diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 397a106a4574..b398bfcb87c6 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -15,7 +15,7 @@ For more detailed information on contribution please read our [beginners guide]( ## Contribution requirements -1. Contributions must adhere to the [Magento coding standards](https://devdocs.magento.com/guides/v2.3/coding-standards/bk-coding-standards.html). +1. Contributions must adhere to the [Magento coding standards](https://devdocs.magento.com/guides/v2.4/coding-standards/bk-coding-standards.html). 2. Pull requests (PRs) must be accompanied by a meaningful description of their purpose. Comprehensive descriptions increase the chances of a pull request being merged quickly and without additional clarification requests. 3. Commits must be accompanied by meaningful commit messages. Please see the [Magento Pull Request Template](https://github.com/magento/magento2/blob/2.3-develop/.github/PULL_REQUEST_TEMPLATE.md) for more information. 4. PRs which include bug fixes must be accompanied with a step-by-step description of how to reproduce the bug. @@ -33,7 +33,7 @@ This will allow you to collaborate with the Magento 2 development team, fork the 1. Search current [listed issues](https://github.com/magento/magento2/issues) (open or closed) for similar proposals of intended contribution before starting work on a new contribution. 2. Review the [Contributor License Agreement](https://opensource.adobe.com/cla.html) if this is your first time contributing. 3. Create and test your work. -4. Fork the Magento 2 repository according to the [Fork A Repository instructions](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#fork) and when you are ready to send us a pull request – follow the [Create A Pull Request instructions](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#pull_request). +4. Fork the Magento 2 repository according to the [Fork A Repository instructions](https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#fork) and when you are ready to send us a pull request – follow the [Create A Pull Request instructions](https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#pull_request). 5. Once your contribution is received the Magento 2 development team will review the contribution and collaborate with you as needed. ## Code of Conduct diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index e4633e187480..a0b3d4628669 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -34,7 +34,7 @@ Important: Provide a set of clear steps to reproduce this bug. We can not provid 2. --- -Please provide [Severity](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#backlog) assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes. +Please provide [Severity](https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#backlog) assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes. - [ ] Severity: **S0** _- Affects critical data or functionality and leaves users without workaround._ - [ ] Severity: **S1** _- Affects critical data or functionality and forces users to employ a workaround._ diff --git a/.github/ISSUE_TEMPLATE/developer-experience-issue.md b/.github/ISSUE_TEMPLATE/developer-experience-issue.md index db5fca78965d..332e069f7006 100644 --- a/.github/ISSUE_TEMPLATE/developer-experience-issue.md +++ b/.github/ISSUE_TEMPLATE/developer-experience-issue.md @@ -20,7 +20,7 @@ Fields marked with (*) are required. Please don't remove the template. --- -Please provide [Severity](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#backlog) assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes. +Please provide [Severity](https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#backlog) assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes. - [ ] Severity: **S0** _- Affects critical data or functionality and leaves users with no workaround._ - [ ] Severity: **S1** _- Affects critical data or functionality and forces users to employ a workaround._ diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 2856223c5ed1..fd2f7f1badc2 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -43,4 +43,5 @@ - [ ] Pull request has a meaningful description of its purpose - [ ] All commits are accompanied by meaningful commit messages - [ ] All new or changed code is covered with unit/integration tests (if applicable) + - [ ] README.md files for modified modules are updated and included in the pull request if any [README.md predefined sections](https://github.com/magento/devdocs/wiki/Magento-module-README.md) require an update - [ ] All automated tests passed successfully (all builds are green) diff --git a/.github/stale.yml b/.github/stale.yml index 0b9283fde06c..2eed13d30e12 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -1,11 +1,11 @@ # Configuration for probot-stale - https://github.com/probot/stale # Number of days of inactivity before an Issue or Pull Request becomes stale -daysUntilStale: 76 +daysUntilStale: 152 # Number of days of inactivity before an Issue or Pull Request with the stale label is closed. # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. -daysUntilClose: 14 +daysUntilClose: 28 # Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) onlyLabels: [] @@ -15,6 +15,8 @@ exemptLabels: - "Priority: P0" - "Priority: P1" - "Priority: P2" + - "Severity: S0" + - "Severity: S1" - "Progress: dev in progress" - "Progress: PR in progress" - "Progress: done" @@ -39,8 +41,9 @@ staleLabel: "stale issue" # Comment to post when marking as stale. Set to `false` to disable markComment: > This issue has been automatically marked as stale because it has not had - recent activity. It will be closed after 14 days if no further activity occurs. Thank you - for your contributions. + recent activity. It will be closed after 28 days if no further activity occurs. + Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? + Thank you for your contributions! # Comment to post when removing the stale label. # unmarkComment: > # Your comment here. diff --git a/README.md b/README.md index 7b959edb4ef7..ef928a19d2fc 100644 --- a/README.md +++ b/README.md @@ -15,50 +15,55 @@

-## Welcome +# Welcome + Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results. ## Magento System Requirements -[Magento System Requirements](https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements.html). + +* [Magento System Requirements](https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html) ## Install Magento -* [Installation Guide](https://devdocs.magento.com/guides/v2.3/install-gde/bk-install-guide.html). +* [Installation Guide](https://devdocs.magento.com/guides/v2.4/install-gde/bk-install-guide.html) + +## Learn About GraphQL in Magento 2 -## Learn More About GraphQL in Magento 2 +* [GraphQL Developer Guide](https://devdocs.magento.com/guides/v2.4/graphql/index.html) -* [GraphQL Developer Guide](https://devdocs.magento.com/guides/v2.3/graphql/index.html) +## Contributing to the Magento 2 Code Base -

Contributing to the Magento 2 Code Base

Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes, optimizations, or just good suggestions. To learn about how to contribute, click [here][1]. -To learn about issues, click [here][2]. To open an issue, click [here][3]. +To learn about issues, click [here][2]. + +To open an issue, click [here][3]. To suggest documentation improvements, click [here][4]. -[1]: https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html -[2]: https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#report +[1]: https://devdocs.magento.com/contributor-guide/contributing.html +[2]: https://devdocs.magento.com/contributor-guide/contributing.html#report [3]: https://github.com/magento/magento2/issues [4]: https://devdocs.magento.com -

Community Maintainers

+### Community Maintainers + The members of this team have been recognized for their outstanding commitment to maintaining and improving Magento. Magento has granted them permission to accept, merge, and reject pull requests, as well as review issues, and thanks to these Community Maintainers for their valuable contributions. - - - +[![](https://raw.githubusercontent.com/wiki/magento/magento2/images/maintainers.png)](https://magento.com/magento-contributors#maintainers) + +### Top Contributors -

Top Contributors

Magento is thankful for any contribution that can improve our codebase, documentation or increase test coverage. We always recognize our most active members, as their contributions are the foundation of the Magento Open Source platform. - - - + +[![](https://raw.githubusercontent.com/wiki/magento/magento2/images/contributors.png)](https://magento.com/magento-contributors) ### Labels Applied by the Magento Team + We apply labels to public Pull Requests and Issues to help other participants retrieve additional information about current progress, component assignments, Magento release lines, and much more. -Please review the [Code Contributions guide](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#labels) for detailed information on labels used in Magento 2 repositories. +Please review the [Code Contributions guide](https://devdocs.magento.com/contributor-guide/contributing.html#labels) for detailed information on labels used in Magento 2 repositories. ## Reporting Security Issues @@ -71,18 +76,17 @@ Stay up-to-date on the latest security news and patches for Magento by signing u Each Magento source file included in this distribution is licensed under OSL 3.0 or the Magento Enterprise Edition (MEE) license. [Open Software License (OSL 3.0)](https://opensource.org/licenses/osl-3.0.php). -Please see [LICENSE.txt](https://github.com/magento/magento2/blob/2.3-develop/LICENSE.txt) for the full text of the OSL 3.0 license or contact license@magentocommerce.com for a copy. +Please see [LICENSE.txt](https://github.com/magento/magento2/blob/2.4-develop/LICENSE.txt) for the full text of the OSL 3.0 license or contact license@magentocommerce.com for a copy. Subject to Licensee's payment of fees and compliance with the terms and conditions of the MEE License, the MEE License supersedes the OSL 3.0 license for each source file. -Please see LICENSE_EE.txt for the full text of the MEE License or visit https://magento.com/legal/terms/enterprise. +Please see LICENSE_EE.txt for the full text of the MEE License or visit . ## Community Engineering Slack To connect with Magento and the Community, join us on the [Magento Community Engineering Slack](https://magentocommeng.slack.com). If you are interested in joining Slack, or a specific channel, send us a request at [engcom@adobe.com](mailto:engcom@adobe.com) or [self signup](https://opensource.magento.com/slack). - We have channels for each project. These channels are recommended for new members: -- [general](https://magentocommeng.slack.com/messages/C4YS78WE6): Open chat for introductions and Magento 2 questions -- [github](https://magentocommeng.slack.com/messages/C7KB93M32): Support for GitHub issues, pull requests, and processes -- [public-backlog](https://magentocommeng.slack.com/messages/CCV3J3RV5): Discussions of the Magento 2 backlog +* [general](https://magentocommeng.slack.com/archives/C4YS78WE6): Open chat for introductions and Magento 2 questions +* [github](https://magentocommeng.slack.com/archives/C7KB93M32): Support for GitHub issues, pull requests, and processes +* [public-backlog](https://magentocommeng.slack.com/archives/CCV3J3RV5): Discussions of the Magento 2 backlog diff --git a/app/code/Magento/AdminAnalytics/etc/csp_whitelist.xml b/app/code/Magento/AdminAnalytics/etc/csp_whitelist.xml index f16a66aa090e..b0e613ffabce 100644 --- a/app/code/Magento/AdminAnalytics/etc/csp_whitelist.xml +++ b/app/code/Magento/AdminAnalytics/etc/csp_whitelist.xml @@ -11,6 +11,12 @@ assets.adobedtm.com + *.adobe.com + + + + + *.adobe.com @@ -19,6 +25,7 @@ amcglobal.sc.omtrdc.net dpm.demdex.net cm.everesttech.net + *.adobe.com @@ -27,9 +34,15 @@ amcglobal.sc.omtrdc.net + + + *.adobe.com + + fast.amc.demdex.net + *.adobe.com diff --git a/app/code/Magento/AdminAnalytics/view/adminhtml/ui_component/admin_usage_notification.xml b/app/code/Magento/AdminAnalytics/view/adminhtml/ui_component/admin_usage_notification.xml index fcd1c4ebbbcd..be832ea35392 100644 --- a/app/code/Magento/AdminAnalytics/view/adminhtml/ui_component/admin_usage_notification.xml +++ b/app/code/Magento/AdminAnalytics/view/adminhtml/ui_component/admin_usage_notification.xml @@ -85,7 +85,7 @@ Help us improve Magento Admin by allowing us to collect usage data.

All usage data that we collect for this purpose cannot be used to individually identify you and is used only to improve the Magento Admin and related products and services.

-

You can learn more and opt out at any time by following the instructions in merchant documentation.

+

You can learn more and opt out at any time by following the instructions in merchant documentation.

]]>
diff --git a/app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php b/app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php index f7374a961bc8..e2aad39b77ad 100644 --- a/app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php +++ b/app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php @@ -101,6 +101,8 @@ protected function _getConfigUrl() */ public function getIdentity() { + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction return md5('BASE_URL' . $this->_getConfigUrl()); } diff --git a/app/code/Magento/AdminNotification/Model/System/Message/CacheOutdated.php b/app/code/Magento/AdminNotification/Model/System/Message/CacheOutdated.php index c4884ee840ba..7ec613d367a1 100644 --- a/app/code/Magento/AdminNotification/Model/System/Message/CacheOutdated.php +++ b/app/code/Magento/AdminNotification/Model/System/Message/CacheOutdated.php @@ -62,6 +62,8 @@ protected function _getCacheTypesForRefresh() */ public function getIdentity() { + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction return md5('cache' . implode(':', $this->_getCacheTypesForRefresh())); } diff --git a/app/code/Magento/AdminNotification/README.md b/app/code/Magento/AdminNotification/README.md index c22fef1bca97..2967aa9ac60b 100644 --- a/app/code/Magento/AdminNotification/README.md +++ b/app/code/Magento/AdminNotification/README.md @@ -5,24 +5,25 @@ The Magento_AdminNotification module provides the ability to alert administrator ## Installation details The Magento_AdminNotification module creates the following tables in the database: + - `adminnotification_inbox` - `admin_system_messages` Before disabling or uninstalling this module, note that the Magento_Indexer module depends on this module. -For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html). +For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Extensibility -Extension developers can interact with the Magento_AdminNotification module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_AdminNotification module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AdminNotification module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AdminNotification module. ### Events This module observes the following events: - - `controller_action_predispatch` event in `Magento\AdminNotification\Observer\PredispatchAdminActionControllerObserver` file. +- `controller_action_predispatch` event in `Magento\AdminNotification\Observer\PredispatchAdminActionControllerObserver` file. ### Layouts @@ -31,10 +32,10 @@ This module introduces the following layouts and layout handles in the `view/adm - `adminhtml_notification_index` - `adminhtml_notification_block` -For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html). +For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). ### UI components You can extend admin notifications using the `view/adminhtml/ui_component/notification_area.xml` configuration file. -For information about UI components in Magento 2, see [Overview of UI components](https://devdocs.magento.com/guides/v2.3/ui_comp_guide/bk-ui_comps.html). +For information about UI components in Magento 2, see [Overview of UI components](https://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). diff --git a/app/code/Magento/AdminNotification/view/adminhtml/web/js/grid/columns/message.js b/app/code/Magento/AdminNotification/view/adminhtml/web/js/grid/columns/message.js index 6c67f7463d9d..6e8ae634002f 100644 --- a/app/code/Magento/AdminNotification/view/adminhtml/web/js/grid/columns/message.js +++ b/app/code/Magento/AdminNotification/view/adminhtml/web/js/grid/columns/message.js @@ -36,6 +36,16 @@ define([ return record[this.messageIndex]; }, + /** + * Proxy to getLabel function with UnsanitizedHtml suffix + * + * @param {Object} record + * @returns {String} + */ + getLabelUnsanitizedHtml: function (record) { + return this.getLabel(record); + }, + /** @inheritdoc */ getFieldClass: function ($row) { var status = this.statusMap[$row.status] || 'warning', diff --git a/app/code/Magento/AdminNotification/view/adminhtml/web/template/grid/cells/message.html b/app/code/Magento/AdminNotification/view/adminhtml/web/template/grid/cells/message.html index fbde33927423..86bf83775ef1 100644 --- a/app/code/Magento/AdminNotification/view/adminhtml/web/template/grid/cells/message.html +++ b/app/code/Magento/AdminNotification/view/adminhtml/web/template/grid/cells/message.html @@ -5,4 +5,4 @@ */ -->
+ html="$col.getLabelUnsanitizedHtml($row())">
diff --git a/app/code/Magento/AdvancedPricingImportExport/Model/CurrencyResolver.php b/app/code/Magento/AdvancedPricingImportExport/Model/CurrencyResolver.php new file mode 100644 index 000000000000..9f930d124fa8 --- /dev/null +++ b/app/code/Magento/AdvancedPricingImportExport/Model/CurrencyResolver.php @@ -0,0 +1,82 @@ +storeManager = $storeManager; + $this->directoryData = $directoryData; + } + + /** + * Get base currency for all websites + * + * @return array associative array with website code as the key and base currency as the value + */ + public function getWebsitesBaseCurrency(): array + { + if ($this->websitesBaseCurrency === null) { + $this->websitesBaseCurrency = []; + foreach ($this->storeManager->getWebsites() as $website) { + $this->websitesBaseCurrency[$website->getCode()] = $website->getBaseCurrencyCode(); + } + } + + return $this->websitesBaseCurrency; + } + + /** + * Get default scope base currency + * + * @return string + */ + public function getDefaultBaseCurrency(): string + { + if ($this->defaultBaseCurrency === null) { + $this->defaultBaseCurrency = $this->directoryData->getBaseCurrencyCode(); + } + + return $this->defaultBaseCurrency; + } +} diff --git a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php index 254dbcca852e..30b2535853e3 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php +++ b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php @@ -5,8 +5,10 @@ */ namespace Magento\AdvancedPricingImportExport\Model\Import; +use Magento\AdvancedPricingImportExport\Model\CurrencyResolver; use Magento\CatalogImportExport\Model\Import\Product as ImportProduct; use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface as ValidatorInterface; +use Magento\Framework\App\ObjectManager; use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; /** @@ -15,6 +17,7 @@ * @SuppressWarnings(PHPMD.ExcessiveParameterList) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.TooManyFields) + * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) */ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity { @@ -42,6 +45,8 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract private const VALIDATOR_TEAR_PRICE = 'validator_tier_price'; private const VALIDATOR_TIER_PRICE = 'validator_tier_price'; + private const ERROR_DUPLICATE_TIER_PRICE = 'duplicateTierPrice'; + /** * Validation failure message template definitions. * @@ -57,8 +62,10 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract ValidatorInterface::ERROR_INVALID_TIER_PRICE_TYPE => 'Value for \'tier_price_value_type\' ' . 'attribute contains incorrect value, acceptable values are Fixed, Discount', ValidatorInterface::ERROR_TIER_DATA_INCOMPLETE => 'Tier Price data is incomplete', - ValidatorInterface::ERROR_INVALID_ATTRIBUTE_DECIMAL => - 'Value for \'%s\' attribute contains incorrect value, acceptable values are in decimal format', + ValidatorInterface::ERROR_INVALID_ATTRIBUTE_DECIMAL => 'Value for \'%s\' attribute contains incorrect value,' . + ' acceptable values are in decimal format', + self::ERROR_DUPLICATE_TIER_PRICE => 'We found a duplicate website, tier price, customer group' . + ' and quantity.' ]; /** @@ -155,6 +162,26 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract */ private $productEntityLinkField; + /** + * @var array + */ + private $websiteScopeTierPrice = []; + + /** + * @var array + */ + private $globalScopeTierPrice = []; + + /** + * @var array + */ + private $allProductIds = []; + + /** + * @var CurrencyResolver + */ + private $currencyResolver; + /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @param \Magento\Framework\Json\Helper\Data $jsonHelper @@ -172,8 +199,9 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract * @param AdvancedPricing\Validator $validator * @param AdvancedPricing\Validator\Website $websiteValidator * @param AdvancedPricing\Validator\TierPrice $tierPriceValidator - * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * @param CurrencyResolver|null $currencyResolver * @throws \Exception + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( \Magento\Framework\Json\Helper\Data $jsonHelper, @@ -190,7 +218,8 @@ public function __construct( ImportProduct $importProduct, AdvancedPricing\Validator $validator, AdvancedPricing\Validator\Website $websiteValidator, - AdvancedPricing\Validator\TierPrice $tierPriceValidator + AdvancedPricing\Validator\TierPrice $tierPriceValidator, + ?CurrencyResolver $currencyResolver = null ) { $this->dateTime = $dateTime; $this->jsonHelper = $jsonHelper; @@ -209,6 +238,7 @@ public function __construct( $this->_validators[self::VALIDATOR_WEBSITE] = $websiteValidator; $this->_validators[self::VALIDATOR_TIER_PRICE] = $tierPriceValidator; $this->errorAggregator = $errorAggregator; + $this->currencyResolver = $currencyResolver ?? ObjectManager::getInstance()->get(CurrencyResolver::class); foreach (array_merge($this->errorMessageTemplates, $this->_messageTemplates) as $errorCode => $message) { $this->getErrorAggregator()->addErrorMessageTemplate($errorCode, $message); @@ -270,6 +300,11 @@ public function validateRow(array $rowData, $rowNum) if (false === $sku) { $this->addRowError(ValidatorInterface::ERROR_ROW_IS_ORPHAN, $rowNum); } + + if (!$this->getErrorAggregator()->isRowInvalid($rowNum)) { + $this->validateRowForDuplicate($rowData, $rowNum); + } + return !$this->getErrorAggregator()->isRowInvalid($rowNum); } @@ -634,4 +669,160 @@ private function getProductEntityLinkField() } return $this->productEntityLinkField; } + + /** + * @inheritdoc + */ + protected function _saveValidatedBunches() + { + if (\Magento\ImportExport\Model\Import::BEHAVIOR_APPEND === $this->getBehavior() + && !$this->_catalogData->isPriceGlobal() + ) { + $source = $this->_getSource(); + $source->rewind(); + while ($source->valid()) { + try { + $rowData = $source->current(); + } catch (\InvalidArgumentException $exception) { + $source->next(); + continue; + } + $this->validateRow($rowData, $source->key()); + $source->next(); + } + $this->validateRowsForDuplicate(self::TABLE_TIER_PRICE); + } + return parent::_saveValidatedBunches(); + } + + /** + * Validate all row data with existing prices in the database for duplicate + * + * A row is considered a duplicate if the pair (product_id, all_groups, customer_group_id, qty) exists for + * both global and website scopes. And the base currency is the same for both global and website scopes. + * + * @param string $table + */ + private function validateRowsForDuplicate(string $table): void + { + if (!empty($this->allProductIds)) { + $priceDataCollection = $this->getPrices(array_keys($this->allProductIds), $table); + $defaultBaseCurrency = $this->currencyResolver->getDefaultBaseCurrency(); + $websiteCodeBaseCurrencyMap = $this->currencyResolver->getWebsitesBaseCurrency(); + $websiteIdCodeMap = array_flip($this->_storeResolver->getWebsiteCodeToId()); + foreach ($priceDataCollection as $priceData) { + $isDefaultScope = (int) $priceData['website_id'] === 0; + $baseCurrency = $isDefaultScope + ? $defaultBaseCurrency + : $websiteCodeBaseCurrencyMap[$websiteIdCodeMap[$priceData['website_id']] ?? null] ?? null; + $rowNums = []; + $key = $this->getUniqueKey($priceData, $baseCurrency); + if ($isDefaultScope) { + if (isset($this->websiteScopeTierPrice[$key])) { + $rowNums = $this->websiteScopeTierPrice[$key]; + } + } else { + if (isset($this->globalScopeTierPrice[$key])) { + $rowNums = $this->globalScopeTierPrice[$key]; + } + } + foreach ($rowNums as $rowNum) { + $this->addRowError(self::ERROR_DUPLICATE_TIER_PRICE, $rowNum); + } + } + } + } + + /** + * Validate row data for duplicate + * + * A row is considered a duplicate if the pair (product_id, all_groups, customer_group_id, qty) exists for + * both global and website scopes. And the base currency is the same for both global and website scopes. + * + * @param array $rowData + * @param int $rowNum + */ + private function validateRowForDuplicate(array $rowData, int $rowNum) + { + $productId = $this->retrieveOldSkus()[$rowData[self::COL_SKU]] ?? null; + if ($productId && !$this->_catalogData->isPriceGlobal()) { + $productEntityLinkField = $this->getProductEntityLinkField(); + $priceData = [ + $productEntityLinkField => $productId, + 'website_id' => (int) $this->getWebSiteId($rowData[self::COL_TIER_PRICE_WEBSITE]), + 'all_groups' => $rowData[self::COL_TIER_PRICE_CUSTOMER_GROUP] == self::VALUE_ALL_GROUPS ? 1 : 0, + 'customer_group_id' => $this->getCustomerGroupId($rowData[self::COL_TIER_PRICE_CUSTOMER_GROUP]), + 'qty' => $rowData[self::COL_TIER_PRICE_QTY], + ]; + $defaultBaseCurrency = $this->currencyResolver->getDefaultBaseCurrency(); + $websiteCodeBaseCurrencyMap = $this->currencyResolver->getWebsitesBaseCurrency(); + $websiteIdCodeMap = array_flip($this->_storeResolver->getWebsiteCodeToId()); + $baseCurrency = $priceData['website_id'] === 0 + ? $defaultBaseCurrency + : $websiteCodeBaseCurrencyMap[$websiteIdCodeMap[$priceData['website_id']] ?? null] ?? null; + + $this->allProductIds[$productId][] = $rowNum; + $key = $this->getUniqueKey($priceData, $baseCurrency); + if ($priceData['website_id'] === 0) { + $this->globalScopeTierPrice[$key][] = $rowNum; + if (isset($this->websiteScopeTierPrice[$key])) { + $this->addRowError(self::ERROR_DUPLICATE_TIER_PRICE, $rowNum); + } + } else { + $this->websiteScopeTierPrice[$key][] = $rowNum; + if (isset($this->globalScopeTierPrice[$key])) { + $this->addRowError(self::ERROR_DUPLICATE_TIER_PRICE, $rowNum); + } + } + } + } + + /** + * Get the unique key of provided price + * + * @param array $priceData + * @param string $baseCurrency + * @return string + */ + private function getUniqueKey(array $priceData, string $baseCurrency): string + { + $productEntityLinkField = $this->getProductEntityLinkField(); + return sprintf( + '%s-%s-%s-%s-%.4f', + $baseCurrency, + $priceData[$productEntityLinkField], + $priceData['all_groups'], + $priceData['customer_group_id'], + $priceData['qty'] + ); + } + + /** + * Get existing prices in the database + * + * @param int[] $productIds + * @param string $table + * @return array + */ + private function getPrices(array $productIds, string $table) + { + $productEntityLinkField = $this->getProductEntityLinkField(); + return $this->_connection->fetchAll( + $this->_connection->select() + ->from( + $this->_resourceFactory->create()->getTable($table), + [ + $productEntityLinkField, + 'all_groups', + 'customer_group_id', + 'qty', + 'website_id' + ] + ) + ->where( + $productEntityLinkField . ' IN (?)', + $productIds + ) + ); + } } diff --git a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator/Website.php b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator/Website.php index 93c63dcbcab2..5b749ccee837 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator/Website.php +++ b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator/Website.php @@ -8,10 +8,12 @@ namespace Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing\Validator; +use Magento\AdvancedPricingImportExport\Model\CurrencyResolver; use Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing; use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface; use Magento\CatalogImportExport\Model\Import\Product\StoreResolver; use Magento\CatalogImportExport\Model\Import\Product\Validator\AbstractImportValidator; +use Magento\Framework\App\ObjectManager; use Magento\Store\Model\Website as WebsiteModel; class Website extends AbstractImportValidator implements RowValidatorInterface @@ -26,16 +28,24 @@ class Website extends AbstractImportValidator implements RowValidatorInterface */ protected $websiteModel; + /** + * @var CurrencyResolver + */ + private $currencyResolver; + /** * @param StoreResolver $storeResolver * @param WebsiteModel $websiteModel + * @param CurrencyResolver|null $currencyResolver */ public function __construct( StoreResolver $storeResolver, - WebsiteModel $websiteModel + WebsiteModel $websiteModel, + ?CurrencyResolver $currencyResolver = null ) { $this->storeResolver = $storeResolver; $this->websiteModel = $websiteModel; + $this->currencyResolver = $currencyResolver ?? ObjectManager::getInstance()->get(CurrencyResolver::class); } /** @@ -85,6 +95,6 @@ public function isValid($value) public function getAllWebsitesValue() { return AdvancedPricing::VALUE_ALL_WEBSITES . - ' [' . $this->websiteModel->getBaseCurrency()->getCurrencyCode() . ']'; + ' [' . $this->currencyResolver->getDefaultBaseCurrency() . ']'; } } diff --git a/app/code/Magento/AdvancedPricingImportExport/README.md b/app/code/Magento/AdvancedPricingImportExport/README.md index 8f33781932f9..b389eabb341a 100644 --- a/app/code/Magento/AdvancedPricingImportExport/README.md +++ b/app/code/Magento/AdvancedPricingImportExport/README.md @@ -4,6 +4,6 @@ The Magento_AdvancedPricingImportExport module handles the import and export of ## Extensibility -Extension developers can interact with the Magento_AdvancedPricingImportExport module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_AdvancedPricingImportExport module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AdvancedPricingImportExport module. \ No newline at end of file +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AdvancedPricingImportExport module. diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/CurrencyResolverTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/CurrencyResolverTest.php new file mode 100644 index 000000000000..eebe783c517d --- /dev/null +++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/CurrencyResolverTest.php @@ -0,0 +1,88 @@ +storeManager = $this->createMock(StoreManagerInterface::class); + $this->directoryData = $this->createMock(DirectoryData::class); + $this->model = new CurrencyResolver( + $this->storeManager, + $this->directoryData, + ); + } + + /** + * Test that the result of getWebsitesBaseCurrency() should be cached + */ + public function testShouldCacheResultOfGetWebsitesBaseCurrency(): void + { + $expected = [ + 'base' => 'EUR', + 'england' => 'GBP', + ]; + $websites = []; + foreach ($expected as $websiteCode => $currencyCode) { + $websites[] = $this->createConfiguredMock( + Website::class, + [ + 'getCode' => $websiteCode, + 'getBaseCurrencyCode' => $currencyCode + ] + ); + } + $this->storeManager->expects($this->once()) + ->method('getWebsites') + ->willReturn($websites); + $this->assertEquals($expected, $this->model->getWebsitesBaseCurrency()); + $this->assertEquals($expected, $this->model->getWebsitesBaseCurrency()); + } + + /** + * Test that the result of getDefaultBaseCurrency() should be cached + */ + public function testShouldCacheResultOfGetDefaultBaseCurrency(): void + { + $expected = 'USD'; + $this->directoryData->expects($this->once()) + ->method('getBaseCurrencyCode') + ->willReturn($expected); + $this->assertEquals($expected, $this->model->getDefaultBaseCurrency()); + $this->assertEquals($expected, $this->model->getDefaultBaseCurrency()); + } +} diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php index 1a0b2b35ce0f..f870f80f657b 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php +++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php @@ -7,10 +7,10 @@ namespace Magento\AdvancedPricingImportExport\Test\Unit\Model\Import\AdvancedPricing\Validator; +use Magento\AdvancedPricingImportExport\Model\CurrencyResolver; use Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing as AdvancedPricing; use Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing\Validator\Website as WebsiteValidator; use Magento\CatalogImportExport\Model\Import\Product\StoreResolver; -use Magento\Directory\Model\Currency; use Magento\Store\Model\Website; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -32,6 +32,11 @@ class WebsiteTest extends TestCase */ protected $website; + /** + * @var CurrencyResolver|MockObject + */ + private $currencyResolver; + protected function setUp(): void { $this->webSiteModel = $this->getMockBuilder(Website::class) @@ -43,11 +48,16 @@ protected function setUp(): void ['getWebsiteCodeToId'] ); + $this->currencyResolver = $this->createPartialMock( + CurrencyResolver::class, + ['getDefaultBaseCurrency'] + ); + $this->website = $this->getMockBuilder( WebsiteValidator::class ) ->setMethods(['getAllWebsitesValue', '_clearMessages', '_addMessages']) - ->setConstructorArgs([$this->storeResolver, $this->webSiteModel]) + ->setConstructorArgs([$this->storeResolver, $this->webSiteModel, $this->currencyResolver]) ->getMock(); } @@ -104,17 +114,15 @@ public function testIsValidReturnAddMessagesCall() public function testGetAllWebsitesValue() { $currencyCode = 'currencyCodeValue'; - $currency = $this->createPartialMock(Currency::class, ['getCurrencyCode']); - $currency->expects($this->once())->method('getCurrencyCode')->willReturn($currencyCode); - $this->webSiteModel->expects($this->once())->method('getBaseCurrency')->willReturn($currency); + $this->currencyResolver->expects($this->once())->method('getDefaultBaseCurrency')->willReturn($currencyCode); $expectedResult = AdvancedPricing::VALUE_ALL_WEBSITES . ' [' . $currencyCode . ']'; $websiteString = $this->getMockBuilder( WebsiteValidator::class ) ->setMethods(['_clearMessages', '_addMessages']) - ->setConstructorArgs([$this->storeResolver, $this->webSiteModel]) + ->setConstructorArgs([$this->storeResolver, $this->webSiteModel, $this->currencyResolver]) ->getMock(); $result = $websiteString->getAllWebsitesValue(); diff --git a/app/code/Magento/AdvancedPricingImportExport/composer.json b/app/code/Magento/AdvancedPricingImportExport/composer.json index ea6a39fba2c3..0f9106ec435d 100644 --- a/app/code/Magento/AdvancedPricingImportExport/composer.json +++ b/app/code/Magento/AdvancedPricingImportExport/composer.json @@ -13,7 +13,8 @@ "magento/module-customer": "*", "magento/module-eav": "*", "magento/module-import-export": "*", - "magento/module-store": "*" + "magento/module-store": "*", + "magento/module-directory": "*" }, "type": "magento2-module", "license": [ diff --git a/app/code/Magento/AdvancedSearch/README.md b/app/code/Magento/AdvancedSearch/README.md index 999721fca1c8..accbca83b57e 100644 --- a/app/code/Magento/AdvancedSearch/README.md +++ b/app/code/Magento/AdvancedSearch/README.md @@ -1,27 +1,29 @@ # Magento_AdvancedSearch module + The Magento_AdvancedSearch module introduces advanced search functionality and provides interfaces that allow third-party search engines to implement this functionality. ## Installation details Before disabling or uninstalling this module, note that the following modules depends on this module: + - Magento_Elasticsearch - Magento_Elasticsearch6 -For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html). +For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Extensibility -Extension developers can interact with the Magento_AdvancedSearch module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_AdvancedSearch module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AdvancedSearch module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AdvancedSearch module. ### Events This module observes the following event: - - `catalogsearch_query_save_after` in the `Magento\AdvancedSearch\Model\Recommendations\SaveSearchQueryRelationsObserver` file. +- `catalogsearch_query_save_after` in the `Magento\AdvancedSearch\Model\Recommendations\SaveSearchQueryRelationsObserver` file. -For information about an event in Magento 2, see [Events and observers](http://devdocs.magento.com/guides/v2.3/extension-dev-guide/events-and-observers.html#events). +For information about an event in Magento 2, see [Events and observers](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). ### Layouts @@ -35,4 +37,4 @@ The module interacts with the following layout handles in the `view/frontend/lay - `catalogsearch_result_index` -For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html). \ No newline at end of file +For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). diff --git a/app/code/Magento/Amqp/README.md b/app/code/Magento/Amqp/README.md index 3613421aacbd..6a47a072390a 100644 --- a/app/code/Magento/Amqp/README.md +++ b/app/code/Magento/Amqp/README.md @@ -4,6 +4,6 @@ Magento_Amqp module provides functionality to publish/consume messages with the ## Extensibility -Extension developers can interact with the Magento_Amqp module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_Amqp module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Amqp module. \ No newline at end of file +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Amqp module. diff --git a/app/code/Magento/AmqpStore/README.md b/app/code/Magento/AmqpStore/README.md index 88459a495401..202c1982620e 100644 --- a/app/code/Magento/AmqpStore/README.md +++ b/app/code/Magento/AmqpStore/README.md @@ -4,6 +4,6 @@ The Magento_AmqpStore module provides the ability to specify a store before publ ## Extensibility -Extension developers can interact with the Magento_AmqpStore module using plugins. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_AmqpStore module using plugins. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AmqpStore module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AmqpStore module. diff --git a/app/code/Magento/Analytics/README.md b/app/code/Magento/Analytics/README.md index 7ec30c6dd484..454ae72d1fd4 100644 --- a/app/code/Magento/Analytics/README.md +++ b/app/code/Magento/Analytics/README.md @@ -1,6 +1,6 @@ # Magento_Analytics module -The Magento_Analytics module integrates your Magento instance with the [Magento Business Intelligence (MBI)](https://magento.com/products/business-intelligence) to use [Advanced Reporting](https://devdocs.magento.com/guides/v2.3/advanced-reporting/modules.html) functionality. +The Magento_Analytics module integrates your Magento instance with the [Magento Business Intelligence (MBI)](https://magento.com/products/business-intelligence) to use [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html) functionality. The module implements the following functionality: @@ -9,13 +9,14 @@ The module implements the following functionality: - Collecting the Magento instance data as reports for MBI - Introducing API that provides the collected data - Extending Magento configuration with the module parameters: - - Subscription status (enabled/disabled) - - Industry (a business area in which the instance website works) - - Time of data collection (time of the day when the module collects data) + - Subscription status (enabled/disabled) + - Industry (a business area in which the instance website works) + - Time of data collection (time of the day when the module collects data) ## Installation details Before disabling or uninstalling this module, note that the following modules depends on this module: + - Magento_CatalogAnalytics - Magento_CustomerAnalytics - Magento_QuoteAnalytics @@ -25,8 +26,8 @@ Before disabling or uninstalling this module, note that the following modules de ## Structure -Beyond the [usual module file structure](https://devdocs.magento.com/guides/v2.3/architecture/archi_perspectives/components/modules/mod_intro.html) the module contains a directory `ReportXml`. -[Report XML](https://devdocs.magento.com/guides/v2.3/advanced-reporting/report-xml.html) is a markup language used to build reports for Advanced Reporting. +Beyond the [usual module file structure](https://devdocs.magento.com/guides/v2.4/architecture/archi_perspectives/components/modules/mod_intro.html) the module contains a directory `ReportXml`. +[Report XML](https://devdocs.magento.com/guides/v2.4/advanced-reporting/report-xml.html) is a markup language used to build reports for Advanced Reporting. The language declares SQL queries using XML declaration. ## Subscription Process @@ -38,12 +39,13 @@ The subscription to the MBI service is enabled during the installation process o Configuration settings for the Analytics module can be modified in the Admin Panel on the Stores > Configuration page under the General > Advanced Reporting tab. The following options can be adjusted: + - Advanced Reporting Service (Enabled/Disabled) - - Alters the status of the Advanced Reporting subscription + - Alters the status of the Advanced Reporting subscription - Time of day to send data (Hour/Minute/Second in the store's time zone) - - Defines when the data collection process for the Advanced Reporting service occurs + - Defines when the data collection process for the Advanced Reporting service occurs - Industry - - Defines the industry of the store in order to create a personalized Advanced Reporting experience + - Defines the industry of the store in order to create a personalized Advanced Reporting experience ## Extensibility diff --git a/app/code/Magento/Analytics/Test/Mftf/Test/AdminAdvancedReportingButtonTest.xml b/app/code/Magento/Analytics/Test/Mftf/Test/AdminAdvancedReportingButtonTest.xml index 9c99041be0df..512ccaef6be9 100644 --- a/app/code/Magento/Analytics/Test/Mftf/Test/AdminAdvancedReportingButtonTest.xml +++ b/app/code/Magento/Analytics/Test/Mftf/Test/AdminAdvancedReportingButtonTest.xml @@ -9,14 +9,12 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - - - <description value="Test log in to AdvancedReporting and tests AdvancedReportingButtonTest"/> - <testCaseId value="MC-14800"/> - <skip> - <issueId value="MC-14800" /> - </skip> + <features value="Analytics"/> + <stories value="Advanced Reporting"/> + <title value="Assert the Advanced Reporting page is opened by dashboard link"/> + <description value="Check the ability to navigate to the Advanced Reporting page through the Advanced Reporting button on the dashboard"/> <severity value="CRITICAL"/> + <testCaseId value="MC-28376"/> <group value="analytics"/> <group value="mtf_migrated"/> </annotations> diff --git a/app/code/Magento/AsynchronousOperations/Model/AccessValidator.php b/app/code/Magento/AsynchronousOperations/Model/AccessValidator.php index a14ec254cf89..6f908a4c5b21 100644 --- a/app/code/Magento/AsynchronousOperations/Model/AccessValidator.php +++ b/app/code/Magento/AsynchronousOperations/Model/AccessValidator.php @@ -55,6 +55,6 @@ public function isAllowed($bulkUuid) $this->bulkSummaryFactory->create(), $bulkUuid ); - return $bulkSummary->getUserId() === $this->userContext->getUserId(); + return ((int) $bulkSummary->getUserId()) === ((int) $this->userContext->getUserId()); } } diff --git a/app/code/Magento/AsynchronousOperations/Model/ResourceModel/System/Message/Collection/Synchronized/Plugin.php b/app/code/Magento/AsynchronousOperations/Model/ResourceModel/System/Message/Collection/Synchronized/Plugin.php index 8457a641ed9a..bd357e101328 100644 --- a/app/code/Magento/AsynchronousOperations/Model/ResourceModel/System/Message/Collection/Synchronized/Plugin.php +++ b/app/code/Magento/AsynchronousOperations/Model/ResourceModel/System/Message/Collection/Synchronized/Plugin.php @@ -108,6 +108,8 @@ public function afterToArray( 'data' => [ 'text' => __('Task "%1": ', $bulk->getDescription()) . $text, 'severity' => \Magento\Framework\Notification\MessageInterface::SEVERITY_MAJOR, + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction 'identity' => md5('bulk' . $bulkUuid), 'uuid' => $bulkUuid, 'status' => $bulkStatus, diff --git a/app/code/Magento/AsynchronousOperations/README.md b/app/code/Magento/AsynchronousOperations/README.md index 896fddedab5f..cc826d66211c 100644 --- a/app/code/Magento/AsynchronousOperations/README.md +++ b/app/code/Magento/AsynchronousOperations/README.md @@ -12,15 +12,15 @@ The Magento_AsynchronousOperations module creates the following tables in the da Before disabling or uninstalling this module, note that the following modules depends on this module: -- Magento_WebapiAsync +- Magento_WebapiAsync -For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html). +For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Extensibility -Extension developers can interact with the Magento_AsynchronousOperations module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_AsynchronousOperations module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AsynchronousOperations module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AsynchronousOperations module. ### Layouts @@ -30,7 +30,7 @@ This module introduces the following layouts and layout handles in the `view/adm - `bulk_bulk_details_modal` - `bulk_index_index` -For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html). +For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). ### UI components @@ -45,4 +45,4 @@ You can extend Magento_AsynchronousOperations module using the following configu - `retriable_operation_listing` - `retriable_operation_modal_listing` -For information about UI components in Magento 2, see [Overview of UI components](https://devdocs.magento.com/guides/v2.3/ui_comp_guide/bk-ui_comps.html). +For information about UI components in Magento 2, see [Overview of UI components](https://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). diff --git a/app/code/Magento/AsynchronousOperations/etc/db_schema.xml b/app/code/Magento/AsynchronousOperations/etc/db_schema.xml index ab482d2e2c76..0eb0af914ab2 100644 --- a/app/code/Magento/AsynchronousOperations/etc/db_schema.xml +++ b/app/code/Magento/AsynchronousOperations/etc/db_schema.xml @@ -30,6 +30,9 @@ <index referenceId="MAGENTO_BULK_USER_ID_ADMIN_USER_USER_ID" indexType="btree"> <column name="user_id"/> </index> + <index referenceId="MAGENTO_BULK_START_TIME" indexType="btree"> + <column name="start_time"/> + </index> </table> <table name="magento_operation" resource="default" engine="innodb" comment="Operation entity"> <column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true" diff --git a/app/code/Magento/AsynchronousOperations/etc/db_schema_whitelist.json b/app/code/Magento/AsynchronousOperations/etc/db_schema_whitelist.json index 6cbb3c664a50..d76b0b693566 100644 --- a/app/code/Magento/AsynchronousOperations/etc/db_schema_whitelist.json +++ b/app/code/Magento/AsynchronousOperations/etc/db_schema_whitelist.json @@ -11,7 +11,8 @@ }, "index": { "MAGENTO_BULK_USER_ID_ADMIN_USER_USER_ID": true, - "MAGENTO_BULK_USER_ID": true + "MAGENTO_BULK_USER_ID": true, + "MAGENTO_BULK_START_TIME": true }, "constraint": { "PRIMARY": true, diff --git a/app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/form/field.html b/app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/form/field.html index 6cff5e3ca973..dfb975d6a944 100644 --- a/app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/form/field.html +++ b/app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/form/field.html @@ -6,4 +6,4 @@ --> <div css="$data.additionalClasses" if="error" - text="error"/> + text="error"></div> diff --git a/app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/grid/cells/actions.html b/app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/grid/cells/actions.html index 17144a22cd32..bba1278004e5 100644 --- a/app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/grid/cells/actions.html +++ b/app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/grid/cells/actions.html @@ -11,5 +11,5 @@ attr="{ title: $action().label }" - /> + ></button> </div> diff --git a/app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/grid/listing.html b/app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/grid/listing.html index e6559a6ede37..4f7384cb4d2c 100644 --- a/app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/grid/listing.html +++ b/app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/grid/listing.html @@ -31,12 +31,12 @@ <a class="action__message-log" href="#" click="dismissAll" - text="dismissAllText"/> + text="dismissAllText"></a> <a class="action__message-log" attr="{ href: link }" - text="linkText"/> + text="linkText"></a> </div> </div> </div> diff --git a/app/code/Magento/Authorization/Model/CompositeUserContext.php b/app/code/Magento/Authorization/Model/CompositeUserContext.php index 9a6be4d96ef1..149c33f861b3 100644 --- a/app/code/Magento/Authorization/Model/CompositeUserContext.php +++ b/app/code/Magento/Authorization/Model/CompositeUserContext.php @@ -60,7 +60,7 @@ protected function add(UserContextInterface $userContext) */ public function getUserId() { - return $this->getUserContext() ? $this->getUserContext()->getUserId() : null; + return $this->getUserContext() ? ((int) $this->getUserContext()->getUserId()) : null; } /** diff --git a/app/code/Magento/Authorization/Model/Role.php b/app/code/Magento/Authorization/Model/Role.php index 96cf956afd1b..74b84f1a7d31 100644 --- a/app/code/Magento/Authorization/Model/Role.php +++ b/app/code/Magento/Authorization/Model/Role.php @@ -5,28 +5,32 @@ */ namespace Magento\Authorization\Model; +use Magento\Authorization\Model\ResourceModel\Role\Collection; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Model\AbstractModel; + /** * Admin Role Model * * @api * @method int getParentId() - * @method \Magento\Authorization\Model\Role setParentId(int $value) + * @method Role setParentId(int $value) * @method int getTreeLevel() - * @method \Magento\Authorization\Model\Role setTreeLevel(int $value) + * @method Role setTreeLevel(int $value) * @method int getSortOrder() - * @method \Magento\Authorization\Model\Role setSortOrder(int $value) + * @method Role setSortOrder(int $value) * @method string getRoleType() - * @method \Magento\Authorization\Model\Role setRoleType(string $value) + * @method Role setRoleType(string $value) * @method int getUserId() - * @method \Magento\Authorization\Model\Role setUserId(int $value) + * @method Role setUserId(int $value) * @method string getUserType() - * @method \Magento\Authorization\Model\Role setUserType(string $value) + * @method Role setUserType(string $value) * @method string getRoleName() - * @method \Magento\Authorization\Model\Role setRoleName(string $value) + * @method Role setRoleName(string $value) * @api * @since 100.0.2 */ -class Role extends \Magento\Framework\Model\AbstractModel +class Role extends AbstractModel { /** * @var string @@ -38,23 +42,6 @@ class Role extends \Magento\Framework\Model\AbstractModel */ protected $_cacheTag = 'user_assigned_role'; - /** - * @param \Magento\Framework\Model\Context $context - * @param \Magento\Framework\Registry $registry - * @param \Magento\Authorization\Model\ResourceModel\Role $resource - * @param \Magento\Authorization\Model\ResourceModel\Role\Collection $resourceCollection - * @param array $data - */ - public function __construct( //phpcs:ignore Generic.CodeAnalysis.UselessOverridingMethod - \Magento\Framework\Model\Context $context, - \Magento\Framework\Registry $registry, - \Magento\Authorization\Model\ResourceModel\Role $resource, - \Magento\Authorization\Model\ResourceModel\Role\Collection $resourceCollection, - array $data = [] - ) { - parent::__construct($context, $registry, $resource, $resourceCollection, $data); - } - /** * @inheritDoc */ @@ -70,31 +57,30 @@ public function __sleep() public function __wakeup() { parent::__wakeup(); - $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); - $this->_resource = $objectManager->get(\Magento\Authorization\Model\ResourceModel\Role::class); - $this->_resourceCollection = $objectManager->get( - \Magento\Authorization\Model\ResourceModel\Role\Collection::class - ); + $objectManager = ObjectManager::getInstance(); + $this->_resource = $objectManager->get(ResourceModel\Role::class); + $this->_resourceCollection = $objectManager->get(Collection::class); } /** - * Class constructor - * - * @return void + * @inheritdoc */ protected function _construct() { - $this->_init(\Magento\Authorization\Model\ResourceModel\Role::class); + $this->_init(ResourceModel\Role::class); } /** - * Update object into database + * Obsolete method of update * * @return $this + * @deprecated Method was never implemented and used. */ public function update() { - $this->getResource()->update($this); + // phpcs:disable Magento2.Functions.DiscouragedFunction + trigger_error('Method was never implemented and used.', E_USER_DEPRECATED); + return $this; } diff --git a/app/code/Magento/Authorization/README.md b/app/code/Magento/Authorization/README.md index 4b8afb4fef0d..f5fa0fccfea3 100644 --- a/app/code/Magento/Authorization/README.md +++ b/app/code/Magento/Authorization/README.md @@ -11,10 +11,10 @@ The Magento_AdminNotification module creates the following tables in the databas Before disabling or uninstalling this module, note that the Magento_GraphQl module depends on this module. -For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html). +For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Extensibility -Extension developers can interact with the Magento_Authorization module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_Authorization module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Authorization module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Authorization module. diff --git a/app/code/Magento/AwsS3/Driver/AwsS3.php b/app/code/Magento/AwsS3/Driver/AwsS3.php index 6b3da8c848fb..a42b0c926399 100644 --- a/app/code/Magento/AwsS3/Driver/AwsS3.php +++ b/app/code/Magento/AwsS3/Driver/AwsS3.php @@ -8,12 +8,15 @@ namespace Magento\AwsS3\Driver; use Generator; -use Exception; -use League\Flysystem\AdapterInterface; use League\Flysystem\Config; +use League\Flysystem\FilesystemAdapter; +use League\Flysystem\UnableToRetrieveMetadata; +use League\Flysystem\Visibility; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\FileSystemException; use Magento\Framework\Filesystem\DriverInterface; use Magento\Framework\Phrase; +use Magento\RemoteStorage\Driver\Adapter\MetadataProviderInterface; use Psr\Log\LoggerInterface; use Magento\RemoteStorage\Driver\DriverException; use Magento\RemoteStorage\Driver\RemoteDriverInterface; @@ -30,10 +33,10 @@ class AwsS3 implements RemoteDriverInterface private const TEST_FLAG = 'storage.flag'; - private const CONFIG = ['ACL' => 'private']; + private const CONFIG = ['ACL' => 'private', 'visibility' => Visibility::PRIVATE]; /** - * @var AdapterInterface + * @var FilesystemAdapter */ private $adapter; @@ -53,18 +56,27 @@ class AwsS3 implements RemoteDriverInterface private $objectUrl; /** - * @param AdapterInterface $adapter + * @var MetadataProviderInterface + */ + private $metadataProvider; + + /** + * @param FilesystemAdapter $adapter * @param LoggerInterface $logger * @param string $objectUrl + * @param MetadataProviderInterface|null $metadataProvider */ public function __construct( - AdapterInterface $adapter, + FilesystemAdapter $adapter, LoggerInterface $logger, - string $objectUrl + string $objectUrl, + MetadataProviderInterface $metadataProvider = null ) { $this->adapter = $adapter; $this->logger = $logger; $this->objectUrl = $objectUrl; + $this->metadataProvider = $metadataProvider ?? + ObjectManager::getInstance()->get(MetadataProviderInterface::class); } /** @@ -89,7 +101,7 @@ public function test(): void { try { $this->adapter->write(self::TEST_FLAG, '', new Config(self::CONFIG)); - } catch (Exception $exception) { + } catch (\Exception $exception) { throw new DriverException(__($exception->getMessage()), $exception); } } @@ -107,7 +119,12 @@ public function fileGetContents($path, $flag = null, $context = null): string //phpcs:enable } - return $this->adapter->read($path)['contents'] ?? ''; + try { + return $this->adapter->read($path); + } catch (\League\Flysystem\FilesystemException $e) { + $this->logger->error($e->getMessage()); + return ''; + } } /** @@ -125,7 +142,12 @@ public function isExists($path): bool return true; } - return $this->adapter->has($path); + try { + return $this->adapter->fileExists($path); + } catch (\League\Flysystem\FilesystemException $e) { + $this->logger->error($e->getMessage()); + return false; + } } /** @@ -166,10 +188,13 @@ private function createDirectoryRecursively(string $path): bool } if (!$this->isDirectory($path)) { - return (bool)$this->adapter->createDir( - $this->fixPath($path), - new Config(self::CONFIG) - ); + + try { + $this->adapter->createDirectory($this->fixPath($path), new Config(self::CONFIG)); + } catch (\League\Flysystem\FilesystemException $e) { + $this->logger->error($e->getMessage()); + return false; + } } return true; @@ -180,10 +205,17 @@ private function createDirectoryRecursively(string $path): bool */ public function copy($source, $destination, DriverInterface $targetDriver = null): bool { - return $this->adapter->copy( - $this->normalizeRelativePath($source, true), - $this->normalizeRelativePath($destination, true) - ); + try { + $this->adapter->copy( + $this->normalizeRelativePath($source, true), + $this->normalizeRelativePath($destination, true), + new Config(self::CONFIG) + ); + } catch (\League\Flysystem\FilesystemException $e) { + $this->logger->error($e->getMessage()); + return false; + } + return true; } /** @@ -191,9 +223,15 @@ public function copy($source, $destination, DriverInterface $targetDriver = null */ public function deleteFile($path): bool { - return $this->adapter->delete( - $this->normalizeRelativePath($path, true) - ); + try { + $this->adapter->delete( + $this->normalizeRelativePath($path, true) + ); + } catch (\League\Flysystem\FilesystemException $e) { + $this->logger->error($e->getMessage()); + return false; + } + return true; } /** @@ -201,9 +239,15 @@ public function deleteFile($path): bool */ public function deleteDirectory($path): bool { - return $this->adapter->deleteDir( - $this->normalizeRelativePath($path, true) - ); + try { + $this->adapter->deleteDirectory( + $this->normalizeRelativePath($path, true) + ); + } catch (\League\Flysystem\FilesystemException $e) { + $this->logger->error($e->getMessage()); + return false; + } + return true; } /** @@ -221,7 +265,13 @@ public function filePutContents($path, $content, $mode = null): int ]; } - return $this->adapter->write($path, $content, new Config($config))['size']; + try { + $this->adapter->write($path, $content, new Config($config)); + return $this->adapter->fileSize($path)->fileSize(); + } catch (\League\Flysystem\FilesystemException | UnableToRetrieveMetadata $e) { + $this->logger->error($e->getMessage()); + return 0; + } } /** @@ -350,6 +400,25 @@ public function isReadable($path): bool return $this->isExists($path); } + /** + * Check is specified path a file. + * + * @param string $path + * @return bool + */ + private function isTypeFile($path) + { + try { + $metadata = $this->metadataProvider->getMetadata($this->normalizeRelativePath($path, true)); + if ($metadata && isset($metadata['type'])) { + return $metadata['type'] === self::TYPE_FILE; + } + } catch (UnableToRetrieveMetadata $e) { + return false; + } + return false; + } + /** * @inheritDoc */ @@ -358,14 +427,7 @@ public function isFile($path): bool if (!$path || $path === '/') { return false; } - - $path = $this->normalizeRelativePath($path, true); - - if ($this->adapter->has($path) && ($meta = $this->adapter->getMetadata($path))) { - return ($meta['type'] ?? null) === self::TYPE_FILE; - } - - return false; + return $this->isTypeFile($path); } /** @@ -377,21 +439,47 @@ public function isDirectory($path): bool return true; } - $path = $this->normalizeRelativePath($path, true); - if (!$path) { return true; } + return $this->isTypeDirectory($path); + } - if ($this->adapter->has($path)) { - $meta = $this->adapter->getMetadata($path); - - return !($meta && $meta['type'] === self::TYPE_FILE); + /** + * Check is given path a directory in metadata. + * + * @param string $path + * @return bool + */ + private function isTypeDirectory($path) + { + try { + $meta = $this->metadataProvider->getMetadata($this->normalizeRelativePath($path, true)); + } catch (UnableToRetrieveMetadata $e) { + return false; + } + if (isset($meta['type']) && $meta['type'] === self::TYPE_DIR) { + return true; } - return false; } + /** + * Check if directory exists by path. + * + * @param string $path + * @return bool + */ + private function directoryExists(string $path): bool + { + try { + return $this->adapter->fileExists($path); + } catch (\Throwable $e) { + // catch closed iterator + return false; + } + } + /** * @inheritDoc */ @@ -434,10 +522,17 @@ public function getRealPath($path) */ public function rename($oldPath, $newPath, DriverInterface $targetDriver = null): bool { - return $this->adapter->rename( - $this->normalizeRelativePath($oldPath, true), - $this->normalizeRelativePath($newPath, true) - ); + try { + $this->adapter->move( + $this->normalizeRelativePath($oldPath, true), + $this->normalizeRelativePath($newPath, true), + new Config(self::CONFIG) + ); + } catch (\League\Flysystem\FilesystemException $e) { + $this->logger->error($e->getMessage()); + return false; + } + return true; } /** @@ -445,14 +540,7 @@ public function rename($oldPath, $newPath, DriverInterface $targetDriver = null) */ public function stat($path): array { - $path = $this->normalizeRelativePath($path, true); - $metaInfo = $this->adapter->getMetadata($path); - - if (!$metaInfo) { - throw new FileSystemException(__('Cannot gather stats! %1', [$this->getWarningMessage()])); - } - - return [ + $result = [ 'dev' => 0, 'ino' => 0, 'mode' => 0, @@ -464,11 +552,30 @@ public function stat($path): array 'ctime' => 0, 'blksize' => 0, 'blocks' => 0, - 'size' => $metaInfo['size'] ?? 0, - 'type' => $metaInfo['type'] ?? '', - 'mtime' => $metaInfo['timestamp'] ?? 0, + 'size' => 0, + 'type' => '', + 'mtime' => 0, 'disposition' => null ]; + $path = $this->normalizeRelativePath($path, true); + try { + $metaInfo = $this->metadataProvider->getMetadata($path); + } catch (UnableToRetrieveMetadata $exception) { + if ($this->directoryExists($path)) { + $result['type'] = self::TYPE_DIR; + } + return $result; + } + + if (!$metaInfo) { + throw new FileSystemException(__('Cannot gather stats! %1', [$this->getWarningMessage()])); + } + if ($metaInfo['type'] === 'file') { + $result['size'] = $metaInfo['size']; + $result['type'] = $metaInfo['type']; + $result['mtime'] = $metaInfo['timestamp']; + } + return $result; } /** @@ -476,31 +583,7 @@ public function stat($path): array */ public function getMetadata(string $path): array { - $path = $this->normalizeRelativePath($path, true); - $metaInfo = $this->adapter->getMetadata($path); - - if (!$metaInfo) { - throw new FileSystemException(__('Cannot gather meta info! %1', [$this->getWarningMessage()])); - } - - $mimeType = $this->adapter->getMimetype($path)['mimetype']; - $size = $this->adapter->getSize($path)['size']; - $timestamp = $this->adapter->getTimestamp($path)['timestamp']; - - return [ - 'path' => $metaInfo['path'], - 'dirname' => $metaInfo['dirname'], - 'basename' => $metaInfo['basename'], - 'extension' => $metaInfo['extension'], - 'filename' => $metaInfo['filename'], - 'timestamp' => $timestamp, - 'size' => $size, - 'mimetype' => $mimeType, - 'extra' => [ - 'image-width' => $metaInfo['metadata']['image-width'] ?? 0, - 'image-height' => $metaInfo['metadata']['image-height'] ?? 0 - ] - ]; + return $this->metadataProvider->getMetadata($this->normalizeRelativePath($path)); } /** @@ -571,11 +654,17 @@ public function touch($path, $modificationTime = null): bool { $path = $this->normalizeRelativePath($path, true); - $content = $this->adapter->has($path) ? - $this->adapter->read($path)['contents'] - : ''; + try { + $content = $this->adapter->fileExists($path) ? + $this->adapter->read($path) + : ''; + $this->adapter->write($path, $content, new Config([])); + } catch (\League\Flysystem\FilesystemException $e) { + $this->logger->error($e->getMessage()); + return false; + } - return (bool)$this->adapter->write($path, $content, new Config([])); + return true; } /** @@ -785,11 +874,15 @@ public function fileOpen($path, $mode) if (!isset($this->streams[$path])) { $this->streams[$path] = tmpfile(); - if ($this->adapter->has($path)) { - //phpcs:ignore Magento2.Functions.DiscouragedFunction - fwrite($this->streams[$path], $this->adapter->read($path)['contents']); - //phpcs:ignore Magento2.Functions.DiscouragedFunction - rewind($this->streams[$path]); + try { + if ($this->adapter->fileExists($path)) { + //phpcs:ignore Magento2.Functions.DiscouragedFunction + fwrite($this->streams[$path], $this->adapter->read($path)); + //phpcs:ignore Magento2.Functions.DiscouragedFunction + rewind($this->streams[$path]); + } + } catch (\League\Flysystem\FilesystemException $e) { + $this->logger->error($e->getMessage()); } } @@ -832,17 +925,13 @@ private function getWarningMessage(): ?string private function readPath(string $path, $isRecursive = false): array { $relativePath = $this->normalizeRelativePath($path); - $contentsList = $this->adapter->listContents( - $this->fixPath($relativePath), - $isRecursive - ); - $itemsList = []; - foreach ($contentsList as $item) { - if (isset($item['path']) - && $item['path'] !== $relativePath - && (!$relativePath || strpos($item['path'], $relativePath) === 0)) { - $itemsList[] = $this->getAbsolutePath($item['dirname'], $item['path']); + foreach ($this->adapter->listContents($this->fixPath($relativePath), $isRecursive) as $item) { + $path = $item->path(); + if (!empty($path) + && $path !== $relativePath + && (!$relativePath || strpos($path, $relativePath) === 0)) { + $itemsList[] = $this->getAbsolutePath(dirname($path), $path); } } diff --git a/app/code/Magento/AwsS3/Driver/AwsS3Factory.php b/app/code/Magento/AwsS3/Driver/AwsS3Factory.php index a4d3676bffa0..917bb6ce045e 100644 --- a/app/code/Magento/AwsS3/Driver/AwsS3Factory.php +++ b/app/code/Magento/AwsS3/Driver/AwsS3Factory.php @@ -8,11 +8,12 @@ namespace Magento\AwsS3\Driver; use Aws\S3\S3Client; -use League\Flysystem\AwsS3v3\AwsS3Adapter; -use League\Flysystem\Cached\CachedAdapter; +use League\Flysystem\AwsS3V3\AwsS3V3Adapter; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\ObjectManagerInterface; -use Magento\RemoteStorage\Driver\Cache\CacheFactory; +use Magento\RemoteStorage\Driver\Adapter\Cache\CacheInterfaceFactory; +use Magento\RemoteStorage\Driver\Adapter\CachedAdapterInterfaceFactory; +use Magento\RemoteStorage\Driver\Adapter\MetadataProviderInterfaceFactory; use Magento\RemoteStorage\Driver\DriverException; use Magento\RemoteStorage\Driver\DriverFactoryInterface; use Magento\RemoteStorage\Driver\RemoteDriverInterface; @@ -29,25 +30,52 @@ class AwsS3Factory implements DriverFactoryInterface private $objectManager; /** - * @var CacheFactory + * @var Config */ - private $cacheFactory; + private $config; /** - * @var Config + * @var MetadataProviderInterfaceFactory */ - private $config; + private $metadataProviderFactory; + + /** + * @var CacheInterfaceFactory + */ + private $cacheInterfaceFactory; + + /** + * @var CachedAdapterInterfaceFactory + */ + private $cachedAdapterInterfaceFactory; + + /** + * @var string|null + */ + private $cachePrefix; /** * @param ObjectManagerInterface $objectManager - * @param CacheFactory $cacheFactory * @param Config $config + * @param MetadataProviderInterfaceFactory $metadataProviderFactory + * @param CacheInterfaceFactory $cacheInterfaceFactory + * @param CachedAdapterInterfaceFactory $cachedAdapterInterfaceFactory + * @param string|null $cachePrefix */ - public function __construct(ObjectManagerInterface $objectManager, CacheFactory $cacheFactory, Config $config) - { + public function __construct( + ObjectManagerInterface $objectManager, + Config $config, + MetadataProviderInterfaceFactory $metadataProviderFactory, + CacheInterfaceFactory $cacheInterfaceFactory, + CachedAdapterInterfaceFactory $cachedAdapterInterfaceFactory, + string $cachePrefix = null + ) { $this->objectManager = $objectManager; - $this->cacheFactory = $cacheFactory; $this->config = $config; + $this->metadataProviderFactory = $metadataProviderFactory; + $this->cacheInterfaceFactory = $cacheInterfaceFactory; + $this->cachedAdapterInterfaceFactory = $cachedAdapterInterfaceFactory; + $this->cachePrefix = $cachePrefix; } /** @@ -58,9 +86,7 @@ public function create(): RemoteDriverInterface try { return $this->createConfigured( $this->config->getConfig(), - $this->config->getPrefix(), - $this->config->getCacheAdapter(), - $this->config->getCacheConfig() + $this->config->getPrefix() ); } catch (LocalizedException $exception) { throw new DriverException(__($exception->getMessage()), $exception); @@ -73,8 +99,8 @@ public function create(): RemoteDriverInterface public function createConfigured( array $config, string $prefix, - string $cacheAdapter, - array $cacheConfig + string $cacheAdapter = '', + array $cacheConfig = [] ): RemoteDriverInterface { $config['version'] = 'latest'; @@ -91,16 +117,31 @@ public function createConfigured( } $client = new S3Client($config); - $adapter = new AwsS3Adapter($client, $config['bucket'], $prefix); - + $adapter = new AwsS3V3Adapter($client, $config['bucket'], $prefix); + $cache = $this->cacheInterfaceFactory->create( + // Custom cache prefix required to distinguish cache records for different sources. + // phpcs:ignore Magento2.Security.InsecureFunction + $this->cachePrefix ? ['prefix' => $this->cachePrefix] : ['prefix' => md5($config['bucket'] . $prefix)] + ); + $metadataProvider = $this->metadataProviderFactory->create( + [ + 'adapter' => $adapter, + 'cache' => $cache + ] + ); + $objectUrl = rtrim($client->getObjectUrl($config['bucket'], './'), '/') . trim($prefix, '\\/') . '/'; return $this->objectManager->create( AwsS3::class, [ - 'adapter' => $this->objectManager->create(CachedAdapter::class, [ - 'adapter' => $adapter, - 'cache' => $this->cacheFactory->create($cacheAdapter, $cacheConfig) - ]), - 'objectUrl' => $client->getObjectUrl($adapter->getBucket(), $adapter->applyPathPrefix('.')) + 'adapter' => $this->cachedAdapterInterfaceFactory->create( + [ + 'adapter' => $adapter, + 'cache' => $cache, + 'metadataProvider' => $metadataProvider + ] + ), + 'objectUrl' => $objectUrl, + 'metadataProvider' => $metadataProvider, ] ); } diff --git a/app/code/Magento/AwsS3/Model/HttpLoggerHandler.php b/app/code/Magento/AwsS3/Model/HttpLoggerHandler.php deleted file mode 100644 index 9971a81f155d..000000000000 --- a/app/code/Magento/AwsS3/Model/HttpLoggerHandler.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\AwsS3\Model; - -use Aws\Handler\GuzzleV6\GuzzleHandler; -use GuzzleHttp\Client; -use GuzzleHttp\HandlerStack; -use GuzzleHttp\MessageFormatter; -use GuzzleHttp\Middleware; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\Exception\FileSystemException; -use Magento\Framework\Filesystem; -use Monolog\Handler\StreamHandler; -use Monolog\Logger; - -final class HttpLoggerHandler -{ - /** - * @var Filesystem\Directory\WriteInterface - */ - private $directory; - - /** - * @var string - */ - private $file; - - /** - * @param Filesystem $filesystem - * @param string $file - * @throws FileSystemException - */ - public function __construct( - Filesystem $filesystem, - $file = 'debug/s3.log' - ) { - $this->directory = $filesystem->getDirectoryWrite(DirectoryList::VAR_DIR); - $this->file = $file; - } - - public function __invoke() - { - $this->directory->create(pathinfo($this->file, PATHINFO_DIRNAME)); - $localStream = $this->directory->getDriver()->fileOpen($this->directory->getAbsolutePath($this->file), 'a'); - $streamHandler = new StreamHandler($localStream, Logger::DEBUG, true, null, true); - $logger = new \Monolog\Logger('S3', [$streamHandler]); - $stack = HandlerStack::create(); - $stack->push( - Middleware::log( - $logger, - new MessageFormatter('{code}:{method}:{target} {error}') - ) - ); - return new GuzzleHandler(new Client(['handler' => $stack])); - } -} diff --git a/app/code/Magento/AwsS3/Test/Mftf/Helper/DummyMetadataCache.php b/app/code/Magento/AwsS3/Test/Mftf/Helper/DummyMetadataCache.php new file mode 100644 index 000000000000..54f44ab2f124 --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Helper/DummyMetadataCache.php @@ -0,0 +1,86 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\AwsS3\Test\Mftf\Helper; + +/** + * Cache mock for metadata provider. + */ +class DummyMetadataCache implements \Magento\RemoteStorage\Driver\Adapter\Cache\CacheInterface +{ + /** + * @inheirtDoc + */ + public function exists(string $path): ?bool + { + return null; + } + + /** + * @inheirtDoc + */ + public function getMetadata(string $path): ?array + { + return null; + } + + /** + * @inheirtDoc + */ + public function flushCache(): void + { + } + + /** + * @inheirtDoc + */ + public function purgeQueue(): void + { + } + + /** + * @inheirtDoc + */ + public function moveFile(string $path, string $newpath): void + { + } + + /** + * @inheirtDoc + */ + public function copyFile(string $path, string $newpath): void + { + } + + /** + * @inheirtDoc + */ + public function deleteFile(string $path): void + { + } + + /** + * @inheirtDoc + */ + public function deleteDir(string $dirname): void + { + } + + /** + * @inheirtDoc + */ + public function updateMetadata(string $path, array $objectMetadata, bool $persist = false): void + { + } + + /** + * @inheirtDoc + */ + public function storeFileNotExists(string $path): void + { + } +} diff --git a/app/code/Magento/AwsS3/Test/Mftf/Helper/MockTestLogger.php b/app/code/Magento/AwsS3/Test/Mftf/Helper/MockTestLogger.php new file mode 100644 index 000000000000..45b7d53fee0d --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Helper/MockTestLogger.php @@ -0,0 +1,63 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\AwsS3\Test\Mftf\Helper; + +use Psr\Log\LoggerInterface; + +/** + * Mocked logger for using the AwsS3 driver in testing + * + * Ignores most log messages but throws errors on error/critical/emergency logs so tests will fail + */ +class MockTestLogger implements LoggerInterface { + + public function emergency($message, array $context = array()) + { + throw new \Exception($message); + } + + public function alert($message, array $context = array()) + { + // noop + } + + public function critical($message, array $context = array()) + { + throw new \Exception($message); + } + + public function error($message, array $context = array()) + { + throw new \Exception($message); + } + + public function warning($message, array $context = array()) + { + // noop + } + + public function notice($message, array $context = array()) + { + // noop + } + + public function info($message, array $context = array()) + { + // noop + } + + public function debug($message, array $context = array()) + { + // noop + } + + public function log($level, $message, array $context = array()) + { + // noop + } +} diff --git a/app/code/Magento/AwsS3/Test/Mftf/Helper/S3FileAssertions.php b/app/code/Magento/AwsS3/Test/Mftf/Helper/S3FileAssertions.php new file mode 100644 index 000000000000..3f78b1051e2d --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Helper/S3FileAssertions.php @@ -0,0 +1,316 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\AwsS3\Test\Mftf\Helper; + +use Aws\S3\S3Client; +use Codeception\Lib\ModuleContainer; +use League\Flysystem\AwsS3V3\AwsS3V3Adapter; +use League\Flysystem\PathPrefixer; +use Magento\AwsS3\Driver\AwsS3; +use Magento\FunctionalTestingFramework\Helper\Helper; +use Magento\Framework\Filesystem\DriverInterface; +use Magento\RemoteStorage\Driver\Adapter\MetadataProvider; + +/** + * Class for MFTF helpers for doing file assertions using S3. + */ +class S3FileAssertions extends Helper +{ + /** + * @var DriverInterface $driver + */ + private $driver; + + /** + * Call the parent constructor then create the AwsS3 driver from environment variables + * + * @param ModuleContainer $moduleContainer + * @param array|null $config + * @return void + */ + public function __construct(ModuleContainer $moduleContainer, ?array $config = null) + { + parent::__construct($moduleContainer, $config); + + $region = getenv('REMOTE_STORAGE_AWSS3_REGION'); + $prefix = getenv('REMOTE_STORAGE_AWSS3_PREFIX'); + $bucket = getenv('REMOTE_STORAGE_AWSS3_BUCKET'); + $accessKey = getenv('REMOTE_STORAGE_AWSS3_ACCESS_KEY'); + $secretKey = getenv('REMOTE_STORAGE_AWSS3_SECRET_KEY'); + + $config = [ + 'version' => 'latest', + 'credentials' => [ + 'key' => $accessKey, + 'secret' => $secretKey + ], + 'bucket' => $bucket, + 'region' => $region + ]; + + if (empty($config['credentials']['key']) || empty($config['credentials']['secret'])) { + unset($config['credentials']); + } + + $client = new S3Client($config); + $adapter = new AwsS3V3Adapter($client, $config['bucket'], $prefix); + $prefixer = new PathPrefixer($prefix); + $objectUrl = $client->getObjectUrl($config['bucket'], ltrim($prefixer->prefixPath('.'), '/')); + $metadataProvider = new MetadataProvider($adapter, new DummyMetadataCache()); + $s3Driver = new AwsS3($adapter, new MockTestLogger(), $objectUrl, $metadataProvider); + + $this->driver = $s3Driver; + } + + /** + * Create a file in the S3 bucket + * + * @param string $filePath + * @param string $text + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function createTextFile($filePath, $text): void + { + $this->driver->filePutContents($filePath, $text); + } + + /** + * Delete a file from the S3 bucket if it exists + * + * @param string $filePath + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function deleteFileIfExists($filePath): void + { + if ($this->driver->isExists($filePath)) { + $this->driver->deleteFile($filePath); + } + } + + /** + * Copy source into destination + * + * @param string $source + * @param string $destination + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function copy($source, $destination): void + { + $this->driver->copy($source, $destination); + } + + /** + * Create directory in the S3 bucket + * + * @param string $path + * @param int $permissions + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function createDirectory($path, $permissions = 0777): void + { + $this->driver->createDirectory($path, $permissions); + } + + /** + * Recursive delete directory in the S3 bucket + * + * @param string $path + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function deleteDirectory($path): void + { + if ($this->driver->isExists($path)) { + $this->driver->deleteDirectory($path); + } + } + + /** + * Assert a file exists on the remote storage system + * + * @param string $filePath + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileExists($filePath, $message = ''): void + { + $this->assertTrue($this->driver->isExists($filePath), "Failed asserting $filePath exists. " . $message); + } + + /** + * Asserts that a file with the given glob pattern exists in the given path on the remote storage system + * + * @param string $path + * @param string $pattern + * @param string $message + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertGlobbedFileExists($path, $pattern, $message = ''): void + { + $files = $this->driver->search($pattern, $path); + $this->assertNotEmpty($files, "Failed asserting file matching glob pattern \"$pattern\" at location \"$path\" is not empty. " . $message); + } + + /** + * Asserts that a file or directory exists on the remote storage system + * + * @param string $path + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertPathExists($path, $message = ''): void + { + $this->assertTrue($this->driver->isExists($path), "Failed asserting $path exists. " . $message); + } + + /** + * Asserts that a file or directory does not exist on the remote storage system + * + * @param string $path + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertPathDoesNotExist($path, $message = ''): void + { + $this->assertFalse($this->driver->isExists($path), "Failed asserting $path does not exist. " . $message); + } + + /** + * Assert a file does not exist on the remote storage system + * + * @param string $filePath + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileDoesNotExist($filePath, $message = ''): void + { + $this->assertFalse($this->driver->isExists($filePath), $message); + } + + /** + * Assert a file on the remote storage system has no contents + * + * @param string $filePath + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileEmpty($filePath, $message = ''): void + { + $this->assertEmpty($this->driver->fileGetContents($filePath), "Failed asserting $filePath is empty. " . $message); + } + + /** + * Assert a file on the remote storage system is not empty + * + * @param string $filePath + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileNotEmpty($filePath, $message = ''): void + { + $this->assertNotEmpty($this->driver->fileGetContents($filePath), "Failed asserting $filePath is not empty. " . $message); + } + + /** + * Assert a file on the remote storage system contains a given string + * + * @param string $filePath + * @param string $text + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileContainsString($filePath, $text, $message = ''): void + { + $this->assertStringContainsString($text, $this->driver->fileGetContents($filePath), "Failed asserting $filePath contains $text. " . $message); + } + + /** + * Asserts that a file with the given glob pattern at the given path on the remote storage system contains a given string + * + * @param string $path + * @param string $pattern + * @param string $text + * @param int $fileIndex + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertGlobbedFileContainsString($path, $pattern, $text, $fileIndex = 0, $message = ''): void + { + $files = $this->driver->search($pattern, $path); + $this->assertStringContainsString($text, $this->driver->fileGetContents($files[$fileIndex] ?? ''), "Failed asserting file of index \"$fileIndex\" matching glob pattern \"$pattern\" at location \"$path\" contains $text. " . $message); + } + + /** + * Assert a file on the remote storage system does not contain a given string + * + * @param string $filePath + * @param string $text + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileDoesNotContainString($filePath, $text, $message = ''): void + { + $this->assertStringNotContainsString($text, $this->driver->fileGetContents($filePath), "Failed asserting $filePath does not contain $text. " . $message); + } + + /** + * Asserts that a directory on the remote storage system is empty + * + * @param string $path + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertDirectoryEmpty($path, $message = ''): void + { + $this->assertEmpty($this->driver->readDirectory($path), "Failed asserting $path is empty. " . $message); + } + + /** + * Asserts that a directory on the remote storage system is not empty + * + * @param string $path + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertDirectoryNotEmpty($path, $message = ''): void + { + $this->assertNotEmpty($this->driver->readDirectory($path), "Failed asserting $path is not empty. " . $message); + } +} diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportBundleProductTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportBundleProductTest.xml new file mode 100644 index 000000000000..c3d727a323c2 --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportBundleProductTest.xml @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ExportBundleProductTest" extends="AdminExportBundleProductTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Export Products"/> + <title value="S3 - Export Bundle Products"/> + <description value="Verifies that a user can export Bundle and Simple child products for Bundled products + with a dynamic price, a fixed price, and a custom attribute. Verifies that the exported file and the + downloadable copy of the exported file contain the expected products. Note that MFTF cannot simply download + a file and have access to it due to the test not having access to the server that is running the test + browser. Therefore, this test verifies that the Download button can be successfully clicked, grabs the + request URL from the Download button, executes the request on the magento machine via a curl request, and + verifies the contents of the downloaded file. Uses S3 for the file system."/> + <severity value="CRITICAL"/> + <testCaseId value="MC-38558"/> + <group value="importExport"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Enable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="firstSimpleProductForDynamic"/> + </before> + + <after> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">import_export/export</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logout"/> + </after> + + <!-- Validate Export File on File System: Dynamic Bundle Product --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstSimpleProductForDynamicBundledProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$firstSimpleProductForDynamic.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondSimpleProductForDynamicBundledProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$secondSimpleProductForDynamic.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDynamicBundleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createDynamicBundleProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDynamicBundleProductOption1"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">name=$createFirstBundleOption.option[title]$,type=$createFirstBundleOption.option[type]$,required=$createFirstBundleOption.option[required]$,sku=$$firstSimpleProductForDynamic.sku$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDynamicBundleProductOption2"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">name=$createFirstBundleOption.option[title]$,type=$createFirstBundleOption.option[type]$,required=$createFirstBundleOption.option[required]$,sku=$$secondSimpleProductForDynamic.sku$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDynamicPriceBundleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">0.000000,,,,$$createDynamicBundleProduct.sku$$</argument> + </helper> + + <!-- Validate Export File on File System: Fixed Bundle Product --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstSimpleProductForFixedBundledProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$firstSimpleProductForFixed.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondSimpleProductForFixedBundledProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$secondSimpleProductForFixed.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createFixedBundleProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductOption1"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">name=$createSecondBundleOption.option[title]$,type=$createSecondBundleOption.option[type]$,required=$createSecondBundleOption.option[required]$,sku=$$firstSimpleProductForFixed.sku$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductOption2"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">name=$createSecondBundleOption.option[title]$,type=$createSecondBundleOption.option[type]$,required=$createSecondBundleOption.option[required]$,sku=$$secondSimpleProductForFixed.sku$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedPriceBundleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createFixedBundleProduct.price$$0000,,,,$$createFixedBundleProduct.sku$$</argument> + </helper> + + <!-- Validate Export File on File System: Fixed Bundle Product with Attribute --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstSimpleProductForFixedBundledProductWithAttribute"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$firstSimpleProductForFixedWithAttribute.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondSimpleProductForFixedBundledProductWithAttribute"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$secondSimpleProductForFixedWithAttribute.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductWithAttribute"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createFixedBundleProductWithAttribute.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductWithAttributeOption1"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">name=$createBundleOptionWithAttribute.option[title]$,type=$createBundleOptionWithAttribute.option[type]$,required=$createBundleOptionWithAttribute.option[required]$,sku=$$firstSimpleProductForFixedWithAttribute.sku$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductWithAttributeOption2"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">name=$createBundleOptionWithAttribute.option[title]$,type=$createBundleOptionWithAttribute.option[type]$,required=$createBundleOptionWithAttribute.option[required]$,sku=$$secondSimpleProductForFixedWithAttribute.sku$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedPriceBundleProductWithAttribute"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createFixedBundleProductWithAttribute.price$$0000,,,,$$createFixedBundleProductWithAttribute.sku$$</argument> + </helper> + + <!-- Delete Export File --> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportDownloadableProductWithFileLinksTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportDownloadableProductWithFileLinksTest.xml new file mode 100644 index 000000000000..0004ecf0f69a --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportDownloadableProductWithFileLinksTest.xml @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ExportDownloadableProductWithFileLinksTest" extends="AdminExportDownloadableProductWithFileLinksTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Export Products"/> + <title value="S3 - Export Downloadable Products with File Links"/> + <description value="Verifies that a user can export a Downloadable product with downloadable and sample file + links. Verifies that the exported file and the downloadable copy of the exported file contain the expected + product (a filter is applied when exporting such that ONLY the downloadable product row should be in the + export), the correct downloadable link with files, and the correct downloadable sample links with files. + Note that MFTF cannot simply download a file and have access to it due to the test not having access to the + server that is running the test browser. Therefore, this test verifies that the Download button can be + successfully clicked, grabs the request URL from the Download button, executes the request on the magento + machine via a curl request, and verifies the contents of the downloaded file. Uses S3 for the file system."/> + <severity value="CRITICAL"/> + <testCaseId value="MC-38558"/> + <group value="importExport"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Enable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="createCategory"/> + </before> + + <after> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">import_export/export</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logout"/> + </after> + + <!-- Validate Export File on S3 --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableLink"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">title=$addDownloadableLink.link[title]$,sort_order=$addDownloadableLink.link[sort_order]$,sample_type=$addDownloadableLink.link[sample_type]$,sample_file=/a/d/$addDownloadableLink.link[sample_file_content][name]$,price=$addDownloadableLink.link[price]$0000,number_of_downloads=$addDownloadableLink.link[number_of_downloads]$,is_shareable=$addDownloadableLink.link[is_shareable]$,link_type=$addDownloadableLink.link[link_type]$,link_file=/m/a/$addDownloadableLink.link[link_file_content][name]$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableSampleLink"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">title=$addDownloadableSamples.sample[title]$,sample_type=$addDownloadableSamples.sample[sample_type]$,sample_file=/t/e/$addDownloadableSamples.sample[sample_file_content][name]$</argument> + </helper> + + <!-- Delete Export File --> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportDownloadableProductWithURLLinksTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportDownloadableProductWithURLLinksTest.xml new file mode 100644 index 000000000000..d34136dd1a1d --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportDownloadableProductWithURLLinksTest.xml @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ExportDownloadableProductWithURLLinksTest" extends="AdminExportDownloadableProductWithURLLinksTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Export Products"/> + <title value="S3 - Export Downloadable Products with URL Links"/> + <description value="Verifies that a user can export a Downloadable product with downloadable and sample Url + links. Verifies that the exported file and the downloadable copy of the exported file contain the expected + product (a filter is applied when exporting such that ONLY the configurable product row should be in the + export), the correct downloadable link with Urls, and the correct downloadable sample links with Urls. + Note that MFTF cannot simply download a file and have access to it due to the test not having access to the + server that is running the test browser. Therefore, this test verifies that the Download button can be + successfully clicked, grabs the request URL from the Download button, executes the request on the magento + machine via a curl request, and verifies the contents of the downloaded file. Uses S3 for the file system."/> + <severity value="CRITICAL"/> + <testCaseId value="MC-38558"/> + <group value="importExport"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Enable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="addDownloadableDomain"/> + </before> + + <after> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">import_export/export</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logout"/> + </after> + + <!-- Validate Export File on S3 --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableLink"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">title=$addDownloadableLink.link[title]$,sort_order=$addDownloadableLink.link[sort_order]$,sample_type=$addDownloadableLink.link[sample_type]$,sample_url=$addDownloadableLink.link[sample_url]$,price=$addDownloadableLink.link[price]$0000,number_of_downloads=$addDownloadableLink.link[number_of_downloads]$,link_type=$addDownloadableLink.link[link_type]$,link_url=$addDownloadableLink.link[link_url]$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableSampleLink"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">title=$addDownloadableSamples.sample[title]$,sort_order=$addDownloadableSamples.sample[sort_order]$,sample_type=$addDownloadableSamples.sample[sample_type]$,sample_url=$addDownloadableSamples.sample[sample_url]$</argument> + </helper> + + <!-- Delete Export File --> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportGroupedProductWithSpecialPriceTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportGroupedProductWithSpecialPriceTest.xml new file mode 100644 index 000000000000..b292162367e2 --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportGroupedProductWithSpecialPriceTest.xml @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ExportGroupedProductWithSpecialPriceTest" extends="AdminExportGroupedProductWithSpecialPriceTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Export Products"/> + <title value="S3 - Export Grouped Products with Special Price"/> + <description value="Verifies that a user can export a Grouped product with a special price and Simple child + products. Verifies that exported file and the downloadable copy of the exported file contain the expected + products. Note that MFTF cannot simply download a file and have access to it due to the test not having + access to the server that is running the test browser. Therefore, this test verifies that the Download + button can be successfully clicked, grabs the request URL from the Download button, executes the request on + the magento machine via a curl request, and verifies the contents of the downloaded file. Uses S3 for the + file system."/> + <severity value="CRITICAL"/> + <testCaseId value="MC-38558"/> + <group value="importExport"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Enable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="createFirstSimpleProduct"/> + </before> + + <after> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">import_export/export</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logout"/> + </after> + + <!-- Validate Export File on S3: Grouped Product with Special Price --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstSimpleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createFirstSimpleProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondSimpleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createSecondSimpleProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsGroupedProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createGroupedProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstChildGroupedProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createFirstSimpleProduct.sku$$=$$createFirstSimpleProduct.quantity$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondChildGroupedProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createSecondSimpleProduct.sku$$=$$createSecondSimpleProduct.quantity$$</argument> + </helper> + + <!-- Delete Export File --> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml new file mode 100644 index 000000000000..1def3bbcc68e --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ExportSimpleAndConfigurableProductsWithCustomOptionsTest" extends="AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Export Products"/> + <title value="S3 - Export Simple and Configurable Products with Custom Options"/> + <description value="Verifies that a user can export a Configurable product with child simple products with + custom options. Verifies that the exported file and the downloadable copy of the exported file contain the + expected product (a filter is applied when exporting such that ONLY the configurable product row should be + in the export). Note that MFTF cannot simply download a file and have access to it due to the test not + having access to the server that is running the test browser. Therefore, this test verifies that the + Download button can be successfully clicked, grabs the request URL from the Download button, executes the + request on the magento machine via a curl request, and verifies the contents of the downloaded file. Uses + S3 for the file system."/> + <severity value="CRITICAL"/> + <testCaseId value="MC-38558"/> + <group value="importExport"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Enable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="createCategory"/> + </before> + + <after> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">import_export/export</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logout"/> + </after> + + <!-- Validate Export File on S3: Product with Custom Options --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsConfigurableProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstChildSimpleProductOption"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">sku=$$createConfigFirstChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option1</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondChildSimpleProductOption"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">sku=$$createConfigSecondChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option2</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotContainString" stepKey="assertExportFileDoesNotContainFirstSimpleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigFirstChildProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotContainString" stepKey="assertExportFileDoesNotContainSecondSimpleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigSecondChildProduct.name$$</argument> + </helper> + + <!-- Delete Export File --> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml new file mode 100644 index 000000000000..0f9a28350dd9 --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ExportSimpleProductAndConfigurableProductsWithAssignedImagesTest" extends="AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Export Products"/> + <title value="S3 - Export Simple product and Configurable products with assigned images"/> + <description value="Verifies that a user can export a Configurable product with child simple products with + images. Verifies that the exported file and the downloadable copy of the exported file contain the expected + product (a filter is applied when exporting such that ONLY the configurable product row should be in the + export) and the attached image. Note that MFTF cannot simply download a file and have access to it due to + the test not having access to the server that is running the test browser. Therefore, this test verifies + that the Download button can be successfully clicked, grabs the request URL from the Download button, + executes the request on the magento machine via a curl request, and verifies the contents of the downloaded + file. Uses S3 for the file system."/> + <severity value="CRITICAL"/> + <testCaseId value="MC-38558"/> + <group value="importExport"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Enable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="createCategory"/> + </before> + + <after> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">import_export/export</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logout"/> + </after> + + <!-- Validate Export File on S3: Configurable Product --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsConfigurableProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstChildSimpleProductOption"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">sku=$$createConfigFirstChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option1</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondChildSimpleProductOption"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">sku=$$createConfigSecondChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option2</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsConfigurableProductImage"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$createConfigProductImage.entry[content][name]$,"$createConfigProductImage.entry[label]$"</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotContainString" stepKey="assertExportFileDoesNotContainFirstSimpleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigFirstChildProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotContainString" stepKey="assertExportFileDoesNotContainSecondSimpleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigSecondChildProduct.name$$</argument> + </helper> + + <!-- Delete Export File --> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportTaxRatesTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportTaxRatesTest.xml new file mode 100644 index 000000000000..456f10960bdc --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportTaxRatesTest.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ExportTaxRatesTest" extends="AdminExportTaxRatesTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Export Tax"/> + <title value="S3 - Export Tax Rates"/> + <description value="Exports tax rates from the System > Data Transfer > Import/Export Tax Rates page, from + the Tax Rule page, from the Tax Rates grid page as a .csv, and from the Tax Rates grid page as an .xml. + Validates contents in downloaded file for each export area. Note that MFTF cannot simply click export and + have access to the file that is downloaded in the browser due to the test not having access to the server + that is running the test browser. Therefore, this test verifies that the Export button can be successfully + clicked, grabs the request URL from the Export button's form, executes the request on the magento machine + via a curl request, and verifies the contents of the exported file. Uses S3 for the file system."/> + <severity value="MAJOR"/> + <testCaseId value="MC-38621"/> + <group value="importExport"/> + <group value="tax"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Enable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="revertInitialTaxRateCA"/> + </before> + + <after> + <!-- Disable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/> + </after> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportBundleProductTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportBundleProductTest.xml new file mode 100644 index 000000000000..98dc78eb5794 --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportBundleProductTest.xml @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ImportBundleProductTest" extends="AdminImportBundleProductTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Import Products"/> + <title value="S3 - Import Bundle Product"/> + <description value="Imports a .csv file containing a bundle product. Verifies that product is imported + successfully and can be purchased."/> + <severity value="MAJOR"/> + <group value="importExport"/> + <group value="Bundle"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Locally Copy Import Files to Unique Media Import Directory --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportFiles" after="createCustomer"> + <argument name="path">pub/media/import/{{ImportProduct_Bundle.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyImportFile" after="createDirectoryForImportFiles"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Bundle.fileName}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Bundle.name}}/{{ImportProduct_Bundle.fileName}}</argument> + </helper> + <remove keyForRemoval="createDirectoryForImportImages"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct1BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple1_Bundle.baseImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Bundle.name}}/{{ImportProductSimple1_Bundle.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct2BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple2_Bundle.smallImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Bundle.name}}/{{ImportProductSimple2_Bundle.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct3BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple3_Bundle.thumbnailImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Bundle.name}}/{{ImportProductSimple3_Bundle.thumbnailImage}}</argument> + </helper> + + <!-- Enable AWS S3 Remote Storage & Sync --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" after="copyProduct3BaseImage"/> + <magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage" after="enableRemoteStorage"/> + + <!-- Copy to Import Directory in AWS S3 --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="createDirectory" stepKey="createDirectoryForImportFilesInS3" after="syncRemoteStorage"> + <argument name="path">var/import/images/{{ImportProduct_Bundle.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct1BaseImageInS3" after="createDirectoryForImportFilesInS3"> + <argument name="source">media/import/{{ImportProduct_Bundle.name}}/{{ImportProductSimple1_Bundle.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Bundle.name}}/{{ImportProductSimple1_Bundle.baseImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct2BaseImageInS3" after="copyProduct1BaseImageInS3"> + <argument name="source">media/import/{{ImportProduct_Bundle.name}}/{{ImportProductSimple2_Bundle.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Bundle.name}}/{{ImportProductSimple2_Bundle.smallImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct3BaseImageInS3" after="copyProduct2BaseImageInS3"> + <argument name="source">media/import/{{ImportProduct_Bundle.name}}/{{ImportProductSimple3_Bundle.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Bundle.name}}/{{ImportProductSimple3_Bundle.thumbnailImage}}</argument> + </helper> + </before> + + <after> + <!-- Delete S3 Data --> + <remove keyForRemoval="deleteProductImageDirectory"/> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryS3" after="deleteCustomer"> + <argument name="path">media/import/{{ImportProduct_Bundle.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportImagesFilesDirectoryS3" after="deleteImportFilesDirectoryS3"> + <argument name="path">var/import/images/{{ImportProduct_Bundle.name}}</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage & Delete Local Data --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryLocal" after="disableRemoteStorage"> + <argument name="path">pub/media/import/{{ImportProduct_Bundle.name}}</argument> + </helper> + </after> + + <!-- Import Bundle Product --> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Bundle.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Bundle.name}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportDownloadableProductsWithFileLinksTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportDownloadableProductsWithFileLinksTest.xml new file mode 100644 index 000000000000..68c341095a0e --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportDownloadableProductsWithFileLinksTest.xml @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ImportDownloadableProductsWithFileLinksTest" extends="AdminImportDownloadableProductsWithFileLinksTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Import Products"/> + <title value="S3 - Import Downloadable Products with File Links"/> + <description value="Imports a .csv file containing a downloadable product with file links. Verifies that + products are imported successfully."/> + <severity value="MAJOR"/> + <group value="importExport"/> + <group value="Downloadable"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Locally Copy Import Files to Unique Media Import Directory --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportFiles" after="createCustomer"> + <argument name="path">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyImportFile" after="createDirectoryForImportFiles"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.fileName}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.fileName}}</argument> + </helper> + <remove keyForRemoval="createDirectoryForImportImages"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyBaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copySmallImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyThumbnailImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument> + </helper> + + <!-- Enable AWS S3 Remote Storage & Sync --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" after="copyThumbnailImage"/> + <magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage" after="enableRemoteStorage"/> + + <!-- Copy to Import Directory in AWS S3 --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="createDirectory" stepKey="createDirectoryForImportFilesInS3" after="syncRemoteStorage"> + <argument name="path">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyBaseImageInS3" after="createDirectoryForImportFilesInS3"> + <argument name="source">media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copySmallImageInS3" after="copyBaseImageInS3"> + <argument name="source">media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyThumbnailImageInS3" after="copySmallImageInS3"> + <argument name="source">media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument> + </helper> + </before> + + <after> + <!-- Delete S3 Data --> + <remove keyForRemoval="deleteProductImageDirectory"/> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryS3" after="deleteCustomer"> + <argument name="path">media/import/{{ImportProduct_Downloadable_FileLinks.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportImagesFilesDirectoryS3" after="deleteImportFilesDirectoryS3"> + <argument name="path">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage & Delete Local Data --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryLocal" after="disableRemoteStorage"> + <argument name="path">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}</argument> + </helper> + </after> + + <!-- Import Downloadable Product --> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Downloadable_FileLinks.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Downloadable_FileLinks.name}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportDownloadableProductsWithUrlLinksTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportDownloadableProductsWithUrlLinksTest.xml new file mode 100644 index 000000000000..ccfdd6ffe51e --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportDownloadableProductsWithUrlLinksTest.xml @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ImportDownloadableProductsWithUrlLinksTest" extends="AdminImportDownloadableProductsWithUrlLinksTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Import Products"/> + <title value="S3 - Import Downloadable Products with Url Links"/> + <description value="Imports a .csv file containing a downloadable product with url links. Verifies that + products are imported successfully."/> + <severity value="MAJOR"/> + <group value="importExport"/> + <group value="Downloadable"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Locally Copy Import Files to Unique Media Import Directory --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportFiles" after="createCustomer"> + <argument name="path">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyImportFile" after="createDirectoryForImportFiles"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.fileName}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.fileName}}</argument> + </helper> + <remove keyForRemoval="createDirectoryForImportImages"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyBaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.baseImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copySmallImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.smallImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyThumbnailImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.thumbnailImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.thumbnailImage}}</argument> + </helper> + + <!-- Enable AWS S3 Remote Storage & Sync --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" after="copyThumbnailImage"/> + <magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage" after="enableRemoteStorage"/> + + <!-- Copy to Import Directory in AWS S3 --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="createDirectory" stepKey="createDirectoryForImportFilesInS3" after="syncRemoteStorage"> + <argument name="path">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyBaseImageInS3" after="createDirectoryForImportFilesInS3"> + <argument name="source">media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.baseImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copySmallImageInS3" after="copyBaseImageInS3"> + <argument name="source">media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.smallImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyThumbnailImageInS3" after="copySmallImageInS3"> + <argument name="source">media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.thumbnailImage}}</argument> + </helper> + </before> + + <after> + <!-- Delete S3 Data --> + <remove keyForRemoval="deleteProductImageDirectory"/> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryS3" after="deleteCustomer"> + <argument name="path">media/import/{{ImportProduct_Downloadable_UrlLinks.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportImagesFilesDirectoryS3" after="deleteImportFilesDirectoryS3"> + <argument name="path">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage & Delete Local Data --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryLocal" after="disableRemoteStorage"> + <argument name="path">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}</argument> + </helper> + </after> + + <!-- Import Downloadable Product --> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Downloadable_UrlLinks.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Downloadable_UrlLinks.name}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportGroupedProductTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportGroupedProductTest.xml new file mode 100644 index 000000000000..17fa5d50e4d8 --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportGroupedProductTest.xml @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ImportGroupedProductTest" extends="AdminImportGroupedProductTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Import Products"/> + <title value="S3 - Import Grouped Product"/> + <description value="Imports a .csv file containing a grouped product. Verifies that product is imported + successfully and can be purchased."/> + <severity value="MAJOR"/> + <group value="importExport"/> + <group value="GroupedProduct"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Locally Copy Import Files to Unique Media Import Directory --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportFiles" after="createCustomer"> + <argument name="path">pub/media/import/{{ImportProduct_Grouped.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyImportFile" after="createDirectoryForImportFiles"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Grouped.fileName}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Grouped.name}}/{{ImportProduct_Grouped.fileName}}</argument> + </helper> + <remove keyForRemoval="createDirectoryForImportImages"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct1BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple1_Grouped.baseImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Grouped.name}}/{{ImportProductSimple1_Grouped.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct2BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple2_Grouped.smallImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Grouped.name}}/{{ImportProductSimple2_Grouped.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct3BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple3_Grouped.thumbnailImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Grouped.name}}/{{ImportProductSimple3_Grouped.thumbnailImage}}</argument> + </helper> + + <!-- Enable AWS S3 Remote Storage & Sync --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" after="copyProduct3BaseImage"/> + <magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage" after="enableRemoteStorage"/> + + <!-- Copy to Import Directory in AWS S3 --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="createDirectory" stepKey="createDirectoryForImportFilesInS3" after="syncRemoteStorage"> + <argument name="path">var/import/images/{{ImportProduct_Grouped.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct1BaseImageInS3" after="createDirectoryForImportFilesInS3"> + <argument name="source">media/import/{{ImportProduct_Grouped.name}}/{{ImportProductSimple1_Grouped.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Grouped.name}}/{{ImportProductSimple1_Grouped.baseImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct2BaseImageInS3" after="copyProduct1BaseImageInS3"> + <argument name="source">media/import/{{ImportProduct_Grouped.name}}/{{ImportProductSimple2_Grouped.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Grouped.name}}/{{ImportProductSimple2_Grouped.smallImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct3BaseImageInS3" after="copyProduct2BaseImageInS3"> + <argument name="source">media/import/{{ImportProduct_Grouped.name}}/{{ImportProductSimple3_Grouped.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Grouped.name}}/{{ImportProductSimple3_Grouped.thumbnailImage}}</argument> + </helper> + </before> + + <after> + <!-- Delete S3 Data --> + <remove keyForRemoval="deleteProductImageDirectory"/> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryS3" after="deleteCustomer"> + <argument name="path">media/import/{{ImportProduct_Grouped.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportImagesFilesDirectoryS3" after="deleteImportFilesDirectoryS3"> + <argument name="path">var/import/images/{{ImportProduct_Grouped.name}}</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage & Delete Local Data --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryLocal" after="disableRemoteStorage"> + <argument name="path">pub/media/import/{{ImportProduct_Grouped.name}}</argument> + </helper> + </after> + + <!-- Import Grouped Product --> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Grouped.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Grouped.name}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml new file mode 100644 index 000000000000..3fa9f8bcc568 --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ImportSimpleAndConfigurableProductsWithAssignedImagesTest" extends="AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Import Products"/> + <title value="S3 - Import Configurable Product With Simple Child Products With Images"/> + <description value="Imports a .csv file containing a configurable product with 3 child simple products that + have images. Verifies that products are imported successfully and that the images are attached to the + products as expected."/> + <severity value="MAJOR"/> + <group value="importExport"/> + <group value="ConfigurableProduct"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Locally Copy Import Files to Unique Media Import Directory --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportFiles" after="createCustomer"> + <argument name="path">pub/media/import/{{ImportProduct_Configurable.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyImportFile" after="createDirectoryForImportFiles"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Configurable.fileName}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Configurable.name}}/{{ImportProduct_Configurable.fileName}}</argument> + </helper> + <remove keyForRemoval="createDirectoryForImportImages"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct1BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple1_Configurable.baseImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Configurable.name}}/{{ImportProductSimple1_Configurable.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct2BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple2_Configurable.smallImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Configurable.name}}/{{ImportProductSimple2_Configurable.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct3BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple3_Configurable.thumbnailImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Configurable.name}}/{{ImportProductSimple3_Configurable.thumbnailImage}}</argument> + </helper> + + <!-- Enable AWS S3 Remote Storage & Sync --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" after="copyProduct3BaseImage"/> + <magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage" after="enableRemoteStorage"/> + + <!-- Copy to Import Directory in AWS S3 --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="createDirectory" stepKey="createDirectoryForImportFilesInS3" after="syncRemoteStorage"> + <argument name="path">var/import/images/{{ImportProduct_Configurable.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct1BaseImageInS3" after="createDirectoryForImportFilesInS3"> + <argument name="source">media/import/{{ImportProduct_Configurable.name}}/{{ImportProductSimple1_Configurable.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Configurable.name}}/{{ImportProductSimple1_Configurable.baseImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct2BaseImageInS3" after="copyProduct1BaseImageInS3"> + <argument name="source">media/import/{{ImportProduct_Configurable.name}}/{{ImportProductSimple2_Configurable.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Configurable.name}}/{{ImportProductSimple2_Configurable.smallImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct3BaseImageInS3" after="copyProduct2BaseImageInS3"> + <argument name="source">media/import/{{ImportProduct_Configurable.name}}/{{ImportProductSimple3_Configurable.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Configurable.name}}/{{ImportProductSimple3_Configurable.thumbnailImage}}</argument> + </helper> + </before> + + <after> + <!-- Delete S3 Data --> + <remove keyForRemoval="deleteProductImageDirectory"/> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryS3" after="deleteCustomer"> + <argument name="path">media/import/{{ImportProduct_Configurable.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportImagesFilesDirectoryS3" after="deleteImportFilesDirectoryS3"> + <argument name="path">var/import/images/{{ImportProduct_Configurable.name}}</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage & Delete Local Data --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryLocal" after="disableRemoteStorage"> + <argument name="path">pub/media/import/{{ImportProduct_Configurable.name}}</argument> + </helper> + </after> + + <!-- Import Configurable Product --> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Configurable.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Configurable.name}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportTaxRatesTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportTaxRatesTest.xml new file mode 100644 index 000000000000..718fe6516179 --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportTaxRatesTest.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ImportTaxRatesTest" extends="AdminImportTaxRatesTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Import Tax"/> + <title value="S3 - Import and Update Tax Rates"/> + <description value="Imports tax rates from the System > Data Transfer > Import/Export Tax Rates page and + from the Tax Rule page, to create new tax rates and update existing tax rates. Verifies results on the Tax + Rates grid page. Uses S3 for the file system."/> + <severity value="MAJOR"/> + <testCaseId value="MC-38621"/> + <group value="importExport"/> + <group value="tax"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Enable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="revertInitialTaxRateCA"/> + </before> + + <after> + <!-- Disable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/> + </after> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3SyncMediaFilesTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3SyncMediaFilesTest.xml new file mode 100644 index 000000000000..2dbba8f81180 --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3SyncMediaFilesTest.xml @@ -0,0 +1,234 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3SyncMediaFilesTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Sync Files"/> + <title value="S3 - Verify Media Files Are Synced"/> + <description value="Verifies that media files are synced from local file system to AWS S3 by creating a + product with images while using the local file system, switching and syncing to S3, deleting the local + file system images, and verifying that the product images still render."/> + <severity value="CRITICAL"/> + <testCaseId value="MC-38938"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Create Category, Product, & Product Images --> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="_defaultProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="ApiProductAttributeMediaGalleryEntryBluePng" stepKey="createProductImage1"> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="ApiProductAttributeMediaGalleryEntryRedPng" stepKey="createProductImage2"> + <requiredEntity createDataKey="createProduct"/> + </createData> + </before> + + <after> + <!-- Delete Data & Disable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Note: Due to MFTF bug, must wrap entity reference in curly braces for entity to resolve --> + <executeJS function="return '{$createProductImage1.entry[content][name]$}'.charAt(1)" stepKey="firstCharacterImage1FileName"/> + <executeJS function="return '{$createProductImage1.entry[content][name]$}'.charAt(2)" stepKey="secondCharacterImage1FileName"/> + <executeJS function="return '{$createProductImage2.entry[content][name]$}'.charAt(1)" stepKey="firstCharacterImage2FileName"/> + <executeJS function="return '{$createProductImage2.entry[content][name]$}'.charAt(2)" stepKey="secondCharacterImage2FileName"/> + + <!-- Verify Images Are in Local File System --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileExists" stepKey="assertLocalImage1Exists"> + <argument name="filePath">pub/media/catalog/product/{$firstCharacterImage1FileName}/{$secondCharacterImage1FileName}/$createProductImage1.entry[content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileExists" stepKey="assertLocalImage2Exists"> + <argument name="filePath">pub/media/catalog/product/{$firstCharacterImage2FileName}/{$secondCharacterImage2FileName}/$createProductImage2.entry[content][name]$</argument> + </helper> + + <!-- Local - Verify Images on Product Storefront Page --> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront"> + <argument name="product" value="$$createProduct$$"/> + </actionGroup> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImageActive($createProductImage2.entry[content][name]$)}}" stepKey="seeFirstImage1"/> + <grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.productImageActive($createProductImage2.entry[content][name]$)}}" stepKey="firstImageSrc1"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertImageContentIsEqual" stepKey="assertFirstImageContent1"> + <argument name="url">{$firstImageSrc1}</argument> + <argument name="expectedString">{{RedPngImageContent.baseImage_md5}}</argument> + <argument name="message">Url: "{$firstImageSrc1}" did not render image: {{RedPngImageContent.baseImage_md5}}</argument> + </helper> + <click selector="{{StorefrontProductMediaSection.productImageInFotorama($createProductImage1.entry[content][name]$)}}" stepKey="clickSecondImage"/> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImageActive($createProductImage1.entry[content][name]$)}}" stepKey="seeSecondImage1"/> + <grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.productImageActive($createProductImage1.entry[content][name]$)}}" stepKey="secondImageSrc1"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertImageContentIsEqual" stepKey="assertSecondImageContent1"> + <argument name="url">{$secondImageSrc1}</argument> + <argument name="expectedString">{{BluePngImageContent.baseImage_md5}}</argument> + <argument name="message">Url: "{$secondImageSrc1}" did not render image: {{BluePngImageContent.baseImage_md5}}</argument> + </helper> + + <!-- Enable AWS S3 Remote Storage & Sync --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage"/> + <magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage"/> + + <!-- Verify Images Are in AWS S3 --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertS3Image1Exists"> + <argument name="filePath">media/catalog/product/{$firstCharacterImage1FileName}/{$secondCharacterImage1FileName}/$createProductImage1.entry[content][name]$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertS3Image2Exists"> + <argument name="filePath">media/catalog/product/{$firstCharacterImage2FileName}/{$secondCharacterImage2FileName}/$createProductImage2.entry[content][name]$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertDirectoryNotEmpty" stepKey="assertS3CacheDirectoryNotEmpty"> + <argument name="path">media/catalog/product/cache/</argument> + </helper> + + <!-- S3 - Clear Caches & Verify Images on Product Storefront Page --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminGoToCacheManagementPageActionGroup" stepKey="goToCacheManagementPage"/> + <actionGroup ref="AdminClickFlushCatalogImagesCacheActionGroup" stepKey="clearCatalogImageCache"/> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertDirectoryEmpty" stepKey="assertS3CacheDirectoryEmpty"> + <argument name="path">media/catalog/product/cache/</argument> + </helper> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushPageCache"> + <argument name="tags" value=""/> + </actionGroup> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront2"> + <argument name="product" value="$$createProduct$$"/> + </actionGroup> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImageActive($createProductImage2.entry[content][name]$)}}" stepKey="seeFirstImage2"/> + <grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.productImageActive($createProductImage2.entry[content][name]$)}}" stepKey="firstImageSrc2"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertImageContentIsEqual" stepKey="assertFirstImageContent2"> + <argument name="url">{$firstImageSrc2}</argument> + <argument name="expectedString">{{RedPngImageContent.baseImage_md5}}</argument> + <argument name="message">Url: "{$firstImageSrc2}" did not render image: {{RedPngImageContent.baseImage_md5}}</argument> + </helper> + <click selector="{{StorefrontProductMediaSection.productImageInFotorama($createProductImage1.entry[content][name]$)}}" stepKey="clickSecondImage2"/> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImageActive($createProductImage1.entry[content][name]$)}}" stepKey="seeSecondImage2"/> + <grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.productImageActive($createProductImage1.entry[content][name]$)}}" stepKey="secondImageSrc2"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertImageContentIsEqual" stepKey="assertSecondImageContent2"> + <argument name="url">{$secondImageSrc2}</argument> + <argument name="expectedString">{{BluePngImageContent.baseImage_md5}}</argument> + <argument name="message">Url: "{$secondImageSrc2}" did not render image: {{BluePngImageContent.baseImage_md5}}</argument> + </helper> + + <!-- Delete Images on Local File System --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteFileIfExists" stepKey="deleteLocalImage1"> + <argument name="filePath">pub/media/catalog/product/{$firstCharacterImage1FileName}/{$secondCharacterImage1FileName}/$createProductImage1.entry[content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalImage1IsDeleted"> + <argument name="path">pub/media/catalog/product/{$firstCharacterImage1FileName}/{$secondCharacterImage1FileName}/$createProductImage1.entry[content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteFileIfExists" stepKey="deleteLocalImage2"> + <argument name="filePath">pub/media/catalog/product/{$firstCharacterImage2FileName}/{$secondCharacterImage2FileName}/$createProductImage2.entry[content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalImage2IsDeleted"> + <argument name="path">pub/media/catalog/product/{$firstCharacterImage2FileName}/{$secondCharacterImage2FileName}/$createProductImage2.entry[content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteLocalCacheDirectory"> + <argument name="path">pub/media/catalog/product/cache/</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalCacheDirectoryDeleted"> + <argument name="path">pub/media/catalog/product/cache/</argument> + </helper> + + <!-- S3 - Clean Cache & Verify Images on Product Storefront Page --> + <actionGroup ref="AdminGoToCacheManagementPageActionGroup" stepKey="goToCacheManagementPage2"/> + <actionGroup ref="AdminClickFlushCatalogImagesCacheActionGroup" stepKey="clearCatalogImageCache2"/> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertDirectoryEmpty" stepKey="assertS3CacheDirectoryEmpty2"> + <argument name="path">media/catalog/product/cache/</argument> + </helper> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushPageCache2"> + <argument name="tags" value=""/> + </actionGroup> + + <!-- Assert Local File System Images & Cached Images Are Still Non-Existent --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalImage1IsDeleted2"> + <argument name="path">pub/media/catalog/product/{$firstCharacterImage1FileName}/{$secondCharacterImage1FileName}/$createProductImage1.entry[content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalImage2IsDeleted2"> + <argument name="path">pub/media/catalog/product/{$firstCharacterImage2FileName}/{$secondCharacterImage2FileName}/$createProductImage2.entry[content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalCacheDirectoryDeleted2"> + <argument name="path">pub/media/catalog/product/cache/</argument> + </helper> + + <!-- Open Product on Storefront, Assert S3 Images Exist & Get Cached, Assert Local File System Images & Cache Are Still Non-Existent --> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront3"> + <argument name="product" value="$$createProduct$$"/> + </actionGroup> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertS3Image1Exists2"> + <argument name="filePath">media/catalog/product/{$firstCharacterImage1FileName}/{$secondCharacterImage1FileName}/$createProductImage1.entry[content][name]$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertS3Image2Exists2"> + <argument name="filePath">media/catalog/product/{$firstCharacterImage2FileName}/{$secondCharacterImage2FileName}/$createProductImage2.entry[content][name]$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertDirectoryNotEmpty" stepKey="assertS3CacheDirectoryNotEmpty2"> + <argument name="path">media/catalog/product/cache/</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalImage1IsDeleted3"> + <argument name="path">pub/media/catalog/product/{$firstCharacterImage1FileName}/{$secondCharacterImage1FileName}/$createProductImage1.entry[content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalImage2IsDeleted3"> + <argument name="path">pub/media/catalog/product/{$firstCharacterImage2FileName}/{$secondCharacterImage2FileName}/$createProductImage2.entry[content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalCacheDirectoryGone"> + <argument name="path">pub/media/catalog/product/cache/</argument> + </helper> + + <!-- Verify Product Images Render Correctly When Images Initially Only Exist in S3 --> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImageActive($createProductImage2.entry[content][name]$)}}" stepKey="seeFirstImage3"/> + <grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.productImageActive($createProductImage2.entry[content][name]$)}}" stepKey="firstImageSrc3"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertImageContentIsEqual" stepKey="assertFirstImageContent3"> + <argument name="url">{$firstImageSrc3}</argument> + <argument name="expectedString">{{RedPngImageContent.baseImage_md5}}</argument> + <argument name="message">Url: "{$firstImageSrc3}" did not render image: {{RedPngImageContent.baseImage_md5}}</argument> + </helper> + <click selector="{{StorefrontProductMediaSection.productImageInFotorama($createProductImage1.entry[content][name]$)}}" stepKey="clickSecondImage3"/> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImageActive($createProductImage1.entry[content][name]$)}}" stepKey="seeSecondImage3"/> + <grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.productImageActive($createProductImage1.entry[content][name]$)}}" stepKey="secondImageSrc3"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertImageContentIsEqual" stepKey="assertSecondImageContent3"> + <argument name="url">{$secondImageSrc3}</argument> + <argument name="expectedString">{{BluePngImageContent.baseImage_md5}}</argument> + <argument name="message">Url: "{$secondImageSrc3}" did not render image: {{BluePngImageContent.baseImage_md5}}</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage, Clean Cache & Verify Images Do Not Appear on Product Storefront Page --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage"/> + <actionGroup ref="AdminGoToCacheManagementPageActionGroup" stepKey="goToCacheManagementPage3"/> + <actionGroup ref="AdminClickFlushCatalogImagesCacheActionGroup" stepKey="clearCatalogImageCache3"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalCacheDirectoryEmpty2"> + <argument name="path">pub/media/catalog/product/cache/</argument> + </helper> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushPageCache3"> + <argument name="tags" value=""/> + </actionGroup> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront4"> + <argument name="product" value="$$createProduct$$"/> + </actionGroup> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImageActive($createProductImage2.entry[content][name]$)}}" stepKey="seeFirstImage4"/> + <grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.productImageActive($createProductImage2.entry[content][name]$)}}" stepKey="firstImageSrc4"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertImageContentIsEqual" stepKey="assertFirstImageContent4"> + <argument name="url">{$firstImageSrc4}</argument> + <argument name="expectedString">{{MagentoPlaceHolderImageContent.baseImage_md5}}</argument> + <argument name="message">Url: "{$firstImageSrc4}" did not render image: {{MagentoPlaceHolderImageContent.baseImage_md5}}</argument> + </helper> + <click selector="{{StorefrontProductMediaSection.productImageInFotorama($createProductImage1.entry[content][name]$)}}" stepKey="clickSecondImage4"/> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImageActive($createProductImage1.entry[content][name]$)}}" stepKey="seeSecondImage4"/> + <grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.productImageActive($createProductImage1.entry[content][name]$)}}" stepKey="secondImageSrc4"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertImageContentIsEqual" stepKey="assertSecondImageContent4"> + <argument name="url">{$secondImageSrc4}</argument> + <argument name="expectedString">{{MagentoPlaceHolderImageContent.baseImage_md5}}</argument> + <argument name="message">Url: "{$secondImageSrc4}" did not render image: {{MagentoPlaceHolderImageContent.baseImage_md5}}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3AdminCreateDownloadableProductWithLinkTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3AdminCreateDownloadableProductWithLinkTest.xml index dd0fe36f44dd..85edd593d839 100644 --- a/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3AdminCreateDownloadableProductWithLinkTest.xml +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3AdminCreateDownloadableProductWithLinkTest.xml @@ -20,9 +20,6 @@ <testCaseId value="MC-38039"/> <group value="Downloadable"/> <group value="remote_storage_aws_s3"/> - <skip> - <issueId value="MQE-2288" /> - </skip> </annotations> <before> <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage"/> @@ -89,7 +86,7 @@ <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> <!-- Assert product in storefront category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <actionGroup ref="StorefrontCheckProductPriceInCategoryActionGroup" stepKey="StorefrontCheckCategorySimpleProduct"> <argument name="product" value="DownloadableProduct"/> @@ -157,21 +154,25 @@ <see selector="{{CheckoutCartProductSection.ProductPriceByName(DownloadableProduct.name)}}" userInput="$52.99" stepKey="assertProductPriceInCart"/> <!-- Perform checkout --> - <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="clickProceedToCheckout"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/> - <seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="navigateToCheckoutPage"/> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlacePurchaseOrder"/> + <comment userInput="BIC workaround" stepKey="clickProceedToCheckout"/> + <comment userInput="BIC workaround" stepKey="waitForPaymentSectionLoaded"/> + <comment userInput="BIC workaround" stepKey="clickPlaceOrderButton"/> + <comment userInput="BIC workaround" stepKey="orderIsSuccessfullyPlaced"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> - <!-- Open created order --> - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> - <actionGroup ref="SearchAdminDataGridByKeywordActionGroup" stepKey="searchOrder"> - <argument name="keyword" value="$grabOrderNumber"/> - </actionGroup> - <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/> - <!-- Open Create invoice --> - <actionGroup ref="AdminCreateInvoiceActionGroup" stepKey="createCreditMemo"/> + <comment userInput="BIC workaround" stepKey="onOrdersPage"/> + <comment userInput="BIC workaround" stepKey="searchOrder"/> + <comment userInput="BIC workaround" stepKey="clickOrderRow"/> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="goToOrderInAdmin"> + <argument name="orderId" value="{$grabOrderNumber}"/> + </actionGroup> + <comment userInput="BIC workaround" stepKey="createCreditMemo"/> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/> + <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> <!-- Check downloadable product link on frontend --> <actionGroup ref="StorefrontAssertDownloadableProductIsPresentInCustomerAccount" stepKey="seeStorefrontMyAccountDownloadableProductsLink"> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3StorefrontPrintOrderGuestTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3StorefrontPrintOrderGuestTest.xml index c8d2947632b5..71a66036012f 100644 --- a/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3StorefrontPrintOrderGuestTest.xml +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3StorefrontPrintOrderGuestTest.xml @@ -16,9 +16,6 @@ <severity value="BLOCKER"/> <testCaseId value="MC-38689"/> <group value="remote_storage_aws_s3"/> - <skip> - <issueId value="MQE-2288" /> - </skip> </annotations> <before> <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage"/> diff --git a/app/code/Magento/AwsS3/Test/Unit/Driver/AwsS3Test.php b/app/code/Magento/AwsS3/Test/Unit/Driver/AwsS3Test.php index a7bcf8c47fce..9c3863105e92 100644 --- a/app/code/Magento/AwsS3/Test/Unit/Driver/AwsS3Test.php +++ b/app/code/Magento/AwsS3/Test/Unit/Driver/AwsS3Test.php @@ -7,10 +7,11 @@ namespace Magento\AwsS3\Test\Unit\Driver; -use League\Flysystem\AdapterInterface; -use League\Flysystem\AwsS3v3\AwsS3Adapter; +use League\Flysystem\FilesystemAdapter; +use League\Flysystem\UnableToRetrieveMetadata; use Magento\AwsS3\Driver\AwsS3; use Magento\Framework\Exception\FileSystemException; +use Magento\RemoteStorage\Driver\Adapter\MetadataProviderInterface; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -28,19 +29,25 @@ class AwsS3Test extends TestCase private $driver; /** - * @var AwsS3Adapter|MockObject + * @var FilesystemAdapter|MockObject */ private $adapterMock; + /** + * @var MetadataProviderInterface|MockObject + */ + private $metadataProviderMock; + /** * @inheritDoc */ protected function setUp(): void { - $this->adapterMock = $this->getMockForAbstractClass(AdapterInterface::class); + $this->adapterMock = $this->getMockForAbstractClass(FilesystemAdapter::class); + $this->metadataProviderMock = $this->getMockForAbstractClass(MetadataProviderInterface::class); $loggerMock = $this->getMockForAbstractClass(LoggerInterface::class); - $this->driver = new AwsS3($this->adapterMock, $loggerMock, self::URL); + $this->driver = new AwsS3($this->adapterMock, $loggerMock, self::URL, $this->metadataProviderMock); } /** @@ -202,24 +209,33 @@ public function getRelativePathDataProvider(): array * @param bool $has * @param array $metadata * @param bool $expected + * @param iterable $listContents + * @param \Exception|null $metadataException * @throws FileSystemException - * * @dataProvider isDirectoryDataProvider */ public function testIsDirectory( string $path, string $normalizedPath, - bool $has, array $metadata, - bool $expected + bool $expected, + iterable $listContents, + \Throwable $listContentsException = null ): void { - $this->adapterMock->method('has') - ->with($normalizedPath) - ->willReturn($has); - $this->adapterMock->method('getMetadata') - ->with($normalizedPath) - ->willReturn($metadata); - + if (!empty($metadata)) { + $this->metadataProviderMock->method('getMetadata') + ->with($normalizedPath) + ->willReturn($metadata); + } + if ($listContentsException) { + $this->adapterMock->method('listContents') + ->with($normalizedPath) + ->willThrowException($listContentsException); + } else { + $this->adapterMock->method('listContents') + ->with($normalizedPath) + ->willReturn($listContents); + } self::assertSame($expected, $this->driver->isDirectory($path)); } @@ -229,53 +245,49 @@ public function testIsDirectory( public function isDirectoryDataProvider(): array { return [ - [ + 'empty metadata' => [ 'some_directory/', 'some_directory', - false, [], - false + false, + new \ArrayIterator([]), + new \Exception('Closed iterator'), ], [ 'some_directory', 'some_directory', - true, [ 'type' => AwsS3::TYPE_DIR ], - true + true, + new \ArrayIterator(['some_directory']), ], [ self::URL . 'some_directory', 'some_directory', - true, [ 'type' => AwsS3::TYPE_DIR ], - true - ], - [ - self::URL . 'some_directory', - 'some_directory', true, - [ - 'type' => AwsS3::TYPE_FILE - ], - false + new \ArrayIterator(['some_directory']), ], [ '', '', + [ + 'type' => AwsS3::TYPE_DIR + ], true, - [], - true + new \ArrayIterator(['']), ], [ '/', '', + [ + 'type' => AwsS3::TYPE_DIR + ], true, - [], - true + new \ArrayIterator(['']), ], ]; } @@ -297,13 +309,12 @@ public function testIsFile( array $metadata, bool $expected ): void { - $this->adapterMock->method('has') + $this->adapterMock->method('fileExists') ->with($normalizedPath) ->willReturn($has); - $this->adapterMock->method('getMetadata') + $this->metadataProviderMock->method('getMetadata') ->with($normalizedPath) ->willReturn($metadata); - self::assertSame($expected, $this->driver->isFile($path)); } @@ -408,21 +419,18 @@ public function testSearchDirectory(): void $expression = '/*'; $path = 'path'; $subPaths = [ - ['path' => 'path/1', 'dirname' => self::URL], - ['path' => 'path/2', 'dirname' => self::URL] + new \League\Flysystem\DirectoryAttributes('path/1/'), + new \League\Flysystem\DirectoryAttributes('path/2/') ]; - $expectedResult = [self::URL . 'path/1', self::URL . 'path/2']; - $this->adapterMock->expects(self::atLeastOnce())->method('has') - ->willReturnMap([ - [$path, true] - ]); - $this->adapterMock->expects(self::atLeastOnce())->method('getMetadata') + $expectedResult = [self::URL . 'path/1/', self::URL . 'path/2/']; + $this->metadataProviderMock->expects(self::any())->method('getMetadata') ->willReturnMap([ - [$path, ['type' => AwsS3::TYPE_DIR]] + ['path', ['type' => AwsS3::TYPE_DIR]], + ['path/1', ['type' => AwsS3::TYPE_FILE]], + ['path/2', ['type' => AwsS3::TYPE_FILE]], ]); $this->adapterMock->expects(self::atLeastOnce())->method('listContents') - ->with($path, false) - ->willReturn($subPaths); + ->willReturn(new \ArrayIterator($subPaths)); self::assertEquals($expectedResult, $this->driver->search($expression, $path)); } @@ -435,20 +443,17 @@ public function testSearchFiles(): void $expression = '/*'; $path = 'path'; $subPaths = [ - ['path' => 'path/1.jpg', 'dirname' => self::URL], - ['path' => 'path/2.png', 'dirname' => self::URL] + new \League\Flysystem\DirectoryAttributes('path/1.jpg'), + new \League\Flysystem\DirectoryAttributes('path/2.png') ]; $expectedResult = [self::URL . 'path/1.jpg', self::URL . 'path/2.png']; - - $this->adapterMock->expects(self::atLeastOnce())->method('has') + $this->metadataProviderMock->expects(self::atLeastOnce())->method('getMetadata') ->willReturnMap([ - [$path, true], + ['path', ['type' => AwsS3::TYPE_DIR]], + ['path/1.jpg', ['type' => AwsS3::TYPE_FILE]], + ['path/2.png', ['type' => AwsS3::TYPE_FILE]], ]); - $this->adapterMock->expects(self::atLeastOnce())->method('getMetadata') - ->willReturnMap([ - [$path, ['type' => AwsS3::TYPE_DIR]], - ]); - $this->adapterMock->expects(self::atLeastOnce())->method('listContents')->with($path, false) + $this->adapterMock->expects(self::atLeastOnce())->method('listContents') ->willReturn($subPaths); self::assertEquals($expectedResult, $this->driver->search($expression, $path)); @@ -459,21 +464,22 @@ public function testSearchFiles(): void */ public function testCreateDirectory(): void { - $this->adapterMock->expects(self::exactly(2)) - ->method('has') - ->willReturnMap([ - ['test', true], - ['test/test2', false] - ]); - $this->adapterMock->expects(self::once()) + $this->metadataProviderMock->expects($this->any()) ->method('getMetadata') - ->willReturnMap([ - ['test', ['type' => AwsS3::TYPE_DIR]] - ]); - $this->adapterMock->expects(self::once()) - ->method('createDir') + ->willReturnCallback(function ($param) { + if ($param == 'test') { + return ['type' => AwsS3::TYPE_DIR]; + } else { + throw new UnableToRetrieveMetadata(''); + } + }); + $this->adapterMock->expects($this->any()) + ->method('listContents') ->with('test/test2') - ->willReturn(true); + ->willReturn(new \EmptyIterator()); + $this->adapterMock->expects(self::once()) + ->method('createDirectory') + ->with('test/test2'); self::assertTrue($this->driver->createDirectory(self::URL . 'test/test2/')); } diff --git a/app/code/Magento/AwsS3/composer.json b/app/code/Magento/AwsS3/composer.json index 77ed75862d19..2bf91663f588 100644 --- a/app/code/Magento/AwsS3/composer.json +++ b/app/code/Magento/AwsS3/composer.json @@ -6,11 +6,10 @@ }, "require": { "php": "~7.3.0||~7.4.0", - "magento/framework": "^100.0.2", + "magento/framework": "*", "magento/module-remote-storage": "*", - "league/flysystem": "^1.0", - "league/flysystem-aws-s3-v3": "^1.0", - "league/flysystem-cached-adapter": "^1.0" + "league/flysystem": "^2.0", + "league/flysystem-aws-s3-v3": "^2.0" }, "type": "magento2-module", "license": [ diff --git a/app/code/Magento/AwsS3/etc/di.xml b/app/code/Magento/AwsS3/etc/di.xml index 94df51fcd685..04f68d289058 100644 --- a/app/code/Magento/AwsS3/etc/di.xml +++ b/app/code/Magento/AwsS3/etc/di.xml @@ -13,4 +13,9 @@ </argument> </arguments> </type> + <type name="Magento\RemoteStorage\Driver\Adapter\MetadataProvider"> + <arguments> + <argument name="adapter" xsi:type="object">League\Flysystem\AwsS3V3\AwsS3V3Adapter</argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Backend/App/Action/Plugin/Authentication.php b/app/code/Magento/Backend/App/Action/Plugin/Authentication.php index 4b25e9921e40..8227966e43f6 100644 --- a/app/code/Magento/Backend/App/Action/Plugin/Authentication.php +++ b/app/code/Magento/Backend/App/Action/Plugin/Authentication.php @@ -225,7 +225,10 @@ protected function _redirectIfNeededAfterLogin(\Magento\Framework\App\RequestInt // Checks, whether secret key is required for admin access or request uri is explicitly set if ($this->_url->useSecretKey()) { - $requestUri = $this->_url->getUrl('*/*/*', ['_current' => true]); + $requestParts = explode('/', trim($request->getRequestUri(), '/'), 3); + $baseUrlPath = trim(parse_url($this->backendUrl->getBaseUrl(), PHP_URL_PATH), '/'); + $routeIndex = empty($baseUrlPath) ? 0 : 1; + $requestUri = $this->_url->getUrl($requestParts[$routeIndex]); } elseif ($request) { $requestUri = $request->getRequestUri(); } diff --git a/app/code/Magento/Backend/Block/Dashboard/Bar.php b/app/code/Magento/Backend/Block/Dashboard/Bar.php index 57f13c740f78..65c0aa961edf 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Bar.php +++ b/app/code/Magento/Backend/Block/Dashboard/Bar.php @@ -5,6 +5,7 @@ */ namespace Magento\Backend\Block\Dashboard; +use Magento\Directory\Model\Currency; use Magento\Store\Model\Store; /** @@ -20,10 +21,15 @@ class Bar extends \Magento\Backend\Block\Dashboard\AbstractDashboard protected $_totals = []; /** - * @var \Magento\Directory\Model\Currency|null + * @var Currency|null */ protected $_currentCurrencyCode = null; + /** + * @var Currency + */ + private $_currency; + /** * Get totals * @@ -67,7 +73,7 @@ public function format($price) /** * Setting currency model * - * @param \Magento\Directory\Model\Currency $currency + * @param Currency $currency * @return void */ public function setCurrency($currency) @@ -78,7 +84,7 @@ public function setCurrency($currency) /** * Retrieve currency model if not set then return currency model for current store * - * @return \Magento\Directory\Model\Currency + * @return Currency * @SuppressWarnings(PHPMD.RequestAwareBlockMethod) */ public function getCurrency() diff --git a/app/code/Magento/Backend/Block/Store/Switcher.php b/app/code/Magento/Backend/Block/Store/Switcher.php index 2b9f70844df8..2ae929f9b739 100644 --- a/app/code/Magento/Backend/Block/Store/Switcher.php +++ b/app/code/Magento/Backend/Block/Store/Switcher.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Backend\Block\Store; @@ -17,7 +18,7 @@ class Switcher extends \Magento\Backend\Block\Template /** * URL for store switcher hint */ - const HINT_URL = 'https://docs.magento.com/m2/ce/user_guide/configuration/scope.html'; + const HINT_URL = 'https://docs.magento.com/user-guide/configuration/scope.html'; /** * Name of website variable @@ -114,7 +115,8 @@ protected function _construct() { parent::_construct(); - $this->setUseConfirm(true); + $this->setUseConfirm($this->hasData('use_confirm') ? (bool)$this->getData('use_confirm') : true); + $this->setUseAjax(true); $this->setShowManageStoresLink(0); @@ -449,14 +451,17 @@ public function hasScopeSelected() */ public function getCurrentSelectionName() { - if (!($name = $this->getCurrentStoreName())) { - if (!($name = $this->getCurrentStoreGroupName())) { - if (!($name = $this->getCurrentWebsiteName())) { - $name = $this->getDefaultSelectionName(); - } - } + if ($this->getCurrentStoreName() !== '') { + return $this->getCurrentStoreName(); + } + if ($this->getCurrentStoreGroupName() !== '') { + return $this->getCurrentStoreGroupName(); + } + + if ($this->getCurrentWebsiteName() !== '') { + return $this->getCurrentWebsiteName(); } - return $name; + return $this->getDefaultSelectionName(); } /** @@ -473,6 +478,8 @@ public function getCurrentWebsiteName() return $website->getName(); } } + + return ''; } /** @@ -489,6 +496,8 @@ public function getCurrentStoreGroupName() return $group->getName(); } } + + return ''; } /** @@ -505,6 +514,8 @@ public function getCurrentStoreName() return $store->getName(); } } + + return ''; } /** @@ -586,13 +597,11 @@ public function getHintHtml() $html = ''; $url = $this->getHintUrl(); if ($url) { - $html = '<div class="admin__field-tooltip tooltip">' . '<a' . ' href="' . $this->escapeUrl( - $url - ) . '"' . ' onclick="this.target=\'_blank\'"' . ' title="' . __( - 'What is this?' - ) . '"' . ' class="admin__field-tooltip-action action-help"><span>' . __( - 'What is this?' - ) . '</span></a>' . ' </div>'; + $html = '<div class="admin__field-tooltip tooltip"><a href="%s" onclick="this.target=\'_blank\'" title="%s" + class="admin__field-tooltip-action action-help"><span>%s</span></a></span></div>'; + $title = $this->escapeHtmlAttr(__('What is this?')); + $span= $this->escapeHtml(__('What is this?')); + $html = sprintf($html, $this->escapeUrl($url), $title, $span); } return $html; } diff --git a/app/code/Magento/Backend/Block/Widget.php b/app/code/Magento/Backend/Block/Widget.php index d2f9ac485b7c..05a7444998c8 100644 --- a/app/code/Magento/Backend/Block/Widget.php +++ b/app/code/Magento/Backend/Block/Widget.php @@ -15,6 +15,8 @@ class Widget extends \Magento\Backend\Block\Template { /** + * Get ID + * * @return string */ public function getId() @@ -37,6 +39,8 @@ public function getSuffixId($suffix) } /** + * Get HTML ID + * * @return string */ public function getHtmlId() @@ -59,6 +63,8 @@ public function getCurrentUrl($params = []) } /** + * Prepare Breadcrumbs + * * @param string $label * @param string|null $title * @param string|null $link @@ -84,7 +90,13 @@ public function getButtonHtml($label, $onclick, $class = '', $buttonId = null, $ return $this->getLayout()->createBlock( \Magento\Backend\Block\Widget\Button::class )->setData( - ['label' => $label, 'onclick' => $onclick, 'class' => $class, 'type' => 'button', 'id' => $buttonId] + [ + 'label' => $label, + 'onclick' => $onclick, + 'class' => $class, + 'type' => 'button', + 'id' => $buttonId + ] )->setDataAttribute( $dataAttr )->toHtml(); diff --git a/app/code/Magento/Backend/Block/Widget/Form.php b/app/code/Magento/Backend/Block/Widget/Form.php index 38d5d90a22d1..b673dbdca859 100644 --- a/app/code/Magento/Backend/Block/Widget/Form.php +++ b/app/code/Magento/Backend/Block/Widget/Form.php @@ -230,6 +230,10 @@ protected function _applyTypeSpecificConfig($inputType, $element, \Magento\Eav\M case 'date': $element->setDateFormat($this->_localeDate->getDateFormatWithLongYear()); break; + case 'datetime': + $element->setDateFormat($this->_localeDate->getDateFormatWithLongYear()); + $element->setTimeFormat($this->_localeDate->getTimeFormat()); + break; case 'multiline': $element->setLineCount($attribute->getMultilineCount()); break; @@ -246,7 +250,13 @@ protected function _applyTypeSpecificConfig($inputType, $element, \Magento\Eav\M */ protected function _addElementTypes(\Magento\Framework\Data\Form\AbstractForm $baseElement) { - $types = $this->_getAdditionalElementTypes(); + $types = array_merge( + [ + 'datetime' => 'date' + ], + $this->_getAdditionalElementTypes() + ); + foreach ($types as $code => $className) { $baseElement->addType($code, $className); } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php b/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php index 1de77c810f31..410265c63221 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php @@ -1,13 +1,17 @@ <?php /** - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Backend\Controller\Adminhtml\Auth; +use Magento\Backend\App\Area\FrontNameResolver; +use Magento\Backend\App\BackendAppList; +use Magento\Backend\Model\UrlFactory; use Magento\Framework\App\Action\HttpGetActionInterface as HttpGet; use Magento\Framework\App\Action\HttpPostActionInterface as HttpPost; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\App\Request\Http; /** * @api @@ -20,18 +24,50 @@ class Login extends \Magento\Backend\Controller\Adminhtml\Auth implements HttpGe */ protected $resultPageFactory; + /** + * @var FrontNameResolver + */ + private $frontNameResolver; + + /** + * @var BackendAppList + */ + private $backendAppList; + + /** + * @var UrlFactory + */ + private $backendUrlFactory; + + /** + * @var Http + */ + private $http; + /** * Constructor * * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory + * @param FrontNameResolver|null $frontNameResolver + * @param BackendAppList|null $backendAppList + * @param UrlFactory|null $backendUrlFactory + * @param Http|null $http */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Framework\View\Result\PageFactory $resultPageFactory + \Magento\Framework\View\Result\PageFactory $resultPageFactory, + FrontNameResolver $frontNameResolver = null, + BackendAppList $backendAppList = null, + UrlFactory $backendUrlFactory = null, + Http $http = null ) { $this->resultPageFactory = $resultPageFactory; parent::__construct($context); + $this->frontNameResolver = $frontNameResolver ?? ObjectManager::getInstance()->get(FrontNameResolver::class); + $this->backendAppList = $backendAppList ?? ObjectManager::getInstance()->get(BackendAppList::class); + $this->backendUrlFactory = $backendUrlFactory ?? ObjectManager::getInstance()->get(UrlFactory::class); + $this->http = $http ?? ObjectManager::getInstance()->get(Http::class); } /** @@ -49,11 +85,11 @@ public function execute() } $requestUrl = $this->getRequest()->getUri(); - $backendUrl = $this->getUrl('*'); - // redirect according to rewrite rule - if ($requestUrl != $backendUrl) { - return $this->getRedirect($backendUrl); + + if (!$requestUrl->isValid() || !$this->isValidBackendUri()) { + return $this->getRedirect($this->getUrl('*')); } + return $this->resultPageFactory->create(); } @@ -70,4 +106,26 @@ private function getRedirect($path) $resultRedirect->setPath($path); return $resultRedirect; } + + /** + * Verify if correct backend uri requested. + * + * @return bool + */ + private function isValidBackendUri(): bool + { + $requestUri = $this->getRequest()->getRequestUri(); + $backendApp = $this->backendAppList->getCurrentApp(); + $baseUrl = parse_url($this->backendUrlFactory->create()->getBaseUrl(), PHP_URL_PATH); + if (!$backendApp) { + $backendFrontName = $this->frontNameResolver->getFrontName(); + } else { + //In case of application authenticating through the admin login, the script name should be removed + //from the path, because application has own script. + $baseUrl = $this->http->getUrlNoScript($baseUrl); + $backendFrontName = $backendApp->getCookiePath(); + } + + return strpos($requestUri, $baseUrl . $backendFrontName) === 0; + } } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/RefreshStatistics.php b/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/RefreshStatistics.php index c709859adb19..167cefa7123a 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/RefreshStatistics.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/RefreshStatistics.php @@ -6,8 +6,11 @@ namespace Magento\Backend\Controller\Adminhtml\Dashboard; +use Magento\Backend\App\Action\Context; use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\Stdlib\DateTime\Filter\Date; use Magento\Reports\Controller\Adminhtml\Report\Statistics; +use Psr\Log\LoggerInterface; /** * Refresh Dashboard statistics action. @@ -15,16 +18,21 @@ class RefreshStatistics extends Statistics implements HttpPostActionInterface { /** - * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Framework\Stdlib\DateTime\Filter\Date $dateFilter + * @var LoggerInterface + */ + private $logger; + + /** + * @param Context $context + * @param Date $dateFilter * @param array $reportTypes - * @param \Psr\Log\LoggerInterface $logger + * @param LoggerInterface $logger */ public function __construct( - \Magento\Backend\App\Action\Context $context, - \Magento\Framework\Stdlib\DateTime\Filter\Date $dateFilter, + Context $context, + Date $dateFilter, array $reportTypes, - \Psr\Log\LoggerInterface $logger + LoggerInterface $logger ) { parent::__construct($context, $dateFilter, $reportTypes); $this->logger = $logger; diff --git a/app/code/Magento/Backend/Model/Auth/Session.php b/app/code/Magento/Backend/Model/Auth/Session.php index 8f959d873243..b52796d75659 100644 --- a/app/code/Magento/Backend/Model/Auth/Session.php +++ b/app/code/Magento/Backend/Model/Auth/Session.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Backend\Model\Auth; use Magento\Framework\App\ObjectManager; @@ -210,7 +212,8 @@ public function prolong() ->setPath($this->sessionConfig->getCookiePath()) ->setDomain($this->sessionConfig->getCookieDomain()) ->setSecure($this->sessionConfig->getCookieSecure()) - ->setHttpOnly($this->sessionConfig->getCookieHttpOnly()); + ->setHttpOnly($this->sessionConfig->getCookieHttpOnly()) + ->setSameSite($this->sessionConfig->getCookieSameSite()); $this->cookieManager->setPublicCookie($this->getName(), $cookieValue, $cookieMetadata); } } diff --git a/app/code/Magento/Backend/Model/Menu/Config.php b/app/code/Magento/Backend/Model/Menu/Config.php index b268da43f6f7..1e6d2bbc2189 100644 --- a/app/code/Magento/Backend/Model/Menu/Config.php +++ b/app/code/Magento/Backend/Model/Menu/Config.php @@ -63,6 +63,11 @@ class Config */ protected $_appState; + /** + * @var Builder + */ + private $_menuBuilder; + /** * @param \Magento\Backend\Model\Menu\Builder $menuBuilder * @param \Magento\Backend\Model\Menu\AbstractDirector $menuDirector diff --git a/app/code/Magento/Backend/Model/Session/AdminConfig.php b/app/code/Magento/Backend/Model/Session/AdminConfig.php index 2662d7a2d7ee..ee5a59f86c00 100644 --- a/app/code/Magento/Backend/Model/Session/AdminConfig.php +++ b/app/code/Magento/Backend/Model/Session/AdminConfig.php @@ -85,6 +85,7 @@ public function __construct( $this->setCookiePath($adminPath); $this->setName($sessionName); $this->setCookieSecure($this->_httpRequest->isSecure()); + $this->setCookieSameSite('Lax'); } /** @@ -96,6 +97,7 @@ private function extractAdminPath() { $backendApp = $this->backendAppList->getCurrentApp(); $cookiePath = null; + //phpcs:ignore $baseUrl = parse_url($this->backendUrlFactory->create()->getBaseUrl(), PHP_URL_PATH); if (!$backendApp) { $cookiePath = $baseUrl . $this->_frontNameResolver->getFrontName(); diff --git a/app/code/Magento/Backend/Model/Validator/UrlKey/CompositeUrlKey.php b/app/code/Magento/Backend/Model/Validator/UrlKey/CompositeUrlKey.php new file mode 100644 index 000000000000..d144bff9ef9f --- /dev/null +++ b/app/code/Magento/Backend/Model/Validator/UrlKey/CompositeUrlKey.php @@ -0,0 +1,41 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Backend\Model\Validator\UrlKey; + +/** + * Class Composite validates if urlKey doesn't matches frontName or restricted words(endpoint names) + */ +class CompositeUrlKey implements UrlKeyValidatorInterface +{ + /** + * @var UrlKeyValidatorInterface[] + */ + private $validators; + + /** + * @param array $validators + */ + public function __construct( + array $validators = [] + ) { + $this->validators = $validators; + } + + /** + * @inheritDoc + */ + public function validate(string $urlKey): array + { + $errors = []; + foreach ($this->validators as $validator) { + $errors[] = $validator->validate($urlKey); + } + + return array_merge([], ...$errors); + } +} diff --git a/app/code/Magento/Backend/Model/Validator/UrlKey/FrontName.php b/app/code/Magento/Backend/Model/Validator/UrlKey/FrontName.php new file mode 100644 index 000000000000..c2c9a4d0be81 --- /dev/null +++ b/app/code/Magento/Backend/Model/Validator/UrlKey/FrontName.php @@ -0,0 +1,48 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Backend\Model\Validator\UrlKey; + +use Magento\Backend\App\Area\FrontNameResolver; + +/** + * Class FrontName validates if urlKey doesn't matches frontName + */ +class FrontName implements UrlKeyValidatorInterface +{ + /** + * @var FrontNameResolver + */ + private $frontNameResolver; + + /** + * @param FrontNameResolver $frontNameResolver + */ + public function __construct( + FrontNameResolver $frontNameResolver + ) { + $this->frontNameResolver = $frontNameResolver; + } + + /** + * @inheritDoc + */ + public function validate(string $urlKey): array + { + $errors = []; + $frontName = $this->frontNameResolver->getFrontName(); + if ($urlKey == $frontName) { + $errors[] = __( + 'URL key "%1" matches a reserved endpoint name (%2). Use another URL key.', + $urlKey, + $frontName + ); + } + + return $errors; + } +} diff --git a/app/code/Magento/Backend/Model/Validator/UrlKey/RestrictedWords.php b/app/code/Magento/Backend/Model/Validator/UrlKey/RestrictedWords.php new file mode 100644 index 000000000000..7fd72d5e35ad --- /dev/null +++ b/app/code/Magento/Backend/Model/Validator/UrlKey/RestrictedWords.php @@ -0,0 +1,47 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Backend\Model\Validator\UrlKey; + +use Magento\Framework\Validator\UrlKey; + +/** + * Class RestrictedWords validates if urlKey doesn't matches restricted words(endpoint names) + */ +class RestrictedWords implements UrlKeyValidatorInterface +{ + /** + * @var UrlKey + */ + private $urlKey; + + /** + * @param UrlKey $urlKey + */ + public function __construct( + UrlKey $urlKey + ) { + $this->urlKey = $urlKey; + } + + /** + * @inheritDoc + */ + public function validate(string $urlKey): array + { + $errors = []; + if (!$this->urlKey->isValid($urlKey)) { + $errors[] = __( + 'URL key "%1" matches a reserved endpoint name (%2). Use another URL key.', + $urlKey, + implode(', ', $this->urlKey->getRestrictedValues()) + ); + } + + return $errors; + } +} diff --git a/app/code/Magento/Backend/Model/Validator/UrlKey/UrlKeyValidatorInterface.php b/app/code/Magento/Backend/Model/Validator/UrlKey/UrlKeyValidatorInterface.php new file mode 100644 index 000000000000..058162e722a0 --- /dev/null +++ b/app/code/Magento/Backend/Model/Validator/UrlKey/UrlKeyValidatorInterface.php @@ -0,0 +1,22 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Backend\Model\Validator\UrlKey; + +/** + * Interface UrlKeyValidatorInterface is responsive for validating urlKeys + */ +interface UrlKeyValidatorInterface +{ + /** + * Validates urlKey + * + * @param string $urlKey + * @return array + */ + public function validate(string $urlKey): array; +} diff --git a/app/code/Magento/Backend/README.md b/app/code/Magento/Backend/README.md index f70dc9f67623..10d5b7baec9a 100644 --- a/app/code/Magento/Backend/README.md +++ b/app/code/Magento/Backend/README.md @@ -21,48 +21,48 @@ Before disabling or uninstalling this module, note that the following modules de - Magento_User - Magento_Webapi -For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html). +For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Structure -Beyond the [usual module file structure](https://devdocs.magento.com/guides/v2.3/architecture/archi_perspectives/components/modules/mod_intro.html) the module contains a directory `Service/V1`. +Beyond the [usual module file structure](https://devdocs.magento.com/guides/v2.4/architecture/archi_perspectives/components/modules/mod_intro.html) the module contains a directory `Service/V1`. `Service/V1` - contains logic to provide a list of modules installed in Magento. -For information about typical file structure of a module in Magento 2, see [Module file structure](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/build/module-file-structure.html#module-file-structure). +For information about typical file structure of a module in Magento 2, see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). ## Extensibility -Extension developers can interact with the Magento_Backend module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_Backend module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Backend module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Backend module. ### Events The module dispatches the following events: - - `adminhtml_block_html_before` event in the `\Magento\Backend\Block\Template::_toHtml()` method. Parameters: - - `block` is the backend block template (this) (`\Magento\Backend\Block\Template` class). - - `adminhtml_store_edit_form_prepare_form` event in the `\Magento\Backend\Block\System\Store\Edit\AbstractForm::_prepareForm()` method. Parameters: - - `block` is the AbstractForm block (this) (`\Magento\Backend\Block\System\Store\Edit\AbstractForm` class). - - `backend_block_widget_grid_prepare_grid_before` event in the `\Magento\Backend\Block\Widget\Grid::_prepareGrid()` method. Parameters: - - `grid` is the widget grid block (this) (`\Magento\Backend\Block\Widget\Grid` class) - - `collection` is the grid collection (`\Magento\Framework\Data\Collection` class). - - `adminhtml_cache_flush_system` event in the `\Magento\Backend\Console\Command\CacheCleanCommand::performAction()` method. - - `adminhtml_cache_flush_all` event in the `\Magento\Backend\Console\Command\CacheFlushCommand::performAction()` method. - - `clean_catalog_images_cache_after` event in the `\Magento\Backend\Controller\Adminhtml\Cache\CleanImages::execute()` method. - - `clean_media_cache_after` event in the `\Magento\Backend\Controller\Adminhtml\Cache\CleanMedia::execute()` method. - - `clean_static_files_cache_after` event in the `\Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles::execute()` method. - - `adminhtml_cache_flush_all` event in the `\Magento\Backend\Controller\Adminhtml\Cache\FlushAll::execute()` method. - - `adminhtml_cache_flush_system` event in the `\Magento\Backend\Controller\Adminhtml\Cache\FlushSystem::execute()` method. - - `theme_save_after` event in the `\Magento\Backend\Controller\Adminhtml\System\Design\Save::execute()` method. - - `backend_auth_user_login_success` event in the `\Magento\Backend\Model\Auth::login()` method. Parameters: - - `user` is the credential storage object (`null | \Magento\Backend\Model\Auth\Credential\StorageInterface`) - - `backend_auth_user_login_failed` event in the `\Magento\Backend\Model\Auth::login()` method. Parameters: - - `user_name` is username extracted from the credential storage object (`null | \Magento\Backend\Model\Auth\Credential\StorageInterface`) - - `exception` any exception generated (`\Magento\Framework\Exception\LocalizedException | \Magento\Framework\Exception\Plugin\AuthenticationException`) - -For information about an event in Magento 2, see [Events and observers](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/events-and-observers.html#events). +- `adminhtml_block_html_before` event in the `\Magento\Backend\Block\Template::_toHtml()` method. Parameters: + - `block` is the backend block template (this) (`\Magento\Backend\Block\Template` class). +- `adminhtml_store_edit_form_prepare_form` event in the `\Magento\Backend\Block\System\Store\Edit\AbstractForm::_prepareForm()` method. Parameters: + - `block` is the AbstractForm block (this) (`\Magento\Backend\Block\System\Store\Edit\AbstractForm` class). +- `backend_block_widget_grid_prepare_grid_before` event in the `\Magento\Backend\Block\Widget\Grid::_prepareGrid()` method. Parameters: + - `grid` is the widget grid block (this) (`\Magento\Backend\Block\Widget\Grid` class) + - `collection` is the grid collection (`\Magento\Framework\Data\Collection` class). +- `adminhtml_cache_flush_system` event in the `\Magento\Backend\Console\Command\CacheCleanCommand::performAction()` method. +- `adminhtml_cache_flush_all` event in the `\Magento\Backend\Console\Command\CacheFlushCommand::performAction()` method. +- `clean_catalog_images_cache_after` event in the `\Magento\Backend\Controller\Adminhtml\Cache\CleanImages::execute()` method. +- `clean_media_cache_after` event in the `\Magento\Backend\Controller\Adminhtml\Cache\CleanMedia::execute()` method. +- `clean_static_files_cache_after` event in the `\Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles::execute()` method. +- `adminhtml_cache_flush_all` event in the `\Magento\Backend\Controller\Adminhtml\Cache\FlushAll::execute()` method. +- `adminhtml_cache_flush_system` event in the `\Magento\Backend\Controller\Adminhtml\Cache\FlushSystem::execute()` method. +- `theme_save_after` event in the `\Magento\Backend\Controller\Adminhtml\System\Design\Save::execute()` method. +- `backend_auth_user_login_success` event in the `\Magento\Backend\Model\Auth::login()` method. Parameters: + - `user` is the credential storage object (`null | \Magento\Backend\Model\Auth\Credential\StorageInterface`) +- `backend_auth_user_login_failed` event in the `\Magento\Backend\Model\Auth::login()` method. Parameters: + - `user_name` is username extracted from the credential storage object (`null | \Magento\Backend\Model\Auth\Credential\StorageInterface`) + - `exception` any exception generated (`\Magento\Framework\Exception\LocalizedException | \Magento\Framework\Exception\Plugin\AuthenticationException`) + +For information about an event in Magento 2, see [Events and observers](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). ### Layouts @@ -94,8 +94,7 @@ This module introduces the following layouts and layout handles in the `view/adm - `overlay_popup` - `popup` - -For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html). +For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). ### UI components @@ -104,8 +103,8 @@ You can extend Magento_Backend module using the following configuration files: - `view/adminhtml/ui_component/design_config_form.xml` - `view/adminhtml/ui_component/design_config_listing.xml` -For information about UI components in Magento 2, see [Overview of UI components](https://devdocs.magento.com/guides/v2.3/ui_comp_guide/bk-ui_comps.html). +For information about UI components in Magento 2, see [Overview of UI components](https://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickFlushCatalogImagesCacheActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickFlushCatalogImagesCacheActionGroup.xml new file mode 100644 index 000000000000..ba36e4f0a84c --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickFlushCatalogImagesCacheActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickFlushCatalogImagesCacheActionGroup"> + <annotations> + <description>Clicks the 'Flush Catalog Images Cache' button on the Admin Cache Management page</description> + </annotations> + <waitForElementVisible selector="{{AdminCacheManagementSection.flushCatalogImagesCacheButton}}" stepKey="waitForFlushCatalogImagesCacheButton"/> + <click selector="{{AdminCacheManagementSection.flushCatalogImagesCacheButton}}" stepKey="clickFlushCatalogImagesCacheButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForText userInput="The image cache was cleaned." selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminFilterLegacyGridActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminFilterLegacyGridActionGroup.xml index 3b1ed2c6a767..92c8eeb644ce 100644 --- a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminFilterLegacyGridActionGroup.xml +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminFilterLegacyGridActionGroup.xml @@ -11,8 +11,10 @@ <actionGroup name="AdminFilterLegacyGridActionGroup"> <arguments> <argument name="value" type="string"/> + <argument name="field" type="string" defaultValue="{{AdminLegacyDataGridFilterSection.inputFieldByNameAttr('name')}}"/> <argument name="button" type="string" defaultValue="{{AdminLegacyDataGridFilterSection.apply}}"/> </arguments> + <waitForElementVisible selector="{{AdminLegacyDataGridFilterSection.clear}}" stepKey="waitForResetFilters" /> <click selector="{{AdminLegacyDataGridFilterSection.clear}}" stepKey="resetFilters" /> <waitForPageLoad stepKey="waitForFilterReset" /> <fillField selector="{{field}}" userInput="{{value}}" stepKey="fillFieldInFilter"/> diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminGoToCacheManagementPageActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminGoToCacheManagementPageActionGroup.xml new file mode 100644 index 000000000000..5d3d9a32df68 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminGoToCacheManagementPageActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminGoToCacheManagementPageActionGroup"> + <annotations> + <description>Goes to the Admin Cache Management page</description> + </annotations> + <amOnPage url="{{AdminCacheManagementPage.url}}" stepKey="goToCacheManagementPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminDashboardDisplayedWithNoErrorsActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminDashboardDisplayedWithNoErrorsActionGroup.xml new file mode 100644 index 000000000000..3afe1cbde1c4 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminDashboardDisplayedWithNoErrorsActionGroup.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminDashboardDisplayedWithNoErrorsActionGroup"> + <annotations> + <description>Checks if Dashboard is displayed properly</description> + </annotations> + + <seeElement selector="{{AdminDashboardSection.dashboardDiagramOrderContentTab}}" stepKey="seeOrderContentTab"/> + <seeElement selector="{{AdminDashboardSection.dashboardDiagramContent}}" stepKey="seeDiagramContent"/> + <click selector="{{AdminDashboardSection.dashboardDiagramAmounts}}" stepKey="clickDashboardAmount"/> + <waitForLoadingMaskToDisappear stepKey="waitForDashboardAmountLoading"/> + <seeElement selector="{{AdminDashboardSection.dashboardDiagramAmountsContentTab}}" stepKey="seeDiagramAmountContent"/> + <seeElement selector="{{AdminDashboardSection.dashboardDiagramTotals}}" stepKey="seeAmountTotals"/> + <dontSeeJsError stepKey="dontSeeJsError"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/Data/AdminWebConfigData.xml b/app/code/Magento/Backend/Test/Mftf/Data/AdminWebConfigData.xml new file mode 100644 index 000000000000..dba631f46e70 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Data/AdminWebConfigData.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="AdminEnableUrlRewritesConfigData"> + <data key="path">web/seo/use_rewrites</data> + <data key="value">1</data> + </entity> + <entity name="AdminDisableUrlRewritesConfigData"> + <data key="path">web/seo/use_rewrites</data> + <data key="value">0</data> + </entity> +</entities> diff --git a/app/code/Magento/Backend/Test/Mftf/Data/GeneralLocalConfigsData.xml b/app/code/Magento/Backend/Test/Mftf/Data/GeneralLocalConfigsData.xml index 0477befccc06..f772a77ddd36 100644 --- a/app/code/Magento/Backend/Test/Mftf/Data/GeneralLocalConfigsData.xml +++ b/app/code/Magento/Backend/Test/Mftf/Data/GeneralLocalConfigsData.xml @@ -8,6 +8,12 @@ <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="GeneralLocaleCodeConfigsForUkraine"> + <data key="path">general/locale/code</data> + <data key="scope">websites</data> + <data key="scope_code">base</data> + <data key="value">uk_UA</data> + </entity> <entity name="GeneralLocalCodeConfigsForChina"> <data key="path">general/locale/code</data> <data key="scope">websites</data> diff --git a/app/code/Magento/Backend/Test/Mftf/Data/SystemUploadConfigurationConfigData.xml b/app/code/Magento/Backend/Test/Mftf/Data/SystemUploadConfigurationConfigData.xml new file mode 100644 index 000000000000..17688b9f69ff --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Data/SystemUploadConfigurationConfigData.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="SystemUploadConfigurationMaxWidth"> + <data key="path">system/upload_configuration/max_width</data> + <data key="value">1920</data> + </entity> + <entity name="SystemUploadConfigurationMaxHeight"> + <data key="path">system/upload_configuration/max_height</data> + <data key="value">1200</data> + </entity> +</entities> diff --git a/app/code/Magento/Backend/Test/Mftf/Helper/CurlHelpers.php b/app/code/Magento/Backend/Test/Mftf/Helper/CurlHelpers.php new file mode 100644 index 000000000000..700d464a8915 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Helper/CurlHelpers.php @@ -0,0 +1,171 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Backend\Test\Mftf\Helper; + +use Magento\FunctionalTestingFramework\Helper\Helper; + +/** + * Class for MFTF helpers for curl requests. + */ +class CurlHelpers extends Helper +{ + /** + * Asserts that a curl request's response contains an expected string + * + * @param string $url + * @param string $expectedString + * @param string $postBody + * @param string $cookieName + * @param string $message + * @return void + * + */ + public function assertCurlResponseContainsString( + $url, + $expectedString, + $postBody = null, + $cookieName = 'admin', + $message = '' + ): void { + $cookie = $this->getCookie($cookieName); + $curlResponse = $this->getCurlResponse($url, $cookie, $postBody); + $this->assertStringContainsString($expectedString, $curlResponse, $message); + } + + /** + * Asserts that an MD5 encoded image retrieved via a curl request equals the expected string + * + * @param string $url + * @param string $expectedString + * @param string $postBody + * @param string $cookieName + * @param string $message + * @return void + * + */ + public function assertImageContentIsEqual( + $url, + $expectedString, + $postBody = null, + $cookieName = null, + $message = '' + ): void { + $cookie = $this->getCookie($cookieName); + $imageContent = $this->getCurlResponse($url, $cookie, $postBody); + // Must make request twice until bug is resolved: B2B-1789 + $imageContent = $this->getCurlResponse($url, $cookie, $postBody); + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction + $imageContentMD5 = md5($imageContent); + $this->assertStringContainsString($expectedString, $imageContentMD5, $message); + } + + /** + * Assert a that a curl request's response does not contain an expected string + * + * @param string $url + * @param string $expectedString + * @param string $postBody + * @param string $cookieName + * @return void + * + */ + public function assertCurlResponseDoesNotContainString( + $url, + $expectedString, + $postBody = null, + $cookieName = 'admin' + ): void { + $cookie = $this->getCookie($cookieName); + $curlResponse = $this->getCurlResponse($url, $cookie, $postBody); + $this->assertStringNotContainsString($expectedString, $curlResponse); + } + + /** + * Assert a that a curl request's response headers contains an expected string + * + * @param string $url + * @param string $expectedString + * @param string $postBody + * @param string $cookieName + * @return void + * + */ + public function assertCurlResponseHeadersContainsString( + $url, + $expectedString, + $postBody = null, + $cookieName = 'admin' + ): void { + $cookie = $this->getCookie($cookieName); + $curlResponse = $this->getCurlResponse( + $url, + $cookie, + $postBody, + [ + CURLOPT_NOBODY => true, + CURLOPT_HEADER => true, + ] + ); + $this->assertStringContainsString($expectedString, $curlResponse); + } + + /** + * Sends a curl request with the provided URL & cookie. Returns the response + * + * @param string $url + * @param string $cookie + * @param string $postBody + * @param array $options + * @return string + * + */ + private function getCurlResponse($url, $cookie = null, $postBody = null, array $options = []): string + { + // Start Session + $session = curl_init($url); + + // Set Options + if ($postBody) { + $data = json_decode($postBody, true); + curl_setopt($session, CURLOPT_POST, true); + curl_setopt($session, CURLOPT_POSTFIELDS, $data); + } + curl_setopt($session, CURLOPT_COOKIE, $cookie); + curl_setopt($session, CURLOPT_RETURNTRANSFER, true); + foreach ($options as $option => $value) { + curl_setopt($session, $option, $value); + } + + // Execute + $response = curl_exec($session); + curl_close($session); + + return $response; + } + + /** + * Gets the value of the specified cookie and returns the key value pair of the cookie + * + * @param string $cookieName + * @return string + * + */ + private function getCookie($cookieName = 'admin'): string + { + try { + $webDriver = $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver'); + $cookieValue = $webDriver->grabCookie($cookieName); + + return $cookieName . '=' . $cookieValue; + } catch (\Exception $exception) { + $this->fail($exception->getMessage()); + return ''; + } + } +} diff --git a/app/code/Magento/Backend/Test/Mftf/Section/AdminCacheManagementSection.xml b/app/code/Magento/Backend/Test/Mftf/Section/AdminCacheManagementSection.xml new file mode 100644 index 000000000000..0e5256f5f626 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Section/AdminCacheManagementSection.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminCacheManagementSection"> + <element name="flushCatalogImagesCacheButton" type="button" selector="#flushCatalogImages"/> + </section> +</sections> diff --git a/app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml b/app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml index f9d3c49d509e..9451886b1120 100644 --- a/app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml +++ b/app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml @@ -22,6 +22,7 @@ <element name="marketing" type="button" selector="#menu-magento-backend-marketing"/> <element name="system" type="button" selector="#menu-magento-backend-system"/> <element name="findPartners" type="button" selector="#menu-magento-marketplace-partners"/> + <element name="contentMenuClose" type="button" selector="#menu-magento-backend-content a.action-close" timeout="30"/> <!-- Navigate menu selectors --> <element name="menuItem" type="button" selector="li[data-ui-id='menu-{{dataUiId}}']" parameterized="true" timeout="30"/> diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminCheckDashboardWithChartsTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminCheckDashboardWithChartsTest.xml new file mode 100644 index 000000000000..d25801652b6c --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminCheckDashboardWithChartsTest.xml @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCheckDashboardWithChartsTest"> + <annotations> + <features value="Backend"/> + <stories value="Google Charts on Magento dashboard"/> + <title value="Admin should see Google chart on Magento dashboard"/> + <description value="Google chart on Magento dashboard page is displaying properly"/> + <severity value="MAJOR"/> + <testCaseId value="MAGETWO-98934"/> + <useCaseId value="MAGETWO-98584"/> + <group value="backend"/> + </annotations> + <before> + <magentoCLI command="config:set admin/dashboard/enable_charts 1" stepKey="setEnableCharts"/> + <createData entity="SimpleProduct2" stepKey="createProduct"> + <field key="price">150</field> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"> + <field key="firstname">John1</field> + <field key="lastname">Doe1</field> + </createData> + <createData entity="CustomerCart" stepKey="createCustomerCart"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItem"> + <requiredEntity createDataKey="createCustomerCart"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <magentoCLI command="config:set admin/dashboard/enable_charts 0" stepKey="setDisableChartsAsDefault"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <grabTextFrom selector="{{AdminDashboardSection.dashboardTotals('Quantity')}}" stepKey="grabQuantityBefore"/> + + <updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformation"> + <requiredEntity createDataKey="createCustomerCart"/> + </updateData> + <createData entity="Invoice" stepKey="invoiceOrder"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <createData entity="Shipment" stepKey="shipOrder"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + + <reloadPage stepKey="refreshPage"/> + <actionGroup ref="AssertAdminDashboardDisplayedWithNoErrorsActionGroup" stepKey="assertAdminDashboardNotBroken"/> + <grabTextFrom selector="{{AdminDashboardSection.dashboardTotals('Quantity')}}" stepKey="grabQuantityAfter"/> + <assertGreaterThan stepKey="checkQuantityWasChanged"> + <actualResult type="const">$grabQuantityAfter</actualResult> + <expectedResult type="const">$grabQuantityBefore</expectedResult> + </assertGreaterThan> + </test> +</tests> diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsTest.xml index 44577771fe4f..bfb3d0b23b06 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsTest.xml @@ -8,16 +8,19 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminDashboardWithChartsTest"> + <test name="AdminDashboardWithChartsTest" deprecated="Use AdminCheckDashboardWithChartsTest instead"> <annotations> <features value="Backend"/> <stories value="Google Charts on Magento dashboard"/> - <title value="Admin should see Google chart on Magento dashboard"/> + <title value="DEPRECATED. Admin should see Google chart on Magento dashboard"/> <description value="Google chart on Magento dashboard page is displaying properly"/> <severity value="MAJOR"/> <testCaseId value="MAGETWO-98934"/> <useCaseId value="MAGETWO-98584"/> <group value="backend"/> + <skip> + <issueId value="DEPRECATED">Use AdminCheckDashboardWithChartsTest instead</issueId> + </skip> </annotations> <before> <magentoCLI command="config:set admin/dashboard/enable_charts 1" stepKey="setEnableCharts"/> @@ -69,8 +72,8 @@ <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> <!-- Place Order --> <comment userInput="Place order" stepKey="placeOrder"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessTitle"/> <see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order number is: " stepKey="seeOrderNumber"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> <!-- Search for Order in the order grid --> diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterChangeCookieDomainTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterChangeCookieDomainTest.xml index c5b4e8c34bfe..80a21996e2c0 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterChangeCookieDomainTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterChangeCookieDomainTest.xml @@ -21,15 +21,11 @@ </annotations> <before> <magentoCLI command="config:set {{ChangedCookieDomainForMainWebsiteConfigData.path}} --scope={{ChangedCookieDomainForMainWebsiteConfigData.scope}} --scope-code={{ChangedCookieDomainForMainWebsiteConfigData.scope_code}} {{ChangedCookieDomainForMainWebsiteConfigData.value}}" stepKey="changeDomainForMainWebsiteBeforeTestRun"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheBeforeTestRun"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> </before> <after> <magentoCLI command="config:set {{EmptyCookieDomainForMainWebsiteConfigData.path}} --scope={{EmptyCookieDomainForMainWebsiteConfigData.scope}} --scope-code={{EmptyCookieDomainForMainWebsiteConfigData.scope_code}} {{EmptyCookieDomainForMainWebsiteConfigData.value}}" stepKey="changeDomainForMainWebsiteAfterTestComplete"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterTestComplete"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterTestComplete"/> </after> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AssertAdminDashboardPageIsVisibleActionGroup" stepKey="seeDashboardPage"/> diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginSuccessfulWithRewritesDisabledTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginSuccessfulWithRewritesDisabledTest.xml new file mode 100644 index 000000000000..bd3d39122a36 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginSuccessfulWithRewritesDisabledTest.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminLoginSuccessfulWithRewritesDisabledTest"> + <annotations> + <features value="Backend"/> + <stories value="Login on the Admin Login page"/> + <title + value="Admin should be able to log into the Magento Admin backend successfully if url rewrites are disabled"/> + <description + value="Admin should be able to log into the Magento Admin backend successfully if url rewrites are disabled"/> + <severity value="CRITICAL"/> + <group value="example"/> + <group value="login"/> + </annotations> + + <before> + <magentoCLI command="config:set {{AdminDisableUrlRewritesConfigData.path}} {{AdminDisableUrlRewritesConfigData.value}}" stepKey="disableUrlRewrites"/> + </before> + <after> + <magentoCLI command="config:set {{AdminEnableUrlRewritesConfigData.path}} {{AdminEnableUrlRewritesConfigData.value}}" stepKey="enableUrlRewrites"/> + </after> + + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="assertLoggedIn"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </test> +</tests> diff --git a/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Auth/LoginTest.php b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Auth/LoginTest.php new file mode 100644 index 000000000000..8bde3187fe69 --- /dev/null +++ b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Auth/LoginTest.php @@ -0,0 +1,198 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Backend\Test\Unit\Controller\Adminhtml\Auth; + +use Laminas\Uri\Http; +use Magento\Backend\App\Action\Context; +use Magento\Backend\App\Area\FrontNameResolver; +use Magento\Backend\App\BackendAppList; +use Magento\Backend\Controller\Adminhtml\Auth\Login; +use Magento\Backend\Helper\Data; +use Magento\Backend\Model\Auth; +use Magento\Backend\Model\Url; +use Magento\Backend\Model\UrlFactory; +use Magento\Backend\Model\View\Result\Redirect; +use Magento\Framework\App\Cache\StateInterface as CacheState; +use Magento\Framework\App\Cache\TypeListInterface as CacheTypeList; +use Magento\Framework\App\RequestInterface as Request; +use Magento\Framework\App\State; +use Magento\Framework\Controller\Result\RedirectFactory; +use Magento\Framework\Message\ManagerInterface as MessageManager; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Framework\View\Result\PageFactory; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test for \Magento\Backend\Controller\Adminhtml\Auth\Login. + */ +class LoginTest extends TestCase +{ + /** + * @var Login + */ + private $controller; + + /** + * @var Redirect|MockObject + */ + private $redirectMock; + + /** + * @var Request|MockObject + */ + private $requestMock; + + /** + * @var Auth|MockObject + */ + private $authMock; + + /** + * @var Http|MockObject + */ + private $uriMock; + + /** + * @var PageFactory|MockObject + */ + private $resultPageFactoryMock; + + /** + * @var BackendAppList|MockObject + */ + private $backendAppListMock; + + /** + * @var UrlFactory|MockObject + */ + private $backendUrlFactoryMock; + + /** + * @var Url|MockObject + */ + private $backendUrlMock; + + /** + * @var FrontNameResolver|MockObject + */ + private $frontNameResolverMock; + + /** + * @var RedirectFactory|MockObject + */ + private $resultRedirectFactoryMock; + + /** + * @var Data|MockObject + */ + private $helperMock; + + protected function setUp(): void + { + $objectManagerHelper = new ObjectManagerHelper($this); + + $this->helperMock = $this->createMock(Data::class); + $this->requestMock = $this->getMockBuilder(Request::class) + ->setMethods(['getUri', 'getRequestUri']) + ->getMockForAbstractClass(); + $this->redirectMock = $this->getMockBuilder(Redirect::class) + ->disableOriginalConstructor() + ->disableOriginalClone() + ->getMock(); + $this->resultRedirectFactoryMock = $this->createMock(RedirectFactory::class); + $this->resultPageFactoryMock = $this->createMock(PageFactory::class); + $this->authMock = $this->createMock(Auth::class); + $this->backendAppListMock = $this->createMock(BackendAppList::class); + $this->backendUrlMock = $this->createMock(Url::class); + $this->backendUrlFactoryMock = $this->createMock(UrlFactory::class); + $this->frontNameResolverMock = $this->createMock(FrontNameResolver::class); + $this->uriMock = $this->createMock(Http::class); + + $this->resultRedirectFactoryMock->expects($this->any()) + ->method('create') + ->willReturn($this->redirectMock); + $this->backendUrlFactoryMock->expects($this->any()) + ->method('create') + ->willReturn($this->backendUrlMock); + $this->requestMock->expects($this->any()) + ->method('getUri') + ->willReturn($this->uriMock); + + $contextMock = $this->getMockBuilder(Context::class) + ->disableOriginalConstructor() + ->disableOriginalClone() + ->getMock(); + + $contextMock->expects($this->once()) + ->method('getResultFactory') + ->willReturn($this->resultRedirectFactoryMock); + $contextMock->expects($this->once()) + ->method('getRequest') + ->willReturn($this->requestMock); + $contextMock->expects($this->once()) + ->method('getHelper') + ->willReturn($this->helperMock); + $contextMock->expects($this->once()) + ->method('getResultRedirectFactory') + ->willReturn($this->resultRedirectFactoryMock); + $contextMock->expects($this->once()) + ->method('getAuth') + ->willReturn($this->authMock); + + $this->controller = $objectManagerHelper->getObject( + Login::class, + [ + 'context' => $contextMock, + 'resultPageFactory' => $this->resultPageFactoryMock, + 'backendAppList' => $this->backendAppListMock, + 'backendUrlFactory' => $this->backendUrlFactoryMock, + 'frontNameResolver' => $this->frontNameResolverMock, + ] + ); + } + + /** + * Test for isValidBackendUri method. + * + * @param string $requestUri + * @param string $baseUrl + * @param string $backendFrontName + * @param bool $redirect + * + * @dataProvider isValidBackendUriDataProvider + */ + public function testIsValidBackendUri(string $requestUri, string $baseUrl, string $backendFrontName, bool $redirect) + { + $this->uriMock->expects($this->once())->method('isValid')->willReturn(true); + $this->authMock->expects($this->once())->method('isLoggedIn')->willReturn(false); + $this->requestMock->expects($this->once())->method('getRequestUri')->willReturn($requestUri); + $this->backendUrlMock->expects($this->once())->method('getBaseUrl')->willReturn($baseUrl); + $this->frontNameResolverMock->expects($this->once())->method('getFrontName')->willReturn($backendFrontName); + + $this->resultPageFactoryMock->expects($this->exactly($redirect ? 0 : 1))->method('create'); + $this->resultRedirectFactoryMock->expects($this->exactly($redirect ? 1 : 0))->method('create'); + + $this->controller->execute(); + } + + /** + * Data provider for testIsValidBackendUri. + * + * @return array[] + */ + public function isValidBackendUriDataProvider() + { + return [ + 'Rewrites on, valid url' => ['/index.php/admin', 'http://magento2.local/', 'admin', true], + 'Rewrites on, invalid url' => ['/admin', 'http://magento2.local/', 'admin', false], + 'Rewrites off, valid url' => ['/index.php/admin', 'http://magento2.local/index.php/', 'admin', false], + 'Rewrites off, invalid url' => ['/admin', 'http://magento2.local/index.php/', 'admin', true], + ]; + } +} diff --git a/app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php b/app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php index de02e11b645e..0b97f847099a 100644 --- a/app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php +++ b/app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php @@ -84,7 +84,13 @@ protected function setUp(): void ->getMock(); $this->sessionConfig = $this->createPartialMock( \Magento\Framework\Session\Config::class, - ['getCookiePath', 'getCookieDomain', 'getCookieSecure', 'getCookieHttpOnly'] + [ + 'getCookiePath', + 'getCookieDomain', + 'getCookieSecure', + 'getCookieHttpOnly', + 'getCookieSameSite' + ] ); $this->aclBuilder = $this->getMockBuilder(Builder::class) ->disableOriginalConstructor() @@ -193,6 +199,9 @@ public function testProlong() $cookieMetadata->expects($this->once()) ->method('setHttpOnly') ->with($httpOnly)->willReturnSelf(); + $cookieMetadata->expects($this->once()) + ->method('setSameSite') + ->willReturnSelf(); $this->cookieMetadataFactory->expects($this->once()) ->method('createPublicCookieMetadata') @@ -218,6 +227,9 @@ public function testProlong() $this->sessionConfig->expects($this->once()) ->method('getCookieHttpOnly') ->willReturn($httpOnly); + $this->sessionConfig->expects($this->once()) + ->method('getCookieSameSite') + ->willReturn('Lax'); $this->session->prolong(); @@ -247,7 +259,9 @@ public function testIsAllowed($isUserDefined, $isAclDefined, $isAllowed, $expect $this->storage->expects($this->once())->method('getUser')->willReturn($userMock); } if ($isAclDefined && $isUserDefined) { + // phpstan:ignore $userMock->expects($this->any())->method('getAclRole')->willReturn($userAclRole); + // phpstan:ignore $aclMock->expects($this->once())->method('isAllowed')->with($userAclRole)->willReturn($isAllowed); } diff --git a/app/code/Magento/Backend/etc/di.xml b/app/code/Magento/Backend/etc/di.xml index 1297bd9603a1..0fd778f2e156 100644 --- a/app/code/Magento/Backend/etc/di.xml +++ b/app/code/Magento/Backend/etc/di.xml @@ -188,4 +188,12 @@ <argument name="anchorRenderer" xsi:type="object">Magento\Backend\Block\AnchorRenderer</argument> </arguments> </type> + <type name="Magento\Backend\Model\Validator\UrlKey\CompositeUrlKey"> + <arguments> + <argument name="validators" xsi:type="array"> + <item name="frontNameValidator" xsi:type="object">Magento\Backend\Model\Validator\UrlKey\FrontName</item> + <item name="restrictedWordsValidator" xsi:type="object">Magento\Backend\Model\Validator\UrlKey\RestrictedWords</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Backend/i18n/en_US.csv b/app/code/Magento/Backend/i18n/en_US.csv index d5870de8b713..b72db96d6a59 100644 --- a/app/code/Magento/Backend/i18n/en_US.csv +++ b/app/code/Magento/Backend/i18n/en_US.csv @@ -466,3 +466,4 @@ Pagination,Pagination "Theme Name","Theme Name" "Use URL parameter to enable template path hints for Storefront","Use URL parameter to enable template path hints for Storefront" "Add the following parameter to the URL to show template hints ?templatehints=[parameter_value]","Add the following parameter to the URL to show template hints ?templatehints=[parameter_value]" +"URL key "%1" matches a reserved endpoint name (%2). Use another URL key.","URL key "%1" matches a reserved endpoint name (%2). Use another URL key." diff --git a/app/code/Magento/Backend/view/adminhtml/templates/dashboard/chart.phtml b/app/code/Magento/Backend/view/adminhtml/templates/dashboard/chart.phtml index 56131fa62232..9db4241f78d9 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/dashboard/chart.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/dashboard/chart.phtml @@ -19,7 +19,7 @@ $viewModel = $block->getViewModel(); ?> <div class="dashboard-diagram"> <div class="dashboard-diagram-graph"> - <canvas id="chart_<?= $escaper->escapeHtmlAttr($block->getData('html_id')) ?>_period"/> + <canvas id="chart_<?= $escaper->escapeHtmlAttr($block->getData('html_id')) ?>_period"></canvas> <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( 'display:none', '#chart_' . $escaper->escapeJs($block->getData('html_id')) . '_period' diff --git a/app/code/Magento/Backend/view/adminhtml/templates/media/uploader.phtml b/app/code/Magento/Backend/view/adminhtml/templates/media/uploader.phtml index 83482b1720cf..bfc1e6a522b7 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/media/uploader.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/media/uploader.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Backend\Block\Media\Uploader */ ?> diff --git a/app/code/Magento/Backend/view/adminhtml/templates/store/switcher.phtml b/app/code/Magento/Backend/view/adminhtml/templates/store/switcher.phtml index c6fcaff9cd87..d2bdacda47eb 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/store/switcher.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/store/switcher.phtml @@ -8,222 +8,132 @@ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> <?php if ($websites = $block->getWebsites()): ?> -<div class="store-switcher store-view"> - <span class="store-switcher-label"><?= $block->escapeHtml(__('Scope:')) ?></span> - <div class="actions dropdown closable"> - <input type="hidden" name="store_switcher" id="store_switcher" - data-role="store-view-id" data-param="<?= $block->escapeHtmlAttr($block->getStoreVarName()) ?>" - value="<?= $block->escapeHtml($block->getStoreId()) ?>" - <?= /* @noEscape */ $block->getUiId() ?> /> - <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( - 'onchange', - 'switchScope(this);', - '#store_switcher' - ) ?> - <input type="hidden" name="store_group_switcher" id="store_group_switcher" - data-role="store-group-id" data-param="<?= $block->escapeHtmlAttr($block->getStoreGroupVarName()) ?>" - value="<?= $block->escapeHtml($block->getStoreGroupId()) ?>" - <?= /* @noEscape */ $block->getUiId() ?> /> - <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( - 'onchange', - 'switchScope(this);', - '#store_group_switcher' - ) ?> - <input type="hidden" name="website_switcher" id="website_switcher" - data-role="website-id" data-param="<?= $block->escapeHtmlAttr($block->getWebsiteVarName()) ?>" - value="<?= $block->escapeHtml($block->getWebsiteId()) ?>" - <?= /* @noEscape */ $block->getUiId() ?> /> - <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( - 'onchange', - 'switchScope(this);', - '#website_switcher' - ) ?> - <button - type="button" - class="admin__action-dropdown" - data-mage-init='{"dropdown":{}}' - data-toggle="dropdown" - aria-haspopup="true" - id="store-change-button"> - <?= $block->escapeHtml($block->getCurrentSelectionName()) ?> - </button> - <ul class="dropdown-menu" data-role="stores-list"> - <?php if ($block->hasDefaultOption()): ?> - <li class="store-switcher-all <?php - if (!($block->getDefaultSelectionName() != $block->getCurrentSelectionName())): ?>disabled<?php endif; - ?> <?php if (!$block->hasScopeSelected()): ?>current<?php endif; ?>"> - <?php if ($block->getDefaultSelectionName() != $block->getCurrentSelectionName()): ?> - <a data-role="store-view-id" data-value="" href="#"> - <?= $block->escapeHtml($block->getDefaultSelectionName()) ?> - </a> - <?php else: ?> - <span><?= $block->escapeHtml($block->getDefaultSelectionName()) ?></span> - <?php endif; ?> - </li> - <?php endif; ?> - <?php foreach ($websites as $website): ?> - <?php $showWebsite = false; ?> - <?php foreach ($website->getGroups() as $group): ?> - <?php $showGroup = false; ?> - <?php foreach ($block->getStores($group) as $store): ?> - <?php if ($showWebsite == false): ?> - <?php $showWebsite = true; ?> - <li class="store-switcher-website <?php if (!($block->isWebsiteSwitchEnabled() && - ! $block->isWebsiteSelected($website))): ?>disabled<?php endif; ?> <?php -if ($block->isWebsiteSelected($website)): ?>current<?php endif; ?>"> - <?php if ($block->isWebsiteSwitchEnabled() && ! $block->isWebsiteSelected($website)): ?> - <a data-role="website-id" data-value="<?= $block->escapeHtmlAttr($website->getId()); - ?>" href="#"> - <?= $block->escapeHtml($website->getName()) ?> - </a> - <?php else: ?> - <span><?= $block->escapeHtml($website->getName()) ?></span> - <?php endif; ?> - </li> + <div class="store-switcher store-view"> + <span class="store-switcher-label"><?= $block->escapeHtml(__('Scope:')) ?></span> + <div class="actions dropdown closable"> + <input type="hidden" name="store_switcher" id="store_switcher" + data-role="store-view-id" data-param="<?= $block->escapeHtmlAttr($block->getStoreVarName()) ?>" + value="<?= $block->escapeHtml($block->getStoreId()) ?>" + <?= /* @noEscape */ $block->getUiId() ?> /> + <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( + 'onchange', + 'switchScope(this);', + '#store_switcher' + ) ?> + <input type="hidden" name="store_group_switcher" id="store_group_switcher" + data-role="store-group-id" data-param="<?= $block->escapeHtmlAttr($block->getStoreGroupVarName()) ?>" + value="<?= $block->escapeHtml($block->getStoreGroupId()) ?>" + <?= /* @noEscape */ $block->getUiId() ?> /> + <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( + 'onchange', + 'switchScope(this);', + '#store_group_switcher' + ) ?> + <input type="hidden" name="website_switcher" id="website_switcher" + data-role="website-id" data-param="<?= $block->escapeHtmlAttr($block->getWebsiteVarName()) ?>" + value="<?= $block->escapeHtml($block->getWebsiteId()) ?>" + <?= /* @noEscape */ $block->getUiId() ?> /> + <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( + 'onchange', + 'switchScope(this);', + '#website_switcher' + ) ?> + <button + type="button" + class="admin__action-dropdown" + data-mage-init='{"dropdown":{}}' + data-toggle="dropdown" + aria-haspopup="true" + id="store-change-button"> + <?= $block->escapeHtml($block->getCurrentSelectionName()) ?> + </button> + <ul class="dropdown-menu" data-role="stores-list"> + <?php if ($block->hasDefaultOption()): ?> + <li class="store-switcher-all <?php + if (!($block->getDefaultSelectionName() != $block->getCurrentSelectionName())): ?>disabled<?php endif; + ?> <?php if (!$block->hasScopeSelected()): ?>current<?php endif; ?>"> + <?php if ($block->getDefaultSelectionName() != $block->getCurrentSelectionName()): ?> + <a data-role="store-view-id" data-value="" href="#"> + <?= $block->escapeHtml($block->getDefaultSelectionName()) ?> + </a> + <?php else: ?> + <span><?= $block->escapeHtml($block->getDefaultSelectionName()) ?></span> <?php endif; ?> - <?php if ($showGroup == false): ?> - <?php $showGroup = true; ?> - <li class="store-switcher-store <?php if (!($block->isStoreGroupSwitchEnabled() && - ! $block->isStoreGroupSelected($group))): ?>disabled<?php endif; ?> <?php -if ($block->isStoreGroupSelected($group)): ?>current<?php endif; ?>"> - <?php if ($block->isStoreGroupSwitchEnabled() && - ! $block->isStoreGroupSelected($group)): ?> - <a data-role="store-group-id" - data-value="<?= $block->escapeHtmlAttr($group->getId()) ?>" href="#"> - <?= $block->escapeHtml($group->getName()) ?> + </li> + <?php endif; ?> + <?php foreach ($websites as $website): ?> + <?php $showWebsite = false; ?> + <?php foreach ($website->getGroups() as $group): ?> + <?php $showGroup = false; ?> + <?php foreach ($block->getStores($group) as $store): ?> + <?php if ($showWebsite == false): ?> + <?php $showWebsite = true; ?> + <li class="store-switcher-website <?php if (!($block->isWebsiteSwitchEnabled() && + ! $block->isWebsiteSelected($website))): ?>disabled<?php endif; ?> <?php + if ($block->isWebsiteSelected($website)): ?>current<?php endif; ?>"> + <?php if ($block->isWebsiteSwitchEnabled() && ! $block->isWebsiteSelected($website)): ?> + <a data-role="website-id" data-value="<?= $block->escapeHtmlAttr($website->getId()); + ?>" href="#"> + <?= $block->escapeHtml($website->getName()) ?> + </a> + <?php else: ?> + <span><?= $block->escapeHtml($website->getName()) ?></span> + <?php endif; ?> + </li> + <?php endif; ?> + <?php if ($showGroup == false): ?> + <?php $showGroup = true; ?> + <li class="store-switcher-store <?php if (!($block->isStoreGroupSwitchEnabled() && + ! $block->isStoreGroupSelected($group))): ?>disabled<?php endif; ?> <?php + if ($block->isStoreGroupSelected($group)): ?>current<?php endif; ?>"> + <?php if ($block->isStoreGroupSwitchEnabled() && + ! $block->isStoreGroupSelected($group)): ?> + <a data-role="store-group-id" + data-value="<?= $block->escapeHtmlAttr($group->getId()) ?>" href="#"> + <?= $block->escapeHtml($group->getName()) ?> + </a> + <?php else: ?> + <span><?= $block->escapeHtml($group->getName()) ?></span> + <?php endif; ?> + </li> + <?php endif; ?> + <li class="store-switcher-store-view <?php if (!($block->isStoreSwitchEnabled() && + !$block->isStoreSelected($store))): ?>disabled<?php endif; ?> <?php + if ($block->isStoreSelected($store)):?>current<?php endif; ?>"> + <?php if ($block->isStoreSwitchEnabled() && ! $block->isStoreSelected($store)): ?> + <a data-role="store-view-id" + data-value="<?= $block->escapeHtmlAttr($store->getId()) ?>" href="#"> + <?= $block->escapeHtml($store->getName()) ?> </a> <?php else: ?> - <span><?= $block->escapeHtml($group->getName()) ?></span> + <span><?= $block->escapeHtml($store->getName()) ?></span> <?php endif; ?> </li> - <?php endif; ?> - <li class="store-switcher-store-view <?php if (!($block->isStoreSwitchEnabled() && - !$block->isStoreSelected($store))): ?>disabled<?php endif; ?> <?php -if ($block->isStoreSelected($store)):?>current<?php endif; ?>"> - <?php if ($block->isStoreSwitchEnabled() && ! $block->isStoreSelected($store)): ?> - <a data-role="store-view-id" - data-value="<?= $block->escapeHtmlAttr($store->getId()) ?>" href="#"> - <?= $block->escapeHtml($store->getName()) ?> - </a> - <?php else: ?> - <span><?= $block->escapeHtml($store->getName()) ?></span> - <?php endif; ?> - </li> + <?php endforeach; ?> <?php endforeach; ?> <?php endforeach; ?> - <?php endforeach; ?> - <?php if ($block->getShowManageStoresLink() && - $block->getAuthorization()->isAllowed('Magento_Backend::store')): ?> - <li class="dropdown-toolbar"> - <a href="<?= /* @noEscape */ $block->getUrl('*/system_store'); - ?>"><?= $block->escapeHtml(__('Stores Configuration')) ?></a> - </li> - <?php endif; ?> - </ul> + <?php if ($block->getShowManageStoresLink() && + $block->getAuthorization()->isAllowed('Magento_Backend::store')): ?> + <li class="dropdown-toolbar"> + <a href="<?= /* @noEscape */ $block->getUrl('*/system_store'); + ?>"><?= $block->escapeHtml(__('Stores Configuration')) ?></a> + </li> + <?php endif; ?> + </ul> + </div> + <?= $block->getHintHtml() ?> </div> - <?= $block->getHintHtml() ?> -</div> - - <?php - $useConfirm = (int)$block->getUseConfirm(); - $scriptString = <<<script -require([ - 'jquery', - 'Magento_Ui/js/modal/confirm' -], function(jQuery, confirm){ - - (function($) { - var storesList = $('[data-role=stores-list]'); - storesList.on('click', '[data-value]', function(event) { - var val = $(event.target).data('value'); - var role = $(event.target).data('role'); - var switcher = $('[data-role='+role+']'); - - event.preventDefault(); - - if (!switcher.val() || val != switcher.val()) { - switcher.val(val).trigger('change'); // Set the value & trigger event - } - }); - })(jQuery); - - var scopeSwitcherHandler; - function switchScope(obj) { - var switcher = jQuery(obj); - var scopeId = switcher.val(); - var scopeParams = ''; - if (scopeId) { - scopeParams = switcher.data('param') + '/' + scopeId + '/'; - } - - if (obj.switchParams) { - scopeParams += obj.switchParams; - } - - if ((typeof scopeSwitcherHandler) != 'undefined') { - var switcherParams = { - scopeId: scopeId, - scopeParams: scopeParams, - useConfirm: {$useConfirm} - }; - scopeSwitcherHandler(switcherParams); - } else { -script; - if ($block->getUseConfirm()) { - $scriptString .= ' - confirm({ - content: "' . $block->escapeJs(__( - 'Please confirm scope switching. All data that hasn\'t been saved will be lost.' - )) . '", - actions: { - confirm: function() { - reload(); - }, - cancel: function() { - obj.value = \'' . $block->escapeJs($block->getStoreId()) . '\'; - } + <script type="text/x-magento-init"> + { + "*": { + "Magento_Backend/js/store-switcher": { + "useConfirm": <?= /* @noEscape */ (int)$block->getUseConfirm(); ?>, + "isUsingIframe": <?= /* @noEscape */ (int)$block->isUsingIframe(); ?>, + "switchUrl": "<?= $block->escapeUrl($block->getSwitchUrl()); ?>", + "storeId": <?= /* @noEscape */ (int)$block->getStoreId(); ?> } - }); -'; - } else { - $scriptString .= 'reload();'; - } - $scriptString .= ' - } - - function reload() { - '; - if (!$block->isUsingIframe()) { - $scriptString .= ' - var url = \'' . $block->escapeJs($block->getSwitchUrl()) . '\' + scopeParams; - setLocation(url); -'; - } else { - $scriptString .= <<<script - jQuery('#preview_selected_store').val(scopeId); - jQuery('#preview_form').submit(); - - jQuery('.store-switcher .dropdown-menu li a').each(function() { - var $this = jQuery(this); - - if ($this.data('role') === 'store-view-id' && $this.data('value') == scopeId) { - jQuery('#store-change-button').html($this.text()); - } - }); - - jQuery('#store-change-button').click(); -script; - } - $scriptString .= <<<script + } } - } - - window.scopeSwitcherHandler = scopeSwitcherHandler; - window.switchScope = switchScope; - -}); -script; - ?> - <?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false); ?> + </script> <?php endif; ?> diff --git a/app/code/Magento/Backend/view/adminhtml/templates/system/search.phtml b/app/code/Magento/Backend/view/adminhtml/templates/system/search.phtml index 6e94770c6e40..01a8d54db308 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/system/search.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/system/search.phtml @@ -4,7 +4,15 @@ * See COPYING.txt for license details. */ -/** @var $block \Magento\Backend\Block\GlobalSearch */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound + +use Magento\Backend\Block\GlobalSearch; +use Magento\Framework\Json\Helper\Data; + +/** @var $block GlobalSearch */ +/** @var Data $helper */ +$helper = $this->helper(Data::class); + ?> <div class="search-global" data-mage-init='{"globalSearch": {}}'> <form action="#" id="form-search"> @@ -15,9 +23,7 @@ class="search-global-input" id="search-global" name="query" - <?php //phpcs:disable ?> - data-mage-init='<?= /* @noEscape */ $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonEncode($block->getWidgetInitOptions()) ?>'> - <?php //phpcs:enable ?> + data-mage-init='<?= /* @noEscape */ $helper->jsonEncode($block->getWidgetInitOptions()) ?>'> <button type="submit" class="search-global-action" diff --git a/app/code/Magento/Backend/view/adminhtml/web/js/store-switcher.js b/app/code/Magento/Backend/view/adminhtml/web/js/store-switcher.js new file mode 100644 index 000000000000..e9bded2bb79c --- /dev/null +++ b/app/code/Magento/Backend/view/adminhtml/web/js/store-switcher.js @@ -0,0 +1,127 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'jquery' +], function ($) { + 'use strict'; + + /** + * @param {Object} storeSwitchConfig + */ + return function (storeSwitchConfig) { + var scopeSwitcherHandler; + + (function () { + var storesList = $('[data-role=stores-list]'); + + storesList.on('click', '[data-value]', function (event) { + var val = $(event.target).data('value'), + role = $(event.target).data('role'), + switcher = $('[data-role=' + role + ']'); + + event.preventDefault(); + + if (!switcher.val() || val !== switcher.val()) { + + /* Set the value & trigger event */ + switcher.val(val).trigger('change'); + } + }); + })($); + + /** + * Switch store scope + * + * @param {Object} obj + * @return void + */ + function switchScope(obj) { + var switcher = $(obj), + scopeId = switcher.val(), + scopeParams = '', + switcherParams = {}; + + if (scopeId) { + scopeParams = switcher.data('param') + '/' + scopeId + '/'; + } + + if (obj.switchParams) { + scopeParams += obj.switchParams; + } + + /** + * Reload function for switcher + */ + function reload() { + var url; + + if (!storeSwitchConfig.isUsingIframe) { + + if (storeSwitchConfig.switchUrl && storeSwitchConfig.switchUrl.length > 0) { + url = storeSwitchConfig.switchUrl + scopeParams; + + /* eslint-disable no-undef */ + setLocation(url); + } + + } else { + $('#preview_selected_store').val(scopeId); + $('#preview_form').trigger('submit'); + + $('.store-switcher .dropdown-menu li a').each(function () { + var $this = $(this); + + if ($this.data('role') === 'store-view-id' && $this.data('value') === scopeId) { + $('#store-change-button').html($this.text()); + } + }); + + $('#store-change-button').trigger('click'); + } + } + + if (typeof scopeSwitcherHandler !== 'undefined') { + switcherParams = { + scopeId: scopeId, + scopeParams: scopeParams, + useConfirm: storeSwitchConfig.useConfirm + }; + + scopeSwitcherHandler(switcherParams); + } else if (storeSwitchConfig.useConfirm) { + require([ + 'Magento_Ui/js/modal/confirm', + 'mage/translate' + ], function (confirm, $t) { + confirm({ + content: $t('Please confirm scope switching. All data that hasn\'t been saved will be lost.'), + actions: { + + /** + * Confirm action + */ + confirm: function () { + reload(); + }, + + /** + * Cancel action + */ + cancel: function () { + obj.value = storeSwitchConfig.storeId ? storeSwitchConfig.storeId : ''; + } + } + }); + }); + } else { + reload(); + } + } + + window.scopeSwitcherHandler = scopeSwitcherHandler; + window.switchScope = switchScope; + }; +}); diff --git a/app/code/Magento/Backend/view/adminhtml/web/template/dynamic-rows/grid.html b/app/code/Magento/Backend/view/adminhtml/web/template/dynamic-rows/grid.html index 0033f4c071e4..4b520a53857a 100644 --- a/app/code/Magento/Backend/view/adminhtml/web/template/dynamic-rows/grid.html +++ b/app/code/Magento/Backend/view/adminhtml/web/template/dynamic-rows/grid.html @@ -16,7 +16,7 @@ class="action-secondary" type="button" click="processingAddChild.bind($data, false, false, false)"> - <span translate="addButtonLabel"/> + <span translate="addButtonLabel"></span> </button> </div> @@ -30,14 +30,14 @@ css="$data.setClasses($data)" attr="'data-index': index"> <label if="$data.label" class="admin__field-label" attr="for: $data.uid"> - <span translate="$data.label"/> + <span translate="$data.label"></span> </label> <div class="admin__field-control" data-role="grid-wrapper"> <div class="admin__control-table-pagination" visible="!!element.getRecordCount()"> <div class="admin__data-grid-pager"> <button class="action-previous" type="button" data-bind="attr: {title: $t('Previous Page')}, click: previousPage, disable: isFirst()"></button> - <input class="admin__control-text" type="number" data-bind="attr: {id: ++ko.uid}, value: currentPage"> + <input class="admin__control-text" type="number" data-bind="attr: {id: ++ko.uid}, value: currentPage"/> <label class="admin__control-support-text" data-bind="attr: {for: ko.uid}, text: 'of ' + pages()"></label> <button class="action-next" type="button" data-bind="attr: {title: $t('Next Page')}, click: nextPage, disable: isLast()"></button> </div> @@ -47,14 +47,14 @@ <thead if="element.columnsHeader"> <tr> <th if="$data.dndConfig.enabled" - class="data-grid-draggable-row-cell"/> + class="data-grid-draggable-row-cell"></th> <th repeat="foreach: labels, item: '$label'" class="data-grid-th" visible="$label().visible" disable="$label().disabled" css="setClasses($label())"> - <span translate="$label().label"/> + <span translate="$label().label"></span> </th> </tr> </thead> @@ -65,7 +65,7 @@ css="'_odd-row': $index % 2"> <td if="dndConfig.enabled" class="data-grid-draggable-row-cell" - template="name: dndConfig.template, data: dnd"/> + template="name: dndConfig.template, data: dnd"></td> <!-- ko foreach: { data: $record().elems(), as: 'elem'} --> <td if="elem.template" @@ -73,7 +73,7 @@ disable="elem.disabled" css="$parent.setClasses(elem)" template="elem.template" - attr="'data-index': index"/> + attr="'data-index': index"></td> <!-- /ko --> </tr> </tbody> @@ -86,7 +86,7 @@ <div class="message message-notice notice"> <span translate="'Search strings are either normal strings or regular expressions (PCRE). They are matched in the same order as entered.'"></span> - <br> + <br/> <span translate="'Examples'"></span>: <span class="code-sample">Firefox: /^mozilla/i</span> diff --git a/app/code/Magento/Backup/Model/Fs/Collection.php b/app/code/Magento/Backup/Model/Fs/Collection.php index 41a497495f68..263bcdf17400 100644 --- a/app/code/Magento/Backup/Model/Fs/Collection.php +++ b/app/code/Magento/Backup/Model/Fs/Collection.php @@ -40,6 +40,10 @@ class Collection extends \Magento\Framework\Data\Collection\Filesystem */ protected $_backup = null; + /** + * @var \Magento\Framework\Filesystem + */ + private $_filesystem; /** * @param \Magento\Framework\Data\Collection\EntityFactory $entityFactory * @param \Magento\Backup\Helper\Data $backupData diff --git a/app/code/Magento/Backup/README.md b/app/code/Magento/Backup/README.md index e1167bc4f242..4d5f0941dd45 100644 --- a/app/code/Magento/Backup/README.md +++ b/app/code/Magento/Backup/README.md @@ -4,25 +4,25 @@ The Magento_Backup module allows administrators to perform backups and rollbacks The Magento_Backup module does not affect the storefront. -For more information about this module, see [Magento Backups](https://docs.magento.com/m2/ce/user_guide/system/backups.html) +For more information about this module, see [Magento Backups](https://docs.magento.com/user-guide/system/backups.html) ## Extensibility -Extension developers can interact with the Magento_Backup module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_Backup module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Backup module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Backup module. ### Layouts -This module introduces the following layouts and layout handles in the `view/adminhtml/layout` directory: +This module introduces the following layouts and layout handles in the `view/adminhtml/layout` directory: `backup_index_block` `backup_index_disabled` `backup_index_grid` `backup_index_index` -For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html). +For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/Backup/Test/Mftf/Data/BackupConfigData.xml b/app/code/Magento/Backup/Test/Mftf/Data/BackupConfigData.xml new file mode 100644 index 000000000000..45f8f3a6ddab --- /dev/null +++ b/app/code/Magento/Backup/Test/Mftf/Data/BackupConfigData.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="EnableBackupFunctionality"> + <data key="path">system/backup/functionality_enabled</data> + <data key="value">1</data> + </entity> + <entity name="DisableBackupFunctionality"> + <!-- Magento default value --> + <data key="path">system/backup/functionality_enabled</data> + <data key="value">0</data> + </entity> +</entities> \ No newline at end of file diff --git a/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml b/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml index 6db3aa7cbded..7319069c9458 100644 --- a/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml +++ b/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml @@ -17,10 +17,13 @@ <severity value="CRITICAL"/> <testCaseId value="MAGETWO-94176"/> <group value="backup"/> - <skip> - <issueId value="MC-5807"/> - </skip> </annotations> + <before> + <magentoCLI command="config:set {{EnableBackupFunctionality.path}} {{EnableBackupFunctionality.value}}" stepKey="setEnableBackup"/> + </before> + <after> + <magentoCLI command="config:set {{DisableBackupFunctionality.path}} {{DisableBackupFunctionality.value}}" stepKey="setDisableBackup"/> + </after> <!--Login to admin area--> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php index 635811e3d0f8..8f89910558c9 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php @@ -218,7 +218,7 @@ public function getOptionHtml(Option $option) { $optionBlock = $this->getChildBlock($option->getType()); if (!$optionBlock) { - return __('There is no defined renderer for "%1" option type.', $option->getType()); + return __('There is no defined renderer for "%1" option type.', $this->escapeHtml($option->getType())); } return $optionBlock->setOption($option)->toHtml(); } @@ -407,15 +407,18 @@ private function processOptions(string $optionId, array $options, DataObject $pr { $preConfiguredQtys = $preConfiguredValues->getData("bundle_option_qty/${optionId}") ?? []; $selections = $options[$optionId]['selections']; - array_walk($selections, function (&$selection, $selectionId) use ($preConfiguredQtys) { - if (is_array($preConfiguredQtys) && isset($preConfiguredQtys[$selectionId])) { - $selection['qty'] = $preConfiguredQtys[$selectionId]; - } else { - if ((int)$preConfiguredQtys > 0) { - $selection['qty'] = $preConfiguredQtys; + array_walk( + $selections, + function (&$selection, $selectionId) use ($preConfiguredQtys) { + if (is_array($preConfiguredQtys) && isset($preConfiguredQtys[$selectionId])) { + $selection['qty'] = $preConfiguredQtys[$selectionId]; + } else { + if ((int)$preConfiguredQtys > 0) { + $selection['qty'] = $preConfiguredQtys; + } } } - }); + ); $options[$optionId]['selections'] = $selections; return $options; diff --git a/app/code/Magento/Bundle/Model/LinkManagement.php b/app/code/Magento/Bundle/Model/LinkManagement.php index 43a6532a16b2..9bc056a3e9a8 100644 --- a/app/code/Magento/Bundle/Model/LinkManagement.php +++ b/app/code/Magento/Bundle/Model/LinkManagement.php @@ -19,9 +19,9 @@ use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Catalog\Model\Product; use Magento\Framework\Api\DataObjectHelper; +use Magento\Framework\EntityManager\MetadataPool; use Magento\Framework\Exception\CouldNotSaveException; use Magento\Framework\Exception\InputException; -use Magento\Framework\EntityManager\MetadataPool; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Store\Model\StoreManagerInterface; @@ -173,12 +173,11 @@ public function saveChild( ) ); } - $linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField(); - $selectionModel = $this->mapProductLinkToSelectionModel( + $selectionModel = $this->mapProductLinkToBundleSelectionModel( $selectionModel, $linkedProduct, - $linkProductModel->getId(), - $product->getData($linkField) + $product, + (int)$linkProductModel->getId() ); try { @@ -202,6 +201,7 @@ public function saveChild( * * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) + * @deprecated use mapProductLinkToBundleSelectionModel */ protected function mapProductLinkToSelectionModel( Selection $selectionModel, @@ -239,6 +239,55 @@ protected function mapProductLinkToSelectionModel( return $selectionModel; } + /** + * Fill selection model with product link data. + * + * @param Selection $selectionModel + * @param LinkInterface $productLink + * @param ProductInterface $parentProduct + * @param int $linkedProductId + * @param string $linkField + * @return Selection + * @throws NoSuchEntityException + */ + private function mapProductLinkToBundleSelectionModel( + Selection $selectionModel, + LinkInterface $productLink, + ProductInterface $parentProduct, + int $linkedProductId + ): Selection { + $linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField(); + $selectionModel->setProductId($linkedProductId); + $selectionModel->setParentProductId($parentProduct->getData($linkField)); + if ($productLink->getSelectionId() !== null) { + $selectionModel->setSelectionId($productLink->getSelectionId()); + } + if ($productLink->getOptionId() !== null) { + $selectionModel->setOptionId($productLink->getOptionId()); + } + if ($productLink->getPosition() !== null) { + $selectionModel->setPosition($productLink->getPosition()); + } + if ($productLink->getQty() !== null) { + $selectionModel->setSelectionQty($productLink->getQty()); + } + if ($productLink->getPriceType() !== null) { + $selectionModel->setSelectionPriceType($productLink->getPriceType()); + } + if ($productLink->getPrice() !== null) { + $selectionModel->setSelectionPriceValue($productLink->getPrice()); + } + if ($productLink->getCanChangeQuantity() !== null) { + $selectionModel->setSelectionCanChangeQty($productLink->getCanChangeQuantity()); + } + if ($productLink->getIsDefault() !== null) { + $selectionModel->setIsDefault($productLink->getIsDefault()); + } + $selectionModel->setWebsiteId((int)$this->storeManager->getStore($parentProduct->getStoreId())->getWebsiteId()); + + return $selectionModel; + } + /** * @inheritDoc * @@ -302,12 +351,13 @@ public function addChild( } $selectionModel = $this->bundleSelection->create(); - $selectionModel = $this->mapProductLinkToSelectionModel( + $selectionModel = $this->mapProductLinkToBundleSelectionModel( $selectionModel, $linkedProduct, - $linkProductModel->getEntityId(), - $product->getData($linkField) + $product, + (int)$linkProductModel->getEntityId() ); + $selectionModel->setOptionId($optionId); try { @@ -317,7 +367,7 @@ public function addChild( throw new CouldNotSaveException(__('Could not save child: "%1"', $e->getMessage()), $e); } - return $selectionModel->getId(); + return (int)$selectionModel->getId(); } /** diff --git a/app/code/Magento/Bundle/Model/Option/SaveAction.php b/app/code/Magento/Bundle/Model/Option/SaveAction.php index 00c5b05d532f..42349f2f2cc2 100644 --- a/app/code/Magento/Bundle/Model/Option/SaveAction.php +++ b/app/code/Magento/Bundle/Model/Option/SaveAction.php @@ -7,13 +7,17 @@ namespace Magento\Bundle\Model\Option; +use Magento\Bundle\Api\Data\LinkInterface; use Magento\Bundle\Api\Data\OptionInterface; use Magento\Bundle\Model\ResourceModel\Option; use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\EntityManager\MetadataPool; use Magento\Framework\Exception\CouldNotSaveException; use Magento\Bundle\Model\Product\Type; use Magento\Bundle\Api\ProductLinkManagementInterface; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Store\Model\StoreManagerInterface; /** * Encapsulates logic for saving a bundle option, including coalescing the parent product's data. @@ -45,12 +49,14 @@ class SaveAction * @param MetadataPool $metadataPool * @param Type $type * @param ProductLinkManagementInterface $linkManagement + * @param StoreManagerInterface|null $storeManager */ public function __construct( Option $optionResource, MetadataPool $metadataPool, Type $type, - ProductLinkManagementInterface $linkManagement + ProductLinkManagementInterface $linkManagement, + ?StoreManagerInterface $storeManager = null ) { $this->optionResource = $optionResource; $this->metadataPool = $metadataPool; @@ -69,7 +75,7 @@ public function __construct( */ public function save(ProductInterface $bundleProduct, OptionInterface $option) { - $metadata = $this->metadataPool->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class); + $metadata = $this->metadataPool->getMetadata(ProductInterface::class); $option->setStoreId($bundleProduct->getStoreId()); $parentId = $bundleProduct->getData($metadata->getLinkField()); @@ -108,7 +114,7 @@ public function save(ProductInterface $bundleProduct, OptionInterface $option) throw new CouldNotSaveException(__("The option couldn't be saved."), $e); } - /** @var \Magento\Bundle\Api\Data\LinkInterface $linkedProduct */ + /** @var LinkInterface $linkedProduct */ foreach ($linksToAdd as $linkedProduct) { $this->linkManagement->addChild($bundleProduct, $option->getOptionId(), $linkedProduct); } @@ -121,8 +127,8 @@ public function save(ProductInterface $bundleProduct, OptionInterface $option) /** * Update option selections * - * @param \Magento\Catalog\Api\Data\ProductInterface $product - * @param \Magento\Bundle\Api\Data\OptionInterface $option + * @param ProductInterface $product + * @param OptionInterface $option * @return void */ private function updateOptionSelection(ProductInterface $product, OptionInterface $option) @@ -141,7 +147,7 @@ private function updateOptionSelection(ProductInterface $product, OptionInterfac $linksToUpdate[] = $productLink; } } - /** @var \Magento\Bundle\Api\Data\LinkInterface[] $linksToDelete */ + /** @var LinkInterface[] $linksToDelete */ $linksToDelete = $this->compareLinks($existingLinks, $linksToUpdate); } foreach ($linksToUpdate as $linkedProduct) { @@ -162,8 +168,8 @@ private function updateOptionSelection(ProductInterface $product, OptionInterfac /** * Compute the difference between given arrays. * - * @param \Magento\Bundle\Api\Data\LinkInterface[] $firstArray - * @param \Magento\Bundle\Api\Data\LinkInterface[] $secondArray + * @param LinkInterface[] $firstArray + * @param LinkInterface[] $secondArray * * @return array */ diff --git a/app/code/Magento/Bundle/Model/Product/BundleOptionDataProvider.php b/app/code/Magento/Bundle/Model/Product/BundleOptionDataProvider.php index f56c4228e49e..4ac3b54b7011 100644 --- a/app/code/Magento/Bundle/Model/Product/BundleOptionDataProvider.php +++ b/app/code/Magento/Bundle/Model/Product/BundleOptionDataProvider.php @@ -11,6 +11,7 @@ use Magento\Bundle\Model\Option; use Magento\Catalog\Model\Product; use Magento\Catalog\Model\Product\Configuration\Item\ItemInterface; +use Magento\Framework\GraphQl\Query\Uid; use Magento\Framework\Pricing\Helper\Data; use Magento\Framework\Serialize\SerializerInterface; @@ -19,6 +20,11 @@ */ class BundleOptionDataProvider { + /** + * Option type name + */ + private const OPTION_TYPE = 'bundle'; + /** * @var Data */ @@ -34,19 +40,27 @@ class BundleOptionDataProvider */ private $configuration; + /** + * @var Uid + */ + private $uidEncoder; + /** * @param Data $pricingHelper * @param SerializerInterface $serializer * @param Configuration $configuration + * @param Uid $uidEncoder */ public function __construct( Data $pricingHelper, SerializerInterface $serializer, - Configuration $configuration + Configuration $configuration, + Uid $uidEncoder ) { $this->pricingHelper = $pricingHelper; $this->serializer = $serializer; $this->configuration = $configuration; + $this->uidEncoder = $uidEncoder; } /** @@ -100,8 +114,15 @@ private function buildBundleOptions(array $bundleOptions, ItemInterface $item): continue; } + $optionDetails = [ + self::OPTION_TYPE, + $bundleOption->getOptionId() + ]; + $uidString = implode('/', $optionDetails); + $options[] = [ 'id' => $bundleOption->getId(), + 'uid' => $this->uidEncoder->encode($uidString), 'label' => $bundleOption->getTitle(), 'type' => $bundleOption->getType(), 'values' => $this->buildBundleOptionValues($bundleOption->getSelections(), $item), @@ -130,10 +151,19 @@ private function buildBundleOptionValues(array $selections, ItemInterface $item) continue; } + $optionValueDetails = [ + self::OPTION_TYPE, + $selection->getOptionId(), + $selection->getSelectionId(), + (int) $selection->getSelectionQty() + ]; + $uidString = implode('/', $optionValueDetails); + $selectionPrice = $this->configuration->getSelectionFinalPrice($item, $selection); $values[] = [ - 'label' => $selection->getName(), 'id' => $selection->getSelectionId(), + 'uid' => $this->uidEncoder->encode($uidString), + 'label' => $selection->getName(), 'quantity' => $qty, 'price' => $this->pricingHelper->currency($selectionPrice, false, false), ]; diff --git a/app/code/Magento/Bundle/Model/Product/CheckOptionLinkIfExist.php b/app/code/Magento/Bundle/Model/Product/CheckOptionLinkIfExist.php new file mode 100644 index 000000000000..be49cd209faa --- /dev/null +++ b/app/code/Magento/Bundle/Model/Product/CheckOptionLinkIfExist.php @@ -0,0 +1,96 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Model\Product; + +use Magento\Bundle\Api\Data\OptionInterface; +use Magento\Bundle\Api\ProductOptionRepositoryInterface as OptionRepository; +use Magento\Bundle\Model\Link; +use Magento\Framework\Exception\InputException; +use Magento\Framework\Exception\NoSuchEntityException; + +/** + * Check bundle product option link if exist + */ +class CheckOptionLinkIfExist +{ + /** + * @var OptionRepository + */ + private $optionRepository; + + /** + * @param OptionRepository $optionRepository + */ + public function __construct(OptionRepository $optionRepository) + { + $this->optionRepository = $optionRepository; + } + + /** + * Check if link is already exist in bundle product option + * + * @param string $sku + * @param OptionInterface $optionToDelete + * @param Link $link + * @return bool + * @throws InputException + * @throws NoSuchEntityException + */ + public function execute(string $sku, OptionInterface $optionToDelete, Link $link): bool + { + $isLinkExist = true; + $availableOptions = $this->getAvailableOptionsAfterDelete($sku, $optionToDelete); + $optionLinkIds = $this->getLinkIds($availableOptions); + if (in_array($link->getEntityId(), $optionLinkIds)) { + $isLinkExist = false; + } + return $isLinkExist; + } + + /** + * Retrieve bundle product options after delete option + * + * @param string $sku + * @param OptionInterface $optionToDelete + * @return array + * @throws InputException + * @throws NoSuchEntityException + */ + private function getAvailableOptionsAfterDelete(string $sku, OptionInterface $optionToDelete): array + { + $bundleProductOptions = $this->optionRepository->getList($sku); + $options = []; + foreach ($bundleProductOptions as $bundleOption) { + if ($bundleOption->getOptionId() == $optionToDelete->getOptionId()) { + continue; + } + $options[] = $bundleOption; + } + return $options; + } + + /** + * Retrieve bundle product link options + * + * @param array $options + * @return array + */ + private function getLinkIds(array $options): array + { + $ids = []; + foreach ($options as $option) { + $links = $option->getProductLinks(); + if (!empty($links)) { + foreach ($links as $link) { + $ids[] = $link->getEntityId(); + } + } + } + return $ids; + } +} diff --git a/app/code/Magento/Bundle/Model/Product/LinksList.php b/app/code/Magento/Bundle/Model/Product/LinksList.php index c35d475e04d8..eba9886a895b 100644 --- a/app/code/Magento/Bundle/Model/Product/LinksList.php +++ b/app/code/Magento/Bundle/Model/Product/LinksList.php @@ -4,12 +4,22 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Bundle\Model\Product; +use Magento\Bundle\Api\Data\LinkInterface; +use Magento\Bundle\Api\Data\LinkInterfaceFactory; +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Framework\Api\DataObjectHelper; + +/** + * Retrieve bundle product links service. + */ class LinksList { /** - * @var \Magento\Bundle\Api\Data\LinkInterfaceFactory + * @var LinkInterfaceFactory */ protected $linkFactory; @@ -19,19 +29,19 @@ class LinksList protected $type; /** - * @var \Magento\Framework\Api\DataObjectHelper + * @var DataObjectHelper */ protected $dataObjectHelper; /** - * @param \Magento\Bundle\Api\Data\LinkInterfaceFactory $linkFactory + * @param LinkInterfaceFactory $linkFactory * @param Type $type - * @param \Magento\Framework\Api\DataObjectHelper $dataObjectHelper + * @param DataObjectHelper $dataObjectHelper */ public function __construct( - \Magento\Bundle\Api\Data\LinkInterfaceFactory $linkFactory, - \Magento\Bundle\Model\Product\Type $type, - \Magento\Framework\Api\DataObjectHelper $dataObjectHelper + LinkInterfaceFactory $linkFactory, + Type $type, + DataObjectHelper $dataObjectHelper ) { $this->linkFactory = $linkFactory; $this->type = $type; @@ -39,32 +49,32 @@ public function __construct( } /** - * Bundle Product Items Data + * Get Bundle Product Items Data. * - * @param \Magento\Catalog\Api\Data\ProductInterface $product + * @param ProductInterface $product * @param int $optionId - * @return \Magento\Bundle\Api\Data\LinkInterface[] + * @return LinkInterface[] */ - public function getItems(\Magento\Catalog\Api\Data\ProductInterface $product, $optionId) + public function getItems(ProductInterface $product, $optionId) { $selectionCollection = $this->type->getSelectionsCollection([$optionId], $product); $productLinks = []; /** @var \Magento\Catalog\Model\Product $selection */ foreach ($selectionCollection as $selection) { - $bundledProductPrice = $selection->getSelectionPriceValue(); - if ($bundledProductPrice <= 0) { - $bundledProductPrice = $selection->getPrice(); - } - $selectionPriceType = $product->getPriceType() ? $selection->getSelectionPriceType() : null; - $selectionPrice = $bundledProductPrice ? $bundledProductPrice : null; + $priceType = $product->getPriceType(); + $selectionPriceType = $priceType ? $selection->getSelectionPriceType() : null; + $selectionPriceValue = $selection->getSelectionPriceValue() < 0 + ? $selection->getPrice() + : $selection->getSelectionPriceValue(); + $selectionPrice = $priceType ? $selectionPriceValue : $selection->getPrice(); - /** @var \Magento\Bundle\Api\Data\LinkInterface $productLink */ + /** @var LinkInterface $productLink */ $productLink = $this->linkFactory->create(); $this->dataObjectHelper->populateWithArray( $productLink, $selection->getData(), - \Magento\Bundle\Api\Data\LinkInterface::class + LinkInterface::class ); $productLink->setIsDefault($selection->getIsDefault()) ->setId($selection->getSelectionId()) diff --git a/app/code/Magento/Bundle/Model/Product/SaveHandler.php b/app/code/Magento/Bundle/Model/Product/SaveHandler.php index 8c2727a71aac..e536b8961ebb 100644 --- a/app/code/Magento/Bundle/Model/Product/SaveHandler.php +++ b/app/code/Magento/Bundle/Model/Product/SaveHandler.php @@ -8,12 +8,16 @@ namespace Magento\Bundle\Model\Product; use Magento\Bundle\Api\Data\OptionInterface; +use Magento\Bundle\Api\ProductLinkManagementInterface; +use Magento\Bundle\Api\ProductOptionRepositoryInterface as OptionRepository; use Magento\Bundle\Model\Option\SaveAction; +use Magento\Bundle\Model\ProductRelationsProcessorComposite; use Magento\Catalog\Api\Data\ProductInterface; -use Magento\Bundle\Api\ProductOptionRepositoryInterface as OptionRepository; -use Magento\Bundle\Api\ProductLinkManagementInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\EntityManager\MetadataPool; use Magento\Framework\EntityManager\Operation\ExtensionInterface; +use Magento\Framework\Exception\InputException; +use Magento\Framework\Exception\NoSuchEntityException; /** * Bundle product save handler @@ -40,22 +44,40 @@ class SaveHandler implements ExtensionInterface */ private $metadataPool; + /** + * @var CheckOptionLinkIfExist + */ + private $checkOptionLinkIfExist; + + /** + * @var ProductRelationsProcessorComposite + */ + private $productRelationsProcessorComposite; + /** * @param OptionRepository $optionRepository * @param ProductLinkManagementInterface $productLinkManagement * @param SaveAction $optionSave * @param MetadataPool $metadataPool + * @param CheckOptionLinkIfExist|null $checkOptionLinkIfExist + * @param ProductRelationsProcessorComposite|null $productRelationsProcessorComposite */ public function __construct( OptionRepository $optionRepository, ProductLinkManagementInterface $productLinkManagement, SaveAction $optionSave, - MetadataPool $metadataPool + MetadataPool $metadataPool, + ?CheckOptionLinkIfExist $checkOptionLinkIfExist = null, + ?ProductRelationsProcessorComposite $productRelationsProcessorComposite = null ) { $this->optionRepository = $optionRepository; $this->productLinkManagement = $productLinkManagement; $this->optionSave = $optionSave; $this->metadataPool = $metadataPool; + $this->checkOptionLinkIfExist = $checkOptionLinkIfExist + ?? ObjectManager::getInstance()->get(CheckOptionLinkIfExist::class); + $this->productRelationsProcessorComposite = $productRelationsProcessorComposite + ?? ObjectManager::getInstance()->get(ProductRelationsProcessorComposite::class); } /** @@ -95,6 +117,12 @@ public function execute($entity, $arguments = []) $entity->setCopyFromView(false); } + $this->productRelationsProcessorComposite->process( + $entity, + $existingBundleProductOptions, + $bundleProductOptions + ); + return $entity; } @@ -105,13 +133,18 @@ public function execute($entity, $arguments = []) * @param OptionInterface $option * * @return void + * @throws InputException + * @throws NoSuchEntityException */ protected function removeOptionLinks($entitySku, $option) { $links = $option->getProductLinks(); if (!empty($links)) { foreach ($links as $link) { - $this->productLinkManagement->removeChild($entitySku, $option->getId(), $link->getSku()); + $linkCanBeDeleted = $this->checkOptionLinkIfExist->execute($entitySku, $option, $link); + if ($linkCanBeDeleted) { + $this->productLinkManagement->removeChild($entitySku, $option->getId(), $link->getSku()); + } } } } diff --git a/app/code/Magento/Bundle/Model/Product/SingleChoiceProvider.php b/app/code/Magento/Bundle/Model/Product/SingleChoiceProvider.php new file mode 100644 index 000000000000..3141252dafef --- /dev/null +++ b/app/code/Magento/Bundle/Model/Product/SingleChoiceProvider.php @@ -0,0 +1,64 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Model\Product; + +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Type as BundleType; + +/** + * Service to check is bundle product has single choice (no customization possible) + */ +class SingleChoiceProvider +{ + /** + * Single choice availability + * + * @param Product $product + * @return bool + */ + public function isSingleChoiceAvailable(Product $product) : bool + { + $result = false; + if ($product->getTypeId() === BundleType::TYPE_BUNDLE) { + $typeInstance = $product->getTypeInstance(); + $typeInstance->setStoreFilter($product->getStoreId(), $product); + + if ($typeInstance->hasRequiredOptions($product)) { + $options = $typeInstance->getOptions($product); + $isNoCustomizations = true; + foreach ($options as $option) { + $optionId = $option->getId(); + $required = $option->getRequired(); + if ($isNoCustomizations && (int) $required === 1) { + $selectionsCollection = $typeInstance->getSelectionsCollection( + [$optionId], + $product + ); + $selections = $selectionsCollection->exportToArray(); + if (count($selections) > 1) { + foreach ($selections as $selection) { + if ($isNoCustomizations) { + $isNoCustomizations = (int)$selection['is_default'] === 1 + && (int)$selection['selection_can_change_qty'] === 0; + } else { + break; + } + } + } + } else { + $isNoCustomizations = false; + break; + } + } + + $result = $isNoCustomizations; + } + } + return $result; + } +} diff --git a/app/code/Magento/Bundle/Model/Product/Type.php b/app/code/Magento/Bundle/Model/Product/Type.php index 6ee67859db01..3890be0e9a8a 100644 --- a/app/code/Magento/Bundle/Model/Product/Type.php +++ b/app/code/Magento/Bundle/Model/Product/Type.php @@ -665,7 +665,11 @@ protected function _prepareProduct(\Magento\Framework\DataObject $buyRequest, $p $skipSaleableCheck = $this->_catalogProduct->getSkipSaleableCheck(); $_appendAllSelections = (bool)$product->getSkipCheckRequiredOption() || $skipSaleableCheck; - $options = $buyRequest->getBundleOption(); + if ($buyRequest->getBundleOptionsData()) { + $options = $this->getPreparedOptions($buyRequest->getBundleOptionsData()); + } else { + $options = $buyRequest->getBundleOption(); + } if (is_array($options)) { $options = $this->recursiveIntval($options); $optionIds = array_keys($options); @@ -732,7 +736,11 @@ protected function _prepareProduct(\Magento\Framework\DataObject $buyRequest, $p if ((is_array($selections) && count($selections) > 0) || !$isStrictProcessMode) { $uniqueKey = [$product->getId()]; $selectionIds = []; - $qtys = $buyRequest->getBundleOptionQty(); + if ($buyRequest->getBundleOptionsData()) { + $qtys = $buyRequest->getBundleOptionsData(); + } else { + $qtys = $buyRequest->getBundleOptionQty(); + } // Shuffle selection array by option position usort($selections, [$this, 'shakeSelections']); @@ -1231,7 +1239,12 @@ public function getIdentities(\Magento\Catalog\Model\Product $product) protected function getQty($selection, $qtys, $selectionOptionId) { if ($selection->getSelectionCanChangeQty() && isset($qtys[$selectionOptionId])) { - $qty = (float)$qtys[$selectionOptionId] > 0 ? $qtys[$selectionOptionId] : 1; + if (is_array($qtys[$selectionOptionId]) && isset($qtys[$selectionOptionId][$selection->getSelectionId()])) { + $selectionQty = $qtys[$selectionOptionId][$selection->getSelectionId()]; + $qty = (float)$selectionQty > 0 ? $selectionQty : 1; + } else { + $qty = (float)$qtys[$selectionOptionId] > 0 ? $qtys[$selectionOptionId] : 1; + } } else { $qty = (float)$selection->getSelectionQty() ? $selection->getSelectionQty() : 1; } @@ -1404,4 +1417,21 @@ protected function mergeSelectionsWithOptions($options, $selections) return array_merge([], ...$selections); } + + /** + * Get prepared options with selection ids + * + * @param array $options + * @return array + */ + private function getPreparedOptions(array $options): array + { + foreach ($options as $optionId => $option) { + foreach ($option as $selectionId => $optionQty) { + $options[$optionId][$selectionId] = $selectionId; + } + } + + return $options; + } } diff --git a/app/code/Magento/Bundle/Model/ProductRelationsProcessorComposite.php b/app/code/Magento/Bundle/Model/ProductRelationsProcessorComposite.php new file mode 100644 index 000000000000..b1035b0fb0d4 --- /dev/null +++ b/app/code/Magento/Bundle/Model/ProductRelationsProcessorComposite.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Model; + +use Magento\Catalog\Api\Data\ProductInterface; + +/** + * Composite processor to handle bundle product relations. + */ +class ProductRelationsProcessorComposite implements ProductRelationsProcessorInterface +{ + /** + * @var ProductRelationsProcessorInterface[] + */ + private $processors; + + /** + * @param ProductRelationsProcessorInterface[] $processors + */ + public function __construct(array $processors = []) + { + foreach ($processors as $processor) { + if (!$processor instanceof ProductRelationsProcessorInterface) { + throw new \InvalidArgumentException( + __('Product relations processor must implement %1.', ProductRelationsProcessorInterface::class) + ); + } + } + + $this->processors = $processors; + } + + /** + * @inheritDoc + */ + public function process( + ProductInterface $product, + array $existingProductOptions, + array $expectedProductOptions + ): void { + foreach ($this->processors as $processor) { + $processor->process($product, $existingProductOptions, $expectedProductOptions); + } + } +} diff --git a/app/code/Magento/Bundle/Model/ProductRelationsProcessorInterface.php b/app/code/Magento/Bundle/Model/ProductRelationsProcessorInterface.php new file mode 100644 index 000000000000..68bb6531652e --- /dev/null +++ b/app/code/Magento/Bundle/Model/ProductRelationsProcessorInterface.php @@ -0,0 +1,28 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Model; + +/** + * Processor to handle bundle product relations. + */ +interface ProductRelationsProcessorInterface +{ + /** + * Process bundle product relations. + * + * @param \Magento\Catalog\Api\Data\ProductInterface $product + * @param array $existingProductOptions + * @param array $expectedProductOptions + * @return void + */ + public function process( + \Magento\Catalog\Api\Data\ProductInterface $product, + array $existingProductOptions, + array $expectedProductOptions + ): void; +} diff --git a/app/code/Magento/Bundle/Model/Quote/Item/Option.php b/app/code/Magento/Bundle/Model/Quote/Item/Option.php new file mode 100644 index 000000000000..2d8ad3b0d57a --- /dev/null +++ b/app/code/Magento/Bundle/Model/Quote/Item/Option.php @@ -0,0 +1,109 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Model\Quote\Item; + +use Magento\Bundle\Model\Product\Price; +use Magento\Bundle\Model\Product\Type; +use Magento\Catalog\Model\Product; +use Magento\Framework\Serialize\Serializer\Json; + +/** + * Bundle product options model + */ +class Option +{ + /** + * @var Json + */ + private $serializer; + + /** + * @param Json $serializer + */ + public function __construct( + Json $serializer + ) { + $this->serializer = $serializer; + } + + /** + * Get selection options for provided bundle product + * + * @param Product $product + * @return array + */ + public function getSelectionOptions(Product $product): array + { + $options = []; + $bundleOptionIds = $this->getOptionValueAsArray($product, 'bundle_option_ids'); + if ($bundleOptionIds) { + /** @var Type $typeInstance */ + $typeInstance = $product->getTypeInstance(); + $optionsCollection = $typeInstance->getOptionsByIds($bundleOptionIds, $product); + $selectionIds = $this->getOptionValueAsArray($product, 'bundle_selection_ids'); + + if ($selectionIds) { + $selectionsCollection = $typeInstance->getSelectionsByIds($selectionIds, $product); + $optionsCollection->appendSelections($selectionsCollection, true); + + foreach ($selectionsCollection as $selection) { + $selectionId = $selection->getSelectionId(); + $options[$selectionId][] = $this->getBundleSelectionAttributes($product, $selection); + } + } + } + + return $options; + } + + /** + * Get selection attributes for provided selection + * + * @param Product $product + * @param Product $selection + * @return array + */ + private function getBundleSelectionAttributes(Product $product, Product $selection): array + { + $selectionId = $selection->getSelectionId(); + /** @var \Magento\Bundle\Model\Option $bundleOption */ + $bundleOption = $selection->getOption(); + /** @var Price $priceModel */ + $priceModel = $product->getPriceModel(); + $price = $priceModel->getSelectionFinalTotalPrice($product, $selection, 0, 1); + $customOption = $product->getCustomOption('selection_qty_' . $selectionId); + $qty = (float)($customOption ? $customOption->getValue() : 0); + + return [ + 'code' => 'bundle_selection_attributes', + 'value'=> $this->serializer->serialize( + [ + 'price' => $price, + 'qty' => $qty, + 'option_label' => $bundleOption->getTitle(), + 'option_id' => $bundleOption->getId(), + ] + ) + ]; + } + + /** + * Get unserialized value of custom option + * + * @param Product $product + * @param string $code + * @return array + */ + private function getOptionValueAsArray(Product $product, string $code): array + { + $option = $product->getCustomOption($code); + return $option && $option->getValue() + ? $this->serializer->unserialize($option->getValue()) + : []; + } +} diff --git a/app/code/Magento/Bundle/Model/Quote/Item/Option/BundleSelectionAttributesComparator.php b/app/code/Magento/Bundle/Model/Quote/Item/Option/BundleSelectionAttributesComparator.php new file mode 100644 index 000000000000..8e4a2c1f367e --- /dev/null +++ b/app/code/Magento/Bundle/Model/Quote/Item/Option/BundleSelectionAttributesComparator.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Model\Quote\Item\Option; + +use Magento\Framework\DataObject; +use Magento\Framework\Serialize\Serializer\Json; +use Magento\Quote\Model\Quote\Item\Option\ComparatorInterface; + +/** + * Bundle quote item option comparator + */ +class BundleSelectionAttributesComparator implements ComparatorInterface +{ + /** + * @var Json + */ + private $serializer; + + /** + * @param Json $serializer + */ + public function __construct( + Json $serializer + ) { + $this->serializer = $serializer; + } + + /** + * @inheritdoc + */ + public function compare(DataObject $option1, DataObject $option2): bool + { + $value1 = $option1->getValue() ? $this->serializer->unserialize($option1->getValue()) : []; + $value2 = $option2->getValue() ? $this->serializer->unserialize($option2->getValue()) : []; + $option1Id = isset($value1['option_id']) ? (int) $value1['option_id'] : null; + $option2Id = isset($value2['option_id']) ? (int) $value2['option_id'] : null; + + return $option1Id === $option2Id; + } +} diff --git a/app/code/Magento/Bundle/Model/QuoteRecollectProcessor.php b/app/code/Magento/Bundle/Model/QuoteRecollectProcessor.php new file mode 100644 index 000000000000..c3b69003b225 --- /dev/null +++ b/app/code/Magento/Bundle/Model/QuoteRecollectProcessor.php @@ -0,0 +1,149 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Model; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Framework\Reflection\TypeCaster; +use Magento\Quote\Model\ResourceModel\Quote as QuoteResource; + +/** + * Recollect quota after handle product relations. + */ +class QuoteRecollectProcessor implements ProductRelationsProcessorInterface +{ + /** + * @var TypeCaster + */ + private $typeCaster; + + /** + * @var QuoteResource + */ + private $quoteResource; + + /** + * @var array + */ + private $comparisonFieldsTypeMapper; + + /** + * @param TypeCaster $typeCaster + * @param QuoteResource $quoteResource + * @param array $comparisonFieldsTypeMapper + */ + public function __construct( + TypeCaster $typeCaster, + QuoteResource $quoteResource, + array $comparisonFieldsTypeMapper = [] + ) { + $this->typeCaster = $typeCaster; + $this->quoteResource = $quoteResource; + $this->comparisonFieldsTypeMapper = $comparisonFieldsTypeMapper; + } + + /** + * Mark quotes to recollect if product options or links are changed. + * + * @param ProductInterface $product + * @param array $existingProductOptions + * @param array $expectedProductOptions + * @return void + */ + public function process( + ProductInterface $product, + array $existingProductOptions, + array $expectedProductOptions + ): void { + if (empty($existingProductOptions)) { + return; + } + + if ($this->isProductOptionsChanged($existingProductOptions, $expectedProductOptions) + || $this->isProductLinksChanged($existingProductOptions, $expectedProductOptions) + ) { + $this->quoteResource->markQuotesRecollect($product->getId()); + } + } + + /** + * Check product options change. + * + * @param array $existingProductOptions + * @param array $expectedProductOptions + * @return bool + */ + private function isProductOptionsChanged( + array $existingProductOptions, + array $expectedProductOptions + ): bool { + if (count($existingProductOptions) !== count($expectedProductOptions)) { + return true; + } + + $productOptionsDiff = array_udiff( + $expectedProductOptions, + $existingProductOptions, + function ($expectedProductOption, $existingProductOption) { + if ($expectedProductOption->getOptionId() === $existingProductOption->getOptionId()) { + return $expectedProductOption->getRequired() - $existingProductOption->getRequired(); + } + + return $expectedProductOption->getOptionId() - $existingProductOption->getOptionId(); + } + ); + + return (bool)count($productOptionsDiff); + } + + /** + * Check product links change. + * + * @param array $existingProductOptions + * @param array $expectedProductOptions + * @return bool + */ + private function isProductLinksChanged( + array $existingProductOptions, + array $expectedProductOptions + ): bool { + $existingProductLinks = $this->flattenProductLinksData($existingProductOptions); + $expectedProductLinks = $this->flattenProductLinksData($expectedProductOptions); + + return $existingProductLinks != $expectedProductLinks; + } + + /** + * Simplify product links data. + * + * @param array $productOptions + * @return array + */ + private function flattenProductLinksData(array $productOptions): array + { + return array_reduce($productOptions, function ($result, $productOption) { + $optionId = $productOption->getOptionId(); + $productLinks = []; + foreach ($productOption->getProductLinks() as $productLink) { + $productLinkData = $productLink->getData(); + $productLinkFilteredData = []; + foreach ($this->comparisonFieldsTypeMapper as $fieldName => $fieldType) { + if (isset($productLinkData[$fieldName])) { + $productLinkFilteredData[$fieldName] = $this->typeCaster->castValueToType( + $productLinkData[$fieldName], + $fieldType + ); + } + } + $productLinks[$productLink->getId()] = $productLinkFilteredData; + } + $result[$optionId] = $productLinks; + + return $result; + }); + } +} diff --git a/app/code/Magento/Bundle/Model/ResourceModel/Indexer/BundleOptionStockDataSelectBuilder.php b/app/code/Magento/Bundle/Model/ResourceModel/Indexer/BundleOptionStockDataSelectBuilder.php index 702a25ff73fb..c322a4b26241 100644 --- a/app/code/Magento/Bundle/Model/ResourceModel/Indexer/BundleOptionStockDataSelectBuilder.php +++ b/app/code/Magento/Bundle/Model/ResourceModel/Indexer/BundleOptionStockDataSelectBuilder.php @@ -17,6 +17,16 @@ */ class BundleOptionStockDataSelectBuilder { + /** + * @var \Magento\Framework\App\ResourceConnection + */ + private $resourceConnection; + + /** + * @var \Magento\Framework\EntityManager\MetadataPool + */ + private $metadataPool; + /** * @param \Magento\Framework\App\ResourceConnection $resourceConnection * @param \Magento\Framework\EntityManager\MetadataPool $metadataPool diff --git a/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php b/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php index 55bef4980098..569758c10717 100644 --- a/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php +++ b/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php @@ -91,6 +91,21 @@ class Price implements DimensionalIndexerInterface */ private $moduleManager; + /** + * @var string + */ + private $tmpBundlePriceTable; + + /** + * @var string + */ + private $tmpBundleSelectionTable; + + /** + * @var string + */ + private $tmpBundleOptionTable; + /** * @param IndexTableStructureFactory $indexTableStructureFactory * @param TableMaintainer $tableMaintainer @@ -184,7 +199,16 @@ public function executeByDimensions(array $dimensions, \Traversable $entityIds) */ private function getBundlePriceTable() { - return $this->getTable('catalog_product_index_price_bundle_tmp'); + if ($this->tmpBundlePriceTable === null) { + $this->tmpBundlePriceTable = $this->getTable('catalog_product_index_price_bundle_temp'); + $this->getConnection()->createTemporaryTableLike( + $this->tmpBundlePriceTable, + $this->getTable('catalog_product_index_price_bundle_tmp'), + true + ); + } + + return $this->tmpBundlePriceTable; } /** @@ -194,7 +218,16 @@ private function getBundlePriceTable() */ private function getBundleSelectionTable() { - return $this->getTable('catalog_product_index_price_bundle_sel_tmp'); + if ($this->tmpBundleSelectionTable === null) { + $this->tmpBundleSelectionTable = $this->getTable('catalog_product_index_price_bundle_sel_temp'); + $this->getConnection()->createTemporaryTableLike( + $this->tmpBundleSelectionTable, + $this->getTable('catalog_product_index_price_bundle_sel_tmp'), + true + ); + } + + return $this->tmpBundleSelectionTable; } /** @@ -204,7 +237,16 @@ private function getBundleSelectionTable() */ private function getBundleOptionTable() { - return $this->getTable('catalog_product_index_price_bundle_opt_tmp'); + if ($this->tmpBundleOptionTable === null) { + $this->tmpBundleOptionTable = $this->getTable('catalog_product_index_price_bundle_opt_temp'); + $this->getConnection()->createTemporaryTableLike( + $this->tmpBundleOptionTable, + $this->getTable('catalog_product_index_price_bundle_opt_tmp'), + true + ); + } + + return $this->tmpBundleOptionTable; } /** @@ -273,6 +315,10 @@ private function prepareBundlePriceByType($priceType, array $dimensions, $entity ['cwd' => $this->getTable('catalog_product_index_website')], 'pw.website_id = cwd.website_id', [] + )->joinLeft( + ['cgw' => $this->getTable('customer_group_excluded_website')], + 'cg.customer_group_id = cgw.customer_group_id AND pw.website_id = cgw.website_id', + [] ); $select->joinLeft( ['tp' => $this->getTable('catalog_product_index_tier_price')], @@ -365,6 +411,9 @@ private function prepareBundlePriceByType($priceType, array $dimensions, $entity $select->where('e.entity_id IN(?)', $entityIds); } + // exclude websites that are limited for customer group + $select->where('cgw.website_id IS NULL'); + /** * Add additional external limitation */ @@ -456,6 +505,42 @@ private function getBaseBundleSelectionPriceSelect(): Select return $select; } + /** + * Get base select for bundle selection price update + * + * @return Select + * @throws \Exception + */ + private function getBaseBundleSelectionPriceUpdateSelect(): Select + { + $metadata = $this->metadataPool->getMetadata(ProductInterface::class); + $linkField = $metadata->getLinkField(); + $bundleSelectionTable = $this->getBundleSelectionTable(); + + $select = $this->getConnection()->select() + ->join( + ['i' => $this->getBundlePriceTable()], + "i.entity_id = $bundleSelectionTable.entity_id + AND i.customer_group_id = $bundleSelectionTable.customer_group_id + AND i.website_id = $bundleSelectionTable.website_id", + [] + )->join( + ['parent_product' => $this->getTable('catalog_product_entity')], + 'parent_product.entity_id = i.entity_id', + [] + )->join( + ['bo' => $this->getTable('catalog_product_bundle_option')], + "bo.parent_id = parent_product.$linkField AND bo.option_id = $bundleSelectionTable.option_id", + ['option_id'] + )->join( + ['bs' => $this->getTable('catalog_product_bundle_selection')], + "bs.option_id = bo.option_id AND bs.selection_id = $bundleSelectionTable.selection_id", + ['selection_id'] + ); + + return $select; + } + /** * Apply selections price for fixed bundles * @@ -499,7 +584,7 @@ private function applyFixedBundleSelectionPrice() ] ); - $select = $this->getBaseBundleSelectionPriceSelect(); + $select = $this->getBaseBundleSelectionPriceUpdateSelect(); $select->joinInner( ['bsp' => $this->getTable('catalog_product_bundle_selection_price')], 'bs.selection_id = bsp.selection_id AND bsp.website_id = i.website_id', @@ -678,6 +763,11 @@ private function prepareTierPriceIndex($dimensions, $entityIds) ['pw' => $this->getTable('store_website')], 'tp.website_id = 0 OR tp.website_id = pw.website_id', ['website_id'] + )->joinLeft( + // customer group website limitations + ['cgw' => $this->getTable('customer_group_excluded_website')], + 'cg.customer_group_id = cgw.customer_group_id AND pw.website_id = cgw.website_id', + [] )->where( 'pw.website_id != 0' )->where( @@ -692,6 +782,10 @@ private function prepareTierPriceIndex($dimensions, $entityIds) if (!empty($entityIds)) { $select->where('e.entity_id IN(?)', $entityIds); } + + // exclude websites that are limited for customer group + $select->where('cgw.website_id IS NULL'); + foreach ($dimensions as $dimension) { if (!isset($this->dimensionToFieldMapper[$dimension->getName()])) { throw new \LogicException( diff --git a/app/code/Magento/Bundle/Model/ResourceModel/Indexer/StockStatusSelectBuilder.php b/app/code/Magento/Bundle/Model/ResourceModel/Indexer/StockStatusSelectBuilder.php index a4685fc3630a..d41f6bc0a8ce 100644 --- a/app/code/Magento/Bundle/Model/ResourceModel/Indexer/StockStatusSelectBuilder.php +++ b/app/code/Magento/Bundle/Model/ResourceModel/Indexer/StockStatusSelectBuilder.php @@ -18,6 +18,20 @@ */ class StockStatusSelectBuilder { + /** + * @var \Magento\Framework\App\ResourceConnection + */ + private $resourceConnection; + + /** + * @var \Magento\Framework\EntityManager\MetadataPool + */ + private $metadataPool; + + /** + * @var \Magento\Eav\Model\Config + */ + private $eavConfig; /** * @param \Magento\Framework\App\ResourceConnection $resourceConnection diff --git a/app/code/Magento/Bundle/Model/Selection.php b/app/code/Magento/Bundle/Model/Selection.php index f8e3d05fd980..3137f723e57c 100644 --- a/app/code/Magento/Bundle/Model/Selection.php +++ b/app/code/Magento/Bundle/Model/Selection.php @@ -20,6 +20,8 @@ * @method \Magento\Bundle\Model\Selection setPosition(int $value) * @method int getIsDefault() * @method \Magento\Bundle\Model\Selection setIsDefault(int $value) + * @method int getWebsiteId() + * @method \Magento\Bundle\Model\Selection setWebsiteId(int $value) * @method int getSelectionPriceType() * @method \Magento\Bundle\Model\Selection setSelectionPriceType(int $value) * @method float getSelectionPriceValue() @@ -74,11 +76,28 @@ protected function _construct() /** * Processing object before save data * + * @return void + */ + public function beforeSave() + { + if (!$this->_catalogData->isPriceGlobal() && $this->getWebsiteId()) { + $this->setData('tmp_selection_price_value', $this->getSelectionPriceValue()); + $this->setSelectionPriceValue($this->getOrigData('selection_price_value')); + } + parent::beforeSave(); + } + + /** + * Processing object after save data + * * @return $this */ public function afterSave() { if (!$this->_catalogData->isPriceGlobal() && $this->getWebsiteId()) { + if (null !== $this->getData('tmp_selection_price_value')) { + $this->setSelectionPriceValue($this->getData('tmp_selection_price_value')); + } $this->getResource()->saveSelectionPrice($this); if (!$this->getDefaultPriceScope()) { @@ -86,6 +105,6 @@ public function afterSave() $this->unsSelectionPriceType(); } } - parent::afterSave(); + return parent::afterSave(); } } diff --git a/app/code/Magento/Bundle/Plugin/Api/ProductLinkManagement/ReindexAfterAddChildBySkuPlugin.php b/app/code/Magento/Bundle/Plugin/Api/ProductLinkManagement/ReindexAfterAddChildBySkuPlugin.php new file mode 100644 index 000000000000..24dc8ce49b23 --- /dev/null +++ b/app/code/Magento/Bundle/Plugin/Api/ProductLinkManagement/ReindexAfterAddChildBySkuPlugin.php @@ -0,0 +1,59 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Bundle\Plugin\Api\ProductLinkManagement; + +use Magento\Bundle\Api\ProductLinkManagementInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Indexer\Product\Full; + +/** + * Reindex bundle product after child has been added. + */ +class ReindexAfterAddChildBySkuPlugin +{ + /** + * @var Full + */ + private $indexer; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @param Full $indexer + * @param ProductRepositoryInterface $productRepository + */ + public function __construct(Full $indexer, ProductRepositoryInterface $productRepository) + { + $this->indexer = $indexer; + $this->productRepository = $productRepository; + } + + /** + * Reindex bundle product after child has been added. + * + * @param ProductLinkManagementInterface $subject + * @param int $result + * @param string $sku + * @return int + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterAddChildByProductSku( + ProductLinkManagementInterface $subject, + int $result, + string $sku + ): int { + $bundleProduct = $this->productRepository->get($sku, true); + $this->indexer->executeRow($bundleProduct->getId()); + + return $result; + } +} diff --git a/app/code/Magento/Bundle/Plugin/Api/ProductLinkManagement/ReindexAfterRemoveChildPlugin.php b/app/code/Magento/Bundle/Plugin/Api/ProductLinkManagement/ReindexAfterRemoveChildPlugin.php new file mode 100644 index 000000000000..c92ee5b49477 --- /dev/null +++ b/app/code/Magento/Bundle/Plugin/Api/ProductLinkManagement/ReindexAfterRemoveChildPlugin.php @@ -0,0 +1,59 @@ +<?php + +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Plugin\Api\ProductLinkManagement; + +use Magento\Bundle\Api\ProductLinkManagementInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Indexer\Product\Full; + +/** + * Reindex bundle product after child has been removed. + */ +class ReindexAfterRemoveChildPlugin +{ + /** + * @var Full + */ + private $indexer; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @param Full $indexer + * @param ProductRepositoryInterface $productRepository + */ + public function __construct(Full $indexer, ProductRepositoryInterface $productRepository) + { + $this->indexer = $indexer; + $this->productRepository = $productRepository; + } + + /** + * Reindex bundle product after child has been removed. + * + * @param ProductLinkManagementInterface $subject + * @param bool $result + * @param string $sku + * @return bool + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterRemoveChild( + ProductLinkManagementInterface $subject, + bool $result, + string $sku + ): bool { + $bundleProduct = $this->productRepository->get($sku, true); + $this->indexer->executeRow($bundleProduct->getId()); + + return $result; + } +} diff --git a/app/code/Magento/Bundle/Plugin/Catalog/Model/Product/Type/AbstractType.php b/app/code/Magento/Bundle/Plugin/Catalog/Model/Product/Type/AbstractType.php new file mode 100644 index 000000000000..64061dc96321 --- /dev/null +++ b/app/code/Magento/Bundle/Plugin/Catalog/Model/Product/Type/AbstractType.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Plugin\Catalog\Model\Product\Type; + +use Magento\Catalog\Model\Product\Type\AbstractType as Subject; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Type; +use Magento\Bundle\Model\Product\SingleChoiceProvider; + +/** + * Plugin to add possibility to add bundle product with single option from list + */ +class AbstractType +{ + /** + * @var SingleChoiceProvider + */ + private $singleChoiceProvider; + + /** + * @param SingleChoiceProvider $singleChoiceProvider + */ + public function __construct( + SingleChoiceProvider $singleChoiceProvider + ) { + $this->singleChoiceProvider = $singleChoiceProvider; + } + + /** + * Add possibility to add to cart from the list in case of one required option + * + * @param Subject $subject + * @param bool $result + * @param Product $product + * @return bool + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterIsPossibleBuyFromList(Subject $subject, $result, $product) + { + if ($product->getTypeId() === Type::TYPE_BUNDLE) { + $isSingleChoice = $this->singleChoiceProvider->isSingleChoiceAvailable($product); + if ($isSingleChoice === true) { + $result = $isSingleChoice; + } + } + return $result; + } +} diff --git a/app/code/Magento/Bundle/Plugin/Catalog/ViewModel/Product/AddBundleOptionsData.php b/app/code/Magento/Bundle/Plugin/Catalog/ViewModel/Product/AddBundleOptionsData.php new file mode 100644 index 000000000000..46125546d468 --- /dev/null +++ b/app/code/Magento/Bundle/Plugin/Catalog/ViewModel/Product/AddBundleOptionsData.php @@ -0,0 +1,64 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Plugin\Catalog\ViewModel\Product; + +use Magento\Catalog\Model\Product; +use Magento\Catalog\ViewModel\Product\OptionsData as Subject; +use Magento\Catalog\Model\Product\Type; +use Magento\Bundle\Model\Product\SingleChoiceProvider; + +/** + * Plugin to add bundle options data + */ +class AddBundleOptionsData +{ + /** + * @var SingleChoiceProvider + */ + private $singleChoiceProvider; + + /** + * @param SingleChoiceProvider $singleChoiceProvider + */ + public function __construct( + SingleChoiceProvider $singleChoiceProvider + ) { + $this->singleChoiceProvider = $singleChoiceProvider; + } + + public function afterGetOptionsData(Subject $subject, array $result, Product $product) : array + { + if ($product->getTypeId() === Type::TYPE_BUNDLE) { + if ($this->singleChoiceProvider->isSingleChoiceAvailable($product) === true) { + $typeInstance = $product->getTypeInstance(); + $typeInstance->setStoreFilter($product->getStoreId(), $product); + $options = $typeInstance->getOptions($product); + foreach ($options as $option) { + $optionId = $option->getId(); + $selectionsCollection = $typeInstance->getSelectionsCollection( + [$optionId], + $product + ); + $selections = $selectionsCollection->exportToArray(); + $countSelections = count($selections); + foreach ($selections as $selection) { + $name = 'bundle_option[' . $optionId . ']'; + if ($countSelections > 1) { + $name .= '[]'; + } + $result[] = [ + 'name' => $name, + 'value' => $selection['selection_id'] + ]; + } + } + } + } + return $result; + } +} diff --git a/app/code/Magento/Bundle/Plugin/Quote/UpdateBundleQuoteItemOptions.php b/app/code/Magento/Bundle/Plugin/Quote/UpdateBundleQuoteItemOptions.php new file mode 100644 index 000000000000..8ee06d2a41b5 --- /dev/null +++ b/app/code/Magento/Bundle/Plugin/Quote/UpdateBundleQuoteItemOptions.php @@ -0,0 +1,61 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Plugin\Quote; + +use Magento\Bundle\Model\Product\Type; +use Magento\Bundle\Model\Quote\Item\Option; +use Magento\Quote\Model\Quote; +use Magento\Quote\Model\Quote\Item; +use Magento\Quote\Model\QuoteManagement; + +/** + * Update bundle selection custom options + */ +class UpdateBundleQuoteItemOptions +{ + /** + * @var Option + */ + private $option; + + /** + * @param Option $option + */ + public function __construct( + Option $option + ) { + $this->option = $option; + } + + /** + * Update bundle selection custom options before order is placed + * + * @param QuoteManagement $subject + * @param Quote $quote + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function beforeSubmit( + QuoteManagement $subject, + Quote $quote, + array $orderData = [] + ): void { + foreach ($quote->getAllVisibleItems() as $quoteItem) { + if ($quoteItem->getProductType() === Type::TYPE_CODE) { + $options = $this->option->getSelectionOptions($quoteItem->getProduct()); + foreach ($quoteItem->getChildren() as $childItem) { + /** @var Item $childItem */ + $customOption = $childItem->getOptionByCode('selection_id'); + $selectionId = $customOption ? $customOption->getValue() : null; + if ($selectionId && isset($options[$selectionId])) { + $childItem->setOptions($options[$selectionId]); + } + } + } + } + } +} diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminAssertBundleProductGeneralInfoOnEditPageActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminAssertBundleProductGeneralInfoOnEditPageActionGroup.xml new file mode 100644 index 000000000000..d0a3fcb497c3 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminAssertBundleProductGeneralInfoOnEditPageActionGroup.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertBundleProductGeneralInfoOnEditPageActionGroup" extends="AdminAssertProductInfoOnEditPageActionGroup"> + <annotations> + <description>Verifies the general data on the Edit product details page in admin for a bundle product.</description> + </annotations> + <arguments> + <argument name="dynamicSku" defaultValue="true" type="string"/> + <argument name="dynamicPrice" defaultValue="true" type="string"/> + <argument name="dynamicWeight" defaultValue="true" type="string"/> + </arguments> + <executeJS function="return document.querySelector("{{AdminProductFormSection.attributeSet}}").innerText" stepKey="seeProductAttributeSet"/> + <assertEquals stepKey="assertProductAttributeSet" after="seeProductAttributeSet"> + <actualResult type="variable">seeProductAttributeSet</actualResult> + <expectedResult type="string">{{productAttributeSet}}</expectedResult> + </assertEquals> + <executeJS function="return document.querySelector("{{AdminProductFormBundleSection.dynamicSkuInput}}").checked.toString()" stepKey="dynamicSkuCheckedValue" after="seeProductSku"/> + <assertEquals stepKey="assertDynamicSku" after="dynamicSkuCheckedValue"> + <actualResult type="variable">dynamicSkuCheckedValue</actualResult> + <expectedResult type="string">{{dynamicSku}}</expectedResult> + </assertEquals> + <executeJS function="return document.querySelector("{{AdminProductFormBundleSection.dynamicPriceInput}}").checked.toString()" stepKey="dynamicPriceCheckedValue" after="seeProductPrice"/> + <assertEquals stepKey="assertDynamicPrice" after="dynamicPriceCheckedValue"> + <actualResult type="variable">dynamicPriceCheckedValue</actualResult> + <expectedResult type="string">{{dynamicPrice}}</expectedResult> + </assertEquals> + <executeJS function="return document.querySelector("{{AdminProductFormBundleSection.dynamicWeightInput}}").checked.toString()" stepKey="dynamicWeightCheckedValue" after="seeProductWeight"/> + <assertEquals stepKey="assertDynamicWeight" after="dynamicWeightCheckedValue"> + <actualResult type="variable">dynamicWeightCheckedValue</actualResult> + <expectedResult type="string">{{dynamicWeight}}</expectedResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminToggleSwitchDynamicPriceOnProductEditPageActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminToggleSwitchDynamicPriceOnProductEditPageActionGroup.xml new file mode 100644 index 000000000000..d822f5d6d7a4 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminToggleSwitchDynamicPriceOnProductEditPageActionGroup.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminToggleSwitchDynamicPriceOnProductEditPageActionGroup"> + <waitForElementVisible selector="{{AdminProductFormBundleSection.dynamicPriceToggle}}" stepKey="waitForToggleDynamicPrice"/> + <checkOption selector="{{AdminProductFormBundleSection.dynamicPriceToggle}}" stepKey="switchDynamicPriceToggle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminVerifyBundleProductOptionActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminVerifyBundleProductOptionActionGroup.xml new file mode 100644 index 000000000000..9562fd3df749 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminVerifyBundleProductOptionActionGroup.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminVerifyBundleProductOptionActionGroup"> + <annotations> + <description>Verify bundle option data for the specified option index on the Edit Product page in admin for + a Bundle product.</description> + </annotations> + <arguments> + <argument name="optionTitle" defaultValue="{{DropDownBundleOption.title}}" type="string"/> + <argument name="inputType" defaultValue="{{DropDownBundleOption.type}}" type="string"/> + <argument name="required" defaultValue="{{DropDownBundleOption.required}}" type="string"/> + <argument name="numberOfProducts" defaultValue="1" type="string"/> + <argument name="index" defaultValue="1" type="string"/> + </arguments> + <executeJS function="return ({{index}}-1).toString()" stepKey="indexMinusOne"/> + <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle({$indexMinusOne})}}" stepKey="waitForOptionTitle"/> + <seeInField userInput="{{optionTitle}}" selector="{{AdminProductFormBundleSection.bundleOptionXTitle({$indexMinusOne})}}" stepKey="seeOptionTitle"/> + <seeOptionIsSelected userInput="{{inputType}}" selector="{{AdminProductFormBundleSection.bundleOptionXInputType({$indexMinusOne})}}" stepKey="seeOptionType"/> + <executeJS function="return document.querySelector("{{AdminProductFormBundleSection.bundleOptionXRequired({$indexMinusOne})}}").checked.toString()" stepKey="optionRequiredValue"/> + <assertEquals stepKey="assertOptionRequiredValue"> + <actualResult type="variable">optionRequiredValue</actualResult> + <expectedResult type="string">{{required}}</expectedResult> + </assertEquals> + <seeNumberOfElements userInput="{{numberOfProducts}}" selector="{{AdminProductFormBundleSection.bundleOptionXAllProductRows(index)}}" stepKey="seeNumberOfProductsInOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminVerifyProductInBundleProductOptionActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminVerifyProductInBundleProductOptionActionGroup.xml new file mode 100644 index 000000000000..385f07d692bc --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminVerifyProductInBundleProductOptionActionGroup.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminVerifyProductInBundleProductOptionActionGroup"> + <annotations> + <description>Verify product data for the specified product row in a bundle option in the Bundle Items + section on the Edit Product page in admin for a Bundle product.</description> + </annotations> + <arguments> + <argument name="isDefault" defaultValue="true" type="string"/> + <argument name="name" defaultValue="{{_defaultProduct.name}}" type="string"/> + <argument name="sku" defaultValue="{{_defaultProduct.sku}}" type="string"/> + <argument name="defaultQuantity" defaultValue="1" type="string"/> + <argument name="userDefined" defaultValue="false" type="string"/> + <argument name="optionIndex" defaultValue="1" type="string"/> + <argument name="productIndex" defaultValue="1" type="string"/> + </arguments> + <executeJS function="return ({{optionIndex}}-1).toString()" stepKey="optionIndexMinusOne"/> + <executeJS function="return ({{productIndex}}-1).toString()" stepKey="productIndexMinusOne"/> + <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXProductYIsDefault({$optionIndexMinusOne}, {$productIndexMinusOne})}}" stepKey="waitForIsDefault"/> + <executeJS function="return document.querySelector("{{AdminProductFormBundleSection.bundleOptionXProductYIsDefault({$optionIndexMinusOne}, {$productIndexMinusOne})}}").checked.toString()" stepKey="isDefaultValue"/> + <assertEquals stepKey="assertIsDefaultValue"> + <actualResult type="variable">isDefaultValue</actualResult> + <expectedResult type="string">{{isDefault}}</expectedResult> + </assertEquals> + <see userInput="{{name}}" selector="{{AdminProductFormBundleSection.bundleOptionXProductYName(optionIndex, productIndex)}}" stepKey="seeName"/> + <see userInput="{{sku}}" selector="{{AdminProductFormBundleSection.bundleOptionXProductYSku(optionIndex, productIndex)}}" stepKey="seeSku"/> + <seeInField userInput="{{defaultQuantity}}" selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity({$optionIndexMinusOne}, {$productIndexMinusOne})}}" stepKey="seeDefaultQuantity"/> + <executeJS function="return document.querySelector("{{AdminProductFormBundleSection.bundleOptionXProductYUserDefined({$optionIndexMinusOne}, {$productIndexMinusOne})}}").checked.toString()" stepKey="userDefinedValue"/> + <assertEquals stepKey="assertUserDefinedValueValue"> + <actualResult type="variable">userDefinedValue</actualResult> + <expectedResult type="string">{{userDefined}}</expectedResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddCategoryBundleProductWithSingleChoiceToCartActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddCategoryBundleProductWithSingleChoiceToCartActionGroup.xml new file mode 100644 index 000000000000..4767a5abe352 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddCategoryBundleProductWithSingleChoiceToCartActionGroup.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontAddCategoryBundleProductWithSingleChoiceToCartActionGroup"> + <annotations> + <description>Adds a Bundled Product with the single choice to the Cart from the Category page.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="quantity" defaultValue="1" type="string"/> + </arguments> + + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> + <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product.name}} to your shopping cart." stepKey="seeAddToCartSuccessMessage"/> + + <!--Open minicart and change Qty--> + <scrollToTopOfPage stepKey="scrollToTheTopOfThePage"/> + <waitForElementVisible selector="{{StorefrontMinicartSection.showCart}}" stepKey="waitForElementToBeVisible"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickOnMiniCart"/> + <waitForPageLoad stepKey="waitForPageToLoad2"/> + <waitForElementVisible selector="{{StorefrontMinicartSection.quantity}}" stepKey="waitForElementQty"/> + <pressKey selector="{{StorefrontMinicartSection.itemQuantity(product.name)}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::BACKSPACE]" stepKey="deleteFiled"/> + <fillField selector="{{StorefrontMinicartSection.itemQuantity(product.name)}}" userInput="{{quantity}}" stepKey="changeQty"/> + <conditionalClick selector="{{StorefrontMinicartSection.itemQuantityUpdate(product.name)}}" dependentSelector="{{StorefrontMinicartSection.itemQuantityUpdate(product.name)}}" visible="true" stepKey="updateQty"/> + <waitForAjaxLoad stepKey="waitForAjaxLoad"/> + <waitForText userInput="{{quantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/> + + <!-- Close minicart --> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickOnMiniCartToClose"/> + <waitForPageLoad stepKey="waitForPageToLoad3"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontVerifyBundleProductOptionOnOrderActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontVerifyBundleProductOptionOnOrderActionGroup.xml new file mode 100644 index 000000000000..1867fdcb2484 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontVerifyBundleProductOptionOnOrderActionGroup.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontVerifyBundleProductOptionOnOrderActionGroup"> + <annotations> + <description>Verify bundle option data for the specified option index on a placed order on the storefront.</description> + </annotations> + <arguments> + <argument name="optionTitle" defaultValue="{{DropDownBundleOption.title}}" type="string"/> + <argument name="optionProductName" defaultValue="{{_defaultProduct.name}}" type="string"/> + <argument name="optionProductSku" defaultValue="{{_defaultProduct.sku}}" type="string"/> + <argument name="optionProductQuantityDescription" defaultValue="Ordered 1" type="string"/> + <argument name="productIndex" defaultValue="1" type="string"/> + <argument name="optionIndex" defaultValue="1" type="string"/> + </arguments> + <waitForText userInput="{{optionTitle}}" selector="{{StorefrontCustomerOrderViewSection.productOptionLabel(productIndex, optionIndex)}}" stepKey="seeOptionTitle"/> + <see userInput="{{optionProductName}}" selector="{{StorefrontCustomerOrderViewSection.productOptionProductName(productIndex, optionIndex)}}" stepKey="seeOptionProductName"/> + <see userInput="{{optionProductSku}}" selector="{{StorefrontCustomerOrderViewSection.productOptionProductSku(productIndex, optionIndex)}}" stepKey="seeOptionProductSku"/> + <see userInput="{{optionProductQuantityDescription}}" selector="{{StorefrontCustomerOrderViewSection.productOptionProductQuantity(productIndex, optionIndex)}}" stepKey="seeOptionProductQuantity"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/Data/BundleLinkData.xml b/app/code/Magento/Bundle/Test/Mftf/Data/BundleLinkData.xml index 60d11345731c..75ab4393e047 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Data/BundleLinkData.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Data/BundleLinkData.xml @@ -17,4 +17,13 @@ <data key="price_type">1</data> <data key="can_change_quantity">1</data> </entity> + <entity name="ApiBundleLinkFixed" type="bundle_link"> + <var key="option_id" entityKey="return" entityType="bundle_option"/> + <var key="sku" entityKey="sku" entityType="product"/> + <data key="qty">1</data> + <data key="is_default">1</data> + <data key="price">30</data> + <data key="price_type">0</data> + <data key="can_change_quantity">1</data> + </entity> </entities> diff --git a/app/code/Magento/Bundle/Test/Mftf/Section/AdminOrderItemsOrderedSection.xml b/app/code/Magento/Bundle/Test/Mftf/Section/AdminOrderItemsOrderedSection.xml new file mode 100644 index 000000000000..fc82816cabb9 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/Section/AdminOrderItemsOrderedSection.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminOrderItemsOrderedSection"> + <element name="orderItemOptionLabel" type="text" selector=".edit-order-table tr:nth-of-type({{row}}) .col-product .option-label" parameterized="true"/> + <element name="orderItemOptionValue" type="text" selector=".edit-order-table tr:nth-of-type({{row}}) .col-product .option-value" parameterized="true"/> + <element name="orderItemOptionPrice" type="text" selector=".edit-order-table tr:nth-of-type({{row}}) .col-product .option-value .price" parameterized="true"/> + </section> +</sections> diff --git a/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml b/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml index 6ad83ba1105f..213131c5ed65 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml @@ -16,10 +16,16 @@ <element name="firstInputType" type="select" selector="[name='bundle_options[bundle_options][0][type]']"/> <element name="firstRequired" type="checkbox" selector="[name='bundle_options[bundle_options][0][required]']"/> <element name="firstProductQuantity" type="input" selector="[name='bundle_options[bundle_options][0][bundle_selections][0][selection_qty]']"/> + <element name="allBundleOptions" type="text" selector="[data-index=bundle_options]>tbody>tr"/> <element name="bundleOptionXTitle" type="input" selector="[name='bundle_options[bundle_options][{{x}}][title]']" parameterized="true"/> <element name="bundleOptionXInputType" type="select" selector="[name='bundle_options[bundle_options][{{x}}][type]']" parameterized="true"/> <element name="bundleOptionXRequired" type="checkbox" selector="[name='bundle_options[bundle_options][{{x}}][required]']" parameterized="true"/> + <element name="bundleOptionXAllProductRows" type="text" parameterized="true" selector="[data-index=bundle_options]>tbody>tr:nth-of-type({{optionIndex}}) table[data-index=bundle_selections]>tbody>tr"/> + <element name="bundleOptionXProductYIsDefault" type="input" parameterized="true" selector="[name='bundle_options[bundle_options][{{optionIndex}}][bundle_selections][{{productIndex}}][is_default]']"/> + <element name="bundleOptionXProductYName" type="text" parameterized="true" selector="[data-index=bundle_options]>tbody>tr:nth-of-type({{optionIndex}}) table[data-index=bundle_selections]>tbody>tr:nth-of-type({{productIndex}}) div[data-index=name]"/> + <element name="bundleOptionXProductYSku" type="text" parameterized="true" selector="[data-index=bundle_options]>tbody>tr:nth-of-type({{optionIndex}}) table[data-index=bundle_selections]>tbody>tr:nth-of-type({{productIndex}}) div[data-index=sku]"/> <element name="bundleOptionXProductYQuantity" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_qty]']" parameterized="true"/> + <element name="bundleOptionXProductYUserDefined" type="checkbox" parameterized="true" selector="[name='bundle_options[bundle_options][{{optionIndex}}][bundle_selections][{{productIndex}}][selection_can_change_qty]']"/> <element name="bundleOptionXProductYPrice" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_price_value]']" parameterized="true"/> <element name="addProductsToOption" type="button" selector="[data-index='modal_set']" timeout="30"/> <element name="nthAddProductsToOption" type="button" selector="//tr[{{var}}]//button[@data-index='modal_set']" timeout="30" parameterized="true"/> @@ -73,6 +79,7 @@ <element name="firstProductOption" type="checkbox" selector="//div[@class='admin__data-grid-outer-wrap']//tr[@data-repeat-index='0']//input[@type='checkbox']"/> <element name="dynamicSkuToggle" type="checkbox" selector="div[data-index='sku_type'] .admin__actions-switch-label" timeout="30"/> <element name="dynamicPriceToggle" type="checkbox" selector="//div[@data-index='price_type']//div[@data-role='switcher']"/> + <element name="dynamicPriceInput" type="input" selector="[name='product[price_type]']"/> <element name="taxClassDropDown" type="select" selector="//select[@name='product[tax_class_id]']" timeout="30"/> <element name="taxableGoodsOption" type="text" selector="//select[@name='product[tax_class_id]']//option[@data-title='Taxable Goods']"/> <element name="stockStatusField" type="select" selector="//select[@name='product[quantity_and_stock_status][is_in_stock]']"/> @@ -90,8 +97,10 @@ <element name="selectCountryOfManufacture" type="text" selector="//select[@name='product[country_of_manufacture]']//option[@data-title='{{country}}']" parameterized="true"/> <element name="dynamicSkuToggleOn" type="checkbox" selector="//div[@data-index='sku_type']//div[@data-role='switcher']//input[@value='0']"/> <element name="dynamicSkuToggleOff" type="checkbox" selector="//div[@data-index='sku_type']//div[@data-role='switcher']//input[@value='1']"/> + <element name="dynamicSkuInput" type="input" selector="[name='product[sku_type]']"/> <element name="dynamicWeightToggleOn" type="checkbox" selector="//div[@data-index='weight_type']//div[@data-role='switcher']//input[@value='0']"/> <element name="dynamicWeightToggleOff" type="checkbox" selector="//div[@data-index='weight_type']//div[@data-role='switcher']//input[@value='1']"/> + <element name="dynamicWeightInput" type="input" selector="[name='product[weight_type]']"/> <element name="categoryFieldName" type="text" selector="//fieldset[@data-index='container_category_ids']//label//span" timeout="30"/> <element name="categoryDone" type="button" selector=".admin__action-multiselect-actions-wrap [type='button'] span" timeout="30"/> <element name="dynamicPriceToggleOff" type="checkbox" selector="//div[@data-index='price_type']//div[@data-role='switcher']//input[@value='1']"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontBundledSection.xml b/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontBundledSection.xml index 1dea8958c355..863375632eba 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontBundledSection.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontBundledSection.xml @@ -11,6 +11,7 @@ <section name="StorefrontBundledSection"> <element name="productCheckbox" type="select" selector="//*[@id='customizeTitle']/following-sibling::div[{{arg1}}]//div[{{arg2}}][@class='field choice']/input" parameterized="true"/> <element name="bundleProductsPrice" type="text" selector="//*[@class='bundle-info']//*[contains(@id,'product-price')]/span"/> + <element name="bundleSummary" type="text" selector="#bundle-summary"/> <element name="nthBundledOption" type="input" selector=".option:nth-of-type({{numOption}}) .choice:nth-of-type({{numOptionSelect}}) input" parameterized="true"/> <element name="addToCart" type="button" selector="#bundle-slide" timeout="30"/> <element name="addToCartConfigured" type="button" selector="#product-addtocart-button" timeout="30"/> @@ -21,6 +22,14 @@ <element name="customizableBundleItemOption" type="text" selector="//div[@class='field choice'][1]//input[@type='checkbox']"/> <element name="customizableBundleItemOption2" type="text" selector="//div[@class='field choice'][2]//input[@type='checkbox']"/> <element name="nthOptionDiv" type="block" selector="#product-options-wrapper div.field.option:nth-of-type({{var}})" parameterized="true"/> + <element name="allBundleOptions" type="block" selector="#product-options-wrapper div.field.option"/> + <element name="allBundleOptionProducts" type="block" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}) .choice"/> + <element name="bundleOptionRequired" type="block" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}).required"/> + <element name="bundleOptionInput" type="input" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}) .choice:nth-of-type({{productIndex}}) input"/> + <element name="bundleOptionProductName" type="text" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}) .choice:nth-of-type({{productIndex}}) .product-name"/> + <element name="bundleOptionProductPrice" type="text" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}) .choice:nth-of-type({{productIndex}}) .price-notice"/> + <element name="bundleOptionQuantity" type="input" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}) .qty input"/> + <element name="bundleOptionQuantityDisabled" type="input" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}) .qty input[disabled]"/> <element name="nthItemOptionsTitle" type="text" selector="dl.item-options dt:nth-of-type({{var}})" parameterized="true"/> <element name="nthItemOptionsValue" type="text" selector="dl.item-options dd:nth-of-type({{var}})" parameterized="true"/> <element name="bundleProductName" type="text" selector="//*[@id='maincontent']//span[@itemprop='name']"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontCustomerOrderSection.xml b/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontCustomerOrderSection.xml new file mode 100644 index 000000000000..92534f2cb368 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontCustomerOrderSection.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontCustomerOrderSection"> + <element name="orderItemOptionLabel" type="text" selector=".table-order-items tr:nth-of-type({{row}}) td.label" parameterized="true"/> + <element name="orderItemOptionValue" type="text" selector=".table-order-items tr:nth-of-type({{row}}) td.value" parameterized="true"/> + </section> +</sections> diff --git a/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml b/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml new file mode 100644 index 000000000000..634a7db53694 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontCustomerOrderViewSection"> + <element name="allProductOptionLabels" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{productIndex}}) .options-label"/> + <element name="productOptionLabel" type="text" parameterized="true" selector="//table[@id='my-orders-table']//tbody[{{productIndex}}]//tr[@class='options-label'][{{optionIndex}}]"/> + <element name="allProductOptionProducts" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{productIndex}}) .item-options-container"/> + <element name="productOptionProductName" type="text" parameterized="true" selector="//table[@id='my-orders-table']//tbody[{{productIndex}}]//tr[contains(@class,'item-options-container')][{{optionIndex}}]//td[@data-th='Product Name']"/> + <element name="productOptionProductSku" type="text" parameterized="true" selector="//table[@id='my-orders-table']//tbody[{{productIndex}}]//tr[contains(@class,'item-options-container')][{{optionIndex}}]//td[@data-th='SKU']"/> + <element name="productOptionProductQuantity" type="text" parameterized="true" selector="//table[@id='my-orders-table']//tbody[{{productIndex}}]//tr[contains(@class,'item-options-container')][{{optionIndex}}]//td[@data-th='Quantity']"/> + </section> +</sections> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml index 0fa4a8ed9373..538cf391ea35 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml @@ -70,7 +70,7 @@ <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductPriceValidationErrorDisappearedAfterSwitchToDynamicPriceTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductPriceValidationErrorDisappearedAfterSwitchToDynamicPriceTest.xml new file mode 100644 index 000000000000..4ff1121f48e6 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductPriceValidationErrorDisappearedAfterSwitchToDynamicPriceTest.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<!-- Test XML Example --> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminBundleProductPriceValidationErrorDisappearedAfterSwitchToDynamicPriceTest"> + <annotations> + <features value="Bundle"/> + <stories value="Create/Edit bundle product in Admin"/> + <title value="Assert error message for price field"/> + <description value="Verify error message for price field is not visible when toggle Dynamic Price is disabled"/> + <severity value="MAJOR"/> + <testCaseId value="MC-40309"/> + <useCaseId value="MC-30152"/> + <group value="bundle"/> + </annotations> + + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="openNewBundleProductPage"> + <argument name="productType" value="bundle"/> + </actionGroup> + <actionGroup ref="AdminToggleSwitchDynamicPriceOnProductEditPageActionGroup" stepKey="disableDynamicPrice"/> + <actionGroup ref="AdminFillProductPriceFieldAndPressEnterOnProductEditPageActionGroup" stepKey="fillProductPriceField"> + <argument name="price" value="test"/> + </actionGroup> + <actionGroup ref="AssertAdminValidationErrorAppearedForPriceFieldOnProductEditPageActionGroup" stepKey="assertVisibleError"> + <argument name="errorMessage" value="Please enter a number 0 or greater in this field."/> + </actionGroup> + <actionGroup ref="AdminToggleSwitchDynamicPriceOnProductEditPageActionGroup" stepKey="enableDynamicPrice"/> + <actionGroup ref="AssertAdminNoValidationErrorForPriceFieldOnProductEditPageActionGroup" stepKey="assertNotVisibleError"/> + </test> +</tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductSetEditContentTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductSetEditContentTest.xml index 788dc4a848fd..68134c843dae 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductSetEditContentTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductSetEditContentTest.xml @@ -35,6 +35,6 @@ </actionGroup> <!--Checking content storefront--> - <amOnPage url="{{BundleProduct.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{BundleProduct.urlKey}}.html" stepKey="goToStorefront"/> </test> </tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml index 26d7dddbcc37..6491bc52ea82 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml @@ -79,7 +79,7 @@ <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> - <argument name="productUrl" value="{{BundleProduct.name}}"/> + <argument name="productUrl" value="{{BundleProduct.urlKey}}"/> </actionGroup> <!-- Assert product Design settings "layout 3 columns" --> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml index 7973860e4d5c..1f2b8435b45f 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml @@ -37,7 +37,7 @@ </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!-- Verify product on Product Page --> - <amOnPage url="{{StorefrontProductPage.url($$createDynamicBundleProduct.name$$)}}" stepKey="amOnBundleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createDynamicBundleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnBundleProductPage"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> @@ -47,7 +47,7 @@ <dontSee userInput="$$createDynamicBundleProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/> <see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/> <!-- Go to the category page that we created in the before block --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <!-- Should not see the product --> <dontSee userInput="$$createDynamicBundleProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/> <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml index edde81f33843..b0c1ff7480df 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml @@ -34,7 +34,7 @@ </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!-- Verify product on Product Page --> - <amOnPage url="{{StorefrontProductPage.url($$createFixedBundleProduct.name$$)}}" stepKey="amOnBundleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createFixedBundleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnBundleProductPage"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> @@ -44,7 +44,7 @@ <dontSee userInput="$$createFixedBundleProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/> <see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/> <!-- Go to the category page that we created in the before block --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <!-- Should not see the product --> <dontSee userInput="$$createFixedBundleProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/> <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml index ac0c3e7b5b79..b132a7829866 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml @@ -68,13 +68,13 @@ <!--See related product in admin--> <scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" stepKey="scrollTo"/> <conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedSee"/> - <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct1.sku$$" stepKey="seeRelatedProduct"/> + <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct1.name$$" stepKey="seeRelatedProduct"/> <magentoCLI command="cron:run --group=index" stepKey="runCronIndexer"/> <!--See related product in storefront--> - <amOnPage url="{{BundleProduct.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{BundleProduct.urlKey}}.html" stepKey="goToStorefront"/> <waitForPageLoad stepKey="waitForStorefront"/> - <see userInput="$$simpleProduct1.sku$$" stepKey="seeRelatedProductInStorefront"/> + <see userInput="$$simpleProduct1.name$$" stepKey="seeRelatedProductInStorefront"/> </test> </tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByDescriptionTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByDescriptionTest.xml index 95b4e06678af..1d851fdc888d 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByDescriptionTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByDescriptionTest.xml @@ -15,8 +15,8 @@ <title value="Guest customer should be able to advance search Bundle product with product description"/> <description value="Guest customer should be able to advance search Bundle product with product description"/> <severity value="MAJOR"/> - <testCaseId value="MC-242"/> - <group value="Bundle"/> + <testCaseId value="MC-25427"/> + <group value="bundle"/> <group value="SearchEngineElasticsearch"/> </annotations> <before> @@ -43,9 +43,9 @@ <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> </after> - <see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> - <see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> - <see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/> - <see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> + <see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/> </test> </tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByPriceTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByPriceTest.xml index f45c9ceba635..a37ee49ee195 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByPriceTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByPriceTest.xml @@ -15,8 +15,8 @@ <title value="Guest customer should be able to advance search Bundle product with product price"/> <description value="Guest customer should be able to advance search Bundle product with product price"/> <severity value="MAJOR"/> - <testCaseId value="MC-251"/> - <group value="Bundle"/> + <testCaseId value="MC-25435"/> + <group value="bundle"/> <group value="SearchEngineElasticsearch"/> </annotations> <before> @@ -52,9 +52,9 @@ <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> </after> - <see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> - <see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> - <see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/> - <see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> + <see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/> </test> </tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByShortDescriptionTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByShortDescriptionTest.xml index 05e14174d14a..f534b52aa2c3 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByShortDescriptionTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByShortDescriptionTest.xml @@ -15,8 +15,8 @@ <title value="Guest customer should be able to advance search Bundle product with product short description"/> <description value="Guest customer should be able to advance search Bundle product with product short description"/> <severity value="MAJOR"/> - <testCaseId value="MC-250"/> - <group value="Bundle"/> + <testCaseId value="MC-25434"/> + <group value="bundle"/> <group value="SearchEngineElasticsearch"/> </annotations> <before> @@ -43,9 +43,9 @@ <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> </after> - <see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> - <see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> - <see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/> - <see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> + <see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/> </test> </tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleProductTest.xml index e6af89181e55..465a171b9f96 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleProductTest.xml @@ -15,8 +15,8 @@ <title value="Guest customer should be able to advance search Bundle product with product name"/> <description value="Guest customer should be able to advance search Bundle product with product name"/> <severity value="MAJOR"/> - <testCaseId value="MC-139"/> - <group value="Bundle"/> + <testCaseId value="MC-25342"/> + <group value="bundle"/> <group value="SearchEngineElasticsearch"/> </annotations> <before> @@ -43,9 +43,9 @@ <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> </after> - <see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> - <see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> - <see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/> - <see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> + <see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/> </test> </tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml index 0474de1144f4..b472eb57b7a8 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml @@ -134,9 +134,7 @@ <!--Clear Cache - reindex - resets products according to enabled/disabled view--> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Confirm bundle products have been enabled--> <amOnPage url="{{BundleProduct.urlKey2}}.html" stepKey="GoToProductPageEnabled"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml index 68156d166bb8..12d4f00982cd 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml @@ -40,11 +40,15 @@ <actionGroup ref="AdminClickAddProductToggleAndSelectProductTypeActionGroup" stepKey="clickAddBundleProduct"> <argument name="productType" value="bundle"/> </actionGroup> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{_defaultProduct.sku}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.setProductAsNewFrom}}" userInput="01/1/2000" stepKey="fillProductNewFrom"/> - <fillField selector="{{AdminProductFormSection.setProductAsNewTo}}" userInput="01/1/2099" stepKey="fillProductNewTo"/> - + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillProductName"> + <argument name="product" value="_defaultProduct"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductSku"/> + <actionGroup ref="AdminSetProductAsNewDateActionGroup" stepKey="fillProductNewFrom"> + <argument name="fromDate" value="01/1/2000"/> + <argument name="toDate" value="01/1/2099"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductNewTo"/> <!-- and then configure bundled items for this product --> <scrollTo selector="{{AdminProductFormBundleSection.addOption}}" stepKey="scrollToAddOptionButton"/> @@ -69,9 +73,12 @@ <!-- If PageCache is enabled, Cache clearing happens here, via merge --> <!-- Check for product on the CMS page with the New Products widget --> - - <amOnPage url="{{_newDefaultCmsPage.identifier}}" stepKey="amOnCmsPage"/> - <waitForPageLoad stepKey="waitForCmsPage"/> - <see selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" userInput="{{_defaultProduct.name}}" stepKey="seeProductName"/> + <actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="amOnCmsPage"> + <argument name="identifier" value="{{_newDefaultCmsPage.identifier}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCmsPage"/> + <actionGroup ref="AssertStorefrontProductIsShownOnCmsPageActionGroup" stepKey="seeProductName"> + <argument name="cmsTitle" value="{{_newDefaultCmsPage.title}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdvanceCatalogSearchBundleBySkuWithHyphenTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdvanceCatalogSearchBundleBySkuWithHyphenTest.xml index 30c784b19a0b..d95099f4a34a 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdvanceCatalogSearchBundleBySkuWithHyphenTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdvanceCatalogSearchBundleBySkuWithHyphenTest.xml @@ -15,16 +15,13 @@ <title value="Guest customer should be able to advance search Bundle product with product sku that contains hyphen"/> <description value="Guest customer should be able to advance search Bundle product with product sku that contains hyphen"/> <severity value="MAJOR"/> - <testCaseId value="MC-20359"/> + <testCaseId value="MC-28812"/> <group value="Bundle"/> <group value="SearchEngineElasticsearch"/> - <skip> - <issueId value="MC-34217"/> - </skip> </annotations> <before> - <createData entity="ApiProductWithDescription" stepKey="simple1" before="simple2"/> - <createData entity="ApiProductWithDescription" stepKey="simple2" before="product"/> + <createData entity="ApiProductWithDescription" before="simple2" stepKey="simple1"/> + <createData entity="ApiProductWithDescription" before="product" stepKey="simple2"/> <createData entity="ApiBundleProduct" stepKey="product"/> <createData entity="DropDownBundleOption" stepKey="bundleOption"> <requiredEntity createDataKey="product"/> @@ -42,8 +39,8 @@ <magentoCron stepKey="runCronReindex" groups="index"/> </before> <after> - <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> - <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> + <deleteData createDataKey="simple1" before="deleteSimple2" stepKey="deleteSimple1"/> + <deleteData createDataKey="simple2" before="delete" stepKey="deleteSimple2"/> </after> </test> -</tests> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundlePlaceOrderWithMultipleOptionsSuccessTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundlePlaceOrderWithMultipleOptionsSuccessTest.xml index 0e2ae9bf5cc5..6742d276c8fe 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundlePlaceOrderWithMultipleOptionsSuccessTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundlePlaceOrderWithMultipleOptionsSuccessTest.xml @@ -58,7 +58,7 @@ <!--Open Product Page--> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> - <argument name="productUrl" value="{{BundleProduct.name}}"/> + <argument name="productUrl" value="{{BundleProduct.urlKey}}"/> </actionGroup> <!-- Add bundle to cart --> @@ -88,7 +88,7 @@ <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/> <!-- Assert item options display --> - <see selector="{{AdminInvoiceItemsSection.bundleItem}}" userInput="50 x $firstSimpleProduct.sku$" stepKey="seeFirstProductInList"/> - <see selector="{{AdminInvoiceItemsSection.bundleItem}}" userInput="50 x $secondSimpleProduct.sku$" stepKey="seeSecondProductInList"/> + <see selector="{{AdminInvoiceItemsSection.bundleItem}}" userInput="50 x $firstSimpleProduct.name$" stepKey="seeFirstProductInList"/> + <see selector="{{AdminInvoiceItemsSection.bundleItem}}" userInput="50 x $secondSimpleProduct.name$" stepKey="seeSecondProductInList"/> </test> </tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPricesTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPricesTest.xml index 4e408a863b5e..63f94401a3c1 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPricesTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPricesTest.xml @@ -62,16 +62,16 @@ <!--"Drop-down" type option--> <!-- Check Tier Prices for product 1 --> - <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct1CreateBundleProduct.sku$$ +$$$simpleProduct1CreateBundleProduct.price$$.00" stepKey="selectDropDownOptionProduct1"/> - <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct1CreateBundleProduct.sku$$ +$$$simpleProduct1CreateBundleProduct.price$$.00" stepKey="checkDropDownOptionProduct1"/> + <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct1CreateBundleProduct.name$$ +$$$simpleProduct1CreateBundleProduct.price$$.00" stepKey="selectDropDownOptionProduct1"/> + <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct1CreateBundleProduct.name$$ +$$$simpleProduct1CreateBundleProduct.price$$.00" stepKey="checkDropDownOptionProduct1"/> <grabTextFrom selector="{{StorefrontBundledSection.dropDownOptionTierPrices('Drop-down Option')}}" stepKey="DropDownTierPriceTextProduct1"/> <assertStringContainsString stepKey="assertDropDownTierPriceTextProduct1"> <expectedResult type="string">Buy 5 for $5.00 each and save 50%</expectedResult> <actualResult type="variable">DropDownTierPriceTextProduct1</actualResult> </assertStringContainsString> <!-- Check Tier Prices for product 2 --> - <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.sku$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="selectDropDownOptionProduct2"/> - <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.sku$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="checkDropDownOptionProduct2"/> + <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.name$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="selectDropDownOptionProduct2"/> + <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.name$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="checkDropDownOptionProduct2"/> <grabTextFrom selector="{{StorefrontBundledSection.dropDownOptionTierPrices('Drop-down Option')}}" stepKey="dropDownTierPriceTextProduct2"/> <assertStringContainsString stepKey="assertDropDownTierPriceTextProduct2"> <expectedResult type="string">Buy 7 for $15.00 each and save 25%</expectedResult> @@ -80,13 +80,13 @@ <!--"Radio Buttons" type option--> <!-- Check Tier Prices for product 1 --> - <grabTextFrom selector="{{StorefrontBundledSection.radioButtonOptionLabel('Radio Buttons Option', '$$simpleProduct1CreateBundleProduct.sku$$')}}" stepKey="radioButtonsOptionTierPriceTextProduct1"/> + <grabTextFrom selector="{{StorefrontBundledSection.radioButtonOptionLabel('Radio Buttons Option', '$$simpleProduct1CreateBundleProduct.name$$')}}" stepKey="radioButtonsOptionTierPriceTextProduct1"/> <assertStringContainsString stepKey="assertRadioButtonsOptionTierPriceTextProduct1"> <expectedResult type="string">Buy 5 for $5.00 each and save 50%</expectedResult> <actualResult type="variable">radioButtonsOptionTierPriceTextProduct1</actualResult> </assertStringContainsString> <!-- Check Tier Prices for product 2 --> - <grabTextFrom selector="{{StorefrontBundledSection.radioButtonOptionLabel('Radio Buttons Option', '$$simpleProduct2CreateBundleProduct.sku$$')}}" stepKey="radioButtonsOptionTierPriceTextProduct2"/> + <grabTextFrom selector="{{StorefrontBundledSection.radioButtonOptionLabel('Radio Buttons Option', '$$simpleProduct2CreateBundleProduct.name$$')}}" stepKey="radioButtonsOptionTierPriceTextProduct2"/> <assertStringContainsString stepKey="assertRadioButtonsOptionTierPriceTextProduct2"> <expectedResult type="string">Buy 7 for $15.00 each and save 25%</expectedResult> <actualResult type="variable">radioButtonsOptionTierPriceTextProduct2</actualResult> @@ -94,13 +94,13 @@ <!--"Checkbox" type option--> <!-- Check Tier Prices for product 1 --> - <grabTextFrom selector="{{StorefrontBundledSection.checkboxOptionLabel('Checkbox Option', '$$simpleProduct1CreateBundleProduct.sku$$')}}" stepKey="checkBoxOptionTierPriceTextProduct1"/> + <grabTextFrom selector="{{StorefrontBundledSection.checkboxOptionLabel('Checkbox Option', '$$simpleProduct1CreateBundleProduct.name$$')}}" stepKey="checkBoxOptionTierPriceTextProduct1"/> <assertStringContainsString stepKey="assertCheckBoxOptionTierPriceTextProduct1"> <expectedResult type="string">Buy 5 for $5.00 each and save 50%</expectedResult> <actualResult type="variable">checkBoxOptionTierPriceTextProduct1</actualResult> </assertStringContainsString> <!-- Check Tier Prices for product 2 --> - <grabTextFrom selector="{{StorefrontBundledSection.checkboxOptionLabel('Checkbox Option', '$$simpleProduct2CreateBundleProduct.sku$$')}}" stepKey="checkBoxOptionTierPriceTextProduct2"/> + <grabTextFrom selector="{{StorefrontBundledSection.checkboxOptionLabel('Checkbox Option', '$$simpleProduct2CreateBundleProduct.name$$')}}" stepKey="checkBoxOptionTierPriceTextProduct2"/> <assertStringContainsString stepKey="assertCheckBoxOptionTierPriceTextProduct2"> <expectedResult type="string">Buy 7 for $15.00 each and save 25%</expectedResult> <actualResult type="variable">checkBoxOptionTierPriceTextProduct2</actualResult> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductTwoWebsiteDifferentPriceOptionTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductTwoWebsiteDifferentPriceOptionTest.xml new file mode 100644 index 000000000000..5fdce3fb555c --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductTwoWebsiteDifferentPriceOptionTest.xml @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontCheckBundleProductTwoWebsiteDifferentPriceOptionTest"> + <annotations> + <title value="Verify bundle item price different websites."/> + <stories value="Github issue: #12584 Bundle Item price cannot differ per website"/> + <description value="Verify bundle item price different websites. Change bundle item price on second website."/> + <features value="Bundle"/> + <severity value="MAJOR"/> + <group value="bundle"/> + </annotations> + <before> + <magentoCLI command="config:set {{WebsiteCatalogPriceScopeConfigData.path}} {{WebsiteCatalogPriceScopeConfigData.value}}" stepKey="setPriceScopeWebsite"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="logInAsAdmin"/> + + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite"> + <argument name="newWebsiteName" value="{{customWebsite.name}}"/> + <argument name="websiteCode" value="{{customWebsite.code}}"/> + </actionGroup> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStoreGroup"> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="store" value="{{customStoreGroup.name}}"/> + <argument name="rootCategory" value="Default Category"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> + <argument name="StoreGroup" value="customStoreGroup"/> + <argument name="customStore" value="customStore"/> + </actionGroup> + + <createData entity="SimpleProduct2" stepKey="simpleProduct"/> + <createData entity="ApiFixedBundleProduct" stepKey="createBundleProduct" /> + <createData entity="CheckboxOption" stepKey="createBundleOption"> + <requiredEntity createDataKey="createBundleProduct"/> + </createData> + <createData entity="ApiBundleLinkFixed" stepKey="linkOptionToProduct"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption"/> + <requiredEntity createDataKey="simpleProduct"/> + </createData> + </before> + <after> + <magentoCLI command="config:set {{GlobalCatalogPriceScopeConfigData.path}} {{GlobalCatalogPriceScopeConfigData.value}}" stepKey="setPriceScopeGlobal"/> + + <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> + <deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/> + + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> + <argument name="websiteName" value="{{customWebsite.name}}"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanFullPageCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> + </after> + + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="openEditBundleProduct"> + <argument name="product" value="$$createBundleProduct$$"/> + </actionGroup> + + <actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="selectProductInWebsites"> + <argument name="website" value="{{customWebsite.name}}"/> + </actionGroup> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveButton"/> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="SwitchNewStoreView"> + <argument name="storeViewName" value="{{customStore.name}}"/> + </actionGroup> + + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYPrice('0', '0')}}" userInput="100" stepKey="fillBundleOption1Price"/> + + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveNewPrice"/> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrl" value="$$createBundleProduct.custom_attributes[url_key]$$"/> + </actionGroup> + + <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomizeAndAddToCart"/> + + <grabTextFrom selector="{{StorefrontBundledSection.bundleProductsPrice}}" stepKey="grabPriceText"/> + <assertEquals stepKey="assertPriceText"> + <expectedResult type="string">$31.23</expectedResult> + <actualResult type="variable">$grabPriceText</actualResult> + </assertEquals> + + </test> +</tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml index f7bce778cc0d..268f58c6cb61 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml @@ -41,7 +41,7 @@ </createData> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value="cataloginventory_stock catalog_product_price"/> + <argument name="indices" value=""/> </actionGroup> </before> <after> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml index 97d466964fbd..b9dd67a42b7f 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml @@ -101,13 +101,13 @@ <!--Select options - set quantities--> <!--"Drop-down" type option--> - <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct1.sku$$ +$$$simpleProduct1.price$$.00" stepKey="selectOption0Product0"/> - <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct1.sku$$ +$$$simpleProduct1.price$$.00" stepKey="checkOption0Product0"/> + <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct1.name$$ +$$$simpleProduct1.price$$.00" stepKey="selectOption0Product0"/> + <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct1.name$$ +$$$simpleProduct1.price$$.00" stepKey="checkOption0Product0"/> <fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity('Option One')}}" userInput="3" stepKey="fillQuantity00"/> <seeInField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity('Option One')}}" userInput="03" stepKey="checkQuantity00"/> - <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct2.sku$$ +$$$simpleProduct2.price$$.00" stepKey="selectOption0Product1"/> - <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct2.sku$$ +$$$simpleProduct2.price$$.00" stepKey="checkOption0Product1"/> + <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct2.name$$ +$$$simpleProduct2.price$$.00" stepKey="selectOption0Product1"/> + <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct2.name$$ +$$$simpleProduct2.price$$.00" stepKey="checkOption0Product1"/> <fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity('Option One')}}" userInput="3" stepKey="fillQuantity01"/> <seeInField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity('Option One')}}" userInput="03" stepKey="checkQuantity01"/> @@ -132,10 +132,10 @@ <!--"Multi Select" type option--> <!--This option does not support user defined quantities--> - <selectOption selector="{{StorefrontBundledSection.multiselectOptionFourProducts('Option Four')}}" userInput="$$simpleProduct1.sku$$ +$$$simpleProduct1.price$$.00" stepKey="selectOption3Product0"/> - <seeOptionIsSelected selector="{{StorefrontBundledSection.multiselectOptionFourProducts('Option Four')}}" userInput="$$simpleProduct1.sku$$ +$$$simpleProduct1.price$$.00" stepKey="checkOption3Product0"/> + <selectOption selector="{{StorefrontBundledSection.multiselectOptionFourProducts('Option Four')}}" userInput="$$simpleProduct1.name$$ +$$$simpleProduct1.price$$.00" stepKey="selectOption3Product0"/> + <seeOptionIsSelected selector="{{StorefrontBundledSection.multiselectOptionFourProducts('Option Four')}}" userInput="$$simpleProduct1.name$$ +$$$simpleProduct1.price$$.00" stepKey="checkOption3Product0"/> - <selectOption selector="{{StorefrontBundledSection.multiselectOptionFourProducts('Option Four')}}" userInput="$$simpleProduct2.sku$$ +$$$simpleProduct2.price$$.00" stepKey="selectOption3Product1"/> - <seeOptionIsSelected selector="{{StorefrontBundledSection.multiselectOptionFourProducts('Option Four')}}" userInput="$$simpleProduct2.sku$$ +$$$simpleProduct2.price$$.00" stepKey="checkOption3Product1"/> + <selectOption selector="{{StorefrontBundledSection.multiselectOptionFourProducts('Option Four')}}" userInput="$$simpleProduct2.name$$ +$$$simpleProduct2.price$$.00" stepKey="selectOption3Product1"/> + <seeOptionIsSelected selector="{{StorefrontBundledSection.multiselectOptionFourProducts('Option Four')}}" userInput="$$simpleProduct2.name$$ +$$$simpleProduct2.price$$.00" stepKey="checkOption3Product1"/> </test> </tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml index e204dd01e636..f30cdc21513d 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml @@ -106,8 +106,8 @@ <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="onPageShoppingCart2"/> <!-- Assert that the options are both there and the proce no longer matches --> - <see stepKey="assertBothOptions" selector="{{CheckoutCartProductSection.nthItemOption('2')}}" userInput="$$simpleProduct1.sku$$"/> - <see stepKey="assertBothOptions2" selector="{{CheckoutCartProductSection.nthItemOption('2')}}" userInput="$$simpleProduct2.sku$$"/> + <see stepKey="assertBothOptions" selector="{{CheckoutCartProductSection.nthItemOption('2')}}" userInput="$$simpleProduct1.name$$"/> + <see stepKey="assertBothOptions2" selector="{{CheckoutCartProductSection.nthItemOption('2')}}" userInput="$$simpleProduct2.name$$"/> <waitForElementVisible stepKey="waitForInfoDropdown2" selector="{{CheckoutCartSummarySection.total}}"/> <waitForPageLoad stepKey="waitForCartPageLoad4"/> <grabTextFrom selector="{{CheckoutCartSummarySection.total}}" stepKey="grabTotalAfter"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml index e08982a266ee..2b74e6fc9939 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml @@ -26,10 +26,14 @@ <magentoCron stepKey="runCronIndex" groups="index"/> </before> <after> - <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteBundleProduct"> + <argument name="sku" value="{{BundleProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> </after> <!--Go to bundle product creation page--> <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage" /> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontPlaceOrderBundleProductFixedPriceWithUpdatedPriceTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontPlaceOrderBundleProductFixedPriceWithUpdatedPriceTest.xml new file mode 100644 index 000000000000..2351a6b1b2d5 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontPlaceOrderBundleProductFixedPriceWithUpdatedPriceTest.xml @@ -0,0 +1,141 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontPlaceOrderBundleProductFixedPriceWithUpdatedPriceTest"> + <annotations> + <features value="Bundle"/> + <stories value="Placing order with bundle product"/> + <title value="Order details with bundle product fixed price should show the correct price for bundle items"/> + <description value="Order details with bundle product fixed price should show the correct price for bundle items"/> + <severity value="MAJOR"/> + <useCaseId value="MC-40603"/> + <testCaseId value="MC-40744"/> + <group value="bundle"/> + <group value="catalog"/> + </annotations> + + <before> + <createData entity="CustomerEntityOne" stepKey="createCustomer"/> + <createData entity="SimpleProduct2" stepKey="createFirstProduct"/> + <createData entity="SimpleProduct2" stepKey="createSecondProduct"/> + <createData entity="ApiFixedBundleProduct" stepKey="createFixedBundleProduct"> + <field key="price">11.00</field> + </createData> + <createData entity="RadioButtonsOption" stepKey="createFirstBundleOption"> + <field key="position">1</field> + <requiredEntity createDataKey="createFixedBundleProduct"/> + </createData> + <createData entity="RadioButtonsOption" stepKey="createSecondBundleOption"> + <field key="position">2</field> + <requiredEntity createDataKey="createFixedBundleProduct"/> + </createData> + <createData entity="ApiBundleLink" stepKey="firstLinkOptionToFixedProduct"> + <requiredEntity createDataKey="createFixedBundleProduct"/> + <requiredEntity createDataKey="createFirstBundleOption"/> + <requiredEntity createDataKey="createFirstProduct"/> + <field key="price_type">0</field> + <field key="price">7.00</field> + </createData> + <createData entity="ApiBundleLink" stepKey="secondLinkOptionToFixedProduct"> + <requiredEntity createDataKey="createFixedBundleProduct"/> + <requiredEntity createDataKey="createSecondBundleOption"/> + <requiredEntity createDataKey="createSecondProduct"/> + <field key="price_type">0</field> + <field key="price">5.00</field> + </createData> + <actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> + <argument name="productId" value="$createFixedBundleProduct.id$"/> + </actionGroup> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> + </before> + <after> + <deleteData createDataKey="createFirstProduct" stepKey="deleteSimpleProductForBundleItem"/> + <deleteData createDataKey="createSecondProduct" stepKey="deleteVirtualProductForBundleItem"/> + <deleteData createDataKey="createFixedBundleProduct" stepKey="deleteBundleProduct"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductsGridFilters"/> + <waitForPageLoad stepKey="waitForClearProductsGridFilters"/> + </after> + <!--Login customer on storefront--> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomer"> + <argument name="Customer" value="$$createCustomer$$" /> + </actionGroup> + <!--Open Product Page--> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openBundleProductPage"> + <argument name="product" value="$createFixedBundleProduct$"/> + </actionGroup> + <!--Add bundle to cart--> + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickAddToCart"/> + <actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart"> + <argument name="quantity" value="1"/> + </actionGroup> + <!--Open bundle product in admin--> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> + <argument name="productId" value="$createFixedBundleProduct.id$"/> + </actionGroup> + <!--Change price of the first option--> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYPrice('0', '0')}}" userInput="9" stepKey="fillBundleOption1Price"/> + <!--Save the bundle product--> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> + <!--Open Product Page--> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openBundleProductPage2"> + <argument name="product" value="$createFixedBundleProduct$"/> + </actionGroup> + <!--Add bundle to cart--> + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickAddToCart2"/> + <actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart2"> + <argument name="quantity" value="1"/> + </actionGroup> + <!--Verify bundle product details--> + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCart"/> + <see selector="{{StorefrontBundledSection.nthItemOptionsTitle('1')}}" userInput="$$createFirstBundleOption.title$$" stepKey="seeOptionLabelInShoppingCart"/> + <see selector="{{StorefrontBundledSection.nthItemOptionsValue('1')}}" userInput="1 x $$createFirstProduct.name$$ $9.00" stepKey="seeOptionValueInShoppingCart"/> + <see selector="{{StorefrontBundledSection.nthItemOptionsTitle('2')}}" userInput="$$createSecondBundleOption.title$$" stepKey="seeOption2LabelInShoppingCart"/> + <see selector="{{StorefrontBundledSection.nthItemOptionsValue('2')}}" userInput="1 x $$createSecondProduct.name$$ $5.00" stepKey="seeOption2ValueInShoppingCart"/> + <!--Verify total--> + <grabTextFrom selector="{{CheckoutCartSummarySection.total}}" stepKey="grabShoppingCartTotal"/> + <assertEquals stepKey="verifyGrandTotalOnShoppingCartPage"> + <actualResult type="variable">grabShoppingCartTotal</actualResult> + <expectedResult type="string">$60.00</expectedResult> + </assertEquals> + + <!--Navigate to checkout--> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="openCheckoutPage"/> + <!--Click next button to open payment section--> + <actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/> + <!--Click place order--> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> + <!--Navigate to order details page in custom account--> + <amOnPage url="{{StorefrontCustomerOrderViewPage.url({$grabOrderNumber})}}" stepKey="amOnOrderPage"/> + <!--Verify bundle order items details--> + <see selector="{{StorefrontCustomerOrderSection.orderItemOptionLabel('2')}}" userInput="$$createFirstBundleOption.title$$" stepKey="seeOptionLabelInCustomerOrderItems"/> + <see selector="{{StorefrontCustomerOrderSection.orderItemOptionValue('3')}}" userInput="1 x $$createFirstProduct.name$$ $9.00" stepKey="seeOptionValueInCustomerOrderItems"/> + <see selector="{{StorefrontCustomerOrderSection.orderItemOptionLabel('4')}}" userInput="$$createSecondBundleOption.title$$" stepKey="seeOption2LabelInCustomerOrderItems"/> + <see selector="{{StorefrontCustomerOrderSection.orderItemOptionValue('5')}}" userInput="1 x $$createSecondProduct.name$$ $5.00" stepKey="seeOption2ValueInCustomerOrderItems"/> + <!--Navigate to order details page on admin--> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrdersGridById"> + <argument name="orderId" value="{$grabOrderNumber}"/> + </actionGroup> + <!--Verify bundle order items details--> + <see selector="{{AdminOrderItemsOrderedSection.orderItemOptionLabel('2')}}" userInput="$$createFirstBundleOption.title$$" stepKey="seeOptionLabelInAdminOrderItems"/> + <see selector="{{AdminOrderItemsOrderedSection.orderItemOptionValue('3')}}" userInput="1 x $$createFirstProduct.name$$" stepKey="seeOptionValueInAdminOrderItems"/> + <see selector="{{AdminOrderItemsOrderedSection.orderItemOptionPrice('3')}}" userInput="$9.00" stepKey="seeOptionPriceInAdminOrderItems"/> + <see selector="{{AdminOrderItemsOrderedSection.orderItemOptionLabel('4')}}" userInput="$$createSecondBundleOption.title$$" stepKey="seeOption2LabelInAdminOrderItems"/> + <see selector="{{AdminOrderItemsOrderedSection.orderItemOptionValue('5')}}" userInput="1 x $$createSecondProduct.name$$" stepKey="seeOption2ValueInAdminOrderItems"/> + <see selector="{{AdminOrderItemsOrderedSection.orderItemOptionPrice('5')}}" userInput="$5.00" stepKey="seeOption2PriceInAdminOrderItems"/> + <!--Verify total--> + <grabTextFrom selector="{{AdminOrderTotalSection.grandTotal}}" stepKey="grabAdminOrderTotal"/> + <assertEquals stepKey="verifyGrandTotalOnAdminOrderPage"> + <actualResult type="variable">grabAdminOrderTotal</actualResult> + <expectedResult type="string">$60.00</expectedResult> + </assertEquals> + </test> +</tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml index 927cebdf7e50..73e1e41140d8 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml @@ -210,7 +210,7 @@ </after> <!-- Go to storefront category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$createSubCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createSubCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <see userInput="From $7.33" selector="{{StorefrontCategoryProductSection.priceFromByProductId($$createBundleProduct.id$$)}}" stepKey="seePriceFromInCategoryBundle1"/> diff --git a/app/code/Magento/Bundle/Test/Unit/Block/Catalog/Product/View/Type/BundleTest.php b/app/code/Magento/Bundle/Test/Unit/Block/Catalog/Product/View/Type/BundleTest.php index 9f3d4a908f06..89d8526658f0 100644 --- a/app/code/Magento/Bundle/Test/Unit/Block/Catalog/Product/View/Type/BundleTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Block/Catalog/Product/View/Type/BundleTest.php @@ -21,6 +21,7 @@ use Magento\Catalog\Pricing\Price\RegularPrice; use Magento\CatalogRule\Model\ResourceModel\Product\CollectionProcessor; use Magento\Framework\DataObject; +use Magento\Framework\Escaper; use Magento\Framework\Event\ManagerInterface; use Magento\Framework\Json\Encoder; use Magento\Framework\Pricing\Amount\AmountInterface; @@ -66,6 +67,11 @@ class BundleTest extends TestCase */ private $bundleBlock; + /** + * @var Escaper|MockObject + */ + private $escaperMock; + protected function setUp(): void { $objectHelper = new ObjectManager($this); @@ -103,6 +109,9 @@ protected function setUp(): void $this->catalogProduct = $this->getMockBuilder(Product::class) ->disableOriginalConstructor() ->getMock(); + $this->escaperMock = $this->getMockBuilder(Escaper::class) + ->disableOriginalConstructor() + ->getMock(); /** @var BundleBlock $bundleBlock */ $this->bundleBlock = $objectHelper->getObject( \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle::class, @@ -111,7 +120,8 @@ protected function setUp(): void 'eventManager' => $this->eventManager, 'jsonEncoder' => $this->jsonEncoder, 'productPrice' => $this->bundleProductPriceFactory, - 'catalogProduct' => $this->catalogProduct + 'catalogProduct' => $this->catalogProduct, + 'escaper' => $this->escaperMock, ] ); @@ -133,16 +143,16 @@ public function testGetOptionHtmlNoRenderer() ->disableOriginalConstructor() ->getMock(); $option->expects($this->any())->method('getType')->willReturn('checkbox'); - + $this->escaperMock->expects($this->once())->method('escapeHtml')->willReturn('checkbox'); + $expected='There is no defined renderer for "checkbox" option type.'; $layout = $this->getMockBuilder(Layout::class) ->setMethods(['getChildName', 'getBlock']) ->disableOriginalConstructor() ->getMock(); $layout->expects($this->any())->method('getChildName')->willReturn(false); $this->bundleBlock->setLayout($layout); - $this->assertEquals( - 'There is no defined renderer for "checkbox" option type.', + $expected, $this->bundleBlock->getOptionHtml($option) ); } diff --git a/app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php b/app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php index 06d0aed85e49..091dec8e1dc8 100644 --- a/app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php @@ -31,6 +31,7 @@ use Magento\Framework\Exception\InputException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Store\Api\Data\WebsiteInterface; use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; use PHPUnit\Framework\MockObject\MockObject; @@ -139,6 +140,11 @@ class LinkManagementTest extends TestCase */ private $linkField = 'product_id'; + /** + * @var WebsiteInterface|MockObject + */ + private $websiteMock; + /** * @inheritDoc */ @@ -203,6 +209,9 @@ protected function setUp(): void $this->dataObjectHelperMock = $this->getMockBuilder(DataObjectHelper::class) ->disableOriginalConstructor() ->getMock(); + + $this->websiteMock = $this->getMockForAbstractClass( WebsiteInterface::class); + $this->model = $helper->getObject( LinkManagement::class, [ @@ -540,7 +549,7 @@ public function testAddChildCouldNotSave() $productLink->method('getOptionId')->willReturn(1); $productLink->method('getSelectionId')->willReturn(1); - $this->metadataMock->expects($this->once())->method('getLinkField')->willReturn($this->linkField); + $this->metadataMock->expects($this->exactly(2))->method('getLinkField')->willReturn($this->linkField); $productMock = $this->createMock(Product::class); $productMock->expects($this->once()) ->method('getTypeId') @@ -617,7 +626,7 @@ public function testAddChild() $productLink->method('getOptionId')->willReturn(1); $productLink->method('getSelectionId')->willReturn(1); - $this->metadataMock->expects($this->once())->method('getLinkField')->willReturn($this->linkField); + $this->metadataMock->expects($this->exactly(2))->method('getLinkField')->willReturn($this->linkField); $productMock = $this->createMock(Product::class); $productMock->expects($this->once())->method('getTypeId')->willReturn(Type::TYPE_BUNDLE); $productMock @@ -740,7 +749,7 @@ public function testSaveChild() 'setSelectionPriceType', 'setSelectionPriceValue', 'setSelectionCanChangeQty', - 'setIsDefault' + 'setIsDefault', ] ) ->onlyMethods(['save', 'getId', 'load']) @@ -778,14 +787,19 @@ public function testSaveChildFailedToSave() $productLink->method('getSku')->willReturn('linked_product_sku'); $productLink->method('getId')->willReturn($id); $productLink->method('getSelectionId')->willReturn(1); - $bundleProductSku = 'bundleProductSku'; + $bundleProductSku = 'bundleProductSku'; + $this->metadataMock->expects($this->once())->method('getLinkField')->willReturn($this->linkField); $productMock = $this->createMock(Product::class); $productMock->expects($this->once()) ->method('getTypeId') ->willReturn(Type::TYPE_BUNDLE); $productMock->method('getId') ->willReturn($parentProductId); + $productMock + ->method('getData') + ->with($this->linkField) + ->willReturn($parentProductId); $linkedProductMock = $this->createMock(Product::class); $linkedProductMock->method('getId')->willReturn($linkProductId); diff --git a/app/code/Magento/Bundle/Test/Unit/Model/Product/LinksListTest.php b/app/code/Magento/Bundle/Test/Unit/Model/Product/LinksListTest.php index 27531682b1de..39b58b75ea46 100644 --- a/app/code/Magento/Bundle/Test/Unit/Model/Product/LinksListTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Model/Product/LinksListTest.php @@ -95,7 +95,7 @@ public function testLinksList() $this->selectionMock->expects($this->once()) ->method('getSelectionPriceType') ->willReturn('selection_price_type'); - $this->selectionMock->expects($this->once())->method('getSelectionPriceValue')->willReturn(12); + $this->selectionMock->expects($this->exactly(2))->method('getSelectionPriceValue')->willReturn(12); $this->selectionMock->expects($this->once())->method('getData')->willReturn(['some data']); $this->selectionMock->expects($this->once())->method('getSelectionId')->willReturn($selectionId); $this->selectionMock->expects($this->once())->method('getIsDefault')->willReturn(true); diff --git a/app/code/Magento/Bundle/Test/Unit/Model/Product/TypeTest.php b/app/code/Magento/Bundle/Test/Unit/Model/Product/TypeTest.php index 9c4d4ce00b7c..2faaa02badab 100644 --- a/app/code/Magento/Bundle/Test/Unit/Model/Product/TypeTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Model/Product/TypeTest.php @@ -232,7 +232,16 @@ public function testPrepareForCartAdvancedWithoutOptions() /** @var MockObject|DataObject $buyRequest */ $buyRequest = $this->getMockBuilder(DataObject::class) ->setMethods( - ['__wakeup', 'getOptions', 'getSuperProductConfig', 'unsetData', 'getData', 'getQty', 'getBundleOption'] + [ + '__wakeup', + 'getOptions', + 'getSuperProductConfig', + 'unsetData', + 'getData', + 'getQty', + 'getBundleOption', + 'getBundleOptionsData', + ] ) ->disableOriginalConstructor() ->getMock(); @@ -342,7 +351,8 @@ public function testPrepareForCartAdvancedWithShoppingCart() 'getData', 'getQty', 'getBundleOption', - 'getBundleOptionQty' + 'getBundleOptionQty', + 'getBundleOptionsData', ] ) ->disableOriginalConstructor() @@ -586,7 +596,8 @@ public function testPrepareForCartAdvancedEmptyShoppingCart() 'getData', 'getQty', 'getBundleOption', - 'getBundleOptionQty' + 'getBundleOptionQty', + 'getBundleOptionsData', ] ) ->disableOriginalConstructor() @@ -811,7 +822,8 @@ public function testPrepareForCartAdvancedStringInResult() 'getData', 'getQty', 'getBundleOption', - 'getBundleOptionQty' + 'getBundleOptionQty', + 'getBundleOptionsData', ] ) ->disableOriginalConstructor() @@ -1030,7 +1042,8 @@ public function testPrepareForCartAdvancedWithoutSelections() 'getData', 'getQty', 'getBundleOption', - 'getBundleOptionQty' + 'getBundleOptionQty', + 'getBundleOptionsData', ] ) ->disableOriginalConstructor() @@ -1131,7 +1144,16 @@ public function testPrepareForCartAdvancedSelectionsSelectionIdsExists() /** @var MockObject|DataObject $buyRequest */ $buyRequest = $this->getMockBuilder(DataObject::class) ->setMethods( - ['__wakeup', 'getOptions', 'getSuperProductConfig', 'unsetData', 'getData', 'getQty', 'getBundleOption'] + [ + '__wakeup', + 'getOptions', + 'getSuperProductConfig', + 'unsetData', + 'getData', + 'getQty', + 'getBundleOption', + 'getBundleOptionsData', + ] ) ->disableOriginalConstructor() ->getMock(); @@ -1258,7 +1280,16 @@ public function testPrepareForCartAdvancedSelectRequiredOptions() /** @var MockObject|DataObject $buyRequest */ $buyRequest = $this->getMockBuilder(DataObject::class) ->setMethods( - ['__wakeup', 'getOptions', 'getSuperProductConfig', 'unsetData', 'getData', 'getQty', 'getBundleOption'] + [ + '__wakeup', + 'getOptions', + 'getSuperProductConfig', + 'unsetData', + 'getData', + 'getQty', + 'getBundleOption', + 'getBundleOptionsData', + ] ) ->disableOriginalConstructor() ->getMock(); @@ -1422,7 +1453,16 @@ public function testPrepareForCartAdvancedAllRequiredOption() /** @var MockObject|DataObject $buyRequest */ $buyRequest = $this->getMockBuilder(DataObject::class) ->setMethods( - ['__wakeup', 'getOptions', 'getSuperProductConfig', 'unsetData', 'getData', 'getQty', 'getBundleOption'] + [ + '__wakeup', + 'getOptions', + 'getSuperProductConfig', + 'unsetData', + 'getData', + 'getQty', + 'getBundleOption', + 'getBundleOptionsData', + ] ) ->disableOriginalConstructor() ->getMock(); @@ -1523,7 +1563,16 @@ public function testPrepareForCartAdvancedSpecifyProductOptions() /** @var MockObject|DataObject $buyRequest */ $buyRequest = $this->getMockBuilder(DataObject::class) ->setMethods( - ['__wakeup', 'getOptions', 'getSuperProductConfig', 'unsetData', 'getData', 'getQty', 'getBundleOption'] + [ + '__wakeup', + 'getOptions', + 'getSuperProductConfig', + 'unsetData', + 'getData', + 'getQty', + 'getBundleOption', + 'getBundleOptionsData', + ] ) ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Bundle/Test/Unit/Model/Quote/Item/Option/BundleSelectionAttributesComparatorTest.php b/app/code/Magento/Bundle/Test/Unit/Model/Quote/Item/Option/BundleSelectionAttributesComparatorTest.php new file mode 100644 index 000000000000..6502f8b6f57e --- /dev/null +++ b/app/code/Magento/Bundle/Test/Unit/Model/Quote/Item/Option/BundleSelectionAttributesComparatorTest.php @@ -0,0 +1,70 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Test\Unit\Model\Quote\Item\Option; + +use Magento\Bundle\Model\Quote\Item\Option\BundleSelectionAttributesComparator; +use Magento\Framework\DataObject; +use Magento\Framework\Serialize\Serializer\Json; +use PHPUnit\Framework\TestCase; + +/** + * Test bundle quote item option comparator + */ +class BundleSelectionAttributesComparatorTest extends TestCase +{ + /** + * @var BundleSelectionAttributesComparator + */ + private $model; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->model = new BundleSelectionAttributesComparator( + new Json() + ); + } + + /** + * @param array $option1 + * @param array $option2 + * @param bool $expected + * @dataProvider compareDataProvider + */ + public function testCompare(array $option1, array $option2, bool $expected): void + { + $this->assertEquals($expected, $this->model->compare(new DataObject($option1), new DataObject($option2))); + } + + /** + * @return array + */ + public function compareDataProvider(): array + { + return [ + [ + ['code' => 'test', 'value' => '{"option_id":1,"option_label":"Option 1"}'], + ['code' => 'test', 'value' => '{"option_id":1,"option_label":"Option One"}'], + true + ], + [ + ['code' => 'test', 'value' => '{"option_id":1,"option_label":"Option 1"}'], + ['code' => 'test', 'value' => '{"option_id":2,"option_label":"Option 1"}'], + false + ], + [ + ['code' => 'test', 'value' => '{"option_id":1,"option_label":"Option 1"}'], + ['code' => 'test', 'value' => '{"option_label":"Option 1"}'], + false + ], + ]; + } +} diff --git a/app/code/Magento/Bundle/Test/Unit/Model/Quote/Item/OptionTest.php b/app/code/Magento/Bundle/Test/Unit/Model/Quote/Item/OptionTest.php new file mode 100644 index 000000000000..1790d31e29c8 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Unit/Model/Quote/Item/OptionTest.php @@ -0,0 +1,210 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Test\Unit\Model\Quote\Item; + +use Magento\Bundle\Model\Option as BundleOption; +use Magento\Bundle\Model\Product\Price; +use Magento\Bundle\Model\Product\Type; +use Magento\Bundle\Model\Quote\Item\Option; +use Magento\Bundle\Model\ResourceModel\Option\Collection as OptionsCollection; +use Magento\Bundle\Model\ResourceModel\Selection\Collection as SelectionsCollection; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Configuration\Item\Option\OptionInterface; +use Magento\Framework\Serialize\Serializer\Json; +use PHPUnit\Framework\TestCase; + +/** + * Test bundle product options model + */ +class OptionTest extends TestCase +{ + /** + * @var Option + */ + private $model; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->model = new Option( + new Json() + ); + } + + /** + * @param array $customOptions + * @param array $expected + * @dataProvider getSelectionOptionsDataProvider + */ + public function testGetSelectionOptions(array $customOptions, array $expected): void + { + $bundleProduct = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->onlyMethods(['getTypeInstance', 'getPriceModel']) + ->getMock(); + + $typeInstance = $this->createMock(Type::class); + $typeInstance->method('getOptionsByIds') + ->willReturnCallback([$this, 'getOptionsCollectionMock']); + $typeInstance->method('getSelectionsByIds') + ->willReturnCallback([$this, 'getSelectionsCollectionMock']); + + $priceModel = $this->createMock(Price::class); + $priceModel->method('getSelectionFinalTotalPrice') + ->willReturnCallback( + function ($product, $selection) { + return $selection->getSelectionId() * 10 + $product->getId(); + } + ); + + $bundleProduct->method('getTypeInstance') + ->willReturn($typeInstance); + $bundleProduct->method('getPriceModel') + ->willReturn($priceModel); + + $bundleProduct->setCustomOptions($this->getCustomOptions($customOptions)); + $this->assertEquals($expected, $this->model->getSelectionOptions($bundleProduct)); + } + + /** + * @return array + */ + public function getSelectionOptionsDataProvider(): array + { + return [ + [ + [], + [] + ], + [ + [ + 'bundle_option_ids' => '[1,2]', + ], + [] + ], + [ + [ + 'bundle_selection_ids' => '[11,21]', + ], + [] + ], + [ + [ + 'bundle_option_ids' => '[1,2]', + 'bundle_selection_ids' => '[11,21]', + 'selection_qty_11' => '2', + 'selection_qty_21' => '3', + ], + [ + 11 => [ + [ + 'code' => 'bundle_selection_attributes', + 'value' => '{"price":110,"qty":2,"option_label":"Option 1","option_id":1}' + ] + ], + 21 => [ + [ + 'code' => 'bundle_selection_attributes', + 'value' => '{"price":210,"qty":3,"option_label":"Option 2","option_id":2}' + ] + ] + ] + ] + ]; + } + + /** + * @param array $configuration + * @return OptionInterface[] + */ + private function getCustomOptions(array $configuration): array + { + $customOptions = []; + foreach ($configuration as $code => $value) { + $customOptions[$code] = $this->createConfiguredMock( + OptionInterface::class, + [ + 'getValue' => $value + ] + ); + } + + return $customOptions; + } + + /** + * @param array $ids + * @return OptionsCollection + * @throws \ReflectionException + */ + public function getOptionsCollectionMock(array $ids): OptionsCollection + { + $optionsCollection = $this->getMockBuilder(OptionsCollection::class) + ->disableOriginalConstructor() + ->onlyMethods(['load']) + ->getMock(); + + $options = []; + foreach ($ids as $id) { + $option = $this->getMockBuilder(BundleOption::class) + ->disableOriginalConstructor() + ->onlyMethods(['getId', 'getTitle']) + ->getMock(); + + $option->method('getId') + ->willReturn($id); + + $option->method('getTitle') + ->willReturn('Option ' . $id); + + $options[$id] = $option; + } + $reflectionProperty = new \ReflectionProperty($optionsCollection, '_items'); + $reflectionProperty->setAccessible(true); + $reflectionProperty->setValue($optionsCollection, $options); + + return $optionsCollection; + } + + /** + * @param array $ids + * @return SelectionsCollection + * @throws \ReflectionException + */ + public function getSelectionsCollectionMock(array $ids): SelectionsCollection + { + $selectionsCollection = $this->getMockBuilder(SelectionsCollection::class) + ->disableOriginalConstructor() + ->onlyMethods(['load']) + ->getMock(); + + $selections = []; + foreach ($ids as $id) { + $selection = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->addMethods(['getSelectionId', 'getOptionId']) + ->getMock(); + + $selection->method('getSelectionId') + ->willReturn($id); + + $selection->method('getOptionId') + ->willReturn(intdiv($id, 10)); + + $selections[$id] = $selection; + } + $reflectionProperty = new \ReflectionProperty($selectionsCollection, '_items'); + $reflectionProperty->setAccessible(true); + $reflectionProperty->setValue($selectionsCollection, $selections); + + return $selectionsCollection; + } +} diff --git a/app/code/Magento/Bundle/Test/Unit/Model/ResourceModel/Indexer/PriceTest.php b/app/code/Magento/Bundle/Test/Unit/Model/ResourceModel/Indexer/PriceTest.php new file mode 100644 index 000000000000..4cdb3913f96e --- /dev/null +++ b/app/code/Magento/Bundle/Test/Unit/Model/ResourceModel/Indexer/PriceTest.php @@ -0,0 +1,162 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Test\Unit\Model\ResourceModel\Indexer; + +use Magento\Bundle\Model\ResourceModel\Indexer\Price; +use Magento\Catalog\Model\Indexer\Product\Price\TableMaintainer; +use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\BasePriceModifier; +use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\IndexTableStructureFactory; +use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\Query\JoinAttributeProcessor; +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Adapter\AdapterInterface; +use Magento\Framework\EntityManager\MetadataPool; +use Magento\Framework\Event\ManagerInterface; +use Magento\Framework\Module\Manager; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Class to test Bundle products Price indexer resource model + */ +class PriceTest extends TestCase +{ + /** + * @var string + */ + private $connectionName = 'test_connection'; + + /** + * @var ResourceConnection|MockObject + */ + private $resourceMock; + + /** + * @var AdapterInterface|MockObject + */ + private $connectionMock; + + /** + * @var Price + */ + private $priceModel; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->connectionMock = $this->createMock(AdapterInterface::class); + $this->resourceMock = $this->createMock(ResourceConnection::class); + $this->resourceMock->method('getConnection') + ->with($this->connectionName) + ->willReturn($this->connectionMock); + $this->resourceMock->method('getTableName')->willReturnArgument(0); + + /** @var IndexTableStructureFactory|MockObject $indexTableStructureFactory */ + $indexTableStructureFactory = $this->createMock(IndexTableStructureFactory::class); + /** @var TableMaintainer|MockObject $tableMaintainer */ + $tableMaintainer = $this->createMock(TableMaintainer::class); + /** @var MetadataPool|MockObject $metadataPool */ + $metadataPool = $this->createMock(MetadataPool::class); + /** @var BasePriceModifier|MockObject $basePriceModifier */ + $basePriceModifier = $this->createMock(BasePriceModifier::class); + /** @var JoinAttributeProcessor|MockObject $joinAttributeProcessor */ + $joinAttributeProcessor = $this->createMock(JoinAttributeProcessor::class); + /** @var ManagerInterface|MockObject $eventManager */ + $eventManager = $this->createMock(ManagerInterface::class); + /** @var Manager|MockObject $moduleManager */ + $moduleManager = $this->createMock(Manager::class); + $fullReindexAction = false; + + $this->priceModel = new Price( + $indexTableStructureFactory, + $tableMaintainer, + $metadataPool, + $this->resourceMock, + $basePriceModifier, + $joinAttributeProcessor, + $eventManager, + $moduleManager, + $fullReindexAction, + $this->connectionName + ); + } + + /** + * Tests create Bundle Price temporary table + */ + public function testGetBundlePriceTable(): void + { + $expectedTmpTableName = 'catalog_product_index_price_bundle_temp'; + $expectedTableName = 'catalog_product_index_price_bundle_tmp'; + + $this->connectionMock->expects($this->once()) + ->method('createTemporaryTableLike') + ->with($expectedTmpTableName, $expectedTableName, true); + + $this->assertEquals( + $expectedTmpTableName, + $this->invokeMethodViaReflection('getBundlePriceTable') + ); + } + + /** + * Tests create Bundle Selection Prices Index temporary table + */ + public function testGetBundleSelectionTable(): void + { + $expectedTmpTableName = 'catalog_product_index_price_bundle_sel_temp'; + $expectedTableName = 'catalog_product_index_price_bundle_sel_tmp'; + + $this->connectionMock->expects($this->once()) + ->method('createTemporaryTableLike') + ->with($expectedTmpTableName, $expectedTableName, true); + + $this->assertEquals( + $expectedTmpTableName, + $this->invokeMethodViaReflection('getBundleSelectionTable') + ); + } + + /** + * Tests create Bundle Option Prices Index temporary table + */ + public function testGetBundleOptionTable(): void + { + $expectedTmpTableName = 'catalog_product_index_price_bundle_opt_temp'; + $expectedTableName = 'catalog_product_index_price_bundle_opt_tmp'; + + $this->connectionMock->expects($this->once()) + ->method('createTemporaryTableLike') + ->with($expectedTmpTableName, $expectedTableName, true); + + $this->assertEquals( + $expectedTmpTableName, + $this->invokeMethodViaReflection('getBundleOptionTable') + ); + } + + /** + * Invoke private method via reflection + * + * @param string $methodName + * @return string + */ + private function invokeMethodViaReflection(string $methodName): string + { + $method = new \ReflectionMethod( + Price::class, + $methodName + ); + $method->setAccessible(true); + + return (string)$method->invoke($this->priceModel); + } +} diff --git a/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePanelTest.php b/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePanelTest.php index 51563d319dfc..e12b6fb36aac 100644 --- a/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePanelTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePanelTest.php @@ -23,6 +23,11 @@ */ class BundlePanelTest extends TestCase { + /** + * @var ObjectManager + */ + private $objectManager; + /** * @var UrlInterface|MockObject */ diff --git a/app/code/Magento/Bundle/etc/di.xml b/app/code/Magento/Bundle/etc/di.xml index 1bb79b4b56d3..17b6d228e88e 100644 --- a/app/code/Magento/Bundle/etc/di.xml +++ b/app/code/Magento/Bundle/etc/di.xml @@ -241,4 +241,34 @@ </argument> </arguments> </type> + <type name="Magento\Quote\Model\Quote\Item\Option\Comparator"> + <arguments> + <argument name="customComparators" xsi:type="array"> + <item name="bundle_selection_attributes" xsi:type="object">Magento\Bundle\Model\Quote\Item\Option\BundleSelectionAttributesComparator</item> + </argument> + </arguments> + </type> + <type name="Magento\Quote\Model\QuoteManagement"> + <plugin name="update_bundle_quote_item_options" + type="Magento\Bundle\Plugin\Quote\UpdateBundleQuoteItemOptions" + sortOrder="10"/> + </type> + <type name="Magento\Bundle\Model\ProductRelationsProcessorComposite"> + <arguments> + <argument name="processors" xsi:type="array"> + <item name="quote_recollect" xsi:type="object">Magento\Bundle\Model\QuoteRecollectProcessor</item> + </argument> + </arguments> + </type> + <type name="Magento\Bundle\Model\QuoteRecollectProcessor"> + <arguments> + <argument name="comparisonFieldsTypeMapper" xsi:type="array"> + <item name="sku" xsi:type="string">string</item> + <item name="price" xsi:type="string">float</item> + <item name="price_type" xsi:type="string">string</item> + <item name="qty" xsi:type="string">float</item> + <item name="selection_can_change_quantity" xsi:type="string">string</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Bundle/etc/events.xml b/app/code/Magento/Bundle/etc/events.xml index 6c855db2d323..b2d43a808860 100644 --- a/app/code/Magento/Bundle/etc/events.xml +++ b/app/code/Magento/Bundle/etc/events.xml @@ -18,4 +18,7 @@ <event name="magento_bundle_model_selection_save_after"> <observer name="legacy_model_save" instance="Magento\Framework\EntityManager\Observer\AfterEntitySave" /> </event> + <event name="magento_bundle_model_selection_save_before"> + <observer name="legacy_model_save" instance="Magento\Framework\EntityManager\Observer\BeforeEntitySave" /> + </event> </config> diff --git a/app/code/Magento/Bundle/etc/frontend/di.xml b/app/code/Magento/Bundle/etc/frontend/di.xml index a6b2b055ffd9..54f5ff0a1f48 100644 --- a/app/code/Magento/Bundle/etc/frontend/di.xml +++ b/app/code/Magento/Bundle/etc/frontend/di.xml @@ -16,4 +16,10 @@ <type name="Magento\Catalog\Model\Product"> <plugin name="add_bundle_child_identities" type="Magento\Bundle\Model\Plugin\Frontend\ProductIdentitiesExtender" sortOrder="100"/> </type> + <type name="Magento\Catalog\Model\Product\Type\AbstractType"> + <plugin name="add_to_cart_single_option" type="Magento\Bundle\Plugin\Catalog\Model\Product\Type\AbstractType" /> + </type> + <type name="Magento\Catalog\ViewModel\Product\OptionsData"> + <plugin name="add_bundle_options_data" type="Magento\Bundle\Plugin\Catalog\ViewModel\Product\AddBundleOptionsData" /> + </type> </config> diff --git a/app/code/Magento/Bundle/etc/webapi_rest/di.xml b/app/code/Magento/Bundle/etc/webapi_rest/di.xml index 54f6d3b4b0f4..28a236d1fb35 100644 --- a/app/code/Magento/Bundle/etc/webapi_rest/di.xml +++ b/app/code/Magento/Bundle/etc/webapi_rest/di.xml @@ -13,4 +13,8 @@ </argument> </arguments> </type> + <type name="Magento\Bundle\Api\ProductLinkManagementInterface"> + <plugin name="reindex_after_add_child_by_sku" type="Magento\Bundle\Plugin\Api\ProductLinkManagement\ReindexAfterAddChildBySkuPlugin"/> + <plugin name="reindex_after_remove_child" type="Magento\Bundle\Plugin\Api\ProductLinkManagement\ReindexAfterRemoveChildPlugin"/> + </type> </config> diff --git a/app/code/Magento/Bundle/etc/webapi_soap/di.xml b/app/code/Magento/Bundle/etc/webapi_soap/di.xml index 54f6d3b4b0f4..28a236d1fb35 100644 --- a/app/code/Magento/Bundle/etc/webapi_soap/di.xml +++ b/app/code/Magento/Bundle/etc/webapi_soap/di.xml @@ -13,4 +13,8 @@ </argument> </arguments> </type> + <type name="Magento\Bundle\Api\ProductLinkManagementInterface"> + <plugin name="reindex_after_add_child_by_sku" type="Magento\Bundle\Plugin\Api\ProductLinkManagement\ReindexAfterAddChildBySkuPlugin"/> + <plugin name="reindex_after_remove_child" type="Magento\Bundle\Plugin\Api\ProductLinkManagement\ReindexAfterRemoveChildPlugin"/> + </type> </config> diff --git a/app/code/Magento/Bundle/i18n/en_US.csv b/app/code/Magento/Bundle/i18n/en_US.csv index 99ef117fffad..cf02ca338ad1 100644 --- a/app/code/Magento/Bundle/i18n/en_US.csv +++ b/app/code/Magento/Bundle/i18n/en_US.csv @@ -108,3 +108,4 @@ Type,Type "Cannot create shipment as bundle product ""%1"" has shipment type ""%2"". %3 should be shipped instead.","Cannot create shipment as bundle product ""%1"" has shipment type ""%2"". %3 should be shipped instead." "Bundle product itself","Bundle product itself" "Bundle product options","Bundle product options" +"Product relations processor must implement %1.","Product relations processor must implement %1." diff --git a/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/radio.phtml b/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/radio.phtml index 185a9159c8ab..d9fc3ada8f99 100644 --- a/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/radio.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/radio.phtml @@ -69,7 +69,7 @@ class="input-text admin__control-text qty validate-greater-than-zero<?php if (!$_canChangeQty) { echo ' qty-disabled'; } ?>" type="text" name="bundle_option_qty[<?= $block->escapeHtmlAttr($_option->getId()) ?>]" - value="<?= $block->escapeHtmlAttr($_defaultQty) ?>" /> + value="<?= $block->escapeHtmlAttr($_defaultQty) ?>"></div> </div> </div> </div> diff --git a/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml b/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml index d6637401cff9..edb6f6063403 100644 --- a/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ // phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> diff --git a/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option/selection.phtml b/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option/selection.phtml index 4ada5496ab5a..cf6b753ca832 100644 --- a/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option/selection.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option/selection.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option\Selection */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> @@ -158,9 +159,9 @@ Bundle.Selection.prototype = { $grid.find('.checkbox').prop({checked: false}); var checkRowBySku = function (sku) { - sku = $.trim(sku); + sku = sku.trim(); $grid.find('.sku').filter(function () { - return $.trim($(this).text()) == sku; + return $(this).text().trim() == sku; }).closest('tr').find('.checkbox').prop({checked: true}); }; $.each(bSelection.gridSelection.values().pop().toArray(), function () { diff --git a/app/code/Magento/Bundle/view/adminhtml/web/js/bundle-product.js b/app/code/Magento/Bundle/view/adminhtml/web/js/bundle-product.js index fa79439517ab..f4417f93685e 100644 --- a/app/code/Magento/Bundle/view/adminhtml/web/js/bundle-product.js +++ b/app/code/Magento/Bundle/view/adminhtml/web/js/bundle-product.js @@ -146,8 +146,8 @@ define([ if ($(this).is(':checked')) { selectedProductList[$(this).val()] = { - name: $.trim(tr.find('.col-name').html()), - sku: $.trim(tr.find('.col-sku').html()), + name: tr.find('.col-name').html().trim(), + sku: tr.find('.col-sku').html().trim(), 'product_id': $(this).val(), 'option_id': $('bundle_selection_id_' + optionIndex).val(), 'selection_price_value': 0, @@ -186,7 +186,7 @@ define([ }); bSelection.gridRemoval.each(function (pair) { $optionBox.find('.col-sku').filter(function () { - return $.trim($(this).text()) === pair.key; // find row by SKU + return $(this).text().trim() === pair.key; // find row by SKU }).closest('tr').find('button.delete').trigger('click'); }); widget.refreshSortableElements(); diff --git a/app/code/Magento/Bundle/view/base/web/template/product/price/minimal_price.html b/app/code/Magento/Bundle/view/base/web/template/product/price/minimal_price.html index cb5b273dd890..57c4857f5dbe 100644 --- a/app/code/Magento/Bundle/view/base/web/template/product/price/minimal_price.html +++ b/app/code/Magento/Bundle/view/base/web/template/product/price/minimal_price.html @@ -9,14 +9,14 @@ css="getAdjustmentCssClasses($row())"> <span if="label" class="price-label" - text="label"/> + text="label"></span> <span class="price-wrapper" css="priceWrapperCssClasses" attr="priceWrapperAttr" data-price-amount="" data-price-type="" - html="getMinimalPrice($row())"/> + html="getMinimalPriceUnsanitizedHtml($row())"></span> <each args="data: getAdjustments(), as: '$adj'"> <render args="$adj.getBody()"/> diff --git a/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/summary.phtml b/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/summary.phtml index 9bf179e622f1..aaf8fc22d534 100644 --- a/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/summary.phtml +++ b/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/summary.phtml @@ -3,10 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -?> -<?php - $_product = $block->getProduct(); +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound +$_product = $block->getProduct(); ?> <?php if ($_product->isSaleable() && $block->hasOptions()) : ?> <div id="bundleSummary" diff --git a/app/code/Magento/Bundle/view/frontend/web/js/product-summary.js b/app/code/Magento/Bundle/view/frontend/web/js/product-summary.js index d5270569d5bb..25f65830e396 100644 --- a/app/code/Magento/Bundle/view/frontend/web/js/product-summary.js +++ b/app/code/Magento/Bundle/view/frontend/web/js/product-summary.js @@ -77,7 +77,7 @@ define([ .closest(this.options.summaryContainer) .find(this.options.templates.summaryBlock) .html(); - template = mageTemplate($.trim(template), { + template = mageTemplate(template.trim(), { data: { _label_: this.cache.currentElement.options[key].title } @@ -107,7 +107,7 @@ define([ .closest(this.options.summaryContainer) .find(this.options.templates.optionBlock) .html(); - template = mageTemplate($.trim(template), { + template = mageTemplate(template.trim(), { data: { _quantity_: this.cache.currentElement.options[this.cache.currentKey].selections[optionIndex].qty, _label_: this.cache.currentElement.options[this.cache.currentKey].selections[optionIndex].name diff --git a/app/code/Magento/Bundle/view/frontend/web/js/slide.js b/app/code/Magento/Bundle/view/frontend/web/js/slide.js index 5afe4ad8a9ea..86b341e4adcb 100644 --- a/app/code/Magento/Bundle/view/frontend/web/js/slide.js +++ b/app/code/Magento/Bundle/view/frontend/web/js/slide.js @@ -85,7 +85,7 @@ define([ $('html, body').animate({ scrollTop: $(this.options.bundleOptionsContainer).offset().top }, 600); - $('#product-options-wrapper > fieldset').focus(); + $('#product-options-wrapper > fieldset').trigger('focus'); }, /** diff --git a/app/code/Magento/BundleGraphQl/etc/graphql/di.xml b/app/code/Magento/BundleGraphQl/etc/graphql/di.xml index 7fe0b2a53677..caca08d3d4a9 100644 --- a/app/code/Magento/BundleGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/BundleGraphQl/etc/graphql/di.xml @@ -107,4 +107,11 @@ </argument> </arguments> </type> + <type name="Magento\UrlRewriteGraphQl\Model\RoutableInterfaceTypeResolver"> + <arguments> + <argument name="productTypeNameResolvers" xsi:type="array"> + <item name="bundle_product_type_resolver" xsi:type="object">Magento\BundleGraphQl\Model\BundleProductTypeResolver</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/BundleGraphQl/etc/schema.graphqls b/app/code/Magento/BundleGraphQl/etc/schema.graphqls index 8a60eb671b0b..8c8149133b98 100644 --- a/app/code/Magento/BundleGraphQl/etc/schema.graphqls +++ b/app/code/Magento/BundleGraphQl/etc/schema.graphqls @@ -72,7 +72,7 @@ type BundleItemOption @doc(description: "BundleItemOption defines characteristic uid: ID! @doc(description: "The unique ID for a `BundleItemOption` object.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Options\\BundleItemOptionUid") } -type BundleProduct implements ProductInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "BundleProduct defines basic features of a bundle product and contains multiple BundleItems.") { +type BundleProduct implements ProductInterface, RoutableInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "Defines basic features of a bundle product and contains multiple BundleItems") { price_view: PriceViewEnum @doc(description: "One of PRICE_RANGE or AS_LOW_AS.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\PriceView") dynamic_price: Boolean @doc(description: "Indicates whether the bundle product has a dynamic price.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\DynamicPrice") dynamic_sku: Boolean @doc(description: "Indicates whether the bundle product has a dynamic SK.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\DynamicSku") diff --git a/app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle.php b/app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle.php index 04384ca71cfb..9497522e74f1 100644 --- a/app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle.php +++ b/app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle.php @@ -573,8 +573,12 @@ protected function insertOptions() $optionIds = $this->connection->fetchAssoc( $this->connection->select()->from( - $this->_resource->getTableName('catalog_product_bundle_option'), + ['bo' => $this->_resource->getTableName('catalog_product_bundle_option')], ['option_id', 'position', 'parent_id'] + )->joinLeft( + ['bov' => $this->_resource->getTableName('catalog_product_bundle_option_value')], + 'bo.option_id = bov.option_id', + ['title'] )->where( 'parent_id IN (?)', $productIds @@ -600,8 +604,10 @@ protected function populateInsertOptionValues(array $optionIds): array foreach ($this->_cachedOptions as $entityId => $options) { foreach ($options as $key => $option) { foreach ($optionIds as $optionId => $assoc) { - if ($assoc['position'] == $this->_cachedOptions[$entityId][$key]['index'] - && $assoc['parent_id'] == $entityId) { + if ($assoc['position'] == $this->_cachedOptions[$entityId][$key]['index'] && + $assoc['parent_id'] == $entityId && + (empty($assoc['title']) || $assoc['title'] == $this->_cachedOptions[$entityId][$key]['name']) + ) { $option['parent_id'] = $entityId; $optionValues[] = $this->populateOptionValueTemplate($option, $optionId); $this->_cachedOptions[$entityId][$key]['option_id'] = $optionId; diff --git a/app/code/Magento/BundleImportExport/Test/Mftf/Data/ImportData.xml b/app/code/Magento/BundleImportExport/Test/Mftf/Data/ImportData.xml new file mode 100644 index 000000000000..af7fb0af4685 --- /dev/null +++ b/app/code/Magento/BundleImportExport/Test/Mftf/Data/ImportData.xml @@ -0,0 +1,130 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <!-- Categories --> + <entity name="ImportCategory_Bundle" type="category"> + <data key="name">import-category-bundle</data> + <data key="name_lwr">import-category-bundle</data> + <data key="is_active">true</data> + <data key="include_in_menu">true</data> + <data key="urlKey">import-category-bundle</data> + </entity> + + <!-- Products --> + <entity name="ImportProductSimple1_Bundle" type="product"> + <data key="name">import-product-simple1-bundle</data> + <data key="sku">import-product-simple1-bundle</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="attributeSetText">Default</data> + <data key="price">10.00</data> + <data key="visibility">4</data> + <data key="status">1</data> + <data key="statusText">Enabled</data> + <data key="quantity">101</data> + <data key="weight">1</data> + <data key="urlKey">import-product-simple1-bundle</data> + <data key="baseImage">magento-logo.png</data> + <data key="baseImageName">magento-logo</data> + <data key="smallImage">magento-logo.png</data> + <data key="smallImageName">magento-logo</data> + <data key="thumbnailImage">magento-logo.png</data> + <data key="thumbnailImageName">magento-logo</data> + <data key="bundleIsDefault">false</data> + <data key="bundleDefaultQuantity">2</data> + <data key="bundleUserDefined">true</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="ImportProductSimple2_Bundle" type="product"> + <data key="name">import-product-simple2-bundle</data> + <data key="sku">import-product-simple2-bundle</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="attributeSetText">Default</data> + <data key="price">20.00</data> + <data key="visibility">4</data> + <data key="status">1</data> + <data key="statusText">Enabled</data> + <data key="quantity">102</data> + <data key="weight">2</data> + <data key="urlKey">import-product-simple2-bundle</data> + <data key="baseImage">m-logo.gif</data> + <data key="baseImageName">m-logo</data> + <data key="smallImage">m-logo.gif</data> + <data key="smallImageName">m-logo</data> + <data key="thumbnailImage">m-logo.gif</data> + <data key="thumbnailImageName">m-logo</data> + <data key="bundleIsDefault">true</data> + <data key="bundleDefaultQuantity">4</data> + <data key="bundleUserDefined">false</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="ImportProductSimple3_Bundle" type="product"> + <data key="name">import-product-simple3-bundle</data> + <data key="sku">import-product-simple3-bundle</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="attributeSetText">Default</data> + <data key="price">30.00</data> + <data key="visibility">4</data> + <data key="status">1</data> + <data key="statusText">Enabled</data> + <data key="quantity">103</data> + <data key="weight">3</data> + <data key="urlKey">import-product-simple3-bundle</data> + <data key="baseImage">adobe-base.jpg</data> + <data key="baseImageName">adobe-base</data> + <data key="smallImage">adobe-base.jpg</data> + <data key="smallImageName">adobe-base</data> + <data key="thumbnailImage">adobe-base.jpg</data> + <data key="thumbnailImageName">adobe-base</data> + <data key="bundleIsDefault">false</data> + <data key="bundleDefaultQuantity">3</data> + <data key="bundleUserDefined">false</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="ImportProduct_Bundle" type="product"> + <data key="fileName">import_bundle_product.csv</data> + <data key="importSummary">Created: 4, Updated: 0, Deleted: 0</data> + <data key="name">import-product-bundle</data> + <data key="sku">import-product-bundle</data> + <data key="type_id">bundle</data> + <data key="attribute_set_id">4</data> + <data key="attributeSetText">Default</data> + <data key="price"/> + <data key="dynamicSkuCheckedValue">true</data> + <data key="dynamicPriceCheckedValue">true</data> + <data key="dynamicWeightCheckedValue">true</data> + <data key="visibility">4</data> + <data key="status">1</data> + <data key="quantity">0</data> + <data key="weight"/> + <data key="urlKey">import-product-bundle</data> + <data key="baseImage">magento-logo.png</data> + <data key="baseImageName">magento-logo</data> + <data key="smallImage">m-logo.gif</data> + <data key="smallImageName">m-logo</data> + <data key="thumbnailImage">adobe-base.jpg</data> + <data key="thumbnailImageName">adobe-base</data> + <data key="totalBundleOptions">2</data> + <data key="bundleOptionShipmentType">Together</data> + <data key="bundleOption1Title">Bundle Option A</data> + <data key="bundleOption1InputType">radio</data> + <data key="bundleOption1Required">true</data> + <data key="bundleOption1NumberOfProducts">2</data> + <data key="bundleOption2Title">Bundle Option B</data> + <data key="bundleOption2InputType">checkbox</data> + <data key="bundleOption2Required">false</data> + <data key="bundleOption2NumberOfProducts">1</data> + </entity> +</entities> diff --git a/app/code/Magento/BundleImportExport/Test/Mftf/Test/AdminImportBundleProductTest.xml b/app/code/Magento/BundleImportExport/Test/Mftf/Test/AdminImportBundleProductTest.xml new file mode 100644 index 000000000000..6e28ebb4e673 --- /dev/null +++ b/app/code/Magento/BundleImportExport/Test/Mftf/Test/AdminImportBundleProductTest.xml @@ -0,0 +1,351 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminImportBundleProductTest"> + <annotations> + <features value="BundleImportExport"/> + <stories value="Import Products"/> + <title value="Import Bundle Product"/> + <description value="Imports a .csv file containing a bundle product. Verifies that product is imported + successfully and can be purchased."/> + <severity value="MAJOR"/> + <testCaseId value="MC-38432"/> + <group value="importExport"/> + <group value="Bundle"/> + </annotations> + + <before> + <!-- Create Product, Upload Images & Create Customer --> + <createData entity="ImportCategory_Bundle" stepKey="createImportCategory"/> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + + <!-- Copy Images to Import Directory for Product Images --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportImages"> + <argument name="path">var/import/images/{{ImportProduct_Bundle.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct1BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple1_Bundle.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Bundle.name}}/{{ImportProductSimple1_Bundle.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct2BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple2_Bundle.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Bundle.name}}/{{ImportProductSimple2_Bundle.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct3BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple3_Bundle.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Bundle.name}}/{{ImportProductSimple3_Bundle.thumbnailImage}}</argument> + </helper> + + <!-- Login as Admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <after> + <!-- Delete Data --> + <deleteData createDataKey="createImportCategory" stepKey="deleteImportCategory"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteProductImageDirectory"> + <argument name="path">var/import/images/{{ImportProduct_Bundle.name}}</argument> + </helper> + <deleteData url="/V1/products/{{ImportProductSimple1_Bundle.urlKey}}" stepKey="deleteImportedSimpleProduct1"/> + <deleteData url="/V1/products/{{ImportProductSimple2_Bundle.urlKey}}" stepKey="deleteImportedSimpleProduct2"/> + <deleteData url="/V1/products/{{ImportProductSimple3_Bundle.urlKey}}" stepKey="deleteImportedSimpleProduct3"/> + <deleteData url="/V1/products/{{ImportProduct_Bundle.urlKey}}" stepKey="deleteImportedBundleProduct"/> + <actionGroup ref="NavigateToAndResetProductGridToDefaultViewActionGroup" stepKey="navigateToAndResetProductGridToDefaultView"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Import Bundle Product & Assert No Errors --> + <actionGroup ref="AdminNavigateToImportPageActionGroup" stepKey="navigateToImportPage"/> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Bundle.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Bundle.name}}"/> + </actionGroup> + <actionGroup ref="AdminClickCheckDataImportActionGroup" stepKey="clickCheckData"/> + <see selector="{{AdminImportValidationMessagesSection.success}}" userInput="{{ImportCommonMessages.validFile}}" stepKey="seeCheckDataResultMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage"/> + <actionGroup ref="AdminClickImportActionGroup" stepKey="clickImport"/> + <see selector="{{AdminImportValidationMessagesSection.notice}}" userInput="{{ImportProduct_Bundle.importSummary}}" stepKey="seeNoticeMessage"/> + <see selector="{{AdminImportValidationMessagesSection.messageByType('success')}}" userInput="{{ImportCommonMessages.success}}" stepKey="seeImportMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage2"/> + + <!-- Reindex --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + + <!-- Admin: Verify Data on Import History Page --> + <actionGroup ref="AdminNavigateToImportHistoryPageActionGroup" stepKey="navigateToImportHistoryPage"/> + <actionGroup ref="AdminGridSortColumnDescendingActionGroup" stepKey="sortColumnByIdDescending"> + <argument name="columnLabel" value="history_id"/> + </actionGroup> + <see userInput="{{ImportProduct_Bundle.fileName}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeImportedFile"/> + <see userInput="{{ImportProduct_Bundle.importSummary}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeSummary"/> + + <!-- Admin: Verify Simple Product 1 on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToSimpleProduct1EditPage"> + <argument name="product" value="ImportProductSimple1_Bundle"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct1OnEditPage"> + <argument name="productStatus" value="{{ImportProductSimple1_Bundle.status}}"/> + <argument name="productAttributeSet" value="{{ImportProductSimple1_Bundle.attributeSetText}}"/> + <argument name="productName" value="{{ImportProductSimple1_Bundle.name}}"/> + <argument name="productSku" value="{{ImportProductSimple1_Bundle.sku}}"/> + <argument name="productPrice" value="{{ImportProductSimple1_Bundle.price}}"/> + <argument name="productQuantity" value="{{ImportProductSimple1_Bundle.quantity}}"/> + <argument name="productWeight" value="{{ImportProductSimple1_Bundle.weight}}"/> + <argument name="categoryName" value="{{ImportCategory_Bundle.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertSimpleProduct1ImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple1_Bundle.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple1_Bundle.baseImageName, 'image')}}" stepKey="seeBaseImageRoleSimple1"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertSimpleProduct1SmallImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple1_Bundle.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple1_Bundle.smallImageName, 'small_image')}}" stepKey="seeSmallImageRoleSimple1"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertSimpleProduct1ThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple1_Bundle.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple1_Bundle.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRoleSimple1"/> + + <!-- Admin: Verify Simple Product 2 on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToSimpleProduct2EditPage"> + <argument name="product" value="ImportProductSimple2_Bundle"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct2OnEditPage"> + <argument name="productStatus" value="{{ImportProductSimple2_Bundle.status}}"/> + <argument name="productAttributeSet" value="{{ImportProductSimple2_Bundle.attributeSetText}}"/> + <argument name="productName" value="{{ImportProductSimple2_Bundle.name}}"/> + <argument name="productSku" value="{{ImportProductSimple2_Bundle.sku}}"/> + <argument name="productPrice" value="{{ImportProductSimple2_Bundle.price}}"/> + <argument name="productQuantity" value="{{ImportProductSimple2_Bundle.quantity}}"/> + <argument name="productWeight" value="{{ImportProductSimple2_Bundle.weight}}"/> + <argument name="categoryName" value="{{ImportCategory_Bundle.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertSimpleProduct2ImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple2_Bundle.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple2_Bundle.baseImageName, 'image')}}" stepKey="seeBaseImageRoleSimple2"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertSimpleProduct2SmallImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple2_Bundle.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple2_Bundle.smallImageName, 'small_image')}}" stepKey="seeSmallImageRoleSimple2"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertSimpleProduct2ThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple2_Bundle.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple2_Bundle.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRoleSimple2"/> + + <!-- Admin: Verify Simple Product 3 on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToSimpleProduct3EditPage"> + <argument name="product" value="ImportProductSimple3_Bundle"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct3OnEditPage"> + <argument name="productStatus" value="{{ImportProductSimple3_Bundle.status}}"/> + <argument name="productAttributeSet" value="{{ImportProductSimple3_Bundle.attributeSetText}}"/> + <argument name="productName" value="{{ImportProductSimple3_Bundle.name}}"/> + <argument name="productSku" value="{{ImportProductSimple3_Bundle.sku}}"/> + <argument name="productPrice" value="{{ImportProductSimple3_Bundle.price}}"/> + <argument name="productQuantity" value="{{ImportProductSimple3_Bundle.quantity}}"/> + <argument name="productWeight" value="{{ImportProductSimple3_Bundle.weight}}"/> + <argument name="categoryName" value="{{ImportCategory_Bundle.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertSimpleProduct3ImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple3_Bundle.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple3_Bundle.baseImageName, 'image')}}" stepKey="seeBaseImageRoleSimple3"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertSimpleProduct3SmallImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple3_Bundle.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple3_Bundle.smallImageName, 'small_image')}}" stepKey="seeSmallImageRoleSimple3"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertSimpleProduct3ThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple3_Bundle.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple3_Bundle.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRoleSimple3"/> + + <!-- Admin: Verify Bundle Product Common Data on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToBundleProductEditPage"> + <argument name="product" value="ImportProduct_Bundle"/> + </actionGroup> + <actionGroup ref="AdminAssertBundleProductGeneralInfoOnEditPageActionGroup" stepKey="assertBundleProductOnEditPage"> + <argument name="productStatus" value="{{ImportProduct_Bundle.status}}"/> + <argument name="productAttributeSet" value="{{ImportProduct_Bundle.attributeSetText}}"/> + <argument name="productName" value="{{ImportProduct_Bundle.name}}"/> + <argument name="productSku" value="{{ImportProduct_Bundle.sku}}"/> + <argument name="dynamicSku" value="{{ImportProduct_Bundle.dynamicSkuCheckedValue}}"/> + <argument name="productPrice" value="{{ImportProduct_Bundle.price}}"/> + <argument name="dynamicPrice" value="{{ImportProduct_Bundle.dynamicPriceCheckedValue}}"/> + <argument name="productQuantity" value="{{ImportProduct_Bundle.quantity}}"/> + <argument name="productWeight" value="{{ImportProduct_Bundle.weight}}"/> + <argument name="dynamicWeight" value="{{ImportProduct_Bundle.dynamicWeightCheckedValue}}"/> + <argument name="categoryName" value="{{ImportCategory_Bundle.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertBundleProductBaseImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Bundle.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Bundle.baseImageName, 'image')}}" stepKey="seeBaseImageRoleBundle"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertBundleProductSmallImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Bundle.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Bundle.smallImageName, 'small_image')}}" stepKey="seeSmallImageRoleBundle"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertBundleProductThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Bundle.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Bundle.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRoleBundle"/> + + <!-- Admin: Verify Bundle Product Information on Edit Product Page --> + <seeOptionIsSelected userInput="{{ImportProduct_Bundle.bundleOptionShipmentType}}" selector="{{AdminProductFormBundleSection.shipmentType}}" stepKey="seeShipBundleItemsTogether"/> + <seeNumberOfElements userInput="{{ImportProduct_Bundle.totalBundleOptions}}" selector="{{AdminProductFormBundleSection.allBundleOptions}}" stepKey="see2BundleOptionsAdmin"/> + <actionGroup ref="AdminVerifyBundleProductOptionActionGroup" stepKey="verifyBundleProductOption1"> + <argument name="optionTitle" value="{{ImportProduct_Bundle.bundleOption1Title}}"/> + <argument name="inputType" value="{{ImportProduct_Bundle.bundleOption1InputType}}"/> + <argument name="required" value="{{ImportProduct_Bundle.bundleOption1Required}}"/> + <argument name="numberOfProducts" value="{{ImportProduct_Bundle.bundleOption1NumberOfProducts}}"/> + <argument name="index" value="1"/> + </actionGroup> + <actionGroup ref="AdminVerifyProductInBundleProductOptionActionGroup" stepKey="verifyBundleProductOption1Product1"> + <argument name="isDefault" value="{{ImportProductSimple1_Bundle.bundleIsDefault}}"/> + <argument name="name" value="{{ImportProductSimple1_Bundle.name}}"/> + <argument name="sku" value="{{ImportProductSimple1_Bundle.sku}}"/> + <argument name="defaultQuantity" value="{{ImportProductSimple1_Bundle.bundleDefaultQuantity}}"/> + <argument name="userDefined" value="{{ImportProductSimple1_Bundle.bundleUserDefined}}"/> + <argument name="optionIndex" value="1"/> + <argument name="productIndex" value="1"/> + </actionGroup> + <actionGroup ref="AdminVerifyProductInBundleProductOptionActionGroup" stepKey="verifyBundleProductOption1Product2"> + <argument name="isDefault" value="{{ImportProductSimple2_Bundle.bundleIsDefault}}"/> + <argument name="name" value="{{ImportProductSimple2_Bundle.name}}"/> + <argument name="sku" value="{{ImportProductSimple2_Bundle.sku}}"/> + <argument name="defaultQuantity" value="{{ImportProductSimple2_Bundle.bundleDefaultQuantity}}"/> + <argument name="userDefined" value="{{ImportProductSimple2_Bundle.bundleUserDefined}}"/> + <argument name="optionIndex" value="1"/> + <argument name="productIndex" value="2"/> + </actionGroup> + <actionGroup ref="AdminVerifyBundleProductOptionActionGroup" stepKey="verifyBundleProductOption2"> + <argument name="optionTitle" value="{{ImportProduct_Bundle.bundleOption2Title}}"/> + <argument name="inputType" value="{{ImportProduct_Bundle.bundleOption2InputType}}"/> + <argument name="required" value="{{ImportProduct_Bundle.bundleOption2Required}}"/> + <argument name="numberOfProducts" value="{{ImportProduct_Bundle.bundleOption2NumberOfProducts}}"/> + <argument name="index" value="2"/> + </actionGroup> + <actionGroup ref="AdminVerifyProductInBundleProductOptionActionGroup" stepKey="verifyBundleProductOption2Product1"> + <argument name="isDefault" value="{{ImportProductSimple3_Bundle.bundleIsDefault}}"/> + <argument name="name" value="{{ImportProductSimple3_Bundle.name}}"/> + <argument name="sku" value="{{ImportProductSimple3_Bundle.sku}}"/> + <argument name="defaultQuantity" value="{{ImportProductSimple3_Bundle.bundleDefaultQuantity}}"/> + <argument name="userDefined" value="{{ImportProductSimple3_Bundle.bundleUserDefined}}"/> + <argument name="optionIndex" value="2"/> + <argument name="productIndex" value="1"/> + </actionGroup> + + <!-- Storefront: Verify Bundle Product In Category --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginStorefront"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + <actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryPage"> + <argument name="categoryUrl" value="{{ImportCategory_Bundle.name}}"/> + </actionGroup> + <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productName}}" userInput="4" stepKey="see4Products"/> + <see userInput="{{ImportProductSimple1_Bundle.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeSimpleProduct1"/> + <see userInput="{{ImportProductSimple2_Bundle.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeSimpleProduct2"/> + <see userInput="{{ImportProductSimple3_Bundle.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeSimpleProduct3"/> + <see userInput="{{ImportProduct_Bundle.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeBundleProduct"/> + + <!-- Storefront: Verify Bundle Product Info & Images --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefrontPage"> + <argument name="productUrl" value="{{ImportProduct_Bundle.urlKey}}"/> + </actionGroup> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Bundle.name}}" stepKey="seeProductName"/> + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Bundle.sku}}" stepKey="seeSku"/> + <see userInput="From $20.00 To $170.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seePrice"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple1_Bundle.baseImageName)}}" stepKey="seeProduct1BaseImage"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple2_Bundle.baseImageName)}}" stepKey="seeProduct2BaseImage"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple3_Bundle.baseImageName)}}" stepKey="seeProduct3BaseImage"/> + + <!-- Storefront: Verify Default Customization Summary --> + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickCustomizeAndAddToCartButton"/> + <see userInput="$80.00" selector="{{StorefrontBundledSection.bundleProductsPrice}}" stepKey="seeCustomizationPrice"/> + <see userInput="{{ImportProduct_Bundle.bundleOption1Title}}: {{ImportProductSimple2_Bundle.bundleDefaultQuantity}} x {{ImportProductSimple2_Bundle.name}}" selector="{{StorefrontBundledSection.bundleSummary}}" stepKey="seeCustomizationSummary"/> + + <!-- Storefront: Verify Default Bundle Option 1 --> + <seeNumberOfElements userInput="2" selector="{{StorefrontBundledSection.allBundleOptions}}" stepKey="see2TotalBundleOptions"/> + <see userInput="{{ImportProduct_Bundle.bundleOption1Title}}" selector="{{StorefrontBundledSection.nthOptionDiv('1')}}" stepKey="seeOption1Title"/> + <seeElement selector="{{StorefrontBundledSection.bundleOptionRequired('1')}}" stepKey="seeOption1Required"/> + <seeNumberOfElements userInput="2" selector="{{StorefrontBundledSection.allBundleOptionProducts('1')}}" stepKey="see2TotalProductsInBundleOption1"/> + <dontSeeCheckboxIsChecked selector="{{StorefrontBundledSection.bundleOptionInput('1', '1')}}" stepKey="dontSeeOption1Product1Checked"/> + <see userInput="{{ImportProductSimple1_Bundle.name}}" selector="{{StorefrontBundledSection.bundleOptionProductName('1', '1')}}" stepKey="seeOption1Product1Name"/> + <see userInput="+ ${{ImportProductSimple1_Bundle.price}}" selector="{{StorefrontBundledSection.bundleOptionProductPrice('1', '1')}}" stepKey="seeOption1Product1Price"/> + <seeCheckboxIsChecked selector="{{StorefrontBundledSection.bundleOptionInput('1', '2')}}" stepKey="seeOption1Product2Checked"/> + <see userInput="{{ImportProductSimple2_Bundle.name}}" selector="{{StorefrontBundledSection.bundleOptionProductName('1', '2')}}" stepKey="seeOption1Product2Name"/> + <see userInput="+ ${{ImportProductSimple2_Bundle.price}}" selector="{{StorefrontBundledSection.bundleOptionProductPrice('1', '2')}}" stepKey="seeOption1Product2Price"/> + <seeInField userInput="{{ImportProductSimple2_Bundle.bundleDefaultQuantity}}" selector="{{StorefrontBundledSection.bundleOptionQuantity('1')}}" stepKey="seeOption1DefaultQuantity"/> + <seeElement selector="{{StorefrontBundledSection.bundleOptionQuantityDisabled('1')}}" stepKey="seeOption1QuantityDisabled"/> + + <!-- Storefront: Verify Default Bundle Option 2 --> + <see userInput="{{ImportProduct_Bundle.bundleOption2Title}}" selector="{{StorefrontBundledSection.nthOptionDiv('2')}}" stepKey="seeOption2Title"/> + <dontSeeElement selector="{{StorefrontBundledSection.bundleOptionRequired('2')}}" stepKey="seeOption2NotRequired"/> + <seeNumberOfElements userInput="2" selector="{{StorefrontBundledSection.allBundleOptionProducts('1')}}" stepKey="see1TotalProductsInBundleOption2"/> + <dontSeeCheckboxIsChecked selector="{{StorefrontBundledSection.bundleOptionInput('2', '1')}}" stepKey="dontSeeOption2Product1Checked"/> + <see userInput="{{ImportProductSimple3_Bundle.bundleDefaultQuantity}} x {{ImportProductSimple3_Bundle.name}}" selector="{{StorefrontBundledSection.bundleOptionProductName('2', '1')}}" stepKey="seeOption2Product1Name"/> + <see userInput="+ ${{ImportProductSimple3_Bundle.price}}" selector="{{StorefrontBundledSection.bundleOptionProductPrice('2', '1')}}" stepKey="seeOption2Product1Price"/> + <dontSeeElement selector="{{StorefrontBundledSection.bundleOptionQuantity('2')}}" stepKey="dontSeeOption2QuantityInput"/> + + <!-- Storefront: Select Product 1 in Option 1 & Select Option 2 --> + <checkOption selector="{{StorefrontBundledSection.bundleOptionInput('1', '1')}}" stepKey="checkProduct1InOption1"/> + <seeInField userInput="{{ImportProductSimple1_Bundle.bundleDefaultQuantity}}" selector="{{StorefrontBundledSection.bundleOptionQuantity('1')}}" stepKey="seeOption1UpdatedQuantity"/> + <dontSeeElement selector="{{StorefrontBundledSection.bundleOptionQuantityDisabled('1')}}" stepKey="seeOption1QuantityEnabled"/> + <checkOption selector="{{StorefrontBundledSection.bundleOptionInput('2', '1')}}" stepKey="checkOption2"/> + + <!-- Storefront: Verify Updated Customization Summary --> + <see userInput="$110.00" selector="{{StorefrontBundledSection.bundleProductsPrice}}" stepKey="seeCustomizationPrice2"/> + <see userInput="{{ImportProduct_Bundle.bundleOption1Title}}: {{ImportProductSimple1_Bundle.bundleDefaultQuantity}} x {{ImportProductSimple1_Bundle.name}}" selector="{{StorefrontBundledSection.bundleSummary}}" stepKey="seeUpdatedCustomizationSummary"/> + <see userInput="{{ImportProduct_Bundle.bundleOption2Title}}: {{ImportProductSimple3_Bundle.bundleDefaultQuantity}} x {{ImportProductSimple3_Bundle.name}}" selector="{{StorefrontBundledSection.bundleSummary}}" stepKey="seeUpdatedCustomizationSummary2"/> + + <!-- Purchase Bundle Product --> + <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProductToCart"/> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="navigateToCheckoutPage"/> + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/> + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNextOnShippingStep"/> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlacePurchaseOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> + + <!-- Confirm Purchased Bundle Product --> + <actionGroup ref="StorefrontOpenOrderFromSuccessPageActionGroup" stepKey="openOrderFromSuccessPage"> + <argument name="orderNumber" value="{$grabOrderNumber}"/> + </actionGroup> + <actionGroup ref="StorefrontVerifyCustomerOrderProductRowDataActionGroup" stepKey="verifyProductRow1InOrder"> + <argument name="name" value="{{ImportProduct_Bundle.name}}"/> + <argument name="sku" value="{{ImportProduct_Bundle.sku}}-import-product-simple1- bundle-{{ImportProductSimple3_Bundle.sku}}"/> + <argument name="price" value="$110.00"/> + <argument name="quantity" value="1"/> + <argument name="subtotal" value="$110.00"/> + <argument name="index" value="1"/> + </actionGroup> + <seeNumberOfElements userInput="2" selector="{{StorefrontCustomerOrderViewSection.allProductOptionLabels('1')}}" stepKey="see2ProductOptions"/> + <seeNumberOfElements userInput="2" selector="{{StorefrontCustomerOrderViewSection.allProductOptionProducts('1')}}" stepKey="see2ProductOptionProducts"/> + <actionGroup ref="StorefrontVerifyBundleProductOptionOnOrderActionGroup" stepKey="verifyOrderedOption1"> + <argument name="optionTitle" value="{{ImportProduct_Bundle.bundleOption1Title}}"/> + <argument name="optionProductName" value="{{ImportProductSimple1_Bundle.bundleDefaultQuantity}} x {{ImportProductSimple1_Bundle.name}} ${{ImportProductSimple1_Bundle.price}}"/> + <argument name="optionProductSku" value="{{ImportProductSimple1_Bundle.sku}}"/> + <argument name="optionProductQuantityDescription" value="Ordered {{ImportProductSimple1_Bundle.bundleDefaultQuantity}}"/> + <argument name="productIndex" value="1"/> + <argument name="optionIndex" value="1"/> + </actionGroup> + <actionGroup ref="StorefrontVerifyBundleProductOptionOnOrderActionGroup" stepKey="verifyOrderedOption2"> + <argument name="optionTitle" value="{{ImportProduct_Bundle.bundleOption2Title}}"/> + <argument name="optionProductName" value="{{ImportProductSimple3_Bundle.bundleDefaultQuantity}} x {{ImportProductSimple3_Bundle.name}} ${{ImportProductSimple3_Bundle.price}}"/> + <argument name="optionProductSku" value="{{ImportProductSimple3_Bundle.sku}}"/> + <argument name="optionProductQuantityDescription" value="Ordered {{ImportProductSimple3_Bundle.bundleDefaultQuantity}}"/> + <argument name="productIndex" value="1"/> + <argument name="optionIndex" value="2"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml b/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml index 6ddce634ec95..68ae4826050a 100644 --- a/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml +++ b/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml @@ -38,9 +38,7 @@ <argument name="importFile" value="catalog_product_import_bundle.csv"/> <argument name="importNoticeMessage" value="Created: 2, Updated: 0, Deleted: 0"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterCreate"> - <argument name="tags" value="full_page"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterCreate"/> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="indexerReindexAfterCreate"> <argument name="indices" value="catalog_product_price"/> </actionGroup> @@ -60,9 +58,7 @@ <argument name="importFile" value="catalog_product_import_bundle.csv"/> <argument name="importNoticeMessage" value="Created: 0, Updated: 2, Deleted: 0"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterUpdate"> - <argument name="tags" value="full_page"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterUpdate"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindexAfterUpdate"/> <!-- Check Bundle product is still visible on the storefront--> diff --git a/app/code/Magento/BundleImportExport/Test/Unit/Model/Import/Product/Type/BundleTest.php b/app/code/Magento/BundleImportExport/Test/Unit/Model/Import/Product/Type/BundleTest.php index fffa4a858f4f..2d426eb6ca65 100644 --- a/app/code/Magento/BundleImportExport/Test/Unit/Model/Import/Product/Type/BundleTest.php +++ b/app/code/Magento/BundleImportExport/Test/Unit/Model/Import/Product/Type/BundleTest.php @@ -289,6 +289,7 @@ public function testSaveData($skus, $bunch, $allowImport) 'type' => 'bundle', 'value_id' => '6', 'title' => 'Bundle6', + 'name' => 'Bundle6', 'selections' => [ [ 'name' => 'Bundlen6', diff --git a/app/code/Magento/Captcha/Api/CaptchaConfigPostProcessorInterface.php b/app/code/Magento/Captcha/Api/CaptchaConfigPostProcessorInterface.php new file mode 100644 index 000000000000..f4d88d424bef --- /dev/null +++ b/app/code/Magento/Captcha/Api/CaptchaConfigPostProcessorInterface.php @@ -0,0 +1,22 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Captcha\Api; + +/** + * Interface contains methods for post processing and modifies client-side CAPTCHA config + */ +interface CaptchaConfigPostProcessorInterface +{ + /** + * Filters the data object by a filter list + * + * @param array $config + * @return array + */ + public function process(array $config): array; +} diff --git a/app/code/Magento/Captcha/Cron/DeleteExpiredImages.php b/app/code/Magento/Captcha/Cron/DeleteExpiredImages.php index cb5f1c454750..ffe46aa82dd6 100644 --- a/app/code/Magento/Captcha/Cron/DeleteExpiredImages.php +++ b/app/code/Magento/Captcha/Cron/DeleteExpiredImages.php @@ -6,6 +6,7 @@ namespace Magento\Captcha\Cron; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem\DriverPool; /** * Captcha cron actions @@ -48,7 +49,7 @@ public function __construct( ) { $this->_helper = $helper; $this->_adminHelper = $adminHelper; - $this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA); + $this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA, DriverPool::FILE); $this->_storeManager = $storeManager; } diff --git a/app/code/Magento/Captcha/Model/Filter/CaptchaConfigPostProcessorComposite.php b/app/code/Magento/Captcha/Model/Filter/CaptchaConfigPostProcessorComposite.php new file mode 100644 index 000000000000..182ef8916be5 --- /dev/null +++ b/app/code/Magento/Captcha/Model/Filter/CaptchaConfigPostProcessorComposite.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Captcha\Model\Filter; + +use Magento\Captcha\Api\CaptchaConfigPostProcessorInterface; + +/** + * Composite class for post processing captcha configuration + */ +class CaptchaConfigPostProcessorComposite implements CaptchaConfigPostProcessorInterface +{ + /** + * @var CaptchaConfigPostProcessorInterface[] $processors + */ + private $processors = []; + + /** + * @param CaptchaConfigPostProcessorInterface[] $processors + */ + public function __construct( + $processors = [] + ) { + $this->processors = $processors; + } + + /** + * Loops through all leafs of the composite and calls process method + * + * @param array $config + * @return array + */ + public function process(array $config): array + { + $result = []; + foreach ($this->processors as $processor) { + $result = array_merge_recursive($result, $processor->process($config)); + } + return $result; + } +} diff --git a/app/code/Magento/Captcha/Model/Filter/QuoteDataConfigFilter.php b/app/code/Magento/Captcha/Model/Filter/QuoteDataConfigFilter.php new file mode 100644 index 000000000000..b90497e9993e --- /dev/null +++ b/app/code/Magento/Captcha/Model/Filter/QuoteDataConfigFilter.php @@ -0,0 +1,47 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Captcha\Model\Filter; + +use Magento\Captcha\Api\CaptchaConfigPostProcessorInterface; + +/** + * Class QuoteDataConfigFilter used for filtering config quote data based on filter list + */ +class QuoteDataConfigFilter implements CaptchaConfigPostProcessorInterface +{ + /** + * @var array $filterList + */ + private $filterList; + + /** + * @param array $filterList + */ + public function __construct( + array $filterList = [] + ) { + $this->filterList = $filterList; + } + + /** + * Filters the quote config with values from a filter list + * + * @param array $config + * @return array + */ + public function process(array $config): array + { + foreach ($this->filterList as $filterKey) { + /** @var string $filterKey */ + if (isset($config['quoteData']) && array_key_exists($filterKey, $config['quoteData'])) { + unset($config['quoteData'][$filterKey]); + } + } + return $config; + } +} diff --git a/app/code/Magento/Captcha/Plugin/ResetPaymentAttemptsAfterOrderIsPlacedPlugin.php b/app/code/Magento/Captcha/Plugin/ResetPaymentAttemptsAfterOrderIsPlacedPlugin.php new file mode 100644 index 000000000000..660d5acc7586 --- /dev/null +++ b/app/code/Magento/Captcha/Plugin/ResetPaymentAttemptsAfterOrderIsPlacedPlugin.php @@ -0,0 +1,65 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Captcha\Plugin; + +use Magento\Captcha\Helper\Data as HelperCaptcha; +use Magento\Captcha\Model\ResourceModel\LogFactory; +use Magento\Sales\Api\Data\OrderInterface; +use Magento\Sales\Api\OrderManagementInterface; + +/** + * Reset attempts for frontend checkout + */ +class ResetPaymentAttemptsAfterOrderIsPlacedPlugin +{ + /** + * Form ID + */ + private const FORM_ID = 'payment_processing_request'; + + /** + * @var HelperCaptcha + */ + private $helper; + + /** + * @var LogFactory + */ + private $resLogFactory; + + /** + * ResetPaymentAttemptsAfterOrderIsPlacedPlugin constructor + * + * @param HelperCaptcha $helper + * @param LogFactory $resLogFactory + */ + public function __construct( + HelperCaptcha $helper, + LogFactory $resLogFactory + ) { + $this->helper = $helper; + $this->resLogFactory = $resLogFactory; + } + + /** + * Reset attempts for frontend checkout + * + * @param OrderManagementInterface $subject + * @param OrderInterface $result + * @param OrderInterface $order + * @return OrderInterface + */ + public function afterPlace( + OrderManagementInterface $subject, + OrderInterface $result, + OrderInterface $order + ): OrderInterface { + $captchaModel = $this->helper->getCaptcha(self::FORM_ID); + $captchaModel->setShowCaptchaInSession(false); + $this->resLogFactory->create()->deleteUserAttempts($order->getCustomerEmail()); + return $result; + } +} diff --git a/app/code/Magento/Captcha/Test/Mftf/ActionGroup/AssertStorefrontCaptchaVisibleOnShoppingCartApplyCouponCodeFormActionGroup.xml b/app/code/Magento/Captcha/Test/Mftf/ActionGroup/AssertStorefrontCaptchaVisibleOnShoppingCartApplyCouponCodeFormActionGroup.xml new file mode 100644 index 000000000000..e213ecadc739 --- /dev/null +++ b/app/code/Magento/Captcha/Test/Mftf/ActionGroup/AssertStorefrontCaptchaVisibleOnShoppingCartApplyCouponCodeFormActionGroup.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontCaptchaVisibleOnShoppingCartApplyCouponCodeFormActionGroup"> + <waitForElement selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" time="30" stepKey="waitForCouponHeader"/> + <conditionalClick selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" dependentSelector="{{StorefrontSalesRuleCartCouponSection.discountBlockActive}}" visible="false" stepKey="clickCouponHeader"/> + <waitForElementVisible selector="{{StorefrontSalesRuleCartCouponSection.couponField}}" stepKey="waitForCouponField"/> + <waitForElementVisible selector="{{StorefrontShoppingCartApplyDiscountCodeSection.captchaField}}" stepKey="waitToSeeCaptchaField"/> + <waitForElementVisible selector="{{StorefrontShoppingCartApplyDiscountCodeSection.captchaImg}}" stepKey="waitToSeeCaptchaImage"/> + <waitForElementVisible selector="{{StorefrontShoppingCartApplyDiscountCodeSection.captchaReload}}" stepKey="waitToSeeCaptchaReloadButton"/> + <reloadPage stepKey="refreshPage"/> + <waitForPageLoad stepKey="waitForPageReloaded"/> + <waitForElement selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" time="30" stepKey="waitForCouponHeaderAfterReload"/> + <conditionalClick selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" dependentSelector="{{StorefrontSalesRuleCartCouponSection.discountBlockActive}}" visible="false" stepKey="clickCouponHeaderAfterReload"/> + <waitForElementVisible selector="{{StorefrontSalesRuleCartCouponSection.couponField}}" stepKey="waitForCouponFieldAfterReload"/> + <waitForElementVisible selector="{{StorefrontShoppingCartApplyDiscountCodeSection.captchaField}}" stepKey="waitToSeeCaptchaFieldAfterPageReload"/> + <waitForElementVisible selector="{{StorefrontShoppingCartApplyDiscountCodeSection.captchaImg}}" stepKey="waitToSeeCaptchaImageAfterPageReload"/> + <waitForElementVisible selector="{{StorefrontShoppingCartApplyDiscountCodeSection.captchaReload}}" stepKey="waitToSeeCaptchaReloadButtonAfterPageReload"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Captcha/Test/Mftf/ActionGroup/StorefrontCheckoutPaymentsWithCaptchaActionGroup.xml b/app/code/Magento/Captcha/Test/Mftf/ActionGroup/StorefrontCheckoutPaymentsWithCaptchaActionGroup.xml new file mode 100644 index 000000000000..f4ad1deaca44 --- /dev/null +++ b/app/code/Magento/Captcha/Test/Mftf/ActionGroup/StorefrontCheckoutPaymentsWithCaptchaActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontCheckoutPaymentsWithCaptchaActionGroup"> + <arguments> + <argument name="captcha" type="string"/> + </arguments> + + <fillField selector="{{StorefrontCaptchaOnOnepageCheckoutPyamentSection.captchaField}}" userInput="{{captcha}}" stepKey="fillCaptchaField" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Captcha/Test/Mftf/ActionGroup/StorefrontCustomerChangePasswordWithCaptchaActionGroup.xml b/app/code/Magento/Captcha/Test/Mftf/ActionGroup/StorefrontCustomerChangePasswordWithCaptchaActionGroup.xml new file mode 100644 index 000000000000..2345fcc67f45 --- /dev/null +++ b/app/code/Magento/Captcha/Test/Mftf/ActionGroup/StorefrontCustomerChangePasswordWithCaptchaActionGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontCustomerChangePasswordWithCaptchaActionGroup" extends="StorefrontEditCustomerPasswordActionGroup"> + <annotations> + <description>EXTENDS: StorefrontEditCustomerPasswordActionGroup. Fills in the Captcha field on the Storefront Customer Information page.</description> + </annotations> + <arguments> + <argument name="captcha" type="string"/> + </arguments> + + <fillField selector="{{StorefrontCustomerAccountInformationSection.captchaField}}" userInput="{{captcha}}" stepKey="fillCaptchaField" after="confirmNewPassword"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Captcha/Test/Mftf/ActionGroup/StorefrontShoppingCartFillCaptchaFieldOnApplyDiscountFormActionGroup.xml b/app/code/Magento/Captcha/Test/Mftf/ActionGroup/StorefrontShoppingCartFillCaptchaFieldOnApplyDiscountFormActionGroup.xml new file mode 100644 index 000000000000..5594f33d0610 --- /dev/null +++ b/app/code/Magento/Captcha/Test/Mftf/ActionGroup/StorefrontShoppingCartFillCaptchaFieldOnApplyDiscountFormActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontShoppingCartFillCaptchaFieldOnApplyDiscountFormActionGroup"> + <arguments> + <argument name="captcha" type="string"/> + </arguments> + + <fillField userInput="{{captcha}}" selector="{{StorefrontShoppingCartApplyDiscountCodeSection.captchaField}}" stepKey="fillCaptchaField"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Captcha/Test/Mftf/Data/CaptchaConfigData.xml b/app/code/Magento/Captcha/Test/Mftf/Data/CaptchaConfigData.xml index 90f48c320f2a..b96e9bd5ccc1 100644 --- a/app/code/Magento/Captcha/Test/Mftf/Data/CaptchaConfigData.xml +++ b/app/code/Magento/Captcha/Test/Mftf/Data/CaptchaConfigData.xml @@ -46,6 +46,12 @@ <data key="label">Change password</data> <data key="value">user_edit</data> </entity> + <entity name="StorefrontCaptchaOnOnepageCheckoutConfigData"> + <data key="path">customer/captcha/forms</data> + <data key="scope_id">0</data> + <data key="label">Checkout/Placing Order</data> + <data key="value">payment_processing_request</data> + </entity> <entity name="StorefrontCaptchaOnCustomerForgotPasswordConfigData"> <!-- Magento default value --> <data key="path">customer/captcha/forms</data> @@ -139,4 +145,10 @@ <data key="label">ABCDEFGHJKMnpqrstuvwxyz23456789</data> <data key="value">ABCDEFGHJKMnpqrstuvwxyz23456789</data> </entity> + <entity name="StorefrontCaptchaOnApplyingCouponCodeFormsConfigData"> + <data key="path">customer/captcha/forms</data> + <data key="scope_id">0</data> + <data key="label">Applying coupon code</data> + <data key="value">sales_rule_coupon_request</data> + </entity> </entities> diff --git a/app/code/Magento/Captcha/Test/Mftf/Section/StorefrontCaptchaOnOnepageCheckoutPyamentSection.xml b/app/code/Magento/Captcha/Test/Mftf/Section/StorefrontCaptchaOnOnepageCheckoutPyamentSection.xml new file mode 100644 index 000000000000..5d70666f698a --- /dev/null +++ b/app/code/Magento/Captcha/Test/Mftf/Section/StorefrontCaptchaOnOnepageCheckoutPyamentSection.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontCaptchaOnOnepageCheckoutPyamentSection"> + <element name="captchaField" type="input" selector="#captcha_payment_processing_request"/> + <element name="captchaImg" type="block" selector=".captcha-img"/> + <element name="captchaReload" type="block" selector=".captcha-reload"/> + </section> +</sections> diff --git a/app/code/Magento/Captcha/Test/Mftf/Section/StorefrontCheckoutPaymentMethodsSection.xml b/app/code/Magento/Captcha/Test/Mftf/Section/StorefrontCheckoutPaymentMethodsSection.xml new file mode 100644 index 000000000000..bc13516c00a9 --- /dev/null +++ b/app/code/Magento/Captcha/Test/Mftf/Section/StorefrontCheckoutPaymentMethodsSection.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontCheckoutPaymentMethodsSection"> + <element name="purchaseOrder" type="radio" selector="#purchaseorder" timeout="30"/> + <element name="purchaseOrderNumber" type="input" selector="#po_number" timeout="30"/> + <element name="bankTransfer" type="radio" selector="#banktransfer" timeout="30"/> + <element name="cashOnDelivery" type="radio" selector="#cashondelivery" timeout="30"/> + </section> +</sections> diff --git a/app/code/Magento/Captcha/Test/Mftf/Section/StorefrontShoppingCartApplyDiscountCodeSection.xml b/app/code/Magento/Captcha/Test/Mftf/Section/StorefrontShoppingCartApplyDiscountCodeSection.xml new file mode 100644 index 000000000000..25827ab5ad22 --- /dev/null +++ b/app/code/Magento/Captcha/Test/Mftf/Section/StorefrontShoppingCartApplyDiscountCodeSection.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontShoppingCartApplyDiscountCodeSection"> + <element name="captchaField" type="input" selector="#discount-coupon-form input[name='captcha[sales_rule_coupon_request]']" /> + <element name="captchaImg" type="block" selector="#discount-coupon-form img.captcha-img"/> + <element name="captchaReload" type="block" selector="#discount-coupon-form button.captcha-reload"/> + </section> +</sections> diff --git a/app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest/CaptchaWithDisabledGuestCheckoutTest.xml b/app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest/CaptchaWithDisabledGuestCheckoutTest.xml index 66183cb31aeb..b44f252fda85 100644 --- a/app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest/CaptchaWithDisabledGuestCheckoutTest.xml +++ b/app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest/CaptchaWithDisabledGuestCheckoutTest.xml @@ -32,7 +32,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct1"/> </after> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.sku$$)}}" stepKey="openProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="openProductPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/> <waitForText userInput="You added $$createSimpleProduct.name$$ to your shopping cart." stepKey="waitForText"/> diff --git a/app/code/Magento/Captcha/Test/Mftf/Test/StorefrontCaptchaChangeCustomerPasswordTest.xml b/app/code/Magento/Captcha/Test/Mftf/Test/StorefrontCaptchaChangeCustomerPasswordTest.xml new file mode 100644 index 000000000000..0bcda35c5eba --- /dev/null +++ b/app/code/Magento/Captcha/Test/Mftf/Test/StorefrontCaptchaChangeCustomerPasswordTest.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontCaptchaChangeCustomerPasswordTest"> + <annotations> + <features value="Captcha"/> + <stories value="Change customer password with enabled captcha"/> + <title value="Enabled captcha on changing customer password form"/> + <description value="Customer should be able change the password with enabled captcha"/> + <severity value="MAJOR"/> + <group value="captcha"/> + </annotations> + <before> + <magentoCLI command="config:set {{StorefrontCaptchaOnCustomerChangePasswordConfigData.path}} {{StorefrontCaptchaOnCustomerChangePasswordConfigData.value}}" stepKey="enableUserEditCaptcha"/> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaLength3ConfigData.path}} {{StorefrontCustomerCaptchaLength3ConfigData.value}}" stepKey="setCaptchaLength"/> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaSymbols1ConfigData.path}} {{StorefrontCustomerCaptchaSymbols1ConfigData.value}}" stepKey="setCaptchaSymbols"/> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAlwaysConfigData.path}} {{StorefrontCustomerCaptchaModeAlwaysConfigData.value}}" stepKey="setCaptchaAlwaysVisible"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <createData entity="Simple_US_Customer" stepKey="customer"/> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$$customer$$"/> + </actionGroup> + </before> + <after> + <magentoCLI command="config:set {{StorefrontCaptchaOnCustomerLoginConfigData.path}} {{StorefrontCaptchaOnCustomerLoginConfigData.value}},{{StorefrontCaptchaOnCustomerForgotPasswordConfigData.value}}" stepKey="enableCaptchaOnDefaultForms"/> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultLengthConfigData.path}} {{StorefrontCustomerCaptchaDefaultLengthConfigData.value}}" stepKey="setDefaultCaptchaLength"/> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.path}} {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.value}}" stepKey="setDefaultCaptchaSymbols"/> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAfterFailConfigData.path}} {{StorefrontCustomerCaptchaModeAfterFailConfigData.value}}" stepKey="setCaptchaDefaultVisibility"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <deleteData createDataKey="customer" stepKey="deleteCustomer"/> + </after> + + <actionGroup ref="StorefrontOpenCustomerAccountInfoEditPageActionGroup" stepKey="goToCustomerEditPage"/> + <actionGroup ref="AssertCaptchaVisibleOnCustomerAccountInfoActionGroup" stepKey="assertCaptchaVisible"/> + <actionGroup ref="StorefrontCustomerChangePasswordWithCaptchaActionGroup" stepKey="changePasswordWithIncorrectCaptcha"> + <argument name="currentPassword" value="{{Simple_US_Customer.password}}"/> + <argument name="newPassword" value="{{Colorado_US_Customer.password}}"/> + <argument name="captcha" value="{{WrongCaptcha.value}}"/> + </actionGroup> + <actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="assertErrorMessage"> + <argument name="message" value="Incorrect CAPTCHA"/> + <argument name="messageType" value="error"/> + </actionGroup> + <actionGroup ref="StorefrontCustomerChangePasswordWithCaptchaActionGroup" stepKey="changePasswordWithCorrectValues"> + <argument name="currentPassword" value="{{Simple_US_Customer.password}}"/> + <argument name="newPassword" value="{{Colorado_US_Customer.password}}"/> + <argument name="captcha" value="{{PreconfiguredCaptcha.value}}"/> + </actionGroup> + <actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="You saved the account information."/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Captcha/Test/Mftf/Test/StorefrontCaptchaOnApplyingCouponCodesFormsTest.xml b/app/code/Magento/Captcha/Test/Mftf/Test/StorefrontCaptchaOnApplyingCouponCodesFormsTest.xml new file mode 100644 index 000000000000..2d41858f85a0 --- /dev/null +++ b/app/code/Magento/Captcha/Test/Mftf/Test/StorefrontCaptchaOnApplyingCouponCodesFormsTest.xml @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontCaptchaOnApplyingCouponCodesFormsTest"> + <annotations> + <features value="Captcha"/> + <stories value="Applying coupon codes with enabled captcha"/> + <title value="Captcha on applying coupon code forms"/> + <description value="Customer should be able apply coupon codes with enabled captcha"/> + <severity value="MINOR"/> + <group value="captcha"/> + </annotations> + <before> + <createData entity="SimpleSubCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="SalesRuleSpecificCouponWithFixedDiscount" stepKey="createCartPriceRule"/> + <createData entity="SimpleSalesRuleCoupon" stepKey="createCouponForCartPriceRule"> + <requiredEntity createDataKey="createCartPriceRule"/> + </createData> + <magentoCLI command="config:set {{EnablePaymentBankTransferConfigData.path}} {{EnablePaymentBankTransferConfigData.value}}" stepKey="enableBankTransferPayment"/> + <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaLength3ConfigData.path}} {{StorefrontCustomerCaptchaLength3ConfigData.value}}" stepKey="setCaptchaLength"/> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaSymbols1ConfigData.path}} {{StorefrontCustomerCaptchaSymbols1ConfigData.value}}" stepKey="setCaptchaSymbols"/> + <magentoCLI command="config:set {{StorefrontCaptchaOnApplyingCouponCodeFormsConfigData.path}} {{StorefrontCaptchaOnApplyingCouponCodeFormsConfigData.value}}" stepKey="enableCaptchaOnApplyingCouponsForms"/> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAlwaysConfigData.path}} {{StorefrontCustomerCaptchaModeAlwaysConfigData.value}}" stepKey="setCaptchaAlwaysVisible"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> + <argument name="tags" value="config full_page"/> + </actionGroup> + </before> + <after> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createCartPriceRule" stepKey="deleteCartPriceRule"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <magentoCLI command="config:set {{DisablePaymentBankTransferConfigData.path}} {{DisablePaymentBankTransferConfigData.value}}" stepKey="disableBankTransferPayment"/> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultLengthConfigData.path}} {{StorefrontCustomerCaptchaDefaultLengthConfigData.value}}" stepKey="setDefaultCaptchaLength"/> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.path}} {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.value}}" stepKey="setDefaultCaptchaSymbols"/> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAfterFailConfigData.path}} {{StorefrontCustomerCaptchaModeAfterFailConfigData.value}}" stepKey="setCaptchaDefaultVisibility"/> + <magentoCLI command="config:set {{StorefrontCaptchaOnCustomerLoginConfigData.path}} {{StorefrontCaptchaOnCustomerLoginConfigData.value}},{{StorefrontCaptchaOnCustomerForgotPasswordConfigData.value}}" stepKey="enableCaptchaOnDefaultForms"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> + <argument name="tags" value="config full_page"/> + </actionGroup> + </after> + + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$createCustomer$"/> + </actionGroup> + <actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategory"> + <argument name="category" value="$createCategory$"/> + <argument name="product" value="$createProduct$"/> + </actionGroup> + <actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addProductToTheCart"> + <argument name="productQty" value="1"/> + </actionGroup> + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="navigateToShoppingCart"/> + <actionGroup ref="AssertStorefrontCaptchaVisibleOnShoppingCartApplyCouponCodeFormActionGroup" stepKey="assertCaptchaIsPresent"/> + <actionGroup ref="StorefrontShoppingCartFillCouponCodeFieldActionGroup" stepKey="fillDiscountField"> + <argument name="discountCode" value="$$createCouponForCartPriceRule.code$$"/> + </actionGroup> + <actionGroup ref="StorefrontShoppingCartFillCaptchaFieldOnApplyDiscountFormActionGroup" stepKey="fillCaptchaWithIncorrectValues"> + <argument name="captcha" value="{{WrongCaptcha.value}}"/> + </actionGroup> + <actionGroup ref="StorefrontShoppingCartClickApplyDiscountButtonActionGroup" stepKey="clickApplyButton"/> + <actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="assertErrorMessage"> + <argument name="message" value="Incorrect CAPTCHA"/> + <argument name="messageType" value="error"/> + </actionGroup> + <actionGroup ref="StorefrontShoppingCartFillCouponCodeFieldActionGroup" stepKey="fillDiscountCodeField"> + <argument name="discountCode" value="$$createCouponForCartPriceRule.code$$"/> + </actionGroup> + <actionGroup ref="StorefrontShoppingCartFillCaptchaFieldOnApplyDiscountFormActionGroup" stepKey="fillCaptchaWithCorrectValues"> + <argument name="captcha" value="{{PreconfiguredCaptcha.value}}"/> + </actionGroup> + <actionGroup ref="StorefrontShoppingCartClickApplyDiscountButtonActionGroup" stepKey="clickApplyDiscountButton"/> + <actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value='You used coupon code "$$createCouponForCartPriceRule.code$$".'/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Captcha/Test/Mftf/Test/StorefrontCaptchaOnOnepageCheckoutPyamentTest.xml b/app/code/Magento/Captcha/Test/Mftf/Test/StorefrontCaptchaOnOnepageCheckoutPyamentTest.xml new file mode 100644 index 000000000000..a9b8331716e8 --- /dev/null +++ b/app/code/Magento/Captcha/Test/Mftf/Test/StorefrontCaptchaOnOnepageCheckoutPyamentTest.xml @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontCaptchaOnOnepageCheckoutPyamentTest"> + <annotations> + <features value="Captcha"/> + <stories value="Place order on checkout page + Captcha"/> + <title value="Captcha on checkout page test"/> + <description value="Test creation of order on storefront checkout page with captcha."/> + <severity value="AVERAGE"/> + <testCaseId value="MC-41461"/> + <useCaseId value="MC-41281"/> + <group value="captcha"/> + </annotations> + <before> + <!-- Create Simple Product --> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"> + <field key="price">20</field> + </createData> + + <!-- Create customer --> + <createData entity="Simple_Customer_Without_Address" stepKey="createCustomer"/> + + <!-- Enable payment method --> + <magentoCLI command="config:set {{BankTransferEnableConfigData.path}} {{BankTransferEnableConfigData.value}}" stepKey="enableBankTransfer"/> + + <!-- Enable captcha for Checkout/Placing Order --> + <magentoCLI command="config:set {{StorefrontCaptchaOnOnepageCheckoutConfigData.path}} {{StorefrontCaptchaOnOnepageCheckoutConfigData.value}}" stepKey="enableOnOpageCheckoutCaptcha" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAlwaysConfigData.path}} {{StorefrontCustomerCaptchaModeAlwaysConfigData.value}}" stepKey="alwaysEnableCaptcha" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaLength3ConfigData.path}} {{StorefrontCustomerCaptchaLength3ConfigData.value}}" stepKey="setCaptchaLength" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaSymbols1ConfigData.path}} {{StorefrontCustomerCaptchaSymbols1ConfigData.value}}" stepKey="setCaptchaSymbols" /> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> + <argument name="tags" value="config full_page"/> + </actionGroup> + </before> + <after> + <!-- Disabled payment method --> + <magentoCLI command="config:set {{BankTransferDisabledConfigData.path}} {{BankTransferDisabledConfigData.value}}" stepKey="disabledBankTransfer"/> + + <!-- Set default configuration for captcha --> + <magentoCLI command="config:set {{StorefrontCaptchaOnOnepageCheckoutConfigData.path}} {{StorefrontCaptchaOnOnepageCheckoutConfigData.value}},{{StorefrontCaptchaOnCustomerForgotPasswordConfigData.value}}" stepKey="enableCaptchaOnDefaultForms" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAfterFailConfigData.path}} {{StorefrontCustomerCaptchaModeAfterFailConfigData.value}}" stepKey="defaultCaptchaMode" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultLengthConfigData.path}} {{StorefrontCustomerCaptchaDefaultLengthConfigData.value}}" stepKey="setDefaultCaptchaLength" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.path}} {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.value}}" stepKey="setDefaultCaptchaSymbols" /> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> + <argument name="tags" value="config full_page"/> + </actionGroup> + + <!-- Customer logout --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> + + <!-- Delete created products --> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + + <!-- Delete customer --> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + </after> + + <!-- Reindex and flush cache --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> + <argument name="tags" value=""/> + </actionGroup> + + <!-- Add Simple Product to cart --> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> + <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartSimpleProductFromStorefrontProductPage"> + <argument name="productName" value="$$createSimpleProduct.name$$"/> + </actionGroup> + + <!-- Go to shopping cart --> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="FillShippingZipForm" stepKey="fillShippingZipForm"> + <argument name="address" value="US_Address_CA"/> + </actionGroup> + <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="goToCheckout"/> + + <!-- Login as customer on checkout page --> + <actionGroup ref="LoginAsCustomerOnCheckoutPageActionGroup" stepKey="customerLogin"> + <argument name="customer" value="$$createCustomer$$"/> + </actionGroup> + + <!-- Fill customer new shipping address --> + <actionGroup ref="CustomerCheckoutFillNewShippingAddressActionGroup" stepKey="fillShippingAddress"> + <argument name="address" value="US_Address_TX"/> + </actionGroup> + + <!-- Click next button to open payment section --> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + + <!-- Select payment method --> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> + <click selector="{{StorefrontCheckoutPaymentMethodsSection.bankTransfer}}" stepKey="selectBankTransferMethod"/> + + <!-- Enter captcha value --> + <fillField userInput="{{PreconfiguredCaptcha.value}}" selector="{{StorefrontCaptchaOnOnepageCheckoutPyamentSection.captchaField}}" stepKey="fillCaptchaField" /> + + <!-- Place Order --> + <actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="customerPlaceOrder"> + <argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/> + <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/> + </actionGroup> + + <!-- Assert order grand total --> + <amOnPage url="{{StorefrontCustomerDashboardPage.url}}" stepKey="navigateToCustomerDashboardPage"/> + <waitForPageLoad stepKey="waitForCustomerDashboardPageLoad"/> + <see selector="{{StorefrontCustomerRecentOrdersSection.orderTotal}}" userInput="$25.00" stepKey="checkOrderTotalInStorefront"/> + </test> +</tests> diff --git a/app/code/Magento/Captcha/Test/Unit/Model/Filter/CaptchaConfigPostProcessorCompositeTest.php b/app/code/Magento/Captcha/Test/Unit/Model/Filter/CaptchaConfigPostProcessorCompositeTest.php new file mode 100644 index 000000000000..8928857ddfbb --- /dev/null +++ b/app/code/Magento/Captcha/Test/Unit/Model/Filter/CaptchaConfigPostProcessorCompositeTest.php @@ -0,0 +1,87 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Captcha\Test\Unit\Model\Filter; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; +use Magento\Captcha\Api\CaptchaConfigPostProcessorInterface; +use Magento\Captcha\Model\Filter\CaptchaConfigPostProcessorComposite; +use PHPUnit\Framework\MockObject\MockObject; + +/** + * Test for Class \Magento\Captcha\Model\Filter\CaptchaConfigPostProcessorComposite + */ +class CaptchaConfigPostProcessorCompositeTest extends TestCase +{ + /** + * @var CaptchaConfigPostProcessorComposite + */ + private $model; + + /** + * @var ObjectManager + */ + private $objectManager; + + /** + * @var MockObject + */ + private $processorMock1; + + /** + * @var MockObject + */ + private $processorMock2; + + /** + * Initialize Class Dependencies + */ + protected function setUp(): void + { + $this->objectManager = new ObjectManager($this); + + $this->processorMock1 = $this->getMockBuilder(CaptchaConfigPostProcessorInterface::class) + ->disableOriginalConstructor() + ->setMethods(['process']) + ->getMock(); + $this->processorMock2 = $this->getMockBuilder(CaptchaConfigPostProcessorInterface::class) + ->disableOriginalConstructor() + ->setMethods(['process']) + ->getMock(); + + $processors = [$this->processorMock1, $this->processorMock2]; + + $this->model = $this->objectManager->getObject( + CaptchaConfigPostProcessorComposite::class, + [ + 'processors' => $processors, + ] + ); + } + + /** + * Test for Composite + * + * @return void + */ + public function testProcess(): void + { + $config = ['test1','test2', 'test3']; + + $this->processorMock1->expects($this->atLeastOnce()) + ->method('process') + ->with($config) + ->willReturn(['test1', 'test2']); + $this->processorMock2->expects($this->atLeastOnce()) + ->method('process') + ->with($config) + ->willReturn(['test3']); + + $this->assertEquals(['test1','test2', 'test3'], $this->model->process($config)); + } +} diff --git a/app/code/Magento/Captcha/Test/Unit/Model/Filter/QuoteDataConfigFilterTest.php b/app/code/Magento/Captcha/Test/Unit/Model/Filter/QuoteDataConfigFilterTest.php new file mode 100644 index 000000000000..855a52ab5b83 --- /dev/null +++ b/app/code/Magento/Captcha/Test/Unit/Model/Filter/QuoteDataConfigFilterTest.php @@ -0,0 +1,70 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Captcha\Test\Unit\Model\Filter; + +use Magento\Captcha\Model\Filter\QuoteDataConfigFilter; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; + +/** + * Test for Class \Magento\Captcha\Model\Filter\QuoteDataConfigFilter + */ +class QuoteDataConfigFilterTest extends TestCase +{ + + /** + * @var QuoteDataConfigFilter + */ + private $model; + + /** + * @var ObjectManager + */ + private $objectManager; + + /** + * Initialize Class Dependencies + */ + protected function setUp(): void + { + $this->objectManager = new ObjectManager($this); + + $this->model = $this->objectManager->getObject( + QuoteDataConfigFilter::class, + [ + 'filterList' => ['test1', 'test2'], + ] + ); + } + + /** + * Test Process method + * + * @return void + */ + public function testProcess(): void + { + $config = [ + 'quoteData' => + [ + 'test1' => 1, + 'test2' => 2, + 'test3' => 3 + ] + ]; + + $expected = [ + 'quoteData' => + [ + 'test3' => 3 + ] + ]; + + $this->assertEquals($expected, $this->model->process($config)); + } +} diff --git a/app/code/Magento/Captcha/Test/Unit/Plugin/ResetPaymentAttemptsAfterOrderIsPlacedPluginTest.php b/app/code/Magento/Captcha/Test/Unit/Plugin/ResetPaymentAttemptsAfterOrderIsPlacedPluginTest.php new file mode 100644 index 000000000000..b36063f6ab05 --- /dev/null +++ b/app/code/Magento/Captcha/Test/Unit/Plugin/ResetPaymentAttemptsAfterOrderIsPlacedPluginTest.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Captcha\Test\Unit\Plugin; + +use Magento\Captcha\Model\ResourceModel\Log; +use Magento\Captcha\Model\ResourceModel\LogFactory; +use Magento\Captcha\Plugin\ResetPaymentAttemptsAfterOrderIsPlacedPlugin; +use Magento\Captcha\Helper\Data as HelperCaptcha; +use Magento\Captcha\Model\DefaultModel; +use Magento\Sales\Api\Data\OrderInterface; +use Magento\Sales\Api\OrderManagementInterface; +use PHPUnit\Framework\TestCase; + +/** + * Unit test for ResetPaymentAttemptsAfterOrderIsPlacedPluginTest + */ +class ResetPaymentAttemptsAfterOrderIsPlacedPluginTest extends TestCase +{ + /** + * Test that the method resets attempts for frontend checkout + */ + public function testExecuteExpectsDeleteUserAttemptsCalled() + { + $orderManagementInterfaceMock = $this->getMockForAbstractClass(OrderManagementInterface::class); + $resultOrderMock = $this->createMock(OrderInterface::class); + $orderMock = $this->createMock(OrderInterface::class); + $orderMock->expects($this->once())->method('getCustomerEmail')->willReturn('email@example.com'); + $captchaModelMock = $this->createMock(DefaultModel::class); + $captchaModelMock->expects($this->once())->method('setShowCaptchaInSession')->with(false)->willReturnSelf(); + $helperCaptchaMock = $this->createMock(HelperCaptcha::class); + $helperCaptchaMock->expects($this->once())->method('getCaptcha')->willReturn($captchaModelMock); + $logMock = $this->createMock(Log::class); + $logMock->expects($this->once())->method('deleteUserAttempts')->willReturnSelf(); + $resLogFactoryMock = $this->createMock(LogFactory::class); + $resLogFactoryMock->expects($this->once())->method('create')->willReturn($logMock); + $observer = new ResetPaymentAttemptsAfterOrderIsPlacedPlugin($helperCaptchaMock, $resLogFactoryMock); + $observer->afterPlace($orderManagementInterfaceMock, $resultOrderMock, $orderMock); + } +} diff --git a/app/code/Magento/Captcha/composer.json b/app/code/Magento/Captcha/composer.json index 3c3aa58c3fe2..5bab62d51546 100644 --- a/app/code/Magento/Captcha/composer.json +++ b/app/code/Magento/Captcha/composer.json @@ -10,11 +10,12 @@ "magento/module-backend": "*", "magento/module-checkout": "*", "magento/module-customer": "*", + "magento/module-sales": "*", "magento/module-store": "*", "magento/module-authorization": "*", - "laminas/laminas-captcha": "^2.7.1", + "laminas/laminas-captcha": "^2.10", "laminas/laminas-db": "^2.8.2", - "laminas/laminas-session": "^2.7.3" + "laminas/laminas-session": "^2.10" }, "type": "magento2-module", "license": [ diff --git a/app/code/Magento/Captcha/etc/di.xml b/app/code/Magento/Captcha/etc/di.xml index 83c4e8aa1e2c..5162f13f0a14 100644 --- a/app/code/Magento/Captcha/etc/di.xml +++ b/app/code/Magento/Captcha/etc/di.xml @@ -6,6 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> + <preference for="Magento\Captcha\Api\CaptchaConfigPostProcessorInterface" type="Magento\Captcha\Model\Filter\CaptchaConfigPostProcessorComposite"/> <type name="Magento\Captcha\Model\DefaultModel"> <arguments> <argument name="session" xsi:type="object">Magento\Customer\Model\Session</argument> @@ -39,4 +40,19 @@ <type name="Magento\Checkout\Block\Cart\Sidebar"> <plugin name="login_captcha" type="Magento\Captcha\Model\Cart\ConfigPlugin" sortOrder="50" /> </type> + <type name="Magento\Captcha\Model\Filter\CaptchaConfigPostProcessorComposite"> + <arguments> + <argument name="processors" xsi:type="array"> + <item name="processor" xsi:type="object">Magento\Captcha\Model\Filter\QuoteDataConfigFilter</item> + </argument> + </arguments> + </type> + <type name="Magento\Captcha\Model\Filter\QuoteDataConfigFilter"> + <arguments> + <argument name="filterList" xsi:type="array"> + <item name="remote_ip" xsi:type="string">remote_ip</item> + <item name="x_forwarded_for" xsi:type="string">x_forwarded_for</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Captcha/etc/frontend/di.xml b/app/code/Magento/Captcha/etc/frontend/di.xml index 490f1eab8519..6ecbb156b44f 100644 --- a/app/code/Magento/Captcha/etc/frontend/di.xml +++ b/app/code/Magento/Captcha/etc/frontend/di.xml @@ -34,4 +34,7 @@ </argument> </arguments> </type> + <type name="Magento\Sales\Api\OrderManagementInterface"> + <plugin name="reset_payment_attempts_after_order_is_placed_plugin" type="Magento\Captcha\Plugin\ResetPaymentAttemptsAfterOrderIsPlacedPlugin"/> + </type> </config> diff --git a/app/code/Magento/Captcha/etc/frontend/sections.xml b/app/code/Magento/Captcha/etc/frontend/sections.xml index 7f2070e10c8a..665d989e2294 100644 --- a/app/code/Magento/Captcha/etc/frontend/sections.xml +++ b/app/code/Magento/Captcha/etc/frontend/sections.xml @@ -10,4 +10,10 @@ <action name="customer/ajax/login"> <section name="captcha"/> </action> + <action name="rest/*/V1/carts/*/payment-information"> + <section name="captcha"/> + </action> + <action name="rest/*/V1/guest-carts/*/payment-information"> + <section name="captcha"/> + </action> </config> diff --git a/app/code/Magento/Captcha/etc/module.xml b/app/code/Magento/Captcha/etc/module.xml index 36a44a654306..7a7ffc7f460f 100644 --- a/app/code/Magento/Captcha/etc/module.xml +++ b/app/code/Magento/Captcha/etc/module.xml @@ -10,6 +10,7 @@ <sequence> <module name="Magento_Customer"/> <module name="Magento_Checkout"/> + <module name="Magento_Sales"/> </sequence> </module> </config> diff --git a/app/code/Magento/Captcha/etc/webapi_rest/di.xml b/app/code/Magento/Captcha/etc/webapi_rest/di.xml new file mode 100644 index 000000000000..7c5efea56a40 --- /dev/null +++ b/app/code/Magento/Captcha/etc/webapi_rest/di.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> + <type name="Magento\Sales\Api\OrderManagementInterface"> + <plugin name="reset_payment_attempts_after_order_is_placed_plugin" type="Magento\Captcha\Plugin\ResetPaymentAttemptsAfterOrderIsPlacedPlugin"/> + </type> +</config> diff --git a/app/code/Magento/Captcha/view/adminhtml/templates/default.phtml b/app/code/Magento/Captcha/view/adminhtml/templates/default.phtml index e73174d3768d..6336061335d0 100644 --- a/app/code/Magento/Captcha/view/adminhtml/templates/default.phtml +++ b/app/code/Magento/Captcha/view/adminhtml/templates/default.phtml @@ -9,8 +9,10 @@ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ $captcha = $block->getCaptchaModel(); +/** @var bool $validationEnabled */ +$validationEnabled = $block->hasData('frontend_validation') ? $block->getData('frontend_validation') : true; ?> -<div class="admin__field _required"> +<div class="admin__field<?php if ($validationEnabled): ?> _required<?php endif; ?>"> <label for="captcha" class="admin__field-label"> <span><?= $block->escapeHtml(__('Please enter the letters and numbers from the image')) ?></span> </label> @@ -21,7 +23,7 @@ $captcha = $block->getCaptchaModel(); type="text" name="<?= $block->escapeHtmlAttr(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE) ?>[<?= $block->escapeHtml($block->getFormId()) ?>]" - data-validate="{required:true}"/> + <?php if ($validationEnabled): ?>data-validate="{required:true}"<?php endif; ?>/> <?php if ($captcha->isCaseSensitive()):?> <div class="admin__field-note"> <span><?= $block->escapeHtml(__('<strong>Attention</strong>: Captcha is case sensitive.'), ['strong']) diff --git a/app/code/Magento/Captcha/view/frontend/templates/default.phtml b/app/code/Magento/Captcha/view/frontend/templates/default.phtml index ead8c590eee9..0d436cc62b79 100644 --- a/app/code/Magento/Captcha/view/frontend/templates/default.phtml +++ b/app/code/Magento/Captcha/view/frontend/templates/default.phtml @@ -8,27 +8,46 @@ /** @var \Magento\Captcha\Model\DefaultModel $captcha */ $captcha = $block->getCaptchaModel(); +/** @var bool $validationEnabled */ +$validationEnabled = $block->hasData('frontend_validation') ? $block->getData('frontend_validation') : true; +$inputName = $block->escapeHtmlAttr(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE); +$loaderUrl = $block->escapeUrl($block->getViewFileUrl('images/loader-2.gif')); +$note = $block->escapeHtml(__('<strong>Attention</strong>: Captcha is case sensitive.'), ['strong']); ?> -<div class="field captcha required" role="<?= $block->escapeHtmlAttr($block->getFormId()) ?>"> - <label for="captcha_<?= $block->escapeHtmlAttr($block->getFormId()) ?>" class="label"><span><?= $block->escapeHtml(__('Please type the letters and numbers below')) ?></span></label> +<div class="field captcha<?php if ($validationEnabled): ?> required<?php endif; ?>" + role="<?= $block->escapeHtmlAttr($block->getFormId()) ?>"> + <label for="captcha_<?= $block->escapeHtmlAttr($block->getFormId()) ?>" class="label"> + <span><?= $block->escapeHtml(__('Please type the letters and numbers below')) ?></span> + </label> <div class="control captcha"> - <input name="<?= $block->escapeHtmlAttr(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE) ?>[<?= $block->escapeHtmlAttr($block->getFormId()) ?>]" type="text" class="input-text required-entry" data-validate="{required:true}" id="captcha_<?= $block->escapeHtmlAttr($block->getFormId()) ?>" autocomplete="off"/> + <input + name="<?= /* @noEscape */ $inputName ?>[<?= $block->escapeHtmlAttr($block->getFormId()) ?>]" + type="text" + class="input-text<?php if ($validationEnabled): ?> required-entry<?php endif; ?>" + <?php if ($validationEnabled): ?>data-validate="{required:true}"<?php endif; ?> + id="captcha_<?= $block->escapeHtmlAttr($block->getFormId()) ?>" + autocomplete="off"/> <div class="nested"> <div class="field captcha no-label" data-captcha="<?= $block->escapeHtmlAttr($block->getFormId()) ?>" id="captcha-container-<?= $block->escapeHtmlAttr($block->getFormId()) ?>" data-mage-init='{"captcha":{"url": "<?= $block->escapeUrl($block->getRefreshUrl()) ?>", - "imageLoader": "<?= $block->escapeUrl($block->getViewFileUrl('images/loader-2.gif')) ?>", + "imageLoader": "<?= /* @noEscape */ $loaderUrl ?>", "type": "<?= $block->escapeHtmlAttr($block->getFormId()) ?>"}}'> <div class="control captcha-image"> - <img alt="<?= $block->escapeHtmlAttr(__('Please type the letters and numbers below')) ?>" class="captcha-img" height="<?= /* @noEscape */ (float) $block->getImgHeight() ?>" src="<?= $block->escapeUrl($captcha->getImgSrc()) ?>"/> - <button type="button" class="action reload captcha-reload" title="<?= $block->escapeHtmlAttr(__('Reload captcha')) ?>"><span><?= $block->escapeHtml(__('Reload captcha')) ?></span></button> + <img alt="<?= $block->escapeHtmlAttr(__('Please type the letters and numbers below')) ?>" + class="captcha-img" + height="<?= /* @noEscape */ (float) $block->getImgHeight() ?>" + src="<?= $block->escapeUrl($captcha->getImgSrc()) ?>"/> + <button type="button" + class="action reload captcha-reload" + title="<?= $block->escapeHtmlAttr(__('Reload captcha')) ?>"> + <span><?= $block->escapeHtml(__('Reload captcha')) ?></span> + </button> </div> </div> - <?php if ($captcha->isCaseSensitive()) :?> - <div class="captcha-note note"> - <?= $block->escapeHtml(__('<strong>Attention</strong>: Captcha is case sensitive.'), ['strong']) ?> - </div> + <?php if ($captcha->isCaseSensitive()):?> + <div class="captcha-note note"><?= /* @noEscape */ $note ?></div> <?php endif; ?> </div> </div> diff --git a/app/code/Magento/Captcha/view/frontend/web/js/action/refresh.js b/app/code/Magento/Captcha/view/frontend/web/js/action/refresh.js index c82278269ade..030a990ce2a8 100644 --- a/app/code/Magento/Captcha/view/frontend/web/js/action/refresh.js +++ b/app/code/Magento/Captcha/view/frontend/web/js/action/refresh.js @@ -4,18 +4,21 @@ */ define([ - 'mage/storage' -], function (storage) { + 'jquery', 'mage/url' +], function ($, urlBuilder) { 'use strict'; return function (refreshUrl, formId, imageSource) { - return storage.post( - refreshUrl, - JSON.stringify({ + return $.ajax({ + url: urlBuilder.build(refreshUrl), + type: 'POST', + async: false, + data: JSON.stringify({ 'formId': formId }), - false - ).done( + global: false, + contentType: 'application/json' + }).done( function (response) { if (response.imgSrc) { imageSource(response.imgSrc); diff --git a/app/code/Magento/Captcha/view/frontend/web/js/view/checkout/defaultCaptcha.js b/app/code/Magento/Captcha/view/frontend/web/js/view/checkout/defaultCaptcha.js index d79c42a71156..55f3782e78f7 100644 --- a/app/code/Magento/Captcha/view/frontend/web/js/view/checkout/defaultCaptcha.js +++ b/app/code/Magento/Captcha/view/frontend/web/js/view/checkout/defaultCaptcha.js @@ -21,6 +21,7 @@ define([ }, dataScope: 'global', currentCaptcha: null, + subscribedFormIds: [], /** * @return {*} @@ -56,7 +57,7 @@ define([ */ checkCustomerData: function (formId, captchaData, captcha) { if (!_.isEmpty(captchaData) && - !_.isEmpty(captchaData)[formId] && + !_.isEmpty(captchaData[formId]) && captchaData[formId].timestamp > captcha.timestamp ) { if (!captcha.isRequired() && captchaData[formId].isRequired) { @@ -74,9 +75,12 @@ define([ * @param {Object} captcha */ subscribeCustomerData: function (formId, captcha) { - customerData.get('captcha').subscribe(function (captchaData) { - this.checkCustomerData(formId, captchaData, captcha); - }.bind(this)); + if (this.subscribedFormIds.includes(formId) === false) { + this.subscribedFormIds.push(formId); + customerData.get('captcha').subscribe(function (captchaData) { + this.checkCustomerData(formId, captchaData, captcha); + }.bind(this)); + } }, /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php index 89239a2e3e60..35f30ed8d3d6 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php @@ -61,7 +61,7 @@ public function __construct( \Magento\Framework\Data\FormFactory $formFactory, Yesno $yesNo, Data $eavData, - array $disableScopeChangeList = ['sku'], + array $disableScopeChangeList = [], array $data = [] ) { $this->_yesNo = $yesNo; diff --git a/app/code/Magento/Catalog/Block/Navigation.php b/app/code/Magento/Catalog/Block/Navigation.php index 1d4ad5a03619..be42f9df4965 100644 --- a/app/code/Magento/Catalog/Block/Navigation.php +++ b/app/code/Magento/Catalog/Block/Navigation.php @@ -152,6 +152,8 @@ public function getCacheKeyInfo() $shortCacheId = array_values($shortCacheId); $shortCacheId = implode('|', $shortCacheId); + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $shortCacheId = md5($shortCacheId); $cacheId['category_path'] = $this->getCurrentCategoryKey(); diff --git a/app/code/Magento/Catalog/Block/Product/ImageFactory.php b/app/code/Magento/Catalog/Block/Product/ImageFactory.php index d43a77695e36..1126429a7f9f 100644 --- a/app/code/Magento/Catalog/Block/Product/ImageFactory.php +++ b/app/code/Magento/Catalog/Block/Product/ImageFactory.php @@ -165,7 +165,7 @@ public function create(Product $product, string $imageId, array $attributes = nu 'image_url' => $imageAsset->getUrl(), 'width' => $imageMiscParams['image_width'], 'height' => $imageMiscParams['image_height'], - 'label' => $this->getLabel($product, $imageMiscParams['image_type']), + 'label' => $this->getLabel($product, $imageMiscParams['image_type'] ?? ''), 'ratio' => $this->getRatio($imageMiscParams['image_width'] ?? 0, $imageMiscParams['image_height'] ?? 0), 'custom_attributes' => $this->filterCustomAttributes($attributes), 'class' => $this->getClass($attributes), diff --git a/app/code/Magento/Catalog/Block/Product/ListProduct.php b/app/code/Magento/Catalog/Block/Product/ListProduct.php index b181a5392905..5b8cb6a19199 100644 --- a/app/code/Magento/Catalog/Block/Product/ListProduct.php +++ b/app/code/Magento/Catalog/Block/Product/ListProduct.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Catalog\Block\Product; @@ -141,14 +142,7 @@ public function getLayer() */ public function getLoadedProductCollection() { - $collection = $this->_getProductCollection(); - - $categoryId = $this->getLayer()->getCurrentCategory()->getId(); - foreach ($collection as $product) { - $product->setData('category_id', $categoryId); - } - - return $collection; + return $this->_getProductCollection(); } /** @@ -205,6 +199,14 @@ protected function _beforeToHtml() $collection->load(); } + $categoryId = $this->getLayer()->getCurrentCategory()->getId(); + + if ($categoryId) { + foreach ($collection as $product) { + $product->setData('category_id', $categoryId); + } + } + return parent::_beforeToHtml(); } @@ -461,7 +463,7 @@ private function initializeProductCollection() // if the product is associated with any category if ($categories->count()) { // show products from this category - $this->setCategoryId(current($categories->getIterator())->getId()); + $this->setCategoryId($categories->getIterator()->current()->getId()); } } diff --git a/app/code/Magento/Catalog/Block/Product/View.php b/app/code/Magento/Catalog/Block/Product/View.php index 6cc565235215..e24b3d881bdf 100644 --- a/app/code/Magento/Catalog/Block/Product/View.php +++ b/app/code/Magento/Catalog/Block/Product/View.php @@ -177,21 +177,26 @@ public function getJsonConfig() { /* @var $product \Magento\Catalog\Model\Product */ $product = $this->getProduct(); + $tierPrices = []; + $priceInfo = $product->getPriceInfo(); + $tierPricesList = $priceInfo->getPrice('tier_price')->getTierPriceList(); + foreach ($tierPricesList as $tierPrice) { + $tierPriceData = [ + 'qty' => $tierPrice['price_qty'], + 'price' => $tierPrice['website_price'], + ]; + $tierPrices[] = $tierPriceData; + } if (!$this->hasOptions()) { $config = [ 'productId' => $product->getId(), - 'priceFormat' => $this->_localeFormat->getPriceFormat() + 'priceFormat' => $this->_localeFormat->getPriceFormat(), + 'tierPrices' => $tierPrices ]; return $this->_jsonEncoder->encode($config); } - $tierPrices = []; - $priceInfo = $product->getPriceInfo(); - $tierPricesList = $priceInfo->getPrice('tier_price')->getTierPriceList(); - foreach ($tierPricesList as $tierPrice) { - $tierPrices[] = $tierPrice['price']->getValue() * 1; - } $config = [ 'productId' => (int)$product->getId(), 'priceFormat' => $this->_localeFormat->getPriceFormat(), diff --git a/app/code/Magento/Catalog/Block/Product/View/Options.php b/app/code/Magento/Catalog/Block/Product/View/Options.php index c457b20cd090..26c6bab80992 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options.php @@ -60,6 +60,11 @@ class Options extends \Magento\Framework\View\Element\Template */ protected $_catalogData; + /** + * @var \Magento\Framework\Stdlib\ArrayUtils + */ + private $arrayUtils; + /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Framework\Pricing\Helper\Data $pricingHelper @@ -93,7 +98,7 @@ public function __construct( * Retrieve product object * * @return Product - * @throws \LogicExceptions + * @throws \LogicException */ public function getProduct() { diff --git a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php index af921959f8e2..0f8c978de649 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php @@ -168,7 +168,10 @@ public function getTimeHtml() $dayPartHtml = $this->_getHtmlSelect( 'day_part' )->setOptions( - ['am' => __('AM'), 'pm' => __('PM')] + [ + 'am' => $this->escapeHtml(__('AM')), + 'pm' => $this->escapeHtml(__('PM')) + ] )->getHtml(); } $hoursHtml = $this->_getSelectFromToHtml('hour', $hourStart, $hourEnd); diff --git a/app/code/Magento/Catalog/Block/Ui/ProductViewCounter.php b/app/code/Magento/Catalog/Block/Ui/ProductViewCounter.php index c5c08a0552f4..93732b1b52f0 100644 --- a/app/code/Magento/Catalog/Block/Ui/ProductViewCounter.php +++ b/app/code/Magento/Catalog/Block/Ui/ProductViewCounter.php @@ -153,6 +153,7 @@ public function getCurrentProductData() $this->productRenderCollectorComposite ->collect($product, $productRender); $data = $this->hydrator->extract($productRender); + $data['is_available'] = $product->isAvailable(); $currentProductData = [ 'items' => [ diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute/Save.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute/Save.php index 3651a9bc6ade..f71058a71519 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute/Save.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute/Save.php @@ -7,6 +7,7 @@ namespace Magento\Catalog\Controller\Adminhtml\Product\Action\Attribute; use Magento\AsynchronousOperations\Api\Data\OperationInterface; +use Magento\Catalog\Model\Product\Filter\DateTime as DateTimeFilter; use Magento\Catalog\Model\ProductFactory; use Magento\Catalog\Api\Data\ProductAttributeInterface; use Magento\Eav\Model\Config; @@ -14,6 +15,7 @@ use Magento\Backend\App\Action; use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Stdlib\DateTime; use Magento\Framework\Stdlib\DateTime\TimezoneInterface; /** @@ -67,6 +69,11 @@ class Save extends \Magento\Catalog\Controller\Adminhtml\Product\Action\Attribut */ private $productFactory; + /** + * @var DateTimeFilter + */ + private $dateTimeFilter; + /** * @param Action\Context $context * @param \Magento\Catalog\Helper\Product\Edit\Action\Attribute $attributeHelper @@ -76,9 +83,10 @@ class Save extends \Magento\Catalog\Controller\Adminhtml\Product\Action\Attribut * @param \Magento\Framework\Serialize\SerializerInterface $serializer * @param \Magento\Authorization\Model\UserContextInterface $userContext * @param int $bulkSize - * @param TimezoneInterface $timezone - * @param Config $eavConfig - * @param ProductFactory $productFactory + * @param TimezoneInterface|null $timezone + * @param Config|null $eavConfig + * @param ProductFactory|null $productFactory + * @param DateTimeFilter|null $dateTimeFilter * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -92,7 +100,8 @@ public function __construct( int $bulkSize = 100, TimezoneInterface $timezone = null, Config $eavConfig = null, - ProductFactory $productFactory = null + ProductFactory $productFactory = null, + ?DateTimeFilter $dateTimeFilter = null ) { parent::__construct($context, $attributeHelper); $this->bulkManagement = $bulkManagement; @@ -106,6 +115,7 @@ public function __construct( $this->eavConfig = $eavConfig ?: ObjectManager::getInstance() ->get(Config::class); $this->productFactory = $productFactory ?? ObjectManager::getInstance()->get(ProductFactory::class); + $this->dateTimeFilter = $dateTimeFilter ?? ObjectManager::getInstance()->get(DateTimeFilter::class); } /** @@ -155,8 +165,6 @@ public function execute() */ private function sanitizeProductAttributes($attributesData) { - $dateFormat = $this->timezone->getDateFormat(\IntlDateFormatter::SHORT); - foreach ($attributesData as $attributeCode => $value) { if ($attributeCode === ProductAttributeInterface::CODE_HAS_WEIGHT) { continue; @@ -170,16 +178,10 @@ private function sanitizeProductAttributes($attributesData) } if ($attribute->getBackendType() === 'datetime') { - if (!empty($value)) { - $filterInput = new \Zend_Filter_LocalizedToNormalized(['date_format' => $dateFormat]); - $filterInternal = new \Zend_Filter_NormalizedToLocalized( - ['date_format' => \Magento\Framework\Stdlib\DateTime::DATE_INTERNAL_FORMAT] - ); - $value = $filterInternal->filter($filterInput->filter($value)); - } else { - $value = null; - } - $attributesData[$attributeCode] = $value; + $attributesData[$attributeCode] = $this->filterDate( + $value, + $attribute->getFrontendInput() === 'datetime' + ); } elseif ($attribute->getFrontendInput() === 'multiselect') { // Check if 'Change' checkbox has been checked by admin for this attribute $isChanged = (bool)$this->getRequest()->getPost('toggle_' . $attributeCode); @@ -196,6 +198,24 @@ private function sanitizeProductAttributes($attributesData) return $attributesData; } + /** + * Get the date and time value in internal format and timezone + * + * @param string $value + * @param bool $isDatetime + * @return string|null + * @throws LocalizedException + */ + private function filterDate(string $value, bool $isDatetime = false): ?string + { + $date = !empty($value) ? $this->dateTimeFilter->filter($value) : null; + if ($date && $isDatetime) { + $date = $this->timezone->convertConfigTimeToUtc($date, DateTime::DATETIME_PHP_FORMAT); + } + + return $date; + } + /** * Validate product attributes data. * diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php index d5fed1782bc6..7a6b71db9dde 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php @@ -126,6 +126,8 @@ protected function generateCode($label) ); $validatorAttrCode = new \Zend_Validate_Regex(['pattern' => '/^[a-z][a-z_0-9]{0,29}[a-z0-9]$/']); if (!$validatorAttrCode->isValid($code)) { + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $code = 'attr_' . ($code ?: substr(md5(time()), 0, 8)); } return $code; diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php index 4ca9d4b0d060..440716e45691 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php @@ -185,6 +185,9 @@ public function execute() } $attributeId = $this->getRequest()->getParam('attribute_id'); + if (!empty($data['attribute_id']) && $data['attribute_id'] != $attributeId) { + $attributeId = $data['attribute_id']; + } /** @var ProductAttributeInterface $model */ $model = $this->attributeFactory->create(); diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilter.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilter.php index 1d6939acacfd..81ab67bdf26d 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilter.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilter.php @@ -102,6 +102,6 @@ private function isAttributeShouldNotBeUpdated(Product $product, array $useDefau { $considerUseDefaultsAttribute = !isset($useDefaults[$attribute]) || $useDefaults[$attribute] === '1'; - return ($value === '' && $considerUseDefaultsAttribute && !$product->getData($attribute)); + return ($value === '' && $considerUseDefaultsAttribute && ($product->getData($attribute) === null)); } } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/MassDelete.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/MassDelete.php index c779c01cd7d7..0edd43923060 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/MassDelete.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/MassDelete.php @@ -9,9 +9,12 @@ namespace Magento\Catalog\Controller\Adminhtml\Product; use Magento\Backend\App\Action\Context; +use Magento\Backend\Model\View\Result\Redirect; use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Controller\Adminhtml\Product; use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Controller\ResultFactory; use Magento\Framework\Exception\LocalizedException; use Magento\Ui\Component\MassAction\Filter; @@ -20,7 +23,7 @@ /** * Class \Magento\Catalog\Controller\Adminhtml\Product\MassDelete */ -class MassDelete extends \Magento\Catalog\Controller\Adminhtml\Product implements HttpPostActionInterface +class MassDelete extends Product implements HttpPostActionInterface { /** * Massactions filter @@ -49,8 +52,8 @@ class MassDelete extends \Magento\Catalog\Controller\Adminhtml\Product implement * @param Builder $productBuilder * @param Filter $filter * @param CollectionFactory $collectionFactory - * @param ProductRepositoryInterface $productRepository - * @param LoggerInterface $logger + * @param ProductRepositoryInterface|null $productRepository + * @param LoggerInterface|null $logger */ public function __construct( Context $context, @@ -63,20 +66,23 @@ public function __construct( $this->filter = $filter; $this->collectionFactory = $collectionFactory; $this->productRepository = $productRepository ?: - \Magento\Framework\App\ObjectManager::getInstance()->create(ProductRepositoryInterface::class); + ObjectManager::getInstance()->create(ProductRepositoryInterface::class); $this->logger = $logger ?: - \Magento\Framework\App\ObjectManager::getInstance()->create(LoggerInterface::class); + ObjectManager::getInstance()->create(LoggerInterface::class); parent::__construct($context, $productBuilder); } /** * Mass Delete Action * - * @return \Magento\Backend\Model\View\Result\Redirect + * @return Redirect + * @throws LocalizedException */ public function execute() { $collection = $this->filter->getCollection($this->collectionFactory->create()); + $collection->addMediaGalleryData(); + $productDeleted = 0; $productDeletedError = 0; /** @var \Magento\Catalog\Model\Product $product */ diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Validate.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Validate.php index 77c9cfcd40f0..035b50f3ada5 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Validate.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Validate.php @@ -12,6 +12,9 @@ use Magento\Catalog\Controller\Adminhtml\Product; use Magento\Framework\App\ObjectManager; use Magento\Store\Model\StoreManagerInterface; +use Magento\UrlRewrite\Model\Exception\UrlAlreadyExistsException; +use Magento\CatalogUrlRewrite\Model\Product\Validator as ProductUrlRewriteValidator; +use Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator; /** * Product validate @@ -57,6 +60,16 @@ class Validate extends Product implements HttpPostActionInterface, HttpGetAction */ private $storeManager; + /** + * @var ProductUrlPathGenerator + */ + private $productUrlPathGenerator; + + /** + * @var ProductUrlRewriteValidator + */ + private $productUrlRewriteValidator; + /** * @param Action\Context $context * @param Builder $productBuilder @@ -65,6 +78,8 @@ class Validate extends Product implements HttpPostActionInterface, HttpGetAction * @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory * @param \Magento\Framework\View\LayoutFactory $layoutFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param ProductUrlRewriteValidator $productUrlRewriteValidator + * @param ProductUrlPathGenerator $productUrlPathGenerator */ public function __construct( \Magento\Backend\App\Action\Context $context, @@ -73,7 +88,9 @@ public function __construct( \Magento\Catalog\Model\Product\Validator $productValidator, \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory, \Magento\Framework\View\LayoutFactory $layoutFactory, - \Magento\Catalog\Model\ProductFactory $productFactory + \Magento\Catalog\Model\ProductFactory $productFactory, + ProductUrlRewriteValidator $productUrlRewriteValidator, + ProductUrlPathGenerator $productUrlPathGenerator ) { $this->_dateFilter = $dateFilter; $this->productValidator = $productValidator; @@ -81,6 +98,8 @@ public function __construct( $this->resultJsonFactory = $resultJsonFactory; $this->layoutFactory = $layoutFactory; $this->productFactory = $productFactory; + $this->productUrlRewriteValidator = $productUrlRewriteValidator; + $this->productUrlPathGenerator = $productUrlPathGenerator; } /** @@ -130,11 +149,22 @@ public function execute() $resource->getAttribute('news_from_date')->setMaxValue($product->getNewsToDate()); $resource->getAttribute('custom_design_from')->setMaxValue($product->getCustomDesignTo()); + if (!$product->getUrlKey()) { + $urlKey = $this->productUrlPathGenerator->getUrlKey($product); + $product->setUrlKey($urlKey); + } + $this->productUrlRewriteValidator->validateUrlKeyConflicts($product); $this->productValidator->validate($product, $this->getRequest(), $response); } catch (\Magento\Eav\Model\Entity\Attribute\Exception $e) { $response->setError(true); $response->setAttribute($e->getAttributeCode()); $response->setMessages([$e->getMessage()]); + } catch (UrlAlreadyExistsException $e) { + $this->messageManager->addExceptionMessage($e); + $layout = $this->layoutFactory->create(); + $layout->initMessages(); + $response->setError(true); + $response->setHtmlMessage($layout->getMessagesBlock()->getGroupedHtml()); } catch (\Magento\Framework\Exception\LocalizedException $e) { $response->setError(true); $response->setMessages([$e->getMessage()]); diff --git a/app/code/Magento/Catalog/Controller/Product/View.php b/app/code/Magento/Catalog/Controller/Product/View.php index 570b8f541b76..07c94658643d 100644 --- a/app/code/Magento/Catalog/Controller/Product/View.php +++ b/app/code/Magento/Catalog/Controller/Product/View.php @@ -5,12 +5,22 @@ */ namespace Magento\Catalog\Controller\Product; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Design; use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface; use Magento\Framework\App\Action\Context; use Magento\Framework\App\ObjectManager; +use Magento\Framework\Controller\Result\Forward; +use Magento\Framework\Controller\Result\ForwardFactory; +use Magento\Framework\Controller\Result\Redirect; +use Magento\Framework\DataObject; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Json\Helper\Data; use Magento\Framework\View\Result\PageFactory; use Magento\Catalog\Controller\Product as ProductAction; +use Magento\Store\Model\StoreManagerInterface; +use Psr\Log\LoggerInterface; /** * View a product on storefront. Needs to be accessible by POST because of the store switching @@ -25,57 +35,84 @@ class View extends ProductAction implements HttpGetActionInterface, HttpPostActi protected $viewHelper; /** - * @var \Magento\Framework\Controller\Result\ForwardFactory + * @var ForwardFactory */ protected $resultForwardFactory; /** - * @var \Magento\Framework\View\Result\PageFactory + * @var PageFactory */ protected $resultPageFactory; /** - * @var \Psr\Log\LoggerInterface + * @var LoggerInterface */ private $logger; /** - * @var \Magento\Framework\Json\Helper\Data + * @var Data */ private $jsonHelper; + /** + * @var Design + */ + private $catalogDesign; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + /** * Constructor * * @param Context $context * @param \Magento\Catalog\Helper\Product\View $viewHelper - * @param \Magento\Framework\Controller\Result\ForwardFactory $resultForwardFactory + * @param ForwardFactory $resultForwardFactory * @param PageFactory $resultPageFactory - * @param \Psr\Log\LoggerInterface $logger - * @param \Magento\Framework\Json\Helper\Data $jsonHelper + * @param LoggerInterface|null $logger + * @param Data|null $jsonHelper + * @param Design|null $catalogDesign + * @param ProductRepositoryInterface|null $productRepository + * @param StoreManagerInterface|null $storeManager */ public function __construct( Context $context, \Magento\Catalog\Helper\Product\View $viewHelper, - \Magento\Framework\Controller\Result\ForwardFactory $resultForwardFactory, + ForwardFactory $resultForwardFactory, PageFactory $resultPageFactory, - \Psr\Log\LoggerInterface $logger = null, - \Magento\Framework\Json\Helper\Data $jsonHelper = null + ?LoggerInterface $logger = null, + ?Data $jsonHelper = null, + ?Design $catalogDesign = null, + ?ProductRepositoryInterface $productRepository = null, + ?StoreManagerInterface $storeManager = null ) { parent::__construct($context); $this->viewHelper = $viewHelper; $this->resultForwardFactory = $resultForwardFactory; $this->resultPageFactory = $resultPageFactory; $this->logger = $logger ?: ObjectManager::getInstance() - ->get(\Psr\Log\LoggerInterface::class); + ->get(LoggerInterface::class); $this->jsonHelper = $jsonHelper ?: ObjectManager::getInstance() - ->get(\Magento\Framework\Json\Helper\Data::class); + ->get(Data::class); + $this->catalogDesign = $catalogDesign ?: ObjectManager::getInstance() + ->get(Design::class); + $this->productRepository = $productRepository ?: ObjectManager::getInstance() + ->get(ProductRepositoryInterface::class); + $this->storeManager = $storeManager ?: ObjectManager::getInstance() + ->get(StoreManagerInterface::class); } /** * Redirect if product failed to load * - * @return \Magento\Framework\Controller\Result\Redirect|\Magento\Framework\Controller\Result\Forward + * @return Redirect|Forward */ protected function noProductRedirect() { @@ -93,7 +130,7 @@ protected function noProductRedirect() /** * Product view action * - * @return \Magento\Framework\Controller\Result\Forward|\Magento\Framework\Controller\Result\Redirect + * @return Forward|Redirect */ public function execute() { @@ -130,16 +167,17 @@ public function execute() } // Prepare helper and params - $params = new \Magento\Framework\DataObject(); + $params = new DataObject(); $params->setCategoryId($categoryId); $params->setSpecifyOptions($specifyOptions); // Render page try { + $this->applyCustomDesign($productId); $page = $this->resultPageFactory->create(); $this->viewHelper->prepareAndRender($page, $productId, $this, $params); return $page; - } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { + } catch (NoSuchEntityException $e) { return $this->noProductRedirect(); } catch (\Exception $e) { $this->logger->critical($e); @@ -148,4 +186,19 @@ public function execute() return $resultForward; } } + + /** + * Apply custom design from product design settings + * + * @param int $productId + * @throws NoSuchEntityException + */ + private function applyCustomDesign(int $productId): void + { + $product = $this->productRepository->getById($productId, false, $this->storeManager->getStore()->getId()); + $settings = $this->catalogDesign->getDesignSettings($product); + if ($settings->getCustomDesign()) { + $this->catalogDesign->applyCustomDesign($settings->getCustomDesign()); + } + } } diff --git a/app/code/Magento/Catalog/Model/Api/SearchCriteria/CollectionProcessor/ConditionProcessor/ConditionBuilder/EavAttributeCondition.php b/app/code/Magento/Catalog/Model/Api/SearchCriteria/CollectionProcessor/ConditionProcessor/ConditionBuilder/EavAttributeCondition.php index e296c8d3b897..438618d89b43 100644 --- a/app/code/Magento/Catalog/Model/Api/SearchCriteria/CollectionProcessor/ConditionProcessor/ConditionBuilder/EavAttributeCondition.php +++ b/app/code/Magento/Catalog/Model/Api/SearchCriteria/CollectionProcessor/ConditionProcessor/ConditionBuilder/EavAttributeCondition.php @@ -64,11 +64,11 @@ public function build(Filter $filter): string ->select() ->from( [Collection::MAIN_TABLE_ALIAS => $entityResourceModel->getEntityTable()], - Collection::MAIN_TABLE_ALIAS . '.' . $entityResourceModel->getEntityIdField() + Collection::MAIN_TABLE_ALIAS . '.' . $attribute->getEntityIdField() )->joinLeft( [$tableAlias => $attribute->getBackendTable()], $tableAlias . '.' . $attribute->getEntityIdField() . '=' . Collection::MAIN_TABLE_ALIAS . - '.' . $entityResourceModel->getEntityIdField() . ' AND ' . $tableAlias . '.' . + '.' . $attribute->getEntityIdField() . ' AND ' . $tableAlias . '.' . $attribute->getIdFieldName() . '=' . $attribute->getAttributeId(), '' )->where($tableAlias . '.value is null'); diff --git a/app/code/Magento/Catalog/Model/Attribute/Backend/Startdate.php b/app/code/Magento/Catalog/Model/Attribute/Backend/Startdate.php index fde99604e9ae..03e9fbb1e913 100644 --- a/app/code/Magento/Catalog/Model/Attribute/Backend/Startdate.php +++ b/app/code/Magento/Catalog/Model/Attribute/Backend/Startdate.php @@ -7,7 +7,7 @@ /** * - * Speical Start Date attribute backend + * Special Start Date attribute backend * * @api * @@ -83,7 +83,7 @@ public function validate($object) $attr = $this->getAttribute(); $maxDate = $attr->getMaxValue(); $startDate = $this->_getValueForSave($object); - if ($startDate === false) { + if ($startDate === false || $startDate === null) { return true; } diff --git a/app/code/Magento/Catalog/Model/Attribute/ScopeOverriddenValue.php b/app/code/Magento/Catalog/Model/Attribute/ScopeOverriddenValue.php index cf194615b1f3..e58383f7d9be 100644 --- a/app/code/Magento/Catalog/Model/Attribute/ScopeOverriddenValue.php +++ b/app/code/Magento/Catalog/Model/Attribute/ScopeOverriddenValue.php @@ -45,6 +45,11 @@ class ScopeOverriddenValue */ private $resourceConnection; + /** + * @var FilterBuilder + */ + private $filterBuilder; + /** * ScopeOverriddenValue constructor. * @param AttributeRepository $attributeRepository diff --git a/app/code/Magento/Catalog/Model/Category.php b/app/code/Magento/Catalog/Model/Category.php index 538a721d356d..981a3d81f0e7 100644 --- a/app/code/Magento/Catalog/Model/Category.php +++ b/app/code/Magento/Catalog/Model/Category.php @@ -1159,7 +1159,10 @@ public function reindex() */ public function afterDeleteCommit() { - $this->reindex(); + if ($this->getIsActive() || $this->getDeletedChildrenIds()) { + $this->reindex(); + } + return parent::afterDeleteCommit(); } diff --git a/app/code/Magento/Catalog/Model/Category/AttributeRepository.php b/app/code/Magento/Catalog/Model/Category/AttributeRepository.php index bde5e08d9099..3243bf718e66 100644 --- a/app/code/Magento/Catalog/Model/Category/AttributeRepository.php +++ b/app/code/Magento/Catalog/Model/Category/AttributeRepository.php @@ -24,6 +24,11 @@ class AttributeRepository implements CategoryAttributeRepositoryInterface */ protected $eavAttributeRepository; + /** + * @var \Magento\Eav\Model\Config + */ + private $eavConfig; + /** * @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder * @param \Magento\Framework\Api\FilterBuilder $filterBuilder diff --git a/app/code/Magento/Catalog/Model/Category/FileInfo.php b/app/code/Magento/Catalog/Model/Category/FileInfo.php index f5aec60b2fcc..adaf9304d8b3 100644 --- a/app/code/Magento/Catalog/Model/Category/FileInfo.php +++ b/app/code/Magento/Catalog/Model/Category/FileInfo.php @@ -5,12 +5,15 @@ */ namespace Magento\Catalog\Model\Category; +use Magento\Catalog\Model\Category\Media\PathResolverFactory; +use Magento\Catalog\Model\Category\Media\PathResolverInterface; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\File\Mime; use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Directory\WriteInterface; use Magento\Framework\Filesystem\Directory\ReadInterface; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Filesystem\ExtendedDriverInterface; use Magento\Store\Model\StoreManagerInterface; /** @@ -121,11 +124,15 @@ private function getPubDirectory() */ public function getMimeType($fileName) { - $filePath = $this->getFilePath($fileName); - $absoluteFilePath = $this->getMediaDirectory()->getAbsolutePath($filePath); - - $result = $this->mime->getMimeType($absoluteFilePath); - return $result; + if ($this->getMediaDirectory()->getDriver() instanceof ExtendedDriverInterface) { + return $this->mediaDirectory->getDriver()->getMetadata($fileName)['mimetype']; + } else { + return $this->mime->getMimeType( + $this->getMediaDirectory()->getAbsolutePath( + $this->getFilePath($fileName) + ) + ); + } } /** diff --git a/app/code/Magento/Catalog/Model/Config.php b/app/code/Magento/Catalog/Model/Config.php index c4ff12bbf0f9..3ced479057e0 100644 --- a/app/code/Magento/Catalog/Model/Config.php +++ b/app/code/Magento/Catalog/Model/Config.php @@ -44,6 +44,11 @@ class Config extends \Magento\Eav\Model\Config */ protected $_productTypesById; + /** + * @var array + */ + private $_productTypesByName; + /** * Array of attributes codes needed for product load * @@ -175,16 +180,6 @@ public function __construct( ); } - /** - * Initialize resource model - * - * @return void - */ - protected function _construct() - { - $this->_init(\Magento\Catalog\Model\ResourceModel\Config::class); - } - /** * Set store id * diff --git a/app/code/Magento/Catalog/Model/Config/CatalogMediaConfig.php b/app/code/Magento/Catalog/Model/Config/CatalogMediaConfig.php index 0ae128b34d34..aecb3da8fd3d 100644 --- a/app/code/Magento/Catalog/Model/Config/CatalogMediaConfig.php +++ b/app/code/Magento/Catalog/Model/Config/CatalogMediaConfig.php @@ -16,8 +16,8 @@ class CatalogMediaConfig { private const XML_PATH_CATALOG_MEDIA_URL_FORMAT = 'web/url/catalog_media_url_format'; - const IMAGE_OPTIMIZATION_PARAMETERS = 'image_optimization_parameters'; - const HASH = 'hash'; + public const IMAGE_OPTIMIZATION_PARAMETERS = 'image_optimization_parameters'; + public const HASH = 'hash'; /** * @var ScopeConfigInterface @@ -41,10 +41,16 @@ public function __construct(ScopeConfigInterface $scopeConfig) */ public function getMediaUrlFormat($scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeCode = null): string { - return $this->scopeConfig->getValue( - CatalogMediaConfig::XML_PATH_CATALOG_MEDIA_URL_FORMAT, + $value = $this->scopeConfig->getValue( + self::XML_PATH_CATALOG_MEDIA_URL_FORMAT, $scopeType, $scopeCode ); + + if ($value === null) { + return self::HASH; + } + + return (string)$value; } } diff --git a/app/code/Magento/Catalog/Model/CustomOptions/CustomOption.php b/app/code/Magento/Catalog/Model/CustomOptions/CustomOption.php index df9961518f47..655602cd8e7b 100644 --- a/app/code/Magento/Catalog/Model/CustomOptions/CustomOption.php +++ b/app/code/Magento/Catalog/Model/CustomOptions/CustomOption.php @@ -17,6 +17,11 @@ class CustomOption extends AbstractExtensibleModel implements CustomOptionInterface { + /** + * @var FileProcessor + */ + private $fileProcessor; + /** * @param Context $context * @param Registry $registry diff --git a/app/code/Magento/Catalog/Model/Design.php b/app/code/Magento/Catalog/Model/Design.php index fed18a5a6091..3db91aa4c782 100644 --- a/app/code/Magento/Catalog/Model/Design.php +++ b/app/code/Magento/Catalog/Model/Design.php @@ -3,12 +3,22 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Catalog\Model; +use Magento\Catalog\Api\CategoryRepositoryInterface; use Magento\Catalog\Model\Category\Attribute\LayoutUpdateManager as CategoryLayoutManager; use Magento\Catalog\Model\Product\Attribute\LayoutUpdateManager as ProductLayoutManager; use Magento\Framework\App\ObjectManager; -use \Magento\Framework\TranslateInterface; +use Magento\Framework\Data\Collection\AbstractDb; +use Magento\Framework\DataObject; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Model\Context; +use Magento\Framework\Model\ResourceModel\AbstractResource; +use Magento\Framework\Registry; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; +use Magento\Framework\TranslateInterface; +use Magento\Framework\View\DesignInterface; /** * Catalog Custom Category design Model @@ -28,12 +38,12 @@ class Design extends \Magento\Framework\Model\AbstractModel /** * Design package instance * - * @var \Magento\Framework\View\DesignInterface + * @var DesignInterface */ protected $_design = null; /** - * @var \Magento\Framework\Stdlib\DateTime\TimezoneInterface + * @var TimezoneInterface */ protected $_localeDate; @@ -53,29 +63,43 @@ class Design extends \Magento\Framework\Model\AbstractModel private $productLayoutUpdates; /** - * @param \Magento\Framework\Model\Context $context - * @param \Magento\Framework\Registry $registry - * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate - * @param \Magento\Framework\View\DesignInterface $design - * @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource - * @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection + * @var Session + */ + private $catalogSession; + + /** + * @var CategoryRepositoryInterface + */ + private $categoryRepository; + + /** + * @param Context $context + * @param Registry $registry + * @param TimezoneInterface $localeDate + * @param DesignInterface $design + * @param AbstractResource|null $resource + * @param AbstractDb|null $resourceCollection * @param array $data * @param TranslateInterface|null $translator * @param CategoryLayoutManager|null $categoryLayoutManager * @param ProductLayoutManager|null $productLayoutManager + * @param Session|null $catalogSession + * @param CategoryRepositoryInterface|null $categoryRepository * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Framework\Model\Context $context, - \Magento\Framework\Registry $registry, - \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, - \Magento\Framework\View\DesignInterface $design, - \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, - \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, + Context $context, + Registry $registry, + TimezoneInterface $localeDate, + DesignInterface $design, + AbstractResource $resource = null, + AbstractDb $resourceCollection = null, array $data = [], TranslateInterface $translator = null, ?CategoryLayoutManager $categoryLayoutManager = null, - ?ProductLayoutManager $productLayoutManager = null + ?ProductLayoutManager $productLayoutManager = null, + ?Session $catalogSession = null, + ?CategoryRepositoryInterface $categoryRepository = null ) { $this->_localeDate = $localeDate; $this->_design = $design; @@ -84,6 +108,10 @@ public function __construct( ?? ObjectManager::getInstance()->get(CategoryLayoutManager::class); $this->productLayoutUpdates = $productLayoutManager ?? ObjectManager::getInstance()->get(ProductLayoutManager::class); + $this->catalogSession = $catalogSession + ?? ObjectManager::getInstance()->get(Session::class); + $this->categoryRepository = $categoryRepository + ?? ObjectManager::getInstance()->get(CategoryRepositoryInterface::class); parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -104,12 +132,23 @@ public function applyCustomDesign($design) * Get custom layout settings * * @param Category|Product $object - * @return \Magento\Framework\DataObject + * @return DataObject */ public function getDesignSettings($object) { if ($object instanceof Product) { $currentCategory = $object->getCategory(); + if (!$currentCategory) { + $lastId = $this->catalogSession->getLastVisitedCategoryId(); + if ($object->canBeShowInCategory($lastId)) { + $categoryId = $lastId; + try { + $currentCategory = $this->categoryRepository->get($categoryId); + } catch (NoSuchEntityException $e) { + $currentCategory = null; + } + } + } } else { $currentCategory = $object; } @@ -134,14 +173,17 @@ public function getDesignSettings($object) * Extract custom layout settings from category or product object * * @param Category|Product $object - * @return \Magento\Framework\DataObject + * @return DataObject */ protected function _extractSettings($object) { - $settings = new \Magento\Framework\DataObject(); + $settings = new DataObject(); if (!$object) { return $settings; } + $settings->setPageLayout($object->getPageLayout()); + $settings->setLayoutUpdates((array)$object->getCustomLayoutUpdate()); + $date = $object->getCustomDesignDate(); if (array_key_exists( 'from', @@ -155,28 +197,28 @@ protected function _extractSettings($object) $date['to'] ) ) { - $settings->setCustomDesign( - $object->getCustomDesign() - )->setPageLayout( - $object->getPageLayout() - )->setLayoutUpdates( - (array)$object->getCustomLayoutUpdate() - ); + if ($object->getCustomDesign()) { + $settings->setCustomDesign($object->getCustomDesign()); + } + if ($object->getCustomLayout()) { + $settings->setPageLayout($object->getCustomLayout()); + } if ($object instanceof Category) { $this->categoryLayoutUpdates->extractCustomSettings($object, $settings); } elseif ($object instanceof Product) { $this->productLayoutUpdates->extractCustomSettings($object, $settings); } } + return $settings; } /** * Merge custom design settings * - * @param \Magento\Framework\DataObject $categorySettings - * @param \Magento\Framework\DataObject $productSettings - * @return \Magento\Framework\DataObject + * @param DataObject $categorySettings + * @param DataObject $productSettings + * @return DataObject */ protected function _mergeSettings($categorySettings, $productSettings) { @@ -190,6 +232,21 @@ protected function _mergeSettings($categorySettings, $productSettings) $update = array_merge($categorySettings->getLayoutUpdates(), $productSettings->getLayoutUpdates()); $categorySettings->setLayoutUpdates($update); } + if ($categorySettings->getPageLayoutHandles()) { + $handles = []; + foreach ($categorySettings->getPageLayoutHandles() as $key => $value) { + $handles[$key] = [ + 'handle' => 'catalog_category_view', + 'value' => $value, + ]; + } + $categorySettings->setPageLayoutHandles($handles); + } + if ($productSettings->getPageLayoutHandles()) { + $handle = array_merge($categorySettings->getPageLayoutHandles(), $productSettings->getPageLayoutHandles()); + $categorySettings->setPageLayoutHandles($handle); + } + return $categorySettings; } } diff --git a/app/code/Magento/Catalog/Model/ImageUploader.php b/app/code/Magento/Catalog/Model/ImageUploader.php index 6aff6488164f..0b987f05d162 100644 --- a/app/code/Magento/Catalog/Model/ImageUploader.php +++ b/app/code/Magento/Catalog/Model/ImageUploader.php @@ -3,12 +3,12 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Catalog\Model; use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\File\Uploader; use Magento\Framework\App\ObjectManager; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\File\Name; use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Directory\WriteInterface; @@ -211,7 +211,7 @@ public function moveFileFromTmp($imageName, $returnRelativePath = false) $baseTmpImagePath = $this->getFilePath($baseTmpPath, $imageName); try { - $this->coreFileStorageDatabase->copyFile( + $this->coreFileStorageDatabase->renameFile( $baseTmpImagePath, $baseImagePath ); diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Full.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Full.php index a7c5cdf412e6..e94c7a4ee0cf 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Full.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Full.php @@ -12,6 +12,8 @@ use Magento\Catalog\Model\Config; use Magento\Catalog\Model\Indexer\Category\Product\AbstractAction; use Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher; +use Magento\Catalog\Model\Indexer\Category\Product; +use Magento\Framework\App\DeploymentConfig; use Magento\Framework\App\ObjectManager; use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Query\Generator as QueryGenerator; @@ -63,6 +65,18 @@ class Full extends AbstractAction */ private $processManager; + /** + * @var DeploymentConfig|null + */ + private $deploymentConfig; + + /** + * Deployment config path + * + * @var string + */ + private const DEPLOYMENT_CONFIG_INDEXER_BATCHES = 'indexer/batch_size/'; + /** * @param ResourceConnection $resource * @param StoreManagerInterface $storeManager @@ -73,7 +87,8 @@ class Full extends AbstractAction * @param MetadataPool|null $metadataPool * @param int|null $batchRowsCount * @param ActiveTableSwitcher|null $activeTableSwitcher - * @param ProcessManager $processManager + * @param ProcessManager|null $processManager + * @param DeploymentConfig|null $deploymentConfig * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -86,7 +101,8 @@ public function __construct( MetadataPool $metadataPool = null, $batchRowsCount = null, ActiveTableSwitcher $activeTableSwitcher = null, - ProcessManager $processManager = null + ProcessManager $processManager = null, + ?DeploymentConfig $deploymentConfig = null ) { parent::__construct( $resource, @@ -107,6 +123,7 @@ public function __construct( $this->batchRowsCount = $batchRowsCount; $this->activeTableSwitcher = $activeTableSwitcher ?: $objectManager->get(ActiveTableSwitcher::class); $this->processManager = $processManager ?: $objectManager->get(ProcessManager::class); + $this->deploymentConfig = $deploymentConfig ?: ObjectManager::getInstance()->get(DeploymentConfig::class); } /** @@ -266,6 +283,11 @@ private function reindexCategoriesBySelect(Select $basicSelect, $whereCondition, $columns = array_keys( $this->connection->describeTable($this->tableMaintainer->getMainTmpTable((int)$store->getId())) ); + + $this->batchRowsCount = $this->deploymentConfig->get( + self::DEPLOYMENT_CONFIG_INDEXER_BATCHES . Product::INDEXER_ID + ) ?? $this->batchRowsCount; + $this->batchSizeManagement->ensureBatchSize($this->connection, $this->batchRowsCount); $select = $this->connection->select(); diff --git a/app/code/Magento/Catalog/Model/Layer/Filter/Dynamic/Manual.php b/app/code/Magento/Catalog/Model/Layer/Filter/Dynamic/Manual.php index bfa461312783..ee452b08c43e 100644 --- a/app/code/Magento/Catalog/Model/Layer/Filter/Dynamic/Manual.php +++ b/app/code/Magento/Catalog/Model/Layer/Filter/Dynamic/Manual.php @@ -18,6 +18,41 @@ class Manual implements AlgorithmInterface { const XML_PATH_RANGE_MAX_INTERVALS = 'catalog/layered_navigation/price_range_max_intervals'; + /** + * @var Algorithm + */ + private $algorithm; + + /** + * @var \Magento\Catalog\Model\Layer + */ + private $layer; + + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * @var Render + */ + private $render; + + /** + * @var Registry + */ + private $coreRegistry; + + /** + * @var Range + */ + private $range; + + /** + * @var Price + */ + private $resource; + /** * @param Algorithm $algorithm * @param Resolver $layerResolver diff --git a/app/code/Magento/Catalog/Model/Product.php b/app/code/Magento/Catalog/Model/Product.php index 82d252acd990..355d5bd36e7d 100644 --- a/app/code/Magento/Catalog/Model/Product.php +++ b/app/code/Magento/Catalog/Model/Product.php @@ -828,9 +828,6 @@ public function getStoreIds() if (!$this->hasStoreIds()) { $storeIds = []; if ($websiteIds = $this->getWebsiteIds()) { - if (!$this->isObjectNew() && $this->_storeManager->isSingleStoreMode()) { - $websiteIds = array_keys($websiteIds); - } foreach ($websiteIds as $websiteId) { $websiteStores = $this->_storeManager->getWebsite($websiteId)->getStoreIds(); $storeIds[] = $websiteStores; @@ -877,15 +874,17 @@ public function getAttributes($groupId = null, $skipSuper = false) */ public function beforeSave() { - $this->setTypeHasOptions(false); - $this->setTypeHasRequiredOptions(false); - $this->setHasOptions(false); - $this->setRequiredOptions(false); + if ($this->getData('has_options') === null) { + $this->setHasOptions(false); + } + if ($this->getData('required_options') === null) { + $this->setRequiredOptions(false); + } $this->getTypeInstance()->beforeSave($this); - $hasOptions = false; - $hasRequiredOptions = false; + $hasOptions = $this->getData('has_options') === "1"; + $hasRequiredOptions = $this->getData('required_options') === "1"; /** * $this->_canAffectOptions - set by type instance only diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/SaveHandler.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/SaveHandler.php index 9cb2ac014589..32a417a935e8 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/SaveHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/SaveHandler.php @@ -86,9 +86,11 @@ public function execute($entity, $arguments = []) $identifierField = $this->metadataPoll->getMetadata(ProductInterface::class)->getLinkField(); $priceRows = array_filter($priceRows); $productId = (int) $entity->getData($identifierField); + $pricesStored = $this->getPricesStored($priceRows); + $pricesMerged = $this->mergePrices($priceRows, $pricesStored); // prepare and save data - foreach ($priceRows as $data) { + foreach ($pricesMerged as $data) { $isPriceWebsiteGlobal = (int)$data['website_id'] === 0; if ($isGlobal === $isPriceWebsiteGlobal || !empty($data['price_qty']) @@ -109,4 +111,51 @@ public function execute($entity, $arguments = []) return $entity; } + + /** + * Merge prices + * + * @param array $prices + * @param array $pricesStored + * @return array + */ + private function mergePrices(array $prices, array $pricesStored): array + { + if (!$pricesStored) { + return $prices; + } + $pricesId = []; + $pricesStoredId = []; + foreach ($prices as $price) { + if (isset($price['price_id'])) { + $pricesId[$price['price_id']] = $price; + } + } + foreach ($pricesStored as $price) { + if (isset($price['price_id'])) { + $pricesStoredId[$price['price_id']] = $price; + } + } + $pricesAdd = array_diff_key($pricesStoredId, $pricesId); + foreach ($pricesAdd as $price) { + $prices[] = $price; + } + return $prices; + } + + /** + * Get stored prices + * + * @param array $prices + * @return array + */ + private function getPricesStored(array $prices): array + { + $pricesStored = []; + $price = reset($prices); + if (isset($price['product_id']) && $price['product_id']) { + $pricesStored = $this->tierPriceResource->loadPriceData($price['product_id']); + } + return $pricesStored; + } } diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Repository.php b/app/code/Magento/Catalog/Model/Product/Attribute/Repository.php index 4d148f078ae4..a562b3203490 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Repository.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Repository.php @@ -126,6 +126,7 @@ public function save(\Magento\Catalog\Api\Data\ProductAttributeInterface $attrib $attribute->setAttributeId($existingModel->getAttributeId()); $attribute->setIsUserDefined($existingModel->getIsUserDefined()); $attribute->setFrontendInput($existingModel->getFrontendInput()); + $attribute->setBackendModel($existingModel->getBackendModel()); $this->updateDefaultFrontendLabel($attribute, $existingModel); } else { diff --git a/app/code/Magento/Catalog/Model/Product/Authorization.php b/app/code/Magento/Catalog/Model/Product/Authorization.php index 4022eb34e65e..3394b65f9eeb 100644 --- a/app/code/Magento/Catalog/Model/Product/Authorization.php +++ b/app/code/Magento/Catalog/Model/Product/Authorization.php @@ -129,7 +129,7 @@ private function hasProductChanged(ProductModel $product, ?array $oldProduct = n //No new value continue; } - if (!in_array($newValue, $oldValues, true)) { + if ($newValue !== null && !in_array($newValue, $oldValues, true)) { return true; } } diff --git a/app/code/Magento/Catalog/Model/Product/Configuration/Item/ItemResolverComposite.php b/app/code/Magento/Catalog/Model/Product/Configuration/Item/ItemResolverComposite.php index 68d0877c6cd6..d8cfb2eff264 100644 --- a/app/code/Magento/Catalog/Model/Product/Configuration/Item/ItemResolverComposite.php +++ b/app/code/Magento/Catalog/Model/Product/Configuration/Item/ItemResolverComposite.php @@ -16,7 +16,7 @@ class ItemResolverComposite implements ItemResolverInterface { /** @var string[] */ - private $itemResolvers = []; + private $itemResolvers; /** @var ItemResolverInterface[] */ private $itemResolversInstances = []; diff --git a/app/code/Magento/Catalog/Model/Product/Gallery/CopyHandler.php b/app/code/Magento/Catalog/Model/Product/Gallery/CopyHandler.php new file mode 100644 index 000000000000..5e4d3e391618 --- /dev/null +++ b/app/code/Magento/Catalog/Model/Product/Gallery/CopyHandler.php @@ -0,0 +1,173 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Product\Gallery; + +use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\ResourceModel\Product\Gallery; +use Magento\Eav\Model\ResourceModel\AttributeValue; +use Magento\Framework\EntityManager\EntityMetadata; +use Magento\Framework\EntityManager\MetadataPool; +use Magento\Framework\EntityManager\Operation\ExtensionInterface; +use Magento\Framework\Serialize\Serializer\Json; + +/** + * Copy gallery data from one product to another + */ +class CopyHandler implements ExtensionInterface +{ + /** + * @var EntityMetadata + */ + private $metadata; + + /** + * @var Gallery + */ + private $galleryResourceModel; + + /** + * @var ProductAttributeRepositoryInterface + */ + private $attributeRepository; + + /** + * @var AttributeValue + */ + private $attributeValue; + + /** + * @var Json + */ + private $json; + + /** + * @var ProductAttributeInterface + */ + private $attribute; + + /** + * @param MetadataPool $metadataPool + * @param Gallery $galleryResourceModel + * @param ProductAttributeRepositoryInterface $attributeRepository + * @param AttributeValue $attributeValue + * @param Json $json + */ + public function __construct( + MetadataPool $metadataPool, + Gallery $galleryResourceModel, + ProductAttributeRepositoryInterface $attributeRepository, + AttributeValue $attributeValue, + Json $json + ) { + $this->metadata = $metadataPool->getMetadata(ProductInterface::class); + $this->galleryResourceModel = $galleryResourceModel; + $this->attributeRepository = $attributeRepository; + $this->attributeValue = $attributeValue; + $this->json = $json; + } + + /** + * Copy gallery data from one product to another + * + * @param Product $product + * @param array $arguments + * @return void + */ + public function execute($product, $arguments = []): void + { + $fromId = (int) $arguments['original_link_id']; + $toId = $product->getData($this->metadata->getLinkField()); + $attributeId = $this->getAttribute()->getAttributeId(); + $valueIdMap = $this->galleryResourceModel->duplicate($attributeId, [], $fromId, $toId); + $gallery = $this->getMediaGalleryCollection($product); + + if (!empty($gallery['images'])) { + $images = []; + foreach ($gallery['images'] as $key => $image) { + $valueId = $image['value_id'] ?? null; + $newKey = $key; + if ($valueId !== null) { + $newValueId = $valueId; + if (isset($valueIdMap[$valueId])) { + $newValueId = $valueIdMap[$valueId]; + } + if (((int) $valueId) === $key) { + $newKey = $newValueId; + } + $image['value_id'] = $newValueId; + } + $images[$newKey] = $image; + } + $gallery['images'] = $images; + $attrCode = $this->getAttribute()->getAttributeCode(); + $product->setData($attrCode, $gallery); + } + + //Copy media attribute values from one product to another + if (isset($arguments['media_attribute_codes'])) { + $values = $this->attributeValue->getValues( + ProductInterface::class, + $fromId, + $arguments['media_attribute_codes'] + ); + if ($values) { + foreach (array_keys($values) as $key) { + $values[$key][$this->metadata->getLinkField()] = $product->getData($this->metadata->getLinkField()); + unset($values[$key]['value_id']); + } + $this->attributeValue->insertValues( + ProductInterface::class, + $values + ); + } + } + } + + /** + * Get product media gallery collection + * + * @param Product $product + * @return array + */ + private function getMediaGalleryCollection(Product $product): array + { + $attrCode = $this->getAttribute()->getAttributeCode(); + $value = $product->getData($attrCode); + + if (is_array($value) && isset($value['images'])) { + if (!is_array($value['images']) && strlen($value['images']) > 0) { + $value['images'] = $this->json->unserialize($value['images']); + } + + if (!is_array($value['images'])) { + $value['images'] = []; + } + } + + return $value; + } + + /** + * Returns media gallery attribute instance + * + * @return ProductAttributeInterface + */ + private function getAttribute(): ProductAttributeInterface + { + if (!$this->attribute) { + $this->attribute = $this->attributeRepository->get( + ProductInterface::MEDIA_GALLERY + ); + } + + return $this->attribute; + } +} diff --git a/app/code/Magento/Catalog/Model/Product/Gallery/DeleteHandler.php b/app/code/Magento/Catalog/Model/Product/Gallery/DeleteHandler.php new file mode 100644 index 000000000000..16adccb29b25 --- /dev/null +++ b/app/code/Magento/Catalog/Model/Product/Gallery/DeleteHandler.php @@ -0,0 +1,99 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Product\Gallery; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\ResourceModel\Product\Gallery; +use Magento\Eav\Model\ResourceModel\AttributeValue; +use Magento\Framework\EntityManager\EntityMetadata; +use Magento\Framework\EntityManager\MetadataPool; +use Magento\Framework\EntityManager\Operation\ExtensionInterface; + +/** + * Delete all media gallery records for provided product + */ +class DeleteHandler implements ExtensionInterface +{ + /** + * @var EntityMetadata + */ + private $metadata; + + /** + * @var Gallery + */ + private $galleryResourceModel; + + /** + * @var AttributeValue + */ + private $attributeValue; + + /** + * @param MetadataPool $metadataPool + * @param Gallery $galleryResourceModel + * @param AttributeValue $attributeValue + */ + public function __construct( + MetadataPool $metadataPool, + Gallery $galleryResourceModel, + AttributeValue $attributeValue + ) { + $this->metadata = $metadataPool->getMetadata(ProductInterface::class); + $this->galleryResourceModel = $galleryResourceModel; + $this->attributeValue = $attributeValue; + } + + /** + * Delete all media gallery records for provided product + * + * @param Product $product + * @param array $arguments + * @return void + */ + public function execute($product, $arguments = []): void + { + $valuesId = $this->getMediaGalleryValuesId($product); + if ($valuesId) { + $this->galleryResourceModel->deleteGallery($valuesId); + } + if (isset($arguments['media_attribute_codes'])) { + $values = $this->attributeValue->getValues( + ProductInterface::class, + (int) $product->getData($this->metadata->getLinkField()), + $arguments['media_attribute_codes'] + ); + if ($values) { + $this->attributeValue->deleteValues( + ProductInterface::class, + $values + ); + } + } + } + + /** + * Get product media gallery values IDs + * + * @param Product $product + * @return array + */ + private function getMediaGalleryValuesId(Product $product): array + { + $connection = $this->galleryResourceModel->getConnection(); + $select = $connection->select() + ->from($this->galleryResourceModel->getTable(Gallery::GALLERY_VALUE_TO_ENTITY_TABLE)) + ->where( + $this->metadata->getLinkField() . '=?', + $product->getData($this->metadata->getLinkField()), + \Zend_Db::INT_TYPE + ); + return $connection->fetchCol($select); + } +} diff --git a/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php b/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php index 6a1392d776d3..edee9aef508d 100644 --- a/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php @@ -88,9 +88,6 @@ protected function processDeletedImages($product, array &$images) foreach ($images as $image) { if (!empty($image['removed'])) { if (!empty($image['value_id'])) { - if (preg_match('/\.\.(\\\|\/)/', $image['file'])) { - continue; - } $recordsToDelete[] = $image['value_id']; if (!in_array($image['file'], $imagesToNotDelete)) { $imagesToDelete[] = $image['file']; @@ -116,7 +113,8 @@ protected function processDeletedImages($product, array &$images) private function canDeleteImage(string $file): bool { $catalogPath = $this->mediaConfig->getBaseMediaPath(); - return $this->mediaDirectory->isFile($catalogPath . $file) + $filePath = $this->mediaDirectory->getRelativePath($catalogPath . $file); + return $this->mediaDirectory->isFile($filePath) && $this->resourceModel->countImageUses($file) <= 1; } diff --git a/app/code/Magento/Catalog/Model/Product/Option/Repository.php b/app/code/Magento/Catalog/Model/Product/Option/Repository.php index bb4e247de32d..bb0f0c479223 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Repository.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Repository.php @@ -158,6 +158,7 @@ public function save(\Magento\Catalog\Api\Data\ProductCustomOptionInterface $opt $option->setData('product_id', $product->getData($metadata->getLinkField())); $option->setData('store_id', $product->getStoreId()); + $backedOptions = $option->getValues(); if ($option->getOptionId()) { $options = $product->getOptions(); if (!$options) { @@ -174,6 +175,9 @@ public function save(\Magento\Catalog\Api\Data\ProductCustomOptionInterface $opt } $originalValues = $persistedOption->getValues(); $newValues = $option->getData('values'); + if (!$newValues) { + $newValues = $this->getOptionValues($option); + } if ($newValues) { if (isset($originalValues)) { $newValues = $this->markRemovedValues($newValues, $originalValues); @@ -182,6 +186,8 @@ public function save(\Magento\Catalog\Api\Data\ProductCustomOptionInterface $opt } } $option->save(); + // Required for API response data consistency + $option->setValues($backedOptions); return $option; } @@ -249,4 +255,28 @@ private function getHydratorPool() } return $this->hydratorPool; } + + /** + * Get Option values from property + * + * Gets Option values stored in property, modifies for needed format and clears the property + * + * @param \Magento\Catalog\Api\Data\ProductCustomOptionInterface $option + * @return array|null + */ + private function getOptionValues(\Magento\Catalog\Api\Data\ProductCustomOptionInterface $option): ?array + { + if ($option->getValues() === null) { + return null; + } + + $optionValues = []; + + foreach ($option->getValues() as $optionValue) { + $optionValues[] = $optionValue->getData(); + } + $option->setValues(null); + + return $optionValues; + } } diff --git a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php index 9cb6cda4d0a0..121ff2a5db9b 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php @@ -7,26 +7,47 @@ namespace Magento\Catalog\Model\Product\Option; +use Magento\Catalog\Api\Data\ProductCustomOptionInterface; +use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Api\ProductCustomOptionRepositoryInterface as OptionRepository; +use Magento\Catalog\Model\Product\Option; +use Magento\Framework\App\ObjectManager; use Magento\Framework\EntityManager\Operation\ExtensionInterface; +use Magento\Catalog\Model\ResourceModel\Product\Relation; +use Magento\Framework\Exception\CouldNotSaveException; /** - * Class SaveHandler + * SaveHandler for product option + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class SaveHandler implements ExtensionInterface { + /** + * @var string[] + */ + private $compositeProductTypes = ['grouped', 'configurable', 'bundle']; + /** * @var OptionRepository */ protected $optionRepository; + /** + * @var Relation + */ + private $relation; + /** * @param OptionRepository $optionRepository + * @param Relation|null $relation */ public function __construct( - OptionRepository $optionRepository + OptionRepository $optionRepository, + ?Relation $relation = null ) { $this->optionRepository = $optionRepository; + $this->relation = $relation ?: ObjectManager::getInstance()->get(Relation::class); } /** @@ -34,7 +55,7 @@ public function __construct( * * @param object $entity * @param array $arguments - * @return \Magento\Catalog\Api\Data\ProductInterface|object + * @return ProductInterface|object * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function execute($entity, $arguments = []) @@ -47,20 +68,19 @@ public function execute($entity, $arguments = []) $optionIds = []; if ($options) { - $optionIds = array_map(function ($option) { - /** @var \Magento\Catalog\Model\Product\Option $option */ + $optionIds = array_map(function (Option $option) { return $option->getOptionId(); }, $options); } - /** @var \Magento\Catalog\Api\Data\ProductInterface $entity */ + /** @var ProductInterface $entity */ foreach ($this->optionRepository->getProductOptions($entity) as $option) { if (!in_array($option->getOptionId(), $optionIds)) { $this->optionRepository->delete($option); } } if ($options) { - $this->processOptionsSaving($options, (bool)$entity->dataHasChangedFor('sku'), (string)$entity->getSku()); + $this->processOptionsSaving($options, (bool)$entity->dataHasChangedFor('sku'), $entity); } return $entity; @@ -71,15 +91,43 @@ public function execute($entity, $arguments = []) * * @param array $options * @param bool $hasChangedSku - * @param string $newSku + * @param ProductInterface $product + * @return void + * @throws CouldNotSaveException */ - private function processOptionsSaving(array $options, bool $hasChangedSku, string $newSku) + private function processOptionsSaving(array $options, bool $hasChangedSku, ProductInterface $product): void { + $isProductHasRelations = $this->isProductHasRelations($product); + /** @var ProductCustomOptionInterface $option */ foreach ($options as $option) { + if (!$isProductHasRelations && $option->getIsRequire()) { + $message = 'Required custom options cannot be added to a simple product' + . ' that is a part of a composite product.'; + throw new CouldNotSaveException(__($message)); + } + if ($hasChangedSku && $option->hasData('product_sku')) { - $option->setProductSku($newSku); + $option->setProductSku($product->getSku()); } $this->optionRepository->save($option); } } + + /** + * Check if product doesn't belong to composite product + * + * @param ProductInterface $product + * @return bool + */ + private function isProductHasRelations(ProductInterface $product): bool + { + $result = true; + if (!in_array($product->getId(), $this->compositeProductTypes) + && $this->relation->getRelationsByChildren([$product->getId()]) + ) { + $result = false; + } + + return $result; + } } diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorFile.php b/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorFile.php index 934ff4804509..f227e14e6af4 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorFile.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorFile.php @@ -213,7 +213,7 @@ public function validate($processingParams, $option) } } - $fileHash = md5($tmpDirectory->readFile($tmpDirectory->getRelativePath($fileInfo['tmp_name']))); + $fileHash = hash('sha256', $tmpDirectory->readFile($tmpDirectory->getRelativePath($fileInfo['tmp_name']))); $userValue = [ 'type' => $fileInfo['type'], diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfo.php b/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfo.php index 100ad37273cf..43bbe6f67338 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfo.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfo.php @@ -125,7 +125,7 @@ public function validate($optionValue, $option) */ protected function buildSecretKey($fileRelativePath) { - return substr(md5($this->rootDirectory->readFile($fileRelativePath)), 0, 20); + return substr(hash('sha256', $this->rootDirectory->readFile($fileRelativePath)), 0, 20); } /** diff --git a/app/code/Magento/Catalog/Model/Product/Price/SpecialPriceStorage.php b/app/code/Magento/Catalog/Model/Product/Price/SpecialPriceStorage.php index 83a2d1340794..a0f6fcf315c7 100644 --- a/app/code/Magento/Catalog/Model/Product/Price/SpecialPriceStorage.php +++ b/app/code/Magento/Catalog/Model/Product/Price/SpecialPriceStorage.php @@ -6,12 +6,22 @@ namespace Magento\Catalog\Model\Product\Price; +use Magento\Catalog\Api\Data\SpecialPriceInterface; +use Magento\Catalog\Api\Data\SpecialPriceInterfaceFactory; +use Magento\Catalog\Api\SpecialPriceStorageInterface; +use Magento\Catalog\Model\Product\Price\Validation\InvalidSkuProcessor; +use Magento\Catalog\Model\Product\Price\Validation\Result; +use Magento\Catalog\Model\ProductIdLocatorInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Catalog\Helper\Data; +use Magento\Store\Api\StoreRepositoryInterface; /** * Special price storage presents efficient price API and is used to retrieve, update or delete special prices. + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class SpecialPriceStorage implements \Magento\Catalog\Api\SpecialPriceStorageInterface +class SpecialPriceStorage implements SpecialPriceStorageInterface { /** * @var \Magento\Catalog\Api\SpecialPriceInterface @@ -19,52 +29,59 @@ class SpecialPriceStorage implements \Magento\Catalog\Api\SpecialPriceStorageInt private $specialPriceResource; /** - * @var \Magento\Catalog\Api\Data\SpecialPriceInterfaceFactory + * @var SpecialPriceInterfaceFactory */ private $specialPriceFactory; /** - * @var \Magento\Catalog\Model\ProductIdLocatorInterface + * @var ProductIdLocatorInterface */ private $productIdLocator; /** - * @var \Magento\Store\Api\StoreRepositoryInterface + * @var StoreRepositoryInterface */ private $storeRepository; /** - * @var \Magento\Catalog\Model\Product\Price\Validation\Result + * @var Result */ private $validationResult; /** - * @var \Magento\Catalog\Model\Product\Price\Validation\InvalidSkuProcessor + * @var InvalidSkuProcessor */ private $invalidSkuProcessor; /** * @var array */ - private $allowedProductTypes = []; + private $allowedProductTypes; + + /** + * @var Data + */ + private $catalogData; /** * @param \Magento\Catalog\Api\SpecialPriceInterface $specialPriceResource - * @param \Magento\Catalog\Api\Data\SpecialPriceInterfaceFactory $specialPriceFactory - * @param \Magento\Catalog\Model\ProductIdLocatorInterface $productIdLocator - * @param \Magento\Store\Api\StoreRepositoryInterface $storeRepository - * @param \Magento\Catalog\Model\Product\Price\Validation\Result $validationResult - * @param \Magento\Catalog\Model\Product\Price\Validation\InvalidSkuProcessor $invalidSkuProcessor - * @param array $allowedProductTypes [optional] + * @param SpecialPriceInterfaceFactory $specialPriceFactory + * @param ProductIdLocatorInterface $productIdLocator + * @param StoreRepositoryInterface $storeRepository + * @param Result $validationResult + * @param InvalidSkuProcessor $invalidSkuProcessor + * @param array $allowedProductTypes + * @param Data|null $catalogData */ public function __construct( \Magento\Catalog\Api\SpecialPriceInterface $specialPriceResource, - \Magento\Catalog\Api\Data\SpecialPriceInterfaceFactory $specialPriceFactory, - \Magento\Catalog\Model\ProductIdLocatorInterface $productIdLocator, - \Magento\Store\Api\StoreRepositoryInterface $storeRepository, - \Magento\Catalog\Model\Product\Price\Validation\Result $validationResult, - \Magento\Catalog\Model\Product\Price\Validation\InvalidSkuProcessor $invalidSkuProcessor, - array $allowedProductTypes = [] + SpecialPriceInterfaceFactory $specialPriceFactory, + ProductIdLocatorInterface $productIdLocator, + StoreRepositoryInterface $storeRepository, + Result $validationResult, + InvalidSkuProcessor $invalidSkuProcessor, + array $allowedProductTypes = [], + ?Data $catalogData = null ) { $this->specialPriceResource = $specialPriceResource; $this->specialPriceFactory = $specialPriceFactory; @@ -73,10 +90,11 @@ public function __construct( $this->validationResult = $validationResult; $this->invalidSkuProcessor = $invalidSkuProcessor; $this->allowedProductTypes = $allowedProductTypes; + $this->catalogData = $catalogData ?: ObjectManager::getInstance()->get(Data::class); } /** - * {@inheritdoc} + * @inheritdoc */ public function get(array $skus) { @@ -85,7 +103,7 @@ public function get(array $skus) $prices = []; foreach ($rawPrices as $rawPrice) { - /** @var \Magento\Catalog\Api\Data\SpecialPriceInterface $price */ + /** @var SpecialPriceInterface $price */ $price = $this->specialPriceFactory->create(); $sku = isset($rawPrice['sku']) ? $rawPrice['sku'] @@ -102,7 +120,7 @@ public function get(array $skus) } /** - * {@inheritdoc} + * @inheritdoc */ public function update(array $prices) { @@ -113,7 +131,7 @@ public function update(array $prices) } /** - * {@inheritdoc} + * @inheritdoc */ public function delete(array $prices) { @@ -140,52 +158,14 @@ private function retrieveValidPrices(array $prices) foreach ($prices as $key => $price) { if (!$price->getSku() || in_array($price->getSku(), $failedSkus)) { - $this->validationResult->addFailedItem( - $key, - __( - 'The product that was requested doesn\'t exist. Verify the product and try again. ' - . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.', - [ - 'SKU' => $price->getSku(), - 'storeId' => $price->getStoreId(), - 'priceFrom' => $price->getPriceFrom(), - 'priceTo' => $price->getPriceTo() - ] - ), - [ - 'SKU' => $price->getSku(), - 'storeId' => $price->getStoreId(), - 'priceFrom' => $price->getPriceFrom(), - 'priceTo' => $price->getPriceTo() - ] - ); + $errorMessage = 'The product that was requested doesn\'t exist. Verify the product and try again. ' + . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.'; + $this->addFailedItemPrice($price, $key, $errorMessage, []); } + $this->checkStore($price, $key); $this->checkPrice($price, $key); $this->checkDate($price, $price->getPriceFrom(), 'Price From', $key); $this->checkDate($price, $price->getPriceTo(), 'Price To', $key); - try { - $this->storeRepository->getById($price->getStoreId()); - } catch (NoSuchEntityException $e) { - $this->validationResult->addFailedItem( - $key, - __( - 'Requested store is not found. ' - . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.', - [ - 'SKU' => $price->getSku(), - 'storeId' => $price->getStoreId(), - 'priceFrom' => $price->getPriceFrom(), - 'priceTo' => $price->getPriceTo() - ] - ), - [ - 'SKU' => $price->getSku(), - 'storeId' => $price->getStoreId(), - 'priceFrom' => $price->getPriceFrom(), - 'priceTo' => $price->getPriceTo() - ] - ); - } } foreach ($this->validationResult->getFailedRowIds() as $id) { @@ -195,77 +175,95 @@ private function retrieveValidPrices(array $prices) return $prices; } + /** + * Check that store exists and is global when price scope is global and otherwise add error to aggregator. + * + * @param SpecialPriceInterface $price + * @param int $key + * @return void + */ + private function checkStore(SpecialPriceInterface $price, int $key): void + { + if ($this->catalogData->isPriceGlobal() && $price->getStoreId() !== 0) { + $errorMessage = 'Could not change non global Price when price scope is global. ' + . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.'; + $this->addFailedItemPrice($price, $key, $errorMessage, []); + } + + try { + $this->storeRepository->getById($price->getStoreId()); + } catch (NoSuchEntityException $e) { + $errorMessage = 'Requested store is not found. ' + . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.'; + $this->addFailedItemPrice($price, $key, $errorMessage, []); + } + } + /** * Check that date value is correct and add error to aggregator if it contains incorrect data. * - * @param \Magento\Catalog\Api\Data\SpecialPriceInterface $price + * @param SpecialPriceInterface $price * @param string $value * @param string $label * @param int $key * @return void */ - private function checkDate(\Magento\Catalog\Api\Data\SpecialPriceInterface $price, $value, $label, $key) + private function checkDate(SpecialPriceInterface $price, $value, $label, $key) { if ($value && !$this->isCorrectDateValue($value)) { - $this->validationResult->addFailedItem( - $key, - __( - 'Invalid attribute %label = %priceTo. ' - . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.', - [ - 'label' => $label, - 'SKU' => $price->getSku(), - 'storeId' => $price->getStoreId(), - 'priceFrom' => $price->getPriceFrom(), - 'priceTo' => $price->getPriceTo() - ] - ), - [ - 'label' => $label, - 'SKU' => $price->getSku(), - 'storeId' => $price->getStoreId(), - 'priceFrom' => $price->getPriceFrom(), - 'priceTo' => $price->getPriceTo() - ] - ); + $errorMessage = 'Invalid attribute %label = %priceTo. ' + . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.'; + $this->addFailedItemPrice($price, $key, $errorMessage, ['label' => $label]); } } /** - * Check that provided price value is not empty and not lower then zero and add error to aggregator if price + * Check price. + * + * Verify that provided price value is not empty and not lower then zero and add error to aggregator if price * contains not valid data. * - * @param \Magento\Catalog\Api\Data\SpecialPriceInterface $price + * @param SpecialPriceInterface $price * @param int $key * @return void */ - private function checkPrice(\Magento\Catalog\Api\Data\SpecialPriceInterface $price, $key) + private function checkPrice(SpecialPriceInterface $price, int $key): void { if (null === $price->getPrice() || $price->getPrice() < 0) { - $this->validationResult->addFailedItem( - $key, - __( - 'Invalid attribute Price = %price. ' - . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.', - [ - 'price' => $price->getPrice(), - 'SKU' => $price->getSku(), - 'storeId' => $price->getStoreId(), - 'priceFrom' => $price->getPriceFrom(), - 'priceTo' => $price->getPriceTo() - ] - ), - [ - 'price' => $price->getPrice(), - 'SKU' => $price->getSku(), - 'storeId' => $price->getStoreId(), - 'priceFrom' => $price->getPriceFrom(), - 'priceTo' => $price->getPriceTo() - ] - ); + $errorMessage = 'Invalid attribute Price = %price. ' + . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.'; + $this->addFailedItemPrice($price, $key, $errorMessage, ['price' => $price->getPrice()]); } } + /** + * Adds failed item price to validation result + * + * @param SpecialPriceInterface $price + * @param int $key + * @param string $message + * @param array $firstParam + * @return void + */ + private function addFailedItemPrice( + SpecialPriceInterface $price, + int $key, + string $message, + array $firstParam + ): void { + $additionalInfo = []; + if ($firstParam) { + $additionalInfo = array_merge($additionalInfo, $firstParam); + } + + $additionalInfo['SKU'] = $price->getSku(); + $additionalInfo['storeId'] = $price->getStoreId(); + $additionalInfo['priceFrom'] = $price->getPriceFrom(); + $additionalInfo['priceTo'] = $price->getPriceTo(); + + $this->validationResult->addFailedItem($key, __($message, $additionalInfo), $additionalInfo); + } + /** * Retrieve SKU by product ID. * diff --git a/app/code/Magento/Catalog/Model/Product/Price/TierPriceFactory.php b/app/code/Magento/Catalog/Model/Product/Price/TierPriceFactory.php index a2e151c1c962..61f64e7c4695 100644 --- a/app/code/Magento/Catalog/Model/Product/Price/TierPriceFactory.php +++ b/app/code/Magento/Catalog/Model/Product/Price/TierPriceFactory.php @@ -56,6 +56,16 @@ class TierPriceFactory */ private $customerGroupsByCode = []; + /** + * @var \Magento\Framework\Api\SearchCriteriaBuilder + */ + private $searchCriteriaBuilder; + + /** + * @var \Magento\Framework\Api\FilterBuilder + */ + private $filterBuilder; + /** * TierPriceBuilder constructor. * diff --git a/app/code/Magento/Catalog/Model/Product/Price/Validation/InvalidSkuProcessor.php b/app/code/Magento/Catalog/Model/Product/Price/Validation/InvalidSkuProcessor.php index 744fa76ff69b..b124da7b18d6 100644 --- a/app/code/Magento/Catalog/Model/Product/Price/Validation/InvalidSkuProcessor.php +++ b/app/code/Magento/Catalog/Model/Product/Price/Validation/InvalidSkuProcessor.php @@ -11,6 +11,16 @@ */ class InvalidSkuProcessor { + /** + * @var \Magento\Catalog\Model\ProductIdLocatorInterface + */ + private $productIdLocator; + + /** + * @var \Magento\Catalog\Api\ProductRepositoryInterface + */ + private $productRepository; + /** * @param \Magento\Catalog\Model\ProductIdLocatorInterface $productIdLocator * @param \Magento\Catalog\Api\ProductRepositoryInterface $productRepository diff --git a/app/code/Magento/Catalog/Model/Product/Type.php b/app/code/Magento/Catalog/Model/Product/Type.php index d7dc74e0d0cc..c2603d475e7d 100644 --- a/app/code/Magento/Catalog/Model/Product/Type.php +++ b/app/code/Magento/Catalog/Model/Product/Type.php @@ -127,6 +127,8 @@ public function factory($product) $typeModel = $this->_productTypePool->get($typeModelName); $typeModel->setConfig($types[$typeId]); + $typeModel->setTypeId($typeId); + return $typeModel; } diff --git a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php index 19f6461d44b6..6c08c493e803 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php +++ b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php @@ -504,21 +504,17 @@ public function processFileQueue() /** @var $uploader \Zend_File_Transfer_Adapter_Http */ $uploader = $queueOptions['uploader'] ?? null; $isUploaded = false; - if ($uploader && $uploader->isValid()) { + if ($uploader && $uploader->isValid($src)) { + // phpcs:ignore Magento2.Functions.DiscouragedFunction $path = pathinfo($dst, PATHINFO_DIRNAME); $uploader = $this->uploaderFactory->create(['fileId' => $src]); $uploader->setFilesDispersion(false); $uploader->setAllowRenameFiles(true); + // phpcs:ignore Magento2.Functions.DiscouragedFunction $isUploaded = $uploader->save($path, pathinfo($dst, PATHINFO_FILENAME)); } if (empty($src) || empty($dst) || !$isUploaded) { - /** - * @todo: show invalid option - */ - if (isset($queueOptions['option'])) { - $queueOptions['option']->setIsValid(false); - } throw new \Magento\Framework\Exception\LocalizedException( __('The file upload failed. Try to upload again.') ); @@ -756,6 +752,9 @@ protected function _removeNotApplicableAttributes($product) */ public function beforeSave($product) { + if (!$product->getTypeId()) { + $product->setTypeId($this->_typeId); + } $this->_removeNotApplicableAttributes($product); $product->canAffectOptions(true); return $this; diff --git a/app/code/Magento/Catalog/Model/Product/Type/Price.php b/app/code/Magento/Catalog/Model/Product/Type/Price.php index 206f3dba0ee6..8956d1d4c95a 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/Price.php +++ b/app/code/Magento/Catalog/Model/Product/Type/Price.php @@ -298,7 +298,7 @@ public function getTierPrice($qty, $product) $custGroup = $this->_getCustomerGroupId($product); if ($qty) { - $prevQty = 1; + $prevQty = 0; $prevPrice = $product->getPrice(); $prevGroup = $allGroupsId; diff --git a/app/code/Magento/Catalog/Model/ProductIdLocator.php b/app/code/Magento/Catalog/Model/ProductIdLocator.php index 2d382164f264..00a4a9751907 100644 --- a/app/code/Magento/Catalog/Model/ProductIdLocator.php +++ b/app/code/Magento/Catalog/Model/ProductIdLocator.php @@ -124,7 +124,7 @@ public function retrieveProductIdsBySkus(array $skus) private function truncateToLimit() { if (count($this->idsBySku) > $this->idsLimit) { - $this->idsBySku = array_slice($this->idsBySku, round($this->idsLimit / -2)); + $this->idsBySku = array_slice($this->idsBySku, $this->idsLimit * -1, null, true); } } } diff --git a/app/code/Magento/Catalog/Model/ProductOptionProcessor.php b/app/code/Magento/Catalog/Model/ProductOptionProcessor.php index db9f4de14295..b0ac93942b10 100644 --- a/app/code/Magento/Catalog/Model/ProductOptionProcessor.php +++ b/app/code/Magento/Catalog/Model/ProductOptionProcessor.php @@ -152,6 +152,15 @@ private function getUrlBuilder() */ private function isDateWithDateInternal(array $optionValue): bool { - return array_key_exists('date_internal', $optionValue) && array_key_exists('date', $optionValue); + $hasDate = !empty($optionValue['day']) + && !empty($optionValue['month']) + && !empty($optionValue['year']); + + $hasTime = !empty($optionValue['hour']) + && isset($optionValue['minute']); + + $hasDateInternal = !empty($optionValue['date_internal']); + + return $hasDateInternal && ($hasDate || $hasTime || !empty($optionValue['date'])); } } diff --git a/app/code/Magento/Catalog/Model/ProductRepository.php b/app/code/Magento/Catalog/Model/ProductRepository.php index fefeafe46e1c..fdee74c9559c 100644 --- a/app/code/Magento/Catalog/Model/ProductRepository.php +++ b/app/code/Magento/Catalog/Model/ProductRepository.php @@ -9,6 +9,7 @@ use Magento\Catalog\Api\CategoryLinkManagementInterface; use Magento\Catalog\Api\Data\ProductExtension; use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Model\Attribute\ScopeOverriddenValue; use Magento\Catalog\Model\Product\Gallery\MimeTypeExtensionMap; use Magento\Catalog\Model\ProductRepository\MediaGalleryProcessor; use Magento\Catalog\Model\ResourceModel\Product\Collection; @@ -17,6 +18,7 @@ use Magento\Framework\Api\ImageContentValidatorInterface; use Magento\Framework\Api\ImageProcessorInterface; use Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface; +use Magento\Framework\Api\SearchCriteriaInterface; use Magento\Framework\DB\Adapter\ConnectionException; use Magento\Framework\DB\Adapter\DeadlockException; use Magento\Framework\DB\Adapter\LockWaitException; @@ -28,6 +30,8 @@ use Magento\Framework\Exception\StateException; use Magento\Framework\Exception\TemporaryState\CouldNotSaveException as TemporaryCouldNotSaveException; use Magento\Framework\Exception\ValidatorException; +use Magento\Store\Model\Store; +use Magento\Catalog\Api\Data\EavAttributeInterface; /** * @inheritdoc @@ -178,6 +182,11 @@ class ProductRepository implements \Magento\Catalog\Api\ProductRepositoryInterfa */ private $linkManagement; + /** + * @var ScopeOverriddenValue + */ + private $scopeOverriddenValue; + /** * ProductRepository constructor. * @param ProductFactory $productFactory @@ -205,6 +214,7 @@ class ProductRepository implements \Magento\Catalog\Api\ProductRepositoryInterfa * @param int $cacheLimit [optional] * @param ReadExtensions $readExtensions * @param CategoryLinkManagementInterface $linkManagement + * @param ScopeOverriddenValue|null $scopeOverriddenValue * @SuppressWarnings(PHPMD.ExcessiveParameterList) * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ @@ -233,7 +243,8 @@ public function __construct( \Magento\Framework\Serialize\Serializer\Json $serializer = null, $cacheLimit = 1000, ReadExtensions $readExtensions = null, - CategoryLinkManagementInterface $linkManagement = null + CategoryLinkManagementInterface $linkManagement = null, + ?ScopeOverriddenValue $scopeOverriddenValue = null ) { $this->productFactory = $productFactory; $this->collectionFactory = $collectionFactory; @@ -260,6 +271,8 @@ public function __construct( ->get(ReadExtensions::class); $this->linkManagement = $linkManagement ?: \Magento\Framework\App\ObjectManager::getInstance() ->get(CategoryLinkManagementInterface::class); + $this->scopeOverriddenValue = $scopeOverriddenValue ?: \Magento\Framework\App\ObjectManager::getInstance() + ->get(ScopeOverriddenValue::class); } /** @@ -514,9 +527,12 @@ public function save(ProductInterface $product, $saveOptions = false) { $assignToCategories = false; $tierPrices = $product->getData('tier_price'); + $productDataToChange = $product->getData(); try { - $existingProduct = $product->getId() ? $this->getById($product->getId()) : $this->get($product->getSku()); + $existingProduct = $product->getId() ? + $this->getById($product->getId()) : + $this->get($product->getSku()); $product->setData( $this->resourceModel->getLinkField(), @@ -548,7 +564,6 @@ public function save(ProductInterface $product, $saveOptions = false) $productDataArray['store_id'] = (int) $this->storeManager->getStore()->getId(); } $product = $this->initializeProductData($productDataArray, empty($existingProduct)); - $this->processLinks($product, $productLinks); if (isset($productDataArray['media_gallery'])) { $this->processMediaGallery($product, $productDataArray['media_gallery']['images']); @@ -569,6 +584,48 @@ public function save(ProductInterface $product, $saveOptions = false) $product->setData('tier_price', $tierPrices); } + try { + $stores = $product->getStoreIds(); + $websites = $product->getWebsiteIds(); + } catch (NoSuchEntityException $exception) { + $stores = null; + $websites = null; + } + + if (!empty($existingProduct) && is_array($stores) && is_array($websites)) { + $hasDataChanged = false; + $productAttributes = $product->getAttributes(); + if ($productAttributes !== null + && $product->getStoreId() !== Store::DEFAULT_STORE_ID + && (count($stores) > 1 || count($websites) === 1) + ) { + foreach ($productAttributes as $attribute) { + $attributeCode = $attribute->getAttributeCode(); + $value = $product->getData($attributeCode); + if ($existingProduct->getData($attributeCode) === $value + && $attribute->getScope() !== EavAttributeInterface::SCOPE_GLOBAL_TEXT + && !is_array($value) + && $attribute->getData('frontend_input') !== 'media_image' + && !$attribute->isStatic() + && !array_key_exists($attributeCode, $productDataToChange) + && $value !== null + && !$this->scopeOverriddenValue->containsValue( + ProductInterface::class, + $product, + $attributeCode, + $product->getStoreId() + ) + ) { + $product->setData($attributeCode); + $hasDataChanged = true; + } + } + if ($hasDataChanged) { + $product->setData('_edit_mode', true); + } + } + } + $this->saveProduct($product); if ($assignToCategories === true && $product->getCategoryIds()) { $this->linkManagement->assignProductToCategories( @@ -619,7 +676,7 @@ public function deleteById($sku) /** * @inheritdoc */ - public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria) + public function getList(SearchCriteriaInterface $searchCriteria) { /** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $collection */ $collection = $this->collectionFactory->create(); @@ -628,6 +685,7 @@ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCr $collection->addAttributeToSelect('*'); $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner'); $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner'); + $this->joinPositionField($collection, $searchCriteria); $this->collectionProcessor->process($searchCriteria, $collection); @@ -856,4 +914,37 @@ private function saveProduct($product): void ); } } + + /** + * Join category position field to make sorting by position possible. + * + * @param Collection $collection + * @param SearchCriteriaInterface $searchCriteria + * @return void + */ + private function joinPositionField( + Collection $collection, + SearchCriteriaInterface $searchCriteria + ): void { + $categoryIds = [[]]; + foreach ($searchCriteria->getFilterGroups() as $filterGroup) { + foreach ($filterGroup->getFilters() as $filter) { + if ($filter->getField() === 'category_id') { + $filterValue = $filter->getValue(); + $categoryIds[] = is_array($filterValue) ? $filterValue : explode(',', $filterValue); + } + } + } + $categoryIds = array_unique(array_merge(...$categoryIds)); + if (count($categoryIds) === 1) { + $collection->joinField( + 'position', + 'catalog_category_product', + 'position', + 'product_id=entity_id', + ['category_id' => current($categoryIds)], + 'left' + ); + } + } } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Category.php b/app/code/Magento/Catalog/Model/ResourceModel/Category.php index ed2df0f10ac3..18f38f7d2bc2 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Category.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Category.php @@ -232,7 +232,10 @@ protected function _beforeDelete(\Magento\Framework\DataObject $object) */ protected function _afterDelete(DataObject $object) { - $this->indexerProcessor->markIndexerAsInvalid(); + if ($object->getIsActive() || $object->getDeletedChildrenIds()) { + $this->indexerProcessor->markIndexerAsInvalid(); + } + return parent::_afterDelete($object); } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/MediaImageDeleteProcessor.php b/app/code/Magento/Catalog/Model/ResourceModel/MediaImageDeleteProcessor.php new file mode 100644 index 000000000000..f49ddef01ca7 --- /dev/null +++ b/app/code/Magento/Catalog/Model/ResourceModel/MediaImageDeleteProcessor.php @@ -0,0 +1,146 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\ResourceModel; + +use Exception; +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Model\Product\Gallery\Processor; +use Magento\Catalog\Model\Product\Media\ConfigInterface as MediaConfig; +use Magento\Catalog\Model\ResourceModel\Product\Gallery; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\DataObject; +use Magento\Framework\Exception\FileSystemException; +use Magento\Framework\Filesystem; +use Psr\Log\LoggerInterface; + +/** + * Process media gallery and delete media image after product delete + */ +class MediaImageDeleteProcessor +{ + /** + * @var MediaConfig + */ + private $imageConfig; + + /** + * @var Filesystem + */ + private $mediaDirectory; + + /** + * @var Processor + */ + private $imageProcessor; + + /** + * @var Gallery + */ + private $productGallery; + + /** + * @var LoggerInterface + */ + private $logger; + + /** + * Product constructor. + * + * @param MediaConfig $imageConfig + * @param Filesystem $filesystem + * @param Processor $imageProcessor + * @param Gallery $productGallery + * @param LoggerInterface $logger + * @throws FileSystemException + */ + public function __construct( + MediaConfig $imageConfig, + Filesystem $filesystem, + Processor $imageProcessor, + Gallery $productGallery, + LoggerInterface $logger + ) { + $this->imageConfig = $imageConfig; + $this->mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA); + $this->imageProcessor = $imageProcessor; + $this->productGallery = $productGallery; + $this->logger = $logger; + } + + /** + * Process $product data and remove image from gallery after product delete + * + * @param DataObject $product + * @return void + */ + public function execute(DataObject $product): void + { + try { + $productImages = $product->getMediaGalleryImages(); + foreach ($productImages as $image) { + $imageFile = $image->getFile(); + if ($imageFile) { + $this->deleteProductImage($image, $product, $imageFile); + } + } + } catch (Exception $e) { + $this->logger->critical($e); + } + } + + /** + * Check if image exists and is not used by any other products + * + * @param string $file + * @return bool + */ + private function canDeleteImage(string $file): bool + { + return $this->productGallery->countImageUses($file) <= 1; + } + + /** + * Delete the physical image if it's existed and not used by other products + * + * @param string $imageFile + * @param string $filePath + * @throws FileSystemException + */ + private function deletePhysicalImage(string $imageFile, string $filePath): void + { + if ($this->canDeleteImage($imageFile)) { + $this->mediaDirectory->delete($filePath); + } + } + + /** + * Remove product image + * + * @param DataObject $image + * @param ProductInterface $product + * @param string $imageFile + */ + private function deleteProductImage( + DataObject $image, + ProductInterface $product, + string $imageFile + ): void { + $catalogPath = $this->imageConfig->getBaseMediaPath(); + $filePath = $catalogPath . $imageFile; + + if ($this->mediaDirectory->isFile($filePath)) { + try { + $this->productGallery->deleteGallery($image->getValueId()); + $this->imageProcessor->removeImage($product, $imageFile); + $this->deletePhysicalImage($imageFile, $filePath); + } catch (Exception $e) { + $this->logger->critical($e); + } + } + } +} diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product.php b/app/code/Magento/Catalog/Model/ResourceModel/Product.php index b174e4beb635..b3c50015d9db 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product.php @@ -100,6 +100,11 @@ class Product extends AbstractResource */ private $eavAttributeManagement; + /** + * @var MediaImageDeleteProcessor + */ + private $mediaImageDeleteProcessor; + /** * @param \Magento\Eav\Model\Entity\Context $context * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -114,6 +119,7 @@ class Product extends AbstractResource * @param TableMaintainer|null $tableMaintainer * @param UniqueValidationInterface|null $uniqueValidator * @param AttributeManagementInterface|null $eavAttributeManagement + * @param MediaImageDeleteProcessor|null $mediaImageDeleteProcessor * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -129,7 +135,8 @@ public function __construct( $data = [], TableMaintainer $tableMaintainer = null, UniqueValidationInterface $uniqueValidator = null, - AttributeManagementInterface $eavAttributeManagement = null + AttributeManagementInterface $eavAttributeManagement = null, + ?MediaImageDeleteProcessor $mediaImageDeleteProcessor = null ) { $this->_categoryCollectionFactory = $categoryCollectionFactory; $this->_catalogCategory = $catalogCategory; @@ -148,6 +155,8 @@ public function __construct( $this->tableMaintainer = $tableMaintainer ?: ObjectManager::getInstance()->get(TableMaintainer::class); $this->eavAttributeManagement = $eavAttributeManagement ?? ObjectManager::getInstance()->get(AttributeManagementInterface::class); + $this->mediaImageDeleteProcessor = $mediaImageDeleteProcessor + ?? ObjectManager::getInstance()->get(MediaImageDeleteProcessor::class); } /** @@ -819,4 +828,16 @@ protected function getAttributeRow($entity, $object, $attribute) $data['store_id'] = $object->getStoreId(); return $data; } + + /** + * After delete entity process + * + * @param DataObject $object + * @return $this + */ + protected function _afterDelete(DataObject $object) + { + $this->mediaImageDeleteProcessor->execute($object); + return parent::_afterDelete($object); + } } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Attribute/Backend/Tierprice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Attribute/Backend/Tierprice.php index e3edc4a0dc48..b310f6e68774 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Attribute/Backend/Tierprice.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Attribute/Backend/Tierprice.php @@ -35,6 +35,7 @@ protected function _loadPriceDataColumns($columns) $columns = parent::_loadPriceDataColumns($columns); $columns['price_qty'] = 'qty'; $columns['percentage_value'] = 'percentage_value'; + $columns['product_id'] = $this->getProductIdFieldName(); return $columns; } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php index 3f908663c8e5..a247e6b09760 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php @@ -916,7 +916,12 @@ public function addWebsiteFilter($websites = null) } $this->_productLimitationFilters['website_ids'] = $websites; - $this->_applyProductLimitations(); + + if ($this->getStoreId() == Store::DEFAULT_STORE_ID) { + $this->_productLimitationJoinWebsite(); + } else { + $this->_applyProductLimitations(); + } return $this; } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Gallery.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Gallery.php index 5ff6207074b6..28e637ad0560 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Gallery.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Gallery.php @@ -452,6 +452,9 @@ public function duplicate($attributeId, $newFiles, $originalProductId, $newProdu // Duplicate per store gallery values $select = $this->getConnection()->select()->from( $this->getTable(self::GALLERY_VALUE_TABLE) + )->where( + $linkField . ' = ?', + $originalProductId )->where( 'value_id IN(?)', array_keys($valueIdMap) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/BatchSizeCalculator.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/BatchSizeCalculator.php index 810b1b9a07c4..664ed9ead16d 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/BatchSizeCalculator.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/BatchSizeCalculator.php @@ -6,6 +6,10 @@ namespace Magento\Catalog\Model\ResourceModel\Product\Indexer\Price; +use Magento\Framework\App\DeploymentConfig; +use Magento\Framework\App\ObjectManager; +use Magento\Catalog\Model\Indexer\Product\Price\Processor; + /** * Ensure that size of index MEMORY table is enough for configured rows count in batch. */ @@ -27,16 +31,33 @@ class BatchSizeCalculator private $batchSizeAdjusters; /** - * BatchSizeCalculator constructor. + * @var DeploymentConfig|null + */ + private $deploymentConfig; + + /** + * Deployment config path + * + * @var string + */ + private const DEPLOYMENT_CONFIG_INDEXER_BATCHES = 'indexer/batch_size/'; + + /** * @param array $batchRowsCount * @param array $estimators * @param array $batchSizeAdjusters + * @param DeploymentConfig|null $deploymentConfig */ - public function __construct(array $batchRowsCount, array $estimators, array $batchSizeAdjusters) - { + public function __construct( + array $batchRowsCount, + array $estimators, + array $batchSizeAdjusters, + ?DeploymentConfig $deploymentConfig = null + ) { $this->batchRowsCount = $batchRowsCount; $this->estimators = $estimators; $this->batchSizeAdjusters = $batchSizeAdjusters; + $this->deploymentConfig = $deploymentConfig ?: ObjectManager::getInstance()->get(DeploymentConfig::class); } /** @@ -50,9 +71,18 @@ public function __construct(array $batchRowsCount, array $estimators, array $bat */ public function estimateBatchSize(\Magento\Framework\DB\Adapter\AdapterInterface $connection, $indexerTypeId) { - $batchRowsCount = isset($this->batchRowsCount[$indexerTypeId]) - ? $this->batchRowsCount[$indexerTypeId] - : $this->batchRowsCount['default']; + $batchRowsCount = $this->deploymentConfig->get( + self::DEPLOYMENT_CONFIG_INDEXER_BATCHES . Processor::INDEXER_ID . '/' . $indexerTypeId, + $batchRowsCount = $this->deploymentConfig->get( + self::DEPLOYMENT_CONFIG_INDEXER_BATCHES . Processor::INDEXER_ID . '/' . 'default' + ) + ); + + if (is_null($batchRowsCount)) { + $batchRowsCount = isset($this->batchRowsCount[$indexerTypeId]) + ? $this->batchRowsCount[$indexerTypeId] + : $this->batchRowsCount['default']; + } /** @var \Magento\Framework\Indexer\BatchSizeManagementInterface $calculator */ $calculator = isset($this->estimators[$indexerTypeId]) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/CompositeProductRelationsCalculator.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/CompositeProductRelationsCalculator.php index d03c0c51703a..730fba32c099 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/CompositeProductRelationsCalculator.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/CompositeProductRelationsCalculator.php @@ -11,6 +11,11 @@ */ class CompositeProductRelationsCalculator { + /** + * @var DefaultPrice + */ + private $indexerResource; + /** * @param DefaultPrice $indexerResource */ diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php index 77407ed699fb..be1d1637b853 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php @@ -128,6 +128,11 @@ public function getQuery(array $dimensions, string $productType, array $entityId ['cwd' => $this->getTable('catalog_product_index_website')], 'pw.website_id = cwd.website_id', [] + )->joinLeft( + // customer group website limitations + ['cgw' => $this->getTable('customer_group_excluded_website')], + 'cg.customer_group_id = cgw.customer_group_id AND pw.website_id = cgw.website_id', + [] )->joinLeft( // we need this only for BCC in case someone expects table `tp` to be present in query ['tp' => $this->getTable('catalog_product_index_tier_price')], @@ -227,6 +232,9 @@ public function getQuery(array $dimensions, string $productType, array $entityId $select->where('e.entity_id IN(?)', $entityIds); } + // exclude websites that are limited for customer group + $select->where('cgw.website_id IS NULL'); + /** * throw event for backward compatibility */ diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Price/SpecialPrice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Price/SpecialPrice.php index 7eb19193f8bd..448b3769c715 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Price/SpecialPrice.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Price/SpecialPrice.php @@ -6,10 +6,18 @@ namespace Magento\Catalog\Model\ResourceModel\Product\Price; +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Api\SpecialPriceInterface; +use Magento\Catalog\Model\ProductIdLocatorInterface; +use Magento\Catalog\Model\ResourceModel\Attribute; +use Magento\Framework\EntityManager\MetadataPool; +use Magento\Framework\Exception\CouldNotDeleteException; +use Magento\Framework\App\ObjectManager; + /** * Special price resource. */ -class SpecialPrice implements \Magento\Catalog\Api\SpecialPriceInterface +class SpecialPrice implements SpecialPriceInterface { /** * Price storage table. @@ -26,24 +34,24 @@ class SpecialPrice implements \Magento\Catalog\Api\SpecialPriceInterface private $datetimeTable = 'catalog_product_entity_datetime'; /** - * @var \Magento\Catalog\Model\ResourceModel\Attribute + * @var Attribute */ private $attributeResource; /** - * @var \Magento\Catalog\Api\ProductAttributeRepositoryInterface + * @var ProductAttributeRepositoryInterface */ private $attributeRepository; /** - * @var \Magento\Catalog\Model\ProductIdLocatorInterface + * @var ProductIdLocatorInterface */ private $productIdLocator; /** * Metadata pool. * - * @var \Magento\Framework\EntityManager\MetadataPool + * @var MetadataPool */ private $metadataPool; @@ -76,16 +84,16 @@ class SpecialPrice implements \Magento\Catalog\Api\SpecialPriceInterface private $itemsPerOperation = 500; /** - * @param \Magento\Catalog\Model\ResourceModel\Attribute $attributeResource - * @param \Magento\Catalog\Api\ProductAttributeRepositoryInterface $attributeRepository - * @param \Magento\Catalog\Model\ProductIdLocatorInterface $productIdLocator - * @param \Magento\Framework\EntityManager\MetadataPool $metadataPool + * @param Attribute $attributeResource + * @param ProductAttributeRepositoryInterface $attributeRepository + * @param ProductIdLocatorInterface $productIdLocator + * @param MetadataPool $metadataPool */ public function __construct( - \Magento\Catalog\Model\ResourceModel\Attribute $attributeResource, - \Magento\Catalog\Api\ProductAttributeRepositoryInterface $attributeRepository, - \Magento\Catalog\Model\ProductIdLocatorInterface $productIdLocator, - \Magento\Framework\EntityManager\MetadataPool $metadataPool + Attribute $attributeResource, + ProductAttributeRepositoryInterface $attributeRepository, + ProductIdLocatorInterface $productIdLocator, + MetadataPool $metadataPool ) { $this->attributeResource = $attributeResource; $this->attributeRepository = $attributeRepository; @@ -94,7 +102,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function get(array $skus) { @@ -132,7 +140,7 @@ public function get(array $skus) } /** - * {@inheritdoc} + * @inheritdoc */ public function update(array $prices) { @@ -187,49 +195,63 @@ public function update(array $prices) } /** - * {@inheritdoc} + * @inheritdoc */ public function delete(array $prices) { - $skus = array_unique( - array_map(function ($price) { - return $price->getSku(); - }, $prices) - ); - $ids = $this->retrieveAffectedIds($skus); $connection = $this->attributeResource->getConnection(); - $connection->beginTransaction(); - try { - foreach (array_chunk($ids, $this->itemsPerOperation) as $idsBunch) { - $this->attributeResource->getConnection()->delete( - $this->attributeResource->getTable($this->priceTable), - [ - 'attribute_id = ?' => $this->getPriceAttributeId(), - $this->getEntityLinkField() . ' IN (?)' => $idsBunch - ] - ); - } - foreach (array_chunk($ids, $this->itemsPerOperation) as $idsBunch) { - $this->attributeResource->getConnection()->delete( - $this->attributeResource->getTable($this->datetimeTable), - [ - 'attribute_id IN (?)' => [$this->getPriceFromAttributeId(), $this->getPriceToAttributeId()], - $this->getEntityLinkField() . ' IN (?)' => $idsBunch - ] - ); + + foreach ($this->getStoreSkus($prices) as $storeId => $skus) { + + $ids = $this->retrieveAffectedIds(array_unique($skus)); + $connection->beginTransaction(); + try { + foreach (array_chunk($ids, $this->itemsPerOperation) as $idsBunch) { + $connection->delete( + $this->attributeResource->getTable($this->priceTable), + [ + 'attribute_id = ?' => $this->getPriceAttributeId(), + 'store_id = ?' => $storeId, + $this->getEntityLinkField() . ' IN (?)' => $idsBunch + ] + ); + } + foreach (array_chunk($ids, $this->itemsPerOperation) as $idsBunch) { + $connection->delete( + $this->attributeResource->getTable($this->datetimeTable), + [ + 'attribute_id IN (?)' => [$this->getPriceFromAttributeId(), $this->getPriceToAttributeId()], + 'store_id = ?' => $storeId, + $this->getEntityLinkField() . ' IN (?)' => $idsBunch + ] + ); + } + $connection->commit(); + } catch (\Exception $e) { + $connection->rollBack(); + throw new CouldNotDeleteException(__('Could not delete Prices'), $e); } - $connection->commit(); - } catch (\Exception $e) { - $connection->rollBack(); - throw new \Magento\Framework\Exception\CouldNotDeleteException( - __('Could not delete Prices'), - $e - ); } return true; } + /** + * Returns associative arrays of store_id as key and array of skus as value. + * + * @param \Magento\Catalog\Api\Data\SpecialPriceInterface[] $priceItems + * @return array + */ + private function getStoreSkus(array $priceItems): array + { + $storeSkus = []; + foreach ($priceItems as $priceItem) { + $storeSkus[$priceItem->getStoreId()][] = $priceItem->getSku(); + } + + return $storeSkus; + } + /** * Get link field. * @@ -312,9 +334,9 @@ private function retrieveAffectedIds(array $skus) $affectedIds = []; foreach ($this->productIdLocator->retrieveProductIdsBySkus($skus) as $productIds) { - $affectedIds = array_merge($affectedIds, array_keys($productIds)); + $affectedIds[] = array_keys($productIds); } - return array_unique($affectedIds); + return array_unique(array_merge([], ...$affectedIds)); } } diff --git a/app/code/Magento/Catalog/Model/Webapi/Product/Option/Type/File/Processor.php b/app/code/Magento/Catalog/Model/Webapi/Product/Option/Type/File/Processor.php index 92302dd9ccf4..371d9e6c091f 100644 --- a/app/code/Magento/Catalog/Model/Webapi/Product/Option/Type/File/Processor.php +++ b/app/code/Magento/Catalog/Model/Webapi/Product/Option/Type/File/Processor.php @@ -59,7 +59,7 @@ public function processFileContent(ImageContentInterface $imageContent) $filePath = $this->saveFile($imageContent); $fileAbsolutePath = $this->filesystem->getDirectoryRead(DirectoryList::MEDIA)->getAbsolutePath($filePath); - $fileHash = md5($this->filesystem->getDirectoryRead(DirectoryList::MEDIA)->readFile($filePath)); + $fileHash = hash('sha256', $this->filesystem->getDirectoryRead(DirectoryList::MEDIA)->readFile($filePath)); $imageSize = getimagesize($fileAbsolutePath); $result = [ 'type' => $imageContent->getType(), diff --git a/app/code/Magento/Catalog/Observer/Compare/BindCustomerLoginObserver.php b/app/code/Magento/Catalog/Observer/Compare/BindCustomerLoginObserver.php index 27e1b4470415..0f165d96494a 100644 --- a/app/code/Magento/Catalog/Observer/Compare/BindCustomerLoginObserver.php +++ b/app/code/Magento/Catalog/Observer/Compare/BindCustomerLoginObserver.php @@ -14,6 +14,11 @@ */ class BindCustomerLoginObserver implements ObserverInterface { + /** + * @var Item + */ + private $item; + /** * @param Item $item */ diff --git a/app/code/Magento/Catalog/Observer/Compare/BindCustomerLogoutObserver.php b/app/code/Magento/Catalog/Observer/Compare/BindCustomerLogoutObserver.php index 11b8d3f854f6..ece2a48da62a 100644 --- a/app/code/Magento/Catalog/Observer/Compare/BindCustomerLogoutObserver.php +++ b/app/code/Magento/Catalog/Observer/Compare/BindCustomerLogoutObserver.php @@ -14,6 +14,11 @@ */ class BindCustomerLogoutObserver implements ObserverInterface { + /** + * @var Item + */ + private $item; + /** * @param Item $item */ diff --git a/app/code/Magento/Catalog/Plugin/Api/ProductLinkRepositoryInterface/ReindexAfterDeleteByIdProductLinksPlugin.php b/app/code/Magento/Catalog/Plugin/Api/ProductLinkRepositoryInterface/ReindexAfterDeleteByIdProductLinksPlugin.php new file mode 100644 index 000000000000..91e8629ec212 --- /dev/null +++ b/app/code/Magento/Catalog/Plugin/Api/ProductLinkRepositoryInterface/ReindexAfterDeleteByIdProductLinksPlugin.php @@ -0,0 +1,57 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Api\ProductLinkRepositoryInterface; +use Magento\Catalog\Model\Indexer\Product\Full as FullProductIndexer; + +/** + * Product reindexing after delete by id links plugin. + */ +class ReindexAfterDeleteByIdProductLinksPlugin +{ + /** + * @var FullProductIndexer + */ + private $fullProductIndexer; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @param FullProductIndexer $fullProductIndexer + * @param ProductRepositoryInterface $productRepository + */ + public function __construct(FullProductIndexer $fullProductIndexer, ProductRepositoryInterface $productRepository) + { + $this->fullProductIndexer = $fullProductIndexer; + $this->productRepository = $productRepository; + } + + /** + * Complex reindex after product links has been deleted. + * + * @param ProductLinkRepositoryInterface $subject + * @param bool $result + * @param string $sku + * @param string $type + * @param string $linkedProductSku + * @return bool + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterDeleteById(ProductLinkRepositoryInterface $subject, bool $result, $sku): bool + { + $product = $this->productRepository->get($sku); + $this->fullProductIndexer->executeRow($product->getId()); + + return $result; + } +} diff --git a/app/code/Magento/Catalog/Plugin/Api/ProductLinkRepositoryInterface/ReindexAfterSaveProductLinksPlugin.php b/app/code/Magento/Catalog/Plugin/Api/ProductLinkRepositoryInterface/ReindexAfterSaveProductLinksPlugin.php new file mode 100644 index 000000000000..480399035a7a --- /dev/null +++ b/app/code/Magento/Catalog/Plugin/Api/ProductLinkRepositoryInterface/ReindexAfterSaveProductLinksPlugin.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Api\ProductLinkRepositoryInterface; +use Magento\Catalog\Api\Data\ProductLinkInterface; +use Magento\Catalog\Model\Indexer\Product\Full as FullProductIndexer; + +/** + * Product reindexing after save links plugin. + */ +class ReindexAfterSaveProductLinksPlugin +{ + /** + * @var FullProductIndexer + */ + private $fullProductIndexer; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @param FullProductIndexer $fullProductIndexer + * @param ProductRepositoryInterface $productRepository + */ + public function __construct(FullProductIndexer $fullProductIndexer, ProductRepositoryInterface $productRepository) + { + $this->fullProductIndexer = $fullProductIndexer; + $this->productRepository = $productRepository; + } + + /** + * Complex reindex after product links has been saved. + * + * @param ProductLinkRepositoryInterface $subject + * @param bool $result + * @param ProductLinkInterface $entity + * @return bool + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterSave(ProductLinkRepositoryInterface $subject, bool $result, ProductLinkInterface $entity): bool + { + $product = $this->productRepository->get($entity->getSku()); + $this->fullProductIndexer->executeRow($product->getId()); + + return $result; + } +} diff --git a/app/code/Magento/Catalog/Plugin/Model/Indexer/Category/Product/MaxHeapTableSizeProcessorOnFullReindex.php b/app/code/Magento/Catalog/Plugin/Model/Indexer/Category/Product/MaxHeapTableSizeProcessorOnFullReindex.php index e655a66e9b91..cb4df8f162b4 100644 --- a/app/code/Magento/Catalog/Plugin/Model/Indexer/Category/Product/MaxHeapTableSizeProcessorOnFullReindex.php +++ b/app/code/Magento/Catalog/Plugin/Model/Indexer/Category/Product/MaxHeapTableSizeProcessorOnFullReindex.php @@ -15,6 +15,11 @@ */ class MaxHeapTableSizeProcessorOnFullReindex { + /** + * @var LoggerInterface + */ + private $logger; + /** * @var MaxHeapTableSizeProcessor */ diff --git a/app/code/Magento/Catalog/Plugin/RemoveImagesFromGalleryAfterRemovingProduct.php b/app/code/Magento/Catalog/Plugin/RemoveImagesFromGalleryAfterRemovingProduct.php new file mode 100644 index 000000000000..ef3abddf91e6 --- /dev/null +++ b/app/code/Magento/Catalog/Plugin/RemoveImagesFromGalleryAfterRemovingProduct.php @@ -0,0 +1,66 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Catalog\Plugin; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product\Gallery\ReadHandler; +use Magento\Catalog\Model\ResourceModel\Product\Gallery; + +/** + * Responsible for deleting images from media gallery after deleting product + */ +class RemoveImagesFromGalleryAfterRemovingProduct +{ + /** + * @var Gallery + */ + private $galleryResource; + + /** + * @var ReadHandler + */ + private $mediaGalleryReadHandler; + + /** + * @param Gallery $galleryResource + * @param ReadHandler $mediaGalleryReadHandler + */ + public function __construct(Gallery $galleryResource, ReadHandler $mediaGalleryReadHandler) + { + $this->galleryResource = $galleryResource; + $this->mediaGalleryReadHandler = $mediaGalleryReadHandler; + } + + /** + * Delete media gallery after deleting product + * + * @param ProductRepositoryInterface $subject + * @param callable $proceed + * @param ProductInterface $product + * @return bool + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function aroundDelete( + ProductRepositoryInterface $subject, + callable $proceed, + ProductInterface $product + ): bool { + $mediaGalleryAttributeId = $this->mediaGalleryReadHandler->getAttribute()->getAttributeId(); + $mediaGallery = $this->galleryResource->loadProductGalleryByAttributeId($product, $mediaGalleryAttributeId); + + $result = $proceed($product); + + if ($mediaGallery) { + $this->galleryResource->deleteGallery(array_column($mediaGallery, 'value_id')); + } + + return $result; + } +} diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductExtendedActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductExtendedActionGroup.xml index cf8a3879886f..340095e2339a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductExtendedActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductExtendedActionGroup.xml @@ -15,7 +15,9 @@ <remove keyForRemoval="selectProductTierPriceCustomerGroupInput"/> <click selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect(index)}}" stepKey="clickProductTierPriceCustGroupSelect" after="selectProductTierPriceWebsiteInput"/> - <waitForElement selector="{{AdminProductFormAdvancedPricingSection.productTierPriceGroupOrCatalogOption(groupPrice.customer_group)}}" time="30" stepKey="waitProductTierPriceGroupOrCatalogOption" after="clickProductTierPriceCustGroupSelect"/> - <click selector="{{AdminProductFormAdvancedPricingSection.productTierPriceGroupOrCatalogOption(groupPrice.customer_group)}}" stepKey="clickAllGroupsOption" after="waitProductTierPriceGroupOrCatalogOption"/> + <waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupFilterInputByIndex(index)}}" time="30" stepKey="waitProductTierPriceGroupOrCatalogOption" after="clickProductTierPriceCustGroupSelect"/> + <selectMultipleOptions filterSelector="{{AdminProductFormAdvancedPricingSection.customerGroupFilterInputByIndex(index)}}" optionSelector="{{AdminProductFormAdvancedPricingSection.customerGroupOptionByIndex(index)}}" stepKey="clickAllGroupsOption" after="waitProductTierPriceGroupOrCatalogOption"> + <array>['{{groupPrice.customer_group}}']</array> + </selectMultipleOptions> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductImageOnProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductImageOnProductPageActionGroup.xml new file mode 100644 index 000000000000..3dca650c2dcf --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductImageOnProductPageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertProductImageOnProductPageActionGroup"> + <annotations> + <description>Validates that the provided product image is present and correct.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="{{MagentoLogo.filename}}" type="string"/> + </arguments> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementVisible selector="{{AdminProductImagesSection.imageFile(image)}}" stepKey="seeImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml new file mode 100644 index 000000000000..9e0d13c1bc91 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertProductInfoOnEditPageActionGroup"> + <annotations> + <description>Verifies the general data on the Edit product details page in admin for a product.</description> + </annotations> + <arguments> + <argument name="productStatus" defaultValue="{{_defaultProduct.status}}" type="string"/> + <argument name="productAttributeSet" defaultValue="Default" type="string"/> + <argument name="productName" defaultValue="{{_defaultProduct.name}}" type="string"/> + <argument name="productSku" defaultValue="{{_defaultProduct.sku}}" type="string"/> + <argument name="productPrice" defaultValue="{{_defaultProduct.price}}" type="string"/> + <argument name="productQuantity" defaultValue="{{_defaultProduct.quantity}}" type="string"/> + <argument name="productStockStatus" defaultValue="In Stock" type="string"/> + <argument name="productWeight" defaultValue="{{_defaultProduct.weight}}" type="string"/> + <argument name="productVisibility" defaultValue="Catalog, Search" type="string"/> + <argument name="categoryName" defaultValue="{{_defaultCategory.name}}" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminProductFormSection.productStatus}}" stepKey="waitForProductStatus"/> + <seeElement selector="{{AdminProductFormSection.productStatusValue(productStatus)}}" stepKey="seeProductStatus"/> + <seeOptionIsSelected selector="{{AdminProductFormSection.attributeSet}}" userInput="{{productAttributeSet}}" stepKey="seeProductAttributeSet"/> + <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{productName}}" stepKey="seeProductName"/> + <seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{productSku}}" stepKey="seeProductSku"/> + <seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{productPrice}}" stepKey="seeProductPrice"/> + <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{productQuantity}}" stepKey="seeProductQuantity"/> + <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{productStockStatus}}" stepKey="seeProductStockStatus"/> + <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{productWeight}}" stepKey="seeProductWeight"/> + <seeOptionIsSelected selector="{{AdminProductFormSection.visibility}}" userInput="{{productVisibility}}" stepKey="seeProductVisibility"/> + <seeElement selector="{{AdminProductFormSection.categories(categoryName)}}" stepKey="seeProductCategories"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminChangeSeoUrlKeyToDefaultValueWithoutRedirectActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminChangeSeoUrlKeyToDefaultValueWithoutRedirectActionGroup.xml new file mode 100644 index 000000000000..a8539859c6d7 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminChangeSeoUrlKeyToDefaultValueWithoutRedirectActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminChangeSeoUrlKeyToDefaultValueWithoutRedirectActionGroup"> + <annotations> + <description>Requires navigation to category creation/edit page. Selects 'Use Default Value' checkbox for the 'URL Key' with 'Create Permanent Redirect for old URL' unchecked.</description> + </annotations> + + <conditionalClick selector="{{AdminCategorySEOSection.SectionHeader}}" dependentSelector="{{AdminCategorySEOSection.UrlKeyInput}}" visible="false" stepKey="clickOnSEOTab"/> + <waitForElementVisible selector="{{AdminCategorySEOSection.UrlKeyInput}}" stepKey="waitForSEOTabOpened"/> + <clearField selector="{{AdminCategorySEOSection.UrlKeyInput}}" stepKey="clearUrlKeyField"/> + <uncheckOption selector="{{AdminCategorySEOSection.UrlKeyRedirectCheckbox}}" stepKey="uncheckRedirectCheckbox"/> + <checkOption selector="{{AdminCategorySEOSection.UrlKeyDefaultValueCheckbox}}" stepKey="checkUseDefaultValueCheckbox"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml index 60438e23e084..2fb18ddfc9eb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml @@ -17,5 +17,7 @@ <click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickOnAdvancedInventoryLink"/> <waitForPageLoad stepKey="waitForAdvancedInventoryPageToLoad"/> + <!-- Wait for close button appeared. That means animation finished and modal window is fully visible --> + <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryCloseButton}}" stepKey="waitForCloseButtonAppeared"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml index fe5b0ae1a64c..703b37079aee 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml @@ -21,7 +21,7 @@ <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="clearExistingFilters"/> <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{codeFilter}}" stepKey="fillAttributeCodeFilterField"/> <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="applyGridFilter"/> - <helper class="\Magento\Catalog\Test\Mftf\Helper\CatalogHelper" method="deleteAllProductAttributesOneByOne" stepKey="deleteAllProductAttributesOneByOne"> + <helper class="Magento\Catalog\Test\Mftf\Helper\CatalogHelper" method="deleteAllProductAttributesOneByOne" stepKey="deleteAllProductAttributesOneByOne"> <argument name="notEmptyRow">{{AdminDataGridTableSection.firstNotEmptyRow2}}</argument> <argument name="modalAcceptButton">{{AdminConfirmationModalSection.ok}}</argument> <argument name="deleteButton">{{AdminMainActionsSection.delete}}</argument> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminExpandProductDesignSectionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminExpandProductDesignSectionActionGroup.xml new file mode 100644 index 000000000000..f3d742f28cab --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminExpandProductDesignSectionActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminExpandProductDesignSectionActionGroup"> + <annotations> + <description>Expand the Design section on the Product Details page in Admin.</description> + </annotations> + + <click selector="{{ProductDesignSection.DesignTab}}" stepKey="clickDesignTab"/> + <waitForPageLoad stepKey="waitForTabOpen"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductNameOnProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductNameOnProductFormActionGroup.xml new file mode 100644 index 000000000000..e2adc0937608 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductNameOnProductFormActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminFillProductNameOnProductFormActionGroup"> + <annotations> + <description>Fills in Name field on the Admin Products creation/edit page.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{productName}}" stepKey="fillProductName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductPriceFieldAndPressEnterOnProductEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductPriceFieldAndPressEnterOnProductEditPageActionGroup.xml new file mode 100644 index 000000000000..ed10792d09cf --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductPriceFieldAndPressEnterOnProductEditPageActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminFillProductPriceFieldAndPressEnterOnProductEditPageActionGroup"> + <arguments> + <argument name="price" type="string"/> + </arguments> + + <waitForElementVisible selector="{{AdminProductFormSection.productPrice}}" stepKey="waitForPriceField"/> + <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{price}}" stepKey="fillPriceField"/> + <pressKey selector="{{AdminProductFormSection.productPrice}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::ENTER]" stepKey="pressEnterButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductQtyOnProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductQtyOnProductFormActionGroup.xml new file mode 100644 index 000000000000..225638f066a2 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductQtyOnProductFormActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminFillProductQtyOnProductFormActionGroup"> + <annotations> + <description>Fills in Quantity field on the Admin Products creation/edit page.</description> + </annotations> + <arguments> + <argument name="productQty" type="string"/> + </arguments> + <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{productQty}}" stepKey="fillProductQty"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductSkuOnProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductSkuOnProductFormActionGroup.xml new file mode 100644 index 000000000000..f7b4baaeef8e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductSkuOnProductFormActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminFillProductSkuOnProductFormActionGroup"> + <annotations> + <description>Fills in Sku field on the Admin Products creation/edit page.</description> + </annotations> + <arguments> + <argument name="productSku" type="string"/> + </arguments> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{productSku}}" stepKey="fillProductSku"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminMassUpdateProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminMassUpdateProductAttributeActionGroup.xml new file mode 100644 index 000000000000..10133e45db36 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminMassUpdateProductAttributeActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminMassUpdateProductAttributeActionGroup"> + <arguments> + <argument name="attributeCode" type="string" defaultValue="{{newProductAttribute.attribute_code}}"/> + <argument name="attributeValue" type="string" defaultValue=""/> + </arguments> + <checkOption selector="{{AdminEditProductAttributesSection.toggleAttribute(attributeCode)}}" stepKey="toggleAttribute"/> + <fillField selector="{{AdminEditProductAttributesSection.attributeInput(attributeCode)}}" userInput="{{attributeValue}}" stepKey="setAttributeValue"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminMassUpdateProductAttributeSaveActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminMassUpdateProductAttributeSaveActionGroup.xml new file mode 100644 index 000000000000..aec420d6650a --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminMassUpdateProductAttributeSaveActionGroup.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminMassUpdateProductAttributeSaveActionGroup"> + <click selector="{{AdminUpdateAttributesSection.saveButton}}" stepKey="save"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitVisibleSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue" stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminOpenProductImagesSectionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminOpenProductImagesSectionActionGroup.xml index 4d49b13a8bf5..fc965dcfc629 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminOpenProductImagesSectionActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminOpenProductImagesSectionActionGroup.xml @@ -13,6 +13,8 @@ <description>Requires the navigation to the Product page. Opens 'Image and Videos' section.</description> </annotations> <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> + <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" stepKey="scrollToProductImagesSection"/> + <waitForPageLoad stepKey="waitForLoadingMediaContent"/> <waitForElementVisible selector="{{AdminProductImagesSection.imageUploadButton}}" stepKey="waitForImageUploadButton"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAssertImageAltTextActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAssertImageAltTextActionGroup.xml new file mode 100644 index 000000000000..bf1324fce969 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAssertImageAltTextActionGroup.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminProductAssertImageAltTextActionGroup"> + <annotations> + <description>Assert product image alt text.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="ProductImage"/> + <argument name="altText" defaultValue="{{ProductImage.title}}" type="string"/> + </arguments> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageFile(image.fileName)}}" visible="false" stepKey="expandImages"/> + <waitForElementVisible selector="{{AdminProductImagesSection.imageFile(image.fileName)}}" stepKey="seeProductImageName"/> + <click selector="{{AdminProductImagesSection.imageFile(image.fileName)}}" stepKey="clickProductImage"/> + <waitForElementVisible selector="{{AdminProductImagesSection.altText}}" stepKey="seeAltTextSection"/> + <grabValueFrom selector="{{AdminProductImagesSection.altText}}" stepKey="actualAltText"/> + <assertEquals stepKey="assertAltText"> + <expectedResult type="string">{{altText}}</expectedResult> + <actualResult type="variable">actualAltText</actualResult> + </assertEquals> + <click selector="{{AdminSlideOutDialogSection.closeButton}}" stepKey="clickCloseButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetVisibleInAdvancedSearchActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetVisibleInAdvancedSearchActionGroup.xml new file mode 100644 index 000000000000..bd7c59ffc385 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetVisibleInAdvancedSearchActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminProductAttributeSetVisibleInAdvancedSearchActionGroup"> + <annotations> + <description>Set 'Visible in Advanced Search' value for product attribute</description> + </annotations> + <arguments> + <argument name="isVisibleInAdvancedSearch" type="string" defaultValue="Yes"/> + </arguments> + + <scrollToTopOfPage stepKey="scrollToTopOfPage"/> + <click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStorefrontPropertiesTab"/> + <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.VisibleInAdvancedSearch}}" stepKey="waitForVisibleInAdvancedSearchElementVisible"/> + <selectOption selector="{{AdvancedAttributePropertiesSection.VisibleInAdvancedSearch}}" userInput="{{isVisibleInAdvancedSearch}}" stepKey="setVisibleInAdvancedSearchValue"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductChangeImageAltTextActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductChangeImageAltTextActionGroup.xml new file mode 100644 index 000000000000..e56328bbb5c6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductChangeImageAltTextActionGroup.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminProductChangeImageAltTextActionGroup"> + <annotations> + <description>Change product image alt text.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="ProductImage"/> + <argument name="altText" defaultValue="{{ProductImage.title}}" type="string"/> + </arguments> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageFile(image.fileName)}}" visible="false" stepKey="expandImages"/> + <waitForElementVisible selector="{{AdminProductImagesSection.imageFile(image.fileName)}}" stepKey="seeProductImageName"/> + <click selector="{{AdminProductImagesSection.imageFile(image.fileName)}}" stepKey="clickProductImage"/> + <waitForElementVisible selector="{{AdminProductImagesSection.altText}}" stepKey="seeAltTextSection"/> + <fillField selector="{{AdminProductImagesSection.altText}}" userInput="{{altText}}" stepKey="fillAltTextSection"/> + <click selector="{{AdminSlideOutDialogSection.closeButton}}" stepKey="clickCloseButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSaveCategoryFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSaveCategoryFormActionGroup.xml index 5521cc2a7d0b..30a9dd4276eb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSaveCategoryFormActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSaveCategoryFormActionGroup.xml @@ -17,6 +17,7 @@ <scrollToTopOfPage stepKey="scrollToTopOfTheCategoryPage"/> <click selector="{{AdminMainActionsSection.save}}" stepKey="saveCategory"/> <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessageAppears"/> + <dontSee selector="{{AdminCategoryMessagesSection.saveCategoryWarningMessage}}" stepKey="dontSeeWarningMessage"/> <see userInput="You saved the category." selector="{{AdminMessagesSection.success}}" stepKey="assertSuccessMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetProductAsNewDateActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetProductAsNewDateActionGroup.xml new file mode 100644 index 000000000000..219bc73655c8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetProductAsNewDateActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminSetProductAsNewDateActionGroup"> + <arguments> + <argument name="fromDate" type="string"/> + <argument name="toDate" type="string"/> + </arguments> + + <fillField selector="{{AdminProductFormSection.setProductAsNewFrom}}" userInput="{{fromDate}}" stepKey="fillProductNewFrom"/> + <fillField selector="{{AdminProductFormSection.setProductAsNewTo}}" userInput="{{toDate}}" stepKey="fillProductNewTo"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminNoValidationErrorForPriceFieldOnProductEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminNoValidationErrorForPriceFieldOnProductEditPageActionGroup.xml new file mode 100644 index 000000000000..c1281fdaa499 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminNoValidationErrorForPriceFieldOnProductEditPageActionGroup.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminNoValidationErrorForPriceFieldOnProductEditPageActionGroup"> + <dontSeeElement selector="{{AdminProductFormSection.priceFieldError}}" stepKey="dontSeeValidationError"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductFormAdvancedPricingAddTierPriceActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductFormAdvancedPricingAddTierPriceActionGroup.xml new file mode 100644 index 000000000000..64acee0b077c --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductFormAdvancedPricingAddTierPriceActionGroup.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminProductFormAdvancedPricingAddTierPriceActionGroup" extends="AdminProductFormAdvancedPricingAddTierPriceActionGroup"> + <annotations> + <description>Check tier price on Advanced Pricing dialog on the Admin Product creation/edit page.</description> + </annotations> + <remove keyForRemoval="selectWebsite"/> + <remove keyForRemoval="selectCustomerGroup"/> + <remove keyForRemoval="fillQuantity"/> + <remove keyForRemoval="selectPriceType"/> + <remove keyForRemoval="fillPriceAmount"/> + <remove keyForRemoval="waitCustomerGroupFilterAppears"/> + <remove keyForRemoval="selectCustomerGroupValue"/> + <executeJS function="return window.getComputedStyle(document.querySelector("{$priceAmountSelector}")).getPropertyValue('min-width')" after="waitPriceAmountFieldAppers" stepKey="priceMinWidth"/> + <assertEquals after="priceMinWidth" stepKey="assertWebsiteAmounts"> + <actualResult type="string">$priceMinWidth</actualResult> + <expectedResult type="string">60px</expectedResult> + </assertEquals> + <click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceDeleteButton}}" after="assertWebsiteAmounts" stepKey="clickCustomerGroupPriceDeleteButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminValidationErrorAppearedForPriceFieldOnProductEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminValidationErrorAppearedForPriceFieldOnProductEditPageActionGroup.xml new file mode 100644 index 000000000000..c206ee582b51 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminValidationErrorAppearedForPriceFieldOnProductEditPageActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminValidationErrorAppearedForPriceFieldOnProductEditPageActionGroup"> + <arguments> + <argument name="errorMessage" type="string" defaultValue="This is a required field."/> + </arguments> + + <waitForElementVisible selector="{{AdminProductFormSection.priceFieldError}}" stepKey="waitForValidationError"/> + <see selector="{{AdminProductFormSection.priceFieldError}}" userInput="{{errorMessage}}" stepKey="seeElementValidationError"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageAdminProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageAdminProductPageActionGroup.xml index 6ea154d2b01d..c2a2dd5c13de 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageAdminProductPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageAdminProductPageActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertProductImageAdminProductPageActionGroup"> + <actionGroup name="AssertProductImageAdminProductPageActionGroup" deprecated="Use AdminAssertProductImageOnProductPageActionGroup instead"> <annotations> <description>Validates that the provided Product Image is present and correct.</description> </annotations> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontAttributeOptionQuantityInLayeredNavigationActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontAttributeOptionQuantityInLayeredNavigationActionGroup.xml new file mode 100644 index 000000000000..f1ffc1475e87 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontAttributeOptionQuantityInLayeredNavigationActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontAttributeOptionQuantityInLayeredNavigationActionGroup" extends="AssertStorefrontAttributeOptionPresentInLayeredNavigationActionGroup"> + <annotations> + <description>Asserts visible attribute option quantity</description> + </annotations> + <arguments> + <argument name="attributeOptionQuantity" type="string" defaultValue="1"/> + </arguments> + <see selector="{{StorefrontCategorySidebarSection.visibleOptionQty(attributeOptionPosition)}}" userInput="{{attributeOptionQuantity}}" after="assertAttributeOptionInLayeredNavigation" stepKey="assertOptionQuantity"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductAttributeLabelVisibleActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductAttributeLabelVisibleActionGroup.xml new file mode 100644 index 000000000000..ea2ea3b12eba --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductAttributeLabelVisibleActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontProductAttributeLabelVisibleActionGroup"> + <arguments> + <argument name="productAttributeLabel" type="string"/> + </arguments> + <see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="{{productAttributeLabel}}" stepKey="seeProductAttributeLabel"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductDropDownOptionValueActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductDropDownOptionValueActionGroup.xml new file mode 100644 index 000000000000..a633c3bc06c5 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductDropDownOptionValueActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontProductDropDownOptionValueActionGroup"> + <annotations> + <description>Validates that the provided Product Option is selected under the provided Drop-down Attribute.</description> + </annotations> + <arguments> + <argument name="attributeLabel" type="string" defaultValue="{{ProductAttributeFrontendLabel.label}}"/> + <argument name="optionLabel" type="string" defaultValue="{{productAttributeOption1.label}}"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID(attributeLabel)}}" stepKey="waitForAttributeVisible" /> + <seeOptionIsSelected selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID(attributeLabel)}}" userInput="{{optionLabel}}" stepKey="assertAttributeOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByCustomDateRangeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByCustomDateRangeActionGroup.xml new file mode 100644 index 000000000000..30b15abb234d --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByCustomDateRangeActionGroup.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="FilterProductGridByCustomDateRangeActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the provided Date Filter.</description> + </annotations> + <arguments> + <argument name="code" type="string"/> + <argument name="date" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.inputByCodeRangeFrom(code)}}" userInput="{{date}}" stepKey="fillProductDatetimeFromFilter"/> + <fillField selector="{{AdminProductGridFilterSection.inputByCodeRangeTo(code)}}" userInput="{{date}}" stepKey="fillProductDatetimeToFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormActionGroup.xml index f2524d6e68bf..670eb04b55bd 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormActionGroup.xml @@ -17,6 +17,7 @@ <waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveProductButton"/> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/> <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitProductSaveSuccessMessage"/> + <dontSee selector="{{AdminProductMessagesSection.saveProductWarningMessage}}" stepKey="dontSeeWarningMessage"/> <see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductNameIsNotOnProductMainPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductNameIsNotOnProductMainPageActionGroup.xml new file mode 100644 index 000000000000..ccda16f37085 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductNameIsNotOnProductMainPageActionGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup"> + <annotations> + <description>Validates that the provided Product Name is NOT present on a Storefront page.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + + <waitForPageLoad stepKey="waitForTheProductPageToLoad"/> + <dontSee selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{productName}}" stepKey="dontSeeProductName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertRelatedProductOnProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertRelatedProductOnProductPageActionGroup.xml new file mode 100644 index 000000000000..2d31eae0aedd --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertRelatedProductOnProductPageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontAssertRelatedProductOnProductPageActionGroup"> + <annotations> + <description>Validates that the provided Product Name is present on Product details page.</description> + </annotations> + <arguments> + <argument name="productName" type="string" defaultValue="{{_defaultProduct.name}}"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontProductRelatedProductsSection.relatedProductsListSectionText}}" stepKey="waitForRelatedProductsList"/> + <see selector="{{StorefrontProductRelatedProductsSection.relatedProductsListSectionText}}" userInput="{{productName}}" stepKey="seeRelatedProduct"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertSubCategoryNameIsNotShownInMenuActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertSubCategoryNameIsNotShownInMenuActionGroup.xml new file mode 100644 index 000000000000..157138f5e667 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertSubCategoryNameIsNotShownInMenuActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontAssertSubCategoryNameIsNotShownInMenuActionGroup" extends="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup"> + <annotations> + <description>Validate that the subcategory is not present in menu on Frontend.</description> + </annotations> + <arguments> + <argument name="parentCategoryName" type="string"/> + </arguments> + <moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName(parentCategoryName)}}" before="doNotSeeCatergoryInStoreFront" stepKey="showSubCategories"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontNavigateToCategoryUrlActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontNavigateToCategoryUrlActionGroup.xml new file mode 100644 index 000000000000..f93862788654 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontNavigateToCategoryUrlActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontNavigateToCategoryUrlActionGroup"> + <annotations> + <description>Goes to the Storefront Category page for the provided Category URL.</description> + </annotations> + <arguments> + <argument name="categoryUrl" type="string"/> + </arguments> + <amOnPage url="{{StorefrontCategoryPage.url(categoryUrl)}}" stepKey="goToStorefrontCategoryPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageSelectDropDownOptionValueActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageSelectDropDownOptionValueActionGroup.xml index 31b18e1f0d37..9cb3f3faf2f3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageSelectDropDownOptionValueActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageSelectDropDownOptionValueActionGroup.xml @@ -18,5 +18,6 @@ </arguments> <selectOption selector="{{StorefrontProductInfoMainSection.productOptionSelect(attributeLabel)}}" userInput="{{optionLabel}}" stepKey="fillDropDownAttributeOption"/> + <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontRemoveFirstProductFromCompareActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontRemoveFirstProductFromCompareActionGroup.xml new file mode 100644 index 000000000000..fefcdb6930c6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontRemoveFirstProductFromCompareActionGroup.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontRemoveFirstProductFromCompareActionGroup"> + <annotations> + <description>Open Compare Products list and remove a product</description> + </annotations> + + <amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage"/> + <waitForElementVisible selector="{{StorefrontProductCompareMainSection.removeFirstItem}}" stepKey="waitForButton"/> + <click selector="{{StorefrontProductCompareMainSection.removeFirstItem}}" stepKey="clickOnButton"/> + <waitForElementVisible selector="{{ModalConfirmationSection.OkButton}}" stepKey="waitForModal"/> + <scrollTo selector="{{ModalConfirmationSection.OkButton}}" stepKey="scrollToModal"/> + <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOkButton"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml index 9639bc39b45f..0fb4f3ef3205 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml @@ -11,6 +11,7 @@ <entity name="_defaultCategory" type="category"> <data key="name" unique="suffix">simpleCategory</data> <data key="name_lwr" unique="suffix">simplecategory</data> + <data key="urlKey" unique="suffix">simplecategory</data> <data key="is_active">true</data> </entity> <entity name="ApiCategory" type="category"> @@ -20,12 +21,14 @@ <entity name="SimpleSubCategory" type="category"> <data key="name" unique="suffix">SimpleSubCategory</data> <data key="name_lwr" unique="suffix">simplesubcategory</data> + <data key="urlKey" unique="suffix">simplesubcategory</data> <data key="is_active">true</data> <data key="include_in_menu">true</data> </entity> <entity name="NewRootCategory" type="category"> <data key="name" unique="suffix">NewRootCategory</data> <data key="name_lwr" unique="suffix">newrootcategory</data> + <data key="urlKey" unique="suffix">newrootcategory</data> <data key="is_active">true</data> <data key="include_in_menu">true</data> <data key="parent_id">1</data> @@ -45,22 +48,27 @@ <entity name="FirstLevelSubCat" type="category"> <data key="name" unique="suffix">FirstLevelSubCategory</data> <data key="name_lwr" unique="suffix">firstlevelsubcategory</data> + <data key="urlKey" unique="suffix">firstlevelsubcategory</data> </entity> <entity name="SecondLevelSubCat" type="category"> <data key="name" unique="suffix">SecondLevelSubCategory</data> <data key="name_lwr" unique="suffix">secondlevelsubcategory</data> + <data key="urlKey" unique="suffix">secondlevelsubcategory</data> </entity> <entity name="ThirdLevelSubCat" type="category"> <data key="name" unique="suffix">ThirdLevelSubCategory</data> - <data key="name_lwr" unique="suffix">subcategory</data> + <data key="name_lwr" unique="suffix">thirdlevelsubcategory</data> + <data key="urlKey" unique="suffix">thirdlevelsubcategory</data> </entity> <entity name="FourthLevelSubCat" type="category"> <data key="name" unique="suffix">FourthLevelSubCategory</data> - <data key="name_lwr" unique="suffix">subcategory</data> + <data key="name_lwr" unique="suffix">fourthlevelsubcategory</data> + <data key="urlKey" unique="suffix">fourthlevelsubcategory</data> </entity> <entity name="FifthLevelCat" type="category"> <data key="name" unique="suffix">FifthLevelCategory</data> - <data key="name_lwr" unique="suffix">category</data> + <data key="name_lwr" unique="suffix">fifthlevelcategory</data> + <data key="urlKey" unique="suffix">fifthlevelcategory</data> </entity> <entity name="SimpleRootSubCategory" type="category"> <data key="name" unique="suffix">SimpleRootSubCategory</data> @@ -73,6 +81,7 @@ <entity name="SubCategory" type="category"> <data key="name" unique="suffix">SubCategory</data> <data key="name_lwr" unique="suffix">subcategory</data> + <data key="urlKey" unique="suffix">subcategory</data> <data key="is_active">true</data> <data key="include_in_menu">true</data> </entity> @@ -95,6 +104,7 @@ <entity name="CatNotIncludeInMenu" type="category"> <data key="name" unique="suffix">NotInclMenu</data> <data key="name_lwr" unique="suffix">notinclemenu</data> + <data key="urlKey" unique="suffix">notinclemenu</data> <data key="is_active">true</data> <data key="include_in_menu">false</data> </entity> diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ImageContentData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ImageContentData.xml index 6e40499d0efe..6f270feb20b6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ImageContentData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ImageContentData.xml @@ -8,11 +8,16 @@ <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> - <entity name="TestImageContent" type="ImageContent"> + <entity name="TestImageContent" type="ImageContent"> <data key="base64_encoded_data">/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDIBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAGAAYAMBIgACEQEDEQH/xACXAAEBAAMBAQEBAAAAAAAAAAAABgMEBQgCAQcQAAEDAQUFBgQDCQAAAAAAAAABAgMEBQYRFpESMTZV0QchcnOzwhMUIkEygaE1QlFSYXGCsbIBAAEFAQAAAAAAAAAAAAAAAAACAwQGBwERAAECAwMLBAMBAAAAAAAAAAEAAgMEERMhkRQxMzRBUVJTcXKxBRJhoSKBwUL/2gAMAwEAAhEDEQA/AP7+AYKysp7Po5aurlbFBEmL3u3NQ6ASaBdArcFnBN5/urzqn0d0Gf7q86p9HdCRkUzy3YFOWEXhOCpATef7q86p9HdBn+6vOqfR3QMimeW7AosIvCcFSAm8/wB1edU+jugz/dXnVPo7oGRTPLdgUWEXhOCpATef7q86p9HdBn+6vOqfR3QMimeW7AosIvCcFSA1bPtGktWiZWUM7Z6d6qjZG7lwXBf1Q2iO5paaOFCmyCDQoTd/uBLX8n3IUhN3+4EtfyfchIk9Zh9w8pyBpW9QvN4Bwbcsujis+pq2Q4Tq5HbW0u9XJj3Y4fc0ibjPgQjEY0GgJNTS4brj/FaIz3Q2FwFafNP4V3gc1aWz7FY+rjhVrsNjBrlcrsV3Iir/ABPxtqzRyM+boJKeJ7kakm2jkRV3Yom4TlbYf4xrnfFSBuqaCn7ouWwbc+4/FT90XTBz57RlbVvpqWjdUSRoiyfWjUbju71MUlqSyWdVPjpnsqIUVJI3ORFZ3fix+4OnoLSRU3V2HZnANKEjcEGOwVG74OxdUGjZM1RNQROqIlYuw3Zcr9pXpgn1f0xN4kQYgiww8bU4xwe0OG1eg+y7gCg8cvqOLEjuy7gCg8cvqOLEzT1HXIvcfKq0zpn9ShN3+4EtfyfchSE3f7gS1/J9yCJPWYfcPKTA0reoXm85l4P2HUf4/wDSHTPmSOOZiskY17F3tcmKKaXMwjGgvhj/AECMQrTFZ72ObvC5lvxq+gjeivRsUzXvVn4kb34qmpozxWc+NjVtWtqPiOREjbMj1Vf7YFHvMMdLTxP244ImP/maxEUhzMhaxC8UvABrXZuoR9pmLL+9xddfvXNrfkVtJyPqJaOpRiL8VHbKPT8+5THFVS1FnWnE+VKhsUbmsmamG3i1e78jsSwQzoiTRRyIm5HtRf8AZ9MjZGxGMY1rU/damCHTJPMQuDgAa5q31G0VpdnrnuRYO9xNaA1+/r9rUsmeGazqdscrHuZExHo1cVauH30U3THFBDBtfBijj2t+w1Ex0MhMgMcyG1r843J+GC1oDs69B9l3AFB45fUcWJHdl3AFB45fUcWJm3qOuRe4+VV5nTP6lCbv9wJa/k+5CkJu/wBwJa/k+5BEnrMPuHlJgaVvULzeADUlbUAAIQAAhAACF6D7LuAKDxy+o4sSO7LuAKDxy+o4sTMPUdci9x8qqTOmf1KE3f7gS1/J9yFITd/uBLX8n3IIk9Zh9w8pMDSt6hebwAakragABCAAEIAAQvQfZdwBQeOX1HFiR3ZdwBQeOX1HFiZh6jrkXuPlVSZ0z+pQwVlHT2hRy0lXE2WCVMHsduchnBEBINQmQaXhTeQLq8lp9XdRkC6vJafV3UpASMtmeY7Epy3i8RxU3kC6vJafV3UZAuryWn1d1KQBlszzHYlFvF4jipvIF1eS0+ruoyBdXktPq7qUgDLZnmOxKLeLxHFTeQLq8lp9XdRkC6vJafV3UpAGWzPMdiUW8XiOK1bPs6ksqiZR0MDYKdiqrY27kxXFf1U2gCO5xcauNSmySTUr/9k=</data> <data key="type">image/jpeg</data> <data key="name" unique="prefix">test_image.jpg</data> </entity> + <entity name="AdobeBaseContent" type="ImageContent"> + <data key="base64_encoded_data">/9j/4AAQSkZJRgABAQAASABIAAD/4QCARXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAKgAgAEAAAAAQAAAGSgAwAEAAAAAQAAAGQAAAAA/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/iDFhJQ0NfUFJPRklMRQABAQAADEhMaW5vAhAAAG1udHJSR0IgWFlaIAfOAAIACQAGADEAAGFjc3BNU0ZUAAAAAElFQyBzUkdCAAAAAAAAAAAAAAAAAAD21gABAAAAANMtSFAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEWNwcnQAAAFQAAAAM2Rlc2MAAAGEAAAAbHd0cHQAAAHwAAAAFGJrcHQAAAIEAAAAFHJYWVoAAAIYAAAAFGdYWVoAAAIsAAAAFGJYWVoAAAJAAAAAFGRtbmQAAAJUAAAAcGRtZGQAAALEAAAAiHZ1ZWQAAANMAAAAhnZpZXcAAAPUAAAAJGx1bWkAAAP4AAAAFG1lYXMAAAQMAAAAJHRlY2gAAAQwAAAADHJUUkMAAAQ8AAAIDGdUUkMAAAQ8AAAIDGJUUkMAAAQ8AAAIDHRleHQAAAAAQ29weXJpZ2h0IChjKSAxOTk4IEhld2xldHQtUGFja2FyZCBDb21wYW55AABkZXNjAAAAAAAAABJzUkdCIElFQzYxOTY2LTIuMQAAAAAAAAAAAAAAEnNSR0IgSUVDNjE5NjYtMi4xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYWVogAAAAAAAA81EAAQAAAAEWzFhZWiAAAAAAAAAAAAAAAAAAAAAAWFlaIAAAAAAAAG+iAAA49QAAA5BYWVogAAAAAAAAYpkAALeFAAAY2lhZWiAAAAAAAAAkoAAAD4QAALbPZGVzYwAAAAAAAAAWSUVDIGh0dHA6Ly93d3cuaWVjLmNoAAAAAAAAAAAAAAAWSUVDIGh0dHA6Ly93d3cuaWVjLmNoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRlc2MAAAAAAAAALklFQyA2MTk2Ni0yLjEgRGVmYXVsdCBSR0IgY29sb3VyIHNwYWNlIC0gc1JHQgAAAAAAAAAAAAAALklFQyA2MTk2Ni0yLjEgRGVmYXVsdCBSR0IgY29sb3VyIHNwYWNlIC0gc1JHQgAAAAAAAAAAAAAAAAAAAAAAAAAAAABkZXNjAAAAAAAAACxSZWZlcmVuY2UgVmlld2luZyBDb25kaXRpb24gaW4gSUVDNjE5NjYtMi4xAAAAAAAAAAAAAAAsUmVmZXJlbmNlIFZpZXdpbmcgQ29uZGl0aW9uIGluIElFQzYxOTY2LTIuMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdmlldwAAAAAAE6T+ABRfLgAQzxQAA+3MAAQTCwADXJ4AAAABWFlaIAAAAAAATAlWAFAAAABXH+dtZWFzAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAACjwAAAAJzaWcgAAAAAENSVCBjdXJ2AAAAAAAABAAAAAAFAAoADwAUABkAHgAjACgALQAyADcAOwBAAEUASgBPAFQAWQBeAGMAaABtAHIAdwB8AIEAhgCLAJAAlQCaAJ8ApACpAK4AsgC3ALwAwQDGAMsA0ADVANsA4ADlAOsA8AD2APsBAQEHAQ0BEwEZAR8BJQErATIBOAE+AUUBTAFSAVkBYAFnAW4BdQF8AYMBiwGSAZoBoQGpAbEBuQHBAckB0QHZAeEB6QHyAfoCAwIMAhQCHQImAi8COAJBAksCVAJdAmcCcQJ6AoQCjgKYAqICrAK2AsECywLVAuAC6wL1AwADCwMWAyEDLQM4A0MDTwNaA2YDcgN+A4oDlgOiA64DugPHA9MD4APsA/kEBgQTBCAELQQ7BEgEVQRjBHEEfgSMBJoEqAS2BMQE0wThBPAE/gUNBRwFKwU6BUkFWAVnBXcFhgWWBaYFtQXFBdUF5QX2BgYGFgYnBjcGSAZZBmoGewaMBp0GrwbABtEG4wb1BwcHGQcrBz0HTwdhB3QHhgeZB6wHvwfSB+UH+AgLCB8IMghGCFoIbgiCCJYIqgi+CNII5wj7CRAJJQk6CU8JZAl5CY8JpAm6Cc8J5Qn7ChEKJwo9ClQKagqBCpgKrgrFCtwK8wsLCyILOQtRC2kLgAuYC7ALyAvhC/kMEgwqDEMMXAx1DI4MpwzADNkM8w0NDSYNQA1aDXQNjg2pDcMN3g34DhMOLg5JDmQOfw6bDrYO0g7uDwkPJQ9BD14Peg+WD7MPzw/sEAkQJhBDEGEQfhCbELkQ1xD1ERMRMRFPEW0RjBGqEckR6BIHEiYSRRJkEoQSoxLDEuMTAxMjE0MTYxODE6QTxRPlFAYUJxRJFGoUixStFM4U8BUSFTQVVhV4FZsVvRXgFgMWJhZJFmwWjxayFtYW+hcdF0EXZReJF64X0hf3GBsYQBhlGIoYrxjVGPoZIBlFGWsZkRm3Gd0aBBoqGlEadxqeGsUa7BsUGzsbYxuKG7Ib2hwCHCocUhx7HKMczBz1HR4dRx1wHZkdwx3sHhYeQB5qHpQevh7pHxMfPh9pH5Qfvx/qIBUgQSBsIJggxCDwIRwhSCF1IaEhziH7IiciVSKCIq8i3SMKIzgjZiOUI8Ij8CQfJE0kfCSrJNolCSU4JWgllyXHJfcmJyZXJocmtyboJxgnSSd6J6sn3CgNKD8ocSiiKNQpBik4KWspnSnQKgIqNSpoKpsqzysCKzYraSudK9EsBSw5LG4soizXLQwtQS12Last4S4WLkwugi63Lu4vJC9aL5Evxy/+MDUwbDCkMNsxEjFKMYIxujHyMioyYzKbMtQzDTNGM38zuDPxNCs0ZTSeNNg1EzVNNYc1wjX9Njc2cjauNuk3JDdgN5w31zgUOFA4jDjIOQU5Qjl/Obw5+To2OnQ6sjrvOy07azuqO+g8JzxlPKQ84z0iPWE9oT3gPiA+YD6gPuA/IT9hP6I/4kAjQGRApkDnQSlBakGsQe5CMEJyQrVC90M6Q31DwEQDREdEikTORRJFVUWaRd5GIkZnRqtG8Ec1R3tHwEgFSEtIkUjXSR1JY0mpSfBKN0p9SsRLDEtTS5pL4kwqTHJMuk0CTUpNk03cTiVObk63TwBPSU+TT91QJ1BxULtRBlFQUZtR5lIxUnxSx1MTU19TqlP2VEJUj1TbVShVdVXCVg9WXFapVvdXRFeSV+BYL1h9WMtZGllpWbhaB1pWWqZa9VtFW5Vb5Vw1XIZc1l0nXXhdyV4aXmxevV8PX2Ffs2AFYFdgqmD8YU9homH1YklinGLwY0Njl2PrZEBklGTpZT1lkmXnZj1mkmboZz1nk2fpaD9olmjsaUNpmmnxakhqn2r3a09rp2v/bFdsr20IbWBtuW4SbmtuxG8eb3hv0XArcIZw4HE6cZVx8HJLcqZzAXNdc7h0FHRwdMx1KHWFdeF2Pnabdvh3VnezeBF4bnjMeSp5iXnnekZ6pXsEe2N7wnwhfIF84X1BfaF+AX5ifsJ/I3+Ef+WAR4CogQqBa4HNgjCCkoL0g1eDuoQdhICE44VHhauGDoZyhteHO4efiASIaYjOiTOJmYn+imSKyoswi5aL/IxjjMqNMY2Yjf+OZo7OjzaPnpAGkG6Q1pE/kaiSEZJ6kuOTTZO2lCCUipT0lV+VyZY0lp+XCpd1l+CYTJi4mSSZkJn8mmia1ZtCm6+cHJyJnPedZJ3SnkCerp8dn4uf+qBpoNihR6G2oiailqMGo3aj5qRWpMelOKWpphqmi6b9p26n4KhSqMSpN6mpqhyqj6sCq3Wr6axcrNCtRK24ri2uoa8Wr4uwALB1sOqxYLHWskuywrM4s660JbSctRO1irYBtnm28Ldot+C4WbjRuUq5wro7urW7LrunvCG8m70VvY++Cr6Evv+/er/1wHDA7MFnwePCX8Lbw1jD1MRRxM7FS8XIxkbGw8dBx7/IPci8yTrJuco4yrfLNsu2zDXMtc01zbXONs62zzfPuNA50LrRPNG+0j/SwdNE08bUSdTL1U7V0dZV1tjXXNfg2GTY6Nls2fHadtr724DcBdyK3RDdlt4c3qLfKd+v4DbgveFE4cziU+Lb42Pj6+Rz5PzlhOYN5pbnH+ep6DLovOlG6dDqW+rl63Dr++yG7RHtnO4o7rTvQO/M8Fjw5fFy8f/yjPMZ86f0NPTC9VD13vZt9vv3ivgZ+Kj5OPnH+lf65/t3/Af8mP0p/br+S/7c/23////AABEIAGQAZAMBEQACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/3QAEAA3/2gAMAwEAAhEDEQA/APy/r+Jz/roCgAoAKACgAoAKACgAoAKACgAoAKAP/9D8v6/ic/66AoAKACgAoAKACgAoAKACgAoAKACgD//R/L+v4nP+ugKACgAoAKACgAoAKACgAoAKACgAoA//0vy/r+Jz/roCgB8aGSRIx1d1QZ6AuwUE47Anmmt16ilJRjKT2hGUnbe0U5O22tk7frsfrz+x3/wRu+O37aH7P3g39onwB8V/g74U8LeNrzxTaaboXjPSPHdz4js28KeJtT8K3r382hajDpjrc3+kXVzaC3jDJaSQLPmXezfd5L4c53n2XUczwmZ5Th6GIlWUKWJw2MqV4exqyoy5pUsTCm+acJSjaOkZRTu05H8W+OH04PD/AMCfErPvDDiLgvjfOc34eo5PWxWZZHmXDtDK8Qs5yjB51QWHp5jllfFx9jhsdQo1va1ZJ141ZU/ctCP07/xDj/tU/wDReP2dP/BF8U//AJbV6v8AxCHiT/oc5H/4RZh/82/Lf8fePyX/AIqf+Ef/AEbjxN/8PHB3/wA52uvl+h+YH7cn7EPi39hH4heDvhh4/wDid8M/H/i/xX4OvvHNxpvw7tfENpL4V0GHWotC0ifxHF4j1C8uRJ4nvf7Q/sJbWGGN4dD1eWV2EKhfjOIuHMXwvjcPl+Ox+AxuJxGFljHHAUq9P6tSjV9jTeJVetVaeKl7T6vy8qaw1d/Zsf1p9H7x8yf6Q3DWe8WcPcI8V8M5Jk2eYbh6jjOJsTlmKp5xmVXAVcxxtHLKmVYDB0bZPh44aWZe2lUnGWZZfGnFe0fP8QzSCG3ubgo8otrW5ujDEAZpltYXuJI4VJCvM0cb+VGzJ5sm2MMGcV8/OXJCc+WU+SEp8kFec+VN8sI/am7Wim43el9T98pQVSrRpOUYe2rUaPPO6p03WqQpRnUaTcaUZTj7SSUnCDc+VqMuX97fh7/wQC/aC+KPgTwb8SPBX7Rv7NeueEfHnhfQfF/hrV7LR/iZcW2o6L4h0y11XT7qKa31mSCQSW90oYxOYw6sEyuK/SsH4WZ7j8Jhsbhc9yCrhsXQpYihVhhMdOFSlWpxnCcZLF2alGSd1ddm9Gf508R/tHvDnhTiDPOF898K/FTL864ezbMMlzXA4jNOEqVfCY/LMXVweKoVaVXJoVITp1aMk41Ep/zWa5TsD/wbj/tUgZ/4Xx+zpwCf+QF8Uv66sB+Z/LFdH/EIeJf+h1kf/hHj/wD5qf5feeN/xU98JP8Ao2/idv8A9Dfg/wC//kUP7rO/lf3fxY/aY+A/iP8AZe+P3xQ/Z58X63oPiTxT8K7/AMO2Gs674Xt9StfDuot4n8Mad4rsH0qHWZp9URYLDU4La7F45f7ZHMY8RFFX4POMoxORZhicsxdahiMRhZQjOthoVKdCftKUK0eSFWdSorQqRjLmk3zRbWj5Y/3d4VeIWWeLfhtwj4nZLl+Y5TlPGOHzbEYHLs3r4TEZnhY5NnGJyTExxlXA0cPhJOrisLOtQdClb6vOCnealOXhteWffBQAUAf/0/y/r+Jz/roCgCe1/wCPm3/67w/+jFprdeqM638Gt/15q/8ApuR/dJ/wQU/5RgfAH/sM/GX/ANXH41r+n/Dr/kksu/6+Y3/1MrH/AD9/tFv+Ut/Ev/sD4G/9YTh4/YDUtQstJ0++1TUrmKy07TbO61DULyd/LgtLGyge5u7md+iQwW8UkkjkgKqk5GBX205xpwlUnJRhCMpzk9FGMVeUm+iSTbP4mw2Hr4vEUMLhaU62JxNalh8PRpxcqlavXqRp0aVOK1c51JKMY63btZ7H+b3+2t+0je/ta/tP/GD49TT3Mmi+M/FMtn4Dtrh7ojT/AIXeEvP8P/Dq2iguY4GthqGjxXXi6eL7NFIl94uvLeZpvsscr/x/n+bTz7PMzziUrwxdfkwaUuaMMtwvNSwCi03F+1pueMlaMZRni5U5c3soyP8AqD8BvC2h4M+EvBPh1GlShmOR5TDEcSVacaN8TxhnipZnxTUnVoyqKs8JjHhsgpz9tOLw+QUa0I0vrE4R+Wkd43SSNikkbpJG45KSRsHRgOhKsobB4OMGvJTtr1Wp+uuMZxlCa5oTjKE47c0JpxnG+65otq61V7o/su/4N9P2nk+I/wCzh4r/AGatev5JfE/7OGs27+FYbmW8mnufg549mvtU8KJDNcoyyw+Etft/EngwolxPLBZaTpM9yYhqECV/QHhLnH1nJcRklaadbJa1sKnPmnLK8U5VMLo7yjHDVViMFHmlKU44eNRv31GP+HH7SPwnlwt4o5R4p5fh4QynxTwNV5vOjDD06dLjrhyGHweeynSoyi6c87y+tlPEXNLD0YVMRmWMo0VN4StM/oGf7jf7rfyr9YP84FuvVH+fB/wV3/5Sdftjf9jD8I//AFTXhSv5c8Qf+Sszf/r7hv8A1CoH/Sd9C7/lEzwN/wCxZx1/632bn50V8Uf0yFABQB//1Py/r+Jz/roCgCe1/wCPm3/67w/+jFprdeqM638Gt/15q/8ApuR/dJ/wQU/5RgfAH/sM/GX/ANXH41r+n/Dr/kksu/6+Y3/1MrH/AD9/tFv+Ut/Ev/sD4G/9YTh4qf8ABcj9pyb4CfsW6/4E8OasdM+IX7R+pf8ACovD81uzC+03wld2sup/FLxFbeTfWM8Mmm+B7TU7GyuUmzHq+qaYqRzySpby8HihnTyvhqpg6FR08ZnlaOWUXB8tSGHmnUzGtTfPT5J0sDCv7KfN7taVO0ZycYSf0AfCin4jeO+W5/muDWL4Z8L8L/rvmdOql9XxmcYevSwnCGVVufDYmlUp43iTEYCpiqM6bU8vw2Mc5U4RnVpfwvSPBFHJKVjs7O1t5JSkaMYbGwsrdpGWOOFGcwWNnAdqRIz+VDhEJwrfzb7kI6KNOnThsrRhTp04/JKEIR7WUV0P+gmMalScIc0sRXrVoU1OcoxqYnFYmtGCc5zcYqrisTVV5TkoqpVvOVryPevjt+zb8V/2cZPhLF8U9EbR5vjL8FvCPxw8LRLZ6hbmz0HxTNLb3PhrV2vIhGnivwpOdLi8R2yNB5Ta/pfl2cQZy3q5plOMyl5fHGUpUpZjlmHzOhGaSkqVdtToztJtV8M3TWIik4Q9tS5akudo/OvDzxS4N8UYcaVOD8esbT4G49zrw/zabxOErLE4/KKcK1DOMDHDvmeS55SjjqmU1ZRnzLK8ap4mpJQR9G/8EvP2m3/ZV/bU+EHjzUb77F4E8X6kvwe+KW//AI9z4L+Il7aadpOr3Gby1jB8JePh4Z1NJ5Y7s2umaj4gZIoo5JrhPR4Ozn+weJsrx0pcmFxNVZVmLekfquOko0KkvejeWHx/1Zwm1NU6VbFe6lOU4/l/0tvCleL/AID8bcP4bDvEcQ5FhXxzwgo/xP7d4Xw9bE5hgqdsPWm1nXC/9sYeVKFTDqvjcBlKlUnKNKjL/QuDB4iysHBQkOpBVgVyrKVJBDAhhgkYPU9a/rM/5rLWlZppqWqe8XfVNbpp6a6/gf58X/BXf/lJ1+2N/wBjD8I//VNeFK/lzxB/5KzN/wDr7hv/AFCoH/Sb9C7/AJRM8Df+xZx1/wCt9m5+dFfFH9MhQAUAf//V/L+v4nP+ugKAJ7X/AI+bf/rvD/6MWmt16ozrfwa3/Xmr/wCm5H90f/BBU4/4Jf8AwBPf+2fjJj3J+MfjUAfiePbvX9P+HX/JJZd/18xv/qZWP+fz9otr9LjxL/7A+Bvu/wBROHvXp5fefzkf8Fqf2oI/2jP22fF2gaBqq6h8Pv2dtPn+Cnhf7NPa3Fjc+LYb221n4u6zBJbozM7eIodC8IyF5yY5/Bl7AIotshl/F/EPO1nXE+JhScZYPJYyyrDTTup4nnhVzScbe44KvDD4W799VsHWg7KKcv8ATj6CHhLLwx8BcmzPMsG8LxL4n4qnx7mqq0q9LEUsjlQrZfwPgakKrhFR/s2rm2e03Gk1Ohn+Erc8uaCh8x/8E8f2Zj+1t+198Hfg1fWP27wbcavL4++KKulvLbp8Lvh3cadq/iGxu4rgsrweK9ZuPDfg2WMwSrPYa7qcBKFlavF4YyX/AFhz/LMqlrh6lSWMzGLimpZbgZU6lem7+644ivPC4SrGSkp0cRVjZWUo/q/0mPFb/iDHgpxvxzhsQ8PntPB0+GuEJQlWp1v9cOKaWMwWWYqhUoq8KuSZbQznPqc+eEqeMy/A1FzKMoy/qK/4L0fsu2vxV/Y/t/jX4c0WKXxh+yvezeMAtla2aXc3wh1eC20b4m6LC7mJltNK0mLTvGMNrHNFEt94TsZju8kI37V4qZJHG8PwzajGMcRw/N4qUuXfLKkVTzKk+VObhCioYuMI6e2wlKTUlHll/kp+zv8AFqtwf42y4DzLHzhkfjBQp5C/b1a7oUuNsHVqY7g/MJwp+0TrYrMZ4jIqladOc/qee4ymnD2nNH+KCa3hcXNldktbXENzY3bREZa2uoZLa4aE/ONxhkdoWG7B2Mp4DL/O04QqRnTmr06kZU5rXWE04yWlmrxbV07rdW0P946VWcXRxFD3atKpRxNBVE7RrUKkK9GNRe67KrCMakb6rmi7rm5v9Ar/AIJOftSv+1Z+xR8MvE2vatHqnxL+HdrJ8H/iyxntZLt/G/gK2ttPOs3cVqkSwf8ACXaC2j+LbXdBB5trrEUqxIrqi/1NwFnss/4awVevKLx+Dvl2ZRTV44vCKMHO13JRxNF0sVSc+WUqNenPlXMkf83n0xPCKPg948cWZRl2CnhOFOJK0ONuCl7OtCiuHOJKlXFU8DRnWc5VXkePWNyLENVa3JicuqwdWcouR/IV/wAFd/8AlJ1+2N/2MPwj/wDVNeFK/D/EH/krM3/6+4b/ANQqB/tV9C7/AJRM8Df+xZx1/wCt9m5+dFfFH9MhQAUAf//W/L+v4nP+ugKAJ7X/AI+bf/rvD/6MWmt16ozrfwa3/Xmr/wCm5H9cf7BX7TFl+yJ/wQO0P46ShJtc8OWvxm0jwHpjedv1v4keLPjT4x8OeA9JT7PDcSqlz4i1Kyku5xC8dpYQ3V7PsgtpJF/f8jzlZB4aPNEoSrUKePhhKU5qmq2NrY2tSwdFTekfaV5wjd3stUnsf4y/SP8ACrEeNP7RrNPD2nKVLA5tiOBMXxDjF7O2X8LZPwBkWa8R49+1q0acpYfKcJiXRpOrCeIxDpYelz1asIH8j17c315d3V5qWo3Gsapd3V3fapq93JJJdaxrGpXlzqetaxcvNJLJ5+s6ze6hqs6s7CKW9aJMRRotfz7FTS/eVHVqylOpWqu961erOVWvWd3Jp1q051XFPli5OMbRUVH/AGZw9LD0KNGhhMLSwGDo0aGHweAoxhCll+BwmHpYPLsvpRpwpx9nl2XYfC4CElFOpDDKrO85ycv6Sf8Aghf8Vv2Mf2ZfA3xf+Lvx4/aQ+CHw7+LnxJ8RweBtB8K+LfH2laT4n8PfC3wIzvbXF/pepRWNzpreN/Fmoa34ltwDdrd6B/wjsgu5Ujhjt/1vwzzPhbI6OZ5jmue5Xgsyx1aOEhhsZi6GHxOGwOCuoKVOc4yUcViKtfF05tN1KFSg/hUD/Lj9oJwd46eK3EXBPBfh54V+IfFHBfCuU1OIMwzjJeF8wx+UZnxhxIofWKeFx2CljKOLjw/kmFyvJazf1d0c0pZtB4eE51JT/p78DfEz4G/tT/DLWtV+G3jjwX8Yfhf4kj1/wVrGreE9YsfEPh7UBLaGw1/RZru1ae3aaO1vdlzAwZgkqkjDAr+24THZXnuCqVcDi8LmWArqrhp1cNVhXoT93kq0+eEpxbSlaSv11P8AJziDhXj7wl4pweB4q4fz7gni3K5ZfneEwOdYDFZVmmFcayxOXY6FCvCnWjCVWipUqiUbuL25fe/zsv2p/gBrX7LX7Qvxc+AOtRyj/hWPjLUNF8PXUzSO2r/D6/8A+Jz8M9cSWWzsfPF94KvNM0+7mjjnQ67omuQm7uZYJZX/AJIzbKp5FmuYZLPmvl2JlSouStz4Gp+9y+pHROcfqkqdGVS3vV6FePNOUJyP+mjwi8SMF4veGnBfiRgZQvxZkeHx+aUYckVguJ8M/qHF+AlThXxDpOhxDRxWNoU5ypyWWZpllRYehTqwpw/WL/ggV+1D/wAKl/am1j4A+INQkh8H/tMaGbTRI5pLtrOy+L/w+0y61HQGVFWW3tpPFvgSHWNFeV2tYpLrwho1uPPvNRRK+78Lc5ll/EFbLKk0sLnlH92pSso5pg4XpcsXdylisFGpCXLyqH1KDd3O5/HP7Rnwl/1y8JMD4kZbhoTzrwpx/tMxlCOHhXxHBHE+NpYbME5PkrVlkfE1XB46EIxxM1R4jx1T91hsFJx+NP8Agrv/AMpOv2xv+xh+Ef8A6prwp/n/APVXleIP/JWZv/19w3/qFQP3T6F3/KJngb/2LOOv/W+zc/Oivij+mQoAKAP/1/y/r+Jz/roCgCa3ZUngZjhVmiZieyhwWPGTwATwOfemt16oiqnKlVjFXlKlUjFd5ShJJfNtLyPtP4lftIJqv7Bf7FP7I/h/WUurX4ZXnxg+LXxZsrbztkXj7xX8QNZuPhn4YvybgRGTwl4V8Sa3rk1vJbzH+1P7Dvt9u4gD+9j82rYjhvhjJJTvHCSzPNcwguW0cZWxtT+zcJPltCrHB4evWm5xi+avRoV3KE0lP8L4X8L5YT6Rvj7405ll86FTiulwTwVwViK3s71eG8n4ZwNDi7OcLH2POo51m+TZfltKtCpBfUq2aYbkrJ1XD4mrwD93JUnmjXbHIyLkkhTjJPc8DJwPU8cccU7vbp/X4+f3ESp05vmlCMpWSvLVpLZLXS2+il6aWl/Qr/wQD/a98NfCD4o/GD4B/EzxZovhPwR8VtFtvil4Y1zxPqukaFoWn/EfwZBpnhjxPplxqepXdnHFdeLfB0nhvULBGD/a7nwzri+dvSCKv1Lwrz2llmZZlleMrQoYTM6UcwoVq06dKjTx2EhRwuIpSqT5IqWJwqw06MfelOWGxN5e7CJ/mr+0d8F804z4S4I8SOFsox2bZ5wdjqvB2bYDK8JjsxzDEcL57Wxuc5Ni6eFwtCtejkuexznCYqanH2NLNsqtStOpVOs/4OAfB3wa8ca78G/2n/hP8Svhr4u1qW3n+C3xR0nwj4x0HX9YnsXefxD8NPFNzY6Vq9zM9to+prrvhW7u2sX8iLxXZyy3MFpZXDNv4q4fAYjEZZnuX4vCYipKM8qzCnhq9KtVcJXr4HFSjSlOTp4eoq+Hm+S0Y4z2kp06dKo5eJ+zf4g41yHBcc+EnF/DHE+T4FTp8e8J4zOMlx+AwVLE0o08r4tyilXxeCpwVXMMDPL85pUliqftJ5DVpU6VfE4mjy/zs+E/GPiX4e+J/Dfj/wAF3jaf4y8B6/o/jjwffKHza+KfCd7FrWiBwk9rI1rf3Np/Y2pRi5gE2lanfQSSCOVxX5MqtfDTpYrCvlxmCq08Zg5bNYrCy9rRi3eNoVZL2FZKUOehVq03NRk3H/TfOMjyribKc14Zz6j9ZyLiPLcdw7nuH929XJ87oSy/MJQc6VaMa+EpVlmODqOlUdLHYHC1YU5ThE+nf2+fjD4V/aF/bF+NPx38EX0V94Y+K9l8I/EVmke/fo+qaf8AC7QvDninw1dBySt9oXiLSL6O6Rtrxm6SF1LROa93ijMo5txBmWY0Zc+FxiwGIoO0U6UvqFGjiMLJJKTlRr0ZTc53v7b2cdKVz8n+jlwVnXhr4G8A+HfEOEqYTN+DMRxxleJ53Fxx2FxvGGNzjKM3oOKSeGzHLMbRdCcXKFRYd1I2jOKPkKvBP2kKACgD/9D8v6/ic/66AoAKAFyeBk4HT278enPP+TQH66vz/pf1sJQAUAMkihmQx3FvbXUTEFoby1tr23YqcqWt7uKaB2U8ozRlkPKYJJWZwhUi4VIQqQlvCpCM4uzTV4yTi7NJq+zV001eN06lSlJTpVa1GaulUoV62HqpPdRq4epSqxUlpJKaUlo7pWjDFZWEDiS30zSbSUBgJrLSNLsZwrDay+fZWcExRhwyF9jdwcfLEMPh6T5qVChSk005UqNKnJxbTs5QhFtXSdtVdJtRtFS0nisXVjyVsZj68Lp+zxOYY7FU7p3T9licVWpqSdnGahzR6NXfNZrUwFJJ6kk8Dk54HQd+g4H9OlAf194lABQAUAf/0fy/r+Jz/roCgAoAKACgAoAKACgAoAKACgAoAKAP/9L8v6/ic/66AoAKACgAoAKACgAoAKACgAoAKACgD//T/L+v4nP+ugKACgAoAKACgAoAKACgAoAKACgAoA//2Q==</data> + <data key="type">image/jpeg</data> + <data key="name" unique="prefix">adobe-base.jpg</data> + </entity> <entity name="MagentoLogoImageContent" type="ImageContent"> <data key="base64_encoded_data">iVBORw0KGgoAAAANSUhEUgAAAP8AAAEsCAYAAAAM1WX/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAACY7SURBVHhe7Z0LlBxXnd6HXWyWhx9g8HS3pJFGPVU1klmC2RB28frBIbY00y2NpBnN9GMkG4JJcOJsgCVrszZg56wJuxj2BTjLY8FsADsb20kwmEc4WYgNxPYuiwX2yg9ZxrKsefS7R5IlufP/qm+N76hbo5qa7p6qru875zs6M5quvvd/76/q3lt1/9VDhU/7Ll79ikrauL66y8pVUsZ1ezf1nan+i6KoblV+bP22uUlrT+1dG2vlycEa/pWfH5kej4+oP6Eoqpt0aGx9vJqxvnF892Dt2JUbavmMNW/8fEx+X81aXy9MxNerj1AUFWQ9eGHPy4sp4wOHJ60ZXOWLWauW08CH8TN+r0YBM8W0+f47B3vOUIegKCpoyo/HL6tkzAcA9eFdgw3Qn2z8/5z8Hf6+krEeyE/EL1WHoigqCHo+2X9+MW18dm5y8MSLV25sCvrpfEI+V520TuA4h4b6etWhKYryqwTWXTJ3fxpXbyzone5qfyrjc+WsjALeLSeBrPl0MWNOqq+gKMpPmh3rf2Mpbdxbu2pj7ejuDZ6hP9k4Do6HEUQpY34zl+r/TfWVFEWtpH52ee+rZF7/kbmsVQb4hZPgbZVxXBx/btIqldLmjQeSkVeqIlAU1Wnl0gNJAf/nGOJXlzHEd2scH99jLwhmzX8sTgwkVFEoiuqEcjvW9pWzxleO7hqsHT/pnn2njO/F95cz5pefk/KoolEU1S5VM+Y1law1hatvqck9+04Z34vvr48CrEMolyoiRVGtVG5n/0Vylf07zLvd3LPvlFEOlAflkqnA/5kdX/92VWSKopajZ8Zir53LGrdWJ61jL161oW0Lest1fUFwQ60i5ZxLG7fuT/Sdq6pAUdRSVU4ZqXLGenK59+w7ZZTP2SxUzlpPlNPGhKoKRVFuND22zpQh9N+euHJD7YXdK7Ogt1yj3Ch/JWv97fSOPktVjaKoZsK++krGuK6cNUu4emKzTTOwgmJns5CcyIqVtPkH9zJvAEU1amZi3eXVjPkQYMHmGr8P8d0a9XA2C1Wz5oOFsXX/UlWZosKt6a1rotWs9XmsmGOY3AygbjHqd3hysFbNWH+1X+qtQkBR4VMpZbynOmkewFWxlO2eq/2pjPqhnvboJms+i/qrUFBUOFRI9f+WdP7v4tbYkRZuwgmKUV/UG/WXqcB3Cjvjb1Ghoaju1L6RtedUM8YtMsw/2s5NOEGxs1moOmkdKWeMjyM+KlQU1T3KTxjb57LWL+3V7wDcs++UEQfEoz4VsH6RT63fpkJGUcFWPXGm+V+PyzD35MSZ9EI7iUQrGetriJsKIUUFS0icmU8ZH0BCTFzVmiXOpBca8XGeDTictaaLqYH/gDiqkFKU/1VKxy+Zy1h24sxuumffKSNe9mYhiV81a92fG4tfokJLUf7UoZ19vcWM8ZnqMhJn0guNONqJRFPGXyIxqQo1RflHFSTOnLT24WoVhE04QTHiaG8Werf9bMBTchLYrUJOUSurfCr+5lLG+taLV25oaeJMeqER13oi0Q21Ytr4Vn7nwD9TTUBRndWeS899dTltfFSu9hXes++cnWcD5iTuiP/By3tfpZqEotqvysRAopOJM+mFRrz1RKKVlDGsmoai2qN64kzzS0d3r1ziTHqh0Q5HdtmJRP86t7N/jWoqimqdyinj31Wz1iFcbVYycSa90GgHJ5GotM/zTCRKtUzFifjvyBDfTpyJKwyh96fRLmgftBMSiRbT639bNSFFLU3PXBF7bSVdT5yJ3WfNOhztPzuJRKXdXqhkjE8ykSi1JBVSRqqStR7nPftgGu3lPBuAdkR7qqalqOY6OBrfKJ3l7iAnzqQXGu2IRUEZBdw1s3XNBtXUFFXXnrHBM2SIf305Y5ZxtecmnO4x2lFLJFpCO+8ZHDxDNT0VZs2MDlxezVh24sxqiBb0AASemMO/zf6/24x2RfvW7woMPjjDRKLh1dT2NZG5tHkbEkqeCNEmHEAA6Oek3vm0+Rh2z4XtsWS0t51INGv+F2zGUl2CCoNKE8bV1UkrNIkzYdSxrJJnYgNSLjWQrSUjr5wZj++qZq2n8Xv8f1hi8VIiUetXTCQaAk3vjL9FzvahTJyJ9/xVZIg/lzH//Int/W9QIbF1UH6uZI2/kJOA/XfNPt+NRvs7iUQlLt/Jj8cvVCGhukUzm/vPKmaMj8sV70iYNuGgc9svzJA6y0nv/unR+KUqJE01PR6/rDpp3m9fEUO0/uFsFqpI/yimjFv2Sn9RIaGCrPzEeiTO/AU6dFgSZ6KO8yvcGTNXThkfuGN7z6+pkCyqj17c8+tyovygjBJy+HxY7nygjkwk2iWa2rbOqGSsO5AQMmyJM+uJMDfgzTjfOLTFWyLMqR39A3LiuBPHCWf87ESi30AcVEgovwsJH4sTxgfDljhTv3LJVfuX+fTADhWSZamUGhiVk8Cj9nFDOHJCP5KpwAd+ICMiFRLKj8qND1wcxsSZzpy1nDXx8otbprec8xoVkpZoZvPZZ1UzxsflpBLONZN32W8Wuh/9S4WE8ouwWl1MG39RnbSOvyids1lDdqPROZ3VagHzu+1+7RVeM1bJGN8L590S3CIdPI5+hv6mQkKtpJDQ8XDIEmeijs596nLGPFDp8H1qGQVcXZXvxfeH6jkJNa2qZq19chLYpcJBdVpI4FhKG6FMnGm/6lqGo5W0eRte8a1C0lHNjK2OyRTjr7CHvttfLa4b/cxJJCr9716ZCrxJhYRqtw4kI68sp4yPze2y7E04YZp/Os+mlzLmQ4Xx+BUqJCuqQmr9JinPw/YVMSQjL9hZZ5nLWmUkEkW/VCGh2qFieiCJhI2h62hq5bmaNYtytf+DvZt6zlQh8YX2buo7s5IxrkP57BOylLdZPbrN9glZTQWQ0LWYGUiokFCtUn5i7dpqxrr9qFz5wpQ4E50L+9ExrC6nzXtmR+MbVUh8qdlUfGM5Y/4PJx9CWE7OMPol+mc5bX0lP7J2rQoJtRzJvPLasCXORB21xaXHZVg5ocIRCMm0DJmQnkAmnXAtwjojNOsQEr6qcFBLVXE8/rZKxrITZ2JxKyxXEWcuiRx0hbRxq8wlz1MhCZRQ7lLa+BTqgfo0q2s3Gv3Ufsmo1BmJRGfHmEjUtZBwsZoxPilXjtB1Gjv7rP1AidU1nWYW2Y8n5SQu9QrfSdx+/uKFatb8k30ja89RIaGaqTAxkLaHizJ0CuNw8fCkdbCcMq+pqXh0i27o6XlZQYbBc1nr+bBO36RfM5FoM81MGIMSnLvCmDgTC0Uv7FZvnMms7VMh6Uqphdsvo75hWriFnYXbSsb879M7DEuFJLy6F7eI0sb1SKyIs2OYNuE4t4jkavgPsyF711xR6iv1/hnqH5Zbtqijs1mojESiGeM69H8VknBpdjx+hcyFHrQBCNtc0O70VjXMb5nFW47lJHBTNWvNIR5helirvlkIdwXMB5FAVoWk+4XEmdWM+QUs/oT1sVC56n0zlzJ+U4Uk1Do0PvAmice9oX1MW0Y+1bT1eXChQtKdKqSN91YnQ7ghRG3Ckavc0/kJ40oVDkpTfnzgKonPfsQpnIlEzWcLE8bVKhzdI2zCkcp9J6yJM6VT42r/508m+89XIaGa6HmJTyVj/aVMicKbSHTSvC8/Gn+zCklw9eTYurPLKeMW6fyHcc8+TPM650EPmdfdPzUWv0SFhHKh6Yn4pQJBaJOyVLODh8tp84/AjwpJsITEmQL9L9GAoUycmbVmkTiT6Z+8CXGrMJFosBKJHhpbH0fiyOOhTpxpfu35HX39KiTUMnRoIr5eLiJfC3MiUan/1wsSBxUS/8lOnClXusMhT5xZmjC2q5BQLRQSkoY+kWjafD84UyHxh/Lj8cukYew5Whg34eBlD9WMccujLU6cSS3U9BbzNSqR6NGwrSFpzwbcn59Y/OUrHRFWZ4tp47Nzk4MnXgzZyy6d1VkZkn13Zqz/rSokVAdUSPe/VaaW9USiu0J290g4q05aJ8op4zPgT4Wks0ICQ+n49Rc8hmgYNp84M2s9V8p04X3ZAKmUNt4ro4CDaI/QJRJ9tz0KeLqYMSdVONqv2bH+NyJxIYZdYU2cicSV0ylzRRJnUgs1M2bEymnj8+F9YtTO6fjNXKq/fU+M/uzy3lfJvP4jc1mrHNb5VhmJMydC9Cx2gFRIx6+Q9rETiYbx2YC5SatUSps3tjyRaA6JMzPmzxHYMCXOdFZaZY5VkCH+dX5LnEkt1A8uXv0KGZVeLyAU0G5ov2bt2m0Gj/OJRLPmPxYnWpBINLdjbV85a3wlbIkz4fnEmRnjLuQbUCGhAiC0l0wF7kb7hTE/hJ1INGN++TnhV4VkaapmzGsqWWsKZ5PQJs6cMMdVOKgAqpA2JtCOaM8wZoYSfg+BYxWO0yu3s/8iOWuEMnFm/X1s1jEZOt5aGIu9VoWECrCeHYm+TqZsn0a7on3DtFbl7C+xE4mOr3+7CkmjnpHOPpc1bq0HaUP4gvQupFiy/m7RIFGBVS5tXlS1s0GHNJGocD0nFzUkyFUhqQt54csZ68nwDY/qQ/w5GR4VJox/i0STKiRUF+qOnp5fU4lE7fdAhOkRdGc6W85aT8y/ByI3MXDHcRkahHJhROosQ/yvYGHTDgYVCiGRqEwFbg9lIlGpL3gH9z3Ht6+pFXbG6/8pV8KT/7ibjDOgljjzZ8VxY0j1ByqEQuJU9AP0h1DcwlZ8g3dw3zM7FKnZ3rq6lhuXkwD+oAtPAvbcB42ctSphTpxJLdSesXNfXcZbnyetStc+vKaYBt/g3GG+Z3Y4WrPtnAS29dXyKUN9oMmBAmaczecTZ05a/2t2vP8C1e4UNS88ti6jgO5KJAp+wbHwDK7nGVfMvwS/Y/Wfue1ra/m0Wf9wswP73PoiR3XS2ldMx3epdqaoU6qYMnZ3xYY1cCv8gmOda92N8DvGHyditdxo/0sHO/kLfOwT9tbHwVolY3zmudH1r1dtS1GnFfpLJWt9Zk76T+A2CylOwS34bQa941PDD+OD8JZVtRwWBXFgH58EcJaef7AhYz4wvSN+mWpPilqypsf63yH96MeBeOBNsQlOwes8u824Vl4cfsfqQLmta2r58QHfnQTQKM4mHDlj54oZ44NMnEm1QrchPV3a+H3pV3n0L989G+CwKFyCTzfQO3YHv2N10Ny2tbWcsyjYrEAd9nzizKz5tUPbfJzokAqs7MS0WevreC7AN4lEhT9wCB51Pt16afA7xpdgPWDHuhVbFMTZ10mcKY3CxJlUR2QnEp1c4USi4A2LecLf6eb1i9kb/I7xpUk5CYytf6lQJxe0Da4/r2xDf1iu9n/ExJlUJ7V389lnlTPGx/FyjY4+G6D4Am/gziv0jpcHP4wCwFva/5AQzrK4B2tvVMia353eGX+Lag+K6rimR/t/q+IkEm3nswGKKfshHZeLeW68fPgd2wWSf0fW1PITrV0URFDnE2dmzAOllPEeFf/QSaY3g7WxwTPUj77Q3k19Z6Jc6sfQqZoxrm7LC2gdhoQncGXz1QLoHbcOfseqcDn7ScHWrAfgXuuRXYO1ctr6/MzY6piKeah0aGdfbylrfTmXMp6ckWGn+rUvlHvnWWdLuZ4qZ80voZzq16HSzLboKrkwfQH9tCXPBoAbezGvbwFXrXTr4XeMwi5jURBnTydxZiljPlwYj1+h4hw6VVLWu8oZ61e1q9+IWD7+zGjsN9R/+UJIGjmbMp9C+UpSzkp64Cr1X6FTJR2/opQ2/x791lMiUXDSgsU8N24f/I5R+OSqJS0KOvfs5yatfCVtXI/EjCq2odLUePzCatb8NuaUWOuA82njsZZnaF2msEkqlzL3Yt7rrMlUs9a9U93wqmkP2if9Vfrth5eUSFRxUV/MU/P6Zjy10O2HH0ZFxDkXi4J64sywziORJr2aMf9T5aRXmwcBfpTTuRtTxt2YtHmz38rbKc2OxjeeNpGoYgFcgA+HlaYctdidgd+xU7GRNbXchLNzsD400l52+bjMnUKbOLM0Ed9azVh77FicdB85KPDDepvKKOCRXCq+Rf156FRIGSmJweN4y878ZiGn7wsH9cW8zkHvuLPwO1aVxI4j6TS1Oek0MkQ6WkoZn0TCRRWzUCk/tmadDPH/BleIUz1BFiT4daM+yJojo5mv5kfWrlUfC5Wkzc5DYlj0c/R39PvFdtx1wisDv2OpdHnLqlppbN3B2XEjlIkzsQehOGG+v5I1T/tq86DCj/q8tPfCnC6nzN9DPj318VAJiUQr0t/R71cKescrC7/4ha2x2vRQ5CcqNqGSDPl+V672/xdQuNk1FlT4HaN+zq5LGQb/KLfTvEgdIlSaHer9Kfp9Mx466RWH/6gEYWY48pCKSyj0mAwBKxnzzypZ6wTSpDcDpZmDDr9u5NAvS/0rafNPwzTVq4lnhyMPo98346GTJvwdVmFiIF2dtJ7A1X6pmWK6CX7U28m0JPPgx2dTRkodrqtF+DWHBX7kDpzLmPcgRxwW9ZYCveNugt8x4uDc3pXR0D2zqfhGddiuFOHX3O3wA9RCeuBGmeOWcZUruHng4xTuRvgdIy6IT3XSLEm8bnjIZ3VslQi/5m6Gf3Zi/WYZ0tqPerYiL3w3ww8jPtp7FR6eHVu/SX1F14jwa+5G+PFq5HLG/GKrX23e7fDrRtywSaYkcczt7F+jvirwIvyauw3+UnrgfXLVeg5Xr5Zu7xSHCX7Ebf5dipPWgVJq4F+rrwu0CL/mboFfhqi/Xc2a/9tO7LCrPYkdwgS/Y8QR8bQ3C2Ws7xfH429TXxtIEX7NQYd/38jac0pp84/l6nSk3Smdwgi/4/nUbRLnUsr8xJNj685WXx8oEX7NQYa/PGGNVTuYzDHM8MOIr7ZZ6JcyFRhVRQiMCL/mIMI/vcOwyhnzv9lpnNvc4XWHHX7d2CyE+JfT5p3TY5apiuJ7EX7NQYL/wQt7Xl7JmB+Sq878Cxyadcx2mfAvtLNZSNojV0kbv4/2UUXyrQi/5qDAXxg33ilX+/9nrz57Sc/UAhP+RqMdnHRv5Yz103LKfIcqli9F+DX7Hf79W9dEK1nzs/ZLG5ewCacdJvyLG5ukqpPWCbyc9entayKqeL4S4dfsZ/grafNflbPms7iqtPqevRcT/sWN9nGeDShlzGdlivZuVUTfiPBr9iP8eBmInjhzpaF3TPjdGe2FWKlnA76FRKiqqCsuwq/ZT/Dnd7/pHJnXNyTO9IsJ/9LsPBsg7TlXTps3o31VkVdMhF+zn+DP7ej/cO09F9SqbXpCb7km/Es32hHtiXadGe2/XhV5xUT4NfsJ/unNvTfXRvtquZ2dffGoWxP+JVq1H3Lh10bX1KR9b1JFXjERfs1+gn92KPrR2og0ylCkltu6ppYbb+07B5drwu/Sqs3Qfrmt9Vz4aFfpZx9RRV4xEX7NvoN/26p62VRmVbwrLZdy3jHQpKN10IT/NEb7APoJo5YbWfiOO7Qr4V9owq9pAfyOnZPAdm/vHGylCf8iRrvgHXfSTnq7OSb8jSb8mprC7xidCS8eHe1/qbOd3AHbbMLfxKod0C6LvdiS8Dea8GtaFH4YHQvesqq+KKiGmQ0dsk0m/JoRd4k/2gHtMd82zdpNTPgbTfg1nRZ+x05H27pa5pedWxQk/GIVa8Qd8T8d9I4Jf6MJvybX8DtWnQ6LgnlnUbBZh22RQw8/4itxRrz1+Lsx4W804de0ZPgdOyeBHe1dFAwt/IgnFvMkvnq8l2LC32jCr8kz/I7RKZOxWm6sPYuCoYNfxQ/xRFy9QO+Y8Dea8GtaNvwwOii8ZXUttzNe78AtOgmEBn4VM8QPcZyPabN4uzThbzTh19QS+B2rDpsbWWM/dNKKk0DXw+9APzFgx60V0Dsm/I0m/JpaCr9j1Xlz29Yue1Gwq+FHXOzFvLUL4tYqE/5GE35NbYHfsXMSsBcFVWdvBsEi7kr4EQeJx3IW89yY8Dea8GtqK/yO0bmTq+ydZvOd/2QgTuGugl/VG3FAPNoFvWPC32jCr6kj8MPo6DAWBcfdLwp2Bfyqrqh3qxbz3JjwN5rwa+oY/I5Vx8fiVn5+UbAJMMqBht95FNrecdfaxTw3JvyNJvyaOg6/YwVBbjsWBU/9kFBg4Ud9pF6on17fTprwN5rwa1ox+B0DikV2DgYOflX+3Oi6RXfcdcKEv9GEX9OKww8PwQIJFgXxkJAGUWDgd6DHQzrOYh7q1ay+HTLhbzTh1+QL+B3bwIixc1AtCh69cqO/4Uf5pJz2Yt4Sdtx1woS/0YRfk6/gd+wAtK2vdnQSw2nznwCbKrIvdOjSc1+dy1iPH8ladjn9BL1jwt9owq/Jl/A7FpiObJWpwLa+R2pjg2eoIvtCezf1nZnbtmbPYSmf36B3TPgbTfg1+Rp+sR2rod4HVXF9pdmh3of80KFPZcLfaMKvKRDw+yRWuvzUoU9lwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt/onmNbV9UKiagEpvkftNuE370Jv3cT/rrBOXgH9z0zQ9HPVZKx2gsrVBjC796E37sJf93gHLyDe7tAUphNpUT04drIqloZ/9HkQ+0y4Xdvwu/dYYYfPINr8F1KxB4C7/XSKO27ePUrSsnYHxYT0fKL8kd59aFmB2ulCb97E37vDiP84DcvQ3zwLBf3Umk48uEfCOf1kjTRbKL3AjlL3I3hwZEt7S8g4Xdvwu/dYYQf/ILjciJ218Et52+sl8CFColoRkYB+xA0+dc+izT7guWa8Ls34ffusMAPTsGr4vap2WQ0Xf/mJepAMnKeTAU+XU5GXzjepsISfvcm/N4dBvhz4uMjsVpJeBVuP/WY8Fv/1mUol4xcVEzEfoS5Q7XFC4KE370Jv3d3M/zgsSpDfPBZTER+ODsUeXv921qkG3p6XiYjgGtl/jCFQGIhoRUnAcLv3oTfu7sRfvAHDlE34fJQcTh6LTitf1MbdHBL77ricOyrWExoRQUIv3sTfu/uRvidRflSInp7ftMb1ta/oQMqJqJbxHvss84ypgKE370Jv3d3C/zgzL5nL/UR/h4pJqPJ+pE7rL2bzz6rOBS9uZKIVU7IfAMLDs0KvJgJv3sTfu/uBvjBF+b1MsSvCPgf23Ppua+uH3UFld8ce3N+OHLfiZFY7bAMQ5YyCiD87k34vTvo8IMrrOTLHP9bU8Jb/Wg+Un4odlUlGd2vhiSuTgKE370Jv3cHEX7wA45Q9nIiuj+XiO2uH8Wnmtq0JiKjgNuweQA7h5pVSjfhd2/C791BhB/8gKPcUPRzh4bO660fIQDKD/W+o5yM/gRBt3cRNakcTPjdm/B7d1DgByfgxd5kl4j+OD98/mX1TwZMezf1nSlzlA9JJXIIfrNnAwi/exN+7w4C/M49e5k6z+aHYx/cMzZ4Rv1TAdb0pqgpo4A7m20WIvzuTfi92+/wH1XPzQgnd0wNRY36X3eR8oneUTmrPYaGKCXrowDC796E37v9CD/6f0nds5fR8aP5ZGRH/a+6VPsTfeeWEtE/LiaiR/FsAEYDhN+dCb93+w1+9Hv0f2HhSCER/cTPhYv6X4RAM1esfmslEf1+bXR1TaD7hfr1iorwexPhX5okVo+i30v//9705t5/rn4dLqHTlJOR908PR+6rXX3hy+u/XTkRfm8i/O5VGxs8Q2J1nwzzf0/9Ktya3nLOa2oX9/y6+nHFRPi9ifC7F/o5+rv6kfKLCL83EX4q8CL83kT4qcCL8HsT4acCL8LvTYSfCrwIvzcRfirwIvzeRPipwIvwexPhpwIvwu9NhJ8KvAi/NxF+KvAi/N5E+KnAi/B7E+GnAi/C702Enwq8CL83EX4q8CL83kT4qcDL7/Aj+8v0cPQnqri+kpTvpyjfyWX2iwk/taj8Dj/e0VZIRA9ODUcuVkX2hXKbey8pSrlQvmbl9oMJP7Wo/A6/k9O9lIgeKyVif3rgksh5qugrouc29b5eyvFnUp7ji72bwQ8m/NSi8jv8MABzXuEk0D1ZHI5kVfE7qmIyMinf/xTK4fbVbCtpwk8tqunN0Zv8Dr9uvAPhmMyzy8noPQcv771AVaOten7oDW8sJ6L/89hI4zsY/Gy7XYd6P6aqQVELJVf+j9XGVmNe7fsrmWPntc1yFS6XEpEb9l28+hWqOi3VA2+L/UZpOHKjjDQq+D4vr2NfCaMd0Z5oV175qVNqZnh1TK6iX6jKFc3PK9cnGx0ci232VCAZ/fupzb1Dqkot0dRw77Ac9x9wfHxPUE6MMNqxIu1ZGI58YXrrmqiqEkU11+xwZFM5EXsoqJ29KmWWofkXf7U5ukpVyZOevSK6Wo7zpSCfDNGOU0ORzapKFHV64SWjpUTshqIMpwM5zMUoIBE9WBiOvU9VaUnKDcWukc8/j+MEaRqUF6O90G6lZOQP0Y6qShS1NB1M9F5QTMTuxsLa4QAtcAHWOSmvWg/4/kxi9VtVlRbVzPCqf1FJRr+PV0nh80Ea9WABEiMUmaLcM7vp/I2qShS1POGWmlxNAnNryzFGLOqdcEcLw9E/2XNF7LWqSgv0jPy+JP+Pv8PfB2mkg/ZQ7fJkLhHNqCpRVOt0IBk5T4aSn5J58LHjI8EaBeCtyACkkog+NpvoHVNVslUY7t0pV/t/sqcK6u3JzY7jN+MEhXYoJ6MvlJKxTz/7zujrVJUoqj2Sq8vvlhORH9bkConFtSAOjWeGIt+Y2Ry5fHYoegd+DtI9e8QbcX9RwC9KO+SSkYtU01BU+1W7oedlxWT02nIiNhXERTEAjxVx/Iufg1B2lNFZzETci0PRf3+DtINqEorqrA5tfv364nDsq1gM9POW1mbOC0jNfu9X40SFOMsJ4PbnE2/oV01AUSsrmQpsKSVij9TnzcGaCvjZiKNzz76SjP08NxzZqkJOUf4RXr0sV9Oby4loNUgr5n414odblTLEr8jU5KZHf4evtqZ8rvzm2JuLyci3j0vHxTCVo4ClGfFC3BC/4nDk24inCi1FBUP5odhVMgrYjyFrkJ4NWCkjPs49e7naP50f7r1ShZKigqepTa+L5Iain0Oyi2NyJWvW6em6ER+Z35/IS7yelripEFJUsJXfsuod5WT0x3g2wO9ZbzppxAHxQFxklPRAfvj8y1TIKKp7hE0m+eHof5ROnsNCVtButbXaqL+9oJeMzs4moh/aMzZ4hgoVRXWnnt0UNYvJ6J32k3UBezagVcYzEbDM8e+YGooaKjQUFQ4VEr1jlWT00fqzAd2/IIj6OXsM5Gr/aH5z76gKBUWFT/sTfeeWEtFPBG033VKNejm7C4vJ2H9GvVUIKCrcOhjgffSLGfVAfVCvaiL6Pbd5BSgqdJpN9P4bGRo/h6FxkDYLnWyU29mEI/U5UBqOvFdVkaKoUwm592R4/EVcMbEo2AwuvxvlRvmREPWZ4dUxVTWKotxodiiyWU4CD9v3wAPwbADK52zCKSViDyERqqoKRVFLFfLwF4ajNxZ9nEgU0DuJM+VkVSokIjf8oE3vD6Co0Gk20XuBXFXvxiOwfsu6g/LYj+YmYncd3MLEmRTVFqlEovswtF7JzUL4XmcTjvz7VIGJMymq/aonEo19WubVx4+vwIIgph524sxE7JiU41OPSXlU0SiK6oRyw5GLi4nYjzDX7kQiURy/njgTV/vID0tMnElRK6cbenpeVtYSiWKzTKtPAjgejovj43uKw9Fr8b2qCBRFraScRKJYfGt1IlF7A5Ict5SI3l5g4kyK8qeKiegW8R77Kr2MqQA+59yzl+M9UkxGk+orKIryq/ZuPvus4lD05koiVvGyWcjZhCND/IoM8W96dAsTZ1JUoITEl/nhyH0nRur57t2MAuqJM/Eij8i3p5g4k6KCLSQSrSRPnUgUP+P39QW96P5iIrZbfZSiqKBratOaiFzNb7MTiW5dmEgUP+P3SDR6aOi8XvURiqK6SfmhXiQS/Qnu1QN4/CtX+x8zcSZFhUC4R19I9l5THYk9kRuOvE/9mgqVenr+P+OvTjWo+kMRAAAAAElFTkSuQmCC</data> <data key="type">image/png</data> @@ -21,4 +26,21 @@ <entity name="MagentoLogoImageContentExportImport" extends="MagentoLogoImageContent" type="ImageContent"> <data key="name">magento-logo.png</data> </entity> + <entity name="BluePngImageContent" type="ImageContent"> + <data key="base64_encoded_data">iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAFpOLgnAAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABgAAAAAQAAAGAAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAADKgAwAEAAAAAQAAADIAAAAAaawubwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAAN1JREFUaAXtllEKwlAMBFvvfwsP5XEUhf2MzLOwFp3+BF42TTL7KN236+2+Dc9lOH8dny65T6uMk341MY77MfSpcFxzKnien7xomd7yPha8ux7J/SWl5csXWitxmezKy6O1SUigKC6EKSJxhQSKFVx+u5AXEVU8sUlwoyguhCkicYUEiuJCmCISV0igKC6EKSJxhQSKlZ87NMlBUcX3gzOichdBmIoiHSnCRq10BGEqinSkCBu10hGEqSjSkSJs1EpHEKaiSEeKsFErHUGYiiIdKcJGrXQEYSqKfsaRB19MEgdQHhXpAAAAAElFTkSuQmCC</data> + <data key="type">image/png</data> + <data key="name" unique="prefix">blue.png</data> + <data key="baseImage_md5">5da9660dc7c0536210547e0000f9a9cf</data> + <data key="thumbnailImage_md5">b1e89172f4d192f00c1d947741759180</data> + </entity> + <entity name="RedPngImageContent" type="ImageContent"> + <data key="base64_encoded_data">iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAFpOLgnAAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABgAAAAAQAAAGAAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAADKgAwAEAAAAAQAAADIAAAAAaawubwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAAN1JREFUaAXtllEKwlAMBFuP4f2v4PkUhf2MzLOwFp3+BF42TTL7KN1v1+2+Dc9lOH8dny65T6uMk341MY77MfSpcFxzKnien7xomd7yPha8ux7J/SWl5csXWitxmezKy6O1SUigKC6EKSJxhQSKFVx+u5AXEVU8sUlwoyguhCkicYUEiuJCmCISV0igKC6EKSJxhQSKlZ87NMlBUcX3gzOichdBmIoiHSnCRq10BGEqinSkCBu10hGEqSjSkSJs1EpHEKaiSEeKsFErHUGYiiIdKcJGrXQEYSqKfsaRB7YwDVopmL/PAAAAAElFTkSuQmCC</data> + <data key="type">image/png</data> + <data key="name" unique="prefix">red.png</data> + <data key="baseImage_md5">55942e709d0a1c85d5174839c2e55cea</data> + <data key="thumbnailImage_md5">263ab50a24625c8d4f855cee8b947daa</data> + </entity> + <entity name="MagentoPlaceHolderImageContent" type="ImageContent"> + <data key="baseImage_md5">c0459a796c5b8ee74254472c235a7460</data> + </entity> </entities> diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeMediaGalleryEntryData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeMediaGalleryEntryData.xml index 7016a1c1d035..5cc6b4ea3429 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeMediaGalleryEntryData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeMediaGalleryEntryData.xml @@ -20,6 +20,18 @@ <data key="disabled">false</data> <requiredEntity type="ImageContent">TestImageContent</requiredEntity> </entity> + <entity name="ApiProductAttributeMediaGalleryEntryTestImage2" type="ProductAttributeMediaGalleryEntry"> + <data key="media_type">image</data> + <data key="label" unique="suffix">Adobe Base </data> + <data key="position">1</data> + <array key="types"> + <item>image</item> + <item>small_image</item> + <item>thumbnail</item> + </array> + <data key="disabled">false</data> + <requiredEntity type="ImageContent">AdobeBaseContent</requiredEntity> + </entity> <entity name="ApiProductAttributeMediaGalleryEntryMagentoLogo" type="ProductAttributeMediaGalleryEntry"> <data key="media_type">image</data> <data key="label" unique="suffix">Magento Logo </data> @@ -30,6 +42,23 @@ <data key="disabled">false</data> <requiredEntity type="ImageContent">MagentoLogoImageContent</requiredEntity> </entity> + <entity name="ApiProductAttributeMediaGalleryEntryBluePng" type="ProductAttributeMediaGalleryEntry"> + <data key="media_type">image</data> + <data key="label" unique="suffix">Blue PNG </data> + <data key="position">1</data> + <array key="types"> + <item>image</item> + <item>small_image</item> + <item>thumbnail</item> + <item>swatch</item> + </array> + <data key="disabled">false</data> + <requiredEntity type="ImageContent">BluePngImageContent</requiredEntity> + </entity> + <entity name="ApiProductAttributeMediaGalleryEntryRedPng" extends="ApiProductAttributeMediaGalleryEntryBluePng" type="ProductAttributeMediaGalleryEntry"> + <data key="label" unique="suffix">Red PNG </data> + <requiredEntity type="ImageContent">RedPngImageContent</requiredEntity> + </entity> <!-- From file "export_import_configurable_product.csv" --> <entity name="ApiProductAttributeMediaGalleryForExportImport" extends="ApiProductAttributeMediaGalleryEntryTestImage" type="ProductAttributeMediaGalleryEntry"> <data key="label">Magento Logo</data> diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml index 5375459122e6..567b3940eb6f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml @@ -11,7 +11,7 @@ <entity name="_defaultProduct" type="product"> <data key="name" unique="suffix">testProductName</data> <data key="sku" unique="suffix">testSku</data> - <data key="urlKey" unique="suffix">testurlkey</data> + <data key="urlKey" unique="suffix">testproductname</data> <data key="type_id">simple</data> <data key="attribute_set_id">4</data> <data key="visibility">4</data> @@ -39,6 +39,10 @@ <data key="name">TestFooBar</data> <data key="sku" unique="suffix">foobar</data> </entity> + <entity name="ApiSimpleProductWithDoubleSpaces" type="product" extends="ApiSimpleProduct"> + <data key="name">Simple Product Double Space</data> + <data key="sku" unique="suffix">simple-product double-space</data> + </entity> <entity name="ApiSimpleProductWithSpecCharInName" type="product" extends="ApiSimpleProduct"> <data key="name">Pursuit Lumaflex&trade; Tone Band</data> <data key="sku" unique="suffix">x&trade;</data> @@ -59,9 +63,9 @@ <data key="urlKey" unique="suffix">api-simple-product</data> </entity> <entity name="SimpleProduct" type="product"> - <data key="name" unique="suffix">SimpleProduct</data> + <data key="name" unique="suffix">Simple Product </data> <data key="sku" unique="suffix">SimpleProduct</data> - <data key="urlKey" unique="suffix">simpleproduct</data> + <data key="urlKey" unique="suffix">simple-product-</data> <data key="type_id">simple</data> <data key="attribute_set_id">4</data> <data key="price">123.00</data> @@ -72,6 +76,11 @@ <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> </entity> + <entity name="SimpleProduct_NoSpaces" extends="SimpleProduct" type="product"> + <data key="name" unique="suffix">SimpleProduct</data> + <data key="sku" unique="suffix">SimpleProduct</data> + <data key="urlKey" unique="suffix">simpleproduct</data> + </entity> <entity name="ProductForPartialSearch" extends="SimpleProduct" type="product"> <data key="sku">partialTestSku</data> </entity> @@ -135,8 +144,9 @@ <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> </entity> <entity name="SimpleProduct2" type="product"> - <data key="name" unique="suffix">SimpleProduct</data> - <data key="sku" unique="suffix">SimpleProduct</data> + <data key="name" unique="suffix">Simple Product 2 </data> + <data key="sku" unique="suffix">SimpleProduct2</data> + <data key="urlKey" unique="suffix">simple-product-2-</data> <data key="type_id">simple</data> <data key="attribute_set_id">4</data> <data key="price">123.00</data> @@ -147,15 +157,15 @@ <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> </entity> <entity name="SimpleProduct3" type="product"> - <data key="name" unique="suffix">simple</data> - <data key="sku" unique="suffix">simple</data> + <data key="name" unique="suffix">Simple Product 3 </data> + <data key="sku" unique="suffix">SimpleProduct3</data> + <data key="urlKey" unique="suffix">simple-product-3-</data> <data key="type_id">simple</data> <data key="attribute_set_id">4</data> <data key="price">123.00</data> <data key="visibility">4</data> <data key="status">1</data> <data key="quantity">1000</data> - <data key="urlKey" unique="suffix">simple</data> <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> </entity> @@ -1392,9 +1402,34 @@ <entity name="SimpleProductUpdatePrice16" type="product2"> <data key="price">16.00</data> </entity> + <entity name="SimpleProductUpdatePrice90" type="product2"> + <data key="price">90.00</data> + </entity> + <entity name="SimpleProductUpdatePrice95" type="product2"> + <data key="price">95.00</data> + </entity> + <entity name="SimpleProductUpdatePrice80" type="product2"> + <data key="price">80.00</data> + </entity> <entity name="ProductWithTwoTextFieldOptions" type="product"> <var key="sku" entityType="product" entityKey="sku" /> <requiredEntity type="product_option">ProductOptionField</requiredEntity> <requiredEntity type="product_option">ProductOptionField2</requiredEntity> </entity> + <entity name="SimpleProductWithCustomSku24MB01" type="product" extends="SimpleProduct2"> + <data key="name" unique="suffix">ProductWithSku24MB01-</data> + <data key="sku" unique="suffix">24 MB01</data> + </entity> + <entity name="SimpleProductWithCustomSku24MB02" type="product" extends="SimpleProduct2"> + <data key="name" unique="suffix">ProductWithSku24MB02-</data> + <data key="sku" unique="suffix">24 MB02 </data> + </entity> + <entity name="SimpleProductWithCustomSku24MB04" type="product" extends="SimpleProduct2"> + <data key="name" unique="suffix">ProductWithSku24MB04-</data> + <data key="sku" unique="suffix">24 MB04 </data> + </entity> + <entity name="SimpleProductWithCustomSku24MB06" type="product" extends="SimpleProduct2"> + <data key="name" unique="suffix">ProductWithSku24MB06-</data> + <data key="sku" unique="suffix">24 MB06 </data> + </entity> </entities> diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml index b763fda489b2..fb587da75940 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml @@ -86,4 +86,18 @@ <data key="price">0.1</data> <data key="qty">1</data> </entity> + <entity name="tierPriceForAllGroups" type="data"> + <data key="price">80</data> + <data key="price_type">fixed</data> + <data key="website_id">0</data> + <data key="customer_group">ALL GROUPS</data> + <data key="quantity">2</data> + </entity> + <entity name="tierPriceForGeneralGroup" type="data"> + <data key="price">70</data> + <data key="price_type">fixed</data> + <data key="website_id">0</data> + <data key="customer_group">General</data> + <data key="quantity">3</data> + </entity> </entities> diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/WYSIWYGConfigData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/WYSIWYGConfigData.xml deleted file mode 100644 index 3965cfa1f958..000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/Data/WYSIWYGConfigData.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<!--TODO: This datasets should be moved to CMS module--> -<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> - <entity name="EnableWYSIWYG"> - <data key="path">cms/wysiwyg/enabled</data> - <data key="scope_id">0</data> - <data key="label">Yes</data> - <data key="value">enabled</data> - </entity> - <entity name="EnableTinyMCE4"> - <data key="path">cms/wysiwyg/editor</data> - <data key="scope_id">0</data> - <data key="label">Yes</data> - <data key="value">mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter</data> - </entity> -</entities> diff --git a/app/code/Magento/Catalog/Test/Mftf/Helper/LocalFileAssertions.php b/app/code/Magento/Catalog/Test/Mftf/Helper/LocalFileAssertions.php new file mode 100644 index 000000000000..14867cd130cd --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Helper/LocalFileAssertions.php @@ -0,0 +1,337 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Test\Mftf\Helper; + +use Codeception\Lib\ModuleContainer; +use Magento\Framework\Filesystem\Driver\File; +use Magento\Framework\Filesystem\DriverInterface; +use Magento\FunctionalTestingFramework\Helper\Helper; + +/** + * Class for MFTF helpers for doing file assertions using the local filesystem. + * + * If relative file paths are given assume they're in context of the Magento base path. + */ +class LocalFileAssertions extends Helper +{ + /** + * @var DriverInterface $driver + */ + private $driver; + + /** + * Call the parent constructor then create the local filesystem driver + * + * @param ModuleContainer $moduleContainer + * @param array|null $config + * @return void + */ + public function __construct(ModuleContainer $moduleContainer, ?array $config = null) + { + parent::__construct($moduleContainer, $config); + + $this->driver = new File(); + } + + /** + * Create a text file + * + * @param string $filePath + * @param string $text + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function createTextFile($filePath, $text): void + { + $realPath = $this->expandPath($filePath); + $this->driver->filePutContents($realPath, $text); + } + + /** + * Delete a file if it exists + * + * @param string $filePath + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function deleteFileIfExists($filePath): void + { + $realPath = $this->expandPath($filePath); + if ($this->driver->isExists($realPath)) { + $this->driver->deleteFile($realPath); + } + } + + /** + * Recursive delete directory + * + * @param string $path + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function deleteDirectory($path): void + { + $realPath = $this->expandPath($path); + if ($this->driver->isExists($realPath)) { + $this->driver->deleteDirectory($realPath); + } + } + + /** + * Copy source into destination + * + * @param string $source + * @param string $destination + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function copy($source, $destination): void + { + $sourceRealPath = $this->expandPath($source); + $destinationRealPath = $this->expandPath($destination); + $this->driver->copy($sourceRealPath, $destinationRealPath); + } + + /** + * Create directory + * + * @param string $path + * @param int $permissions + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function createDirectory($path, $permissions = 0777): void + { + $permissions = $this->convertOctalStringToDecimalInt($permissions); + $sourceRealPath = $this->expandPath($path); + $oldUmask = umask(0); + $this->driver->createDirectory($sourceRealPath, $permissions); + umask($oldUmask); + } + + /** + * Assert a file exists + * + * @param string $filePath + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileExists($filePath, $message = ''): void + { + $realPath = $this->expandPath($filePath); + $this->assertTrue($this->driver->isExists($realPath), "Failed asserting $filePath exists. " . $message); + } + + /** + * Asserts that a file with the given glob pattern exists in the given path + * + * @param string $path + * @param string $pattern + * @param string $message + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertGlobbedFileExists($path, $pattern, $message = ''): void + { + $realPath = $this->expandPath($path); + $files = $this->driver->search($pattern, $realPath); + $this->assertNotEmpty($files, "Failed asserting file matching glob pattern \"$pattern\" at location \"$path\" is not empty. " . $message); + } + + /** + * Asserts that a file or directory exists + * + * @param string $path + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertPathExists($path, $message = ''): void + { + $realPath = $this->expandPath($path); + $this->assertTrue($this->driver->isExists($realPath), "Failed asserting $path exists. " . $message); + } + + /** + * Asserts that a file or directory does not exist + * + * @param string $path + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertPathDoesNotExist($path, $message = ''): void + { + $realPath = $this->expandPath($path); + $this->assertFalse($this->driver->isExists($realPath), "Failed asserting $path does not exist. " . $message); + } + + /** + * Assert a file does not exist + * + * @param string $filePath + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileDoesNotExist($filePath, $message = ''): void + { + $realPath = $this->expandPath($filePath); + $this->assertFalse($this->driver->isExists($realPath), $message); + } + + /** + * Assert a file has no contents + * + * @param string $filePath + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileEmpty($filePath, $message = ''): void + { + $realPath = $this->expandPath($filePath); + $this->assertEmpty($this->driver->fileGetContents($realPath), "Failed asserting $filePath is empty. " . $message); + } + + /** + * Assert a file is not empty + * + * @param string $filePath + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileNotEmpty($filePath, $message = ''): void + { + $realPath = $this->expandPath($filePath); + $this->assertNotEmpty($this->driver->fileGetContents($realPath), "Failed asserting $filePath is not empty. " . $message); + } + + /** + * Assert a file contains a given string + * + * @param string $filePath + * @param string $text + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileContainsString($filePath, $text, $message = ''): void + { + $realPath = $this->expandPath($filePath); + $this->assertStringContainsString($text, $this->driver->fileGetContents($realPath), "Failed asserting $filePath contains $text. " . $message); + } + + /** + * Asserts that a file with the given glob pattern at the given path contains a given string + * + * @param string $path + * @param string $pattern + * @param string $text + * @param int $fileIndex + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertGlobbedFileContainsString($path, $pattern, $text, $fileIndex = 0, $message = ''): void + { + $realPath = $this->expandPath($path); + $files = $this->driver->search($pattern, $realPath); + $this->assertStringContainsString($text, $this->driver->fileGetContents($files[$fileIndex] ?? ''), "Failed asserting file of index \"$fileIndex\" matching glob pattern \"$pattern\" at location \"$path\" contains $text. " . $message); + } + + /** + * Assert a file does not contain a given string + * + * @param string $filePath + * @param string $text + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileDoesNotContainString($filePath, $text, $message = ''): void + { + $realPath = $this->expandPath($filePath); + $this->assertStringNotContainsString($text, $this->driver->fileGetContents($realPath), "Failed asserting $filePath does not contain $text. " . $message); + } + + /** + * Asserts that a directory is empty + * + * @param string $path + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertDirectoryEmpty($path, $message = ''): void + { + $realPath = $this->expandPath($path); + $this->assertEmpty($this->driver->readDirectory($realPath), "Failed asserting $path is empty. " . $message); + } + + /** + * Asserts that a directory is not empty + * + * @param string $path + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertDirectoryNotEmpty($path, $message = ''): void + { + $realPath = $this->expandPath($path); + $this->assertNotEmpty($this->driver->readDirectory($realPath), "Failed asserting $path is not empty. " . $message); + } + + /** + * Helper function to convert an octal string to its decimal equivalent + * + * @param string $string + * @return int + * + */ + private function convertOctalStringToDecimalInt($string): int + { + if (is_string($string)) { + $string = octdec($string); + } + return $string; + } + + /** + * Helper function to construct the real path to the file + * + * If the given path isn't an absolute path then assume it's in context of the Magento root + * + * @param string $filePath + * @return string + */ + private function expandPath($filePath): string + { + return (substr($filePath, 0, 1) === '/') ? $filePath : MAGENTO_BP . '/' . $filePath; + + } +} diff --git a/app/code/Magento/Catalog/Test/Mftf/Page/StorefrontCategoryPage.xml b/app/code/Magento/Catalog/Test/Mftf/Page/StorefrontCategoryPage.xml index 416e0d27a182..e0640ba39acd 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Page/StorefrontCategoryPage.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Page/StorefrontCategoryPage.xml @@ -11,5 +11,6 @@ <page name="StorefrontCategoryPage" url="/{{var1}}.html" area="storefront" module="Magento_Catalog" parameterized="true"> <section name="StorefrontCategoryMainSection"/> <section name="WYSIWYGToolbarSection"/> + <section name="StorefrontCategoryProductSection"/> </page> </pages> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategoryMessagesSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategoryMessagesSection.xml index ea4f4bf53eb7..14bf132c6a0c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategoryMessagesSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategoryMessagesSection.xml @@ -11,5 +11,6 @@ <section name="AdminCategoryMessagesSection"> <element name="SuccessMessage" type="text" selector=".message-success"/> <element name="errorMessage" type="text" selector="//div[@class='message message-error error']"/> + <element name="saveCategoryWarningMessage" type="text" selector=".message-warning"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminEditProductAttributesSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminEditProductAttributesSection.xml index d7dc38a4a88f..5f3a836de4af 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminEditProductAttributesSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminEditProductAttributesSection.xml @@ -25,5 +25,7 @@ <element name="tabButton" type="text" selector="#product_attribute_tabs a[title='{{tabName}}']" parameterized="true"/> <element name="attributeShortDescription" type="text" selector="#short_description"/> <element name="changeAttributeShortDescriptionToggle" type="checkbox" selector="#toggle_short_description"/> + <element name="attributeInput" type="input" selector="#{{attributeCode}}" parameterized="true"/> + <element name="toggleAttribute" type="checkbox" selector="#toggle_{{attributeCode}}" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAdvancedPricingSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAdvancedPricingSection.xml index 91ac52a91a4c..672df19a8e66 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAdvancedPricingSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAdvancedPricingSection.xml @@ -26,6 +26,8 @@ <element name="msrpType" type="select" selector="//select[@name='product[msrp_display_actual_price_type]']" timeout="30"/> <element name="save" type="button" selector="#save-button" timeout="30"/> <element name="modalTitle" type="text" selector="aside.product_form_product_form_advanced_pricing_modal h1.modal-title"/> + <element name="customerGroupFilterInputByIndex" type="input" selector="div[name='product[tier_price][{{rowIndex}}][cust_group]'] div.admin__action-multiselect-search-wrap input" parameterized="true"/> + <element name="customerGroupOptionByIndex" type="text" selector="//div[@name='product[tier_price][{{rowIndex}}][cust_group]']//label[@class='admin__action-multiselect-label']//span" parameterized="true"/> <!-- Last row tier price elements--> <element name="lastTierPriceWebsite" type="select" selector="[data-index='tier_price'] table tbody tr.data-row:last-child [name*='[website_id]']"/> <element name="lastTierPriceCustomerGroup" type="select" selector="[data-index='tier_price'] table tbody tr.data-row:last-child [name*='[cust_group]']"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml index d70c48f2b00e..590b9a185e5e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml @@ -75,6 +75,7 @@ <element name="selectMultipleCategories" type="input" selector="//*[@data-index='container_category_ids']//*[contains(@class, '_selected')]"/> <element name="countryOfManufacture" type="select" selector="select[name='product[country_of_manufacture]']"/> <element name="newAddedAttribute" type="text" selector="//fieldset[@class='admin__fieldset']//div[contains(@data-index,'{{attributeCode}}')]" parameterized="true"/> + <element name="newAddedAttributeInput" type="text" selector="//fieldset[@class='admin__fieldset']//div[contains(@data-index,'{{attributeCode}}')]//input" parameterized="true"/> <element name="newCategoryButton" type="button" selector="button[data-index='create_category_button']" timeout="30"/> <element name="footerBlock" type="block" selector="//footer"/> <element name="categories" type="text" selector="//*[@class='admin__action-multiselect-crumb']/span[contains(text(), '{{categoryName}}')]" parameterized="true"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductImagesSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductImagesSection.xml index c2de91aadbc0..0de3e6de1dee 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductImagesSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductImagesSection.xml @@ -13,6 +13,8 @@ <element name="imageFileUpload" type="input" selector="#fileupload"/> <element name="imageUploadButton" type="button" selector="div.image div.fileinput-button"/> <element name="imageFile" type="text" selector="//*[@id='media_gallery_content']//img[contains(@src, '{{url}}')]" parameterized="true"/> + <element name="imageFileRoleByImage" type="text" selector="//*[@id='media_gallery_content']//img[contains(@src, '{{url}}')]/ancestor::div[@data-role='image']//*[@data-role-code='{{roleCode}}']" parameterized="true"/> + <element name="imageElement" type="text" selector="#media_gallery_content img"/> <element name="removeImageButton" type="button" selector=".action-remove"/> <element name="removeImageButtonForExactImage" type="button" selector="[id='media_gallery_content'] img[src*='{{imageName}}'] + div[class='actions'] button[class='action-remove']" parameterized="true"/> <element name="modalOkBtn" type="button" selector="button.action-primary.action-accept"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductMessagesSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductMessagesSection.xml index c51d481d7dc5..ff7edf14a50f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductMessagesSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductMessagesSection.xml @@ -11,5 +11,6 @@ <section name="AdminProductMessagesSection"> <element name="successMessage" type="text" selector=".message.message-success.success"/> <element name="errorMessage" type="text" selector=".message.message-error.error"/> + <element name="saveProductWarningMessage" type="text" selector=".message-warning"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryMainSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryMainSection.xml index 6b67f5609f7f..f3a0919f6c72 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryMainSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryMainSection.xml @@ -39,5 +39,6 @@ <element name="productName" type="text" selector=".product-item-name"/> <element name="productOptionList" type="text" selector="#narrow-by-list"/> <element name="productNameByPosition" type="text" selector=".products-grid li:nth-of-type({{position}}) .product-item-name a" parameterized="true"/> + <element name="sidebarAdditional" type="block" selector="#maincontent .sidebar.sidebar-additional"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategorySidebarSection/StorefrontCategorySidebarSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategorySidebarSection/StorefrontCategorySidebarSection.xml index 848035b911aa..3131e9a89e8c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategorySidebarSection/StorefrontCategorySidebarSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategorySidebarSection/StorefrontCategorySidebarSection.xml @@ -16,8 +16,9 @@ <element name="filterOptionByLabel" type="button" selector=" div.filter-options-item div[data-option-label='{{optionLabel}}']" parameterized="true"/> <element name="removeFilter" type="button" selector="div.filter-current .remove" timeout="30"/> <element name="activeFilterOptions" type="text" selector=".filter-options-item.active .items"/> - <element name="activeFilterOptionItemByPosition" type="text" selector=".filter-options-item.active .items li:nth-child({{itemPosition}}) a" parameterized="true"/> + <element name="activeFilterOptionItemByPosition" type="text" selector=".filter-options-item.active .items li:nth-child({{itemPosition}}) a" parameterized="true" timeout="30"/> <element name="enabledFilterOptionItemByLabel" type="text" selector="//div[@class='filter-options']//li[@class='item']//a[contains(text(), '{{optionLabel}}')]" parameterized="true" timeout="30"/> <element name="disabledFilterOptionItemByLabel" type="text" selector="//div[@class='filter-options']//li[@class='item' and contains(text(), '{{optionLabel}}')]" parameterized="true" timeout="30"/> + <element name="visibleOptionQty" type="text" selector=".filter-options-item.active .items li:nth-child({{itemPosition}}) a .count" parameterized="true" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductCompareMainSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductCompareMainSection.xml index ad31be6b277e..f8000a25efdc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductCompareMainSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductCompareMainSection.xml @@ -14,5 +14,7 @@ <element name="ProductPriceByName" type="text" selector="//*[@id='product-comparison']//td[.//strong[@class='product-item-name']/a[contains(text(), '{{var1}}')]]//span[@class='price']" parameterized="true"/> <element name="ProductImageByName" type="text" selector="//*[@id='product-comparison']//td[.//strong[@class='product-item-name']/a[contains(text(), '{{var1}}')]]//img[@class='product-image-photo']" parameterized="true"/> <element name="ProductAttributeByCodeAndProductName" type="text" selector="//*[@id='product-comparison']//tr[.//th[./span[contains(text(), '{{var1}}')]]]//td[count(//*[@id='product-comparison']//tr//td[.//strong[@class='product-item-name']/a[contains(text(), '{{var2}}')]]/preceding-sibling::td)+1]/div" parameterized="true"/> + <element name="ProductAddToCartButton" type="button" selector=".product-item-photo[title='{{productName}}'] ~ .product-item-actions button[type='submit']" parameterized="true" timeout="30"/> + <element name="removeFirstItem" type="button" selector="table.table-comparison a.delete"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml index 5efa094e2c35..63b50e2d82f0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml @@ -11,6 +11,7 @@ <section name="StorefrontProductMediaSection"> <element name="gallerySpinner" type="block" selector="#maincontent .fotorama__spinner--show" /> <element name="gallery" type="block" selector="[data-gallery-role='gallery']" timeout="30"/> + <element name="galleryNoControlsElement" type="block" selector=".fotorama__wrap.fotorama__wrap--no-controls"/> <element name="productImage" type="text" selector="//*[@data-gallery-role='gallery' and not(contains(@class, 'fullscreen'))]//img[contains(@src, '{{filename}}') and not(contains(@class, 'full'))]" parameterized="true" /> <element name="productImageFullscreen" type="text" selector="//*[@data-gallery-role='gallery' and contains(@class, 'fullscreen')]//img[contains(@src, '{{filename}}') and contains(@class, 'full')]" parameterized="true" /> <element name="closeFullscreenImage" type="button" selector="//*[@data-gallery-role='gallery' and contains(@class, 'fullscreen')]//*[@data-gallery-role='fotorama__fullscreen-icon']" /> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml index e1499a248435..fad0b26262d0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml @@ -22,9 +22,7 @@ <before> <comment userInput="Adding the comment for preserving Backward Compatibility" stepKey="loginAsAdmin"/> <magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockDisable.path}} {{CatalogInventoryOptionsShowOutOfStockDisable.value}}" stepKey="setConfigShowOutOfStockFalse"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <createData entity="SimpleSubCategory" stepKey="category"/> <createData entity="SimpleProduct4" stepKey="product"> <requiredEntity createDataKey="category"/> @@ -33,9 +31,7 @@ <after> <magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockDisable.path}} {{CatalogInventoryOptionsShowOutOfStockDisable.value}}" stepKey="setConfigShowOutOfStockFalse"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <deleteData createDataKey="product" stepKey="deleteProduct"/> <deleteData createDataKey="category" stepKey="deleteCategory"/> <comment userInput="Adding the comment for preserving Backward Compatibility" stepKey="logout"/> @@ -58,9 +54,7 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value="catalog_product_price"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <comment userInput="Open product page | Comment is kept to preserve the step key for backward compatibility" stepKey="openProductPage"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToSimpleProductPage2"/> @@ -84,8 +78,7 @@ <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage"> <argument name="categoryName" value="$$category.name$$"/> </actionGroup> - - <actionGroup ref="StorefrontOpenAndCheckComparisionActionGroup" stepKey="navigateToComparePage"/> + <comment userInput="Comment is kept to preserve the step key for backward compatibility" stepKey="navigateToComparePage"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontProductComparePageLoad"/> <actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductInCompareList"> @@ -98,11 +91,13 @@ <argument name="categoryName" value="$$category.name$$"/> </actionGroup> - <actionGroup ref="StorefrontClearCompareActionGroup" stepKey="clickClearAll"/> + <actionGroup ref="StorefrontRemoveFirstProductFromCompareActionGroup" stepKey="clickClearAll"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForConfirmPageLoad"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="confirmProdDelate"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForConfirmLoad"/> - <comment userInput="Add product to compare list fom Category page | Comment is kept to preserve the step key for backward compatibility" stepKey="addToCmpFromCategPage"/> + <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="addToCmpFromCategPage"> + <argument name="categoryName" value="$$category.name$$"/> + </actionGroup> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverOverProduct"/> @@ -114,11 +109,11 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="grabTextFromSuccessMessage2"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertSuccessMessage2"/> - <comment userInput="Check that product displays on add to compare widget | Comment is kept to preserve the step key for backward compatibility" stepKey="checkProdNameOnWidget"/> - <seeElement selector="{{StorefrontComparisonSidebarSection.ProductTitleByName($$product.name$$)}}" stepKey="seeProdNameOnCmpWidget"/> + <comment userInput="Comment is kept to preserve the step key for backward compatibility" stepKey="checkProdNameOnWidget"/> + <comment userInput="Comment is kept to preserve the step key for backward compatibility" stepKey="seeProdNameOnCmpWidget"/> <comment userInput="See product in the compare page" stepKey="seeProductInComparePage"/> - <actionGroup ref="StorefrontOpenAndCheckComparisionActionGroup" stepKey="navigateToComparePage2"/> + <comment userInput="Comment is kept to preserve the step key for backward compatibility" stepKey="navigateToComparePage2"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontProductComparePageLoad2"/> <actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductInCompareList2"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml index 2dc840b60f3b..bed5297041dd 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml @@ -42,9 +42,7 @@ <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"> - <argument name="image" value="MagentoLogo"/> - </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml index d1e292ff5644..d713660d7ee6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml @@ -42,7 +42,7 @@ <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml index 029c304873ce..e1f5798b3741 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml @@ -11,7 +11,9 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> </before> <annotations> <features value="Catalog"/> @@ -48,7 +50,7 @@ <actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/> <actionGroup ref="FillOutUploadImagePopupActionGroup" stepKey="fillOutUploadImagePopup" /> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCatalog"/> - <amOnPage url="/{{SimpleSubCategory.name_lwr}}.html" stepKey="goToCategoryFrontPage"/> + <amOnPage url="/{{SimpleSubCategory.urlKey}}.html" stepKey="goToCategoryFrontPage"/> <waitForPageLoad stepKey="waitForPageLoad2"/> <seeElement selector="{{StorefrontCategoryMainSection.mediaDescription(ImageUpload3.content)}}" stepKey="assertMediaDescription"/> <seeElementInDOM selector="{{StorefrontCategoryMainSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml index 5ea7253619ed..8a00e30e9ed2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml @@ -21,7 +21,9 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> </before> <after> @@ -103,7 +105,7 @@ <click selector="{{ProductShortDescriptionWYSIWYGToolbarSection.OkBtn}}" stepKey="clickOkBtn2" /> <waitForPageLoad stepKey="waitForPageLoad6"/> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/> - <amOnPage url="{{_defaultProduct.name}}.html" stepKey="navigateToProductPage"/> + <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForPageLoad7"/> <seeElement selector="{{StorefrontProductInfoMainSection.mediaDescription}}" stepKey="assertMediaDescription"/> <seeElementInDOM selector="{{StorefrontCategoryMainSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource3"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml index 73019bb5ec0e..a574b0c7eabf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml @@ -59,17 +59,15 @@ <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickOnSaveButton"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Verify product is visible in category front page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="openCategoryStoreFrontPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="openCategoryStoreFrontPage"/> <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="seeCategoryInFrontPage"/> <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="clickOnCategory"/> <see selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="seeProductNameInCategoryPage"/> <!--Verify Product In Store Front--> - <amOnPage url="$$createSimpleProduct.name$$.html" stepKey="goToStorefrontPage"/> + <amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="goToStorefrontPage"/> <waitForPageLoad stepKey="waitForProductFrontPageToLoad"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="seeProductNameInStoreFront"/> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{SimpleProduct.price}}" stepKey="seeProductPriceInStoreFront"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductTest.xml index 1ed079b12d1f..8add42ec7493 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductTest.xml @@ -55,14 +55,14 @@ <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin1"> <argument name="Customer" value="$$createSimpleUSCustomer$$"/> </actionGroup> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage1"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage1"/> <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('90')}}" stepKey="assertProductFinalPriceIs90_1"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceLabel_1"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceOld('100')}}" stepKey="assertRegularPriceAmount_1"/> <amOnPage url="{{StorefrontCustomerLogoutPage.url}}" stepKey="logoutCustomer1"/> <waitForPageLoad time="30" stepKey="waitForPageLoad2"/> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage2"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage2"/> <waitForPageLoad time="30" stepKey="waitForPageLoad3"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('90')}}" stepKey="assertProductFinalPriceIs90_2"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceLabel_2"/> @@ -79,14 +79,14 @@ <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect('0')}}" userInput="General" stepKey="selectCustomerGroupGeneral"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton2"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage3"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage3"/> <waitForPageLoad time="30" stepKey="waitForPageLoad4"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('100')}}" stepKey="assertProductFinalPriceIs100_1"/> <dontSeeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceLabel_3"/> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin2"> <argument name="Customer" value="$$createSimpleUSCustomer$$"/> </actionGroup> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage4"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage4"/> <waitForPageLoad time="30" stepKey="waitForPageLoad5"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('90')}}" stepKey="assertProductFinalPriceIs90_3"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceLabel_4"/> @@ -109,19 +109,19 @@ <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('1')}}" userInput="18" stepKey="selectProductTierPricePriceInput18"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton3"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct3"/> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage5"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage5"/> <waitForPageLoad time="30" stepKey="waitForPageLoad6"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('100')}}" stepKey="assertProductFinalPriceIs100_2"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('As low as')}}" stepKey="assertAsLowAsPriceLabel_1"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLinkAfterLabel('As low as', '82')}}" stepKey="assertPriceAfterAsLowAsLabel_1"/> <amOnPage url="{{StorefrontCustomerLogoutPage.url}}" stepKey="logoutCustomer2"/> <waitForPageLoad time="30" stepKey="waitForPageLoad7"/> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage6"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage6"/> <waitForPageLoad time="30" stepKey="waitForPageLoad8"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('100')}}" stepKey="assertProductFinalPriceIs100_3"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('As low as')}}" stepKey="assertAsLowAsPriceLabel_2"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLinkAfterLabel('As low as', '82')}}" stepKey="assertPriceAfterAsLowAsLabel_2"/> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="goToProductPage1"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage1"/> <waitForPageLoad time="30" stepKey="waitForPageLoad9"/> <seeElement selector="{{StorefrontProductInfoMainSection.productTierPriceByForTextLabel('1', '15')}}" stepKey="assertProductTierPriceByForTextLabelForFirstRow1"/> <seeElement selector="{{StorefrontProductInfoMainSection.productTierPriceByForTextLabel('2', '20')}}" stepKey="assertProductTierPriceByForTextLabelForSecondRow1"/> @@ -213,7 +213,7 @@ <expectedResult type="string">$1,500.00</expectedResult> <actualResult type="variable">grabTextFromSubtotalField6</actualResult> </assertEquals> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="goToProductPage2"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage2"/> <waitForPageLoad time="30" stepKey="waitForPageLoad10"/> <seeElement selector="{{StorefrontProductInfoMainSection.productTierPriceByForTextLabel('1', '15')}}" stepKey="assertProductTierPriceByForTextLabelForFirstRow2"/> <seeElement selector="{{StorefrontProductInfoMainSection.productTierPriceByForTextLabel('2', '20')}}" stepKey="assertProductTierPriceByForTextLabelForSecondRow2"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml index 0b29d2edb661..6ffd15746809 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml @@ -32,7 +32,7 @@ <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> </after> - + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="loginAsAdmin"/> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct"> <argument name="product" value="$$createSimpleProduct$$"/> @@ -41,6 +41,10 @@ <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> + <actionGroup ref="AdminProductFormOpenAdvancedPricingDialogActionGroup" stepKey="clickOnAdvancedPricingButtonForAssert"/> + <actionGroup ref="AssertAdminProductFormAdvancedPricingAddTierPriceActionGroup" stepKey="assertProductTierPriceInput"/> + <actionGroup ref="AdminProductFormDoneAdvancedPricingDialogActionGroup" stepKey="doneButtonAfterAssert"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollToTopOfPage"/> <actionGroup ref="AdminProductFormOpenAdvancedPricingDialogActionGroup" stepKey="clickOnAdvancedPricingButton"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCustomerGroupPriceAddButton"/> @@ -60,7 +64,7 @@ <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goProductPageOnStorefront"> - <argument name="productUrl" value="$$createSimpleProduct.sku$$"/> + <argument name="productUrl" value="$$createSimpleProduct.custom_attributes[url_key]$$"/> </actionGroup> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad1"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('99.90')}}" stepKey="assertProductFinalPriceProductPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml index b52d18f3c020..7a99afa3dcba 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml @@ -42,7 +42,7 @@ <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> <!-- Verify Parent Category and Sub category is not visible in navigation menu --> - <amOnPage url="$$createCategory.name_lwr$$/{{SimpleSubCategory.name_lwr}}.html" stepKey="openCategoryStoreFrontPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$/{{SimpleSubCategory.urlKey}}.html" stepKey="openCategoryStoreFrontPage"/> <waitForPageLoad stepKey="waitForCategoryStoreFrontPageToLoad"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="dontSeeCategoryOnStoreNavigationBar"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSubCategoryOnStoreNavigation"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml index a4a42a9999a5..f361345478b5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml @@ -41,7 +41,7 @@ <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> <!-- Verify Parent Category and Sub category is not visible in navigation menu --> - <amOnPage url="$$createCategory.name_lwr$$/{{SimpleSubCategory.name_lwr}}.html" stepKey="openCategoryStoreFrontPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$/{{SimpleSubCategory.urlKey}}.html" stepKey="openCategoryStoreFrontPage"/> <waitForPageLoad stepKey="waitForCategoryStoreFrontPageToLoad"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="dontSeeCategoryOnStoreNavigationBar"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSubCategoryOnStoreNavigation"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml index 99fd1cf3caf3..88d24540b11f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml @@ -42,7 +42,7 @@ <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> <!-- Verify Parent Category and Sub category is not visible in navigation menu --> - <amOnPage url="$$createCategory.name_lwr$$/{{SimpleSubCategory.name_lwr}}.html" stepKey="openCategoryStoreFrontPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$/{{SimpleSubCategory.urlKey}}.html" stepKey="openCategoryStoreFrontPage"/> <waitForPageLoad stepKey="waitForCategoryStoreFrontPageToLoad"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="dontSeeCategoryOnStoreNavigationBar"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSubCategoryOnStoreNavigation"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml index 3fff2c118ae6..f956c7331942 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml @@ -124,7 +124,7 @@ <waitForPageLoad stepKey="waitForPageTitleToBeSaved"/> <!--Open Category Store Front Page--> <comment userInput="Open Category Store Front Page" stepKey="commentOpenCategoryOnStorefront"/> - <amOnPage url="{{_defaultCategory.name}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{_defaultCategory.urlKey}}.html" stepKey="goToStorefront"/> <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="seeCategoryOnNavigation"/> <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="selectCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml index 32c1599355f8..8e45c223fbf4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml @@ -89,7 +89,7 @@ <!--See correct placeholder images on category page--> <comment userInput="Check placeholder images on the storefront" stepKey="checkStorefrontComment"/> - <amOnPage url="$$category.name$$.html" stepKey="goToCategoryStorefront1"/> + <amOnPage url="$$category.custom_attributes[url_key]$$.html" stepKey="goToCategoryStorefront1"/> <waitForPageLoad stepKey="waitForStorefrontCategory1"/> <!--Product with no images uses placeholder--> <seeElement selector="{{StorefrontCategoryProductSection.ProductImageByName($$productNoImages.name$$)}}" stepKey="seeProductNoImagesInCategory"/> @@ -124,7 +124,7 @@ <argument name="productName" value="$$productNoImages.name$$"/> </actionGroup> <!--Product which is NOT using placeholder--> - <amOnPage url="$$category.name$$.html" stepKey="goToCategoryStorefront2"/> + <amOnPage url="$$category.custom_attributes[url_key]$$.html" stepKey="goToCategoryStorefront2"/> <waitForPageLoad stepKey="waitForStorefrontCategory2"/> <click selector="{{StorefrontCategoryProductSection.ProductImageByName($$productWithImages.name$$)}}" stepKey="goToProductWithImages"/> <waitForPageLoad stepKey="waitForProductPageLoad2"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml index 0525e7543acc..1ba9c3a6ddc7 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml @@ -64,7 +64,7 @@ <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> - <argument name="productUrl" value="{{_defaultProduct.name}}"/> + <argument name="productUrl" value="{{_defaultProduct.urlKey}}"/> </actionGroup> <!-- Assert related products at the storefront --> @@ -114,7 +114,7 @@ <!-- Verify Url Key after changing --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> - <argument name="productUrl" value="{{SimpleProduct.name}}"/> + <argument name="productUrl" value="{{SimpleProduct.urlKey}}"/> </actionGroup> <!-- Assert related products at the storefront --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml index ce3dd8fa0873..61b7b8f6eaca 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml @@ -97,7 +97,7 @@ <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> - <argument name="productUrl" value="{{defaultVirtualProduct.name}}"/> + <argument name="productUrl" value="{{defaultVirtualProduct.urlKey}}"/> </actionGroup> <!-- Assert two related products at the storefront --> @@ -166,7 +166,7 @@ <!-- Verify Url Key after changing --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> - <argument name="productUrl" value="{{SimpleProduct.name}}"/> + <argument name="productUrl" value="{{SimpleProduct.urlKey}}"/> </actionGroup> <!-- Assert three related products at the storefront --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndSwitchProductType/AdminCreateSimpleProductSwitchToVirtualTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndSwitchProductType/AdminCreateSimpleProductSwitchToVirtualTest.xml index 6e607ca012ba..72f1fdb1ae63 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndSwitchProductType/AdminCreateSimpleProductSwitchToVirtualTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndSwitchProductType/AdminCreateSimpleProductSwitchToVirtualTest.xml @@ -27,7 +27,7 @@ <argument name="product" value="_defaultProduct"/> </actionGroup> <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetSearch"/> - <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> + <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml index 8d0534891a29..6886775bff57 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml @@ -71,15 +71,13 @@ </actionGroup> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Verify Product in store front page--> - <amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.name_lwr)}}" stepKey="amOnCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.urlKey)}}" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForPageToBeLoaded"/> <see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seeCategoryPageTitle"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="seeCategoryOnNavigation"/> <waitForPageLoad stepKey="waitForProductToLoad"/> - <seeElement selector="{{StorefrontCategoryMainSection.productLinkByHref($$simpleProduct.urlKey$$)}}" stepKey="seeProductInCategory"/> + <seeElement selector="{{StorefrontCategoryMainSection.productLinkByHref($$simpleProduct.custom_attributes[url_key]$$)}}" stepKey="seeProductInCategory"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithFiveNestingTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithFiveNestingTest.xml index f61a97219903..fcffd272a2fe 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithFiveNestingTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithFiveNestingTest.xml @@ -67,7 +67,7 @@ <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveFifthLevelCategory"/> <!-- Verify success message --> <actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertSuccessMessage4"/> - <amOnPage url="/{{FirstLevelSubCat.name}}/{{SecondLevelSubCat.name}}/{{ThirdLevelSubCat.name}}/{{FourthLevelSubCat.name}}/{{FifthLevelCat.name}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> + <amOnPage url="/{{FirstLevelSubCat.urlKey}}/{{SecondLevelSubCat.urlKey}}/{{ThirdLevelSubCat.urlKey}}/{{FourthLevelSubCat.urlKey}}/{{FifthLevelCat.urlKey}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> <waitForPageLoad time="60" stepKey="waitForStoreFrontPageLoad"/> <!--<Verify category displayed in store front page--> <grabMultiple selector=".breadcrumbs li" stepKey="breadcrumbs"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithNoAnchorFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithNoAnchorFieldTest.xml index 4173254c66fc..d6fb7d0aa2c8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithNoAnchorFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithNoAnchorFieldTest.xml @@ -80,12 +80,12 @@ </actionGroup> <!--Verify Product in store front page--> - <amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.name_lwr)}}" stepKey="amOnCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.urlKey)}}" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForPageToBeLoaded"/> <see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seeCategoryPageTitle"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="seeCategoryOnNavigation"/> <waitForPageLoad stepKey="waitForProductToLoad"/> - <seeElement selector="{{StorefrontCategoryMainSection.productLinkByHref($$simpleProduct.urlKey$$)}}" stepKey="seeProductInCategory"/> + <seeElement selector="{{StorefrontCategoryMainSection.productLinkByHref($$simpleProduct.custom_attributes[url_key]$$)}}" stepKey="seeProductInCategory"/> <dontSeeElement selector="{{StorefrontCategorySidebarSection.filterOptions}}" stepKey="dontSeeFilterOptionsForNonAnchorCategory"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml index af72dba3f805..31ad92afb9d4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml @@ -36,7 +36,7 @@ <see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seePageTitle" /> <seeElement selector="{{AdminCategoryContentSection.activeCategoryInTree(_defaultCategory.name)}}" stepKey="seeCategoryInTree" /> <!--Verify Category is listed in store front page menu/>--> - <amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.name)}}" stepKey="amOnCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.urlKey)}}" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForPageToBeLoaded"/> <see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seeCategoryPageTitle"/> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml index 10cba3ab209e..4758bf63859b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml @@ -114,7 +114,7 @@ <see selector="{{AdminProductAttributeGridSection.isComparableColumn}}" userInput="Yes" stepKey="seeComparableColumn"/> <!--Verify Product Attribute is present in Category Store Front Page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="goToStorefrontPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontPage"/> <waitForPageLoad stepKey="waitForProductFrontPageToLoad"/> <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="clickOnCategory"/> <waitForPageLoad stepKey="waitForPageToLoad"/> @@ -130,7 +130,7 @@ <see selector="{{StorefrontProductMoreInformationSection.attributeValue}}" userInput="{{ProductAttributeOption8.value}}" stepKey="seeAttributeValue"/> <!--Verify Product Attribute present in search page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="goToStorefrontPage1"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontPage1"/> <waitForPageLoad stepKey="waitForProductFrontPageToLoad1"/> <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{ProductAttributeOption8.value}}" stepKey="fillAttribute"/> <waitForPageLoad stepKey="waitForSearchTextBox"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml index 9db8e74b6ae7..5931193dbe7c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml @@ -82,10 +82,7 @@ <click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSave"/> <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/> - <!-- Flash cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Go to store's advanced catalog search page --> <actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroup"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml index 7447c75a778a..47c7f86067cf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml @@ -31,9 +31,7 @@ <argument name="storeView" value="customStoreFR"/> </actionGroup> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Enable Flat Catalog Category --> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 1"/> <!--Open Index Management Page and Select Index mode "Update by Schedule" --> @@ -64,14 +62,12 @@ <see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{CatNotActive.name}}" stepKey="seeUpdatedCategoryTitle"/> <dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}" stepKey="verifyInactiveCategory"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Open Index Management Page --> <actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/> <see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/> <!--Verify Category In Store Front--> - <amOnPage url="/$$createCategory.name$$.html" stepKey="openCategoryPage1"/> + <amOnPage url="/$$createCategory.custom_attributes[url_key]$$.html" stepKey="openCategoryPage1"/> <waitForPageLoad stepKey="waitForCategoryStoreFrontPageToLoad"/> <seeElement selector="{{StorefrontBundledSection.pageNotFound}}" stepKey="seeWhoopsOurBadMessage"/> <!--Verify category is not visible in First Store View --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml index df2124759686..fc09a1ac07d5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml @@ -31,9 +31,7 @@ <argument name="storeView" value="customStoreFR"/> </actionGroup> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Enable Flat Catalog Category --> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 1"/> <!--Open Index Management Page and Select Index mode "Update by Schedule" --> @@ -67,13 +65,11 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value="catalog_category_flat"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/> <see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/> <!--Verify Category In Store Front--> - <amOnPage url="/$$createCategory.name$$.html" stepKey="openCategoryPage1"/> + <amOnPage url="/$$createCategory.custom_attributes[url_key]$$.html" stepKey="openCategoryPage1"/> <waitForPageLoad stepKey="waitForCategoryStoreFrontPageToLoad"/> <!--Verify category is not visible in First Store View --> <click stepKey="selectStoreSwitcher" selector="{{StorefrontHeaderSection.storeViewSwitcher}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml index 2f86209da1eb..a2bd771c58fe 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml @@ -31,9 +31,7 @@ <argument name="storeView" value="customStoreFR"/> </actionGroup> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Enable Flat Catalog Category --> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 1"/> <!--Open Index Management Page and Select Index mode "Update by Schedule" --> @@ -68,13 +66,11 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value="catalog_category_flat"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/> <see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/> <!--Verify Category In Store Front--> - <amOnPage url="/$$category.name$$.html" stepKey="openCategoryPage1"/> + <amOnPage url="/$$category.custom_attributes[url_key]$$.html" stepKey="openCategoryPage1"/> <waitForPageLoad stepKey="waitForCategoryStoreFrontPageToLoad"/> <!--Verify category is not displayed in navigation menu in First Store View --> <click stepKey="selectStoreSwitcher" selector="{{StorefrontHeaderSection.storeViewSwitcher}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml index 7b555aa84be0..45b776a6c871 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml @@ -86,10 +86,7 @@ <click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSave"/> <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/> - <!-- Flash cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Go to store's advanced catalog search page --> <actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroup"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml index 37a4bc613f65..8f56a062c911 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml @@ -55,7 +55,7 @@ <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="fillProductQty"/> <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectStockStatus"> <argument name="stockStatus" value="In Stock"/> - </actionGroup> + </actionGroup> <!-- Create New Product Attribute --> <click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickOnAddAttribute"/> @@ -110,7 +110,7 @@ <see selector="{{AdminProductAttributeGridSection.isComparableColumn}}" userInput="Yes" stepKey="seeComparableColumn"/> <!--Verify Product Attribute is present in Category Store Front Page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="goToStorefrontPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontPage"/> <waitForPageLoad stepKey="waitForProductFrontPageToLoad"/> <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="clickOnCategory"/> <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> @@ -126,12 +126,16 @@ <see selector="{{StorefrontProductMoreInformationSection.attributeValue}}" userInput="{{ProductAttributeOption8.value}}" stepKey="seeAttributeValue"/> <!--Verify Product Attribute present in search page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="goToStorefrontPage1"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontPage1"/> <waitForPageLoad stepKey="waitForProductFrontPageToLoad1"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{ProductAttributeOption8.value}}" stepKey="fillAttribute"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <see selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="seeProductNameInCategoryPage"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillAttribute"> + <argument name="phrase" value="{{ProductAttributeOption8.value}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProductNameInCategoryPage"> + <argument name="productName" value="{{SimpleProduct.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml index d1110f593545..069baf6544d3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml @@ -35,7 +35,7 @@ <click selector="{{AdminProductAttributeSetSection.modalOk}}" stepKey="confirmDelete"/> <waitForPageLoad stepKey="wait3"/> - <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> + <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> </after> <!-- Create a new attribute set --> @@ -79,7 +79,7 @@ <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <!-- Check the storefront --> - <amOnPage url="{{_defaultProduct.name}}.html" stepKey="goToProductPage"/> + <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <seeInTitle userInput="{{_defaultProduct.name}}" stepKey="seeProductNameInTitlte"/> <see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest/AdminCreateProductDuplicateUrlkeyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest/AdminCreateProductDuplicateUrlkeyTest.xml index 6b3768cc88b3..e61684b91c08 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest/AdminCreateProductDuplicateUrlkeyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest/AdminCreateProductDuplicateUrlkeyTest.xml @@ -32,13 +32,24 @@ <actionGroup ref="AdminClickAddProductToggleAndSelectProductTypeActionGroup" stepKey="clickAddSimpleProduct"> <argument name="productType" value="simple"/> </actionGroup> - <fillField userInput="$$simpleProduct.name$$new" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> - <fillField userInput="$$simpleProduct.sku$$new" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> - <fillField userInput="$$simpleProduct.price$$" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> - <fillField userInput="$$simpleProduct.quantity$$" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> + <actionGroup ref="AdminFillProductNameOnProductFormActionGroup" stepKey="fillName"> + <argument name="productName" value="$$simpleProduct.name$$new"/> + </actionGroup> + <actionGroup ref="AdminFillProductSkuOnProductFormActionGroup" stepKey="fillSKU"> + <argument name="productSku" value="$$simpleProduct.sku$$new"/> + </actionGroup> + <actionGroup ref="AdminFillProductPriceFieldAndPressEnterOnProductEditPageActionGroup" stepKey="fillPrice"> + <argument name="price" value="$$simpleProduct.price$$"/> + </actionGroup> + <actionGroup ref="AdminFillProductQtyOnProductFormActionGroup" stepKey="fillQuantity"> + <argument name="productQty" value="$$simpleProduct.quantity$$"/> + </actionGroup> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> <fillField userInput="$$simpleProduct.custom_attributes[url_key]$$" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/> - <see userInput="The value specified in the URL Key field would generate a URL that already exists" selector="{{AdminProductMessagesSection.errorMessage}}" stepKey="assertErrorMessage"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertErrorMessage"> + <argument name="messageType" value="error"/> + <argument name="message" value="The value specified in the URL Key field would generate a URL that already exists"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductNotVisibleIndividuallyTest.xml index 12cd5454ea8e..deaa736ea6b4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductNotVisibleIndividuallyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductNotVisibleIndividuallyTest.xml @@ -23,7 +23,11 @@ <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> </before> <after> - <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{simpleProductNotVisibleIndividually.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminConfigDefaultProductLayoutFromConfigurationSettingTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminConfigDefaultProductLayoutFromConfigurationSettingTest.xml index ac2e86a57245..819835dead30 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminConfigDefaultProductLayoutFromConfigurationSettingTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminConfigDefaultProductLayoutFromConfigurationSettingTest.xml @@ -5,8 +5,8 @@ * See COPYING.txt for license details. */ --> -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminConfigDefaultProductLayoutFromConfigurationSettingTest"> <annotations> <features value="Catalog"/> @@ -21,18 +21,29 @@ <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="RestoreLayoutSetting" stepKey="sampleActionGroup"/> + <actionGroup ref="NavigateToDefaultLayoutsSettingActionGroup" stepKey="navigateToWebConfigurationPage1"/> + <actionGroup ref="AdminSetProductLayoutSettingsActionGroup" stepKey="sampleActionGroup"> + <argument name="layout" value="1 column"/> + </actionGroup> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheBeforeTestFinishes"> + <argument name="tags" value="config"/> + </actionGroup> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <actionGroup ref="AdminOpenWebConfigurationPageActionGroup" stepKey="navigateToWebConfigurationPage"/> - <conditionalClick stepKey="expandDefaultLayouts" selector="{{WebSection.DefaultLayoutsTab}}" dependentSelector="{{WebSection.CheckIfTabExpand}}" visible="true"/> - <waitForElementVisible selector="{{DefaultLayoutsSection.productLayout}}" stepKey="DefaultProductLayout"/> - <selectOption selector="{{DefaultLayoutsSection.productLayout}}" userInput="3 columns" stepKey="select3ColumnsLayout"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/> - <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToNewProduct"/> - <waitForPageLoad stepKey="wait1"/> - <click selector="{{ProductDesignSection.DesignTab}}" stepKey="clickOnDesignTab"/> - <waitForElementVisible selector="{{ProductDesignSection.LayoutDropdown}}" stepKey="waitForLayoutDropDown"/> + + <actionGroup ref="NavigateToDefaultLayoutsSettingActionGroup" stepKey="navigateToWebConfigurationPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandDefaultLayouts"/> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="DefaultProductLayout"/> + <actionGroup ref="AdminSetProductLayoutSettingsActionGroup" stepKey="select3ColumnsLayout"> + <argument name="layout" value="3 columns"/> + </actionGroup> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="clickSaveConfig"> + <argument name="tags" value="config"/> + </actionGroup> + <actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="navigateToNewProduct"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait1"/> + <actionGroup ref="AdminExpandProductDesignSectionActionGroup" stepKey="clickOnDesignTab"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLayoutDropDown"/> <seeOptionIsSelected selector="{{ProductDesignSection.LayoutDropdown}}" userInput="3 columns" stepKey="see3ColumnsSelected"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductNegativePriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductNegativePriceTest.xml index 9f51d6227aa1..32cce3633b10 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductNegativePriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductNegativePriceTest.xml @@ -18,11 +18,20 @@ <group value="product"/> </annotations> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> - <amOnPage url="{{AdminProductCreatePage.url(SimpleProduct.visibility, SimpleProduct.type_id)}}" stepKey="goToCreateProduct"/> - <waitForPageLoad stepKey="wait1"/> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="fillName"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="-42" stepKey="fillPrice"/> + <actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="goToCreateProduct"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait1"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillName"/> + <actionGroup ref="FillMainProductFormByStringActionGroup" stepKey="fillPrice"> + <argument name="productName" value="{{SimpleProduct.name}}"/> + <argument name="productSku" value="{{SimpleProduct.sku}}"/> + <argument name="productPrice" value="-42"/> + <argument name="productQuantity" value="{{SimpleProduct.quantity}}"/> + <argument name="productStatus" value="{{SimpleProduct.status}}"/> + <argument name="productWeight" value="{{SimpleProduct.weight}}"/> + </actionGroup> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSave"/> - <see selector="{{AdminProductFormSection.priceFieldError}}" userInput="Please enter a number 0 or greater in this field." stepKey="seePriceValidationError"/> + <actionGroup ref="AssertAdminValidationErrorAppearedForPriceFieldOnProductEditPageActionGroup" stepKey="seePriceValidationError"> + <argument name="errorMessage" value="Please enter a number 0 or greater in this field."/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductTest.xml index 3e5ccfd8bf3b..1c478eb4b654 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductTest.xml @@ -22,6 +22,11 @@ </before> <after> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> </after> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductZeroPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductZeroPriceTest.xml index 24f87cca958a..b1f18a770ea0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductZeroPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductZeroPriceTest.xml @@ -18,13 +18,22 @@ <group value="product"/> </annotations> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> - <amOnPage url="{{AdminProductCreatePage.url(SimpleProduct.visibility, SimpleProduct.type_id)}}" stepKey="goToCreateProduct"/> - <waitForPageLoad stepKey="wait1"/> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="fillName"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="0" stepKey="fillPrice"/> + <actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="goToCreateProduct"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait1"/> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillName"> + <argument name="product" value="SimpleProduct"/> + </actionGroup> + <actionGroup ref="AdminFillProductPriceFieldAndPressEnterOnProductEditPageActionGroup" stepKey="fillPrice"> + <argument name="price" value="0"/> + </actionGroup> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSave"/> - <amOnPage url="{{StorefrontProductPage.url(SimpleProduct.name)}}" stepKey="viewProduct"/> - <waitForPageLoad stepKey="wait2"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$0.00" stepKey="seeZeroPrice"/> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="viewProduct"> + <argument name="productUrl" value="{{SimpleProduct.urlKey}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait2"/> + <actionGroup ref="StorefrontAssertUpdatedProductPriceInStorefrontProductPageActionGroup" stepKey="seeZeroPrice"> + <argument name="productName" value="{{SimpleProduct.name}}"/> + <argument name="expectedPrice" value="$0.00"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml index 13efee209a55..47c7868b2400 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml @@ -48,10 +48,7 @@ </actionGroup> <!-- Save the product --> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> - <!-- Flush config cache to reset product attributes in attribute set --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushConfigCache"/> <reloadPage stepKey="reloadProductEditPage"/> <!-- Check default value --> <waitForElementVisible selector="{{AdminProductAttributesSection.sectionHeader}}" stepKey="waitAttributesSectionAppears"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml index a00714e412b0..0c1785b8f725 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml @@ -22,6 +22,10 @@ <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> </before> <after> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{ProductWithUnicode.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> </after> @@ -32,9 +36,7 @@ <argument name="simpleProduct" value="ProductWithUnicode"/> </actionGroup> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AssertProductInStorefrontCategoryPage" stepKey="assertProductInStorefront1"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="product" value="ProductWithUnicode"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateTextEditorProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateTextEditorProductAttributeTest.xml index fd6db45b1716..7d57d81e565b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateTextEditorProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateTextEditorProductAttributeTest.xml @@ -13,17 +13,19 @@ <features value="Catalog"/> <stories value="Create product Attribute"/> <title value="Admin create text editor product attribute test"/> - <description value="Create text editor product attribute with TinyMCE4 enabled"/> + <description value="Create text editor product attribute with TinyMCE enabled"/> <severity value="CRITICAL"/> <testCaseId value="MC-6338"/> <group value="catalog"/> </annotations> <before> <!-- Enable WYSIWYG editor --> - <magentoCLI command="config:set {{EnableWYSIWYG.path}} {{EnableWYSIWYG.value}}" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <!-- Enable TinyMCE 4 --> - <magentoCLI command="config:set {{EnableTinyMCE4.path}} {{EnableTinyMCE4.value}}" stepKey="enableTinyMCE4"/> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> <!-- Login as admin --> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductFillingRequiredFieldsOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductFillingRequiredFieldsOnlyTest.xml index cffefc4cd74c..4c02c57dae53 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductFillingRequiredFieldsOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductFillingRequiredFieldsOnlyTest.xml @@ -25,31 +25,54 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" stepKey="clickAddProductToggle"/> - <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" stepKey="waitForProductToggleToSelectProduct"/> - <actionGroup ref="AdminClickAddProductToggleAndSelectProductTypeActionGroup" stepKey="clickVirtualProduct"> + <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" + stepKey="openProductCatalogPage"/> + <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" + stepKey="clickAddProductToggle"/> + <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" + stepKey="waitForProductToggleToSelectProduct"/> + <actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="clickVirtualProduct"> <argument name="productType" value="virtual"/> </actionGroup> <!-- Create virtual product with required fields only --> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{virtualProductWithRequiredFields.name}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{virtualProductWithRequiredFields.sku}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{virtualProductWithRequiredFields.price}}" stepKey="fillProductPrice"/> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillProductName"> + <argument name="product" value="virtualProductWithRequiredFields"/> + </actionGroup> + <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" + stepKey="fillProductSku"/> + <actionGroup ref="AdminFillProductPriceFieldAndPressEnterOnProductEditPageActionGroup" stepKey="fillProductPrice"> + <argument name="price" value="{{virtualProductWithRequiredFields.price}}"/> + </actionGroup> <actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/> <!-- Verify we see success message --> - <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertVirtualProductSuccessMessage"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeAssertVirtualProductSuccessMessage"> + <argument name="message" value="You saved the product."/> + </actionGroup> <!-- Verify we see created virtual product(from the above step) on the product grid page --> <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage1"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clickSelector"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickFilter"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{virtualProductWithRequiredFields.name}}" stepKey="fillProductName1"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{virtualProductWithRequiredFields.sku}}" stepKey="fillVirtualProductSku"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickSearch2"/> - <waitForPageLoad stepKey="waitForProductSearch"/> - <seeInField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{virtualProductWithRequiredFields.name}}" stepKey="seeVirtualProductName"/> - <seeInField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{virtualProductWithRequiredFields.sku}}" stepKey="seeVirtualProductSku"/> + <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" + stepKey="clickSelector"/> + <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" + stepKey="clickFilter"/> + <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" + stepKey="fillProductName1"/> + <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" + stepKey="fillVirtualProductSku"/> + <actionGroup ref="FilterProductGridBySkuAndNameActionGroup" stepKey="clickSearch2"> + <argument name="product" value="virtualProductWithRequiredFields"/> + </actionGroup> + <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" + stepKey="waitForProductSearch"/> + <actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeVirtualProductName"> + <argument name="column" value="Name"/> + <argument name="value" value="{{virtualProductWithRequiredFields.name}}"/> + </actionGroup> + <actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeVirtualProductSku"> + <argument name="column" value="SKU"/> + <argument name="value" value="{{virtualProductWithRequiredFields.sku}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml index 3141db87f697..c9670ba5a8a7 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml @@ -118,18 +118,20 @@ <!-- Verify we see success message --> <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertVirtualProductSuccessMessage"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Verify customer see created virtual product with custom options suite and import options(from above step) on storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(virtualProductCustomImportOptions.urlKey)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{virtualProductCustomImportOptions.sku}}" stepKey="fillVirtualProductName"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{virtualProductCustomImportOptions.name}}" stepKey="seeVirtualProductName"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> + <argument name="phrase" value="{{virtualProductCustomImportOptions.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeVirtualProductName"> + <argument name="productName" value="{{virtualProductCustomImportOptions.name}}"/> + </actionGroup> <click selector="{{StorefrontQuickSearchResultsSection.productLink}}" stepKey="openSearchedProduct"/> <!-- Verify we see created virtual product with custom options suite and import options on the storefront page --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml index f2840758d59a..0c4709b01da4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml @@ -91,22 +91,25 @@ <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{virtualProductBigQty.urlKey}}" stepKey="seeUrlKey"/> <!--Verify customer see created virtual product on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{virtualProductBigQty.name}}" stepKey="seeVirtualProductNameOnCategoryPage"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Verify customer see created virtual product with tier price(from above step) on storefront page and is searchable by sku --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{virtualProductBigQty.sku}}" stepKey="fillVirtualProductName"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{virtualProductBigQty.name}}" stepKey="seeVirtualProductName"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> + <argument name="phrase" value="{{virtualProductBigQty.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeVirtualProductName"> + <argument name="productName" value="{{virtualProductBigQty.name}}"/> + </actionGroup> + <grabTextFrom selector="{{StorefrontQuickSearchResultsSection.asLowAsLabel}}" stepKey="tierPriceTextOnStorefrontPage"/> <assertEquals stepKey="assertTierPriceTextOnCategoryPage"> <expectedResult type="string">As low as ${{tierPriceOnVirtualProduct.price}}</expectedResult> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml index bf0d5d99a23b..5b1c3c7afc31 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml @@ -87,18 +87,31 @@ <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> </after> <!--Open Product in Store Front Page --> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="openProductInStoreFront"/> - <waitForPageLoad stepKey="waitForProductToLoad"/> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductInStoreFront"> + <argument name="product" value="$createConfigProduct$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForProductToLoad"/> + <!--Verify Product is visible and In Stock --> - <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInFrontPage"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductNameInStoreFront"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigProduct.price$$" stepKey="seeProductPriceInStoreFront"/> + <actionGroup ref="StorefrontAssertCategoryNameIsShownInMenuActionGroup" stepKey="seeCategoryInFrontPage"> + <argument name="categoryName" value="$$createCategory.name$$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeProductNameInStoreFront"> + <argument name="productName" value="$$createConfigProduct.name$$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeProductPriceInStoreFront"> + <argument name="productPrice" value="$$createConfigChildProduct1.price$$"/> + </actionGroup> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSkuInStoreFront"> <argument name="productSku" value="$$createConfigProduct.sku$$"/> </actionGroup> - <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="In Stock" stepKey="seeProductStatusInStoreFront"/> - <see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="$$createConfigProductAttribute.default_value$$" stepKey="seeProductAttributeLabel"/> - <seeElement selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeProductAttributeOptions"/> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="seeProductStatusInStoreFront"> + <argument name="productStockStatus" value="In Stock"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductAttributeLabelVisibleActionGroup" stepKey="seeProductAttributeLabel"> + <argument name="productAttributeLabel" value="$$createConfigProductAttribute.default_value$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductOptionsDropDownVisibleActionGroup" stepKey="seeProductAttributeOptions"/> <!-- Delete Child products --> <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteFirstChildProduct"> <argument name="sku" value="$$createConfigChildProduct1.sku$$"/> @@ -107,21 +120,32 @@ <argument name="sku" value="$$createConfigChildProduct2.sku$$"/> </actionGroup> <!--Verify product is not visible in category store front page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="openCategoryStoreFrontPage"/> - <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> - <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInStoreFrontPage"/> - <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="clickOnCategory"/> - <dontSee selector="{{StorefrontCategoryMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="dontSeeProductInCategoryPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="openCategoryStoreFrontPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategoryPageToLoad"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeCategoryInStoreFrontPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickOnCategory"/> + <actionGroup ref="AssertStorefrontProductAbsentOnCategoryPageActionGroup" stepKey="dontSeeProductInCategoryPage"> + <argument name="categoryUrlKey" value="$$createCategory.name$$"/> + <argument name="productName" value="$$createConfigProduct.name$$"/> + </actionGroup> <!--Open Product Store Front Page and Verify Product is Out Of Stock --> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="openProductInStoreFront1"/> - <waitForPageLoad stepKey="waitForProductToLoad1"/> - <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInFrontPage1"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductNameInStoreFront1"/> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductInStoreFront1"> + <argument name="product" value="$createConfigProduct$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForProductToLoad1"/> + <actionGroup ref="StorefrontAssertCategoryNameIsShownInMenuActionGroup" stepKey="seeCategoryInFrontPage1"> + <argument name="categoryName" value="$$createCategory.name$$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeProductNameInStoreFront1"> + <argument name="productName" value="$$createConfigProduct.name$$"/> + </actionGroup> <dontSee selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigProduct.price$$" stepKey="dontSeeProductPriceInStoreFront"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSkuInStoreFront1"> <argument name="productSku" value="$$createConfigProduct.sku$$"/> </actionGroup> - <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="OUT OF STOCK" stepKey="seeProductStatusInStoreFront1"/> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="seeProductStatusInStoreFront1"> + <argument name="productStockStatus" value="OUT OF STOCK"/> + </actionGroup> <dontSee selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="$$createConfigProductAttribute.default_value$$" stepKey="dontSeeProductAttributeLabel"/> <dontSeeElement selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="dontSeeProductAttributeOptions"/> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml index 4599d0c27521..2c05b1515bc9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml @@ -35,7 +35,7 @@ </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!--Verify product on product page --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> @@ -45,7 +45,7 @@ <dontSee userInput="$$createSimpleProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/> <see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/> <!-- Go to the category page that we created in the before block --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <!-- Should not see the product --> <dontSee userInput="$$createSimpleProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/> <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml index 3514f53e8b93..0cb59ee54ae9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml @@ -66,9 +66,7 @@ <argument name="websiteName" value="{{NewWebSiteData.name}}"/> </actionGroup> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <deleteData createDataKey="createSubCategory" stepKey="deleteSubCategory"/> <deleteData createDataKey="createRootCategory" stepKey="deleteRootCategory"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> @@ -95,9 +93,7 @@ </actionGroup> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Switch to 'Default Store View' scope and open product page--> <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="SwitchDefaultStoreView"> <argument name="storeViewName" value="'Default Store View'"/> @@ -179,7 +175,7 @@ <waitForPageLoad stepKey="waitForImagesLoad3"/> <dontSeeElement selector="{{AdminProductImagesSection.imageFile(TestImageNew.fileName)}}" stepKey="seeImageIsDeleted"/> <!--Open Storefront on Default store view and assert image existence--> - <amOnPage url="{{StorefrontCategoryPage.url($$createSubCategory.name$$)}}" stepKey="navigateToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createSubCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad0"/> <grabAttributeFrom userInput="src" selector="{{StorefrontCategoryMainSection.mediaDescription($$createProduct.name$$)}}" stepKey="grabAttributeFromImage"/> <assertStringContainsString stepKey="assertProductImageAbsence"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml index bdd1a4b4c70f..2c6cc08d7689 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml @@ -34,7 +34,7 @@ </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!--Verify product on Product Page --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> @@ -44,7 +44,7 @@ <dontSee userInput="$$createSimpleProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/> <see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/> <!-- Go to the category page that we created in the before block --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <!-- Should not see the product --> <dontSee userInput="$$createSimpleProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/> <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml index dcfcbd699fc6..de72de276929 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml @@ -35,7 +35,7 @@ </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!--Verify product on product page --> - <amOnPage url="{{StorefrontProductPage.url($$createVirtualProduct.name$$)}}" stepKey="amOnVirtualProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createVirtualProduct.custom_attributes[url_key]$$)}}" stepKey="amOnVirtualProductPage"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> @@ -45,7 +45,7 @@ <dontSee userInput="$$createVirtualProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/> <see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/> <!-- Go to the category page that we created in the before block --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <!-- Should not see the product --> <dontSee userInput="$$createVirtualProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/> <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml index 283ed72e62fa..979762e1d98b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml @@ -20,7 +20,9 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> <createData stepKey="myProductAttributeCreation" entity="productAttributeWysiwyg"/> <createData stepKey="myProductAttributeSetAssign" entity="AddToDefaultSet"> <requiredEntity createDataKey="myProductAttributeCreation"/> @@ -46,7 +48,7 @@ <fillField selector="{{ProductAttributeWYSIWYGSection.TextArea($$myProductAttributeCreation.attribute_code$$)}}" userInput="Text Area" stepKey="fillContentTextarea" /> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/> <!-- Go to storefront product page, assert product content --> - <amOnPage url="{{_defaultProduct.name}}.html" stepKey="navigateToProductPage"/> + <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForPageLoad5"/> <see userInput="Text Area" stepKey="seeText2" /> <actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="navigateToProductAttributeGrid2"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml index 4dd76e55f933..e8ed35ecb4a9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml @@ -32,9 +32,7 @@ </createData> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributeDatetimeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributeDatetimeTest.xml new file mode 100644 index 000000000000..161c349b4d29 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributeDatetimeTest.xml @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminMassUpdateProductAttributeDatetimeTest"> + <annotations> + <features value="Catalog"/> + <stories value="Mass update product attributes"/> + <title value="Admin should be able to mass update datetime attribute"/> + <description value="Admin should be able to mass update datetime attribute"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-41972"/> + <useCaseId value="MC-41796"/> + <group value="catalog"/> + <group value="product_attributes"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="ApiSimpleProduct" stepKey="createProductOne"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="ApiSimpleProduct" stepKey="createProductTwo"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <!-- Create new datetime product attribute --> + <createData entity="DatetimeProductAttribute" stepKey="createDatetimeProduct"/> + <createData entity="AddToDefaultSet" stepKey="addToDefaultSet"> + <requiredEntity createDataKey="createDatetimeProduct"/> + </createData> + </before> + <after> + <deleteData createDataKey="createProductOne" stepKey="deleteProductOne"/> + <deleteData createDataKey="createProductTwo" stepKey="deleteProductTwo"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductFilter"/> + <deleteData createDataKey="createDatetimeProduct" stepKey="deleteDatetimeProduct" /> + <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> + </after> + <!-- Generate the datetime default value --> + <generateDate date="+1 day" format="m/j/Y g:i A" stepKey="randomDatetime"/> + <!-- Navigate to products list page and select created products --> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/> + <actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword"> + <argument name="keyword" value="api-simple-product"/> + </actionGroup> + <actionGroup ref="SortProductsByIdDescendingActionGroup" stepKey="sortProductsByIdDescending"/> + <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox1"/> + <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="clickCheckbox2"/> + <!-- Mass update qty increments --> + <actionGroup ref="AdminClickMassUpdateProductAttributesActionGroup" stepKey="clickMassUpdateProductAttributes"/> + <actionGroup ref="AdminMassUpdateProductAttributeActionGroup" stepKey="updateAttribute"> + <argument name="attributeCode" value="$createDatetimeProduct.attribute_code$"/> + <argument name="attributeValue" value="{$randomDatetime}"/> + </actionGroup> + <actionGroup ref="AdminMassUpdateProductAttributeSaveActionGroup" stepKey="saveForm"/> + <!-- Start message queue for product attribute consumer --> + <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> + <argument name="consumerName" value="{{AdminProductAttributeUpdateMessageConsumerData.consumerName}}"/> + <argument name="maxMessages" value="{{AdminProductAttributeUpdateMessageConsumerData.messageLimit}}"/> + </actionGroup> + + <!-- Open first product for edit and assert that qty increment is updated --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> + <argument name="productId" value="$createProductOne.id$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForProductPageLoad"/> + <seeInField selector="{{AdminProductFormSection.attributeRequiredInput($createDatetimeProduct.attribute_code$)}}" userInput="{$randomDatetime}" stepKey="assertQtyIncrementsValue"/> + + <!-- Open second product for edit and assert that qty increment is updated --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage2"> + <argument name="productId" value="$createProductTwo.id$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForProductPageLoad2"/> + <seeInField selector="{{AdminProductFormSection.attributeRequiredInput($createDatetimeProduct.attribute_code$)}}" userInput="{$randomDatetime}" stepKey="assertQtyIncrementsValue2"/> + </test> +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeTest.xml index 30ab17f65f3c..44df83a4a729 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeTest.xml @@ -14,8 +14,8 @@ <title value="Admin should be able to mass update product attributes in store view scope"/> <description value="Admin should be able to mass update product attributes in store view scope"/> <severity value="AVERAGE"/> - <testCaseId value="MC-128"/> - <group value="Catalog"/> + <testCaseId value="MC-25333"/> + <group value="catalog"/> <group value="Product Attributes"/> <group value="SearchEngineElasticsearch"/> </annotations> @@ -51,35 +51,43 @@ <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="AdminSwitchStoreViewActionGroup"/> <!-- Update attribute --> <click selector="{{AdminEditProductAttributesSection.ChangeAttributeDescriptionToggle}}" stepKey="toggleToChangeDescription"/> - <fillField selector="{{AdminEditProductAttributesSection.AttributeDescription}}" userInput="Updated $$createProductOne.custom_attributes[description]$$" stepKey="fillAttributeDescriptionField"/> + <fillField selector="{{AdminEditProductAttributesSection.AttributeDescription}}" userInput="Updated $createProductOne.custom_attributes[description]$" stepKey="fillAttributeDescriptionField"/> <click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="save"/> <see selector="{{AdminProductMessagesSection.successMessage}}" userInput="Message is added to queue" stepKey="seeAttributeUpateSuccessMsg"/> + <!-- Start message queue for product attribute consumer --> + <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> + <argument name="consumerName" value="{{AdminProductAttributeUpdateMessageConsumerData.consumerName}}"/> + <argument name="maxMessages" value="{{AdminProductAttributeUpdateMessageConsumerData.messageLimit}}"/> + </actionGroup> <!-- Assert on storefront default view with partial word of product name --> <actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroupDefault"/> <actionGroup ref="StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup" stepKey="searchByNameDefault"> - <argument name="name" value="$$createProductOne.name$$"/> - <argument name="description" value="$$createProductOne.custom_attributes[description]$$"/> + <argument name="name" value="$createProductOne.name$"/> + <argument name="description" value="$createProductOne.custom_attributes[description]$"/> </actionGroup> <actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultDefault"/> - <see userInput="2 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="seeInDefault"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="seeInDefault"/> <!-- Assert on storefront custom view with partial word of product name --> <actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroupCustom"/> <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="StorefrontSwitchStoreViewActionGroup"/> <actionGroup ref="StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup" stepKey="searchByNameCustom"> - <argument name="name" value="$$createProductOne.name$$"/> - <argument name="description" value="Updated $$createProductOne.custom_attributes[description]$$"/> + <argument name="name" value="$createProductTwo.name$"/> + <argument name="description" value="Updated $createProductOne.custom_attributes[description]$"/> </actionGroup> <actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultCustom"/> - <see userInput="2 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="seeInCustom"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="seeInCustom"/> <!-- Assert Storefront default view with exact product name --> <actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroupDefault1"/> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToDefaultStoreView"> + <argument name="storeView" value="_defaultStore"/> + </actionGroup> <actionGroup ref="StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup" stepKey="searchByNameDefault1"> - <argument name="name" value="$$createProductThree.name$$"/> - <argument name="description" value="$$createProductThree.custom_attributes[description]$$"/> + <argument name="name" value="$createProductThree.name$"/> + <argument name="description" value="$createProductThree.custom_attributes[description]$"/> </actionGroup> <actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultDefault1"/> <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="seeInDefault1"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml index 3da19eb59801..ff9d99f76d6b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml @@ -66,12 +66,10 @@ <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage2"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Open Category in store front page--> - <amOnPage url="/$$createDefaultCategory.name$$/{{FirstLevelSubCat.name}}/{{SimpleSubCategory.name}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> + <amOnPage url="/$$createDefaultCategory.custom_attributes[url_key]$$/{{FirstLevelSubCat.urlKey}}/{{SimpleSubCategory.urlKey}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontPageLoad"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="seeDefaultCategoryOnStoreNavigationBar"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSubCategoryOnStoreNavigationBar"/> @@ -98,7 +96,7 @@ <click selector="{{AdminCategoryModalSection.ok}}" stepKey="clickOkButtonOnWarningPopup"/> <waitForPageLoad stepKey="waitForPageToLoad3"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You moved the category." stepKey="seeSuccessMoveMessage"/> - <amOnPage url="/{{SimpleSubCategory.name}}.html" stepKey="seeTheCategoryInStoreFrontPage1"/> + <amOnPage url="/{{SimpleSubCategory.urlKey}}.html" stepKey="seeTheCategoryInStoreFrontPage1"/> <waitForPageLoad stepKey="waitForStoreFrontPageLoad1"/> <!--Verify breadcrumbs in store front page after the move--> @@ -109,7 +107,7 @@ </assertEquals> <!--Open Category in store front--> - <amOnPage url="{{StorefrontCategoryPage.url(SimpleSubCategory.name)}}" stepKey="amOnCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url(SimpleSubCategory.urlKey)}}" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForPageToBeLoaded"/> <seeElement selector="{{StorefrontCategoryMainSection.CategoryTitle(SimpleSubCategory.name)}}" stepKey="seeCategoryInTitle"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="seeCategoryOnStoreNavigationBarAfterMove"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml index 1c55b09151cf..96f905c3d916 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml @@ -22,7 +22,7 @@ <createData entity="FirstLevelSubCat" stepKey="createDefaultCategory"> <field key="is_active">true</field> </createData> - <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <magentoCron groups="index" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -110,7 +110,7 @@ <see stepKey="verifyTheTargetPathAfterMove1" selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('1', 'Target Path')}}" userInput="{{FirstLevelSubCat.name_lwr}}2/{{SimpleSubCategory.name_lwr}}.html" /> <!--Verify before move Redirect Path directs to the category page--> - <amOnPage url="{{FirstLevelSubCat.name_lwr}}2/{{SubCategory.name_lwr}}/{{SimpleSubCategory.name_lwr}}.html" stepKey="openCategoryStoreFrontPage"/> + <amOnPage url="{{FirstLevelSubCat.urlKey}}2/{{SubCategory.urlKey}}/{{SimpleSubCategory.urlKey}}.html" stepKey="openCategoryStoreFrontPage"/> <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(FirstLevelSubCat.name)}}" stepKey="seeCategoryOnStoreNavigationBar"/> <seeElement selector="{{StorefrontCategoryMainSection.CategoryTitle(SimpleSubCategory.name)}}" stepKey="seeCategoryInTitle"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml index fe3ffbb4fc1d..2a03effb51ae 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml @@ -59,7 +59,7 @@ <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Verify category displayed in store front page--> - <amOnPage url="/$$createDefaultCategory.name$$/{{SimpleSubCategory.name}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> + <amOnPage url="/$$createDefaultCategory.custom_attributes[url_key]$$/{{SimpleSubCategory.urlKey}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontPageLoad"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="seeDefaultCategoryOnStoreNavigationBar"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSubCategoryOnStoreNavigationBar"/> @@ -88,7 +88,7 @@ <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You moved the category." stepKey="seeSuccessMoveMessage"/> <!--Open category in store front page--> - <amOnPage url="/{{SimpleSubCategory.name}}.html" stepKey="seeTheCategoryInStoreFrontPage1"/> + <amOnPage url="/{{SimpleSubCategory.urlKey}}.html" stepKey="seeTheCategoryInStoreFrontPage1"/> <waitForPageLoad stepKey="waitForStoreFrontPageLoad1"/> <!--Verify breadcrumbs after the move in store front page--> @@ -99,7 +99,7 @@ </assertEquals> <!--Open category store front page --> - <amOnPage url="{{StorefrontCategoryPage.url(SimpleSubCategory.name)}}" stepKey="amOnCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url(SimpleSubCategory.urlKey)}}" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForPageToBeLoaded"/> <!--Verify Category in store front--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml index 8eb3d9bbb806..c81e47a84189 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml @@ -56,7 +56,7 @@ <waitForText selector="{{AdminCategoryModalSection.message}}" userInput="This operation can take a long time" stepKey="seeWarningMessage"/> <click selector="{{AdminCategoryModalSection.cancel}}" stepKey="clickCancelButtonOnWarningPopup"/> <!-- Verify Category in store front page after clicking cancel button --> - <amOnPage url="/$$createDefaultCategory.name$$/{{FirstLevelSubCat.name}}/{{SecondLevelSubCat.name}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> + <amOnPage url="/$$createDefaultCategory.custom_attributes[url_key]$$/{{FirstLevelSubCat.urlKey}}/{{SecondLevelSubCat.urlKey}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontPageLoad"/> <waitForElementVisible selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="seeDefaultCategoryOnStoreNavigationBar"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSubCategoryOnStoreNavigationBar"/> @@ -76,10 +76,10 @@ <click selector="{{AdminCategoryModalSection.ok}}" stepKey="clickOkButtonOnWarningPopup"/> <waitForPageLoad stepKey="waitTheForPageToLoad"/> <waitForText selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You moved the category." stepKey="seeSuccessMoveMessage"/> - <amOnPage url="/{{SimpleSubCategory.name}}.html" stepKey="seeCategoryNameInStoreFrontPage"/> + <amOnPage url="/{{SimpleSubCategory.urlKey}}.html" stepKey="seeCategoryNameInStoreFrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontPageToLoad"/> <!-- Verify Category in store front after moving category to another position in category tree --> - <amOnPage url="{{StorefrontCategoryPage.url(SecondLevelSubCat.name)}}" stepKey="amOnCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url(SecondLevelSubCat.urlKey)}}" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForPageToBeLoaded"/> <waitForElementVisible selector="{{StorefrontCategoryMainSection.CategoryTitle(SecondLevelSubCat.name)}}" stepKey="seeCategoryInTitle"/> <waitForElementVisible selector="{{StorefrontHeaderSection.NavigationCategoryByName(SecondLevelSubCat.name)}}" stepKey="seeCategoryOnStoreNavigationBarAfterMove"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml index 0af391147481..002f11b5adfc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml @@ -140,7 +140,7 @@ <see userInput="$$simpleProduct.name$$" selector="{{StorefrontCategoryMainSection.productName}}" stepKey="seeProduct"/> <!-- Open <product1> --> - <click selector="{{StorefrontCategoryMainSection.productLinkByHref($$simpleProduct.urlKey$$)}}" stepKey="openProduct"/> + <click selector="{{StorefrontCategoryMainSection.productLinkByHref($$simpleProduct.custom_attributes[url_key]$$)}}" stepKey="openProduct"/> <waitForPageLoad stepKey="waitForProductPageLoading"/> <!-- # Product page should open successfully # Breadcrumb for product should be like <Cat 2> --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml index 94d7ea14b096..edde693c5120 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml @@ -156,9 +156,9 @@ <waitForPageLoad stepKey="waitForUpdatesTobeSaved1"/> <!--Go to SimpleProduct store front page--> - <amOnPage url="$$createSimpleProduct.sku$$.html" stepKey="goToSimpleProductFrontPage"/> + <amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="goToSimpleProductFrontPage"/> <waitForPageLoad stepKey="waitForProduct"/> - <see stepKey="seeProductName" userInput="$$createSimpleProduct.sku$$" selector="{{StorefrontProductInfoMainSection.productName}}"/> + <see stepKey="seeProductName" userInput="$$createSimpleProduct.name$$" selector="{{StorefrontProductInfoMainSection.productName}}"/> <scrollTo stepKey="scrollToTheUpSellHeading" selector="{{StorefrontProductUpSellProductsSection.upSellHeading}}"/> <!--Verify Up Sell Products displayed in SimpleProduct page--> @@ -167,7 +167,7 @@ <see stepKey="seeConfigProduct" selector="{{StorefrontProductUpSellProductsSection.upSellProducts}}" userInput="$$createConfigProduct.name$$"/> <!--Go to Config Product store front page--> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="goToConfigProductFrontPage"/> + <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="goToConfigProductFrontPage"/> <waitForPageLoad stepKey="waitForConfigProductToBeLoaded"/> <scrollTo stepKey="scrollToTheUpSellHeading1" selector="{{StorefrontProductUpSellProductsSection.upSellHeading}}"/> @@ -176,7 +176,7 @@ <see stepKey="seeSimpleProduct2" selector="{{StorefrontProductUpSellProductsSection.upSellProducts}}" userInput="$$createSimpleProduct1.name$$"/> <!--Go to SimpleProduct1 store front page--> - <amOnPage url="$$createSimpleProduct1.sku$$.html" stepKey="goToSimpleProduct1FrontPage"/> + <amOnPage url="$$createSimpleProduct1.custom_attributes[url_key]$$.html" stepKey="goToSimpleProduct1FrontPage"/> <waitForPageLoad stepKey="waitForSimpleProduct1ToBeLoaded"/> <!--Verify No Up Sell Products displayed in SimplProduct1 page--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml index e06a7f3c5679..a422d781b816 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml @@ -35,9 +35,7 @@ </actionGroup> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value="full_page"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createSimpleProductFirst" stepKey="deleteFirstSimpleProduct"/> @@ -80,8 +78,8 @@ <actionGroup ref="AdminSaveCategoryFormActionGroup" stepKey="saveCategory"/> <executeJS function="return '$createCategory.name$'.toLowerCase();" stepKey="categoryNameLower" /> - <executeJS function="return '$createSimpleProductFirst.name$'.toLowerCase();" stepKey="simpleProductFirstNameLower" /> - <executeJS function="return '$createSimpleProductSecond.name$'.toLowerCase();" stepKey="simpleProductSecondNameLower" /> + <executeJS function="return '$createSimpleProductFirst.custom_attributes[url_key]$'.toLowerCase();" stepKey="simpleProductFirstNameLower" /> + <executeJS function="return '$createSimpleProductSecond.custom_attributes[url_key]$'.toLowerCase();" stepKey="simpleProductSecondNameLower" /> <!-- Make assertions on frontend --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateWithCustomLocaleTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateWithCustomLocaleTest.xml new file mode 100644 index 000000000000..eae9cebd7e63 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateWithCustomLocaleTest.xml @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminProductGridFilteringByDateWithCustomLocaleTest"> + <annotations> + <features value="Catalog"/> + <stories value="Filter products"/> + <title value="Product grid date filters does not work for en_GB locale"/> + <description value="Product grid date filters does not work for en_GB locale"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-40644"/> + <useCaseId value="MC-40240"/> + <group value="catalog"/> + </annotations> + + <before> + <!-- Deploy static content with United Kingdom locale--> + <magentoCLI command="setup:static-content:deploy en_GB" stepKey="deployStaticContentWithUnitedKingdomLocale"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <!-- Create new User --> + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> + <actionGroup ref="AdminCreateUserWithRoleAndLocaleActionGroup" stepKey="createAdminUser"> + <argument name="user" value="activeAdmin"/> + <argument name="role" value="roleDefaultAdministrator"/> + <argument name="interfaceLocale" value="en_GB"/> + </actionGroup> + </before> + <after> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteAttribute"> + <argument name="ProductAttribute" value="dateProductAttribute"/> + </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="resetGridFilter"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <!-- Generate date for use as default value, needs to be MM/d/YYYY and mm/d/yy --> + <generateDate date="now" format="m/j/Y" stepKey="generateDefaultDate"/> + <generateDate date="now" format="j/m/Y" stepKey="generateDefaultDateGB"/> + + <!-- Navigate to Stores > Attributes > Product. --> + <actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributes"/> + + <!-- Create new Product Attribute as TextField, with code and default value. --> + <actionGroup ref="CreateProductAttributeWithDateFieldActionGroup" stepKey="createAttribute"> + <argument name="attribute" value="dateProductAttribute"/> + <argument name="date" value="{$generateDefaultDate}"/> + </actionGroup> + + <!-- Go to default attribute set edit page --> + <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/{{AddToDefaultSet.attributeSetId}}/" stepKey="onAttributeSetEdit"/> + <!-- Assert created attribute in unassigned section --> + <see userInput="{{dateProductAttribute.attribute_code}}" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassigned"/> + <!-- Assign attribute to a group --> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> + <argument name="group" value="Product Details"/> + <argument name="attribute" value="{{dateProductAttribute.attribute_code}}"/> + </actionGroup> + <!-- Assert attribute in a group --> + <see userInput="{{dateProductAttribute.attribute_code}}" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/> + <!-- Save attribute set --> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="SaveAttributeSet"/> + + <!-- Open Product Edit Page and set custom attribute value --> + <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForProduct"> + <argument name="product" value="$createProduct$"/> + </actionGroup> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct"> + <argument name="product" value="$createProduct$"/> + </actionGroup> + <fillField selector="{{AdminProductFormSection.newAddedAttributeInput(dateProductAttribute.attribute_code)}}" userInput="{$generateDefaultDate}" stepKey="fillCustomDateValue"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> + + <!-- Logout master admin and Login as new User --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutMasterAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToNewAdmin"> + <argument name="username" value="{{activeAdmin.username}}"/> + <argument name="password" value="{{activeAdmin.password}}"/> + </actionGroup> + + <!-- Open Product Index Page and filter the product --> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex2"/> + <actionGroup ref="FilterProductGridByCustomDateRangeActionGroup" stepKey="filterProductGridByCustomDateRange"> + <argument name="code" value="{{dateProductAttribute.attribute_code}}"/> + <argument name="date" value="{$generateDefaultDateGB}"/> + </actionGroup> + <!-- Check products filtering --> + <see selector="{{AdminProductGridSection.productGridNameProduct($createProduct.name$)}}" userInput="$createProduct.name$" stepKey="seeProductName"/> + </test> +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminDownloadableProductTypeSwitchingToSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminDownloadableProductTypeSwitchingToSimpleProductTest.xml index 6cbf03a02f3b..b9f199c3954e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminDownloadableProductTypeSwitchingToSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminDownloadableProductTypeSwitchingToSimpleProductTest.xml @@ -46,7 +46,7 @@ <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearSimpleProductFilters"/> <!--Assert simple product on storefront--> <comment userInput="Assert simple product on storefront" stepKey="commentAssertSimpleProductOnStorefront"/> - <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="openSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="openSimpleProductPage"/> <waitForPageLoad stepKey="waitForStorefrontSimpleProductPageLoad"/> <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertSimpleProductInStock"/> <dontSeeElement selector="{{StorefrontDownloadableProductSection.downloadableLinkLabel(downloadableLinkWithMaxDownloads.title)}}" stepKey="dontSeeDownloadableLink"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToDownloadableProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToDownloadableProductTest.xml index 2311369db48f..809096626270 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToDownloadableProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToDownloadableProductTest.xml @@ -66,7 +66,7 @@ <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearDownloadableProductFilters"/> <!--Assert downloadable product on storefront--> <comment userInput="Assert downloadable product on storefront" stepKey="commentAssertDownloadableProductOnStorefront"/> - <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="openDownloadableProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="openDownloadableProductPage"/> <waitForPageLoad stepKey="waitForStorefrontDownloadableProductPageLoad"/> <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertDownloadableProductInStock"/> <scrollTo selector="{{StorefrontDownloadableProductSection.downloadableLinkBlock}}" stepKey="scrollToLinksInStorefront"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml index e989aa3758cf..2cdbc26f90f7 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml @@ -66,9 +66,7 @@ <deleteData createDataKey="category" stepKey="deletePreReqCategory"/> <deleteData createDataKey="product" stepKey="deleteFirstProduct"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRequiredFieldsHaveRequiredFieldIndicatorTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRequiredFieldsHaveRequiredFieldIndicatorTest.xml index b2ed7b9628f3..49add85f7680 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRequiredFieldsHaveRequiredFieldIndicatorTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRequiredFieldsHaveRequiredFieldIndicatorTest.xml @@ -58,8 +58,8 @@ </assertEquals> <!-- Verify that the CMS page have the required field name indicator next to Page Title --> - <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnPagePagesGrid"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="amOnPagePagesGrid"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad1"/> <actionGroup ref="AdminClickAddNewPageOnPagesGridActionGroup" stepKey="clickAddNewPage"/> <executeJS function="{{CmsNewPagePageBasicFieldsSection.RequiredFieldIndicator}}" stepKey="pageTitleRequiredFieldIndicator"/> <assertEquals message="pass" stepKey="assertRequiredFieldIndicator5"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminShowDoubleSpacesInProductGrid.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminShowDoubleSpacesInProductGrid.xml new file mode 100644 index 000000000000..c3e939b4155c --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminShowDoubleSpacesInProductGrid.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminShowDoubleSpacesInProductGrid"> + <annotations> + <features value="Catalog"/> + <stories value="Edit products"/> + <title value="Show double spaces in the product grid"/> + <description value="Admin should be able to see double spaces in the Name and Sku fields in the product grid"/> + <testCaseId value="MC-40725"/> + <useCaseId value="MC-40122"/> + <severity value="AVERAGE"/> + <group value="Catalog"/> + </annotations> + + <before> + <createData entity="ApiCategory" stepKey="createCategory"/> + <createData entity="ApiSimpleProductWithDoubleSpaces" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <magentoCLI command="cron:run --group=index" stepKey="cronRun"/> + <magentoCLI command="cron:run --group=index" stepKey="cronRunSecondTime"/> + </before> + + <after> + <actionGroup ref="AdminDeleteAllProductsFromGridActionGroup" stepKey="deleteProduct"/> + <actionGroup ref="ClearFiltersAdminProductGridActionGroup" stepKey="clearGridFilters"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + </after> + + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToProductCatalogPage"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="searchForProduct"> + <argument name="product" value="$createProduct$"/> + </actionGroup> + <actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="assertProductName"> + <argument name="column" value="Name"/> + <argument name="value" value="$createProduct.name$"/> + </actionGroup> + <actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="assertProductSku"> + <argument name="column" value="SKU"/> + <argument name="value" value="$createProduct.sku$"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductImagesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductImagesTest.xml index 8a33f6132aeb..17dac7600ef9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductImagesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductImagesTest.xml @@ -106,7 +106,7 @@ <!-- Save the first product and go to the storefront --> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/> - <amOnPage url="$$firstProduct.name$$.html" stepKey="goToStorefront"/> + <amOnPage url="$$firstProduct.custom_attributes[url_key]$$.html" stepKey="goToStorefront"/> <waitForPageLoad stepKey="waitForStorefront"/> <!-- See all of the images that we uploaded --> @@ -118,7 +118,7 @@ <seeElementInDOM selector="{{StorefrontProductMediaSection.imageFile('png')}}" stepKey="seePng"/> <!-- Go to the category page and see a placeholder image for the second product --> - <amOnPage url="$$category.name$$.html" stepKey="goToCategoryPage"/> + <amOnPage url="$$category.custom_attributes[url_key]$$.html" stepKey="goToCategoryPage"/> <seeElement selector=".products-grid img[src*='placeholder/small_image.jpg']" stepKey="seePlaceholder"/> <!-- Go to the second product edit page --> @@ -142,9 +142,7 @@ <!-- Save the second product --> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct2"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Go to the admin grid and see the uploaded image --> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductIndex3"/> @@ -155,11 +153,11 @@ <seeElement selector="img.admin__control-thumbnail[src*='/large']" stepKey="seeImgInGrid"/> <!-- Go to the category page and see the uploaded image --> - <amOnPage url="$$category.name$$.html" stepKey="goToCategoryPage2"/> + <amOnPage url="$$category.custom_attributes[url_key]$$.html" stepKey="goToCategoryPage2"/> <seeElement selector=".products-grid img[src*='/large']" stepKey="seeUploadedImg"/> <!-- Go to the product page and see the uploaded image --> - <amOnPage url="$$secondProduct.name$$.html" stepKey="goToStorefront2"/> + <amOnPage url="$$secondProduct.custom_attributes[url_key]$$.html" stepKey="goToStorefront2"/> <waitForPageLoad stepKey="waitForStorefront2"/> <seeElementInDOM selector="{{StorefrontProductMediaSection.imageFile('large')}}" stepKey="seeLarge2"/> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductRemoveImagesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductRemoveImagesTest.xml index e1c97b205d4f..9dae1259cc4f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductRemoveImagesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductRemoveImagesTest.xml @@ -11,11 +11,11 @@ <annotations> <features value="Catalog"/> <stories value="Add/remove images and videos for all product types and category"/> - <title value="Admin should be able to remove Product Images assigned as Base, Small and Thumbnail from Simple Product"/> + <title value="Remove Product Images assigned as Base, Small and Thumbnail from Simple Product"/> <description value="Admin should be able to remove Product Images assigned as Base, Small and Thumbnail from Simple Product"/> - <severity value="BLOCKER"/> - <testCaseId value="MC-191"/> - <group value="Catalog"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-25383"/> + <group value="catalog"/> </annotations> <before> @@ -29,6 +29,7 @@ <after> <deleteData createDataKey="category" stepKey="deletePreReqCategory"/> <deleteData createDataKey="product" stepKey="deleteProduct"/> + <actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductGridFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> @@ -36,16 +37,16 @@ <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductIndex"/> <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku"> - <argument name="product" value="$$product$$"/> + <argument name="product" value="$product$"/> </actionGroup> - <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProduct"/> + <actionGroup ref="AdminProductGridSectionClickFirstRowActionGroup" stepKey="openProduct"/> <!-- Set url key --> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> - <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="$$product.name$$" stepKey="fillUrlKey"/> + <comment userInput="BIC workaround" stepKey="openSeoSection"/> + <comment userInput="BIC workaround" stepKey="fillUrlKey"/> <!-- Expand images section --> - <click selector="{{AdminProductImagesSection.productImagesToggle}}" stepKey="expandImages"/> + <actionGroup ref="AdminOpenProductImagesSectionActionGroup" stepKey="expandImages"/> <!-- Upload and set Base image --> <attachFile selector="{{AdminProductImagesSection.imageFileUpload}}" userInput="adobe-base.jpg" stepKey="attach1"/> @@ -87,12 +88,12 @@ <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/> <!-- Go to the product page and see the Base image --> - <amOnPage url="$$product.name$$.html" stepKey="goToProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($product.custom_attributes[url_key]$)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="wait4"/> <seeElement selector="{{StorefrontProductMediaSection.imageFile('/adobe-base')}}" stepKey="seeBase"/> <!-- Go to the category page and see the Small image --> - <amOnPage url="$$category.name$$.html" stepKey="goToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($category.custom_attributes[url_key]$)}}" stepKey="goToCategoryPage"/> <waitForPageLoad stepKey="wait3"/> <seeElement selector="{{StorefrontCategoryProductSection.ProductImageBySrc('/adobe-small')}}" stepKey="seeThumb"/> @@ -100,7 +101,7 @@ <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductIndex2"/> <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid2"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku2"> - <argument name="product" value="$$product$$"/> + <argument name="product" value="$product$"/> </actionGroup> <seeElement selector="{{AdminProductGridSection.productThumbnailBySrc('/adobe-thumb')}}" stepKey="seeBaseInGrid"/> @@ -108,12 +109,13 @@ <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductIndex3"/> <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid3"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku3"> - <argument name="product" value="$$product$$"/> + <argument name="product" value="$product$"/> </actionGroup> - <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProduct3"/> - <click selector="{{AdminProductImagesSection.productImagesToggle}}" stepKey="expandImages2"/> + <actionGroup ref="AdminProductGridSectionClickFirstRowActionGroup" stepKey="openProduct3"/> + <actionGroup ref="AdminOpenProductImagesSectionActionGroup" stepKey="expandImages2"/> <!-- Remove all images --> + <waitForElementVisible selector="{{AdminProductImagesSection.nthRemoveImageBtn('1')}}" stepKey="waitForRemoveImageButtonVisible"/> <click selector="{{AdminProductImagesSection.nthRemoveImageBtn('1')}}" stepKey="removeImage1"/> <click selector="{{AdminProductImagesSection.nthRemoveImageBtn('2')}}" stepKey="removeImage2"/> <click selector="{{AdminProductImagesSection.nthRemoveImageBtn('3')}}" stepKey="removeImage3"/> @@ -123,19 +125,19 @@ <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductIndex4"/> <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid4"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku4"> - <argument name="product" value="$$product$$"/> + <argument name="product" value="$product$"/> </actionGroup> <dontSeeElement selector="{{AdminProductGridSection.productThumbnailBySrc('/adobe-thumb')}}" stepKey="dontSeeBaseInGrid"/> <seeElement selector="{{AdminProductGridSection.productThumbnailBySrc('/placeholder/thumbnail')}}" stepKey="seePlaceholderThumb"/> <!-- Check category page for placeholder --> - <amOnPage url="$$category.name$$.html" stepKey="goToCategoryPage2"/> + <amOnPage url="{{StorefrontCategoryPage.url($category.custom_attributes[url_key]$)}}" stepKey="goToCategoryPage2"/> <waitForPageLoad stepKey="wait7"/> <dontSeeElement selector="{{StorefrontCategoryProductSection.ProductImageBySrc('/adobe-small')}}" stepKey="dontSeeThumb"/> <seeElement selector="{{StorefrontCategoryProductSection.ProductImageBySrc('placeholder/small_image')}}" stepKey="seePlaceholderSmall"/> <!-- Check product page for placeholder --> - <amOnPage url="$$product.name$$.html" stepKey="goToProductPage2"/> + <amOnPage url="{{StorefrontProductPage.url($product.custom_attributes[url_key]$)}}" stepKey="goToProductPage2"/> <waitForPageLoad stepKey="wait8"/> <dontSeeElement selector="{{StorefrontProductMediaSection.imageFile('/adobe-base')}}" stepKey="dontSeeBase"/> <seeElement selector="{{StorefrontProductMediaSection.imageFile('placeholder/image')}}" stepKey="seePlaceholderBase"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml index fc18531eca35..92966e0a0095 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml @@ -70,7 +70,7 @@ <seeInField selector="{{AdminProductContentSection.shortDescriptionTextArea}}" userInput="EDIT ~ This is the short description ~ EDIT" stepKey="seeShortDescriptionAdmin"/> <!--Checking content storefront--> - <amOnPage url="{{SimpleProduct.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{SimpleProduct.urlKey}}.html" stepKey="goToStorefront"/> <waitForPageLoad stepKey="waitForStorefront"/> <see selector="{{StorefrontProductInfoMainSection.productDescription}}" userInput="EDIT ~ This is the long description ~ EDIT" stepKey="seeLongDescriptionStorefront"/> <see selector="{{StorefrontProductInfoMainSection.productShortDescription}}" userInput="EDIT ~ This is the short description ~ EDIT" stepKey="seeShortDescriptionStorefront"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml index 3c90de572988..a3ab78a11e09 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml @@ -78,7 +78,7 @@ <!--See related product in admin--> <scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" stepKey="scrollTo"/> <conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedSee"/> - <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct1.sku$$" stepKey="seeRelatedProduct"/> + <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct1.name$$" stepKey="seeRelatedProduct"/> <!--See more related products in admin--> <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct2"> @@ -98,13 +98,14 @@ </actionGroup> <scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" stepKey="scrollTo2"/> <conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedSee2"/> - <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct6.sku$$" stepKey="seeSixthRelatedProduct"/> + <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct6.name$$" stepKey="seeSixthRelatedProduct"/> <selectOption selector=".admin__collapsible-block-wrapper[data-index='related'] .admin__control-select" userInput="5" stepKey="selectFivePerPage"/> - <dontSee selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct6.sku$$" stepKey="dontSeeSixthRelatedProduct"/> + <waitForPageLoad stepKey="waitForLoadingAfterSelectFivePerPage"/> + <dontSee selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct6.name$$" stepKey="dontSeeSixthRelatedProduct"/> <!--See related product in storefront--> - <amOnPage url="{{SimpleProduct3.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{SimpleProduct3.urlKey}}.html" stepKey="goToStorefront"/> <waitForPageLoad stepKey="waitForStorefront"/> - <seeElement selector="{{StorefrontProductRelatedProductsSection.relatedProductName($$simpleProduct1.sku$$)}}" stepKey="seeRelatedProductInStorefront"/> + <seeElement selector="{{StorefrontProductRelatedProductsSection.relatedProductName($$simpleProduct1.name$$)}}" stepKey="seeRelatedProductInStorefront"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml index a9f8eab9a582..b31ef59e30bb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml @@ -31,9 +31,7 @@ <argument name="websiteCode" value="{{customWebsite.code}}"/> </actionGroup> <actionGroup ref="EnableWebUrlOptionsActionGroup" stepKey="addStoreCodeToUrls"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterEnableWebUrlOptions"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterEnableWebUrlOptions"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> @@ -46,9 +44,7 @@ <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> <actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryAndCheckDefaultUrlKeyOnStoreViewTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryAndCheckDefaultUrlKeyOnStoreViewTest.xml index e562faf52392..e800b72f3385 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryAndCheckDefaultUrlKeyOnStoreViewTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryAndCheckDefaultUrlKeyOnStoreViewTest.xml @@ -62,7 +62,7 @@ <waitForPageLoad stepKey="waitForPageToLoad2"/> <seeInField selector="{{AdminCategorySEOSection.UrlKeyInput}}" stepKey="seeCategoryUrlKey" userInput="{{SimpleRootSubCategory.name_lwr}}2" /> <!--Open Category in Store Front Page--> - <amOnPage url="/{{NewRootCategory.name}}/{{_defaultCategory.name}}.html" stepKey="seeTheCategoryInStoreFront"/> + <amOnPage url="/{{NewRootCategory.urlKey}}/{{_defaultCategory.urlKey}}.html" stepKey="seeTheCategoryInStoreFront"/> <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> <click selector="{{StorefrontFooterSection.switchStoreButton}}" stepKey="clickSwitchStoreButtonOnDefaultStore"/> <click selector="{{StorefrontFooterSection.storeLink(customStore.name)}}" stepKey="selectSecondStoreToSwitchOn"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithProductsTest.xml index f82294ece647..20fb1f6dc4f4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithProductsTest.xml @@ -65,16 +65,11 @@ <!--Verify Category Title--> <see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seePageTitle" /> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Verify Category in store front page--> - <amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.name)}}" stepKey="seeDefaultProductPage"/> + <amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.urlKey)}}" stepKey="seeDefaultProductPage"/> <waitForPageLoad stepKey="waitForPageToBeLoaded"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="seeCategoryOnNavigation"/> <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="selectCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml index f7f87da77b40..a6523c018bdb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml @@ -31,10 +31,7 @@ <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> - <!--Run full reindex and clear caches --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Enable Flat Catalog Category --> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 1"/> @@ -76,13 +73,11 @@ <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/> <see stepKey="seeCategoryIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/> <!--Verify Product In Store Front--> - <amOnPage url="$$createSimpleProduct.name$$.html" stepKey="goToStorefrontPage"/> + <amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="goToStorefrontPage"/> <waitForPageLoad stepKey="waitForPageToBeLoaded"/> <!--Verify product and category is visible in First Store View --> <click stepKey="selectStoreSwitcher" selector="{{StorefrontHeaderSection.storeViewSwitcher}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml index b316e3194c98..2c7e26d4084b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml @@ -33,11 +33,9 @@ <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 1"/> <!--Open Index Management Page and Select Index mode "Update by Schedule" --> <magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="schedule" /> - <!-- Reindex invalidated indices and clear caches --> + <!-- Reindex invalidated indices --> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData stepKey="deleteCategory" createDataKey="createCategory"/> @@ -53,7 +51,7 @@ <magentoCron groups="index" stepKey="reindexInvalidatedIndicesAgain"/> </after> <!--Verify Category is not listed in navigation menu--> - <amOnPage url="/{{CatNotIncludeInMenu.name_lwr}}.html" stepKey="openCategoryPage"/> + <amOnPage url="/{{CatNotIncludeInMenu.urlKey}}.html" stepKey="openCategoryPage"/> <waitForPageLoad time="60" stepKey="waitForPageToBeLoaded"/> <dontSee selector="{{StorefrontHeaderSection.NavigationCategoryByName(CatNotIncludeInMenu.name)}}" stepKey="dontSeeCategoryOnNavigation"/> <!-- Select created category and enable Include In Menu option--> @@ -67,13 +65,11 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value="catalog_category_flat"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/> <see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/> <!--Verify Category In Store Front--> - <amOnPage url="/$$createCategory.name$$.html" stepKey="openCategoryPage1"/> + <amOnPage url="/$$createCategory.custom_attributes[url_key]$$.html" stepKey="openCategoryPage1"/> <waitForPageLoad stepKey="waitForCategoryStoreFrontPageToLoad"/> <!--Verify category is visible in First Store View --> <click stepKey="selectStoreSwitcher" selector="{{StorefrontHeaderSection.storeViewSwitcher}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml index 2124efed3129..13891c58c601 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml @@ -35,9 +35,7 @@ <!--Open Index Management Page and Select Index mode "Update by Schedule" --> <magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="schedule" /> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 0 "/> @@ -68,13 +66,11 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value="catalog_category_flat"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/> <see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="READY"/> <!--Verify Category In Store Front--> - <amOnPage url="{{SimpleSubCategory.name}}.html" stepKey="goToStorefrontPage"/> + <amOnPage url="{{SimpleSubCategory.urlKey}}.html" stepKey="goToStorefrontPage"/> <waitForPageLoad stepKey="waitForPageToBeLoaded"/> <!--Verify category is visible in First Store View --> <click stepKey="selectStoreSwitcher" selector="{{StorefrontHeaderSection.storeViewSwitcher}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml index 70d6932f6fc1..9e5fd6261ee0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -71,20 +71,31 @@ <!--Verify customer see default simple product name on magento storefront page --> <amOnPage url="{{StorefrontProductPage.url($$initialSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="$$initialSimpleProduct.sku$$" stepKey="fillDefaultSimpleProductSkuInSearchTextBox"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="$$initialSimpleProduct.name$$" stepKey="seeDefaultProductName"/> + + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillDefaultSimpleProductSkuInSearchTextBox"> + <argument name="phrase" value="$$initialSimpleProduct.sku$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeDefaultProductName"> + <argument name="productName" value="$$initialSimpleProduct.name$$"/> + </actionGroup> <!--Verify customer see simple product with updated name on magento storefront page under store view section --> <click selector="{{StorefrontHeaderSection.storeViewSwitcher}}" stepKey="clickStoreViewSwitcher"/> <waitForPageLoad stepKey="waitForStoreSwitcherLoad"/> <click selector="{{StorefrontHeaderSection.storeView(customStoreFR.name)}}" stepKey="clickStoreViewOption"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="$$initialSimpleProduct.sku$$" stepKey="fillDefaultSimpleProductSkuInSearch"/> - <waitForPageLoad stepKey="waitForSearchTextBoxLoad"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextButton"/> - <waitForPageLoad stepKey="waitForTextSearchLoad"/> - <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductDataOverriding.name}}" stepKey="seeUpdatedSimpleProductName"/> + + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillDefaultSimpleProductSkuInSearch"> + <argument name="phrase" value="$$initialSimpleProduct.sku$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBoxLoad"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForTextSearchLoad"/> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeUpdatedSimpleProductName"> + <argument name="productName" value="{{simpleProductDataOverriding.name}}"/> + </actionGroup> + </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml index f9c90b119061..26380bd2861d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -69,20 +69,24 @@ <!-- Verify customer see simple product with updated price on magento storefront page --> <amOnPage url="{{StorefrontProductPage.url($$initialSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="$$initialSimpleProduct.sku$$" stepKey="fillDefaultSimpleProductSkuInSearchTextBox"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillDefaultSimpleProductSkuInSearchTextBox"> + <argument name="phrase" value="$$initialSimpleProduct.sku$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> <see selector="{{StorefrontQuickSearchResultsSection.regularPrice}}" userInput="{{simpleProductDataOverriding.price}}" stepKey="seeUpdatedProductPriceOnStorefrontPage"/> <!-- Verify customer see simple product with updated price on magento storefront page under store view section --> <click selector="{{StorefrontHeaderSection.storeViewSwitcher}}" stepKey="clickStoreViewSwitcher"/> <waitForPageLoad stepKey="waitForStoreSwitcherLoad"/> <click selector="{{StorefrontHeaderSection.storeView(customStoreFR.name)}}" stepKey="clickStoreViewOption"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="$$initialSimpleProduct.sku$$" stepKey="fillDefaultSimpleProductSkuInSearch"/> - <waitForPageLoad stepKey="waitForSearchTextBoxLoad"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextButton"/> - <waitForPageLoad stepKey="waitForTextSearchLoad"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillDefaultSimpleProductSkuInSearch"> + <argument name="phrase" value="$$initialSimpleProduct.sku$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBoxLoad"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForTextSearchLoad"/> <see selector="{{StorefrontQuickSearchResultsSection.regularPrice}}" userInput="{{simpleProductDataOverriding.price}}" stepKey="seeUpdatedProductPriceOnStorefrontPageUnderStoreViewSection"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml index 420a0604f038..34aea06bb69c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml @@ -27,9 +27,7 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value="full_page"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> @@ -68,10 +66,10 @@ <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductTierPrice300InStock.weight}}" stepKey="fillSimpleProductWeight"/> <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{simpleProductTierPrice300InStock.weightSelect}}" stepKey="selectProductWeight"/> <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory" /> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory"/> <waitForPageLoad stepKey="waitForCategory1"/> <click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory" /> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/> <waitForPageLoad stepKey="waitForCategory2"/> <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> @@ -112,42 +110,52 @@ <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="seeSelectedCategories"> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> - <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductTierPrice300InStock.urlKey}}" stepKey="seeUrlKey"/> <!--Verify customer see updated simple product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductTierPrice300InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/> <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductTierPrice300InStock.urlKey)}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductTierPrice300InStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductTierPrice300InStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> + <argument name="productUrlKey" value="{{simpleProductTierPrice300InStock.urlKey}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/> + + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> + <argument name="productName" value="{{simpleProductTierPrice300InStock.name}}"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> + <argument name="productPrice" value="{{simpleProductTierPrice300InStock.price}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSku"> <argument name="productSku" value="{{simpleProductTierPrice300InStock.sku}}"/> </actionGroup> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> - <assertEquals stepKey="assertStockAvailableOnProductPage"> - <expectedResult type="string">{{simpleProductTierPrice300InStock.storefrontStatus}}</expectedResult> - <actualResult type="variable">productStockAvailableStatus</actualResult> - </assertEquals> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> - <assertEquals stepKey="assertOldPriceTextOnProductPage"> - <expectedResult type="string">${{simpleProductTierPrice300InStock.price}}</expectedResult> - <actualResult type="variable">productPriceAmount</actualResult> - </assertEquals> + + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> + <argument name="productStockStatus" value="{{simpleProductTierPrice300InStock.storefrontStatus}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/> <!--Verify customer see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductTierPrice300InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductTierPrice300InStock.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductTierPrice300InStock.name}}" stepKey="seeProductName"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> + <argument name="phrase" value="{{simpleProductTierPrice300InStock.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProductName"> + <argument name="productName" value="{{simpleProductTierPrice300InStock.name}}"/> + </actionGroup> + </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml index 9cae9cc3f1f4..ab0fcea919af 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml @@ -81,10 +81,14 @@ <!--Verify customer don't see updated simple product link on magento storefront page --> <amOnPage url="{{StorefrontProductPage.url(simpleProductDisabled.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductDisabled.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductDisabled.name}}" stepKey="dontSeeProductNameOnStorefrontPage"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> + <argument name="phrase" value="{{simpleProductDisabled.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProductNameOnStorefrontPage"> + <argument name="productName" value="{{simpleProductDisabled.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml index d2e145adb6a8..39ff6d99b5b7 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> <skip> <issueId value="DEPRECATED">Use AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest instead</issueId> - </skip> + </skip> </annotations> <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> @@ -108,7 +108,7 @@ <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductEnabledFlat.urlKey}}" stepKey="seeUrlKey"/> <!--Verify customer see updated simple product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml index aad946dced83..3ee9d0a9262c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml @@ -36,72 +36,97 @@ </after> <!-- Search default simple product in the grid page --> - <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="openProductCatalogPage"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> - <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> - <argument name="product" value="$$initialSimpleProduct$$"/> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> + <argument name="productSku" value="$initialSimpleProduct.sku$"/> </actionGroup> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(in stock) --> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductNotVisibleIndividually.name}}" stepKey="fillSimpleProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductNotVisibleIndividually.sku}}" stepKey="fillSimpleProductSku"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductNotVisibleIndividually.price}}" stepKey="fillSimpleProductPrice"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductNotVisibleIndividually.quantity}}" stepKey="fillSimpleProductQuantity"/> - <selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductNotVisibleIndividually.status}}" stepKey="selectStockStatusInStock"/> - <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductNotVisibleIndividually.weight}}" stepKey="fillSimpleProductWeight"/> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory" /> - <waitForPageLoad stepKey="waitForCategory1"/> - <click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/> - <waitForPageLoad stepKey="waitForCategory2"/> - <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> + <actionGroup ref="FillMainProductFormByStringActionGroup" stepKey="fillSimpleProductName"> + <argument name="productName" value="{{simpleProductNotVisibleIndividually.name}}"/> + <argument name="productSku" value="{{simpleProductNotVisibleIndividually.sku}}"/> + <argument name="productPrice" value="{{simpleProductNotVisibleIndividually.price}}"/> + <argument name="productQuantity" value="{{simpleProductNotVisibleIndividually.quantity}}"/> + <argument name="productStatus" value="{{simpleProductNotVisibleIndividually.status}}"/> + <argument name="productWeight" value="{{simpleProductNotVisibleIndividually.weight}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSimpleProductSku"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSimpleProductPrice"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSimpleProductQuantity"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectStockStatusInStock"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSimpleProductWeight"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDown"/> + <actionGroup ref="SetCategoryByNameActionGroup" stepKey="fillSearchForInitialCategory"> + <argument name="categoryName" value="$$initialCategoryEntity.name$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategory1"/> + <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="unselectInitialCategory"/> + <actionGroup ref="SetCategoryByNameActionGroup" stepKey="fillSearchCategory"> + <argument name="categoryName" value="$$categoryEntity.name$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategory2"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickOnCategory"/> <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductNotVisibleIndividually.visibility}}" stepKey="selectVisibility"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/> - <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductNotVisibleIndividually.urlKey}}" stepKey="fillSimpleProductUrlKey"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickAdminProductSEOSection"/> + <actionGroup ref="SetProductUrlKeyByStringActionGroup" stepKey="fillSimpleProductUrlKey"> + <argument name="urlKey" value="{{simpleProductNotVisibleIndividually.urlKey}}"/> + </actionGroup> <scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/> <actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/> <!-- Verify customer see success message --> - <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeAssertSimpleProductSaveSuccessMessage"> + <argument name="message" value="You saved the product."/> + </actionGroup> <!-- Search updated simple product(from above step) in the grid page --> <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPageToSearchUpdatedSimpleProduct"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clickClearAll"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickFiltersButton"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{simpleProductNotVisibleIndividually.name}}" stepKey="fillSimpleProductNameInNameFilter"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{simpleProductNotVisibleIndividually.sku}}" stepKey="fillProductSku"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickClearAll"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickFiltersButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSimpleProductNameInNameFilter"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductSku"/> + <actionGroup ref="FilterProductGridBySkuAndNameActionGroup" stepKey="clickApplyFiltersButton"> + <argument name="product" value="simpleProductNotVisibleIndividually"/> + </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/> <waitForPageLoad stepKey="waitUntilSimpleProductPageIsOpened"/> - <!-- Verify customer see updated simple product in the product form page --> - <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductNotVisibleIndividually.name}}" stepKey="seeSimpleProductName"/> - <seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductNotVisibleIndividually.sku}}" stepKey="seeSimpleProductSku"/> - <seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductNotVisibleIndividually.price}}" stepKey="seeSimpleProductPrice"/> - <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductNotVisibleIndividually.quantity}}" stepKey="seeSimpleProductQuantity"/> - <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductNotVisibleIndividually.status}}" stepKey="seeSimpleProductStockStatus"/> - <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductNotVisibleIndividually.weightNoDecimals}}" stepKey="seeSimpleProductWeight"/> - - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> - <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="seeSelectedCategories"> + <!--Verify customer see updated simple product in the product form page--> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="seeSimpleProductName"> + <argument name="productName" value="{{simpleProductNotVisibleIndividually.name}}"/> + <argument name="productSku" value="{{simpleProductNotVisibleIndividually.sku}}"/> + <argument name="productPrice" value="{{simpleProductNotVisibleIndividually.price}}"/> + <argument name="productQuantity" value="{{simpleProductNotVisibleIndividually.quantity}}"/> + <argument name="productWeight" value="{{simpleProductNotVisibleIndividually.weightNoDecimals}}"/> + <argument name="productVisibility" value="{{simpleProductNotVisibleIndividually.visibility}}"/> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> - - <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductNotVisibleIndividually.visibility}}" stepKey="seeSimpleProductVisibility"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductSku"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductPrice"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductQuantity"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductStockStatus"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductWeight"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSelectedCategories"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSectionHeader"/> <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductNotVisibleIndividually.urlKey}}" stepKey="seeSimpleProductUrlKey"/> <!--Verify customer don't see updated simple product link on magento storefront page --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductNotVisibleIndividually.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> - <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductNotVisibleIndividually.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductNotVisibleIndividually.name}}" stepKey="dontSeeSimpleProductNameOnMagentoStorefrontPage"/> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToMagentoStorefrontPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStoreFrontProductPageLoad"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> + <argument name="phrase" value="{{simpleProductNotVisibleIndividually.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeSimpleProductNameOnMagentoStorefrontPage"> + <argument name="productName" value="{{simpleProductNotVisibleIndividually.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml index 9cb326ca6d80..6f8356f86986 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml @@ -51,10 +51,10 @@ <selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductRegularPrice245InStock.status}}" stepKey="selectStockStatusInStock"/> <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice245InStock.weight}}" stepKey="fillSimpleProductWeight"/> <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory" /> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory"/> <waitForPageLoad stepKey="waitForCategory1"/> <click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory" /> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/> <waitForPageLoad stepKey="waitForCategory2"/> <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> @@ -89,7 +89,6 @@ <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories"> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> - <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice245InStock.visibility}}" stepKey="seeVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> @@ -98,36 +97,47 @@ <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Verify customer see updated simple product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice245InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/> <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice245InStock.urlKey)}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPrice245InStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPrice245InStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> + <argument name="productUrlKey" value="{{simpleProductRegularPrice245InStock.urlKey}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/> + + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> + <argument name="productName" value="{{simpleProductRegularPrice245InStock.name}}"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> + <argument name="productPrice" value="{{simpleProductRegularPrice245InStock.price}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSkuOnStoreFrontPage"> <argument name="productSku" value="{{simpleProductRegularPrice245InStock.sku}}"/> </actionGroup> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> - <assertEquals stepKey="assertStockAvailableOnProductPage"> - <expectedResult type="string">{{simpleProductRegularPrice245InStock.storefrontStatus}}</expectedResult> - <actualResult type="variable">productStockAvailableStatus</actualResult> - </assertEquals> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> - <assertEquals stepKey="assertOldPriceTextOnProductPage"> - <expectedResult type="string">${{simpleProductRegularPrice245InStock.price}}</expectedResult> - <actualResult type="variable">productPriceAmount</actualResult> - </assertEquals> + + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> + <argument name="productStockStatus" value="{{simpleProductRegularPrice245InStock.storefrontStatus}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/> <!--Verify customer see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice245InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductRegularPrice245InStock.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductRegularPrice245InStock.name}}" stepKey="seeSimpleProductNameOnStorefrontPage"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> + <argument name="phrase" value="{{simpleProductRegularPrice245InStock.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeSimpleProductNameOnStorefrontPage"> + <argument name="productName" value="{{simpleProductRegularPrice245InStock.name}}"/> + </actionGroup> + </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml index 38c0a7449210..4de9552b863b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml @@ -36,98 +36,145 @@ </after> <!-- Search default simple product in the grid --> - <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> - <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> - <argument name="product" value="$$initialSimpleProduct$$"/> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openProductCatalogPage"> + <argument name="productSku" value="$initialSimpleProduct.sku$"/> </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="filterProductGrid"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(in stock) --> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="fillSimpleProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductRegularPrice32501InStock.sku}}" stepKey="fillSimpleProductSku"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductRegularPrice32501InStock.price}}" stepKey="fillSimpleProductPrice"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPrice32501InStock.quantity}}" stepKey="fillSimpleProductQuantity"/> - <selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductRegularPrice32501InStock.status}}" stepKey="selectStockStatusInStock"/> - <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice32501InStock.weight}}" stepKey="fillSimpleProductWeight"/> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory"/> - <waitForPageLoad stepKey="waitForCategory1"/> - <click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/> - <waitForPageLoad stepKey="waitForCategory2"/> - <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> + <actionGroup ref="FillMainProductFormByStringActionGroup" stepKey="fillSimpleProductName"> + <argument name="productName" value="{{simpleProductRegularPrice32501InStock.name}}"/> + <argument name="productSku" value="{{simpleProductRegularPrice32501InStock.sku}}"/> + <argument name="productPrice" value="{{simpleProductRegularPrice32501InStock.price}}"/> + <argument name="productQuantity" value="{{simpleProductRegularPrice32501InStock.quantity}}"/> + <argument name="productStatus" value="{{simpleProductRegularPrice32501InStock.status}}"/> + <argument name="productWeight" value="{{simpleProductRegularPrice32501InStock.weight}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSimpleProductSku"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSimpleProductPrice"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSimpleProductQuantity"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="selectStockStatusInStock"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSimpleProductWeight"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="clickCategoriesDropDown"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSearchForInitialCategory"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="waitForCategory1"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="unselectInitialCategory"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSearchCategory"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="waitForCategory2"/> + <actionGroup ref="SetCategoryByNameActionGroup" stepKey="clickOnCategory"> + <argument name="categoryName" value="$$categoryEntity.name$$"/> + </actionGroup> <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice32501InStock.visibility}}" stepKey="selectVisibility"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/> - <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice32501InStock.urlKey}}" stepKey="fillUrlKey"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickAdminProductSEOSection"/> + <actionGroup ref="SetProductUrlKeyByStringActionGroup" stepKey="fillUrlKey"> + <argument name="urlKey" value="{{simpleProductRegularPrice32501InStock.urlKey}}"/> + </actionGroup> <scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/> <actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/> <!-- Verify customer see success message --> - <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeAssertSimpleProductSaveSuccessMessage"> + <argument name="message" value="You saved the product."/> + </actionGroup> <!-- Search updated simple product(from above step) in the grid page --> <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPageToSearchUpdatedSimpleProduct"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clickClearAll"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickFiltersButton"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="fillSimpleProductNameInNameFilter"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{simpleProductRegularPrice32501InStock.sku}}" stepKey="fillProductSku"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/> - <waitForPageLoad stepKey="waitUntilSimpleProductPageIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickClearAll"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickFiltersButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSimpleProductNameInNameFilter"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductSku"/> + <actionGroup ref="FilterProductGridBySkuAndNameActionGroup" stepKey="clickApplyFiltersButton"> + <argument name="product" value="simpleProductRegularPrice32501InStock"/> + </actionGroup> + <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilSimpleProductPageIsOpened"/> <!-- Verify customer see updated simple product in the product form page --> - <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="seeSimpleProductName"/> - <seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductRegularPrice32501InStock.sku}}" stepKey="seeSimpleProductSku"/> - <seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductRegularPrice32501InStock.price}}" stepKey="seeSimpleProductPrice"/> - <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPrice32501InStock.quantity}}" stepKey="seeSimpleProductQuantity"/> - <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductRegularPrice32501InStock.status}}" stepKey="seeSimpleProductStockStatus"/> - <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice32501InStock.weight}}" stepKey="seeSimpleProductWeight"/> - - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> - <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories"> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="seeSimpleProductName"> + <argument name="productName" value="{{simpleProductRegularPrice32501InStock.name}}"/> + <argument name="productSku" value="{{simpleProductRegularPrice32501InStock.sku}}"/> + <argument name="productPrice" value="{{simpleProductRegularPrice32501InStock.price}}"/> + <argument name="productQuantity" value="{{simpleProductRegularPrice32501InStock.quantity}}"/> + <argument name="productWeight" value="{{simpleProductRegularPrice32501InStock.weight}}"/> + <argument name="productVisibility" value="{{simpleProductRegularPrice32501InStock.visibility}}"/> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> - - <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice32501InStock.visibility}}" stepKey="seeVisibility"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductSku"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductPrice"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductQuantity"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductStockStatus"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductWeight"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectedCategories"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice32501InStock.urlKey}}" stepKey="seeUrlKey"/> - <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Verify customer see updated simple product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> - <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/> + <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage"> + <argument name="categoryName" value="$$categoryEntity.name$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategoryPageLoad"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductNameOnCategoryPage"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertFirstBundleProduct"> + <argument name="productName" value="{{simpleProductRegularPrice32501InStock.name}}"/> + </actionGroup> <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32501InStock.urlKey)}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPrice32501InStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> + <argument name="productUrlKey" value="{{simpleProductRegularPrice32501InStock.urlKey}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/> + + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> + <argument name="productName" value="{{simpleProductRegularPrice32501InStock.name}}"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> + <argument name="productPrice" value="{{simpleProductRegularPrice32501InStock.price}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSku"> <argument name="productSku" value="{{simpleProductRegularPrice32501InStock.sku}}"/> </actionGroup> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> - <assertEquals stepKey="assertStockAvailableOnProductPage"> - <expectedResult type="string">{{simpleProductRegularPrice32501InStock.storefrontStatus}}</expectedResult> - <actualResult type="variable">productStockAvailableStatus</actualResult> - </assertEquals> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> - <assertEquals stepKey="assertOldPriceTextOnProductPage"> - <expectedResult type="string">${{simpleProductRegularPrice32501InStock.price}}</expectedResult> - <actualResult type="variable">productPriceAmount</actualResult> - </assertEquals> + + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> + <argument name="productStockStatus" value="{{simpleProductRegularPrice32501InStock.storefrontStatus}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/> <!--Verify customer don't see updated simple product link on magento storefront page and is searchable by sku --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32501InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> - <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductRegularPrice32501InStock.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="dontSeeProductName"/> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToMagentoStorefrontPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStoreFrontProductPageLoad"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> + <argument name="phrase" value="{{simpleProductRegularPrice32501InStock.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProductName"> + <argument name="productName" value="{{simpleProductRegularPrice32501InStock.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml index 4ce3af599123..312baff6b8bc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml @@ -51,10 +51,10 @@ <selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductRegularPrice325InStock.status}}" stepKey="selectStockStatusInStock"/> <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice325InStock.weight}}" stepKey="fillSimpleProductWeight"/> <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory" /> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory"/> <waitForPageLoad stepKey="waitForCategory1"/> <click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory" /> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/> <waitForPageLoad stepKey="waitForCategory2"/> <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> @@ -89,43 +89,52 @@ <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories"> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> - <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice325InStock.visibility}}" stepKey="seeVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice325InStock.urlKey}}" stepKey="seeUrlKey"/> <!--Verify customer don't see updated simple product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice325InStock.name}}" stepKey="dontSeeSimpleProductNameOnCategoryPage"/> <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice325InStock.urlKey)}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPrice325InStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPrice325InStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> + <argument name="productUrlKey" value="{{simpleProductRegularPrice325InStock.urlKey}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/> + + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> + <argument name="productName" value="{{simpleProductRegularPrice325InStock.name}}"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> + <argument name="productPrice" value="{{simpleProductRegularPrice325InStock.price}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSku"> <argument name="productSku" value="{{simpleProductRegularPrice325InStock.sku}}"/> </actionGroup> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> - <assertEquals stepKey="assertStockAvailableOnProductPage"> - <expectedResult type="string">{{simpleProductRegularPrice325InStock.storefrontStatus}}</expectedResult> - <actualResult type="variable">productStockAvailableStatus</actualResult> - </assertEquals> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> - <assertEquals stepKey="assertOldPriceTextOnProductPage"> - <expectedResult type="string">${{simpleProductRegularPrice325InStock.price}}</expectedResult> - <actualResult type="variable">productPriceAmount</actualResult> - </assertEquals> + + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> + <argument name="productStockStatus" value="{{simpleProductRegularPrice325InStock.storefrontStatus}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/> <!--Verify customer see updated simple product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice325InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductRegularPrice325InStock.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductRegularPrice325InStock.name}}" stepKey="seeProductName"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> + <argument name="phrase" value="{{simpleProductRegularPrice325InStock.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProductName"> + <argument name="productName" value="{{simpleProductRegularPrice325InStock.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml index 2316e36eb0b9..6066a02110f1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml @@ -121,23 +121,29 @@ <seeInField selector="{{AdminProductCustomizableOptionsSection.fillOptionValueSku(simpleProductCustomizableOption.title,'0')}}" userInput="{{simpleProductCustomizableOption.option_0_sku}}" stepKey="seeOptionSku"/> <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPriceCustomOptions.urlKey)}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPriceCustomOptions.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPriceCustomOptions.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> + <argument name="productUrlKey" value="{{simpleProductRegularPriceCustomOptions.urlKey}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/> + + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> + <argument name="productName" value="{{simpleProductRegularPriceCustomOptions.name}}"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> + <argument name="productPrice" value="{{simpleProductRegularPriceCustomOptions.price}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSkuOnStoreFrontPage"> <argument name="productSku" value="{{simpleProductRegularPriceCustomOptions.sku}}"/> </actionGroup> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> - <assertEquals stepKey="assertStockAvailableOnProductPage"> - <expectedResult type="string">{{simpleProductRegularPriceCustomOptions.storefrontStatus}}</expectedResult> - <actualResult type="variable">productStockAvailableStatus</actualResult> - </assertEquals> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> - <assertEquals stepKey="assertOldPriceTextOnProductPage"> - <expectedResult type="string">${{simpleProductRegularPriceCustomOptions.price}}</expectedResult> - <actualResult type="variable">productPriceAmount</actualResult> - </assertEquals> + + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage"> + <argument name="productStockStatus" value="{{simpleProductRegularPriceCustomOptions.storefrontStatus}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/> <!--Verify customer see customizable options are Required --> <seeElement selector="{{StorefrontProductInfoMainSection.requiredCustomSelect(simpleProductCustomizableOption.title)}}" stepKey="verifyFirstCustomOptionIsRequired"/> @@ -157,7 +163,7 @@ <seeElement selector="{{StorefrontProductPageSection.successMsg}}" stepKey="seeYouAddedSimpleprod4ToYourShoppingCartSuccessSaveMessage"/> <seeElement selector="{{StorefrontMinicartSection.quantity(1)}}" stepKey="seeAddedProductQuantityInCart"/> <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/> - <see selector="{{StorefrontMinicartSection.miniCartItemsText}}" userInput="{{simpleProductRegularPriceCustomOptions.name}}" stepKey="seeProductNameInMiniCart"/> + <see selector="{{StorefrontMinicartSection.miniCartItemsText}}" userInput="{{simpleProductRegularPriceCustomOptions.name}}" stepKey="seeProductNameInMiniCart"/> <see selector="{{StorefrontMinicartSection.miniCartItemsText}}" userInput="{{simpleProductRegularPriceCustomOptions.storefront_new_cartprice}}" stepKey="seeProductPriceInMiniCart"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml index dcec3e3f8bd5..04fc2b70a1cb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml @@ -36,95 +36,163 @@ </after> <!-- Search default simple product in the grid --> - <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> - <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> - <argument name="product" value="$$initialSimpleProduct$$"/> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openProductCatalogPage"> + <argument name="productSku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="filterProductGrid"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(out of stock) --> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" stepKey="fillSimpleProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductRegularPrice32503OutOfStock.sku}}" stepKey="fillSimpleProductSku"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductRegularPrice32503OutOfStock.price}}" stepKey="fillSimpleProductPrice"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPrice32503OutOfStock.quantity}}" stepKey="fillSimpleProductQuantity"/> - <selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductRegularPrice32503OutOfStock.status}}" stepKey="selectStockStatusInStock"/> - <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice32503OutOfStock.weight}}" stepKey="fillSimpleProductWeight"/> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory"/> - <waitForPageLoad stepKey="waitForCategory1"/> - <click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/> - <waitForPageLoad stepKey="waitForCategory2"/> - <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> + <actionGroup ref="FillMainProductFormByStringActionGroup" stepKey="fillSimpleProductName"> + <argument name="productName" value="{{simpleProductRegularPrice32503OutOfStock.name}}"/> + <argument name="productSku" value="{{simpleProductRegularPrice32503OutOfStock.sku}}"/> + <argument name="productPrice" value="{{simpleProductRegularPrice32503OutOfStock.price}}"/> + <argument name="productQuantity" value="{{simpleProductRegularPrice32503OutOfStock.quantity}}"/> + <argument name="productStatus" value="{{simpleProductRegularPrice32503OutOfStock.status}}"/> + <argument name="productWeight" value="{{simpleProductRegularPrice32503OutOfStock.weight}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSimpleProductSku"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSimpleProductPrice"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSimpleProductQuantity"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="selectStockStatusInStock"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSimpleProductWeight"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="clickCategoriesDropDown"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSearchForInitialCategory"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="waitForCategory1"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="unselectInitialCategory"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSearchCategory"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="waitForCategory2"/> + <actionGroup ref="SetCategoryByNameActionGroup" stepKey="clickOnCategory"> + <argument name="categoryName" value="$$categoryEntity.name$$"/> + </actionGroup> <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/> - <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice32503OutOfStock.urlKey}}" stepKey="fillUrlKey"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="clickAdminProductSEOSection"/> + <actionGroup ref="SetProductUrlKeyByStringActionGroup" stepKey="fillUrlKey"> + <argument name="urlKey" value="{{simpleProductRegularPrice32503OutOfStock.urlKey}}"/> + </actionGroup> <scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/> - <actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/> <!-- Verify customer see success message --> - <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeAssertSimpleProductSaveSuccessMessage"> + <argument name="message" value="You saved the product."/> + </actionGroup> <!-- Search updated simple product(from above step) in the grid page --> <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPageToSearchUpdatedSimpleProduct"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clickClearAll"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickFiltersButton"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" stepKey="fillSimpleProductNameInNameFilter"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{simpleProductRegularPrice32503OutOfStock.sku}}" stepKey="fillProductSku"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="clickClearAll"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="clickFiltersButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSimpleProductNameInNameFilter"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillProductSku"/> + <actionGroup ref="FilterProductGridBySkuAndNameActionGroup" stepKey="clickApplyFiltersButton"> + <argument name="product" value="simpleProductRegularPrice32503OutOfStock"/> + </actionGroup> + <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" + stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/> <waitForPageLoad stepKey="waitUntilSimpleProductPageIsOpened"/> <!-- Verify customer see updated simple product in the product form page --> - <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" stepKey="seeSimpleProductName"/> - <seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductRegularPrice32503OutOfStock.sku}}" stepKey="seeSimpleProductSku"/> - <seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductRegularPrice32503OutOfStock.price}}" stepKey="seeSimpleProductPrice"/> - <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPrice32503OutOfStock.quantity}}" stepKey="seeSimpleProductQuantity"/> - <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductRegularPrice32503OutOfStock.status}}" stepKey="seeSimpleProductStockStatus"/> - <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice32503OutOfStock.weight}}" stepKey="seeSimpleProductWeight"/> - - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> - <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories"> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="seeSimpleProductName"> + <argument name="productName" value="{{simpleProductRegularPrice32503OutOfStock.name}}"/> + <argument name="productSku" value="{{simpleProductRegularPrice32503OutOfStock.sku}}"/> + <argument name="productPrice" value="{{simpleProductRegularPrice32503OutOfStock.price}}"/> + <argument name="productQuantity" value="{{simpleProductRegularPrice32503OutOfStock.quantity}}"/> + <argument name="productStockStatus" value="{{simpleProductRegularPrice32503OutOfStock.status}}"/> + <argument name="productWeight" value="{{simpleProductRegularPrice32503OutOfStock.weight}}"/> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> - + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="seeSimpleProductSku"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="seeSimpleProductPrice"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="seeSimpleProductQuantity"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="seeSimpleProductStockStatus"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="seeSimpleProductWeight"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="clickCategoriesDropDownToVerify"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="selectedCategories"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> - <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice32503OutOfStock.urlKey}}" stepKey="seeUrlKey"/> + <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice32503OutOfStock.urlKey}}" + stepKey="seeUrlKey"/> <!--Verify customer don't see updated simple product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> - <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" stepKey="dontSeeSimpleProductNameOnCategoryPage"/> + <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage"> + <argument name="categoryName" value="$$categoryEntity.name$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="waitForCategoryPageLoad"/> + <dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" + stepKey="dontSeeSimpleProductNameOnCategoryPage"/> <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32503OutOfStock.urlKey)}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPrice32503OutOfStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> - <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSkuOnStoreFrontPage"> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> + <argument name="productUrlKey" value="{{simpleProductRegularPrice32503OutOfStock.urlKey}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" + stepKey="waitForStorefrontProductPageLoad"/> + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" + stepKey="seeSimpleProductNameOnStoreFrontPage"> + <argument name="productName" value="{{simpleProductRegularPrice32503OutOfStock.name}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" + stepKey="seeSimpleProductPriceOnStoreFrontPage"> + <argument name="productPrice" value="{{simpleProductRegularPrice32503OutOfStock.price}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" + stepKey="seeSimpleProductSkuOnStoreFrontPage"> <argument name="productSku" value="{{simpleProductRegularPrice32503OutOfStock.sku}}"/> </actionGroup> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> - <assertEquals stepKey="assertStockAvailableOnProductPage"> - <expectedResult type="string">{{simpleProductRegularPrice32503OutOfStock.storefrontStatus}}</expectedResult> - <actualResult type="variable">productStockAvailableStatus</actualResult> - </assertEquals> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> - <assertEquals stepKey="assertOldPriceTextOnProductPage"> - <expectedResult type="string">${{simpleProductRegularPrice32503OutOfStock.price}}</expectedResult> - <actualResult type="variable">productPriceAmount</actualResult> - </assertEquals> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" + stepKey="productStockAvailableStatus"/> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" + stepKey="assertStockAvailableOnProductPage"> + <argument name="productStockStatus" value="{{simpleProductRegularPrice32503OutOfStock.storefrontStatus}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" + stepKey="productPriceAmount"/> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" + stepKey="assertOldPriceTextOnProductPage"/> <!--Verify customer don't see updated simple product link on magento storefront page and is searchable by sku --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32503OutOfStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> - <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductRegularPrice32503OutOfStock.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" stepKey="dontSeeProductName"/> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToMagentoStorefrontPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="waitForStoreFrontProductPageLoad"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> + <argument name="phrase" value="{{simpleProductRegularPrice32503OutOfStock.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="waitForSearch"/> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProductName"> + <argument name="productName" value="{{simpleProductRegularPrice32503OutOfStock.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml index f4375ad499df..2a03187af26b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml @@ -116,14 +116,18 @@ <!-- Verify customer don't see updated virtual product link on storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductRegularPrice.urlKey)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualProductRegularPrice.sku}}" stepKey="fillVirtualProductSkuOnStorefrontPage"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualProductRegularPrice.name}}" stepKey="dontSeeVirtualProductName"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductSkuOnStorefrontPage"> + <argument name="phrase" value="{{updateVirtualProductRegularPrice.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> + <argument name="productName" value="{{updateVirtualProductRegularPrice.name}}"/> + </actionGroup> <!-- Verify customer see updated virtual product in category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{updateVirtualProductRegularPrice.name}}" stepKey="seeVirtualProductLinkOnCategoryPage"/> <grabTextFrom selector="{{StorefrontCategoryMainSection.asLowAs}}" stepKey="tierPriceTextOnCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockWithCustomOptionsVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockWithCustomOptionsVisibleInSearchOnlyTest.xml index 0cf0d22094cb..4e0b5a635594 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockWithCustomOptionsVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockWithCustomOptionsVisibleInSearchOnlyTest.xml @@ -207,7 +207,7 @@ <seeInField selector="{{AdminProductCustomizableOptionsSection.fillOptionValueSku(virtualProductCustomizableOption4.title,'1')}}" userInput="{{virtualProductCustomizableOption4.option_1_sku}}" stepKey="seeOptionSkuForFourthDataSetSecondRow"/> <!--Verify customer don't see updated virtual product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{updateVirtualProductRegularPriceInStock.name}}" stepKey="dontSeeVirtualProductNameOnCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml index 343326547254..3cef25a62775 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml @@ -96,7 +96,7 @@ <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.urlKey}}" stepKey="seeUrlKey"/> <!--Verify customer don't see updated virtual product link(from above step) on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.name}}" stepKey="dontseeVirtualProductNameOnCategoryPage"/> @@ -122,10 +122,14 @@ <!--Verify customer don't see updated virtual product link(from above step) on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductRegularPrice5OutOfStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.sku}}" stepKey="fillVirtualProductName"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.name}}" stepKey="dontSeeVirtualProductName"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> + <argument name="phrase" value="{{updateVirtualProductRegularPrice5OutOfStock.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> + <argument name="productName" value="{{updateVirtualProductRegularPrice5OutOfStock.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml index 0d6a1c87c62f..1e87a10fe753 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml @@ -100,14 +100,18 @@ <!--Verify customer don't see updated virtual product link on magento storefront page --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductRegularPrice99OutOfStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualProductRegularPrice99OutOfStock.sku}}" stepKey="fillVirtualProductName"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualProductRegularPrice99OutOfStock.name}}" stepKey="dontSeeVirtualProductLinkOnStorefrontPage"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> + <argument name="phrase" value="{{updateVirtualProductRegularPrice99OutOfStock.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductLinkOnStorefrontPage"> + <argument name="productName" value="{{updateVirtualProductRegularPrice99OutOfStock.name}}"/> + </actionGroup> <!--Verify customer don't see updated virtual product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$initialCategoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$initialCategoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{updateVirtualProductRegularPrice99OutOfStock.name}}" stepKey="dontSeeVirtualProductLinkOnCategoryPage"/> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml index f423cd6c7780..41c187975a92 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml @@ -105,18 +105,22 @@ <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{updateVirtualProductSpecialPrice.urlKey}}" stepKey="seeUrlKey"/> <!--Verify customer see updated virtual product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{updateVirtualProductSpecialPrice.name}}" stepKey="seeVirtualProductNameOnCategoryPage"/> <!-- Verify customer see updated virtual product on the magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductSpecialPrice.urlKey)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualProductSpecialPrice.sku}}" stepKey="fillVirtualProductName"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualProductSpecialPrice.name}}" stepKey="seeVirtualProductName"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> + <argument name="phrase" value="{{updateVirtualProductSpecialPrice.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeVirtualProductName"> + <argument name="productName" value="{{updateVirtualProductSpecialPrice.name}}"/> + </actionGroup> <!--Verify customer see updated virtual product with special price(from above step) on product storefront page by url key --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductSpecialPrice.urlKey)}}" stepKey="goToProductStorefrontPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml index 78a15ee7eb19..df2e7f530158 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -130,10 +130,15 @@ <!--Verify customer don't see updated virtual product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductSpecialPriceOutOfStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualProductSpecialPriceOutOfStock.sku}}" stepKey="fillVirtualProductName"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualProductSpecialPriceOutOfStock.name}}" stepKey="dontSeeVirtualProductNameOnStorefrontPage"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> + <argument name="phrase" value="{{updateVirtualProductSpecialPriceOutOfStock.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductNameOnStorefrontPage"> + <argument name="productName" value="{{updateVirtualProductSpecialPriceOutOfStock.name}}"/> + </actionGroup> + </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml index f64e628c0edb..409ed2cd272a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml @@ -114,7 +114,7 @@ <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{updateVirtualProductWithTierPriceInStock.urlKey}}" stepKey="seeUrlKey"/> <!--Verify customer see updated virtual product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{updateVirtualProductWithTierPriceInStock.name}}" stepKey="seeVirtualProductNameOnCategoryPage"/> @@ -146,10 +146,14 @@ <!--Verify customer don't see updated virtual product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductWithTierPriceInStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualProductTierPriceInStock.sku}}" stepKey="fillVirtualProductName"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualProductWithTierPriceInStock.name}}" stepKey="dontSeeVirtualProductName"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> + <argument name="phrase" value="{{updateVirtualProductTierPriceInStock.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> + <argument name="productName" value="{{updateVirtualProductWithTierPriceInStock.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml index 6e835f2e5e98..0123c226d3fa 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -114,7 +114,7 @@ <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{updateVirtualTierPriceOutOfStock.urlKey}}" stepKey="seeUrlKey"/> <!--Verify customer don't see updated virtual product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{updateVirtualTierPriceOutOfStock.name}}" stepKey="dontSeeVirtualProductNameOnCategoryPage"/> @@ -146,10 +146,15 @@ <!--Verify customer don't see updated virtual product link on magento storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualTierPriceOutOfStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{updateVirtualTierPriceOutOfStock.sku}}" stepKey="fillVirtualProductName"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <dontSee selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{updateVirtualTierPriceOutOfStock.name}}" stepKey="dontSeeVirtualProductName"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillVirtualProductName"> + <argument name="phrase" value="{{updateVirtualTierPriceOutOfStock.sku}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> + <argument name="productName" value="{{updateVirtualTierPriceOutOfStock.name}}"/> + </actionGroup> + </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualProductSetEditContentTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualProductSetEditContentTest.xml index 1e7b7cc14f9c..ea562cbbd52b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualProductSetEditContentTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualProductSetEditContentTest.xml @@ -35,6 +35,6 @@ </actionGroup> <!--Checking content storefront--> - <amOnPage url="{{defaultVirtualProduct.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{defaultVirtualProduct.urlKey}}.html" stepKey="goToStorefront"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml index f70f5757ec5c..f12512e99812 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml @@ -15,13 +15,9 @@ <title value="Admin should be able to set/edit Related Products information when editing a virtual product"/> <description value="Admin should be able to set/edit Related Products information when editing a virtual product"/> <severity value="CRITICAL"/> - <testCaseId value="MC-3415"/> - <group value="Catalog"/> - <skip> - <issueId value="MC-194"/> - </skip> + <testCaseId value="MC-25532"/> + <group value="catalog"/> </annotations> - <before></before> <after> <!-- Delete virtual product --> <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> @@ -38,6 +34,6 @@ </actionGroup> <!--See related product in storefront--> - <amOnPage url="{{defaultVirtualProduct.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{StorefrontProductPage.url(defaultVirtualProduct.urlKey)}}" stepKey="goToStorefront"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByShortDescriptionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByShortDescriptionTest.xml index 5431a19461f7..3faa9e8cf795 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByShortDescriptionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByShortDescriptionTest.xml @@ -18,6 +18,8 @@ <group value="Catalog"/> </annotations> <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <createData entity="ApiProductWithDescription" stepKey="product"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml index 2095d56ce6c5..2f4e20c7c8b5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml @@ -109,11 +109,7 @@ </actionGroup> <actionGroup ref="ClearProductsFilterActionGroup" stepKey="ClearProductsFilterActionGroup"/> - <!--Flush cache--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> - + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Edit customer info--> <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="OpenEditCustomerFrom"> @@ -159,14 +155,14 @@ <waitForPageLoad stepKey="waitForProductsOpened"/> <!--TEST CASE #1--> <!--Add 3 products to order with specified quantity--> - <click selector="{{OrdersGridSection.selectProduct($$product1.name$$)}}" stepKey="selectProduct1"/> - <fillField selector="{{OrdersGridSection.setQuantity($$product1.name$$)}}" userInput="10" stepKey="AddProductQuantity1"/> + <click selector="{{OrdersGridSection.selectProduct($$product1.sku$$)}}" stepKey="selectProduct1"/> + <fillField selector="{{OrdersGridSection.setQuantity($$product1.sku$$)}}" userInput="10" stepKey="AddProductQuantity1"/> - <click selector="{{OrdersGridSection.selectProduct($$product2.name$$)}}" stepKey="selectProduct2"/> - <fillField selector="{{OrdersGridSection.setQuantity($$product2.name$$)}}" userInput="10" stepKey="AddProductQuantity2"/> + <click selector="{{OrdersGridSection.selectProduct($$product2.sku$$)}}" stepKey="selectProduct2"/> + <fillField selector="{{OrdersGridSection.setQuantity($$product2.sku$$)}}" userInput="10" stepKey="AddProductQuantity2"/> - <click selector="{{OrdersGridSection.selectProduct($$product3.name$$)}}" stepKey="selectProduct3"/> - <fillField selector="{{OrdersGridSection.setQuantity($$product3.name$$)}}" userInput="10" stepKey="AddProductQuantity3"/> + <click selector="{{OrdersGridSection.selectProduct($$product3.sku$$)}}" stepKey="selectProduct3"/> + <fillField selector="{{OrdersGridSection.setQuantity($$product3.sku$$)}}" userInput="10" stepKey="AddProductQuantity3"/> <click stepKey="addProductsToOrder" selector="{{OrdersGridSection.addProductsToOrder}}"/> <waitForLoadingMaskToDisappear stepKey="wait6"/> <!--Verify tier price values--> @@ -224,14 +220,14 @@ <!--Add 3 products to order with specified quantity--> <scrollToTopOfPage stepKey="scrollToTopOfPage"/> <click stepKey="clickToAddProduct1" selector="{{OrdersGridSection.addProducts}}"/> - <click selector="{{OrdersGridSection.selectProduct($$product1.name$$)}}" stepKey="selectProduct5"/> - <fillField selector="{{OrdersGridSection.setQuantity($$product1.name$$)}}" userInput="10" stepKey="AddProductQuantity5"/> + <click selector="{{OrdersGridSection.selectProduct($$product1.sku$$)}}" stepKey="selectProduct5"/> + <fillField selector="{{OrdersGridSection.setQuantity($$product1.sku$$)}}" userInput="10" stepKey="AddProductQuantity5"/> - <click selector="{{OrdersGridSection.selectProduct($$product2.name$$)}}" stepKey="selectProduct6"/> - <fillField selector="{{OrdersGridSection.setQuantity($$product2.name$$)}}" userInput="10" stepKey="AddProductQuantity6"/> + <click selector="{{OrdersGridSection.selectProduct($$product2.sku$$)}}" stepKey="selectProduct6"/> + <fillField selector="{{OrdersGridSection.setQuantity($$product2.sku$$)}}" userInput="10" stepKey="AddProductQuantity6"/> - <click selector="{{OrdersGridSection.selectProduct($$product3.name$$)}}" stepKey="selectProduct7"/> - <fillField selector="{{OrdersGridSection.setQuantity($$product3.name$$)}}" userInput="10" stepKey="AddProductQuantity7"/> + <click selector="{{OrdersGridSection.selectProduct($$product3.sku$$)}}" stepKey="selectProduct7"/> + <fillField selector="{{OrdersGridSection.setQuantity($$product3.sku$$)}}" userInput="10" stepKey="AddProductQuantity7"/> <click stepKey="addProductsToOrder1" selector="{{OrdersGridSection.addProductsToOrder}}"/> <waitForLoadingMaskToDisappear stepKey="wait7"/> <!--Verify tier price values--> @@ -257,8 +253,8 @@ <waitForPageLoad stepKey="waitForPgeLoaded3"/> <click selector="{{OrdersGridSection.addProducts}}" stepKey="clickToAddProduct2"/> <waitForLoadingMaskToDisappear stepKey="wait8"/> - <click selector="{{OrdersGridSection.selectProduct($$product4.name$$)}}" stepKey="selectProduct8"/> - <fillField selector="{{OrdersGridSection.setQuantity($$product4.name$$)}}" userInput="10" stepKey="AddProductQuantity9"/> + <click selector="{{OrdersGridSection.selectProduct($$product4.sku$$)}}" stepKey="selectProduct8"/> + <fillField selector="{{OrdersGridSection.setQuantity($$product4.sku$$)}}" userInput="10" stepKey="AddProductQuantity9"/> <click selector="{{OrdersGridSection.addProductsToOrder}}" stepKey="addProductsToOrder2"/> <waitForLoadingMaskToDisappear stepKey="wait9"/> <grabTextFrom selector="{{OrdersGridSection.productPrice($$product4.name$$)}}" stepKey="checkProductPrice10"/> @@ -296,8 +292,8 @@ <waitForPageLoad stepKey="WaitProductsDeleted1"/> <scrollToTopOfPage stepKey="scrollToTopOfPage1"/> <click selector="{{OrdersGridSection.addProducts}}" stepKey="clickToAddProduct4" /> - <click selector="{{OrdersGridSection.selectProduct($$product1.name$$)}}" stepKey="selectProduct9"/> - <fillField selector="{{OrdersGridSection.setQuantity($$product1.name$$)}}" userInput="10" stepKey="AddProductQuantity10"/> + <click selector="{{OrdersGridSection.selectProduct($$product1.sku$$)}}" stepKey="selectProduct9"/> + <fillField selector="{{OrdersGridSection.setQuantity($$product1.sku$$)}}" userInput="10" stepKey="AddProductQuantity10"/> <click selector="{{OrdersGridSection.addProductsToOrder}}" stepKey="addProductsToOrder3"/> <waitForLoadingMaskToDisappear stepKey="wait11"/> <fillField selector="{{OrdersGridSection.applyCoupon}}" userInput="ship" stepKey="AddCouponCode"/> @@ -333,9 +329,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHintTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHintTest.xml index e50c124f7cfd..9bebe97a8b34 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHintTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHintTest.xml @@ -22,8 +22,12 @@ <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> </before> <after> - <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> </after> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml index e67940274039..1094af357b18 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml @@ -24,18 +24,14 @@ <comment userInput="Create category, flush cache and log in" stepKey="createCategoryAndLogIn"/> <createData entity="SimpleSubCategory" stepKey="simpleCategory"/> <actionGroup ref="AdminLoginActionGroup" stepKey="logInAsAdmin"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!-- Delete category and log out --> <comment userInput="Delete category and log out" stepKey="deleteCategoryAndLogOut"/> <deleteData createDataKey="simpleCategory" stepKey="deleteCategory"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logOutFromAdmin"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <!-- Navigate to category details page --> <comment userInput="Navigate to category details page" stepKey="navigateToAdminCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/NewProductsListWidgetSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/NewProductsListWidgetSimpleProductTest.xml index 845299b3e33b..a5ed6b0a370d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/NewProductsListWidgetSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/NewProductsListWidgetSimpleProductTest.xml @@ -24,20 +24,27 @@ <!-- Create a Simple Product to appear in the widget --> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="amOnProductList"/> - <click selector="{{AdminProductGridActionSection.addProductBtn}}" stepKey="clickAddProduct"/> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{_defaultProduct.sku}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{_defaultProduct.price}}" stepKey="fillProductPrice"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="fillProductQuantity"/> - <fillField selector="{{AdminProductFormSection.setProductAsNewFrom}}" userInput="01/1/2000" stepKey="fillProductNewFrom"/> - <fillField selector="{{AdminProductFormSection.setProductAsNewTo}}" userInput="01/1/2099" stepKey="fillProductNewTo"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="clickAddProduct"/> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductName"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductSku"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductPrice"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductQuantity"/> + <actionGroup ref="AdminSetProductAsNewDateActionGroup" stepKey="fillProductNewFrom"> + <argument name="fromDate" value="01/1/2000"/> + <argument name="toDate" value="01/1/2099"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductNewTo"/> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveProduct"/> <!-- If PageCache is enabled, Cache clearing happens here via merge --> <!-- Check for product on the CMS page with the New Products widget --> - <amOnPage url="{{_newDefaultCmsPage.identifier}}" stepKey="amOnCmsPage"/> - <waitForPageLoad stepKey="waitForCmsPage"/> - <see selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" userInput="{{_defaultProduct.name}}" stepKey="seeProductName"/> + <actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="amOnCmsPage"> + <argument name="identifier" value="{{_newDefaultCmsPage.identifier}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCmsPage"/> + <actionGroup ref="AssertStorefrontProductIsShownOnCmsPageActionGroup" stepKey="seeProductName"> + <argument name="cmsTitle" value="{{_newDefaultCmsPage.title}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml index 916bcd7405ec..9c18ba6cd654 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml @@ -49,7 +49,7 @@ <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> </after> <!--Open product page--> - <amOnPage url="{{StorefrontProductPage.url($$createProductDefault.name$$)}}" stepKey="goToProductDefaultPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProductDefault.custom_attributes[url_key]$$)}}" stepKey="goToProductDefaultPage"/> <waitForPageLoad stepKey="waitForProductPage"/> <!--Click on 'Add to Compare' link--> <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="clickOnAddToCompare"> @@ -60,7 +60,7 @@ <argument name="productVar" value="$$createProductDefault$$"/> </actionGroup> <!--Open product with custom attribute page--> - <amOnPage url="{{StorefrontProductPage.url($$createProductCustom.name$$)}}" stepKey="goToProductCustomPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProductCustom.custom_attributes[url_key]$$)}}" stepKey="goToProductCustomPage"/> <waitForPageLoad stepKey="waitForProductCustomPage"/> <!--Click on 'Add to Compare' link--> <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="clickOnAddToCompareCustom"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml index f6292a3a96c4..662ff5d0195c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml @@ -63,7 +63,7 @@ <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccess"/> <!-- navigate to the created product page --> - <amOnPage url="/{{SimpleProduct3.name}}.html" stepKey="goToCreatedProduct"/> + <amOnPage url="/{{SimpleProduct3.urlKey}}.html" stepKey="goToCreatedProduct"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <!-- Check to make sure all of the created names are there --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontAssertProductFinalPriceChangesDynamicallyOnProductPageWithTierPricesConfiguredTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontAssertProductFinalPriceChangesDynamicallyOnProductPageWithTierPricesConfiguredTest.xml new file mode 100644 index 000000000000..ca36442543e4 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontAssertProductFinalPriceChangesDynamicallyOnProductPageWithTierPricesConfiguredTest.xml @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StoreFrontAssertProductFinalPriceChangesDynamicallyOnProductPageWithTierPricesConfiguredTest"> + <annotations> + <features value="Catalog"/> + <stories value="Tier price"/> + <title value="Product price is updated according to tier prices when changing product quantity"/> + <description value="Check that price of product will be updated according to tier prices on product page when changing product quantity"/> + <severity value="MAJOR"/> + <testCaseId value="MC-42006"/> + <useCaseId value="MC-41767"/> + <group value="catalog"/> + </annotations> + <before> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> + <createData entity="CustomerEntityOne" stepKey="createCustomer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdmin"/> + </before> + <after> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="amOnProductGridPage"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilterProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + <!--AdminProductPageOpenByIdActionGroup--> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductForEdit"> + <argument name="productId" value="$createSimpleProduct.id$"/> + </actionGroup> + <actionGroup ref="AdminAddAdvancedPricingToTheProductActionGroup" stepKey="addCustomerGroupPrice"> + <argument name="index" value="0"/> + <argument name="groupPrice" value="simpleGroupPrice"/> + </actionGroup> + <actionGroup ref="AdminAddAdvancedPricingToTheProductActionGroup" stepKey="addCustomerGroupPrice2"> + <argument name="index" value="1"/> + <argument name="groupPrice" value="tierPriceForAllGroups"/> + </actionGroup> + <actionGroup ref="AdminAddAdvancedPricingToTheProductActionGroup" stepKey="addCustomerGroupPrice3"> + <argument name="index" value="2"/> + <argument name="groupPrice" value="tierPriceForGeneralGroup"/> + </actionGroup> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrl" value="$createSimpleProduct.custom_attributes[url_key]$"/> + </actionGroup> + <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="2" stepKey="fillQuantity"/> + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> + <argument name="productPrice" value="80"/> + </actionGroup> + <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="3" stepKey="fillQuantity2"/> + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage2"> + <argument name="productPrice" value="80"/> + </actionGroup> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> + <argument name="Customer" value="$createCustomer$" /> + </actionGroup> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openSimpleProductPage"> + <argument name="productUrl" value="$createSimpleProduct.custom_attributes[url_key]$"/> + </actionGroup> + <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="2" stepKey="fillQuantity3"/> + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage3"> + <argument name="productPrice" value="80"/> + </actionGroup> + <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="3" stepKey="fillQuantity4"/> + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage4"> + <argument name="productPrice" value="70"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreLevelTest.xml index 64ad34825785..fe7bbd49dd40 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreLevelTest.xml @@ -75,9 +75,7 @@ <!-- Logout Admin --> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterDeletion"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterDeletion"/> </after> <!--Create widget for recently viewed products--> <actionGroup ref="AdminEditCMSPageContentActionGroup" stepKey="clearRecentlyViewedWidgetsFromCMSContentBefore"> @@ -96,13 +94,10 @@ <argument name="buttonToShowSection1" value="1"/> <argument name="buttonToShowSection2" value="3"/> </actionGroup> - <!-- Warm up cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterWidgetCreated"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterWidgetCreated"/> <!-- Navigate to product 3 on store front --> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.name$)}}" stepKey="goToStoreOneProductPageTwo"/> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct3.name$)}}" stepKey="goToStoreOneProductPageThree"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.custom_attributes[url_key]$)}}" stepKey="goToStoreOneProductPageTwo"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct3.custom_attributes[url_key]$)}}" stepKey="goToStoreOneProductPageThree"/> <!-- Go to Home Page --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnStoreFrontHomePage"/> <actionGroup ref="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup" stepKey="assertStoreOneRecentlyViewedProduct2"> @@ -116,8 +111,8 @@ <!-- Switch to second store and add second product (visible on second store) to wishlist --> <click selector="{{StorefrontFooterSection.switchStoreButton}}" stepKey="clickSwitchStoreButtonOnDefaultStore"/> <click selector="{{StorefrontFooterSection.storeLink(customStore.name)}}" stepKey="selectCustomStore"/> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct1.name$)}}" stepKey="goToStore2ProductPage1"/> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.name$)}}" stepKey="goToStore2ProductPage2"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct1.custom_attributes[url_key]$)}}" stepKey="goToStore2ProductPage1"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.custom_attributes[url_key]$)}}" stepKey="goToStore2ProductPage2"/> <!-- Go to Home Page --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnHomePage2"/> <actionGroup ref="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup" stepKey="assertNextStore1RecentlyViewedProduct1"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreViewLevelTest.xml index 4d04a25c8d12..8034e7911cb0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreViewLevelTest.xml @@ -67,9 +67,7 @@ <!-- Logout Admin --> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterDeletion"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterDeletion"/> </after> <!--Create widget for recently viewed products--> @@ -90,13 +88,11 @@ <argument name="buttonToShowSection2" value="3"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterWidgetCreated"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterWidgetCreated"/> <!-- Navigate to product 3 on store front --> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.name$)}}" stepKey="goToStore1ProductPage2"/> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct3.name$)}}" stepKey="goToStore1ProductPage3"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.custom_attributes[url_key]$)}}" stepKey="goToStore1ProductPage2"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct3.custom_attributes[url_key]$)}}" stepKey="goToStore1ProductPage3"/> <!-- Go to Home Page --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnHomePage"/> <actionGroup ref="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup" stepKey="assertStore1RecentlyViewedProduct2"> @@ -114,8 +110,8 @@ <argument name="storeView" value="customStoreEN"/> </actionGroup> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct1.name$)}}" stepKey="goToStore2ProductPage1"/> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.name$)}}" stepKey="goToStore2ProductPage2"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct1.custom_attributes[url_key]$)}}" stepKey="goToStore2ProductPage1"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.custom_attributes[url_key]$)}}" stepKey="goToStore2ProductPage2"/> <!-- Go to Home Page --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnStoreViewHomePage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontAdvanceCatalogSearchSimpleProductBySkuWithHyphenTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontAdvanceCatalogSearchSimpleProductBySkuWithHyphenTest.xml index 69f78c63e267..b1caeac384d8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontAdvanceCatalogSearchSimpleProductBySkuWithHyphenTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontAdvanceCatalogSearchSimpleProductBySkuWithHyphenTest.xml @@ -15,12 +15,9 @@ <title value="Guest customer should be able to advance search simple product with product sku that contains hyphen"/> <description value="Guest customer should be able to advance search simple product with product sku that contains hyphen"/> <severity value="MAJOR"/> - <testCaseId value="MC-20361"/> + <testCaseId value="MC-28813"/> <group value="Catalog"/> <group value="SearchEngineElasticsearch"/> - <skip> - <issueId value="MC-34217"/> - </skip> </annotations> <before> <createData entity="ApiProductWithDescription" stepKey="product"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontAdvanceCatalogSearchVirtualProductBySkuWithHyphenTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontAdvanceCatalogSearchVirtualProductBySkuWithHyphenTest.xml index b87cce398498..5ef2fd65fec1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontAdvanceCatalogSearchVirtualProductBySkuWithHyphenTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontAdvanceCatalogSearchVirtualProductBySkuWithHyphenTest.xml @@ -15,12 +15,9 @@ <title value="Guest customer should be able to advance search virtual product with product sku that contains hyphen"/> <description value="Guest customer should be able to advance search virtual product with product sku that contains hyphen"/> <severity value="MAJOR"/> - <testCaseId value="MC-20385"/> - <group value="Catalog"/> + <testCaseId value="MC-28816"/> + <group value="catalog"/> <group value="SearchEngineElasticsearch"/> - <skip> - <issueId value="MC-34217"/> - </skip> </annotations> <before> <createData entity="ApiVirtualProductWithDescription" stepKey="product"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryPageWithCategoryFilterTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryPageWithCategoryFilterTest.xml index 3ff477070cc3..d8c798dbc140 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryPageWithCategoryFilterTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryPageWithCategoryFilterTest.xml @@ -43,10 +43,7 @@ <!-- Set the category filter to be present on the category page layered navigation --> <magentoCLI command="config:set {{EnableCategoryFilterOnCategoryPageConfigData.path}} {{EnableCategoryFilterOnCategoryPageConfigData.value}}" stepKey="setCategoryFilterVisibleOnStorefront"/> - - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryPageWithoutCategoryFilterTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryPageWithoutCategoryFilterTest.xml index a2316efb3a74..befb64d01bfd 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryPageWithoutCategoryFilterTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryPageWithoutCategoryFilterTest.xml @@ -43,10 +43,7 @@ <!-- Set the category filter to NOT be present on the category page layered navigation --> <magentoCLI command="config:set {{DisableCategoryFilterOnCategoryPageConfigData.path}} {{DisableCategoryFilterOnCategoryPageConfigData.value}}" stepKey="hideCategoryFilterOnStorefront"/> - - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckCustomOptionPriceDifferentCurrencyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckCustomOptionPriceDifferentCurrencyTest.xml index a8368fcd9503..38f72fe24bb4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckCustomOptionPriceDifferentCurrencyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckCustomOptionPriceDifferentCurrencyTest.xml @@ -20,6 +20,7 @@ </annotations> <before> <magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForEUR.value}}" stepKey="setCurrencyAllow"/> + <magentoCLI command="config:set --scope={{SetAllowedCurrenciesConfigForUSD.scope}} --scope-code={{SetAllowedCurrenciesConfigForUSD.scope_code}} {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForEUR.value}}" stepKey="setAllowedCurrencyWebsitesForEURandUSD"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="_defaultProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> @@ -29,6 +30,7 @@ </before> <after> <magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}}" stepKey="setCurrencyAllow"/> + <magentoCLI command="config:set --scope={{SetAllowedCurrenciesConfigForUSD.scope}} --scope-code={{SetAllowedCurrenciesConfigForUSD.scope_code}} {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}}" stepKey="setAllowedCurrencyUSDWebsites"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckDefaultNumberProductsToDisplayTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckDefaultNumberProductsToDisplayTest.xml index ca561e4af70d..c9be526e095a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckDefaultNumberProductsToDisplayTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckDefaultNumberProductsToDisplayTest.xml @@ -188,13 +188,11 @@ <seeInField selector="{{AdminCatalogStorefrontConfigSection.productsPerPageDefaultValue}}" userInput="12" stepKey="seeDefaultValueProductPerPage"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Open storefront on the category page --> <comment userInput="Open storefront on the category page" stepKey="commentOpenStorefront"/> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="goToStorefrontCreatedCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="goToStorefrontCreatedCategoryPage"/> <!-- Check the drop-down at the bottom of page contains options --> <comment userInput="Check the drop-down at the bottom of page contains options" stepKey="commentCheckOptions"/> <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.perPage}}" stepKey="scrollToBottomToolbarSection"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontConfigurableOptionsThumbImagesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontConfigurableOptionsThumbImagesTest.xml index 5d584bed989b..d0c6c4fe86ae 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontConfigurableOptionsThumbImagesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontConfigurableOptionsThumbImagesTest.xml @@ -170,7 +170,7 @@ </after> <!-- Open ConfigProduct in Store Front Page --> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="openProductInStoreFront"/> + <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="openProductInStoreFront"/> <waitForPageLoad stepKey="waitForProductToLoad"/> <!-- Check fotorama thumbnail images (no selected options) --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontForthLevelCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontForthLevelCategoryTest.xml index 9731b66209df..34d712f49e33 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontForthLevelCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontForthLevelCategoryTest.xml @@ -34,9 +34,7 @@ <deleteData createDataKey="category3" stepKey="deleteCategory3"/> <deleteData createDataKey="category2" stepKey="deleteCategory2"/> <deleteData createDataKey="category1" stepKey="deleteCategory1"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="cleanInvalidatedCaches"> - <argument name="tags" value="full_page"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="cleanInvalidatedCaches"/> </after> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnStorefrontPage"/> <moveMouseOver diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml index df1eb0c502e1..f9ad2d69264f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml @@ -51,7 +51,7 @@ <!-- Assert product in storefront product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openCreatedProductPage"> - <argument name="productUrl" value="$$createProduct.name$$"/> + <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> </actionGroup> <!-- Assert Fotorama arrows aren't visible --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml index 1032c322053d..02b21394770c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml @@ -42,7 +42,7 @@ <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Check product in category listing--> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="goToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="goToCategoryPage"/> <seeElement selector="{{StorefrontCategoryProductSection.ProductImageByNameAndSrc(SimpleProductNameWithDoubleQuote.name, ProductImage.fileName)}}" stepKey="seeCorrectImageCategoryPage"/> <see selector="{{StorefrontCategoryProductSection.ProductTitleByName(SimpleProductNameWithDoubleQuote.name)}}" userInput="{{SimpleProductNameWithDoubleQuote.name}}" stepKey="seeCorrectNameCategoryPage"/> <see selector="{{StorefrontCategoryProductSection.ProductPriceByName(SimpleProductNameWithDoubleQuote.name)}}" userInput="${{SimpleProductNameWithDoubleQuote.price}}" stepKey="seeCorrectPriceCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml index 9819357704d4..9c248a289ebd 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml @@ -36,7 +36,7 @@ <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Check product in category listing--> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategoryOne.name$$)}}" stepKey="navigateToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategoryOne.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage"/> <waitForPageLoad stepKey="waitforCategoryPageToLoad"/> <see selector="{{StorefrontCategoryProductSection.ProductTitleByName(productWithHTMLEntityOne.name)}}" userInput="{{productWithHTMLEntityOne.name}}" stepKey="seeCorrectNameProd1CategoryPage"/> <see selector="{{StorefrontCategoryProductSection.ProductTitleByName(productWithHTMLEntityTwo.name)}}" userInput="{{productWithHTMLEntityTwo.name}}" stepKey="seeCorrectNameProd2CategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml index a311b63418a6..203fa753d10f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml @@ -26,6 +26,7 @@ <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSimpleProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> <deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductsCompareWithEmptyAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductsCompareWithEmptyAttributeTest.xml index c7817ed181ae..d56faf9d5dec 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductsCompareWithEmptyAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductsCompareWithEmptyAttributeTest.xml @@ -46,7 +46,7 @@ <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear" /> <seeElement selector=".message-success" stepKey="assertSuccess"/> <actionGroup ref="ClearCacheActionGroup" stepKey="clearCache"/> - <amOnPage url="{{StorefrontProductPage.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="goProductPageOnStorefront1"/> + <amOnPage url="{{StorefrontProductPage.NavigationCategoryByName($$createCategory.custom_attributes[url_key]$$)}}" stepKey="goProductPageOnStorefront1"/> <!-- View Simple Product 1 --> <comment userInput="View simple product 1" stepKey="commentViewSimpleProduct1" after="goProductPageOnStorefront1"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="browseClickCategorySimpleProduct1View" after="commentViewSimpleProduct1"/> @@ -54,7 +54,7 @@ <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="compareAddSimpleProduct1ToCompare"> <argument name="productVar" value="$$createSimpleProduct1$$"/> </actionGroup> - <amOnPage url="{{StorefrontProductPage.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="goProductPageOnStorefront2"/> + <amOnPage url="{{StorefrontProductPage.NavigationCategoryByName($$createCategory.custom_attributes[url_key]$$)}}" stepKey="goProductPageOnStorefront2"/> <!-- View Simple Product 2 --> <comment userInput="View simple product 2" stepKey="commentViewSimpleProduct2" after="goProductPageOnStorefront2"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct2.name$$)}}" stepKey="browseClickCategorySimpleProduct2View" after="commentViewSimpleProduct2"/> @@ -62,7 +62,7 @@ <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="compareAddSimpleProduct2ToCompare"> <argument name="productVar" value="$$createSimpleProduct2$$"/> </actionGroup> - <amOnPage url="{{StorefrontProductPage.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="goProductPageOnStorefront3"/> + <amOnPage url="{{StorefrontProductPage.NavigationCategoryByName($$createCategory.custom_attributes[url_key]$$)}}" stepKey="goProductPageOnStorefront3"/> <!-- Check products in comparison sidebar --> <!-- Check simple product 1 in comparison sidebar --> <comment userInput="Check simple product 1 in comparison sidebar" stepKey="commentCheckSimpleProduct1InComparisonSidebar" after="goProductPageOnStorefront3"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml index 71041ee7e134..dad3e05d81a5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml @@ -120,9 +120,8 @@ <!--Select payment method--> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPaymentMethod"/> <!-- Place Order --> - <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPlaceOrderButton"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> <!-- Login to Admin and open Order --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitleTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitleTest.xml index ce419167e951..e8bb48cfdd62 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitleTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitleTest.xml @@ -12,14 +12,11 @@ <annotations> <features value="Catalog"/> <stories value="Custom options"/> - <group value="Catalog"/> <title value="Admin should be able to see the full title of the selected custom option value in the order"/> <description value="Admin should be able to see the full title of the selected custom option value in the order"/> <severity value="MAJOR"/> - <testCaseId value="MC-3043"/> - <skip> - <issueId value="MQE-1128"/> - </skip> + <testCaseId value="MC-25479"/> + <group value="catalog"/> </annotations> <before> <!--Create Simple Product with Custom Options--> @@ -45,38 +42,39 @@ <!-- Login Customer Storefront --> <actionGroup ref="StorefrontOpenCustomerLoginPageActionGroup" stepKey="goToSignInPage"/> <actionGroup ref="StorefrontFillCustomerLoginFormActionGroup" stepKey="fillLoginFormWithCorrectCredentials"> - <argument name="customer" value="$$createCustomer$$"/> + <argument name="customer" value="$createCustomer$"/> </actionGroup> <actionGroup ref="StorefrontClickSignOnCustomerLoginFormActionGroup" stepKey="clickSignInAccountButton" /> <!-- Checking the correctness of displayed prices for user parameters --> - <amOnPage url="{{StorefrontHomePage.url}}$$createProduct.custom_attributes[url_key]$$.html" stepKey="amOnProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($createProduct.custom_attributes[url_key]$)}}" stepKey="amOnProductPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> <seeElement selector="{{StorefrontProductInfoMainSection.productAttributeOptionsDropDown(ProductOptionDropDownWithLongValuesTitle.title, ProductOptionValueDropdownLongTitle1.price)}}" stepKey="checkDropDownProductOption"/> <!-- Adding items to the checkout --> <selectOption userInput="{{ProductOptionValueDropdownLongTitle1.price}}" selector="{{StorefrontProductInfoMainSection.productOptionSelect(ProductOptionDropDownWithLongValuesTitle.title)}}" stepKey="seeProductOptionDropDown"/> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="finalProductPrice"/> - + <comment userInput="BIC workaround" stepKey="finalProductPrice"/> <actionGroup ref="StorefrontAddToCartCustomOptionsProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> - <argument name="productName" value="$$createProduct.name$$"/> + <argument name="productName" value="$createProduct.name$"/> </actionGroup> <!-- Checking the correctness of displayed custom options for user parameters on checkout --> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart" /> - <conditionalClick selector="{{CheckoutPaymentSection.cartItemsArea}}" dependentSelector="{{CheckoutPaymentSection.cartItemsArea}}" visible="true" stepKey="exposeMiniCart"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.cartItemsArea}}" stepKey="waitForCartItemsVisible"/> + <conditionalClick selector="{{CheckoutPaymentSection.cartItemsArea}}" dependentSelector="{{CheckoutPaymentSection.cartItemsAreaActive}}" visible="false" stepKey="exposeMiniCart"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskForCartItem"/> - <waitForElement selector="{{CheckoutPaymentSection.cartItemsAreaActive}}" time="30" stepKey="waitForCartItemsAreaActive"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.cartItems}}" stepKey="waitForCartItemsAreaActive"/> - <see selector="{{CheckoutPaymentSection.cartItems}}" userInput="$$createProduct.name$$" stepKey="seeProductInCart"/> + <see selector="{{CheckoutPaymentSection.cartItems}}" userInput="$createProduct.name$" stepKey="seeProductInCart"/> - <conditionalClick selector="{{CheckoutPaymentSection.ProductOptionsByProductItemName($$createProduct.name$$)}}" dependentSelector="{{CheckoutPaymentSection.ProductOptionsActiveByProductItemName($$createProduct.name$$)}}" visible="false" stepKey="exposeProductOptions"/> + <conditionalClick selector="{{CheckoutPaymentSection.ProductOptionsByProductItemName($createProduct.name$)}}" dependentSelector="{{CheckoutPaymentSection.ProductOptionsActiveByProductItemName($createProduct.name$)}}" visible="false" stepKey="exposeProductOptions"/> - <see selector="{{CheckoutPaymentSection.ProductOptionsActiveByProductItemName($$createProduct.name$$)}}" userInput="{{ProductOptionValueDropdownLongTitle1.title}}" stepKey="seeProductOptionValueDropdown1Input1"/> + <see selector="{{CheckoutPaymentSection.ProductOptionsActiveByProductItemName($createProduct.name$)}}" userInput="{{ProductOptionValueDropdownLongTitle1.title}}" stepKey="seeProductOptionValueDropdown1Input1"/> <!--Select shipping method--> @@ -84,14 +82,13 @@ <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNext"/> <!-- Checkout select Check/Money Order payment --> - <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> + <comment userInput="BIC workaround" stepKey="selectCheckMoneyPayment"/> <!-- Place Order --> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPaymentMethod"/> - <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPlaceOrderButton"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> <!-- Login to Admin and open Order --> @@ -117,6 +114,6 @@ </assertEquals> <moveMouseOver selector="{{AdminOrderItemsOrderedSection.productNameOptions}} dd" stepKey="hoverProduct"/> <waitForElementVisible selector="{{AdminOrderItemsOrderedSection.productNameOptions}} dd:nth-child(2)" stepKey="waitForCustomOptionValueFullName"/> - <see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj11111Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj11111" stepKey="seeAdminOrderProductOptionValueDropdown1"/> + <see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj111 11Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj11111" stepKey="seeAdminOrderProductOptionValueDropdown1"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontRememberCategoryPaginationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontRememberCategoryPaginationTest.xml index 78fbed1aef3a..107000a33799 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontRememberCategoryPaginationTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontRememberCategoryPaginationTest.xml @@ -44,7 +44,7 @@ <argument name="numOfProductsPerPage" value="12"/> </actionGroup> - <amOnPage url="{{StorefrontCategoryPage.url($$defaultCategory2.name$$)}}" stepKey="navigateToCategory2Page"/> + <amOnPage url="{{StorefrontCategoryPage.url($$defaultCategory2.custom_attributes[url_key]$$)}}" stepKey="navigateToCategory2Page"/> <waitForPageLoad stepKey="waitForCategory2PageToLoad"/> <actionGroup ref="VerifyCategoryPageParametersActionGroup" stepKey="verifyCategory2PageParameters"> @@ -61,10 +61,7 @@ <deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/> <deleteData createDataKey="defaultCategory2" stepKey="deleteCategory2"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> - + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml index 164701fa5bc6..5ff0a002e11e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml @@ -69,7 +69,7 @@ </actionGroup> <!--Go to the product page and check special price--> - <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <grabTextFrom selector="{{StorefrontProductInfoMainSection.specialPriceValue}}" stepKey="grabSpecialPrice"/> <assertEquals stepKey="assertSpecialPrice"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest/VerifyDefaultWYSIWYGToolbarOnProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest/VerifyDefaultWYSIWYGToolbarOnProductTest.xml index 662a251be3b2..f931c81afd93 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest/VerifyDefaultWYSIWYGToolbarOnProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest/VerifyDefaultWYSIWYGToolbarOnProductTest.xml @@ -20,7 +20,9 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4"/> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE"> + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> </before> <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToProduct"/> <waitForPageLoad stepKey="wait"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest/VerifydefaultcontrolsonproductshortdescriptionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest/VerifydefaultcontrolsonproductshortdescriptionTest.xml index d4bc095dbe9b..845b5e7863f7 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest/VerifydefaultcontrolsonproductshortdescriptionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest/VerifydefaultcontrolsonproductshortdescriptionTest.xml @@ -20,7 +20,9 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4"/> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE"> + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> </before> <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToProduct"/> <waitForPageLoad stepKey="wait"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEIsNativeWYSIWYGOnCatalogTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEIsNativeWYSIWYGOnCatalogTest.xml new file mode 100644 index 000000000000..502a20d3fd6f --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEIsNativeWYSIWYGOnCatalogTest.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="VerifyTinyMCEIsNativeWYSIWYGOnCatalogTest"> + <annotations> + <features value="Catalog"/> + <stories value="MAGETWO-72137-Apply new WYSIWYG on Categories Page"/> + <group value="Catalog"/> + <title value="Admin should see TinyMCE is the native WYSIWYG on Catalog Page"/> + <description value="Admin should see TinyMCE is the native WYSIWYG on Catalog Page"/> + <severity value="CRITICAL"/> + <testCaseId value="MAGETWO-82551"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> + </before> + <actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="navigateToNewCatalog"/> + <waitForLoadingMaskToDisappear stepKey="wait2" /> + <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/> + <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{SimpleSubCategory.name}}" stepKey="enterCategoryName"/> + <click selector="{{AdminProductFormSection.contentTab}}" stepKey="clickContentTab"/> + <waitForElementVisible selector="{{CatalogWYSIWYGSection.TinyMCE4}}" stepKey="waitForTinyMCE4" /> + <seeElement selector="{{CatalogWYSIWYGSection.ShowHideBtn}}" stepKey="seeShowHideBtn" /> + <actionGroup ref="VerifyTinyMCEActionGroup" stepKey="verifyTinyMCE"/> + <executeJS function="tinyMCE.get('category_form_description').setContent('Hello World!');" stepKey="executeJSFillContent"/> + <click selector="{{CatalogWYSIWYGSection.ShowHideBtn}}" stepKey="clickShowHideBtn" /> + <waitForElementVisible selector="{{TinyMCESection.InsertImageBtn}}" stepKey="waitForInsertImage" /> + <seeElement selector="{{TinyMCESection.InsertImageBtn}}" stepKey="insertImage"/> + <dontSee selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="insertWidget" /> + <dontSee selector="{{TinyMCESection.InsertVariableBtn}}" stepKey="insertVariable" /> + <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCatalog"/> + <!-- Go to storefront product page, assert product content --> + <amOnPage url="/{{SimpleSubCategory.urlKey}}.html" stepKey="goToCategoryFrontPage"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.CatalogDescription}}" stepKey="waitForDesVisible" /> + <see userInput="Hello World!" selector="{{StorefrontCategoryMainSection.CatalogDescription}}" stepKey="assertCatalogDescription"/> + <after> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + </test> +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEIsNativeWYSIWYGOnProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEIsNativeWYSIWYGOnProductTest.xml new file mode 100644 index 000000000000..4aa746e8cc03 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEIsNativeWYSIWYGOnProductTest.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="VerifyTinyMCEIsNativeWYSIWYGOnProductTest"> + <annotations> + <features value="Catalog"/> + <stories value="MAGETWO-72114-TinyMCE v4.6 as a native WYSIWYG editor"/> + <group value="Catalog"/> + <title value="Admin should see TinyMCE is the native WYSIWYG on Product Page"/> + <description value="Admin should see TinyMCE is the native WYSIWYG on Product Page"/> + <severity value="CRITICAL"/> + <testCaseId value="MAGETWO-81819"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> + </before> + <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToNewProduct"/> + <waitForPageLoad stepKey="wait1"/> + <fillField userInput="{{_defaultProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> + <fillField userInput="{{_defaultProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> + <fillField userInput="{{_defaultProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> + <fillField userInput="{{_defaultProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> + <scrollTo selector="{{AdminProductFormSection.productQuantity}}" stepKey="scrollToQty" /> + <click selector="{{AdminProductFormSection.contentTab}}" stepKey="clickContentTab" /> + <waitForElementVisible selector="{{ProductDescriptionWYSIWYGToolbarSection.TinyMCE4}}" stepKey="waitForDescription" /> + <seeElement selector="{{ProductDescriptionWYSIWYGToolbarSection.TinyMCE4}}" stepKey="TinyMCE4Description" /> + <click selector="{{ProductDescriptionWysiwygSection.EditArea}}" stepKey="focusProductDescriptionWysiwyg"/> + <executeJS function="tinyMCE.get('product_form_description').setContent('Hello World!');" stepKey="executeJSFillContent1"/> + <waitForElementVisible selector="{{ProductShortDescriptionWYSIWYGToolbarSection.TinyMCE4}}" stepKey="waitForShortDescription" /> + <seeElement selector="{{ProductShortDescriptionWYSIWYGToolbarSection.TinyMCE4}}" stepKey="TinyMCE4ShortDescription" /> + <click selector="{{ProductShortDescriptionWysiwygSection.EditArea}}" stepKey="focusProductShortDescriptionWysiwyg"/> + <executeJS function="tinyMCE.get('product_form_short_description').setContent('Hello World! Short Content');" stepKey="executeJSFillContent2"/> + <scrollTo selector="{{ProductDescriptionWYSIWYGToolbarSection.showHideBtn}}" y="-150" x="0" stepKey="scrollToDesShowHideBtn1" /> + <click selector="{{ProductDescriptionWYSIWYGToolbarSection.showHideBtn}}" stepKey="clickShowHideBtn1" /> + <waitForElementVisible selector="{{ProductDescriptionWYSIWYGToolbarSection.InsertImageBtn}}" stepKey="waitForInsertImage1" /> + <see selector="{{ProductDescriptionWYSIWYGToolbarSection.InsertImageBtn}}" userInput="Insert Image..." stepKey="seeInsertImage1"/> + <dontSee selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="insertWidget1" /> + <dontSee selector="{{TinyMCESection.InsertVariableBtn}}" stepKey="insertVariable1" /> + <scrollTo selector="{{ProductShortDescriptionWYSIWYGToolbarSection.showHideBtn}}" y="-150" x="0" stepKey="scrollToDesShowHideBtn2" /> + <click selector="{{ProductShortDescriptionWYSIWYGToolbarSection.showHideBtn}}" stepKey="clickShowHideBtn2" /> + <waitForElementVisible selector="{{ProductShortDescriptionWYSIWYGToolbarSection.InsertImageBtn}}" stepKey="waitForInsertImage2" /> + <see selector="{{ProductShortDescriptionWYSIWYGToolbarSection.InsertImageBtn}}" userInput="Insert Image..." stepKey="seeInsertImage2"/> + <dontSee selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="insertWidget2" /> + <dontSee selector="{{TinyMCESection.InsertVariableBtn}}" stepKey="insertVariable2" /> + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/> + <!-- Go to storefront product page, assert product content --> + <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="navigateToProductPage"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <scrollTo selector="{{StorefrontProductInfoMainSection.stock}}" stepKey="scrollToStock"/> + <see userInput="Hello World!" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/> + <see userInput="Hello World! Short Content" selector="{{StorefrontProductInfoMainSection.productShortDescription}}" stepKey="assertProductShortDescription"/> + <after> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + </test> +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml deleted file mode 100644 index ee6ff0c22454..000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml +++ /dev/null @@ -1,51 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest"> - <annotations> - <features value="Catalog"/> - <stories value="MAGETWO-72137-Apply new WYSIWYG on Categories Page"/> - <group value="Catalog"/> - <title value="Admin should see TinyMCEv4.6 is the native WYSIWYG on Catalog Page"/> - <description value="Admin should see TinyMCEv4.6 is the native WYSIWYG on Catalog Page"/> - <severity value="CRITICAL"/> - <testCaseId value="MAGETWO-82551"/> - </annotations> - <before> - <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> - </before> - <actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="navigateToNewCatalog"/> - <waitForLoadingMaskToDisappear stepKey="wait2" /> - <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/> - <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{SimpleSubCategory.name}}" stepKey="enterCategoryName"/> - <click selector="{{AdminProductFormSection.contentTab}}" stepKey="clickContentTab"/> - <waitForElementVisible selector="{{CatalogWYSIWYGSection.TinyMCE4}}" stepKey="waitForTinyMCE4" /> - <seeElement selector="{{CatalogWYSIWYGSection.ShowHideBtn}}" stepKey="seeShowHideBtn" /> - <actionGroup ref="VerifyTinyMCEActionGroup" stepKey="verifyTinyMCE4"/> - <executeJS function="tinyMCE.get('category_form_description').setContent('Hello World!');" stepKey="executeJSFillContent"/> - <click selector="{{CatalogWYSIWYGSection.ShowHideBtn}}" stepKey="clickShowHideBtn" /> - <waitForElementVisible selector="{{TinyMCESection.InsertImageBtn}}" stepKey="waitForInsertImage" /> - <seeElement selector="{{TinyMCESection.InsertImageBtn}}" stepKey="insertImage"/> - <dontSee selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="insertWidget" /> - <dontSee selector="{{TinyMCESection.InsertVariableBtn}}" stepKey="insertVariable" /> - <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCatalog"/> - <!-- Go to storefront product page, assert product content --> - <amOnPage url="/{{SimpleSubCategory.name_lwr}}.html" stepKey="goToCategoryFrontPage"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <waitForElementVisible selector="{{StorefrontCategoryMainSection.CatalogDescription}}" stepKey="waitForDesVisible" /> - <see userInput="Hello World!" selector="{{StorefrontCategoryMainSection.CatalogDescription}}" stepKey="assertCatalogDescription"/> - <after> - <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - </after> - </test> -</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml deleted file mode 100644 index f75053f495c4..000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml +++ /dev/null @@ -1,65 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest"> - <annotations> - <features value="Catalog"/> - <stories value="MAGETWO-72114-TinyMCE v4.6 as a native WYSIWYG editor"/> - <group value="Catalog"/> - <title value="Admin should see TinyMCEv4.6 is the native WYSIWYG on Product Page"/> - <description value="Admin should see TinyMCEv4.6 is the native WYSIWYG on Product Page"/> - <severity value="CRITICAL"/> - <testCaseId value="MAGETWO-81819"/> - </annotations> - <before> - <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> - </before> - <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToNewProduct"/> - <waitForPageLoad stepKey="wait1"/> - <fillField userInput="{{_defaultProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> - <fillField userInput="{{_defaultProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> - <fillField userInput="{{_defaultProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> - <fillField userInput="{{_defaultProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> - <scrollTo selector="{{AdminProductFormSection.productQuantity}}" stepKey="scrollToQty" /> - <click selector="{{AdminProductFormSection.contentTab}}" stepKey="clickContentTab" /> - <waitForElementVisible selector="{{ProductDescriptionWYSIWYGToolbarSection.TinyMCE4}}" stepKey="waitForDescription" /> - <seeElement selector="{{ProductDescriptionWYSIWYGToolbarSection.TinyMCE4}}" stepKey="TinyMCE4Description" /> - <click selector="{{ProductDescriptionWysiwygSection.EditArea}}" stepKey="focusProductDescriptionWysiwyg"/> - <executeJS function="tinyMCE.get('product_form_description').setContent('Hello World!');" stepKey="executeJSFillContent1"/> - <waitForElementVisible selector="{{ProductShortDescriptionWYSIWYGToolbarSection.TinyMCE4}}" stepKey="waitForShortDescription" /> - <seeElement selector="{{ProductShortDescriptionWYSIWYGToolbarSection.TinyMCE4}}" stepKey="TinyMCE4ShortDescription" /> - <click selector="{{ProductShortDescriptionWysiwygSection.EditArea}}" stepKey="focusProductShortDescriptionWysiwyg"/> - <executeJS function="tinyMCE.get('product_form_short_description').setContent('Hello World! Short Content');" stepKey="executeJSFillContent2"/> - <scrollTo selector="{{ProductDescriptionWYSIWYGToolbarSection.showHideBtn}}" y="-150" x="0" stepKey="scrollToDesShowHideBtn1" /> - <click selector="{{ProductDescriptionWYSIWYGToolbarSection.showHideBtn}}" stepKey="clickShowHideBtn1" /> - <waitForElementVisible selector="{{ProductDescriptionWYSIWYGToolbarSection.InsertImageBtn}}" stepKey="waitForInsertImage1" /> - <see selector="{{ProductDescriptionWYSIWYGToolbarSection.InsertImageBtn}}" userInput="Insert Image..." stepKey="seeInsertImage1"/> - <dontSee selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="insertWidget1" /> - <dontSee selector="{{TinyMCESection.InsertVariableBtn}}" stepKey="insertVariable1" /> - <scrollTo selector="{{ProductShortDescriptionWYSIWYGToolbarSection.showHideBtn}}" y="-150" x="0" stepKey="scrollToDesShowHideBtn2" /> - <click selector="{{ProductShortDescriptionWYSIWYGToolbarSection.showHideBtn}}" stepKey="clickShowHideBtn2" /> - <waitForElementVisible selector="{{ProductShortDescriptionWYSIWYGToolbarSection.InsertImageBtn}}" stepKey="waitForInsertImage2" /> - <see selector="{{ProductShortDescriptionWYSIWYGToolbarSection.InsertImageBtn}}" userInput="Insert Image..." stepKey="seeInsertImage2"/> - <dontSee selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="insertWidget2" /> - <dontSee selector="{{TinyMCESection.InsertVariableBtn}}" stepKey="insertVariable2" /> - <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/> - <!-- Go to storefront product page, assert product content --> - <amOnPage url="{{_defaultProduct.name}}.html" stepKey="navigateToProductPage"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <scrollTo selector="{{StorefrontProductInfoMainSection.stock}}" stepKey="scrollToStock"/> - <see userInput="Hello World!" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/> - <see userInput="Hello World! Short Content" selector="{{StorefrontProductInfoMainSection.productShortDescription}}" stepKey="assertProductShortDescription"/> - <after> - <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - </after> - </test> -</tests> diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Product/ListProductTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Product/ListProductTest.php index 157f64133549..55551a4ed603 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Product/ListProductTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Product/ListProductTest.php @@ -195,7 +195,7 @@ public function testGetIdentities() $this->catCollectionMock->expects($this->once()) ->method('getIterator') - ->willReturn([$currentCategory]); + ->willReturn(new \ArrayIterator([$currentCategory])); $this->prodCollectionMock->expects($this->any()) ->method('getIterator') diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Ui/ProductViewCounterTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Ui/ProductViewCounterTest.php index 6026d1462e46..87f5be4b2133 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Ui/ProductViewCounterTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Ui/ProductViewCounterTest.php @@ -166,6 +166,7 @@ public function testGetCurrentProductDataWithNonEmptyProduct() { $productMock = $this->getMockBuilder(ProductInterface::class) ->disableOriginalConstructor() + ->addMethods(['isAvailable']) ->getMockForAbstractClass(); $productRendererMock = $this->getMockBuilder(ProductRenderInterface::class) ->disableOriginalConstructor() @@ -173,7 +174,6 @@ public function testGetCurrentProductDataWithNonEmptyProduct() $storeMock = $this->getMockBuilder(Store::class) ->disableOriginalConstructor() ->getMock(); - $this->registryMock->expects($this->once()) ->method('registry') ->with('product') diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilterTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilterTest.php index 2560b56a04e8..f38ffcd822cd 100644 --- a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilterTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilterTest.php @@ -216,6 +216,29 @@ public function setupInputDataProvider() ['description', null, 'descr text'], ], ], + 'update_product_with_empty_string_attribute' => [ + 'requestProductData' => [ + 'name' => 'testName3', + 'sku' => 'testSku3', + 'price' => '103', + 'special_price' => '100', + 'custom_attribute' => '', + ], + 'useDefaults' => [], + 'expectedProductData' => [ + 'name' => 'testName3', + 'sku' => 'testSku3', + 'price' => '103', + 'special_price' => '100', + 'custom_attribute' => '', + ], + 'initialProductData' => [ + ['name', null, 'testName2'], + ['sku', null, 'testSku2'], + ['price', null, '101'], + ['custom_attribute', null, '0'], + ], + ], ]; } diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Product/ViewTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Product/ViewTest.php new file mode 100644 index 000000000000..32bab09cb98a --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/Controller/Product/ViewTest.php @@ -0,0 +1,147 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Test\Unit\Controller\Product; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Controller\Product\View; +use Magento\Catalog\Helper\Product\View as ViewHelper; +use Magento\Catalog\Model\Design; +use Magento\Catalog\Model\ProductRepository; +use Magento\Framework\App\Action\Context; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\Controller\Result\ForwardFactory; +use Magento\Framework\DataObject; +use Magento\Framework\View\Result\Page; +use Magento\Framework\View\Result\PageFactory; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Responsible for testing product view action on a strorefront. + */ +class ViewTest extends TestCase +{ + /** + * @var View + */ + private $view; + + /** + * @var RequestInterface|MockObject + */ + private $requestMock; + + /** + * @var PageFactory|MockObject + */ + private $resultPageFactoryMock; + + /** + * @var Design|MockObject + */ + private $catalogDesignMock; + + /** + * @var ProductRepository|MockObject + */ + private $productRepositoryMock; + + /** + * @var ProductInterface|MockObject + */ + private $productInterfaceMock; + + /** + * @var StoreManagerInterface|MockObject + */ + protected $storeManagerMock; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $contextMock = $this->getMockBuilder(Context::class) + ->disableOriginalConstructor() + ->getMock(); + $this->requestMock = $this->getMockBuilder(RequestInterface::class) + ->disableOriginalConstructor() + ->addMethods(['isPost']) + ->getMockForAbstractClass(); + $contextMock->expects($this->any()) + ->method('getRequest') + ->willReturn($this->requestMock); + $viewHelperMock = $this->getMockBuilder(ViewHelper::class) + ->disableOriginalConstructor() + ->getMock(); + $resultForwardFactoryMock = $this->getMockBuilder(ForwardFactory::class) + ->disableOriginalConstructor() + ->getMock(); + $this->resultPageFactoryMock = $this->getMockBuilder(PageFactory::class) + ->disableOriginalConstructor() + ->getMock(); + $this->resultPageFactoryMock = $this->getMockBuilder(PageFactory::class) + ->disableOriginalConstructor() + ->getMock(); + $this->catalogDesignMock = $this->getMockBuilder(Design::class) + ->disableOriginalConstructor() + ->getMock(); + $this->productRepositoryMock = $this->getMockBuilder(ProductRepository::class) + ->disableOriginalConstructor() + ->getMock(); + $this->productInterfaceMock = $this->getMockBuilder(ProductInterface::class) + ->disableOriginalConstructor() + ->getMock(); + $this->storeManagerMock = $this->getMockForAbstractClass(StoreManagerInterface::class); + $storeMock = $this->createMock(Store::class); + $this->storeManagerMock->method('getStore')->willReturn($storeMock); + + $this->view = new View( + $contextMock, + $viewHelperMock, + $resultForwardFactoryMock, + $this->resultPageFactoryMock, + null, + null, + $this->catalogDesignMock, + $this->productRepositoryMock, + $this->storeManagerMock + ); + } + + /** + * Verify that product custom design theme is applied before product rendering + */ + public function testExecute(): void + { + $themeId = 3; + $this->requestMock->method('isPost') + ->willReturn(false); + $this->productRepositoryMock->method('getById') + ->willReturn($this->productInterfaceMock); + $dataObjectMock = $this->getMockBuilder(DataObject::class) + ->disableOriginalConstructor() + ->addMethods(['getCustomDesign']) + ->getMock(); + $dataObjectMock->method('getCustomDesign') + ->willReturn($themeId); + $this->catalogDesignMock->method('getDesignSettings') + ->willReturn($dataObjectMock); + $this->catalogDesignMock->expects($this->once()) + ->method('applyCustomDesign') + ->with($themeId); + $viewResultPageMock = $this->getMockBuilder(Page::class) + ->disableOriginalConstructor() + ->getMock(); + $this->resultPageFactoryMock->method('create') + ->willReturn($viewResultPageMock); + $this->view->execute(); + } +} diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/TierPrice/SaveHandlerTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/TierPrice/SaveHandlerTest.php index c807ea881da6..8721e8661446 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/TierPrice/SaveHandlerTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/TierPrice/SaveHandlerTest.php @@ -180,4 +180,143 @@ public function testExecuteWithException(): void $this->saveHandler->execute($product); } + + /** + * @param $tierPrices + * @param $tierPricesStored + * @param $tierPricesExpected + * @dataProvider executeWithWebsitePriceDataProvider + */ + public function testExecuteWithWebsitePrice($tierPrices, $tierPricesStored, $tierPricesExpected): void + { + $productId = 10; + $linkField = 'entity_id'; + + /** @var MockObject $product */ + $product = $this->getMockBuilder(ProductInterface::class) + ->disableOriginalConstructor() + ->setMethods(['getData','setData', 'getStoreId']) + ->getMockForAbstractClass(); + $product->expects($this->atLeastOnce())->method('getData')->willReturnMap( + [ + ['tier_price', $tierPrices], + ['entity_id', $productId] + ] + ); + $product->expects($this->atLeastOnce())->method('getStoreId')->willReturn(0); + $product->expects($this->atLeastOnce())->method('setData')->with('tier_price_changed', 1); + $store = $this->getMockBuilder(StoreInterface::class) + ->disableOriginalConstructor() + ->setMethods(['getWebsiteId']) + ->getMockForAbstractClass(); + $store->expects($this->atLeastOnce())->method('getWebsiteId')->willReturn(1); + $this->storeManager->expects($this->atLeastOnce())->method('getStore')->willReturn($store); + /** @var MockObject $attribute */ + $attribute = $this->getMockBuilder(ProductAttributeInterface::class) + ->disableOriginalConstructor() + ->setMethods(['getName', 'isScopeGlobal']) + ->getMockForAbstractClass(); + $attribute->expects($this->atLeastOnce())->method('getName')->willReturn('tier_price'); + $attribute->expects($this->atLeastOnce())->method('isScopeGlobal')->willReturn(false); + $this->attributeRepository->expects($this->atLeastOnce())->method('get')->with('tier_price') + ->willReturn($attribute); + $productMetadata = $this->getMockBuilder(EntityMetadataInterface::class) + ->disableOriginalConstructor() + ->setMethods(['getLinkField']) + ->getMockForAbstractClass(); + $productMetadata->expects($this->atLeastOnce())->method('getLinkField')->willReturn($linkField); + $this->metadataPoll->expects($this->atLeastOnce())->method('getMetadata') + ->with(ProductInterface::class) + ->willReturn($productMetadata); + $customerGroup = $this->getMockBuilder(GroupInterface::class) + ->disableOriginalConstructor() + ->setMethods(['getId']) + ->getMockForAbstractClass(); + $customerGroup->expects($this->atLeastOnce())->method('getId')->willReturn(3200); + $this->groupManagement->expects($this->atLeastOnce())->method('getAllCustomersGroup') + ->willReturn($customerGroup); + $this->tierPriceResource + ->expects($this->at(1)) + ->method('savePriceData') + ->with(new \Magento\Framework\DataObject($tierPricesExpected[0])) + ->willReturnSelf(); + $this->tierPriceResource + ->expects($this->at(2)) + ->method('savePriceData') + ->with(new \Magento\Framework\DataObject($tierPricesExpected[1])) + ->willReturnSelf(); + $this->tierPriceResource + ->expects($this->at(3)) + ->method('savePriceData') + ->with(new \Magento\Framework\DataObject($tierPricesExpected[2])) + ->willReturnSelf(); + $this->tierPriceResource + ->expects($this->atLeastOnce()) + ->method('loadPriceData') + ->willReturn($tierPricesStored); + + $this->assertEquals($product, $this->saveHandler->execute($product)); + } + + public function executeWithWebsitePriceDataProvider(): array + { + $productId = 10; + return [[ + 'tierPrices' => [ + [ + 'price_id' => 1, + 'website_id' => 0, + 'price_qty' => 1, + 'cust_group' => 0, + 'price' => 10, + 'product_id' => $productId + ],[ + 'price_id' => 2, + 'website_id' => 1, + 'price_qty' => 2, + 'cust_group' => 3200, + 'price' => null, + 'percentage_value' => 20, + 'product_id' => $productId + ] + ], + 'tierPricesStored' => [ + [ + 'price_id' => 3, + 'website_id' => 1, + 'price_qty' => 3, + 'cust_group' => 0, + 'price' => 30, + 'product_id' => $productId + ] + ], + 'tierPricesExpected' => [ + [ + 'website_id' => 0, + 'qty' => 1, + 'customer_group_id' => 0, + 'all_groups' => 0, + 'value' => 10, + 'percentage_value' => null, + 'entity_id' => $productId + ],[ + 'website_id' => 1, + 'qty' => 2, + 'customer_group_id' => 0, + 'all_groups' => 1, + 'value' => null, + 'percentage_value' => 20, + 'entity_id' => $productId + ],[ + 'website_id' => 1, + 'qty' => 3, + 'customer_group_id' => 0, + 'all_groups' => 0, + 'value' => 30, + 'percentage_value' => null, + 'entity_id' => $productId + ] + ] + ]]; + } } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Category/FileInfoTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Category/FileInfoTest.php index 6928f9161b81..96948ed8d1aa 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Category/FileInfoTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Category/FileInfoTest.php @@ -129,21 +129,13 @@ public function testGetMimeType() $absoluteFilePath = '/a/b/c/pub/media/catalog/category/filename.ext1'; $expected = 'ext1'; - - $this->mediaDirectory->expects($this->at(0)) - ->method('getAbsolutePath') - ->with(null) - ->willReturn('/a/b/c/pub/media/'); - - $this->mediaDirectory->expects($this->at(1)) - ->method('getAbsolutePath') - ->with(null) - ->willReturn('/a/b/c/pub/media/'); - - $this->mediaDirectory->expects($this->at(2)) - ->method('getAbsolutePath') - ->with('/catalog/category/filename.ext1') - ->willReturn($absoluteFilePath); + $this->mediaDirectory->method('getAbsolutePath') + ->willReturnMap( + [ + [null, '/a/b/c/pub/media'], + ['/catalog/category/filename.ext1', $absoluteFilePath] + ] + ); $this->mime->expects($this->once()) ->method('getMimeType') diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/RepositoryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/RepositoryTest.php index 673e12a5b42b..2924bf66949c 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/RepositoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/RepositoryTest.php @@ -267,13 +267,16 @@ public function testSaveDoesNotSaveAttributeOptionsIfOptionsAreAbsentInPayload() { $attributeId = 1; $attributeCode = 'existing_attribute_code'; + $backendModel = 'backend_model'; $attributeMock = $this->createMock(Attribute::class); $attributeMock->expects($this->any())->method('getAttributeCode')->willReturn($attributeCode); $attributeMock->expects($this->any())->method('getAttributeId')->willReturn($attributeId); + $attributeMock->expects($this->once())->method('setBackendModel')->with($backendModel)->willReturnSelf(); $existingModelMock = $this->createMock(Attribute::class); $existingModelMock->expects($this->any())->method('getAttributeCode')->willReturn($attributeCode); $existingModelMock->expects($this->any())->method('getAttributeId')->willReturn($attributeId); + $existingModelMock->expects($this->once())->method('getBackendModel')->willReturn($backendModel); $this->eavAttributeRepositoryMock->expects($this->any()) ->method('get') @@ -292,6 +295,7 @@ public function testSaveDoesNotSaveAttributeOptionsIfOptionsAreAbsentInPayload() */ public function testSaveSavesDefaultFrontendLabelIfItIsPresentInPayload() { + $backendModel = 'backend_model'; $labelMock = $this->getMockForAbstractClass(AttributeFrontendLabelInterface::class); $labelMock->expects($this->any())->method('getStoreId')->willReturn(1); $labelMock->expects($this->any())->method('getLabel')->willReturn('Store Scope Label'); @@ -304,11 +308,13 @@ public function testSaveSavesDefaultFrontendLabelIfItIsPresentInPayload() $attributeMock->expects($this->any())->method('getDefaultFrontendLabel')->willReturn(null); $attributeMock->expects($this->any())->method('getFrontendLabels')->willReturn([$labelMock]); $attributeMock->expects($this->any())->method('getOptions')->willReturn([]); + $attributeMock->expects($this->once())->method('setBackendModel')->with($backendModel)->willReturnSelf(); $existingModelMock = $this->createMock(Attribute::class); $existingModelMock->expects($this->any())->method('getDefaultFrontendLabel')->willReturn('Default Label'); $existingModelMock->expects($this->any())->method('getAttributeId')->willReturn($attributeId); $existingModelMock->expects($this->any())->method('getAttributeCode')->willReturn($attributeCode); + $existingModelMock->expects($this->once())->method('getBackendModel')->willReturn($backendModel); $this->eavAttributeRepositoryMock->expects($this->any()) ->method('get') diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/RepositoryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/RepositoryTest.php index ac67ba52d772..016e755f27b4 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/RepositoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/RepositoryTest.php @@ -262,7 +262,7 @@ public function testSave() ->getMock(); $optionCollection->expects($this->once())->method('getProductOptions')->willReturn([$this->optionMock]); $this->optionCollectionFactory->expects($this->once())->method('create')->willReturn($optionCollection); - $this->optionMock->expects($this->once())->method('getValues')->willReturn([ + $this->optionMock->expects($this->exactly(2))->method('getValues')->willReturn([ $originalValue1, $originalValue2, $originalValue3 @@ -291,7 +291,7 @@ public function testSaveWhenOptionTypeWasChanged() ->getMock(); $optionCollection->expects($this->once())->method('getProductOptions')->willReturn([$this->optionMock]); $this->optionCollectionFactory->expects($this->once())->method('create')->willReturn($optionCollection); - $this->optionMock->expects($this->once())->method('getValues')->willReturn(null); + $this->optionMock->expects($this->exactly(2))->method('getValues')->willReturn(null); $this->assertEquals($this->optionMock, $this->optionRepository->save($this->optionMock)); } } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/SaveHandlerTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/SaveHandlerTest.php index fa8a3fc1e605..82916cf42ebe 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/SaveHandlerTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/SaveHandlerTest.php @@ -11,9 +11,13 @@ use Magento\Catalog\Model\Product\Option; use Magento\Catalog\Model\Product\Option\Repository; use Magento\Catalog\Model\Product\Option\SaveHandler; +use Magento\Catalog\Model\ResourceModel\Product\Relation; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +/** + * Test for \Magento\Catalog\Model\Product\Option\SaveHandler. + */ class SaveHandlerTest extends TestCase { /** @@ -36,6 +40,14 @@ class SaveHandlerTest extends TestCase */ protected $optionRepository; + /** + * @var Relation|MockObject + */ + private $relationMock; + + /** + * @inheridoc + */ protected function setUp(): void { $this->entity = $this->getMockBuilder(Product::class) @@ -47,11 +59,19 @@ protected function setUp(): void $this->optionRepository = $this->getMockBuilder(Repository::class) ->disableOriginalConstructor() ->getMock(); + $this->relationMock = $this->getMockBuilder(Relation::class) + ->disableOriginalConstructor() + ->getMock(); - $this->model = new SaveHandler($this->optionRepository); + $this->model = new SaveHandler($this->optionRepository, $this->relationMock); } - public function testExecute() + /** + * Test for execute + * + * @return void + */ + public function testExecute(): void { $this->optionMock->expects($this->any())->method('getOptionId')->willReturn(5); $this->entity->expects($this->once())->method('getOptions')->willReturn([$this->optionMock]); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php index c14bb7f524d0..61bbaf94e9ff 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php @@ -21,6 +21,7 @@ use Magento\Store\Model\StoreManagerInterface; use Magento\Store\Model\Website; use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\MockObject\RuntimeException; use PHPUnit\Framework\TestCase; /** @@ -110,7 +111,7 @@ protected function setUp(): void $this->groupManagementMock->expects($this->any())->method('getAllCustomersGroup') ->willReturn($group); $this->tierPriceExtensionFactoryMock = $this->getMockBuilder(ProductTierPriceExtensionFactory::class) - ->setMethods(['create']) + ->onlyMethods(['create']) ->disableOriginalConstructor() ->getMock(); $this->model = $this->objectManagerHelper->getObject( @@ -182,9 +183,7 @@ function () { ); // create sample TierPrice objects that would be coming from a REST call - $tierPriceExtensionMock = $this->getMockBuilder(ProductTierPriceExtensionInterface::class) - ->setMethods(['getWebsiteId', 'setWebsiteId', 'getPercentageValue', 'setPercentageValue']) - ->getMockForAbstractClass(); + $tierPriceExtensionMock = $this->getProductTierPriceExtensionInterfaceMock(); $tierPriceExtensionMock->expects($this->any())->method('getWebsiteId')->willReturn($expectedWebsiteId); $tierPriceExtensionMock->expects($this->any())->method('getPercentageValue')->willReturn(null); $tp1 = $this->objectManagerHelper->getObject(TierPrice::class); @@ -226,9 +225,7 @@ function () { $this->assertEquals($tps[$i]->getQty(), $tpData['price_qty'], 'Qty does not match'); } - $tierPriceExtensionMock = $this->getMockBuilder(ProductTierPriceExtensionInterface::class) - ->setMethods(['getWebsiteId', 'setWebsiteId', 'getPercentageValue', 'setPercentageValue']) - ->getMockForAbstractClass(); + $tierPriceExtensionMock = $this->getProductTierPriceExtensionInterfaceMock(); $tierPriceExtensionMock->expects($this->any())->method('getPercentageValue')->willReturn(50); $tierPriceExtensionMock->expects($this->any())->method('setWebsiteId'); $this->tierPriceExtensionFactoryMock->expects($this->any()) @@ -289,9 +286,7 @@ function () { return $this->objectManagerHelper->getObject(TierPrice::class); } ); - $tierPriceExtensionMock = $this->getMockBuilder(ProductTierPriceExtensionInterface::class) - ->onlyMethods(['getPercentageValue', 'setPercentageValue']) - ->getMockForAbstractClass(); + $tierPriceExtensionMock = $this->getProductTierPriceExtensionInterfaceMock(); $tierPriceExtensionMock->method('getPercentageValue') ->willReturn(50); $this->tierPriceExtensionFactoryMock->method('create') @@ -299,4 +294,22 @@ function () { $this->assertInstanceOf(TierPrice::class, $this->model->getTierPrices($this->product)[0]); } + + /** + * Build ProductTierPriceExtensionInterface mock. + * + * @return MockObject + */ + private function getProductTierPriceExtensionInterfaceMock(): MockObject + { + $mockBuilder = $this->getMockBuilder(ProductTierPriceExtensionInterface::class) + ->disableOriginalConstructor(); + try { + $mockBuilder->addMethods(['getPercentageValue', 'setPercentageValue', 'setWebsiteId', 'getWebsiteId']); + } catch (RuntimeException $e) { + // ProductTierPriceExtensionInterface already generated and has all necessary methods. + } + + return $mockBuilder->getMock(); + } } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductIdLocatorTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductIdLocatorTest.php index a68eb3e652da..a0c682aa3e41 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductIdLocatorTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductIdLocatorTest.php @@ -13,7 +13,6 @@ use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; use Magento\Framework\EntityManager\EntityMetadataInterface; use Magento\Framework\EntityManager\MetadataPool; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -23,14 +22,19 @@ class ProductIdLocatorTest extends TestCase { /** - * @var MetadataPool|MockObject + * @var int */ - private $metadataPool; + private $idsLimit; /** - * @var CollectionFactory|MockObject + * @var string */ - private $collectionFactory; + private $linkField; + + /** + * @var Collection|MockObject + */ + private $collection; /** * @var ProductIdLocator @@ -38,79 +42,125 @@ class ProductIdLocatorTest extends TestCase private $model; /** - * Set up. - * - * @return void + * @inheritDoc */ protected function setUp(): void { - $this->metadataPool = $this->getMockBuilder(MetadataPool::class) - ->setMethods(['getMetadata']) - ->disableOriginalConstructor() - ->getMock(); - $this->collectionFactory = $this - ->getMockBuilder(CollectionFactory::class) + $metadataPool = $this->createMock(MetadataPool::class); + $collectionFactory = $this->getMockBuilder(CollectionFactory::class) ->setMethods(['create']) ->disableOriginalConstructor() ->getMock(); + $this->idsLimit = 4; - $objectManager = new ObjectManager($this); - $this->model = $objectManager->getObject( - ProductIdLocator::class, - [ - 'metadataPool' => $this->metadataPool, - 'collectionFactory' => $this->collectionFactory, - ] - ); + $this->linkField = 'entity_id'; + $metaDataInterface = $this->createMock(EntityMetadataInterface::class); + $metaDataInterface->method('getLinkField') + ->willReturn($this->linkField); + $metadataPool->method('getMetadata') + ->with(ProductInterface::class) + ->willReturn($metaDataInterface); + + $this->collection = $this->createMock(Collection::class); + $collectionFactory->method('create') + ->willReturn($this->collection); + + $this->model = new ProductIdLocator($metadataPool, $collectionFactory, $this->idsLimit); } - /** - * Test retrieve - */ public function testRetrieveProductIdsBySkus() { $skus = ['sku_1', 'sku_2']; - $collection = $this->getMockBuilder(Collection::class) - ->setMethods( - [ - 'getItems', - 'addFieldToFilter', - 'setPageSize', - 'getLastPageNumber', - 'setCurPage', - 'clear' - ] - ) - ->disableOriginalConstructor() - ->getMock(); + $product = $this->getMockBuilder(ProductInterface::class) ->setMethods(['getSku', 'getData', 'getTypeId']) ->disableOriginalConstructor() ->getMockForAbstractClass(); - $metaDataInterface = $this->getMockBuilder(EntityMetadataInterface::class) - ->setMethods(['getLinkField']) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - $this->collectionFactory->expects($this->once())->method('create')->willReturn($collection); - $collection->expects($this->once())->method('addFieldToFilter') - ->with(ProductInterface::SKU, ['in' => $skus])->willReturnSelf(); - $collection->expects($this->atLeastOnce())->method('getItems')->willReturn([$product]); - $collection->expects($this->atLeastOnce())->method('setPageSize')->willReturnSelf(); - $collection->expects($this->atLeastOnce())->method('getLastPageNumber')->willReturn(1); - $collection->expects($this->atLeastOnce())->method('setCurPage')->with(1)->willReturnSelf(); - $collection->expects($this->atLeastOnce())->method('clear')->willReturnSelf(); - $this->metadataPool - ->expects($this->once()) - ->method('getMetadata') - ->with(ProductInterface::class) - ->willReturn($metaDataInterface); - $metaDataInterface->expects($this->once())->method('getLinkField')->willReturn('entity_id'); - $product->expects($this->once())->method('getSku')->willReturn('sku_1'); - $product->expects($this->once())->method('getData')->with('entity_id')->willReturn(1); - $product->expects($this->once())->method('getTypeId')->willReturn('simple'); + $product->method('getSku') + ->willReturn('sku_1'); + $product->method('getData') + ->with($this->linkField) + ->willReturn(1); + $product->method('getTypeId') + ->willReturn('simple'); + + $this->collection->expects($this->once()) + ->method('addFieldToFilter') + ->with(ProductInterface::SKU, ['in' => $skus]) + ->willReturnSelf(); + $this->collection->expects($this->atLeastOnce()) + ->method('getItems') + ->willReturn([$product]); + $this->collection->expects($this->atLeastOnce()) + ->method('setPageSize') + ->willReturnSelf(); + $this->collection->expects($this->atLeastOnce()) + ->method('getLastPageNumber') + ->willReturn(1); + $this->collection->expects($this->atLeastOnce()) + ->method('setCurPage') + ->with(1) + ->willReturnSelf(); + $this->collection->expects($this->atLeastOnce()) + ->method('clear') + ->willReturnSelf(); + $this->assertEquals( ['sku_1' => [1 => 'simple']], $this->model->retrieveProductIdsBySkus($skus) ); } + + public function testRetrieveProductIdsWithNumericSkus() + { + $skus = ['111', '222', '333', '444', '555']; + $products = []; + foreach ($skus as $sku) { + $product = $this->getMockBuilder(ProductInterface::class) + ->setMethods(['getSku', 'getData', 'getTypeId']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $product->method('getSku') + ->willReturn($sku); + $product->method('getData') + ->with($this->linkField) + ->willReturn((int) $sku); + $product->method('getTypeId') + ->willReturn('simple'); + $products[] = $product; + } + + $this->collection->expects($this->atLeastOnce()) + ->method('addFieldToFilter') + ->withConsecutive([ProductInterface::SKU, ['in' => $skus]], [ProductInterface::SKU, ['in' => ['1']]]) + ->willReturnSelf(); + $this->collection->expects($this->atLeastOnce()) + ->method('getItems') + ->willReturnOnConsecutiveCalls($products, []); + $this->collection->expects($this->atLeastOnce()) + ->method('setPageSize') + ->willReturnSelf(); + $this->collection->expects($this->atLeastOnce()) + ->method('getLastPageNumber') + ->willReturn(1); + $this->collection->expects($this->atLeastOnce()) + ->method('setCurPage') + ->with(1) + ->willReturnSelf(); + $this->collection->expects($this->atLeastOnce()) + ->method('clear') + ->willReturnSelf(); + + $this->assertEquals( + [ + '111' => [111 => 'simple'], + '222' => [222 => 'simple'], + '333' => [333 => 'simple'], + '444' => [444 => 'simple'], + '555' => [555 => 'simple'], + ], + $this->model->retrieveProductIdsBySkus($skus) + ); + $this->assertEmpty($this->model->retrieveProductIdsBySkus(['1'])); + } } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php index 129873a067d9..6d690d79ac1e 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php @@ -220,7 +220,8 @@ protected function setUp(): void 'getStoreId', 'getMediaGalleryEntries', 'getExtensionAttributes', - 'getCategoryIds' + 'getCategoryIds', + 'getAttributes' ] ) ->disableOriginalConstructor() @@ -243,7 +244,8 @@ protected function setUp(): void 'save', 'getMediaGalleryEntries', 'getExtensionAttributes', - 'getCategoryIds' + 'getCategoryIds', + 'getAttributes' ] ) ->disableOriginalConstructor() @@ -852,6 +854,9 @@ public function testDeleteById() public function testGetList() { $searchCriteriaMock = $this->getMockForAbstractClass(SearchCriteriaInterface::class); + $searchCriteriaMock->expects($this->once()) + ->method('getFilterGroups') + ->willReturn([]); $collectionMock = $this->createMock(Collection::class); $this->collectionFactory->expects($this->once())->method('create')->willReturn($collectionMock); $this->product->method('getSku')->willReturn('simple'); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php index 42d0778daa4a..91313d4cd199 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php @@ -508,28 +508,17 @@ public function testGetStoreIds() /** * @dataProvider getSingleStoreIds * @param bool $isObjectNew + * @return void */ - public function testGetStoreSingleSiteModelIds( - bool $isObjectNew - ) { + public function testGetStoreSingleSiteModelIds(bool $isObjectNew): void + { $websiteIDs = [0 => 2]; - $this->model->setWebsiteIds( - !$isObjectNew ? $websiteIDs : array_flip($websiteIDs) - ); + $this->model->setWebsiteIds(!$isObjectNew ? $websiteIDs : array_flip($websiteIDs)); $this->model->isObjectNew($isObjectNew); - $this->storeManager->expects( - $this->exactly( - (int)!$isObjectNew - ) - ) - ->method('isSingleStoreMode') - ->willReturn(true); - - $this->website->expects( - $this->once() - )->method('getStoreIds') + $this->website->expects($this->once()) + ->method('getStoreIds') ->willReturn($websiteIDs); $this->assertEquals($websiteIDs, $this->model->getStoreIds()); @@ -1095,6 +1084,35 @@ public function testSaveAndDuplicate() $this->model->afterSave(); } + /** + * Test for save method behavior with type options + */ + public function testSaveWithoutTypeOptions() + { + $this->model->setCanSaveCustomOptions(false); + $this->model->setTypeHasOptions(true); + $this->model->setTypeHasRequiredOptions(true); + $this->configureSaveTest(); + $this->model->beforeSave(); + $this->model->afterSave(); + $this->assertTrue($this->model->getTypeHasOptions()); + $this->assertTrue($this->model->getTypeHasRequiredOptions()); + } + + /** + * Test for save method with provided options data + */ + public function testSaveWithProvidedRequiredOptions() + { + $this->model->setData("has_options", "1"); + $this->model->setData("required_options", "1"); + $this->configureSaveTest(); + $this->model->beforeSave(); + $this->model->afterSave(); + $this->assertTrue($this->model->getHasOptions()); + $this->assertTrue($this->model->getRequiredOptions()); + } + public function testGetIsSalableSimple() { $typeInstanceMock = diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/MediaImageDeleteProcessorTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/MediaImageDeleteProcessorTest.php new file mode 100644 index 000000000000..bfc113ce4160 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/MediaImageDeleteProcessorTest.php @@ -0,0 +1,200 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Test\Unit\Model\ResourceModel; + +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\ResourceModel\MediaImageDeleteProcessor; +use Magento\Catalog\Model\Product\Gallery\Processor; +use Magento\Catalog\Model\Product\Media\ConfigInterface as MediaConfig; +use Magento\Catalog\Model\ResourceModel\Product\Gallery; +use Magento\Framework\DataObject; +use Magento\Framework\Exception\FileSystemException; +use Magento\Framework\Filesystem; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Unit test for \Magento\Catalog\Model\ResourceModel\MediaImageDeleteProcessor + */ +class MediaImageDeleteProcessorTest extends TestCase +{ + /** + * Testable Object + * + * @var MediaImageDeleteProcessor + */ + private $mediaImageDeleteProcessor; + + /** + * @var ObjectManager|null + */ + private $objectManager; + + /** + * @var Product|MockObject + */ + private $productMock; + + /** + * @var MediaConfig|MockObject + */ + private $imageConfig; + + /** + * @var Filesystem|MockObject + */ + private $mediaDirectory; + + /** + * @var Processor|MockObject + */ + private $imageProcessor; + + /** + * @var Gallery|MockObject + */ + private $productGallery; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $this->objectManager = new ObjectManager($this); + + $this->productMock = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->setMethods(['getId', 'getMediaGalleryImages']) + ->getMock(); + + $this->imageConfig = $this->getMockBuilder(MediaConfig::class) + ->disableOriginalConstructor() + ->setMethods(['getBaseMediaUrl', 'getMediaUrl', 'getBaseMediaPath', 'getMediaPath']) + ->getMock(); + + $this->mediaDirectory = $this->getMockBuilder(Filesystem::class) + ->disableOriginalConstructor() + ->setMethods(['getRelativePath', 'isFile', 'delete']) + ->getMock(); + + $this->imageProcessor = $this->getMockBuilder(Processor::class) + ->disableOriginalConstructor() + ->setMethods(['removeImage']) + ->getMock(); + + $this->productGallery = $this->getMockBuilder(Gallery::class) + ->disableOriginalConstructor() + ->setMethods(['deleteGallery', 'countImageUses']) + ->getMock(); + + $this->mediaImageDeleteProcessor = $this->objectManager->getObject( + MediaImageDeleteProcessor::class, + [ + 'imageConfig' => $this->imageConfig, + 'mediaDirectory' => $this->mediaDirectory, + 'imageProcessor' => $this->imageProcessor, + 'productGallery' => $this->productGallery + ] + ); + } + + /** + * Test mediaImageDeleteProcessor execute method + * + * @dataProvider executeCategoryProductMediaDeleteDataProvider + * @param int $productId + * @param array $productImages + * @param bool $isValidFile + * @param bool $imageUsedBefore + */ + public function testExecuteCategoryProductMediaDelete( + int $productId, + array $productImages, + bool $isValidFile, + bool $imageUsedBefore + ): void { + $this->productMock->expects($this->any()) + ->method('getId') + ->willReturn($productId); + + $this->productMock->expects($this->any()) + ->method('getMediaGalleryImages') + ->willReturn($productImages); + + $this->mediaDirectory->expects($this->any()) + ->method('isFile') + ->willReturn($isValidFile); + + $this->mediaDirectory->expects($this->any()) + ->method('getRelativePath') + ->withConsecutive([$productImages[0]->getFile()], [$productImages[1]->getFile()]) + ->willReturnOnConsecutiveCalls($productImages[0]->getPath(), $productImages[1]->getPath()); + + $this->productGallery->expects($this->any()) + ->method('countImageUses') + ->willReturn($imageUsedBefore); + + $this->productGallery->expects($this->any()) + ->method('deleteGallery') + ->willReturnSelf(); + + $this->imageProcessor->expects($this->any()) + ->method('removeImage') + ->willReturnSelf(); + + $this->mediaImageDeleteProcessor->execute($this->productMock); + } + + /** + * @return array + */ + public function executeCategoryProductMediaDeleteDataProvider(): array + { + $imageDirectoryPath = '/media/dir1/dir2/catalog/product/'; + $image1FilePath = '/test/test1.jpg'; + $image2FilePath = '/test/test2.jpg'; + $productImages = [ + new DataObject([ + 'value_id' => 1, + 'file' => $image1FilePath, + 'media_type' => 'image', + 'path' => $imageDirectoryPath.$image1FilePath + ]), + new DataObject([ + 'value_id' => 2, + 'file' => $image2FilePath, + 'media_type' => 'image', + 'path' => $imageDirectoryPath.$image2FilePath + ]) + ]; + return [ + 'test image can be deleted with existing product and product images' => + [ + 12, + $productImages, + true, + false + ], + 'test image can not be deleted without valid product id' => + [ + 0, + $productImages, + true, + false + ], + 'test image can not be deleted without valid product images' => + [ + 12, + [new DataObject(['file' => null]), new DataObject(['file' => null])], + true, + false + ], + ]; + } +} diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/CollectionTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/CollectionTest.php index 2bf504369b8a..9a55e48cfb1b 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/CollectionTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/CollectionTest.php @@ -38,6 +38,7 @@ use Magento\Framework\Stdlib\DateTime\TimezoneInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Framework\Validator\UniversalFactory; +use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -93,6 +94,11 @@ class CollectionTest extends TestCase */ private $storeManager; + /** + * @var ProductLimitation|MockObject + */ + private $productLimitationMock; + /** * @var EntityFactory|MockObject */ @@ -192,7 +198,7 @@ protected function setUp(): void $this->entityMock->expects($this->any())->method('getTable')->willReturnArgument(0); $this->connectionMock->expects($this->atLeastOnce())->method('select')->willReturn($this->selectMock); - $productLimitationMock = $this->createMock( + $this->productLimitationMock = $this->createMock( ProductLimitation::class ); $productLimitationFactoryMock = $this->getMockBuilder( @@ -201,7 +207,7 @@ protected function setUp(): void ->setMethods(['create'])->getMock(); $productLimitationFactoryMock->method('create') - ->willReturn($productLimitationMock); + ->willReturn($this->productLimitationMock); $this->collection = $this->objectManager->getObject( Collection::class, [ @@ -432,4 +438,44 @@ public function testGetNewEmptyItem() $secondItem = $this->collection->getNewEmptyItem(); $this->assertEquals($firstItem, $secondItem); } + + /** + * Test to add website filter in admin area + */ + public function testAddWebsiteFilterOnAdminStore(): void + { + $websiteIds = [2]; + $websiteTable = 'catalog_product_website'; + $joinCondition = 'join condition'; + $this->productLimitationMock->expects($this->atLeastOnce()) + ->method('offsetSet') + ->with('website_ids', $websiteIds); + $this->productLimitationMock->method('offsetExists') + ->with('website_ids') + ->willReturn(true); + $this->productLimitationMock->method('offsetGet') + ->with('website_ids') + ->willReturn($websiteIds); + $this->connectionMock->expects($this->once()) + ->method('quoteInto') + ->with('product_website.website_id IN(?)', $websiteIds, 'int') + ->willReturn($joinCondition); + $this->selectMock->method('getPart')->with(Select::FROM)->willReturn([]); + /** @var AbstractEntity|MockObject $eavEntity */ + $eavEntity = $this->createMock(AbstractEntity::class); + $eavEntity->method('getTable') + ->with('catalog_product_website') + ->willReturn($websiteTable); + $this->selectMock->expects($this->once()) + ->method('join') + ->with( + ['product_website' => $websiteTable], + 'product_website.product_id = e.entity_id AND ' . $joinCondition, + [] + ); + + $this->collection->setEntity($eavEntity); + $this->collection->setStoreId(Store::DEFAULT_STORE_ID); + $this->collection->addWebsiteFilter($websiteIds); + } } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/Indexer/Price/BatchSizeCalculatorTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/Indexer/Price/BatchSizeCalculatorTest.php index 589bdf8dda07..d813bb0e5caa 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/Indexer/Price/BatchSizeCalculatorTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/Indexer/Price/BatchSizeCalculatorTest.php @@ -12,6 +12,7 @@ use Magento\Framework\Indexer\BatchSizeManagementInterface; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Magento\Framework\App\DeploymentConfig; class BatchSizeCalculatorTest extends TestCase { @@ -30,6 +31,11 @@ class BatchSizeCalculatorTest extends TestCase */ private $batchRowsCount; + /** + * @var DeploymentConfig|MockObject + */ + private $deploymentConfigMock; + protected function setUp(): void { $this->estimatorMock = $this->getMockForAbstractClass(BatchSizeManagementInterface::class); @@ -37,7 +43,8 @@ protected function setUp(): void $this->model = new BatchSizeCalculator( ['default' => $this->batchRowsCount], ['default' => $this->estimatorMock], - [] + [], + $this->createMock(DeploymentConfig::class) ); } diff --git a/app/code/Magento/Catalog/Ui/Component/Listing/Attribute/AbstractRepository.php b/app/code/Magento/Catalog/Ui/Component/Listing/Attribute/AbstractRepository.php index c7b339d5fac9..b1218c88264c 100644 --- a/app/code/Magento/Catalog/Ui/Component/Listing/Attribute/AbstractRepository.php +++ b/app/code/Magento/Catalog/Ui/Component/Listing/Attribute/AbstractRepository.php @@ -11,6 +11,11 @@ */ abstract class AbstractRepository implements RepositoryInterface { + /** + * @var \Magento\Catalog\Api\ProductAttributeRepositoryInterface + */ + private $productAttributeRepository; + /** * @var null|\Magento\Catalog\Api\Data\ProductAttributeInterface[] */ diff --git a/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php b/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php index 1e056d9f8d51..88edfc7b36cb 100644 --- a/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php +++ b/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php @@ -23,6 +23,11 @@ class Columns extends \Magento\Ui\Component\Listing\Columns */ protected $attributeRepository; + /** + * @var \Magento\Catalog\Ui\Component\ColumnFactory + */ + private $columnFactory; + /** * @var array */ diff --git a/app/code/Magento/Catalog/Ui/Component/Listing/Columns/Price.php b/app/code/Magento/Catalog/Ui/Component/Listing/Columns/Price.php index 53347db23f5a..c35dad5e37bd 100644 --- a/app/code/Magento/Catalog/Ui/Component/Listing/Columns/Price.php +++ b/app/code/Magento/Catalog/Ui/Component/Listing/Columns/Price.php @@ -24,6 +24,11 @@ class Price extends \Magento\Ui\Component\Listing\Columns\Column */ protected $localeCurrency; + /** + * @var \Magento\Store\Model\StoreManagerInterface + */ + private $storeManager; + /** * @param ContextInterface $context * @param UiComponentFactory $uiComponentFactory diff --git a/app/code/Magento/Catalog/Ui/Component/Listing/Columns/Thumbnail.php b/app/code/Magento/Catalog/Ui/Component/Listing/Columns/Thumbnail.php index 09c9782fc0e3..0ef5adf7a188 100644 --- a/app/code/Magento/Catalog/Ui/Component/Listing/Columns/Thumbnail.php +++ b/app/code/Magento/Catalog/Ui/Component/Listing/Columns/Thumbnail.php @@ -20,6 +20,16 @@ class Thumbnail extends \Magento\Ui\Component\Listing\Columns\Column const ALT_FIELD = 'name'; + /** + * @var \Magento\Catalog\Helper\Image + */ + private $imageHelper; + + /** + * @var \Magento\Framework\UrlInterface + */ + private $urlBuilder; + /** * @param ContextInterface $context * @param UiComponentFactory $uiComponentFactory diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php index 430b6c004e77..6915265b4881 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php @@ -165,7 +165,7 @@ protected function getFieldsForFieldset() $websitesList = $this->getWebsitesList(); $isNewProduct = !$this->locator->getProduct()->getId(); $tooltip = [ - 'link' => 'https://docs.magento.com/m2/ce/user_guide/configuration/scope.html', + 'link' => 'https://docs.magento.com/user-guide/configuration/scope.html', 'description' => __( 'If your Magento installation has multiple websites, ' . 'you can edit the scope to use the product on specific sites.' diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php index 298595b3d0f6..f4334bc25efd 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php @@ -25,58 +25,4 @@ protected function _productLimitationJoinPrice() $this->_productLimitationFilters->setUsePriceIndex(false); return $this->_productLimitationPrice(true); } - - /** - * Return approximately amount if too much entities. - * - * @return int|mixed - */ - public function getSize() - { - $sql = $this->getSelectCountSql(); - $possibleCount = $this->analyzeCount($sql); - - if ($possibleCount > 20000) { - return $possibleCount; - } - - return parent::getSize(); - } - - /** - * Analyze amount of entities in DB. - * - * @param $sql - * @return int|mixed - * @throws \Zend_Db_Statement_Exception - */ - private function analyzeCount($sql) - { - $results = $this->getConnection()->query('EXPLAIN ' . $sql)->fetchAll(); - $alias = $this->getMainTableAlias(); - - foreach ($results as $result) { - if ($result['table'] == $alias) { - return $result['rows']; - } - } - - return 0; - } - - /** - * Identify main table alias or its name if alias is not defined. - * - * @return string - * @throws \LogicException - */ - private function getMainTableAlias() - { - foreach ($this->getSelect()->getPart(\Magento\Framework\DB\Select::FROM) as $tableAlias => $tableMetadata) { - if ($tableMetadata['joinType'] == 'from') { - return $tableAlias; - } - } - throw new \LogicException("Main table cannot be identified."); - } } diff --git a/app/code/Magento/Catalog/ViewModel/Product/Checker/AddToCompareAvailability.php b/app/code/Magento/Catalog/ViewModel/Product/Checker/AddToCompareAvailability.php index 00bac7e61b5b..f486eed91da5 100644 --- a/app/code/Magento/Catalog/ViewModel/Product/Checker/AddToCompareAvailability.php +++ b/app/code/Magento/Catalog/ViewModel/Product/Checker/AddToCompareAvailability.php @@ -7,10 +7,10 @@ namespace Magento\Catalog\ViewModel\Product\Checker; -use Magento\Framework\View\Element\Block\ArgumentInterface; use Magento\Catalog\Api\Data\ProductInterface; -use Magento\CatalogInventory\Api\StockConfigurationInterface; use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\CatalogInventory\Api\StockConfigurationInterface; +use Magento\Framework\View\Element\Block\ArgumentInterface; /** * Check is available add to compare. @@ -39,25 +39,9 @@ public function __construct(StockConfigurationInterface $stockConfiguration) public function isAvailableForCompare(ProductInterface $product): bool { if ((int)$product->getStatus() !== Status::STATUS_DISABLED) { - return $this->isInStock($product) || $this->stockConfiguration->isShowOutOfStock(); + return $product->isSalable() || $this->stockConfiguration->isShowOutOfStock(); } return false; } - - /** - * Get is in stock status. - * - * @param ProductInterface $product - * @return bool - */ - private function isInStock(ProductInterface $product): bool - { - $quantityAndStockStatus = $product->getQuantityAndStockStatus(); - if (!$quantityAndStockStatus) { - return $product->isSalable(); - } - - return $quantityAndStockStatus['is_in_stock'] ?? false; - } } diff --git a/app/code/Magento/Catalog/ViewModel/Product/OptionsData.php b/app/code/Magento/Catalog/ViewModel/Product/OptionsData.php new file mode 100644 index 000000000000..a4b77ca89ee7 --- /dev/null +++ b/app/code/Magento/Catalog/ViewModel/Product/OptionsData.php @@ -0,0 +1,29 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\ViewModel\Product; + +use Magento\Framework\View\Element\Block\ArgumentInterface; +use Magento\Catalog\Model\Product; + +/** + * Product options data view model + */ +class OptionsData implements ArgumentInterface +{ + /** + * Returns options data array + * + * @param Product $product + * @return array + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function getOptionsData(Product $product) : array + { + return []; + } +} diff --git a/app/code/Magento/Catalog/etc/adminhtml/di.xml b/app/code/Magento/Catalog/etc/adminhtml/di.xml index 7d74ab38a856..8e17c61c3926 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/di.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/di.xml @@ -282,4 +282,12 @@ </argument> </arguments> </type> + <type name="Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Advanced"> + <arguments> + <argument name="disableScopeChangeList" xsi:type="array"> + <item name="sku" xsi:type="string">sku</item> + <item name="media_gallery" xsi:type="string">media_gallery</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Catalog/etc/adminhtml/system.xml b/app/code/Magento/Catalog/etc/adminhtml/system.xml index 4e10453f542b..a1b2202309d6 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/system.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/system.xml @@ -218,7 +218,7 @@ <field id="catalog_media_url_format" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1"> <label>Catalog media URL format</label> <source_model>Magento\Catalog\Model\Config\Source\Web\CatalogMediaUrlFormat</source_model> - <comment><![CDATA[Images should be optimized based on query parameters by your CDN or web server. Use the legacy mode for backward compatibility. <a href="https://docs.magento.com/m2/ee/user_guide/configuration/general/web.html#url-options">Learn more</a> about catalog URL formats.<br/><br/><strong style="color:red">Warning!</strong> If you switch back to legacy mode, you must <a href="https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/theme-images.html#resize-catalog-images">use the CLI to regenerate images</a>.]]></comment> + <comment><![CDATA[Images should be optimized based on query parameters by your CDN or web server. Use the legacy mode for backward compatibility. <a href="https://docs.magento.com/user-guide/configuration/general/web.html#url-options">Learn more</a> about catalog URL formats.<br/><br/><strong style="color:red">Warning!</strong> If you switch back to legacy mode, you must <a href="https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/themes/theme-images.html#resize-catalog-images">use the CLI to regenerate images</a>.]]></comment> </field> </group> </section> diff --git a/app/code/Magento/Catalog/etc/db_schema.xml b/app/code/Magento/Catalog/etc/db_schema.xml index ce34914a2f5d..f6a1dbe5e41a 100644 --- a/app/code/Magento/Catalog/etc/db_schema.xml +++ b/app/code/Magento/Catalog/etc/db_schema.xml @@ -13,7 +13,7 @@ <column xsi:type="smallint" name="attribute_set_id" unsigned="true" nullable="false" identity="false" default="0" comment="Attribute Set ID"/> <column xsi:type="varchar" name="type_id" nullable="false" length="32" default="simple" comment="Type ID"/> - <column xsi:type="varchar" name="sku" nullable="true" length="64" comment="SKU"/> + <column xsi:type="varchar" name="sku" nullable="false" length="64" comment="SKU"/> <column xsi:type="smallint" name="has_options" unsigned="false" nullable="false" identity="false" default="0" comment="Has Options"/> <column xsi:type="smallint" name="required_options" unsigned="true" nullable="false" @@ -1693,7 +1693,7 @@ <constraint xsi:type="foreign" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_ENTT_ID_CAT_PRD_ENTT_ENTT_ID" table="catalog_product_entity_media_gallery_value_to_entity" column="entity_id" referenceTable="catalog_product_entity" referenceColumn="entity_id" onDelete="CASCADE"/> - <constraint xsi:type="unique" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_VAL_ID_ENTT_ID"> + <constraint xsi:type="primary" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_VAL_ID_ENTT_ID"> <column name="value_id"/> <column name="entity_id"/> </constraint> diff --git a/app/code/Magento/Catalog/etc/db_schema_whitelist.json b/app/code/Magento/Catalog/etc/db_schema_whitelist.json index efc45112920e..fd332606bb22 100644 --- a/app/code/Magento/Catalog/etc/db_schema_whitelist.json +++ b/app/code/Magento/Catalog/etc/db_schema_whitelist.json @@ -1020,6 +1020,7 @@ "entity_id": true }, "constraint": { + "PRIMARY": true, "FK_A6C6C8FAA386736921D3A7C4B50B1185": true, "CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_ENTT_ID_CAT_PRD_ENTT_ENTT_ID": true, "CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_VAL_ID_ENTT_ID": true diff --git a/app/code/Magento/Catalog/etc/di.xml b/app/code/Magento/Catalog/etc/di.xml index 8a116282e257..b509debe7bae 100644 --- a/app/code/Magento/Catalog/etc/di.xml +++ b/app/code/Magento/Catalog/etc/di.xml @@ -1319,4 +1319,13 @@ </argument> </arguments> </type> + <type name="Magento\Catalog\Model\Product\Configuration\Item\ItemResolverComposite"> + <arguments> + <argument name="itemResolvers" xsi:type="array"/> + </arguments> + </type> + <type name="Magento\Catalog\Api\ProductRepositoryInterface"> + <plugin name="remove_images_from_gallery_after_removing_product" + type="Magento\Catalog\Plugin\RemoveImagesFromGalleryAfterRemovingProduct"/> + </type> </config> diff --git a/app/code/Magento/Catalog/etc/webapi_rest/di.xml b/app/code/Magento/Catalog/etc/webapi_rest/di.xml index 1fd47fde304e..a33c3a19e1e4 100644 --- a/app/code/Magento/Catalog/etc/webapi_rest/di.xml +++ b/app/code/Magento/Catalog/etc/webapi_rest/di.xml @@ -40,4 +40,8 @@ <argument name="deserializer" xsi:type="object">Magento\Catalog\Model\Product\Webapi\Rest\RequestTypeBasedDeserializer</argument> </arguments> </type> + <type name="Magento\Catalog\Api\ProductLinkRepositoryInterface"> + <plugin name="reindex_after_save_product_links" type="Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface\ReindexAfterSaveProductLinksPlugin"/> + <plugin name="reindex_after_delete_by_id_product_links" type="Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface\ReindexAfterDeleteByIdProductLinksPlugin"/> + </type> </config> diff --git a/app/code/Magento/Catalog/etc/webapi_soap/di.xml b/app/code/Magento/Catalog/etc/webapi_soap/di.xml index a709f23d8c12..03671ba0bb2e 100644 --- a/app/code/Magento/Catalog/etc/webapi_soap/di.xml +++ b/app/code/Magento/Catalog/etc/webapi_soap/di.xml @@ -40,4 +40,8 @@ <argument name="deserializer" xsi:type="object">Magento\Framework\Webapi\Rest\Request\Deserializer\Xml</argument> </arguments> </type> + <type name="Magento\Catalog\Api\ProductLinkRepositoryInterface"> + <plugin name="reindex_after_save_product_links" type="Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface\ReindexAfterSaveProductLinksPlugin"/> + <plugin name="reindex_after_delete_by_id_product_links" type="Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface\ReindexAfterDeleteByIdProductLinksPlugin"/> + </type> </config> diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/options.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/options.phtml index e5f8a360c334..7ae3a2ade655 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/options.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/options.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Eav\Block\Adminhtml\Attribute\Edit\Options\Options */ $stores = $block->getStoresSortedBySortOrder(); diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/attribute_set.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/attribute_set.phtml index 261de795f719..e4f3dba6f984 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/attribute_set.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/attribute_set.phtml @@ -5,6 +5,7 @@ */ // phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /* @var $block \Magento\Catalog\Block\Adminhtml\Product\Edit\AttributeSet */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/option.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/option.phtml index ce7dac70010b..6848e6f269bc 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/option.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/option.phtml @@ -5,6 +5,7 @@ */ // phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Option */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/date.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/date.phtml index 2063609bf056..748f7d229dbb 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/date.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/date.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound ?> <?php /** @var $block \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Type\Date */ ?> <script id="custom-option-date-type-template" type="text/x-magento-template"> diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/file.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/file.phtml index c0e61c5de998..92178052f0a9 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/file.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/file.phtml @@ -4,8 +4,9 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound +/** @var $block \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Type\File */ ?> -<?php /** @var $block \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Type\File */ ?> <script id="custom-option-file-type-template" type="text/x-magento-template"> <div id="product_option_<%- data.option_id %>_type_<%- data.group %>" class="fieldset"> <table class="data-table"> diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/select.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/select.phtml index c7ff03a08d95..fa648ead21a6 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/select.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/select.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound ?> <?php /** @var $block \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Type\Select */ ?> <script id="custom-option-select-type-template" type="text/x-magento-template"> diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/text.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/text.phtml index 89da5d633ef4..280bdb6a93c9 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/text.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/text.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound ?> <?php /** @var $block \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Type\Text */ ?> <script id="custom-option-text-type-template" type="text/x-magento-template"> diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/serializer.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/serializer.phtml index 0c1da98c7d85..acd14f591e21 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/serializer.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/serializer.phtml @@ -8,7 +8,11 @@ ?> // phpcs:disable Magento2.Security.InsecureFunction.DiscouragedWithAlternative -<?php $_id = 'id_' . md5(microtime()) ?> +<?php +// md5() here is not for cryptographic use. +// phpcs:ignore Magento2.Security.InsecureFunction +$_id = 'id_' . md5(microtime()) +?> <input type="hidden" name="<?= $block->escapeHtmlAttr($block->getInputElementName()) ?>" value="" diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/helper/gallery.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/helper/gallery.phtml index 94d71dbb5ab2..12cbcd7031e9 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/helper/gallery.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/helper/gallery.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Gallery\Content */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ $elementName = $block->getElement()->getName() . '[images]'; diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/product/edit/attribute/search.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/product/edit/attribute/search.phtml index f58e213b6077..bd6a846b49ba 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/product/edit/attribute/search.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/product/edit/attribute/search.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attributes\Search */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml index 88bb57871205..2cd2a15b0490 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml @@ -132,7 +132,7 @@ <settings> <addField>true</addField> <filter>text</filter> - <bodyTmpl>ui/grid/cells/html</bodyTmpl> + <bodyTmpl>Magento_Catalog/grid/cells/preserved</bodyTmpl> <label translate="true">Name</label> </settings> </column> @@ -155,7 +155,7 @@ <column name="sku" sortOrder="60"> <settings> <filter>text</filter> - <bodyTmpl>ui/grid/cells/html</bodyTmpl> + <bodyTmpl>Magento_Catalog/grid/cells/preserved</bodyTmpl> <label translate="true">SKU</label> </settings> </column> diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/form.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/form.js index 76aaddf55ac9..9f85c0f03217 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/form.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/form.js @@ -45,10 +45,10 @@ define([ content: data.message }); } else { - $(this.options.categoryIdSelector).val(data.id).change(); - $(this.options.categoryPathSelector).val(data.path).change(); - $(this.options.categoryParentSelector).val(data.parentId).change(); - $(this.options.categoryLevelSelector).val(data.level).change(); + $(this.options.categoryIdSelector).val(data.id).trigger('change'); + $(this.options.categoryPathSelector).val(data.path).trigger('change'); + $(this.options.categoryParentSelector).val(data.parentId).trigger('change'); + $(this.options.categoryLevelSelector).val(data.level).trigger('change'); } } }; diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product-attributes.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product-attributes.js index 31d4f7a76280..606f852b7247 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product-attributes.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product-attributes.js @@ -47,7 +47,7 @@ define([ closed: function () { var doc = self.iframe.get(0).document; - if (doc && $.isFunction(doc.execCommand)) { + if (doc && typeof doc.execCommand === 'function') { //IE9 break script loading but not execution on iframe removing doc.execCommand('stop'); self.iframe.remove(); diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js index 4040ff9d684f..9ec3c0a64000 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js @@ -47,10 +47,14 @@ define([ * Initialize object */ initialize: function () { - var self = this; + var self = this, + popupDialog = jQuery('#product_composite_configure'); this._initWindowElements(); jQuery.async('#product_composite_configure', function (el) { + if (el !== popupDialog[0]) { + el = popupDialog[0]; + } self.dialog = jQuery(el).modal({ title: jQuery.mage.__('Configure Product'), type: 'slide', @@ -60,7 +64,10 @@ define([ click: function () { self.onConfirmBtn(); } - }] + }], + closed: function () { + self.clean('window'); + }, }); }); }, @@ -402,6 +409,7 @@ define([ this.blockMsgError.innerHTML = response.message; this._showWindow(); + jQuery(this.blockForm).trigger('processStop'); return false; } } @@ -444,6 +452,13 @@ define([ } }, + /** + * Helper to find select element of currently confirmed item + */ + getCurrentConfirmedSelectElement: function () { + return $(this.confirmedCurrentId).getElementsByTagName('select'); + }, + /** * Helper to find qty of active form */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/custom-options.js b/app/code/Magento/Catalog/view/adminhtml/web/js/custom-options.js index 4d0448f8f2a1..56713c0c6f30 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/custom-options.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/custom-options.js @@ -437,7 +437,7 @@ define([ this.refreshSortableElements(); this.options.selectionItemCount[data.id] = parseInt(this.options.selectionItemCount[data.id], 10) + 1; - $('#' + this.options.fieldId + '_' + data.id + '_select_' + data['select_id'] + '_title').focus(); + $('#' + this.options.fieldId + '_' + data.id + '_select_' + data['select_id'] + '_title').trigger('focus'); }, /** diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/new-category-dialog.js b/app/code/Magento/Catalog/view/adminhtml/web/js/new-category-dialog.js index 480dc645e410..8c3b576b38b0 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/new-category-dialog.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/new-category-dialog.js @@ -75,7 +75,7 @@ define([ $('#new_category_name').val(enteredName); if (enteredName === '') { - $('#new_category_name').focus(); + $('#new_category_name').trigger('focus'); } $('#new_category_messages').html(''); }, @@ -88,7 +88,7 @@ define([ validationOptions.unhighlight($('#new_category_parent-suggest').get(0), validationOptions.errorClass, validationOptions.validClass || ''); newCategoryForm.validation('clearError'); - $('#category_ids-suggest').focus(); + $('#category_ids-suggest').trigger('focus'); }, buttons: [{ text: $.mage.__('Create Category'), @@ -118,7 +118,7 @@ define([ }, dataType: 'json', context: $('body') - }).success(function (data) { + }).done(function (data) { var $suggest; if (!data.error) { @@ -135,7 +135,7 @@ define([ } else { $('#new_category_messages').html(data.messages); } - }).complete( + }).always( function () { thisButton.prop('disabled', false); } diff --git a/app/code/Magento/Catalog/view/adminhtml/web/template/attributes/grid/paging.html b/app/code/Magento/Catalog/view/adminhtml/web/template/attributes/grid/paging.html index 0797843cbf22..fa694f148797 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/template/attributes/grid/paging.html +++ b/app/code/Magento/Catalog/view/adminhtml/web/template/attributes/grid/paging.html @@ -6,8 +6,8 @@ --> <ul class="admin__control-support-text attributes-summary"> <li class="attributes-selected"> - <span translate="'Selected Attributes\:'"/> - <span text="label"/> + <span translate="'Selected Attributes\:'"></span> + <span text="label"></span> </li> <li class="attributes-found"> <text args="totalRecords"/> records found diff --git a/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/frontend-input-select.html b/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/frontend-input-select.html index 8097273a7856..98229f2a5778 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/frontend-input-select.html +++ b/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/frontend-input-select.html @@ -17,7 +17,7 @@ optionsCaption: caption, optionsValue: 'value', optionsText: 'label'" -/> +></select> <div class="admin__field-note" if="$data.hints"> - <span translate="$data.hints[$data.value()]"/> + <span translate="$data.hints[$data.value()]"></span> </div> diff --git a/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/input.html b/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/input.html index f13f431c9594..83a52db96590 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/input.html +++ b/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/input.html @@ -17,4 +17,4 @@ id: uid, disabled: disabled }"/> -<label class="admin__field-error" if="error" attr="for: uid" text="error"/> \ No newline at end of file +<label class="admin__field-error" if="error" attr="for: uid" text="error"></label> diff --git a/app/code/Magento/Catalog/view/adminhtml/web/template/form/field.html b/app/code/Magento/Catalog/view/adminhtml/web/template/form/field.html index 205d08d748af..43b06e7f7ea2 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/template/form/field.html +++ b/app/code/Magento/Catalog/view/adminhtml/web/template/form/field.html @@ -9,7 +9,7 @@ css="$data.additionalClasses" attr="'data-index': index"> <label class="admin__field-label" if="$data.label" visible="$data.labelVisible" attr="for: uid"> - <span translate="label" attr="'data-config-scope': $data.scopeLabel"/> + <span translate="label" attr="'data-config-scope': $data.scopeLabel"></span> </label> <div class="admin__field-control" css="'_with-tooltip': $data.tooltip, '_with-reset': $data.showFallbackReset && $data.isDifferedFromDefault"> @@ -19,10 +19,10 @@ <render args="elementTmpl"/> <label class="admin__addon-prefix" if="addBefore()" attr="for: uid"> - <span text="addBefore()"/> + <span text="addBefore()"></span> </label> <label class="admin__addon-suffix" if="$data.addafter" attr="for: uid"> - <span text="addafter"/> + <span text="addafter"></span> </label> </div> @@ -30,13 +30,17 @@ <render args="fallbackResetTpl" if="$data.showFallbackReset && $data.isDifferedFromDefault"/> - <label class="admin__field-error" if="error" attr="for: uid" text="error"/> + <label class="admin__field-error" if="error" attr="for: uid" text="error"></label> <div class="admin__field-note" if="$data.notice" attr="id: noticeId"> - <span translate="notice"/> + <span translate="notice"></span> </div> - <div class="admin__additional-info" if="$data.additionalInfo" html="$data.additionalInfo"></div> + <!-- ko if: $data.additionalInfo --> + <!-- ko with: {additionalInfoUnsanitizedHtml: $data.additionalInfo} --> + <div class="admin__additional-info" html="additionalInfoUnsanitizedHtml"></div> + <!-- /ko --> + <!-- /ko --> <render args="$data.service.template" if="$data.hasService()"/> </div> diff --git a/app/code/Magento/Catalog/view/adminhtml/web/template/grid/cells/preserved.html b/app/code/Magento/Catalog/view/adminhtml/web/template/grid/cells/preserved.html new file mode 100644 index 000000000000..5dcaa9d6c706 --- /dev/null +++ b/app/code/Magento/Catalog/view/adminhtml/web/template/grid/cells/preserved.html @@ -0,0 +1,7 @@ +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<div class="data-grid-cell-content white-space-preserved" html="$col.getLabelUnsanitizedHtml($row())"></div> diff --git a/app/code/Magento/Catalog/view/adminhtml/web/template/image-preview.html b/app/code/Magento/Catalog/view/adminhtml/web/template/image-preview.html index bf17624517f2..5c344ba56f10 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/template/image-preview.html +++ b/app/code/Magento/Catalog/view/adminhtml/web/template/image-preview.html @@ -7,7 +7,7 @@ <div class="file-uploader-summary"> <div class="file-uploader-preview image-uploader-preview"> <a class="image-uploader-preview-link" attr="href: $parent.getFilePreview($file)" target="_blank"> - <div class="file-uploader-spinner image-uploader-spinner" /> + <div class="file-uploader-spinner image-uploader-spinner"></div> <img class="preview-image" tabindex="0" @@ -26,12 +26,12 @@ attr="title: $t('Delete image')" disable="$parent.disabled" click="$parent.removeFile.bind($parent, $file)"> - <span translate="'Delete image'"/> + <span translate="'Delete image'"></span> </button> </div> </div> - <div class="file-uploader-filename" text="$file.name"/> + <div class="file-uploader-filename" text="$file.name"></div> <div class="file-uploader-meta"> <text args="$file.previewWidth"/>x<text args="$file.previewHeight"/>, <text args="$parent.formatSize($file.size)"/> diff --git a/app/code/Magento/Catalog/view/base/web/js/price-box.js b/app/code/Magento/Catalog/view/base/web/js/price-box.js index 6ca7f24b90c3..7028e42cc459 100644 --- a/app/code/Magento/Catalog/view/base/web/js/price-box.js +++ b/app/code/Magento/Catalog/view/base/web/js/price-box.js @@ -24,6 +24,7 @@ define([ $.widget('mage.priceBox', { options: globalOptions, + qtyInfo: '#qty', /** * Widget initialisation. @@ -49,6 +50,7 @@ define([ box.on('reloadPrice', this.reloadPrice.bind(this)); box.on('updatePrice', this.onUpdatePrice.bind(this)); + $(this.qtyInfo).on('input', this.updateProductTierPrice.bind(this)); box.trigger('price-box-initialized'); }, @@ -101,9 +103,9 @@ define([ priceValue.adjustments = priceValue.adjustments || {}; additionalPrice[priceCode] = additionalPrice[priceCode] || { - 'amount': 0, - 'adjustments': {} - }; + 'amount': 0, + 'adjustments': {} + }; additionalPrice[priceCode].amount = 0 + (additionalPrice[priceCode].amount || 0) + priceValue.amount; _.each(priceValue.adjustments, function (adValue, adCode) { @@ -131,6 +133,7 @@ define([ }, this); } + this.element.trigger('priceUpdated', this.cache.displayPrices); this.element.trigger('reloadPrice'); }, @@ -214,6 +217,31 @@ define([ if (config && config.prices) { this.options.prices = config.prices; } + }, + + /** + * Updates product final price according to tier prices + */ + updateProductTierPrice: function updateProductTierPrice() { + var productQty = $(this.qtyInfo).val(), + originalPrice = this.options.prices.finalPrice.amount, + tierPrice, + prices, + i; + + for (i = 0; i < this.options.priceConfig.tierPrices.length; i++) { + if (productQty >= this.options.priceConfig.tierPrices[i].qty) { + tierPrice = this.options.priceConfig.tierPrices[i].price; + } + } + prices = { + 'prices': { + 'finalPrice': { + 'amount': tierPrice - originalPrice + } + } + }; + this.updatePrice(prices); } }); diff --git a/app/code/Magento/Catalog/view/base/web/js/product/addtocart-button.js b/app/code/Magento/Catalog/view/base/web/js/product/addtocart-button.js index 4baf082b37c0..f599d05ba5ea 100644 --- a/app/code/Magento/Catalog/view/base/web/js/product/addtocart-button.js +++ b/app/code/Magento/Catalog/view/base/web/js/product/addtocart-button.js @@ -55,6 +55,16 @@ define([ return row['is_salable']; }, + /** + * Depends on this option, stock status text can be "In stock" or "Out Of Stock" + * + * @param {Object} row + * @returns {Boolean} + */ + isAvailable: function (row) { + return row['is_available']; + }, + /** * Depends on this option, "Add to cart" button can be shown or hide. Depends on backend configuration * diff --git a/app/code/Magento/Catalog/view/base/web/js/product/list/columns/final-price.js b/app/code/Magento/Catalog/view/base/web/js/product/list/columns/final-price.js index b981c985eb10..2f5aa8e951fb 100644 --- a/app/code/Magento/Catalog/view/base/web/js/product/list/columns/final-price.js +++ b/app/code/Magento/Catalog/view/base/web/js/product/list/columns/final-price.js @@ -32,6 +32,16 @@ define([ return row['price_info']['formatted_prices']['final_price']; }, + /** + * UnsanitizedHtml version of getPrice. + * + * @param {Object} row + * @return {HTMLElement} final price html + */ + getPriceUnsanitizedHtml: function (row) { + return this.getPrice(row); + }, + /** * Get product regular price. * @@ -42,6 +52,16 @@ define([ return row['price_info']['formatted_prices']['regular_price']; }, + /** + * UnsanitizedHtml version of getRegularPrice. + * + * @param {Object} row + * @return {HTMLElement} regular price html + */ + getRegularPriceUnsanitizedHtml: function (row) { + return this.getRegularPrice(row); + }, + /** * Check if product has a price range. * @@ -82,6 +102,16 @@ define([ return row['price_info']['formatted_prices']['minimal_price']; }, + /** + * UnsanitizedHtml version of getMinimalPrice. + * + * @param {Object} row + * @return {HTMLElement} minimal price html + */ + getMinimalPriceUnsanitizedHtml: function (row) { + return this.getMinimalPrice(row); + }, + /** * Check if product is salable. * @@ -102,6 +132,16 @@ define([ return row['price_info']['formatted_prices']['max_price']; }, + /** + * UnsanitizedHtml version of getMaxPrice. + * + * @param {Object} row + * @return {HTMLElement} maximum price html + */ + getMaxPriceUnsanitizedHtml: function (row) { + return this.getMaxPrice(row); + }, + /** * Get product maximum regular price in case of price range and special price. * @@ -112,6 +152,16 @@ define([ return row['price_info']['formatted_prices']['max_regular_price']; }, + /** + * UnsanitizedHtml version of getMaxRegularPrice. + * + * @param {Object} row + * @return {HTMLElement} maximum regular price html + */ + getMaxRegularPriceUnsanitizedHtml: function (row) { + return this.getMaxRegularPrice(row); + }, + /** * Get product minimal regular price in case of price range and special price. * @@ -122,6 +172,16 @@ define([ return row['price_info']['formatted_prices']['min_regular_price']; }, + /** + * UnsanitizedHtml version of getMinRegularPrice. + * + * @param {Object} row + * @return {HTMLElement} minimal regular price html + */ + getMinRegularPriceUnsanitizedHtml: function (row) { + return this.getMinRegularPrice(row); + }, + /** * Get adjustments names and return as string. * @@ -141,6 +201,16 @@ define([ return row['price_info']['minimal_price']; }, + /** + * UnsanitizedHtml version of getMinimalPriceAmount + * + * @param {Object} row + * @return {Number} minimal price amount + */ + getMinimalPriceAmountUnsanitizedHtml: function (row) { + return this.getMinimalPriceAmount(row); + }, + /** * Get product minimal regular price as number in case of special price. * diff --git a/app/code/Magento/Catalog/view/base/web/js/product/name.js b/app/code/Magento/Catalog/view/base/web/js/product/name.js index d83d58f94edf..dad84ea52d70 100644 --- a/app/code/Magento/Catalog/view/base/web/js/product/name.js +++ b/app/code/Magento/Catalog/view/base/web/js/product/name.js @@ -5,11 +5,16 @@ define([ 'Magento_Ui/js/grid/columns/column', - 'Magento_Catalog/js/product/list/column-status-validator' -], function (Column, columnStatusValidator) { + 'Magento_Catalog/js/product/list/column-status-validator', + 'escaper' +], function (Column, columnStatusValidator, escaper) { 'use strict'; return Column.extend({ + defaults: { + allowedTags: ['div', 'span', 'b', 'strong', 'i', 'em', 'u', 'a'] + }, + /** * Depends on this option, product name can be shown or hide. Depends on backend configuration * @@ -17,6 +22,16 @@ define([ */ isAllowed: function () { return columnStatusValidator.isValid(this.source(), 'name', 'show_attributes'); + }, + + /** + * Name column. + * + * @param {String} label + * @returns {String} + */ + getNameUnsanitizedHtml: function (label) { + return escaper.escapeHtml(label, this.allowedTags); } }); }); diff --git a/app/code/Magento/Catalog/view/base/web/template/product/link.html b/app/code/Magento/Catalog/view/base/web/template/product/link.html index 2c70300f7aec..5a5db062214f 100644 --- a/app/code/Magento/Catalog/view/base/web/template/product/link.html +++ b/app/code/Magento/Catalog/view/base/web/template/product/link.html @@ -7,4 +7,4 @@ <a if="isAllowed()" class="product-item-link" attr="href: $row().url" - text="label"/> + text="label"></a> diff --git a/app/code/Magento/Catalog/view/base/web/template/product/list/listing.html b/app/code/Magento/Catalog/view/base/web/template/product/list/listing.html index ea0124f1c7c4..b156bf7e4a3b 100644 --- a/app/code/Magento/Catalog/view/base/web/template/product/list/listing.html +++ b/app/code/Magento/Catalog/view/base/web/template/product/list/listing.html @@ -9,7 +9,7 @@ <div class="block-title"> <strong role="heading" aria-level="2" - text="label"/> + text="label"></strong> </div> <div class="block-content"> <div css="'products-' + displayMode"> diff --git a/app/code/Magento/Catalog/view/base/web/template/product/name.html b/app/code/Magento/Catalog/view/base/web/template/product/name.html index d0e1cf0fb4e4..1a26b4dfdd8f 100644 --- a/app/code/Magento/Catalog/view/base/web/template/product/name.html +++ b/app/code/Magento/Catalog/view/base/web/template/product/name.html @@ -6,5 +6,5 @@ --> <strong if="isAllowed()" class="product-item-name"> - <a attr="href: $row().url" html="$col.getLabel($row())"/> + <a attr="href: $row().url" html="getNameUnsanitizedHtml($col.getLabel($row()))"></a> </strong> diff --git a/app/code/Magento/Catalog/view/base/web/template/product/price/max_price.html b/app/code/Magento/Catalog/view/base/web/template/product/price/max_price.html index b31d31b6fb68..66f8ccae91be 100644 --- a/app/code/Magento/Catalog/view/base/web/template/product/price/max_price.html +++ b/app/code/Magento/Catalog/view/base/web/template/product/price/max_price.html @@ -9,14 +9,14 @@ css="getAdjustmentCssClasses($row())"> <span if="label" class="price-label" - text="label"/> + text="label"></span> <span class="price-wrapper" css="priceWrapperCssClasses" attr="priceWrapperAttr" data-price-amount="" data-price-type="" - html="getMaxPrice($row())"/> + html="getMaxPriceUnsanitizedHtml($row())"></span> <each args="data: getAdjustments('max_price'), as: '$adj'"> <render args="$adj.getBody()"/> diff --git a/app/code/Magento/Catalog/view/base/web/template/product/price/max_regular_price.html b/app/code/Magento/Catalog/view/base/web/template/product/price/max_regular_price.html index c6ab5e40f6da..eb52446ee0c6 100644 --- a/app/code/Magento/Catalog/view/base/web/template/product/price/max_regular_price.html +++ b/app/code/Magento/Catalog/view/base/web/template/product/price/max_regular_price.html @@ -10,13 +10,13 @@ css="getAdjustmentCssClasses($row())"> <span if="label" class="price-label" - text="label"/> + text="label"></span> <span class="price-wrapper" css="priceWrapperCssClasses" attr="priceWrapperAttr" data-price-amount="" data-price-type="" - html="getMaxRegularPrice($row())"/> + html="getMaxRegularPriceUnsanitizedHtml($row())"></span> </span> </span> diff --git a/app/code/Magento/Catalog/view/base/web/template/product/price/minimal_price.html b/app/code/Magento/Catalog/view/base/web/template/product/price/minimal_price.html index 524cc13abbad..0c4f339f241c 100644 --- a/app/code/Magento/Catalog/view/base/web/template/product/price/minimal_price.html +++ b/app/code/Magento/Catalog/view/base/web/template/product/price/minimal_price.html @@ -8,11 +8,11 @@ <if args="useLinkForAsLowAs"> <a attr="href: $row().url" class="minimal-price-link" - html="getMinimalPrice($row())"/> + html="getMinimalPriceUnsanitizedHtml($row())"></a> </if> <ifnot args="useLinkForAsLowAs"> <span class="minimal-price-link" - html="getMinimalPrice($row())"/> + html="getMinimalPriceUnsanitizedHtml($row())"></span> </ifnot> </if> diff --git a/app/code/Magento/Catalog/view/base/web/template/product/price/minimal_regular_price.html b/app/code/Magento/Catalog/view/base/web/template/product/price/minimal_regular_price.html index 16db329e144c..2bb8e2af8510 100644 --- a/app/code/Magento/Catalog/view/base/web/template/product/price/minimal_regular_price.html +++ b/app/code/Magento/Catalog/view/base/web/template/product/price/minimal_regular_price.html @@ -10,13 +10,13 @@ css="getAdjustmentCssClasses($row())"> <span if="label" class="price-label" - text="label"/> + text="label"></span> <span class="price-wrapper" css="priceWrapperCssClasses" attr="priceWrapperAttr" data-price-amount="" data-price-type="" - html="getMinRegularPrice($row())"/> + html="getMinRegularPriceUnsanitizedHtml($row())"></span> </span> </span> diff --git a/app/code/Magento/Catalog/view/base/web/template/product/price/regular_price.html b/app/code/Magento/Catalog/view/base/web/template/product/price/regular_price.html index 396fa9440b4c..9926e525edd1 100644 --- a/app/code/Magento/Catalog/view/base/web/template/product/price/regular_price.html +++ b/app/code/Magento/Catalog/view/base/web/template/product/price/regular_price.html @@ -11,14 +11,14 @@ css="getAdjustmentCssClasses($row())"> <span if="label && hasSpecialPrice($row())" class="price-label" - text="label"/> + text="label"></span> <span class="price-wrapper" css="priceWrapperCssClasses" attr="priceWrapperAttr" data-price-amount="" data-price-type="" - html="getRegularPrice($row())"/> + html="getRegularPriceUnsanitizedHtml($row())"></span> <if args="!hasSpecialPrice($row())"> <each args="data: getAdjustments(), as: '$adj'"> diff --git a/app/code/Magento/Catalog/view/base/web/template/product/price/special_price.html b/app/code/Magento/Catalog/view/base/web/template/product/price/special_price.html index 9532be152c3f..92b8036e1e38 100644 --- a/app/code/Magento/Catalog/view/base/web/template/product/price/special_price.html +++ b/app/code/Magento/Catalog/view/base/web/template/product/price/special_price.html @@ -10,14 +10,14 @@ css="getAdjustmentCssClasses($row())"> <span if="label" class="price-label" - text="label"/> + text="label"></span> <span class="price-wrapper" css="priceWrapperCssClasses" attr="priceWrapperAttr" data-price-amount="" data-price-type="finalPrice" - html="getPrice($row())"/> + html="getPriceUnsanitizedHtml($row())"></span> <each args="data: getAdjustments(), as: '$adj'"> <render args="$adj.getBody()"/> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml index c4adcaf78501..5e7b7ba867c1 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml @@ -54,5 +54,10 @@ </arguments> <block class="Magento\Catalog\Block\Category\Rss\Link" name="rss.link" template="Magento_Catalog::category/rss.phtml"/> </referenceBlock> + <referenceBlock name="category.products.list"> + <arguments> + <argument name="viewModel" xsi:type="object">Magento\Catalog\ViewModel\Product\OptionsData</argument> + </arguments> + </referenceBlock> </body> </page> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/compare/list.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/compare/list.phtml index 0bea3ca03dee..b7d6e1f2079a 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/compare/list.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/compare/list.phtml @@ -73,12 +73,12 @@ action="<?= $block->escapeUrl($this->helper(Magento\Catalog\Helper\Product\Compare::class)->getAddToCartUrl($item)) ?>" method="post"> <?= $block->getBlockHtml('formkey') ?> - <button type="submit" class="action tocart primary"> + <button type="submit" class="action tocart primary" disabled> <span><?= $block->escapeHtml(__('Add to Cart')) ?></span> </button> </form> <?php else :?> - <?php if ($item->getIsSalable()) :?> + <?php if ($item->isAvailable()) :?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> <?php else :?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> @@ -144,15 +144,13 @@ </tbody> </table> </div> - <?php if (!$block->isRedirectToCartEnabled()) :?> - <script type="text/x-magento-init"> - { - "[data-role=tocart-form]": { - "catalogAddToCart": {} - } + <script type="text/x-magento-init"> + { + "[data-role=tocart-form]": { + "catalogAddToCart": {} } - </script> - <?php endif; ?> + } + </script> <?php else :?> <div class="message info empty"><div><?= $block->escapeHtml(__('You have no items to compare.')) ?></div></div> <?php endif; ?> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list.phtml index 6a47978f1e5c..afd804591fec 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/list.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/list.phtml @@ -87,6 +87,12 @@ $_helper = $block->getData('outputHelper'); data-product-sku="<?= $escaper->escapeHtml($_product->getSku()) ?>" action="<?= $escaper->escapeUrl($postParams['action']) ?>" method="post"> + <?php $optionsData = $block->getData('viewModel')->getOptionsData($_product); ?> + <?php foreach ($optionsData as $optionItem): ?> + <input type="hidden" + name="<?= $escaper->escapeHtml($optionItem['name']) ?>" + value="<?= $escaper->escapeHtml($optionItem['value']) ?>"> + <?php endforeach; ?> <input type="hidden" name="product" value="<?= /* @noEscape */ $postParams['data']['product'] ?>"> @@ -153,16 +159,14 @@ $_helper = $block->getData('outputHelper'); <?php endforeach; ?> </ol> </div> - <?= $block->getToolbarHtml() ?> - <?php if (!$block->isRedirectToCartEnabled()): ?> - <script type="text/x-magento-init"> - { - "[data-role=tocart-form], .form.map.checkout": { - "catalogAddToCart": { - "product_sku": "<?= $escaper->escapeJs($_product->getSku()) ?>" - } + <?= $block->getChildBlock('toolbar')->setIsBottom(true)->toHtml() ?> + <script type="text/x-magento-init"> + { + "[data-role=tocart-form], .form.map.checkout": { + "catalogAddToCart": { + "product_sku": "<?= $escaper->escapeJs($_product->getSku()) ?>" } } - </script> - <?php endif; ?> + } + </script> <?php endif; ?> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml index e426b940deab..6fd619de7fd6 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml @@ -287,7 +287,7 @@ $_item = null; </form> <?php endif; ?> <?php else:?> - <?php if ($_item->getIsSalable()):?> + <?php if ($_item->isAvailable()):?> <div class="stock available"> <span><?= $block->escapeHtml(__('In stock')) ?></span> </div> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list/toolbar.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list/toolbar.phtml index 76ef6baf4993..3c8687d090ba 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/list/toolbar.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/list/toolbar.phtml @@ -10,27 +10,23 @@ * * @var $block \Magento\Catalog\Block\Product\ProductList\Toolbar */ - -// phpcs:disable Magento2.Security.IncludeFile.FoundIncludeFile -// phpcs:disable PSR2.Methods.FunctionCallSignature.SpaceBeforeOpenBracket ?> <?php if ($block->getCollection()->getSize()) :?> <?php $widget = $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonDecode($block->getWidgetOptionsJson()); $widgetOptions = $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonEncode($widget['productListToolbarForm']); ?> <div class="toolbar toolbar-products" data-mage-init='{"productListToolbarForm":<?= /* @noEscape */ $widgetOptions ?>}'> - <?php if ($block->isExpanded()) :?> - <?php include ($block->getTemplateFile('Magento_Catalog::product/list/toolbar/viewmode.phtml')) ?> - <?php endif; ?> - - <?php include ($block->getTemplateFile('Magento_Catalog::product/list/toolbar/amount.phtml')) ?> - - <?= $block->getPagerHtml() ?> - - <?php include ($block->getTemplateFile('Magento_Catalog::product/list/toolbar/limiter.phtml')) ?> - - <?php if ($block->isExpanded()) :?> - <?php include ($block->getTemplateFile('Magento_Catalog::product/list/toolbar/sorter.phtml')) ?> - <?php endif; ?> + <?php if ($block->getIsBottom()): ?> + <?= $block->getPagerHtml() ?> + <?= $block->fetchView($block->getTemplateFile('Magento_Catalog::product/list/toolbar/limiter.phtml')) ?> + <?php else: ?> + <?php if ($block->isExpanded()): ?> + <?= $block->fetchView($block->getTemplateFile('Magento_Catalog::product/list/toolbar/viewmode.phtml')) ?> + <?php endif ?> + <?= $block->fetchView($block->getTemplateFile('Magento_Catalog::product/list/toolbar/amount.phtml')) ?> + <?php if ($block->isExpanded()): ?> + <?= $block->fetchView($block->getTemplateFile('Magento_Catalog::product/list/toolbar/sorter.phtml')) ?> + <?php endif ?> + <?php endif ?> </div> <?php endif ?> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/listing.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/listing.phtml index 6cebd51284f4..49dd702a6e39 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/listing.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/listing.phtml @@ -63,7 +63,7 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class); . ' data-mage-init=\'{ "redirectUrl": { "event": "click", url: "' . $block->escapeUrl($block->getAddToCartUrl($_product)) . '"} }\'>' . '<span>' . $block->escapeHtml(__('Add to Cart')) . '</span></button>'; } else { - $info['button'] = $_product->getIsSalable() ? '<div class="stock available"><span>' . $block->escapeHtml(__('In stock')) . '</span></div>' : + $info['button'] = $_product->isAvailable() ? '<div class="stock available"><span>' . $block->escapeHtml(__('In stock')) . '</span></div>' : '<div class="stock unavailable"><span>' . $block->escapeHtml(__('Out of stock')) . '</span></div>'; } diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/file.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/file.phtml index f5fd1c5aa64e..4385829a5bdc 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/file.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/file.phtml @@ -51,7 +51,7 @@ id="<?= /* @noEscape */ $_fileName ?>" class="product-custom-option<?= $_option->getIsRequire() ? ' required' : '' ?>" <?= $_fileExists ? 'disabled="disabled"' : '' ?> /> - <input type="hidden" name="<?= /* @noEscape */ $_fieldNameAction ?>" + <input type="hidden" class="product-custom-option" name="<?= /* @noEscape */ $_fieldNameAction ?>" value="<?= /* @noEscape */ $_fieldValueAction ?>" /> <?php if ($_option->getFileExtension()):?> <p class="note"> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/column/new_default_list.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/column/new_default_list.phtml index 53a0682311b1..fce91564c96a 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/column/new_default_list.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/column/new_default_list.phtml @@ -52,7 +52,7 @@ </button> <?php endif; ?> <?php else :?> - <?php if ($_product->getIsSalable()) :?> + <?php if ($_product->isAvailable()) :?> <div class="stock available" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>"> <span><?= $block->escapeHtml(__('In stock')) ?></span> </div> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/content/new_grid.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/content/new_grid.phtml index 5108c488aec1..66683ef328e0 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/content/new_grid.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/content/new_grid.phtml @@ -89,7 +89,7 @@ if ($exist = ($block->getProductCollection() && $block->getProductCollection()-> </button> <?php endif; ?> <?php else :?> - <?php if ($_item->getIsSalable()) :?> + <?php if ($_item->isAvailable()) :?> <div class="stock available"> <span><?= $block->escapeHtml(__('In stock')) ?></span> </div> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/content/new_list.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/content/new_list.phtml index 378cd49493a6..ceb32e78c7e4 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/content/new_list.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/content/new_list.phtml @@ -88,7 +88,7 @@ if ($exist = ($block->getProductCollection() && $block->getProductCollection()-> </button> <?php endif; ?> <?php else :?> - <?php if ($_item->getIsSalable()) :?> + <?php if ($_item->isAvailable()) :?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> <?php else :?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> diff --git a/app/code/Magento/Catalog/view/frontend/web/js/zoom.js b/app/code/Magento/Catalog/view/frontend/web/js/zoom.js index 1c68818ed9c4..1305a9acac16 100644 --- a/app/code/Magento/Catalog/view/frontend/web/js/zoom.js +++ b/app/code/Magento/Catalog/view/frontend/web/js/zoom.js @@ -92,7 +92,7 @@ define([ }, this)); // Window resize will change offset for draggable - $(window).resize(this._draggableImage()); + $(window).on('resize', this._draggableImage); }, /** diff --git a/app/code/Magento/Catalog/view/frontend/web/template/product/addtocart-button.html b/app/code/Magento/Catalog/view/frontend/web/template/product/addtocart-button.html index 05dbf0270328..8755c7ec9103 100644 --- a/app/code/Magento/Catalog/view/frontend/web/template/product/addtocart-button.html +++ b/app/code/Magento/Catalog/view/frontend/web/template/product/addtocart-button.html @@ -11,14 +11,14 @@ 'data-post': getDataPost($row()), title: getLabel()" type="button"> - <span text="getLabel()"/> + <span text="getLabel()"></span> </button> </if> - <ifnot args="isSalable($row())"> + <if args="isAvailable($row()) === false"> <div class="stock unavailable"> <text args="$t('Availability')"/> - <span translate="'Out of stock'"/> + <span translate="'Out of stock'"></span> </div> - </ifnot> + </if> </if> diff --git a/app/code/Magento/Catalog/view/frontend/web/template/product/addtocompare-button.html b/app/code/Magento/Catalog/view/frontend/web/template/product/addtocompare-button.html index 915fc1b3ac2f..dfab8c3af84a 100644 --- a/app/code/Magento/Catalog/view/frontend/web/template/product/addtocompare-button.html +++ b/app/code/Magento/Catalog/view/frontend/web/template/product/addtocompare-button.html @@ -8,6 +8,6 @@ <button attr="'data-post': $col.getDataPost($row()), title: getLabel()" class="action tocompare" data-action="add-to-compare"> - <span text="getLabel()"/> + <span text="getLabel()"></span> </button> </if> diff --git a/app/code/Magento/CatalogAnalytics/README.md b/app/code/Magento/CatalogAnalytics/README.md index 0c4ee155c4f2..bfea74e7ddd8 100644 --- a/app/code/Magento/CatalogAnalytics/README.md +++ b/app/code/Magento/CatalogAnalytics/README.md @@ -1,3 +1,3 @@ # Magento_CatalogAnalytics module -The Magento_CatalogAnalytics module configures data definitions for a data collection related to the Catalog module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.3/advanced-reporting/modules.html). +The Magento_CatalogAnalytics module configures data definitions for a data collection related to the Catalog module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html). diff --git a/app/code/Magento/CatalogCustomerGraphQl/Model/Resolver/PriceTiers.php b/app/code/Magento/CatalogCustomerGraphQl/Model/Resolver/PriceTiers.php index efba88ff154b..3c6cc849081e 100644 --- a/app/code/Magento/CatalogCustomerGraphQl/Model/Resolver/PriceTiers.php +++ b/app/code/Magento/CatalogCustomerGraphQl/Model/Resolver/PriceTiers.php @@ -19,7 +19,6 @@ use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Framework\Pricing\PriceCurrencyInterface; -use Magento\Store\Api\Data\StoreInterface; /** * Resolver for price_tiers @@ -125,6 +124,10 @@ public function resolve( return []; } + if (!$product->getTierPrices()) { + return []; + } + $productId = (int)$product->getId(); $this->tiers->addProductFilter($productId); @@ -152,7 +155,8 @@ private function formatAndFilterTierPrices( array $tierPrices, string $currencyCode ): array { - + $this->formatAndFilterTierPrices = []; + $this->tierPricesQty = []; foreach ($tierPrices as $key => $tierPrice) { $tierPrice->setValue($this->priceCurrency->convertAndRound($tierPrice->getValue())); $this->formatTierPrices($productPrice, $currencyCode, $tierPrice); diff --git a/app/code/Magento/CatalogCustomerGraphQl/composer.json b/app/code/Magento/CatalogCustomerGraphQl/composer.json index a7c887af0379..ce80ee602327 100644 --- a/app/code/Magento/CatalogCustomerGraphQl/composer.json +++ b/app/code/Magento/CatalogCustomerGraphQl/composer.json @@ -7,8 +7,7 @@ "magento/framework": "*", "magento/module-catalog": "*", "magento/module-customer": "*", - "magento/module-catalog-graph-ql": "*", - "magento/module-store": "*" + "magento/module-catalog-graph-ql": "*" }, "license": [ "OSL-3.0", diff --git a/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/AttributeOptionProvider.php b/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/AttributeOptionProvider.php index d46776bfe498..978e4f6b406d 100644 --- a/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/AttributeOptionProvider.php +++ b/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/AttributeOptionProvider.php @@ -8,6 +8,7 @@ namespace Magento\CatalogGraphQl\DataProvider\Product\LayeredNavigation; use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Select; use Magento\Store\Model\Store; /** @@ -62,6 +63,7 @@ public function getOptions(array $optionIds, ?int $storeId, array $attributeCode 'attribute_id' => 'a.attribute_id', 'attribute_code' => 'a.attribute_code', 'attribute_label' => 'a.frontend_label', + 'position' => 'attribute_configuration.position' ] ) ->joinLeft( @@ -71,6 +73,11 @@ public function getOptions(array $optionIds, ?int $storeId, array $attributeCode 'attribute_store_label' => 'attribute_label.value', ] ) + ->joinLeft( + ['attribute_configuration' => $this->resourceConnection->getTableName('catalog_eav_attribute')], + 'a.attribute_id = attribute_configuration.attribute_id', + [] + ) ->joinLeft( ['options' => $this->resourceConnection->getTableName('eav_attribute_option')], 'a.attribute_id = options.attribute_id', @@ -95,6 +102,8 @@ public function getOptions(array $optionIds, ?int $storeId, array $attributeCode )->where( 'a.attribute_id = options.attribute_id AND option_value.store_id = ?', Store::DEFAULT_STORE_ID + )->order( + 'options.sort_order ' . Select::SQL_ASC ); $select->where('option_value.option_id IN (?)', $optionIds); @@ -112,11 +121,11 @@ public function getOptions(array $optionIds, ?int $storeId, array $attributeCode /** * Format result * - * @param \Magento\Framework\DB\Select $select + * @param Select $select * @return array * @throws \Zend_Db_Statement_Exception */ - private function formatResult(\Magento\Framework\DB\Select $select): array + private function formatResult(Select $select): array { $statement = $this->resourceConnection->getConnection()->query($select); @@ -128,10 +137,13 @@ private function formatResult(\Magento\Framework\DB\Select $select): array 'attribute_code' => $option['attribute_code'], 'attribute_label' => $option['attribute_store_label'] ? $option['attribute_store_label'] : $option['attribute_label'], + 'position' => $option['position'], 'options' => [], ]; } - $result[$option['attribute_code']]['options'][$option['option_id']] = $option['option_label']; + if (!empty($option['option_id'])) { + $result[$option['attribute_code']]['options'][$option['option_id']] = $option['option_label']; + } } return $result; diff --git a/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/Builder/Attribute.php b/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/Builder/Attribute.php index 5fce0fcdf3ca..afef26aad604 100644 --- a/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/Builder/Attribute.php +++ b/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/Builder/Attribute.php @@ -83,15 +83,16 @@ public function build(AggregationInterface $aggregation, ?int $storeId): array $result[$bucketName] = $this->layerFormatter->buildLayer( $attribute['attribute_label'] ?? $bucketName, \count($bucket->getValues()), - $attribute['attribute_code'] ?? $bucketName + $attribute['attribute_code'] ?? $bucketName, + isset($attribute['position']) ? $attribute['position'] : null ); - foreach ($bucket->getValues() as $value) { - $metrics = $value->getMetrics(); + $options = $this->getSortedOptions($bucket, isset($attribute['options']) ? $attribute['options'] : []); + foreach ($options as $option) { $result[$bucketName]['options'][] = $this->layerFormatter->buildItem( - $attribute['options'][$metrics['value']] ?? $metrics['value'], - $metrics['value'], - $metrics['count'] + $option['label'], + $option['value'], + $option['count'] ); } } @@ -161,4 +162,36 @@ function (AggregationValueInterface $value) { $attributes ); } + + /** + * Get sorted options + * + * @param BucketInterface $bucket + * @param array $optionLabels + * @return array + */ + private function getSortedOptions(BucketInterface $bucket, array $optionLabels): array + { + /** + * Option labels array has been sorted + */ + $options = $optionLabels; + foreach ($bucket->getValues() as $value) { + $metrics = $value->getMetrics(); + $optionValue = $metrics['value']; + $optionLabel = $optionLabels[$optionValue] ?? $optionValue; + $options[$optionValue] = $metrics + ['label' => $optionLabel]; + } + + /** + * Delete options without bucket values + */ + foreach ($options as $optionId => $option) { + if (!is_array($options[$optionId])) { + unset($options[$optionId]); + } + } + + return array_values($options); + } } diff --git a/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/Formatter/LayerFormatter.php b/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/Formatter/LayerFormatter.php index 48a1265b10fc..6df29fa25692 100644 --- a/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/Formatter/LayerFormatter.php +++ b/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/Formatter/LayerFormatter.php @@ -18,14 +18,16 @@ class LayerFormatter * @param string $layerName * @param string $itemsCount * @param string $requestName + * @param int $position * @return array */ - public function buildLayer($layerName, $itemsCount, $requestName): array + public function buildLayer($layerName, $itemsCount, $requestName, $position = null): array { return [ 'label' => $layerName, 'count' => $itemsCount, - 'attribute_code' => $requestName + 'attribute_code' => $requestName, + 'position' => isset($position) ? (int)$position : null ]; } diff --git a/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php b/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php index ab100c7272ba..356ff17183a5 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php +++ b/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php @@ -7,6 +7,7 @@ namespace Magento\CatalogGraphQl\Model\Category; +use GraphQL\Language\AST\Node; use GraphQL\Language\AST\FieldNode; use GraphQL\Language\AST\InlineFragmentNode; use GraphQL\Language\AST\NodeKind; @@ -26,22 +27,35 @@ class DepthCalculator */ public function calculate(ResolveInfo $resolveInfo, FieldNode $fieldNode) : int { - $selections = $fieldNode->selectionSet->selections ?? []; + return $this->calculateRecursive($resolveInfo, $fieldNode); + } + + /** + * Calculate recursive the total depth of a category tree inside a GraphQL request + * + * @param ResolveInfo $resolveInfo + * @param Node $node + * @return int + */ + private function calculateRecursive(ResolveInfo $resolveInfo, Node $node) : int + { + if ($node->kind === NodeKind::FRAGMENT_SPREAD) { + $selections = isset($resolveInfo->fragments[$node->name->value]) ? + $resolveInfo->fragments[$node->name->value]->selectionSet->selections : []; + } else { + $selections = $node->selectionSet->selections ?? []; + } $depth = count($selections) ? 1 : 0; $childrenDepth = [0]; - foreach ($selections as $node) { - if (isset($node->alias) && null !== $node->alias) { + foreach ($selections as $subNode) { + if (isset($subNode->alias) && null !== $subNode->alias) { continue; } - if ($node->kind === NodeKind::INLINE_FRAGMENT) { - $childrenDepth[] = $this->addInlineFragmentDepth($resolveInfo, $node); - } elseif ($node->kind === NodeKind::FRAGMENT_SPREAD && isset($resolveInfo->fragments[$node->name->value])) { - foreach ($resolveInfo->fragments[$node->name->value]->selectionSet->selections as $spreadNode) { - $childrenDepth[] = $this->calculate($resolveInfo, $spreadNode); - } + if ($subNode->kind === NodeKind::INLINE_FRAGMENT) { + $childrenDepth[] = $this->addInlineFragmentDepth($resolveInfo, $subNode); } else { - $childrenDepth[] = $this->calculate($resolveInfo, $node); + $childrenDepth[] = $this->calculateRecursive($resolveInfo, $subNode); } } diff --git a/app/code/Magento/CatalogGraphQl/Model/Category/ParentCategoryUidsArgsProcessor.php b/app/code/Magento/CatalogGraphQl/Model/Category/ParentCategoryUidsArgsProcessor.php new file mode 100644 index 000000000000..700b95d79990 --- /dev/null +++ b/app/code/Magento/CatalogGraphQl/Model/Category/ParentCategoryUidsArgsProcessor.php @@ -0,0 +1,69 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogGraphQl\Model\Category; + +use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\GraphQl\Query\Uid; +use Magento\Framework\GraphQl\Query\Resolver\ArgumentsProcessorInterface; + +/** + * Parent Category UID processor class for category uid and category id arguments + */ +class ParentCategoryUidsArgsProcessor implements ArgumentsProcessorInterface +{ + private const ID = 'parent_id'; + + private const UID = 'parent_category_uid'; + + /** @var Uid */ + private $uidEncoder; + + /** + * @param Uid $uidEncoder + */ + public function __construct(Uid $uidEncoder) + { + $this->uidEncoder = $uidEncoder; + } + + /** + * Composite processor that loops through available processors for arguments that come from graphql input + * + * @param string $fieldName, + * @param array $args + * @return array + * @throws GraphQlInputException + */ + public function process( + string $fieldName, + array $args + ): array { + $filterKey = 'filters'; + $parentUidFilter = $args[$filterKey][self::UID] ?? []; + $parentIdFilter = $args[$filterKey][self::ID] ?? []; + if (!empty($parentIdFilter) + && !empty($parentUidFilter) + && ($fieldName === 'categories' || $fieldName === 'categoryList')) { + throw new GraphQlInputException( + __('`%1` and `%2` can\'t be used at the same time.', [self::ID, self::UID]) + ); + } elseif (!empty($parentUidFilter)) { + if (isset($parentUidFilter['eq'])) { + $args[$filterKey][self::ID]['eq'] = $this->uidEncoder->decode( + $parentUidFilter['eq'] + ); + } elseif (!empty($parentUidFilter['in'])) { + foreach ($parentUidFilter['in'] as $parentUids) { + $args[$filterKey][self::ID]['in'][] = $this->uidEncoder->decode($parentUids); + } + } + unset($args[$filterKey][self::UID]); + } + return $args; + } +} diff --git a/app/code/Magento/CatalogGraphQl/Model/CategoryTypeResolver.php b/app/code/Magento/CatalogGraphQl/Model/CategoryTypeResolver.php new file mode 100755 index 000000000000..d4b7c644fe82 --- /dev/null +++ b/app/code/Magento/CatalogGraphQl/Model/CategoryTypeResolver.php @@ -0,0 +1,30 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogGraphQl\Model; + +use Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface; + +/** + * @inheritdoc + */ +class CategoryTypeResolver implements TypeResolverInterface +{ + const CATEGORY = 'CATEGORY'; + const TYPE_RESOLVER = 'CategoryTree'; + + /** + * @inheritdoc + */ + public function resolveType(array $data) : string + { + if (isset($data['type_id']) && $data['type_id'] == self::CATEGORY) { + return self::TYPE_RESOLVER; + } + return ''; + } +} diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoriesQuery.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoriesQuery.php index 0e653995ebca..86715623eb9f 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoriesQuery.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoriesQuery.php @@ -85,8 +85,9 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value throw new GraphQlInputException(__($e->getMessage())); } - $rootCategoryIds = $filterResult['category_ids']; - $filterResult['items'] = $this->fetchCategories($rootCategoryIds, $info); + $rootCategoryIds = $filterResult['category_ids'] ?? []; + + $filterResult['items'] = $this->fetchCategories($rootCategoryIds, $info, (int) $store->getId()); return $filterResult; } @@ -95,13 +96,14 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value * * @param array $categoryIds * @param ResolveInfo $info + * @param int $storeId * @return array */ - private function fetchCategories(array $categoryIds, ResolveInfo $info) + private function fetchCategories(array $categoryIds, ResolveInfo $info, int $storeId) { $fetchedCategories = []; foreach ($categoryIds as $categoryId) { - $categoryTree = $this->categoryTree->getTree($info, $categoryId); + $categoryTree = $this->categoryTree->getTree($info, $categoryId, $storeId); if (empty($categoryTree)) { continue; } diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryList.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryList.php index 747e05806a82..ee0ec69aaea7 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryList.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryList.php @@ -81,8 +81,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value } catch (InputException $e) { throw new GraphQlInputException(__($e->getMessage())); } - - return $this->fetchCategories($rootCategoryIds, $info); + return $this->fetchCategories($rootCategoryIds, $info, (int) $store->getId()); } /** @@ -90,13 +89,14 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value * * @param array $categoryIds * @param ResolveInfo $info + * @param int $storeId * @return array */ - private function fetchCategories(array $categoryIds, ResolveInfo $info) + private function fetchCategories(array $categoryIds, ResolveInfo $info, int $storeId) { $fetchedCategories = []; foreach ($categoryIds as $categoryId) { - $categoryTree = $this->categoryTree->getTree($info, $categoryId); + $categoryTree = $this->categoryTree->getTree($info, $categoryId, $storeId); if (empty($categoryTree)) { continue; } diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryTree.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryTree.php index 4284aed61084..cddba2e91f70 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryTree.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryTree.php @@ -71,7 +71,8 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value if ($rootCategoryId !== Category::TREE_ROOT_ID) { $this->checkCategoryIsActive->execute($rootCategoryId); } - $categoriesTree = $this->categoryTree->getTree($info, $rootCategoryId); + $store = $context->getExtensionAttributes()->getStore(); + $categoriesTree = $this->categoryTree->getTree($info, $rootCategoryId, (int)$store->getId()); if (empty($categoriesTree) || ($categoriesTree->count() == 0)) { throw new GraphQlNoSuchEntityException(__('Category doesn\'t exist')); diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/CustomizableDateTypeOptionValue.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/CustomizableDateTypeOptionValue.php new file mode 100644 index 000000000000..1b9583cc7239 --- /dev/null +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/CustomizableDateTypeOptionValue.php @@ -0,0 +1,42 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogGraphQl\Model\Resolver\Product; + +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; +use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; + +/** + * Format the option type value. + */ +class CustomizableDateTypeOptionValue implements ResolverInterface +{ + /** + * Resolver option code. + */ + private const OPTION_CODE = 'type'; + + /** + * Resolver enum type options to up case format. + * + * @param Field $field + * @param ContextInterface $context + * @param ResolveInfo $info + * @param array|null $value + * @param array|null $args + * + * @return string + */ + public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null): string + { + $dteType = $value[self::OPTION_CODE] ?? ''; + + return strtoupper($dteType); + } +} diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SpecialPrice.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SpecialPrice.php index c80cc3744876..954607f1f66e 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SpecialPrice.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SpecialPrice.php @@ -7,6 +7,7 @@ namespace Magento\CatalogGraphQl\Model\Resolver\Product; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; @@ -23,8 +24,13 @@ class SpecialPrice implements ResolverInterface */ public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null) { + if (!isset($value['model'])) { + throw new LocalizedException(__('"model" value should be specified')); + } + /** @var ProductInterface $product */ $product = $value['model']; + /** @var PricingSpecialPrice $specialPrice */ $specialPrice = $product->getPriceInfo()->getPrice(PricingSpecialPrice::PRICE_CODE); diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/CategoryTree.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/CategoryTree.php index c553d4486f9e..86ee717d1ba3 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/CategoryTree.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/CategoryTree.php @@ -80,9 +80,11 @@ public function __construct( * * @param ResolveInfo $resolveInfo * @param int $rootCategoryId + * @param int $storeId * @return \Iterator + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function getTree(ResolveInfo $resolveInfo, int $rootCategoryId): \Iterator + public function getTree(ResolveInfo $resolveInfo, int $rootCategoryId, int $storeId): \Iterator { $categoryQuery = $resolveInfo->fieldNodes[0]; $collection = $this->collectionFactory->create(); diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Deferred/Product.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Deferred/Product.php index 22bbc991a78e..8218c22b8056 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Deferred/Product.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Deferred/Product.php @@ -132,7 +132,7 @@ private function fetch() : array $this->searchCriteriaBuilder->create(), $this->attributeCodes, false, - true + false ); /** @var \Magento\Catalog\Model\Product $product */ diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/ExtractDataFromCategoryTree.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/ExtractDataFromCategoryTree.php index b38a2c9bb04d..e212f33a35d2 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/ExtractDataFromCategoryTree.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/ExtractDataFromCategoryTree.php @@ -67,7 +67,8 @@ public function execute(\Iterator $iterator): array $tree = $this->mergeCategoriesTrees($currentLevelTree, $tree); } } - return $tree; + + return $this->sortTree($tree); } /** @@ -141,4 +142,24 @@ private function explodePathToArray(array $pathElements, int $index): array } return $tree; } + + /** + * Recursive method to sort tree + * + * @param array $tree + * @return array + */ + private function sortTree(array $tree): array + { + foreach ($tree as &$node) { + if ($node['children']) { + uasort($node['children'], function ($element1, $element2) { + return $element1['position'] > $element2['position']; + }); + $node['children'] = $this->sortTree($node['children']); + } + } + + return $tree; + } } diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product.php index 3e955ae30345..30be41072242 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product.php @@ -89,7 +89,7 @@ public function getList( $this->collectionPreProcessor->process($collection, $searchCriteria, $attributes, $context); - if (!$isChildSearch) { + if ($isChildSearch) { $visibilityIds = $isSearch ? $this->visibility->getVisibleInSearchIds() : $this->visibility->getVisibleInCatalogIds(); diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/RequiredColumnsProcessor.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/RequiredColumnsProcessor.php index b545047d0154..721441cd08d6 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/RequiredColumnsProcessor.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/RequiredColumnsProcessor.php @@ -36,8 +36,8 @@ public function process( ContextInterface $context = null ): Collection { $collection->addAttributeToSelect('special_price'); - $collection->addAttributeToSelect('special_price_from'); - $collection->addAttributeToSelect('special_price_to'); + $collection->addAttributeToSelect('special_from_date'); + $collection->addAttributeToSelect('special_to_date'); $collection->addAttributeToSelect('tax_class_id'); return $collection; diff --git a/app/code/Magento/CatalogGraphQl/etc/di.xml b/app/code/Magento/CatalogGraphQl/etc/di.xml index 8c6fac0fe621..bb2a069d738e 100644 --- a/app/code/Magento/CatalogGraphQl/etc/di.xml +++ b/app/code/Magento/CatalogGraphQl/etc/di.xml @@ -72,6 +72,7 @@ <argument name="processors" xsi:type="array"> <item name="category_uid" xsi:type="object">Magento\CatalogGraphQl\Model\Resolver\Products\Query\CategoryUidArgsProcessor</item> <item name="category_uids" xsi:type="object">Magento\CatalogGraphQl\Model\Category\CategoryUidsArgsProcessor</item> + <item name="parent_category_uids" xsi:type="object">Magento\CatalogGraphQl\Model\Category\ParentCategoryUidsArgsProcessor</item> </argument> </arguments> </type> diff --git a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls index 79281ff42cf2..b1790f4bc628 100644 --- a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls @@ -49,6 +49,12 @@ enum PriceTypeEnum @doc(description: "This enumeration the price type.") { DYNAMIC } +enum CustomizableDateTypeEnum @doc(description: "This enumeration customizable date type.") { + DATE + DATE_TIME + TIME +} + type ProductPrices @doc(description: "ProductPrices is deprecated, replaced by PriceRange. The ProductPrices object contains the regular price of an item, as well as its minimum and maximum prices. Only composite products, which include bundle, configurable, and grouped products, can contain a minimum and maximum price.") { minimalPrice: Price @deprecated(reason: "Use PriceRange.minimum_price.") @doc(description: "The lowest possible final price for all the options defined within a composite product. If you are specifying a price range, this would be the from value.") maximalPrice: Price @deprecated(reason: "Use PriceRange.maximum_price.") @doc(description: "The highest possible final price for all the options defined within a composite product. If you are specifying a price range, this would be the to value.") @@ -136,7 +142,7 @@ type CustomizableAreaValue @doc(description: "CustomizableAreaValue defines the uid: ID! @doc(description: "The unique ID for a `CustomizableAreaValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") } -type CategoryTree implements CategoryInterface @doc(description: "Category Tree implementation.") { +type CategoryTree implements CategoryInterface, RoutableInterface @doc(description: "Category tree implementation") { children: [CategoryTree] @doc(description: "Child categories tree.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\CategoryTree") } @@ -154,6 +160,7 @@ type CustomizableDateOption implements CustomizableOptionInterface @doc(descript type CustomizableDateValue @doc(description: "CustomizableDateValue defines the price and sku of a product whose page contains a customized date picker.") { price: Float @doc(description: "The price assigned to this option.") price_type: PriceTypeEnum @doc(description: "FIXED, PERCENT, or DYNAMIC.") + type: CustomizableDateTypeEnum @doc(description: "DATE, DATE_TIME or TIME") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableDateTypeOptionValue") sku: String @doc(description: "The Stock Keeping Unit for this option.") uid: ID! @doc(description: "The unique ID for a `CustomizableDateValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") } @@ -301,10 +308,10 @@ type CustomizableCheckboxValue @doc(description: "CustomizableCheckboxValue defi uid: ID! @doc(description: "The unique ID for a `CustomizableCheckboxValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") } -type VirtualProduct implements ProductInterface, CustomizableProductInterface @doc(description: "A virtual product is non-tangible product that does not require shipping and is not kept in inventory.") { +type VirtualProduct implements ProductInterface, RoutableInterface, CustomizableProductInterface @doc(description: "A virtual product is a non-tangible product that does not require shipping and is not kept in inventory") { } -type SimpleProduct implements ProductInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "A simple product is tangible and are usually sold as single units or in fixed quantities.") +type SimpleProduct implements ProductInterface, RoutableInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "A simple product is tangible and is usually sold in single units or in fixed quantities") { } @@ -332,7 +339,8 @@ input CategoryFilterInput @doc(description: "CategoryFilterInput defines the fi { ids: FilterEqualTypeInput @deprecated(reason: "Use the `category_uid` argument instead.") @doc(description: "Deprecated: use 'category_uid' to filter uniquely identifiers of categories.") category_uid: FilterEqualTypeInput @doc(description: "Filter by the unique category ID for a `CategoryInterface` object.") - parent_id: FilterEqualTypeInput @doc(description: "Filter by the unique parent category ID for a `CategoryInterface` object.") + parent_id: FilterEqualTypeInput @deprecated @doc(description: "Filter by the unique parent category ID for a `CategoryInterface` object.") + parent_category_uid: FilterEqualTypeInput @doc(description: "Filter by the unique parent category ID for a `CategoryInterface` object.") url_key: FilterEqualTypeInput @doc(description: "Filter by the part of the URL that identifies the category.") name: FilterMatchTypeInput @doc(description: "Filter by the display name of the category.") url_path: FilterEqualTypeInput @doc(description: "Filter by the URL path for the category.") @@ -466,6 +474,7 @@ type Aggregation @doc(description: "A bucket that contains information for each label: String @doc(description: "The aggregation display name.") attribute_code: String! @doc(description: "Attribute code of the aggregation group.") options: [AggregationOption] @doc(description: "Array of options for the aggregation.") + position: Int @doc(description: "The relative position of the attribute in a layered navigation block") } interface AggregationOptionInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\AggregationOptionTypeResolverComposite") { diff --git a/app/code/Magento/CatalogImportExport/Model/Export/Product/WebsiteFilter.php b/app/code/Magento/CatalogImportExport/Model/Export/Product/WebsiteFilter.php new file mode 100644 index 000000000000..11ef78a8ca81 --- /dev/null +++ b/app/code/Magento/CatalogImportExport/Model/Export/Product/WebsiteFilter.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogImportExport\Model\Export\Product; + +use Magento\Catalog\Model\ResourceModel\Product\Collection; +use Magento\CatalogImportExport\Model\Export\ProductFilterInterface; + +/** + * Website filter for products export + */ +class WebsiteFilter implements ProductFilterInterface +{ + private const NAME = 'website_id'; + + /** + * @inheritDoc + */ + public function filter(Collection $collection, array $filters): Collection + { + if (!isset($filters[self::NAME])) { + return $collection; + } + + $collection->addWebsiteFilter($filters[self::NAME]); + + return $collection; + } +} diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 673dbcb3b3c9..d0c93658fc28 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -1855,7 +1855,7 @@ protected function _saveProducts() } $productTypeModel = $this->_productTypeModels[$productType]; - if (!empty($rowData['tax_class_name'])) { + if (isset($rowData['tax_class_name']) && strlen($rowData['tax_class_name'])) { $rowData['tax_class_id'] = $this->taxClassProcessor->upsertTaxClass($rowData['tax_class_name'], $productTypeModel); } diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product/LinkProcessor.php b/app/code/Magento/CatalogImportExport/Model/Import/Product/LinkProcessor.php index 22a83671f630..84cdc4608148 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product/LinkProcessor.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product/LinkProcessor.php @@ -220,7 +220,7 @@ private function deleteProductsLinks( if (!empty($linksToDelete) && Import::BEHAVIOR_APPEND === $importEntity->getBehavior()) { foreach ($linksToDelete as $linkTypeId => $productIds) { if (!empty($productIds)) { - $whereLinkId = $importEntity->getConnection()->quoteInto('link_type_id', $linkTypeId); + $whereLinkId = $importEntity->getConnection()->quoteInto('link_type_id = ?', $linkTypeId); $whereProductId = $importEntity->getConnection()->quoteInto( 'product_id IN (?)', array_unique($productIds) diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product/TaxClassProcessor.php b/app/code/Magento/CatalogImportExport/Model/Import/Product/TaxClassProcessor.php index af102cc50b8b..e068a0740482 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product/TaxClassProcessor.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product/TaxClassProcessor.php @@ -7,9 +7,25 @@ use Magento\CatalogImportExport\Model\Import\Product\Type\AbstractType; use Magento\Tax\Model\ClassModel; +use Magento\Tax\Model\ClassModelFactory; +use Magento\Tax\Model\ResourceModel\TaxClass\Collection; +use Magento\Tax\Model\ResourceModel\TaxClass\CollectionFactory; +/** + * Imported products tax class processor + */ class TaxClassProcessor { + /** + * Empty tax class name + */ + private const CLASS_NONE_NAME = 'none'; + + /** + * Empty tax class ID + */ + private const CLASS_NONE_ID = 0; + /** * Tax attribute code. */ @@ -25,24 +41,24 @@ class TaxClassProcessor /** * Instance of tax class collection factory. * - * @var \Magento\Tax\Model\ResourceModel\TaxClass\CollectionFactory + * @var CollectionFactory */ protected $collectionFactory; /** * Instance of tax model factory. * - * @var \Magento\Tax\Model\ClassModelFactory + * @var ClassModelFactory */ protected $classModelFactory; /** - * @param \Magento\Tax\Model\ResourceModel\TaxClass\CollectionFactory $collectionFactory - * @param \Magento\Tax\Model\ClassModelFactory $classModelFactory + * @param CollectionFactory $collectionFactory + * @param ClassModelFactory $classModelFactory */ public function __construct( - \Magento\Tax\Model\ResourceModel\TaxClass\CollectionFactory $collectionFactory, - \Magento\Tax\Model\ClassModelFactory $classModelFactory + CollectionFactory $collectionFactory, + ClassModelFactory $classModelFactory ) { $this->collectionFactory = $collectionFactory; $this->classModelFactory = $classModelFactory; @@ -59,9 +75,9 @@ protected function initTaxClasses() if (empty($this->taxClasses)) { $collection = $this->collectionFactory->create(); $collection->addFieldToFilter('class_type', ClassModel::TAX_CLASS_TYPE_PRODUCT); - /* @var $collection \Magento\Tax\Model\ResourceModel\TaxClass\Collection */ + /* @var $collection Collection */ foreach ($collection as $taxClass) { - $this->taxClasses[$taxClass->getClassName()] = $taxClass->getId(); + $this->taxClasses[mb_strtolower($taxClass->getClassName())] = $taxClass->getId(); } } return $this; @@ -76,7 +92,7 @@ protected function initTaxClasses() */ protected function createTaxClass($taxClassName, AbstractType $productTypeModel) { - /** @var \Magento\Tax\Model\ClassModelFactory $taxClass */ + /** @var ClassModelFactory $taxClass */ $taxClass = $this->classModelFactory->create(); $taxClass->setClassType(ClassModel::TAX_CLASS_TYPE_PRODUCT); $taxClass->setClassName($taxClassName); @@ -98,10 +114,22 @@ protected function createTaxClass($taxClassName, AbstractType $productTypeModel) */ public function upsertTaxClass($taxClassName, AbstractType $productTypeModel) { - if (!isset($this->taxClasses[$taxClassName])) { - $this->taxClasses[$taxClassName] = $this->createTaxClass($taxClassName, $productTypeModel); + $normalizedTaxClassName = mb_strtolower($taxClassName); + + if ($normalizedTaxClassName === (string) self::CLASS_NONE_ID) { + $normalizedTaxClassName = self::CLASS_NONE_NAME; + } + + if (!isset($this->taxClasses[$normalizedTaxClassName])) { + $this->taxClasses[$normalizedTaxClassName] = $normalizedTaxClassName === self::CLASS_NONE_NAME + ? self::CLASS_NONE_ID + : $this->createTaxClass($taxClassName, $productTypeModel); + } + if ($normalizedTaxClassName === self::CLASS_NONE_NAME) { + // Add None option to tax_class_id options. + $productTypeModel->addAttributeOption(self::ATRR_CODE, self::CLASS_NONE_ID, self::CLASS_NONE_ID); } - return $this->taxClasses[$taxClassName]; + return $this->taxClasses[$normalizedTaxClassName]; } } diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportAllProductsActionGroup.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportAllProductsActionGroup.xml index 3edbb1b82184..bceac07f2a64 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportAllProductsActionGroup.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportAllProductsActionGroup.xml @@ -12,13 +12,18 @@ <annotations> <description>Exports the unfiltered Products list. Validates that the Success Message is present.</description> </annotations> - + <arguments> + <argument name="fileFormat" defaultValue="CSV" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminExportMainSection.entityType}}" stepKey="waitForEntityTypeDropDown"/> <selectOption selector="{{AdminExportMainSection.entityType}}" userInput="Products" stepKey="selectProductsOption"/> - <waitForElementVisible selector="{{AdminExportMainSection.entityAttributes}}" stepKey="waitForElementVisible" time="5"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementVisible selector="{{AdminExportMainSection.entityAttributes}}" stepKey="waitForElementVisible"/> + <selectOption selector="{{AdminExportMainSection.fileFormat}}" userInput="{{fileFormat}}" stepKey="selectFileFormat"/> <scrollTo selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="scrollToContinue"/> - <wait stepKey="waitForScroll" time="5"/> + <waitForElementVisible selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="waitForScroll"/> <click selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="clickContinueButton"/> - <wait stepKey="waitForClick" time="5"/> - <see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue, wait to get your file soon. Make sure your cron job is running to export the file" stepKey="seeSuccessMessage"/> + <waitForPageLoad stepKey="waitForClick"/> + <waitForText userInput="Message is added to queue, wait to get your file soon. Make sure your cron job is running to export the file" selector="{{AdminMessagesSection.success}}" stepKey="seeSuccessMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportProductsFilterByAttributeActionGroup.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportProductsFilterByAttributeActionGroup.xml index f3ca89420289..f34236b49843 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportProductsFilterByAttributeActionGroup.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportProductsFilterByAttributeActionGroup.xml @@ -17,8 +17,9 @@ <argument name="attribute" type="string"/> <argument name="attributeData" type="string"/> </arguments> - + <waitForElementVisible selector="{{AdminExportMainSection.entityType}}" stepKey="waitForEntityTypeDropDown"/> <selectOption selector="{{AdminExportMainSection.entityType}}" userInput="Products" stepKey="selectProductsOption"/> + <waitForPageLoad stepKey="waitForPageLoad"/> <waitForElementVisible selector="{{AdminExportMainSection.entityAttributes}}" stepKey="waitForElementVisible"/> <scrollTo selector="{{AdminExportAttributeSection.chooseAttribute('attribute')}}" stepKey="scrollToAttribute"/> <checkOption selector="{{AdminExportAttributeSection.chooseAttribute('attribute')}}" stepKey="selectAttribute"/> @@ -26,6 +27,7 @@ <waitForPageLoad stepKey="waitForUserInput"/> <scrollTo selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="scrollToContinue"/> <click selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="clickContinueButton"/> - <see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue, wait to get your file soon" stepKey="seeSuccessMessage"/> + <waitForPageLoad stepKey="waitForClick"/> + <waitForText userInput="Message is added to queue, wait to get your file soon" selector="{{AdminMessagesSection.success}}" stepKey="seeSuccessMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Data/ImportData.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Data/ImportData.xml new file mode 100644 index 000000000000..3ca2da4f1b89 --- /dev/null +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Data/ImportData.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <!-- Product Attributes --> + <entity name="ProductAttributeFrontendLabelImport1" type="FrontendLabel"> + <data key="store_id">0</data> + <data key="label">import_attribute1</data> + </entity> + <entity name="ProductAttributeWithThreeOptionsForImport" extends="productAttributeDropdownTwoOptions" type="ProductAttribute"> + <data key="attribute_code">import_attribute1</data> + <requiredEntity type="FrontendLabel">ProductAttributeFrontendLabelImport1</requiredEntity> + </entity> + <entity name="ProductAttributeOptionThreeForImport" extends="productAttributeOption3" type="ProductAttributeOption"> + <data key="label">option3</data> + </entity> + + <!-- Images --> + <entity name="TestImageImageContentExportImport" extends="TestImageContent" type="ImageContent"> + <data key="name">test_image.jpg</data> + </entity> + <entity name="AdobeBaseContentExportImport" extends="AdobeBaseContent" type="ImageContent"> + <data key="name">adobe-base.jpg</data> + </entity> + <entity name="ApiProductAttributeMediaGalleryForExportImport2" extends="ApiProductAttributeMediaGalleryEntryTestImage" type="ProductAttributeMediaGalleryEntry"> + <data key="label">Test Image</data> + <requiredEntity type="ImageContent">TestImageImageContentExportImport</requiredEntity> + </entity> + <entity name="ApiProductAttributeMediaGalleryForExportImport3" extends="ApiProductAttributeMediaGalleryEntryTestImage2" type="ProductAttributeMediaGalleryEntry"> + <data key="label">Adobe Base</data> + <requiredEntity type="ImageContent">AdobeBaseContentExportImport</requiredEntity> + </entity> +</entities> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml index 785d19c000af..e72542df7c65 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml @@ -11,14 +11,21 @@ <test name="AdminExportBundleProductTest"> <annotations> <features value="CatalogImportExport"/> - <stories value="Export products"/> - <title value="Export Bundle Product"/> - <description value="Admin should be able to export Bundle Product"/> + <stories value="Export Products"/> + <title value="Export Bundle Products"/> + <description value="Verifies that a user can export Bundle and Simple child products for Bundled products + with a dynamic price, a fixed price, and a custom attribute. Verifies that the exported file and the + downloadable copy of the exported file contain the expected products. Note that MFTF cannot simply download + a file and have access to it due to the test not having access to the server that is running the test + browser. Therefore, this test verifies that the Download button can be successfully clicked, grabs the + request URL from the Download button, executes the request on the magento machine via a curl request, and + verifies the contents of the downloaded file."/> <severity value="CRITICAL"/> <testCaseId value="MC-14008"/> <group value="catalog_import_export"/> <group value="mtf_migrated"/> </annotations> + <before> <!--Create bundle product with dynamic price with two simple products --> <createData entity="SimpleProduct2" stepKey="firstSimpleProductForDynamic"/> @@ -81,7 +88,9 @@ </createData> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> + <after> + <!-- Delete Data & Reindex --> <deleteData createDataKey="createDynamicBundleProduct" stepKey="deleteDynamicBundleProduct"/> <deleteData createDataKey="firstSimpleProductForDynamic" stepKey="deleteFirstSimpleProductForDynamic"/> <deleteData createDataKey="secondSimpleProductForDynamic" stepKey="deleteSecondSimpleProductForDynamic"/> @@ -92,33 +101,201 @@ <deleteData createDataKey="firstSimpleProductForFixedWithAttribute" stepKey="deleteFirstSimpleProductForFixedWithAttribute"/> <deleteData createDataKey="secondSimpleProductForFixedWithAttribute" stepKey="deleteSecondSimpleProductForFixedWithAttribute"/> <deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">var/export</argument> + </helper> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Go to export page --> - <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> - - <!-- Export created below products --> + <!-- Export Created Products --> + <actionGroup ref="AdminNavigateToExportPageActionGroup" stepKey="goToExportIndexPage"/> <actionGroup ref="ExportAllProductsActionGroup" stepKey="exportCreatedProducts"/> - <!-- Start message queue for export consumer --> + <!-- Start Message Queue for Export Consumer --> <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> <argument name="consumerName" value="{{AdminExportMessageConsumerData.consumerName}}"/> <argument name="maxMessages" value="{{AdminExportMessageConsumerData.messageLimit}}"/> </actionGroup> <reloadPage stepKey="refreshPage"/> + <waitForPageLoad stepKey="waitForReload"/> <waitForElementVisible selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="waitForFileName"/> - <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="grabNameFile"/> + <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="getFilename"/> + <actionGroup ref="AdminGetExportFilenameOnServerActionGroup" stepKey="grabNameFile"> + <argument name="rowIndex" value="0"/> + </actionGroup> + + <!-- Validate Export File on File System: Dynamic Bundle Product --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstSimpleProductForDynamicBundledProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$firstSimpleProductForDynamic.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondSimpleProductForDynamicBundledProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$secondSimpleProductForDynamic.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDynamicBundleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createDynamicBundleProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDynamicBundleProductOption1"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">name=$createFirstBundleOption.option[title]$,type=$createFirstBundleOption.option[type]$,required=$createFirstBundleOption.option[required]$,sku=$$firstSimpleProductForDynamic.sku$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDynamicBundleProductOption2"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">name=$createFirstBundleOption.option[title]$,type=$createFirstBundleOption.option[type]$,required=$createFirstBundleOption.option[required]$,sku=$$secondSimpleProductForDynamic.sku$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDynamicPriceBundleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">0.000000,,,,$$createDynamicBundleProduct.sku$$</argument> + </helper> - <!-- Download product --> + <!-- Validate Export File on File System: Fixed Bundle Product --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstSimpleProductForFixedBundledProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$firstSimpleProductForFixed.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondSimpleProductForFixedBundledProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$secondSimpleProductForFixed.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createFixedBundleProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductOption1"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">name=$createSecondBundleOption.option[title]$,type=$createSecondBundleOption.option[type]$,required=$createSecondBundleOption.option[required]$,sku=$$firstSimpleProductForFixed.sku$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductOption2"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">name=$createSecondBundleOption.option[title]$,type=$createSecondBundleOption.option[type]$,required=$createSecondBundleOption.option[required]$,sku=$$secondSimpleProductForFixed.sku$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedPriceBundleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createFixedBundleProduct.price$$0000,,,,$$createFixedBundleProduct.sku$$</argument> + </helper> + + <!-- Validate Export File on File System: Fixed Bundle Product with Attribute --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstSimpleProductForFixedBundledProductWithAttribute"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$firstSimpleProductForFixedWithAttribute.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondSimpleProductForFixedBundledProductWithAttribute"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$secondSimpleProductForFixedWithAttribute.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductWithAttribute"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createFixedBundleProductWithAttribute.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductWithAttributeOption1"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">name=$createBundleOptionWithAttribute.option[title]$,type=$createBundleOptionWithAttribute.option[type]$,required=$createBundleOptionWithAttribute.option[required]$,sku=$$firstSimpleProductForFixedWithAttribute.sku$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductWithAttributeOption2"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">name=$createBundleOptionWithAttribute.option[title]$,type=$createBundleOptionWithAttribute.option[type]$,required=$createBundleOptionWithAttribute.option[required]$,sku=$$secondSimpleProductForFixedWithAttribute.sku$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedPriceBundleProductWithAttribute"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createFixedBundleProductWithAttribute.price$$0000,,,,$$createFixedBundleProductWithAttribute.sku$$</argument> + </helper> + + <!-- Download Export File --> <actionGroup ref="DownloadFileActionGroup" stepKey="downloadCreatedProducts"> - <argument name="fileName" value="{$grabNameFile}"/> + <argument name="fileName" value="{$getFilename}"/> </actionGroup> - <!-- Delete exported file --> + <!-- Validate Downloaded Export File on File System: Dynamic Bundle Product --> + <grabAttributeFrom userInput="href" selector="{{AdminExportAttributeSection.download('0')}}" stepKey="grabExportUrl"/> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFirstSimpleProductForDynamicBundledProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$firstSimpleProductForDynamic.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsSecondSimpleProductForDynamicBundledProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$secondSimpleProductForDynamic.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDynamicBundleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createDynamicBundleProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDynamicBundleProductOption1"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">name=$createFirstBundleOption.option[title]$,type=$createFirstBundleOption.option[type]$,required=$createFirstBundleOption.option[required]$,sku=$$firstSimpleProductForDynamic.sku$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDynamicBundleProductOption2"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">name=$createFirstBundleOption.option[title]$,type=$createFirstBundleOption.option[type]$,required=$createFirstBundleOption.option[required]$,sku=$$secondSimpleProductForDynamic.sku$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDynamicPriceBundleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">0.000000,,,,$$createDynamicBundleProduct.sku$$</argument> + </helper> + + <!-- Validate Downloaded Export File on File System: Fixed Bundle Product --> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFirstSimpleProductForFixedBundledProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$firstSimpleProductForFixed.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsSecondSimpleProductForFixedBundledProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$secondSimpleProductForFixed.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFixedBundleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createFixedBundleProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFixedBundleProductOption1"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">name=$createSecondBundleOption.option[title]$,type=$createSecondBundleOption.option[type]$,required=$createSecondBundleOption.option[required]$,sku=$$firstSimpleProductForFixed.sku$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFixedBundleProductOption2"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">name=$createSecondBundleOption.option[title]$,type=$createSecondBundleOption.option[type]$,required=$createSecondBundleOption.option[required]$,sku=$$secondSimpleProductForFixed.sku$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFixedPriceBundleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createFixedBundleProduct.price$$0000,,,,$$createFixedBundleProduct.sku$$</argument> + </helper> + + <!-- Validate Downloaded Export File on File System: Fixed Bundle Product with Attribute --> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFirstSimpleProductForFixedBundledProductWithAttribute"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$firstSimpleProductForFixedWithAttribute.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsSecondSimpleProductForFixedBundledProductWithAttribute"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$secondSimpleProductForFixedWithAttribute.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFixedBundleProductWithAttribute"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createFixedBundleProductWithAttribute.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFixedBundleProductWithAttributeOption1"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">name=$createBundleOptionWithAttribute.option[title]$,type=$createBundleOptionWithAttribute.option[type]$,required=$createBundleOptionWithAttribute.option[required]$,sku=$$firstSimpleProductForFixedWithAttribute.sku$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFixedBundleProductWithAttributeOption2"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">name=$createBundleOptionWithAttribute.option[title]$,type=$createBundleOptionWithAttribute.option[type]$,required=$createBundleOptionWithAttribute.option[required]$,sku=$$secondSimpleProductForFixedWithAttribute.sku$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFixedPriceBundleProductWithAttribute"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createFixedBundleProductWithAttribute.price$$0000,,,,$$createFixedBundleProductWithAttribute.sku$$</argument> + </helper> + + <!-- Delete Export File --> <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> - <argument name="fileName" value="{$grabNameFile}"/> + <argument name="fileName" value="{$getFilename}"/> </actionGroup> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> </test> </tests> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportFilenameTimezoneTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportFilenameTimezoneTest.xml new file mode 100644 index 000000000000..a38a43bc7217 --- /dev/null +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportFilenameTimezoneTest.xml @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminExportFilenameTimezoneTest"> + <annotations> + <features value="CatalogImportExport"/> + <stories value="Export Products"/> + <title value="Date and time in export file name should be in user timezone"/> + <description value="Date and time in export file name should be in user timezone"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-42286"/> + <useCaseId value="MC-41672"/> + <group value="catalog_import_export"/> + </annotations> + <before> + <!-- Create simple product --> + <createData entity="SimpleProduct2" stepKey="createProduct"/> + <!-- Log in to admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <!-- Delete product --> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <!-- Log out from admin --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <!--Set timezone for default config--> + <actionGroup ref="AdminOpenGeneralConfigurationPageActionGroup" stepKey="goToGeneralConfig"/> + <conditionalClick selector="{{LocaleOptionsSection.sectionHeader}}" + dependentSelector="{{LocaleOptionsSection.timezone}}" + visible="false" + stepKey="openLocaleSection"/> + <grabValueFrom selector="{{LocaleOptionsSection.timezone}}" stepKey="originalTimezone"/> + <selectOption selector="{{LocaleOptionsSection.timezone}}" userInput="America/Chicago" stepKey="setTimezone"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="saveConfig"/> + + <!-- Navigate to export page --> + <actionGroup ref="AdminNavigateToExportPageActionGroup" stepKey="goToExportIndexPage"/> + <!-- Export all products --> + <actionGroup ref="ExportAllProductsActionGroup" stepKey="exportCreatedProducts"/> + <!-- Start queue consumer for export --> + <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> + <argument name="consumerName" value="{{AdminExportMessageConsumerData.consumerName}}"/> + <argument name="maxMessages" value="{{AdminExportMessageConsumerData.messageLimit}}"/> + </actionGroup> + <!-- Refresh export page --> + <actionGroup ref="ReloadPageActionGroup" stepKey="refreshPage"/> + <!-- Get file display name --> + <waitForElementVisible selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" + stepKey="waitForFilename"/> + <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="getFilename"/> + <!-- Get file name on server --> + <actionGroup ref="AdminGetExportFilenameOnServerActionGroup" stepKey="grabNameFile"> + <argument name="rowIndex" value="0"/> + </actionGroup> + <!-- Verify that the file exists on server --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" + method="assertFileExists" + stepKey="assertExportFileExists"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> + <executeJS function="var dt = '{$grabNameFile}'.replace(/[^\d]/g, ''), + dy = dt.substring(0, 4), + dm = dt.substring(4, 6), + dd = dt.substring(6, 8), + dh = dt.substring(8, 10), + dmn = dt.substring(10, 12), + ds = dt.substring(12); + return (Date.parse(dy + '-' + dm + '-' + dd + 'T' + dh + ':' + dmn + ':' + ds + '.000Z')/1000);" + stepKey="timestamp"/> + <generateDate date="@{$timestamp}" format="Ymd_His" stepKey="expectedDate" timezone="America/Chicago"/> + <executeJS function="return 'catalog_product_' + '{$expectedDate}' + '.csv'" + stepKey="expectedFilename"/> + <!-- Verify that the date and time in export filename is in user timezone--> + <assertEquals stepKey="assertThatFilenameDisplayedToUserIsInAdminTimezone"> + <actualResult type="variable">getFilename</actualResult> + <expectedResult type="variable">expectedFilename</expectedResult> + </assertEquals> + <!-- Verify that the date and time in download filename is in user timezone--> + <grabAttributeFrom userInput="href" + selector="{{AdminExportAttributeSection.download('0')}}" + stepKey="grabExportUrl"/> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" + method="assertCurlResponseHeadersContainsString" + stepKey="assertDownloadFileContainsConfigurableProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">Content-Disposition: attachment; filename="export/{$expectedFilename}"</argument> + </helper> + <!-- Delete export File --> + <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> + <argument name="fileName" value="{$getFilename}"/> + </actionGroup> + <!--Reset timezone--> + <actionGroup ref="AdminOpenGeneralConfigurationPageActionGroup" stepKey="goToGeneralConfigReset"/> + <conditionalClick selector="{{LocaleOptionsSection.sectionHeader}}" + dependentSelector="{{LocaleOptionsSection.timezone}}" + visible="false" stepKey="openLocaleSectionReset"/> + <selectOption selector="{{LocaleOptionsSection.timezone}}" + userInput="$originalTimezone" + stepKey="resetTimezone"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="saveConfigReset"/> + </test> +</tests> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml index 9f8d65968d74..dba833c95b21 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml @@ -11,14 +11,20 @@ <test name="AdminExportGroupedProductWithSpecialPriceTest"> <annotations> <features value="CatalogImportExport"/> - <stories value="Export products"/> - <title value="Export grouped product with special price"/> - <description value="Admin should be able to export grouped product with special price"/> + <stories value="Export Products"/> + <title value="Export Grouped Products with Special Price"/> + <description value="Verifies that a user can export a Grouped product with a special price and Simple child + products. Verifies that exported file and the downloadable copy of the exported file contain the expected + products. Note that MFTF cannot simply download a file and have access to it due to the test not having + access to the server that is running the test browser. Therefore, this test verifies that the Download + button can be successfully clicked, grabs the request URL from the Download button, executes the request on + the magento machine via a curl request, and verifies the contents of the downloaded file."/> <severity value="CRITICAL"/> <testCaseId value="MC-14009"/> <group value="catalog_import_export"/> <group value="mtf_migrated"/> </annotations> + <before> <!-- Create first simple product and add special price --> <createData entity="SimpleProduct2" stepKey="createFirstSimpleProduct"/> @@ -50,40 +56,97 @@ <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> + <after> + <!-- Delete Data & Reindex --> <deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/> <deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/> <deleteData createDataKey="createGroupedProduct" stepKey="deleteGroupedProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">var/export</argument> + </helper> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> - <!-- Log out --> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Go to export page --> - <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> - <waitForPageLoad stepKey="waitForExportIndexPageLoad"/> - - <!-- Export created below products --> + <!-- Export Created Products --> + <actionGroup ref="AdminNavigateToExportPageActionGroup" stepKey="goToExportIndexPage"/> + <comment userInput="BIC workaround" stepKey="waitForExportIndexPageLoad"/> <actionGroup ref="ExportAllProductsActionGroup" stepKey="exportCreatedProducts"/> - <!-- Start message queue for export consumer --> + <!-- Start Message Queue for Export Consumer --> <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> <argument name="consumerName" value="{{AdminExportMessageConsumerData.consumerName}}"/> <argument name="maxMessages" value="{{AdminExportMessageConsumerData.messageLimit}}"/> </actionGroup> <reloadPage stepKey="refreshPage"/> + <waitForPageLoad stepKey="waitForReload"/> <waitForElementVisible selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="waitForFileName"/> - <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="grabNameFile"/> + <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="getFilename"/> + <actionGroup ref="AdminGetExportFilenameOnServerActionGroup" stepKey="grabNameFile"> + <argument name="rowIndex" value="0"/> + </actionGroup> + + <!-- Validate Export File on File System: Grouped Product with Special Price --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstSimpleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createFirstSimpleProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondSimpleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createSecondSimpleProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsGroupedProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createGroupedProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstChildGroupedProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createFirstSimpleProduct.sku$$=$$createFirstSimpleProduct.quantity$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondChildGroupedProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createSecondSimpleProduct.sku$$=$$createSecondSimpleProduct.quantity$$</argument> + </helper> - <!-- Download product --> + <!-- Download Export File --> <actionGroup ref="DownloadFileActionGroup" stepKey="downloadCreatedProducts"> - <argument name="fileName" value="{$grabNameFile}"/> + <argument name="fileName" value="{$getFilename}"/> </actionGroup> - <!-- Delete exported file --> + <!-- Validate Downloaded Export File: Grouped Product with Special Price --> + <grabAttributeFrom userInput="href" selector="{{AdminExportAttributeSection.download('0')}}" stepKey="grabExportUrl"/> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFirstSimpleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createFirstSimpleProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsSecondSimpleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createSecondSimpleProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsGroupedProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createGroupedProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFirstChildGroupedProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createFirstSimpleProduct.sku$$=$$createFirstSimpleProduct.quantity$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsSecondChildGroupedProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createSecondSimpleProduct.sku$$=$$createSecondSimpleProduct.quantity$$</argument> + </helper> + + <!-- Delete Export File --> <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> - <argument name="fileName" value="{$grabNameFile}"/> + <argument name="fileName" value="{$getFilename}"/> </actionGroup> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> </test> </tests> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml index f0e6e12204a9..44a7558d6054 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml @@ -171,11 +171,14 @@ </actionGroup> <reloadPage stepKey="refreshPage"/> <waitForElementVisible selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="waitForFileName"/> - <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="grabNameFile"/> + <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="getFilename"/> + <actionGroup ref="AdminGetExportFilenameOnServerActionGroup" stepKey="grabNameFile"> + <argument name="rowIndex" value="0"/> + </actionGroup> <!-- Save exported file: file successfully downloaded --> <actionGroup ref="DownloadFileActionGroup" stepKey="downloadCreatedProducts"> - <argument name="fileName" value="{$grabNameFile}"/> + <argument name="fileName" value="{$getFilename}"/> </actionGroup> <!-- Go to Catalog > Products. Find ConfProd and delete it --> @@ -209,9 +212,7 @@ <!-- Go to "Images and Videos" section: assert image --> <scrollTo selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" stepKey="scrollToProductGalleryTab"/> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"> - <argument name="image" value="MagentoLogo"/> - </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Go to any ConfProd's configuration page: Product page open successfully --> <click selector="{{AdminProductFormConfigurationsSection.variationProductLinkByName($$createConfigFirstChildProduct.name$$)}}" stepKey="clickOnFirstProductLink"/> @@ -219,14 +220,12 @@ <waitForPageLoad stepKey="waitForProductPageLoad"/> <!-- Go to "Images and Videos" section: assert image --> <scrollTo selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" stepKey="scrollToChildProductGalleryTab"/> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertChildProductImageAdminProductPage"> - <argument name="image" value="MagentoLogo"/> - </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertChildProductImageAdminProductPage"/> <closeTab stepKey="closeConfigChildProductPage"/> <!-- Delete exported file --> <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> - <argument name="fileName" value="{$grabNameFile}"/> + <argument name="fileName" value="{$getFilename}"/> </actionGroup> </test> </tests> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml index 94478e63aa92..d60ed5e1c448 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml @@ -11,14 +11,21 @@ <test name="AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest"> <annotations> <features value="CatalogImportExport"/> - <stories value="Export products"/> - <title value="Export Simple and Configurable products with custom options"/> - <description value="Admin should be able to export Simple and Configurable products with custom options"/> + <stories value="Export Products"/> + <title value="Export Simple and Configurable Products with Custom Options"/> + <description value="Verifies that a user can export a Configurable product with child simple products with + custom options. Verifies that the exported file and the downloadable copy of the exported file contain the + expected product (a filter is applied when exporting such that ONLY the configurable product row should be + in the export). Note that MFTF cannot simply download a file and have access to it due to the test not + having access to the server that is running the test browser. Therefore, this test verifies that the + Download button can be successfully clicked, grabs the request URL from the Download button, executes the + request on the magento machine via a curl request, and verifies the contents of the downloaded file."/> <severity value="CRITICAL"/> <testCaseId value="MC-14005"/> <group value="catalog_import_export"/> <group value="mtf_migrated"/> </annotations> + <before> <!-- Create category --> <createData entity="SimpleSubCategory" stepKey="createCategory"/> @@ -76,6 +83,7 @@ <magentoCron stepKey="runCronIndex" groups="index"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> + <after> <!-- Delete configurable product creation --> <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> @@ -83,37 +91,93 @@ <deleteData createDataKey="createConfigSecondChildProduct" stepKey="deleteConfigSecondChildProduct"/> <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">var/export</argument> + </helper> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Go to export page --> - <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> - <waitForPageLoad stepKey="waitForExportIndexPageLoad"/> - - <!-- Fill entity attributes data --> + <!-- Export Created Products --> + <actionGroup ref="AdminNavigateToExportPageActionGroup" stepKey="goToExportIndexPage"/> + <comment userInput="BIC workaround" stepKey="waitForExportIndexPageLoad"/> <actionGroup ref="ExportProductsFilterByAttributeActionGroup" stepKey="exportProductBySku"> <argument name="attribute" value="sku"/> <argument name="attributeData" value="$$createConfigProduct.sku$$"/> </actionGroup> - <!-- Start message queue for export consumer --> + <!-- Start Message Queue for Export Consumer --> <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> <argument name="consumerName" value="{{AdminExportMessageConsumerData.consumerName}}"/> <argument name="maxMessages" value="{{AdminExportMessageConsumerData.messageLimit}}"/> </actionGroup> <reloadPage stepKey="refreshPage"/> + <waitForPageLoad stepKey="waitForReload"/> <waitForElementVisible selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="waitForFileName"/> - <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="grabNameFile"/> + <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="getFilename"/> + <actionGroup ref="AdminGetExportFilenameOnServerActionGroup" stepKey="grabNameFile"> + <argument name="rowIndex" value="0"/> + </actionGroup> + + <!-- Validate Export File on File System: Product with Custom Options --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsConfigurableProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstChildSimpleProductOption"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">sku=$$createConfigFirstChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option1</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondChildSimpleProductOption"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">sku=$$createConfigSecondChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option2</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotContainString" stepKey="assertExportFileDoesNotContainFirstSimpleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigFirstChildProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotContainString" stepKey="assertExportFileDoesNotContainSecondSimpleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigSecondChildProduct.name$$</argument> + </helper> - <!-- Download product --> + <!-- Download Export File --> <actionGroup ref="DownloadFileActionGroup" stepKey="downloadCreatedProducts"> - <argument name="fileName" value="{$grabNameFile}"/> + <argument name="fileName" value="{$getFilename}"/> </actionGroup> - <!-- Delete exported file --> + <!-- Validate Downloaded Export File: Product with Custom Options --> + <grabAttributeFrom userInput="href" selector="{{AdminExportAttributeSection.download('0')}}" stepKey="grabExportUrl"/> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsConfigurableProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createConfigProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFirstChildSimpleProductOption"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">sku=$$createConfigFirstChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option1</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsSecondChildSimpleProductOption"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">sku=$$createConfigSecondChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option2</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseDoesNotContainString" stepKey="assertDownloadFileDoesNotContainFirstSimpleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createConfigFirstChildProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseDoesNotContainString" stepKey="assertDownloadFileDoesNotContainSecondSimpleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createConfigSecondChildProduct.name$$</argument> + </helper> + + <!-- Delete Export File --> <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> - <argument name="fileName" value="{$grabNameFile}"/> + <argument name="fileName" value="{$getFilename}"/> </actionGroup> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> </test> </tests> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml index 95cfe2c87bff..ab0d00527cbb 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml @@ -11,14 +11,22 @@ <test name="AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest"> <annotations> <features value="CatalogImportExport"/> - <stories value="Export products"/> + <stories value="Export Products"/> <title value="Export Simple product and Configurable products with assigned images"/> - <description value="Admin should be able to export Simple and Configurable products with assigned images"/> + <description value="Verifies that a user can export a Configurable product with child simple products with + images. Verifies that the exported file and the downloadable copy of the exported file contain the expected + product (a filter is applied when exporting such that ONLY the configurable product row should be in the + export) and the attached image. Note that MFTF cannot simply download a file and have access to it due to + the test not having access to the server that is running the test browser. Therefore, this test verifies + that the Download button can be successfully clicked, grabs the request URL from the Download button, + executes the request on the magento machine via a curl request, and verifies the contents of the downloaded + file"/> <severity value="CRITICAL"/> <testCaseId value="MC-14004"/> <group value="catalog_import_export"/> <group value="mtf_migrated"/> </annotations> + <before> <!-- Create category --> <createData entity="SimpleSubCategory" stepKey="createCategory"/> @@ -92,43 +100,108 @@ <magentoCron groups="index" stepKey="runCronIndex"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> + <after> - <!-- Delete configurable product creation --> + <!-- Delete Data --> <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> <deleteData createDataKey="createConfigFirstChildProduct" stepKey="deleteConfigFirstChildProduct"/> <deleteData createDataKey="createConfigSecondChildProduct" stepKey="deleteConfigSecondChildProduct"/> <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">var/export</argument> + </helper> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Go to export page --> - <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> - - <!-- Fill entity attributes data --> + <!-- Export Created Products --> + <actionGroup ref="AdminNavigateToExportPageActionGroup" stepKey="goToExportIndexPage"/> <actionGroup ref="ExportProductsFilterByAttributeActionGroup" stepKey="exportProductBySku"> <argument name="attribute" value="sku"/> <argument name="attributeData" value="$$createConfigProduct.sku$$"/> </actionGroup> - <!-- Start message queue for export consumer --> + <!-- Start Message Queue for Export Consumer --> <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> <argument name="consumerName" value="{{AdminExportMessageConsumerData.consumerName}}"/> <argument name="maxMessages" value="{{AdminExportMessageConsumerData.messageLimit}}"/> </actionGroup> <reloadPage stepKey="refreshPage"/> + <waitForPageLoad stepKey="waitForReload"/> <waitForElementVisible selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="waitForFileName"/> - <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="grabNameFile"/> + <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="getFilename"/> + <actionGroup ref="AdminGetExportFilenameOnServerActionGroup" stepKey="grabNameFile"> + <argument name="rowIndex" value="0"/> + </actionGroup> + + <!-- Validate Export File on File System: Configurable Product --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsConfigurableProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstChildSimpleProductOption"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">sku=$$createConfigFirstChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option1</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondChildSimpleProductOption"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">sku=$$createConfigSecondChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option2</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsConfigurableProductImage"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$createConfigProductImage.entry[content][name]$,"$createConfigProductImage.entry[label]$"</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotContainString" stepKey="assertExportFileDoesNotContainFirstSimpleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigFirstChildProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotContainString" stepKey="assertExportFileDoesNotContainSecondSimpleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigSecondChildProduct.name$$</argument> + </helper> - <!-- Download product --> + <!-- Download Export File --> <actionGroup ref="DownloadFileActionGroup" stepKey="downloadCreatedProducts"> - <argument name="fileName" value="{$grabNameFile}"/> + <argument name="fileName" value="{$getFilename}"/> </actionGroup> - <!-- Delete exported file --> + <!-- Validate Downloaded Export File on File System: Configurable Product --> + <grabAttributeFrom userInput="href" selector="{{AdminExportAttributeSection.download('0')}}" stepKey="grabExportUrl"/> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsConfigurableProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createConfigProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFirstChildSimpleProductOption"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">sku=$$createConfigFirstChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option1</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsSecondChildSimpleProductOption"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">sku=$$createConfigSecondChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option2</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsConfigurableProductImage"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$createConfigProductImage.entry[content][name]$,"$createConfigProductImage.entry[label]$"</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseDoesNotContainString" stepKey="assertDownloadFileDoesNotContainFirstSimpleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createConfigFirstChildProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseDoesNotContainString" stepKey="assertDownloadFileDoesNotContainSecondSimpleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createConfigSecondChildProduct.name$$</argument> + </helper> + + <!-- Delete Export File --> <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> - <argument name="fileName" value="{$grabNameFile}"/> + <argument name="fileName" value="{$getFilename}"/> </actionGroup> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> </test> </tests> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml index 2f57d94113d3..bbfc65d18c7e 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml @@ -11,7 +11,7 @@ <test name="AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest"> <annotations> <features value="CatalogImportExport"/> - <stories value="Export products"/> + <stories value="Export Products"/> <title value="Export Simple Product assigned to Main Website and Configurable Product assigned to Custom Website"/> <description value="Admin should be able to export Simple Product assigned to Main Website and Configurable Product assigned to Custom Website"/> <severity value="CRITICAL"/> @@ -103,16 +103,19 @@ </actionGroup> <reloadPage stepKey="refreshPage"/> <waitForElementVisible selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="waitForFileName"/> - <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="grabNameFile"/> + <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="getFilename"/> + <actionGroup ref="AdminGetExportFilenameOnServerActionGroup" stepKey="grabNameFile"> + <argument name="rowIndex" value="0"/> + </actionGroup> <!-- Download product --> <actionGroup ref="DownloadFileActionGroup" stepKey="downloadCreatedProducts"> - <argument name="fileName" value="{$grabNameFile}"/> + <argument name="fileName" value="{$getFilename}"/> </actionGroup> <!-- Delete exported file --> <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> - <argument name="fileName" value="{$grabNameFile}"/> + <argument name="fileName" value="{$getFilename}"/> </actionGroup> </test> </tests> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml index dac97a61a967..d9e42e65b44f 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml @@ -11,7 +11,7 @@ <test name="AdminExportSimpleProductWithCustomAttributeTest"> <annotations> <features value="CatalogImportExport"/> - <stories value="Export products"/> + <stories value="Export Products"/> <title value="Export Simple Product with custom attribute"/> <description value="Admin should be able to export Simple Product with custom attribute"/> <severity value="CRITICAL"/> @@ -56,16 +56,19 @@ </actionGroup> <reloadPage stepKey="pageReload" /> <waitForElementVisible selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="waitForFileName"/> - <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="grabNameFile"/> + <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="getFilename"/> + <actionGroup ref="AdminGetExportFilenameOnServerActionGroup" stepKey="grabNameFile"> + <argument name="rowIndex" value="0"/> + </actionGroup> <!-- Download product --> <actionGroup ref="DownloadFileActionGroup" stepKey="downloadCreatedProducts"> - <argument name="fileName" value="{$grabNameFile}"/> + <argument name="fileName" value="{$getFilename}"/> </actionGroup> <!-- Delete exported file --> <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> - <argument name="fileName" value="{$grabNameFile}"/> + <argument name="fileName" value="{$getFilename}"/> </actionGroup> </test> diff --git a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/TaxClassProcessorTest.php b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/TaxClassProcessorTest.php index ba65ffa37c8c..80ee5e92f2e7 100644 --- a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/TaxClassProcessorTest.php +++ b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/TaxClassProcessorTest.php @@ -101,4 +101,22 @@ public function testUpsertTaxClassNotExist() $taxClassId = $this->taxClassProcessor->upsertTaxClass('noExistClassName', $this->product); $this->assertEquals(self::TEST_JUST_CREATED_TAX_CLASS_ID, $taxClassId); } + + public function testUpsertTaxClassExistCaseInsensitive() + { + $taxClassId = $this->taxClassProcessor->upsertTaxClass(strtoupper(self::TEST_TAX_CLASS_NAME), $this->product); + $this->assertEquals(self::TEST_TAX_CLASS_ID, $taxClassId); + } + + public function testUpsertTaxClassNone() + { + $taxClassId = $this->taxClassProcessor->upsertTaxClass('none', $this->product); + $this->assertEquals(0, $taxClassId); + } + + public function testUpsertTaxClassZero() + { + $taxClassId = $this->taxClassProcessor->upsertTaxClass(0, $this->product); + $this->assertEquals(0, $taxClassId); + } } diff --git a/app/code/Magento/CatalogImportExport/etc/di.xml b/app/code/Magento/CatalogImportExport/etc/di.xml index 040e9dcda132..c35bcbd84951 100644 --- a/app/code/Magento/CatalogImportExport/etc/di.xml +++ b/app/code/Magento/CatalogImportExport/etc/di.xml @@ -48,6 +48,7 @@ <argument name="filters" xsi:type="array"> <item name="category_ids" xsi:type="object">Magento\CatalogImportExport\Model\Export\Product\CategoryFilter</item> <item name="quantity_and_stock_status" xsi:type="object">Magento\CatalogImportExport\Model\Export\Product\StockStatusFilter</item> + <item name="website_ids" xsi:type="object">Magento\CatalogImportExport\Model\Export\Product\WebsiteFilter</item> </argument> </arguments> </type> diff --git a/app/code/Magento/CatalogInventory/Api/Data/StockCollectionInterface.php b/app/code/Magento/CatalogInventory/Api/Data/StockCollectionInterface.php index 07b8429ddf18..4b9383b9eb10 100644 --- a/app/code/Magento/CatalogInventory/Api/Data/StockCollectionInterface.php +++ b/app/code/Magento/CatalogInventory/Api/Data/StockCollectionInterface.php @@ -17,8 +17,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockCollectionInterface extends SearchResultsInterface { diff --git a/app/code/Magento/CatalogInventory/Api/Data/StockInterface.php b/app/code/Magento/CatalogInventory/Api/Data/StockInterface.php index 581081f2924e..e0375471acf1 100644 --- a/app/code/Magento/CatalogInventory/Api/Data/StockInterface.php +++ b/app/code/Magento/CatalogInventory/Api/Data/StockInterface.php @@ -13,8 +13,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockInterface extends ExtensibleDataInterface { diff --git a/app/code/Magento/CatalogInventory/Api/Data/StockItemCollectionInterface.php b/app/code/Magento/CatalogInventory/Api/Data/StockItemCollectionInterface.php index 2d5f980a5703..d280df7e9fe1 100644 --- a/app/code/Magento/CatalogInventory/Api/Data/StockItemCollectionInterface.php +++ b/app/code/Magento/CatalogInventory/Api/Data/StockItemCollectionInterface.php @@ -17,8 +17,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockItemCollectionInterface extends SearchResultsInterface { diff --git a/app/code/Magento/CatalogInventory/Api/Data/StockItemInterface.php b/app/code/Magento/CatalogInventory/Api/Data/StockItemInterface.php index 759cc9883be9..4b42c6498c94 100644 --- a/app/code/Magento/CatalogInventory/Api/Data/StockItemInterface.php +++ b/app/code/Magento/CatalogInventory/Api/Data/StockItemInterface.php @@ -13,8 +13,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockItemInterface extends ExtensibleDataInterface { diff --git a/app/code/Magento/CatalogInventory/Api/Data/StockStatusCollectionInterface.php b/app/code/Magento/CatalogInventory/Api/Data/StockStatusCollectionInterface.php index a7d70a943d40..c3649496f2be 100644 --- a/app/code/Magento/CatalogInventory/Api/Data/StockStatusCollectionInterface.php +++ b/app/code/Magento/CatalogInventory/Api/Data/StockStatusCollectionInterface.php @@ -13,8 +13,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockStatusCollectionInterface extends SearchResultsInterface { diff --git a/app/code/Magento/CatalogInventory/Api/Data/StockStatusInterface.php b/app/code/Magento/CatalogInventory/Api/Data/StockStatusInterface.php index 35e56b0e3e7b..10123c9c5a10 100644 --- a/app/code/Magento/CatalogInventory/Api/Data/StockStatusInterface.php +++ b/app/code/Magento/CatalogInventory/Api/Data/StockStatusInterface.php @@ -13,8 +13,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockStatusInterface extends ExtensibleDataInterface { diff --git a/app/code/Magento/CatalogInventory/Api/RegisterProductSaleInterface.php b/app/code/Magento/CatalogInventory/Api/RegisterProductSaleInterface.php index ddb3fce22a85..e530b0d83c9c 100644 --- a/app/code/Magento/CatalogInventory/Api/RegisterProductSaleInterface.php +++ b/app/code/Magento/CatalogInventory/Api/RegisterProductSaleInterface.php @@ -14,8 +14,8 @@ * @api * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html * @since 100.3.0 */ interface RegisterProductSaleInterface diff --git a/app/code/Magento/CatalogInventory/Api/RevertProductSaleInterface.php b/app/code/Magento/CatalogInventory/Api/RevertProductSaleInterface.php index 83f7d73deaed..5d5f22580b1e 100644 --- a/app/code/Magento/CatalogInventory/Api/RevertProductSaleInterface.php +++ b/app/code/Magento/CatalogInventory/Api/RevertProductSaleInterface.php @@ -11,8 +11,8 @@ * @api * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html * @since 100.3.0 */ interface RevertProductSaleInterface diff --git a/app/code/Magento/CatalogInventory/Api/StockConfigurationInterface.php b/app/code/Magento/CatalogInventory/Api/StockConfigurationInterface.php index ab52580988c5..4436f3b220c2 100644 --- a/app/code/Magento/CatalogInventory/Api/StockConfigurationInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockConfigurationInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockConfigurationInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockCriteriaInterface.php b/app/code/Magento/CatalogInventory/Api/StockCriteriaInterface.php index 92f2290ec08a..5c3c82701339 100644 --- a/app/code/Magento/CatalogInventory/Api/StockCriteriaInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockCriteriaInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockCriteriaInterface extends \Magento\Framework\Api\CriteriaInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockIndexInterface.php b/app/code/Magento/CatalogInventory/Api/StockIndexInterface.php index 24dbaf5bb6d5..e3288d355f74 100644 --- a/app/code/Magento/CatalogInventory/Api/StockIndexInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockIndexInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockIndexInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockItemCriteriaInterface.php b/app/code/Magento/CatalogInventory/Api/StockItemCriteriaInterface.php index b72289ee0927..19c5f597d4b3 100644 --- a/app/code/Magento/CatalogInventory/Api/StockItemCriteriaInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockItemCriteriaInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockItemCriteriaInterface extends \Magento\Framework\Api\CriteriaInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockItemRepositoryInterface.php b/app/code/Magento/CatalogInventory/Api/StockItemRepositoryInterface.php index 4269569f9da1..41b96b0d5ccd 100644 --- a/app/code/Magento/CatalogInventory/Api/StockItemRepositoryInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockItemRepositoryInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockItemRepositoryInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockManagementInterface.php b/app/code/Magento/CatalogInventory/Api/StockManagementInterface.php index 3c1c7ea137c8..a3fca303236b 100644 --- a/app/code/Magento/CatalogInventory/Api/StockManagementInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockManagementInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockManagementInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockRegistryInterface.php b/app/code/Magento/CatalogInventory/Api/StockRegistryInterface.php index bab5f9b457c4..07bf2746338d 100644 --- a/app/code/Magento/CatalogInventory/Api/StockRegistryInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockRegistryInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockRegistryInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockRepositoryInterface.php b/app/code/Magento/CatalogInventory/Api/StockRepositoryInterface.php index a7d64ec9eedb..f38d4a2ca91b 100644 --- a/app/code/Magento/CatalogInventory/Api/StockRepositoryInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockRepositoryInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockRepositoryInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockStateInterface.php b/app/code/Magento/CatalogInventory/Api/StockStateInterface.php index d404e885d78d..ad7291281ed3 100644 --- a/app/code/Magento/CatalogInventory/Api/StockStateInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockStateInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockStateInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockStatusCriteriaInterface.php b/app/code/Magento/CatalogInventory/Api/StockStatusCriteriaInterface.php index be1c9642826a..cd26a575b676 100644 --- a/app/code/Magento/CatalogInventory/Api/StockStatusCriteriaInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockStatusCriteriaInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockStatusCriteriaInterface extends \Magento\Framework\Api\CriteriaInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockStatusRepositoryInterface.php b/app/code/Magento/CatalogInventory/Api/StockStatusRepositoryInterface.php index 91efd5576133..b120b93c9193 100644 --- a/app/code/Magento/CatalogInventory/Api/StockStatusRepositoryInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockStatusRepositoryInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockStatusRepositoryInterface { diff --git a/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php b/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php index bc63114d9980..e7918e32f78a 100644 --- a/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php +++ b/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php @@ -14,8 +14,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class Minsaleqty extends \Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray { diff --git a/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Stock.php b/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Stock.php index 3c1a6e798270..0063eefeb12b 100644 --- a/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Stock.php +++ b/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Stock.php @@ -16,8 +16,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class Stock extends \Magento\Framework\Data\Form\Element\Select { @@ -256,8 +256,8 @@ protected function _getJs($quantityFieldId, $inStockFieldId) }; $.each(fieldsAssociations, function(generalTabField, advancedTabField) { $('#' + generalTabField + ', #' + advancedTabField) - .bind('focus blur change keyup click', filler) - .bind('keyup change blur', disabler) + .on('focus blur change keyup click', filler) + .on('keyup change blur', disabler) .trigger('change'); }); diff --git a/app/code/Magento/CatalogInventory/Block/Qtyincrements.php b/app/code/Magento/CatalogInventory/Block/Qtyincrements.php index dd8c987fe5da..909ec9346ebf 100644 --- a/app/code/Magento/CatalogInventory/Block/Qtyincrements.php +++ b/app/code/Magento/CatalogInventory/Block/Qtyincrements.php @@ -16,8 +16,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class Qtyincrements extends Template implements IdentityInterface { diff --git a/app/code/Magento/CatalogInventory/Block/Stockqty/DefaultStockqty.php b/app/code/Magento/CatalogInventory/Block/Stockqty/DefaultStockqty.php index c19dc5fb34bf..cb7d68c92ef6 100644 --- a/app/code/Magento/CatalogInventory/Block/Stockqty/DefaultStockqty.php +++ b/app/code/Magento/CatalogInventory/Block/Stockqty/DefaultStockqty.php @@ -13,8 +13,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class DefaultStockqty extends AbstractStockqty implements \Magento\Framework\DataObject\IdentityInterface { diff --git a/app/code/Magento/CatalogInventory/Helper/Stock.php b/app/code/Magento/CatalogInventory/Helper/Stock.php index 87a0e3c32ad0..e79d2098be68 100644 --- a/app/code/Magento/CatalogInventory/Helper/Stock.php +++ b/app/code/Magento/CatalogInventory/Helper/Stock.php @@ -20,8 +20,8 @@ * @api * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html * @since 100.0.2 */ class Stock diff --git a/app/code/Magento/CatalogInventory/Model/Adminhtml/Stock/Item.php b/app/code/Magento/CatalogInventory/Model/Adminhtml/Stock/Item.php index 04e54acad5c0..c2715241fbe1 100644 --- a/app/code/Magento/CatalogInventory/Model/Adminhtml/Stock/Item.php +++ b/app/code/Magento/CatalogInventory/Model/Adminhtml/Stock/Item.php @@ -22,8 +22,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class Item extends \Magento\CatalogInventory\Model\Stock\Item implements IdentityInterface { diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Full.php b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Full.php index f85f3f357627..d8bf4f858047 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Full.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Full.php @@ -28,6 +28,8 @@ use Magento\Framework\Exception\LocalizedException; use Magento\CatalogInventory\Model\Indexer\Stock\AbstractAction; use Magento\CatalogInventory\Model\ResourceModel\Indexer\Stock\StockInterface; +use Magento\Framework\App\DeploymentConfig; +use Magento\CatalogInventory\Model\Indexer\Stock\Processor; /** * Class Full reindex action @@ -71,6 +73,18 @@ class Full extends AbstractAction */ private $batchQueryGenerator; + /** + * @var DeploymentConfig|null + */ + private $deploymentConfig; + + /** + * Deployment config path + * + * @var string + */ + private const DEPLOYMENT_CONFIG_INDEXER_BATCHES = 'indexer/batch_size/'; + /** * @param ResourceConnection $resource * @param StockFactory $indexerFactory @@ -83,6 +97,7 @@ class Full extends AbstractAction * @param array $batchRowsCount * @param ActiveTableSwitcher|null $activeTableSwitcher * @param QueryGenerator|null $batchQueryGenerator + * @param DeploymentConfig|null $deploymentConfig * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -96,7 +111,8 @@ public function __construct( BatchProviderInterface $batchProvider = null, array $batchRowsCount = [], ActiveTableSwitcher $activeTableSwitcher = null, - QueryGenerator $batchQueryGenerator = null + QueryGenerator $batchQueryGenerator = null, + ?DeploymentConfig $deploymentConfig = null ) { parent::__construct( $resource, @@ -115,6 +131,7 @@ public function __construct( $this->activeTableSwitcher = $activeTableSwitcher ?: ObjectManager::getInstance() ->get(ActiveTableSwitcher::class); $this->batchQueryGenerator = $batchQueryGenerator ?: ObjectManager::getInstance()->get(QueryGenerator::class); + $this->deploymentConfig = $deploymentConfig ?: ObjectManager::getInstance()->get(DeploymentConfig::class); } /** @@ -141,9 +158,18 @@ public function execute($ids = null): void $connection = $indexer->getConnection(); $tableName = $this->activeTableSwitcher->getAdditionalTableName($indexer->getMainTable()); - $batchRowCount = isset($this->batchRowsCount[$indexer->getTypeId()]) - ? $this->batchRowsCount[$indexer->getTypeId()] - : $this->batchRowsCount['default']; + $batchRowCount = $this->deploymentConfig->get( + self::DEPLOYMENT_CONFIG_INDEXER_BATCHES . Processor::INDEXER_ID . '/' . $indexer->getTypeId(), + $this->deploymentConfig->get( + self::DEPLOYMENT_CONFIG_INDEXER_BATCHES . Processor::INDEXER_ID . '/' . 'default' + ) + ); + + if (is_null($batchRowCount)) { + $batchRowCount = isset($this->batchRowsCount[$indexer->getTypeId()]) + ? $this->batchRowsCount[$indexer->getTypeId()] + : $this->batchRowsCount['default']; + } $this->batchSizeManagement->ensureBatchSize($connection, $batchRowCount); diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/CacheCleaner.php b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/CacheCleaner.php index 005ffd11ac7a..c871a8dee65f 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/CacheCleaner.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/CacheCleaner.php @@ -6,6 +6,7 @@ namespace Magento\CatalogInventory\Model\Indexer\Stock; +use Magento\Catalog\Model\Category; use Magento\CatalogInventory\Api\StockConfigurationInterface; use Magento\Framework\App\ResourceConnection; use Magento\Framework\App\ObjectManager; @@ -88,6 +89,11 @@ public function clean(array $productIds, callable $reindex) if ($productIds) { $this->cacheContext->registerEntities(Product::CACHE_TAG, array_unique($productIds)); $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]); + $categoryIds = $this->getCategoryIdsByProductIds($productIds); + if ($categoryIds){ + $this->cacheContext->registerEntities(Category::CACHE_TAG, array_unique($categoryIds)); + $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]); + } } } @@ -159,6 +165,22 @@ private function getProductIdsForCacheClean(array $productStatusesBefore, array return $productIds; } + /** + * Get category ids for products + * + * @param array $productIds + * @return array + */ + private function getCategoryIdsByProductIds(array $productIds): array + { + $categoryProductTable = $this->resource->getTableName('catalog_category_product'); + $select = $this->getConnection()->select() + ->from(['catalog_category_product' => $categoryProductTable], ['category_id']) + ->where('product_id IN (?)', $productIds); + + return $this->getConnection()->fetchCol($select); + } + /** * Get database connection. * diff --git a/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php b/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php index 12a48caf6241..3304e39f2cb2 100644 --- a/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php +++ b/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php @@ -27,8 +27,8 @@ * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class QuantityValidator { diff --git a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php index dec18044b699..05b645652093 100644 --- a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php +++ b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php @@ -20,8 +20,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class DefaultStock extends AbstractIndexer implements StockInterface { diff --git a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/QueryProcessorInterface.php b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/QueryProcessorInterface.php index 665ebf2db2f3..4a78babd0320 100644 --- a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/QueryProcessorInterface.php +++ b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/QueryProcessorInterface.php @@ -13,8 +13,8 @@ * @since 100.1.0 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface QueryProcessorInterface { diff --git a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/StockInterface.php b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/StockInterface.php index 9a1945d5aefa..e111a5267da7 100644 --- a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/StockInterface.php +++ b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/StockInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockInterface { diff --git a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/StockFactory.php b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/StockFactory.php index 49e4889c8ede..f109643bc09c 100644 --- a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/StockFactory.php +++ b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/StockFactory.php @@ -14,8 +14,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class StockFactory { diff --git a/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php b/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php index afb7d51335df..adf62b75b2ad 100644 --- a/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php +++ b/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php @@ -24,8 +24,8 @@ * @api * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html * @since 100.0.2 */ class Status extends AbstractDb diff --git a/app/code/Magento/CatalogInventory/Model/Source/Backorders.php b/app/code/Magento/CatalogInventory/Model/Source/Backorders.php index d28da4e5b349..59d359433c26 100644 --- a/app/code/Magento/CatalogInventory/Model/Source/Backorders.php +++ b/app/code/Magento/CatalogInventory/Model/Source/Backorders.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class Backorders implements \Magento\Framework\Option\ArrayInterface { diff --git a/app/code/Magento/CatalogInventory/Model/Source/Stock.php b/app/code/Magento/CatalogInventory/Model/Source/Stock.php index 69e80658ecd7..c0ffb619e36c 100644 --- a/app/code/Magento/CatalogInventory/Model/Source/Stock.php +++ b/app/code/Magento/CatalogInventory/Model/Source/Stock.php @@ -13,8 +13,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class Stock extends AbstractSource { diff --git a/app/code/Magento/CatalogInventory/Model/Spi/StockRegistryProviderInterface.php b/app/code/Magento/CatalogInventory/Model/Spi/StockRegistryProviderInterface.php index b2dfe532ffbe..bbba3498ab03 100644 --- a/app/code/Magento/CatalogInventory/Model/Spi/StockRegistryProviderInterface.php +++ b/app/code/Magento/CatalogInventory/Model/Spi/StockRegistryProviderInterface.php @@ -9,8 +9,8 @@ * Interface StockRegistryProviderInterface * * @deprecated 100.3.2 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockRegistryProviderInterface { diff --git a/app/code/Magento/CatalogInventory/Model/Spi/StockStateProviderInterface.php b/app/code/Magento/CatalogInventory/Model/Spi/StockStateProviderInterface.php index 5bb78e1489b3..2cc69513f31b 100644 --- a/app/code/Magento/CatalogInventory/Model/Spi/StockStateProviderInterface.php +++ b/app/code/Magento/CatalogInventory/Model/Spi/StockStateProviderInterface.php @@ -11,8 +11,8 @@ * Interface StockStateProviderInterface * * @deprecated 100.3.2 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockStateProviderInterface { diff --git a/app/code/Magento/CatalogInventory/Model/Stock/Status.php b/app/code/Magento/CatalogInventory/Model/Stock/Status.php index 4941d5d333bd..7066d06c7f1a 100644 --- a/app/code/Magento/CatalogInventory/Model/Stock/Status.php +++ b/app/code/Magento/CatalogInventory/Model/Stock/Status.php @@ -27,6 +27,11 @@ class Status extends AbstractExtensibleModel implements StockStatusInterface const KEY_STOCK_STATUS = 'stock_status'; /**#@-*/ + /** + * @var StockRegistryInterface + */ + private $stockRegistry; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry diff --git a/app/code/Magento/CatalogInventory/Model/Stock/StockItemRepository.php b/app/code/Magento/CatalogInventory/Model/Stock/StockItemRepository.php index 515080d56541..936cafb60f33 100644 --- a/app/code/Magento/CatalogInventory/Model/Stock/StockItemRepository.php +++ b/app/code/Magento/CatalogInventory/Model/Stock/StockItemRepository.php @@ -25,6 +25,7 @@ use Magento\Framework\Stdlib\DateTime\DateTime; use Magento\Framework\Stdlib\DateTime\TimezoneInterface; use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; +use Psr\Log\LoggerInterface as PsrLogger; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -98,8 +99,11 @@ class StockItemRepository implements StockItemRepositoryInterface protected $productCollectionFactory; /** - * Constructor - * + * @var PsrLogger + */ + private $psrLogger; + + /** * @param StockConfigurationInterface $stockConfiguration * @param StockStateProviderInterface $stockStateProvider * @param StockItemResource $resource @@ -111,7 +115,8 @@ class StockItemRepository implements StockItemRepositoryInterface * @param TimezoneInterface $localeDate * @param Processor $indexProcessor * @param DateTime $dateTime - * @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory|null $collectionFactory + * @param CollectionFactory|null $productCollectionFactory + * @param PsrLogger|null $psrLogger * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -126,7 +131,8 @@ public function __construct( TimezoneInterface $localeDate, Processor $indexProcessor, DateTime $dateTime, - \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory = null + \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory = null, + PsrLogger $psrLogger = null ) { $this->stockConfiguration = $stockConfiguration; $this->stockStateProvider = $stockStateProvider; @@ -141,6 +147,8 @@ public function __construct( $this->dateTime = $dateTime; $this->productCollectionFactory = $productCollectionFactory ?: ObjectManager::getInstance() ->get(CollectionFactory::class); + $this->psrLogger = $psrLogger ?: ObjectManager::getInstance() + ->get(PsrLogger::class); } /** @@ -184,6 +192,7 @@ public function save(\Magento\CatalogInventory\Api\Data\StockItemInterface $stoc $this->resource->save($stockItem); } catch (\Exception $exception) { + $this->psrLogger->error($exception->getMessage()); throw new CouldNotSaveException(__('The stock item was unable to be saved. Please try again.'), $exception); } return $stockItem; diff --git a/app/code/Magento/CatalogInventory/Model/StockStateProvider.php b/app/code/Magento/CatalogInventory/Model/StockStateProvider.php index b57518b681aa..bfa854edeaaf 100644 --- a/app/code/Magento/CatalogInventory/Model/StockStateProvider.php +++ b/app/code/Magento/CatalogInventory/Model/StockStateProvider.php @@ -105,47 +105,46 @@ public function verifyNotification(StockItemInterface $stockItem) * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function checkQuoteItemQty(StockItemInterface $stockItem, $qty, $summaryQty, $origQty = 0) { $result = $this->objectFactory->create(); $result->setHasError(false); - $qty = $this->getNumber($qty); - - /** - * Check quantity type - */ - $result->setItemIsQtyDecimal($stockItem->getIsQtyDecimal()); - if (!$stockItem->getIsQtyDecimal()) { - $result->setHasQtyOptionUpdate(true); - $qty = (int) $qty ?: 1; - /** - * Adding stock data to quote item - */ - $result->setItemQty($qty); - $result->setOrigQty((int)$this->getNumber($origQty) ?: 1); - } + $quoteMessage = __('Please correct the quantity for some products.'); if ($stockItem->getMinSaleQty() && $qty < $stockItem->getMinSaleQty()) { $result->setHasError(true) ->setMessage(__('The fewest you may purchase is %1.', $stockItem->getMinSaleQty() * 1)) ->setErrorCode('qty_min') - ->setQuoteMessage(__('Please correct the quantity for some products.')) + ->setQuoteMessage($quoteMessage) ->setQuoteMessageIndex('qty'); return $result; } if ($stockItem->getMaxSaleQty() && $qty > $stockItem->getMaxSaleQty()) { $result->setHasError(true) - ->setMessage(__('The most you may purchase is %1.', $stockItem->getMaxSaleQty() * 1)) + ->setMessage(__('The requested qty exceeds the maximum qty allowed in shopping cart')) ->setErrorCode('qty_max') - ->setQuoteMessage(__('Please correct the quantity for some products.')) + ->setQuoteMessage($quoteMessage) ->setQuoteMessageIndex('qty'); return $result; } $result->addData($this->checkQtyIncrements($stockItem, $qty)->getData()); + + $result->setItemIsQtyDecimal($stockItem->getIsQtyDecimal()); + if (!$stockItem->getIsQtyDecimal() && (floor($qty) !== $qty)) { + $result->setHasError(true) + ->setMessage(__('You cannot use decimal quantity for this product.')) + ->setErrorCode('qty_decimal') + ->setQuoteMessage($quoteMessage) + ->setQuoteMessageIndex('qty'); + + return $result; + } + if ($result->getHasError()) { return $result; } diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminCatalogInventoryChangeManageStockActionGroup.xml b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminCatalogInventoryChangeManageStockActionGroup.xml index 2c38f14f5337..b93c2af43e64 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminCatalogInventoryChangeManageStockActionGroup.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminCatalogInventoryChangeManageStockActionGroup.xml @@ -16,6 +16,8 @@ <argument name="manageStock" type="string" defaultValue="Yes"/> </arguments> <conditionalClick selector="{{AdminProductFormSection.advancedInventoryLink}}" dependentSelector="{{AdminProductFormAdvancedInventorySection.advancedInventoryModal}}" visible="false" stepKey="openAdvancedInventoryWindow"/> + <!-- Wait for close button appeared. That means animation finished and modal window is fully visible --> + <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryCloseButton}}" stepKey="waitForCloseButtonAppeared"/> <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" stepKey="waitForAdvancedInventoryModalWindowOpen"/> <uncheckOption selector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" stepKey="uncheckManageStockConfigSetting"/> <selectOption selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="{{manageStock}}" stepKey="changeManageStock"/> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductSetMaxQtyAllowedInShoppingCartActionGroup.xml b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductSetMaxQtyAllowedInShoppingCartActionGroup.xml index a5e4d3e9c2af..e8871365dabe 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductSetMaxQtyAllowedInShoppingCartActionGroup.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductSetMaxQtyAllowedInShoppingCartActionGroup.xml @@ -13,11 +13,11 @@ <argument name="qty" type="string"/> </arguments> <conditionalClick selector="{{AdminProductFormSection.advancedInventoryLink}}" dependentSelector="{{AdminProductFormAdvancedInventorySection.advancedInventoryModal}}" visible="false" stepKey="clickOnAdvancedInventoryLinkIfNeeded"/> + <!-- Wait for close button appeared. That means animation finished and modal window is fully visible --> + <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryCloseButton}}" stepKey="waitForCloseButtonAppeared"/> <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.maxiQtyConfigSetting}}" stepKey="waitForAdvancedInventoryModalWindowOpen"/> <uncheckOption selector="{{AdminProductFormAdvancedInventorySection.maxiQtyConfigSetting}}" stepKey="uncheckMaxQtyCheckBox"/> <fillField selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCart}}" userInput="{{qty}}" stepKey="fillMaxAllowedQty"/> <click selector="{{AdminSlideOutDialogSection.doneButton}}" stepKey="clickDone"/> </actionGroup> - - </actionGroups> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Test/AssociatedProductToConfigurableOutOfStockTest.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AssociatedProductToConfigurableOutOfStockTest.xml index e7387ddd5d67..eb076d23919b 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/Test/AssociatedProductToConfigurableOutOfStockTest.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AssociatedProductToConfigurableOutOfStockTest.xml @@ -109,8 +109,8 @@ <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNext"/> <!-- Checkout select Check/Money Order payment --> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <waitForPageLoad stepKey="waitForOrderSuccessPage1"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForOrderSuccessPage1"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> <actionGroup ref="StorefrontSignOutActionGroup" stepKey="StorefrontSignOutActionGroup"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/CacheCleanerTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/CacheCleanerTest.php index f65ccaf806c1..794f5d92da1e 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/CacheCleanerTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/CacheCleanerTest.php @@ -7,6 +7,7 @@ namespace Magento\CatalogInventory\Test\Unit\Model\Indexer\Stock; +use Magento\Catalog\Model\Category; use Magento\Catalog\Model\Product; use Magento\CatalogInventory\Api\StockConfigurationInterface; use Magento\CatalogInventory\Model\Indexer\Stock\CacheCleaner; @@ -20,6 +21,9 @@ use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +/** + * Test for CacheCleaner + */ class CacheCleanerTest extends TestCase { /** @@ -70,14 +74,16 @@ protected function setUp(): void $this->connectionMock = $this->getMockBuilder(AdapterInterface::class) ->getMock(); $this->stockConfigurationMock = $this->getMockBuilder(StockConfigurationInterface::class) - ->setMethods(['getStockThresholdQty'])->getMockForAbstractClass(); + ->setMethods(['getStockThresholdQty']) + ->getMockForAbstractClass(); $this->cacheContextMock = $this->getMockBuilder(CacheContext::class) ->disableOriginalConstructor() ->getMock(); $this->eventManagerMock = $this->getMockBuilder(ManagerInterface::class) ->getMock(); $this->metadataPoolMock = $this->getMockBuilder(MetadataPool::class) - ->setMethods(['getMetadata', 'getLinkField'])->disableOriginalConstructor() + ->setMethods(['getMetadata', 'getLinkField']) + ->disableOriginalConstructor() ->getMock(); $this->selectMock = $this->getMockBuilder(Select::class) ->disableOriginalConstructor() @@ -100,37 +106,63 @@ protected function setUp(): void } /** + * Test clean cache by product ids and category ids + * * @param bool $stockStatusBefore * @param bool $stockStatusAfter * @param int $qtyAfter * @param bool|int $stockThresholdQty * @dataProvider cleanDataProvider + * @return void */ - public function testClean($stockStatusBefore, $stockStatusAfter, $qtyAfter, $stockThresholdQty) + public function testClean($stockStatusBefore, $stockStatusAfter, $qtyAfter, $stockThresholdQty): void { $productId = 123; - $this->selectMock->expects($this->any())->method('from')->willReturnSelf(); - $this->selectMock->expects($this->any())->method('where')->willReturnSelf(); - $this->selectMock->expects($this->any())->method('joinLeft')->willReturnSelf(); - $this->connectionMock->expects($this->exactly(2))->method('select')->willReturn($this->selectMock); - $this->connectionMock->expects($this->exactly(2))->method('fetchAll')->willReturnOnConsecutiveCalls( - [ - ['product_id' => $productId, 'stock_status' => $stockStatusBefore], - ], - [ - ['product_id' => $productId, 'stock_status' => $stockStatusAfter, 'qty' => $qtyAfter], - ] - ); - $this->stockConfigurationMock->expects($this->once())->method('getStockThresholdQty') + $categoryId = 3; + $this->selectMock->expects($this->any()) + ->method('from') + ->willReturnSelf(); + $this->selectMock->expects($this->any()) + ->method('where') + ->willReturnSelf(); + $this->selectMock->expects($this->any()) + ->method('joinLeft') + ->willReturnSelf(); + $this->connectionMock->expects($this->exactly(3)) + ->method('select') + ->willReturn($this->selectMock); + $this->connectionMock->expects($this->exactly(2)) + ->method('fetchAll') + ->willReturnOnConsecutiveCalls( + [ + ['product_id' => $productId, 'stock_status' => $stockStatusBefore], + ], + [ + ['product_id' => $productId, 'stock_status' => $stockStatusAfter, 'qty' => $qtyAfter], + ] + ); + $this->connectionMock->expects($this->exactly(1)) + ->method('fetchCol') + ->willReturn([$categoryId]); + $this->stockConfigurationMock->expects($this->once()) + ->method('getStockThresholdQty') ->willReturn($stockThresholdQty); - $this->cacheContextMock->expects($this->once())->method('registerEntities') - ->with(Product::CACHE_TAG, [$productId]); - $this->eventManagerMock->expects($this->once())->method('dispatch') + $this->cacheContextMock->expects($this->exactly(2)) + ->method('registerEntities') + ->withConsecutive( + [Product::CACHE_TAG, [$productId]], + [Category::CACHE_TAG, [$categoryId]], + ); + $this->eventManagerMock->expects($this->exactly(2)) + ->method('dispatch') ->with('clean_cache_by_tags', ['object' => $this->cacheContextMock]); - $this->metadataPoolMock->expects($this->exactly(2))->method('getMetadata') + $this->metadataPoolMock->expects($this->exactly(2)) + ->method('getMetadata') ->willReturnSelf(); - $this->metadataPoolMock->expects($this->exactly(2))->method('getLinkField') + $this->metadataPoolMock->expects($this->exactly(2)) + ->method('getLinkField') ->willReturn('row_id'); + $callback = function () { }; $this->unit->clean([], $callback); @@ -139,7 +171,7 @@ public function testClean($stockStatusBefore, $stockStatusAfter, $qtyAfter, $sto /** * @return array */ - public function cleanDataProvider() + public function cleanDataProvider(): array { return [ [true, false, 1, false], @@ -155,29 +187,42 @@ public function cleanDataProvider() * @param int $qtyAfter * @param bool|int $stockThresholdQty * @dataProvider notCleanCacheDataProvider + * @return void */ - public function testNotCleanCache($stockStatusBefore, $stockStatusAfter, $qtyAfter, $stockThresholdQty) + public function testNotCleanCache($stockStatusBefore, $stockStatusAfter, $qtyAfter, $stockThresholdQty): void { $productId = 123; - $this->selectMock->expects($this->any())->method('from')->willReturnSelf(); - $this->selectMock->expects($this->any())->method('where')->willReturnSelf(); - $this->selectMock->expects($this->any())->method('joinLeft')->willReturnSelf(); - $this->connectionMock->expects($this->exactly(2))->method('select')->willReturn($this->selectMock); - $this->connectionMock->expects($this->exactly(2))->method('fetchAll')->willReturnOnConsecutiveCalls( - [ - ['product_id' => $productId, 'stock_status' => $stockStatusBefore], - ], - [ - ['product_id' => $productId, 'stock_status' => $stockStatusAfter, 'qty' => $qtyAfter], - ] - ); - $this->stockConfigurationMock->expects($this->once())->method('getStockThresholdQty') + $this->selectMock->expects($this->any())->method('from') + ->willReturnSelf(); + $this->selectMock->expects($this->any())->method('where') + ->willReturnSelf(); + $this->selectMock->expects($this->any())->method('joinLeft') + ->willReturnSelf(); + $this->connectionMock->expects($this->exactly(2)) + ->method('select') + ->willReturn($this->selectMock); + $this->connectionMock->expects($this->exactly(2)) + ->method('fetchAll') + ->willReturnOnConsecutiveCalls( + [ + ['product_id' => $productId, 'stock_status' => $stockStatusBefore], + ], + [ + ['product_id' => $productId, 'stock_status' => $stockStatusAfter, 'qty' => $qtyAfter], + ] + ); + $this->stockConfigurationMock->expects($this->once()) + ->method('getStockThresholdQty') ->willReturn($stockThresholdQty); - $this->cacheContextMock->expects($this->never())->method('registerEntities'); - $this->eventManagerMock->expects($this->never())->method('dispatch'); - $this->metadataPoolMock->expects($this->exactly(2))->method('getMetadata') + $this->cacheContextMock->expects($this->never()) + ->method('registerEntities'); + $this->eventManagerMock->expects($this->never()) + ->method('dispatch'); + $this->metadataPoolMock->expects($this->exactly(2)) + ->method('getMetadata') ->willReturnSelf(); - $this->metadataPoolMock->expects($this->exactly(2))->method('getLinkField') + $this->metadataPoolMock->expects($this->exactly(2)) + ->method('getLinkField') ->willReturn('row_id'); $callback = function () { @@ -188,7 +233,7 @@ public function testNotCleanCache($stockStatusBefore, $stockStatusAfter, $qtyAft /** * @return array */ - public function notCleanCacheDataProvider() + public function notCleanCacheDataProvider(): array { return [ [true, true, 1, false], diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockStateProviderTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockStateProviderTest.php index 9d2fb66dc716..0d900bde6015 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockStateProviderTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockStateProviderTest.php @@ -21,6 +21,8 @@ use PHPUnit\Framework\TestCase; /** + * Unit tests for \Magento\CatalogInventory\Model\StockStateProvider class. + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class StockStateProviderTest extends TestCase @@ -115,6 +117,9 @@ class StockStateProviderTest extends TestCase 'getProductName', ]; + /** + * @inheritDoc + */ protected function setUp(): void { $this->objectManagerHelper = new ObjectManagerHelper($this); @@ -383,7 +388,7 @@ protected function getVariations() 'suggestQty' => 51, 'getStockQty' => $stockQty, 'checkQtyIncrements' => false, - 'checkQuoteItemQty' => false, + 'checkQuoteItemQty' => true, ], ], [ @@ -411,7 +416,7 @@ protected function getVariations() 'getStockQty' => $stockQty, 'checkQtyIncrements' => false, 'checkQuoteItemQty' => true, - ] + ], ], [ 'values' => [ @@ -438,8 +443,8 @@ protected function getVariations() 'getStockQty' => null, 'checkQtyIncrements' => false, 'checkQuoteItemQty' => true, - ] - ] + ], + ], ]; } diff --git a/app/code/Magento/CatalogInventory/i18n/en_US.csv b/app/code/Magento/CatalogInventory/i18n/en_US.csv index af989dc06d47..4bac24ed998b 100644 --- a/app/code/Magento/CatalogInventory/i18n/en_US.csv +++ b/app/code/Magento/CatalogInventory/i18n/en_US.csv @@ -71,3 +71,5 @@ Stock,Stock "Qty Uses Decimals","Qty Uses Decimals" "Allow Multiple Boxes for Shipping","Allow Multiple Boxes for Shipping" "Done","Done" +"The requested qty exceeds the maximum qty allowed in shopping cart","The requested qty exceeds the maximum qty allowed in shopping cart" +"You cannot use decimal quantity for this product.","You cannot use decimal quantity for this product." diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index df167d171e00..38b48e05c55c 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -7,13 +7,23 @@ namespace Magento\CatalogRule\Model\Indexer; use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\ProductFactory; +use Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher; +use Magento\CatalogRule\Model\Indexer\IndexBuilder\ProductLoader; +use Magento\CatalogRule\Model\Indexer\IndexerTableSwapperInterface as TableSwapper; use Magento\CatalogRule\Model\ResourceModel\Rule\Collection as RuleCollection; use Magento\CatalogRule\Model\ResourceModel\Rule\CollectionFactory as RuleCollectionFactory; use Magento\CatalogRule\Model\Rule; +use Magento\Eav\Model\Config; use Magento\Framework\App\ObjectManager; +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Pricing\PriceCurrencyInterface; -use Magento\CatalogRule\Model\Indexer\IndexBuilder\ProductLoader; -use Magento\CatalogRule\Model\Indexer\IndexerTableSwapperInterface as TableSwapper; +use Magento\Framework\Stdlib\DateTime; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\StoreManagerInterface; +use Psr\Log\LoggerInterface; /** * Catalog rule index builder @@ -46,12 +56,12 @@ class IndexBuilder protected $_catalogRuleGroupWebsiteColumnsList = ['rule_id', 'customer_group_id', 'website_id']; /** - * @var \Magento\Framework\App\ResourceConnection + * @var ResourceConnection */ protected $resource; /** - * @var \Magento\Store\Model\StoreManagerInterface + * @var StoreManagerInterface */ protected $storeManager; @@ -61,7 +71,7 @@ class IndexBuilder protected $ruleCollectionFactory; /** - * @var \Psr\Log\LoggerInterface + * @var LoggerInterface */ protected $logger; @@ -71,22 +81,22 @@ class IndexBuilder protected $priceCurrency; /** - * @var \Magento\Eav\Model\Config + * @var Config */ protected $eavConfig; /** - * @var \Magento\Framework\Stdlib\DateTime + * @var DateTime */ protected $dateFormat; /** - * @var \Magento\Framework\Stdlib\DateTime\DateTime + * @var DateTime\DateTime */ protected $dateTime; /** - * @var \Magento\Catalog\Model\ProductFactory + * @var ProductFactory */ protected $productFactory; @@ -136,7 +146,12 @@ class IndexBuilder private $pricesPersistor; /** - * @var \Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher + * @var TimezoneInterface|mixed + */ + private $localeDate; + + /** + * @var ActiveTableSwitcher|mixed */ private $activeTableSwitcher; @@ -146,20 +161,20 @@ class IndexBuilder private $tableSwapper; /** - * @var ProductLoader + * @var ProductLoader|mixed */ private $productLoader; /** * @param RuleCollectionFactory $ruleCollectionFactory * @param PriceCurrencyInterface $priceCurrency - * @param \Magento\Framework\App\ResourceConnection $resource - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Psr\Log\LoggerInterface $logger - * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\Framework\Stdlib\DateTime $dateFormat - * @param \Magento\Framework\Stdlib\DateTime\DateTime $dateTime - * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param ResourceConnection $resource + * @param StoreManagerInterface $storeManager + * @param LoggerInterface $logger + * @param Config $eavConfig + * @param DateTime $dateFormat + * @param DateTime\DateTime $dateTime + * @param ProductFactory $productFactory * @param int $batchCount * @param ProductPriceCalculator|null $productPriceCalculator * @param ReindexRuleProduct|null $reindexRuleProduct @@ -167,21 +182,23 @@ class IndexBuilder * @param RuleProductsSelectBuilder|null $ruleProductsSelectBuilder * @param ReindexRuleProductPrice|null $reindexRuleProductPrice * @param RuleProductPricesPersistor|null $pricesPersistor - * @param \Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher|null $activeTableSwitcher + * @param ActiveTableSwitcher|null $activeTableSwitcher * @param ProductLoader|null $productLoader * @param TableSwapper|null $tableSwapper + * @param TimezoneInterface|null $localeDate * @SuppressWarnings(PHPMD.ExcessiveParameterList) + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( RuleCollectionFactory $ruleCollectionFactory, PriceCurrencyInterface $priceCurrency, - \Magento\Framework\App\ResourceConnection $resource, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Psr\Log\LoggerInterface $logger, - \Magento\Eav\Model\Config $eavConfig, - \Magento\Framework\Stdlib\DateTime $dateFormat, - \Magento\Framework\Stdlib\DateTime\DateTime $dateTime, - \Magento\Catalog\Model\ProductFactory $productFactory, + ResourceConnection $resource, + StoreManagerInterface $storeManager, + LoggerInterface $logger, + Config $eavConfig, + DateTime $dateFormat, + DateTime\DateTime $dateTime, + ProductFactory $productFactory, $batchCount = 1000, ProductPriceCalculator $productPriceCalculator = null, ReindexRuleProduct $reindexRuleProduct = null, @@ -189,9 +206,10 @@ public function __construct( RuleProductsSelectBuilder $ruleProductsSelectBuilder = null, ReindexRuleProductPrice $reindexRuleProductPrice = null, RuleProductPricesPersistor $pricesPersistor = null, - \Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher $activeTableSwitcher = null, + ActiveTableSwitcher $activeTableSwitcher = null, ProductLoader $productLoader = null, - TableSwapper $tableSwapper = null + TableSwapper $tableSwapper = null, + TimezoneInterface $localeDate = null ) { $this->resource = $resource; $this->connection = $resource->getConnection(); @@ -224,19 +242,22 @@ public function __construct( RuleProductPricesPersistor::class ); $this->activeTableSwitcher = $activeTableSwitcher ?? ObjectManager::getInstance()->get( - \Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher::class + ActiveTableSwitcher::class ); $this->productLoader = $productLoader ?? ObjectManager::getInstance()->get( ProductLoader::class ); $this->tableSwapper = $tableSwapper ?? ObjectManager::getInstance()->get(TableSwapper::class); + $this->localeDate = $localeDate ?? + ObjectManager::getInstance()->get(TimezoneInterface::class); } /** * Reindex by id * * @param int $id + * @throws LocalizedException * @return void * @api */ @@ -254,7 +275,7 @@ public function reindexById($id) $this->reindexRuleGroupWebsite->execute(); } catch (\Exception $e) { $this->critical($e); - throw new \Magento\Framework\Exception\LocalizedException( + throw new LocalizedException( __('Catalog rule indexing failed. See details in exception log.') ); } @@ -264,7 +285,7 @@ public function reindexById($id) * Reindex by ids * * @param array $ids - * @throws \Magento\Framework\Exception\LocalizedException + * @throws LocalizedException * @return void * @api */ @@ -274,7 +295,7 @@ public function reindexByIds(array $ids) $this->doReindexByIds($ids); } catch (\Exception $e) { $this->critical($e); - throw new \Magento\Framework\Exception\LocalizedException( + throw new LocalizedException( __("Catalog rule indexing failed. See details in exception log.") ); } @@ -308,7 +329,7 @@ protected function doReindexByIds($ids) /** * Full reindex * - * @throws \Magento\Framework\Exception\LocalizedException + * @throws LocalizedException * @return void * @api */ @@ -318,7 +339,7 @@ public function reindexFull() $this->doReindexFull(); } catch (\Exception $e) { $this->critical($e); - throw new \Magento\Framework\Exception\LocalizedException( + throw new LocalizedException( __("Catalog rule indexing failed. See details in exception log.") ); } @@ -404,9 +425,6 @@ private function assignProductToRule(Rule $rule, int $productEntityId, array $we ); $customerGroupIds = $rule->getCustomerGroupIds(); - $fromTime = strtotime($rule->getFromDate()); - $toTime = strtotime($rule->getToDate()); - $toTime = $toTime ? $toTime + self::SECONDS_IN_DAY - 1 : 0; $sortOrder = (int)$rule->getSortOrder(); $actionOperator = $rule->getSimpleAction(); $actionAmount = $rule->getDiscountAmount(); @@ -414,6 +432,15 @@ private function assignProductToRule(Rule $rule, int $productEntityId, array $we $rows = []; foreach ($websiteIds as $websiteId) { + $scopeTz = new \DateTimeZone( + $this->localeDate->getConfigTimezone(ScopeInterface::SCOPE_WEBSITE, $websiteId) + ); + $fromTime = $rule->getFromDate() + ? (new \DateTime($rule->getFromDate(), $scopeTz))->getTimestamp() + : 0; + $toTime = $rule->getToDate() + ? (new \DateTime($rule->getToDate(), $scopeTz))->getTimestamp() + IndexBuilder::SECONDS_IN_DAY - 1 + : 0; foreach ($customerGroupIds as $customerGroupId) { $rows[] = [ 'rule_id' => $ruleId, diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexerTableSwapper.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexerTableSwapper.php index f99f8c50a7f9..0ddae74ff0a5 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexerTableSwapper.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexerTableSwapper.php @@ -122,4 +122,14 @@ public function swapIndexTables(array $originalTablesNames) $this->resourceConnection->getConnection()->dropTable($tableName); } } + + /** + * Cleanup leftover temporary tables + */ + public function __destruct() + { + foreach ($this->temporaryTables as $tableName) { + $this->resourceConnection->getConnection()->dropTable($tableName); + } + } } diff --git a/app/code/Magento/CatalogRule/Model/Indexer/ReindexRuleProduct.php b/app/code/Magento/CatalogRule/Model/Indexer/ReindexRuleProduct.php index 944710773123..ff9893ae1b90 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/ReindexRuleProduct.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/ReindexRuleProduct.php @@ -6,8 +6,8 @@ namespace Magento\CatalogRule\Model\Indexer; -use Magento\CatalogRule\Model\Indexer\IndexerTableSwapperInterface as TableSwapper; use Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher; +use Magento\CatalogRule\Model\Indexer\IndexerTableSwapperInterface as TableSwapper; use Magento\CatalogRule\Model\Rule; use Magento\Framework\App\ResourceConnection; use Magento\Framework\Stdlib\DateTime\TimezoneInterface; @@ -18,6 +18,8 @@ */ class ReindexRuleProduct { + private const ADMIN_WEBSITE_ID = 0; + /** * @var ResourceConnection */ @@ -38,22 +40,30 @@ class ReindexRuleProduct */ private $localeDate; + /** + * @var bool + */ + private $useWebsiteTimezone; + /** * @param ResourceConnection $resource * @param ActiveTableSwitcher $activeTableSwitcher * @param TableSwapper $tableSwapper * @param TimezoneInterface $localeDate + * @param bool $useWebsiteTimezone */ public function __construct( ResourceConnection $resource, ActiveTableSwitcher $activeTableSwitcher, TableSwapper $tableSwapper, - TimezoneInterface $localeDate + TimezoneInterface $localeDate, + bool $useWebsiteTimezone = true ) { $this->resource = $resource; $this->activeTableSwitcher = $activeTableSwitcher; $this->tableSwapper = $tableSwapper; $this->localeDate = $localeDate; + $this->useWebsiteTimezone = $useWebsiteTimezone; } /** @@ -95,18 +105,23 @@ public function execute(Rule $rule, $batchCount, $useAdditionalTable = false) $actionOperator = $rule->getSimpleAction(); $actionAmount = $rule->getDiscountAmount(); $actionStop = $rule->getStopRulesProcessing(); + $fromTimeInAdminTz = $this->parseDateByWebsiteTz((string)$rule->getFromDate(), self::ADMIN_WEBSITE_ID); + $toTimeInAdminTz = $this->parseDateByWebsiteTz((string)$rule->getToDate(), self::ADMIN_WEBSITE_ID); + $excludedWebsites = []; + $ruleExtensionAttributes = $rule->getExtensionAttributes(); + if ($ruleExtensionAttributes && $ruleExtensionAttributes->getExcludeWebsiteIds()) { + $excludedWebsites = $ruleExtensionAttributes->getExcludeWebsiteIds(); + } $rows = []; foreach ($websiteIds as $websiteId) { - $scopeTz = new \DateTimeZone( - $this->localeDate->getConfigTimezone(ScopeInterface::SCOPE_WEBSITE, $websiteId) - ); - $fromTime = $rule->getFromDate() - ? (new \DateTime($rule->getFromDate(), $scopeTz))->getTimestamp() - : 0; - $toTime = $rule->getToDate() - ? (new \DateTime($rule->getToDate(), $scopeTz))->getTimestamp() + IndexBuilder::SECONDS_IN_DAY - 1 - : 0; + $fromTime = $this->useWebsiteTimezone + ? $this->parseDateByWebsiteTz((string)$rule->getFromDate(), (int)$websiteId) + : $fromTimeInAdminTz; + $toTime = $this->useWebsiteTimezone + ? $this->parseDateByWebsiteTz((string)$rule->getToDate(), (int)$websiteId) + + ($rule->getToDate() ? IndexBuilder::SECONDS_IN_DAY - 1 : 0) + : $toTimeInAdminTz; foreach ($productIds as $productId => $validationByWebsite) { if (empty($validationByWebsite[$websiteId])) { @@ -114,22 +129,26 @@ public function execute(Rule $rule, $batchCount, $useAdditionalTable = false) } foreach ($customerGroupIds as $customerGroupId) { - $rows[] = [ - 'rule_id' => $ruleId, - 'from_time' => $fromTime, - 'to_time' => $toTime, - 'website_id' => $websiteId, - 'customer_group_id' => $customerGroupId, - 'product_id' => $productId, - 'action_operator' => $actionOperator, - 'action_amount' => $actionAmount, - 'action_stop' => $actionStop, - 'sort_order' => $sortOrder, - ]; - - if (count($rows) == $batchCount) { - $connection->insertMultiple($indexTable, $rows); - $rows = []; + if (!array_key_exists($customerGroupId, $excludedWebsites) + || !in_array((int)$websiteId, array_values($excludedWebsites[$customerGroupId]), true) + ) { + $rows[] = [ + 'rule_id' => $ruleId, + 'from_time' => $fromTime, + 'to_time' => $toTime, + 'website_id' => $websiteId, + 'customer_group_id' => $customerGroupId, + 'product_id' => $productId, + 'action_operator' => $actionOperator, + 'action_amount' => $actionAmount, + 'action_stop' => $actionStop, + 'sort_order' => $sortOrder, + ]; + + if (count($rows) === $batchCount) { + $connection->insertMultiple($indexTable, $rows); + $rows = []; + } } } } @@ -140,4 +159,23 @@ public function execute(Rule $rule, $batchCount, $useAdditionalTable = false) return true; } + + /** + * Parse date value by the timezone of the website + * + * @param string $date + * @param int $websiteId + * @return int + */ + private function parseDateByWebsiteTz(string $date, int $websiteId): int + { + if (empty($date)) { + return 0; + } + + $websiteTz = $this->localeDate->getConfigTimezone(ScopeInterface::SCOPE_WEBSITE, $websiteId); + $dateTime = new \DateTime($date, new \DateTimeZone($websiteTz)); + + return $dateTime->getTimestamp(); + } } diff --git a/app/code/Magento/CatalogRule/Model/Indexer/ReindexRuleProductPrice.php b/app/code/Magento/CatalogRule/Model/Indexer/ReindexRuleProductPrice.php index 51869f1accbb..ccc5352567ff 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/ReindexRuleProductPrice.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/ReindexRuleProductPrice.php @@ -7,6 +7,7 @@ namespace Magento\CatalogRule\Model\Indexer; use Magento\Framework\Stdlib\DateTime\TimezoneInterface; +use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; /** @@ -39,25 +40,33 @@ class ReindexRuleProductPrice */ private $pricesPersistor; + /** + * @var bool + */ + private $useWebsiteTimezone; + /** * @param StoreManagerInterface $storeManager * @param RuleProductsSelectBuilder $ruleProductsSelectBuilder * @param ProductPriceCalculator $productPriceCalculator * @param TimezoneInterface $localeDate * @param RuleProductPricesPersistor $pricesPersistor + * @param bool $useWebsiteTimezone */ public function __construct( StoreManagerInterface $storeManager, RuleProductsSelectBuilder $ruleProductsSelectBuilder, ProductPriceCalculator $productPriceCalculator, TimezoneInterface $localeDate, - RuleProductPricesPersistor $pricesPersistor + RuleProductPricesPersistor $pricesPersistor, + bool $useWebsiteTimezone = true ) { $this->storeManager = $storeManager; $this->ruleProductsSelectBuilder = $ruleProductsSelectBuilder; $this->productPriceCalculator = $productPriceCalculator; $this->localeDate = $localeDate; $this->pricesPersistor = $pricesPersistor; + $this->useWebsiteTimezone = $useWebsiteTimezone; } /** @@ -82,11 +91,9 @@ public function execute(int $batchCount, ?int $productId = null, bool $useAdditi $prevKey = null; $storeGroup = $this->storeManager->getGroup($website->getDefaultGroupId()); - $currentDate = $this->localeDate->scopeDate($storeGroup->getDefaultStoreId(), null, true); - $previousDate = (clone $currentDate)->modify('-1 day'); - $previousDate->setTime(23, 59, 59); - $nextDate = (clone $currentDate)->modify('+1 day'); - $nextDate->setTime(0, 0, 0); + $dateInterval = $this->useWebsiteTimezone + ? $this->getDateInterval((int)$storeGroup->getDefaultStoreId()) + : $this->getDateInterval(Store::DEFAULT_STORE_ID); while ($ruleData = $productsStmt->fetch()) { $ruleProductId = $ruleData['product_id']; @@ -107,7 +114,7 @@ public function execute(int $batchCount, ?int $productId = null, bool $useAdditi /** * Build prices for each day */ - foreach ([$previousDate, $currentDate, $nextDate] as $date) { + foreach ($dateInterval as $date) { $time = $date->getTimestamp(); if (($ruleData['from_time'] == 0 || $time >= $ruleData['from_time']) && ($ruleData['to_time'] == 0 || @@ -157,4 +164,21 @@ public function execute(int $batchCount, ?int $productId = null, bool $useAdditi return true; } + + /** + * Retrieve date sequence in store time zone + * + * @param int $storeId + * @return \DateTime[] + */ + private function getDateInterval(int $storeId): array + { + $currentDate = $this->localeDate->scopeDate($storeId, null, true); + $previousDate = (clone $currentDate)->modify('-1 day'); + $previousDate->setTime(23, 59, 59); + $nextDate = (clone $currentDate)->modify('+1 day'); + $nextDate->setTime(0, 0, 0); + + return [$previousDate, $currentDate, $nextDate]; + } } diff --git a/app/code/Magento/CatalogRule/Model/ResourceModel/Rule/Collection.php b/app/code/Magento/CatalogRule/Model/ResourceModel/Rule/Collection.php index fdc039067cc3..f7a01de2d277 100644 --- a/app/code/Magento/CatalogRule/Model/ResourceModel/Rule/Collection.php +++ b/app/code/Magento/CatalogRule/Model/ResourceModel/Rule/Collection.php @@ -5,8 +5,8 @@ */ namespace Magento\CatalogRule\Model\ResourceModel\Rule; -use Magento\Framework\Serialize\Serializer\Json; use Magento\Framework\App\ObjectManager; +use Magento\Framework\Serialize\Serializer\Json; class Collection extends \Magento\Rule\Model\ResourceModel\Rule\Collection\AbstractCollection { @@ -22,6 +22,16 @@ class Collection extends \Magento\Rule\Model\ResourceModel\Rule\Collection\Abstr */ protected $serializer; + /** + * @var string + */ + protected $_eventPrefix = 'catalog_rule_collection'; + + /** + * @var string + */ + protected $_eventObject = 'catalog_rule'; + /** * Collection constructor. * @param \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory diff --git a/app/code/Magento/CatalogRule/Model/Rule.php b/app/code/Magento/CatalogRule/Model/Rule.php index 2d9219236896..da32801ace47 100644 --- a/app/code/Magento/CatalogRule/Model/Rule.php +++ b/app/code/Magento/CatalogRule/Model/Rule.php @@ -589,7 +589,7 @@ protected function _invalidateCache() */ public function afterSave() { - if (!$this->getIsActive()) { + if (!$this->getIsActive() && !$this->getOrigData(self::IS_ACTIVE)) { return parent::afterSave(); } @@ -601,6 +601,7 @@ public function afterSave() } else { $this->_ruleProductProcessor->getIndexer()->invalidate(); } + return parent::afterSave(); } diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCatalogPriceRuleDeleteAllActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCatalogPriceRuleDeleteAllActionGroup.xml index 27edab962033..d16255e0237b 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCatalogPriceRuleDeleteAllActionGroup.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCatalogPriceRuleDeleteAllActionGroup.xml @@ -16,7 +16,7 @@ <!-- It sometimes is loading too long for default 10s --> <waitForPageLoad time="60" stepKey="waitForPageFullyLoaded"/> <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> - <helper class="\Magento\Rule\Test\Mftf\Helper\RuleHelper" method="deleteAllRulesOneByOne" stepKey="deleteAllRulesOneByOne"> + <helper class="Magento\Rule\Test\Mftf\Helper\RuleHelper" method="deleteAllRulesOneByOne" stepKey="deleteAllRulesOneByOne"> <argument name="firstNotEmptyRow">{{AdminDataGridTableSection.firstNotEmptyRow}}</argument> <argument name="modalAcceptButton">{{AdminConfirmationModalSection.ok}}</argument> <argument name="deleteButton">{{AdminMainActionsSection.delete}}</argument> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SaveAndContinueEditCatalogPriceRuleActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SaveAndContinueEditCatalogPriceRuleActionGroup.xml new file mode 100644 index 000000000000..cf8499ca1b46 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SaveAndContinueEditCatalogPriceRuleActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="SaveAndContinueEditCatalogPriceRuleActionGroup"> + <annotations> + <description>Clicks on Save and Continue Edit. Validates that the Success Message is present and correct on the Admin Catalog Price Rule creation/edit page.</description> + </annotations> + + <waitForElementVisible selector="{{AdminNewCatalogPriceRule.saveAndContinue}}" stepKey="waitForSaveAndContinueEditButton"/> + <click selector="{{AdminNewCatalogPriceRule.saveAndContinue}}" stepKey="saveAndContinueEdit"/> + <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml index 3109c56122d1..c49b31ad4734 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml @@ -78,16 +78,14 @@ <!-- 3. Save and apply the new catalog price rule --> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- 4. Verify the storefront --> - <amOnPage url="$$createCategoryOne.name$$.html" stepKey="goToCategoryOne"/> + <amOnPage url="$$createCategoryOne.custom_attributes[url_key]$$.html" stepKey="goToCategoryOne"/> <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$$createSimpleProductOne.name$$" stepKey="seeProductOne"/> <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$61.50" stepKey="seeProductOnePrice"/> <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="Regular Price $123.00" stepKey="seeProductOneRegularPrice"/> - <amOnPage url="$$createCategoryTwo.name$$.html" stepKey="goToCategoryTwo"/> + <amOnPage url="$$createCategoryTwo.custom_attributes[url_key]$$.html" stepKey="goToCategoryTwo"/> <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$$createSimpleProductTwo.name$$" stepKey="seeProductTwo"/> <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$123.00" stepKey="seeProductTwoPrice"/> <dontSee selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$61.50" stepKey="dontSeeDiscount"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml index 97e93c8f762c..26e1966ece36 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml @@ -127,9 +127,7 @@ <actionGroup ref="SaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Open Storefront product page and assert created configurable product --> <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage"> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleByPercentTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleByPercentTest.xml index 946a25d721cb..843bc4e722e6 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleByPercentTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleByPercentTest.xml @@ -25,9 +25,7 @@ </createData> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- log in and create the price rule --> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> @@ -49,13 +47,13 @@ </after> <!-- Go to category page and make sure that all of the prices are correct --> - <amOnPage url="$$createCategory.name$$.html" stepKey="goToCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="goToCategoryPage"/> <waitForPageLoad stepKey="waitForCategory"/> <see stepKey="seeOldPrice" selector="{{StorefrontCategoryProductSection.ProductOldPriceByNumber('1')}}" userInput="$$createProduct.price$$"/> <see stepKey="seeNewPrice" selector="{{StorefrontCategoryProductSection.ProductSpecialPriceByNumber('1')}}" userInput="$110.70"/> <!-- Go to the simple product page and check that the prices are correct --> - <amOnPage stepKey="goToProductPage" url="$$createProduct.sku$$.html"/> + <amOnPage stepKey="goToProductPage" url="$$createProduct.custom_attributes[url_key]$$.html"/> <waitForPageLoad stepKey="waitForProductPage"/> <see stepKey="seeOldPriceTag" selector="{{StorefrontProductInfoMainSection.oldPriceTag}}" userInput="Regular Price"/> <see stepKey="seeOldPrice2" selector="{{StorefrontProductInfoMainSection.oldPriceAmount}}" userInput="$$createProduct.price$$"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleForCustomerGroupTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleForCustomerGroupTest.xml index e55cabd50646..a6a735bb81de 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleForCustomerGroupTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleForCustomerGroupTest.xml @@ -49,9 +49,7 @@ <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- As a NOT LOGGED IN user, go to the storefront category page and should see the discount --> <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="goToCategory1"> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromConfigurableProductTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromConfigurableProductTest.xml index 831470e0d64c..c6a3291561fa 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromConfigurableProductTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromConfigurableProductTest.xml @@ -72,9 +72,7 @@ </createData> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> @@ -115,12 +113,10 @@ <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the rule." stepKey="seeDeletedRuleMessage1"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Assert that the rule isn't present on the Category page --> - <amOnPage url="$$createCategory1.name$$.html" stepKey="goToStorefrontCategoryPage1"/> + <amOnPage url="$$createCategory1.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage1"/> <waitForPageLoad stepKey="waitForPageLoad2"/> <see selector="{{StorefrontCategoryProductSection.ProductPriceByName($$createConfigProduct1.name$$)}}" userInput="$$createConfigChildProduct1.price$$" stepKey="seeRegularPriceText1"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromSimpleProductTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromSimpleProductTest.xml index 5a62b1a373f9..c6452612f82a 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromSimpleProductTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromSimpleProductTest.xml @@ -60,18 +60,16 @@ <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the rule." stepKey="seeDeletedRuleMessage1"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Assert that the rule isn't present on the Category page --> - <amOnPage url="$$createCategory1.name$$.html" stepKey="goToStorefrontCategoryPage1"/> + <amOnPage url="$$createCategory1.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage1"/> <waitForPageLoad stepKey="waitForPageLoad3"/> <dontSee selector="{{StorefrontCategoryProductSection.ProductCatalogRulePriceTitleByName($$createProduct1.name$$)}}" userInput="Regular Price" stepKey="dontSeeRegularPriceText1"/> <dontSeeElement selector="{{StorefrontCategoryProductSection.ProductCatalogRuleSpecialPriceTitleByName($$createProduct1.name$$)}}" stepKey="dontSeeSpecialPrice1"/> <!-- Assert that the rule isn't present on the Product page --> - <amOnPage url="$$createProduct1.name$$.html" stepKey="goToStorefrontProductPage1"/> + <amOnPage url="$$createProduct1.custom_attributes[url_key]$$.html" stepKey="goToStorefrontProductPage1"/> <waitForPageLoad stepKey="waitForPageLoad4"/> <dontSee selector="{{StorefrontProductInfoMainSection.oldPriceTag}}" userInput="Regular Price" stepKey="dontSeeRegularPRiceText2"/> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createProduct1.price$$" stepKey="seeTrueProductPrice1"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml index d03ca6b22d66..333c4ab06aad 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml @@ -38,6 +38,15 @@ <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <amOnPage url="{{AdminCatalogPriceRuleGridPage.url}}" stepKey="goToCatalogRuleGridPage"/> <waitForPageLoad stepKey="waitForCatalogRuleGridPageLoaded"/> @@ -52,7 +61,7 @@ <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/> <!-- Verify that category page shows the discount --> - <amOnPage url="$$createCategory.name$$.html" stepKey="goToCategoryPage1"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="goToCategoryPage1"/> <see selector="{{StorefrontCategoryProductSection.ProductTitleByName(ApiSimpleProduct.name)}}" userInput="$$createSimpleProduct.name$$" stepKey="seeSimpleProduct1"/> <see selector="{{StorefrontCategoryProductSection.ProductPriceByName(ApiSimpleProduct.name)}}" userInput="$110.70" stepKey="seeSimpleProductDiscount1"/> <see selector="{{StorefrontCategoryProductSection.ProductTitleByName(_defaultProduct.name)}}" userInput="{{_defaultProduct.name}}" stepKey="seeConfigurableProduct1"/> @@ -86,12 +95,10 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value="catalog_product_price"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Verify that category page shows the original prices --> - <amOnPage url="$$createCategory.name$$.html" stepKey="goToCategoryPage2"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="goToCategoryPage2"/> <see selector="{{StorefrontCategoryProductSection.ProductTitleByName(ApiSimpleProduct.name)}}" userInput="$$createSimpleProduct.name$$" stepKey="seeSimpleProduct2"/> <see selector="{{StorefrontCategoryProductSection.ProductPriceByName(ApiSimpleProduct.name)}}" userInput="$123.00" stepKey="seeSimpleProductDiscount2"/> <see selector="{{StorefrontCategoryProductSection.ProductTitleByName(_defaultProduct.name)}}" userInput="{{_defaultProduct.name}}" stepKey="seeConfigurableProduct2"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml index da62981c9920..1951aa6c0f6a 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml @@ -80,9 +80,7 @@ </actionGroup> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="clickSaveAndApplyRules"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Check Catalog Price Rule for first product--> <amOnPage url="{{StorefrontProductPage.url($$createFirstProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToFirstProductPage"/> @@ -128,9 +126,7 @@ </actionGroup> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="clickSaveAndApplyRules1"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexSecondTime"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheSecondTime"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheSecondTime"/> <!--Check Catalog Price Rule for third product--> <amOnPage url="{{StorefrontProductPage.url($$createThirdProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToThirdProductPage"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml index 6de7bba59c34..0e1059f2f5f1 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml @@ -234,19 +234,17 @@ <!-- Run cron --> <magentoCron stepKey="runAllCronJobs"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Go to Frontend and open the simple product --> - <amOnPage url="{{StorefrontProductPage.url($$createFirstProduct.sku$$)}}" stepKey="amOnSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createFirstProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> <!-- Verify Price for simple product with specialColor green=$20 --> <see userInput="20.00" selector="{{StorefrontProductInfoMainSection.updatedPrice}}" stepKey="seePrice20"/> <!-- Go to Frontend and Open the Configurable product --> - <amOnPage url="{{StorefrontProductPage.url($$createConfigProduct.sku$$)}}" stepKey="amOnConfigProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createConfigProduct.custom_attributes[url_key]$$)}}" stepKey="amOnConfigProductPage"/> <waitForPageLoad stepKey="waitForConfigProductPageLoad"/> <!-- Verify Price for configurable product with specialColor green=$30 --> @@ -259,7 +257,7 @@ <see userInput="30.00" selector="{{StorefrontProductInfoMainSection.updatedPrice}}" stepKey="seeOption2Price30"/> <!-- Go to Frontend and open the second simple product --> - <amOnPage url="{{StorefrontProductPage.url($$createSecondProduct.sku$$)}}" stepKey="amOnSecondProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createSecondProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSecondProductPage"/> <waitForPageLoad stepKey="waitForSecondProductPageLoad"/> <!-- Verify Price for simple product with specialColor red=$40 --> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml index c3690e72e084..b1d6935bec28 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml @@ -113,12 +113,10 @@ <actionGroup ref="SaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Navigate to category on store front --> - <amOnPage url="{{StorefrontProductPage.url($createCategory.name$)}}" stepKey="goToCategoryPage"/> + <amOnPage url="{{StorefrontProductPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="goToCategoryPage"/> <!-- Sort products By Price --> <actionGroup ref="StorefrontCategoryPageSortProductActionGroup" stepKey="sortProductByPrice"/> @@ -156,7 +154,7 @@ </actionGroup> <!-- Navigate to simple product on store front --> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct.name$)}}" stepKey="goToProductPage1"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct.custom_attributes[url_key]$)}}" stepKey="goToProductPage1"/> <!-- Assert regular and special price after selecting ProductOptionValueDropdown1 --> <actionGroup ref="AssertStorefrontProductPricesActionGroup" stepKey="assertStorefrontProductPrices"> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml index ece8dc4bacf2..6d8de2cb1d9b 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml @@ -64,15 +64,11 @@ <!-- Save and apply the new catalog price rule --> <actionGroup ref="SaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Navigate to category on store front --> - <amOnPage url="{{StorefrontProductPage.url($createCategory.name$)}}" stepKey="goToCategoryPage"/> + <amOnPage url="{{StorefrontProductPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="goToCategoryPage"/> <!-- Check product 1 name on store front category page --> <actionGroup ref="AssertProductDetailsOnStorefrontActionGroup" stepKey="storefrontProduct1Name"> @@ -93,7 +89,7 @@ </actionGroup> <!-- Navigate to product 1 on store front --> - <amOnPage url="{{StorefrontProductPage.url($createProduct1.name$)}}" stepKey="goToProductPage1"/> + <amOnPage url="{{StorefrontProductPage.url($createProduct1.custom_attributes[url_key]$)}}" stepKey="goToProductPage1"/> <!-- Assert regular and special price after selecting ProductOptionValueDropdown1 --> <actionGroup ref="StorefrontSelectCustomOptionRadioAndAssertPricesActionGroup" stepKey="storefrontSelectCustomOptionAndAssertPrices1"> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml index 3b7c9c181f1b..ba446380a4f6 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml @@ -40,7 +40,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Customer Log Out --> <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> - + <!-- Delete customer --> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> @@ -74,7 +74,7 @@ <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!-- Navigate to category on store front --> - <amOnPage url="{{StorefrontProductPage.url($createCategory.name$)}}" stepKey="goToCategoryPage"/> + <amOnPage url="{{StorefrontProductPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="goToCategoryPage"/> <!-- Check product 1 name on store front category page --> <actionGroup ref="AssertProductDetailsOnStorefrontActionGroup" stepKey="storefrontProductName"> @@ -95,7 +95,7 @@ </actionGroup> <!-- Navigate to product 1 on store front --> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct.name$)}}" stepKey="goToProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct.custom_attributes[url_key]$)}}" stepKey="goToProductPage"/> <!-- Add product 1 to cart --> <actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="cartAddSimpleProductToCart"> @@ -113,7 +113,7 @@ </actionGroup> <!-- Navigate to category on store front as customer--> - <amOnPage url="{{StorefrontProductPage.url($createCategory.name$)}}" stepKey="goToCategoryPageAsCustomer"/> + <amOnPage url="{{StorefrontProductPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="goToCategoryPageAsCustomer"/> <!-- Check simple product name on store front category page --> <actionGroup ref="AssertProductDetailsOnStorefrontActionGroup" stepKey="storefrontProductNameAsCustomer"> @@ -134,7 +134,7 @@ </actionGroup> <!-- Navigate to simple product on store front as customer --> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct.name$)}}" stepKey="goToProductPage1AsCustomer"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct.custom_attributes[url_key]$)}}" stepKey="goToProductPage1AsCustomer"/> <!-- Assert regular and special price as customer--> <actionGroup ref="AssertStorefrontProductPricesActionGroup" stepKey="assertStorefrontProductPrices"> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml index 45e97f179a11..77b10a09d6ce 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml @@ -71,15 +71,11 @@ <!-- Save and apply the new catalog price rule --> <actionGroup ref="SaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Navigate to category on store front --> - <amOnPage url="{{StorefrontProductPage.url($createCategory.name$)}}" stepKey="goToCategoryPage"/> + <amOnPage url="{{StorefrontProductPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="goToCategoryPage"/> <!-- Check product 1 price on store front category page --> <see selector="{{StorefrontCategoryProductSection.ProductInfoByName($createProduct1.name$)}}" userInput="$51.10" stepKey="storefrontProduct1Price"/> @@ -100,7 +96,7 @@ <see selector="{{StorefrontCategoryProductSection.ProductInfoByName($createProduct3.name$)}}" userInput="$56.78" stepKey="storefrontProduct3RegularPrice"/> <!-- Navigate to product 1 on store front --> - <amOnPage url="{{StorefrontProductPage.url($createProduct1.name$)}}" stepKey="goToProductPage1"/> + <amOnPage url="{{StorefrontProductPage.url($createProduct1.custom_attributes[url_key]$)}}" stepKey="goToProductPage1"/> <!-- Assert regular and special price after selecting ProductOptionValueDropdown1 --> <actionGroup ref="StorefrontSelectCustomOptionDropDownAndAssertPricesActionGroup" stepKey="storefrontSelectCustomOptionAndAssertPrices1"> @@ -115,7 +111,7 @@ </actionGroup> <!-- Navigate to product 2 on store front --> - <amOnPage url="{{StorefrontProductPage.url($createProduct1.name$)}}" stepKey="goToProductPage2"/> + <amOnPage url="{{StorefrontProductPage.url($createProduct1.custom_attributes[url_key]$)}}" stepKey="goToProductPage2"/> <!-- Assert regular and special price after selecting ProductOptionValueDropdown3 --> <actionGroup ref="StorefrontSelectCustomOptionDropDownAndAssertPricesActionGroup" stepKey="storefrontSelectCustomOptionAndAssertPrices2"> @@ -130,7 +126,7 @@ </actionGroup> <!-- Navigate to product 3 on store front --> - <amOnPage url="{{StorefrontProductPage.url($createProduct3.name$)}}" stepKey="goToProductPage3"/> + <amOnPage url="{{StorefrontProductPage.url($createProduct3.custom_attributes[url_key]$)}}" stepKey="goToProductPage3"/> <!-- Add product 3 to cart with no custom option --> <actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="cartAddSimpleProduct3ToCart"> diff --git a/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/ReindexRuleProductPriceTest.php b/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/ReindexRuleProductPriceTest.php index 7f22634f9343..230a6e386095 100644 --- a/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/ReindexRuleProductPriceTest.php +++ b/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/ReindexRuleProductPriceTest.php @@ -64,7 +64,8 @@ protected function setUp(): void $this->ruleProductsSelectBuilderMock, $this->productPriceCalculatorMock, $this->localeDate, - $this->pricesPersistorMock + $this->pricesPersistorMock, + true ); } diff --git a/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/ReindexRuleProductTest.php b/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/ReindexRuleProductTest.php index ddb6a85ed614..fff8a80c88e3 100644 --- a/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/ReindexRuleProductTest.php +++ b/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/ReindexRuleProductTest.php @@ -5,7 +5,6 @@ */ declare(strict_types=1); - namespace Magento\CatalogRule\Test\Unit\Model\Indexer; use Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher; @@ -21,6 +20,8 @@ class ReindexRuleProductTest extends TestCase { + private const ADMIN_WEBSITE_ID = 0; + /** * @var ReindexRuleProduct */ @@ -31,11 +32,6 @@ class ReindexRuleProductTest extends TestCase */ private $resourceMock; - /** - * @var ActiveTableSwitcher|MockObject - */ - private $activeTableSwitcherMock; - /** * @var IndexerTableSwapperInterface|MockObject */ @@ -46,45 +42,59 @@ class ReindexRuleProductTest extends TestCase */ private $localeDateMock; + /** + * @var AdapterInterface|MockObject + */ + private $connectionMock; + + /** + * @var Rule|MockObject + */ + private $ruleMock; + protected function setUp(): void { $this->resourceMock = $this->createMock(ResourceConnection::class); - $this->activeTableSwitcherMock = $this->createMock(ActiveTableSwitcher::class); + $activeTableSwitcherMock = $this->createMock(ActiveTableSwitcher::class); $this->tableSwapperMock = $this->getMockForAbstractClass(IndexerTableSwapperInterface::class); $this->localeDateMock = $this->getMockForAbstractClass(TimezoneInterface::class); + $this->connectionMock = $this->getMockForAbstractClass(AdapterInterface::class); + $this->ruleMock = $this->createMock(Rule::class); $this->model = new ReindexRuleProduct( $this->resourceMock, - $this->activeTableSwitcherMock, + $activeTableSwitcherMock, $this->tableSwapperMock, - $this->localeDateMock + $this->localeDateMock, + true ); } - public function testExecuteIfRuleInactive() + public function testExecuteIfRuleInactive(): void { $ruleMock = $this->createMock(Rule::class); - $ruleMock->expects($this->once()) + $ruleMock->expects(self::once()) ->method('getIsActive') ->willReturn(false); - $this->assertFalse($this->model->execute($ruleMock, 100, true)); + self::assertFalse($this->model->execute($ruleMock, 100, true)); } - public function testExecuteIfRuleWithoutWebsiteIds() + public function testExecuteIfRuleWithoutWebsiteIds(): void { $ruleMock = $this->createMock(Rule::class); - $ruleMock->expects($this->once()) + $ruleMock->expects(self::once()) ->method('getIsActive') ->willReturn(true); - $ruleMock->expects($this->once()) + $ruleMock->expects(self::once()) ->method('getWebsiteIds') ->willReturn(null); - $this->assertFalse($this->model->execute($ruleMock, 100, true)); + self::assertFalse($this->model->execute($ruleMock, 100, true)); } - public function testExecute() + public function testExecute(): void { $websiteId = 3; + $adminTimeZone = 'America/Chicago'; $websiteTz = 'America/Los_Angeles'; $productIds = [ 4 => [$websiteId => 1], @@ -92,41 +102,14 @@ public function testExecute() 6 => [$websiteId => 1], ]; - $this->tableSwapperMock->expects($this->once()) - ->method('getWorkingTableName') - ->with('catalogrule_product') - ->willReturn('catalogrule_product_replica'); - - $connectionMock = $this->getMockForAbstractClass(AdapterInterface::class); - $this->resourceMock->expects($this->at(0)) - ->method('getConnection') - ->willReturn($connectionMock); - $this->resourceMock->expects($this->at(1)) - ->method('getTableName') - ->with('catalogrule_product') - ->willReturn('catalogrule_product'); - $this->resourceMock->expects($this->at(2)) - ->method('getTableName') - ->with('catalogrule_product_replica') - ->willReturn('catalogrule_product_replica'); + $this->prepareResourceMock(); + $this->prepareRuleMock([3], $productIds, [10]); - $ruleMock = $this->createMock(Rule::class); - $ruleMock->expects($this->once())->method('getIsActive')->willReturn(true); - $ruleMock->expects($this->exactly(2))->method('getWebsiteIds')->willReturn([$websiteId]); - $ruleMock->expects($this->once())->method('getMatchingProductIds')->willReturn($productIds); - $ruleMock->expects($this->once())->method('getId')->willReturn(100); - $ruleMock->expects($this->once())->method('getCustomerGroupIds')->willReturn([10]); - $ruleMock->expects($this->atLeastOnce())->method('getFromDate')->willReturn('2017-06-21'); - $ruleMock->expects($this->atLeastOnce())->method('getToDate')->willReturn('2017-06-30'); - $ruleMock->expects($this->once())->method('getSortOrder')->willReturn(1); - $ruleMock->expects($this->once())->method('getSimpleAction')->willReturn('simple_action'); - $ruleMock->expects($this->once())->method('getDiscountAmount')->willReturn(43); - $ruleMock->expects($this->once())->method('getStopRulesProcessing')->willReturn(true); - - $this->localeDateMock->expects($this->once()) - ->method('getConfigTimezone') - ->with(ScopeInterface::SCOPE_WEBSITE, $websiteId) - ->willReturn($websiteTz); + $this->localeDateMock->method('getConfigTimezone') + ->willReturnMap([ + [ScopeInterface::SCOPE_WEBSITE, self::ADMIN_WEBSITE_ID, $adminTimeZone], + [ScopeInterface::SCOPE_WEBSITE, $websiteId, $websiteTz], + ]); $batchRows = [ [ @@ -170,13 +153,141 @@ public function testExecute() ] ]; - $connectionMock->expects($this->at(0)) + $this->connectionMock->expects(self::at(0)) ->method('insertMultiple') ->with('catalogrule_product_replica', $batchRows); - $connectionMock->expects($this->at(1)) + $this->connectionMock->expects(self::at(1)) ->method('insertMultiple') ->with('catalogrule_product_replica', $rowsNotInBatch); - $this->assertTrue($this->model->execute($ruleMock, 2, true)); + self::assertTrue($this->model->execute($this->ruleMock, 2, true)); + } + + public function testExecuteWithExcludedWebsites(): void + { + $websitesIds = [1, 2, 3]; + $adminTimeZone = 'America/Chicago'; + $websiteTz = 'America/Los_Angeles'; + $productIds = [ + 1 => [1 => 1], + 2 => [2 => 1], + 3 => [3 => 1], + ]; + + $this->prepareResourceMock(); + $this->prepareRuleMock($websitesIds, $productIds, [10, 20]); + + $extensionAttributes = $this->getMockBuilder(\Magento\Framework\Api\ExtensionAttributesInterface::class) + ->setMethods(['getExtensionAttributes', 'getExcludeWebsiteIds']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->ruleMock->expects(self::once())->method('getExtensionAttributes') + ->willReturn($extensionAttributes); + $extensionAttributes->expects(self::exactly(2))->method('getExcludeWebsiteIds') + ->willReturn([10 => [1, 2]]); + + $this->localeDateMock->method('getConfigTimezone') + ->willReturnMap([ + [ScopeInterface::SCOPE_WEBSITE, self::ADMIN_WEBSITE_ID, $adminTimeZone], + [ScopeInterface::SCOPE_WEBSITE, 1, $websiteTz], + [ScopeInterface::SCOPE_WEBSITE, 2, $websiteTz], + [ScopeInterface::SCOPE_WEBSITE, 3, $websiteTz], + ]); + + $batchRows = [ + [ + 'rule_id' => 100, + 'from_time' => 1498028400, + 'to_time' => 1498892399, + 'website_id' => 1, + 'customer_group_id' => 20, + 'product_id' => 1, + 'action_operator' => 'simple_action', + 'action_amount' => 43, + 'action_stop' => true, + 'sort_order' => 1, + ], + [ + 'rule_id' => 100, + 'from_time' => 1498028400, + 'to_time' => 1498892399, + 'website_id' => 2, + 'customer_group_id' => 20, + 'product_id' => 2, + 'action_operator' => 'simple_action', + 'action_amount' => 43, + 'action_stop' => true, + 'sort_order' => 1, + ], + [ + 'rule_id' => 100, + 'from_time' => 1498028400, + 'to_time' => 1498892399, + 'website_id' => 3, + 'customer_group_id' => 10, + 'product_id' => 3, + 'action_operator' => 'simple_action', + 'action_amount' => 43, + 'action_stop' => true, + 'sort_order' => 1, + ], + [ + 'rule_id' => 100, + 'from_time' => 1498028400, + 'to_time' => 1498892399, + 'website_id' => 3, + 'customer_group_id' => 20, + 'product_id' => 3, + 'action_operator' => 'simple_action', + 'action_amount' => 43, + 'action_stop' => true, + 'sort_order' => 1, + ] + ]; + + $this->connectionMock->expects(self::at(0)) + ->method('insertMultiple') + ->with('catalogrule_product_replica', $batchRows); + + self::assertTrue($this->model->execute($this->ruleMock, 100, true)); + } + + private function prepareResourceMock(): void + { + $this->tableSwapperMock->expects(self::once()) + ->method('getWorkingTableName') + ->with('catalogrule_product') + ->willReturn('catalogrule_product_replica'); + $this->resourceMock->expects(self::at(0)) + ->method('getConnection') + ->willReturn($this->connectionMock); + $this->resourceMock->expects(self::at(1)) + ->method('getTableName') + ->with('catalogrule_product') + ->willReturn('catalogrule_product'); + $this->resourceMock->expects(self::at(2)) + ->method('getTableName') + ->with('catalogrule_product_replica') + ->willReturn('catalogrule_product_replica'); + } + + /** + * @param array $websiteId + * @param array $productIds + * @param array $customerGroupIds + */ + private function prepareRuleMock(array $websiteId, array $productIds, array $customerGroupIds): void + { + $this->ruleMock->expects(self::once())->method('getIsActive')->willReturn(true); + $this->ruleMock->expects(self::exactly(2))->method('getWebsiteIds')->willReturn($websiteId); + $this->ruleMock->expects(self::once())->method('getMatchingProductIds')->willReturn($productIds); + $this->ruleMock->expects(self::once())->method('getId')->willReturn(100); + $this->ruleMock->expects(self::once())->method('getCustomerGroupIds')->willReturn($customerGroupIds); + $this->ruleMock->expects(self::atLeastOnce())->method('getFromDate')->willReturn('2017-06-21'); + $this->ruleMock->expects(self::atLeastOnce())->method('getToDate')->willReturn('2017-06-30'); + $this->ruleMock->expects(self::once())->method('getSortOrder')->willReturn(1); + $this->ruleMock->expects(self::once())->method('getSimpleAction')->willReturn('simple_action'); + $this->ruleMock->expects(self::once())->method('getDiscountAmount')->willReturn(43); + $this->ruleMock->expects(self::once())->method('getStopRulesProcessing')->willReturn(true); } } diff --git a/app/code/Magento/CatalogRule/Test/Unit/Model/RuleTest.php b/app/code/Magento/CatalogRule/Test/Unit/Model/RuleTest.php index e6d2fc78b2ae..0649cfc6112c 100644 --- a/app/code/Magento/CatalogRule/Test/Unit/Model/RuleTest.php +++ b/app/code/Magento/CatalogRule/Test/Unit/Model/RuleTest.php @@ -9,6 +9,7 @@ use Magento\Catalog\Model\Product; use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; +use Magento\CatalogRule\Api\Data\RuleInterface; use Magento\CatalogRule\Model\Indexer\Rule\RuleProductProcessor; use Magento\CatalogRule\Model\Rule; use Magento\CatalogRule\Model\Rule\Condition\CombineFactory; @@ -31,46 +32,60 @@ */ class RuleTest extends TestCase { - /** @var Rule */ - protected $rule; + /** + * @var Rule + */ + private $rule; - /** @var ObjectManager */ + /** + * @var ObjectManager + */ private $objectManager; - /** @var StoreManagerInterface|MockObject */ - protected $storeManager; + /** + * @var StoreManagerInterface|MockObject + */ + private $storeManager; - /** @var MockObject */ - protected $combineFactory; + /** + * @var CombineFactory|MockObject + */ + private $combineFactory; - /** @var Store|MockObject */ - protected $storeModel; + /** + * @var Store|MockObject + */ + private $storeModel; - /** @var Website|MockObject */ - protected $websiteModel; + /** + * @var Website|MockObject + */ + private $websiteModel; - /** @var Combine|MockObject */ - protected $condition; + /** + * @var Combine|MockObject + */ + private $condition; /** * @var RuleProductProcessor|MockObject */ - protected $_ruleProductProcessor; + private $_ruleProductProcessor; /** * @var CollectionFactory|MockObject */ - protected $_productCollectionFactory; + private $_productCollectionFactory; /** * @var Iterator|MockObject */ - protected $_resourceIterator; + private $_resourceIterator; /** * @var Product|MockObject */ - protected $productModel; + private $productModel; /** * Set up before test @@ -85,7 +100,7 @@ protected function setUp(): void $this->combineFactory = $this->createPartialMock( CombineFactory::class, [ - 'create' + 'create', ] ); $this->productModel = $this->createPartialMock( @@ -93,7 +108,7 @@ protected function setUp(): void [ '__wakeup', 'getId', - 'setData' + 'setData', ] ); $this->condition = $this->getMockBuilder(Combine::class) @@ -106,7 +121,7 @@ protected function setUp(): void [ '__wakeup', 'getId', - 'getDefaultStore' + 'getDefaultStore', ] ); $this->_ruleProductProcessor = $this->createMock( @@ -192,7 +207,7 @@ public function testCallbackValidateProduct($validate) 'has_options' => '0', 'required_options' => '0', 'created_at' => '2014-06-25 13:14:30', - 'updated_at' => '2014-06-25 14:37:15' + 'updated_at' => '2014-06-25 14:37:15', ]; $this->storeManager->expects($this->any())->method('getWebsites')->with(false) ->willReturn([$this->websiteModel, $this->websiteModel]); @@ -263,14 +278,14 @@ public function validateDataDataProvider() 'simple_action' => 'by_fixed', 'discount_amount' => '123', ], - true + true, ], [ [ 'simple_action' => 'by_percent', 'discount_amount' => '9,99', ], - true + true, ], [ [ @@ -279,7 +294,7 @@ public function validateDataDataProvider() ], [ 'Percentage discount should be between 0 and 100.', - ] + ], ], [ [ @@ -288,7 +303,7 @@ public function validateDataDataProvider() ], [ 'Percentage discount should be between 0 and 100.', - ] + ], ], [ [ @@ -297,7 +312,7 @@ public function validateDataDataProvider() ], [ 'Discount value should be 0 or greater.', - ] + ], ], [ [ @@ -306,7 +321,7 @@ public function validateDataDataProvider() ], [ 'Unknown action.', - ] + ], ], ]; } @@ -325,33 +340,48 @@ public function testAfterDelete() } /** - * Test after update action for inactive rule + * Test after update action for active and deactivated rule. * + * @dataProvider afterUpdateDataProvider + * @param int $active * @return void */ - public function testAfterUpdateInactive() + public function testAfterUpdate(int $active) { $this->rule->isObjectNew(false); - $this->rule->setIsActive(0); - $this->_ruleProductProcessor->expects($this->never())->method('getIndexer'); + $this->rule->setIsActive($active); + $this->rule->setOrigData(RuleInterface::IS_ACTIVE, 1); + $indexer = $this->getMockForAbstractClass(IndexerInterface::class); + $indexer->expects($this->once())->method('invalidate'); + $this->_ruleProductProcessor->expects($this->once())->method('getIndexer')->willReturn($indexer); $this->rule->afterSave(); } /** - * Test after update action for active rule + * Test after update action for inactive rule. * * @return void */ - public function testAfterUpdateActive() + public function testAfterUpdateInactiveRule() { $this->rule->isObjectNew(false); - $this->rule->setIsActive(1); - $indexer = $this->getMockForAbstractClass(IndexerInterface::class); - $indexer->expects($this->once())->method('invalidate'); - $this->_ruleProductProcessor->expects($this->once())->method('getIndexer')->willReturn($indexer); + $this->rule->setIsActive(0); + $this->rule->setOrigData(RuleInterface::IS_ACTIVE, 0); + $this->_ruleProductProcessor->expects($this->never())->method('getIndexer'); $this->rule->afterSave(); } + /** + * @return array + */ + public function afterUpdateDataProvider(): array + { + return [ + ['active' => 0], + ['active' => 1], + ]; + } + /** * Test isRuleBehaviorChanged action * diff --git a/app/code/Magento/CatalogRule/etc/extension_attributes.xml b/app/code/Magento/CatalogRule/etc/extension_attributes.xml new file mode 100644 index 000000000000..78568d8961ad --- /dev/null +++ b/app/code/Magento/CatalogRule/etc/extension_attributes.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> + <extension_attributes for="Magento\CatalogRule\Api\Data\RuleInterface"> + <attribute code="exclude_website_ids" type="int[]" /> + </extension_attributes> +</config> diff --git a/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml b/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml index 59e3c4668e8a..64bc5efe8e38 100644 --- a/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml +++ b/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml @@ -133,7 +133,7 @@ </validation> <dataType>number</dataType> <tooltip> - <link>https://docs.magento.com/m2/ce/user_guide/configuration/scope.html</link> + <link>https://docs.magento.com/user-guide/configuration/scope.html</link> <description>What is this?</description> </tooltip> <label translate="true">Websites</label> diff --git a/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Indexer/ProductRuleReindex.php b/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Indexer/ProductRuleReindex.php index 9c6671933463..ad2a7c3c2b21 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Indexer/ProductRuleReindex.php +++ b/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Indexer/ProductRuleReindex.php @@ -6,21 +6,22 @@ */ namespace Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model\Indexer; +use Magento\CatalogRule\Model\Indexer\Product\ProductRuleIndexer; use Magento\ConfigurableProduct\Model\Product\Type\Configurable; use Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model\ConfigurableProductsProvider; /** - * Class ReindexProduct. Add configurable sub-products to reindex + * Add configurable sub-products to reindex */ class ProductRuleReindex { /** - * @var \Magento\ConfigurableProduct\Model\Product\Type\Configurable + * @var Configurable */ private $configurable; /** - * @var \Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model\ConfigurableProductsProvider + * @var ConfigurableProductsProvider */ private $configurableProductsProvider; @@ -37,61 +38,47 @@ public function __construct( } /** - * @param \Magento\CatalogRule\Model\Indexer\Product\ProductRuleIndexer $subject + * Reindex configurable product with sub-products + * + * @param ProductRuleIndexer $subject * @param \Closure $proceed * @param int $id - * * @return void */ - public function aroundExecuteRow( - \Magento\CatalogRule\Model\Indexer\Product\ProductRuleIndexer $subject, - \Closure $proceed, - $id - ) { + public function aroundExecuteRow(ProductRuleIndexer $subject, \Closure $proceed, $id) + { + $isReindexed = false; + $configurableProductIds = $this->configurableProductsProvider->getIds([$id]); - $this->reindexSubProducts($configurableProductIds, $subject); - if (!$configurableProductIds) { - $proceed($id); + if ($configurableProductIds) { + $subProducts = array_values($this->configurable->getChildrenIds($id)[0]); + if ($subProducts) { + $subject->executeList(array_merge([$id], $subProducts)); + $isReindexed = true; + } } - } - /** - * @param \Magento\CatalogRule\Model\Indexer\Product\ProductRuleIndexer $subject - * @param \Closure $proceed - * @param array $ids - * - * @return void - */ - public function aroundExecuteList( - \Magento\CatalogRule\Model\Indexer\Product\ProductRuleIndexer $subject, - \Closure $proceed, - array $ids - ) { - $configurableProductIds = $this->configurableProductsProvider->getIds($ids); - $subProducts = $this->reindexSubProducts($configurableProductIds, $subject); - $ids = array_diff($ids, $configurableProductIds, $subProducts); - if ($ids) { - $proceed($ids); + if (!$isReindexed) { + $proceed($id); } } /** - * @param array $configurableIds - * @param \Magento\CatalogRule\Model\Indexer\Product\ProductRuleIndexer $subject + * Add sub-products to reindex * + * @param ProductRuleIndexer $subject + * @param array $ids * @return array + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - private function reindexSubProducts( - array $configurableIds, - \Magento\CatalogRule\Model\Indexer\Product\ProductRuleIndexer $subject - ) { - $subProducts = []; - if ($configurableIds) { - $subProducts = array_values($this->configurable->getChildrenIds($configurableIds)[0]); - if ($subProducts) { - $subject->executeList($subProducts); - } + public function beforeExecuteList(ProductRuleIndexer $subject, array $ids): array + { + $configurableProductIds = $this->configurableProductsProvider->getIds($ids); + if ($configurableProductIds) { + $subProducts = array_values($this->configurable->getChildrenIds($configurableProductIds)[0]); + $ids = array_unique(array_merge($ids, $subProducts)); } - return $subProducts; + + return [$ids]; } } diff --git a/app/code/Magento/CatalogSearch/Model/Attribute/SearchWeight.php b/app/code/Magento/CatalogSearch/Model/Attribute/SearchWeight.php index fa42cadb8a2f..840eb147a86f 100644 --- a/app/code/Magento/CatalogSearch/Model/Attribute/SearchWeight.php +++ b/app/code/Magento/CatalogSearch/Model/Attribute/SearchWeight.php @@ -15,6 +15,11 @@ */ class SearchWeight { + /** + * @var \Magento\Framework\Search\Request\Config + */ + private $config; + /** * @param \Magento\Framework\Search\Request\Config $config */ diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php index f72516d28c46..603a5c8a4793 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php @@ -15,6 +15,7 @@ use Magento\Framework\Indexer\SaveHandler\IndexerInterface; use Magento\Store\Model\StoreDimensionProvider; use Magento\Indexer\Model\ProcessManager; +use Magento\Framework\App\DeploymentConfig; /** * Provide functionality for Fulltext Search indexing. @@ -88,6 +89,18 @@ class Fulltext implements */ private $batchSize; + /** + * @var DeploymentConfig|null + */ + private $deploymentConfig; + + /** + * Deployment config path + * + * @var string + */ + private const DEPLOYMENT_CONFIG_INDEXER_BATCHES = 'indexer/batch_size/'; + /** * @param FullFactory $fullActionFactory * @param IndexerHandlerFactory $indexerHandlerFactory @@ -96,8 +109,9 @@ class Fulltext implements * @param StateFactory $indexScopeStateFactory * @param DimensionProviderInterface $dimensionProvider * @param array $data - * @param ProcessManager $processManager + * @param ProcessManager|null $processManager * @param int|null $batchSize + * @param DeploymentConfig|null $deploymentConfig * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( @@ -109,7 +123,8 @@ public function __construct( DimensionProviderInterface $dimensionProvider, array $data, ProcessManager $processManager = null, - ?int $batchSize = null + ?int $batchSize = null, + ?DeploymentConfig $deploymentConfig = null ) { $this->fullAction = $fullActionFactory->create(['data' => $data]); $this->indexerHandlerFactory = $indexerHandlerFactory; @@ -120,6 +135,7 @@ public function __construct( $this->dimensionProvider = $dimensionProvider; $this->processManager = $processManager ?: ObjectManager::getInstance()->get(ProcessManager::class); $this->batchSize = $batchSize ?? self::BATCH_SIZE; + $this->deploymentConfig = $deploymentConfig ?: ObjectManager::getInstance()->get(DeploymentConfig::class); } /** @@ -165,6 +181,10 @@ public function executeByDimensions(array $dimensions, \Traversable $entityIds = $currentBatch = []; $i = 0; + $this->batchSize = $this->deploymentConfig->get( + self::DEPLOYMENT_CONFIG_INDEXER_BATCHES . self::INDEXER_ID . '/partial_reindex' + ) ?? $this->batchSize; + foreach ($entityIds as $entityId) { $currentBatch[] = $entityId; if (++$i === $this->batchSize) { diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php index 3ce8a96fb507..59bdd0e47327 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php @@ -7,6 +7,7 @@ use Magento\Catalog\Api\Data\ProductInterface; use Magento\CatalogSearch\Model\Indexer\Fulltext; +use Magento\Framework\App\DeploymentConfig; use Magento\Framework\App\ObjectManager; use Magento\Framework\App\ResourceConnection; @@ -199,6 +200,19 @@ class Full private $batchSize; /** + * @var DeploymentConfig|null + */ + private $deploymentConfig; + + /** + * Deployment config path + * + * @var string + */ + private const DEPLOYMENT_CONFIG_INDEXER_BATCHES = 'indexer/batch_size/'; + + /** + * Full constructor. * @param ResourceConnection $resource * @param \Magento\Catalog\Model\Product\Type $catalogProductType * @param \Magento\Eav\Model\Config $eavConfig @@ -216,10 +230,12 @@ class Full * @param \Magento\CatalogSearch\Model\ResourceModel\Fulltext $fulltextResource * @param \Magento\Framework\Search\Request\DimensionFactory $dimensionFactory * @param \Magento\Framework\Indexer\ConfigInterface $indexerConfig - * @param mixed $indexIteratorFactory + * @param null $indexIteratorFactory * @param \Magento\Framework\EntityManager\MetadataPool|null $metadataPool * @param DataProvider|null $dataProvider * @param int $batchSize + * @param DeploymentConfig|null $deploymentConfig + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ @@ -244,7 +260,8 @@ public function __construct( $indexIteratorFactory = null, \Magento\Framework\EntityManager\MetadataPool $metadataPool = null, DataProvider $dataProvider = null, - $batchSize = 500 + $batchSize = 500, + ?DeploymentConfig $deploymentConfig = null ) { $this->resource = $resource; $this->connection = $resource->getConnection(); @@ -268,6 +285,7 @@ public function __construct( ->get(\Magento\Framework\EntityManager\MetadataPool::class); $this->dataProvider = $dataProvider ?: ObjectManager::getInstance()->get(DataProvider::class); $this->batchSize = $batchSize; + $this->deploymentConfig = $deploymentConfig ?: ObjectManager::getInstance()->get(DeploymentConfig::class); } /** @@ -360,6 +378,9 @@ public function rebuildStoreIndex($storeId, $productIds = null) ]; $lastProductId = 0; + $this->batchSize = $this->deploymentConfig->get( + self::DEPLOYMENT_CONFIG_INDEXER_BATCHES . Fulltext::INDEXER_ID . '/mysql_get' + ) ?? $this->batchSize; $products = $this->dataProvider ->getSearchableProducts($storeId, $staticFields, $productIds, $lastProductId, $this->batchSize); while (count($products) > 0) { diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/Category.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/Category.php index ed841996ea07..5c5b4591f8a5 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/Category.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/Category.php @@ -9,6 +9,7 @@ use Magento\Catalog\Model\ResourceModel\Category as Resource; use Magento\CatalogSearch\Model\Indexer\Fulltext\Processor; +use Magento\Framework\DataObject; /** * Perform indexer invalidation after a category delete. @@ -33,12 +34,15 @@ public function __construct(Processor $fulltextIndexerProcessor) * * @param Resource $subjectCategory * @param Resource $resultCategory + * @param DataObject $object * @return Resource * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterDelete(Resource $subjectCategory, Resource $resultCategory) : Resource + public function afterDelete(Resource $subjectCategory, Resource $resultCategory, DataObject $object) : Resource { - $this->fulltextIndexerProcessor->markIndexerAsInvalid(); + if ($object->getIsActive() || $object->getDeletedChildrenIds()) { + $this->fulltextIndexerProcessor->markIndexerAsInvalid(); + } return $resultCategory; } diff --git a/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php b/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php index d37f0f8a5153..7e9be408a385 100644 --- a/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php @@ -17,6 +17,11 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection implements \Magento\Search\Model\SearchCollectionInterface { + /** + * @var array + */ + private $indexUsageEnforcements; + /** * Attribute collection * @@ -61,6 +66,7 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection * @param \Magento\Customer\Api\GroupManagementInterface $groupManagement * @param \Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory $attributeCollectionFactory * @param \Magento\Framework\DB\Adapter\AdapterInterface $connection + * @param array $indexUsageEnforcements * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -84,7 +90,8 @@ public function __construct( \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Customer\Api\GroupManagementInterface $groupManagement, \Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory $attributeCollectionFactory, - \Magento\Framework\DB\Adapter\AdapterInterface $connection = null + \Magento\Framework\DB\Adapter\AdapterInterface $connection = null, + array $indexUsageEnforcements = [] ) { $this->_attributeCollectionFactory = $attributeCollectionFactory; parent::__construct( @@ -109,6 +116,7 @@ public function __construct( $groupManagement, $connection ); + $this->indexUsageEnforcements = $indexUsageEnforcements; } /** @@ -197,6 +205,35 @@ protected function _hasAttributeOptionsAndSearchable($attribute) return false; } + /** + * Prepare table names for the index enforcements + * + * @return array + */ + private function prepareIndexEnforcements() : array + { + $result = []; + foreach ($this->indexUsageEnforcements as $table => $index) { + $table = $this->getTable($table); + if ($this->isIndexExists($table, $index)) { + $result[$table] = $index; + } + } + return $result; + } + + /** + * Check if index exists in the table + * + * @param string $table + * @param string $index + * @return bool + */ + private function isIndexExists(string $table, string $index) : bool + { + return array_key_exists($index, $this->_conn->getIndexList($table)); + } + /** * Retrieve SQL for search entities * @@ -208,6 +245,7 @@ protected function _getSearchEntityIdsSql($query, $searchOnlyInCurrentStore = tr { $tables = []; $selects = []; + $preparedIndexEnforcements = $this->prepareIndexEnforcements(); $likeOptions = ['position' => 'any']; @@ -249,23 +287,56 @@ protected function _getSearchEntityIdsSql($query, $searchOnlyInCurrentStore = tr $ifValueId = $this->getConnection()->getIfNullSql('t2.value', 't1.value'); foreach ($tables as $table => $attributeIds) { - $selects[] = $this->getConnection()->select()->from( - ['t1' => $table], - $linkField - )->joinLeft( - ['t2' => $table], - $joinCondition, - [] - )->where( - 't1.attribute_id IN (?)', - $attributeIds, - \Zend_Db::INT_TYPE - )->where( - 't1.store_id = ?', - 0 - )->where( - $this->_resourceHelper->getCILike($ifValueId, $this->_searchQuery, $likeOptions) - ); + if (!empty($preparedIndexEnforcements[$table])) { + $condition1 = $this->_conn->quoteInto( + '`t1`.`attribute_id` IN (?)', + $attributeIds, + \Zend_Db::INT_TYPE + ); + $condition2 = '`t1`.`store_id` = 0'; + $quotedField = $this->_conn->quoteIdentifier($ifValueId); + $condition3 = $this->_conn->quoteInto( + $quotedField . ' LIKE ?', + $this->_resourceHelper->addLikeEscape($this->_searchQuery, $likeOptions) + ); + + //force index statement not implemented in framework + // phpcs:ignore Magento2.SQL.RawQuery + $select = sprintf( + 'SELECT `t1`.`%s` FROM `%s` AS `t1` FORCE INDEX(%s) + LEFT JOIN `%s` AS `t2` FORCE INDEX(%s) + ON %s WHERE %s AND %s AND (%s)', + $linkField, + $table, + $preparedIndexEnforcements[$table], + $table, + $preparedIndexEnforcements[$table], + $joinCondition, + $condition1, + $condition2, + $condition3 + ); + } else { + $select = $this->getConnection()->select(); + $select->from( + ['t1' => $table], + $linkField + )->joinLeft( + ['t2' => $table], + $joinCondition, + [] + )->where( + 't1.attribute_id IN (?)', + $attributeIds, + \Zend_Db::INT_TYPE + )->where( + 't1.store_id = ?', + 0 + )->where( + $this->_resourceHelper->getCILike($ifValueId, $this->_searchQuery, $likeOptions) + ); + } + $selects[] = $select; } $sql = $this->_getSearchInOptionSql($query); diff --git a/app/code/Magento/CatalogSearch/Model/Search/ReaderPlugin.php b/app/code/Magento/CatalogSearch/Model/Search/ReaderPlugin.php index 2f6a402b2040..4adb9c2299e9 100644 --- a/app/code/Magento/CatalogSearch/Model/Search/ReaderPlugin.php +++ b/app/code/Magento/CatalogSearch/Model/Search/ReaderPlugin.php @@ -5,6 +5,9 @@ */ namespace Magento\CatalogSearch\Model\Search; +use Magento\CatalogSearch\Model\Search\Request\ModifierInterface; +use Magento\Framework\Config\ReaderInterface; + /** * @deprecated 101.0.0 * @see \Magento\ElasticSearch @@ -12,34 +15,34 @@ class ReaderPlugin { /** - * @var \Magento\CatalogSearch\Model\Search\RequestGenerator + * @var ModifierInterface */ - private $requestGenerator; + private $requestModifier; /** - * @param \Magento\CatalogSearch\Model\Search\RequestGenerator $requestGenerator + * @param ModifierInterface $requestModifier */ public function __construct( - \Magento\CatalogSearch\Model\Search\RequestGenerator $requestGenerator + ModifierInterface $requestModifier ) { - $this->requestGenerator = $requestGenerator; + $this->requestModifier = $requestModifier; } /** * Merge reader's value with generated * - * @param \Magento\Framework\Config\ReaderInterface $subject + * @param ReaderInterface $subject * @param array $result * @param string|null $scope * @return array * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterRead( - \Magento\Framework\Config\ReaderInterface $subject, + ReaderInterface $subject, array $result, $scope = null ) { - $result = array_merge_recursive($result, $this->requestGenerator->generate()); + $result = $this->requestModifier->modify($result); return $result; } } diff --git a/app/code/Magento/CatalogSearch/Model/Search/Request/MatchQueriesModifier.php b/app/code/Magento/CatalogSearch/Model/Search/Request/MatchQueriesModifier.php new file mode 100644 index 000000000000..8d1675884c3b --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Search/Request/MatchQueriesModifier.php @@ -0,0 +1,62 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Model\Search\Request; + +/** + * Modifies match queries + */ +class MatchQueriesModifier implements ModifierInterface +{ + /** + * Queries node name + */ + private const NODE_QUERIES = 'queries'; + + /** + * Match query node name + */ + private const NODE_MATCH = 'match'; + + /** + * Match query node field attribute name + */ + private const NODE_MATCH_ATTRIBUTE_FIELD = 'field'; + + /** + * @var array + */ + private $queries; + + /** + * @param array $queries + */ + public function __construct(array $queries = []) + { + $this->queries = $queries; + } + + /** + * @inheritdoc + */ + public function modify(array $requests): array + { + foreach ($requests as &$request) { + foreach ($this->queries as $query => $fields) { + if (!empty($request[self::NODE_QUERIES][$query][self::NODE_MATCH])) { + foreach ($request[self::NODE_QUERIES][$query][self::NODE_MATCH] as $index => $match) { + $field = $match[self::NODE_MATCH_ATTRIBUTE_FIELD] ?? null; + if ($field !== null && isset($fields[$field])) { + $request[self::NODE_QUERIES][$query][self::NODE_MATCH][$index] += $fields[$field]; + } + } + } + } + } + return $requests; + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Search/Request/ModifierComposite.php b/app/code/Magento/CatalogSearch/Model/Search/Request/ModifierComposite.php new file mode 100644 index 000000000000..6290b5bd7ce4 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Search/Request/ModifierComposite.php @@ -0,0 +1,46 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Model\Search\Request; + +/** + * Search requests configuration composite modifier + */ +class ModifierComposite implements ModifierInterface +{ + /** + * @var ModifierInterface[] + */ + private $modifiers; + + /** + * @param ModifierInterface[] $modifiers + */ + public function __construct( + array $modifiers = [] + ) { + foreach ($modifiers as $modifier) { + if (!$modifier instanceof ModifierInterface) { + throw new \InvalidArgumentException( + get_class($modifier) . ' must implement ' . ModifierInterface::class + ); + } + } + $this->modifiers = $modifiers; + } + + /** + * @inheritdoc + */ + public function modify(array $requests): array + { + foreach ($this->modifiers as $modifier) { + $requests = $modifier->modify($requests); + } + return $requests; + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Search/Request/ModifierInterface.php b/app/code/Magento/CatalogSearch/Model/Search/Request/ModifierInterface.php new file mode 100644 index 000000000000..68421d6cb1d4 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Search/Request/ModifierInterface.php @@ -0,0 +1,22 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Model\Search\Request; + +/** + * Search requests configuration modifier interface + */ +interface ModifierInterface +{ + /** + * Modifies search requests configuration + * + * @param array $requests + * @return array + */ + public function modify(array $requests): array; +} diff --git a/app/code/Magento/CatalogSearch/Model/Search/Request/PartialSearchModifier.php b/app/code/Magento/CatalogSearch/Model/Search/Request/PartialSearchModifier.php new file mode 100644 index 000000000000..5a543b363c99 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Search/Request/PartialSearchModifier.php @@ -0,0 +1,76 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Model\Search\Request; + +use Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection; +use Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory; +use Magento\Eav\Model\Entity\Attribute; + +/** + * Modifies partial search query in search requests configuration + */ +class PartialSearchModifier implements ModifierInterface +{ + /** + * @var CollectionFactory + */ + private $collectionFactory; + + /** + * @param CollectionFactory $collectionFactory + */ + public function __construct( + CollectionFactory $collectionFactory + ) { + $this->collectionFactory = $collectionFactory; + } + + /** + * @inheritdoc + */ + public function modify(array $requests): array + { + $attributes = $this->getSearchableAttributes(); + foreach ($requests as $code => $request) { + $matches = $request['queries']['partial_search']['match'] ?? []; + if ($matches) { + foreach ($matches as $index => $match) { + $field = $match['field'] ?? null; + if ($field && $field !== '*' && !isset($attributes[$field])) { + unset($matches[$index]); + } + } + $requests[$code]['queries']['partial_search']['match'] = array_values($matches); + } + } + return $requests; + } + + /** + * Retrieve searchable attributes + * + * @return Attribute[] + */ + private function getSearchableAttributes(): array + { + $attributes = []; + /** @var Collection $collection */ + $collection = $this->collectionFactory->create(); + $collection->addFieldToFilter( + ['is_searchable', 'is_visible_in_advanced_search', 'is_filterable', 'is_filterable_in_search'], + [1, 1, [1, 2], 1] + ); + + /** @var Attribute $attribute */ + foreach ($collection->getItems() as $attribute) { + $attributes[$attribute->getAttributeCode()] = $attribute; + } + + return $attributes; + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Search/Request/SearchModifier.php b/app/code/Magento/CatalogSearch/Model/Search/Request/SearchModifier.php new file mode 100644 index 000000000000..54082dd28ec0 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Search/Request/SearchModifier.php @@ -0,0 +1,39 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Model\Search\Request; + +use Magento\CatalogSearch\Model\Search\RequestGenerator; + +/** + * Modifies search requests configuration + */ +class SearchModifier implements ModifierInterface +{ + /** + * @var RequestGenerator + */ + private $requestGenerator; + + /** + * @param RequestGenerator $requestGenerator + */ + public function __construct( + RequestGenerator $requestGenerator + ) { + $this->requestGenerator = $requestGenerator; + } + + /** + * @inheritdoc + */ + public function modify(array $requests): array + { + $requests = array_merge_recursive($requests, $this->requestGenerator->generate()); + return $requests; + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator.php b/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator.php index caa49d0f0c4a..94922c9ce772 100644 --- a/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator.php +++ b/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator.php @@ -186,6 +186,7 @@ private function generateAdvancedSearchRequest() [ 'field' => $attribute->getAttributeCode(), 'boost' => $attribute->getSearchWeight() ?: 1, + 'matchCondition' => 'match_phrase_prefix', ], ], ]; diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertStorefrontNoResultsMessageOnSearchPageActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertStorefrontNoResultsMessageOnSearchPageActionGroup.xml new file mode 100644 index 000000000000..6001708b41a1 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertStorefrontNoResultsMessageOnSearchPageActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontNoResultsMessageOnSearchPageActionGroup"> + <annotations> + <description>Check if search returned no results</description> + </annotations> + <arguments> + <argument name="message" type="string" defaultValue="Your search returned no results."/> + </arguments> + <see selector="{{StorefrontMessagesSection.noticeMessage}}" userInput="{{message}}" stepKey="seeNoSearchResultsMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertStorefrontProductNotOnSearchPageActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertStorefrontProductNotOnSearchPageActionGroup.xml new file mode 100644 index 000000000000..c35be6f46e7d --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertStorefrontProductNotOnSearchPageActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontProductNotOnSearchPageActionGroup"> + <arguments> + <argument name="productSku" type="string"/> + </arguments> + <dontSee selector="{{StorefrontCatalogSearchMainSection.searchResults}}" userInput="{{productSku}}" stepKey="doNotSeeProduct"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontFillFormAdvancedSearchActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontFillFormAdvancedSearchActionGroup.xml index 1afdb6e5e46f..81a283b9fcf3 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontFillFormAdvancedSearchActionGroup.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontFillFormAdvancedSearchActionGroup.xml @@ -23,6 +23,7 @@ <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ShortDescription}}" userInput="{{short_description}}" stepKey="fillShortDescription"/> <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.PriceFrom}}" userInput="{{price_from}}" stepKey="fillPriceFrom"/> <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.PriceTo}}" userInput="{{price_to}}" stepKey="fillPriceTo"/> + <scrollTo selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="scrollToSubmitButton"/> <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByDescriptionTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByDescriptionTest.xml index c02ef4957ad3..395cfd187013 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByDescriptionTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByDescriptionTest.xml @@ -12,9 +12,8 @@ <features value="CatalogSearch"/> <group value="CatalogSearch"/> </annotations> - <!-- Perform reindex and flush cache --> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> </actionGroup> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByNameTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByNameTest.xml index 0c8e192f9366..99448fd730d9 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByNameTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByNameTest.xml @@ -13,9 +13,8 @@ <group value="CatalogSearch"/> </annotations> - <!-- Perform reindex and flush cache --> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> </actionGroup> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByPriceTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByPriceTest.xml index 99c09b5ba93a..af70c3ba1c3a 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByPriceTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByPriceTest.xml @@ -13,9 +13,8 @@ <group value="CatalogSearch"/> </annotations> - <!-- Perform reindex and flush cache --> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> </actionGroup> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByShortDescriptionTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByShortDescriptionTest.xml index 1e18c5ea4d0a..38399f2729d3 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByShortDescriptionTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByShortDescriptionTest.xml @@ -13,9 +13,8 @@ <group value="CatalogSearch"/> </annotations> - <!-- Perform reindex and flush cache --> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> </actionGroup> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductBySkuTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductBySkuTest.xml index 34e0a73e91fe..e12505299c76 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductBySkuTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductBySkuTest.xml @@ -13,9 +13,8 @@ <group value="CatalogSearch"/> </annotations> - <!-- Perform reindex and flush cache --> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> </actionGroup> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index 28eb53542ad9..f787b160e768 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -23,7 +23,7 @@ <waitForLoadingMaskToDisappear stepKey="waitForSearchProductsloaded" after="searchClickAdvancedSearchSubmitButton"/> <actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="searchCheckAdvancedSearchResult" after="waitForSearchProductsloaded"/> <!-- Results returned will be different with ES vs MySQL --> - <see userInput="4" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.productCount}} span" stepKey="searchAdvancedAssertProductCount" after="searchCheckAdvancedSearchResult"/> + <see userInput="1" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.productCount}} span" stepKey="searchAdvancedAssertProductCount" after="searchCheckAdvancedSearchResult"/> <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertSimpleProduct1" after="searchAdvancedAssertProductCount"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/MinimalQueryLengthForCatalogSearchTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/MinimalQueryLengthForCatalogSearchTest.xml index d6a5aa8b9357..8b9b78b67bc7 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/MinimalQueryLengthForCatalogSearchTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/MinimalQueryLengthForCatalogSearchTest.xml @@ -38,10 +38,14 @@ <comment userInput="Go to Storefront and search for product" stepKey="searchProdUsingMinQueryLength"/> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> <comment userInput="Quick search by single character and avoid using ES stopwords" stepKey="commentQuickSearch"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="B" stepKey="fillAttribute"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <see selector="{{StorefrontCategoryMainSection.productName}}" userInput="$$createProduct.name$$" stepKey="seeProductNameInCategoryPage"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillAttribute"> + <argument name="phrase" value="B"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProductNameInCategoryPage"> + <argument name="productName" value="$$createProduct.name$$"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleDynamicTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleDynamicTest.xml index 09f7ee455ebb..a6cec9480373 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleDynamicTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleDynamicTest.xml @@ -43,10 +43,7 @@ </actionGroup> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleFixedTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleFixedTest.xml index 98d1b3412360..e587840f3bff 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleFixedTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleFixedTest.xml @@ -54,10 +54,7 @@ </actionGroup> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartConfigurableTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartConfigurableTest.xml index 3298eff34759..1a25ee6bc57a 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartConfigurableTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartConfigurableTest.xml @@ -25,10 +25,7 @@ <argument name="category" value="$$createCategory$$"/> </actionGroup> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -38,6 +35,15 @@ <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> </after> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartDownloadableTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartDownloadableTest.xml index 85e3c4665450..2201b17c31a0 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartDownloadableTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartDownloadableTest.xml @@ -27,10 +27,7 @@ <requiredEntity createDataKey="createProduct"/> </createData> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartGroupedTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartGroupedTest.xml index 3488a6314080..efe1018c29e5 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartGroupedTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartGroupedTest.xml @@ -27,10 +27,7 @@ <requiredEntity createDataKey="simple1"/> </createData> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartTest.xml index 26f4cd77b60b..b0137f145bff 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartTest.xml @@ -23,10 +23,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartVirtualTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartVirtualTest.xml index 9277baba94aa..b2e86ae896ab 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartVirtualTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartVirtualTest.xml @@ -23,10 +23,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchEmptyResultsTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchEmptyResultsTest.xml index a6654db91eff..02f6ffd5db8e 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchEmptyResultsTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchEmptyResultsTest.xml @@ -24,10 +24,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchProductBySkuTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchProductBySkuTest.xml index 83436ebb44c6..4bde337ab78d 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchProductBySkuTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchProductBySkuTest.xml @@ -23,10 +23,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchByPartialNameTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchByPartialNameTest.xml index d8f8924c4db0..d85b17348b0b 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchByPartialNameTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchByPartialNameTest.xml @@ -10,17 +10,15 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="StorefrontAdvancedSearchByPartialNameTest" extends="StorefrontAdvancedSearchEntitySimpleProductTest"> <annotations> + <features value="CatalogSearch"/> <stories value="Use Advanced Search"/> <title value="Search product in advanced search by partial name"/> <description value="Search product in advanced search by partial name"/> - <testCaseId value="MAGETWO-24729"/> <severity value="CRITICAL"/> + <testCaseId value="MC-40416"/> <group value="searchFrontend"/> <group value="mtf_migrated"/> <group value="SearchEngineElasticsearch"/> - <skip> - <issueId value="MC-34217"/> - </skip> </annotations> <actionGroup ref="StorefrontFillFormAdvancedSearchActionGroup" stepKey="search"> <argument name="productName" value="abc"/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml index 14ae988e6ce7..1e27f9f6d05a 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml @@ -31,10 +31,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAdmin"/> </after> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontPartialWordQuickSearchNotSearchableTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontPartialWordQuickSearchNotSearchableTest.xml new file mode 100644 index 000000000000..b8ca2a16e751 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontPartialWordQuickSearchNotSearchableTest.xml @@ -0,0 +1,149 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontPartialWordQuickSearchNotSearchableTest"> + <annotations> + <features value="Search"/> + <stories value="Partial Word search using Elasticsearch"/> + <title value="Partial word search should be performed on searchable fields only"/> + <description value="Partial word search should be performed on searchable fields only"/> + <severity value="MAJOR"/> + <testCaseId value="MC-40782"/> + <useCaseId value="MC-40715"/> + <group value="SearchEngineElasticsearch"/> + </annotations> + <before> + <!--Create category--> + <createData entity="SimpleSubCategory" stepKey="newCategory"/> + <!--Create product1--> + <createData entity="ProductForPartialSearch" stepKey="product1"> + <requiredEntity createDataKey="newCategory"/> + </createData> + <!--Create product2--> + <createData entity="SimpleProduct" stepKey="product2"> + <requiredEntity createDataKey="newCategory"/> + </createData> + <!--Create product3--> + <createData entity="ApiSimpleProduct" stepKey="product3"> + <requiredEntity createDataKey="newCategory"/> + </createData> + <!--Login as admin--> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!--Open "Name" attribute in admin--> + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="OpenNameAttribute"> + <argument name="productAttributeCode" value="name"/> + </actionGroup> + <!--Configure "Name" attribute as not searchable--> + <actionGroup ref="AdminSetUseInSearchValueForProductAttributeActionGroup" stepKey="makeNameNotSearchable"> + <argument name="useInSearchValue" value="No"/> + </actionGroup> + <!--Save "Name" attribute--> + <actionGroup ref="SaveProductAttributeActionGroup" stepKey="saveAttributeChanges"/> + <!--Reindex--> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + <!--Clean cache--> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCache"> + <argument name="tags" value=""/> + </actionGroup> + </before> + <after> + <!--Delete product1--> + <deleteData createDataKey="product1" stepKey="deleteProduct1"/> + <!--Delete product2--> + <deleteData createDataKey="product2" stepKey="deleteProduct2"/> + <!--Delete product3--> + <deleteData createDataKey="product3" stepKey="deleteProduct3"/> + <!--Delete category--> + <deleteData createDataKey="newCategory" stepKey="deleteCategory"/> + <!--Open "Name" attribute in admin--> + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="OpenNameAttribute"> + <argument name="productAttributeCode" value="name"/> + </actionGroup> + <!--Configure "Name" attribute as searchable--> + <actionGroup ref="AdminSetUseInSearchValueForProductAttributeActionGroup" stepKey="makeNameSearchable"> + <argument name="useInSearchValue" value="Yes"/> + </actionGroup> + <!--Configure "Name" attribute to be visible in advanced search (this option is automatically turned off when "use in search" is off)--> + <actionGroup ref="AdminProductAttributeSetVisibleInAdvancedSearchActionGroup" stepKey="makeNameVisibleInAdvancedSearch"> + <argument name="isVisibleInAdvancedSearch" value="Yes"/> + </actionGroup> + <!--Save "Name" attribute--> + <actionGroup ref="SaveProductAttributeActionGroup" stepKey="saveAttributeChanges"/> + <!--Clear grid filter--> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> + <!--Logout from admin--> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + <!--Reindex--> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + <!--Clean cache--> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCache"> + <argument name="tags" value=""/> + </actionGroup> + </after> + <!--Navigate to home page--> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> + <!--Search for word "partial"--> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="search1"> + <argument name="phrase" value="partial"/> + </actionGroup> + <!--Assert that product1 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct1"> + <argument name="productName" value="$$product1.name$$"/> + </actionGroup> + <!--Assert that product2 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct2"> + <argument name="productName" value="$$product2.name$$"/> + </actionGroup> + <!--Assert that product3 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct3"> + <argument name="productName" value="$$product3.name$$"/> + </actionGroup> + + <!--Search for word "simple"--> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="search2"> + <argument name="phrase" value="simple"/> + </actionGroup> + <!--Assert that product1 is present in the search result--> + <comment userInput="BIC workaround" stepKey="dontSeeProduct1"/> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct1c"> + <argument name="productName" value="$$product1.name$$"/> + </actionGroup> + <!--Assert that product2 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct2"> + <argument name="productName" value="$$product2.name$$"/> + </actionGroup> + <!--Assert that product3 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct3"> + <argument name="productName" value="$$product3.name$$"/> + </actionGroup> + + <!--Search for word "api-sim"--> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="search3"> + <argument name="phrase" value="api-sim"/> + </actionGroup> + <!--Assert that product1 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct1b"> + <argument name="productName" value="$$product1.name$$"/> + </actionGroup> + <!--Assert that product2 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct2b"> + <argument name="productName" value="$$product2.name$$"/> + </actionGroup> + <!--Assert that product3 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct3b"> + <argument name="productName" value="$$product3.name$$"/> + </actionGroup> + </test> +</tests> + diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontPartialWordQuickSearchStemmingTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontPartialWordQuickSearchStemmingTest.xml new file mode 100644 index 000000000000..b1528b169cbd --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontPartialWordQuickSearchStemmingTest.xml @@ -0,0 +1,162 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontPartialWordQuickSearchStemmingTest"> + <annotations> + <features value="Search"/> + <stories value="Partial Word search using Elasticsearch"/> + <title value="Partial word search should match only the documents that contain the words of a provided text, in the same order as provided"/> + <description value="Partial word search should match only the documents that contain the words of a provided text, in the same order as provided"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-41570"/> + <useCaseId value="MC-40981"/> + <group value="SearchEngineElasticsearch"/> + </annotations> + <before> + <!--Create category--> + <createData entity="SimpleSubCategory" stepKey="category1"/> + <!--Create product1--> + <createData entity="SimpleProduct" stepKey="product1"> + <field key="name">5127SS YALE JUNIOR KNOB ENTRANCE SET 5 PINS SATIN STAI</field> + <requiredEntity createDataKey="category1"/> + </createData> + <!--Create product2--> + <createData entity="SimpleProduct" stepKey="product2"> + <field key="name">5127AC YALE JUNIOR KNOB ENTRANCE SET 5 PINS ANTIQUE CO</field> + <requiredEntity createDataKey="category1"/> + </createData> + <!--Create product3--> + <createData entity="SimpleProduct" stepKey="product3"> + <field key="name">5127AB YALE JUNIOR KNOB ENTRANCE SET 5 PINS ANTIQUE BRASS</field> + <requiredEntity createDataKey="category1"/> + </createData> + <!--Create product4--> + <createData entity="SimpleProduct" stepKey="product4"> + <field key="sku">5127SS-YALE</field> + <requiredEntity createDataKey="category1"/> + </createData> + <!--Create product5--> + <createData entity="SimpleProduct" stepKey="product5"> + <field key="sku">5127AC-CO</field> + <requiredEntity createDataKey="category1"/> + </createData> + <!--Create product6--> + <createData entity="SimpleProduct" stepKey="product6"> + <field key="sku">5127AB-BRASS</field> + <requiredEntity createDataKey="category1"/> + </createData> + </before> + <after> + <!--Delete category--> + <deleteData createDataKey="category1" stepKey="deleteCategory"/> + <!--Delete product1--> + <deleteData createDataKey="product1" stepKey="deleteProduct1"/> + <!--Delete product2--> + <deleteData createDataKey="product2" stepKey="deleteProduct2"/> + <!--Delete product3--> + <deleteData createDataKey="product3" stepKey="deleteProduct3"/> + <!--Delete product4--> + <deleteData createDataKey="product4" stepKey="deleteProduct4"/> + <!--Delete product5--> + <deleteData createDataKey="product5" stepKey="deleteProduct5"/> + <!--Delete product6--> + <deleteData createDataKey="product6" stepKey="deleteProduct6"/> + </after> + <!--Navigate to home page--> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> + <!--Search for word "5127S"--> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="search1"> + <argument name="phrase" value="5127S"/> + </actionGroup> + <!--Assert that product1 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct1"> + <argument name="productName" value="$$product1.name$$"/> + </actionGroup> + <!--Assert that product2 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct2"> + <argument name="productName" value="$$product2.name$$"/> + </actionGroup> + <!--Assert that product2 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct3"> + <argument name="productName" value="$$product3.name$$"/> + </actionGroup> + <!--Assert that product4 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct4"> + <argument name="productName" value="$$product4.name$$"/> + </actionGroup> + <!--Assert that product5 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct5"> + <argument name="productName" value="$$product5.name$$"/> + </actionGroup> + <!--Assert that product6 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct6"> + <argument name="productName" value="$$product6.name$$"/> + </actionGroup> + + <!--Search for word "5127A"--> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="search2"> + <argument name="phrase" value="5127A"/> + </actionGroup> + <!--Assert that product1 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct1"> + <argument name="productName" value="$$product1.name$$"/> + </actionGroup> + <!--Assert that product2 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct2"> + <argument name="productName" value="$$product2.name$$"/> + </actionGroup> + <!--Assert that product3 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct3"> + <argument name="productName" value="$$product3.name$$"/> + </actionGroup> + <!--Assert that product4 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct4"> + <argument name="productName" value="$$product4.name$$"/> + </actionGroup> + <!--Assert that product5 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct5"> + <argument name="productName" value="$$product5.name$$"/> + </actionGroup> + <!--Assert that product6 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct6"> + <argument name="productName" value="$$product6.name$$"/> + </actionGroup> + + <!--Search for word "5127SS"--> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="search3"> + <argument name="phrase" value="5127SS"/> + </actionGroup> + <!--Assert that product1 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct1b"> + <argument name="productName" value="$$product1.name$$"/> + </actionGroup> + <!--Assert that product2 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct2b"> + <argument name="productName" value="$$product2.name$$"/> + </actionGroup> + <!--Assert that product3 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct3b"> + <argument name="productName" value="$$product3.name$$"/> + </actionGroup> + <!--Assert that product4 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct4b"> + <argument name="productName" value="$$product4.name$$"/> + </actionGroup> + <!--Assert that product5 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct5b"> + <argument name="productName" value="$$product5.name$$"/> + </actionGroup> + <!--Assert that product6 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct6b"> + <argument name="productName" value="$$product6.name$$"/> + </actionGroup> + </test> +</tests> + diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontQuickSearchConfigurableChildrenTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontQuickSearchConfigurableChildrenTest.xml index 67e8bc6bf183..fe30acc17424 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontQuickSearchConfigurableChildrenTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontQuickSearchConfigurableChildrenTest.xml @@ -72,10 +72,7 @@ <requiredEntity createDataKey="createSimpleProduct"/> </createData> - <!-- Perform reindex --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> </before> <after> <deleteData createDataKey="createConfigurableProduct" stepKey="deleteConfigurableProduct"/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml index 26280ed67d18..634ee57f1723 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml @@ -25,10 +25,7 @@ <requiredEntity createDataKey="createCategory1"/> </createData> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/ReaderPluginTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/ReaderPluginTest.php index 5f342f1735de..3b19c98aca3c 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/ReaderPluginTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/ReaderPluginTest.php @@ -8,7 +8,7 @@ namespace Magento\CatalogSearch\Test\Unit\Model\Search; use Magento\CatalogSearch\Model\Search\ReaderPlugin; -use Magento\CatalogSearch\Model\Search\RequestGenerator; +use Magento\CatalogSearch\Model\Search\Request\ModifierInterface; use Magento\Framework\Config\ReaderInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use PHPUnit\Framework\MockObject\MockObject; @@ -16,8 +16,8 @@ class ReaderPluginTest extends TestCase { - /** @var RequestGenerator|MockObject */ - protected $requestGenerator; + /** @var ModifierInterface|MockObject */ + protected $requestModifier; /** @var ObjectManager */ protected $objectManagerHelper; @@ -27,22 +27,20 @@ class ReaderPluginTest extends TestCase protected function setUp(): void { - $this->requestGenerator = $this->getMockBuilder(RequestGenerator::class) + $this->requestModifier = $this->getMockBuilder(ModifierInterface::class) ->disableOriginalConstructor() ->getMock(); $this->objectManagerHelper = new ObjectManager($this); - $this->object = $this->objectManagerHelper->getObject( - ReaderPlugin::class, - ['requestGenerator' => $this->requestGenerator] - ); + $this->object = new ReaderPlugin($this->requestModifier); } public function testAfterRead() { $readerConfig = ['test' => 'b', 'd' => 'e']; - $this->requestGenerator->expects($this->once()) - ->method('generate') + $this->requestModifier->expects($this->once()) + ->method('modify') + ->with($readerConfig) ->willReturn(['test' => 'a']); $result = $this->object->afterRead( @@ -53,6 +51,6 @@ public function testAfterRead() null ); - $this->assertEquals(['test' => ['b', 'a'], 'd' => 'e'], $result); + $this->assertEquals(['test' => 'a'], $result); } } diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/MatchQueriesModifierTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/MatchQueriesModifierTest.php new file mode 100644 index 000000000000..00576f9ad029 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/MatchQueriesModifierTest.php @@ -0,0 +1,130 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Test\Unit\Model\Search\Request; + +use Magento\CatalogSearch\Model\Search\Request\MatchQueriesModifier; +use PHPUnit\Framework\TestCase; + +/** + * Test match queries modifier + */ +class MatchQueriesModifierTest extends TestCase +{ + /** + * Test that queries configuration are merged into request + * + * @param array $queries + * @param array $requests + * @param array $expected + * @dataProvider modifyDataProvider + */ + public function testModify(array $queries, array $requests, array $expected): void + { + $model = new MatchQueriesModifier($queries); + $this->assertEquals($expected, $model->modify($requests)); + } + + /** + * @return array + */ + public function modifyDataProvider(): array + { + return [ + [ + [ + 'partial_search' => [ + 'name' => [ + 'analyzer' => 'standard', + 'max_expansions' => 20, + ] + ], + ], + [ + 'search_1' => [ + 'filters' => [ + 'category_filter' => [ + 'name' => 'category_filter', + 'field' => 'category_ids', + 'value' => '$category_ids$', + ] + ], + 'queries' => [ + 'partial_search' => [ + 'name' => 'partial_search', + 'value' => '$search_term$', + 'match' => [ + [ + 'field' => '*' + ], + [ + 'field' => 'sku', + 'matchCondition' => 'match_phrase_prefix', + ], + [ + 'field' => 'name', + 'matchCondition' => 'match_phrase_prefix', + ], + ] + ] + ] + ], + 'search_2' => [ + 'filters' => [ + 'category_filter' => [ + 'name' => 'category_filter', + 'field' => 'category_ids', + 'value' => '$category_ids$', + ] + ] + ] + ], + [ + 'search_1' => [ + 'filters' => [ + 'category_filter' => [ + 'name' => 'category_filter', + 'field' => 'category_ids', + 'value' => '$category_ids$', + ] + ], + 'queries' => [ + 'partial_search' => [ + 'name' => 'partial_search', + 'value' => '$search_term$', + 'match' => [ + [ + 'field' => '*' + ], + [ + 'field' => 'sku', + 'matchCondition' => 'match_phrase_prefix', + ], + [ + 'field' => 'name', + 'matchCondition' => 'match_phrase_prefix', + 'analyzer' => 'standard', + 'max_expansions' => 20, + ], + ] + ] + ] + ], + 'search_2' => [ + 'filters' => [ + 'category_filter' => [ + 'name' => 'category_filter', + 'field' => 'category_ids', + 'value' => '$category_ids$', + ] + ] + ] + ] + ] + ]; + } +} diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/ModifierCompositeTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/ModifierCompositeTest.php new file mode 100644 index 000000000000..936ad83b8a63 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/ModifierCompositeTest.php @@ -0,0 +1,86 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Test\Unit\Model\Search\Request; + +use Magento\CatalogSearch\Model\Search\Request\ModifierComposite; +use Magento\CatalogSearch\Model\Search\Request\ModifierInterface; +use Magento\Framework\DataObject; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test composite search requests modifier + */ +class ModifierCompositeTest extends TestCase +{ + /** + * @var ModifierInterface|MockObject + */ + private $modifier1; + + /** + * @var ModifierInterface|MockObject + */ + private $modifier2; + + /** + * @var ModifierComposite + */ + private $model; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->modifier1 = $this->getMockForAbstractClass(ModifierInterface::class); + $this->modifier2 = $this->getMockForAbstractClass(ModifierInterface::class); + $this->model = new ModifierComposite( + [ + $this->modifier1, + $this->modifier2 + ] + ); + } + + /** + * Test that all modifiers are executed + */ + public function testModify(): void + { + $requests = ['a', 'b', 'c']; + $this->modifier1->expects($this->once()) + ->method('modify') + ->with($requests) + ->willReturn(['a', 'b', 'c', 'd']); + + $this->modifier2->expects($this->once()) + ->method('modify') + ->with(['a', 'b', 'c', 'd']) + ->willReturn(['a', 'c', 'd']); + + $this->assertEquals(['a', 'c', 'd'], $this->model->modify($requests)); + } + + /** + * Test that exception is thrown if modifier is not instance of ModifierInterface + */ + public function testInvalidModifier(): void + { + $exception = new \InvalidArgumentException( + 'Magento\Framework\DataObject must implement Magento\CatalogSearch\Model\Search\Request\ModifierInterface' + ); + $this->expectExceptionObject($exception); + $this->model = new ModifierComposite( + [ + new DataObject() + ] + ); + } +} diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/PartialSearchModifierTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/PartialSearchModifierTest.php new file mode 100644 index 000000000000..2fabec670a57 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/PartialSearchModifierTest.php @@ -0,0 +1,157 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Test\Unit\Model\Search\Request; + +use Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection; +use Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory; +use Magento\CatalogSearch\Model\Search\Request\PartialSearchModifier; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test "partial" search requests modifier + */ +class PartialSearchModifierTest extends TestCase +{ + /** + * @var Collection|MockObject + */ + private $collection; + + /** + * @var PartialSearchModifier + */ + private $model; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $collectionFactory = $this->createMock(CollectionFactory::class); + $this->collection = $this->getMockBuilder(Collection::class) + ->disableOriginalConstructor() + ->onlyMethods(['load', 'addFieldToFilter']) + ->getMock(); + $collectionFactory->method('create') + ->willReturn($this->collection); + $this->model = new PartialSearchModifier($collectionFactory); + } + + /** + * Test that not searchable attributes are removed from the request + * + * @param array $attributes + * @param array $requests + * @param array $expected + * @dataProvider modifyDataProvider + */ + public function testModify(array $attributes, array $requests, array $expected): void + { + $items = []; + foreach ($attributes as $attribute) { + $item = $this->getMockForAbstractClass(\Magento\Eav\Api\Data\AttributeInterface::class); + $item->method('getAttributeCode') + ->willReturn($attribute); + $items[] = $item; + } + $reflectionProperty = new \ReflectionProperty($this->collection, '_items'); + $reflectionProperty->setAccessible(true); + $reflectionProperty->setValue($this->collection, $items); + $this->assertEquals($expected, $this->model->modify($requests)); + } + + /** + * @return array + */ + public function modifyDataProvider(): array + { + return [ + [ + [ + 'name', + ], + [ + 'search_1' => [ + 'filters' => [ + 'category_filter' => [ + 'name' => 'category_filter', + 'field' => 'category_ids', + 'value' => '$category_ids$', + ] + ], + 'queries' => [ + 'partial_search' => [ + 'name' => 'partial_search', + 'value' => '$search_term$', + 'match' => [ + [ + 'field' => '*' + ], + [ + 'field' => 'sku', + 'matchCondition' => 'match_phrase_prefix', + ], + [ + 'field' => 'name', + 'matchCondition' => 'match_phrase_prefix', + ], + ] + ] + ] + ], + 'search_2' => [ + 'filters' => [ + 'category_filter' => [ + 'name' => 'category_filter', + 'field' => 'category_ids', + 'value' => '$category_ids$', + ] + ] + ] + ], + [ + 'search_1' => [ + 'filters' => [ + 'category_filter' => [ + 'name' => 'category_filter', + 'field' => 'category_ids', + 'value' => '$category_ids$', + ] + ], + 'queries' => [ + 'partial_search' => [ + 'name' => 'partial_search', + 'value' => '$search_term$', + 'match' => [ + [ + 'field' => '*' + ], + [ + 'field' => 'name', + 'matchCondition' => 'match_phrase_prefix', + ], + ] + ] + ] + ], + 'search_2' => [ + 'filters' => [ + 'category_filter' => [ + 'name' => 'category_filter', + 'field' => 'category_ids', + 'value' => '$category_ids$', + ] + ] + ] + ] + ] + ]; + } +} diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/SearchModifierTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/SearchModifierTest.php new file mode 100644 index 000000000000..2c7ce97751f1 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/SearchModifierTest.php @@ -0,0 +1,52 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Test\Unit\Model\Search\Request; + +use Magento\CatalogSearch\Model\Search\Request\SearchModifier; +use Magento\CatalogSearch\Model\Search\RequestGenerator; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test search requests modifier + */ +class SearchModifierTest extends TestCase +{ + /** + * @var RequestGenerator|MockObject + */ + private $requestGenerator; + + /** + * @var SearchModifier + */ + private $model; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->requestGenerator = $this->createMock(RequestGenerator::class); + $this->model = new SearchModifier($this->requestGenerator); + } + + /** + * Test that the result is merged into the initial requests + */ + public function testModifier(): void + { + $requests = ['a' => ['x', 'y'], 'b' => ['k']]; + $expected = ['a' => ['x', 'y', 'z'], 'b' => ['k'], 'c' => ['n']]; + $this->requestGenerator->expects($this->once()) + ->method('generate') + ->willReturn(['a' => ['z'], 'c' => ['n']]); + $this->assertEquals($expected, $this->model->modify($requests)); + } +} diff --git a/app/code/Magento/CatalogSearch/etc/di.xml b/app/code/Magento/CatalogSearch/etc/di.xml index f8e2a262d73c..43ba82f047e4 100644 --- a/app/code/Magento/CatalogSearch/etc/di.xml +++ b/app/code/Magento/CatalogSearch/etc/di.xml @@ -14,6 +14,7 @@ <preference for="Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\TotalRecordsResolverInterface" type="Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\TotalRecordsResolver"/> <preference for="Magento\CatalogSearch\Model\Search\ItemCollectionProviderInterface" type="Magento\CatalogSearch\Model\Search\ItemCollectionProvider"/> <preference for="Magento\Framework\Indexer\IndexStructureInterface" type="Magento\CatalogSearch\Model\Indexer\IndexStructure" /> + <preference for="Magento\CatalogSearch\Model\Search\Request\ModifierInterface" type="Magento\CatalogSearch\Model\Search\Request\ModifierComposite" /> <type name="Magento\Catalog\Model\Indexer\Product\Full"> <arguments> <argument name="indexerList" xsi:type="array"> @@ -248,4 +249,27 @@ <argument name="temporaryStorageFactory" xsi:type="null" /> </arguments> </type> + <type name="Magento\CatalogSearch\Model\Search\Request\ModifierComposite"> + <arguments> + <argument name="modifiers" xsi:type="array"> + <item name="search" xsi:type="object">Magento\CatalogSearch\Model\Search\Request\SearchModifier</item> + <item name="partial_search" xsi:type="object">Magento\CatalogSearch\Model\Search\Request\PartialSearchModifier</item> + <item name="match_queries" xsi:type="object">Magento\CatalogSearch\Model\Search\Request\MatchQueriesModifier</item> + </argument> + </arguments> + </type> + <type name="Magento\CatalogSearch\Model\Search\Request\MatchQueriesModifier"> + <arguments> + <argument name="queries" xsi:type="array"> + <item name="partial_search" xsi:type="array"> + <item name="name" xsi:type="array"> + <item name="analyzer" xsi:type="string">prefix_search</item> + </item> + <item name="sku" xsi:type="array"> + <item name="analyzer" xsi:type="string">sku_prefix_search</item> + </item> + </item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml index 9c20f614076b..67958af8b54c 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml @@ -36,5 +36,10 @@ <action method="setListCollection"/> </block> </referenceContainer> + <referenceBlock name="search_result_list"> + <arguments> + <argument name="viewModel" xsi:type="object">Magento\Catalog\ViewModel\Product\OptionsData</argument> + </arguments> + </referenceBlock> </body> </page> diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml index 8dd8e3ed7282..52cca45d8d7d 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml @@ -16,6 +16,7 @@ positions:list-secondary,grid-secondary,list-actions,grid-actions,list-primary,grid-primary --> <argument name="positioned" xsi:type="string">positions:list-secondary</argument> + <argument name="viewModel" xsi:type="object">Magento\Catalog\ViewModel\Product\OptionsData</argument> </arguments> <block class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="product_list_toolbar" template="Magento_Catalog::product/list/toolbar.phtml"> <block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager"/> diff --git a/app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Category/Move.php b/app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Category/Move.php index f3984bf7d62a..5a5b805ba189 100644 --- a/app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Category/Move.php +++ b/app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Category/Move.php @@ -67,13 +67,11 @@ public function afterChangeParent( $categoryStoreId = $category->getStoreId(); foreach ($category->getStoreIds() as $storeId) { $category->setStoreId($storeId); - if (!$this->isGlobalScope($storeId)) { - $this->updateCategoryUrlKeyForStore($category); - $category->unsUrlPath(); - $category->setUrlPath($this->categoryUrlPathGenerator->getUrlPath($category)); - $category->getResource()->saveAttribute($category, 'url_path'); - $this->updateUrlPathForChildren($category); - } + $this->updateCategoryUrlKeyForStore($category); + $category->unsUrlPath(); + $category->setUrlPath($this->categoryUrlPathGenerator->getUrlPath($category)); + $category->getResource()->saveAttribute($category, 'url_path'); + $this->updateUrlPathForChildren($category); } $category->setStoreId($categoryStoreId); diff --git a/app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Store/View.php b/app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Store/View.php index 31bb630718e5..015103489fd9 100644 --- a/app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Store/View.php +++ b/app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Store/View.php @@ -104,7 +104,10 @@ public function afterSave( Store $object, Store $store ): Store { - if ($this->origStore->isObjectNew() || $this->origStore->dataHasChangedFor('group_id')) { + if ( + $this->origStore->getData('group_id') + && ($this->origStore->isObjectNew() || $this->origStore->dataHasChangedFor('group_id')) + ) { $categoryRewriteUrls = $this->generateCategoryUrls( (int)$this->origStore->getRootCategoryId(), (int)$this->origStore->getId() diff --git a/app/code/Magento/CatalogUrlRewrite/Model/Product/Validator.php b/app/code/Magento/CatalogUrlRewrite/Model/Product/Validator.php new file mode 100644 index 000000000000..01aa2155e322 --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/Model/Product/Validator.php @@ -0,0 +1,101 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogUrlRewrite\Model\Product; + +use Magento\Catalog\Model\Product; +use Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator; +use Magento\UrlRewrite\Model\Exception\UrlAlreadyExistsException; +use Magento\UrlRewrite\Model\UrlFinderInterface; +use Magento\UrlRewrite\Service\V1\Data\UrlRewrite; +use Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator; +use Magento\Store\Model\StoreManagerInterface; + +/** + * Url Rewrites Product validator. + */ +class Validator +{ + /** + * @var ProductUrlPathGenerator + */ + private $productUrlPathGenerator; + + /** + * @var UrlFinderInterface + */ + private $urlFinder; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @param ProductUrlPathGenerator $productUrlPathGenerator + * @param UrlFinderInterface $urlFinder + * @param StoreManagerInterface $storeManager + */ + public function __construct( + ProductUrlPathGenerator $productUrlPathGenerator, + UrlFinderInterface $urlFinder, + StoreManagerInterface $storeManager + ) { + $this->productUrlPathGenerator = $productUrlPathGenerator; + $this->urlFinder = $urlFinder; + $this->storeManager = $storeManager; + } + + /** + * Validate Url Key of a Product has no conflicts. + * + * @param Product $product + * @throws UrlAlreadyExistsException + */ + public function validateUrlKeyConflicts(Product $product): void + { + $stores = $this->storeManager->getStores(); + + $storeIdsToPathForSave = []; + $searchData = [ + UrlRewrite::ENTITY_TYPE => ProductUrlRewriteGenerator::ENTITY_TYPE, + UrlRewrite::REQUEST_PATH => [], + ]; + + foreach ($stores as $store) { + if (!in_array($store->getWebsiteId(), $product->getWebsiteIds())) { + continue; + } + + $urlPath = $this->productUrlPathGenerator->getUrlPathWithSuffix($product, $store->getId()); + $storeIdsToPathForSave[$store->getId()] = $urlPath; + $searchData[UrlRewrite::REQUEST_PATH][] = $urlPath; + } + + $urlRewrites = $this->urlFinder->findAllByData($searchData); + $exceptionData = []; + + foreach ($urlRewrites as $urlRewrite) { + if (in_array($urlRewrite->getRequestPath(), $storeIdsToPathForSave) + && isset($storeIdsToPathForSave[$urlRewrite->getStoreId()]) + && $storeIdsToPathForSave[$urlRewrite->getStoreId()] === $urlRewrite->getRequestPath() + && $product->getId() !== $urlRewrite->getEntityId() + ) { + $exceptionData[$urlRewrite->getUrlRewriteId()] = $urlRewrite->toArray(); + } + } + + if ($exceptionData) { + throw new UrlAlreadyExistsException( + __('URL key for specified store already exists.'), + null, + 0, + $exceptionData + ); + } + } +} diff --git a/app/code/Magento/CatalogUrlRewrite/Model/ResourceModel/Category/GetDefaultUrlKey.php b/app/code/Magento/CatalogUrlRewrite/Model/ResourceModel/Category/GetDefaultUrlKey.php new file mode 100644 index 000000000000..d5e603d9df59 --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/Model/ResourceModel/Category/GetDefaultUrlKey.php @@ -0,0 +1,83 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogUrlRewrite\Model\ResourceModel\Category; + +use Magento\Catalog\Api\Data\CategoryInterface; +use Magento\Catalog\Model\Category; +use Magento\Eav\Model\Config as EavConfig; +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Select; +use Magento\Framework\EntityManager\MetadataPool; +use Magento\Store\Model\Store; + +/** + * Fetch category 'url_key' default value from the database. + */ +class GetDefaultUrlKey +{ + /** + * @var MetadataPool + */ + private $metadataPool; + + /** + * @var ResourceConnection + */ + private $resourceConnection; + + /** + * @var EavConfig + */ + private $eavConfig; + + /** + * @param MetadataPool $metadataPool + * @param ResourceConnection $resourceConnection + * @param EavConfig $eavConfig + */ + public function __construct( + MetadataPool $metadataPool, + ResourceConnection $resourceConnection, + EavConfig $eavConfig + ) { + $this->metadataPool = $metadataPool; + $this->resourceConnection = $resourceConnection; + $this->eavConfig = $eavConfig; + } + + /** + * Retrieve 'url_key' value for default store. + * + * @param int $categoryId + * @return string|null + */ + public function execute(int $categoryId): ?string + { + $metadata = $this->metadataPool->getMetadata(CategoryInterface::class); + $entityTypeId = $this->eavConfig->getEntityType(Category::ENTITY)->getId(); + $linkField = $metadata->getLinkField(); + $whereConditions = [ + 'e.entity_type_id = ' . $entityTypeId, + "e.attribute_code = 'url_key'", + 'c.' . $linkField . ' = ' . $categoryId, + 'c.store_id = ' . Store::DEFAULT_STORE_ID, + ]; + $connection = $this->resourceConnection->getConnection(); + $select = $connection->select() + ->from(['c' => $this->resourceConnection->getTableName('catalog_category_entity_varchar')]) + ->joinLeft( + ['e' => $this->resourceConnection->getTableName('eav_attribute')], + 'e.attribute_id = c.attribute_id' + ) + ->reset(Select::COLUMNS) + ->columns(['c.value']) + ->where(implode(' AND ', $whereConditions)); + + return $connection->fetchOne($select) ?: null; + } +} diff --git a/app/code/Magento/CatalogUrlRewrite/Model/Storage/DynamicStorage.php b/app/code/Magento/CatalogUrlRewrite/Model/Storage/DynamicStorage.php index d9e9705ac039..9da95d4270b7 100644 --- a/app/code/Magento/CatalogUrlRewrite/Model/Storage/DynamicStorage.php +++ b/app/code/Magento/CatalogUrlRewrite/Model/Storage/DynamicStorage.php @@ -179,13 +179,16 @@ private function findProductRewriteByRequestPath(array $data): ?array unset($data[UrlRewrite::IS_AUTOGENERATED]); $categoryFromDb = $this->connection->fetchRow($this->prepareSelect($data)); + if ($categoryFromDb === false) { + return null; + } + if ($categoryFromDb[UrlRewrite::REDIRECT_TYPE]) { $productFromDb[UrlRewrite::REDIRECT_TYPE] = OptionProvider::PERMANENT; $categoryPath = str_replace($categorySuffix, '', $categoryFromDb[UrlRewrite::TARGET_PATH]); } - if ($categoryFromDb === false - || !$productResource->canBeShowInCategory( + if (!$productResource->canBeShowInCategory( $productFromDb[UrlRewrite::ENTITY_ID], $categoryFromDb[UrlRewrite::ENTITY_ID] ) diff --git a/app/code/Magento/CatalogUrlRewrite/Observer/AfterImportDataObserver.php b/app/code/Magento/CatalogUrlRewrite/Observer/AfterImportDataObserver.php index b467771408ec..0a82a8febc0a 100644 --- a/app/code/Magento/CatalogUrlRewrite/Observer/AfterImportDataObserver.php +++ b/app/code/Magento/CatalogUrlRewrite/Observer/AfterImportDataObserver.php @@ -475,17 +475,18 @@ private function currentUrlRewritesRegenerate() ] ); - $urlRewrites = []; + $mergeDataProvider = clone $this->mergeDataProviderPrototype; foreach ($currentUrlRewrites as $currentUrlRewrite) { $category = $this->retrieveCategoryFromMetadata($currentUrlRewrite); if ($category === false) { continue; } - $url = $currentUrlRewrite->getIsAutogenerated() + $urls = $currentUrlRewrite->getIsAutogenerated() ? $this->generateForAutogenerated($currentUrlRewrite, $category) : $this->generateForCustom($currentUrlRewrite, $category); - $urlRewrites = $url + $urlRewrites; + $mergeDataProvider->merge($urls); } + $urlRewrites = $mergeDataProvider->getData(); $this->product = null; $this->productCategories = null; diff --git a/app/code/Magento/CatalogUrlRewrite/Observer/CategoryUrlPathAutogeneratorObserver.php b/app/code/Magento/CatalogUrlRewrite/Observer/CategoryUrlPathAutogeneratorObserver.php index 401f2c9629f7..9593f5cb4fcc 100644 --- a/app/code/Magento/CatalogUrlRewrite/Observer/CategoryUrlPathAutogeneratorObserver.php +++ b/app/code/Magento/CatalogUrlRewrite/Observer/CategoryUrlPathAutogeneratorObserver.php @@ -11,11 +11,14 @@ use Magento\Catalog\Model\Category; use Magento\CatalogUrlRewrite\Model\Category\ChildrenCategoriesProvider; use Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator; +use Magento\CatalogUrlRewrite\Model\ResourceModel\Category\GetDefaultUrlKey; use Magento\CatalogUrlRewrite\Service\V1\StoreViewService; +use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Store\Model\Store; +use Magento\Backend\Model\Validator\UrlKey\CompositeUrlKey; /** * Class for set or update url path. @@ -24,24 +27,17 @@ class CategoryUrlPathAutogeneratorObserver implements ObserverInterface { /** - * Reserved endpoint names. - * - * @var string[] - */ - private $invalidValues = []; - - /** - * @var \Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator + * @var CategoryUrlPathGenerator */ protected $categoryUrlPathGenerator; /** - * @var \Magento\CatalogUrlRewrite\Model\Category\ChildrenCategoriesProvider + * @var ChildrenCategoriesProvider */ protected $childrenCategoriesProvider; /** - * @var \Magento\CatalogUrlRewrite\Service\V1\StoreViewService + * @var StoreViewService */ protected $storeViewService; @@ -51,43 +47,47 @@ class CategoryUrlPathAutogeneratorObserver implements ObserverInterface private $categoryRepository; /** - * @var \Magento\Backend\App\Area\FrontNameResolver + * @var CompositeUrlKey + */ + private $compositeUrlValidator; + + /** + * @var GetDefaultUrlKey */ - private $frontNameResolver; + private $getDefaultUrlKey; /** * @param CategoryUrlPathGenerator $categoryUrlPathGenerator * @param ChildrenCategoriesProvider $childrenCategoriesProvider - * @param \Magento\CatalogUrlRewrite\Service\V1\StoreViewService $storeViewService + * @param StoreViewService $storeViewService * @param CategoryRepositoryInterface $categoryRepository - * @param \Magento\Backend\App\Area\FrontNameResolver $frontNameResolver - * @param string[] $invalidValues + * @param CompositeUrlKey $compositeUrlValidator + * @param GetDefaultUrlKey $getDefaultUrlKey */ public function __construct( CategoryUrlPathGenerator $categoryUrlPathGenerator, ChildrenCategoriesProvider $childrenCategoriesProvider, StoreViewService $storeViewService, CategoryRepositoryInterface $categoryRepository, - \Magento\Backend\App\Area\FrontNameResolver $frontNameResolver = null, - array $invalidValues = [] + CompositeUrlKey $compositeUrlValidator, + GetDefaultUrlKey $getDefaultUrlKey ) { $this->categoryUrlPathGenerator = $categoryUrlPathGenerator; $this->childrenCategoriesProvider = $childrenCategoriesProvider; $this->storeViewService = $storeViewService; $this->categoryRepository = $categoryRepository; - $this->frontNameResolver = $frontNameResolver ?: \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Backend\App\Area\FrontNameResolver::class); - $this->invalidValues = $invalidValues; + $this->compositeUrlValidator = $compositeUrlValidator; + $this->getDefaultUrlKey = $getDefaultUrlKey; } /** * Method for update/set url path. * - * @param \Magento\Framework\Event\Observer $observer + * @param Observer $observer * @return void * @throws LocalizedException */ - public function execute(\Magento\Framework\Event\Observer $observer) + public function execute(Observer $observer) { /** @var Category $category */ $category = $observer->getEvent()->getCategory(); @@ -100,6 +100,12 @@ public function execute(\Magento\Framework\Event\Observer $observer) $resultUrlKey = $category->formatUrlKey($category->getOrigData('name')); $this->updateUrlKey($category, $resultUrlKey); } + if ($category->hasChildren()) { + $defaultUrlKey = $this->getDefaultUrlKey->execute((int)$category->getId()); + if ($defaultUrlKey) { + $this->updateUrlKey($category, $defaultUrlKey); + } + } $category->setUrlKey(null)->setUrlPath(null); } } @@ -161,27 +167,12 @@ private function validateUrlKey(Category $category, ?string $urlKey): void throw new LocalizedException(__('Invalid URL key')); } - if (in_array($urlKey, $this->getInvalidValues())) { - throw new LocalizedException( - __( - 'URL key "%1" matches a reserved endpoint name (%2). Use another URL key.', - $urlKey, - implode(', ', $this->getInvalidValues()) - ) - ); + $errors = $this->compositeUrlValidator->validate($urlKey); + if (!empty($errors)) { + throw new LocalizedException($errors[0]); } } - /** - * Get reserved endpoint names. - * - * @return array - */ - private function getInvalidValues() - { - return array_unique(array_merge($this->invalidValues, [$this->frontNameResolver->getFrontName()])); - } - /** * Update url path for children category. * diff --git a/app/code/Magento/CatalogUrlRewrite/Observer/ProductUrlKeyAutogeneratorObserver.php b/app/code/Magento/CatalogUrlRewrite/Observer/ProductUrlKeyAutogeneratorObserver.php index 28afff56c019..b3f06874b711 100644 --- a/app/code/Magento/CatalogUrlRewrite/Observer/ProductUrlKeyAutogeneratorObserver.php +++ b/app/code/Magento/CatalogUrlRewrite/Observer/ProductUrlKeyAutogeneratorObserver.php @@ -9,32 +9,49 @@ use Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Backend\Model\Validator\UrlKey\CompositeUrlKey; class ProductUrlKeyAutogeneratorObserver implements ObserverInterface { /** - * @var \Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator + * @var ProductUrlPathGenerator */ protected $productUrlPathGenerator; + /** + * @var CompositeUrlKey + */ + private $compositeUrlValidator; + /** * @param ProductUrlPathGenerator $productUrlPathGenerator + * @param CompositeUrlKey $compositeUrlValidator */ - public function __construct(ProductUrlPathGenerator $productUrlPathGenerator) - { + public function __construct( + ProductUrlPathGenerator $productUrlPathGenerator, + CompositeUrlKey $compositeUrlValidator + ) { $this->productUrlPathGenerator = $productUrlPathGenerator; + $this->compositeUrlValidator = $compositeUrlValidator; } /** - * @param \Magento\Framework\Event\Observer $observer - * @return void + * Validates and sets url key for product + * + * @param Observer $observer + * @throws LocalizedException */ - public function execute(\Magento\Framework\Event\Observer $observer) + public function execute(Observer $observer) { /** @var Product $product */ $product = $observer->getEvent()->getProduct(); $urlKey = $this->productUrlPathGenerator->getUrlKey($product); if (null !== $urlKey) { + $errors = $this->compositeUrlValidator->validate($urlKey); + if (!empty($errors)) { + throw new LocalizedException($errors[0]); + } $product->setUrlKey($urlKey); } } diff --git a/app/code/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewrites.php b/app/code/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewrites.php index f9c605ab489a..ce951dc539d0 100644 --- a/app/code/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewrites.php +++ b/app/code/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewrites.php @@ -8,7 +8,7 @@ namespace Magento\CatalogUrlRewrite\Plugin\Catalog\Model\Product; use Magento\Catalog\Model\Product\Action as ProductAction; -use Magento\Catalog\Model\ResourceModel\Product\Collection; +use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; use Magento\CatalogUrlRewrite\Model\Products\AppendUrlRewritesToProducts; use Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator; use Magento\Store\Api\StoreWebsiteRelationInterface; @@ -27,9 +27,9 @@ class UpdateProductWebsiteUrlRewrites private $urlPersist; /** - * @var Collection + * @var CollectionFactory */ - private $productCollection; + private $productCollectionFactory; /** * @var AppendUrlRewritesToProducts @@ -43,18 +43,18 @@ class UpdateProductWebsiteUrlRewrites /** * @param UrlPersistInterface $urlPersist - * @param Collection $productCollection + * @param CollectionFactory $productCollectionFactory * @param AppendUrlRewritesToProducts $appendRewrites * @param GetStoresListByWebsiteIds $getStoresList */ public function __construct( UrlPersistInterface $urlPersist, - Collection $productCollection, + CollectionFactory $productCollectionFactory, AppendUrlRewritesToProducts $appendRewrites, GetStoresListByWebsiteIds $getStoresList ) { $this->urlPersist = $urlPersist; - $this->productCollection = $productCollection; + $this->productCollectionFactory = $productCollectionFactory; $this->appendRewrites = $appendRewrites; $this->getStoresList = $getStoresList; } @@ -90,8 +90,9 @@ public function afterUpdateWebsites( ] ); } else { - $collection = $this->productCollection->addFieldToFilter('entity_id', ['in' => implode(',', $productIds)]); - $this->appendRewrites->execute($collection->getItems(), $storeIds); + $productCollection = $this->productCollectionFactory->create(); + $productCollection->addFieldToFilter('entity_id', ['in' => implode(',', $productIds)]); + $this->appendRewrites->execute($productCollection->getItems(), $storeIds); } } } diff --git a/app/code/Magento/CatalogUrlRewrite/Setup/Patch/Data/UpdateUrlKeyForProducts.php b/app/code/Magento/CatalogUrlRewrite/Setup/Patch/Data/UpdateUrlKeyForProducts.php index 5e7039912999..f74d8ca358b3 100644 --- a/app/code/Magento/CatalogUrlRewrite/Setup/Patch/Data/UpdateUrlKeyForProducts.php +++ b/app/code/Magento/CatalogUrlRewrite/Setup/Patch/Data/UpdateUrlKeyForProducts.php @@ -34,19 +34,27 @@ class UpdateUrlKeyForProducts implements DataPatchInterface, PatchVersionInterfa */ private $urlProduct; + /** + * @var \Magento\Framework\EntityManager\MetadataPool + */ + private $metadataPool; + /** * @param ModuleDataSetupInterface $moduleDataSetup * @param EavSetupFactory $eavSetupFactory * @param Url $urlProduct + * @param \Magento\Framework\EntityManager\MetadataPool $metadataPool */ public function __construct( ModuleDataSetupInterface $moduleDataSetup, EavSetupFactory $eavSetupFactory, - Url $urlProduct + Url $urlProduct, + \Magento\Framework\EntityManager\MetadataPool $metadataPool ) { $this->moduleDataSetup = $moduleDataSetup; $this->eavSetup = $eavSetupFactory->create(['setup' => $moduleDataSetup]); $this->urlProduct = $urlProduct; + $this->metadataPool = $metadataPool; } /** @@ -58,7 +66,7 @@ public function apply() $table = $this->moduleDataSetup->getTable('catalog_product_entity_varchar'); $select = $this->moduleDataSetup->getConnection()->select()->from( $table, - ['value_id', 'value'] + [$this->getProductLinkField(), 'attribute_id', 'store_id', 'value_id', 'value'] )->where( 'attribute_id = ?', $this->eavSetup->getAttributeId($productTypeId, 'url_key') @@ -99,4 +107,17 @@ public function getAliases() { return []; } + + /** + * Return product id field name - entity_id|row_id + * + * @return string + * @throws \Exception + */ + private function getProductLinkField() + { + return $this->metadataPool + ->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class) + ->getLinkField(); + } } diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Data/AdminCategoryRestrictedUrlMessageData.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Data/AdminCategoryRestrictedUrlMessageData.xml index b463b0524d5f..5fbf9e474e23 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Data/AdminCategoryRestrictedUrlMessageData.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Data/AdminCategoryRestrictedUrlMessageData.xml @@ -13,5 +13,6 @@ <data key="urlSoap">URL key "soap" matches a reserved endpoint name (admin, soap, rest, graphql, standard). Use another URL key.</data> <data key="urlRest">URL key "rest" matches a reserved endpoint name (admin, soap, rest, graphql, standard). Use another URL key.</data> <data key="urlGraphql">URL key "graphql" matches a reserved endpoint name (admin, soap, rest, graphql, standard). Use another URL key.</data> + <data key="urlAdminError">URL key "admin" matches a reserved endpoint name (admin). Use another URL key.</data> </entity> </entities> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml index 213099d3ba97..89bb8285cd47 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml @@ -45,12 +45,12 @@ <argument name="categoryName" value="admin"/> <argument name="categoryUrlKey" value=""/> </actionGroup> - <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlAdmin}}' stepKey="seeAdminFirstErrorMessage"/> + <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlAdminError}}' stepKey="seeAdminFirstErrorMessage"/> <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillAdminSecondCategoryForm"> <argument name="categoryName" value="{{SimpleSubCategory.name}}"/> <argument name="categoryUrlKey" value="admin"/> </actionGroup> - <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlAdmin}}' stepKey="seeAdminSecondErrorMessage"/> + <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlAdminError}}' stepKey="seeAdminSecondErrorMessage"/> <!--Create category with 'admin' name--> <comment userInput="Create category with 'admin' name" stepKey="commentAdminCategoryCreation"/> <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillAdminThirdCategoryForm"> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminRewriteProductWithTwoStoreTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminRewriteProductWithTwoStoreTest.xml index 0e4ee26a462e..b8af481c2eee 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminRewriteProductWithTwoStoreTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminRewriteProductWithTwoStoreTest.xml @@ -17,10 +17,7 @@ <before> <magentoCLI command="config:set {{EnableCategoriesPathProductUrls.path}} {{EnableCategoriesPathProductUrls.value}}" stepKey="enableUseCategoriesPath"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> - + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView" /> <createData entity="_defaultCategoryDifferentUrlStore" stepKey="defaultCategory"/> @@ -38,9 +35,7 @@ <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="defaultCategory" stepKey="deleteNewRootCategory"/> <magentoCLI command="config:set {{DisableCategoriesPathProductUrls.path}} {{DisableCategoriesPathProductUrls.value}}" stepKey="disableUseCategoriesPath"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="navigateToCreatedDefaultCategory"> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml index ad426c4bc6c4..12caaca76976 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml @@ -80,7 +80,7 @@ <magentoCLI command="cron:run --group=index" stepKey="runCron"/> <!--Got to Store front product page and check url--> - <amOnPage url="{{StorefrontProductPage.url($$createProduct.sku$$-new)}}" stepKey="navigateToSimpleProductPage"/> - <seeInCurrentUrl url="{{StorefrontProductPage.url($$createProduct.sku$$-new)}}" stepKey="seeProductNewUrl"/> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$-new)}}" stepKey="navigateToSimpleProductPage"/> + <seeInCurrentUrl url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$-new)}}" stepKey="seeProductNewUrl"/> </test> </tests> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryAccessibleWhenSuffixIsNullTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryAccessibleWhenSuffixIsNullTest.xml index 4880d438373f..8f5d45513e62 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryAccessibleWhenSuffixIsNullTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryAccessibleWhenSuffixIsNullTest.xml @@ -21,9 +21,7 @@ <magentoCLI command="config:set catalog/seo/category_url_suffix ''" stepKey="setCategoryUrlSuffix"/> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 0" stepKey="setCategoryProductRewrites"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheBefore"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheBefore"/> <createData entity="_defaultCategory" stepKey="createCategory"/> </before> <after> @@ -32,12 +30,10 @@ stepKey="restoreCategoryUrlSuffix"/> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="restoreCategoryProductRewrites"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfter"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfter"/> </after> - <amOnPage url="/$$createCategory.name$$" stepKey="onCategoryPage"/> + <amOnPage url="/$$createCategory.custom_attributes[url_key]$$" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <seeInTitle userInput="$$createCategory.name$$" stepKey="assertCategoryNameInTitle"/> </test> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryUrlRewriteDifferentStoreTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryUrlRewriteDifferentStoreTest.xml index 783d9fa31c99..3275a136aa11 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryUrlRewriteDifferentStoreTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryUrlRewriteDifferentStoreTest.xml @@ -32,9 +32,7 @@ </actionGroup> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindexAfterCreate"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheBefore"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheBefore"/> </before> <after> <magentoCLI command="config:set catalog/seo/product_use_categories 0" stepKey="setEnableUseCategoriesPath"/> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCheckCategoryUrlPathForCustomStoreAfterChangingHierarchyTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCheckCategoryUrlPathForCustomStoreAfterChangingHierarchyTest.xml new file mode 100644 index 000000000000..c28b48f27006 --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCheckCategoryUrlPathForCustomStoreAfterChangingHierarchyTest.xml @@ -0,0 +1,174 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontCheckCategoryUrlPathForCustomStoreAfterChangingHierarchyTest"> + <annotations> + <features value="CatalogUrlRewrite"/> + <stories value="Url rewrites"/> + <title value="Checking category URL path for custom store after changing hierarchy"/> + <description value="Checks that category and its children have correct URL path for custom store after changing hierarchy"/> + <severity value="MAJOR"/> + <testCaseId value="MC-41615"/> + <useCaseId value="MC-40780"/> + <group value="catalog"/> + <group value="urlRewrite"/> + </annotations> + <before> + <!-- Create categories --> + <createData entity="_defaultCategory" stepKey="createCategory1"/> + <createData entity="SubCategoryWithParent" stepKey="createCategory2"> + <requiredEntity createDataKey="createCategory1"/> + </createData> + <createData entity="_defaultCategory" stepKey="createCategory3"/> + <createData entity="_defaultCategory" stepKey="createCategory4"/> + <!-- Login as Admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!-- Create "EN" Store View --> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createEnStoreView"> + <argument name="customStore" value="customStoreEN"/> + </actionGroup> + </before> + <after> + <!-- Delete categories --> + <deleteData createDataKey="createCategory4" stepKey="deleteCategory4"/> + <deleteData createDataKey="createCategory3" stepKey="deleteCategory3"/> + <deleteData createDataKey="createCategory2" stepKey="deleteCategory2"/> + <deleteData createDataKey="createCategory1" stepKey="deleteCategory1"/> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteEnStoreView"> + <argument name="customStore" value="customStoreEN"/> + </actionGroup> + <!-- Clear grid filters --> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearStoreFilters"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Go to Category 1 edit page on "EN" store view --> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="goToCategory1PageOnEnStoreView"> + <argument name="Store" value="customStoreEN.name"/> + <argument name="CatName" value="$createCategory1.name$"/> + </actionGroup> + + <!-- Change Name and URL key for Category 1 --> + <actionGroup ref="AdminChangeCategoryNameOnStoreViewLevelActionGroup" stepKey="changeCategory1NameForEnStoreView"> + <argument name="categoryName" value="EN 1"/> + </actionGroup> + <actionGroup ref="AdminChangeSeoUrlKeyForSubCategoryWithoutRedirectActionGroup" stepKey="changeCategory1UrlKeyForEnStoreView"> + <argument name="value" value="en 1"/> + </actionGroup> + + <!-- Change Name and URL key for Category 2 --> + <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory2EditPage"> + <argument name="category" value="$createCategory2$"/> + </actionGroup> + <actionGroup ref="AdminChangeCategoryNameOnStoreViewLevelActionGroup" stepKey="changeCategory2NameForEnStoreView"> + <argument name="categoryName" value="EN 2"/> + </actionGroup> + <actionGroup ref="AdminChangeSeoUrlKeyForSubCategoryWithoutRedirectActionGroup" stepKey="changeCategory2UrlKeyForEnStoreView"> + <argument name="value" value="en 2"/> + </actionGroup> + + <!-- Change Name and URL key for Category 3 --> + <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory3EditPage"> + <argument name="category" value="$createCategory3$"/> + </actionGroup> + <actionGroup ref="AdminChangeCategoryNameOnStoreViewLevelActionGroup" stepKey="changeCategory3NameForEnStoreView"> + <argument name="categoryName" value="EN 3"/> + </actionGroup> + <actionGroup ref="AdminChangeSeoUrlKeyForSubCategoryWithoutRedirectActionGroup" stepKey="changeCategory3UrlKeyForEnStoreView"> + <argument name="value" value="en 3"/> + </actionGroup> + + <!-- Change Name and URL key for Category 4 --> + <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory4EditPage"> + <argument name="category" value="$createCategory4$"/> + </actionGroup> + <actionGroup ref="AdminChangeCategoryNameOnStoreViewLevelActionGroup" stepKey="changeCategory4NameForEnStoreView"> + <argument name="categoryName" value="EN 4"/> + </actionGroup> + <actionGroup ref="AdminChangeSeoUrlKeyForSubCategoryWithoutRedirectActionGroup" stepKey="changeCategory4UrlKeyForEnStoreView"> + <argument name="value" value="en 4"/> + </actionGroup> + + <!-- Go to Home page on the Storefront --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> + <!-- Switch store view to 'EN' --> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchStoreViewToEn"> + <argument name="storeView" value="customStoreEN"/> + </actionGroup> + + <!-- Assert Category 2 URL path on the 'EN' store view --> + <actionGroup ref="StorefrontGoToSubCategoryPageActionGroup" stepKey="navigateToCategory2Page"> + <argument name="categoryName" value="EN 1"/> + <argument name="subCategoryName" value="EN 2"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProperUrlIsShownActionGroup" stepKey="assertUrlPathForCategory2"> + <argument name="urlPath" value="/en-1/en-2.html"/> + </actionGroup> + + <!-- Go to Categories page on the Admin --> + <actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="goToAdminCategoriesPage"/> + <see userInput="All Store View" selector="{{AdminMainActionsSection.storeViewDropdown}}" stepKey="assertAllStoreView"/> + + <!-- Move Category 2 to 'Default Category' --> + <actionGroup ref="MoveCategoryActionGroup" stepKey="moveCategory2ToDefaultCategory"> + <argument name="childCategory" value="$createCategory2.name$"/> + <argument name="parentCategory" value="Default Category"/> + </actionGroup> + <!-- Move Category 4 to Category 3 --> + <actionGroup ref="MoveCategoryActionGroup" stepKey="moveCategory4ToCategory3"> + <argument name="childCategory" value="$createCategory4.name$"/> + <argument name="parentCategory" value="$createCategory3.name$"/> + </actionGroup> + + <!-- Create Category 5 --> + <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="navigateToCategory2EditPage"> + <argument name="category" value="$createCategory2$"/> + </actionGroup> + <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickToAddCategory5"/> + <checkOption selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="enableCategory5"/> + <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{SimpleSubCategory.name}}" stepKey="fillCategory5Name"/> + <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory5"/> + <actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertCategory5Saved"/> + + <!-- Assert Category 5 URL path on the 'EN' store view --> + <actionGroup ref="StorefrontGoToSubCategoryPageActionGroup" stepKey="navigateToCategory5Page"> + <argument name="categoryName" value="EN 2"/> + <argument name="subCategoryName" value="{{SimpleSubCategory.name}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProperUrlIsShownActionGroup" stepKey="assertUrlPathForCategory5"> + <argument name="urlPath" value="en-2/{{SimpleSubCategory.name_lwr}}.html"/> + </actionGroup> + + <!-- Go to Category 2 edit page on "EN" store view --> + <actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="goToAdminCategoryIndexPage"/> + <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="goToCategory2EditPage"> + <argument name="category" value="$createCategory2$"/> + </actionGroup> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToDefaultStoreView"> + <argument name="storeView" value="customStoreEN.name"/> + </actionGroup> + + <!-- Change Category 2 URL key to default value --> + <actionGroup ref="AdminChangeSeoUrlKeyToDefaultValueWithoutRedirectActionGroup" stepKey="changeCategory2UrlKeyToDefaultValue"/> + <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory2"/> + <actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertCategory2Saved"/> + + <!-- Go to Home page on the Storefront --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="navigateToHomePage"/> + <!-- Assert Category 5 URL path on the 'EN' store view after change parent category --> + <actionGroup ref="StorefrontGoToSubCategoryPageActionGroup" stepKey="goToCategory5Page"> + <argument name="categoryName" value="EN 2"/> + <argument name="subCategoryName" value="{{SimpleSubCategory.name}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProperUrlIsShownActionGroup" stepKey="assertUrlPathForCategory5AfterChangeParent"> + <argument name="urlPath" value="$createCategory2.name_lwr$/{{SimpleSubCategory.name_lwr}}.html"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/Plugin/Category/MoveTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/Plugin/Category/MoveTest.php index 6faebc1154dc..44997591a690 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/Plugin/Category/MoveTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/Plugin/Category/MoveTest.php @@ -91,27 +91,26 @@ protected function setUp(): void public function testAfterChangeParent() { $urlPath = 'test/path'; - $storeIds = [1]; + $storeIds = [0, 1]; $originalCategory = $this->getMockBuilder(Category::class) ->disableOriginalConstructor() ->getMock(); $this->categoryFactory->method('create') ->willReturn($originalCategory); - $this->categoryMock->method('getResource') ->willReturn($this->subjectMock); $this->categoryMock->expects($this->once()) ->method('getStoreIds') ->willReturn($storeIds); - $this->childrenCategoriesProviderMock->expects($this->once()) + $this->childrenCategoriesProviderMock->expects($this->exactly(2)) ->method('getChildren') ->with($this->categoryMock, true) ->willReturn([]); - $this->categoryUrlPathGeneratorMock->expects($this->once()) + $this->categoryUrlPathGeneratorMock->expects($this->exactly(2)) ->method('getUrlPath') ->with($this->categoryMock) ->willReturn($urlPath); - $this->categoryMock->expects($this->once()) + $this->categoryMock->expects($this->exactly(2)) ->method('setUrlPath') ->with($urlPath); $this->assertSame( diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/Plugin/Store/ViewTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/Plugin/Store/ViewTest.php index 61557db883aa..d3da26038ed0 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/Plugin/Store/ViewTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/Plugin/Store/ViewTest.php @@ -7,18 +7,18 @@ namespace Magento\CatalogUrlRewrite\Test\Unit\Model\Category\Plugin\Store; -use Magento\Catalog\Model\ResourceModel\Category\Collection as CategoryCollection; use Magento\Catalog\Model\Category; use Magento\Catalog\Model\CategoryFactory; use Magento\Catalog\Model\Product; use Magento\Catalog\Model\ProductFactory; +use Magento\Catalog\Model\ResourceModel\Category\Collection as CategoryCollection; use Magento\Catalog\Model\ResourceModel\Product\Collection as ProductCollection; use Magento\CatalogUrlRewrite\Model\Category\Plugin\Store\View as StoreViewPlugin; use Magento\CatalogUrlRewrite\Model\CategoryUrlRewriteGenerator; use Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator; use Magento\Framework\Model\AbstractModel; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\Store\Model\ResourceModel\Store; +use Magento\Store\Model\ResourceModel\Store as StoreResourceModel; +use Magento\Store\Model\Store; use Magento\UrlRewrite\Model\UrlPersistInterface; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -28,11 +28,6 @@ */ class ViewTest extends TestCase { - /** - * @var ObjectManager - */ - private $objectManager; - /** * @var StoreViewPlugin */ @@ -44,7 +39,7 @@ class ViewTest extends TestCase private $abstractModelMock; /** - * @var Store|MockObject + * @var StoreResourceModel|MockObject */ private $subjectMock; @@ -93,12 +88,11 @@ class ViewTest extends TestCase */ protected function setUp(): void { - $this->objectManager = new ObjectManager($this); $this->abstractModelMock = $this->getMockBuilder(AbstractModel::class) ->disableOriginalConstructor() ->setMethods(['isObjectNew']) ->getMockForAbstractClass(); - $this->subjectMock = $this->getMockBuilder(Store::class) + $this->subjectMock = $this->getMockBuilder(StoreResourceModel::class) ->disableOriginalConstructor() ->getMock(); $this->urlPersistMock = $this->getMockBuilder(UrlPersistInterface::class) @@ -131,15 +125,12 @@ protected function setUp(): void ->disableOriginalConstructor() ->setMethods(['getCollection']) ->getMock(); - $this->plugin = $this->objectManager->getObject( - StoreViewPlugin::class, - [ - 'urlPersist' => $this->urlPersistMock, - 'categoryFactory' => $this->categoryFactoryMock, - 'productFactory' => $this->productFactoryMock, - 'categoryUrlRewriteGenerator' => $this->categoryUrlRewriteGeneratorMock, - 'productUrlRewriteGenerator' => $this->productUrlRewriteGeneratorMock - ] + $this->plugin = new StoreViewPlugin( + $this->urlPersistMock, + $this->categoryFactoryMock, + $this->productFactoryMock, + $this->categoryUrlRewriteGeneratorMock, + $this->productUrlRewriteGeneratorMock ); } @@ -150,13 +141,19 @@ protected function setUp(): void */ public function testAfterSave(): void { - $origStoreMock = $this->getMockBuilder(\Magento\Store\Model\Store::class) + $origStoreMock = $this->getMockBuilder(Store::class) ->disableOriginalConstructor() ->getMock(); $reflectionStore = new \ReflectionClass($this->plugin); $origStore = $reflectionStore->getProperty('origStore'); $origStore->setAccessible(true); $origStore->setValue($this->plugin, $origStoreMock); + + $origStoreMock->expects($this->atLeastOnce()) + ->method('getData') + ->with('group_id') + ->willReturn('1'); + $origStoreMock->expects($this->atLeastOnce()) ->method('isObjectNew') ->willReturn(true); @@ -203,7 +200,54 @@ public function testAfterSave(): void $this->assertSame( $this->subjectMock, - $this->plugin->afterSave($this->subjectMock, $this->subjectMock, $this->abstractModelMock) + $this->plugin->afterSave($this->subjectMock, $this->subjectMock) + ); + } + + public function testAfterSaveWhenNoGroupId() + { + $origStoreMock = $this->getMockBuilder(Store::class) + ->disableOriginalConstructor() + ->getMock(); + $reflectionStore = new \ReflectionClass($this->plugin); + $origStore = $reflectionStore->getProperty('origStore'); + $origStore->setAccessible(true); + $origStore->setValue($this->plugin, $origStoreMock); + + $origStoreMock->expects($this->atLeastOnce()) + ->method('getData') + ->with('group_id') + ->willReturn(null); + + $origStoreMock->expects($this->any()) + ->method('isObjectNew') + ->willReturn(true); + + $this->abstractModelMock->expects($this->any()) + ->method('isObjectNew') + ->willReturn(true); + $categoryCollection = $this->getMockBuilder(CategoryCollection::class) + ->disableOriginalConstructor() + ->setMethods(['getIterator']) + ->getMock(); + $categoryCollection->expects($this->any()) + ->method('getIterator') + ->willReturn(new \ArrayIterator([])); + $this->categoryMock->expects($this->never()) + ->method('getCategories'); + $this->categoryFactoryMock->expects($this->never())->method('create'); + $this->productFactoryMock->expects($this->never())->method('create'); + $this->productMock->expects($this->never())->method('getCollection'); + $this->productCollectionMock->expects($this->never())->method('addCategoryIds'); + $this->productCollectionMock->expects($this->never())->method('addAttributeToSelect'); + $this->productCollectionMock->expects($this->never())->method('addStoreFilter'); + + $this->productCollectionMock->expects($this->never())->method('getIterator'); + $this->productUrlRewriteGeneratorMock->expects($this->never())->method('generate'); + + $this->assertSame( + $this->subjectMock, + $this->plugin->afterSave($this->subjectMock, $this->subjectMock) ); } diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Storage/DynamicStorageTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Storage/DynamicStorageTest.php new file mode 100644 index 000000000000..4389498a3297 --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Storage/DynamicStorageTest.php @@ -0,0 +1,327 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogUrlRewrite\Test\Unit\Model\Storage; + +use Magento\Catalog\Model\ResourceModel\Product; +use Magento\Catalog\Model\ResourceModel\ProductFactory; +use Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator; +use Magento\CatalogUrlRewrite\Model\Storage\DynamicStorage; +use Magento\Framework\Api\DataObjectHelper; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Adapter\AdapterInterface; +use Magento\Framework\DB\Select; +use Magento\UrlRewrite\Model\OptionProvider; +use Magento\Store\Model\ScopeInterface; +use Magento\UrlRewrite\Service\V1\Data\UrlRewriteFactory; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; +use ReflectionMethod; + +class DynamicStorageTest extends TestCase +{ + /** + * @var DynamicStorage + */ + private $object; + + /** + * @var UrlRewriteFactory|MockObject + */ + private $urlRewriteFactoryMock; + + /** + * @var DataObjectHelper|MockObject + */ + private $dataObjectHelperMock; + + /** + * @var AdapterInterface|MockObject + */ + private $connectionMock; + + /** + * @var Select|MockObject + */ + private $selectMock; + + /** + * @var ResourceConnection|MockObject + */ + private $resourceConnectionMock; + + /** + * @var ScopeConfigInterface|MockObject + */ + private $scopeConfigMock; + + /** + * @var Product|MockObject + */ + private $productResourceMock; + + /** + * @var ProductFactory|MockObject + */ + private $productFactoryMock; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $this->urlRewriteFactoryMock = $this->getMockBuilder(UrlRewriteFactory::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->dataObjectHelperMock = $this->getMockBuilder(DataObjectHelper::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->connectionMock = $this->getMockBuilder(AdapterInterface::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->selectMock = $this->getMockBuilder(Select::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->resourceConnectionMock = $this->getMockBuilder(ResourceConnection::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->connectionMock + ->method('select') + ->willReturn($this->selectMock); + + $this->resourceConnectionMock + ->method('getConnection') + ->willReturn($this->connectionMock); + + $this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class) + ->getMock(); + + $this->productResourceMock = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->productFactoryMock = $this->getMockBuilder(ProductFactory::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->productFactoryMock + ->method('create') + ->willReturn($this->productResourceMock); + + $this->object = new DynamicStorage( + $this->urlRewriteFactoryMock, + $this->dataObjectHelperMock, + $this->resourceConnectionMock, + $this->scopeConfigMock, + $this->productFactoryMock + ); + } + + /** + * @dataProvider findProductRewriteByRequestPathDataProvider + * @param array $data + * @param array|false $productFromDb + * @param string $categorySuffix + * @param array|false $categoryFromDb + * @param bool $canBeShownInCategory + * @param array|null $expectedProductRewrite + * @throws \ReflectionException + */ + public function testFindProductRewriteByRequestPath( + array $data, + $productFromDb, + string $categorySuffix, + $categoryFromDb, + bool $canBeShownInCategory, + ?array $expectedProductRewrite + ): void { + $this->connectionMock->expects($this->any()) + ->method('fetchRow') + ->will($this->onConsecutiveCalls($productFromDb, $categoryFromDb)); + + $scopeConfigMap = [ + [ + CategoryUrlPathGenerator::XML_PATH_CATEGORY_URL_SUFFIX, + ScopeInterface::SCOPE_STORE, + $data['store_id'], + $categorySuffix + ] + ]; + + $this->scopeConfigMock + ->method('getValue') + ->willReturnMap($scopeConfigMap); + + $this->productResourceMock + ->method('canBeShowInCategory') + ->willReturn($canBeShownInCategory); + + $method = new ReflectionMethod($this->object, 'findProductRewriteByRequestPath'); + $method->setAccessible(true); + + $this->assertSame($expectedProductRewrite, $method->invoke($this->object, $data)); + } + + /** + * @return array + */ + public function findProductRewriteByRequestPathDataProvider(): array + { + return [ + [ + // Non-existing product + [ + 'request_path' => 'test.html', + 'store_id' => 1 + ], + false, + '', + null, + true, + null + ], + [ + // Non-existing category + [ + 'request_path' => 'a/test.html', + 'store_id' => 1 + ], + [ + 'entity_type' => 'product', + 'entity_id' => '1', + 'request_path' => 'test.html', + 'target_path' => 'catalog/product/view/id/1', + 'redirect_type' => '0', + ], + '.html', + false, + true, + null + ], + [ + // Existing category + [ + 'request_path' => 'shop/test.html', + 'store_id' => 1 + ], + [ + 'entity_type' => 'product', + 'entity_id' => '1', + 'request_path' => 'test.html', + 'target_path' => 'catalog/product/view/id/1', + 'redirect_type' => '0', + ], + '.html', + [ + 'entity_type' => 'category', + 'entity_id' => '3', + 'request_path' => 'shop.html', + 'target_path' => 'catalog/category/view/id/3', + 'redirect_type' => '0', + ], + true, + [ + 'entity_type' => 'product', + 'entity_id' => '1', + 'request_path' => 'shop/test.html', + 'target_path' => 'catalog/product/view/id/1/category/3', + 'redirect_type' => '0', + ] + ], + [ + // Existing category, but can't be shown in category + [ + 'request_path' => 'shop/test.html', + 'store_id' => 1 + ], + [ + 'entity_type' => 'product', + 'entity_id' => '1', + 'request_path' => 'test.html', + 'target_path' => 'catalog/product/view/id/1', + 'redirect_type' => '0', + ], + '.html', + [ + 'entity_type' => 'category', + 'entity_id' => '3', + 'request_path' => 'shop.html', + 'target_path' => 'catalog/category/view/id/3', + 'redirect_type' => '0', + ], + false, + null + ], + [ + // Existing category, with product 301 redirect type + [ + 'request_path' => 'shop/test.html', + 'store_id' => 1 + ], + [ + 'entity_type' => 'product', + 'entity_id' => '1', + 'request_path' => 'test.html', + 'target_path' => 'test-new.html', + 'redirect_type' => OptionProvider::PERMANENT, + ], + '.html', + [ + 'entity_type' => 'category', + 'entity_id' => '3', + 'request_path' => 'shop.html', + 'target_path' => 'catalog/category/view/id/3', + 'redirect_type' => '0', + ], + true, + [ + 'entity_type' => 'product', + 'entity_id' => '1', + 'request_path' => 'shop/test.html', + 'target_path' => 'shop/test-new.html', + 'redirect_type' => OptionProvider::PERMANENT, + ] + ], + [ + // Existing category, with category 301 redirect type + [ + 'request_path' => 'shop/test.html', + 'store_id' => 1 + ], + [ + 'entity_type' => 'product', + 'entity_id' => '1', + 'request_path' => 'test.html', + 'target_path' => 'catalog/product/view/id/1', + 'redirect_type' => '0', + ], + '.html', + [ + 'entity_type' => 'category', + 'entity_id' => '3', + 'request_path' => 'shop.html', + 'target_path' => 'shop-new.html', + 'redirect_type' => OptionProvider::PERMANENT, + ], + true, + [ + 'entity_type' => 'product', + 'entity_id' => '1', + 'request_path' => 'shop/test.html', + 'target_path' => 'shop-new/test.html', + 'redirect_type' => OptionProvider::PERMANENT, + ] + ], + ]; + } +} diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryUrlPathAutogeneratorObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryUrlPathAutogeneratorObserverTest.php index f491f63700a4..367336c09f86 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryUrlPathAutogeneratorObserverTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryUrlPathAutogeneratorObserverTest.php @@ -7,9 +7,11 @@ namespace Magento\CatalogUrlRewrite\Test\Unit\Observer; -use Magento\Catalog\Model\ResourceModel\Category; +use Magento\Catalog\Model\Category; +use Magento\Catalog\Model\ResourceModel\Category as CategoryResource; use Magento\CatalogUrlRewrite\Model\Category\ChildrenCategoriesProvider; use Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator; +use Magento\CatalogUrlRewrite\Model\ResourceModel\Category\GetDefaultUrlKey; use Magento\CatalogUrlRewrite\Observer\CategoryUrlPathAutogeneratorObserver; use Magento\CatalogUrlRewrite\Service\V1\StoreViewService; use Magento\Framework\Event\Observer; @@ -18,7 +20,11 @@ use Magento\Store\Model\Store; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Magento\Backend\Model\Validator\UrlKey\CompositeUrlKey; +/** + * Unit tests for \Magento\CatalogUrlRewrite\Observer\CategoryUrlPathAutogeneratorObserver class. + */ class CategoryUrlPathAutogeneratorObserverTest extends TestCase { /** @@ -52,10 +58,20 @@ class CategoryUrlPathAutogeneratorObserverTest extends TestCase private $storeViewService; /** - * @var Category|MockObject + * @var CategoryResource|MockObject */ private $categoryResource; + /** + * @var CompositeUrlKey|MockObject + */ + private $compositeUrlValidator; + + /** + * @var GetDefaultUrlKey|MockObject + */ + private $getDefaultUrlKey; + /** * @inheritDoc */ @@ -66,34 +82,44 @@ protected function setUp(): void ->onlyMethods(['getEvent']) ->disableOriginalConstructor() ->getMock(); - $this->categoryResource = $this->createMock(Category::class); + $this->categoryResource = $this->createMock(CategoryResource::class); $this->category = $this->createPartialMock( - \Magento\Catalog\Model\Category::class, + Category::class, [ 'dataHasChangedFor', 'getResource', 'getStoreId', - 'formatUrlKey' + 'formatUrlKey', + 'getId', + 'hasChildren', ] ); $this->category->expects($this->any())->method('getResource')->willReturn($this->categoryResource); $this->observer->expects($this->any())->method('getEvent')->willReturnSelf(); $this->observer->expects($this->any())->method('getCategory')->willReturn($this->category); - $this->categoryUrlPathGenerator = $this->createMock( - CategoryUrlPathGenerator::class - ); - $this->childrenCategoriesProvider = $this->createMock( - ChildrenCategoriesProvider::class - ); + $this->categoryUrlPathGenerator = $this->createMock(CategoryUrlPathGenerator::class); + $this->childrenCategoriesProvider = $this->createMock(ChildrenCategoriesProvider::class); $this->storeViewService = $this->createMock(StoreViewService::class); + $this->compositeUrlValidator = $this->getMockBuilder(CompositeUrlKey::class) + ->disableOriginalConstructor() + ->onlyMethods(['validate']) + ->getMock(); + + $this->getDefaultUrlKey = $this->getMockBuilder(GetDefaultUrlKey::class) + ->disableOriginalConstructor() + ->onlyMethods(['execute']) + ->getMock(); + $this->categoryUrlPathAutogeneratorObserver = (new ObjectManagerHelper($this))->getObject( CategoryUrlPathAutogeneratorObserver::class, [ 'categoryUrlPathGenerator' => $this->categoryUrlPathGenerator, 'childrenCategoriesProvider' => $this->childrenCategoriesProvider, 'storeViewService' => $this->storeViewService, + 'compositeUrlValidator' => $this->compositeUrlValidator, + 'getDefaultUrlKey' => $this->getDefaultUrlKey, ] ); } @@ -114,6 +140,7 @@ public function testShouldFormatUrlKeyAndGenerateUrlPathIfUrlKeyIsNotUsingDefaul $this->categoryUrlPathGenerator->expects($this->once())->method('getUrlPath')->willReturn($expectedUrlPath); $this->assertEquals($categoryData['url_key'], $this->category->getUrlKey()); $this->assertEquals($categoryData['url_path'], $this->category->getUrlPath()); + $this->compositeUrlValidator->expects($this->once())->method('validate')->with('formatted_url_key')->willReturn([]); $this->categoryUrlPathAutogeneratorObserver->execute($this->observer); $this->assertEquals($expectedUrlKey, $this->category->getUrlKey()); $this->assertEquals($expectedUrlPath, $this->category->getUrlPath()); @@ -132,16 +159,26 @@ public function shouldFormatUrlKeyAndGenerateUrlPathIfUrlKeyIsNotUsingDefaultVal } /** - * @param $isObjectNew + * @param bool $isObjectNew + * @param int $storeId + * @return void * @throws LocalizedException * @dataProvider shouldResetUrlPathAndUrlKeyIfUrlKeyIsUsingDefaultValueDataProvider */ - public function testShouldResetUrlPathAndUrlKeyIfUrlKeyIsUsingDefaultValue($isObjectNew) + public function testShouldResetUrlPathAndUrlKeyIfUrlKeyIsUsingDefaultValue(bool $isObjectNew, int $storeId): void { - $categoryData = ['use_default' => ['url_key' => 1], 'url_key' => 'some_key', 'url_path' => 'some_path']; + $categoryData = [ + 'use_default' => ['url_key' => 1], + 'url_key' => 'some_key', + 'url_path' => 'some_path', + ]; $this->category->setData($categoryData); $this->category->isObjectNew($isObjectNew); $this->category->expects($this->any())->method('formatUrlKey')->willReturn('formatted_key'); + $this->category->expects($this->any())->method('getStoreId')->willReturn($storeId); + $this->category->expects($this->once()) + ->method('hasChildren') + ->willReturn(false); $this->assertEquals($categoryData['url_key'], $this->category->getUrlKey()); $this->assertEquals($categoryData['url_path'], $this->category->getUrlPath()); $this->categoryUrlPathAutogeneratorObserver->execute($this->observer); @@ -152,14 +189,83 @@ public function testShouldResetUrlPathAndUrlKeyIfUrlKeyIsUsingDefaultValue($isOb /** * @return array */ - public function shouldResetUrlPathAndUrlKeyIfUrlKeyIsUsingDefaultValueDataProvider() + public function shouldResetUrlPathAndUrlKeyIfUrlKeyIsUsingDefaultValueDataProvider(): array { return [ - [true], - [false], + [false, 0], + [false, 1], + [true, 1], + [true, 0], ]; } + /** + * @return void + */ + public function testShouldUpdateUrlPathForChildrenIfUrlKeyIsUsingDefaultValueForSpecificStore(): void + { + $storeId = 1; + $categoryId = 1; + $categoryData = [ + 'use_default' => ['url_key' => 1], + 'url_key' => null, + 'url_path' => 'some_path', + ]; + + $this->category->setData($categoryData); + $this->category->isObjectNew(false); + $this->category->expects($this->any()) + ->method('getStoreId') + ->willReturn($storeId); + $this->category->expects($this->once()) + ->method('hasChildren') + ->willReturn(true); + $this->category->expects($this->exactly(2)) + ->method('getId') + ->willReturn($categoryId); + $this->getDefaultUrlKey->expects($this->once()) + ->method('execute') + ->with($categoryId) + ->willReturn('default_url_key'); + $this->category->expects($this->once()) + ->method('dataHasChangedFor') + ->with('url_path') + ->willReturn(true); + + $childCategory = $this->getMockBuilder(Category::class) + ->onlyMethods( + [ + 'getResource', + 'getStore', + 'getStoreId', + 'setStoreId', + ] + ) + ->addMethods( + [ + 'getUrlPath', + 'setUrlPath', + ] + ) + ->disableOriginalConstructor() + ->getMock(); + $childCategory->expects($this->any()) + ->method('getResource') + ->willReturn($this->categoryResource); + $childCategory->expects($this->once()) + ->method('setStoreId') + ->with($storeId) + ->willReturnSelf(); + + $this->childrenCategoriesProvider->expects($this->once()) + ->method('getChildren') + ->willReturn([$childCategory]); + + $this->categoryUrlPathAutogeneratorObserver->execute($this->observer); + $this->assertNull($this->category->getUrlKey()); + $this->assertNull($this->category->getUrlPath()); + } + /** * @param $useDefaultUrlKey * @param $isObjectNew @@ -206,6 +312,7 @@ public function testUrlPathAttributeUpdating() $this->categoryUrlPathGenerator->expects($this->any())->method('getUrlPath')->willReturn($expectedUrlPath); $this->categoryResource->expects($this->once())->method('saveAttribute')->with($this->category, 'url_path'); $this->category->expects($this->once())->method('dataHasChangedFor')->with('url_path')->willReturn(false); + $this->compositeUrlValidator->expects($this->once())->method('validate')->with('formatted_url_key')->willReturn([]); $this->categoryUrlPathAutogeneratorObserver->execute($this->observer); } @@ -222,6 +329,7 @@ public function testChildrenUrlPathAttributeNoUpdatingIfParentUrlPathIsNotChange // break code execution $this->category->expects($this->once())->method('dataHasChangedFor')->with('url_path')->willReturn(false); + $this->compositeUrlValidator->expects($this->once())->method('validate')->with('url_key')->willReturn([]); $this->categoryUrlPathAutogeneratorObserver->execute($this->observer); } @@ -238,10 +346,10 @@ public function testChildrenUrlPathAttributeUpdatingForSpecificStore() // only for specific store $this->category->expects($this->atLeastOnce())->method('getStoreId')->willReturn(1); - $childCategoryResource = $this->getMockBuilder(Category::class) + $childCategoryResource = $this->getMockBuilder(CategoryResource::class) ->disableOriginalConstructor() ->getMock(); - $childCategory = $this->getMockBuilder(\Magento\Catalog\Model\Category::class) + $childCategory = $this->getMockBuilder(Category::class) ->setMethods( [ 'getUrlPath', @@ -260,6 +368,7 @@ public function testChildrenUrlPathAttributeUpdatingForSpecificStore() $this->childrenCategoriesProvider->expects($this->once())->method('getChildren')->willReturn([$childCategory]); $childCategory->expects($this->once())->method('setUrlPath')->with('generated_url_path')->willReturnSelf(); $childCategoryResource->expects($this->once())->method('saveAttribute')->with($childCategory, 'url_path'); + $this->compositeUrlValidator->expects($this->once())->method('validate')->with('generated_url_key')->willReturn([]); $this->categoryUrlPathAutogeneratorObserver->execute($this->observer); } diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductUrlKeyAutogeneratorObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductUrlKeyAutogeneratorObserverTest.php index 51b6a3dd9668..8e0b4eee1a65 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductUrlKeyAutogeneratorObserverTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductUrlKeyAutogeneratorObserverTest.php @@ -15,6 +15,7 @@ use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Magento\Backend\Model\Validator\UrlKey\CompositeUrlKey; /** * Unit tests for \Magento\CatalogUrlRewrite\Observer\ProductUrlKeyAutogeneratorObserver class @@ -29,6 +30,11 @@ class ProductUrlKeyAutogeneratorObserverTest extends TestCase /** @var ProductUrlKeyAutogeneratorObserver */ private $productUrlKeyAutogeneratorObserver; + /** + * @var CompositeUrlKey|MockObject + */ + private $compositeUrlValidator; + /** * @inheritdoc */ @@ -39,10 +45,16 @@ protected function setUp(): void ->setMethods(['getUrlKey']) ->getMock(); + $this->compositeUrlValidator = $this->getMockBuilder(CompositeUrlKey::class) + ->disableOriginalConstructor() + ->setMethods(['validate']) + ->getMock(); + $this->productUrlKeyAutogeneratorObserver = (new ObjectManagerHelper($this))->getObject( ProductUrlKeyAutogeneratorObserver::class, [ - 'productUrlPathGenerator' => $this->productUrlPathGenerator + 'productUrlPathGenerator' => $this->productUrlPathGenerator, + 'compositeUrlValidator' => $this->compositeUrlValidator ] ); } @@ -73,6 +85,8 @@ public function testExecuteWithUrlKey(): void $this->productUrlPathGenerator->expects($this->atLeastOnce())->method('getUrlKey')->with($product) ->willReturn($urlKey); + $this->compositeUrlValidator->expects($this->once())->method('validate')->with($urlKey)->willReturn([]); + $this->productUrlKeyAutogeneratorObserver->execute($observer); } diff --git a/app/code/Magento/CatalogUrlRewrite/etc/db_schema.xml b/app/code/Magento/CatalogUrlRewrite/etc/db_schema.xml index aaf86e7d4418..5bbefc644543 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/db_schema.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/db_schema.xml @@ -15,6 +15,9 @@ comment="category_id"/> <column xsi:type="int" name="product_id" unsigned="true" nullable="false" identity="false" comment="product_id"/> + <constraint xsi:type="primary" referenceId="PRIMARY"> + <column name="url_rewrite_id"/> + </constraint> <constraint xsi:type="foreign" referenceId="CAT_URL_REWRITE_PRD_CTGR_PRD_ID_CAT_PRD_ENTT_ENTT_ID" table="catalog_url_rewrite_product_category" column="product_id" referenceTable="catalog_product_entity" referenceColumn="entity_id" onDelete="CASCADE"/> diff --git a/app/code/Magento/CatalogUrlRewrite/etc/db_schema_whitelist.json b/app/code/Magento/CatalogUrlRewrite/etc/db_schema_whitelist.json index 5562ae5d48cc..ce7cb7b9bb64 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/db_schema_whitelist.json +++ b/app/code/Magento/CatalogUrlRewrite/etc/db_schema_whitelist.json @@ -9,6 +9,7 @@ "CATALOG_URL_REWRITE_PRODUCT_CATEGORY_CATEGORY_ID_PRODUCT_ID": true }, "constraint": { + "PRIMARY": true, "CAT_URL_REWRITE_PRD_CTGR_PRD_ID_CAT_PRD_ENTT_ENTT_ID": true, "FK_BB79E64705D7F17FE181F23144528FC8": true, "CAT_URL_REWRITE_PRD_CTGR_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID": true, @@ -16,4 +17,4 @@ "CAT_URL_REWRITE_PRD_CTGR_PRD_ID_SEQUENCE_PRD_SEQUENCE_VAL": true } } -} \ No newline at end of file +} diff --git a/app/code/Magento/CatalogUrlRewrite/etc/di.xml b/app/code/Magento/CatalogUrlRewrite/etc/di.xml index 533693692cd5..5c25d11986eb 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/di.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/di.xml @@ -48,17 +48,6 @@ </argument> </arguments> </type> - <type name="Magento\CatalogUrlRewrite\Observer\CategoryUrlPathAutogeneratorObserver"> - <arguments> - <argument name="invalidValues" xsi:type="array"> - <item name="0" xsi:type="string">admin</item> - <item name="1" xsi:type="string">soap</item> - <item name="2" xsi:type="string">rest</item> - <item name="3" xsi:type="string">graphql</item> - <item name="4" xsi:type="string">standard</item> - </argument> - </arguments> - </type> <type name="Magento\UrlRewrite\Model\UrlRewrite"> <arguments> <argument name="entityToCacheTagMap" xsi:type="array"> diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/CatalogTreeDataProvider.php b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/CatalogTreeDataProvider.php new file mode 100644 index 000000000000..c4f7066340dc --- /dev/null +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/CatalogTreeDataProvider.php @@ -0,0 +1,74 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogUrlRewriteGraphQl\Model\DataProvider\UrlRewrite; + +use Magento\Catalog\Model\CategoryRepository; +use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\CategoryTree as CategoryTreeDataProvider; +use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\ExtractDataFromCategoryTree; +use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\UrlRewriteGraphQl\Model\DataProvider\EntityDataProviderInterface; + +class CatalogTreeDataProvider implements EntityDataProviderInterface +{ + /** + * @var ExtractDataFromCategoryTree + */ + private $extractDataFromCategoryTree; + + /** + * @var CategoryTreeDataProvider + */ + private $categoryTree; + + /** + * @var CategoryRepository + */ + private $categoryRepository; + + /** + * @param CategoryTreeDataProvider $categoryTree + * @param ExtractDataFromCategoryTree $extractDataFromCategoryTree + * @param CategoryRepository $categoryRepository + */ + public function __construct( + CategoryTreeDataProvider $categoryTree, + ExtractDataFromCategoryTree $extractDataFromCategoryTree, + CategoryRepository $categoryRepository + ) { + $this->categoryTree = $categoryTree; + $this->extractDataFromCategoryTree = $extractDataFromCategoryTree; + $this->categoryRepository = $categoryRepository; + } + + /** + * Get catalog tree data + * + * @param string $entity_type + * @param int $id + * @param ResolveInfo|null $info + * @param int|null $storeId + * @return array + * @throws GraphQlNoSuchEntityException + */ + public function getData( + string $entity_type, + int $id, + ResolveInfo $info = null, + int $storeId = null + ): array { + $categoryId = (int)$id; + $categoriesTree = $this->categoryTree->getTree($info, $categoryId, $storeId); + if (empty($categoriesTree) || ($categoriesTree->count() == 0)) { + throw new GraphQlNoSuchEntityException(__('Category doesn\'t exist')); + } + $result = current($this->extractDataFromCategoryTree->execute($categoriesTree)); + $result['type_id'] = $entity_type; + return $result; + } +} diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/ProductDataProvider.php b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/ProductDataProvider.php new file mode 100644 index 000000000000..a88c31e13722 --- /dev/null +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/ProductDataProvider.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogUrlRewriteGraphQl\Model\DataProvider\UrlRewrite; + +use Magento\Catalog\Model\ProductRepository; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\UrlRewriteGraphQl\Model\DataProvider\EntityDataProviderInterface; + +class ProductDataProvider implements EntityDataProviderInterface +{ + /** + * @var ProductRepository + */ + private $productRepository; + + /** + * @param ProductRepository $productRepository + */ + public function __construct( + ProductRepository $productRepository + ) { + $this->productRepository = $productRepository; + } + + /** + * Get catalog tree data + * + * @param string $entity_type + * @param int $id + * @param ResolveInfo|null $info + * @param int|null $storeId + * @return array + * @throws NoSuchEntityException + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function getData( + string $entity_type, + int $id, + ResolveInfo $info = null, + int $storeId = null + ): array { + $product = $this->productRepository->getById($id, false, $storeId); + $result = $product->getData(); + $result['model'] = $product; + return $result; + } +} diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/composer.json b/app/code/Magento/CatalogUrlRewriteGraphQl/composer.json index 3b64d51b8556..3119eb6667b0 100644 --- a/app/code/Magento/CatalogUrlRewriteGraphQl/composer.json +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/composer.json @@ -6,6 +6,8 @@ "php": "~7.3.0||~7.4.0", "magento/module-store": "*", "magento/module-catalog": "*", + "magento/module-catalog-graph-ql": "*", + "magento/module-url-rewrite-graph-ql": "*", "magento/framework": "*" }, "suggest": { diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml b/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml index 8724972e71b1..cb7362717fff 100644 --- a/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml @@ -30,4 +30,13 @@ </argument> </arguments> </type> + + <type name="Magento\UrlRewriteGraphQl\Model\DataProvider\EntityDataProviderComposite"> + <arguments> + <argument name="dataProviders" xsi:type="array"> + <item name="category" xsi:type="object">Magento\CatalogUrlRewriteGraphQl\Model\DataProvider\UrlRewrite\CatalogTreeDataProvider</item> + <item name="product" xsi:type="object">Magento\CatalogUrlRewriteGraphQl\Model\DataProvider\UrlRewrite\ProductDataProvider</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/etc/graphql/di.xml b/app/code/Magento/CatalogUrlRewriteGraphQl/etc/graphql/di.xml new file mode 100755 index 000000000000..2e3e4a2aec0d --- /dev/null +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/etc/graphql/di.xml @@ -0,0 +1,17 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> + <type name="Magento\UrlRewriteGraphQl\Model\RoutableInterfaceTypeResolver"> + <arguments> + <argument name="productTypeNameResolvers" xsi:type="array"> + <item name="category_type_resolver" xsi:type="object">Magento\CatalogGraphQl\Model\CategoryTypeResolver</item> + <item name="catalog_type_resolver" xsi:type="object">Magento\CatalogGraphQl\Model\CatalogProductTypeResolver</item> + </argument> + </arguments> + </type> +</config> diff --git a/app/code/Magento/CatalogWidget/Model/Rule/Condition/Product.php b/app/code/Magento/CatalogWidget/Model/Rule/Condition/Product.php index f9340a495de6..e4bb0a8a66b0 100644 --- a/app/code/Magento/CatalogWidget/Model/Rule/Condition/Product.php +++ b/app/code/Magento/CatalogWidget/Model/Rule/Condition/Product.php @@ -149,6 +149,8 @@ public function addToCollection($collection) $attributes[$attributeCode] = true; $this->getRule()->setCollectedAttributes($attributes); } + } else { + $this->joinedAttributes['price'] ='price_index.min_price'; } return $this; @@ -244,8 +246,6 @@ public function getMappedSqlField() $result = parent::getMappedSqlField(); } elseif (isset($this->joinedAttributes[$this->getAttribute()])) { $result = $this->joinedAttributes[$this->getAttribute()]; - } elseif ($this->getAttribute() === 'price') { - $result = 'price_index.min_price'; } elseif ($this->getAttributeObject()->isStatic()) { $result = $this->getAttributeObject()->getAttributeCode(); } elseif ($this->getValueParsed()) { diff --git a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListCheckWidgetOrderTest.xml b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListCheckWidgetOrderTest.xml index 1d5e369d50e1..062c4c398e18 100644 --- a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListCheckWidgetOrderTest.xml +++ b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListCheckWidgetOrderTest.xml @@ -70,7 +70,7 @@ <click selector="{{WidgetSection.Chooser}}" stepKey="clickChooser" /> <waitForElementVisible selector="{{WidgetSection.PreCreateCategory('$simplecategory.name$')}}" stepKey="waitForCategoryVisible" /> <click selector="{{WidgetSection.PreCreateCategory('$simplecategory.name$')}}" stepKey="selectCategory" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> <!--Save cms page and go to Storefront--> <actionGroup ref="SaveCmsPageActionGroup" stepKey="saveCmsPage"/> <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront1"> diff --git a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml index c40071f4ef26..6019c00560bf 100644 --- a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml +++ b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml @@ -75,7 +75,7 @@ <actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="seeSuccessMessage"/> <!--Go to Storefront > category--> - <amOnPage url="$$simplecategory.name$$.html" stepKey="goToStorefrontCategoryPage"/> + <amOnPage url="$$simplecategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage"/> <waitForPageLoad stepKey="waitForStorefrontPageLoaded"/> <!--Check operators Greater than--> @@ -95,7 +95,7 @@ </actionGroup> <!--Go to Storefront > category--> - <amOnPage url="$$simplecategory.name$$.html" stepKey="goToStorefrontCategoryPage2"/> + <amOnPage url="$$simplecategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage2"/> <waitForPageLoad stepKey="waitForStorefrontPageLoaded2"/> <!--Check operators Greater than--> @@ -115,7 +115,7 @@ </actionGroup> <!--Go to Storefront > category--> - <amOnPage url="$$simplecategory.name$$.html" stepKey="goToStorefrontCategoryPage3"/> + <amOnPage url="$$simplecategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage3"/> <waitForPageLoad stepKey="waitForStorefrontPageLoaded3"/> <!--Check operators Greater than--> @@ -135,7 +135,7 @@ </actionGroup> <!--Go to Storefront > category--> - <amOnPage url="$$simplecategory.name$$.html" stepKey="goToStorefrontCategoryPage4"/> + <amOnPage url="$$simplecategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage4"/> <waitForPageLoad stepKey="waitForStorefrontPageLoaded4"/> <!--Check operators Greater than--> diff --git a/app/code/Magento/CatalogWidget/Test/Unit/Model/Rule/Condition/ProductTest.php b/app/code/Magento/CatalogWidget/Test/Unit/Model/Rule/Condition/ProductTest.php index 415c9bd81174..600190d3899d 100644 --- a/app/code/Magento/CatalogWidget/Test/Unit/Model/Rule/Condition/ProductTest.php +++ b/app/code/Magento/CatalogWidget/Test/Unit/Model/Rule/Condition/ProductTest.php @@ -11,6 +11,7 @@ use Magento\Catalog\Model\ResourceModel\Eav\Attribute; use Magento\Catalog\Model\ResourceModel\Product; use Magento\Catalog\Model\ResourceModel\Product\Collection; +use Magento\Catalog\Model\ResourceModel\Product\Collection\ProductLimitation; use Magento\CatalogWidget\Model\Rule\Condition\Product as ProductWidget; use Magento\Eav\Model\Config; use Magento\Eav\Model\Entity\AbstractEntity; @@ -57,9 +58,13 @@ protected function setUp(): void $storeManager = $this->getMockForAbstractClass(StoreManagerInterface::class); $storeMock = $this->getMockForAbstractClass(StoreInterface::class); $storeManager->expects($this->any())->method('getStore')->willReturn($storeMock); + $storeMock->method('getId') + ->willReturn(1); $this->productResource = $this->createMock(Product::class); $this->productResource->expects($this->once())->method('loadAllAttributes')->willReturnSelf(); $this->productResource->expects($this->once())->method('getAttributesByCode')->willReturn([]); + $connection = $this->getMockForAbstractClass(AdapterInterface::class); + $this->productResource->method('getConnection')->willReturn($connection); $productCategoryList = $this->getMockBuilder(ProductCategoryList::class) ->disableOriginalConstructor() ->getMock(); @@ -100,9 +105,6 @@ public function testAddToCollection() $entityMock = $this->createMock(AbstractEntity::class); $entityMock->expects($this->once())->method('getLinkField')->willReturn('entitiy_id'); $this->attributeMock->expects($this->once())->method('getEntity')->willReturn($entityMock); - $connection = $this->getMockForAbstractClass(AdapterInterface::class); - - $this->productResource->expects($this->atLeastOnce())->method('getConnection')->willReturn($connection); $this->model->addToCollection($collectionMock); } @@ -119,4 +121,116 @@ public function testGetMappedSqlFieldSku() $this->model->setAttribute('attribute_set_id'); $this->assertEquals('e.attribute_set_id', $this->model->getMappedSqlField()); } + + /** + * Test getMappedSqlField method for price attribute. + * + * @dataProvider getMappedSqlFieldPriceDataProvider + * @param bool $isScopeGlobal + * @param bool $isUsingPriceIndex + * @param string $expectedMappedField + */ + public function testGetMappedSqlFieldPrice( + bool $isScopeGlobal, + bool $isUsingPriceIndex, + string $expectedMappedField + ): void { + $productLimitation = new ProductLimitation(); + $productLimitation['use_price_index'] = $isUsingPriceIndex; + $collectionMock = $this->mockCollection( + [ + 'getLimitationFilters' => $productLimitation, + 'getAllAttributeValues' => [ + 1 => [ + 0 => 10, + 1 => 11 + ] + ] + ] + ); + $this->mockAttribute( + [ + 'getAttributeCode' => 'price', + 'isScopeGlobal' => $isScopeGlobal, + 'getBackendType' => 'decimal' + ] + ); + $this->model->setAttribute('price'); + $this->model->setValue(10); + $this->model->setOperator('>='); + $this->model->collectValidatedAttributes($collectionMock); + $this->assertEquals($expectedMappedField, $this->model->getMappedSqlField()); + } + + /** + * @return array + */ + public function getMappedSqlFieldPriceDataProvider(): array + { + return [ + [ + true, + true, + 'price_index.min_price' + ], + [ + true, + false, + 'at_price.value' + ], + [ + false, + true, + 'price_index.min_price' + ], + [ + false, + false, + 'e.entity_id' + ], + ]; + } + + /** + * @param array $configuration + */ + private function mockAttribute(array $configuration = []): void + { + $defaultConfiguration = [ + 'getAttributeCode' => 'code', + 'isStatic' => false, + 'getBackend' => true, + 'isScopeGlobal' => true, + 'getBackendType' => 'int', + ]; + $configuration = array_merge($defaultConfiguration, $configuration); + $this->attributeMock->method('getAttributeCode') + ->willReturn($configuration['getAttributeCode']); + $this->attributeMock->method('isStatic') + ->willReturn($configuration['isStatic']); + $this->attributeMock->method('getBackend') + ->willReturn($configuration['getBackend']); + $this->attributeMock->method('isScopeGlobal') + ->willReturn($configuration['isScopeGlobal']); + $this->attributeMock->method('getBackendType') + ->willReturn($configuration['getBackendType']); + $entityMock = $this->createMock(AbstractEntity::class); + $entityMock->method('getLinkField') + ->willReturn('entitiy_id'); + $this->attributeMock->method('getEntity') + ->willReturn($entityMock); + } + + /** + * @param array $configuration + * @return Collection + */ + private function mockCollection(array $configuration = []): Collection + { + $collectionMock = $this->createConfiguredMock(Collection::class, $configuration); + $selectMock = $this->createMock(Select::class); + $collectionMock->method('getSelect') + ->willReturn($selectMock); + return $collectionMock; + } } diff --git a/app/code/Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml b/app/code/Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml index 881d8b28dfae..000f3ffd3693 100644 --- a/app/code/Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml +++ b/app/code/Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml @@ -3,11 +3,15 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + use Magento\Framework\App\Action\Action; /** @var \Magento\CatalogWidget\Block\Product\ProductsList $block */ + +// phpcs:disable Generic.Files.LineLength.TooLong +// phpcs:disable Magento2.Templates.ThisInTemplate.FoundHelper ?> -<?php if ($exist = ($block->getProductCollection() && $block->getProductCollection()->getSize())) : ?> +<?php if ($exist = ($block->getProductCollection() && $block->getProductCollection()->getSize())): ?> <?php $type = 'widget-product-grid'; @@ -23,7 +27,7 @@ use Magento\Framework\App\Action\Action; $description = false; ?> <div class="block widget block-products-list <?= /* @noEscape */ $mode ?>"> - <?php if ($block->getTitle()) : ?> + <?php if ($block->getTitle()): ?> <div class="block-title"> <strong><?= $block->escapeHtml(__($block->getTitle())) ?></strong> </div> @@ -33,7 +37,7 @@ use Magento\Framework\App\Action\Action; <div class="products-<?= /* @noEscape */ $mode ?> <?= /* @noEscape */ $mode ?>"> <ol class="product-items <?= /* @noEscape */ $type ?>"> <?php $iterator = 1; ?> - <?php foreach ($items as $_item) : ?> + <?php foreach ($items as $_item): ?> <?= /* @noEscape */ ($iterator++ == 1) ? '<li class="product-item">' : '</li><li class="product-item">' ?> <div class="product-item-info"> <a href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>" class="product-item-photo"> @@ -47,7 +51,7 @@ use Magento\Framework\App\Action\Action; <?= $block->escapeHtml($_item->getName()) ?> </a> </strong> - <?php if ($templateType) : ?> + <?php if ($templateType): ?> <?= $block->getReviewsSummaryHtml($_item, $templateType) ?> <?php endif; ?> @@ -55,12 +59,12 @@ use Magento\Framework\App\Action\Action; <?= $block->getProductDetailsHtml($_item) ?> - <?php if ($showWishlist || $showCompare || $showCart) : ?> + <?php if ($showWishlist || $showCompare || $showCart): ?> <div class="product-item-inner"> <div class="product-item-actions"> - <?php if ($showCart) : ?> + <?php if ($showCart): ?> <div class="actions-primary"> - <?php if ($_item->isSaleable()) : ?> + <?php if ($_item->isSaleable()): ?> <?php $postParams = $block->getAddToCartPostParams($_item); ?> <form data-role="tocart-form" data-product-sku="<?= $block->escapeHtml($_item->getSku()) ?>" action="<?= $block->escapeUrl($postParams['action']) ?>" method="post"> <input type="hidden" name="product" value="<?= $block->escapeHtmlAttr($postParams['data']['product']) ?>"> @@ -72,24 +76,24 @@ use Magento\Framework\App\Action\Action; <span><?= $block->escapeHtml(__('Add to Cart')) ?></span> </button> </form> - <?php else : ?> - <?php if ($_item->getIsSalable()) : ?> + <?php else: ?> + <?php if ($_item->isAvailable()): ?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> - <?php else : ?> + <?php else: ?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> <?php endif; ?> <?php endif; ?> </div> <?php endif; ?> - <?php if ($showWishlist || $showCompare) : ?> + <?php if ($showWishlist || $showCompare): ?> <div class="actions-secondary" data-role="add-to-links"> - <?php if ($this->helper(\Magento\Wishlist\Helper\Data::class)->isAllow() && $showWishlist) : ?> + <?php if ($this->helper(\Magento\Wishlist\Helper\Data::class)->isAllow() && $showWishlist): ?> <a href="#" data-post='<?= /* @noEscape */ $block->getAddToWishlistParams($_item) ?>' class="action towishlist" data-action="add-to-wishlist" title="<?= $block->escapeHtmlAttr(__('Add to Wish List')) ?>"> <span><?= $block->escapeHtml(__('Add to Wish List')) ?></span> </a> <?php endif; ?> - <?php if ($block->getAddToCompareUrl() && $showCompare) : ?> + <?php if ($block->getAddToCompareUrl() && $showCompare): ?> <?php $compareHelper = $this->helper(\Magento\Catalog\Helper\Product\Compare::class);?> <a href="#" class="action tocompare" data-post='<?= /* @noEscape */ $compareHelper->getPostDataParams($_item) ?>' title="<?= $block->escapeHtmlAttr(__('Add to Compare')) ?>"> <span><?= $block->escapeHtml(__('Add to Compare')) ?></span> @@ -109,4 +113,13 @@ use Magento\Framework\App\Action\Action; <?= $block->getPagerHtml() ?> </div> </div> + <?php if($block->getBlockHtml('formkey')): ?> + <script type="text/x-magento-init"> + { + ".block.widget [data-role=tocart-form]": { + "Magento_Catalog/js/validate-product": {} + } + } + </script> + <?php endif;?> <?php endif;?> diff --git a/app/code/Magento/Checkout/Api/Exception/PaymentProcessingRateLimitExceededException.php b/app/code/Magento/Checkout/Api/Exception/PaymentProcessingRateLimitExceededException.php index e398bf400391..018c18112a76 100644 --- a/app/code/Magento/Checkout/Api/Exception/PaymentProcessingRateLimitExceededException.php +++ b/app/code/Magento/Checkout/Api/Exception/PaymentProcessingRateLimitExceededException.php @@ -11,7 +11,7 @@ use Magento\Framework\Exception\LocalizedException; /** - * Thrown when too many payment processing requests have been initiated by a user. + * Thrown when too many payment processing/saving requests have been initiated by a user. */ class PaymentProcessingRateLimitExceededException extends LocalizedException { diff --git a/app/code/Magento/Checkout/Api/PaymentSavingRateLimiterInterface.php b/app/code/Magento/Checkout/Api/PaymentSavingRateLimiterInterface.php new file mode 100644 index 000000000000..c964029ff8b3 --- /dev/null +++ b/app/code/Magento/Checkout/Api/PaymentSavingRateLimiterInterface.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Checkout\Api; + +use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; + +/** + * Limits number of times a user can store payment method info. + */ +interface PaymentSavingRateLimiterInterface +{ + /** + * Limit an attempt. + * + * @return void + * @throws PaymentProcessingRateLimitExceededException + */ + public function limit(): void; +} diff --git a/app/code/Magento/Checkout/Block/Cart.php b/app/code/Magento/Checkout/Block/Cart.php index 76bf917f02d8..f0305daf2abd 100644 --- a/app/code/Magento/Checkout/Block/Cart.php +++ b/app/code/Magento/Checkout/Block/Cart.php @@ -6,6 +6,7 @@ namespace Magento\Checkout\Block; use Magento\Customer\Model\Context; +use Magento\Framework\Phrase; /** * Shopping cart block @@ -69,7 +70,7 @@ protected function _construct() } /** - * prepare cart items URLs + * Prepare cart items URLs * * @return void * @SuppressWarnings(PHPMD.CyclomaticComplexity) @@ -111,6 +112,8 @@ public function prepareItemUrls() } /** + * Check quote for error + * * @codeCoverageIgnore * @return bool */ @@ -120,6 +123,8 @@ public function hasError() } /** + * Get Items Summary Qty + * * @codeCoverageIgnore * @return int */ @@ -129,6 +134,8 @@ public function getItemsSummaryQty() } /** + * Check if Wishlist Active + * * @codeCoverageIgnore * @return bool */ @@ -148,6 +155,8 @@ public function isWishlistActive() } /** + * Get Checkout Url + * * @codeCoverageIgnore * @return string */ @@ -157,6 +166,8 @@ public function getCheckoutUrl() } /** + * Get Continue Shopping Url + * * @return string */ public function getContinueShoppingUrl() @@ -173,6 +184,8 @@ public function getContinueShoppingUrl() } /** + * Check if quote is virtual + * * @return bool * @codeCoverageIgnore * @SuppressWarnings(PHPMD.BooleanGetMethodName) @@ -208,7 +221,13 @@ public function getMethodHtml($name) { $block = $this->getLayout()->getBlock($name); if (!$block) { - throw new \Magento\Framework\Exception\LocalizedException(__('Invalid method: %1', $name)); + throw new \Magento\Framework\Exception\LocalizedException( + new Phrase( + $this->escapeHtml( + __('Invalid method: %1', $name) + ) + ) + ); } return $block->toHtml(); } @@ -228,6 +247,8 @@ public function getItems() } /** + * Get Item Count + * * @codeCoverageIgnore * @return int */ diff --git a/app/code/Magento/Checkout/Controller/Cart/Add.php b/app/code/Magento/Checkout/Controller/Cart/Add.php index c4294e0fbade..009505d8e7b2 100644 --- a/app/code/Magento/Checkout/Controller/Cart/Add.php +++ b/app/code/Magento/Checkout/Controller/Cart/Add.php @@ -6,9 +6,11 @@ */ namespace Magento\Checkout\Controller\Cart; +use Magento\Checkout\Model\Cart\RequestQuantityProcessor; use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Checkout\Model\Cart as CustomerCart; +use Magento\Framework\App\ObjectManager; use Magento\Framework\App\ResponseInterface; use Magento\Framework\Controller\ResultInterface; use Magento\Framework\Exception\NoSuchEntityException; @@ -25,6 +27,11 @@ class Add extends \Magento\Checkout\Controller\Cart implements HttpPostActionInt */ protected $productRepository; + /** + * @var RequestQuantityProcessor + */ + private $quantityProcessor; + /** * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig @@ -33,6 +40,7 @@ class Add extends \Magento\Checkout\Controller\Cart implements HttpPostActionInt * @param \Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator * @param CustomerCart $cart * @param ProductRepositoryInterface $productRepository + * @param RequestQuantityProcessor|null $quantityProcessor * @codeCoverageIgnore */ public function __construct( @@ -42,7 +50,8 @@ public function __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator, CustomerCart $cart, - ProductRepositoryInterface $productRepository + ProductRepositoryInterface $productRepository, + ?RequestQuantityProcessor $quantityProcessor = null ) { parent::__construct( $context, @@ -53,6 +62,8 @@ public function __construct( $cart ); $this->productRepository = $productRepository; + $this->quantityProcessor = $quantityProcessor + ?? ObjectManager::getInstance()->get(RequestQuantityProcessor::class); } /** @@ -99,6 +110,7 @@ public function execute() \Magento\Framework\Locale\ResolverInterface::class )->getLocale()] ); + $params['qty'] = $this->quantityProcessor->prepareQuantity($params['qty']); $params['qty'] = $filter->filter($params['qty']); } diff --git a/app/code/Magento/Checkout/Controller/Cart/UpdateItemOptions.php b/app/code/Magento/Checkout/Controller/Cart/UpdateItemOptions.php index 40ce2252581c..205f0aa8dbd2 100644 --- a/app/code/Magento/Checkout/Controller/Cart/UpdateItemOptions.php +++ b/app/code/Magento/Checkout/Controller/Cart/UpdateItemOptions.php @@ -1,20 +1,29 @@ <?php /** - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Checkout\Controller\Cart; +use Magento\Checkout\Controller\Cart; +use Magento\Checkout\Helper\Cart as CartHelper; use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; +use Magento\Framework\Controller\Result\Redirect; +use Magento\Framework\DataObject; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Locale\ResolverInterface; +use Psr\Log\LoggerInterface; -class UpdateItemOptions extends \Magento\Checkout\Controller\Cart implements HttpPostActionInterface +/** + * Process updating product options in a cart item. + */ +class UpdateItemOptions extends Cart implements HttpPostActionInterface { /** - * Update product configuration for a cart item + * Update product configuration for a cart item. * - * @return \Magento\Framework\Controller\Result\Redirect + * @return Redirect * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) */ @@ -28,27 +37,27 @@ public function execute() } try { if (isset($params['qty'])) { - $filter = new \Zend_Filter_LocalizedToNormalized( - ['locale' => $this->_objectManager->get( - \Magento\Framework\Locale\ResolverInterface::class - )->getLocale()] + $inputFilter = new \Zend_Filter_LocalizedToNormalized( + [ + 'locale' => $this->_objectManager->get(ResolverInterface::class)->getLocale(), + ] ); - $params['qty'] = $filter->filter($params['qty']); + $params['qty'] = $inputFilter->filter($params['qty']); } $quoteItem = $this->cart->getQuote()->getItemById($id); if (!$quoteItem) { - throw new \Magento\Framework\Exception\LocalizedException( + throw new LocalizedException( __("The quote item isn't found. Verify the item and try again.") ); } - $item = $this->cart->updateItem($id, new \Magento\Framework\DataObject($params)); + $item = $this->cart->updateItem($id, new DataObject($params)); if (is_string($item)) { - throw new \Magento\Framework\Exception\LocalizedException(__($item)); + throw new LocalizedException(__($item)); } if ($item->getHasError()) { - throw new \Magento\Framework\Exception\LocalizedException(__($item->getMessage())); + throw new LocalizedException(__($item->getMessage())); } $related = $this->getRequest()->getParam('related_product'); @@ -73,7 +82,7 @@ public function execute() } return $this->_goBack($this->_url->getUrl('checkout/cart')); } - } catch (\Magento\Framework\Exception\LocalizedException $e) { + } catch (LocalizedException $e) { if ($this->_checkoutSession->getUseNotice(true)) { $this->messageManager->addNoticeMessage($e->getMessage()); } else { @@ -87,14 +96,15 @@ public function execute() if ($url) { return $this->resultRedirectFactory->create()->setUrl($url); } else { - $cartUrl = $this->_objectManager->get(\Magento\Checkout\Helper\Cart::class)->getCartUrl(); - return $this->resultRedirectFactory->create()->setUrl($this->_redirect->getRedirectUrl($cartUrl)); + $cartUrl = $this->_objectManager->get(CartHelper::class)->getCartUrl(); + return $this->resultRedirectFactory->create()->setUrl($cartUrl); } } catch (\Exception $e) { $this->messageManager->addExceptionMessage($e, __('We can\'t update the item right now.')); - $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); + $this->_objectManager->get(LoggerInterface::class)->critical($e); return $this->_goBack(); } + return $this->resultRedirectFactory->create()->setPath('*/*'); } } diff --git a/app/code/Magento/Checkout/Controller/Sidebar/UpdateItemQty.php b/app/code/Magento/Checkout/Controller/Sidebar/UpdateItemQty.php index 0208519c33d7..44e40c57f661 100644 --- a/app/code/Magento/Checkout/Controller/Sidebar/UpdateItemQty.php +++ b/app/code/Magento/Checkout/Controller/Sidebar/UpdateItemQty.php @@ -5,9 +5,11 @@ */ namespace Magento\Checkout\Controller\Sidebar; +use Magento\Checkout\Model\Cart\RequestQuantityProcessor; use Magento\Checkout\Model\Sidebar; use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; +use Magento\Framework\App\ObjectManager; use Magento\Framework\App\Response\Http; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Json\Helper\Data; @@ -30,23 +32,32 @@ class UpdateItemQty extends Action */ protected $jsonHelper; + /** + * @var RequestQuantityProcessor + */ + private $quantityProcessor; + /** * @param Context $context * @param Sidebar $sidebar * @param LoggerInterface $logger * @param Data $jsonHelper + * @param RequestQuantityProcessor|null $quantityProcessor * @codeCoverageIgnore */ public function __construct( Context $context, Sidebar $sidebar, LoggerInterface $logger, - Data $jsonHelper + Data $jsonHelper, + ?RequestQuantityProcessor $quantityProcessor = null ) { $this->sidebar = $sidebar; $this->logger = $logger; $this->jsonHelper = $jsonHelper; parent::__construct($context); + $this->quantityProcessor = $quantityProcessor + ?? ObjectManager::getInstance()->get(RequestQuantityProcessor::class); } /** @@ -56,6 +67,7 @@ public function execute() { $itemId = (int)$this->getRequest()->getParam('item_id'); $itemQty = $this->getRequest()->getParam('item_qty') * 1; + $itemQty = $this->quantityProcessor->prepareQuantity($itemQty); try { $this->sidebar->checkQuoteItem($itemId); diff --git a/app/code/Magento/Checkout/Model/CaptchaPaymentProcessingRateLimiter.php b/app/code/Magento/Checkout/Model/CaptchaPaymentProcessingRateLimiter.php index 6f71423acbca..68860b629c24 100644 --- a/app/code/Magento/Checkout/Model/CaptchaPaymentProcessingRateLimiter.php +++ b/app/code/Magento/Checkout/Model/CaptchaPaymentProcessingRateLimiter.php @@ -12,42 +12,23 @@ use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; use Magento\Checkout\Api\PaymentProcessingRateLimiterInterface; use Magento\Customer\Api\CustomerRepositoryInterface; -use Magento\Captcha\Model\DefaultModel as Captcha; use Magento\Captcha\Helper\Data as CaptchaHelper; use Magento\Captcha\Observer\CaptchaStringResolver as CaptchaResolver; +use Magento\Framework\App\ObjectManager; use Magento\Framework\App\RequestInterface; +use Magento\Framework\Exception\LocalizedException; /** - * Utilize CAPTCHA as a rate-limiting mechanism. + * Utilize CAPTCHA to limit payment processing requests. */ class CaptchaPaymentProcessingRateLimiter implements PaymentProcessingRateLimiterInterface { public const CAPTCHA_FORM = 'payment_processing_request'; /** - * @var UserContextInterface + * @var CaptchaRateLimiter */ - private $userContext; - - /** - * @var CustomerRepositoryInterface - */ - private $customerRepo; - - /** - * @var CaptchaHelper - */ - private $captchaHelper; - - /** - * @var RequestInterface - */ - private $request; - - /** - * @var CaptchaResolver - */ - private $captchaResolver; + private $limiter; /** * CaptchaPaymentProcessingRateLimiter constructor. @@ -57,19 +38,25 @@ class CaptchaPaymentProcessingRateLimiter implements PaymentProcessingRateLimite * @param CaptchaHelper $captchaHelper * @param RequestInterface $request * @param CaptchaResolver $captchaResolver + * @param CaptchaRateLimiterFactory|null $limiterFactory */ public function __construct( UserContextInterface $userContext, CustomerRepositoryInterface $customerRepo, CaptchaHelper $captchaHelper, RequestInterface $request, - CaptchaResolver $captchaResolver + CaptchaResolver $captchaResolver, + ?CaptchaRateLimiterFactory $limiterFactory ) { - $this->userContext = $userContext; - $this->customerRepo = $customerRepo; - $this->captchaHelper = $captchaHelper; - $this->request = $request; - $this->captchaResolver = $captchaResolver; + $limiterFactory = $limiterFactory ?? ObjectManager::getInstance()->get(CaptchaRateLimiterFactory::class); + $this->limiter = $limiterFactory->create([ + 'userContext' => $userContext, + 'customerRepo' => $customerRepo, + 'captchaHelper' => $captchaHelper, + 'captchaResolver' => $captchaResolver, + 'request' => $request, + 'captchaId' => self::CAPTCHA_FORM + ]); } /** @@ -77,47 +64,10 @@ public function __construct( */ public function limit(): void { - if ($this->userContext->getUserType() !== UserContextInterface::USER_TYPE_GUEST - && $this->userContext->getUserType() !== UserContextInterface::USER_TYPE_CUSTOMER - && $this->userContext->getUserType() !== null - ) { - return; + try { + $this->limiter->limit(); + } catch (LocalizedException $exception) { + throw new PaymentProcessingRateLimitExceededException(__($exception->getMessage()), $exception); } - - $login = $this->retrieveLogin(); - /** @var Captcha $captcha */ - $captcha = $this->captchaHelper->getCaptcha(self::CAPTCHA_FORM); - /** @var PaymentProcessingRateLimitExceededException|null $exception */ - $exception = null; - if ($captcha->isRequired($login)) { - $value = $this->captchaResolver->resolve($this->request, self::CAPTCHA_FORM); - if ($value && !$captcha->isCorrect($value)) { - $exception = new PaymentProcessingRateLimitExceededException(__('Incorrect CAPTCHA')); - } elseif (!$value) { - $exception = new PaymentProcessingRateLimitExceededException( - __('Please provide CAPTCHA code and try again') - ); - } - } - - $captcha->logAttempt($login); - if ($exception) { - throw $exception; - } - } - - /** - * Retrieve current user login. - * - * @return string|null - */ - private function retrieveLogin(): ?string - { - $login = null; - if ($this->userContext->getUserId()) { - $login = $this->customerRepo->getById($this->userContext->getUserId())->getEmail(); - } - - return $login; } } diff --git a/app/code/Magento/Checkout/Model/CaptchaPaymentSavingRateLimiter.php b/app/code/Magento/Checkout/Model/CaptchaPaymentSavingRateLimiter.php new file mode 100644 index 000000000000..7d52a1a0e19a --- /dev/null +++ b/app/code/Magento/Checkout/Model/CaptchaPaymentSavingRateLimiter.php @@ -0,0 +1,55 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Checkout\Model; + +use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; +use Magento\Checkout\Api\PaymentSavingRateLimiterInterface; +use Magento\Framework\Exception\LocalizedException; + +/** + * Utilize CAPTCHA to limit save payment requests. + */ +class CaptchaPaymentSavingRateLimiter implements PaymentSavingRateLimiterInterface +{ + public const CAPTCHA_FORM = 'payment_saving_request'; + + /** + * @var CaptchaRateLimiter + */ + private $limiter; + + /** + * CaptchaPaymentProcessingRateLimiter constructor. + * + * @param CaptchaRateLimiterFactory $limiterFactory + */ + public function __construct( + CaptchaRateLimiterFactory $limiterFactory + ) { + $this->limiter = $limiterFactory->create(['captchaId' => self::CAPTCHA_FORM]); + } + + /** + * @inheritDoc + */ + public function limit(): void + { + try { + $this->limiter->limit(); + } catch (LocalizedException $exception) { + throw new PaymentProcessingRateLimitExceededException( + __( + 'Could not store billing/shipping information at the moment' + .' but you can proceed with the checkout' + ), + $exception + ); + } + } +} diff --git a/app/code/Magento/Checkout/Model/CaptchaRateLimiter.php b/app/code/Magento/Checkout/Model/CaptchaRateLimiter.php new file mode 100644 index 000000000000..e643d61e82b1 --- /dev/null +++ b/app/code/Magento/Checkout/Model/CaptchaRateLimiter.php @@ -0,0 +1,129 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Checkout\Model; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Captcha\Model\DefaultModel as Captcha; +use Magento\Captcha\Helper\Data as CaptchaHelper; +use Magento\Captcha\Observer\CaptchaStringResolver as CaptchaResolver; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\Exception\LocalizedException; + +/** + * Utilize CAPTCHA as a rate-limiting mechanism. + */ +class CaptchaRateLimiter +{ + /** + * @var string + */ + private $captchaId; + + /** + * @var UserContextInterface + */ + private $userContext; + + /** + * @var CustomerRepositoryInterface + */ + private $customerRepo; + + /** + * @var CaptchaHelper + */ + private $captchaHelper; + + /** + * @var RequestInterface + */ + private $request; + + /** + * @var CaptchaResolver + */ + private $captchaResolver; + + /** + * @param UserContextInterface $userContext + * @param CustomerRepositoryInterface $customerRepo + * @param CaptchaHelper $captchaHelper + * @param RequestInterface $request + * @param CaptchaResolver $captchaResolver + * @param string $captchaId + */ + public function __construct( + UserContextInterface $userContext, + CustomerRepositoryInterface $customerRepo, + CaptchaHelper $captchaHelper, + RequestInterface $request, + CaptchaResolver $captchaResolver, + string $captchaId + ) { + $this->userContext = $userContext; + $this->customerRepo = $customerRepo; + $this->captchaHelper = $captchaHelper; + $this->request = $request; + $this->captchaResolver = $captchaResolver; + $this->captchaId = $captchaId; + } + + /** + * Validate CAPTCHA if necessary. + * + * @return void + * @throws LocalizedException + */ + public function limit(): void + { + if ($this->userContext->getUserType() !== UserContextInterface::USER_TYPE_GUEST + && $this->userContext->getUserType() !== UserContextInterface::USER_TYPE_CUSTOMER + && $this->userContext->getUserType() !== null + ) { + return; + } + + $login = $this->retrieveLogin(); + /** @var Captcha $captcha */ + $captcha = $this->captchaHelper->getCaptcha($this->captchaId); + /** @var LocalizedException|null $exception */ + $exception = null; + if ($captcha->isRequired($login)) { + $value = $this->captchaResolver->resolve($this->request, $this->captchaId); + if ($value && !$captcha->isCorrect($value)) { + $exception = new LocalizedException(__('Incorrect CAPTCHA')); + } elseif (!$value) { + $exception = new LocalizedException( + __('Please provide CAPTCHA code and try again') + ); + } + } + + $captcha->logAttempt($login); + if ($exception) { + throw $exception; + } + } + + /** + * Retrieve current user login. + * + * @return string|null + */ + private function retrieveLogin(): ?string + { + $login = null; + if ($this->userContext->getUserId()) { + $login = $this->customerRepo->getById($this->userContext->getUserId())->getEmail(); + } + + return $login; + } +} diff --git a/app/code/Magento/Checkout/Model/Cart/ImageProvider.php b/app/code/Magento/Checkout/Model/Cart/ImageProvider.php index bc409357bf40..d15d1a9f7549 100644 --- a/app/code/Magento/Checkout/Model/Cart/ImageProvider.php +++ b/app/code/Magento/Checkout/Model/Cart/ImageProvider.php @@ -32,19 +32,37 @@ class ImageProvider */ protected $customerDataItem; + /** + * @var \Magento\Catalog\Helper\Image + */ + private $imageHelper; + + /** + * @var \Magento\Catalog\Model\Product\Configuration\Item\ItemResolverInterface + */ + private $itemResolver; + /** * @param \Magento\Quote\Api\CartItemRepositoryInterface $itemRepository * @param \Magento\Checkout\CustomerData\ItemPoolInterface $itemPool * @param DefaultItem|null $customerDataItem + * @param \Magento\Catalog\Helper\Image $imageHelper + * @param \Magento\Catalog\Model\Product\Configuration\Item\ItemResolverInterface $itemResolver */ public function __construct( \Magento\Quote\Api\CartItemRepositoryInterface $itemRepository, \Magento\Checkout\CustomerData\ItemPoolInterface $itemPool, - \Magento\Checkout\CustomerData\DefaultItem $customerDataItem = null + \Magento\Checkout\CustomerData\DefaultItem $customerDataItem = null, + \Magento\Catalog\Helper\Image $imageHelper = null, + \Magento\Catalog\Model\Product\Configuration\Item\ItemResolverInterface $itemResolver = null ) { $this->itemRepository = $itemRepository; $this->itemPool = $itemPool; $this->customerDataItem = $customerDataItem ?: ObjectManager::getInstance()->get(DefaultItem::class); + $this->imageHelper = $imageHelper ?: ObjectManager::getInstance()->get(\Magento\Catalog\Helper\Image::class); + $this->itemResolver = $itemResolver ?: ObjectManager::getInstance()->get( + \Magento\Catalog\Model\Product\Configuration\Item\ItemResolverInterface::class + ); } /** @@ -58,9 +76,30 @@ public function getImages($cartId) $items = $this->itemRepository->getList($cartId); /** @var \Magento\Quote\Model\Quote\Item $cartItem */ foreach ($items as $cartItem) { - $allData = $this->customerDataItem->getItemData($cartItem); - $itemData[$cartItem->getItemId()] = $allData['product_image']; + $itemData[$cartItem->getItemId()] = $this->getProductImageData($cartItem); } return $itemData; } + + /** + * Get product image data + * + * @param \Magento\Quote\Model\Quote\Item $cartItem + * + * @return array + */ + private function getProductImageData($cartItem) + { + $imageHelper = $this->imageHelper->init( + $this->itemResolver->getFinalProduct($cartItem), + 'mini_cart_product_thumbnail' + ); + $imageData = [ + 'src' => $imageHelper->getUrl(), + 'alt' => $imageHelper->getLabel(), + 'width' => $imageHelper->getWidth(), + 'height' => $imageHelper->getHeight(), + ]; + return $imageData; + } } diff --git a/app/code/Magento/Checkout/Model/Cart/RequestQuantityProcessor.php b/app/code/Magento/Checkout/Model/Cart/RequestQuantityProcessor.php index 27566ba6805a..d3d15f787fa9 100644 --- a/app/code/Magento/Checkout/Model/Cart/RequestQuantityProcessor.php +++ b/app/code/Magento/Checkout/Model/Cart/RequestQuantityProcessor.php @@ -41,6 +41,7 @@ public function process(array $cartData): array foreach ($cartData as $index => $data) { if (isset($data['qty'])) { + $data['qty'] = $this->prepareQuantity($data['qty']); $data['qty'] = is_string($data['qty']) ? trim($data['qty']) : $data['qty']; $cartData[$index]['qty'] = $filter->filter($data['qty']); } @@ -48,4 +49,31 @@ public function process(array $cartData): array return $cartData; } + + /** + * Prepare quantity with taking into account decimal separator by locale + * + * @param int|float|string|array $quantity + * @return int|float|string|array + * @throws \Zend_Locale_Exception + */ + public function prepareQuantity($quantity) + { + $formatter = new \NumberFormatter($this->localeResolver->getLocale(), \NumberFormatter::CURRENCY); + $decimalSymbol = $formatter->getSymbol(\NumberFormatter::DECIMAL_SEPARATOR_SYMBOL); + + if (is_array($quantity)) { + foreach ($quantity as $key => $qty) { + if (strpos((string)$qty, '.') !== false && $decimalSymbol !== '.') { + $quantity[$key] = str_replace('.', $decimalSymbol, $qty); + } + } + } else { + if (strpos((string)$quantity, '.') !== false && $decimalSymbol !== '.') { + $quantity = str_replace('.', $decimalSymbol, (string)$quantity); + } + } + + return $quantity; + } } diff --git a/app/code/Magento/Checkout/Model/DefaultConfigProvider.php b/app/code/Magento/Checkout/Model/DefaultConfigProvider.php index fdf49d6765a2..80748bfa042d 100644 --- a/app/code/Magento/Checkout/Model/DefaultConfigProvider.php +++ b/app/code/Magento/Checkout/Model/DefaultConfigProvider.php @@ -5,11 +5,13 @@ */ namespace Magento\Checkout\Model; +use Magento\Captcha\Api\CaptchaConfigPostProcessorInterface; use Magento\Catalog\Helper\Product\ConfigurationPool; use Magento\Checkout\Helper\Data as CheckoutHelper; use Magento\Checkout\Model\Session as CheckoutSession; use Magento\Customer\Api\AddressMetadataInterface; use Magento\Customer\Api\CustomerRepositoryInterface as CustomerRepository; +use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Model\Address\CustomerAddressDataProvider; use Magento\Customer\Model\Context as CustomerContext; use Magento\Customer\Model\Session as CustomerSession; @@ -31,7 +33,7 @@ use Magento\Ui\Component\Form\Element\Multiline; /** - * Default Config Provider + * Default Config Provider for checkout * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.TooManyFields) @@ -184,6 +186,11 @@ class DefaultConfigProvider implements ConfigProviderInterface */ private $customerAddressData; + /** + * @var CaptchaConfigPostProcessorInterface + */ + private $configPostProcessor; + /** * @param CheckoutHelper $checkoutHelper * @param Session $checkoutSession @@ -211,6 +218,7 @@ class DefaultConfigProvider implements ConfigProviderInterface * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Quote\Api\PaymentMethodManagementInterface $paymentMethodManagement * @param UrlInterface $urlBuilder + * @param CaptchaConfigPostProcessorInterface $configPostProcessor * @param AddressMetadataInterface $addressMetadata * @param AttributeOptionManagementInterface $attributeOptionManager * @param CustomerAddressDataProvider|null $customerAddressData @@ -244,6 +252,7 @@ public function __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Quote\Api\PaymentMethodManagementInterface $paymentMethodManagement, UrlInterface $urlBuilder, + CaptchaConfigPostProcessorInterface $configPostProcessor, AddressMetadataInterface $addressMetadata = null, AttributeOptionManagementInterface $attributeOptionManager = null, CustomerAddressDataProvider $customerAddressData = null @@ -279,6 +288,7 @@ public function __construct( ObjectManager::getInstance()->get(AttributeOptionManagementInterface::class); $this->customerAddressData = $customerAddressData ?: ObjectManager::getInstance()->get(CustomerAddressDataProvider::class); + $this->configPostProcessor = $configPostProcessor; } /** @@ -302,14 +312,11 @@ public function getConfig() $output['isCustomerLoggedIn'] = $this->isCustomerLoggedIn(); $output['selectedShippingMethod'] = $this->getSelectedShippingMethod(); if ($email && !$this->isCustomerLoggedIn()) { - $shippingAddressFromData = $this->getAddressFromData($quote->getShippingAddress()); - $billingAddressFromData = $this->getAddressFromData($quote->getBillingAddress()); - $output['shippingAddressFromData'] = $shippingAddressFromData; - if ($shippingAddressFromData != $billingAddressFromData) { - $output['billingAddressFromData'] = $billingAddressFromData; - } $output['validatedEmailValue'] = $email; } + if (!$this->isCustomerLoggedIn() || !$this->getCustomer()->getAddresses()) { + $output = array_merge($output, $this->getQuoteAddressData()); + } $output['storeCode'] = $this->getStoreCode(); $output['isGuestCheckoutAllowed'] = $this->isGuestCheckoutAllowed(); $output['isCustomerLoginRequired'] = $this->isCustomerLoginRequired(); @@ -352,7 +359,7 @@ public function getConfig() $output['paymentMethods'] = $this->getPaymentMethods(); $output['autocomplete'] = $this->isAutocompleteEnabled(); $output['displayBillingOnPaymentMethod'] = $this->checkoutHelper->isDisplayBillingOnPaymentMethodAvailable(); - return $output; + return $this->configPostProcessor->process($output); } /** @@ -378,8 +385,7 @@ private function getCustomerData(): array { $customerData = []; if ($this->isCustomerLoggedIn()) { - /** @var \Magento\Customer\Api\Data\CustomerInterface $customer */ - $customer = $this->customerRepository->getById($this->customerSession->getCustomerId()); + $customer = $this->getCustomer(); $customerData = $customer->__toArray(); $customerData['addresses'] = $this->customerAddressData->getAddressDataByCustomer($customer); } @@ -722,4 +728,43 @@ private function getQuoteItemsMessages(array $quoteItemData): array return $quoteItemsMessages; } + + /** + * Get quote address data for checkout + * + * @return array + */ + private function getQuoteAddressData(): array + { + $output = []; + $quote = $this->checkoutSession->getQuote(); + $shippingAddressFromData = []; + if ($quote->getShippingAddress()->getEmail()) { + $shippingAddressFromData = $this->getAddressFromData($quote->getShippingAddress()); + if ($shippingAddressFromData) { + $output['isShippingAddressFromDataValid'] = $quote->getShippingAddress()->validate() === true; + $output['shippingAddressFromData'] = $shippingAddressFromData; + } + } + + if ($quote->getBillingAddress()->getEmail()) { + $billingAddressFromData = $this->getAddressFromData($quote->getBillingAddress()); + if ($billingAddressFromData && $shippingAddressFromData != $billingAddressFromData) { + $output['isBillingAddressFromDataValid'] = $quote->getBillingAddress()->validate() === true; + $output['billingAddressFromData'] = $billingAddressFromData; + } + } + + return $output; + } + + /** + * Get logged-in customer + * + * @return CustomerInterface + */ + private function getCustomer(): CustomerInterface + { + return $this->customerRepository->getById($this->customerSession->getCustomerId()); + } } diff --git a/app/code/Magento/Checkout/Model/GuestPaymentInformationManagement.php b/app/code/Magento/Checkout/Model/GuestPaymentInformationManagement.php index 2b2824213df7..0ca398b73a08 100644 --- a/app/code/Magento/Checkout/Model/GuestPaymentInformationManagement.php +++ b/app/code/Magento/Checkout/Model/GuestPaymentInformationManagement.php @@ -7,7 +7,9 @@ namespace Magento\Checkout\Model; +use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; use Magento\Checkout\Api\PaymentProcessingRateLimiterInterface; +use Magento\Checkout\Api\PaymentSavingRateLimiterInterface; use Magento\Framework\App\ObjectManager; use Magento\Quote\Api\CartRepositoryInterface; use Magento\Framework\Exception\CouldNotSaveException; @@ -61,6 +63,16 @@ class GuestPaymentInformationManagement implements \Magento\Checkout\Api\GuestPa */ private $paymentsRateLimiter; + /** + * @var PaymentSavingRateLimiterInterface + */ + private $savingRateLimiter; + + /** + * @var bool + */ + private $saveRateLimitDisabled = false; + /** * @param \Magento\Quote\Api\GuestBillingAddressManagementInterface $billingAddressManagement * @param \Magento\Quote\Api\GuestPaymentMethodManagementInterface $paymentMethodManagement @@ -69,6 +81,7 @@ class GuestPaymentInformationManagement implements \Magento\Checkout\Api\GuestPa * @param \Magento\Quote\Model\QuoteIdMaskFactory $quoteIdMaskFactory * @param CartRepositoryInterface $cartRepository * @param PaymentProcessingRateLimiterInterface|null $paymentsRateLimiter + * @param PaymentSavingRateLimiterInterface|null $savingRateLimiter * @codeCoverageIgnore */ public function __construct( @@ -78,7 +91,8 @@ public function __construct( \Magento\Checkout\Api\PaymentInformationManagementInterface $paymentInformationManagement, \Magento\Quote\Model\QuoteIdMaskFactory $quoteIdMaskFactory, CartRepositoryInterface $cartRepository, - ?PaymentProcessingRateLimiterInterface $paymentsRateLimiter = null + ?PaymentProcessingRateLimiterInterface $paymentsRateLimiter = null, + ?PaymentSavingRateLimiterInterface $savingRateLimiter = null ) { $this->billingAddressManagement = $billingAddressManagement; $this->paymentMethodManagement = $paymentMethodManagement; @@ -88,6 +102,8 @@ public function __construct( $this->cartRepository = $cartRepository; $this->paymentsRateLimiter = $paymentsRateLimiter ?? ObjectManager::getInstance()->get(PaymentProcessingRateLimiterInterface::class); + $this->savingRateLimiter = $savingRateLimiter + ?? ObjectManager::getInstance()->get(PaymentSavingRateLimiterInterface::class); } /** @@ -99,7 +115,14 @@ public function savePaymentInformationAndPlaceOrder( \Magento\Quote\Api\Data\PaymentInterface $paymentMethod, \Magento\Quote\Api\Data\AddressInterface $billingAddress = null ) { - $this->savePaymentInformation($cartId, $email, $paymentMethod, $billingAddress); + $this->paymentsRateLimiter->limit(); + try { + //Have to do this hack because of savePaymentInformation() plugins. + $this->saveRateLimitDisabled = true; + $this->savePaymentInformation($cartId, $email, $paymentMethod, $billingAddress); + } finally { + $this->saveRateLimitDisabled = false; + } try { $orderId = $this->cartManagement->placeOrder($cartId); } catch (\Magento\Framework\Exception\LocalizedException $e) { @@ -130,7 +153,14 @@ public function savePaymentInformation( \Magento\Quote\Api\Data\PaymentInterface $paymentMethod, \Magento\Quote\Api\Data\AddressInterface $billingAddress = null ) { - $this->paymentsRateLimiter->limit(); + if (!$this->saveRateLimitDisabled) { + try { + $this->savingRateLimiter->limit(); + } catch (PaymentProcessingRateLimitExceededException $ex) { + //Limit reached + return false; + } + } $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id'); /** @var Quote $quote */ diff --git a/app/code/Magento/Checkout/Model/PaymentInformationManagement.php b/app/code/Magento/Checkout/Model/PaymentInformationManagement.php index a6e448ecdb87..1aad8a78bda5 100644 --- a/app/code/Magento/Checkout/Model/PaymentInformationManagement.php +++ b/app/code/Magento/Checkout/Model/PaymentInformationManagement.php @@ -6,9 +6,12 @@ namespace Magento\Checkout\Model; +use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; use Magento\Checkout\Api\PaymentProcessingRateLimiterInterface; +use Magento\Checkout\Api\PaymentSavingRateLimiterInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\CouldNotSaveException; +use Magento\Quote\Api\CartRepositoryInterface; /** * Payment information management service. @@ -49,7 +52,7 @@ class PaymentInformationManagement implements \Magento\Checkout\Api\PaymentInfor private $logger; /** - * @var \Magento\Quote\Api\CartRepositoryInterface + * @var CartRepositoryInterface */ private $cartRepository; @@ -58,6 +61,16 @@ class PaymentInformationManagement implements \Magento\Checkout\Api\PaymentInfor */ private $paymentRateLimiter; + /** + * @var PaymentSavingRateLimiterInterface + */ + private $saveRateLimiter; + + /** + * @var bool + */ + private $saveRateLimiterDisabled = false; + /** * @param \Magento\Quote\Api\BillingAddressManagementInterface $billingAddressManagement * @param \Magento\Quote\Api\PaymentMethodManagementInterface $paymentMethodManagement @@ -65,6 +78,8 @@ class PaymentInformationManagement implements \Magento\Checkout\Api\PaymentInfor * @param PaymentDetailsFactory $paymentDetailsFactory * @param \Magento\Quote\Api\CartTotalRepositoryInterface $cartTotalsRepository * @param PaymentProcessingRateLimiterInterface|null $paymentRateLimiter + * @param PaymentSavingRateLimiterInterface|null $saveRateLimiter + * @param CartRepositoryInterface|null $cartRepository * @codeCoverageIgnore */ public function __construct( @@ -73,7 +88,9 @@ public function __construct( \Magento\Quote\Api\CartManagementInterface $cartManagement, \Magento\Checkout\Model\PaymentDetailsFactory $paymentDetailsFactory, \Magento\Quote\Api\CartTotalRepositoryInterface $cartTotalsRepository, - ?PaymentProcessingRateLimiterInterface $paymentRateLimiter = null + ?PaymentProcessingRateLimiterInterface $paymentRateLimiter = null, + ?PaymentSavingRateLimiterInterface $saveRateLimiter = null, + ?CartRepositoryInterface $cartRepository = null ) { $this->billingAddressManagement = $billingAddressManagement; $this->paymentMethodManagement = $paymentMethodManagement; @@ -82,6 +99,10 @@ public function __construct( $this->cartTotalsRepository = $cartTotalsRepository; $this->paymentRateLimiter = $paymentRateLimiter ?? ObjectManager::getInstance()->get(PaymentProcessingRateLimiterInterface::class); + $this->saveRateLimiter = $saveRateLimiter + ?? ObjectManager::getInstance()->get(PaymentSavingRateLimiterInterface::class); + $this->cartRepository = $cartRepository + ?? ObjectManager::getInstance()->get(CartRepositoryInterface::class); } /** @@ -92,7 +113,14 @@ public function savePaymentInformationAndPlaceOrder( \Magento\Quote\Api\Data\PaymentInterface $paymentMethod, \Magento\Quote\Api\Data\AddressInterface $billingAddress = null ) { - $this->savePaymentInformation($cartId, $paymentMethod, $billingAddress); + $this->paymentRateLimiter->limit(); + try { + //Have to do this hack because of plugins for savePaymentInformation() + $this->saveRateLimiterDisabled = true; + $this->savePaymentInformation($cartId, $paymentMethod, $billingAddress); + } finally { + $this->saveRateLimiterDisabled = false; + } try { $orderId = $this->cartManagement->placeOrder($cartId); } catch (\Magento\Framework\Exception\LocalizedException $e) { @@ -121,13 +149,18 @@ public function savePaymentInformation( \Magento\Quote\Api\Data\PaymentInterface $paymentMethod, \Magento\Quote\Api\Data\AddressInterface $billingAddress = null ) { - $this->paymentRateLimiter->limit(); + if (!$this->saveRateLimiterDisabled) { + try { + $this->saveRateLimiter->limit(); + } catch (PaymentProcessingRateLimitExceededException $ex) { + //Limit reached + return false; + } + } if ($billingAddress) { - /** @var \Magento\Quote\Api\CartRepositoryInterface $quoteRepository */ - $quoteRepository = $this->getCartRepository(); /** @var \Magento\Quote\Model\Quote $quote */ - $quote = $quoteRepository->getActive($cartId); + $quote = $this->cartRepository->getActive($cartId); $customerId = $quote->getBillingAddress() ->getCustomerId(); if (!$billingAddress->getCustomerId() && $customerId) { @@ -174,19 +207,4 @@ private function getLogger() } return $this->logger; } - - /** - * Get Cart repository - * - * @return \Magento\Quote\Api\CartRepositoryInterface - * @deprecated 100.2.0 - */ - private function getCartRepository() - { - if (!$this->cartRepository) { - $this->cartRepository = ObjectManager::getInstance() - ->get(\Magento\Quote\Api\CartRepositoryInterface::class); - } - return $this->cartRepository; - } } diff --git a/app/code/Magento/Checkout/Model/Type/Onepage.php b/app/code/Magento/Checkout/Model/Type/Onepage.php index f7e55fdc84cf..7c5c8790e422 100644 --- a/app/code/Magento/Checkout/Model/Type/Onepage.php +++ b/app/code/Magento/Checkout/Model/Type/Onepage.php @@ -169,6 +169,11 @@ class Onepage */ protected $totalsCollector; + /** + * @var \Magento\Framework\Encryption\EncryptorInterface + */ + private $_encryptor; + /** * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Checkout\Helper\Data $helper @@ -405,7 +410,7 @@ public function saveShipping($data, $customerAddressId) $address = $this->getQuote()->getShippingAddress(); $addressForm = $this->_formFactory->create( - \customer_address::class, + 'customer_address', 'customer_address_edit', [], $this->_request->isAjax(), diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontGuestCheckoutShippingAddressFormPrefilledActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontGuestCheckoutShippingAddressFormPrefilledActionGroup.xml new file mode 100644 index 000000000000..300e9c60ff36 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontGuestCheckoutShippingAddressFormPrefilledActionGroup.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontGuestCheckoutShippingAddressFormPrefilledActionGroup"> + <annotations> + <description>Verify that shipping address form is filled with provided customer and address information.</description> + </annotations> + <arguments> + <argument name="customer" defaultValue="Simple_US_Customer" type="entity"/> + <argument name="address" defaultValue="US_Address_TX" type="entity"/> + </arguments> + + <grabValueFrom selector="{{CheckoutShippingSection.email}}" stepKey="email"/> + <grabValueFrom selector="{{CheckoutShippingSection.firstName}}" stepKey="firstname"/> + <grabValueFrom selector="{{CheckoutShippingSection.lastName}}" stepKey="lastname"/> + <grabValueFrom selector="{{CheckoutShippingSection.street}}" stepKey="street"/> + <grabValueFrom selector="{{CheckoutShippingSection.city}}" stepKey="city"/> + <grabValueFrom selector="{{CheckoutShippingSection.postcode}}" stepKey="postcode"/> + <grabValueFrom selector="{{CheckoutShippingSection.telephone}}" stepKey="telephone"/> + + <assertEquals stepKey="assertEmail"> + <actualResult type="variable">email</actualResult> + <expectedResult type="string">{{customer.email}}</expectedResult> + </assertEquals> + <assertEquals stepKey="assertFirstName"> + <actualResult type="variable">firstname</actualResult> + <expectedResult type="string">{{customer.firstName}}</expectedResult> + </assertEquals> + <assertEquals stepKey="assertLastName"> + <actualResult type="variable">lastname</actualResult> + <expectedResult type="string">{{customer.lastName}}</expectedResult> + </assertEquals> + <assertEquals stepKey="assertStreet"> + <actualResult type="variable">street</actualResult> + <expectedResult type="string">{{address.street[0]}}</expectedResult> + </assertEquals> + <assertEquals stepKey="assertCity"> + <actualResult type="variable">city</actualResult> + <expectedResult type="string">{{address.city}}</expectedResult> + </assertEquals> + <seeOptionIsSelected selector="{{CheckoutShippingSection.region}}" userInput="{{address.state}}" stepKey="assertRegion"/> + <seeOptionIsSelected selector="{{CheckoutShippingSection.country}}" userInput="{{address.country}}" stepKey="assertCountry"/> + <assertEquals stepKey="assertPostcode"> + <actualResult type="variable">postcode</actualResult> + <expectedResult type="string">{{address.postcode}}</expectedResult> + </assertEquals> + <assertEquals stepKey="assertTelephone"> + <actualResult type="variable">telephone</actualResult> + <expectedResult type="string">{{address.telephone}}</expectedResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShippingMethodInCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShippingMethodInCheckoutActionGroup.xml index 968ee8b46d0b..bb4853550e97 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShippingMethodInCheckoutActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShippingMethodInCheckoutActionGroup.xml @@ -16,7 +16,9 @@ <argument name="shippingMethod"/> </arguments> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <waitForPageLoad stepKey="waitForPageFullyLoaded"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.shippingMethodInformation}}" stepKey="waitForShippingMethodInformationVisible"/> <see userInput="{{shippingMethod}}" selector="{{CheckoutPaymentSection.shippingMethodInformation}}" stepKey="assertshippingMethodInformation"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickPlaceOrderActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickPlaceOrderActionGroup.xml index 079b89a879b7..f2fff4af4814 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickPlaceOrderActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickPlaceOrderActionGroup.xml @@ -15,6 +15,7 @@ <waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> + <waitForPageLoad stepKey="waitForCheckout"/> <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressWithCountryAndStateActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressWithCountryAndStateActionGroup.xml new file mode 100644 index 000000000000..cf3bfcc29a37 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressWithCountryAndStateActionGroup.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="FillGuestCheckoutShippingAddressWithCountryAndStateActionGroup" extends="FillGuestCheckoutShippingAddressFormActionGroup"> + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{customerAddress.country_id}}" after="SetCustomerCity" stepKey="selectCustomerCountry"/> + <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{customerAddress.state}}" after="selectCustomerCountry" stepKey="SetCustomerState"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionActionGroup.xml index f020cb42725c..b74ace4847dd 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionActionGroup.xml @@ -19,6 +19,7 @@ <argument name="shippingMethod" defaultValue="" type="string"/> </arguments> + <waitForElementVisible selector="{{CheckoutShippingSection.email}}" stepKey="waitForEmailField"/> <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customerVar.email}}" stepKey="enterEmail"/> <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddProductToCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddProductToCartActionGroup.xml index 8c1ef9d97329..2e0f1b8e97f3 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddProductToCartActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddProductToCartActionGroup.xml @@ -18,6 +18,7 @@ </arguments> <click selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="clickAddToCart"/> + <waitForPageLoad stepKey="waitForPageLoad"/> <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" stepKey="waitForSuccessMessage"/> <see selector="{{StorefrontProductPageSection.messagesBlock}}" userInput="You added {{product.name}} to your shopping cart." stepKey="assertSuccessMessage"/> <seeLink stepKey="assertLinkToShoppingCart" url="{{_ENV.MAGENTO_BASE_URL}}checkout/cart/" userInput="shopping cart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddSimpleProductToCartFromComparisonListActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddSimpleProductToCartFromComparisonListActionGroup.xml new file mode 100644 index 000000000000..0a4f37e783f7 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddSimpleProductToCartFromComparisonListActionGroup.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <!-- Add Product to Cart from the category page and check message --> + <actionGroup name="StorefrontAddSimpleProductToCartFromComparisonListActionGroup"> + <annotations> + <description>Add simple product from comparison page to the cart. Starts on products comparison page.</description> + </annotations> + <arguments> + <argument name="productName" type="string" defaultValue="{{SimpleProduct.name}}"/> + </arguments> + + <waitForElement selector="{{StorefrontProductCompareMainSection.ProductAddToCartButton(productName)}}" stepKey="waitForAddToCartButton"/> + <click selector="{{StorefrontProductCompareMainSection.ProductAddToCartButton(productName)}}" stepKey="clickAddToCartButton"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{productName}} to your shopping cart." stepKey="assertSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCartPageCheckMapMessagePresentAndClickableActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCartPageCheckMapMessagePresentAndClickableActionGroup.xml new file mode 100644 index 000000000000..5e70e1b096e3 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCartPageCheckMapMessagePresentAndClickableActionGroup.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + + <actionGroup name="StorefrontCartPageCheckMapMessagePresentAndClickableActionGroup"> + <annotations> + <description> + Assert that the MAP message is present on the product listing in the cart, and What's this? link is clickable and bring up the info popup. + </description> + </annotations> + <!-- Confirm that the MAP message and help link are visible --> + <see selector="{{StorefrontCartMapSection.mapNotice}}" userInput="See price before order confirmation." stepKey="seeMsrpNotice"/> + <see selector="{{StorefrontCartMapSection.mapWhatsThis}}" userInput="What's this?" stepKey="seeMsrpNoticeHelpLink"/> + <!-- Confirm that clicking on the 'What's this?' link shows the help popup --> + <click selector="{{StorefrontCartMapSection.mapWhatsThis}}" stepKey="clickOnWhatsThisLink"/> + <waitForElementVisible selector="{{StorefrontCartMapSection.mapWhatsThisPopup}}" stepKey="waitForTheInfoMessage"/> + <!-- Confirm that clicking on X button closes the popup --> + <click selector="{{StorefrontCartMapSection.mapWhatsThisPopupClose}}" stepKey="clickOnCloseInfoMessage"/> + <waitForElementNotVisible selector="{{StorefrontCartMapSection.mapWhatsThisPopup}}" stepKey="waitForTheInfoMessageToClose"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontFillNewShippingAddressFormInCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontFillNewShippingAddressFormInCheckoutActionGroup.xml new file mode 100644 index 000000000000..a0abbd4644b6 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontFillNewShippingAddressFormInCheckoutActionGroup.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontFillNewShippingAddressFormInCheckoutActionGroup"> + <annotations> + <description>Fills in the provided Address details in the New Address form on the Storefront Checkout pages. By default, this works for the Shipping Address but this can be used for Billing Addresses as well if you pass in the correct 'section' argument value</description> + </annotations> + <arguments> + <argument name="address"/> + <argument name="section" defaultValue="StorefrontCheckoutShippingNewAddressModalSection"/> + </arguments> + <fillField stepKey="fillFirstName" selector="{{section.firstName}}" userInput="{{address.firstname}}"/> + <fillField stepKey="fillLastName" selector="{{section.lastName}}" userInput="{{address.lastname}}"/> + <fillField stepKey="fillCompany" selector="{{section.company}}" userInput="{{address.company}}"/> + <fillField stepKey="fillStreetAddress" selector="{{section.street('0')}}" userInput="{{address.street[0]}}"/> + <selectOption stepKey="selectCounty" selector="{{section.country}}" userInput="{{address.country_id}}"/> + <selectOption stepKey="selectRegion" selector="{{section.region}}" userInput="{{address.state}}"/> + <fillField stepKey="fillCityName" selector="{{section.city}}" userInput="{{address.city}}"/> + <fillField stepKey="fillZip" selector="{{section.postcode}}" userInput="{{address.postcode}}"/> + <fillField stepKey="fillPhoneNumber" selector="{{section.telephone}}" userInput="{{address.telephone}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontGuestCheckoutProceedToPaymentStepActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontGuestCheckoutProceedToPaymentStepActionGroup.xml new file mode 100644 index 000000000000..a55db2b92e9c --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontGuestCheckoutProceedToPaymentStepActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontGuestCheckoutProceedToPaymentStepActionGroup"> + <annotations> + <description>Clicks next on Checkout Shipping step. Waits for Payment step</description> + </annotations> + + <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded" after="clickNext"/> + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/Data/CheckoutConfigData.xml b/app/code/Magento/Checkout/Test/Mftf/Data/CheckoutConfigData.xml index 13d9385101f1..ebc69f712238 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Data/CheckoutConfigData.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Data/CheckoutConfigData.xml @@ -32,4 +32,16 @@ <data key="label">No</data> <data key="value">0</data> </entity> -</entities> \ No newline at end of file + <entity name="EnableRedirectToShoppingCart"> + <data key="path">checkout/cart/redirect_to_cart</data> + <data key="scope_id">0</data> + <data key="label">Yes</data> + <data key="value">1</data> + </entity> + <entity name="DisableRedirectToShoppingCart"> + <data key="path">checkout/cart/redirect_to_cart</data> + <data key="scope_id">0</data> + <data key="label">No</data> + <data key="value">0</data> + </entity> +</entities> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutHeaderSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutHeaderSection.xml index 615db79b2ba6..13a08edaae33 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutHeaderSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutHeaderSection.xml @@ -7,7 +7,7 @@ --> <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="CheckoutHeaderSection"> - <element name="shippingMethodStep" type="text" selector=".opc-progress-bar-item:nth-of-type(1)"/> + <element name="shippingMethodStep" type="text" selector=".opc-progress-bar-item:nth-of-type(1)" timeout="30"/> <element name="reviewAndPaymentsStep" type="text" selector=".opc-progress-bar-item:nth-of-type(2)"/> <element name="errorMessageContainsText" type="text" selector="//div[contains(@class, 'message message-error error')]//div[contains(text(), '{{text}}')]" parameterized="true"/> </section> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml index 100567d503c7..4851e2f8c316 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml @@ -18,7 +18,7 @@ <element name="addressDropdown" type="select" selector="[name=billing_address_id]"/> <element name="addressDropdownSelected" type="select" selector="[name=billing_address_id] option:checked"/> <element name="placeOrderDisabled" type="button" selector="#checkout-payment-method-load button.disabled"/> - <element name="update" type="button" selector=".payment-method._active .payment-method-billing-address .action.action-update"/> + <element name="update" type="button" selector=".payment-method._active .payment-method-billing-address .action.action-update" timeout="30"/> <element name="guestFirstName" type="input" selector=".payment-method._active .billing-address-form input[name='firstname']"/> <element name="guestLastName" type="input" selector=".payment-method._active .billing-address-form input[name*='lastname']"/> <element name="guestStreet" type="input" selector=".payment-method._active .billing-address-form input[name*='street[0]']"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingGuestInfoSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingGuestInfoSection.xml index c39fab8a52e8..305d717ada27 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingGuestInfoSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingGuestInfoSection.xml @@ -26,7 +26,8 @@ <element name="shippingBlock" type="text" selector="#checkout-step-shipping"/> <!--Order Summary--> - <element name="itemInCart" type="button" selector="//div[@class='title']"/> + <element name="itemInCart" type="button" selector="div.items-in-cart div.title" timeout="30"/> + <element name="itemInCartActive" type="button" selector="div.items-in-cart.active div.title" timeout="30"/> <element name="productName" type="text" selector="//strong[@class='product-item-name']"/> </section> </sections> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingMethodsSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingMethodsSection.xml index 233cc539e08a..e4dd0fe367ca 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingMethodsSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingMethodsSection.xml @@ -21,5 +21,6 @@ <element name="freeShippingShippingMethod" type="input" selector="#s_method_freeshipping_freeshipping" timeout="30"/> <element name="noQuotesMsg" type="text" selector="#checkout-step-shipping_method div"/> <element name="price" type="text" selector="//*[@id='checkout-shipping-method-load']//td[@class='col col-price']"/> + <element name="shippingRatePriceByName" type="text" selector="//div[@id='checkout-shipping-method-load']//td[contains(., '{{var1}}')]/..//td//span[contains(@class, 'price')]" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml index a5eba8835e35..4b8b1745c16d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml @@ -45,5 +45,6 @@ <element name="addressFieldValidationError" type="text" selector="div.address div.field .field-error"/> <element name="textFieldAttrRequireMessage" type="text" selector="//input[@name='custom_attributes[{{attribute}}]']/ancestor::div[contains(@class, 'control')]/div/span" parameterized="true" timeout="30"/> <element name="textFieldAttribute" type="input" selector="[name*='custom_attributes[{{attribute}}]']" parameterized="true" timeout="30"/> + <element name="shippingAddressRequiredField" type="text" selector="//div[@id='shipping-new-address-form']//div[contains(@class, 'field _required') and contains(@name, 'shippingAddress.{{fieldName}}')]" parameterized="true" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCartMapSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCartMapSection.xml new file mode 100644 index 000000000000..35ff25cb0ded --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCartMapSection.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontCartMapSection"> + <element name="mapNotice" type="text" selector=".msrp.notice"/> + <element name="mapWhatsThis" type="text" selector=".msrp .action.help.map"/> + <element name="mapWhatsThisPopup" type="text" selector="//div[@id='map-popup-text-what-this']"/> + <element name="mapWhatsThisPopupClose" type="text" selector=".popup button.action.close"/> + </section> +</sections> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCheckoutShippingNewAddressModalSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCheckoutShippingNewAddressModalSection.xml new file mode 100644 index 000000000000..18071ff5fba4 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCheckoutShippingNewAddressModalSection.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontCheckoutShippingNewAddressModalSection"> + <element name="firstName" type="input" selector="//div[@id='shipping-new-address-form']//input[@name='firstname']"/> + <element name="lastName" type="input" selector="//div[@id='shipping-new-address-form']//input[@name='lastname']"/> + <element name="company" type="input" selector="//div[@id='shipping-new-address-form']//input[@name='company']"/> + <element name="street" type="input" parameterized="true" selector="//div[@id='shipping-new-address-form']//input[@name='street[{{index}}]']"/> + <element name="city" type="input" selector="//div[@id='shipping-new-address-form']//input[@name='city']"/> + <element name="region" type="select" selector="//div[@id='shipping-new-address-form']//select[@name='region_id']"/> + <element name="postcode" type="input" selector="//div[@id='shipping-new-address-form']//input[@name='postcode']"/> + <element name="country" type="select" selector="//div[@id='shipping-new-address-form']//select[@name='country_id']"/> + <element name="telephone" type="input" selector="//div[@id='shipping-new-address-form']//input[@name='telephone']"/> + <element name="saveAddress" type="button" selector="//div[@id='shipping-new-address-form']//button[contains(@class, 'action-save-address')]"/> + <element name="cancelChangeAddress" type="button" selector="//div[@id='shipping-new-address-form']//button[contains(@class, 'action-hide-popup')]"/> + </section> +</sections> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldForUKCustomerRemainOptionAfterRefreshTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldForUKCustomerRemainOptionAfterRefreshTest.xml index f43211e909cc..965732100ce3 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldForUKCustomerRemainOptionAfterRefreshTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldForUKCustomerRemainOptionAfterRefreshTest.xml @@ -8,17 +8,17 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AddressStateFieldForUKCustomerRemainOptionAfterRefreshTest"> + <test name="AddressStateFieldForUKCustomerRemainOptionAfterRefreshTest" deprecated="Use StorefrontAddressStateFieldForUKCustomerRemainOptionAfterRefreshTest instead"> <annotations> <features value="Checkout"/> <stories value="Guest checkout"/> - <title value="Address State Field For UK Customers Remain Option even After Browser Refresh"/> + <title value="DEPRECATED. Address State Field For UK Customers Remain Option even After Browser Refresh"/> <description value="Address State Field For UK Customers Remain Option even After Browser Refresh"/> <severity value="MAJOR"/> <testCaseId value="MAGETWO-93329"/> <group value="checkout"/> <skip> - <issueId value="MAGETWO-93726"/> + <issueId value="DEPRECATED">Use StorefrontAddressStateFieldForUKCustomerRemainOptionAfterRefreshTest instead</issueId> </skip> </annotations> <before> @@ -32,7 +32,7 @@ <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> </after> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldShouldNotAcceptJustIntegerValuesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldShouldNotAcceptJustIntegerValuesTest.xml index b825757636c0..eddb7d430387 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldShouldNotAcceptJustIntegerValuesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldShouldNotAcceptJustIntegerValuesTest.xml @@ -23,19 +23,15 @@ <createData entity="ApiSimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> </after> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml index ffbd6152af80..1a7e2255db35 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml @@ -67,8 +67,8 @@ <seeCheckboxIsChecked selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="freeShippingMethodCheckboxIsChecked"/> <!-- Click Next button --> - <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> - <waitForPageLoad stepKey="waitForShipmentPageLoad"/> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> <!-- Payment step is opened --> <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> @@ -88,10 +88,7 @@ <!-- Enable "Flat Rate" --> <actionGroup ref="AdminChangeFlatRateShippingMethodStatusActionGroup" stepKey="enableFlatRateShippingStatus"/> - <!-- Flush cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Back to the Checkout and refresh the page --> <switchToPreviousTab stepKey="switchToPreviousTab"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsGuestTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsGuestTest.xml index 3b15b9b4e044..b80476bb633e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsGuestTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsGuestTest.xml @@ -62,9 +62,9 @@ <!-- Checkout select Check/Money Order payment --> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> - <!--Click Place Order button--> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> + <!--Click Place Order button--> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoadSuccessPage"/> <!--See success messages--> <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsRegisterCustomerTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsRegisterCustomerTest.xml index 8836d54187cb..ff0365a2f686 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsRegisterCustomerTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsRegisterCustomerTest.xml @@ -71,8 +71,8 @@ <!-- Checkout select Check/Money Order payment --> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> <!--Click Place Order button--> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessTitle"/> <see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order number is: " stepKey="seeOrderNumber"/> <see selector="{{CheckoutSuccessMainSection.success}}" userInput="We'll email you an order confirmation with details and tracking info." stepKey="seeSuccessNotify"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml index 561e73bc24f6..57b3a9f071cc 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml @@ -39,7 +39,7 @@ </actionGroup> <!--Go to product page--> - <amOnPage url="{{StorefrontProductPage.url($$simpleProduct.name$$)}}" stepKey="amOnStorefrontProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$simpleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnStorefrontProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <!--Add product to cart--> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleFixedProductFromShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleFixedProductFromShoppingCartTest.xml index d1f452896c84..9958b12ceaf2 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleFixedProductFromShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleFixedProductFromShoppingCartTest.xml @@ -34,7 +34,7 @@ <requiredEntity createDataKey="createSimpleProduct"/> </createData> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> </before> <after> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/EditShippingAddressOnePageCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/EditShippingAddressOnePageCheckoutTest.xml index 9734a05d2cc0..d45fb9274454 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/EditShippingAddressOnePageCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/EditShippingAddressOnePageCheckoutTest.xml @@ -25,13 +25,8 @@ <requiredEntity createDataKey="createCategory"/> </createData> <createData entity="Simple_US_Customer_NY" stepKey="createCustomer"/> - <!--Clear cache and reindex--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> @@ -45,7 +40,7 @@ </actionGroup> <!-- Add product to cart --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <actionGroup ref="StorefrontAddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/NoErrorCartCheckoutForProductsDeletedFromMiniCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/NoErrorCartCheckoutForProductsDeletedFromMiniCartTest.xml index d269a666d975..a783da18b78d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/NoErrorCartCheckoutForProductsDeletedFromMiniCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/NoErrorCartCheckoutForProductsDeletedFromMiniCartTest.xml @@ -26,18 +26,14 @@ <field key="price">100.00</field> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> </after> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onStorefrontCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onStorefrontCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addProductToCart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml index 3d7f8e1dcfed..3b43ecfa6e8b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml @@ -69,14 +69,15 @@ <click selector="{{CheckoutShippingSection.shipHereButton(UK_Not_Default_Address.street[0])}}" stepKey="clickShipHere"/> <!-- Click next button to open payment section --> - <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> - <waitForPageLoad stepKey="waitForShipmentPageLoad"/> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> <!-- Select payment solution --> <checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution" /> <!-- Check order summary in checkout --> <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/> <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/> <seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml index e6734cf9257b..a508df5aad02 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml @@ -86,9 +86,9 @@ <waitForPageLoad stepKey="waitForAddressSaved"/> <!-- Place order --> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <waitForPageLoad stepKey="waitForCheckoutPaymentSectionPageLoad"/> - <seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCheckoutPaymentSectionPageLoad"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="orderIsSuccessfullyPlaced"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> <!-- Login as admin --> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml index 8fcb8211c462..42bec1546e40 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml @@ -64,8 +64,8 @@ <click selector="{{CheckoutShippingSection.shipHereButton(DE_Address_Berlin_Not_Default_Address.street[0])}}" stepKey="clickShipHere"/> <!-- Click next button to open payment section --> - <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> - <waitForPageLoad stepKey="waitForShipmentPageLoad"/> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> <uncheckOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution"/> <!-- Change the address --> @@ -79,9 +79,9 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <!-- Place order --> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <waitForPageLoad stepKey="waitForCheckoutPaymentSectionPageLoad"/> - <seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCheckoutPaymentSectionPageLoad"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="orderIsSuccessfullyPlaced"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonExistentCustomerGroupTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonExistentCustomerGroupTest.xml index 6b1d3a7ba66a..a8a5e4a4cc5e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonExistentCustomerGroupTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonExistentCustomerGroupTest.xml @@ -79,14 +79,15 @@ <click selector="{{CheckoutShippingSection.shipHereButton(UK_Not_Default_Address.street[0])}}" stepKey="clickShipHere"/> <!-- Click next button to open payment section --> - <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> - <waitForPageLoad stepKey="waitForShipmentPageLoad"/> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> <!-- Select payment solution --> <checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution" /> <!-- Check order summary in checkout --> <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/> <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/> <seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutCancelEditingBillingAddress.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutCancelEditingBillingAddress.xml new file mode 100644 index 000000000000..46947b869877 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutCancelEditingBillingAddress.xml @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="OnePageCheckoutCancelEditingBillingAddress"> + <annotations> + <features value="OnePageCheckout"/> + <stories value="MC-39581: Billing Address empty after going back and forth between shipping and payment step"/> + <title value="Billing Address empty after going back and forth between shipping and payment step"/> + <description value="Check billing address editing cancelation during checkout on the payment step"/> + <severity value="AVERAGE"/> + <group value="checkout"/> + </annotations> + <before> + <!-- Create Simple Product --> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"> + <field key="price">160</field> + </createData> + </before> + <after> + <!-- Delete created product --> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + </after> + + <!-- Add Simple Product to cart --> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> + <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> + <argument name="productName" value="$$createSimpleProduct.name$$"/> + </actionGroup> + + <!-- Navigate to checkout --> + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> + <!-- Fill shipping address --> + <actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping"> + <argument name="shippingMethod" value="Flat Rate"/> + </actionGroup> + + <!-- Change the address --> + + <waitForElementVisible selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="waitForElementToBeVisible"/> + <uncheckOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="uncheckSameBillingAndShippingAddress"/> + <conditionalClick selector="{{CheckoutShippingSection.editActiveAddressButton}}" dependentSelector="{{CheckoutShippingSection.editActiveAddressButton}}" visible="true" stepKey="clickEditButton"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + + <!-- Fill in New Billing Address --> + <actionGroup ref="StorefrontFillBillingAddressActionGroup" stepKey="fillBillingAddress"> + <argument name="address" value="US_Address_CA"/> + </actionGroup> + <selectOption selector="{{CheckoutPaymentSection.guestRegion}}" userInput="{{US_Address_CA.state}}" stepKey="selectRegion"/> + <click selector="{{CheckoutPaymentSection.update}}" stepKey="clickOnUpdateButton"/> + + + <!-- Edit Billing Address --> + <waitForElementVisible selector="{{CheckoutShippingSection.editAddressButton}}" stepKey="waitForEditBillingAddressButton"/> + <click selector="{{CheckoutShippingSection.editAddressButton}}" stepKey="clickOnEditButton"/> + <fillField selector="{{CheckoutPaymentSection.guestFirstName}}" userInput="" stepKey="enterEmptyFirstName"/> + <fillField selector="{{CheckoutPaymentSection.guestLastName}}" userInput="" stepKey="enterEmptyLastName"/> + + <!-- Cancel Editing Billing Address --> + <click selector="{{CheckoutHeaderSection.shippingMethodStep}}" stepKey="goToShipping"/> + <actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickOnNextButton"/> + + <!-- Place order --> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/> + <seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/> + </test> +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml index c7b1c441f197..b60a46d34844 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml @@ -63,14 +63,15 @@ </actionGroup> <!-- Click next button to open payment section --> - <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> - <waitForPageLoad stepKey="waitForShipmentPageLoad"/> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> <!-- Select payment solution --> <checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution" /> <!-- Check order summary in checkout --> <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/> <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/> <seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml index 73a2e4757e95..e3aec189bcd5 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml @@ -89,7 +89,7 @@ <createData entity="Simple_Customer_Without_Address" stepKey="createCustomer"/> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> </before> <after> @@ -187,8 +187,8 @@ <fillField selector="{{CheckoutShippingGuestInfoSection.telephone}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="fillPhone" /> <!-- Click next button to open payment section --> - <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNextBtn"/> - <waitForPageLoad stepKey="waitForShipmentPageLoad"/> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNextBtn"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> <!-- Check order summary in checkout --> <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml index 70faa3721efe..d809e3824e17 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml @@ -19,10 +19,7 @@ <group value="checkout"/> </annotations> <before> - <!-- Flush cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Create two customers --> <createData entity="Simple_US_Customer" stepKey="createFirstCustomer"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartWithoutAnySelectedOptionTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartWithoutAnySelectedOptionTest.xml index b65cfe0eb574..e360909d6d65 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartWithoutAnySelectedOptionTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartWithoutAnySelectedOptionTest.xml @@ -23,9 +23,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> <updateData createDataKey="createProduct" entity="productWithOptions" stepKey="updateProductWithCustomOptions"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml index 026f33b04f69..806e5e44591a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml @@ -28,9 +28,7 @@ <createData entity="_defaultProduct" stepKey="product"> <requiredEntity createDataKey="category"/> </createData> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> @@ -39,7 +37,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> </after> - <amOnPage url="$$product.name$$.html" stepKey="navigateToProductPage"/> + <amOnPage url="$$product.custom_attributes[url_key]$$.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPage"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$product.name$$"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml index 45f1df1237d0..a119cf4179ed 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml @@ -35,9 +35,7 @@ <createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRate"/> <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> <createData entity="MinimumOrderAmount90" stepKey="minimumOrderAmount90"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminCreateCartPriceRuleWithCouponCodeActionGroup" stepKey="createCartPriceRule"> <argument name="ruleName" value="CatPriceRule"/> <argument name="couponCode" value="CatPriceRule.coupon_code"/> @@ -45,7 +43,7 @@ <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStoreFront"> <argument name="Customer" value="$$createSimpleUsCustomer$$"/> </actionGroup> - <amOnPage url="$$simpleProduct.name$$.html" stepKey="navigateToProductPage"/> + <amOnPage url="$$simpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPage"/> </before> <after> @@ -54,10 +52,7 @@ <createData entity="DefaultShippingMethodsConfig" stepKey="defaultShippingMethodsConfig"/> <createData entity="DefaultMinimumOrderAmount" stepKey="defaultMinimumOrderAmount"/> <deleteData createDataKey="createSimpleUsCustomer" stepKey="deleteCustomer"/> - - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteCartPriceRule"> <argument name="ruleName" value="{{CatPriceRule.name}}"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAppliedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAppliedTest.xml index bc9dddf53ad0..c29e19275f75 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAppliedTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAppliedTest.xml @@ -32,9 +32,7 @@ <createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRate"/> <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> <createData entity="MinimumOrderAmount90" stepKey="minimumOrderAmount90"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" stepKey="deleteAllCartPriceRules"/> <actionGroup ref="AdminCreateCartPriceRuleWithCouponCodeActionGroup" stepKey="createCartPriceRule"> @@ -55,10 +53,7 @@ <createData entity="DefaultShippingMethodsConfig" stepKey="defaultShippingMethodsConfig"/> <createData entity="DefaultMinimumOrderAmount" stepKey="defaultMinimumOrderAmount"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> - - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" stepKey="deleteAllCartPriceRules"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml index 1f9948f80f39..9cddb6b648b6 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml @@ -30,7 +30,7 @@ </after> <!--Add product to cart--> - <amOnPage url="$$createProduct.name$$.html" stepKey="navigateToProductPage"/> + <amOnPage url="$$createProduct.custom_attributes[url_key]$$.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPage"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createProduct.name$$"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml index 714a06510952..678929ff228c 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml @@ -53,9 +53,7 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value="cataloginventory_stock"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartWithDisableMiniCartSidebarTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartWithDisableMiniCartSidebarTest.xml index edb6f8ba97b2..4038c14cc70d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartWithDisableMiniCartSidebarTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartWithDisableMiniCartSidebarTest.xml @@ -50,11 +50,9 @@ <requiredEntity createDataKey="simpleProduct2"/> </createData> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> @@ -115,9 +113,7 @@ <!--Enabled Mini Cart --> <magentoCLI stepKey="enableShoppingCartSidebar" command="config:set checkout/sidebar/display 1"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <reloadPage stepKey="reloadThePage"/> <!--Click on mini cart--> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml index 146ecde04701..699340e1694e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml @@ -110,12 +110,8 @@ <requiredEntity createDataKey="createConfigProduct"/> <requiredEntity createDataKey="createConfigChildProduct3"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteSimpleProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddDownloadableProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddDownloadableProductToShoppingCartTest.xml index 4f54363bd8dc..81377db2c17c 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddDownloadableProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddDownloadableProductToShoppingCartTest.xml @@ -28,12 +28,8 @@ <createData entity="downloadableLink2" stepKey="addDownloadableLink2"> <requiredEntity createDataKey="createDownloadableProduct"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove example.com static.magento.com"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddGroupedProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddGroupedProductToShoppingCartTest.xml index 13a179fe5244..ca62e7c58dfb 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddGroupedProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddGroupedProductToShoppingCartTest.xml @@ -43,9 +43,7 @@ <requiredEntity createDataKey="product"/> <requiredEntity createDataKey="simple3"/> </updateData> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simple1" stepKey="deleteProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml index cd6f4215adb5..a5ff1907efc2 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml @@ -47,11 +47,9 @@ <requiredEntity createDataKey="simpleProduct2"/> </createData> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml index 3a87bc88f937..a403f928229b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml @@ -23,9 +23,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> <updateData createDataKey="createProduct" entity="productWithOptions" stepKey="updateProductWithCustomOptions"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddSimpleProductToCartWithRedirectToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddSimpleProductToCartWithRedirectToShoppingCartTest.xml new file mode 100644 index 000000000000..6718a566d523 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddSimpleProductToCartWithRedirectToShoppingCartTest.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontAddSimpleProductToCartWithRedirectToShoppingCartTest"> + <annotations> + <stories value="Shopping Cart"/> + <features value="Checkout"/> + <title value="Add simple product to shopping cart with 'redirect to shopping cart' enabled."/> + <description value="Verify, user able add simple product to shopping cart from category page and compare products page when 'redirect to shopping cart' is enabled."/> + <testCaseId value="MC-41079"/> + <useCaseId value="MC-40983"/> + <severity value="CRITICAL"/> + <group value="shoppingCart"/> + <group value="checkout"/> + </annotations> + + <before> + <!--Enable redirect to shopping cart.--> + <magentoCLI command="config:set {{EnableRedirectToShoppingCart.path}} {{EnableRedirectToShoppingCart.value}}" stepKey="enableRedirectToShippingCart"/> + <!--Create test data.--> + <createData entity="_defaultCategory" stepKey="category"/> + <createData entity="SimpleProduct" stepKey="product"> + <requiredEntity createDataKey="category"/> + </createData> + </before> + <after> + <!--Disable redirect to shopping cart.--> + <magentoCLI command="config:set {{DisableRedirectToShoppingCart.path}} {{DisableRedirectToShoppingCart.value}}" stepKey="disableRedirectToShippingCart"/> + <!--Delete test data.--> + <deleteData createDataKey="product" stepKey="deleteSimpleProduct"/> + <deleteData createDataKey="category" stepKey="deleteCategory"/> + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> + </after> + + <!--Try to add simple product to shopping cart.--> + <actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryPage"> + <argument name="categoryUrl" value="$category.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="StorefrontAddSimpleProductToCartActionGroup" stepKey="addProductToCart"> + <argument name="product" value="$product$"/> + </actionGroup> + <seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="verifyCartRedirectAfterAddingProductFromCategoryPage"/> + <!-- Add product to compare list --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrl" value="$product.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addProductToCompare"> + <argument name="productVar" value="$product$"/> + </actionGroup> + <!--Try to add simple product to shopping cart from compare products page.--> + <actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="checkProductInComparisonList"> + <argument name="productVar" value="$product$"/> + </actionGroup> + <actionGroup ref="StorefrontAddSimpleProductToCartFromComparisonListActionGroup" stepKey="addProductToCartFromComparisonList"> + <argument name="productName" value="$product.name$"/> + </actionGroup> + <seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="verifyCartRedirectAfterAddingProductFromComparisonList"/> + </test> +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml index cd1c0542c5c5..feab5625c115 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml @@ -47,11 +47,9 @@ <requiredEntity createDataKey="simpleProduct2"/> </createData> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddressStateFieldForUKCustomerRemainOptionAfterRefreshTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddressStateFieldForUKCustomerRemainOptionAfterRefreshTest.xml new file mode 100644 index 000000000000..6b9c1f8f9b00 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddressStateFieldForUKCustomerRemainOptionAfterRefreshTest.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontAddressStateFieldForUKCustomerRemainOptionAfterRefreshTest"> + <annotations> + <features value="Checkout"/> + <stories value="Guest checkout"/> + <title value="Address State Field For UK Customers Remain Option even After Browser Refresh"/> + <description value="Address State Field For UK Customers Remain Option even After Browser Refresh"/> + <severity value="MAJOR"/> + <testCaseId value="MC-25694"/> + <group value="checkout"/> + </annotations> + <before> + <createData entity="simpleProductWithoutCategory" stepKey="createSimpleProduct"/> + </before> + <after> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> + </after> + <!--Step 1 Add simple product to the cart --> + <actionGroup ref="StorefrontAddSimpleProductToShoppingCartActionGroup" stepKey="addProductToCart"> + <argument name="product" value="$createSimpleProduct$"/> + </actionGroup> + + <!--Step 2 Proceed to Checkout and be on Shipping page --> + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckout"/> + + <!--Step 3 Select Country as United Kingdom and Refresh the page --> + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{UK_Address.country_id}}" stepKey="selectCounty"/> + <waitForPageLoad stepKey="waitFormToReload"/> + <actionGroup ref="ReloadPageActionGroup" stepKey="refreshPage"/> + <!-- Assert Selected Country is United States --> + <seeOptionIsSelected selector="{{CheckoutShippingSection.country}}" userInput="{{US_Address_TX.country}}" stepKey="selectedCountryIsUnitedStates"/> + + <!--Step 4 Select Country as United Kingdom, select address street and Refresh the page--> + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{UK_Address.country_id}}" stepKey="selectUnitedKingdomCounty"/> + <waitForPageLoad stepKey="waitFormToReloadAfterSelectCountry"/> + <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{UK_Address.street[0]}}" stepKey="enterAddressStreet"/> + <actionGroup ref="ReloadPageActionGroup" stepKey="refreshPageAfterAddressIsAdded"/> + <!-- Assert Entered details should be retained and State/Province field should be displayed as an optional field (without * ) --> + <seeOptionIsSelected selector="{{CheckoutShippingSection.country}}" userInput="{{UK_Address.country}}" stepKey="selectedCountryIsUnitedKingdom"/> + <seeInField selector="{{CheckoutShippingSection.street}}" userInput="{{UK_Address.street[0]}}" stepKey="seeAddressStreetUnitedKingdom"/> + <dontSeeElement selector="{{CheckoutShippingSection.shippingAddressRequiredField('region_id')}}" stepKey="assertStateProvinceIsNotRequired"/> + </test> +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndSummaryBlockItemDisplayWithDefaultDisplayLimitationTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndSummaryBlockItemDisplayWithDefaultDisplayLimitationTest.xml index 4c0484f88d54..6af6df2ea03f 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndSummaryBlockItemDisplayWithDefaultDisplayLimitationTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndSummaryBlockItemDisplayWithDefaultDisplayLimitationTest.xml @@ -51,9 +51,7 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct10"> <field key="price">100.00</field> </createData> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWhenMoreItemsAddedToTheCartThanDefaultDisplayLimitTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWhenMoreItemsAddedToTheCartThanDefaultDisplayLimitTest.xml index b399d76e86e2..e31db8ee28c7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWhenMoreItemsAddedToTheCartThanDefaultDisplayLimitTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWhenMoreItemsAddedToTheCartThanDefaultDisplayLimitTest.xml @@ -54,12 +54,8 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct11"> <field key="price">110.00</field> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWithDefaultDisplayLimitAndDefaultTotalQuantityTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWithDefaultDisplayLimitAndDefaultTotalQuantityTest.xml index e0aeb2f93d30..c68961c3e8c2 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWithDefaultDisplayLimitAndDefaultTotalQuantityTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWithDefaultDisplayLimitAndDefaultTotalQuantityTest.xml @@ -49,9 +49,7 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct10"> <field key="price">100.00</field> </createData> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckSimpleProductCartItemDisplayWithDefaultLimitationTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckSimpleProductCartItemDisplayWithDefaultLimitationTest.xml index ce6d46540838..ee32ce6d928a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckSimpleProductCartItemDisplayWithDefaultLimitationTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckSimpleProductCartItemDisplayWithDefaultLimitationTest.xml @@ -54,9 +54,7 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct11"> <field key="price">110.00</field> </createData> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckVirtualProductCountDisplayWithCustomDisplayConfigurationTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckVirtualProductCountDisplayWithCustomDisplayConfigurationTest.xml index c1dc0b7e62ba..f20a21da1496 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckVirtualProductCountDisplayWithCustomDisplayConfigurationTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckVirtualProductCountDisplayWithCustomDisplayConfigurationTest.xml @@ -34,9 +34,7 @@ <createData entity="VirtualProduct" stepKey="virtualProduct4"> <field key="price">40.00</field> </createData> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="virtualProduct1" stepKey="deleteProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml index 3aa93d72571f..743f4e016515 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml @@ -39,9 +39,7 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value=""/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!-- Delete category --> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml index 35328c58cdd4..33517a490fde 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml @@ -33,9 +33,7 @@ <argument name="price" value="Fixed"/> <argument name="amount" value="24.00"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set {{DisablePaymentBankTransferConfigData.path}} {{DisablePaymentBankTransferConfigData.value}}" stepKey="enableGuestCheckout"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithPurchaseOrderNumberTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithPurchaseOrderNumberTest.xml index 0b46bbdb7db6..c2dc47c006a1 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithPurchaseOrderNumberTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithPurchaseOrderNumberTest.xml @@ -55,8 +55,8 @@ </actionGroup> <!--Click Place Order button--> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <waitForPageLoad stepKey="waitForPageLoad"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad"/> <!--See success messages--> <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml index 646983eafcf0..1a85bb0bee1e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml @@ -90,12 +90,8 @@ <click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct1"/> <waitForPageLoad time='60' stepKey="waitForSpecialPriceProductSaved"/> <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSaveSuccessMessage1"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml index 05d24696197d..2dc99accba8f 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml @@ -45,7 +45,7 @@ </actionGroup> <!-- Add product to shopping cart --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/> <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="cartAddSimpleProductToCart"> <argument name="product" value="$$createSimpleProduct$$"/> <argument name="productCount" value="1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml index 535a3fb0c436..3b7bd1d662cb 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml @@ -23,9 +23,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> </before> <after> <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutStorefront"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithMultipleAddressesAndTaxRatesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithMultipleAddressesAndTaxRatesTest.xml index 396ba5894aeb..9a460c3fff8c 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithMultipleAddressesAndTaxRatesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithMultipleAddressesAndTaxRatesTest.xml @@ -42,13 +42,8 @@ <click stepKey="clickSave" selector="{{AdminStoresMainActionsSection.saveButton}}"/> - <!--TODO: REMOVE AFTER FIX MC-21717 --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value="full_page"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!-- Go to the tax rule page and delete the row we created--> @@ -80,7 +75,7 @@ <argument name="Customer" value="$$multiple_address_customer$$"/> </actionGroup> - <amOnPage url="{{StorefrontCategoryPage.url($$simplecategory.name$$)}}" stepKey="onCategoryPage1"/> + <amOnPage url="{{StorefrontCategoryPage.url($$simplecategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage1"/> <waitForPageLoad stepKey="waitForCatalogPageLoad1"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct1"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart1"/> @@ -99,7 +94,7 @@ <waitForPageLoad stepKey="waitForOrderSuccessPage1"/> <see stepKey="seeSuccessMessage1" selector="{{CheckoutSuccessMainSection.success}}" userInput="Your order number is:"/> - <amOnPage url="{{StorefrontCategoryPage.url($$simplecategory.name$$)}}" stepKey="onCategoryPage2"/> + <amOnPage url="{{StorefrontCategoryPage.url($$simplecategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage2"/> <waitForPageLoad stepKey="waitForCatalogPageLoad2"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct2"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart2"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithRestrictedCountriesForPaymentTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithRestrictedCountriesForPaymentTest.xml index 8325eeb0da7e..6a56f653698b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithRestrictedCountriesForPaymentTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithRestrictedCountriesForPaymentTest.xml @@ -27,13 +27,8 @@ <magentoCLI command="config:set payment/checkmo/specificcountry GB" stepKey="specificCountryValue"/> <createData entity="Simple_US_Customer" stepKey="simpleuscustomer"/> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> @@ -49,7 +44,7 @@ </actionGroup> <!-- Add product to cart --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml index 38060e34cbb7..e09c2a3af2f3 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml @@ -72,9 +72,9 @@ <!--Refresh Page and Place Order--> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> <reloadPage stepKey="reloadPage"/> - <waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPlaceOrderButton"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="orderIsSuccessfullyPlaced"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="grabOrderNumber"/> <!--Verify New addresses in Customer's Address Book--> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml index 6e304ff9cfb5..d289bdc0dc8d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml @@ -41,7 +41,7 @@ <requiredEntity createDataKey="simpleProduct1"/> </createData> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> </before> <after> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml index d012d44d8405..4d0196aebf4c 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml @@ -63,12 +63,8 @@ <requiredEntity createDataKey="createConfigProduct"/> <requiredEntity createDataKey="createConfigChildProduct1"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteSimpleProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml index d2bcaedb74fd..c2c7a3c6f663 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml @@ -27,12 +27,8 @@ <createData entity="downloadableLink1" stepKey="addDownloadableLink1"> <requiredEntity createDataKey="createDownloadableProduct"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove example.com static.magento.com"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml index 21966875519d..153d30b1e226 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml @@ -40,7 +40,7 @@ <argument name="product" value="$$simpleProduct$$"/> </actionGroup> <!-- Add virtual Product to the cart --> - <amOnPage url="{{StorefrontProductPage.url($$virtualProduct.name$$)}}" stepKey="amOnStorefrontVirtualProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$virtualProduct.custom_attributes[url_key]$$)}}" stepKey="amOnStorefrontVirtualProductPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$virtualProduct.name$$"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTest.xml index 4c9828d17ca1..da4a1b93691b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTest.xml @@ -23,13 +23,8 @@ <requiredEntity createDataKey="createCategory"/> </createData> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> @@ -37,7 +32,7 @@ <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> </after> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTestWithRestrictedCountriesForPaymentTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTestWithRestrictedCountriesForPaymentTest.xml index 7090b0d4fd3f..a393d6b42df4 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTestWithRestrictedCountriesForPaymentTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTestWithRestrictedCountriesForPaymentTest.xml @@ -24,12 +24,8 @@ </createData> <magentoCLI stepKey="allowSpecificValue" command="config:set payment/checkmo/allowspecific 1"/> <magentoCLI stepKey="specificCountryValue" command="config:set payment/checkmo/specificcountry GB"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> @@ -40,7 +36,7 @@ </after> <!-- Add product to cart --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml index c03f10c3b2f3..f22bcef1a19a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml @@ -93,9 +93,7 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value=""/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <actionGroup ref="AdminDeleteTaxRule" stepKey="deleteTaxRule"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithDifferentShippingAndBillingAddressWithRestrictedCountriesForPaymentTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithDifferentShippingAndBillingAddressWithRestrictedCountriesForPaymentTest.xml new file mode 100644 index 000000000000..ad4dbd0ab804 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithDifferentShippingAndBillingAddressWithRestrictedCountriesForPaymentTest.xml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontGuestCheckoutWithDifferentShippingAndBillingAddressWithRestrictedCountriesForPaymentTest"> + <annotations> + <features value="Checkout"/> + <stories value="Check payment methods on checkout"/> + <title value="Check payment methods update on checkout payment step"/> + <description value="Check that payment methods will update on checkout payment step after updating customer billing address"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-41743"/> + <useCaseId value="MC-37820"/> + <group value="checkout"/> + </annotations> + + <before> + <magentoCLI command="config:set {{BankTransferEnableConfigData.path}} {{BankTransferEnableConfigData.value}}" stepKey="enableBankTransfer"/> + <magentoCLI command="config:set payment/checkmo/allowspecific 1" stepKey="allowSpecificValue"/> + <magentoCLI command="config:set payment/checkmo/specificcountry GB" stepKey="allowBankTransferOnlyForGB"/> + <createData entity="SimpleProduct2" stepKey="createProduct"/> + </before> + + <after> + <magentoCLI command="config:set {{BankTransferDisabledConfigData.path}} {{BankTransferDisabledConfigData.value}}" stepKey="disableBankTransfer"/> + <magentoCLI command="config:set payment/checkmo/allowspecific 0" stepKey="disallowSpecificValue" /> + <magentoCLI command="config:set payment/checkmo/specificcountry ''" stepKey="defaultCountryValue"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + </after> + + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> + <argument name="productName" value="$createProduct.name$"/> + </actionGroup> + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> + <actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="fillShippingSectionAsGuest"> + <argument name="customerVar" value="CustomerEntityOne"/> + <argument name="customerAddressVar" value="CustomerAddressSimple"/> + </actionGroup> + <dontSee selector="{{CheckoutPaymentSection.paymentMethodTitle}}" userInput="Check / Money order" stepKey="assertNoCheckMoneyOrderPaymentMethod"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.billingAddressNotSameBankTransferCheckbox}}" stepKey="waitForBillingAddressNotSameAsShippingCheckbox"/> + <uncheckOption selector="{{CheckoutPaymentSection.billingAddressNotSameBankTransferCheckbox}}" stepKey="uncheckSameBillingAndShippingAddress"/> + <conditionalClick selector="{{CheckoutPaymentSection.editAddress}}" dependentSelector="{{CheckoutShippingSection.editAddressButton}}" visible="true" stepKey="clickEditBillingAddressButton"/> + <waitForLoadingMaskToDisappear stepKey="waitForBillingAddressFormLoads"/> + + <!-- Fill Billing Address --> + <actionGroup ref="StorefrontFillBillingAddressActionGroup" stepKey="fillBillingAddress"/> + <click selector="{{CheckoutPaymentSection.update}}" stepKey="clickOnUpdateButton"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear" /> + <see selector="{{CheckoutPaymentSection.paymentMethodTitle}}" userInput="Check / Money order" stepKey="sdadasdasdsdaasd"/> + </test> +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutDataWhenChangeQtyTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutDataWhenChangeQtyTest.xml index 321511e4e86d..502a564a22ff 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutDataWhenChangeQtyTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutDataWhenChangeQtyTest.xml @@ -30,7 +30,7 @@ </after> <!--Add product to cart and checkout--> - <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$createProduct.name$$"/> @@ -65,10 +65,10 @@ <!--Go to cart page, update qty and proceed to checkout--> <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCartPage"/> <see userInput="Shopping Cart" stepKey="seeCartPageIsOpened"/> - <fillField selector="{{CheckoutCartProductSection.qty($$createProduct.name$$)}}" userInput="2" stepKey="updateProductQty"/> + <fillField selector="{{CheckoutCartProductSection.qty($$createProduct.sku$$)}}" userInput="2" stepKey="updateProductQty"/> <click selector="{{CheckoutCartProductSection.updateShoppingCartButton}}" stepKey="clickUpdateShoppingCart"/> <waitForAjaxLoad stepKey="waitForAjaxLoad"/> - <grabValueFrom selector="{{CheckoutCartProductSection.qty($$createProduct.name$$)}}" stepKey="grabQty"/> + <grabValueFrom selector="{{CheckoutCartProductSection.qty($$createProduct.sku$$)}}" stepKey="grabQty"/> <assertEquals stepKey="assertQty"> <actualResult type="const">$grabQty</actualResult> <expectedResult type="const">2</expectedResult> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml index 91086a4b3788..caba8a9f0f49 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml @@ -15,7 +15,7 @@ <title value="Checking Product name in Minicart and on Checkout page with different store views"/> <description value="Checking Product name in Minicart and on Checkout page with different store views"/> <severity value="MAJOR"/> - <testCaseId value="MAGETWO-96466"/> + <testCaseId value="MC-28566"/> <useCaseId value="MAGETWO-96421"/> <group value="checkout"/> </annotations> @@ -31,6 +31,7 @@ <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView"> <argument name="customStore" value="customStore"/> </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> @@ -56,7 +57,7 @@ <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/> <!--Add product to cart--> - <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$createProduct.name$$"/> @@ -95,8 +96,8 @@ <!--Proceed to checkout and check product name in Order Summary area--> <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="proceedToCheckout"/> - <comment userInput="Adding the comment to replace waitForShippingPageLoad action for preserving Backward Compatibility" stepKey="waitForShippingPageLoad"/> - <click selector="{{CheckoutShippingGuestInfoSection.itemInCart}}" stepKey="clickItemInCart"/> + <waitForElementVisible selector="{{CheckoutShippingSection.email}}" stepKey="waitForShippingPageLoad"/> + <conditionalClick selector="{{CheckoutShippingGuestInfoSection.itemInCart}}" dependentSelector="{{CheckoutShippingGuestInfoSection.itemInCartActive}}" visible="false" stepKey="clickItemInCart"/> <grabTextFrom selector="{{CheckoutShippingGuestInfoSection.productName}}" stepKey="grabProductNameShipping"/> <assertStringContainsString stepKey="assertProductNameShipping"> <actualResult type="const">$grabProductNameShipping</actualResult> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml index f014a7a5bd1e..dc926b6e7b37 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml @@ -30,9 +30,7 @@ <after> <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> <actionGroup ref="SetCustomerDataLifetimeActionGroup" stepKey="setDefaultCustomerDataLifetime"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexCustomerGrid"> - <argument name="indices" value="customer_grid"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexCustomerGrid"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <!--Go to product page--> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifyGuestCheckoutUsingFreeShippingAndTaxesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifyGuestCheckoutUsingFreeShippingAndTaxesTest.xml index 38cc4fe8abcf..fed40f39d612 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifyGuestCheckoutUsingFreeShippingAndTaxesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifyGuestCheckoutUsingFreeShippingAndTaxesTest.xml @@ -83,11 +83,9 @@ </createData> <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifyMapMessagePopupOnCartViewPageTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifyMapMessagePopupOnCartViewPageTest.xml new file mode 100644 index 000000000000..257f0104d9f8 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifyMapMessagePopupOnCartViewPageTest.xml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontVerifyMapMessagePopupOnCartViewPageTest"> + <annotations> + <stories value="Shopping Cart"/> + <features value="Checkout"/> + <title value="Minimum Advertised Price 'What's this?' popup does not displays in cart"/> + <description value="When Minimum Advertised Price (MAP) is enabled and the product has MAP set in Advanced Pricing, click on 'What's this?' at the product listing in the shopping cart must display the popup with the info message."/> + <testCaseId value="MC-41596"/> + <useCaseId value="MC-41494"/> + <severity value="MAJOR"/> + <group value="shoppingCart"/> + <group value="checkout"/> + </annotations> + <before> + <!-- Enable MAP functionality in Magento Instance --> + <createData entity="MsrpEnableMAP" stepKey="enableMAP"/> + <!-- Create product and category --> + <createData entity="_defaultCategory" stepKey="category"/> + <createData entity="SimpleProduct" stepKey="product"> + <requiredEntity createDataKey="category"/> + </createData> + </before> + <after> + <!-- Disable MAP functionality in Magento Instance --> + <createData entity="MsrpDisableMAP" stepKey="disableMAP"/> + <!-- Delete product and category --> + <deleteData createDataKey="product" stepKey="deleteSimpleProduct"/> + <deleteData createDataKey="category" stepKey="deleteCategory"/> + </after> + + <!-- Add MAP to the newly created product Advanced Pricing --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openAdminProductEditPage"> + <argument name="productId" value="$$product.id$$"/> + </actionGroup> + <actionGroup ref="AdminAddMinimumAdvertisedPriceActionGroup" stepKey="setMapToCreatedProduct"> + <argument name="msrpData" value="MsrpBeforeOrderConfirmation"/> + </actionGroup> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAdmin"/> + + <!--Adding the newly created product to shopping cart.--> + <actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryPageOnFrontEnd"> + <argument name="categoryUrl" value="$category.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="StorefrontAddSimpleProductToCartActionGroup" stepKey="addProductToCart"> + <argument name="product" value="$product$"/> + </actionGroup> + + <!-- Navigate to the cart edit page --> + <actionGroup ref="clickViewAndEditCartFromMiniCartActionGroup" stepKey="goToCartViewAndEditPage"/> + + <!-- Check if MAP message and link are present and functioning --> + <actionGroup ref="StorefrontCartPageCheckMapMessagePresentAndClickableActionGroup" stepKey="checkFormMapFunctioning"/> + </test> +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifySecureURLRedirectCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifySecureURLRedirectCheckoutTest.xml index 7465ab6aa69e..901c5c3598db 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifySecureURLRedirectCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifySecureURLRedirectCheckoutTest.xml @@ -25,7 +25,7 @@ <createData entity="_defaultProduct" stepKey="product"> <requiredEntity createDataKey="category"/> </createData> - <amOnPage url="{{StorefrontCategoryPage.url($$category.name$$)}}" stepKey="goToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$category.custom_attributes[url_key]$$)}}" stepKey="goToCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="moveMouseOverProduct"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="clickAddToCartButton"/> @@ -35,15 +35,11 @@ <executeJS function="return window.location.host" stepKey="hostname"/> <magentoCLI command="config:set web/secure/base_url https://{$hostname}/" stepKey="setSecureBaseURL"/> <magentoCLI command="config:set web/secure/use_in_frontend 1" stepKey="useSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set web/secure/use_in_frontend 0" stepKey="dontUseSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <deleteData createDataKey="product" stepKey="deleteProduct"/> <deleteData createDataKey="category" stepKey="deleteCategory"/> </after> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml index f38061dbf6a6..d4e473466c94 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml @@ -79,8 +79,8 @@ <waitForPageLoad stepKey="WaitForDiscountToBeAdded"/> <see userInput="Your coupon was successfully applied." stepKey="verifyText"/> - <waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPlaceOrderButton"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> <!--Proceed to Admin panel > SALES > Orders. Created order should be in Processing status--> diff --git a/app/code/Magento/Checkout/Test/Unit/Block/CartTest.php b/app/code/Magento/Checkout/Test/Unit/Block/CartTest.php new file mode 100644 index 000000000000..2937eed39652 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Unit/Block/CartTest.php @@ -0,0 +1,74 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Checkout\Test\Unit\Block; + +use Magento\Checkout\Block\Cart; +use Magento\Checkout\Model\Session; +use Magento\Framework\Escaper; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\View\Element\Template\Context; +use Magento\Framework\View\LayoutInterface; +use Magento\Quote\Model\Quote; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class CartTest extends TestCase +{ + + /** + * @var Cart + */ + private $cartBlock; + + /** + * @var Escaper|MockObject + */ + private $escaper; + + /** @var Cart|MockObject */ + private $context; + + /** @var LayoutInterface|MockObject */ + private $layoutMock; + + protected function setUp(): void + { + $objectManager = new ObjectManager($this); + $this->context = $this->createPartialMock(Context::class, ['getEscaper', 'getLayout']); + $quoteMock = $this->createMock(Quote::class); + $checkoutSession = $this->createMock(Session::class); + $this->layoutMock = $this->createMock(LayoutInterface::class); + $this->escaper = $objectManager->getObject(Escaper::class); + $quoteMock->expects($this->once())->method('getAllVisibleItems')->willReturn([]); + $checkoutSession->expects($this->any())->method('getQuote')->willReturn($quoteMock); + $this->context->expects($this->once())->method('getEscaper')->willReturn($this->escaper); + $this->context->expects($this->once())->method('getLayout')->willReturn($this->layoutMock); + + /** @var $cartBlock Cart */ + $this->cartBlock = $objectManager->getObject( + Cart::class, + [ + 'context'=> $this->context, + 'checkoutSession'=>$checkoutSession, + + ] + ); + } + + public function testGetMethodHtmlWithException() + { + $this->layoutMock->expects($this->any())->method('getBlock')->willReturn(false); + $name='blockMethod'; + $this->expectException(LocalizedException::class); + $this->expectExceptionMessage( + (string)__('Invalid method: %1', $name) + ); + $this->cartBlock->getMethodHtml($name); + } +} diff --git a/app/code/Magento/Checkout/Test/Unit/Controller/Sidebar/UpdateItemQtyTest.php b/app/code/Magento/Checkout/Test/Unit/Controller/Sidebar/UpdateItemQtyTest.php index 47f43c8580e2..c100571e1086 100644 --- a/app/code/Magento/Checkout/Test/Unit/Controller/Sidebar/UpdateItemQtyTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Controller/Sidebar/UpdateItemQtyTest.php @@ -8,6 +8,7 @@ namespace Magento\Checkout\Test\Unit\Controller\Sidebar; use Magento\Checkout\Controller\Sidebar\UpdateItemQty; +use Magento\Checkout\Model\Cart\RequestQuantityProcessor; use Magento\Checkout\Model\Sidebar; use Magento\Framework\App\RequestInterface; use Magento\Framework\App\ResponseInterface; @@ -41,11 +42,15 @@ class UpdateItemQtyTest extends TestCase /** @var ResponseInterface|MockObject */ protected $responseMock; + /** @var RequestQuantityProcessor|MockObject */ + private $quantityProcessor; + protected function setUp(): void { $this->sidebarMock = $this->createMock(Sidebar::class); $this->loggerMock = $this->getMockForAbstractClass(LoggerInterface::class); $this->jsonHelperMock = $this->createMock(Data::class); + $this->quantityProcessor = $this->createMock(RequestQuantityProcessor::class); $this->requestMock = $this->getMockForAbstractClass(RequestInterface::class); $this->responseMock = $this->getMockForAbstractClass( ResponseInterface::class, @@ -64,6 +69,7 @@ protected function setUp(): void 'sidebar' => $this->sidebarMock, 'logger' => $this->loggerMock, 'jsonHelper' => $this->jsonHelperMock, + 'quantityProcessor' => $this->quantityProcessor, 'request' => $this->requestMock, 'response' => $this->responseMock, ] @@ -115,6 +121,11 @@ public function testExecute() ) ->willReturn('json encoded'); + $this->quantityProcessor->expects($this->once()) + ->method('prepareQuantity') + ->with(2) + ->willReturn(2); + $this->responseMock->expects($this->once()) ->method('representJson') ->with('json encoded') diff --git a/app/code/Magento/Checkout/Test/Unit/Model/Cart/ImageProviderTest.php b/app/code/Magento/Checkout/Test/Unit/Model/Cart/ImageProviderTest.php index 71578131ad26..f97dc2ecf8d0 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/Cart/ImageProviderTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/Cart/ImageProviderTest.php @@ -37,6 +37,16 @@ class ImageProviderTest extends TestCase */ private $customerItem; + /** + * @var MockObject|\Magento\Catalog\Helper\Image + */ + private $imageHelper; + + /** + * @var MockObject|\Magento\Catalog\Model\Product\Configuration\Item\ItemResolverInterface + */ + private $itemResolver; + protected function setUp(): void { $this->itemRepositoryMock = $this->getMockForAbstractClass(CartItemRepositoryInterface::class); @@ -44,10 +54,18 @@ protected function setUp(): void $this->customerItem = $this->getMockBuilder(DefaultItem::class) ->disableOriginalConstructor() ->getMock(); + $this->imageHelper = $this->getMockBuilder(\Magento\Catalog\Helper\Image::class) + ->disableOriginalConstructor() + ->getMock(); + $this->itemResolver = $this->getMockForAbstractClass( + \Magento\Catalog\Model\Product\Configuration\Item\ItemResolverInterface::class + ); $this->model = new ImageProvider( $this->itemRepositoryMock, $this->itemPoolMock, - $this->customerItem + $this->customerItem, + $this->imageHelper, + $this->itemResolver ); } @@ -55,14 +73,23 @@ public function testGetImages() { $cartId = 42; $itemId = 74; - $itemData = ['product_image' => 'Magento.png', 'random' => '3.1415926535']; + $itemData = [ + 'src' => 'Url', + 'alt' => 'Label', + 'width' => 'Width', + 'height' => 'Height' + ]; $itemMock = $this->createMock(Item::class); $itemMock->expects($this->once())->method('getItemId')->willReturn($itemId); - $expectedResult = [$itemId => $itemData['product_image']]; + $expectedResult = [$itemId => $itemData]; $this->itemRepositoryMock->expects($this->once())->method('getList')->with($cartId)->willReturn([$itemMock]); - $this->customerItem->expects($this->once())->method('getItemData')->with($itemMock)->willReturn($itemData); + $this->imageHelper->expects($this->once())->method('init')->willReturnSelf(); + $this->imageHelper->expects($this->once())->method('getUrl')->willReturn('Url'); + $this->imageHelper->expects($this->once())->method('getLabel')->willReturn('Label'); + $this->imageHelper->expects($this->once())->method('getWidth')->willReturn('Width'); + $this->imageHelper->expects($this->once())->method('getHeight')->willReturn('Height'); $this->assertEquals($expectedResult, $this->model->getImages($cartId)); } diff --git a/app/code/Magento/Checkout/Test/Unit/Model/Cart/RequestQuantityProcessorTest.php b/app/code/Magento/Checkout/Test/Unit/Model/Cart/RequestQuantityProcessorTest.php index e536d5e286a1..acd97fbc11bd 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/Cart/RequestQuantityProcessorTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/Cart/RequestQuantityProcessorTest.php @@ -28,24 +28,24 @@ protected function setUp(): void { $this->localeResolver = $this->getMockBuilder(ResolverInterface::class) ->getMockForAbstractClass(); - - $this->localeResolver->method('getLocale') - ->willReturn('en_US'); - - $this->requestProcessor = new RequestQuantityProcessor( - $this->localeResolver - ); } /** * Test of cart data processing. * * @param array $cartData + * @param string $locale * @param array $expected * @dataProvider cartDataProvider */ - public function testProcess($cartData, $expected) + public function testProcess(array $cartData, string $locale, array $expected): void { + $this->localeResolver->method('getLocale') + ->willReturn($locale); + $this->requestProcessor = new RequestQuantityProcessor( + $this->localeResolver + ); + $this->assertEquals($this->requestProcessor->process($cartData), $expected); } @@ -57,6 +57,7 @@ public function cartDataProvider() return [ 'empty_array' => [ 'cartData' => [], + 'locale' => 'en_US', 'expected' => [], ], 'strings_array' => [ @@ -64,6 +65,7 @@ public function cartDataProvider() ['qty' => ' 10 '], ['qty' => ' 0.5 '] ], + 'locale' => 'en_US', 'expected' => [ ['qty' => 10], ['qty' => 0.5] @@ -74,6 +76,7 @@ public function cartDataProvider() ['qty' => 1], ['qty' => 0.002] ], + 'locale' => 'en_US', 'expected' => [ ['qty' => 1], ['qty' => 0.002] @@ -83,10 +86,22 @@ public function cartDataProvider() 'cartData' => [ ['qty' => [1, 2 ,3]], ], + 'locale' => 'en_US', 'expected' => [ ['qty' => [1, 2, 3]], ], ], + 'strings_array_spain_locale' => [ + 'cartData' => [ + ['qty' => ' 10 '], + ['qty' => ' 0.5 '] + ], + 'locale' => 'es_CL', + 'expected' => [ + ['qty' => 10], + ['qty' => 0.5] + ], + ], ]; } } diff --git a/app/code/Magento/Checkout/Test/Unit/Model/DefaultConfigProviderTest.php b/app/code/Magento/Checkout/Test/Unit/Model/DefaultConfigProviderTest.php new file mode 100644 index 000000000000..401e4a03f4ca --- /dev/null +++ b/app/code/Magento/Checkout/Test/Unit/Model/DefaultConfigProviderTest.php @@ -0,0 +1,298 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Checkout\Test\Unit\Model; + +use Magento\Captcha\Api\CaptchaConfigPostProcessorInterface; +use Magento\Catalog\Helper\Image; +use Magento\Catalog\Helper\Product\ConfigurationPool; +use Magento\Checkout\Helper\Data as CheckoutHelper; +use Magento\Checkout\Model\Cart\ImageProvider; +use Magento\Checkout\Model\DefaultConfigProvider; +use Magento\Checkout\Model\Session as CheckoutSession; +use Magento\Customer\Api\AddressMetadataInterface; +use Magento\Customer\Api\CustomerRepositoryInterface as CustomerRepository; +use Magento\Customer\Api\Data\AttributeMetadataInterface; +use Magento\Customer\Model\Address\CustomerAddressDataProvider; +use Magento\Customer\Model\Address\Mapper; +use Magento\Customer\Model\Session as CustomerSession; +use Magento\Customer\Model\Url as CustomerUrlManager; +use Magento\Directory\Helper\Data; +use Magento\Directory\Model\Country\Postcode\ConfigInterface; +use Magento\Eav\Api\AttributeOptionManagementInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\Http\Context as HttpContext; +use Magento\Framework\Data\Form\FormKey; +use Magento\Framework\Locale\FormatInterface as LocaleFormat; +use Magento\Framework\UrlInterface; +use Magento\Quote\Api\CartItemRepositoryInterface as QuoteItemRepository; +use Magento\Quote\Api\CartRepositoryInterface; +use Magento\Quote\Api\CartTotalRepositoryInterface; +use Magento\Quote\Api\Data\TotalsInterface; +use Magento\Quote\Api\PaymentMethodManagementInterface; +use Magento\Quote\Api\ShippingMethodManagementInterface as ShippingMethodManager; +use Magento\Quote\Model\Quote; +use Magento\Quote\Model\Quote\Address; +use Magento\Quote\Model\QuoteIdMaskFactory; +use Magento\Shipping\Model\Config; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class DefaultConfigProviderTest extends TestCase +{ + /** + * @var DefaultConfigProvider + */ + private $model; + + /** + * @var CheckoutSession|MockObject + */ + private $checkoutSession; + + /** + * @var ShippingMethodManager|MockObject + */ + private $shippingMethodManager; + + /** + * @var AddressMetadataInterface|MockObject + */ + private $addressMetadata; + + /** + * @var CartTotalRepositoryInterface|MockObject + */ + private $cartTotalRepository; + + /** + * @var Config|MockObject + */ + private $shippingMethodConfig; + + /** + * @var CaptchaConfigPostProcessorInterface|MockObject + */ + private $configPostProcessor; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $checkoutHelper = $this->createMock(CheckoutHelper::class); + $this->checkoutSession = $this->createMock(CheckoutSession::class); + $customerRepository = $this->createMock(CustomerRepository::class); + $customerSession = $this->createMock(CustomerSession::class); + $customerUrlManager = $this->createMock(CustomerUrlManager::class); + $httpContext = $this->createMock(HttpContext::class); + $quoteRepository = $this->createMock(CartRepositoryInterface::class); + $quoteItemRepository = $this->createMock(QuoteItemRepository::class); + $this->shippingMethodManager = $this->getMockBuilder(ShippingMethodManager::class) + ->addMethods(['get']) + ->getMockForAbstractClass(); + $configurationPool = $this->createMock(ConfigurationPool::class); + $quoteIdMaskFactory = $this->createMock(QuoteIdMaskFactory::class); + $localeFormat = $this->createMock(LocaleFormat::class); + $addressMapper = $this->createMock(Mapper::class); + $addressConfig = $this->createMock(\Magento\Customer\Model\Address\Config::class); + $formKey = $this->createMock(FormKey::class); + $imageHelper = $this->createMock(Image::class); + $viewConfig = $this->createMock(\Magento\Framework\View\ConfigInterface::class); + $postCodesConfig = $this->createMock(ConfigInterface::class); + $imageProvider = $this->createMock(ImageProvider::class); + $directoryHelper = $this->createMock(Data::class); + $this->cartTotalRepository = $this->createMock(CartTotalRepositoryInterface::class); + $scopeConfig = $this->createMock(ScopeConfigInterface::class); + $this->shippingMethodConfig = $this->createMock(Config::class); + $storeManager = $this->createMock(StoreManagerInterface::class); + $paymentMethodManagement = $this->createMock(PaymentMethodManagementInterface::class); + $urlBuilder = $this->createMock(UrlInterface::class); + $this->configPostProcessor = $this->createMock(CaptchaConfigPostProcessorInterface::class); + $this->addressMetadata = $this->createMock(AddressMetadataInterface::class); + $attributeOptionManager = $this->createMock(AttributeOptionManagementInterface::class); + $customerAddressData = $this->createMock(CustomerAddressDataProvider::class); + $this->model = new DefaultConfigProvider( + $checkoutHelper, + $this->checkoutSession, + $customerRepository, + $customerSession, + $customerUrlManager, + $httpContext, + $quoteRepository, + $quoteItemRepository, + $this->shippingMethodManager, + $configurationPool, + $quoteIdMaskFactory, + $localeFormat, + $addressMapper, + $addressConfig, + $formKey, + $imageHelper, + $viewConfig, + $postCodesConfig, + $imageProvider, + $directoryHelper, + $this->cartTotalRepository, + $scopeConfig, + $this->shippingMethodConfig, + $storeManager, + $paymentMethodManagement, + $urlBuilder, + $this->configPostProcessor, + $this->addressMetadata, + $attributeOptionManager, + $customerAddressData + ); + } + + /** + * @param array $shippingAddressData + * @param array $billingAddressData + * @param array $expected + * @dataProvider getConfigQuoteAddressDataDataProvider + */ + public function testGetConfigQuoteAddressData( + array $shippingAddressData, + array $billingAddressData, + array $expected + ): void { + $shippingAddressData['email'] = 'john.doe@example.com'; + $billingAddressData['email'] = 'john.doe@example.com'; + $keys = [ + 'isShippingAddressFromDataValid', + 'shippingAddressFromData', + 'isBillingAddressFromDataValid', + 'billingAddressFromData', + ]; + $quote = $this->createMock(Quote::class); + $shippingAddress = $this->getMockBuilder(Address::class) + ->disableOriginalConstructor() + ->onlyMethods(['validate']) + ->getMockForAbstractClass(); + $shippingAddress->addData($shippingAddressData); + $shippingAddress->method('validate') + ->willReturn(!empty($shippingAddress['firstname'])); + $billingAddress = $this->getMockBuilder(Address::class) + ->disableOriginalConstructor() + ->onlyMethods(['validate']) + ->getMockForAbstractClass(); + $billingAddress->addData($billingAddressData); + $billingAddress->method('validate') + ->willReturn(!empty($shippingAddress['firstname'])); + $quote->method('getShippingAddress') + ->willReturn($shippingAddress); + $quote->method('getBillingAddress') + ->willReturn($billingAddress); + $quote->method('getStore') + ->willReturn($this->createMock(Store::class)); + $this->checkoutSession->expects($this->atLeast(1)) + ->method('getQuote') + ->willReturn($quote); + + $attributeMetadata1 = $this->createMock(AttributeMetadataInterface::class); + $attributeMetadata1->method('isVisible') + ->willReturn(true); + $attributeMetadata1->method('getAttributeCode') + ->willReturn('firstname'); + + $attributeMetadata2 = $this->createMock(AttributeMetadataInterface::class); + $attributeMetadata2->method('isVisible') + ->willReturn(true); + $attributeMetadata2->method('getAttributeCode') + ->willReturn('lastname'); + + $this->addressMetadata->method('getAllAttributesMetadata') + ->willReturn([$attributeMetadata1, $attributeMetadata2]); + + $totals = $this->getMockBuilder(TotalsInterface::class) + ->addMethods(['toArray']) + ->getMockForAbstractClass(); + $totals->method('getItems') + ->willReturn([]); + $totals->method('getTotalSegments') + ->willReturn([]); + $this->cartTotalRepository->method('get') + ->willReturn($totals); + $this->shippingMethodConfig->method('getActiveCarriers') + ->willReturn([]); + $this->configPostProcessor->method('process') + ->willReturnArgument(0); + $actual = array_intersect_key($this->model->getConfig(), array_flip($keys)); + $this->assertEquals($expected, $actual); + } + + /** + * @return array + */ + public function getConfigQuoteAddressDataDataProvider(): array + { + return [ + [ + [], + [], + [] + ], + [ + [ + 'firstname' => 'John' + ], + [ + 'firstname' => 'Jack' + ], + [ + 'isShippingAddressFromDataValid' => true, + 'shippingAddressFromData' => [ + 'firstname' => 'John' + ], + 'isBillingAddressFromDataValid' => true, + 'billingAddressFromData' => [ + 'firstname' => 'Jack' + ] + ] + ], + [ + [ + 'lastname' => 'John' + ], + [ + 'lastname' => 'Jack' + ], + [ + 'isShippingAddressFromDataValid' => false, + 'shippingAddressFromData' => [ + 'lastname' => 'John' + ], + 'isBillingAddressFromDataValid' => false, + 'billingAddressFromData' => [ + 'lastname' => 'Jack' + ] + ] + ], + [ + [ + 'firstname' => 'John' + ], + [ + 'firstname' => 'John' + ], + [ + 'isShippingAddressFromDataValid' => true, + 'shippingAddressFromData' => [ + 'firstname' => 'John' + ], + ] + ], + ]; + } +} diff --git a/app/code/Magento/Checkout/Test/Unit/Model/GuestPaymentInformationManagementTest.php b/app/code/Magento/Checkout/Test/Unit/Model/GuestPaymentInformationManagementTest.php index 4a89443f02f6..b4cab724b0ef 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/GuestPaymentInformationManagementTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/GuestPaymentInformationManagementTest.php @@ -9,6 +9,7 @@ use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; use Magento\Checkout\Api\PaymentProcessingRateLimiterInterface; +use Magento\Checkout\Api\PaymentSavingRateLimiterInterface; use Magento\Checkout\Model\GuestPaymentInformationManagement; use Magento\Framework\Exception\CouldNotSaveException; use Magento\Framework\Exception\LocalizedException; @@ -74,6 +75,11 @@ class GuestPaymentInformationManagementTest extends TestCase */ private $limiterMock; + /** + * @var PaymentSavingRateLimiterInterface|MockObject + */ + private $saveLimiterMock; + protected function setUp(): void { $objectManager = new ObjectManager($this); @@ -92,6 +98,7 @@ protected function setUp(): void ); $this->loggerMock = $this->getMockForAbstractClass(LoggerInterface::class); $this->limiterMock = $this->getMockForAbstractClass(PaymentProcessingRateLimiterInterface::class); + $this->saveLimiterMock = $this->getMockForAbstractClass(PaymentSavingRateLimiterInterface::class); $this->model = $objectManager->getObject( GuestPaymentInformationManagement::class, [ @@ -100,7 +107,8 @@ protected function setUp(): void 'cartManagement' => $this->cartManagementMock, 'cartRepository' => $this->cartRepositoryMock, 'quoteIdMaskFactory' => $this->quoteIdMaskFactoryMock, - 'paymentsRateLimiter' => $this->limiterMock + 'paymentsRateLimiter' => $this->limiterMock, + 'savingRateLimiter' => $this->saveLimiterMock ] ); $objectManager->setBackwardCompatibleProperty($this->model, 'logger', $this->loggerMock); @@ -159,11 +167,10 @@ public function testSavePaymentInformation() */ public function testSavePaymentInformationLimited(): void { - $this->expectException(PaymentProcessingRateLimitExceededException::class); - $this->limiterMock->method('limit') + $this->saveLimiterMock->method('limit') ->willThrowException(new PaymentProcessingRateLimitExceededException(__('Error'))); - $this->savePayment(); + $this->assertFalse($this->savePayment()); } public function testSavePaymentInformationWithoutBillingAddress() diff --git a/app/code/Magento/Checkout/Test/Unit/Model/PaymentInformationManagementTest.php b/app/code/Magento/Checkout/Test/Unit/Model/PaymentInformationManagementTest.php index 294857765007..a396b290f367 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/PaymentInformationManagementTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/PaymentInformationManagementTest.php @@ -9,6 +9,7 @@ use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; use Magento\Checkout\Api\PaymentProcessingRateLimiterInterface; +use Magento\Checkout\Api\PaymentSavingRateLimiterInterface; use Magento\Checkout\Model\PaymentInformationManagement; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Phrase; @@ -66,6 +67,11 @@ class PaymentInformationManagementTest extends TestCase */ private $rateLimiterMock; + /** + * @var PaymentSavingRateLimiterInterface|MockObject + */ + private $saveLimiterMock; + protected function setUp(): void { $objectManager = new ObjectManager($this); @@ -81,13 +87,15 @@ protected function setUp(): void $this->cartRepositoryMock = $this->getMockBuilder(CartRepositoryInterface::class) ->getMock(); $this->rateLimiterMock = $this->getMockForAbstractClass(PaymentProcessingRateLimiterInterface::class); + $this->saveLimiterMock = $this->getMockForAbstractClass(PaymentSavingRateLimiterInterface::class); $this->model = $objectManager->getObject( PaymentInformationManagement::class, [ 'billingAddressManagement' => $this->billingAddressManagementMock, 'paymentMethodManagement' => $this->paymentMethodManagementMock, 'cartManagement' => $this->cartManagementMock, - 'paymentRateLimiter' => $this->rateLimiterMock + 'paymentRateLimiter' => $this->rateLimiterMock, + 'saveRateLimiter' => $this->saveLimiterMock ] ); $objectManager->setBackwardCompatibleProperty($this->model, 'logger', $this->loggerMock); @@ -164,11 +172,10 @@ public function testSavePaymentInformation() */ public function testSavePaymentInformationLimited(): void { - $this->rateLimiterMock->method('limit') + $this->saveLimiterMock->method('limit') ->willThrowException(new PaymentProcessingRateLimitExceededException(__('Error'))); - $this->expectException(PaymentProcessingRateLimitExceededException::class); - $this->savePayment(); + $this->assertFalse($this->savePayment()); } public function testSavePaymentInformationWithoutBillingAddress() diff --git a/app/code/Magento/Checkout/composer.json b/app/code/Magento/Checkout/composer.json index 5f7b5425667e..2c89c9264845 100644 --- a/app/code/Magento/Checkout/composer.json +++ b/app/code/Magento/Checkout/composer.json @@ -7,6 +7,7 @@ "require": { "php": "~7.3.0||~7.4.0", "magento/framework": "*", + "magento/module-captcha": "*", "magento/module-catalog": "*", "magento/module-catalog-inventory": "*", "magento/module-config": "*", @@ -19,12 +20,12 @@ "magento/module-quote": "*", "magento/module-sales": "*", "magento/module-sales-rule": "*", + "magento/module-security": "*", "magento/module-shipping": "*", "magento/module-store": "*", "magento/module-tax": "*", "magento/module-theme": "*", "magento/module-ui": "*", - "magento/module-captcha": "*", "magento/module-authorization": "*" }, "suggest": { diff --git a/app/code/Magento/Checkout/etc/di.xml b/app/code/Magento/Checkout/etc/di.xml index 0c1d866dfc2f..1af46c878694 100644 --- a/app/code/Magento/Checkout/etc/di.xml +++ b/app/code/Magento/Checkout/etc/di.xml @@ -51,4 +51,6 @@ </type> <preference for="Magento\Checkout\Api\PaymentProcessingRateLimiterInterface" type="Magento\Checkout\Model\CaptchaPaymentProcessingRateLimiter" /> + <preference for="Magento\Checkout\Api\PaymentSavingRateLimiterInterface" + type="Magento\Checkout\Model\CaptchaPaymentSavingRateLimiter" /> </config> diff --git a/app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml b/app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml index c3bddbac5648..6a0be41151e8 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml @@ -78,6 +78,7 @@ $canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinima <a href="#" class="action help map" id="<?= ($block->escapeHtmlAttr($helpLinkId)) ?>" data-mage-init='{"addToCart":{ + "origin": "info", "helpLinkId": "#<?= $block->escapeJs($block->escapeHtml($helpLinkId)) ?>", "productName": "<?= $block->escapeJs($block->escapeHtml($product->getName())) ?>", "showAddToCart": false diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/link.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/link.phtml index b667764ac7bb..c2f99c03c8f4 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/link.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/link.phtml @@ -4,21 +4,27 @@ * See COPYING.txt for license details. */ -/** @var $block \Magento\Checkout\Block\Onepage\Link */ +use Magento\Checkout\Block\Onepage\Link; +use Magento\Framework\Escaper; + +/** + * @var Link $block + * @var Escaper $escaper + */ ?> -<?php if ($block->isPossibleOnepageCheckout()) :?> +<?php if ($block->isPossibleOnepageCheckout()): ?> <button type="button" data-role="proceed-to-checkout" - title="<?= $block->escapeHtmlAttr(__('Proceed to Checkout')) ?>" + title="<?= $escaper->escapeHtmlAttr(__('Proceed to Checkout')) ?>" data-mage-init='{ "Magento_Checkout/js/proceed-to-checkout":{ - "checkoutUrl":"<?= $block->escapeJs($block->escapeUrl($block->getCheckoutUrl())) ?>" + "checkoutUrl":"<?= $escaper->escapeJs($block->getCheckoutUrl()) ?>" } }' class="action primary checkout<?= ($block->isDisabled()) ? ' disabled' : '' ?>" - <?php if ($block->isDisabled()) :?> + <?php if ($block->isDisabled()): ?> disabled="disabled" <?php endif; ?>> - <span><?= $block->escapeHtml(__('Proceed to Checkout')) ?></span> + <span><?= $escaper->escapeHtml(__('Proceed to Checkout')) ?></span> </button> <?php endif?> diff --git a/app/code/Magento/Checkout/view/frontend/web/js/action/get-totals.js b/app/code/Magento/Checkout/view/frontend/web/js/action/get-totals.js index 3c4c69e82967..2ba5dbbfac7e 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/action/get-totals.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/action/get-totals.js @@ -38,7 +38,7 @@ define([ quote.setTotals(response); deferred.resolve(); } - }).error(function (response) { + }).fail(function (response) { totals.isLoading(false); deferred.reject(); errorProcessor.process(response); diff --git a/app/code/Magento/Checkout/view/frontend/web/js/action/set-payment-information-extended.js b/app/code/Magento/Checkout/view/frontend/web/js/action/set-payment-information-extended.js index 43c8c5a3a4fe..bb66c90980a7 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/action/set-payment-information-extended.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/action/set-payment-information-extended.js @@ -15,7 +15,7 @@ define([ 'Magento_Checkout/js/action/get-totals', 'Magento_Checkout/js/model/full-screen-loader', 'underscore', - 'Magento_Checkout/js/model/payment/set-payment-hooks' + 'Magento_Checkout/js/model/payment/place-order-hooks' ], function (quote, urlBuilder, storage, errorProcessor, customer, getTotalsAction, fullScreenLoader, _, hooks) { 'use strict'; diff --git a/app/code/Magento/Checkout/view/frontend/web/js/action/update-shopping-cart.js b/app/code/Magento/Checkout/view/frontend/web/js/action/update-shopping-cart.js index f9def2fd58b2..8cc303b8807d 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/action/update-shopping-cart.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/action/update-shopping-cart.js @@ -125,7 +125,7 @@ define([ .on('submit', function () { $(document.body).trigger('processStart'); }) - .submit(); + .trigger('submit'); } }); diff --git a/app/code/Magento/Checkout/view/frontend/web/js/discount-codes.js b/app/code/Magento/Checkout/view/frontend/web/js/discount-codes.js index 1f38ff28a860..5cf1421c6900 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/discount-codes.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/discount-codes.js @@ -21,13 +21,13 @@ define([ $(this.options.applyButton).on('click', $.proxy(function () { this.couponCode.attr('data-validate', '{required:true}'); this.removeCoupon.attr('value', '0'); - $(this.element).validation().submit(); + $(this.element).validation().trigger('submit'); }, this)); $(this.options.cancelButton).on('click', $.proxy(function () { this.couponCode.removeAttr('data-validate'); this.removeCoupon.attr('value', '1'); - this.element.submit(); + this.element.trigger('submit'); }, this)); } }); diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/address-converter.js b/app/code/Magento/Checkout/view/frontend/web/js/model/address-converter.js index d296999c88b5..6f89c4bfe988 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/address-converter.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/address-converter.js @@ -99,12 +99,12 @@ define([ customAttributesObject; $.each(addrs, function (key) { - if (addrs.hasOwnProperty(key) && !$.isFunction(addrs[key])) { + if (addrs.hasOwnProperty(key) && typeof addrs[key] !== 'function') { output[self.toUnderscore(key)] = addrs[key]; } }); - if ($.isArray(addrs.street)) { + if (Array.isArray(addrs.street)) { streetObject = {}; addrs.street.forEach(function (value, index) { streetObject[index] = value; @@ -113,7 +113,7 @@ define([ } //jscs:disable requireCamelCaseOrUpperCaseIdentifiers - if ($.isArray(addrs.customAttributes)) { + if (Array.isArray(addrs.customAttributes)) { customAttributesObject = {}; addrs.customAttributes.forEach(function (value) { customAttributesObject[value.attribute_code] = value.value; diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js b/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js index 66539ad21185..9c00050d886e 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js @@ -35,6 +35,8 @@ define([ ) { 'use strict'; + var isBillingAddressResolvedFromBackend = false; + return { /** @@ -90,9 +92,7 @@ define([ applyShippingAddress: function (isEstimatedAddress) { var address, shippingAddress, - isConvertAddress, - addressData, - isShippingAddressInitialized; + isConvertAddress; if (addressList().length === 0) { address = addressConverter.formAddressDataToQuoteAddress( @@ -104,39 +104,14 @@ define([ isConvertAddress = isEstimatedAddress || false; if (!shippingAddress) { - isShippingAddressInitialized = addressList.some(function (addressFromList) { - if (checkoutData.getSelectedShippingAddress() == addressFromList.getKey()) { //eslint-disable-line - addressData = isConvertAddress ? - addressConverter.addressToEstimationAddress(addressFromList) - : addressFromList; - selectShippingAddress(addressData); - - return true; - } - - return false; - }); - - if (!isShippingAddressInitialized) { - isShippingAddressInitialized = addressList.some(function (addrs) { - if (addrs.isDefaultShipping()) { - addressData = isConvertAddress ? - addressConverter.addressToEstimationAddress(addrs) - : addrs; - selectShippingAddress(addressData); - - return true; - } + shippingAddress = this.getShippingAddressFromCustomerAddressList(); - return false; - }); - } - - if (!isShippingAddressInitialized && addressList().length === 1) { - addressData = isConvertAddress ? - addressConverter.addressToEstimationAddress(addressList()[0]) - : addressList()[0]; - selectShippingAddress(addressData); + if (shippingAddress) { + selectShippingAddress( + isConvertAddress ? + addressConverter.addressToEstimationAddress(shippingAddress) + : shippingAddress + ); } } }, @@ -208,12 +183,6 @@ define([ var selectedBillingAddress, newCustomerBillingAddressData; - if (!checkoutData.getBillingAddressFromData() && - window.checkoutConfig.billingAddressFromData - ) { - checkoutData.setBillingAddressFromData(window.checkoutConfig.billingAddressFromData); - } - selectedBillingAddress = checkoutData.getSelectedBillingAddress(); newCustomerBillingAddressData = checkoutData.getNewCustomerBillingAddress(); @@ -230,6 +199,19 @@ define([ } else { this.applyBillingAddress(); } + + if (!isBillingAddressResolvedFromBackend && + !checkoutData.getBillingAddressFromData() && + !_.isEmpty(window.checkoutConfig.billingAddressFromData) && + !quote.billingAddress() + ) { + if (window.checkoutConfig.isBillingAddressFromDataValid === true) { + selectBillingAddress(createBillingAddress(window.checkoutConfig.billingAddressFromData)); + } else { + checkoutData.setBillingAddressFromData(window.checkoutConfig.billingAddressFromData); + } + isBillingAddressResolvedFromBackend = true; + } }, /** @@ -267,6 +249,35 @@ define([ //set billing address same as shipping by default if it is not empty selectBillingAddress(quote.shippingAddress()); } + }, + + /** + * Get shipping address from address list + * + * @return {Object|null} + */ + getShippingAddressFromCustomerAddressList: function () { + var shippingAddress = _.find( + addressList(), + function (address) { + return checkoutData.getSelectedShippingAddress() == address.getKey() //eslint-disable-line + } + ); + + if (!shippingAddress) { + shippingAddress = _.find( + addressList(), + function (address) { + return address.isDefaultShipping(); + } + ); + } + + if (!shippingAddress && addressList().length === 1) { + shippingAddress = addressList()[0]; + } + + return shippingAddress; } }; }); diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/full-screen-loader.js b/app/code/Magento/Checkout/view/frontend/web/js/model/full-screen-loader.js index 0a10ff32bcb2..fa52b336a90f 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/full-screen-loader.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/full-screen-loader.js @@ -27,7 +27,7 @@ define([ */ stopLoader: function (forceStop) { var $elem = $(containerId), - stop = $elem.trigger.bind($elem, 'processStop'); + stop = $elem.trigger.bind($elem, 'processStop'); //eslint-disable-line jquery-no-bind-unbind forceStop ? stop() : resolver(stop); } diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/new-customer-address.js b/app/code/Magento/Checkout/view/frontend/web/js/model/new-customer-address.js index 4ef39421440c..eb4b45d83817 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/new-customer-address.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/new-customer-address.js @@ -54,6 +54,7 @@ define([ vatId: addressData['vat_id'], saveInAddressBook: addressData['save_in_address_book'], customAttributes: addressData['custom_attributes'], + extensionAttributes: addressData['extension_attributes'], /** * @return {*} diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/payment/set-payment-hooks.js b/app/code/Magento/Checkout/view/frontend/web/js/model/payment/set-payment-hooks.js deleted file mode 100644 index 5cd31d85c9a2..000000000000 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/payment/set-payment-hooks.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -define([], function () { - 'use strict'; - - return { - requestModifiers: [], - afterRequestListeners: [] - }; -}); diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/place-order.js b/app/code/Magento/Checkout/view/frontend/web/js/model/place-order.js index 701c31944939..36403d5e2259 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/place-order.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/place-order.js @@ -31,7 +31,7 @@ define( function (response) { errorProcessor.process(response, messageContainer); } - ).success( + ).done( function (response) { var clearData = { 'selectedShippingAddress': null, diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/totals.js b/app/code/Magento/Checkout/view/frontend/web/js/model/totals.js index aba0c31b998d..fe525bddc02f 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/totals.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/totals.js @@ -22,7 +22,7 @@ define([ quoteItems(newValue.items); }); - if (quoteSubtotal !== subtotalAmount) { + if (!isNaN(subtotalAmount) && quoteSubtotal !== subtotalAmount) { customerData.reload(['cart'], false); } diff --git a/app/code/Magento/Checkout/view/frontend/web/js/proceed-to-checkout.js b/app/code/Magento/Checkout/view/frontend/web/js/proceed-to-checkout.js index 0bb0a53ce0a6..836c7a8c5847 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/proceed-to-checkout.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/proceed-to-checkout.js @@ -11,7 +11,7 @@ define([ 'use strict'; return function (config, element) { - $(element).click(function (event) { + $(element).on('click', function (event) { var cart = customerData.get('cart'), customer = customerData.get('customer'); diff --git a/app/code/Magento/Checkout/view/frontend/web/js/region-updater.js b/app/code/Magento/Checkout/view/frontend/web/js/region-updater.js index 68f6b1b2753c..4307acea96e2 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/region-updater.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/region-updater.js @@ -192,7 +192,7 @@ define([ } if (this.options.isRegionRequired) { - regionList.addClass('required-entry').removeAttr('disabled'); + regionList.addClass('required-entry').prop('disabled', false); container.addClass('required').show(); } else { regionList.removeClass('required-entry validate-select').removeAttr('data-validate'); @@ -202,7 +202,7 @@ define([ regionList.hide(); container.hide(); } else { - regionList.removeAttr('disabled').show(); + regionList.prop('disabled', false).show(); } } @@ -213,7 +213,7 @@ define([ this._removeSelectOptions(regionList); if (this.options.isRegionRequired) { - regionInput.addClass('required-entry').removeAttr('disabled'); + regionInput.addClass('required-entry').prop('disabled', false); container.addClass('required').show(); } else { if (!this.options.optionalRegionAllowed) { //eslint-disable-line max-depth @@ -238,6 +238,7 @@ define([ // Add defaultvalue attribute to state/province select element regionList.attr('defaultvalue', this.options.defaultRegion); + this.options.form.find('[type="submit"]').prop('disabled', false).show(); }, /** diff --git a/app/code/Magento/Checkout/view/frontend/web/js/shopping-cart.js b/app/code/Magento/Checkout/view/frontend/web/js/shopping-cart.js index 97dff2f6fd47..47e91b7cf105 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/shopping-cart.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/shopping-cart.js @@ -89,7 +89,7 @@ define([ .attr('name', 'update_cart_action').attr('value', 'empty_cart'); if ($(this.options.emptyCartButton).parents('form').length > 0) { - $(this.options.emptyCartButton).parents('form').submit(); + $(this.options.emptyCartButton).parents('form').trigger('submit'); } } }); diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/billing-address.js b/app/code/Magento/Checkout/view/frontend/web/js/view/billing-address.js index 127aa6ef01f5..6412fd726ed6 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/billing-address.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/billing-address.js @@ -18,7 +18,8 @@ define([ 'Magento_Checkout/js/action/set-billing-address', 'Magento_Ui/js/model/messageList', 'mage/translate', - 'Magento_Checkout/js/model/billing-address-postcode-validator' + 'Magento_Checkout/js/model/billing-address-postcode-validator', + 'Magento_Checkout/js/model/address-converter' ], function ( ko, @@ -35,11 +36,14 @@ function ( setBillingAddressAction, globalMessageList, $t, - billingAddressPostcodeValidator + billingAddressPostcodeValidator, + addressConverter ) { 'use strict'; var lastSelectedBillingAddress = null, + addressUpadated = false, + addressEdited = false, countryData = customerData.get('directory-data'), addressOptions = addressList().filter(function (address) { return address.getType() === 'customer-address'; @@ -140,6 +144,8 @@ function ( updateAddress: function () { var addressData, newBillingAddress; + addressUpadated = true; + if (this.selectedAddress() && !this.isAddressFormVisible()) { selectBillingAddress(this.selectedAddress()); checkoutData.setSelectedBillingAddress(this.selectedAddress().getKey()); @@ -165,6 +171,7 @@ function ( checkoutData.setNewCustomerBillingAddress(addressData); } } + setBillingAddressAction(globalMessageList); this.updateAddresses(); }, @@ -172,6 +179,8 @@ function ( * Edit address action */ editAddress: function () { + addressUpadated = false; + addressEdited = true; lastSelectedBillingAddress = quote.billingAddress(); quote.billingAddress(null); this.isAddressDetailsVisible(false); @@ -181,6 +190,7 @@ function ( * Cancel address edit action */ cancelAddressEdit: function () { + addressUpadated = true; this.restoreBillingAddress(); if (quote.billingAddress()) { @@ -201,12 +211,26 @@ function ( return quote.billingAddress() || lastSelectedBillingAddress; }), + /** + * Check if Billing Address Changes should be canceled + */ + needCancelBillingAddressChanges: function () { + if (addressEdited && !addressUpadated) { + this.cancelAddressEdit(); + } + }, + /** * Restore billing address */ restoreBillingAddress: function () { + var lastBillingAddress; + if (lastSelectedBillingAddress != null) { selectBillingAddress(lastSelectedBillingAddress); + lastBillingAddress = addressConverter.quoteAddressToFormAddressData(lastSelectedBillingAddress); + + checkoutData.setNewCustomerBillingAddress(lastBillingAddress); } }, @@ -259,6 +283,8 @@ function ( label = _.map(attribute.value, function (value) { return this.getCustomAttributeOptionLabel(attribute['attribute_code'], value) || value; }, this).join(', '); + } else if (typeof attribute.value === 'object') { + label = _.map(Object.values(attribute.value)).join(', '); } else { label = this.getCustomAttributeOptionLabel(attribute['attribute_code'], attribute.value); } @@ -286,6 +312,8 @@ function ( if (option) { label = option.label; } + } else if (value.file !== null) { + label = value.file; } return label; diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/checkout/setPaymentCaptcha.js b/app/code/Magento/Checkout/view/frontend/web/js/view/checkout/setPaymentCaptcha.js deleted file mode 100644 index 93f3bb8b2a45..000000000000 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/checkout/setPaymentCaptcha.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -define([ - 'Magento_Captcha/js/view/checkout/defaultCaptcha', - 'Magento_Captcha/js/model/captchaList', - 'underscore', - 'Magento_Checkout/js/model/payment/set-payment-hooks' -], -function (defaultCaptcha, captchaList, _, setPaymentHooks) { - 'use strict'; - - return defaultCaptcha.extend({ - /** @inheritdoc */ - initialize: function () { - var self = this, - currentCaptcha; - - this._super(); - currentCaptcha = captchaList.getCaptchaByFormId(this.formId); - - if (currentCaptcha != null) { - currentCaptcha.setIsVisible(true); - this.setCurrentCaptcha(currentCaptcha); - setPaymentHooks.requestModifiers.push(function (headers) { - if (self.isRequired()) { - headers['X-Captcha'] = self.captchaValue()(); - } - }); - setPaymentHooks.afterRequestListeners.push(function () { - self.refresh(); - }); - } - } - }); -}); diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/form/element/email.js b/app/code/Magento/Checkout/view/frontend/web/js/view/form/element/email.js index 8311d9752298..f1ef00daaf52 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/form/element/email.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/form/element/email.js @@ -161,9 +161,13 @@ define([ return valid; } - validator = loginForm.validate(); + if (loginForm.is(':visible')) { + validator = loginForm.validate(); - return validator.check(usernameSelector); + return validator.check(usernameSelector); + } + + return true; }, /** diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/progress-bar.js b/app/code/Magento/Checkout/view/frontend/web/js/view/progress-bar.js index 30ea9da1dd60..6dd1f31562a6 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/progress-bar.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/progress-bar.js @@ -8,8 +8,9 @@ define([ 'underscore', 'ko', 'uiComponent', - 'Magento_Checkout/js/model/step-navigator' -], function ($, _, ko, Component, stepNavigator) { + 'Magento_Checkout/js/model/step-navigator', + 'Magento_Checkout/js/view/billing-address' +], function ($, _, ko, Component, stepNavigator, billingAddress) { 'use strict'; var steps = stepNavigator.steps; @@ -52,6 +53,9 @@ define([ * @param {Object} step */ navigateTo: function (step) { + if (step.code === 'shipping') { + billingAddress().needCancelBillingAddressChanges(); + } stepNavigator.navigateTo(step.code); }, diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/shipping-address/address-renderer/default.js b/app/code/Magento/Checkout/view/frontend/web/js/view/shipping-address/address-renderer/default.js index 3a4f34c26e5d..4405dfd7219a 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/shipping-address/address-renderer/default.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/shipping-address/address-renderer/default.js @@ -69,6 +69,8 @@ define([ label = _.map(attribute.value, function (value) { return this.getCustomAttributeOptionLabel(attribute['attribute_code'], value) || value; }, this).join(', '); + } else if (typeof attribute.value === 'object') { + label = _.map(Object.values(attribute.value)).join(', '); } else { label = this.getCustomAttributeOptionLabel(attribute['attribute_code'], attribute.value); } @@ -96,6 +98,8 @@ define([ if (option) { label = option.label; } + } else if (value.file !== null) { + label = value.file; } return label; diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/shipping-information/address-renderer/default.js b/app/code/Magento/Checkout/view/frontend/web/js/view/shipping-information/address-renderer/default.js index 03591c95e46c..6a7b28f4150d 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/shipping-information/address-renderer/default.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/shipping-information/address-renderer/default.js @@ -46,6 +46,8 @@ define([ label = _.map(attribute.value, function (value) { return this.getCustomAttributeOptionLabel(attribute['attribute_code'], value) || value; }, this).join(', '); + } else if (typeof attribute.value === 'object') { + label = _.map(Object.values(attribute.value)).join(', '); } else { label = this.getCustomAttributeOptionLabel(attribute['attribute_code'], attribute.value); } @@ -73,6 +75,8 @@ define([ if (option) { label = option.label; } + } else if (value.file !== null) { + label = value.file; } return label; diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/shipping.js b/app/code/Magento/Checkout/view/frontend/web/js/view/shipping.js index 2a52b6464774..8f6c5ad8118e 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/shipping.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/shipping.js @@ -354,7 +354,7 @@ define([ } if (!emailValidationResult) { - $(loginFormSelector + ' input[name=username]').focus(); + $(loginFormSelector + ' input[name=username]').trigger('focus'); return false; } diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/summary/item/details.js b/app/code/Magento/Checkout/view/frontend/web/js/view/summary/item/details.js index 2046413cbc68..22db7d52aed1 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/summary/item/details.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/summary/item/details.js @@ -4,19 +4,33 @@ */ define([ - 'uiComponent' -], function (Component) { + 'uiComponent', + 'escaper' +], function (Component, escaper) { 'use strict'; return Component.extend({ defaults: { - template: 'Magento_Checkout/summary/item/details' + template: 'Magento_Checkout/summary/item/details', + allowedTags: ['b', 'strong', 'i', 'em', 'u'] }, /** * @param {Object} quoteItem * @return {String} */ + getNameUnsanitizedHtml: function (quoteItem) { + var txt = document.createElement('textarea'); + + txt.innerHTML = quoteItem.name; + + return escaper.escapeHtml(txt.value, this.allowedTags); + }, + + /** + * @param {Object} quoteItem + * @return {String}Magento_Checkout/js/region-updater + */ getValue: function (quoteItem) { return quoteItem.name; } diff --git a/app/code/Magento/Checkout/view/frontend/web/template/billing-address.html b/app/code/Magento/Checkout/view/frontend/web/template/billing-address.html index cabfcc9b3db0..789707a9b836 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/billing-address.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/billing-address.html @@ -11,12 +11,12 @@ <label data-bind="attr: {for: 'billing-address-same-as-shipping-' + getCode($parent)}"><span data-bind="i18n: 'My billing and shipping address are the same'"></span></label> </div> - <render args="detailsTemplate"/> + <render args="detailsTemplate"></render> <fieldset class="fieldset" data-bind="visible: !isAddressDetailsVisible()"> - <each args="getRegion('billing-address-list')" render="" /> + <each args="getRegion('billing-address-list')" render=""></each> <div data-bind="fadeVisible: isAddressFormVisible"> - <render args="formTemplate"/> + <render args="formTemplate"></render> </div> - <render args="actionsTemplate"/> + <render args="actionsTemplate"></render> </fieldset> </div> diff --git a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/actions.html b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/actions.html index 860f340d3f7c..4589331da8fa 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/actions.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/actions.html @@ -9,13 +9,13 @@ <button class="action action-update" type="button" click="updateAddress"> - <span translate="'Update'"/> + <span translate="'Update'"></span> </button> <button class="action action-cancel" type="button" click="cancelAddressEdit" visible="canUseCancelBillingAddress()"> - <span translate="'Cancel'"/> + <span translate="'Cancel'"></span> </button> </div> </div> diff --git a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html index 6b3de69d1a21..2ec63a6160f6 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html @@ -5,15 +5,17 @@ */ --> <div if="isAddressDetailsVisible() && currentBillingAddress()" class="billing-address-details"> - <text args="currentBillingAddress().prefix"/> <text args="currentBillingAddress().firstname"/> <text args="currentBillingAddress().middlename"/> - <text args="currentBillingAddress().lastname"/> <text args="currentBillingAddress().suffix"/><br/> - <text args="currentBillingAddress().street.join(', ')"/><br/> - <text args="currentBillingAddress().city "/>, <span text="currentBillingAddress().region"></span> <text args="currentBillingAddress().postcode"/><br/> - <text args="getCountryName(currentBillingAddress().countryId)"/><br/> + <text args="currentBillingAddress().prefix"></text> <text args="currentBillingAddress().firstname"></text> + <text args="currentBillingAddress().middlename"></text> + <text args="currentBillingAddress().lastname"></text> <text args="currentBillingAddress().suffix"></text><br/> + <text args="currentBillingAddress().street.join(', ')"></text><br/> + <text args="currentBillingAddress().city "></text>, <span text="currentBillingAddress().region"></span> + <text args="currentBillingAddress().postcode"></text><br/> + <text args="getCountryName(currentBillingAddress().countryId)"></text><br/> <a if="currentBillingAddress().telephone" attr="'href': 'tel:' + currentBillingAddress().telephone" text="currentBillingAddress().telephone"></a><br/> <each args="data: currentBillingAddress().customAttributes, as: 'element'"> - <text args="$parent.getCustomAttributeLabel(element)"/> + <text args="$parent.getCustomAttributeLabel(element)"></text> <br/> </each> diff --git a/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-estimation.html b/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-estimation.html index 982aa6a88d09..8ab66b284967 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-estimation.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-estimation.html @@ -8,7 +8,7 @@ <fieldset class="fieldset estimate"> <legend class="legend"> <span data-bind="text: isVirtual ? $t('Estimate Tax') : $t('Estimate Shipping and Tax') "></span> - </legend><br> + </legend><br/> <p class="field note" data-bind="text: isVirtual ? $t('Enter your billing address to get a tax estimate.') : $t('Enter your destination to get a shipping estimate.')"></p> <!-- ko foreach: getRegion('address-fieldsets') --> <!-- ko template: getTemplate() --><!-- /ko --> diff --git a/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-rates.html b/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-rates.html index 9f0d43605692..f79a58053cba 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-rates.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-rates.html @@ -30,7 +30,7 @@ "/> <label class="label" data-bind="attr: {for: 's_method_' + carrier_code + '_' + method_code}"> <!-- ko text: $data.method_title --><!-- /ko --> - <each args="element.getRegion('price')" render="" /> + <each args="element.getRegion('price')" render=""></each> </label> <!-- /ko --> </div> diff --git a/app/code/Magento/Checkout/view/frontend/web/template/minicart/content.html b/app/code/Magento/Checkout/view/frontend/web/template/minicart/content.html index 08e66ef0401e..78792236de88 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/minicart/content.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/minicart/content.html @@ -6,7 +6,7 @@ --> <div class="block-title"> <strong> - <span class="text" translate="'My Cart'"/> + <span class="text" translate="'My Cart'"></span> <span class="qty empty" text="getCartParam('summary_count')" @@ -27,24 +27,24 @@ }, click: closeMinicart() "> - <span translate="'Close'"/> + <span translate="'Close'"></span> </button> <if args="getCartParam('summary_count')"> <div class="items-total"> - <span class="count" if="maxItemsToDisplay < getCartLineItemsCount()" text="maxItemsToDisplay"/> - <translate args="'of'" if="maxItemsToDisplay < getCartLineItemsCount()"/> - <span class="count" text="getCartParam('summary_count')"/> + <span class="count" if="maxItemsToDisplay < getCartLineItemsCount()" text="maxItemsToDisplay"></span> + <translate args="'of'" if="maxItemsToDisplay < getCartLineItemsCount()"></translate> + <span class="count" text="getCartParam('summary_count')"></span> <!-- ko if: (getCartParam('summary_count') > 1) --> - <span translate="'Items in Cart'"/> + <span translate="'Items in Cart'"></span> <!--/ko--> <!-- ko if: (getCartParam('summary_count') === 1) --> - <span translate="'Item in Cart'"/> + <span translate="'Item in Cart'"></span> <!--/ko--> </div> - <each args="getRegion('subtotalContainer')" render=""/> - <each args="getRegion('extraInfo')" render=""/> + <each args="getRegion('subtotalContainer')" render=""></each> + <each args="getRegion('extraInfo')" render=""></each> <div class="actions" if="getCartParam('possible_onepage_checkout')"> <div class="primary"> @@ -59,34 +59,32 @@ }, click: closeMinicart() " - translate="'Proceed to Checkout'" - /> + translate="'Proceed to Checkout'"> + </button> <div data-bind="html: getCartParamUnsanitizedHtml('extra_actions')"></div> </div> </div> </if> <if args="getCartParam('summary_count')"> - <strong class="subtitle" translate="'Recently added item(s)'"/> + <strong class="subtitle" translate="'Recently added item(s)'"></strong> <div data-action="scroll" class="minicart-items-wrapper"> <ol id="mini-cart" class="minicart-items" data-bind="foreach: { data: getCartItems(), as: 'item' }"> <each args="$parent.getRegion($parent.getItemRenderer(item.product_type))" - render="{name: getTemplate(), data: item, afterRender: function() {$parents[1].initSidebar()}}" - /> + render="{name: getTemplate(), data: item, afterRender: function() {$parents[1].initSidebar()}}"></each> </ol> </div> </if> <ifnot args="getCartParam('summary_count')"> <strong class="subtitle empty" - translate="'You have no items in your shopping cart.'" - /> + translate="'You have no items in your shopping cart.'"></strong> <if args="getCartParam('cart_empty_message')"> - <p class="minicart empty text" text="getCartParam('cart_empty_message')"/> + <p class="minicart empty text" text="getCartParam('cart_empty_message')"></p> <div class="actions"> <div class="secondary"> <a class="action viewcart" data-bind="attr: {href: shoppingCartUrl}"> - <span translate="'View and Edit Cart'"/> + <span translate="'View and Edit Cart'"></span> </a> </div> </div> @@ -96,13 +94,13 @@ <div class="actions" if="getCartParam('summary_count')"> <div class="secondary"> <a class="action viewcart" data-bind="attr: {href: shoppingCartUrl}"> - <span translate="'View and Edit Cart'"/> + <span translate="'View and Edit Cart'"></span> </a> </div> </div> <div id="minicart-widgets" class="minicart-widgets" if="regionHasElements('promotion')"> - <each args="getRegion('promotion')" render=""/> + <each args="getRegion('promotion')" render=""></each> </div> </div> -<each args="getRegion('sign-in-popup')" render=""/> +<each args="getRegion('sign-in-popup')" render=""></each> diff --git a/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html b/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html index b15b7952d2cb..765c260ac9d0 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html @@ -82,7 +82,7 @@ }, value: qty" type="number" size="4" - class="item-qty cart-item-qty"> + class="item-qty cart-item-qty"/> <button data-bind="attr: { id: 'update-cart-item-'+item_id, 'data-cart-item': item_id, diff --git a/app/code/Magento/Checkout/view/frontend/web/template/payment-methods/list.html b/app/code/Magento/Checkout/view/frontend/web/template/payment-methods/list.html index 77b801ec0e82..12808ab23005 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/payment-methods/list.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/payment-methods/list.html @@ -13,7 +13,7 @@ class="step-title" data-role="title"> </div> - <each args="data: getRegion($group().displayArea), as: 'method'" render=""/> + <each args="data: getRegion($group().displayArea), as: 'method'" render=""></each> </div> </div> <div ifnot="isPaymentMethodsAvailable()" diff --git a/app/code/Magento/Checkout/view/frontend/web/template/registration.html b/app/code/Magento/Checkout/view/frontend/web/template/registration.html index 5cc0d189e7c5..6191f2bab44d 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/registration.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/registration.html @@ -12,7 +12,7 @@ <p data-bind="i18n: 'You can track your order status by creating an account.'"></p> <p><span data-bind="i18n: 'Email Address'"></span>: <span data-bind="text: getEmailAddress()"></span></p> <a class="action primary" data-bind="attr: { href: getUrl() }"> - <span data-bind="i18n: 'Create an Account'" /> + <span data-bind="i18n: 'Create an Account'"></span> </a> <!--/ko--> </div> diff --git a/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/address-renderer/default.html b/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/address-renderer/default.html index b14f4da3f5f7..e89ec66b7b16 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/address-renderer/default.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/address-renderer/default.html @@ -5,15 +5,15 @@ */ --> <div class="shipping-address-item" css="'selected-item' : isSelected() , 'not-selected-item':!isSelected()"> - <text args="address().prefix"/> <text args="address().firstname"/> <text args="address().middlename"/> - <text args="address().lastname"/> <text args="address().suffix"/><br/> - <text args="_.values(address().street).join(', ')"/><br/> - <text args="address().city "/>, <span text="address().region"></span> <text args="address().postcode"/><br/> - <text args="getCountryName(address().countryId)"/><br/> + <text args="address().prefix"></text> <text args="address().firstname"></text> <text args="address().middlename"></text> + <text args="address().lastname"></text> <text args="address().suffix"></text><br/> + <text args="_.values(address().street).join(', ')"></text><br/> + <text args="address().city "></text>, <span text="address().region"></span> <text args="address().postcode"></text><br/> + <text args="getCountryName(address().countryId)"></text><br/> <a if="address().telephone" attr="'href': 'tel:' + address().telephone" text="address().telephone"></a><br/> <each args="data: address().customAttributes, as: 'element'"> - <text args="$parent.getCustomAttributeLabel(element)"/> + <text args="$parent.getCustomAttributeLabel(element)"></text> <br/> </each> diff --git a/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/shipping-method-item.html b/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/shipping-method-item.html index fd6be02657e3..514c0c869178 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/shipping-method-item.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/shipping-method-item.html @@ -17,15 +17,15 @@ </td> <!-- ko ifnot: (method.error_message) --> <td class="col col-price"> - <each args="element.getRegion('price')" render="" /> + <each args="element.getRegion('price')" render=""></each> </td> <!-- /ko --> <td class="col col-method" attr="'id': 'label_method_' + method.method_code + '_' + method.carrier_code" - text="method.method_title" /> + text="method.method_title"></td> <td class="col col-carrier" attr="'id': 'label_carrier_' + method.method_code + '_' + method.carrier_code" - text="method.carrier_title" /> + text="method.carrier_title"></td> </tr> <tr class="row row-error" if="method.error_message"> @@ -35,7 +35,7 @@ </div> <span class="no-display"> <input type="radio" - attr="'value' : method.method_code, 'id': 's_method_' + method.method_code" /> + attr="'value' : method.method_code, 'id': 's_method_' + method.method_code"> </span> </td> </tr> diff --git a/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/address-renderer/default.html b/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/address-renderer/default.html index 26dd7742d1da..14ef6bac143e 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/address-renderer/default.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/address-renderer/default.html @@ -5,15 +5,15 @@ */ --> <if args="visible()"> - <text args="address().prefix"/> <text args="address().firstname"/> <text args="address().middlename"/> - <text args="address().lastname"/> <text args="address().suffix"/><br/> - <text args="_.values(address().street).join(', ')"/><br/> - <text args="address().city "/>, <span text="address().region"></span> <text args="address().postcode"/><br/> - <text args="getCountryName(address().countryId)"/><br/> + <text args="address().prefix"></text> <text args="address().firstname"></text> <text args="address().middlename"></text> + <text args="address().lastname"></text> <text args="address().suffix"></text><br/> + <text args="_.values(address().street).join(', ')"></text><br/> + <text args="address().city "></text>, <span text="address().region"></span> <text args="address().postcode"></text><br/> + <text args="getCountryName(address().countryId)"></text><br/> <a if="address().telephone" attr="'href': 'tel:' + address().telephone" text="address().telephone"></a><br/> <each args="data: address().customAttributes, as: 'element'"> - <text args="$parent.getCustomAttributeLabel(element)"/> + <text args="$parent.getCustomAttributeLabel(element)"></text> <br/> </each> </if> diff --git a/app/code/Magento/Checkout/view/frontend/web/template/shipping.html b/app/code/Magento/Checkout/view/frontend/web/template/shipping.html index 1fcfa4b3b134..28057b373432 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/shipping.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/shipping.html @@ -5,7 +5,7 @@ */ --> <li id="shipping" class="checkout-shipping-address" data-bind="fadeVisible: visible()"> - <div class="step-title" translate="'Shipping Address'" data-role="title" /> + <div class="step-title" translate="'Shipping Address'" data-role="title"></div> <div id="checkout-step-shipping" class="step-content" data-role="content"> @@ -21,18 +21,18 @@ class="action action-show-popup" click="showFormPopUp" visible="!isNewAddressAdded()"> - <span translate="'New Address'" /> + <span translate="'New Address'"></span> </button> </div> <div id="opc-new-shipping-address" visible="isFormPopUpVisible()" - render="shippingFormTemplate" /> + render="shippingFormTemplate"></div> </if> <each args="getRegion('before-form')" render="" /> <!-- Inline address form --> - <render if="isFormInline" args="shippingFormTemplate" /> + <render if="isFormInline" args="shippingFormTemplate"/> </div> </li> @@ -44,7 +44,7 @@ <div class="checkout-shipping-method"> <div class="step-title" translate="'Shipping Methods'" - data-role="title" /> + data-role="title"></div> <each args="getRegion('before-shipping-method-form')" render="" /> @@ -67,19 +67,19 @@ <div role="alert" if="errorValidationMessage().length" class="message notice"> - <span text="errorValidationMessage()" /> + <span text="errorValidationMessage()"></span> </div> <div class="actions-toolbar" id="shipping-method-buttons-container"> <div class="primary"> <button data-role="opc-continue" type="submit" class="button action continue primary"> - <span translate="'Next'" /> + <span translate="'Next'"></span> </button> </div> </div> </form> <div class="no-quotes-block" ifnot="rates().length > 0" - translate="'Sorry, no quotes are available for this order at this time'" /> + translate="'Sorry, no quotes are available for this order at this time'"></div> </div> </div> </li> diff --git a/app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html b/app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html index 0ea72fb27540..b77c28b48e9a 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html @@ -7,11 +7,11 @@ <div class="block items-in-cart" data-bind="mageInit: {'collapsible':{'openedState': 'active', 'active': isItemsBlockExpanded()}}"> <div class="title" data-role="title"> <strong role="heading" aria-level="1"> - <translate args="maxCartItemsToDisplay" if="maxCartItemsToDisplay < getCartLineItemsCount()"/> - <translate args="'of'" if="maxCartItemsToDisplay < getCartLineItemsCount()"/> + <translate args="maxCartItemsToDisplay" if="maxCartItemsToDisplay < getCartLineItemsCount()"></translate> + <translate args="'of'" if="maxCartItemsToDisplay < getCartLineItemsCount()"></translate> <span data-bind="text: getCartSummaryItemsCount()"></span> - <translate args="'Item in Cart'" if="getCartSummaryItemsCount() === 1"/> - <translate args="'Items in Cart'" if="getCartSummaryItemsCount() > 1"/> + <translate args="'Item in Cart'" if="getCartSummaryItemsCount() === 1"></translate> + <translate args="'Items in Cart'" if="getCartSummaryItemsCount() > 1"></translate> </strong> </div> <div class="content minicart-items" data-role="content"> @@ -20,7 +20,7 @@ <each args="items()"> <li class="product-item"> <div class="product"> - <each args="$parent.elems()" render=""/> + <each args="$parent.elems()" render=""></each> </div> </li> </each> diff --git a/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details.html b/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details.html index 2491ee12d263..d92aa8553f47 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details.html @@ -12,7 +12,7 @@ <div class="product-item-inner"> <div class="product-item-name-block"> - <strong class="product-item-name" data-bind="html: $parent.name"></strong> + <strong class="product-item-name" data-bind="html: getNameUnsanitizedHtml($parent)"></strong> <div class="details-qty"> <span class="label"><!-- ko i18n: 'Qty' --><!-- /ko --></span> <span class="value" data-bind="text: $parent.qty"></span> @@ -32,10 +32,14 @@ <!--ko foreach: JSON.parse($parent.options)--> <dt class="label" data-bind="text: label"></dt> <!-- ko if: ($data.full_view)--> - <dd class="values" data-bind="html: full_view"></dd> + <!-- ko with: {full_viewUnsanitizedHtml: $data.full_view}--> + <dd class="values" data-bind="html: full_viewUnsanitizedHtml"></dd> + <!-- /ko --> <!-- /ko --> <!-- ko ifnot: ($data.full_view)--> - <dd class="values" data-bind="html: value"></dd> + <!-- ko with: {valueUnsanitizedHtml: $data.value}--> + <dd class="values" data-bind="html: valueUnsanitizedHtml"></dd> + <!-- /ko --> <!-- /ko --> <!-- /ko --> </dl> diff --git a/app/code/Magento/CheckoutAgreements/Model/Checkout/Plugin/Validation.php b/app/code/Magento/CheckoutAgreements/Model/Checkout/Plugin/Validation.php index 5338a16004a0..ceb0240af1df 100644 --- a/app/code/Magento/CheckoutAgreements/Model/Checkout/Plugin/Validation.php +++ b/app/code/Magento/CheckoutAgreements/Model/Checkout/Plugin/Validation.php @@ -86,30 +86,6 @@ public function beforeSavePaymentInformationAndPlaceOrder( } } - /** - * Check validation before saving the payment information - * - * @param \Magento\Checkout\Api\PaymentInformationManagementInterface $subject - * @param int $cartId - * @param \Magento\Quote\Api\Data\PaymentInterface $paymentMethod - * @param \Magento\Quote\Api\Data\AddressInterface|null $billingAddress - * @return void - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - * @throws \Magento\Framework\Exception\NoSuchEntityException - * @throws \Magento\Framework\Exception\CouldNotSaveException - */ - public function beforeSavePaymentInformation( - \Magento\Checkout\Api\PaymentInformationManagementInterface $subject, - $cartId, - \Magento\Quote\Api\Data\PaymentInterface $paymentMethod, - \Magento\Quote\Api\Data\AddressInterface $billingAddress = null - ) { - $quote = $this->quoteRepository->getActive($cartId); - if ($this->isAgreementEnabled() && !$quote->getIsMultiShipping()) { - $this->validateAgreements($paymentMethod); - } - } - /** * Validate agreements base on the payment method * diff --git a/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php b/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php index b7e5127df1f8..6aa3d6223009 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php +++ b/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php @@ -126,11 +126,9 @@ public function testBeforeSavePaymentInformationAndPlaceOrder() ->willReturn(true); $searchCriteriaMock = $this->createMock(SearchCriteria::class); $this->quoteMock - ->expects($this->once()) ->method('getIsMultiShipping') ->willReturn(false); $this->quoteRepositoryMock - ->expects($this->once()) ->method('getActive') ->with($cartId) ->willReturn($this->quoteMock); @@ -146,7 +144,7 @@ public function testBeforeSavePaymentInformationAndPlaceOrder() $this->paymentMock->expects(static::atLeastOnce()) ->method('getExtensionAttributes') ->willReturn($this->extensionAttributesMock); - $this->model->beforeSavePaymentInformation( + $this->model->beforeSavePaymentInformationAndPlaceOrder( $this->subjectMock, $cartId, $this->paymentMock, @@ -166,11 +164,9 @@ public function testBeforeSavePaymentInformationAndPlaceOrderIfAgreementsNotVali ->willReturn(true); $searchCriteriaMock = $this->createMock(SearchCriteria::class); $this->quoteMock - ->expects($this->once()) ->method('getIsMultiShipping') ->willReturn(false); $this->quoteRepositoryMock - ->expects($this->once()) ->method('getActive') ->with($cartId) ->willReturn($this->quoteMock); @@ -186,7 +182,7 @@ public function testBeforeSavePaymentInformationAndPlaceOrderIfAgreementsNotVali $this->paymentMock->expects(static::atLeastOnce()) ->method('getExtensionAttributes') ->willReturn($this->extensionAttributesMock); - $this->model->beforeSavePaymentInformation( + $this->model->beforeSavePaymentInformationAndPlaceOrder( $this->subjectMock, $cartId, $this->paymentMock, @@ -198,40 +194,6 @@ public function testBeforeSavePaymentInformationAndPlaceOrderIfAgreementsNotVali ); } - public function testBeforeSavePaymentInformation() - { - $cartId = 100; - $agreements = [1, 2, 3]; - $this->scopeConfigMock - ->expects($this->once()) - ->method('isSetFlag') - ->with(AgreementsProvider::PATH_ENABLED, ScopeInterface::SCOPE_STORE) - ->willReturn(true); - $this->quoteMock - ->expects($this->once()) - ->method('getIsMultiShipping') - ->willReturn(false); - $this->quoteRepositoryMock - ->expects($this->once()) - ->method('getActive') - ->with($cartId) - ->willReturn($this->quoteMock); - $searchCriteriaMock = $this->createMock(SearchCriteria::class); - $this->agreementsFilterMock->expects($this->once()) - ->method('buildSearchCriteria') - ->willReturn($searchCriteriaMock); - $this->checkoutAgreementsListMock->expects($this->once()) - ->method('getList') - ->with($searchCriteriaMock) - ->willReturn([1]); - $this->extensionAttributesMock->expects($this->once())->method('getAgreementIds')->willReturn($agreements); - $this->agreementsValidatorMock->expects($this->once())->method('isValid')->with($agreements)->willReturn(true); - $this->paymentMock->expects(static::atLeastOnce()) - ->method('getExtensionAttributes') - ->willReturn($this->extensionAttributesMock); - $this->model->beforeSavePaymentInformation($this->subjectMock, $cartId, $this->paymentMock, $this->addressMock); - } - /** * Build payment extension mock. * diff --git a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Tree.php b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Tree.php index c033e09ca8db..028a1a432762 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Tree.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Tree.php @@ -76,8 +76,7 @@ public function getTreeJson() 'path' => substr($item->getFilename(), strlen($storageRoot)), 'cls' => 'folder', ]; - $nestedDirectories = $this->getMediaDirectory()->readRecursively($item->getFilename()); - $hasNestedDirectories = count($nestedDirectories) > 0; + $hasNestedDirectories = $this->hasNestedDirectories($storageRoot, $item->getFilename()); // if no nested directories inside dir, add 'leaf' state so that jstree hides dropdown arrow next to dir if (!$hasNestedDirectories) { @@ -89,6 +88,26 @@ public function getTreeJson() return $this->serializer->serialize($jsonArray); } + /** + * Check if directory has nested directories + * + * @param string $storageRoot + * @param string $fileName + * @return bool + */ + private function hasNestedDirectories(string $storageRoot, string $fileName): bool + { + $pathList = $this->getMediaDirectory()->read($fileName); + foreach ($pathList as $directoryPath) { + $file = $this->_filesystem->getDirectoryReadByPath($storageRoot . $directoryPath); + if ($file->isDirectory()) { + return true; + } + } + + return false; + } + /** * Json source URL * diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Block/Save.php b/app/code/Magento/Cms/Controller/Adminhtml/Block/Save.php index 0c6c6470398c..c18d2ef1fce7 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Block/Save.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Block/Save.php @@ -121,9 +121,9 @@ private function processBlockReturn($model, $data, $resultRedirect) if ($redirect ==='continue') { $resultRedirect->setPath('*/*/edit', ['block_id' => $model->getId()]); - } else if ($redirect === 'close') { + } elseif ($redirect === 'close') { $resultRedirect->setPath('*/*/'); - } else if ($redirect === 'duplicate') { + } elseif ($redirect === 'duplicate') { $duplicateModel = $this->blockFactory->create(['data' => $data]); $duplicateModel->setId(null); $duplicateModel->setIdentifier($data['identifier'] . '-' . uniqid()); diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Page/InlineEdit.php b/app/code/Magento/Cms/Controller/Adminhtml/Page/InlineEdit.php index 2237f35ed0b8..aeeae78e00e2 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Page/InlineEdit.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Page/InlineEdit.php @@ -83,9 +83,9 @@ public function execute() /** @var \Magento\Cms\Model\Page $page */ $page = $this->pageRepository->getById($pageId); try { - $pageData = $this->filterPost($postItems[$pageId]); - $this->validatePost($pageData, $page, $error, $messages); $extendedPageData = $page->getData(); + $pageData = $this->filterPostWithDateConverting($postItems[$pageId], $extendedPageData); + $this->validatePost($pageData, $page, $error, $messages); $this->setCmsPageData($page, $extendedPageData, $pageData); $this->pageRepository->save($page); } catch (\Magento\Framework\Exception\LocalizedException $e) { @@ -127,6 +127,34 @@ protected function filterPost($postData = []) return $pageData; } + /** + * Filtering posted data with converting custom theme dates to proper format + * + * @param array $postData + * @param array $pageData + * @return array + */ + private function filterPostWithDateConverting($postData = [], $pageData = []) + { + $newPageData = $this->filterPost($postData); + if ( + !empty($newPageData['custom_theme_from']) + && date("Y-m-d", strtotime($postData['custom_theme_from'])) + === date("Y-m-d", strtotime($pageData['custom_theme_from'])) + ) { + $newPageData['custom_theme_from'] = date("Y-m-d", strtotime($postData['custom_theme_from'])); + } + if ( + !empty($newPageData['custom_theme_to']) + && date("Y-m-d", strtotime($postData['custom_theme_to'])) + === date("Y-m-d", strtotime($pageData['custom_theme_to'])) + ) { + $newPageData['custom_theme_to'] = date("Y-m-d", strtotime($postData['custom_theme_to'])); + } + + return $newPageData; + } + /** * Validate post data * diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Page/Save.php b/app/code/Magento/Cms/Controller/Adminhtml/Page/Save.php index 449fdb4224a5..34b1e949271d 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Page/Save.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Page/Save.php @@ -3,13 +3,20 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Cms\Controller\Adminhtml\Page; -use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Backend\App\Action; +use Magento\Backend\Model\View\Result\Redirect; +use Magento\Cms\Api\Data\PageInterface; +use Magento\Cms\Api\PageRepositoryInterface; use Magento\Cms\Model\Page; +use Magento\Cms\Model\PageFactory; +use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\App\Request\DataPersistorInterface; +use Magento\Framework\Controller\ResultInterface; use Magento\Framework\Exception\LocalizedException; /** @@ -17,7 +24,7 @@ * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Save extends \Magento\Backend\App\Action implements HttpPostActionInterface +class Save extends Action implements HttpPostActionInterface { /** * Authorization level of a basic admin session @@ -37,12 +44,12 @@ class Save extends \Magento\Backend\App\Action implements HttpPostActionInterfac protected $dataPersistor; /** - * @var \Magento\Cms\Model\PageFactory + * @var PageFactory */ private $pageFactory; /** - * @var \Magento\Cms\Api\PageRepositoryInterface + * @var PageRepositoryInterface */ private $pageRepository; @@ -50,21 +57,20 @@ class Save extends \Magento\Backend\App\Action implements HttpPostActionInterfac * @param Action\Context $context * @param PostDataProcessor $dataProcessor * @param DataPersistorInterface $dataPersistor - * @param \Magento\Cms\Model\PageFactory|null $pageFactory - * @param \Magento\Cms\Api\PageRepositoryInterface|null $pageRepository + * @param PageFactory|null $pageFactory + * @param PageRepositoryInterface|null $pageRepository */ public function __construct( Action\Context $context, PostDataProcessor $dataProcessor, DataPersistorInterface $dataPersistor, - \Magento\Cms\Model\PageFactory $pageFactory = null, - \Magento\Cms\Api\PageRepositoryInterface $pageRepository = null + PageFactory $pageFactory = null, + PageRepositoryInterface $pageRepository = null ) { $this->dataProcessor = $dataProcessor; $this->dataPersistor = $dataPersistor; - $this->pageFactory = $pageFactory ?: ObjectManager::getInstance()->get(\Magento\Cms\Model\PageFactory::class); - $this->pageRepository = $pageRepository - ?: ObjectManager::getInstance()->get(\Magento\Cms\Api\PageRepositoryInterface::class); + $this->pageFactory = $pageFactory ?: ObjectManager::getInstance()->get(PageFactory::class); + $this->pageRepository = $pageRepository ?: ObjectManager::getInstance()->get(PageRepositoryInterface::class); parent::__construct($context); } @@ -72,12 +78,12 @@ public function __construct( * Save action * * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @return \Magento\Framework\Controller\ResultInterface + * @return ResultInterface */ public function execute() { $data = $this->getRequest()->getPostValue(); - /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ + /** @var Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); if ($data) { $data = $this->dataProcessor->filter($data); @@ -88,7 +94,7 @@ public function execute() $data['page_id'] = null; } - /** @var \Magento\Cms\Model\Page $model */ + /** @var Page $model */ $model = $this->pageFactory->create(); $id = $this->getRequest()->getParam('page_id'); @@ -117,7 +123,7 @@ public function execute() } catch (LocalizedException $e) { $this->messageManager->addExceptionMessage($e->getPrevious() ?: $e); } catch (\Throwable $e) { - $this->messageManager->addExceptionMessage($e, __('Something went wrong while saving the page.')); + $this->messageManager->addErrorMessage(__('Something went wrong while saving the page.')); } $this->dataPersistor->set('cms_page', $data); @@ -129,10 +135,10 @@ public function execute() /** * Process result redirect * - * @param \Magento\Cms\Api\Data\PageInterface $model - * @param \Magento\Backend\Model\View\Result\Redirect $resultRedirect + * @param PageInterface $model + * @param Redirect $resultRedirect * @param array $data - * @return \Magento\Backend\Model\View\Result\Redirect + * @return Redirect * @throws LocalizedException */ private function processResultRedirect($model, $resultRedirect, $data) @@ -149,7 +155,7 @@ private function processResultRedirect($model, $resultRedirect, $data) '*/*/edit', [ 'page_id' => $newPage->getId(), - '_current' => true + '_current' => true, ] ); } diff --git a/app/code/Magento/Cms/Helper/Wysiwyg/Images.php b/app/code/Magento/Cms/Helper/Wysiwyg/Images.php index e42bb0143f6b..b45d4a04b62b 100644 --- a/app/code/Magento/Cms/Helper/Wysiwyg/Images.php +++ b/app/code/Magento/Cms/Helper/Wysiwyg/Images.php @@ -6,9 +6,11 @@ namespace Magento\Cms\Helper\Wysiwyg; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Exception\ValidatorException; /** * Wysiwyg Images Helper. + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Images extends \Magento\Framework\App\Helper\AbstractHelper { @@ -64,6 +66,11 @@ class Images extends \Magento\Framework\App\Helper\AbstractHelper */ protected $escaper; + /** + * @var \Magento\Framework\Filesystem\Directory\Read + */ + private $_readDirectory; + /** * Construct * @@ -87,6 +94,7 @@ public function __construct( $this->_directory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA); $this->_directory->create($this->getStorageRoot()); + $this->_readDirectory = $filesystem->getDirectoryReadByPath($this->getStorageRoot()); } /** @@ -158,7 +166,7 @@ public function convertPathToId($path) * * @param string $id * @return string - * @throws \InvalidArgumentException When path contains restricted symbols. + * @throws \InvalidArgumentException */ public function convertIdToPath($id) { @@ -166,7 +174,10 @@ public function convertIdToPath($id) return $this->getStorageRoot(); } else { $path = $this->getStorageRoot() . $this->idDecode($id); - if (preg_match('/\.\.(\\\|\/)/', $path)) { + + try { + $this->_readDirectory->getAbsolutePath($path); + } catch (\Exception $e) { throw new \InvalidArgumentException('Path is invalid'); } diff --git a/app/code/Magento/Cms/Model/Block.php b/app/code/Magento/Cms/Model/Block.php index ab8d65399f37..8b9cef07e3b5 100644 --- a/app/code/Magento/Cms/Model/Block.php +++ b/app/code/Magento/Cms/Model/Block.php @@ -15,6 +15,8 @@ use Magento\Framework\Registry; use Magento\Framework\Model\ResourceModel\AbstractResource; use Magento\Framework\Data\Collection\AbstractDb; +use Magento\Backend\Model\Validator\UrlKey\CompositeUrlKey; +use Magento\Framework\Exception\LocalizedException; /** * CMS block model @@ -52,6 +54,11 @@ class Block extends AbstractModel implements BlockInterface, IdentityInterface */ private $wysiwygValidator; + /** + * @var CompositeUrlKey + */ + private $compositeUrlValidator; + /** * @param Context $context * @param Registry $registry @@ -59,6 +66,7 @@ class Block extends AbstractModel implements BlockInterface, IdentityInterface * @param AbstractDb|null $resourceCollection * @param array $data * @param WYSIWYGValidatorInterface|null $wysiwygValidator + * @param CompositeUrlKey|null $compositeUrlValidator */ public function __construct( Context $context, @@ -66,11 +74,14 @@ public function __construct( AbstractResource $resource = null, AbstractDb $resourceCollection = null, array $data = [], - ?WYSIWYGValidatorInterface $wysiwygValidator = null + ?WYSIWYGValidatorInterface $wysiwygValidator = null, + CompositeUrlKey $compositeUrlValidator = null ) { parent::__construct($context, $registry, $resource, $resourceCollection, $data); $this->wysiwygValidator = $wysiwygValidator ?? ObjectManager::getInstance()->get(WYSIWYGValidatorInterface::class); + $this->compositeUrlValidator = $compositeUrlValidator + ?? ObjectManager::getInstance()->get(CompositeUrlKey::class); } /** @@ -101,6 +112,12 @@ public function beforeSave() __('Make sure that static block content does not reference the block itself.') ); } + + $errors = $this->compositeUrlValidator->validate($this->getIdentifier()); + if (!empty($errors)) { + throw new LocalizedException($errors[0]); + } + parent::beforeSave(); //Validating HTML content. diff --git a/app/code/Magento/Cms/Model/Page.php b/app/code/Magento/Cms/Model/Page.php index 7e3e3ff44cfa..8469d60f56fe 100644 --- a/app/code/Magento/Cms/Model/Page.php +++ b/app/code/Magento/Cms/Model/Page.php @@ -15,6 +15,7 @@ use Magento\Framework\Model\AbstractModel; use Magento\Framework\Validation\ValidationException; use Magento\Framework\Validator\HTML\WYSIWYGValidatorInterface; +use Magento\Backend\Model\Validator\UrlKey\CompositeUrlKey; /** * Cms Page Model @@ -72,6 +73,11 @@ class Page extends AbstractModel implements PageInterface, IdentityInterface */ private $wysiwygValidator; + /** + * @var CompositeUrlKey + */ + private $compositeUrlValidator; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry @@ -80,6 +86,7 @@ class Page extends AbstractModel implements PageInterface, IdentityInterface * @param array $data * @param CustomLayoutRepository|null $customLayoutRepository * @param WYSIWYGValidatorInterface|null $wysiwygValidator + * @param CompositeUrlKey|null $compositeUrlValidator */ public function __construct( \Magento\Framework\Model\Context $context, @@ -88,13 +95,16 @@ public function __construct( \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [], ?CustomLayoutRepository $customLayoutRepository = null, - ?WYSIWYGValidatorInterface $wysiwygValidator = null + ?WYSIWYGValidatorInterface $wysiwygValidator = null, + CompositeUrlKey $compositeUrlValidator = null ) { parent::__construct($context, $registry, $resource, $resourceCollection, $data); $this->customLayoutRepository = $customLayoutRepository ?? ObjectManager::getInstance()->get(CustomLayoutRepository::class); $this->wysiwygValidator = $wysiwygValidator ?? ObjectManager::getInstance()->get(WYSIWYGValidatorInterface::class); + $this->compositeUrlValidator = $compositeUrlValidator + ?? ObjectManager::getInstance()->get(CompositeUrlKey::class); } /** @@ -601,6 +611,10 @@ private function validateNewIdentifier(): void ); } } + $errors = $this->compositeUrlValidator->validate($currentIdentifier); + if (!empty($errors)) { + throw new LocalizedException($errors[0]); + } } /** diff --git a/app/code/Magento/Cms/Model/Page/DataProvider.php b/app/code/Magento/Cms/Model/Page/DataProvider.php index 41010575a1f2..6afde01cfe6c 100644 --- a/app/code/Magento/Cms/Model/Page/DataProvider.php +++ b/app/code/Magento/Cms/Model/Page/DataProvider.php @@ -5,24 +5,24 @@ */ namespace Magento\Cms\Model\Page; -use Magento\Cms\Model\Page; +use Magento\Cms\Api\Data\PageInterface; +use Magento\Cms\Api\PageRepositoryInterface; +use Magento\Cms\Model\PageFactory; use Magento\Cms\Model\ResourceModel\Page\CollectionFactory; use Magento\Framework\App\ObjectManager; use Magento\Framework\App\Request\DataPersistorInterface; use Magento\Framework\App\RequestInterface; -use Magento\Ui\DataProvider\Modifier\PoolInterface; use Magento\Framework\AuthorizationInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Ui\DataProvider\Modifier\PoolInterface; +use Magento\Ui\DataProvider\ModifierPoolDataProvider; +use Psr\Log\LoggerInterface; /** - * Class DataProvider + * Cms Page DataProvider */ -class DataProvider extends \Magento\Ui\DataProvider\ModifierPoolDataProvider +class DataProvider extends ModifierPoolDataProvider { - /** - * @var \Magento\Cms\Model\ResourceModel\Page\Collection - */ - protected $collection; - /** * @var DataPersistorInterface */ @@ -33,6 +33,11 @@ class DataProvider extends \Magento\Ui\DataProvider\ModifierPoolDataProvider */ protected $loadedData; + /** + * @var PageRepositoryInterface + */ + private $pageRepository; + /** * @var AuthorizationInterface */ @@ -49,9 +54,14 @@ class DataProvider extends \Magento\Ui\DataProvider\ModifierPoolDataProvider private $customLayoutManager; /** - * @var CollectionFactory + * @var PageFactory + */ + private $pageFactory; + + /** + * @var LoggerInterface */ - private $collectionFactory; + private $logger; /** * @param string $name @@ -65,6 +75,9 @@ class DataProvider extends \Magento\Ui\DataProvider\ModifierPoolDataProvider * @param AuthorizationInterface|null $auth * @param RequestInterface|null $request * @param CustomLayoutManagerInterface|null $customLayoutManager + * @param PageRepositoryInterface|null $pageRepository + * @param PageFactory|null $pageFactory + * @param LoggerInterface|null $logger * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -78,33 +91,22 @@ public function __construct( PoolInterface $pool = null, ?AuthorizationInterface $auth = null, ?RequestInterface $request = null, - ?CustomLayoutManagerInterface $customLayoutManager = null + ?CustomLayoutManagerInterface $customLayoutManager = null, + ?PageRepositoryInterface $pageRepository = null, + ?PageFactory $pageFactory = null, + ?LoggerInterface $logger = null ) { + parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data, $pool); $this->collection = $pageCollectionFactory->create(); - $this->collectionFactory = $pageCollectionFactory; $this->dataPersistor = $dataPersistor; - parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data, $pool); $this->auth = $auth ?? ObjectManager::getInstance()->get(AuthorizationInterface::class); $this->meta = $this->prepareMeta($this->meta); $this->request = $request ?? ObjectManager::getInstance()->get(RequestInterface::class); $this->customLayoutManager = $customLayoutManager ?? ObjectManager::getInstance()->get(CustomLayoutManagerInterface::class); - } - - /** - * Find requested page. - * - * @return Page|null - */ - private function findCurrentPage(): ?Page - { - if ($this->getRequestFieldName() && ($pageId = (int)$this->request->getParam($this->getRequestFieldName()))) { - //Loading data for the collection. - $this->getData(); - return $this->collection->getItemById($pageId); - } - - return null; + $this->pageRepository = $pageRepository ?? ObjectManager::getInstance()->get(PageRepositoryInterface::class); + $this->pageFactory = $pageFactory ?: ObjectManager::getInstance()->get(PageFactory::class); + $this->logger = $logger ?: ObjectManager::getInstance()->get(LoggerInterface::class); } /** @@ -128,29 +130,53 @@ public function getData() if (isset($this->loadedData)) { return $this->loadedData; } - $this->collection = $this->collectionFactory->create(); - $items = $this->collection->getItems(); - /** @var $page \Magento\Cms\Model\Page */ - foreach ($items as $page) { - $this->loadedData[$page->getId()] = $page->getData(); - if ($page->getCustomLayoutUpdateXml() || $page->getLayoutUpdateXml()) { - //Deprecated layout update exists. - $this->loadedData[$page->getId()]['layout_update_selected'] = '_existing_'; + + $page = $this->getCurrentPage(); + $this->loadedData[$page->getId()] = $page->getData(); + if ($page->getCustomLayoutUpdateXml() || $page->getLayoutUpdateXml()) { + //Deprecated layout update exists. + $this->loadedData[$page->getId()]['layout_update_selected'] = '_existing_'; + } + + return $this->loadedData; + } + + /** + * Return current page + * + * @return PageInterface + */ + private function getCurrentPage(): PageInterface + { + $pageId = $this->getPageId(); + if ($pageId) { + try { + $page = $this->pageRepository->getById($pageId); + } catch (LocalizedException $exception) { + $page = $this->pageFactory->create(); } + + return $page; } $data = $this->dataPersistor->get('cms_page'); - if (!empty($data)) { - $page = $this->collection->getNewEmptyItem(); - $page->setData($data); - $this->loadedData[$page->getId()] = $page->getData(); - if ($page->getCustomLayoutUpdateXml() || $page->getLayoutUpdateXml()) { - $this->loadedData[$page->getId()]['layout_update_selected'] = '_existing_'; - } - $this->dataPersistor->clear('cms_page'); + if (empty($data)) { + return $this->pageFactory->create(); } + $this->dataPersistor->clear('cms_page'); - return $this->loadedData; + return $this->pageFactory->create() + ->setData($data); + } + + /** + * Returns current page id from request + * + * @return int + */ + private function getPageId(): int + { + return (int) $this->request->getParam($this->getRequestFieldName()); } /** @@ -186,16 +212,20 @@ public function getMeta() //List of custom layout files available for current page. $options = [['label' => 'No update', 'value' => '_no_update_']]; - if ($page = $this->findCurrentPage()) { - //We must have a specific page selected. - //If custom layout XML is set then displaying this special option. + + $page = null; + try { + $page = $this->pageRepository->getById($this->getPageId()); if ($page->getCustomLayoutUpdateXml() || $page->getLayoutUpdateXml()) { $options[] = ['label' => 'Use existing layout update XML', 'value' => '_existing_']; } foreach ($this->customLayoutManager->fetchAvailableFiles($page) as $layoutFile) { $options[] = ['label' => $layoutFile, 'value' => $layoutFile]; } + } catch (LocalizedException $e) { + $this->logger->error($e->getMessage()); } + $customLayoutMeta = [ 'design' => [ 'children' => [ diff --git a/app/code/Magento/Cms/Model/Wysiwyg/DefaultConfigProvider.php b/app/code/Magento/Cms/Model/Wysiwyg/DefaultConfigProvider.php index 2ff2aa3f82ba..326f8b7d26b9 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/DefaultConfigProvider.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/DefaultConfigProvider.php @@ -9,7 +9,7 @@ namespace Magento\Cms\Model\Wysiwyg; /** - * Class DefaultConfigProvider returns data required to render tinymce4 editor + * Class DefaultConfigProvider returns data required to render tinymce editor */ class DefaultConfigProvider implements \Magento\Framework\Data\Wysiwyg\ConfigProviderInterface { @@ -32,7 +32,7 @@ public function __construct(\Magento\Framework\View\Asset\Repository $assetRepo) public function getConfig(\Magento\Framework\DataObject $config) : \Magento\Framework\DataObject { $config->addData([ - 'tinymce4' => [ + 'tinymce' => [ 'toolbar' => 'formatselect | bold italic underline | alignleft aligncenter alignright | ' . 'bullist numlist | link table charmap', 'plugins' => implode( diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php index 617c8663d6f8..ad6a79e5bbd6 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php @@ -7,6 +7,7 @@ namespace Magento\Cms\Model\Wysiwyg\Images\Storage; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Exception\FileSystemException; /** * Wysiwyg Images storage collection @@ -43,11 +44,16 @@ protected function _generateRow($filename) { $filename = preg_replace('~[/\\\]+(?<![htps?]://)~', '/', $filename); $path = $this->_filesystem->getDirectoryWrite(DirectoryList::MEDIA); + try { + $mtime = $path->stat($path->getRelativePath($filename))['mtime']; + } catch (FileSystemException $e) { + $mtime = 0; + } return [ 'filename' => rtrim($filename, '/'), // phpcs:ignore Magento2.Functions.DiscouragedFunction 'basename' => basename($filename), - 'mtime' => $path->stat($path->getRelativePath($filename))['mtime'] + 'mtime' => $mtime ]; } } diff --git a/app/code/Magento/Cms/Observer/PageValidatorObserver.php b/app/code/Magento/Cms/Observer/PageValidatorObserver.php index b4e5d2bc0e0a..9b54712fb7d6 100644 --- a/app/code/Magento/Cms/Observer/PageValidatorObserver.php +++ b/app/code/Magento/Cms/Observer/PageValidatorObserver.php @@ -3,7 +3,6 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - declare(strict_types=1); namespace Magento\Cms\Observer; diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCloseContentMenuTabActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCloseContentMenuTabActionGroup.xml new file mode 100644 index 000000000000..a1bf826e1491 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCloseContentMenuTabActionGroup.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCloseContentMenuTabActionGroup"> + <annotations> + <description>Close tab 'Content' on main menu.</description> + </annotations> + <conditionalClick selector="{{AdminMenuSection.menuItem('magento-backend-content')}}" dependentSelector="{{AdminMenuSection.contentMenuClose}}" visible="true" stepKey="closeContentTab"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageSetUrlActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageSetUrlActionGroup.xml new file mode 100644 index 000000000000..a5fa342a1145 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCmsPageSetUrlActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCmsPageSetUrlActionGroup"> + <arguments> + <argument name="urlKey" type="string"/> + </arguments> + + <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{urlKey}}" stepKey="fillPageUrlKey"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminExpandContentSectionActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminExpandContentSectionActionGroup.xml new file mode 100644 index 000000000000..583708cd99b5 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminExpandContentSectionActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminExpandContentSectionActionGroup"> + <annotations> + <description>Expand Content section on the Admin CMS Page creation/edit.</description> + </annotations> + <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="expandContentSection"/> + <waitForPageLoad stepKey="waitForContentSection"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminExpandSeoSectionActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminExpandSeoSectionActionGroup.xml new file mode 100644 index 000000000000..0796496cc599 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminExpandSeoSectionActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminExpandSeoSectionActionGroup"> + <annotations> + <description>Expand SEO section on the Admin CMS Page creation/edit.</description> + </annotations> + <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="expandSeoSection"/> + <waitForPageLoad stepKey="waitForSeoSection"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenContentMenuTabActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenContentMenuTabActionGroup.xml new file mode 100644 index 000000000000..78451fbbbe61 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenContentMenuTabActionGroup.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminOpenContentMenuTabActionGroup"> + <annotations> + <description>Open tab 'Content' on main menu.</description> + </annotations> + <conditionalClick selector="{{AdminMenuSection.menuItem('magento-backend-content')}}" dependentSelector="{{AdminMenuSection.contentMenuClose}}" visible="false" stepKey="openContentTab"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSetProductLayoutSettingsActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSetProductLayoutSettingsActionGroup.xml new file mode 100644 index 000000000000..4f8934d243b3 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSetProductLayoutSettingsActionGroup.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminSetProductLayoutSettingsActionGroup"> + <annotations> + <description>Sets the 'Default Product Layout' to requested value.</description> + </annotations> + <arguments> + <argument name="layout" type="string"/> + </arguments> + + <waitForElementVisible selector="{{DefaultLayoutsSection.productLayout}}" stepKey="waittForDefaultProductLayout"/> + <selectOption selector="{{DefaultLayoutsSection.productLayout}}" userInput="{{layout}}" stepKey="selectLayout"/> + <click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/> + <waitForPageLoad stepKey="waitForSavingSystemConfiguration"/> + <see userInput="You saved the configuration." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertStorefrontProductIsShownOnCmsPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertStorefrontProductIsShownOnCmsPageActionGroup.xml new file mode 100644 index 000000000000..271350bac327 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertStorefrontProductIsShownOnCmsPageActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontProductIsShownOnCmsPageActionGroup"> + <arguments> + <argument name="cmsTitle" type="string"/> + <argument name="productName" type="string" defaultValue="{{_defaultProduct.name}}"/> + </arguments> + + <seeInTitle userInput="{{cmsTitle}}" stepKey="seePageTitle"/> + <see selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" userInput="{{productName}}" stepKey="seeProductName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsFromCMSContentActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsFromCMSContentActionGroup.xml index a50f674208d6..c75fda273acd 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsFromCMSContentActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsFromCMSContentActionGroup.xml @@ -19,9 +19,9 @@ <waitForElementNotVisible selector="{{CmsWYSIWYGSection.CheckIfTabExpand}}" stepKey="waitForTabExpand"/> <executeJS function="jQuery('[id=\'cms_page_form_content_ifr\']').attr('name', 'preview-iframe')" stepKey="setPreviewFrameName"/> <switchToIFrame selector="preview-iframe" stepKey="switchToIframe"/> - <fillField selector="{{TinyMCESection.EditorContent}}" userInput="Hello TinyMCE4!" stepKey="clearWidgets"/> + <fillField selector="{{TinyMCESection.EditorContent}}" userInput="Hello TinyMCE!" stepKey="clearWidgets"/> <switchToIFrame stepKey="switchOutFromIframe"/> - <executeJS function="tinyMCE.activeEditor.setContent('Hello TinyMCE4!');" stepKey="executeJSFillContent1"/> + <executeJS function="tinyMCE.activeEditor.setContent('Hello TinyMCE!');" stepKey="executeJSFillContent1"/> <click selector="{{InsertWidgetSection.save}}" stepKey="saveWidget"/> <waitForPageLoad stepKey="waitSaveToBeApplied"/> <see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the page." stepKey="seeSaveSuccess"/> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CliEnableTinyMCEActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CliEnableTinyMCEActionGroup.xml new file mode 100644 index 000000000000..6d42ffabe7ca --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CliEnableTinyMCEActionGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="CliEnableTinyMCEActionGroup"> + <annotations> + <description>Enable Tiny MCE by CLI command config:set</description> + </annotations> + <arguments> + <argument name="TinyMCEValue" type="string"/> + </arguments> + + <magentoCLI command="config:set {{EnableTinyMCE.path}} {{TinyMCEValue}}" stepKey="enableTinyMCE"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndCloseCMSBlockWithSplitButtonActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndCloseCMSBlockWithSplitButtonActionGroup.xml index 44e29f7e2fe5..e0729a55afa2 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndCloseCMSBlockWithSplitButtonActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndCloseCMSBlockWithSplitButtonActionGroup.xml @@ -18,6 +18,7 @@ <click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveBlock"/> <waitForPageLoad stepKey="waitForPageLoadAfterClickingSave"/> <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessageAppear"/> + <dontSee selector="{{BlockPageActionsSection.saveBlockWarningMessage}}" stepKey="dontSeeWarningMessage"/> <see userInput="You saved the block." selector="{{AdminMessagesSection.success}}" stepKey="assertSaveBlockSuccessMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCMSBlockActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCMSBlockActionGroup.xml index 2f86df70ae8c..5c58fc8538d0 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCMSBlockActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCMSBlockActionGroup.xml @@ -16,6 +16,7 @@ <waitForElementVisible selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="waitForSaveButton"/> <click selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="clickSaveButton"/> <waitForPageLoad stepKey="waitForPageLoad"/> + <dontSee selector="{{BlockPageActionsSection.saveBlockWarningMessage}}" stepKey="dontSeeWarningMessage"/> <see userInput="You saved the block." stepKey="seeSuccessfulSaveMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCmsPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCmsPageActionGroup.xml index 5b3b0460edbd..188a55d96e7e 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCmsPageActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCmsPageActionGroup.xml @@ -18,6 +18,7 @@ <waitForElementVisible selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="waitForSaveCmsPage"/> <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSaveCmsPage"/> <waitForElementVisible time="1" selector="{{CmsPagesPageActionsSection.addNewPageButton}}" stepKey="waitForCmsPageSaveButton"/> + <dontSee selector="{{CmsPagesPageActionsSection.savePageWarningMessage}}" stepKey="dontSeeWarningMessage"/> <see userInput="You saved the page." selector="{{CmsPagesPageActionsSection.savePageSuccessMessage}}" stepKey="assertSavePageSuccessMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/Data/CmsPageData.xml b/app/code/Magento/Cms/Test/Mftf/Data/CmsPageData.xml index 5dc100573c37..5075a9cfa02b 100644 --- a/app/code/Magento/Cms/Test/Mftf/Data/CmsPageData.xml +++ b/app/code/Magento/Cms/Test/Mftf/Data/CmsPageData.xml @@ -88,6 +88,19 @@ <data key="height">1000</data> <data key="path">wysiwyg</data> </entity> + <entity name="ImageUploadMedium" type="uploadImage"> + <data key="title" unique="suffix">Medium Image</data> + <data key="price">1.00</data> + <data key="file_type">Upload File</data> + <data key="shareable">Yes</data> + <data key="value">medium.jpg</data> + <data key="file">medium.jpg</data> + <data key="fileName">medium</data> + <data key="extension">jpg</data> + <data key="content">Image content. Yeah.</data> + <data key="height">508</data> + <data key="path">wysiwyg</data> + </entity> <entity name="ImageFolder" type="uploadImage"> <data key="name" unique="suffix">Test</data> </entity> diff --git a/app/code/Magento/Cms/Test/Mftf/Data/WysiwygConfigData.xml b/app/code/Magento/Cms/Test/Mftf/Data/WysiwygConfigData.xml index 66f2983140b4..3c0fe64255b8 100644 --- a/app/code/Magento/Cms/Test/Mftf/Data/WysiwygConfigData.xml +++ b/app/code/Magento/Cms/Test/Mftf/Data/WysiwygConfigData.xml @@ -18,14 +18,10 @@ <data key="scope_id">0</data> <data key="value">disabled</data> </entity> - <entity name="WysiwygTinyMCE3Enable" deprecated="Use WysiwygTinyMCE4Enable instead"> - <data key="path">cms/wysiwyg/editor</data> - <data key="scope_id">0</data> - <data key="value">Magento_Tinymce3/tinymce3Adapter</data> - </entity> - <entity name="WysiwygTinyMCE4Enable"> + <entity name="EnableTinyMCE"> <data key="path">cms/wysiwyg/editor</data> <data key="scope_id">0</data> + <data key="label">Yes</data> <data key="value">mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter</data> </entity> </entities> diff --git a/app/code/Magento/Cms/Test/Mftf/Page/CmsPagesPage.xml b/app/code/Magento/Cms/Test/Mftf/Page/CmsPagesPage.xml index 45ba6eb6cf00..deeec372a410 100644 --- a/app/code/Magento/Cms/Test/Mftf/Page/CmsPagesPage.xml +++ b/app/code/Magento/Cms/Test/Mftf/Page/CmsPagesPage.xml @@ -10,5 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="CmsPagesPage" url="/cms/page" area="admin" module="Magento_Cms"> <section name="CmsPagesPageActionsSection"/> + <section name="AdminCmsPageGridInlineEditSection"/> </page> </pages> diff --git a/app/code/Magento/Cms/Test/Mftf/Section/AdminCmsPageGridInlineEditSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/AdminCmsPageGridInlineEditSection.xml new file mode 100644 index 000000000000..713f15789ffc --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Section/AdminCmsPageGridInlineEditSection.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminCmsPageGridInlineEditSection"> + <element name="customDesignFrom" type="input" selector="tr.data-grid-editable-row:not([style*='display: none']) [name='custom_theme_from']"/> + <element name="customDesignTo" type="input" selector="tr.data-grid-editable-row:not([style*='display: none']) [name='custom_theme_to']"/> + <element name="customLayout" type="input" selector="tr.data-grid-editable-row:not([style*='display: none']) [name='page_layout']"/> + <element name="savePageButton" type="button" selector="tr.data-grid-editable-row-actions button.action-primary" timeout="30"/> + </section> +</sections> diff --git a/app/code/Magento/Cms/Test/Mftf/Section/BlockPageActionsSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/BlockPageActionsSection.xml index 38281d4d6d1d..4cd61cc96ea3 100644 --- a/app/code/Magento/Cms/Test/Mftf/Section/BlockPageActionsSection.xml +++ b/app/code/Magento/Cms/Test/Mftf/Section/BlockPageActionsSection.xml @@ -19,6 +19,7 @@ <element name="FilterBtn" type="input" selector="//button[text()='Filters']"/> <element name="URLKey" type="input" selector="//div[@class='admin__form-field-control']/input[@name='identifier']"/> <element name="ApplyFiltersBtn" type="button" selector="//span[text()='Apply Filters']"/> + <element name="saveBlockWarningMessage" type="text" selector=".message-warning"/> <element name="blockGridRowByTitle" type="input" selector="//tbody//tr//td//div[contains(., '{{var1}}')]" parameterized="true" timeout="30"/> <element name="delete" type="button" selector="//a[@data-action='item-delete']"/> <element name="deleteConfirm" type="button" selector="//button[@data-role='action']//span[text()='OK']" timeout="60"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePageContentSection/CmsDesignSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePageContentSection/CmsDesignSection.xml index cf0f6797ce42..251e7101517a 100644 --- a/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePageContentSection/CmsDesignSection.xml +++ b/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePageContentSection/CmsDesignSection.xml @@ -9,6 +9,10 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="CmsDesignSection"> <element name="DesignTab" type="button" selector="//strong[@class='admin__collapsible-title']//span[text()='Design']"/> + <element name="customDesignUpdateTab" type="button" selector="//strong[@class='admin__collapsible-title']//span[text()='Custom Design Update']"/> + <element name="customDesignFrom" type="input" selector="input[name='custom_theme_from']"/> + <element name="customDesignTo" type="input" selector="input[name='custom_theme_to']"/> + <element name="customTheme" type="select" selector="//div[@data-index='custom_design_update']//select[@name='custom_theme']"/> <element name="LayoutDropdown" type="select" selector="select[name='page_layout']"/> </section> </sections> diff --git a/app/code/Magento/Cms/Test/Mftf/Section/CmsPagesPageActionsSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/CmsPagesPageActionsSection.xml index a287685dbdef..f3389072f177 100644 --- a/app/code/Magento/Cms/Test/Mftf/Section/CmsPagesPageActionsSection.xml +++ b/app/code/Magento/Cms/Test/Mftf/Section/CmsPagesPageActionsSection.xml @@ -22,10 +22,11 @@ <element name="clearFilters" type="button" selector=".admin__data-grid-header button[data-action='grid-filter-reset']" timeout="30"/> <element name="activeFilters" type="button" selector="//div[@class='admin__data-grid-header']//span[contains(text(), 'Active filters:')]" /> <element name="spinner" type="input" selector='//div[@data-component="cms_page_listing.cms_page_listing.cms_page_columns"]'/> - <element name="firstItemSelectButton" type="button" selector=".data-grid .action-select-wrap button.action-select"/> - <element name="firstItemEditButton" type="button" selector=".data-grid .action-select-wrap .action-menu-item[data-action~='item-edit']"/> + <element name="firstItemSelectButton" type="button" selector=".data-grid .action-select-wrap button.action-select" timeout="30"/> + <element name="firstItemEditButton" type="button" selector=".data-grid .action-select-wrap .action-menu-item[data-action~='item-edit']" timeout="30"/> <element name="activeFilter" type="button" selector="(//div[contains(@class, 'admin__data-grid-filters-current') and contains(@class, '_show')])[1]"/> <element name="savePageSuccessMessage" type="text" selector=".message-success"/> + <element name="savePageWarningMessage" type="text" selector=".message-warning"/> <element name="delete" type="button" selector="//div[text()='{{var1}}']/parent::td//following-sibling::td[@class='data-grid-actions-cell']//a[text()='Delete']" parameterized="true"/> <element name="deleteConfirm" type="button" selector=".action-primary.action-accept" timeout="60"/> <element name="pageRowCheckboxByIdentifier" type="checkbox" selector="//table[@data-role='grid']//td[count(../../..//th[./*[.='URL Key']]/preceding-sibling::th) + 1][./*[.='{{identifier}}']]/../td//input[@data-action='select-row']" parameterized="true" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Section/StorefrontCMSPageSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/StorefrontCMSPageSection.xml index 4ce8842c1ad8..bb276b2adb0d 100644 --- a/app/code/Magento/Cms/Test/Mftf/Section/StorefrontCMSPageSection.xml +++ b/app/code/Magento/Cms/Test/Mftf/Section/StorefrontCMSPageSection.xml @@ -11,6 +11,7 @@ <section name="StorefrontCMSPageSection"> <element name="mediaDescription" type="text" selector=".column.main>p>img"/> <element name="imageSource" type="text" selector="//img[contains(@src,'{{imageName}}')]" parameterized="true"/> + <element name="imageBySource" type="text" selector="img[src*='{{imageName}}']" parameterized="true"/> <element name="mainTitle" type="text" selector="#maincontent .page-title"/> <element name="mainContent" type="text" selector="#maincontent"/> <element name="footerTop" type="text" selector="footer.page-footer"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection/MediaGallerySection.xml b/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection/MediaGallerySection.xml index 212035fbc575..b78639545e68 100644 --- a/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection/MediaGallerySection.xml +++ b/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection/MediaGallerySection.xml @@ -17,7 +17,6 @@ <element name="imageSelected" type="text" selector="//small[text()='{{var1}}']/parent::*[@class='filecnt selected']" parameterized="true"/> <element name="ImageSource" type="input" selector=".mce-combobox.mce-abs-layout-item.mce-last.mce-has-open"/> <element name="ImageDescription" type="input" selector=".mce-textbox.mce-abs-layout-item.mce-last"/> - <element name="ImageDescriptionTinyMCE3" type="input" selector="#alt" deprecated="Deprecated New element was introduced. Please use 'ImageDescriptionTinyMCE4'"/> <element name="ImageDescriptionTinyMCE4" type="input" selector="#alt" /> <element name="Height" type="input" selector=".mce-textbox.mce-abs-layout-item.mce-first"/> <element name="UploadImage" type="file" selector=".fileupload"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml deleted file mode 100644 index 35d8e692cd46..000000000000 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminAddImageToCMSPageTinyMCE3Test" deprecated="TinyMCE3 is no longer supported"> - <annotations> - <features value="Cms"/> - <stories value="Admin should be able to upload images with TinyMCE3 WYSIWYG"/> - <group value="Cms"/> - <title value="Verify that admin is able to upload image to a CMS Page with TinyMCE3 enabled"/> - <description value="Verify that admin is able to upload image to CMS Page with TinyMCE3 enabled"/> - <severity value="BLOCKER"/> - <testCaseId value="MAGETWO-95725"/> - <skip> - <issueId value="DEPRECATED">TinyMCE3 is no longer supported</issueId> - </skip> - </annotations> - <before> - <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> - <magentoCLI command="config:set cms/wysiwyg/enabled enabled" stepKey="enableWYSIWYG"/> - <!-- Choose TinyMCE3 as the default WYSIWYG editor--> - <magentoCLI command="config:set cms/wysiwyg/editor Magento_Tinymce3/tinymce3Adapter" stepKey="enableTinyMCE3"/> - </before> - <after> - <actionGroup ref="NavigateToMediaGalleryActionGroup" stepKey="navigateToMediaGallery"/> - <actionGroup ref="DeleteFolderActionGroup" stepKey="DeleteCreatedFolder"> - <argument name="ImageFolder" value="ImageFolder"/> - </actionGroup> - <!-- Switch WYSIWYG editor to TinyMCE4--> - <comment userInput="Reset editor as TinyMCE4" stepKey="chooseTinyMCE4AsEditor"/> - <magentoCLI command="config:set cms/wysiwyg/editor mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter" stepKey="enableTinyMCE4"/> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - </after> - <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToPage2"/> - <fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_defaultCmsPage.title}}" stepKey="fillFieldTitle2"/> - <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickContentTab2" /> - <comment userInput="removing deprecated element" stepKey="waitForTinyMCE3"/> - <comment userInput="removing deprecated element" stepKey="seeTinyMCE3" /> - <wait time="3" stepKey="waiting"/> - <comment userInput="Click Insert image button" stepKey="clickImageButton"/> - <comment userInput="removing deprecated element" stepKey="clickInsertImage" /> - <waitForPageLoad stepKey="waitForiFrameToLoad" /> - <!-- Switch to the Edit/Insert Image iFrame --> - <comment userInput="Switching to iFrame" stepKey="insertImageiFrame"/> - <executeJS function="document.querySelector('.clearlooks2 iframe').setAttribute('name', 'insert-image');" stepKey="makeIFrameInteractable"/> - <switchToIFrame selector="insert-image" stepKey="switchToIFrame"/> - <click selector="{{MediaGallerySection.browseForImage}}" stepKey="clickBrowse"/> - <switchToIFrame stepKey="switchOutOfIFrame"/> - <waitForPageLoad stepKey="waitForPageToLoad" /> - <actionGroup ref="NavigateToMediaFolderActionGroup" stepKey="navigateToFolder"> - <argument name="FolderName" value="Storage Root"/> - </actionGroup> - <actionGroup ref="CreateImageFolderActionGroup" stepKey="CreateImageFolder"> - <argument name="ImageFolder" value="ImageFolder"/> - </actionGroup> - <actionGroup ref="AttachImageActionGroup" stepKey="attachImage1"> - <argument name="Image" value="ImageUpload"/> - </actionGroup> - <actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/> - <!-- Switching back to the Edit/Insert Image iFrame--> - <comment userInput="switching back to iFrame" stepKey="switchBackToIFrame"/> - <executeJS function="document.querySelector('.clearlooks2 iframe').setAttribute('name', 'insert-image');" stepKey="makeIFrameInteractable2"/> - <switchToIFrame selector="insert-image" stepKey="switchToIFrame2"/> - <waitForElementVisible selector="{{MediaGallerySection.insertBtn}}" stepKey="waitForInsertBtnOnIFrame" /> - <comment userInput="removing deprecated element" stepKey="fillImageDescription" /> - <click selector="{{MediaGallerySection.insertBtn}}" stepKey="clickInsertBtn" /> - <waitForPageLoad stepKey="wait3"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> - </test> -</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml index e2111aac348c..61357d5eb0b1 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml @@ -22,7 +22,9 @@ <createData entity="_defaultBlock" stepKey="createPreReqBlock" /> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> </before> <actionGroup ref="AssignBlockToCMSPage" stepKey="assignBlockToCMSPage"> <argument name="Block" value="$$createPreReqBlock$$"/> @@ -63,8 +65,8 @@ <actionGroup ref="DeleteFolderActionGroup" stepKey="DeleteCreatedFolder"> <argument name="ImageFolder" value="ImageFolder"/> </actionGroup> - <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnEditPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="amOnEditPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad"/> <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> <waitForPageLoad stepKey="waitForGridReload"/> <deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml index 39f44a327094..0746d1385466 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml @@ -21,7 +21,9 @@ <createData entity="_defaultCmsPage" stepKey="createCMSPage" /> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> </before> <after> <actionGroup ref="NavigateToMediaGalleryActionGroup" stepKey="navigateToMediaGallery"/> @@ -60,10 +62,10 @@ <actionGroup ref="FillOutUploadImagePopupActionGroup" stepKey="fillOutUploadImagePopup" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="$$createCMSPage.identifier$$" stepKey="fillFieldUrlKey"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage"/> <waitForPageLoad stepKey="wait4"/> <seeElement selector="{{StorefrontCMSPageSection.mediaDescription}}" stepKey="assertMediaDescription"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddLargeImageToWYSIWYGCMSTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddLargeImageToWYSIWYGCMSTest.xml new file mode 100644 index 000000000000..964b8b5ff91e --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddLargeImageToWYSIWYGCMSTest.xml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAddLargeImageToWYSIWYGCMSTest"> + <annotations> + <features value="Cms"/> + <stories value="Default WYSIWYG toolbar configuration with Magento Media Gallery"/> + <group value="Cms"/> + <title value="Resize image for CMS according to Upload Configuration"/> + <description value="The large image should be resized according to Upload Configuration"/> + <severity value="BLOCKER"/> + <testCaseId value="MC-41826"/> + </annotations> + <before> + <createData entity="_defaultCmsPage" stepKey="createCMSPage" /> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> + </before> + <after> + <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage" /> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> + <argument name="CMSPage" value="$$createCMSPage$$"/> + </actionGroup> + <waitForElementVisible selector="{{TinyMCESection.TinyMCE4}}" stepKey="waitForTinyMCE4" /> + <click selector="{{TinyMCESection.InsertImageIcon}}" stepKey="clickInsertImageIcon" /> + <waitForPageLoad stepKey="waitForPageLoad" /> + <actionGroup ref="ClickBrowseBtnOnUploadPopupActionGroup" stepKey="clickBrowserBtn"/> + <actionGroup ref="AttachImageActionGroup" stepKey="attachImage"> + <argument name="Image" value="ImageUploadMedium"/> + </actionGroup> + <actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/> + <actionGroup ref="FillOutUploadImagePopupActionGroup" stepKey="fillOutUploadImagePopup" /> + <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> + <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="$$createCMSPage.identifier$$" stepKey="fillFieldUrlKey"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage"/> + <waitForPageLoad stepKey="waitPageLoadOnFrontend"/> + <seeElementInDOM selector="{{StorefrontCMSPageSection.imageSource(ImageUploadMedium.fileName)}}" stepKey="assertMediaSource"/> + <executeJS function='return document.querySelector("{{StorefrontCMSPageSection.imageBySource(ImageUploadMedium.fileName)}}").naturalWidth;' stepKey="imageNaturalWith"/> + <assertLessThanOrEqual stepKey="assertMaxImageWith"> + <expectedResult type="int">{{SystemUploadConfigurationMaxWidth.value}}</expectedResult> + <actualResult type="variable">imageNaturalWith</actualResult> + </assertLessThanOrEqual> + <executeJS function='return document.querySelector("{{StorefrontCMSPageSection.imageBySource(ImageUploadMedium.fileName)}}").naturalHeight;' stepKey="imageNaturalHeight"/> + <assertLessThanOrEqual stepKey="assertMaxImageHeight"> + <expectedResult type="int">{{SystemUploadConfigurationMaxHeight.value}}</expectedResult> + <actualResult type="variable">imageNaturalHeight</actualResult> + </assertLessThanOrEqual> + </test> +</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml index 963844710dd7..5f97903bcf1c 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml @@ -22,13 +22,15 @@ <createData entity="_defaultBlock" stepKey="createPreReqBlock" /> <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> </before> <!--Create Custom Variable--> <actionGroup ref="CreateCustomVariableActionGroup" stepKey="createCustomVariable" /> <!--Setup Store information--> <waitForPageLoad stepKey="wait" /> - <amOnPage url="/admin/admin/system_config/" stepKey="goToConfigStoreInformation" /> + <amOnPage url="{{AdminConfigPage.url}}" stepKey="goToConfigStoreInformation" /> <waitForPageLoad stepKey="waitForPageLoad1" /> <conditionalClick selector="{{StoreConfigSection.StoreInformation}}" dependentSelector="{{StoreConfigSection.CheckIfTabExpand}}" stepKey="checkIfTabOpen" visible="true"/> <fillField selector="{{StoreConfigSection.City}}" userInput="{{_defaultVariable.city}}" stepKey="fillCity" /> @@ -82,8 +84,8 @@ <seeElement selector="{{TinyMCESection.InsertVariableBtn}}" stepKey="InsertVariableBtn" /> <click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/> <click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveBlock"/> - <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnEditPage"/> - <waitForPageLoad stepKey="waitForPageLoad7"/> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="amOnEditPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad7"/> <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter1" visible="true"/> <waitForPageLoad stepKey="waitForFilterReload"/> <click selector="{{CmsPagesPageActionsSection.filterButton}}" stepKey="clickFiltersBtn" /> @@ -110,15 +112,15 @@ <waitForElementVisible selector="{{WidgetSection.BlockPage(_defaultBlock.identifier)}}" stepKey="waitForBlockTitle" /> <click selector="{{WidgetSection.BlockPage(_defaultBlock.identifier)}}" stepKey="selectPreCreateBlock" /> <wait time="3" stepKey="wait1" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidgetBtn" /> - <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> - <waitForPageLoad stepKey="waitForPageLoad10" /> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveButtonVisible"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <waitForPageLoad stepKey="waitForPageLoadAfterSaveCmsPage" /> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidgetBtn"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad10"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSaveButtonVisible"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoadAfterSaveCmsPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <conditionalClick selector="{{BlockPageActionsSection.clearAll}}" dependentSelector="{{BlockPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> <waitForPageLoad stepKey="waitForPageLoad2"/> <amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage1"/> @@ -136,8 +138,8 @@ <!--see custom variable blank--> <dontSee userInput="{{customVariable.html}}" stepKey="dontSeeCustomVariableName" /> <after> - <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnEditPage"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="amOnEditPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad2"/> <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> <waitForPageLoad stepKey="waitForGridReload"/> <deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml index 7f3d2537a9b0..61a681a5cf38 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml @@ -19,13 +19,15 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> </before> <!--Create Custom Variable--> <actionGroup ref="CreateCustomVariableActionGroup" stepKey="createCustomVariable" /> <!--Setup Store information--> <waitForPageLoad stepKey="wait" /> - <amOnPage url="/admin/admin/system_config/" stepKey="goToConfigStoreInformation" /> + <amOnPage url="{{AdminConfigPage.url}}" stepKey="goToConfigStoreInformation" /> <waitForPageLoad stepKey="waitForPageLoad1" /> <conditionalClick selector="{{StoreConfigSection.StoreInformation}}" dependentSelector="{{StoreConfigSection.CheckIfTabExpand}}" stepKey="checkIfTabOpen" visible="true"/> <fillField selector="{{StoreConfigSection.City}}" userInput="{{_defaultVariable.city}}" stepKey="fillCity" /> @@ -75,10 +77,10 @@ <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/> <!--see Default Variable on Storefront--> <see userInput="{{_defaultVariable.city}}" stepKey="seeDefaultVariable" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml index 9e28e81c2696..03b359ca8ad6 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml @@ -22,7 +22,9 @@ <createData entity="_defaultBlock" stepKey="createPreReqBlock" /> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> </before> <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage"> <argument name="CMSBlockPage" value="$$createPreReqBlock$$"/> @@ -40,9 +42,9 @@ <waitForElementVisible selector="{{WidgetSection.CMSPage}}" stepKey="waitForPageVisible" /> <click selector="{{WidgetSection.CMSPage}}" stepKey="selectPreCreateCMS" /> <waitForElementNotVisible selector="{{WidgetSection.SelectPageTitle}}" stepKey="waitForSlideOutCloses" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> - <waitForElementNotVisible selector="{{WidgetSection.InsertWidgetTitle}}" stepKey="waitForSlideOutCloses1" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSlideOutCloses1"/> <click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/> <click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveBlock"/> <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> @@ -62,20 +64,20 @@ </actionGroup> <click selector="{{WidgetSection.BlockPage(_defaultBlock.identifier)}}" stepKey="selectPreCreateBlock" /> <wait time="3" stepKey="wait1" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidgetBtn" /> - <waitForLoadingMaskToDisappear stepKey="waitForLoading2" /> - <waitForPageLoad stepKey="waitForPageLoad6" /> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidgetBtn"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading2"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad6"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <actionGroup ref="ClearCacheActionGroup" stepKey="clearCache" /> <amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage1"/> <waitForPageLoad stepKey="waitForPageLoad7" /> <see userInput="Home page" stepKey="seeHomePageCMSPage"/> <after> - <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnEditPage"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="amOnEditPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad2"/> <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> <waitForPageLoad stepKey="waitForGridReload"/> <deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" /> @@ -85,4 +87,3 @@ </after> </test> </tests> - diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml index a599d22eab29..6727c2e1d1d4 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml @@ -21,7 +21,9 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> </before> <!--Main test--> <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToPage"/> @@ -48,17 +50,17 @@ <click selector="{{WidgetSection.CMSPage}}" stepKey="selectPreCreateCMS" /> <waitForElementNotVisible selector="{{WidgetSection.SelectPageTitle}}" stepKey="waitForSlideOutCloses" /> <wait time="3" stepKey="waitForInsertWidgetClickable"/> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> <waitForElementNotVisible selector="{{WidgetSection.InsertWidgetTitle}}" stepKey="waitForSlideoutCloses" /> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <wait stepKey="waitForPageLoad5" time="10" /> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/> <waitForPageLoad stepKey="wait5" /> <see userInput="Hello CMS Page!" stepKey="seeContent"/> @@ -70,4 +72,3 @@ </after> </test> </tests> - diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml index 1c9d7b38a40a..26f4312464a4 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml @@ -22,7 +22,9 @@ <createData entity="_defaultBlock" stepKey="createPreReqBlock" /> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> </before> <!--Main test--> <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToPage"/> @@ -51,15 +53,15 @@ <scrollTo selector="{{WidgetSection.BlockPage($$createPreReqBlock.identifier$$)}}" stepKey="scrollToBlockIdentifier" /> <click selector="{{WidgetSection.BlockPage($$createPreReqBlock.identifier$$)}}" stepKey="selectPreCreateBlock" /> <waitForElementNotVisible selector="{{WidgetSection.SelectBlockTitle}}" stepKey="waitForSlideoutCloses" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForLoadingMaskToDisappear stepKey="waitingForLoading" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitingForLoading"/> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/> <waitForPageLoad stepKey="wait5" /> <!--see widget on Storefront--> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml index 4f78f6bcce5e..153210e15d0f 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml @@ -21,7 +21,9 @@ <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> <actionGroup ref="ConfigAdminAccountSharingActionGroup" stepKey="allowAdminShareAccount"/> </before> <!--Main test--> @@ -49,15 +51,15 @@ <waitForElementVisible selector="{{WidgetSection.PreCreateCategory('$$createPreReqCategory.name$$')}}" stepKey="expandWait" /> <click selector="{{WidgetSection.PreCreateCategory('$$createPreReqCategory.name$$')}}" stepKey="selectPreCreateCategory" /> <waitForElementNotVisible selector="{{WidgetSection.SelectCategoryTitle}}" stepKey="waitForSlideoutCloses1" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForElementNotVisible selector="{{WidgetSection.InsertWidgetTitle}}" stepKey="waitForSlideOutCloses2" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSlideOutCloses2"/> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/> <waitForPageLoad stepKey="wait5" /> <see userInput="Hello CMS Page!" stepKey="seeContent"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml index 4ee5b0d263d4..7322dce5afec 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml @@ -25,7 +25,9 @@ </createData> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> </before> <!--Main test--> <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToPage"/> @@ -55,16 +57,16 @@ <waitForLoadingMaskToDisappear stepKey="waitLoadingMask" /> <click selector="{{WidgetSection.PreCreateProduct('$$createPreReqProduct.name$$')}}" stepKey="selectPreProduct" /> <waitForElementNotVisible selector="{{WidgetSection.SelectProductTitle}}" stepKey="waitForSlideOutCloses" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForLoadingMaskToDisappear stepKey="waitLoadingMask1" /> - <waitForPageLoad stepKey="wait6" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitLoadingMask1"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait6"/> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/> <waitForPageLoad stepKey="wait7" /> <!--see widget on Storefront--> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml index 6c36913cbb59..7817b3f5e3d3 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml @@ -27,7 +27,9 @@ </createData> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> </before> <!--Main test--> <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToPage"/> @@ -79,15 +81,15 @@ <click selector="{{WidgetSection.RuleParam}}" stepKey="clickRuleParam3"/> <fillField selector="{{WidgetSection.RuleParamInput('3','2')}}" userInput="1" stepKey="fillMinPrice"/> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForPageLoad stepKey="wait6" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait6"/> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/> <waitForPageLoad stepKey="wait5" /> <!--see widget on Storefront--> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml index 440f63403c51..7c5909234d50 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml @@ -26,7 +26,9 @@ </createData> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> </before> <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToPage"/> <fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_defaultCmsPage.title}}" stepKey="fillFieldTitle"/> @@ -51,19 +53,19 @@ <selectOption selector="{{WidgetSection.ProductAttribute}}" userInput="Name" stepKey="selectProductAttributes" /> <selectOption selector="{{WidgetSection.ButtonToShow}}" userInput="Add to Cart" stepKey="selectBtnToShow" /> <selectOption selector="{{WidgetSection.WidgetTemplate}}" userInput="Compared Products Grid Template" stepKey="selectTemplate" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> - <amOnPage url="$$createPreReqProduct.name$$.html" stepKey="amOnProductPage" /> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> + <amOnPage url="$$createPreReqProduct.custom_attributes[url_key]$$.html" stepKey="amOnProductPage" /> <waitForPageLoad stepKey="waitForPage" /> <click selector="{{WidgetSection.CompareBtn}}" stepKey="clickCompareBtn" /> - <amOnPage url="$$createPreReqCategory.name$$.html" stepKey="amOnCatalogPage" /> + <amOnPage url="$$createPreReqCategory.custom_attributes[url_key]$$.html" stepKey="amOnCatalogPage" /> <waitForPageLoad stepKey="waitForPage1" /> <waitForPageLoad stepKey="waitForPage2" /> <waitForElementVisible selector="{{WidgetSection.ClearCompare}}" stepKey="waitForClearBtn" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml index 226292e6cdea..bec269d87bbe 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml @@ -25,7 +25,9 @@ </createData> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> </before> <!--Main test--> <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToPage"/> @@ -50,16 +52,16 @@ <selectOption selector="{{WidgetSection.ProductAttribute}}" userInput="Name" stepKey="selectProductAttributes" /> <selectOption selector="{{WidgetSection.ButtonToShow}}" userInput="Add to Cart" stepKey="selectBtnToShow" /> <selectOption selector="{{WidgetSection.WidgetTemplate}}" userInput="Viewed Products Grid Template" stepKey="selectTemplate" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> - <amOnPage url="$$createPreReqProduct.name$$.html" stepKey="amOnProductPage" /> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> + <amOnPage url="$$createPreReqProduct.custom_attributes[url_key]$$.html" stepKey="amOnProductPage" /> <waitForPageLoad stepKey="waitForPage" /> <amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/> <waitForPageLoad stepKey="wait5" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageInlineEditTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageInlineEditTest.xml new file mode 100644 index 000000000000..c03d46440bd3 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageInlineEditTest.xml @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCMSPageInlineEditTest"> + <annotations> + <features value="Cms"/> + <stories value="Inline Edit Cms Page"/> + <title value="Inline changing CMS page custom theme will be applied with proper dates"/> + <description value="Verify that Merchant can inline edit CMS pages in grid and dates will be proper"/> + <severity value="MAJOR"/> + <testCaseId value="MC-40900" /> + <useCaseId value="MC-39953"/> + <group value="cms"/> + <group value="ui"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="navigateToCmsPageGridAgain"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="resetGridFilters"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <generateDate date="now" format="m/d/Y" stepKey="today"/> + <generateDate date="+1 day" format="m/d/Y" stepKey="tomorrow"/> + <generateDate date="now" format="M j, Y" stepKey="todayFormatted"/> + <generateDate date="+1 day" format="M j, Y" stepKey="tomorrowFormatted"/> + <generateDate date="+100 day" format="m/d/Y" stepKey="newDateFrom"/> + <generateDate date="+101 day" format="m/d/Y" stepKey="newDateTo"/> + <generateDate date="+100 day" format="M j, Y" stepKey="newDateFromFormatted"/> + <generateDate date="+101 day" format="M j, Y" stepKey="newDateToFormatted"/> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="navigateToCmsPageGrid"/> + <actionGroup ref="AdminGridColumnShowActionGroup" stepKey="showCustomerEmailColumn"> + <argument name="columnLabel" value="Custom design from"/> + </actionGroup> + <actionGroup ref="AdminGridColumnShowActionGroup" stepKey="showCustomerEmailColumnTwo"> + <argument name="columnLabel" value="Custom design to"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clickClearFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.search}}" userInput="404 Not Found" stepKey="fillKeywordSearchFieldWithSecondCustomerEmail"/> + <click selector="{{AdminDataGridHeaderSection.submitSearch}}" stepKey="clickKeywordSearch"/> + <see userInput="404 Not Found" selector="{{AdminGridRow.rowOne}}" stepKey="seeFirstCmsPageAfterFiltering"/> + <click selector="{{CmsPagesPageActionsSection.firstItemSelectButton}}" stepKey="clickOnSelectButton"/> + <click selector="{{CmsPagesPageActionsSection.firstItemEditButton}}" stepKey="clickOnEditButton"/> + <click selector="{{CmsDesignSection.customDesignUpdateTab}}" stepKey="clickOnDesignTab"/> + <waitForElementVisible selector="{{CmsDesignSection.customDesignFrom}}" stepKey="waitForLayoutDropDown" /> + <fillField selector="{{CmsDesignSection.customDesignFrom}}" userInput="{$today}" stepKey="fillDateFrom"/> + <fillField selector="{{CmsDesignSection.customDesignTo}}" userInput="{$tomorrow}" stepKey="fillDateTo"/> + <selectOption selector="{{CmsDesignSection.customTheme}}" userInput="{{MagentoBlankTheme.name}}" stepKey="fillCustomTheme"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="saveCmsPage"/> + <see userInput="{$todayFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design from')}}" stepKey="assertCustomDesignFrom"/> + <see userInput="{$tomorrowFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design to')}}" stepKey="assertCustomDesignTo"/> + <click selector="{{AdminDataGridTableSection.rows}}" stepKey="clickEdit"/> + <waitForElementVisible selector="{{AdminCmsPageGridInlineEditSection.customLayout}}" stepKey="waitForDate"/> + <selectOption userInput="2 columns with right bar" selector="{{AdminCmsPageGridInlineEditSection.customLayout}}" stepKey="changeLayoutFromGrid"/> + <click selector="{{AdminCmsPageGridInlineEditSection.savePageButton}}" stepKey="clickSaveFromGrid"/> + <see userInput="{$todayFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design from')}}" stepKey="assertCustomDesignFrom2"/> + <see userInput="{$tomorrowFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design to')}}" stepKey="assertCustomDesignTo2"/> + <click selector="{{AdminDataGridTableSection.rows}}" stepKey="clickEdit2"/> + <waitForElementVisible selector="{{AdminCmsPageGridInlineEditSection.customLayout}}" stepKey="waitForDate2"/> + <selectOption userInput="2 columns with left bar" selector="{{AdminCmsPageGridInlineEditSection.customLayout}}" stepKey="changeLayoutFromGrid2"/> + <click selector="{{AdminCmsPageGridInlineEditSection.savePageButton}}" stepKey="clickSaveFromGrid2"/> + <see userInput="{$todayFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design from')}}" stepKey="assertCustomDesignFrom3"/> + <see userInput="{$tomorrowFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design to')}}" stepKey="assertCustomDesignTo3"/> + <click selector="{{AdminDataGridTableSection.rows}}" stepKey="clickEdit3"/> + <waitForElementVisible selector="{{AdminCmsPageGridInlineEditSection.customDesignFrom}}" stepKey="waitForDate3"/> + <fillField selector="{{AdminCmsPageGridInlineEditSection.customDesignFrom}}" userInput="{$newDateFrom}" stepKey="fillDateFromInGrid"/> + <fillField selector="{{AdminCmsPageGridInlineEditSection.customDesignTo}}" userInput="{$newDateTo}" stepKey="fillDateToInGrid"/> + <click selector="{{AdminCmsPageGridInlineEditSection.savePageButton}}" stepKey="clickSaveFromGrid3"/> + <see userInput="{$newDateFromFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design from')}}" stepKey="assertCustomDesignFrom4"/> + <see userInput="{$newDateToFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design to')}}" stepKey="assertCustomDesignTo4"/> + </test> +</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCheckCreateFolderEscapeAndEnterHandlesForWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCheckCreateFolderEscapeAndEnterHandlesForWYSIWYGBlockTest.xml index c5ab9d13b848..d560efed5d23 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCheckCreateFolderEscapeAndEnterHandlesForWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCheckCreateFolderEscapeAndEnterHandlesForWYSIWYGBlockTest.xml @@ -23,7 +23,9 @@ <createData entity="_defaultBlock" stepKey="createPreReqBlock" /> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> </before> <after> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsBlockGridUrlFilterApplierTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsBlockGridUrlFilterApplierTest.xml index e2cf9c20627f..0d483e21499f 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsBlockGridUrlFilterApplierTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsBlockGridUrlFilterApplierTest.xml @@ -20,6 +20,8 @@ </annotations> <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminOpenCmsBlocksGridActionGroup" stepKey="goToCMSBlockPage"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> <createData entity="Sales25offBlock" stepKey="createBlock"/> </before> <after> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml index c0e6a9cbd793..085f79f024f5 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml @@ -22,7 +22,9 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="enableTinyMCE4"/> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE"> + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> <waitForPageLoad stepKey="waitConfigToSave"/> <createData entity="ApiCategory" stepKey="createFirstCategory"/> <createData entity="ApiSimpleProduct" stepKey="product1"> @@ -90,8 +92,8 @@ <waitForPageLoad stepKey="waitForPageToLoadBeforeSelectingProduct2"/> <click selector="{{WidgetSection.PreCreateProduct('$$product2.name$$')}}" stepKey="selectProduct2"/> <click selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="applyProducts"/> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickOnInsertWidgetButton"/> - <waitForPageLoad stepKey="waitForPageToLoadBeforeClickingOnSaveWidget1"/> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickOnInsertWidgetButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageToLoadBeforeClickingOnSaveWidget1"/> <click selector="{{InsertWidgetSection.save}}" stepKey="saveWidget"/> <waitForPageLoad stepKey="waitForSaveComplete"/> <actionGroup ref="CompareTwoProductsOrder" stepKey="compareProductOrders1"> @@ -125,8 +127,8 @@ <click selector="{{WidgetSection.PreCreateProduct('$$product1.name$$')}}" stepKey="selectProduct1_1"/> <click selector="{{WidgetSection.PreCreateProduct('$$product1.name$$')}}" stepKey="selectProduct2_2"/> <click selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="applyProducts1"/> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickOnInsertWidgetButton1"/> - <waitForPageLoad stepKey="waitForPageToLoadBeforeClickingOnSaveWidget2"/> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickOnInsertWidgetButton1"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageToLoadBeforeClickingOnSaveWidget2"/> <click selector="{{InsertWidgetSection.save}}" stepKey="saveWidget1"/> <waitForPageLoad stepKey="waitForSaveComplete1"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEIsNativeWYSIWYGOnBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEIsNativeWYSIWYGOnBlockTest.xml new file mode 100644 index 000000000000..52a795ea76fa --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEIsNativeWYSIWYGOnBlockTest.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="VerifyTinyMCEIsNativeWYSIWYGOnBlockTest"> + <annotations> + <features value="Cms"/> + <stories value="MAGETWO-42046-Apply new WYSIWYG on CMS Page and Block"/> + <group value="Cms"/> + <title value="Admin should see TinyMCE is the native WYSIWYG on Block"/> + <description value="Admin should see TinyMCE is the native WYSIWYG on Block"/> + <severity value="CRITICAL"/> + <testCaseId value="MAGETWO-84184"/> + </annotations> + <before> + <createData entity="_defaultCmsPage" stepKey="createPreReqCMSPage" /> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> + </before> + <amOnPage url="{{CmsNewBlock.url}}" stepKey="amOnNewBlockPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <fillField selector="{{BlockNewPageBasicFieldsSection.blockTitle}}" userInput="{{_defaultBlock.title}}" stepKey="fillFieldTitle"/> + <fillField selector="{{BlockNewPageBasicFieldsSection.identifier}}" userInput="{{_defaultBlock.identifier}}" stepKey="fillFieldIdentifier"/> + <selectOption selector="{{BlockNewPageBasicFieldsSection.storeView}}" userInput="All Store View" stepKey="selectAllStoreView" /> + <waitForElementVisible selector="{{TinyMCESection.TinyMCE4}}" stepKey="waitForTinyMCE" /> + <actionGroup ref="VerifyTinyMCEActionGroup" stepKey="verifyTinyMCE"/> + <actionGroup ref="VerifyMagentoEntityActionGroup" stepKey="verifyMagentoEntities"/> + <executeJS function="tinyMCE.get('cms_block_form_content').setContent('Hello Block Page!');" stepKey="executeJSFillContent"/> + <click selector="{{BlockWYSIWYGSection.ShowHideBtn}}" stepKey="clickShowHideBtn1" /> + <waitForElementVisible selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="waitForInsertWidget" /> + <see selector="{{TinyMCESection.InsertImageBtn}}" userInput="Insert Image..." stepKey="assertInf17"/> + <see selector="{{TinyMCESection.InsertWidgetBtn}}" userInput="Insert Widget..." stepKey="assertInfo18"/> + <see selector="{{TinyMCESection.InsertVariableBtn}}" userInput="Insert Variable..." stepKey="assertInfo19"/> + <click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/> + <click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveBlock"/> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="amOnEditPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad2"/> + <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> + <waitForPageLoad stepKey="waitForGridReload"/> + <click selector="{{CmsPagesPageActionsSection.filterButton}}" stepKey="clickFiltersBtn" /> + <fillField selector="{{CmsPagesPageActionsSection.URLKey}}" userInput="$$createPreReqCMSPage.identifier$$" stepKey="fillOutURLKey" /> + <click selector="{{CmsPagesPageActionsSection.ApplyFiltersBtn}}" stepKey="clickApplyBtn" /> + <waitForLoadingMaskToDisappear stepKey="waitForLoading3" /> + <actionGroup ref="SortByIdDescendingActionGroup" stepKey="sortByIdDescending" /> + <waitForElementVisible selector="{{CmsPagesPageActionsSection.select('$$createPreReqCMSPage.identifier$$')}}" stepKey="waitForCMSPageGrid" /> + <scrollTo selector="{{CmsPagesPageActionsSection.select('$$createPreReqCMSPage.identifier$$')}}" stepKey="scrollToCMSPage" /> + <click selector="{{CmsPagesPageActionsSection.select('$$createPreReqCMSPage.identifier$$')}}" stepKey="clickSelect" /> + <waitForElementVisible selector="{{CmsPagesPageActionsSection.edit('$$createPreReqCMSPage.identifier$$')}}" stepKey="waitForEditLink" /> + <click selector="{{CmsPagesPageActionsSection.edit('$$createPreReqCMSPage.identifier$$')}}" stepKey="clickEdit" /> + <waitForPageLoad stepKey="waitForPageLoad3" /> + <scrollTo selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" stepKey="scrollToPageTitle" /> + <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickContentTab" /> + <waitForElementVisible selector="{{CmsWYSIWYGSection.ShowHideBtn}}" stepKey="waitforShowHideBtn" /> + <click selector="{{CmsWYSIWYGSection.ShowHideBtn}}" stepKey="clickShowHideBtn2"/> + <waitForElementVisible selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="waitForInsertInsertWidgetBtn" /> + <seeElement selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="widgetBtn" /> + <click selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="clickInsertWidgetBtn"/> + <waitForPageLoad stepKey="waitForPageLoad4"/> + <selectOption selector="{{WidgetSection.WidgetType}}" userInput="CMS Static Block" stepKey="selectCMSStaticBlock" /> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear" /> + <selectOption selector="{{WidgetSection.WidgetTemplate}}" userInput="CMS Static Block Default Template" stepKey="selectTemplate" /> + <click selector="{{WidgetSection.BtnChooser}}" stepKey="clickSelectPageBtn" /> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappearAfterClickingBtnChooser" /> + <actionGroup ref="SortByIdDescendingActionGroup" stepKey="sortByIdDescending2" /> + <waitForElementVisible selector="{{WidgetSection.BlockPage(_defaultBlock.identifier)}}" stepKey="waitForBlockCode" /> + <scrollTo selector="{{WidgetSection.BlockPage(_defaultBlock.identifier)}}" stepKey="scrollToBlockIdentifier" /> + <click selector="{{WidgetSection.BlockPage(_defaultBlock.identifier)}}" stepKey="selectPreCreateBlock" /> + <wait time="3" stepKey="wait1" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad5"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSaveButtonVisible"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> + <amOnPage url="$$createPreReqCMSPage.identifier$$" stepKey="amOnPageTestPage"/> + <waitForPageLoad stepKey="waitForPageLoad6" /> + <!--see content of Block on Storefront--> + <see userInput="Hello Block Page!" stepKey="seeContent"/> + <after> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="amOnEditPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad"/> + <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> + <waitForPageLoad stepKey="waitForGridReload"/> + <deleteData createDataKey="createPreReqCMSPage" stepKey="deletePreReqCMSPage" /> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + </test> +</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEIsNativeWYSIWYGOnCMSPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEIsNativeWYSIWYGOnCMSPageTest.xml new file mode 100644 index 000000000000..8bab0b90bf12 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEIsNativeWYSIWYGOnCMSPageTest.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="VerifyTinyMCEIsNativeWYSIWYGOnCMSPageTest"> + <annotations> + <features value="Cms"/> + <stories value="MAGETWO-42046-Apply new WYSIWYG on CMS Page"/> + <group value="Cms"/> + <title value="Admin should see TinyMCE is the native WYSIWYG on CMS Page"/> + <description value="Admin should see TinyMCE is the native WYSIWYG on CMS Page"/> + <severity value="CRITICAL"/> + <testCaseId value="MAGETWO-84182 "/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE"> + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> + </before> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="amOnPagePagesGrid"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad1"/> + <actionGroup ref="AdminClickAddNewPageOnPagesGridActionGroup" stepKey="clickAddNewPage"/> + <fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_defaultCmsPage.title}}" stepKey="fillFieldTitle"/> + <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContent"/> + <fillField selector="{{CmsNewPagePageContentSection.contentHeading}}" userInput="{{_defaultCmsPage.content_heading}}" stepKey="fillFieldContentHeading"/> + <waitForElementVisible selector="{{TinyMCESection.TinyMCE4}}" stepKey="waitForTinyMCE" /> + <actionGroup ref="VerifyTinyMCEActionGroup" stepKey="verifyTinyMCE"/> + <actionGroup ref="VerifyMagentoEntityActionGroup" stepKey="verifyMagentoEntities"/> + <executeJS function="tinyMCE.get('cms_page_form_content').setContent('Hello World!');" stepKey="executeJSFillContent"/> + <click selector="{{CmsWYSIWYGSection.ShowHideBtn}}" stepKey="clickShowHideBtn" /> + <waitForElementVisible selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="waitForInsertWidget" /> + <see selector="{{TinyMCESection.InsertImageBtn}}" userInput="Insert Image..." stepKey="assertInf17"/> + <see selector="{{TinyMCESection.InsertWidgetBtn}}" userInput="Insert Widget..." stepKey="assertInfo18"/> + <see selector="{{TinyMCESection.InsertVariableBtn}}" userInput="Insert Variable..." stepKey="assertInfo19"/> + <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> + <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSaveButtonVisible"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> + <amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <see userInput="{{_defaultCmsPage.content_heading}}" stepKey="seeContentHeading"/> + <see userInput="Hello World!" stepKey="seeContent" /> + <after> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + </test> +</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml deleted file mode 100644 index 03e3097dbd72..000000000000 --- a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml +++ /dev/null @@ -1,97 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest"> - <annotations> - <features value="Cms"/> - <stories value="MAGETWO-42046-Apply new WYSIWYG on CMS Page and Block"/> - <group value="Cms"/> - <title value="Admin should see TinyMCEv4.6 is the native WYSIWYG on Block"/> - <description value="Admin should see TinyMCEv4.6 is the native WYSIWYG on Block"/> - <severity value="CRITICAL"/> - <testCaseId value="MAGETWO-84184"/> - </annotations> - <before> - <createData entity="_defaultCmsPage" stepKey="createPreReqCMSPage" /> - <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> - </before> - <amOnPage url="{{CmsNewBlock.url}}" stepKey="amOnNewBlockPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <fillField selector="{{BlockNewPageBasicFieldsSection.blockTitle}}" userInput="{{_defaultBlock.title}}" stepKey="fillFieldTitle"/> - <fillField selector="{{BlockNewPageBasicFieldsSection.identifier}}" userInput="{{_defaultBlock.identifier}}" stepKey="fillFieldIdentifier"/> - <selectOption selector="{{BlockNewPageBasicFieldsSection.storeView}}" userInput="All Store View" stepKey="selectAllStoreView" /> - <waitForElementVisible selector="{{TinyMCESection.TinyMCE4}}" stepKey="waitForTinyMCE" /> - <actionGroup ref="VerifyTinyMCEActionGroup" stepKey="verifyTinyMCE4"/> - <actionGroup ref="VerifyMagentoEntityActionGroup" stepKey="verifyMagentoEntities"/> - <executeJS function="tinyMCE.get('cms_block_form_content').setContent('Hello Block Page!');" stepKey="executeJSFillContent"/> - <click selector="{{BlockWYSIWYGSection.ShowHideBtn}}" stepKey="clickShowHideBtn1" /> - <waitForElementVisible selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="waitForInsertWidget" /> - <see selector="{{TinyMCESection.InsertImageBtn}}" userInput="Insert Image..." stepKey="assertInf17"/> - <see selector="{{TinyMCESection.InsertWidgetBtn}}" userInput="Insert Widget..." stepKey="assertInfo18"/> - <see selector="{{TinyMCESection.InsertVariableBtn}}" userInput="Insert Variable..." stepKey="assertInfo19"/> - <click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/> - <click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveBlock"/> - <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnEditPage"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> - <waitForPageLoad stepKey="waitForGridReload"/> - <click selector="{{CmsPagesPageActionsSection.filterButton}}" stepKey="clickFiltersBtn" /> - <fillField selector="{{CmsPagesPageActionsSection.URLKey}}" userInput="$$createPreReqCMSPage.identifier$$" stepKey="fillOutURLKey" /> - <click selector="{{CmsPagesPageActionsSection.ApplyFiltersBtn}}" stepKey="clickApplyBtn" /> - <waitForLoadingMaskToDisappear stepKey="waitForLoading3" /> - <actionGroup ref="SortByIdDescendingActionGroup" stepKey="sortByIdDescending" /> - <waitForElementVisible selector="{{CmsPagesPageActionsSection.select('$$createPreReqCMSPage.identifier$$')}}" stepKey="waitForCMSPageGrid" /> - <scrollTo selector="{{CmsPagesPageActionsSection.select('$$createPreReqCMSPage.identifier$$')}}" stepKey="scrollToCMSPage" /> - <click selector="{{CmsPagesPageActionsSection.select('$$createPreReqCMSPage.identifier$$')}}" stepKey="clickSelect" /> - <waitForElementVisible selector="{{CmsPagesPageActionsSection.edit('$$createPreReqCMSPage.identifier$$')}}" stepKey="waitForEditLink" /> - <click selector="{{CmsPagesPageActionsSection.edit('$$createPreReqCMSPage.identifier$$')}}" stepKey="clickEdit" /> - <waitForPageLoad stepKey="waitForPageLoad3" /> - <scrollTo selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" stepKey="scrollToPageTitle" /> - <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickContentTab" /> - <waitForElementVisible selector="{{CmsWYSIWYGSection.ShowHideBtn}}" stepKey="waitforShowHideBtn" /> - <click selector="{{CmsWYSIWYGSection.ShowHideBtn}}" stepKey="clickShowHideBtn2"/> - <waitForElementVisible selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="waitForInsertInsertWidgetBtn" /> - <seeElement selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="widgetBtn" /> - <click selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="clickInsertWidgetBtn"/> - <waitForPageLoad stepKey="waitForPageLoad4"/> - <selectOption selector="{{WidgetSection.WidgetType}}" userInput="CMS Static Block" stepKey="selectCMSStaticBlock" /> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear" /> - <selectOption selector="{{WidgetSection.WidgetTemplate}}" userInput="CMS Static Block Default Template" stepKey="selectTemplate" /> - <click selector="{{WidgetSection.BtnChooser}}" stepKey="clickSelectPageBtn" /> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappearAfterClickingBtnChooser" /> - <actionGroup ref="SortByIdDescendingActionGroup" stepKey="sortByIdDescending2" /> - <waitForElementVisible selector="{{WidgetSection.BlockPage(_defaultBlock.identifier)}}" stepKey="waitForBlockCode" /> - <scrollTo selector="{{WidgetSection.BlockPage(_defaultBlock.identifier)}}" stepKey="scrollToBlockIdentifier" /> - <click selector="{{WidgetSection.BlockPage(_defaultBlock.identifier)}}" stepKey="selectPreCreateBlock" /> - <wait time="3" stepKey="wait1" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> - <waitForPageLoad stepKey="waitForPageLoad5" /> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveButtonVisible"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> - <amOnPage url="$$createPreReqCMSPage.identifier$$" stepKey="amOnPageTestPage"/> - <waitForPageLoad stepKey="waitForPageLoad6" /> - <!--see content of Block on Storefront--> - <see userInput="Hello Block Page!" stepKey="seeContent"/> - <after> - <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnEditPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> - <waitForPageLoad stepKey="waitForGridReload"/> - <deleteData createDataKey="createPreReqCMSPage" stepKey="deletePreReqCMSPage" /> - <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - </after> - </test> -</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml deleted file mode 100644 index 711e126afc55..000000000000 --- a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest"> - <annotations> - <features value="Cms"/> - <stories value="MAGETWO-42046-Apply new WYSIWYG on CMS Page"/> - <group value="Cms"/> - <title value="Admin should see TinyMCEv4.6 is the native WYSIWYG on CMS Page"/> - <description value="Admin should see TinyMCEv4.6 is the native WYSIWYG on CMS Page"/> - <severity value="CRITICAL"/> - <testCaseId value="MAGETWO-84182 "/> - </annotations> - <before> - <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> - </before> - <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnPagePagesGrid"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <actionGroup ref="AdminClickAddNewPageOnPagesGridActionGroup" stepKey="clickAddNewPage"/> - <fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_defaultCmsPage.title}}" stepKey="fillFieldTitle"/> - <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContent"/> - <fillField selector="{{CmsNewPagePageContentSection.contentHeading}}" userInput="{{_defaultCmsPage.content_heading}}" stepKey="fillFieldContentHeading"/> - <waitForElementVisible selector="{{TinyMCESection.TinyMCE4}}" stepKey="waitForTinyMCE" /> - <actionGroup ref="VerifyTinyMCEActionGroup" stepKey="verifyTinyMCE4"/> - <actionGroup ref="VerifyMagentoEntityActionGroup" stepKey="verifyMagentoEntities"/> - <executeJS function="tinyMCE.get('cms_page_form_content').setContent('Hello World!');" stepKey="executeJSFillContent"/> - <click selector="{{CmsWYSIWYGSection.ShowHideBtn}}" stepKey="clickShowHideBtn" /> - <waitForElementVisible selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="waitForInsertWidget" /> - <see selector="{{TinyMCESection.InsertImageBtn}}" userInput="Insert Image..." stepKey="assertInf17"/> - <see selector="{{TinyMCESection.InsertWidgetBtn}}" userInput="Insert Widget..." stepKey="assertInfo18"/> - <see selector="{{TinyMCESection.InsertVariableBtn}}" userInput="Insert Variable..." stepKey="assertInfo19"/> - <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> - <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveButtonVisible"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> - <amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <see userInput="{{_defaultCmsPage.content_heading}}" stepKey="seeContentHeading"/> - <see userInput="Hello World!" stepKey="seeContent" /> - <after> - <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - </after> - </test> -</tests> diff --git a/app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Wysiwyg/Images/TreeTest.php b/app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Wysiwyg/Images/TreeTest.php new file mode 100644 index 000000000000..5fde8d946835 --- /dev/null +++ b/app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Wysiwyg/Images/TreeTest.php @@ -0,0 +1,126 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Cms\Test\Unit\Block\Adminhtml\Wysiwyg\Images; + +use Magento\Backend\Block\Template\Context; +use Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Tree; +use Magento\Cms\Helper\Wysiwyg\Images; +use Magento\Cms\Model\Wysiwyg\Images\Storage; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\DataObject; +use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\Read; +use Magento\Framework\Registry; +use Magento\Framework\Serialize\Serializer\Json; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Get tree json test. + */ +class TreeTest extends TestCase +{ + /** + * @var Tree + */ + private $model; + + /** + * @var Registry|MockObject + */ + private $coreRegistryMock; + + /** + * @var Images|MockObject + */ + private $cmsWysiwygImagesMock; + + /** + * @var Storage|MockObject + */ + private $imagesStorageMock; + + /** + * @var Read|MockObject + */ + private $directoryMock; + + /** + * @var Filesystem|MockObject + */ + private $fileSystemMock; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $objectManager = new ObjectManager($this); + $contextMock = $this->createMock(Context::class); + $this->cmsWysiwygImagesMock = $this->createMock(Images::class); + $this->coreRegistryMock = $this->createMock(Registry::class); + $serializerMock = $this->createMock(Json::class); + $this->imagesStorageMock = $this->createMock(Storage::class); + + $this->directoryMock = $this->getMockBuilder(Read::class) + ->disableOriginalConstructor() + ->onlyMethods(['getRelativePath', 'isDirectory', 'getAbsolutePath', 'read']) + ->getMock(); + $this->fileSystemMock = $this->createMock(Filesystem::class); + $this->fileSystemMock->method('getDirectoryRead') + ->with(DirectoryList::MEDIA) + ->willReturn($this->directoryMock); + + $this->model = $objectManager->getObject( + Tree::class, + [ + 'context' => $contextMock, + 'cmsWysiwygImages' => $this->cmsWysiwygImagesMock, + 'registry' => $this->coreRegistryMock, + 'serializer' => $serializerMock, + '_filesystem' => $this->fileSystemMock + ] + ); + } + + /** + * Test execute for get directories tree + * + * @return void + */ + public function testGetTreeJson(): void + { + $collection = []; + $this->cmsWysiwygImagesMock->method('getStorageRoot') + ->willReturn('/storage/root/dir/'); + $this->cmsWysiwygImagesMock->method('getCurrentPath') + ->willReturn('/storage/root/dir/pub/media/'); + $fileNames = ['fileName']; + foreach ($fileNames as $filename) { + /** @var DataObject|MockObject $objectMock */ + $objectMock = $this->getMockBuilder(DataObject::class) + ->addMethods(['getFilename']) + ->disableOriginalConstructor() + ->getMock(); + $objectMock->method('getFilename') + ->willReturn('/storage/root/dir/' . $filename); + $collection[] = $objectMock; + } + //items for collection + $iterator = new \ArrayIterator($collection); + $this->imagesStorageMock->method('getDirsCollection') + ->willReturn($iterator); + $this->coreRegistryMock->method('registry')->willReturn($this->imagesStorageMock); + $this->directoryMock->method('read')->willReturn($fileNames); + $this->fileSystemMock->expects($this->once()) + ->method('getDirectoryReadByPath') + ->willReturn($this->directoryMock); + $this->model->getTreeJson(); + } +} diff --git a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Page/SaveTest.php b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Page/SaveTest.php index 67a7f0a93448..1cd85364b2cd 100644 --- a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Page/SaveTest.php +++ b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Page/SaveTest.php @@ -1,4 +1,5 @@ <?php + /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. @@ -7,6 +8,7 @@ namespace Magento\Cms\Test\Unit\Controller\Adminhtml\Page; +use Magento\Backend\App\Action\Context; use Magento\Backend\Model\View\Result\Redirect; use Magento\Backend\Model\View\Result\RedirectFactory; use Magento\Cms\Api\PageRepositoryInterface; @@ -18,7 +20,6 @@ use Magento\Framework\App\RequestInterface; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Message\ManagerInterface; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -82,13 +83,14 @@ class SaveTest extends TestCase */ private $pageId = 1; + /** + * @inheirtDoc + */ protected function setUp(): void { - $objectManager = new ObjectManager($this); - $this->resultRedirectFactory = $this->getMockBuilder(RedirectFactory::class) ->disableOriginalConstructor() - ->setMethods(['create']) + ->onlyMethods(['create']) ->getMock(); $this->resultRedirect = $this->getMockBuilder(Redirect::class) ->disableOriginalConstructor() @@ -98,7 +100,7 @@ protected function setUp(): void ->willReturn($this->resultRedirect); $this->dataProcessorMock = $this->getMockBuilder( PostDataProcessor::class - )->setMethods(['filter'])->disableOriginalConstructor() + )->onlyMethods(['filter'])->disableOriginalConstructor() ->getMock(); $this->dataPersistorMock = $this->getMockBuilder(DataPersistorInterface::class) ->getMock(); @@ -108,27 +110,28 @@ protected function setUp(): void $this->messageManagerMock = $this->getMockBuilder(ManagerInterface::class) ->getMockForAbstractClass(); $this->eventManagerMock = $this->getMockBuilder(\Magento\Framework\Event\ManagerInterface::class) - ->setMethods(['dispatch']) + ->onlyMethods(['dispatch']) ->getMockForAbstractClass(); $this->pageFactory = $this->getMockBuilder(PageFactory::class) ->disableOriginalConstructor() - ->setMethods(['create']) + ->onlyMethods(['create']) ->getMock(); $this->pageRepository = $this->getMockBuilder(PageRepositoryInterface::class) ->disableOriginalConstructor() ->getMockForAbstractClass(); - $this->saveController = $objectManager->getObject( - Save::class, - [ - 'request' => $this->requestMock, - 'messageManager' => $this->messageManagerMock, - 'eventManager' => $this->eventManagerMock, - 'resultRedirectFactory' => $this->resultRedirectFactory, - 'dataProcessor' => $this->dataProcessorMock, - 'dataPersistor' => $this->dataPersistorMock, - 'pageFactory' => $this->pageFactory, - 'pageRepository' => $this->pageRepository - ] + $context = $this->getMockBuilder(Context::class) + ->disableOriginalConstructor() + ->getMock(); + $context->method('getRequest')->willReturn($this->requestMock); + $context->method('getMessageManager')->willReturn($this->messageManagerMock); + $context->method('getEventManager')->willReturn($this->eventManagerMock); + $context->method('getResultRedirectFactory')->willReturn($this->resultRedirectFactory); + $this->saveController = new Save( + $context, + $this->dataProcessorMock, + $this->dataPersistorMock, + $this->pageFactory, + $this->pageRepository ); } @@ -140,7 +143,7 @@ public function testSaveAction() 'stores' => ['0'], 'is_active' => true, 'content' => '"><script>alert("cookie: "+document.cookie)</script>', - 'back' => 'close' + 'back' => 'close', ]; $filteredPostData = [ @@ -149,7 +152,7 @@ public function testSaveAction() 'stores' => ['0'], 'is_active' => true, 'content' => '"><script>alert("cookie: "+document.cookie)</script>', - 'back' => 'close' + 'back' => 'close', ]; $this->dataProcessorMock->expects($this->any()) @@ -236,7 +239,7 @@ public function testSaveAndContinue() 'stores' => ['0'], 'is_active' => true, 'content' => '"><script>alert("cookie: "+document.cookie)</script>', - 'back' => 'continue' + 'back' => 'continue', ]; $this->requestMock->expects($this->any())->method('getPostValue')->willReturn($postData); $this->requestMock->expects($this->atLeastOnce()) @@ -304,12 +307,13 @@ public function testSaveActionThrowsException() $this->pageRepository->expects($this->once())->method('getById')->with($this->pageId)->willReturn($page); $page->expects($this->once())->method('setData'); $this->pageRepository->expects($this->once())->method('save')->with($page) - ->willThrowException(new \Exception('Error message.')); + ->willThrowException(new \Error('Error message.')); $this->messageManagerMock->expects($this->never()) ->method('addSuccessMessage'); $this->messageManagerMock->expects($this->once()) - ->method('addExceptionMessage'); + ->method('addErrorMessage') + ->with('Something went wrong while saving the page.'); $this->dataPersistorMock->expects($this->any()) ->method('set') @@ -318,7 +322,7 @@ public function testSaveActionThrowsException() [ 'page_id' => $this->pageId, 'layout_update_xml' => null, - 'custom_layout_update_xml' => null + 'custom_layout_update_xml' => null, ] ); diff --git a/app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php b/app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php index c9a664aeb434..42acee758998 100644 --- a/app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php +++ b/app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php @@ -16,7 +16,9 @@ use Magento\Framework\Event\ManagerInterface; use Magento\Framework\Exception\FileSystemException; use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Exception\ValidatorException; use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\Read; use Magento\Framework\Filesystem\Directory\Write; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Framework\Url\EncoderInterface; @@ -52,6 +54,11 @@ class ImagesTest extends TestCase */ protected $directoryWriteMock; + /** + * @var Read|MockObject + */ + protected $directoryReadMock; + /** * @var StoreManagerInterface|MockObject */ @@ -101,15 +108,10 @@ protected function setUp(): void { $this->path = 'PATH'; $this->objectManager = new ObjectManager($this); - $this->eventManagerMock = $this->getMockForAbstractClass(ManagerInterface::class); - $this->requestMock = $this->getMockForAbstractClass(RequestInterface::class); - $this->urlEncoderMock = $this->getMockForAbstractClass(EncoderInterface::class); - $this->backendDataMock = $this->createMock(Data::class); - $this->contextMock = $this->createMock(Context::class); $this->contextMock->expects($this->any()) ->method('getEventManager') @@ -120,26 +122,21 @@ protected function setUp(): void $this->contextMock->expects($this->any()) ->method('getUrlEncoder') ->willReturn($this->urlEncoderMock); - $this->directoryWriteMock = $this->getMockBuilder(Write::class) ->setConstructorArgs(['path' => $this->path]) ->disableOriginalConstructor() ->getMock(); - $this->directoryWriteMock->expects($this->any()) - ->method('getAbsolutePath') - ->willReturnMap( - [ - [WysiwygConfig::IMAGE_DIRECTORY, null, $this->getAbsolutePath(WysiwygConfig::IMAGE_DIRECTORY)], - [null, null, $this->getAbsolutePath(null)], - ['', null, $this->getAbsolutePath('')], - ] - ); - + $this->directoryReadMock = $this->getMockBuilder(Read::class) + ->setConstructorArgs(['path' => $this->path]) + ->disableOriginalConstructor() + ->getMock(); $this->filesystemMock = $this->createMock(Filesystem::class); $this->filesystemMock->expects($this->once()) ->method('getDirectoryWrite') ->willReturn($this->directoryWriteMock); - + $this->filesystemMock->expects($this->once()) + ->method('getDirectoryReadByPath') + ->willReturn($this->directoryReadMock); $this->storeManagerMock = $this->getMockBuilder(StoreManagerInterface::class) ->setMethods( [ @@ -150,11 +147,8 @@ protected function setUp(): void ) ->disableOriginalConstructor() ->getMockForAbstractClass(); - $this->storeMock = $this->createMock(Store::class); - $this->escaperMock = $this->createMock(Escaper::class); - $this->imagesHelper = $this->objectManager->getObject( Images::class, [ @@ -165,6 +159,44 @@ protected function setUp(): void 'escaper' => $this->escaperMock, ] ); + $this->directoryWriteMock->expects($this->any()) + ->method('getAbsolutePath') + ->willReturnMap([ + [ + WysiwygConfig::IMAGE_DIRECTORY, + null, + $this->getAbsolutePath(WysiwygConfig::IMAGE_DIRECTORY) + ], + [ + null, + null, + $this->getAbsolutePath(null) + ], + [ + '', + null, + $this->getAbsolutePath('') + ] + ]); + $this->directoryReadMock->expects($this->any()) + ->method('getAbsolutePath') + ->willReturnMap([ + [ + $this->path, + null, + $this->path + ], + [ + $this->path . '/test_path', + null, + $this->path . '/test_path' + ], + [ + $this->path . '/tmp', + null, + $this->path . '/tmp' + ] + ]); } protected function tearDown(): void @@ -231,6 +263,18 @@ public function testConvertPathToId() ); } + public function testConvertIdToPathInvalid() + { + $this->expectException('InvalidArgumentException'); + $this->expectExceptionMessage('Path is invalid'); + $this->directoryReadMock->expects($this->any()) + ->method('getAbsolutePath') + ->will( + $this->throwException(new ValidatorException(__("Error"))) + ); + $this->imagesHelper->convertIdToPath('Ly4uLy4uLy4uLy4uLy4uL3dvcms-'); + } + /** * @param string $path * @param string $pathId @@ -260,13 +304,6 @@ public function testConvertIdToPathNodeRoot() $this->assertEquals($this->imagesHelper->getStorageRoot(), $this->imagesHelper->convertIdToPath($pathId)); } - public function testConvertIdToPathInvalid() - { - $this->expectException('InvalidArgumentException'); - $this->expectExceptionMessage('Path is invalid'); - $this->imagesHelper->convertIdToPath('Ly4uLy4uLy4uLy4uLy4uL3dvcms-'); - } - /** * @param string $fileName * @param int $maxLength @@ -403,7 +440,7 @@ public function testGetCurrentPathThrowException() { $this->requestMock->expects($this->any()) ->method('getParam') - ->willReturn('PATH'); + ->willReturn('L3RtcA'); $this->expectException(LocalizedException::class); $this->expectExceptionMessage( diff --git a/app/code/Magento/Cms/etc/adminhtml/di.xml b/app/code/Magento/Cms/etc/adminhtml/di.xml index 363217af4cd0..349bb1fd0fff 100644 --- a/app/code/Magento/Cms/etc/adminhtml/di.xml +++ b/app/code/Magento/Cms/etc/adminhtml/di.xml @@ -36,7 +36,7 @@ <type name="Magento\Cms\Model\Config\Source\Wysiwyg\Editor"> <arguments> <argument name="adapterOptions" xsi:type="array"> - <item name="tinymce4" xsi:type="array"> + <item name="tinymce" xsi:type="array"> <item name="value" xsi:type="string">mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter</item> <item name="label" xsi:type="string" translatable="true">TinyMCE 4</item> </item> diff --git a/app/code/Magento/Cms/etc/db_schema.xml b/app/code/Magento/Cms/etc/db_schema.xml index ac49421d31e8..f2decc7c10db 100644 --- a/app/code/Magento/Cms/etc/db_schema.xml +++ b/app/code/Magento/Cms/etc/db_schema.xml @@ -22,6 +22,9 @@ <constraint xsi:type="primary" referenceId="PRIMARY"> <column name="block_id"/> </constraint> + <index referenceId="CMS_BLOCK_IDENTIFIER" indexType="btree"> + <column name="identifier"/> + </index> <index referenceId="CMS_BLOCK_TITLE_IDENTIFIER_CONTENT" indexType="fulltext"> <column name="title"/> <column name="identifier"/> diff --git a/app/code/Magento/Cms/etc/db_schema_whitelist.json b/app/code/Magento/Cms/etc/db_schema_whitelist.json index fe0e9c1f2e22..ead711d210eb 100644 --- a/app/code/Magento/Cms/etc/db_schema_whitelist.json +++ b/app/code/Magento/Cms/etc/db_schema_whitelist.json @@ -10,7 +10,8 @@ "is_active": true }, "index": { - "CMS_BLOCK_TITLE_IDENTIFIER_CONTENT": true + "CMS_BLOCK_TITLE_IDENTIFIER_CONTENT": true, + "CMS_BLOCK_IDENTIFIER": true }, "constraint": { "PRIMARY": true diff --git a/app/code/Magento/Cms/etc/di.xml b/app/code/Magento/Cms/etc/di.xml index 61cf33f88abd..e52c2ff99c71 100644 --- a/app/code/Magento/Cms/etc/di.xml +++ b/app/code/Magento/Cms/etc/di.xml @@ -287,6 +287,8 @@ <item name="button" xsi:type="string">button</item> <item name="i" xsi:type="string">i</item> <item name="u" xsi:type="string">u</item> + <item name="br" xsi:type="string">br</item> + <item name="b" xsi:type="string">b</item> </argument> <argument name="allowedAttributes" xsi:type="array"> <item name="class" xsi:type="string">class</item> diff --git a/app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml b/app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml index 154e76bd93e4..a647558b39fc 100644 --- a/app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml +++ b/app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml @@ -4,32 +4,22 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\Uploader */ -/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ -$filters = $block->getConfig()->getFilters() ?? []; -$allowedExtensions = []; $blockHtmlId = $block->getHtmlId(); - -$listExtensions = []; -foreach ($filters as $media_type) { - $listExtensions[] = array_map(function ($fileExt) { - return ltrim($fileExt, '.*'); - }, $media_type['files']); -} - -$allowedExtensions = array_merge([], ...$listExtensions); - -$resizeConfig = $block->getImageUploadConfigData()->getIsResizeEnabled() - ? "{action: 'resize', maxWidth: " - . $block->escapeHtml($block->getImageUploadMaxWidth()) - . ", maxHeight: " - . $block->escapeHtml($block->getImageUploadMaxHeight()) - . "}" - : "{action: 'resize'}"; ?> -<div id="<?= /* @noEscape */ $blockHtmlId ?>" class="uploader"> +<div id="<?= /* @noEscape */ $blockHtmlId ?>" class="uploader" + data-mage-init='{ + "Magento_Backend/js/media-uploader" : { + "maxFileSize": <?= /* @noEscape */ $block->getFileSizeService()->getMaxFileSize() ?>, + "maxWidth": <?= /* @noEscape */ $block->getImageUploadMaxWidth() ?>, + "maxHeight": <?= /* @noEscape */ $block->getImageUploadMaxHeight() ?>, + "isResizeEnabled": <?= /* @noEscape */ $block->getImageUploadConfigData()->getIsResizeEnabled() ?> + } + }' +> <span class="fileinput-button form-buttons"> <span><?= $block->escapeHtml(__('Upload Images')) ?></span> <input class="fileupload" type="file" @@ -46,130 +36,4 @@ $resizeConfig = $block->getImageUploadConfigData()->getIsResizeEnabled() <div class="clear"></div> </div> </script> - <?php $intMaxSize = $block->getFileSizeService()->getMaxFileSize(); - $resizeConfig = /* @noEscape */ $resizeConfig; - $blockHtmlId = /* @noEscape */ $blockHtmlId; - $scriptString = <<<script - -require([ - 'jquery', - 'mage/template', - 'Magento_Ui/js/lib/validation/validator', - 'Magento_Ui/js/modal/alert', - 'jquery/file-uploader', - 'domReady!', - 'mage/translate' -], function ($, mageTemplate, validator, uiAlert) { - var maxFileSize = {$block->escapeJs($block->getFileSizeService()->getMaxFileSize())}, - allowedExtensions = '{$block->escapeJs(implode(' ', $allowedExtensions))}'; - - $('#{$blockHtmlId} .fileupload').fileupload({ - dataType: 'json', - formData: { - isAjax: 'true', - form_key: FORM_KEY - }, - sequentialUploads: true, - acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i, - allowedExtensions: allowedExtensions, - maxFileSize: maxFileSize, - dropZone: $('#{$blockHtmlId}').closest('[role="dialog"]'), - add: function (e, data) { - var progressTmpl = mageTemplate('#{$blockHtmlId}-template'), - fileSize, - tmpl, - validationResult; - - data.files = data.files.filter(function (file) { - fileSize = typeof file.size == "undefined" ? - $.mage.__('We could not detect a size.') : - byteConvert(file.size); - - if (maxFileSize) { - validationResult = validator('validate-max-size', file.size, maxFileSize); - - if (!validationResult.passed) { - uiAlert({ - content: validationResult.message - }); - - return false; - } - } - - if (allowedExtensions) { - validationResult = validator('validate-file-type', file.name, allowedExtensions); - - if (!validationResult.passed) { - uiAlert({ - content: validationResult.message - }); - - return false; - } - } - - data.fileId = Math.random().toString(36).substr(2, 9); - - tmpl = progressTmpl({ - data: { - name: file.name, - size: fileSize, - id: data.fileId - } - }); - - $(tmpl).data('image', data).appendTo('#{$blockHtmlId}'); - - return true; - }); - - if (data.files.length) { - $(this).fileupload('process', data).done(function () { - data.submit(); - }); - } - }, - done: function (e, data) { - var progressSelector = '#' + data.fileId + ' .progressbar-container .progressbar'; - var tempErrorMessage = document.createElement("div"); - $(progressSelector).css('width', '100%'); - $('[data-action="show-error"]').children(".message").remove(); - if (data.result && !data.result.hasOwnProperty('errorcode')) { - $(progressSelector).removeClass('upload-progress').addClass('upload-success'); - } else { - tempErrorMessage.className = "message message-warning warning"; - tempErrorMessage.innerHTML = data.result.error; - - $('[data-action="show-error"]').append(tempErrorMessage); - $(progressSelector).removeClass('upload-progress').addClass('upload-failure'); - } - }, - progress: function (e, data) { - var progress = parseInt(data.loaded / data.total * 100, 10); - var progressSelector = '#' + data.fileId + ' .progressbar-container .progressbar'; - $(progressSelector).css('width', progress + '%'); - }, - fail: function (e, data) { - var progressSelector = '#' + data.fileId + ' .progressbar-container .progressbar'; - $(progressSelector).removeClass('upload-progress').addClass('upload-failure'); - } - }); - - $('#{$blockHtmlId} .fileupload').fileupload('option', { - process: [{ - action: 'load', - fileTypes: /^image\/(gif|jpeg|png)$/, - maxFileSize: {$intMaxSize} * 10 - }, - {$resizeConfig}, - { - action: 'save' - }] - }); -}); - -script; - ?> - <?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?> </div> diff --git a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_form.xml b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_form.xml index a2ce0ec1b874..4da2e0c8c13d 100644 --- a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_form.xml +++ b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_form.xml @@ -125,7 +125,7 @@ </validation> <dataType>int</dataType> <tooltip> - <link>https://docs.magento.com/m2/ce/user_guide/configuration/scope.html</link> + <link>https://docs.magento.com/user-guide/configuration/scope.html</link> <description>What is this?</description> </tooltip> <label translate="true">Store View</label> diff --git a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_form.xml b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_form.xml index 396923a2b6f3..dd1c9d2b8ae4 100644 --- a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_form.xml +++ b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_form.xml @@ -208,7 +208,7 @@ </validation> <dataType>int</dataType> <tooltip> - <link>https://docs.magento.com/m2/ce/user_guide/configuration/scope.html</link> + <link>https://docs.magento.com/user-guide/configuration/scope.html</link> <description>What is this?</description> </tooltip> <label translate="true">Store View</label> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_noroute.xml b/app/code/Magento/Cms/view/frontend/layout/cms_noroute_index.xml similarity index 100% rename from app/code/Magento/Cms/view/frontend/layout/cms_index_noroute.xml rename to app/code/Magento/Cms/view/frontend/layout/cms_noroute_index.xml diff --git a/app/code/Magento/CmsGraphQl/etc/schema.graphqls b/app/code/Magento/CmsGraphQl/etc/schema.graphqls index 2453cb61b9a6..338dae0f6c6c 100644 --- a/app/code/Magento/CmsGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CmsGraphQl/etc/schema.graphqls @@ -20,7 +20,7 @@ type Query { ): CmsBlocks @resolver(class: "Magento\\CmsGraphQl\\Model\\Resolver\\Blocks") @doc(description: "The CMS block query returns information about CMS blocks") @cache(cacheIdentity: "Magento\\CmsGraphQl\\Model\\Resolver\\Block\\Identity") } -type CmsPage @doc(description: "CMS page defines all CMS page information") { +type CmsPage implements RoutableInterface @doc(description: "CMS page defines all CMS page information") { identifier: String @doc(description: "Identifier of the CMS page") url_key: String @doc(description: "URL key of CMS page") title: String @doc(description: "CMS page title") @@ -40,4 +40,4 @@ type CmsBlock @doc(description: "CMS block defines all CMS block information") { identifier: String @doc(description: "CMS block identifier") title: String @doc(description: "CMS block title") content: String @doc(description: "CMS block content") -} \ No newline at end of file +} diff --git a/app/code/Magento/CmsUrlRewrite/Plugin/Cms/Model/PageRepository/ValidationCompositePlugin.php b/app/code/Magento/CmsUrlRewrite/Plugin/Cms/Model/PageRepository/ValidationCompositePlugin.php new file mode 100644 index 000000000000..c4e1907c13b1 --- /dev/null +++ b/app/code/Magento/CmsUrlRewrite/Plugin/Cms/Model/PageRepository/ValidationCompositePlugin.php @@ -0,0 +1,48 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CmsUrlRewrite\Plugin\Cms\Model\PageRepository; + +use Magento\Cms\Api\Data\PageInterface; +use Magento\Cms\Model\PageRepository\ValidationComposite; +use Magento\CmsUrlRewrite\Model\CmsPageUrlPathGenerator; + +/** + * Generate url_key if the merchant didn't fill this field + */ +class ValidationCompositePlugin +{ + /** + * @var CmsPageUrlPathGenerator + */ + private $cmsPageUrlPathGenerator; + + /** + * @param CmsPageUrlPathGenerator $cmsPageUrlPathGenerator + */ + public function __construct( + CmsPageUrlPathGenerator $cmsPageUrlPathGenerator + ) { + $this->cmsPageUrlPathGenerator = $cmsPageUrlPathGenerator; + } + + /** + * Before save handler + * + * @param ValidationComposite $subject + * @param PageInterface $page + */ + public function beforeSave( + ValidationComposite $subject, + PageInterface $page + ) { + $urlKey = $page->getData('identifier'); + if ($urlKey === '' || $urlKey === null) { + $page->setData('identifier', $this->cmsPageUrlPathGenerator->generateUrlKey($page)); + } + } +} diff --git a/app/code/Magento/CmsUrlRewrite/etc/di.xml b/app/code/Magento/CmsUrlRewrite/etc/di.xml index 0463bf5b696c..98f6abf105c3 100644 --- a/app/code/Magento/CmsUrlRewrite/etc/di.xml +++ b/app/code/Magento/CmsUrlRewrite/etc/di.xml @@ -9,6 +9,10 @@ <type name="Magento\Cms\Model\ResourceModel\Page"> <plugin name="cms_url_rewrite_plugin" type="Magento\CmsUrlRewrite\Plugin\Cms\Model\ResourceModel\Page"/> </type> + <type name="Magento\Cms\Model\PageRepository\ValidationComposite"> + <plugin name="cms_validate_url_plugin" + type="Magento\CmsUrlRewrite\Plugin\Cms\Model\PageRepository\ValidationCompositePlugin" sortOrder="10"/> + </type> <type name="Magento\UrlRewrite\Model\UrlRewrite"> <arguments> <argument name="entityToCacheTagMap" xsi:type="array"> diff --git a/app/code/Magento/CmsUrlRewriteGraphQl/Model/CmsPageTypeResolver.php b/app/code/Magento/CmsUrlRewriteGraphQl/Model/CmsPageTypeResolver.php new file mode 100755 index 000000000000..74b3c91a999c --- /dev/null +++ b/app/code/Magento/CmsUrlRewriteGraphQl/Model/CmsPageTypeResolver.php @@ -0,0 +1,30 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CmsUrlRewriteGraphQl\Model; + +use Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface; + +/** + * @inheritdoc + */ +class CmsPageTypeResolver implements TypeResolverInterface +{ + const CMS_PAGE = 'CMS_PAGE'; + const TYPE_RESOLVER = 'CmsPage'; + + /** + * @inheritdoc + */ + public function resolveType(array $data) : string + { + if (isset($data['type_id']) && $data['type_id'] == self::CMS_PAGE) { + return self::TYPE_RESOLVER; + } + return ''; + } +} diff --git a/app/code/Magento/CmsUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/Page.php b/app/code/Magento/CmsUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/Page.php new file mode 100644 index 000000000000..a83cbb8713d5 --- /dev/null +++ b/app/code/Magento/CmsUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/Page.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CmsUrlRewriteGraphQl\Model\DataProvider\UrlRewrite; + +use Magento\CmsGraphQl\Model\Resolver\DataProvider\Page as PageDataProvider; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\UrlRewriteGraphQl\Model\DataProvider\EntityDataProviderInterface; + +class Page implements EntityDataProviderInterface +{ + /** + * @var PageDataProvider + */ + private $pageDataProvider; + + /** + * Route constructor. + * @param PageDataProvider $pageDataProvider + */ + public function __construct( + PageDataProvider $pageDataProvider + ) { + $this->pageDataProvider = $pageDataProvider; + } + + /** + * Get Page data + * + * @param string $entity_type + * @param int $id + * @param ResolveInfo|null $info + * @param int|null $storeId + * @return array + * @throws NoSuchEntityException + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function getData( + string $entity_type, + int $id, + ResolveInfo $info = null, + int $storeId = null + ): array { + $result = $this->pageDataProvider->getDataByPageId((int)$id); + $result['type_id'] = $entity_type; + return $result; + } +} diff --git a/app/code/Magento/CmsUrlRewriteGraphQl/composer.json b/app/code/Magento/CmsUrlRewriteGraphQl/composer.json index d8fbbb4c2e6f..fc393fdceadb 100644 --- a/app/code/Magento/CmsUrlRewriteGraphQl/composer.json +++ b/app/code/Magento/CmsUrlRewriteGraphQl/composer.json @@ -7,7 +7,8 @@ "magento/framework": "*", "magento/module-cms": "*", "magento/module-store": "*", - "magento/module-url-rewrite-graph-ql": "*" + "magento/module-url-rewrite-graph-ql": "*", + "magento/module-cms-graph-ql": "*" }, "suggest": { "magento/module-cms-url-rewrite": "*", diff --git a/app/code/Magento/CmsUrlRewriteGraphQl/etc/di.xml b/app/code/Magento/CmsUrlRewriteGraphQl/etc/di.xml index ae8475cc113d..4f4efff82a2d 100644 --- a/app/code/Magento/CmsUrlRewriteGraphQl/etc/di.xml +++ b/app/code/Magento/CmsUrlRewriteGraphQl/etc/di.xml @@ -20,4 +20,11 @@ </argument> </arguments> </type> + <type name="Magento\UrlRewriteGraphQl\Model\DataProvider\EntityDataProviderComposite"> + <arguments> + <argument name="dataProviders" xsi:type="array"> + <item name="cms_page" xsi:type="object">Magento\CmsUrlRewriteGraphQl\Model\DataProvider\UrlRewrite\Page</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/CmsUrlRewriteGraphQl/etc/graphql/di.xml b/app/code/Magento/CmsUrlRewriteGraphQl/etc/graphql/di.xml new file mode 100755 index 000000000000..08b96da8accd --- /dev/null +++ b/app/code/Magento/CmsUrlRewriteGraphQl/etc/graphql/di.xml @@ -0,0 +1,16 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> + <type name="Magento\UrlRewriteGraphQl\Model\RoutableInterfaceTypeResolver"> + <arguments> + <argument name="productTypeNameResolvers" xsi:type="array"> + <item name="cms_page_type_resolver" xsi:type="object">Magento\CmsUrlRewriteGraphQl\Model\CmsPageTypeResolver</item> + </argument> + </arguments> + </type> +</config> diff --git a/app/code/Magento/Config/Model/Config/PathValidator.php b/app/code/Magento/Config/Model/Config/PathValidator.php index bc4f863b7b05..d0d1d46303b8 100644 --- a/app/code/Magento/Config/Model/Config/PathValidator.php +++ b/app/code/Magento/Config/Model/Config/PathValidator.php @@ -6,6 +6,7 @@ namespace Magento\Config\Model\Config; +use Magento\Config\Model\Config\Structure\Element\Field; use Magento\Framework\Exception\ValidatorException; /** @@ -40,6 +41,11 @@ public function __construct(Structure $structure) */ public function validate($path) { + $element = $this->structure->getElementByConfigPath($path); + if ($element instanceof Field && $element->getConfigPath()) { + $path = $element->getConfigPath(); + } + $allPaths = $this->structure->getFieldPaths(); if (!array_key_exists($path, $allPaths)) { diff --git a/app/code/Magento/Config/Model/Config/Structure.php b/app/code/Magento/Config/Model/Config/Structure.php index 156867f34318..3eb0a375091f 100644 --- a/app/code/Magento/Config/Model/Config/Structure.php +++ b/app/code/Magento/Config/Model/Config/Structure.php @@ -191,7 +191,7 @@ public function getElementByConfigPath($path) { $allPaths = $this->getFieldPaths(); - if (isset($allPaths[$path])) { + if (isset($allPaths[$path]) && is_array($allPaths[$path])) { $path = array_shift($allPaths[$path]); } diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/AdminNavigateToConfigurationSystemSectionActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/AdminNavigateToConfigurationSystemSectionActionGroup.xml new file mode 100644 index 000000000000..64cac92f3a3e --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/AdminNavigateToConfigurationSystemSectionActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminNavigateToConfigurationSystemSectionActionGroup"> + <annotations> + <description>Navigates to the specified section in admin on the Stores > Settings > Configuration > Advanced > System page.</description> + </annotations> + <arguments> + <argument name="section" defaultValue="" type="string"/> + </arguments> + <amOnPage url="{{AdminConfigSystemBySectionPage.url(section)}}" stepKey="navigateToConfigurationSystemPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGActionGroup.xml index 556b8bdcf973..4aa92697b346 100644 --- a/app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGActionGroup.xml +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGActionGroup.xml @@ -13,6 +13,6 @@ <description>Enables the WYSIWYG Editor via the CLI.</description> </annotations> - <magentoCLI stepKey="enableWYSIWYG" command="config:set cms/wysiwyg/enabled enabled"/> + <magentoCLI stepKey="enableWYSIWYG" command="config:set {{WysiwygEnabledByDefault.path}} {{WysiwygEnabledByDefault.value}}"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/SwitchToTinyMCE3ActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/SwitchToTinyMCE3ActionGroup.xml deleted file mode 100644 index 837402005fec..000000000000 --- a/app/code/Magento/Config/Test/Mftf/ActionGroup/SwitchToTinyMCE3ActionGroup.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="SwitchToTinyMCE3ActionGroup" deprecated="This version of TinyMCE is no longer supported"> - <annotations> - <description>Goes to the 'Configuration' page for 'Content Management'. Sets 'WYSIWYG Editor' to 'TinyMCE 3'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <comment userInput="Choose TinyMCE3 as the default editor" stepKey="chooseTinyMCE3AsEditor"/> - <conditionalClick stepKey="expandWYSIWYGOptions1" selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.CheckIfTabExpand}}" visible="true"/> - <waitForElementVisible selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="waitForCheckbox2"/> - <uncheckOption selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="uncheckUseSystemValue2"/> - <waitForElementVisible selector="{{ContentManagementSection.Switcher}}" stepKey="waitForSwitcherDropdown2"/> - <selectOption selector="{{ContentManagementSection.Switcher}}" userInput="TinyMCE 3" stepKey="switchToVersion3"/> - <click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeConfigurationSuccessMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/SwitcherActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/SwitcherActionGroup.xml deleted file mode 100644 index c6b2605c73d8..000000000000 --- a/app/code/Magento/Config/Test/Mftf/ActionGroup/SwitcherActionGroup.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="SwitchToVersion4ActionGroup"> - <annotations> - <description>DEPRECATED. Use CliEnableTinyMCE4 instead. Goes to the 'Configuration' page for 'Content Management'. Sets the 'WYSIWYG Editor' to 'TinyMCE 4'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <amOnPage url="{{ConfigurationStoresPage.url}}" stepKey="navigateToWYSIWYGConfigPage1"/> - <waitForPageLoad stepKey="waitForConfigPageToLoad"/> - <conditionalClick stepKey="expandWYSIWYGOptions" selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.CheckIfTabExpand}}" visible="true"/> - <waitForElementVisible selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="waitForCheckbox"/> - <uncheckOption selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="uncheckUseSystemValue"/> - <waitForElementVisible selector="{{ContentManagementSection.Switcher}}" stepKey="waitForSwitcherDropdown"/> - <selectOption selector="{{ContentManagementSection.Switcher}}" userInput="TinyMCE 4" stepKey="switchToVersion4"/> - <click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/Data/CountryOptionConfigData.xml b/app/code/Magento/Config/Test/Mftf/Data/CountryOptionConfigData.xml index 53ca46e74620..378aa0bfc510 100644 --- a/app/code/Magento/Config/Test/Mftf/Data/CountryOptionConfigData.xml +++ b/app/code/Magento/Config/Test/Mftf/Data/CountryOptionConfigData.xml @@ -21,4 +21,13 @@ <entity name="DefaultAdminAccountAllowCountry" type="checkoutTotalFlagZero"> <data key="value">0</data> </entity> + <entity name="SetAdminAccountAllowCountryToDefaultForDefaultWebsite" type="default_admin_account_country_options_config_for_default_website"> + <requiredEntity type="checkoutTotalFlagZero">DefaultAdminAccountAllowCountry</requiredEntity> + </entity> + <entity name="SetAllowedCountryUsConfig"> + <data key="path">general/country/allow</data> + <data key="value">US</data> + <data key="scope">websites</data> + <data key="scope_code">base</data> + </entity> </entities> diff --git a/app/code/Magento/Config/Test/Mftf/Metadata/SystemConfigCountriesMeta.xml b/app/code/Magento/Config/Test/Mftf/Metadata/SystemConfigCountriesMeta.xml index bd16c225af51..100c874024a5 100644 --- a/app/code/Magento/Config/Test/Mftf/Metadata/SystemConfigCountriesMeta.xml +++ b/app/code/Magento/Config/Test/Mftf/Metadata/SystemConfigCountriesMeta.xml @@ -32,4 +32,18 @@ </object> </object> </operation> + + <operation name="DefaultAdminAccountCountryOptionConfigDefaultWebsite" dataType="default_admin_account_country_options_config_for_default_website" type="create" auth="adminFormKey" url="/admin/system_config/save/section/general/website/1/" method="POST"> + <object key="groups" dataType="default_admin_account_country_options_config_for_default_website"> + <object key="country" dataType="default_admin_account_country_options_config_for_default_website"> + <object key="fields" dataType="default_admin_account_country_options_config_for_default_website"> + <object key="allow" dataType="default_admin_account_country_options_config_for_default_website"> + <object key="inherit" dataType="checkoutTotalFlagZero"> + <field key="value">string</field> + </object> + </object> + </object> + </object> + </object> + </operation> </operations> diff --git a/app/code/Magento/Config/Test/Mftf/Page/AdminConfigPage/AdminConfigSystemBySectionPage.xml b/app/code/Magento/Config/Test/Mftf/Page/AdminConfigPage/AdminConfigSystemBySectionPage.xml new file mode 100644 index 000000000000..40977bb7b955 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/Page/AdminConfigPage/AdminConfigSystemBySectionPage.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="AdminConfigSystemBySectionPage" url="admin/system_config/edit/section/system/{{section}}" area="admin" module="Magento_Config" parameterized="true"/> +</pages> diff --git a/app/code/Magento/Config/Test/Mftf/Test/CheckingCountryDropDownWithOneAllowedCountryTest.xml b/app/code/Magento/Config/Test/Mftf/Test/CheckingCountryDropDownWithOneAllowedCountryTest.xml index d0edd4cf1cb6..f65f626f1a52 100644 --- a/app/code/Magento/Config/Test/Mftf/Test/CheckingCountryDropDownWithOneAllowedCountryTest.xml +++ b/app/code/Magento/Config/Test/Mftf/Test/CheckingCountryDropDownWithOneAllowedCountryTest.xml @@ -11,21 +11,25 @@ <test name="CheckingCountryDropDownWithOneAllowedCountryTest"> <annotations> <features value="Config"/> - <stories value="MAGETWO-96107: Additional blank option in country dropdown"/> + <stories value="Additional blank option in country dropdown"/> <title value="Checking country drop-down with one allowed country"/> <description value="Check country drop-down with one allowed country"/> <severity value="MAJOR"/> - <testCaseId value="MAGETWO-96133"/> + <testCaseId value="MAGETWO-28511"/> <group value="configuration"/> </annotations> <before> <createData entity="EnableAdminAccountAllowCountry" stepKey="setAllowedCountries"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> </before> <after> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <createData entity="DisableAdminAccountAllowCountry" stepKey="setDefaultValueForAllowCountries"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer"> <argument name="customerEmail" value="CustomerEntityOne.email"/> @@ -34,10 +38,7 @@ <waitForPageLoad stepKey="WaitForPageToLoad"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!--Flush Magento Cache--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Create a customer account from Storefront--> <actionGroup ref="StorefrontOpenCustomerAccountCreatePageActionGroup" stepKey="openCreateAccountPage"/> <actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="fillCreateAccountForm"> @@ -52,5 +53,12 @@ <click selector="{{StorefrontCustomerAddressSection.country}}" stepKey="clickToExpandCountryDropDown"/> <see selector="{{StorefrontCustomerAddressSection.country}}" userInput="United States" stepKey="seeSelectedCountry"/> <dontSee selector="{{StorefrontCustomerAddressSection.country}}" userInput="Brazil" stepKey="canNotSeeSelectedCountry"/> + <createData entity="DisableAdminAccountAllowCountry" stepKey="setDefaultValueForAllowCountries"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <reloadPage stepKey="realoadPageAfterConfigChanged"/> + <see selector="{{StorefrontCustomerAddressSection.country}}" userInput="United States" stepKey="seeUnitedStatesCountry"/> + <see selector="{{StorefrontCustomerAddressSection.country}}" userInput="Brazil" stepKey="seeBrazilCountry"/> </test> </tests> diff --git a/app/code/Magento/Config/etc/di.xml b/app/code/Magento/Config/etc/di.xml index 4277ca0a6de2..76cfdbfa60b8 100644 --- a/app/code/Magento/Config/etc/di.xml +++ b/app/code/Magento/Config/etc/di.xml @@ -96,7 +96,7 @@ <virtualType name="systemConfigQueryLocker" type="Magento\Framework\Cache\LockGuardedCacheLoader"> <arguments> - <argument name="locker" xsi:type="object">Magento\Framework\Lock\Backend\Database</argument> + <argument name="locker" xsi:type="object">Magento\Framework\Lock\Proxy</argument> </arguments> </virtualType> diff --git a/app/code/Magento/ConfigurableImportExport/Plugin/Import/Product/UpdateConfigurableProductsStockItemStatusPlugin.php b/app/code/Magento/ConfigurableImportExport/Plugin/Import/Product/UpdateConfigurableProductsStockItemStatusPlugin.php new file mode 100644 index 000000000000..9a2881d3031b --- /dev/null +++ b/app/code/Magento/ConfigurableImportExport/Plugin/Import/Product/UpdateConfigurableProductsStockItemStatusPlugin.php @@ -0,0 +1,49 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ConfigurableImportExport\Plugin\Import\Product; + +use Magento\CatalogImportExport\Model\StockItemImporterInterface; +use Magento\ConfigurableProduct\Model\Inventory\ChangeParentStockStatus; + +/** + * Update configurable products stock item status based on children products stock status after import + */ +class UpdateConfigurableProductsStockItemStatusPlugin +{ + /** + * @var ChangeParentStockStatus + */ + private $changeParentStockStatus; + + /** + * @param ChangeParentStockStatus $changeParentStockStatus + */ + public function __construct( + ChangeParentStockStatus $changeParentStockStatus + ) { + $this->changeParentStockStatus = $changeParentStockStatus; + } + + /** + * Update configurable products stock item status based on children products stock status after import + * + * @param StockItemImporterInterface $subject + * @param mixed $result + * @param array $stockData + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterImport( + StockItemImporterInterface $subject, + $result, + array $stockData + ): void { + if ($stockData) { + $this->changeParentStockStatus->execute(array_column($stockData, 'product_id')); + } + } +} diff --git a/app/code/Magento/ConfigurableImportExport/Test/Mftf/Data/ImportData.xml b/app/code/Magento/ConfigurableImportExport/Test/Mftf/Data/ImportData.xml new file mode 100644 index 000000000000..5c0c897c7313 --- /dev/null +++ b/app/code/Magento/ConfigurableImportExport/Test/Mftf/Data/ImportData.xml @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <!-- Categories --> + <entity name="ImportCategory_Configurable" type="category"> + <data key="name">import-category-configurable</data> + <data key="name_lwr">import-category-configurable</data> + <data key="is_active">true</data> + <data key="include_in_menu">true</data> + <data key="urlKey">import-category-configurable</data> + </entity> + + <!-- Products --> + <entity name="ImportProductSimple1_Configurable" type="product"> + <data key="name">import-product-simple1-configurable</data> + <data key="sku">import-product-simple1-configurable</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="price">11.00</data> + <data key="quantity">101</data> + <data key="weight">1</data> + <data key="visibilityText">Not Visible Individually</data> + <data key="status">1</data> + <data key="statusText">Enabled</data> + <data key="urlKey">import-product-simple1-configurable</data> + <data key="baseImage">magento-logo.png</data> + <data key="baseImageName">magento-logo</data> + <data key="smallImage">magento-logo.png</data> + <data key="smallImageName">magento-logo</data> + <data key="thumbnailImage">magento-logo.png</data> + <data key="thumbnailImageName">magento-logo</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="ImportProductSimple2_Configurable" type="product"> + <data key="name">import-product-simple2-configurable</data> + <data key="sku">import-product-simple2-configurable</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="price">12.00</data> + <data key="quantity">102</data> + <data key="weight">2</data> + <data key="visibilityText">Not Visible Individually</data> + <data key="status">1</data> + <data key="statusText">Enabled</data> + <data key="urlKey">import-product-simple2-configurable</data> + <data key="baseImage">m-logo.gif</data> + <data key="baseImageName">m-logo</data> + <data key="smallImage">m-logo.gif</data> + <data key="smallImageName">m-logo</data> + <data key="thumbnailImage">m-logo.gif</data> + <data key="thumbnailImageName">m-logo</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="ImportProductSimple3_Configurable" type="product"> + <data key="name">import-product-simple3-configurable</data> + <data key="sku">import-product-simple3-configurable</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="price">13.00</data> + <data key="quantity">103</data> + <data key="weight">3</data> + <data key="visibilityText">Not Visible Individually</data> + <data key="status">1</data> + <data key="statusText">Enabled</data> + <data key="urlKey">import-product-simple3-configurable</data> + <data key="baseImage">adobe-base.jpg</data> + <data key="baseImageName">adobe-base</data> + <data key="smallImage">adobe-base.jpg</data> + <data key="smallImageName">adobe-base</data> + <data key="thumbnailImage">adobe-base.jpg</data> + <data key="thumbnailImageName">adobe-base</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="ImportProduct_Configurable" type="product"> + <data key="fileName">import_configurable_product.csv</data> + <data key="importSummary">Created: 4, Updated: 0, Deleted: 0</data> + <data key="name">import-product-configurable</data> + <data key="sku">import-product-configurable</data> + <data key="type_id">configurable</data> + <data key="attribute_set_id">4</data> + <data key="price"/> + <data key="quantity"/> + <data key="weight"/> + <data key="visibilityText">Catalog, Search</data> + <data key="status">1</data> + <data key="urlKey">import-product-configurable</data> + <data key="baseImage">adobe-base.jpg</data> + <data key="baseImageName">adobe-base</data> + <data key="smallImage">adobe-base.jpg</data> + <data key="smallImageName">adobe-base</data> + <data key="thumbnailImage">adobe-base.jpg</data> + <data key="thumbnailImageName">adobe-base</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> +</entities> diff --git a/app/code/Magento/ConfigurableImportExport/Test/Mftf/Test/AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml b/app/code/Magento/ConfigurableImportExport/Test/Mftf/Test/AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml new file mode 100644 index 000000000000..67a7a0970eb3 --- /dev/null +++ b/app/code/Magento/ConfigurableImportExport/Test/Mftf/Test/AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml @@ -0,0 +1,341 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest"> + <annotations> + <features value="Import/Export"/> + <stories value="Import Products"/> + <title value="Import Configurable Product With Simple Child Products With Images"/> + <description value="Imports a .csv file containing a configurable product with 3 child simple products that + have images. Verifies that products are imported successfully, that the images are attached to the + products as expected, and that the configurable product can be purchased successfully."/> + <severity value="MAJOR"/> + <testCaseId value="MC-38222"/> + <group value="importExport"/> + <group value="ConfigurableProduct"/> + </annotations> + + <before> + <!-- Login as Admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + + <!-- Create Category, Product Attribute with 3 Options, & Customer --> + <createData entity="ImportCategory_Configurable" stepKey="createImportCategory"/> + <createData entity="ProductAttributeWithThreeOptionsForImport" stepKey="createImportProductAttribute"/> + <createData entity="ProductAttributeOptionOneForExportImport" stepKey="createImportProductAttributeOption1"> + <requiredEntity createDataKey="createImportProductAttribute"/> + </createData> + <createData entity="ProductAttributeOptionTwoForExportImport" stepKey="createImportProductAttributeOption2"> + <requiredEntity createDataKey="createImportProductAttribute"/> + </createData> + <createData entity="ProductAttributeOptionThreeForImport" stepKey="createImportProductAttributeOption3"> + <requiredEntity createDataKey="createImportProductAttribute"/> + </createData> + <createData entity="AddToDefaultSet" stepKey="addToProductAttributeSet"> + <requiredEntity createDataKey="createImportProductAttribute"/> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + + <!-- Copy Images to Import Directory for Product Images --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportImages"> + <argument name="path">var/import/images/{{ImportProduct_Configurable.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct1BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple1_Configurable.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Configurable.name}}/{{ImportProductSimple1_Configurable.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct2BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple2_Configurable.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Configurable.name}}/{{ImportProductSimple2_Configurable.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct3BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple3_Configurable.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Configurable.name}}/{{ImportProductSimple3_Configurable.thumbnailImage}}</argument> + </helper> + </before> + + <after> + <!-- Delete Data --> + <deleteData createDataKey="createImportCategory" stepKey="deleteImportCategory"/> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="filterProductsGrid"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{ImportProduct_Configurable.name}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterApplyActionGroup" stepKey="applyProductsFilter"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteProducts"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="filterProductsGrid2"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="import-product"/> + </actionGroup> + <actionGroup ref="AdminGridFilterApplyActionGroup" stepKey="applyProductsFilter2"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteProducts2"/> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="resetProductsGrid"/> + <actionGroup ref="AdminDeleteProductAttributeByLabelActionGroup" stepKey="deleteAttribute"> + <argument name="productAttributeLabel" value="{{ProductAttributeFrontendLabelImport1.label}}" /> + </actionGroup> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteProductImageDirectory"> + <argument name="path">var/import/images/{{ImportProduct_Configurable.name}}</argument> + </helper> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Import Configurable Product with Simple Child Products & Assert No Errors --> + <actionGroup ref="AdminNavigateToImportPageActionGroup" stepKey="navigateToImportPage"/> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Configurable.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Configurable.name}}"/> + </actionGroup> + <actionGroup ref="AdminClickCheckDataImportActionGroup" stepKey="clickCheckData"/> + <see selector="{{AdminImportValidationMessagesSection.success}}" userInput="{{ImportCommonMessages.validFile}}" stepKey="seeCheckDataResultMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage"/> + <actionGroup ref="AdminClickImportActionGroup" stepKey="clickImport"/> + <see selector="{{AdminImportValidationMessagesSection.notice}}" userInput="{{ImportProduct_Configurable.importSummary}}" stepKey="seeNoticeMessage"/> + <see selector="{{AdminImportValidationMessagesSection.messageByType('success')}}" userInput="{{ImportCommonMessages.success}}" stepKey="seeImportMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage2"/> + + <!-- Reindex --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + + <!-- Admin: Verify Data on Import History Page --> + <actionGroup ref="AdminNavigateToImportHistoryPageActionGroup" stepKey="navigateToImportHistoryPage"/> + <actionGroup ref="AdminGridSortColumnDescendingActionGroup" stepKey="sortColumnByIdDescending"> + <argument name="columnLabel" value="history_id"/> + </actionGroup> + <see userInput="{{ImportProduct_Configurable.fileName}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeImportedFile"/> + <see userInput="{{ImportProduct_Configurable.importSummary}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeSummary"/> + + <!-- Admin: Verify Simple Product 1 on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToSimpleProduct1EditPage"> + <argument name="product" value="ImportProductSimple1_Configurable"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct1OnEditPage"> + <argument name="productStatus" value="{{ImportProductSimple1_Configurable.status}}"/> + <argument name="productName" value="{{ImportProductSimple1_Configurable.name}}"/> + <argument name="productSku" value="{{ImportProductSimple1_Configurable.sku}}"/> + <argument name="productPrice" value="{{ImportProductSimple1_Configurable.price}}"/> + <argument name="productQuantity" value="{{ImportProductSimple1_Configurable.quantity}}"/> + <argument name="productWeight" value="{{ImportProductSimple1_Configurable.weight}}"/> + <argument name="productVisibility" value="{{ImportProductSimple1_Configurable.visibilityText}}"/> + <argument name="categoryName" value="{{ImportCategory_Configurable.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct1BaseImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple1_Configurable.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple1_Configurable.baseImageName, 'image')}}" stepKey="seeBaseImageRole1"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct1SmallImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple1_Configurable.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple1_Configurable.smallImageName, 'small_image')}}" stepKey="seeSmallImageRole1"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct1ThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple1_Configurable.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple1_Configurable.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRole1"/> + + <!-- Admin: Verify Simple Product 2 on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToSimpleProduct2EditPage"> + <argument name="product" value="ImportProductSimple2_Configurable"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct2OnEditPage"> + <argument name="productStatus" value="{{ImportProductSimple2_Configurable.status}}"/> + <argument name="productName" value="{{ImportProductSimple2_Configurable.name}}"/> + <argument name="productSku" value="{{ImportProductSimple2_Configurable.sku}}"/> + <argument name="productPrice" value="{{ImportProductSimple2_Configurable.price}}"/> + <argument name="productQuantity" value="{{ImportProductSimple2_Configurable.quantity}}"/> + <argument name="productWeight" value="{{ImportProductSimple2_Configurable.weight}}"/> + <argument name="productVisibility" value="{{ImportProductSimple2_Configurable.visibilityText}}"/> + <argument name="categoryName" value="{{ImportCategory_Configurable.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct2BaseImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple2_Configurable.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple2_Configurable.baseImageName, 'image')}}" stepKey="seeBaseImageRole2"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct2SmallImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple2_Configurable.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple2_Configurable.smallImageName, 'small_image')}}" stepKey="seeSmallImageRole2"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct2ThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple2_Configurable.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple2_Configurable.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRole2"/> + + <!-- Admin: Verify Simple Product 3 on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToSimpleProduct3EditPage"> + <argument name="product" value="ImportProductSimple3_Configurable"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct3OnEditPage"> + <argument name="productStatus" value="{{ImportProductSimple3_Configurable.status}}"/> + <argument name="productName" value="{{ImportProductSimple3_Configurable.name}}"/> + <argument name="productSku" value="{{ImportProductSimple3_Configurable.sku}}"/> + <argument name="productPrice" value="{{ImportProductSimple3_Configurable.price}}"/> + <argument name="productQuantity" value="{{ImportProductSimple3_Configurable.quantity}}"/> + <argument name="productWeight" value="{{ImportProductSimple3_Configurable.weight}}"/> + <argument name="productVisibility" value="{{ImportProductSimple3_Configurable.visibilityText}}"/> + <argument name="categoryName" value="{{ImportCategory_Configurable.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct3BaseImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple3_Configurable.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple3_Configurable.baseImageName, 'image')}}" stepKey="seeBaseImageRole3"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct3SmallImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple3_Configurable.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple3_Configurable.smallImageName, 'small_image')}}" stepKey="seeSmallImageRole3"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct3ThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple3_Configurable.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple3_Configurable.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRole3"/> + + <!-- Admin: Verify Configurable Product Common Data on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToConfigurableProductEditPage"> + <argument name="product" value="ImportProduct_Configurable"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertConfigurableProductOnEditPage"> + <argument name="productStatus" value="{{ImportProduct_Configurable.status}}"/> + <argument name="productName" value="{{ImportProduct_Configurable.name}}"/> + <argument name="productSku" value="{{ImportProduct_Configurable.sku}}"/> + <argument name="productPrice" value="{{ImportProduct_Configurable.price}}"/> + <argument name="productQuantity" value="{{ImportProduct_Configurable.quantity}}"/> + <argument name="productWeight" value="{{ImportProduct_Configurable.weight}}"/> + <argument name="productVisibility" value="{{ImportProduct_Configurable.visibilityText}}"/> + <argument name="categoryName" value="{{ImportCategory_Configurable.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertConfigurableProductBaseImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Configurable.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Configurable.baseImageName, 'image')}}" stepKey="seeBaseImageRoleConfigurable"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertConfigurableProductSmallImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Configurable.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Configurable.smallImageName, 'small_image')}}" stepKey="seeSmallImageRoleConfigurable"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertConfigurableProductThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Configurable.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Configurable.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRoleConfigurable"/> + + <!-- Admin: Verify Configurable Product Information on Edit Product Page --> + <seeNumberOfElements userInput="3" selector="{{AdminProductFormConfigurationsSection.currentVariationsAllRows}}" stepKey="see3RowsAdmin"/> + <actionGroup ref="AdminVerifyCurrentVariationsForConfigurableProductActionGroup" stepKey="verifyConfigurableChildProduct1Admin"> + <argument name="image" value="{{ImportProductSimple1_Configurable.thumbnailImageName}}"/> + <argument name="name" value="{{ImportProductSimple1_Configurable.name}}"/> + <argument name="sku" value="{{ImportProductSimple1_Configurable.sku}}"/> + <argument name="price" value="${{ImportProductSimple1_Configurable.price}}"/> + <argument name="quantity" value="{{ImportProductSimple1_Configurable.quantity}}"/> + <argument name="weight" value="{{ImportProductSimple1_Configurable.weight}}"/> + <argument name="status" value="{{ImportProductSimple1_Configurable.statusText}}"/> + <argument name="attributes" value="{{ProductAttributeWithThreeOptionsForImport.attribute_code}}: {{ProductAttributeOptionOneForExportImport.label}}"/> + <argument name="index" value="1"/> + </actionGroup> + <actionGroup ref="AdminVerifyCurrentVariationsForConfigurableProductActionGroup" stepKey="verifyConfigurableChildProduct2Admin"> + <argument name="image" value="{{ImportProductSimple2_Configurable.thumbnailImageName}}"/> + <argument name="name" value="{{ImportProductSimple2_Configurable.name}}"/> + <argument name="sku" value="{{ImportProductSimple2_Configurable.sku}}"/> + <argument name="price" value="${{ImportProductSimple2_Configurable.price}}"/> + <argument name="quantity" value="{{ImportProductSimple2_Configurable.quantity}}"/> + <argument name="weight" value="{{ImportProductSimple2_Configurable.weight}}"/> + <argument name="status" value="{{ImportProductSimple2_Configurable.statusText}}"/> + <argument name="attributes" value="{{ProductAttributeWithThreeOptionsForImport.attribute_code}}: {{ProductAttributeOptionTwoForExportImport.label}}"/> + <argument name="index" value="2"/> + </actionGroup> + <actionGroup ref="AdminVerifyCurrentVariationsForConfigurableProductActionGroup" stepKey="verifyConfigurableChildProduct3Admin"> + <argument name="image" value="{{ImportProductSimple3_Configurable.thumbnailImageName}}"/> + <argument name="name" value="{{ImportProductSimple3_Configurable.name}}"/> + <argument name="sku" value="{{ImportProductSimple3_Configurable.sku}}"/> + <argument name="price" value="${{ImportProductSimple3_Configurable.price}}"/> + <argument name="quantity" value="{{ImportProductSimple3_Configurable.quantity}}"/> + <argument name="weight" value="{{ImportProductSimple3_Configurable.weight}}"/> + <argument name="status" value="{{ImportProductSimple3_Configurable.statusText}}"/> + <argument name="attributes" value="{{ProductAttributeWithThreeOptionsForImport.attribute_code}}: {{ProductAttributeOptionThreeForImport.label}}"/> + <argument name="index" value="3"/> + </actionGroup> + + <!-- Storefront: Verify Configurable Product In Category --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginStorefront"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + <actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryPage"> + <argument name="categoryUrl" value="{{ImportCategory_Configurable.name_lwr}}"/> + </actionGroup> + <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productName}}" userInput="1" stepKey="seeOnly1Product"/> + <see userInput="{{ImportProduct_Configurable.name}}" selector="{{StorefrontCategoryMainSection.productName}}" stepKey="seeConfigurableProduct"/> + <dontSee userInput="{{ImportProductSimple1_Configurable.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeSimpleProduct1"/> + <dontSee userInput="{{ImportProductSimple2_Configurable.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeSimpleProduct2"/> + <dontSee userInput="{{ImportProductSimple3_Configurable.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeSimpleProduct3"/> + + <!-- Storefront: Verify Configurable Product Info & Image --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefrontPage"> + <argument name="productUrl" value="{{ImportProduct_Configurable.urlKey}}"/> + </actionGroup> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Configurable.name}}" stepKey="seeProductName"/> + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Configurable.sku}}" stepKey="seeSku"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="As low as ${{ImportProductSimple1_Configurable.price}}" stepKey="seePrice"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProduct_Configurable.baseImageName)}}" stepKey="seeBaseImage"/> + + <!-- Storefront: Verify Configurable Product Option 1 Info & Image --> + <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption1"> + <argument name="attributeLabel" value="{{ProductAttributeFrontendLabelImport1.label}}"/> + <argument name="optionLabel" value="{{ProductAttributeOptionOneForExportImport.label}}"/> + </actionGroup> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Configurable.name}}" stepKey="seeProductName2"/> + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Configurable.sku}}" stepKey="seeSku2"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProductSimple1_Configurable.price}}" stepKey="seePrice2"/> + <waitForPageLoad stepKey="waitForImageLoad1"/> + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple1_Configurable.baseImageName)}}" stepKey="seeBaseImage2"/> + + <!-- Storefront: Verify Configurable Product Option 2 Info & Image --> + <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption2"> + <argument name="attributeLabel" value="{{ProductAttributeFrontendLabelImport1.label}}"/> + <argument name="optionLabel" value="{{ProductAttributeOptionTwoForExportImport.label}}"/> + </actionGroup> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Configurable.name}}" stepKey="seeProductName3"/> + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Configurable.sku}}" stepKey="seeSku3"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProductSimple2_Configurable.price}}" stepKey="seePrice3"/> + <waitForPageLoad stepKey="waitForImageLoad2"/> + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple2_Configurable.baseImageName)}}" stepKey="seeBaseImage3"/> + + <!-- Storefront: Verify Configurable Product Option 3 Info & Image --> + <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption3"> + <argument name="attributeLabel" value="{{ProductAttributeFrontendLabelImport1.label}}"/> + <argument name="optionLabel" value="{{ProductAttributeOptionThreeForImport.label}}"/> + </actionGroup> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Configurable.name}}" stepKey="seeProductName4"/> + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Configurable.sku}}" stepKey="seeSku4"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProductSimple3_Configurable.price}}" stepKey="seePrice4"/> + <waitForPageLoad stepKey="waitForImageLoad3"/> + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple3_Configurable.baseImageName)}}" stepKey="seeBaseImage4"/> + + <!-- Purchase Configurable Product --> + <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProductToCart"/> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="navigateToCheckoutPage"/> + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/> + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNextOnShippingStep"/> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlacePurchaseOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> + + <!-- Confirm Purchased Configurable Product --> + <actionGroup ref="StorefrontOpenOrderFromSuccessPageActionGroup" stepKey="openOrderFromSuccessPage"> + <argument name="orderNumber" value="{$grabOrderNumber}"/> + </actionGroup> + <seeNumberOfElements selector="{{StorefrontCustomerOrderViewSection.productRows}}" userInput="1" stepKey="seeOnly1ProductInOrder"/> + <actionGroup ref="StorefrontVerifyCustomerOrderProductRowDataActionGroup" stepKey="verifyProductRowInOrder"> + <argument name="name" value="{{ImportProduct_Configurable.name}}"/> + <argument name="sku" value="{{ImportProductSimple3_Configurable.sku}}"/> + <argument name="price" value="${{ImportProductSimple3_Configurable.price}}"/> + <argument name="quantity" value="1"/> + <argument name="subtotal" value="${{ImportProductSimple3_Configurable.price}}"/> + </actionGroup> + <waitForText userInput="{{ProductAttributeWithThreeOptionsForImport.attribute_code}}" selector="{{StorefrontCustomerOrderViewSection.productNameByRow('1')}}" stepKey="seeProductAttribute"/> + <waitForText userInput="{{ProductAttributeOptionThreeForImport.label}}" selector="{{StorefrontCustomerOrderViewSection.productNameByRow('1')}}" stepKey="seeProductAttributeOption"/> + </test> +</tests> diff --git a/app/code/Magento/ConfigurableImportExport/etc/di.xml b/app/code/Magento/ConfigurableImportExport/etc/di.xml index f72f3885d45c..c30eae0aa9a7 100644 --- a/app/code/Magento/ConfigurableImportExport/etc/di.xml +++ b/app/code/Magento/ConfigurableImportExport/etc/di.xml @@ -13,4 +13,9 @@ </argument> </arguments> </type> + <type name="Magento\CatalogImportExport\Model\StockItemImporterInterface"> + <plugin name="update_configurable_products_stock_item_status" + type="Magento\ConfigurableImportExport\Plugin\Import\Product\UpdateConfigurableProductsStockItemStatusPlugin" + sortOrder="100"/> + </type> </config> diff --git a/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Attribute/GetAttributes.php b/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Attribute/GetAttributes.php index 9f5d5062b536..f7230fddfaf2 100644 --- a/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Attribute/GetAttributes.php +++ b/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Attribute/GetAttributes.php @@ -31,6 +31,11 @@ class GetAttributes extends Action implements HttpGetActionInterface */ protected $jsonHelper; + /** + * @var AttributesListInterface + */ + private $attributesList; + /** * @param Action\Context $context * @param \Magento\Store\Model\StoreManagerInterface $storeManager diff --git a/app/code/Magento/ConfigurableProduct/Model/Inventory/ChangeParentStockStatus.php b/app/code/Magento/ConfigurableProduct/Model/Inventory/ChangeParentStockStatus.php new file mode 100644 index 000000000000..9bb4659b31db --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Model/Inventory/ChangeParentStockStatus.php @@ -0,0 +1,127 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ConfigurableProduct\Model\Inventory; + +use Magento\CatalogInventory\Api\Data\StockItemInterface; +use Magento\CatalogInventory\Api\StockConfigurationInterface; +use Magento\CatalogInventory\Api\StockItemCriteriaInterfaceFactory; +use Magento\CatalogInventory\Api\StockItemRepositoryInterface; +use Magento\ConfigurableProduct\Model\Product\Type\Configurable; + +/*** + * Update stock status of configurable products based on children products stock status + */ +class ChangeParentStockStatus +{ + /** + * @var Configurable + */ + private $configurableType; + + /** + * @var StockItemCriteriaInterfaceFactory + */ + private $criteriaInterfaceFactory; + + /** + * @var StockItemRepositoryInterface + */ + private $stockItemRepository; + + /** + * @var StockConfigurationInterface + */ + private $stockConfiguration; + + /** + * @param Configurable $configurableType + * @param StockItemCriteriaInterfaceFactory $criteriaInterfaceFactory + * @param StockItemRepositoryInterface $stockItemRepository + * @param StockConfigurationInterface $stockConfiguration + */ + public function __construct( + Configurable $configurableType, + StockItemCriteriaInterfaceFactory $criteriaInterfaceFactory, + StockItemRepositoryInterface $stockItemRepository, + StockConfigurationInterface $stockConfiguration + ) { + $this->configurableType = $configurableType; + $this->criteriaInterfaceFactory = $criteriaInterfaceFactory; + $this->stockItemRepository = $stockItemRepository; + $this->stockConfiguration = $stockConfiguration; + } + + /** + * Update stock status of configurable products based on children products stock status + * + * @param array $childrenIds + * @return void + */ + public function execute(array $childrenIds): void + { + $parentIds = $this->configurableType->getParentIdsByChild($childrenIds); + foreach (array_unique($parentIds) as $productId) { + $this->processStockForParent((int)$productId); + } + } + + /** + * Update stock status of configurable product based on children products stock status + * + * @param int $productId + * @return void + */ + private function processStockForParent(int $productId): void + { + $criteria = $this->criteriaInterfaceFactory->create(); + $criteria->setScopeFilter($this->stockConfiguration->getDefaultScopeId()); + + $criteria->setProductsFilter($productId); + $stockItemCollection = $this->stockItemRepository->getList($criteria); + $allItems = $stockItemCollection->getItems(); + if (empty($allItems)) { + return; + } + $parentStockItem = array_shift($allItems); + + $childrenIds = $this->configurableType->getChildrenIds($productId); + $criteria->setProductsFilter($childrenIds); + $stockItemCollection = $this->stockItemRepository->getList($criteria); + $allItems = $stockItemCollection->getItems(); + + $childrenIsInStock = false; + + foreach ($allItems as $childItem) { + if ($childItem->getIsInStock() === true) { + $childrenIsInStock = true; + break; + } + } + + if ($this->isNeedToUpdateParent($parentStockItem, $childrenIsInStock)) { + $parentStockItem->setIsInStock($childrenIsInStock); + $parentStockItem->setStockStatusChangedAuto(1); + $this->stockItemRepository->save($parentStockItem); + } + } + + /** + * Check if parent item should be updated + * + * @param StockItemInterface $parentStockItem + * @param bool $childrenIsInStock + * @return bool + */ + private function isNeedToUpdateParent( + StockItemInterface $parentStockItem, + bool $childrenIsInStock + ): bool { + return $parentStockItem->getIsInStock() !== $childrenIsInStock && + ($childrenIsInStock === false || $parentStockItem->getStockStatusChangedAuto()); + } +} diff --git a/app/code/Magento/ConfigurableProduct/Model/Inventory/ParentItemProcessor.php b/app/code/Magento/ConfigurableProduct/Model/Inventory/ParentItemProcessor.php index f1567f2b196d..4ae3efdd6aca 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Inventory/ParentItemProcessor.php +++ b/app/code/Magento/ConfigurableProduct/Model/Inventory/ParentItemProcessor.php @@ -12,8 +12,8 @@ use Magento\CatalogInventory\Api\StockItemCriteriaInterfaceFactory; use Magento\CatalogInventory\Api\StockItemRepositoryInterface; use Magento\CatalogInventory\Api\StockConfigurationInterface; -use Magento\CatalogInventory\Api\Data\StockItemInterface; use Magento\CatalogInventory\Observer\ParentItemProcessorInterface; +use Magento\Framework\App\ObjectManager; /** * Process parent stock item @@ -21,41 +21,27 @@ class ParentItemProcessor implements ParentItemProcessorInterface { /** - * @var Configurable + * @var ChangeParentStockStatus */ - private $configurableType; - - /** - * @var StockItemCriteriaInterfaceFactory - */ - private $criteriaInterfaceFactory; - - /** - * @var StockItemRepositoryInterface - */ - private $stockItemRepository; - - /** - * @var StockConfigurationInterface - */ - private $stockConfiguration; + private $changeParentStockStatus; /** * @param Configurable $configurableType * @param StockItemCriteriaInterfaceFactory $criteriaInterfaceFactory * @param StockItemRepositoryInterface $stockItemRepository * @param StockConfigurationInterface $stockConfiguration + * @param ChangeParentStockStatus|null $changeParentStockStatus + * @SuppressWarnings(PHPMD.UnusedFormalParameter) Deprecated dependencies */ public function __construct( Configurable $configurableType, StockItemCriteriaInterfaceFactory $criteriaInterfaceFactory, StockItemRepositoryInterface $stockItemRepository, - StockConfigurationInterface $stockConfiguration + StockConfigurationInterface $stockConfiguration, + ?ChangeParentStockStatus $changeParentStockStatus = null ) { - $this->configurableType = $configurableType; - $this->criteriaInterfaceFactory = $criteriaInterfaceFactory; - $this->stockItemRepository = $stockItemRepository; - $this->stockConfiguration = $stockConfiguration; + $this->changeParentStockStatus = $changeParentStockStatus + ?? ObjectManager::getInstance()->get(ChangeParentStockStatus::class); } /** @@ -66,64 +52,6 @@ public function __construct( */ public function process(Product $product) { - $parentIds = $this->configurableType->getParentIdsByChild($product->getId()); - foreach ($parentIds as $productId) { - $this->processStockForParent((int)$productId); - } - } - - /** - * Change stock item for parent product depending on children stock items - * - * @param int $productId - * @return void - */ - private function processStockForParent(int $productId) - { - $criteria = $this->criteriaInterfaceFactory->create(); - $criteria->setScopeFilter($this->stockConfiguration->getDefaultScopeId()); - - $criteria->setProductsFilter($productId); - $stockItemCollection = $this->stockItemRepository->getList($criteria); - $allItems = $stockItemCollection->getItems(); - if (empty($allItems)) { - return; - } - $parentStockItem = array_shift($allItems); - - $childrenIds = $this->configurableType->getChildrenIds($productId); - $criteria->setProductsFilter($childrenIds); - $stockItemCollection = $this->stockItemRepository->getList($criteria); - $allItems = $stockItemCollection->getItems(); - - $childrenIsInStock = false; - - foreach ($allItems as $childItem) { - if ($childItem->getIsInStock() === true) { - $childrenIsInStock = true; - break; - } - } - - if ($this->isNeedToUpdateParent($parentStockItem, $childrenIsInStock)) { - $parentStockItem->setIsInStock($childrenIsInStock); - $parentStockItem->setStockStatusChangedAuto(1); - $this->stockItemRepository->save($parentStockItem); - } - } - - /** - * Check is parent item should be updated - * - * @param StockItemInterface $parentStockItem - * @param bool $childrenIsInStock - * @return bool - */ - private function isNeedToUpdateParent( - StockItemInterface $parentStockItem, - bool $childrenIsInStock - ): bool { - return $parentStockItem->getIsInStock() !== $childrenIsInStock && - ($childrenIsInStock === false || $parentStockItem->getStockStatusChangedAuto()); + $this->changeParentStockStatus->execute([$product->getId()]); } } diff --git a/app/code/Magento/ConfigurableProduct/Plugin/Model/Attribute/Backend/AttributeValidation.php b/app/code/Magento/ConfigurableProduct/Plugin/Model/Attribute/Backend/AttributeValidation.php index 4a11137b62af..842ba25b163a 100644 --- a/app/code/Magento/ConfigurableProduct/Plugin/Model/Attribute/Backend/AttributeValidation.php +++ b/app/code/Magento/ConfigurableProduct/Plugin/Model/Attribute/Backend/AttributeValidation.php @@ -3,10 +3,15 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\ConfigurableProduct\Plugin\Model\Attribute\Backend; use Magento\Catalog\Api\Data\ProductInterface; use Magento\ConfigurableProduct\Model\Product\Type\Configurable; +use Magento\Eav\Model\Entity\Attribute\AbstractAttribute; +use Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend; +use Magento\Framework\DataObject; /** * Skip validate attributes used for create configurable product @@ -19,7 +24,6 @@ class AttributeValidation private $configurableProductType; /** - * AttributeValidation constructor. * @param Configurable $configurableProductType */ public function __construct( @@ -29,27 +33,42 @@ public function __construct( } /** - * @param \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend $subject + * Verify is attribute used for configurable product creation and should not be validated. + * + * @param AbstractBackend $subject * @param \Closure $proceed - * @param \Magento\Framework\DataObject $entity + * @param DataObject $entity * @return bool */ public function aroundValidate( - \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend $subject, + AbstractBackend $subject, \Closure $proceed, - \Magento\Framework\DataObject $entity + DataObject $entity ) { $attribute = $subject->getAttribute(); - if ($entity instanceof ProductInterface - && $entity->getTypeId() == Configurable::TYPE_CODE - && in_array( - $attribute->getAttributeId(), - $this->configurableProductType->getUsedProductAttributeIds($entity), - true - ) - ) { + if ($this->isAttributeShouldNotBeValidated($entity, $attribute)) { return true; } return $proceed($entity); } + + /** + * Verify if attribute is a part of configurable product and should not be validated. + * + * @param DataObject $entity + * @param AbstractAttribute $attribute + * @return bool + */ + private function isAttributeShouldNotBeValidated(DataObject $entity, AbstractAttribute $attribute): bool + { + if (!($entity instanceof ProductInterface && $entity->getTypeId() === Configurable::TYPE_CODE)) { + return false; + } + $attributeId = $attribute->getAttributeId(); + $options = $entity->getConfigurableProductOptions() ?: []; + $configurableAttributeIds = array_column($options, 'attribute_id'); + + return in_array($attributeId, $configurableAttributeIds) + || in_array($attributeId, $this->configurableProductType->getUsedProductAttributeIds($entity), true); + } } diff --git a/app/code/Magento/ConfigurableProduct/README.md b/app/code/Magento/ConfigurableProduct/README.md index 68e947abf8a4..b0cc21d1bc77 100644 --- a/app/code/Magento/ConfigurableProduct/README.md +++ b/app/code/Magento/ConfigurableProduct/README.md @@ -1,5 +1,44 @@ -Magento_ConfigurableProduct module introduces new product type in the Magento application called Configurable Product. +# Magento_ConfigurableProduct module + +The Magento_ConfigurableProduct module introduces new product type in the Magento application called Configurable Product. This module is designed to extend existing functionality of Magento_Catalog module by adding new product type. Configurable Products let the customers select the variant they desire by choosing options. For example, store owner sells t-shirts in two colors and three sizes. + +## Structure + +`ConfigurableProduct/` - the directory that declares ConfigurableProduct metadata used by the module. + +For information about a typical file structure of a module in Magento 2, see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). + +## Extensibility + +Extension developers can interact with the Magento_ConfigurableProduct module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_ConfigurableProduct module. + +## Additional information + +### Configurable variables through the theme view.xml + +Modify the value of the `gallery_switch_strategy` variable in the theme view.xml file to configure how gallery images should be updated when a user switches between product configurations. + +Learn how to [configure variables](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/themes/theme-images.html#view_xml_vars) in the view.xml file. + +There are two available values for the `gallery_switch_strategy` variable: + +Value | Description +--- | --- +`replace` | In replace mode, images of the parent configurable product will be replaced by the simple product images upon a configuration change +`prepend` | In prepend mode, the simple product images will be added in front of the parent configurable product upon a configuration change + +If the `gallery_switch_strategy` variable is not defined, the default value `replace` will be used. + +For example, adding these lines of code to the theme view.xml file will set the gallery behavior to `replace` mode. + +```xml +<vars module="Magento_ConfigurableProduct"> + <var name="gallery_switch_strategy">replace</var> +</vars> +``` diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminVerifyCurrentVariationsForConfigurableProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminVerifyCurrentVariationsForConfigurableProductActionGroup.xml new file mode 100644 index 000000000000..f85341da5574 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminVerifyCurrentVariationsForConfigurableProductActionGroup.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminVerifyCurrentVariationsForConfigurableProductActionGroup"> + <annotations> + <description>Verify product data for the specified row in the Configurations Current Variations grid on the + Edit Product page in admin for a Configurable Product.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="Magento_Catalog/images/product/placeholder/thumbnail.jpg" type="string"/> + <argument name="name" defaultValue="{{_defaultProduct.name}}" type="string"/> + <argument name="sku" defaultValue="{{_defaultProduct.sku}}" type="string"/> + <argument name="price" defaultValue="${{_defaultProduct.price}}" type="string"/> + <argument name="quantity" defaultValue="{{_defaultProduct.quantity}}" type="string"/> + <argument name="weight" defaultValue="{{_defaultProduct.weight}}" type="string"/> + <argument name="status" defaultValue="Enabled" type="string"/> + <argument name="attributes" type="string"/> + <argument name="index" defaultValue="1" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminProductFormConfigurationsSection.currentVariationsProductImage(index)}}" stepKey="waitForProductImage"/> + <grabAttributeFrom userInput="src" selector="{{AdminProductFormConfigurationsSection.currentVariationsProductImage(index)}}" stepKey="grabProductImageSrc"/> + <assertStringContainsString stepKey="assertProductImageSrc"> + <expectedResult type="string">{{image}}</expectedResult> + <actualResult type="variable">$grabProductImageSrc</actualResult> + </assertStringContainsString> + <see userInput="{{name}}" selector="{{AdminProductFormConfigurationsSection.currentVariationsProductName(index)}}" stepKey="seeProductName"/> + <see userInput="{{sku}}" selector="{{AdminProductFormConfigurationsSection.currentVariationsProductSku(index)}}" stepKey="seeProductSku"/> + <see userInput="{{price}}" selector="{{AdminProductFormConfigurationsSection.currentVariationsProductPrice(index)}}" stepKey="seeProductPrice"/> + <see userInput="{{quantity}}" selector="{{AdminProductFormConfigurationsSection.currentVariationsProductQuantity(index)}}" stepKey="seeProductQuantity"/> + <see userInput="{{weight}}" selector="{{AdminProductFormConfigurationsSection.currentVariationsProductWeight(index)}}" stepKey="seeProductWeight"/> + <see userInput="{{status}}" selector="{{AdminProductFormConfigurationsSection.currentVariationsProductStatus(index)}}" stepKey="seeProductStatus"/> + <see userInput="{{attributes}}" selector="{{AdminProductFormConfigurationsSection.currentVariationsProductAttributes(index)}}" stepKey="seeProductAttributes"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertAdminChildProductDataOnParentProductEditPageActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertAdminChildProductDataOnParentProductEditPageActionGroup.xml new file mode 100644 index 000000000000..dc2924b655c3 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertAdminChildProductDataOnParentProductEditPageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminChildProductDataOnParentProductEditPageActionGroup"> + <annotations> + <description>Verify the proper child product data (name, sku, price) is shown on the Configurable Product edit page.</description> + </annotations> + <arguments> + <argument name="attribute" type="string"/> + <argument name="value" type="string"/> + </arguments> + <see selector="{{AdminProductFormConfigurationsSection.currentVariationsCells(attribute)}}" userInput="{{value}}" + stepKey="seeChildProductData"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertStorefrontProductAttributeLabelVisibleActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertStorefrontProductAttributeLabelVisibleActionGroup.xml new file mode 100644 index 000000000000..ea2ea3b12eba --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertStorefrontProductAttributeLabelVisibleActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontProductAttributeLabelVisibleActionGroup"> + <arguments> + <argument name="productAttributeLabel" type="string"/> + </arguments> + <see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="{{productAttributeLabel}}" stepKey="seeProductAttributeLabel"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertStorefrontProductAttributeOptionVisibleActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertStorefrontProductAttributeOptionVisibleActionGroup.xml new file mode 100644 index 000000000000..f90be42e24fc --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertStorefrontProductAttributeOptionVisibleActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontProductAttributeOptionVisibleActionGroup"> + <arguments> + <argument name="productAttributeOption" type="string"/> + </arguments> + <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{productAttributeOption}}" stepKey="seeProductAttributeOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertStorefrontProductOptionsDropDownVisibleActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertStorefrontProductOptionsDropDownVisibleActionGroup.xml new file mode 100644 index 000000000000..7b22a19b2119 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertStorefrontProductOptionsDropDownVisibleActionGroup.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontProductOptionsDropDownVisibleActionGroup"> + + <seeElement selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeProductOptionsDropDown"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ConfigurableProductData.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ConfigurableProductData.xml index 87b181616bd7..f07faf4087c3 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ConfigurableProductData.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ConfigurableProductData.xml @@ -16,7 +16,7 @@ <data key="name" unique="suffix">configurable</data> <data key="price">123.00</data> <data key="weight">2</data> - <data key="urlKey" unique="suffix">configurableurlkey</data> + <data key="urlKey" unique="suffix">configurable</data> <data key="status">1</data> <data key="quantity">100</data> <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection/AdminProductFormConfigurationsSection.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection/AdminProductFormConfigurationsSection.xml index 320b3d575f3c..264a3d4e7503 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection/AdminProductFormConfigurationsSection.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection/AdminProductFormConfigurationsSection.xml @@ -17,7 +17,17 @@ <element name="currentVariationsPriceCells" type="textarea" selector=".admin__control-fields[data-index='price_container']"/> <element name="currentVariationsQuantityCells" type="textarea" selector=".admin__control-fields[data-index='quantity_container']"/> <element name="currentVariationsAttributesCells" type="textarea" selector=".admin__control-fields[data-index='attributes']"/> + <element name="currentVariationsCells" type="textarea" selector=".admin__control-fields[data-index='{{var}}']" parameterized="true"/> <element name="currentVariationsStatusCells" type="textarea" selector="._no-header[data-index='status']"/> + <element name="currentVariationsAllRows" type="text" selector="[data-index=configurable-matrix] .data-row"/> + <element name="currentVariationsProductImage" type="text" parameterized="true" selector="[data-index=configurable-matrix] .data-row:nth-of-type({{index}}) td[data-index=thumbnail_image_container] img"/> + <element name="currentVariationsProductName" type="text" parameterized="true" selector="[data-index=configurable-matrix] .data-row:nth-of-type({{index}}) td[data-index=name_container]"/> + <element name="currentVariationsProductSku" type="text" parameterized="true" selector="[data-index=configurable-matrix] .data-row:nth-of-type({{index}}) td[data-index=sku_container]"/> + <element name="currentVariationsProductPrice" type="text" parameterized="true" selector="[data-index=configurable-matrix] .data-row:nth-of-type({{index}}) td[data-index=price_container]"/> + <element name="currentVariationsProductQuantity" type="text" parameterized="true" selector="[data-index=configurable-matrix] .data-row:nth-of-type({{index}}) td[data-index=quantity_container]"/> + <element name="currentVariationsProductWeight" type="text" parameterized="true" selector="[data-index=configurable-matrix] .data-row:nth-of-type({{index}}) td[data-index=price_weight]"/> + <element name="currentVariationsProductStatus" type="text" parameterized="true" selector="[data-index=configurable-matrix] .data-row:nth-of-type({{index}}) td[data-index=status]"/> + <element name="currentVariationsProductAttributes" type="text" parameterized="true" selector="[data-index=configurable-matrix] .data-row:nth-of-type({{index}}) td[data-index=attributes]"/> <element name="firstSKUInConfigurableProductsGrid" type="input" selector="//input[@name='configurable-matrix[0][sku]']"/> <element name="actionsBtn" type="button" selector="(//button[@class='action-select']/span[contains(text(), 'Select')])[{{var1}}]" parameterized="true"/> <element name="actionsBtnByProductName" type="textarea" selector="//*[.='Attributes']/ancestor::tr/td[@data-index='attributes']//span[contains(text(), '{{var}}')]/ancestor::tr//button[@class='action-select']" parameterized="true"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml index 4190dafb927e..07ed24d9bdbc 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml @@ -108,7 +108,7 @@ <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="AssertProductInStorefrontProductPage"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest/AdminConfigurableProductCreateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest/AdminConfigurableProductCreateTest.xml index 59da88874f5b..a17fcf1ddf30 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest/AdminConfigurableProductCreateTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest/AdminConfigurableProductCreateTest.xml @@ -25,6 +25,30 @@ <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersConfigurable"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterConfigurable"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterFillSelectFieldActionGroup" stepKey="addTypeFilterConfigurable"> + <argument name="filterName" value="type_id"/> + <argument name="filterValue" value="Configurable Product"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterConfigurable"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteConfigurableProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> @@ -37,35 +61,84 @@ <!-- assert color configurations on the admin create product page --> <dontSee selector="{{AdminProductFormConfigurationsSection.variationLabel}}" stepKey="seeLabelNotVisible"/> <seeNumberOfElements selector="{{AdminProductFormConfigurationsSection.currentVariationsRows}}" userInput="3" stepKey="seeNumberOfRows"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="{{colorProductAttribute1.name}}" stepKey="seeAttributeName1InField"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="{{colorProductAttribute2.name}}" stepKey="seeAttributeName2InField"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="{{colorProductAttribute3.name}}" stepKey="seeAttributeName3InField"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsSkuCells}}" userInput="{{colorProductAttribute1.name}}" stepKey="seeAttributeSku1InField"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsSkuCells}}" userInput="{{colorProductAttribute2.name}}" stepKey="seeAttributeSku2InField"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsSkuCells}}" userInput="{{colorProductAttribute3.name}}" stepKey="seeAttributeSku3InField"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsPriceCells}}" userInput="{{colorProductAttribute1.price}}" stepKey="seeUniquePrice1InField"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsPriceCells}}" userInput="{{colorProductAttribute2.price}}" stepKey="seeUniquePrice2InField"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsPriceCells}}" userInput="{{colorProductAttribute3.price}}" stepKey="seeUniquePrice3InField"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsQuantityCells}}" userInput="{{colorProductAttribute.attribute_quantity}}" stepKey="seeQuantityInField"/> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeAttributeName1InField"> + <argument name="attribute" value="name_container"/> + <argument name="value" value="{{colorProductAttribute1.name}}"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeAttributeName2InField"> + <argument name="attribute" value="name_container"/> + <argument name="value" value="{{colorProductAttribute2.name}}"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeAttributeName3InField"> + <argument name="attribute" value="name_container"/> + <argument name="value" value="{{colorProductAttribute3.name}}"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeAttributeSku1InField"> + <argument name="attribute" value="sku_container"/> + <argument name="value" value="{{colorProductAttribute1.name}}"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeAttributeSku2InField"> + <argument name="attribute" value="sku_container"/> + <argument name="value" value="{{colorProductAttribute2.name}}"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeAttributeSku3InField"> + <argument name="attribute" value="sku_container"/> + <argument name="value" value="{{colorProductAttribute3.name}}"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeUniquePrice1InField"> + <argument name="attribute" value="price_container"/> + <argument name="value" value="{{colorProductAttribute1.price}}"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeUniquePrice2InField"> + <argument name="attribute" value="price_container"/> + <argument name="value" value="{{colorProductAttribute2.price}}"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeUniquePrice3InField"> + <argument name="attribute" value="price_container"/> + <argument name="value" value="{{colorProductAttribute3.price}}"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeQuantityInField"> + <argument name="attribute" value="quantity_container"/> + <argument name="value" value="{{colorProductAttribute.attribute_quantity}}"/> + </actionGroup> <!-- assert storefront category list page --> - <amOnPage url="/" stepKey="amOnStorefront"/> - <waitForPageLoad stepKey="waitForPageLoad3"/> - <click userInput="$$createCategory.name$$" stepKey="clickOnCategoryName"/> - <waitForPageLoad stepKey="waitForPageLoad4"/> - <see userInput="{{_defaultProduct.name}}" stepKey="assertProductPresent"/> - <see userInput="{{colorProductAttribute1.price}}" stepKey="assertProductPricePresent"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="amOnStorefront"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad3"/> + <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="clickOnCategoryName"> + <argument name="categoryName" value="$$createCategory.name$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad4"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductPresent"> + <argument name="productName" value="{{_defaultProduct.name}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductPriceOnCategoryPageActionGroup" stepKey="assertProductPricePresent"> + <argument name="productName" value="{{_defaultProduct.name}}"/> + <argument name="productPrice" value="{{colorProductAttribute1.price}}"/> + </actionGroup> <!-- assert storefront product details page --> - <click userInput="{{_defaultProduct.name}}" stepKey="clickOnProductName"/> - <waitForPageLoad stepKey="waitForPageLoad5"/> - <seeInTitle userInput="{{_defaultProduct.name}}" stepKey="assertProductNameTitle"/> - <see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> - <see userInput="{{colorProductAttribute1.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/> - <see userInput="{{_defaultProduct.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> - <see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="{{colorProductAttribute.default_label}}" stepKey="seeColorAttributeName1"/> - <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute1.name}}" stepKey="seeInDropDown1"/> - <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute2.name}}" stepKey="seeInDropDown2"/> - <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute3.name}}" stepKey="seeInDropDown3"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickOnProductName"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad5"/> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="assertProductNameTitle"> + <argument name="product" value="_defaultProduct"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertProductName"/> + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="assertProductPrice"> + <argument name="productPrice" value="{{colorProductAttribute1.price}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertProductSku"/> + <actionGroup ref="AssertStorefrontProductAttributeLabelVisibleActionGroup" stepKey="seeColorAttributeName1"> + <argument name="productAttributeLabel" value="{{colorProductAttribute.default_label}}"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown1"> + <argument name="productAttributeOption" value="{{colorProductAttribute1.name}}"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown2"> + <argument name="productAttributeOption" value="{{colorProductAttribute2.name}}"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown3"> + <argument name="productAttributeOption" value="{{colorProductAttribute3.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductBulkDeleteTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductBulkDeleteTest.xml index 4f6407ca4150..5f7d98e3fa91 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductBulkDeleteTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductBulkDeleteTest.xml @@ -158,15 +158,15 @@ <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="0" stepKey="seeNoResults"/> <!-- after delete, assert product pages are 404 --> - <amOnPage url="$$createProduct1.sku$$.html" stepKey="gotoStorefront1"/> + <amOnPage url="$$createProduct1.custom_attributes[url_key]$$.html" stepKey="gotoStorefront1"/> <waitForPageLoad stepKey="waitForProduct1"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops1"/> <dontSee selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createProduct1.name$$" stepKey="dontSeeProduct1"/> - <amOnPage url="$$createProduct1.sku$$.html" stepKey="gotoStorefront2"/> + <amOnPage url="$$createProduct1.custom_attributes[url_key]$$.html" stepKey="gotoStorefront2"/> <waitForPageLoad stepKey="waitForProduct2"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops2"/> <dontSee selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createProduct1.name$$" stepKey="dontSeeProduct2"/> - <amOnPage url="$$createProduct1.sku$$.html" stepKey="gotoStorefront3"/> + <amOnPage url="$$createProduct1.custom_attributes[url_key]$$.html" stepKey="gotoStorefront3"/> <waitForPageLoad stepKey="waitForProduct3"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops3"/> <dontSee selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createProduct1.name$$" stepKey="dontSeeProduct3"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductDeleteTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductDeleteTest.xml index 186752fd5268..56f74e4ff1fc 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductDeleteTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductDeleteTest.xml @@ -75,7 +75,7 @@ </after> <!-- assert product visible in storefront --> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="gotoStorefront1"/> + <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="gotoStorefront1"/> <waitForPageLoad stepKey="wait1"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProduct"/> @@ -94,7 +94,7 @@ <see selector="{{AdminProductMessagesSection.successMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="seeSuccessMsg"/> <!-- after delete, assert product page is 404 --> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="gotoStorefront2"/> + <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="gotoStorefront2"/> <waitForPageLoad stepKey="wait3"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> <dontSee selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="dontSeeProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSetEditContentTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSetEditContentTest.xml index 0da4c265a73a..80efad157e87 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSetEditContentTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSetEditContentTest.xml @@ -35,6 +35,6 @@ </actionGroup> <!--Checking content storefront--> - <amOnPage url="{{BaseConfigurableProduct.name}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{BaseConfigurableProduct.urlKey}}.html" stepKey="goToStorefront"/> </test> </tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductAddConfigurationTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductAddConfigurationTest.xml index 854cfb98607a..4ef63ba34887 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductAddConfigurationTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductAddConfigurationTest.xml @@ -25,6 +25,30 @@ <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersConfigurable"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterConfigurable"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterFillSelectFieldActionGroup" stepKey="addTypeFilterConfigurable"> + <argument name="filterName" value="type_id"/> + <argument name="filterValue" value="Configurable Product"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterConfigurable"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteConfigurableProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductDisableAnOptionTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductDisableAnOptionTest.xml index 345b21246f30..7fa4cc5006cb 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductDisableAnOptionTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductDisableAnOptionTest.xml @@ -75,7 +75,7 @@ </after> <!--check storefront for both options--> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="amOnStorefront1"/> + <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="amOnStorefront1"/> <waitForPageLoad stepKey="wait1"/> <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option1" stepKey="seeOption1Storefront"/> <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option2" stepKey="seeOption2Storefront"/> @@ -91,7 +91,7 @@ <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSave"/> <!--check storefront for one option--> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="amOnStorefront2"/> + <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="amOnStorefront2"/> <waitForPageLoad stepKey="wait4"/> <dontSee selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option1" stepKey="dontSeeOption1InStorefront"/> <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option2" stepKey="seeOption2Again"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveAnOptionTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveAnOptionTest.xml index ec0ed623d2b0..9b61427274fc 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveAnOptionTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveAnOptionTest.xml @@ -75,10 +75,16 @@ </after> <!--check storefront for both options--> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="amOnStorefront1"/> - <waitForPageLoad stepKey="wait1"/> - <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option1" stepKey="seeOption1Storefront"/> - <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option2" stepKey="seeOption2Storefront"/> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="amOnStorefront1"> + <argument name="product" value="$createConfigProduct$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait1"/> + <actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeOption1Storefront"> + <argument name="productAttributeOption" value="option1"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeOption2Storefront"> + <argument name="productAttributeOption" value="option2"/> + </actionGroup> <!--check admin for both options--> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> @@ -86,8 +92,14 @@ <argument name="productId" value="$$createConfigProduct.id$$"/> </actionGroup> <waitForPageLoad stepKey="wait2"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="$$createConfigChildProduct1.name$$" stepKey="seeOption1Admin"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="$$createConfigChildProduct2.name$$" stepKey="seeOption2Admin"/> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeOption1Admin"> + <argument name="attribute" value="name_container"/> + <argument name="value" value="$$createConfigChildProduct1.name$$"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeOption2Admin"> + <argument name="attribute" value="name_container"/> + <argument name="value" value="$$createConfigChildProduct2.name$$"/> + </actionGroup> <!--remove an option--> <click selector="{{AdminProductFormConfigurationsSection.actionsBtn('1')}}" stepKey="clickToExpandActions"/> @@ -98,9 +110,13 @@ <dontSee selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="$$createConfigChildProduct1.name$$" stepKey="dontSeeOption1Admin"/> <!--check storefront for one option--> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="amOnStorefront2"/> - <waitForPageLoad stepKey="wait4"/> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="amOnStorefront2"> + <argument name="product" value="$createConfigProduct$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait4"/> <dontSee selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option1" stepKey="dontSeeOption1InStorefront"/> - <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option2" stepKey="seeOption2Again"/> + <actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeOption2Again"> + <argument name="productAttributeOption" value="option2"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveConfigurationTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveConfigurationTest.xml index 75fbaa7f4388..3016ef4add00 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveConfigurationTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveConfigurationTest.xml @@ -28,6 +28,15 @@ <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProductFilteredBySkuAndName"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFiltersOnProductIndexPage"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> <!-- Reindex invalidated indices after product attribute has been created/deleted --> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml index 924707a16600..775ffe1cf1ad 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml @@ -29,6 +29,7 @@ <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters" after="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> </after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml index 796a4628393b..ef32b401fe09 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml @@ -51,7 +51,7 @@ <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> - <argument name="productUrl" value="{{BaseConfigurableProduct.sku}}"/> + <argument name="productUrl" value="{{BaseConfigurableProduct.urlKey}}"/> </actionGroup> <!-- Assert product design settings "left bar is present at product page with 2 columns" --> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml index c285287130ac..cce127f10ef1 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml @@ -98,13 +98,10 @@ <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> - <!-- Flash cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Assert configurable product in category --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml index d210f90779d9..760b6a92d169 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml @@ -107,13 +107,10 @@ <!-- Display out of stock product --> <actionGroup ref="DisplayOutOfStockProductActionGroup" stepKey="displayOutOfStockProduct"/> - <!-- Flash cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Assert configurable product is not present in category --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml index 4984d296df5d..2589d56cbbe5 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml @@ -134,7 +134,7 @@ <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!-- Assert configurable product in category --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml index 4afc95f9a635..7a5744dc0048 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml @@ -123,13 +123,10 @@ <!-- Display out of stock product --> <actionGroup ref="DisplayOutOfStockProductActionGroup" stepKey="displayOutOfStockProduct"/> - <!-- Flash cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Assert configurable product in category --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml index ad634ed0144a..361d7b4500ab 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml @@ -119,13 +119,10 @@ <!-- Save configurable product --> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveConfigurableProduct"/> - <!-- Flash cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Assert configurable product in category --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml index 2fcf9a622a97..048183e7df24 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml @@ -108,13 +108,10 @@ </actionGroup> <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> - <!-- Flash cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Assert configurable product in category --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml index b562c8ab6fb1..07118a0cc2af 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml @@ -98,10 +98,7 @@ </actionGroup> <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> - <!-- Flash cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Assert configurable product on product page --> <amOnPage url="{{ApiConfigurableProduct.urlKey}}.html" stepKey="amOnProductPage"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithVideoAssociatedToVariantTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithVideoAssociatedToVariantTest.xml index 0eb730bf91af..f541751db7e3 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithVideoAssociatedToVariantTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithVideoAssociatedToVariantTest.xml @@ -114,7 +114,7 @@ <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="AssertProductInStorefrontProductPage"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml index 1a6d802987cd..7eef88f7317a 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml @@ -33,7 +33,7 @@ </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!-- Verify product on Product Page --> - <amOnPage url="{{StorefrontProductPage.url($$createConfigurableProduct.name$$)}}" stepKey="amOnConfigurableProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createConfigurableProduct.custom_attributes[url_key]$$)}}" stepKey="amOnConfigurableProductPage"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchBarByProductSku"> @@ -43,7 +43,7 @@ <dontSee userInput="$$createConfigurableProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/> <see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/> <!-- Go to the category page that we created in the before block --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <!-- Should not see the product --> <dontSee userInput="$$createConfigurableProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/> <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminConfigurableProductTypeSwitchingToVirtualProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminConfigurableProductTypeSwitchingToVirtualProductTest.xml index f287aca332b4..4243cffea72e 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminConfigurableProductTypeSwitchingToVirtualProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminConfigurableProductTypeSwitchingToVirtualProductTest.xml @@ -43,7 +43,7 @@ <seeElement selector="{{AdminProductGridSection.productRowByTypeAndName('Virtual Product',$createProduct.name$)}}" stepKey="seeVirtualProductInGrid"/> <!--Assert virtual product on storefront--> <comment userInput="Assert virtual product on storefront" stepKey="commentAssertVirtualProductOnStorefront"/> - <amOnPage url="{{StorefrontProductPage.url($createProduct.name$)}}" stepKey="openVirtualProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($createProduct.custom_attributes[url_key]$)}}" stepKey="openVirtualProductPage"/> <waitForPageLoad stepKey="waitForStorefrontVirtualProductPageLoad"/> <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertVirtualProductInStock"/> </test> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToConfigurableProductTest.xml index f3b79765f746..d59a3f603df9 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToConfigurableProductTest.xml @@ -70,7 +70,7 @@ <seeElement selector="{{AdminProductGridSection.productRowByTypeAndName('Simple Product',$createProduct.name$-option2)}}" stepKey="seeSimpleProduct2NameInGrid"/> <!--Assert configurable product on storefront--> <comment userInput="Assert configurable product on storefront" stepKey="commentAssertConfigProductOnStorefront"/> - <amOnPage url="{{StorefrontProductPage.url($createProduct.name$)}}" stepKey="openProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($createProduct.custom_attributes[url_key]$)}}" stepKey="openProductPage"/> <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> <click selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="clickAttributeDropDown"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToConfigurableProductTest.xml index bb5baf33d95f..89084a0c4d46 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToConfigurableProductTest.xml @@ -87,7 +87,7 @@ <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearConfigurableProductFilters"/> <!--Assert configurable product on storefront--> <comment userInput="Assert configurable product on storefront" stepKey="commentAssertConfigurableProductOnStorefront"/> - <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="openConfigurableProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="openConfigurableProductPage"/> <waitForPageLoad stepKey="waitForStorefrontConfigurableProductPageLoad"/> <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertConfigurableProductInStock"/> <click selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="clickConfigurableAttributeDropDown"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index 1b8dffbd3ac6..fc8a521ebc5c 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -79,9 +79,7 @@ <!-- Reindex invalidated indices after product attribute has been created/deleted --> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexAll"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <!-- Verify Configurable Product in checkout cart items --> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NewProductsListWidgetConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NewProductsListWidgetConfigurableProductTest.xml index 7f1034db062d..8d03812db920 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NewProductsListWidgetConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NewProductsListWidgetConfigurableProductTest.xml @@ -82,15 +82,23 @@ <argument name="productId" value="$$createConfigProduct.id$$"/> </actionGroup> <waitForPageLoad stepKey="waitForEditPage"/> - <fillField selector="{{AdminProductFormSection.setProductAsNewFrom}}" userInput="01/1/2000" stepKey="fillProductNewFrom"/> - <fillField selector="{{AdminProductFormSection.setProductAsNewTo}}" userInput="01/1/2099" stepKey="fillProductNewTo"/> + <actionGroup ref="AdminSetProductAsNewDateActionGroup" stepKey="fillProductNewFrom"> + <argument name="fromDate" value="01/1/2000"/> + <argument name="toDate" value="01/1/2099"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductNewTo"/> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveProduct"/> <!-- If PageCache is enabled, Cache clearing happens here, via merge --> <!-- Check for product on the CMS page with the New Products widget --> - <amOnPage url="{{_newDefaultCmsPage.identifier}}" stepKey="amOnCmsPage"/> - <waitForPageLoad stepKey="waitForCmsPage"/> - <see selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductName"/> + <actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="amOnCmsPage"> + <argument name="identifier" value="{{_newDefaultCmsPage.identifier}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCmsPage"/> + <actionGroup ref="AssertStorefrontProductIsShownOnCmsPageActionGroup" stepKey="seeProductName"> + <argument name="cmsTitle" value="{{_newDefaultCmsPage.title}}"/> + <argument name="productName" value="$$createConfigProduct.name$$"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml index 10d8aeb87574..328984e973d5 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml @@ -32,9 +32,16 @@ <actionGroup stepKey="deleteProduct1" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" - dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" - stepKey="clickClearFilters"/> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clickClearFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml index 4baceead08a0..1a2972437e35 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml @@ -21,7 +21,7 @@ <group value="ConfigurableProduct"/> <skip> <issueId value="DEPRECATED">Use AdminCheckProductQtyAfterOrderCancellingTest instead</issueId> - </skip> + </skip> </annotations> <before> @@ -47,7 +47,7 @@ <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="changeProductQuantity"/> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveChanges"/> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="navigateToProductPage"/> + <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPage"/> <fillField selector="{{StorefrontProductInfoMainSection.qty}}" userInput="4" stepKey="fillQuantity"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontAdvanceCatalogSearchConfigurableBySkuWithHyphenTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontAdvanceCatalogSearchConfigurableBySkuWithHyphenTest.xml index f26a8d611c56..b7ab7323904c 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontAdvanceCatalogSearchConfigurableBySkuWithHyphenTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontAdvanceCatalogSearchConfigurableBySkuWithHyphenTest.xml @@ -15,12 +15,9 @@ <title value="Guest customer should be able to advance search configurable product with product sku that contains hyphen"/> <description value="Guest customer should be able to advance search configurable product with product sku that contains hyphen"/> <severity value="MAJOR"/> - <testCaseId value="MC-20389"/> + <testCaseId value="MC-28817"/> <group value="ConfigurableProduct"/> <group value="SearchEngineElasticsearch"/> - <skip> - <issueId value="MC-34217"/> - </skip> </annotations> <before> <createData entity="SimpleSubCategory" stepKey="categoryHandle" before="simple1Handle"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml index ca3065c13ea6..a87b9bec99e8 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml @@ -145,9 +145,7 @@ </after> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexAll"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Quick search the storefront for the first attribute option --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductBasicInfoTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductBasicInfoTest.xml index 317563a468d7..99b4cf5d4c3a 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductBasicInfoTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductBasicInfoTest.xml @@ -33,22 +33,49 @@ <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> <!-- Verify configurable product details in storefront product view --> - <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="amOnConfigurableProductPage"/> - <waitForPageLoad stepKey="wait"/> - <see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeProductName"/> - <see userInput="{{_defaultProduct.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="seeProductSku"/> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="amOnConfigurableProductPage"> + <argument name="productUrl" value="{{_defaultProduct.urlKey}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait"/> + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeProductName"> + <argument name="productName" value="{{_defaultProduct.name}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSku"> + <argument name="productSku" value="{{_defaultProduct.sku}}"/> + </actionGroup> <see userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="seeProductPriceLabel"/> - <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="seeProductStockStatus"/> - <see userInput="1.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice"/> - <see userInput="{{colorProductAttribute.default_label}}" selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" stepKey="seeProductAttributeTitle"/> - <see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="{{colorProductAttribute.default_label}}" stepKey="seeColorAttributeName1"/> - <see userInput="{{colorProductAttribute1.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeInDropDown1"/> - <see userInput="{{colorProductAttribute2.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeInDropDown2"/> - <see userInput="{{colorProductAttribute3.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeInDropDown3"/> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="seeProductStockStatus"> + <argument name="productStockStatus" value="In Stock"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeProductPrice"> + <argument name="productPrice" value="1.00"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductAttributeLabelVisibleActionGroup" stepKey="seeProductAttributeTitle"> + <argument name="productAttributeLabel" value="{{colorProductAttribute.default_label}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeColorAttributeName1"/> + <actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown1"> + <argument name="productAttributeOption" value="{{colorProductAttribute1.name}}"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown2"> + <argument name="productAttributeOption" value="{{colorProductAttribute2.name}}"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown3"> + <argument name="productAttributeOption" value="{{colorProductAttribute3.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml index 9fc6dce10c21..f0acc3834f7a 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml @@ -33,6 +33,15 @@ <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml index 01859f995b00..13568701ecc6 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml @@ -33,6 +33,15 @@ <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductOptionsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductOptionsTest.xml index 1aef8c33785c..8bc3d21bb58f 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductOptionsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductOptionsTest.xml @@ -33,6 +33,15 @@ <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductAddToCartTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductAddToCartTest.xml index 238f1e107c11..440899eb6fd4 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductAddToCartTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductAddToCartTest.xml @@ -31,11 +31,35 @@ <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersConfigurable"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterConfigurable"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterFillSelectFieldActionGroup" stepKey="addTypeFilterConfigurable"> + <argument name="filterName" value="type_id"/> + <argument name="filterValue" value="Configurable Product"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterConfigurable"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteConfigurableProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> <!-- Should be taken to product details page when adding to cart because an option needs to be selected --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="amOnCategoryPage1"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="amOnCategoryPage1"/> <waitForPageLoad stepKey="wait1"/> <click selector="{{StorefrontCategoryMainSection.modeListButton}}" stepKey="clickListView"/> <waitForPageLoad stepKey="wait2"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductGridViewTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductGridViewTest.xml index 81a083c5da06..146b40784fb9 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductGridViewTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductGridViewTest.xml @@ -26,11 +26,8 @@ <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> - <!-- TODO: REMOVE AFTER FIX MC-21717 --> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value="eav"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> @@ -38,11 +35,21 @@ <actionGroup stepKey="deleteProduct" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> <!-- Verify the storefront category grid view --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="amOnCategoryPage1"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="amOnCategoryPage1"/> <waitForPageLoad stepKey="wait1"/> <seeElement selector="{{StorefrontCategoryMainSection.productImage}}" stepKey="seePhoto"/> <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{_defaultProduct.name}}" stepKey="seeName"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductListViewTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductListViewTest.xml index 619e50acba84..7e4045ca2967 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductListViewTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductListViewTest.xml @@ -31,11 +31,35 @@ <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersConfigurable"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterConfigurable"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterFillSelectFieldActionGroup" stepKey="addTypeFilterConfigurable"> + <argument name="filterName" value="type_id"/> + <argument name="filterValue" value="Configurable Product"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterConfigurable"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteConfigurableProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> <!-- Verify storefront category list view --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="amOnCategoryPage1"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="amOnCategoryPage1"/> <waitForPageLoad stepKey="wait1"/> <click selector="{{StorefrontCategoryMainSection.modeListButton}}" stepKey="clickListView"/> <waitForPageLoad stepKey="wait2"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductMSRPCovertTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductMSRPCovertTest.xml index 9526e8568b26..54d131ce7327 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductMSRPCovertTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductMSRPCovertTest.xml @@ -98,10 +98,7 @@ <actionGroup ref="AdminSetAdvancedPricingActionGroup" stepKey="setAdvancedPricingSecond"> <argument name="advancedPrice" value="100"/> </actionGroup> - - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToProduct"> <argument name="productUrlKey" value="$$createConfigProduct.custom_attributes[url_key]$$"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml index d9ad32df872f..742b67d2a691 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml @@ -25,6 +25,30 @@ <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersConfigurable"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterConfigurable"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{BaseConfigurableProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterFillSelectFieldActionGroup" stepKey="addTypeFilterConfigurable"> + <argument name="filterName" value="type_id"/> + <argument name="filterValue" value="Configurable Product"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterConfigurable"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteConfigurableProduct"> + <argument name="sku" value="{{BaseConfigurableProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{BaseConfigurableProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{BaseConfigurableProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml index 14ce1fe71281..c4f23dfebf5e 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml @@ -122,7 +122,7 @@ <fillField selector="{{AdminProductFormSection.productName}}" userInput="$$createConfigProduct.name$$-Updated" stepKey="fillProductName"/> <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectInStock"> <argument name="stockStatus" value="In Stock"/> - </actionGroup> + </actionGroup> <!--Change product image--> <comment userInput="Change product image" stepKey="commentChangeProductImage"/> <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> @@ -195,17 +195,15 @@ <waitForPageLoad stepKey="waitForDuplicatedProductPageLoad"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveDuplicatedProduct"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Assert configurable product in category--> <comment userInput="Assert configurable product in category" stepKey="commentAssertProductInCategoryPage"/> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onStorefrontCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onStorefrontCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createConfigProduct.name$$-Updated)}}" stepKey="assertProductNameInCategoryPage"/> <!--Assert product options in Storefront product page--> <comment userInput="Assert product options in Storefront product page" stepKey="commentAssertProductOptions"/> - <amOnPage url="{{StorefrontProductPage.url($$createConfigProduct.sku$$-1)}}" stepKey="amOnSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createConfigProduct.custom_attributes[url_key]$$-1)}}" stepKey="amOnSimpleProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoadOnStorefront"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$-Updated" stepKey="seeConfigurableProductName"/> <see userInput="{{productAttributeColor.default_label}}" selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" stepKey="seeColorAttributeName"/> diff --git a/app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Columns.php b/app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Columns.php index 2ca46b4e6728..f971dbe870ad 100644 --- a/app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Columns.php +++ b/app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Columns.php @@ -12,6 +12,11 @@ class Columns extends \Magento\Ui\Component\Listing\Columns */ protected $attributeRepository; + /** + * @var \Magento\Catalog\Ui\Component\ColumnFactory + */ + private $columnFactory; + /** * @param \Magento\Framework\View\Element\UiComponent\ContextInterface $context * @param \Magento\Catalog\Ui\Component\ColumnFactory $columnFactory diff --git a/app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Columns/Price.php b/app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Columns/Price.php index 1433a3736263..14cbcf4f755f 100644 --- a/app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Columns/Price.php +++ b/app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Columns/Price.php @@ -20,6 +20,11 @@ class Price extends \Magento\Ui\Component\Listing\Columns\Column */ protected $localeCurrency; + /** + * @var \Magento\Store\Model\StoreManagerInterface + */ + private $storeManager; + /** * @param ContextInterface $context * @param UiComponentFactory $uiComponentFactory diff --git a/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Attributes.php b/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Attributes.php index 04db96bc158d..0104dff342cc 100644 --- a/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Attributes.php +++ b/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Attributes.php @@ -13,6 +13,11 @@ class Attributes extends \Magento\Ui\DataProvider\AbstractDataProvider */ protected $collection; + /** + * @var \Magento\ConfigurableProduct\Model\ConfigurableAttributeHandler + */ + private $configurableAttributeHandler; + /** * @param string $name * @param string $primaryFieldName diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/bulk.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/bulk.phtml index 6cd930978c85..11ee28d28015 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/bulk.phtml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/bulk.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /* @var $block \Magento\ConfigurableProduct\Block\Adminhtml\Product\Steps\Bulk */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/super/matrix.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/super/matrix.phtml index 73067fdee3b8..dcff7a579a0a 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/super/matrix.phtml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/super/matrix.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Variations\Config\Matrix */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/attributes_values.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/attributes_values.js index 16dbf9ec23cd..816b8a08f24c 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/attributes_values.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/attributes_values.js @@ -106,7 +106,7 @@ define([ errorOption, allOptions = []; - newOption.label = $.trim(newOption.label); + newOption.label = newOption.label.trim(); if (_.isEmpty(newOption.label)) { return false; diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/file-uploader.html b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/file-uploader.html index e54f19878bb8..ddb7bf166e9c 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/file-uploader.html +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/template/components/file-uploader.html @@ -21,8 +21,8 @@ class="file-uploader-input" afterRender="onElementRender" attr="id: uid, name: fileInputName, multiple: isMultipleFiles"/> - <label class="file-uploader-button" attr="for: uid, title: $t('Upload Image')"><span translate="'Upload Image'"/></label> - <span class="file-uploader-spinner"/> + <label class="file-uploader-button" attr="for: uid, title: $t('Upload Image')"><span translate="'Upload Image'"></span></label> + <span class="file-uploader-spinner"></span> </div> </div> <!-- ko if: $data.processedFile().url || $data.thumbnail() --> @@ -30,7 +30,7 @@ css : {'_active': $data.actionsListOpened()}, outerClick: $data.closeList.bind($data)" > - <button type="button" class="action-select" data-bind="click: function(){ $data.toggleActionsList(); }"/> + <button type="button" class="action-select" data-bind="click: function(){ $data.toggleActionsList(); }"></button> <ul class="action-menu" data-bind="css: {'_active': $data.actionsListOpened()}"> <li> <a class="action-menu-item" data-bind=" diff --git a/app/code/Magento/ConfigurableProduct/view/base/templates/product/price/tier_price.phtml b/app/code/Magento/ConfigurableProduct/view/base/templates/product/price/tier_price.phtml index 7ce1fd2ccb45..fc4ad86f8bda 100644 --- a/app/code/Magento/ConfigurableProduct/view/base/templates/product/price/tier_price.phtml +++ b/app/code/Magento/ConfigurableProduct/view/base/templates/product/price/tier_price.phtml @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound ?> <script type="text/x-magento-template" id="tier-prices-template"> <ul class="prices-tier items"> diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js b/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js index 00030be74324..2795fd0e7ac0 100644 --- a/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js +++ b/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js @@ -46,7 +46,9 @@ define([ gallerySwitchStrategy: 'replace', tierPriceTemplateSelector: '#tier-prices-template', tierPriceBlockSelector: '[data-role="tier-price-block"]', - tierPriceTemplate: '' + tierPriceTemplate: '', + selectorProduct: '.product-info-main', + selectorProductPrice: '[data-role=priceBox]' }, /** @@ -578,7 +580,7 @@ define([ _.each(elements, function (element) { var selected = element.options[element.selectedIndex], config = selected && selected.config, - priceValue = {}; + priceValue = this._calculatePrice({}); if (config && config.allowedProducts.length === 1) { priceValue = this._calculatePrice(config); @@ -632,12 +634,10 @@ define([ */ _calculatePrice: function (config) { var displayPrices = $(this.options.priceHolderSelector).priceBox('option').prices, - newPrices = this.options.spConfig.optionPrices[_.first(config.allowedProducts)]; + newPrices = this.options.spConfig.optionPrices[_.first(config.allowedProducts)] || {}; _.each(displayPrices, function (price, code) { - if (newPrices[code]) { - displayPrices[code].amount = newPrices[code].amount - displayPrices[code].amount; - } + displayPrices[code].amount = newPrices[code] ? newPrices[code].amount - displayPrices[code].amount : 0; }); return displayPrices; @@ -676,7 +676,9 @@ define([ * @private */ _displayRegularPriceBlock: function (optionId) { - var shouldBeShown = true; + var shouldBeShown = true, + $priceBox = this.element.parents(this.options.selectorProduct) + .find(this.options.selectorProductPrice); _.each(this.options.settings, function (element) { if (element.value === '') { @@ -696,7 +698,8 @@ define([ $(document).trigger('updateMsrpPriceBlock', [ optionId, - this.options.spConfig.optionPrices + this.options.spConfig.optionPrices, + $priceBox ] ); }, diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/web/template/product/minimal_price.html b/app/code/Magento/ConfigurableProduct/view/frontend/web/template/product/minimal_price.html index 78312f965e5b..89d0033c9c53 100644 --- a/app/code/Magento/ConfigurableProduct/view/frontend/web/template/product/minimal_price.html +++ b/app/code/Magento/ConfigurableProduct/view/frontend/web/template/product/minimal_price.html @@ -9,13 +9,13 @@ <if args="useLinkForAsLowAs"> <a attr="href: $row().url" class="minimal-price-link" - html="getMinimalPrice($row())"/> + html="getMinimalPriceUnsanitizedHtml($row())"></a> </if> <ifnot args="useLinkForAsLowAs"> <span class="price-wrapper price-including-tax"> <span class="minimal-price-link" - html="getMinimalPrice($row())"/> + html="getMinimalPriceUnsanitizedHtml($row())"></span> </span> </ifnot> diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Cart/BuyRequest/SuperAttributeDataProvider.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Cart/BuyRequest/SuperAttributeDataProvider.php index 0fa4b8da5081..4877450b1714 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Cart/BuyRequest/SuperAttributeDataProvider.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Cart/BuyRequest/SuperAttributeDataProvider.php @@ -93,7 +93,7 @@ public function execute(array $cartItemData): array throw new GraphQlNoSuchEntityException(__('Could not find specified product.')); } - $this->checkProductStock($sku, (float) $qty, (int) $cart->getStoreId()); + $this->checkProductStock($sku, (float) $qty, (int) $cart->getStore()->getWebsiteId()); $configurableProductLinks = $parentProduct->getExtensionAttributes()->getConfigurableProductLinks(); if (!in_array($product->getId(), $configurableProductLinks)) { diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Formatter/Option.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Formatter/Option.php new file mode 100644 index 000000000000..68968b6f3819 --- /dev/null +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Formatter/Option.php @@ -0,0 +1,63 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\ConfigurableProductGraphQl\Model\Formatter; + +use Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute; +use Magento\Framework\GraphQl\Query\Uid; + +/** + * Formatter for configurable product options + */ +class Option +{ + /** + * @var Uid + */ + private $idEncoder; + + /** + * @var OptionValue + */ + private $valueFormatter; + + /** + * @param Uid $idEncoder + * @param OptionValue $valueFormatter + */ + public function __construct( + Uid $idEncoder, + OptionValue $valueFormatter + ) { + $this->idEncoder = $idEncoder; + $this->valueFormatter = $valueFormatter; + } + + /** + * Format configurable product options according to the GraphQL schema + * + * @param Attribute $attribute + * @param array $optionIds + * @return array|null + */ + public function format(Attribute $attribute, array $optionIds): ?array + { + $optionValues = []; + + foreach ($attribute->getOptions() as $option) { + $optionValues[] = $this->valueFormatter->format($option, $attribute, $optionIds); + } + + return [ + 'uid' => $this->idEncoder->encode($attribute->getProductSuperAttributeId()), + 'attribute_code' => $attribute->getProductAttribute()->getAttributeCode(), + 'label' => $attribute->getLabel(), + 'values' => $optionValues, + ]; + } +} diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Formatter/OptionValue.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Formatter/OptionValue.php new file mode 100644 index 000000000000..5d721f13fbb9 --- /dev/null +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Formatter/OptionValue.php @@ -0,0 +1,83 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\ConfigurableProductGraphQl\Model\Formatter; + +use Magento\CatalogInventory\Model\StockRegistry; +use Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute; +use Magento\ConfigurableProductGraphQl\Model\Options\SelectionUidFormatter; + +/** + * Formatter for configurable product option values + */ +class OptionValue +{ + /** + * @var SelectionUidFormatter + */ + private $selectionUidFormatter; + + /** + * @var StockRegistry + */ + private $stockRegistry; + + /** + * @param SelectionUidFormatter $selectionUidFormatter + * @param StockRegistry $stockRegistry + */ + public function __construct( + SelectionUidFormatter $selectionUidFormatter, + StockRegistry $stockRegistry + ) { + $this->selectionUidFormatter = $selectionUidFormatter; + $this->stockRegistry = $stockRegistry; + } + + /** + * Format configurable product option values according to the GraphQL schema + * + * @param array $optionValue + * @param Attribute $attribute + * @param array $optionIds + * @return array + */ + public function format(array $optionValue, Attribute $attribute, array $optionIds): array + { + $valueIndex = (int)$optionValue['value_index']; + $attributeId = (int)$attribute->getAttributeId(); + + return [ + 'uid' => $this->selectionUidFormatter->encode( + $attributeId, + $valueIndex + ), + 'is_available' => $this->getIsAvailable($optionIds[$valueIndex] ?? []), + 'is_use_default' => (bool)$attribute->getIsUseDefault(), + 'label' => $optionValue['label'], + 'value_index' => $optionValue['value_index'] + ]; + } + + /** + * Get is variants available + * + * @param array $variantIds + * @return bool + */ + private function getIsAvailable(array $variantIds): bool + { + foreach ($variantIds as $variantId) { + if ($this->stockRegistry->getProductStockStatus($variantId)) { + return true; + } + } + + return false; + } +} diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Formatter/Variant.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Formatter/Variant.php new file mode 100644 index 000000000000..1d73ad6a1933 --- /dev/null +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Formatter/Variant.php @@ -0,0 +1,49 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\ConfigurableProductGraphQl\Model\Formatter; + +use Magento\Framework\GraphQl\Exception\GraphQlInputException; + +/** + * Formatter for configurable product variant + */ +class Variant +{ + /** + * Format selected variant of configurable product based on selected options + * + * @param array $options + * @param array $selectedOptions + * @param array $variants + * @return array|null + * @throws GraphQlInputException + */ + public function format(array $options, array $selectedOptions, array $variants): ?array + { + $variant = null; + $productIds = array_keys($variants); + + foreach ($selectedOptions as $attributeId => $selectedValue) { + if (!isset($options[$attributeId][$selectedValue])) { + throw new GraphQlInputException(__('configurableOptionValueUids values are incorrect')); + } + + $productIds = array_intersect($productIds, $options[$attributeId][$selectedValue]); + } + + if (count($productIds) === 1) { + $variantProduct = $variants[array_pop($productIds)]; + $variant = $variantProduct->getData(); + $variant['url_path'] = $variantProduct->getProductUrl(); + $variant['model'] = $variantProduct; + } + + return $variant; + } +} diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Options/ConfigurableOptionsMetadata.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Options/ConfigurableOptionsMetadata.php new file mode 100644 index 000000000000..ce81e970bcd5 --- /dev/null +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Options/ConfigurableOptionsMetadata.php @@ -0,0 +1,86 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\ConfigurableProductGraphQl\Model\Options; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\ConfigurableProduct\Helper\Data; +use Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute; +use Magento\ConfigurableProductGraphQl\Model\Formatter\Option; + +/** + * Retrieve metadata for configurable option selection. + */ +class ConfigurableOptionsMetadata +{ + /** + * @var Data + */ + private $configurableProductHelper; + + /** + * @var Option + */ + private $configurableOptionsFormatter; + + /** + * @param Data $configurableProductHelper + * @param Option $configurableOptionsFormatter + */ + public function __construct( + Data $configurableProductHelper, + Option $configurableOptionsFormatter + ) { + $this->configurableProductHelper = $configurableProductHelper; + $this->configurableOptionsFormatter = $configurableOptionsFormatter; + } + + /** + * Load available selections from configurable options and variant. + * + * @param ProductInterface $product + * @param array $options + * @param array $selectedOptions + * @return array + */ + public function getAvailableSelections(ProductInterface $product, array $options, array $selectedOptions): array + { + $attributes = $this->getAttributes($product); + $availableSelections = []; + + foreach ($options as $attributeId => $option) { + if ($attributeId === 'index' || isset($selectedOptions[$attributeId])) { + continue; + } + + $availableSelections[] = $this->configurableOptionsFormatter->format( + $attributes[$attributeId], + $options[$attributeId] ?? [] + ); + } + + return $availableSelections; + } + + /** + * Retrieve configurable attributes for the product + * + * @param ProductInterface $product + * @return Attribute[] + */ + private function getAttributes(ProductInterface $product): array + { + $allowedAttributes = $this->configurableProductHelper->getAllowAttributes($product); + $attributes = []; + foreach ($allowedAttributes as $attribute) { + $attributes[$attribute->getAttributeId()] = $attribute; + } + + return $attributes; + } +} diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Options/DataProvider/Variant.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Options/DataProvider/Variant.php index 80fbdc76bacb..7b5a3fb806a5 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Options/DataProvider/Variant.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Options/DataProvider/Variant.php @@ -10,6 +10,7 @@ use Magento\Catalog\Api\Data\ProductInterface; use Magento\CatalogInventory\Model\ResourceModel\Stock\StatusFactory; use Magento\ConfigurableProduct\Model\Product\Type\Configurable; +use Magento\Framework\Exception\LocalizedException; /** * Retrieve child products @@ -45,7 +46,7 @@ public function __construct( * @return ProductInterface[] * @throws \Magento\Framework\Exception\LocalizedException */ - public function getSalableVariantsByParent(ProductInterface $product) + public function getSalableVariantsByParent(ProductInterface $product): array { $collection = $this->configurableType->getUsedProductCollection($product); $collection @@ -62,6 +63,6 @@ public function getSalableVariantsByParent(ProductInterface $product) } $collection->clear(); - return $collection->getItems(); + return $collection->getItems() ?? []; } } diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Options/SelectionUidFormatter.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Options/SelectionUidFormatter.php index 1d13ad75489a..8c82c9414763 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Options/SelectionUidFormatter.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Options/SelectionUidFormatter.php @@ -3,8 +3,12 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\ConfigurableProductGraphQl\Model\Options; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\GraphQl\Query\Uid; + /** * Handle option selection uid. */ @@ -20,6 +24,19 @@ class SelectionUidFormatter */ private const UID_SEPARATOR = '/'; + /** + * @var Uid + */ + private $idEncoder; + + /** + * @param Uid $idEncoder + */ + public function __construct(Uid $idEncoder) + { + $this->idEncoder = $idEncoder; + } + /** * Create uid and encode. * @@ -29,28 +46,22 @@ class SelectionUidFormatter */ public function encode(int $attributeId, int $indexId): string { - // phpcs:ignore Magento2.Functions.DiscouragedFunction - return base64_encode(implode(self::UID_SEPARATOR, [ - self::UID_PREFIX, - $attributeId, - $indexId - ])); + return $this->idEncoder->encode(implode(self::UID_SEPARATOR, [self::UID_PREFIX, $attributeId, $indexId])); } /** * Retrieve attribute and option index from uid. Array key is the id of attribute and value is the index of option * - * @param string $selectionUids + * @param array $selectionUids * @return array - * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @throws GraphQlInputException */ public function extract(array $selectionUids): array { $attributeOption = []; foreach ($selectionUids as $uid) { - // phpcs:ignore Magento2.Functions.DiscouragedFunction - $optionData = explode(self::UID_SEPARATOR, base64_decode($uid)); - if (count($optionData) == 3) { + $optionData = explode(self::UID_SEPARATOR, $this->idEncoder->decode($uid)); + if (count($optionData) === 3) { $attributeOption[(int)$optionData[1]] = (int)$optionData[2]; } } diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/OptionsSelectionMetadata.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/OptionsSelectionMetadata.php index f7d5a96ad2ab..556aab7e39f7 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/OptionsSelectionMetadata.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/OptionsSelectionMetadata.php @@ -3,17 +3,23 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\ConfigurableProductGraphQl\Model\Resolver; -use Magento\Catalog\Api\Data\ProductInterface; +use Magento\ConfigurableProduct\Helper\Data; +use Magento\ConfigurableProductGraphQl\Model\Formatter\Variant as VariantFormatter; +use Magento\ConfigurableProductGraphQl\Model\Options\ConfigurableOptionsMetadata; +use Magento\ConfigurableProductGraphQl\Model\Options\DataProvider\Variant; use Magento\ConfigurableProductGraphQl\Model\Options\Metadata; +use Magento\ConfigurableProductGraphQl\Model\Options\SelectionUidFormatter; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; /** - * Resolver class for option selection metadata. + * Resolver for options selection */ class OptionsSelectionMetadata implements ResolverInterface { @@ -22,13 +28,53 @@ class OptionsSelectionMetadata implements ResolverInterface */ private $configurableSelectionMetadata; + /** + * @var ConfigurableOptionsMetadata + */ + private $configurableOptionsMetadata; + + /** + * @var SelectionUidFormatter + */ + private $selectionUidFormatter; + + /** + * @var Variant + */ + private $variant; + + /** + * @var VariantFormatter + */ + private $variantFormatter; + + /** + * @var Data + */ + private $configurableProductHelper; + /** * @param Metadata $configurableSelectionMetadata + * @param ConfigurableOptionsMetadata $configurableOptionsMetadata + * @param SelectionUidFormatter $selectionUidFormatter + * @param Variant $variant + * @param VariantFormatter $variantFormatter + * @param Data $configurableProductHelper */ public function __construct( - Metadata $configurableSelectionMetadata + Metadata $configurableSelectionMetadata, + ConfigurableOptionsMetadata $configurableOptionsMetadata, + SelectionUidFormatter $selectionUidFormatter, + Variant $variant, + VariantFormatter $variantFormatter, + Data $configurableProductHelper ) { $this->configurableSelectionMetadata = $configurableSelectionMetadata; + $this->configurableOptionsMetadata = $configurableOptionsMetadata; + $this->selectionUidFormatter = $selectionUidFormatter; + $this->variant = $variant; + $this->variantFormatter = $variantFormatter; + $this->configurableProductHelper = $configurableProductHelper; } /** @@ -40,10 +86,31 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value throw new LocalizedException(__('"model" value should be specified')); } - $selectedOptions = $args['selectedConfigurableOptionValues'] ?? []; - /** @var ProductInterface $product */ $product = $value['model']; - return $this->configurableSelectionMetadata->getAvailableSelections($product, $selectedOptions); + $selectionUids = $args['configurableOptionValueUids'] ?? []; + $selectedOptions = $this->selectionUidFormatter->extract($selectionUids); + + $variants = $this->variant->getSalableVariantsByParent($product); + $options = $this->configurableProductHelper->getOptions($product, $variants); + + $configurableOptions = $this->configurableOptionsMetadata->getAvailableSelections( + $product, + $options, + $selectedOptions + ); + + $optionsAvailableForSelection = $this->configurableSelectionMetadata->getAvailableSelections( + $product, + $args['configurableOptionValueUids'] ?? [] + ); + + return [ + 'configurable_options' => $configurableOptions, + 'variant' => $this->variantFormatter->format($options, $selectedOptions, $variants), + 'model' => $product, + 'options_available_for_selection' => $optionsAvailableForSelection['options_available_for_selection'], + 'availableSelectionProducts' => $optionsAvailableForSelection['availableSelectionProducts'] + ]; } } diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ProductResolver.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ProductResolver.php new file mode 100644 index 000000000000..38662c86964d --- /dev/null +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ProductResolver.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ConfigurableProductGraphQl\Model\Resolver; + +use Magento\Catalog\Model\Product\Configuration\Item\ItemResolverInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; + +/** + * Fetches the Product data according to the GraphQL schema + */ +class ProductResolver implements ResolverInterface +{ + /** + * @var ItemResolverInterface + */ + private $configurableItemResolver; + + /** + * @param ItemResolverInterface $configurableItemResolver + */ + public function __construct(ItemResolverInterface $configurableItemResolver) + { + $this->configurableItemResolver = $configurableItemResolver; + } + + /** + * @inheritdoc + */ + public function resolve( + Field $field, + $context, + ResolveInfo $info, + array $value = null, + array $args = null + ) { + if (!isset($value['model'])) { + throw new LocalizedException(__('"model" value should be specified')); + } + + $product = $this->configurableItemResolver->getFinalProduct($value['model']); + $productData = $product->toArray(); + $productData['model'] = $product; + return $productData; + } +} diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/SelectionMediaGallery.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/SelectionMediaGallery.php index 7b3ddc4ac141..972e4a9fd629 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/SelectionMediaGallery.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/SelectionMediaGallery.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\ConfigurableProductGraphQl\Model\Resolver; use Magento\Framework\GraphQl\Config\Element\Field; @@ -19,19 +21,21 @@ class SelectionMediaGallery implements ResolverInterface */ public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null) { - if (!isset($value['product']) || !$value['product']) { + if (!isset($value['model']) || !$value['model']) { return null; } - $product = $value['product']; + $product = $value['model']; $availableSelectionProducts = $value['availableSelectionProducts']; $mediaGalleryEntries = []; $usedProducts = $product->getTypeInstance()->getUsedProducts($product, null); foreach ($usedProducts as $usedProduct) { if (in_array($usedProduct->getId(), $availableSelectionProducts)) { foreach ($usedProduct->getMediaGalleryEntries() ?? [] as $key => $entry) { - $index = $usedProduct->getId() . '_' . $key; - $mediaGalleryEntries[$index] = $entry->getData(); + $entryData = $entry->getData(); + $initialIndex = $usedProduct->getId() . '_' . $key; + $index = $this->prepareIndex($entryData, $initialIndex); + $mediaGalleryEntries[$index] = $entryData; $mediaGalleryEntries[$index]['model'] = $usedProduct; if ($entry->getExtensionAttributes() && $entry->getExtensionAttributes()->getVideoContent()) { $mediaGalleryEntries[$index]['video_content'] @@ -42,4 +46,26 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value } return $mediaGalleryEntries; } + + /** + * Formulate an index to have unique set of media entries + * + * @param array $entryData + * @param string $initialIndex + * @return string + */ + private function prepareIndex(array $entryData, string $initialIndex) : string + { + $index = $initialIndex; + if (isset($entryData['media_type'])) { + $index = $entryData['media_type']; + } + if (isset($entryData['file'])) { + $index = $index.'_'.$entryData['file']; + } + if (isset($entryData['position'])) { + $index = $index.'_'.$entryData['position']; + } + return $index; + } } diff --git a/app/code/Magento/ConfigurableProductGraphQl/Plugin/Product/Configuration/Item/ItemResolver.php b/app/code/Magento/ConfigurableProductGraphQl/Plugin/Product/Configuration/Item/ItemResolver.php new file mode 100644 index 000000000000..96e92c8039ea --- /dev/null +++ b/app/code/Magento/ConfigurableProductGraphQl/Plugin/Product/Configuration/Item/ItemResolver.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ConfigurableProductGraphQl\Plugin\Product\Configuration\Item; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Model\Product\Configuration\Item\ItemInterface; +use Magento\ConfigurableProduct\Model\Product\Configuration\Item\ItemProductResolver; +use Magento\ConfigurableProduct\Model\Product\Type\Configurable; + +/** + * Plugin for item resolver + */ +class ItemResolver +{ + /** + * After plugin for final product + * + * @param ItemProductResolver $subject + * @param $result + * @param ItemInterface $item + * @return ProductInterface + */ + public function afterGetFinalProduct(ItemProductResolver $subject, $result, ItemInterface $item): ProductInterface + { + if ($result->getTypeId() === Configurable::TYPE_CODE) { + $option = $item->getOptionByCode('simple_product'); + $result = $option ? $option->getProduct() : $item->getProduct(); + } + + return $result; + } +} diff --git a/app/code/Magento/ConfigurableProductGraphQl/Test/Unit/Model/Cart/BuyRequest/SuperAttributeDataProviderTest.php b/app/code/Magento/ConfigurableProductGraphQl/Test/Unit/Model/Cart/BuyRequest/SuperAttributeDataProviderTest.php new file mode 100644 index 000000000000..b1f36f038dbc --- /dev/null +++ b/app/code/Magento/ConfigurableProductGraphQl/Test/Unit/Model/Cart/BuyRequest/SuperAttributeDataProviderTest.php @@ -0,0 +1,163 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ConfigurableProductGraphQl\Test\Unit\Model\Cart\BuyRequest; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\CatalogInventory\Api\StockStateInterface; +use Magento\ConfigurableProductGraphQl\Model\Cart\BuyRequest\SuperAttributeDataProvider; +use Magento\ConfigurableProductGraphQl\Model\Options\Collection as OptionCollection; +use Magento\Framework\EntityManager\MetadataPool; +use Magento\Framework\Stdlib\ArrayManager; +use Magento\Quote\Model\Quote; +use Magento\Store\Api\Data\StoreInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test for SuperAttributeDataProvider + */ +class SuperAttributeDataProviderTest extends TestCase +{ + /** + * @var ArrayManager|MockObject + */ + private $arrayManager; + + /** + * @var ProductRepositoryInterface|MockObject + */ + private $productRepository; + + /** + * @var OptionCollection|MockObject + */ + private $optionCollection; + + /** + * @var MetadataPool|MockObject + */ + private $metadataPool; + + /** + * @var StockStateInterface|MockObject + */ + private $stockState; + + /** + * @var SuperAttributeDataProvider|MockObject + */ + private $superAttributeDataProvider; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $this->arrayManager = $this->getMockBuilder(ArrayManager::class) + ->disableOriginalConstructor() + ->getMock(); + $this->productRepository = $this->getMockBuilder(ProductRepositoryInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->optionCollection = $this->createMock(OptionCollection::class); + $this->metadataPool = $this->getMockBuilder(MetadataPool::class) + ->disableOriginalConstructor() + ->onlyMethods(['getMetadata']) + ->addMethods(['getLinkField']) + ->getMock(); + $this->stockState = $this->getMockBuilder(StockStateInterface::class) + ->disableOriginalConstructor() + ->addMethods(['getHasError']) + ->getMockForAbstractClass(); + + $this->superAttributeDataProvider = new SuperAttributeDataProvider( + $this->arrayManager, + $this->productRepository, + $this->optionCollection, + $this->metadataPool, + $this->stockState + ); + } + + /** + * Check that website id is correctly retrieved + */ + public function testExecute(): void + { + $quoteMock = $this->getMockBuilder(Quote::class) + ->disableOriginalConstructor() + ->getMock(); + $cartItemData = [ + 'data' => [ + 'quantity' => 2.0, + 'sku' => 'simple1', + ], + 'parent_sku' => 'configurable', + 'model' => $quoteMock, + ]; + + $this->arrayManager->method('get') + ->withConsecutive( + ['parent_sku', $cartItemData], + ['data/sku', $cartItemData], + ['data/quantity', $cartItemData], + ['model', $cartItemData], + ) + ->willReturnOnConsecutiveCalls( + 'configurable', + 'simple1', + 2.0, + $quoteMock, + ); + + $storeMock = $this->getMockBuilder(StoreInterface::class) + ->disableOriginalConstructor() + ->addMethods(['getWebsite']) + ->getMockForAbstractClass(); + $storeMock->expects($this->once())->method('getWebsiteId')->willReturn(1); + $storeMock->expects($this->never())->method('getWebsite'); + $quoteMock->expects($this->atLeastOnce()) + ->method('getStore') + ->willReturn($storeMock); + + $productMock = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->onlyMethods(['getId', 'getExtensionAttributes', 'getData']) + ->addMethods(['getConfigurableProductLinks']) + ->getMock(); + $productMock->method('getId') + ->willReturn(1); + $productMock->method('getExtensionAttributes') + ->willReturnSelf(); + $productMock->method('getConfigurableProductLinks') + ->willReturn([1]); + $productMock->method('getData') + ->willReturn(1); + $this->productRepository->method('get') + ->willReturn($productMock); + $this->stockState->method('checkQuoteItemQty') + ->willReturnSelf(); + $this->stockState->method('getHasError') + ->willReturn(false); + $this->metadataPool->method('getMetadata') + ->willReturnSelf(); + $this->metadataPool->method('getLinkField') + ->willReturnSelf(); + $this->optionCollection->method('getAttributesByProductId') + ->willReturn([ + [ + 'attribute_code' => 'code', + 'attribute_id' => 1, + 'values' => [['value_index' => 1]], + ] + ]); + + $this->assertEquals(['super_attribute' => [1 => 1]], $this->superAttributeDataProvider->execute($cartItemData)); + } +} diff --git a/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml b/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml index 227817b3887b..06206e35712a 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml @@ -59,4 +59,15 @@ </argument> </arguments> </type> + + <type name="Magento\UrlRewriteGraphQl\Model\RoutableInterfaceTypeResolver"> + <arguments> + <argument name="productTypeNameResolvers" xsi:type="array"> + <item name="configurable_product_type_resolver" xsi:type="object">Magento\ConfigurableProductGraphQl\Model\ConfigurableProductTypeResolver</item> + </argument> + </arguments> + </type> + <type name="Magento\ConfigurableProduct\Model\Product\Configuration\Item\ItemProductResolver"> + <plugin name="configured_variant" type="Magento\ConfigurableProductGraphQl\Plugin\Product\Configuration\Item\ItemResolver"/> + </type> </config> diff --git a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls index fc177557906e..03fae0d34525 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls +++ b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls @@ -4,10 +4,10 @@ type Mutation { addConfigurableProductsToCart(input: AddConfigurableProductsToCartInput): AddConfigurableProductsToCartOutput @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\AddConfigurableProductsToCart") } -type ConfigurableProduct implements ProductInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "ConfigurableProduct defines basic features of a configurable product and its simple product variants") { +type ConfigurableProduct implements ProductInterface, RoutableInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "ConfigurableProduct defines basic features of a configurable product and its simple product variants") { variants: [ConfigurableVariant] @doc(description: "An array of variants of products") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\ConfigurableVariant") configurable_options: [ConfigurableProductOptions] @doc(description: "An array of linked simple product items") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Options") - configurable_options_selection_metadata(selectedConfigurableOptionValues: [ID!]): ConfigurableOptionsSelectionMetadata @doc(description: "Metadata for the specified configurable options selection") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\OptionsSelectionMetadata") + configurable_product_options_selection(configurableOptionValueUids: [ID!]): ConfigurableProductOptionsSelection @doc(description: "Specified configurable product options selection") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\OptionsSelectionMetadata") } type ConfigurableVariant @doc(description: "An array containing all the simple product variants of a configurable product") { @@ -64,6 +64,7 @@ input ConfigurableProductCartItemInput { type ConfigurableCartItem implements CartItemInterface { customizable_options: [SelectedCustomizableOption] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") configurable_options: [SelectedConfigurableOption!]! @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\ConfigurableCartItemOptions") + configured_variant: ProductInterface! @doc(description: "Product details of the cart item") @resolver(class: "\\Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\ProductResolver") } type SelectedConfigurableOption { @@ -80,8 +81,9 @@ type ConfigurableWishlistItem implements WishlistItemInterface @doc(description: configurable_options: [SelectedConfigurableOption!] @resolver(class: "\\Magento\\ConfigurableProductGraphQl\\Model\\Wishlist\\ConfigurableOptions") @doc (description: "An array of selected configurable options") } -type ConfigurableOptionsSelectionMetadata @doc(description: "Metadata corresponding to the configurable options selection.") { +type ConfigurableProductOptionsSelection @doc(description: "Metadata corresponding to the configurable options selection.") { options_available_for_selection: [ConfigurableOptionAvailableForSelection!] @doc(description: "Configurable options available for further selection based on current selection.") + configurable_options: [ConfigurableProductOption!] @doc(description: "Configurable options available for further selection based on current selection.") media_gallery: [MediaGalleryInterface!] @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\SelectionMediaGallery") @doc(description: "Product images and videos corresponding to the specified configurable options selection.") variant: SimpleProduct @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Variant\\Variant") @doc(description: "Variant represented by the specified configurable options selection. It is expected to be null, until selections are made for each configurable option.") } @@ -91,6 +93,20 @@ type ConfigurableOptionAvailableForSelection @doc(description: "Configurable opt attribute_code: String! @doc(description: "Attribute code that uniquely identifies configurable option.") } +type ConfigurableProductOption { + uid: ID! + attribute_code: String! + label: String! + values: [ConfigurableProductOptionValue!] +} + +type ConfigurableProductOptionValue { + uid: ID! + is_available: Boolean! + is_use_default: Boolean! + label: String! +} + type StoreConfig @doc(description: "The type contains information about a store config") { configurable_thumbnail_source : String @doc(description: "The configuration setting determines which thumbnail should be used in the cart for configurable products.") } diff --git a/app/code/Magento/ConfigurableProductSales/Test/Unit/ViewModel/ItemRendererTypeResolverTest.php b/app/code/Magento/ConfigurableProductSales/Test/Unit/ViewModel/ItemRendererTypeResolverTest.php new file mode 100644 index 000000000000..f4d0ea78e284 --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/Test/Unit/ViewModel/ItemRendererTypeResolverTest.php @@ -0,0 +1,81 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ConfigurableProductSales\Test\Unit\ViewModel; + +use Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver; +use Magento\Framework\DataObject; +use Magento\Sales\Model\Order\Item; +use PHPUnit\Framework\TestCase; + +/** + * Test configurable order item renderer type resolver + */ +class ItemRendererTypeResolverTest extends TestCase +{ + /** + * @var ItemRendererTypeResolver + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->model = new ItemRendererTypeResolver(); + } + + /** + * @param string|null $realProductType + * @param string $expectedProductType + * @dataProvider resolveConfigurableOrderItemDataProvider + */ + public function testResolveConfigurableOrderItem(?string $realProductType, string $expectedProductType): void + { + $orderItem = $this->getOrderItemMock(); + $orderItem->setProductType('configurable'); + $childOrderItem = $this->getOrderItemMock(); + $childOrderItem->setProductOptions(['real_product_type' => $realProductType]); + $orderItem->addChildItem($childOrderItem); + $this->assertEquals($expectedProductType, $this->model->resolve($orderItem)); + $this->assertEquals($expectedProductType, $this->model->resolve(new DataObject(['order_item' => $orderItem]))); + } + + /** + * @return array + */ + public function resolveConfigurableOrderItemDataProvider(): array + { + return [ + ['simple', 'simple'], + [null, 'configurable'], + ]; + } + + /** + * @return void + */ + public function testResolveSimpleOrderItem(): void + { + $orderItem = $this->getOrderItemMock(); + $orderItem->setProductType('virtual'); + $this->assertEquals('virtual', $this->model->resolve($orderItem)); + $this->assertEquals('virtual', $this->model->resolve(new DataObject(['order_item' => $orderItem]))); + } + + /** + * @return Item + */ + private function getOrderItemMock(): Item + { + return $this->getMockBuilder(Item::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + } +} diff --git a/app/code/Magento/ConfigurableProductSales/ViewModel/ItemRendererTypeResolver.php b/app/code/Magento/ConfigurableProductSales/ViewModel/ItemRendererTypeResolver.php new file mode 100644 index 000000000000..12e35f637604 --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/ViewModel/ItemRendererTypeResolver.php @@ -0,0 +1,51 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ConfigurableProductSales\ViewModel; + +use Magento\ConfigurableProduct\Model\Product\Type\Configurable as ProductType; +use Magento\Framework\DataObject; +use Magento\Framework\View\Element\Block\ArgumentInterface; +use Magento\Sales\Model\Order\Item; +use Magento\Sales\ViewModel\ItemRendererTypeResolverInterface; + +/** + * Configurable order item renderer type resolver + */ +class ItemRendererTypeResolver implements ItemRendererTypeResolverInterface, ArgumentInterface +{ + /** + * @inheritdoc + */ + public function resolve(DataObject $item): ?string + { + $orderItem = $item->getOrderItem() ? $item->getOrderItem() : $item; + if ($orderItem->getProductType() === ProductType::TYPE_CODE) { + $childItem = $this->getChildOrderItem($orderItem); + if ($childItem->getRealProductType() && $childItem->getRealProductType() !== ProductType::TYPE_CODE) { + return $childItem->getRealProductType(); + } + } + return $orderItem->getProductType(); + } + + /** + * Get child product order item + * + * @param Item $orderItem + * @return Item + */ + private function getChildOrderItem(Item $orderItem): Item + { + $childrenItems = $orderItem->getChildrenItems() ?: []; + if (count($childrenItems) === 1) { + $orderItem = reset($childrenItems); + } + + return $orderItem; + } +} diff --git a/app/code/Magento/ConfigurableProductSales/composer.json b/app/code/Magento/ConfigurableProductSales/composer.json index edac2b7782dc..e72db7424a6c 100644 --- a/app/code/Magento/ConfigurableProductSales/composer.json +++ b/app/code/Magento/ConfigurableProductSales/composer.json @@ -9,9 +9,7 @@ "magento/framework": "*", "magento/module-catalog": "*", "magento/module-sales": "*", - "magento/module-store": "*" - }, - "suggest": { + "magento/module-store": "*", "magento/module-configurable-product": "*" }, "type": "magento2-module", diff --git a/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_email_order_creditmemo_items.xml b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_email_order_creditmemo_items.xml new file mode 100644 index 000000000000..5aac30f1ede9 --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_email_order_creditmemo_items.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <body> + <referenceBlock name="items"> + <arguments> + <argument name="configurable_renderer_type_resolver" xsi:type="object"> + Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver + </argument> + </arguments> + </referenceBlock> + </body> +</page> diff --git a/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_email_order_invoice_items.xml b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_email_order_invoice_items.xml new file mode 100644 index 000000000000..5aac30f1ede9 --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_email_order_invoice_items.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <body> + <referenceBlock name="items"> + <arguments> + <argument name="configurable_renderer_type_resolver" xsi:type="object"> + Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver + </argument> + </arguments> + </referenceBlock> + </body> +</page> diff --git a/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_email_order_items.xml b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_email_order_items.xml new file mode 100644 index 000000000000..5aac30f1ede9 --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_email_order_items.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <body> + <referenceBlock name="items"> + <arguments> + <argument name="configurable_renderer_type_resolver" xsi:type="object"> + Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver + </argument> + </arguments> + </referenceBlock> + </body> +</page> diff --git a/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_creditmemo.xml b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_creditmemo.xml new file mode 100644 index 000000000000..1437e8c69e80 --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_creditmemo.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <body> + <referenceBlock name="creditmemo_items"> + <arguments> + <argument name="configurable_renderer_type_resolver" xsi:type="object"> + Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver + </argument> + </arguments> + </referenceBlock> + </body> +</page> diff --git a/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_invoice.xml b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_invoice.xml new file mode 100644 index 000000000000..52623bdc0c99 --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_invoice.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <body> + <referenceBlock name="invoice_items"> + <arguments> + <argument name="configurable_renderer_type_resolver" xsi:type="object"> + Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver + </argument> + </arguments> + </referenceBlock> + </body> +</page> diff --git a/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_print.xml b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_print.xml new file mode 100644 index 000000000000..8bd2260decdc --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_print.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <body> + <referenceBlock name="order_items"> + <arguments> + <argument name="configurable_renderer_type_resolver" xsi:type="object"> + Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver + </argument> + </arguments> + </referenceBlock> + </body> +</page> diff --git a/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_printcreditmemo.xml b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_printcreditmemo.xml new file mode 100644 index 000000000000..4d7f4f882310 --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_printcreditmemo.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <body> + <referenceBlock name="sales.order.print.creditmemo"> + <arguments> + <argument name="configurable_renderer_type_resolver" xsi:type="object"> + Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver + </argument> + </arguments> + </referenceBlock> + </body> +</page> diff --git a/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_printinvoice.xml b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_printinvoice.xml new file mode 100644 index 000000000000..194c37787575 --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_printinvoice.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <body> + <referenceBlock name="sales.order.print.invoice"> + <arguments> + <argument name="configurable_renderer_type_resolver" xsi:type="object"> + Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver + </argument> + </arguments> + </referenceBlock> + </body> +</page> diff --git a/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_view.xml b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_view.xml new file mode 100644 index 000000000000..8bd2260decdc --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_view.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <body> + <referenceBlock name="order_items"> + <arguments> + <argument name="configurable_renderer_type_resolver" xsi:type="object"> + Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver + </argument> + </arguments> + </referenceBlock> + </body> +</page> diff --git a/app/code/Magento/Contact/Test/Mftf/ActionGroup/StorefrontAssertEmailAddressTrimmedActionGroup.xml b/app/code/Magento/Contact/Test/Mftf/ActionGroup/StorefrontAssertEmailAddressTrimmedActionGroup.xml new file mode 100644 index 000000000000..558a4b26dd5f --- /dev/null +++ b/app/code/Magento/Contact/Test/Mftf/ActionGroup/StorefrontAssertEmailAddressTrimmedActionGroup.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontAssertEmailAddressTrimmedActionGroup"> + <annotations> + <description>Validate that the provided email address is trimmed from spaces in the given input.</description> + </annotations> + <arguments> + <argument name="inputSelector" type="string" defaultValue="input[name='email']"/> + <argument name="emailAddressWithSpaces" type="string" defaultValue="John.Doe@example.com "/> + </arguments> + + <executeJS function="return '{{emailAddressWithSpaces}}'.trim();" stepKey="trimEmail"/> + + <grabValueFrom selector="{{inputSelector}}" stepKey="grabEmailFromInput"/> + + <assertEquals stepKey="assertEmailsAreEqual"> + <expectedResult type="string">$trimEmail</expectedResult> + <actualResult type="string">$grabEmailFromInput</actualResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Contact/Test/Mftf/Test/StorefrontVerifyContactUsNbspTrimFromEmailInputTest.xml b/app/code/Magento/Contact/Test/Mftf/Test/StorefrontVerifyContactUsNbspTrimFromEmailInputTest.xml new file mode 100644 index 000000000000..f8b9adf8da2d --- /dev/null +++ b/app/code/Magento/Contact/Test/Mftf/Test/StorefrontVerifyContactUsNbspTrimFromEmailInputTest.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontVerifyContactUsNbspTrimFromEmailInputTest"> + <annotations> + <features value="Contact"/> + <title value="Test for contact form to trim non-breaking spaces at the end of the email address"/> + <description value="Non-break spaces should be trimmed from the contact form email address input field"/> + <stories value="Submit Contact Us Form"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-42234"/> + <useCaseId value="MC-41850"/> + <group value="contact"/> + </annotations> + + <actionGroup ref="StorefrontOpenContactUsPageActionGroup" stepKey="goToContactUsPage"/> + + <actionGroup ref="StorefrontFillContactUsFormActionGroup" stepKey="fillUpTheFormWithCustomerDataWithNbsp"> + <argument name="customer" value="Simple_US_Customer_Nbsp_In_Email" /> + <argument name="contactUsData" value="DefaultContactUsData" /> + </actionGroup> + + <actionGroup ref="StorefrontAssertEmailAddressTrimmedActionGroup" stepKey="assertEmailWasTrimmedInTheInput"> + <argument name="emailAddressWithSpaces" value="{{Simple_US_Customer_Nbsp_In_Email.email}}" /> + <argument name="inputSelector" value="{{StorefrontContactUsFormSection.emailField}}" /> + </actionGroup> + + <actionGroup ref="StorefrontSubmitContactUsFormActionGroup" stepKey="submitContactUsForm"/> + <actionGroup ref="AssertMessageContactUsFormActionGroup" stepKey="assertContactUsFormSuccessfullySubmitted"/> + </test> +</tests> diff --git a/app/code/Magento/Contact/Test/Mftf/Test/StorefrontVerifySecureURLRedirectContactTest.xml b/app/code/Magento/Contact/Test/Mftf/Test/StorefrontVerifySecureURLRedirectContactTest.xml index 2300740f23c7..2e085351f2d4 100644 --- a/app/code/Magento/Contact/Test/Mftf/Test/StorefrontVerifySecureURLRedirectContactTest.xml +++ b/app/code/Magento/Contact/Test/Mftf/Test/StorefrontVerifySecureURLRedirectContactTest.xml @@ -25,15 +25,11 @@ <executeJS function="return window.location.host" stepKey="hostname"/> <magentoCLI command="config:set web/secure/base_url https://{$hostname}/" stepKey="setSecureBaseURL"/> <magentoCLI command="config:set web/secure/use_in_frontend 1" stepKey="useSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set web/secure/use_in_frontend 0" stepKey="dontUseSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <executeJS function="return window.location.host" stepKey="hostname"/> <amOnUrl url="http://{$hostname}/contact" stepKey="goToUnsecureContactURL"/> diff --git a/app/code/Magento/Contact/view/frontend/templates/form.phtml b/app/code/Magento/Contact/view/frontend/templates/form.phtml index e9d0c065fd8b..99e61e8249da 100644 --- a/app/code/Magento/Contact/view/frontend/templates/form.phtml +++ b/app/code/Magento/Contact/view/frontend/templates/form.phtml @@ -44,7 +44,9 @@ $viewModel = $block->getViewModel(); value="<?= $block->escapeHtmlAttr($viewModel->getUserEmail()) ?>" class="input-text" type="email" - data-validate="{required:true, 'validate-email':true}"/> + data-validate="{required:true, 'validate-email':true}" + data-mage-init='{"mage/trim-input":{}}' + /> </div> </div> <div class="field telephone"> diff --git a/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifySecureCookieTest.xml b/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifySecureCookieTest.xml index 56098cfec90c..337410d61c06 100644 --- a/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifySecureCookieTest.xml +++ b/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifySecureCookieTest.xml @@ -28,7 +28,7 @@ <magentoCLI command="config:set web/secure/base_url https://{$hostname}/" stepKey="setSecureBaseURL"/> <magentoCLI command="config:set web/secure/use_in_frontend 1" stepKey="useSecureURLsOnStorefront"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> + <argument name="tags" value="full_page"/> </actionGroup> </before> <after> @@ -37,9 +37,7 @@ <magentoCLI command="config:set web/unsecure/base_url http://{$hostname}/" stepKey="setUnsecureBaseURL"/> <magentoCLI command="config:set web/secure/base_url http://{$hostname}/" stepKey="setSecureBaseURL"/> <magentoCLI command="config:set web/secure/use_in_frontend 0" stepKey="useSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <amOnPage url="/" stepKey="goToHomePage"/> <executeJS function="return window.cookiesConfig.secure ? 'true' : 'false'" stepKey="isCookieSecure"/> diff --git a/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifyUnsecureCookieTest.xml b/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifyUnsecureCookieTest.xml index e601a6b1920b..dccb432273b8 100644 --- a/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifyUnsecureCookieTest.xml +++ b/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifyUnsecureCookieTest.xml @@ -21,14 +21,10 @@ <group value="configuration"/> </annotations> <before> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <amOnPage url="/" stepKey="goToHomePage"/> <executeJS function="return window.cookiesConfig.secure ? 'true' : 'false'" stepKey="isCookieSecure"/> diff --git a/app/code/Magento/Cookie/view/base/web/js/jquery.storageapi.extended.js b/app/code/Magento/Cookie/view/base/web/js/jquery.storageapi.extended.js index c026b205f037..c16586652264 100644 --- a/app/code/Magento/Cookie/view/base/web/js/jquery.storageapi.extended.js +++ b/app/code/Magento/Cookie/view/base/web/js/jquery.storageapi.extended.js @@ -16,8 +16,11 @@ define([ * @private */ function _extend(storage) { + var cookiesConfig = window.cookiesConfig || {}; + $.extend(storage, { - _secure: window.cookiesConfig ? window.cookiesConfig.secure : false, + _secure: !!cookiesConfig.secure, + _samesite: cookiesConfig.samesite ? cookiesConfig.samesite : 'lax', /** * Set value under name @@ -30,7 +33,8 @@ define([ expires: this._expires, path: this._path, domain: this._domain, - secure: this._secure + secure: this._secure, + samesite: this._samesite }; $.cookie(this._prefix + name, value, $.extend(_default, options || {})); @@ -58,6 +62,10 @@ define([ this._secure = c.secure; } + if (typeof c.samesite !== 'undefined') { + this._samesite = c.samesite; + } + return this; } }); diff --git a/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currencysymbol.php b/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currencysymbol.php index f48394ac19b3..431a7cf858b9 100644 --- a/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currencysymbol.php +++ b/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currencysymbol.php @@ -22,6 +22,11 @@ class Currencysymbol extends \Magento\Backend\Block\Widget\Form */ protected $_symbolSystemFactory; + /** + * @var string + */ + private $_controller; + /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\CurrencySymbol\Model\System\CurrencysymbolFactory $symbolSystemFactory @@ -36,17 +41,6 @@ public function __construct( parent::__construct($context, $data); } - /** - * Constructor. Initialization required variables for class instance. - * - * @return void - */ - protected function _construct() - { - $this->_controller = 'adminhtml_system_currencysymbol'; - parent::_construct(); - } - /** * Custom currency symbol properties * diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminImportUnsupportedCurrencyRatesActionGroup.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminImportUnsupportedCurrencyRatesActionGroup.xml new file mode 100644 index 000000000000..6c6ce71506d7 --- /dev/null +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminImportUnsupportedCurrencyRatesActionGroup.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminImportUnsupportedCurrencyRatesActionGroup" extends="AdminImportCurrencyRatesActionGroup"> + <waitForElementVisible selector="{{AdminCurrencyRatesSection.oldRateLabel}}" stepKey="waitForOldRateVisible"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Data/CurrencyRatesConfigData.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Data/CurrencyRatesConfigData.xml index d22430e3c021..9b95f4017df0 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Data/CurrencyRatesConfigData.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Data/CurrencyRatesConfigData.xml @@ -32,6 +32,12 @@ <data key="scope">websites</data> <data key="scope_code">base</data> </entity> + <entity name="SetCurrencyRHDBaseConfig"> + <data key="path">currency/options/base</data> + <data key="value">RHD</data> + <data key="scope">websites</data> + <data key="scope_code">base</data> + </entity> <entity name="SetCurrencyAUDBaseConfig"> <data key="path">currency/options/base</data> <data key="value">AUD</data> @@ -62,6 +68,12 @@ <data key="scope">websites</data> <data key="scope_code">base</data> </entity> + <entity name="SetAllowedCurrenciesConfigForRHD"> + <data key="path">currency/options/allow</data> + <data key="value">RHD</data> + <data key="scope">websites</data> + <data key="scope_code">base</data> + </entity> <entity name="SetAllowedCurrenciesConfigForYEN"> <data key="path">currency/options/allow</data> <data key="value">JPY</data> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Section/AdminCurrencyRatesSection.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Section/AdminCurrencyRatesSection.xml index 10f345ec6936..a98495416cff 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Section/AdminCurrencyRatesSection.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Section/AdminCurrencyRatesSection.xml @@ -13,6 +13,7 @@ <element name="saveCurrencyRates" type="button" selector="//button[@title='Save Currency Rates']"/> <element name="options" type="button" selector="//button[@title='Options']"/> <element name="oldRate" type="text" selector="//div[contains(@class, 'admin__field-note') and contains(text(), 'Old rate:')]/strong"/> + <element name="oldRateLabel" type="text" selector="//div[contains(@class, 'admin__field-note') and contains(text(), 'Old rate:')]"/> <element name="rateService" type="select" selector="#rate_services"/> <element name="currencyRate" type="input" selector="input[name='rate[{{fistCurrency}}][{{secondCurrency}}]']" parameterized="true"/> </section> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminCheckCurrencyConverterApiConfigurationTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminCheckCurrencyConverterApiConfigurationTest.xml new file mode 100644 index 000000000000..c36ce89d9dfa --- /dev/null +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminCheckCurrencyConverterApiConfigurationTest.xml @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCheckCurrencyConverterApiConfigurationTest"> + <annotations> + <features value="CurrencySymbol"/> + <stories value="Currency Rates"/> + <title value="Currency Converter API configuration"/> + <description value="Admin should be able to import currency rates using Currency Converter API"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-28786"/> + <useCaseId value="MAGETWO-94919"/> + <group value="currency"/> + </annotations> + <before> + <!--Set currency configuration--> + <magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForRHD.value}}" stepKey="setAllowedCurrencyRHDAndUSD"/> + <magentoCLI command="config:set {{CurrencyConverterApiKeyConfigData.path}} {{CurrencyConverterApiKeyConfigData.value}}" stepKey="setCurrencyConverterApiKey"/> + <!--Create product--> + <createData entity="SimpleProduct2" stepKey="createProduct"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <!--Set currency allow previous config--> + <magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}}" stepKey="setDefaultAllowedCurrencies"/> + <magentoCLI command="config:set {{DefaultCurrencyConverterApiKeyConfigData.path}} {{DefaultCurrencyConverterApiKeyConfigData.value}}" stepKey="setDefaultCurrencyConverterApiKey"/> + <!--Delete created data--> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + <!--Import rates from Currency Converter API--> + <actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="openCurrencyRatesPage"/> + <actionGroup ref="AdminImportUnsupportedCurrencyRatesActionGroup" stepKey="importCurrencyRates"> + <argument name="rateService" value="Currency Converter API"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeWarningMessageForRHD"> + <argument name="message" value="We can't retrieve a rate from https://free.currconv.com for RHD."/> + <argument name="messageType" value="warning"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeWarningMessageSaved"> + <argument name="message" value='Click "Save" to apply the rates we found.'/> + <argument name="messageType" value="warning"/> + </actionGroup> + <actionGroup ref="AdminSaveCurrencyRatesActionGroup" stepKey="saveCurrencyRates"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeRHDMessageAfterSave"> + <argument name="message" value="{{AdminSaveCurrencyRatesMessageData.success}}"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeValidRatesSaved"> + <argument name="message" value='Please correct the input data for "USD => RHD" rate'/> + <argument name="messageType" value="warning"/> + </actionGroup> + <magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForEUR.value}}" stepKey="setAllowedCurrencyEURAndUSD"/> + <actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="openCurrencyRatesPageAfterSetEUR"/> + <actionGroup ref="AdminImportCurrencyRatesActionGroup" stepKey="importCurrencyRatesAfterEUR"> + <argument name="rateService" value="Currency Converter API"/> + </actionGroup> + <dontSee selector="{{AdminMessagesSection.warning}}" userInput="We can't retrieve a rate from https://free.currconv.com for EUR." stepKey="dontSeeWarningMessageForEUR"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeSuccessMessageForSaveRates"> + <argument name="message" value='Click "Save" to apply the rates we found.'/> + </actionGroup> + <actionGroup ref="AdminSaveCurrencyRatesActionGroup" stepKey="saveCurrencyRatesAfterEUR"/> + <dontSee selector="{{AdminMessagesSection.warning}}" userInput='Please correct the input data for "USD => EUR" rate' stepKey="dontSeeWarningMessageCorrectForEUR"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeValidRatesEURSaved"> + <argument name="message" value="{{AdminSaveCurrencyRatesMessageData.success}}"/> + </actionGroup> + <!--Go to the Storefront and check currency rates--> + <amOnPage url="{{StorefrontProductPage.url($createProduct.custom_attributes[url_key]$)}}" stepKey="openCreatedProductPage"/> + <waitForPageLoad stepKey="waitForProductPageLoad"/> + <actionGroup ref="StorefrontSwitchCurrencyActionGroup" stepKey="switchToEURCurrency"> + <argument name="currency" value="EUR"/> + </actionGroup> + <see selector="{{StorefrontCategoryMainSection.productPrice}}" userInput="€" stepKey="seeEURCurrencySymbolInPrice"/> + <!--Set allowed currencies greater then 10--> + <magentoCLI command="config:set currency/options/allow RHD,CHW,YER,ZMK,CHE,EUR,USD,AMD,RUB,DZD,ARS,AWG" stepKey="setGreaterThanTenAllowedCurrencies"/> + <!--Import rates from Currency Converter API with currencies greater then 10--> + <actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="openCurrencyRatesPageAfterChangeAllowed"/> + <actionGroup ref="AdminImportUnsupportedCurrencyRatesActionGroup" stepKey="importCurrencyRatesGreaterThen10"> + <argument name="rateService" value="Currency Converter API"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeTooManyPairsMessage"> + <argument name="message" value="Too many pairs. Maximum of 2 is supported for this free version."/> + <argument name="messageType" value="warning"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminCurrencyConverterAPIConfigurationTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminCurrencyConverterAPIConfigurationTest.xml index ce586be359e4..3f82ca4f3855 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminCurrencyConverterAPIConfigurationTest.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminCurrencyConverterAPIConfigurationTest.xml @@ -8,27 +8,25 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminCurrencyConverterAPIConfigurationTest"> + <test name="AdminCurrencyConverterAPIConfigurationTest" deprecated="Use AdminCheckCurrencyConverterApiConfigurationTest instead"> <annotations> <features value="CurrencySymbol"/> <stories value="Currency Rates"/> - <title value="Currency Converter API configuration"/> - <description value="Currency Converter API configuration"/> + <title value="DEPRECATED. Currency Converter API configuration"/> + <description value="DEPRECATED. Currency Converter API configuration"/> <severity value="CRITICAL"/> <testCaseId value="MC-19272"/> <useCaseId value="MAGETWO-94919"/> <group value="currency"/> <skip> - <issueId value="MQE-1578"/> + <issueId value="DEPRECATED">Use AdminCheckCurrencyConverterApiConfigurationTest instead</issueId> </skip> </annotations> <before> <!--Set currency allow config--> <magentoCLI command="config:set currency/options/allow RHD,CHW,CHE,AMD,EUR,USD" stepKey="setCurrencyAllow"/> <!--TODO: Add Api key--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Create product--> <createData entity="SimpleSubCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createProduct"> @@ -58,7 +56,7 @@ <see selector="{{AdminMessagesSection.warning}}" userInput='Please correct the input data for "USD => RHD" rate' stepKey="seeRHDMessageAfterSave"/> <see selector="{{AdminMessagesSection.warning}}" userInput='Please correct the input data for "USD => CHW" rate' stepKey="seeCHWMessageAfterSave"/> <!--Go to the Storefront and check currency rates--> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <actionGroup ref="StorefrontSwitchCurrencyActionGroup" stepKey="switchAMDCurrency"> <argument name="currency" value="AMD"/> @@ -70,9 +68,7 @@ <see selector="{{StorefrontCategoryMainSection.productPrice}}" userInput="€" stepKey="seeEURInPrice"/> <!--Set allowed currencies greater then 10--> <magentoCLI command="config:set currency/options/allow RHD,CHW,YER,ZMK,CHE,EUR,USD,AMD,RUB,DZD,ARS,AWG" stepKey="setCurrencyAllow"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Import rates from Currency Converter API with currencies greater then 10--> <actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="onCurrencyRatePageSecondTime"/> <actionGroup ref="AdminImportCurrencyRatesActionGroup" stepKey="importCurrencyRatesGreaterThen10"> diff --git a/app/code/Magento/Customer/Api/Data/CustomerInterface.php b/app/code/Magento/Customer/Api/Data/CustomerInterface.php index 9e8f9a12d5a4..f03889050ef8 100644 --- a/app/code/Magento/Customer/Api/Data/CustomerInterface.php +++ b/app/code/Magento/Customer/Api/Data/CustomerInterface.php @@ -6,7 +6,8 @@ namespace Magento\Customer\Api\Data; /** - * Customer interface. + * Customer entity interface for API handling. + * * @api * @since 100.0.2 */ @@ -161,7 +162,10 @@ public function setCreatedIn($createdIn); /** * Get date of birth * - * @return string|null + * @return string|null In keeping with current security and privacy best practices, be sure you are aware of any + * potential legal and security risks associated with the storage of customers’ full date of birth + * (month, day, year) along with other personal identifiers (e.g., full name) before collecting or processing + * such data. */ public function getDob(); diff --git a/app/code/Magento/Customer/Api/Data/GroupExcludedWebsiteInterface.php b/app/code/Magento/Customer/Api/Data/GroupExcludedWebsiteInterface.php new file mode 100644 index 000000000000..6758c67c2bbf --- /dev/null +++ b/app/code/Magento/Customer/Api/Data/GroupExcludedWebsiteInterface.php @@ -0,0 +1,88 @@ +<?php +/** + * + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Api\Data; + +use Magento\Framework\Api\ExtensibleDataInterface; + +/** + * Customer group website interface for websites that are excluded from customer group. + * @api + */ +interface GroupExcludedWebsiteInterface extends ExtensibleDataInterface +{ + /**#@+ + * Constants for keys of data array + */ + public const ID = 'entity_id'; + public const GROUP_ID = 'customer_group_id'; + public const WEBSITE_ID = 'website_id'; + /**#@-*/ + + /** + * Get entity id + * + * @return int|null + */ + public function getGroupWebsiteId(): ?int; + + /** + * Set entity id + * + * @param int $id + * @return $this + */ + public function setGroupWebsiteId(int $id): GroupExcludedWebsiteInterface; + + /** + * Get customer group id + * + * @return int|null + */ + public function getGroupId(): ?int; + + /** + * Set customer group id + * + * @param int $id + * @return $this + */ + public function setGroupId(int $id): GroupExcludedWebsiteInterface; + + /** + * Get excluded website id + * + * @return int|null + */ + public function getExcludedWebsiteId(): ?int; + + /** + * Set excluded website id + * + * @param int $websiteId + * @return $this + */ + public function setExcludedWebsiteId(int $websiteId): GroupExcludedWebsiteInterface; + + /** + * Retrieve existing extension attributes object or create a new one. + * + * @return \Magento\Customer\Api\Data\GroupExcludedWebsiteExtensionInterface|null + */ + public function getExtensionAttributes(): ?GroupExcludedWebsiteExtensionInterface; + + /** + * Set an extension attributes object. + * + * @param GroupExcludedWebsiteExtensionInterface $extensionAttributes + * @return $this + */ + public function setExtensionAttributes( + GroupExcludedWebsiteExtensionInterface $extensionAttributes + ): GroupExcludedWebsiteInterface; +} diff --git a/app/code/Magento/Customer/Api/GroupExcludedWebsiteRepositoryInterface.php b/app/code/Magento/Customer/Api/GroupExcludedWebsiteRepositoryInterface.php new file mode 100644 index 000000000000..361ecfd7f245 --- /dev/null +++ b/app/code/Magento/Customer/Api/GroupExcludedWebsiteRepositoryInterface.php @@ -0,0 +1,62 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Api; + +use Magento\Customer\Api\Data\GroupExcludedWebsiteInterface; +use Magento\Framework\Exception\LocalizedException; + +/** + * Customer group website repository interface for websites that are excluded from customer group. + * @api + */ +interface GroupExcludedWebsiteRepositoryInterface +{ + /** + * Save customer group excluded website. + * + * @param GroupExcludedWebsiteInterface $groupExcludedWebsite + * @return GroupExcludedWebsiteInterface + * @throws LocalizedException + */ + public function save(GroupExcludedWebsiteInterface $groupExcludedWebsite): GroupExcludedWebsiteInterface; + + /** + * Retrieve customer group excluded websites by customer group id. + * + * @param int $customerGroupId + * @return string[] + * @throws LocalizedException + */ + public function getCustomerGroupExcludedWebsites(int $customerGroupId): array; + + /** + * Retrieve all excluded customer group websites per customer groups. + * + * @return int[] + * @throws LocalizedException + */ + public function getAllExcludedWebsites(): array; + + /** + * Delete customer group with its excluded websites. + * + * @param int $customerGroupId + * @return bool + * @throws LocalizedException + */ + public function delete(int $customerGroupId): bool; + + /** + * Delete customer group excluded website by id. + * + * @param int $websiteId + * @return bool + * @throws LocalizedException + */ + public function deleteByWebsite(int $websiteId): bool; +} diff --git a/app/code/Magento/Customer/Block/Account/Dashboard/Address.php b/app/code/Magento/Customer/Block/Account/Dashboard/Address.php index 87fb6fc62bc2..5a22009221c0 100644 --- a/app/code/Magento/Customer/Block/Account/Dashboard/Address.php +++ b/app/code/Magento/Customer/Block/Account/Dashboard/Address.php @@ -104,17 +104,19 @@ public function getPrimaryBillingAddressHtml() try { $address = $this->currentCustomerAddress->getDefaultBillingAddress(); } catch (NoSuchEntityException $e) { - return __('You have not set a default billing address.'); + return $this->escapeHtml(__('You have not set a default billing address.')); } if ($address) { return $this->_getAddressHtml($address); } else { - return __('You have not set a default billing address.'); + return $this->escapeHtml(__('You have not set a default billing address.')); } } /** + * Get Primary Shipping Address Edit Url + * * @return string */ public function getPrimaryShippingAddressEditUrl() @@ -132,6 +134,8 @@ public function getPrimaryShippingAddressEditUrl() } /** + * Get Primary Billing Address Edit Url + * * @return string */ public function getPrimaryBillingAddressEditUrl() @@ -149,6 +153,8 @@ public function getPrimaryBillingAddressEditUrl() } /** + * Get Address Book Url + * * @return string */ public function getAddressBookUrl() diff --git a/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php b/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php index c10ff421b7f9..703d9b2d0154 100644 --- a/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php +++ b/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php @@ -172,9 +172,9 @@ public function renderArray($addressAttributes, $format = null) } $attributeCode = $attributeMetadata->getAttributeCode(); if ($attributeCode == 'country_id' && isset($addressAttributes['country_id'])) { - $data['country'] = $this->_countryFactory->create()->loadByCode( - $addressAttributes['country_id'] - )->getName(); + $data['country'] = $this->_countryFactory->create() + ->loadByCode($addressAttributes['country_id']) + ->getName($addressAttributes['locale'] ?? null); } elseif ($attributeCode == 'region' && isset($addressAttributes['region'])) { $data['region'] = (string)__($addressAttributes['region']); } elseif (isset($addressAttributes[$attributeCode])) { @@ -198,6 +198,7 @@ public function renderArray($addressAttributes, $format = null) } } $format = $format !== null ? $format : $this->getFormatArray($addressAttributes); + return $this->filterManager->template($format, ['variables' => $data]); } } diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Orders.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Orders.php index 56f5e07670e5..818b3221db4e 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Orders.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Orders.php @@ -34,6 +34,11 @@ class Orders extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $collectionFactory; + /** + * @var \Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory + */ + private $_collectionFactory; + /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/PersonalInfo.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/PersonalInfo.php index a6e0eb0bcbc5..da20bc9b4871 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/PersonalInfo.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/PersonalInfo.php @@ -314,11 +314,11 @@ public function getBillingAddressHtml() try { $address = $this->accountManagement->getDefaultBillingAddress($this->getCustomer()->getId()); } catch (NoSuchEntityException $e) { - return __('The customer does not have default billing address.'); + return $this->escapeHtml(__('The customer does not have default billing address.')); } if ($address === null) { - return __('The customer does not have default billing address.'); + return $this->escapeHtml(__('The customer does not have default billing address.')); } return $this->addressHelper->getFormatTypeRenderer( diff --git a/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Address/File.php b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Address/File.php new file mode 100644 index 000000000000..0286ef4b96aa --- /dev/null +++ b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Address/File.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Block\Adminhtml\Form\Element\Address; + +/** + * Customer Address Widget Form File Element Block + */ +class File extends \Magento\Customer\Block\Adminhtml\Form\Element\File +{ + /** + * @inheritdoc + */ + protected function _getPreviewUrl() + { + return $this->_adminhtmlData->getUrl( + 'customer/address/viewfile', + ['file' => $this->urlEncoder->encode($this->getValue())] + ); + } +} diff --git a/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Address/Image.php b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Address/Image.php new file mode 100644 index 000000000000..fe1a0a26d6ff --- /dev/null +++ b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Address/Image.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Block\Adminhtml\Form\Element\Address; + +/** + * Customer Address Widget Form Image Element Block + */ +class Image extends \Magento\Customer\Block\Adminhtml\Form\Element\Image +{ + /** + * @inheritdoc + */ + protected function _getPreviewUrl() + { + return $this->_adminhtmlData->getUrl( + 'customer/address/viewfile', + ['file' => $this->urlEncoder->encode($this->getValue())] + ); + } +} diff --git a/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Image.php b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Image.php index 3452085a85c2..2f6609486ee7 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Image.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Image.php @@ -73,7 +73,7 @@ protected function _getPreviewUrl() { return $this->_adminhtmlData->getUrl( 'customer/index/viewfile', - ['image' => $this->urlEncoder->encode($this->getValue())] + ['file' => $this->urlEncoder->encode($this->getValue())] ); } } diff --git a/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Newsletter/Subscriptions.php b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Newsletter/Subscriptions.php index e9686daa3e3a..a14ddea9e444 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Newsletter/Subscriptions.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Newsletter/Subscriptions.php @@ -152,7 +152,7 @@ private function getSessionFormValue(string $name, int $arrayKey): ?string $data = $this->dataPersistor->get('customer_form'); $currentCustomerId = $this->getData('customer_id'); $sessionCustomerId = $data['customer']['entity_id'] ?? null; - if ($sessionCustomerId === null || $currentCustomerId !== (int)$sessionCustomerId) { + if ($sessionCustomerId === null || ((int) $currentCustomerId) !== (int)$sessionCustomerId) { return null; } diff --git a/app/code/Magento/Customer/Block/Adminhtml/Group/Edit/Form.php b/app/code/Magento/Customer/Block/Adminhtml/Group/Edit/Form.php index 1a57ab7c7b6a..80b0ac662b13 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Group/Edit/Form.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Group/Edit/Form.php @@ -5,7 +5,10 @@ */ namespace Magento\Customer\Block\Adminhtml\Group\Edit; +use Magento\Customer\Api\GroupExcludedWebsiteRepositoryInterface; use Magento\Customer\Controller\RegistryConstants; +use Magento\Framework\App\ObjectManager; +use Magento\Store\Model\System\Store as SystemStore; /** * Adminhtml customer groups edit form @@ -32,6 +35,16 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $groupDataFactory; + /** + * @var SystemStore + */ + private $systemStore; + + /** + * @var GroupExcludedWebsiteRepositoryInterface + */ + private $groupExcludedWebsiteRepository; + /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Framework\Registry $registry @@ -41,6 +54,8 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic * @param \Magento\Customer\Api\GroupRepositoryInterface $groupRepository * @param \Magento\Customer\Api\Data\GroupInterfaceFactory $groupDataFactory * @param array $data + * @param SystemStore|null $systemStore + * @param GroupExcludedWebsiteRepositoryInterface|null $groupExcludedWebsiteRepository */ public function __construct( \Magento\Backend\Block\Template\Context $context, @@ -50,12 +65,17 @@ public function __construct( \Magento\Tax\Helper\Data $taxHelper, \Magento\Customer\Api\GroupRepositoryInterface $groupRepository, \Magento\Customer\Api\Data\GroupInterfaceFactory $groupDataFactory, - array $data = [] + array $data = [], + SystemStore $systemStore = null, + GroupExcludedWebsiteRepositoryInterface $groupExcludedWebsiteRepository = null ) { $this->_taxCustomer = $taxCustomer; $this->_taxHelper = $taxHelper; $this->_groupRepository = $groupRepository; $this->groupDataFactory = $groupDataFactory; + $this->systemStore = $systemStore ?: ObjectManager::getInstance()->get(SystemStore::class); + $this->groupExcludedWebsiteRepository = $groupExcludedWebsiteRepository + ?: ObjectManager::getInstance()->get(GroupExcludedWebsiteRepositoryInterface::class); parent::__construct($context, $registry, $formFactory, $data); } @@ -73,12 +93,16 @@ protected function _prepareLayout() $groupId = $this->_coreRegistry->registry(RegistryConstants::CURRENT_GROUP_ID); /** @var \Magento\Customer\Api\Data\GroupInterface $customerGroup */ + $customerGroupExcludedWebsites = []; if ($groupId === null) { $customerGroup = $this->groupDataFactory->create(); $defaultCustomerTaxClass = $this->_taxHelper->getDefaultCustomerTaxClass(); } else { $customerGroup = $this->_groupRepository->getById($groupId); $defaultCustomerTaxClass = $customerGroup->getTaxClassId(); + $customerGroupExcludedWebsites = $this->groupExcludedWebsiteRepository->getCustomerGroupExcludedWebsites( + $groupId + ); } $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('Group Information')]); @@ -120,6 +144,20 @@ protected function _prepareLayout() ] ); + $fieldset->addField( + 'customer_group_excluded_website_ids', + 'multiselect', + [ + 'name' => 'customer_group_excluded_websites', + 'label' => __('Excluded Website(s)'), + 'title' => __('Excluded Website(s)'), + 'required' => false, + 'can_be_empty' => true, + 'values' => $this->systemStore->getWebsiteValuesForForm(), + 'note' => __('Select websites you want to exclude from this customer group.') + ] + ); + if ($customerGroup->getId() !== null) { // If edit add id $form->addField('id', 'hidden', ['name' => 'id', 'value' => $customerGroup->getId()]); @@ -135,6 +173,7 @@ protected function _prepareLayout() 'id' => $customerGroup->getId(), 'customer_group_code' => $customerGroup->getCode(), 'tax_class_id' => $defaultCustomerTaxClass, + 'customer_group_excluded_website_ids' => $customerGroupExcludedWebsites ] ); } diff --git a/app/code/Magento/Customer/Block/Form/Register.php b/app/code/Magento/Customer/Block/Form/Register.php index d6d0d9c494c1..006deed60127 100644 --- a/app/code/Magento/Customer/Block/Form/Register.php +++ b/app/code/Magento/Customer/Block/Form/Register.php @@ -9,6 +9,7 @@ use Magento\Customer\Model\AccountManagement; use Magento\Framework\App\ObjectManager; use Magento\Newsletter\Model\Config; +use Magento\Store\Model\ScopeInterface; /** * Customer register form block @@ -184,7 +185,7 @@ public function getRegion() public function isNewsletterEnabled() { return $this->_moduleManager->isOutputEnabled('Magento_Newsletter') - && $this->newsLetterConfig->isActive(); + && $this->newsLetterConfig->isActive(ScopeInterface::SCOPE_STORE); } /** diff --git a/app/code/Magento/Customer/Console/Command/UpgradeHashAlgorithmCommand.php b/app/code/Magento/Customer/Console/Command/UpgradeHashAlgorithmCommand.php index c980fe1fe776..260efefe48dd 100644 --- a/app/code/Magento/Customer/Console/Command/UpgradeHashAlgorithmCommand.php +++ b/app/code/Magento/Customer/Console/Command/UpgradeHashAlgorithmCommand.php @@ -68,10 +68,9 @@ protected function execute(InputInterface $input, OutputInterface $output) $customer->load($customer->getId()); if (!$this->encryptor->validateHashVersion($customer->getPasswordHash())) { list($hash, $salt, $version) = explode(Encryptor::DELIMITER, $customer->getPasswordHash(), 3); - $version .= Encryptor::DELIMITER . $this->encryptor->getLatestHashVersion(); $hash = $this->encryptor->getHash($hash, $salt, $this->encryptor->getLatestHashVersion()); - list($hash, $salt) = explode(Encryptor::DELIMITER, $hash, 3); - $hash = implode(Encryptor::DELIMITER, [$hash, $salt, $version]); + list($hash, $salt, $newVersion) = explode(Encryptor::DELIMITER, $hash, 3); + $hash = implode(Encryptor::DELIMITER, [$hash, $salt, $version .Encryptor::DELIMITER .$newVersion]); $customer->setPasswordHash($hash); $customer->save(); $output->write("."); @@ -79,5 +78,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } $output->writeln("."); $output->writeln("<info>Finished</info>"); + + return 0; } } diff --git a/app/code/Magento/Customer/Controller/Account/CreatePost.php b/app/code/Magento/Customer/Controller/Account/CreatePost.php index 14c2ed43171f..9171511f5ba2 100644 --- a/app/code/Magento/Customer/Controller/Account/CreatePost.php +++ b/app/code/Magento/Customer/Controller/Account/CreatePost.php @@ -152,7 +152,7 @@ class CreatePost extends AbstractAccount implements CsrfAwareActionInterface, Ht /** * @var ScopeConfigInterface */ - private $scopeConfig; + protected $scopeConfig; /** * @param Context $context diff --git a/app/code/Magento/Customer/Controller/Account/EditPost.php b/app/code/Magento/Customer/Controller/Account/EditPost.php index c2137f1b4001..901036302c77 100644 --- a/app/code/Magento/Customer/Controller/Account/EditPost.php +++ b/app/code/Magento/Customer/Controller/Account/EditPost.php @@ -8,6 +8,7 @@ namespace Magento\Customer\Controller\Account; use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Api\SessionCleanerInterface; use Magento\Customer\Model\AddressRegistry; use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; use Magento\Customer\Model\AuthenticationInterface; @@ -27,6 +28,7 @@ use Magento\Framework\Escaper; use Magento\Framework\Exception\InputException; use Magento\Framework\Exception\InvalidEmailOrPasswordException; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Exception\State\UserLockedException; use Magento\Customer\Controller\AbstractAccount; @@ -72,7 +74,7 @@ class EditPost extends AbstractAccount implements CsrfAwareActionInterface, Http protected $session; /** - * @var \Magento\Customer\Model\EmailNotificationInterface + * @var EmailNotificationInterface */ private $emailNotification; @@ -101,6 +103,11 @@ class EditPost extends AbstractAccount implements CsrfAwareActionInterface, Http */ private $filesystem; + /** + * @var SessionCleanerInterface|null + */ + private $sessionCleaner; + /** * @param Context $context * @param Session $customerSession @@ -111,6 +118,7 @@ class EditPost extends AbstractAccount implements CsrfAwareActionInterface, Http * @param Escaper|null $escaper * @param AddressRegistry|null $addressRegistry * @param Filesystem $filesystem + * @param SessionCleanerInterface|null $sessionCleaner */ public function __construct( Context $context, @@ -121,7 +129,8 @@ public function __construct( CustomerExtractor $customerExtractor, ?Escaper $escaper = null, AddressRegistry $addressRegistry = null, - Filesystem $filesystem = null + Filesystem $filesystem = null, + ?SessionCleanerInterface $sessionCleaner = null ) { parent::__construct($context); $this->session = $customerSession; @@ -132,6 +141,7 @@ public function __construct( $this->escaper = $escaper ?: ObjectManager::getInstance()->get(Escaper::class); $this->addressRegistry = $addressRegistry ?: ObjectManager::getInstance()->get(AddressRegistry::class); $this->filesystem = $filesystem ?: ObjectManager::getInstance()->get(Filesystem::class); + $this->sessionCleaner = $sessionCleaner ?: ObjectManager::getInstance()->get(SessionCleanerInterface::class); } /** @@ -143,9 +153,7 @@ private function getAuthentication() { if (!($this->authentication instanceof AuthenticationInterface)) { - return ObjectManager::getInstance()->get( - \Magento\Customer\Model\AuthenticationInterface::class - ); + return ObjectManager::getInstance()->get(AuthenticationInterface::class); } else { return $this->authentication; } @@ -160,9 +168,7 @@ private function getAuthentication() private function getEmailNotification() { if (!($this->emailNotification instanceof EmailNotificationInterface)) { - return ObjectManager::getInstance()->get( - EmailNotificationInterface::class - ); + return ObjectManager::getInstance()->get(EmailNotificationInterface::class); } else { return $this->emailNotification; } @@ -171,9 +177,8 @@ private function getEmailNotification() /** * @inheritDoc */ - public function createCsrfValidationException( - RequestInterface $request - ): ?InvalidRequestException { + public function createCsrfValidationException(RequestInterface $request): ?InvalidRequestException + { /** @var Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); $resultRedirect->setPath('*/*/edit'); @@ -195,12 +200,12 @@ public function validateForCsrf(RequestInterface $request): ?bool /** * Change customer email or password action * - * @return \Magento\Framework\Controller\Result\Redirect + * @return Redirect * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function execute() { - /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */ + /** @var Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); $validFormKey = $this->formKeyValidator->validate($this->getRequest()); @@ -254,13 +259,14 @@ public function execute() $this->session->logout(); $this->session->start(); $this->messageManager->addErrorMessage($message); + return $resultRedirect->setPath('customer/account/login'); } catch (InputException $e) { $this->messageManager->addErrorMessage($this->escaper->escapeHtml($e->getMessage())); foreach ($e->getErrors() as $error) { $this->messageManager->addErrorMessage($this->escaper->escapeHtml($error->getMessage())); } - } catch (\Magento\Framework\Exception\LocalizedException $e) { + } catch (LocalizedException $e) { $this->messageManager->addErrorMessage($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addException($e, __('We can\'t save the customer.')); @@ -272,16 +278,17 @@ public function execute() /** @var Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); $resultRedirect->setPath('*/*/edit'); + return $resultRedirect; } /** * Account editing action completed successfully event * - * @param \Magento\Customer\Api\Data\CustomerInterface $customerCandidateDataObject + * @param CustomerInterface $customerCandidateDataObject * @return void */ - private function dispatchSuccessEvent(\Magento\Customer\Api\Data\CustomerInterface $customerCandidateDataObject) + private function dispatchSuccessEvent(CustomerInterface $customerCandidateDataObject) { $this->_eventManager->dispatch( 'customer_account_edited', @@ -294,7 +301,7 @@ private function dispatchSuccessEvent(\Magento\Customer\Api\Data\CustomerInterfa * * @param int $customerId * - * @return \Magento\Customer\Api\Data\CustomerInterface + * @return CustomerInterface */ private function getCustomerDataObject($customerId) { @@ -304,13 +311,13 @@ private function getCustomerDataObject($customerId) /** * Create Data Transfer Object of customer candidate * - * @param \Magento\Framework\App\RequestInterface $inputData - * @param \Magento\Customer\Api\Data\CustomerInterface $currentCustomerData - * @return \Magento\Customer\Api\Data\CustomerInterface + * @param RequestInterface $inputData + * @param CustomerInterface $currentCustomerData + * @return CustomerInterface */ private function populateNewCustomerDataObject( - \Magento\Framework\App\RequestInterface $inputData, - \Magento\Customer\Api\Data\CustomerInterface $currentCustomerData + RequestInterface $inputData, + CustomerInterface $currentCustomerData ) { $attributeValues = $this->getCustomerMapper()->toFlatArray($currentCustomerData); $customerDto = $this->customerExtractor->extract( @@ -356,12 +363,12 @@ protected function changeCustomerPassword($email) /** * Process change email request * - * @param \Magento\Customer\Api\Data\CustomerInterface $currentCustomerDataObject + * @param CustomerInterface $currentCustomerDataObject * @return void * @throws InvalidEmailOrPasswordException * @throws UserLockedException */ - private function processChangeEmailRequest(\Magento\Customer\Api\Data\CustomerInterface $currentCustomerDataObject) + private function processChangeEmailRequest(CustomerInterface $currentCustomerDataObject) { if ($this->getRequest()->getParam('change_email')) { // authenticate user for changing email @@ -370,6 +377,7 @@ private function processChangeEmailRequest(\Magento\Customer\Api\Data\CustomerIn $currentCustomerDataObject->getId(), $this->getRequest()->getPost('current_password') ); + $this->sessionCleaner->clearFor($currentCustomerDataObject->getId()); } catch (InvalidEmailOrPasswordException $e) { throw new InvalidEmailOrPasswordException( __("The password doesn't match this account. Verify the password and try again.") @@ -388,7 +396,7 @@ private function processChangeEmailRequest(\Magento\Customer\Api\Data\CustomerIn private function getCustomerMapper() { if ($this->customerMapper === null) { - $this->customerMapper = ObjectManager::getInstance()->get(\Magento\Customer\Model\Customer\Mapper::class); + $this->customerMapper = ObjectManager::getInstance()->get(Mapper::class); } return $this->customerMapper; } diff --git a/app/code/Magento/Customer/Controller/Account/Logout.php b/app/code/Magento/Customer/Controller/Account/Logout.php index 9344f482bd6e..20b4fe30aa24 100644 --- a/app/code/Magento/Customer/Controller/Account/Logout.php +++ b/app/code/Magento/Customer/Controller/Account/Logout.php @@ -4,8 +4,11 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Customer\Controller\Account; +use Magento\Customer\Api\SessionCleanerInterface; use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Customer\Model\Session; @@ -35,15 +38,24 @@ class Logout extends AbstractAccount implements HttpGetActionInterface, HttpPost */ private $cookieMetadataManager; + /** + * @var SessionCleanerInterface + */ + private $sessionCleaner; + /** * @param Context $context * @param Session $customerSession + * @param SessionCleanerInterface|null $sessionCleaner */ public function __construct( Context $context, - Session $customerSession + Session $customerSession, + SessionCleanerInterface $sessionCleaner = null ) { $this->session = $customerSession; + $objectManager = ObjectManager::getInstance(); + $this->sessionCleaner = $sessionCleaner ?? $objectManager->get(SessionCleanerInterface::class); parent::__construct($context); } @@ -85,6 +97,7 @@ public function execute() $lastCustomerId = $this->session->getId(); $this->session->logout()->setBeforeAuthUrl($this->_redirect->getRefererUrl()) ->setLastCustomerId($lastCustomerId); + $this->sessionCleaner->clearFor((int)$lastCustomerId); if ($this->getCookieManager()->getCookie('mage-cache-sessid')) { $metadata = $this->getCookieMetadataFactory()->createCookieMetadata(); $metadata->setPath('/'); diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Address/Viewfile.php b/app/code/Magento/Customer/Controller/Adminhtml/Address/Viewfile.php index a8cad14c23a7..71167f289ffb 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Address/Viewfile.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Address/Viewfile.php @@ -8,6 +8,7 @@ namespace Magento\Customer\Controller\Adminhtml\Address; use Magento\Customer\Api\AddressMetadataInterface; +use Magento\Framework\App\ResponseInterface; use Magento\Framework\Exception\NotFoundException; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Controller\Result\RawFactory; @@ -92,7 +93,7 @@ public function __construct( /** * Customer address view file action * - * @return ResultInterface|void + * @return ResultInterface|ResponseInterface|void * @throws NotFoundException */ public function execute() @@ -142,7 +143,7 @@ public function execute() return $resultRaw; } else { $name = $pathInfo['basename']; - $this->fileFactory->create( + return $this->fileFactory->create( $name, ['type' => 'filename', 'value' => $fileName], DirectoryList::MEDIA diff --git a/app/code/Magento/Customer/Controller/Adminhtml/File/Customer/Upload.php b/app/code/Magento/Customer/Controller/Adminhtml/File/Customer/Upload.php index 6ec11f4f7632..833a0504a823 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/File/Customer/Upload.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/File/Customer/Upload.php @@ -14,6 +14,9 @@ use Magento\Framework\Exception\LocalizedException; use Psr\Log\LoggerInterface; +/** + * Class for upload customer file attribute + */ class Upload extends Action { /** @@ -38,6 +41,11 @@ class Upload extends Action */ private $logger; + /** + * @var string + */ + private $scope; + /** * @param Context $context * @param FileUploaderFactory $fileUploaderFactory @@ -65,15 +73,15 @@ public function execute() if (empty($_FILES)) { throw new \Exception('$_FILES array is empty.'); } - - $attributeCode = key($_FILES['customer']['name']); + $scope = array_key_first($_FILES); + $attributeCode = key($_FILES[$scope]['name']); $attributeMetadata = $this->customerMetadataService->getAttributeMetadata($attributeCode); /** @var FileUploader $fileUploader */ $fileUploader = $this->fileUploaderFactory->create([ 'attributeMetadata' => $attributeMetadata, 'entityTypeCode' => CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, - 'scope' => 'customer', + 'scope' => $scope, ]); $errors = $fileUploader->validate(); diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php b/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php index 64c94fa230fb..4c07864f9b95 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php @@ -5,10 +5,10 @@ */ namespace Magento\Customer\Controller\Adminhtml\Group; -use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; use Magento\Customer\Api\Data\GroupInterfaceFactory; -use Magento\Customer\Api\Data\GroupInterface; use Magento\Customer\Api\GroupRepositoryInterface; +use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\App\ObjectManager; /** * Controller class Save. Performs save action of customers group @@ -20,6 +20,11 @@ class Save extends \Magento\Customer\Controller\Adminhtml\Group implements HttpP */ protected $dataObjectProcessor; + /** + * @var \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory + */ + private $groupExtensionInterfaceFactory; + /** * * @param \Magento\Backend\App\Action\Context $context @@ -29,6 +34,7 @@ class Save extends \Magento\Customer\Controller\Adminhtml\Group implements HttpP * @param \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory * @param \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor + * @param \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory $groupExtensionInterfaceFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, @@ -37,9 +43,12 @@ public function __construct( GroupInterfaceFactory $groupDataFactory, \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory, \Magento\Framework\View\Result\PageFactory $resultPageFactory, - \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor + \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor, + \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory $groupExtensionInterfaceFactory ) { $this->dataObjectProcessor = $dataObjectProcessor; + $this->groupExtensionInterfaceFactory = $groupExtensionInterfaceFactory + ?: ObjectManager::getInstance()->get(\Magento\Customer\Api\Data\GroupExtensionInterfaceFactory::class); parent::__construct( $context, $coreRegistry, @@ -78,6 +87,8 @@ public function execute() $customerGroup = null; if ($taxClass) { $id = $this->getRequest()->getParam('id'); + $websitesToExclude = empty($this->getRequest()->getParam('customer_group_excluded_websites')) + ? [] : $this->getRequest()->getParam('customer_group_excluded_websites'); $resultRedirect = $this->resultRedirectFactory->create(); try { $customerGroupCode = (string)$this->getRequest()->getParam('code'); @@ -91,6 +102,12 @@ public function execute() $customerGroup->setCode(!empty($customerGroupCode) ? $customerGroupCode : null); $customerGroup->setTaxClassId($taxClass); + if ($websitesToExclude !== null) { + $customerGroupExtensionAttributes = $this->groupExtensionInterfaceFactory->create(); + $customerGroupExtensionAttributes->setExcludeWebsiteIds($websitesToExclude); + $customerGroup->setExtensionAttributes($customerGroupExtensionAttributes); + } + $this->groupRepository->save($customerGroup); $this->messageManager->addSuccessMessage(__('You saved the customer group.')); diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Viewfile.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Viewfile.php index 02a045086224..8aa55a6d1c5f 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Viewfile.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Viewfile.php @@ -14,6 +14,8 @@ use Magento\Customer\Api\Data\AddressInterfaceFactory; use Magento\Customer\Api\Data\CustomerInterfaceFactory; use Magento\Customer\Model\Address\Mapper; +use Magento\Framework\App\ResponseInterface; +use Magento\Framework\Controller\ResultInterface; use Magento\Framework\Exception\NotFoundException; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\DataObjectFactory; @@ -130,7 +132,7 @@ public function __construct( /** * Customer view file action * - * @return \Magento\Framework\Controller\ResultInterface|void + * @return ResultInterface|ResponseInterface|void * @throws NotFoundException */ public function execute() @@ -181,7 +183,7 @@ public function execute() } else { // phpcs:ignore Magento2.Functions.DiscouragedFunction $name = pathinfo($path, PATHINFO_BASENAME); - $this->_fileFactory->create( + return $this->_fileFactory->create( $name, ['type' => 'filename', 'value' => $fileName], DirectoryList::MEDIA diff --git a/app/code/Magento/Customer/Helper/View.php b/app/code/Magento/Customer/Helper/View.php index a47930abb6d0..dcd4ae01940a 100644 --- a/app/code/Magento/Customer/Helper/View.php +++ b/app/code/Magento/Customer/Helper/View.php @@ -8,6 +8,8 @@ use Magento\Customer\Api\CustomerNameGenerationInterface; use Magento\Customer\Api\CustomerMetadataInterface; use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Escaper; /** * Customer helper for view. @@ -19,22 +21,30 @@ class View extends \Magento\Framework\App\Helper\AbstractHelper implements Custo */ protected $_customerMetadataService; + /** + * @var Escaper + */ + private $escaper; + /** * Initialize dependencies. * * @param \Magento\Framework\App\Helper\Context $context * @param CustomerMetadataInterface $customerMetadataService + * @param Escaper|null $escaper */ public function __construct( \Magento\Framework\App\Helper\Context $context, - CustomerMetadataInterface $customerMetadataService + CustomerMetadataInterface $customerMetadataService, + Escaper $escaper = null ) { $this->_customerMetadataService = $customerMetadataService; + $this->escaper = $escaper ?? ObjectManager::getInstance()->get(Escaper::class); parent::__construct($context); } /** - * {@inheritdoc} + * @inheritdoc */ public function getCustomerName(CustomerInterface $customerData) { @@ -57,6 +67,7 @@ public function getCustomerName(CustomerInterface $customerData) if ($suffixMetadata->isVisible() && $customerData->getSuffix()) { $name .= ' ' . $customerData->getSuffix(); } - return $name; + + return $this->escaper->escapeHtml($name); } } diff --git a/app/code/Magento/Customer/Model/Account/Redirect.php b/app/code/Magento/Customer/Model/Account/Redirect.php index 9824be73f36b..dc83aee3a6ae 100644 --- a/app/code/Magento/Customer/Model/Account/Redirect.php +++ b/app/code/Magento/Customer/Model/Account/Redirect.php @@ -221,15 +221,15 @@ protected function processLoggedCustomer() ScopeInterface::SCOPE_STORE ) ) { - $referer = $this->request->getParam(CustomerUrl::REFERER_QUERY_PARAM_NAME); - if ($referer) { - $referer = $this->urlDecoder->decode($referer); - preg_match('/logoutSuccess\//', $referer, $matches, PREG_OFFSET_CAPTURE); + $referrer = $this->request->getParam(CustomerUrl::REFERER_QUERY_PARAM_NAME); + if ($referrer) { + $referrer = $this->urlDecoder->decode($referrer); + preg_match('/logoutSuccess\//', $referrer, $matches, PREG_OFFSET_CAPTURE); if (!empty($matches)) { - $referer = str_replace('logoutSuccess/', '', $referer); + $referrer = str_replace('logoutSuccess/', '', $referrer); } - if ($this->hostChecker->isOwnOrigin($referer)) { - $this->applyRedirect($referer); + if ($this->isReferrerValid($referrer) && $this->hostChecker->isOwnOrigin($referrer)) { + $this->applyRedirect($referrer); } } } elseif ($this->session->getAfterAuthUrl()) { @@ -237,6 +237,23 @@ protected function processLoggedCustomer() } } + /** + * Check if referrer is well-formatted + * + * @param string $referrer + * @return bool + */ + private function isReferrerValid(string $referrer) : bool + { + $result = true; + if (preg_match('/^(https?|\/\/)/i', $referrer)) { + if (filter_var($referrer, FILTER_VALIDATE_URL) === false) { + $result = false; + } + } + return $result; + } + /** * Prepare redirect URL * @@ -305,6 +322,7 @@ public function setRedirectCookie($route) ->setHttpOnly(true) ->setDuration(3600) ->setPath($this->storeManager->getStore()->getStorePath()) + ->setSameSite('Lax') ); } diff --git a/app/code/Magento/Customer/Model/Address/Validator/Customer.php b/app/code/Magento/Customer/Model/Address/Validator/Customer.php new file mode 100644 index 000000000000..5b1d6decd151 --- /dev/null +++ b/app/code/Magento/Customer/Model/Address/Validator/Customer.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Address\Validator; + +use Magento\Customer\Model\Address\AbstractAddress; +use Magento\Customer\Model\Address\ValidatorInterface; +use Magento\Customer\Model\AddressFactory; +use Magento\Quote\Api\Data\AddressInterface as QuoteAddressInterface; + +/** + * Validates that current Address is related to given Customer. + */ +class Customer implements ValidatorInterface +{ + /** + * @var AddressFactory + */ + private $addressFactory; + + /** + * @param AddressFactory $addressFactory + */ + public function __construct(AddressFactory $addressFactory) + { + $this->addressFactory = $addressFactory; + } + + /** + * @inheritDoc + */ + public function validate(AbstractAddress $address): array + { + $errors = []; + $addressId = $address instanceof QuoteAddressInterface ? $address->getCustomerAddressId() : $address->getId(); + if ($addressId !== null) { + $addressCustomerId = (int) $address->getCustomerId(); + $originalAddressCustomerId = (int) $this->addressFactory->create() + ->load($addressId) + ->getCustomerId(); + + if ($originalAddressCustomerId !== 0 && $originalAddressCustomerId !== $addressCustomerId) { + $errors[] = __( + 'Provided customer ID "%customer_id" isn\'t related to current customer address.', + ['customer_id' => $addressCustomerId] + ); + } + } + + return $errors; + } +} diff --git a/app/code/Magento/Customer/Model/Data/GroupExcludedWebsite.php b/app/code/Magento/Customer/Model/Data/GroupExcludedWebsite.php new file mode 100644 index 000000000000..6ebe39e554ba --- /dev/null +++ b/app/code/Magento/Customer/Model/Data/GroupExcludedWebsite.php @@ -0,0 +1,93 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Data; + +use Magento\Customer\Api\Data\GroupExcludedWebsiteExtensionInterface; +use Magento\Customer\Api\Data\GroupExcludedWebsiteInterface; +use Magento\Framework\Model\AbstractExtensibleModel; + +/** + * Customer Group Excluded Website data model. + */ +class GroupExcludedWebsite extends AbstractExtensibleModel implements GroupExcludedWebsiteInterface +{ + /** + * Define resource model. + * + * @return void + */ + protected function _construct() + { + $this->_init(\Magento\Customer\Model\ResourceModel\GroupExcludedWebsite::class); + } + + /** + * {@inheritdoc} + */ + public function getGroupWebsiteId(): ?int + { + return $this->getData(self::ID); + } + + /** + * {@inheritdoc} + */ + public function setGroupWebsiteId(int $id): GroupExcludedWebsiteInterface + { + return $this->setData(self::ID, $id); + } + + /** + * {@inheritdoc} + */ + public function getGroupId(): ?int + { + return $this->getData(self::GROUP_ID); + } + + /** + * {@inheritdoc} + */ + public function setGroupId(int $id): GroupExcludedWebsiteInterface + { + return $this->setData(self::GROUP_ID, $id); + } + + /** + * {@inheritdoc} + */ + public function getExcludedWebsiteId(): ?int + { + return $this->getData(self::WEBSITE_ID); + } + + /** + * {@inheritdoc} + */ + public function setExcludedWebsiteId(int $websiteId): GroupExcludedWebsiteInterface + { + return $this->setData(self::WEBSITE_ID, $websiteId); + } + + /** + * {@inheritdoc} + */ + public function getExtensionAttributes(): ?GroupExcludedWebsiteExtensionInterface + { + return $this->_getExtensionAttributes(); + } + + /** + * {@inheritdoc} + */ + public function setExtensionAttributes( + GroupExcludedWebsiteExtensionInterface $extensionAttributes + ): GroupExcludedWebsiteInterface { + return $this->_setExtensionAttributes($extensionAttributes); + } +} diff --git a/app/code/Magento/Customer/Model/EmailNotification.php b/app/code/Magento/Customer/Model/EmailNotification.php index 55d82e0d7ccb..a4f85a9c4a0c 100644 --- a/app/code/Magento/Customer/Model/EmailNotification.php +++ b/app/code/Magento/Customer/Model/EmailNotification.php @@ -10,6 +10,7 @@ use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\Mail\Template\SenderResolverInterface; +use Magento\Store\Model\App\Emulation; use Magento\Store\Model\StoreManagerInterface; use Magento\Framework\Mail\Template\TransportBuilder; use Magento\Customer\Helper\View as CustomerViewHelper; @@ -103,6 +104,11 @@ class EmailNotification implements EmailNotificationInterface */ private $senderResolver; + /** + * @var Emulation + */ + private $emulation; + /** * @param CustomerRegistry $customerRegistry * @param StoreManagerInterface $storeManager @@ -111,6 +117,7 @@ class EmailNotification implements EmailNotificationInterface * @param DataObjectProcessor $dataProcessor * @param ScopeConfigInterface $scopeConfig * @param SenderResolverInterface|null $senderResolver + * @param Emulation|null $emulation */ public function __construct( CustomerRegistry $customerRegistry, @@ -119,7 +126,8 @@ public function __construct( CustomerViewHelper $customerViewHelper, DataObjectProcessor $dataProcessor, ScopeConfigInterface $scopeConfig, - SenderResolverInterface $senderResolver = null + SenderResolverInterface $senderResolver = null, + Emulation $emulation =null ) { $this->customerRegistry = $customerRegistry; $this->storeManager = $storeManager; @@ -128,6 +136,7 @@ public function __construct( $this->dataProcessor = $dataProcessor; $this->scopeConfig = $scopeConfig; $this->senderResolver = $senderResolver ?? ObjectManager::getInstance()->get(SenderResolverInterface::class); + $this->emulation = $emulation ?? ObjectManager::getInstance()->get(Emulation::class); } /** @@ -274,7 +283,9 @@ private function sendEmailTemplate( ->addTo($email, $this->customerViewHelper->getCustomerName($customer)) ->getTransport(); + $this->emulation->startEnvironmentEmulation($storeId, \Magento\Framework\App\Area::AREA_FRONTEND); $transport->sendMessage(); + $this->emulation->stopEnvironmentEmulation(); } /** diff --git a/app/code/Magento/Customer/Model/FileProcessor.php b/app/code/Magento/Customer/Model/FileProcessor.php index 59e2d5fb2b57..f566d7e9a91f 100644 --- a/app/code/Magento/Customer/Model/FileProcessor.php +++ b/app/code/Magento/Customer/Model/FileProcessor.php @@ -29,6 +29,10 @@ class FileProcessor */ const TMP_DIR = 'tmp'; + private const CUSTOMER_FILE_URL_PATH = 'customer/index/viewfile'; + + private const CUSTOMER_ADDRESS_FILE_URL_PATH = 'customer/address/viewfile'; + /** * @var WriteInterface */ @@ -64,6 +68,16 @@ class FileProcessor */ private $mime; + /** + * @var string + */ + private $customerFileUrlPath; + + /** + * @var string + */ + private $customerAddressFileUrlPath; + /** * @param Filesystem $filesystem * @param UploaderFactory $uploaderFactory @@ -72,6 +86,8 @@ class FileProcessor * @param string $entityTypeCode * @param Mime $mime * @param array $allowedExtensions + * @param string $customerFileUrlPath + * @param string $customerAddressFileUrlPath */ public function __construct( Filesystem $filesystem, @@ -80,7 +96,9 @@ public function __construct( EncoderInterface $urlEncoder, $entityTypeCode, Mime $mime, - array $allowedExtensions = [] + array $allowedExtensions = [], + string $customerFileUrlPath = self::CUSTOMER_FILE_URL_PATH, + string $customerAddressFileUrlPath = self::CUSTOMER_ADDRESS_FILE_URL_PATH ) { $this->mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA); $this->uploaderFactory = $uploaderFactory; @@ -89,6 +107,8 @@ public function __construct( $this->entityTypeCode = $entityTypeCode; $this->mime = $mime; $this->allowedExtensions = $allowedExtensions; + $this->customerFileUrlPath = $customerFileUrlPath; + $this->customerAddressFileUrlPath = $customerAddressFileUrlPath; } /** @@ -159,14 +179,14 @@ public function getViewUrl($filePath, $type) if ($this->entityTypeCode == AddressMetadataInterface::ENTITY_TYPE_ADDRESS) { $viewUrl = $this->urlBuilder->getUrl( - 'customer/address/viewfile', + $this->customerAddressFileUrlPath, [$type => $this->urlEncoder->encode(ltrim($filePath, '/'))] ); } if ($this->entityTypeCode == CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER) { $viewUrl = $this->urlBuilder->getUrl( - 'customer/index/viewfile', + $this->customerFileUrlPath, [$type => $this->urlEncoder->encode(ltrim($filePath, '/'))] ); } diff --git a/app/code/Magento/Customer/Model/Metadata/Form/File.php b/app/code/Magento/Customer/Model/Metadata/Form/File.php index 1add044c50c9..16730f89ccd2 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/File.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/File.php @@ -11,9 +11,9 @@ use Magento\Framework\Api\Data\ImageContentInterface; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\App\ObjectManager; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\File\UploaderFactory; use Magento\Framework\Filesystem; -use Magento\Framework\Filesystem\Io\File as IoFile; /** * Processes files that are save for customer. @@ -62,11 +62,6 @@ class File extends AbstractData */ protected $fileProcessorFactory; - /** - * @var IoFile|null - */ - private $ioFile; - /** * Constructor * @@ -82,7 +77,6 @@ class File extends AbstractData * @param Filesystem $fileSystem * @param UploaderFactory $uploaderFactory * @param \Magento\Customer\Model\FileProcessorFactory|null $fileProcessorFactory - * @param IoFile|null $ioFile * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -97,8 +91,7 @@ public function __construct( \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $fileValidator, Filesystem $fileSystem, UploaderFactory $uploaderFactory, - FileProcessorFactory $fileProcessorFactory = null, - IoFile $ioFile = null + \Magento\Customer\Model\FileProcessorFactory $fileProcessorFactory = null ) { $value = $this->prepareFileValue($value); parent::__construct($localeDate, $logger, $attribute, $localeResolver, $value, $entityTypeCode, $isAjax); @@ -109,8 +102,6 @@ public function __construct( $this->fileProcessorFactory = $fileProcessorFactory ?: ObjectManager::getInstance() ->get(FileProcessorFactory::class); $this->fileProcessor = $this->fileProcessorFactory->create(['entityTypeCode' => $this->_entityTypeCode]); - $this->ioFile = $ioFile ?: ObjectManager::getInstance() - ->get(IoFile::class); } /** @@ -137,9 +128,10 @@ public function extractValue(\Magento\Framework\App\RequestInterface $request) $mainScope = $this->_requestScope; $scopes = []; } - + // phpcs:disable Magento2.Security.Superglobal if (!empty($_FILES[$mainScope])) { foreach ($_FILES[$mainScope] as $fileKey => $scopeData) { + // phpcs:enable Magento2.Security.Superglobal foreach ($scopes as $scopeName) { if (isset($scopeData[$scopeName])) { $scopeData = $scopeData[$scopeName]; @@ -164,8 +156,10 @@ public function extractValue(\Magento\Framework\App\RequestInterface $request) $value = []; } } else { + // phpcs:disable Magento2.Security.Superglobal if (isset($_FILES[$attrCode])) { $value = $_FILES[$attrCode]; + // phpcs:enable Magento2.Security.Superglobal } else { $value = []; } @@ -189,9 +183,7 @@ protected function _validateByRules($value) { $label = $value['name']; $rules = $this->getAttribute()->getValidationRules(); - // phpcs:ignore Magento2.Functions.DiscouragedFunction - $pathInfo = $this->ioFile->getPathInfo($label); - $extension = $pathInfo['extension'] ?? null; + $extension = $this->getFileExtension($value['name']); $fileExtensions = ArrayObjectSearch::getArrayElementByName( $rules, 'file_extensions' @@ -229,6 +221,28 @@ protected function _validateByRules($value) return []; } + /** + * Get file extension from the file if it exists, otherwise, get from filename. + * + * @param string $fileName + * @return string + */ + private function getFileExtension(string $fileName): string + { + return pathinfo($fileName, PATHINFO_EXTENSION); + } + + /** + * Get file basename from the file if it exists, otherwise, get from filename. + * + * @param string $fileName + * @return string + */ + private function getFileBasename(string $fileName): string + { + return pathinfo($fileName, PATHINFO_BASENAME); + } + /** * Helper function that checks if the file was uploaded. * @@ -245,8 +259,7 @@ protected function _isUploadedFile($filename) } // This case is required for file uploader UI component - $temporaryFile = FileProcessor::TMP_DIR . DIRECTORY_SEPARATOR . - $this->ioFile->getPathInfo($filename)['basename']; + $temporaryFile = FileProcessor::TMP_DIR . '/' . $this->getFileBasename($filename); if ($this->fileProcessor->isExist($temporaryFile)) { return true; } @@ -307,7 +320,10 @@ public function compactValue($value) } // Remove outdated file (in the case of file uploader UI component) - if (!empty($this->_value) && !empty($value['delete'])) { + if (!empty($this->_value) + && (!empty($value['delete']) + || ($this->_entityTypeCode == 'customer' && empty($value))) + ) { $this->fileProcessor->removeUploadedFile($this->_value); return $value; } @@ -368,16 +384,20 @@ protected function processInputFieldValue($value) } if (!empty($value['tmp_name'])) { + $uploader = $this->uploaderFactory->create(['fileId' => $value]); + $fileExtension = $uploader->getFileExtension(); + if (!$this->_fileValidator->isValid($fileExtension)) { + throw new LocalizedException($this->_fileValidator->getMessages()[$fileExtension]); + } + $uploader->setFilesDispersion(true); + $uploader->setFilenamesCaseSensitivity(false); + $uploader->setAllowRenameFiles(true); try { - $uploader = $this->uploaderFactory->create(['fileId' => $value]); - $uploader->setFilesDispersion(true); - $uploader->setFilenamesCaseSensitivity(false); - $uploader->setAllowRenameFiles(true); $uploader->save($mediaDir->getAbsolutePath($this->_entityTypeCode), $value['name']); - $result = $uploader->getUploadedFileName(); } catch (\Exception $e) { $this->_logger->critical($e); } + $result = $uploader->getUploadedFileName(); } return $result; diff --git a/app/code/Magento/Customer/Model/Plugin/CustomerGridIndexAfterWebsiteDelete.php b/app/code/Magento/Customer/Model/Plugin/CustomerGridIndexAfterWebsiteDelete.php new file mode 100644 index 000000000000..0dc20a5a6238 --- /dev/null +++ b/app/code/Magento/Customer/Model/Plugin/CustomerGridIndexAfterWebsiteDelete.php @@ -0,0 +1,75 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Customer\Model\Plugin; + +use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory as CustomerCollectionFactory; +use Magento\Framework\Indexer\IndexerRegistry; +use Magento\Store\Model\Website; + +/** + * Run customer_grid indexer after deleting website for specified customers + */ +class CustomerGridIndexAfterWebsiteDelete +{ + private const CUSTOMER_GRID_INDEXER_ID = 'customer_grid'; + + /** + * @var IndexerRegistry + */ + private $indexerRegistry; + + /** + * @var CustomerCollectionFactory + */ + private $customerCollectionFactory; + + /** + * @param IndexerRegistry $indexerRegistry + * @param CustomerCollectionFactory $customerCollectionFactory + */ + public function __construct(IndexerRegistry $indexerRegistry, CustomerCollectionFactory $customerCollectionFactory) + { + $this->indexerRegistry = $indexerRegistry; + $this->customerCollectionFactory = $customerCollectionFactory; + } + + /** + * Run customer_grid indexer after deleting website + * + * @param Website $subject + * @param callable $proceed + * @return Website + */ + public function aroundDelete(Website $subject, callable $proceed): Website + { + $customerIds = $this->getCustomerIdsByWebsiteId((int) $subject->getId()); + $result = $proceed(); + + if ($customerIds) { + $this->indexerRegistry->get(self::CUSTOMER_GRID_INDEXER_ID) + ->reindexList($customerIds); + } + + return $result; + } + + /** + * Returns customer ids by website id + * + * @param int $websiteId + * @return array + */ + private function getCustomerIdsByWebsiteId(int $websiteId): array + { + $collection = $this->customerCollectionFactory->create(); + $collection->addFieldToFilter('website_id', $websiteId); + + return $collection->getAllIds(); + } +} diff --git a/app/code/Magento/Customer/Model/Plugin/DeleteCustomerGroupExcludedWebsite.php b/app/code/Magento/Customer/Model/Plugin/DeleteCustomerGroupExcludedWebsite.php new file mode 100644 index 000000000000..aa86b1fd97d2 --- /dev/null +++ b/app/code/Magento/Customer/Model/Plugin/DeleteCustomerGroupExcludedWebsite.php @@ -0,0 +1,76 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Plugin; + +use Magento\Catalog\Model\Indexer\Product\Price\Processor; +use Magento\Customer\Api\GroupRepositoryInterface; +use Magento\Customer\Model\ResourceModel\GroupExcludedWebsiteRepository; +use Magento\Framework\Exception\CouldNotDeleteException; +use Magento\Framework\Exception\LocalizedException; + +/** + * Delete customer group excluded websites while deleting customer group by id. + */ +class DeleteCustomerGroupExcludedWebsite +{ + /** + * @var GroupExcludedWebsiteRepository + */ + private $groupExcludedWebsiteRepository; + + /** + * @var Processor + */ + private $priceIndexProcessor; + + /** + * @param GroupExcludedWebsiteRepository $groupExcludedWebsiteRepository + * @param Processor $priceIndexProcessor + */ + public function __construct( + GroupExcludedWebsiteRepository $groupExcludedWebsiteRepository, + Processor $priceIndexProcessor + ) { + $this->groupExcludedWebsiteRepository = $groupExcludedWebsiteRepository; + $this->priceIndexProcessor = $priceIndexProcessor; + } + + /** + * Delete excluded customer group websites while deleting customer group by id. + * + * @param GroupRepositoryInterface $subject + * @param bool $result + * @param string $groupId + * @return bool + * @throws CouldNotDeleteException + * @throws LocalizedException + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterDeleteById(GroupRepositoryInterface $subject, bool $result, string $groupId): bool + { + $excludedWebsites = $this->groupExcludedWebsiteRepository->getCustomerGroupExcludedWebsites((int)$groupId); + if (!empty($excludedWebsites)) { + try { + $this->groupExcludedWebsiteRepository->delete((int)$groupId); + } catch (LocalizedException $e) { + throw new CouldNotDeleteException( + __( + 'Could not delete customer group website with ID: %1', + $groupId + ), + $e + ); + } + // invalidate product price index if websites were deleted from customer group exclusion + $priceIndexer = $this->priceIndexProcessor->getIndexer(); + $priceIndexer->invalidate(); + } + + return $result; + } +} diff --git a/app/code/Magento/Customer/Model/Plugin/GetByIdCustomerGroupExcludedWebsite.php b/app/code/Magento/Customer/Model/Plugin/GetByIdCustomerGroupExcludedWebsite.php new file mode 100644 index 000000000000..7600f242641b --- /dev/null +++ b/app/code/Magento/Customer/Model/Plugin/GetByIdCustomerGroupExcludedWebsite.php @@ -0,0 +1,67 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Plugin; + +use Magento\Customer\Api\Data\GroupInterface; +use Magento\Customer\Api\GroupRepositoryInterface; +use Magento\Customer\Model\ResourceModel\GroupExcludedWebsiteRepository; +use Magento\Framework\Exception\LocalizedException; + +/** + * Add excluded websites to customer group as extension attributes while retrieving this group by id. + */ +class GetByIdCustomerGroupExcludedWebsite +{ + /** + * @var \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory + */ + private $groupExtensionInterfaceFactory; + + /** + * @var GroupExcludedWebsiteRepository + */ + private $groupExcludedWebsiteRepository; + + /** + * @param \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory $groupExtensionInterfaceFactory + * @param GroupExcludedWebsiteRepository $groupExcludedWebsiteRepository + */ + public function __construct( + \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory $groupExtensionInterfaceFactory, + GroupExcludedWebsiteRepository $groupExcludedWebsiteRepository + ) { + $this->groupExtensionInterfaceFactory = $groupExtensionInterfaceFactory; + $this->groupExcludedWebsiteRepository = $groupExcludedWebsiteRepository; + } + + /** + * Add excluded websites as extension attributes while getting customer group by id. + * + * @param GroupRepositoryInterface $subject + * @param GroupInterface $result + * @param int $id + * @return GroupInterface + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * @throws LocalizedException + */ + public function afterGetById( + GroupRepositoryInterface $subject, + GroupInterface $result, + int $id + ): GroupInterface { + $excludedWebsites = $this->groupExcludedWebsiteRepository->getCustomerGroupExcludedWebsites($id); + if (!empty($excludedWebsites)) { + $customerGroupExtensionAttributes = $this->groupExtensionInterfaceFactory->create(); + $customerGroupExtensionAttributes->setExcludeWebsiteIds($excludedWebsites); + $result->setExtensionAttributes($customerGroupExtensionAttributes); + } + + return $result; + } +} diff --git a/app/code/Magento/Customer/Model/Plugin/GetListCustomerGroupExcludedWebsite.php b/app/code/Magento/Customer/Model/Plugin/GetListCustomerGroupExcludedWebsite.php new file mode 100644 index 000000000000..a3adb28da5b4 --- /dev/null +++ b/app/code/Magento/Customer/Model/Plugin/GetListCustomerGroupExcludedWebsite.php @@ -0,0 +1,77 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Plugin; + +use Magento\Customer\Api\Data\GroupSearchResultsInterface; +use Magento\Customer\Api\GroupRepositoryInterface; +use Magento\Customer\Model\ResourceModel\GroupExcludedWebsiteRepository; +use Magento\Framework\Api\SearchCriteriaInterface; +use Magento\Framework\Exception\LocalizedException; + +/** + * Add excluded websites to customer groups as extension attributes while retrieving the list of all groups. + */ +class GetListCustomerGroupExcludedWebsite +{ + /** + * @var \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory + */ + private $groupExtensionInterfaceFactory; + + /** + * @var GroupExcludedWebsiteRepository + */ + private $groupExcludedWebsiteRepository; + + /** + * @param \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory $groupExtensionInterfaceFactory + * @param GroupExcludedWebsiteRepository $groupExcludedWebsiteRepository + */ + public function __construct( + \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory $groupExtensionInterfaceFactory, + GroupExcludedWebsiteRepository $groupExcludedWebsiteRepository + ) { + $this->groupExtensionInterfaceFactory = $groupExtensionInterfaceFactory; + $this->groupExcludedWebsiteRepository = $groupExcludedWebsiteRepository; + } + + /** + * Add excluded websites to customer groups as extension attributes while retrieving the list of all groups. + * + * @param GroupRepositoryInterface $subject + * @param GroupSearchResultsInterface $result + * @param SearchCriteriaInterface $searchCriteria + * @return GroupSearchResultsInterface + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * @throws LocalizedException + */ + public function afterGetList( + GroupRepositoryInterface $subject, + GroupSearchResultsInterface $result, + SearchCriteriaInterface $searchCriteria + ): GroupSearchResultsInterface { + $customerGroups = $result->getItems(); + if (!empty($customerGroups)) { + $allExcludedWebsites = $this->groupExcludedWebsiteRepository->getAllExcludedWebsites(); + if (!empty($allExcludedWebsites)) { + foreach ($customerGroups as $customerGroup) { + $customerGroupId = (int)$customerGroup->getId(); + if (array_key_exists($customerGroupId, $allExcludedWebsites)) { + $excludedWebsites = $allExcludedWebsites[$customerGroupId]; + $customerGroupExtensionAttributes = $this->groupExtensionInterfaceFactory->create(); + $customerGroupExtensionAttributes->setExcludeWebsiteIds($excludedWebsites); + $customerGroup->setExtensionAttributes($customerGroupExtensionAttributes); + } + } + } + } + + return $result; + } +} diff --git a/app/code/Magento/Customer/Model/Plugin/SaveCustomerGroupExcludedWebsite.php b/app/code/Magento/Customer/Model/Plugin/SaveCustomerGroupExcludedWebsite.php new file mode 100644 index 000000000000..33a857fd3527 --- /dev/null +++ b/app/code/Magento/Customer/Model/Plugin/SaveCustomerGroupExcludedWebsite.php @@ -0,0 +1,149 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Plugin; + +use Magento\Catalog\Model\Indexer\Product\Price\Processor; +use Magento\Customer\Api\Data\GroupInterface; +use Magento\Customer\Api\GroupRepositoryInterface; +use Magento\Customer\Api\GroupExcludedWebsiteRepositoryInterface; +use Magento\Customer\Model\Data\GroupExcludedWebsiteFactory; +use Magento\Framework\Exception\CouldNotSaveException; +use Magento\Framework\Exception\LocalizedException; +use Magento\Store\Model\System\Store as SystemStore; + +/** + * Save customer group websites excluded for certain customer group. + */ +class SaveCustomerGroupExcludedWebsite +{ + /** + * @var GroupExcludedWebsiteFactory + */ + private $groupExcludedWebsiteFactory; + + /** + * @var GroupExcludedWebsiteRepositoryInterface + */ + private $groupExcludedWebsiteRepository; + + /** + * @var SystemStore + */ + private $systemStore; + + /** + * @var Processor + */ + private $priceIndexProcessor; + + /** + * @param GroupExcludedWebsiteFactory $groupExcludedWebsiteFactory + * @param GroupExcludedWebsiteRepositoryInterface $groupExcludedWebsiteRepository + * @param SystemStore $systemStore + * @param Processor $priceIndexProcessor + */ + public function __construct( + GroupExcludedWebsiteFactory $groupExcludedWebsiteFactory, + GroupExcludedWebsiteRepositoryInterface $groupExcludedWebsiteRepository, + SystemStore $systemStore, + Processor $priceIndexProcessor + ) { + $this->groupExcludedWebsiteFactory = $groupExcludedWebsiteFactory; + $this->groupExcludedWebsiteRepository = $groupExcludedWebsiteRepository; + $this->systemStore = $systemStore; + $this->priceIndexProcessor = $priceIndexProcessor; + } + + /** + * Save excluded websites for customer group. + * + * @param GroupRepositoryInterface $subject + * @param GroupInterface $result + * @param GroupInterface $group + * @return GroupInterface + * + * @throws CouldNotSaveException + * @throws LocalizedException + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterSave( + GroupRepositoryInterface $subject, + GroupInterface $result, + GroupInterface $group + ): GroupInterface { + if ($result->getExtensionAttributes() && $result->getExtensionAttributes()->getExcludeWebsiteIds() !== null) { + $websitesToExclude = array_intersect( + $this->getAllWebsites(), + $result->getExtensionAttributes()->getExcludeWebsiteIds() + ); + $customerGroupId = (int)$result->getId(); + + // prevent NOT LOGGED IN customers with id 0 to have excluded websites + if ($customerGroupId !== null && $customerGroupId !== 0) { + $excludedWebsites = $this->groupExcludedWebsiteRepository + ->getCustomerGroupExcludedWebsites($customerGroupId); + $isValueChanged = $this->isValueChanged($excludedWebsites, $websitesToExclude); + if ($isValueChanged) { + $this->groupExcludedWebsiteRepository->delete($customerGroupId); + foreach ($websitesToExclude as $websiteToExclude) { + $groupExcludedWebsite = $this->groupExcludedWebsiteFactory->create(); + $groupExcludedWebsite->setGroupId($customerGroupId); + $groupExcludedWebsite->setExcludedWebsiteId((int)$websiteToExclude); + try { + $this->groupExcludedWebsiteRepository->save($groupExcludedWebsite); + } catch (LocalizedException $e) { + throw new CouldNotSaveException( + __( + 'Could not save customer group website to exclude with ID: %1', + $websiteToExclude + ), + $e + ); + } + } + // invalidate product price index if new websites are excluded from customer group + $priceIndexer = $this->priceIndexProcessor->getIndexer(); + $priceIndexer->invalidate(); + } + } + } + + return $result; + } + + /** + * Get all websites. + * + * @return array + */ + private function getAllWebsites(): array + { + $websiteCollection = $this->systemStore->getWebsiteCollection(); + + $websites = []; + foreach ($websiteCollection as $website) { + $websites[] = (int)$website->getWebsiteId(); + } + + return $websites; + } + + /** + * Check if there are new websites to exclude from the customer group. + * + * @param array $currentValues + * @param array $newValues + * @return bool + */ + private function isValueChanged(array $currentValues, array $newValues): bool + { + return !($currentValues === array_intersect($currentValues, $newValues) + && $newValues === array_intersect($newValues, $currentValues)); + } + +} diff --git a/app/code/Magento/Customer/Model/Plugin/Website/DeleteCustomerGroupExcludedWebsite.php b/app/code/Magento/Customer/Model/Plugin/Website/DeleteCustomerGroupExcludedWebsite.php new file mode 100644 index 000000000000..aac0c436d290 --- /dev/null +++ b/app/code/Magento/Customer/Model/Plugin/Website/DeleteCustomerGroupExcludedWebsite.php @@ -0,0 +1,68 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Plugin\Website; + +use Magento\Catalog\Model\Indexer\Product\Price\Processor; +use Magento\Customer\Model\ResourceModel\GroupExcludedWebsiteRepository; +use Magento\Framework\Exception\LocalizedException; +use Magento\Store\Model\Website; + +/** + * Delete excluded customer group website after deleting the website. + */ +class DeleteCustomerGroupExcludedWebsite +{ + /** + * @var GroupExcludedWebsiteRepository + */ + private $groupExcludedWebsiteRepository; + + /** + * @var Processor + */ + private $priceIndexProcessor; + + /** + * @param GroupExcludedWebsiteRepository $groupExcludedWebsiteRepository + * @param Processor $priceIndexProcessor + */ + public function __construct( + GroupExcludedWebsiteRepository $groupExcludedWebsiteRepository, + Processor $priceIndexProcessor + ) { + $this->groupExcludedWebsiteRepository = $groupExcludedWebsiteRepository; + $this->priceIndexProcessor = $priceIndexProcessor; + } + + /** + * Delete excluded customer group website after deleting this website. + * + * @param Website $subject + * @param Website $result + * @return Website + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * @throws LocalizedException + */ + public function afterDelete( + Website $subject, + Website $result + ): Website { + $websiteId = (int)$result->getId(); + if (!empty($websiteId)) { + $deletedRecords = $this->groupExcludedWebsiteRepository->deleteByWebsite($websiteId); + if ($deletedRecords) { + // invalidate product price index if website was deleted from customer group exclusion + $priceIndexer = $this->priceIndexProcessor->getIndexer(); + $priceIndexer->invalidate(); + } + } + + return $result; + } +} diff --git a/app/code/Magento/Customer/Model/Renderer/Region.php b/app/code/Magento/Customer/Model/Renderer/Region.php index a26cfb96fe02..a3d747b0c023 100644 --- a/app/code/Magento/Customer/Model/Renderer/Region.php +++ b/app/code/Magento/Customer/Model/Renderer/Region.php @@ -38,6 +38,11 @@ class Region implements \Magento\Framework\Data\Form\Element\Renderer\RendererIn */ protected $_countryFactory; + /** + * @var \Magento\Directory\Helper\Data + */ + private $_directoryHelper; + /** * @param \Magento\Directory\Model\CountryFactory $countryFactory * @param \Magento\Directory\Helper\Data $directoryHelper diff --git a/app/code/Magento/Customer/Model/ResourceModel/Grid/Collection.php b/app/code/Magento/Customer/Model/ResourceModel/Grid/Collection.php index 0fab27161ce2..e14594daf801 100644 --- a/app/code/Magento/Customer/Model/ResourceModel/Grid/Collection.php +++ b/app/code/Magento/Customer/Model/ResourceModel/Grid/Collection.php @@ -7,10 +7,12 @@ use Magento\Customer\Model\ResourceModel\Customer; use Magento\Customer\Ui\Component\DataProvider\Document; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Data\Collection\Db\FetchStrategyInterface as FetchStrategy; use Magento\Framework\Data\Collection\EntityFactoryInterface as EntityFactory; use Magento\Framework\Event\ManagerInterface as EventManager; use Magento\Framework\Locale\ResolverInterface; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; use Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult; use Psr\Log\LoggerInterface as Logger; @@ -24,6 +26,11 @@ class Collection extends SearchResult */ private $localeResolver; + /** + * @var TimezoneInterface + */ + private $timeZone; + /** * @inheritdoc */ @@ -42,6 +49,7 @@ class Collection extends SearchResult * @param ResolverInterface $localeResolver * @param string $mainTable * @param string $resourceModel + * @param TimezoneInterface|null $timeZone */ public function __construct( EntityFactory $entityFactory, @@ -50,10 +58,13 @@ public function __construct( EventManager $eventManager, ResolverInterface $localeResolver, $mainTable = 'customer_grid_flat', - $resourceModel = Customer::class + $resourceModel = Customer::class, + TimezoneInterface $timeZone = null ) { $this->localeResolver = $localeResolver; parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $mainTable, $resourceModel); + $this->timeZone = $timeZone ?: ObjectManager::getInstance() + ->get(TimezoneInterface::class); } /** @@ -81,6 +92,14 @@ public function addFieldToFilter($field, $condition = null) return $this; } + if ($field === 'created_at') { + if (is_array($condition)) { + foreach ($condition as $key => $value) { + $condition[$key] = $this->timeZone->convertConfigTimeToUtc($value); + } + } + } + if (is_string($field) && count(explode('.', $field)) === 1) { $field = 'main_table.' . $field; } diff --git a/app/code/Magento/Customer/Model/ResourceModel/GroupExcludedWebsite.php b/app/code/Magento/Customer/Model/ResourceModel/GroupExcludedWebsite.php new file mode 100644 index 000000000000..61696154f231 --- /dev/null +++ b/app/code/Magento/Customer/Model/ResourceModel/GroupExcludedWebsite.php @@ -0,0 +1,105 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\ResourceModel; + +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Model\ResourceModel\Db\VersionControl\AbstractDb; + +/** + * Excluded customer group website resource model. + */ +class GroupExcludedWebsite extends AbstractDb +{ + /** + * Resource initialization + * + * @return void + */ + protected function _construct() + { + $this->_init('customer_group_excluded_website', 'entity_id'); + } + + /** + * Retrieve excluded website ids related to customer group. + * + * @param int $customerGroupId + * @return array + * @throws LocalizedException + */ + public function loadCustomerGroupExcludedWebsites(int $customerGroupId): array + { + $connection = $this->getConnection(); + $bind = ['customer_group_id' => $customerGroupId]; + + $select = $connection->select()->from( + $this->getMainTable(), + ['website_id'] + )->where( + 'customer_group_id = :customer_group_id' + ); + + return $connection->fetchCol($select, $bind); + } + + /** + * Retrieve all excluded website ids per related customer group. + * + * @return array + * @throws LocalizedException + */ + public function loadAllExcludedWebsites(): array + { + $connection = $this->getConnection(); + + $select = $connection->select()->from( + $this->getMainTable(), + ['customer_group_id', 'website_id'] + ); + + return $connection->fetchAll($select); + } + + /** + * Delete customer group with its excluded websites. + * + * @param int $customerGroupId + * @return GroupExcludedWebsite + * @throws LocalizedException + */ + public function delete($customerGroupId) + { + $connection = $this->getConnection(); + $connection->beginTransaction(); + try { + $where = $connection->quoteInto('customer_group_id = ?', $customerGroupId); + $connection->delete( + $this->getMainTable(), + $where + ); + $connection->commit(); + } catch (\Exception $e) { + $connection->rollBack(); + throw $e; + } + + return $this; + } + + /** + * Delete customer group excluded website by id. + * + * @param int $websiteId + * @return int + * @throws LocalizedException + */ + public function deleteByWebsite(int $websiteId): int + { + return $this->getConnection()->delete($this->getMainTable(), ['website_id = ?' => $websiteId]); + } +} diff --git a/app/code/Magento/Customer/Model/ResourceModel/GroupExcludedWebsiteRepository.php b/app/code/Magento/Customer/Model/ResourceModel/GroupExcludedWebsiteRepository.php new file mode 100644 index 000000000000..1237ff3017c1 --- /dev/null +++ b/app/code/Magento/Customer/Model/ResourceModel/GroupExcludedWebsiteRepository.php @@ -0,0 +1,119 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\ResourceModel; + +use Magento\Customer\Api\Data\GroupExcludedWebsiteInterface; +use Magento\Customer\Api\GroupExcludedWebsiteRepositoryInterface; +use Magento\Framework\Exception\CouldNotSaveException; +use Magento\Framework\Exception\LocalizedException; + +/** + * Customer group website repository for CRUD operations with excluded websites. + */ +class GroupExcludedWebsiteRepository implements GroupExcludedWebsiteRepositoryInterface +{ + /** + * @var GroupExcludedWebsite + */ + private $groupExcludedWebsiteResourceModel; + + /** + * @param GroupExcludedWebsite $groupExcludedWebsiteResourceModel + */ + public function __construct( + GroupExcludedWebsite $groupExcludedWebsiteResourceModel + ) { + $this->groupExcludedWebsiteResourceModel = $groupExcludedWebsiteResourceModel; + } + + /** + * @inheritdoc + */ + public function save(GroupExcludedWebsiteInterface $groupExcludedWebsite): GroupExcludedWebsiteInterface + { + try { + $this->groupExcludedWebsiteResourceModel->save($groupExcludedWebsite); + } catch (\Exception $e) { + throw new CouldNotSaveException( + __('Could not save customer group website to exclude from customer group: "%1"', $e->getMessage()) + ); + } + + return $groupExcludedWebsite; + } + + /** + * @inheritdoc + */ + public function getCustomerGroupExcludedWebsites(int $customerGroupId): array + { + try { + return $this->groupExcludedWebsiteResourceModel->loadCustomerGroupExcludedWebsites($customerGroupId); + } catch (LocalizedException $e) { + throw new LocalizedException( + __('Could not retrieve excluded customer group websites by customer group: "%1"', $e->getMessage()) + ); + } + } + + /** + * @inheritdoc + */ + public function getAllExcludedWebsites(): array + { + try { + $allExcludedWebsites = $this->groupExcludedWebsiteResourceModel->loadAllExcludedWebsites(); + } catch (LocalizedException $e) { + throw new LocalizedException( + __('Could not retrieve all excluded customer group websites.') + ); + } + + $excludedWebsites = []; + + if (!empty($allExcludedWebsites)) { + foreach ($allExcludedWebsites as $allExcludedWebsite) { + $customerGroupId = (int)$allExcludedWebsite['customer_group_id']; + $websiteId = (int)$allExcludedWebsite['website_id']; + $excludedWebsites[$customerGroupId][] = $websiteId; + } + } + + return $excludedWebsites; + } + + /** + * @inheritdoc + */ + public function delete(int $customerGroupId): bool + { + try { + $this->groupExcludedWebsiteResourceModel->delete($customerGroupId); + } catch (LocalizedException $e) { + throw new LocalizedException( + __('Could not delete customer group with its excluded websites.') + ); + } + + return true; + } + + /** + * @inheritdoc + */ + public function deleteByWebsite(int $websiteId): bool + { + try { + return (bool)$this->groupExcludedWebsiteResourceModel->deleteByWebsite($websiteId); + } catch (LocalizedException $e) { + throw new LocalizedException( + __('Could not delete customer group excluded website by id.') + ); + } + } +} diff --git a/app/code/Magento/Customer/Model/ResourceModel/GroupRepository.php b/app/code/Magento/Customer/Model/ResourceModel/GroupRepository.php index 10979cd9cc22..1ad002d5f431 100644 --- a/app/code/Magento/Customer/Model/ResourceModel/GroupRepository.php +++ b/app/code/Magento/Customer/Model/ResourceModel/GroupRepository.php @@ -134,6 +134,15 @@ public function save(\Magento\Customer\Api\Data\GroupInterface $group) $taxClassId = $group->getTaxClassId() ?: self::DEFAULT_TAX_CLASS_ID; $this->_verifyTaxClassModel($taxClassId, $group); $groupModel->setTaxClassId($taxClassId); + + $groupDataAttributes = $this->dataObjectProcessor->buildOutputDataArray( + $group, + \Magento\Customer\Api\Data\GroupInterface::class + ); + + if (!empty($groupDataAttributes['extension_attributes'])) { + $groupModel->setDataUsingMethod('extension_attributes', $groupDataAttributes['extension_attributes']); + } } try { diff --git a/app/code/Magento/Customer/Model/Webapi/ParamOverriderCustomerGroupId.php b/app/code/Magento/Customer/Model/Webapi/ParamOverriderCustomerGroupId.php new file mode 100644 index 000000000000..346be97dc19c --- /dev/null +++ b/app/code/Magento/Customer/Model/Webapi/ParamOverriderCustomerGroupId.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Webapi; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Framework\Webapi\Rest\Request\ParamOverriderInterface; + +/** + * Replaces a "%customer_group_id%" value with the real customer id + */ +class ParamOverriderCustomerGroupId implements ParamOverriderInterface +{ + /** + * @var UserContextInterface + */ + private $userContext; + + /** + * @var CustomerRepositoryInterface + */ + private $customerRepository; + + /** + * @param UserContextInterface $userContext + * @param CustomerRepositoryInterface $customerRepository + */ + public function __construct(UserContextInterface $userContext, CustomerRepositoryInterface $customerRepository) + { + $this->userContext = $userContext; + $this->customerRepository = $customerRepository; + } + + /** + * @inheritDoc + */ + public function getOverriddenValue() + { + if ((int) $this->userContext->getUserType() === UserContextInterface::USER_TYPE_CUSTOMER) { + return $this->customerRepository->getById($this->userContext->getUserId())->getGroupId(); + } + + return null; + } +} diff --git a/app/code/Magento/Customer/Model/Webapi/ParamOverriderCustomerStoreId.php b/app/code/Magento/Customer/Model/Webapi/ParamOverriderCustomerStoreId.php new file mode 100644 index 000000000000..c7a2eb20be9c --- /dev/null +++ b/app/code/Magento/Customer/Model/Webapi/ParamOverriderCustomerStoreId.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Webapi; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Framework\Webapi\Rest\Request\ParamOverriderInterface; + +/** + * Replaces a "%customer_store_id%" value with the real customer id + */ +class ParamOverriderCustomerStoreId implements ParamOverriderInterface +{ + /** + * @var UserContextInterface + */ + private $userContext; + + /** + * @var CustomerRepositoryInterface + */ + private $customerRepository; + + /** + * @param UserContextInterface $userContext + * @param CustomerRepositoryInterface $customerRepository + */ + public function __construct(UserContextInterface $userContext, CustomerRepositoryInterface $customerRepository) + { + $this->userContext = $userContext; + $this->customerRepository = $customerRepository; + } + + /** + * @inheritDoc + */ + public function getOverriddenValue() + { + if ((int) $this->userContext->getUserType() === UserContextInterface::USER_TYPE_CUSTOMER) { + return $this->customerRepository->getById($this->userContext->getUserId())->getStoreId(); + } + + return null; + } +} diff --git a/app/code/Magento/Customer/Model/Webapi/ParamOverriderCustomerWebsiteId.php b/app/code/Magento/Customer/Model/Webapi/ParamOverriderCustomerWebsiteId.php new file mode 100644 index 000000000000..975493797208 --- /dev/null +++ b/app/code/Magento/Customer/Model/Webapi/ParamOverriderCustomerWebsiteId.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Webapi; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Framework\Webapi\Rest\Request\ParamOverriderInterface; + +/** + * Replaces a "%customer_website_id%" value with the real customer id + */ +class ParamOverriderCustomerWebsiteId implements ParamOverriderInterface +{ + /** + * @var UserContextInterface + */ + private $userContext; + + /** + * @var CustomerRepositoryInterface + */ + private $customerRepository; + + /** + * @param UserContextInterface $userContext + * @param CustomerRepositoryInterface $customerRepository + */ + public function __construct(UserContextInterface $userContext, CustomerRepositoryInterface $customerRepository) + { + $this->userContext = $userContext; + $this->customerRepository = $customerRepository; + } + + /** + * @inheritDoc + */ + public function getOverriddenValue() + { + if ((int) $this->userContext->getUserType() === UserContextInterface::USER_TYPE_CUSTOMER) { + return $this->customerRepository->getById($this->userContext->getUserId())->getWebsiteId(); + } + + return null; + } +} diff --git a/app/code/Magento/Customer/Observer/CatalogRule/AddCustomerGroupExcludedWebsite.php b/app/code/Magento/Customer/Observer/CatalogRule/AddCustomerGroupExcludedWebsite.php new file mode 100644 index 000000000000..019c63d78f3b --- /dev/null +++ b/app/code/Magento/Customer/Observer/CatalogRule/AddCustomerGroupExcludedWebsite.php @@ -0,0 +1,69 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Observer\CatalogRule; + +use Magento\Customer\Api\GroupExcludedWebsiteRepositoryInterface; +use Magento\Framework\Event\Observer; +use Magento\Framework\Event\ObserverInterface; +use Magento\Framework\Exception\LocalizedException; + +/** + * Add excluded customer group websites to catalog rule. + */ +class AddCustomerGroupExcludedWebsite implements ObserverInterface +{ + /** + * @var GroupExcludedWebsiteRepositoryInterface + */ + private $customerGroupExcludedWebsiteRepository; + + /** + * @param GroupExcludedWebsiteRepositoryInterface $customerGroupExcludedWebsiteRepository + */ + public function __construct( + GroupExcludedWebsiteRepositoryInterface $customerGroupExcludedWebsiteRepository + ) { + $this->customerGroupExcludedWebsiteRepository = $customerGroupExcludedWebsiteRepository; + } + + /** + * Add excluded customer group websites to catalog rule as extension attributes. + * + * @param Observer $observer + * @return void + * @throws LocalizedException + */ + public function execute(\Magento\Framework\Event\Observer $observer): void + { + $catalogRule = $observer->getData('catalog_rule'); + $rules = $catalogRule->getItems(); + if (!empty($rules)) { + $allExcludedWebsiteIds = $this->customerGroupExcludedWebsiteRepository->getAllExcludedWebsites(); + if (!empty($allExcludedWebsiteIds)) { + foreach ($rules as $rule) { + if ($rule->getIsActive()) { + $excludedWebsites = []; + $customerGroupIds = $rule->getCustomerGroupIds(); + if (!empty($customerGroupIds)) { + foreach ($customerGroupIds as $customerGroupId) { + if (array_key_exists((int)$customerGroupId, $allExcludedWebsiteIds)) { + $excludedWebsites[$customerGroupId] = $allExcludedWebsiteIds[(int)$customerGroupId]; + } + } + if (!empty($excludedWebsites)) { + $ruleExtensionAttributes = $rule->getExtensionAttributes(); + $ruleExtensionAttributes->setExcludeWebsiteIds($excludedWebsites); + $rule->setExtensionAttributes($ruleExtensionAttributes); + } + } + } + } + } + } + } +} diff --git a/app/code/Magento/Customer/Observer/CustomerGroupAuthenticate.php b/app/code/Magento/Customer/Observer/CustomerGroupAuthenticate.php new file mode 100644 index 000000000000..063c4f057df2 --- /dev/null +++ b/app/code/Magento/Customer/Observer/CustomerGroupAuthenticate.php @@ -0,0 +1,62 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Observer; + +use Magento\Customer\Api\GroupExcludedWebsiteRepositoryInterface; +use Magento\Framework\Event\Observer; +use Magento\Framework\Event\ObserverInterface; +use Magento\Framework\Exception\LocalizedException; + +/** + * Customer group authenticate observer. + */ +class CustomerGroupAuthenticate implements ObserverInterface +{ + /** + * @var GroupExcludedWebsiteRepositoryInterface + */ + private $customerGroupExcludedWebsiteRepository; + + /** + * @var \Magento\Store\Model\StoreManagerInterface + */ + private $storeManager; + + /** + * @param GroupExcludedWebsiteRepositoryInterface $customerGroupExcludedWebsiteRepository + * @param \Magento\Store\Model\StoreManagerInterface $storeManager + */ + public function __construct( + GroupExcludedWebsiteRepositoryInterface $customerGroupExcludedWebsiteRepository, + \Magento\Store\Model\StoreManagerInterface $storeManager + ) { + $this->customerGroupExcludedWebsiteRepository = $customerGroupExcludedWebsiteRepository; + $this->storeManager = $storeManager; + } + + /** + * Do not authenticate customer if website is excluded from customer's group. + * + * @param Observer $observer + * @return void + * @throws LocalizedException + */ + public function execute(Observer $observer): void + { + $websiteId = $this->storeManager->getStore()->getWebsiteId(); + $customer = $observer->getData('model'); + if ($customer->getGroupId()) { + $excludedWebsites = $this->customerGroupExcludedWebsiteRepository->getCustomerGroupExcludedWebsites( + (int)$customer->getGroupId() + ); + if (in_array($websiteId, $excludedWebsites, true)) { + throw new LocalizedException(__('This website is excluded from customer\'s group.')); + } + } + } +} diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerSelectWebsiteGroupStoreActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerSelectWebsiteGroupStoreActionGroup.xml new file mode 100644 index 000000000000..8f8cf0ba85bd --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerSelectWebsiteGroupStoreActionGroup.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCustomerSelectWebsiteGroupStoreActionGroup"> + <annotations> + <description>Select Website, Group, Send Welcome Email From on the Customer creation/edit page Account Information Tab.</description> + </annotations> + <arguments> + <argument name="website" type="string"/> + <argument name="customerGroup" type="string"/> + <argument name="store" type="string"/> + </arguments> + <selectOption stepKey="selectWebSite" selector="{{AdminCustomerAccountInformationSection.associateToWebsite}}" userInput="{{website}}"/> + <click selector="{{AdminCustomerAccountInformationSection.group}}" stepKey="clickToExpandGroup"/> + <click selector="{{AdminCustomerAccountInformationSection.customerGroupOption(customerGroup)}}" stepKey="clickToSelectCustomerGroup"/> + <selectOption stepKey="selectStoreView" selector="{{AdminCustomerAccountInformationSection.storeView}}" userInput="{{store}}"/> + <waitForElement selector="{{AdminCustomerAccountInformationSection.storeView}}" stepKey="waitForCustomerStoreViewExpand"/> + <click stepKey="saveCustomer" selector="{{AdminCustomerAccountInformationSection.saveCustomer}}"/> + <waitForPageLoad stepKey="waitForCustomersPage"/> + <see stepKey="seeCustomerSaveSuccessMessage" userInput="You saved the customer."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerWishlistConfigureItemActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerWishlistConfigureItemActionGroup.xml new file mode 100644 index 000000000000..de126e6cc658 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerWishlistConfigureItemActionGroup.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCustomerWishlistConfigureItemActionGroup"> + <arguments> + <argument name="title" type="string" defaultValue="{{Attribute.label}}"/> + <argument name="option" type="string" defaultValue="option1"/> + <argument name="quantity" type="string" defaultValue="2"/> + <argument name="productName" type="string" defaultValue="{{ApiConfigurableProductWithOutCategory.name}}"/> + </arguments> + <click selector="{{AdminCustomerWishlistSection.configureButton(productName)}}" stepKey="clickConfigureButton"/> + <waitForElementVisible selector="{{AdminCustomerWishlistSection.productAttributeOptionsDropDown(title)}}" stepKey="waitForConfigurableOption"/> + <selectOption selector="{{AdminCustomerWishlistSection.productAttributeOptionsDropDown(title)}}" userInput="{{option}}" stepKey="selectConfigurableOption"/> + <fillField selector="{{AdminOrderFormConfigureProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQty"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="confirmSave"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertCustomerEditFormPasswordFieldActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertCustomerEditFormPasswordFieldActionGroup.xml new file mode 100644 index 000000000000..6548845994b2 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertCustomerEditFormPasswordFieldActionGroup.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertCustomerEditFormPasswordFieldActionGroup"> + <annotations> + <description>Validate the password is visible as plain text in customer account edit form.</description> + </annotations> + <arguments> + <argument name="passwordFieldType" type="string" defaultValue="text"/> + </arguments> + + <assertElementContainsAttribute stepKey="assertCurrentPasswordFieldType"> + <expectedResult selector="{{StorefrontCustomerAccountInformationSection.currentPassword}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult> + </assertElementContainsAttribute> + <assertElementContainsAttribute stepKey="assertNewPasswordFieldType"> + <expectedResult selector="{{StorefrontCustomerAccountInformationSection.newPassword}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult> + </assertElementContainsAttribute> + <assertElementContainsAttribute stepKey="assertConfirmNewPasswordFieldType"> + <expectedResult selector="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult> + </assertElementContainsAttribute> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertLoginFormPasswordFieldActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertLoginFormPasswordFieldActionGroup.xml new file mode 100644 index 000000000000..5882dd0ac80e --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertLoginFormPasswordFieldActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertLoginFormPasswordFieldActionGroup"> + <annotations> + <description>Validate the password is visible as plain text in login form.</description> + </annotations> + <arguments> + <argument name="passwordFieldType" type="string" defaultValue="text"/> + </arguments> + + <assertElementContainsAttribute stepKey="assertPasswordFieldType"> + <expectedResult selector="{{StorefrontCustomerSignInFormSection.passwordField}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult> + </assertElementContainsAttribute> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertRegistrationFormPasswordFieldActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertRegistrationFormPasswordFieldActionGroup.xml new file mode 100644 index 000000000000..d5efbf58dda1 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertRegistrationFormPasswordFieldActionGroup.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertRegistrationFormPasswordFieldActionGroup"> + <annotations> + <description>Validate the password is visible as plain text on customer registration form.</description> + </annotations> + <arguments> + <argument name="passwordFieldType" type="string" defaultValue="text"/> + </arguments> + + <assertElementContainsAttribute stepKey="assertPasswordFieldType"> + <expectedResult selector="{{StorefrontCustomerCreateFormSection.passwordField}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult> + </assertElementContainsAttribute> + <assertElementContainsAttribute stepKey="assertConfirmPasswordFieldType"> + <expectedResult selector="{{StorefrontCustomerCreateFormSection.confirmPasswordField}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult> + </assertElementContainsAttribute> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStorefrontCustomWelcomeMessageActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStorefrontCustomWelcomeMessageActionGroup.xml new file mode 100644 index 000000000000..966529d280cf --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStorefrontCustomWelcomeMessageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontCustomWelcomeMessageActionGroup"> + <annotations> + <description>Validates that the custom Welcome message is present on storefront header.</description> + </annotations> + <arguments> + <argument name="customMessage" type="string" defaultValue="Welcome to "Food & Drinks" store"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" stepKey="waitForWelcomeMessage"/> + <see userInput="{{customMessage}}" selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" stepKey="verifyCustomMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAddCustomerDefaultAddressActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAddCustomerDefaultAddressActionGroup.xml index ce26d14bb95f..0624f14006a2 100644 --- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAddCustomerDefaultAddressActionGroup.xml +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAddCustomerDefaultAddressActionGroup.xml @@ -27,6 +27,7 @@ <fillField stepKey="fillZip" userInput="{{Address.postcode}}" selector="{{StorefrontCustomerAddressFormSection.zip}}"/> <selectOption stepKey="selectCountry" userInput="{{Address.country}}" selector="{{StorefrontCustomerAddressFormSection.country}}"/> <click stepKey="checkUseAsDefaultBillingAddressCheckBox" selector="{{StorefrontCustomerAddressFormSection.useAsDefaultBillingAddressCheckBox}}"/> + <scrollTo selector="{{StorefrontCustomerAddressFormSection.useAsDefaultShippingAddressCheckBox}}" stepKey="scrollToUseAsDefaultShippingAddressCheckbox"/> <click stepKey="checkUseAsDefaultShippingAddressCheckBox" selector="{{StorefrontCustomerAddressFormSection.useAsDefaultShippingAddressCheckBox}}"/> <click stepKey="saveCustomerAddress" selector="{{StorefrontCustomerAddressFormSection.saveAddress}}"/> <waitForPageLoad stepKey="waitForPageLoad"/> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAssertCustomerSidebarItemIsPresentActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAssertCustomerSidebarItemIsPresentActionGroup.xml new file mode 100644 index 000000000000..4815077e8dd7 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAssertCustomerSidebarItemIsPresentActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontAssertCustomerSidebarItemIsPresentActionGroup"> + <arguments> + <argument name="itemName" type="string"/> + </arguments> + <see userInput="{{itemName}}" selector="{{StorefrontCustomerSidebarSection.sidebarTab(itemName)}}" stepKey="seeElement"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickPrintOrderLinkOnViewOrderPageActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickPrintOrderLinkOnViewOrderPageActionGroup.xml new file mode 100644 index 000000000000..cbe227c1809f --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickPrintOrderLinkOnViewOrderPageActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontClickPrintOrderLinkOnViewOrderPageActionGroup"> + <annotations> + <description>Clicks the "Print Order" link on the My Account->My Orders->Order View page</description> + </annotations> + + <click selector="{{StorefrontCustomerOrderViewSection.printOrderLink}}" stepKey="clickPrintOrderLink"/> + <waitForPageLoad stepKey="waitForPageLoaded"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup.xml new file mode 100644 index 000000000000..232667cd9a8e --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup"> + <annotations> + <description>Clicks the top "View Order" link on the My Account->My Orders page</description> + </annotations> + + <click selector="{{StorefrontCustomerOrderSection.viewOrder}}" stepKey="clickViewOrder"/> + <waitForPageLoad stepKey="waitForPageLoaded"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerAddressFormCheckDefaultShippingActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerAddressFormCheckDefaultShippingActionGroup.xml new file mode 100644 index 000000000000..6b9725de7e19 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerAddressFormCheckDefaultShippingActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontCustomerAddressFormCheckDefaultShippingActionGroup"> + <annotations> + <description>Check default chipping address checkbox.</description> + </annotations> + <checkOption selector="{{StorefrontCustomerAddressFormSection.useAsDefaultShippingAddressCheckBox}}" stepKey="checkUseAsDefaultShippingAddressCheckBox"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerEditFormClickShowPasswordActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerEditFormClickShowPasswordActionGroup.xml new file mode 100644 index 000000000000..b5c73b02be20 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerEditFormClickShowPasswordActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontCustomerEditFormClickShowPasswordActionGroup"> + <annotations> + <description>Click on the show password checkbox in customer account information form</description> + </annotations> + + <click stepKey="clickShowPasswordCheckbox" selector="{{StorefrontCustomerAccountInformationSection.showPasswordCheckbox}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontEditCustomerPasswordActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontEditCustomerPasswordActionGroup.xml new file mode 100644 index 000000000000..9cc53dc0c525 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontEditCustomerPasswordActionGroup.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontEditCustomerPasswordActionGroup"> + <arguments> + <argument name="currentPassword" type="string"/> + <argument name="newPassword" type="string"/> + </arguments> + + <checkOption selector="{{StorefrontCustomerAccountInformationSection.changePassword}}" stepKey="clickChangePasswordCheckbox"/> + <fillField selector="{{StorefrontCustomerAccountInformationSection.currentPassword}}" userInput="{{currentPassword}}" stepKey="fillCurrentPassword"/> + <fillField selector="{{StorefrontCustomerAccountInformationSection.newPassword}}" userInput="{{newPassword}}" stepKey="fillNewPassword"/> + <fillField selector="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}" userInput="{{newPassword}}" stepKey="confirmNewPassword"/> + <click selector="{{StorefrontCustomerAccountInformationSection.saveButton}}" stepKey="saveChange"/> + <waitForPageLoad stepKey="waitForPageLoaded"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillChangePasswordFormActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillChangePasswordFormActionGroup.xml new file mode 100644 index 000000000000..2c8f16db8987 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillChangePasswordFormActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontFillChangePasswordFormActionGroup"> + <annotations> + <description>Fills in the provided Customer details on the Storefront Customer change password form.</description> + </annotations> + <arguments> + <argument name="customer" type="entity"/> + </arguments> + + <fillField stepKey="fillCurrentPassword" userInput="{{customer.password}}" selector="{{StorefrontCustomerAccountInformationSection.currentPassword}}"/> + <fillField stepKey="fillNewPassword" userInput="{{customer.password}}" selector="{{StorefrontCustomerAccountInformationSection.newPassword}}"/> + <fillField stepKey="fillNewConfirmPassword" userInput="{{customer.password}}" selector="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillCustomerAddressFormActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillCustomerAddressFormActionGroup.xml new file mode 100644 index 000000000000..c0faf297f35c --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillCustomerAddressFormActionGroup.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontFillCustomerAddressFormActionGroup"> + <annotations> + <description>Fills address data in storefront customer address edit form.</description> + </annotations> + <arguments> + <argument name="Address"/> + </arguments> + <fillField userInput="{{Address.firstname}}" selector="{{StorefrontCustomerAddressFormSection.firstName}}" stepKey="fillFirstName"/> + <fillField userInput="{{Address.lastname}}" selector="{{StorefrontCustomerAddressFormSection.lastName}}" stepKey="fillLastName"/> + <fillField userInput="{{Address.company}}" selector="{{StorefrontCustomerAddressFormSection.company}}" stepKey="fillCompanyName"/> + <fillField userInput="{{Address.telephone}}" selector="{{StorefrontCustomerAddressFormSection.phoneNumber}}" stepKey="fillPhoneNumber"/> + <fillField userInput="{{Address.street[0]}}" selector="{{StorefrontCustomerAddressFormSection.streetAddress}}" stepKey="fillStreetAddress"/> + <fillField userInput="{{Address.city}}" selector="{{StorefrontCustomerAddressFormSection.city}}" stepKey="fillCity"/> + <selectOption userInput="{{Address.state}}" selector="{{StorefrontCustomerAddressFormSection.state}}" stepKey="selectState"/> + <fillField userInput="{{Address.postcode}}" selector="{{StorefrontCustomerAddressFormSection.zip}}" stepKey="fillZip"/> + <selectOption userInput="{{Address.country}}" selector="{{StorefrontCustomerAddressFormSection.country}}" stepKey="selectCountry"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup.xml new file mode 100644 index 000000000000..8bd192b593ad --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup"> + <annotations> + <description>Goes to the Storefront Customer Sign In page. Logs in using the provided Customer.</description> + </annotations> + <arguments> + <argument name="Customer"/> + </arguments> + + <click selector="{{StorefrontCustomerSignInFormSection.signInAccountLink}}" stepKey="clickSignInAccountLink"/> + <waitForPageLoad time="30" stepKey="waitPageFullyLoaded"/> + <waitForElementVisible selector="{{StorefrontCustomerSignInFormSection.emailField}}" stepKey="waitFormAppears"/> + <fillField userInput="{{Customer.email}}" selector="{{StorefrontCustomerSignInFormSection.emailField}}" stepKey="fillEmail"/> + <fillField userInput="{{Customer.password}}" selector="{{StorefrontCustomerSignInFormSection.passwordField}}" stepKey="fillPassword"/> + <click selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}" stepKey="clickSignInAccountButton"/> + <waitForPageLoad stepKey="waitForCustomerLoggedIn"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontLoginFormClickShowPasswordActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontLoginFormClickShowPasswordActionGroup.xml new file mode 100644 index 000000000000..cec52b88dbac --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontLoginFormClickShowPasswordActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontLoginFormClickShowPasswordActionGroup"> + <annotations> + <description>Click on the show password checkbox in login form</description> + </annotations> + + <click stepKey="clickShowPasswordCheckbox" selector="{{StorefrontCustomerSignInFormSection.showPasswordCheckbox}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontNavigateToMyProductReviewsPageActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontNavigateToMyProductReviewsPageActionGroup.xml new file mode 100644 index 000000000000..e26f71f40c9a --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontNavigateToMyProductReviewsPageActionGroup.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontNavigateToMyProductReviewsPageActionGroup"> + <amOnPage url="{{StorefrontCustomerProductReviewsPage.url}}" stepKey="goToMyProductReviewsPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontOpenCustomerChangePasswordPageActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontOpenCustomerChangePasswordPageActionGroup.xml new file mode 100644 index 000000000000..aebcfc6f488e --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontOpenCustomerChangePasswordPageActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontOpenCustomerChangePasswordPageActionGroup"> + <annotations> + <description>Goes to the Storefront Customer Change Password page.</description> + </annotations> + + <amOnPage url="{{StorefrontCustomerAccountChangePasswordPage.url}}" stepKey="goToCustomerAccountChangePasswordPage"/> + <waitForPageLoad stepKey="waitForPageLoaded"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontOpenNewCustomerAddressFormActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontOpenNewCustomerAddressFormActionGroup.xml new file mode 100644 index 000000000000..c3c85ac92557 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontOpenNewCustomerAddressFormActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontOpenNewCustomerAddressFormActionGroup"> + <annotations> + <description>Open new customer address form on storefront.</description> + </annotations> + <amOnPage url="customer/address/new/" stepKey="OpenCustomerAddNewAddress"/> + <waitForPageLoad stepKey="waitForCustomerAddNewAddress"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontRegistrationFormClickShowPasswordActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontRegistrationFormClickShowPasswordActionGroup.xml new file mode 100644 index 000000000000..6e441aee9d63 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontRegistrationFormClickShowPasswordActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontRegistrationFormClickShowPasswordActionGroup"> + <annotations> + <description>Click on the show password checkbox in registration form</description> + </annotations> + + <click stepKey="clickShowPasswordCheckbox" selector="{{StorefrontCustomerCreateFormSection.showPasswordCheckbox}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontSaveCustomerAddressActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontSaveCustomerAddressActionGroup.xml new file mode 100644 index 000000000000..80264f989219 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontSaveCustomerAddressActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontSaveCustomerAddressActionGroup"> + <annotations> + <description>Clicks on the Save Address button. Validates that the Success Message is present.</description> + </annotations> + + <click selector="{{StorefrontCustomerAddressFormSection.saveAddress}}" stepKey="clickSaveAddress"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You saved the address." stepKey="assertSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontVerifyCustomerOrderProductRowDataActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontVerifyCustomerOrderProductRowDataActionGroup.xml new file mode 100644 index 000000000000..7ca1911570a5 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontVerifyCustomerOrderProductRowDataActionGroup.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontVerifyCustomerOrderProductRowDataActionGroup"> + <annotations> + <description>Verify a customer's order details for a product row on the view order page on the storefront</description> + </annotations> + <arguments> + <argument name="name" type="string"/> + <argument name="sku" type="string"/> + <argument name="price" type="string"/> + <argument name="quantity" type="string"/> + <argument name="subtotal" type="string"/> + <argument name="index" defaultValue="1" type="string"/> + </arguments> + <waitForText userInput="{{name}}" selector="{{StorefrontCustomerOrderViewSection.productNameByRow(index)}}" stepKey="seeProductName"/> + <waitForText userInput="{{sku}}" selector="{{StorefrontCustomerOrderViewSection.productSkuByRow(index)}}" stepKey="seeProductSku"/> + <waitForText userInput="{{price}}" selector="{{StorefrontCustomerOrderViewSection.productPriceByRow(index)}}" stepKey="seeProductPrice"/> + <waitForText userInput="{{quantity}}" selector="{{StorefrontCustomerOrderViewSection.productQuantityByRow(index)}}" stepKey="seeProductQuantity"/> + <waitForText userInput="{{subtotal}}" selector="{{StorefrontCustomerOrderViewSection.productSubtotalByRow(index)}}" stepKey="seeProductSubtotal"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml b/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml index e31be78185aa..1746a683ab0e 100644 --- a/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml +++ b/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml @@ -159,6 +159,7 @@ </array> <data key="city">London</data> <data key="country_id">GB</data> + <data key="country">United Kingdom</data> <data key="telephone">512-345-6789</data> <data key="province">JS</data> </entity> @@ -198,6 +199,9 @@ </array> <data key="state">California</data> </entity> + <entity name="US_With_Vat_Number" type="address" extends="US_Address_CA"> + <data key="vat_id">U1234567891</data> + </entity> <entity name="US_Default_Billing_Address_TX" type="address" extends="US_Address_TX"> <data key="default_billing">false</data> <data key="default_shipping">true</data> @@ -240,7 +244,7 @@ <data key="postcode">12345</data> </entity> <entity name="updateCustomerFranceAddress" type="address"> - <data key="firstname">Jaen</data> + <data key="firstname">Jean</data> <data key="lastname">Reno</data> <data key="company">Magento</data> <data key="telephone">555-888-111-999</data> @@ -376,4 +380,10 @@ <data key="postcode">6690</data> <data key="telephone">0477-58-77867</data> </entity> + <entity name="UK_With_State_Default_Billing" extends="UK_Not_Default_Address"> + <requiredEntity type="region">RegionUKGL</requiredEntity> + <data key="country">United Kingdom</data> + <data key="state">Greater London</data> + <data key="default_billing">Yes</data> + </entity> </entities> diff --git a/app/code/Magento/Customer/Test/Mftf/Data/AdminAddressTemplateData.xml b/app/code/Magento/Customer/Test/Mftf/Data/AdminAddressTemplateData.xml new file mode 100644 index 000000000000..806b878c653e --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Data/AdminAddressTemplateData.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="templateTypeHtml"> + <data key="templateType">html</data> + </entity> + <entity name="templateTypeOneLine"> + <data key="templateType">oneline</data> + </entity> + <entity name="templateTypeText"> + <data key="templateType">text</data> + </entity> +</entities> diff --git a/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml b/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml index 5db0b8f5581d..61597317824c 100644 --- a/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml +++ b/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml @@ -7,7 +7,7 @@ --> <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <entity name="CustomerEntityOne" type="customer"> <data key="group_id">1</data> <data key="default_billing">defaultBillingValue</data> @@ -72,10 +72,10 @@ <data key="store_id">0</data> <data key="website_id">0</data> <requiredEntity type="address">US_Address_TX</requiredEntity> - <var entityType="customerGroup" entityKey="id" key="group_id" /> + <var entityType="customerGroup" entityKey="id" key="group_id"/> </entity> <entity name="UsCustomerAssignedToNewCustomerGroup" type="customer"> - <var key="group_id" entityKey="id" entityType="customerGroup" /> + <var key="group_id" entityKey="id" entityType="customerGroup"/> <data key="default_billing">true</data> <data key="default_shipping">true</data> <data key="email" unique="prefix">John.Doe@example.com</data> @@ -100,6 +100,20 @@ <data key="website_id">0</data> <requiredEntity type="address">US_Address_TX</requiredEntity> </entity> + <entity name="Simple_US_Customer_Nbsp_In_Email" type="customer"> + <data key="group_id">1</data> + <data key="default_billing">true</data> + <data key="default_shipping">true</data> + <data key="email" unique="prefix">John.Doe@example.com  </data> + <data key="firstname">John</data> + <data key="lastname">Doe</data> + <data key="fullname">John Doe</data> + <data key="password">pwdTest123!</data> + <data key="store_id">0</data> + <data key="website_id">0</data> + <data key="group">General</data> + <requiredEntity type="address">US_Address_TX</requiredEntity> + </entity> <entity name="Simple_Customer_Without_Address" type="customer"> <data key="group_id">1</data> <data key="email" unique="prefix">John.Doe@example.com</data> @@ -110,6 +124,32 @@ <data key="store_id">0</data> <data key="website_id">0</data> </entity> + <entity name="FrenchCustomerOneAssignedToNewCustomerGroup" type="customer"> + <var key="group_id" entityKey="id" entityType="customerGroup"/> + <data key="default_billing">true</data> + <data key="default_shipping">true</data> + <data key="email" unique="prefix">Alain.Delon@example.com</data> + <data key="firstname">Alain</data> + <data key="lastname">Delon</data> + <data key="fullname">Alain Delon</data> + <data key="password">pwdTest123!</data> + <data key="store_id">0</data> + <data key="website_id">0</data> + <requiredEntity type="address">updateCustomerFranceAddress</requiredEntity> + </entity> + <entity name="FrenchCustomerTwoAssignedToNewCustomerGroup" type="customer"> + <var key="group_id" entityKey="id" entityType="customerGroup"/> + <data key="default_billing">true</data> + <data key="default_shipping">true</data> + <data key="email" unique="prefix">Jean.Reno@example.com</data> + <data key="firstname">Jean</data> + <data key="lastname">Reno</data> + <data key="fullname">Jean Reno</data> + <data key="password">pwdTest123!</data> + <data key="store_id">0</data> + <data key="website_id">0</data> + <requiredEntity type="address">updateCustomerFranceAddress</requiredEntity> + </entity> <entity name="Simple_US_Customer_Multiple_Addresses" type="customer"> <data key="group_id">1</data> <data key="default_billing">true</data> @@ -233,6 +273,9 @@ <data key="website_id">0</data> <requiredEntity type="address">UK_Not_Default_Address</requiredEntity> </entity> + <entity name="Customer_With_Vat_Number" type="customer" extends="Simple_Customer_Without_Address"> + <requiredEntity type="address">US_With_Vat_Number</requiredEntity> + </entity> <entity name="Customer_With_Different_Default_Billing_Shipping_Addresses" type="customer"> <data key="group_id">1</data> <data key="email" unique="prefix">John.Doe@example.com</data> @@ -395,4 +438,9 @@ <requiredEntity type="address">US_Address_CA</requiredEntity> <requiredEntity type="address">US_Address_NY_Not_Default_Address</requiredEntity> </entity> + <entity name="Customer_UK_US" type="customer" extends="Simple_GB_Customer"> + <data key="country">United Kingdom</data> + <requiredEntity type="address">UK_With_State_Default_Billing</requiredEntity> + <requiredEntity type="address">US_Address_NY_Default_Shipping</requiredEntity> + </entity> </entities> diff --git a/app/code/Magento/Customer/Test/Mftf/Data/RegionData.xml b/app/code/Magento/Customer/Test/Mftf/Data/RegionData.xml index 0a956f16767b..7f2ea38a6ab8 100644 --- a/app/code/Magento/Customer/Test/Mftf/Data/RegionData.xml +++ b/app/code/Magento/Customer/Test/Mftf/Data/RegionData.xml @@ -37,4 +37,7 @@ <data key="region_code">AFE</data> <data key="region_id">9</data> </entity> + <entity name="RegionUKGL" type="region"> + <data key="region">Greater London</data> + </entity> </entities> diff --git a/app/code/Magento/Customer/Test/Mftf/Page/AdminCustomerConfigPage.xml b/app/code/Magento/Customer/Test/Mftf/Page/AdminCustomerConfigPage.xml index 282f9bb6fdeb..774ee294bd3f 100644 --- a/app/code/Magento/Customer/Test/Mftf/Page/AdminCustomerConfigPage.xml +++ b/app/code/Magento/Customer/Test/Mftf/Page/AdminCustomerConfigPage.xml @@ -8,5 +8,6 @@ <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="AdminCustomerConfigPage" url="admin/system_config/edit/section/customer/{{tabLink}}" area="admin" parameterized="true" module="Magento_Customer"> <section name="AdminCustomerConfigSection"/> + <section name="AdminCustomerConfigAddressTemplateSection"/> </page> </pages> diff --git a/app/code/Magento/Customer/Test/Mftf/Page/AdminEditCustomerGroupPage.xml b/app/code/Magento/Customer/Test/Mftf/Page/AdminEditCustomerGroupPage.xml new file mode 100644 index 000000000000..078b63037cd8 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Page/AdminEditCustomerGroupPage.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="AdminEditCustomerGroupPage" url="/customer/group/edit/id/{{var1}}" area="admin" module="Magento_Customer"> + <section name="AdminEditCustomerGroupSection"/> + </page> +</pages> diff --git a/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerProductReviewsPage.xml b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerProductReviewsPage.xml new file mode 100644 index 000000000000..616774f96ec4 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerProductReviewsPage.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="StorefrontCustomerProductReviewsPage" url="/review/customer/" area="storefront" module="Magento_Customer"> + </page> +</pages> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAccountInformationSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAccountInformationSection.xml index 50e923d9b32c..1752cb6d04c3 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAccountInformationSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAccountInformationSection.xml @@ -14,6 +14,7 @@ <element name="accountInformationTitle" type="text" selector=".admin__page-nav-title"/> <element name="accountInformationButton" type="text" selector="//a/span[text()='Account Information']"/> <element name="addressesButton" type="select" selector="//a//span[contains(text(), 'Addresses')]"/> + <element name="customerGroupOption" type="text" selector="//label/span[text()='{{groupValue}}']|//select/option[text()='{{groupValue}}']" parameterized="true"/> <element name="firstName" type="input" selector="input[name='customer[firstname]']"/> <element name="lastName" type="input" selector="input[name='customer[lastname]']"/> <element name="email" type="input" selector="input[name='customer[email]']"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerFiltersSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerFiltersSection.xml index 17a4a283c264..f90a01a56841 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerFiltersSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerFiltersSection.xml @@ -19,5 +19,6 @@ <element name="viewDropdown" type="button" selector=".admin__data-grid-action-bookmarks button.admin__action-dropdown"/> <element name="viewBookmark" type="button" selector="//div[contains(@class, 'admin__data-grid-action-bookmarks')]/ul/li/div/a[text() = '{{label}}']" parameterized="true" timeout="30"/> <element name="countryOptions" type="button" selector=".admin__data-grid-filters select[name=billing_country_id] option"/> + <element name="websiteOptions" type="button" selector=".admin__data-grid-filters select[name=website_id] option"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerWishlistSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerWishlistSection.xml index 39a67968c66e..0a44149cb067 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerWishlistSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerWishlistSection.xml @@ -14,5 +14,8 @@ <element name="deleteButton" type="text" selector="//*[@id='wishlistGrid_table']//*[@data-column='action']//*[text()='Delete']"/> <element name="deleteConfirm" type="button" selector=".modal-popup.confirm .action-primary.action-accept"/> <element name="gridTable" type="text" selector="#wishlistGrid_table"/> + <element name="configureButton" type="text" selector="//table[@id='wishlistGrid_table']//tbody//td[@data-column='product_name' and contains(text(),'{{productName}}')]/parent::tr//td[@data-column='action']//a[@class='configure-item-link']" timeout="30" parameterized="true"/> + <element name="productAttributeOptionsDropDown" type="text" selector="//label[contains(.,'{{var1}}')]/following::div[contains(@class,'control')]//select" parameterized="true"/> + <element name="productQty" type="text" selector="table#wishlistGrid_table td.col-number[data-column=qty]"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerGroupSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerGroupSection.xml index 917af88338d2..e9d988911a61 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerGroupSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerGroupSection.xml @@ -9,6 +9,13 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminEditCustomerGroupSection"> + <element name="groupName" type="input" selector="#customer_group_code"/> + <element name="taxClass" type="select" selector="#tax_class_id"/> + <element name="saveCustomerGroup" type="button" selector="#save"/> + <element name="resetBtn" type="button" selector="#reset"/> + <element name="backBtn" type="button" selector="#back"/> + <element name="excludeWebsite" type="multiselect" selector="#customer_group_excluded_website_ids"/> + <element name="selectedExcludedWebsites" type="multiselect" selector="//select[@id='customer_group_excluded_website_ids']/option[contains(@selected, 'selected')]"/> <element name="deleteButton" type="button" selector=".page-actions-buttons button#delete"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml index 9828c42211e4..abb61d2dd0be 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml @@ -18,6 +18,7 @@ <element name="currentPassword" type="input" selector="#current-password"/> <element name="newPassword" type="input" selector="#password"/> <element name="confirmNewPassword" type="input" selector="#password-confirmation"/> + <element name="showPasswordCheckbox" type="input" selector="#show-password"/> <element name="confirmNewPasswordError" type="text" selector="#password-confirmation-error"/> <element name="email" type="input" selector=".form-edit-account input[name='email']" /> <element name="emailErrorMessage" type="text" selector="#email-error"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressFormSection.xml index 112ced1bc375..5b111489a841 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressFormSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressFormSection.xml @@ -21,5 +21,6 @@ <element name="useAsDefaultBillingAddressCheckBox" type="input" selector="//form[@class='form-address-edit']//input[@name='default_billing']"/> <element name="useAsDefaultShippingAddressCheckBox" type="input" selector="//form[@class='form-address-edit']//input[@name='default_shipping']"/> <element name="saveAddress" type="button" selector="//button[@title='Save Address']" timeout="30"/> + <element name="formTitle" type="text" selector="//h1[@class='page-title']/span[text() = 'Edit Address']" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressesSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressesSection.xml index dee62070ab9b..0b0625a08421 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressesSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressesSection.xml @@ -18,7 +18,7 @@ <element name="addressesList" type="text" selector=".additional-addresses" /> <element name="deleteAdditionalAddress" type="button" selector="//tbody//tr[{{var}}]//a[@class='action delete']" parameterized="true"/> <element name="editAdditionalAddress" type="button" selector="//tbody//tr[{{var}}]//a[@class='action edit']" parameterized="true" timeout="30"/> - <element name="addNewAddress" type="button" selector="//span[text()='Add New Address']"/> + <element name="addNewAddress" type="button" selector="//span[text()='Add New Address']" timeout="30"/> <element name="numberOfAddresses" type="text" selector=".toolbar-number"/> <element name="shippingAddress" type="text" selector="//div[contains(@class,'box box-shipping-address')]//div/address"/> <element name="billingAddress" type="text" selector="//div[contains(@class,'box box-billing-address')]//div/address"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StoreFrontCustomerAdvancedAttributesSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StoreFrontCustomerAdvancedAttributesSection.xml index d03e08810480..099c8da06552 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StoreFrontCustomerAdvancedAttributesSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StoreFrontCustomerAdvancedAttributesSection.xml @@ -22,5 +22,7 @@ <element name="attributeLabel" type="text" selector="//span[text()='{{attributeLabel}}']" parameterized="true"/> <element name="fileAttribute" type="file" selector="//input[@type='file' and @name='{{attributeCode}}']" parameterized="true" timeout="30"/> <element name="customFileAttributeUploadButton" type="input" selector=".file-uploader-area input[name='{{attributeCode}}'] ~ .file-uploader-button" parameterized="true"/> + <element name="fileUploaderPreviewLink" type="block" selector="//input[@type='file' and @name='{{attributeCode}}']/ancestor::div[contains(@class, 'file-uploader')]//div[contains(@class, 'file-uploader-preview')]//a[contains(@class, 'preview-link')]" parameterized="true"/> + <element name="fileUploaderPreviewImage" type="block" selector="//input[@type='file' and @name='{{attributeCode}}']/ancestor::div[contains(@class, 'file-uploader')]//div[contains(@class, 'file-uploader-preview')]//img" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StorefrontCustomerCreateFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StorefrontCustomerCreateFormSection.xml index 6b65ef861472..ead385d6e6dd 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StorefrontCustomerCreateFormSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StorefrontCustomerCreateFormSection.xml @@ -16,6 +16,7 @@ <element name="emailField" type="input" selector="#email_address"/> <element name="passwordField" type="input" selector="#password"/> <element name="confirmPasswordField" type="input" selector="#password-confirmation"/> + <element name="showPasswordCheckbox" type="input" selector="#show-password"/> <element name="createAccountButton" type="button" selector="button.action.submit.primary" timeout="30"/> <element name="passwordErrorMessages" type="text" selector="#password-error"/> </section> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerDashboardAccountInformationSection/StorefrontCustomerAddressSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerDashboardAccountInformationSection/StorefrontCustomerAddressSection.xml index c1e0ac6573be..533a1d91b9c7 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerDashboardAccountInformationSection/StorefrontCustomerAddressSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerDashboardAccountInformationSection/StorefrontCustomerAddressSection.xml @@ -19,6 +19,7 @@ <element name="stateProvinceFill" type="input" selector="#region"/> <element name="zip" type="input" selector="#zip"/> <element name="country" type="select" selector="#country"/> + <element name="vatId" type="input" selector="#vat_id"/> <element name="saveAddress" type="button" selector="[data-action='save-address']" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml index 42c6f5cea082..4eb5e8aa0240 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml @@ -21,6 +21,12 @@ <element name="createdDate" type="text" selector=".block-order-details-comments .comment-date"/> <element name="orderPlacedBy" type="text" selector=".block-order-details-comments .comment-content"/> <element name="productName" type="text" selector="//td[@data-th='Product Name']"/> + <element name="productRows" type="text" selector="#my-orders-table tbody tr"/> + <element name="productNameByRow" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{index}}) td.name"/> + <element name="productSkuByRow" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{index}}) td.sku"/> + <element name="productPriceByRow" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{index}}) td.price"/> + <element name="productQuantityByRow" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{index}}) td.qty"/> + <element name="productSubtotalByRow" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{index}}) td.subtotal"/> <element name="grandTotal" type="text" selector="//tr[@class='grand_total']//td[@data-th='Grand Total']"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection/StorefrontCustomerSignInFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection/StorefrontCustomerSignInFormSection.xml index 2e40610c18f8..5497ed9950a6 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection/StorefrontCustomerSignInFormSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection/StorefrontCustomerSignInFormSection.xml @@ -10,8 +10,10 @@ <section name="StorefrontCustomerSignInFormSection"> <element name="emailField" type="input" selector="#email"/> <element name="passwordField" type="input" selector="#pass"/> + <element name="showPasswordCheckbox" type="input" selector="#show-password"/> <element name="signInAccountButton" type="button" selector="#send2" timeout="30"/> <element name="forgotPasswordLink" type="button" selector=".action.remind" timeout="10"/> <element name="customerLoginBlock" type="text" selector=".login-container .block.block-customer-login"/> + <element name="signInAccountLink" type="button" selector="//header[@class='page-header']//li/a[contains(.,'Sign In')]"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsNoTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsNoTest.xml index 6aec5440193a..543f26a1aaf6 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsNoTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsNoTest.xml @@ -20,9 +20,7 @@ </annotations> <before> <magentoCLI command="config:set customer/create_account/viv_disable_auto_group_assign_default 0" stepKey="setConfigDefaultIsNo"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> </before> <after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsYesTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsYesTest.xml index d48fb90b24ec..922063272cd1 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsYesTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsYesTest.xml @@ -20,16 +20,12 @@ </annotations> <before> <magentoCLI command="config:set customer/create_account/viv_disable_auto_group_assign_default 1" stepKey="setConfigDefaultIsYes"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> </before> <after> <magentoCLI command="config:set customer/create_account/viv_disable_auto_group_assign_default 0" stepKey="setConfigDefaultIsNo"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml index 5b6c4fd23e03..b191ae940661 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml @@ -21,9 +21,7 @@ </annotations> <before> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexCustomerGrid"> - <argument name="indices" value="customer_grid"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexCustomerGrid"/> </before> <after> @@ -34,15 +32,15 @@ <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <actionGroup ref="AdminClearCustomersFiltersActionGroup" stepKey="navigateToCustomers"/> <waitForPageLoad stepKey="waitForLoad1"/> + <conditionalClick selector="{{AdminCustomerFiltersSection.clearAll}}" dependentSelector="{{AdminCustomerFiltersSection.clearAll}}" visible="true" stepKey="clickClearFilters"/> + <waitForPageLoad stepKey="waitForFiltersClear"/> <click selector="{{AdminCustomerGridMainActionsSection.addNewCustomer}}" stepKey="clickCreateCustomer"/> <fillField userInput="{{CustomerEntityOne.firstname}}" selector="{{AdminCustomerAccountInformationSection.firstName}}" stepKey="fillFirstName"/> <fillField userInput="{{CustomerEntityOne.lastname}}" selector="{{AdminCustomerAccountInformationSection.lastName}}" stepKey="fillLastName"/> <fillField userInput="{{CustomerEntityOne.email}}" selector="{{AdminCustomerAccountInformationSection.email}}" stepKey="fillEmail"/> <click selector="{{AdminCustomerMainActionsSection.saveButton}}" stepKey="saveCustomer"/> <seeElement selector="{{AdminCustomerMessagesSection.successMessage}}" stepKey="assertSuccessMessage"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/> <comment userInput="Replacing reload action and preserve Backward Compatibility" stepKey="waitForLoad2"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCustomGroupTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCustomGroupTest.xml index 7cffd5f304e3..5b43d5baf8f7 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCustomGroupTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCustomGroupTest.xml @@ -39,7 +39,7 @@ <click selector="{{AdminCustomerMainActionsSection.saveButton}}" stepKey="saveCustomer"/> <seeElement selector="{{AdminCustomerMessagesSection.successMessage}}" stepKey="assertSuccessMessage"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> + <argument name="tags" value="compiled_config"/> </actionGroup> <reloadPage stepKey="reloadPage"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml index 62dcd6fc4d89..b3d432b7776a 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml @@ -20,9 +20,7 @@ <before> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml index c6e72901b062..15eae933ccdd 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml @@ -20,9 +20,7 @@ <before> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml index 52c8029b8f77..55c9315f42fa 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml @@ -20,9 +20,7 @@ <before> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminEditCustomerWithAssociatedNewsletterQueueTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminEditCustomerWithAssociatedNewsletterQueueTest.xml new file mode 100644 index 000000000000..96e63b33d624 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminEditCustomerWithAssociatedNewsletterQueueTest.xml @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminEditCustomerWithAssociatedNewsletterQueueTest"> + <annotations> + <stories value="Edit customer if there is associated newsletter queue"/> + <title value="Edit customer if there is associated newsletter queue"/> + <description value="Edit customer if there is associated newsletter queue"/> + <severity value="BLOCKER"/> + <group value="customer"/> + </annotations> + <before> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> + <createData entity="Simple_US_Customer_Multiple_Addresses_No_Default_Address" stepKey="customer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> + </before> + <after> + <deleteData createDataKey="customer" stepKey="deleteCustomer"/> + + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToNewsletterGridPage"> + <argument name="menuUiId" value="{{AdminMenuMarketing.dataUiId}}"/> + <argument name="submenuUiId" value="{{AdminMenuMarketingCommunicationsNewsletterTemplate.dataUiId}}"/> + </actionGroup> + <actionGroup ref="AdminSearchNewsletterTemplateOnGridActionGroup" stepKey="findCreatedNewsletterTemplateInGrid"> + <argument name="name" value="{{_defaultNewsletter.name}}"/> + <argument name="subject" value="{{_defaultNewsletter.subject}}"/> + </actionGroup> + <actionGroup ref="AdminMarketingOpenNewsletterTemplateFromGridActionGroup" stepKey="openTemplate"/> + <actionGroup ref="AdminMarketingDeleteNewsletterTemplateActionGroup" stepKey="deleteTemplate"/> + + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="AdminOpenCustomersGridActionGroup" stepKey="openCustomersGridPage"/> + <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPage"> + <argument name="customer" value="Simple_US_Customer_Multiple_Addresses_No_Default_Address"/> + </actionGroup> + <actionGroup ref="AdminSubscribeCustomerToNewsletters" stepKey="subscribeToNewsletter"/> + + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToNewsletterTemplatePage"> + <argument name="menuUiId" value="{{AdminMenuMarketing.dataUiId}}"/> + <argument name="submenuUiId" value="{{AdminMenuMarketingCommunicationsNewsletterTemplate.dataUiId}}"/> + </actionGroup> + <actionGroup ref="AdminNavigateToCreateNewsletterTemplatePageActionGroup" stepKey="navigateToCreateNewsletterTemplatePage"/> + <actionGroup ref="AdminCreateNewsletterTemplateActionGroup" stepKey="createNewsletterTemplate"> + <argument name="name" value="{{_defaultNewsletter.name}}"/> + <argument name="subject" value="{{_defaultNewsletter.subject}}"/> + <argument name="senderName" value="{{_defaultNewsletter.senderName}}"/> + <argument name="senderEmail" value="{{_defaultNewsletter.senderEmail}}"/> + <argument name="templateContent" value="{{_defaultNewsletter.textAreaContent}}"/> + </actionGroup> + <actionGroup ref="AdminSearchNewsletterTemplateOnGridActionGroup" stepKey="findCreatedNewsletterTemplate"> + <argument name="name" value="{{_defaultNewsletter.name}}"/> + <argument name="subject" value="{{_defaultNewsletter.subject}}"/> + </actionGroup> + <actionGroup ref="AdminQueueNewsletterActionGroup" stepKey="addNewsletterToQueue"> + <argument name="startAt" value="Dec 21, 2022 11:04:20 AM"/> + </actionGroup> + + <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="editCustomerForm"> + <argument name="customer" value="Simple_US_Customer_Multiple_Addresses_No_Default_Address"/> + </actionGroup> + <actionGroup stepKey="editCustomerAddress" ref="AdminEditCustomerAddressesFromActionGroup"> + <argument name="customerAddress" value="CustomerAddressSimple"/> + </actionGroup> + <actionGroup ref="AdminSaveCustomerAndAssertSuccessMessage" stepKey="saveCustomer"/> + + </test> +</tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml index 77422c6e8da3..b975cf62765c 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml @@ -6,7 +6,8 @@ */ --> -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest"> <annotations> <features value="Customer"/> @@ -23,37 +24,41 @@ <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createSimpleCategory"/> </createData> - <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="login"/> </before> <after> <deleteData createDataKey="createSimpleCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPage"> - <argument name="customer" value="$simpleCustomer$"/> - </actionGroup> - <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSecondProduct"> - <argument name="product" value="$createSimpleProduct$"/> - </actionGroup> - <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInfo"> - <argument name="customer" value="$simpleCustomer$"/> - <argument name="address" value="US_Address_TX"/> - </actionGroup> - <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> - <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> - <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/> - - <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startCreateInvoice"/> - <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> - <actionGroup ref="GoToShipmentIntoOrderActionGroup" stepKey="goToShipment"/> - <actionGroup ref="SubmitShipmentIntoOrderActionGroup" stepKey="submitShipment"/> - - <!--Create Credit Memo--> - <actionGroup ref="StartToCreateCreditMemoActionGroup" stepKey="startToCreateCreditMemo"> - <argument name="orderId" value="{$getOrderId}"/> - </actionGroup> - <actionGroup ref="SubmitCreditMemoActionGroup" stepKey="submitCreditMemo"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="navigateToNewOrderPage"/> + <createData entity="CustomerCart" stepKey="createCustomerCart"> + <requiredEntity createDataKey="simpleCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addSecondProduct"> + <requiredEntity createDataKey="createCustomerCart"/> + <requiredEntity createDataKey="createSimpleProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="fillCustomerInfo"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectFlatRate"/> + <updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="submitOrder"> + <requiredEntity createDataKey="createCustomerCart"/> + </updateData> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="getOrderId"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="startCreateInvoice"/> + <createData entity="Invoice" stepKey="submitInvoice"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToShipment"/> + <createData entity="Shipment" stepKey="submitShipment"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="startToCreateCreditMemo"/> + <createData entity="CreditMemo" stepKey="submitCreditMemo"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="logInCustomer"> <argument name="Customer" value="$$simpleCustomer$$"/> @@ -61,12 +66,11 @@ <actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="goToMyOrdersPage"> <argument name="menu" value="My Orders"/> </actionGroup> - <click selector="{{StorefrontCustomerOrderSection.viewOrder}}" stepKey="clickViewOrder"/> - <click selector="{{StorefrontCustomerOrderViewSection.printOrderLink}}" stepKey="clickPrintOrderLink"/> - <waitForPageLoad stepKey="waitPageReload"/> + <actionGroup ref="StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup" stepKey="clickViewOrder"/> + <actionGroup ref="StorefrontClickPrintOrderLinkOnViewOrderPageActionGroup" stepKey="clickPrintOrderLink"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitPageReload"/> <switchToWindow stepKey="switchToWindow"/> <switchToPreviousTab stepKey="switchToPreviousTab"/> - <actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="goToAddressBook"> <argument name="menu" value="Address Book"/> </actionGroup> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminPlaceOrderWhenCountryAllowedOnlyOnCurrentWebsiteScopeTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminPlaceOrderWhenCountryAllowedOnlyOnCurrentWebsiteScopeTest.xml new file mode 100644 index 000000000000..7217f452e83f --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminPlaceOrderWhenCountryAllowedOnlyOnCurrentWebsiteScopeTest.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminPlaceOrderWhenCountryAllowedOnlyOnCurrentWebsiteScopeTest"> + <annotations> + <features value="Customer"/> + <stories value="Customer Order"/> + <title value="Place an order when country allowed only on current website"/> + <description value="Place an order when country allowed only on current website scope"/> + <severity value="MAJOR"/> + <group value="customer"/> + </annotations> + <before> + <magentoCLI command="config:set --scope={{SetAllowedCountryUsConfig.scope}} --scope-code={{SetAllowedCountryUsConfig.scope_code}} {{SetAllowedCountryUsConfig.path}} {{SetAllowedCountryUsConfig.value}}" stepKey="setAllowedCountryUs"/> + <magentoCLI command="config:set {{SetAllowedCountryUsConfig.path}} ''" stepKey="unselectAllCountriesFromAllowedCounties"/> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <createData entity="DisableAdminAccountAllowCountry" stepKey="setDefaultValueForAllowCountries"/> + <createData entity="SetAdminAccountAllowCountryToDefaultForDefaultWebsite" stepKey="setDefaultValueForAllowCountriesForDefaultWebsites"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> + <argument name="customer" value="$createCustomer$"/> + </actionGroup> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> + <argument name="product" value="$createSimpleProduct$"/> + <argument name="productQty" value="2"/> + </actionGroup> + <actionGroup ref="AdminSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/> + <actionGroup ref="AdminOrderClickSubmitOrderActionGroup" stepKey="submitOrder"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> + </test> +</tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminResetCustomerPasswordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminResetCustomerPasswordTest.xml index 257d4c9b2e3c..6ecb20ab8072 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminResetCustomerPasswordTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminResetCustomerPasswordTest.xml @@ -25,12 +25,8 @@ <deleteData createDataKey="customer" stepKey="deleteCustomer"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Edit customer info--> <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="OpenEditCustomerFrom"> <argument name="customer" value="$$customer$$"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml index bac1c665cbe7..7a9743482f81 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml @@ -20,9 +20,7 @@ <before> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminDeleteCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminDeleteCustomerAddressTest.xml index 3f95e55c5613..3fa29aef9908 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminDeleteCustomerAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminDeleteCustomerAddressTest.xml @@ -20,9 +20,7 @@ </annotations> <before> <createData stepKey="customer" entity="Simple_US_Customer_Multiple_Addresses"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminUpdateCustomerInfoFromDefaultToNonDefaultTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminUpdateCustomerInfoFromDefaultToNonDefaultTest.xml index fb6793b1751a..971a93f64d80 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminUpdateCustomerInfoFromDefaultToNonDefaultTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminUpdateCustomerInfoFromDefaultToNonDefaultTest.xml @@ -20,9 +20,7 @@ </annotations> <before> <createData stepKey="customer" entity="Simple_Customer_Without_Address"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminVerifyCustomerOnGridAfterDeletingWebsiteTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminVerifyCustomerOnGridAfterDeletingWebsiteTest.xml new file mode 100644 index 000000000000..a28078995010 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminVerifyCustomerOnGridAfterDeletingWebsiteTest.xml @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminVerifyCustomerOnGridAfterDeletingWebsiteTest"> + <annotations> + <features value="Customer"/> + <stories value="Customer grid"/> + <title value="The customer's grid is not available after deleting the website"/> + <description value="Verify grid after deleting website associated with customer"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-39783"/> + <group value="customer"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite"> + <argument name="newWebsiteName" value="{{customWebsite.name}}"/> + <argument name="websiteCode" value="{{customWebsite.code}}"/> + </actionGroup> + <actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createNewStore"> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="storeGroupName" value="{{customStoreGroup.name}}"/> + <argument name="storeGroupCode" value="{{customStoreGroup.code}}"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> + <argument name="StoreGroup" value="customStoreGroup"/> + <argument name="customStore" value="customStore"/> + </actionGroup> + <actionGroup ref="AdminGoCreatedWebsitePageActionGroup" stepKey="openWebsiteToGetId"> + <argument name="websiteName" value="{{customWebsite.name}}"/> + </actionGroup> + <grabFromCurrentUrl regex="~/website_id/(\d+)/~" stepKey="grabWebsiteIdFromURL"/> + <createData entity="Simple_Customer_Without_Address" stepKey="createCustomer"> + <field key="website_id">$grabWebsiteIdFromURL</field> + </createData> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="DeleteWebsite"> + <argument name="websiteName" value="{{customWebsite.name}}"/> + </actionGroup> + <actionGroup ref="AdminOpenCustomersGridActionGroup" stepKey="goToCustomersGridPage"/> + <actionGroup stepKey="resetFilter" ref="AdminResetFilterInCustomerGrid"/> + <actionGroup stepKey="filterByEamil" ref="AdminFilterCustomerGridByEmail"> + <argument name="email" value="$$createCustomer.email$$"/> + </actionGroup> + <actionGroup stepKey="checkCustomerInGrid" ref="AdminAssertCustomerInCustomersGrid"> + <argument name="text" value="$$createCustomer.email$$"/> + <argument name="row" value="1"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml index 6a157c631253..fb4680b2d064 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml @@ -42,9 +42,7 @@ <!--Set account sharing option - Default value is 'Per Website'--> <comment userInput="Set account sharing option - Default value is 'Per Website'" stepKey="setAccountSharingOption"/> <createData entity="CustomerAccountSharingDefault" stepKey="setToAccountSharingToDefault"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> </before> <after> <!--delete all created data and set main website country options to default--> @@ -62,12 +60,8 @@ <actionGroup ref="SetWebsiteCountryOptionsToDefaultActionGroup" stepKey="setCountryOptionsToDefault"/> <createData entity="CustomerAccountSharingSystemValue" stepKey="setAccountSharingToSystemValue"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <!--Check that all countries are allowed initially and get amount--> <comment userInput="Check that all countries are allowed initially and get amount" stepKey="checkAllCountriesAreAllowed"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/ExcludeWebsiteFromCustomerGroupCustomerAccountSharingGlobalTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/ExcludeWebsiteFromCustomerGroupCustomerAccountSharingGlobalTest.xml new file mode 100644 index 000000000000..d2231f7c3e56 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/ExcludeWebsiteFromCustomerGroupCustomerAccountSharingGlobalTest.xml @@ -0,0 +1,373 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="ExcludeWebsiteFromCustomerGroupCustomerAccountSharingGlobalTest"> + <annotations> + <features value="Customer"/> + <stories value="Exclude Website From Customer Group With Global Customer Account Sharing"/> + <title value="Exclude Website From Customer Group With Global Customer Account Sharing"/> + <description value="Exclude websites from Customer Group with Customer Accounts Sharing is Global"/> + <testCaseId value="MC-40713"/> + <severity value="MAJOR"/> + <group value="customers"/> + </annotations> + + <before> + <!-- Set indexer on save --> + <magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="realtime" /> + <!-- Create French Root Category with its Subcategory--> + <createData entity="NewRootCategory" stepKey="createFrenchRootCategory"/> + <createData entity="SimpleRootSubCategory" stepKey="createFrenchSubcategory"> + <requiredEntity createDataKey="createFrenchRootCategory"/> + </createData> + <!-- Create subcategory to the Default Root Category --> + <createData entity="SimpleSubCategory" stepKey="createDefaultSubcategory"/> + + <!-- Create 3 products --> + <createData entity="SimpleProduct2" stepKey="simpleMainProduct"/> + <createData entity="SimpleProduct2" stepKey="simpleFrenchProduct"/> + <createData entity="SimpleProduct2" stepKey="simpleCommonProduct"/> + + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!-- Create French Website, Store, & Store View --> + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsiteFR"> + <argument name="newWebsiteName" value="{{customWebsite.name}}"/> + <argument name="websiteCode" value="{{customWebsite.code}}"/> + </actionGroup> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createStoreFR"> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="store" value="{{customStoreFR.name}}"/> + <argument name="rootCategory" value="$$createFrenchRootCategory.name$$"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreViewFR"> + <argument name="StoreGroup" value="customStoreFR"/> + <argument name="customStore" value="customStoreFR"/> + </actionGroup> + + <!-- 1. Open Admin > Catalog > Products > Default Product --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToDefaultProduct"> + <argument name="productId" value="$$simpleMainProduct.id$$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForProductPageLoad1"/> + <!-- 2. Assign SubCategory Of Additional Root Category to Default product. Save product --> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignDefaultProduct"> + <argument name="categoryName" value="$$createDefaultSubcategory.name$$"/> + </actionGroup> + + <!-- 1. Open Admin > Catalog > Products > Additional Product --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToAdditionalProduct"> + <argument name="productId" value="$$simpleFrenchProduct.id$$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForProductPageLoad2"/> + <!-- 2. Assign subcategory of default root category to Additional product. Save product --> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignAdditionalProduct"> + <argument name="categoryName" value="$$createFrenchSubcategory.name$$"/> + </actionGroup> + <!-- 3. Assign Additional Website to Additional product --> + <actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectAdditionalWebsiteInAdditionalProduct"> + <argument name="website" value="{{customWebsite.name}}"/> + </actionGroup> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> + + <!-- 1. Open Admin > Catalog > Products > Common Product --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToCommonProduct"> + <argument name="productId" value="$$simpleCommonProduct.id$$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForProductPageLoad3"/> + <!-- 2. Assign product to Subcategory of Default and Additional Websites. Save product --> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignCommonProduct1"> + <argument name="categoryName" value="$$createDefaultSubcategory.name$$"/> + </actionGroup> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignCommonProduct2"> + <argument name="categoryName" value="$$createFrenchSubcategory.name$$"/> + </actionGroup> + <!-- 3. Assign Additional Website to Additional product --> + <actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectAdditionalWebsiteInCommonProduct"> + <argument name="website" value="{{customWebsite.name}}"/> + </actionGroup> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct3"/> + + <!-- Create customer group Members --> + <createData entity="CustomCustomerGroup" stepKey="customerGroupMembers"/> + <!-- Create customer group Family --> + <createData entity="CustomCustomerGroup" stepKey="customerGroupFamily"/> + + <!-- Create customer assigned to Main Website and to Members group --> + <createData entity="UsCustomerAssignedToNewCustomerGroup" stepKey="customerAssignedToMainWebsiteMembersGroup"> + <requiredEntity createDataKey="customerGroupMembers"/> + </createData> + <!-- Create customer assigned to Main Website and to Family group --> + <createData entity="UsCustomerAssignedToNewCustomerGroup" stepKey="customerAssignedToMainWebsiteFamilyGroup"> + <requiredEntity createDataKey="customerGroupFamily"/> + </createData> + + <!-- Create customer assigned to FR Website and to Members group --> + <createData entity="FrenchCustomerOneAssignedToNewCustomerGroup" stepKey="customerAssignedToFrenchWebsiteMembersGroup"> + <requiredEntity createDataKey="customerGroupMembers"/> + </createData> + <amOnPage url="{{AdminEditCustomerPage.url($$customerAssignedToFrenchWebsiteMembersGroup.id$$)}}" stepKey="goToFRCustomerMembersGroupEditPage"/> + <waitForPageLoad stepKey="waitPageToLoad1"/> + <actionGroup ref="AdminOpenAccountInformationTabFromCustomerEditPageActionGroup" stepKey="clickOnAccountInformation1"/> + <actionGroup ref="AdminCustomerSelectWebsiteGroupStoreActionGroup" stepKey="selectWebsiteGroupStoreForFRCustomerMembersGroup"> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="customerGroup" value="$$customerGroupMembers.code$$"/> + <argument name="store" value="{{customStoreFR.name}}"/> + </actionGroup> + + <!-- Create customer assigned to FR Website and to Family group --> + <createData entity="FrenchCustomerTwoAssignedToNewCustomerGroup" stepKey="customerAssignedToFrenchWebsiteFamilyGroup"> + <requiredEntity createDataKey="customerGroupFamily"/> + </createData> + <amOnPage url="{{AdminEditCustomerPage.url($$customerAssignedToFrenchWebsiteFamilyGroup.id$$)}}" stepKey="goToFRCustomerFamilyGroupEditPage"/> + <waitForPageLoad stepKey="waitPageToLoad2"/> + <actionGroup ref="AdminOpenAccountInformationTabFromCustomerEditPageActionGroup" stepKey="clickOnAccountInformation2"/> + <actionGroup ref="AdminCustomerSelectWebsiteGroupStoreActionGroup" stepKey="selectWebsiteGroupStoreForFRCustomerFamilyGroup"> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="customerGroup" value="$$customerGroupFamily.code$$"/> + <argument name="store" value="{{customStoreFR.name}}"/> + </actionGroup> + + <!-- Add store code to url --> + <actionGroup ref="EnableWebUrlOptionsActionGroup" stepKey="addStoreCodeToUrls"/> + <!-- Set Customer Accounts Sharing to Global --> + <magentoCLI command="config:set {{CustomerAccountShareGlobalConfigData.path}} {{CustomerAccountShareGlobalConfigData.value}}" stepKey="shareCustomerAccountsGlobal"/> + <magentoCLI command="cache:clean config full_page" stepKey="cleanInvalidatedCaches"/> + <!-- Reindex all indexers --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + </before> + <after> + <!-- Delete website --> + <actionGroup ref="DeleteCustomWebsiteActionGroup" stepKey="deleteStoreUS"> + <argument name="websiteName" value="customWebsite.name"/> + </actionGroup> + <!-- Delete root category and subcategory --> + <deleteData createDataKey="createFrenchRootCategory" stepKey="deleteAdditionalRootCategory"/> + <deleteData createDataKey="createDefaultSubcategory" stepKey="deleteSubCategoryOfDefaultRootCategory"/> + <!-- Delete products --> + <deleteData createDataKey="simpleMainProduct" stepKey="deleteSimpleMainProduct"/> + <deleteData createDataKey="simpleFrenchProduct" stepKey="deleteSimpleFrenchProduct"/> + <deleteData createDataKey="simpleCommonProduct" stepKey="deleteSimpleCommonProduct"/> + + <!-- Delete Main website customers --> + <deleteData createDataKey="customerAssignedToMainWebsiteMembersGroup" stepKey="deleteMainWebsiteMembersGroupCustomer"/> + <deleteData createDataKey="customerAssignedToMainWebsiteFamilyGroup" stepKey="deleteMainWebsiteFamilyGroupCustomer"/> + <!-- Delete FR Website customers --> + <deleteData createDataKey="customerAssignedToFrenchWebsiteMembersGroup" stepKey="deleteFRWebsiteMembersGroupCustomer"/> + <deleteData createDataKey="customerAssignedToFrenchWebsiteFamilyGroup" stepKey="deleteFRWebsiteFamilyGroupCustomer"/> + + <!-- Delete customer group --> + <deleteData createDataKey="customerGroupMembers" stepKey="deleteCustomerGroupMembers"/> + <deleteData createDataKey="customerGroupFamily" stepKey="deleteCustomerGroupFamily"/> + + <!-- Rollback config settings --> + <magentoCLI command="config:set {{CustomerAccountShareWebsiteConfigData.path}} {{CustomerAccountShareWebsiteConfigData.value}}" stepKey="shareCustomerAccountsPerWebsite"/> + <actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + + <!-- Reindex all indexers --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + </after> + <!--Grab new store view code--> + <actionGroup ref="AdminSystemStoreOpenPageActionGroup" stepKey="navigateToNewWebsitePage"/> + <fillField userInput="{{customWebsite.name}}" selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="fillSearchWebsiteField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <click selector="{{AdminStoresGridSection.storeNameInFirstRow}}" stepKey="clickFirstRow"/> + <grabValueFrom selector="{{AdminNewStoreSection.storeCodeTextField}}" stepKey="grabStoreViewCode"/> + <click selector="{{AdminNewStoreViewActionsSection.backButton}}" stepKey="clickBack"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="clickResetButton"/> + <waitForPageLoad stepKey="waitForStorePageLoad"/> + + <!-- Go to FR website home page --> + <amOnPage url="$grabStoreViewCode" stepKey="navigateToHomePageOfFRStore"/> + <waitForPageLoad stepKey="waitForHomePageLoad"/> + <!-- Sign In FR Members Group customer using Sign In header Link --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="FrCustomerMembersGroupLogin"> + <argument name="Customer" value="$$customerAssignedToFrenchWebsiteMembersGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleFrenchProduct in FR website and FR category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createFrenchSubcategory.name$$)}}" stepKey="goToCategoryFR"/> + <waitForPageLoad stepKey="waitForCategoryPageFR"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductFRInFR"> + <argument name="productName" value="$$simpleFrenchProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBothInUS_FR"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomStoreCustomerLogoutActionGroup" stepKey="storefrontSignOut"> + <argument name="storeCode" value="{{customStoreFR.code}}"/> + </actionGroup> + + <!-- Go to FR website home page --> + <amOnPage url="$grabStoreViewCode" stepKey="navigateToHomePageOfFRStore2"/> + <waitForPageLoad stepKey="waitForHomePageLoad2"/> + <!-- Sign In FR Family Group Customer using Sign In header Link --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="FrCustomerFamilyGroupLogin"> + <argument name="Customer" value="$$customerAssignedToFrenchWebsiteFamilyGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleFrenchProduct in FR website and FR category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createFrenchSubcategory.name$$)}}" stepKey="goToCategoryFR2"/> + <waitForPageLoad stepKey="waitForCategoryPageFR2"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductFRInFR2"> + <argument name="productName" value="$$simpleFrenchProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBothInUS_FR2"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomStoreCustomerLogoutActionGroup" stepKey="storefrontSignOut2"> + <argument name="storeCode" value="{{customStoreFR.code}}"/> + </actionGroup> + + <!-- Go to Main Website home page with Family Group customer --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage1"/> + <waitForPageLoad stepKey="waitForHomePageLoad3"/> + <!-- Sign In Main Website Family Group Customer using Sign In header Link --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="MainWebsiteCustomerFamilyGroupLogin"> + <argument name="Customer" value="$$customerAssignedToMainWebsiteFamilyGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleMainProduct in Main Website website and Main category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createDefaultSubcategory.name$$)}}" stepKey="goToCategoryMain1"/> + <waitForPageLoad stepKey="waitForCategoryPageMain1"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductMainInMain1"> + <argument name="productName" value="$$simpleMainProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBoth1"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront1"/> + + <!-- Go to Main Website home page with Members Group customer --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage2"/> + <waitForPageLoad stepKey="waitForHomePageLoad4"/> + <!-- Sign In Main Website Members Group Customer using Sign In header Link --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="MainWebsiteCustomerMembersGroupLogin"> + <argument name="Customer" value="$$customerAssignedToMainWebsiteMembersGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleMainProduct in Main Website website and Main category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createDefaultSubcategory.name$$)}}" stepKey="goToCategoryMain2"/> + <waitForPageLoad stepKey="waitForCategoryPageMain2"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductMainInMain2"> + <argument name="productName" value="$$simpleMainProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBoth2"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront2"/> + + <!-- Exclude French Website from Members group --> + <actionGroup ref="AdminOpenCustomerGroupsGridPageActionGroup" stepKey="openCustomerGroupGridPage1"/> + <actionGroup ref="AdminFilterCustomerGroupByNameActionGroup" stepKey="filterCustomerGroupsByMembersGroup"> + <argument name="customerGroupName" value="$$customerGroupMembers.code$$"/> + </actionGroup> + <actionGroup ref="AdminOpenCustomerGroupEditPageFromGridActionGroup" stepKey="openMembersCustomerGroupEditPage"> + <argument name="groupCode" value="$$customerGroupMembers.code$$"/> + </actionGroup> + <selectOption selector="{{AdminEditCustomerGroupSection.excludeWebsite}}" userInput="{{customWebsite.name}}" stepKey="selectFRExcludedWebsiteOption"/> + <click selector="{{AdminNewCustomerGroupSection.saveCustomerGroup}}" stepKey="clickToSaveCustomerGroup1"/> + <waitForPageLoad stepKey="waitForCustomerGroupSaved1"/> + <see stepKey="seeCustomerGroupSaveMessage1" userInput="You saved the customer group."/> + + <!-- Exclude Main Website from Family group --> + <actionGroup ref="AdminOpenCustomerGroupsGridPageActionGroup" stepKey="openCustomerGroupGridPage2"/> + <actionGroup ref="AdminFilterCustomerGroupByNameActionGroup" stepKey="filterCustomerGroupsByFamilyGroup"> + <argument name="customerGroupName" value="$$customerGroupFamily.code$$"/> + </actionGroup> + <actionGroup ref="AdminOpenCustomerGroupEditPageFromGridActionGroup" stepKey="openFamilyCustomerGroupEditPage"> + <argument name="groupCode" value="$$customerGroupFamily.code$$"/> + </actionGroup> + <selectOption selector="{{AdminEditCustomerGroupSection.excludeWebsite}}" userInput="Main Website" stepKey="selectMainExcludedWebsiteOption"/> + <click selector="{{AdminNewCustomerGroupSection.saveCustomerGroup}}" stepKey="clickToSaveCustomerGroup2"/> + <waitForPageLoad stepKey="waitForCustomerGroupSaved2"/> + <see stepKey="seeCustomerGroupSaveMessage2" userInput="You saved the customer group."/> + + <!-- Go to FR website home page as NOT LOGGED IN user --> + <amOnPage url="$grabStoreViewCode" stepKey="navigateToHomePageOfFRStore3"/> + <waitForPageLoad stepKey="waitForHomePageLoad5"/> + <!-- Assert simpleCommonProduct and simpleFrenchProduct in FR website and FR category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createFrenchSubcategory.name$$)}}" stepKey="goToCategoryFR3"/> + <waitForPageLoad stepKey="waitForCategoryPageFR3"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductFRInFR3"> + <argument name="productName" value="$$simpleFrenchProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBothInUS_FR3"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + + <!-- Sign In FR Website as Family Group Customer --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="FrCustomerFamilyGroupLogin2"> + <argument name="Customer" value="$$customerAssignedToFrenchWebsiteFamilyGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleFrenchProduct in FR website and FR category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createFrenchSubcategory.name$$)}}" stepKey="goToCategoryFR4"/> + <waitForPageLoad stepKey="waitForCategoryPageFR4"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductFRInFR4"> + <argument name="productName" value="$$simpleFrenchProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBothInUS_FR4"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomStoreCustomerLogoutActionGroup" stepKey="storefrontSignOut3"> + <argument name="storeCode" value="{{customStoreFR.code}}"/> + </actionGroup> + + <!-- Go to FR website home page --> + <amOnPage url="$grabStoreViewCode" stepKey="navigateToHomePageOfFRStore4"/> + <waitForPageLoad stepKey="waitForHomePageLoad6"/> + <!-- Sign In FR Website as Members Group customer --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="FrCustomerMembersGroupLogin2"> + <argument name="Customer" value="$$customerAssignedToFrenchWebsiteMembersGroup$$"/> + </actionGroup> + <!-- Assert that customer is excluded from Members customer group --> + <actionGroup ref="AssertMessageCustomerLoginActionGroup" stepKey="seeErrorMessageAfterLogin"> + <argument name="messageType" value="error"/> + <argument name="message" value="This website is excluded from customer's group."/> + </actionGroup> + + <!-- Go to Main Website home page with Members Group customer --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage3"/> + <waitForPageLoad stepKey="waitForHomePageLoad7"/> + <!-- Sign In Main Website as Members Group Customer --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="MainWebsiteCustomerMembersGroupLogin2"> + <argument name="Customer" value="$$customerAssignedToMainWebsiteMembersGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleMainProduct in Main Website website and Main category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createDefaultSubcategory.name$$)}}" stepKey="goToCategoryMain3"/> + <waitForPageLoad stepKey="waitForCategoryPageMain4"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductMainInMain3"> + <argument name="productName" value="$$simpleMainProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBoth3"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront3"/> + + <!-- Go to Main Website home page with Family Group customer --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage4"/> + <waitForPageLoad stepKey="waitForHomePageLoad8"/> + <!-- Sign In Main Website as Family Group Customer --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="MainWebsiteCustomerFamilyGroupLogin2"> + <argument name="Customer" value="$$customerAssignedToMainWebsiteFamilyGroup$$"/> + </actionGroup> + <!-- Assert that customer is excluded from Family customer group --> + <actionGroup ref="AssertMessageCustomerLoginActionGroup" stepKey="seeErrorMessageAfterLogin2"> + <argument name="messageType" value="error"/> + <argument name="message" value="This website is excluded from customer's group."/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/ExcludeWebsiteFromCustomerGroupCustomerAccountSharingPerWebsiteTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/ExcludeWebsiteFromCustomerGroupCustomerAccountSharingPerWebsiteTest.xml new file mode 100644 index 000000000000..b6428e46d262 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/ExcludeWebsiteFromCustomerGroupCustomerAccountSharingPerWebsiteTest.xml @@ -0,0 +1,385 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="ExcludeWebsiteFromCustomerGroupCustomerAccountSharingPerWebsiteTest"> + <annotations> + <features value="Customer"/> + <stories value="Exclude Website From Customer Group With Account Sharing Per Website"/> + <title value="Exclude Website From Customer Group With Account Sharing Per Website"/> + <description value="Exclude websites from Customer Group with Customer Accounts Sharing per Website"/> + <testCaseId value="MC-41141"/> + <severity value="MAJOR"/> + <group value="customers"/> + </annotations> + + <before> + <!-- Set indexer on save --> + <magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="realtime" /> + <!-- Create French Root Category with its Subcategory--> + <createData entity="NewRootCategory" stepKey="createFrenchRootCategory"/> + <createData entity="SimpleRootSubCategory" stepKey="createFrenchSubcategory"> + <requiredEntity createDataKey="createFrenchRootCategory"/> + </createData> + <!-- Create subcategory to the Default Root Category --> + <createData entity="SimpleSubCategory" stepKey="createDefaultSubcategory"/> + + <!-- Create 3 products --> + <createData entity="SimpleProduct2" stepKey="simpleMainProduct"/> + <createData entity="SimpleProduct2" stepKey="simpleFrenchProduct"/> + <createData entity="SimpleProduct2" stepKey="simpleCommonProduct"/> + + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!-- Create French Website, Store, & Store View --> + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsiteFR"> + <argument name="newWebsiteName" value="{{customWebsite.name}}"/> + <argument name="websiteCode" value="{{customWebsite.code}}"/> + </actionGroup> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createStoreFR"> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="store" value="{{customStoreFR.name}}"/> + <argument name="rootCategory" value="$$createFrenchRootCategory.name$$"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreViewFR"> + <argument name="StoreGroup" value="customStoreFR"/> + <argument name="customStore" value="customStoreFR"/> + </actionGroup> + + <!-- 1. Open Admin > Catalog > Products > Default Product --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToDefaultProduct"> + <argument name="productId" value="$$simpleMainProduct.id$$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForProductPageLoad1"/> + <!-- 2. Assign SubCategory Of Additional Root Category to Default product. Save product --> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignDefaultProduct"> + <argument name="categoryName" value="$$createDefaultSubcategory.name$$"/> + </actionGroup> + + <!-- 1. Open Admin > Catalog > Products > Additional Product --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToAdditionalProduct"> + <argument name="productId" value="$$simpleFrenchProduct.id$$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForProductPageLoad2"/> + <!-- 2. Assign subcategory of default root category to Additional product. Save product --> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignAdditionalProduct"> + <argument name="categoryName" value="$$createFrenchSubcategory.name$$"/> + </actionGroup> + <!-- 3. Assign Additional Website to Additional product --> + <actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectAdditionalWebsiteInAdditionalProduct"> + <argument name="website" value="{{customWebsite.name}}"/> + </actionGroup> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> + + <!-- 1. Open Admin > Catalog > Products > Common Product --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToCommonProduct"> + <argument name="productId" value="$$simpleCommonProduct.id$$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForProductPageLoad3"/> + <!-- 2. Assign product to Subcategory of Default and Additional Websites. Save product --> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignCommonProduct1"> + <argument name="categoryName" value="$$createDefaultSubcategory.name$$"/> + </actionGroup> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignCommonProduct2"> + <argument name="categoryName" value="$$createFrenchSubcategory.name$$"/> + </actionGroup> + <!-- 3. Assign Additional Website to Additional product --> + <actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectAdditionalWebsiteInCommonProduct"> + <argument name="website" value="{{customWebsite.name}}"/> + </actionGroup> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct3"/> + + <!-- Create customer group Members --> + <createData entity="CustomCustomerGroup" stepKey="customerGroupMembers"/> + <!-- Create customer group Family --> + <createData entity="CustomCustomerGroup" stepKey="customerGroupFamily"/> + + <!-- Create customer assigned to Main Website and to Members group --> + <createData entity="UsCustomerAssignedToNewCustomerGroup" stepKey="customerAssignedToMainWebsiteMembersGroup"> + <requiredEntity createDataKey="customerGroupMembers"/> + </createData> + <!-- Create customer assigned to Main Website and to Family group --> + <createData entity="UsCustomerAssignedToNewCustomerGroup" stepKey="customerAssignedToMainWebsiteFamilyGroup"> + <requiredEntity createDataKey="customerGroupFamily"/> + </createData> + + <!-- Create customer assigned to FR Website and to Members group --> + <createData entity="FrenchCustomerOneAssignedToNewCustomerGroup" stepKey="customerAssignedToFrenchWebsiteMembersGroup"> + <requiredEntity createDataKey="customerGroupMembers"/> + </createData> + <amOnPage url="{{AdminEditCustomerPage.url($$customerAssignedToFrenchWebsiteMembersGroup.id$$)}}" stepKey="goToFRCustomerMembersGroupEditPage"/> + <waitForPageLoad stepKey="waitPageToLoad1"/> + <actionGroup ref="AdminOpenAccountInformationTabFromCustomerEditPageActionGroup" stepKey="clickOnAccountInformation1"/> + <actionGroup ref="AdminCustomerSelectWebsiteGroupStoreActionGroup" stepKey="selectWebsiteGroupStoreForFRCustomerMembersGroup"> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="customerGroup" value="$$customerGroupMembers.code$$"/> + <argument name="store" value="{{customStoreFR.name}}"/> + </actionGroup> + + <!-- Create customer assigned to FR Website and to Family group --> + <createData entity="FrenchCustomerTwoAssignedToNewCustomerGroup" stepKey="customerAssignedToFrenchWebsiteFamilyGroup"> + <requiredEntity createDataKey="customerGroupFamily"/> + </createData> + <amOnPage url="{{AdminEditCustomerPage.url($$customerAssignedToFrenchWebsiteFamilyGroup.id$$)}}" stepKey="goToFRCustomerFamilyGroupEditPage"/> + <waitForPageLoad stepKey="waitPageToLoad2"/> + <actionGroup ref="AdminOpenAccountInformationTabFromCustomerEditPageActionGroup" stepKey="clickOnAccountInformation2"/> + <actionGroup ref="AdminCustomerSelectWebsiteGroupStoreActionGroup" stepKey="selectWebsiteGroupStoreForFRCustomerFamilyGroup"> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="customerGroup" value="$$customerGroupFamily.code$$"/> + <argument name="store" value="{{customStoreFR.name}}"/> + </actionGroup> + + <!-- Add store code to url --> + <actionGroup ref="EnableWebUrlOptionsActionGroup" stepKey="addStoreCodeToUrls"/> + <!-- Set Customer Accounts Sharing to Per Website --> + <magentoCLI command="config:set {{CustomerAccountShareWebsiteConfigData.path}} {{CustomerAccountShareWebsiteConfigData.value}}" stepKey="setConfigCustomerAccountToWebsite"/> + <magentoCLI command="cache:clean config full_page" stepKey="cleanInvalidatedCaches"/> + <!-- Reindex all indexers --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + </before> + <after> + <!-- Delete website --> + <actionGroup ref="DeleteCustomWebsiteActionGroup" stepKey="deleteStoreUS"> + <argument name="websiteName" value="customWebsite.name"/> + </actionGroup> + <!-- Delete root category and subcategory --> + <deleteData createDataKey="createFrenchRootCategory" stepKey="deleteAdditionalRootCategory"/> + <deleteData createDataKey="createDefaultSubcategory" stepKey="deleteSubCategoryOfDefaultRootCategory"/> + <!-- Delete products --> + <deleteData createDataKey="simpleMainProduct" stepKey="deleteSimpleMainProduct"/> + <deleteData createDataKey="simpleFrenchProduct" stepKey="deleteSimpleFrenchProduct"/> + <deleteData createDataKey="simpleCommonProduct" stepKey="deleteSimpleCommonProduct"/> + + <!-- Delete Main website customers --> + <deleteData createDataKey="customerAssignedToMainWebsiteMembersGroup" stepKey="deleteMainWebsiteMembersGroupCustomer"/> + <deleteData createDataKey="customerAssignedToMainWebsiteFamilyGroup" stepKey="deleteMainWebsiteFamilyGroupCustomer"/> + <!-- Delete FR Website customers --> + <deleteData createDataKey="customerAssignedToFrenchWebsiteMembersGroup" stepKey="deleteFRWebsiteMembersGroupCustomer"/> + <deleteData createDataKey="customerAssignedToFrenchWebsiteFamilyGroup" stepKey="deleteFRWebsiteFamilyGroupCustomer"/> + + <!-- Delete customer group --> + <deleteData createDataKey="customerGroupMembers" stepKey="deleteCustomerGroupMembers"/> + <deleteData createDataKey="customerGroupFamily" stepKey="deleteCustomerGroupFamily"/> + + <!-- Rollback config settings --> + <actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + + <!-- Reindex all indexers --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + </after> + <!--Grab new store view code--> + <actionGroup ref="AdminSystemStoreOpenPageActionGroup" stepKey="navigateToNewWebsitePage"/> + <fillField userInput="{{customWebsite.name}}" selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="fillSearchWebsiteField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <click selector="{{AdminStoresGridSection.storeNameInFirstRow}}" stepKey="clickFirstRow"/> + <grabValueFrom selector="{{AdminNewStoreSection.storeCodeTextField}}" stepKey="grabStoreViewCode"/> + <click selector="{{AdminNewStoreViewActionsSection.backButton}}" stepKey="clickBack"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="clickResetButton"/> + <waitForPageLoad stepKey="waitForStorePageLoad"/> + + <!-- Go to FR website home page --> + <amOnPage url="$grabStoreViewCode" stepKey="navigateToHomePageOfFRStore"/> + <waitForPageLoad stepKey="waitForHomePageLoad"/> + <!-- Sign In FR Members Group customer using Sign In header Link --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="FrCustomerMembersGroupLogin"> + <argument name="Customer" value="$$customerAssignedToFrenchWebsiteMembersGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleFrenchProduct in FR website and FR category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createFrenchSubcategory.name$$)}}" stepKey="goToCategoryFR"/> + <waitForPageLoad stepKey="waitForCategoryPageFR"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductFRInFR"> + <argument name="productName" value="$$simpleFrenchProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBothInUS_FR"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomStoreCustomerLogoutActionGroup" stepKey="storefrontSignOut"> + <argument name="storeCode" value="{{customStoreFR.code}}"/> + </actionGroup> + + <!-- Go to FR website home page --> + <amOnPage url="$grabStoreViewCode" stepKey="navigateToHomePageOfFRStore2"/> + <waitForPageLoad stepKey="waitForHomePageLoad2"/> + <!-- Sign In FR Family Group Customer using Sign In header Link --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="FrCustomerFamilyGroupLogin"> + <argument name="Customer" value="$$customerAssignedToFrenchWebsiteFamilyGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleFrenchProduct in FR website and FR category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createFrenchSubcategory.name$$)}}" stepKey="goToCategoryFR2"/> + <waitForPageLoad stepKey="waitForCategoryPageFR2"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductFRInFR2"> + <argument name="productName" value="$$simpleFrenchProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBothInUS_FR2"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomStoreCustomerLogoutActionGroup" stepKey="storefrontSignOut2"> + <argument name="storeCode" value="{{customStoreFR.code}}"/> + </actionGroup> + + <!-- Go to Main Website home page with Family Group customer --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage1"/> + <waitForPageLoad stepKey="waitForHomePageLoad3"/> + <!-- Sign In Main Website Family Group Customer using Sign In header Link --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="MainWebsiteCustomerFamilyGroupLogin"> + <argument name="Customer" value="$$customerAssignedToMainWebsiteFamilyGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleMainProduct in Main Website website and Main category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createDefaultSubcategory.name$$)}}" stepKey="goToCategoryMain1"/> + <waitForPageLoad stepKey="waitForCategoryPageMain1"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductMainInMain1"> + <argument name="productName" value="$$simpleMainProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBoth1"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront1"/> + + <!-- Go to Main Website home page with Members Group customer --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage2"/> + <waitForPageLoad stepKey="waitForHomePageLoad4"/> + <!-- Sign In Main Website Members Group Customer using Sign In header Link --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="MainWebsiteCustomerMembersGroupLogin"> + <argument name="Customer" value="$$customerAssignedToMainWebsiteMembersGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleMainProduct in Main Website website and Main category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createDefaultSubcategory.name$$)}}" stepKey="goToCategoryMain2"/> + <waitForPageLoad stepKey="waitForCategoryPageMain2"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductMainInMain2"> + <argument name="productName" value="$$simpleMainProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBoth2"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront2"/> + + <!-- Exclude French Website from Members group --> + <actionGroup ref="AdminOpenCustomerGroupsGridPageActionGroup" stepKey="openCustomerGroupGridPage1"/> + <actionGroup ref="AdminFilterCustomerGroupByNameActionGroup" stepKey="filterCustomerGroupsByMembersGroup"> + <argument name="customerGroupName" value="$$customerGroupMembers.code$$"/> + </actionGroup> + <actionGroup ref="AdminOpenCustomerGroupEditPageFromGridActionGroup" stepKey="openMembersCustomerGroupEditPage"> + <argument name="groupCode" value="$$customerGroupMembers.code$$"/> + </actionGroup> + <selectOption selector="{{AdminEditCustomerGroupSection.excludeWebsite}}" userInput="{{customWebsite.name}}" stepKey="selectFRExcludedWebsiteOption"/> + <click selector="{{AdminNewCustomerGroupSection.saveCustomerGroup}}" stepKey="clickToSaveCustomerGroup1"/> + <waitForPageLoad stepKey="waitForCustomerGroupSaved1"/> + <see stepKey="seeCustomerGroupSaveMessage1" userInput="You saved the customer group."/> + + <!-- Exclude Main Website from Family group --> + <actionGroup ref="AdminOpenCustomerGroupsGridPageActionGroup" stepKey="openCustomerGroupGridPage2"/> + <actionGroup ref="AdminFilterCustomerGroupByNameActionGroup" stepKey="filterCustomerGroupsByFamilyGroup"> + <argument name="customerGroupName" value="$$customerGroupFamily.code$$"/> + </actionGroup> + <actionGroup ref="AdminOpenCustomerGroupEditPageFromGridActionGroup" stepKey="openFamilyCustomerGroupEditPage"> + <argument name="groupCode" value="$$customerGroupFamily.code$$"/> + </actionGroup> + <selectOption selector="{{AdminEditCustomerGroupSection.excludeWebsite}}" userInput="Main Website" stepKey="selectMainExcludedWebsiteOption"/> + <click selector="{{AdminNewCustomerGroupSection.saveCustomerGroup}}" stepKey="clickToSaveCustomerGroup2"/> + <waitForPageLoad stepKey="waitForCustomerGroupSaved2"/> + <see stepKey="seeCustomerGroupSaveMessage2" userInput="You saved the customer group."/> + + <!-- Go to FR website home page as NOT LOGGED IN user --> + <amOnPage url="$grabStoreViewCode" stepKey="navigateToHomePageOfFRStore3"/> + <waitForPageLoad stepKey="waitForHomePageLoad5"/> + <!-- Assert simpleCommonProduct and simpleFrenchProduct in FR website and FR category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createFrenchSubcategory.name$$)}}" stepKey="goToCategoryFR3"/> + <waitForPageLoad stepKey="waitForCategoryPageFR3"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductFRInFR3"> + <argument name="productName" value="$$simpleFrenchProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBothInUS_FR3"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + + <!-- Sign In FR Website as Family Group Customer --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="FrCustomerFamilyGroupLogin2"> + <argument name="Customer" value="$$customerAssignedToFrenchWebsiteFamilyGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleFrenchProduct in FR website and FR category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createFrenchSubcategory.name$$)}}" stepKey="goToCategoryFR4"/> + <waitForPageLoad stepKey="waitForCategoryPageFR4"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductFRInFR4"> + <argument name="productName" value="$$simpleFrenchProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBothInUS_FR4"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomStoreCustomerLogoutActionGroup" stepKey="storefrontSignOut3"> + <argument name="storeCode" value="{{customStoreFR.code}}"/> + </actionGroup> + + <!-- Go to FR website home page --> + <amOnPage url="$grabStoreViewCode" stepKey="navigateToHomePageOfFRStore4"/> + <waitForPageLoad stepKey="waitForHomePageLoad6"/> + <!-- Sign In FR Website as Members Group customer --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="FrCustomerMembersGroupLogin2"> + <argument name="Customer" value="$$customerAssignedToFrenchWebsiteMembersGroup$$"/> + </actionGroup> + <!-- Assert that customer is excluded from Members customer group --> + <actionGroup ref="AssertMessageCustomerLoginActionGroup" stepKey="seeErrorMessageAfterLogin"> + <argument name="messageType" value="error"/> + <argument name="message" value="This website is excluded from customer's group."/> + </actionGroup> + + <!-- Go to Main Website home page with Members Group customer --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage3"/> + <waitForPageLoad stepKey="waitForHomePageLoad7"/> + <!-- Sign In Main Website as Members Group Customer --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="MainWebsiteCustomerMembersGroupLogin2"> + <argument name="Customer" value="$$customerAssignedToMainWebsiteMembersGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleMainProduct in Main Website website and Main category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createDefaultSubcategory.name$$)}}" stepKey="goToCategoryMain3"/> + <waitForPageLoad stepKey="waitForCategoryPageMain4"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductMainInMain3"> + <argument name="productName" value="$$simpleMainProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBoth3"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront3"/> + + <!-- Go to Main Website home page with Family Group customer --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage4"/> + <waitForPageLoad stepKey="waitForHomePageLoad8"/> + <!-- Sign In Main Website as Family Group Customer --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="MainWebsiteCustomerFamilyGroupLogin2"> + <argument name="Customer" value="$$customerAssignedToMainWebsiteFamilyGroup$$"/> + </actionGroup> + <!-- Assert that customer is excluded from Family customer group --> + <actionGroup ref="AssertMessageCustomerLoginActionGroup" stepKey="seeErrorMessageAfterLogin2"> + <argument name="messageType" value="error"/> + <argument name="message" value="This website is excluded from customer's group."/> + </actionGroup> + + <!-- Login to the Main Website as FR customer --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage5"/> + <waitForPageLoad stepKey="waitForHomePageLoad9"/> + <!-- Sign In Main Website as FR Members Group Customer --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="MainWebsiteCustomerMembersGroupLogin3"> + <argument name="Customer" value="$$customerAssignedToFrenchWebsiteMembersGroup$$"/> + </actionGroup> + <!-- Assert that customer cannot login --> + <actionGroup ref="AssertMessageCustomerLoginActionGroup" stepKey="seeErrorMessageAfterLogin3"> + <argument name="messageType" value="error"/> + <argument name="message" value="The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later."/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontChangePasswordFormShowPasswordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontChangePasswordFormShowPasswordTest.xml new file mode 100644 index 000000000000..fe7a54bb2355 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontChangePasswordFormShowPasswordTest.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontChangePasswordFormShowPasswordTest"> + <annotations> + <features value="Customer"/> + <stories value="Customer Password Update"/> + <title value="Show Password Checkbox on Customer Change Password Form"/> + <description value="Check Show Password Functionality in Customer Password Update Form"/> + <severity value="MAJOR"/> + <group value="Customer"/> + </annotations> + <before> + <createData stepKey="customer" entity="Simple_US_Customer"/> + </before> + <after> + <deleteData stepKey="deleteCustomer" createDataKey="customer" /> + </after> + + <actionGroup ref="StorefrontOpenCustomerLoginPageActionGroup" stepKey="goToSignInPage"/> + <actionGroup ref="StorefrontFillCustomerLoginFormActionGroup" stepKey="fillLoginFormWithCorrectCredentials"> + <argument name="customer" value="$$customer$$"/> + </actionGroup> + <actionGroup ref="StorefrontClickSignOnCustomerLoginFormActionGroup" stepKey="clickSignInAccountButton" /> + <actionGroup ref="StorefrontOpenCustomerChangePasswordPageActionGroup" stepKey="openCustomerPasswordUpdatePage"/> + <actionGroup ref="StorefrontFillChangePasswordFormActionGroup" stepKey="fillChangePasswordForm"> + <argument name="customer" value="Simple_US_Customer"/> + </actionGroup> + <actionGroup ref="StorefrontCustomerEditFormClickShowPasswordActionGroup" stepKey="clickShowPasswordCheckbox"/> + <actionGroup ref="AssertCustomerEditFormPasswordFieldActionGroup" stepKey="AssertCurrentPasswordField"/> + </test> +</tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml index 5a75d5d27229..b9c558c65c51 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml @@ -79,7 +79,7 @@ </actionGroup> <!-- Go to product visible --> - <amOnPage url="$$createProduct.name$$.html" stepKey="navigateToProductPageOnDefaultStore"/> + <amOnPage url="$$createProduct.custom_attributes[url_key]$$.html" stepKey="navigateToProductPageOnDefaultStore"/> <see userInput="$$createProduct.name$$" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertFirstProductNameTitle"/> <!--Add a product to the cart--> @@ -87,8 +87,8 @@ <!--Proceed to checkout--> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="GoToCheckoutFromMinicartActionGroup"/> <!-- Click next button to open payment section --> - <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> - <waitForPageLoad stepKey="waitForShipmentPageLoad"/> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> <!-- Check order summary in checkout --> <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontClearAllCompareProductsTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontClearAllCompareProductsTest.xml index 130e1ba6723a..d04e60ef86bb 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontClearAllCompareProductsTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontClearAllCompareProductsTest.xml @@ -102,12 +102,8 @@ <requiredEntity createDataKey="createDownloadableProduct1"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Login --> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerFormShowPasswordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerFormShowPasswordTest.xml new file mode 100644 index 000000000000..39623a341918 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerFormShowPasswordTest.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontCreateCustomerFormShowPasswordTest"> + <annotations> + <features value="Customer"/> + <stories value="Customer Creation"/> + <title value="Show Password Checkbox on Customer Create Form"/> + <description value="Check Show Password Functionality in Customer Creation Form"/> + <severity value="MAJOR"/> + <group value="Customer"/> + </annotations> + + <actionGroup ref="StorefrontOpenCustomerAccountCreatePageActionGroup" stepKey="openCreateAccountPage"/> + <actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="fillCreateAccountForm"> + <argument name="customer" value="Simple_US_Customer"/> + </actionGroup> + <actionGroup ref="StorefrontRegistrationFormClickShowPasswordActionGroup" stepKey="clickShowPasswordCheckbox"/> + <actionGroup ref="AssertRegistrationFormPasswordFieldActionGroup" stepKey="AssertPasswordField"/> + </test> +</tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerWithDateOfBirthTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerWithDateOfBirthTest.xml index 47b61b332f57..148afb6d67c2 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerWithDateOfBirthTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerWithDateOfBirthTest.xml @@ -36,7 +36,7 @@ <argument name="dob" value="{{EN_US_DATE.short4DigitYear}}"/> </actionGroup> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="customer_grid"/> </actionGroup> <actionGroup ref="DeleteCustomerByEmailActionGroup" stepKey="deleteNewUser"> <argument name="email" value="{{CustomerEntityOne.email}}"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontLoginFormShowPasswordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontLoginFormShowPasswordTest.xml new file mode 100644 index 000000000000..4e967cdee8df --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontLoginFormShowPasswordTest.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontLoginFormShowPasswordTest"> + <annotations> + <features value="Customer"/> + <stories value="Customer Login"/> + <title value="Show Password Checkbox on Customer Login Form"/> + <description value="Check Show Password Functionality on Customer Login Form"/> + <severity value="MAJOR"/> + <group value="Customer"/> + </annotations> + <before> + <createData stepKey="customer" entity="Simple_US_Customer"/> + </before> + <after> + <deleteData stepKey="deleteCustomer" createDataKey="customer" /> + </after> + + <actionGroup ref="StorefrontOpenCustomerLoginPageActionGroup" stepKey="goToSignInPage"/> + <actionGroup ref="StorefrontFillCustomerLoginFormWithWrongPasswordActionGroup" stepKey="fillLoginFormWithCustomerData"> + <argument name="customer" value="$$customer$$"/> + </actionGroup> + <actionGroup ref="StorefrontLoginFormClickShowPasswordActionGroup" stepKey="clickShowPasswordCheckbox"/> + <actionGroup ref="AssertLoginFormPasswordFieldActionGroup" stepKey="AssertPasswordField"/> + </test> +</tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressTest/StorefrontUpdateCustomerDefaultShippingAddressFromBlockTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressTest/StorefrontUpdateCustomerDefaultShippingAddressFromBlockTest.xml index f79ef0a397e2..0539b50dcaac 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressTest/StorefrontUpdateCustomerDefaultShippingAddressFromBlockTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressTest/StorefrontUpdateCustomerDefaultShippingAddressFromBlockTest.xml @@ -9,17 +9,15 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="StorefrontUpdateCustomerDefaultShippingAddressFromBlockTest"> <annotations> - <features value="Customer address"/> - <stories value="Implement handling of large number of addresses on storefront Address book"/> - <title value="Add default customer address via the Storefront611"/> - <description value="Storefront user should be able to create a new default address via the storefront"/> + <features value="Customer"/> + <stories value="Update Customer Address"/> + <title value="Update customer default shipping address via the Storefront"/> + <description value="Customer should be able to update a default shipping address via the Storefront"/> <severity value="MAJOR"/> - <testCaseId value="MAGETWO-97501"/> + <testCaseId value="MC-40247"/> + <useCaseId value="MAGETWO-97504"/> <group value="customer"/> <group value="update"/> - <skip> - <issueId value="MAGETWO-97504"/> - </skip> </annotations> <before> <createData entity="Simple_US_Customer_With_Different_Billing_Shipping_Addresses" stepKey="createCustomer"/> @@ -30,16 +28,18 @@ <!--Log in to Storefront as Customer 1 --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp"> - <argument name="Customer" value="$$createCustomer$$"/> + <argument name="Customer" value="$createCustomer$"/> </actionGroup> - <amOnPage url="customer/address/" stepKey="OpenCustomerAddNewAddress"/> - <click stepKey="ClickEditDefaultShippingAddress" selector="{{StorefrontCustomerAddressesSection.editDefaultShippingAddress}}"/> - <fillField stepKey="fillFirstName" userInput="EditedFirstNameShipping" selector="{{StorefrontCustomerAddressFormSection.firstName}}"/> - <fillField stepKey="fillLastName" userInput="EditedLastNameShipping" selector="{{StorefrontCustomerAddressFormSection.lastName}}"/> - <click stepKey="saveCustomerAddress" selector="{{StorefrontCustomerAddressFormSection.saveAddress}}"/> - <see userInput="You saved the address." stepKey="verifyAddressAdded"/> + <amOnPage url="{{StorefrontCustomerAddressesPage.url}}" stepKey="OpenCustomerAddNewAddress"/> + <waitForElementVisible selector="{{StorefrontCustomerAddressesSection.editDefaultShippingAddress}}" stepKey="waitForChangeShippingAddressLinkVisible"/> + <click selector="{{StorefrontCustomerAddressesSection.editDefaultShippingAddress}}" stepKey="ClickEditDefaultShippingAddress"/> + <fillField userInput="EditedFirstNameShipping" selector="{{StorefrontCustomerAddressFormSection.firstName}}" stepKey="fillFirstName"/> + <fillField userInput="EditedLastNameShipping" selector="{{StorefrontCustomerAddressFormSection.lastName}}" stepKey="fillLastName"/> + <click selector="{{StorefrontCustomerAddressFormSection.saveAddress}}" stepKey="saveCustomerAddress"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessageVisible"/> + <see userInput="You saved the address." selector="{{StorefrontMessagesSection.success}}" stepKey="verifyAddressAdded"/> <see userInput="EditedFirstNameShipping" selector="{{StorefrontCustomerAddressesSection.defaultShippingAddress}}" stepKey="checkNewAddressesFirstNameOnDefaultShipping"/> - <see userInput="EditedLastNameShipping" selector="{{StorefrontCustomerAddressesSection.defaultBillingAddress}}" stepKey="checkNewAddressesLastNameOnDefaultShipping"/> + <see userInput="EditedLastNameShipping" selector="{{StorefrontCustomerAddressesSection.defaultShippingAddress}}" stepKey="checkNewAddressesLastNameOnDefaultShipping"/> <see userInput="{{US_Address_TX_Default_Billing.firstname}}" selector="{{StorefrontCustomerAddressesSection.defaultBillingAddress}}" stepKey="checkNewAddressesFirstNameOnDefaultBilling"/> <see userInput="{{US_Address_TX_Default_Billing.lastname}}" selector="{{StorefrontCustomerAddressesSection.defaultBillingAddress}}" stepKey="checkNewAddressesLastNameOnDefaultBilling"/> </test> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifySecureURLRedirectCustomerTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifySecureURLRedirectCustomerTest.xml index 410070234b9c..3fae59f03f34 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifySecureURLRedirectCustomerTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifySecureURLRedirectCustomerTest.xml @@ -25,15 +25,11 @@ <executeJS function="return window.location.host" stepKey="hostname"/> <magentoCLI command="config:set web/secure/base_url https://{$hostname}/" stepKey="setSecureBaseURL"/> <magentoCLI command="config:set web/secure/use_in_frontend 1" stepKey="useSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set web/secure/use_in_frontend 0" stepKey="dontUseSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <executeJS function="return window.location.host" stepKey="hostname"/> <amOnUrl url="http://{$hostname}/customer" stepKey="goToUnsecureCustomerURL"/> diff --git a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Form/Element/Address/FileTest.php b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Form/Element/Address/FileTest.php new file mode 100644 index 000000000000..7a86b35a9802 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Form/Element/Address/FileTest.php @@ -0,0 +1,89 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\Block\Adminhtml\Form\Element\Address; + +use Magento\Backend\Helper\Data; +use Magento\Customer\Block\Adminhtml\Form\Element\Address\File; +use Magento\Framework\Data\Form\Element\CollectionFactory; +use Magento\Framework\Data\Form\Element\Factory; +use Magento\Framework\Escaper; +use Magento\Framework\Url\EncoderInterface; +use Magento\Framework\View\Asset\Repository; +use PHPUnit\Framework\TestCase; + +/** + * Test customer address file element block + */ +class FileTest extends TestCase +{ + /** + * @var File + */ + private $model; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $factoryElement = $this->createMock(Factory::class); + $factoryCollection = $this->createMock(CollectionFactory::class); + $escaper = $this->createMock(Escaper::class); + $adminhtmlData = $this->createMock(Data::class); + $assetRepo = $this->createMock(Repository::class); + $urlEncoder = $this->createMock(EncoderInterface::class); + $formKey = $this->createMock(\Magento\Framework\Data\Form\FormKey::class); + $form = new \Magento\Framework\Data\Form( + $factoryElement, + $factoryCollection, + $formKey + ); + $class = $this->modelClass(); + $this->model = new $class( + $factoryElement, + $factoryCollection, + $escaper, + $adminhtmlData, + $assetRepo, + $urlEncoder, + ); + $this->model->setForm($form); + $adminhtmlData->method('getUrl') + ->willReturnCallback( + function (string $path, array $params) { + $url = 'http://example.com/admin/' . trim($path, '/'); + foreach ($params as $key => $value) { + $url .= "/$key/$value"; + } + return $url; + } + ); + $urlEncoder->method('encode') + ->willReturnCallback('md5'); + } + + /** + * Test that the file element html has proper download link + */ + public function testGetElementHtml(): void + { + $expected = 'http://example.com/admin/customer/address/viewfile/file/a7aef9426d9744cdf873c83ee830f6f5'; + $filePath = '/i/m/image.png'; + $this->model->setValue($filePath); + $this->assertStringContainsString($expected, $this->model->getElementHtml()); + } + + /** + * @return string + */ + public function modelClass(): string + { + return File::class; + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Form/Element/Address/ImageTest.php b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Form/Element/Address/ImageTest.php new file mode 100644 index 000000000000..c6289995be7b --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Form/Element/Address/ImageTest.php @@ -0,0 +1,24 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\Block\Adminhtml\Form\Element\Address; + +use Magento\Customer\Block\Adminhtml\Form\Element\Address\Image; + +/** + * Test customer address image element block + */ +class ImageTest extends FileTest +{ + /** + * @inheritdoc + */ + public function modelClass(): string + { + return Image::class; + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/From/Element/ImageTest.php b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/From/Element/ImageTest.php index 123ea590434c..7016b22384e7 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/From/Element/ImageTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/From/Element/ImageTest.php @@ -69,7 +69,7 @@ public function testGetPreviewFile() ->willReturnArgument(0); $this->backendHelperMock->expects($this->once()) ->method('getUrl') - ->with('customer/index/viewfile', ['image' => $value]) + ->with('customer/index/viewfile', ['file' => $value]) ->willReturn($url); $this->assertStringContainsString($url, $this->image->getElementHtml()); diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Account/CreateTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Account/CreateTest.php index ad024d7e65c0..fc32562e8aaa 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Account/CreateTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Account/CreateTest.php @@ -69,6 +69,14 @@ class CreateTest extends TestCase */ protected $pageFactoryMock; + /** + * @var Http|MockObject + */ + private $request; + + /** + * @inheritDoc + */ protected function setUp(): void { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Account/LogoutTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Account/LogoutTest.php index ff218ef7a2e3..2381e38fc1e7 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Account/LogoutTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Account/LogoutTest.php @@ -7,6 +7,7 @@ namespace Magento\Customer\Test\Unit\Controller\Account; +use Magento\Customer\Api\SessionCleanerInterface; use Magento\Customer\Controller\Account\Logout; use Magento\Customer\Model\Session; use Magento\Framework\App\Action\Context; @@ -48,6 +49,11 @@ class LogoutTest extends TestCase /** @var RedirectInterface|MockObject */ protected $redirect; + /** + * @var SessionCleanerInterface|MockObject + */ + private $sessionCleanerMock; + protected function setUp(): void { $this->contextMock = $this->getMockBuilder(Context::class) @@ -57,6 +63,7 @@ protected function setUp(): void ->disableOriginalConstructor() ->setMethods(['getId', 'logout', 'setBeforeAuthUrl', 'setLastCustomerId']) ->getMock(); + $this->sessionCleanerMock = $this->createMock(SessionCleanerInterface::class); $this->cookieMetadataFactory = $this->getMockBuilder(CookieMetadataFactory::class) ->disableOriginalConstructor() @@ -83,7 +90,7 @@ protected function setUp(): void ->method('getRedirect') ->willReturn($this->redirect); - $this->controller = new Logout($this->contextMock, $this->sessionMock); + $this->controller = new Logout($this->contextMock, $this->sessionMock, $this->sessionCleanerMock); $refClass = new \ReflectionClass(Logout::class); $cookieMetadataManagerProperty = $refClass->getProperty('cookieMetadataManager'); @@ -117,6 +124,11 @@ public function testExecute() ->method('setLastCustomerId') ->with($customerId); + $this->sessionCleanerMock->expects($this->once()) + ->method('clearFor') + ->with($customerId) + ->willReturnSelf(); + $this->cookieManager->expects($this->once()) ->method('getCookie') ->with('mage-cache-sessid') diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php index a5186e1dc5c0..7fd6806013ef 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php @@ -11,6 +11,8 @@ use Magento\Backend\Model\Session; use Magento\Backend\Model\View\Result\Forward; use Magento\Backend\Model\View\Result\ForwardFactory; +use Magento\Customer\Api\Data\GroupExtension; +use Magento\Customer\Api\Data\GroupExtensionInterfaceFactory; use Magento\Customer\Api\Data\GroupInterface; use Magento\Customer\Api\Data\GroupInterfaceFactory; use Magento\Customer\Api\GroupRepositoryInterface; @@ -64,9 +66,6 @@ class SaveTest extends TestCase /** @var Redirect|MockObject */ protected $resultRedirect; - /** @var GroupInterface|MockObject */ - protected $customerGroup; - /** @var ManagerInterface|MockObject */ protected $messageManager; @@ -79,6 +78,12 @@ class SaveTest extends TestCase /** @var Session|MockObject */ protected $session; + /** @var GroupExtensionInterfaceFactory $groupExtensionInterfaceFactory|MockObject */ + private $groupExtensionInterfaceFactory; + + /** @var GroupExtension/MockObject */ + private $groupExtension; + protected function setUp(): void { $this->contextMock = $this->getMockBuilder(Context::class) @@ -109,30 +114,36 @@ protected function setUp(): void $this->resultRedirect = $this->getMockBuilder(Redirect::class) ->disableOriginalConstructor() ->getMock(); - $this->customerGroup = $this->getMockBuilder(GroupInterface::class) - ->getMockForAbstractClass(); $this->messageManager = $this->getMockBuilder(ManagerInterface::class) ->getMockForAbstractClass(); $this->resultForward = $this->getMockBuilder(Forward::class) ->disableOriginalConstructor() ->getMock(); $this->group = $this->getMockBuilder(GroupInterface::class) + ->setMethods(['setExtensionAttributes']) ->getMockForAbstractClass(); $this->session = $this->getMockBuilder(Session::class) ->disableOriginalConstructor() ->setMethods(['setCustomerGroupData']) ->getMock(); + $this->groupExtensionInterfaceFactory = $this->getMockBuilder(GroupExtensionInterfaceFactory::class) + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->groupExtension = $this->getMockBuilder(GroupExtension::class) + ->disableOriginalConstructor() + ->getMock(); - $this->contextMock->expects($this->once()) + $this->contextMock->expects(self::once()) ->method('getMessageManager') ->willReturn($this->messageManager); - $this->contextMock->expects($this->once()) + $this->contextMock->expects(self::once()) ->method('getRequest') ->willReturn($this->request); - $this->contextMock->expects($this->once()) + $this->contextMock->expects(self::once()) ->method('getResultRedirectFactory') ->willReturn($this->resultRedirectFactory); - $this->contextMock->expects($this->once()) + $this->contextMock->expects(self::once()) ->method('getSession') ->willReturn($this->session); @@ -143,24 +154,37 @@ protected function setUp(): void $this->groupInterfaceFactoryMock, $this->forwardFactoryMock, $this->pageFactoryMock, - $this->dataObjectProcessorMock + $this->dataObjectProcessorMock, + $this->groupExtensionInterfaceFactory ); } - public function testExecuteWithTaxClassAndException() + public function testExecuteWithTaxClassAndException(): void { $taxClass = '3'; $groupId = 0; $code = 'NOT LOGGED IN'; - $this->request->expects($this->exactly(3)) - ->method('getParam') - ->withConsecutive( - ['tax_class'], - ['id'], - ['code'] - ) - ->willReturnOnConsecutiveCalls($taxClass, $groupId, null); + $this->request->method('getParam') + ->willReturnMap( + [ + ['tax_class', null, $taxClass], + ['id', null, $groupId], + ['code', null, null], + ['customer_group_excluded_websites', null, ''] + ] + ); + $this->groupExtensionInterfaceFactory->expects(self::once()) + ->method('create') + ->willReturn($this->groupExtension); + $this->groupExtension->expects(self::once()) + ->method('setExcludeWebsiteIds') + ->with([]) + ->willReturnSelf(); + $this->group->expects(self::once()) + ->method('setExtensionAttributes') + ->with($this->groupExtension) + ->willReturnSelf(); $this->resultRedirectFactory->expects($this->once()) ->method('create') ->willReturn($this->resultRedirect); @@ -168,55 +192,55 @@ public function testExecuteWithTaxClassAndException() ->method('getById') ->with($groupId) ->willReturn($this->group); - $this->group->expects($this->once()) + $this->group->expects(self::once()) ->method('getCode') ->willReturn($code); - $this->group->expects($this->once()) + $this->group->expects(self::once()) ->method('setCode') ->with($code); - $this->group->expects($this->once()) + $this->group->expects(self::once()) ->method('setTaxClassId') ->with($taxClass); - $this->groupRepositoryMock->expects($this->once()) + $this->groupRepositoryMock->expects(self::once()) ->method('save') ->with($this->group); - $this->messageManager->expects($this->once()) + $this->messageManager->expects(self::once()) ->method('addSuccessMessage') ->with(__('You saved the customer group.')); $exception = new \Exception('Exception'); - $this->resultRedirect->expects($this->at(0)) + $this->resultRedirect->expects(self::at(0)) ->method('setPath') ->with('customer/group') ->willThrowException($exception); - $this->messageManager->expects($this->once()) + $this->messageManager->expects(self::once()) ->method('addErrorMessage') ->with('Exception'); - $this->dataObjectProcessorMock->expects($this->once()) + $this->dataObjectProcessorMock->expects(self::once()) ->method('buildOutputDataArray') ->with($this->group, GroupInterface::class) ->willReturn(['code' => $code]); - $this->session->expects($this->once()) + $this->session->expects(self::once()) ->method('setCustomerGroupData') ->with(['customer_group_code' => $code]); - $this->resultRedirect->expects($this->at(1)) + $this->resultRedirect->expects(self::at(1)) ->method('setPath') ->with('customer/group/edit', ['id' => $groupId]); - $this->assertSame($this->resultRedirect, $this->controller->execute()); + self::assertSame($this->resultRedirect, $this->controller->execute()); } - public function testExecuteWithoutTaxClass() + public function testExecuteWithoutTaxClass(): void { - $this->request->expects($this->once()) + $this->request->expects(self::once()) ->method('getParam') ->with('tax_class') ->willReturn(null); - $this->forwardFactoryMock->expects($this->once()) + $this->forwardFactoryMock->expects(self::once()) ->method('create') ->willReturn($this->resultForward); - $this->resultForward->expects($this->once()) + $this->resultForward->expects(self::once()) ->method('forward') ->with('new') ->willReturnSelf(); - $this->assertSame($this->resultForward, $this->controller->execute()); + self::assertSame($this->resultForward, $this->controller->execute()); } } diff --git a/app/code/Magento/Customer/Test/Unit/Helper/ViewTest.php b/app/code/Magento/Customer/Test/Unit/Helper/ViewTest.php index b93ee2b1abec..03d6dbf1c2c7 100644 --- a/app/code/Magento/Customer/Test/Unit/Helper/ViewTest.php +++ b/app/code/Magento/Customer/Test/Unit/Helper/ViewTest.php @@ -12,6 +12,7 @@ use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Helper\View; use Magento\Framework\App\Helper\Context; +use Magento\Framework\Escaper; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -26,6 +27,11 @@ class ViewTest extends TestCase /** @var CustomerMetadataInterface|MockObject */ protected $customerMetadataService; + /** + * @var Escaper|MockObject + */ + private $escaperMock; + protected function setUp(): void { $this->context = $this->getMockBuilder(Context::class) @@ -38,8 +44,9 @@ protected function setUp(): void $this->customerMetadataService->expects($this->any()) ->method('getAttributeMetadata') ->willReturn($attributeMetadata); + $this->escaperMock = $this->createMock(Escaper::class); - $this->object = new View($this->context, $this->customerMetadataService); + $this->object = new View($this->context, $this->customerMetadataService, $this->escaperMock); } /** @@ -60,6 +67,7 @@ public function testGetCustomerName($prefix, $firstName, $middleName, $lastName, ->method('getLastname')->willReturn($lastName); $customerData->expects($this->any()) ->method('getSuffix')->willReturn($suffix); + $this->escaperMock->expects($this->once())->method('escapeHtml')->with($result)->willReturn($result); $this->assertEquals($result, $this->object->getCustomerName($customerData)); } diff --git a/app/code/Magento/Customer/Test/Unit/Model/Account/RedirectTest.php b/app/code/Magento/Customer/Test/Unit/Model/Account/RedirectTest.php index 0edeff1e6d12..eb93fbf06f6e 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Account/RedirectTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Account/RedirectTest.php @@ -398,6 +398,10 @@ public function testSetRedirectCookie(): void ->method('setPath') ->with('storePath') ->willReturnSelf(); + $publicMetadataMock->expects($this->once()) + ->method('setSameSite') + ->with('Lax') + ->willReturnSelf(); $coockieManagerMock->expects($this->once()) ->method('setPublicCookie') ->with( diff --git a/app/code/Magento/Customer/Test/Unit/Model/Address/Validator/CustomerTest.php b/app/code/Magento/Customer/Test/Unit/Model/Address/Validator/CustomerTest.php new file mode 100644 index 000000000000..ad50e09e1150 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Model/Address/Validator/CustomerTest.php @@ -0,0 +1,201 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\Model\Address\Validator; + +use Magento\Customer\Model\Address; +use Magento\Customer\Model\Address\Validator\Customer as CustomerValidator; +use Magento\Customer\Model\AddressFactory; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Quote\Model\Quote\Address as QuoteAddress; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test for Magento\Customer\Model\Address\Validator\Customer class. + */ +class CustomerTest extends TestCase +{ + /** @var AddressFactory|MockObject */ + private $addressFactoryMock; + + /** @var CustomerValidator */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $this->addressFactoryMock = $this->createMock(AddressFactory::class); + $objectManager = new ObjectManager($this); + + $this->model = $objectManager->getObject( + CustomerValidator::class, + [ + 'addressFactory' => $this->addressFactoryMock, + ] + ); + } + + /** + * @return void + */ + public function testValidateNewCustomerWithNewCustomerAddress(): void + { + $addressMock = $this->getMockBuilder(Address::class) + ->onlyMethods(['getId', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + + $addressMock->expects($this->once())->method('getId')->willReturn(null); + $addressMock->expects($this->never())->method('getCustomerId'); + + $this->assertEmpty($this->model->validate($addressMock)); + } + + /** + * @return void + */ + public function testValidateNewCustomerWithExistingCustomerAddress(): void + { + $addressMock = $this->getMockBuilder(Address::class) + ->onlyMethods(['getId', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + $originalAddressMock = $this->getMockBuilder(Address::class) + ->onlyMethods(['getId', 'load', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + + $addressMock->expects($this->once())->method('getId')->willReturn(1); + $addressMock->expects($this->once())->method('getCustomerId')->willReturn(null); + $this->addressFactoryMock->expects($this->once())->method('create')->willReturn($originalAddressMock); + $originalAddressMock->expects($this->once()) + ->method('load') + ->with(1) + ->willReturn($originalAddressMock); + $originalAddressMock->expects($this->once())->method('getCustomerId')->willReturn(2); + + $this->assertEquals( + [ + __( + 'Provided customer ID "%customer_id" isn\'t related to current customer address.', + ['customer_id' => null] + ) + ], + $this->model->validate($addressMock) + ); + } + + /** + * @return void + */ + public function testValidateExistingCustomerWithNewCustomerAddress(): void + { + $addressMock = $this->getMockBuilder(Address::class) + ->onlyMethods(['getId', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + + $addressMock->expects($this->once())->method('getId')->willReturn(null); + $addressMock->expects($this->never())->method('getCustomerId'); + + $this->assertEmpty($this->model->validate($addressMock)); + } + + /** + * @return void + */ + public function testValidateExistingCustomerWithRelevantCustomerAddress(): void + { + $addressMock = $this->getMockBuilder(Address::class) + ->onlyMethods(['getId', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + $originalAddressMock = $this->getMockBuilder(Address::class) + ->onlyMethods(['getId', 'load', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + + $addressMock->expects($this->once())->method('getId')->willReturn(1); + $this->addressFactoryMock->expects($this->once())->method('create')->willReturn($originalAddressMock); + $originalAddressMock->expects($this->once()) + ->method('load') + ->with(1) + ->willReturn($originalAddressMock); + + $addressMock->expects($this->once())->method('getCustomerId')->willReturn(1); + $originalAddressMock->expects($this->once())->method('getCustomerId')->willReturn(1); + + $this->assertEmpty($this->model->validate($addressMock)); + } + + /** + * @return void + */ + public function testValidateExistingCustomerAddressWithNotRelevantCustomer(): void + { + $addressMock = $this->getMockBuilder(Address::class) + ->onlyMethods(['getId', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + $originalAddressMock = $this->getMockBuilder(Address::class) + ->onlyMethods(['getId', 'load', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + + $addressMock->expects($this->once())->method('getId')->willReturn(1); + $this->addressFactoryMock->expects($this->once())->method('create')->willReturn($originalAddressMock); + $originalAddressMock->expects($this->once()) + ->method('load') + ->with(1) + ->willReturn($originalAddressMock); + + $addressMock->expects($this->once())->method('getCustomerId')->willReturn(2); + $originalAddressMock->expects($this->once())->method('getCustomerId')->willReturn(1); + + $this->assertEquals( + [ + __( + 'Provided customer ID "%customer_id" isn\'t related to current customer address.', + ['customer_id' => 2] + ) + ], + $this->model->validate($addressMock) + ); + } + + /** + * @return void + */ + public function testValidateExistingCustomerWithQuoteAddress(): void + { + $addressMock = $this->getMockBuilder(QuoteAddress::class) + ->onlyMethods(['getCustomerAddressId', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + $originalAddressMock = $this->getMockBuilder(Address::class) + ->onlyMethods(['getId', 'load', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + + $addressMock->expects($this->once())->method('getCustomerAddressId')->willReturn(1); + $addressMock->expects($this->once())->method('getCustomerId')->willReturn(1); + + $this->addressFactoryMock->expects($this->once())->method('create')->willReturn($originalAddressMock); + $originalAddressMock->expects($this->once()) + ->method('load') + ->with(1) + ->willReturn($originalAddressMock); + + $addressMock->expects($this->once())->method('getCustomerId')->willReturn(1); + $originalAddressMock->expects($this->once())->method('getCustomerId')->willReturn(1); + + $this->assertEmpty($this->model->validate($addressMock)); + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Model/CustomerTest.php b/app/code/Magento/Customer/Test/Unit/Model/CustomerTest.php index 65705fcc6ea4..f2cbac781000 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/CustomerTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/CustomerTest.php @@ -123,7 +123,6 @@ protected function setUp(): void $this->_config = $this->createMock(Config::class); $this->_attribute = $this->createMock(Attribute::class); $this->_storeManager = $this->createMock(StoreManager::class); - $this->_storetMock = $this->createMock(Store::class); $this->_scopeConfigMock = $this->getMockForAbstractClass(ScopeConfigInterface::class); $this->_transportBuilderMock = $this->createMock(TransportBuilder::class); $this->_transportMock = $this->getMockForAbstractClass(TransportInterface::class); diff --git a/app/code/Magento/Customer/Test/Unit/Model/EmailNotificationTest.php b/app/code/Magento/Customer/Test/Unit/Model/EmailNotificationTest.php index 51d8c197831b..81252121c500 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/EmailNotificationTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/EmailNotificationTest.php @@ -20,6 +20,7 @@ use Magento\Framework\Mail\TransportInterface; use Magento\Framework\Reflection\DataObjectProcessor; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Store\Model\App\Emulation; use Magento\Store\Model\ScopeInterface; use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; @@ -113,6 +114,10 @@ class EmailNotificationTest extends TestCase * @var SenderResolverInterface|MockObject */ private $senderResolverMock; + /** + * @var Emulation|MockObject + */ + private $emulation; /** * @inheritdoc @@ -144,6 +149,7 @@ protected function setUp(): void ->setMethods(['resolve']) ->disableOriginalConstructor() ->getMockForAbstractClass(); + $this->emulation = $this->createMock(Emulation::class); $objectManager = new ObjectManagerHelper($this); @@ -157,6 +163,7 @@ protected function setUp(): void 'dataProcessor' => $this->dataProcessorMock, 'scopeConfig' => $this->scopeConfigMock, 'senderResolver' => $this->senderResolverMock, + 'emulation' => $this->emulation, ] ); } @@ -336,6 +343,14 @@ public function testEmailNotifyWhenCredentialsChanged( $transport->expects(clone $expects) ->method('sendMessage'); + $this->emulation->expects(clone $expects) + ->method('startEnvironmentEmulation') + ->willReturnSelf(); + + $this->emulation->expects(clone $expects) + ->method('stopEnvironmentEmulation') + ->willReturnSelf(); + $this->model->credentialsChanged($savedCustomer, $oldEmail, $isPasswordChanged); } @@ -498,6 +513,14 @@ public function testPasswordReminder($customerStoreId):void ['customer' => $this->customerSecureMock, 'store' => $this->storeMock] ); + $this->emulation->expects($this->once()) + ->method('startEnvironmentEmulation') + ->willReturnSelf(); + + $this->emulation->expects($this->once()) + ->method('stopEnvironmentEmulation') + ->willReturnSelf(); + $this->model->passwordReminder($customerMock); } @@ -595,6 +618,14 @@ public function testPasswordReminderCustomerWithoutStoreId():void self::STUB_CUSTOMER_NAME, ['customer' => $this->customerSecureMock, 'store' => $this->storeMock] ); + $this->emulation->expects($this->once()) + ->method('startEnvironmentEmulation') + ->willReturnSelf(); + + $this->emulation->expects($this->once()) + ->method('stopEnvironmentEmulation') + ->willReturnSelf(); + $this->model->passwordReminder($customer); } @@ -690,6 +721,13 @@ public function testPasswordResetConfirmation($customerStoreId):void self::STUB_CUSTOMER_NAME, ['customer' => $this->customerSecureMock, 'store' => $this->storeMock] ); + $this->emulation->expects($this->once()) + ->method('startEnvironmentEmulation') + ->willReturnSelf(); + + $this->emulation->expects($this->once()) + ->method('stopEnvironmentEmulation') + ->willReturnSelf(); $this->model->passwordResetConfirmation($customerMock); } @@ -785,6 +823,13 @@ public function testNewAccount($customerStoreId):void self::STUB_CUSTOMER_NAME, ['customer' => $this->customerSecureMock, 'back_url' => '', 'store' => $this->storeMock] ); + $this->emulation->expects($this->once()) + ->method('startEnvironmentEmulation') + ->willReturnSelf(); + + $this->emulation->expects($this->once()) + ->method('stopEnvironmentEmulation') + ->willReturnSelf(); $this->model->newAccount( $customer, diff --git a/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php b/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php index fb775ce78bbb..909e69accbab 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php @@ -92,10 +92,16 @@ protected function setUp(): void /** * @param $entityTypeCode * @param array $allowedExtensions + * @param string|null $customerFileUrlPath + * @param string|null $customerAddressFileUrlPath * @return FileProcessor */ - private function getModel($entityTypeCode, array $allowedExtensions = []) - { + private function getModel( + $entityTypeCode, + array $allowedExtensions = [], + string $customerFileUrlPath = null, + string $customerAddressFileUrlPath = null + ) { $model = new FileProcessor( $this->filesystem, $this->uploaderFactory, @@ -103,7 +109,9 @@ private function getModel($entityTypeCode, array $allowedExtensions = []) $this->urlEncoder, $entityTypeCode, $this->mime, - $allowedExtensions + $allowedExtensions, + $customerFileUrlPath ?? 'customer/index/viewfile', + $customerAddressFileUrlPath ?? 'customer/address/viewfile' ); return $model; } @@ -138,46 +146,85 @@ public function testIsExist() $this->assertTrue($model->isExist($fileName)); } - public function testGetViewUrlCustomer() - { - $filePath = 'filename.ext1'; - $encodedFilePath = 'encodedfilenameext1'; - - $fileUrl = 'fileUrl'; - + /** + * @param array $params + * @param string $filePath + * @param string $expectedUrl + * @dataProvider getViewUrlDataProvider + */ + public function testGetViewUrlTest( + array $params, + string $filePath, + string $expectedUrl + ): void { $this->urlEncoder->expects($this->once()) ->method('encode') - ->with($filePath) - ->willReturn($encodedFilePath); + ->willReturnCallback('md5'); $this->urlBuilder->expects($this->once()) ->method('getUrl') - ->with('customer/index/viewfile', ['image' => $encodedFilePath]) - ->willReturn($fileUrl); - - $model = $this->getModel(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER); - $this->assertEquals($fileUrl, $model->getViewUrl($filePath, 'image')); + ->willReturnCallback( + function (string $path, array $params) { + $url = 'http://example.com/' . trim($path, '/'); + foreach ($params as $key => $value) { + $url .= "/$key/$value"; + } + return $url; + } + ); + + $model = $this->getModel( + $params['entityTypeCode'], + [], + $params['customerFileUrlPath'], + $params['addressFileUrlPath'] + ); + $this->assertEquals($expectedUrl, $model->getViewUrl($filePath, 'file')); } - public function testGetViewUrlCustomerAddress() + /** + * @return array[] + */ + public function getViewUrlDataProvider(): array { - $filePath = 'filename.ext1'; - $encodedFilePath = 'encodedfilenameext1'; - - $fileUrl = 'fileUrl'; - - $this->urlEncoder->expects($this->once()) - ->method('encode') - ->with($filePath) - ->willReturn($encodedFilePath); - - $this->urlBuilder->expects($this->once()) - ->method('getUrl') - ->with('customer/address/viewfile', ['image' => $encodedFilePath]) - ->willReturn($fileUrl); - - $model = $this->getModel(AddressMetadataInterface::ENTITY_TYPE_ADDRESS); - $this->assertEquals($fileUrl, $model->getViewUrl($filePath, 'image')); + return [ + [ + [ + 'entityTypeCode' => CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, + 'customerFileUrlPath' => 'customer/index/viewfile', + 'addressFileUrlPath' => 'customer/address/viewfile', + ], + '/i/m/image1.jpeg', + 'http://example.com/customer/index/viewfile/file/57523c876842c97ab9d5fd92f8d8d9ec' + ], + [ + [ + 'entityTypeCode' => AddressMetadataInterface::ENTITY_TYPE_ADDRESS, + 'customerFileUrlPath' => 'customer/index/viewfile', + 'addressFileUrlPath' => 'customer/address/viewfile', + ], + '/i/m/image2.png', + 'http://example.com/customer/address/viewfile/file/4498819248a7f824893bd3dac4babdfc' + ], + [ + [ + 'entityTypeCode' => CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, + 'customerFileUrlPath' => 'custom_module/customer/preview', + 'addressFileUrlPath' => 'custom_module/address/preview', + ], + '/i/m/image1.jpeg', + 'http://example.com/custom_module/customer/preview/file/57523c876842c97ab9d5fd92f8d8d9ec' + ], + [ + [ + 'entityTypeCode' => AddressMetadataInterface::ENTITY_TYPE_ADDRESS, + 'customerFileUrlPath' => 'custom_module/customer/preview', + 'addressFileUrlPath' => 'custom_module/address/preview', + ], + '/i/m/image2.png', + 'http://example.com/custom_module/address/preview/file/4498819248a7f824893bd3dac4babdfc' + ] + ]; } public function testRemoveUploadedFile() @@ -370,7 +417,6 @@ public function testMoveTemporaryFile() ->with($path, $newPath) ->willReturn(true); - $model = $this->getModel(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER); $this->assertEquals('/f/i' . $filePath, $model->moveTemporaryFile($filePath)); } @@ -406,7 +452,6 @@ public function testMoveTemporaryFileNewFileName() ->with($path, 'customer/f/i/filename_2.ext1') ->willReturn(true); - $model = $this->getModel(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER); $this->assertEquals('/f/i/filename_2.ext1', $model->moveTemporaryFile($filePath)); } diff --git a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/FileTest.php b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/FileTest.php index b0e9805bb3d2..32ac9ffc5b07 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/FileTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/FileTest.php @@ -13,6 +13,7 @@ use Magento\Customer\Model\Metadata\Form\File; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\App\Request\Http; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\File\Uploader; use Magento\Framework\File\UploaderFactory; use Magento\Framework\Filesystem; @@ -302,6 +303,13 @@ public function testValidateValueToUpload($expected, $value, $parameters = []) $this->returnValue($parameters['valid']) ); + $this->fileProcessorMock->expects($this->any()) + ->method('getStat') + ->willReturn([ + 'extension' => $value['extension'], + 'basename' => $value['basename'] + ]); + $this->fileProcessorMock->expects($this->any()) ->method('isExist') ->willReturn($parameters['uploaded']); @@ -325,15 +333,33 @@ public function validateValueToUploadDataProvider() return [ 'notValid' => [ ['Validation error message.'], - ['tmp_name' => 'tempName_0001.bin', 'name' => 'realFileName.bin'], + [ + 'tmp_name' => 'tempName_0001.bin', + 'name' => 'realFileName.bin', + 'extension' => 'bin', + 'basename' => 'realFileName.bin', + ], ['valid' => false], ], 'notUploaded' => [ ['"realFileName.bin" is not a valid file.'], - ['tmp_name' => 'tempName_0001.bin', 'name' => 'realFileName.bin'], + [ + 'tmp_name' => 'tempName_0001.bin', + 'name' => 'realFileName.bin', + 'extension' => 'bin', + 'basename' => 'realFileName.bin', + ], ['uploaded' => false], ], - 'isValid' => [true, ['tmp_name' => 'tempName_0001.txt', 'name' => 'realFileName.txt']] + 'isValid' => [ + true, + [ + 'tmp_name' => 'tempName_0001.txt', + 'name' => 'realFileName.txt', + 'extension' => 'txt', + 'basename' => 'realFileName.txt', + ], + ], ]; } @@ -367,7 +393,7 @@ public function testCompactValueNoDelete() ->with('value') ->willReturnSelf(); - $this->assertSame('value', $model->compactValue([])); + $this->assertSame([], $model->compactValue([])); } public function testCompactValueDelete() @@ -416,7 +442,12 @@ public function testCompactValueTmpFile() $this->uploaderFactoryMock->expects($this->once()) ->method('create') ->with(['fileId' => $value]) - ->will($this->returnValue($uploaderMock)); + ->willReturn($uploaderMock); + $uploaderMock->expects($this->once())->method('getFileExtension')->willReturn('file'); + $this->fileValidatorMock->expects($this->once()) + ->method('isValid') + ->with('file') + ->willReturn(true); $uploaderMock->expects($this->once()) ->method('setFilesDispersion') ->with(true); @@ -594,7 +625,7 @@ public function testCompactValueRemoveUiComponentValue() ->with($value) ->willReturnSelf(); - $this->assertEquals($value, $model->compactValue([])); + $this->assertEquals([], $model->compactValue([])); } public function testCompactValueNoAction() @@ -659,8 +690,14 @@ public function testCompactValueInputField() ->willReturn($mediaDirectoryMock); $uploaderMock = $this->getMockBuilder( - \Magento\Framework\File\Uploader::class - )->disableOriginalConstructor()->getMock(); + Uploader::class + )->disableOriginalConstructor() + ->getMock(); + $uploaderMock->expects($this->once())->method('getFileExtension')->willReturn('ext1'); + $this->fileValidatorMock->expects($this->once()) + ->method('isValid') + ->with('ext1') + ->willReturn(true); $uploaderMock->expects($this->once()) ->method('setFilesDispersion') ->with(true) @@ -720,9 +757,31 @@ public function testCompactValueInputFieldWithException() $exception = new \Exception('Error'); + $uploaderMock = $this->createMock(Uploader::class); $this->uploaderFactoryMock->expects($this->once()) ->method('create') ->with(['fileId' => $value]) + ->willReturn($uploaderMock); + $uploaderMock->expects($this->once())->method('getFileExtension')->willReturn('ext1'); + $this->fileValidatorMock->expects($this->once()) + ->method('isValid') + ->with('ext1') + ->willReturn(true); + $uploaderMock->expects($this->once()) + ->method('setFilesDispersion') + ->with(true) + ->willReturnSelf(); + $uploaderMock->expects($this->once()) + ->method('setFilenamesCaseSensitivity') + ->with(false) + ->willReturnSelf(); + $uploaderMock->expects($this->once()) + ->method('setAllowRenameFiles') + ->with(true) + ->willReturnSelf(); + $uploaderMock->expects($this->once()) + ->method('save') + ->with(self::ENTITY_TYPE, $value['name']) ->willThrowException($exception); $this->loggerMock->expects($this->once()) @@ -740,4 +799,56 @@ public function testCompactValueInputFieldWithException() $this->assertEquals('', $model->compactValue($value)); } + + /** + * @return void + */ + public function testCompactValueWithProtectedExtension(): void + { + $value = [ + 'name' => 'filename.php', + 'tmp_name' => 'tmpfilename.php', + ]; + + $originValue = 'origin'; + + $mediaDirectoryMock = $this->getMockBuilder( + WriteInterface::class + )->getMockForAbstractClass(); + $mediaDirectoryMock->expects($this->once()) + ->method('delete') + ->with(self::ENTITY_TYPE . '/' . $originValue); + + $this->fileSystemMock->expects($this->once()) + ->method('getDirectoryWrite') + ->with(DirectoryList::MEDIA) + ->willReturn($mediaDirectoryMock); + + $uploaderMock = $this->createMock(Uploader::class); + $this->uploaderFactoryMock->expects($this->once()) + ->method('create') + ->with(['fileId' => $value]) + ->willReturn($uploaderMock); + $uploaderMock->expects($this->once())->method('getFileExtension')->willReturn('php'); + $this->fileValidatorMock->expects($this->once()) + ->method('isValid') + ->with('php') + ->willReturn(false); + $this->fileValidatorMock->expects($this->once()) + ->method('getMessages') + ->willReturn([ + 'php' => __('File with an extension php is protected and cannot be uploaded'), + ]); + + $model = $this->initialize([ + 'value' => $originValue, + 'isAjax' => false, + 'entityTypeCode' => self::ENTITY_TYPE, + ]); + + $this->expectException(LocalizedException::class); + $this->expectExceptionMessage('File with an extension php is protected and cannot be uploaded'); + + $this->assertEquals('', $model->compactValue($value)); + } } diff --git a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/ImageTest.php b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/ImageTest.php index 8017c367c081..2a74bcdccd03 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/ImageTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/ImageTest.php @@ -197,7 +197,7 @@ private function initialize(array $data): Image public function testValidateIsNotValidFile() { $value = [ - 'tmp_name' => 'tmp_file', + 'tmp_name' => 'tmp_file.txt', 'name' => 'realFileName', ]; diff --git a/app/code/Magento/Customer/Test/Unit/Model/Plugin/SaveCustomerGroupExcludedWebsiteTest.php b/app/code/Magento/Customer/Test/Unit/Model/Plugin/SaveCustomerGroupExcludedWebsiteTest.php new file mode 100644 index 000000000000..b6c7cedbb428 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Model/Plugin/SaveCustomerGroupExcludedWebsiteTest.php @@ -0,0 +1,290 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\Model\Plugin; + +use Magento\Catalog\Model\Indexer\Product\Price\Processor; +use Magento\Customer\Api\Data\GroupExtensionInterface; +use Magento\Customer\Api\Data\GroupInterface; +use Magento\Customer\Api\GroupRepositoryInterface; +use Magento\Customer\Api\GroupExcludedWebsiteRepositoryInterface; +use Magento\Customer\Model\Data\GroupExcludedWebsite; +use Magento\Customer\Model\Data\GroupExcludedWebsiteFactory; +use Magento\Customer\Model\Plugin\SaveCustomerGroupExcludedWebsite; +use Magento\Customer\Model\ResourceModel\GroupExcludedWebsite as GroupExcludedWebsiteResourceModel; +use Magento\Framework\Indexer\IndexerInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Store\Model\System\Store; +use Magento\Store\Model\Website; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class SaveCustomerGroupExcludedWebsiteTest extends TestCase +{ + /** + * @var GroupInterface|MockObject + */ + private $groupInterface; + + /** + * @var GroupExtensionInterface|MockObject + */ + private $groupExtensionInterface; + + /** + * @var GroupRepositoryInterface|MockObject + */ + private $groupRepositoryInterface; + + /** + * @var GroupExcludedWebsiteFactory|MockObject + */ + private $groupExcludedWebsiteFactory; + + /** + * @var GroupExcludedWebsite|MockObject + */ + private $groupExcludedWebsite; + + /** + * @var GroupExcludedWebsiteRepositoryInterface|MockObject + */ + private $groupExcludedWebsiteRepository; + + /** + * @var GroupExcludedWebsiteResourceModel|MockObject + */ + private $groupExcludedWebsiteResourceModel; + + /** + * @var Store|MockObject + */ + private $store; + + /** + * @var Processor|MockObject + */ + private $priceIndexProcessor; + + /** + * @var IndexerInterface + */ + private $priceIndexer; + + /** + * @var SaveCustomerGroupExcludedWebsite + */ + private $plugin; + + protected function setUp(): void + { + $objectManagerHelper = new ObjectManager($this); + + $this->groupExcludedWebsiteFactory = $this->getMockBuilder(GroupExcludedWebsiteFactory::class) + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + $this->groupExcludedWebsiteRepository = $this->getMockForAbstractClass( + GroupExcludedWebsiteRepositoryInterface::class + ); + $this->groupExcludedWebsiteResourceModel = $this->createMock(GroupExcludedWebsiteResourceModel::class); + $this->groupExcludedWebsite = $this->getMockBuilder(GroupExcludedWebsite::class) + ->disableOriginalConstructor() + ->getMock(); + $this->groupRepositoryInterface = $this->getMockBuilder(GroupRepositoryInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->groupInterface = $this->getMockBuilder(GroupInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->groupExtensionInterface = $this->getMockBuilder(GroupExtensionInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->groupInterface->method('getExtensionAttributes') + ->willReturn($this->groupExtensionInterface); + $this->groupInterface->method('getId')->willReturn(1); + + $this->store = $this->createPartialMock( + Store::class, + ['getWebsiteCollection', 'getGroupCollection', 'getStoreCollection'] + ); + $this->priceIndexProcessor = $this->getMockBuilder(Processor::class) + ->disableOriginalConstructor() + ->getMock(); + $this->priceIndexer = $this->getMockBuilder(IndexerInterface::class) + ->getMockForAbstractClass(); + + $this->plugin = $objectManagerHelper->getObject( + SaveCustomerGroupExcludedWebsite::class, + [ + 'groupExcludedWebsiteFactory' => $this->groupExcludedWebsiteFactory, + 'groupExcludedWebsiteRepository' => $this->groupExcludedWebsiteRepository, + 'systemStore' => $this->store, + 'priceIndexProcessor' => $this->priceIndexProcessor + ] + ); + } + + public function testAfterSaveWithoutExtensionAttributes(): void + { + $this->groupExtensionInterface->method('getExcludeWebsiteIds')->willReturn(null); + $this->groupInterface->expects(self::never())->method('getId'); + + $this->plugin->afterSave($this->groupRepositoryInterface, $this->groupInterface, $this->groupInterface); + } + + /** + * @dataProvider dataProviderNoExcludedWebsitesChanged + * @param array $excludedWebsites + * @param array $websitesToExclude + * @throws \Magento\Framework\Exception\CouldNotSaveException + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function testAfterSaveWithNoExcludedWebsitesChanged(array $excludedWebsites, array $websitesToExclude): void + { + $this->getAllWebsites(); + + $this->groupExtensionInterface->method('getExcludeWebsiteIds')->willReturn($websitesToExclude); + $this->groupExcludedWebsiteRepository->method('getCustomerGroupExcludedWebsites') + ->with(1)->willReturn($excludedWebsites); + $this->groupExcludedWebsiteRepository->expects(self::never())->method('delete'); + $this->groupExcludedWebsiteFactory->expects(self::never())->method('create'); + + $this->plugin->afterSave($this->groupRepositoryInterface, $this->groupInterface, $this->groupInterface); + } + + /** + * @dataProvider dataProviderExcludedWebsitesChanged + * @param array $excludedWebsites + * @param array $websitesToExclude + * @param int $times + * @throws \Magento\Framework\Exception\CouldNotSaveException + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function testAfterSaveWithExcludedWebsitesChanged( + array $excludedWebsites, + array $websitesToExclude, + int $times + ): void { + $this->getAllWebsites(); + + $this->groupExtensionInterface->method('getExcludeWebsiteIds')->willReturn($websitesToExclude); + $this->groupExcludedWebsiteRepository->method('getCustomerGroupExcludedWebsites') + ->with(1)->willReturn($excludedWebsites); + $this->groupExcludedWebsiteRepository->expects(self::once())->method('delete'); + $this->groupExcludedWebsiteFactory->expects(self::exactly($times)) + ->method('create')->willReturn($this->groupExcludedWebsite); + $this->groupExcludedWebsite->expects(self::exactly($times)) + ->method('setGroupId') + ->with(1) + ->willReturnSelf(); + $this->groupExcludedWebsite->expects(self::exactly($times)) + ->method('setExcludedWebsiteId')->willReturnSelf(); + $this->groupExcludedWebsiteRepository->expects(self::exactly($times)) + ->method('save') + ->willReturn($this->groupExcludedWebsiteResourceModel); + + $this->priceIndexProcessor->expects(self::once())->method('getIndexer') + ->willReturn($this->priceIndexer); + $this->priceIndexer->expects(self::once())->method('invalidate') + ->willReturnSelf(); + + $this->plugin->afterSave($this->groupRepositoryInterface, $this->groupInterface, $this->groupInterface); + } + + private function getAllWebsites(): void + { + $websiteMock1 = $this->getMockBuilder(Website::class) + ->setMethods(['getWebsiteId']) + ->disableOriginalConstructor() + ->getMock(); + $websiteMock2 = $this->getMockBuilder(Website::class) + ->setMethods(['getWebsiteId']) + ->disableOriginalConstructor() + ->getMock(); + $this->store->expects(self::once())->method('getWebsiteCollection') + ->willReturn([$websiteMock1, $websiteMock2]); + $websiteMock1->method('getWebsiteId')->willReturn(1); + $websiteMock2->method('getWebsiteId')->willReturn(2); + } + + /** + * Data provider for customer groups where excluded websites has not changed. + * + * @return array[] + */ + public function dataProviderNoExcludedWebsitesChanged(): array + { + return [ + [ + [], [] + ], + [ + ['1', '2'], + [1, 2] + ], + [ + [1, 2], + [1, 2] + ], + [ + [1, 2], + ['1', '2'] + ], + [ + ['1', 2], + ['2', 1] + ], + [ + ['1', 2], + ['2', 1, 3] + ] + ]; + } + + /** + * Data provider for customer groups where excluded websites has changed. + * + * @return array[] + */ + public function dataProviderExcludedWebsitesChanged(): array + { + return [ + [ + ['2'], + [1, 2], + 2 + ], + [ + [], + [1, 2], + 2 + ], + [ + [2], + [1, 2], + 2 + ], + [ + [1, 2], + [], + 0 + ], + [ + [1, 2], + ['1'], + 1 + ], + [ + ['1', 2, 3], + ['2', 1], + 2 + ] + ]; + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/DeleteRelationTest.php b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/DeleteRelationTest.php index cce848240fe8..8730dba8c207 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/DeleteRelationTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/DeleteRelationTest.php @@ -22,12 +22,11 @@ class DeleteRelationTest extends TestCase /** @var DeleteRelation */ protected $relation; + /** + * @inheritDoc + */ protected function setUp(): void { - $this->customerFactoryMock = $this->createPartialMock( - CustomerFactory::class, - ['create'] - ); $this->relation = (new ObjectManagerHelper($this))->getObject( DeleteRelation::class ); diff --git a/app/code/Magento/Customer/Test/Unit/Model/Webapi/ParamOverriderCustomerGroupIdTest.php b/app/code/Magento/Customer/Test/Unit/Model/Webapi/ParamOverriderCustomerGroupIdTest.php new file mode 100644 index 000000000000..05ea6cb5f2ea --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Model/Webapi/ParamOverriderCustomerGroupIdTest.php @@ -0,0 +1,89 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\Model\Webapi; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Customer\Model\Webapi\ParamOverriderCustomerGroupId; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test for Magento\Webapi\Controller\Rest\ParamOverriderCustomerGroupId class. + */ +class ParamOverriderCustomerGroupIdTest extends TestCase +{ + /** + * @var ParamOverriderCustomerGroupId + */ + private $model; + + /** + * @var UserContextInterface|MockObject + */ + private $userContextMock; + + /** + * @var CustomerRepositoryInterface|MockObject + */ + private $customerRepositoryMock; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $this->userContextMock = $this->createMock(UserContextInterface::class); + $this->customerRepositoryMock = $this->createMock(CustomerRepositoryInterface::class); + $this->model = (new ObjectManager($this))->getObject( + ParamOverriderCustomerGroupId::class, + [ + 'userContext' => $this->userContextMock, + 'customerRepository' => $this->customerRepositoryMock, + ] + ); + } + + /** + * @return void + */ + public function testGetOverriddenValueIsCustomer(): void + { + $userId = 1; + $groupId = 1; + $customerMock = $this->createMock(CustomerInterface::class); + + $this->userContextMock->expects($this->once()) + ->method('getUserType') + ->willReturn(UserContextInterface::USER_TYPE_CUSTOMER); + $this->userContextMock->expects($this->once()) + ->method('getUserId') + ->willReturn($userId); + $this->customerRepositoryMock->expects($this->once()) + ->method('getById') + ->with($userId) + ->willReturn($customerMock); + $customerMock->expects($this->once())->method('getGroupId')->willReturn($groupId); + + $this->assertSame($groupId, $this->model->getOverriddenValue()); + } + + /** + * @return void + */ + public function testGetOverriddenValueIsNotCustomer(): void + { + $this->userContextMock->expects($this->once()) + ->method('getUserType') + ->willReturn(UserContextInterface::USER_TYPE_ADMIN); + + $this->assertNull($this->model->getOverriddenValue()); + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Model/Webapi/ParamOverriderCustomerStoreIdTest.php b/app/code/Magento/Customer/Test/Unit/Model/Webapi/ParamOverriderCustomerStoreIdTest.php new file mode 100644 index 000000000000..feb5701d540a --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Model/Webapi/ParamOverriderCustomerStoreIdTest.php @@ -0,0 +1,89 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\Model\Webapi; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Customer\Model\Webapi\ParamOverriderCustomerStoreId; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test for Magento\Webapi\Controller\Rest\ParamOverriderCustomerStoreId class. + */ +class ParamOverriderCustomerStoreIdTest extends TestCase +{ + /** + * @var ParamOverriderCustomerStoreId + */ + private $model; + + /** + * @var UserContextInterface|MockObject + */ + private $userContextMock; + + /** + * @var CustomerRepositoryInterface|MockObject + */ + private $customerRepositoryMock; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $this->userContextMock = $this->createMock(UserContextInterface::class); + $this->customerRepositoryMock = $this->createMock(CustomerRepositoryInterface::class); + $this->model = (new ObjectManager($this))->getObject( + ParamOverriderCustomerStoreId::class, + [ + 'userContext' => $this->userContextMock, + 'customerRepository' => $this->customerRepositoryMock, + ] + ); + } + + /** + * @return void + */ + public function testGetOverriddenValueIsCustomer(): void + { + $userId = 1; + $groupId = 1; + $customerMock = $this->createMock(CustomerInterface::class); + + $this->userContextMock->expects($this->once()) + ->method('getUserType') + ->willReturn(UserContextInterface::USER_TYPE_CUSTOMER); + $this->userContextMock->expects($this->once()) + ->method('getUserId') + ->willReturn($userId); + $this->customerRepositoryMock->expects($this->once()) + ->method('getById') + ->with($userId) + ->willReturn($customerMock); + $customerMock->expects($this->once())->method('getStoreId')->willReturn($groupId); + + $this->assertSame($groupId, $this->model->getOverriddenValue()); + } + + /** + * @return void + */ + public function testGetOverriddenValueIsNotCustomer(): void + { + $this->userContextMock->expects($this->once()) + ->method('getUserType') + ->willReturn(UserContextInterface::USER_TYPE_ADMIN); + + $this->assertNull($this->model->getOverriddenValue()); + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Model/Webapi/ParamOverriderCustomerWebsiteIdTest.php b/app/code/Magento/Customer/Test/Unit/Model/Webapi/ParamOverriderCustomerWebsiteIdTest.php new file mode 100644 index 000000000000..070170a34d43 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Model/Webapi/ParamOverriderCustomerWebsiteIdTest.php @@ -0,0 +1,89 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\Model\Webapi; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Customer\Model\Webapi\ParamOverriderCustomerWebsiteId; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test for Magento\Webapi\Controller\Rest\ParamOverriderCustomerWebsiteId class. + */ +class ParamOverriderCustomerWebsiteIdTest extends TestCase +{ + /** + * @var ParamOverriderCustomerWebsiteId + */ + private $model; + + /** + * @var UserContextInterface|MockObject + */ + private $userContextMock; + + /** + * @var CustomerRepositoryInterface|MockObject + */ + private $customerRepositoryMock; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $this->userContextMock = $this->createMock(UserContextInterface::class); + $this->customerRepositoryMock = $this->createMock(CustomerRepositoryInterface::class); + $this->model = (new ObjectManager($this))->getObject( + ParamOverriderCustomerWebsiteId::class, + [ + 'userContext' => $this->userContextMock, + 'customerRepository' => $this->customerRepositoryMock, + ] + ); + } + + /** + * @return void + */ + public function testGetOverriddenValueIsCustomer(): void + { + $userId = 1; + $groupId = 1; + $customerMock = $this->createMock(CustomerInterface::class); + + $this->userContextMock->expects($this->once()) + ->method('getUserType') + ->willReturn(UserContextInterface::USER_TYPE_CUSTOMER); + $this->userContextMock->expects($this->once()) + ->method('getUserId') + ->willReturn($userId); + $this->customerRepositoryMock->expects($this->once()) + ->method('getById') + ->with($userId) + ->willReturn($customerMock); + $customerMock->expects($this->once())->method('getWebsiteId')->willReturn($groupId); + + $this->assertSame($groupId, $this->model->getOverriddenValue()); + } + + /** + * @return void + */ + public function testGetOverriddenValueIsNotCustomer(): void + { + $this->userContextMock->expects($this->once()) + ->method('getUserType') + ->willReturn(UserContextInterface::USER_TYPE_ADMIN); + + $this->assertNull($this->model->getOverriddenValue()); + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Observer/CatalogRule/AddCustomerGroupExcludedWebsiteTest.php b/app/code/Magento/Customer/Test/Unit/Observer/CatalogRule/AddCustomerGroupExcludedWebsiteTest.php new file mode 100644 index 000000000000..2d430975d1f1 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Observer/CatalogRule/AddCustomerGroupExcludedWebsiteTest.php @@ -0,0 +1,112 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\Observer\CatalogRule; + +use Magento\CatalogRule\Api\Data\RuleExtension; +use Magento\CatalogRule\Model\ResourceModel\Rule\Collection; +use Magento\CatalogRule\Model\Rule; +use Magento\Customer\Api\GroupExcludedWebsiteRepositoryInterface; +use Magento\Customer\Observer\CatalogRule\AddCustomerGroupExcludedWebsite; +use Magento\Framework\Event\Observer; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class AddCustomerGroupExcludedWebsiteTest extends TestCase +{ + /** @var GroupExcludedWebsiteRepositoryInterface|MockObject */ + private $groupExcludedWebsiteRepository; + + /** @var Collection */ + private $ruleCollection; + + /** @var Rule */ + private $rule; + + /** @var RuleExtension */ + private $ruleExtension; + + /** @var Observer */ + private $observer; + + /** @var AddCustomerGroupExcludedWebsite */ + protected $addCustomerGroupExcludedWebsiteObserver; + + protected function setUp(): void + { + $this->groupExcludedWebsiteRepository = $this->getMockBuilder(GroupExcludedWebsiteRepositoryInterface::class) + ->getMockForAbstractClass(); + $this->observer = $this->getMockBuilder(Observer::class) + ->disableOriginalConstructor() + ->getMock(); + $this->ruleCollection = $this->getMockBuilder(Collection::class) + ->disableOriginalConstructor() + ->getMock(); + $this->rule = $this->getMockBuilder(Rule::class) + ->disableOriginalConstructor() + ->getMock(); + $this->ruleExtension = $this->getMockBuilder(RuleExtension::class) + ->disableOriginalConstructor() + ->getMock(); + $this->observer->expects(self::atLeastOnce()) + ->method('getData') + ->willReturn($this->ruleCollection); + + $this->addCustomerGroupExcludedWebsiteObserver = new AddCustomerGroupExcludedWebsite( + $this->groupExcludedWebsiteRepository + ); + } + + public function testExecuteWithoutCatalogRules(): void + { + $this->ruleCollection->expects(self::once()) + ->method('getItems') + ->willReturn([]); + + $this->groupExcludedWebsiteRepository->expects(self::never()) + ->method('getAllExcludedWebsites') + ->willReturn([]); + + $this->addCustomerGroupExcludedWebsiteObserver->execute($this->observer); + } + + public function testExecuteWithCustomerGroupExcludedWebsites(): void + { + $excludedWebsites = [ + 1 => [2], + 3 => [1] + ]; + $this->ruleCollection->expects(self::once()) + ->method('getItems') + ->willReturn([$this->rule]); + + $this->groupExcludedWebsiteRepository->expects(self::once()) + ->method('getAllExcludedWebsites') + ->willReturn($excludedWebsites); + + $this->rule->expects(self::once()) + ->method('getIsActive') + ->willReturn(true); + $this->rule->expects(self::once()) + ->method('getCustomerGroupIds') + ->willReturn([1, 2, 3, 4]); + + $this->rule->expects(self::once()) + ->method('getExtensionAttributes') + ->willReturn($this->ruleExtension); + $this->ruleExtension->expects(self::once()) + ->method('setExcludeWebsiteIds') + ->with($excludedWebsites) + ->willReturnSelf(); + $this->rule->expects(self::once()) + ->method('setExtensionAttributes') + ->with($this->ruleExtension) + ->willReturnSelf(); + + $this->addCustomerGroupExcludedWebsiteObserver->execute($this->observer); + } +} diff --git a/app/code/Magento/Customer/composer.json b/app/code/Magento/Customer/composer.json index db3108a78e9a..3c25bee14ebe 100644 --- a/app/code/Magento/Customer/composer.json +++ b/app/code/Magento/Customer/composer.json @@ -28,7 +28,8 @@ }, "suggest": { "magento/module-cookie": "*", - "magento/module-customer-sample-data": "*" + "magento/module-customer-sample-data": "*", + "magento/module-webapi": "*" }, "type": "magento2-module", "license": [ diff --git a/app/code/Magento/Customer/etc/adminhtml/di.xml b/app/code/Magento/Customer/etc/adminhtml/di.xml index 9f207ea8bebd..8d7fc668bb61 100644 --- a/app/code/Magento/Customer/etc/adminhtml/di.xml +++ b/app/code/Magento/Customer/etc/adminhtml/di.xml @@ -41,4 +41,8 @@ <argument name="reporting" xsi:type="object">CustomerGridCollectionReporting</argument> </arguments> </type> + <type name="Magento\Store\Model\Website"> + <plugin name="reindex_customer_grid_after_website_remove" type="Magento\Customer\Model\Plugin\CustomerGridIndexAfterWebsiteDelete" /> + <plugin name="deleteCustomerGroupExcludedWebsiteAfterWebsiteDelete" type="Magento\Customer\Model\Plugin\Website\DeleteCustomerGroupExcludedWebsite"/> + </type> </config> diff --git a/app/code/Magento/Customer/etc/db_schema.xml b/app/code/Magento/Customer/etc/db_schema.xml index 63ac8d9c1e46..4d2b1c6454ae 100644 --- a/app/code/Magento/Customer/etc/db_schema.xml +++ b/app/code/Magento/Customer/etc/db_schema.xml @@ -536,4 +536,19 @@ <column name="customer_id"/> </constraint> </table> + <table name="customer_group_excluded_website" resource="default" engine="innodb" + comment="Excluded Websites From Customer Group"> + <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"/> + <column xsi:type="int" name="customer_group_id" unsigned="true" nullable="false" identity="false" + comment="Customer Group ID"/> + <column xsi:type="smallint" name="website_id" unsigned="true" nullable="false" identity="false" + comment="Excluded Website ID from Customer Group"/> + <constraint xsi:type="primary" referenceId="PRIMARY"> + <column name="entity_id"/> + </constraint> + <index referenceId="CUSTOMER_GROUP_EXCLUDED_WEBSITE_CUSTOMER_GROUP_ID_WEBSITE_ID" indexType="btree"> + <column name="customer_group_id"/> + <column name="website_id"/> + </index> + </table> </schema> diff --git a/app/code/Magento/Customer/etc/db_schema_whitelist.json b/app/code/Magento/Customer/etc/db_schema_whitelist.json index 1e04a75ab300..686afb985c31 100644 --- a/app/code/Magento/Customer/etc/db_schema_whitelist.json +++ b/app/code/Magento/Customer/etc/db_schema_whitelist.json @@ -349,5 +349,19 @@ "PRIMARY": true, "CUSTOMER_LOG_CUSTOMER_ID": true } + }, + "customer_group_excluded_website": { + "column": { + "entity_id": true, + "customer_group_id": true, + "website_id": true + }, + "index": { + "CUSTOMER_GROUP_EXCLUDED_WEBSITE_CUSTOMER_GROUP_ID": true, + "CUSTOMER_GROUP_EXCLUDED_WEBSITE_CUSTOMER_GROUP_ID_WEBSITE_ID": true + }, + "constraint": { + "PRIMARY": true + } } } diff --git a/app/code/Magento/Customer/etc/di.xml b/app/code/Magento/Customer/etc/di.xml index 437912d29a33..06e986b8d7da 100644 --- a/app/code/Magento/Customer/etc/di.xml +++ b/app/code/Magento/Customer/etc/di.xml @@ -22,6 +22,7 @@ <preference for="Magento\Customer\Api\Data\AttributeMetadataInterface" type="Magento\Customer\Model\Data\AttributeMetadata" /> <preference for="Magento\Customer\Api\Data\GroupInterface" type="Magento\Customer\Model\Data\Group" /> + <preference for="Magento\Customer\Api\Data\GroupExcludedWebsiteInterface" type="Magento\Customer\Model\Data\GroupExcludedWebsite" /> <preference for="Magento\Customer\Api\Data\OptionInterface" type="Magento\Customer\Model\Data\Option" /> <preference for="Magento\Customer\Api\Data\ValidationRuleInterface" type="Magento\Customer\Model\Data\ValidationRule" /> @@ -62,6 +63,8 @@ <preference for="Magento\Customer\Model\Group\RetrieverInterface" type="Magento\Customer\Model\Group\Retriever"/> <preference for="Magento\Customer\Api\SessionCleanerInterface" type="Magento\Customer\Model\Session\SessionCleaner"/> + <preference for="Magento\Customer\Api\GroupExcludedWebsiteRepositoryInterface" + type="Magento\Customer\Model\ResourceModel\GroupExcludedWebsiteRepository" /> <type name="Magento\Customer\Model\Session"> <arguments> <argument name="configShare" xsi:type="object">Magento\Customer\Model\Config\Share\Proxy</argument> @@ -457,6 +460,7 @@ <argument name="validators" xsi:type="array"> <item name="general" xsi:type="object">Magento\Customer\Model\Address\Validator\General</item> <item name="country" xsi:type="object">Magento\Customer\Model\Address\Validator\Country</item> + <item name="customer" xsi:type="object">Magento\Customer\Model\Address\Validator\Customer</item> </argument> </arguments> </type> @@ -476,6 +480,15 @@ <argument name="resourceModel" xsi:type="string">Magento\Customer\Model\ResourceModel\Address</argument> </arguments> </type> + <type name="Magento\Webapi\Controller\Rest\ParamsOverrider"> + <arguments> + <argument name="paramOverriders" xsi:type="array"> + <item name="%customer_group_id%" xsi:type="object">Magento\Customer\Model\Webapi\ParamOverriderCustomerGroupId</item> + <item name="%customer_website_id%" xsi:type="object">Magento\Customer\Model\Webapi\ParamOverriderCustomerWebsiteId</item> + <item name="%customer_store_id%" xsi:type="object">Magento\Customer\Model\Webapi\ParamOverriderCustomerStoreId</item> + </argument> + </arguments> + </type> <preference for="Magento\Customer\Api\AccountDelegationInterface" type="Magento\Customer\Model\Delegation\AccountDelegation" /> @@ -533,4 +546,10 @@ </argument> </arguments> </type> + <type name="Magento\Customer\Api\GroupRepositoryInterface"> + <plugin name="saveCustomerGroupExcludedWebsite" type="Magento\Customer\Model\Plugin\SaveCustomerGroupExcludedWebsite"/> + <plugin name="deleteCustomerGroupExcludedWebsite" type="Magento\Customer\Model\Plugin\DeleteCustomerGroupExcludedWebsite"/> + <plugin name="getByIdCustomerGroupExcludedWebsite" type="Magento\Customer\Model\Plugin\GetByIdCustomerGroupExcludedWebsite"/> + <plugin name="getListCustomerGroupExcludedWebsite" type="Magento\Customer\Model\Plugin\GetListCustomerGroupExcludedWebsite"/> + </type> </config> diff --git a/app/code/Magento/Customer/etc/events.xml b/app/code/Magento/Customer/etc/events.xml index 0194f91c591f..e37983e12213 100644 --- a/app/code/Magento/Customer/etc/events.xml +++ b/app/code/Magento/Customer/etc/events.xml @@ -19,4 +19,10 @@ <observer name="upgrade_order_customer_email" instance="Magento\Customer\Observer\UpgradeOrderCustomerEmailObserver"/> <observer name="upgrade_quote_customer_email" instance="Magento\Customer\Observer\UpgradeQuoteCustomerEmailObserver"/> </event> + <event name="customer_customer_authenticated"> + <observer name="customerGroupAuthenticate" instance="Magento\Customer\Observer\CustomerGroupAuthenticate" /> + </event> + <event name="catalog_rule_collection_load_after"> + <observer name="catalogRuleCustomerGroupExcludedWebsite" instance="Magento\Customer\Observer\CatalogRule\AddCustomerGroupExcludedWebsite" /> + </event> </config> diff --git a/app/code/Magento/Customer/etc/extension_attributes.xml b/app/code/Magento/Customer/etc/extension_attributes.xml new file mode 100644 index 000000000000..9e27de9d30f3 --- /dev/null +++ b/app/code/Magento/Customer/etc/extension_attributes.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> + <extension_attributes for="Magento\Customer\Api\Data\GroupInterface"> + <attribute code="exclude_website_ids" type="int[]" /> + </extension_attributes> +</config> diff --git a/app/code/Magento/Customer/etc/webapi.xml b/app/code/Magento/Customer/etc/webapi.xml index 68c8da8744a0..be025947cd75 100644 --- a/app/code/Magento/Customer/etc/webapi.xml +++ b/app/code/Magento/Customer/etc/webapi.xml @@ -141,6 +141,9 @@ </resources> <data> <parameter name="customer.id" force="true">%customer_id%</parameter> + <parameter name="customer.group_id" force="true">%customer_group_id%</parameter> + <parameter name="customer.website_id" force="true">%customer_website_id%</parameter> + <parameter name="customer.store_id" force="true">%customer_store_id%</parameter> </data> </route> <route url="/V1/customers/me" method="GET" soapOperation="getSelf"> diff --git a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml index 97ae9a9953eb..a9f01d1cf962 100644 --- a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml +++ b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml @@ -189,6 +189,7 @@ </column> <column name="website_id" class="Magento\Customer\Ui\Component\Listing\Column\Websites" component="Magento_Ui/js/grid/columns/select" sortOrder="110"> <settings> + <options class="Magento\Store\Model\ResourceModel\Website\Collection"/> <filter>select</filter> <editor> <editorType>select</editorType> diff --git a/app/code/Magento/Customer/view/adminhtml/web/edit/post-wrapper.js b/app/code/Magento/Customer/view/adminhtml/web/edit/post-wrapper.js index 76b060015c5f..e1115763c089 100644 --- a/app/code/Magento/Customer/view/adminhtml/web/edit/post-wrapper.js +++ b/app/code/Magento/Customer/view/adminhtml/web/edit/post-wrapper.js @@ -25,7 +25,7 @@ define([ })); } - $('#customer-edit-delete-button').click(function () { + $('#customer-edit-delete-button').on('click', function () { var msg = $.mage.__('Are you sure you want to do this?'), url = $('#customer-edit-delete-button').data('url'); diff --git a/app/code/Magento/Customer/view/adminhtml/web/template/default-address-wrapper.html b/app/code/Magento/Customer/view/adminhtml/web/template/default-address-wrapper.html index 2af366b03342..53b017fc9c41 100644 --- a/app/code/Magento/Customer/view/adminhtml/web/template/default-address-wrapper.html +++ b/app/code/Magento/Customer/view/adminhtml/web/template/default-address-wrapper.html @@ -4,4 +4,4 @@ * See COPYING.txt for license details. */ --> -<div class="customer-default-address-wrapper" each="data: elems, as: 'element'" render=""/> +<div class="customer-default-address-wrapper" each="data: elems, as: 'element'" render=""></div> diff --git a/app/code/Magento/Customer/view/adminhtml/web/template/default-address.html b/app/code/Magento/Customer/view/adminhtml/web/template/default-address.html index 6dd154726010..cc1383378468 100644 --- a/app/code/Magento/Customer/view/adminhtml/web/template/default-address.html +++ b/app/code/Magento/Customer/view/adminhtml/web/template/default-address.html @@ -38,7 +38,7 @@ </if> <text args="address.country"/> <if args="address.telephone"> - <br/>T: <a attr="href: 'tel:' + address.telephone" text="address.telephone"/> + <br/>T: <a attr="href: 'tel:' + address.telephone" text="address.telephone"></a> </if> <if args="address.fax"> <br/>F: <text args="address.fax"/> diff --git a/app/code/Magento/Customer/view/base/ui_component/customer_form.xml b/app/code/Magento/Customer/view/base/ui_component/customer_form.xml index 065d87792665..8898ce1ee357 100644 --- a/app/code/Magento/Customer/view/base/ui_component/customer_form.xml +++ b/app/code/Magento/Customer/view/base/ui_component/customer_form.xml @@ -129,7 +129,7 @@ </validation> <dataType>number</dataType> <tooltip> - <link>https://docs.magento.com/m2/ce/user_guide/configuration/scope.html</link> + <link>https://docs.magento.com/user-guide/configuration/scope.html</link> <description translate="true">If your Magento installation has multiple websites, you can edit the scope to associate the customer with a specific site.</description> </tooltip> <imports> diff --git a/app/code/Magento/Customer/view/frontend/requirejs-config.js b/app/code/Magento/Customer/view/frontend/requirejs-config.js index f1bf5c1d1b67..d09c61e880f9 100644 --- a/app/code/Magento/Customer/view/frontend/requirejs-config.js +++ b/app/code/Magento/Customer/view/frontend/requirejs-config.js @@ -12,6 +12,7 @@ var config = { passwordStrengthIndicator: 'Magento_Customer/js/password-strength-indicator', zxcvbn: 'Magento_Customer/js/zxcvbn', addressValidation: 'Magento_Customer/js/addressValidation', + showPassword: 'Magento_Customer/js/show-password', 'Magento_Customer/address': 'Magento_Customer/js/address', 'Magento_Customer/change-email-password': 'Magento_Customer/js/change-email-password' } diff --git a/app/code/Magento/Customer/view/frontend/templates/address/edit.phtml b/app/code/Magento/Customer/view/frontend/templates/address/edit.phtml index a4a500b7d1b3..71ac56475ae8 100644 --- a/app/code/Magento/Customer/view/frontend/templates/address/edit.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/address/edit.phtml @@ -202,6 +202,7 @@ $viewModel = $block->getViewModel(); <button type="submit" class="action save primary" data-action="save-address" + disabled="disabled" title="<?= $escaper->escapeHtmlAttr(__('Save Address')) ?>"> <span><?= $escaper->escapeHtml(__('Save Address')) ?></span> </button> diff --git a/app/code/Magento/Customer/view/frontend/templates/form/edit.phtml b/app/code/Magento/Customer/view/frontend/templates/form/edit.phtml index b64ad58c17af..6734e9ad30a4 100644 --- a/app/code/Magento/Customer/view/frontend/templates/form/edit.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/form/edit.phtml @@ -104,6 +104,9 @@ use Magento\Customer\Block\Widget\Name; autocomplete="off" /> </div> </div> + <div class="field choice" data-bind="scope: 'showPassword'"> + <!-- ko template: getTemplate() --><!-- /ko --> + </div> </fieldset> <fieldset class="fieldset additional_info"> @@ -176,6 +179,16 @@ script; "passwordStrengthIndicator": { "formSelector": "form.form-edit-account" } + }, + "*": { + "Magento_Ui/js/core/app": { + "components": { + "showPassword": { + "component": "Magento_Customer/js/show-password", + "passwordSelector": "#current-password,#password,#password-confirmation" + } + } + } } } </script> diff --git a/app/code/Magento/Customer/view/frontend/templates/form/login.phtml b/app/code/Magento/Customer/view/frontend/templates/form/login.phtml index 73e9ec35d51c..119bb72083a4 100644 --- a/app/code/Magento/Customer/view/frontend/templates/form/login.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/form/login.phtml @@ -42,6 +42,9 @@ data-validate="{required:true}"> </div> </div> + <div class="field choice" data-bind="scope: 'showPassword'"> + <!-- ko template: getTemplate() --><!-- /ko --> + </div> <?= $block->getChildHtml('form_additional_info') ?> <div class="actions-toolbar"> <div class="primary"><button type="submit" class="action login primary" name="send" id="send2"><span><?= $block->escapeHtml(__('Sign In')) ?></span></button></div> @@ -55,6 +58,14 @@ "*": { "Magento_Customer/js/block-submit-on-send": { "formId": "login-form" + }, + "Magento_Ui/js/core/app": { + "components": { + "showPassword": { + "component": "Magento_Customer/js/show-password", + "passwordSelector": "#pass" + } + } } } } diff --git a/app/code/Magento/Customer/view/frontend/templates/form/register.phtml b/app/code/Magento/Customer/view/frontend/templates/form/register.phtml index 5e58f94683ec..0394f112b142 100644 --- a/app/code/Magento/Customer/view/frontend/templates/form/register.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/form/register.phtml @@ -131,6 +131,23 @@ $formData = $block->getFormData(); </div> </div> + <?php if ($addressHelper->isVatAttributeVisible()): ?> + <?php $_vatidValidationClass = $addressHelper->getAttributeValidationClass('vat_id'); ?> + <div class="field taxvat"> + <label class="label" for="vat_id"> + <span><?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('vat_id') ?></span> + </label> + <div class="control"> + <input type="text" + name="vat_id" + value="<?= $escaper->escapeHtmlAttr($formData->getVatId()) ?>" + title="<?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('vat_id') ?>" + class="input-text <?= $escaper->escapeHtmlAttr($_vatidValidationClass) ?>" + id="vat_id"> + </div> + </div> + <?php endif; ?> + <div class="field country required"> <label for="country" class="label"> <span><?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('country_id') ?></span> @@ -259,6 +276,9 @@ $formData = $block->getFormData(); autocomplete="off"> </div> </div> + <div class="field choice" data-bind="scope: 'showPassword'"> + <!-- ko template: getTemplate() --><!-- /ko --> + </div> </fieldset> <fieldset class="fieldset additional_info"> @@ -335,9 +355,9 @@ script; "regionInputId": "#region", "postcodeId": "#zip", "form": "#form-validate", - "regionJson": {$regionJson}, - "defaultRegion": "{$regionId}", - "countriesWithOptionalZip": {$countriesWithOptionalZip} + "regionJson": <?= $regionJson ?>, + "defaultRegion": <?= $regionId ?>, + "countriesWithOptionalZip": <?= $countriesWithOptionalZip ?> } } } @@ -354,6 +374,14 @@ script; "*": { "Magento_Customer/js/block-submit-on-send": { "formId": "form-validate" + }, + "Magento_Ui/js/core/app": { + "components": { + "showPassword": { + "component": "Magento_Customer/js/show-password", + "passwordSelector": "#password,#password-confirmation" + } + } } } } diff --git a/app/code/Magento/Customer/view/frontend/templates/form/resetforgottenpassword.phtml b/app/code/Magento/Customer/view/frontend/templates/form/resetforgottenpassword.phtml index 76a755bab6e4..7df33fea1acc 100644 --- a/app/code/Magento/Customer/view/frontend/templates/form/resetforgottenpassword.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/form/resetforgottenpassword.phtml @@ -37,6 +37,9 @@ <input type="password" class="input-text" name="password_confirmation" id="password-confirmation" data-validate="{required:true,equalTo:'#password'}" autocomplete="off"> </div> </div> + <div class="field choice" data-bind="scope: 'showPassword'"> + <!-- ko template: getTemplate() --><!-- /ko --> + </div> </fieldset> <div class="actions-toolbar"> <div class="primary"> @@ -44,3 +47,17 @@ </div> </div> </form> +<script type="text/x-magento-init"> + { + "*": { + "Magento_Ui/js/core/app": { + "components": { + "showPassword": { + "component": "Magento_Customer/js/show-password", + "passwordSelector": "#password,#password-confirmation" + } + } + } + } + } +</script> diff --git a/app/code/Magento/Customer/view/frontend/web/js/block-submit-on-send.js b/app/code/Magento/Customer/view/frontend/web/js/block-submit-on-send.js index 75f4ee609768..146c1b0e4caf 100644 --- a/app/code/Magento/Customer/view/frontend/web/js/block-submit-on-send.js +++ b/app/code/Magento/Customer/view/frontend/web/js/block-submit-on-send.js @@ -12,7 +12,7 @@ define([ return function (config) { var dataForm = $('#' + config.formId); - dataForm.submit(function () { + dataForm.on('submit', function () { $(this).find(':submit').attr('disabled', 'disabled'); if (this.isValid === false) { @@ -20,7 +20,7 @@ define([ } this.isValid = true; }); - dataForm.bind('invalid-form.validate', function () { + dataForm.on('invalid-form.validate', function () { $(this).find(':submit').prop('disabled', false); this.isValid = false; }); diff --git a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js index 2d7e26ecef76..566125dd9092 100644 --- a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js +++ b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js @@ -17,7 +17,9 @@ define([ ], function ($, _, ko, sectionConfig, url) { 'use strict'; - var options = {}, + var options = { + cookieLifeTime: 86400 //1 day by default + }, storage, storageInvalidation, invalidateCacheBySessionTimeOut, @@ -30,6 +32,22 @@ define([ url.setBaseUrl(window.BASE_URL); options.sectionLoadUrl = url.build('customer/section/load'); + /** + * Storage initialization + */ + function initStorage() { + $.cookieStorage.setConf({ + path: '/', + expires: new Date(Date.now() + parseInt(options.cookieLifeTime, 10) * 1000), + samesite: 'lax' + }); + storage = $.initNamespaceStorage('mage-cache-storage').localStorage; + storageInvalidation = $.initNamespaceStorage('mage-cache-storage-section-invalidation').localStorage; + } + + // Initialize storage with default parameters to prevent JS errors while component still not initialized + initStorage(); + /** * @param {Object} invalidateOptions */ @@ -216,14 +234,7 @@ define([ /** * Storage init */ - initStorage: function () { - $.cookieStorage.setConf({ - path: '/', - expires: new Date(Date.now() + parseInt(options.cookieLifeTime, 10) * 1000) - }); - storage = $.initNamespaceStorage('mage-cache-storage').localStorage; - storageInvalidation = $.initNamespaceStorage('mage-cache-storage-section-invalidation').localStorage; - }, + initStorage: initStorage, /** * Retrieve the list of sections that has expired since last page reload. @@ -357,13 +368,41 @@ define([ return deferred.promise(); }, + /** + * Reload sections on ajax complete + * + * @param {Object} jsonResponse + * @param {Object} settings + */ + onAjaxComplete: function (jsonResponse, settings) { + var sections, + redirects; + + if (settings.type.match(/post|put|delete/i)) { + sections = sectionConfig.getAffectedSections(settings.url); + + if (sections && sections.length) { + this.invalidate(sections); + redirects = ['redirect', 'backUrl']; + + if (_.isObject(jsonResponse) && !_.isEmpty(_.pick(jsonResponse, redirects))) { //eslint-disable-line + return; + } + this.reload(sections, true); + } + } + }, + /** * @param {Object} settings * @constructor */ 'Magento_Customer/js/customer-data': function (settings) { options = settings; + + // re-init storage with a new settings customerData.initStorage(); + invalidateCacheBySessionTimeOut(settings); invalidateCacheByCloseCookieSession(); customerData.init(); @@ -375,22 +414,7 @@ define([ * Events listener */ $(document).on('ajaxComplete', function (event, xhr, settings) { - var sections, - redirects; - - if (settings.type.match(/post|put|delete/i)) { - sections = sectionConfig.getAffectedSections(settings.url); - - if (sections) { - customerData.invalidate(sections); - redirects = ['redirect', 'backUrl']; - - if (_.isObject(xhr.responseJSON) && !_.isEmpty(_.pick(xhr.responseJSON, redirects))) { //eslint-disable-line - return; - } - customerData.reload(sections, true); - } - } + customerData.onAjaxComplete(xhr.responseJSON, settings); }); /** diff --git a/app/code/Magento/Customer/view/frontend/web/js/show-password.js b/app/code/Magento/Customer/view/frontend/web/js/show-password.js new file mode 100644 index 000000000000..f96ae0dee861 --- /dev/null +++ b/app/code/Magento/Customer/view/frontend/web/js/show-password.js @@ -0,0 +1,46 @@ +/** +* Copyright © Magento, Inc. All rights reserved. +* See COPYING.txt for license details. +*/ + +define([ + 'jquery', + 'uiComponent' +], function ($, Component) { + 'use strict'; + + return Component.extend({ + passwordSelector: '', + passwordInputType: 'password', + textInputType: 'text', + + defaults: { + template: 'Magento_Customer/show-password', + isPasswordVisible: false + }, + + /** + * @return {Object} + */ + initObservable: function () { + this._super() + .observe(['isPasswordVisible']); + + this.isPasswordVisible.subscribe(function (isChecked) { + this._showPassword(isChecked); + }.bind(this)); + + return this; + }, + + /** + * Show/Hide password + * @private + */ + _showPassword: function (isChecked) { + $(this.passwordSelector).attr('type', + isChecked ? this.textInputType : this.passwordInputType + ); + } + }); +}); diff --git a/app/code/Magento/Customer/view/frontend/web/template/show-password.html b/app/code/Magento/Customer/view/frontend/web/template/show-password.html new file mode 100644 index 000000000000..83027d56ecda --- /dev/null +++ b/app/code/Magento/Customer/view/frontend/web/template/show-password.html @@ -0,0 +1,9 @@ +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + --> + +<input type="checkbox" name="show-password" title="Show Password" id="show-password" class="checkbox" data-role="show-password" ko-checked="isPasswordVisible"> +<label for="show-password" class="label"><span translate="'Show Password'"></span></label> diff --git a/app/code/Magento/CustomerAnalytics/README.md b/app/code/Magento/CustomerAnalytics/README.md index 301025569f03..5afc63015225 100644 --- a/app/code/Magento/CustomerAnalytics/README.md +++ b/app/code/Magento/CustomerAnalytics/README.md @@ -1,3 +1,3 @@ # Magento_CustomerAnalytics module -The Magento_CustomerAnalytics module configures data definitions for a data collection related to the Customer module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.3/advanced-reporting/modules.html). +The Magento_CustomerAnalytics module configures data definitions for a data collection related to the Customer module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html). diff --git a/app/code/Magento/CustomerGraphQl/Model/Context/AddUserInfoToContext.php b/app/code/Magento/CustomerGraphQl/Model/Context/AddUserInfoToContext.php index 0f0b91967e47..2db91bea359d 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Context/AddUserInfoToContext.php +++ b/app/code/Magento/CustomerGraphQl/Model/Context/AddUserInfoToContext.php @@ -8,6 +8,8 @@ namespace Magento\CustomerGraphQl\Model\Context; use Magento\Authorization\Model\UserContextInterface; +use Magento\Customer\Model\ResourceModel\CustomerRepository; +use Magento\Customer\Model\Session; use Magento\GraphQl\Model\Query\ContextParametersInterface; use Magento\GraphQl\Model\Query\ContextParametersProcessorInterface; @@ -21,13 +23,29 @@ class AddUserInfoToContext implements ContextParametersProcessorInterface */ private $userContext; + /** + * @var Session + */ + private $session; + + /** + * @var CustomerRepository + */ + private $customerRepository; + /** * @param UserContextInterface $userContext + * @param Session $session + * @param CustomerRepository $customerRepository */ public function __construct( - UserContextInterface $userContext + UserContextInterface $userContext, + Session $session, + CustomerRepository $customerRepository ) { $this->userContext = $userContext; + $this->session = $session; + $this->customerRepository = $customerRepository; } /** @@ -47,7 +65,13 @@ public function execute(ContextParametersInterface $contextParameters): ContextP } $contextParameters->setUserType($currentUserType); - $contextParameters->addExtensionAttribute('is_customer', $this->isCustomer($currentUserId, $currentUserType)); + $isCustomer = $this->isCustomer($currentUserId, $currentUserType); + $contextParameters->addExtensionAttribute('is_customer', $isCustomer); + if ($isCustomer) { + $customer = $this->customerRepository->getById($currentUserId); + $this->session->setCustomerData($customer); + $this->session->setCustomerGroupId($customer->getGroupId()); + } return $contextParameters; } @@ -60,6 +84,8 @@ public function execute(ContextParametersInterface $contextParameters): ContextP */ private function isCustomer(?int $customerId, ?int $customerType): bool { - return !empty($customerId) && !empty($customerType) && $customerType !== UserContextInterface::USER_TYPE_GUEST; + return !empty($customerId) + && !empty($customerType) + && $customerType === UserContextInterface::USER_TYPE_CUSTOMER; } } diff --git a/app/code/Magento/CustomerGraphQl/Plugin/ClearCustomerSessionAfterRequest.php b/app/code/Magento/CustomerGraphQl/Plugin/ClearCustomerSessionAfterRequest.php new file mode 100644 index 000000000000..35e0ea03830c --- /dev/null +++ b/app/code/Magento/CustomerGraphQl/Plugin/ClearCustomerSessionAfterRequest.php @@ -0,0 +1,68 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CustomerGraphQl\Plugin; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Customer\Model\ResourceModel\CustomerRepository; +use Magento\Customer\Model\Session as CustomerSession; +use Magento\Framework\App\ResponseInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\GraphQl\Controller\GraphQl as GraphQlController; + +/** + * Clear the user data out of the session object before returning the GraphQL response + */ +class ClearCustomerSessionAfterRequest +{ + /** + * @var UserContextInterface + */ + private $userContext; + + /** + * @var CustomerSession + */ + private $customerSession; + + /** + * @var CustomerRepository + */ + private $customerRepository; + + /** + * @param UserContextInterface $userContext + * @param CustomerSession $customerSession + * @param CustomerRepository $customerRepository + */ + public function __construct( + UserContextInterface $userContext, + CustomerSession $customerSession, + CustomerRepository $customerRepository + ) { + $this->userContext = $userContext; + $this->customerSession = $customerSession; + $this->customerRepository = $customerRepository; + } + + /** + * Clear the customer data from the session after business logic has completed + * + * @param GraphQlController $controller + * @param ResponseInterface $response + * @return ResponseInterface + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterDispatch(GraphQlController $controller, ResponseInterface $response): ResponseInterface + { + $this->customerSession->setCustomerId(null); + $this->customerSession->setCustomerGroupId(null); + return $response; + } +} diff --git a/app/code/Magento/CustomerGraphQl/etc/graphql/di.xml b/app/code/Magento/CustomerGraphQl/etc/graphql/di.xml index 3e3a5327370a..44f26a48d192 100644 --- a/app/code/Magento/CustomerGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/CustomerGraphQl/etc/graphql/di.xml @@ -40,4 +40,7 @@ </argument> </arguments> </type> + <type name="Magento\GraphQl\Controller\GraphQl"> + <plugin name="ClearCustomerSessionAfterRequest" type="Magento\CustomerGraphQl\Plugin\ClearCustomerSessionAfterRequest" sortOrder="1" disabled="false" /> + </type> </config> diff --git a/app/code/Magento/CustomerImportExport/Model/Import/Address.php b/app/code/Magento/CustomerImportExport/Model/Import/Address.php index 0c3be73ec504..7e2e32f0e895 100644 --- a/app/code/Magento/CustomerImportExport/Model/Import/Address.php +++ b/app/code/Magento/CustomerImportExport/Model/Import/Address.php @@ -645,7 +645,7 @@ protected function _prepareDataForUpdate(array $rowData): array $value = $rowData[$attributeAlias]; if (!strlen($rowData[$attributeAlias])) { - if (!$newAddress) { + if ($attributeParams['is_required']) { continue; } diff --git a/app/code/Magento/Deploy/Model/Filesystem.php b/app/code/Magento/Deploy/Model/Filesystem.php index 67632d051621..59a2f0f7cfe9 100644 --- a/app/code/Magento/Deploy/Model/Filesystem.php +++ b/app/code/Magento/Deploy/Model/Filesystem.php @@ -29,8 +29,8 @@ class Filesystem * Access permissions to the files are set during deploy Magento 2, directly after * uploading code of Magento. Also it is possible to specify the value * of inverse mask for setting access permissions to files generated by Magento. - * @link https://devdocs.magento.com/guides/v2.3/install-gde/install/post-install-umask.html - * @link https://devdocs.magento.com/guides/v2.3/install-gde/prereq/file-system-perms.html + * @link https://devdocs.magento.com/guides/v2.4/install-gde/install/post-install-umask.html + * @link https://devdocs.magento.com/guides/v2.4/install-gde/prereq/file-system-perms.html */ const PERMISSIONS_FILE = 0640; @@ -41,8 +41,8 @@ class Filesystem * Access permissions to the directories are set during deploy Magento 2, directly after * uploading code of Magento. Also it is possible to specify the value * of inverse mask for setting access permissions to directories generated by Magento. - * @link https://devdocs.magento.com/guides/v2.3/install-gde/install/post-install-umask.html - * @link https://devdocs.magento.com/guides/v2.3/install-gde/prereq/file-system-perms.html + * @link https://devdocs.magento.com/guides/v2.4/install-gde/install/post-install-umask.html + * @link https://devdocs.magento.com/guides/v2.4/install-gde/prereq/file-system-perms.html */ const PERMISSIONS_DIR = 0750; @@ -305,8 +305,8 @@ public function cleanupFilesystem($directoryCodeList) * Access permissions to the files and directories are set during deploy Magento 2, directly after * uploading code of Magento. Also it is possible to specify the value * of inverse mask for setting access permissions to files and directories generated by Magento. - * @link https://devdocs.magento.com/guides/v2.3/install-gde/install/post-install-umask.html - * @link https://devdocs.magento.com/guides/v2.3/install-gde/prereq/file-system-perms.html + * @link https://devdocs.magento.com/guides/v2.4/install-gde/install/post-install-umask.html + * @link https://devdocs.magento.com/guides/v2.4/install-gde/prereq/file-system-perms.html * @throws \Magento\Framework\Exception\FileSystemException */ protected function changePermissions($directoryCodeList, $dirPermissions, $filePermissions) @@ -331,8 +331,8 @@ protected function changePermissions($directoryCodeList, $dirPermissions, $fileP * Access permissions to the files and directories are set during deploy Magento 2, directly after * uploading code of Magento. Also it is possible to specify the value * of inverse mask for setting access permissions to files and directories generated by Magento. - * @link https://devdocs.magento.com/guides/v2.3/install-gde/install/post-install-umask.html - * @link https://devdocs.magento.com/guides/v2.3/install-gde/prereq/file-system-perms.html + * @link https://devdocs.magento.com/guides/v2.4/install-gde/install/post-install-umask.html + * @link https://devdocs.magento.com/guides/v2.4/install-gde/prereq/file-system-perms.html * @throws \Magento\Framework\Exception\FileSystemException */ public function lockStaticResources() diff --git a/app/code/Magento/Deploy/Package/Bundle/RequireJs.php b/app/code/Magento/Deploy/Package/Bundle/RequireJs.php index c7c9e5315c7a..c5fa1c819ec1 100644 --- a/app/code/Magento/Deploy/Package/Bundle/RequireJs.php +++ b/app/code/Magento/Deploy/Package/Bundle/RequireJs.php @@ -104,6 +104,11 @@ class RequireJs implements BundleInterface */ private $pathToBundleDir; + /** + * @var Filesystem + */ + private $filesystem; + /** * Bundle constructor * @@ -185,6 +190,8 @@ public function flush() } $this->files = []; + + return true; } /** @@ -193,6 +200,8 @@ public function flush() public function clear() { $this->staticDir->delete($this->pathToBundleDir); + + return true; } /** diff --git a/app/code/Magento/Deploy/Package/BundleInterfaceFactory.php b/app/code/Magento/Deploy/Package/BundleInterfaceFactory.php index da691e7e2559..4cab52e1e00e 100644 --- a/app/code/Magento/Deploy/Package/BundleInterfaceFactory.php +++ b/app/code/Magento/Deploy/Package/BundleInterfaceFactory.php @@ -23,6 +23,11 @@ class BundleInterfaceFactory */ private $objectManager; + /** + * @var string + */ + private $type; + /** * BundleFactory constructor * diff --git a/app/code/Magento/Deploy/Package/PackageFactory.php b/app/code/Magento/Deploy/Package/PackageFactory.php index 2d251a0a3eff..686d854f7916 100644 --- a/app/code/Magento/Deploy/Package/PackageFactory.php +++ b/app/code/Magento/Deploy/Package/PackageFactory.php @@ -23,6 +23,11 @@ class PackageFactory */ private $objectManager; + /** + * @var string + */ + private $type; + /** * PackageFactory constructor * diff --git a/app/code/Magento/Deploy/Process/Queue.php b/app/code/Magento/Deploy/Process/Queue.php index 35d85c390b9c..6c49075c714e 100644 --- a/app/code/Magento/Deploy/Process/Queue.php +++ b/app/code/Magento/Deploy/Process/Queue.php @@ -46,6 +46,11 @@ class Queue */ private $inProgress = []; + /** + * @var Package[] + */ + private $failed = []; + /** * @var int */ @@ -162,7 +167,7 @@ public function getPackages() * Process jobs * * @return int - * @throws TimeoutException + * @throws \RuntimeException */ public function process() { @@ -193,8 +198,13 @@ public function process() $this->awaitForAllProcesses(); - if (!empty($packages)) { - throw new TimeoutException('Not all packages are deployed.'); + $failedPackages = array_merge($this->failed, $packages); + if (!empty($failedPackages)) { + throw new \RuntimeException( + 'The following packages have failed to deploy ' + .PHP_EOL + .implode(PHP_EOL, array_keys($failedPackages)) + ); } return $returnStatus; @@ -277,7 +287,12 @@ private function awaitForAllProcesses() { while ($this->inProgress && $this->checkTimeout()) { foreach ($this->inProgress as $name => $package) { - if ($this->isDeployed($package)) { + $isDeployed = $this->isDeployed($package); + + if ($isDeployed === false) { + $this->failed[$package->getPath()]= $this->packages[$package->getPath()]; + unset($this->inProgress[$name]); + } elseif ($isDeployed) { unset($this->inProgress[$name]); } } @@ -351,12 +366,15 @@ function () use ($package) { // process child process $this->inProgress = []; - $this->deployPackageService->deploy($package, $this->options, true); + $isDeployed = $this->deployPackageService->deploy($package, $this->options, true); // phpcs:ignore Magento2.Security.LanguageConstruct.ExitUsage - exit(0); + exit((int)!$isDeployed); } else { - $this->deployPackageService->deploy($package, $this->options); - return true; + $isDeployed = $this->deployPackageService->deploy($package, $this->options); + if ($isDeployed === false) { + $this->failed[$package->getPath()]= $this->packages[$package->getPath()]; + } + return $isDeployed; } } @@ -364,9 +382,9 @@ function () use ($package) { * Checks if package is deployed. * * @param Package $package - * @return bool + * @return null|bool */ - private function isDeployed(Package $package) + private function isDeployed(Package $package): ?bool { if ($this->isCanBeParalleled()) { if ($package->getState() === null) { @@ -375,7 +393,7 @@ private function isDeployed(Package $package) // When $pid comes back as null the child process for this package has not yet started; prevents both // hanging until timeout expires (which was behaviour in 2.2.x) and the type error from strict_types if ($pid === null) { - return false; + return null; } // phpcs:ignore Magento2.Functions.DiscouragedFunction @@ -406,10 +424,10 @@ private function isDeployed(Package $package) "Error encountered checking child process status (PID: $pid): $strerror (errno: $errno)" ); } - return false; + return null; } } - return $package->getState(); + return (bool)$package->getState(); } /** diff --git a/app/code/Magento/Deploy/Process/TimeoutException.php b/app/code/Magento/Deploy/Process/TimeoutException.php deleted file mode 100644 index 2d8eb3ab2aad..000000000000 --- a/app/code/Magento/Deploy/Process/TimeoutException.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\Deploy\Process; - -/** - * Exception is thrown if deploy process is finished due to timeout. - */ -class TimeoutException extends \RuntimeException -{ -} diff --git a/app/code/Magento/Deploy/Service/Bundle.php b/app/code/Magento/Deploy/Service/Bundle.php index 26e61624c219..ee43ba5496f2 100644 --- a/app/code/Magento/Deploy/Service/Bundle.php +++ b/app/code/Magento/Deploy/Service/Bundle.php @@ -84,13 +84,15 @@ class Bundle private $file; /** - * Bundle constructor - * + * @var BundleConfig + */ + private $bundleConfig; + + /** * @param Filesystem $filesystem * @param BundleInterfaceFactory $bundleFactory * @param BundleConfig $bundleConfig * @param Files $files - * * @param File|null $file * * @throws \Magento\Framework\Exception\FileSystemException diff --git a/app/code/Magento/Deploy/Service/DeployPackage.php b/app/code/Magento/Deploy/Service/DeployPackage.php index 90d4cdb11696..37a4db671a11 100644 --- a/app/code/Magento/Deploy/Service/DeployPackage.php +++ b/app/code/Magento/Deploy/Service/DeployPackage.php @@ -99,7 +99,7 @@ public function deploy(Package $package, array $options, $skipLogging = false) function () use ($package, $options, $skipLogging) { // emulate application locale needed for correct file path resolving $this->localeResolver->setLocale($package->getLocale()); - $this->deployEmulated($package, $options, $skipLogging); + return $this->deployEmulated($package, $options, $skipLogging); } ); $package->setState(Package::STATE_COMPLETED); @@ -151,7 +151,7 @@ public function deployEmulated(Package $package, array $options, $skipLogging = $processor->process($package, $options); } - return true; + return !(bool)$this->errorsCount; } /** diff --git a/app/code/Magento/Deploy/Service/DeployStaticFile.php b/app/code/Magento/Deploy/Service/DeployStaticFile.php index 40986087c405..a0cd91bfe684 100644 --- a/app/code/Magento/Deploy/Service/DeployStaticFile.php +++ b/app/code/Magento/Deploy/Service/DeployStaticFile.php @@ -52,8 +52,11 @@ class DeployStaticFile private $tmpDir; /** - * DeployStaticFile constructor - * + * @var Filesystem\Directory\WriteInterface + */ + private $pubStaticDir; + + /** * @param Filesystem $filesystem * @param Repository $assetRepo * @param Publisher $assetPublisher diff --git a/app/code/Magento/Deploy/Test/Unit/Process/QueueTest.php b/app/code/Magento/Deploy/Test/Unit/Process/QueueTest.php index a0356b34ebb9..32a3159b69ea 100644 --- a/app/code/Magento/Deploy/Test/Unit/Process/QueueTest.php +++ b/app/code/Magento/Deploy/Test/Unit/Process/QueueTest.php @@ -8,15 +8,16 @@ namespace Magento\Deploy\Test\Unit\Process; use Magento\Deploy\Package\Package; +use Magento\Deploy\Package\PackageFile; use Magento\Deploy\Process\Queue; use Magento\Deploy\Service\DeployPackage; +use Magento\Deploy\Service\DeployStaticFile; use Magento\Framework\App\ResourceConnection; - use Magento\Framework\App\State as AppState; +use Magento\Framework\Config\ScopeInterface; use Magento\Framework\Locale\ResolverInterface as LocaleResolver; use PHPUnit\Framework\MockObject\MockObject as Mock; use PHPUnit\Framework\TestCase; - use Psr\Log\LoggerInterface; /** @@ -27,12 +28,7 @@ class QueueTest extends TestCase { /** - * @var Queue - */ - private $queue; - - /** - * @var AppState|Mock + * @var AppState */ private $appState; @@ -52,39 +48,64 @@ class QueueTest extends TestCase private $logger; /** - * @var DeployPackage|Mock + * @var DeployPackage */ private $deployPackageService; + /** + * @var DeployStaticFile|Mock + */ + private $deployStaticFile; + + /** + * @var Package|Mock + */ + private $package; + + /** + * @var PackageFile|Mock + */ + private $packageFile; + /** * @inheritdoc */ protected function setUp(): void { - $this->appState = $this->createMock(AppState::class); + $this->resourceConnection = $this->createMock(ResourceConnection::class); + $this->package = $this->createMock(Package::class); + $this->deployStaticFile = $this->createMock(DeployStaticFile::class); + + $this->packageFile = $this->createMock(PackageFile::class); + $this->packageFile + ->expects($this->any()) + ->method('getContent') + ->willReturn('{}'); + $this->localeResolver = $this->getMockForAbstractClass( LocaleResolver::class, ['setLocale'], '', false ); - $this->resourceConnection = $this->createMock(ResourceConnection::class); + $this->logger = $this->getMockForAbstractClass( LoggerInterface::class, ['notice', 'info'], '', false ); - $this->deployPackageService = $this->createPartialMock(DeployPackage::class, ['deploy']); - $this->queue = new Queue( + $configScope = $this->createMock(ScopeInterface::class); + $this->appState = new AppState( + $configScope + ); + + $this->deployPackageService = new DeployPackage( $this->appState, $this->localeResolver, - $this->resourceConnection, - $this->logger, - $this->deployPackageService, - [], - 1 + $this->deployStaticFile, + $this->logger ); } @@ -93,13 +114,21 @@ protected function setUp(): void */ public function testAdd() { - $package = $this->createMock(Package::class); - $package->expects($this->once())->method('getPath')->willReturn('path'); + $queue = new Queue( + $this->appState, + $this->localeResolver, + $this->resourceConnection, + $this->logger, + $this->deployPackageService, + [], + 0 + ); - $this->assertTrue($this->queue->add($package)); - $packages = $this->queue->getPackages(); + $this->package->expects($this->once())->method('getPath')->willReturn('path'); + $this->assertTrue($queue->add($this->package)); + $packages = $queue->getPackages(); $this->assertEquals( - $package, + $this->package, isset($packages['path']['package']) ? $packages['path']['package'] : null ); } @@ -109,20 +138,72 @@ public function testAdd() */ public function testProcess() { - $package = $this->createMock(Package::class); - $package->expects($this->any())->method('getState')->willReturn(0); - $package->expects($this->exactly(2))->method('getParent')->willReturn(true); - $package->expects($this->any())->method('getArea')->willReturn('area'); - $package->expects($this->any())->method('getPath')->willReturn('path'); - $package->expects($this->any())->method('getFiles')->willReturn([]); - $this->logger->expects($this->exactly(2))->method('info')->willReturnSelf(); + $queue = new Queue( + $this->appState, + $this->localeResolver, + $this->resourceConnection, + $this->logger, + $this->deployPackageService, + [], + 0 + ); - $this->appState->expects($this->once())->method('emulateAreaCode'); + $this->package->expects($this->any())->method('getState')->willReturn(0); + $this->package->expects($this->exactly(2))->method('getParent')->willReturn(true); + $this->package->expects($this->any())->method('getArea')->willReturn('global'); + $this->package->expects($this->any())->method('getPath')->willReturn('path'); + $this->package->expects($this->any())->method('getFiles')->willReturn([]); + $this->package->expects($this->any())->method('getPreProcessors')->willReturn([]); + $this->package->expects($this->any())->method('getPostProcessors')->willReturn([]); + $this->logger->expects($this->exactly(3))->method('info')->willReturnSelf(); + $queue->add($this->package, []); + $this->resourceConnection->expects(self::never())->method('closeConnection'); + $this->assertEquals(0, $queue->process()); + } - $this->queue->add($package, []); + /** + * @see Queue::process() + * @dataProvider maxProcessesDataProvider + */ + public function testProcessFailedPackagesToThrowAnException($maxProcesses) + { + $this->deployStaticFile + ->expects($this->any()) + ->method('writeFile') + ->willThrowException(new \Exception); - $this->resourceConnection->expects(self::never())->method('closeConnection'); + $queue = new Queue( + $this->appState, + $this->localeResolver, + $this->resourceConnection, + $this->logger, + $this->deployPackageService, + [], + $maxProcesses + ); - $this->assertEquals(0, $this->queue->process()); + $this->package->expects($this->any())->method('getState')->willReturn(0); + $this->package->expects($this->any())->method('getParent')->willReturn(true); + $this->package->expects($this->any())->method('getArea')->willReturn('global'); + $this->package->expects($this->any())->method('getPath')->willReturn('path'); + $this->package->expects($this->any())->method('getFiles')->willReturn([$this->packageFile]); + $this->package->expects($this->any())->method('getPreProcessors')->willReturn([]); + $this->package->expects($this->any())->method('getPostProcessors')->willReturn([]); + $this->logger->expects($this->any())->method('info')->willReturnSelf(); + $queue->add($this->package, []); + $this->expectException(\RuntimeException::class); + $queue->process(); } + + /** + * @return int[] + */ + public function maxProcessesDataProvider(): array + { + return [ + [0], + [1] + ]; + } + } diff --git a/app/code/Magento/Developer/Console/Command/DevTestsRunCommand.php b/app/code/Magento/Developer/Console/Command/DevTestsRunCommand.php index 5b8b79ef4139..69410b666f87 100644 --- a/app/code/Magento/Developer/Console/Command/DevTestsRunCommand.php +++ b/app/code/Magento/Developer/Console/Command/DevTestsRunCommand.php @@ -105,6 +105,8 @@ protected function execute(InputInterface $input, OutputInterface $output) } $message = $dirName . '> ' . $command; $output->writeln(['', str_pad("---- {$message} ", 70, '-'), '']); + // passthru() call have to be here. + // phpcs:ignore Magento2.Security.InsecureFunction passthru($command, $returnVal); if ($returnVal) { $failures[] = $message; diff --git a/app/code/Magento/Directory/Helper/Data.php b/app/code/Magento/Directory/Helper/Data.php index 3133e3d4c195..b359989fe981 100644 --- a/app/code/Magento/Directory/Helper/Data.php +++ b/app/code/Magento/Directory/Helper/Data.php @@ -13,6 +13,7 @@ use Magento\Directory\Model\ResourceModel\Region\CollectionFactory; use Magento\Framework\App\Cache\Type\Config; use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\Helper\AbstractHelper; use Magento\Framework\App\Helper\Context; use Magento\Framework\Json\Helper\Data as JsonData; use Magento\Store\Model\ScopeInterface; @@ -25,8 +26,10 @@ * @since 100.0.2 * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Data extends \Magento\Framework\App\Helper\AbstractHelper +class Data extends AbstractHelper { + private const STORE_ID = 'store_id'; + /** * Config value that lists ISO2 country codes which have optional Zip/Postal pre-configured */ @@ -424,6 +427,11 @@ private function getCurrentScope(): array 'type' => ScopeInterface::SCOPE_STORE, 'value' => $request->getParam(ScopeInterface::SCOPE_STORE), ]; + } elseif ($request->getParam(self::STORE_ID)) { + $scope = [ + 'type' => ScopeInterface::SCOPE_STORE, + 'value' => $request->getParam(self::STORE_ID), + ]; } return $scope; diff --git a/app/code/Magento/Directory/Model/Currency.php b/app/code/Magento/Directory/Model/Currency.php index 6a2ebb453150..65b47d7535cb 100644 --- a/app/code/Magento/Directory/Model/Currency.php +++ b/app/code/Magento/Directory/Model/Currency.php @@ -9,6 +9,10 @@ use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\InputException; use Magento\Directory\Model\Currency\Filter; +use Magento\Framework\Locale\Currency as LocaleCurrency; +use Magento\Framework\Locale\ResolverInterface as LocalResolverInterface; +use Magento\Framework\NumberFormatterFactory; +use Magento\Framework\Serialize\Serializer\Json; /** * Currency model @@ -71,6 +75,31 @@ class Currency extends \Magento\Framework\Model\AbstractModel */ private $currencyConfig; + /** + * @var LocalResolverInterface + */ + private $localeResolver; + + /** + * @var NumberFormatterFactory + */ + private $numberFormatterFactory; + + /** + * @var \Magento\Framework\NumberFormatter + */ + private $numberFormatter; + + /** + * @var array + */ + private $numberFormatterCache; + + /** + * @var Json + */ + private $serializer; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry @@ -79,10 +108,13 @@ class Currency extends \Magento\Framework\Model\AbstractModel * @param \Magento\Directory\Helper\Data $directoryHelper * @param Currency\FilterFactory $currencyFilterFactory * @param \Magento\Framework\Locale\CurrencyInterface $localeCurrency - * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource - * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection + * @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource + * @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection * @param array $data - * @param CurrencyConfig $currencyConfig + * @param CurrencyConfig|null $currencyConfig + * @param LocalResolverInterface|null $localeResolver + * @param NumberFormatterFactory|null $numberFormatterFactory + * @param Json|null $serializer * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -96,7 +128,10 @@ public function __construct( \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [], - CurrencyConfig $currencyConfig = null + CurrencyConfig $currencyConfig = null, + LocalResolverInterface $localeResolver = null, + \Magento\Framework\NumberFormatterFactory $numberFormatterFactory = null, + Json $serializer = null ) { parent::__construct( $context, @@ -111,6 +146,9 @@ public function __construct( $this->_currencyFilterFactory = $currencyFilterFactory; $this->_localeCurrency = $localeCurrency; $this->currencyConfig = $currencyConfig ?: ObjectManager::getInstance()->get(CurrencyConfig::class); + $this->localeResolver = $localeResolver ?: ObjectManager::getInstance()->get(LocalResolverInterface::class); + $this->numberFormatterFactory = $numberFormatterFactory ?: ObjectManager::getInstance()->get(NumberFormatterFactory::class); + $this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class); } /** @@ -326,9 +364,121 @@ public function formatTxt($price, $options = []) * %F - the argument is treated as a float, and presented as a floating-point number (non-locale aware). */ $price = sprintf("%F", $price); + + if ($this->canUseNumberFormatter($options)) { + return $this->formatCurrency($price, $options); + } + return $this->_localeCurrency->getCurrency($this->getCode())->toCurrency($price, $options); } + /** + * Check if to use Intl.NumberFormatter to format currency. + * + * @param array $options + * @return bool + */ + private function canUseNumberFormatter(array $options): bool + { + $allowedOptions = [ + 'precision', + LocaleCurrency::CURRENCY_OPTION_DISPLAY, + LocaleCurrency::CURRENCY_OPTION_SYMBOL + ]; + + if (!empty(array_diff(array_keys($options), $allowedOptions))) { + return false; + } + + if (array_key_exists('display', $options) + && $options['display'] !== \Magento\Framework\Currency::NO_SYMBOL + && $options['display'] !== \Magento\Framework\Currency::USE_SYMBOL + ) { + return false; + } + + return true; + } + + /** + * Format currency. + * + * @param string $price + * @param array $options + * @return string + */ + private function formatCurrency(string $price, array $options): string + { + $customerOptions = new \Magento\Framework\DataObject([]); + + $this->_eventManager->dispatch( + 'currency_display_options_forming', + ['currency_options' => $customerOptions, 'base_code' => $this->getCode()] + ); + $options += $customerOptions->toArray(); + + $this->numberFormatter = $this->getNumberFormatter($options); + + $formattedCurrency = $this->numberFormatter->formatCurrency( + $price, $this->getCode() ?? $this->numberFormatter->getTextAttribute(\NumberFormatter::CURRENCY_CODE) + ); + + if (array_key_exists(LocaleCurrency::CURRENCY_OPTION_SYMBOL, $options)) { + // remove only one non-breaking space from custom currency symbol to allow custom NBSP in currency symbol + $formattedCurrency = preg_replace('/ /u', '', $formattedCurrency, 1); + } + + if ((array_key_exists(LocaleCurrency::CURRENCY_OPTION_DISPLAY, $options) + && $options[LocaleCurrency::CURRENCY_OPTION_DISPLAY] === \Magento\Framework\Currency::NO_SYMBOL)) { + $formattedCurrency = str_replace(' ', '', $formattedCurrency); + } + + return preg_replace('/^\s+|\s+$/u', '', $formattedCurrency); + } + + /** + * Get NumberFormatter object from cache. + * + * @param array $options + * @return \Magento\Framework\NumberFormatter + */ + private function getNumberFormatter(array $options): \Magento\Framework\NumberFormatter + { + $key = 'currency_' . md5($this->localeResolver->getLocale() . $this->serializer->serialize($options)); + if (!isset($this->numberFormatterCache[$key])) { + $this->numberFormatter = $this->numberFormatterFactory->create( + ['locale' => $this->localeResolver->getLocale(), 'style' => \NumberFormatter::CURRENCY] + ); + + $this->setOptions($options); + $this->numberFormatterCache[$key] = $this->numberFormatter; + } + + return $this->numberFormatterCache[$key]; + } + + /** + * Set number formatter custom options. + * + * @param array $options + * @return void + */ + private function setOptions(array $options): void + { + if (array_key_exists(LocaleCurrency::CURRENCY_OPTION_SYMBOL, $options)) { + $this->numberFormatter->setSymbol( + \NumberFormatter::CURRENCY_SYMBOL, $options[LocaleCurrency::CURRENCY_OPTION_SYMBOL] + ); + } + if (array_key_exists(LocaleCurrency::CURRENCY_OPTION_DISPLAY, $options) + && $options[LocaleCurrency::CURRENCY_OPTION_DISPLAY] === \Magento\Framework\Currency::NO_SYMBOL) { + $this->numberFormatter->setSymbol(\NumberFormatter::CURRENCY_SYMBOL, ''); + } + if (array_key_exists('precision', $options)) { + $this->numberFormatter->setAttribute(\NumberFormatter::FRACTION_DIGITS, $options['precision']); + } + } + /** * Return currency symbol for current locale and currency code * diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForArgentina.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForArgentina.php new file mode 100644 index 000000000000..98175b23e82a --- /dev/null +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForArgentina.php @@ -0,0 +1,111 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Setup\Patch\Data; + +use Magento\Directory\Setup\DataInstaller; +use Magento\Directory\Setup\DataInstallerFactory; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Add Argentina States + */ +class AddDataForArgentina implements DataPatchInterface +{ + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * @var DataInstallerFactory + */ + private $dataInstallerFactory; + + /** + * AddDataForArgentina constructor. + * + * @param ModuleDataSetupInterface $moduleDataSetup + * @param DataInstallerFactory $dataInstallerFactory + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup, + DataInstallerFactory $dataInstallerFactory + ) { + $this->moduleDataSetup = $moduleDataSetup; + $this->dataInstallerFactory = $dataInstallerFactory; + } + + /** + * @inheritdoc + */ + public function apply() + { + /** @var DataInstaller $dataInstaller */ + $dataInstaller = $this->dataInstallerFactory->create(); + $dataInstaller->addCountryRegions( + $this->moduleDataSetup->getConnection(), + $this->getDataForArgentina() + ); + + return $this; + } + + /** + * Argentina states data. + * + * @return array + */ + private function getDataForArgentina() + { + return [ + ['AR', 'AR-C', 'Ciudad Autónoma de Buenos Aires'], + ['AR', 'AR-B', 'Buenos Aires'], + ['AR', 'AR-K', 'Catamarca'], + ['AR', 'AR-H', 'Chaco'], + ['AR', 'AR-U', 'Chubut'], + ['AR', 'AR-X', 'Córdoba'], + ['AR', 'AR-W', 'Corrientes'], + ['AR', 'AR-E', 'Entre Ríos'], + ['AR', 'AR-P', 'Formosa'], + ['AR', 'AR-Y', 'Jujuy'], + ['AR', 'AR-L', 'La Pampa'], + ['AR', 'AR-F', 'La Rioja'], + ['AR', 'AR-M', 'Mendoza'], + ['AR', 'AR-N', 'Misiones'], + ['AR', 'AR-Q', 'Neuquén'], + ['AR', 'AR-R', 'Río Negro'], + ['AR', 'AR-A', 'Salta'], + ['AR', 'AR-J', 'San Juan'], + ['AR', 'AR-D', 'San Luis'], + ['AR', 'AR-Z', 'Santa Cruz'], + ['AR', 'AR-S', 'Santa Fe'], + ['AR', 'AR-G', 'Santiago del Estero'], + ['AR', 'AR-V', 'Tierra del Fuego'], + ['AR', 'AR-T', 'Tucumán'], + ]; + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return [ + InitializeDirectoryData::class, + ]; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForBolivia.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForBolivia.php new file mode 100644 index 000000000000..caa7856797a7 --- /dev/null +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForBolivia.php @@ -0,0 +1,96 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Setup\Patch\Data; + +use Magento\Directory\Setup\DataInstaller; +use Magento\Directory\Setup\DataInstallerFactory; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Add Bolivia States + */ +class AddDataForBolivia implements DataPatchInterface +{ + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * @var DataInstallerFactory + */ + private $dataInstallerFactory; + + /** + * AddDataForBolivia constructor. + * + * @param ModuleDataSetupInterface $moduleDataSetup + * @param DataInstallerFactory $dataInstallerFactory + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup, + DataInstallerFactory $dataInstallerFactory + ) { + $this->moduleDataSetup = $moduleDataSetup; + $this->dataInstallerFactory = $dataInstallerFactory; + } + + /** + * @inheritdoc + */ + public function apply() + { + /** @var DataInstaller $dataInstaller */ + $dataInstaller = $this->dataInstallerFactory->create(); + $dataInstaller->addCountryRegions( + $this->moduleDataSetup->getConnection(), + $this->getDataForBolivia() + ); + + return $this; + } + + /** + * Bolivia states data. + * + * @return array + */ + private function getDataForBolivia() + { + return [ + ['BO', 'BO-C', 'Cochabamba'], + ['BO', 'BO-H', 'Chuquisaca'], + ['BO', 'BO-B', 'El Beni'], + ['BO', 'BO-L', 'La Paz'], + ['BO', 'BO-O', 'Oruro'], + ['BO', 'BO-N', 'Pando'], + ['BO', 'BO-P', 'Potosí'], + ['BO', 'BO-S', 'Santa Cruz'], + ['BO', 'BO-T', 'Tarija'], + ]; + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return [ + InitializeDirectoryData::class, + ]; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForChile.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForChile.php new file mode 100644 index 000000000000..a92982db89e0 --- /dev/null +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForChile.php @@ -0,0 +1,103 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Setup\Patch\Data; + +use Magento\Directory\Setup\DataInstaller; +use Magento\Directory\Setup\DataInstallerFactory; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Add Chile States + */ +class AddDataForChile implements DataPatchInterface +{ + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * @var DataInstallerFactory + */ + private $dataInstallerFactory; + + /** + * AddDataForChile constructor. + * + * @param ModuleDataSetupInterface $moduleDataSetup + * @param DataInstallerFactory $dataInstallerFactory + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup, + DataInstallerFactory $dataInstallerFactory + ) { + $this->moduleDataSetup = $moduleDataSetup; + $this->dataInstallerFactory = $dataInstallerFactory; + } + + /** + * @inheritdoc + */ + public function apply() + { + /** @var DataInstaller $dataInstaller */ + $dataInstaller = $this->dataInstallerFactory->create(); + $dataInstaller->addCountryRegions( + $this->moduleDataSetup->getConnection(), + $this->getDataForChile() + ); + + return $this; + } + + /** + * Chile states data. + * + * @return array + */ + private function getDataForChile() + { + return [ + ['CL', 'CL-AI', 'Aisén del General Carlos Ibañez del Campo'], + ['CL', 'CL-AN', 'Antofagasta'], + ['CL', 'CL-AP', 'Arica y Parinacota'], + ['CL', 'CL-AR', 'La Araucanía'], + ['CL', 'CL-AT', 'Atacama'], + ['CL', 'CL-BI', 'Biobío'], + ['CL', 'CL-CO', 'Coquimbo'], + ['CL', 'CL-LI', 'Libertador General Bernardo O\'Higgins'], + ['CL', 'CL-LL', 'Los Lagos'], + ['CL', 'CL-LR', 'Los Ríos'], + ['CL', 'CL-MA', 'Magallanes'], + ['CL', 'CL-ML', 'Maule'], + ['CL', 'CL-NB', 'Ñuble'], + ['CL', 'CL-RM', 'Región Metropolitana de Santiago'], + ['CL', 'CL-TA', 'Tarapacá'], + ['CL', 'CL-VS', 'Valparaíso'], + ]; + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return [ + InitializeDirectoryData::class, + ]; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForEcuador.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForEcuador.php new file mode 100644 index 000000000000..5079b8c6f633 --- /dev/null +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForEcuador.php @@ -0,0 +1,112 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Setup\Patch\Data; + +use Magento\Directory\Setup\DataInstaller; +use Magento\Directory\Setup\DataInstallerFactory; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Add Ecuador States + */ +class AddDataForEcuador implements DataPatchInterface +{ + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * @var DataInstallerFactory + */ + private $dataInstallerFactory; + + /** + * AddDataForEcuador constructor. + * + * @param ModuleDataSetupInterface $moduleDataSetup + * @param DataInstallerFactory $dataInstallerFactory + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup, + DataInstallerFactory $dataInstallerFactory + ) { + $this->moduleDataSetup = $moduleDataSetup; + $this->dataInstallerFactory = $dataInstallerFactory; + } + + /** + * @inheritdoc + */ + public function apply() + { + /** @var DataInstaller $dataInstaller */ + $dataInstaller = $this->dataInstallerFactory->create(); + $dataInstaller->addCountryRegions( + $this->moduleDataSetup->getConnection(), + $this->getDataForEcuador() + ); + + return $this; + } + + /** + * Ecuador states data. + * + * @return array + */ + private function getDataForEcuador() + { + return [ + ['EC', 'EC-A', 'Azuay'], + ['EC', 'EC-B', 'Bolívar'], + ['EC', 'EC-F', 'Cañar'], + ['EC', 'EC-C', 'Carchi'], + ['EC', 'EC-H', 'Chimborazo'], + ['EC', 'EC-X', 'Cotopaxi'], + ['EC', 'EC-O', 'El Oro'], + ['EC', 'EC-E', 'Esmeraldas'], + ['EC', 'EC-W', 'Galápagos'], + ['EC', 'EC-G', 'Guayas'], + ['EC', 'EC-I', 'Imbabura'], + ['EC', 'EC-L', 'Loja'], + ['EC', 'EC-R', 'Los Ríos'], + ['EC', 'EC-M', 'Manabí'], + ['EC', 'EC-S', 'Morona Santiago'], + ['EC', 'EC-N', 'Napo'], + ['EC', 'EC-D', 'Orellana'], + ['EC', 'EC-Y', 'Pastaza'], + ['EC', 'EC-P', 'Pichincha'], + ['EC', 'EC-SE', 'Santa Elena'], + ['EC', 'EC-SD', 'Santo Domingo de los Tsáchilas'], + ['EC', 'EC-U', 'Sucumbíos'], + ['EC', 'EC-T', 'Tungurahua'], + ['EC', 'EC-Z', 'Zamora Chinchipe'], + + ]; + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return [ + InitializeDirectoryData::class, + ]; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForGuyana.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForGuyana.php new file mode 100644 index 000000000000..35c40d026bfb --- /dev/null +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForGuyana.php @@ -0,0 +1,97 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Setup\Patch\Data; + +use Magento\Directory\Setup\DataInstaller; +use Magento\Directory\Setup\DataInstallerFactory; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Add Guyana States + */ +class AddDataForGuyana implements DataPatchInterface +{ + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * @var DataInstallerFactory + */ + private $dataInstallerFactory; + + /** + * AddDataForGuyana constructor. + * + * @param ModuleDataSetupInterface $moduleDataSetup + * @param DataInstallerFactory $dataInstallerFactory + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup, + DataInstallerFactory $dataInstallerFactory + ) { + $this->moduleDataSetup = $moduleDataSetup; + $this->dataInstallerFactory = $dataInstallerFactory; + } + + /** + * @inheritdoc + */ + public function apply() + { + /** @var DataInstaller $dataInstaller */ + $dataInstaller = $this->dataInstallerFactory->create(); + $dataInstaller->addCountryRegions( + $this->moduleDataSetup->getConnection(), + $this->getDataForGuyana() + ); + + return $this; + } + + /** + * Guyana states data. + * + * @return array + */ + private function getDataForGuyana() + { + return [ + ['GY', 'GY-BA', 'Barima-Waini'], + ['GY', 'GY-CU', 'Cuyuni-Mazaruni'], + ['GY', 'GY-DE', 'Demerara-Mahaica'], + ['GY', 'GY-EB', 'East Berbice-Corentyne'], + ['GY', 'GY-ES', 'Essequibo Islands-West Demerara'], + ['GY', 'GY-MA', 'Mahaica-Berbice'], + ['GY', 'GY-PM', 'Pomeroon-Supenaam'], + ['GY', 'GY-PT', 'Potaro-Siparuni'], + ['GY', 'GY-UD', 'Upper Demerara-Berbice'], + ['GY', 'GY-UT', 'Upper Takutu-Upper Essequibo'], + ]; + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return [ + InitializeDirectoryData::class, + ]; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForParaguay.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForParaguay.php new file mode 100644 index 000000000000..5c7724641aa9 --- /dev/null +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForParaguay.php @@ -0,0 +1,105 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Setup\Patch\Data; + +use Magento\Directory\Setup\DataInstaller; +use Magento\Directory\Setup\DataInstallerFactory; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Add Paraguay States + */ +class AddDataForParaguay implements DataPatchInterface +{ + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * @var DataInstallerFactory + */ + private $dataInstallerFactory; + + /** + * AddDataForParaguay constructor. + * + * @param ModuleDataSetupInterface $moduleDataSetup + * @param DataInstallerFactory $dataInstallerFactory + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup, + DataInstallerFactory $dataInstallerFactory + ) { + $this->moduleDataSetup = $moduleDataSetup; + $this->dataInstallerFactory = $dataInstallerFactory; + } + + /** + * @inheritdoc + */ + public function apply() + { + /** @var DataInstaller $dataInstaller */ + $dataInstaller = $this->dataInstallerFactory->create(); + $dataInstaller->addCountryRegions( + $this->moduleDataSetup->getConnection(), + $this->getDataForParaguay() + ); + + return $this; + } + + /** + * Paraguay states data. + * + * @return array + */ + private function getDataForParaguay() + { + return [ + ['PY', 'PY-ASU', 'Asunción'], + ['PY', 'PY-16', 'Alto Paraguay'], + ['PY', 'PY-10', 'Alto Paraná'], + ['PY', 'PY-13', 'Amambay'], + ['PY', 'PY-19', 'Boquerón'], + ['PY', 'PY-5', 'Caaguazú'], + ['PY', 'PY-6', 'Caazapá'], + ['PY', 'PY-14', 'Canindeyú'], + ['PY', 'PY-11', 'Central'], + ['PY', 'PY-1', 'Concepción'], + ['PY', 'PY-3', 'Cordillera'], + ['PY', 'PY-4', 'Guairá'], + ['PY', 'PY-7', 'Itapúa'], + ['PY', 'PY-8', 'Misiones'], + ['PY', 'PY-12', 'Ñeembucú'], + ['PY', 'PY-9', 'Paraguarí'], + ['PY', 'PY-15', 'Presidente Hayes'], + ['PY', 'PY-2', 'San Pedro'], + ]; + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return [ + InitializeDirectoryData::class, + ]; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForPeru.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForPeru.php new file mode 100644 index 000000000000..128fd5df6255 --- /dev/null +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForPeru.php @@ -0,0 +1,113 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Setup\Patch\Data; + +use Magento\Directory\Setup\DataInstaller; +use Magento\Directory\Setup\DataInstallerFactory; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Add Peru States + */ +class AddDataForPeru implements DataPatchInterface +{ + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * @var DataInstallerFactory + */ + private $dataInstallerFactory; + + /** + * AddDataForPeru constructor. + * + * @param ModuleDataSetupInterface $moduleDataSetup + * @param DataInstallerFactory $dataInstallerFactory + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup, + DataInstallerFactory $dataInstallerFactory + ) { + $this->moduleDataSetup = $moduleDataSetup; + $this->dataInstallerFactory = $dataInstallerFactory; + } + + /** + * @inheritdoc + */ + public function apply() + { + /** @var DataInstaller $dataInstaller */ + $dataInstaller = $this->dataInstallerFactory->create(); + $dataInstaller->addCountryRegions( + $this->moduleDataSetup->getConnection(), + $this->getDataForPeru() + ); + + return $this; + } + + /** + * Peru states data. + * + * @return array + */ + private function getDataForPeru() + { + return [ + ['PE', 'PE-LMA', 'Municipalidad Metropolitana de Lima'], + ['PE', 'PE-AMA', 'Amazonas'], + ['PE', 'PE-ANC', 'Ancash'], + ['PE', 'PE-APU', 'Apurímac'], + ['PE', 'PE-ARE', 'Arequipa'], + ['PE', 'PE-AYA', 'Ayacucho'], + ['PE', 'PE-CAJ', 'Cajamarca'], + ['PE', 'PE-CUS', 'Cusco'], + ['PE', 'PE-CAL', 'El Callao'], + ['PE', 'PE-HUV', 'Huancavelica'], + ['PE', 'PE-HUC', 'Huánuco'], + ['PE', 'PE-ICA', 'Ica'], + ['PE', 'PE-JUN', 'Junín'], + ['PE', 'PE-LAL', 'La Libertad'], + ['PE', 'PE-LAM', 'Lambayeque'], + ['PE', 'PE-LIM', 'Lima'], + ['PE', 'PE-LOR', 'Loreto'], + ['PE', 'PE-MDD', 'Madre de Dios'], + ['PE', 'PE-MOQ', 'Moquegua'], + ['PE', 'PE-PAS', 'Pasco'], + ['PE', 'PE-PIU', 'Piura'], + ['PE', 'PE-PUN', 'Puno'], + ['PE', 'PE-SAM', 'San Martín'], + ['PE', 'PE-TAC', 'Tacna'], + ['PE', 'PE-TUM', 'Tumbes'], + ['PE', 'PE-UCA', 'Ucayali'], + ]; + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return [ + InitializeDirectoryData::class, + ]; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForSuriname.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForSuriname.php new file mode 100644 index 000000000000..f267d8d0168f --- /dev/null +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForSuriname.php @@ -0,0 +1,97 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Setup\Patch\Data; + +use Magento\Directory\Setup\DataInstaller; +use Magento\Directory\Setup\DataInstallerFactory; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Add Suriname States + */ +class AddDataForSuriname implements DataPatchInterface +{ + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * @var DataInstallerFactory + */ + private $dataInstallerFactory; + + /** + * AddDataForSuriname constructor. + * + * @param ModuleDataSetupInterface $moduleDataSetup + * @param DataInstallerFactory $dataInstallerFactory + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup, + DataInstallerFactory $dataInstallerFactory + ) { + $this->moduleDataSetup = $moduleDataSetup; + $this->dataInstallerFactory = $dataInstallerFactory; + } + + /** + * @inheritdoc + */ + public function apply() + { + /** @var DataInstaller $dataInstaller */ + $dataInstaller = $this->dataInstallerFactory->create(); + $dataInstaller->addCountryRegions( + $this->moduleDataSetup->getConnection(), + $this->getDataForSuriname() + ); + + return $this; + } + + /** + * Suriname states data. + * + * @return array + */ + private function getDataForSuriname() + { + return [ + ['SR', 'SR-BR', 'Brokopondo'], + ['SR', 'SR-CM', 'Commewijne'], + ['SR', 'SR-CR', 'Coronie'], + ['SR', 'SR-MA', 'Marowijne'], + ['SR', 'SR-NI', 'Nickerie'], + ['SR', 'SR-PR', 'Para'], + ['SR', 'SR-PM', 'Paramaribo'], + ['SR', 'SR-SA', 'Saramacca'], + ['SR', 'SR-SI', 'Sipaliwini'], + ['SR', 'SR-WA', 'Wanica'], + ]; + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return [ + InitializeDirectoryData::class, + ]; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForVenezuela.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForVenezuela.php new file mode 100644 index 000000000000..4fa9e1375deb --- /dev/null +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForVenezuela.php @@ -0,0 +1,112 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Setup\Patch\Data; + +use Magento\Directory\Setup\DataInstaller; +use Magento\Directory\Setup\DataInstallerFactory; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Add Venezuela States + */ +class AddDataForVenezuela implements DataPatchInterface +{ + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * @var DataInstallerFactory + */ + private $dataInstallerFactory; + + /** + * AddDataForVenezuela constructor. + * + * @param ModuleDataSetupInterface $moduleDataSetup + * @param DataInstallerFactory $dataInstallerFactory + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup, + DataInstallerFactory $dataInstallerFactory + ) { + $this->moduleDataSetup = $moduleDataSetup; + $this->dataInstallerFactory = $dataInstallerFactory; + } + + /** + * @inheritdoc + */ + public function apply() + { + /** @var DataInstaller $dataInstaller */ + $dataInstaller = $this->dataInstallerFactory->create(); + $dataInstaller->addCountryRegions( + $this->moduleDataSetup->getConnection(), + $this->getDataForVenezuela() + ); + + return $this; + } + + /** + * Venezuela states data. + * + * @return array + */ + private function getDataForVenezuela() + { + return [ + ['VE', 'VE-W', 'Dependencias Federales'], + ['VE', 'VE-A', 'Distrito Capital'], + ['VE', 'VE-Z', 'Amazonas'], + ['VE', 'VE-B', 'Anzoátegui'], + ['VE', 'VE-C', 'Apure'], + ['VE', 'VE-D', 'Aragua'], + ['VE', 'VE-E', 'Barinas'], + ['VE', 'VE-F', 'Bolívar'], + ['VE', 'VE-G', 'Carabobo'], + ['VE', 'VE-H', 'Cojedes'], + ['VE', 'VE-Y', 'Delta Amacuro'], + ['VE', 'VE-I', 'Falcón'], + ['VE', 'VE-J', 'Guárico'], + ['VE', 'VE-K', 'Lara'], + ['VE', 'VE-L', 'Mérida'], + ['VE', 'VE-M', 'Miranda'], + ['VE', 'VE-N', 'Monagas'], + ['VE', 'VE-O', 'Nueva Esparta'], + ['VE', 'VE-P', 'Portuguesa'], + ['VE', 'VE-R', 'Sucre'], + ['VE', 'VE-S', 'Táchira'], + ['VE', 'VE-T', 'Trujillo'], + ['VE', 'VE-X', 'Vargas'], + ['VE', 'VE-U', 'Yaracuy'], + ['VE', 'VE-V', 'Zulia'], + ]; + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return [ + InitializeDirectoryData::class, + ]; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Directory/Test/Mftf/Data/CurrencyConfigData.xml b/app/code/Magento/Directory/Test/Mftf/Data/CurrencyConfigData.xml index fb21ee42fe2f..3424e727ab90 100644 --- a/app/code/Magento/Directory/Test/Mftf/Data/CurrencyConfigData.xml +++ b/app/code/Magento/Directory/Test/Mftf/Data/CurrencyConfigData.xml @@ -13,4 +13,12 @@ <data key="label">Russian Ruble</data> <data key="value">RUB</data> </entity> + <entity name="CurrencyConverterApiKeyConfigData"> + <data key="path">currency/currencyconverterapi/api_key</data> + <data key="value">{{_CREDS.magento/currency_currencyconverterapi_api_key}}</data> + </entity> + <entity name="DefaultCurrencyConverterApiKeyConfigData"> + <data key="path">currency/currencyconverterapi/api_key</data> + <data key="value">''</data> + </entity> </entities> diff --git a/app/code/Magento/Directory/Test/Unit/Model/CurrencyTest.php b/app/code/Magento/Directory/Test/Unit/Model/CurrencyTest.php index 80a19617ea31..b67ebda692de 100644 --- a/app/code/Magento/Directory/Test/Unit/Model/CurrencyTest.php +++ b/app/code/Magento/Directory/Test/Unit/Model/CurrencyTest.php @@ -9,6 +9,9 @@ use Magento\Directory\Model\Currency; use Magento\Framework\Locale\CurrencyInterface; +use Magento\Framework\Locale\ResolverInterface as LocalResolverInterface; +use Magento\Framework\NumberFormatterFactory; +use Magento\Framework\Serialize\Serializer\Json; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -27,15 +30,46 @@ class CurrencyTest extends TestCase */ protected $localeCurrencyMock; + /** + * @var LocalResolverInterface + */ + private $localeResolver; + + /** + * @var NumberFormatterFactory + */ + private $numberFormatterFactory; + + /** + * @var Json + */ + private $serializer; + protected function setUp(): void { $this->localeCurrencyMock = $this->getMockForAbstractClass(CurrencyInterface::class); + $currencyFilterFactory = $this->getMockBuilder(\Magento\Directory\Model\Currency\FilterFactory::class) + ->disableOriginalConstructor() + ->getMock(); + $this->localeResolver = $this->getMockBuilder(LocalResolverInterface::class) + ->getMockForAbstractClass(); + $this->numberFormatterFactory = $this->getMockBuilder(NumberFormatterFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->serializer = $this->getMockBuilder(Json::class) + ->disableOriginalConstructor() + ->getMock(); $objectManager = new ObjectManager($this); $this->currency = $objectManager->getObject( Currency::class, [ 'localeCurrency' => $this->localeCurrencyMock, + 'currencyFilterFactory' => $currencyFilterFactory, + 'localeResolver' => $this->localeResolver, + 'numberFormatterFactory' => $this->numberFormatterFactory, + 'serializer' => $this->serializer, 'data' => [ 'currency_code' => $this->currencyCode, ] @@ -43,66 +77,151 @@ protected function setUp(): void ); } - public function testGetCurrencySymbol() + public function testGetCurrencySymbol(): void { $currencySymbol = '$'; $currencyMock = $this->getMockBuilder(\Magento\Framework\Currency::class) ->disableOriginalConstructor() ->getMock(); - $currencyMock->expects($this->once()) + $currencyMock->expects(self::once()) ->method('getSymbol') ->willReturn($currencySymbol); - $this->localeCurrencyMock->expects($this->once()) + $this->localeCurrencyMock->expects(self::once()) ->method('getCurrency') ->with($this->currencyCode) ->willReturn($currencyMock); - $this->assertEquals($currencySymbol, $this->currency->getCurrencySymbol()); + self::assertEquals($currencySymbol, $this->currency->getCurrencySymbol()); } /** * @dataProvider getOutputFormatDataProvider - * @param $withCurrency - * @param $noCurrency * @param $expected + * @param $locale */ - public function testGetOutputFormat($withCurrency, $noCurrency, $expected) + public function testGetOutputFormat($expected, $locale): void { - $currencyMock = $this->getMockBuilder(\Magento\Framework\Currency::class) - ->disableOriginalConstructor() - ->getMock(); - $currencyMock->expects($this->at(0)) - ->method('toCurrency') - ->willReturn($withCurrency); - $currencyMock->expects($this->at(1)) - ->method('toCurrency') - ->willReturn($noCurrency); - $this->localeCurrencyMock->expects($this->atLeastOnce()) - ->method('getCurrency') - ->with($this->currencyCode) - ->willReturn($currencyMock); - $this->assertEquals($expected, $this->currency->getOutputFormat()); + $this->localeResolver->method('getLocale')->willReturn($locale); + $this->numberFormatterFactory + ->method('create') + ->with(['locale' => $locale, 'style' => 2]) + ->willReturn(new \Magento\Framework\NumberFormatter($locale, 2)); + $this->serializer->method('serialize')->willReturnMap( + [ + [[], '[]'], + [['display' => 1], '{"display":1}'] + ] + ); + self::assertEquals($expected, $this->currency->getOutputFormat()); } /** - * Return data sets for testGetCurrencySymbol() + * Return data sets for testGetOutputFormat() * * @return array */ - public function getOutputFormatDataProvider() + public function getOutputFormatDataProvider(): array { return [ 'no_unicode' => [ - 'withCurrency' => '$0.00', - 'noCurrency' => '0.00', 'expected' => '$%s', + 'locale' => 'en_US' ], 'arabic_unicode' => [ - 'withCurrency' => json_decode('"\u200E"') . '$0.00', - 'noCurrency' => json_decode('"\u200E"') . '0.00', 'expected' => json_decode('"\u200E"') . '$%s', + 'locale' => 'fa_IR' ] ]; } + + /** + * @dataProvider getFormatTxtNumberFormatterDataProvider + * @param string $price + * @param array $options + * @param string $locale + * @param string $expected + */ + public function testFormatTxtWithNumberFormatter( + string $price, + array $options, + string $locale, + string $expected + ): void { + $this->localeResolver->expects(self::exactly(2))->method('getLocale')->willReturn($locale); + $this->numberFormatterFactory + ->expects(self::once()) + ->method('create') + ->with(['locale' => $locale, 'style' => 2]) + ->willReturn(new \Magento\Framework\NumberFormatter($locale, 2)); + $this->serializer->method('serialize')->willReturnMap( + [ + [[], '[]'] + ] + ); + + self::assertEquals($expected, $this->currency->formatTxt($price, $options)); + } + + /** + * Return data sets for testFormatTxtWithNumberFormatter() + * + * @return array + */ + public function getFormatTxtNumberFormatterDataProvider(): array + { + return [ + ['9999', [], 'en_US', '$9,999.00'], + ['9999', ['display' => \Magento\Framework\Currency::NO_SYMBOL, 'precision' => 2], 'en_US', '9,999.00'], + ['9999', ['display' => \Magento\Framework\Currency::NO_SYMBOL], 'en_US', '9,999.00'], + [' 9999', ['display' => \Magento\Framework\Currency::NO_SYMBOL], 'en_US', '9,999.00'], + ['9999', ['precision' => 1], 'en_US', '$9,999.0'], + ['9999', ['precision' => 2, 'symbol' => '#'], 'en_US', '#9,999.00'], + [ + '9999.99', + ['precision' => 2, 'symbol' => '#', 'display' => \Magento\Framework\Currency::NO_SYMBOL], + 'en_US', + '9,999.99' + ], + ]; + } + + /** + * @dataProvider getFormatTxtZendCurrencyDataProvider + * @param string $price + * @param array $options + * @param string $expected + * @throws \Zend_Currency_Exception + */ + public function testFormatTxtWithZendCurrency(string $price, array $options, string $expected): void + { + $this->localeCurrencyMock + ->expects(self::once()) + ->method('getCurrency') + ->with($this->currencyCode) + ->willReturn(new \Zend_Currency($options, 'en_US')); + $this->serializer->method('serialize')->willReturnMap( + [ + [[], '[]'] + ] + ); + + self::assertEquals($expected, $this->currency->formatTxt($price, $options)); + } + + /** + * Return data sets for testFormatTxtWithZendCurrency() + * + * @return array + */ + public function getFormatTxtZendCurrencyDataProvider(): array + { + return [ + ['9999', ['display' => \Magento\Framework\Currency::USE_SYMBOL, 'foo' => 'bar'], '$9,999.00'], + ['9999', ['display' => \Magento\Framework\Currency::USE_SHORTNAME, 'foo' => 'bar'], 'USD9,999.00'], + ['9999', ['currency' => 'USD'], '$9,999.00'], + ['9999', ['currency' => 'CNY'], 'CN¥9,999.00'], + ['9999', ['locale' => 'fr_FR'], '9 999,00 $'] + ]; + } } diff --git a/app/code/Magento/Directory/etc/zip_codes.xml b/app/code/Magento/Directory/etc/zip_codes.xml index 634d4abe0676..f186102911a6 100644 --- a/app/code/Magento/Directory/etc/zip_codes.xml +++ b/app/code/Magento/Directory/etc/zip_codes.xml @@ -6,14 +6,14 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Directory:etc/zip_codes.xsd"> - <zip countryCode="DZ"> + <zip countryCode="AD"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="AD100">^AD\d{3}$</code> </codes> </zip> - <zip countryCode="AS"> + <zip countryCode="AM"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> <zip countryCode="AR"> @@ -22,51 +22,65 @@ <code id="pattern_2" active="true" example="A1234BCD">^[a-zA-z]{1}[0-9]{4}[a-zA-z]{3}$</code> </codes> </zip> - <zip countryCode="AM"> + <zip countryCode="AS"> <codes> - <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> - <zip countryCode="AU"> + <zip countryCode="AT"> <codes> <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> - <zip countryCode="AT"> + <zip countryCode="AU"> <codes> <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> + <zip countryCode="AX"> + <codes> + <code id="pattern_1" active="true" example="22123">^22\d{3}$</code> + </codes> + </zip> <zip countryCode="AZ"> <codes> <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> <code id="pattern_2" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> + <zip countryCode="BA"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> + <zip countryCode="BB"> + <codes> + <code id="pattern_1" active="true" example="BB12345">^(BB\d{5})?$</code> + </codes> + </zip> <zip countryCode="BD"> <codes> <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> - <zip countryCode="BY"> + <zip countryCode="BE"> <codes> - <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> - <zip countryCode="BE"> + <zip countryCode="BG"> <codes> <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> - <zip countryCode="BA"> + <zip countryCode="BH"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="323">^((1[0-2]|[1-9])\d{2})?$</code> </codes> </zip> - <zip countryCode="BR"> + <zip countryCode="BM"> <codes> - <code id="pattern_1" active="true" example="12345678">^[0-9]{8}$</code> - <code id="pattern_2" active="true" example="12345-678">^[0-9]{5}\-[0-9]{3}$</code> + <code id="pattern_1" active="true" example="MA 02">^[A-Z]{2}[ ]?[A-Z0-9]{2}$</code> </codes> </zip> <zip countryCode="BN"> @@ -74,20 +88,42 @@ <code id="pattern_1" active="true" example="AB1234">^[a-zA-z]{2}[0-9]{4}$</code> </codes> </zip> - <zip countryCode="BG"> + <zip countryCode="BR"> <codes> - <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + <code id="pattern_1" active="true" example="12345678">^[0-9]{8}$</code> + <code id="pattern_2" active="true" example="12345-678">^[0-9]{5}\-[0-9]{3}$</code> + </codes> + </zip> + <zip countryCode="BY"> + <codes> + <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> <zip countryCode="CA"> <codes> <code id="pattern_1" active="true" example="A1B 2C3">^[a-zA-z]{1}[0-9]{1}[a-zA-z]{1}\s[0-9]{1}[a-zA-z]{1}[0-9]{1}$</code> <code id="pattern_2" active="true" example="A1B2C3">^[a-zA-z]{1}[0-9]{1}[a-zA-z]{1}[0-9]{1}[a-zA-z]{1}[0-9]{1}$</code> + <code id="pattern_3" active="true" example="A1B">^[a-zA-z]{1}[0-9]{1}[a-zA-z]{1}$</code> </codes> </zip> - <zip countryCode="IC"> + <zip countryCode="CC"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="6799">^6799$</code> + </codes> + </zip> + <zip countryCode="CH"> + <codes> + <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + </codes> + </zip> + <zip countryCode="CK"> + <codes> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> + </codes> + </zip> + <zip countryCode="CL"> + <codes> + <code id="pattern_1" active="true" example="1234567">^\d{7}$</code> </codes> </zip> <zip countryCode="CN"> @@ -95,7 +131,12 @@ <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> - <zip countryCode="HR"> + <zip countryCode="CR"> + <codes> + <code id="pattern_1" active="true" example="12345 or 123-1234">^\d{4,5}|\d{3}-\d{4}$</code> + </codes> + </zip> + <zip countryCode="CS"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> @@ -105,6 +146,16 @@ <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> + <zip countryCode="CV"> + <codes> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> + </codes> + </zip> + <zip countryCode="CX"> + <codes> + <code id="pattern_1" active="true" example="6798">^6798$</code> + </codes> + </zip> <zip countryCode="CY"> <codes> <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> @@ -115,29 +166,84 @@ <code id="pattern_1" active="true" example="123 45">^[0-9]{3}\s[0-9]{2}$</code> </codes> </zip> + <zip countryCode="DE"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> <zip countryCode="DK"> <codes> <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> + <zip countryCode="DO"> + <codes> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> + <zip countryCode="DZ"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> + <zip countryCode="EC"> + <codes> + <code id="pattern_1" active="true" example="A1234B or AB123456 or 123456">^([A-Z]\d{4}[A-Z]|(?:[A-Z]{2})?\d{6})?$</code> + </codes> + </zip> <zip countryCode="EE"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> + <zip countryCode="EG"> + <codes> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> + <zip countryCode="ES"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> + <zip countryCode="ET"> + <codes> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> + </codes> + </zip> <zip countryCode="FI"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> + <zip countryCode="FK"> + <codes> + <code id="pattern_1" active="true" example="FIQQ 1ZZ">^FIQQ 1ZZ$</code> + </codes> + </zip> + <zip countryCode="FM"> + <codes> + <code id="pattern_1" active="true" example="96941">^(9694[1-4])([ \-]\d{4})?$</code> + </codes> + </zip> + <zip countryCode="FO"> + <codes> + <code id="pattern_1" active="true" example="123">^\d{3}$</code> + </codes> + </zip> <zip countryCode="FR"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> - <zip countryCode="GF"> + <zip countryCode="GB"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="AB12 3CD">^[a-zA-Z]{2}[0-9]{2}\s?[0-9]{1}[a-zA-Z]{2}$</code> + <code id="pattern_2" active="true" example="A1B 2CD">^[a-zA-Z]{1}[0-9]{1}[a-zA-Z]{1}\s?[0-9]{1}[a-zA-Z]{2}$</code> + <code id="pattern_3" active="true" example="AB1 2CD">^[a-zA-Z]{2}[0-9]{1}\s?[0-9]{1}[a-zA-Z]{2}$</code> + <code id="pattern_4" active="true" example="AB1C 2DF">^[a-zA-Z]{2}[0-9]{1}[a-zA-Z]{1}\s?[0-9]{1}[a-zA-Z]{2}$</code> + <code id="pattern_5" active="true" example="A12 3BC">^[a-zA-Z]{1}[0-9]{2}\s?[0-9]{1}[a-zA-Z]{2}$</code> + <code id="pattern_6" active="true" example="A1 2BC">^[a-zA-Z]{1}[0-9]{1}\s?[0-9]{1}[a-zA-Z]{2}$</code> </codes> </zip> <zip countryCode="GE"> @@ -145,14 +251,19 @@ <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> - <zip countryCode="DE"> + <zip countryCode="GF"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> - <zip countryCode="GR"> + <zip countryCode="GG"> <codes> - <code id="pattern_1" active="true" example="123 45">^[0-9]{3}\s[0-9]{2}$</code> + <code id="pattern_1" active="true" example="AB1 2CD">^[a-zA-Z]{2}[0-9]{1}\s[0-9]{1}[a-zA-Z]{2}$</code> + </codes> + </zip> + <zip countryCode="GH"> + <codes> + <code id="pattern_1" active="true" example="GA18400">^[A-Z][A-Z0-9]\d{3,5}$</code> </codes> </zip> <zip countryCode="GL"> @@ -160,34 +271,69 @@ <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> + <zip countryCode="GN"> + <codes> + <code id="pattern_1" active="true" example="123">^\d{3}$</code> + </codes> + </zip> <zip countryCode="GP"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> + <zip countryCode="GR"> + <codes> + <code id="pattern_1" active="true" example="123 45">^[0-9]{3}\s[0-9]{2}$</code> + </codes> + </zip> + <zip countryCode="GS"> + <codes> + <code id="pattern_1" active="true" example="SIQQ 1ZZ">^SIQQ 1ZZ$</code> + </codes> + </zip> + <zip countryCode="GT"> + <codes> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> <zip countryCode="GU"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> - <zip countryCode="GG"> + <zip countryCode="GW"> <codes> - <code id="pattern_1" active="true" example="AB1 2CD">^[a-zA-Z]{2}[0-9]{1}\s[0-9]{1}[a-zA-Z]{2}$</code> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> </codes> </zip> - <zip countryCode="HU"> + <zip countryCode="HM"> <codes> - <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> </codes> </zip> - <zip countryCode="IS"> + <zip countryCode="HN"> <codes> - <code id="pattern_1" active="true" example="123">^[0-9]{3}$</code> + <code id="pattern_1" active="true" example="12345">^(?:\d{5})?$</code> </codes> </zip> - <zip countryCode="IN"> + <zip countryCode="HR"> <codes> - <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> + <zip countryCode="HT"> + <codes> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> + </codes> + </zip> + <zip countryCode="HU"> + <codes> + <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + </codes> + </zip> + <zip countryCode="IC"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> <zip countryCode="ID"> @@ -200,15 +346,34 @@ <code id="pattern_1" active="true" example="6687865">^[0-9]{7}$</code> </codes> </zip> - <zip countryCode="IT"> + <zip countryCode="IM"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="IM1 1AD">^IM\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$</code> </codes> </zip> - <zip countryCode="JP"> + <zip countryCode="IN"> <codes> - <code id="pattern_1" active="true" example="123-4567">^[0-9]{3}-[0-9]{4}$</code> - <code id="pattern_2" active="true" example="1234567">^[0-9]{7}$</code> + <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + </codes> + </zip> + <zip countryCode="IO"> + <codes> + <code id="pattern_1" active="true" example="BBND 1ZZ">^BBND 1ZZ$</code> + </codes> + </zip> + <zip countryCode="IS"> + <codes> + <code id="pattern_1" active="true" example="123">^[0-9]{3}$</code> + </codes> + </zip> + <zip countryCode="IQ"> + <codes> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> + <zip countryCode="IT"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> <zip countryCode="JE"> @@ -216,9 +381,15 @@ <code id="pattern_1" active="true" example="AB1 2CD">^[a-zA-Z]{2}[0-9]{1}\s[0-9]{1}[a-zA-Z]{2}$</code> </codes> </zip> - <zip countryCode="KZ"> + <zip countryCode="JO"> <codes> - <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> + <zip countryCode="JP"> + <codes> + <code id="pattern_1" active="true" example="123-4567">^[0-9]{3}-[0-9]{4}$</code> + <code id="pattern_2" active="true" example="1234567">^[0-9]{7}$</code> </codes> </zip> <zip countryCode="KE"> @@ -226,20 +397,40 @@ <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> + <zip countryCode="KG"> + <codes> + <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + </codes> + </zip> <zip countryCode="KR"> <codes> <code id="pattern_1" active="true" example="123-456">^[0-9]{3}-[0-9]{3}$</code> <code id="pattern_2" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> - <zip countryCode="KG"> + <zip countryCode="KH"> + <codes> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> + <zip countryCode="KW"> + <codes> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> + <zip countryCode="KZ"> <codes> <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> - <zip countryCode="LV"> + <zip countryCode="LA"> <codes> - <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> + <zip countryCode="LB"> + <codes> + <code id="pattern_1" active="true" example="1234 5678">^(\d{4}([ ]?\d{4})?)?$</code> </codes> </zip> <zip countryCode="LI"> @@ -247,6 +438,11 @@ <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> + <zip countryCode="LK"> + <codes> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> <zip countryCode="LT"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> @@ -257,25 +453,64 @@ <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> - <zip countryCode="MK"> + <zip countryCode="LV"> + <codes> + <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + </codes> + </zip> + <zip countryCode="MA"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> + <zip countryCode="MC"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> + <zip countryCode="MD"> <codes> <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> + <zip countryCode="ME"> + <codes> + <code id="pattern_1" active="true" example="81101">^8\d{4}$</code> + </codes> + </zip> <zip countryCode="MG"> <codes> <code id="pattern_1" active="true" example="123">^[0-9]{3}$</code> </codes> </zip> - <zip countryCode="MY"> + <zip countryCode="MH"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> - <zip countryCode="MV"> + <zip countryCode="MK"> + <codes> + <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + </codes> + </zip> + <zip countryCode="MN"> + <codes> + <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + </codes> + </zip> + <zip countryCode="MP"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> + <zip countryCode="MS"> + <codes> + <code id="pattern_1" active="true" example="MSR1250">^MSR\s?\d{4}$</code> + </codes> + </zip> + <zip countryCode="MQ"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> - <code id="pattern_2" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> <zip countryCode="MT"> @@ -285,14 +520,15 @@ <code id="pattern_3" active="true" example="ABC 12">^[a-zA-Z]{3}\s[0-9]{2}$</code> </codes> </zip> - <zip countryCode="MH"> + <zip countryCode="MU"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="A1201 or 80110">^([AR]|[0-9])\d{4,5}$</code> </codes> </zip> - <zip countryCode="MQ"> + <zip countryCode="MV"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_2" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> <zip countryCode="MX"> @@ -300,24 +536,34 @@ <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> - <zip countryCode="MD"> + <zip countryCode="MY"> <codes> - <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> - <zip countryCode="MC"> + <zip countryCode="NC"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="98800">^988\d{2}$</code> </codes> </zip> - <zip countryCode="MN"> + <zip countryCode="NE"> <codes> - <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> </codes> </zip> - <zip countryCode="MA"> + <zip countryCode="NF"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="2899">^2899$</code> + </codes> + </zip> + <zip countryCode="NG"> + <codes> + <code id="pattern_1" active="true" example="123456">^(\d{6})?$</code> + </codes> + </zip> + <zip countryCode="NI"> + <codes> + <code id="pattern_1" active="true" example="22500">^\d{5}$</code> </codes> </zip> <zip countryCode="NL"> @@ -330,9 +576,34 @@ <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> - <zip countryCode="PK"> + <zip countryCode="NP"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> + <zip countryCode="NZ"> + <codes> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> + </codes> + </zip> + <zip countryCode="OM"> + <codes> + <code id="pattern_1" active="true" example="PC 123 or 123">^(PC )?\d{3}$</code> + </codes> + </zip> + <zip countryCode="PA"> + <codes> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> + </codes> + </zip> + <zip countryCode="PF"> + <codes> + <code id="pattern_1" active="true" example="98701">^987\d{2}$</code> + </codes> + </zip> + <zip countryCode="PG"> + <codes> + <code id="pattern_1" active="true" example="123">^\d{3}$</code> </codes> </zip> <zip countryCode="PH"> @@ -340,20 +611,45 @@ <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> + <zip countryCode="PK"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> <zip countryCode="PL"> <codes> <code id="pattern_1" active="true" example="12-345">^[0-9]{2}-[0-9]{3}$</code> </codes> </zip> + <zip countryCode="PM"> + <codes> + <code id="pattern_1" active="true" example="97500">^9[78]5\d{2}$</code> + </codes> + </zip> + <zip countryCode="PN"> + <codes> + <code id="pattern_1" active="true" example="PCRN 1ZZ">^PCRN 1ZZ$</code> + </codes> + </zip> + <zip countryCode="PR"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> <zip countryCode="PT"> <codes> <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> <code id="pattern_2" active="true" example="1234-567">^[0-9]{4}-[0-9]{3}$</code> </codes> </zip> - <zip countryCode="PR"> + <zip countryCode="PW"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="96939 or 96940">^(?:96939|96940)$</code> + </codes> + </zip> + <zip countryCode="PY"> + <codes> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> </codes> </zip> <zip countryCode="RE"> @@ -366,19 +662,24 @@ <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> + <zip countryCode="RS"> + <codes> + <code id="pattern_1" active="true" example="123456">^\d{6}$</code> + </codes> + </zip> <zip countryCode="RU"> <codes> <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> - <zip countryCode="MP"> + <zip countryCode="SA"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> </codes> </zip> - <zip countryCode="CS"> + <zip countryCode="SE"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="123 45">^[0-9]{3}\s[0-9]{2}$</code> </codes> </zip> <zip countryCode="SG"> @@ -386,50 +687,54 @@ <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> + <zip countryCode="SI"> + <codes> + <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + </codes> + </zip> <zip countryCode="SK"> <codes> <code id="pattern_1" active="true" example="123 45">^[0-9]{3}\s[0-9]{2}$</code> </codes> </zip> - <zip countryCode="SI"> + <zip countryCode="SH"> <codes> - <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + <code id="pattern_1" active="true" example="ASCN 1ZZ">^(ASCN|STHL) 1ZZ$</code> </codes> </zip> - <zip countryCode="ZA"> + <zip countryCode="SJ"> <codes> - <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> </codes> </zip> - <zip countryCode="ES"> + <zip countryCode="SM"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="47890">^4789\d$</code> </codes> </zip> - <zip countryCode="XY"> + <zip countryCode="SN"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> </codes> </zip> - <zip countryCode="SZ"> + <zip countryCode="SO"> <codes> - <code id="pattern_1" active="true" example="A123">^[a-zA-Z]{1}[0-9]{3}$</code> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> </codes> </zip> - <zip countryCode="SE"> + <zip countryCode="SZ"> <codes> - <code id="pattern_1" active="true" example="123 45">^[0-9]{3}\s[0-9]{2}$</code> + <code id="pattern_1" active="true" example="A123">^[a-zA-Z]{1}[0-9]{3}$</code> </codes> </zip> - <zip countryCode="CH"> + <zip countryCode="TC"> <codes> - <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + <code id="pattern_1" active="true" example="TKCA 1ZZ">^TKCA 1ZZ$</code> </codes> </zip> - <zip countryCode="TW"> + <zip countryCode="TH"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> - <code id="pattern_2" active="true" example="123">^[0-9]{3}$</code> </codes> </zip> <zip countryCode="TJ"> @@ -437,9 +742,14 @@ <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> - <zip countryCode="TH"> + <zip countryCode="TM"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + </codes> + </zip> + <zip countryCode="TN"> + <codes> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> </codes> </zip> <zip countryCode="TR"> @@ -447,24 +757,20 @@ <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> - <zip countryCode="TM"> + <zip countryCode="TT"> <codes> - <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + <code id="pattern_1" active="true" example="120110">^\d{6}$</code> </codes> </zip> - <zip countryCode="UA"> + <zip countryCode="TW"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_2" active="true" example="123">^[0-9]{3}$</code> </codes> </zip> - <zip countryCode="GB"> + <zip countryCode="UA"> <codes> - <code id="pattern_1" active="true" example="AB12 3CD">^[a-zA-Z]{2}[0-9]{2}\s?[0-9]{1}[a-zA-Z]{2}$</code> - <code id="pattern_2" active="true" example="A1B 2CD">^[a-zA-Z]{1}[0-9]{1}[a-zA-Z]{1}\s?[0-9]{1}[a-zA-Z]{2}$</code> - <code id="pattern_3" active="true" example="AB1 2CD">^[a-zA-Z]{2}[0-9]{1}\s?[0-9]{1}[a-zA-Z]{2}$</code> - <code id="pattern_4" active="true" example="AB1C 2DF">^[a-zA-Z]{2}[0-9]{1}[a-zA-Z]{1}\s?[0-9]{1}[a-zA-Z]{2}$</code> - <code id="pattern_5" active="true" example="A12 3BC">^[a-zA-Z]{1}[0-9]{2}\s?[0-9]{1}[a-zA-Z]{2}$</code> - <code id="pattern_6" active="true" example="A1 2BC">^[a-zA-Z]{1}[0-9]{1}\s?[0-9]{1}[a-zA-Z]{2}$</code> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> <zip countryCode="US"> @@ -483,9 +789,49 @@ <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> + <zip countryCode="VA"> + <codes> + <code id="pattern_1" active="true" example="00120">^00120$</code> + </codes> + </zip> + <zip countryCode="VE"> + <codes> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> + </codes> + </zip> <zip countryCode="VI"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> + <zip countryCode="WF"> + <codes> + <code id="pattern_1" active="true" example="98601">^986\d{2}$</code> + </codes> + </zip> + <zip countryCode="XK"> + <codes> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> + <zip countryCode="XY"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> + <zip countryCode="YT"> + <codes> + <code id="pattern_1" active="true" example="97601">^976\d{2}$</code> + </codes> + </zip> + <zip countryCode="ZA"> + <codes> + <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + </codes> + </zip> + <zip countryCode="ZM"> + <codes> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> </config> diff --git a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php index 5895f3a92c54..6b13e92553e8 100644 --- a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php +++ b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php @@ -180,7 +180,7 @@ public function getAddButtonHtml() \Magento\Backend\Block\Widget\Button::class )->setData( [ - 'label' => __('Add New Link'), + 'label' => $this->escapeHtmlAttr(__('Add New Link')), 'id' => 'add_link_item', 'class' => 'action-add', 'data_attribute' => ['action' => 'add-link'], diff --git a/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php b/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php index 5a54a274485f..54ae6dd95372 100644 --- a/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php +++ b/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php @@ -9,6 +9,7 @@ use Magento\Downloadable\Model\Link; use Magento\Downloadable\Model\Link\Purchased; use Magento\Downloadable\Model\Link\Purchased\Item; +use Magento\Framework\App\ObjectManager; use Magento\Store\Model\ScopeInterface; /** @@ -39,6 +40,10 @@ class Downloadable extends \Magento\Sales\Block\Order\Email\Items\DefaultItems * @since 100.1.0 */ protected $frontendUrlBuilder; + /** + * @var \Magento\Downloadable\Model\Sales\Order\Link\Purchased + */ + private $purchasedLink; /** * @param \Magento\Framework\View\Element\Template\Context $context @@ -46,18 +51,22 @@ class Downloadable extends \Magento\Sales\Block\Order\Email\Items\DefaultItems * @param \Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory $itemsFactory * @param \Magento\Framework\Url $frontendUrlBuilder * @param array $data + * @param \Magento\Downloadable\Model\Sales\Order\Link\Purchased|null $purchasedLink */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory, \Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory $itemsFactory, \Magento\Framework\Url $frontendUrlBuilder, - array $data = [] + array $data = [], + ?\Magento\Downloadable\Model\Sales\Order\Link\Purchased $purchasedLink = null ) { $this->_purchasedFactory = $purchasedFactory; $this->_itemsFactory = $itemsFactory; $this->frontendUrlBuilder = $frontendUrlBuilder; parent::__construct($context, $data); + $this->purchasedLink = $purchasedLink + ?? ObjectManager::getInstance()->get(\Magento\Downloadable\Model\Sales\Order\Link\Purchased::class); } /** @@ -67,15 +76,7 @@ public function __construct( */ public function getLinks() { - $this->_purchased = $this->_purchasedFactory->create()->load( - $this->getItem()->getOrderItemId(), - 'order_item_id' - ); - $purchasedLinks = $this->_itemsFactory->create()->addFieldToFilter( - 'order_item_id', - $this->getItem()->getOrderItemId() - ); - $this->_purchased->setPurchasedItems($purchasedLinks); + $this->_purchased = $this->purchasedLink->getLink($this->getItem()); return $this->_purchased; } diff --git a/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php b/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php index c714a10d37f0..d0385900b09a 100644 --- a/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php +++ b/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php @@ -38,42 +38,47 @@ class Downloadable extends \Magento\Sales\Block\Order\Email\Items\Order\DefaultO * @var \Magento\Framework\UrlInterface */ private $frontendUrlBuilder; + /** + * @var \Magento\Downloadable\Model\Sales\Order\Link\Purchased + */ + private $purchasedLink; /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory * @param \Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory $itemsFactory * @param array $data + * @param \Magento\Downloadable\Model\Sales\Order\Link\Purchased|null $purchasedLink */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory, \Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory $itemsFactory, - array $data = [] + array $data = [], + ?\Magento\Downloadable\Model\Sales\Order\Link\Purchased $purchasedLink = null ) { $this->_purchasedFactory = $purchasedFactory; $this->_itemsFactory = $itemsFactory; parent::__construct($context, $data); + $this->purchasedLink = $purchasedLink + ?? ObjectManager::getInstance()->get(\Magento\Downloadable\Model\Sales\Order\Link\Purchased::class); } /** - * Enter description here... + * Get purchased link * * @return \Magento\Downloadable\Model\Link\Purchased */ public function getLinks() { - $this->_purchased = $this->_purchasedFactory->create()->load( - $this->getItem()->getId(), - 'order_item_id' - ); - $purchasedLinks = $this->_itemsFactory->create()->addFieldToFilter('order_item_id', $this->getItem()->getId()); - $this->_purchased->setPurchasedItems($purchasedLinks); + $this->_purchased = $this->purchasedLink->getLink($this->getItem()); return $this->_purchased; } /** + * Get purchased link title + * * @return null|string */ public function getLinksTitle() @@ -85,6 +90,8 @@ public function getLinksTitle() } /** + * Get download link for given link + * * @param Item $item * @return string */ diff --git a/app/code/Magento/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php b/app/code/Magento/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php index e7b95ec0136f..a16e3b6e2a71 100644 --- a/app/code/Magento/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php +++ b/app/code/Magento/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php @@ -8,6 +8,7 @@ use Magento\Downloadable\Model\Link; use Magento\Downloadable\Model\Link\Purchased; +use Magento\Framework\App\ObjectManager; use Magento\Store\Model\ScopeInterface; /** @@ -32,6 +33,10 @@ class Downloadable extends \Magento\Sales\Block\Order\Item\Renderer\DefaultRende * @var \Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory */ protected $_itemsFactory; + /** + * @var \Magento\Downloadable\Model\Sales\Order\Link\Purchased + */ + private $purchasedLink; /** * @param \Magento\Framework\View\Element\Template\Context $context @@ -40,6 +45,7 @@ class Downloadable extends \Magento\Sales\Block\Order\Item\Renderer\DefaultRende * @param \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory * @param \Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory $itemsFactory * @param array $data + * @param \Magento\Downloadable\Model\Sales\Order\Link\Purchased|null $purchasedLink */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, @@ -47,32 +53,31 @@ public function __construct( \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory, \Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory $itemsFactory, - array $data = [] + array $data = [], + ?\Magento\Downloadable\Model\Sales\Order\Link\Purchased $purchasedLink = null ) { $this->_purchasedFactory = $purchasedFactory; $this->_itemsFactory = $itemsFactory; parent::__construct($context, $string, $productOptionFactory, $data); + $this->purchasedLink = $purchasedLink + ?? ObjectManager::getInstance()->get(\Magento\Downloadable\Model\Sales\Order\Link\Purchased::class); } /** + * Get purchased link + * * @return Purchased */ public function getLinks() { - $this->_purchasedLinks = $this->_purchasedFactory->create()->load( - $this->getOrderItem()->getId(), - 'order_item_id' - ); - $purchasedItems = $this->_itemsFactory->create()->addFieldToFilter( - 'order_item_id', - $this->getOrderItem()->getId() - ); - $this->_purchasedLinks->setPurchasedItems($purchasedItems); + $this->_purchasedLinks = $this->purchasedLink->getLink($this->getOrderItem()); return $this->_purchasedLinks; } /** + * Get purchased link title + * * @return string */ public function getLinksTitle() diff --git a/app/code/Magento/Downloadable/Model/Link/DeleteHandler.php b/app/code/Magento/Downloadable/Model/Link/DeleteHandler.php index 399550e5f33c..c2a3b20ff9e3 100644 --- a/app/code/Magento/Downloadable/Model/Link/DeleteHandler.php +++ b/app/code/Magento/Downloadable/Model/Link/DeleteHandler.php @@ -9,7 +9,7 @@ use Magento\Framework\EntityManager\Operation\ExtensionInterface; /** - * Class DeleteHandler + * Delete Handler for Downloadable Product Links. */ class DeleteHandler implements ExtensionInterface { @@ -27,6 +27,8 @@ public function __construct(LinkRepository $linkRepository) } /** + * Delete Downloadable Links for the provided Product. + * * @param object $entity * @param array $arguments * @return \Magento\Catalog\Api\Data\ProductInterface|object @@ -41,6 +43,8 @@ public function execute($entity, $arguments = []) foreach ($this->linkRepository->getList($entity->getSku()) as $link) { $this->linkRepository->delete($link->getId()); } + $entity->setDownloadableLinks(null); + return $entity; } } diff --git a/app/code/Magento/Downloadable/Model/Link/ReadHandler.php b/app/code/Magento/Downloadable/Model/Link/ReadHandler.php index a11b38ee3afd..d3a2349739c2 100644 --- a/app/code/Magento/Downloadable/Model/Link/ReadHandler.php +++ b/app/code/Magento/Downloadable/Model/Link/ReadHandler.php @@ -9,7 +9,7 @@ use Magento\Framework\EntityManager\Operation\ExtensionInterface; /** - * Class ReadHandler + * Read Handler for Downloadable Product Links. */ class ReadHandler implements ExtensionInterface { @@ -27,6 +27,8 @@ public function __construct(LinkRepository $linkRepository) } /** + * Read Downloadable Links for the provided Product. + * * @param object $entity * @param array $arguments * @return \Magento\Catalog\Api\Data\ProductInterface|object @@ -40,10 +42,9 @@ public function execute($entity, $arguments = []) } $entityExtension = $entity->getExtensionAttributes(); $links = $this->linkRepository->getLinksByProduct($entity); - if ($links) { - $entityExtension->setDownloadableProductLinks($links); - } + $entityExtension->setDownloadableProductLinks($links); $entity->setExtensionAttributes($entityExtension); + return $entity; } } diff --git a/app/code/Magento/Downloadable/Model/Sales/Order/Link/Purchased.php b/app/code/Magento/Downloadable/Model/Sales/Order/Link/Purchased.php new file mode 100644 index 000000000000..cfb768b6d747 --- /dev/null +++ b/app/code/Magento/Downloadable/Model/Sales/Order/Link/Purchased.php @@ -0,0 +1,73 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Downloadable\Model\Sales\Order\Link; + +use Magento\Downloadable\Model\Link\Purchased as PurchasedEntity; +use Magento\Downloadable\Model\Link\PurchasedFactory; +use Magento\Downloadable\Model\Product\Type; +use Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory; +use Magento\Framework\DataObject; + +/** + * Order purchased link resolver + */ +class Purchased +{ + /** + * @var PurchasedFactory + */ + private $linkPurchasedFactory; + /** + * @var CollectionFactory + */ + private $linkPurchasedItemCollectionFactory; + + /** + * @param PurchasedFactory $linkPurchasedFactory + * @param CollectionFactory $linkPurchasedItemCollectionFactory + */ + public function __construct( + PurchasedFactory $linkPurchasedFactory, + CollectionFactory $linkPurchasedItemCollectionFactory + ) { + $this->linkPurchasedFactory = $linkPurchasedFactory; + $this->linkPurchasedItemCollectionFactory = $linkPurchasedItemCollectionFactory; + } + + /** + * Get order purchased link + * + * @param DataObject $item + * @return PurchasedEntity + */ + public function getLink(DataObject $item): PurchasedEntity + { + if ($item->getOrderItem()) { + $item = $item->getOrderItem(); + } + + if ($item->getProductType() !== Type::TYPE_DOWNLOADABLE) { + $childrenItems = $item->getChildrenItems() ?: []; + if (count($childrenItems) === 1) { + $childItem = reset($childrenItems); + if ($childItem->getProductType() == Type::TYPE_DOWNLOADABLE) { + $item = $childItem; + } + } + } + $itemId = $item->getId(); + + $purchased = $this->linkPurchasedFactory->create() + ->load($itemId, 'order_item_id'); + $purchasedLinks = $this->linkPurchasedItemCollectionFactory->create() + ->addFieldToFilter('order_item_id', $itemId); + $purchased->setPurchasedItems($purchasedLinks); + + return $purchased; + } +} diff --git a/app/code/Magento/Downloadable/Model/Sample/DeleteHandler.php b/app/code/Magento/Downloadable/Model/Sample/DeleteHandler.php index b34cedbdda01..d7361b602673 100644 --- a/app/code/Magento/Downloadable/Model/Sample/DeleteHandler.php +++ b/app/code/Magento/Downloadable/Model/Sample/DeleteHandler.php @@ -9,7 +9,7 @@ use Magento\Framework\EntityManager\Operation\ExtensionInterface; /** - * Class DeleteHandler + * Delete Handler for Downloadable Product Samples. */ class DeleteHandler implements ExtensionInterface { @@ -27,6 +27,8 @@ public function __construct(SampleRepository $sampleRepository) } /** + * Delete Downloadable Samples for the provided Entity. + * * @param object $entity * @param array $arguments * @return \Magento\Catalog\Api\Data\ProductInterface|object @@ -42,6 +44,8 @@ public function execute($entity, $arguments = []) foreach ($this->sampleRepository->getList($entity->getSku()) as $sample) { $this->sampleRepository->delete($sample->getId()); } + $entity->setDownloadableSamples(null); + return $entity; } } diff --git a/app/code/Magento/Downloadable/Model/Sample/ReadHandler.php b/app/code/Magento/Downloadable/Model/Sample/ReadHandler.php index abcefc720ca3..4704de24e209 100644 --- a/app/code/Magento/Downloadable/Model/Sample/ReadHandler.php +++ b/app/code/Magento/Downloadable/Model/Sample/ReadHandler.php @@ -9,7 +9,7 @@ use Magento\Framework\EntityManager\Operation\ExtensionInterface; /** - * Class ReadHandler + * Read Handler for Downloadable Product Samples. */ class ReadHandler implements ExtensionInterface { @@ -27,6 +27,8 @@ public function __construct(SampleRepository $sampleRepository) } /** + * Read Downloadable Samples for the provided Entity. + * * @param object $entity * @param array $arguments * @return \Magento\Catalog\Api\Data\ProductInterface|object @@ -40,10 +42,9 @@ public function execute($entity, $arguments = []) } $entityExtension = $entity->getExtensionAttributes(); $samples = $this->sampleRepository->getSamplesByProduct($entity); - if ($samples) { - $entityExtension->setDownloadableProductSamples($samples); - } + $entityExtension->setDownloadableProductSamples($samples); $entity->setExtensionAttributes($entityExtension); + return $entity; } } diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminAssertDownloadableLinkInformationActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminAssertDownloadableLinkInformationActionGroup.xml new file mode 100644 index 000000000000..474e6ec5ba19 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminAssertDownloadableLinkInformationActionGroup.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertDownloadableLinkInformationActionGroup"> + <annotations> + <description>Verifies the data for a downloadable link on the Edit Product page in admin.</description> + </annotations> + <arguments> + <argument name="title" defaultValue="{{downloadableLink.title}}" type="string"/> + <argument name="price" defaultValue="{{downloadableLink.price}}" type="string"/> + <argument name="fileType" defaultValue="{{downloadableLink.file_type}}" type="string"/> + <argument name="fileNameOrUrl" defaultValue="{{downloadableLink.file}}" type="string"/> + <argument name="sampleType" defaultValue="{{downloadableLink.sample_type}}" type="string"/> + <argument name="sampleFileNameOrUrl" defaultValue="{{downloadableLink.sample}}" type="string"/> + <argument name="shareable" defaultValue="{{downloadableLink.shareable}}" type="string"/> + <argument name="maxDownloads" defaultValue="0" type="string"/> + <argument name="index" defaultValue="0" type="string"/> + </arguments> + <conditionalClick selector="{{AdminProductDownloadableSection.sectionHeader}}" dependentSelector="{{AdminProductDownloadableSection.addSampleTitleInput(index)}}" visible="false" stepKey="expandDownloadableSection"/> + <waitForElementVisible selector="{{AdminProductDownloadableSection.addSampleTitleInput(index)}}" stepKey="waitForDownloadableLinks"/> + <seeInField userInput="{{title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput(index)}}" stepKey="seeTitle"/> + <seeInField userInput="{{price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput(index)}}" stepKey="seePrice"/> + <seeInField userInput="{{fileType}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector(index)}}" stepKey="seeFileType"/> + <executeJS function=" + var element = document.evaluate("{{AdminProductDownloadableSection.linkFileNameOrUrl(index)}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null); + if ( typeof element.singleNodeValue.value !== "undefined" ) { + return element.singleNodeValue.value; } + else { + return element.singleNodeValue.innerText; };" + stepKey="grabFileNameOrUrl"/> + <assertStringContainsString stepKey="assertFileNameOrUrl"> + <actualResult type="variable">grabFileNameOrUrl</actualResult> + <expectedResult type="string">{{fileNameOrUrl}}</expectedResult> + </assertStringContainsString> + <seeInField userInput="{{sampleType}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector(index)}}" stepKey="seeSampleType"/> + <executeJS function=" + var element = document.evaluate("{{AdminProductDownloadableSection.linkSampleFileNameOrUrl(index)}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null); + if ( typeof element.singleNodeValue.value !== "undefined" ) { + return element.singleNodeValue.value; } + else { + return element.singleNodeValue.innerText; };" + stepKey="grabSampleFileNameOrUrl"/> + <assertStringContainsString stepKey="assertSampleFileNameOrUrl"> + <actualResult type="variable">grabSampleFileNameOrUrl</actualResult> + <expectedResult type="string">{{sampleFileNameOrUrl}}</expectedResult> + </assertStringContainsString> + <seeInField userInput="{{shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector(index)}}" stepKey="seeShareable"/> + <seeInField userInput="{{maxDownloads}}" selector="{{AdminProductDownloadableSection.addLinkMaxDownloadsInput(index)}}" stepKey="seeMaxDownloads"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminAssertDownloadableSampleLinkInformationActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminAssertDownloadableSampleLinkInformationActionGroup.xml new file mode 100644 index 000000000000..733ed47549d4 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminAssertDownloadableSampleLinkInformationActionGroup.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertDownloadableSampleLinkInformationActionGroup"> + <annotations> + <description>Verifies the data for a downloadable sample link on the Edit Product page in admin.</description> + </annotations> + <arguments> + <argument name="title" defaultValue="{{downloadableSampleFile.title}}" type="string"/> + <argument name="fileType" defaultValue="{{downloadableSampleFile.file_type}}" type="string"/> + <argument name="fileNameOrUrl" defaultValue="{{downloadableSampleFile.file}}" type="string"/> + <argument name="index" defaultValue="0" type="string"/> + </arguments> + <conditionalClick selector="{{AdminProductDownloadableSection.sectionHeader}}" dependentSelector="{{AdminProductDownloadableSection.addSampleTitleInput(index)}}" visible="false" stepKey="expandDownloadableSection"/> + <waitForElementVisible selector="{{AdminProductDownloadableSection.addSampleTitleInput(index)}}" stepKey="waitForDownloadableLinks"/> + <seeInField userInput="{{title}}" selector="{{AdminProductDownloadableSection.addSampleTitleInput(index)}}" stepKey="seeTitle"/> + <seeInField userInput="{{fileType}}" selector="{{AdminProductDownloadableSection.addSampleFileTypeSelector(index)}}" stepKey="seeFileType"/> + <executeJS function=" + var element = document.evaluate("{{AdminProductDownloadableSection.sampleFileNameOrUrl(index)}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null); + if ( typeof element.singleNodeValue.value !== "undefined" ) { + return element.singleNodeValue.value; } + else { + return element.singleNodeValue.innerText; };" + stepKey="grabFileNameOrUrl"/> + <assertStringContainsString stepKey="assertFileNameOrUrl"> + <actualResult type="variable">grabFileNameOrUrl</actualResult> + <expectedResult type="string">{{fileNameOrUrl}}</expectedResult> + </assertStringContainsString> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontLinkOnDownloadableProductPageActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontLinkOnDownloadableProductPageActionGroup.xml new file mode 100644 index 000000000000..978fff04938f --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontLinkOnDownloadableProductPageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontLinkOnDownloadableProductPageActionGroup"> + <annotations> + <description>Validates that the provided Link Title is present on Downloadable Product details page.</description> + </annotations> + <arguments> + <argument name="linkTitle" type="string" defaultValue="{{downloadableLink.title}}"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontDownloadableProductSection.downloadableLinksListSection}}" stepKey="waitForDownloadableLinksList"/> + <see selector="{{StorefrontDownloadableProductSection.downloadableLinksListSection}}" userInput="{{linkTitle}}" stepKey="seeDownloadableLink"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontNoLinkOnDownloadableProductPageActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontNoLinkOnDownloadableProductPageActionGroup.xml new file mode 100644 index 000000000000..8b7183966987 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontNoLinkOnDownloadableProductPageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontNoLinkOnDownloadableProductPageActionGroup"> + <annotations> + <description>Validates that the provided Link Title is NOT present on Downloadable Product details page.</description> + </annotations> + <arguments> + <argument name="linkTitle" type="string" defaultValue="{{downloadableLink.title}}"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontDownloadableProductSection.downloadableLinksListSection}}" stepKey="waitForDownloadableLinksList"/> + <dontSee selector="{{StorefrontDownloadableProductSection.downloadableLinksListSection}}" userInput="{{linkTitle}}" stepKey="dontSeeDownloadableLink"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontNoSampleOnDownloadableProductPageActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontNoSampleOnDownloadableProductPageActionGroup.xml new file mode 100644 index 000000000000..693667b3dddf --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontNoSampleOnDownloadableProductPageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontNoSampleOnDownloadableProductPageActionGroup"> + <annotations> + <description>Validates that the provided Sample Title is NOT present on Downloadable Product details page.</description> + </annotations> + <arguments> + <argument name="sampleTitle" type="string" defaultValue="{{downloadableSampleUrl.title}}"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontDownloadableProductSection.downloadableSamplesListSection}}" stepKey="waitForDownloadableSamplesList"/> + <dontSeeElement selector="{{StorefrontDownloadableProductSection.downloadableSampleLabel(sampleTitle)}}" stepKey="dontSeeDownloadableSample"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontSampleOnDownloadableProductPageActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontSampleOnDownloadableProductPageActionGroup.xml new file mode 100644 index 000000000000..8542c8389299 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontSampleOnDownloadableProductPageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontSampleOnDownloadableProductPageActionGroup"> + <annotations> + <description>Validates that the provided Sample Title is present on Downloadable Product details page.</description> + </annotations> + <arguments> + <argument name="sampleTitle" type="string" defaultValue="{{downloadableSampleUrl.title}}"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontDownloadableProductSection.downloadableSamplesListSection}}" stepKey="waitForDownloadableSamplesList"/> + <seeElement selector="{{StorefrontDownloadableProductSection.downloadableSampleLabel(sampleTitle)}}" stepKey="seeDownloadableSample"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/StorefrontNavigateToCustomerDownloadableProductsPageActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/StorefrontNavigateToCustomerDownloadableProductsPageActionGroup.xml new file mode 100644 index 000000000000..2e1218de3195 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/StorefrontNavigateToCustomerDownloadableProductsPageActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontNavigateToCustomerDownloadableProductsPageActionGroup"> + <annotations> + <description>Navigates to the storefront My Downloadable Products page. Must be signed in as a customer.</description> + </annotations> + <amOnPage url="{{StorefrontCustomerDownloadableProductsPage.url}}" stepKey="navigateToImportPage"/> + <waitForText userInput="My Downloadable Products" selector="{{StorefrontCustomerAccountMainSection.pageTitle}}" stepKey="waitForPageTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Data/LinkData.xml b/app/code/Magento/Downloadable/Test/Mftf/Data/LinkData.xml index 4c0382e0d444..a406453438a6 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Data/LinkData.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Data/LinkData.xml @@ -8,10 +8,7 @@ <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> - <entity name="downloadableData" type="downloadable_data"> - <data key="link_title">Downloadable Links</data> - <data key="sample_title">Downloadable Samples</data> - </entity> + <!-- Downloadable Links --> <entity name="downloadableLink" type="downloadable_link"> <data key="title" unique="suffix">DownloadableLink</data> <data key="price">2.00</data> @@ -64,6 +61,28 @@ <data key="is_shareable">1</data> <data key="sort_order">2</data> </entity> + <entity name="ApiDownloadableLink" type="downloadable_link"> + <data key="title" unique="suffix">Api Downloadable Link</data> + <data key="price">2.00</data> + <data key="link_type">url</data> + <data key="shareable">No</data> + <data key="number_of_downloads">1000</data> + <data key="sort_order">0</data> + <data key="link_url">https://static.magento.com/sites/all/themes/mag_redesign/images/magento-logo.svg</data> + </entity> + <entity name="downloadableLink_Files" type="downloadable_link"> + <data key="title" unique="suffix">LinkFiles</data> + <data key="sort_order">1</data> + <data key="is_shareable">1</data> + <data key="price">3.43</data> + <data key="number_of_downloads">2</data> + <data key="link_type">file</data> + <data key="sample_type">file</data> + <requiredEntity type="link_file_content">downloadableLink_MagentoLogo</requiredEntity> + <requiredEntity type="sample_file_content">downloadableSampleLink_AdobeBase</requiredEntity> + </entity> + + <!-- Downloadable Samples --> <entity name="downloadableSampleFile" type="downloadable_sample"> <data key="title" unique="suffix">SampleFile</data> <data key="file_type">Upload File</data> @@ -80,13 +99,30 @@ <data key="sample_type">url</data> <data key="sample_url">http://example.com</data> </entity> - <entity name="ApiDownloadableLink" type="downloadable_link"> - <data key="title" unique="suffix">Api Downloadable Link</data> - <data key="price">2.00</data> - <data key="link_type">url</data> - <data key="shareable">No</data> - <data key="number_of_downloads">1000</data> + <entity name="downloadableSample_File2" type="downloadable_sample"> + <data key="title" unique="suffix">SampleFile</data> <data key="sort_order">0</data> - <data key="link_url">https://static.magento.com/sites/all/themes/mag_redesign/images/magento-logo.svg</data> + <data key="sample_type">file</data> + <requiredEntity type="sample_file_content">downloadableSampleLink_TestImage</requiredEntity> + </entity> + + <!-- File Content --> + <entity name="downloadableLink_MagentoLogo" type="link_file_content"> + <data key="file_data">iVBORw0KGgoAAAANSUhEUgAAAP8AAAEsCAYAAAAM1WX/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAACY7SURBVHhe7Z0LlBxXnd6HXWyWhx9g8HS3pJFGPVU1klmC2RB28frBIbY00y2NpBnN9GMkG4JJcOJsgCVrszZg56wJuxj2BTjLY8FsADsb20kwmEc4WYgNxPYuiwX2yg9ZxrKsefS7R5IlufP/qm+N76hbo5qa7p6qru875zs6M5quvvd/76/q3lt1/9VDhU/7Ll79ikrauL66y8pVUsZ1ezf1nan+i6KoblV+bP22uUlrT+1dG2vlycEa/pWfH5kej4+oP6Eoqpt0aGx9vJqxvnF892Dt2JUbavmMNW/8fEx+X81aXy9MxNerj1AUFWQ9eGHPy4sp4wOHJ60ZXOWLWauW08CH8TN+r0YBM8W0+f47B3vOUIegKCpoyo/HL6tkzAcA9eFdgw3Qn2z8/5z8Hf6+krEeyE/EL1WHoigqCHo+2X9+MW18dm5y8MSLV25sCvrpfEI+V520TuA4h4b6etWhKYryqwTWXTJ3fxpXbyzone5qfyrjc+WsjALeLSeBrPl0MWNOqq+gKMpPmh3rf2Mpbdxbu2pj7ejuDZ6hP9k4Do6HEUQpY34zl+r/TfWVFEWtpH52ee+rZF7/kbmsVQb4hZPgbZVxXBx/btIqldLmjQeSkVeqIlAU1Wnl0gNJAf/nGOJXlzHEd2scH99jLwhmzX8sTgwkVFEoiuqEcjvW9pWzxleO7hqsHT/pnn2njO/F95cz5pefk/KoolEU1S5VM+Y1law1hatvqck9+04Z34vvr48CrEMolyoiRVGtVG5n/0Vylf07zLvd3LPvlFEOlAflkqnA/5kdX/92VWSKopajZ8Zir53LGrdWJ61jL161oW0Lest1fUFwQ60i5ZxLG7fuT/Sdq6pAUdRSVU4ZqXLGenK59+w7ZZTP2SxUzlpPlNPGhKoKRVFuND22zpQh9N+euHJD7YXdK7Ogt1yj3Ch/JWv97fSOPktVjaKoZsK++krGuK6cNUu4emKzTTOwgmJns5CcyIqVtPkH9zJvAEU1amZi3eXVjPkQYMHmGr8P8d0a9XA2C1Wz5oOFsXX/UlWZosKt6a1rotWs9XmsmGOY3AygbjHqd3hysFbNWH+1X+qtQkBR4VMpZbynOmkewFWxlO2eq/2pjPqhnvboJms+i/qrUFBUOFRI9f+WdP7v4tbYkRZuwgmKUV/UG/WXqcB3Cjvjb1Ghoaju1L6RtedUM8YtMsw/2s5NOEGxs1moOmkdKWeMjyM+KlQU1T3KTxjb57LWL+3V7wDcs++UEQfEoz4VsH6RT63fpkJGUcFWPXGm+V+PyzD35MSZ9EI7iUQrGetriJsKIUUFS0icmU8ZH0BCTFzVmiXOpBca8XGeDTictaaLqYH/gDiqkFKU/1VKxy+Zy1h24sxuumffKSNe9mYhiV81a92fG4tfokJLUf7UoZ19vcWM8ZnqMhJn0guNONqJRFPGXyIxqQo1RflHFSTOnLT24WoVhE04QTHiaG8Werf9bMBTchLYrUJOUSurfCr+5lLG+taLV25oaeJMeqER13oi0Q21Ytr4Vn7nwD9TTUBRndWeS899dTltfFSu9hXes++cnWcD5iTuiP/By3tfpZqEotqvysRAopOJM+mFRrz1RKKVlDGsmoai2qN64kzzS0d3r1ziTHqh0Q5HdtmJRP86t7N/jWoqimqdyinj31Wz1iFcbVYycSa90GgHJ5GotM/zTCRKtUzFifjvyBDfTpyJKwyh96fRLmgftBMSiRbT639bNSFFLU3PXBF7bSVdT5yJ3WfNOhztPzuJRKXdXqhkjE8ykSi1JBVSRqqStR7nPftgGu3lPBuAdkR7qqalqOY6OBrfKJ3l7iAnzqQXGu2IRUEZBdw1s3XNBtXUFFXXnrHBM2SIf305Y5ZxtecmnO4x2lFLJFpCO+8ZHDxDNT0VZs2MDlxezVh24sxqiBb0AASemMO/zf6/24x2RfvW7woMPjjDRKLh1dT2NZG5tHkbEkqeCNEmHEAA6Oek3vm0+Rh2z4XtsWS0t51INGv+F2zGUl2CCoNKE8bV1UkrNIkzYdSxrJJnYgNSLjWQrSUjr5wZj++qZq2n8Xv8f1hi8VIiUetXTCQaAk3vjL9FzvahTJyJ9/xVZIg/lzH//Int/W9QIbF1UH6uZI2/kJOA/XfNPt+NRvs7iUQlLt/Jj8cvVCGhukUzm/vPKmaMj8sV70iYNuGgc9svzJA6y0nv/unR+KUqJE01PR6/rDpp3m9fEUO0/uFsFqpI/yimjFv2Sn9RIaGCrPzEeiTO/AU6dFgSZ6KO8yvcGTNXThkfuGN7z6+pkCyqj17c8+tyovygjBJy+HxY7nygjkwk2iWa2rbOqGSsO5AQMmyJM+uJMDfgzTjfOLTFWyLMqR39A3LiuBPHCWf87ESi30AcVEgovwsJH4sTxgfDljhTv3LJVfuX+fTADhWSZamUGhiVk8Cj9nFDOHJCP5KpwAd+ICMiFRLKj8qND1wcxsSZzpy1nDXx8otbprec8xoVkpZoZvPZZ1UzxsflpBLONZN32W8Wuh/9S4WE8ouwWl1MG39RnbSOvyids1lDdqPROZ3VagHzu+1+7RVeM1bJGN8L590S3CIdPI5+hv6mQkKtpJDQ8XDIEmeijs596nLGPFDp8H1qGQVcXZXvxfeH6jkJNa2qZq19chLYpcJBdVpI4FhKG6FMnGm/6lqGo5W0eRte8a1C0lHNjK2OyRTjr7CHvttfLa4b/cxJJCr9716ZCrxJhYRqtw4kI68sp4yPze2y7E04YZp/Os+mlzLmQ4Xx+BUqJCuqQmr9JinPw/YVMSQjL9hZZ5nLWmUkEkW/VCGh2qFieiCJhI2h62hq5bmaNYtytf+DvZt6zlQh8YX2buo7s5IxrkP57BOylLdZPbrN9glZTQWQ0LWYGUiokFCtUn5i7dpqxrr9qFz5wpQ4E50L+9ExrC6nzXtmR+MbVUh8qdlUfGM5Y/4PJx9CWE7OMPol+mc5bX0lP7J2rQoJtRzJvPLasCXORB21xaXHZVg5ocIRCMm0DJmQnkAmnXAtwjojNOsQEr6qcFBLVXE8/rZKxrITZ2JxKyxXEWcuiRx0hbRxq8wlz1MhCZRQ7lLa+BTqgfo0q2s3Gv3Ufsmo1BmJRGfHmEjUtZBwsZoxPilXjtB1Gjv7rP1AidU1nWYW2Y8n5SQu9QrfSdx+/uKFatb8k30ja89RIaGaqTAxkLaHizJ0CuNw8fCkdbCcMq+pqXh0i27o6XlZQYbBc1nr+bBO36RfM5FoM81MGIMSnLvCmDgTC0Uv7FZvnMms7VMh6Uqphdsvo75hWriFnYXbSsb879M7DEuFJLy6F7eI0sb1SKyIs2OYNuE4t4jkavgPsyF711xR6iv1/hnqH5Zbtqijs1mojESiGeM69H8VknBpdjx+hcyFHrQBCNtc0O70VjXMb5nFW47lJHBTNWvNIR5helirvlkIdwXMB5FAVoWk+4XEmdWM+QUs/oT1sVC56n0zlzJ+U4Uk1Do0PvAmice9oX1MW0Y+1bT1eXChQtKdKqSN91YnQ7ghRG3Ckavc0/kJ40oVDkpTfnzgKonPfsQpnIlEzWcLE8bVKhzdI2zCkcp9J6yJM6VT42r/508m+89XIaGa6HmJTyVj/aVMicKbSHTSvC8/Gn+zCklw9eTYurPLKeMW6fyHcc8+TPM650EPmdfdPzUWv0SFhHKh6Yn4pQJBaJOyVLODh8tp84/AjwpJsITEmQL9L9GAoUycmbVmkTiT6Z+8CXGrMJFosBKJHhpbH0fiyOOhTpxpfu35HX39KiTUMnRoIr5eLiJfC3MiUan/1wsSBxUS/8lOnClXusMhT5xZmjC2q5BQLRQSkoY+kWjafD84UyHxh/Lj8cukYew5Whg34eBlD9WMccujLU6cSS3U9BbzNSqR6NGwrSFpzwbcn59Y/OUrHRFWZ4tp47Nzk4MnXgzZyy6d1VkZkn13Zqz/rSokVAdUSPe/VaaW9USiu0J290g4q05aJ8op4zPgT4Wks0ICQ+n49Rc8hmgYNp84M2s9V8p04X3ZAKmUNt4ro4CDaI/QJRJ9tz0KeLqYMSdVONqv2bH+NyJxIYZdYU2cicSV0ylzRRJnUgs1M2bEymnj8+F9YtTO6fjNXKq/fU+M/uzy3lfJvP4jc1mrHNb5VhmJMydC9Cx2gFRIx6+Q9rETiYbx2YC5SatUSps3tjyRaA6JMzPmzxHYMCXOdFZaZY5VkCH+dX5LnEkt1A8uXv0KGZVeLyAU0G5ov2bt2m0Gj/OJRLPmPxYnWpBINLdjbV85a3wlbIkz4fnEmRnjLuQbUCGhAiC0l0wF7kb7hTE/hJ1INGN++TnhV4VkaapmzGsqWWsKZ5PQJs6cMMdVOKgAqpA2JtCOaM8wZoYSfg+BYxWO0yu3s/8iOWuEMnFm/X1s1jEZOt5aGIu9VoWECrCeHYm+TqZsn0a7on3DtFbl7C+xE4mOr3+7CkmjnpHOPpc1bq0HaUP4gvQupFiy/m7RIFGBVS5tXlS1s0GHNJGocD0nFzUkyFUhqQt54csZ68nwDY/qQ/w5GR4VJox/i0STKiRUF+qOnp5fU4lE7fdAhOkRdGc6W85aT8y/ByI3MXDHcRkahHJhROosQ/yvYGHTDgYVCiGRqEwFbg9lIlGpL3gH9z3Ht6+pFXbG6/8pV8KT/7ibjDOgljjzZ8VxY0j1ByqEQuJU9AP0h1DcwlZ8g3dw3zM7FKnZ3rq6lhuXkwD+oAtPAvbcB42ctSphTpxJLdSesXNfXcZbnyetStc+vKaYBt/g3GG+Z3Y4WrPtnAS29dXyKUN9oMmBAmaczecTZ05a/2t2vP8C1e4UNS88ti6jgO5KJAp+wbHwDK7nGVfMvwS/Y/Wfue1ra/m0Wf9wswP73PoiR3XS2ldMx3epdqaoU6qYMnZ3xYY1cCv8gmOda92N8DvGHyditdxo/0sHO/kLfOwT9tbHwVolY3zmudH1r1dtS1GnFfpLJWt9Zk76T+A2CylOwS34bQa941PDD+OD8JZVtRwWBXFgH58EcJaef7AhYz4wvSN+mWpPilqypsf63yH96MeBeOBNsQlOwes8u824Vl4cfsfqQLmta2r58QHfnQTQKM4mHDlj54oZ44NMnEm1QrchPV3a+H3pV3n0L989G+CwKFyCTzfQO3YHv2N10Ny2tbWcsyjYrEAd9nzizKz5tUPbfJzokAqs7MS0WevreC7AN4lEhT9wCB51Pt16afA7xpdgPWDHuhVbFMTZ10mcKY3CxJlUR2QnEp1c4USi4A2LecLf6eb1i9kb/I7xpUk5CYytf6lQJxe0Da4/r2xDf1iu9n/ExJlUJ7V389lnlTPGx/FyjY4+G6D4Am/gziv0jpcHP4wCwFva/5AQzrK4B2tvVMia353eGX+Lag+K6rimR/t/q+IkEm3nswGKKfshHZeLeW68fPgd2wWSf0fW1PITrV0URFDnE2dmzAOllPEeFf/QSaY3g7WxwTPUj77Q3k19Z6Jc6sfQqZoxrm7LC2gdhoQncGXz1QLoHbcOfseqcDn7ScHWrAfgXuuRXYO1ctr6/MzY6piKeah0aGdfbylrfTmXMp6ckWGn+rUvlHvnWWdLuZ4qZ80voZzq16HSzLboKrkwfQH9tCXPBoAbezGvbwFXrXTr4XeMwi5jURBnTydxZiljPlwYj1+h4hw6VVLWu8oZ61e1q9+IWD7+zGjsN9R/+UJIGjmbMp9C+UpSzkp64Cr1X6FTJR2/opQ2/x791lMiUXDSgsU8N24f/I5R+OSqJS0KOvfs5yatfCVtXI/EjCq2odLUePzCatb8NuaUWOuA82njsZZnaF2msEkqlzL3Yt7rrMlUs9a9U93wqmkP2if9Vfrth5eUSFRxUV/MU/P6Zjy10O2HH0ZFxDkXi4J64sywziORJr2aMf9T5aRXmwcBfpTTuRtTxt2YtHmz38rbKc2OxjeeNpGoYgFcgA+HlaYctdidgd+xU7GRNbXchLNzsD400l52+bjMnUKbOLM0Ed9azVh77FicdB85KPDDepvKKOCRXCq+Rf156FRIGSmJweN4y878ZiGn7wsH9cW8zkHvuLPwO1aVxI4j6TS1Oek0MkQ6WkoZn0TCRRWzUCk/tmadDPH/BleIUz1BFiT4daM+yJojo5mv5kfWrlUfC5Wkzc5DYlj0c/R39PvFdtx1wisDv2OpdHnLqlppbN3B2XEjlIkzsQehOGG+v5I1T/tq86DCj/q8tPfCnC6nzN9DPj318VAJiUQr0t/R71cKescrC7/4ha2x2vRQ5CcqNqGSDPl+V672/xdQuNk1FlT4HaN+zq5LGQb/KLfTvEgdIlSaHer9Kfp9Mx466RWH/6gEYWY48pCKSyj0mAwBKxnzzypZ6wTSpDcDpZmDDr9u5NAvS/0rafNPwzTVq4lnhyMPo98346GTJvwdVmFiIF2dtJ7A1X6pmWK6CX7U28m0JPPgx2dTRkodrqtF+DWHBX7kDpzLmPcgRxwW9ZYCveNugt8x4uDc3pXR0D2zqfhGddiuFOHX3O3wA9RCeuBGmeOWcZUruHng4xTuRvgdIy6IT3XSLEm8bnjIZ3VslQi/5m6Gf3Zi/WYZ0tqPerYiL3w3ww8jPtp7FR6eHVu/SX1F14jwa+5G+PFq5HLG/GKrX23e7fDrRtywSaYkcczt7F+jvirwIvyauw3+UnrgfXLVeg5Xr5Zu7xSHCX7Ebf5dipPWgVJq4F+rrwu0CL/mboFfhqi/Xc2a/9tO7LCrPYkdwgS/Y8QR8bQ3C2Ws7xfH429TXxtIEX7NQYd/38jac0pp84/l6nSk3Smdwgi/4/nUbRLnUsr8xJNj685WXx8oEX7NQYa/PGGNVTuYzDHM8MOIr7ZZ6JcyFRhVRQiMCL/mIMI/vcOwyhnzv9lpnNvc4XWHHX7d2CyE+JfT5p3TY5apiuJ7EX7NQYL/wQt7Xl7JmB+Sq878Cxyadcx2mfAvtLNZSNojV0kbv4/2UUXyrQi/5qDAXxg33ilX+/9nrz57Sc/UAhP+RqMdnHRv5Yz103LKfIcqli9F+DX7Hf79W9dEK1nzs/ZLG5ewCacdJvyLG5ukqpPWCbyc9entayKqeL4S4dfsZ/grafNflbPms7iqtPqevRcT/sWN9nGeDShlzGdlivZuVUTfiPBr9iP8eBmInjhzpaF3TPjdGe2FWKlnA76FRKiqqCsuwq/ZT/Dnd7/pHJnXNyTO9IsJ/9LsPBsg7TlXTps3o31VkVdMhF+zn+DP7ej/cO09F9SqbXpCb7km/Es32hHtiXadGe2/XhV5xUT4NfsJ/unNvTfXRvtquZ2dffGoWxP+JVq1H3Lh10bX1KR9b1JFXjERfs1+gn92KPrR2og0ylCkltu6ppYbb+07B5drwu/Sqs3Qfrmt9Vz4aFfpZx9RRV4xEX7NvoN/26p62VRmVbwrLZdy3jHQpKN10IT/NEb7APoJo5YbWfiOO7Qr4V9owq9pAfyOnZPAdm/vHGylCf8iRrvgHXfSTnq7OSb8jSb8mprC7xidCS8eHe1/qbOd3AHbbMLfxKod0C6LvdiS8Dea8GtaFH4YHQvesqq+KKiGmQ0dsk0m/JoRd4k/2gHtMd82zdpNTPgbTfg1nRZ+x05H27pa5pedWxQk/GIVa8Qd8T8d9I4Jf6MJvybX8DtWnQ6LgnlnUbBZh22RQw8/4itxRrz1+Lsx4W804de0ZPgdOyeBHe1dFAwt/IgnFvMkvnq8l2LC32jCr8kz/I7RKZOxWm6sPYuCoYNfxQ/xRFy9QO+Y8Dea8GtaNvwwOii8ZXUttzNe78AtOgmEBn4VM8QPcZyPabN4uzThbzTh19QS+B2rDpsbWWM/dNKKk0DXw+9APzFgx60V0Dsm/I0m/JpaCr9j1Xlz29Yue1Gwq+FHXOzFvLUL4tYqE/5GE35NbYHfsXMSsBcFVWdvBsEi7kr4EQeJx3IW89yY8Dea8GtqK/yO0bmTq+ydZvOd/2QgTuGugl/VG3FAPNoFvWPC32jCr6kj8MPo6DAWBcfdLwp2Bfyqrqh3qxbz3JjwN5rwa+oY/I5Vx8fiVn5+UbAJMMqBht95FNrecdfaxTw3JvyNJvyaOg6/YwVBbjsWBU/9kFBg4Ud9pF6on17fTprwN5rwa1ox+B0DikV2DgYOflX+3Oi6RXfcdcKEv9GEX9OKww8PwQIJFgXxkJAGUWDgd6DHQzrOYh7q1ay+HTLhbzTh1+QL+B3bwIixc1AtCh69cqO/4Uf5pJz2Yt4Sdtx1woS/0YRfk6/gd+wAtK2vdnQSw2nznwCbKrIvdOjSc1+dy1iPH8ladjn9BL1jwt9owq/Jl/A7FpiObJWpwLa+R2pjg2eoIvtCezf1nZnbtmbPYSmf36B3TPgbTfg1+Rp+sR2rod4HVXF9pdmh3of80KFPZcLfaMKvKRDw+yRWuvzUoU9lwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt/onmNbV9UKiagEpvkftNuE370Jv3cT/rrBOXgH9z0zQ9HPVZKx2gsrVBjC796E37sJf93gHLyDe7tAUphNpUT04drIqloZ/9HkQ+0y4Xdvwu/dYYYfPINr8F1KxB4C7/XSKO27ePUrSsnYHxYT0fKL8kd59aFmB2ulCb97E37vDiP84DcvQ3zwLBf3Umk48uEfCOf1kjTRbKL3AjlL3I3hwZEt7S8g4Xdvwu/dYYQf/ILjciJ218Et52+sl8CFColoRkYB+xA0+dc+izT7guWa8Ls34ffusMAPTsGr4vap2WQ0Xf/mJepAMnKeTAU+XU5GXzjepsISfvcm/N4dBvhz4uMjsVpJeBVuP/WY8Fv/1mUol4xcVEzEfoS5Q7XFC4KE370Jv3d3M/zgsSpDfPBZTER+ODsUeXv921qkG3p6XiYjgGtl/jCFQGIhoRUnAcLv3oTfu7sRfvAHDlE34fJQcTh6LTitf1MbdHBL77ricOyrWExoRQUIv3sTfu/uRvidRflSInp7ftMb1ta/oQMqJqJbxHvss84ypgKE370Jv3d3C/zgzL5nL/UR/h4pJqPJ+pE7rL2bzz6rOBS9uZKIVU7IfAMLDs0KvJgJv3sTfu/uBvjBF+b1MsSvCPgf23Ppua+uH3UFld8ce3N+OHLfiZFY7bAMQ5YyCiD87k34vTvo8IMrrOTLHP9bU8Jb/Wg+Un4odlUlGd2vhiSuTgKE370Jv3cHEX7wA45Q9nIiuj+XiO2uH8Wnmtq0JiKjgNuweQA7h5pVSjfhd2/C791BhB/8gKPcUPRzh4bO660fIQDKD/W+o5yM/gRBt3cRNakcTPjdm/B7d1DgByfgxd5kl4j+OD98/mX1TwZMezf1nSlzlA9JJXIIfrNnAwi/exN+7w4C/M49e5k6z+aHYx/cMzZ4Rv1TAdb0pqgpo4A7m20WIvzuTfi92+/wH1XPzQgnd0wNRY36X3eR8oneUTmrPYaGKCXrowDC796E37v9CD/6f0nds5fR8aP5ZGRH/a+6VPsTfeeWEtE/LiaiR/FsAEYDhN+dCb93+w1+9Hv0f2HhSCER/cTPhYv6X4RAM1esfmslEf1+bXR1TaD7hfr1iorwexPhX5okVo+i30v//9705t5/rn4dLqHTlJOR908PR+6rXX3hy+u/XTkRfm8i/O5VGxs8Q2J1nwzzf0/9Ktya3nLOa2oX9/y6+nHFRPi9ifC7F/o5+rv6kfKLCL83EX4q8CL83kT4qcCL8HsT4acCL8LvTYSfCrwIvzcRfirwIvzeRPipwIvwexPhpwIvwu9NhJ8KvAi/NxF+KvAi/N5E+KnAi/B7E+GnAi/C702Enwq8CL83EX4q8CL83kT4qcDL7/Aj+8v0cPQnqri+kpTvpyjfyWX2iwk/taj8Dj/e0VZIRA9ODUcuVkX2hXKbey8pSrlQvmbl9oMJP7Wo/A6/k9O9lIgeKyVif3rgksh5qugrouc29b5eyvFnUp7ji72bwQ8m/NSi8jv8MABzXuEk0D1ZHI5kVfE7qmIyMinf/xTK4fbVbCtpwk8tqunN0Zv8Dr9uvAPhmMyzy8noPQcv771AVaOten7oDW8sJ6L/89hI4zsY/Gy7XYd6P6aqQVELJVf+j9XGVmNe7fsrmWPntc1yFS6XEpEb9l28+hWqOi3VA2+L/UZpOHKjjDQq+D4vr2NfCaMd0Z5oV175qVNqZnh1TK6iX6jKFc3PK9cnGx0ci232VCAZ/fupzb1Dqkot0dRw77Ac9x9wfHxPUE6MMNqxIu1ZGI58YXrrmqiqEkU11+xwZFM5EXsoqJ29KmWWofkXf7U5ukpVyZOevSK6Wo7zpSCfDNGOU0ORzapKFHV64SWjpUTshqIMpwM5zMUoIBE9WBiOvU9VaUnKDcWukc8/j+MEaRqUF6O90G6lZOQP0Y6qShS1NB1M9F5QTMTuxsLa4QAtcAHWOSmvWg/4/kxi9VtVlRbVzPCqf1FJRr+PV0nh80Ea9WABEiMUmaLcM7vp/I2qShS1POGWmlxNAnNryzFGLOqdcEcLw9E/2XNF7LWqSgv0jPy+JP+Pv8PfB2mkg/ZQ7fJkLhHNqCpRVOt0IBk5T4aSn5J58LHjI8EaBeCtyACkkog+NpvoHVNVslUY7t0pV/t/sqcK6u3JzY7jN+MEhXYoJ6MvlJKxTz/7zujrVJUoqj2Sq8vvlhORH9bkConFtSAOjWeGIt+Y2Ry5fHYoegd+DtI9e8QbcX9RwC9KO+SSkYtU01BU+1W7oedlxWT02nIiNhXERTEAjxVx/Iufg1B2lNFZzETci0PRf3+DtINqEorqrA5tfv364nDsq1gM9POW1mbOC0jNfu9X40SFOMsJ4PbnE2/oV01AUSsrmQpsKSVij9TnzcGaCvjZiKNzz76SjP08NxzZqkJOUf4RXr0sV9Oby4loNUgr5n414odblTLEr8jU5KZHf4evtqZ8rvzm2JuLyci3j0vHxTCVo4ClGfFC3BC/4nDk24inCi1FBUP5odhVMgrYjyFrkJ4NWCkjPs49e7naP50f7r1ShZKigqepTa+L5Iain0Oyi2NyJWvW6em6ER+Z35/IS7yelripEFJUsJXfsuod5WT0x3g2wO9ZbzppxAHxQFxklPRAfvj8y1TIKKp7hE0m+eHof5ROnsNCVtButbXaqL+9oJeMzs4moh/aMzZ4hgoVRXWnnt0UNYvJ6J32k3UBezagVcYzEbDM8e+YGooaKjQUFQ4VEr1jlWT00fqzAd2/IIj6OXsM5Gr/aH5z76gKBUWFT/sTfeeWEtFPBG033VKNejm7C4vJ2H9GvVUIKCrcOhjgffSLGfVAfVCvaiL6Pbd5BSgqdJpN9P4bGRo/h6FxkDYLnWyU29mEI/U5UBqOvFdVkaKoUwm592R4/EVcMbEo2AwuvxvlRvmREPWZ4dUxVTWKotxodiiyWU4CD9v3wAPwbADK52zCKSViDyERqqoKRVFLFfLwF4ajNxZ9nEgU0DuJM+VkVSokIjf8oE3vD6Co0Gk20XuBXFXvxiOwfsu6g/LYj+YmYncd3MLEmRTVFqlEovswtF7JzUL4XmcTjvz7VIGJMymq/aonEo19WubVx4+vwIIgph524sxE7JiU41OPSXlU0SiK6oRyw5GLi4nYjzDX7kQiURy/njgTV/vID0tMnElRK6cbenpeVtYSiWKzTKtPAjgejovj43uKw9Fr8b2qCBRFraScRKJYfGt1IlF7A5Ict5SI3l5g4kyK8qeKiegW8R77Kr2MqQA+59yzl+M9UkxGk+orKIryq/ZuPvus4lD05koiVvGyWcjZhCND/IoM8W96dAsTZ1JUoITEl/nhyH0nRur57t2MAuqJM/Eij8i3p5g4k6KCLSQSrSRPnUgUP+P39QW96P5iIrZbfZSiqKBratOaiFzNb7MTiW5dmEgUP+P3SDR6aOi8XvURiqK6SfmhXiQS/Qnu1QN4/CtX+x8zcSZFhUC4R19I9l5THYk9kRuOvE/9mgqVenr+P+OvTjWo+kMRAAAAAElFTkSuQmCC</data> + <data key="name" unique="suffix">magento_logo_</data> + </entity> + <entity name="downloadableSampleLink_AdobeBase" type="sample_file_content"> + <data key="file_data">/9j/4AAQSkZJRgABAQAASABIAAD/4QCARXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAKgAgAEAAAAAQAAAGSgAwAEAAAAAQAAAGQAAAAA/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/iDFhJQ0NfUFJPRklMRQABAQAADEhMaW5vAhAAAG1udHJSR0IgWFlaIAfOAAIACQAGADEAAGFjc3BNU0ZUAAAAAElFQyBzUkdCAAAAAAAAAAAAAAAAAAD21gABAAAAANMtSFAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEWNwcnQAAAFQAAAAM2Rlc2MAAAGEAAAAbHd0cHQAAAHwAAAAFGJrcHQAAAIEAAAAFHJYWVoAAAIYAAAAFGdYWVoAAAIsAAAAFGJYWVoAAAJAAAAAFGRtbmQAAAJUAAAAcGRtZGQAAALEAAAAiHZ1ZWQAAANMAAAAhnZpZXcAAAPUAAAAJGx1bWkAAAP4AAAAFG1lYXMAAAQMAAAAJHRlY2gAAAQwAAAADHJUUkMAAAQ8AAAIDGdUUkMAAAQ8AAAIDGJUUkMAAAQ8AAAIDHRleHQAAAAAQ29weXJpZ2h0IChjKSAxOTk4IEhld2xldHQtUGFja2FyZCBDb21wYW55AABkZXNjAAAAAAAAABJzUkdCIElFQzYxOTY2LTIuMQAAAAAAAAAAAAAAEnNSR0IgSUVDNjE5NjYtMi4xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYWVogAAAAAAAA81EAAQAAAAEWzFhZWiAAAAAAAAAAAAAAAAAAAAAAWFlaIAAAAAAAAG+iAAA49QAAA5BYWVogAAAAAAAAYpkAALeFAAAY2lhZWiAAAAAAAAAkoAAAD4QAALbPZGVzYwAAAAAAAAAWSUVDIGh0dHA6Ly93d3cuaWVjLmNoAAAAAAAAAAAAAAAWSUVDIGh0dHA6Ly93d3cuaWVjLmNoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRlc2MAAAAAAAAALklFQyA2MTk2Ni0yLjEgRGVmYXVsdCBSR0IgY29sb3VyIHNwYWNlIC0gc1JHQgAAAAAAAAAAAAAALklFQyA2MTk2Ni0yLjEgRGVmYXVsdCBSR0IgY29sb3VyIHNwYWNlIC0gc1JHQgAAAAAAAAAAAAAAAAAAAAAAAAAAAABkZXNjAAAAAAAAACxSZWZlcmVuY2UgVmlld2luZyBDb25kaXRpb24gaW4gSUVDNjE5NjYtMi4xAAAAAAAAAAAAAAAsUmVmZXJlbmNlIFZpZXdpbmcgQ29uZGl0aW9uIGluIElFQzYxOTY2LTIuMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdmlldwAAAAAAE6T+ABRfLgAQzxQAA+3MAAQTCwADXJ4AAAABWFlaIAAAAAAATAlWAFAAAABXH+dtZWFzAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAACjwAAAAJzaWcgAAAAAENSVCBjdXJ2AAAAAAAABAAAAAAFAAoADwAUABkAHgAjACgALQAyADcAOwBAAEUASgBPAFQAWQBeAGMAaABtAHIAdwB8AIEAhgCLAJAAlQCaAJ8ApACpAK4AsgC3ALwAwQDGAMsA0ADVANsA4ADlAOsA8AD2APsBAQEHAQ0BEwEZAR8BJQErATIBOAE+AUUBTAFSAVkBYAFnAW4BdQF8AYMBiwGSAZoBoQGpAbEBuQHBAckB0QHZAeEB6QHyAfoCAwIMAhQCHQImAi8COAJBAksCVAJdAmcCcQJ6AoQCjgKYAqICrAK2AsECywLVAuAC6wL1AwADCwMWAyEDLQM4A0MDTwNaA2YDcgN+A4oDlgOiA64DugPHA9MD4APsA/kEBgQTBCAELQQ7BEgEVQRjBHEEfgSMBJoEqAS2BMQE0wThBPAE/gUNBRwFKwU6BUkFWAVnBXcFhgWWBaYFtQXFBdUF5QX2BgYGFgYnBjcGSAZZBmoGewaMBp0GrwbABtEG4wb1BwcHGQcrBz0HTwdhB3QHhgeZB6wHvwfSB+UH+AgLCB8IMghGCFoIbgiCCJYIqgi+CNII5wj7CRAJJQk6CU8JZAl5CY8JpAm6Cc8J5Qn7ChEKJwo9ClQKagqBCpgKrgrFCtwK8wsLCyILOQtRC2kLgAuYC7ALyAvhC/kMEgwqDEMMXAx1DI4MpwzADNkM8w0NDSYNQA1aDXQNjg2pDcMN3g34DhMOLg5JDmQOfw6bDrYO0g7uDwkPJQ9BD14Peg+WD7MPzw/sEAkQJhBDEGEQfhCbELkQ1xD1ERMRMRFPEW0RjBGqEckR6BIHEiYSRRJkEoQSoxLDEuMTAxMjE0MTYxODE6QTxRPlFAYUJxRJFGoUixStFM4U8BUSFTQVVhV4FZsVvRXgFgMWJhZJFmwWjxayFtYW+hcdF0EXZReJF64X0hf3GBsYQBhlGIoYrxjVGPoZIBlFGWsZkRm3Gd0aBBoqGlEadxqeGsUa7BsUGzsbYxuKG7Ib2hwCHCocUhx7HKMczBz1HR4dRx1wHZkdwx3sHhYeQB5qHpQevh7pHxMfPh9pH5Qfvx/qIBUgQSBsIJggxCDwIRwhSCF1IaEhziH7IiciVSKCIq8i3SMKIzgjZiOUI8Ij8CQfJE0kfCSrJNolCSU4JWgllyXHJfcmJyZXJocmtyboJxgnSSd6J6sn3CgNKD8ocSiiKNQpBik4KWspnSnQKgIqNSpoKpsqzysCKzYraSudK9EsBSw5LG4soizXLQwtQS12Last4S4WLkwugi63Lu4vJC9aL5Evxy/+MDUwbDCkMNsxEjFKMYIxujHyMioyYzKbMtQzDTNGM38zuDPxNCs0ZTSeNNg1EzVNNYc1wjX9Njc2cjauNuk3JDdgN5w31zgUOFA4jDjIOQU5Qjl/Obw5+To2OnQ6sjrvOy07azuqO+g8JzxlPKQ84z0iPWE9oT3gPiA+YD6gPuA/IT9hP6I/4kAjQGRApkDnQSlBakGsQe5CMEJyQrVC90M6Q31DwEQDREdEikTORRJFVUWaRd5GIkZnRqtG8Ec1R3tHwEgFSEtIkUjXSR1JY0mpSfBKN0p9SsRLDEtTS5pL4kwqTHJMuk0CTUpNk03cTiVObk63TwBPSU+TT91QJ1BxULtRBlFQUZtR5lIxUnxSx1MTU19TqlP2VEJUj1TbVShVdVXCVg9WXFapVvdXRFeSV+BYL1h9WMtZGllpWbhaB1pWWqZa9VtFW5Vb5Vw1XIZc1l0nXXhdyV4aXmxevV8PX2Ffs2AFYFdgqmD8YU9homH1YklinGLwY0Njl2PrZEBklGTpZT1lkmXnZj1mkmboZz1nk2fpaD9olmjsaUNpmmnxakhqn2r3a09rp2v/bFdsr20IbWBtuW4SbmtuxG8eb3hv0XArcIZw4HE6cZVx8HJLcqZzAXNdc7h0FHRwdMx1KHWFdeF2Pnabdvh3VnezeBF4bnjMeSp5iXnnekZ6pXsEe2N7wnwhfIF84X1BfaF+AX5ifsJ/I3+Ef+WAR4CogQqBa4HNgjCCkoL0g1eDuoQdhICE44VHhauGDoZyhteHO4efiASIaYjOiTOJmYn+imSKyoswi5aL/IxjjMqNMY2Yjf+OZo7OjzaPnpAGkG6Q1pE/kaiSEZJ6kuOTTZO2lCCUipT0lV+VyZY0lp+XCpd1l+CYTJi4mSSZkJn8mmia1ZtCm6+cHJyJnPedZJ3SnkCerp8dn4uf+qBpoNihR6G2oiailqMGo3aj5qRWpMelOKWpphqmi6b9p26n4KhSqMSpN6mpqhyqj6sCq3Wr6axcrNCtRK24ri2uoa8Wr4uwALB1sOqxYLHWskuywrM4s660JbSctRO1irYBtnm28Ldot+C4WbjRuUq5wro7urW7LrunvCG8m70VvY++Cr6Evv+/er/1wHDA7MFnwePCX8Lbw1jD1MRRxM7FS8XIxkbGw8dBx7/IPci8yTrJuco4yrfLNsu2zDXMtc01zbXONs62zzfPuNA50LrRPNG+0j/SwdNE08bUSdTL1U7V0dZV1tjXXNfg2GTY6Nls2fHadtr724DcBdyK3RDdlt4c3qLfKd+v4DbgveFE4cziU+Lb42Pj6+Rz5PzlhOYN5pbnH+ep6DLovOlG6dDqW+rl63Dr++yG7RHtnO4o7rTvQO/M8Fjw5fFy8f/yjPMZ86f0NPTC9VD13vZt9vv3ivgZ+Kj5OPnH+lf65/t3/Af8mP0p/br+S/7c/23////AABEIAGQAZAMBEQACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/3QAEAA3/2gAMAwEAAhEDEQA/APy/r+Jz/roCgAoAKACgAoAKACgAoAKACgAoAKAP/9D8v6/ic/66AoAKACgAoAKACgAoAKACgAoAKACgD//R/L+v4nP+ugKACgAoAKACgAoAKACgAoAKACgAoA//0vy/r+Jz/roCgB8aGSRIx1d1QZ6AuwUE47Anmmt16ilJRjKT2hGUnbe0U5O22tk7frsfrz+x3/wRu+O37aH7P3g39onwB8V/g74U8LeNrzxTaaboXjPSPHdz4js28KeJtT8K3r382hajDpjrc3+kXVzaC3jDJaSQLPmXezfd5L4c53n2XUczwmZ5Th6GIlWUKWJw2MqV4exqyoy5pUsTCm+acJSjaOkZRTu05H8W+OH04PD/AMCfErPvDDiLgvjfOc34eo5PWxWZZHmXDtDK8Qs5yjB51QWHp5jllfFx9jhsdQo1va1ZJ141ZU/ctCP07/xDj/tU/wDReP2dP/BF8U//AJbV6v8AxCHiT/oc5H/4RZh/82/Lf8fePyX/AIqf+Ef/AEbjxN/8PHB3/wA52uvl+h+YH7cn7EPi39hH4heDvhh4/wDid8M/H/i/xX4OvvHNxpvw7tfENpL4V0GHWotC0ifxHF4j1C8uRJ4nvf7Q/sJbWGGN4dD1eWV2EKhfjOIuHMXwvjcPl+Ox+AxuJxGFljHHAUq9P6tSjV9jTeJVetVaeKl7T6vy8qaw1d/Zsf1p9H7x8yf6Q3DWe8WcPcI8V8M5Jk2eYbh6jjOJsTlmKp5xmVXAVcxxtHLKmVYDB0bZPh44aWZe2lUnGWZZfGnFe0fP8QzSCG3ubgo8otrW5ujDEAZpltYXuJI4VJCvM0cb+VGzJ5sm2MMGcV8/OXJCc+WU+SEp8kFec+VN8sI/am7Wim43el9T98pQVSrRpOUYe2rUaPPO6p03WqQpRnUaTcaUZTj7SSUnCDc+VqMuX97fh7/wQC/aC+KPgTwb8SPBX7Rv7NeueEfHnhfQfF/hrV7LR/iZcW2o6L4h0y11XT7qKa31mSCQSW90oYxOYw6sEyuK/SsH4WZ7j8Jhsbhc9yCrhsXQpYihVhhMdOFSlWpxnCcZLF2alGSd1ddm9Gf508R/tHvDnhTiDPOF898K/FTL864ezbMMlzXA4jNOEqVfCY/LMXVweKoVaVXJoVITp1aMk41Ep/zWa5TsD/wbj/tUgZ/4Xx+zpwCf+QF8Uv66sB+Z/LFdH/EIeJf+h1kf/hHj/wD5qf5feeN/xU98JP8Ao2/idv8A9Dfg/wC//kUP7rO/lf3fxY/aY+A/iP8AZe+P3xQ/Z58X63oPiTxT8K7/AMO2Gs674Xt9StfDuot4n8Mad4rsH0qHWZp9URYLDU4La7F45f7ZHMY8RFFX4POMoxORZhicsxdahiMRhZQjOthoVKdCftKUK0eSFWdSorQqRjLmk3zRbWj5Y/3d4VeIWWeLfhtwj4nZLl+Y5TlPGOHzbEYHLs3r4TEZnhY5NnGJyTExxlXA0cPhJOrisLOtQdClb6vOCnealOXhteWffBQAUAf/0/y/r+Jz/roCgCe1/wCPm3/67w/+jFprdeqM638Gt/15q/8ApuR/dJ/wQU/5RgfAH/sM/GX/ANXH41r+n/Dr/kksu/6+Y3/1MrH/AD9/tFv+Ut/Ev/sD4G/9YTh4/YDUtQstJ0++1TUrmKy07TbO61DULyd/LgtLGyge5u7md+iQwW8UkkjkgKqk5GBX205xpwlUnJRhCMpzk9FGMVeUm+iSTbP4mw2Hr4vEUMLhaU62JxNalh8PRpxcqlavXqRp0aVOK1c51JKMY63btZ7H+b3+2t+0je/ta/tP/GD49TT3Mmi+M/FMtn4Dtrh7ojT/AIXeEvP8P/Dq2iguY4GthqGjxXXi6eL7NFIl94uvLeZpvsscr/x/n+bTz7PMzziUrwxdfkwaUuaMMtwvNSwCi03F+1pueMlaMZRni5U5c3soyP8AqD8BvC2h4M+EvBPh1GlShmOR5TDEcSVacaN8TxhnipZnxTUnVoyqKs8JjHhsgpz9tOLw+QUa0I0vrE4R+Wkd43SSNikkbpJG45KSRsHRgOhKsobB4OMGvJTtr1Wp+uuMZxlCa5oTjKE47c0JpxnG+65otq61V7o/su/4N9P2nk+I/wCzh4r/AGatev5JfE/7OGs27+FYbmW8mnufg549mvtU8KJDNcoyyw+Etft/EngwolxPLBZaTpM9yYhqECV/QHhLnH1nJcRklaadbJa1sKnPmnLK8U5VMLo7yjHDVViMFHmlKU44eNRv31GP+HH7SPwnlwt4o5R4p5fh4QynxTwNV5vOjDD06dLjrhyGHweeynSoyi6c87y+tlPEXNLD0YVMRmWMo0VN4StM/oGf7jf7rfyr9YP84FuvVH+fB/wV3/5Sdftjf9jD8I//AFTXhSv5c8Qf+Sszf/r7hv8A1CoH/Sd9C7/lEzwN/wCxZx1/632bn50V8Uf0yFABQB//1Py/r+Jz/roCgCe1/wCPm3/67w/+jFprdeqM638Gt/15q/8ApuR/dJ/wQU/5RgfAH/sM/GX/ANXH41r+n/Dr/kksu/6+Y3/1MrH/AD9/tFv+Ut/Ev/sD4G/9YTh4qf8ABcj9pyb4CfsW6/4E8OasdM+IX7R+pf8ACovD81uzC+03wld2sup/FLxFbeTfWM8Mmm+B7TU7GyuUmzHq+qaYqRzySpby8HihnTyvhqpg6FR08ZnlaOWUXB8tSGHmnUzGtTfPT5J0sDCv7KfN7taVO0ZycYSf0AfCin4jeO+W5/muDWL4Z8L8L/rvmdOql9XxmcYevSwnCGVVufDYmlUp43iTEYCpiqM6bU8vw2Mc5U4RnVpfwvSPBFHJKVjs7O1t5JSkaMYbGwsrdpGWOOFGcwWNnAdqRIz+VDhEJwrfzb7kI6KNOnThsrRhTp04/JKEIR7WUV0P+gmMalScIc0sRXrVoU1OcoxqYnFYmtGCc5zcYqrisTVV5TkoqpVvOVryPevjt+zb8V/2cZPhLF8U9EbR5vjL8FvCPxw8LRLZ6hbmz0HxTNLb3PhrV2vIhGnivwpOdLi8R2yNB5Ta/pfl2cQZy3q5plOMyl5fHGUpUpZjlmHzOhGaSkqVdtToztJtV8M3TWIik4Q9tS5akudo/OvDzxS4N8UYcaVOD8esbT4G49zrw/zabxOErLE4/KKcK1DOMDHDvmeS55SjjqmU1ZRnzLK8ap4mpJQR9G/8EvP2m3/ZV/bU+EHjzUb77F4E8X6kvwe+KW//AI9z4L+Il7aadpOr3Gby1jB8JePh4Z1NJ5Y7s2umaj4gZIoo5JrhPR4Ozn+weJsrx0pcmFxNVZVmLekfquOko0KkvejeWHx/1Zwm1NU6VbFe6lOU4/l/0tvCleL/AID8bcP4bDvEcQ5FhXxzwgo/xP7d4Xw9bE5hgqdsPWm1nXC/9sYeVKFTDqvjcBlKlUnKNKjL/QuDB4iysHBQkOpBVgVyrKVJBDAhhgkYPU9a/rM/5rLWlZppqWqe8XfVNbpp6a6/gf58X/BXf/lJ1+2N/wBjD8I//VNeFK/lzxB/5KzN/wDr7hv/AFCoH/Sb9C7/AJRM8Df+xZx1/wCt9m5+dFfFH9MhQAUAf//V/L+v4nP+ugKAJ7X/AI+bf/rvD/6MWmt16ozrfwa3/Xmr/wCm5H90f/BBU4/4Jf8AwBPf+2fjJj3J+MfjUAfiePbvX9P+HX/JJZd/18xv/qZWP+fz9otr9LjxL/7A+Bvu/wBROHvXp5fefzkf8Fqf2oI/2jP22fF2gaBqq6h8Pv2dtPn+Cnhf7NPa3Fjc+LYb221n4u6zBJbozM7eIodC8IyF5yY5/Bl7AIotshl/F/EPO1nXE+JhScZYPJYyyrDTTup4nnhVzScbe44KvDD4W799VsHWg7KKcv8ATj6CHhLLwx8BcmzPMsG8LxL4n4qnx7mqq0q9LEUsjlQrZfwPgakKrhFR/s2rm2e03Gk1Ohn+Erc8uaCh8x/8E8f2Zj+1t+198Hfg1fWP27wbcavL4++KKulvLbp8Lvh3cadq/iGxu4rgsrweK9ZuPDfg2WMwSrPYa7qcBKFlavF4YyX/AFhz/LMqlrh6lSWMzGLimpZbgZU6lem7+644ivPC4SrGSkp0cRVjZWUo/q/0mPFb/iDHgpxvxzhsQ8PntPB0+GuEJQlWp1v9cOKaWMwWWYqhUoq8KuSZbQznPqc+eEqeMy/A1FzKMoy/qK/4L0fsu2vxV/Y/t/jX4c0WKXxh+yvezeMAtla2aXc3wh1eC20b4m6LC7mJltNK0mLTvGMNrHNFEt94TsZju8kI37V4qZJHG8PwzajGMcRw/N4qUuXfLKkVTzKk+VObhCioYuMI6e2wlKTUlHll/kp+zv8AFqtwf42y4DzLHzhkfjBQp5C/b1a7oUuNsHVqY7g/MJwp+0TrYrMZ4jIqladOc/qee4ymnD2nNH+KCa3hcXNldktbXENzY3bREZa2uoZLa4aE/ONxhkdoWG7B2Mp4DL/O04QqRnTmr06kZU5rXWE04yWlmrxbV07rdW0P946VWcXRxFD3atKpRxNBVE7RrUKkK9GNRe67KrCMakb6rmi7rm5v9Ar/AIJOftSv+1Z+xR8MvE2vatHqnxL+HdrJ8H/iyxntZLt/G/gK2ttPOs3cVqkSwf8ACXaC2j+LbXdBB5trrEUqxIrqi/1NwFnss/4awVevKLx+Dvl2ZRTV44vCKMHO13JRxNF0sVSc+WUqNenPlXMkf83n0xPCKPg948cWZRl2CnhOFOJK0ONuCl7OtCiuHOJKlXFU8DRnWc5VXkePWNyLENVa3JicuqwdWcouR/IV/wAFd/8AlJ1+2N/2MPwj/wDVNeFK/D/EH/krM3/6+4b/ANQqB/tV9C7/AJRM8Df+xZx1/wCt9m5+dFfFH9MhQAUAf//W/L+v4nP+ugKAJ7X/AI+bf/rvD/6MWmt16ozrfwa3/Xmr/wCm5H9cf7BX7TFl+yJ/wQO0P46ShJtc8OWvxm0jwHpjedv1v4keLPjT4x8OeA9JT7PDcSqlz4i1Kyku5xC8dpYQ3V7PsgtpJF/f8jzlZB4aPNEoSrUKePhhKU5qmq2NrY2tSwdFTekfaV5wjd3stUnsf4y/SP8ACrEeNP7RrNPD2nKVLA5tiOBMXxDjF7O2X8LZPwBkWa8R49+1q0acpYfKcJiXRpOrCeIxDpYelz1asIH8j17c315d3V5qWo3Gsapd3V3fapq93JJJdaxrGpXlzqetaxcvNJLJ5+s6ze6hqs6s7CKW9aJMRRotfz7FTS/eVHVqylOpWqu961erOVWvWd3Jp1q051XFPli5OMbRUVH/AGZw9LD0KNGhhMLSwGDo0aGHweAoxhCll+BwmHpYPLsvpRpwpx9nl2XYfC4CElFOpDDKrO85ycv6Sf8Aghf8Vv2Mf2ZfA3xf+Lvx4/aQ+CHw7+LnxJ8RweBtB8K+LfH2laT4n8PfC3wIzvbXF/pepRWNzpreN/Fmoa34ltwDdrd6B/wjsgu5Ujhjt/1vwzzPhbI6OZ5jmue5Xgsyx1aOEhhsZi6GHxOGwOCuoKVOc4yUcViKtfF05tN1KFSg/hUD/Lj9oJwd46eK3EXBPBfh54V+IfFHBfCuU1OIMwzjJeF8wx+UZnxhxIofWKeFx2CljKOLjw/kmFyvJazf1d0c0pZtB4eE51JT/p78DfEz4G/tT/DLWtV+G3jjwX8Yfhf4kj1/wVrGreE9YsfEPh7UBLaGw1/RZru1ae3aaO1vdlzAwZgkqkjDAr+24THZXnuCqVcDi8LmWArqrhp1cNVhXoT93kq0+eEpxbSlaSv11P8AJziDhXj7wl4pweB4q4fz7gni3K5ZfneEwOdYDFZVmmFcayxOXY6FCvCnWjCVWipUqiUbuL25fe/zsv2p/gBrX7LX7Qvxc+AOtRyj/hWPjLUNF8PXUzSO2r/D6/8A+Jz8M9cSWWzsfPF94KvNM0+7mjjnQ67omuQm7uZYJZX/AJIzbKp5FmuYZLPmvl2JlSouStz4Gp+9y+pHROcfqkqdGVS3vV6FePNOUJyP+mjwi8SMF4veGnBfiRgZQvxZkeHx+aUYckVguJ8M/qHF+AlThXxDpOhxDRxWNoU5ypyWWZpllRYehTqwpw/WL/ggV+1D/wAKl/am1j4A+INQkh8H/tMaGbTRI5pLtrOy+L/w+0y61HQGVFWW3tpPFvgSHWNFeV2tYpLrwho1uPPvNRRK+78Lc5ll/EFbLKk0sLnlH92pSso5pg4XpcsXdylisFGpCXLyqH1KDd3O5/HP7Rnwl/1y8JMD4kZbhoTzrwpx/tMxlCOHhXxHBHE+NpYbME5PkrVlkfE1XB46EIxxM1R4jx1T91hsFJx+NP8Agrv/AMpOv2xv+xh+Ef8A6prwp/n/APVXleIP/JWZv/19w3/qFQP3T6F3/KJngb/2LOOv/W+zc/Oivij+mQoAKAP/1/y/r+Jz/roCgCa3ZUngZjhVmiZieyhwWPGTwATwOfemt16oiqnKlVjFXlKlUjFd5ShJJfNtLyPtP4lftIJqv7Bf7FP7I/h/WUurX4ZXnxg+LXxZsrbztkXj7xX8QNZuPhn4YvybgRGTwl4V8Sa3rk1vJbzH+1P7Dvt9u4gD+9j82rYjhvhjJJTvHCSzPNcwguW0cZWxtT+zcJPltCrHB4evWm5xi+avRoV3KE0lP8L4X8L5YT6Rvj7405ll86FTiulwTwVwViK3s71eG8n4ZwNDi7OcLH2POo51m+TZfltKtCpBfUq2aYbkrJ1XD4mrwD93JUnmjXbHIyLkkhTjJPc8DJwPU8cccU7vbp/X4+f3ESp05vmlCMpWSvLVpLZLXS2+il6aWl/Qr/wQD/a98NfCD4o/GD4B/EzxZovhPwR8VtFtvil4Y1zxPqukaFoWn/EfwZBpnhjxPplxqepXdnHFdeLfB0nhvULBGD/a7nwzri+dvSCKv1Lwrz2llmZZlleMrQoYTM6UcwoVq06dKjTx2EhRwuIpSqT5IqWJwqw06MfelOWGxN5e7CJ/mr+0d8F804z4S4I8SOFsox2bZ5wdjqvB2bYDK8JjsxzDEcL57Wxuc5Ni6eFwtCtejkuexznCYqanH2NLNsqtStOpVOs/4OAfB3wa8ca78G/2n/hP8Svhr4u1qW3n+C3xR0nwj4x0HX9YnsXefxD8NPFNzY6Vq9zM9to+prrvhW7u2sX8iLxXZyy3MFpZXDNv4q4fAYjEZZnuX4vCYipKM8qzCnhq9KtVcJXr4HFSjSlOTp4eoq+Hm+S0Y4z2kp06dKo5eJ+zf4g41yHBcc+EnF/DHE+T4FTp8e8J4zOMlx+AwVLE0o08r4tyilXxeCpwVXMMDPL85pUliqftJ5DVpU6VfE4mjy/zs+E/GPiX4e+J/Dfj/wAF3jaf4y8B6/o/jjwffKHza+KfCd7FrWiBwk9rI1rf3Np/Y2pRi5gE2lanfQSSCOVxX5MqtfDTpYrCvlxmCq08Zg5bNYrCy9rRi3eNoVZL2FZKUOehVq03NRk3H/TfOMjyribKc14Zz6j9ZyLiPLcdw7nuH929XJ87oSy/MJQc6VaMa+EpVlmODqOlUdLHYHC1YU5ThE+nf2+fjD4V/aF/bF+NPx38EX0V94Y+K9l8I/EVmke/fo+qaf8AC7QvDninw1dBySt9oXiLSL6O6Rtrxm6SF1LROa93ijMo5txBmWY0Zc+FxiwGIoO0U6UvqFGjiMLJJKTlRr0ZTc53v7b2cdKVz8n+jlwVnXhr4G8A+HfEOEqYTN+DMRxxleJ53Fxx2FxvGGNzjKM3oOKSeGzHLMbRdCcXKFRYd1I2jOKPkKvBP2kKACgD/9D8v6/ic/66AoAKAFyeBk4HT278enPP+TQH66vz/pf1sJQAUAMkihmQx3FvbXUTEFoby1tr23YqcqWt7uKaB2U8ozRlkPKYJJWZwhUi4VIQqQlvCpCM4uzTV4yTi7NJq+zV001eN06lSlJTpVa1GaulUoV62HqpPdRq4epSqxUlpJKaUlo7pWjDFZWEDiS30zSbSUBgJrLSNLsZwrDay+fZWcExRhwyF9jdwcfLEMPh6T5qVChSk005UqNKnJxbTs5QhFtXSdtVdJtRtFS0nisXVjyVsZj68Lp+zxOYY7FU7p3T9licVWpqSdnGahzR6NXfNZrUwFJJ6kk8Dk54HQd+g4H9OlAf194lABQAUAf/0fy/r+Jz/roCgAoAKACgAoAKACgAoAKACgAoAKAP/9L8v6/ic/66AoAKACgAoAKACgAoAKACgAoAKACgD//T/L+v4nP+ugKACgAoAKACgAoAKACgAoAKACgAoA//2Q==</data> + <data key="name" unique="suffix">adobe_base_</data> + </entity> + <entity name="downloadableSampleLink_TestImage" type="sample_file_content"> + <data key="file_data">/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDIBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAGAAYAMBIgACEQEDEQH/xACXAAEBAAMBAQEBAAAAAAAAAAAABgMEBQgCAQcQAAEDAQUFBgQDCQAAAAAAAAABAgMEBQYRFpESMTZV0QchcnOzwhMUIkEygaE1QlFSYXGCsbIBAAEFAQAAAAAAAAAAAAAAAAACAwQGBwERAAECAwMLBAMBAAAAAAAAAAEAAgMEERMhkRQxMzRBUVJTcXKxBRJhoSKBwUL/2gAMAwEAAhEDEQA/AP7+AYKysp7Po5aurlbFBEmL3u3NQ6ASaBdArcFnBN5/urzqn0d0Gf7q86p9HdCRkUzy3YFOWEXhOCpATef7q86p9HdBn+6vOqfR3QMimeW7AosIvCcFSAm8/wB1edU+jugz/dXnVPo7oGRTPLdgUWEXhOCpATef7q86p9HdBn+6vOqfR3QMimeW7AosIvCcFSA1bPtGktWiZWUM7Z6d6qjZG7lwXBf1Q2iO5paaOFCmyCDQoTd/uBLX8n3IUhN3+4EtfyfchIk9Zh9w8pyBpW9QvN4Bwbcsujis+pq2Q4Tq5HbW0u9XJj3Y4fc0ibjPgQjEY0GgJNTS4brj/FaIz3Q2FwFafNP4V3gc1aWz7FY+rjhVrsNjBrlcrsV3Iir/ABPxtqzRyM+boJKeJ7kakm2jkRV3Yom4TlbYf4xrnfFSBuqaCn7ouWwbc+4/FT90XTBz57RlbVvpqWjdUSRoiyfWjUbju71MUlqSyWdVPjpnsqIUVJI3ORFZ3fix+4OnoLSRU3V2HZnANKEjcEGOwVG74OxdUGjZM1RNQROqIlYuw3Zcr9pXpgn1f0xN4kQYgiww8bU4xwe0OG1eg+y7gCg8cvqOLEjuy7gCg8cvqOLEzT1HXIvcfKq0zpn9ShN3+4EtfyfchSE3f7gS1/J9yCJPWYfcPKTA0reoXm85l4P2HUf4/wDSHTPmSOOZiskY17F3tcmKKaXMwjGgvhj/AECMQrTFZ72ObvC5lvxq+gjeivRsUzXvVn4kb34qmpozxWc+NjVtWtqPiOREjbMj1Vf7YFHvMMdLTxP244ImP/maxEUhzMhaxC8UvABrXZuoR9pmLL+9xddfvXNrfkVtJyPqJaOpRiL8VHbKPT8+5THFVS1FnWnE+VKhsUbmsmamG3i1e78jsSwQzoiTRRyIm5HtRf8AZ9MjZGxGMY1rU/damCHTJPMQuDgAa5q31G0VpdnrnuRYO9xNaA1+/r9rUsmeGazqdscrHuZExHo1cVauH30U3THFBDBtfBijj2t+w1Ex0MhMgMcyG1r843J+GC1oDs69B9l3AFB45fUcWJHdl3AFB45fUcWJm3qOuRe4+VV5nTP6lCbv9wJa/k+5CkJu/wBwJa/k+5BEnrMPuHlJgaVvULzeADUlbUAAIQAAhAACF6D7LuAKDxy+o4sSO7LuAKDxy+o4sTMPUdci9x8qqTOmf1KE3f7gS1/J9yFITd/uBLX8n3IIk9Zh9w8pMDSt6hebwAakragABCAAEIAAQvQfZdwBQeOX1HFiR3ZdwBQeOX1HFiZh6jrkXuPlVSZ0z+pQwVlHT2hRy0lXE2WCVMHsduchnBEBINQmQaXhTeQLq8lp9XdRkC6vJafV3UpASMtmeY7Epy3i8RxU3kC6vJafV3UZAuryWn1d1KQBlszzHYlFvF4jipvIF1eS0+ruoyBdXktPq7qUgDLZnmOxKLeLxHFTeQLq8lp9XdRkC6vJafV3UpAGWzPMdiUW8XiOK1bPs6ksqiZR0MDYKdiqrY27kxXFf1U2gCO5xcauNSmySTUr/9k=</data> + <data key="name" unique="suffix">test_image_</data> + </entity> + + <!-- Other --> + <entity name="downloadableData" type="downloadable_data"> + <data key="link_title">Downloadable Links</data> + <data key="sample_title">Downloadable Samples</data> </entity> </entities> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Section/AdminProductDownloadableSection.xml b/app/code/Magento/Downloadable/Test/Mftf/Section/AdminProductDownloadableSection.xml index 074ed5578110..fc21578f6c5e 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Section/AdminProductDownloadableSection.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Section/AdminProductDownloadableSection.xml @@ -31,7 +31,9 @@ <element name="addLinkFileUrlInput" type="input" selector="input[name='downloadable[link][{{var1}}][link_url]']" parameterized="true" /> <element name="addLinkSampleUploadFile" type="file" selector="div[data-index='container_links'] tr[data-repeat-index='{{var1}}'] fieldset[data-index='container_sample'] input[type='file']" parameterized="true" /> <element name="addLinkSampleUrlInput" type="input" selector="input[name='downloadable[link][{{var1}}][sample][url]']" parameterized="true" /> - + <element name="linkFileNameOrUrl" type="text" parameterized="true" selector="//div[@data-index='container_links']//tr[@data-repeat-index='{{index}}']//fieldset[@data-index='container_file']//div[@class='file-uploader-filename']//a|//input[@name='downloadable[link][{{index}}][link_url]']"/> + <element name="linkSampleFileNameOrUrl" type="text" parameterized="true" selector="//div[@data-index='container_links']//tr[@data-repeat-index='{{index}}']//fieldset[@data-index='container_sample']//div[@class='file-uploader-filename']//a|//input[@name='downloadable[link][{{index}}][sample][url]']"/> + <element name="samplesTitleInput" type="input" selector="input[name='product[samples_title]']"/> <element name="samplesAddLinkButton" type="button" selector="div[data-index='container_samples'] button[data-action='add_new_row']" /> @@ -41,5 +43,6 @@ <element name="addSampleRemoveRowButton" type="button" selector="div[data-index='container_links'] tr[data-repeat-index='{{var1}}'] button[data-action='remove_row']" parameterized="true" /> <element name="addSampleFileUploadFile" type="file" selector="div[data-index='container_samples'] tr[data-repeat-index='{{var1}}'] input[type='file']" parameterized="true" /> <element name="addSampleFileUrlInput" type="input" selector="input[name='downloadable[sample][{{var1}}][sample_url]']" parameterized="true" /> + <element name="sampleFileNameOrUrl" type="text" parameterized="true" selector="//div[@data-index='sample']//tr[@data-repeat-index='{{index}}']//fieldset[@data-index='container_sample']//div[@class='file-uploader-filename']//a|//input[@name='downloadable[sample][{{index}}][sample_url]']"/> </section> </sections> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontCustomerDownloadableProductsSection.xml b/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontCustomerDownloadableProductsSection.xml index 5d340e6c9106..07968d5581e6 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontCustomerDownloadableProductsSection.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontCustomerDownloadableProductsSection.xml @@ -11,5 +11,6 @@ <section name="StorefrontCustomerDownloadableProductsSection"> <element name="productName" type="text" selector="//table[@id='my-downloadable-products-table']//strong[contains(@class, 'product-name') and normalize-space(.)='{{productName}}']" parameterized="true"/> <element name="downloadableLink" type="button" selector="//table[@id='my-downloadable-products-table']//a[contains(@class, 'download')]"/> + <element name="downloadableLinkByOrderNumber" type="button" parameterized="true" selector="//table[@id='my-downloadable-products-table']//td[@data-th='Order #']//a[contains(.,'{{orderNumber}}')]/ancestor::tr//a[contains(@class, 'download')]"/> </section> </sections> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontDownloadableLinkSection.xml b/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontDownloadableLinkSection.xml index 6364600faee3..e900ffe2f50a 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontDownloadableLinkSection.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontDownloadableLinkSection.xml @@ -11,5 +11,8 @@ <section name="StorefrontDownloadableLinkSection"> <element name="downloadedImage" type="text" selector="//img[contains(@style, '-webkit-user-select')]"/> <element name="downloadedSvg" type="text" selector="//*[@id='{{id}}']" parameterized="true"/> + <element name="downloadableLinkTitle" type="text" parameterized="true" selector="//*[name()='title'][contains(.,'{{title}}')]"/> + <element name="downloadableLinkImage" type="text" selector="body>img"/> + <element name="downloadableLinkSvg" type="text" selector="svg"/> </section> </sections> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontDownloadableProductSection.xml b/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontDownloadableProductSection.xml index dc2a58be138e..7a23822dc27a 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontDownloadableProductSection.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontDownloadableProductSection.xml @@ -13,8 +13,10 @@ <element name="downloadableLinkLabel" type="text" selector="//label[contains(., '{{title}}')]" parameterized="true" timeout="30"/> <element name="downloadableLinkByTitle" type="input" selector="//*[@id='downloadable-links-list']/*[contains(.,'{{title}}')]//input" parameterized="true" timeout="30"/> <element name="downloadableLinkSampleByTitle" type="text" selector="//label[contains(., '{{title}}')]/a[contains(@class, 'sample link')]" parameterized="true"/> - <element name="downloadableSampleLabel" type="text" selector="//a[contains(.,normalize-space('{{title}}'))]" parameterized="true" timeout="30"/> + <element name="downloadableSampleLabel" type="text" selector="//dl[contains(@class,'samples')]//a[contains(.,normalize-space('{{title}}'))]" parameterized="true" timeout="30"/> <element name="downloadableLinkSelectAllCheckbox" type="checkbox" selector="#links_all" /> <element name="downloadableLinkSelectAllLabel" type="text" selector="label[for='links_all']" /> + <element name="downloadableLinksListSection" type="text" selector="#downloadable-links-list" timeout="30"/> + <element name="downloadableSamplesListSection" type="text" selector=".items.samples" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml index 44cc15272ff6..e1007477d60d 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml @@ -61,7 +61,7 @@ <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml index 650cfd5ba819..74f30eac78b7 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml @@ -57,7 +57,7 @@ <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> - <argument name="productUrl" value="{{DownloadableProduct.name}}"/> + <argument name="productUrl" value="{{DownloadableProduct.urlKey}}"/> </actionGroup> <!-- Assert product design settings "layout 1 column" --> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml index 7685017adc42..d5c317d7f7ed 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml @@ -90,7 +90,7 @@ <magentoCLI stepKey="runCronIndex" command="cron:run --group=index"/> <!-- Go to storefront category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <!-- Assert product in storefront category page --> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml index 43f2f07b83cd..b2878cfd3f86 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml @@ -24,9 +24,7 @@ <!-- Create category --> <createData entity="SimpleSubCategory" stepKey="createCategory"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value="full_page"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Login as admin --> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> @@ -77,9 +75,7 @@ <!-- Save product --> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Find downloadable product in grid --> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPage"/> @@ -94,7 +90,7 @@ <seeElement selector="{{AdminProductDownloadableSection.addLinkTitleInput('1')}}" stepKey="seeSecondLinkTitle"/> <!-- Go to storefront category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <!-- Assert product in storefront category page --> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml index 34b9701f2dca..00757c3b76de 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml @@ -14,7 +14,7 @@ <title value="Create Downloadable Product with invalid domain link url"/> <description value="Admin should not be able to create downloadable product with invalid domain link url"/> <severity value="CRITICAL"/> - <testCaseId value="MC-18282"/> + <testCaseId value="MC-28757"/> <useCaseId value="MC-17700"/> <group value="Downloadable"/> </annotations> @@ -40,6 +40,7 @@ <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductAfterAddingDomainToAllowlist" after="addDownloadableProductLinkAgain" /> <scrollTo selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" stepKey="scrollToLinks"/> <click selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" stepKey="selectProductLink"/> + <scrollTo selector="{{StorefrontProductInfoMainSection.AddToCart}}" before="addProductToCart" stepKey="scrollToAddToCart"/> <see selector="{{CheckoutCartProductSection.ProductPriceByName(DownloadableProduct.name)}}" userInput="$52.99" stepKey="assertProductPriceInCart"/> </test> </tests> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml index e7e00d2fb81e..72dc6196ed56 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml @@ -71,7 +71,7 @@ <magentoCron stepKey="runIndexCronJobs" groups="index"/> <!-- Assert product in storefront category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <actionGroup ref="StorefrontCheckProductPriceInCategoryActionGroup" stepKey="StorefrontCheckCategorySimpleProduct"> <argument name="product" value="DownloadableProduct"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml index e04b53ff208a..6e7a1a65572a 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml @@ -41,7 +41,7 @@ </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!--Verify product on Product Page --> - <amOnPage url="{{StorefrontProductPage.url($$createDownloadableProduct.name$$)}}" stepKey="amOnDownloadableProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createDownloadableProduct.custom_attributes[url_key]$$)}}" stepKey="amOnDownloadableProductPage"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> @@ -51,7 +51,7 @@ <dontSee userInput="$$createDownloadableProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/> <see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/> <!-- Go to the category page that we created in the before block --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <!-- Should not see the product --> <dontSee userInput="$$createDownloadableProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/> <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableProductSetEditContentTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableProductSetEditContentTest.xml index 44c27c17adcd..1baca344d3e3 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableProductSetEditContentTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableProductSetEditContentTest.xml @@ -35,6 +35,6 @@ </actionGroup> <!--Checking content storefront--> - <amOnPage url="{{DownloadableProduct.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{DownloadableProduct.urlKey}}.html" stepKey="goToStorefront"/> </test> </tests> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableSetEditRelatedProductsTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableSetEditRelatedProductsTest.xml index 27d505e070f5..a4a03fc4baa0 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableSetEditRelatedProductsTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableSetEditRelatedProductsTest.xml @@ -37,6 +37,6 @@ <magentoCLI command="cron:run --group=index" stepKey="runCronIndexer"/> <!--See related product in storefront--> - <amOnPage url="{{DownloadableProduct.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{DownloadableProduct.urlKey}}.html" stepKey="goToStorefront"/> </test> </tests> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToDownloadableProductTest.xml index 0237eca61b78..b0ee5074e0a7 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToDownloadableProductTest.xml @@ -66,7 +66,7 @@ <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearDownloadableProductFilters"/> <!--Assert downloadable product on storefront--> <comment userInput="Assert downloadable product on storefront" stepKey="commentAssertDownloadableProductOnStorefront"/> - <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="openDownloadableProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="openDownloadableProductPage"/> <waitForPageLoad stepKey="waitForStorefrontDownloadableProductPageLoad"/> <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertDownloadableProductInStock"/> <scrollTo selector="{{StorefrontDownloadableProductSection.downloadableLinkBlock}}" stepKey="scrollToLinksInStorefront"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/NewProductsListWidgetDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/NewProductsListWidgetDownloadableProductTest.xml index 353554d0110a..3490fb75fbca 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/NewProductsListWidgetDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/NewProductsListWidgetDownloadableProductTest.xml @@ -36,12 +36,17 @@ <actionGroup ref="AdminClickAddProductToggleAndSelectProductTypeActionGroup" stepKey="clickAddDownloadableProduct"> <argument name="productType" value="downloadable"/> </actionGroup> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{_defaultProduct.sku}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{_defaultProduct.price}}" stepKey="fillProductPrice"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="fillProductQuantity"/> - <fillField selector="{{AdminProductFormSection.setProductAsNewFrom}}" userInput="01/1/2000" stepKey="fillProductNewFrom"/> - <fillField selector="{{AdminProductFormSection.setProductAsNewTo}}" userInput="01/1/2099" stepKey="fillProductNewTo"/> + <actionGroup ref="FillMainDownloadableProductFormActionGroup" stepKey="fillProductName"> + <argument name="product" value="_defaultProduct"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductSku"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductPrice"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductQuantity"/> + <actionGroup ref="AdminSetProductAsNewDateActionGroup" stepKey="fillProductNewFrom"> + <argument name="fromDate" value="01/1/2000"/> + <argument name="toDate" value="01/1/2099"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductNewTo"/> <click selector="{{AdminProductDownloadableSection.sectionHeader}}" stepKey="openDownloadableSection"/> <checkOption selector="{{AdminProductDownloadableSection.isDownloadableProduct}}" stepKey="checkIsDownloadable"/> <fillField userInput="This Is A Title" selector="{{AdminProductDownloadableSection.linksTitleInput}}" stepKey="fillDownloadableLinkTitle"/> @@ -55,9 +60,12 @@ <!-- If PageCache is enabled, Cache clearing happens here, via merge --> <!-- Check for product on the CMS page with the New Products widget --> - - <amOnPage url="{{_newDefaultCmsPage.identifier}}" stepKey="amOnCmsPage"/> - <waitForPageLoad stepKey="waitForCmsPage"/> - <see selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" userInput="{{_defaultProduct.name}}" stepKey="seeProductName"/> + <actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="amOnCmsPage"> + <argument name="identifier" value="{{_newDefaultCmsPage.identifier}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCmsPage"/> + <actionGroup ref="AssertStorefrontProductIsShownOnCmsPageActionGroup" stepKey="seeProductName"> + <argument name="cmsTitle" value="{{_newDefaultCmsPage.title}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml index 0d37c353052e..3a1eb63a96ae 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml @@ -70,8 +70,8 @@ <comment userInput="Adding the comment to replace waitForProceedToCheckout action for preserving Backward Compatibility" stepKey="waitForProceedToCheckout"/> <waitForElementVisible selector="{{CheckoutShippingSection.shipHereButton(UK_Not_Default_Address.street[0])}}" stepKey="waitForShipHereVisible"/> <click selector="{{CheckoutShippingSection.shipHereButton(UK_Not_Default_Address.street[0])}}" stepKey="clickShipHere"/> - <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> - <waitForPageLoad stepKey="waitForShipmentPageLoad"/> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForShipmentPageLoad"/> <checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution"/> <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAdvanceCatalogSearchDownloadableBySkuWithHyphenTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAdvanceCatalogSearchDownloadableBySkuWithHyphenTest.xml index 5f7e9970c27e..3e23c5f32660 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAdvanceCatalogSearchDownloadableBySkuWithHyphenTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAdvanceCatalogSearchDownloadableBySkuWithHyphenTest.xml @@ -15,12 +15,9 @@ <title value="Guest customer should be able to advance search Downloadable product with product sku that contains hyphen"/> <description value="Guest customer should be able to advance search Downloadable product with product that contains hyphen"/> <severity value="MAJOR"/> - <testCaseId value="MC-252"/> + <testCaseId value="MC-28818"/> <group value="Downloadable"/> <group value="SearchEngineElasticsearch"/> - <skip> - <issueId value="MC-34217"/> - </skip> </annotations> <before> <magentoCLI command="downloadable:domains:add example.com static.magento.com" before="product" stepKey="addDownloadableDomain"/> @@ -36,4 +33,4 @@ <magentoCLI command="downloadable:domains:remove example.com static.magento.com" stepKey="removeDownloadableDomain"/> </after> </test> - </tests> + </tests> \ No newline at end of file diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontVerifySecureURLRedirectDownloadableTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontVerifySecureURLRedirectDownloadableTest.xml index 5f89db581a7c..4ba8ef1b7fe2 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontVerifySecureURLRedirectDownloadableTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontVerifySecureURLRedirectDownloadableTest.xml @@ -28,15 +28,11 @@ <executeJS function="return window.location.host" stepKey="hostname"/> <magentoCLI command="config:set web/secure/base_url https://{$hostname}/" stepKey="setSecureBaseURL"/> <magentoCLI command="config:set web/secure/use_in_frontend 1" stepKey="useSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set web/secure/use_in_frontend 0" stepKey="dontUseSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> </after> <executeJS function="return window.location.host" stepKey="hostname"/> diff --git a/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/DownloadableTest.php b/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/DownloadableTest.php index c8c363536a2f..268339b93749 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/DownloadableTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/DownloadableTest.php @@ -13,6 +13,7 @@ use Magento\Downloadable\Model\Link\PurchasedFactory; use Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\Collection; use Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory; +use Magento\Framework\DataObject; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Sales\Model\Order\Item; use PHPUnit\Framework\MockObject\MockObject; @@ -55,22 +56,29 @@ protected function setUp(): void ->setMethods(['create']) ->getMock(); + $purchasedLink = new \Magento\Downloadable\Model\Sales\Order\Link\Purchased( + $this->purchasedFactory, + $this->itemsFactory + ); + $this->block = $objectManager->getObject( Downloadable::class, [ 'context' => $contextMock, - 'purchasedFactory' => $this->purchasedFactory, - 'itemsFactory' => $this->itemsFactory + 'purchasedLink' => $purchasedLink ] ); } public function testGetLinks() { - $item = $this->getMockBuilder(Item::class) + $orderItem = $item = $this->getMockBuilder(Item::class) ->disableOriginalConstructor() - ->setMethods(['getOrderItemId']) + ->onlyMethods(['getId']) ->getMock(); + $orderItem->method('getId') + ->willReturn(1); + $item = new DataObject(['order_item' => $orderItem]); $linkPurchased = $this->getMockBuilder(Purchased::class) ->disableOriginalConstructor() ->setMethods(['load']) @@ -83,12 +91,11 @@ public function testGetLinks() $this->block->setData('item', $item); $this->purchasedFactory->expects($this->once())->method('create')->willReturn($linkPurchased); - $linkPurchased->expects($this->once())->method('load')->with('orderItemId', 'order_item_id')->willReturnSelf(); - $item->expects($this->any())->method('getOrderItemId')->willReturn('orderItemId'); + $linkPurchased->expects($this->once())->method('load')->with(1, 'order_item_id')->willReturnSelf(); $this->itemsFactory->expects($this->once())->method('create')->willReturn($itemCollection); $itemCollection->expects($this->once()) ->method('addFieldToFilter') - ->with('order_item_id', 'orderItemId') + ->with('order_item_id', 1) ->willReturnSelf(); $this->assertEquals($linkPurchased, $this->block->getLinks()); diff --git a/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/Order/DownloadableTest.php b/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/Order/DownloadableTest.php index ffcf50c77c78..0925648f6ffa 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/Order/DownloadableTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/Order/DownloadableTest.php @@ -55,12 +55,16 @@ protected function setUp(): void ->setMethods(['create']) ->getMock(); + $purchasedLink = new \Magento\Downloadable\Model\Sales\Order\Link\Purchased( + $this->purchasedFactory, + $this->itemsFactory + ); + $this->block = $objectManager->getObject( Downloadable::class, [ 'context' => $contextMock, - 'purchasedFactory' => $this->purchasedFactory, - 'itemsFactory' => $this->itemsFactory + 'purchasedLink' => $purchasedLink ] ); } diff --git a/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Item/Renderer/DownloadableTest.php b/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Item/Renderer/DownloadableTest.php index 812f6697b43f..20dfa624f43f 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Item/Renderer/DownloadableTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Item/Renderer/DownloadableTest.php @@ -55,12 +55,15 @@ protected function setUp(): void ->setMethods(['create']) ->getMock(); + $purchasedLink = new \Magento\Downloadable\Model\Sales\Order\Link\Purchased( + $this->purchasedFactory, + $this->itemsFactory + ); $this->block = $objectManager->getObject( Downloadable::class, [ 'context' => $contextMock, - 'purchasedFactory' => $this->purchasedFactory, - 'itemsFactory' => $this->itemsFactory + 'purchasedLink' => $purchasedLink ] ); } diff --git a/app/code/Magento/Downloadable/Test/Unit/Model/Sales/Order/Link/PurchasedTest.php b/app/code/Magento/Downloadable/Test/Unit/Model/Sales/Order/Link/PurchasedTest.php new file mode 100644 index 000000000000..6a4bd6ba3dfe --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Unit/Model/Sales/Order/Link/PurchasedTest.php @@ -0,0 +1,148 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Downloadable\Test\Unit\Model\Sales\Order\Link; + +use Magento\Downloadable\Model\Link\Purchased as PurchasedEntity; +use Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\Collection; +use Magento\Downloadable\Model\Sales\Order\Link\Purchased; +use Magento\Framework\DataObject; +use Magento\Sales\Model\Order\Item; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; +use Magento\Downloadable\Model\Link\PurchasedFactory; +use Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory; + +/** + * Test order purchased link resolver + */ +class PurchasedTest extends TestCase +{ + /** + * @var PurchasedFactory|MockObject + */ + private $linkPurchasedFactory; + /** + * @var CollectionFactory|MockObject + */ + private $linkPurchasedItemCollectionFactory; + /** + * @var Purchased + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->linkPurchasedFactory = $this->getMockBuilder(PurchasedFactory::class) + ->disableOriginalConstructor() + ->onlyMethods(['create']) + ->getMock(); + $this->linkPurchasedItemCollectionFactory = $this->getMockBuilder(CollectionFactory::class) + ->disableOriginalConstructor() + ->onlyMethods(['create']) + ->getMock(); + + $this->model = new Purchased( + $this->linkPurchasedFactory, + $this->linkPurchasedItemCollectionFactory + ); + } + + /** + * @param bool $hasChildItem + * @param int $expectedItemId + * @param array $itemData + * @param array $childItemData + * @dataProvider getLinkDataProvider + */ + public function testGetLink( + bool $hasChildItem, + int $expectedItemId, + array $itemData, + array $childItemData = [] + ): void { + /** @var Item $orderItem */ + $orderItem = $this->getMockBuilder(Item::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $orderItem->addData($itemData); + /** @var Item $childOrderItem */ + $childOrderItem = $this->getMockBuilder(Item::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $childOrderItem->addData($childItemData); + if ($hasChildItem) { + $orderItem->addChildItem($childOrderItem); + } + $linkPurchased = $this->getMockBuilder(PurchasedEntity::class) + ->disableOriginalConstructor() + ->onlyMethods(['load']) + ->getMock(); + $itemCollection = $this->getMockBuilder(Collection::class) + ->disableOriginalConstructor() + ->onlyMethods(['addFieldToFilter']) + ->getMock(); + $this->linkPurchasedFactory->method('create') + ->willReturn($linkPurchased); + $linkPurchased->method('load') + ->with($expectedItemId, 'order_item_id') + ->willReturnSelf(); + $this->linkPurchasedItemCollectionFactory->method('create') + ->willReturn($itemCollection); + $itemCollection->method('addFieldToFilter') + ->with('order_item_id', $expectedItemId) + ->willReturnSelf(); + + $this->assertEquals($linkPurchased, $this->model->getLink($orderItem)); + $this->assertEquals($linkPurchased, $this->model->getLink(new DataObject(['order_item' => $orderItem]))); + } + + /** + * @return array[] + */ + public function getLinkDataProvider(): array + { + return [ + [ + false, + 1, + [ + 'id' => 1, + 'product_type' => 'downloadable' + ], + ], + [ + true, + 2, + [ + 'id' => 1, + 'product_type' => 'configurable' + ], + [ + 'id' => 2, + 'product_type' => 'downloadable' + ], + ], + [ + true, + 1, + [ + 'id' => 1, + 'product_type' => 'configurable' + ], + [ + 'id' => 2, + 'product_type' => 'virtual' + ], + ] + ]; + } +} diff --git a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable.phtml b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable.phtml index 699b384a8cda..478f27fd792e 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable.phtml @@ -5,6 +5,7 @@ */ // @deprecated +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound ?> <?php diff --git a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/links.phtml b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/links.phtml index 747ada71221f..c57e0c99a4c0 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/links.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/links.phtml @@ -5,8 +5,7 @@ */ // @deprecated -?> -<?php +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** * @var $block \Magento\Downloadable\Block\Adminhtml\Catalog\Product\Edit\Tab\Downloadable\Links diff --git a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/samples.phtml b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/samples.phtml index c4f7ffa51f89..6dc5d1e49a8a 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/samples.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/samples.phtml @@ -5,8 +5,8 @@ */ // @deprecated -?> -<?php +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound + /** * @var $block \Magento\Downloadable\Block\Adminhtml\Catalog\Product\Edit\Tab\Downloadable\Links */ diff --git a/app/code/Magento/Downloadable/view/adminhtml/web/template/components/file-uploader.html b/app/code/Magento/Downloadable/view/adminhtml/web/template/components/file-uploader.html index 76fe2bd8b5dd..57fb2c389aaf 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/web/template/components/file-uploader.html +++ b/app/code/Magento/Downloadable/view/adminhtml/web/template/components/file-uploader.html @@ -10,7 +10,7 @@ <each args="data: value, as: '$file'"> <div class="file-uploader-summary"> <div class="file-uploader-filename"> - <!-- ko if: $file.url --><a attr="href: $file.url" target="_blank" text="$file.name"/><!-- /ko --> + <!-- ko if: $file.url --><a attr="href: $file.url" target="_blank" text="$file.name"></a><!-- /ko --> <!-- ko if: !$file.url --><text args="$file.name"/><!-- /ko --> (<text args="$parent.formatSize($file.size)"/>) </div> @@ -18,9 +18,9 @@ </each> <div class="file-uploader-area"> <input type="file" afterRender="onElementRender" attr="id: uid, name: fileInputName, multiple: isMultipleFiles"/> - <label class="file-uploader-button action-secondary" attr="for: uid" translate="'Browse Files...'"/> + <label class="file-uploader-button action-secondary" attr="for: uid" translate="'Browse Files...'"></label> - <span class="file-uploader-spinner"/> + <span class="file-uploader-spinner"></span> </div> </div> </div> diff --git a/app/code/Magento/Downloadable/view/frontend/templates/catalog/product/type.phtml b/app/code/Magento/Downloadable/view/frontend/templates/catalog/product/type.phtml index ba6d9e0abec7..e5397e758d63 100644 --- a/app/code/Magento/Downloadable/view/frontend/templates/catalog/product/type.phtml +++ b/app/code/Magento/Downloadable/view/frontend/templates/catalog/product/type.phtml @@ -12,7 +12,7 @@ ?> <?php $_product = $block->getProduct() ?> -<?php if ($_product->getIsSalable()) : ?> +<?php if ($_product->isAvailable()) : ?> <div class="stock available" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>"> <span><?= $block->escapeHtml(__('In stock')) ?></span> </div> diff --git a/app/code/Magento/Downloadable/view/frontend/web/js/downloadable.js b/app/code/Magento/Downloadable/view/frontend/web/js/downloadable.js index 8bdea0b3a70b..a44ec1043ea7 100644 --- a/app/code/Magento/Downloadable/view/frontend/web/js/downloadable.js +++ b/app/code/Magento/Downloadable/view/frontend/web/js/downloadable.js @@ -17,7 +17,19 @@ define([ */ $.widget('mage.downloadable', { options: { - priceHolderSelector: '.price-box' + priceHolderSelector: '.price-box', + linkElement: '', + allElements: '' + }, + + /** + * @inheritdoc + */ + _init: function initLinks() { + var element = this.element, + options = $(this.options.linkElement, element); + + options.trigger('change'); }, /** diff --git a/app/code/Magento/DownloadableGraphQl/etc/graphql/di.xml b/app/code/Magento/DownloadableGraphQl/etc/graphql/di.xml index d752b3f13527..7dae7856a3bd 100644 --- a/app/code/Magento/DownloadableGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/DownloadableGraphQl/etc/graphql/di.xml @@ -67,4 +67,11 @@ </argument> </arguments> </type> + <type name="Magento\UrlRewriteGraphQl\Model\RoutableInterfaceTypeResolver"> + <arguments> + <argument name="productTypeNameResolvers" xsi:type="array"> + <item name="downloadable_product_type_resolver" xsi:type="object">Magento\DownloadableGraphQl\Model\DownloadableProductTypeResolver</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/DownloadableGraphQl/etc/schema.graphqls b/app/code/Magento/DownloadableGraphQl/etc/schema.graphqls index d8e9c9615b61..1c552dc858e9 100644 --- a/app/code/Magento/DownloadableGraphQl/etc/schema.graphqls +++ b/app/code/Magento/DownloadableGraphQl/etc/schema.graphqls @@ -25,12 +25,12 @@ type AddDownloadableProductsToCartOutput { } type DownloadableCartItem implements CartItemInterface @doc(description: "Downloadable Cart Item") { - customizable_options: [SelectedCustomizableOption] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") + customizable_options: [SelectedCustomizableOption]! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") links: [DownloadableProductLinks] @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\DownloadableCartItem\\Links") @doc(description: "An array containing information about the links for the added to cart downloadable product") samples: [DownloadableProductSamples] @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\DownloadableCartItem\\Samples") @doc(description: "DownloadableProductSamples defines characteristics of a downloadable product") } -type DownloadableProduct implements ProductInterface, CustomizableProductInterface @doc(description: "DownloadableProduct defines a product that the customer downloads") { +type DownloadableProduct implements ProductInterface, RoutableInterface, CustomizableProductInterface @doc(description: "DownloadableProduct defines a product that the shopper downloads") { downloadable_product_samples: [DownloadableProductSamples] @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Product\\Samples") @doc(description: "An array containing information about samples of this downloadable product.") downloadable_product_links: [DownloadableProductLinks] @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Product\\Links") @doc(description: "An array containing information about the links for this downloadable product") links_purchased_separately: Int @doc(description: "A value of 1 indicates that each link in the array must be purchased separately") diff --git a/app/code/Magento/DownloadableImportExport/Test/Mftf/Data/ImportData.xml b/app/code/Magento/DownloadableImportExport/Test/Mftf/Data/ImportData.xml new file mode 100644 index 000000000000..2392efab81ce --- /dev/null +++ b/app/code/Magento/DownloadableImportExport/Test/Mftf/Data/ImportData.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <!-- Categories --> + <entity name="ImportCategory_Downloadable_UrlLinks" type="category"> + <data key="name">import-category-downloadable-url-links</data> + <data key="name_lwr">import-category-downloadable-url-links</data> + <data key="is_active">true</data> + <data key="include_in_menu">true</data> + <data key="urlKey">import-category-downloadable-url-links</data> + </entity> + <entity name="ImportCategory_Downloadable_FileLinks" type="category"> + <data key="name">import-category-downloadable-file-links</data> + <data key="name_lwr">import-category-downloadable-file-links</data> + <data key="is_active">true</data> + <data key="include_in_menu">true</data> + <data key="urlKey">import-category-downloadable-file-links</data> + </entity> + + <!-- Products --> + <entity name="ImportProduct_Downloadable_UrlLinks" type="product"> + <data key="fileName">import_downloadable_product_url_links.csv</data> + <data key="importSummary">Created: 1, Updated: 0, Deleted: 0</data> + <data key="sku">import-product-downloadable-url-links</data> + <data key="type_id">downloadable</data> + <data key="attribute_set_id">4</data> + <data key="name">import-product-downloadable-url-links</data> + <data key="price">99.00</data> + <data key="quantity">100</data> + <data key="weight"/> + <data key="visibilityText">Catalog, Search</data> + <data key="status">1</data> + <data key="urlKey">import-product-downloadable-url-links</data> + <data key="baseImage">magento-logo.png</data> + <data key="baseImageName">magento-logo</data> + <data key="smallImage">m-logo.gif</data> + <data key="smallImageName">m-logo</data> + <data key="thumbnailImage">adobe-base.jpg</data> + <data key="thumbnailImageName">adobe-base</data> + <data key="linksTitle">Links</data> + <data key="linkTitle">Link1</data> + <data key="linkPrice">2.00</data> + <data key="totalPriceWithLink">101.00</data> + <data key="linkFileType">URL</data> + <data key="linkFileUrl">https://static.magento.com/sites/all/themes/mag_redesign/images/magento-logo.svg</data> + <data key="linkFileName">magento-logo</data> + <data key="linkSampleFileType">URL</data> + <data key="linkSampleFileUrl">https://static.magento.com/sites/all/themes/mag_redesign/images/magento-logo.svg</data> + <data key="linkSampleFileName">magento-logo</data> + <data key="linkShareable">Yes</data> + <data key="linkMaxDownloads">0</data> + <data key="samplesTitle">Samples</data> + <data key="sampleTitle">Sample1</data> + <data key="sampleFileType">URL</data> + <data key="sampleFileUrl">https://static.magento.com/sites/all/themes/mag_redesign/images/magento-logo.svg</data> + <data key="sampleFileName">magento-logo</data> + </entity> + <entity name="ImportProduct_Downloadable_FileLinks" type="product"> + <data key="fileName">import_downloadable_product_file_links.csv</data> + <data key="importSummary">Created: 1, Updated: 0, Deleted: 0</data> + <data key="name">import-product-downloadable-file-links</data> + <data key="sku">import-product-downloadable-file-links</data> + <data key="type_id">downloadable</data> + <data key="attribute_set_id">4</data> + <data key="price">100.00</data> + <data key="quantity">100</data> + <data key="weight"/> + <data key="visibilityText">Catalog, Search</data> + <data key="status">1</data> + <data key="urlKey">import-product-downloadable-file-links</data> + <data key="baseImage">magento-logo.png</data> + <data key="baseImageName">magento-logo</data> + <data key="smallImage">m-logo.gif</data> + <data key="smallImageName">m-logo</data> + <data key="thumbnailImage">adobe-base.jpg</data> + <data key="thumbnailImageName">adobe-base</data> + <data key="linksTitle">Links</data> + <data key="linkTitle">Link1</data> + <data key="linkPrice">3.00</data> + <data key="totalPriceWithLink">103.00</data> + <data key="linkFileType">Upload File</data> + <data key="linkFileName">m-logo</data> + <data key="linkSampleFileType">Upload File</data> + <data key="linkSampleFileName">magento-logo</data> + <data key="linkShareable">No</data> + <data key="linkMaxDownloads">0</data> + <data key="samplesTitle">Samples</data> + <data key="sampleTitle">Sample1</data> + <data key="sampleFileType">Upload File</data> + <data key="sampleFileName">adobe-base</data> + </entity> +</entities> diff --git a/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminExportDownloadableProductWithFileLinksTest.xml b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminExportDownloadableProductWithFileLinksTest.xml new file mode 100644 index 000000000000..b3a2063af340 --- /dev/null +++ b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminExportDownloadableProductWithFileLinksTest.xml @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminExportDownloadableProductWithFileLinksTest"> + <annotations> + <features value="DownloadableImportExport"/> + <stories value="Export Products"/> + <title value="Export Downloadable Products with File Links"/> + <description value="Verifies that a user can export a Downloadable product with downloadable and sample file + links. Verifies that the exported file and the downloadable copy of the exported file contain the expected + product (a filter is applied when exporting such that ONLY the downloadable product row should be in the + export), the correct downloadable link with files, and the correct downloadable sample links with files. + Note that MFTF cannot simply download a file and have access to it due to the test not having access to the + server that is running the test browser. Therefore, this test verifies that the Download button can be + successfully clicked, grabs the request URL from the Download button, executes the request on the magento + machine via a curl request, and verifies the contents of the downloaded file"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-38558"/> + <group value="importExport"/> + <group value="Downloadable"/> + </annotations> + + <before> + <!-- Create Category, Create Downloadable Product --> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="ApiDownloadableProduct" stepKey="createProduct"/> + <createData entity="downloadableLink_Files" stepKey="addDownloadableLink"> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="downloadableSample_File2" stepKey="addDownloadableSamples"> + <requiredEntity createDataKey="createProduct"/> + </createData> + <magentoCron groups="index" stepKey="runCronIndex"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <after> + <!-- Delete Data --> + <deleteData createDataKey="createProduct" stepKey="deleteConfigProduct"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">var/export</argument> + </helper> + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <!-- Export Created Products --> + <actionGroup ref="AdminNavigateToExportPageActionGroup" stepKey="goToExportIndexPage"/> + <actionGroup ref="ExportProductsFilterByAttributeActionGroup" stepKey="exportProductBySku"> + <argument name="attribute" value="sku"/> + <argument name="attributeData" value="$$createProduct.sku$$"/> + </actionGroup> + + <!-- Start Message Queue for Export Consumer --> + <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> + <argument name="consumerName" value="{{AdminExportMessageConsumerData.consumerName}}"/> + <argument name="maxMessages" value="{{AdminExportMessageConsumerData.messageLimit}}"/> + </actionGroup> + <reloadPage stepKey="refreshPage"/> + <waitForPageLoad stepKey="waitForReload"/> + <waitForElementVisible selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="waitForFileName"/> + <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="getFilename"/> + <actionGroup ref="AdminGetExportFilenameOnServerActionGroup" stepKey="grabNameFile"> + <argument name="rowIndex" value="0"/> + </actionGroup> + + <!-- Validate Export File on File System --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableLink"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">title=$addDownloadableLink.link[title]$,sort_order=$addDownloadableLink.link[sort_order]$,sample_type=$addDownloadableLink.link[sample_type]$,sample_file=/a/d/$addDownloadableLink.link[sample_file_content][name]$,price=$addDownloadableLink.link[price]$0000,number_of_downloads=$addDownloadableLink.link[number_of_downloads]$,is_shareable=$addDownloadableLink.link[is_shareable]$,link_type=$addDownloadableLink.link[link_type]$,link_file=/m/a/$addDownloadableLink.link[link_file_content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableSampleLink"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">title=$addDownloadableSamples.sample[title]$,sample_type=$addDownloadableSamples.sample[sample_type]$,sample_file=/t/e/$addDownloadableSamples.sample[sample_file_content][name]$</argument> + </helper> + + <!-- Download Export File --> + <actionGroup ref="DownloadFileActionGroup" stepKey="downloadExport"> + <argument name="fileName" value="{$getFilename}"/> + </actionGroup> + + <!-- Validate Downloaded Export File on File System --> + <grabAttributeFrom userInput="href" selector="{{AdminExportAttributeSection.download('0')}}" stepKey="grabExportUrl"/> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDownloadableProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDownloadableLink"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">title=$addDownloadableLink.link[title]$,sort_order=$addDownloadableLink.link[sort_order]$,sample_type=$addDownloadableLink.link[sample_type]$,sample_file=/a/d/$addDownloadableLink.link[sample_file_content][name]$,price=$addDownloadableLink.link[price]$0000,number_of_downloads=$addDownloadableLink.link[number_of_downloads]$,is_shareable=$addDownloadableLink.link[is_shareable]$,link_type=$addDownloadableLink.link[link_type]$,link_file=/m/a/$addDownloadableLink.link[link_file_content][name]$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDownloadableSampleLink"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">title=$addDownloadableSamples.sample[title]$,sample_type=$addDownloadableSamples.sample[sample_type]$,sample_file=/t/e/$addDownloadableSamples.sample[sample_file_content][name]$</argument> + </helper> + + <!-- Delete Export File --> + <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> + <argument name="fileName" value="{$getFilename}"/> + </actionGroup> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminExportDownloadableProductWithURLLinksTest.xml b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminExportDownloadableProductWithURLLinksTest.xml new file mode 100644 index 000000000000..b59a84675a0c --- /dev/null +++ b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminExportDownloadableProductWithURLLinksTest.xml @@ -0,0 +1,128 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminExportDownloadableProductWithURLLinksTest"> + <annotations> + <features value="DownloadableImportExport"/> + <stories value="Export Products"/> + <title value="Export Downloadable Products with URL Links"/> + <description value="Verifies that a user can export a Downloadable product with downloadable and sample Url + links. Verifies that the exported file and the downloadable copy of the exported file contain the expected + product (a filter is applied when exporting such that ONLY the downloadable product row should be in the + export), the correct downloadable link with Urls, and the correct downloadable sample links with Urls. + Note that MFTF cannot simply download a file and have access to it due to the test not having access to the + server that is running the test browser. Therefore, this test verifies that the Download button can be + successfully clicked, grabs the request URL from the Download button, executes the request on the magento + machine via a curl request, and verifies the contents of the downloaded file"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-38558"/> + <group value="importExport"/> + <group value="Downloadable"/> + </annotations> + + <before> + <!-- Add Downloadable Domain, Create Category, Create Downloadable Product --> + <magentoCLI command="downloadable:domains:add example.com" stepKey="addDownloadableDomain"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="ApiDownloadableProduct" stepKey="createProduct"/> + <createData entity="downloadableLink1" stepKey="addDownloadableLink"> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="DownloadableSample" stepKey="addDownloadableSamples"> + <requiredEntity createDataKey="createProduct"/> + </createData> + <magentoCron groups="index" stepKey="runCronIndex"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <after> + <!-- Revert Configuration & Delete Data --> + <magentoCLI command="downloadable:domains:remove example.com" stepKey="removeDownloadableDomain"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <deleteData createDataKey="createProduct" stepKey="deleteConfigProduct"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">var/export</argument> + </helper> + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <!-- Export Created Products --> + <actionGroup ref="AdminNavigateToExportPageActionGroup" stepKey="goToExportIndexPage"/> + <actionGroup ref="ExportProductsFilterByAttributeActionGroup" stepKey="exportProductBySku"> + <argument name="attribute" value="sku"/> + <argument name="attributeData" value="$$createProduct.sku$$"/> + </actionGroup> + + <!-- Start Message Queue for Export Consumer --> + <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> + <argument name="consumerName" value="{{AdminExportMessageConsumerData.consumerName}}"/> + <argument name="maxMessages" value="{{AdminExportMessageConsumerData.messageLimit}}"/> + </actionGroup> + <reloadPage stepKey="refreshPage"/> + <waitForPageLoad stepKey="waitForReload"/> + <waitForElementVisible selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="waitForFileName"/> + <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="getFilename"/> + <actionGroup ref="AdminGetExportFilenameOnServerActionGroup" stepKey="grabNameFile"> + <argument name="rowIndex" value="0"/> + </actionGroup> + + <!-- Validate Export File on File System --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableLink"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">title=$addDownloadableLink.link[title]$,sort_order=$addDownloadableLink.link[sort_order]$,sample_type=$addDownloadableLink.link[sample_type]$,sample_url=$addDownloadableLink.link[sample_url]$,price=$addDownloadableLink.link[price]$0000,number_of_downloads=$addDownloadableLink.link[number_of_downloads]$,link_type=$addDownloadableLink.link[link_type]$,link_url=$addDownloadableLink.link[link_url]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableSampleLink"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">title=$addDownloadableSamples.sample[title]$,sort_order=$addDownloadableSamples.sample[sort_order]$,sample_type=$addDownloadableSamples.sample[sample_type]$,sample_url=$addDownloadableSamples.sample[sample_url]$</argument> + </helper> + + <!-- Download Export File --> + <actionGroup ref="DownloadFileActionGroup" stepKey="downloadExport"> + <argument name="fileName" value="{$getFilename}"/> + </actionGroup> + + <!-- Validate Downloaded Export File on File System --> + <grabAttributeFrom userInput="href" selector="{{AdminExportAttributeSection.download('0')}}" stepKey="grabExportUrl"/> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDownloadableProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDownloadableLink"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">title=$addDownloadableLink.link[title]$,sort_order=$addDownloadableLink.link[sort_order]$,sample_type=$addDownloadableLink.link[sample_type]$,sample_url=$addDownloadableLink.link[sample_url]$,price=$addDownloadableLink.link[price]$0000,number_of_downloads=$addDownloadableLink.link[number_of_downloads]$,link_type=$addDownloadableLink.link[link_type]$,link_url=$addDownloadableLink.link[link_url]$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDownloadableSampleLink"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">title=$addDownloadableSamples.sample[title]$,sort_order=$addDownloadableSamples.sample[sort_order]$,sample_type=$addDownloadableSamples.sample[sample_type]$,sample_url=$addDownloadableSamples.sample[sample_url]$</argument> + </helper> + + <!-- Delete Export File --> + <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> + <argument name="fileName" value="{$getFilename}"/> + </actionGroup> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithFileLinksTest.xml b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithFileLinksTest.xml new file mode 100644 index 000000000000..441395e3114a --- /dev/null +++ b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithFileLinksTest.xml @@ -0,0 +1,220 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminImportDownloadableProductsWithFileLinksTest"> + <annotations> + <features value="DownloadableImportExport"/> + <stories value="Import Products"/> + <title value="Import Downloadable Products with File Links"/> + <description value="Imports a .csv file containing a downloadable product with file links. Verifies that + products are imported successfully and that the files are attached to the products as expected."/> + <severity value="MAJOR"/> + <testCaseId value="MC-38325"/> + <group value="importExport"/> + <group value="Downloadable"/> + </annotations> + + <before> + <!-- Create Category & Customer --> + <createData entity="ImportCategory_Downloadable_FileLinks" stepKey="createImportCategory"/> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + + <!-- Copy Images to Import Directory for Product Images --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportImages"> + <argument name="path">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyBaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copySmallImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyThumbnailImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument> + </helper> + + <!-- Copy Images to Import Directory for Downloadable Links --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportDownloadableLinkFiles"> + <argument name="path">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyBaseImage2"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copySmallImage2"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyThumbnailImage3"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument> + </helper> + + <!-- Login as Admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <after> + <!-- Delete Data --> + <deleteData createDataKey="createImportCategory" stepKey="deleteImportCategory"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteProductImageDirectory"> + <argument name="path">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteDownloadableLinkFilesDirectory"> + <argument name="path">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}</argument> + </helper> + <deleteData url="/V1/products/{{ImportProduct_Downloadable_FileLinks.urlKey}}" stepKey="deleteImportedDownloadableProduct"/> + <actionGroup ref="NavigateToAndResetProductGridToDefaultViewActionGroup" stepKey="navigateToAndResetProductGridToDefaultView"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Import Downloadable Product & Assert No Errors --> + <actionGroup ref="AdminNavigateToImportPageActionGroup" stepKey="navigateToImportPage"/> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Downloadable_FileLinks.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Downloadable_FileLinks.name}}"/> + </actionGroup> + <actionGroup ref="AdminClickCheckDataImportActionGroup" stepKey="clickCheckData"/> + <see selector="{{AdminImportValidationMessagesSection.success}}" userInput="{{ImportCommonMessages.validFile}}" stepKey="seeCheckDataResultMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage"/> + <actionGroup ref="AdminClickImportActionGroup" stepKey="clickImport"/> + <see selector="{{AdminImportValidationMessagesSection.notice}}" userInput="{{ImportProduct_Downloadable_FileLinks.importSummary}}" stepKey="seeNoticeMessage"/> + <see selector="{{AdminImportValidationMessagesSection.messageByType('success')}}" userInput="{{ImportCommonMessages.success}}" stepKey="seeImportMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage2"/> + + <!-- Reindex --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + + <!-- Admin: Verify Data on Import History Page --> + <actionGroup ref="AdminNavigateToImportHistoryPageActionGroup" stepKey="navigateToImportHistoryPage"/> + <actionGroup ref="AdminGridSortColumnDescendingActionGroup" stepKey="sortColumnByIdDescending"> + <argument name="columnLabel" value="history_id"/> + </actionGroup> + <see userInput="{{ImportProduct_Downloadable_FileLinks.fileName}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeImportedFile"/> + <see userInput="{{ImportProduct_Downloadable_FileLinks.importSummary}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeSummary"/> + + <!-- Admin: Verify Downloadable Product on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToDownloadableProductEditPage"> + <argument name="product" value="ImportProduct_Downloadable_FileLinks"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertDownloadableProductOnEditPage"> + <argument name="productStatus" value="{{ImportProduct_Downloadable_FileLinks.status}}"/> + <argument name="productName" value="{{ImportProduct_Downloadable_FileLinks.name}}"/> + <argument name="productSku" value="{{ImportProduct_Downloadable_FileLinks.sku}}"/> + <argument name="productPrice" value="{{ImportProduct_Downloadable_FileLinks.price}}"/> + <argument name="productQuantity" value="{{ImportProduct_Downloadable_FileLinks.quantity}}"/> + <argument name="productWeight" value="{{ImportProduct_Downloadable_FileLinks.weight}}"/> + <argument name="productVisibility" value="{{ImportProduct_Downloadable_FileLinks.visibilityText}}"/> + <argument name="categoryName" value="{{ImportCategory_Downloadable_FileLinks.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductBaseImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Downloadable_FileLinks.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Downloadable_FileLinks.baseImageName, 'image')}}" stepKey="seeBaseImageRole"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductSmallImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Downloadable_FileLinks.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Downloadable_FileLinks.smallImageName, 'small_image')}}" stepKey="seeSmallImageRole"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Downloadable_FileLinks.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Downloadable_FileLinks.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRole"/> + + <!-- Admin: Verify Downloadable Information --> + <actionGroup ref="ExpandAdminProductSectionActionGroup" stepKey="expandDownloadableSection"> + <argument name="sectionSelector" value="{{AdminProductDownloadableSection.sectionHeader}}"/> + <argument name="sectionDependentSelector" value="{{AdminProductDownloadableSection.sectionLinkGrid}}"/> + </actionGroup> + <seeCheckboxIsChecked selector="{{AdminProductDownloadableSection.isDownloadableProduct}}" stepKey="seeDownloadableProductChecked"/> + <seeInField userInput="{{ImportProduct_Downloadable_FileLinks.linksTitle}}" selector="{{AdminProductDownloadableSection.linksTitleInput}}" stepKey="seeLinksTitle"/> + <seeCheckboxIsChecked selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="seeLinksPurchasedSeparateChecked"/> + <actionGroup ref="AdminAssertDownloadableLinkInformationActionGroup" stepKey="verifyDownloadableLinkAdmin"> + <argument name="title" value="{{ImportProduct_Downloadable_FileLinks.linkTitle}}"/> + <argument name="price" value="{{ImportProduct_Downloadable_FileLinks.linkPrice}}"/> + <argument name="fileType" value="{{ImportProduct_Downloadable_FileLinks.linkFileType}}"/> + <argument name="fileNameOrUrl" value="{{ImportProduct_Downloadable_FileLinks.linkFileName}}"/> + <argument name="sampleType" value="{{ImportProduct_Downloadable_FileLinks.linkSampleFileType}}"/> + <argument name="sampleFileNameOrUrl" value="{{ImportProduct_Downloadable_FileLinks.linkSampleFileName}}"/> + <argument name="shareable" value="{{ImportProduct_Downloadable_FileLinks.linkShareable}}"/> + <argument name="maxDownloads" value="{{ImportProduct_Downloadable_FileLinks.linkMaxDownloads}}"/> + </actionGroup> + <seeCheckboxIsChecked selector="{{AdminProductDownloadableSection.addLinkIsUnlimitedDownloads('0')}}" stepKey="seeLinkMaxDownloadsUnlimitedChecked"/> + <seeInField userInput="{{ImportProduct_Downloadable_FileLinks.samplesTitle}}" selector="{{AdminProductDownloadableSection.samplesTitleInput}}" stepKey="seeSamplesTitle"/> + <actionGroup ref="AdminAssertDownloadableSampleLinkInformationActionGroup" stepKey="verifyDownloadableSampleLinkAdmin"> + <argument name="title" value="{{ImportProduct_Downloadable_FileLinks.sampleTitle}}"/> + <argument name="fileType" value="{{ImportProduct_Downloadable_FileLinks.sampleFileType}}"/> + <argument name="fileNameOrUrl" value="{{ImportProduct_Downloadable_FileLinks.sampleFileName}}"/> + </actionGroup> + + <!-- Storefront: Verify Downloadable Product In Category --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginStorefront"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + <actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryPage"> + <argument name="categoryUrl" value="{{ImportCategory_Downloadable_FileLinks.name_lwr}}"/> + </actionGroup> + <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productName}}" userInput="1" stepKey="seeOnly1Product2"/> + <see selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{ImportProduct_Downloadable_FileLinks.name}}" stepKey="seeProduct"/> + + <!-- Storefront: Verify Downloadable Product Info & Image --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefrontPage"> + <argument name="productUrl" value="{{ImportProduct_Downloadable_FileLinks.urlKey}}"/> + </actionGroup> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Downloadable_FileLinks.name}}" stepKey="seeProductName"/> + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Downloadable_FileLinks.sku}}" stepKey="seeSku"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProduct_Downloadable_FileLinks.price}}" stepKey="seePrice"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProduct_Downloadable_FileLinks.baseImageName)}}" stepKey="seeBaseImage"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProduct_Downloadable_FileLinks.smallImageName)}}" stepKey="seeSmallImage"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProduct_Downloadable_FileLinks.thumbnailImageName)}}" stepKey="seeThumbnailImage"/> + + <!-- Storefront: Verify Downloadable Product Link Data --> + <seeElement selector="{{StorefrontDownloadableProductSection.downloadableSampleLabel(ImportProduct_Downloadable_FileLinks.sampleTitle)}}" stepKey="seeDownloadableSampleLink"/> + <click selector="{{StorefrontDownloadableProductSection.downloadableSampleLabel(ImportProduct_Downloadable_FileLinks.sampleTitle)}}" stepKey="clickDownloadableSampleLink"/> + <switchToNextTab stepKey="switchToDownloadedLinkTab"/> + <waitForElement selector="{{StorefrontDownloadableLinkSection.downloadableLinkImage}}" stepKey="seeImage"/> + <closeTab stepKey="closeTab"/> + <seeElement selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(ImportProduct_Downloadable_FileLinks.linkTitle)}}" stepKey="seeDownloadableLink"/> + <seeElement selector="{{StorefrontDownloadableProductSection.downloadableLinkSampleByTitle('sample')}}" stepKey="seeDownloadableLinkSampleLink"/> + <click selector="{{StorefrontDownloadableProductSection.downloadableLinkSampleByTitle('sample')}}" stepKey="clickDownloadableLinkSampleLink"/> + <switchToNextTab stepKey="switchToDownloadedLinkTab2"/> + <waitForElement selector="{{StorefrontDownloadableLinkSection.downloadableLinkImage}}" stepKey="seeImage2"/> + <closeTab stepKey="closeTab2"/> + <checkOption selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(ImportProduct_Downloadable_FileLinks.linkTitle)}}" stepKey="selectDownloadableLink"/> + <waitForText selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProduct_Downloadable_FileLinks.totalPriceWithLink}}" stepKey="seeUpdatedPrice"/> + + <!-- Purchase Downloadable Product --> + <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProductToCart"/> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="navigateToCheckoutPage"/> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlacePurchaseOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> + + <!-- Create Invoice --> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="goToOrderInAdmin"> + <argument name="orderId" value="{$grabOrderNumber}"/> + </actionGroup> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/> + <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> + + <!-- Storefront: Go to Purchased Downloadable Product & Verify Link --> + <actionGroup ref="StorefrontNavigateToCustomerDownloadableProductsPageActionGroup" stepKey="goToCustomerDownloadableProductsPage"/> + <see userInput="{{ImportProduct_Downloadable_FileLinks.linkTitle}}" selector="{{StorefrontCustomerDownloadableProductsSection.downloadableLinkByOrderNumber({$grabOrderNumber})}}" stepKey="seeDownloadableLink2"/> + <click selector="{{StorefrontCustomerDownloadableProductsSection.downloadableLinkByOrderNumber({$grabOrderNumber})}}" stepKey="clickDownloadableLink"/> + <switchToNextTab stepKey="switchToDownloadedLinkTab3"/> + <waitForElement selector="{{StorefrontDownloadableLinkSection.downloadableLinkImage}}" stepKey="seeImage3"/> + <closeTab stepKey="closeTab3"/> + </test> +</tests> diff --git a/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithUrlLinksTest.xml b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithUrlLinksTest.xml new file mode 100644 index 000000000000..22cfca5224ad --- /dev/null +++ b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithUrlLinksTest.xml @@ -0,0 +1,231 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminImportDownloadableProductsWithUrlLinksTest"> + <annotations> + <features value="DownloadableImportExport"/> + <stories value="Import Products"/> + <title value="Import Downloadable Products with Url Links"/> + <description value="Imports a .csv file containing a downloadable product with url links. Verifies that + products are imported successfully."/> + <severity value="MAJOR"/> + <testCaseId value="MC-38947"/> + <group value="importExport"/> + <group value="Downloadable"/> + </annotations> + + <before> + <!-- Add Downloadable Domain, Create Category, & Create Customer --> + <magentoCLI command="downloadable:domains:add static.magento.com" stepKey="addDownloadableDomain"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <createData entity="ImportCategory_Downloadable_UrlLinks" stepKey="createImportCategory"/> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + + <!-- Copy Images to Import Directory for Product Images --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportImages"> + <argument name="path">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyBaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copySmallImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyThumbnailImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.thumbnailImage}}</argument> + </helper> + + <!-- Copy Images to Import Directory for Downloadable Links --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportDownloadableLinkFiles"> + <argument name="path">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyBaseImage2"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.baseImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copySmallImage2"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.smallImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyThumbnailImage3"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.thumbnailImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.thumbnailImage}}</argument> + </helper> + + <!-- Login as Admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <after> + <!-- Revert Configuration & Delete Data --> + <magentoCLI command="downloadable:domains:remove static.magento.com" stepKey="removeDownloadableDomain"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <deleteData createDataKey="createImportCategory" stepKey="deleteImportCategory"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteProductImageDirectory"> + <argument name="path">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteDownloadableLinkFilesDirectory"> + <argument name="path">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}</argument> + </helper> + <deleteData url="/V1/products/{{ImportProduct_Downloadable_UrlLinks.urlKey}}" stepKey="deleteImportedDownloadableProduct"/> + <actionGroup ref="NavigateToAndResetProductGridToDefaultViewActionGroup" stepKey="navigateToAndResetProductGridToDefaultView"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Import Downloadable Product & Assert No Errors --> + <actionGroup ref="AdminNavigateToImportPageActionGroup" stepKey="navigateToImportPage"/> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Downloadable_UrlLinks.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Downloadable_UrlLinks.name}}"/> + </actionGroup> + <actionGroup ref="AdminClickCheckDataImportActionGroup" stepKey="clickCheckData"/> + <see selector="{{AdminImportValidationMessagesSection.success}}" userInput="{{ImportCommonMessages.validFile}}" stepKey="seeCheckDataResultMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage"/> + <actionGroup ref="AdminClickImportActionGroup" stepKey="clickImport"/> + <see selector="{{AdminImportValidationMessagesSection.notice}}" userInput="{{ImportProduct_Downloadable_UrlLinks.importSummary}}" stepKey="seeNoticeMessage"/> + <see selector="{{AdminImportValidationMessagesSection.messageByType('success')}}" userInput="{{ImportCommonMessages.success}}" stepKey="seeImportMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage2"/> + + <!-- Reindex --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + + <!-- Admin: Verify Data on Import History Page --> + <actionGroup ref="AdminNavigateToImportHistoryPageActionGroup" stepKey="navigateToImportHistoryPage"/> + <actionGroup ref="AdminGridSortColumnDescendingActionGroup" stepKey="sortColumnByIdDescending"> + <argument name="columnLabel" value="history_id"/> + </actionGroup> + <see userInput="{{ImportProduct_Downloadable_UrlLinks.fileName}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeImportedFile"/> + <see userInput="{{ImportProduct_Downloadable_UrlLinks.importSummary}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeSummary"/> + + <!-- Admin: Verify Downloadable Product on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToDownloadableProductEditPage"> + <argument name="product" value="ImportProduct_Downloadable_UrlLinks"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertDownloadableProductOnEditPage"> + <argument name="productStatus" value="{{ImportProduct_Downloadable_UrlLinks.status}}"/> + <argument name="productName" value="{{ImportProduct_Downloadable_UrlLinks.name}}"/> + <argument name="productSku" value="{{ImportProduct_Downloadable_UrlLinks.sku}}"/> + <argument name="productPrice" value="{{ImportProduct_Downloadable_UrlLinks.price}}"/> + <argument name="productQuantity" value="{{ImportProduct_Downloadable_UrlLinks.quantity}}"/> + <argument name="productWeight" value="{{ImportProduct_Downloadable_UrlLinks.weight}}"/> + <argument name="productVisibility" value="{{ImportProduct_Downloadable_UrlLinks.visibilityText}}"/> + <argument name="categoryName" value="{{ImportCategory_Downloadable_UrlLinks.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductBaseImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Downloadable_UrlLinks.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Downloadable_UrlLinks.baseImageName, 'image')}}" stepKey="seeBaseImageRole"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductSmallImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Downloadable_UrlLinks.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Downloadable_UrlLinks.smallImageName, 'small_image')}}" stepKey="seeSmallImageRole"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Downloadable_UrlLinks.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Downloadable_UrlLinks.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRole"/> + + <!-- Admin: Verify Downloadable Information --> + <actionGroup ref="ExpandAdminProductSectionActionGroup" stepKey="expandDownloadableSection"> + <argument name="sectionSelector" value="{{AdminProductDownloadableSection.sectionHeader}}"/> + <argument name="sectionDependentSelector" value="{{AdminProductDownloadableSection.sectionLinkGrid}}"/> + </actionGroup> + <seeCheckboxIsChecked selector="{{AdminProductDownloadableSection.isDownloadableProduct}}" stepKey="seeDownloadableProductChecked"/> + <seeInField userInput="{{ImportProduct_Downloadable_UrlLinks.linksTitle}}" selector="{{AdminProductDownloadableSection.linksTitleInput}}" stepKey="seeLinksTitle"/> + <seeCheckboxIsChecked selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="seeLinksPurchasedSeparateChecked"/> + <actionGroup ref="AdminAssertDownloadableLinkInformationActionGroup" stepKey="verifyDownloadableLinkAdmin"> + <argument name="title" value="{{ImportProduct_Downloadable_UrlLinks.linkTitle}}"/> + <argument name="price" value="{{ImportProduct_Downloadable_UrlLinks.linkPrice}}"/> + <argument name="fileType" value="{{ImportProduct_Downloadable_UrlLinks.linkFileType}}"/> + <argument name="fileNameOrUrl" value="{{ImportProduct_Downloadable_UrlLinks.linkFileUrl}}"/> + <argument name="sampleType" value="{{ImportProduct_Downloadable_UrlLinks.linkSampleFileType}}"/> + <argument name="sampleFileNameOrUrl" value="{{ImportProduct_Downloadable_UrlLinks.linkSampleFileUrl}}"/> + <argument name="shareable" value="{{ImportProduct_Downloadable_UrlLinks.linkShareable}}"/> + <argument name="maxDownloads" value="{{ImportProduct_Downloadable_UrlLinks.linkMaxDownloads}}"/> + </actionGroup> + <seeCheckboxIsChecked selector="{{AdminProductDownloadableSection.addLinkIsUnlimitedDownloads('0')}}" stepKey="seeLinkMaxDownloadsUnlimitedChecked"/> + <seeInField userInput="{{ImportProduct_Downloadable_UrlLinks.samplesTitle}}" selector="{{AdminProductDownloadableSection.samplesTitleInput}}" stepKey="seeSamplesTitle"/> + <actionGroup ref="AdminAssertDownloadableSampleLinkInformationActionGroup" stepKey="verifyDownloadableSampleLinkAdmin"> + <argument name="title" value="{{ImportProduct_Downloadable_UrlLinks.sampleTitle}}"/> + <argument name="fileType" value="{{ImportProduct_Downloadable_UrlLinks.sampleFileType}}"/> + <argument name="fileNameOrUrl" value="{{ImportProduct_Downloadable_UrlLinks.sampleFileUrl}}"/> + </actionGroup> + + <!-- Storefront: Verify Downloadable Product In Category --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginStorefront"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + <actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryPage"> + <argument name="categoryUrl" value="{{ImportCategory_Downloadable_UrlLinks.name_lwr}}"/> + </actionGroup> + <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productName}}" userInput="1" stepKey="seeOnly1Product2"/> + <see selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{ImportProduct_Downloadable_UrlLinks.name}}" stepKey="seeProduct"/> + + <!-- Storefront: Verify Downloadable Product Info & Image --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefrontPage"> + <argument name="productUrl" value="{{ImportProduct_Downloadable_UrlLinks.urlKey}}"/> + </actionGroup> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Downloadable_UrlLinks.name}}" stepKey="seeProductName"/> + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Downloadable_UrlLinks.sku}}" stepKey="seeSku"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProduct_Downloadable_UrlLinks.price}}" stepKey="seePrice"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProduct_Downloadable_UrlLinks.baseImageName)}}" stepKey="seeBaseImage"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProduct_Downloadable_UrlLinks.smallImageName)}}" stepKey="seeSmallImage"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProduct_Downloadable_UrlLinks.thumbnailImageName)}}" stepKey="seeThumbnailImage"/> + + <!-- Storefront: Verify Downloadable Product Link Data --> + <seeElement selector="{{StorefrontDownloadableProductSection.downloadableSampleLabel(ImportProduct_Downloadable_UrlLinks.sampleTitle)}}" stepKey="seeDownloadableSampleLink"/> + <click selector="{{StorefrontDownloadableProductSection.downloadableSampleLabel(ImportProduct_Downloadable_UrlLinks.sampleTitle)}}" stepKey="clickDownloadableSampleLink"/> + <switchToNextTab stepKey="switchToDownloadedLinkTab"/> + <waitForElement selector="{{StorefrontDownloadableLinkSection.downloadableLinkTitle(ImportProduct_Downloadable_UrlLinks.sampleFileName)}}" stepKey="seeImageTitle"/> + <waitForElement selector="{{StorefrontDownloadableLinkSection.downloadableLinkSvg}}" stepKey="seeImage"/> + <closeTab stepKey="closeTab"/> + <seeElement selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(ImportProduct_Downloadable_UrlLinks.linkTitle)}}" stepKey="seeDownloadableLink"/> + <seeElement selector="{{StorefrontDownloadableProductSection.downloadableLinkSampleByTitle('sample')}}" stepKey="seeDownloadableLinkSampleLink"/> + <click selector="{{StorefrontDownloadableProductSection.downloadableLinkSampleByTitle('sample')}}" stepKey="clickDownloadableLinkSampleLink"/> + <switchToNextTab stepKey="switchToDownloadedLinkTab2"/> + <waitForElement selector="{{StorefrontDownloadableLinkSection.downloadableLinkTitle(ImportProduct_Downloadable_UrlLinks.linkSampleFileName)}}" stepKey="seeImageTitle2"/> + <waitForElement selector="{{StorefrontDownloadableLinkSection.downloadableLinkSvg}}" stepKey="seeImage2"/> + <closeTab stepKey="closeTab2"/> + <checkOption selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(ImportProduct_Downloadable_UrlLinks.linkTitle)}}" stepKey="selectDownloadableLink"/> + <waitForText selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProduct_Downloadable_UrlLinks.totalPriceWithLink}}" stepKey="seeUpdatedPrice"/> + + <!-- Purchase Downloadable Product --> + <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProductToCart"/> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="navigateToCheckoutPage"/> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlacePurchaseOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> + + <!-- Create Invoice --> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="goToOrderInAdmin"> + <argument name="orderId" value="{$grabOrderNumber}"/> + </actionGroup> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/> + <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> + + <!-- Storefront: Go to Purchased Downloadable Product & Verify Link --> + <actionGroup ref="StorefrontNavigateToCustomerDownloadableProductsPageActionGroup" stepKey="goToCustomerDownloadableProductsPage"/> + <see userInput="{{ImportProduct_Downloadable_UrlLinks.linkTitle}}" selector="{{StorefrontCustomerDownloadableProductsSection.downloadableLinkByOrderNumber({$grabOrderNumber})}}" stepKey="seeDownloadableLink2"/> + <click selector="{{StorefrontCustomerDownloadableProductsSection.downloadableLinkByOrderNumber({$grabOrderNumber})}}" stepKey="clickDownloadableLink"/> + <switchToNextTab stepKey="switchToDownloadedLinkTab3"/> + <waitForElement selector="{{StorefrontDownloadableLinkSection.downloadableLinkTitle(ImportProduct_Downloadable_UrlLinks.linkFileName)}}" stepKey="seeImageTitle3"/> + <waitForElement selector="{{StorefrontDownloadableLinkSection.downloadableLinkSvg}}" stepKey="seeImage3"/> + <closeTab stepKey="closeTab3"/> + </test> +</tests> diff --git a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php index fe660f01c824..9070254bcc6c 100644 --- a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php +++ b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php @@ -201,7 +201,7 @@ protected function _prepareForm() ] ); - $dateFormat = $this->_localeDate->getDateFormat(\IntlDateFormatter::SHORT); + $dateFormat = $this->_localeDate->getDateFormatWithLongYear(); $fieldset->addField( 'default_value_date', 'date', diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Group.php b/app/code/Magento/Eav/Model/Entity/Attribute/Group.php index 2e5596456058..53df296f36ab 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Group.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Group.php @@ -128,6 +128,7 @@ public function beforeSave() $isReservedSystemName = in_array(strtolower($attributeGroupCode), $this->reservedSystemNames); if (empty($attributeGroupCode) || $isReservedSystemName) { // in the following code md5 is not used for security purposes + // phpcs:ignore Magento2.Security.InsecureFunction $attributeGroupCode = md5(strtolower($groupName)); } $this->setAttributeGroupCode($attributeGroupCode); diff --git a/app/code/Magento/Eav/Model/ResourceModel/AttributeValue.php b/app/code/Magento/Eav/Model/ResourceModel/AttributeValue.php index 305ed202ff22..66404c3ef380 100644 --- a/app/code/Magento/Eav/Model/ResourceModel/AttributeValue.php +++ b/app/code/Magento/Eav/Model/ResourceModel/AttributeValue.php @@ -117,7 +117,7 @@ public function getValues( * Delete attribute values * * @param string $entityType - * @param array[][] $values + * @param array[] $values * Format: * array( * 0 => array( @@ -159,12 +159,64 @@ public function deleteValues(string $entityType, array $values): void } } + /** + * Insert attribute values + * + * @param string $entityType + * @param array[] $values + * Format: + * array( + * 0 => array( + * attribute_id => 11, + * value => 'some long text', + * ... + * ), + * 1 => array( + * attribute_id => 22, + * value => 'some short text', + * ... + * ) + * ) + */ + public function insertValues(string $entityType, array $values): void + { + $metadata = $this->metadataPool->getMetadata($entityType); + $connection = $metadata->getEntityConnection(); + $attributeTables = []; + $allAttributes = []; + + foreach ($this->getEntityAttributes($entityType) as $attribute) { + $allAttributes[(int) $attribute->getAttributeId()] = $attribute; + } + + foreach ($values as $value) { + $attribute = $allAttributes[(int) $value['attribute_id']] ?? null; + if ($attribute && !$attribute->isStatic()) { + $columns = array_keys($value); + $columnsHash = implode(',', $columns); + $attributeTable = $attribute->getBackend()->getTable(); + $attributeTables[$attributeTable][$columnsHash][] = array_values($value); + } + } + + foreach ($attributeTables as $table => $tableData) { + foreach ($tableData as $columns => $data) { + $connection->insertArray( + $table, + explode(',', $columns), + $data + ); + } + } + } + /** * Get attribute of given entity type * * @param string $entityType + * @return array */ - private function getEntityAttributes(string $entityType) + private function getEntityAttributes(string $entityType): array { $metadata = $this->metadataPool->getMetadata($entityType); $eavEntityType = $metadata->getEavEntityType(); diff --git a/app/code/Magento/Eav/view/adminhtml/web/js/input-types.js b/app/code/Magento/Eav/view/adminhtml/web/js/input-types.js index 250bea09adf4..c4a0e84cf7d6 100644 --- a/app/code/Magento/Eav/view/adminhtml/web/js/input-types.js +++ b/app/code/Magento/Eav/view/adminhtml/web/js/input-types.js @@ -71,7 +71,7 @@ define([ // Check current type (allow only compatible types) if (~enabledTypes.indexOf(currentValue)) { // Enable select and keep only available options (all other will be removed) - select.removeAttr('disabled').find('option').each(removeOption); + select.prop('disabled', false).find('option').each(removeOption); // Add warning on page and event for show/hide it select.after(warning).on('change', toggleWarning); } diff --git a/app/code/Magento/EavGraphQl/Model/Resolver/CustomAttributeMetadata.php b/app/code/Magento/EavGraphQl/Model/Resolver/CustomAttributeMetadata.php index 85445580bb1f..0ebeca292975 100644 --- a/app/code/Magento/EavGraphQl/Model/Resolver/CustomAttributeMetadata.php +++ b/app/code/Magento/EavGraphQl/Model/Resolver/CustomAttributeMetadata.php @@ -9,13 +9,14 @@ use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\EavGraphQl\Model\Resolver\Query\Type; -use Magento\EavGraphQl\Model\Resolver\Query\FrontendType; +use Magento\EavGraphQl\Model\Resolver\Query\Attribute; use Magento\Framework\Exception\InputException; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Eav\Api\Data\AttributeInterface; /** * Resolve data for custom attribute metadata requests @@ -28,18 +29,18 @@ class CustomAttributeMetadata implements ResolverInterface private $type; /** - * @var FrontendType + * @var Attribute */ - private $frontendType; + private $attribute; /** * @param Type $type - * @param FrontendType $frontendType + * @param Attribute $attribute */ - public function __construct(Type $type, FrontendType $frontendType) + public function __construct(Type $type, Attribute $attribute) { $this->type = $type; - $this->frontendType = $frontendType; + $this->attribute = $attribute; } /** @@ -54,19 +55,22 @@ public function resolve( ) { $attributes['items'] = null; $attributeInputs = $args['attributes']; - foreach ($attributeInputs as $attribute) { - if (!isset($attribute['attribute_code']) || !isset($attribute['entity_type'])) { - $attributes['items'][] = $this->createInputException($attribute); + foreach ($attributeInputs as $attributeInput) { + if (!isset($attributeInput['attribute_code']) || !isset($attributeInput['entity_type'])) { + $attributes['items'][] = $this->createInputException($attributeInput); continue; } try { - $frontendType = $this->frontendType->getType($attribute['attribute_code'], $attribute['entity_type']); - $type = $this->type->getType($attribute['attribute_code'], $attribute['entity_type']); + $attribute = $this->attribute->getAttribute( + $attributeInput['attribute_code'], + $attributeInput['entity_type'] + ); + $type = $this->type->getType($attributeInput['attribute_code'], $attributeInput['entity_type']); } catch (InputException $exception) { $attributes['items'][] = new GraphQlNoSuchEntityException( __( 'Attribute code %1 of entity type %2 not configured to have a type.', - [$attribute['attribute_code'], $attribute['entity_type']] + [$attributeInput['attribute_code'], $attributeInput['entity_type']] ) ); continue; @@ -74,7 +78,7 @@ public function resolve( $attributes['items'][] = new GraphQlInputException( __( 'Invalid entity_type specified: %1', - [$attribute['entity_type']] + [$attributeInput['entity_type']] ) ); continue; @@ -85,16 +89,48 @@ public function resolve( } $attributes['items'][] = [ - 'attribute_code' => $attribute['attribute_code'], - 'entity_type' => $attribute['entity_type'], + 'attribute_code' => $attributeInput['attribute_code'], + 'entity_type' => $attributeInput['entity_type'], 'attribute_type' => ucfirst($type), - 'input_type' => $frontendType + 'input_type' => isset($attribute) ? $attribute->getFrontendInput() : null, + 'storefront_properties' => isset($attribute) ?$this->getStorefrontProperties($attribute) : null ]; } return $attributes; } + /** + * Format storefront properties + * + * @param AttributeInterface $attribute + * @return array + */ + private function getStorefrontProperties(AttributeInterface $attribute) + { + return [ + 'position'=> $attribute->getPosition(), + 'visible_on_catalog_pages'=> $attribute->getIsVisibleOnFront(), + 'use_in_search_results_layered_navigation' => $attribute->getIsFilterableInSearch(), + 'use_in_product_listing'=> $attribute->getUsedInProductListing(), + 'use_in_layered_navigation'=> + $this->getLayeredNavigationPropertiesEnum()[$attribute->getisFilterable()] ?? null + ]; + } + + /** + * Return enum for resolving use in layered navigation + * + * @return string[] + */ + private function getLayeredNavigationPropertiesEnum() { + return [ + 0 => 'NO', + 1 => 'FILTERABLE_WITH_RESULTS', + 2 => 'FILTERABLE_NO_RESULT' + ]; + } + /** * Create GraphQL input exception for an invalid attribute input * diff --git a/app/code/Magento/EavGraphQl/Model/Resolver/Query/Attribute.php b/app/code/Magento/EavGraphQl/Model/Resolver/Query/Attribute.php new file mode 100644 index 000000000000..b26223f97983 --- /dev/null +++ b/app/code/Magento/EavGraphQl/Model/Resolver/Query/Attribute.php @@ -0,0 +1,62 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\EavGraphQl\Model\Resolver\Query; + +use Magento\Eav\Api\AttributeRepositoryInterface; +use Magento\Eav\Api\Data\AttributeInterface; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Webapi\ServiceTypeToEntityTypeMap; + +/** + * Get frontend input type for EAV attribute + */ +class Attribute +{ + /** + * @var AttributeRepositoryInterface + */ + private $attributeRepository; + + /** + * @var ServiceTypeToEntityTypeMap + */ + private $serviceTypeMap; + + /** + * @param AttributeRepositoryInterface $attributeRepository + * @param ServiceTypeToEntityTypeMap $serviceTypeMap + */ + public function __construct( + AttributeRepositoryInterface $attributeRepository, + ServiceTypeToEntityTypeMap $serviceTypeMap + ) { + $this->attributeRepository = $attributeRepository; + $this->serviceTypeMap = $serviceTypeMap; + } + + /** + * Return frontend type for attribute + * + * @param string $attributeCode + * @param string $entityType + * @return null | AttributeInterface + */ + public function getAttribute(string $attributeCode, string $entityType): ?AttributeInterface + { + $mappedEntityType = $this->serviceTypeMap->getEntityType($entityType); + if ($mappedEntityType) { + $entityType = $mappedEntityType; + } + try { + $attribute = $this->attributeRepository->get($entityType, $attributeCode); + } catch (NoSuchEntityException $e) { + return null; + } + return $attribute; + } +} diff --git a/app/code/Magento/EavGraphQl/Model/Resolver/Query/FrontendType.php b/app/code/Magento/EavGraphQl/Model/Resolver/Query/FrontendType.php deleted file mode 100644 index c76f19e6dfeb..000000000000 --- a/app/code/Magento/EavGraphQl/Model/Resolver/Query/FrontendType.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\EavGraphQl\Model\Resolver\Query; - -use Magento\Eav\Api\AttributeRepositoryInterface; -use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Framework\Webapi\ServiceTypeToEntityTypeMap; - -/** - * Get frontend input type for EAV attribute - */ -class FrontendType -{ - /** - * @var AttributeRepositoryInterface - */ - private $attributeRepository; - - /** - * @var ServiceTypeToEntityTypeMap - */ - private $serviceTypeMap; - - /** - * @param AttributeRepositoryInterface $attributeRepository - * @param ServiceTypeToEntityTypeMap $serviceTypeMap - */ - public function __construct( - AttributeRepositoryInterface $attributeRepository, - ServiceTypeToEntityTypeMap $serviceTypeMap - ) { - $this->attributeRepository = $attributeRepository; - $this->serviceTypeMap = $serviceTypeMap; - } - - /** - * Return frontend type for attribute - * - * @param string $attributeCode - * @param string $entityType - * @return null|string - */ - public function getType(string $attributeCode, string $entityType): ?string - { - $mappedEntityType = $this->serviceTypeMap->getEntityType($entityType); - if ($mappedEntityType) { - $entityType = $mappedEntityType; - } - try { - $attribute = $this->attributeRepository->get($entityType, $attributeCode); - } catch (NoSuchEntityException $e) { - return null; - } - return $attribute->getFrontendInput(); - } -} diff --git a/app/code/Magento/EavGraphQl/etc/schema.graphqls b/app/code/Magento/EavGraphQl/etc/schema.graphqls index 21aa7001fab2..c41fde7c7144 100644 --- a/app/code/Magento/EavGraphQl/etc/schema.graphqls +++ b/app/code/Magento/EavGraphQl/etc/schema.graphqls @@ -15,6 +15,21 @@ type Attribute @doc(description: "Attribute contains the attribute_type of the s attribute_type: String @doc(description: "The data type of the attribute") input_type: String @doc(description: "The frontend input type of the attribute") attribute_options: [AttributeOption] @resolver(class: "Magento\\EavGraphQl\\Model\\Resolver\\AttributeOptions") @doc(description: "Attribute options list.") + storefront_properties: StorefrontProperties @doc(description: "Contains details about the storefront properties configured for the attribute") +} + +type StorefrontProperties { + use_in_product_listing: Boolean @doc(description: "Indicates whether the attribute is displayed in product listings") + position: Int @doc(description: "The relative position of the attribute in the layered navigation block") + visible_on_catalog_pages: Boolean @doc(description: "Indicates whether the attribute is displayed on product pages") + use_in_layered_navigation: UseInLayeredNavigationOptions @doc(description: "Indicates whether the attribute is filterable with results, without results, or not at all") + use_in_search_results_layered_navigation: Boolean @doc(description: "Indicates whether the attribute can be used in layered navigation on search results pages") +} + +enum UseInLayeredNavigationOptions { + NO + FILTERABLE_WITH_RESULTS + FILTERABLE_NO_RESULT } type AttributeOption @doc(description: "Attribute option.") { diff --git a/app/code/Magento/Elasticsearch/Model/Adapter/Index/Builder.php b/app/code/Magento/Elasticsearch/Model/Adapter/Index/Builder.php index 1cad781ad6d7..f5a70d2d0953 100644 --- a/app/code/Magento/Elasticsearch/Model/Adapter/Index/Builder.php +++ b/app/code/Magento/Elasticsearch/Model/Adapter/Index/Builder.php @@ -63,6 +63,15 @@ public function build() ), 'char_filter' => array_keys($charFilter) ], + // this analyzer must not include stemmer filter + 'prefix_search' => [ + 'type' => 'custom', + 'tokenizer' => key($tokenizer), + 'filter' => array_merge( + ['lowercase', 'keyword_repeat'] + ), + 'char_filter' => array_keys($charFilter) + ], 'sku' => [ 'type' => 'custom', 'tokenizer' => 'keyword', @@ -70,6 +79,14 @@ public function build() ['lowercase', 'keyword_repeat'], array_keys($filter) ), + ], + // this analyzer must not include stemmer filter + 'sku_prefix_search' => [ + 'type' => 'custom', + 'tokenizer' => 'keyword', + 'filter' => array_merge( + ['lowercase', 'keyword_repeat'] + ), ] ], 'tokenizer' => $tokenizer, diff --git a/app/code/Magento/Elasticsearch/Model/Indexer/IndexerHandler.php b/app/code/Magento/Elasticsearch/Model/Indexer/IndexerHandler.php index 90e21e9e3ea1..6a780f43025d 100644 --- a/app/code/Magento/Elasticsearch/Model/Indexer/IndexerHandler.php +++ b/app/code/Magento/Elasticsearch/Model/Indexer/IndexerHandler.php @@ -5,8 +5,11 @@ */ namespace Magento\Elasticsearch\Model\Indexer; +use Magento\CatalogSearch\Model\Indexer\Fulltext; use Magento\Elasticsearch\Model\Adapter\Elasticsearch as ElasticsearchAdapter; use Magento\Elasticsearch\Model\Adapter\Index\IndexNameResolver; +use Magento\Framework\App\DeploymentConfig; +use Magento\Framework\App\ObjectManager; use Magento\Framework\App\ScopeResolverInterface; use Magento\Framework\Indexer\IndexStructureInterface; use Magento\Framework\Indexer\SaveHandler\Batch; @@ -59,6 +62,19 @@ class IndexerHandler implements IndexerInterface private $scopeResolver; /** + * @var DeploymentConfig|null + */ + private $deploymentConfig; + + /** + * Deployment config path + * + * @var string + */ + private const DEPLOYMENT_CONFIG_INDEXER_BATCHES = 'indexer/batch_size/'; + + /** + * IndexerHandler constructor. * @param IndexStructureInterface $indexStructure * @param ElasticsearchAdapter $adapter * @param IndexNameResolver $indexNameResolver @@ -66,6 +82,7 @@ class IndexerHandler implements IndexerInterface * @param ScopeResolverInterface $scopeResolver * @param array $data * @param int $batchSize + * @param DeploymentConfig|null $deploymentConfig */ public function __construct( IndexStructureInterface $indexStructure, @@ -74,7 +91,8 @@ public function __construct( Batch $batch, ScopeResolverInterface $scopeResolver, array $data = [], - $batchSize = self::DEFAULT_BATCH_SIZE + $batchSize = self::DEFAULT_BATCH_SIZE, + ?DeploymentConfig $deploymentConfig = null ) { $this->indexStructure = $indexStructure; $this->adapter = $adapter; @@ -83,6 +101,7 @@ public function __construct( $this->data = $data; $this->batchSize = $batchSize; $this->scopeResolver = $scopeResolver; + $this->deploymentConfig = $deploymentConfig ?: ObjectManager::getInstance()->get(DeploymentConfig::class); } /** @@ -92,6 +111,11 @@ public function saveIndex($dimensions, \Traversable $documents) { $dimension = current($dimensions); $scopeId = $this->scopeResolver->getScope($dimension->getValue())->getId(); + + $this->batchSize = $this->deploymentConfig->get( + self::DEPLOYMENT_CONFIG_INDEXER_BATCHES . Fulltext::INDEXER_ID . '/elastic_save' + ) ?? $this->batchSize; + foreach ($this->batch->getItems($documents, $this->batchSize) as $documentsBatch) { $docs = $this->adapter->prepareDocsPerStore($documentsBatch, $scopeId); $this->adapter->addDocs($docs, $scopeId, $this->getIndexerId()); diff --git a/app/code/Magento/Elasticsearch/Model/ResourceModel/Index.php b/app/code/Magento/Elasticsearch/Model/ResourceModel/Index.php index d75bb9c8ccd3..7cc248294694 100644 --- a/app/code/Magento/Elasticsearch/Model/ResourceModel/Index.php +++ b/app/code/Magento/Elasticsearch/Model/ResourceModel/Index.php @@ -6,6 +6,7 @@ namespace Magento\Elasticsearch\Model\ResourceModel; use Magento\Catalog\Model\Indexer\Product\Price\DimensionCollectionFactory; +use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Model\ResourceModel\Db\Context; use Magento\Store\Model\StoreManagerInterface; use Magento\Catalog\Api\ProductRepositoryInterface; @@ -137,7 +138,11 @@ public function getFullCategoryProductIndexData($storeId = null, $productIds = n foreach ($categoryPositions as $productId => $positions) { foreach ($positions as $categoryId => $position) { - $category = $this->categoryRepository->get($categoryId, $storeId); + try { + $category = $this->categoryRepository->get($categoryId, $storeId); + } catch (NoSuchEntityException $e) { + continue; + } $categoryName = $category->getName(); $categoryData[$productId][] = [ 'id' => $categoryId, diff --git a/app/code/Magento/Elasticsearch/SearchAdapter/Dynamic/DataProvider.php b/app/code/Magento/Elasticsearch/SearchAdapter/Dynamic/DataProvider.php index 7bc64b59ffe7..594fa2fc4915 100644 --- a/app/code/Magento/Elasticsearch/SearchAdapter/Dynamic/DataProvider.php +++ b/app/code/Magento/Elasticsearch/SearchAdapter/Dynamic/DataProvider.php @@ -7,6 +7,8 @@ use Magento\Elasticsearch\SearchAdapter\QueryAwareInterface; use Magento\Elasticsearch\SearchAdapter\QueryContainer; +use Magento\Framework\App\ObjectManager; +use Psr\Log\LoggerInterface; /** * Elastic search data provider @@ -83,6 +85,11 @@ class DataProvider implements \Magento\Framework\Search\Dynamic\DataProviderInte */ private $queryContainer; + /** + * @var LoggerInterface + */ + private $logger; + /** * @param \Magento\Elasticsearch\SearchAdapter\ConnectionManager $connectionManager * @param \Magento\Elasticsearch\Model\Adapter\FieldMapperInterface $fieldMapper @@ -94,7 +101,7 @@ class DataProvider implements \Magento\Framework\Search\Dynamic\DataProviderInte * @param string $indexerId * @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver * @param QueryContainer|null $queryContainer - * + * @param LoggerInterface|null $logger * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -107,7 +114,8 @@ public function __construct( \Magento\Elasticsearch\SearchAdapter\SearchIndexNameResolver $searchIndexNameResolver, $indexerId, \Magento\Framework\App\ScopeResolverInterface $scopeResolver, - QueryContainer $queryContainer = null + QueryContainer $queryContainer = null, + LoggerInterface $logger = null ) { $this->connectionManager = $connectionManager; $this->fieldMapper = $fieldMapper; @@ -119,6 +127,7 @@ public function __construct( $this->indexerId = $indexerId; $this->scopeResolver = $scopeResolver; $this->queryContainer = $queryContainer; + $this->logger = $logger ?? ObjectManager::getInstance()->get(LoggerInterface::class); } /** @@ -154,16 +163,19 @@ public function getAggregations(\Magento\Framework\Search\Dynamic\EntityStorage ], ]; - $queryResult = $this->connectionManager->getConnection() - ->query($query); - - if (isset($queryResult['aggregations']['prices'])) { - $aggregations = [ - 'count' => $queryResult['aggregations']['prices']['count'], - 'max' => $queryResult['aggregations']['prices']['max'], - 'min' => $queryResult['aggregations']['prices']['min'], - 'std' => $queryResult['aggregations']['prices']['std_deviation'], - ]; + try { + $queryResult = $this->connectionManager->getConnection() + ->query($query); + if (isset($queryResult['aggregations']['prices'])) { + $aggregations = [ + 'count' => $queryResult['aggregations']['prices']['count'], + 'max' => $queryResult['aggregations']['prices']['max'], + 'min' => $queryResult['aggregations']['prices']['min'], + 'std' => $queryResult['aggregations']['prices']['std_deviation'], + ]; + } + } catch (\Exception $e) { + $this->logger->critical($e); } return $aggregations; @@ -202,8 +214,6 @@ public function getAggregation( $range, \Magento\Framework\Search\Dynamic\EntityStorage $entityStorage ) { - $result = []; - $query = $this->getBasicSearchQuery($entityStorage); $fieldName = $this->fieldMapper->getFieldName($bucket->getField()); @@ -217,11 +227,16 @@ public function getAggregation( ], ]; - $queryResult = $this->connectionManager->getConnection() - ->query($query); - foreach ($queryResult['aggregations']['prices']['buckets'] as $bucket) { - $key = (int)($bucket['key'] / $range + 1); - $result[$key] = $bucket['doc_count']; + $result = []; + try { + $queryResult = $this->connectionManager->getConnection() + ->query($query); + foreach ($queryResult['aggregations']['prices']['buckets'] as $bucket) { + $key = (int)($bucket['key'] / $range + 1); + $result[$key] = $bucket['doc_count']; + } + } catch (\Exception $e) { + $this->logger->critical($e); } return $result; diff --git a/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php b/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php index ac40e4ee3c08..b4ed33fb85f5 100644 --- a/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php +++ b/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php @@ -154,15 +154,18 @@ protected function buildQueries(array $matches, array $queryValue) continue; } $matchCondition = $match['matchCondition'] ?? $condition; + $fields = []; + $fields[$resolvedField] = [ + 'query' => $transformedValue, + 'boost' => $match['boost'] ?? 1, + ]; + if (isset($match['analyzer'])) { + $fields[$resolvedField]['analyzer'] = $match['analyzer']; + } $conditions[] = [ 'condition' => $queryValue['condition'], 'body' => [ - $matchCondition => [ - $resolvedField => [ - 'query' => $transformedValue, - 'boost' => $match['boost'] ?? 1, - ], - ], + $matchCondition => $fields, ], ]; } diff --git a/app/code/Magento/Elasticsearch/Test/Mftf/Suite/SearchEngineElasticsearchSuite.xml b/app/code/Magento/Elasticsearch/Test/Mftf/Suite/SearchEngineElasticsearchSuite.xml index c2c8644a6fcf..98df34b3c011 100644 --- a/app/code/Magento/Elasticsearch/Test/Mftf/Suite/SearchEngineElasticsearchSuite.xml +++ b/app/code/Magento/Elasticsearch/Test/Mftf/Suite/SearchEngineElasticsearchSuite.xml @@ -9,12 +9,8 @@ <suite name="SearchEngineElasticsearchSuite"> <before> <magentoCLI stepKey="setSearchEngineToElasticsearch" command="config:set {{SearchEngineElasticsearchConfigData.path}} {{SearchEngineElasticsearchConfigData.value}}"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after></after> <include> diff --git a/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontCheckAdvancedSearchOnElasticSearchTest.xml b/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontCheckAdvancedSearchOnElasticSearchTest.xml index 1e067f156040..7dce38cd6bab 100644 --- a/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontCheckAdvancedSearchOnElasticSearchTest.xml +++ b/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontCheckAdvancedSearchOnElasticSearchTest.xml @@ -36,9 +36,7 @@ <!-- Reindex invalidated indices after product attribute has been created/deleted --> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushFullPageCache"> - <argument name="tags" value="full_page"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushFullPageCache"/> </before> <after> diff --git a/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontProductQuickSearchWithDecimalAttributeUsingElasticSearchTest.xml b/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontProductQuickSearchWithDecimalAttributeUsingElasticSearchTest.xml index 1c4d53b27366..baeb70ae3cb8 100644 --- a/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontProductQuickSearchWithDecimalAttributeUsingElasticSearchTest.xml +++ b/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontProductQuickSearchWithDecimalAttributeUsingElasticSearchTest.xml @@ -54,10 +54,7 @@ <deleteData createDataKey="newCategory" stepKey="deleteCategory"/> <!--Delete attribute--> <deleteData createDataKey="customAttribute" stepKey="deleteCustomAttribute"/> - <!--Reindex and clear cache--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> <argument name="tags" value=""/> </actionGroup> @@ -80,10 +77,7 @@ <argument name="product" value="$$product2.sku$$"/> </actionGroup> - <!--Reindex and clear cache--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Dynamic/DataProviderTest.php b/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Dynamic/DataProviderTest.php index 0595b667f4ee..c19371fe9c5a 100644 --- a/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Dynamic/DataProviderTest.php +++ b/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Dynamic/DataProviderTest.php @@ -281,6 +281,19 @@ public function testGetAggregations() ); } + public function testGetAggregationsWithException() + { + $this->queryContainer->expects($this->once()) + ->method('getQuery') + ->willReturn([]); + $this->clientMock->expects($this->once()) + ->method('query') + ->willThrowException(new \Exception()); + + $result = $this->model->getAggregations($this->entityStorage); + $this->assertIsArray($result); + } + /** * Test getInterval() method */ @@ -383,6 +396,22 @@ public function testGetAggregation() ); } + public function testGetAggregationWithException() + { + $bucket = $this->createMock(BucketInterface::class); + $dimension = $this->createMock(Dimension::class); + + $this->queryContainer->expects($this->once()) + ->method('getQuery') + ->willReturn([]); + $this->clientMock->expects($this->once()) + ->method('query') + ->willThrowException(new \Exception()); + + $result = $this->model->getAggregation($bucket, [$dimension], 10, $this->entityStorage); + $this->assertIsArray($result); + } + /** * Test prepareData() method */ diff --git a/app/code/Magento/Elasticsearch/composer.json b/app/code/Magento/Elasticsearch/composer.json index b79ae7bc5cc4..6bc6022cfc82 100644 --- a/app/code/Magento/Elasticsearch/composer.json +++ b/app/code/Magento/Elasticsearch/composer.json @@ -12,7 +12,7 @@ "magento/module-store": "*", "magento/module-catalog-inventory": "*", "magento/framework": "*", - "elasticsearch/elasticsearch": "~7.7.0" + "elasticsearch/elasticsearch": "~7.11.0" }, "suggest": { "magento/module-config": "*" diff --git a/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml b/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml index 1727e5137138..d6e896144cec 100644 --- a/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml +++ b/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml @@ -68,7 +68,7 @@ <depends> <field id="engine">elasticsearch5</field> </depends> - <comment><![CDATA[<a href="https://docs.magento.com/m2/ce/user_guide/catalog/search-elasticsearch.html">Learn more</a> about valid syntax.]]></comment> + <comment><![CDATA[<a href="https://docs.magento.com/user-guide/catalog/search-elasticsearch.html">Learn more</a> about valid syntax.]]></comment> <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> </field> </group> diff --git a/app/code/Magento/Elasticsearch/etc/di.xml b/app/code/Magento/Elasticsearch/etc/di.xml index edec07cb5d51..f3c109f83025 100644 --- a/app/code/Magento/Elasticsearch/etc/di.xml +++ b/app/code/Magento/Elasticsearch/etc/di.xml @@ -383,12 +383,12 @@ <virtualType name="elasticsearch5FieldNameResolver" type="\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CompositeResolver"> <arguments> <argument name="items" xsi:type="array"> - <item name="notEav" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\NotEavAttribute</item> - <item name="special" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\SpecialAttribute</item> - <item name="price" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Price</item> - <item name="categoryName" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CategoryName</item> - <item name="position" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Position</item> - <item name="default" xsi:type="object">elasticsearch5FieldNameDefaultResolver</item> + <item name="notEav" xsi:type="object" sortOrder="10">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\NotEavAttribute</item> + <item name="special" xsi:type="object" sortOrder="20">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\SpecialAttribute</item> + <item name="price" xsi:type="object" sortOrder="30">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Price</item> + <item name="categoryName" xsi:type="object" sortOrder="40">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CategoryName</item> + <item name="position" xsi:type="object" sortOrder="50">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Position</item> + <item name="default" xsi:type="object" sortOrder="100">elasticsearch5FieldNameDefaultResolver</item> </argument> </arguments> </virtualType> @@ -401,21 +401,21 @@ <type name="Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\CompositeResolver"> <arguments> <argument name="items" xsi:type="array"> - <item name="integer" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\IntegerType</item> - <item name="datetime" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\DateTimeType</item> - <item name="float" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\FloatType</item> - <item name="default" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\DefaultResolver</item> + <item name="integer" xsi:type="object" sortOrder="10">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\IntegerType</item> + <item name="datetime" xsi:type="object" sortOrder="20">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\DateTimeType</item> + <item name="float" xsi:type="object" sortOrder="30">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\FloatType</item> + <item name="default" xsi:type="object" sortOrder="100">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\DefaultResolver</item> </argument> </arguments> </type> <type name="Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\CompositeResolver"> <arguments> <argument name="items" xsi:type="array"> - <item name="keyword" xsi:type="object">\Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\KeywordType</item> - <item name="integer" xsi:type="object">\Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\IntegerType</item> - <item name="datetime" xsi:type="object">elasticsearch5FieldTypeDateTimeResolver</item> - <item name="float" xsi:type="object">elasticsearch5FieldTypeFloatResolver</item> - <item name="default" xsi:type="object">elasticsearch5FieldTypeDefaultResolver</item> + <item name="keyword" xsi:type="object" sortOrder="10">\Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\KeywordType</item> + <item name="integer" xsi:type="object" sortOrder="20">\Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\IntegerType</item> + <item name="datetime" xsi:type="object" sortOrder="30">elasticsearch5FieldTypeDateTimeResolver</item> + <item name="float" xsi:type="object" sortOrder="40">elasticsearch5FieldTypeFloatResolver</item> + <item name="default" xsi:type="object" sortOrder="100">elasticsearch5FieldTypeDefaultResolver</item> </argument> </arguments> </type> @@ -506,6 +506,7 @@ <item name="default" xsi:type="object">Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\TextTransformer</item> <item name="date" xsi:type="object">Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\DateTransformer</item> <item name="float" xsi:type="object">Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\FloatTransformer</item> + <item name="double" xsi:type="object">Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\FloatTransformer</item> <item name="integer" xsi:type="object">Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\IntegerTransformer</item> </argument> </arguments> diff --git a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticSearchForChineseLocaleTest.xml b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticSearchForChineseLocaleTest.xml index 75e355126ff2..79566e42c5af 100644 --- a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticSearchForChineseLocaleTest.xml +++ b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticSearchForChineseLocaleTest.xml @@ -26,9 +26,7 @@ <magentoCLI command="config:set --scope={{GeneralLocalCodeConfigsForChina.scope}} --scope-code={{GeneralLocalCodeConfigsForChina.scope_code}} {{GeneralLocalCodeConfigsForChina.path}} {{GeneralLocalCodeConfigsForChina.value}}" stepKey="setLocaleToChina"/> <comment userInput="Moved to appropriate test suite" stepKey="enableElasticsearch6"/> <comment userInput="Moved to appropriate test suite" stepKey="checkConnection"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <createData entity="ApiCategory" stepKey="createCategory"/> <createData entity="ApiSimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> diff --git a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearchSearchInvalidValueTest.xml b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearchSearchInvalidValueTest.xml index 627105751507..9d2eefd23d71 100644 --- a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearchSearchInvalidValueTest.xml +++ b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearchSearchInvalidValueTest.xml @@ -25,13 +25,8 @@ <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!--Set Minimal Query Length--> <magentoCLI command="config:set {{SetMinQueryLength2Config.path}} {{SetMinQueryLength2Config.value}}" stepKey="setMinQueryLength"/> - <!--Reindex indexes and clear cache--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value="catalogsearch_fulltext"/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!--Set configs to default--> @@ -50,12 +45,8 @@ <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="goToProductCatalog"/> <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteProduct"/> <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetFiltersIfExist"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value="catalogsearch_fulltext"/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <!--Create new searchable product attribute--> @@ -85,13 +76,8 @@ </actionGroup> <fillField selector="{{AdminProductFormSection.attributeRequiredInput(textProductAttribute.attribute_code)}}" userInput="searchable" stepKey="fillTheAttributeRequiredInputField"/> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton"/> - <!-- TODO: REMOVE AFTER FIX MC-21717 --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value="eav"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Assert search results on storefront--> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefrontPage"/> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchForFirstSearchTerm"> diff --git a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontProductQuickSearchUsingElasticSearchTest.xml b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontProductQuickSearchUsingElasticSearchTest.xml index 653c46073397..ef84482d342a 100644 --- a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontProductQuickSearchUsingElasticSearchTest.xml +++ b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontProductQuickSearchUsingElasticSearchTest.xml @@ -31,9 +31,7 @@ </createData> <magentoCLI command="config:set {{CustomGridPerPageValuesConfigData.path}} {{CustomGridPerPageValuesConfigData.value}}" stepKey="setCustomGridPerPageValues"/> <magentoCLI command="config:set {{CustomGridPerPageDefaultConfigData.path}} {{CustomGridPerPageDefaultConfigData.value}}" stepKey="setCustomGridPerPageDefaults"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushConfigCache"/> <magentoCron groups="index" stepKey="runCronIndex"/> </before> diff --git a/app/code/Magento/Elasticsearch6/composer.json b/app/code/Magento/Elasticsearch6/composer.json index 1ee92c0b0a3b..daf6c337b870 100644 --- a/app/code/Magento/Elasticsearch6/composer.json +++ b/app/code/Magento/Elasticsearch6/composer.json @@ -8,7 +8,7 @@ "magento/module-catalog-search": "*", "magento/module-search": "*", "magento/module-elasticsearch": "*", - "elasticsearch/elasticsearch": "~7.7.0" + "elasticsearch/elasticsearch": "~7.11.0" }, "suggest": { "magento/module-config": "*" diff --git a/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml b/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml index fee234ada43b..5907442d28a0 100644 --- a/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml +++ b/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml @@ -76,7 +76,7 @@ <depends> <field id="engine">elasticsearch6</field> </depends> - <comment><![CDATA[<a href="https://docs.magento.com/m2/ce/user_guide/catalog/search-elasticsearch.html">Learn more</a> about valid syntax.]]></comment> + <comment><![CDATA[<a href="https://docs.magento.com/user-guide/catalog/search-elasticsearch.html">Learn more</a> about valid syntax.]]></comment> <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> </field> </group> diff --git a/app/code/Magento/Elasticsearch6/etc/di.xml b/app/code/Magento/Elasticsearch6/etc/di.xml index e60f331f9ee8..bb6fe436e620 100644 --- a/app/code/Magento/Elasticsearch6/etc/di.xml +++ b/app/code/Magento/Elasticsearch6/etc/di.xml @@ -144,12 +144,12 @@ <virtualType name="elasticsearch6FieldNameResolver" type="\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CompositeResolver"> <arguments> <argument name="items" xsi:type="array"> - <item name="notEav" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\NotEavAttribute</item> - <item name="special" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\SpecialAttribute</item> - <item name="price" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Price</item> - <item name="categoryName" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CategoryName</item> - <item name="position" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Position</item> - <item name="default" xsi:type="object">\Magento\Elasticsearch6\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\DefaultResolver</item> + <item name="notEav" xsi:type="object" sortOrder="10">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\NotEavAttribute</item> + <item name="special" xsi:type="object" sortOrder="20">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\SpecialAttribute</item> + <item name="price" xsi:type="object" sortOrder="30">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Price</item> + <item name="categoryName" xsi:type="object" sortOrder="40">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CategoryName</item> + <item name="position" xsi:type="object" sortOrder="50">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Position</item> + <item name="default" xsi:type="object" sortOrder="100">\Magento\Elasticsearch6\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\DefaultResolver</item> </argument> </arguments> </virtualType> diff --git a/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/IntegerMapper.php b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/IntegerMapper.php new file mode 100644 index 000000000000..f2ccdbeed0cd --- /dev/null +++ b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/IntegerMapper.php @@ -0,0 +1,31 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch7\Model\Adapter\DynamicTemplates; + +/** + * @inheridoc + */ +class IntegerMapper implements MapperInterface +{ + /** + * @inheridoc + */ + public function processTemplates(array $templates): array + { + $templates[] = [ + 'integer_mapping' => [ + 'match_mapping_type' => 'long', + 'mapping' => [ + 'type' => 'integer', + ], + ], + ]; + + return $templates; + } +} diff --git a/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/MapperInterface.php b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/MapperInterface.php new file mode 100644 index 000000000000..236eede99cb8 --- /dev/null +++ b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/MapperInterface.php @@ -0,0 +1,22 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch7\Model\Adapter\DynamicTemplates; + +/** + * Elasticsearch dynamic templates mapper. + */ +interface MapperInterface +{ + /** + * Add/remove/edit dynamic template mapping. + * + * @param array $templates + * @return array + */ + public function processTemplates(array $templates): array; +} diff --git a/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/PositionMapper.php b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/PositionMapper.php new file mode 100644 index 000000000000..ac290e82ea91 --- /dev/null +++ b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/PositionMapper.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch7\Model\Adapter\DynamicTemplates; + +/** + * @inheridoc + */ +class PositionMapper implements MapperInterface +{ + /** + * @inheridoc + */ + public function processTemplates(array $templates): array + { + $templates[] = [ + 'position_mapping' => [ + 'match' => 'position_*', + 'match_mapping_type' => 'string', + 'mapping' => [ + 'type' => 'integer', + 'index' => true, + ], + ], + ]; + + return $templates; + } +} diff --git a/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/PriceMapper.php b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/PriceMapper.php new file mode 100644 index 000000000000..3c73cb28fe77 --- /dev/null +++ b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/PriceMapper.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch7\Model\Adapter\DynamicTemplates; + +/** + * @inheridoc + */ +class PriceMapper implements MapperInterface +{ + /** + * @inheridoc + */ + public function processTemplates(array $templates): array + { + $templates[] = [ + 'price_mapping' => [ + 'match' => 'price_*', + 'match_mapping_type' => 'string', + 'mapping' => [ + 'type' => 'double', + 'store' => true, + ], + ], + ]; + + return $templates; + } +} diff --git a/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/StringMapper.php b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/StringMapper.php new file mode 100644 index 000000000000..71a490976949 --- /dev/null +++ b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/StringMapper.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch7\Model\Adapter\DynamicTemplates; + +/** + * @inheridoc + */ +class StringMapper implements MapperInterface +{ + /** + * @inheridoc + */ + public function processTemplates(array $templates): array + { + $templates[] = [ + 'string_mapping' => [ + 'match' => '*', + 'match_mapping_type' => 'string', + 'mapping' => [ + 'type' => 'text', + 'index' => true, + 'copy_to' => '_search', + ], + ], + ]; + + return $templates; + } +} diff --git a/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplatesProvider.php b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplatesProvider.php new file mode 100644 index 000000000000..a5199fe06249 --- /dev/null +++ b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplatesProvider.php @@ -0,0 +1,51 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch7\Model\Adapter; + +use Magento\Elasticsearch7\Model\Adapter\DynamicTemplates\MapperInterface; +use Magento\Framework\Exception\InvalidArgumentException; + +/** + * Elasticsearch dynamic templates provider. + */ +class DynamicTemplatesProvider +{ + /** + * @var array + */ + private $mappers; + + /** + * @param MapperInterface[] $mappers + */ + public function __construct(array $mappers) + { + $this->mappers = $mappers; + } + + /** + * Get elasticsearch dynamic templates. + * + * @return array + * @throws InvalidArgumentException + */ + public function getTemplates(): array + { + $templates = []; + foreach ($this->mappers as $mapper) { + if (!$mapper instanceof MapperInterface) { + throw new InvalidArgumentException( + __('Mapper %1 should implement %2', get_class($mapper), MapperInterface::class) + ); + } + $templates = $mapper->processTemplates($templates); + } + + return $templates; + } +} diff --git a/app/code/Magento/Elasticsearch7/Model/Client/Elasticsearch.php b/app/code/Magento/Elasticsearch7/Model/Client/Elasticsearch.php index d193c8aa108c..87b9f7c93a65 100644 --- a/app/code/Magento/Elasticsearch7/Model/Client/Elasticsearch.php +++ b/app/code/Magento/Elasticsearch7/Model/Client/Elasticsearch.php @@ -7,9 +7,11 @@ namespace Magento\Elasticsearch7\Model\Client; +use Magento\AdvancedSearch\Model\Client\ClientInterface; use Magento\Elasticsearch\Model\Adapter\FieldsMappingPreprocessorInterface; +use Magento\Elasticsearch7\Model\Adapter\DynamicTemplatesProvider; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\LocalizedException; -use Magento\AdvancedSearch\Model\Client\ClientInterface; /** * Elasticsearch client @@ -38,18 +40,25 @@ class Elasticsearch implements ClientInterface */ private $fieldsMappingPreprocessors; + /** + * @var DynamicTemplatesProvider|null + */ + private $dynamicTemplatesProvider; + /** * Initialize Elasticsearch 7 Client * * @param array $options * @param \Elasticsearch\Client|null $elasticsearchClient * @param array $fieldsMappingPreprocessors + * @param DynamicTemplatesProvider|null $dynamicTemplatesProvider * @throws LocalizedException */ public function __construct( $options = [], $elasticsearchClient = null, - $fieldsMappingPreprocessors = [] + $fieldsMappingPreprocessors = [], + ?DynamicTemplatesProvider $dynamicTemplatesProvider = null ) { if (empty($options['hostname']) || ((!empty($options['enableAuth']) && ($options['enableAuth'] == 1)) @@ -65,6 +74,8 @@ public function __construct( } $this->clientOptions = $options; $this->fieldsMappingPreprocessors = $fieldsMappingPreprocessors; + $this->dynamicTemplatesProvider = $dynamicTemplatesProvider ?: ObjectManager::getInstance() + ->get(DynamicTemplatesProvider::class); } /** @@ -235,8 +246,8 @@ public function updateAlias(string $alias, string $newIndex, string $oldIndex = { $params = [ 'body' => [ - 'actions' => [] - ] + 'actions' => [], + ], ]; if ($oldIndex) { $params['body']['actions'][] = ['remove' => ['alias' => $alias, 'index' => $oldIndex]]; @@ -304,47 +315,7 @@ public function addFieldsMapping(array $fields, string $index, string $entityTyp 'body' => [ $entityType => [ 'properties' => [], - 'dynamic_templates' => [ - [ - 'price_mapping' => [ - 'match' => 'price_*', - 'match_mapping_type' => 'string', - 'mapping' => [ - 'type' => 'double', - 'store' => true, - ], - ], - ], - [ - 'position_mapping' => [ - 'match' => 'position_*', - 'match_mapping_type' => 'string', - 'mapping' => [ - 'type' => 'integer', - 'index' => true, - ], - ], - ], - [ - 'string_mapping' => [ - 'match' => '*', - 'match_mapping_type' => 'string', - 'mapping' => [ - 'type' => 'text', - 'index' => true, - 'copy_to' => '_search', - ], - ], - ], - [ - 'integer_mapping' => [ - 'match_mapping_type' => 'long', - 'mapping' => [ - 'type' => 'integer', - ], - ], - ], - ], + 'dynamic_templates' => $this->dynamicTemplatesProvider->getTemplates(), ], ], ]; diff --git a/app/code/Magento/Elasticsearch7/Test/Mftf/Test/StorefrontQuickSearchUsingElasticSearchByProductSkuTest.xml b/app/code/Magento/Elasticsearch7/Test/Mftf/Test/StorefrontQuickSearchUsingElasticSearchByProductSkuTest.xml new file mode 100644 index 000000000000..802553f20f7a --- /dev/null +++ b/app/code/Magento/Elasticsearch7/Test/Mftf/Test/StorefrontQuickSearchUsingElasticSearchByProductSkuTest.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontQuickSearchUsingElasticSearchByProductSkuTest"> + <annotations> + <features value="Elasticsearch7"/> + <stories value="Storefront Search"/> + <title value="Check that AND query is performed when searching using ElasticSearch 7"/> + <description value="Check that AND query is performed when searching using ElasticSearch 7"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-31114"/> + <useCaseId value="MC-29788"/> + <group value="SearchEngineElasticsearch"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> + + <createData entity="VirtualProduct" stepKey="createFirtsSimpleProduct"/> + <createData entity="SimpleProductWithCustomSku24MB06" stepKey="createSecondSimpleProduct"/> + <createData entity="SimpleProductWithCustomSku24MB04" stepKey="createThirdSimpleProduct"/> + <createData entity="SimpleProductWithCustomSku24MB02" stepKey="createFourthSimpleProduct"/> + <createData entity="SimpleProductWithCustomSku24MB01" stepKey="createFifthSimpleProduct"/> + + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value=""/> + </actionGroup> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + </before> + <after> + <deleteData createDataKey="createFirtsSimpleProduct" stepKey="deleteProductOne"/> + + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProductsAfterTest"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdminPanel"/> + </after> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByProductSku"> + <argument name="phrase" value="24 MB04"/> + </actionGroup> + + <see userInput="4" selector="{{StorefrontCatalogSearchMainSection.productCount}}" stepKey="assertSearchResultCount"/> + + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="assertSecondProductName"> + <argument name="productName" value="$createSecondSimpleProduct.name$"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="assertThirdProductName"> + <argument name="productName" value="$createThirdSimpleProduct.name$"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="assertFourthProductName"> + <argument name="productName" value="$createFourthSimpleProduct.name$"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="assertFifthProductName"> + <argument name="productName" value="$createFifthSimpleProduct.name$"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Elasticsearch7/Test/Unit/Model/Client/ElasticsearchTest.php b/app/code/Magento/Elasticsearch7/Test/Unit/Model/Client/ElasticsearchTest.php index 3b3cbcfbb15f..100a63e9bef0 100644 --- a/app/code/Magento/Elasticsearch7/Test/Unit/Model/Client/ElasticsearchTest.php +++ b/app/code/Magento/Elasticsearch7/Test/Unit/Model/Client/ElasticsearchTest.php @@ -12,6 +12,11 @@ use Elasticsearch\Namespaces\IndicesNamespace; use Magento\AdvancedSearch\Model\Client\ClientInterface as ElasticsearchClient; use Magento\Elasticsearch\Model\Adapter\FieldMapper\AddDefaultSearchField; +use Magento\Elasticsearch7\Model\Adapter\DynamicTemplates\IntegerMapper; +use Magento\Elasticsearch7\Model\Adapter\DynamicTemplates\PositionMapper; +use Magento\Elasticsearch7\Model\Adapter\DynamicTemplates\PriceMapper; +use Magento\Elasticsearch7\Model\Adapter\DynamicTemplates\StringMapper; +use Magento\Elasticsearch7\Model\Adapter\DynamicTemplatesProvider; use Magento\Elasticsearch7\Model\Client\Elasticsearch; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; @@ -93,12 +98,21 @@ protected function setUp(): void ->willReturn(['version' => ['number' => '7.0.0']]); $this->objectManager = new ObjectManagerHelper($this); + $dynamicTemplatesProvider = new DynamicTemplatesProvider( + [ + new PriceMapper(), + new PositionMapper(), + new StringMapper(), + new IntegerMapper(), + ] + ); $this->model = $this->objectManager->getObject( Elasticsearch::class, [ 'options' => $this->getOptions(), 'elasticsearchClient' => $this->elasticsearchClientMock, - 'fieldsMappingPreprocessors' => [new AddDefaultSearchField()] + 'fieldsMappingPreprocessors' => [new AddDefaultSearchField()], + 'dynamicTemplatesProvider' => $dynamicTemplatesProvider, ] ); } @@ -109,7 +123,7 @@ public function testConstructorOptionsException() $result = $this->objectManager->getObject( Elasticsearch::class, [ - 'options' => [] + 'options' => [], ] ); $this->assertNotNull($result); @@ -123,7 +137,7 @@ public function testConstructorWithOptions() $result = $this->objectManager->getObject( Elasticsearch::class, [ - 'options' => $this->getOptions() + 'options' => $this->getOptions(), ] ); $this->assertNotNull($result); @@ -177,7 +191,7 @@ public function getOptionsDataProvider() 'index' => 'magento2', 'enableAuth' => 0, ], - 'expected_result' => 'http://localhost:9200' + 'expected_result' => 'http://localhost:9200', ], [ 'with_protocol' => [ @@ -187,8 +201,8 @@ public function getOptionsDataProvider() 'index' => 'magento2', 'enableAuth' => 0, ], - 'expected_result' => 'https://localhost:9200' - ] + 'expected_result' => 'https://localhost:9200', + ], ]; } @@ -228,7 +242,7 @@ public function testTestConnectionPing() Elasticsearch::class, [ 'options' => $this->getEmptyIndexOption(), - 'elasticsearchClient' => $this->elasticsearchClientMock + 'elasticsearchClient' => $this->elasticsearchClientMock, ] ); @@ -627,6 +641,7 @@ public function testGetMapping(): void /** * Test query() method + * * @return void */ public function testQuery() @@ -641,6 +656,7 @@ public function testQuery() /** * Test suggest() method + * * @return void */ public function testSuggest() diff --git a/app/code/Magento/Elasticsearch7/composer.json b/app/code/Magento/Elasticsearch7/composer.json index 1e59ceaebaf8..f14630e87a12 100644 --- a/app/code/Magento/Elasticsearch7/composer.json +++ b/app/code/Magento/Elasticsearch7/composer.json @@ -5,7 +5,7 @@ "php": "~7.3.0||~7.4.0", "magento/framework": "*", "magento/module-elasticsearch": "*", - "elasticsearch/elasticsearch": "~7.7.0", + "elasticsearch/elasticsearch": "~7.11.0", "magento/module-advanced-search": "*", "magento/module-catalog-search": "*" }, diff --git a/app/code/Magento/Elasticsearch7/etc/adminhtml/system.xml b/app/code/Magento/Elasticsearch7/etc/adminhtml/system.xml index 9e818ff61eb8..6b5d3cf36886 100644 --- a/app/code/Magento/Elasticsearch7/etc/adminhtml/system.xml +++ b/app/code/Magento/Elasticsearch7/etc/adminhtml/system.xml @@ -84,7 +84,7 @@ <depends> <field id="engine">elasticsearch7</field> </depends> - <comment><![CDATA[<a href="https://docs.magento.com/m2/ce/user_guide/catalog/search-elasticsearch.html">Learn more</a> about valid syntax.]]></comment> + <comment><![CDATA[<a href="https://docs.magento.com/user-guide/catalog/search-elasticsearch.html">Learn more</a> about valid syntax.]]></comment> <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> </field> </group> diff --git a/app/code/Magento/Elasticsearch7/etc/di.xml b/app/code/Magento/Elasticsearch7/etc/di.xml index 446331edc63f..298d93b21af5 100644 --- a/app/code/Magento/Elasticsearch7/etc/di.xml +++ b/app/code/Magento/Elasticsearch7/etc/di.xml @@ -134,12 +134,12 @@ <virtualType name="\Magento\Elasticsearch7\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CompositeResolver" type="\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CompositeResolver"> <arguments> <argument name="items" xsi:type="array"> - <item name="notEav" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\NotEavAttribute</item> - <item name="special" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\SpecialAttribute</item> - <item name="price" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Price</item> - <item name="categoryName" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CategoryName</item> - <item name="position" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Position</item> - <item name="default" xsi:type="object">Magento\Elasticsearch7\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\DefaultResolver</item> + <item name="notEav" xsi:type="object" sortOrder="10">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\NotEavAttribute</item> + <item name="special" xsi:type="object" sortOrder="20">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\SpecialAttribute</item> + <item name="price" xsi:type="object" sortOrder="30">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Price</item> + <item name="categoryName" xsi:type="object" sortOrder="40">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CategoryName</item> + <item name="position" xsi:type="object" sortOrder="50">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Position</item> + <item name="default" xsi:type="object" sortOrder="100">Magento\Elasticsearch7\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\DefaultResolver</item> </argument> </arguments> </virtualType> @@ -251,4 +251,14 @@ </argument> </arguments> </type> + <type name="Magento\Elasticsearch7\Model\Adapter\DynamicTemplatesProvider"> + <arguments> + <argument name="mappers" xsi:type="array"> + <item name="price_mapping" xsi:type="object">Magento\Elasticsearch7\Model\Adapter\DynamicTemplates\PriceMapper</item> + <item name="position_mapping" xsi:type="object">Magento\Elasticsearch7\Model\Adapter\DynamicTemplates\PositionMapper</item> + <item name="string_mapping" xsi:type="object">Magento\Elasticsearch7\Model\Adapter\DynamicTemplates\StringMapper</item> + <item name="integer_mapping" xsi:type="object">Magento\Elasticsearch7\Model\Adapter\DynamicTemplates\IntegerMapper</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Email/Model/Template/Filter.php b/app/code/Magento/Email/Model/Template/Filter.php index 648e4ab8fc38..18435d85574f 100644 --- a/app/code/Magento/Email/Model/Template/Filter.php +++ b/app/code/Magento/Email/Model/Template/Filter.php @@ -3,15 +3,39 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Email\Model\Template; -use Magento\Framework\App\ObjectManager; +use Exception; +use Magento\Cms\Block\Block; +use Magento\Framework\App\Area; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\State; +use Magento\Framework\Css\PreProcessor\Adapter\CssInliner; +use Magento\Framework\Escaper; use Magento\Framework\Exception\MailException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\Read; +use Magento\Framework\Filter\Template; +use Magento\Framework\Filter\Template\Tokenizer\Parameter; use Magento\Framework\Filter\VariableResolverInterface; +use Magento\Framework\Stdlib\StringUtils; +use Magento\Framework\UrlInterface; use Magento\Framework\View\Asset\ContentProcessorException; use Magento\Framework\View\Asset\ContentProcessorInterface; +use Magento\Framework\View\Asset\File\NotFoundException; +use Magento\Framework\View\Asset\Repository; +use Magento\Framework\View\Element\AbstractBlock; +use Magento\Framework\View\LayoutFactory; +use Magento\Framework\View\LayoutInterface; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\StoreManagerInterface; +use Magento\Variable\Model\Source\Variables; +use Magento\Variable\Model\Variable; +use Magento\Variable\Model\VariableFactory; +use Psr\Log\LoggerInterface; /** * Core Email Template Filter Model @@ -22,7 +46,7 @@ * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @since 100.0.2 */ -class Filter extends \Magento\Framework\Filter\Template +class Filter extends Template { /** * The name used in the {{trans}} directive @@ -89,17 +113,17 @@ class Filter extends \Magento\Framework\Filter\Template private $plainTemplateMode = false; /** - * @var \Magento\Framework\View\Asset\Repository + * @var Repository */ protected $_assetRepo; /** - * @var \Psr\Log\LoggerInterface + * @var LoggerInterface */ protected $_logger; /** - * @var \Magento\Framework\Escaper + * @var Escaper */ protected $_escaper; @@ -107,29 +131,29 @@ class Filter extends \Magento\Framework\Filter\Template * Core store config * Variable factory * - * @var \Magento\Variable\Model\VariableFactory + * @var VariableFactory */ protected $_variableFactory; /** - * @var \Magento\Store\Model\StoreManagerInterface + * @var StoreManagerInterface */ protected $_storeManager; /** - * @var \Magento\Framework\View\LayoutInterface + * @var LayoutInterface */ protected $_layout; /** - * @var \Magento\Framework\View\LayoutFactory + * @var LayoutFactory */ protected $_layoutFactory; /** * Setup callbacks for filters * - * @var \Magento\Framework\App\Config\ScopeConfigInterface + * @var ScopeConfigInterface */ protected $_scopeConfig; @@ -143,28 +167,22 @@ class Filter extends \Magento\Framework\Filter\Template /** * App state * - * @var \Magento\Framework\App\State + * @var State */ protected $_appState; /** - * @var \Magento\Framework\UrlInterface + * @var UrlInterface */ protected $urlModel; /** - * @var \Pelago\Emogrifier - * @deprecated 100.2.0 - */ - protected $emogrifier; - - /** - * @var \Magento\Framework\Css\PreProcessor\Adapter\CssInliner + * @var CssInliner */ private $cssInliner; /** - * @var \Magento\Variable\Model\Source\Variables + * @var Variables */ protected $configVariables; @@ -179,52 +197,52 @@ class Filter extends \Magento\Framework\Filter\Template private $pubDirectory; /** - * @var \Magento\Framework\Filesystem\Directory\Read + * @var Read */ private $pubDirectoryRead; + /** - * @param \Magento\Framework\Stdlib\StringUtils $string - * @param \Psr\Log\LoggerInterface $logger - * @param \Magento\Framework\Escaper $escaper - * @param \Magento\Framework\View\Asset\Repository $assetRepo - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Variable\Model\VariableFactory $coreVariableFactory - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\View\LayoutInterface $layout - * @param \Magento\Framework\View\LayoutFactory $layoutFactory - * @param \Magento\Framework\App\State $appState - * @param \Magento\Framework\UrlInterface $urlModel - * @param \Pelago\Emogrifier $emogrifier - * @param \Magento\Variable\Model\Source\Variables $configVariables + * Filter constructor. + * @param StringUtils $string + * @param LoggerInterface $logger + * @param Escaper $escaper + * @param Repository $assetRepo + * @param ScopeConfigInterface $scopeConfig + * @param VariableFactory $coreVariableFactory + * @param StoreManagerInterface $storeManager + * @param LayoutInterface $layout + * @param LayoutFactory $layoutFactory + * @param State $appState + * @param UrlInterface $urlModel + * @param Variables $configVariables + * @param VariableResolverInterface $variableResolver + * @param Css\Processor $cssProcessor + * @param Filesystem $pubDirectory + * @param CssInliner $cssInliner * @param array $variables - * @param \Magento\Framework\Css\PreProcessor\Adapter\CssInliner|null $cssInliner * @param array $directiveProcessors - * @param VariableResolverInterface|null $variableResolver - * @param Css\Processor|null $cssProcessor - * @param Filesystem|null $pubDirectory * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Framework\Stdlib\StringUtils $string, - \Psr\Log\LoggerInterface $logger, - \Magento\Framework\Escaper $escaper, - \Magento\Framework\View\Asset\Repository $assetRepo, - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Variable\Model\VariableFactory $coreVariableFactory, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\View\LayoutInterface $layout, - \Magento\Framework\View\LayoutFactory $layoutFactory, - \Magento\Framework\App\State $appState, - \Magento\Framework\UrlInterface $urlModel, - \Pelago\Emogrifier $emogrifier, - \Magento\Variable\Model\Source\Variables $configVariables, + StringUtils $string, + LoggerInterface $logger, + Escaper $escaper, + Repository $assetRepo, + ScopeConfigInterface $scopeConfig, + VariableFactory $coreVariableFactory, + StoreManagerInterface $storeManager, + LayoutInterface $layout, + LayoutFactory $layoutFactory, + State $appState, + UrlInterface $urlModel, + Variables $configVariables, + VariableResolverInterface $variableResolver, + Css\Processor $cssProcessor, + Filesystem $pubDirectory, + CssInliner $cssInliner, $variables = [], - \Magento\Framework\Css\PreProcessor\Adapter\CssInliner $cssInliner = null, - array $directiveProcessors = [], - VariableResolverInterface $variableResolver = null, - Css\Processor $cssProcessor = null, - Filesystem $pubDirectory = null + array $directiveProcessors = [] ) { $this->_escaper = $escaper; $this->_assetRepo = $assetRepo; @@ -237,13 +255,9 @@ public function __construct( $this->_layoutFactory = $layoutFactory; $this->_appState = $appState; $this->urlModel = $urlModel; - $this->emogrifier = $emogrifier; - $this->cssInliner = $cssInliner ?: \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Framework\Css\PreProcessor\Adapter\CssInliner::class); - $this->cssProcessor = $cssProcessor ?: ObjectManager::getInstance() - ->get(Css\Processor::class); - $this->pubDirectory = $pubDirectory ?: ObjectManager::getInstance() - ->get(Filesystem::class); + $this->cssInliner = $cssInliner; + $this->cssProcessor = $cssProcessor; + $this->pubDirectory = $pubDirectory; $this->configVariables = $configVariables; parent::__construct($string, $variables, $directiveProcessors, $variableResolver); } @@ -395,7 +409,7 @@ public function blockDirective($construction) if (isset($blockParameters['class'])) { $block = $this->_layout->createBlock($blockParameters['class'], null, ['data' => $blockParameters]); } elseif (isset($blockParameters['id'])) { - $block = $this->_layout->createBlock(\Magento\Cms\Block\Block::class); + $block = $this->_layout->createBlock(Block::class); if ($block) { $block->setBlockId($blockParameters['id']); } @@ -436,7 +450,7 @@ public function layoutDirective($construction) { $this->_directiveParams = $this->getParameters($construction[2]); if (!isset($this->_directiveParams['area'])) { - $this->_directiveParams['area'] = \Magento\Framework\App\Area::AREA_FRONTEND; + $this->_directiveParams['area'] = Area::AREA_FRONTEND; } if ($this->_directiveParams['area'] != $this->_appState->getAreaCode()) { return $this->_appState->emulateAreaCode( @@ -457,7 +471,7 @@ public function emulateAreaCallback() { $skipParams = ['handle', 'area']; - /** @var $layout \Magento\Framework\View\LayoutInterface */ + /** @var $layout LayoutInterface */ $layout = $this->_layoutFactory->create(['cacheable' => false]); $layout->getUpdate()->addHandle($this->_directiveParams['handle'])->load(); @@ -466,7 +480,7 @@ public function emulateAreaCallback() $rootBlock = false; foreach ($layout->getAllBlocks() as $block) { - /* @var $block \Magento\Framework\View\Element\AbstractBlock */ + /* @var $block AbstractBlock */ if (!$block->getParentBlock() && !$rootBlock) { $rootBlock = $block; } @@ -499,7 +513,7 @@ public function emulateAreaCallback() */ protected function _getBlockParameters($value) { - $tokenizer = new \Magento\Framework\Filter\Template\Tokenizer\Parameter(); + $tokenizer = new Parameter(); $tokenizer->setString($value); return $tokenizer->tokenize(); @@ -529,7 +543,7 @@ public function mediaDirective($construction) // phpcs:disable Magento2.Functions.DiscouragedFunction $params = $this->getParameters(html_entity_decode($construction[2], ENT_QUOTES)); return $this->_storeManager->getStore() - ->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA) . $params['url']; + ->getBaseUrl(UrlInterface::URL_TYPE_MEDIA) . $params['url']; } /** @@ -573,10 +587,10 @@ public function storeDirective($construction) /** * Set current URL model, which will be used for URLs generation. * - * @param \Magento\Framework\UrlInterface $urlModel + * @param UrlInterface $urlModel * @return $this */ - public function setUrlModel(\Magento\Framework\UrlInterface $urlModel) + public function setUrlModel(UrlInterface $urlModel) { $this->urlModel = $urlModel; return $this; @@ -752,7 +766,7 @@ public function protocolDirective($construction) if (isset($params['store'])) { try { $store = $this->_storeManager->getStore($params['store']); - } catch (\Exception $e) { + } catch (Exception $e) { throw new MailException( __('Requested invalid store "%1"', $params['store']) ); @@ -820,7 +834,7 @@ public function configDirective($construction) if (isset($params['path']) && $this->isAvailableConfigVariable($params['path'])) { $configValue = $this->_scopeConfig->getValue( $params['path'], - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, + ScopeInterface::SCOPE_STORE, $storeId ); } @@ -858,8 +872,8 @@ public function customvarDirective($construction) $params['code'] ); $mode = $this->isPlainTemplateMode() - ? \Magento\Variable\Model\Variable::TYPE_TEXT - : \Magento\Variable\Model\Variable::TYPE_HTML; + ? Variable::TYPE_TEXT + : Variable::TYPE_HTML; $value = $variable->getValue($mode); if ($value) { $customVarValue = $value; @@ -892,19 +906,17 @@ public function cssDirective($construction) return '/* ' . __('"file" parameter must be specified') . ' */'; } - $css = $this->cssProcessor->process( - $this->getCssFilesContent([$params['file']]) - ); + try { + $css = $this->cssProcessor->process($this->getCssFilesContent([$params['file']])); + } catch (ContentProcessorException $exception) { + return '/*' . PHP_EOL . $exception->getMessage() . PHP_EOL . '*/'; + } - if (strpos($css, ContentProcessorInterface::ERROR_MESSAGE_PREFIX) !== false) { - // Return compilation error wrapped in CSS comment - return '/*' . PHP_EOL . $css . PHP_EOL . '*/'; - } elseif (!empty($css)) { - return $css; - } else { - // Return CSS comment for debugging purposes + if (empty($css)){ return '/* ' . __('Contents of the specified CSS file could not be loaded or is empty') . ' */'; } + + return $css; } /** @@ -922,7 +934,7 @@ public function cssDirective($construction) * * @param string[] $construction * @return string - * @throws \Magento\Framework\Exception\MailException + * @throws MailException */ public function inlinecssDirective($construction) { @@ -939,7 +951,7 @@ public function inlinecssDirective($construction) $params = $this->getParameters($construction[2]); if (!isset($params['file']) || !$params['file']) { - throw new \Magento\Framework\Exception\MailException( + throw new MailException( __('"file" parameter must be specified and must not be empty') ); } @@ -978,7 +990,8 @@ protected function getInlineCssFiles() * * @param [] $files * @return string - * @throws \Magento\Framework\Exception\MailException + * @throws MailException + * @throws ContentProcessorException */ public function getCssFilesContent(array $files) { @@ -987,7 +1000,7 @@ public function getCssFilesContent(array $files) $designParams = $this->getDesignParams(); if (!count($designParams)) { - throw new \Magento\Framework\Exception\MailException( + throw new MailException( __('Design params must be set before calling this method') ); } @@ -1002,9 +1015,7 @@ public function getCssFilesContent(array $files) $css .= $asset->getContent(); } } - } catch (ContentProcessorException $exception) { - $css = $exception->getMessage(); - } catch (\Magento\Framework\View\Asset\File\NotFoundException $exception) { + } catch (NotFoundException $exception) { $css = ''; } @@ -1019,50 +1030,55 @@ public function getCssFilesContent(array $files) * * @param string $html * @return string - * @throws \Magento\Framework\Exception\MailException + * @throws MailException */ public function applyInlineCss($html) { - // Check to see if the {{inlinecss file=""}} directive set CSS file(s) to inline and then load those files - $cssToInline = $this->getCssFilesContent( - $this->getInlineCssFiles() - ); + try { + // Check to see if the {{inlinecss file=""}} directive set CSS file(s) to inline and then load those files + $cssToInline = $this->getCssFilesContent($this->getInlineCssFiles()); + } catch (ContentProcessorException $exception) { + return $this->getExceptionHtml($html, $exception); + } + $cssToInline = $this->cssProcessor->process($cssToInline); // Only run Emogrify if HTML and CSS contain content - if ($html && $cssToInline) { - try { - // Don't try to compile CSS that has compilation errors - if (strpos($cssToInline, ContentProcessorInterface::ERROR_MESSAGE_PREFIX) - !== false - ) { - throw new \Magento\Framework\Exception\MailException( - __('<pre> %1 </pre>', PHP_EOL . $cssToInline . PHP_EOL) - ); - } - - $this->cssInliner->setHtml($html); - - $this->cssInliner->setCss($cssToInline); - - // Don't parse inline <style> tags, since existing tag is intentionally for non-inline styles - $this->cssInliner->disableStyleBlocksParsing(); + if (!$html || !$cssToInline) { + return $html; + } - $processedHtml = $this->cssInliner->process(); - } catch (\Exception $e) { - if ($this->_appState->getMode() == \Magento\Framework\App\State::MODE_DEVELOPER) { - $processedHtml = __('CSS inlining error:') . PHP_EOL . $e->getMessage() - . PHP_EOL - . $html; - } else { - $processedHtml = $html; - } - $this->_logger->error($e); + try { + // Don't try to compile CSS that has compilation errors + if (strpos($cssToInline, ContentProcessorInterface::ERROR_MESSAGE_PREFIX) !== false) { + throw new MailException(__('<pre> %1 </pre>', PHP_EOL . $cssToInline . PHP_EOL)); } - } else { - $processedHtml = $html; + $this->cssInliner->setHtml($html); + $this->cssInliner->setCss($cssToInline); + // Don't parse inline <style> tags, since existing tag is intentionally for non-inline styles + $this->cssInliner->disableStyleBlocksParsing(); + return $this->cssInliner->process(); + } catch (Exception $exception) { + return $this->getExceptionHtml($html, $exception); + } + } + + /** + * Handle css inlining exception, log it, add to the content in developer mode + * + * @param string $html + * @param Exception $exception + * @return string + */ + private function getExceptionHtml(string $html, Exception $exception): string + { + $this->_logger->error($exception); + if ($this->_appState->getMode() == \Magento\Framework\App\State::MODE_DEVELOPER) { + return __('CSS inlining error:') . PHP_EOL . $exception->getMessage() + . PHP_EOL + . $html; } - return $processedHtml; + return $html; } /** @@ -1078,15 +1094,15 @@ public function filter($value) { try { $value = parent::filter($value); - } catch (\Exception $e) { + } catch (Exception $e) { // Since a single instance of this class can be used to filter content multiple times, reset callbacks to // prevent callbacks running for unrelated content (e.g., email subject and email body) $this->resetAfterFilterCallbacks(); - if ($this->_appState->getMode() == \Magento\Framework\App\State::MODE_DEVELOPER) { + if ($this->_appState->getMode() == State::MODE_DEVELOPER) { $value = sprintf(__('Error filtering template: %s'), $e->getMessage()); } else { - $value = __("We're sorry, an error has occurred while generating this content."); + $value = (string) __("We're sorry, an error has occurred while generating this content."); } $this->_logger->critical($e); } diff --git a/app/code/Magento/Email/Model/Transport.php b/app/code/Magento/Email/Model/Transport.php index 881180920731..54f884c99d5d 100644 --- a/app/code/Magento/Email/Model/Transport.php +++ b/app/code/Magento/Email/Model/Transport.php @@ -8,6 +8,7 @@ namespace Magento\Email\Model; use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\MailException; use Magento\Framework\Mail\MessageInterface; use Magento\Framework\Mail\TransportInterface; @@ -15,6 +16,7 @@ use Magento\Store\Model\ScopeInterface; use Laminas\Mail\Message; use Laminas\Mail\Transport\Sendmail; +use Psr\Log\LoggerInterface; /** * Class that responsible for filling some message data before transporting it. @@ -60,15 +62,22 @@ class Transport implements TransportInterface */ private $message; + /** + * @var LoggerInterface|null + */ + private $logger; + /** * @param MessageInterface $message Email message object * @param ScopeConfigInterface $scopeConfig Core store config * @param null|string|array|\Traversable $parameters Config options for sendmail parameters + * @param LoggerInterface|null $logger */ public function __construct( MessageInterface $message, ScopeConfigInterface $scopeConfig, - $parameters = null + $parameters = null, + LoggerInterface $logger = null ) { $this->isSetReturnPath = (int) $scopeConfig->getValue( self::XML_PATH_SENDING_SET_RETURN_PATH, @@ -81,6 +90,7 @@ public function __construct( $this->laminasTransport = new Sendmail($parameters); $this->message = $message; + $this->logger = $logger ?: ObjectManager::getInstance()->get(LoggerInterface::class); } /** @@ -100,7 +110,8 @@ public function sendMessage() $this->laminasTransport->send($laminasMessage); } catch (\Exception $e) { - throw new MailException(new Phrase($e->getMessage()), $e); + $this->logger->error($e); + throw new MailException(new Phrase('Unable to send mail. Please try again later.')); } } diff --git a/app/code/Magento/Email/Test/Unit/Model/Template/FilterTest.php b/app/code/Magento/Email/Test/Unit/Model/Template/FilterTest.php index ac890dd3d4a7..97a684b92be5 100644 --- a/app/code/Magento/Email/Test/Unit/Model/Template/FilterTest.php +++ b/app/code/Magento/Email/Test/Unit/Model/Template/FilterTest.php @@ -38,7 +38,6 @@ use Magento\Store\Model\StoreManagerInterface; use Magento\Variable\Model\Source\Variables; use Magento\Variable\Model\VariableFactory; -use Pelago\Emogrifier; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -114,11 +113,6 @@ class FilterTest extends TestCase */ private $configVariables; - /** - * @var Emogrifier - */ - private $emogrifier; - /** * @var CssInliner */ @@ -144,6 +138,11 @@ class FilterTest extends TestCase */ private $variableResolver; + /** + * @var MockObject|VariableResolverInterface + */ + private $variableResolverInterface; + /** * @var array */ @@ -195,8 +194,6 @@ protected function setUp(): void ->disableOriginalConstructor() ->getMockForAbstractClass(); - $this->emogrifier = $this->objectManager->getObject(Emogrifier::class); - $this->configVariables = $this->getMockBuilder(Variables::class) ->disableOriginalConstructor() ->getMock(); @@ -257,20 +254,29 @@ protected function getModel($mockedMethods = null) $this->layoutFactory, $this->appState, $this->backendUrlBuilder, - $this->emogrifier, $this->configVariables, - [], - $this->cssInliner, - $this->directiveProcessors, $this->variableResolver, $this->cssProcessor, - $this->pubDirectory + $this->pubDirectory, + $this->cssInliner, + [], + $this->directiveProcessors ] ) ->setMethods($mockedMethods) ->getMock(); } + /** + * Test exception handling of filter method + */ + public function testFilterExceptionHandler() + { + $filter = $this->getModel(); + $filteredValue = $filter->filter(null); + $this->assertTrue(is_string($filteredValue)); + } + /** * Test basic usages of applyInlineCss * diff --git a/app/code/Magento/Email/Test/Unit/Model/TransportTest.php b/app/code/Magento/Email/Test/Unit/Model/TransportTest.php new file mode 100644 index 000000000000..2c1ed4575fd5 --- /dev/null +++ b/app/code/Magento/Email/Test/Unit/Model/TransportTest.php @@ -0,0 +1,72 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Email\Test\Unit\Model; + +use Laminas\Mail\Transport\Exception\RuntimeException; +use Magento\Email\Model\Transport; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\Mail\Message; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; +use Psr\Log\LoggerInterface; + +/** + * Tests for email transport functionality. + */ +class TransportTest extends TestCase +{ + /** + * @var MockObject|LoggerInterface + */ + private $loggerMock; + + /** + * @var Transport + */ + private $transport; + + /** + * @var ScopeConfigInterface|MockObject + */ + private $scopeConfigMock; + + /** + * @inheridoc + */ + protected function setUp(): void + { + $this->loggerMock = $this->getMockBuilder(LoggerInterface::class) + ->disableOriginalConstructor() + ->onlyMethods(['error']) + ->getMockForAbstractClass(); + $this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->transport = new Transport( + new Message(), + $this->scopeConfigMock, + null, + $this->loggerMock + ); + } + + /** + * Verify exception is properly handled in case one occurred when message sent. + * + * @return void + */ + public function testSendMessageBrokenMessage(): void + { + $exception = new RuntimeException('Invalid email; contains no at least one of "To", "Cc", and "Bcc" header'); + $this->loggerMock->expects(self::once())->method('error')->with($exception); + $this->expectException('Magento\Framework\Exception\MailException'); + $this->expectExceptionMessage('Unable to send mail. Please try again later.'); + + $this->transport->sendMessage(); + } +} diff --git a/app/code/Magento/Email/i18n/en_US.csv b/app/code/Magento/Email/i18n/en_US.csv index 412660d90d46..c66902d749bf 100644 --- a/app/code/Magento/Email/i18n/en_US.csv +++ b/app/code/Magento/Email/i18n/en_US.csv @@ -98,3 +98,4 @@ Action,Action "Email template chosen based on theme fallback, when the ""Default"" option is selected.","Email template chosen based on theme fallback, when the ""Default"" option is selected." "Header Template","Header Template" "Footer Template","Footer Template" +"Unable to send mail. Please try again later.","Unable to send mail. Please try again later." diff --git a/app/code/Magento/Email/view/adminhtml/templates/preview/iframeswitcher.phtml b/app/code/Magento/Email/view/adminhtml/templates/preview/iframeswitcher.phtml index 900c527dcff1..fd66acb7aca9 100644 --- a/app/code/Magento/Email/view/adminhtml/templates/preview/iframeswitcher.phtml +++ b/app/code/Magento/Email/view/adminhtml/templates/preview/iframeswitcher.phtml @@ -31,7 +31,7 @@ require([ 'jquery' ], function($) { $(document).ready(function() { - $('#preview_form').submit(); + $('#preview_form').trigger('submit'); }); $('#preview_iframe').load(function() { diff --git a/app/code/Magento/EncryptionKey/Model/ResourceModel/Key/Change.php b/app/code/Magento/EncryptionKey/Model/ResourceModel/Key/Change.php index bce4ec096a5e..e687817be743 100644 --- a/app/code/Magento/EncryptionKey/Model/ResourceModel/Key/Change.php +++ b/app/code/Magento/EncryptionKey/Model/ResourceModel/Key/Change.php @@ -108,6 +108,9 @@ public function changeEncryptionKey($key = null) } if (null === $key) { + // md5() here is not for cryptographic use. It used for generate encryption key itself + // and do not encrypt any passwords + // phpcs:ignore Magento2.Security.InsecureFunction $key = md5($this->random->getRandomString(ConfigOptionsListConstants::STORE_KEY_RANDOM_STRING_SIZE)); } $this->encryptor->setNewKey($key); diff --git a/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml b/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml index 2144f486f9bd..174c04b60185 100644 --- a/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml +++ b/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml @@ -53,9 +53,7 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value=""/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!--Reset configs--> @@ -77,9 +75,7 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value=""/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Delete created data--> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/GiftMessage/view/frontend/web/js/gift-options.js b/app/code/Magento/GiftMessage/view/frontend/web/js/gift-options.js index cff3324fceaf..083065e0221c 100644 --- a/app/code/Magento/GiftMessage/view/frontend/web/js/gift-options.js +++ b/app/code/Magento/GiftMessage/view/frontend/web/js/gift-options.js @@ -48,8 +48,8 @@ define([ container.show() .find('.giftmessage-area:not(:visible)').each(function (x, element) { if ($(element).val().length > 0) { - $(element).change(); - container.find('a').click(); + $(element).trigger('change'); + container.find('a').trigger('click'); } }); } else { @@ -61,7 +61,7 @@ define([ }).end() .find('.giftmessage-area').val('').change().end() .find('.select').val('').change().end() - .find('.checkbox:checked').prop('checked', false).click().prop('checked', false).end() + .find('.checkbox:checked').prop('checked', false).trigger('click').prop('checked', false).end() .find('.price-box').addClass(this.options.noDisplay).end(); } }, diff --git a/app/code/Magento/GiftMessage/view/frontend/web/template/gift-message-item-level.html b/app/code/Magento/GiftMessage/view/frontend/web/template/gift-message-item-level.html index 37f559feb5fb..fe07c87d6461 100644 --- a/app/code/Magento/GiftMessage/view/frontend/web/template/gift-message-item-level.html +++ b/app/code/Magento/GiftMessage/view/frontend/web/template/gift-message-item-level.html @@ -33,17 +33,17 @@ <!-- ko text: getObservable('message') --><!-- /ko --> </div> <!-- /ko --> - + <div class="actions-toolbar"> <div class="secondary"> <button type="submit" class="action action-edit" data-bind=" click: $data.editOptions.bind($data), - attr: {title: $t('Edit')"> + attr: {title: $t('Edit')}"> <span data-bind="i18n: 'Edit'"></span> </button> <button class="action action-delete" data-bind=" click: $data.deleteOptions.bind($data), - attr: {title: $t('Delete')"> + attr: {title: $t('Delete')}"> <span data-bind="i18n: 'Delete'"></span> </button> </div> diff --git a/app/code/Magento/GoogleAdwords/Observer/SetConversionValueObserver.php b/app/code/Magento/GoogleAdwords/Observer/SetConversionValueObserver.php index 5886d68a71a3..b97975182a63 100644 --- a/app/code/Magento/GoogleAdwords/Observer/SetConversionValueObserver.php +++ b/app/code/Magento/GoogleAdwords/Observer/SetConversionValueObserver.php @@ -21,6 +21,11 @@ class SetConversionValueObserver implements ObserverInterface */ protected $_collection; + /** + * @var \Magento\Framework\Registry + */ + private $_registry; + /** * Constructor * diff --git a/app/code/Magento/GoogleOptimizer/README.md b/app/code/Magento/GoogleOptimizer/README.md index c513b0d370af..bffdfab1dfbe 100644 --- a/app/code/Magento/GoogleOptimizer/README.md +++ b/app/code/Magento/GoogleOptimizer/README.md @@ -4,5 +4,5 @@ Google Experiment (on Google side) allows to make two variants of the same page From Magento side, code generated by Google should be saved and displayed on a particular page. Google Experiment functionality is available on pages of products, categories and cms pages. This allows to save different codes for products and categories on different store views. -This functionality can be switched on and off on the configuration page (Stores -> Configuration -> General -> Google Api -> Google Analytics). +This functionality can be switched on and off on the configuration page (Stores -> Configuration -> Sales -> Google Api -> Google Analytics). Also this functionality depends on Google Analytics module and configuration options. diff --git a/app/code/Magento/GraphQl/Controller/HttpRequestValidator/HttpVerbValidator.php b/app/code/Magento/GraphQl/Controller/HttpRequestValidator/HttpVerbValidator.php index 300b3d4f44dc..7fe82c13ae4c 100644 --- a/app/code/Magento/GraphQl/Controller/HttpRequestValidator/HttpVerbValidator.php +++ b/app/code/Magento/GraphQl/Controller/HttpRequestValidator/HttpVerbValidator.php @@ -11,6 +11,8 @@ use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\App\Request\Http; use Magento\GraphQl\Controller\HttpRequestValidatorInterface; +use GraphQL\Language\AST\Node; +use GraphQL\Language\AST\NodeKind; /** * Validator to check HTTP verb for Graphql requests @@ -29,11 +31,25 @@ public function validate(HttpRequestInterface $request) : void /** @var Http $request */ if (false === $request->isPost()) { $query = $request->getParam('query', ''); - // The easiest way to determine mutations without additional parsing - if (strpos(trim($query), 'mutation') === 0) { - throw new GraphQlInputException( - new \Magento\Framework\Phrase('Mutation requests allowed only for POST requests') + if (!empty($query)) { + $operationType = null; + $queryAst = \GraphQL\Language\Parser::parse(new \GraphQL\Language\Source($query ?: '', 'GraphQL')); + \GraphQL\Language\Visitor::visit( + $queryAst, + [ + 'leave' => [ + NodeKind::OPERATION_DEFINITION => function (Node $node) use (&$operationType) { + $operationType = $node->operation; + } + ] + ] ); + + if (strtolower($operationType) === 'mutation') { + throw new GraphQlInputException( + new \Magento\Framework\Phrase('Mutation requests allowed only for POST requests') + ); + } } } } diff --git a/app/code/Magento/GraphQl/Test/Unit/Controller/HttpRequestValidator/HttpVerbValidatorTest.php b/app/code/Magento/GraphQl/Test/Unit/Controller/HttpRequestValidator/HttpVerbValidatorTest.php new file mode 100644 index 000000000000..8570242c6584 --- /dev/null +++ b/app/code/Magento/GraphQl/Test/Unit/Controller/HttpRequestValidator/HttpVerbValidatorTest.php @@ -0,0 +1,97 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\Test\Unit\Controller\HttpRequestValidator; + +use Magento\Framework\App\HttpRequestInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\GraphQl\Controller\HttpRequestValidator\HttpVerbValidator; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test HttpVerbValidator + */ +class HttpVerbValidatorTest extends TestCase +{ + /** + * @var HttpVerbValidator|MockObject + */ + private $httpVerbValidator; + + /** + * @var HttpRequestInterface|MockObject + */ + private $requestMock; + + /** + * @inheritDoc + */ + protected function setup(): void + { + $objectManager = new ObjectManager($this); + $this->requestMock = $this->getMockBuilder(HttpRequestInterface::class) + ->disableOriginalConstructor() + ->onlyMethods( + [ + 'isPost', + ] + )->addMethods( + [ + 'getParam', + ] + ) + ->getMockForAbstractClass(); + + $this->httpVerbValidator = $objectManager->getObject( + HttpVerbValidator::class + ); + } + + /** + * Test for validate method + * + * @param string $query + * @param bool $needException + * @dataProvider validateDataProvider + */ + public function testValidate(string $query, bool $needException): void + { + $this->requestMock + ->expects($this->once()) + ->method('isPost') + ->willReturn(false); + + $this->requestMock + ->method('getParam') + ->with('query', '') + ->willReturn($query); + + if ($needException) { + $this->expectExceptionMessage('Syntax Error: Unexpected <EOF>'); + } + + $this->httpVerbValidator->validate($this->requestMock); + } + + /** + * @return array + */ + public function validateDataProvider(): array + { + return [ + [ + 'query' => '', + 'needException' => false, + ], + [ + 'query' => ' ', + 'needException' => true + ], + ]; + } +} diff --git a/app/code/Magento/GroupedImportExport/Plugin/CatalogImportExport/Model/StockItemImporter/UpdateGroupedProductStockStatusPlugin.php b/app/code/Magento/GroupedImportExport/Plugin/CatalogImportExport/Model/StockItemImporter/UpdateGroupedProductStockStatusPlugin.php new file mode 100644 index 000000000000..57eff4889360 --- /dev/null +++ b/app/code/Magento/GroupedImportExport/Plugin/CatalogImportExport/Model/StockItemImporter/UpdateGroupedProductStockStatusPlugin.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GroupedImportExport\Plugin\CatalogImportExport\Model\StockItemImporter; + +use Magento\CatalogImportExport\Model\StockItemImporterInterface; +use Magento\GroupedProduct\Model\Inventory\ChangeParentStockStatus; + +/** + * Update grouped product stock status during import plugin. + */ +class UpdateGroupedProductStockStatusPlugin +{ + /** + * @var ChangeParentStockStatus + */ + private $changeParentStockStatus; + + /** + * @param ChangeParentStockStatus $changeParentStockStatus + */ + public function __construct(ChangeParentStockStatus $changeParentStockStatus) + { + $this->changeParentStockStatus = $changeParentStockStatus; + } + + /** + * Update grouped product stock status during import. + * + * @param StockItemImporterInterface $subject + * @param null $result + * @param array $stockData + * @return void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterImport( + StockItemImporterInterface $subject, + $result, + array $stockData + ) { + $productIds = array_column($stockData, 'product_id'); + foreach ($productIds as $productId) { + $this->changeParentStockStatus->execute((int)$productId); + } + } +} diff --git a/app/code/Magento/GroupedImportExport/Test/Mftf/ActionGroup/AdminAssertGroupedProductInfoOnEditPageActionGroup.xml b/app/code/Magento/GroupedImportExport/Test/Mftf/ActionGroup/AdminAssertGroupedProductInfoOnEditPageActionGroup.xml new file mode 100644 index 000000000000..65199d9f4710 --- /dev/null +++ b/app/code/Magento/GroupedImportExport/Test/Mftf/ActionGroup/AdminAssertGroupedProductInfoOnEditPageActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertGroupedProductGeneralInfoOnEditPageActionGroup" extends="AdminAssertProductInfoOnEditPageActionGroup"> + <annotations> + <description>Verifies the general data on the Edit product details page in admin for a grouped product.</description> + </annotations> + <remove keyForRemoval="seeProductPrice"/> + <remove keyForRemoval="seeProductWeight"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/GroupedImportExport/Test/Mftf/Data/ImportData.xml b/app/code/Magento/GroupedImportExport/Test/Mftf/Data/ImportData.xml new file mode 100644 index 000000000000..1f9fb3582421 --- /dev/null +++ b/app/code/Magento/GroupedImportExport/Test/Mftf/Data/ImportData.xml @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <!-- Categories --> + <entity name="ImportCategory_Grouped" type="category"> + <data key="name">import-category-grouped</data> + <data key="name_lwr">import-category-grouped</data> + <data key="is_active">true</data> + <data key="include_in_menu">true</data> + <data key="urlKey">import-category-grouped</data> + </entity> + + <!-- Products --> + <entity name="ImportProductSimple1_Grouped" type="product"> + <data key="name">import-product-simple1-grouped</data> + <data key="sku">import-product-simple1-grouped</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="attributeSetText">Default</data> + <data key="price">11.00</data> + <data key="visibility">4</data> + <data key="status">1</data> + <data key="statusText">Enabled</data> + <data key="quantity">101</data> + <data key="groupedDefaultQuantity">3</data> + <data key="groupedPosition">1</data> + <data key="urlKey">import-product-simple1-grouped</data> + <data key="weight">1</data> + <data key="baseImage">magento-logo.png</data> + <data key="baseImageName">magento-logo</data> + <data key="smallImage">magento-logo.png</data> + <data key="smallImageName">magento-logo</data> + <data key="thumbnailImage">magento-logo.png</data> + <data key="thumbnailImageName">magento-logo</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="ImportProductSimple2_Grouped" type="product"> + <data key="name">import-product-simple2-grouped</data> + <data key="sku">import-product-simple2-grouped</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="attributeSetText">Default</data> + <data key="price">12.00</data> + <data key="visibility">4</data> + <data key="status">1</data> + <data key="statusText">Enabled</data> + <data key="quantity">102</data> + <data key="groupedDefaultQuantity">2</data> + <data key="groupedPosition">0</data> + <data key="urlKey">import-product-simple2-grouped</data> + <data key="weight">2</data> + <data key="baseImage">m-logo.gif</data> + <data key="baseImageName">m-logo</data> + <data key="smallImage">m-logo.gif</data> + <data key="smallImageName">m-logo</data> + <data key="thumbnailImage">m-logo.gif</data> + <data key="thumbnailImageName">m-logo</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="ImportProductSimple3_Grouped" type="product"> + <data key="name">import-product-simple3-grouped</data> + <data key="sku">import-product-simple3-grouped</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="attributeSetText">Default</data> + <data key="price">13.00</data> + <data key="visibility">4</data> + <data key="status">1</data> + <data key="statusText">Enabled</data> + <data key="quantity">103</data> + <data key="groupedDefaultQuantity">1</data> + <data key="groupedPosition">2</data> + <data key="urlKey">import-product-simple3-grouped</data> + <data key="weight">3</data> + <data key="baseImage">adobe-base.jpg</data> + <data key="baseImageName">adobe-base</data> + <data key="smallImage">adobe-base.jpg</data> + <data key="smallImageName">adobe-base</data> + <data key="thumbnailImage">adobe-base.jpg</data> + <data key="thumbnailImageName">adobe-base</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="ImportProduct_Grouped" type="product"> + <data key="fileName">import_grouped_product.csv</data> + <data key="importSummary">Created: 4, Updated: 0, Deleted: 0</data> + <data key="name">import-product-grouped</data> + <data key="sku">import-product-grouped</data> + <data key="type_id">grouped</data> + <data key="attribute_set_id">4</data> + <data key="price"/> + <data key="visibility">4</data> + <data key="status">1</data> + <data key="quantity">0</data> + <data key="weight">1</data> + <data key="urlKey">import-product-grouped</data> + <data key="baseImage">magento-logo.png</data> + <data key="baseImageName">magento-logo</data> + <data key="smallImage">m-logo.gif</data> + <data key="smallImageName">m-logo</data> + <data key="thumbnailImage">adobe-base.jpg</data> + <data key="thumbnailImageName">adobe-base</data> + </entity> +</entities> diff --git a/app/code/Magento/GroupedImportExport/Test/Mftf/Test/AdminImportGroupedProductTest.xml b/app/code/Magento/GroupedImportExport/Test/Mftf/Test/AdminImportGroupedProductTest.xml new file mode 100644 index 000000000000..d02764c09a50 --- /dev/null +++ b/app/code/Magento/GroupedImportExport/Test/Mftf/Test/AdminImportGroupedProductTest.xml @@ -0,0 +1,315 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminImportGroupedProductTest"> + <annotations> + <features value="GroupedImportExport"/> + <stories value="Import Products"/> + <title value="Import Grouped Product"/> + <description value="Imports a .csv file containing a grouped product. Verifies that product is imported + successfully and can be purchased."/> + <severity value="MAJOR"/> + <testCaseId value="MC-38408"/> + <group value="importExport"/> + <group value="GroupedProduct"/> + </annotations> + + <before> + <!-- Create Category & Customer --> + <createData entity="ImportCategory_Grouped" stepKey="createImportCategory"/> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + + <!-- Copy Images to Import Directory for Product Images --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportImages"> + <argument name="path">var/import/images/{{ImportProduct_Grouped.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct1BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple1_Grouped.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Grouped.name}}/{{ImportProductSimple1_Grouped.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct2BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple2_Grouped.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Grouped.name}}/{{ImportProductSimple2_Grouped.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct3BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple3_Grouped.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Grouped.name}}/{{ImportProductSimple3_Grouped.thumbnailImage}}</argument> + </helper> + + <!-- Login as Admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <after> + <!-- Delete Data --> + <deleteData createDataKey="createImportCategory" stepKey="deleteImportCategory"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteProductImageDirectory"> + <argument name="path">var/import/images/{{ImportProduct_Grouped.name}}</argument> + </helper> + <deleteData url="/V1/products/{{ImportProductSimple1_Grouped.urlKey}}" stepKey="deleteImportedSimpleProduct1"/> + <deleteData url="/V1/products/{{ImportProductSimple2_Grouped.urlKey}}" stepKey="deleteImportedSimpleProduct2"/> + <deleteData url="/V1/products/{{ImportProductSimple3_Grouped.urlKey}}" stepKey="deleteImportedSimpleProduct3"/> + <deleteData url="/V1/products/{{ImportProduct_Grouped.urlKey}}" stepKey="deleteImportedGroupedProduct"/> + <actionGroup ref="NavigateToAndResetProductGridToDefaultViewActionGroup" stepKey="navigateToAndResetProductGridToDefaultView"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Import Grouped Product & Assert No Errors --> + <actionGroup ref="AdminNavigateToImportPageActionGroup" stepKey="navigateToImportPage"/> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Grouped.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Grouped.name}}"/> + </actionGroup> + <actionGroup ref="AdminClickCheckDataImportActionGroup" stepKey="clickCheckData"/> + <see selector="{{AdminImportValidationMessagesSection.success}}" userInput="{{ImportCommonMessages.validFile}}" stepKey="seeCheckDataResultMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage"/> + <actionGroup ref="AdminClickImportActionGroup" stepKey="clickImport"/> + <see selector="{{AdminImportValidationMessagesSection.notice}}" userInput="{{ImportProduct_Grouped.importSummary}}" stepKey="seeNoticeMessage"/> + <see selector="{{AdminImportValidationMessagesSection.messageByType('success')}}" userInput="{{ImportCommonMessages.success}}" stepKey="seeImportMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage2"/> + + <!-- Reindex --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + + <!-- Admin: Verify Data on Import History Page --> + <actionGroup ref="AdminNavigateToImportHistoryPageActionGroup" stepKey="navigateToImportHistoryPage"/> + <actionGroup ref="AdminGridSortColumnDescendingActionGroup" stepKey="sortColumnByIdDescending"> + <argument name="columnLabel" value="history_id"/> + </actionGroup> + <see userInput="{{ImportProduct_Grouped.fileName}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeImportedFile"/> + <see userInput="{{ImportProduct_Grouped.importSummary}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeSummary"/> + + <!-- Admin: Verify Simple Product 1 on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToSimpleProduct1EditPage"> + <argument name="product" value="ImportProductSimple1_Grouped"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct1OnEditPage"> + <argument name="productStatus" value="{{ImportProductSimple1_Grouped.status}}"/> + <argument name="productName" value="{{ImportProductSimple1_Grouped.name}}"/> + <argument name="productSku" value="{{ImportProductSimple1_Grouped.sku}}"/> + <argument name="productPrice" value="{{ImportProductSimple1_Grouped.price}}"/> + <argument name="productQuantity" value="{{ImportProductSimple1_Grouped.quantity}}"/> + <argument name="productWeight" value="{{ImportProductSimple1_Grouped.weight}}"/> + <argument name="categoryName" value="{{ImportCategory_Grouped.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct1BaseImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple1_Grouped.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple1_Grouped.baseImageName, 'image')}}" stepKey="seeBaseImageRole1"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct1SmallImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple1_Grouped.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple1_Grouped.smallImageName, 'small_image')}}" stepKey="seeSmallImageRole1"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct1ThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple1_Grouped.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple1_Grouped.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRole1"/> + + <!-- Admin: Verify Simple Product 2 on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToSimpleProduct2EditPage"> + <argument name="product" value="ImportProductSimple2_Grouped"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct2OnEditPage"> + <argument name="productStatus" value="{{ImportProductSimple2_Grouped.status}}"/> + <argument name="productName" value="{{ImportProductSimple2_Grouped.name}}"/> + <argument name="productSku" value="{{ImportProductSimple2_Grouped.sku}}"/> + <argument name="productPrice" value="{{ImportProductSimple2_Grouped.price}}"/> + <argument name="productQuantity" value="{{ImportProductSimple2_Grouped.quantity}}"/> + <argument name="productWeight" value="{{ImportProductSimple2_Grouped.weight}}"/> + <argument name="categoryName" value="{{ImportCategory_Grouped.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct2BaseImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple2_Grouped.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple2_Grouped.baseImageName, 'image')}}" stepKey="seeBaseImageRole2"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct2SmallImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple2_Grouped.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple2_Grouped.smallImageName, 'small_image')}}" stepKey="seeSmallImageRole2"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct2ThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple2_Grouped.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple2_Grouped.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRole2"/> + + <!-- Admin: Verify Simple Product 3 on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToSimpleProduct3EditPage"> + <argument name="product" value="ImportProductSimple3_Grouped"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct3OnEditPage"> + <argument name="productStatus" value="{{ImportProductSimple3_Grouped.status}}"/> + <argument name="productName" value="{{ImportProductSimple3_Grouped.name}}"/> + <argument name="productSku" value="{{ImportProductSimple3_Grouped.sku}}"/> + <argument name="productPrice" value="{{ImportProductSimple3_Grouped.price}}"/> + <argument name="productQuantity" value="{{ImportProductSimple3_Grouped.quantity}}"/> + <argument name="productWeight" value="{{ImportProductSimple3_Grouped.weight}}"/> + <argument name="categoryName" value="{{ImportCategory_Grouped.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct3BaseImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple3_Grouped.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple3_Grouped.baseImageName, 'image')}}" stepKey="seeBaseImageRole3"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct3SmallImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple3_Grouped.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple3_Grouped.smallImageName, 'small_image')}}" stepKey="seeSmallImageRole3"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct3ThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple3_Grouped.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple3_Grouped.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRole3"/> + + <!-- Admin: Verify Grouped Product Common Data on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToGroupedProductEditPage"> + <argument name="product" value="ImportProduct_Grouped"/> + </actionGroup> + <actionGroup ref="AdminAssertGroupedProductGeneralInfoOnEditPageActionGroup" stepKey="assertGroupedProductOnEditPage"> + <argument name="productStatus" value="{{ImportProduct_Grouped.status}}"/> + <argument name="productName" value="{{ImportProduct_Grouped.name}}"/> + <argument name="productSku" value="{{ImportProduct_Grouped.sku}}"/> + <argument name="productQuantity" value="{{ImportProduct_Grouped.quantity}}"/> + <argument name="categoryName" value="{{ImportCategory_Grouped.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertGroupedProductBaseImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Grouped.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Grouped.baseImageName, 'image')}}" stepKey="seeBaseImageRoleGrouped"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertGroupedProductSmallImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Grouped.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Grouped.smallImageName, 'small_image')}}" stepKey="seeSmallImageRoleGrouped"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertGroupedProductThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Grouped.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Grouped.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRoleGrouped"/> + + <!-- Admin: Verify Grouped Product Information on Edit Product Page --> + <seeNumberOfElements userInput="3" selector="{{AdminGroupedProductOptionGridSection.allRows}}" stepKey="see3RowsAdmin"/> + <actionGroup ref="AdminVerifyAssociatedProductForGroupedProductActionGroup" stepKey="verifyAssociatedProduct1Admin"> + <argument name="image" value="{{ImportProductSimple2_Grouped.thumbnailImageName}}"/> + <argument name="name" value="{{ImportProductSimple2_Grouped.name}}"/> + <argument name="attributeSet" value="{{ImportProductSimple2_Grouped.attributeSetText}}"/> + <argument name="status" value="{{ImportProductSimple2_Grouped.statusText}}"/> + <argument name="sku" value="{{ImportProductSimple2_Grouped.sku}}"/> + <argument name="price" value="${{ImportProductSimple2_Grouped.price}}"/> + <argument name="defaultQuantity" value="{{ImportProductSimple2_Grouped.groupedDefaultQuantity}}"/> + <argument name="position" value="{{ImportProductSimple2_Grouped.groupedPosition}}"/> + <argument name="index" value="1"/> + </actionGroup> + <actionGroup ref="AdminVerifyAssociatedProductForGroupedProductActionGroup" stepKey="verifyAssociatedProduct2Admin"> + <argument name="image" value="{{ImportProductSimple1_Grouped.thumbnailImageName}}"/> + <argument name="name" value="{{ImportProductSimple1_Grouped.name}}"/> + <argument name="attributeSet" value="{{ImportProductSimple1_Grouped.attributeSetText}}"/> + <argument name="status" value="{{ImportProductSimple1_Grouped.statusText}}"/> + <argument name="sku" value="{{ImportProductSimple1_Grouped.sku}}"/> + <argument name="price" value="${{ImportProductSimple1_Grouped.price}}"/> + <argument name="defaultQuantity" value="{{ImportProductSimple1_Grouped.groupedDefaultQuantity}}"/> + <argument name="position" value="{{ImportProductSimple1_Grouped.groupedPosition}}"/> + <argument name="index" value="2"/> + </actionGroup> + <actionGroup ref="AdminVerifyAssociatedProductForGroupedProductActionGroup" stepKey="verifyAssociatedProduct3Admin"> + <argument name="image" value="{{ImportProductSimple3_Grouped.thumbnailImageName}}"/> + <argument name="name" value="{{ImportProductSimple3_Grouped.name}}"/> + <argument name="attributeSet" value="{{ImportProductSimple3_Grouped.attributeSetText}}"/> + <argument name="status" value="{{ImportProductSimple3_Grouped.statusText}}"/> + <argument name="sku" value="{{ImportProductSimple3_Grouped.sku}}"/> + <argument name="price" value="${{ImportProductSimple3_Grouped.price}}"/> + <argument name="defaultQuantity" value="{{ImportProductSimple3_Grouped.groupedDefaultQuantity}}"/> + <argument name="position" value="{{ImportProductSimple3_Grouped.groupedPosition}}"/> + <argument name="index" value="3"/> + </actionGroup> + + <!-- Storefront: Verify Grouped Product In Category --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginStorefront"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + <actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryPage"> + <argument name="categoryUrl" value="{{ImportCategory_Grouped.name}}"/> + </actionGroup> + <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productName}}" userInput="4" stepKey="see4Products"/> + <see userInput="{{ImportProductSimple1_Grouped.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeSimpleProduct1"/> + <see userInput="{{ImportProductSimple2_Grouped.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeSimpleProduct2"/> + <see userInput="{{ImportProductSimple3_Grouped.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeSimpleProduct3"/> + <see userInput="{{ImportProduct_Grouped.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeGroupedProduct"/> + + <!-- Storefront: Verify Grouped Product Info & Images --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefrontPage"> + <argument name="productUrl" value="{{ImportProduct_Grouped.urlKey}}"/> + </actionGroup> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Grouped.name}}" stepKey="seeProductName"/> + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Grouped.sku}}" stepKey="seeSku"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple1_Grouped.baseImageName)}}" stepKey="seeProduct1BaseImage"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple2_Grouped.baseImageName)}}" stepKey="seeProduct2BaseImage"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple3_Grouped.baseImageName)}}" stepKey="seeProduct3BaseImage"/> + + <!-- Storefront: Verify Associated Grouped Products --> + <seeNumberOfElements userInput="3" selector="{{StorefrontProductInfoMainSection.groupedProductsTableAllRows}}" stepKey="see3RowsStorefront"/> + <actionGroup ref="StorefrontVerifyAssociatedProductForGroupedProductActionGroup" stepKey="verifyAssociatedProduct1Storefront"> + <argument name="name" value="{{ImportProductSimple2_Grouped.name}}"/> + <argument name="price" value="${{ImportProductSimple2_Grouped.price}}"/> + <argument name="quantity" value="{{ImportProductSimple2_Grouped.groupedDefaultQuantity}}"/> + <argument name="index" value="1"/> + </actionGroup> + <actionGroup ref="StorefrontVerifyAssociatedProductForGroupedProductActionGroup" stepKey="verifyAssociatedProduct2Storefront"> + <argument name="name" value="{{ImportProductSimple1_Grouped.name}}"/> + <argument name="price" value="${{ImportProductSimple1_Grouped.price}}"/> + <argument name="quantity" value="{{ImportProductSimple1_Grouped.groupedDefaultQuantity}}"/> + <argument name="index" value="2"/> + </actionGroup> + <actionGroup ref="StorefrontVerifyAssociatedProductForGroupedProductActionGroup" stepKey="verifyAssociatedProduct3Storefront"> + <argument name="name" value="{{ImportProductSimple3_Grouped.name}}"/> + <argument name="price" value="${{ImportProductSimple3_Grouped.price}}"/> + <argument name="quantity" value="{{ImportProductSimple3_Grouped.groupedDefaultQuantity}}"/> + <argument name="index" value="3"/> + </actionGroup> + + <!-- Purchase Grouped Product --> + <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProductToCart"/> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="navigateToCheckoutPage"/> + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/> + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNextOnShippingStep"/> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlacePurchaseOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> + + <!-- Confirm Purchased Grouped Product --> + <actionGroup ref="StorefrontOpenOrderFromSuccessPageActionGroup" stepKey="openOrderFromSuccessPage"> + <argument name="orderNumber" value="{$grabOrderNumber}"/> + </actionGroup> + <executeJS function="return (Math.round(({{ImportProductSimple1_Grouped.price}}*{{ImportProductSimple1_Grouped.groupedDefaultQuantity}})*100)/100).toString()" stepKey="simpleProduct1Subtotal"/> + <executeJS function="return (Math.round(({{ImportProductSimple2_Grouped.price}}*{{ImportProductSimple2_Grouped.groupedDefaultQuantity}})*100)/100).toString()" stepKey="simpleProduct2Subtotal"/> + <executeJS function="return (Math.round(({{ImportProductSimple3_Grouped.price}}*{{ImportProductSimple3_Grouped.groupedDefaultQuantity}})*100)/100).toString()" stepKey="simpleProduct3Subtotal"/> + <actionGroup ref="StorefrontVerifyCustomerOrderProductRowDataActionGroup" stepKey="verifyProductRow1InOrder"> + <argument name="name" value="{{ImportProductSimple2_Grouped.name}}"/> + <argument name="sku" value="{{ImportProductSimple2_Grouped.sku}}"/> + <argument name="price" value="${{ImportProductSimple2_Grouped.price}}"/> + <argument name="quantity" value="{{ImportProductSimple2_Grouped.groupedDefaultQuantity}}"/> + <argument name="subtotal" value="{$simpleProduct2Subtotal}"/> + <argument name="index" value="1"/> + </actionGroup> + <actionGroup ref="StorefrontVerifyCustomerOrderProductRowDataActionGroup" stepKey="verifyProductRow2InOrder"> + <argument name="name" value="{{ImportProductSimple1_Grouped.name}}"/> + <argument name="sku" value="{{ImportProductSimple1_Grouped.sku}}"/> + <argument name="price" value="${{ImportProductSimple1_Grouped.price}}"/> + <argument name="quantity" value="{{ImportProductSimple1_Grouped.groupedDefaultQuantity}}"/> + <argument name="subtotal" value="{$simpleProduct1Subtotal}"/> + <argument name="index" value="2"/> + </actionGroup> + <actionGroup ref="StorefrontVerifyCustomerOrderProductRowDataActionGroup" stepKey="verifyProductRow3InOrder"> + <argument name="name" value="{{ImportProductSimple3_Grouped.name}}"/> + <argument name="sku" value="{{ImportProductSimple3_Grouped.sku}}"/> + <argument name="price" value="${{ImportProductSimple3_Grouped.price}}"/> + <argument name="quantity" value="{{ImportProductSimple3_Grouped.groupedDefaultQuantity}}"/> + <argument name="subtotal" value="{$simpleProduct3Subtotal}"/> + <argument name="index" value="3"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/GroupedImportExport/etc/di.xml b/app/code/Magento/GroupedImportExport/etc/di.xml index 25fd3b569751..d6a8ae2bfaff 100644 --- a/app/code/Magento/GroupedImportExport/etc/di.xml +++ b/app/code/Magento/GroupedImportExport/etc/di.xml @@ -13,4 +13,7 @@ </argument> </arguments> </type> + <type name="Magento\CatalogImportExport\Model\StockItemImporterInterface"> + <plugin name="update_grouped_product_stock_status_plugin" type="Magento\GroupedImportExport\Plugin\CatalogImportExport\Model\StockItemImporter\UpdateGroupedProductStockStatusPlugin" /> + </type> </config> diff --git a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php index b56e8657df72..24e4e49f51b9 100644 --- a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php +++ b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php @@ -351,7 +351,12 @@ protected function getProductInfo(\Magento\Framework\DataObject $buyRequest, $pr if ($isStrictProcessMode && !$subProduct->getQty() && $subProduct->isSalable()) { return __('Please specify the quantity of product(s).')->render(); } - $productsInfo[$subProduct->getId()] = $subProduct->isSalable() ? (float)$subProduct->getQty() : 0; + if (isset($buyRequest['qty']) && !isset($buyRequest['super_group'])) { + $subProductQty = (float)$subProduct->getQty() * (float)$buyRequest['qty']; + $productsInfo[$subProduct->getId()] = $subProduct->isSalable() ? $subProductQty : 0; + } else { + $productsInfo[$subProduct->getId()] = $subProduct->isSalable() ? (float)$subProduct->getQty() : 0; + } } } diff --git a/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price/Grouped.php b/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price/Grouped.php index 4c24cdb752d3..4a6e98ab966c 100644 --- a/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price/Grouped.php +++ b/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price/Grouped.php @@ -157,6 +157,12 @@ private function prepareGroupedProductPriceDataSelect(array $dimensions, array $ 'tier_price' => new \Zend_Db_Expr('NULL'), ] ); + // customer group website limitations + $select->joinLeft( + ['cgw' => $this->getTable('customer_group_excluded_website')], + 'i.customer_group_id = cgw.customer_group_id AND i.website_id = cgw.website_id', + [] + ); $select->group( ['e.entity_id', 'i.customer_group_id', 'i.website_id'] ); @@ -169,6 +175,9 @@ private function prepareGroupedProductPriceDataSelect(array $dimensions, array $ $select->where('e.entity_id IN(?)', $entityIds, \Zend_Db::INT_TYPE); } + // exclude websites that are limited for customer group + $select->where('cgw.website_id IS NULL'); + return $select; } diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminVerifyAssociatedProductForGroupedProductActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminVerifyAssociatedProductForGroupedProductActionGroup.xml new file mode 100644 index 000000000000..8d4c53e26d48 --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminVerifyAssociatedProductForGroupedProductActionGroup.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminVerifyAssociatedProductForGroupedProductActionGroup"> + <annotations> + <description>Verify product data for the specified row in the Associated Grouped Products grid on the Edit + Product page in admin for a Grouped Product.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="Magento_Catalog/images/product/placeholder/thumbnail.jpg" type="string"/> + <argument name="name" defaultValue="{{_defaultProduct.name}}" type="string"/> + <argument name="attributeSet" defaultValue="Default" type="string"/> + <argument name="status" defaultValue="Enabled" type="string"/> + <argument name="sku" defaultValue="{{_defaultProduct.sku}}" type="string"/> + <argument name="price" defaultValue="${{_defaultProduct.price}}" type="string"/> + <argument name="defaultQuantity" defaultValue="0" type="string"/> + <argument name="position" defaultValue="0" type="string"/> + <argument name="index" defaultValue="1" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminGroupedProductOptionGridSection.productImage(index)}}" stepKey="waitForProductImage"/> + <grabAttributeFrom userInput="src" selector="{{AdminGroupedProductOptionGridSection.productImage(index)}}" stepKey="grabProductImageSrc"/> + <assertStringContainsString stepKey="assertProductImageSrc"> + <expectedResult type="string">{{image}}</expectedResult> + <actualResult type="variable">$grabProductImageSrc</actualResult> + </assertStringContainsString> + <see userInput="{{name}}" selector="{{AdminGroupedProductOptionGridSection.productNameByRow(index)}}" stepKey="seeProductName"/> + <see userInput="{{attributeSet}}" selector="{{AdminGroupedProductOptionGridSection.productAttributeSet(index)}}" stepKey="seeProductAttributeSet"/> + <see userInput="{{status}}" selector="{{AdminGroupedProductOptionGridSection.productStatus(index)}}" stepKey="seeProductStatus"/> + <see userInput="{{sku}}" selector="{{AdminGroupedProductOptionGridSection.productSku(index)}}" stepKey="seeProductSku"/> + <see userInput="{{price}}" selector="{{AdminGroupedProductOptionGridSection.productPrice(index)}}" stepKey="seeProductPrice"/> + <seeInField userInput="{{defaultQuantity}}" selector="{{AdminGroupedProductOptionGridSection.productDefaultQuantity(index)}}" stepKey="seeProductDefaultQuantity"/> + <seeInField userInput="{{position}}" selector="{{AdminGroupedProductOptionGridSection.productPosition(index)}}" stepKey="seeProductPosition"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/StorefrontVerifyAssociatedProductForGroupedProductActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/StorefrontVerifyAssociatedProductForGroupedProductActionGroup.xml new file mode 100644 index 000000000000..1524f235edfe --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/StorefrontVerifyAssociatedProductForGroupedProductActionGroup.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontVerifyAssociatedProductForGroupedProductActionGroup"> + <annotations> + <description>Verify product data for the specified row in the Associated Grouped Products grid on the + storefront Product page for a Grouped Product.</description> + </annotations> + <arguments> + <argument name="name" defaultValue="{{_defaultProduct.name}}" type="string"/> + <argument name="price" defaultValue="${{_defaultProduct.price}}" type="string"/> + <argument name="quantity" defaultValue="0" type="string"/> + <argument name="index" defaultValue="1" type="string"/> + </arguments> + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.groupedProductsTableAllRows}}" stepKey="waitForGroupedProductRows"/> + <see userInput="{{name}}" selector="{{StorefrontProductInfoMainSection.groupedProductsAssociatedProductName(index)}}" stepKey="seeProductName"/> + <see userInput="{{price}}" selector="{{StorefrontProductInfoMainSection.groupedProductsAssociatedProductPrice(index)}}" stepKey="seeProductPrice"/> + <seeInField userInput="{{quantity}}" selector="{{StorefrontProductInfoMainSection.groupedProductsAssociatedProductQuantity(index)}}" stepKey="seeProductQuantity"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Section/AdminGroupedProductOptionGridSection.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Section/AdminGroupedProductOptionGridSection.xml index 1fff52c1d30c..1b61dd8cb4c0 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Section/AdminGroupedProductOptionGridSection.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Section/AdminGroupedProductOptionGridSection.xml @@ -9,7 +9,18 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminGroupedProductOptionGridSection"> + <element name="allRows" type="text" selector="[data-index=associated] .data-row"/> + <element name="productId" type="text" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) span[data-index=id]"/> + <element name="productImage" type="text" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) [data-index=thumbnail] img"/> <element name="productName" type="text" selector=".data-row td[data-index='name']"/> + <element name="productNameByRow" type="text" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) span[data-index=name]"/> + <element name="productAttributeSet" type="text" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) span[data-index=attribute_set]"/> + <element name="productStatus" type="text" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) span[data-index=status]"/> <element name="productSku" type="text" selector=".data-row td[data-index='sku']"/> + <element name="productSkuByRow" type="text" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) span[data-index=sku]"/> + <element name="productPrice" type="text" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) span[data-index=price]"/> + <element name="productDefaultQuantity" type="input" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) [data-index=qty] input"/> + <element name="productPosition" type="input" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) .position-widget-input"/> + <element name="removeProduct" type="button" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) button[data-action=remove_row]"/> </section> </sections> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Section/StorefrontProductInfoMainSection.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Section/StorefrontProductInfoMainSection.xml index 45d8e6334373..b9df178da490 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Section/StorefrontProductInfoMainSection.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Section/StorefrontProductInfoMainSection.xml @@ -10,5 +10,9 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="StorefrontProductInfoMainSection"> <element name="groupedProductsTable" type="text" selector="#super-product-table .product-item-name"/> + <element name="groupedProductsTableAllRows" type="text" selector="#super-product-table tbody tr"/> + <element name="groupedProductsAssociatedProductName" type="text" parameterized="true" selector="#super-product-table tbody tr:nth-of-type({{index}}) .product-item-name"/> + <element name="groupedProductsAssociatedProductPrice" type="text" parameterized="true" selector="#super-product-table tbody tr:nth-of-type({{index}}) .price"/> + <element name="groupedProductsAssociatedProductQuantity" type="input" parameterized="true" selector="#super-product-table tbody tr:nth-of-type({{index}}) input.qty"/> </section> </sections> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml index 23b1499c2d4e..983c54d76970 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml @@ -68,7 +68,7 @@ <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml index a909582c32b3..16a3ad59b549 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml @@ -51,11 +51,7 @@ <argument name="StoreGroup" value="SecondStoreGroupUnique"/> <argument name="customStore" value="SecondStoreUnique"/> </actionGroup> - - <!-- Reindex --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexAllIndexes"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexAllIndexes"/> </before> <after> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml index b842dad9c8c4..b6d6fbac370e 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml @@ -90,7 +90,7 @@ <!-- Open grouped product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> - <argument name="productUrl" value="{{GroupedProduct.sku}}"/> + <argument name="productUrl" value="{{GroupedProduct.urlKey}}"/> </actionGroup> <!-- Assert product design settings "left bar is present at product page with 2 columns" --> @@ -153,7 +153,7 @@ <!-- Verify Url Key after changing --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> - <argument name="productUrl" value="{{ApiGroupedProduct.name}}"/> + <argument name="productUrl" value="{{ApiGroupedProduct.urlKey}}"/> </actionGroup> <!-- Assert product design settings "right bar is present at the product page with 2 columns" --> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml index a00a341c4e6a..4dd89289d102 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml @@ -37,21 +37,31 @@ <argument name="product" value="$$createGroupedProduct$$"/> </actionGroup> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> - <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="deleteMessage"> + <argument name="message" value="A total of 1 record(s) have been deleted."/> + </actionGroup> <!--Verify product on Product Page --> - <amOnPage url="{{StorefrontProductPage.url($$createGroupedProduct.name$$)}}" stepKey="amOnGroupedProductPage"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="amOnGroupedProductPage"> + <argument name="productUrl" value="$$createGroupedProduct.custom_attributes[url_key]$$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertPageNotFoundErrorOnProductDetailPageActionGroup" stepKey="seeWhoops"> + <argument name="product" value="$$createGroupedProduct$$"/> + </actionGroup> <!--Search for the product by sku--> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> <argument name="query" value="$$createGroupedProduct.sku$$"/> </actionGroup> <!-- Should not see any search results --> - <dontSee userInput="$$createGroupedProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/> - <see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/> + <actionGroup ref="AssertStorefrontProductNotOnSearchPageActionGroup" stepKey="dontSeeProduct"> + <argument name="productSku" value="$$createGroupedProduct.sku$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontNoResultsMessageOnSearchPageActionGroup" stepKey="seeCantFindProductOneMessage"/> <!-- Go to the category page that we created in the before block --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> - <!-- Should not see the product --> - <dontSee userInput="$$createGroupedProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/> - <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="onCategoryPage"/> + <actionGroup ref="AssertStorefrontProductAbsentOnCategoryPageActionGroup" stepKey="dontSeeProductInCategory"> + <argument name="categoryUrlKey" value="$$createCategory.name$$"/> + <argument name="productName" value="$$createGroupedProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontNoProductsFoundActionGroup" stepKey="seeEmptyProductMessage"/> </test> </tests> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductSetEditContentTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductSetEditContentTest.xml index d9f9d8ecd938..2674ead37b34 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductSetEditContentTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductSetEditContentTest.xml @@ -35,6 +35,6 @@ </actionGroup> <!--Checking content storefront--> - <amOnPage url="{{GroupedProduct.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{GroupedProduct.urlKey}}.html" stepKey="goToStorefront"/> </test> </tests> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml index a0698224b780..1023a320b248 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml @@ -24,6 +24,7 @@ <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters" after="deleteProduct"/> </after> <!-- Create product --> @@ -37,6 +38,6 @@ <magentoCLI command="cron:run --group=index" stepKey="runCronIndexer"/> <!--See related product in storefront--> - <amOnPage url="{{GroupedProduct.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{GroupedProduct.urlKey}}.html" stepKey="goToStorefront"/> </test> </tests> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByDescriptionTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByDescriptionTest.xml index 4aa4e99e7948..63909e5322ee 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByDescriptionTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByDescriptionTest.xml @@ -14,8 +14,8 @@ <title value="Guest customer should be able to advance search Grouped product with product description"/> <description value="Guest customer should be able to advance search Grouped product with product description"/> <severity value="MAJOR"/> - <testCaseId value="MC-282"/> - <group value="GroupedProduct"/> + <testCaseId value="MC-25443"/> + <group value="groupedProduct"/> <group value="SearchEngineElasticsearch"/> </annotations> <before> @@ -30,9 +30,7 @@ <requiredEntity createDataKey="product"/> <requiredEntity createDataKey="simple2"/> </updateData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -41,9 +39,9 @@ <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> </after> - <see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> - <see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> - <see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/> - <see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> + <see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/> </test> </tests> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByNameTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByNameTest.xml index 06dde74de20f..099511395f9f 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByNameTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByNameTest.xml @@ -14,8 +14,8 @@ <title value="Guest customer should be able to advance search Grouped product with product name"/> <description value="Guest customer should be able to advance search Grouped product with product name"/> <severity value="MAJOR"/> - <testCaseId value="MC-141"/> - <group value="GroupedProduct"/> + <testCaseId value="MC-25344"/> + <group value="groupedProduct"/> <group value="SearchEngineElasticsearch"/> </annotations> <before> @@ -30,9 +30,7 @@ <requiredEntity createDataKey="product"/> <requiredEntity createDataKey="simple2"/> </updateData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -41,9 +39,9 @@ <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> </after> - <see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> - <see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> - <see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/> - <see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> + <see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/> </test> </tests> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByPriceTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByPriceTest.xml index 66e1b60331e9..4c754628cd42 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByPriceTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByPriceTest.xml @@ -14,8 +14,8 @@ <title value="Guest customer should be able to advance search Grouped product with product price"/> <description value="Guest customer should be able to advance search Grouped product with product price"/> <severity value="MAJOR"/> - <testCaseId value="MC-284"/> - <group value="GroupedProduct"/> + <testCaseId value="MC-25445"/> + <group value="groupedProduct"/> <group value="SearchEngineElasticsearch"/> </annotations> <before> @@ -39,9 +39,7 @@ <getData entity="GetProduct" stepKey="arg3"> <requiredEntity createDataKey="simple2"/> </getData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -50,9 +48,9 @@ <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> </after> - <see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> - <see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> - <see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/> - <see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> + <see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/> </test> </tests> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByShortDescriptionTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByShortDescriptionTest.xml index 79b465abe2ac..bdbe079935e2 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByShortDescriptionTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByShortDescriptionTest.xml @@ -14,8 +14,8 @@ <title value="Guest customer should be able to advance search Grouped product with product short description"/> <description value="Guest customer should be able to advance search Grouped product with product short description"/> <severity value="MAJOR"/> - <testCaseId value="MC-283"/> - <group value="GroupedProduct"/> + <testCaseId value="MC-25444"/> + <group value="groupedProduct"/> <group value="SearchEngineElasticsearch"/> </annotations> <before> @@ -30,9 +30,7 @@ <requiredEntity createDataKey="product"/> <requiredEntity createDataKey="simple2"/> </updateData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -41,9 +39,9 @@ <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> </after> - <see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> - <see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> - <see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/> - <see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> + <see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/> </test> </tests> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductBySkuTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductBySkuTest.xml index c196abbce99e..5142558eaff6 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductBySkuTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductBySkuTest.xml @@ -29,9 +29,7 @@ <requiredEntity createDataKey="product"/> <requiredEntity createDataKey="simple2"/> </updateData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/NewProductsListWidgetGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/NewProductsListWidgetGroupedProductTest.xml index 628173ae989a..b0598d37fd3b 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/NewProductsListWidgetGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/NewProductsListWidgetGroupedProductTest.xml @@ -45,10 +45,15 @@ <actionGroup ref="AdminClickAddProductToggleAndSelectProductTypeActionGroup" stepKey="clickAddGroupedProduct"> <argument name="productType" value="grouped"/> </actionGroup> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{_defaultProduct.sku}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.setProductAsNewFrom}}" userInput="01/1/2000" stepKey="fillProductNewFrom"/> - <fillField selector="{{AdminProductFormSection.setProductAsNewTo}}" userInput="01/1/2099" stepKey="fillProductNewTo"/> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillProductName"> + <argument name="product" value="_defaultProduct"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductSku"/> + <actionGroup ref="AdminSetProductAsNewDateActionGroup" stepKey="fillProductNewFrom"> + <argument name="fromDate" value="01/1/2000"/> + <argument name="toDate" value="01/1/2099"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductNewTo"/> <conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductsSection"/> <scrollTo selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="scrollToAddProductsToGroup"/> <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> @@ -64,9 +69,12 @@ <!-- If PageCache is enabled, Cache clearing happens here, via merge --> <!-- Check for product on the CMS page with the New Products widget --> - - <amOnPage url="{{_newDefaultCmsPage.identifier}}" stepKey="amOnCmsPage"/> - <waitForPageLoad stepKey="waitForCmsPage"/> - <see selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" userInput="{{_defaultProduct.name}}" stepKey="seeProductName"/> + <actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="amOnCmsPage"> + <argument name="identifier" value="{{_newDefaultCmsPage.identifier}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCmsPage"/> + <actionGroup ref="AssertStorefrontProductIsShownOnCmsPageActionGroup" stepKey="seeProductName"> + <argument name="cmsTitle" value="{{_newDefaultCmsPage.title}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/StorefrontAdvanceCatalogSearchGroupedProductBySkuWithHyphenTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/StorefrontAdvanceCatalogSearchGroupedProductBySkuWithHyphenTest.xml index c141c179330f..632bdcfa78d8 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/StorefrontAdvanceCatalogSearchGroupedProductBySkuWithHyphenTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/StorefrontAdvanceCatalogSearchGroupedProductBySkuWithHyphenTest.xml @@ -15,16 +15,13 @@ <title value="Guest customer should be able to advance search Grouped product with product sku that in camelCase format"/> <description value="Guest customer should be able to advance search Grouped product with product sku that in camelCase format"/> <severity value="MAJOR"/> - <testCaseId value="MC-20519"/> + <testCaseId value="MC-28832"/> <group value="GroupedProduct"/> <group value="SearchEngineElasticsearch"/> - <skip> - <issueId value="MC-34217"/> - </skip> </annotations> <before> - <createData entity="ApiProductWithDescription" stepKey="simple1" before="simple2"/> - <createData entity="ApiProductWithDescription" stepKey="simple2" before="product"/> + <createData entity="ApiProductWithDescription" before="simple2" stepKey="simple1"/> + <createData entity="ApiProductWithDescription" before="product" stepKey="simple2"/> <createData entity="ApiGroupedProduct" stepKey="product"/> <createData entity="OneSimpleProductLink" stepKey="addProductOne"> <requiredEntity createDataKey="product"/> @@ -42,8 +39,8 @@ </actionGroup> </before> <after> - <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> - <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> + <deleteData createDataKey="simple1" before="deleteSimple2" stepKey="deleteSimple1"/> + <deleteData createDataKey="simple2" before="delete" stepKey="deleteSimple2"/> </after> </test> </tests> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/templates/product/grouped/list.phtml b/app/code/Magento/GroupedProduct/view/adminhtml/templates/product/grouped/list.phtml index 0872afcc8b3c..99b6e44feffe 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/templates/product/grouped/list.phtml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/templates/product/grouped/list.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ // phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /* @var $block \Magento\GroupedProduct\Block\Product\Grouped\AssociatedProducts\ListAssociatedProducts */ ?> <script type="text/x-magento-template" id="group-product-template"> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/web/js/grouped-product.js b/app/code/Magento/GroupedProduct/view/adminhtml/web/js/grouped-product.js index 59abb85d35de..2760a3632f14 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/web/js/grouped-product.js +++ b/app/code/Magento/GroupedProduct/view/adminhtml/web/js/grouped-product.js @@ -159,7 +159,7 @@ define([ product.id = element.val(); product.qty = 0; element.closest('[data-role=row]').find('[data-column]').each(function (index, el) { - product[$(el).data('column')] = $.trim($(el).text()); + product[$(el).data('column')] = $(el).text().trim(); }); selectedProductList[product.id] = product; } else { diff --git a/app/code/Magento/GroupedProduct/view/base/web/template/product/price/minimal_price.html b/app/code/Magento/GroupedProduct/view/base/web/template/product/price/minimal_price.html index acc246f1c894..c40b011204cf 100644 --- a/app/code/Magento/GroupedProduct/view/base/web/template/product/price/minimal_price.html +++ b/app/code/Magento/GroupedProduct/view/base/web/template/product/price/minimal_price.html @@ -8,14 +8,14 @@ <div class="minimal-price"> <span if="label" class="price-label" - text="label"/> + text="label"></span> <span class="price-container" css="getAdjustmentCssClasses($row())"> <span class="price-wrapper price-including-tax" data-price-amount="" data-price-type="" - html="getPrice($row())"/> + html="getPriceUnsanitizedHtml($row())"></span> <each args="data: getAdjustments(), as: '$adj'"> <render args="$adj.getBody()"/> diff --git a/app/code/Magento/GroupedProductGraphQl/etc/graphql/di.xml b/app/code/Magento/GroupedProductGraphQl/etc/graphql/di.xml index 003ce5083429..84eab3bf132a 100644 --- a/app/code/Magento/GroupedProductGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/GroupedProductGraphQl/etc/graphql/di.xml @@ -45,4 +45,12 @@ </argument> </arguments> </type> + + <type name="Magento\UrlRewriteGraphQl\Model\RoutableInterfaceTypeResolver"> + <arguments> + <argument name="productTypeNameResolvers" xsi:type="array"> + <item name="grouped_product_type_resolver" xsi:type="object">Magento\GroupedProductGraphQl\Model\GroupedProductTypeResolver</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/GroupedProductGraphQl/etc/schema.graphqls b/app/code/Magento/GroupedProductGraphQl/etc/schema.graphqls index 7c9e17a3d6d0..c0d309130a3e 100644 --- a/app/code/Magento/GroupedProductGraphQl/etc/schema.graphqls +++ b/app/code/Magento/GroupedProductGraphQl/etc/schema.graphqls @@ -1,7 +1,7 @@ # Copyright © Magento, Inc. All rights reserved. # See COPYING.txt for license details. -type GroupedProduct implements ProductInterface, PhysicalProductInterface @doc(description: "GroupedProduct defines a grouped product") { +type GroupedProduct implements ProductInterface, RoutableInterface, PhysicalProductInterface @doc(description: "A grouped product consists of simple standalone products that are presented as a group") { items: [GroupedProductItem] @doc(description: "An array containing grouped product items") @resolver(class: "Magento\\GroupedProductGraphQl\\Model\\Resolver\\GroupedItems") } diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php b/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php index d032f2f7621b..b4d45dde94a6 100644 --- a/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php +++ b/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php @@ -7,6 +7,8 @@ use Magento\Eav\Model\Entity\Attribute; use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Framework\App\ObjectManager; +use Magento\ImportExport\Model\ResourceModel\Export\AttributeGridCollectionFactory; /** * Export filter block @@ -40,20 +42,29 @@ class Filter extends \Magento\Backend\Block\Widget\Grid\Extended 'updated_at' => \Magento\ImportExport\Model\Export::FILTER_TYPE_DATE, ]; + /** + * @var AttributeGridCollectionFactory + */ + private $attributeGridCollectionFactory; + /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\ImportExport\Helper\Data $importExportData * @param array $data + * @param AttributeGridCollectionFactory|null $attributeGridCollectionFactory */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, \Magento\ImportExport\Helper\Data $importExportData, - array $data = [] + array $data = [], + ?AttributeGridCollectionFactory $attributeGridCollectionFactory = null ) { $this->_importExportData = $importExportData; parent::__construct($context, $backendHelper, $data); + $this->attributeGridCollectionFactory = $attributeGridCollectionFactory + ?: ObjectManager::getInstance()->get(AttributeGridCollectionFactory::class); } /** @@ -263,7 +274,7 @@ protected function _getSelectHtmlWithValue(Attribute $attribute, $value) '', ['data' => $arguments] ); - return $selectBlock->setOptions($options)->setValue($value)->getHtml(); + return $selectBlock->setOptions($options)->setValue($value !== '' ? $value : null)->getHtml(); } else { return __('We can\'t filter an attribute with no attribute options.'); } @@ -426,7 +437,10 @@ public function getRowUrl($row) */ public function prepareCollection(\Magento\Framework\Data\Collection $collection) { - $this->setCollection($collection); - return $this->getCollection(); + $attributeGridCollection = $this->attributeGridCollectionFactory->create(); + $gridCollection = $attributeGridCollection->setItems($collection->getItems()); + $this->setCollection($gridCollection); + + return $collection; } } diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php b/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php index 07cf6f8c733d..b24cad16897a 100644 --- a/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php +++ b/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php @@ -287,7 +287,7 @@ private function getImportBehaviorTooltip() { $html = '<div class="admin__field-tooltip tooltip"> <a class="admin__field-tooltip-action action-help" target="_blank" title="What is this?" - href="https://docs.magento.com/m2/ce/user_guide/system/data-import.html"><span>' + href="https://docs.magento.com/user-guide/system/data-import.html"><span>' . __('What is this?') . '</span></a></div>'; return $html; diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/Export/Export.php b/app/code/Magento/ImportExport/Controller/Adminhtml/Export/Export.php index 43cc467ad390..18b319f7a25c 100644 --- a/app/code/Magento/ImportExport/Controller/Adminhtml/Export/Export.php +++ b/app/code/Magento/ImportExport/Controller/Adminhtml/Export/Export.php @@ -76,7 +76,7 @@ public function execute() { if ($this->getRequest()->getPost(ExportModel::FILTER_ELEMENT_GROUP)) { try { - $params = $this->getRequest()->getParams(); + $params = $this->getRequestParameters(); if (!array_key_exists('skip_attr', $params)) { $params['skip_attr'] = []; @@ -109,4 +109,14 @@ public function execute() $resultRedirect->setPath('adminhtml/*/index'); return $resultRedirect; } + + /** + * Retrieve all params as array + * + * @return array + */ + public function getRequestParameters(): array + { + return $this->getRequest()->getParams(); + } } diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/Export/File/Download.php b/app/code/Magento/ImportExport/Controller/Adminhtml/Export/File/Download.php index 8e432e395bdf..75022e2b8ad9 100644 --- a/app/code/Magento/ImportExport/Controller/Adminhtml/Export/File/Download.php +++ b/app/code/Magento/ImportExport/Controller/Adminhtml/Export/File/Download.php @@ -9,10 +9,13 @@ use Magento\Backend\App\Action; use Magento\Framework\App\Action\HttpGetActionInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\App\Response\Http\FileFactory; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\ImportExport\Controller\Adminhtml\Export as ExportController; use Magento\Framework\Filesystem; +use Magento\ImportExport\Model\LocalizedFileName; +use Throwable; /** * Controller that download file by name. @@ -34,45 +37,61 @@ class Download extends ExportController implements HttpGetActionInterface */ private $filesystem; + /** + * @var LocalizedFileName + */ + private $localizedFileName; + /** * DownloadFile constructor. * @param Action\Context $context * @param FileFactory $fileFactory * @param Filesystem $filesystem + * @param LocalizedFileName|null $localizedFileName */ public function __construct( Action\Context $context, FileFactory $fileFactory, - Filesystem $filesystem + Filesystem $filesystem, + ?LocalizedFileName $localizedFileName = null ) { $this->fileFactory = $fileFactory; $this->filesystem = $filesystem; parent::__construct($context); + $this->localizedFileName = $localizedFileName ?? ObjectManager::getInstance()->get(LocalizedFileName::class); } /** * Controller basic method implementation. * - * @return \Magento\Framework\App\ResponseInterface + * @return \Magento\Framework\Controller\Result\Redirect | \Magento\Framework\App\ResponseInterface */ public function execute() { - /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); $resultRedirect->setPath('adminhtml/export/index'); $fileName = $this->getRequest()->getParam('filename'); - if (empty($fileName) || preg_match('/\.\.(\\\|\/)/', $fileName) !== 0) { + $exportDirectory = $this->filesystem->getDirectoryRead(DirectoryList::VAR_IMPORT_EXPORT); + + try { + $fileExist = $exportDirectory->isExist('export/' . $fileName); + } catch (Throwable $e) { + $fileExist = false; + } + + if (empty($fileName) || !$fileExist) { $this->messageManager->addErrorMessage(__('Please provide valid export file name')); return $resultRedirect; } + try { $path = 'export/' . $fileName; $directory = $this->filesystem->getDirectoryRead(DirectoryList::VAR_IMPORT_EXPORT); if ($directory->isFile($path)) { return $this->fileFactory->create( - $path, - $directory->readFile($path), + $this->localizedFileName->getFileDisplayName($path), + ['type' => 'filename', 'value' => $path], DirectoryList::VAR_IMPORT_EXPORT ); } diff --git a/app/code/Magento/ImportExport/Helper/Report.php b/app/code/Magento/ImportExport/Helper/Report.php index d5be27a56994..845f449e1907 100644 --- a/app/code/Magento/ImportExport/Helper/Report.php +++ b/app/code/Magento/ImportExport/Helper/Report.php @@ -7,7 +7,9 @@ namespace Magento\ImportExport\Helper; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Exception\ValidatorException; use Magento\ImportExport\Model\Import; +use Magento\Framework\Filesystem\Directory\ReadInterface; /** * ImportExport history reports helper @@ -27,6 +29,11 @@ class Report extends \Magento\Framework\App\Helper\AbstractHelper */ protected $varDirectory; + /** + * @var ReadInterface + */ + private $importHistoryDirectory; + /** * Construct * @@ -41,6 +48,8 @@ public function __construct( ) { $this->timeZone = $timeZone; $this->varDirectory = $filesystem->getDirectoryWrite(DirectoryList::VAR_IMPORT_EXPORT); + $importHistoryPath = $this->varDirectory->getAbsolutePath('import_history'); + $this->importHistoryDirectory = $filesystem->getDirectoryReadByPath($importHistoryPath); parent::__construct($context); } @@ -129,11 +138,12 @@ public function getReportSize($filename) */ protected function getFilePath($filename) { - if (preg_match('/\.\.(\\\|\/)/', $filename)) { - throw new \InvalidArgumentException('Filename has not permitted symbols in it'); + try { + $filePath = $this->varDirectory->getRelativePath($this->importHistoryDirectory->getAbsolutePath($filename)); + } catch (ValidatorException $e) { + throw new \InvalidArgumentException('File not found'); } - - return $this->varDirectory->getRelativePath(Import::IMPORT_HISTORY_DIR . $filename); + return $filePath; } /** diff --git a/app/code/Magento/ImportExport/Model/Export/Entity/AbstractEav.php b/app/code/Magento/ImportExport/Model/Export/Entity/AbstractEav.php index df556e961d2c..0ac4d5dd9a18 100644 --- a/app/code/Magento/ImportExport/Model/Export/Entity/AbstractEav.php +++ b/app/code/Magento/ImportExport/Model/Export/Entity/AbstractEav.php @@ -158,6 +158,11 @@ public function filterEntityCollection(AbstractCollection $collection) $attributeCode, ['eq' => $exportFilter[$attributeCode]] ); + } else if (is_array($exportFilter[$attributeCode])) { + $collection->addAttributeToFilter( + $attributeCode, + ['in' => $exportFilter[$attributeCode]] + ); } } elseif (Export::FILTER_TYPE_MULTISELECT == $attributeFilterType) { if (is_array($exportFilter[$attributeCode])) { diff --git a/app/code/Magento/ImportExport/Model/LocalizedFileName.php b/app/code/Magento/ImportExport/Model/LocalizedFileName.php new file mode 100644 index 000000000000..4b2293618763 --- /dev/null +++ b/app/code/Magento/ImportExport/Model/LocalizedFileName.php @@ -0,0 +1,127 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ImportExport\Model; + +use DateTime; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; + +/** + * Localized filename model + */ +class LocalizedFileName +{ + /** + * date format regex map + */ + private const DATE_FORMAT_TO_REGEX = [ + 'Y' => '\d{4}', + 'y' => '\d{2}', + 'm' => '\d{2}', + 'n' => '\d{1,2}', + 'M' => '[A-Z][a-z]{3}', + 'F' => '[A-Z][a-z]{2,8}', + 'd' => '\d{2}', + 'j' => '\d{1,2}', + 'D' => '[A-Z][a-z]{2}', + 'l' => '[A-Z][a-z]{6,9}', + 'u' => '\d{1,6}', + 'h' => '\d{2}', + 'H' => '\d{2}', + 'g' => '\d{1,2}', + 'G' => '\d{1,2}', + 'i' => '\d{2}', + 's' => '\d{2}' + ]; + + /** + * @var TimezoneInterface + */ + private $timezone; + + /** + * @var array + */ + private $dateFormats; + + /** + * @param TimezoneInterface $timezone + * @param array $dateFormats + */ + public function __construct( + TimezoneInterface $timezone, + array $dateFormats = [] + ) { + $this->timezone = $timezone; + $this->dateFormats = $dateFormats; + } + + /** + * Get file display name + * + * @param string $filename + * @return string + */ + public function getFileDisplayName(string $filename): string + { + $displayName = $filename; + foreach ($this->dateFormats as $dateFormat) { + $utcDate = $this->parseDateFromFilename($filename, $dateFormat); + if ($utcDate) { + $utcDateString = $utcDate->format($dateFormat); + $scopeDate = $this->timezone->scopeDate(null, $utcDate, true); + $displayName = str_replace($utcDateString, $scopeDate->format($dateFormat), $filename); + break; + } + } + return $displayName; + } + + /** + * Parse date from filename + * + * @param string $filename + * @param string $dateFormat + * @return DateTime|null + */ + private function parseDateFromFilename(string $filename, string $dateFormat): ?DateTime + { + $date = null; + $regex = $this->convertDateFormatToRegex($dateFormat); + if (preg_match("/$regex/", $filename, $result)) { + $date = date_create_from_format($dateFormat, $result[0]); + if (!$date || $date->format($dateFormat) !== $result[0]) { + $date = null; + } + } + return $date; + } + + /** + * Convert date format to regex format + * + * @param string $dateFormat + * @return string + */ + private function convertDateFormatToRegex(string $dateFormat): string + { + $regex = ''; + $escape = '\\'; + $chars = str_split($dateFormat); + foreach ($chars as $pos => $char) { + $lastChar = $chars[$pos - 1] ?? ''; + if ($lastChar !== $escape && isset(self::DATE_FORMAT_TO_REGEX[$char])) { + $regex .= self::DATE_FORMAT_TO_REGEX[$char]; + } elseif ($char === $escape) { + $regex .= $char; + } else { + $regex .= preg_quote($char); + } + } + return $regex; + } +} diff --git a/app/code/Magento/ImportExport/Model/ResourceModel/Export/AttributeGridCollection.php b/app/code/Magento/ImportExport/Model/ResourceModel/Export/AttributeGridCollection.php new file mode 100644 index 000000000000..1fccff62910b --- /dev/null +++ b/app/code/Magento/ImportExport/Model/ResourceModel/Export/AttributeGridCollection.php @@ -0,0 +1,124 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ImportExport\Model\ResourceModel\Export; + +use Magento\Framework\Data\Collection; +use Magento\Framework\Phrase; + +/** + * Association of attributes for grid + */ +class AttributeGridCollection extends Collection +{ + private const FILTERED_FLAG_NAME = 'agc_filtered'; + + /** + * Adding item to collection + * + * @param array $items + * @return $this + */ + public function setItems(array $items): self + { + foreach ($items as $item) { + $this->addItem($item); + } + + return $this; + } + + /** + * @inheritDoc + */ + public function getSize(): int + { + return count($this->getItems()); + } + + /** + * @inheritDoc + */ + public function addFieldToFilter($field, $condition) + { + if (isset($condition['like'])) { + $value = $this->unescapeLikeValue((string)$condition['like']); + $this->addFilter($field, $value); + } + + return $this; + } + + /** + * @inheritDoc + */ + public function load($printQuery = false, $logQuery = false) + { + $this->filterCollection(); + $this->sortCollectionByAttributeCode(); + + return $this; + } + + /** + * Add filters to collection + * + * @return $this + */ + private function filterCollection() + { + if (!$this->getFlag(self::FILTERED_FLAG_NAME) && !empty($this->_filters)) { + foreach ($this->_filters as $filter) { + foreach ($this->_items as $item) { + $field = $item->getData($filter->getData('field')) ?? ''; + if ($field instanceof Phrase) { + $field = (string)$field; + } + if (stripos($field, $filter->getData('value')) === false) { + $this->removeItemByKey($item->getId()); + } + } + } + $this->setFlag(self::FILTERED_FLAG_NAME, true); + } + + return $this; + } + + /** + * Sort collection by attribute code + * + * @return $this + */ + private function sortCollectionByAttributeCode() + { + $sortOrder = $this->_orders['attribute_code']; + uasort($this->_items, function ($a, $b) use ($sortOrder) { + $cmp = strnatcmp($a->getData('attribute_code'), $b->getData('attribute_code')); + + return $sortOrder === self::SORT_ORDER_ASC ? $cmp : -$cmp; + }); + + return $this; + } + + /** + * Unescape 'like' value from condition + * + * @param string $likeValue + * @return string + */ + private function unescapeLikeValue(string $likeValue): string + { + $replaceFrom = ['\\\\', '\_', '\%']; + $replaceTo = ['\\', '_', '%']; + $value = trim($likeValue, "'%"); + $value = str_replace($replaceFrom, $replaceTo, $value); + + return $value; + } +} diff --git a/app/code/Magento/ImportExport/README.md b/app/code/Magento/ImportExport/README.md index 7319cfbe766f..9a130aee1102 100644 --- a/app/code/Magento/ImportExport/README.md +++ b/app/code/Magento/ImportExport/README.md @@ -1,2 +1,85 @@ -Magento_ImportExport module provides a framework and basic functionality for importing/exporting various entities in Magento. +# Magento_ImportExport module + +This module provides a framework and basic functionality for importing/exporting various entities in Magento. It can be disabled and in such case all dependent import/export functionality (products, customers, orders etc.) will be disabled in Magento. + +## Installation + +The Magento_ImportExport module creates the following tables in the database: +- `importexport_importdata` +- `import_history` + +All database schema changes made by this module are rolled back when the module gets disabled and setup:upgrade command is run. + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Structure + +`Files/` - the directory that contains sample import files. + +For information about a typical file structure of a module in Magento 2, see [Module file structure](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). + +## Extensibility + +Extension developers can interact with the Magento_ImportExport module. For more information about the Magento extension mechanism, see [Magento plugins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_ImportExport module. + +### Layouts + +This module introduces the following layout handles in the `view/frontend/layout` directory: + +- `adminhtml_export_getfilter` +- `adminhtml_export_index` +- `adminhtml_history_grid_block` +- `adminhtml_history_index` +- `adminhtml_import_busy` +- `adminhtml_import_index` +- `adminhtml_import_start` +- `adminhtml_import_validate` + +For more information about a layout in Magento 2, see the [Layout documentation](http://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). + +### UI components + +You can extend an export updates using the configuration files located in the `view/adminhtml/ui_component` directory: + +- `export_grid` + +For information about a UI component in Magento 2, see [Overview of UI components](http://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). + +### Public APIs + +- `Magento\ImportExport\Api\Data\ExportInfoInterface` + - getter and setter interface with data needed for export + +- `Magento\ImportExport\Api\Data\ExtendedExportInfoInterface` + - extends `Magento\ImportExport\Api\Data\ExportInfoInterface`. Contains data for skipped attributes + +- `\Magento\ImportExport\Api\ExportManagementInterface` + - Executing actual export and returns export data + +For information about a public API in Magento 2, see [Public interfaces & APIs](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/api-concepts.html). + +## Additional information + +#### Message Queue Consumer + +- `exportProcessor` - consumer to run export process + +[Learn how to manage Message Queues](https://devdocs.magento.com/guides/v2.4/config-guide/mq/manage-message-queues.html). + +#### Create custom import entity + +1. Declare the new import entity in `etc/import.xml` +2. Create an import model + +#### Create custom export entity + +1. Declare the new import entity in `etc/export.xml` +2. Create an export model + +You can get more information about import/export processes in magento at the articles: +- [Create custom import entity](https://devdocs.magento.com/guides/v2.4/ext-best-practices/tutorials/custom-import-entity.html) +- [Import](https://docs.magento.com/user-guide/system/data-import.html) +- [Export](https://docs.magento.com/user-guide/system/data-export.html) diff --git a/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminClickCheckDataImportActionGroup.xml b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminClickCheckDataImportActionGroup.xml new file mode 100644 index 000000000000..4b072e0c60a3 --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminClickCheckDataImportActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickCheckDataImportActionGroup"> + <annotations> + <description>Clicks the 'Check Data' button on the Admin Import page.</description> + </annotations> + <waitForElementVisible selector="{{AdminImportHeaderSection.checkDataButton}}" stepKey="waitForCheckDataButton"/> + <click selector="{{AdminImportHeaderSection.checkDataButton}}" stepKey="clickCheckDataButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminClickImportActionGroup.xml b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminClickImportActionGroup.xml new file mode 100644 index 000000000000..2e64c35d8c82 --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminClickImportActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickImportActionGroup"> + <annotations> + <description>Clicks the 'Import' button on the Admin Import page.</description> + </annotations> + <waitForElementVisible selector="{{AdminImportMainSection.importButton}}" stepKey="waitForImportButton"/> + <click selector="{{AdminImportMainSection.importButton}}" stepKey="clickImportButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementVisible selector="{{AdminImportValidationMessagesSection.notice}}" stepKey="waitForNoticeMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminDownloadImportHistoryFileActionGroup.xml b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminDownloadImportHistoryFileActionGroup.xml new file mode 100644 index 000000000000..b93364969231 --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminDownloadImportHistoryFileActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminDownloadImportHistoryFileActionGroup"> + <annotations> + <description>Downloads the imported file for the specified row on the admin System > Data Transfer > Import History page.</description> + </annotations> + <arguments> + <argument name="rowIndex" defaultValue="1" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminImportHistorySection.downloadLink(rowIndex)}}" stepKey="waitForDownloadLink"/> + <click selector="{{AdminImportHistorySection.downloadLink(rowIndex)}}" stepKey="clickDownloadLink"/> + <waitForPageLoad stepKey="waitForDownload"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminExportAttributeGridFillColumnFilterFieldsAndApplyActionGroup.xml b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminExportAttributeGridFillColumnFilterFieldsAndApplyActionGroup.xml new file mode 100644 index 000000000000..51de367d470a --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminExportAttributeGridFillColumnFilterFieldsAndApplyActionGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminExportAttributeGridFillColumnFilterFieldsAndApplyActionGroup"> + <arguments> + <argument name="attributeLabel" type="string" defaultValue=""/> + <argument name="attributeCode" type="string" defaultValue=""/> + </arguments> + + <waitForElementVisible selector="{{AdminExportAttributeSection.filterByFrontLabel}}" stepKey="seeFilterByFrontLabel"/> + <fillField selector="{{AdminExportAttributeSection.filterByFrontLabel}}" userInput="{{attributeLabel}}" stepKey="fillAttributeLabelField"/> + <fillField selector="{{AdminExportAttributeSection.filterByAttributeCode}}" userInput="{{attributeCode}}" stepKey="fillAttributeCodeField"/> + <click selector="{{AdminExportAttributeSection.search}}" stepKey="clickSearch"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminFillImportFormActionGroup.xml b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminFillImportFormActionGroup.xml new file mode 100644 index 000000000000..ac88333a89e4 --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminFillImportFormActionGroup.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminFillImportFormActionGroup"> + <annotations> + <description>Fills the form on the System > Data Transfer > Import page.</description> + </annotations> + <arguments> + <argument name="entityType" defaultValue="Products" type="string"/> + <argument name="importBehavior" defaultValue="Add/Update" type="string"/> + <argument name="validationStrategy" defaultValue="Stop on Error" type="string"/> + <argument name="allowedErrorsCount" defaultValue="10" type="string"/> + <argument name="fieldSeparator" defaultValue="," type="string"/> + <argument name="multipleValueSeparator" defaultValue="," type="string"/> + <argument name="emptyAttributeValueConstant" defaultValue="__EMPTY__VALUE__" type="string"/> + <argument name="imagesFileDirectory" defaultValue="" type="string"/> + <argument name="importFile" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminImportMainSection.entityType}}" stepKey="waitForEntityType"/> + <selectOption selector="{{AdminImportMainSection.entityType}}" userInput="{{entityType}}" stepKey="selectEntityType"/> + <waitForElementVisible selector="{{AdminImportMainSection.importBehavior}}" stepKey="waitForImportBehavior"/> + <selectOption selector="{{AdminImportMainSection.importBehavior}}" userInput="{{importBehavior}}" stepKey="selectImportBehaviorOption"/> + <selectOption selector="{{AdminImportMainSection.validationStrategy}}" userInput="{{validationStrategy}}" stepKey="selectValidationStrategyOption"/> + <fillField selector="{{AdminImportMainSection.allowedErrorsCount}}" userInput="{{allowedErrorsCount}}" stepKey="fillAllowedErrorsCountField"/> + <fillField selector="{{AdminImportMainSection.fieldSeparator}}" userInput="{{fieldSeparator}}" stepKey="fillFieldSeparatorField"/> + <fillField selector="{{AdminImportMainSection.multipleValueSeparator}}" userInput="{{multipleValueSeparator}}" stepKey="fillMultipleValueSeparatorField"/> + <fillField selector="{{AdminImportMainSection.emptyAttributeValueConstant}}" userInput="{{emptyAttributeValueConstant}}" stepKey="fillEmptyAttributeValueConstantField"/> + <attachFile selector="{{AdminImportMainSection.selectFileToImport}}" userInput="{{importFile}}" stepKey="attachFileForImport"/> + <fillField selector="{{AdminImportMainSection.imagesFileDirectory}}" userInput="{{imagesFileDirectory}}" stepKey="fillImagesFileDirectoryField"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminGetExportFilenameOnServerActionGroup.xml b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminGetExportFilenameOnServerActionGroup.xml new file mode 100644 index 000000000000..8647b58457a8 --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminGetExportFilenameOnServerActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminGetExportFilenameOnServerActionGroup"> + <annotations> + <description>Return the export filename on server at provided index.</description> + </annotations> + <arguments> + <argument name="rowIndex" defaultValue="0" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminExportAttributeSection.selectByIndex(rowIndex)}}" stepKey="waitForTheRow"/> + <grabAttributeFrom selector="{{AdminExportAttributeSection.download(rowIndex)}}" userInput="href" stepKey="grabDownloadUrl"/> + <executeJS function="var href = '{$grabDownloadUrl}'; return href.toQueryParams().filename;" stepKey="grabFilename"/> + <return value="{$grabFilename}" stepKey="returnFilename"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminNavigateToImportHistoryPageActionGroup.xml b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminNavigateToImportHistoryPageActionGroup.xml new file mode 100644 index 000000000000..02a5990b9ad2 --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminNavigateToImportHistoryPageActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminNavigateToImportHistoryPageActionGroup"> + <annotations> + <description>Navigates to the admin System > Data Transfer > Import History page.</description> + </annotations> + <amOnPage url="{{AdminImportHistoryPage.url}}" stepKey="navigateToImportHistoryPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminNavigateToImportPageActionGroup.xml b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminNavigateToImportPageActionGroup.xml new file mode 100644 index 000000000000..03c2fea99899 --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminNavigateToImportPageActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminNavigateToImportPageActionGroup"> + <annotations> + <description>Navigates to the admin System > Data Transfer > Import page.</description> + </annotations> + <amOnPage url="{{AdminImportIndexPage.url}}" stepKey="navigateToImportPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AssertAdminExportFilterGridFirstRowContainsAttributeCodeActionGroup.xml b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AssertAdminExportFilterGridFirstRowContainsAttributeCodeActionGroup.xml new file mode 100644 index 000000000000..2e9bd50ee75f --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AssertAdminExportFilterGridFirstRowContainsAttributeCodeActionGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminExportFilterGridFirstRowContainsAttributeCodeActionGroup"> + <arguments> + <argument name="attributeCode" type="string" defaultValue="allow_message"/> + </arguments> + + <grabTextFrom selector="{{AdminExportAttributeSection.rowAttributeCodeCell('1')}}" stepKey="getTextFirstRowContainsAttributeCode"/> + <assertStringContainsString stepKey="checkTextInFirstRowContainsAttributeCode"> + <actualResult type="variable">getTextFirstRowContainsAttributeCode</actualResult> + <expectedResult type="string">{{attributeCode}}</expectedResult> + </assertStringContainsString> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Data/ImportData.xml b/app/code/Magento/ImportExport/Test/Mftf/Data/ImportData.xml new file mode 100644 index 000000000000..b962588ab911 --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Mftf/Data/ImportData.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <!-- Common Messages --> + <entity name="ImportCommonMessages"> + <data key="validFile">File is valid! To start import process press "Import" button</data> + <data key="success">Import successfully done</data> + </entity> +</entities> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Page/AdminImportHistoryPage.xml b/app/code/Magento/ImportExport/Test/Mftf/Page/AdminImportHistoryPage.xml new file mode 100644 index 000000000000..728db6fe51be --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Mftf/Page/AdminImportHistoryPage.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="AdminImportHistoryPage" url="admin/history" area="admin" module="Magento_ImportExport"/> +</pages> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Section/AdminExportAttributeSection.xml b/app/code/Magento/ImportExport/Test/Mftf/Section/AdminExportAttributeSection.xml index d6970feb4bb3..002b31a6e852 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Section/AdminExportAttributeSection.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Section/AdminExportAttributeSection.xml @@ -9,8 +9,10 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminExportAttributeSection"> <element name="filterByAttributeCode" type="input" selector="#export_filter_grid_filter_attribute_code"/> + <element name="filterByFrontLabel" type="input" selector="#export_filter_grid_filter_frontend_label"/> <element name="resetFilter" type="button" selector="button[data-action='grid-filter-reset']" timeout="30"/> <element name="search" type="button" selector="button[data-action=grid-filter-apply]" timeout="30"/> + <element name="rowAttributeCodeCell" type="block" selector="//table[@id='export_filter_grid_table']/tbody/tr[{{row}}]/td[contains(@class,'col-attribute_code')]" parameterized="true"/> <element name="chooseAttribute" type="checkbox" selector="//*[@name='export_filter[{{var}}]']/ancestor::tr//input[@type='checkbox']" parameterized="true"/> <element name="fillFilter" type="input" selector="//*[@name='export_filter[{{var}}]']/ancestor::tr//input[@type='text']" parameterized="true"/> <element name="continueBtn" type="button" selector="//*[@id='export_filter_container']/button" timeout="30"/> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Section/AdminExportMainSection.xml b/app/code/Magento/ImportExport/Test/Mftf/Section/AdminExportMainSection.xml index da1d928607e7..49a18d1f2a92 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Section/AdminExportMainSection.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Section/AdminExportMainSection.xml @@ -9,6 +9,8 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminExportMainSection"> <element name="entityType" type="select" selector="#entity"/> + <element name="fileFormat" type="select" selector="#file_format"/> + <element name="fieldsEnclosure" type="input" selector="#fields_enclosure"/> <element name="entityAttributes" type="select" selector="#export_filter_form"/> </section> </sections> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportHistorySection.xml b/app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportHistorySection.xml new file mode 100644 index 000000000000..3dc63deb7ad0 --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportHistorySection.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminImportHistorySection"> + <element name="downloadLink" type="button" parameterized="true" selector="#importHistoryGrid_table tbody tr:nth-of-type({{rowIndex}}) [data-column=imported_file] a"/> + <element name="importedFileName" type="text" parameterized="true" selector="#importHistoryGrid_table tbody tr:nth-of-type({{rowIndex}}) [data-column=imported_file] p"/> + </section> +</sections> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportMainSection.xml b/app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportMainSection.xml index 0f647aa027c2..5f4fa2015426 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportMainSection.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportMainSection.xml @@ -17,6 +17,10 @@ <element name="messageError" type="text" selector=".messages div.message-error"/> <element name="validationStrategy" type="select" selector="#basic_behaviorvalidation_strategy"/> <element name="allowedErrorsCount" type="input" selector="#basic_behavior_allowed_error_count"/> + <element name="fieldSeparator" type="input" selector="#basic_behavior__import_field_separator"/> + <element name="multipleValueSeparator" type="input" selector="#basic_behavior_import_multiple_value_separator"/> + <element name="emptyAttributeValueConstant" type="input" selector="#basic_behavior_import_empty_attribute_value_constant"/> + <element name="imagesFileDirectory" type="input" selector="#import_images_file_dir"/> <element name="importImagesFileDirNote" type="input" selector="#import_images_file_dir-note"/> </section> </sections> diff --git a/app/code/Magento/ImportExport/Test/Unit/Block/Adminhtml/Export/FilterTest.php b/app/code/Magento/ImportExport/Test/Unit/Block/Adminhtml/Export/FilterTest.php index a68bf1910692..cf69cdf7ee36 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Block/Adminhtml/Export/FilterTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Block/Adminhtml/Export/FilterTest.php @@ -7,33 +7,20 @@ namespace Magento\ImportExport\Test\Unit\Block\Adminhtml\Export; +use Magento\Backend\Block\Template\Context; use Magento\Backend\Helper\Data; -use Magento\Catalog\Model\Product\ReservedAttributeList; -use Magento\Catalog\Model\ResourceModel\Product; use Magento\Eav\Api\Data\AttributeOptionInterfaceFactory; -use Magento\Eav\Model\Config; use Magento\Eav\Model\Entity\Attribute; use Magento\Eav\Model\Entity\TypeFactory; -use Magento\Eav\Model\ResourceModel\Helper; -use Magento\Framework\Api\AttributeValueFactory; -use Magento\Framework\Api\DataObjectHelper; -use Magento\Framework\Api\ExtensionAttributesFactory; -use Magento\Framework\Data\Collection\AbstractDb; use Magento\Framework\DataObject; use Magento\Framework\Escaper; use Magento\Framework\Filesystem; -use Magento\Framework\Locale\Resolver; -use Magento\Framework\Model\Context; -use Magento\Framework\Reflection\DataObjectProcessor; -use Magento\Framework\Registry; -use Magento\Framework\Stdlib\DateTime\DateTimeFormatterInterface; use Magento\Framework\Stdlib\DateTime\Timezone; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; -use Magento\Framework\Validator\UniversalFactory; use Magento\Framework\View\Element\Html\Date; +use Magento\Framework\View\Element\Html\Select; use Magento\Framework\View\Layout; use Magento\ImportExport\Block\Adminhtml\Export\Filter; -use Magento\Store\Model\StoreManager; +use Magento\ImportExport\Model\ResourceModel\Export\AttributeGridCollectionFactory; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -43,279 +30,302 @@ class FilterTest extends TestCase { /** - * @var Context|MockObject - */ - protected $modelContext; - - /** - * @var Registry|MockObject - */ - protected $registry; - - /** - * @var ExtensionAttributesFactory|MockObject - */ - protected $extensionFactory; - - /** - * @var AttributeValueFactory|MockObject - */ - protected $customAttributeFactory; - - /** - * @var Config|MockObject - */ - protected $eavConfig; - - /** - * @var TypeFactory|MockObject - */ - protected $eavTypeFactory; - - /** - * @var StoreManager|MockObject - */ - protected $storeManager; - - /** - * @var Helper|MockObject - */ - protected $resourceHelper; - - /** - * @var UniversalFactory|MockObject - */ - protected $universalFactory; - - /** - * @var AttributeOptionInterfaceFactory|MockObject - */ - protected $optionDataFactory; - - /** - * @var DataObjectProcessor|MockObject - */ - protected $dataObjectProcessor; - - /** - * @var DataObjectHelper|MockObject - */ - protected $dataObjectHelper; - - /** - * @var Timezone|MockObject - */ - protected $localeDate; - - /** - * @var ReservedAttributeList|MockObject - */ - protected $reservedAttributeList; - - /** - * @var Resolver|MockObject + * @var Filter|MockObject */ - protected $localeResolver; + private $filter; /** - * @var Product|MockObject + * @var Layout|MockObject */ - protected $resource; + private $layout; /** - * @var MockObject + * @inheritdoc */ - protected $resourceCollection; + protected function setUp(): void + { + $context = $this->getMockBuilder(Context::class) + ->onlyMethods(['getFileSystem', 'getEscaper', 'getLocaleDate', 'getLayout']) + ->disableOriginalConstructor() + ->getMock(); + $filesystem = $this->createMock(Filesystem::class); + $context->expects($this->any())->method('getFileSystem')->willReturn($filesystem); + $escaper = $this->createPartialMock(Escaper::class, ['escapeHtml']); + $escaper->expects($this->any())->method('escapeHtml')->willReturnArgument(0); + $context->expects($this->any())->method('getEscaper')->willReturn($escaper); + $timeZone = $this->createMock(Timezone::class); + $timeZone->expects($this->any())->method('getDateFormat')->willReturn('M/d/yy'); + $context->expects($this->any())->method('getLocaleDate')->willReturn($timeZone); + $this->layout = $this->createMock(Layout::class); + $context->expects($this->any())->method('getLayout')->willReturn($this->layout); + $backendHelper = $this->createMock(Data::class); + $importExportData = $this->createMock(\Magento\ImportExport\Helper\Data::class); + $attributeGridCollectionFactory = $this->createMock(AttributeGridCollectionFactory::class); + $this->filter = new Filter( + $context, + $backendHelper, + $importExportData, + [], + $attributeGridCollectionFactory + ); + } /** - * @var \Magento\Backend\Block\Template\Context|MockObject + * Test date filter + * + * @param array $attributeData + * @param array $values + * @param array $expect + * @dataProvider dateFilterDataProvider */ - protected $context; + public function testDateFilter(array $attributeData, array $values, array $expect): void + { + $type = Date::class; + $block = $block = $this->getMockBuilder($type) + ->addMethods(['setValue']) + ->onlyMethods(['getHtml']) + ->disableOriginalConstructor() + ->getMock(); + $block->expects($this->exactly(2)) + ->method('setValue') + ->withConsecutive(...$expect) + ->willReturnSelf(); + $this->layout->expects($this->once()) + ->method('createBlock') + ->with($type) + ->willReturn($block); + $attribute = $this->getAttributeMock($attributeData); + $column = new DataObject(); + $column->addData($values); + $isExport = true; + $result = $this->filter->decorateFilter(null, $attribute, $column, $isExport); + $this->assertNotNull($result); + } /** - * @var Data|MockObject + * @return array[] */ - protected $backendHelper; + public function dateFilterDataProvider(): array + { + return [ + [ + [ + 'attribute_code' =>'updated_at', + 'frontend_input' => '', + 'options' => [], + 'filter_options' => [], + 'backend_type' => 'datetime', + ], + ['values' => ['updated_at' => ['12/12/12', '12/15/12']]], + [ + ['12/12/12'], + ['12/15/12'] + ] + ], + ]; + } /** - * @var \Magento\ImportExport\Helper\Data|MockObject + * Test select filter + * + * @param array $attributeData + * @param array $values + * @param array $expect + * @dataProvider selectFilterDataProvider */ - protected $importExportData; + public function testSelectFilter(array $attributeData, array $values, array $expect): void + { + $html = '<select></select>'; + $type = Select::class; + $block = $block = $this->getMockBuilder($type) + ->onlyMethods(['getHtml']) + ->disableOriginalConstructor() + ->getMock(); + $block->expects($this->once()) + ->method('getHtml') + ->willReturn($html); + $this->layout->expects($this->once()) + ->method('createBlock') + ->with($type) + ->willReturn($block); + $attribute = $this->getAttributeMock($attributeData); + $column = new DataObject(); + $column->addData($values); + $isExport = true; + $result = $this->filter->decorateFilter(null, $attribute, $column, $isExport); + $this->assertEquals($html, $result); + $this->assertSame($expect['value'], $block->getValue()); + $this->assertEquals($expect['options'], $block->getOptions()); + } /** - * @var ObjectManagerHelper + * @return array[] */ - protected $objectManagerHelper; + public function selectFilterDataProvider(): array + { + return [ + [ + [ + 'attribute_code' => 'color', + 'frontend_input' => 'select', + 'filter_options' => ['6' => 'Green', '7' => 'Blue'], + 'backend_type' => 'select', + ], + ['values' => ['color' => '6']], + [ + 'value' => '6', + 'options' => [ + [ + 'label' => '-- Not Selected --', + 'value' => '' + ], + [ + 'label' => 'Green', + 'value' => '6' + ], + [ + 'label' => 'Blue', + 'value' => '7' + ] + ] + ] + ], + [ + [ + 'attribute_code' => 'color', + 'frontend_input' => 'select', + 'filter_options' => ['6' => 'Green', '7' => 'Blue'], + 'backend_type' => 'select', + ], + ['values' => ['color' => '']], + [ + 'value' => null, + 'options' => [ + [ + 'label' => '-- Not Selected --', + 'value' => '' + ], + [ + 'label' => 'Green', + 'value' => '6' + ], + [ + 'label' => 'Blue', + 'value' => '7' + ] + ] + ] + ] + ]; + } /** - * @var Filter|MockObject + * Test input filter + * + * @param array $attributeData + * @param array $values + * @param array $expect + * @dataProvider inputFilterDataProvider */ - protected $filter; + public function testInputFilter(array $attributeData, array $values, array $expect): void + { + $this->layout->expects($this->never()) + ->method('createBlock'); + $attribute = $this->getAttributeMock($attributeData); + $column = new DataObject(); + $column->addData($values); + $isExport = true; + $result = $this->filter->decorateFilter(null, $attribute, $column, $isExport); + $tag = simplexml_load_string($result); + $attributes = []; + foreach ($tag->attributes() as $name => $value) { + $attributes[$name] = "$value"; + } + $this->assertEquals($expect, array_intersect_key($expect, $attributes)); + } /** - * @var DateTimeFormatterInterface|MockObject + * @return array[] */ - private $dateTimeFormatter; - - protected function setUp(): void + public function inputFilterDataProvider(): array { - $this->modelContext = $this->createMock(Context::class); - $this->registry = $this->createMock(Registry::class); - $this->extensionFactory = $this->createMock(ExtensionAttributesFactory::class); - $this->customAttributeFactory = $this->createMock(AttributeValueFactory::class); - $this->eavConfig = $this->createMock(Config::class); - $this->eavTypeFactory = $this->createMock(TypeFactory::class); - $this->storeManager = $this->createMock(StoreManager::class); - $this->resourceHelper = $this->createMock(Helper::class); - $this->universalFactory = $this->createMock(UniversalFactory::class); - $this->optionDataFactory = $this->createMock(AttributeOptionInterfaceFactory::class); - $this->dataObjectProcessor = $this->createMock(DataObjectProcessor::class); - $this->dataObjectHelper = $this->createMock(DataObjectHelper::class); - $this->localeDate = $this->createMock(Timezone::class); - $this->localeDate->expects($this->any())->method('getDateFormat')->willReturn('12-12-2012'); - $this->reservedAttributeList = $this->createMock(ReservedAttributeList::class); - $this->localeResolver = $this->createMock(Resolver::class); - $this->resource = $this->createMock(Product::class); - $this->resourceCollection = $this->getMockForAbstractClass( - AbstractDb::class, - [], - '', - false - ); - $this->context = $this->getMockBuilder(\Magento\Backend\Block\Template\Context::class) - ->onlyMethods(['getFileSystem', 'getEscaper', 'getLocaleDate', 'getLayout']) - ->disableOriginalConstructor() - ->getMock(); - $filesystem = $this->createMock(Filesystem::class); - $this->context->expects($this->any())->method('getFileSystem')->willReturn($filesystem); - $escaper = $this->createPartialMock(Escaper::class, ['escapeHtml']); - $escaper->expects($this->any())->method('escapeHtml')->willReturn(''); - $this->context->expects($this->any())->method('getEscaper')->willReturn($escaper); - $timeZone = $this->createMock(Timezone::class); - $timeZone->expects($this->any())->method('getDateFormat')->willReturn('M/d/yy'); - $this->context->expects($this->any())->method('getLocaleDate')->willReturn($timeZone); - $dateBlock = $this->getMockBuilder(Date::class) - ->addMethods(['setValue', 'setId', 'getId']) - ->onlyMethods(['getHtml']) - ->disableOriginalConstructor() - ->getMock(); - $dateBlock->expects($this->any())->method('setValue')->willReturnSelf(); - $dateBlock->expects($this->any())->method('getHtml')->willReturn(''); - $dateBlock->expects($this->any())->method('setId')->willReturnSelf(); - $dateBlock->expects($this->any())->method('getId')->willReturn(1); - $layout = $this->createMock(Layout::class); - $layout->expects($this->any())->method('createBlock')->willReturn($dateBlock); - $this->context->expects($this->any())->method('getLayout')->willReturn($layout); - $this->backendHelper = $this->createMock(Data::class); - $this->importExportData = $this->createMock(\Magento\ImportExport\Helper\Data::class); - $this->dateTimeFormatter = $this->createMock( - DateTimeFormatterInterface::class - ); - $this->objectManagerHelper = new ObjectManagerHelper($this); - $this->filter = $this->objectManagerHelper->getObject( - Filter::class, + return [ [ - 'context' => $this->context, - 'backendHelper' => $this->backendHelper, - 'importExportData' => $this->importExportData - ] - ); + [ + 'attribute_code' => 'category_ids', + 'frontend_input' => '', + 'options' => [], + 'filter_options' => [], + 'backend_type' => 'varchar', + ], + ['values' => ['category_ids' => '1']], + [ + 'name' => 'export_filter[category_ids]', + 'value' => '1', + ] + ], + ]; } /** - * Test decorateFilter() + * Test number filter * * @param array $attributeData - * @param string $backendType - * @param array $columnValue - * @dataProvider decorateFilterDataProvider + * @param array $values + * @param array $expect + * @dataProvider numberFilterDataProvider */ - public function testDecorateFilter($attributeData, $backendType, $columnValue) + public function testNumberFilter(array $attributeData, array $values, array $expect): void { - $value = ''; - $attribute = new Attribute( - $this->modelContext, - $this->registry, - $this->extensionFactory, - $this->customAttributeFactory, - $this->eavConfig, - $this->eavTypeFactory, - $this->storeManager, - $this->resourceHelper, - $this->universalFactory, - $this->optionDataFactory, - $this->dataObjectProcessor, - $this->dataObjectHelper, - $this->localeDate, - $this->reservedAttributeList, - $this->localeResolver, - $this->dateTimeFormatter, - $this->resource, - $this->resourceCollection - ); - $attribute->setAttributeCode($attributeData['code']); - $attribute->setFrontendInput($attributeData['input']); - $attribute->setOptions($attributeData['options']); - $attribute->setFilterOptions($attributeData['filter_options']); - $attribute->setBackendType($backendType); + $this->layout->expects($this->never()) + ->method('createBlock'); + $attribute = $this->getAttributeMock($attributeData); $column = new DataObject(); - $column->setData($columnValue, 'value'); + $column->addData($values); $isExport = true; - $result = $this->filter->decorateFilter($value, $attribute, $column, $isExport); - $this->assertNotNull($result); + $result = $this->filter->decorateFilter(null, $attribute, $column, $isExport); + $this->assertStringContainsString($expect[0], $result); + $this->assertStringContainsString($expect[1], $result); } /** - * Dataprovider for testDecorateFilter() - * - * @return array + * @return array[] */ - public function decorateFilterDataProvider() + public function numberFilterDataProvider(): array { return [ [ - 'attributeCode' => [ - 'code' =>'updated_at', - 'input' => '', + [ + 'attribute_code' => 'cost', + 'frontend_input' => '', 'options' => [], - 'filter_options' => [] + 'filter_options' => [], + 'backend_type' => 'decimal', ], - 'backendType' => 'datetime', - 'columnValue' => ['values' => ['updated_at' => '12/12/12']] + ['values' => ['cost' => ['3', '5']]], + [ + 'value="3"', + 'value="5"', + ] ], - [ - 'attributeCode' => [ - 'code' => 'category_ids', - 'input' => '', - 'options' => [], - 'filter_options' => [] - ], - 'backendType' => 'varchar', - 'columnValue' => ['values' => ['category_ids' => '1']] - ], - [ - 'attributeCode' => [ - 'code' => 'cost', - 'input' => '', - 'options' => [], - 'filter_options' => [] - ], - 'backendType' => 'decimal', - 'columnValue' => ['values' => ['cost' => 'cost']] - ], - [ - 'attributeCode' => [ - 'code' => 'color', - 'input' => 'select', - 'options' => ['red' => 'red'], - 'filter_options' => ['opt' => 'val'] - ], - 'backendType' => 'select', - 'columnValue' => ['values' => ['color' => 'red']] - ] ]; } + /** + * @param array $data + * @return Attribute + */ + private function getAttributeMock(array $data): Attribute + { + $attribute = $this->getMockBuilder(Attribute::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $attribute->addData($data); + + return $attribute; + } + /** * Test for protected method prepareForm() * diff --git a/app/code/Magento/ImportExport/Test/Unit/Controller/Adminhtml/Export/File/DownloadTest.php b/app/code/Magento/ImportExport/Test/Unit/Controller/Adminhtml/Export/File/DownloadTest.php index d5a3ca142472..5e0385c3a521 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Controller/Adminhtml/Export/File/DownloadTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Controller/Adminhtml/Export/File/DownloadTest.php @@ -131,6 +131,10 @@ protected function setUp(): void ->method('getMessageManager') ->willReturn($this->messageManagerMock); + $this->fileSystemMock->expects($this->any()) + ->method('getDirectoryRead') + ->willReturn($this->directoryMock); + $this->objectManagerHelper = new ObjectManagerHelper($this); $this->downloadControllerMock = $this->objectManagerHelper->getObject( Download::class, @@ -150,10 +154,7 @@ public function testExecuteSuccess() $this->requestMock->method('getParam') ->with('filename') ->willReturn('sampleFile.csv'); - - $this->fileSystemMock->expects($this->once()) - ->method('getDirectoryRead') - ->willReturn($this->directoryMock); + $this->directoryMock->expects($this->once())->method('isExist')->willReturn(true); $this->directoryMock->expects($this->once())->method('isFile')->willReturn(true); $this->fileFactoryMock->expects($this->once())->method('create'); @@ -169,10 +170,8 @@ public function testExecuteFileDoesntExists() ->with('filename') ->willReturn('sampleFile'); - $this->fileSystemMock->expects($this->once()) - ->method('getDirectoryRead') - ->willReturn($this->directoryMock); $this->directoryMock->expects($this->once())->method('isFile')->willReturn(false); + $this->directoryMock->expects($this->once())->method('isExist')->willReturn(true); $this->messageManagerMock->expects($this->once())->method('addErrorMessage'); $this->downloadControllerMock->execute(); diff --git a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php index a09de5b761a0..f7f576476246 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php @@ -11,7 +11,9 @@ use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\Helper\Context; use Magento\Framework\App\Request\Http; +use Magento\Framework\Exception\ValidatorException; use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\Read; use Magento\Framework\Filesystem\Directory\Write; use Magento\Framework\HTTP\Adapter\FileTransferFactory; use Magento\Framework\Indexer\IndexerRegistry; @@ -60,6 +62,11 @@ class ReportTest extends TestCase */ protected $varDirectory; + /** + * @var Read|MockObject + */ + protected $importHistoryDirectory; + /** * @var Report */ @@ -87,14 +94,48 @@ protected function setUp(): void ->getMock(); $this->varDirectory = $this->createPartialMock( Write::class, - ['getRelativePath', 'readFile', 'isFile', 'stat'] + ['getRelativePath', 'getAbsolutePath', 'readFile', 'isFile', 'stat'] + ); + $this->importHistoryDirectory = $this->createPartialMock( + Read::class, + ['getAbsolutePath'] + ); + + $this->filesystem = $this->createPartialMock( + Filesystem::class, + ['getDirectoryWrite', 'getDirectoryReadByPath'] ); - $this->filesystem = $this->createPartialMock(Filesystem::class, ['getDirectoryWrite']); - $this->varDirectory->expects($this->any())->method('getRelativePath')->willReturn('path'); - $this->varDirectory->expects($this->any())->method('readFile')->willReturn('contents'); - $this->varDirectory->expects($this->any())->method('isFile')->willReturn(true); - $this->varDirectory->expects($this->any())->method('stat')->willReturn(false); - $this->filesystem->expects($this->any())->method('getDirectoryWrite')->willReturn($this->varDirectory); + $this->varDirectory + ->expects($this->any()) + ->method('getRelativePath') + ->willReturn('path'); + $this->varDirectory + ->expects($this->any()) + ->method('getAbsolutePath') + ->willReturn('path'); + $this->varDirectory + ->expects($this->any()) + ->method('readFile') + ->willReturn('contents'); + $this->varDirectory + ->expects($this->any()) + ->method('isFile') + ->willReturn(true); + $this->varDirectory + ->expects($this->any()) + ->method('stat') + ->willReturn(false); + $this->filesystem + ->expects($this->any()) + ->method('getDirectoryWrite') + ->willReturn($this->varDirectory); + $this->importHistoryDirectory + ->expects($this->any())->method('getAbsolutePath') + ->willReturnArgument(0); + $this->filesystem + ->expects($this->any()) + ->method('getDirectoryReadByPath') + ->willReturn($this->importHistoryDirectory); $this->objectManagerHelper = new ObjectManagerHelper($this); $this->report = $this->objectManagerHelper->getObject( Report::class, @@ -144,9 +185,15 @@ public function testGetSummaryStats() Product::class, ['getEntityTypeCode', 'setParameters'] ); - $product->expects($this->any())->method('getEntityTypeCode')->willReturn('catalog_product'); - $product->expects($this->any())->method('setParameters')->willReturn(''); - $entityFactory->expects($this->any())->method('create')->willReturn($product); + $product->expects($this->any()) + ->method('getEntityTypeCode') + ->willReturn('catalog_product'); + $product->expects($this->any()) + ->method('setParameters') + ->willReturn(''); + $entityFactory->expects($this->any()) + ->method('create') + ->willReturn($product); $importData = $this->createMock(\Magento\ImportExport\Model\ResourceModel\Import\Data::class); $csvFactory = $this->createMock(CsvFactory::class); $httpFactory = $this->createMock(FileTransferFactory::class); @@ -184,7 +231,10 @@ public function testGetSummaryStats() public function testImportFileExistsException($fileName) { $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Filename has not permitted symbols in it'); + $this->expectExceptionMessage('File not found'); + $this->importHistoryDirectory->expects($this->any()) + ->method('getAbsolutePath') + ->will($this->throwException(new ValidatorException(__("Error")))); $this->report->importFileExists($fileName); } diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/LocalizedFileNameTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/LocalizedFileNameTest.php new file mode 100644 index 000000000000..8c69c21fdd06 --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Unit/Model/LocalizedFileNameTest.php @@ -0,0 +1,84 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ImportExport\Test\Unit\Model; + +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; +use Magento\ImportExport\Model\LocalizedFileName; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test for localized filename model + */ +class LocalizedFileNameTest extends TestCase +{ + /** + * @var TimezoneInterface|MockObject + */ + private $timezone; + + /** + * @var LocalizedFileName + */ + private $model; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->timezone = $this->createMock(TimezoneInterface::class); + $this->model = new LocalizedFileName( + $this->timezone, + [ + 'Y-m-d_H-i-s', + 'YmdHis' + ] + ); + } + + /** + * @param string $filename + * @param string $displayName + * @dataProvider getFileDisplayNameDataProvider + */ + public function testGetFileDisplayName(string $filename, string $displayName): void + { + $this->timezone + ->method('scopeDate') + ->willReturnCallback( + function () { + return func_get_args()[1]->modify('+12 hour'); + } + ); + $this->assertEquals($displayName, $this->model->getFileDisplayName($filename)); + } + + /** + * @return array + */ + public function getFileDisplayNameDataProvider(): array + { + return [ + [ + 'export_products_2021-01-03_13-42-53', + 'export_products_2021-01-04_01-42-53', + ], + [ + '20210513102351_export_customers', + '20210513222351_export_customers', + ], + //unknown format + [ + 'export_products_20210103T134253', + 'export_products_20210103T134253', + ], + ]; + } +} diff --git a/app/code/Magento/ImportExport/Ui/Component/Columns/FileDisplayName.php b/app/code/Magento/ImportExport/Ui/Component/Columns/FileDisplayName.php new file mode 100644 index 000000000000..aed9f09adb8f --- /dev/null +++ b/app/code/Magento/ImportExport/Ui/Component/Columns/FileDisplayName.php @@ -0,0 +1,57 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ImportExport\Ui\Component\Columns; + +use Magento\Framework\View\Element\UiComponent\ContextInterface; +use Magento\Framework\View\Element\UiComponentFactory; +use Magento\ImportExport\Model\LocalizedFileName; +use Magento\Ui\Component\Listing\Columns\Column; + +/** + * File display name column + */ +class FileDisplayName extends Column +{ + /** + * @var LocalizedFileName + */ + private $localizedFileName; + + /** + * @param ContextInterface $context + * @param UiComponentFactory $uiComponentFactory + * @param LocalizedFileName $localizedFileName + * @param array $components + * @param array $data + */ + public function __construct( + ContextInterface $context, + UiComponentFactory $uiComponentFactory, + LocalizedFileName $localizedFileName, + array $components = [], + array $data = [] + ) { + parent::__construct($context, $uiComponentFactory, $components, $data); + $this->localizedFileName = $localizedFileName; + } + + /** + * @inheritdoc + */ + public function prepareDataSource(array $dataSource) + { + $fieldName = $this->getData('name'); + if (isset($dataSource['data']['items'])) { + foreach ($dataSource['data']['items'] as & $item) { + $item[$fieldName] = $this->localizedFileName->getFileDisplayName($item['file_name']); + } + } + + return $dataSource; + } +} diff --git a/app/code/Magento/ImportExport/etc/di.xml b/app/code/Magento/ImportExport/etc/di.xml index 2a9e1d388754..66d7fc94ee17 100644 --- a/app/code/Magento/ImportExport/etc/di.xml +++ b/app/code/Magento/ImportExport/etc/di.xml @@ -32,4 +32,11 @@ </argument> </arguments> </type> + <type name="Magento\ImportExport\Model\LocalizedFileName"> + <arguments> + <argument name="dateFormats" xsi:type="array"> + <item name="Ymd_His" xsi:type="string">Ymd_His</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/ImportExport/view/adminhtml/ui_component/export_grid.xml b/app/code/Magento/ImportExport/view/adminhtml/ui_component/export_grid.xml index 1922f58ed47a..85a25d73bdab 100644 --- a/app/code/Magento/ImportExport/view/adminhtml/ui_component/export_grid.xml +++ b/app/code/Magento/ImportExport/view/adminhtml/ui_component/export_grid.xml @@ -38,7 +38,7 @@ <paging name="listing_paging"/> </listingToolbar> <columns name="export_grid_columns"> - <column name="file_name"> + <column name="file_display_name" class="Magento\ImportExport\Ui\Component\Columns\FileDisplayName"> <settings> <sortable>false</sortable> <label translate="true">File name</label> @@ -50,4 +50,4 @@ </settings> </actionsColumn> </columns> -</listing> \ No newline at end of file +</listing> diff --git a/app/code/Magento/Indexer/App/Indexer.php b/app/code/Magento/Indexer/App/Indexer.php index 89f153ee9aa4..9bb594c65678 100644 --- a/app/code/Magento/Indexer/App/Indexer.php +++ b/app/code/Magento/Indexer/App/Indexer.php @@ -27,6 +27,11 @@ class Indexer implements \Magento\Framework\AppInterface */ protected $_response; + /** + * @var \Magento\Indexer\Model\Processor + */ + private $processor; + /** * @param string $reportDir * @param \Magento\Framework\Filesystem $filesystem diff --git a/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php b/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php index d6e6c2f1fc2c..5f21228665a0 100644 --- a/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php +++ b/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php @@ -16,6 +16,7 @@ use Magento\Framework\Indexer\IndexerRegistry; use Magento\Framework\Indexer\StateInterface; use Magento\Indexer\Model\Processor\MakeSharedIndexValid; +use Psr\Log\LoggerInterface; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -50,21 +51,29 @@ class IndexerReindexCommand extends AbstractIndexerManageCommand */ private $makeSharedValid; + /** + * @var LoggerInterface + */ + private $logger; + /** * @param ObjectManagerFactory $objectManagerFactory * @param IndexerRegistry|null $indexerRegistry * @param DependencyInfoProvider|null $dependencyInfoProvider * @param MakeSharedIndexValid|null $makeSharedValid + * @param LoggerInterface|null $logger */ public function __construct( ObjectManagerFactory $objectManagerFactory, IndexerRegistry $indexerRegistry = null, DependencyInfoProvider $dependencyInfoProvider = null, - MakeSharedIndexValid $makeSharedValid = null + MakeSharedIndexValid $makeSharedValid = null, + ?LoggerInterface $logger = null ) { $this->indexerRegistry = $indexerRegistry; $this->dependencyInfoProvider = $dependencyInfoProvider; $this->makeSharedValid = $makeSharedValid; + $this->logger = $logger ?: ObjectManager::getInstance()->get(LoggerInterface::class); parent::__construct($objectManagerFactory); } @@ -108,15 +117,14 @@ protected function execute(InputInterface $input, OutputInterface $output) $output->writeln( __('has been rebuilt successfully in %time', ['time' => gmdate('H:i:s', $resultTime)]) ); - } catch (LocalizedException $e) { - $output->writeln(__('exception: %message', ['message' => $e->getMessage()])); - $returnValue = Cli::RETURN_FAILURE; - } catch (\Exception $e) { - $output->writeln('process unknown error:'); + } catch (\Throwable $e) { + $output->writeln('process error during indexation process:'); $output->writeln($e->getMessage()); $output->writeln($e->getTraceAsString(), OutputInterface::VERBOSITY_DEBUG); $returnValue = Cli::RETURN_FAILURE; + + $this->logger->critical($e->getMessage()); } } diff --git a/app/code/Magento/Indexer/Model/Indexer/CacheCleaner.php b/app/code/Magento/Indexer/Model/Indexer/CacheCleaner.php index 1cf7142e07ca..cd7e807f87b4 100644 --- a/app/code/Magento/Indexer/Model/Indexer/CacheCleaner.php +++ b/app/code/Magento/Indexer/Model/Indexer/CacheCleaner.php @@ -7,10 +7,7 @@ namespace Magento\Indexer\Model\Indexer; -use Magento\Framework\App\CacheInterface; -use Magento\Framework\Event\Manager as EventManager; use Magento\Framework\Indexer\ActionInterface; -use Magento\Framework\Indexer\CacheContext; /** * Clean cache for reindexed entities after executed action. @@ -18,45 +15,53 @@ class CacheCleaner { /** - * @var EventManager + * @var DeferredCacheCleaner */ - private $eventManager; + private $cacheCleaner; /** - * @var CacheContext + * @param DeferredCacheCleaner $cacheCleaner */ - private $cacheContext; + public function __construct( + DeferredCacheCleaner $cacheCleaner + ) { + $this->cacheCleaner = $cacheCleaner; + } /** - * @var CacheInterface + * Defer cache cleaning until after execute full + * + * @param ActionInterface $subject + * @return void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - private $appCache; + public function beforeExecuteFull(ActionInterface $subject) + { + $this->cacheCleaner->start(); + } /** - * @param EventManager $eventManager - * @param CacheContext $cacheContext - * @param CacheInterface $appCache + * Clean cache after full reindex full + * + * @param ActionInterface $subject + * @return void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function __construct( - EventManager $eventManager, - CacheContext $cacheContext, - CacheInterface $appCache - ) { - $this->eventManager = $eventManager; - $this->cacheContext = $cacheContext; - $this->appCache = $appCache; + public function afterExecuteFull(ActionInterface $subject) + { + $this->cacheCleaner->flush(); } /** - * Clean cache after full reindex. + * Defer cache cleaning until after execute list * * @param ActionInterface $subject * @return void * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterExecuteFull(ActionInterface $subject) + public function beforeExecuteList(ActionInterface $subject) { - $this->cleanCache(); + $this->cacheCleaner->start(); } /** @@ -68,34 +73,30 @@ public function afterExecuteFull(ActionInterface $subject) */ public function afterExecuteList(ActionInterface $subject) { - $this->cleanCache(); + $this->cacheCleaner->flush(); } /** - * Clean cache after reindexed row. + * Defer cache cleaning until after execute row * * @param ActionInterface $subject * @return void * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterExecuteRow(ActionInterface $subject) + public function beforeExecuteRow(ActionInterface $subject) { - $this->cleanCache(); + $this->cacheCleaner->start(); } /** - * Clean cache. + * Clean cache after reindexed row. * + * @param ActionInterface $subject * @return void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - private function cleanCache() + public function afterExecuteRow(ActionInterface $subject) { - $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]); - - $identities = $this->cacheContext->getIdentities(); - if (!empty($identities)) { - $this->appCache->clean($identities); - $this->cacheContext->flush(); - } + $this->cacheCleaner->flush(); } } diff --git a/app/code/Magento/Indexer/Model/Indexer/DeferCacheCleaning.php b/app/code/Magento/Indexer/Model/Indexer/DeferCacheCleaning.php new file mode 100644 index 000000000000..2d57c5bb3e06 --- /dev/null +++ b/app/code/Magento/Indexer/Model/Indexer/DeferCacheCleaning.php @@ -0,0 +1,74 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Indexer\Model\Indexer; + +use Magento\Framework\Indexer\CacheContext; + +/** + * Defer cache tags registration if cache context is deferred + */ +class DeferCacheCleaning +{ + /** + * @var DeferredCacheContext + */ + private $deferredCacheContext; + + /** + * @param DeferredCacheContext $deferredCacheContext + */ + public function __construct( + DeferredCacheContext $deferredCacheContext + ) { + $this->deferredCacheContext = $deferredCacheContext; + } + + /** + * Defer cache tags registration if cache context is deferred + * + * @param CacheContext $subject + * @param callable $proceed + * @param string $cacheTag + * @param array $ids + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function aroundRegisterEntities( + CacheContext $subject, + callable $proceed, + string $cacheTag, + array $ids + ): CacheContext { + if ($this->deferredCacheContext->isActive()) { + $this->deferredCacheContext->registerEntities($cacheTag, $ids); + } else { + $proceed($cacheTag, $ids); + } + return $subject; + } + + /** + * Defer cache tags registration if cache context is deferred + * + * @param CacheContext $subject + * @param callable $proceed + * @param array $cacheTags + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function aroundRegisterTags( + CacheContext $subject, + callable $proceed, + array $cacheTags + ): CacheContext { + if ($this->deferredCacheContext->isActive()) { + $this->deferredCacheContext->registerTags($cacheTags); + } else { + $proceed($cacheTags); + } + return $subject; + } +} diff --git a/app/code/Magento/Indexer/Model/Indexer/DeferredCacheCleaner.php b/app/code/Magento/Indexer/Model/Indexer/DeferredCacheCleaner.php new file mode 100644 index 000000000000..2f240095193a --- /dev/null +++ b/app/code/Magento/Indexer/Model/Indexer/DeferredCacheCleaner.php @@ -0,0 +1,80 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Indexer\Model\Indexer; + +use Magento\Framework\App\CacheInterface; +use Magento\Framework\Event\Manager as EventManager; +use Magento\Framework\Indexer\CacheContext; + +/** + * Deferred cache cleaner for indexers + */ +class DeferredCacheCleaner +{ + /** + * @var EventManager + */ + private $eventManager; + + /** + * @var CacheInterface + */ + private $appCache; + + /** + * @var DeferredCacheContext + */ + private $deferredCacheContext; + + /** + * @var CacheContext + */ + private $cacheContext; + + /** + * @param EventManager $eventManager + * @param CacheInterface $appCache + * @param DeferredCacheContext $deferredCacheContext + * @param CacheContext $cacheContext + */ + public function __construct( + EventManager $eventManager, + CacheInterface $appCache, + DeferredCacheContext $deferredCacheContext, + CacheContext $cacheContext + ) { + $this->eventManager = $eventManager; + $this->deferredCacheContext = $deferredCacheContext; + $this->appCache = $appCache; + $this->cacheContext = $cacheContext; + } + + /** + * Defer cache cleaning until flush() is called + * + * @see flush() + */ + public function start(): void + { + $this->deferredCacheContext->start(); + } + + /** + * Flush cache + */ + public function flush(): void + { + $this->deferredCacheContext->commit(); + $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]); + $identities = $this->cacheContext->getIdentities(); + if (!empty($identities)) { + $this->appCache->clean($identities); + $this->cacheContext->flush(); + } + } +} diff --git a/app/code/Magento/Indexer/Model/Indexer/DeferredCacheContext.php b/app/code/Magento/Indexer/Model/Indexer/DeferredCacheContext.php new file mode 100644 index 000000000000..4589f1e96bf5 --- /dev/null +++ b/app/code/Magento/Indexer/Model/Indexer/DeferredCacheContext.php @@ -0,0 +1,112 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Indexer\Model\Indexer; + +use Magento\Framework\Indexer\CacheContext; + +/** + * Deferred cache context for indexers + */ +class DeferredCacheContext +{ + /** + * @var CacheContext + */ + private $cacheContext; + + /** + * @var array + */ + private $tags = []; + + /** + * @var array + */ + private $entities = []; + + /** + * @var int + */ + private $level = 0; + + /** + * @param CacheContext $cacheContext + */ + public function __construct(CacheContext $cacheContext) + { + $this->cacheContext = $cacheContext; + } + + /** + * Register entity Ids + * + * @param string $cacheTag + * @param array $ids + */ + public function registerEntities(string $cacheTag, array $ids): void + { + if ($this->isActive()) { + $this->entities[$cacheTag] = array_merge($this->entities[$cacheTag] ?? [], $ids); + } + } + + /** + * Register entity tags + * + * @param array $cacheTags + */ + public function registerTags(array $cacheTags): void + { + if ($this->isActive()) { + $this->tags = array_merge($this->tags, $cacheTags); + } + } + + /** + * Defer any subsequent cache tags registration until commit() is called + * + * @see commit() + */ + public function start(): void + { + if (!$this->isActive()) { + $this->entities = []; + $this->tags = []; + $this->level = 0; + } + ++$this->level; + } + + /** + * Register all buffered cache tags since the first call of start() + * + * @see start() + */ + public function commit(): void + { + $level = $this->level--; + if ($level === 1) { + if ($this->tags) { + $this->cacheContext->registerTags($this->tags); + } + foreach ($this->entities as $cacheTag => $entityIds) { + $this->cacheContext->registerEntities($cacheTag, $entityIds); + } + } + } + + /** + * Check if cache tags registration is deferred + * + * @return bool + */ + public function isActive(): bool + { + return $this->level > 0; + } +} diff --git a/app/code/Magento/Indexer/Model/Indexer/DependencyDecorator.php b/app/code/Magento/Indexer/Model/Indexer/DependencyDecorator.php index fcfdce4f5862..966769cc6fd4 100644 --- a/app/code/Magento/Indexer/Model/Indexer/DependencyDecorator.php +++ b/app/code/Magento/Indexer/Model/Indexer/DependencyDecorator.php @@ -7,6 +7,7 @@ namespace Magento\Indexer\Model\Indexer; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Indexer\Config\DependencyInfoProviderInterface; use Magento\Framework\Indexer\IndexerInterface; use Magento\Framework\Indexer\IndexerRegistry; @@ -35,19 +36,27 @@ class DependencyDecorator implements IndexerInterface */ private $indexerRegistry; + /** + * @var DeferredCacheCleaner + */ + private $cacheCleaner; + /** * @param IndexerInterface $indexer * @param DependencyInfoProviderInterface $dependencyInfoProvider * @param IndexerRegistry $indexerRegistry + * @param DeferredCacheCleaner|null $cacheCleaner */ public function __construct( IndexerInterface $indexer, DependencyInfoProviderInterface $dependencyInfoProvider, - IndexerRegistry $indexerRegistry + IndexerRegistry $indexerRegistry, + ?DeferredCacheCleaner $cacheCleaner = null ) { $this->indexer = $indexer; $this->dependencyInfoProvider = $dependencyInfoProvider; $this->indexerRegistry = $indexerRegistry; + $this->cacheCleaner = $cacheCleaner ?? ObjectManager::getInstance()->get(DeferredCacheCleaner::class); } /** @@ -264,6 +273,7 @@ public function reindexAll() */ public function reindexRow($id) { + $this->cacheCleaner->start(); $this->indexer->reindexRow($id); $dependentIndexerIds = $this->dependencyInfoProvider->getIndexerIdsToRunAfter($this->indexer->getId()); foreach ($dependentIndexerIds as $indexerId) { @@ -272,6 +282,7 @@ public function reindexRow($id) $dependentIndexer->reindexRow($id); } } + $this->cacheCleaner->flush(); } /** @@ -279,6 +290,7 @@ public function reindexRow($id) */ public function reindexList($ids) { + $this->cacheCleaner->start(); $this->indexer->reindexList($ids); $dependentIndexerIds = $this->dependencyInfoProvider->getIndexerIdsToRunAfter($this->indexer->getId()); foreach ($dependentIndexerIds as $indexerId) { @@ -287,5 +299,6 @@ public function reindexList($ids) $dependentIndexer->reindexList($ids); } } + $this->cacheCleaner->flush(); } } diff --git a/app/code/Magento/Indexer/Model/Message/Invalid.php b/app/code/Magento/Indexer/Model/Message/Invalid.php index 309cab1a3102..086d06a88fa8 100644 --- a/app/code/Magento/Indexer/Model/Message/Invalid.php +++ b/app/code/Magento/Indexer/Model/Message/Invalid.php @@ -75,7 +75,7 @@ public function getText() return __( 'One or more <a href="%1">indexers are invalid</a>. Make sure your <a href="%2" target="_blank">Magento cron job</a> is running.', $url, - 'https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-cron.html#create-or-remove-the-magento-crontab' + 'https://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-cron.html#create-or-remove-the-magento-crontab' ); //@codingStandardsIgnoreEnd } diff --git a/app/code/Magento/Indexer/Model/Processor/CleanCache.php b/app/code/Magento/Indexer/Model/Processor/CleanCache.php index d7663171c8a6..37dac8b98463 100644 --- a/app/code/Magento/Indexer/Model/Processor/CleanCache.php +++ b/app/code/Magento/Indexer/Model/Processor/CleanCache.php @@ -5,7 +5,7 @@ */ namespace Magento\Indexer\Model\Processor; -use Magento\Framework\App\CacheInterface; +use Magento\Indexer\Model\Indexer\DeferredCacheCleaner; /** * Clear cache after reindex @@ -13,83 +13,64 @@ class CleanCache { /** - * @var \Magento\Framework\Indexer\CacheContext + * @var DeferredCacheCleaner */ - protected $context; + private $cacheCleaner; /** - * @var \Magento\Framework\Event\Manager - */ - protected $eventManager; - - /** - * @var \Magento\Framework\App\CacheInterface - */ - private $cache; - - /** - * @param \Magento\Framework\Indexer\CacheContext $context - * @param \Magento\Framework\Event\Manager $eventManager + * @param DeferredCacheCleaner $cacheCleaner */ public function __construct( - \Magento\Framework\Indexer\CacheContext $context, - \Magento\Framework\Event\Manager $eventManager + DeferredCacheCleaner $cacheCleaner ) { - $this->context = $context; - $this->eventManager = $eventManager; + $this->cacheCleaner = $cacheCleaner; } /** - * Update indexer views + * Defer cache cleaning until after update mview * * @param \Magento\Indexer\Model\Processor $subject * @return void * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterUpdateMview(\Magento\Indexer\Model\Processor $subject) + public function beforeUpdateMview(\Magento\Indexer\Model\Processor $subject) { - $this->eventManager->dispatch('clean_cache_after_reindex', ['object' => $this->context]); - $this->cleanCache(); + $this->cacheCleaner->start(); } /** - * Clear cache after reindex all + * Update indexer views * * @param \Magento\Indexer\Model\Processor $subject * @return void * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterReindexAllInvalid(\Magento\Indexer\Model\Processor $subject) + public function afterUpdateMview(\Magento\Indexer\Model\Processor $subject) { - $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->context]); - $this->cleanCache(); + $this->cacheCleaner->flush(); } /** - * Get cache interface + * Defer cache cleaning until after reindex invalid indexers * - * @return \Magento\Framework\App\CacheInterface - * @deprecated 100.1.1 + * @param \Magento\Indexer\Model\Processor $subject + * @return void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - private function getCache() + public function beforeReindexAllInvalid(\Magento\Indexer\Model\Processor $subject) { - if ($this->cache === null) { - $this->cache = \Magento\Framework\App\ObjectManager::getInstance()->get(CacheInterface::class); - } - return $this->cache; + $this->cacheCleaner->start(); } /** - * Clean cache. + * Clear cache after reindex all * + * @param \Magento\Indexer\Model\Processor $subject * @return void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - private function cleanCache(): void + public function afterReindexAllInvalid(\Magento\Indexer\Model\Processor $subject) { - $identities = $this->context->getIdentities(); - if (!empty($identities)) { - $this->getCache()->clean($identities); - $this->context->flush(); - } + $this->cacheCleaner->flush(); } } diff --git a/app/code/Magento/Indexer/README.md b/app/code/Magento/Indexer/README.md index b0a88d12ad0e..84d2a55ff2f1 100644 --- a/app/code/Magento/Indexer/README.md +++ b/app/code/Magento/Indexer/README.md @@ -1,12 +1,101 @@ -## Overview -Magento_Indexer module is a base of Magento Indexing functionality. -It allows: - - read indexers configuration, - - represent indexers in admin, - - regenerate indexes by cron schedule, - - regenerate indexes from console, - - view and reset indexer state from console, +# Magento_Indexer module + +This module provides Magento Indexing functionality. +It allows to: + - read indexers configuration + - represent indexers in admin + - regenerate indexes by cron schedule + - regenerate indexes from console + - view and reset indexer state from console - view and set indexer mode from console -There are 2 modes of the Indexers: "Update on save" and "Update by schedule". -Manual full reindex can be performed via console by running `php -f bin/magento indexer:reindex` console command. \ No newline at end of file +## Installation + +The Magento_Indexer module is one of the base Magento 2 modules. You cannot disable or uninstall this module. + +This module is dependent on the following modules: + +- `Magento_Store` +- `Magento_AdminNotification` + +The Magento_Indexer module creates the following tables in the database: +- `indexer_state` +- `mview_state` + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Structure + +`App/` - the directory that contains launch application entry point. + +For information about a typical file structure of a module in Magento 2, see [Module file structure](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). + +## Extensibility + +Extension developers can interact with the Magento_Indexer module. For more information about the Magento extension mechanism, see [Magento plugins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Indexer module. + +### Events + +The module dispatches the following events: + +#### Model + +- `clean_cache_by_tags` event in the `\Magento\Indexer\Model\Indexer\CacheCleaner::cleanCache` method. Parameters: + - `object` is a `cacheContext` object (`Magento\Framework\Indexer\CacheContext` class) + +#### Plugin + +- `clean_cache_after_reindex` event in the `\Magento\Indexer\Model\Processor\CleanCache::afterUpdateMview` method. Parameters: + - `object` is a `context` object (`Magento\Framework\Indexer\CacheContext` class) + +- `clean_cache_by_tags` event in the `\Magento\Indexer\Model\Processor\CleanCache::afterReindexAllInvalid` method. Parameters: + - `object` is a `context` object (`Magento\Framework\Indexer\CacheContext` class) + +For information about an event in Magento 2, see [Events and observers](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). + +### Layouts + +This module introduces the following layout handles in the `view/adminhtml/layout` directory: +- `indexer_indexer_list` +- `indexer_indexer_list_grid` + +For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html). + +## Additional information + +### Indexer modes + +There are 2 modes of the Indexers: + +- Update on Save - index tables are updated immediately after the dictionary data is changed +- Update by Schedule - index tables are updated by cron job according to the configured schedule + +### Console commands + +Magento_Indexers provides console commands: +- `bin/magento indexer:info` - view a list of all indexers +- `bin/magento indexer:status [indexer]` - view index status +- `bin/magento indexer:reindex [indexer]` - run reindex +- `bin/magento indexer:reset [indexer]` - reset indexers +- `bin/magento indexer:show-mode [indexer]` - view the current indexer configuration +- `bin/magento indexer:set-mode {realtime|schedule} [indexer]` - specify the indexer configuration +- `bin/magento indexer:set-dimensions-mode [indexer]` - set indexer dimension mode +- `bin/magento indexer:show-dimensions-mode [indexer]` - set indexer dimension mode + +### Cron options + +Cron group configuration can be set at `etc/crontab.xml`: +- `indexer_reindex_all_invalid` - regenerate indexes for all invalid indexers +- `indexer_update_all_views` - update indexer views +- `indexer_clean_all_changelogs` - clean indexer view changelogs + +[Learn how to configure and run cron in Magento.](http://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-cron.html). + +More information can get at articles: +- [Learn more about indexing](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/indexing.html) +- [Learn more about Indexer optimization](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/indexer-batch.html) +- [Learn more how to add custom indexer](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/indexing-custom.html) +- [Learn how to manage indexers](https://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-index.html) +- [Learn more about Index Management](https://docs.magento.com/user-guide/system/index-management.html) diff --git a/app/code/Magento/Indexer/Test/Mftf/ActionGroup/CliIndexerSetRealtimeModeActionGroup.xml b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/CliIndexerSetRealtimeModeActionGroup.xml new file mode 100644 index 000000000000..a1bfae067a2a --- /dev/null +++ b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/CliIndexerSetRealtimeModeActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="CliIndexerSetRealtimeModeActionGroup"> + <annotations> + <description>Set indexers to realtime mode.</description> + </annotations> + + <magentoCLI command="indexer:set-mode" arguments="realtime" stepKey="setRealtimeIndexerMode"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Indexer/Test/Mftf/ActionGroup/CliIndexerSetScheduleModeActionGroup.xml b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/CliIndexerSetScheduleModeActionGroup.xml new file mode 100644 index 000000000000..a00b2516d308 --- /dev/null +++ b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/CliIndexerSetScheduleModeActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="CliIndexerSetScheduleModeActionGroup"> + <annotations> + <description>Set indexers to schedule mode.</description> + </annotations> + + <magentoCLI command="indexer:set-mode" arguments="schedule" stepKey="setScheduleIndexerMode"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Indexer/Test/Mftf/Test/AdminSystemIndexManagementGridChangesTest.xml b/app/code/Magento/Indexer/Test/Mftf/Test/AdminSystemIndexManagementGridChangesTest.xml index adb0b9d059d8..403a95885e03 100644 --- a/app/code/Magento/Indexer/Test/Mftf/Test/AdminSystemIndexManagementGridChangesTest.xml +++ b/app/code/Magento/Indexer/Test/Mftf/Test/AdminSystemIndexManagementGridChangesTest.xml @@ -24,18 +24,14 @@ <!--Open Index Management Page and Select Index mode "Update by Schedule" --> <magentoCLI command="indexer:set-mode" arguments="schedule" stepKey="setIndexerModeSchedule"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/></before> <after> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <magentoCLI command="indexer:set-mode" arguments="realtime" stepKey="setIndexerModeRealTime"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> diff --git a/app/code/Magento/Indexer/Test/Unit/Console/Command/IndexerReindexCommandTest.php b/app/code/Magento/Indexer/Test/Unit/Console/Command/IndexerReindexCommandTest.php index 8bdceb92b247..244798e7261b 100644 --- a/app/code/Magento/Indexer/Test/Unit/Console/Command/IndexerReindexCommandTest.php +++ b/app/code/Magento/Indexer/Test/Unit/Console/Command/IndexerReindexCommandTest.php @@ -422,27 +422,6 @@ public function executeWithIndexDataProvider() ]; } - public function testExecuteWithLocalizedException() - { - $this->configureAdminArea(); - $indexerOne = $this->getIndexerMock( - ['reindexAll', 'getStatus'], - ['indexer_id' => 'indexer_1', 'title' => self::STUB_INDEXER_NAME] - ); - $localizedException = new LocalizedException(new Phrase('Some Exception Message')); - $indexerOne->expects($this->once())->method('reindexAll')->willThrowException($localizedException); - $this->initIndexerCollectionByItems([$indexerOne]); - $this->command = new IndexerReindexCommand($this->objectManagerFactory); - $commandTester = new CommandTester($this->command); - $commandTester->execute(['index' => ['indexer_1']]); - $actualValue = $commandTester->getDisplay(); - $this->assertSame(Cli::RETURN_FAILURE, $commandTester->getStatusCode()); - $this->assertStringStartsWith( - self::STUB_INDEXER_NAME . ' index exception: Some Exception Message', - $actualValue - ); - } - public function testExecuteWithException() { $this->configureAdminArea(); @@ -459,7 +438,10 @@ public function testExecuteWithException() $commandTester->execute(['index' => ['indexer_1']]); $actualValue = $commandTester->getDisplay(); $this->assertSame(Cli::RETURN_FAILURE, $commandTester->getStatusCode()); - $this->assertStringStartsWith('Title_indexer_1' . ' index process unknown error:', $actualValue); + $this->assertStringStartsWith( + 'Title_indexer_1' . ' index process error during indexation process:', + $actualValue + ); } public function testExecuteWithExceptionInGetIndexers() diff --git a/app/code/Magento/Indexer/Test/Unit/Model/Indexer/CacheCleanerTest.php b/app/code/Magento/Indexer/Test/Unit/Model/Indexer/CacheCleanerTest.php index 0839dbfb1337..ad38134d7af0 100644 --- a/app/code/Magento/Indexer/Test/Unit/Model/Indexer/CacheCleanerTest.php +++ b/app/code/Magento/Indexer/Test/Unit/Model/Indexer/CacheCleanerTest.php @@ -7,11 +7,9 @@ namespace Magento\Indexer\Test\Unit\Model\Indexer; -use Magento\Framework\App\CacheInterface; -use Magento\Framework\Event\Manager; use Magento\Framework\Indexer\ActionInterface; -use Magento\Framework\Indexer\CacheContext; use Magento\Indexer\Model\Indexer\CacheCleaner; +use Magento\Indexer\Model\Indexer\DeferredCacheCleaner; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -20,27 +18,21 @@ */ class CacheCleanerTest extends TestCase { - /** - * @var Manager|MockObject - */ - private $eventManager; - /** - * @var CacheContext|MockObject - */ - private $cacheContext; - /** - * @var CacheInterface|MockObject - */ - private $cache; /** * @var CacheCleaner */ private $model; + /** * @var ActionInterface|MockObject */ private $action; + /** + * @var DeferredCacheCleaner|MockObject + */ + private $cacheCleaner; + /** * @inheritDoc */ @@ -48,82 +40,67 @@ protected function setUp(): void { parent::setUp(); $this->action = $this->getMockForAbstractClass(ActionInterface::class); - $this->cacheContext = $this->createMock(CacheContext::class); - $this->eventManager = $this->createMock(Manager::class); - $this->cache = $this->getMockForAbstractClass(CacheInterface::class); - $this->model = new CacheCleaner( - $this->eventManager, - $this->cacheContext, - $this->cache - ); + $this->cacheCleaner = $this->createMock(DeferredCacheCleaner::class); + $this->model = new CacheCleaner($this->cacheCleaner); } /** - * @param array $tags - * @param bool $isCacheClean - * @dataProvider cacheTagsDataProvider + * Test beforeExecuteFull() */ - public function testAfterExecuteFull(array $tags, bool $isCacheClean = true): void + public function testBeforeExecuteFull(): void { - $this->expectCacheClean($tags, $isCacheClean); - $this->model->afterExecuteFull($this->action); + $this->cacheCleaner->expects($this->once()) + ->method('start'); + $this->model->beforeExecuteFull($this->action); } /** - * @param array $tags - * @param bool $isCacheClean - * @dataProvider cacheTagsDataProvider + * Test afterExecuteFull() */ - public function testAfterExecuteList(array $tags, bool $isCacheClean = true): void + public function testAfterExecuteFull(): void { - $this->expectCacheClean($tags, $isCacheClean); - $this->model->afterExecuteList($this->action); + $this->cacheCleaner->expects($this->once()) + ->method('flush'); + $this->model->afterExecuteFull($this->action); } /** - * @param array $tags - * @param bool $isCacheClean - * @dataProvider cacheTagsDataProvider + * Test beforeExecuteList() */ - public function testAfterExecuteRow(array $tags, bool $isCacheClean = true): void + public function testBeforeExecuteList(): void { - $this->expectCacheClean($tags, $isCacheClean); - $this->model->afterExecuteRow($this->action); + $this->cacheCleaner->expects($this->once()) + ->method('start'); + $this->model->beforeExecuteList($this->action); } /** - * @return array[] + * Test afterExecuteList() */ - public function cacheTagsDataProvider(): array + public function testAfterExecuteList(): void { - return [ - [[], false], - [['cat_c_1', 'cat_c_2'], true] - ]; + $this->cacheCleaner->expects($this->once()) + ->method('flush'); + $this->model->afterExecuteList($this->action); } /** - * @param array $tags - * @param bool $isCacheClean + * Test beforeExecuteRow() */ - private function expectCacheClean(array $tags, bool $isCacheClean = true): void + public function testBeforeExecuteRow(): void { - $this->eventManager->expects($this->once()) - ->method('dispatch') - ->with( - 'clean_cache_by_tags', - ['object' => $this->cacheContext] - ); - - $this->cacheContext->expects($this->atLeastOnce()) - ->method('getIdentities') - ->willReturn($tags); - - $this->cache->expects($this->exactly($isCacheClean ? 1 : 0)) - ->method('clean') - ->with($tags); + $this->cacheCleaner->expects($this->once()) + ->method('start'); + $this->model->beforeExecuteRow($this->action); + } - $this->cacheContext->expects($this->exactly($isCacheClean ? 1 : 0)) + /** + * Test afterExecuteRow() + */ + public function testAfterExecuteRow(): void + { + $this->cacheCleaner->expects($this->once()) ->method('flush'); + $this->model->afterExecuteRow($this->action); } } diff --git a/app/code/Magento/Indexer/Test/Unit/Model/Indexer/DeferredCacheCleanerTest.php b/app/code/Magento/Indexer/Test/Unit/Model/Indexer/DeferredCacheCleanerTest.php new file mode 100644 index 000000000000..bcf7430f241a --- /dev/null +++ b/app/code/Magento/Indexer/Test/Unit/Model/Indexer/DeferredCacheCleanerTest.php @@ -0,0 +1,119 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Indexer\Test\Unit\Model\Indexer; + +use Magento\Framework\App\CacheInterface; +use Magento\Framework\Event\Manager; +use Magento\Framework\Indexer\CacheContext; +use Magento\Indexer\Model\Indexer\DeferredCacheCleaner; +use Magento\Indexer\Model\Indexer\DeferredCacheContext; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test Deferred cache cleaner for indexers + */ +class DeferredCacheCleanerTest extends TestCase +{ + /** + * @var Manager|MockObject + */ + private $eventManager; + + /** + * @var CacheInterface|MockObject + */ + private $cache; + + /** + * @var DeferredCacheContext|MockObject + */ + private $deferredCacheContext; + + /** + * @var CacheContext|MockObject + */ + private $cacheContext; + + /** + * @var DeferredCacheCleaner + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->cacheContext = $this->createMock(CacheContext::class); + $this->deferredCacheContext = $this->createMock(DeferredCacheContext::class); + $this->eventManager = $this->createMock(Manager::class); + $this->cache = $this->getMockForAbstractClass(CacheInterface::class); + $this->model = new DeferredCacheCleaner( + $this->eventManager, + $this->cache, + $this->deferredCacheContext, + $this->cacheContext, + ); + } + + /** + * Test start() + */ + public function testStart(): void + { + $this->deferredCacheContext->expects($this->once()) + ->method('start'); + $this->model->start(); + } + + /** + * Test flush() + * + * @param array $tags + * @param bool $isCacheClean + * @dataProvider cacheTagsDataProvider + */ + public function testFlush(array $tags, bool $isCacheClean = true): void + { + $this->eventManager->expects($this->once()) + ->method('dispatch') + ->with( + 'clean_cache_by_tags', + ['object' => $this->cacheContext] + ); + + $this->deferredCacheContext->expects($this->once()) + ->method('commit'); + + $this->cacheContext->expects($this->once()) + ->method('getIdentities') + ->willReturn($tags); + + $this->cacheContext->expects($this->exactly($isCacheClean ? 1 : 0)) + ->method('flush'); + + $this->cache->expects($this->exactly($isCacheClean ? 1 : 0)) + ->method('clean') + ->with($tags); + + $this->model->flush(); + } + + /** + * @return array[] + */ + public function cacheTagsDataProvider(): array + { + return [ + [[], false], + [['cat_c_1', 'cat_c_2'], true] + ]; + } +} diff --git a/app/code/Magento/Indexer/Test/Unit/Model/Indexer/DeferredCacheContextTest.php b/app/code/Magento/Indexer/Test/Unit/Model/Indexer/DeferredCacheContextTest.php new file mode 100644 index 000000000000..cfe4ae9c816d --- /dev/null +++ b/app/code/Magento/Indexer/Test/Unit/Model/Indexer/DeferredCacheContextTest.php @@ -0,0 +1,66 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Indexer\Test\Unit\Model\Indexer; + +use Magento\Framework\Indexer\CacheContext; +use Magento\Indexer\Model\Indexer\DeferredCacheContext; +use PHPUnit\Framework\TestCase; + +/** + * Test deferred cache context for indexers + */ +class DeferredCacheContextTest extends TestCase +{ + /** + * @var CacheContext + */ + private $context; + + /** + * @var DeferredCacheContext + */ + private $model; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $this->context = new CacheContext(); + $this->model = new DeferredCacheContext($this->context); + } + + /** + * Test that deferred cache works correctly + */ + public function test(): void + { + $productTag = 'cat_p'; + $categoryTag = 'cat_c'; + $additionalTags1 = ['cat_c_p']; + $additionalTags2 = ['cms_page']; + $productIds1 = [1, 2, 3]; + $productIds2 = [4]; + $categoryIds = [5, 6, 7]; + $this->model->start(); + $this->model->registerEntities($productTag, $productIds1); + $this->model->registerTags($additionalTags1); + $this->model->start(); + $this->model->registerEntities($productTag, $productIds2); + $this->model->registerEntities($categoryTag, $categoryIds); + $this->model->registerTags($additionalTags2); + $this->assertEmpty($this->context->getIdentities()); + $this->model->commit(); + $this->assertEmpty($this->context->getIdentities()); + $this->model->commit(); + $this->assertEquals( + ['cat_p_1', 'cat_p_2', 'cat_p_3', 'cat_p_4', 'cat_c_5', 'cat_c_6', 'cat_c_7', 'cat_c_p', 'cms_page'], + $this->context->getIdentities() + ); + } +} diff --git a/app/code/Magento/Indexer/Test/Unit/Model/Processor/CleanCacheTest.php b/app/code/Magento/Indexer/Test/Unit/Model/Processor/CleanCacheTest.php index 4c37f4c767fb..9345413bd6a6 100644 --- a/app/code/Magento/Indexer/Test/Unit/Model/Processor/CleanCacheTest.php +++ b/app/code/Magento/Indexer/Test/Unit/Model/Processor/CleanCacheTest.php @@ -7,11 +7,7 @@ namespace Magento\Indexer\Test\Unit\Model\Processor; -use Magento\Framework\App\CacheInterface; -use Magento\Framework\Event\Manager; -use Magento\Framework\Indexer\ActionInterface; -use Magento\Framework\Indexer\CacheContext; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Indexer\Model\Indexer\DeferredCacheCleaner; use Magento\Indexer\Model\Processor; use Magento\Indexer\Model\Processor\CleanCache; use PHPUnit\Framework\MockObject\MockObject; @@ -27,88 +23,73 @@ class CleanCacheTest extends TestCase * * @var CleanCache */ - protected $plugin; + private $plugin; /** * Mock for context * - * @var CacheContext|MockObject + * @var DeferredCacheCleaner|MockObject */ - protected $contextMock; + private $cacheCleaner; /** * Subject mock * - * @var ActionInterface|MockObject + * @var Processor|MockObject */ - protected $subjectMock; + private $subjectMock; /** - * Event manager mock - * - * @var Manager|MockObject + * @inheritDoc */ - protected $eventManagerMock; + protected function setUp(): void + { + $this->subjectMock = $this->createMock(Processor::class); + $this->cacheCleaner = $this->createMock(DeferredCacheCleaner::class); + $this->plugin = new CleanCache($this->cacheCleaner); + } /** - * Cache mock - * - * @var CacheInterface|MockObject + * Test beforeUpdateMview() */ - protected $cacheMock; + public function testBeforeUpdateMview(): void + { + $this->cacheCleaner->expects($this->once()) + ->method('start'); - /** - * @var ObjectManager - */ - protected $objectManager; + $this->plugin->beforeUpdateMview($this->subjectMock); + } /** - * Set up + * Test afterUpdateMview() */ - protected function setUp(): void + public function testAfterUpdateMview(): void { - $this->objectManager = new ObjectManager($this); - $this->subjectMock = $this->createMock(Processor::class); - $this->contextMock = $this->createMock(CacheContext::class); - $this->eventManagerMock = $this->createMock(Manager::class); - $this->cacheMock = $this->getMockForAbstractClass(CacheInterface::class); - $this->plugin = new CleanCache( - $this->contextMock, - $this->eventManagerMock - ); - $this->objectManager->setBackwardCompatibleProperty( - $this->plugin, - 'cache', - $this->cacheMock - ); + $this->cacheCleaner->expects($this->once()) + ->method('flush'); + + $this->plugin->afterUpdateMview($this->subjectMock); } /** - * Test afterUpdateMview - * - * @return void + * Test beforeReindexAllInvalid() */ - public function testAfterUpdateMview() + public function testBeforeReindexAllInvalid(): void { - $tags = ['tag_name1', 'tag_name2']; - $this->eventManagerMock->expects($this->once()) - ->method('dispatch') - ->with( - 'clean_cache_after_reindex', - ['object' => $this->contextMock] - ); - - $this->contextMock->expects($this->atLeastOnce()) - ->method('getIdentities') - ->willReturn($tags); + $this->cacheCleaner->expects($this->once()) + ->method('start'); - $this->cacheMock->expects($this->once()) - ->method('clean') - ->with($tags); + $this->plugin->beforeReindexAllInvalid($this->subjectMock); + } - $this->contextMock->expects($this->once()) + /** + * Test afterReindexAllInvalid() + */ + public function testAfterReindexAllInvalid(): void + { + $this->cacheCleaner->expects($this->once()) ->method('flush'); - $this->plugin->afterUpdateMview($this->subjectMock); + $this->plugin->afterReindexAllInvalid($this->subjectMock); } } diff --git a/app/code/Magento/Indexer/etc/di.xml b/app/code/Magento/Indexer/etc/di.xml index 9496f29cb1d8..e85a7c31f9ae 100644 --- a/app/code/Magento/Indexer/etc/di.xml +++ b/app/code/Magento/Indexer/etc/di.xml @@ -70,4 +70,7 @@ <type name="Magento\Framework\Indexer\ActionInterface"> <plugin name="cache_cleaner_after_reindex" type="Magento\Indexer\Model\Indexer\CacheCleaner" /> </type> + <type name="Magento\Framework\Indexer\CacheContext"> + <plugin name="defer_cache_cleaning" type="Magento\Indexer\Model\Indexer\DeferCacheCleaning" /> + </type> </config> diff --git a/app/code/Magento/InstantPurchase/README.md b/app/code/Magento/InstantPurchase/README.md index 2c20dc869d60..66b14b0c72c8 100644 --- a/app/code/Magento/InstantPurchase/README.md +++ b/app/code/Magento/InstantPurchase/README.md @@ -1,19 +1,56 @@ -## Overview +## Magento_InstantPurchase module -Instant Purchase feature allows the Customer to place the order in seconds without going through full checkout. Once clicked, system places the order using default shipping and billing addresses and stored payment method. Order is placed and customer gets confirmation message in notification area. +This module allows the Customer to place the order in seconds without going through full checkout. Once clicked, system places the order using default shipping and billing addresses and stored payment method. Order is placed and customer gets confirmation message in notification area. -Prerequisites to display the Instant Purchase button: -1. Instant purchase enabled for a store at `Store / Configurations / Sales / Sales / Instant Purchase` -2. Customer is logged in -3. Customer has default shipping and billing address defined -4. Customer has valid stored payment method with instant purchase support +## Installation + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Structure -In addition to [a typical file structure for a Magento 2 module](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/build/module-file-structure.html) `PaymentMethodsIntegration` directory contains interfaces and basic implementation of integration vault payment method to the instant purchase. +`PaymentMethodsIntegration` - directory contains interfaces and basic implementation of integration vault payment method to the instant purchase. + +For information about a typical file structure of a module in Magento 2, see [Module file structure](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). ## Extensibility +Extension developers can interact with the Magento_InstantPurchase module. For more information about the Magento extension mechanism, see [Magento plugins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_InstantPurchase module. + +### Public APIs + +- `\Magento\InstantPurchase\Model\BillingAddressChoose\BillingAddressChooserInterface` + - choose billing address for a customer if available + +- `\Magento\InstantPurchase\Model\PaymentMethodChoose\PaymentTokenChooserInterface` + - choose one of the stored payment methods for a customer if available + +- `\Magento\InstantPurchase\Model\ShippingAddressChoose\ShippingAddressChooserInterface` + - choose shipping address for a customer if available + +- `\Magento\InstantPurchase\Model\ShippingMethodChoose\DeferredShippingMethodChooserInterface` + - choose shipping method for a quote address + +- `\Magento\InstantPurchase\Model\ShippingMethodChoose\ShippingMethodChooserInterface` + - choose shipping method for customer address if available + +- `\Magento\InstantPurchase\Model\InstantPurchaseInterface` + - detects instant purchase options for a customer in a store + +- `\Magento\InstantPurchase\PaymentMethodIntegration\AvailabilityCheckerInterface` + - checks if payment method may be used for instant purchase + +- `\Magento\InstantPurchase\PaymentMethodIntegration\PaymentAdditionalInformationProviderInterface` + - provides additional information part specific for payment method + +- `\Magento\InstantPurchase\PaymentMethodIntegration\PaymentTokenFormatterInterface` + - provides mechanism to create string presentation of token for payment method + +For information about a public API in Magento 2, see [Public interfaces & APIs](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/api-concepts.html). + +## Additional information + ### Instant purchase customization Almost all aspects of instant purchase may be customized. See comments to classes and interfaces marked with `@api` tag. @@ -22,11 +59,11 @@ All payments created for instant purchase also have `'instant-purchase' => true` ### Payment method integration -Instant purchase support may be implemented for any payment method with [vault support](https://devdocs.magento.com/guides/v2.3/payments-integrations/vault/vault-intro.html). +Instant purchase support may be implemented for any payment method with [vault support](https://devdocs.magento.com/guides/v2.4/payments-integrations/vault/vault-intro.html). Basic implementation provided in `Magento\InstantPurchase\PaymentMethodIntegration` should be enough in most cases. It is not enabled by default to avoid issues on production sites and authors of vault payment method should verify correct work for instant purchase manually. To enable basic implementation just add single option to configuration of payemnt method in `config.xml`: -``` +```xml <instant_purchase> <supported>1</supported> </instant_purchase> @@ -34,7 +71,7 @@ To enable basic implementation just add single option to configuration of payemn Basic implementation is a good start point but it's recommended to provide own implementation to improve user experience. If instant purchase integration has customization then `supported` option is not required. -``` +```xml <instant_purchase> <available>Implementation_Of_Magento\InstantPurchase\PaymentMethodIntegration\AvailabilityCheckerInterface</available> <tokenFormat>Implementation_Of_Magento\InstantPurchase\PaymentMethodIntegration\PaymentTokenFormatterInterface</tokenFormat> @@ -46,13 +83,20 @@ Basic implementation is a good start point but it's recommended to provide own i - `Magento\InstantPurchase\PaymentMethodIntegration\PaymentTokenFormatterInterface` - creates string that describes stored payment method. Basic implementation returns payment method name. It is highly recommended to implement own formatter. - `Magento\InstantPurchase\PaymentMethodIntegration\PaymentAdditionalInformationProviderInterface` - allows to add some extra values to payment additional information array. Default implementation returns empty array. -## Additional information +### Prerequisites to display the Instant Purchase button + +1. Instant purchase enabled for a store at `Store / Configurations / Sales / Sales / Instant Purchase` +2. Customer is logged in +3. Customer has default shipping and billing address defined +4. Customer has valid stored payment method with instant purchase support + +[Learn more about Instant Purchase](https://docs.magento.com/user-guide/sales/checkout-instant-purchase.html). ### Backward incompatible changes The `Magento_InstantPurchase` module does not introduce backward incompatible changes. -You can track [backward incompatible changes in patch releases](https://devdocs.magento.com/guides/v2.3/release-notes/backward-incompatible-changes/reference.html). +You can track [backward incompatible changes in patch releases](https://devdocs.magento.com/guides/v2.4/release-notes/backward-incompatible-changes/reference.html). *** diff --git a/app/code/Magento/InstantPurchase/view/frontend/web/template/instant-purchase.html b/app/code/Magento/InstantPurchase/view/frontend/web/template/instant-purchase.html index 0373b25c9c52..b7c472983f93 100644 --- a/app/code/Magento/InstantPurchase/view/frontend/web/template/instant-purchase.html +++ b/app/code/Magento/InstantPurchase/view/frontend/web/template/instant-purchase.html @@ -9,7 +9,7 @@ class="action primary instant-purchase" click="instantPurchase" attr="title: $t(buttonText)"> - <span translate="buttonText" /> + <span translate="buttonText"></span> </button> <input if="paymentToken()" type="hidden" diff --git a/app/code/Magento/Integration/Api/Data/UserToken.php b/app/code/Magento/Integration/Api/Data/UserToken.php new file mode 100644 index 000000000000..b1899c0209cd --- /dev/null +++ b/app/code/Magento/Integration/Api/Data/UserToken.php @@ -0,0 +1,47 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Integration\Api\Data; + +use Magento\Authorization\Model\UserContextInterface; + +/** + * User token authentication. + */ +class UserToken +{ + /** + * @var UserContextInterface + */ + private $context; + + /** + * @var UserTokenDataInterface + */ + private $data; + + /** + * @param UserContextInterface $context + * @param UserTokenDataInterface $data + */ + public function __construct(UserContextInterface $context, UserTokenDataInterface $data) + { + $this->context = $context; + $this->data = $data; + } + + public function getUserContext(): UserContextInterface + { + return $this->context; + } + + public function getData(): UserTokenDataInterface + { + return $this->data; + } +} diff --git a/app/code/Magento/Integration/Api/Data/UserTokenDataInterface.php b/app/code/Magento/Integration/Api/Data/UserTokenDataInterface.php new file mode 100644 index 000000000000..83cecc272b65 --- /dev/null +++ b/app/code/Magento/Integration/Api/Data/UserTokenDataInterface.php @@ -0,0 +1,19 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Integration\Api\Data; + +/** + * Information attached to a user's token. + */ +interface UserTokenDataInterface +{ + public function getIssued(): \DateTimeImmutable; + + public function getExpires(): \DateTimeImmutable; +} diff --git a/app/code/Magento/Integration/Api/Data/UserTokenParametersInterface.php b/app/code/Magento/Integration/Api/Data/UserTokenParametersInterface.php new file mode 100644 index 000000000000..dab035368c17 --- /dev/null +++ b/app/code/Magento/Integration/Api/Data/UserTokenParametersInterface.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Integration\Api\Data; + +use Magento\Framework\Api\ExtensibleDataInterface; + +/** + * Parameters for new tokens. + */ +interface UserTokenParametersInterface extends ExtensibleDataInterface +{ + /** + * Force issued timestamp as given. + * + * @return \DateTimeInterface|null + */ + public function getForcedIssuedTime(): ?\DateTimeInterface; + + /** + * @return \Magento\Integration\Api\Data\UserTokenParametersExtensionInterface|null + */ + public function getExtensionAttributes(): ?UserTokenParametersExtensionInterface; + + /** + * @param \Magento\Integration\Api\Data\UserTokenParametersExtensionInterface $extended + */ + public function setExtensionAttributes(UserTokenParametersExtensionInterface $extended): void; +} diff --git a/app/code/Magento/Integration/Api/Exception/UserTokenException.php b/app/code/Magento/Integration/Api/Exception/UserTokenException.php new file mode 100644 index 000000000000..025d5260bdaf --- /dev/null +++ b/app/code/Magento/Integration/Api/Exception/UserTokenException.php @@ -0,0 +1,36 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Integration\Api\Exception; + +use Magento\Authorization\Model\UserContextInterface; + +/** + * Describes user token related failure. + */ +class UserTokenException extends \InvalidArgumentException +{ + /** + * @var UserContextInterface|null + */ + private $context; + + public function __construct( + string $message, + ?\Throwable $previous = null, + ?UserContextInterface $forContext = null + ) { + parent::__construct($message, 0, $previous); + $this->context = $forContext; + } + + public function getUserContext(): ?UserContextInterface + { + return $this->context; + } +} diff --git a/app/code/Magento/Integration/Api/UserTokenIssuerInterface.php b/app/code/Magento/Integration/Api/UserTokenIssuerInterface.php new file mode 100644 index 000000000000..d6c18af67935 --- /dev/null +++ b/app/code/Magento/Integration/Api/UserTokenIssuerInterface.php @@ -0,0 +1,29 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Integration\Api; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Integration\Api\Data\UserTokenParametersInterface; +use Magento\Integration\Api\Exception\UserTokenException; + +/** + * Issues tokens used to authenticate users. + */ +interface UserTokenIssuerInterface +{ + /** + * Create token for a user. + * + * @param UserContextInterface $userContext + * @param UserTokenParametersInterface $params + * @return string + * @throws UserTokenException + */ + public function create(UserContextInterface $userContext, UserTokenParametersInterface $params): string; +} diff --git a/app/code/Magento/Integration/Api/UserTokenReaderInterface.php b/app/code/Magento/Integration/Api/UserTokenReaderInterface.php new file mode 100644 index 000000000000..20ca3feda678 --- /dev/null +++ b/app/code/Magento/Integration/Api/UserTokenReaderInterface.php @@ -0,0 +1,27 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Integration\Api; + +use Magento\Integration\Api\Data\UserToken; +use Magento\Integration\Api\Exception\UserTokenException; + +/** + * Reads user token data. + */ +interface UserTokenReaderInterface +{ + /** + * Read user data from a token. + * + * @param string $token + * @return UserToken + * @throws UserTokenException + */ + public function read(string $token): UserToken; +} diff --git a/app/code/Magento/Integration/Api/UserTokenRevokerInterface.php b/app/code/Magento/Integration/Api/UserTokenRevokerInterface.php new file mode 100644 index 000000000000..b8ce01d48dac --- /dev/null +++ b/app/code/Magento/Integration/Api/UserTokenRevokerInterface.php @@ -0,0 +1,27 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Integration\Api; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Integration\Api\Exception\UserTokenException; + +/** + * Revokes user tokens. + */ +interface UserTokenRevokerInterface +{ + /** + * Revoke all previously issued tokens for given user. + * + * @param UserContextInterface $userContext + * @return void + * @throws UserTokenException + */ + public function revokeFor(UserContextInterface $userContext): void; +} diff --git a/app/code/Magento/Integration/Api/UserTokenValidatorInterface.php b/app/code/Magento/Integration/Api/UserTokenValidatorInterface.php new file mode 100644 index 000000000000..2c956d3ce050 --- /dev/null +++ b/app/code/Magento/Integration/Api/UserTokenValidatorInterface.php @@ -0,0 +1,27 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Integration\Api; + +use Magento\Framework\Exception\AuthorizationException; +use Magento\Integration\Api\Data\UserToken; + +/** + * Validates tokens used to authenticate users. + */ +interface UserTokenValidatorInterface +{ + /** + * Validate user token. + * + * @param UserToken $token + * @throws AuthorizationException + * @return void + */ + public function validate(UserToken $token): void; +} diff --git a/app/code/Magento/Integration/Controller/Adminhtml/Integration/TokensExchange.php b/app/code/Magento/Integration/Controller/Adminhtml/Integration/TokensExchange.php index 2f1884b8db73..50fb701e7a0d 100644 --- a/app/code/Magento/Integration/Controller/Adminhtml/Integration/TokensExchange.php +++ b/app/code/Magento/Integration/Controller/Adminhtml/Integration/TokensExchange.php @@ -8,16 +8,21 @@ namespace Magento\Integration\Controller\Adminhtml\Integration; -use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\App\Action\HttpGetActionInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Oauth\Exception; use Magento\Integration\Controller\Adminhtml\Integration; use Magento\Integration\Model\Integration as IntegrationModel; -class TokensExchange extends Integration implements HttpPostActionInterface +/** + * Tokens Exchange for integration + */ +class TokensExchange extends Integration implements HttpGetActionInterface { /** * Let the admin know that integration has been sent for activation and token exchange is in process. * - * @param bool $isReauthorize + * @param bool $isReauthorize * @param string $integrationName * @return void */ @@ -60,7 +65,7 @@ public function execute() $popupContent = $this->_response->getBody(); $consumer = $this->_oauthService->loadConsumer($integration->getConsumerId()); if (!$consumer->getId()) { - throw new \Magento\Framework\Oauth\Exception( + throw new Exception( __( 'A consumer with "%1" ID doesn\'t exist. Verify the ID and try again.', $integration->getConsumerId() @@ -74,7 +79,7 @@ public function execute() 'popup_content' => $popupContent, ]; $this->getResponse()->representJson($this->jsonHelper->jsonEncode($result)); - } catch (\Magento\Framework\Exception\LocalizedException $e) { + } catch (LocalizedException $e) { $this->messageManager->addErrorMessage($e->getMessage()); $this->_redirect('*/*'); return; diff --git a/app/code/Magento/Integration/Model/AdminTokenService.php b/app/code/Magento/Integration/Model/AdminTokenService.php index 7726ff979c6d..afffcfb1b069 100644 --- a/app/code/Magento/Integration/Model/AdminTokenService.php +++ b/app/code/Magento/Integration/Model/AdminTokenService.php @@ -6,27 +6,24 @@ namespace Magento\Integration\Model; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\AuthenticationException; use Magento\Framework\Exception\LocalizedException; -use Magento\Integration\Model\CredentialsValidator; +use Magento\Integration\Api\Exception\UserTokenException; +use Magento\Integration\Api\UserTokenIssuerInterface; +use Magento\Integration\Api\UserTokenRevokerInterface; use Magento\Integration\Model\Oauth\Token as Token; use Magento\Integration\Model\Oauth\TokenFactory as TokenModelFactory; use Magento\Integration\Model\ResourceModel\Oauth\Token\CollectionFactory as TokenCollectionFactory; use Magento\User\Model\User as UserModel; use Magento\Integration\Model\Oauth\Token\RequestThrottler; +use Magento\Integration\Model\UserToken\UserTokenParametersFactory; /** * Class to handle token generation for Admins */ class AdminTokenService implements \Magento\Integration\Api\AdminTokenServiceInterface { - /** - * Token Model - * - * @var TokenModelFactory - */ - private $tokenModelFactory; - /** * User Model * @@ -35,21 +32,29 @@ class AdminTokenService implements \Magento\Integration\Api\AdminTokenServiceInt private $userModel; /** - * @var \Magento\Integration\Model\CredentialsValidator + * @var CredentialsValidator */ private $validatorHelper; /** - * Token Collection Factory - * - * @var TokenCollectionFactory + * @var RequestThrottler */ - private $tokenModelCollectionFactory; + private $requestThrottler; /** - * @var RequestThrottler + * @var UserTokenParametersFactory */ - private $requestThrottler; + private $tokenParametersFactory; + + /** + * @var UserTokenIssuerInterface + */ + private $tokenIssuer; + + /** + * @var UserTokenRevokerInterface + */ + private $tokenRevoker; /** * Initialize service @@ -57,18 +62,26 @@ class AdminTokenService implements \Magento\Integration\Api\AdminTokenServiceInt * @param TokenModelFactory $tokenModelFactory * @param UserModel $userModel * @param TokenCollectionFactory $tokenModelCollectionFactory - * @param \Magento\Integration\Model\CredentialsValidator $validatorHelper + * @param CredentialsValidator $validatorHelper + * @param UserTokenParametersFactory|null $tokenParamsFactory + * @param UserTokenIssuerInterface|null $tokenIssuer + * @param UserTokenRevokerInterface|null $tokenRevoker */ public function __construct( TokenModelFactory $tokenModelFactory, UserModel $userModel, TokenCollectionFactory $tokenModelCollectionFactory, - CredentialsValidator $validatorHelper + CredentialsValidator $validatorHelper, + ?UserTokenParametersFactory $tokenParamsFactory = null, + ?UserTokenIssuerInterface $tokenIssuer = null, + ?UserTokenRevokerInterface $tokenRevoker = null ) { - $this->tokenModelFactory = $tokenModelFactory; $this->userModel = $userModel; - $this->tokenModelCollectionFactory = $tokenModelCollectionFactory; $this->validatorHelper = $validatorHelper; + $this->tokenParametersFactory = $tokenParamsFactory + ?? ObjectManager::getInstance()->get(UserTokenParametersFactory::class); + $this->tokenIssuer = $tokenIssuer ?? ObjectManager::getInstance()->get(UserTokenIssuerInterface::class); + $this->tokenRevoker = $tokenRevoker ?? ObjectManager::getInstance()->get(UserTokenRevokerInterface::class); } /** @@ -94,7 +107,13 @@ public function createAdminAccessToken($username, $password) ); } $this->getRequestThrottler()->resetAuthenticationFailuresCount($username, RequestThrottler::USER_TYPE_ADMIN); - return $this->tokenModelFactory->create()->createAdminToken($this->userModel->getId())->getToken(); + $context = new CustomUserContext( + (int) $this->userModel->getId(), + CustomUserContext::USER_TYPE_ADMIN + ); + $params = $this->tokenParametersFactory->create(); + + return $this->tokenIssuer->create($context, $params); } /** @@ -108,16 +127,10 @@ public function createAdminAccessToken($username, $password) */ public function revokeAdminAccessToken($adminId) { - $tokenCollection = $this->tokenModelCollectionFactory->create()->addFilterByAdminId($adminId); - if ($tokenCollection->getSize() == 0) { - return true; - } try { - foreach ($tokenCollection as $token) { - $token->delete(); - } - } catch (\Exception $e) { - throw new LocalizedException(__("The tokens couldn't be revoked.")); + $this->tokenRevoker->revokeFor(new CustomUserContext((int) $adminId, CustomUserContext::USER_TYPE_ADMIN)); + } catch (UserTokenException $exception) { + throw new LocalizedException(__('The tokens couldn\'t be revoked.'), $exception); } return true; } diff --git a/app/code/Magento/Integration/Model/CompositeUserTokenValidator.php b/app/code/Magento/Integration/Model/CompositeUserTokenValidator.php new file mode 100644 index 000000000000..866d041147ae --- /dev/null +++ b/app/code/Magento/Integration/Model/CompositeUserTokenValidator.php @@ -0,0 +1,38 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Integration\Model; + +use Magento\Integration\Api\Data\UserToken; +use Magento\Integration\Api\UserTokenValidatorInterface; + +class CompositeUserTokenValidator implements UserTokenValidatorInterface +{ + /** + * @var UserTokenValidatorInterface[] + */ + private $validators; + + /** + * @param UserTokenValidatorInterface[] $validators + */ + public function __construct(array $validators) + { + $this->validators = $validators; + } + + /** + * @inheritDoc + */ + public function validate(UserToken $token): void + { + foreach ($this->validators as $tokenValidator) { + $tokenValidator->validate($token); + } + } +} diff --git a/app/code/Magento/Integration/Model/CustomUserContext.php b/app/code/Magento/Integration/Model/CustomUserContext.php new file mode 100644 index 000000000000..a004694edc5f --- /dev/null +++ b/app/code/Magento/Integration/Model/CustomUserContext.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Integration\Model; + +use Magento\Authorization\Model\UserContextInterface; + +class CustomUserContext implements UserContextInterface +{ + /** + * @var int|null + */ + private $userId; + + /** + * @var int|null + */ + private $userType; + + /** + * @param int|null $userId + * @param int|null $userType + */ + public function __construct(?int $userId, ?int $userType) + { + $this->userId = $userId; + $this->userType = $userType; + } + + /** + * @inheritDoc + */ + public function getUserId() + { + return $this->userId; + } + + /** + * @inheritDoc + */ + public function getUserType() + { + return $this->userType; + } +} diff --git a/app/code/Magento/Integration/Model/CustomerTokenService.php b/app/code/Magento/Integration/Model/CustomerTokenService.php index 7c2c444a734e..0cdad363d80e 100644 --- a/app/code/Magento/Integration/Model/CustomerTokenService.php +++ b/app/code/Magento/Integration/Model/CustomerTokenService.php @@ -7,29 +7,26 @@ namespace Magento\Integration\Model; use Magento\Customer\Api\AccountManagementInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\LocalizedException; -use Magento\Integration\Model\CredentialsValidator; -use Magento\Integration\Model\Oauth\Token as Token; +use Magento\Integration\Model\UserToken\UserTokenParametersFactory; +use Magento\Integration\Api\Exception\UserTokenException; +use Magento\Integration\Api\UserTokenIssuerInterface; +use Magento\Integration\Api\UserTokenRevokerInterface; use Magento\Integration\Model\Oauth\TokenFactory as TokenModelFactory; use Magento\Integration\Model\ResourceModel\Oauth\Token\CollectionFactory as TokenCollectionFactory; use Magento\Integration\Model\Oauth\Token\RequestThrottler; use Magento\Framework\Exception\AuthenticationException; use Magento\Framework\Event\ManagerInterface; +use Magento\Integration\Api\CustomerTokenServiceInterface; /** * @inheritdoc */ -class CustomerTokenService implements \Magento\Integration\Api\CustomerTokenServiceInterface +class CustomerTokenService implements CustomerTokenServiceInterface { /** - * Token Model - * - * @var TokenModelFactory - */ - private $tokenModelFactory; - - /** - * @var Magento\Framework\Event\ManagerInterface + * @var ManagerInterface */ private $eventManager; @@ -41,21 +38,29 @@ class CustomerTokenService implements \Magento\Integration\Api\CustomerTokenServ private $accountManagement; /** - * @var \Magento\Integration\Model\CredentialsValidator + * @var CredentialsValidator */ private $validatorHelper; /** - * Token Collection Factory - * - * @var TokenCollectionFactory + * @var RequestThrottler */ - private $tokenModelCollectionFactory; + private $requestThrottler; /** - * @var RequestThrottler + * @var UserTokenParametersFactory */ - private $requestThrottler; + private $tokenParametersFactory; + + /** + * @var UserTokenIssuerInterface + */ + private $tokenIssuer; + + /** + * @var UserTokenRevokerInterface + */ + private $tokenRevoker; /** * Initialize service @@ -63,22 +68,29 @@ class CustomerTokenService implements \Magento\Integration\Api\CustomerTokenServ * @param TokenModelFactory $tokenModelFactory * @param AccountManagementInterface $accountManagement * @param TokenCollectionFactory $tokenModelCollectionFactory - * @param \Magento\Integration\Model\CredentialsValidator $validatorHelper - * @param \Magento\Framework\Event\ManagerInterface $eventManager + * @param CredentialsValidator $validatorHelper + * @param ManagerInterface|null $eventManager + * @param UserTokenParametersFactory|null $tokenParamsFactory + * @param UserTokenIssuerInterface|null $tokenIssuer + * @param UserTokenRevokerInterface|null $tokenRevoker */ public function __construct( TokenModelFactory $tokenModelFactory, AccountManagementInterface $accountManagement, TokenCollectionFactory $tokenModelCollectionFactory, CredentialsValidator $validatorHelper, - ManagerInterface $eventManager = null + ManagerInterface $eventManager = null, + ?UserTokenParametersFactory $tokenParamsFactory = null, + ?UserTokenIssuerInterface $tokenIssuer = null, + ?UserTokenRevokerInterface $tokenRevoker = null ) { - $this->tokenModelFactory = $tokenModelFactory; $this->accountManagement = $accountManagement; - $this->tokenModelCollectionFactory = $tokenModelCollectionFactory; $this->validatorHelper = $validatorHelper; - $this->eventManager = $eventManager ?: \Magento\Framework\App\ObjectManager::getInstance() - ->get(ManagerInterface::class); + $this->eventManager = $eventManager ?: ObjectManager::getInstance()->get(ManagerInterface::class); + $this->tokenParametersFactory = $tokenParamsFactory + ?? ObjectManager::getInstance()->get(UserTokenParametersFactory::class); + $this->tokenIssuer = $tokenIssuer ?? ObjectManager::getInstance()->get(UserTokenIssuerInterface::class); + $this->tokenRevoker = $tokenRevoker ?? ObjectManager::getInstance()->get(UserTokenRevokerInterface::class); } /** @@ -101,30 +113,28 @@ public function createCustomerAccessToken($username, $password) } $this->eventManager->dispatch('customer_login', ['customer' => $customerDataObject]); $this->getRequestThrottler()->resetAuthenticationFailuresCount($username, RequestThrottler::USER_TYPE_CUSTOMER); - return $this->tokenModelFactory->create()->createCustomerToken($customerDataObject->getId())->getToken(); + $context = new CustomUserContext( + (int)$customerDataObject->getId(), + CustomUserContext::USER_TYPE_CUSTOMER + ); + $params = $this->tokenParametersFactory->create(); + + return $this->tokenIssuer->create($context, $params); } /** * Revoke token by customer id. * - * The function will delete the token from the oauth_token table. - * * @param int $customerId * @return bool * @throws \Magento\Framework\Exception\LocalizedException */ public function revokeCustomerAccessToken($customerId) { - $tokenCollection = $this->tokenModelCollectionFactory->create()->addFilterByCustomerId($customerId); - if ($tokenCollection->getSize() == 0) { - throw new LocalizedException(__('This customer has no tokens.')); - } try { - foreach ($tokenCollection as $token) { - $token->delete(); - } - } catch (\Exception $e) { - throw new LocalizedException(__("The tokens couldn't be revoked.")); + $this->tokenRevoker->revokeFor(new CustomUserContext((int)$customerId, CustomUserContext::USER_TYPE_CUSTOMER)); + } catch (UserTokenException $exception) { + throw new LocalizedException(__('Failed to revoke customer\'s access tokens'), $exception); } return true; } @@ -138,7 +148,7 @@ public function revokeCustomerAccessToken($customerId) private function getRequestThrottler() { if (!$this->requestThrottler instanceof RequestThrottler) { - return \Magento\Framework\App\ObjectManager::getInstance()->get(RequestThrottler::class); + return ObjectManager::getInstance()->get(RequestThrottler::class); } return $this->requestThrottler; } diff --git a/app/code/Magento/Integration/Model/Message/RecreatedIntegration.php b/app/code/Magento/Integration/Model/Message/RecreatedIntegration.php index d3ef8dc5e262..b90bc4e11cd5 100644 --- a/app/code/Magento/Integration/Model/Message/RecreatedIntegration.php +++ b/app/code/Magento/Integration/Model/Message/RecreatedIntegration.php @@ -81,6 +81,8 @@ public function isDisplayed() */ public function getIdentity() { + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction return md5('INTEGRATION_RECREATED'); } diff --git a/app/code/Magento/Integration/Model/Oauth/Token.php b/app/code/Magento/Integration/Model/Oauth/Token.php index 7a3580b8bd40..cc693c03b92d 100644 --- a/app/code/Magento/Integration/Model/Oauth/Token.php +++ b/app/code/Magento/Integration/Model/Oauth/Token.php @@ -6,8 +6,14 @@ namespace Magento\Integration\Model\Oauth; use Magento\Authorization\Model\UserContextInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Oauth\Exception as OauthException; use Magento\Framework\Oauth\Helper\Oauth as OauthHelper; +use Magento\Integration\Api\Data\UserTokenParametersInterfaceFactory; +use Magento\Integration\Api\Exception\UserTokenException; +use Magento\Integration\Api\UserTokenIssuerInterface; +use Magento\Integration\Api\UserTokenReaderInterface; +use Magento\Integration\Model\CustomUserContext; use Magento\Integration\Model\ResourceModel\Oauth\Token\Collection as TokenCollection; /** @@ -76,6 +82,21 @@ class Token extends \Magento\Framework\Model\AbstractModel */ protected $_keyLengthFactory; + /** + * @var UserTokenReaderInterface + */ + private $reader; + + /** + * @var UserTokenIssuerInterface + */ + private $issuer; + + /** + * @var UserTokenParametersInterfaceFactory + */ + private $tokenParamsFactory; + /** * Initialize dependencies. * @@ -89,6 +110,9 @@ class Token extends \Magento\Framework\Model\AbstractModel * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection * @param array $data + * @param UserTokenReaderInterface|null $reader + * @param UserTokenIssuerInterface|null $issuer + * @param UserTokenParametersInterfaceFactory|null $paramsFactory * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -101,7 +125,10 @@ public function __construct( OauthHelper $oauthHelper, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, - array $data = [] + array $data = [], + ?UserTokenReaderInterface $reader = null, + ?UserTokenIssuerInterface $issuer = null, + ?UserTokenParametersInterfaceFactory $paramsFactory = null ) { parent::__construct($context, $registry, $resource, $resourceCollection, $data); $this->_keyLengthFactory = $keyLengthFactory; @@ -109,6 +136,9 @@ public function __construct( $this->_consumerFactory = $consumerFactory; $this->_oauthData = $oauthData; $this->_oauthHelper = $oauthHelper; + $this->reader = ObjectManager::getInstance()->get(UserTokenReaderInterface::class); + $this->issuer = ObjectManager::getInstance()->get(UserTokenIssuerInterface::class); + $this->tokenParamsFactory = ObjectManager::getInstance()->get(UserTokenParametersInterfaceFactory::class); } /** @@ -184,11 +214,17 @@ public function convertToAccess() * * @param int $userId * @return $this + * @deprecated New proper SPI for warking with tokens has been introduced. + * @see UserTokenIssuerInterface */ public function createAdminToken($userId) { - $this->setAdminId($userId); - return $this->saveAccessToken(UserContextInterface::USER_TYPE_ADMIN); + return $this->loadByToken( + $this->issuer->create( + new CustomUserContext((int) $userId, UserContextInterface::USER_TYPE_ADMIN), + $this->tokenParamsFactory->create() + ) + ); } /** @@ -196,11 +232,17 @@ public function createAdminToken($userId) * * @param int $userId * @return $this + * @deprecated New proper SPI for warking with tokens has been introduced. + * @see UserTokenIssuerInterface */ public function createCustomerToken($userId) { - $this->setCustomerId($userId); - return $this->saveAccessToken(UserContextInterface::USER_TYPE_CUSTOMER); + return $this->loadByToken( + $this->issuer->create( + new CustomUserContext((int) $userId, UserContextInterface::USER_TYPE_CUSTOMER), + $this->tokenParamsFactory->create() + ) + ); } /** @@ -352,9 +394,32 @@ public function loadByCustomerId($customerId) * * @param string $token * @return $this + * @deprecated Proper SPI for managing tokens was introduced. + * @see UserTokenReaderInterface */ public function loadByToken($token) { - return $this->load($token, 'token'); + $data = $this->load($token, 'token'); + if ($data->getId()) { + return $data; + } + try { + $data = $this->reader->read($token); + } catch (UserTokenException $exception) { + //Token is not valid, keeping this model's data empty + return $this; + } + + $this->setUserType($data->getUserContext()->getUserType()); + if ($data->getUserContext()->getUserType() === UserContextInterface::USER_TYPE_CUSTOMER) { + $this->setCustomerId($data->getUserContext()->getUserId()); + } else { + $this->setAdminId($data->getUserContext()->getUserId()); + } + $this->setId(PHP_INT_MAX); + $this->setToken($token); + $this->setCreatedAt($data->getData()->getIssued()->format('Y-m-d H:i:s')); + + return $this; } } diff --git a/app/code/Magento/Integration/Model/OpaqueToken/Data.php b/app/code/Magento/Integration/Model/OpaqueToken/Data.php new file mode 100644 index 000000000000..50de431068e2 --- /dev/null +++ b/app/code/Magento/Integration/Model/OpaqueToken/Data.php @@ -0,0 +1,44 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Integration\Model\OpaqueToken; + +use Magento\Integration\Api\Data\UserTokenDataInterface; + +class Data implements UserTokenDataInterface +{ + /** + * @var \DateTimeImmutable + */ + private $issued; + + /** + * @var \DateTimeImmutable + */ + private $expires; + + /** + * @param \DateTimeImmutable $issued + * @param \DateTimeImmutable $expires + */ + public function __construct(\DateTimeImmutable $issued, \DateTimeImmutable $expires) + { + $this->issued = $issued; + $this->expires = $expires; + } + + public function getIssued(): \DateTimeImmutable + { + return $this->issued; + } + + public function getExpires(): \DateTimeImmutable + { + return $this->expires; + } +} diff --git a/app/code/Magento/Integration/Model/OpaqueToken/Issuer.php b/app/code/Magento/Integration/Model/OpaqueToken/Issuer.php new file mode 100644 index 000000000000..f4a825b07c58 --- /dev/null +++ b/app/code/Magento/Integration/Model/OpaqueToken/Issuer.php @@ -0,0 +1,73 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Integration\Model\OpaqueToken; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Integration\Api\Data\UserTokenParametersInterface; +use Magento\Integration\Api\Exception\UserTokenException; +use Magento\Integration\Api\UserTokenIssuerInterface; +use Magento\Integration\Model\Oauth\Token; +use Magento\Integration\Model\Oauth\TokenFactory as TokenModelFactory; +use Magento\Framework\Oauth\Helper\Oauth as OauthHelper; + +/** + * Issues opaque tokens (legacy). + */ +class Issuer implements UserTokenIssuerInterface +{ + /** + * @var TokenModelFactory + */ + private $tokenFactory; + + /** + * @var OauthHelper + */ + private $helper; + + /** + * @param TokenModelFactory $tokenFactory + */ + public function __construct(TokenModelFactory $tokenFactory, OauthHelper $helper) + { + $this->tokenFactory = $tokenFactory; + $this->helper = $helper; + } + + /** + * @inheritDoc + */ + public function create(UserContextInterface $userContext, UserTokenParametersInterface $params): string + { + /** @var Token $token */ + $token = $this->tokenFactory->create(); + + if ($userContext->getUserType() === UserContextInterface::USER_TYPE_CUSTOMER) { + $token->setCustomerId($userContext->getUserId()); + } elseif ($userContext->getUserType() === UserContextInterface::USER_TYPE_ADMIN) { + $token->setAdminId($userContext->getUserId()); + } else { + throw new UserTokenException('Can only create tokens for customers and admin users'); + } + $token->setUserType($userContext->getUserType()); + $token->setType(Token::TYPE_ACCESS); + $token->setToken($this->helper->generateToken()); + $token->setSecret($this->helper->generateTokenSecret()); + if ($params->getForcedIssuedTime()) { + if ($params->getForcedIssuedTime()->getTimezone()->getName() !== 'UTC') { + throw new UserTokenException('Invalid forced issued time provided'); + } + $token->setCreatedAt($params->getForcedIssuedTime()->format('Y-m-d H:i:s')); + } + $token = $token->save(); + + + return $token->getToken(); + } +} diff --git a/app/code/Magento/Integration/Model/OpaqueToken/Reader.php b/app/code/Magento/Integration/Model/OpaqueToken/Reader.php new file mode 100644 index 000000000000..fedf61318884 --- /dev/null +++ b/app/code/Magento/Integration/Model/OpaqueToken/Reader.php @@ -0,0 +1,79 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Integration\Model\OpaqueToken; + +use Magento\Integration\Api\Data\UserToken; +use Magento\Integration\Api\Exception\UserTokenException; +use Magento\Integration\Api\UserTokenReaderInterface; +use Magento\Integration\Model\CustomUserContext; +use Magento\Integration\Model\Oauth\Token; +use Magento\Integration\Model\Oauth\TokenFactory; +use Magento\Integration\Helper\Oauth\Data as OauthHelper; + +class Reader implements UserTokenReaderInterface +{ + /** + * @var TokenFactory + */ + private $tokenFactory; + + /** + * @var OauthHelper + */ + private $helper; + + /** + * @param TokenFactory $tokenFactory + * @param OauthHelper $helper + */ + public function __construct(TokenFactory $tokenFactory, OauthHelper $helper) + { + $this->tokenFactory = $tokenFactory; + $this->helper = $helper; + } + + /** + * @inheritDoc + */ + public function read(string $token): UserToken + { + /** @var Token $tokenModel */ + $tokenModel = $this->tokenFactory->create(); + $tokenModel = $tokenModel->load($token, 'token'); + + if (!$tokenModel->getId()) { + throw new UserTokenException('Token does not exist'); + } + if ($tokenModel->getRevoked()) { + throw new UserTokenException('Token was revoked'); + } + $userType = (int) $tokenModel->getUserType(); + if ($userType !== CustomUserContext::USER_TYPE_ADMIN && $userType !== CustomUserContext::USER_TYPE_CUSTOMER) { + throw new UserTokenException('Invalid token found'); + } + if ($userType === CustomUserContext::USER_TYPE_ADMIN) { + $userId = $tokenModel->getAdminId(); + } else { + $userId = $tokenModel->getCustomerId(); + } + if (!$userId) { + throw new UserTokenException('Invalid token found'); + } + $issued = \DateTimeImmutable::createFromFormat( + 'Y-m-d H:i:s', + $tokenModel->getCreatedAt(), + new \DateTimeZone('UTC') + ); + $lifetimeHours = $userType === CustomUserContext::USER_TYPE_ADMIN + ? $this->helper->getAdminTokenLifetime() : $this->helper->getCustomerTokenLifetime(); + $expires = $issued->add(new \DateInterval("PT{$lifetimeHours}H")); + + return new UserToken(new CustomUserContext((int) $userId, (int) $userType), new Data($issued, $expires)); + } +} diff --git a/app/code/Magento/Integration/Model/OpaqueToken/Revoker.php b/app/code/Magento/Integration/Model/OpaqueToken/Revoker.php new file mode 100644 index 000000000000..d9c0027fa571 --- /dev/null +++ b/app/code/Magento/Integration/Model/OpaqueToken/Revoker.php @@ -0,0 +1,55 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Integration\Model\OpaqueToken; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Integration\Api\Exception\UserTokenException; +use Magento\Integration\Api\UserTokenRevokerInterface; +use Magento\Integration\Model\ResourceModel\Oauth\Token\CollectionFactory as TokenCollectionFactory; +use Magento\Integration\Model\ResourceModel\Oauth\Token\Collection as TokenCollection; + +class Revoker implements UserTokenRevokerInterface +{ + /** + * @var TokenCollectionFactory + */ + private $tokenCollectionFactory; + + /** + * @param TokenCollectionFactory $tokenCollectionFactory + */ + public function __construct(TokenCollectionFactory $tokenCollectionFactory) + { + $this->tokenCollectionFactory = $tokenCollectionFactory; + } + + /** + * @inheritDoc + */ + public function revokeFor(UserContextInterface $userContext): void + { + /** @var TokenCollection $tokenCollection */ + $tokenCollection = $this->tokenCollectionFactory->create(); + if ($userContext->getUserType() === UserContextInterface::USER_TYPE_CUSTOMER) { + $tokenCollection->addFilterByCustomerId($userContext->getUserId()); + } elseif ($userContext->getUserType() === UserContextInterface::USER_TYPE_ADMIN) { + $tokenCollection->addFilterByAdminId($userContext->getUserId()); + } else { + throw new \InvalidArgumentException('Opaque token revoker only works for customers and admin users'); + } + try { + foreach ($tokenCollection as $token) { + $token->delete(); + } + } catch (\Exception $e) { + throw new UserTokenException("The tokens couldn't be revoked.", $e); + } + } +} diff --git a/app/code/Magento/Integration/Model/UserToken/ExpirationValidator.php b/app/code/Magento/Integration/Model/UserToken/ExpirationValidator.php new file mode 100644 index 000000000000..3e19fed38aea --- /dev/null +++ b/app/code/Magento/Integration/Model/UserToken/ExpirationValidator.php @@ -0,0 +1,40 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Integration\Model\UserToken; + +use Magento\Framework\Exception\AuthorizationException; +use Magento\Integration\Api\Data\UserToken; +use Magento\Integration\Api\UserTokenValidatorInterface; +use Magento\Framework\Stdlib\DateTime\DateTime as DtUtil; + +class ExpirationValidator implements UserTokenValidatorInterface +{ + /** + * @var DtUtil + */ + private $datetimeUtil; + + /** + * @param DtUtil $datetimeUtil + */ + public function __construct(DtUtil $datetimeUtil) + { + $this->datetimeUtil = $datetimeUtil; + } + + /** + * @inheritDoc + */ + public function validate(UserToken $token): void + { + if ($token->getData()->getExpires()->getTimestamp() <= $this->datetimeUtil->gmtTimestamp()) { + throw new AuthorizationException(__('Consumer key has expired')); + } + } +} diff --git a/app/code/Magento/Integration/Model/UserToken/UserTokenParameters.php b/app/code/Magento/Integration/Model/UserToken/UserTokenParameters.php new file mode 100644 index 000000000000..3acfa2aa1f50 --- /dev/null +++ b/app/code/Magento/Integration/Model/UserToken/UserTokenParameters.php @@ -0,0 +1,51 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Integration\Model\UserToken; + +use Magento\Framework\Api\ExtensionAttributesFactory; +use Magento\Integration\Api\Data\UserTokenParametersInterface; +use Magento\Integration\Api\Data\UserTokenParametersExtensionInterface; + +/** + * @inheritDoc + */ +class UserTokenParameters implements UserTokenParametersInterface +{ + /** + * @var \Magento\Framework\Api\ExtensionAttributesInterface|null|UserTokenParametersExtensionInterface + */ + private $extensionAttrs; + + /** + * @var \DateTimeInterface|null + */ + private $forceIssued; + + public function __construct(ExtensionAttributesFactory $extensionAttrsFactory, ?\DateTimeInterface $issued = null) + { + $this->extensionAttrs = $extensionAttrsFactory->create(self::class, []); + $this->forceIssued = $issued; + + } + + public function getForcedIssuedTime(): ?\DateTimeInterface + { + return $this->forceIssued; + } + + public function getExtensionAttributes(): ?UserTokenParametersExtensionInterface + { + return $this->extensionAttrs; + } + + public function setExtensionAttributes(UserTokenParametersExtensionInterface $extended): void + { + $this->extensionAttrs = $extended; + } +} diff --git a/app/code/Magento/Integration/Plugin/Model/AdminUser.php b/app/code/Magento/Integration/Plugin/Model/AdminUser.php index 7b2fa1981bce..ae3ffdf33817 100644 --- a/app/code/Magento/Integration/Plugin/Model/AdminUser.php +++ b/app/code/Magento/Integration/Plugin/Model/AdminUser.php @@ -7,6 +7,8 @@ namespace Magento\Integration\Plugin\Model; use Magento\Integration\Model\AdminTokenService; +use Magento\User\Model\User; +use Magento\Framework\Model\AbstractModel; /** * Plugin to delete admin tokens when admin becomes inactive @@ -27,22 +29,22 @@ public function __construct( $this->adminTokenService = $adminTokenService; } - /** - * Check if admin is inactive - if so, invalidate their tokens - * - * @param \Magento\User\Model\User $subject - * @param \Magento\Framework\DataObject $object - * @return \Magento\User\Model\User - * @throws \Magento\Framework\Exception\LocalizedException - */ public function afterSave( - \Magento\User\Model\User $subject, - \Magento\Framework\DataObject $object - ): \Magento\User\Model\User { - $isActive = $object->getIsActive(); + User $subject, + AbstractModel $return + ): AbstractModel { + $isActive = $return->getIsActive(); if ($isActive !== null && $isActive == 0) { - $this->adminTokenService->revokeAdminAccessToken($object->getId()); + $this->adminTokenService->revokeAdminAccessToken((int) $return->getId()); } - return $subject; + + return $return; + } + + public function afterDelete(User $subject, AbstractModel $return): AbstractModel + { + $this->adminTokenService->revokeAdminAccessToken((int) $return->getId()); + + return $return; } } diff --git a/app/code/Magento/Integration/Plugin/Model/CustomerUser.php b/app/code/Magento/Integration/Plugin/Model/CustomerUser.php index 537b66402397..bb681fd5e947 100644 --- a/app/code/Magento/Integration/Plugin/Model/CustomerUser.php +++ b/app/code/Magento/Integration/Plugin/Model/CustomerUser.php @@ -5,7 +5,9 @@ */ namespace Magento\Integration\Plugin\Model; +use Magento\Framework\Model\AbstractModel; use Magento\Integration\Model\CustomerTokenService; +use Magento\Customer\Model\Customer; /** * Plugin to delete customer tokens when customer becomes inactive @@ -29,18 +31,27 @@ public function __construct( /** * Check if customer is inactive - if so, invalidate their tokens * - * @param \Magento\Customer\Model\Customer $subject - * @param \Magento\Framework\DataObject $object - * @return $this + * @param Customer $subject + * @param AbstractModel $object + * @return AbstractModel + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterSave( - \Magento\Customer\Model\Customer $subject, - \Magento\Framework\DataObject $object + Customer $subject, + AbstractModel $object ) { $isActive = $object->getIsActive(); if (isset($isActive) && $isActive == 0) { $this->customerTokenService->revokeCustomerAccessToken($object->getId()); } - return $subject; + return $object; + } + + public function afterDelete(Customer $subject, AbstractModel $return): AbstractModel + { + $this->customerTokenService->revokeCustomerAccessToken((int) $subject->getId()); + + return $return; } } diff --git a/app/code/Magento/Integration/README.md b/app/code/Magento/Integration/README.md index 0496b0b81f08..5f5e6b990d1d 100644 --- a/app/code/Magento/Integration/README.md +++ b/app/code/Magento/Integration/README.md @@ -1,6 +1,105 @@ -# Integration +# Magento_Integration module -**Integration** enables third-party services to call the Web API by using access tokens. +This module enables third-party services to call the Web API by using access tokens. It provides an admin UI that enables manual creation of integrations. Extensions can also provide a configuration file so that an integration can be automatically pre-configured. The module also contains the data model for request and access token management. + +## Installation + +The Magento_Integration module is one of the base Magento 2 modules. You cannot disable or uninstall this module. + +This module is dependent on the following modules: +- `Magento_Store` +- `Magento_User` +- `Magento_Security` + +The Magento_Integration module creates the following tables in the database: +- `oauth_consumer` +- `oauth_token` +- `oauth_nonce` +- `integration` +- `oauth_token_request_log` + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Extensibility + +Extension developers can interact with the Magento_Integration module. For more information about the Magento extension mechanism, see [Magento plugins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Integration module. + +### Events + +The module dispatches the following events: + +#### Model +- `customer_login` event in the `\Magento\Integration\Model\CustomerTokenService::createCustomerAccessToken` method. Parameters: + - `customer` is an object (`\Magento\Customer\Api\Data\CustomerInterface` class) + +For information about an event in Magento 2, see [Events and observers](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). + +### Layouts + +This module introduces the following layout handles in the `view/adminhtml/layout` directory: +- `adminhtml_integration_edit` +- `adminhtml_integration_grid` +- `adminhtml_integration_grid_block` +- `adminhtml_integration_index` +- `adminhtml_integration_new` +- `adminhtml_integration_permissionsdialog` +- `adminhtml_integration_tokensdialog` +- `adminhtml_integration_tokensexchange` + +For more information about a layout in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). + +### Public APIs + +- `\Magento\Integration\Api\AdminTokenServiceInterface`: + - create access token for admin given the admin credentials + - revoke token by admin ID + +- `\Magento\Integration\Api\AuthorizationServiceInterface`: + - grant permissions to user to access the specified resources + - grant permissions to the user to access all resources available in the system + - remove role and associated permissions for the specified integration + +- `\Magento\Integration\Api\CustomerTokenServiceInterface`: + - create access token for admin given the customer credentials + - revoke token by customer ID + +- `\Magento\Integration\Api\IntegrationServiceInterface`: + - create a new Integration + - get the details of a specific Integration by integration ID + - find Integration by name + - get the details of an Integration by consumer_id + - get the details of an active Integration by consumer_id + - update an Integration + - delete an Integration by integration ID + - get an array of selected resources for an integration + +- `\Magento\Integration\Api\OauthServiceInterface`: + - create a new consumer account + - create access token for provided consumer + - retrieve access token assigned to the consumer + - load consumer by its ID + - load consumer by its key + - execute post to integration (consumer) HTTP Post URL. Generate and return oauth_verifier + - delete the consumer data associated with the integration including its token and nonce + - remove token associated with provided consumer + +For information about a public API in Magento 2, see [Public interfaces & APIs](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/api-concepts.html). + +## Additional information + +### Cron options + +Cron group configuration can be set at `etc/crontab.xml`: +- `outdated_authentication_failures_cleanup` - clearing log of outdated token request authentication failures +- `expired_tokens_cleanups` - delete expired customer and admin tokens + +[Learn how to configure and run cron in Magento.](http://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-cron.html). + +More information can get at articles: +- [Learn more about an Integration](https://docs.magento.com/user-guide/system/integrations.html) +- [Lear how to create an Integration](https://devdocs.magento.com/guides/v2.4/get-started/create-integration.html) diff --git a/app/code/Magento/Integration/Test/Unit/Model/AdminTokenServiceTest.php b/app/code/Magento/Integration/Test/Unit/Model/AdminTokenServiceTest.php deleted file mode 100644 index a49e0ff48faf..000000000000 --- a/app/code/Magento/Integration/Test/Unit/Model/AdminTokenServiceTest.php +++ /dev/null @@ -1,150 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\Integration\Test\Unit\Model; - -use Magento\Integration\Model\AdminTokenService; -use Magento\Integration\Model\CredentialsValidator; -use Magento\Integration\Model\Oauth\Token; -use Magento\Integration\Model\Oauth\TokenFactory; -use Magento\Integration\Model\ResourceModel\Oauth\Token\Collection; -use Magento\Integration\Model\ResourceModel\Oauth\Token\CollectionFactory; -use Magento\User\Model\User; -use PHPUnit\Framework\MockObject\MockObject; -use PHPUnit\Framework\TestCase; - -/** - * Test for Magento\Integration\Model\AdminTokenService class. - */ -class AdminTokenServiceTest extends TestCase -{ - /** \Magento\Integration\Model\AdminTokenService */ - protected $_tokenService; - - /** \Magento\Integration\Model\Oauth\TokenFactory|MockObject */ - protected $_tokenFactoryMock; - - /** \Magento\User\Model\User|MockObject */ - protected $_userModelMock; - - /** \Magento\Integration\Model\ResourceModel\Oauth\Token\Collection|MockObject */ - protected $_tokenModelCollectionMock; - - /** \Magento\Integration\Model\ResourceModel\Oauth\Token\CollectionFactory|MockObject */ - protected $_tokenModelCollectionFactoryMock; - - /** @var CredentialsValidator|MockObject */ - protected $validatorHelperMock; - - /** @var Token|MockObject */ - private $_tokenMock; - - protected function setUp(): void - { - $this->_tokenFactoryMock = $this->getMockBuilder(TokenFactory::class) - ->setMethods(['create']) - ->disableOriginalConstructor() - ->getMock(); - $this->_tokenFactoryMock->expects($this->any())->method('create')->willReturn($this->_tokenMock); - - $this->_userModelMock = $this->getMockBuilder(User::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->_tokenMock = $this->getMockBuilder(Token::class) - ->disableOriginalConstructor() - ->setMethods(['getToken', 'loadByAdminId', 'delete', '__wakeup'])->getMock(); - - $this->_tokenModelCollectionMock = $this->getMockBuilder( - Collection::class - )->disableOriginalConstructor() - ->setMethods( - ['addFilterByAdminId', 'getSize', '__wakeup', '_beforeLoad', '_afterLoad', 'getIterator', '_fetchAll'] - )->getMock(); - - $this->_tokenModelCollectionFactoryMock = $this->getMockBuilder( - CollectionFactory::class - )->setMethods(['create'])->disableOriginalConstructor() - ->getMock(); - - $this->_tokenModelCollectionFactoryMock->expects($this->once()) - ->method('create') - ->willReturn($this->_tokenModelCollectionMock); - - $this->validatorHelperMock = $this->getMockBuilder( - CredentialsValidator::class - )->disableOriginalConstructor() - ->getMock(); - - $this->_tokenService = new AdminTokenService( - $this->_tokenFactoryMock, - $this->_userModelMock, - $this->_tokenModelCollectionFactoryMock, - $this->validatorHelperMock - ); - } - - public function testRevokeAdminAccessToken() - { - $adminId = 1; - - $this->_tokenModelCollectionMock->expects($this->once()) - ->method('addFilterByAdminId') - ->with($adminId) - ->willReturn($this->_tokenModelCollectionMock); - $this->_tokenModelCollectionMock->expects($this->any()) - ->method('getSize') - ->willReturn(1); - $this->_tokenModelCollectionMock->expects($this->once()) - ->method('getIterator') - ->willReturn(new \ArrayIterator([$this->_tokenMock])); - $this->_tokenModelCollectionMock->expects($this->any()) - ->method('_fetchAll') - ->with(null) - ->willReturn(1); - $this->_tokenMock->expects($this->once()) - ->method('delete') - ->willReturn($this->_tokenMock); - - $this->assertTrue($this->_tokenService->revokeAdminAccessToken($adminId)); - } - - public function testRevokeAdminAccessTokenWithoutAdminId() - { - $this->_tokenModelCollectionMock->expects($this->once()) - ->method('addFilterByAdminId') - ->with(null) - ->willReturn($this->_tokenModelCollectionMock); - $this->_tokenMock->expects($this->never()) - ->method('delete') - ->willReturn($this->_tokenMock); - $this->_tokenService->revokeAdminAccessToken(null); - } - - public function testRevokeAdminAccessTokenCannotRevoked() - { - $this->expectException('Magento\Framework\Exception\LocalizedException'); - $this->expectExceptionMessage('The tokens couldn\'t be revoked.'); - $exception = new \Exception(); - $adminId = 1; - $this->_tokenModelCollectionMock->expects($this->once()) - ->method('addFilterByAdminId') - ->with($adminId) - ->willReturn($this->_tokenModelCollectionMock); - $this->_tokenModelCollectionMock->expects($this->once()) - ->method('getSize') - ->willReturn(1); - $this->_tokenModelCollectionMock->expects($this->once()) - ->method('getIterator') - ->willReturn(new \ArrayIterator([$this->_tokenMock])); - - $this->_tokenMock->expects($this->once()) - ->method('delete') - ->willThrowException($exception); - $this->_tokenService->revokeAdminAccessToken($adminId); - } -} diff --git a/app/code/Magento/Integration/Test/Unit/Model/CompositeUserTokenValidatorTest.php b/app/code/Magento/Integration/Test/Unit/Model/CompositeUserTokenValidatorTest.php new file mode 100644 index 000000000000..db7a12dec95c --- /dev/null +++ b/app/code/Magento/Integration/Test/Unit/Model/CompositeUserTokenValidatorTest.php @@ -0,0 +1,31 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Integration\Test\Unit\Model; + +use Magento\Integration\Api\Data\UserToken; +use Magento\Integration\Api\UserTokenValidatorInterface; +use Magento\Integration\Model\CompositeUserTokenValidator; +use PHPUnit\Framework\TestCase; + +class CompositeUserTokenValidatorTest extends TestCase +{ + public function testValidate(): void + { + $userToken = $this->createMock(UserToken::class); + + $validator1 = $this->createMock(UserTokenValidatorInterface::class); + $validator1->expects($this->once())->method('validate')->with($userToken); + + $validator2 = $this->createMock(UserTokenValidatorInterface::class); + $validator2->expects($this->once())->method('validate')->with($userToken); + + $model = new CompositeUserTokenValidator([$validator1, $validator2]); + $model->validate($userToken); + } +} diff --git a/app/code/Magento/Integration/Test/Unit/Model/CustomerTokenServiceTest.php b/app/code/Magento/Integration/Test/Unit/Model/CustomerTokenServiceTest.php deleted file mode 100644 index a6029d9cbce2..000000000000 --- a/app/code/Magento/Integration/Test/Unit/Model/CustomerTokenServiceTest.php +++ /dev/null @@ -1,164 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\Integration\Test\Unit\Model; - -use Magento\Customer\Api\AccountManagementInterface; -use Magento\Framework\Event\ManagerInterface; -use Magento\Integration\Model\CredentialsValidator; -use Magento\Integration\Model\CustomerTokenService; -use Magento\Integration\Model\Oauth\Token; -use Magento\Integration\Model\Oauth\TokenFactory; -use Magento\Integration\Model\ResourceModel\Oauth\Token\Collection; -use Magento\Integration\Model\ResourceModel\Oauth\Token\CollectionFactory; -use PHPUnit\Framework\MockObject\MockObject; -use PHPUnit\Framework\TestCase; - -class CustomerTokenServiceTest extends TestCase -{ - /** \Magento\Integration\Model\CustomerTokenService */ - protected $_tokenService; - - /** \Magento\Integration\Model\Oauth\TokenFactory|MockObject */ - protected $_tokenFactoryMock; - - /** \Magento\Customer\Api\AccountManagementInterface|MockObject */ - protected $_accountManagementMock; - - /** \Magento\Integration\Model\ResourceModel\Oauth\Token\Collection|MockObject */ - protected $_tokenModelCollectionMock; - - /** MockObject */ - protected $_tokenModelCollectionFactoryMock; - - /** @var CredentialsValidator|MockObject */ - protected $validatorHelperMock; - - /** @var Token|MockObject */ - private $_tokenMock; - - /** @var ManagerInterface|MockObject */ - protected $manager; - - protected function setUp(): void - { - $this->_tokenFactoryMock = $this->getMockBuilder(TokenFactory::class) - ->setMethods(['create']) - ->disableOriginalConstructor() - ->getMock(); - $this->_tokenFactoryMock->expects($this->any())->method('create')->willReturn($this->_tokenMock); - - $this->_accountManagementMock = $this - ->getMockBuilder(AccountManagementInterface::class) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - - $this->_tokenMock = $this->getMockBuilder(Token::class) - ->disableOriginalConstructor() - ->setMethods(['getToken', 'loadByCustomerId', 'delete', '__wakeup'])->getMock(); - - $this->_tokenModelCollectionMock = $this->getMockBuilder( - Collection::class - )->disableOriginalConstructor() - ->setMethods( - [ - 'addFilterByCustomerId', - 'getSize', - '__wakeup', - '_beforeLoad', - '_afterLoad', - 'getIterator', - '_fetchAll' - ] - )->getMock(); - - $this->_tokenModelCollectionFactoryMock = $this->getMockBuilder( - CollectionFactory::class - )->setMethods(['create'])->disableOriginalConstructor() - ->getMock(); - - $this->_tokenModelCollectionFactoryMock->expects($this->once()) - ->method('create') - ->willReturn($this->_tokenModelCollectionMock); - - $this->validatorHelperMock = $this->getMockBuilder( - CredentialsValidator::class - )->disableOriginalConstructor() - ->getMock(); - - $this->manager = $this->getMockForAbstractClass(ManagerInterface::class); - - $this->_tokenService = new CustomerTokenService( - $this->_tokenFactoryMock, - $this->_accountManagementMock, - $this->_tokenModelCollectionFactoryMock, - $this->validatorHelperMock, - $this->manager - ); - } - - public function testRevokeCustomerAccessToken() - { - $customerId = 1; - - $this->_tokenModelCollectionMock->expects($this->once()) - ->method('addFilterByCustomerId') - ->with($customerId) - ->willReturn($this->_tokenModelCollectionMock); - $this->_tokenModelCollectionMock->expects($this->any()) - ->method('getSize') - ->willReturn(1); - $this->_tokenModelCollectionMock->expects($this->once()) - ->method('getIterator') - ->willReturn(new \ArrayIterator([$this->_tokenMock])); - $this->_tokenModelCollectionMock->expects($this->any()) - ->method('_fetchAll') - ->willReturn(1); - $this->_tokenMock->expects($this->once()) - ->method('delete') - ->willReturn($this->_tokenMock); - - $this->assertTrue($this->_tokenService->revokeCustomerAccessToken($customerId)); - } - - public function testRevokeCustomerAccessTokenWithoutCustomerId() - { - $this->expectException('Magento\Framework\Exception\LocalizedException'); - $this->expectExceptionMessage('This customer has no tokens.'); - $this->_tokenModelCollectionMock->expects($this->once()) - ->method('addFilterByCustomerId') - ->with(null) - ->willReturn($this->_tokenModelCollectionMock); - $this->_tokenMock->expects($this->never()) - ->method('delete') - ->willReturn($this->_tokenMock); - $this->_tokenService->revokeCustomerAccessToken(null); - } - - public function testRevokeCustomerAccessTokenCannotRevoked() - { - $this->expectException('Magento\Framework\Exception\LocalizedException'); - $this->expectExceptionMessage('The tokens couldn\'t be revoked.'); - $exception = new \Exception(); - $customerId = 1; - $this->_tokenModelCollectionMock->expects($this->once()) - ->method('addFilterByCustomerId') - ->with($customerId) - ->willReturn($this->_tokenModelCollectionMock); - $this->_tokenModelCollectionMock->expects($this->once()) - ->method('getSize') - ->willReturn(1); - $this->_tokenModelCollectionMock->expects($this->once()) - ->method('getIterator') - ->willReturn(new \ArrayIterator([$this->_tokenMock])); - - $this->_tokenMock->expects($this->once()) - ->method('delete') - ->willThrowException($exception); - $this->_tokenService->revokeCustomerAccessToken($customerId); - } -} diff --git a/app/code/Magento/Integration/Test/Unit/Model/Oauth/TokenTest.php b/app/code/Magento/Integration/Test/Unit/Model/Oauth/TokenTest.php deleted file mode 100644 index cc31ea99da4f..000000000000 --- a/app/code/Magento/Integration/Test/Unit/Model/Oauth/TokenTest.php +++ /dev/null @@ -1,530 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\Integration\Test\Unit\Model\Oauth; - -use Magento\Authorization\Model\UserContextInterface; -use Magento\Framework\Event\ManagerInterface; -use Magento\Framework\Model\Context; -use Magento\Framework\Model\ResourceModel\AbstractResource; -use Magento\Framework\Oauth\Exception; -use Magento\Framework\Oauth\Helper\Oauth as OauthHelper; -use Magento\Framework\Registry; -use Magento\Framework\Url\Validator; -use Magento\Integration\Helper\Oauth\Data; -use Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength; -use Magento\Integration\Model\Oauth\Consumer\Validator\KeyLengthFactory; -use Magento\Integration\Model\Oauth\ConsumerFactory; -use Magento\Integration\Model\Oauth\Token; -use PHPUnit\Framework\MockObject\MockObject; -use PHPUnit\Framework\TestCase; - -/** - * Unit test for \Magento\Integration\Model\Oauth\Nonce - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class TokenTest extends TestCase -{ - /** - * @var Token - */ - protected $tokenModel; - - /** - * @var Context|MockObject - */ - protected $contextMock; - - /** - * @var Registry|MockObject - */ - protected $registryMock; - - /** - * @var KeyLengthFactory|MockObject - */ - protected $keyLengthFactoryMock; - - /** - * @var KeyLength|MockObject - */ - protected $validatorKeyLengthMock; - - /** - * @var Validator|MockObject - */ - protected $validatorMock; - - /** - * @var ConsumerFactory|MockObject - */ - protected $consumerFactoryMock; - - /** - * @var Data|MockObject - */ - protected $oauthDataMock; - - /** - * @var \Magento\Framework\Oauth\Helper\Oauth|MockObject - */ - protected $oauthHelperMock; - - /** - * @var AbstractResource|MockObject - */ - protected $resourceMock; - - protected function setUp(): void - { - $this->contextMock = $this->getMockBuilder(Context::class) - ->setMethods(['getEventDispatcher']) - ->disableOriginalConstructor() - ->getMock(); - - $this->registryMock = $this->getMockBuilder(Registry::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->validatorKeyLengthMock = $this->getMockBuilder( - KeyLength::class - ) - ->setMethods(['isValid', 'setLength', 'setName', 'getMessages']) - ->disableOriginalConstructor() - ->getMock(); - - $this->keyLengthFactoryMock = $this->getMockBuilder( - KeyLengthFactory::class - ) - ->setMethods(['create']) - ->disableOriginalConstructor() - ->getMock(); - - $this->validatorMock = $this->getMockBuilder(Validator::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->consumerFactoryMock = $this->getMockBuilder(ConsumerFactory::class) - ->setMethods(['create']) - ->disableOriginalConstructor() - ->getMock(); - - $this->oauthDataMock = $this->getMockBuilder(Data::class) - ->setMethods(['isCleanupProbability', 'getCleanupExpirationPeriod']) - ->disableOriginalConstructor() - ->getMock(); - - $this->oauthHelperMock = $this->getMockBuilder(\Magento\Framework\Oauth\Helper\Oauth::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->resourceMock = $this->getMockBuilder(AbstractResource::class) - ->setMethods( - [ - 'getIdFieldName', - 'deleteOldEntries', - '_construct', - 'getConnection', - 'selectTokenByType', - 'save', - 'selectTokenByConsumerIdAndUserType', - 'selectTokenByAdminId', - 'selectTokenByCustomerId', - 'load' - ] - ) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - - $this->resourceMock->expects($this->any()) - ->method('getIdFieldName') - ->willReturn('id'); - - $eventManagerMock = $this->getMockBuilder(ManagerInterface::class) - ->setMethods(['dispatch']) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - - $this->contextMock->expects($this->once()) - ->method('getEventDispatcher') - ->willReturn($eventManagerMock); - - $this->tokenModel = new Token( - $this->contextMock, - $this->registryMock, - $this->keyLengthFactoryMock, - $this->validatorMock, - $this->consumerFactoryMock, - $this->oauthDataMock, - $this->oauthHelperMock, - $this->resourceMock - ); - } - - public function testAfterSave() - { - $this->oauthDataMock->expects($this->once())->method('isCleanupProbability')->willReturn(true); - $this->oauthDataMock->expects($this->once())->method('getCleanupExpirationPeriod')->willReturn(30); - $this->resourceMock->expects($this->once())->method('deleteOldEntries')->with(30); - - $this->assertEquals($this->tokenModel, $this->tokenModel->afterSave()); - } - - public function testAfterSaveNoCleanupProbability() - { - $this->oauthDataMock->expects($this->once())->method('isCleanupProbability')->willReturn(false); - $this->oauthDataMock->expects($this->never())->method('getCleanupExpirationPeriod'); - $this->resourceMock->expects($this->never())->method('deleteOldEntries'); - - $this->assertEquals($this->tokenModel, $this->tokenModel->afterSave()); - } - - public function testCreateVerifierToken() - { - $consumerId = 1; - - $this->resourceMock->expects($this->once()) - ->method('selectTokenByType') - ->with($consumerId, Token::TYPE_VERIFIER) - ->willReturn(['id' => 123]); - - $this->oauthHelperMock->expects($this->never())->method('generateToken'); - $this->oauthHelperMock->expects($this->never())->method('generateTokenSecret'); - $this->oauthHelperMock->expects($this->never())->method('generateVerifier'); - $this->validatorMock->expects($this->never())->method('isValid'); - $this->keyLengthFactoryMock->expects($this->never())->method('create'); - $this->resourceMock->expects($this->never())->method('save'); - $this->assertEquals($this->tokenModel, $this->tokenModel->createVerifierToken($consumerId)); - } - - public function testCreateVerifierTokenIfNoTokenId() - { - $consumerId = 1; - $secret = 'secret'; - $token = 'token'; - $verifier = 'verifier'; - - $this->oauthHelperMock->expects($this->once())->method('generateTokenSecret')->willReturn($secret); - $this->oauthHelperMock->expects($this->once())->method('generateToken')->willReturn($token); - $this->oauthHelperMock->expects($this->once())->method('generateVerifier')->willReturn($verifier); - - $this->resourceMock->expects($this->once()) - ->method('selectTokenByType') - ->with($consumerId, Token::TYPE_VERIFIER) - ->willReturn([]); - - $this->tokenModel->setCallbackUrl(OauthHelper::CALLBACK_ESTABLISHED); - - $this->keyLengthFactoryMock->expects($this->once())->method('create')->willReturn( - $this->validatorKeyLengthMock - ); - $this->validatorKeyLengthMock->expects($this->exactly(3))->method('setLength'); - $this->validatorKeyLengthMock->expects($this->exactly(3))->method('setName'); - $this->validatorKeyLengthMock->expects($this->exactly(3))->method('isValid')->willReturn(true); - $this->resourceMock->expects($this->once())->method('save'); - $this->assertEquals($this->tokenModel, $this->tokenModel->createVerifierToken($consumerId)); - } - - public function testConvertToAccessIfIsNotRequestType() - { - $this->expectException('Magento\Framework\Oauth\Exception'); - $this->expectExceptionMessage('Cannot convert to access token due to token is not request type'); - $this->tokenModel->setType('isNotRequestType'); - $this->tokenModel->convertToAccess(); - } - - public function testConvertToAccess() - { - $token = 'token'; - $secret = 'secret'; - - $this->tokenModel->setType(Token::TYPE_REQUEST); - $this->oauthHelperMock->expects($this->once())->method('generateToken')->willReturn($token); - $this->oauthHelperMock->expects($this->once())->method('generateTokenSecret')->willReturn($secret); - $this->resourceMock->expects($this->once())->method('save'); - - $result = $this->tokenModel->convertToAccess(); - $this->assertEquals($this->tokenModel, $result); - $this->assertEquals($token, $result->getToken()); - $this->assertEquals($secret, $result->getSecret()); - $this->assertEquals(UserContextInterface::USER_TYPE_INTEGRATION, $result->getUserType()); - } - - public function testCreateAdminToken() - { - $userId = 1; - $token = 'token'; - $secret = 'secret'; - - $this->oauthHelperMock->expects($this->once())->method('generateToken')->willReturn($token); - $this->oauthHelperMock->expects($this->once())->method('generateTokenSecret')->willReturn($secret); - $this->resourceMock->expects($this->once())->method('save'); - - $result = $this->tokenModel->createAdminToken($userId); - $this->assertEquals($this->tokenModel, $result); - $this->assertEquals($token, $result->getToken()); - $this->assertEquals($secret, $result->getSecret()); - $this->assertEquals($userId, $result->getAdminId()); - $this->assertEquals(UserContextInterface::USER_TYPE_ADMIN, $result->getUserType()); - } - - public function testCreateCustomerToken() - { - $userId = 1; - $token = 'token'; - $secret = 'secret'; - - $this->oauthHelperMock->expects($this->once())->method('generateToken')->willReturn($token); - $this->oauthHelperMock->expects($this->once())->method('generateTokenSecret')->willReturn($secret); - $this->resourceMock->expects($this->once())->method('save'); - - $result = $this->tokenModel->createCustomerToken($userId); - $this->assertEquals($this->tokenModel, $result); - $this->assertEquals($token, $result->getToken()); - $this->assertEquals($secret, $result->getSecret()); - $this->assertEquals($userId, $result->getCustomerId()); - $this->assertNotEquals($userId, $result->getAdminId()); - $this->assertEquals(UserContextInterface::USER_TYPE_CUSTOMER, $result->getUserType()); - } - - public function testCreateRequestToken() - { - $entityId = 1; - $callbackUrl = OauthHelper::CALLBACK_ESTABLISHED; - $token = 'token'; - $secret = 'secret'; - - $this->oauthHelperMock->expects($this->once())->method('generateTokenSecret')->willReturn($secret); - $this->oauthHelperMock->expects($this->once())->method('generateToken')->willReturn($token); - - $this->tokenModel->setCallbackUrl($callbackUrl); - $this->keyLengthFactoryMock->expects($this->once())->method('create')->willReturn( - $this->validatorKeyLengthMock - ); - $this->validatorKeyLengthMock->expects($this->exactly(2))->method('setLength'); - $this->validatorKeyLengthMock->expects($this->exactly(2))->method('setName'); - $this->validatorKeyLengthMock->expects($this->exactly(2))->method('isValid')->willReturn(true); - $this->resourceMock->expects($this->once())->method('save'); - - $actualToken = $this->tokenModel->createRequestToken($entityId, $callbackUrl); - $this->assertEquals($this->tokenModel, $actualToken); - $this->assertEquals($this->tokenModel->getSecret(), $actualToken->getSecret()); - $this->assertEquals($this->tokenModel->getToken(), $actualToken->getToken()); - } - - public function testToString() - { - $token = 'token'; - $secret = 'secret'; - $expectedResponse = "oauth_token={$token}&oauth_token_secret={$secret}"; - - $this->tokenModel->setToken($token)->setSecret($secret); - - $this->assertEquals($expectedResponse, sprintf($this->tokenModel)); - } - - public function testBeforeSave() - { - $this->assertEquals($this->tokenModel, $this->tokenModel->beforeSave()); - } - - public function testGetVerifier() - { - $verifier = 'testVerifier'; - $this->tokenModel->setData('verifier', $verifier); - $this->assertEquals($verifier, $this->tokenModel->getVerifier()); - } - - public function testLoadByConsumerIdAndUserType() - { - $consumerId = 1; - $userType = 1; - $tokenData = 'testToken'; - $data = ['token' => $tokenData]; - - $this->resourceMock->expects($this->once())->method('selectTokenByConsumerIdAndUserType')->willReturn($data); - $actualToken = $this->tokenModel->loadByConsumerIdAndUserType($consumerId, $userType); - $this->assertEquals($this->tokenModel, $actualToken); - $this->assertEquals($tokenData, $actualToken->getToken()); - } - - public function testLoadByAdminId() - { - $adminId = 1; - $tokenData = 'testToken'; - $data = ['token' => $tokenData]; - - $this->resourceMock->expects($this->once())->method('selectTokenByAdminId')->willReturn($data); - $actualToken = $this->tokenModel->loadByAdminId($adminId); - $this->assertEquals($this->tokenModel, $actualToken); - $this->assertEquals($tokenData, $actualToken->getToken()); - } - - public function testLoadByCustomerId() - { - $customerId = 1; - $tokenData = 'testToken'; - $data = ['token' => $tokenData]; - - $this->resourceMock->expects($this->once())->method('selectTokenByCustomerId')->willReturn($data); - $actualToken = $this->tokenModel->loadByCustomerId($customerId); - $this->assertEquals($this->tokenModel, $actualToken); - $this->assertEquals($tokenData, $actualToken->getToken()); - } - - public function testLoad() - { - $token = 'testToken'; - - $this->resourceMock->expects($this->once())->method('load'); - $actualToken = $this->tokenModel->loadByToken($token); - $this->assertEquals($this->tokenModel, $actualToken); - } - - public function testValidateIfNotCallbackEstablishedAndNotValid() - { - $exceptionMessage = 'exceptionMessage'; - - $this->tokenModel->setCallbackUrl('notCallbackEstablished'); - $this->validatorMock->expects($this->once())->method('isValid')->willReturn(false); - $this->validatorMock->expects($this->once())->method('getMessages')->willReturn([$exceptionMessage]); - - $this->expectException(Exception::class); - $this->expectExceptionMessage($exceptionMessage); - - $this->tokenModel->validate(); - } - - public function testValidateIfSecretNotValid() - { - $exceptionMessage = 'exceptionMessage'; - - $this->tokenModel->setCallbackUrl('notCallbackEstablished'); - $this->validatorMock->expects($this->once())->method('isValid')->willReturn(true); - - $this->keyLengthFactoryMock->expects($this->once())->method('create')->willReturn( - $this->validatorKeyLengthMock - ); - $this->validatorKeyLengthMock->expects($this->once())->method('isValid')->willReturn(false); - $this->validatorKeyLengthMock->expects($this->once())->method('getMessages')->willReturn([$exceptionMessage]); - - $this->expectException(Exception::class); - $this->expectExceptionMessage($exceptionMessage); - - $this->tokenModel->validate(); - } - - public function testValidateIfTokenNotValid() - { - $exceptionMessage = 'exceptionMessage'; - $token = 'token'; - $secret = 'secret'; - - $this->tokenModel->setCallbackUrl('notCallbackEstablished'); - $this->validatorMock->expects($this->once())->method('isValid')->willReturn(true); - - $this->keyLengthFactoryMock->expects($this->once()) - ->method('create') - ->willReturn($this->validatorKeyLengthMock); - - $this->tokenModel->setSecret($secret); - $this->tokenModel->setToken($token); - $this->validatorKeyLengthMock->expects($this->exactly(2))->method('isValid')->willReturnMap( - [ - [$secret, true], - [$token, false] - ] - ); - $this->validatorKeyLengthMock->expects($this->once())->method('getMessages')->willReturn([$exceptionMessage]); - $this->expectException(Exception::class); - $this->expectExceptionMessage($exceptionMessage); - - $this->tokenModel->validate(); - } - - public function testValidateIfVerifierNotValid() - { - $exceptionMessage = 'exceptionMessage'; - $secret = 'secret'; - $token = 'token'; - $verifier = 'isSetAndNotValid'; - - $this->tokenModel->setCallbackUrl('notCallbackEstablished'); - $this->validatorMock->expects($this->once())->method('isValid')->willReturn(true); - - $this->keyLengthFactoryMock->expects($this->once()) - ->method('create') - ->willReturn($this->validatorKeyLengthMock); - - $this->tokenModel->setSecret($secret); - $this->tokenModel->setToken($token); - $this->tokenModel->setData('verifier', $verifier); - $this->validatorKeyLengthMock->expects($this->exactly(3))->method('isValid')->willReturnMap( - [ - [$secret, true], - [$token, true], - [$verifier, false], - ] - ); - $this->validatorKeyLengthMock->expects($this->once())->method('getMessages')->willReturn([$exceptionMessage]); - $this->expectException(Exception::class); - $this->expectExceptionMessage($exceptionMessage); - - $this->tokenModel->validate(); - } - - public function testValidateIfVerifierIsNotSet() - { - $token = 'token'; - $secret = 'secret'; - $verifier = null; - - $this->tokenModel->setCallbackUrl('notCallbackEstablished'); - $this->validatorMock->expects($this->once())->method('isValid')->willReturn(true); - - $this->keyLengthFactoryMock->expects($this->once())->method('create')->willReturn( - $this->validatorKeyLengthMock - ); - - $this->tokenModel->setSecret($secret); - $this->tokenModel->setToken($token); - $this->tokenModel->setData('verifier', $verifier); - $this->validatorKeyLengthMock->expects($this->exactly(2))->method('isValid')->willReturnMap( - [ - [$secret, true], - [$token, true], - ] - ); - $this->assertTrue($this->tokenModel->validate()); - } - - public function testValidate() - { - $token = 'token'; - $secret = 'secret'; - $verifier = 'verifier'; - - $this->tokenModel->setCallbackUrl('notCallbackEstablished'); - $this->validatorMock->expects($this->once())->method('isValid')->willReturn(true); - - $this->keyLengthFactoryMock->expects($this->once())->method('create')->willReturn( - $this->validatorKeyLengthMock - ); - - $this->tokenModel->setSecret($secret); - $this->tokenModel->setToken($token); - $this->tokenModel->setData('verifier', $verifier); - $this->validatorKeyLengthMock->expects($this->exactly(3))->method('isValid')->willReturnMap( - [ - [$secret, true], - [$token, true], - [$verifier, true], - ] - ); - $this->assertTrue($this->tokenModel->validate()); - } -} diff --git a/app/code/Magento/Integration/Test/Unit/Model/UserToken/ExpirationValidatorTest.php b/app/code/Magento/Integration/Test/Unit/Model/UserToken/ExpirationValidatorTest.php new file mode 100644 index 000000000000..6bc1dad3087b --- /dev/null +++ b/app/code/Magento/Integration/Test/Unit/Model/UserToken/ExpirationValidatorTest.php @@ -0,0 +1,90 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Integration\Test\Unit\Model\UserToken; + +use Magento\Framework\Exception\AuthorizationException; +use Magento\Integration\Api\Data\UserToken; +use Magento\Integration\Api\Data\UserTokenDataInterface; +use Magento\Integration\Model\UserToken\ExpirationValidator; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; +use Magento\Framework\Stdlib\DateTime\DateTime as DtUtil; + +class ExpirationValidatorTest extends TestCase +{ + /** + * @var ExpirationValidator + */ + private $model; + + /** + * @var DtUtil|MockObject + */ + private $datetimeUtilMock; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->datetimeUtilMock = $this->createMock(DtUtil::class); + $this->model = new ExpirationValidator($this->datetimeUtilMock); + } + + public function getUserTokens(): array + { + $currentTs = \DateTimeImmutable::createFromFormat('Y-m-d H:i:s', '2021-04-07 14:00:00') + ->getTimestamp(); + + $pastToken = $this->createMock(UserToken::class); + $pastData = $this->createMock(UserTokenDataInterface::class); + $pastData->method('getExpires') + ->willReturn(\DateTimeImmutable::createFromFormat('Y-m-d H:i:s', '2021-04-07 12:00:00')); + $pastToken->method('getData')->willReturn($pastData); + + $exactToken = $this->createMock(UserToken::class); + $exactData = $this->createMock(UserTokenDataInterface::class); + $exactData->method('getExpires') + ->willReturn(\DateTimeImmutable::createFromFormat('Y-m-d H:i:s', '2021-04-07 14:00:00')); + $exactToken->method('getData')->willReturn($exactData); + + $futureToken = $this->createMock(UserToken::class); + $futureData = $this->createMock(UserTokenDataInterface::class); + $futureData->method('getExpires') + ->willReturn(\DateTimeImmutable::createFromFormat('Y-m-d H:i:s', '2021-04-07 16:00:00')); + $futureToken->method('getData')->willReturn($futureData); + + return [ + 'past' => [$pastToken, false, $currentTs], + 'exact' => [$exactToken, false, $currentTs], + 'future' => [$futureToken, true, $currentTs] + ]; + } + + /** + * Test "validate" method. + * + * @param UserToken $userToken + * @param bool $isValid + * @param int $currentTimestamp + * @throws AuthorizationException + * @dataProvider getUserTokens + */ + public function testValidate(UserToken $userToken, bool $isValid, int $currentTimestamp): void + { + if (!$isValid) { + $this->expectException(AuthorizationException::class); + } + $this->datetimeUtilMock->method('gmtTimestamp')->willReturn($currentTimestamp); + + $this->model->validate($userToken); + } +} diff --git a/app/code/Magento/Integration/etc/db_schema.xml b/app/code/Magento/Integration/etc/db_schema.xml index 91af330e8ef2..ecd967cf189b 100644 --- a/app/code/Magento/Integration/etc/db_schema.xml +++ b/app/code/Magento/Integration/etc/db_schema.xml @@ -84,7 +84,7 @@ <constraint xsi:type="foreign" referenceId="OAUTH_NONCE_CONSUMER_ID_OAUTH_CONSUMER_ENTITY_ID" table="oauth_nonce" column="consumer_id" referenceTable="oauth_consumer" referenceColumn="entity_id" onDelete="CASCADE"/> - <constraint xsi:type="unique" referenceId="OAUTH_NONCE_NONCE_CONSUMER_ID"> + <constraint xsi:type="primary" referenceId="OAUTH_NONCE_NONCE_CONSUMER_ID"> <column name="nonce"/> <column name="consumer_id"/> </constraint> diff --git a/app/code/Magento/Integration/etc/db_schema_whitelist.json b/app/code/Magento/Integration/etc/db_schema_whitelist.json index a7649eeb4ee1..2bf014c94d10 100644 --- a/app/code/Magento/Integration/etc/db_schema_whitelist.json +++ b/app/code/Magento/Integration/etc/db_schema_whitelist.json @@ -54,6 +54,7 @@ "consumer_id": true }, "constraint": { + "PRIMARY": true, "OAUTH_NONCE_CONSUMER_ID_OAUTH_CONSUMER_ENTITY_ID": true, "OAUTH_NONCE_NONCE_CONSUMER_ID": true }, @@ -94,4 +95,4 @@ "OAUTH_TOKEN_REQUEST_LOG_USER_NAME_USER_TYPE": true } } -} \ No newline at end of file +} diff --git a/app/code/Magento/Integration/etc/di.xml b/app/code/Magento/Integration/etc/di.xml index 387770909bda..9fe53af49f07 100644 --- a/app/code/Magento/Integration/etc/di.xml +++ b/app/code/Magento/Integration/etc/di.xml @@ -35,4 +35,16 @@ <type name="Magento\Customer\Model\Customer"> <plugin name="revokeTokensFromInactiveCustomers" type="Magento\Integration\Plugin\Model\CustomerUser" /> </type> + <type name="Magento\Integration\Model\CompositeUserTokenValidator"> + <arguments> + <argument name="validators" xsi:type="array"> + <item name="expiration" xsi:type="object">Magento\Integration\Model\UserToken\ExpirationValidator</item> + </argument> + </arguments> + </type> + <preference for="Magento\Integration\Api\Data\UserTokenParametersInterface" type="Magento\Integration\Model\UserToken\UserTokenParameters" /> + <preference for="Magento\Integration\Api\UserTokenValidatorInterface" type="Magento\Integration\Model\CompositeUserTokenValidator" /> + <preference for="Magento\Integration\Api\UserTokenIssuerInterface" type="Magento\Integration\Model\OpaqueToken\Issuer" /> + <preference for="Magento\Integration\Api\UserTokenReaderInterface" type="Magento\Integration\Model\OpaqueToken\Reader" /> + <preference for="Magento\Integration\Api\UserTokenRevokerInterface" type="Magento\Integration\Model\OpaqueToken\Revoker" /> </config> diff --git a/app/code/Magento/Tinymce3/LICENSE.txt b/app/code/Magento/JwtFrameworkAdapter/LICENSE.txt similarity index 100% rename from app/code/Magento/Tinymce3/LICENSE.txt rename to app/code/Magento/JwtFrameworkAdapter/LICENSE.txt diff --git a/app/code/Magento/Tinymce3/LICENSE_AFL.txt b/app/code/Magento/JwtFrameworkAdapter/LICENSE_AFL.txt similarity index 100% rename from app/code/Magento/Tinymce3/LICENSE_AFL.txt rename to app/code/Magento/JwtFrameworkAdapter/LICENSE_AFL.txt diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/AlgorithmProviderFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/AlgorithmProviderFactory.php new file mode 100644 index 000000000000..365fa25fbd36 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/AlgorithmProviderFactory.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Easy\AlgorithmProvider; + +class AlgorithmProviderFactory +{ + /** + * Create provider instance. + * + * @param string[] $algorithms Algorithm classes. + * @return AlgorithmProvider + */ + public function create(array $algorithms): AlgorithmProvider + { + return new AlgorithmProvider($algorithms); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/Data/Claim.php b/app/code/Magento/JwtFrameworkAdapter/Model/Data/Claim.php new file mode 100644 index 000000000000..cd102609201d --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/Data/Claim.php @@ -0,0 +1,19 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model\Data; + +use Magento\Framework\Jwt\Claim\AbstractClaim; + +class Claim extends AbstractClaim +{ + public function __construct(string $name, $value, ?int $class) + { + parent::__construct($name, $value, $class, false); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/Data/Header.php b/app/code/Magento/JwtFrameworkAdapter/Model/Data/Header.php new file mode 100644 index 000000000000..0916326e1865 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/Data/Header.php @@ -0,0 +1,67 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model\Data; + +use Magento\Framework\Jwt\Jwe\JweHeaderParameterInterface; +use Magento\Framework\Jwt\Jws\JwsHeaderParameterInterface; + +class Header implements JwsHeaderParameterInterface, JweHeaderParameterInterface +{ + /** + * @var string + */ + private $name; + + /** + * @var mixed + */ + private $value; + + /** + * @var int|null + */ + private $class; + + /** + * Header constructor. + * @param string $name + * @param mixed $value + * @param int|null $class + */ + public function __construct(string $name, $value, ?int $class) + { + $this->name = $name; + $this->value = $value; + $this->class = $class; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return $this->name; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return $this->value; + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return $this->class; + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JweAlgorithmManagerFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JweAlgorithmManagerFactory.php new file mode 100644 index 000000000000..a1a53db3e450 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JweAlgorithmManagerFactory.php @@ -0,0 +1,47 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Core\AlgorithmManager; + +class JweAlgorithmManagerFactory +{ + private const ALGOS = [ + \Jose\Component\Encryption\Algorithm\KeyEncryption\RSAOAEP::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\RSAOAEP256::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\A128KW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\A192KW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\A256KW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\Dir::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHES::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHESA128KW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHESA192KW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHESA256KW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\A128GCMKW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\A192GCMKW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\A256GCMKW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\PBES2HS256A128KW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\PBES2HS384A192KW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\PBES2HS512A256KW::class + ]; + + /** + * @var AlgorithmProviderFactory + */ + private $algorithmProviderFactory; + + public function __construct(AlgorithmProviderFactory $algorithmProviderFactory) { + $this->algorithmProviderFactory = $algorithmProviderFactory; + } + + public function create(): AlgorithmManager + { + return new AlgorithmManager($this->algorithmProviderFactory->create(self::ALGOS)->getAvailableAlgorithms()); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JweBuilderFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JweBuilderFactory.php new file mode 100644 index 000000000000..69a9a90dbaa3 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JweBuilderFactory.php @@ -0,0 +1,54 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Core\AlgorithmManager; +use Jose\Component\Encryption\Compression\CompressionMethodManager; +use Jose\Component\Encryption\JWEBuilder; +use Jose\Component\Encryption\Serializer\JWESerializerManager; + +class JweBuilderFactory +{ + /** + * @var JWESerializerManager + */ + private $serializers; + + /** + * @var AlgorithmManager + */ + private $algoManager; + + /** + * @var AlgorithmManager + */ + private $contentAlgoManager; + + /** + * @var CompressionMethodManager + */ + private $compressionManager; + + public function __construct( + JweSerializerPoolFactory $serializerPoolFactory, + JweAlgorithmManagerFactory $algorithmManagerFactory, + JweContentAlgorithmManagerFactory $contentAlgoManagerFactory, + JweCompressionManagerFactory $compressionManagerFactory + ) { + $this->serializers = $serializerPoolFactory->create(); + $this->algoManager = $algorithmManagerFactory->create(); + $this->contentAlgoManager = $contentAlgoManagerFactory->create(); + $this->compressionManager = $compressionManagerFactory->create(); + } + + public function create(): JWEBuilder + { + return new JWEBuilder($this->algoManager, $this->contentAlgoManager, $this->compressionManager); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JweCompressionManagerFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JweCompressionManagerFactory.php new file mode 100644 index 000000000000..16367cff6a53 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JweCompressionManagerFactory.php @@ -0,0 +1,20 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Encryption\Compression\CompressionMethodManager; +use Jose\Component\Encryption\Compression\Deflate; + +class JweCompressionManagerFactory +{ + public function create(): CompressionMethodManager + { + return new CompressionMethodManager([new Deflate()]); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JweContentAlgorithmManagerFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JweContentAlgorithmManagerFactory.php new file mode 100644 index 000000000000..ded1e63fabf2 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JweContentAlgorithmManagerFactory.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Core\AlgorithmManager; + +class JweContentAlgorithmManagerFactory +{ + private const ALGOS = [ + \Jose\Component\Encryption\Algorithm\ContentEncryption\A128CBCHS256::class, + \Jose\Component\Encryption\Algorithm\ContentEncryption\A192CBCHS384::class, + \Jose\Component\Encryption\Algorithm\ContentEncryption\A256CBCHS512::class, + \Jose\Component\Encryption\Algorithm\ContentEncryption\A128GCM::class, + \Jose\Component\Encryption\Algorithm\ContentEncryption\A192GCM::class, + \Jose\Component\Encryption\Algorithm\ContentEncryption\A256GCM::class, + ]; + + /** + * @var AlgorithmProviderFactory + */ + private $algorithmProviderFactory; + + public function __construct(AlgorithmProviderFactory $algorithmProviderFactory) { + $this->algorithmProviderFactory = $algorithmProviderFactory; + } + + public function create(): AlgorithmManager + { + return new AlgorithmManager($this->algorithmProviderFactory->create(self::ALGOS)->getAvailableAlgorithms()); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JweFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JweFactory.php new file mode 100644 index 000000000000..07a99c202b3e --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JweFactory.php @@ -0,0 +1,76 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Magento\Framework\Jwt\Jwe\Jwe; +use Magento\Framework\Jwt\Jwe\JweHeader; +use Magento\Framework\Jwt\Jwe\JweInterface; +use Magento\Framework\Jwt\Jws\Jws; +use Magento\Framework\Jwt\Jws\JwsHeader; +use Magento\Framework\Jwt\Jws\JwsInterface; +use Magento\Framework\Jwt\Payload\ArbitraryPayload; +use Magento\Framework\Jwt\Payload\ClaimsPayload; +use Magento\Framework\Jwt\Payload\NestedPayload; +use Magento\Framework\Jwt\Payload\NestedPayloadInterface; +use Magento\JwtFrameworkAdapter\Model\Data\Claim; +use Magento\JwtFrameworkAdapter\Model\Data\Header; + +/** + * Create JWE data object. + */ +class JweFactory +{ + public function create( + array $protectedHeadersMap, + string $payload, + ?array $unprotectedHeadersMap, + ?array $recipientHeadersMap + ): JweInterface { + $protectedHeaders = []; + foreach ($protectedHeadersMap as $header => $headerValue) { + $protectedHeaders[] = new Header($header, $headerValue, null); + } + $publicHeaders = null; + if ($unprotectedHeadersMap) { + $publicHeaders = []; + foreach ($unprotectedHeadersMap as $header => $headerValue) { + $publicHeaders[] = new Header($header, $headerValue, null); + } + } + $recipientHeader = null; + if ($recipientHeadersMap) { + $recipientHeader = []; + foreach ($recipientHeadersMap as $header => $headerValue) { + $recipientHeader[] = new Header($header, $headerValue, null); + } + } + $headersMap = array_merge($unprotectedHeadersMap ?? [], $recipientHeader ?? [], $protectedHeadersMap); + if (array_key_exists('cty', $headersMap)) { + if ($headersMap['cty'] === NestedPayloadInterface::CONTENT_TYPE) { + $payload = new NestedPayload($payload); + } else { + $payload = new ArbitraryPayload($payload); + } + } else { + $claimData = json_decode($payload, true); + $claims = []; + foreach ($claimData as $name => $value) { + $claims[] = new Claim($name, $value, null); + } + $payload = new ClaimsPayload($claims); + } + + return new Jwe( + new JweHeader($protectedHeaders), + $publicHeaders ? new JweHeader($publicHeaders) : null, + $recipientHeader ? [new JweHeader($recipientHeader)] : null, + $payload + ); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JweLoaderFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JweLoaderFactory.php new file mode 100644 index 000000000000..25941e33b15c --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JweLoaderFactory.php @@ -0,0 +1,63 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Core\AlgorithmManager; +use Jose\Component\Encryption\Compression\CompressionMethodManager; +use Jose\Component\Encryption\JWEDecrypter; +use Jose\Component\Encryption\JWELoader; +use Jose\Component\Encryption\Serializer\JWESerializerManager; + +class JweLoaderFactory +{ + /** + * @var JWESerializerManager + */ + private $serializers; + + /** + * @var AlgorithmManager + */ + private $algoManager; + + /** + * @var AlgorithmManager + */ + private $contentAlgoManager; + + /** + * @var CompressionMethodManager + */ + private $compressionManager; + + public function __construct( + JweSerializerPoolFactory $serializerPoolFactory, + JweAlgorithmManagerFactory $algorithmManagerFactory, + JweContentAlgorithmManagerFactory $contentAlgoManagerFactory, + JweCompressionManagerFactory $compressionManagerFactory + ) { + $this->serializers = $serializerPoolFactory->create(); + $this->algoManager = $algorithmManagerFactory->create(); + $this->contentAlgoManager = $contentAlgoManagerFactory->create(); + $this->compressionManager = $compressionManagerFactory->create(); + } + + public function create(): JWELoader + { + return new JWELoader( + $this->serializers, + new JWEDecrypter( + $this->algoManager, + $this->contentAlgoManager, + $this->compressionManager + ), + null + ); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JweManager.php b/app/code/Magento/JwtFrameworkAdapter/Model/JweManager.php new file mode 100644 index 000000000000..8e25ab817d2f --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JweManager.php @@ -0,0 +1,249 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Encryption\JWEBuilder; +use Jose\Component\Encryption\JWELoader; +use Jose\Component\Encryption\Serializer\JWESerializerManager; +use Magento\Framework\Jwt\EncryptionSettingsInterface; +use Magento\Framework\Jwt\Exception\EncryptionException; +use Magento\Framework\Jwt\Exception\JwtException; +use Magento\Framework\Jwt\Exception\MalformedTokenException; +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\Jwe\JweEncryptionJwks; +use Magento\Framework\Jwt\Jwe\JweHeader; +use Magento\Framework\Jwt\Jwe\JweInterface; +use Jose\Component\Core\JWK as AdapterJwk; +use Jose\Component\Core\JWKSet as AdapterJwkSet; +use Magento\Framework\Jwt\Jwk; +use Magento\Framework\Jwt\Jws\JwsHeader; +use Magento\Framework\Jwt\Payload\ClaimsPayloadInterface; +use Magento\JwtFrameworkAdapter\Model\Data\Header; + +/** + * Works with JWE + */ +class JweManager +{ + /** + * @var JWEBuilder + */ + private $builder; + + /** + * @var JWESerializerManager + */ + private $serializer; + + /** + * @var JWELoader + */ + private $loader; + + /** + * @var JweFactory + */ + private $jweFactory; + + public function __construct( + JweBuilderFactory $jweBuilderFactory, + JweSerializerPoolFactory $serializerPoolFactory, + JweLoaderFactory $jweLoaderFactory, + JweFactory $jweFactory + ) { + $this->builder = $jweBuilderFactory->create(); + $this->serializer = $serializerPoolFactory->create(); + $this->loader = $jweLoaderFactory->create(); + $this->jweFactory = $jweFactory; + } + + /** + * Generate JWE token. + * + * @param JweInterface $jwe + * @param EncryptionSettingsInterface|JweEncryptionJwks $encryptionSettings + * @return string + */ + public function build(JweInterface $jwe, EncryptionSettingsInterface $encryptionSettings): string + { + $this->validateJweSettings($jwe, $encryptionSettings); + + $builder = $this->builder->create(); + + $payload = $jwe->getPayload(); + $builder = $builder->withPayload($payload->getContent()); + + $sharedProtected = $this->extractHeaderData($jwe->getProtectedHeader()); + $sharedProtected['enc'] = $encryptionSettings->getContentEncryptionAlgorithm(); + if ($payload->getContentType()) { + $sharedProtected['cty'] = $payload->getContentType(); + } + if (!$jwe->getPerRecipientUnprotectedHeaders()) { + $sharedProtected['alg'] = $encryptionSettings->getAlgorithmName(); + } + if ($payload instanceof ClaimsPayloadInterface) { + foreach ($payload->getClaims() as $claim) { + if ($claim->isHeaderDuplicated()) { + $sharedProtected[$claim->getName()] = $claim->getValue(); + } + } + } + $builder = $builder->withSharedProtectedHeader($sharedProtected); + + $sharedUnprotected = []; + if ($jwe->getSharedUnprotectedHeader()) { + $sharedUnprotected = array_merge( + $this->extractHeaderData($jwe->getSharedUnprotectedHeader()), + $sharedUnprotected + ); + } + if ($sharedUnprotected) { + $builder = $builder->withSharedHeader($sharedUnprotected); + } + + if (!$jwe->getPerRecipientUnprotectedHeaders()) { + $builder = $builder->addRecipient( + new AdapterJwk($encryptionSettings->getJwkSet()->getKeys()[0]->getJsonData()) + ); + } else { + foreach ($jwe->getPerRecipientUnprotectedHeaders() as $i => $header) { + $jwk = $encryptionSettings->getJwkSet()->getKeys()[$i]; + $headerData = []; + if ($jwk->getKeyId()) { + $headerData['kid'] = $jwk->getKeyId(); + } + $headerData = array_merge($headerData, $this->extractHeaderData($header)); + $headerData['alg'] = $jwk->getAlgorithm(); + $builder = $builder->addRecipient(new AdapterJwk($jwk->getJsonData()), $headerData); + } + } + + $built = $builder->build(); + if ($jwe->getPerRecipientUnprotectedHeaders() + && count($jwe->getPerRecipientUnprotectedHeaders()) === 1 + || (!$jwe->getPerRecipientUnprotectedHeaders() && $jwe->getSharedUnprotectedHeader()) + ) { + return $this->serializer->serialize('jwe_json_flattened', $built); + } + if ($jwe->getPerRecipientUnprotectedHeaders()) { + return $this->serializer->serialize('jwe_json_general', $built); + } + return $this->serializer->serialize('jwe_compact', $built); + } + + /** + * Read JWE token. + * + * @param string $token + * @param EncryptionSettingsInterface|JweEncryptionJwks $encryptionSettings + * @return JweInterface + */ + public function read(string $token, EncryptionSettingsInterface $encryptionSettings): JweInterface + { + if (!$encryptionSettings instanceof JweEncryptionJwks) { + throw new JwtException('Can only work with JWK encryption settings for JWE tokens'); + } + + $jwkSet = new AdapterJwkSet( + array_map( + function (Jwk $jwk) { + return new AdapterJwk($jwk->getJsonData()); + }, + $encryptionSettings->getJwkSet()->getKeys() + ) + ); + try { + /** @var int|null $recipientId */ + $jwe = $this->loader->loadAndDecryptWithKeySet($token, $jwkSet, $recipientId); + } catch (\Throwable $exception) { + throw new EncryptionException('Failed to decrypt JWE token.', 0, $exception); + } + if ($recipientId) { + throw new EncryptionException('Failed to decrypt JWE token.'); + } + $recipientHeader = $jwe->getRecipient($recipientId)->getHeader(); + + return $this->jweFactory->create( + $jwe->getSharedProtectedHeader(), + $jwe->getPayload() ?? '', + $jwe->getSharedHeader() ? $jwe->getSharedHeader() : null, + $recipientHeader ? $recipientHeader : null + ); + } + + /** + * Read JWS headers. + * + * @param string $token + * @return HeaderInterface[] + */ + public function readHeaders(string $token): array + { + try { + $jwe = $this->serializer->unserialize($token); + } catch (\Throwable $exception) { + throw new JwtException('Failed to read JWE headers'); + } + $headers = []; + $headersValues = []; + if ($jwe->getSharedHeader()) { + $headersValues[] = $jwe->getSharedHeader(); + } + if ($jwe->getSharedProtectedHeader()) { + $headersValues[] = $jwe->getSharedProtectedHeader(); + } + foreach ($jwe->getRecipients() as $recipient) { + if ($recipient->getHeader()) { + $headersValues[] = $recipient->getHeader(); + } + } + foreach ($headersValues as $headerValues) { + $params = []; + foreach ($headerValues as $header => $value) { + $params[] = new Header($header, $value, null); + } + if ($params) { + $headers[] = new JweHeader($params); + } + } + + return $headers; + } + + private function validateJweSettings(JweInterface $jwe, EncryptionSettingsInterface $encryptionSettings): void + { + if (!$encryptionSettings instanceof JweEncryptionJwks) { + throw new JwtException('Can only work with JWK encryption settings for JWE tokens'); + } + if ($jwe->getPerRecipientUnprotectedHeaders() + && count($encryptionSettings->getJwkSet()->getKeys()) !== count($jwe->getPerRecipientUnprotectedHeaders()) + ) { + throw new EncryptionException('Not enough JWKs to encrypt all headers'); + } + if (count($encryptionSettings->getJwkSet()->getKeys()) > 1 && !$jwe->getPerRecipientUnprotectedHeaders()) { + throw new MalformedTokenException('Need more per-recipient headers for the amount of keys'); + } + } + + /** + * Extract JOSE header data. + * + * @param HeaderInterface $header + * @return array + */ + private function extractHeaderData(HeaderInterface $header): array + { + $data = []; + foreach ($header->getParameters() as $parameter) { + $data[$parameter->getName()] = $parameter->getValue(); + } + + return $data; + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JweSerializerPoolFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JweSerializerPoolFactory.php new file mode 100644 index 000000000000..25418af169ed --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JweSerializerPoolFactory.php @@ -0,0 +1,28 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Encryption\Serializer\CompactSerializer; +use Jose\Component\Encryption\Serializer\JSONFlattenedSerializer; +use Jose\Component\Encryption\Serializer\JSONGeneralSerializer; +use Jose\Component\Encryption\Serializer\JWESerializerManager; + +class JweSerializerPoolFactory +{ + public function create(): JWESerializerManager + { + return new JWESerializerManager( + [ + new CompactSerializer(), + new JSONGeneralSerializer(), + new JSONFlattenedSerializer() + ] + ); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JwsAlgorithmManagerFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JwsAlgorithmManagerFactory.php new file mode 100644 index 000000000000..e9478727b559 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JwsAlgorithmManagerFactory.php @@ -0,0 +1,47 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Core\AlgorithmManager; +use Jose\Easy\AlgorithmProvider; + +class JwsAlgorithmManagerFactory +{ + private const ALGOS = [ + + \Jose\Component\Signature\Algorithm\HS256::class, + \Jose\Component\Signature\Algorithm\HS384::class, + \Jose\Component\Signature\Algorithm\HS512::class, + \Jose\Component\Signature\Algorithm\RS256::class, + \Jose\Component\Signature\Algorithm\RS384::class, + \Jose\Component\Signature\Algorithm\RS512::class, + \Jose\Component\Signature\Algorithm\PS256::class, + \Jose\Component\Signature\Algorithm\PS384::class, + \Jose\Component\Signature\Algorithm\PS512::class, + \Jose\Component\Signature\Algorithm\ES256::class, + \Jose\Component\Signature\Algorithm\ES384::class, + \Jose\Component\Signature\Algorithm\ES512::class, + \Jose\Component\Signature\Algorithm\EdDSA::class, + \Jose\Component\Signature\Algorithm\None::class + ]; + + /** + * @var AlgorithmProviderFactory + */ + private $algorithmProviderFactory; + + public function __construct(AlgorithmProviderFactory $algorithmProviderFactory) { + $this->algorithmProviderFactory = $algorithmProviderFactory; + } + + public function create(): AlgorithmManager + { + return new AlgorithmManager($this->algorithmProviderFactory->create(self::ALGOS)->getAvailableAlgorithms()); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JwsBuilderFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JwsBuilderFactory.php new file mode 100644 index 000000000000..f851b0cf0a43 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JwsBuilderFactory.php @@ -0,0 +1,29 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Core\AlgorithmManager; +use Jose\Component\Signature\JWSBuilder; + +class JwsBuilderFactory +{ + /** + * @var AlgorithmManager + */ + private $algoManager; + + public function __construct(JwsAlgorithmManagerFactory $algorithmManagerFactory) { + $this->algoManager = $algorithmManagerFactory->create(); + } + + public function create(): JWSBuilder + { + return new JWSBuilder($this->algoManager); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JwsFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JwsFactory.php new file mode 100644 index 000000000000..7a5aa282eed5 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JwsFactory.php @@ -0,0 +1,64 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Magento\Framework\Jwt\Jws\Jws; +use Magento\Framework\Jwt\Jws\JwsHeader; +use Magento\Framework\Jwt\Jws\JwsInterface; +use Magento\Framework\Jwt\Payload\ArbitraryPayload; +use Magento\Framework\Jwt\Payload\ClaimsPayload; +use Magento\Framework\Jwt\Payload\NestedPayload; +use Magento\Framework\Jwt\Payload\NestedPayloadInterface; +use Magento\JwtFrameworkAdapter\Model\Data\Claim; +use Magento\JwtFrameworkAdapter\Model\Data\Header; + +/** + * Create JWS data object. + */ +class JwsFactory +{ + public function create( + array $protectedHeadersMap, + string $payload, + ?array $unprotectedHeadersMap + ): JwsInterface { + $protectedHeaders = []; + foreach ($protectedHeadersMap as $header => $headerValue) { + $protectedHeaders[] = new Header($header, $headerValue, null); + } + $publicHeaders = null; + if ($unprotectedHeadersMap) { + $publicHeaders = []; + foreach ($unprotectedHeadersMap as $header => $headerValue) { + $publicHeaders[] = new Header($header, $headerValue, null); + } + } + $headersMap = array_merge($unprotectedHeadersMap ?? [], $protectedHeadersMap); + if (array_key_exists('cty', $headersMap)) { + if ($headersMap['cty'] === NestedPayloadInterface::CONTENT_TYPE) { + $payload = new NestedPayload($payload); + } else { + $payload = new ArbitraryPayload($payload); + } + } else { + $claimData = json_decode($payload, true); + $claims = []; + foreach ($claimData as $name => $value) { + $claims[] = new Claim($name, $value, null); + } + $payload = new ClaimsPayload($claims); + } + + return new Jws( + [new JwsHeader($protectedHeaders)], + $payload, + $publicHeaders ? [new JwsHeader($publicHeaders)] : null + ); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JwsLoaderFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JwsLoaderFactory.php new file mode 100644 index 000000000000..ff67f0ac8c1a --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JwsLoaderFactory.php @@ -0,0 +1,44 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Core\AlgorithmManager; +use Jose\Component\Signature\JWSLoader; +use Jose\Component\Signature\JWSVerifier; +use Jose\Component\Signature\Serializer\JWSSerializerManager; + +class JwsLoaderFactory +{ + /** + * @var JWSSerializerManager + */ + private $serializer; + + /** + * @var AlgorithmManager + */ + private $algoManager; + + public function __construct( + JwsSerializerPoolFactory $serializerPoolFactory, + JwsAlgorithmManagerFactory $algorithmManagerFactory + ) { + $this->serializer = $serializerPoolFactory->create(); + $this->algoManager = $algorithmManagerFactory->create(); + } + + public function create(): JWSLoader + { + return new JWSLoader( + $this->serializer, + new JWSVerifier($this->algoManager), + null + ); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JwsManager.php b/app/code/Magento/JwtFrameworkAdapter/Model/JwsManager.php new file mode 100644 index 000000000000..77d488a738c1 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JwsManager.php @@ -0,0 +1,226 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Signature\JWSBuilder; +use Jose\Component\Signature\JWSLoader; +use Jose\Component\Signature\Serializer\JWSSerializerManager; +use Magento\Framework\Jwt\EncryptionSettingsInterface; +use Magento\Framework\Jwt\Exception\EncryptionException; +use Magento\Framework\Jwt\Exception\JwtException; +use Magento\Framework\Jwt\Exception\MalformedTokenException; +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\Jwk; +use Magento\Framework\Jwt\Jws\JwsHeader; +use Magento\Framework\Jwt\Jws\JwsInterface; +use Magento\Framework\Jwt\Jws\JwsSignatureJwks; +use Jose\Component\Core\JWK as AdapterJwk; +use Jose\Component\Core\JWKSet as AdapterJwkSet; +use Magento\JwtFrameworkAdapter\Model\Data\Header; + +/** + * Works with JWS. + */ +class JwsManager +{ + /** + * @var JWSBuilder + */ + private $jwsBuilder; + + /** + * @var JWSLoader + */ + private $jwsLoader; + + /** + * @var JWSSerializerManager + */ + private $jwsSerializer; + + /** + * @var JwsFactory + */ + private $jwsFactory; + + /** + * @param JwsBuilderFactory $builderFactory + * @param JwsSerializerPoolFactory $serializerPoolFactory + * @param JwsLoaderFactory $jwsLoaderFactory + * @param JwsFactory $jwsFactory + */ + public function __construct( + JwsBuilderFactory $builderFactory, + JwsSerializerPoolFactory $serializerPoolFactory, + JwsLoaderFactory $jwsLoaderFactory, + JwsFactory $jwsFactory + ) { + $this->jwsBuilder = $builderFactory->create(); + $this->jwsSerializer = $serializerPoolFactory->create(); + $this->jwsLoader = $jwsLoaderFactory->create(); + $this->jwsFactory = $jwsFactory; + } + + /** + * Generate JWS token. + * + * @param JwsInterface $jws + * @param EncryptionSettingsInterface|JwsSignatureJwks $encryptionSettings + * @return string + * @throws JwtException + */ + public function build(JwsInterface $jws, EncryptionSettingsInterface $encryptionSettings): string + { + if (!$encryptionSettings instanceof JwsSignatureJwks) { + throw new JwtException('Can only work with JWK encryption settings for JWS tokens'); + } + $signaturesCount = count($encryptionSettings->getJwkSet()->getKeys()); + if ($jws->getProtectedHeaders() && count($jws->getProtectedHeaders()) !== $signaturesCount) { + throw new MalformedTokenException('Number of headers must equal to number of JWKs'); + } + if ($jws->getUnprotectedHeaders() + && count($jws->getUnprotectedHeaders()) !== $signaturesCount + ) { + throw new MalformedTokenException('There must be an equal number of protected and unprotected headers.'); + } + $builder = $this->jwsBuilder->create(); + $builder = $builder->withPayload($jws->getPayload()->getContent()); + for ($i = 0; $i < $signaturesCount; $i++) { + $jwk = $encryptionSettings->getJwkSet()->getKeys()[$i]; + $alg = $jwk->getAlgorithm(); + if (!$alg) { + throw new EncryptionException('Algorithm is required for JWKs'); + } + $protected = []; + if ($jws->getPayload()->getContentType()) { + $protected['cty'] = $jws->getPayload()->getContentType(); + } + if ($jwk->getKeyId()) { + $protected['kid'] = $jwk->getKeyId(); + } + if ($jws->getProtectedHeaders()) { + $protected = array_merge($protected, $this->extractHeaderData($jws->getProtectedHeaders()[$i])); + } + $protected['alg'] = $alg; + $unprotected = []; + if ($jws->getUnprotectedHeaders()) { + $unprotected = $this->extractHeaderData($jws->getUnprotectedHeaders()[$i]); + } + $builder = $builder->addSignature(new AdapterJwk($jwk->getJsonData()), $protected, $unprotected); + } + $jwsCreated = $builder->build(); + + if ($signaturesCount > 1) { + return $this->jwsSerializer->serialize('jws_json_general', $jwsCreated); + } + if ($jws->getUnprotectedHeaders()) { + return $this->jwsSerializer->serialize('jws_json_flattened', $jwsCreated); + } + return $this->jwsSerializer->serialize('jws_compact', $jwsCreated); + } + + /** + * Read and verify JWS token. + * + * @param string $token + * @param EncryptionSettingsInterface|JwsSignatureJwks $encryptionSettings + * @return JwsInterface + * @throws JwtException + */ + public function read(string $token, EncryptionSettingsInterface $encryptionSettings): JwsInterface + { + if (!$encryptionSettings instanceof JwsSignatureJwks) { + throw new JwtException('Can only work with JWK settings for JWS tokens'); + } + + $jwkSet = new AdapterJwkSet( + array_map( + function (Jwk $jwk) { + return new AdapterJwk($jwk->getJsonData()); + }, + $encryptionSettings->getJwkSet()->getKeys() + ) + ); + try { + $jws = $this->jwsLoader->loadAndVerifyWithKeySet( + $token, + $jwkSet, + $signature, + null + ); + } catch (\Throwable $exception) { + throw new MalformedTokenException('Failed to read JWS token', 0, $exception); + } + if ($signature === null) { + throw new EncryptionException('Failed to verify a JWS token'); + } + $headers = $jws->getSignature($signature); + if ($jws->isPayloadDetached()) { + throw new JwtException('Detached payload is not supported'); + } + + return $this->jwsFactory->create( + $headers->getProtectedHeader(), + $jws->getPayload(), + $headers->getHeader() ? $headers->getHeader() : null + ); + } + + /** + * Read JWS headers. + * + * @param string $token + * @return HeaderInterface[] + */ + public function readHeaders(string $token): array + { + try { + $jws = $this->jwsSerializer->unserialize($token); + } catch (\Throwable $exception) { + throw new JwtException('Failed to read JWS headers'); + } + $headers = []; + $headersValues = []; + foreach ($jws->getSignatures() as $signature) { + if ($signature->getProtectedHeader()) { + $headersValues[] = $signature->getProtectedHeader(); + } + if ($signature->getHeader()) { + $headersValues[] = $signature->getHeader(); + } + } + foreach ($headersValues as $headerValues) { + $params = []; + foreach ($headerValues as $header => $value) { + $params[] = new Header($header, $value, null); + } + if ($params) { + $headers[] = new JwsHeader($params); + } + } + + return $headers; + } + + /** + * Extract JOSE header data. + * + * @param HeaderInterface $header + * @return array + */ + private function extractHeaderData(HeaderInterface $header): array + { + $data = []; + foreach ($header->getParameters() as $parameter) { + $data[$parameter->getName()] = $parameter->getValue(); + } + + return $data; + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JwsSerializerPoolFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JwsSerializerPoolFactory.php new file mode 100644 index 000000000000..70306829b90a --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JwsSerializerPoolFactory.php @@ -0,0 +1,28 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Signature\Serializer\CompactSerializer; +use Jose\Component\Signature\Serializer\JSONFlattenedSerializer; +use Jose\Component\Signature\Serializer\JSONGeneralSerializer; +use Jose\Component\Signature\Serializer\JWSSerializerManager; + +class JwsSerializerPoolFactory +{ + public function create(): JWSSerializerManager + { + return new JWSSerializerManager( + [ + new CompactSerializer(), + new JSONGeneralSerializer(), + new JSONFlattenedSerializer() + ] + ); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JwtManager.php b/app/code/Magento/JwtFrameworkAdapter/Model/JwtManager.php new file mode 100644 index 000000000000..56208f349a70 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JwtManager.php @@ -0,0 +1,199 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Magento\Framework\Jwt\EncryptionSettingsInterface; +use Magento\Framework\Jwt\Exception\EncryptionException; +use Magento\Framework\Jwt\Exception\JwtException; +use Magento\Framework\Jwt\Exception\MalformedTokenException; +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\Jwe\JweEncryptionSettingsInterface; +use Magento\Framework\Jwt\Jwe\JweInterface; +use Magento\Framework\Jwt\Jwk; +use Magento\Framework\Jwt\Jws\JwsInterface; +use Magento\Framework\Jwt\Jws\JwsSignatureSettingsInterface; +use Magento\Framework\Jwt\JwtInterface; +use Magento\Framework\Jwt\JwtManagerInterface; +use Magento\Framework\Jwt\Unsecured\NoEncryption; +use Magento\Framework\Jwt\Unsecured\UnsecuredJwtInterface; + +/** + * Adapter for jwt-framework. + */ +class JwtManager implements JwtManagerInterface +{ + private const JWT_TYPE_JWS = 1; + + private const JWT_TYPE_JWE = 2; + + private const JWT_TYPE_UNSECURED = 3; + + private const JWS_ALGORITHMS = [ + Jwk::ALGORITHM_HS256, + Jwk::ALGORITHM_HS384, + Jwk::ALGORITHM_HS512, + Jwk::ALGORITHM_RS256, + Jwk::ALGORITHM_RS384, + Jwk::ALGORITHM_RS512, + Jwk::ALGORITHM_ES256, + Jwk::ALGORITHM_ES384, + Jwk::ALGORITHM_ES512, + Jwk::ALGORITHM_PS256, + Jwk::ALGORITHM_PS384, + Jwk::ALGORITHM_PS512 + ]; + + private const JWE_ALGORITHMS = [ + Jwk::ALGORITHM_RSA_OAEP, + Jwk::ALGORITHM_RSA_OAEP_256, + Jwk::ALGORITHM_A128KW, + Jwk::ALGORITHM_A192KW, + Jwk::ALGORITHM_A256KW, + Jwk::ALGORITHM_DIR, + Jwk::ALGORITHM_ECDH_ES, + Jwk::ALGORITHM_ECDH_ES_A128KW, + Jwk::ALGORITHM_ECDH_ES_A192KW, + Jwk::ALGORITHM_ECDH_ES_A256KW, + Jwk::ALGORITHM_A128GCMKW, + Jwk::ALGORITHM_A192GCMKW, + Jwk::ALGORITHM_A256GCMKW, + Jwk::ALGORITHM_PBES2_HS256_A128KW, + Jwk::ALGORITHM_PBES2_HS384_A192KW, + Jwk::ALGORITHM_PBES2_HS512_A256KW, + ]; + + /** + * @var JwsManager + */ + private $jwsManager; + + /** + * @var JweManager + */ + private $jweManager; + + /** + * @var UnsecuredJwtManager + */ + private $unsecuredManager; + + /** + * @param JwsManager $jwsManager + * @param JweManager $jweManager + */ + public function __construct(JwsManager $jwsManager, JweManager $jweManager, UnsecuredJwtManager $unsecuredManager) + { + $this->jwsManager = $jwsManager; + $this->jweManager = $jweManager; + $this->unsecuredManager = $unsecuredManager; + } + + /** + * @inheritDoc + */ + public function create(JwtInterface $jwt, EncryptionSettingsInterface $encryption): string + { + if (!$jwt instanceof UnsecuredJwtInterface && !$jwt instanceof JwsInterface && !$jwt instanceof JweInterface) { + throw new MalformedTokenException('Can only build JWS, JWE or Unsecured tokens.'); + } + try { + if ($jwt instanceof JwsInterface) { + return $this->jwsManager->build($jwt, $encryption); + } + if ($jwt instanceof JweInterface) { + return $this->jweManager->build($jwt, $encryption); + } + if ($jwt instanceof UnsecuredJwtInterface) { + if (!$encryption instanceof NoEncryption) { + throw new EncryptionException('Unsecured JWTs can only work with no encryption settings'); + } + + return $this->unsecuredManager->build($jwt); + } + } catch (\Throwable $exception) { + if (!$exception instanceof JwtException) { + $exception = new JwtException('Failed to generate a JWT', 0, $exception); + } + throw $exception; + } + } + + /** + * @inheritDoc + */ + public function read(string $token, array $acceptableEncryption): JwtInterface + { + /** @var JwtInterface|null $read */ + $read = null; + /** @var \Throwable|null $lastException */ + $lastException = null; + foreach ($acceptableEncryption as $encryptionSettings) { + try { + switch ($this->detectJwtType($encryptionSettings)) { + case self::JWT_TYPE_JWS: + $read = $this->jwsManager->read($token, $encryptionSettings); + break; + case self::JWT_TYPE_JWE: + $read = $this->jweManager->read($token, $encryptionSettings); + break; + case self::JWT_TYPE_UNSECURED: + $read = $this->unsecuredManager->read($token); + break; + } + } catch (\Throwable $exception) { + if (!$exception instanceof JwtException) { + $exception = new JwtException('Failed to read JWT', 0, $exception); + } + $lastException = $exception; + } + } + + if (!$read) { + throw $lastException; + } + return $read; + } + + /** + * @inheritDoc + */ + public function readHeaders(string $token): array + { + try { + return $this->jwsManager->readHeaders($token); + } catch (JwtException $exception) { + return $this->jweManager->readHeaders($token); + } + } + + private function detectJwtType(EncryptionSettingsInterface $encryptionSettings): int + { + if ($encryptionSettings instanceof JwsSignatureSettingsInterface) { + return self::JWT_TYPE_JWS; + } + if ($encryptionSettings instanceof JweEncryptionSettingsInterface) { + return self::JWT_TYPE_JWE; + } + if ($encryptionSettings instanceof NoEncryption) { + return self::JWT_TYPE_UNSECURED; + } + + if ($encryptionSettings->getAlgorithmName() === Jwk::ALGORITHM_NONE) { + return self::JWT_TYPE_UNSECURED; + } + if (in_array($encryptionSettings->getAlgorithmName(), self::JWS_ALGORITHMS, true)) { + return self::JWT_TYPE_JWS; + } + if (in_array($encryptionSettings->getAlgorithmName(), self::JWE_ALGORITHMS, true)) { + return self::JWT_TYPE_JWE; + } + + throw new \RuntimeException('Failed to determine JWT type'); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/UnsecuredJwtFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/UnsecuredJwtFactory.php new file mode 100644 index 000000000000..2d9fa891b910 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/UnsecuredJwtFactory.php @@ -0,0 +1,79 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Magento\Framework\Jwt\Jws\Jws; +use Magento\Framework\Jwt\Jws\JwsHeader; +use Magento\Framework\Jwt\Payload\ArbitraryPayload; +use Magento\Framework\Jwt\Payload\ClaimsPayload; +use Magento\Framework\Jwt\Payload\NestedPayload; +use Magento\Framework\Jwt\Payload\NestedPayloadInterface; +use Magento\Framework\Jwt\Unsecured\UnsecuredJwt; +use Magento\Framework\Jwt\Unsecured\UnsecuredJwtInterface; +use Magento\JwtFrameworkAdapter\Model\Data\Claim; +use Magento\JwtFrameworkAdapter\Model\Data\Header; + +/** + * Creates unsecure JWT DTOs. + */ +class UnsecuredJwtFactory +{ + public function create( + array $protectedHeaderMaps, + ?array $unprotectedHeaderMaps, + string $payload + ): UnsecuredJwtInterface { + $cty = null; + $protectedHeaders = []; + foreach ($protectedHeaderMaps as $protectedHeaderMap) { + $parameters = []; + foreach ($protectedHeaderMap as $header => $headerValue) { + $parameters[] = new Header($header, $headerValue, null); + if ($header === 'cty') { + $cty = $headerValue; + } + } + $protectedHeaders[] = new JwsHeader($parameters); + } + $publicHeaders = null; + if ($unprotectedHeaderMaps) { + $publicHeaders = []; + foreach ($unprotectedHeaderMaps as $unprotectedHeaderMap) { + $parameters = []; + foreach ($unprotectedHeaderMap as $header => $headerValue) { + $parameters[] = new Header($header, $headerValue, null); + if ($header === 'cty') { + $cty = $headerValue; + } + } + $publicHeaders[] = new JwsHeader($parameters); + } + } + if ($cty) { + if ($cty === NestedPayloadInterface::CONTENT_TYPE) { + $payload = new NestedPayload($payload); + } else { + $payload = new ArbitraryPayload($payload); + } + } else { + $claimData = json_decode($payload, true); + $claims = []; + foreach ($claimData as $name => $value) { + $claims[] = new Claim($name, $value, null); + } + $payload = new ClaimsPayload($claims); + } + + return new UnsecuredJwt( + $protectedHeaders, + $payload, + $publicHeaders + ); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/UnsecuredJwtManager.php b/app/code/Magento/JwtFrameworkAdapter/Model/UnsecuredJwtManager.php new file mode 100644 index 000000000000..d3a35d5a0ad3 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/UnsecuredJwtManager.php @@ -0,0 +1,164 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Signature\JWSBuilder; +use Jose\Component\Signature\JWSLoader; +use Jose\Component\Signature\Serializer\JWSSerializerManager; +use Magento\Framework\Jwt\Exception\JwtException; +use Magento\Framework\Jwt\Exception\MalformedTokenException; +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\Jwk; +use Jose\Component\Core\JWK as AdapterJwk; +use Magento\Framework\Jwt\Unsecured\UnsecuredJwtInterface; + +/** + * Works with Unsecured JWT. + */ +class UnsecuredJwtManager +{ + /** + * @var JWSBuilder + */ + private $jwsBuilder; + + /** + * @var JWSLoader + */ + private $jwsLoader; + + /** + * @var JWSSerializerManager + */ + private $jwsSerializer; + + /** + * @var UnsecuredJwtFactory + */ + private $jwtFactory; + + /** + * @param JwsBuilderFactory $builderFactory + * @param JwsSerializerPoolFactory $serializerPoolFactory + * @param JwsLoaderFactory $jwsLoaderFactory + * @param UnsecuredJwtFactory $jwtFactory + */ + public function __construct( + JwsBuilderFactory $builderFactory, + JwsSerializerPoolFactory $serializerPoolFactory, + JwsLoaderFactory $jwsLoaderFactory, + UnsecuredJwtFactory $jwtFactory + ) { + $this->jwsBuilder = $builderFactory->create(); + $this->jwsSerializer = $serializerPoolFactory->create(); + $this->jwsLoader = $jwsLoaderFactory->create(); + $this->jwtFactory = $jwtFactory; + } + + /** + * Generate unsecured JWT token. + * + * @param UnsecuredJwtInterface $jwt + * @return string + * @throws JwtException + */ + public function build(UnsecuredJwtInterface $jwt): string + { + $signaturesCount = count($jwt->getProtectedHeaders()); + if ($jwt->getUnprotectedHeaders() + && count($jwt->getUnprotectedHeaders()) !== $signaturesCount + ) { + throw new MalformedTokenException('There must be an equal number of protected and unprotected headers.'); + } + $builder = $this->jwsBuilder->create(); + $builder = $builder->withPayload($jwt->getPayload()->getContent()); + for ($i = 0; $i < $signaturesCount; $i++) { + $protected = []; + if ($jwt->getPayload()->getContentType()) { + $protected['cty'] = $jwt->getPayload()->getContentType(); + } + if ($jwt->getProtectedHeaders()) { + $protected = $this->extractHeaderData($jwt->getProtectedHeaders()[$i]); + } + $protected['alg'] = Jwk::ALGORITHM_NONE; + $unprotected = []; + if ($jwt->getUnprotectedHeaders()) { + $unprotected = $this->extractHeaderData($jwt->getUnprotectedHeaders()[$i]); + } + $builder = $builder->addSignature( + new AdapterJwk(['kty' => 'none', 'alg' => 'none']), + $protected, + $unprotected + ); + } + $jwsCreated = $builder->build(); + + if ($signaturesCount > 1) { + return $this->jwsSerializer->serialize('jws_json_general', $jwsCreated); + } + if ($jwt->getUnprotectedHeaders()) { + return $this->jwsSerializer->serialize('jws_json_flattened', $jwsCreated); + } + return $this->jwsSerializer->serialize('jws_compact', $jwsCreated); + } + + /** + * Read unsecured JWT token. + * + * @param string $token + * @return UnsecuredJwtInterface + * @throws JwtException + */ + public function read(string $token): UnsecuredJwtInterface + { + try { + $jws = $this->jwsLoader->loadAndVerifyWithKey( + $token, + new AdapterJwk(['kty' => 'none', 'alg' => 'none']), + $signature, + null + ); + } catch (\Throwable $exception) { + throw new MalformedTokenException('Failed to read JWT token', 0, $exception); + } + if ($jws->isPayloadDetached()) { + throw new JwtException('Detached payload is not supported'); + } + $protectedHeaders = []; + $publicHeaders = []; + foreach ($jws->getSignatures() as $signature) { + $protectedHeaders[] = $signature->getProtectedHeader(); + if ($signature->getHeader()) { + $publicHeaders[] = $signature->getHeader(); + } + } + + return $this->jwtFactory->create( + $protectedHeaders, + $publicHeaders, + $jws->getPayload() + ); + } + + /** + * Extract JOSE header data. + * + * @param HeaderInterface $header + * @return array + */ + private function extractHeaderData(HeaderInterface $header): array + { + $data = []; + foreach ($header->getParameters() as $parameter) { + $data[$parameter->getName()] = $parameter->getValue(); + } + + return $data; + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/README.md b/app/code/Magento/JwtFrameworkAdapter/README.md new file mode 100644 index 000000000000..4a2f9dc59aef --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/README.md @@ -0,0 +1 @@ +Provides Magento\Framework\Jwt\JwtManagerInterface implementation based on jwt-framework. diff --git a/app/code/Magento/JwtFrameworkAdapter/Test/Unit/Model/JweFactoryTest.php b/app/code/Magento/JwtFrameworkAdapter/Test/Unit/Model/JweFactoryTest.php new file mode 100644 index 000000000000..1258aab828a0 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Test/Unit/Model/JweFactoryTest.php @@ -0,0 +1,131 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Test\Unit\Model; + +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\Payload\ArbitraryPayload; +use Magento\Framework\Jwt\Payload\ClaimsPayloadInterface; +use Magento\Framework\Jwt\Payload\NestedPayloadInterface; +use Magento\JwtFrameworkAdapter\Model\JweFactory; +use PHPUnit\Framework\TestCase; + +class JweFactoryTest extends TestCase +{ + /** + * @var JweFactory + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->model = new JweFactory(); + } + + public function getCreateCases(): array + { + return [ + 'compact-arbitrary' => [ + ['cty' => 'MyType', 'typ' => 'JWT'], + 'some-value', + null, + null, + ArbitraryPayload::class + ], + 'compact-claims' => [ + ['typ' => 'JWT'], + '{"tst1":"val1","tst2":2,"tst3":true}', + null, + null, + ClaimsPayloadInterface::class + ], + 'compact-nested' => [ + ['typ' => 'JWT', 'cty' => NestedPayloadInterface::CONTENT_TYPE], + 'eyJhbGciOiJub25lIn0.' + .'eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ.', + null, + null, + NestedPayloadInterface::class + ], + 'json-arbitrary' => [ + ['typ' => 'JWT'], + 'arbitrary', + ['cty' => 'SomeType'], + ['crit' => 'exp'], + ArbitraryPayload::class + ], + 'json-claims' => [ + ['typ' => 'JWT'], + '{"tst1":"val1","tst2":2,"tst3":true}', + ['aud' => 'magento'], + ['custom' => 'value'], + ClaimsPayloadInterface::class + ] + ]; + } + + /** + * Test "create" method. + * + * @param array $headers + * @param string $content + * @param array|null $unprotected + * @param array|null $perRecipient + * @param string $payloadClass + * @return void + * @dataProvider getCreateCases + */ + public function testCreate( + array $headers, + string $content, + ?array $unprotected, + ?array $perRecipient, + string $payloadClass + ): void { + $jwe = $this->model->create($headers, $content, $unprotected, $perRecipient); + + $payload = $jwe->getPayload(); + $this->assertEquals($content, $payload->getContent()); + $this->assertInstanceOf($payloadClass, $payload); + if ($payload instanceof ClaimsPayloadInterface) { + $actualClaims = []; + foreach ($payload->getClaims() as $claim) { + $actualClaims[$claim->getName()] = $claim->getValue(); + } + $this->assertEquals(json_decode($content, true), $actualClaims); + } + + $this->validateHeader($headers, $jwe->getHeader()); + if ($unprotected === null) { + $this->assertNull($jwe->getSharedUnprotectedHeader()); + } else { + $this->assertNotNull($jwe->getSharedUnprotectedHeader()); + $this->validateHeader($unprotected, $jwe->getSharedUnprotectedHeader()); + } + if ($perRecipient === null) { + $this->assertNull($jwe->getSharedUnprotectedHeader()); + } else { + $this->assertNotNull($jwe->getSharedUnprotectedHeader()); + $this->validateHeader($unprotected, $jwe->getSharedUnprotectedHeader()); + } + } + + private function validateHeader(array $expectedHeaders, HeaderInterface $actual): void + { + foreach ($expectedHeaders as $header => $value) { + $parameter = $actual->getParameter($header); + $this->assertNotNull($parameter); + $this->assertEquals($value, $parameter->getValue()); + } + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Test/Unit/Model/JwsFactoryTest.php b/app/code/Magento/JwtFrameworkAdapter/Test/Unit/Model/JwsFactoryTest.php new file mode 100644 index 000000000000..addbf4c98383 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Test/Unit/Model/JwsFactoryTest.php @@ -0,0 +1,118 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Test\Unit\Model; + +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\Payload\ArbitraryPayload; +use Magento\Framework\Jwt\Payload\ClaimsPayloadInterface; +use Magento\Framework\Jwt\Payload\NestedPayloadInterface; +use Magento\JwtFrameworkAdapter\Model\JwsFactory; +use PHPUnit\Framework\TestCase; + +class JwsFactoryTest extends TestCase +{ + /** + * @var JwsFactory + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->model = new JwsFactory(); + } + + public function getCreateCases(): array + { + return [ + 'compact-arbitrary' => [ + ['cty' => 'MyType', 'typ' => 'JWT'], + 'some-value', + null, + ArbitraryPayload::class + ], + 'compact-claims' => [ + ['typ' => 'JWT'], + '{"tst1":"val1","tst2":2,"tst3":true}', + null, + ClaimsPayloadInterface::class + ], + 'compact-nested' => [ + ['typ' => 'JWT', 'cty' => NestedPayloadInterface::CONTENT_TYPE], + 'eyJhbGciOiJub25lIn0.' + .'eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ.', + null, + NestedPayloadInterface::class + ], + 'json-arbitrary' => [ + ['typ' => 'JWT'], + 'arbitrary', + ['cty' => 'SomeType'], + ArbitraryPayload::class + ], + 'json-claims' => [ + ['typ' => 'JWT'], + '{"tst1":"val1","tst2":2,"tst3":true}', + ['aud' => 'magento'], + ClaimsPayloadInterface::class + ] + ]; + } + + /** + * Test "create" method. + * + * @param array $headers + * @param string $content + * @param array|null $unprotected + * @param string $payloadClass + * @return void + * @dataProvider getCreateCases + */ + public function testCreate( + array $headers, + string $content, + ?array $unprotected, + string $payloadClass + ): void { + $jws = $this->model->create($headers, $content, $unprotected); + + $payload = $jws->getPayload(); + $this->assertEquals($content, $payload->getContent()); + $this->assertInstanceOf($payloadClass, $payload); + if ($payload instanceof ClaimsPayloadInterface) { + $actualClaims = []; + foreach ($payload->getClaims() as $claim) { + $actualClaims[$claim->getName()] = $claim->getValue(); + } + $this->assertEquals(json_decode($content, true), $actualClaims); + } + + $this->validateHeader($headers, $jws->getHeader()); + if ($unprotected === null) { + $this->assertEmpty($jws->getUnprotectedHeaders()); + } else { + $this->assertNotEmpty($jws->getUnprotectedHeaders()); + $this->validateHeader($unprotected, array_values($jws->getUnprotectedHeaders())[0]); + } + } + + private function validateHeader(array $expectedHeaders, HeaderInterface $actual): void + { + foreach ($expectedHeaders as $header => $value) { + $parameter = $actual->getParameter($header); + $this->assertNotNull($parameter); + $this->assertEquals($value, $parameter->getValue()); + } + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Test/Unit/Model/UnsecuredJwtFactoryTest.php b/app/code/Magento/JwtFrameworkAdapter/Test/Unit/Model/UnsecuredJwtFactoryTest.php new file mode 100644 index 000000000000..551f2c0b8c3f --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Test/Unit/Model/UnsecuredJwtFactoryTest.php @@ -0,0 +1,120 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Test\Unit\Model; + +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\Payload\ArbitraryPayload; +use Magento\Framework\Jwt\Payload\ClaimsPayloadInterface; +use Magento\Framework\Jwt\Payload\NestedPayloadInterface; +use Magento\JwtFrameworkAdapter\Model\UnsecuredJwtFactory; +use PHPUnit\Framework\TestCase; + +class UnsecuredJwtFactoryTest extends TestCase +{ + /** + * @var UnsecuredJwtFactory + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->model = new UnsecuredJwtFactory(); + } + + public function getCreateCases(): array + { + return [ + 'compact-arbitrary' => [ + [['cty' => 'MyType', 'typ' => 'JWT']], + 'some-value', + null, + ArbitraryPayload::class + ], + 'compact-claims' => [ + [['typ' => 'JWT']], + '{"tst1":"val1","tst2":2,"tst3":true}', + null, + ClaimsPayloadInterface::class + ], + 'compact-nested' => [ + [['typ' => 'JWT', 'cty' => NestedPayloadInterface::CONTENT_TYPE]], + 'eyJhbGciOiJub25lIn0.' + .'eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ.', + null, + NestedPayloadInterface::class + ], + 'json-flat-arbitrary' => [ + [['typ' => 'JWT']], + 'arbitrary', + [['cty' => 'SomeType']], + ArbitraryPayload::class + ], + 'json-flat-claims' => [ + [['typ' => 'JWT']], + '{"tst1":"val1","tst2":2,"tst3":true}', + [['aud' => 'magento']], + ClaimsPayloadInterface::class + ], + 'json-arbitrary' => [ + [['typ' => 'JWT'], ['typ' => 'JWT', 'aud' => 'magento']], + 'value', + [['cty' => 'MyType'], ['cty' => 'MyType', 'crit' => 'exp']], + ArbitraryPayload::class + ] + ]; + } + + /** + * Test "create" method. + * + * @param array $headers + * @param string $content + * @param array|null $unprotected + * @param string $payloadClass + * @return void + * @dataProvider getCreateCases + */ + public function testCreate( + array $headers, + string $content, + ?array $unprotected, + string $payloadClass + ): void { + $jwt = $this->model->create($headers, $unprotected, $content); + + $payload = $jwt->getPayload(); + $this->assertEquals($content, $payload->getContent()); + $this->assertInstanceOf($payloadClass, $payload); + if ($payload instanceof ClaimsPayloadInterface) { + $actualClaims = []; + foreach ($payload->getClaims() as $claim) { + $actualClaims[$claim->getName()] = $claim->getValue(); + } + $this->assertEquals(json_decode($content, true), $actualClaims); + } + + $actualHeaders = array_map([$this, 'extractHeader'], $jwt->getProtectedHeaders()); + $this->assertEquals($headers, $actualHeaders); + } + + private function extractHeader(HeaderInterface $header): array + { + $values = []; + foreach ($header->getParameters() as $parameter) { + $values[$parameter->getName()] = $parameter->getValue(); + } + + return $values; + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/composer.json b/app/code/Magento/JwtFrameworkAdapter/composer.json new file mode 100644 index 000000000000..e99a527d0a97 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/composer.json @@ -0,0 +1,25 @@ +{ + "name": "magento/module-jwt-framework-adapter", + "description": "JWT Manager implementation based on jwt-framework", + "config": { + "sort-packages": true + }, + "require": { + "php": "~7.3.0||~7.4.0", + "magento/framework": "*", + "web-token/jwt-framework": "^v2.2.7" + }, + "type": "magento2-module", + "license": [ + "OSL-3.0", + "AFL-3.0" + ], + "autoload": { + "files": [ + "registration.php" + ], + "psr-4": { + "Magento\\JwtFrameworkAdapter\\": "" + } + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/etc/di.xml b/app/code/Magento/JwtFrameworkAdapter/etc/di.xml new file mode 100644 index 000000000000..2a8248c67c9b --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/etc/di.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> + <preference for="Magento\Framework\Jwt\JwtManagerInterface" type="Magento\JwtFrameworkAdapter\Model\JwtManager" /> +</config> diff --git a/app/code/Magento/JwtFrameworkAdapter/etc/module.xml b/app/code/Magento/JwtFrameworkAdapter/etc/module.xml new file mode 100644 index 000000000000..256d332ef3fe --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/etc/module.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> + <module name="Magento_JwtFrameworkAdapter" /> +</config> diff --git a/app/code/Magento/JwtFrameworkAdapter/registration.php b/app/code/Magento/JwtFrameworkAdapter/registration.php new file mode 100644 index 000000000000..2b21e8fad652 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/registration.php @@ -0,0 +1,9 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Framework\Component\ComponentRegistrar; + +ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_JwtFrameworkAdapter', __DIR__); diff --git a/app/code/Magento/JwtUserToken/Api/ConfigReaderInterface.php b/app/code/Magento/JwtUserToken/Api/ConfigReaderInterface.php new file mode 100644 index 000000000000..ffb48b66b7a2 --- /dev/null +++ b/app/code/Magento/JwtUserToken/Api/ConfigReaderInterface.php @@ -0,0 +1,55 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Api; + +/** + * Provides JWT configurations. + */ +interface ConfigReaderInterface +{ + public const JWT_TYPE_JWS = 0; + + public const JWT_TYPE_JWE = 0; + + /** + * Algorithm to use for authentication JWTs. + * + * @return string + */ + public function getJwtAlgorithm(): string; + + /** + * Find JWT type based on algorithm. + * + * @param string $algorithm + * @return int + */ + public function getJwtAlgorithmType(string $algorithm): int; + + /** + * Algorithm to encrypt JWE content with. + * + * @return string + */ + public function getJweContentAlgorithm(): string; + + /** + * Customer tokens TTL in minutes. + * + * @return int + */ + public function getCustomerTtl(): int; + + /** + * Admin tokens TTL in minutes. + * + * @return int + */ + public function getAdminTtl(): int; +} diff --git a/app/code/Magento/JwtUserToken/Api/Data/JwtTokenDataInterface.php b/app/code/Magento/JwtUserToken/Api/Data/JwtTokenDataInterface.php new file mode 100644 index 000000000000..151de297c4d6 --- /dev/null +++ b/app/code/Magento/JwtUserToken/Api/Data/JwtTokenDataInterface.php @@ -0,0 +1,23 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Api\Data; + +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\Payload\ClaimsPayloadInterface; +use Magento\Integration\Api\Data\UserTokenDataInterface; + +/** + * Adds JWT data retrieved from a token. + */ +interface JwtTokenDataInterface extends UserTokenDataInterface +{ + public function getJwtHeader(): HeaderInterface; + + public function getJwtClaims(): ClaimsPayloadInterface; +} diff --git a/app/code/Magento/JwtUserToken/Api/Data/Revoked.php b/app/code/Magento/JwtUserToken/Api/Data/Revoked.php new file mode 100644 index 000000000000..16be761aebf7 --- /dev/null +++ b/app/code/Magento/JwtUserToken/Api/Data/Revoked.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Api\Data; + +use Magento\Framework\DataObject; + +/** + * Revoked token data. + */ +class Revoked extends DataObject +{ + /** + * @param int $userTypeId + * @param int $userId + * @param int $beforeTimestamp + * @param array $data + */ + public function __construct(?int $userTypeId, ?int $userId, ?int $beforeTimestamp, array $data = []) + { + if ($userTypeId !== null) { + $data['user_type_id'] = $userTypeId; + } + if ($userId !== null) { + $data['user_id'] = $userId; + } + if ($beforeTimestamp !== null) { + $data['revoke_before'] = $beforeTimestamp; + } + + parent::__construct($data); + } + + public function getUserTypeId(): int + { + return (int) $this->getData('user_type_id'); + } + + public function getUserId(): int + { + return (int) $this->getData('user_id'); + } + + public function getBeforeTimestamp(): int + { + return (int) $this->getData('revoke_before'); + } +} diff --git a/app/code/Magento/JwtUserToken/Api/RevokedRepositoryInterface.php b/app/code/Magento/JwtUserToken/Api/RevokedRepositoryInterface.php new file mode 100644 index 000000000000..f65f72cc7c16 --- /dev/null +++ b/app/code/Magento/JwtUserToken/Api/RevokedRepositoryInterface.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Api; + +use Magento\JwtUserToken\Api\Data\Revoked; + +/** + * Repository for revoked tokens data. + */ +interface RevokedRepositoryInterface +{ + /** + * Store revoked tokens data. + * + * @param Revoked $revoked + * @return void + */ + public function saveRevoked(Revoked $revoked): void; + + /** + * Find user's record. + * + * @param int $userTypeId + * @param int $userId + * @return Revoked|null + */ + public function findRevoked(int $userTypeId, int $userId): ?Revoked; +} diff --git a/app/code/Magento/Tinymce3/Test/Mftf/LICENSE.txt b/app/code/Magento/JwtUserToken/LICENSE.txt similarity index 100% rename from app/code/Magento/Tinymce3/Test/Mftf/LICENSE.txt rename to app/code/Magento/JwtUserToken/LICENSE.txt diff --git a/app/code/Magento/Tinymce3/Test/Mftf/LICENSE_AFL.txt b/app/code/Magento/JwtUserToken/LICENSE_AFL.txt similarity index 100% rename from app/code/Magento/Tinymce3/Test/Mftf/LICENSE_AFL.txt rename to app/code/Magento/JwtUserToken/LICENSE_AFL.txt diff --git a/app/code/Magento/JwtUserToken/Model/Config/ConfigReader.php b/app/code/Magento/JwtUserToken/Model/Config/ConfigReader.php new file mode 100644 index 000000000000..83136b2e78cb --- /dev/null +++ b/app/code/Magento/JwtUserToken/Model/Config/ConfigReader.php @@ -0,0 +1,96 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Model\Config; + +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\JwtUserToken\Api\ConfigReaderInterface; + +/** + * provides JWT configuration values. + */ +class ConfigReader implements ConfigReaderInterface +{ + private const JWT_ALG_CONFIG_PATH = 'webapi/jwtauth/jwt_alg'; + + private const JWE_ALG_CONFIG_PATH = 'webapi/jwtauth/jwe_alg'; + + private const CUSTOMER_EXPIRATION_CONFIG_PATH = 'webapi/jwtauth/customer_expiration'; + + private const ADMIN_EXPIRATION_CONFIG_PATH = 'webapi/jwtauth/admin_expiration'; + + /** + * @var ScopeConfigInterface + */ + private $config; + + /** + * @var JwtAlgorithmSource + */ + private $algSource; + + /** + * @param ScopeConfigInterface $config + * @param JwtAlgorithmSource $algorithmSource + */ + public function __construct(ScopeConfigInterface $config, JwtAlgorithmSource $algorithmSource) + { + $this->config = $config; + $this->algSource = $algorithmSource; + } + + /** + * @inheritDoc + */ + public function getJwtAlgorithm(): string + { + return $this->config->getValue(self::JWT_ALG_CONFIG_PATH); + } + + /** + * @inheritDoc + */ + public function getJweContentAlgorithm(): string + { + return $this->config->getValue(self::JWE_ALG_CONFIG_PATH); + } + + /** + * @inheritDoc + */ + public function getCustomerTtl(): int + { + $ttl = (int) $this->config->getValue(self::CUSTOMER_EXPIRATION_CONFIG_PATH); + if ($ttl <= 0) { + $ttl = 30; + } + + return $ttl; + } + + /** + * @inheritDoc + */ + public function getAdminTtl(): int + { + $ttl = (int) $this->config->getValue(self::ADMIN_EXPIRATION_CONFIG_PATH); + if ($ttl <= 0) { + $ttl = 30; + } + + return $ttl; + } + + /** + * @inheritDoc + */ + public function getJwtAlgorithmType(string $algorithm): int + { + return $this->algSource->getAlgorithmType($algorithm); + } +} diff --git a/app/code/Magento/JwtUserToken/Model/Config/JweAlgorithmSource.php b/app/code/Magento/JwtUserToken/Model/Config/JweAlgorithmSource.php new file mode 100644 index 000000000000..2842e65f6774 --- /dev/null +++ b/app/code/Magento/JwtUserToken/Model/Config/JweAlgorithmSource.php @@ -0,0 +1,40 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Model\Config; + +use Magento\Framework\Data\OptionSourceInterface; +use Magento\Framework\Jwt\Jwe\JweEncryptionSettingsInterface; + +/** + * JWE content encryption algorithm options + */ +class JweAlgorithmSource implements OptionSourceInterface +{ + private const ALGS = [ + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128GCM, + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A192GCM, + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A256GCM, + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256, + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A192_HS384, + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A256_HS512 + ]; + + /** + * @inheritDoc + */ + public function toOptionArray() + { + $options = []; + foreach (self::ALGS as $algorithm) { + $options[] = ['label' => __($algorithm), 'value' => $algorithm]; + } + + return $options; + } +} diff --git a/app/code/Magento/JwtUserToken/Model/Config/JwtAlgorithmSource.php b/app/code/Magento/JwtUserToken/Model/Config/JwtAlgorithmSource.php new file mode 100644 index 000000000000..8fc8d14b1d0b --- /dev/null +++ b/app/code/Magento/JwtUserToken/Model/Config/JwtAlgorithmSource.php @@ -0,0 +1,73 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Model\Config; + +use Magento\Framework\Data\OptionSourceInterface; +use Magento\Framework\Jwt\Jwk; + +/** + * JWT Algorithm options + */ +class JwtAlgorithmSource implements OptionSourceInterface +{ + public const ALG_TYPE_JWS = 0; + + public const ALG_TYPE_JWE = 1; + + private const ALG_TYPE_NAME = [ + self::ALG_TYPE_JWS => 'JWS', + self::ALG_TYPE_JWE => 'JWE' + ]; + + private const ALGS = [ + Jwk::ALGORITHM_HS256 => self::ALG_TYPE_JWS, + Jwk::ALGORITHM_HS384 => self::ALG_TYPE_JWS, + Jwk::ALGORITHM_HS512 => self::ALG_TYPE_JWS, + Jwk::ALGORITHM_A128KW => self::ALG_TYPE_JWE, + Jwk::ALGORITHM_A192KW => self::ALG_TYPE_JWE, + Jwk::ALGORITHM_A256KW => self::ALG_TYPE_JWE, + Jwk::ALGORITHM_A128GCMKW => self::ALG_TYPE_JWE, + Jwk::ALGORITHM_A192GCMKW => self::ALG_TYPE_JWE, + Jwk::ALGORITHM_A256GCMKW => self::ALG_TYPE_JWE, + ]; + + /** + * @var array + */ + private $algs; + + /** + * @param array $algs Additional algorithms. + */ + public function __construct(array $algs = []) + { + $this->algs = array_merge($algs, self::ALGS); + } + + public function getAlgorithmType(string $alg): int + { + return $this->algs[$alg]; + } + + /** + * @inheritDoc + */ + public function toOptionArray() + { + $options = []; + foreach (array_keys($this->algs) as $algorithm) { + $options[] = [ + 'label' => __($algorithm . implode('', [' (', self::ALG_TYPE_NAME[$this->algs[$algorithm]], ')'])), + 'value' => $algorithm + ]; + } + + return $options; + } +} diff --git a/app/code/Magento/JwtUserToken/Model/ConfigurableJwtSettingsProvider.php b/app/code/Magento/JwtUserToken/Model/ConfigurableJwtSettingsProvider.php new file mode 100644 index 000000000000..85dc507f7331 --- /dev/null +++ b/app/code/Magento/JwtUserToken/Model/ConfigurableJwtSettingsProvider.php @@ -0,0 +1,120 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Model; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Framework\Jwt\EncryptionSettingsInterface; +use Magento\Framework\Jwt\Jwe\JweEncryptionJwks; +use Magento\Framework\Jwt\Jwk; +use Magento\Framework\Jwt\JwkSet; +use Magento\Framework\Jwt\Jws\JwsSignatureJwks; +use Magento\JwtUserToken\Api\ConfigReaderInterface; + +/** + * Provides JWT settings based on Magento config. + */ +class ConfigurableJwtSettingsProvider implements JwtSettingsProviderInterface +{ + /** + * @var EncryptionSettingsInterface[][] + */ + private $jwsEncryptions; + + /** + * @var EncryptionSettingsInterface[][] + */ + private $jweEncryptions; + + /** + * @var SecretBasedJwksFactory + */ + private $secretBasedJwkFactory; + + /** + * @var ConfigReaderInterface + */ + private $configReader; + + /** + * @param SecretBasedJwksFactory $secretBasedJwkFactory + * @param ConfigReaderInterface $configReader + * @param EncryptionSettingsInterface[][] $jwsEncryptions Additional JWS settings. + * @param EncryptionSettingsInterface[][] $jweEncryptions Additional JWE settings. + */ + public function __construct( + SecretBasedJwksFactory $secretBasedJwkFactory, + ConfigReaderInterface $configReader, + array $jwsEncryptions = [], + array $jweEncryptions = [] + ) { + $this->jwsEncryptions = $jwsEncryptions; + $this->jweEncryptions = $jweEncryptions; + $this->secretBasedJwkFactory = $secretBasedJwkFactory; + $this->configReader = $configReader; + } + + /** + * @inheritDoc + */ + public function prepareSettingsFor(UserContextInterface $userContext): EncryptionSettingsInterface + { + $settings = $this->prepareAllAccepted(); + + return array_pop($settings); + } + + /** + * @inheritDoc + */ + public function prepareAllAccepted(): array + { + $algorithm = $this->configReader->getJwtAlgorithm(); + $type = $this->configReader->getJwtAlgorithmType($algorithm); + if ($type === ConfigReaderInterface::JWT_TYPE_JWS) { + if (!array_key_exists($algorithm, $this->jwsEncryptions)) { + //Try to create default settings. + try { + $this->jwsEncryptions[$algorithm] = array_map( + function (Jwk $jwk) { + return new JwsSignatureJwks($jwk); + }, + $this->secretBasedJwkFactory->createFor($algorithm) + ); + } catch (\InvalidArgumentException $exception) { + //Failed to create + } + } + if (!array_key_exists($algorithm, $this->jwsEncryptions)) { + throw new \RuntimeException('JWT settings for algorithm "' .$algorithm .'" not found'); + } + + return $this->jwsEncryptions[$algorithm]; + } else { + if (!array_key_exists($algorithm, $this->jweEncryptions)) { + //Try to create default settings. + try { + $contentAlg = $this->configReader->getJweContentAlgorithm(); + $this->jweEncryptions[$algorithm] = array_map( + function (Jwk $jwk) use ($contentAlg) { + return new JweEncryptionJwks($jwk, $contentAlg); + }, + $this->secretBasedJwkFactory->createFor($algorithm) + ); + } catch (\InvalidArgumentException $exception) { + //Failed to create + } + } + if (!array_key_exists($algorithm, $this->jweEncryptions)) { + throw new \RuntimeException('JWT settings for algorithm "' . $algorithm . '" not found'); + } + + return $this->jweEncryptions[$algorithm]; + } + } +} diff --git a/app/code/Magento/JwtUserToken/Model/Data/Header.php b/app/code/Magento/JwtUserToken/Model/Data/Header.php new file mode 100644 index 000000000000..4a153130984b --- /dev/null +++ b/app/code/Magento/JwtUserToken/Model/Data/Header.php @@ -0,0 +1,44 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Model\Data; + +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\HeaderParameterInterface; + +class Header implements HeaderInterface +{ + /** + * @var HeaderParameterInterface[] + */ + private $params; + + /** + * @param HeaderParameterInterface[] $params + */ + public function __construct(array $params) + { + $this->params = $params; + } + + /** + * @inheritDoc + */ + public function getParameters(): array + { + return $this->params; + } + + /** + * @inheritDoc + */ + public function getParameter(string $name): ?HeaderParameterInterface + { + return array_key_exists($name, $this->params) ? $this->params[$name] : null; + } +} diff --git a/app/code/Magento/JwtUserToken/Model/Data/JwtTokenData.php b/app/code/Magento/JwtUserToken/Model/Data/JwtTokenData.php new file mode 100644 index 000000000000..63aa9d15f33a --- /dev/null +++ b/app/code/Magento/JwtUserToken/Model/Data/JwtTokenData.php @@ -0,0 +1,74 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Model\Data; + +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\Payload\ClaimsPayloadInterface; +use Magento\JwtUserToken\Api\Data\JwtTokenDataInterface; + +class JwtTokenData implements JwtTokenDataInterface +{ + /** + * @var \DateTimeImmutable + */ + private $issued; + + /** + * @var \DateTimeImmutable + */ + private $expires; + + /** + * @var HeaderInterface + */ + private $jwtHeader; + + /** + * @var ClaimsPayloadInterface + */ + private $jwtClaims; + + /** + * @param \DateTimeImmutable $issued + * @param \DateTimeImmutable $expires + * @param HeaderInterface $jwtHeader + * @param ClaimsPayloadInterface $jwtClaims + */ + public function __construct( + \DateTimeImmutable $issued, + \DateTimeImmutable $expires, + HeaderInterface $jwtHeader, + ClaimsPayloadInterface $jwtClaims + ) { + $this->issued = $issued; + $this->expires = $expires; + $this->jwtHeader = $jwtHeader; + $this->jwtClaims = $jwtClaims; + } + + public function getIssued(): \DateTimeImmutable + { + return $this->issued; + } + + public function getExpires(): \DateTimeImmutable + { + return $this->expires; + } + + public function getJwtHeader(): HeaderInterface + { + return $this->jwtHeader; + } + + public function getJwtClaims(): ClaimsPayloadInterface + { + return $this->jwtClaims; + } +} diff --git a/app/code/Magento/JwtUserToken/Model/Data/JwtTokenParameters.php b/app/code/Magento/JwtUserToken/Model/Data/JwtTokenParameters.php new file mode 100644 index 000000000000..60825a5c5db1 --- /dev/null +++ b/app/code/Magento/JwtUserToken/Model/Data/JwtTokenParameters.php @@ -0,0 +1,81 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Model\Data; + +use Magento\Framework\Jwt\ClaimInterface; +use Magento\Framework\Jwt\HeaderParameterInterface; + +/** + * User token parameters for JWTs. + */ +class JwtTokenParameters +{ + /** + * @var HeaderParameterInterface[] + */ + private $protectedHeaderParameters = []; + + /** + * @var HeaderParameterInterface[] + */ + private $publicHeaderParameters = []; + + /** + * @var ClaimInterface[] + */ + private $claims = []; + + /** + * @return HeaderParameterInterface[] + */ + public function getProtectedHeaderParameters(): array + { + return $this->protectedHeaderParameters; + } + + /** + * @param HeaderParameterInterface[] $protectedHeaderParameters + */ + public function setProtectedHeaderParameters(array $protectedHeaderParameters): void + { + $this->protectedHeaderParameters = $protectedHeaderParameters; + } + + /** + * @return HeaderParameterInterface[] + */ + public function getPublicHeaderParameters(): array + { + return $this->publicHeaderParameters; + } + + /** + * @param HeaderParameterInterface[] $publicHeaderParameters + */ + public function setPublicHeaderParameters(array $publicHeaderParameters): void + { + $this->publicHeaderParameters = $publicHeaderParameters; + } + + /** + * @return ClaimInterface[] + */ + public function getClaims(): array + { + return $this->claims; + } + + /** + * @param ClaimInterface[] $claims + */ + public function setClaims(array $claims): void + { + $this->claims = $claims; + } +} diff --git a/app/code/Magento/JwtUserToken/Model/Data/JwtUserContext.php b/app/code/Magento/JwtUserToken/Model/Data/JwtUserContext.php new file mode 100644 index 000000000000..6f64cdb73b4f --- /dev/null +++ b/app/code/Magento/JwtUserToken/Model/Data/JwtUserContext.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Model\Data; + +use Magento\Authorization\Model\UserContextInterface; + +class JwtUserContext implements UserContextInterface +{ + /** + * @var int|null + */ + private $userId; + + /** + * @var int|null + */ + private $userType; + + /** + * @param int|null $userId + * @param int|null $userType + */ + public function __construct(?int $userId, ?int $userType) + { + $this->userId = $userId; + $this->userType = $userType; + } + + /** + * @inheritDoc + */ + public function getUserId() + { + return $this->userId; + } + + /** + * @inheritDoc + */ + public function getUserType() + { + return $this->userType; + } +} diff --git a/app/code/Magento/JwtUserToken/Model/Issuer.php b/app/code/Magento/JwtUserToken/Model/Issuer.php new file mode 100644 index 000000000000..a82153dab930 --- /dev/null +++ b/app/code/Magento/JwtUserToken/Model/Issuer.php @@ -0,0 +1,121 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Model; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Framework\Jwt\Claim\ExpirationTime; +use Magento\Framework\Jwt\Claim\IssuedAt; +use Magento\Framework\Jwt\Claim\PrivateClaim; +use Magento\Framework\Jwt\Jwe\Jwe; +use Magento\Framework\Jwt\Jwe\JweHeader; +use Magento\Framework\Jwt\Jws\Jws; +use Magento\Framework\Jwt\Jws\JwsHeader; +use Magento\Framework\Jwt\Jws\JwsSignatureSettingsInterface; +use Magento\Framework\Jwt\JwtManagerInterface; +use Magento\Framework\Jwt\Payload\ClaimsPayload; +use Magento\Integration\Api\Data\UserTokenParametersInterface; +use Magento\Integration\Api\Exception\UserTokenException; +use Magento\Integration\Api\UserTokenIssuerInterface; +use Magento\JwtUserToken\Api\ConfigReaderInterface; +use Magento\JwtUserToken\Model\Data\JwtTokenParameters; + +class Issuer implements UserTokenIssuerInterface +{ + /** + * @var JwtManagerInterface + */ + private $jwtManager; + + /** + * @var JwtSettingsProviderInterface + */ + private $settingsProvider; + + /** + * @var ConfigReaderInterface + */ + private $configReader; + + /** + * @param JwtManagerInterface $jwtManager + * @param JwtSettingsProviderInterface $settingsProvider + * @param ConfigReaderInterface $configReader + */ + public function __construct( + JwtManagerInterface $jwtManager, + JwtSettingsProviderInterface $settingsProvider, + ConfigReaderInterface $configReader + ) { + $this->jwtManager = $jwtManager; + $this->settingsProvider = $settingsProvider; + $this->configReader = $configReader; + } + + /** + * @inheritDoc + */ + public function create(UserContextInterface $userContext, UserTokenParametersInterface $params): string + { + if (!$userContext->getUserId() || !$userContext->getUserType()) { + throw new UserTokenException('User ID and Type ID cannot be empty'); + } + + $protectedHeaders = []; + $publicHeaders = []; + $claims = []; + $claims['uid'] = new PrivateClaim('uid', (int) $userContext->getUserId()); + $claims['utypid'] = new PrivateClaim('utypid', (int) $userContext->getUserType()); + if ($params->getForcedIssuedTime()) { + $iat = $params->getForcedIssuedTime(); + if ($iat instanceof \DateTime) { + $iat = \DateTimeImmutable::createFromMutable($iat); + } + } else { + $iat = new \DateTimeImmutable('now', new \DateTimeZone('UTC')); + } + $claims['iat'] = new IssuedAt($iat, true); + if ($userContext->getUserType() === UserContextInterface::USER_TYPE_ADMIN) { + $ttl = $this->configReader->getAdminTtl(); + } elseif ($userContext->getUserType() === UserContextInterface::USER_TYPE_CUSTOMER) { + $ttl = $this->configReader->getCustomerTtl(); + } else { + throw new \RuntimeException('Can only issue tokens for customers and admin users'); + } + $claims['exp'] = new ExpirationTime($iat->add(new \DateInterval("PT{$ttl}M")), true); + + if ($jwtParams = $params->getExtensionAttributes()->getJwtParams()) { + /** @var JwtTokenParameters $jwtParams */ + $protectedHeaders = array_merge($jwtParams->getProtectedHeaderParameters(), $protectedHeaders); + $publicHeaders = array_merge($jwtParams->getPublicHeaderParameters(), $publicHeaders); + $claims = array_merge($jwtParams->getClaims(), $claims); + } + + $settings = $this->settingsProvider->prepareSettingsFor($userContext); + if ($settings instanceof JwsSignatureSettingsInterface) { + return $this->jwtManager->create( + new Jws( + [new JwsHeader($protectedHeaders)], + new ClaimsPayload($claims), + $publicHeaders ? [new JwsHeader($publicHeaders)] : null + ), + $settings + ); + } else { + return $this->jwtManager->create( + new Jwe( + new JweHeader($protectedHeaders), + new JweHeader($publicHeaders), + null, + new ClaimsPayload($claims) + ), + $settings + ); + } + } +} diff --git a/app/code/Magento/JwtUserToken/Model/JwtSettingsProviderInterface.php b/app/code/Magento/JwtUserToken/Model/JwtSettingsProviderInterface.php new file mode 100644 index 000000000000..11b29d361014 --- /dev/null +++ b/app/code/Magento/JwtUserToken/Model/JwtSettingsProviderInterface.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Model; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Framework\Jwt\EncryptionSettingsInterface; + +/** + * Provides JWT settings to use for authentication. + */ +interface JwtSettingsProviderInterface +{ + /** + * Prepare JWT settings to be used for tokens issued for a particular user context. + * + * @param UserContextInterface $userContext + * @return EncryptionSettingsInterface + */ + public function prepareSettingsFor(UserContextInterface $userContext): EncryptionSettingsInterface; + + /** + * Prepare list of JWT settings for all types of accepted JWTs. + * + * @return EncryptionSettingsInterface[] + */ + public function prepareAllAccepted(): array; +} diff --git a/app/code/Magento/JwtUserToken/Model/Reader.php b/app/code/Magento/JwtUserToken/Model/Reader.php new file mode 100644 index 000000000000..cb6d9624d587 --- /dev/null +++ b/app/code/Magento/JwtUserToken/Model/Reader.php @@ -0,0 +1,123 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Model; + +use Magento\Framework\Jwt\Exception\JwtException; +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\HeaderParameterInterface; +use Magento\Framework\Jwt\Jwe\JweInterface; +use Magento\Framework\Jwt\Jws\JwsInterface; +use Magento\Framework\Jwt\JwtManagerInterface; +use Magento\Framework\Jwt\Payload\ClaimsPayloadInterface; +use Magento\Integration\Api\Data\UserToken; +use Magento\Integration\Api\Exception\UserTokenException; +use Magento\Integration\Api\UserTokenReaderInterface; +use Magento\JwtUserToken\Model\Data\Header; +use Magento\JwtUserToken\Model\Data\JwtTokenData; +use Magento\JwtUserToken\Model\Data\JwtUserContext; + +class Reader implements UserTokenReaderInterface +{ + /** + * @var JwtSettingsProviderInterface + */ + private $settingsProvider; + + /** + * @var JwtManagerInterface + */ + private $jwtManager; + + /** + * @param JwtManagerInterface $jwtManager + * @param JwtSettingsProviderInterface $settingsProvider + */ + public function __construct(JwtManagerInterface $jwtManager, JwtSettingsProviderInterface $settingsProvider) + { + $this->jwtManager = $jwtManager; + $this->settingsProvider = $settingsProvider; + } + + /** + * @inheritDoc + */ + public function read(string $token): UserToken + { + try { + $jwt = $this->jwtManager->read($token, $this->settingsProvider->prepareAllAccepted()); + } catch (JwtException $exception) { + throw new UserTokenException('Failed to read JWT token', $exception); + } + + if ($jwt instanceof JwsInterface) { + $headerParams = array_merge( + $this->extractHeaderParameters($jwt->getProtectedHeaders()), + $this->extractHeaderParameters($jwt->getUnprotectedHeaders()) + ); + } elseif ($jwt instanceof JweInterface) { + $headerParams = array_merge( + $this->extractHeaderParameters($jwt->getPerRecipientUnprotectedHeaders()), + $this->extractHeaderParameters($jwt->getSharedUnprotectedHeader()), + $this->extractHeaderParameters($jwt->getProtectedHeader()) + ); + } else { + $headerParams = $this->extractHeaderParameters($jwt->getHeader()); + } + + if (!$jwt->getPayload() instanceof ClaimsPayloadInterface) { + throw new UserTokenException('JWT does not contain claims'); + } + /** @var ClaimsPayloadInterface $payload */ + $payload = $jwt->getPayload(); + $claims = $payload->getClaims(); + if (empty($claims['uid']) || empty($claims['uid']->getValue())) { + throw new UserTokenException('UserId (uid) time not provided by the received JWT'); + } + if (empty($claims['utypid']) || empty($claims['utypid']->getValue())) { + throw new UserTokenException('UserTypeId (utypid) time not provided by the received JWT'); + } + if (empty($claims['iat']) || empty($claims['iat']->getValue())) { + throw new UserTokenException('IssuedAt (iat) time not provided by the received JWT'); + } + $iat = \DateTimeImmutable::createFromFormat('U', (string) $claims['iat']->getValue()); + if (empty($claims['exp']) || empty($claims['exp']->getValue())) { + throw new UserTokenException('ExpiresAt (exp) time not provided by the received JWT'); + } + $exp = \DateTimeImmutable::createFromFormat('U', (string) $claims['exp']->getValue()); + + return new UserToken( + new JwtUserContext((int) $claims['uid']->getValue(), (int) $claims['utypid']->getValue()), + new JwtTokenData($iat, $exp, new Header($headerParams), $payload) + ); + } + + /** + * Extract header values from multiple headers. + * + * @param HeaderInterface|HeaderInterface[]|null $headers + * @return HeaderParameterInterface[] + */ + private function extractHeaderParameters($headers): array + { + $params = []; + if ($headers) { + if (!is_array($headers)) { + $headers = [$headers]; + } + + foreach ($headers as $header) { + foreach ($header->getParameters() as $parameter) { + $params[$parameter->getName()] = $parameter; + } + } + } + + return $params; + } +} diff --git a/app/code/Magento/JwtUserToken/Model/ResourceModel/FastStorageRevokedWrapper.php b/app/code/Magento/JwtUserToken/Model/ResourceModel/FastStorageRevokedWrapper.php new file mode 100644 index 000000000000..adc638318bfb --- /dev/null +++ b/app/code/Magento/JwtUserToken/Model/ResourceModel/FastStorageRevokedWrapper.php @@ -0,0 +1,96 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Model\ResourceModel; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\JwtUserToken\Api\ConfigReaderInterface; +use Magento\JwtUserToken\Api\Data\Revoked; +use Magento\JwtUserToken\Api\RevokedRepositoryInterface; +use Magento\Framework\App\CacheInterface; + +/** + * Stores revoked token data in a fast storage on top of other storage type. + */ +class FastStorageRevokedWrapper implements RevokedRepositoryInterface +{ + private const CACHE_ID = 'jwt-user-token:revoked:%d:%d'; + + /** + * @var RevokedRepositoryInterface + */ + private $slowRepo; + + /** + * @var CacheInterface + */ + private $cache; + + /** + * @var ConfigReaderInterface + */ + private $jwtConfig; + + /** + * @param RevokedRepositoryInterface $slowRepo + * @param CacheInterface $cache + * @param ConfigReaderInterface $configReader + */ + public function __construct( + RevokedRepositoryInterface $slowRepo, + CacheInterface $cache, + ConfigReaderInterface $configReader + ) { + $this->slowRepo = $slowRepo; + $this->cache = $cache; + $this->jwtConfig = $configReader; + } + + /** + * @inheritDoc + */ + public function saveRevoked(Revoked $revoked): void + { + $this->cacheData($revoked); + $this->slowRepo->saveRevoked($revoked); + } + + /** + * @inheritDoc + */ + public function findRevoked(int $userTypeId, int $userId): ?Revoked + { + $cached = $this->cache->load(sprintf(self::CACHE_ID, $userTypeId, $userId)); + if ($cached) { + return new Revoked($userTypeId, $userId, (int) $cached); + } + + $revoked = $this->slowRepo->findRevoked($userTypeId, $userId); + if ($revoked) { + $this->cacheData($revoked); + } + + return $revoked; + } + + private function cacheData(Revoked $revoked): void + { + //Caching revoked token data for the duration exceeding any previously issued tokens TTL. + if ($revoked->getUserTypeId() === UserContextInterface::USER_TYPE_ADMIN) { + $ttlMin = $this->jwtConfig->getAdminTtl(); + } else { + $ttlMin = $this->jwtConfig->getCustomerTtl(); + } + $this->cache->save( + (string) $revoked->getBeforeTimestamp(), + sprintf(self::CACHE_ID, $revoked->getUserTypeId(), $revoked->getUserId()), + [], + $ttlMin * 60 + ); + } +} diff --git a/app/code/Magento/JwtUserToken/Model/ResourceModel/RevokedRepository.php b/app/code/Magento/JwtUserToken/Model/ResourceModel/RevokedRepository.php new file mode 100644 index 000000000000..d948463018b2 --- /dev/null +++ b/app/code/Magento/JwtUserToken/Model/ResourceModel/RevokedRepository.php @@ -0,0 +1,71 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Model\ResourceModel; + +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Adapter\AdapterInterface; +use Magento\JwtUserToken\Api\RevokedRepositoryInterface; +use Magento\JwtUserToken\Api\Data\Revoked; + +/** + * DB repo. + */ +class RevokedRepository implements RevokedRepositoryInterface +{ + private const TABLE = 'jwt_auth_revoked'; + + /** + * @var ResourceConnection + */ + private $connection; + + /** + * @param ResourceConnection $resourceConnection + */ + public function __construct(ResourceConnection $resourceConnection) { + $this->connection = $resourceConnection; + } + + /** + * @inheritDoc + */ + public function saveRevoked(Revoked $revoked): void + { + $conn = $this->getAdapter(); + $table = $conn->getTableName(self::TABLE); + + $conn->insertOnDuplicate($table, $revoked->getData(), array_keys($revoked->getData())); + } + + /** + * @inheritDoc + */ + public function findRevoked(int $userTypeId, int $userId): ?Revoked + { + $conn = $this->getAdapter(); + $table = $conn->getTableName(self::TABLE); + + $data = $conn->fetchRow( + $conn->select() + ->from($table) + ->where('user_type_id = ?', $userTypeId) + ->where('user_id = ?', $userId) + ); + + if ($data) { + return new Revoked(null, null, null, $data); + } + return null; + } + + private function getAdapter(): AdapterInterface + { + return $this->connection->getConnection(ResourceConnection::DEFAULT_CONNECTION); + } +} diff --git a/app/code/Magento/JwtUserToken/Model/RevokedValidator.php b/app/code/Magento/JwtUserToken/Model/RevokedValidator.php new file mode 100644 index 000000000000..90907af248aa --- /dev/null +++ b/app/code/Magento/JwtUserToken/Model/RevokedValidator.php @@ -0,0 +1,48 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Model; + +use Magento\Framework\Exception\AuthorizationException; +use Magento\Integration\Api\Data\UserToken; +use Magento\Integration\Api\UserTokenValidatorInterface; +use Magento\JwtUserToken\Api\RevokedRepositoryInterface; + +/** + * Verifies that tokens were not revoked. + */ +class RevokedValidator implements UserTokenValidatorInterface +{ + /** + * @var RevokedRepositoryInterface + */ + private $revokedRepo; + + /** + * @param RevokedRepositoryInterface $revokedRepo + */ + public function __construct(RevokedRepositoryInterface $revokedRepo) + { + $this->revokedRepo = $revokedRepo; + } + + /** + * @inheritDoc + */ + public function validate(UserToken $token): void + { + $revoked = $this->revokedRepo->findRevoked( + (int) $token->getUserContext()->getUserType(), + (int) $token->getUserContext()->getUserId() + ); + + if ($revoked && $token->getData()->getIssued()->getTimestamp() <= $revoked->getBeforeTimestamp()) { + throw new AuthorizationException(__('User token has been revoked')); + } + } +} diff --git a/app/code/Magento/JwtUserToken/Model/Revoker.php b/app/code/Magento/JwtUserToken/Model/Revoker.php new file mode 100644 index 000000000000..f735d5bf9338 --- /dev/null +++ b/app/code/Magento/JwtUserToken/Model/Revoker.php @@ -0,0 +1,42 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Model; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Integration\Api\Exception\UserTokenException; +use Magento\Integration\Api\UserTokenRevokerInterface; +use Magento\JwtUserToken\Api\Data\Revoked; +use Magento\JwtUserToken\Api\RevokedRepositoryInterface; + +class Revoker implements UserTokenRevokerInterface +{ + /** + * @var RevokedRepositoryInterface + */ + private $revokedRepo; + + /** + * @param RevokedRepositoryInterface $revokedRepo + */ + public function __construct(RevokedRepositoryInterface $revokedRepo) + { + $this->revokedRepo = $revokedRepo; + } + + /** + * @inheritDoc + */ + public function revokeFor(UserContextInterface $userContext): void + { + //Invalidating all tokens issued before current datetime. + $this->revokedRepo->saveRevoked( + new Revoked((int) $userContext->getUserType(), (int) $userContext->getUserId(), time()) + ); + } +} diff --git a/app/code/Magento/JwtUserToken/Model/SecretBasedJwksFactory.php b/app/code/Magento/JwtUserToken/Model/SecretBasedJwksFactory.php new file mode 100644 index 000000000000..5032db90aba3 --- /dev/null +++ b/app/code/Magento/JwtUserToken/Model/SecretBasedJwksFactory.php @@ -0,0 +1,140 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtUserToken\Model; + +use Magento\Framework\App\DeploymentConfig; +use Magento\Framework\Jwt\Jwk; +use Magento\Framework\Jwt\JwkFactory; +use Magento\Framework\Jwt\JwkSet; + +/** + * Creates JWT settings instances using Magento secret. + */ +class SecretBasedJwksFactory +{ + /** + * @var string[] + */ + private $keys; + + /** + * @var JwkFactory + */ + private $jwkFactory; + + /** + * @param DeploymentConfig $deploymentConfig + * @param JwkFactory $jwkFactory + */ + public function __construct(DeploymentConfig $deploymentConfig, JwkFactory $jwkFactory) + { + $this->keys = preg_split('/\s+/s', trim((string)$deploymentConfig->get('crypt/key'))); + //Making sure keys are large enough. + foreach ($this->keys as &$key) { + $key = str_pad($key, 2048, '&', STR_PAD_BOTH); + } + $this->jwkFactory = $jwkFactory; + } + + /** + * Create JWKs for given algorithm. + * + * @param string $algorithm + * @return Jwk[] + * @throws \InvalidArgumentException When algorithm is not recognized. + */ + public function createFor(string $algorithm): array + { + switch ($algorithm) { + case Jwk::ALGORITHM_HS256: + return array_map( + function (string $key): Jwk { + static $i = 0; + + return $this->jwkFactory->createHs256($key, (string) ++$i); + }, + $this->keys + ); + case Jwk::ALGORITHM_HS384: + return array_map( + function (string $key): Jwk { + static $i = 0; + + return $this->jwkFactory->createHs384($key, (string) ++$i); + }, + $this->keys + ); + case Jwk::ALGORITHM_HS512: + return array_map( + function (string $key): Jwk { + static $i = 0; + + return $this->jwkFactory->createHs512($key, (string) ++$i); + }, + $this->keys + ); + case Jwk::ALGORITHM_A128KW: + return array_map( + function (string $key): Jwk { + static $i = 0; + + return $this->jwkFactory->createA128KW($key, (string) ++$i); + }, + $this->keys + ); + case Jwk::ALGORITHM_A192KW: + return array_map( + function (string $key): Jwk { + static $i = 0; + + return $this->jwkFactory->createA192KW($key, (string) ++$i); + }, + $this->keys + ); + case Jwk::ALGORITHM_A256KW: + return array_map( + function (string $key): Jwk { + static $i = 0; + + return $this->jwkFactory->createA256KW($key, (string) ++$i); + }, + $this->keys + ); + case Jwk::ALGORITHM_A128GCMKW: + return array_map( + function (string $key): Jwk { + static $i = 0; + + return $this->jwkFactory->createA128Gcmkw($key, (string) ++$i); + }, + $this->keys + ); + case Jwk::ALGORITHM_A192GCMKW: + return array_map( + function (string $key): Jwk { + static $i = 0; + + return $this->jwkFactory->createA192Gcmkw($key, (string) ++$i); + }, + $this->keys + ); + case Jwk::ALGORITHM_A256GCMKW: + return array_map( + function (string $key): Jwk { + static $i = 0; + + return $this->jwkFactory->createA256Gcmkw($key, (string) ++$i); + }, + $this->keys + ); + default: + throw new \InvalidArgumentException('Unknown algorithm "' . $algorithm . '"'); + } + } +} diff --git a/app/code/Magento/JwtUserToken/README.md b/app/code/Magento/JwtUserToken/README.md new file mode 100644 index 000000000000..a05b4a329d33 --- /dev/null +++ b/app/code/Magento/JwtUserToken/README.md @@ -0,0 +1 @@ +Provides self-signed JWT support for admin users' and customers' web API authentication. Replaces opaque tokens. diff --git a/app/code/Magento/JwtUserToken/composer.json b/app/code/Magento/JwtUserToken/composer.json new file mode 100644 index 000000000000..3c6cdeef1e4f --- /dev/null +++ b/app/code/Magento/JwtUserToken/composer.json @@ -0,0 +1,26 @@ +{ + "name": "magento/module-jwt-user-token", + "description": "Introduces JWT token support for web API authentication", + "config": { + "sort-packages": true + }, + "require": { + "php": "~7.3.0||~7.4.0", + "magento/framework": "*", + "magento/module-integration": "*", + "magento/module-authorization": "*" + }, + "type": "magento2-module", + "license": [ + "OSL-3.0", + "AFL-3.0" + ], + "autoload": { + "files": [ + "registration.php" + ], + "psr-4": { + "Magento\\JwtUserToken\\": "" + } + } +} diff --git a/app/code/Magento/JwtUserToken/etc/adminhtml/system.xml b/app/code/Magento/JwtUserToken/etc/adminhtml/system.xml new file mode 100644 index 000000000000..9eee9450287d --- /dev/null +++ b/app/code/Magento/JwtUserToken/etc/adminhtml/system.xml @@ -0,0 +1,34 @@ +<?xml version="1.0"?> +<!-- + ~ Copyright © Magento, Inc. All rights reserved. + ~ See COPYING.txt for license details. + --> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> + <system> + <section id="webapi" type="text" sortOrder="102" showInDefault="1" showInWebsite="1" showInStore="1"> + <group id="jwtauth" translate="label" type="text" sortOrder="260" showInDefault="1"> + <label>JWT Authentication</label> + <field id="jwt_alg" translate="label comment" type="select" sortOrder="1" showInDefault="1"> + <label>Algorithm to sign/encrypt JWTs used for authentication</label> + <source_model>Magento\JwtUserToken\Model\Config\JwtAlgorithmSource</source_model> + <comment>Selected algorithm will define JWT type used (JWS or JWE)</comment> + </field> + <field id="jwe_alg" translate="label comment" type="select" sortOrder="2" showInDefault="1"> + <label>Content encryption algorithm for JWEs</label> + <source_model>Magento\JwtUserToken\Model\Config\JweAlgorithmSource</source_model> + <comment>Encryption algorithm for JWT content to be used when JWE algorithm is selected</comment> + </field> + <field id="customer_expiration" translate="label comment" type="text" sortOrder="3" showInDefault="1"> + <label>Customer JWT Expires In</label> + <validate>validate-zero-or-greater validate-number</validate> + <comment>(minutes)</comment> + </field> + <field id="admin_expiration" translate="label comment" type="text" sortOrder="4" showInDefault="1"> + <label>Admin User JWT Expires In</label> + <validate>validate-zero-or-greater validate-number</validate> + <comment>(minutes)</comment> + </field> + </group> + </section> + </system> +</config> diff --git a/app/code/Magento/JwtUserToken/etc/config.xml b/app/code/Magento/JwtUserToken/etc/config.xml new file mode 100644 index 000000000000..71e744199b5d --- /dev/null +++ b/app/code/Magento/JwtUserToken/etc/config.xml @@ -0,0 +1,19 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> + <default> + <webapi> + <jwtauth> + <jwt_alg>HS256</jwt_alg> + <jwe_alg>A128GCM</jwe_alg> + <customer_expiration>60</customer_expiration> + <admin_expiration>60</admin_expiration> + </jwtauth> + </webapi> + </default> +</config> diff --git a/app/code/Magento/JwtUserToken/etc/db_schema.xml b/app/code/Magento/JwtUserToken/etc/db_schema.xml new file mode 100644 index 000000000000..0caf00293e84 --- /dev/null +++ b/app/code/Magento/JwtUserToken/etc/db_schema.xml @@ -0,0 +1,20 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd"> + <table name="jwt_auth_revoked" resource="default" engine="innodb" comment="Holds revoked JWT authentication data"> + <column xsi:type="int" name="user_type_id" unsigned="true" nullable="false" comment="User Type ID"/> + <column xsi:type="int" name="user_id" unsigned="true" nullable="false" comment="User ID"/> + <column xsi:type="bigint" name="revoke_before" nullable="false" unsigned="true" + comment="Not accepting tokens issued before this timestamp" /> + <constraint xsi:type="primary" referenceId="JWT_AUTH_REVOKED_USER"> + <column name="user_type_id" /> + <column name="user_id" /> + </constraint> + </table> +</schema> diff --git a/app/code/Magento/JwtUserToken/etc/db_schema_whitelist.json b/app/code/Magento/JwtUserToken/etc/db_schema_whitelist.json new file mode 100644 index 000000000000..c045d5461c8e --- /dev/null +++ b/app/code/Magento/JwtUserToken/etc/db_schema_whitelist.json @@ -0,0 +1,12 @@ +{ + "jwt_auth_revoked": { + "column": { + "user_type_id": true, + "user_id": true, + "revoke_before": true + }, + "constraint": { + "PRIMARY": true + } + } +} \ No newline at end of file diff --git a/app/code/Magento/JwtUserToken/etc/di.xml b/app/code/Magento/JwtUserToken/etc/di.xml new file mode 100644 index 000000000000..faa523aef102 --- /dev/null +++ b/app/code/Magento/JwtUserToken/etc/di.xml @@ -0,0 +1,27 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> + <preference for="Magento\Integration\Api\UserTokenIssuerInterface" type="Magento\JwtUserToken\Model\Issuer" /> + <preference for="Magento\Integration\Api\UserTokenReaderInterface" type="Magento\JwtUserToken\Model\Reader" /> + <preference for="Magento\Integration\Api\UserTokenRevokerInterface" type="Magento\JwtUserToken\Model\Revoker" /> + <preference for="Magento\JwtUserToken\Model\JwtSettingsProviderInterface" type="Magento\JwtUserToken\Model\ConfigurableJwtSettingsProvider" /> + <preference for="Magento\JwtUserToken\Api\ConfigReaderInterface" type="Magento\JwtUserToken\Model\Config\ConfigReader" /> + <type name="Magento\JwtUserToken\Model\ResourceModel\FastStorageRevokedWrapper"> + <arguments> + <argument name="slowRepo" xsi:type="object">Magento\JwtUserToken\Model\ResourceModel\RevokedRepository</argument> + </arguments> + </type> + <preference for="Magento\JwtUserToken\Api\RevokedRepositoryInterface" type="Magento\JwtUserToken\Model\ResourceModel\FastStorageRevokedWrapper" /> + <type name="Magento\Integration\Model\CompositeUserTokenValidator"> + <arguments> + <argument name="validators" xsi:type="array"> + <item name="jwt_revoked" xsi:type="object">Magento\JwtUserToken\Model\RevokedValidator</item> + </argument> + </arguments> + </type> +</config> diff --git a/app/code/Magento/JwtUserToken/etc/extension_attributes.xml b/app/code/Magento/JwtUserToken/etc/extension_attributes.xml new file mode 100644 index 000000000000..207d9106b892 --- /dev/null +++ b/app/code/Magento/JwtUserToken/etc/extension_attributes.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> + <extension_attributes for="Magento\Integration\Api\Data\UserTokenParametersInterface"> + <attribute code="jwt_params" type="Magento\JwtUserToken\Model\Data\JwtTokenParameters" /> + </extension_attributes> +</config> diff --git a/app/code/Magento/JwtUserToken/etc/module.xml b/app/code/Magento/JwtUserToken/etc/module.xml new file mode 100644 index 000000000000..b06d9355b751 --- /dev/null +++ b/app/code/Magento/JwtUserToken/etc/module.xml @@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> + <module name="Magento_JwtUserToken"> + <sequence> + <module name="Magento_Integration" /> + </sequence> + </module> +</config> diff --git a/app/code/Magento/JwtUserToken/registration.php b/app/code/Magento/JwtUserToken/registration.php new file mode 100644 index 000000000000..fab213695962 --- /dev/null +++ b/app/code/Magento/JwtUserToken/registration.php @@ -0,0 +1,9 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Framework\Component\ComponentRegistrar; + +ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_JwtUserToken', __DIR__); diff --git a/app/code/Magento/LayeredNavigation/README.md b/app/code/Magento/LayeredNavigation/README.md index 39c833488144..77f96ef0c564 100644 --- a/app/code/Magento/LayeredNavigation/README.md +++ b/app/code/Magento/LayeredNavigation/README.md @@ -1,2 +1,54 @@ -Magento_LayeredNavigation module introduces Layered Navigation UI for Catalog (faceted search). +# Magento_LayeredNavigation module + +This module introduces Layered Navigation UI for Catalog (faceted search). + This module can be removed from Magento installation without impact on the application. + +## Installation + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Extensibility + +Extension developers can interact with the Magento_LayeredNavigation module. For more information about the Magento extension mechanism, see [Magento plugins](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_LayeredNavigation module. + +### Layouts + +This module introduces the following layout handles in the `view/frontend/layout` directory: +- `catalog_category_view_type_layered` +- `catalog_category_view_type_layered_without_children` +- `catalogsearch_result_index` + +For more information about a layout in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). + +### UI components + +This module extends following ui components located in the `view/adminhtml/ui_component` directory: +- `product_attribute_add_form` +- `product_attributes_grid` +- `product_attributes_listing` + +For information about a UI component in Magento 2, see [Overview of UI components](http://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). + +### Public APIs + +- `\Magento\LayeredNavigation\Block\Navigation\FilterRendererInterface` + - render filter + +For information about a public API in Magento 2, see [Public interfaces & APIs](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/api-concepts.html). + +## Additional information + +### Page Layout +This module modifies the following page_layout in the `view/frontend.page_layout` directory: +- `1columns` - moves block `catalog.leftnav` into the `content.top` container +- `2columns-left` - moves block `catalog.leftnav` into the `sidebar.main"` container +- `2columns-right` - moves block `catalog.leftnav` into the `sidebar.main"` container +- `3columns` - moves block `catalog.leftnav` into the `sidebar.main"` container +- `empty` - moves block `catalog.leftnav` into the `category.product.list.additional` container + +More information can be found in: +- [Learn more about Layered Navigation](https://docs.magento.com/user-guide/catalog/navigation-layered.html) +- [Learn how to Configuring Layered Navigation](https://docs.magento.com/user-guide/catalog/navigation-layered-configuration.html) diff --git a/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobileTest.xml b/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobileTest.xml index 49f2294b978e..e8dcbec4fb3c 100644 --- a/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobileTest.xml +++ b/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobileTest.xml @@ -50,12 +50,8 @@ </actionGroup> <selectOption selector="{{AdminProductFormSection.customSelectField($$attribute.attribute[attribute_code]$$)}}" userInput="option1" stepKey="selectAttribute"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexAll"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexAll"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Check storefront mobile view for shop by button is functioning as expected --> <comment userInput="Check storefront mobile view for shop by button is functioning as expected" stepKey="commentCheckShopByButton" /> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> diff --git a/app/code/Magento/LoginAsCustomer/Model/AuthenticateCustomerBySecret.php b/app/code/Magento/LoginAsCustomer/Model/AuthenticateCustomerBySecret.php index 808b01bac58a..54d855bb2deb 100644 --- a/app/code/Magento/LoginAsCustomer/Model/AuthenticateCustomerBySecret.php +++ b/app/code/Magento/LoginAsCustomer/Model/AuthenticateCustomerBySecret.php @@ -39,7 +39,7 @@ class AuthenticateCustomerBySecret implements AuthenticateCustomerBySecretInterf /** * @param GetAuthenticationDataBySecretInterface $getAuthenticationDataBySecret * @param Session $customerSession - * @param SetLoggedAsCustomerAdminIdInterface $setLoggedAsCustomerAdminId + * @param SetLoggedAsCustomerAdminIdInterface|null $setLoggedAsCustomerAdminId */ public function __construct( GetAuthenticationDataBySecretInterface $getAuthenticationDataBySecret, @@ -57,7 +57,11 @@ public function __construct( */ public function execute(string $secret): void { - $authenticationData = $this->getAuthenticationDataBySecret->execute($secret); + try { + $authenticationData = $this->getAuthenticationDataBySecret->execute($secret); + } catch (LocalizedException $exception) { + throw new LocalizedException(__('Login was not successful.')); + } if ($this->customerSession->getId()) { $this->customerSession->logout(); @@ -67,7 +71,6 @@ public function execute(string $secret): void if (false === $result) { throw new LocalizedException(__('Login was not successful.')); } - $this->customerSession->regenerateId(); $this->setLoggedAsCustomerAdminId->execute($authenticationData->getAdminId()); } diff --git a/app/code/Magento/LoginAsCustomer/Model/GenerateAuthenticationSecret.php b/app/code/Magento/LoginAsCustomer/Model/GenerateAuthenticationSecret.php new file mode 100644 index 000000000000..56a6bf8e74bf --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Model/GenerateAuthenticationSecret.php @@ -0,0 +1,75 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\LoginAsCustomer\Model; + +use Magento\Framework\Encryption\EncryptorInterface; +use Magento\Framework\Serialize\SerializerInterface; +use Magento\Framework\Stdlib\DateTime\DateTime; +use Magento\LoginAsCustomerApi\Api\GenerateAuthenticationSecretInterface; +use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface; + +/** + * Generates authentication secret + */ +class GenerateAuthenticationSecret implements GenerateAuthenticationSecretInterface +{ + /**#@+ + * Constants + */ + private const CUSTOMER_ID = 'customer_id'; + private const ADMIN_ID = 'admin_id'; + private const TIME_STAMP = 'time_stamp'; + /**#@-*/ + + /** + * @var DateTime + */ + private $dateTime; + + /** + * @var EncryptorInterface + */ + private $encryptor; + + /** + * @var SerializerInterface + */ + private $serializer; + + /** + * @param DateTime $dateTime + * @param EncryptorInterface $encryptor + * @param SerializerInterface $serializer + */ + public function __construct( + DateTime $dateTime, + EncryptorInterface $encryptor, + SerializerInterface $serializer + ) { + $this->dateTime = $dateTime; + $this->encryptor = $encryptor; + $this->serializer = $serializer; + } + + /** + * @inheritdoc + */ + public function execute(AuthenticationDataInterface $authenticationData): string + { + $currentTimestamp = $this->dateTime->timestamp(); + $customerId = $authenticationData->getCustomerId(); + $adminId = $authenticationData->getAdminId(); + return $this->encryptor->encrypt($this->serializer->serialize( + [ + self::ADMIN_ID => $adminId, + self::CUSTOMER_ID => $customerId, + self::TIME_STAMP => $currentTimestamp + ] + )); + } +} diff --git a/app/code/Magento/LoginAsCustomer/Model/GetAuthenticationDataBySecret.php b/app/code/Magento/LoginAsCustomer/Model/GetAuthenticationDataBySecret.php new file mode 100644 index 000000000000..feafe8f71909 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Model/GetAuthenticationDataBySecret.php @@ -0,0 +1,96 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\LoginAsCustomer\Model; + +use Magento\Framework\Encryption\EncryptorInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Serialize\SerializerInterface; +use Magento\Framework\Stdlib\DateTime\DateTime; +use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface; +use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterfaceFactory; +use Magento\LoginAsCustomerApi\Api\GetAuthenticationDataBySecretInterface; + +/** + * @inheritdoc + */ +class GetAuthenticationDataBySecret implements GetAuthenticationDataBySecretInterface +{ + /**#@+ + * Constants + */ + private const CUSTOMER_ID = 'customer_id'; + private const ADMIN_ID = 'admin_id'; + private const TIME_STAMP = 'time_stamp'; + /**#@-*/ + + /** + * Duration in seconds the encrypted data is valid for + */ + private const DATA_LIFETIME = 10; + + /** + * @var DateTime + */ + private $dateTime; + + /** + * @var EncryptorInterface + */ + private $encryptor; + + /** + * @var SerializerInterface + */ + private $serializer; + + /** + * @var AuthenticationDataInterfaceFactory + */ + private $authenticationDataFactory; + + /** + * @param DateTime $dateTime + * @param EncryptorInterface $encryptor + * @param SerializerInterface $serializer + * @param AuthenticationDataInterfaceFactory $authenticationDataFactory + */ + public function __construct( + DateTime $dateTime, + EncryptorInterface $encryptor, + SerializerInterface $serializer, + AuthenticationDataInterfaceFactory $authenticationDataFactory + ) { + $this->dateTime = $dateTime; + $this->encryptor = $encryptor; + $this->serializer = $serializer; + $this->authenticationDataFactory = $authenticationDataFactory; + } + + /** + * @inheritdoc + */ + public function execute(string $secret): AuthenticationDataInterface + { + $data = $this->serializer->unserialize($this->encryptor->decrypt($secret)); + $currentTimestamp = $this->dateTime->timestamp(); + $authenticationDataLifeTime = $currentTimestamp - $data[self::TIME_STAMP]; + if (isset($data[self::ADMIN_ID]) + && isset($data[self::CUSTOMER_ID]) + && isset($data[self::TIME_STAMP]) + && $authenticationDataLifeTime < self::DATA_LIFETIME) { + return $this->authenticationDataFactory->create( + [ + 'customerId' => $data[self::CUSTOMER_ID], + 'adminId' => $data[self::ADMIN_ID], + ] + ); + } else { + throw new LocalizedException(__('Fail to get authentication data.')); + } + } +} diff --git a/app/code/Magento/LoginAsCustomer/Model/ResourceModel/DeleteAuthenticationDataForUser.php b/app/code/Magento/LoginAsCustomer/Model/ResourceModel/DeleteAuthenticationDataForUser.php index f023d08e4025..e1e0ddc9ef1c 100644 --- a/app/code/Magento/LoginAsCustomer/Model/ResourceModel/DeleteAuthenticationDataForUser.php +++ b/app/code/Magento/LoginAsCustomer/Model/ResourceModel/DeleteAuthenticationDataForUser.php @@ -8,8 +8,6 @@ namespace Magento\LoginAsCustomer\Model\ResourceModel; use Magento\Framework\App\ResourceConnection; -use Magento\Framework\Stdlib\DateTime\DateTime; -use Magento\LoginAsCustomerApi\Api\ConfigInterface; use Magento\LoginAsCustomerApi\Api\DeleteAuthenticationDataForUserInterface; /** @@ -22,29 +20,13 @@ class DeleteAuthenticationDataForUser implements DeleteAuthenticationDataForUser */ private $resourceConnection; - /** - * @var DateTime - */ - private $dateTime; - - /** - * @var ConfigInterface - */ - private $config; - /** * @param ResourceConnection $resourceConnection - * @param DateTime $dateTime - * @param ConfigInterface $config */ public function __construct( - ResourceConnection $resourceConnection, - DateTime $dateTime, - ConfigInterface $config + ResourceConnection $resourceConnection ) { $this->resourceConnection = $resourceConnection; - $this->dateTime = $dateTime; - $this->config = $config; } /** diff --git a/app/code/Magento/LoginAsCustomer/Model/ResourceModel/GetAuthenticationDataBySecret.php b/app/code/Magento/LoginAsCustomer/Model/ResourceModel/GetAuthenticationDataBySecret.php deleted file mode 100644 index 0c417f78800a..000000000000 --- a/app/code/Magento/LoginAsCustomer/Model/ResourceModel/GetAuthenticationDataBySecret.php +++ /dev/null @@ -1,107 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\LoginAsCustomer\Model\ResourceModel; - -use Magento\Framework\App\ObjectManager; -use Magento\Framework\App\ResourceConnection; -use Magento\Framework\Encryption\EncryptorInterface; -use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\Stdlib\DateTime\DateTime; -use Magento\LoginAsCustomerApi\Api\ConfigInterface; -use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface; -use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterfaceFactory; -use Magento\LoginAsCustomerApi\Api\GetAuthenticationDataBySecretInterface; - -/** - * @inheritdoc - */ -class GetAuthenticationDataBySecret implements GetAuthenticationDataBySecretInterface -{ - /** - * @var ResourceConnection - */ - private $resourceConnection; - - /** - * @var DateTime - */ - private $dateTime; - - /** - * @var ConfigInterface - */ - private $config; - - /** - * @var AuthenticationDataInterfaceFactory - */ - private $authenticationDataFactory; - - /** - * @var EncryptorInterface - */ - private $encryptor; - - /** - * @param ResourceConnection $resourceConnection - * @param DateTime $dateTime - * @param ConfigInterface $config - * @param AuthenticationDataInterfaceFactory $authenticationDataFactory - * @param EncryptorInterface|null $encryptor - */ - public function __construct( - ResourceConnection $resourceConnection, - DateTime $dateTime, - ConfigInterface $config, - AuthenticationDataInterfaceFactory $authenticationDataFactory, - ?EncryptorInterface $encryptor = null - ) { - $this->resourceConnection = $resourceConnection; - $this->dateTime = $dateTime; - $this->config = $config; - $this->authenticationDataFactory = $authenticationDataFactory; - $this->encryptor = $encryptor ?? ObjectManager::getInstance()->get(EncryptorInterface::class); - } - - /** - * @inheritdoc - */ - public function execute(string $secret): AuthenticationDataInterface - { - $connection = $this->resourceConnection->getConnection(); - $tableName = $this->resourceConnection->getTableName('login_as_customer'); - - $timePoint = date( - 'Y-m-d H:i:s', - $this->dateTime->gmtTimestamp() - $this->config->getAuthenticationDataExpirationTime() - ); - - $hash = $this->encryptor->hash($secret); - - $select = $connection->select() - ->from(['main_table' => $tableName]) - ->where('main_table.secret = ?', $hash) - ->where('main_table.created_at > ?', $timePoint); - - $data = $connection->fetchRow($select); - - if (!$data) { - throw new LocalizedException(__('Secret key is not found or was expired.')); - } - - /** @var AuthenticationDataInterface $authenticationData */ - $authenticationData = $this->authenticationDataFactory->create( - [ - 'customerId' => (int)$data['customer_id'], - 'adminId' => (int)$data['admin_id'], - 'extensionAttributes' => null, - ] - ); - return $authenticationData; - } -} diff --git a/app/code/Magento/LoginAsCustomer/Model/ResourceModel/SaveAuthenticationData.php b/app/code/Magento/LoginAsCustomer/Model/ResourceModel/SaveAuthenticationData.php index 10d110c8ddf0..76f3bfafb0b4 100644 --- a/app/code/Magento/LoginAsCustomer/Model/ResourceModel/SaveAuthenticationData.php +++ b/app/code/Magento/LoginAsCustomer/Model/ResourceModel/SaveAuthenticationData.php @@ -13,6 +13,7 @@ use Magento\Framework\Math\Random; use Magento\Framework\Stdlib\DateTime\DateTime; use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface; +use Magento\LoginAsCustomerApi\Api\GenerateAuthenticationSecretInterface; use Magento\LoginAsCustomerApi\Api\SaveAuthenticationDataInterface; /** @@ -40,22 +41,31 @@ class SaveAuthenticationData implements SaveAuthenticationDataInterface */ private $random; + /** + * @var GenerateAuthenticationSecretInterface + */ + private $generateAuthenticationSecret; + /** * @param ResourceConnection $resourceConnection * @param DateTime $dateTime * @param Random $random - * @param EncryptorInterface $encryptor + * @param EncryptorInterface|null $encryptor + * @param GenerateAuthenticationSecretInterface|null $generateAuthenticationSecret */ public function __construct( ResourceConnection $resourceConnection, DateTime $dateTime, Random $random, - ?EncryptorInterface $encryptor = null + ?EncryptorInterface $encryptor = null, + ?GenerateAuthenticationSecretInterface $generateAuthenticationSecret = null ) { $this->resourceConnection = $resourceConnection; $this->dateTime = $dateTime; $this->random = $random; $this->encryptor = $encryptor ?? ObjectManager::getInstance()->get(EncryptorInterface::class); + $this->generateAuthenticationSecret = $generateAuthenticationSecret + ?? ObjectManager::getInstance()->get(GenerateAuthenticationSecretInterface::class); } /** @@ -66,8 +76,8 @@ public function execute(AuthenticationDataInterface $authenticationData): string $connection = $this->resourceConnection->getConnection(); $tableName = $this->resourceConnection->getTableName('login_as_customer'); - $secret = $this->random->getRandomString(64); - $hash = $this->encryptor->hash($secret); + $key = $this->random->getRandomString(64); + $hash = $this->encryptor->hash($key); $connection->insert( $tableName, @@ -79,6 +89,6 @@ public function execute(AuthenticationDataInterface $authenticationData): string ] ); - return $secret; + return $this->generateAuthenticationSecret->execute($authenticationData); } } diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogFilterDatePickerTodayActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogFilterDatePickerTodayActionGroup.xml new file mode 100644 index 000000000000..3367f20fe304 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogFilterDatePickerTodayActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminLoginAsCustomerLogFilterDatePickerTodayActionGroup"> + <annotations> + <description>Filter Login as Customer Log grid by current day.</description> + </annotations> + <click selector="{{AdminLoginAsCustomerLogToolbarSection.filters}}" stepKey="clickFilters"/> + <click selector="{{AdminLoginAsCustomerLogToolbarSection.DatePickerFrom}}" stepKey="clickFromDate"/> + <click selector="{{AdminLoginAsCustomerLogToolbarSection.todayDate}}" stepKey="clickToToday"/> + <click selector="{{AdminLoginAsCustomerLogToolbarSection.DatePickerTo}}" stepKey="clickToDate"/> + <click selector="{{AdminLoginAsCustomerLogToolbarSection.todayDate}}" stepKey="clickTodayDateAgain"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml index 599a6f8f9e27..983aba6a9a0f 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml @@ -21,8 +21,9 @@ <click selector="{{AdminCustomerMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/> <see selector="{{AdminConfirmationModalSection.title}}" userInput="You are about to Login as Customer" stepKey="seeModal"/> - <see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in "Login as Customer" will affect actual customer data." stepKey="seeModalMessage"/> + <see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in "Login as Customer" will affect actual customer data." stepKey="seeModalMessage"/> <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickLogin"/> + <waitForPageLoad stepKey="waitForLoadingMaskToDisappear" /> <switchToNextTab stepKey="switchToNewTab"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.xml index dc953061ca43..ac827b03a771 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.xml @@ -24,6 +24,7 @@ <see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in "Login as Customer" will affect actual customer data." stepKey="seeModalMessage"/> <selectOption selector="{{AdminLoginAsCustomerConfirmationModalSection.store}}" userInput="{{storeName}}" stepKey="selectStore"/> <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickLogin"/> + <waitForPageLoad stepKey="waitForLoadingMaskToDisappear" /> <switchToNextTab stepKey="switchToNewTab"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml index a478f8e9d18c..e83f7539cc6a 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml @@ -21,8 +21,9 @@ <click selector="{{AdminOrderDetailsMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/> <see selector="{{AdminConfirmationModalSection.title}}" userInput="You are about to Login as Customer" stepKey="seeModal"/> - <see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in "Login as Customer" will affect actual customer data." stepKey="seeModalMessage"/> + <see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in "Login as Customer" will affect actual customer data." stepKey="seeModalMessage"/> <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickLogin"/> + <waitForPageLoad stepKey="waitForLoadingMaskToDisappear" /> <switchToNextTab stepKey="switchToNewTab"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAssistanceAllowedCheckboxCheckedActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAssistanceAllowedCheckboxCheckedActionGroup.xml new file mode 100644 index 000000000000..bff81d0e3a05 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAssistanceAllowedCheckboxCheckedActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontAssertLoginAssistanceAllowedCheckboxCheckedActionGroup"> + <annotations> + <description>Verify "Allow remote shopping assistance" checkbox present on page and checked.</description> + </annotations> + + <waitForElement selector="{{StorefrontCustomerAccountInformationSection.allowAssistance}}" stepKey="waitForAllowAssistanceCheckbox"/> + <seeCheckboxIsChecked selector="{{StorefrontCustomerAccountInformationSection.allowAssistance}}" + stepKey="assertAllowAssistanceCheckboxChecked"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAssistanceAllowedCheckboxUncheckedActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAssistanceAllowedCheckboxUncheckedActionGroup.xml new file mode 100644 index 000000000000..1b74eba6aba3 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAssistanceAllowedCheckboxUncheckedActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontAssertLoginAssistanceAllowedCheckboxUncheckedActionGroup"> + <annotations> + <description>Verify "Allow remote shopping assistance" checkbox present on page and unchecked.</description> + </annotations> + + <waitForElement selector="{{StorefrontCustomerAccountInformationSection.allowAssistance}}" stepKey="waitForAllowAssistanceCheckbox"/> + <dontSeeCheckboxIsChecked selector="{{StorefrontCustomerAccountInformationSection.allowAssistance}}" + stepKey="assertAllowAssistanceCheckboxUnchecked"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.xml index a917ab6acb18..c2d501793521 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.xml @@ -7,7 +7,7 @@ --> <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:/Page/etc/PageObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="AdminLoginAsCustomerLogPage" url="loginascustomer_log/log/index/" area="admin" module="Magento_LoginAsCustomer"> <section name="AdminLoginAsCustomerLogToolbarSection"/> <section name="AdminLoginAsCustomerLogFiltersSection"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLoginManualPage.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLoginManualPage.xml index ddb87ba83bc3..f7b213fe38df 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLoginManualPage.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLoginManualPage.xml @@ -7,7 +7,7 @@ --> <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:/Page/etc/PageObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="AdminLoginAsCustomerLoginManualPage" url="loginascustomer/login/manual/entity_id/{{id}}/" area="storefront" module="Magento_LoginAsCustomer" parameterized="true"> <section name="AdminLoginAsCustomerLoginManualActionsSection"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/StorefrontLoginAsCustomerLoginProceedPage.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/StorefrontLoginAsCustomerLoginProceedPage.xml index 05af5f506112..6c8ec8a86b2c 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/StorefrontLoginAsCustomerLoginProceedPage.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/StorefrontLoginAsCustomerLoginProceedPage.xml @@ -7,6 +7,6 @@ --> <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:/Page/etc/PageObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="StorefrontLoginAsCustomerLoginProceedPage" url="loginascustomer/login/proceed" area="storefront" module="Magento_LoginAsCustomer"/> </pages> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogToolbarSection.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogToolbarSection.xml index a403367ee0d0..fdb684db8c80 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogToolbarSection.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogToolbarSection.xml @@ -10,7 +10,11 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminLoginAsCustomerLogToolbarSection"> <element name="search" type="button" selector="button[data-action='grid-filter-apply']"/> - <element name="resetFilter" type="button" selector="button[data-action='grid-filter-reset']"/> + <element name="filters" type="button" selector="button[data-action='grid-filter-expand']"/> + <element name="resetFilter" type="button" selector="button[data-action='grid-filter-reset']" timeout="15"/> + <element name="DatePickerFrom" type="button" selector="[name='time[from]'] + button" timeout="15"/> + <element name="DatePickerTo" type="button" selector="[name='time[to]'] + button" timeout="15"/> + <element name="todayDate" type="button" selector=".ui-datepicker-today"/> </section> </sections> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml new file mode 100644 index 000000000000..625e474d5f01 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontCustomerAccountInformationSection"> + <element name="allowAssistance" type="checkbox" selector=".form-edit-account input[name='assistance_allowed_checkbox']"/> + </section> +</sections> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAssistanceCheckboxTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAssistanceCheckboxTest.xml new file mode 100644 index 000000000000..13b93f930b00 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAssistanceCheckboxTest.xml @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminLoginAsCustomerAssistanceCheckboxTest"> + <annotations> + <features value="Login as Customer"/> + <stories value="Opt in/out"/> + <title value="Login as Customer assistance checkbox test"/> + <description + value="Verify that 'Allow remote shopping assistance' checkbox is present on Edit Account Information page"/> + <severity value="CRITICAL"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> + <createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createFirstCustomer"/> + <createData entity="Simple_US_Customer" stepKey="createSecondCustomer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultUser"/> + </before> + <after> + <deleteData createDataKey="createFirstCustomer" stepKey="deleteFirstCustomer"/> + <deleteData createDataKey="createSecondCustomer" stepKey="deleteSecondCustomer"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAfter"/> + </after> + <!-- Login into First Customer account --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsFirstCustomer"> + <argument name="Customer" value="$createFirstCustomer$"/> + </actionGroup> + + <!-- Open My Account > Order by SKU --> + <actionGroup ref="StorefrontOpenMyAccountPageActionGroup" stepKey="goToFirstMyAccountPage"/> + <actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="openFirstAccountInformation"> + <argument name="menu" value="Account Information"/> + </actionGroup> + + <!-- Assert Assistance checkbox is present and checked --> + <actionGroup ref="StorefrontAssertLoginAssistanceAllowedCheckboxCheckedActionGroup" + stepKey="assertAssistanceAllowedCheckboxChecked"/> + + <!-- Logout customer --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutFirstCustomer"/> + + <!-- Login into Second Customer account --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsSecondCustomer"> + <argument name="Customer" value="$createSecondCustomer$"/> + </actionGroup> + + <!-- Open My Account > Order by SKU --> + <actionGroup ref="StorefrontOpenMyAccountPageActionGroup" stepKey="goToSecondMyAccountPage"/> + <actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="openSecondAccountInformation"> + <argument name="menu" value="Account Information"/> + </actionGroup> + + <!-- Assert Assistance checkbox is present and unchecked --> + <actionGroup ref="StorefrontAssertLoginAssistanceAllowedCheckboxUncheckedActionGroup" + stepKey="assertAssistanceAllowedCheckboxUnchecked"/> + </test> +</tests> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingFilterTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingFilterTest.xml new file mode 100644 index 000000000000..592390c43bce --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingFilterTest.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminLoginAsCustomerLoggingFilterTest"> + <annotations> + <features value="Login as Customer logs"/> + <stories value="Filter by date login as customer logs"/> + <title value="Filter by date login as customer logs"/> + <description value="Filter by date should be from/to"/> + <severity value="AVERAGE"/> + <group value="login_as_customer"/> + <testCaseId value="MC-38920"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> + <createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createFirstCustomer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultUser"/> + </before> + <after> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilterAfter"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsDefaultAdmin"/> + <deleteData createDataKey="createFirstCustomer" stepKey="deleteFirstCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + </after> + <!-- Login into First Customer account --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" + stepKey="loginAsFirstCustomerByDefaultAdmin"> + <argument name="customerId" value="$$createFirstCustomer.id$$"/> + </actionGroup> + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutFirstCustomerDefaultAdmin"/> + <!-- Navigate to Login as Customer Log page --> + <actionGroup ref="AdminOpenLoginAsCustomerLogActionGroup" stepKey="gotoLoginAsCustomerLog"/> + <!-- Setup date filters --> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> + <actionGroup ref="AdminLoginAsCustomerLogFilterDatePickerTodayActionGroup" stepKey="filterByToday"/> + <!-- Perform assertions --> + <actionGroup ref="AdminAssertLoginAsCustomerLogRecordActionGroup" stepKey="verifyDefaultAdminFirstCustomerLogRecord"> + <argument name="rowNumber" value="1"/> + <argument name="adminId" value="1"/> + <argument name="customerId" value="$$createFirstCustomer.id$$"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml index 8afaaabbc92b..548f3637b597 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml @@ -70,7 +70,7 @@ <!-- Place Order as Customer --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> - <argument name="productUrl" value="$$createProduct.sku$$"/> + <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> </actionGroup> <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml index 8bef9fce9995..4ddf500dec37 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml @@ -69,7 +69,7 @@ <!-- Place Order as Customer --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> - <argument name="productUrl" value="$$createProduct.sku$$"/> + <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> </actionGroup> <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.xml index 02a96df93eae..b3297f6bb000 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.xml @@ -29,9 +29,7 @@ </createData> <createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createCustomer"/> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCachesAfterSet"> <argument name="tags" value="config full_page"/> </actionGroup> @@ -44,9 +42,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexAfter"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexAfter"/> <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCachesDefault"> <argument name="tags" value="config full_page"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerBannerPresentOnAllPagesInSessionTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerBannerPresentOnAllPagesInSessionTest.xml index 38e89050c275..3811a1aa9fd5 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerBannerPresentOnAllPagesInSessionTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerBannerPresentOnAllPagesInSessionTest.xml @@ -20,9 +20,7 @@ <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushConfigCache"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> @@ -40,9 +38,7 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushConfigCache"/> </after> <!-- Admin Login as Customer from Customer page and assert notification banner --> @@ -61,7 +57,7 @@ </actionGroup> <!-- Go to category page and assert notification banner --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage"/> <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBannerOnCategoryPage"> <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerSeeSpecialPriceOnCategoryTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerSeeSpecialPriceOnCategoryTest.xml index c0d7d26816fa..2b909d6ba254 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerSeeSpecialPriceOnCategoryTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerSeeSpecialPriceOnCategoryTest.xml @@ -20,9 +20,7 @@ <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushConfigCache"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> @@ -46,9 +44,7 @@ <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushConfigCache"/> </after> <!-- Creating a new catalog price rule with 50 percent discount for Retailer customer group --> @@ -63,12 +59,8 @@ <!-- Save and apply the new catalog price rule --> <actionGroup ref="SaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Admin Login as Customer --> <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="loginAsCustomerFromCustomerPage"> @@ -79,7 +71,7 @@ </actionGroup> <!-- Check simple product prices on store front category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage"/> <actionGroup ref="AssertProductDetailsOnStorefrontActionGroup" stepKey="storefrontProduct1Price"> <argument name="productInfo" value="$5.00"/> <argument name="productNumber" value="1"/> @@ -91,7 +83,7 @@ <!-- Place order --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> - <argument name="productUrl" value="$$createProduct.sku$$"/> + <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> </actionGroup> <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerShoppingCartIsNotMergedWithGuestCartTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerShoppingCartIsNotMergedWithGuestCartTest.xml index b2c7c6c35db1..97e3cac9f4ec 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerShoppingCartIsNotMergedWithGuestCartTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerShoppingCartIsNotMergedWithGuestCartTest.xml @@ -20,9 +20,7 @@ <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushConfigCache"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> @@ -39,9 +37,7 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushConfigCache"/> </after> <!-- Add product to guest cart --> diff --git a/app/code/Magento/LoginAsCustomer/etc/config.xml b/app/code/Magento/LoginAsCustomer/etc/config.xml index 7e39cc39145e..0532bb9912c2 100644 --- a/app/code/Magento/LoginAsCustomer/etc/config.xml +++ b/app/code/Magento/LoginAsCustomer/etc/config.xml @@ -12,7 +12,6 @@ <general> <enabled>1</enabled> <store_view_manual_choice_enabled>0</store_view_manual_choice_enabled> - <authentication_data_expiration_time>60</authentication_data_expiration_time> </general> </login_as_customer> </default> diff --git a/app/code/Magento/LoginAsCustomer/etc/di.xml b/app/code/Magento/LoginAsCustomer/etc/di.xml index 9927237c51db..e13fc15bf402 100755 --- a/app/code/Magento/LoginAsCustomer/etc/di.xml +++ b/app/code/Magento/LoginAsCustomer/etc/di.xml @@ -9,10 +9,12 @@ xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface" type="Magento\LoginAsCustomer\Model\AuthenticationData"/> + <preference for="Magento\LoginAsCustomerApi\Api\GenerateAuthenticationSecretInterface" + type="Magento\LoginAsCustomer\Model\GenerateAuthenticationSecret"/> <preference for="Magento\LoginAsCustomerApi\Api\SaveAuthenticationDataInterface" type="Magento\LoginAsCustomer\Model\ResourceModel\SaveAuthenticationData"/> <preference for="Magento\LoginAsCustomerApi\Api\GetAuthenticationDataBySecretInterface" - type="Magento\LoginAsCustomer\Model\ResourceModel\GetAuthenticationDataBySecret"/> + type="Magento\LoginAsCustomer\Model\GetAuthenticationDataBySecret"/> <preference for="Magento\LoginAsCustomerApi\Api\AuthenticateCustomerBySecretInterface" type="Magento\LoginAsCustomer\Model\AuthenticateCustomerBySecret"/> <preference for="Magento\LoginAsCustomerApi\Api\DeleteAuthenticationDataForUserInterface" diff --git a/app/code/Magento/LoginAsCustomerAdminUi/Controller/Adminhtml/Login/Login.php b/app/code/Magento/LoginAsCustomerAdminUi/Controller/Adminhtml/Login/Login.php index e80c3700349d..25e6053e685c 100644 --- a/app/code/Magento/LoginAsCustomerAdminUi/Controller/Adminhtml/Login/Login.php +++ b/app/code/Magento/LoginAsCustomerAdminUi/Controller/Adminhtml/Login/Login.php @@ -11,10 +11,11 @@ use Magento\Backend\App\Action\Context; use Magento\Backend\Model\Auth\Session; use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Customer\Model\Config\Share; use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Framework\App\ObjectManager; -use Magento\Framework\Controller\Result\Redirect; +use Magento\Framework\Controller\Result\Json as JsonResult; use Magento\Framework\Controller\ResultFactory; use Magento\Framework\Controller\ResultInterface; use Magento\Framework\Exception\LocalizedException; @@ -27,6 +28,7 @@ use Magento\LoginAsCustomerApi\Api\IsLoginAsCustomerEnabledForCustomerInterface; use Magento\LoginAsCustomerApi\Api\SaveAuthenticationDataInterface; use Magento\LoginAsCustomerApi\Api\SetLoggedAsCustomerCustomerIdInterface; +use Magento\LoginAsCustomerApi\Api\GenerateAuthenticationSecretInterface; use Magento\Store\Model\StoreManagerInterface; use Magento\Store\Model\StoreSwitcher\ManageStoreCookie; @@ -36,7 +38,7 @@ * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Login extends Action implements HttpGetActionInterface +class Login extends Action implements HttpPostActionInterface { /** * Authorization level of a basic admin session @@ -105,6 +107,11 @@ class Login extends Action implements HttpGetActionInterface */ private $isLoginAsCustomerEnabled; + /** + * @var GenerateAuthenticationSecretInterface + */ + private $generateAuthenticationSecret; + /** * @param Context $context * @param Session $authSession @@ -115,11 +122,11 @@ class Login extends Action implements HttpGetActionInterface * @param SaveAuthenticationDataInterface $saveAuthenticationData * @param DeleteAuthenticationDataForUserInterface $deleteAuthenticationDataForUser * @param Url $url - * @param Share $share - * @param ManageStoreCookie $manageStoreCookie - * @param SetLoggedAsCustomerCustomerIdInterface $setLoggedAsCustomerCustomerId - * @param IsLoginAsCustomerEnabledForCustomerInterface $isLoginAsCustomerEnabled - * + * @param Share|null $share + * @param ManageStoreCookie|null $manageStoreCookie + * @param SetLoggedAsCustomerCustomerIdInterface|null $setLoggedAsCustomerCustomerId + * @param IsLoginAsCustomerEnabledForCustomerInterface|null $isLoginAsCustomerEnabled + * @param GenerateAuthenticationSecretInterface|null $generateAuthenticationSecret * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -135,7 +142,8 @@ public function __construct( ?Share $share = null, ?ManageStoreCookie $manageStoreCookie = null, ?SetLoggedAsCustomerCustomerIdInterface $setLoggedAsCustomerCustomerId = null, - ?IsLoginAsCustomerEnabledForCustomerInterface $isLoginAsCustomerEnabled = null + ?IsLoginAsCustomerEnabledForCustomerInterface $isLoginAsCustomerEnabled = null, + ?GenerateAuthenticationSecretInterface $generateAuthenticationSecret = null ) { parent::__construct($context); @@ -153,6 +161,8 @@ public function __construct( ?? ObjectManager::getInstance()->get(SetLoggedAsCustomerCustomerIdInterface::class); $this->isLoginAsCustomerEnabled = $isLoginAsCustomerEnabled ?? ObjectManager::getInstance()->get(IsLoginAsCustomerEnabledForCustomerInterface::class); + $this->generateAuthenticationSecret = $generateAuthenticationSecret + ?? ObjectManager::getInstance()->get(GenerateAuthenticationSecretInterface::class); } /** @@ -164,8 +174,7 @@ public function __construct( */ public function execute(): ResultInterface { - /** @var Redirect $resultRedirect */ - $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); + $messages = []; $customerId = (int)$this->_request->getParam('customer_id'); if (!$customerId) { @@ -175,24 +184,24 @@ public function execute(): ResultInterface $isLoginAsCustomerEnabled = $this->isLoginAsCustomerEnabled->execute($customerId); if (!$isLoginAsCustomerEnabled->isEnabled()) { foreach ($isLoginAsCustomerEnabled->getMessages() as $message) { - $this->messageManager->addErrorMessage(__($message)); + $messages[] = __($message); } - return $resultRedirect->setPath('customer/index/index'); + return $this->prepareJsonResult($messages); } try { $customer = $this->customerRepository->getById($customerId); } catch (NoSuchEntityException $e) { - $this->messageManager->addErrorMessage('Customer with this ID are no longer exist.'); - return $resultRedirect->setPath('customer/index/index'); + $messages[] = __('Customer with this ID no longer exists.'); + return $this->prepareJsonResult($messages); } if ($this->config->isStoreManualChoiceEnabled()) { $storeId = (int)$this->_request->getParam('store_id'); if (empty($storeId)) { - $this->messageManager->addNoticeMessage(__('Please select a Store to login in.')); - return $resultRedirect->setPath('customer/index/edit', ['id' => $customerId]); + $messages[] = __('Please select a Store View to login in.'); + return $this->prepareJsonResult($messages); } } elseif ($this->share->isGlobalScope()) { $storeId = (int)$this->storeManager->getDefaultStoreView()->getId(); @@ -213,12 +222,13 @@ public function execute(): ResultInterface ); $this->deleteAuthenticationDataForUser->execute($userId); - $secret = $this->saveAuthenticationData->execute($authenticationData); + $this->saveAuthenticationData->execute($authenticationData); $this->setLoggedAsCustomerCustomerId->execute($customerId); + $secret = $this->generateAuthenticationSecret->execute($authenticationData); $redirectUrl = $this->getLoginProceedRedirectUrl($secret, $storeId); - $resultRedirect->setUrl($redirectUrl); - return $resultRedirect; + + return $this->prepareJsonResult($messages, $redirectUrl); } /** @@ -232,10 +242,10 @@ public function execute(): ResultInterface private function getLoginProceedRedirectUrl(string $secret, int $storeId): string { $targetStore = $this->storeManager->getStore($storeId); - + $queryParameters = ['secret' => $secret]; $redirectUrl = $this->url ->setScope($targetStore) - ->getUrl('loginascustomer/login/index', ['secret' => $secret, '_nosid' => true]); + ->getUrl('loginascustomer/login/index', ['_query' => $queryParameters, '_nosid' => true]); if (!$targetStore->isUseStoreInUrl()) { $fromStore = $this->storeManager->getStore(); @@ -244,4 +254,24 @@ private function getLoginProceedRedirectUrl(string $secret, int $storeId): strin return $redirectUrl; } + + /** + * Prepare JSON result + * + * @param array $messages + * @param string|null $redirectUrl + * @return JsonResult + */ + private function prepareJsonResult(array $messages, ?string $redirectUrl = null) + { + /** @var JsonResult $jsonResult */ + $jsonResult = $this->resultFactory->create(ResultFactory::TYPE_JSON); + + $jsonResult->setData([ + 'redirectUrl' => $redirectUrl, + 'messages' => $messages, + ]); + + return $jsonResult; + } } diff --git a/app/code/Magento/LoginAsCustomerAdminUi/Plugin/Button/ToolbarPlugin.php b/app/code/Magento/LoginAsCustomerAdminUi/Plugin/Button/ToolbarPlugin.php index 2cdcd5723df4..8bab73963e88 100644 --- a/app/code/Magento/LoginAsCustomerAdminUi/Plugin/Button/ToolbarPlugin.php +++ b/app/code/Magento/LoginAsCustomerAdminUi/Plugin/Button/ToolbarPlugin.php @@ -78,7 +78,7 @@ public function beforePushButtons( if ($order && !empty($order['customer_id']) && $this->config->isEnabled() - && $this->authorization->isAllowed('Magento_LoginAsCustomer::login_button') + && $this->authorization->isAllowed('Magento_LoginAsCustomer::login') ) { $customerId = (int)$order['customer_id']; $buttonList->add( diff --git a/app/code/Magento/LoginAsCustomerAdminUi/Ui/Customer/Component/Control/LoginAsCustomerButton.php b/app/code/Magento/LoginAsCustomerAdminUi/Ui/Customer/Component/Control/LoginAsCustomerButton.php index ab43fca3d447..73d756f80c51 100644 --- a/app/code/Magento/LoginAsCustomerAdminUi/Ui/Customer/Component/Control/LoginAsCustomerButton.php +++ b/app/code/Magento/LoginAsCustomerAdminUi/Ui/Customer/Component/Control/LoginAsCustomerButton.php @@ -61,7 +61,7 @@ public function getButtonData(): array { $customerId = (int)$this->getCustomerId(); $data = []; - $isAllowed = $customerId && $this->authorization->isAllowed('Magento_LoginAsCustomer::login_button'); + $isAllowed = $customerId && $this->authorization->isAllowed('Magento_LoginAsCustomer::login'); $isEnabled = $this->config->isEnabled(); if ($isAllowed && $isEnabled) { $data = $this->dataProvider->getData($customerId); diff --git a/app/code/Magento/LoginAsCustomerAdminUi/etc/acl.xml b/app/code/Magento/LoginAsCustomerAdminUi/etc/acl.xml index f49526f6bbb0..943bad2bf323 100644 --- a/app/code/Magento/LoginAsCustomerAdminUi/etc/acl.xml +++ b/app/code/Magento/LoginAsCustomerAdminUi/etc/acl.xml @@ -10,9 +10,7 @@ <resources> <resource id="Magento_Backend::admin"> <resource id="Magento_Customer::customer"> - <resource id="Magento_LoginAsCustomer::login" title="Login as Customer" sortOrder="50"> - <resource id="Magento_LoginAsCustomer::login_button" title="Allow Login as Customer Button" sortOrder="10" /> - </resource> + <resource id="Magento_LoginAsCustomer::login" title="Login as Customer" sortOrder="50"/> </resource> <resource id="Magento_Backend::stores"> <resource id="Magento_Backend::stores_settings"> diff --git a/app/code/Magento/LoginAsCustomerAdminUi/view/adminhtml/web/js/confirmation-popup.js b/app/code/Magento/LoginAsCustomerAdminUi/view/adminhtml/web/js/confirmation-popup.js index 248b0eea1ca0..0145fd73bd6b 100644 --- a/app/code/Magento/LoginAsCustomerAdminUi/view/adminhtml/web/js/confirmation-popup.js +++ b/app/code/Magento/LoginAsCustomerAdminUi/view/adminhtml/web/js/confirmation-popup.js @@ -10,8 +10,10 @@ define([ 'ko', 'mage/translate', 'mage/template', + 'underscore', + 'Magento_Ui/js/modal/alert', 'text!Magento_LoginAsCustomerAdminUi/template/confirmation-popup/store-view-ptions.html' -], function (Component, confirm, $, ko, $t, template, selectTpl) { +], function (Component, confirm, $, ko, $t, template, _, alert, selectTpl) { 'use strict'; @@ -55,13 +57,63 @@ define([ * Confirm action. */ confirm: function () { - var storeId = $('#lac-confirmation-popup-store-id').val(); + var storeId = $('#lac-confirmation-popup-store-id').val(), + formKey = $('input[name="form_key"]').val(), + params = {}; + // jscs:disable requireCamelCaseOrUpperCaseIdentifiers if (storeId) { - url += url.indexOf('?') === -1 ? '?' : '&'; - url += 'store_id=' + storeId; + params.store_id = storeId; } - window.open(url); + + if (formKey) { + params.form_key = formKey; + } + // jscs:enable requireCamelCaseOrUpperCaseIdentifiers + + $.ajax({ + url: url, + type: 'POST', + dataType: 'json', + data: params, + showLoader: true, + + /** + * Open redirect URL in new window, or show messages if they are present + * + * @param {Object} data + */ + success: function (data) { + var messages = data.messages || []; + + if (data.message) { + messages.push(data.message); + } + + if (data.redirectUrl) { + window.open(data.redirectUrl); + } else if (messages.length) { + messages = messages.map(function (message) { + return _.escape(message); + }); + + alert({ + content: messages.join('<br>') + }); + } + }, + + /** + * Show XHR response text + * + * @param {Object} jqXHR + */ + error: function (jqXHR) { + alert({ + content: _.escape(jqXHR.responseText) + }); + } + }); } }, buttons: [{ diff --git a/app/code/Magento/LoginAsCustomerApi/Api/ConfigInterface.php b/app/code/Magento/LoginAsCustomerApi/Api/ConfigInterface.php index 7048fa5a9e41..97db22e62b5b 100644 --- a/app/code/Magento/LoginAsCustomerApi/Api/ConfigInterface.php +++ b/app/code/Magento/LoginAsCustomerApi/Api/ConfigInterface.php @@ -36,6 +36,7 @@ public function isStoreManualChoiceEnabled(): bool; * * @return int * @since 100.4.0 + * @deprecated */ public function getAuthenticationDataExpirationTime(): int; } diff --git a/app/code/Magento/LoginAsCustomerApi/Api/GenerateAuthenticationSecretInterface.php b/app/code/Magento/LoginAsCustomerApi/Api/GenerateAuthenticationSecretInterface.php new file mode 100644 index 000000000000..5c29dab95bc7 --- /dev/null +++ b/app/code/Magento/LoginAsCustomerApi/Api/GenerateAuthenticationSecretInterface.php @@ -0,0 +1,24 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\LoginAsCustomerApi\Api; + +use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface; + +/** + * Generate authentication secret + */ +interface GenerateAuthenticationSecretInterface +{ + /** + * Generate authentication secret + * + * @param AuthenticationDataInterface $authenticationData + * @return string authentication secret + */ + public function execute(AuthenticationDataInterface $authenticationData): string; +} diff --git a/app/code/Magento/LoginAsCustomerAssistance/etc/acl.xml b/app/code/Magento/LoginAsCustomerAssistance/etc/acl.xml index fd16eb2e51b0..91f66be478a9 100644 --- a/app/code/Magento/LoginAsCustomerAssistance/etc/acl.xml +++ b/app/code/Magento/LoginAsCustomerAssistance/etc/acl.xml @@ -10,8 +10,10 @@ <resources> <resource id="Magento_Backend::admin"> <resource id="Magento_Customer::customer"> - <resource id="Magento_LoginAsCustomer::login" title="Login as Customer"> - <resource id="Magento_LoginAsCustomer::allow_shopping_assistance" title="Allow remote shopping assistance" sortOrder="20" /> + <resource id="Magento_Customer::manage"> + <resource id="Magento_Customer::actions"> + <resource id="Magento_LoginAsCustomer::allow_shopping_assistance" title="Remote shopping assistance opt-in" sortOrder="40" /> + </resource> </resource> </resource> </resource> diff --git a/app/code/Magento/LoginAsCustomerAssistance/etc/db_schema.xml b/app/code/Magento/LoginAsCustomerAssistance/etc/db_schema.xml index deaecc2bfb77..83a21b51a78d 100644 --- a/app/code/Magento/LoginAsCustomerAssistance/etc/db_schema.xml +++ b/app/code/Magento/LoginAsCustomerAssistance/etc/db_schema.xml @@ -12,7 +12,7 @@ <constraint xsi:type="foreign" referenceId="LOGIN_AS_CUSTOMER_ASSISTANCE_ALLOWED_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID" table="login_as_customer_assistance_allowed" column="customer_id" referenceTable="customer_entity" referenceColumn="entity_id" onDelete="CASCADE"/> - <constraint xsi:type="unique" referenceId="LOGIN_AS_CUSTOMER_ASSISTANCE_ALLOWED_CUSTOMER_ID"> + <constraint xsi:type="primary" referenceId="LOGIN_AS_CUSTOMER_ASSISTANCE_ALLOWED_CUSTOMER_ID"> <column name="customer_id"/> </constraint> </table> diff --git a/app/code/Magento/LoginAsCustomerAssistance/etc/db_schema_whitelist.json b/app/code/Magento/LoginAsCustomerAssistance/etc/db_schema_whitelist.json index 2c8aa79f3c7b..e50bd20264db 100644 --- a/app/code/Magento/LoginAsCustomerAssistance/etc/db_schema_whitelist.json +++ b/app/code/Magento/LoginAsCustomerAssistance/etc/db_schema_whitelist.json @@ -4,8 +4,9 @@ "customer_id": true }, "constraint": { + "PRIMARY": true, "LOGIN_AS_CSTR_ASSISTANCE_ALLOWED_CSTR_ID_CSTR_ENTT_ENTT_ID": true, "LOGIN_AS_CUSTOMER_ASSISTANCE_ALLOWED_CUSTOMER_ID": true } } -} \ No newline at end of file +} diff --git a/app/code/Magento/LoginAsCustomerFrontendUi/Controller/Login/Index.php b/app/code/Magento/LoginAsCustomerFrontendUi/Controller/Login/Index.php index e766f0c5e870..2f529b02637d 100644 --- a/app/code/Magento/LoginAsCustomerFrontendUi/Controller/Login/Index.php +++ b/app/code/Magento/LoginAsCustomerFrontendUi/Controller/Login/Index.php @@ -8,12 +8,13 @@ namespace Magento\LoginAsCustomerFrontendUi\Controller\Login; use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Model\Session; +use Magento\Framework\App\ObjectManager; use Magento\Framework\App\RequestInterface; use Magento\Framework\Controller\Result\Redirect; use Magento\Framework\Controller\ResultFactory; use Magento\Framework\Controller\ResultInterface; use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Framework\Message\ManagerInterface; use Magento\LoginAsCustomerApi\Api\GetAuthenticationDataBySecretInterface; @@ -37,11 +38,13 @@ class Index implements HttpGetActionInterface /** * @var CustomerRepositoryInterface + * @deprecated */ private $customerRepository; /** * @var GetAuthenticationDataBySecretInterface + * @deprecated */ private $getAuthenticationDataBySecret; @@ -60,6 +63,11 @@ class Index implements HttpGetActionInterface */ private $logger; + /** + * @var Session + */ + private $customerSession; + /** * @param ResultFactory $resultFactory * @param RequestInterface $request @@ -68,6 +76,7 @@ class Index implements HttpGetActionInterface * @param AuthenticateCustomerBySecretInterface $authenticateCustomerBySecret * @param ManagerInterface $messageManager * @param LoggerInterface $logger + * @param Session|null $customerSession */ public function __construct( ResultFactory $resultFactory, @@ -76,7 +85,8 @@ public function __construct( GetAuthenticationDataBySecretInterface $getAuthenticationDataBySecret, AuthenticateCustomerBySecretInterface $authenticateCustomerBySecret, ManagerInterface $messageManager, - LoggerInterface $logger + LoggerInterface $logger, + Session $customerSession = null ) { $this->resultFactory = $resultFactory; $this->request = $request; @@ -85,6 +95,7 @@ public function __construct( $this->authenticateCustomerBySecret = $authenticateCustomerBySecret; $this->messageManager = $messageManager; $this->logger = $logger; + $this->customerSession = $customerSession ?? ObjectManager::getInstance()->get(Session::class); } /** @@ -97,22 +108,10 @@ public function execute(): ResultInterface /** @var Redirect $resultRedirect */ $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); + $secret = $this->request->getParam('secret'); try { - $secret = $this->request->getParam('secret'); - if (empty($secret) || !is_string($secret)) { - throw new LocalizedException(__('Cannot login to account. No secret key provided.')); - } - - $authenticationData = $this->getAuthenticationDataBySecret->execute($secret); - - try { - $customer = $this->customerRepository->getById($authenticationData->getCustomerId()); - } catch (NoSuchEntityException $e) { - throw new LocalizedException(__('Customer are no longer exist.')); - } - $this->authenticateCustomerBySecret->execute($secret); - + $customer = $this->customerSession->getCustomer(); $this->messageManager->addSuccessMessage( __('You are logged in as customer: %1', $customer->getFirstname() . ' ' . $customer->getLastname()) ); diff --git a/app/code/Magento/LoginAsCustomerLog/view/adminhtml/ui_component/login_as_customer_log_listing.xml b/app/code/Magento/LoginAsCustomerLog/view/adminhtml/ui_component/login_as_customer_log_listing.xml index fdd1bf55c91b..29c53f37746f 100644 --- a/app/code/Magento/LoginAsCustomerLog/view/adminhtml/ui_component/login_as_customer_log_listing.xml +++ b/app/code/Magento/LoginAsCustomerLog/view/adminhtml/ui_component/login_as_customer_log_listing.xml @@ -83,9 +83,10 @@ <label translate="true">Admin Name</label> </settings> </column> - <column name="time" sortOrder="60"> + <column name="time" class="Magento\Ui\Component\Listing\Columns\Date" component="Magento_Ui/js/grid/columns/date" sortOrder="60"> <settings> - <filter>text</filter> + <filter>dateRange</filter> + <dataType>date</dataType> <label translate="true">Logged In</label> </settings> </column> diff --git a/app/code/Magento/LoginAsCustomerQuote/Plugin/LoginAsCustomerApi/ProcessShoppingCartPlugin.php b/app/code/Magento/LoginAsCustomerQuote/Plugin/LoginAsCustomerApi/ProcessShoppingCartPlugin.php index 4aa068a0ccc6..7ebfe4088ab6 100644 --- a/app/code/Magento/LoginAsCustomerQuote/Plugin/LoginAsCustomerApi/ProcessShoppingCartPlugin.php +++ b/app/code/Magento/LoginAsCustomerQuote/Plugin/LoginAsCustomerApi/ProcessShoppingCartPlugin.php @@ -12,7 +12,6 @@ use Magento\Framework\Exception\LocalizedException; use Magento\Quote\Api\CartRepositoryInterface; use Magento\LoginAsCustomerApi\Api\AuthenticateCustomerBySecretInterface; -use Magento\LoginAsCustomerApi\Api\GetAuthenticationDataBySecretInterface; /** * Remove all items from guest shopping cart and mark cart as not-guest @@ -21,11 +20,6 @@ */ class ProcessShoppingCartPlugin { - /** - * @var GetAuthenticationDataBySecretInterface - */ - private $getAuthenticationDataBySecret; - /** * @var CustomerSession */ @@ -42,18 +36,15 @@ class ProcessShoppingCartPlugin private $quoteRepository; /** - * @param GetAuthenticationDataBySecretInterface $getAuthenticationDataBySecret * @param CustomerSession $customerSession * @param CheckoutSession $checkoutSession * @param CartRepositoryInterface $quoteRepository */ public function __construct( - GetAuthenticationDataBySecretInterface $getAuthenticationDataBySecret, CustomerSession $customerSession, CheckoutSession $checkoutSession, CartRepositoryInterface $quoteRepository ) { - $this->getAuthenticationDataBySecret = $getAuthenticationDataBySecret; $this->customerSession = $customerSession; $this->checkoutSession = $checkoutSession; $this->quoteRepository = $quoteRepository; diff --git a/app/code/Magento/Marketplace/Model/Partners.php b/app/code/Magento/Marketplace/Model/Partners.php index f105cf186fc0..9f75f2d17c45 100644 --- a/app/code/Magento/Marketplace/Model/Partners.php +++ b/app/code/Magento/Marketplace/Model/Partners.php @@ -35,6 +35,11 @@ class Partners */ protected $cache; + /** + * @var UrlInterface + */ + private $backendUrl; + /** * @param Curl $curl * @param Cache $cache diff --git a/app/code/Magento/MediaContent/README.md b/app/code/Magento/MediaContent/README.md index b5813540acef..579d7b95fffd 100644 --- a/app/code/Magento/MediaContent/README.md +++ b/app/code/Magento/MediaContent/README.md @@ -4,10 +4,10 @@ The Magento_MediaContent module provides implementations for managing relations ## Extensibility -Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaContentApi/README.md b/app/code/Magento/MediaContentApi/README.md index 87e0d7524f59..4571bb956e7a 100644 --- a/app/code/Magento/MediaContentApi/README.md +++ b/app/code/Magento/MediaContentApi/README.md @@ -4,10 +4,10 @@ The Magento_MediaContentApi module provides interfaces for managing relations be ## Extensibility -Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaContentCatalog/README.md b/app/code/Magento/MediaContentCatalog/README.md index 359126a8b7a1..0fb59f6bb9bc 100644 --- a/app/code/Magento/MediaContentCatalog/README.md +++ b/app/code/Magento/MediaContentCatalog/README.md @@ -4,10 +4,10 @@ The Magento_MediaContentCatalog provides the implementation of MediaContent func ## Extensibility -Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaContentCms/README.md b/app/code/Magento/MediaContentCms/README.md index 32b0fdc2bbd2..2ea462cb70e3 100644 --- a/app/code/Magento/MediaContentCms/README.md +++ b/app/code/Magento/MediaContentCms/README.md @@ -4,10 +4,10 @@ The Magento_MediaContentCms provides the implementation of MediaContent function ## Extensibility -Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaContentSynchronization/README.md b/app/code/Magento/MediaContentSynchronization/README.md index 69098ab02eb0..3fb2c28f063b 100644 --- a/app/code/Magento/MediaContentSynchronization/README.md +++ b/app/code/Magento/MediaContentSynchronization/README.md @@ -5,10 +5,10 @@ media asset information. ## Extensibility -Extension developers can interact with the Magento_MediaContentSynchronization module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaContentSynchronization module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContentSynchronization module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContentSynchronization module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaContentSynchronization/etc/queue.xml b/app/code/Magento/MediaContentSynchronization/etc/queue.xml new file mode 100644 index 000000000000..9d1b994c602a --- /dev/null +++ b/app/code/Magento/MediaContentSynchronization/etc/queue.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/queue.xsd"> + <broker topic="media.content.synchronization" exchange="magento-db" type="db"> + <queue name="media.content.synchronization" consumer="media.content.synchronization" consumerInstance="Magento\Framework\MessageQueue\Consumer" handler="Magento\MediaContentSynchronization\Model\Consume::execute" /> + </broker> +</config> diff --git a/app/code/Magento/MediaContentSynchronizationApi/README.md b/app/code/Magento/MediaContentSynchronizationApi/README.md index 25ceae24452f..b074271149e2 100644 --- a/app/code/Magento/MediaContentSynchronizationApi/README.md +++ b/app/code/Magento/MediaContentSynchronizationApi/README.md @@ -4,10 +4,10 @@ The Magento_MediaContentSynchronizationApi module is responsible for the media g ## Extensibility -Extension developers can interact with the Magento_MediaContentSynchronizationApi module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaContentSynchronizationApi module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContentSynchronizationApi module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContentSynchronizationApi module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaContentSynchronizationCatalog/README.md b/app/code/Magento/MediaContentSynchronizationCatalog/README.md index 8395ffc10d4d..9f985aa0afa6 100644 --- a/app/code/Magento/MediaContentSynchronizationCatalog/README.md +++ b/app/code/Magento/MediaContentSynchronizationCatalog/README.md @@ -4,10 +4,10 @@ The Magento_MediaContentCatalog provides the implementation of MediaContentSyncr ## Extensibility -Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaContentSynchronizationCms/README.md b/app/code/Magento/MediaContentSynchronizationCms/README.md index 58582b1b2d70..5873102dfaa7 100644 --- a/app/code/Magento/MediaContentSynchronizationCms/README.md +++ b/app/code/Magento/MediaContentSynchronizationCms/README.md @@ -4,10 +4,10 @@ The Magento_MediaContentCms provides the implementation of MediaContentSyncroniz ## Extensibility -Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGallery/Model/Directory/IsExcluded.php b/app/code/Magento/MediaGallery/Model/Directory/IsExcluded.php index 8fb0e03b7654..5a74ce266cba 100644 --- a/app/code/Magento/MediaGallery/Model/Directory/IsExcluded.php +++ b/app/code/Magento/MediaGallery/Model/Directory/IsExcluded.php @@ -7,6 +7,9 @@ namespace Magento\MediaGallery\Model\Directory; +use Magento\Framework\Filesystem\File\WriteInterface; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem; use Magento\MediaGalleryApi\Api\IsPathExcludedInterface; use Magento\MediaGalleryApi\Model\ExcludedPatternsConfigInterface; @@ -20,12 +23,23 @@ class IsExcluded implements IsPathExcludedInterface */ private $config; + /** + * @var Filesystem + */ + private $filesystem; + + /** @var WriteInterface */ + private $mediaDirectory; + /** * @param ExcludedPatternsConfigInterface $config + * @param Filesystem $filesystem */ - public function __construct(ExcludedPatternsConfigInterface $config) + public function __construct(ExcludedPatternsConfigInterface $config, Filesystem $filesystem) { $this->config = $config; + $this->filesystem = $filesystem; + $this->mediaDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::MEDIA); } /** @@ -36,16 +50,18 @@ public function __construct(ExcludedPatternsConfigInterface $config) */ public function execute(string $path): bool { + $realPath = $this->mediaDirectory->getDriver()->getRealPathSafety($path); foreach ($this->config->get() as $pattern) { if (empty($pattern)) { continue; } - preg_match($pattern, $path, $result); + preg_match($pattern, $realPath, $result); if ($result) { return true; } } + return false; } } diff --git a/app/code/Magento/MediaGallery/README.md b/app/code/Magento/MediaGallery/README.md index ed97b5df98fc..c96ecf3edadb 100644 --- a/app/code/Magento/MediaGallery/README.md +++ b/app/code/Magento/MediaGallery/README.md @@ -10,14 +10,14 @@ The Magento_MediaGallery module creates the following tables in the database: - `media_gallery_keyword` - `media_gallery_asset_keyword` -For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html). +For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Extensibility -Extension developers can interact with the Magento_MediaGallery module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGallery module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGallery module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGallery module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/Directory/IsExcludedTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/Directory/IsExcludedTest.php deleted file mode 100644 index cc57b043954d..000000000000 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/Directory/IsExcludedTest.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\MediaGallery\Test\Unit\Model\Directory; - -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\MediaGallery\Model\Directory\IsExcluded; -use Magento\MediaGalleryApi\Model\ExcludedPatternsConfigInterface; -use PHPUnit\Framework\MockObject\MockObject; -use PHPUnit\Framework\TestCase; - -/** - * Test for IsExcluded - */ -class IsExcludedTest extends TestCase -{ - /** - * @var IsExcluded - */ - private $object; - - /** - * @var ExcludedPatternsConfigInterface|MockObject - */ - private $configMock; - - /** - * Initialize basic test class mocks - */ - protected function setUp(): void - { - $this->configMock = $this->getMockBuilder(ExcludedPatternsConfigInterface::class) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - $this->configMock->expects($this->at(0))->method('get')->willReturn([ - 'tmp' => '/pub\/media\/tmp/', - 'captcha' => '/pub\/media\/captcha/' - ]); - $this->object = (new ObjectManager($this))->getObject(IsExcluded::class, [ - 'config' => $this->configMock - ]); - } - - /** - * Test if the directory path is excluded - * - * @param string $path - * @param bool $isExcluded - * @dataProvider pathsProvider - */ - public function testExecute(string $path, bool $isExcluded): void - { - $this->assertEquals($isExcluded, $this->object->execute($path)); - } - - /** - * Data provider for testIsExcluded - * - * @return array - */ - public function pathsProvider() - { - return [ - ['/var/www/html/pub/media/tmp/somedir', true], - ['/var/www/html/pub/media/wysiwyg/somedir', false] - ]; - } -} diff --git a/app/code/Magento/MediaGalleryApi/README.md b/app/code/Magento/MediaGalleryApi/README.md index 978a14691597..099f5d3313a1 100644 --- a/app/code/Magento/MediaGalleryApi/README.md +++ b/app/code/Magento/MediaGalleryApi/README.md @@ -4,10 +4,10 @@ The Magento_MediaGalleryApi module serves as application program interface (API) ## Extensibility -Extension developers can interact with the Magento_MediaGallery module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGallery module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryApi module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryApi module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGalleryCatalog/README.md b/app/code/Magento/MediaGalleryCatalog/README.md index b39b1fae756d..18407f6aa03f 100644 --- a/app/code/Magento/MediaGalleryCatalog/README.md +++ b/app/code/Magento/MediaGalleryCatalog/README.md @@ -4,14 +4,14 @@ The Magento_MediaGalleryCatalog module is responsible for for catalog gallery pr ## Installation details -For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html). +For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Extensibility -Extension developers can interact with the Magento_MediaGallery module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGallery module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGallery module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGallery module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGalleryCatalogUi/README.md b/app/code/Magento/MediaGalleryCatalogUi/README.md index f47b031875f5..e23ef6d16de9 100644 --- a/app/code/Magento/MediaGalleryCatalogUi/README.md +++ b/app/code/Magento/MediaGalleryCatalogUi/README.md @@ -4,10 +4,10 @@ The Magento_MediaGalleryCatalogUi module that implement category grid for media ## Extensibility -Extension developers can interact with the Magento_MediaGalleryRenditions module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGalleryRenditions module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryRenditions module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryRenditions module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGalleryCatalogUi/Test/Mftf/Test/AdminMediaGalleryCatalogUiUsedInProductFilterOnTest.xml b/app/code/Magento/MediaGalleryCatalogUi/Test/Mftf/Test/AdminMediaGalleryCatalogUiUsedInProductFilterOnTest.xml index a48256a4c2d2..d58588e838c6 100644 --- a/app/code/Magento/MediaGalleryCatalogUi/Test/Mftf/Test/AdminMediaGalleryCatalogUiUsedInProductFilterOnTest.xml +++ b/app/code/Magento/MediaGalleryCatalogUi/Test/Mftf/Test/AdminMediaGalleryCatalogUiUsedInProductFilterOnTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <magentoCLI command="config:set {{WysiwygEnabledByDefault.path}} {{WysiwygEnabledByDefault.value}}" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <createData entity="SimpleProduct2" stepKey="createProduct"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> @@ -48,7 +48,7 @@ <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> <argument name="productId" value="$createProduct.id$"/> </actionGroup> - <actionGroup ref="AdminOpenMediaGalleryTinyMce4ActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> + <actionGroup ref="AdminOpenMediaGalleryTinyMceActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> <actionGroup ref="AdminEnhancedMediaGalleryUploadImageActionGroup" stepKey="uploadImage"> <argument name="image" value="ImageUpload3"/> </actionGroup> @@ -56,7 +56,7 @@ <argument name="imageName" value="{{ImageMetadata.title}}"/> </actionGroup> <actionGroup ref="AdminMediaGalleryClickAddSelectedActionGroup" stepKey="clickAddSelectedContentImage"/> - <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMce4ActionGroup" stepKey="clickOkButton"/> + <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMceActionGroup" stepKey="clickOkButton"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <actionGroup ref="AdminOpenStandaloneMediaGalleryActionGroup" stepKey="openStandaloneMediaGallery"/> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> diff --git a/app/code/Magento/MediaGalleryCatalogUi/Test/Mftf/Test/AdminMediaGalleryCatalogUiUsedInProductFilterTest.xml b/app/code/Magento/MediaGalleryCatalogUi/Test/Mftf/Test/AdminMediaGalleryCatalogUiUsedInProductFilterTest.xml index 02d96b725603..1a6c7c62c096 100644 --- a/app/code/Magento/MediaGalleryCatalogUi/Test/Mftf/Test/AdminMediaGalleryCatalogUiUsedInProductFilterTest.xml +++ b/app/code/Magento/MediaGalleryCatalogUi/Test/Mftf/Test/AdminMediaGalleryCatalogUiUsedInProductFilterTest.xml @@ -36,7 +36,7 @@ <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct"> <argument name="product" value="$$product$$"/> </actionGroup> - <actionGroup ref="AdminOpenMediaGalleryTinyMce4ActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> + <actionGroup ref="AdminOpenMediaGalleryTinyMceActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> <actionGroup ref="AdminEnhancedMediaGalleryUploadImageActionGroup" stepKey="uploadImage"> <argument name="image" value="ImageUpload3"/> </actionGroup> @@ -44,7 +44,7 @@ <argument name="imageName" value="{{ImageMetadata.title}}"/> </actionGroup> <actionGroup ref="AdminMediaGalleryClickAddSelectedActionGroup" stepKey="clickAddSelectedContentImage"/> - <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMce4ActionGroup" stepKey="clickOkButton"/> + <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMceActionGroup" stepKey="clickOkButton"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductsGrid"/> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearFilters"/> diff --git a/app/code/Magento/MediaGalleryCatalogUi/Test/Mftf/Test/AdminMediaGalleryCatalogUiVerifyUsedInLinkProductGridTest.xml b/app/code/Magento/MediaGalleryCatalogUi/Test/Mftf/Test/AdminMediaGalleryCatalogUiVerifyUsedInLinkProductGridTest.xml index d2e8574ef703..a9d5a9b98d0e 100644 --- a/app/code/Magento/MediaGalleryCatalogUi/Test/Mftf/Test/AdminMediaGalleryCatalogUiVerifyUsedInLinkProductGridTest.xml +++ b/app/code/Magento/MediaGalleryCatalogUi/Test/Mftf/Test/AdminMediaGalleryCatalogUiVerifyUsedInLinkProductGridTest.xml @@ -55,7 +55,7 @@ <argument name="imageName" value="{{ImageMetadata.title}}"/> </actionGroup> <actionGroup ref="AdminMediaGalleryClickAddSelectedActionGroup" stepKey="clickAddSelectedContentImage"/> - <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMce4ActionGroup" stepKey="clickOkButton"/> + <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMceActionGroup" stepKey="clickOkButton"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToProductCatalogPage"/> <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetProductGridToDefaultView"/> diff --git a/app/code/Magento/MediaGalleryCmsUi/README.md b/app/code/Magento/MediaGalleryCmsUi/README.md index a5c2eb24c6c1..f016f39bedd4 100644 --- a/app/code/Magento/MediaGalleryCmsUi/README.md +++ b/app/code/Magento/MediaGalleryCmsUi/README.md @@ -4,10 +4,10 @@ The Magento_MediaGalleryCmsUi module provides Magento_Cms related UI elements to ## Extensibility -Extension developers can interact with the Magento_MediaGalleryRenditions module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGalleryRenditions module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryRenditions module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryRenditions module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGalleryIntegration/Test/Integration/Model/GalleryConfigProviderOpenDialogUrlTest.php b/app/code/Magento/MediaGalleryIntegration/Test/Integration/Model/GalleryConfigProviderOpenDialogUrlTest.php new file mode 100644 index 000000000000..5415d5195a18 --- /dev/null +++ b/app/code/Magento/MediaGalleryIntegration/Test/Integration/Model/GalleryConfigProviderOpenDialogUrlTest.php @@ -0,0 +1,87 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\MediaGalleryIntegration\Test\Integration\Model; + +use Magento\Cms\Model\Wysiwyg\Config; +use Magento\Cms\Model\Wysiwyg\Gallery\DefaultConfigProvider; +use Magento\Cms\Helper\Wysiwyg\Images; +use Magento\Framework\DataObject; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\UrlInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Provide integration tests cover update open dialog url functionality for media editor. + * @magentoAppArea adminhtml + */ +class GalleryConfigProviderOpenDialogUrlTest extends TestCase +{ + private const FILES_BROWSER_WINDOW_URL = 'files_browser_window_url'; + private const MEDIA_GALLERY_URL = 'media_gallery/index/index'; + + /** + * @var ObjectManagerInterface + */ + private $objectManger; + + /** + * @var DefaultConfigProvider + */ + private $galleryConfigProvider; + + /** + * @var DataObject + */ + private $configDataObject; + + /** + * @var string + */ + private $fileBrowserWindowUrl; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $this->objectManger = Bootstrap::getObjectManager(); + $this->galleryConfigProvider = $this->objectManger->create(DefaultConfigProvider::class); + $this->configDataObject = $this->objectManger->create(DataObject::class); + + $url = $this->objectManger->create(UrlInterface::class); + + $this->fileBrowserWindowUrl = $url->getUrl( + self::MEDIA_GALLERY_URL, + [ + 'current_tree_path' => $this->objectManger->get(Images::class)->idEncode(Config::IMAGE_DIRECTORY), + ] + ); + } + + /** + * Test image open dialog url when enhanced media gallery not enabled. + * @magentoConfigFixture default/system/media_gallery/enabled 0 + */ + public function testWithEnhancedMediaGalleryDisabled(): void + { + $config = $this->galleryConfigProvider->getConfig($this->configDataObject); + self::assertNotEquals($this->fileBrowserWindowUrl, $config->getData(self::FILES_BROWSER_WINDOW_URL)); + } + + /** + * Test image open dialog url when enhanced media gallery enabled. + * @magentoConfigFixture default/system/media_gallery/enabled 1 + */ + public function testWithEnhancedMediaGalleryEnabled(): void + { + $config = $this->galleryConfigProvider->getConfig($this->configDataObject); + self::assertEquals($this->fileBrowserWindowUrl, $config->getData(self::FILES_BROWSER_WINDOW_URL)); + } +} diff --git a/app/code/Magento/MediaGalleryIntegration/Test/Integration/Model/TinyMceOpenDialogUrlTest.php b/app/code/Magento/MediaGalleryIntegration/Test/Integration/Model/TinyMceOpenDialogUrlTest.php deleted file mode 100644 index 81a4dc642cfa..000000000000 --- a/app/code/Magento/MediaGalleryIntegration/Test/Integration/Model/TinyMceOpenDialogUrlTest.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -declare(strict_types=1); - -namespace Magento\MediaGalleryIntegration\Test\Integration\Model; - -use Magento\Framework\DataObject; -use Magento\Framework\ObjectManagerInterface; -use Magento\Framework\UrlInterface; -use Magento\TestFramework\Helper\Bootstrap; -use Magento\Tinymce3\Model\Config\Gallery\Config; -use PHPUnit\Framework\TestCase; - -/** - * Provide integration tests cover update open dialog url functionality for media editor. - * @magentoAppArea adminhtml - */ -class TinyMceOpenDialogUrlTest extends TestCase -{ - private const FILES_BROWSER_WINDOW_URL = 'files_browser_window_url'; - - /** - * @var ObjectManagerInterface - */ - private $objectManger; - - /** - * @var Config - */ - private $tinyMce3Config; - - /** - * @var DataObject - */ - private $configDataObject; - - /** - * @var string - */ - private $fileBrowserWindowUrl; - - /** - * @inheritdoc - */ - protected function setUp(): void - { - $this->objectManger = Bootstrap::getObjectManager(); - $this->tinyMce3Config = $this->objectManger->create(Config::class); - $this->configDataObject = $this->objectManger->create(DataObject::class); - - $url = $this->objectManger->create(UrlInterface::class); - $this->fileBrowserWindowUrl = $url->getUrl('media_gallery/index/index'); - } - - /** - * Test image open dialog url when enhanced media gallery not enabled. - * @magentoConfigFixture default/system/media_gallery/enabled 0 - */ - public function testWithEnhancedMediaGalleryDisabled(): void - { - $config = $this->tinyMce3Config->getConfig($this->configDataObject); - self::assertNotEquals($this->fileBrowserWindowUrl, $config->getData(self::FILES_BROWSER_WINDOW_URL)); - } - - /** - * Test image open dialog url when enhanced media gallery enabled. - * @magentoConfigFixture default/system/media_gallery/enabled 1 - */ - public function testWithEnhancedMediaGalleryEnabled(): void - { - $config = $this->tinyMce3Config->getConfig($this->configDataObject); - self::assertEquals($this->fileBrowserWindowUrl, $config->getData(self::FILES_BROWSER_WINDOW_URL)); - } -} diff --git a/app/code/Magento/MediaGalleryMetadata/Model/Png/Segment/ReadXmp.php b/app/code/Magento/MediaGalleryMetadata/Model/Png/Segment/ReadXmp.php index 518697d42147..60d6043f44be 100644 --- a/app/code/Magento/MediaGalleryMetadata/Model/Png/Segment/ReadXmp.php +++ b/app/code/Magento/MediaGalleryMetadata/Model/Png/Segment/ReadXmp.php @@ -70,7 +70,7 @@ public function execute(FileInterface $file): MetadataInterface private function isXmpSegment(SegmentInterface $segment): bool { return $segment->getName() === self::XMP_SEGMENT_NAME - && strpos($segment->getData(), '<x:xmpmeta') !== -1; + && strpos($segment->getData(), '<x:xmpmeta') !== false; } /** diff --git a/app/code/Magento/MediaGalleryMetadata/Model/Png/Segment/WriteXmp.php b/app/code/Magento/MediaGalleryMetadata/Model/Png/Segment/WriteXmp.php index f03482ecf605..ee49a7b4535a 100644 --- a/app/code/Magento/MediaGalleryMetadata/Model/Png/Segment/WriteXmp.php +++ b/app/code/Magento/MediaGalleryMetadata/Model/Png/Segment/WriteXmp.php @@ -152,7 +152,7 @@ private function updateSegment(SegmentInterface $segment, MetadataInterface $met private function isXmpSegment(SegmentInterface $segment): bool { return $segment->getName() === self::XMP_SEGMENT_NAME - && strpos($segment->getData(), '<x:xmpmeta') !== -1; + && strpos($segment->getData(), '<x:xmpmeta') !== false; } /** diff --git a/app/code/Magento/MediaGalleryMetadata/Test/Integration/Model/Png/Segment/XmpTest.php b/app/code/Magento/MediaGalleryMetadata/Test/Integration/Model/Png/Segment/XmpTest.php new file mode 100644 index 000000000000..e3a3ab1709da --- /dev/null +++ b/app/code/Magento/MediaGalleryMetadata/Test/Integration/Model/Png/Segment/XmpTest.php @@ -0,0 +1,144 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\MediaGalleryMetadata\Test\Integration\Model\Png\Segment; + +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\WriteInterface; +use Magento\Framework\Filesystem\DriverInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; +use Magento\MediaGalleryMetadata\Model\Png\Segment\WriteXmp; +use Magento\MediaGalleryMetadata\Model\Png\Segment\ReadXmp; +use Magento\MediaGalleryMetadata\Model\Png\ReadFile; +use Magento\MediaGalleryMetadata\Model\MetadataFactory; + +/** + * Test for Xmp reader and writer + */ +class XmpTest extends TestCase +{ + /** + * @var WriteXmp + */ + private $xmpWriter; + + /** + * @var ReadXmp + */ + private $xmpReader; + + /** + * @var DriverInterface + */ + private $driver; + + /** + * @var ReadFile + */ + private $fileReader; + + /** + * @var MetadataFactory + */ + private $metadataFactory; + + /** + * @var WriteInterface + */ + private $varDirectory; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $this->varDirectory = Bootstrap::getObjectManager()->get(Filesystem::class) + ->getDirectoryWrite(DirectoryList::VAR_DIR); + $this->xmpWriter = Bootstrap::getObjectManager()->get(WriteXmp::class); + $this->xmpReader = Bootstrap::getObjectManager()->get(ReadXmp::class); + $this->fileReader = Bootstrap::getObjectManager()->get(ReadFile::class); + $this->driver = Bootstrap::getObjectManager()->get(DriverInterface::class); + $this->metadataFactory = Bootstrap::getObjectManager()->get(MetadataFactory::class); + } + + /** + * Test for Xmp reader and writer + * + * @dataProvider filesProvider + * @param string $fileName + * @param string $title + * @param string $description + * @param array $keywords + * @throws LocalizedException + */ + public function testWriteRead( + string $fileName, + string $title, + string $description, + array $keywords + ): void { + $path = realpath(__DIR__ . '/../../../../_files/' . $fileName); + $modifiableFilePath = $this->varDirectory->getAbsolutePath($fileName); + $this->driver->copy( + $path, + $modifiableFilePath + ); + $modifiableFilePath = $this->fileReader->execute($modifiableFilePath); + $originalMetadata = $this->xmpReader->execute($modifiableFilePath); + + $this->assertEmpty($originalMetadata->getTitle()); + $this->assertEmpty($originalMetadata->getDescription()); + $this->assertEmpty($originalMetadata->getKeywords()); + + $updatedFile = $this->xmpWriter->execute( + $modifiableFilePath, + $this->metadataFactory->create([ + 'title' => $title, + 'description' => $description, + 'keywords' => $keywords + ]) + ); + + $updatedMetadata = $this->xmpReader->execute($updatedFile); + + $this->assertEquals($title, $updatedMetadata->getTitle()); + $this->assertEquals($description, $updatedMetadata->getDescription()); + $this->assertEquals($keywords, $updatedMetadata->getKeywords()); + } + + /** + * Data provider for testExecute + * + * @return array[] + */ + public function filesProvider(): array + { + return [ + [ + 'empty_xmp_image.png', + 'Updated Title', + 'Updated Description', + [ + 'magento2', + 'mediagallery', + ] + ], + [ + 'itxt_with_empty_xmp_image.png', + 'Title 2', + 'Description 2', + [ + 'magento2', + 'mediagallery', + ] + ], + ]; + } +} diff --git a/app/code/Magento/MediaGalleryMetadata/Test/_files/itxt_with_empty_xmp_image.png b/app/code/Magento/MediaGalleryMetadata/Test/_files/itxt_with_empty_xmp_image.png new file mode 100644 index 000000000000..62d5d4347cb3 Binary files /dev/null and b/app/code/Magento/MediaGalleryMetadata/Test/_files/itxt_with_empty_xmp_image.png differ diff --git a/app/code/Magento/MediaGalleryRenditions/README.md b/app/code/Magento/MediaGalleryRenditions/README.md index df856e8003a8..4629933b287e 100644 --- a/app/code/Magento/MediaGalleryRenditions/README.md +++ b/app/code/Magento/MediaGalleryRenditions/README.md @@ -4,10 +4,10 @@ The Magento_MediaGalleryRenditions module implements height and width fields for ## Extensibility -Extension developers can interact with the Magento_MediaGalleryRenditions module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGalleryRenditions module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryRenditions module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryRenditions module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGalleryRenditions/etc/media_content.xml b/app/code/Magento/MediaGalleryRenditions/etc/media_content.xml index a1fbe5cba558..7596de07b892 100644 --- a/app/code/Magento/MediaGalleryRenditions/etc/media_content.xml +++ b/app/code/Magento/MediaGalleryRenditions/etc/media_content.xml @@ -9,7 +9,7 @@ <search> <patterns> <pattern name="media_gallery_renditions">/{{media url=(?:"|&quot;)(?:.renditions)?(.*?)(?:"|&quot;)}}/</pattern> - <pattern name="media_gallery">/{{media url="?((?!.*.renditions).*?)"?}}/</pattern> + <pattern name="media_gallery">/{{media url="?(?:.*?\.renditions\/)(.*?)"?}}/</pattern> <pattern name="wysiwyg">/src=".*\/media\/(?:.renditions\/)*(.*?)"/</pattern> <pattern name="catalog_image">/^\/?media\/(?:.renditions\/)?(.*)/</pattern> <pattern name="catalog_image_with_pub">/^\/pub\/?media\/(?:.renditions\/)?(.*)/</pattern> diff --git a/app/code/Magento/MediaGalleryRenditions/etc/queue.xml b/app/code/Magento/MediaGalleryRenditions/etc/queue.xml new file mode 100644 index 000000000000..fc86fe7ce4e5 --- /dev/null +++ b/app/code/Magento/MediaGalleryRenditions/etc/queue.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/queue.xsd"> + <broker topic="media.gallery.renditions.update" exchange="magento-db" type="db"> + <queue name="media.gallery.renditions.update" consumer="media.gallery.renditions.update" consumerInstance="Magento\Framework\MessageQueue\Consumer" handler="Magento\MediaGalleryRenditions\Model\Queue\UpdateRenditions::execute" /> + </broker> +</config> diff --git a/app/code/Magento/MediaGalleryRenditionsApi/README.md b/app/code/Magento/MediaGalleryRenditionsApi/README.md index 42478c0c9b52..3f2724521fbf 100644 --- a/app/code/Magento/MediaGalleryRenditionsApi/README.md +++ b/app/code/Magento/MediaGalleryRenditionsApi/README.md @@ -4,10 +4,10 @@ The Magento_MediaGalleryRenditionsApi module is responsible for the API implemen ## Extensibility -Extension developers can interact with the Magento_MediaGalleryRenditions module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGalleryRenditions module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryRenditionsApi module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryRenditionsApi module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGallerySynchronization/README.md b/app/code/Magento/MediaGallerySynchronization/README.md index 4947c18986f3..b02a0f276a16 100644 --- a/app/code/Magento/MediaGallerySynchronization/README.md +++ b/app/code/Magento/MediaGallerySynchronization/README.md @@ -5,10 +5,10 @@ media asset information. ## Extensibility -Extension developers can interact with the Magento_MediaGallerySynchronization module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGallerySynchronization module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGallerySynchronization module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGallerySynchronization module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGallerySynchronization/etc/queue.xml b/app/code/Magento/MediaGallerySynchronization/etc/queue.xml new file mode 100644 index 000000000000..a331673c7c1b --- /dev/null +++ b/app/code/Magento/MediaGallerySynchronization/etc/queue.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/queue.xsd"> + <broker topic="media.gallery.synchronization" exchange="magento-db" type="db"> + <queue name="media.gallery.synchronization" consumer="media.gallery.synchronization" consumerInstance="Magento\Framework\MessageQueue\Consumer" handler="Magento\MediaGallerySynchronization\Model\Consume::execute" /> + </broker> +</config> diff --git a/app/code/Magento/MediaGallerySynchronizationApi/README.md b/app/code/Magento/MediaGallerySynchronizationApi/README.md index 1a1288341392..5043bbf70408 100644 --- a/app/code/Magento/MediaGallerySynchronizationApi/README.md +++ b/app/code/Magento/MediaGallerySynchronizationApi/README.md @@ -4,10 +4,10 @@ The Magento_MediaGallerySynchronizationApi module is responsible for the media g ## Extensibility -Extension developers can interact with the Magento_MediaGallerySynchronizationApi module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGallerySynchronizationApi module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGallerySynchronizationApi module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGallerySynchronizationApi module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGalleryUi/README.md b/app/code/Magento/MediaGalleryUi/README.md index 6fbad656b23a..36226e43ca85 100644 --- a/app/code/Magento/MediaGalleryUi/README.md +++ b/app/code/Magento/MediaGalleryUi/README.md @@ -4,10 +4,10 @@ The Magento_MediaGalleryUi module is responsible for the media gallery user inte ## Extensibility -Extension developers can interact with the Magento_MediaGalleryUi module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGalleryUi module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryUi module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryUi module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminEnhancedMediaGalleryDeletedAllImagesActionGroup.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminEnhancedMediaGalleryDeletedAllImagesActionGroup.xml index 4aa460327578..52ad2b0d497c 100644 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminEnhancedMediaGalleryDeletedAllImagesActionGroup.xml +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminEnhancedMediaGalleryDeletedAllImagesActionGroup.xml @@ -12,8 +12,8 @@ <amOnPage url="{{AdminStandaloneMediaGalleryPage.url}}" stepKey="openMediaGalleryPage"/> <!-- It sometimes is loading too long for default 10s --> <waitForPageLoad time="60" stepKey="waitForPageFullyLoaded"/> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> - <helper class="\Magento\MediaGalleryUi\Test\Mftf\Helper\MediaGalleryUiHelper" method="deleteAllImagesUsingMassAction" stepKey="deleteAllImagesUsingMassAction"> + <conditionalClick selector="{{AdminEnhancedMediaGalleryFiltersSection.clearFilters}}" dependentSelector="{{AdminEnhancedMediaGalleryFiltersSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> + <helper class="Magento\MediaGalleryUi\Test\Mftf\Helper\MediaGalleryUiHelper" method="deleteAllImagesUsingMassAction" stepKey="deleteAllImagesUsingMassAction"> <argument name="emptyRow">{{AdminMediaGalleryGridSection.noDataMessage}}</argument> <argument name="deleteImagesButton">{{AdminEnhancedMediaGalleryMassActionSection.deleteImages}}</argument> <argument name="checkImage">{{AdminEnhancedMediaGalleryMassActionSection.massActionCheckboxAll}}</argument> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminMediaGalleryClickOkButtonTinyMce4ActionGroup.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminMediaGalleryClickOkButtonTinyMce4ActionGroup.xml deleted file mode 100644 index 3e555c25e0a9..000000000000 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminMediaGalleryClickOkButtonTinyMce4ActionGroup.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminMediaGalleryClickOkButtonTinyMce4ActionGroup"> - <annotations> - <description>Click ok button on upload image tinyMce4 popup.</description> - </annotations> - - <waitForElementVisible selector="{{MediaGallerySection.OkBtn}}" stepKey="waitForOkBtn"/> - <click selector="{{MediaGallerySection.OkBtn}}" stepKey="clickOkBtn"/> - <waitForPageLoad stepKey="wait"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminMediaGalleryClickOkButtonTinyMceActionGroup.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminMediaGalleryClickOkButtonTinyMceActionGroup.xml new file mode 100644 index 000000000000..f073826b18cd --- /dev/null +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminMediaGalleryClickOkButtonTinyMceActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminMediaGalleryClickOkButtonTinyMceActionGroup"> + <annotations> + <description>Click ok button on upload image tinyMce4 popup.</description> + </annotations> + + <waitForElementVisible selector="{{MediaGallerySection.OkBtn}}" stepKey="waitForOkBtn"/> + <click selector="{{MediaGallerySection.OkBtn}}" stepKey="clickOkBtn"/> + <waitForPageLoad stepKey="wait"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminOpenMediaGalleryFromTinyMce4IconActionGroup.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminOpenMediaGalleryFromTinyMce4IconActionGroup.xml deleted file mode 100644 index e4fb6aec5c15..000000000000 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminOpenMediaGalleryFromTinyMce4IconActionGroup.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminOpenMediaGalleryTinyMce4ActionGroup"> - <annotations> - <description>Opens Enhanced MediaGallery from category page by tyniMce4 image icon</description> - </annotations> - - <conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="clickExpandContent"/> - <waitForElementVisible selector="{{TinyMCESection.TinyMCE4}}" stepKey="waitForTinyMCE4" /> - <click selector="{{TinyMCESection.InsertImageIcon}}" stepKey="clickInsertImageIcon" /> - <waitForPageLoad stepKey="waitForPageLoad" /> - <click selector="{{MediaGallerySection.Browse}}" stepKey="clickBrowse"/> - <waitForPageLoad stepKey="waitForPopup"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminOpenMediaGalleryFromTinyMceIconActionGroup.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminOpenMediaGalleryFromTinyMceIconActionGroup.xml new file mode 100644 index 000000000000..88e961fb79f4 --- /dev/null +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminOpenMediaGalleryFromTinyMceIconActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminOpenMediaGalleryTinyMceActionGroup"> + <annotations> + <description>Opens Enhanced MediaGallery from category page by tyniMce4 image icon</description> + </annotations> + + <conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="clickExpandContent"/> + <waitForElementVisible selector="{{TinyMCESection.TinyMCE4}}" stepKey="waitForTinyMCE4" /> + <click selector="{{TinyMCESection.InsertImageIcon}}" stepKey="clickInsertImageIcon" /> + <waitForPageLoad stepKey="waitForPageLoad" /> + <click selector="{{MediaGallerySection.Browse}}" stepKey="clickBrowse"/> + <waitForPageLoad stepKey="waitForPopup"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AssertAdminEnhancedMediaGalleryUsedInSectionDisplayedActionGroup.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AssertAdminEnhancedMediaGalleryUsedInSectionDisplayedActionGroup.xml new file mode 100644 index 000000000000..488a68530c86 --- /dev/null +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AssertAdminEnhancedMediaGalleryUsedInSectionDisplayedActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminEnhancedMediaGalleryUsedInSectionDisplayedActionGroup"> + <annotations> + <description>Assert used in section is displayed in view details.</description> + </annotations> + + <seeElement selector="{{AdminEnhancedMediaGalleryViewDetailsSection.usedIn}}" stepKey="assertUsedInPresent"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminEnhancedMediaGalleryFiltersSection.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminEnhancedMediaGalleryFiltersSection.xml index da9f773d0f75..77e42b780df8 100644 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminEnhancedMediaGalleryFiltersSection.xml +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminEnhancedMediaGalleryFiltersSection.xml @@ -26,5 +26,6 @@ <element name="searchOptionsFilterDone" type="button" selector="//div[label/span[contains(text(), '{{filterName}}')]]//button[@data-action='close-advanced-select']" parameterized="true"/> <element name="duplicatedFilterCheckbox" type="button" selector="//input[@name='duplicated']"/> <element name="activeFilterValue" type="text" selector="//div[@class='media-gallery-container']//div[@class='admin__current-filters-list-wrap']//li//span[contains(text(), '{{filterPlaceholder}}')]" parameterized="true"/> + <element name="clearFilters" type="button" selector="//div[@class='media-gallery-container']//div[@class='admin__data-grid-header']//button[@data-action='grid-filter-reset']" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminEnhancedMediaGalleryVerifyAssetFilterTest.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminEnhancedMediaGalleryVerifyAssetFilterTest.xml index 847cc398d489..939612da122c 100644 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminEnhancedMediaGalleryVerifyAssetFilterTest.xml +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminEnhancedMediaGalleryVerifyAssetFilterTest.xml @@ -31,7 +31,7 @@ <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory"> <argument name="category" value="$$category$$"/> </actionGroup> - <actionGroup ref="AdminOpenMediaGalleryTinyMce4ActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> + <actionGroup ref="AdminOpenMediaGalleryTinyMceActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetAdminDataGridToDefaultView"/> <actionGroup ref="AdminMediaGalleryFolderSelectActionGroup" stepKey="selectFolder"> <argument name="name" value="wysiwyg"/> @@ -53,7 +53,7 @@ <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory"> <argument name="category" value="$$category$$"/> </actionGroup> - <actionGroup ref="AdminOpenMediaGalleryTinyMce4ActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> + <actionGroup ref="AdminOpenMediaGalleryTinyMceActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> <actionGroup ref="AdminEnhancedMediaGalleryUploadImageActionGroup" stepKey="uploadFirstIMage"> <argument name="image" value="ImageUpload3"/> </actionGroup> @@ -64,7 +64,7 @@ <argument name="imageName" value="{{ImageMetadata.title}}"/> </actionGroup> <actionGroup ref="AdminMediaGalleryClickAddSelectedActionGroup" stepKey="clickAddSelectedContentImage"/> - <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMce4ActionGroup" stepKey="clickOkButton"/> + <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMceActionGroup" stepKey="clickOkButton"/> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory"/> <actionGroup ref="AdminOpenCategoryGridPageActionGroup" stepKey="openCategoryGridPage"/> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminEnhancedMediaGalleryVerifyFilterByAssetTest.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminEnhancedMediaGalleryVerifyFilterByAssetTest.xml index a3208af0da23..7da94c5355c0 100644 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminEnhancedMediaGalleryVerifyFilterByAssetTest.xml +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminEnhancedMediaGalleryVerifyFilterByAssetTest.xml @@ -40,7 +40,7 @@ <actionGroup ref="GoToAdminCategoryPageByIdActionGroup" stepKey="openCategoryPage"> <argument name="id" value="$category.id$"/> </actionGroup> - <actionGroup ref="AdminOpenMediaGalleryTinyMce4ActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> + <actionGroup ref="AdminOpenMediaGalleryTinyMceActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilters"/> <actionGroup ref="AdminEnhancedMediaGalleryUploadImageActionGroup" stepKey="uploadFirstIMage"> <argument name="image" value="ImageUpload3"/> @@ -52,7 +52,7 @@ <argument name="imageName" value="{{ImageMetadata.title}}"/> </actionGroup> <actionGroup ref="AdminMediaGalleryClickAddSelectedActionGroup" stepKey="clickAddSelectedContentImage"/> - <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMce4ActionGroup" stepKey="clickOkButton"/> + <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMceActionGroup" stepKey="clickOkButton"/> <actionGroup ref="AdminSaveCategoryFormActionGroup" stepKey="saveCategory"/> <actionGroup ref="AdminOpenCategoryGridPageActionGroup" stepKey="openMediaGalleryCategoryGridPage"/> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminEnhancedMediaGalleryVerifyNotUsedOptionFilterTest.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminEnhancedMediaGalleryVerifyNotUsedOptionFilterTest.xml index 4719b98c78db..6c025087ca55 100644 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminEnhancedMediaGalleryVerifyNotUsedOptionFilterTest.xml +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminEnhancedMediaGalleryVerifyNotUsedOptionFilterTest.xml @@ -44,7 +44,7 @@ <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory"> <argument name="category" value="$$category$$"/> </actionGroup> - <actionGroup ref="AdminOpenMediaGalleryTinyMce4ActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> + <actionGroup ref="AdminOpenMediaGalleryTinyMceActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> <actionGroup ref="AdminEnhancedMediaGalleryUploadImageActionGroup" stepKey="uploadFirstImage"> <argument name="image" value="ImageUpload3"/> </actionGroup> @@ -59,9 +59,9 @@ <actionGroup ref="AdminEnhancedMediaGalleryCloseViewDetailsActionGroup" stepKey="closeViewDetails"/> <actionGroup ref="AdminMediaGalleryClickAddSelectedActionGroup" stepKey="clickAddSelectedContentImage"/> - <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMce4ActionGroup" stepKey="clickOkButton"/> + <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMceActionGroup" stepKey="clickOkButton"/> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory"/> - <actionGroup ref="AdminOpenMediaGalleryTinyMce4ActionGroup" stepKey="openMediaGalleryFromWysiwygToFilterImage"/> + <actionGroup ref="AdminOpenMediaGalleryTinyMceActionGroup" stepKey="openMediaGalleryFromWysiwygToFilterImage"/> <actionGroup ref="AdminEnhancedMediaGalleryExpandFilterActionGroup" stepKey="expandFilters"/> <actionGroup ref="AdminMediaGalleryApplyUsedInFilterActionGroup" stepKey="applyUsedInCategoryFilter"> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminEnhancedMediaGalleryVerifyUsedInFilterTest.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminEnhancedMediaGalleryVerifyUsedInFilterTest.xml index d54399bdeb2b..143bb0bf5d49 100644 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminEnhancedMediaGalleryVerifyUsedInFilterTest.xml +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminEnhancedMediaGalleryVerifyUsedInFilterTest.xml @@ -45,7 +45,7 @@ <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory"> <argument name="category" value="$$category$$"/> </actionGroup> - <actionGroup ref="AdminOpenMediaGalleryTinyMce4ActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> + <actionGroup ref="AdminOpenMediaGalleryTinyMceActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> <actionGroup ref="AdminEnhancedMediaGalleryUploadImageActionGroup" stepKey="uploadFirstIMage"> <argument name="image" value="ImageUpload3"/> </actionGroup> @@ -63,9 +63,9 @@ <argument name="imageName" value="{{ImageMetadata.title}}"/> </actionGroup> <actionGroup ref="AdminMediaGalleryClickAddSelectedActionGroup" stepKey="clickAddSelectedContentImage"/> - <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMce4ActionGroup" stepKey="clickOkButton"/> + <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMceActionGroup" stepKey="clickOkButton"/> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory"/> - <actionGroup ref="AdminOpenMediaGalleryTinyMce4ActionGroup" stepKey="openMediaGalleryFromWysiwygToFilterIMage"/> + <actionGroup ref="AdminOpenMediaGalleryTinyMceActionGroup" stepKey="openMediaGalleryFromWysiwygToFilterIMage"/> <actionGroup ref="AdminEnhancedMediaGalleryExpandFilterActionGroup" stepKey="expandFilters"/> <actionGroup ref="AdminMediaGalleryApplyUsedInFilterActionGroup" stepKey="applyUsedInCategoryFilter"> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryAddCategoryImageFromTwoComponentsTest.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryAddCategoryImageFromTwoComponentsTest.xml index cb7adf330786..9e86d700c507 100644 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryAddCategoryImageFromTwoComponentsTest.xml +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryAddCategoryImageFromTwoComponentsTest.xml @@ -42,7 +42,7 @@ <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory"> <argument name="category" value="$$category$$"/> </actionGroup> - <actionGroup ref="AdminOpenMediaGalleryTinyMce4ActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> + <actionGroup ref="AdminOpenMediaGalleryTinyMceActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> <actionGroup ref="AdminEnhancedMediaGalleryUploadImageActionGroup" stepKey="uploadContentImage"> <argument name="image" value="ImageUpload3"/> </actionGroup> @@ -57,7 +57,7 @@ <actionGroup ref="AdminEnhancedMediaGalleryCloseViewDetailsActionGroup" stepKey="closeViewDetails"/> <actionGroup ref="AdminMediaGalleryClickAddSelectedActionGroup" stepKey="clickAddSelectedContentImage"/> - <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMce4ActionGroup" stepKey="clickOkButton"/> + <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMceActionGroup" stepKey="clickOkButton"/> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory"/> <actionGroup ref="AdminOpenMediaGalleryFromCategoryImageUploaderActionGroup" stepKey="openMediaGalleryFromImageUploader"/> <actionGroup ref="AdminMediaGalleryFolderSelectActionGroup" stepKey="selectFolder"> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryAddCategoryImageTest.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryAddCategoryImageTest.xml index d3925fcb265e..304cc1f15ccc 100644 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryAddCategoryImageTest.xml +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryAddCategoryImageTest.xml @@ -28,7 +28,7 @@ <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory"> <argument name="category" value="$$category$$"/> </actionGroup> - <actionGroup ref="AdminOpenMediaGalleryTinyMce4ActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> + <actionGroup ref="AdminOpenMediaGalleryTinyMceActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> <actionGroup ref="AdminEnhancedMediaGalleryViewImageDetails" stepKey="viewImageDetails"/> <actionGroup ref="AdminEnhancedMediaGalleryImageDetailsDeleteActionGroup" stepKey="deleteImage"/> <magentoCLI command="config:set cms/wysiwyg/enabled disabled" stepKey="disableWYSIWYG"/> @@ -38,7 +38,7 @@ <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory"> <argument name="category" value="$$category$$"/> </actionGroup> - <actionGroup ref="AdminOpenMediaGalleryTinyMce4ActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> + <actionGroup ref="AdminOpenMediaGalleryTinyMceActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> <waitForPageLoad stepKey="waitForPageLoad"/> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="AdminMediaGalleryExpandFolderActionGroup" stepKey="expandCatalogFolder"> @@ -54,7 +54,7 @@ <argument name="imageName" value="{{ImageMetadata.title}}"/> </actionGroup> <actionGroup ref="AdminMediaGalleryClickAddSelectedActionGroup" stepKey="clickAddSelectedImage"/> - <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMce4ActionGroup" stepKey="clickOkButton"/> + <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMceActionGroup" stepKey="clickOkButton"/> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory"/> <actionGroup ref="StoreFrontMediaGalleryAssertImageInCategoryDescriptionActionGroup" stepKey="assertImageInCategoryDescriptionField"> <argument name="imageName" value="{{ImageUpload3.fileName}}" /> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryDeleteImageWithWarningPopupTest.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryDeleteImageWithWarningPopupTest.xml index 84dd84a22d3c..644452ac4aa8 100644 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryDeleteImageWithWarningPopupTest.xml +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryDeleteImageWithWarningPopupTest.xml @@ -32,7 +32,7 @@ <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory"> <argument name="category" value="$$category$$"/> </actionGroup> - <actionGroup ref="AdminOpenMediaGalleryTinyMce4ActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> + <actionGroup ref="AdminOpenMediaGalleryTinyMceActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetGridToDefaultView"/> <actionGroup ref="AdminEnhancedMediaGalleryUploadImageActionGroup" stepKey="uploadCategoryImage"> @@ -42,9 +42,9 @@ <argument name="imageName" value="{{ImageMetadata.title}}"/> </actionGroup> <actionGroup ref="AdminMediaGalleryClickAddSelectedActionGroup" stepKey="clickAddSelectedContentImage"/> - <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMce4ActionGroup" stepKey="clickOkButton"/> + <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMceActionGroup" stepKey="clickOkButton"/> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory"/> - <actionGroup ref="AdminOpenMediaGalleryTinyMce4ActionGroup" stepKey="openMediaGalleryFromWysiwygToAssertMessage"/> + <actionGroup ref="AdminOpenMediaGalleryTinyMceActionGroup" stepKey="openMediaGalleryFromWysiwygToAssertMessage"/> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilterAgain"/> <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetGridToDefaultViewAgain"/> <actionGroup ref="AdminEnhancedMediaGalleryEnableMassActionModeActionGroup" stepKey="enableMassActionToDeleteImages"/> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryDisabledContentFilterTest.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryDisabledContentFilterTest.xml index 6b174e8c43c9..52fc9cec48c6 100644 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryDisabledContentFilterTest.xml +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryDisabledContentFilterTest.xml @@ -32,7 +32,7 @@ <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory"> <argument name="category" value="$$category$$"/> </actionGroup> - <actionGroup ref="AdminOpenMediaGalleryTinyMce4ActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> + <actionGroup ref="AdminOpenMediaGalleryTinyMceActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> <waitForPageLoad stepKey="waitForPageLoad" /> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="AdminMediaGalleryOpenNewFolderFormActionGroup" stepKey="openNewFolderForm"/> @@ -50,7 +50,7 @@ <argument name="imageName" value="{{ImageMetadata.title}}"/> </actionGroup> <actionGroup ref="AdminMediaGalleryClickAddSelectedActionGroup" stepKey="clickAddSelectedImage"/> - <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMce4ActionGroup" stepKey="clickOkButton"/> + <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMceActionGroup" stepKey="clickOkButton"/> <scrollToTopOfPage stepKey="scrollToTop"/> <actionGroup ref="AdminEnableCategoryActionGroup" stepKey="disableCategory"/> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory"/> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryEnabledContentFilterTest.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryEnabledContentFilterTest.xml index c2b167912dda..1108cf7f3e3d 100644 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryEnabledContentFilterTest.xml +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryEnabledContentFilterTest.xml @@ -33,7 +33,7 @@ <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory"> <argument name="category" value="$$category$$"/> </actionGroup> - <actionGroup ref="AdminOpenMediaGalleryTinyMce4ActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> + <actionGroup ref="AdminOpenMediaGalleryTinyMceActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> <actionGroup ref="AdminEnhancedMediaGalleryUploadImageActionGroup" stepKey="uploadImage"> <argument name="image" value="ImageUpload3"/> </actionGroup> @@ -41,7 +41,7 @@ <argument name="imageName" value="{{ImageMetadata.title}}"/> </actionGroup> <actionGroup ref="AdminMediaGalleryClickAddSelectedActionGroup" stepKey="clickAddSelectedImage"/> - <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMce4ActionGroup" stepKey="clickOkButton"/> + <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMceActionGroup" stepKey="clickOkButton"/> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory"/> <actionGroup ref="AdminOpenStandaloneMediaGalleryActionGroup" stepKey="openStandaloneMediaGallery"/> <actionGroup ref="AdminEnhancedMediaGalleryExpandFilterActionGroup" stepKey="expandFilters"/> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryStoreViewCategoryFilterTest.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryStoreViewCategoryFilterTest.xml index 9c72ee4ac38f..896cb704cab8 100644 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryStoreViewCategoryFilterTest.xml +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGalleryStoreViewCategoryFilterTest.xml @@ -32,7 +32,7 @@ <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory"> <argument name="category" value="$$category$$"/> </actionGroup> - <actionGroup ref="AdminOpenMediaGalleryTinyMce4ActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> + <actionGroup ref="AdminOpenMediaGalleryTinyMceActionGroup" stepKey="openMediaGalleryFromWysiwyg"/> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetGridToDefaultView"/> <actionGroup ref="AdminEnhancedMediaGalleryUploadImageActionGroup" stepKey="uploadImage"> @@ -42,7 +42,7 @@ <argument name="imageName" value="{{ImageMetadata.title}}"/> </actionGroup> <actionGroup ref="AdminMediaGalleryClickAddSelectedActionGroup" stepKey="clickAddSelectedImage"/> - <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMce4ActionGroup" stepKey="clickOkButton"/> + <actionGroup ref="AdminMediaGalleryClickOkButtonTinyMceActionGroup" stepKey="clickOkButton"/> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory"/> <actionGroup ref="AdminOpenStandaloneMediaGalleryActionGroup" stepKey="openStandaloneMediaGallery"/> <actionGroup ref="AdminEnhancedMediaGalleryExpandFilterActionGroup" stepKey="expandFilters"/> diff --git a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/directory/directories.js b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/directory/directories.js index 5555baeabb66..3f195332cc99 100644 --- a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/directory/directories.js +++ b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/directory/directories.js @@ -192,7 +192,7 @@ define([ } this.selectedFolder(folderId); - $(this.deleteButtonSelector).removeAttr('disabled').removeClass('disabled'); + $(this.deleteButtonSelector).prop('disabled', false).removeClass('disabled'); } }); }); diff --git a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/grid/columns/image.js b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/grid/columns/image.js index e20e5a3235a6..fe5ecb31ea6b 100644 --- a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/grid/columns/image.js +++ b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/grid/columns/image.js @@ -304,7 +304,7 @@ define([ * Action to close the context menu in media gallery. */ closeContextMenu: function () { - $(this.gridSelector).click(); + $(this.gridSelector).trigger('click'); }, /** diff --git a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/grid/columns/image/actions.js b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/grid/columns/image/actions.js index 76e051072285..d0196b9d2e59 100644 --- a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/grid/columns/image/actions.js +++ b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/grid/columns/image/actions.js @@ -61,7 +61,7 @@ define([ if (!this.allowedActions.includes('delete')) { $.async('.media-gallery-delete-assets', function () { - $('.media-gallery-delete-assets').unbind('click').addClass('action-disabled'); + $('.media-gallery-delete-assets').off('click').addClass('action-disabled'); }); } @@ -72,7 +72,7 @@ define([ * Initialize image action events */ initEvents: function () { - $(this.imageModel().addSelectedBtnSelector).click(function () { + $(this.imageModel().addSelectedBtnSelector).on('click', function () { image.insertImage( this.imageModel().getSelected(), { @@ -81,7 +81,7 @@ define([ } ); }.bind(this)); - $(this.imageModel().deleteSelectedBtnSelector).click(function () { + $(this.imageModel().deleteSelectedBtnSelector).on('click', function () { this.deleteImageAction(this.imageModel().selected()); }.bind(this)); diff --git a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/grid/columns/image/insertImageAction.js b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/grid/columns/image/insertImageAction.js index 322b29c92ca5..34e3e924d848 100644 --- a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/grid/columns/image/insertImageAction.js +++ b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/grid/columns/image/insertImageAction.js @@ -49,7 +49,7 @@ define([ if (targetElement.is('textarea')) { this.insertAtCursor(targetElement.get(0), data.content); targetElement.focus(); - $(targetElement).change(); + $(targetElement).trigger('change'); } else { targetElement.val(data.content) .data('size', data.size) diff --git a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/image/image-edit.js b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/image/image-edit.js index e1404a16d712..806c78f20c42 100644 --- a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/image/image-edit.js +++ b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/image/image-edit.js @@ -219,7 +219,7 @@ define([ if (key === 'enterKey') { event.preventDefault(); - modalElement.find('.page-action-buttons button.save').click(); + modalElement.find('.page-action-buttons button.save').trigger('click'); } return true; diff --git a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/validation/validate-image-description.js b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/validation/validate-image-description.js index 127f1676015f..eec95764a7ef 100644 --- a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/validation/validate-image-description.js +++ b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/validation/validate-image-description.js @@ -12,7 +12,7 @@ define([ $.validator.addMethod( 'validate-image-description', function (value) { - return /^[a-zA-Z0-9\-\_\.\,\n\ ]+$|^$/i.test(value); + return /^[a-zA-Z0-9\-\_\.\,\n\s]+$|^$/i.test(value); }, $.mage.__('Please use only letters (a-z or A-Z), numbers (0-9), ' + 'dots (.), commas(,), underscores (_), dashes (-), and spaces on this field.')); diff --git a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/validation/validate-image-title.js b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/validation/validate-image-title.js index 1429be64b7d1..0a55a22ab1a1 100644 --- a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/validation/validate-image-title.js +++ b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/validation/validate-image-title.js @@ -12,7 +12,7 @@ define([ $.validator.addMethod( 'validate-image-title', function (value) { - return /^[a-zA-Z0-9\-\_\.\,\ ]+$/i.test(value); + return /^[a-zA-Z0-9\-\_\.\,\s]+$/i.test(value); }, $.mage.__('Please use only letters (a-z or A-Z), numbers (0-9), dots (.), commas(,), ' + 'underscores (_), dashes(-) and spaces on this field.')); diff --git a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/grid/filter/checkbox.html b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/grid/filter/checkbox.html index d1840fdb3dc8..19a2a52aca16 100644 --- a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/grid/filter/checkbox.html +++ b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/grid/filter/checkbox.html @@ -7,7 +7,7 @@ <div class="admin__field admin__media-gallery-image-checkbox" visible="visible" css="$data.additionalClasses"> <div class="admin__field-control"> <label class="admin__form-field-label" if="$data.label" attr="for: uid"> - <span translate="label" attr="'data-config-scope': $data.scopeLabel" /> + <span translate="label" attr="'data-config-scope': $data.scopeLabel"></span> </label> </div> <div class="admin__field admin__field-option"> @@ -19,6 +19,6 @@ hasFocus="focused" attr="id: uid, name: inputName"/> - <label class="admin__field-label" text="description" attr="for: uid"/> + <label class="admin__field-label" text="description" attr="for: uid"></label> </div> </div> diff --git a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/grid/filters/elements/ui-select.html b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/grid/filters/elements/ui-select.html index a0d21672eafd..0533eede74d7 100644 --- a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/grid/filters/elements/ui-select.html +++ b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/grid/filters/elements/ui-select.html @@ -28,7 +28,7 @@ <div data-role="spinner" class="admin__data-grid-loading-mask" visible="validationLoading" if="validationLoading"> <div class="spinner"> - <span repeat="8"/> + <span repeat="8"></span> </div> </div> </div> @@ -54,7 +54,7 @@ <div class="action-menu" css="{ _active: listVisible}"> <div data-role="spinner" class="admin__data-grid-loading-mask" visible="loading" if="loading"> <div class="spinner"> - <span repeat="8"/> + <span repeat="8"></span> </div> </div> <if args="filterOptions"> @@ -73,7 +73,7 @@ </div> <div ifnot="options().length" class="admin__action-multiselect-empty-area"> - <ul text="emptyOptionsHtml"/> + <ul text="emptyOptionsHtml"></ul> </div> </if> <ul class="admin__action-multiselect-menu-inner _root" diff --git a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/grid/massactions/massactionButtons.html b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/grid/massactions/massactionButtons.html index a4294434c82b..7a2d3485c872 100644 --- a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/grid/massactions/massactionButtons.html +++ b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/grid/massactions/massactionButtons.html @@ -6,8 +6,8 @@ --> <button id="cancel_massaction" type="button" onclick="jQuery(window).trigger('terminateMassAction.MediaGallery')" class="massaction-buttons cancel"> - <span data-bind="i18n: 'Cancel'"/> + <span data-bind="i18n: 'Cancel'"></span> </button> <button id="delete_selected_massaction" onclick="jQuery('#delete_selected_massaction').trigger('massDelete.MediaGallery')" type="button" class="primary massaction-buttons cancel"> - <span data-bind="i18n: 'Delete Selected'"/> + <span data-bind="i18n: 'Delete Selected'"></span> </button> diff --git a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/grid/toolbar.html b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/grid/toolbar.html index fb7334a7b0d0..1b8d0a38f2bd 100644 --- a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/grid/toolbar.html +++ b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/grid/toolbar.html @@ -6,11 +6,11 @@ --> <div class="admin__data-grid-header" data-role="masonry-main-toolbar" afterRender="$data.setToolbarNode"> <div class="admin__data-grid-header-row"> - <div class="admin__data-grid-actions-wrap" each="getRegion('dataGridActions')" render=""/> + <div class="admin__data-grid-actions-wrap" each="getRegion('dataGridActions')" render=""></div> <each args="getRegion('dataGridFilters')" render=""/> </div> <div class="admin__data-grid-header-row row row-gutter"> - <div class="col-xs-2" if="hasChild('listing_massaction')" ko-scope="requestChild('listing_massaction')" render=""/> + <div class="col-xs-2" if="hasChild('listing_massaction')" ko-scope="requestChild('listing_massaction')" render=""></div> <div css=" 'col-xs-10': hasChild('listing_massaction'), 'col-xs-12': !hasChild('listing_massaction')"> @@ -22,7 +22,7 @@ <each args="getRegion('sorting')" render=""/> </div> <div class="col-xs-8" ko-scope="requestChild('listing_paging')"> - <div render=""/> + <div render=""></div> </div> </div> </div> diff --git a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/image-uploader.html b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/image-uploader.html index 6d5580b1aad6..2301eb641d55 100644 --- a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/image-uploader.html +++ b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/image-uploader.html @@ -11,7 +11,7 @@ </form> <div data-role="spinner" class="admin__data-grid-loading-mask" visible="loader"> <div class="spinner"> - <span repeat="8"/> + <span repeat="8"></span> </div> </div> </div> diff --git a/app/code/Magento/MediaGalleryUiApi/README.md b/app/code/Magento/MediaGalleryUiApi/README.md index 005a445c68b2..1b955704cce1 100644 --- a/app/code/Magento/MediaGalleryUiApi/README.md +++ b/app/code/Magento/MediaGalleryUiApi/README.md @@ -4,10 +4,10 @@ The Magento_MediaGalleryUiApi module is responsible for the media gallery user i ## Extensibility -Extension developers can interact with the Magento_MediaGalleryUiApi module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGalleryUiApi module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryUiApi module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryUiApi module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaStorage/Helper/File/Storage/Database.php b/app/code/Magento/MediaStorage/Helper/File/Storage/Database.php index 05e2e836abad..e0f5509830a0 100644 --- a/app/code/Magento/MediaStorage/Helper/File/Storage/Database.php +++ b/app/code/Magento/MediaStorage/Helper/File/Storage/Database.php @@ -14,6 +14,9 @@ * * @api * @since 100.0.2 + * + * @deprecated Database Media Storage is deprecated + * */ class Database extends \Magento\Framework\App\Helper\AbstractHelper { diff --git a/app/code/Magento/MediaStorage/Model/Config/Backend/Storage/Media/Database.php b/app/code/Magento/MediaStorage/Model/Config/Backend/Storage/Media/Database.php index 1a55be299a75..81e6c5e028be 100644 --- a/app/code/Magento/MediaStorage/Model/Config/Backend/Storage/Media/Database.php +++ b/app/code/Magento/MediaStorage/Model/Config/Backend/Storage/Media/Database.php @@ -4,7 +4,9 @@ * See COPYING.txt for license details. */ namespace Magento\MediaStorage\Model\Config\Backend\Storage\Media; - +/** +* @deprecated Database Media Storage is deprecated +**/ class Database extends \Magento\Framework\App\Config\Value { /** diff --git a/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Database.php b/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Database.php index 83134c2ac00e..97f161e4c49d 100644 --- a/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Database.php +++ b/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Database.php @@ -12,6 +12,9 @@ use Magento\Framework\App\DeploymentConfig; use Magento\Framework\Config\ConfigOptionsListConstants; +/** + * @deprecated Database Media Storage is deprecated + **/ class Database implements \Magento\Framework\Option\ArrayInterface { /** diff --git a/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Storage.php b/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Storage.php index fb171831407e..c881b59c5c59 100644 --- a/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Storage.php +++ b/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Storage.php @@ -23,7 +23,7 @@ public function toOptionArray() 'value' => \Magento\MediaStorage\Model\File\Storage::STORAGE_MEDIA_FILE_SYSTEM, 'label' => __('File System'), ], - ['value' => \Magento\MediaStorage\Model\File\Storage::STORAGE_MEDIA_DATABASE, 'label' => __('Database')] + ['value' => \Magento\MediaStorage\Model\File\Storage::STORAGE_MEDIA_DATABASE, 'label' => __('Database (Deprecated)')] ]; } } diff --git a/app/code/Magento/MediaStorage/Model/File/Storage/Database.php b/app/code/Magento/MediaStorage/Model/File/Storage/Database.php index 2bdc69f45ccb..571dad7f0ae9 100644 --- a/app/code/Magento/MediaStorage/Model/File/Storage/Database.php +++ b/app/code/Magento/MediaStorage/Model/File/Storage/Database.php @@ -10,6 +10,8 @@ * * @api * @since 100.0.2 + * + * @deprecated Database Media Storage is deprecated */ class Database extends \Magento\MediaStorage\Model\File\Storage\Database\AbstractDatabase { diff --git a/app/code/Magento/MediaStorage/Model/File/Storage/Database/AbstractDatabase.php b/app/code/Magento/MediaStorage/Model/File/Storage/Database/AbstractDatabase.php index c9812b86e8b9..3528ca5743ff 100644 --- a/app/code/Magento/MediaStorage/Model/File/Storage/Database/AbstractDatabase.php +++ b/app/code/Magento/MediaStorage/Model/File/Storage/Database/AbstractDatabase.php @@ -7,7 +7,10 @@ /** * Class AbstractDatabase - */ + * + * @deprecated Database Media Storage is deprecated + * + **/ abstract class AbstractDatabase extends \Magento\Framework\Model\AbstractModel { /** diff --git a/app/code/Magento/MediaStorage/Model/File/Storage/Directory/Database.php b/app/code/Magento/MediaStorage/Model/File/Storage/Directory/Database.php index 2617e88e7538..03d5eee617b1 100644 --- a/app/code/Magento/MediaStorage/Model/File/Storage/Directory/Database.php +++ b/app/code/Magento/MediaStorage/Model/File/Storage/Directory/Database.php @@ -11,6 +11,8 @@ * * @api * @since 100.0.2 + * + * @deprecated Database Media Storage is deprecated */ class Database extends \Magento\MediaStorage\Model\File\Storage\Database\AbstractDatabase { diff --git a/app/code/Magento/MediaStorage/Model/File/Storage/File.php b/app/code/Magento/MediaStorage/Model/File/Storage/File.php index ffbc2e3e90aa..c47f578be138 100644 --- a/app/code/Magento/MediaStorage/Model/File/Storage/File.php +++ b/app/code/Magento/MediaStorage/Model/File/Storage/File.php @@ -58,6 +58,11 @@ class File */ protected $_logger; + /** + * @var \Magento\MediaStorage\Model\ResourceModel\File\Storage\File + */ + private $_fileUtility; + /** * @param \Psr\Log\LoggerInterface $logger * @param \Magento\MediaStorage\Helper\File\Storage\Database $storageHelper diff --git a/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/AbstractStorage.php b/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/AbstractStorage.php index 227b428328b7..0533c0229ea3 100644 --- a/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/AbstractStorage.php +++ b/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/AbstractStorage.php @@ -7,6 +7,8 @@ /** * Class AbstractStorage + * + * @deprecated Database Media Storage is deprecated */ abstract class AbstractStorage extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb { diff --git a/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Database.php b/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Database.php index ae896395b8eb..863b368883fb 100644 --- a/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Database.php +++ b/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Database.php @@ -10,6 +10,8 @@ * * @api * @since 100.0.2 + * + * @deprecated Database Media Storage is deprecated */ class Database extends \Magento\MediaStorage\Model\ResourceModel\File\Storage\AbstractStorage { diff --git a/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Directory/Database.php b/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Directory/Database.php index e5f54cac4af6..342761646e39 100644 --- a/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Directory/Database.php +++ b/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Directory/Database.php @@ -7,6 +7,8 @@ /** * Class Database + * + * @deprecated Database Media Storage is deprecated */ class Database extends \Magento\MediaStorage\Model\ResourceModel\File\Storage\AbstractStorage { diff --git a/app/code/Magento/Msrp/Helper/Data.php b/app/code/Magento/Msrp/Helper/Data.php index 2f6dd2da9bbc..86ff76610251 100644 --- a/app/code/Magento/Msrp/Helper/Data.php +++ b/app/code/Magento/Msrp/Helper/Data.php @@ -51,6 +51,11 @@ class Data extends AbstractHelper */ private $msrpPriceCalculator; + /** + * @var \Magento\Msrp\Model\Msrp + */ + private $msrp; + /** * @param Context $context * @param StoreManagerInterface $storeManager diff --git a/app/code/Magento/Msrp/README.md b/app/code/Magento/Msrp/README.md new file mode 100644 index 000000000000..025b215d285a --- /dev/null +++ b/app/code/Magento/Msrp/README.md @@ -0,0 +1,123 @@ +# Magento_Msrp module + +The **Magento_Msrp** module is responsible for Manufacturer’s Suggested Retail Price functionality. +A current module provides base functional for msrp pricing rendering, configuration and calculation. + +## Installation +The Magento_Msrp module creates the following attributes: + +Entity type - `catalog_product`. + +Attribute group - `Advanced Pricing`. + +- `msrp` - Manufacturer's Suggested Retail Price +- `msrp_display_actual_price_type` -Display Actual Price + +**Pay attention** if described attributes not removed when the module is removed/disabled, it would trigger errors +because they use models and blocks from Magento_Msrp module: +- `\Magento\Msrp\Block\Adminhtml\Product\Helper\Form\Type` +- `\Magento\Msrp\Model\Product\Attribute\Source\Type\Price` +- `\Magento\Msrp\Block\Adminhtml\Product\Helper\Form\Type\Price` + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Structure +`Pricing\` - directory contains interfaces and implementation for msrp pricing calculations + (`\Magento\Msrp\Pricing\MsrpPriceCalculatorInterface`), price renderers + and price models. + +`Pricing\Price\` - the directory contains declares msrp price model interfaces and implementations. + +`Pricing\Renderer\` - contains price renderers implementations. + +For information about a typical file structure of a module in Magento 2, + see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). + +## Extensibility + + Developers can pass custom `msrpPriceCalculators` for `Magento\Msrp\Pricing\MsrpPriceCalculator` using type configuration using `di.xml`. + + For example: + ``` + <type name="Magento\Msrp\Pricing\MsrpPriceCalculator"> + <arguments> + <argument name="msrpPriceCalculators" xsi:type="array"> + <item name="configurable" xsi:type="array"> + <item name="productType" xsi:type="const">Magento\ConfigurableProduct\Model\Product\Type\Configurable::TYPE_CODE</item> + <item name="priceCalculator" xsi:type="object">Magento\MsrpConfigurableProduct\Pricing\MsrpPriceCalculator</item> + </item> + </argument> + </arguments> + </type> +``` + More information about [type configuration](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/di-xml-file.html). + + Extension developers can interact with the Magento_Msrp module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Msrp module. + +### Events + +This module observes the following event: + +`etc/frontend/` + + - `sales_quote_collect_totals_after` in the `Magento\Msrp\Observer\Frontend\Quote\SetCanApplyMsrpObserver` file. + +`etc/webapi_rest` + - `sales_quote_collect_totals_after` in the `Magento\Msrp\Observer\Frontend\Quote\SetCanApplyMsrpObserver` file. + +`etc/webapi_soap` + - `sales_quote_collect_totals_after` in the `Magento\Msrp\Observer\Frontend\Quote\SetCanApplyMsrpObserver` file. + +For information about an event in Magento 2, see [Events and observers](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). + +### Layouts + +The module interacts with the following layout handles: + +`view/base/layout` directory: + +- `catalog_product_prices` +- `cms_index_index` + +`view/frontend/layout` directory: + +- `catalog_category_view` +- `catalog_product_compare_index` +- `catalog_product_view` +- `catalogsearch_advanced_result` +- `catalogsearch_result_index` +- `checkout_cart_sidebar_total_renderers` +- `checkout_onepage_failure` +- `checkout_onepage_success` +- `review_product_list` +- `wishlist_index_configure_type_downloadable` +- `wishlist_index_index` +- `wishlist_search_view` +- `wishlist_shared_index` + +This module introduces the following layouts and layout handles: + +`view/frontend/layout` directory: + +- `msrp_popup` + +### UI components + +Module provides product admin form modifier: + +`Magento\Msrp\Ui\DataProvider\Product\Form\Modifier\Msrp` - removes `msrp_display_actual_price_type` field from the form if config disabled else adds `validate-zero-or-greater` validation to the fild. + +## Additional information + +### Catalog attributes + +A current module extends `etc/catalog_attributes.xml` and provides following attributes for `quote_item` group: +- `msrp` +- `msrp_display_actual_price_type` + +### Extension Attributes +The Magento_Msrp provides extension attributes for `Magento\Catalog\Api\Data\ProductRender\PriceInfoInterface` +- attribute code: `msrp` +- attribute type: `Magento\Msrp\Api\Data\ProductRender\MsrpPriceInfoInterface` diff --git a/app/code/Magento/Msrp/Test/Mftf/ActionGroup/StorefrontAssertRelatedProductMapOnProductPageActionGroup.xml b/app/code/Magento/Msrp/Test/Mftf/ActionGroup/StorefrontAssertRelatedProductMapOnProductPageActionGroup.xml new file mode 100644 index 000000000000..ec556d1b9710 --- /dev/null +++ b/app/code/Magento/Msrp/Test/Mftf/ActionGroup/StorefrontAssertRelatedProductMapOnProductPageActionGroup.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontAssertRelatedProductMapOnProductPageActionGroup" extends="StorefrontAssertRelatedProductOnProductPageActionGroup"> + <annotations> + <description>Validates provided Product Name and Minimum Advertised Price on Product details page.</description> + </annotations> + <arguments> + <argument name="relatedProductMap" type="string"/> + </arguments> + + <seeElement selector="{{StorefrontCategoryProductSection.relatedProductMapPrice}}" stepKey="seeFirstRelatedProductMapPrice"/> + <grabTextFrom selector="{{StorefrontCategoryProductSection.relatedProductMapPrice}}" stepKey="grabFirstRelatedProductMapPrice"/> + <assertEquals stepKey="assertFirstRelatedProductMapPrice"> + <actualResult type="const">($grabFirstRelatedProductMapPrice)</actualResult> + <expectedResult type="string">${{relatedProductMap}}</expectedResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Msrp/Test/Mftf/ActionGroup/StorefrontConfigurableProductCheckMapActionGroup.xml b/app/code/Magento/Msrp/Test/Mftf/ActionGroup/StorefrontConfigurableProductCheckMapActionGroup.xml new file mode 100644 index 000000000000..df086097a915 --- /dev/null +++ b/app/code/Magento/Msrp/Test/Mftf/ActionGroup/StorefrontConfigurableProductCheckMapActionGroup.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontConfigurableProductCheckMapActionGroup"> + <annotations> + <description>Check MAP of configurable product options on store-front.</description> + </annotations> + <arguments> + <argument name="productMap" type="string"/> + <argument name="productAttributeOptionValue" type="string"/> + </arguments> + + <!--Check msrp for configurable product option --> + <selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="{{productAttributeOptionValue}}" stepKey="selectOption"/> + <waitForElement selector="{{StorefrontProductInfoMainSection.mapPrice}}" stepKey="waitForLoad"/> + <grabTextFrom selector="{{StorefrontProductInfoMainSection.mapPrice}}" stepKey="grabProductMapPrice"/> + <assertEquals stepKey="assertProductMapPrice"> + <actualResult type="const">($grabProductMapPrice)</actualResult> + <expectedResult type="string">${{productMap}}</expectedResult> + </assertEquals> + <seeElement selector="{{StorefrontProductInfoMainSection.clickForPriceLink}}" stepKey="checkClickForPriceLinkForProduct"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Msrp/Test/Mftf/Data/MsrpSettingsData.xml b/app/code/Magento/Msrp/Test/Mftf/Data/MsrpSettingsData.xml index 3922bb486891..941f4acbcc4e 100644 --- a/app/code/Magento/Msrp/Test/Mftf/Data/MsrpSettingsData.xml +++ b/app/code/Magento/Msrp/Test/Mftf/Data/MsrpSettingsData.xml @@ -21,4 +21,11 @@ <entity name="DisableMAP" type="msrp_settings_config"> <data key="value">0</data> </entity> + + <entity name="MsrpDisplayPriceOnGesture" type="msrp_settings_config"> + <requiredEntity type="display_price_type">DisplayPriceOnGesture</requiredEntity> + </entity> + <entity name="DisplayPriceOnGesture" type="msrp_settings_config"> + <data key="value">1</data> + </entity> </entities> diff --git a/app/code/Magento/Msrp/Test/Mftf/Data/ProductData.xml b/app/code/Magento/Msrp/Test/Mftf/Data/ProductData.xml index aa79b6032df4..6f2d4623d23c 100644 --- a/app/code/Magento/Msrp/Test/Mftf/Data/ProductData.xml +++ b/app/code/Magento/Msrp/Test/Mftf/Data/ProductData.xml @@ -13,4 +13,17 @@ <requiredEntity type="custom_attribute_array">ApiProductCost</requiredEntity> <requiredEntity type="custom_attribute_array">ApiProductMsrp</requiredEntity> </entity> + <entity name="SimpleProductWithMsrp" type="product" extends="SimpleProduct"> + <data key="price">100.00</data> + <requiredEntity type="custom_attribute_array">ApiProductMsrp</requiredEntity> + </entity> + <entity name="SimpleProductMap1"> + <data key="price">55.00</data> + </entity> + <entity name="SimpleProductMap2"> + <data key="price">65.00</data> + </entity> + <entity name="SimpleProductMap3"> + <data key="price">155.00</data> + </entity> </entities> diff --git a/app/code/Magento/Msrp/Test/Mftf/Metadata/MsrpSettingsMeta.xml b/app/code/Magento/Msrp/Test/Mftf/Metadata/MsrpSettingsMeta.xml index be91a548ad90..d12107dc6319 100644 --- a/app/code/Magento/Msrp/Test/Mftf/Metadata/MsrpSettingsMeta.xml +++ b/app/code/Magento/Msrp/Test/Mftf/Metadata/MsrpSettingsMeta.xml @@ -14,8 +14,11 @@ <object key="enabled" dataType="enabled"> <field key="value">string</field> </object> + <object key="display_price_type" dataType="display_price_type"> + <field key="value">string</field> + </object> </object> </object> </object> </operation> -</operations> \ No newline at end of file +</operations> diff --git a/app/code/Magento/Msrp/Test/Mftf/Page/StorefrontCategoryPage.xml b/app/code/Magento/Msrp/Test/Mftf/Page/StorefrontCategoryPage.xml new file mode 100644 index 000000000000..4fd3f3f44507 --- /dev/null +++ b/app/code/Magento/Msrp/Test/Mftf/Page/StorefrontCategoryPage.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="StorefrontCategoryPage" url="/{{var1}}.html" area="storefront" module="Magento_Catalog" parameterized="true"> + <section name="StorefrontMsrpPopupSection"/> + </page> +</pages> diff --git a/app/code/Magento/Msrp/Test/Mftf/Section/StorefrontCategoryProductSection.xml b/app/code/Magento/Msrp/Test/Mftf/Section/StorefrontCategoryProductSection.xml new file mode 100644 index 000000000000..80bcf3264dd0 --- /dev/null +++ b/app/code/Magento/Msrp/Test/Mftf/Section/StorefrontCategoryProductSection.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontCategoryProductSection"> + <element name="clickForPrice" type="button" selector="//a[normalize-space() = '{{productName}}']/following::div[@data-role='priceBox']/a[@class='action map-show-info']" parameterized="true" timeout="30"/> + <element name="mapPrice" type="button" selector="//a[normalize-space() = '{{productName}}']/following::div[@data-role='priceBox']//span[contains(@class, 'price-msrp_price')]" parameterized="true" timeout="30"/> + <element name="relatedProductMapPrice" type="text" selector="//*[@class='block related']//span[contains(@class, 'price-msrp_price')]"/> + </section> +</sections> diff --git a/app/code/Magento/Msrp/Test/Mftf/Section/StorefrontMsrpPopupSection.xml b/app/code/Magento/Msrp/Test/Mftf/Section/StorefrontMsrpPopupSection.xml new file mode 100644 index 000000000000..8f4a5952bce6 --- /dev/null +++ b/app/code/Magento/Msrp/Test/Mftf/Section/StorefrontMsrpPopupSection.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontMsrpPopupSection"> + <element name="addToCartButton" type="button" selector="#map-popup-click-for-price .action.tocart" timeout="30"/> + </section> +</sections> diff --git a/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontAddMapProductToCartFromPopupOnCategoryPageTest.xml b/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontAddMapProductToCartFromPopupOnCategoryPageTest.xml new file mode 100644 index 000000000000..86732ba1e18b --- /dev/null +++ b/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontAddMapProductToCartFromPopupOnCategoryPageTest.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontAddMapProductToCartFromPopupOnCategoryPageTest"> + <annotations> + <features value="Msrp"/> + <stories value="Minimum advertised price"/> + <title value="Add simple product with minimum advertised price to cart from popup on category page"/> + <description value="Check that simple product with minimum advertised price is successfully added to cart from popup on category page"/> + <severity value="MAJOR"/> + <testCaseId value="MC-40419"/> + <useCaseId value="MC-35640"/> + <group value="msrp"/> + </annotations> + <before> + <!-- Enable Minimum advertised Price --> + <createData entity="MsrpEnableMAP" stepKey="enableMAP"/> + + <!-- Display Price in Popup --> + <createData entity="MsrpDisplayPriceOnGesture" stepKey="displayPriceOnGesture"/> + + <!-- Create category --> + <createData entity="_defaultCategory" stepKey="createCategory"/> + + <!-- Create product with MAP --> + <createData entity="SimpleProductWithMsrp" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + </before> + <after> + <!-- Delete product and category --> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + + <!-- Disable Minimum advertised Price --> + <createData entity="MsrpDisableMAP" stepKey="disableMAP"/> + </after> + + <!-- Open created category on Storefront --> + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage"> + <argument name="category" value="$createCategory$"/> + </actionGroup> + + <!-- Grab and verify MAP price --> + <grabTextFrom selector="{{StorefrontCategoryProductSection.mapPrice($createProduct.name$)}}" stepKey="grabMapPrice"/> + <assertEquals stepKey="assertMapPrice"> + <actualResult type="variable">grabMapPrice</actualResult> + <expectedResult type="string">${{ApiProductMsrp.value}}</expectedResult> + </assertEquals> + + <!-- Open 'Click for price' popup and click 'Add to Cart' button --> + <click selector="{{StorefrontCategoryProductSection.clickForPrice($createProduct.name$)}}" stepKey="clickForPrice"/> + <waitForElementVisible selector="{{StorefrontMsrpPopupSection.addToCartButton}}" stepKey="waitForAddToCartButton"/> + <click selector="{{StorefrontMsrpPopupSection.addToCartButton}}" stepKey="clickAddToCartButton"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added $createProduct.name$ to your shopping cart." stepKey="assertSuccessMessage"/> + </test> +</tests> diff --git a/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontConfigurableProductWithMapAndRelatedProductTest.xml b/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontConfigurableProductWithMapAndRelatedProductTest.xml new file mode 100644 index 000000000000..5ef73f4dfed4 --- /dev/null +++ b/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontConfigurableProductWithMapAndRelatedProductTest.xml @@ -0,0 +1,157 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontConfigurableProductWithMapAndRelatedProductTest"> + <annotations> + <features value="Msrp"/> + <stories value="Minimum advertised price"/> + <title value="Check related and simple products with MAP assigned to configurable product displayed correctly"/> + <description value="Check related and simple products with MAP assigned to configurable product displayed correctly"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-41948"/> + <useCaseId value="MC-41853"/> + <group value="Msrp"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + + <!--Create category--> + <createData entity="SimpleSubCategory" stepKey="createCategory"/> + + <!-- Create the configurable product --> + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <!-- Make the configurable product have two options, that are children of the default attribute set --> + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + <createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </getData> + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </getData> + + <!-- Create the 2 children that will be a part of the configurable product --> + <createData entity="ApiSimpleProductWithPrice50" stepKey="createConfigChildProduct1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + </createData> + <createData entity="ApiSimpleProductWithPrice60" stepKey="createConfigChildProduct2"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption2"/> + </createData> + + <!-- Assign the two products to the configurable product --> + <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + <requiredEntity createDataKey="getConfigAttributeOption2"/> + </createData> + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigChildProduct1"/> + </createData> + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigChildProduct2"/> + </createData> + + <!-- Create simple product which will be related to configurable product --> + <createData entity="SimpleProduct2" stepKey="createRelatedProduct"/> + + <!--Enable Minimum advertised Price--> + <createData entity="MsrpEnableMAP" stepKey="enableMAP"/> + </before> + <after> + <!--Delete created data--> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> + <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/> + <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> + + <!-- Delete related products --> + <deleteData createDataKey="createRelatedProduct" stepKey="deleteRelatedProduct"/> + + <!--Disable Minimum advertised Price--> + <createData entity="MsrpDisableMAP" stepKey="disableMAP"/> + + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> + + <!-- Reindex invalidated indices after product attribute has been created/deleted --> + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> + </after> + + <!-- Set Minimum Advertised Price to configurable products --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToFirstChildProductEditPage"> + <argument name="productId" value="$$createConfigChildProduct1.id$$"/> + </actionGroup> + <actionGroup ref="AdminSetAdvancedPricingActionGroup" stepKey="setMsrpForFirstChildProduct"> + <argument name="advancedPrice" value="{{SimpleProductMap1.price}}"/> + </actionGroup> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToSecondChildProductEditPage"> + <argument name="productId" value="$$createConfigChildProduct2.id$$"/> + </actionGroup> + <actionGroup ref="AdminSetAdvancedPricingActionGroup" stepKey="setMsrpForSecondChildProduct"> + <argument name="advancedPrice" value="{{SimpleProductMap2.price}}"/> + </actionGroup> + + <!-- Add related product to configurable product --> + <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForConfigProduct"> + <argument name="product" value="$$createConfigProduct$$"/> + </actionGroup> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct"> + <argument name="product" value="$$createConfigProduct$$"/> + </actionGroup> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct"> + <argument name="sku" value="$$createRelatedProduct.sku$$"/> + </actionGroup> + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButtonConfigurableProduct"/> + + <!-- Set Minimum Advertised Price to related product --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToRelatedProductEditPage"> + <argument name="productId" value="$$createRelatedProduct.id$$"/> + </actionGroup> + <actionGroup ref="AdminSetAdvancedPricingActionGroup" stepKey="setMsrpForRelatedProduct"> + <argument name="advancedPrice" value="{{SimpleProductMap3.price}}"/> + </actionGroup> + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButtonRelatedProduct"/> + + <!--Go to store front and check msrp for products--> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrlKey" value="$$createConfigProduct.custom_attributes[url_key]$$"/> + </actionGroup> + <actionGroup ref="StorefrontConfigurableProductCheckMapActionGroup" stepKey="checkMapForConfigurableProductOption2"> + <argument name="productMap" value="{{SimpleProductMap2.price}}"/> + <argument name="productAttributeOptionValue" value="$$getConfigAttributeOption2.value$$"/> + </actionGroup> + <actionGroup ref="StorefrontConfigurableProductCheckMapActionGroup" stepKey="checkMapForConfigurableProduct"> + <argument name="productMap" value="{{SimpleProductMap1.price}}"/> + <argument name="productAttributeOptionValue" value="$$getConfigAttributeOption1.value$$"/> + </actionGroup> + + <!--Check related product map price --> + <actionGroup ref="StorefrontAssertRelatedProductMapOnProductPageActionGroup" stepKey="checkMapForRelatedProductOption1"> + <argument name="relatedProductMap" value="{{SimpleProductMap3.price}}"/> + <argument name="productName" value="$createRelatedProduct.name$"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml b/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml index 1a27bf5aa56a..42bf5772e96e 100644 --- a/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml +++ b/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml @@ -131,10 +131,7 @@ <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton1"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> - <!--Clear cache--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Go to store front and check msrp for products--> <amOnPage url="{{StorefrontProductPage.url($$createConfigProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToConfigProductPage"/> diff --git a/app/code/Magento/Msrp/view/base/templates/product/price/msrp.phtml b/app/code/Magento/Msrp/view/base/templates/product/price/msrp.phtml index 4e011df66974..95d2ced72912 100644 --- a/app/code/Magento/Msrp/view/base/templates/product/price/msrp.phtml +++ b/app/code/Magento/Msrp/view/base/templates/product/price/msrp.phtml @@ -80,12 +80,9 @@ $priceElementIdPrefix = $block->getPriceElementIdPrefix() ? $block->getPriceElem $data['addToCartButton'] = '#product_addtocart_form [type=submit]'; } else { $data['addToCartButton'] = sprintf( - 'form:has(input[type="hidden"][name="product"][value="%s"]) button[type="submit"]', - (int) $productId . ',' . - sprintf( - '.block.widget .price-box[data-product-id=%s]+.product-item-actions button.tocart', - (int)$productId - ) + 'form:has(input[type="hidden"][name="product"][value="%1$s"]) button[type="submit"],' . + '.block.widget .price-box[data-product-id="%1$s"]+.product-item-actions button.tocart', + $productId ); } ?> diff --git a/app/code/Magento/Msrp/view/base/web/js/msrp.js b/app/code/Magento/Msrp/view/base/web/js/msrp.js index db407fbb22ce..07bb5fa10d49 100644 --- a/app/code/Magento/Msrp/view/base/web/js/msrp.js +++ b/app/code/Magento/Msrp/view/base/web/js/msrp.js @@ -172,7 +172,7 @@ define([ ev.preventDefault(); if (this.options.addToCartButton) { - $(this.options.addToCartButton).click(); + $(this.options.addToCartButton).trigger('click'); this.closePopup(this.$popup); } }, @@ -199,7 +199,7 @@ define([ this.options.inputQty && !isNaN(this.tierOptions.qty) ) { $(this.options.inputQty).val(this.tierOptions.qty); - $(this.options.addToCartButton).click(); + $(this.options.addToCartButton).trigger('click'); this.closePopup(this.$popup); } }, @@ -280,7 +280,7 @@ define([ } if (this.options.addToCartButton) { - $(this.options.addToCartButton).click(); + $(this.options.addToCartButton).trigger('click'); return false; } @@ -290,7 +290,7 @@ define([ } e.preventDefault(); - $(this.options.cartForm).submit(); + $(this.options.cartForm).trigger('submit'); }, /** diff --git a/app/code/Magento/Msrp/view/frontend/templates/render/item/price_msrp_item.phtml b/app/code/Magento/Msrp/view/frontend/templates/render/item/price_msrp_item.phtml index d2a0982586ee..04abde81a7fe 100644 --- a/app/code/Magento/Msrp/view/frontend/templates/render/item/price_msrp_item.phtml +++ b/app/code/Magento/Msrp/view/frontend/templates/render/item/price_msrp_item.phtml @@ -34,7 +34,7 @@ <?php endif; ?> <?php if ($_catalogHelper->isShowPriceOnGesture($_product)): ?> <?php $priceElementId = 'product-price-' . $_id . $block->getIdSuffix(); ?> - <span id="<?= /* @noEscape */ $priceElementId ?>"/> + <span id="<?= /* @noEscape */ $priceElementId ?>"></span> <?= /* @noEscape */ $secureRenderer->renderStyleAsTag("display: none", '#'. $priceElementId) ?> <?php $popupId = 'msrp-popup-' . $_id . $block->getRandomString(20); ?> diff --git a/app/code/Magento/Msrp/view/frontend/web/js/product/list/columns/msrp-price.js b/app/code/Magento/Msrp/view/frontend/web/js/product/list/columns/msrp-price.js index 7f1acf7e89b7..eda44b89a7be 100644 --- a/app/code/Magento/Msrp/view/frontend/web/js/product/list/columns/msrp-price.js +++ b/app/code/Magento/Msrp/view/frontend/web/js/product/list/columns/msrp-price.js @@ -86,6 +86,26 @@ define([ return row['price_info']['extension_attributes'].msrp; }, + /** + * UnsanitizedHtml version of getPrice. + * + * @param {Object} row + * @returns {String} + */ + getPriceUnsanitizedHtml: function (row) { + return this.getPrice(row); + }, + + /** + * Get msrp_price property of a price. + * + * @param {Object} row + * @return {HTMLElement} final price html + */ + getMsrpPriceUnsanitizedHtml: function (row) { + return this.getPrice(row)['msrp_price']; + }, + /** * Returns path to the columns' body template. * @@ -113,6 +133,15 @@ define([ return this.getPrice(row)['msrp_message']; }, + /** + * UnsanitizedHtml version of getMsrpPriceMessage. + * + * @returns {String} + */ + getMsrpPriceMessageUnsanitizedHtml: function (row) { + return this.getMsrpPriceMessage(row); + }, + /** * Get msrp price supporting text, when actual price is hidden. * @@ -120,6 +149,15 @@ define([ */ getExplanationMessage: function (row) { return this.getPrice(row)['explanation_message']; + }, + + /** + * UnsanitizedHtml version of getExplanationMessage. + * + * @returns {String} + */ + getExplanationMessageUnsanitizedHtml: function (row) { + return this.getExplanationMessage(row); } }); }); diff --git a/app/code/Magento/Msrp/view/frontend/web/template/product/item/popup.html b/app/code/Magento/Msrp/view/frontend/web/template/product/item/popup.html index d081df134ce3..23cf450bf93b 100644 --- a/app/code/Magento/Msrp/view/frontend/web/template/product/item/popup.html +++ b/app/code/Magento/Msrp/view/frontend/web/template/product/item/popup.html @@ -1,6 +1,6 @@ <!-- /** - * Copyright © 2017 Magento. All rights reserved. + * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> @@ -10,19 +10,19 @@ <div class="price-box"> <div class="map-msrp"> <span class="label" - translate="'Price'"/> + translate="'Price'"></span> <span class="old-price map-old-price"> <span class="price-container price-msrp"> <span class="price-wrapper" - html="getPrice($row())['msrp_price']"/> + html="getMsrpPriceUnsanitizedHtml($row())"></span> </span> </span> </div> <div class="map-price"> <span class="label" - translate="'Actual Price'"/> + translate="'Actual Price'"></span> <span class="actual-price"> <if args="isAllowed()"> @@ -38,11 +38,11 @@ <div class="map-form-addtocart"> <with args="$parent.getComponentByCode('addtocart-button')"> - <render args="getBody()" /> + <render args="getBody()"/> </with> </div> </div> <div class="map-text" - html="getExplanationMessage($row())"/> + html="getExplanationMessageUnsanitizedHtml($row())"></div> </div> diff --git a/app/code/Magento/Msrp/view/frontend/web/template/product/price/price_box.html b/app/code/Magento/Msrp/view/frontend/web/template/product/price/price_box.html index 4c0c57bcacf7..f427a3557206 100644 --- a/app/code/Magento/Msrp/view/frontend/web/template/product/price/price_box.html +++ b/app/code/Magento/Msrp/view/frontend/web/template/product/price/price_box.html @@ -12,7 +12,7 @@ <span class="price-wrapper" data-price-amount="" data-price-type="" - html="getPrice($row())['msrp_price']"/> + html="getMsrpPriceUnsanitizedHtml($row())"></span> </span> </span> @@ -21,7 +21,7 @@ class="action map-show-info" data-role="msrp-popup-trigger" aria-haspopup="true"> - <span translate="'Click for price'"/> + <span translate="'Click for price'"></span> </button> <render args="popupTmpl"/> @@ -29,7 +29,7 @@ <ifnot args="isShowPriceOnGesture($row())"> <span class="msrp-message" - html="getMsrpPriceMessage($row())" /> + html="getMsrpPriceMessageUnsanitizedHtml($row())"></span> </ifnot> </div> diff --git a/app/code/Magento/MsrpConfigurableProduct/README.md b/app/code/Magento/MsrpConfigurableProduct/README.md index 8911b6e9e666..f3f24170c944 100644 --- a/app/code/Magento/MsrpConfigurableProduct/README.md +++ b/app/code/Magento/MsrpConfigurableProduct/README.md @@ -1,3 +1,34 @@ -# MsrpConfigurableProduct +# Magento_MsrpConfigurableProduct module -**MsrpConfigurableProduct** provides type and resolver information for the Msrp module from the ConfigurableProduct module. \ No newline at end of file +The **Magento_MsrpConfigurableProduct** module provides type and resolver information for the Magento_Msrp module from the ConfigurableProduct module. +Provides implementation of msrp price calculation for Configurable Product. + +## Installation + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html) + +## Structure + +`Pricing\` - directory contains implementation of msrp price calculation +for Grouped Product (`Magento\MsrpGroupedProduct\Pricing\MsrpPriceCalculator` class). + +For information about a typical file structure of a module in Magento 2, + see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). + +## Extensibility + + Extension developers can interact with the Magento_Msrp module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Msrp module. + +### Layouts + +For more information about a layout in Magento 2, see the [Layout documentation](http://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html). + +### UI components + +For information about a UI component in Magento 2, see [Overview of UI components](http://devdocs.magento.com/guides/v2.3/ui_comp_guide/bk-ui_comps.html). + +## Additional information + +For information about significant changes in patch releases, see [2.4.x Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MsrpGroupedProduct/README.md b/app/code/Magento/MsrpGroupedProduct/README.md index d597ba7fc18a..800bf0eedd74 100644 --- a/app/code/Magento/MsrpGroupedProduct/README.md +++ b/app/code/Magento/MsrpGroupedProduct/README.md @@ -1,3 +1,39 @@ -# MsrpGroupedProduct +# Magento_MsrpGroupedProduct module -**MsrpGroupedProduct** provides type and resolver information for the Msrp module from the GroupedProduct module. \ No newline at end of file +**Magento_MsrpGroupedProduct** module provides type and resolver information for the Msrp module from the GroupedProduct module. +Provides implementation of msrp price calculation for Grouped Product. + +## Installation + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html) + +## Structure + +`Pricing\` - directory contains implementation of msrp price calculation +for Configurable Product (`Magento\MsrpConfigurableProduct\Pricing\MsrpPriceCalculator` class). + +For information about a typical file structure of a module in Magento 2, + see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). + +## Extensibility + + Extension developers can interact with the Magento_Msrp module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Msrp module. + +### Layouts + +For more information about a layout in Magento 2, see the [Layout documentation](http://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html). + +### UI components + +For information about a UI component in Magento 2, see [Overview of UI components](http://devdocs.magento.com/guides/v2.3/ui_comp_guide/bk-ui_comps.html). + +## Additional information + +### collection attributes + +Module adds attribute `msrp` to select for the `Magento\Catalog\Model\ResourceModel\Product\Link\Product\Collection` +in `Magento\MsrpGroupedProduct\Plugin\Model\Product\Type\Grouped` plugin. + +For information about significant changes in patch releases, see [2.4.x Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/Multishipping/Block/Checkout/Overview.php b/app/code/Magento/Multishipping/Block/Checkout/Overview.php index e4d2efd50de5..d08f6e22b57b 100644 --- a/app/code/Magento/Multishipping/Block/Checkout/Overview.php +++ b/app/code/Magento/Multishipping/Block/Checkout/Overview.php @@ -136,7 +136,8 @@ protected function _prepareLayout() 'after' => '-', 'form_id' => CaptchaPaymentProcessingRateLimiter::CAPTCHA_FORM, 'image_width' => 230, - 'image_height' => 230 + 'image_height' => 230, + 'frontend_validation' => false ] ); } diff --git a/app/code/Magento/Multishipping/Block/Checkout/Shipping.php b/app/code/Magento/Multishipping/Block/Checkout/Shipping.php index 99450fc53807..29ff5c87cba9 100644 --- a/app/code/Magento/Multishipping/Block/Checkout/Shipping.php +++ b/app/code/Magento/Multishipping/Block/Checkout/Shipping.php @@ -35,6 +35,11 @@ class Shipping extends \Magento\Sales\Block\Items\AbstractItems */ protected $priceCurrency; + /** + * @var \Magento\Multishipping\Model\Checkout\Type\Multishipping + */ + private $_multishipping; + /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Framework\Filter\DataObject\GridFactory $filterGridFactory diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Address/EditAddress.php b/app/code/Magento/Multishipping/Controller/Checkout/Address/EditAddress.php index 98d268f6be69..70846ed3ba58 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/Address/EditAddress.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/Address/EditAddress.php @@ -4,23 +4,34 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Multishipping\Controller\Checkout\Address; -class EditAddress extends \Magento\Multishipping\Controller\Checkout\Address +use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface; +use Magento\Multishipping\Controller\Checkout\Address; + +/** + * Controller for editing the specified Address. + */ +class EditAddress extends Address implements HttpGetActionInterface { /** + * Execute edit Billing Address action. + * * @return void */ public function execute() { $this->_view->loadLayout(); if ($addressForm = $this->_view->getLayout()->getBlock('customer_address_edit')) { + $id = $this->getRequest()->getParam('id'); $addressForm->setTitle( __('Edit Address') )->setSuccessUrl( - $this->_url->getUrl('*/*/selectBilling') + $this->_url->getUrl('*/*/saveBillingFromList', ['id' => $id]) )->setErrorUrl( - $this->_url->getUrl('*/*/*', ['id' => $this->getRequest()->getParam('id')]) + $this->_url->getUrl('*/*/*', ['id' => $id]) )->setBackUrl( $this->_url->getUrl('*/*/selectBilling') ); diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Address/SaveBillingFromList.php b/app/code/Magento/Multishipping/Controller/Checkout/Address/SaveBillingFromList.php new file mode 100644 index 000000000000..4162037da5d7 --- /dev/null +++ b/app/code/Magento/Multishipping/Controller/Checkout/Address/SaveBillingFromList.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Multishipping\Controller\Checkout\Address; + +use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface; +use Magento\Multishipping\Controller\Checkout\Address; + +/** + * Controller for Billing Address that was successfully saved. + */ +class SaveBillingFromList extends Address implements HttpGetActionInterface +{ + /** + * Reimport saved Address to Quote if it has same ID as current Billing Address. + * + * @return void + */ + public function execute(): void + { + if ($addressId = (int)$this->getRequest()->getParam('id')) { + $checkout = $this->_getCheckout(); + if ((int)$checkout->getQuote()->getBillingAddress()->getCustomerAddressId() === $addressId) { + $checkout->setQuoteCustomerBillingAddress($addressId); + } + } + $this->_redirect('*/*/selectBilling'); + } +} diff --git a/app/code/Magento/Multishipping/Controller/Checkout/OverviewPost.php b/app/code/Magento/Multishipping/Controller/Checkout/OverviewPost.php index f4dfd60d8198..2232682d92f1 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/OverviewPost.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/OverviewPost.php @@ -11,6 +11,7 @@ use Magento\Customer\Api\AccountManagementInterface; use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Checkout\Api\PaymentProcessingRateLimiterInterface; +use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; use Magento\Framework\App\ObjectManager; use Magento\Customer\Model\Session; use Magento\Framework\App\Action\Context; @@ -134,6 +135,9 @@ public function execute() $this->_getCheckout()->getCheckoutSession()->setDisplaySuccess(true); $this->_redirect('*/*/success'); } + } catch (PaymentProcessingRateLimitExceededException $ex) { + $this->messageManager->addErrorMessage($ex->getMessage()); + $this->_redirect('*/*/overview'); } catch (PaymentException $e) { $message = $e->getMessage(); if (!empty($message)) { diff --git a/app/code/Magento/Multishipping/Model/Cart/Controller/CartPlugin.php b/app/code/Magento/Multishipping/Model/Cart/Controller/CartPlugin.php index 03587f71036f..6f560cfceeab 100644 --- a/app/code/Magento/Multishipping/Model/Cart/Controller/CartPlugin.php +++ b/app/code/Magento/Multishipping/Model/Cart/Controller/CartPlugin.php @@ -12,7 +12,6 @@ use Magento\Customer\Api\AddressRepositoryInterface; use Magento\Framework\App\RequestInterface; use Magento\Framework\Exception\LocalizedException; -use Magento\Multishipping\Model\Checkout\Type\Multishipping\State; use Magento\Multishipping\Model\DisableMultishipping; use Magento\Quote\Api\CartRepositoryInterface; use Magento\Quote\Model\Quote; @@ -73,7 +72,7 @@ public function beforeDispatch(Cart $subject, RequestInterface $request) { /** @var Quote $quote */ $quote = $this->checkoutSession->getQuote(); - if ($quote->isMultipleShippingAddresses() && $this->isCheckoutComplete()) { + if ($quote->isMultipleShippingAddresses() || $this->isDisableMultishippingRequired($request, $quote)) { $this->disableMultishipping->execute($quote); foreach ($quote->getAllShippingAddresses() as $address) { $quote->removeAddress($address->getId()); @@ -92,16 +91,6 @@ public function beforeDispatch(Cart $subject, RequestInterface $request) } } - /** - * Checks whether the checkout flow is complete - * - * @return bool - */ - private function isCheckoutComplete() : bool - { - return (bool) ($this->checkoutSession->getStepData(State::STEP_SHIPPING)['is_complete'] ?? true); - } - /** * Checks whether quote has virtual items * @@ -121,4 +110,18 @@ private function isVirtualItemInQuote(Quote $quote): bool return false; } + + /** + * Check if we have to disable multishipping mode depends on the request action name + * + * We should not disable multishipping mode if we are adding a new product item to the existing quote + * + * @param RequestInterface $request + * @param Quote $quote + * @return bool + */ + private function isDisableMultishippingRequired(RequestInterface $request, Quote $quote): bool + { + return $request->getActionName() !== "add" && $quote->getIsMultiShipping(); + } } diff --git a/app/code/Magento/Multishipping/README.md b/app/code/Magento/Multishipping/README.md index 207416a09455..12bda8ae5f21 100644 --- a/app/code/Magento/Multishipping/README.md +++ b/app/code/Magento/Multishipping/README.md @@ -1,2 +1,139 @@ -Magento\Multishipping module provides functionality that allows customer to request shipping to more than one address -using different carriers. The module provides alternative to standard checkout flow. \ No newline at end of file +# Magento_Multishipping module + +**Magento_Multishipping** module provides functionality that allows customer to request shipping to more than one address +using different carriers. The module provides alternative to standard checkout flow. + +## Installation + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Structure + +For information about a typical file structure of a module in Magento 2, + see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). + + ## Extensibility + +Developers can interact with the module and change behaviour using type configuration feature. + +Namely, we can change `paymentSpecification` for `Magento\Multishipping\Block\Checkout\Billing` and `Magento\Multishipping\Model\Checkout\Type\Multishipping` classes. +As result, we will get changed behaviour, new logic or something what our business need. + +For example: +``` +<type name="Magento\Multishipping\Model\Checkout\Type\Multishipping"> + <arguments> + <argument name="paymentSpecification" xsi:type="object">multishippingPaymentSpecification</argument> + </arguments> +</type> +``` +Yo can check this configuration and find more examples in the `etc/frontend/di.xml` file. + +More information about [type configuration](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/di-xml-file.html). + + +Extension developers can interact with the Magento_Multishipping module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Msrp module. + +### Events + +This module observes the following event: + +`etc/frontend/` + + - `checkout_cart_save_before` in the `Magento\Multishipping\Observer\DisableMultishippingObserver` file. + +The module dispatches the following events: + +- `multishipping_checkout_controller_success_action` event in the + class `\Magento\Multishipping\Controller\Checkout\Success::execute()` method. Parameters: + - `order_ids` is order ids created during checkout +- `checkout_controller_multishipping_shipping_post` event in the + class `\Magento\Multishipping\Controller\Checkout\ShippingPost::execute()` method. Parameters: + - `request` is a request object `Magento\Framework\App\RequestInterface`. + - `quote` is a quote object for current checkout `Magento\Quote\Model\Quote`. +- `checkout_type_multishipping_set_shipping_items` event in the + class `\Magento\Multishipping\Model\Checkout\Type\Multishipping::setShippingItemsInformation()` method. Parameters: + - `quote` is a quote object for current checkout `Magento\Quote\Model\Quote`. +- `checkout_type_multishipping_create_orders_single` event in the + class `\Magento\Multishipping\Model\Checkout\Type\Multishipping::createOrders()` method. Parameters: + - `order` is a prepared order object for creating `\Magento\Sales\Model\Order`. + - `address` is an address array. + - `quote` is a quote object for current checkout `Magento\Quote\Model\Quote`. +- `checkout_submit_all_after` event in the + class `\Magento\Multishipping\Model\Checkout\Type\Multishipping::createOrders()` method. Parameters: + - `orders` is order object array `\Magento\Sales\Model\Order` that was created. + - `quote` is a quote object for current checkout `Magento\Quote\Model\Quote`. +- `checkout_multishipping_refund_all` event in the + class `\Magento\Multishipping\Model\Checkout\Type\Multishipping::createOrders()` method. Parameters: + - `orders` is order object array `\Magento\Sales\Model\Order` that was created. + +For information about an event in Magento 2, see [Events and observers](http://devdocs.magento.com/guides/v2.3/extension-dev-guide/events-and-observers.html#events). + +### Layouts + +The module interacts with the following layout handles: + +`view/frontend/layout` directory: + + - `checkout_cart_index` + +This module introduces the following layouts and layout handles: + +`view/frontend/layout` directory: + + - `multishipping_checkout` + - `multishipping_checkout_address_editaddress` + - `multishipping_checkout_address_editbilling` + - `multishipping_checkout_address_editshipping` + - `multishipping_checkout_address_newbilling` + - `multishipping_checkout_address_newshipping` + - `multishipping_checkout_address_select` + - `multishipping_checkout_address_selectbilling` + - `multishipping_checkout_addresses` + - `multishipping_checkout_billing` + - `multishipping_checkout_customer_address` + - `multishipping_checkout_login` + - `multishipping_checkout_overview` + - `multishipping_checkout_register` + - `multishipping_checkout_results` + - `multishipping_checkout_shipping` + - `multishipping_checkout_success` + +## Additional information + +### ACL + +Module introduces the following resources: + +- `Magento_Multishipping::config_multishipping` - Multishipping Settings Section + +More information about [Access Control List rule](https://devdocs.magento.com/guides/v2.4/ext-best-practices/tutorials/create-access-control-list-rule.html). + +### Page Types + +Module introduces the new pages: + +`etc/frontend/page_types.xml` file. + +- `checkout_cart_multishipping` - Catalog Quick Search Form Suggestion +- `checkout_cart_multishipping_address_editaddress` - Multishipping Checkout One Address Edit Form +- `checkout_cart_multishipping_address_editbilling` - Multishipping Checkout Billing Address Edit Form +- `checkout_cart_multishipping_address_editshipping` - Multishipping Checkout Shipping Address Edit Form +- `checkout_cart_multishipping_address_newbilling` - Multishipping Checkout Billing Address Creation +- `checkout_cart_multishipping_address_newshipping` - Multishipping Checkout Shipping Address Creation +- `checkout_cart_multishipping_address_selectbilling` - Multishipping Checkout Billing Address Selection +- `checkout_cart_multishipping_addresses` - Multishipping Checkout Address (Any) Form +- `checkout_cart_multishipping_billing` - Multishipping Checkout Billing Information Step +- `checkout_cart_multishipping_customer_address` - Multishipping Checkout Customer Address Edit Form +- `checkout_cart_multishipping_login` - Multishipping Checkout Login User Form +- `checkout_cart_multishipping_overview` - Multishipping Checkout Overview +- `checkout_cart_multishipping_register` - Multishipping Checkout Register User Form +- `checkout_cart_multishipping_shipping` - Multishipping Checkout Shipping Information Step +- `checkout_cart_multishipping_success` - Multishipping Checkout Success + +More information about [layout types](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-types.html). + + +For information about significant changes in patch releases, see [2.3.x Release information](http://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/AssertStorefrontMultishippingAddressAndItemActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/AssertStorefrontMultishippingAddressAndItemActionGroup.xml new file mode 100644 index 000000000000..4d59fef61018 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/AssertStorefrontMultishippingAddressAndItemActionGroup.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontMultishippingAddressAndItemActionGroup"> + <annotations> + <description>Verify item information on Ship to Multiple Addresses page.</description> + </annotations> + <arguments> + <argument name="sequenceNumber" type="string" defaultValue="1"/> + <argument name="productName" type="string" defaultValue="{{SimpleProduct.name}}"/> + <argument name="quantity" type="string" defaultValue="1"/> + <argument name="firstName" type="string" defaultValue="{{US_Address_CA.firstname}}"/> + <argument name="lastName" type="string" defaultValue="{{US_Address_CA.lastname}}"/> + <argument name="city" type="string" defaultValue="{{US_Address_CA.city}}"/> + <argument name="state" type="string" defaultValue="{{US_Address_CA.state}}"/> + <argument name="postCode" type="string" defaultValue="{{US_Address_CA.postcode}}"/> + <argument name="country" type="string" defaultValue="{{US_Address_CA.country}}"/> + <argument name="addressStreetLine1" type="string" defaultValue="{{US_Address_CA.street[0]}}"/> + <argument name="addressStreetLine2" type="string" defaultValue="{{US_Address_CA.street[1]}}"/> + </arguments> + + <seeElement selector="{{MultishippingSection.productLink(productName, sequenceNumber)}}" stepKey="verifyProductName"/> + <seeInField selector="{{MultishippingSection.productQty(sequenceNumber)}}" userInput="{{quantity}}" stepKey="verifyQuantity"/> + <seeInField selector="{{MultishippingSection.shippingAddressSelector(sequenceNumber)}}" userInput="{{firstName}} {{lastName}}, {{addressStreetLine1}} {{addressStreetLine2}}, {{city}}, {{state}} {{postCode}}, {{country}}" stepKey="verifyAddress"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontAssertBillingAddressInBillingInfoStepActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontAssertBillingAddressInBillingInfoStepActionGroup.xml new file mode 100644 index 000000000000..4f6f180d69d9 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontAssertBillingAddressInBillingInfoStepActionGroup.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontAssertBillingAddressInBillingInfoStepActionGroup"> + <annotations> + <description>Assert that Billing Address block contains provided Address data.</description> + </annotations> + <arguments> + <argument name="address" type="entity" defaultValue="US_Address_CA"/> + </arguments> + + <see selector="{{PaymentMethodSection.billingAddressBlock}}" userInput="{{address.firstname}}" stepKey="seeFirstname"/> + <see selector="{{PaymentMethodSection.billingAddressBlock}}" userInput="{{address.lastname}}" stepKey="seeLastname"/> + <see selector="{{PaymentMethodSection.billingAddressBlock}}" userInput="{{address.company}}" stepKey="seeCompany"/> + <see selector="{{PaymentMethodSection.billingAddressBlock}}" userInput="{{address.street[0]}}" stepKey="seeStreet"/> + <see selector="{{PaymentMethodSection.billingAddressBlock}}" userInput="{{address.city}}" stepKey="seeCity"/> + <see selector="{{PaymentMethodSection.billingAddressBlock}}" userInput="{{address.state}}" stepKey="seeState"/> + <see selector="{{PaymentMethodSection.billingAddressBlock}}" userInput="{{address.postcode}}" stepKey="seePostcode"/> + <see selector="{{PaymentMethodSection.billingAddressBlock}}" userInput="{{address.country}}" stepKey="seeCountry"/> + <see selector="{{PaymentMethodSection.billingAddressBlock}}" userInput="{{address.telephone}}" stepKey="seeTelephone"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontChangeMultishippingItemQtyActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontChangeMultishippingItemQtyActionGroup.xml new file mode 100644 index 000000000000..eb9acd80a21e --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontChangeMultishippingItemQtyActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontChangeMultishippingItemQtyActionGroup"> + <annotations> + <description>Change multishipping item quantity on Ship to Multiple Addresses page.</description> + </annotations> + <arguments> + <argument name="sequenceNumber" type="string" defaultValue="1"/> + <argument name="quantity" type="string" defaultValue="1"/> + </arguments> + + <fillField selector="{{MultishippingSection.productQty(sequenceNumber)}}" userInput="{{quantity}}" stepKey="setQuantity"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoToBillingInfoStepFromAddressListActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoToBillingInfoStepFromAddressListActionGroup.xml new file mode 100644 index 000000000000..164ba7506bc4 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoToBillingInfoStepFromAddressListActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontGoToBillingInfoStepFromAddressListActionGroup"> + <annotations> + <description>Navigates to Billing Information step from Billing Address list.</description> + </annotations> + + <click selector="{{StorefrontBillingAddressesSection.backToBillingInformation}}" stepKey="navigateToBillingInformation"/> + <waitForElementVisible selector="{{PaymentMethodSection.goToReviewOrder}}" stepKey="waitForGoToReviewButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontOpenOrderByPositionAfterMultishippingCheckoutActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontOpenOrderByPositionAfterMultishippingCheckoutActionGroup.xml new file mode 100644 index 000000000000..29a82630b519 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontOpenOrderByPositionAfterMultishippingCheckoutActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontOpenOrderByPositionAfterMultishippingCheckoutActionGroup"> + <annotations> + <description>Clicks on 'order view' link by provided position from Multishipping Checkout success page.</description> + </annotations> + <arguments> + <argument name="position" type="string" defaultValue="{{CONST.one}}"/> + </arguments> + + <click selector="{{StorefrontMultipleShippingMethodSection.orderByPosition(position)}}" stepKey="openOrderDetailsPage"/> + <waitForElementVisible selector="{{StorefrontCustomerOrderViewSection.orderTitle}}" stepKey="waitForOrderPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontStartEditBillingAddressFromListActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontStartEditBillingAddressFromListActionGroup.xml new file mode 100644 index 000000000000..80f351d781b6 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontStartEditBillingAddressFromListActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontStartEditBillingAddressFromListActionGroup"> + <annotations> + <description>Navigates to Billing Address list. Starts editing specified Billing Address.</description> + </annotations> + <arguments> + <argument name="position" type="string" defaultValue="{{CONST.one}}"/> + </arguments> + + <click selector="{{PaymentMethodSection.changeBillingAddress}}" stepKey="goToBillingAddressesList"/> + <click selector="{{StorefrontBillingAddressesSection.editAddressByPosition(position)}}" stepKey="editBillingAddressByPosition"/> + <waitForElementVisible selector="{{StorefrontCustomerAddressFormSection.formTitle}}" stepKey="waitForAddressEditPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutSelectBillingPage.xml b/app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutSelectBillingPage.xml new file mode 100644 index 000000000000..8523a3e495ab --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutSelectBillingPage.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="MultishippingCheckoutSelectBillingPage" url="/multishipping/checkout_address/selectBilling" module="Magento_Multishipping" area="storefront"> + <section name="StorefrontBillingAddressesSection"/> + </page> +</pages> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection/MultishippingSection.xml b/app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection/MultishippingSection.xml index 1b2f0c31b2cf..304f0a9c7a12 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection/MultishippingSection.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection/MultishippingSection.xml @@ -14,6 +14,8 @@ <element name="shippingAddressSelector" type="select" selector="//tr[position()={{addressPosition}}]//td[@data-th='Send To']//select" parameterized="true"/> <element name="shippingAddressOptions" type="select" selector="#multiship-addresses-table tbody tr:nth-of-type({{addressPosition}}) .col.address select option:nth-of-type({{optionIndex}})" parameterized="true"/> <element name="selectShippingAddress" type="select" selector="(//table[@id='multiship-addresses-table'] //div[@class='field address'] //select)[{{sequenceNumber}}]" parameterized="true"/> + <element name="productQty" type="input" selector="#multiship-addresses-table tbody tr:nth-of-type({{sequenceNumber}}) .col.qty input" parameterized="true"/> + <element name="productLink" type="button" selector="(//form[@id='checkout_multishipping_form']//a[contains(text(),'{{productName}}')])[{{sequenceNumber}}]" parameterized="true"/> <element name="removeItemButton" type="button" selector="//a[contains(@title, 'Remove Item')][{{var}}]" parameterized="true"/> <element name="back" type="button" selector=".action.back"/> </section> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection/StorefrontMultipleShippingMethodSection.xml b/app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection/StorefrontMultipleShippingMethodSection.xml index 52899327c4df..fbf477eae916 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection/StorefrontMultipleShippingMethodSection.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection/StorefrontMultipleShippingMethodSection.xml @@ -9,6 +9,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="StorefrontMultipleShippingMethodSection"> <element name="orderId" type="text" selector=".shipping-list:nth-child({{rowNum}}) .order-id" parameterized="true"/> + <element name="orderByPosition" type="button" selector=".shipping-list:nth-child({{position}}) > .order-id > a" timeout="30" parameterized="true"/> <element name="goToReviewYourOrderButton" type="button" selector="#payment-continue"/> <element name="continueToBillingInformationButton" type="button" selector=".action.primary.continue"/> <element name="successMessage" type="text" selector=".multicheckout.success"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Section/PaymentMethodSection.xml b/app/code/Magento/Multishipping/Test/Mftf/Section/PaymentMethodSection.xml index fe69cba0059f..6bdca5de480c 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Section/PaymentMethodSection.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Section/PaymentMethodSection.xml @@ -9,6 +9,8 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="PaymentMethodSection"> - <element name="goToReviewOrder" type="button" selector="#payment-continue"/> + <element name="goToReviewOrder" type="button" selector="#payment-continue" timeout="30"/> + <element name="changeBillingAddress" type="button" selector="//div[@class='box box-billing-address']//a[normalize-space() = 'Change']" timeout="30"/> + <element name="billingAddressBlock" type="block" selector=".box-billing-address > .box-content > address" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontBillingAddressesSection.xml b/app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontBillingAddressesSection.xml new file mode 100644 index 000000000000..ecb0077dbb53 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontBillingAddressesSection.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontBillingAddressesSection"> + <element name="editAddressByPosition" type="button" selector="div.box-billing-address:nth-of-type({{position}}) .action.edit" parameterized="true" timeout="30"/> + <element name="backToBillingInformation" type="button" selector=".actions-toolbar .action.back" timeout="30"/> + </section> +</sections> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml new file mode 100644 index 000000000000..618c32b21ad0 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest"> + <annotations> + <features value="Multishipment"/> + <stories value="Checking vat id field at account create page with 'Check Out with Multiple Addresses'"/> + <title value="Checking vat id field at account create page with 'Check Out with Multiple Addresses'"/> + <description value="'VAT Number' field should be available at create account page if 'Show VAT Number on Storefront' is Yes"/> + <severity value="MAJOR"/> + <testCaseId value="MC-40397"/> + <group value="Multishipment"/> + </annotations> + <before> + <magentoCLI command="config:set customer/create_account/vat_frontend_visibility 1" stepKey="showVatNumberOnStorefrontYes"/> + <createData entity="SimpleSubCategory" stepKey="category"/> + <createData entity="SimpleProduct" stepKey="product"> + <requiredEntity createDataKey="category"/> + </createData> + </before> + <after> + <magentoCLI command="config:set customer/create_account/vat_frontend_visibility 0" stepKey="showVatNumberOnStorefrontNo"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfter"/> + <deleteData createDataKey="category" stepKey="deleteCategory"/> + <deleteData createDataKey="product" stepKey="deleteproduct"/> + </after> + <!-- Add product to the cart --> + <amOnPage url="$$product.custom_attributes[url_key]$$.html" stepKey="goToProductPage"/> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> + <argument name="productName" value="$$product.name$$"/> + </actionGroup> + <!-- Check Out with Multiple Addresses --> + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> + <waitForElementVisible selector="{{MultishippingSection.shippingMultipleCheckout}}" stepKey="waitMultipleAddressShippingButton"/> + <click selector="{{MultishippingSection.shippingMultipleCheckout}}" stepKey="clickToMultipleAddressShippingButton"/> + <!--Create an account--> + <waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.createAnAccount}}" stepKey="waitCreateAnAccountButton"/> + <click selector="{{StorefrontCustomerSignInPopupFormSection.createAnAccount}}" stepKey="clickOnCreateAnAccountButton"/> + <waitForPageLoad stepKey="waitForCreateAccountPageToLoad"/> + <!--Check the VAT Number field--> + <seeElement selector="{{StorefrontCustomerAddressSection.vatId}}" stepKey="assertVatIdField"/> + </test> +</tests> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml index 5e1c14c57f53..76bd63d69df0 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml @@ -37,11 +37,11 @@ </actionGroup> </before> - <amOnPage url="$$product1.name$$.html" stepKey="goToProduct1"/> + <amOnPage url="$$product1.custom_attributes[url_key]$$.html" stepKey="goToProduct1"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct1"> <argument name="productName" value="$$product1.name$$"/> </actionGroup> - <amOnPage url="$$product2.name$$.html" stepKey="goToProduct2"/> + <amOnPage url="$$product2.custom_attributes[url_key]$$.html" stepKey="goToProduct2"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct2"> <argument name="productName" value="$$product2.name$$"/> </actionGroup> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml index dcdc9203a207..084e0ffc9f3a 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml @@ -37,11 +37,11 @@ </actionGroup> </before> - <amOnPage url="$$product1.name$$.html" stepKey="goToProduct1"/> + <amOnPage url="$$product1.custom_attributes[url_key]$$.html" stepKey="goToProduct1"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct1"> <argument name="productName" value="$$product1.name$$"/> </actionGroup> - <amOnPage url="$$product2.name$$.html" stepKey="goToProduct2"/> + <amOnPage url="$$product2.custom_attributes[url_key]$$.html" stepKey="goToProduct2"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct2"> <argument name="productName" value="$$product2.name$$"/> </actionGroup> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontGuestCheckingWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontGuestCheckingWithMultishipmentTest.xml new file mode 100644 index 000000000000..82563e5055c2 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontGuestCheckingWithMultishipmentTest.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StoreFrontGuestCheckingWithMultishipmentTest"> + <annotations> + <features value="Multishipping"/> + <stories value="Multiple Shipping"/> + <title value="Guest can register through multi shipment checkout"/> + <description value="Check that guest can register through multi shipment checkout"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-41679"/> + <useCaseId value="MC-41668"/> + <group value="multishipping"/> + </annotations> + <before> + <createData entity="SimpleProduct2" stepKey="product1"/> + <createData entity="SimpleProduct2" stepKey="product2"/> + <createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRateShipping"/> + <actionGroup ref="CliEnableCheckMoneyOrderPaymentMethodActionGroup" stepKey="enableCheckMoneyOrderPaymentMethod"/> + </before> + <after> + <deleteData createDataKey="product1" stepKey="deleteProduct1"/> + <deleteData createDataKey="product2" stepKey="deleteProduct2"/> + <createData entity="FreeShippinMethodDefault" stepKey="disableFreeShipping"/> + </after> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goToProduct1Page"> + <argument name="productUrl" value="$product1.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct1"> + <argument name="productName" value="$product1.name$"/> + </actionGroup> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goToProduct2Page"> + <argument name="productUrl" value="$product2.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct2"> + <argument name="productName" value="$product2.name$"/> + </actionGroup> + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> + <click selector="{{MultishippingSection.checkoutWithMultipleAddresses}}" stepKey="proceedMultishipping"/> + <click selector="{{StorefrontCustomerSignInPopupFormSection.createAnAccount}}" stepKey="clickCreateAccount"/> + <seeElement selector="{{CheckoutShippingSection.region}}" stepKey="seeRegionSelector"/> + </test> +</tests> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml index 043d0fc41abe..f05c6e355bb1 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml @@ -47,11 +47,11 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAdmin"/> </after> - <amOnPage url="$$product1.name$$.html" stepKey="goToProduct1"/> + <amOnPage url="$$product1.custom_attributes[url_key]$$.html" stepKey="goToProduct1"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct1"> <argument name="productName" value="$$product1.name$$"/> </actionGroup> - <amOnPage url="$$product2.name$$.html" stepKey="goToProduct2"/> + <amOnPage url="$$product2.custom_attributes[url_key]$$.html" stepKey="goToProduct2"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct2"> <argument name="productName" value="$$product2.name$$"/> </actionGroup> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutMiniCartSubtotalMatchesAfterRemoveProductFromCartTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutMiniCartSubtotalMatchesAfterRemoveProductFromCartTest.xml new file mode 100644 index 000000000000..1d9b6e99a1ea --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutMiniCartSubtotalMatchesAfterRemoveProductFromCartTest.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontCheckoutMiniCartSubtotalMatchesAfterRemoveProductFromCartTest"> + <annotations> + <features value="Multishipping"/> + <stories value="Multiple Shipping"/> + <title value="Check mini shopping cart Subtotal Price matches with the View Cart subtotal price after remove product from cart"/> + <description value="Verify mini shopping cart Subtotal Price matches with the View Cart subtotal price after remove product from cart"/> + <severity value="MAJOR"/> + <testCaseId value="MC-42067"/> + <useCaseId value="MC-41924"/> + <group value="Multishipment"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <createData entity="SimpleSubCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct" stepKey="createdSimpleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="Customer_US_UK_DE" stepKey="createCustomerWithMultipleAddresses"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> + <deleteData createDataKey="createdSimpleProduct" stepKey="deleteCreatedSimpleProduct"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createCustomerWithMultipleAddresses" stepKey="deleteCustomer"/> + </after> + <!-- Login to the Storefront as created customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> + <argument name="Customer" value="$$createCustomerWithMultipleAddresses$$"/> + </actionGroup> + <!-- Open the simple product page --> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductPage"> + <argument name="product" value="$$createdSimpleProduct$$"/> + </actionGroup> + <!-- Add to Cart three times of the product --> + <waitForPageLoad stepKey="waitForProductPageLoad"/> + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> + <argument name="productName" value="$$createdSimpleProduct.name$$"/> + <argument name="productQty" value="3"/> + </actionGroup> + <waitForPageLoad time="120" stepKey="waitForAddToCart"/> + <!-- Go to Cart Summary Section --> + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> + <!-- Check Out with Multiple Addresses --> + <actionGroup ref="StorefrontCheckoutWithMultipleAddressesActionGroup" stepKey="checkoutWithMultipleAddresses"/> + <!-- Remove first simple product from cart --> + <actionGroup ref="StorefrontRemoveProductOnCheckoutActionGroup" stepKey="removeFirstProductFromCart"/> + <!-- Go back to the cart --> + <click selector="{{MultishippingSection.back}}" stepKey="backToCart"/> + <!-- Check and verify subtotals at mini cart summary section--> + <waitForPageLoad time="120" stepKey="waitForCartSummaryPageToLoad"/> + <grabTextFrom selector="{{CheckoutCartProductSection.productSubtotalByName($$createdSimpleProduct.name$$)}}" stepKey="grabTextFromProductsSubtotalField"/> + <grabTextFrom selector="{{CheckoutCartSummarySection.subTotal}}" stepKey="grabTextFromCartSubtotalField"/> + <assertEquals message="Subtotals should be equal" stepKey="assertSubtotalsFields"> + <expectedResult type="variable">$grabTextFromProductsSubtotalField</expectedResult> + <actualResult type="variable">$grabTextFromCartSubtotalField</actualResult> + </assertEquals> + </test> +</tests> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutSubtotalAfterQuantityUpdateTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutSubtotalAfterQuantityUpdateTest.xml index 31ea8c500e86..8c0df3c70677 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutSubtotalAfterQuantityUpdateTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutSubtotalAfterQuantityUpdateTest.xml @@ -51,7 +51,7 @@ <!-- Go back to the cart --> <click selector="{{MultishippingSection.back}}" stepKey="backToCart"/> <!-- Update products quantity --> - <fillField selector="{{CheckoutCartProductSection.qty($createdSimpleProduct.name$)}}" userInput="2" stepKey="updateProductQty"/> + <fillField selector="{{CheckoutCartProductSection.qty($createdSimpleProduct.sku$)}}" userInput="2" stepKey="updateProductQty"/> <click selector="{{CheckoutCartProductSection.updateShoppingCartButton}}" stepKey="clickUpdateShoppingCart"/> <waitForAjaxLoad stepKey="waitForAjaxLoad"/> <!-- Check subtotals --> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontDisableMultishippingModeAfterRemoveItemOnBackToCartTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontDisableMultishippingModeAfterRemoveItemOnBackToCartTest.xml new file mode 100644 index 000000000000..93bce523832a --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontDisableMultishippingModeAfterRemoveItemOnBackToCartTest.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontDisableMultishippingModeAfterRemoveItemOnBackToCartTest"> + <annotations> + <features value="Multishipping"/> + <stories value="Multishipping"/> + <title value="Disable multishipping checkout on backing to cart after remove item"/> + <description value="The cart page should display the proper subtotal after backing back to the cart from the multishipping checkout."/> + <severity value="CRITICAL"/> + <testCaseId value="MC-41594"/> + <useCaseId value="MC-41464"/> + <group value="multishipping"/> + </annotations> + <before> + <createData entity="ApiCategory" stepKey="createCategory"/> + <createData entity="_defaultProduct" stepKey="createSimpleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomerWithMultipleAddresses"/> + </before> + <after> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createCustomerWithMultipleAddresses" stepKey="deleteCustomer"/> + </after> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> + <argument name="Customer" value="$createCustomerWithMultipleAddresses$"/> + </actionGroup> + + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openSimpleProductPage"> + <argument name="product" value="$createSimpleProduct$"/> + </actionGroup> + <grabTextFrom selector="{{StorefrontProductInfoMainSection.price}}" stepKey="grabPrice"/> + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addSimpleProductToCart"> + <argument name="product" value="$createSimpleProduct$"/> + <argument name="productCount" value="1"/> + </actionGroup> + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addSimpleProductToCartAgain"> + <argument name="product" value="$createSimpleProduct$"/> + <argument name="productCount" value="2"/> + </actionGroup> + + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="StorefrontGoCheckoutWithMultipleAddressesActionGroup" stepKey="goCheckoutWithMultipleAddresses"/> + <actionGroup ref="StorefrontRemoveProductOnCheckoutActionGroup" stepKey="removeFirstProductItemFromMultishipping"/> + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goBackToShoppingCartPage"/> + <grabTextFrom selector="{{CheckoutCartProductSection.productSubtotalByName($createSimpleProduct.name$)}}" stepKey="grabSubtotal"/> + <assertEquals stepKey="assertSubtotal" message="pass"> + <expectedResult type="variable">grabPrice</expectedResult> + <actualResult type="variable">grabSubtotal</actualResult> + </assertEquals> + </test> +</tests> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontEditBillingAddressAtMultishippingCheckoutTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontEditBillingAddressAtMultishippingCheckoutTest.xml new file mode 100644 index 000000000000..4ec9792107dc --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontEditBillingAddressAtMultishippingCheckoutTest.xml @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontEditBillingAddressAtMultishippingCheckoutTest"> + <annotations> + <features value="Multishipping"/> + <stories value="Multiple Shipping"/> + <title value="Change Billing Address during Multiple Shipping checkout"/> + <description value="Verify that Billing Address is changed on Billing Information page after editing it"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-40509"/> + <useCaseId value="MC-35289"/> + <group value="catalog"/> + <group value="sales"/> + <group value="multishipping"/> + </annotations> + + <before> + <!-- Create Product and Customer --> + <createData entity="simpleProductWithoutCategory" stepKey="createProduct"/> + <createData entity="Simple_US_Customer_Two_Addresses" stepKey="createCustomer"/> + + <!-- Login to Storefront as created Customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> + <argument name="Customer" value="$createCustomer$"/> + </actionGroup> + </before> + + <after> + <!-- Logout from Customer account --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> + + <!-- Delete Product and Customer --> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + </after> + + <!-- Add Product to Cart and go to Billing Information step --> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> + <argument name="product" value="$createProduct$"/> + </actionGroup> + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openShoppingCart"/> + <actionGroup ref="CheckingWithSingleAddressActionGroup" stepKey="checkoutWithMultishipping"/> + <actionGroup ref="StorefrontLeaveDefaultShippingMethodsAndGoToBillingInfoActionGroup" stepKey="goToBillingInformation"/> + + <!-- Select Check / Money order Payment method --> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> + + <!-- Change the first Address --> + <actionGroup ref="StorefrontStartEditBillingAddressFromListActionGroup" stepKey="openFirstAddressEditPage"/> + <actionGroup ref="FillNewCustomerAddressRequiredFieldsActionGroup" stepKey="editAddressFields"> + <argument name="address" value="US_Address_CA"/> + </actionGroup> + <actionGroup ref="StorefrontSaveCustomerAddressActionGroup" stepKey="saveAddress"/> + + <!-- Go back to Billing Information step and verify Billing Address --> + <actionGroup ref="StorefrontGoToBillingInfoStepFromAddressListActionGroup" stepKey="navigateToBillingInfoStep"/> + <actionGroup ref="StorefrontAssertBillingAddressInBillingInfoStepActionGroup" stepKey="verifyBillingAddress"/> + + <!-- Go to Review Order step and Place Order --> + <actionGroup ref="SelectBillingInfoActionGroup" stepKey="navigateToReviewOrderPage"/> + <actionGroup ref="PlaceOrderActionGroup" stepKey="placeOrder"/> + + <!-- Open Order Details page and verify Billing Address --> + <actionGroup ref="StorefrontOpenOrderByPositionAfterMultishippingCheckoutActionGroup" stepKey="openOrderDetailsPage"/> + <click selector="{{StorefrontGuestOrderViewSection.printOrder}}" stepKey="clickPrintOrderButton"/> + <actionGroup ref="AssertSalesPrintOrderBillingAddress" stepKey="verifyPrintOrderBillingAddress"> + <argument name="address" value="US_Address_CA"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontMultishippingUpdateProductQtyTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontMultishippingUpdateProductQtyTest.xml new file mode 100644 index 000000000000..79d2a6942e6d --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontMultishippingUpdateProductQtyTest.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontMultishippingUpdateProductQtyTest"> + <annotations> + <features value="Multishipping"/> + <stories value="Checkout with multiple addresses."/> + <title value="Update Product Quantity on Ship to Multiple Addresses Page."/> + <description value="Verify customer will see correct product quantity after return to Ship to Multiple Addresses from Shipping information page."/> + <severity value="MAJOR"/> + <testCaseId value="MC-41697"/> + <useCaseId value="MC-40021"/> + <group value="multishipping"/> + </annotations> + + <before> + <createData entity="SimpleProduct2" stepKey="product"/> + <createData entity="Simple_US_CA_Customer" stepKey="customer"/> + </before> + <after> + <deleteData createDataKey="product" stepKey="deleteProduct"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> + <deleteData createDataKey="customer" stepKey="deleteCustomer"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$customer$"/> + </actionGroup> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="navigateToSimpleProductDetailsPage"> + <argument name="product" value="$product$"/> + </actionGroup> + <actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addSimpleProductToCart"> + <argument name="productQty" value="2"/> + </actionGroup> + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> + <actionGroup ref="StorefrontCheckoutWithMultipleAddressesActionGroup" stepKey="checkoutWithMultipleAddresses"/> + <actionGroup ref="StorefrontChangeMultishippingItemQtyActionGroup" stepKey="setProductQuantity"> + <argument name="quantity" value="2"/> + </actionGroup> + <actionGroup ref="StorefrontNavigateToShippingInformationPageActionGroup" stepKey="navigateToShippingInformation"/> + <moveBack stepKey="moveBackToShippingInformation"/> + <actionGroup ref="AssertStorefrontMultishippingAddressAndItemActionGroup" stepKey="verifyLine1Qty"> + <argument name="productName" value="$product.name$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontMultishippingAddressAndItemActionGroup" stepKey="verifyLine2Qty"> + <argument name="sequenceNumber" value="2"/> + <argument name="productName" value="$product.name$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontMultishippingAddressAndItemActionGroup" stepKey="verifyLine3Qty"> + <argument name="sequenceNumber" value="3"/> + <argument name="productName" value="$product.name$"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml index 46f1daad053d..4377b8cfd8c1 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml @@ -45,13 +45,13 @@ <argument name="Customer" value="$$createCustomerWithMultipleAddresses$$"/> </actionGroup> <!-- Add two products to the Shopping Cart --> - <amOnPage url="{{StorefrontProductPage.url($$createFirstProduct.name$$)}}" stepKey="amOnStorefrontProductFirstPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createFirstProduct.custom_attributes[url_key]$$)}}" stepKey="amOnStorefrontProductFirstPage"/> <waitForPageLoad stepKey="waitForTheFirstProduct"/> <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="cartAddProductToCart"> <argument name="product" value="$$createFirstProduct$$"/> <argument name="productCount" value="1"/> </actionGroup> - <amOnPage url="{{StorefrontProductPage.url($$createSecondProduct.name$$)}}" stepKey="amOnStorefrontSecondProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createSecondProduct.custom_attributes[url_key]$$)}}" stepKey="amOnStorefrontSecondProductPage"/> <waitForPageLoad stepKey="waitForPageLoadForTheSecondProduct"/> <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="cartAddSecondProductToCart"> <argument name="product" value="$$createSecondProduct$$"/> @@ -85,6 +85,12 @@ </actionGroup> <switchToNextTab stepKey="switchToNextTab"/> <!-- Click 'Continue to Billing Information' and 'Go to Review Your Order' --> + <actionGroup ref="StorefrontGoToBillingInformationActionGroup" stepKey="redirectToSelectAddressAfterReset"/> + <seeOptionIsSelected selector="{{StorefrontCheckoutShippingMultipleAddressesSection.selectedMultipleShippingAddress('1')}}" userInput="{{US_Address_NY.street[1]}}" stepKey="checkAddressIsReset"/> + <actionGroup ref="StorefrontCheckoutShippingSelectMultipleAddressesActionGroup" stepKey="selectMultipleAddressesAfterReset"> + <argument name="firstAddress" value="{{UK_Not_Default_Address.street[0]}}"/> + <argument name="secondAddress" value="{{US_Address_NY.street[1]}}"/> + </actionGroup> <actionGroup ref="StorefrontGoToBillingInformationActionGroup" stepKey="goToBillingInformation"/> <see selector="{{ShipmentFormSection.shippingAddress}}" userInput="{{US_Address_NY.city}}" stepKey="seeBillingAddress"/> <waitForElementVisible selector="{{StorefrontMultipleShippingMethodSection.goToReviewYourOrderButton}}" stepKey="waitForGoToReviewYourOrderVisible" /> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontVerifySecureURLRedirectMultishippingTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontVerifySecureURLRedirectMultishippingTest.xml index 515c9b2102f5..30e5d360f430 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontVerifySecureURLRedirectMultishippingTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontVerifySecureURLRedirectMultishippingTest.xml @@ -30,7 +30,7 @@ <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefront"> <argument name="Customer" value="$$customer$$"/> </actionGroup> - <amOnPage url="{{StorefrontCategoryPage.url($$category.name$$)}}" stepKey="goToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$category.custom_attributes[url_key]$$)}}" stepKey="goToCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="moveMouseOverProduct"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="clickAddToCartButton"/> @@ -40,15 +40,11 @@ <executeJS function="return window.location.host" stepKey="hostname"/> <magentoCLI command="config:set web/secure/base_url https://{$hostname}/" stepKey="setSecureBaseURL"/> <magentoCLI command="config:set web/secure/use_in_frontend 1" stepKey="useSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set web/secure/use_in_frontend 0" stepKey="dontUseSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> <deleteData createDataKey="product" stepKey="deleteProduct"/> <deleteData createDataKey="category" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Multishipping/Test/Unit/Controller/Checkout/Address/EditAddressTest.php b/app/code/Magento/Multishipping/Test/Unit/Controller/Checkout/Address/EditAddressTest.php index 09e1e87a028e..7cba365e7280 100644 --- a/app/code/Magento/Multishipping/Test/Unit/Controller/Checkout/Address/EditAddressTest.php +++ b/app/code/Magento/Multishipping/Test/Unit/Controller/Checkout/Address/EditAddressTest.php @@ -141,8 +141,9 @@ public function testExecute() ->getMock(); $helperMock->expects($this->any())->method('__')->willReturn('Edit Address'); $valueMap = [ - ['*/*/selectBilling', null, 'success/url'], + ['*/*/saveBillingFromList', ['id' => 1], 'success/url'], ['*/*/*', ['id' => 1], 'error/url'], + ['*/*/selectBilling', null, 'back/url'], ]; $this->urlMock->expects($this->any())->method('getUrl')->willReturnMap($valueMap); $this->addressFormMock->expects($this->once())->method('setSuccessUrl')->with('success/url')->willReturnSelf(); @@ -151,7 +152,7 @@ public function testExecute() $this->titleMock->expects($this->once())->method('getDefault')->willReturn('default_title'); $this->addressFormMock->expects($this->once())->method('getTitle')->willReturn('Address title'); $this->titleMock->expects($this->once())->method('set')->with('Address title - default_title'); - $this->addressFormMock->expects($this->once())->method('setBackUrl')->with('success/url'); + $this->addressFormMock->expects($this->once())->method('setBackUrl')->with('back/url'); $this->viewMock->expects($this->once())->method('renderLayout'); $this->controller->execute(); } diff --git a/app/code/Magento/Multishipping/view/frontend/requirejs-config.js b/app/code/Magento/Multishipping/view/frontend/requirejs-config.js index 0235d8b84815..e47915d6e508 100644 --- a/app/code/Magento/Multishipping/view/frontend/requirejs-config.js +++ b/app/code/Magento/Multishipping/view/frontend/requirejs-config.js @@ -10,7 +10,8 @@ var config = { orderOverview: 'Magento_Multishipping/js/overview', payment: 'Magento_Multishipping/js/payment', billingLoader: 'Magento_Checkout/js/checkout-loader', - cartUpdate: 'Magento_Checkout/js/action/update-shopping-cart' + cartUpdate: 'Magento_Checkout/js/action/update-shopping-cart', + multiShippingBalance: 'Magento_Multishipping/js/multi-shipping-balance' } } }; diff --git a/app/code/Magento/Multishipping/view/frontend/templates/checkout/addresses.phtml b/app/code/Magento/Multishipping/view/frontend/templates/checkout/addresses.phtml index a37ff04a8dc2..81a960b8a823 100644 --- a/app/code/Magento/Multishipping/view/frontend/templates/checkout/addresses.phtml +++ b/app/code/Magento/Multishipping/view/frontend/templates/checkout/addresses.phtml @@ -64,7 +64,9 @@ size="2" min="0" class="input-text qty" - data-validate="{number: true, required:true, 'validate-greater-than-zero':true}"/> + data-validate="{number: true, required:true, 'validate-greater-than-zero':true}" + autocomplete="off" + /> </div> </div> </td> diff --git a/app/code/Magento/Multishipping/view/frontend/templates/checkout/billing.phtml b/app/code/Magento/Multishipping/view/frontend/templates/checkout/billing.phtml index c9ee0a8b12ce..2fbdac12991f 100644 --- a/app/code/Magento/Multishipping/view/frontend/templates/checkout/billing.phtml +++ b/app/code/Magento/Multishipping/view/frontend/templates/checkout/billing.phtml @@ -8,13 +8,14 @@ * Multishipping checkout billing information * * @var $block \Magento\Multishipping\Block\Checkout\Billing + * @var $escaper \Magento\Framework\Escaper * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> <div id="checkout-loader" data-role="checkout-loader" class="loading-mask" data-mage-init='{"billingLoader": {}}'> <div class="loader"> - <img src="<?= $block->escapeUrl($block->getViewFileUrl('images/loader-1.gif')); ?>" - alt="<?= $block->escapeHtml(__('Loading...')); ?>"> + <img src="<?= $escaper->escapeUrl($block->getViewFileUrl('images/loader-1.gif')); ?>" + alt="<?= $escaper->escapeHtml(__('Loading...')); ?>"> </div> </div> <?= /* @noEscape */ $secureRenderer->renderStyleAsTag('position: absolute;', 'div#checkout-loader .loader img') ?> @@ -43,7 +44,7 @@ script; } </script> </div> -<form action="<?= $block->escapeUrl($block->getPostActionUrl()); ?>" +<form action="<?= $escaper->escapeUrl($block->getPostActionUrl()); ?>" method="post" id="multishipping-billing-form" class="form multicheckout billing"> @@ -51,9 +52,9 @@ script; <div class="block-content"> <div class="box box-billing-address"> <strong class="box-title"> - <span><?= $block->escapeHtml(__('Billing Address')); ?></span> - <a href="<?= $block->escapeUrl($block->getSelectAddressUrl()); ?>" class="action"> - <span><?= $block->escapeHtml(__('Change')); ?></span> + <span><?= $escaper->escapeHtml(__('Billing Address')); ?></span> + <a href="<?= $escaper->escapeUrl($block->getSelectAddressUrl()); ?>" class="action"> + <span><?= $escaper->escapeHtml(__('Change')); ?></span> </a> </strong> <div class="box-content"> @@ -65,7 +66,7 @@ script; <div class="box box-billing-method"> <fieldset class="fieldset"> <legend class="legend box-title"> - <span><?= $block->escapeHtml(__('Payment Method')); ?></span> + <span><?= $escaper->escapeHtml(__('Payment Method')); ?></span> </legend><br> <div class="box-content"> <?= $block->getChildHtml('payment_methods_before') ?> @@ -84,14 +85,14 @@ script; $block->setMethodFormTemplate($code, $methodsForms[$code]); } ?> - <div data-bind="scope: 'payment_method_<?= $block->escapeHtml($code);?>'"> + <div data-bind="scope: 'payment_method_<?= $escaper->escapeHtml($code);?>'"> <dt class="item-title"> <?php if ($methodsCount > 1): ?> <input type="radio" - id="p_method_<?= $block->escapeHtml($code); ?>" - value="<?= $block->escapeHtml($code); ?>" + id="p_method_<?= $escaper->escapeHtml($code); ?>" + value="<?= $escaper->escapeHtml($code); ?>" name="payment[method]" - title="<?= $block->escapeHtml($_method->getTitle()) ?>" + title="<?= $escaper->escapeHtml($_method->getTitle()) ?>" data-bind=" value: getCode(), checked: isChecked, @@ -103,8 +104,8 @@ script; class="radio"/> <?php else: ?> <input type="radio" - id="p_method_<?= $block->escapeHtml($code); ?>" - value="<?= $block->escapeHtml($code); ?>" + id="p_method_<?= $escaper->escapeHtml($code); ?>" + value="<?= $escaper->escapeHtml($code); ?>" name="payment[method]" data-bind=" value: getCode(), @@ -112,8 +113,8 @@ script; checked="checked" class="radio solo method" /> <?php endif; ?> - <label for="p_method_<?= $block->escapeHtml($code); ?>"> - <?= $block->escapeHtml($_method->getTitle()) ?> + <label for="p_method_<?= $escaper->escapeHtml($code); ?>"> + <?= $escaper->escapeHtml($_method->getTitle()) ?> </label> </dt> <?php if ($html = $block->getChildHtml('payment.method.' . $code)): ?> @@ -136,12 +137,12 @@ script; <button id="payment-continue" type="button" class="action primary continue"> - <span><?= $block->escapeHtml(__('Go to Review Your Order')); ?></span> + <span><?= $escaper->escapeHtml(__('Go to Review Your Order')); ?></span> </button> </div> <div class="secondary"> - <a href="<?= $block->escapeUrl($block->getBackUrl()); ?>" class="action back"> - <span><?= $block->escapeHtml(__('Back to Shipping Information')); ?></span> + <a href="<?= $escaper->escapeUrl($block->getBackUrl()); ?>" class="action back"> + <span><?= $escaper->escapeHtml(__('Back to Shipping Information')); ?></span> </a> </div> </div> @@ -183,20 +184,21 @@ script; quote.billingAddress({ script; -$scriptString .= "city: '" . /* @noEscape */ $block->getAddress()->getCity() . "'," . PHP_EOL; -$scriptString .= "company: '" . /* @noEscape */ $block->getAddress()->getCompany() . "'," . PHP_EOL; -$scriptString .= "countryId: '" . /* @noEscape */ $block->getAddress()->getCountryId() . "'," . PHP_EOL; -$scriptString .= "customerAddressId: '" . /* @noEscape */ $block->getAddress()->getCustomerAddressId() . "'," . PHP_EOL; -$scriptString .= "customerId: '" . /* @noEscape */ $block->getAddress()->getCustomerId() . "'," . PHP_EOL; -$scriptString .= "fax: '" . /* @noEscape */ $block->getAddress()->getFax() . "'," . PHP_EOL; -$scriptString .= "firstname: '" . /* @noEscape */ $block->getAddress()->getFirstname() . "'," . PHP_EOL; -$scriptString .= "lastname: '" . /* @noEscape */ $block->getAddress()->getLastname() . "'," . PHP_EOL; -$scriptString .= "postcode: '" . /* @noEscape */ $block->getAddress()->getPostcode() . "'," . PHP_EOL; -$scriptString .= "regionId: '" . /* @noEscape */ $block->getAddress()->getRegionId() . "'," . PHP_EOL; -$scriptString .= "regionCode: '" . /* @noEscape */ $block->getAddress()->getRegionCode() . "'," . PHP_EOL; -$scriptString .= "region: '" . /* @noEscape */ $block->getAddress()->getRegion() . "'," . PHP_EOL; +$scriptString .= "city: '" . $escaper->escapeJs($block->getAddress()->getCity()) . "'," . PHP_EOL; +$scriptString .= "company: '" . $escaper->escapeJs($block->getAddress()->getCompany()) . "'," . PHP_EOL; +$scriptString .= "countryId: '" . $escaper->escapeJs($block->getAddress()->getCountryId()) . "'," . PHP_EOL; +$scriptString .= "customerAddressId: '" . $escaper->escapeJs($block->getAddress()->getCustomerAddressId()) . "'," + . PHP_EOL; +$scriptString .= "customerId: '" . $escaper->escapeJs($block->getAddress()->getCustomerId()) . "'," . PHP_EOL; +$scriptString .= "fax: '" . $escaper->escapeJs($block->getAddress()->getFax()) . "'," . PHP_EOL; +$scriptString .= "firstname: '" . $escaper->escapeJs($block->getAddress()->getFirstname()) . "'," . PHP_EOL; +$scriptString .= "lastname: '" . $escaper->escapeJs($block->getAddress()->getLastname()) . "'," . PHP_EOL; +$scriptString .= "postcode: '" . $escaper->escapeJs($block->getAddress()->getPostcode()) . "'," . PHP_EOL; +$scriptString .= "regionId: '" . $escaper->escapeJs($block->getAddress()->getRegionId()) . "'," . PHP_EOL; +$scriptString .= "regionCode: '" . $escaper->escapeJs($block->getAddress()->getRegionCode()) . "'," . PHP_EOL; +$scriptString .= "region: '" . $escaper->escapeJs($block->getAddress()->getRegion()) . "'," . PHP_EOL; $scriptString .= "street: " . /* @noEscape */ json_encode($block->getAddress()->getStreet()) . "," . PHP_EOL; -$scriptString .= "telephone: '" . /* @noEscape */ $block->getAddress()->getTelephone() . "'" . PHP_EOL; +$scriptString .= "telephone: '" . $escaper->escapeJs($block->getAddress()->getTelephone()) . "'" . PHP_EOL; $scriptString .= <<<script }); }); diff --git a/app/code/Magento/Multishipping/view/frontend/web/js/multi-shipping-balance.js b/app/code/Magento/Multishipping/view/frontend/web/js/multi-shipping-balance.js new file mode 100644 index 000000000000..d0a9317b89af --- /dev/null +++ b/app/code/Magento/Multishipping/view/frontend/web/js/multi-shipping-balance.js @@ -0,0 +1,36 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'jquery', + 'mage/dataPost', + 'jquery-ui-modules/widget' +], function ($, dataPost) { + 'use strict'; + + $.widget('mage.multiShippingBalance', { + options: { + changeUrl: '' + }, + + /** + * Initialize balance checkbox events. + * + * @private + */ + _create: function () { + this.element.on('change', $.proxy(function (event) { + dataPost().postData({ + action: this.options.changeUrl, + data: { + useBalance: +$(event.target).is(':checked') + } + }); + }, this)); + } + }); + + return $.mage.multiShippingBalance; +}); diff --git a/app/code/Magento/Multishipping/view/frontend/web/js/payment.js b/app/code/Magento/Multishipping/view/frontend/web/js/payment.js index e185123372e2..2984588c4538 100644 --- a/app/code/Magento/Multishipping/view/frontend/web/js/payment.js +++ b/app/code/Magento/Multishipping/view/frontend/web/js/payment.js @@ -152,7 +152,7 @@ define([ if (submitButton.length) { submitButton.first().trigger('click'); } else { - this.element.submit(); + this.element.trigger('submit'); } } } diff --git a/app/code/Magento/MysqlMq/README.md b/app/code/Magento/MysqlMq/README.md index 3ebc6a10d104..5f41956aee4c 100644 --- a/app/code/Magento/MysqlMq/README.md +++ b/app/code/Magento/MysqlMq/README.md @@ -1,3 +1,28 @@ -# MysqlMq +# Magento_MysqlMq module -**MysqlMq** provides message queue implementation based on MySQL. +**Magento_MysqlMq** provides message queue implementation based on MySQL. + +Module contain recurring script, declared in `Magento\MysqlMq\Setup\Recurring` +class. This script is executed by Magento post each schema installation or upgrade +stage and populates the queue table. + +## Installation + +Module creates the following tables: + +- `queue` - Table storing unique queues +- `queue_message` - Queue messages +- `queue_message_status` - Relation table to keep associations between queues and messages + + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Additional information + +For information about significant changes in patch releases, see [2.3.x Release information](http://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). + +### cron options + +cron group configuration can be set in `etc/crontab.xml`. + +- `mysqlmq_clean_messages` - clean up old messages from database diff --git a/app/code/Magento/Newsletter/Model/CustomerSubscriberCache.php b/app/code/Magento/Newsletter/Model/CustomerSubscriberCache.php new file mode 100644 index 000000000000..37abccea93b8 --- /dev/null +++ b/app/code/Magento/Newsletter/Model/CustomerSubscriberCache.php @@ -0,0 +1,46 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Newsletter\Model; + +/** + * This service provides caching Subscriber by Customer id. + */ +class CustomerSubscriberCache +{ + /** + * @var array + */ + private $customerSubscriber = []; + + /** + * Get Subscriber from cache by Customer id. + * + * @param int $customerId + * @return Subscriber|null + */ + public function getCustomerSubscriber(int $customerId): ?Subscriber + { + $subscriber = null; + if (isset($this->customerSubscriber[$customerId])) { + $subscriber = $this->customerSubscriber[$customerId]; + } + + return $subscriber; + } + + /** + * Set Subscriber to cache by Customer id. + * + * @param int $customerId + * @param Subscriber|null $subscriber + */ + public function setCustomerSubscriber(int $customerId, ?Subscriber $subscriber): void + { + $this->customerSubscriber[$customerId] = $subscriber; + } +} diff --git a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php index d3f8bcb8765c..7ec94ee5bc10 100644 --- a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php +++ b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php @@ -3,21 +3,24 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Newsletter\Model\Plugin; use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerExtensionInterface; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Model\Config\Share; use Magento\Framework\Api\ExtensionAttributesFactory; +use Magento\Framework\Api\SearchResults; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\CustomerSubscriberCache; use Magento\Newsletter\Model\ResourceModel\Subscriber\CollectionFactory; -use Magento\Customer\Api\Data\CustomerExtensionInterface; +use Magento\Newsletter\Model\Subscriber; use Magento\Newsletter\Model\SubscriberFactory; use Magento\Newsletter\Model\SubscriptionManagerInterface; use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; -use Magento\Framework\Api\SearchResults; use Psr\Log\LoggerInterface; /** @@ -52,11 +55,6 @@ class CustomerPlugin */ private $storeManager; - /** - * @var array - */ - private $customerSubscriber = []; - /** * @var SubscriberFactory */ @@ -67,6 +65,11 @@ class CustomerPlugin */ private $logger; + /** + * @var CustomerSubscriberCache + */ + private $customerSubscriberCache; + /** * @param SubscriberFactory $subscriberFactory * @param ExtensionAttributesFactory $extensionFactory @@ -75,6 +78,7 @@ class CustomerPlugin * @param Share $shareConfig * @param StoreManagerInterface $storeManager * @param LoggerInterface $logger + * @param CustomerSubscriberCache|null $customerSubscriberCache */ public function __construct( SubscriberFactory $subscriberFactory, @@ -83,7 +87,8 @@ public function __construct( SubscriptionManagerInterface $subscriptionManager, Share $shareConfig, StoreManagerInterface $storeManager, - LoggerInterface $logger + LoggerInterface $logger, + CustomerSubscriberCache $customerSubscriberCache = null ) { $this->subscriberFactory = $subscriberFactory; $this->extensionFactory = $extensionFactory; @@ -92,6 +97,8 @@ public function __construct( $this->shareConfig = $shareConfig; $this->storeManager = $storeManager; $this->logger = $logger; + $this->customerSubscriberCache = $customerSubscriberCache + ?? ObjectManager::getInstance()->get(CustomerSubscriberCache::class); } /** @@ -129,10 +136,11 @@ public function afterSave( } if ($needToUpdate) { $storeId = $this->getCurrentStoreId($result); + $customerId = (int)$result->getId(); $subscriber = $subscribeStatus - ? $this->subscriptionManager->subscribeCustomer((int)$result->getId(), $storeId) - : $this->subscriptionManager->unsubscribeCustomer((int)$result->getId(), $storeId); - $this->customerSubscriber[(int)$result->getId()] = $subscriber; + ? $this->subscriptionManager->subscribeCustomer($customerId, $storeId) + : $this->subscriptionManager->unsubscribeCustomer($customerId, $storeId); + $this->customerSubscriberCache->setCustomerSubscriber($customerId, $subscriber); } $this->addIsSubscribedExtensionAttribute($result, $subscriber->isSubscribed()); @@ -258,7 +266,7 @@ public function afterGetList(CustomerRepositoryInterface $subject, SearchResults $extensionAttributes = $customer->getExtensionAttributes(); /** @var Subscriber $subscribe */ $subscribe = $collection->getItemByColumnValue('subscriber_email', $customer->getEmail()); - $isSubscribed = $subscribe && (int) $subscribe->getStatus() === Subscriber::STATUS_SUBSCRIBED; + $isSubscribed = $subscribe && (int)$subscribe->getStatus() === Subscriber::STATUS_SUBSCRIBED; $extensionAttributes->setIsSubscribed($isSubscribed); } @@ -315,22 +323,20 @@ private function deleteSubscriptionsAfterCustomerDelete(CustomerInterface $custo private function getSubscriber(CustomerInterface $customer): Subscriber { $customerId = (int)$customer->getId(); - if (isset($this->customerSubscriber[$customerId])) { - return $this->customerSubscriber[$customerId]; - } - - /** @var Subscriber $subscriber */ - $subscriber = $this->subscriberFactory->create(); - $websiteId = $this->getCurrentWebsiteId($customer); - $subscriber->loadByCustomer((int)$customer->getId(), $websiteId); - /** - * If subscriber was't found by customer id then try to find subscriber by customer email. - * It need when the customer is creating and he has already subscribed as guest by same email. - */ - if (!$subscriber->getId()) { - $subscriber->loadBySubscriberEmail((string)$customer->getEmail(), $websiteId); + $subscriber = $this->customerSubscriberCache->getCustomerSubscriber($customerId); + if ($subscriber === null) { + $subscriber = $this->subscriberFactory->create(); + $websiteId = $this->getCurrentWebsiteId($customer); + $subscriber->loadByCustomer((int)$customer->getId(), $websiteId); + /** + * If subscriber wasn't found by customer id then try to find subscriber by customer email. + * It need when the customer is creating and he has already subscribed as guest by same email. + */ + if (!$subscriber->getId()) { + $subscriber->loadBySubscriberEmail((string)$customer->getEmail(), $websiteId); + } + $this->customerSubscriberCache->setCustomerSubscriber($customerId, $subscriber); } - $this->customerSubscriber[$customerId] = $subscriber; return $subscriber; } diff --git a/app/code/Magento/Newsletter/Model/Plugin/RemoveSubscriberFromQueue.php b/app/code/Magento/Newsletter/Model/Plugin/RemoveSubscriberFromQueue.php new file mode 100644 index 000000000000..93b79744c01e --- /dev/null +++ b/app/code/Magento/Newsletter/Model/Plugin/RemoveSubscriberFromQueue.php @@ -0,0 +1,47 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Newsletter\Model\Plugin; + +use Magento\Newsletter\Model\RemoveSubscriberFromQueueLink; +use Magento\Newsletter\Model\Subscriber; + +/** + * Plugin for removing subscriber from queue after unsubscribe + */ +class RemoveSubscriberFromQueue +{ + /** + * @var RemoveSubscriberFromQueueLink + */ + private $removeSubscriberFromQueueLink; + + /** + * @param RemoveSubscriberFromQueueLink $removeSubscriberFromQueueLink + */ + public function __construct(RemoveSubscriberFromQueueLink $removeSubscriberFromQueueLink) + { + $this->removeSubscriberFromQueueLink = $removeSubscriberFromQueueLink; + } + + /** + * Removes subscriber from queue + * + * @param Subscriber $subject + * @param Subscriber $subscriber + * @return Subscriber + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterUnsubscribe(Subscriber $subject, Subscriber $subscriber): Subscriber + { + if ($subscriber->isStatusChanged() && $subscriber->getSubscriberStatus() === Subscriber::STATUS_UNSUBSCRIBED) { + $this->removeSubscriberFromQueueLink->execute((int) $subscriber->getId()); + } + + return $subscriber; + } +} diff --git a/app/code/Magento/Newsletter/Model/RemoveSubscriberFromQueueLink.php b/app/code/Magento/Newsletter/Model/RemoveSubscriberFromQueueLink.php new file mode 100644 index 000000000000..6f741ce719bf --- /dev/null +++ b/app/code/Magento/Newsletter/Model/RemoveSubscriberFromQueueLink.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Newsletter\Model; + +use Magento\Framework\App\ResourceConnection; + +/** + * Responsible for removing subscriber from queue + */ +class RemoveSubscriberFromQueueLink +{ + /** + * @var ResourceConnection + */ + private $resourceConnection; + + /** + * @param ResourceConnection $resourceConnection + */ + public function __construct(ResourceConnection $resourceConnection) + { + $this->resourceConnection = $resourceConnection; + } + + /** + * Removes subscriber from queue + * + * @param int $subscriberId + * @return void + */ + public function execute(int $subscriberId): void + { + $connection = $this->resourceConnection->getConnection(); + + $connection->delete( + $this->resourceConnection->getTableName('newsletter_queue_link'), + ['subscriber_id = ?' => $subscriberId, 'letter_sent_at IS NULL'] + ); + } +} diff --git a/app/code/Magento/Newsletter/Model/ResourceModel/Queue.php b/app/code/Magento/Newsletter/Model/ResourceModel/Queue.php index 06ff66e29064..476ce38fab10 100644 --- a/app/code/Magento/Newsletter/Model/ResourceModel/Queue.php +++ b/app/code/Magento/Newsletter/Model/ResourceModel/Queue.php @@ -86,7 +86,7 @@ public function addSubscribersToQueue(ModelQueue $queue, array $subscriberIds) $usedIds = array_flip($connection->fetchCol($select)); $subscriberIds = array_flip($subscriberIds); $newIds = array_diff_key($subscriberIds, $usedIds); - + $connection->beginTransaction(); try { foreach (array_keys($newIds) as $subscriberId) { diff --git a/app/code/Magento/Newsletter/Model/Subscriber.php b/app/code/Magento/Newsletter/Model/Subscriber.php index c2d80f900079..29045bf5a8e3 100644 --- a/app/code/Magento/Newsletter/Model/Subscriber.php +++ b/app/code/Magento/Newsletter/Model/Subscriber.php @@ -308,6 +308,10 @@ public function getStatus() */ public function setStatus($value) { + if ($this->getSubscriberStatus() !== $value) { + $this->setStatusChanged(true); + } + return $this->setSubscriberStatus($value); } @@ -449,7 +453,8 @@ public function unsubscribe() } if ($this->getSubscriberStatus() != self::STATUS_UNSUBSCRIBED) { - $this->setSubscriberStatus(self::STATUS_UNSUBSCRIBED)->save(); + $this->setStatus(self::STATUS_UNSUBSCRIBED); + $this->save(); $this->sendUnsubscriptionEmail(); } return $this; diff --git a/app/code/Magento/Newsletter/Model/SubscriptionManager.php b/app/code/Magento/Newsletter/Model/SubscriptionManager.php index 57c6cd8b843a..05be8325e324 100644 --- a/app/code/Magento/Newsletter/Model/SubscriptionManager.php +++ b/app/code/Magento/Newsletter/Model/SubscriptionManager.php @@ -11,6 +11,7 @@ use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\MailException; use Magento\Store\Model\ScopeInterface; use Magento\Store\Model\StoreManagerInterface; @@ -51,6 +52,11 @@ class SubscriptionManager implements SubscriptionManagerInterface */ private $customerRepository; + /** + * @var CustomerSubscriberCache + */ + private $customerSubscriberCache; + /** * @param SubscriberFactory $subscriberFactory * @param LoggerInterface $logger @@ -58,6 +64,7 @@ class SubscriptionManager implements SubscriptionManagerInterface * @param ScopeConfigInterface $scopeConfig * @param AccountManagementInterface $customerAccountManagement * @param CustomerRepositoryInterface $customerRepository + * @param CustomerSubscriberCache|null $customerSubscriberCache */ public function __construct( SubscriberFactory $subscriberFactory, @@ -65,7 +72,8 @@ public function __construct( StoreManagerInterface $storeManager, ScopeConfigInterface $scopeConfig, AccountManagementInterface $customerAccountManagement, - CustomerRepositoryInterface $customerRepository + CustomerRepositoryInterface $customerRepository, + CustomerSubscriberCache $customerSubscriberCache = null ) { $this->subscriberFactory = $subscriberFactory; $this->logger = $logger; @@ -73,6 +81,8 @@ public function __construct( $this->scopeConfig = $scopeConfig; $this->customerAccountManagement = $customerAccountManagement; $this->customerRepository = $customerRepository; + $this->customerSubscriberCache = $customerSubscriberCache + ?? ObjectManager::getInstance()->get(CustomerSubscriberCache::class); } /** @@ -209,14 +219,16 @@ private function saveSubscriber( if (!$subscriber->getId()) { $subscriber->setSubscriberConfirmCode($subscriber->randomSequence()); } + $customerId = (int)$customer->getId(); $subscriber->setStatus($status) ->setStatusChanged($statusChanged) - ->setCustomerId($customer->getId()) + ->setCustomerId($customerId) ->setStoreId($storeId) ->setEmail($customer->getEmail()) ->save(); if ($statusChanged) { + $this->customerSubscriberCache->setCustomerSubscriber($customerId, null); return true; } diff --git a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/AdminCreateNewsletterTemplateActionGroup.xml b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/AdminCreateNewsletterTemplateActionGroup.xml new file mode 100644 index 000000000000..b7750f274abb --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/AdminCreateNewsletterTemplateActionGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCreateNewsletterTemplateActionGroup" extends="AdminMarketingCreateNewsletterTemplateActionGroup"> + <annotations> + <description> + Extends AdminMarketingCreateNewsletterTemplateActionGroup. + Clicks the Show/Hide button for the Template Content field before text is sent to this field. + </description> + </annotations> + + <click selector="{{BasicFieldNewsletterSection.showHide}}" stepKey="showWYSIWYG" before="fillTemplateContentField"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/AdminQueueNewsletterActionGroup.xml b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/AdminQueueNewsletterActionGroup.xml new file mode 100644 index 000000000000..05ad191360b3 --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/AdminQueueNewsletterActionGroup.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + + <actionGroup name="AdminQueueNewsletterActionGroup"> + <annotations> + <description> + Sends Newsletter template to queue: + Clicks the Queue Newsletter action. + Sets Queue Date Start. + Selects needed Store view if applicable. + Clicks the Save and Resume button. + </description> + </annotations> + <arguments> + <argument name="startAt" type="string"/> + <argument name="storeView" type="string" defaultValue="Default Store View"/> + </arguments> + + <click selector="{{AdminNewsletterGridMainActionsSection.action}}" stepKey="clickActionDropdown"/> + <click selector="{{AdminNewsletterGridMainActionsSection.queueNewsletterOption}}" stepKey="cliclkQueueNewsletterOption"/> + <fillField selector="{{QueueInformationSection.queueStartFrom}}" userInput="{{startAt}}" stepKey="setDate"/> + <conditionalClick selector="{{QueueInformationSection.subscriberFromOption(storeView)}}" dependentSelector="{{QueueInformationSection.subscriberFromOption(storeView)}}" visible="true" stepKey="setStoreview"/> + <click selector="{{AdminNewsletterMainActionsSection.saveAndResumeButton}}" stepKey="clickSaveAndResumeButton"/> + <see userInput="You saved the newsletter queue." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Page/NewsletterTemplatePage/NewsletterTemplateFormPage.xml b/app/code/Magento/Newsletter/Test/Mftf/Page/NewsletterTemplatePage/NewsletterTemplateFormPage.xml index c24185f6afac..5113232d8524 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Page/NewsletterTemplatePage/NewsletterTemplateFormPage.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Page/NewsletterTemplatePage/NewsletterTemplateFormPage.xml @@ -10,5 +10,6 @@ <page name="NewsletterTemplateForm" url="/newsletter/template/new/" area="admin" module="Magento_Cms"> <section name="StorefrontNewsletterSection"/> <section name="StorefrontNewsletterSection"/> + <section name="QueueInformationSection"/> </page> </pages> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterGridMainActionsSection.xml b/app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterGridMainActionsSection.xml index ed1b432f798a..b8ea4f35db53 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterGridMainActionsSection.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterGridMainActionsSection.xml @@ -16,5 +16,7 @@ <element name="resetFilter" type="button" selector=".action-default.scalable.action-reset.action-tertiary"/> <element name="searchResultFirstRow" type="text" selector=".data-grid>tbody>tr"/> <element name="messageByType" type="block" selector="#messages .message-{{messageType}}" parameterized="true"/> + <element name="action" type="select" selector=".admin__control-select"/> + <element name="queueNewsletterOption" type="input" selector="//option[contains(text(),'Queue Newsletter')]"/> </section> </sections> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterMainActionsSection.xml b/app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterMainActionsSection.xml index d824496f8e6b..e9f44794a42a 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterMainActionsSection.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterMainActionsSection.xml @@ -11,5 +11,6 @@ <element name="saveTemplateButton" type="button" selector=".page-actions-inner .page-actions-buttons .save"/> <element name="deleteTemplateButton" type="button" selector=".page-actions-inner .page-actions-buttons .delete"/> <element name="confirmDelete" type="button" selector=".action-primary.action-accept" timeout="10"/> + <element name="saveAndResumeButton" type="button" selector="//span[contains(text(),'Save and Resume')]/ancestor::button"/> </section> </sections> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Section/NewsletterTemplateSection/BasicFieldNewsletterSection.xml b/app/code/Magento/Newsletter/Test/Mftf/Section/NewsletterTemplateSection/BasicFieldNewsletterSection.xml index 8df5053a5bf0..98b786c0edd6 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Section/NewsletterTemplateSection/BasicFieldNewsletterSection.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Section/NewsletterTemplateSection/BasicFieldNewsletterSection.xml @@ -15,5 +15,6 @@ <element name="save" type="button" selector="button[data-role='template-save']" timeout="60"/> <element name="searchButton" type="button" selector=".admin__filter-actions button[title=Search]"/> <element name="searchInput" type="input" selector="input[name=code]"/> + <element name="showHide" type="button" selector=".action-show-hide"/> </section> </sections> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Section/NewsletterTemplateSection/QueueInformationSection.xml b/app/code/Magento/Newsletter/Test/Mftf/Section/NewsletterTemplateSection/QueueInformationSection.xml new file mode 100644 index 000000000000..150c037cf2c3 --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/Section/NewsletterTemplateSection/QueueInformationSection.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="QueueInformationSection"> + <element name="queueStartFrom" type="input" selector="#date"/> + <element name="subscriberFromOption" type="select" selector="//option[contains(text(),'{{storeView}}')]" parameterized="true"/> + </section> +</sections> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml index a6cb2456c583..0661d1e5d9c2 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml @@ -20,7 +20,9 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> </before> <!--Create a newsletter template that contains an image--> <amOnPage url="{{NewsletterTemplateForm.url}}" stepKey="amOnNewsletterTemplatePage"/> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml index d4bb8d358e21..c4c0bbef02df 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml @@ -20,13 +20,15 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> </before> <!--Create Custom Variable--> <actionGroup ref="CreateCustomVariableActionGroup" stepKey="createCustomVariable" /> <!--Setup Store information--> <waitForPageLoad stepKey="wait" /> - <amOnPage url="/admin/admin/system_config/" stepKey="goToConfigStoreInformation" /> + <amOnPage url="{{AdminConfigPage.url}}" stepKey="goToConfigStoreInformation" /> <waitForPageLoad stepKey="waitForPageLoad1" /> <conditionalClick selector="{{StoreConfigSection.StoreInformation}}" dependentSelector="{{StoreConfigSection.CheckIfTabExpand}}" stepKey="checkIfTabOpen" visible="true"/> <fillField selector="{{StoreConfigSection.City}}" userInput="{{_defaultVariable.city}}" stepKey="fillCity" /> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml index 0fa16d275d6f..27c843f91849 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml @@ -20,7 +20,9 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> </before> <amOnPage url="{{NewsletterTemplateForm.url}}" stepKey="amOnNewsletterTemplatePage"/> <waitForElementVisible selector="{{BasicFieldNewsletterSection.templateName}}" stepKey="waitForTemplateName"/> @@ -42,9 +44,9 @@ <waitForElementVisible selector="{{WidgetSection.CMSPage}}" stepKey="waitForPageVisible" /> <click selector="{{WidgetSection.CMSPage}}" stepKey="selectPreCreateCMS" /> <waitForElementNotVisible selector="{{WidgetSection.SelectPageTitle}}" stepKey="waitForSlideOutCloses" /> - <click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" /> - <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> - <waitForElementNotVisible selector="{{WidgetSection.InsertWidgetTitle}}" stepKey="waitForSlideOutCloses1" /> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSlideOutCloses1"/> <click selector="{{BasicFieldNewsletterSection.save}}" stepKey="clickSaveTemplate"/> <waitForPageLoad stepKey="waitForPageLoad10" /> <click selector="{{NewsletterWYSIWYGSection.Preview(_defaultNewsletter.name)}}" stepKey="clickPreview" /> @@ -59,4 +61,3 @@ </after> </test> </tests> - diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/StorefrontNewsletterSubscriptionDisabledForStoreViewAtRegistrationTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/StorefrontNewsletterSubscriptionDisabledForStoreViewAtRegistrationTest.xml new file mode 100644 index 000000000000..bc273d84aaf3 --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/StorefrontNewsletterSubscriptionDisabledForStoreViewAtRegistrationTest.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontNewsletterSubscriptionDisabledForStoreViewAtRegistrationTest"> + <annotations> + <features value="Newsletter"/> + <stories value="Disabled Newsletter Subscription for store View"/> + <title value="Disabled Newsletter Subscription for store View"/> + <description value="Option to subscribe should not be displayed at registration form if it is switched off for current store"/> + <severity value="AVERAGE"/> + <group value="newsletter"/> + <group value="configuration"/> + <testCaseId value="MC-*"/> + </annotations> + <before> + <magentoCLI command="config:set --scope=stores --scope-code=default newsletter/general/active 0" stepKey="disableSubscriptionForStore"/> + </before> + <after> + <magentoCLI command="config:set --scope=stores --scope-code=default newsletter/general/active 1" stepKey="enableSubscriptionForStore"/> + </after> + <actionGroup ref="StorefrontOpenCustomerAccountCreatePageActionGroup" stepKey="openCreateAccountPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <dontSeeElement selector="{{StorefrontCustomerCreateFormSection.signUpForNewsletter}}" stepKey="checkNoSubscriptionOption"/> + </test> +</tests> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml index 63b2741e7bd1..52635fb263ef 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml @@ -50,9 +50,7 @@ <argument name="websiteName" value="{{customWebsite.name}}"/> </actionGroup> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearFilters"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifyTinyMCEIsNativeWYSIWYGOnNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifyTinyMCEIsNativeWYSIWYGOnNewsletterTest.xml new file mode 100644 index 000000000000..2665109db124 --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifyTinyMCEIsNativeWYSIWYGOnNewsletterTest.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="VerifyTinyMCEIsNativeWYSIWYGOnNewsletterTest"> + <annotations> + <features value="Newsletter"/> + <stories value="MAGETWO-47309-Apply new WYSIWYG in Newsletter"/> + <group value="Newsletter"/> + <title value="Admin should see TinyMCE is the native WYSIWYG on Newsletter"/> + <description value="Admin should see TinyMCE is the native WYSIWYG on Newsletter"/> + <severity value="CRITICAL"/> + <testCaseId value="MAGETWO-84683"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> + <actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" > + <argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/> + </actionGroup> + </before> + <amOnPage url="{{NewsletterTemplateForm.url}}" stepKey="amOnNewsletterTemplatePage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <fillField selector="{{BasicFieldNewsletterSection.templateName}}" userInput="{{_defaultNewsletter.name}}" stepKey="fillTemplateName" /> + <fillField selector="{{BasicFieldNewsletterSection.templateSubject}}" userInput="{{_defaultNewsletter.subject}}" stepKey="fillTemplateSubject" /> + <fillField selector="{{BasicFieldNewsletterSection.senderName}}" userInput="{{_defaultNewsletter.senderName}}" stepKey="fillSenderName" /> + <fillField selector="{{BasicFieldNewsletterSection.senderEmail}}" userInput="{{_defaultNewsletter.senderEmail}}" stepKey="fillSenderEmail" /> + <conditionalClick selector="#toggletext" dependentSelector=".mce-tinymce" visible="false" stepKey="clickBtnIfTinyMCEHidden"/> + <waitForPageLoad stepKey="waitForTinyMce"/> + <actionGroup ref="VerifyTinyMCEActionGroup" stepKey="verifyTinyMCE"/> + <actionGroup ref="VerifyMagentoEntityActionGroup" stepKey="verifyMagentoEntities"/> + <executeJS function="tinyMCE.get('text').setContent('Hello World From Newsletter Template!');" stepKey="executeJSFillContent"/> + <click selector="{{NewsletterWYSIWYGSection.ShowHideBtn}}" stepKey="clickShowHideBtn2" /> + <waitForElementVisible selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="waitForInsertWidget" /> + <see selector="{{NewsletterWYSIWYGSection.InsertImageBtn}}" userInput="Insert Image..." stepKey="assertInf17"/> + <see selector="{{NewsletterWYSIWYGSection.InsertWidgetBtn}}" userInput="Insert Widget..." stepKey="assertInfo18"/> + <see selector="{{NewsletterWYSIWYGSection.InsertVariableBtn}}" userInput="Insert Variable..." stepKey="assertInfo19"/> + <!--Go to Storefront--> + <click selector="{{BasicFieldNewsletterSection.save}}" stepKey="clickSavePage"/> + <waitForPageLoad stepKey="waitForPageLoad3" /> + <click selector="{{NewsletterWYSIWYGSection.Preview(_defaultNewsletter.name)}}" stepKey="clickPreview" /> + <switchToWindow stepKey="switchToWindow" userInput="action_window"/> + <actionGroup ref="SwitchToPreviewIframeActionGroup" stepKey="switchToIframe"/> + <waitForText userInput="Hello World From Newsletter Template!" stepKey="waitForPageLoad2"/> + <see userInput="Hello World From Newsletter Template!" stepKey="seeContent" /> + <closeTab stepKey="closeTab"/> + <after> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + </test> +</tests> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnNewsletterTest.xml deleted file mode 100644 index 7cfd4c67369c..000000000000 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnNewsletterTest.xml +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="VerifyTinyMCEv4IsNativeWYSIWYGOnNewsletterTest"> - <annotations> - <features value="Newsletter"/> - <stories value="MAGETWO-47309-Apply new WYSIWYG in Newsletter"/> - <group value="Newsletter"/> - <title value="Admin should see TinyMCEv4.6 is the native WYSIWYG on Newsletter"/> - <description value="Admin should see TinyMCEv4.6 is the native WYSIWYG on Newsletter"/> - <severity value="CRITICAL"/> - <testCaseId value="MAGETWO-84683"/> - </annotations> - <before> - <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> - </before> - <amOnPage url="{{NewsletterTemplateForm.url}}" stepKey="amOnNewsletterTemplatePage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <fillField selector="{{BasicFieldNewsletterSection.templateName}}" userInput="{{_defaultNewsletter.name}}" stepKey="fillTemplateName" /> - <fillField selector="{{BasicFieldNewsletterSection.templateSubject}}" userInput="{{_defaultNewsletter.subject}}" stepKey="fillTemplateSubject" /> - <fillField selector="{{BasicFieldNewsletterSection.senderName}}" userInput="{{_defaultNewsletter.senderName}}" stepKey="fillSenderName" /> - <fillField selector="{{BasicFieldNewsletterSection.senderEmail}}" userInput="{{_defaultNewsletter.senderEmail}}" stepKey="fillSenderEmail" /> - <conditionalClick selector="#toggletext" dependentSelector=".mce-tinymce" visible="false" stepKey="clickBtnIfTinyMCEHidden"/> - <waitForPageLoad stepKey="waitForTinyMce"/> - <actionGroup ref="VerifyTinyMCEActionGroup" stepKey="verifyTinyMCE4"/> - <actionGroup ref="VerifyMagentoEntityActionGroup" stepKey="verifyMagentoEntities"/> - <executeJS function="tinyMCE.get('text').setContent('Hello World From Newsletter Template!');" stepKey="executeJSFillContent"/> - <click selector="{{NewsletterWYSIWYGSection.ShowHideBtn}}" stepKey="clickShowHideBtn2" /> - <waitForElementVisible selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="waitForInsertWidget" /> - <see selector="{{NewsletterWYSIWYGSection.InsertImageBtn}}" userInput="Insert Image..." stepKey="assertInf17"/> - <see selector="{{NewsletterWYSIWYGSection.InsertWidgetBtn}}" userInput="Insert Widget..." stepKey="assertInfo18"/> - <see selector="{{NewsletterWYSIWYGSection.InsertVariableBtn}}" userInput="Insert Variable..." stepKey="assertInfo19"/> - <!--Go to Storefront--> - <click selector="{{BasicFieldNewsletterSection.save}}" stepKey="clickSavePage"/> - <waitForPageLoad stepKey="waitForPageLoad3" /> - <click selector="{{NewsletterWYSIWYGSection.Preview(_defaultNewsletter.name)}}" stepKey="clickPreview" /> - <switchToWindow stepKey="switchToWindow" userInput="action_window"/> - <actionGroup ref="SwitchToPreviewIframeActionGroup" stepKey="switchToIframe"/> - <waitForText userInput="Hello World From Newsletter Template!" stepKey="waitForPageLoad2"/> - <see userInput="Hello World From Newsletter Template!" stepKey="seeContent" /> - <closeTab stepKey="closeTab"/> - <after> - <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - </after> - </test> -</tests> diff --git a/app/code/Magento/Newsletter/etc/di.xml b/app/code/Magento/Newsletter/etc/di.xml index 3c35936a2e8a..cb97a6af7dde 100644 --- a/app/code/Magento/Newsletter/etc/di.xml +++ b/app/code/Magento/Newsletter/etc/di.xml @@ -26,6 +26,7 @@ type="Magento\Newsletter\Model\Plugin\CustomerPlugin"/> </type> <type name="Magento\Newsletter\Model\Subscriber"> + <plugin name="remove_subscriber_from_queue_after_unsubscribe" type="Magento\Newsletter\Model\Plugin\RemoveSubscriberFromQueue"/> <arguments> <argument name="customerSession" xsi:type="object">Magento\Customer\Model\Session\Proxy</argument> </arguments> diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php b/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php index 1a42aa26175e..fc1da676453f 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php @@ -113,9 +113,14 @@ private function getFreeBoxesCount(RateRequest $request) continue; } + $freeShippingMethod = $item->getFreeShippingMethod(); + if ($item->getHasChildren() && $item->isShipSeparately()) { $freeBoxes += $this->getFreeBoxesCountFromChildren($item); - } elseif ($item->getFreeShipping()) { + } elseif ( + $item->getFreeShipping() + && ($freeShippingMethod === null || $freeShippingMethod === 'flatrate_flatrate') + ) { $freeBoxes += $item->getQty(); } } diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php b/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php index 112accbae807..b4351e6c5727 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php @@ -118,6 +118,7 @@ public function collectRates(RateRequest $request) // Free shipping by qty $freeQty = 0; $freePackageValue = 0; + $freeWeight = 0; if ($request->getAllItems()) { foreach ($request->getAllItems() as $item) { @@ -132,19 +133,31 @@ public function collectRates(RateRequest $request) $freeQty += $item->getQty() * ($child->getQty() - $freeShipping); } } - } elseif ($item->getFreeShipping() || $item->getAddress()->getFreeShipping()) { + } elseif ( + ($item->getFreeShipping() || $item->getAddress()->getFreeShipping()) && + ($item->getFreeShippingMethod() == null || $item->getFreeShippingMethod() && + $item->getFreeShippingMethod() == 'tablerate_bestway') + ) { $freeShipping = $item->getFreeShipping() ? $item->getFreeShipping() : $item->getAddress()->getFreeShipping(); $freeShipping = is_numeric($freeShipping) ? $freeShipping : 0; $freeQty += $item->getQty() - $freeShipping; $freePackageValue += $item->getBaseRowTotal(); } + + if ($item->getFreeShippingMethod() && $item->getFreeShippingMethod() !== 'tablerate_bestway') { + $freeWeight += (int) $item->getWeight(); + } } - + $request->setPackageValue($request->getPackageValue() - $freePackageValue); $request->setPackageValueWithDiscount($request->getPackageValueWithDiscount() - $freePackageValue); } + if ($freeWeight > 0) { + $request->setFreeMethodWeight($freeWeight); + } + if (!$request->getConditionName()) { $conditionName = $this->getConfigData('condition_name'); $request->setConditionName($conditionName ? $conditionName : $this->_defaultConditionName); diff --git a/app/code/Magento/OfflineShipping/Model/SalesRule/Calculator.php b/app/code/Magento/OfflineShipping/Model/SalesRule/Calculator.php index c178551ae458..c602698e600a 100644 --- a/app/code/Magento/OfflineShipping/Model/SalesRule/Calculator.php +++ b/app/code/Magento/OfflineShipping/Model/SalesRule/Calculator.php @@ -45,6 +45,7 @@ public function processFreeShipping(\Magento\Quote\Model\Quote\Item\AbstractItem switch ($rule->getSimpleFreeShipping()) { case Rule::FREE_SHIPPING_ITEM: $item->setFreeShipping($rule->getDiscountQty() ? $rule->getDiscountQty() : true); + $item->setFreeShippingMethod($item->getAddress()->getShippingMethod()); break; case Rule::FREE_SHIPPING_ADDRESS: diff --git a/app/code/Magento/PageCache/Model/App/CacheIdentifierPlugin.php b/app/code/Magento/PageCache/Model/App/CacheIdentifierPlugin.php index 0eca6a763796..c944217d8200 100644 --- a/app/code/Magento/PageCache/Model/App/CacheIdentifierPlugin.php +++ b/app/code/Magento/PageCache/Model/App/CacheIdentifierPlugin.php @@ -16,8 +16,21 @@ class CacheIdentifierPlugin { /** - * Constructor - * + * @var \Magento\Framework\View\DesignExceptions + */ + private $designExceptions; + + /** + * @var \Magento\Framework\App\RequestInterface + */ + private $request; + + /** + * @var \Magento\PageCache\Model\Config + */ + private $config; + + /** * @param \Magento\Framework\View\DesignExceptions $designExceptions * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\PageCache\Model\Config $config diff --git a/app/code/Magento/PageCache/Plugin/RegisterFormKeyFromCookie.php b/app/code/Magento/PageCache/Plugin/RegisterFormKeyFromCookie.php index 36a20ec658b6..62f5461657fa 100644 --- a/app/code/Magento/PageCache/Plugin/RegisterFormKeyFromCookie.php +++ b/app/code/Magento/PageCache/Plugin/RegisterFormKeyFromCookie.php @@ -96,6 +96,7 @@ private function updateCookieFormKey(string $formKey): void $cookieMetadata->setDomain($this->sessionConfig->getCookieDomain()); $cookieMetadata->setPath($this->sessionConfig->getCookiePath()); $cookieMetadata->setSecure($this->sessionConfig->getCookieSecure()); + $cookieMetadata->setSameSite('Lax'); $lifetime = $this->sessionConfig->getCookieLifetime(); if ($lifetime !== 0) { $cookieMetadata->setDuration($lifetime); diff --git a/app/code/Magento/PageCache/view/frontend/web/js/form-key-provider.js b/app/code/Magento/PageCache/view/frontend/web/js/form-key-provider.js index c63d97840e94..f602166e3414 100644 --- a/app/code/Magento/PageCache/view/frontend/web/js/form-key-provider.js +++ b/app/code/Magento/PageCache/view/frontend/web/js/form-key-provider.js @@ -18,13 +18,16 @@ define(function () { var expires, secure, date = new Date(), - isSecure = !!window.cookiesConfig && window.cookiesConfig.secure; + cookiesConfig = window.cookiesConfig || {}, + isSecure = !!cookiesConfig.secure, + samesite = cookiesConfig.samesite || 'lax'; date.setTime(date.getTime() + 86400000); expires = '; expires=' + date.toUTCString(); secure = isSecure ? '; secure' : ''; + samesite = '; samesite=' + samesite; - document.cookie = 'form_key=' + (value || '') + expires + secure + '; path=/'; + document.cookie = 'form_key=' + (value || '') + expires + secure + '; path=/' + samesite; } /** diff --git a/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js b/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js index d7214918c530..2509891d0225 100644 --- a/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js +++ b/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js @@ -65,7 +65,7 @@ define([ contents = function (elem) { return $.map(elem, function (el) { try { - return $.nodeName(el, 'iframe') ? + return el.nodeName.toLowerCase() === 'iframe' ? el.contentDocument || (el.contentWindow ? el.contentWindow.document : []) : $.merge([], el.childNodes); } catch (e) { diff --git a/app/code/Magento/Payment/Helper/Data.php b/app/code/Magento/Payment/Helper/Data.php index 377dad8a3d22..782ef3908243 100644 --- a/app/code/Magento/Payment/Helper/Data.php +++ b/app/code/Magento/Payment/Helper/Data.php @@ -200,7 +200,7 @@ public function getInfoBlock(InfoInterface $info, LayoutInterface $layout = null */ public function getInfoBlockHtml(InfoInterface $info, $storeId) { - $this->_appEmulation->startEnvironmentEmulation($storeId); + $this->_appEmulation->startEnvironmentEmulation($storeId, \Magento\Framework\App\Area::AREA_FRONTEND, true); try { // Retrieve specified view block from appropriate design package (depends on emulated store) diff --git a/app/code/Magento/Payment/Model/Method/AbstractMethod.php b/app/code/Magento/Payment/Model/Method/AbstractMethod.php index 3c21b281cd12..931d0856a78f 100644 --- a/app/code/Magento/Payment/Model/Method/AbstractMethod.php +++ b/app/code/Magento/Payment/Model/Method/AbstractMethod.php @@ -25,7 +25,7 @@ * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @deprecated 100.0.6 * @see \Magento\Payment\Model\Method\Adapter - * @see https://devdocs.magento.com/guides/v2.3/payments-integrations/payment-gateway/payment-gateway-intro.html + * @see https://devdocs.magento.com/guides/v2.4/payments-integrations/payment-gateway/payment-gateway-intro.html * @since 100.0.2 */ abstract class AbstractMethod extends \Magento\Framework\Model\AbstractExtensibleModel implements diff --git a/app/code/Magento/Payment/Test/Mftf/Data/PaymentMethodData.xml b/app/code/Magento/Payment/Test/Mftf/Data/PaymentMethodData.xml index eeae53d08244..a5ac53bc56ca 100644 --- a/app/code/Magento/Payment/Test/Mftf/Data/PaymentMethodData.xml +++ b/app/code/Magento/Payment/Test/Mftf/Data/PaymentMethodData.xml @@ -15,4 +15,8 @@ <entity name="CashOnDeliveryPaymentMethodDefault" type="cashondelivery_payment_method"> <requiredEntity type="active">CashOnDeliveryEnableConfigData</requiredEntity> </entity> + + <entity name="CashOnDeliveryPaymentMethod" type="payment_method"> + <data key="method">cashondelivery</data> + </entity> </entities> diff --git a/app/code/Magento/Payment/Test/Unit/Helper/DataTest.php b/app/code/Magento/Payment/Test/Unit/Helper/DataTest.php index 21c282635945..3130aeeaffcb 100644 --- a/app/code/Magento/Payment/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/Payment/Test/Unit/Helper/DataTest.php @@ -234,7 +234,9 @@ public function testGetInfoBlockHtml() ->setMethods(['setArea', 'setIsSecureMode', 'getMethod', 'setStore', 'toHtml', 'setInfo']) ->getMockForAbstractClass(); - $this->appEmulation->expects($this->once())->method('startEnvironmentEmulation')->with($storeId); + $this->appEmulation->expects($this->once()) + ->method('startEnvironmentEmulation') + ->with($storeId, \Magento\Framework\App\Area::AREA_FRONTEND, true); $infoMock->expects($this->once())->method('getMethodInstance')->willReturn($methodMock); $methodMock->expects($this->once())->method('getInfoBlockType')->willReturn($blockType); $this->layoutMock->expects($this->once())->method('createBlock') diff --git a/app/code/Magento/Payment/view/adminhtml/web/js/transparent.js b/app/code/Magento/Payment/view/adminhtml/web/js/transparent.js index 296d542f3adf..715c039b68f9 100644 --- a/app/code/Magento/Payment/view/adminhtml/web/js/transparent.js +++ b/app/code/Magento/Payment/view/adminhtml/web/js/transparent.js @@ -142,7 +142,7 @@ define([ .on('submit', function (event) { event.stopPropagation(); }); - $(tmpl).appendTo(iframe).submit(); + $(tmpl).appendTo(iframe).trigger('submit'); iframe.html(''); }, diff --git a/app/code/Magento/Payment/view/frontend/templates/transparent/iframe.phtml b/app/code/Magento/Payment/view/frontend/templates/transparent/iframe.phtml index 233d932e5f64..ac4cd87eb996 100644 --- a/app/code/Magento/Payment/view/frontend/templates/transparent/iframe.phtml +++ b/app/code/Magento/Payment/view/frontend/templates/transparent/iframe.phtml @@ -65,7 +65,7 @@ script; function($) { var parent = window.parent; $(parent).trigger('clearTimeout'); - $(parent.document).find('#multishipping-billing-form').submit(); + $(parent.document).find('#multishipping-billing-form').trigger('submit'); } ); script; diff --git a/app/code/Magento/Payment/view/frontend/web/js/transparent.js b/app/code/Magento/Payment/view/frontend/web/js/transparent.js index d5c51d2d100b..fe14c10f4f23 100644 --- a/app/code/Magento/Payment/view/frontend/web/js/transparent.js +++ b/app/code/Magento/Payment/view/frontend/web/js/transparent.js @@ -180,7 +180,7 @@ define([ inputs: data } }); - $(tmpl).appendTo($(iframeSelector)).submit(); + $(tmpl).appendTo($(iframeSelector)).trigger('submit'); }, /** diff --git a/app/code/Magento/PaymentGraphQl/README.md b/app/code/Magento/PaymentGraphQl/README.md new file mode 100644 index 000000000000..e97ac2bad081 --- /dev/null +++ b/app/code/Magento/PaymentGraphQl/README.md @@ -0,0 +1,4 @@ +# PaymentGraphQl + +**PaymentGraphQl** provides type information for the GraphQl module +to generate payment fields information endpoints. diff --git a/app/code/Magento/PaymentGraphQl/composer.json b/app/code/Magento/PaymentGraphQl/composer.json new file mode 100644 index 000000000000..18d0dba32861 --- /dev/null +++ b/app/code/Magento/PaymentGraphQl/composer.json @@ -0,0 +1,24 @@ +{ + "name": "magento/module-payment-graph-ql", + "description": "N/A", + "type": "magento2-module", + "require": { + "php": "~7.3.0||~7.4.0", + "magento/framework": "*" + }, + "suggest": { + "magento/module-store-graph-ql": "*" + }, + "license": [ + "OSL-3.0", + "AFL-3.0" + ], + "autoload": { + "files": [ + "registration.php" + ], + "psr-4": { + "Magento\\PaymentGraphQl\\": "" + } + } +} diff --git a/app/code/Magento/PaymentGraphQl/etc/graphql/di.xml b/app/code/Magento/PaymentGraphQl/etc/graphql/di.xml new file mode 100644 index 000000000000..7f67ace74e43 --- /dev/null +++ b/app/code/Magento/PaymentGraphQl/etc/graphql/di.xml @@ -0,0 +1,32 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> + <type name="Magento\StoreGraphQl\Model\Resolver\Store\StoreConfigDataProvider"> + <arguments> + <argument name="extendedConfigData" xsi:type="array"> + <item name="zero_subtotal_enabled" xsi:type="string">payment/free/active</item> + <item name="zero_subtotal_title" xsi:type="string">payment/free/title</item> + <item name="zero_subtotal_new_order_status" xsi:type="string">payment/free/order_status</item> + <item name="zero_subtotal_payment_action" xsi:type="string">payment/free/payment_action</item> + <item name="zero_subtotal_enable_for_specific_countries" xsi:type="string">payment/free/allowspecific</item> + <item name="zero_subtotal_payment_from_specific_countries" xsi:type="string">payment/free/specificcountry</item> + <item name="zero_subtotal_sort_order" xsi:type="string">payment/free/sort_order</item> + <item name="check_money_order_enabled" xsi:type="string">payment/checkmo/active</item> + <item name="check_money_order_title" xsi:type="string">payment/checkmo/title</item> + <item name="check_money_order_new_order_status" xsi:type="string">payment/checkmo/order_status</item> + <item name="check_money_order_enable_for_specific_countries" xsi:type="string">payment/checkmo/allowspecific</item> + <item name="check_money_order_payment_from_specific_countries" xsi:type="string">payment/checkmo/specificcountry</item> + <item name="check_money_order_make_check_payable_to" xsi:type="string">payment/checkmo/payable_to</item> + <item name="check_money_order_send_check_to" xsi:type="string">payment/checkmo/mailing_address</item> + <item name="check_money_order_min_order_total" xsi:type="string">payment/checkmo/min_order_total</item> + <item name="check_money_order_max_order_total" xsi:type="string">payment/checkmo/max_order_total</item> + <item name="check_money_order_sort_order" xsi:type="string">payment/checkmo/sort_order</item> + </argument> + </arguments> + </type> +</config> diff --git a/app/code/Magento/PaymentGraphQl/etc/module.xml b/app/code/Magento/PaymentGraphQl/etc/module.xml new file mode 100644 index 000000000000..b21a6d5d128c --- /dev/null +++ b/app/code/Magento/PaymentGraphQl/etc/module.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> + <module name="Magento_PaymentGraphQl"/> +</config> diff --git a/app/code/Magento/PaymentGraphQl/etc/schema.graphqls b/app/code/Magento/PaymentGraphQl/etc/schema.graphqls new file mode 100644 index 000000000000..dd5db9d193c6 --- /dev/null +++ b/app/code/Magento/PaymentGraphQl/etc/schema.graphqls @@ -0,0 +1,21 @@ +# Copyright © Magento, Inc. All rights reserved. +# See COPYING.txt for license details. +type StoreConfig { + zero_subtotal_enabled: Boolean @doc(description: "Indicates whether the Zero Subtotal payment method is enabled") + zero_subtotal_title: String @doc(description: "The title of the Zero Subtotal payment method displayed on the storefront") + zero_subtotal_new_order_status: String @doc(description: "Status of new orders placed using the Zero Subtotal payment method") + zero_subtotal_payment_action: String @doc(description: "When the new order status is 'Processing', this can be set to 'authorize_capture' to automatically invoice all items that have a zero balance") + zero_subtotal_enable_for_specific_countries: Boolean @doc(description: "Indicates whether only specific countries can use this payment method") + zero_subtotal_payment_from_specific_countries: String @doc(description: "Comma-separated list of specific countries allowed to use the Zero Subtotal payment method") + zero_subtotal_sort_order: Int @doc(description: "A number indicating the position of the Zero Subtotal payment method in the list of available payment methods during checkout") + check_money_order_enabled: Boolean @doc(description: "Indicates whether the Check/Money Order payment method is enabled") + check_money_order_title: String @doc(description: "The title of the Check/Money Order payment method displayed on the storefront") + check_money_order_new_order_status: String @doc(description: "Status of new orders placed using the Check/Money Order payment method") + check_money_order_enable_for_specific_countries: Boolean @doc(description: "Indicates whether only specific countries can use this payment method") + check_money_order_payment_from_specific_countries: String @doc(description: "Comma-separated list of specific countries allowed to use the Check/Money Order payment method") + check_money_order_make_check_payable_to: String @doc(description: "The name of the party to whom the check must be payable") + check_money_order_send_check_to: String @doc(description: "The full street address or PO Box where the checks are mailed") + check_money_order_min_order_total: String @doc(description: "Minimum order amount required to qualify for the Check/Money Order payment method") + check_money_order_max_order_total: String @doc(description: "Maximum order amount required to qualify for the Check/Money Order payment method") + check_money_order_sort_order: Int @doc(description: "A number indicating the position of the Check/Money Order payment method in the list of available payment methods during checkout") +} diff --git a/app/code/Magento/PaymentGraphQl/registration.php b/app/code/Magento/PaymentGraphQl/registration.php new file mode 100644 index 000000000000..cd2805a82e11 --- /dev/null +++ b/app/code/Magento/PaymentGraphQl/registration.php @@ -0,0 +1,10 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Framework\Component\ComponentRegistrar; + +ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_PaymentGraphQl', __DIR__); diff --git a/app/code/Magento/Paypal/Block/Bml/Banners.php b/app/code/Magento/Paypal/Block/Bml/Banners.php index 53ba4db6244b..5a0259326852 100644 --- a/app/code/Magento/Paypal/Block/Bml/Banners.php +++ b/app/code/Magento/Paypal/Block/Bml/Banners.php @@ -60,7 +60,8 @@ protected function _toHtml() $publisherId = $this->_paypalConfig->getBmlPublisherId(); $display = $this->_paypalConfig->getBmlDisplay($this->_section); $position = $this->_paypalConfig->getBmlPosition($this->_section); - if (!$publisherId || $display == 0 || $this->_position != $position) { + $payLaterActive = (bool)$this->_paypalConfig->getPayLaterConfigValue('experience_active'); + if (!$publisherId || $display == 0 || $this->_position != $position || $payLaterActive) { return ''; } $this->setData('publisher_id', $publisherId); diff --git a/app/code/Magento/Paypal/Block/PayLater/Banner.php b/app/code/Magento/Paypal/Block/PayLater/Banner.php new file mode 100644 index 000000000000..5cccfc9710d5 --- /dev/null +++ b/app/code/Magento/Paypal/Block/PayLater/Banner.php @@ -0,0 +1,135 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Paypal\Block\PayLater; + +use Magento\Framework\View\Element\Template; +use Magento\Paypal\Model\PayLaterConfig; +use Magento\Paypal\Model\SdkUrl; + +/** + * PayPal PayLater component block + * @api + */ +class Banner extends Template +{ + /** + * @var PayLaterConfig + */ + private $payLaterConfig; + + /** + * @var SdkUrl + */ + private $sdkUrl; + + /** + * @var string + */ + private $placement = ''; + + /** + * @var string + */ + private $position = ''; + + /** + * @param Template\Context $context + * @param PayLaterConfig $payLaterConfig + * @param SdkUrl $sdkUrl + * @param array $data + */ + public function __construct( + Template\Context $context, + PayLaterConfig $payLaterConfig, + SdkUrl $sdkUrl, + array $data = [] + ) { + parent::__construct($context, $data); + $this->payLaterConfig = $payLaterConfig; + $this->sdkUrl = $sdkUrl; + $this->placement = $data['placement'] ?? ''; + $this->position = $data['position'] ?? ''; + } + + /** + * Disable block output + * + * @return string + */ + protected function _toHtml(): string + { + if (!$this->isEnabled()) { + return ''; + } + return parent::_toHtml(); + } + + /** + * @inheritdoc + */ + public function getJsLayout() + { + $jsComponent = $this->jsLayout['components']['payLater']['component'] + ?? 'Magento_Paypal/js/view/paylater'; + + //Extend block component config with defaults + $componentConfig = $this->jsLayout['components']['payLater']['config'] ?? []; + $defaultConfig = ['sdkUrl' => $this->getPayPalSdkUrl()]; + $config = array_replace($defaultConfig, $componentConfig); + + //Extend block component attributes with defaults + $componentAttributes = $this->jsLayout['components']['payLater']['config']['attributes'] ?? []; + $config['attributes'] = array_replace($this->getStyleAttributesConfig(), $componentAttributes); + $config['attributes']['data-pp-placement'] = $this->placement; + + $this->jsLayout = [ + 'components' => [ + 'payLater' => [ + 'component' => $jsComponent, + 'config' => $config + ] + ] + ]; + + return parent::getJsLayout(); + } + + /** + * Build\Get URL to PP SDK + * + * @return string + */ + private function getPayPalSdkUrl(): string + { + return $this->sdkUrl->getUrl(); + } + + /** + * Retrieve style configuration + * + * @return string[] + */ + private function getStyleAttributesConfig(): array + { + return $this->payLaterConfig->getSectionConfig($this->placement, PayLaterConfig::CONFIG_KEY_STYLE); + } + + /** + * Check if block should be displayed + * + * @return bool + */ + private function isEnabled(): bool + { + $enabled = $this->payLaterConfig->isEnabled($this->placement); + return $enabled && + $this->payLaterConfig->getSectionConfig($this->placement, PayLaterConfig::CONFIG_KEY_POSITION) === + $this->position; + } +} diff --git a/app/code/Magento/Paypal/Block/PayLater/LayoutProcessor.php b/app/code/Magento/Paypal/Block/PayLater/LayoutProcessor.php new file mode 100644 index 000000000000..33d0ae97a871 --- /dev/null +++ b/app/code/Magento/Paypal/Block/PayLater/LayoutProcessor.php @@ -0,0 +1,90 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Paypal\Block\PayLater; + +use Magento\Checkout\Block\Checkout\LayoutProcessorInterface; +use Magento\Paypal\Model\PayLaterConfig; +use Magento\Paypal\Model\SdkUrl; + +/** + * PayLater Layout Processor + */ +class LayoutProcessor implements LayoutProcessorInterface +{ + /** + * Checkout payment page placement + */ + private const PLACEMENT = 'payment'; + + /** + * @var PayLaterConfig + */ + private $payLaterConfig; + + /** + * @var SdkUrl + */ + private $sdkUrl; + + /** + * @param PayLaterConfig $payLaterConfig + * @param SdkUrl $sdkUrl + */ + public function __construct(PayLaterConfig $payLaterConfig, SdkUrl $sdkUrl) + { + $this->payLaterConfig = $payLaterConfig; + $this->sdkUrl = $sdkUrl; + } + + /** + * {@inheritdoc} + */ + public function process($jsLayout) + { + if (!$this->payLaterConfig->isEnabled(PayLaterConfig::CHECKOUT_PAYMENT_PLACEMENT)) { + unset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step'] + ['children']['payment']['children']['payments-list']['children']['before-place-order']['children'] + ['paylater-place-order']); + + return $jsLayout; + } + + if (isset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step'] + ['children']['payment']['children']['payments-list']['children']['before-place-order']['children'] + ['paylater-place-order']) + ) { + $payLaterPlaceOrder = &$jsLayout['components']['checkout']['children']['steps']['children']['billing-step'] + ['children']['payment']['children']['payments-list']['children']['before-place-order']['children'] + ['paylater-place-order']; + + $componentConfig = $payLaterPlaceOrder['config'] ?? []; + $defaultConfig = [ + 'sdkUrl' => $this->sdkUrl->getUrl(), + 'displayAmount' => true, + 'amountComponentConfig' => [ + 'component' => 'Magento_Paypal/js/view/amountProviders/checkout' + ] + ]; + $config = array_replace($defaultConfig, $componentConfig); + + $attributes = $this->payLaterConfig->getSectionConfig( + PayLaterConfig::CHECKOUT_PAYMENT_PLACEMENT, + PayLaterConfig::CONFIG_KEY_STYLE + ); + $attributes['data-pp-placement'] = self::PLACEMENT; + + $componentAttributes = $payLaterPlaceOrder['config']['attributes'] ?? []; + $config['attributes'] = array_replace($attributes, $componentAttributes); + + $payLaterPlaceOrder['config'] = $config; + } + + return $jsLayout; + } +} diff --git a/app/code/Magento/Paypal/Controller/Express/GetTokenData.php b/app/code/Magento/Paypal/Controller/Express/GetTokenData.php index 5c41e753e8a9..4a799a91a4f3 100644 --- a/app/code/Magento/Paypal/Controller/Express/GetTokenData.php +++ b/app/code/Magento/Paypal/Controller/Express/GetTokenData.php @@ -7,6 +7,7 @@ namespace Magento\Paypal\Controller\Express; +use Magento\Authorization\Model\UserContextInterface; use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface; use Magento\Framework\Controller\ResultFactory; use Magento\Framework\Controller\ResultInterface; @@ -73,6 +74,11 @@ class GetTokenData extends AbstractExpress implements HttpGetActionInterface */ private $guestCartRepository; + /** + * @var UserContextInterface + */ + private $userContext; + /** * @param Context $context * @param CustomerSession $customerSession @@ -86,6 +92,7 @@ class GetTokenData extends AbstractExpress implements HttpGetActionInterface * @param CustomerRepository $customerRepository * @param CartRepositoryInterface $cartRepository * @param GuestCartRepositoryInterface $guestCartRepository + * @param UserContextInterface $userContext * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -100,7 +107,8 @@ public function __construct( LoggerInterface $logger, CustomerRepository $customerRepository, CartRepositoryInterface $cartRepository, - GuestCartRepositoryInterface $guestCartRepository + GuestCartRepositoryInterface $guestCartRepository, + UserContextInterface $userContext ) { parent::__construct( $context, @@ -117,6 +125,7 @@ public function __construct( $this->customerRepository = $customerRepository; $this->cartRepository = $cartRepository; $this->guestCartRepository = $guestCartRepository; + $this->userContext = $userContext; } /** @@ -160,23 +169,33 @@ public function execute(): ResultInterface } /** - * Get paypal token + * Prepare quote specified for checkout. * - * @return string|null + * @return \Magento\Quote\Api\Data\CartInterface * @throws LocalizedException */ - private function getToken(): ?string + private function prepareQuote() { $quoteId = $this->getRequest()->getParam('quote_id'); - $customerId = $this->getRequest()->getParam('customer_id') ?: $this->_customerSession->getId(); - $hasButton = (bool)$this->getRequest()->getParam(Checkout::PAYMENT_INFO_BUTTON); - if ($quoteId) { - $quote = $customerId ? $this->cartRepository->get($quoteId) : $this->guestCartRepository->get($quoteId); - } else { - $quote = $this->_getQuote(); + $quote = $this->userContext->getUserId() + ? $this->cartRepository->get($quoteId) + : $this->guestCartRepository->get($quoteId); + if ((int)$quote->getCustomer()->getId() === (int)$this->userContext->getUserId()) { + return $quote; + } } - + return $this->_getQuote(); + } + /** + * Get paypal token + * + * @return string|null + * @throws LocalizedException + */ + private function getToken(): ?string + { + $quote = $this->prepareQuote(); $this->_initCheckout($quote); if ($quote->getIsMultiShipping()) { @@ -184,8 +203,8 @@ private function getToken(): ?string $quote->removeAllAddresses(); } - if ($customerId) { - $customerData = $this->customerRepository->getById((int)$customerId); + if ($this->userContext->getUserType() === UserContextInterface::USER_TYPE_CUSTOMER) { + $customerData = $this->customerRepository->getById((int)$this->userContext->getUserId()); $this->_checkout->setCustomerWithAddressChange( $customerData, @@ -200,6 +219,7 @@ private function getToken(): ?string $this->_url->getUrl('paypal/express/cancel'), $this->_url->getUrl('checkout/onepage/success') ); + $hasButton = (bool)$this->getRequest()->getParam(Checkout::PAYMENT_INFO_BUTTON); return $this->_checkout->start( $this->_url->getUrl('*/*/return'), diff --git a/app/code/Magento/Paypal/Controller/Payflow/ReturnUrl.php b/app/code/Magento/Paypal/Controller/Payflow/ReturnUrl.php index d2a14febe54d..5a32269b1b79 100644 --- a/app/code/Magento/Paypal/Controller/Payflow/ReturnUrl.php +++ b/app/code/Magento/Paypal/Controller/Payflow/ReturnUrl.php @@ -18,6 +18,10 @@ */ class ReturnUrl extends Payflow implements CsrfAwareActionInterface, HttpGetActionInterface { + private const ORDER_INCREMENT_ID = 'INVNUM'; + + private const SILENT_POST_HASH = 'secure_silent_post_hash'; + /** * @var array of allowed order states on frontend */ @@ -63,23 +67,18 @@ public function execute() $this->_view->loadLayout(false); /** @var \Magento\Checkout\Block\Onepage\Success $redirectBlock */ $redirectBlock = $this->_view->getLayout()->getBlock($this->_redirectBlockName); - - if ($this->_checkoutSession->getLastRealOrderId()) { - /** @var \Magento\Sales\Model\Order $order */ - $order = $this->_orderFactory->create()->loadByIncrementId($this->_checkoutSession->getLastRealOrderId()); - - if ($order->getIncrementId()) { - if ($this->checkOrderState($order)) { - $redirectBlock->setData('goto_success_page', true); + $order = $this->getOrderFromRequest(); + if ($order) { + if ($this->checkOrderState($order)) { + $redirectBlock->setData('goto_success_page', true); + } else { + if ($this->checkPaymentMethod($order)) { + $gotoSection = $this->_cancelPayment((string)$this->getRequest()->getParam('RESPMSG')); + $redirectBlock->setData('goto_section', $gotoSection); + $redirectBlock->setData('error_msg', __('Your payment has been declined. Please try again.')); } else { - if ($this->checkPaymentMethod($order)) { - $gotoSection = $this->_cancelPayment((string)$this->getRequest()->getParam('RESPMSG')); - $redirectBlock->setData('goto_section', $gotoSection); - $redirectBlock->setData('error_msg', __('Your payment has been declined. Please try again.')); - } else { - $redirectBlock->setData('goto_section', false); - $redirectBlock->setData('error_msg', __('Requested payment method does not match with order.')); - } + $redirectBlock->setData('goto_section', false); + $redirectBlock->setData('error_msg', __('Requested payment method does not match with order.')); } } } @@ -87,6 +86,29 @@ public function execute() $this->_view->renderLayout(); } + /** + * Returns an order from request. + * + * @return Order|null + */ + private function getOrderFromRequest(): ?Order + { + $orderId = $this->getRequest()->getParam(self::ORDER_INCREMENT_ID); + if (!$orderId) { + return null; + } + + $order = $this->_orderFactory->create()->loadByIncrementId($orderId); + $storedHash = (string)$order->getPayment()->getAdditionalInformation(self::SILENT_POST_HASH); + $requestHash = (string)$this->getRequest()->getParam('USER2'); + if (empty($storedHash) || empty($requestHash) || !hash_equals($storedHash, $requestHash)) { + return null; + } + $this->_checkoutSession->setLastRealOrderId($orderId); + + return $order; + } + /** * Check order state * diff --git a/app/code/Magento/Paypal/Controller/Transparent/Response.php b/app/code/Magento/Paypal/Controller/Transparent/Response.php index 05d11cedd03a..efb38cd625c4 100644 --- a/app/code/Magento/Paypal/Controller/Transparent/Response.php +++ b/app/code/Magento/Paypal/Controller/Transparent/Response.php @@ -18,7 +18,7 @@ use Magento\Paypal\Model\Payflow\Service\Response\Validator\ResponseValidator; use Magento\Paypal\Model\Payflow\Transparent; use Magento\Sales\Api\PaymentFailuresInterface; -use Magento\Framework\Session\Generic as Session; +use Magento\Checkout\Model\Session; use Magento\Framework\App\Action\HttpPostActionInterface; /** diff --git a/app/code/Magento/Paypal/Model/AbstractConfig.php b/app/code/Magento/Paypal/Model/AbstractConfig.php index c8ad56f242a6..608095f51eaa 100644 --- a/app/code/Magento/Paypal/Model/AbstractConfig.php +++ b/app/code/Magento/Paypal/Model/AbstractConfig.php @@ -292,20 +292,33 @@ public function isMethodActive($method) break; case Config::METHOD_WPS_BML: case Config::METHOD_WPP_BML: - $disabledFunding = $this->_scopeConfig->getValue( - 'paypal/style/disable_funding_options', - ScopeInterface::SCOPE_STORE, - $this->_storeId - ); - $isExpressCreditEnabled = $disabledFunding - ? strpos($disabledFunding, 'CREDIT') === false - : true; - $isEnabled = $isExpressCreditEnabled - || $this->_scopeConfig->isSetFlag( - 'payment/' . Config::METHOD_WPP_BML .'/active', + $isWpsEnabled = $this->_scopeConfig->isSetFlag( + 'payment/' . Config::METHOD_WPS_EXPRESS .'/active', ScopeInterface::SCOPE_STORE, $this->_storeId ); + if ($isWpsEnabled) { + $isEnabled = $this->_scopeConfig->isSetFlag( + 'payment/' . Config::METHOD_WPS_BML .'/active', + ScopeInterface::SCOPE_STORE, + $this->_storeId + ); + } else { + $disabledFunding = $this->_scopeConfig->getValue( + 'paypal/style/disable_funding_options', + ScopeInterface::SCOPE_STORE, + $this->_storeId + ); + $isExpressCreditEnabled = $disabledFunding + ? strpos($disabledFunding, 'CREDIT') === false + : true; + $isEnabled = $isExpressCreditEnabled + || $this->_scopeConfig->isSetFlag( + 'payment/' . Config::METHOD_WPP_BML .'/active', + ScopeInterface::SCOPE_STORE, + $this->_storeId + ); + } $method = Config::METHOD_WPP_BML; break; case Config::METHOD_PAYMENT_PRO: diff --git a/app/code/Magento/Paypal/Model/Config.php b/app/code/Magento/Paypal/Model/Config.php index c790a4524f18..d08c7db4f3db 100644 --- a/app/code/Magento/Paypal/Model/Config.php +++ b/app/code/Magento/Paypal/Model/Config.php @@ -174,6 +174,11 @@ class Config extends AbstractConfig */ const XML_PATH_PAYPAL_EXPRESS_SKIP_ORDER_REVIEW_STEP_FLAG = 'payment/paypal_express/skip_order_review_step'; + /** + * PayPal PayLater + */ + const PAYLATER = 'paypal_paylater'; + /** * Instructions for generating proper BN code * @@ -1828,4 +1833,19 @@ public function getBmlSize($section) $this->_storeId ); } + + /** + * Get PayLater config values + * + * @param string $fieldName + * @return mixed + */ + public function getPayLaterConfigValue($fieldName) + { + return $this->_scopeConfig->getValue( + 'payment/' . self::PAYLATER . '/' . $fieldName, + \Magento\Store\Model\ScopeInterface::SCOPE_STORE, + $this->_storeId + ); + } } diff --git a/app/code/Magento/Paypal/Model/Express/Checkout.php b/app/code/Magento/Paypal/Model/Express/Checkout.php index 389f20c757ae..5099f0ccb35f 100644 --- a/app/code/Magento/Paypal/Model/Express/Checkout.php +++ b/app/code/Magento/Paypal/Model/Express/Checkout.php @@ -1155,8 +1155,18 @@ private function setShippingOptions(PaypalCart $cart, Address $address = null) protected function prepareGuestQuote() { $quote = $this->_quote; + $billingAddress = $quote->getBillingAddress(); + + /* Check if Guest customer provided an email address on checkout page, and in case + it was provided, use it as priority, if not, use email address returned from PayPal. + (Guest customer can place order two ways: - from checkout page, where guest is asked to provide + an email address that later can be used for account creation; - from mini shopping cart, directly + proceeding to PayPal without providing an email address */ + $email = $billingAddress->getOrigData('email') !== null + ? $billingAddress->getOrigData('email') : $billingAddress->getEmail(); + $quote->setCustomerId(null) - ->setCustomerEmail($quote->getBillingAddress()->getEmail()) + ->setCustomerEmail($email) ->setCustomerIsGuest(true) ->setCustomerGroupId(\Magento\Customer\Model\Group::NOT_LOGGED_IN_ID); return $this; diff --git a/app/code/Magento/Paypal/Model/PayLaterConfig.php b/app/code/Magento/Paypal/Model/PayLaterConfig.php new file mode 100644 index 000000000000..463af73128b9 --- /dev/null +++ b/app/code/Magento/Paypal/Model/PayLaterConfig.php @@ -0,0 +1,137 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Paypal\Model; + +use Magento\Framework\App\Config\ScopeConfigInterface; + +/** + * Provides configuration values for PayPal PayLater Banners + */ +class PayLaterConfig +{ + /** + * Configuration key for Styles settings + */ + const CONFIG_KEY_STYLE = 'style'; + + /** + * Configuration key for Position setting + */ + const CONFIG_KEY_POSITION = 'position'; + + /** + * Checkout payment step placement + */ + const CHECKOUT_PAYMENT_PLACEMENT = 'checkout_payment'; + + /** + * @var Config + */ + private $config; + + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * @var array + */ + private $configData = []; + + /** + * @param ScopeConfigInterface $scopeConfig + * @param ConfigFactory $configFactory + */ + public function __construct( + ScopeConfigInterface $scopeConfig, + ConfigFactory $configFactory + ) { + $this->scopeConfig = $scopeConfig; + $this->config = $configFactory->create(); + } + + /** + * Check if Banner enabled for specified page + * + * @param string $placement + * @return bool + */ + public function isEnabled(string $placement): bool + { + $enabled = false; + if ($this->isPPCreditEnabled()) { + $payLaterActive = (boolean)$this->config->getPayLaterConfigValue('experience_active'); + $isPayLaterEnabled = (boolean)$this->config->getPayLaterConfigValue('enabled'); + $enabled = $payLaterActive && $isPayLaterEnabled && $this->getSectionConfig($placement, 'display'); + } + return $enabled; + } + + /** + * Check that PayPal Credit enabled with any PayPal express method + * + * @return + */ + private function isPPCreditEnabled() + { + $isEnabled = false; + if ($this->config->setMethod(Config::METHOD_EXPRESS)->getValue('in_context')) { + $disabledFunding = $this->config->getValue('disable_funding_options'); + $isEnabled = $disabledFunding ? strpos($disabledFunding, 'CREDIT') === false : true; + } + + return $isEnabled || $this->config->isMethodAvailable(Config::METHOD_WPP_BML) + || $this->config->isMethodAvailable(Config::METHOD_WPP_PE_BML); + } + + /** + * Get config for a specific section and key + * + * @param string $section + * @param string $key + * @return array|string|int + */ + public function getSectionConfig(string $section, string $key) + { + if (!array_key_exists($section, $this->configData)) { + $sectionName = $section === self::CHECKOUT_PAYMENT_PLACEMENT + ? self::CHECKOUT_PAYMENT_PLACEMENT : "${section}page"; + + $this->configData[$section] = [ + 'display' => (boolean)$this->config->getPayLaterConfigValue("${sectionName}_display"), + 'position' => $this->config->getPayLaterConfigValue("${sectionName}_position"), + 'style' => [ + 'data-pp-style-layout' => $this->config->getPayLaterConfigValue( + "${sectionName}_stylelayout" + ), + 'data-pp-style-logo-type' => $this->config->getPayLaterConfigValue( + "${sectionName}_logotype" + ), + 'data-pp-style-logo-position' => $this->config->getPayLaterConfigValue( + "${sectionName}_logoposition" + ), + 'data-pp-style-text-color' => $this->config->getPayLaterConfigValue( + "${sectionName}_textcolor" + ), + 'data-pp-style-text-size' => $this->config->getPayLaterConfigValue( + "${sectionName}_textsize" + ), + 'data-pp-style-color' => $this->config->getPayLaterConfigValue( + "${sectionName}_color" + ), + 'data-pp-style-ratio' => $this->config->getPayLaterConfigValue( + "${sectionName}_ratio" + ) + ] + ]; + } + + return $this->configData[$section][$key]; + } +} diff --git a/app/code/Magento/Paypal/Model/Payflow/Transparent.php b/app/code/Magento/Paypal/Model/Payflow/Transparent.php index 87cb0df7b0d7..19e2886a9f70 100644 --- a/app/code/Magento/Paypal/Model/Payflow/Transparent.php +++ b/app/code/Magento/Paypal/Model/Payflow/Transparent.php @@ -331,11 +331,9 @@ public function capture(InfoInterface $payment, $amount) $zeroAmountAuthorizationId = $this->getZeroAmountAuthorizationId($payment); /** @var PaymentTokenInterface $vaultPaymentToken */ $vaultPaymentToken = $payment->getExtensionAttributes()->getVaultPaymentToken(); - if ($vaultPaymentToken && empty($zeroAmountAuthorizationId)) { + if ($vaultPaymentToken && empty($zeroAmountAuthorizationId) && empty($payment->getParentTransactionId())) { $payment->setAdditionalInformation(self::PNREF, $vaultPaymentToken->getGatewayToken()); - if (!$payment->getParentTransactionId()) { - $payment->setParentTransactionId($vaultPaymentToken->getGatewayToken()); - } + $payment->setParentTransactionId($vaultPaymentToken->getGatewayToken()); } parent::capture($payment, $amount); diff --git a/app/code/Magento/Paypal/Model/SdkUrl.php b/app/code/Magento/Paypal/Model/SdkUrl.php new file mode 100644 index 000000000000..e10f4ce2e886 --- /dev/null +++ b/app/code/Magento/Paypal/Model/SdkUrl.php @@ -0,0 +1,226 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Paypal\Model; + +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\Locale\ResolverInterface; +use Magento\Store\Model\StoreManagerInterface; + +/** + * Provides URL to PP SDK based on configuration + */ +class SdkUrl +{ + /** + * Base url for Paypal SDK + */ + private const BASE_URL = 'https://www.paypal.com/sdk/js?'; + + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * @var Config + */ + private $config; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @var array + */ + private $queryParams = []; + + /** + * Maps the old checkout SDK configuration values to the current ones + * + * @var array + */ + private $disallowedFundingMap; + + /** + * These payment methods will be added as parameters to the SDK url to disable them. + * + * @var array + */ + private $unsupportedPaymentMethods; + + /** + * @var ResolverInterface + */ + private $localeResolver; + + /** + * Generated Url to PayPAl SDK + * + * @var string + */ + private $url; + + /** + * @param ResolverInterface $localeResolver + * @param ConfigFactory $configFactory + * @param ScopeConfigInterface $scopeConfig + * @param StoreManagerInterface $storeManager + * @param array $disallowedFundingMap + * @param array $unsupportedPaymentMethods + */ + public function __construct( + ResolverInterface $localeResolver, + ConfigFactory $configFactory, + ScopeConfigInterface $scopeConfig, + StoreManagerInterface $storeManager, + $disallowedFundingMap = [], + $unsupportedPaymentMethods = [] + ) { + $this->localeResolver = $localeResolver; + $this->config = $configFactory->create(); + $this->config->setMethod(Config::METHOD_EXPRESS); + $this->scopeConfig = $scopeConfig; + $this->storeManager = $storeManager; + $this->disallowedFundingMap = $disallowedFundingMap; + $this->unsupportedPaymentMethods = $unsupportedPaymentMethods; + } + + /** + * Generate the url to download the Paypal SDK + * + * @return string + */ + public function getUrl(): string + { + if (empty($this->url)) { + $components = []; + $params = [ + 'client-id' => $this->getClientId(), + 'locale' => $this->localeResolver->getLocale(), + 'currency' => $this->storeManager->getStore()->getBaseCurrencyCode(), + ]; + + if ($this->areMessagesEnabled()) { + $components[] = 'messages'; + } + if ($this->areButtonsEnabled()) { + $components[] = 'buttons'; + $params['commit'] = 'false'; + $params['intent'] = $this->getIntent(); + $params['merchant-id'] = $this->config->getValue('merchant_id'); + $params['disable-funding'] = $this->getDisallowedFunding(); + $params = array_replace($params, $this->queryParams); + } + $params['components'] = implode(',', $components); + $this->url = self::BASE_URL . http_build_query(array_filter($params)); + } + return $this->url; + } + + /** + * Set query params in PayPal SDK Url + * + * @param string $key + * @param string $value + */ + public function setQueryParam(string $key, string $value) + { + $allowedParams = ['commit']; + if (in_array($key, $allowedParams)) { + $this->queryParams[$key] = $value; + } + } + + /** + * Check if PP PayLater Messages enabled + * + * @return bool + */ + private function areMessagesEnabled() + { + //ToDo read from config + return true; + } + + /** + * Check if SmartButtons enabled + * + * @return bool + */ + private function areButtonsEnabled() + { + return (bool)(int) $this->config->getValue('in_context'); + } + + /** + * Get configured value for PayPal client id + * + * @return mixed + */ + private function getClientId() + { + return (int)$this->config->getValue('sandbox_flag') ? + $this->config->getValue('sandbox_client_id') : + $this->config->getValue('client_id'); + } + + /** + * Returns disallowed funding from configuration after updating values + * + * @return string + */ + private function getDisallowedFunding() + { + $disallowedFunding = $this->config->getValue('disable_funding_options'); + $result = $disallowedFunding ? explode(',', $disallowedFunding) : []; + + // PayPal Guest Checkout Credit Card Icons only available when Guest Checkout option is enabled + if ($this->isPaypalGuestCheckoutAllowed() === false && !in_array('CARD', $result)) { + array_push($result, 'CARD'); + } + + // Map old configuration values to current ones + $result = array_map(function ($oldValue) { + return $this->disallowedFundingMap[$oldValue] ?? $oldValue; + }, $result); + + //disable unsupported payment methods + $result = array_combine($result, $result); + $result = array_merge($result, $this->unsupportedPaymentMethods); + + return implode(',', $result); + } + + /** + * Returns if is allowed PayPal Guest Checkout. + * + * @return bool + */ + private function isPaypalGuestCheckoutAllowed(): bool + { + return $this->config->getValue('solution_type') === Config::EC_SOLUTION_TYPE_SOLE; + } + + /** + * Return intent value from the configuration payment_action value + * + * @return string + */ + private function getIntent(): string + { + $paymentAction = $this->config->getValue('paymentAction'); + $mappedIntentValues = [ + Config::PAYMENT_ACTION_AUTH => 'authorize', + Config::PAYMENT_ACTION_SALE => 'capture', + Config::PAYMENT_ACTION_ORDER => 'order' + ]; + return $mappedIntentValues[$paymentAction]; + } +} diff --git a/app/code/Magento/Paypal/Model/SmartButtonConfig.php b/app/code/Magento/Paypal/Model/SmartButtonConfig.php index 8adff75df205..830d51e0221e 100644 --- a/app/code/Magento/Paypal/Model/SmartButtonConfig.php +++ b/app/code/Magento/Paypal/Model/SmartButtonConfig.php @@ -24,7 +24,7 @@ class SmartButtonConfig private $localeResolver; /** - * @var ConfigFactory + * @var Config */ private $config; @@ -39,53 +39,30 @@ class SmartButtonConfig private $scopeConfig; /** - * Maps the old checkout SDK configuration values to the current ones - * @var array - */ - private $disallowedFundingMap; - - /** - * These payment methods will be added as parameters to the SDK url to disable them. - * @var array - */ - private $unsupportedPaymentMethods; - - /** - * @var StoreManagerInterface - */ - private $storeManager; - - /** - * Base url for Paypal SDK + * @var SdkUrl */ - private const BASE_URL = 'https://www.paypal.com/sdk/js?'; + private $sdkUrl; /** * @param ResolverInterface $localeResolver * @param ConfigFactory $configFactory * @param ScopeConfigInterface $scopeConfig - * @param StoreManagerInterface $storeManager + * @param SdkUrl $sdkUrl * @param array $defaultStyles - * @param array $disallowedFundingMap - * @param array $unsupportedPaymentMethods */ public function __construct( ResolverInterface $localeResolver, ConfigFactory $configFactory, ScopeConfigInterface $scopeConfig, - StoreManagerInterface $storeManager, - $defaultStyles = [], - $disallowedFundingMap = [], - $unsupportedPaymentMethods = [] + SdkUrl $sdkUrl, + $defaultStyles = [] ) { $this->localeResolver = $localeResolver; $this->config = $configFactory->create(); $this->config->setMethod(Config::METHOD_EXPRESS); $this->scopeConfig = $scopeConfig; - $this->storeManager = $storeManager; $this->defaultStyles = $defaultStyles; - $this->disallowedFundingMap = $disallowedFundingMap; - $this->unsupportedPaymentMethods = $unsupportedPaymentMethods; + $this->sdkUrl = $sdkUrl; } /** @@ -100,90 +77,14 @@ public function getConfig(string $page): array Data::XML_PATH_GUEST_CHECKOUT, ScopeInterface::SCOPE_STORE ); - return [ 'styles' => $this->getButtonStyles($page), 'isVisibleOnProductPage' => (bool)$this->config->getValue('visible_on_product'), 'isGuestCheckoutAllowed' => $isGuestCheckoutAllowed, - 'sdkUrl' => $this->generatePaypalSdkUrl($page) + 'sdkUrl' => $this->sdkUrl->getUrl() ]; } - /** - * Generate the url to download the Paypal SDK - * - * @param string $page - * - * @return string - */ - private function generatePaypalSdkUrl(string $page): string - { - $clientId = (int)$this->config->getValue('sandbox_flag') ? - $this->config->getValue('sandbox_client_id') : $this->config->getValue('client_id'); - $disallowedFunding = implode(',', $this->getDisallowedFunding()); - - $commit = $page === 'checkout' ? 'true' : 'false'; - - $params = - [ - 'client-id' => $clientId, - 'commit' => $commit, - 'merchant-id' => $this->config->getValue('merchant_id'), - 'locale' => $this->localeResolver->getLocale(), - 'intent' => $this->getIntent(), - 'currency' => $this->storeManager->getStore()->getBaseCurrencyCode(), - ]; - if ($disallowedFunding) { - $params['disable-funding'] = $disallowedFunding; - } - - return self::BASE_URL . http_build_query($params); - } - - /** - * Return intent value from the configuration payment_action value - * - * @return string - */ - private function getIntent(): string - { - $paymentAction = $this->config->getValue('paymentAction'); - $mappedIntentValues = [ - Config::PAYMENT_ACTION_AUTH => 'authorize', - Config::PAYMENT_ACTION_SALE => 'capture', - Config::PAYMENT_ACTION_ORDER => 'order' - ]; - return $mappedIntentValues[$paymentAction]; - } - - /** - * Returns disallowed funding from configuration after updating values - * - * @return array - */ - private function getDisallowedFunding(): array - { - $disallowedFunding = $this->config->getValue('disable_funding_options'); - $result = $disallowedFunding ? explode(',', $disallowedFunding) : []; - - // PayPal Guest Checkout Credit Card Icons only available when Guest Checkout option is enabled - if ($this->isPaypalGuestCheckoutAllowed() === false && !in_array('CARD', $result)) { - array_push($result, 'CARD'); - } - - // Map old configuration values to current ones - $result = array_map(function ($oldValue) { - return $this->disallowedFundingMap[$oldValue] ?? $oldValue; - }, - $result); - - //disable unsupported payment methods - $result = array_combine($result, $result); - $result = array_merge($result, $this->unsupportedPaymentMethods); - - return $result; - } - /** * Returns button styles based on configuration * @@ -242,14 +143,4 @@ private function updateStyles(array $styles, string $page): array return $styles; } - - /** - * Returns if is allowed PayPal Guest Checkout. - * - * @return bool - */ - private function isPaypalGuestCheckoutAllowed(): bool - { - return $this->config->getValue('solution_type') === Config::EC_SOLUTION_TYPE_SOLE; - } } diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/Color.php b/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/Color.php new file mode 100644 index 000000000000..397c5c537692 --- /dev/null +++ b/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/Color.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Paypal\Model\System\Config\Source\PayLater; + +use Magento\Framework\Data\OptionSourceInterface; + +/** + * Source model for PayLater flex banner color + */ +class Color implements OptionSourceInterface +{ + /** + * PayLater colors source + * + * @return array + */ + public function toOptionArray(): array + { + return [ + ['value' => 'blue', 'label' => __('Blue')], + ['value' => 'black', 'label' => __('Black')], + ['value' => 'white', 'label' => __('White')], + ['value' => 'white-no-border', 'label' => __('White No Border')], + ['value' => 'gray', 'label' => __('Gray')], + ['value' => 'monochrome', 'label' => __('Monochrome')], + ['value' => 'grayscale', 'label' => __('Grayscale')] + ]; + } +} diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/LogoPosition.php b/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/LogoPosition.php new file mode 100644 index 000000000000..51d12daac8f4 --- /dev/null +++ b/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/LogoPosition.php @@ -0,0 +1,30 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Paypal\Model\System\Config\Source\PayLater; + +use Magento\Framework\Data\OptionSourceInterface; + +/** + * Source model for PayLater banner logo position + */ +class LogoPosition implements OptionSourceInterface +{ + /** + * PayLater logo positions source + * + * @return array + */ + public function toOptionArray(): array + { + return [ + ['value' => 'left', 'label' => __('Left')], + ['value' => 'right', 'label' => __('Right')], + ['value' => 'top', 'label' => __('Top')] + ]; + } +} diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/LogoType.php b/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/LogoType.php new file mode 100644 index 000000000000..daf8eb9e8880 --- /dev/null +++ b/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/LogoType.php @@ -0,0 +1,31 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Paypal\Model\System\Config\Source\PayLater; + +use Magento\Framework\Data\OptionSourceInterface; + +/** + * Source model for PayLater banner logo type + */ +class LogoType implements OptionSourceInterface +{ + /** + * PayLater logo types source + * + * @return array + */ + public function toOptionArray(): array + { + return [ + ['value' => 'primary', 'label' => __('Primary')], + ['value' => 'alternative', 'label' => __('Alternative')], + ['value' => 'inline', 'label' => __('Inline')], + ['value' => 'none', 'label' => __('None')] + ]; + } +} diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/Position.php b/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/Position.php new file mode 100644 index 000000000000..af86fd2bcf03 --- /dev/null +++ b/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/Position.php @@ -0,0 +1,78 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Paypal\Model\System\Config\Source\PayLater; + +/** + * Source model for PayLater banner position + */ +class Position +{ + /** + * PayLater positions source getter for Catalog Product Page + * + * @return array + */ + public function getPositionsCPP(): array + { + return [ + 'header' => __('Header (center)'), + 'near_pp_button' => __('Near PayPal Credit checkout button') + ]; + } + + /** + * PayLater positions source getter for Home Page + * + * @return array + */ + public function getPositionsHP(): array + { + return [ + 'header' => __('Header (center)'), + 'sidebar' => __('Sidebar') + ]; + } + + /** + * PayLater positions source getter for Checkout Page + * + * @return array + */ + public function getPositionsCheckout(): array + { + return [ + 'near_pp_button' => __('Near PayPal Credit checkout button') + ]; + } + + /** + * PayLater positions source getter for Catalog Category Page + * + * @return array + */ + public function getPositionsCategoryPage(): array + { + return [ + 'header' => __('Header (center)'), + 'sidebar' => __('Sidebar'), + ]; + } + + /** + * PayLater positions source getter for Checkout Cart Page + * + * @return array + */ + public function getPositionsCart(): array + { + return [ + 'header' => __('Header (center)'), + 'near_pp_button' => __('Near PayPal Credit checkout button') + ]; + } +} diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/Ratio.php b/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/Ratio.php new file mode 100644 index 000000000000..d54b3a4ab7f8 --- /dev/null +++ b/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/Ratio.php @@ -0,0 +1,31 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Paypal\Model\System\Config\Source\PayLater; + +use Magento\Framework\Data\OptionSourceInterface; + +/** + * Source model for PayLater banner ratio + */ +class Ratio implements OptionSourceInterface +{ + /** + * PayLater ratios source + * + * @return array + */ + public function toOptionArray(): array + { + return [ + ['value' => '1x1', 'label' => '1x1'], + ['value' => '1x4', 'label' => '1x4'], + ['value' => '8x1', 'label' => '8x1'], + ['value' => '20x1', 'label' => '20x1'] + ]; + } +} diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/StyleLayout.php b/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/StyleLayout.php new file mode 100644 index 000000000000..bf76b08e0e8b --- /dev/null +++ b/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/StyleLayout.php @@ -0,0 +1,29 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Paypal\Model\System\Config\Source\PayLater; + +use Magento\Framework\Data\OptionSourceInterface; + +/** + * Source model for PayLater banner style layout + */ +class StyleLayout implements OptionSourceInterface +{ + /** + * PayLater style layouts source + * + * @return array + */ + public function toOptionArray(): array + { + return [ + ['value' => 'text', 'label' => __('Text')], + ['value' => 'flex', 'label' => __('Flex')] + ]; + } +} diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/TextColor.php b/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/TextColor.php new file mode 100644 index 000000000000..6bcb98f84684 --- /dev/null +++ b/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/TextColor.php @@ -0,0 +1,31 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Paypal\Model\System\Config\Source\PayLater; + +use Magento\Framework\Data\OptionSourceInterface; + +/** + * Source model for PayLater banner text color + */ +class TextColor implements OptionSourceInterface +{ + /** + * PayLater text colors source + * + * @return array + */ + public function toOptionArray(): array + { + return [ + ['value' => 'black', 'label' => __('Black')], + ['value' => 'white', 'label' => __('White')], + ['value' => 'monochrome', 'label' => __('Monochrome')], + ['value' => 'grayscale', 'label' => __('Grayscale')] + ]; + } +} diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/TextSize.php b/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/TextSize.php new file mode 100644 index 000000000000..f3d42fff24ca --- /dev/null +++ b/app/code/Magento/Paypal/Model/System/Config/Source/PayLater/TextSize.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Paypal\Model\System\Config\Source\PayLater; + +use Magento\Framework\Data\OptionSourceInterface; + +/** + * Source model for PayLater banner text size + */ +class TextSize implements OptionSourceInterface +{ + /** + * PayLater text sizes source + * + * @return array + */ + public function toOptionArray(): array + { + return [ + ['value' => '10', 'label' => '10px'], + ['value' => '11', 'label' => '11px'], + ['value' => '12', 'label' => '12px'], + ['value' => '13', 'label' => '13px'], + ['value' => '14', 'label' => '14px'], + ['value' => '15', 'label' => '15px'], + ['value' => '16', 'label' => '16px'] + ]; + } +} diff --git a/app/code/Magento/Paypal/Plugin/CheckoutIndex.php b/app/code/Magento/Paypal/Plugin/CheckoutIndex.php new file mode 100644 index 000000000000..ffb121462dd4 --- /dev/null +++ b/app/code/Magento/Paypal/Plugin/CheckoutIndex.php @@ -0,0 +1,60 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Paypal\Plugin; + +use Magento\Checkout\Controller\Index\Index; +use Magento\Paypal\Model\Config; +use Magento\Paypal\Model\ConfigFactory; +use Magento\Paypal\Model\SdkUrl; + +/** + * Modify query params in PayPal SDK Url to enable PayNow experience + * See https://developer.paypal.com/docs/checkout/integration-features/confirmation-page/ + */ +class CheckoutIndex +{ + /** + * @var SdkUrl + */ + private $sdkUrl; + + /** + * @var Config + */ + private $configFactory; + + /** + * @param SdkUrl $sdkUrl + * @param Config $config + */ + public function __construct( + SdkUrl $sdkUrl, + ConfigFactory $config + ) { + $this->sdkUrl = $sdkUrl; + $this->configFactory = $config; + } + + /** + * Modify URL query parameter + * + * @param Index $subject + * @return null + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function beforeExecute(Index $subject) + { + // Check If PP SmartButtons enabled + $config = $this->configFactory->create()->setMethod(Config::METHOD_EXPRESS); + if ((bool)(int) $config->getValue('in_context')) { + $this->sdkUrl->setQueryParam('commit', 'true'); + } + + return null; + } +} diff --git a/app/code/Magento/Paypal/Plugin/TransparentSessionChecker.php b/app/code/Magento/Paypal/Plugin/TransparentSessionChecker.php index d53fd183c194..5d950f6c346e 100644 --- a/app/code/Magento/Paypal/Plugin/TransparentSessionChecker.php +++ b/app/code/Magento/Paypal/Plugin/TransparentSessionChecker.php @@ -20,6 +20,8 @@ class TransparentSessionChecker */ private $disableSessionUrls = [ 'paypal/transparent/redirect', + 'paypal/payflowadvanced/returnUrl', + 'paypal/payflow/returnUrl', 'paypal/hostedpro/return', ]; diff --git a/app/code/Magento/Paypal/Setup/Patch/Data/UpdateBmltoPayLater.php b/app/code/Magento/Paypal/Setup/Patch/Data/UpdateBmltoPayLater.php new file mode 100644 index 000000000000..449b130fa992 --- /dev/null +++ b/app/code/Magento/Paypal/Setup/Patch/Data/UpdateBmltoPayLater.php @@ -0,0 +1,232 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Paypal\Setup\Patch\Data; + +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Update bml config settings to the equivalent paylater settings + */ +class UpdateBmltoPayLater implements DataPatchInterface +{ + /** + * BML config path + */ + private const BMLPATH = 'payment/paypal_express_bml/'; + + /** + * PayLater config path + */ + private const PAYLATERPATH = 'payment/paypal_paylater/'; + + /** + * @var array + */ + private $bmlToPayLater = [ + [ + 'pages' => ['productpage', 'checkout'], + 'data' => [ + 'position' => [ + 'name' =>'position', + 'values' => [['options' =>['0' => 'header', '1' => 'near_pp_button']]], + 'requires' => [ + 'header' => ['name' => 'stylelayout', 'value' => 'flex'], + 'near_pp_button' => ['name' => 'stylelayout', 'value' => 'text'] + ] + ], + 'size' => [ + 'name' => 'ratio', + 'values' => [ + [ + 'options' => [ + '190x100' => '8x1', + '234x60' => '8x1', + '300x50' => '8x1', + '468x60' => '8x1', + '728x90' => '20x1', + '800x66' => '20x1' + ], + 'depends' => ['name' => 'position', 'value' => '0'] + ] + ] + ] + ] + ], + [ + 'pages' => ['homepage', 'categorypage'], + 'data' => [ + 'position' => [ + 'name' =>'position', + 'values' => [['options' => ['0' => 'header', '1' => 'sidebar']]], + 'requires' => [ + 'header' => ['name' => 'stylelayout', 'value' => 'flex'], + 'sidebar' => ['name' => 'stylelayout', 'value' => 'flex'] + ] + ], + 'size' => [ + 'name' => 'ratio', + 'values' => [ + [ + 'options' => [ + '190x100' => '8x1', + '234x60' => '8x1', + '300x50' => '8x1', + '468x60' => '8x1', + '728x90' => '20x1', + '800x66' => '20x1' + ], + 'depends' => ['name' => 'position', 'value' => '0'] + ], + [ + 'options' => [ + '120x90' => '1x1', + '190x100' => '1x1', + '234x60' => '1x1', + '120x240' => '1x1', + '120x600' => '1x4', + '234x400' => '1x1', + '250x250' => '1x1' + ], + 'depends' => ['name' => 'position', 'value' => '1'] + ] + ] + ] + ] + ] + ]; + + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * PrepareInitialConfig constructor. + * @param ModuleDataSetupInterface $moduleDataSetup + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup + ) { + $this->moduleDataSetup = $moduleDataSetup; + } + + /** + * @inheritdoc + */ + public function apply() + { + $this->moduleDataSetup->getConnection()->startSetup(); + + $select = $this->moduleDataSetup->getConnection()->select() + ->from( + $this->moduleDataSetup->getTable('core_config_data'), + ['path', 'value'] + ) + ->where('path LIKE ?', self::BMLPATH . '%'); + $bmlSettings = $this->moduleDataSetup->getConnection()->fetchPairs($select); + + foreach ($bmlSettings as $bmlPath => $bmlValue) { + $setting = str_replace(self::BMLPATH, '', $bmlPath); + $settingParts = explode('_', $setting); + $page = $settingParts[0]; + $setting = $settingParts[1]; + $payLaterPage = $page === 'checkout' ? 'cartpage' : $page; + $payLaterPath = self::PAYLATERPATH . $payLaterPage; + + if (array_key_exists(self::BMLPATH . $page . '_display', $bmlSettings) + && $bmlSettings[self::BMLPATH . $page . '_display'] === '0' + ) { + continue; + } + + foreach ($this->bmlToPayLater as $bmlToPayLaterSetting) { + if (in_array($page, $bmlToPayLaterSetting['pages']) + && array_key_exists($setting, $bmlToPayLaterSetting['data']) + ) { + $pageSetting = $bmlToPayLaterSetting['data'][$setting]; + + $this->convertAndSaveConfigValues($bmlSettings, $pageSetting, $payLaterPath, $page, $bmlValue); + } + } + } + + return $this->moduleDataSetup->getConnection()->endSetup(); + } + + /** + * Convert BML settings to PayLater and save + * + * @param array $bmlSettings + * @param array $pageSetting + * @param string $payLaterPath + * @param string $page + * @param string $bmlValue + */ + private function convertAndSaveConfigValues( + array $bmlSettings, + array $pageSetting, + string $payLaterPath, + string $page, + string $bmlValue + ) { + foreach ($pageSetting['values'] as $pageSettingValues) { + $dependsPath = isset($pageSettingValues['depends']) + ? self::BMLPATH . $page . '_' . $pageSettingValues['depends']['name'] + : ''; + + if (!array_key_exists('depends', $pageSettingValues) + || (array_key_exists($dependsPath, $bmlSettings) + && $bmlSettings[$dependsPath] === $pageSettingValues['depends']['value']) + ) { + $path = $payLaterPath . '_' . $pageSetting['name']; + $value = $pageSettingValues['options'][$bmlValue]; + $this->moduleDataSetup->getConnection()->insertOnDuplicate( + $this->moduleDataSetup->getTable('core_config_data'), + [ + 'scope' => 'default', + 'scope_id' => 0, + 'path' => $path, + 'value' => $value + ] + ); + if (array_key_exists('requires', $pageSetting) + && array_key_exists($value, $pageSetting['requires']) + ) { + $requiredPath = $payLaterPath . '_' . $pageSetting['requires'][$value]['name']; + $requiredValue = $pageSetting['requires'][$value]['value']; + $this->moduleDataSetup->getConnection()->insertOnDuplicate( + $this->moduleDataSetup->getTable('core_config_data'), + [ + 'scope' => 'default', + 'scope_id' => 0, + 'path' => $requiredPath, + 'value' => $requiredValue + ] + ); + } + } + } + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return []; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/StorefrontCheckoutSelectPaypalPaymentMethodActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/StorefrontCheckoutSelectPaypalPaymentMethodActionGroup.xml new file mode 100644 index 000000000000..c7c13cd84454 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/StorefrontCheckoutSelectPaypalPaymentMethodActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontCheckoutSelectPaypalPaymentMethodActionGroup"> + <annotations> + <description>Select Paypal payment method on onepage checkout</description> + </annotations> + <arguments> + <argument name="paymentMethod" defaultValue="{{StorefrontPaypalCheckoutSection.creditCard}}" type="string"/> + </arguments> + <click selector="{{paymentMethod}}" stepKey="selectPaypalPaymentMethod"/> + <waitForPageLoad stepKey="waitForPaypalFormLoad"/> + <scrollTo selector="{{paymentMethod}}" stepKey="scrollToCreditCardSection"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInCheckoutPageTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInCheckoutPageTest.xml index d43e894b014f..e67e4ae97f8d 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInCheckoutPageTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInCheckoutPageTest.xml @@ -16,10 +16,10 @@ <description value="Users are able to place order using Paypal Smart Button on Checkout Page, payment action is Sale"/> <severity value="CRITICAL"/> <testCaseId value="MC-13690"/> + <group value="paypalExpress"/> <skip> <issueId value="MC-37236"/> </skip> - <group value="paypalExpress"/> </annotations> <before> <!-- Login --> @@ -57,7 +57,7 @@ <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage"/> <actionGroup ref="StorefrontAddProductToCartFromCategoryActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInMiniCartPageTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInMiniCartPageTest.xml index c19cb3ee4a64..2c1a7a43f6f0 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInMiniCartPageTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInMiniCartPageTest.xml @@ -54,7 +54,7 @@ <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage"/> <actionGroup ref="StorefrontAddProductToCartFromCategoryActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInShoppingCartPageTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInShoppingCartPageTest.xml index 4aed4b3d7e41..0e1a0ab98405 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInShoppingCartPageTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInShoppingCartPageTest.xml @@ -68,7 +68,7 @@ <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage"/> <actionGroup ref="StorefrontAddProductToCartFromCategoryActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithFranceMerchantCountryTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithFranceMerchantCountryTest.xml index 7e3c4dab4588..801af2d7c270 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithFranceMerchantCountryTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithFranceMerchantCountryTest.xml @@ -16,10 +16,10 @@ <description value="Users are able to place order using Paypal Smart Button using Euro currency and merchant country is France"/> <severity value="MAJOR"/> <testCaseId value="MC-33274"/> + <group value="paypalExpress"/> <skip> <issueId value="MC-37236"/> </skip> - <group value="paypalExpress"/> </annotations> <before> <!--Set price scope global--> diff --git a/app/code/Magento/Paypal/Test/Unit/Controller/Payflow/ReturnUrlTest.php b/app/code/Magento/Paypal/Test/Unit/Controller/Payflow/ReturnUrlTest.php index 2b1d6526ab2a..5e27a33d1201 100644 --- a/app/code/Magento/Paypal/Test/Unit/Controller/Payflow/ReturnUrlTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Controller/Payflow/ReturnUrlTest.php @@ -32,6 +32,8 @@ class ReturnUrlTest extends TestCase { const LAST_REAL_ORDER_ID = '000000001'; + const SILENT_POST_HASH = 'abcdfg'; + /** * @var ReturnUrl */ @@ -142,7 +144,7 @@ protected function setUp(): void $this->checkoutSession = $this->getMockBuilder(Session::class) ->disableOriginalConstructor() - ->setMethods(['getLastRealOrderId', 'getLastRealOrder', 'restoreQuote']) + ->setMethods(['setLastRealOrderId', 'getLastRealOrder', 'restoreQuote']) ->getMock(); $this->paymentFailures = $this->getMockBuilder(PaymentFailuresInterface::class) @@ -177,8 +179,15 @@ public function testExecuteAllowedOrderState($state) $this->withLayout(); $this->withOrder(self::LAST_REAL_ORDER_ID, $state); - $this->checkoutSession->method('getLastRealOrderId') - ->willReturn(self::LAST_REAL_ORDER_ID); + $this->request->method('getParam') + ->willReturnMap([ + ['INVNUM', self::LAST_REAL_ORDER_ID], + ['USER2', self::SILENT_POST_HASH], + ]); + + $this->checkoutSession->expects($this->once()) + ->method('setLastRealOrderId') + ->with(self::LAST_REAL_ORDER_ID); $this->block->method('setData') ->with('goto_success_page', true) @@ -202,6 +211,45 @@ public function allowedOrderStateDataProvider() ]; } + /** + * Checks a test case when silent post hash validation fails. + * + * @param string $requestHash + * @param string $orderHash + * @dataProvider invalidHashVariations + */ + public function testFailedHashValidation(string $requestHash, string $orderHash) + { + $this->withLayout(); + $this->withOrder(self::LAST_REAL_ORDER_ID, Order::STATE_PROCESSING, $orderHash); + + $this->request->method('getParam') + ->willReturnMap([ + ['INVNUM', self::LAST_REAL_ORDER_ID], + ['USER2', $requestHash], + ]); + + $this->checkoutSession->expects($this->never()) + ->method('setLastRealOrderId') + ->with(self::LAST_REAL_ORDER_ID); + + $this->returnUrl->execute(); + } + + /** + * Gets list of allowed order states. + * + * @return array + */ + public function invalidHashVariations() + { + return [ + ['requestHash' => '', 'orderHash' => self::SILENT_POST_HASH], + ['requestHash' => self::SILENT_POST_HASH, 'orderHash' => ''], + ['requestHash' => 'abcd', 'orderHash' => 'dcba'], + ]; + } + /** * Checks a test case when action processes order with not allowed state. * @@ -218,8 +266,11 @@ public function testExecuteNotAllowedOrderState($state, $restoreQuote, $expected $this->withCheckoutSession(self::LAST_REAL_ORDER_ID, $restoreQuote); $this->request->method('getParam') - ->with('RESPMSG') - ->willReturn($errMessage); + ->willReturnMap([ + ['RESPMSG', $errMessage], + ['INVNUM', self::LAST_REAL_ORDER_ID], + ['USER2', self::SILENT_POST_HASH], + ]); $this->payment->method('getMethod') ->willReturn(Config::METHOD_PAYFLOWLINK); @@ -261,8 +312,14 @@ public function testCheckRejectByPaymentMethod() $this->withLayout(); $this->withOrder(self::LAST_REAL_ORDER_ID, Order::STATE_NEW); - $this->checkoutSession->method('getLastRealOrderId') - ->willReturn(self::LAST_REAL_ORDER_ID); + $this->checkoutSession->expects($this->once()) + ->method('setLastRealOrderId') + ->with(self::LAST_REAL_ORDER_ID); + $this->request->method('getParam') + ->willReturnMap([ + ['INVNUM', self::LAST_REAL_ORDER_ID], + ['USER2', self::SILENT_POST_HASH], + ]); $this->withBlockContent(false, 'Requested payment method does not match with order.'); @@ -285,8 +342,11 @@ public function testCheckXSSEscaped($errorMsg, $errorMsgEscaped) $this->withCheckoutSession(self::LAST_REAL_ORDER_ID, true); $this->request->method('getParam') - ->with('RESPMSG') - ->willReturn($errorMsg); + ->willReturnMap([ + ['RESPMSG', $errorMsg], + ['INVNUM', self::LAST_REAL_ORDER_ID], + ['USER2', self::SILENT_POST_HASH], + ]); $this->checkoutHelper->method('cancelCurrentOrder') ->with(self::equalTo($errorMsgEscaped)); @@ -323,8 +383,11 @@ public function testCheckAdvancedAcceptingByPaymentMethod() $this->withCheckoutSession(self::LAST_REAL_ORDER_ID, true); $this->request->method('getParam') - ->with('RESPMSG') - ->willReturn('message'); + ->willReturnMap([ + ['RESPMSG', 'message'], + ['INVNUM', self::LAST_REAL_ORDER_ID], + ['USER2', self::SILENT_POST_HASH], + ]); $this->withBlockContent('paymentMethod', 'Your payment has been declined. Please try again.'); @@ -347,9 +410,10 @@ public function testCheckAdvancedAcceptingByPaymentMethod() * * @param string $incrementId * @param string $state + * @param string $hash * @return void */ - private function withOrder($incrementId, $state) + private function withOrder($incrementId, $state, $hash = self::SILENT_POST_HASH) { $this->orderFactory->method('create') ->willReturn($this->order); @@ -366,6 +430,8 @@ private function withOrder($incrementId, $state) $this->order->method('getPayment') ->willReturn($this->payment); + $this->payment->method('getAdditionalInformation') + ->willReturn($hash); } /** @@ -390,8 +456,8 @@ private function withLayout() */ private function withCheckoutSession($orderId, $restoreQuote) { - $this->checkoutSession->method('getLastRealOrderId') - ->willReturn($orderId); + $this->checkoutSession->method('setLastRealOrderId') + ->with($orderId); $this->checkoutSession->method('getLastRealOrder') ->willReturn($this->order); diff --git a/app/code/Magento/Paypal/Test/Unit/Controller/Transparent/ResponseTest.php b/app/code/Magento/Paypal/Test/Unit/Controller/Transparent/ResponseTest.php index 696d00ae643e..7d0aa4cf611f 100644 --- a/app/code/Magento/Paypal/Test/Unit/Controller/Transparent/ResponseTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Controller/Transparent/ResponseTest.php @@ -13,7 +13,7 @@ use Magento\Framework\DataObject; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Registry; -use Magento\Framework\Session\Generic as Session; +use Magento\Checkout\Model\Session; use Magento\Framework\View\Layout\ProcessorInterface; use Magento\Framework\View\Result\Layout; use Magento\Framework\View\Result\LayoutFactory; diff --git a/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php b/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php index e532e50a5120..22370440ee7b 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php @@ -11,6 +11,7 @@ use Magento\Framework\App\ProductMetadataInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; use Magento\Payment\Model\MethodInterface; +use Magento\Store\Model\ScopeInterface; use Magento\Store\Model\ScopeInterface as ModelScopeInterface; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -300,23 +301,33 @@ public function testIsMethodActive() * Check bill me later active setting uses disable funding options * * @param string|null $disableFundingOptions - * @param int $expectedFlag + * @param int $expressBml * @param bool $expectedValue * * @dataProvider isMethodActiveBmlDataProvider */ - public function testIsMethodActiveBml($disableFundingOptions, $expectedFlag, $expectedValue) - { + public function testIsMethodActiveBml( + $disableFundingOptions, + $expressBml, + $wpsExpress, + $wpsExpressBml, + $expectedValue + ) { $this->scopeConfigMock->method('getValue') ->with( self::equalTo('paypal/style/disable_funding_options'), - self::equalTo('store') + self::equalTo(ScopeInterface::SCOPE_STORE) ) ->willReturn($disableFundingOptions); + $configFlagMap = [ + ['payment/wps_express/active', ScopeInterface::SCOPE_STORE, null, $wpsExpress], + ['payment/wps_express_bml/active', ScopeInterface::SCOPE_STORE, null, $wpsExpressBml], + ['payment/paypal_express_bml/active', ScopeInterface::SCOPE_STORE, null, $expressBml] + ]; + $this->scopeConfigMock->method('isSetFlag') - ->with('payment/paypal_express_bml/active') - ->willReturn($expectedFlag); + ->willReturnMap($configFlagMap); self::assertEquals($expectedValue, $this->config->isMethodActive('paypal_express_bml')); } @@ -327,14 +338,18 @@ public function testIsMethodActiveBml($disableFundingOptions, $expectedFlag, $ex public function isMethodActiveBmlDataProvider() { return [ - ['CREDIT,CARD,ELV', 0, false], - ['CREDIT,CARD,ELV', 1, true], - ['CREDIT', 0, false], - ['CREDIT', 1, true], - ['CARD', 0, true], - ['CARD', 1, true], - [null, 0, true], - [null, 1, true] + ['CREDIT,CARD,ELV', 0, 0, 0, false], + ['CREDIT,CARD,ELV', 1, 0, 0, true], + ['CREDIT', 0, 0, 0, false], + ['CREDIT', 1, 0, 0, true], + ['CARD', 0, 0, 0, true], + ['CARD', 1, 0, 0, true], + [null, 0, 0, 0, true], + [null, 1, 0, 0, true], + ['CREDIT', 0, 1, 0, false], + ['', 0, 1, 0, false], + ['', 0, 1, 1, true], + ['CREDIT', 0, 1, 1, true] ]; } diff --git a/app/code/Magento/Paypal/Test/Unit/Model/ConfigTest.php b/app/code/Magento/Paypal/Test/Unit/Model/ConfigTest.php index 71d1f82dfa5c..ef6067b81fdd 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/ConfigTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/ConfigTest.php @@ -135,20 +135,22 @@ public function testIsMethodAvailableForIsMethodActive($methodName, $expected) $this->scopeConfig ->method('getValue') ->willReturnMap($valueMap); - $this->scopeConfig->expects($this->exactly(1)) - ->method('isSetFlag') - ->withAnyParameters() - ->willReturn(true); } else { $this->scopeConfig ->method('getValue') ->with('paypal/general/merchant_country') ->willReturn('US'); - $this->scopeConfig->expects($this->exactly(2)) - ->method('isSetFlag') - ->withAnyParameters() - ->willReturn(true); } + $flagMap = [ + ['payment/'. Config::METHOD_WPS_EXPRESS . '/active', ScopeInterface::SCOPE_STORE, null, 0], + ['payment/'. Config::METHOD_WPS_BML . '/active', ScopeInterface::SCOPE_STORE, null, 0], + ['payment/'. Config::METHOD_WPP_EXPRESS . '/active', ScopeInterface::SCOPE_STORE, null, 1], + ['payment/'. Config::METHOD_PAYFLOWPRO . '/active', ScopeInterface::SCOPE_STORE, null, 1], + ['payment/'. Config::METHOD_WPP_PE_EXPRESS . '/active', ScopeInterface::SCOPE_STORE, null, 1], + ['payment/'. Config::METHOD_WPP_PE_BML . '/active', ScopeInterface::SCOPE_STORE, null, 1], + ]; + $this->scopeConfig->method('isSetFlag') + ->willReturnMap($flagMap); $this->model->setMethod($methodName); $this->assertEquals($expected, $this->model->isMethodAvailable($methodName)); diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/TransparentTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/TransparentTest.php index b1acece7982d..0e327e5d1854 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/TransparentTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/TransparentTest.php @@ -78,6 +78,11 @@ class TransparentTest extends TestCase */ private $order; + /** + * @var OrderPaymentExtensionInterface|MockObject + */ + private $paymentExtensionAttributes; + protected function setUp(): void { $this->initPayment(); @@ -97,6 +102,55 @@ protected function setUp(): void ); } + /** + * Check correct parent transaction ID for Payflow delayed capture. + * + * @dataProvider captureCorrectIdDataProvider + * @param string $parentTransactionId + * @throws InvalidTransitionException + * @throws LocalizedException + */ + public function testCaptureCorrectId(string $parentTransactionId) + { + if (empty($parentTransactionId)) { + $setParentTransactionIdCalls = 1; + $setAdditionalInformationCalls = 1; + $getGatewayTokenCalls = 2; + } else { + $setParentTransactionIdCalls = 0; + $setAdditionalInformationCalls = 0; + $getGatewayTokenCalls = 0; + } + + $gatewayToken = 'gateway_token'; + $this->payment->expects($this->once())->method('getParentTransactionId')->willReturn($parentTransactionId); + $this->payment->expects($this->exactly($setParentTransactionIdCalls))->method('setParentTransactionId'); + $this->payment->expects($this->exactly($setAdditionalInformationCalls))->method('setAdditionalInformation')->with(Payflowpro::PNREF, $gatewayToken); + $this->payment->expects($this->exactly(4))->method('getAdditionalInformation')->withConsecutive( + ['result_code'], + [Payflowpro::PNREF], + [Payflowpro::PNREF], + [Payflowpro::PNREF], + )->willReturn(0, '', Payflowpro::PNREF, Payflowpro::PNREF); + $this->paymentExtensionAttributes->expects($this->once())->method('getVaultPaymentToken')->willReturn($this->paymentToken); + $this->paymentToken->expects($this->exactly($getGatewayTokenCalls))->method('getGatewayToken')->willReturn($gatewayToken); + + $this->subject->capture($this->payment, 100); + } + + /** + * Data provider for testCaptureCorrectId. + * + * @return array + */ + public function captureCorrectIdDataProvider(): array + { + return [ + 'No Transaction ID' => [''], + 'With Transaction ID' => ['1'], + ]; + } + /** * Asserts that authorize request to Payflow gateway is valid. * @@ -295,7 +349,7 @@ private function initPayment() $this->order = $this->getMockBuilder(Order::class) ->disableOriginalConstructor() ->getMock(); - $paymentExtensionAttributes = $this->getMockBuilder(OrderPaymentExtensionInterface::class) + $this->paymentExtensionAttributes = $this->getMockBuilder(OrderPaymentExtensionInterface::class) ->setMethods( ['setVaultPaymentToken', 'getVaultPaymentToken', 'setNotificationMessage', 'getNotificationMessage'] ) @@ -305,7 +359,7 @@ private function initPayment() $this->payment->method('setIsTransactionClosed')->willReturnSelf(); $this->payment->method('getCcExpYear')->willReturn('2019'); $this->payment->method('getCcExpMonth')->willReturn('05'); - $this->payment->method('getExtensionAttributes')->willReturn($paymentExtensionAttributes); + $this->payment->method('getExtensionAttributes')->willReturn($this->paymentExtensionAttributes); return $this->payment; } diff --git a/app/code/Magento/Paypal/Test/Unit/Model/SdkUrlTest.php b/app/code/Magento/Paypal/Test/Unit/Model/SdkUrlTest.php new file mode 100644 index 000000000000..3b29017f494c --- /dev/null +++ b/app/code/Magento/Paypal/Test/Unit/Model/SdkUrlTest.php @@ -0,0 +1,163 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Paypal\Test\Unit\Model; + +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\Locale\ResolverInterface; +use Magento\Paypal\Model\Config; +use Magento\Paypal\Model\ConfigFactory; +use Magento\Paypal\Model\SmartButtonConfig; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test for smart button config + */ +class SdkUrlTest extends TestCase +{ + /** + * @var \Magento\Paypal\Model\SdkUrl + */ + private $model; + + /** + * @var MockObject + */ + private $localeResolverMock; + + /** + * @var MockObject + */ + private $configMock; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $this->localeResolverMock = $this->getMockForAbstractClass(ResolverInterface::class); + $this->configMock = $this->getMockBuilder(Config::class) + ->disableOriginalConstructor() + ->getMock(); + + /** @var ScopeConfigInterface|MockObject $scopeConfigMock */ + $scopeConfigMock = $this->getMockForAbstractClass(ScopeConfigInterface::class); + $scopeConfigMock->method('isSetFlag') + ->willReturn(true); + + /** @var ConfigFactory|MockObject $configFactoryMock */ + $configFactoryMock = $this->getMockBuilder(ConfigFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $configFactoryMock->expects($this->any())->method('create')->willReturn($this->configMock); + + /** @var Store|MockObject $storeMock */ + $storeMock = $this->createMock(Store::class); + $storeMock->method('getBaseCurrencyCode') + ->willReturn('USD'); + + /** @var StoreManagerInterface|MockObject $storeManagerMock */ + $storeManagerMock = $this->getMockForAbstractClass(StoreManagerInterface::class); + $storeManagerMock->method('getStore') + ->willReturn($storeMock); + + $this->model = new \Magento\Paypal\Model\SdkUrl( + $this->localeResolverMock, + $configFactoryMock, + $scopeConfigMock, + $storeManagerMock, + $this->getDisallowedFundingMap(), + $this->getUnsupportedPaymentMethods() + ); + } + + /** + * Tests config. + * + * @param string $locale + * @param string $intent + * @param string|null $disallowedFunding + * @param bool $isPaypalGuestCheckoutEnabled + * @param array $expected + * @dataProvider getConfigDataProvider + */ + public function testGetConfig( + string $locale, + string $intent, + ?string $disallowedFunding, + bool $isPaypalGuestCheckoutEnabled, + array $expected + ) { + $this->localeResolverMock->method('getLocale')->willReturn($locale); + $this->configMock->method('getValue')->willReturnMap( + [ + ['merchant_id', null, 'merchant'], + ['sandbox_client_id', null, 'sb'], + ['sandbox_flag', null, true], + ['disable_funding_options', null, $disallowedFunding], + ['paymentAction', null, $intent], + ['in_context', null, true], + [ + 'solution_type', + null, + $isPaypalGuestCheckoutEnabled ? Config::EC_SOLUTION_TYPE_SOLE : Config::EC_SOLUTION_TYPE_MARK + ], + ] + ); + + self::assertEquals($expected['sdkUrl'], $this->model->getUrl()); + } + + /** + * Get config data provider + * + * @return array + */ + public function getConfigDataProvider() + { + return include __DIR__ . '/_files/expected_url_config.php'; + } + + /** + * Get disallowed funding map + * See app/code/Magento/Paypal/etc/frontend/di.xml + * + * @return array + */ + private function getDisallowedFundingMap() + { + return [ + "CREDIT" => 'credit', + "CARD" => 'card', + "ELV" => 'sepa' + ]; + } + + /** + * Get unsupported payment methods + * See app/code/Magento/Paypal/etc/frontend/di.xml + * + * @return array + */ + private function getUnsupportedPaymentMethods() + { + return [ + 'venmo'=> 'venmo', + 'bancontact' => 'bancontact', + 'eps' => 'eps', + 'giropay' => 'giropay', + 'ideal' => 'ideal', + 'mybank' => 'mybank', + 'p24' => 'p24', + 'sofort' => 'sofort' + ]; + } +} diff --git a/app/code/Magento/Paypal/Test/Unit/Model/SmartButtonConfigTest.php b/app/code/Magento/Paypal/Test/Unit/Model/SmartButtonConfigTest.php index f7ee15efa3ab..e42865fa138c 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/SmartButtonConfigTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/SmartButtonConfigTest.php @@ -57,26 +57,17 @@ protected function setUp(): void ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $configFactoryMock->expects($this->once())->method('create')->willReturn($this->configMock); + $configFactoryMock->expects($this->any())->method('create')->willReturn($this->configMock); - /** @var Store|MockObject $storeMock */ - $storeMock = $this->createMock(Store::class); - $storeMock->method('getBaseCurrencyCode') - ->willReturn('USD'); - - /** @var StoreManagerInterface|MockObject $storeManagerMock */ - $storeManagerMock = $this->getMockForAbstractClass(StoreManagerInterface::class); - $storeManagerMock->method('getStore') - ->willReturn($storeMock); + $sdkUrl = $this->createMock(\Magento\Paypal\Model\SdkUrl::class); + $sdkUrl->method('getUrl')->willReturn('http://mock.url'); $this->model = new SmartButtonConfig( $this->localeResolverMock, $configFactoryMock, $scopeConfigMock, - $storeManagerMock, + $sdkUrl, $this->getDefaultStyles(), - $this->getDisallowedFundingMap(), - $this->getUnsupportedPaymentMethods() ); } @@ -86,14 +77,12 @@ protected function setUp(): void * @param string $page * @param string $locale * @param bool $isCustomize - * @param string $disallowedFundings * @param string $layout * @param string $shape * @param string $label * @param string $color - * @param string $installmentPeriodLabel + * @param string $installmentPeriod * @param string $installmentPeriodLocale - * @param string $isPaypalGuestCheckoutEnabled * @param array $expected * @dataProvider getConfigDataProvider * @SuppressWarnings(PHPMD.ExcessiveParameterList) @@ -102,42 +91,17 @@ public function testGetConfig( string $page, string $locale, bool $isCustomize, - ?string $disallowedFundings, string $layout, string $shape, string $label, string $color, - string $installmentPeriodLabel, + string $installmentPeriod, string $installmentPeriodLocale, - bool $isPaypalGuestCheckoutEnabled, array $expected = [] ) { $this->localeResolverMock->method('getLocale')->willReturn($locale); $this->configMock->method('getValue')->willReturnMap( [ - ['merchant_id', null, 'merchant'], - [ - 'solution_type', - null, - $isPaypalGuestCheckoutEnabled ? Config::EC_SOLUTION_TYPE_SOLE : Config::EC_SOLUTION_TYPE_MARK - ], - ['sandbox_flag', null, true], - ['disable_funding_options', null, $disallowedFundings], - ["{$page}_page_button_customize", null, $isCustomize], - ["{$page}_page_button_layout", null, $layout], - ["{$page}_page_button_color", null, $color], - ["{$page}_page_button_shape", null, $shape], - ["{$page}_page_button_label", null, $label], - ['sandbox_client_id', null, 'sb'], - ['merchant_id', null, 'merchant'], - [ - 'solution_type', - null, - $isPaypalGuestCheckoutEnabled ? Config::EC_SOLUTION_TYPE_SOLE : Config::EC_SOLUTION_TYPE_MARK - ], - ['sandbox_flag', null, true], - ['paymentAction', null, 'Authorization'], - ['disable_funding_options', null, $disallowedFundings], ["{$page}_page_button_customize", null, $isCustomize], ["{$page}_page_button_layout", null, $layout], ["{$page}_page_button_color", null, $color], @@ -146,7 +110,7 @@ public function testGetConfig( [ $page . '_page_button_' . $installmentPeriodLocale . '_installment_period', null, - $installmentPeriodLabel + $installmentPeriod ] ] ); @@ -161,7 +125,7 @@ public function testGetConfig( */ public function getConfigDataProvider() { - return include __DIR__ . '/_files/expected_config.php'; + return include __DIR__ . '/_files/expected_style_config.php'; } /** @@ -173,24 +137,4 @@ private function getDefaultStyles() { return include __DIR__ . '/_files/default_styles.php'; } - - /** - * Get disallowed funding map - * - * @return array - */ - private function getDisallowedFundingMap() - { - return include __DIR__ . '/_files/disallowed_funding_map.php'; - } - - /** - * Get unsupported payment methods - * - * @return array - */ - private function getUnsupportedPaymentMethods() - { - return include __DIR__ . '/_files/unsupported_payment_methods.php'; - } } diff --git a/app/code/Magento/Paypal/Test/Unit/Model/_files/disallowed_funding_map.php b/app/code/Magento/Paypal/Test/Unit/Model/_files/disallowed_funding_map.php deleted file mode 100644 index ea543454975f..000000000000 --- a/app/code/Magento/Paypal/Test/Unit/Model/_files/disallowed_funding_map.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -return [ - "CREDIT" => 'credit', - "CARD" => 'card', - "ELV" => 'sepa' -]; diff --git a/app/code/Magento/Paypal/Test/Unit/Model/_files/expected_config.php b/app/code/Magento/Paypal/Test/Unit/Model/_files/expected_config.php deleted file mode 100644 index a7bd43e53085..000000000000 --- a/app/code/Magento/Paypal/Test/Unit/Model/_files/expected_config.php +++ /dev/null @@ -1,212 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -/** - * Generates expected PayPal SDK url - * @param array $params - * @return String - */ -function generateExpectedPaypalSdkUrl(array $params) : String -{ - return 'https://www.paypal.com/sdk/js?' . http_build_query($params); -} - -return [ - 'cart' => [ - 'cart', - 'es_MX', - true, - 'CREDIT', - 'horizontal', - 'pill', - 'installment', - 'blue', - 'my_label', - 'mx', - true, - [ - 'styles' => [ - 'layout' => 'horizontal', - 'size' => null, - 'color' => 'blue', - 'shape' => 'pill', - 'label' => 'installment', - 'period' => 0 - ], - 'isVisibleOnProductPage' => false, - 'isGuestCheckoutAllowed' => true, - 'sdkUrl' => generateExpectedPaypalSdkUrl( - [ - 'client-id' => 'sb', - 'commit' => 'false', - 'merchant-id' => 'merchant', - 'locale' => 'es_MX', - 'intent' => 'authorize', - 'currency' => 'USD', - 'disable-funding' => implode( - ',', - ['credit', 'venmo', 'bancontact', 'eps', 'giropay', 'ideal', 'mybank', 'p24', 'sofort'] - ) - ] - ) - ] - ], - 'checkout' => [ - 'cart', - 'en_BR', - true, - null, - 'horizontal', - 'pill', - 'installment', - 'blue', - 'my_label', - 'br', - true, - [ - 'styles' => [ - 'layout' => 'horizontal', - 'size' => null, - 'color' => 'blue', - 'shape' => 'pill', - 'label' => 'installment', - 'period' => 0 - ], - 'isVisibleOnProductPage' => false, - 'isGuestCheckoutAllowed' => true, - 'sdkUrl' => generateExpectedPaypalSdkUrl( - [ - 'client-id' => 'sb', - 'commit' => 'false', - 'merchant-id' => 'merchant', - 'locale' => 'en_BR', - 'intent' => 'authorize', - 'currency' => 'USD', - 'disable-funding' => implode( - ',', - ['venmo', 'bancontact', 'eps', 'giropay', 'ideal', 'mybank', 'p24', 'sofort'] - ) - ] - ) - ] - ], - 'mini_cart' => [ - 'cart', - 'en_US', - false, - null, - 'horizontal', - 'pill', - 'installment', - 'blue', - 'my_label', - 'br', - true, - [ - 'styles' => [ - 'layout' => 'vertical', - 'size' => 'responsive', - 'color' => 'gold', - 'shape' => 'rect', - 'label' => 'paypal' - ], - 'isVisibleOnProductPage' => false, - 'isGuestCheckoutAllowed' => true, - 'sdkUrl' => generateExpectedPaypalSdkUrl( - [ - 'client-id' => 'sb', - 'commit' => 'false', - 'merchant-id' => 'merchant', - 'locale' => 'en_US', - 'intent' => 'authorize', - 'currency' => 'USD', - 'disable-funding' => implode( - ',', - ['venmo', 'bancontact', 'eps', 'giropay', 'ideal', 'mybank', 'p24', 'sofort'] - ) - ] - ) - ] - ], - 'product' => [ - 'cart', - 'en_US', - false, - 'CREDIT', - 'horizontal', - 'pill', - 'installment', - 'blue', - 'my_label', - 'br', - true, - [ - 'styles' => [ - 'layout' => 'vertical', - 'size' => 'responsive', - 'color' => 'gold', - 'shape' => 'rect', - 'label' => 'paypal', - ], - 'isVisibleOnProductPage' => false, - 'isGuestCheckoutAllowed' => true, - 'sdkUrl' => generateExpectedPaypalSdkUrl( - [ - 'client-id' => 'sb', - 'commit' => 'false', - 'merchant-id' => 'merchant', - 'locale' => 'en_US', - 'intent' => 'authorize', - 'currency' => 'USD', - 'disable-funding' => implode( - ',', - ['credit','venmo', 'bancontact', 'eps', 'giropay', 'ideal', 'mybank', 'p24', 'sofort'] - ) - ] - ) - ] - ], - 'checkout_with_paypal_guest_checkout_disabled' => [ - 'cart', - 'en_BR', - true, - null, - 'horizontal', - 'pill', - 'installment', - 'blue', - 'my_label', - 'br', - false, - [ - 'styles' => [ - 'layout' => 'horizontal', - 'size' => null, - 'color' => 'blue', - 'shape' => 'pill', - 'label' => 'installment', - 'period' => 0 - ], - 'isVisibleOnProductPage' => false, - 'isGuestCheckoutAllowed' => true, - 'sdkUrl' => generateExpectedPaypalSdkUrl( - [ - 'client-id' => 'sb', - 'commit' => 'false', - 'merchant-id' => 'merchant', - 'locale' => 'en_BR', - 'intent' => 'authorize', - 'currency' => 'USD', - 'disable-funding' => implode( - ',', - ['card','venmo', 'bancontact', 'eps', 'giropay', 'ideal', 'mybank', 'p24', 'sofort'] - ) - ] - ) - ] - ], -]; diff --git a/app/code/Magento/Paypal/Test/Unit/Model/_files/expected_style_config.php b/app/code/Magento/Paypal/Test/Unit/Model/_files/expected_style_config.php new file mode 100644 index 000000000000..70da32543484 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Unit/Model/_files/expected_style_config.php @@ -0,0 +1,103 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +return [ + 'cart' => [ + 'cart', + 'es_MX', + true, + 'horizontal', + 'pill', + 'installment', + 'blue', + '5', + 'mx', + [ + 'styles' => [ + 'layout' => 'horizontal', + 'size' => null, + 'color' => 'blue', + 'shape' => 'pill', + 'label' => 'installment', + 'period' => 5 + ], + 'isVisibleOnProductPage' => false, + 'isGuestCheckoutAllowed' => true, + 'sdkUrl' => 'http://mock.url' + ] + ], + 'checkout' => [ + 'cart', + 'en_BR', + true, + 'horizontal', + 'pill', + 'installment', + 'blue', + '6', + 'br', + [ + 'styles' => [ + 'layout' => 'horizontal', + 'size' => null, + 'color' => 'blue', + 'shape' => 'pill', + 'label' => 'installment', + 'period' => 6 + ], + 'isVisibleOnProductPage' => false, + 'isGuestCheckoutAllowed' => true, + 'sdkUrl' => 'http://mock.url' + ] + ], + 'mini_cart' => [ + 'cart', + 'en_US', + false, + 'horizontal', + 'pill', + 'installment', + 'blue', + 'no_value_expected', + 'br', + [ + 'styles' => [ + 'layout' => 'vertical', + 'size' => 'responsive', + 'color' => 'gold', + 'shape' => 'rect', + 'label' => 'paypal' + ], + 'isVisibleOnProductPage' => false, + 'isGuestCheckoutAllowed' => true, + 'sdkUrl' => 'http://mock.url' + ] + ], + 'product' => [ + 'cart', + 'en_US', + false, + 'horizontal', + 'pill', + 'installment', + 'blue', + 'my_label', + 'br', + [ + 'styles' => [ + 'layout' => 'vertical', + 'size' => 'responsive', + 'color' => 'gold', + 'shape' => 'rect', + 'label' => 'paypal', + ], + 'isVisibleOnProductPage' => false, + 'isGuestCheckoutAllowed' => true, + 'sdkUrl' => 'http://mock.url' + ] + ], +]; diff --git a/app/code/Magento/Paypal/Test/Unit/Model/_files/expected_url_config.php b/app/code/Magento/Paypal/Test/Unit/Model/_files/expected_url_config.php new file mode 100644 index 000000000000..52d488104f05 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Unit/Model/_files/expected_url_config.php @@ -0,0 +1,158 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +/** + * Generates expected PayPal SDK url + * @param array $params + * @return String + */ +function generateExpectedPaypalSdkUrl(array $params) : String +{ + return 'https://www.paypal.com/sdk/js?' . http_build_query($params); +} + +return [ + 'authorize' => [ + 'es_MX', + 'Authorization', + 'CREDIT,ELV,CARD', + true, + [ + 'sdkUrl' => generateExpectedPaypalSdkUrl( + [ + 'client-id' => 'sb', + 'locale' => 'es_MX', + 'currency' => 'USD', + 'commit' => 'false', + 'intent' => 'authorize', + 'merchant-id' => 'merchant', + 'disable-funding' => implode( + ',', + [ + 'credit', + 'sepa', + 'card', + 'venmo', + 'bancontact', + 'eps', + 'giropay', + 'ideal', + 'mybank', + 'p24', + 'sofort' + ] + ), + 'components' => implode(',', ['messages', 'buttons']) + ] + ) + ] + ], + 'capture' => [ + 'en_BR', + 'Sale', + null, + true, + [ + 'sdkUrl' => generateExpectedPaypalSdkUrl( + [ + 'client-id' => 'sb', + 'locale' => 'en_BR', + 'currency' => 'USD', + 'commit' => 'false', + 'intent' => 'capture', + 'merchant-id' => 'merchant', + 'disable-funding' => implode( + ',', + ['venmo', 'bancontact', 'eps', 'giropay', 'ideal', 'mybank', 'p24', 'sofort'] + ), + 'components' => implode(',', ['messages', 'buttons']) + ] + ) + ] + ], + 'order' => [ + 'en_US', + 'Order', + null, + true, + [ + 'sdkUrl' => generateExpectedPaypalSdkUrl( + [ + 'client-id' => 'sb', + 'locale' => 'en_US', + 'currency' => 'USD', + 'commit' => 'false', + 'intent' => 'order', + 'merchant-id' => 'merchant', + 'disable-funding' => implode( + ',', + ['venmo', 'bancontact', 'eps', 'giropay', 'ideal', 'mybank', 'p24', 'sofort'] + ), + 'components' => implode(',', ['messages', 'buttons']) + ] + ) + ] + ], + 'paypal_guest_checkout_disabled' => [ + 'en_BR', + 'Authorization', + 'CREDIT,ELV', + false, + [ + 'sdkUrl' => generateExpectedPaypalSdkUrl( + [ + 'client-id' => 'sb', + 'locale' => 'en_BR', + 'currency' => 'USD', + 'commit' => 'false', + 'intent' => 'authorize', + 'merchant-id' => 'merchant', + 'disable-funding' => implode( + ',', + [ + 'credit', + 'sepa', + 'card', + 'venmo', + 'bancontact', + 'eps', + 'giropay', + 'ideal', + 'mybank', + 'p24', + 'sofort' + ] + ), + 'components' => implode(',', ['messages', 'buttons']) + ] + ) + ] + ], + 'paypal_guest_checkout_enabled' => [ + 'en_BR', + 'Authorization', + 'CREDIT,ELV', + true, + [ + 'sdkUrl' => generateExpectedPaypalSdkUrl( + [ + 'client-id' => 'sb', + 'locale' => 'en_BR', + 'currency' => 'USD', + 'commit' => 'false', + 'intent' => 'authorize', + 'merchant-id' => 'merchant', + 'disable-funding' => implode( + ',', + ['credit', 'sepa', 'venmo', 'bancontact', 'eps', 'giropay', 'ideal', 'mybank', 'p24', 'sofort'] + ), + 'components' => implode(',', ['messages', 'buttons']) + ] + ) + ] + ], +]; diff --git a/app/code/Magento/Paypal/Test/Unit/Model/_files/unsupported_payment_methods.php b/app/code/Magento/Paypal/Test/Unit/Model/_files/unsupported_payment_methods.php deleted file mode 100644 index f4b4c72762d9..000000000000 --- a/app/code/Magento/Paypal/Test/Unit/Model/_files/unsupported_payment_methods.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -return [ - 'venmo'=> 'venmo', - 'bancontact' => 'bancontact', - 'eps' => 'eps', - 'giropay' => 'giropay', - 'ideal' => 'ideal', - 'mybank' => 'mybank', - 'p24' => 'p24', - 'sofort' => 'sofort' -]; diff --git a/app/code/Magento/Paypal/composer.json b/app/code/Magento/Paypal/composer.json index 1b35fae2de1b..389544b6a17a 100644 --- a/app/code/Magento/Paypal/composer.json +++ b/app/code/Magento/Paypal/composer.json @@ -8,6 +8,7 @@ "php": "~7.3.0||~7.4.0", "lib-libxml": "*", "magento/framework": "*", + "magento/module-authorization": "*", "magento/module-backend": "*", "magento/module-catalog": "*", "magento/module-checkout": "*", diff --git a/app/code/Magento/Paypal/etc/adminhtml/system.xml b/app/code/Magento/Paypal/etc/adminhtml/system.xml index 80e9523c752e..2900167f86b3 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system.xml @@ -49,6 +49,13 @@ <group id="pphs_advertise_bml" showInDefault="0" showInWebsite="0"/> </group> </group> + <group id="payments_pro_hosted_solution_without_bml_and_paylater" extends="payments_pro_hosted_solution_without_bml"> + <group id="pphs_required_settings"> + <field id="enable_paypal_paylater_experience" showInDefault="0" showInWebsite="0"/> + <group id="pphs_advertise_paylater" showInDefault="0" showInWebsite="0"/> + </group> + </group> + <include path="Magento_Paypal::system/payments_pro_hosted_solution_with_express_checkout.xml"/> </section> <section id="payment_us" extends="payment" showInDefault="0" showInWebsite="0" showInStore="0"> <group id="paypal_alternative_payment_methods" sortOrder="5" showInDefault="0" showInWebsite="0" showInStore="0"> @@ -75,7 +82,7 @@ <label>Payments Pro</label> <attribute type="activity_path">payment/paypal_payment_pro/active</attribute> <group id="configuration_details"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payments-pro.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payments-pro.html</comment> </group> <group id="paypal_payflow_required" showInDefault="1" showInWebsite="1" sortOrder="10"> <field id="enable_paypal_payflow"> @@ -95,7 +102,7 @@ <comment>Accept credit card and PayPal payments securely.</comment> <attribute type="activity_path">payment/wps_express/active</attribute> <group id="configuration_details"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payments-standard.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payments-standard.html</comment> </group> <group id="express_checkout_required"> <group id="express_checkout_required_express_checkout"> @@ -148,6 +155,16 @@ <field id="enable_express_checkout_bml" showInDefault="0" showInWebsite="0"/> <field id="express_checkout_bml_sort_order" showInDefault="0" showInWebsite="0"/> <group id="advertise_bml" showInDefault="0" showInWebsite="0"/> + <group id="advertise_paylater"> + <field id="paylater_enabled" translate="label comment"> + <comment> + <![CDATA[Display pay later messaging on your site for offers like Pay in 3, + which lets customers pay with 3 interest- free monthly payments. We’ll show messages + on your site to promote this feature for you. You may not promote pay later offers + with any other content, marketing, or materials.]]> + </comment> + </field> + </group> </group> </group> </group> @@ -168,13 +185,26 @@ <group id="wpp_advertise_bml" showInDefault="0" showInWebsite="0"/> </group> </group> - <include path="Magento_Paypal::system/payments_pro_hosted_solution_with_express_checkout.xml"/> + <group id="payments_pro_hosted_solution_with_express_checkout" extends="payment_all_paypal/payments_pro_hosted_solution_with_express_checkout"> + <group id="pphs_required_settings"> + <group id="pphs_advertise_paylater"> + <field id="paylater_enabled" translate="label comment"> + <comment> + <![CDATA[Display pay later messaging on your site for offers like Pay in 3, which + lets customers pay with 3 interest- free monthly payments. We’ll show messages on + your site to promote this feature for you. You may not promote pay later offers + with any other content, marketing, or materials.]]> + </comment> + </field> + </group> + </group> + </group> <group id="wps_express" translate="label comment" extends="payment_all_paypal/express_checkout" sortOrder="50"> <label>Website Payments Standard</label> <comment>Accept credit card and PayPal payments securely.</comment> <attribute type="activity_path">payment/wps_express/active</attribute> <group id="configuration_details"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payments-standard.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payments-standard.html</comment> </group> <group id="express_checkout_required"> <group id="express_checkout_required_express_checkout" translate="label"> @@ -188,6 +218,16 @@ <field id="enable_express_checkout_bml" showInDefault="0" showInWebsite="0"/> <field id="express_checkout_bml_sort_order" showInDefault="0" showInWebsite="0"/> <group id="advertise_bml" showInDefault="0" showInWebsite="0"/> + <group id="advertise_paylater"> + <field id="paylater_enabled" translate="label comment"> + <comment> + <![CDATA[Display pay later messaging on your site for offers like Pay in 3, + which lets customers pay with 3 interest- free monthly payments. We’ll show messages + on your site to promote this feature for you. You may not promote pay later offers + with any other content, marketing, or materials.]]> + </comment> + </field> + </group> </group> <group id="settings_ec" translate="label"> <label>Basic Settings - PayPal Website Payments Standard</label> @@ -228,7 +268,9 @@ <group id="express_checkout_required"> <field id="enable_express_checkout_bml" showInDefault="0" showInWebsite="0"/> <field id="express_checkout_bml_sort_order" showInDefault="0" showInWebsite="0"/> + <field id="enable_paypal_paylater_experience" showInDefault="0" showInWebsite="0"/> <group id="advertise_bml" showInDefault="0" showInWebsite="0"/> + <group id="advertise_paylater" showInDefault="0" showInWebsite="0"/> </group> </group> <group id="paypal_group_all_in_one" translate="label comment" sortOrder="7" showInDefault="1" showInWebsite="1" showInStore="1"> @@ -245,7 +287,7 @@ <comment>Accept credit card and PayPal payments securely.</comment> <attribute type="activity_path">payment/wps_express/active</attribute> <group id="configuration_details"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payments-standard.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payments-standard.html</comment> </group> <group id="express_checkout_required"> <group id="express_checkout_required_express_checkout" translate="label"> @@ -258,7 +300,9 @@ </field> <field id="enable_express_checkout_bml" showInDefault="0" showInWebsite="0"/> <field id="express_checkout_bml_sort_order" showInDefault="0" showInWebsite="0"/> + <field id="enable_paypal_paylater_experience" showInDefault="0" showInWebsite="0"/> <group id="advertise_bml" showInDefault="0" showInWebsite="0"/> + <group id="advertise_paylater" showInDefault="0" showInWebsite="0"/> </group> <group id="settings_ec"> <label>Basic Settings - PayPal Website Payments Standard</label> @@ -290,7 +334,7 @@ <label>Website Payments Pro</label> <attribute type="activity_path">payment/paypal_payment_pro/active</attribute> <group id="configuration_details"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payments-pro.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payments-pro.html</comment> </group> <group id="paypal_payflow_required" translate="label" showInDefault="1" showInWebsite="1" sortOrder="10"> <group id="paypal_payflow_api_settings"> @@ -304,25 +348,44 @@ <config_path>payment/paypal_payment_pro/active</config_path> <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Field\Enable\Payment</frontend_model> </field> + <field id="enable_paypal_paylater_experience" showInDefault="0" showInWebsite="0"/> + <group id="paypal_payflow_advertise_paylater" showInDefault="0" showInWebsite="0"/> </group> <group id="settings_paypal_payflow"> <label>Basic Settings - PayPal Payments Pro</label> </group> </group> - <group id="paypal_payflowpro_ca" extends="payment_all_paypal/paypal_payflowpro" sortOrder="40"/> + <group id="paypal_payflowpro_ca" extends="payment_all_paypal/paypal_payflowpro" sortOrder="40"> + <group id="paypal_payflow_required"> + <field id="enable_paypal_paylater_experience" showInDefault="0" showInWebsite="0"/> + <group id="paypal_payflow_advertise_paylater" showInDefault="0" showInWebsite="0"/> + </group> + </group> <group id="payflow_link_ca" extends="payment_all_paypal/payflow_link" sortOrder="50"> <group id="payflow_link_required"> <field id="enable_express_checkout_bml" showInDefault="0" showInWebsite="0"/> <field id="express_checkout_bml_sort_order" showInDefault="0" showInWebsite="0"/> + <field id="enable_paypal_paylater_experience" showInDefault="0" showInWebsite="0"/> <group id="payflow_link_advertise_bml" showInDefault="0" showInWebsite="0"/> + <group id="payflow_link_advertise_paylater" showInDefault="0" showInWebsite="0"/> </group> </group> </group> </section> <section id="payment_au" extends="payment_other"> - <group id="express_checkout_other"/> + <group id="express_checkout_other"> + <group id="express_checkout_required"> + <field id="enable_paypal_paylater_experience" showInDefault="1" showInWebsite="1"/> + <group id="advertise_paylater" showInDefault="1" showInWebsite="1"/> + </group> + </group> <group id="paypal_group_all_in_one"> - <group id="wps_other" sortOrder="12"/> + <group id="wps_other" sortOrder="12"> + <group id="express_checkout_required"> + <field id="enable_paypal_paylater_experience" showInDefault="1" showInWebsite="1"/> + <group id="advertise_paylater" showInDefault="1" showInWebsite="1"/> + </group> + </group> <group id="payments_pro_hosted_solution_au" extends="payment_all_paypal/payments_pro_hosted_solution_without_bml" sortOrder="10"/> </group> <group id="paypal_payment_gateways" showInDefault="1" showInWebsite="1" showInStore="1"> @@ -333,17 +396,76 @@ <group id="express_checkout_other"/> <group id="paypal_group_all_in_one"> <group id="wps_other" sortOrder="12"/> - <group id="payments_pro_hosted_solution_jp" extends="payment_all_paypal/payments_pro_hosted_solution_without_bml" sortOrder="10"> + <group id="payments_pro_hosted_solution_jp" extends="payment_all_paypal/payments_pro_hosted_solution_without_bml_and_paylater" sortOrder="10"> <label>Website Payments Plus</label> </group> </group> </section> <section id="payment_fr" extends="payment_other"> - <group id="express_checkout_other"/> + <group id="express_checkout_other"> + <group id="express_checkout_required"> + <field id="enable_paypal_paylater_experience" showInDefault="1" showInWebsite="1"/> + <group id="advertise_paylater" showInDefault="1" showInWebsite="1"> + <field id="paylater_enabled"> + <comment> + <![CDATA[Affichez le Paiement en 4X PayPal sur votre site. Le Paiement en 4X PayPal + permet aux consommateurs français de payer en 4 versements égaux. Vous pouvez + promouvoir le Paiement en 4X PayPal uniquement si vous êtes un commerçant basé en + France, avec un site internet en français et une intégration PayPal standard. Les + marchands ayant l’outil Vaulting (coffre-fort numérique) ou une intégration de + paiements récurrents/abonnement, ainsi que ceux présentant certaines activités + (vente de biens numériques / de biens non physiques) ne sont pas éligibles pour + promouvoir le Paiement en 4X PayPal. Nous afficherons des messages sur votre site + pour promouvoir le Paiement en 4X PayPal. Vous ne pouvez pas promouvoir le Paiement + en 4X PayPal avec un autre contenu, quel qu’il soit.]]> + </comment> + </field> + </group> + </group> + </group> <group id="paypal_group_all_in_one"> - <group id="wps_other" sortOrder="12"/> + <group id="wps_other" sortOrder="12"> + <group id="express_checkout_required"> + <field id="enable_paypal_paylater_experience" showInDefault="1" showInWebsite="1"/> + <group id="advertise_paylater" showInDefault="1" showInWebsite="1"> + <field id="paylater_enabled"> + <comment> + <![CDATA[Affichez le Paiement en 4X PayPal sur votre site. Le Paiement en 4X PayPal + permet aux consommateurs français de payer en 4 versements égaux. Vous pouvez + promouvoir le Paiement en 4X PayPal uniquement si vous êtes un commerçant basé en + France, avec un site internet en français et une intégration PayPal standard. Les + marchands ayant l’outil Vaulting (coffre-fort numérique) ou une intégration de + paiements récurrents/abonnement, ainsi que ceux présentant certaines activités + (vente de biens numériques / de biens non physiques) ne sont pas éligibles pour + promouvoir le Paiement en 4X PayPal. Nous afficherons des messages sur votre site + pour promouvoir le Paiement en 4X PayPal. Vous ne pouvez pas promouvoir le Paiement + en 4X PayPal avec un autre contenu, quel qu’il soit.]]> + </comment> + </field> + </group> + </group> + </group> <group id="payments_pro_hosted_solution_fr" extends="payment_all_paypal/payments_pro_hosted_solution_without_bml" sortOrder="10"> <label>Integral Evolution</label> + <group id="pphs_required_settings"> + <field id="enable_paypal_paylater_experience" showInDefault="1" showInWebsite="1"/> + <group id="pphs_advertise_paylater"> + <field id="paylater_enabled"> + <comment> + <![CDATA[Affichez le Paiement en 4X PayPal sur votre site. Le Paiement en 4X PayPal + permet aux consommateurs français de payer en 4 versements égaux. Vous pouvez + promouvoir le Paiement en 4X PayPal uniquement si vous êtes un commerçant basé en + France, avec un site internet en français et une intégration PayPal standard. Les + marchands ayant l’outil Vaulting (coffre-fort numérique) ou une intégration de + paiements récurrents/abonnement, ainsi que ceux présentant certaines activités + (vente de biens numériques / de biens non physiques) ne sont pas éligibles pour + promouvoir le Paiement en 4X PayPal. Nous afficherons des messages sur votre site + pour promouvoir le Paiement en 4X PayPal. Vous ne pouvez pas promouvoir le Paiement + en 4X PayPal avec un autre contenu, quel qu’il soit.]]> + </comment> + </field> + </group> + </group> </group> </group> </section> @@ -351,7 +473,7 @@ <group id="express_checkout_other"/> <group id="paypal_group_all_in_one"> <group id="wps_other" sortOrder="12"/> - <group id="payments_pro_hosted_solution_it" extends="payment_all_paypal/payments_pro_hosted_solution_without_bml" sortOrder="10"> + <group id="payments_pro_hosted_solution_it" extends="payment_all_paypal/payments_pro_hosted_solution_without_bml_and_paylater" sortOrder="10"> <label>Pro</label> </group> </group> @@ -360,7 +482,7 @@ <group id="express_checkout_other"/> <group id="paypal_group_all_in_one"> <group id="wps_other" sortOrder="12"/> - <group id="payments_pro_hosted_solution_es" extends="payment_all_paypal/payments_pro_hosted_solution_without_bml" sortOrder="10"> + <group id="payments_pro_hosted_solution_es" extends="payment_all_paypal/payments_pro_hosted_solution_without_bml_and_paylater" sortOrder="10"> <label>Pasarela integral</label> </group> </group> @@ -369,7 +491,7 @@ <group id="express_checkout_other"/> <group id="paypal_group_all_in_one"> <group id="wps_other" sortOrder="12"/> - <group id="payments_pro_hosted_solution_hk" extends="payment_all_paypal/payments_pro_hosted_solution_without_bml" sortOrder="10"/> + <group id="payments_pro_hosted_solution_hk" extends="payment_all_paypal/payments_pro_hosted_solution_without_bml_and_paylater" sortOrder="10"/> </group> </section> <section id="payment_nz" extends="payment_other"> @@ -378,7 +500,12 @@ <group id="wps_other"/> </group> <group id="paypal_payment_gateways" showInDefault="1" showInWebsite="1" showInStore="1"> - <group id="paypal_payflowpro_nz" extends="payment_all_paypal/paypal_payflowpro"/> + <group id="paypal_payflowpro_nz" extends="payment_all_paypal/paypal_payflowpro"> + <group id="paypal_payflow_required"> + <field id="enable_paypal_paylater_experience" showInDefault="0" showInWebsite="0"/> + <group id="paypal_payflow_advertise_paylater" showInDefault="0" showInWebsite="0"/> + </group> + </group> </group> </section> </system> diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/express_checkout.xml b/app/code/Magento/Paypal/etc/adminhtml/system/express_checkout.xml index 2c5d669ccd9e..3389b072daff 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/express_checkout.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/express_checkout.xml @@ -13,7 +13,7 @@ <comment>Add PayPal as an additional payment method to your checkout page.</comment> <attribute type="activity_path">payment/paypal_express/active</attribute> <group id="configuration_details" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="4"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-express-checkout.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-express-checkout.html</comment> <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Hint</frontend_model> </group> <group id="express_checkout_required" translate="label" showInDefault="1" showInWebsite="1" sortOrder="10"> @@ -183,6 +183,18 @@ <field id="enable_express_checkout_bml">1</field> </depends> </field> + <field id="enable_paypal_paylater_experience" translate="label comment" type="select" sortOrder="27" showInDefault="1" showInWebsite="1"> + <label>Enable PayPal PayLater Experience</label> + <comment> + <![CDATA[Recommended. <strong>Advertise PayPal Credit</strong> is deprecated. + See PayPal PayLater details and list of supported regions + <a href="https://developer.paypal.com/docs/business/pay-later/us/#eligibility" target="_blank"> + here</a>.]]> + </comment> + <config_path>payment/paypal_paylater/experience_active</config_path> + <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> + <attribute type="shared">1</attribute> + </field> <group id="advertise_bml" translate="label comment" showInDefault="1" showInWebsite="1" sortOrder="30"> <label>Advertise PayPal Credit</label> <comment> @@ -193,6 +205,10 @@ The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% or more. <a href="https://financing.paypal.com/ppfinportal/content/forrester" target="_blank">See Details</a>.]]> </comment> + <fieldset_css>paypal-advertise-bml</fieldset_css> + <depends> + <field id="enable_paypal_paylater_experience">0</field> + </depends> <field id="bml_publisher_id" translate="label comment tooltip" showInDefault="1" showInWebsite="1" sortOrder="10"> <label>Publisher ID</label> <comment><![CDATA[Required to display a banner]]></comment> @@ -314,6 +330,473 @@ </field> </group> </group> + <group id="advertise_paylater" translate="label" showInDefault="1" showInWebsite="1" sortOrder="40"> + <label>Advertise PayPal PayLater</label> + <field id="paylater_enabled" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="10"> + <label>Enable PayPal PayLater</label> + <config_path>payment/paypal_paylater/enabled</config_path> + <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> + <attribute type="shared">1</attribute> + </field> + <depends> + <field id="enable_paypal_paylater_experience">1</field> + </depends> + <group id="settings_paylater_homepage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20"> + <label>Home Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_homepage_display" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="10"> + <label>Display</label> + <config_path>payment/paypal_paylater/homepage_display</config_path> + <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> + <attribute type="shared">1</attribute> + </field> + <field id="paylater_homepage_position" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="20"> + <label>Position</label> + <config_path>payment/paypal_paylater/homepage_position</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\Position::getPositionsHP</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_homepage_display">1</field> + </depends> + </field> + <field id="paylater_homepage_stylelayout" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="30"> + <label>Style Layout</label> + <config_path>payment/paypal_paylater/homepage_stylelayout</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\StyleLayout</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_homepage_display">1</field> + </depends> + </field> + <field id="paylater_homepage_logotype" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="40"> + <label>Logo Type</label> + <config_path>payment/paypal_paylater/homepage_logotype</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\LogoType</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_homepage_display">1</field> + <field id="paylater_homepage_stylelayout">text</field> + </depends> + </field> + <field id="paylater_homepage_logoposition" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="50"> + <label>Logo Position</label> + <config_path>payment/paypal_paylater/homepage_logoposition</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\LogoPosition</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_homepage_display">1</field> + <field id="paylater_homepage_stylelayout">text</field> + <field id="paylater_homepage_logotype" separator=",">primary,alternative</field> + </depends> + </field> + <field id="paylater_homepage_textcolor" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="60"> + <label>Text Color</label> + <config_path>payment/paypal_paylater/homepage_textcolor</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\TextColor</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_homepage_display">1</field> + <field id="paylater_homepage_stylelayout">text</field> + </depends> + </field> + <field id="paylater_homepage_textsize" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="70"> + <label>Text Size</label> + <config_path>payment/paypal_paylater/homepage_textsize</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\TextSize</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_homepage_display">1</field> + <field id="paylater_homepage_stylelayout">text</field> + </depends> + </field> + <field id="paylater_homepage_ratio" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="80"> + <label>Ratio</label> + <config_path>payment/paypal_paylater/homepage_ratio</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\Ratio</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_homepage_display">1</field> + <field id="paylater_homepage_stylelayout">flex</field> + </depends> + </field> + <field id="paylater_homepage_color" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="90"> + <label>Color</label> + <config_path>payment/paypal_paylater/homepage_color</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\Color</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_homepage_display">1</field> + <field id="paylater_homepage_stylelayout">flex</field> + </depends> + </field> + </group> + <group id="settings_paylater_productpage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="30"> + <label>Catalog Product Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_productpage_display" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="10"> + <label>Display</label> + <config_path>payment/paypal_paylater/productpage_display</config_path> + <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> + <attribute type="shared">1</attribute> + </field> + <field id="paylater_productpage_position" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="20"> + <label>Position</label> + <config_path>payment/paypal_paylater/productpage_position</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\Position::getPositionsCPP</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_productpage_display">1</field> + </depends> + </field> + <field id="paylater_productpage_stylelayout" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="30"> + <label>Style Layout</label> + <config_path>payment/paypal_paylater/productpage_stylelayout</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\StyleLayout</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_productpage_display">1</field> + </depends> + </field> + <field id="paylater_productpage_logotype" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="40"> + <label>Logo Type</label> + <config_path>payment/paypal_paylater/productpage_logotype</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\LogoType</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_productpage_display">1</field> + <field id="paylater_productpage_stylelayout">text</field> + </depends> + </field> + <field id="paylater_productpage_logoposition" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="50"> + <label>Logo Position</label> + <config_path>payment/paypal_paylater/productpage_logoposition</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\LogoPosition</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_productpage_display">1</field> + <field id="paylater_productpage_stylelayout">text</field> + <field id="paylater_productpage_logotype" separator=",">primary,alternative</field> + </depends> + </field> + <field id="paylater_productpage_textcolor" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="60"> + <label>Text Color</label> + <config_path>payment/paypal_paylater/productpage_textcolor</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\TextColor</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_productpage_display">1</field> + <field id="paylater_productpage_stylelayout">text</field> + </depends> + </field> + <field id="paylater_productpage_textsize" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="70"> + <label>Text Size</label> + <config_path>payment/paypal_paylater/productpage_textsize</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\TextSize</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_productpage_display">1</field> + <field id="paylater_productpage_stylelayout">text</field> + </depends> + </field> + <field id="paylater_productpage_ratio" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="80"> + <label>Ratio</label> + <config_path>payment/paypal_paylater/productpage_ratio</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\Ratio</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_productpage_display">1</field> + <field id="paylater_productpage_stylelayout">flex</field> + </depends> + </field> + <field id="paylater_productpage_color" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="90"> + <label>Color</label> + <config_path>payment/paypal_paylater/productpage_color</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\Color</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_productpage_display">1</field> + <field id="paylater_productpage_stylelayout">flex</field> + </depends> + </field> + </group> + <group id="settings_paylater_cartpage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="40"> + <label>Checkout Cart Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_cartpage_display" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="10"> + <label>Display</label> + <config_path>payment/paypal_paylater/cartpage_display</config_path> + <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> + <attribute type="shared">1</attribute> + </field> + <field id="paylater_cartpage_position" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="20"> + <label>Position</label> + <config_path>payment/paypal_paylater/cartpage_position</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\Position::getPositionsCart</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_cartpage_display">1</field> + </depends> + </field> + <field id="paylater_cartpage_stylelayout" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="30"> + <label>Style Layout</label> + <config_path>payment/paypal_paylater/cartpage_stylelayout</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\StyleLayout</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_cartpage_display">1</field> + </depends> + </field> + <field id="paylater_cartpage_logotype" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="40"> + <label>Logo Type</label> + <config_path>payment/paypal_paylater/cartpage_logotype</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\LogoType</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_cartpage_display">1</field> + <field id="paylater_cartpage_stylelayout">text</field> + </depends> + </field> + <field id="paylater_cartpage_logoposition" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="50"> + <label>Logo Position</label> + <config_path>payment/paypal_paylater/cartpage_logoposition</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\LogoPosition</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_cartpage_display">1</field> + <field id="paylater_cartpage_stylelayout">text</field> + <field id="paylater_cartpage_logotype" separator=",">primary,alternative</field> + </depends> + </field> + <field id="paylater_cartpage_textcolor" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="60"> + <label>Text Color</label> + <config_path>payment/paypal_paylater/cartpage_textcolor</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\TextColor</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_cartpage_display">1</field> + <field id="paylater_cartpage_stylelayout">text</field> + </depends> + </field> + <field id="paylater_cartpage_textsize" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="70"> + <label>Text Size</label> + <config_path>payment/paypal_paylater/cartpage_textsize</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\TextSize</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_cartpage_display">1</field> + <field id="paylater_cartpage_stylelayout">text</field> + </depends> + </field> + <field id="paylater_cartpage_ratio" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="80"> + <label>Ratio</label> + <config_path>payment/paypal_paylater/cartpage_ratio</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\Ratio</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_cartpage_display">1</field> + <field id="paylater_cartpage_stylelayout">flex</field> + </depends> + </field> + <field id="paylater_cartpage_color" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="90"> + <label>Color</label> + <config_path>payment/paypal_paylater/cartpage_color</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\Color</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_cartpage_display">1</field> + <field id="paylater_cartpage_stylelayout">flex</field> + </depends> + </field> + </group> + <group id="settings_paylater_checkout_payment" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="50"> + <label>Checkout Payment Step</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_checkout_payment_display" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="10"> + <label>Display</label> + <config_path>payment/paypal_paylater/checkout_payment_display</config_path> + <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> + <attribute type="shared">1</attribute> + </field> + <field id="paylater_checkout_payment_position" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="20"> + <label>Position</label> + <config_path>payment/paypal_paylater/checkout_payment_position</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\Position::getPositionsCheckout</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_checkout_payment_display">1</field> + </depends> + </field> + <field id="paylater_checkout_payment_stylelayout" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="30"> + <label>Style Layout</label> + <config_path>payment/paypal_paylater/checkout_payment_stylelayout</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\StyleLayout</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_checkout_payment_display">1</field> + </depends> + </field> + <field id="paylater_checkout_payment_logotype" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="40"> + <label>Logo Type</label> + <config_path>payment/paypal_paylater/checkout_payment_logotype</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\LogoType</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_checkout_payment_display">1</field> + <field id="paylater_checkout_payment_stylelayout">text</field> + </depends> + </field> + <field id="paylater_checkout_payment_logoposition" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="50"> + <label>Logo Position</label> + <config_path>payment/paypal_paylater/checkout_payment_logoposition</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\LogoPosition</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_checkout_payment_display">1</field> + <field id="paylater_checkout_payment_stylelayout">text</field> + <field id="paylater_checkout_payment_logotype" separator=",">primary,alternative</field> + </depends> + </field> + <field id="paylater_checkout_payment_textcolor" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="60"> + <label>Text Color</label> + <config_path>payment/paypal_paylater/checkout_payment_textcolor</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\TextColor</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_checkout_payment_display">1</field> + <field id="paylater_checkout_payment_stylelayout">text</field> + </depends> + </field> + <field id="paylater_checkout_payment_textsize" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="70"> + <label>Text Size</label> + <config_path>payment/paypal_paylater/checkout_payment_textsize</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\TextSize</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_checkout_payment_display">1</field> + <field id="paylater_checkout_payment_stylelayout">text</field> + </depends> + </field> + <field id="paylater_checkout_payment_ratio" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="80"> + <label>Ratio</label> + <config_path>payment/paypal_paylater/checkout_payment_ratio</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\Ratio</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_checkout_payment_display">1</field> + <field id="paylater_checkout_payment_stylelayout">flex</field> + </depends> + </field> + <field id="paylater_checkout_payment_color" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="90"> + <label>Color</label> + <config_path>payment/paypal_paylater/checkout_payment_color</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\Color</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_checkout_payment_display">1</field> + <field id="paylater_checkout_payment_stylelayout">flex</field> + </depends> + </field> + </group> + <group id="settings_paylater_categorypage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="60"> + <label>Catalog Category Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_categorypage_display" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="10"> + <label>Display</label> + <config_path>payment/paypal_paylater/categorypage_display</config_path> + <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> + <attribute type="shared">1</attribute> + </field> + <field id="paylater_categorypage_position" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="20"> + <label>Position</label> + <config_path>payment/paypal_paylater/categorypage_position</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\Position::getPositionsCategoryPage</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_categorypage_display">1</field> + </depends> + </field> + <field id="paylater_categorypage_stylelayout" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="30"> + <label>Style Layout</label> + <config_path>payment/paypal_paylater/categorypage_stylelayout</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\StyleLayout</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_categorypage_display">1</field> + </depends> + </field> + <field id="paylater_categorypage_logotype" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="40"> + <label>Logo Type</label> + <config_path>payment/paypal_paylater/categorypage_logotype</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\LogoType</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_categorypage_display">1</field> + <field id="paylater_categorypage_stylelayout">text</field> + </depends> + </field> + <field id="paylater_categorypage_logoposition" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="50"> + <label>Logo Position</label> + <config_path>payment/paypal_paylater/categorypage_logoposition</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\LogoPosition</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_categorypage_display">1</field> + <field id="paylater_categorypage_stylelayout">text</field> + <field id="paylater_categorypage_logotype" separator=",">primary,alternative</field> + </depends> + </field> + <field id="paylater_categorypage_textcolor" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="60"> + <label>Text Color</label> + <config_path>payment/paypal_paylater/categorypage_textcolor</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\TextColor</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_categorypage_display">1</field> + <field id="paylater_categorypage_stylelayout">text</field> + </depends> + </field> + <field id="paylater_categorypage_textsize" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="70"> + <label>Text Size</label> + <config_path>payment/paypal_paylater/categorypage_textsize</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\TextSize</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_categorypage_display">1</field> + <field id="paylater_categorypage_stylelayout">text</field> + </depends> + </field> + <field id="paylater_categorypage_ratio" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="80"> + <label>Ratio</label> + <config_path>payment/paypal_paylater/categorypage_ratio</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\Ratio</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_categorypage_display">1</field> + <field id="paylater_categorypage_stylelayout">flex</field> + </depends> + </field> + <field id="paylater_categorypage_color" translate="label" type="select" showInDefault="1" showInWebsite="1" sortOrder="90"> + <label>Color</label> + <config_path>payment/paypal_paylater/categorypage_color</config_path> + <source_model>Magento\Paypal\Model\System\Config\Source\PayLater\Color</source_model> + <attribute type="shared">1</attribute> + <depends> + <field id="paylater_categorypage_display">1</field> + <field id="paylater_categorypage_stylelayout">flex</field> + </depends> + </field> + </group> + </group> </group> <group id="settings_ec" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20"> <label>Basic Settings - PayPal Express Checkout</label> diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/payflow_advanced.xml b/app/code/Magento/Paypal/etc/adminhtml/system/payflow_advanced.xml index 1ae0b52146c3..ad5cf316a7a5 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/payflow_advanced.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/payflow_advanced.xml @@ -13,7 +13,7 @@ <comment><![CDATA[Accept payments with a PCI-compliant checkout that keeps customers on your site. (<u>Includes Express Checkout</u>)]]></comment> <attribute type="activity_path">payment/payflow_advanced/active</attribute> <group id="configuration_details" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="4"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payments-advanced.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payments-advanced.html</comment> <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Hint</frontend_model> </group> <group id="required_settings" translate="label" showInDefault="1" showInWebsite="1" sortOrder="10"> @@ -117,6 +117,7 @@ <field id="enable_express_checkout_bml">1</field> </depends> </field> + <field id="enable_paypal_paylater_experience" sortOrder="55" extends="payment_all_paypal/express_checkout/express_checkout_required/enable_paypal_paylater_experience"/> <group id="advanced_advertise_bml" showInDefault="1" showInWebsite="1" sortOrder="60" translate="label comment"> <label>Advertise PayPal Credit</label> <comment> @@ -127,6 +128,10 @@ The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% or more. <a href="https://financing.paypal.com/ppfinportal/content/forrester" target="_blank">See Details</a>.]]> </comment> + <depends> + <field id="enable_paypal_paylater_experience">0</field> + </depends> + <fieldset_css>paypal-advertise-bml</fieldset_css> <field id="bml_publisher_id" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_bml/bml_publisher_id" /> <field id="bml_wizard" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_bml/bml_wizard" /> <group id="advanced_settings_bml_homepage" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20" translate="label"> @@ -211,6 +216,88 @@ </field> </group> </group> + <group id="advanced_advertise_paylater" translate="label" showInDefault="1" showInWebsite="1" sortOrder="70"> + <label>Advertise PayPal PayLater</label> + <depends> + <field id="enable_paypal_paylater_experience">1</field> + </depends> + <field id="paylater_enabled" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/paylater_enabled" /> + <group id="advanced_settings_paylater_homepage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20"> + <label>Home Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_homepage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_display"/> + <field id="paylater_homepage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_position"/> + <field id="paylater_homepage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_stylelayout"/> + <field id="paylater_homepage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_logotype"/> + <field id="paylater_homepage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_logoposition"/> + <field id="paylater_homepage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_textcolor"/> + <field id="paylater_homepage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_textsize"/> + <field id="paylater_homepage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_ratio"/> + <field id="paylater_homepage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_color"/> + </group> + <group id="advanced_settings_paylater_productpage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="30"> + <label>Catalog Product Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_productpage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_display"/> + <field id="paylater_productpage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_position"/> + <field id="paylater_productpage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_stylelayout"/> + <field id="paylater_productpage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_logotype"/> + <field id="paylater_productpage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_logoposition"/> + <field id="paylater_productpage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_textcolor"/> + <field id="paylater_productpage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_textsize"/> + <field id="paylater_productpage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_ratio"/> + <field id="paylater_productpage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_color"/> + </group> + <group id="advanced_settings_paylater_cartpage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="40"> + <label>Checkout Cart Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_cartpage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_display"/> + <field id="paylater_cartpage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_position"/> + <field id="paylater_cartpage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_stylelayout"/> + <field id="paylater_cartpage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_logotype"/> + <field id="paylater_cartpage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_logoposition"/> + <field id="paylater_cartpage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_textcolor"/> + <field id="paylater_cartpage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_textsize"/> + <field id="paylater_cartpage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_ratio"/> + <field id="paylater_cartpage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_color"/> + </group> + <group id="advanced_settings_paylater_checkout_payment" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="50"> + <label>Checkout Payment Step</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_checkout_payment_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_display"/> + <field id="paylater_checkout_payment_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_position"/> + <field id="paylater_checkout_payment_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_stylelayout"/> + <field id="paylater_checkout_payment_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_logotype"/> + <field id="paylater_checkout_payment_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_logoposition"/> + <field id="paylater_checkout_payment_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_textcolor"/> + <field id="paylater_checkout_payment_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_textsize"/> + <field id="paylater_checkout_payment_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_ratio"/> + <field id="paylater_checkout_payment_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_color"/> + </group> + <group id="advanced_settings_paylater_categorypage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="60"> + <label>Catalog Category Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_categorypage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_display"/> + <field id="paylater_categorypage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_position"/> + <field id="paylater_categorypage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_stylelayout"/> + <field id="paylater_categorypage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_logotype"/> + <field id="paylater_categorypage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_logoposition"/> + <field id="paylater_categorypage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_textcolor"/> + <field id="paylater_categorypage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_textsize"/> + <field id="paylater_categorypage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_ratio"/> + <field id="paylater_categorypage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_color"/> + </group> + </group> </group> <group id="settings_payments_advanced" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20"> <label>Basic Settings - PayPal Payments Advanced</label> diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/payflow_link.xml b/app/code/Magento/Paypal/etc/adminhtml/system/payflow_link.xml index ead70eca3fad..8791720371a7 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/payflow_link.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/payflow_link.xml @@ -13,7 +13,7 @@ <comment><![CDATA[Connect your merchant account with a PCI-compliant gateway that lets customers pay without leaving your site. (<u>Includes Express Checkout</u>)]]></comment> <attribute type="activity_path">payment/payflow_link/active</attribute> <group id="configuration_details" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="4"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payflow-link.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payflow-link.html</comment> <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Hint</frontend_model> </group> <group id="payflow_link_required" translate="label" showInDefault="1" showInWebsite="1" sortOrder="10"> @@ -126,9 +126,7 @@ <field id="enable_express_checkout_bml">1</field> </depends> </field> - - - + <field id="enable_paypal_paylater_experience" sortOrder="55" extends="payment_all_paypal/express_checkout/express_checkout_required/enable_paypal_paylater_experience"/> <group id="payflow_link_advertise_bml" translate="label comment" showInDefault="1" showInWebsite="1" sortOrder="60"> <label>Advertise PayPal Credit</label> <comment> @@ -139,6 +137,10 @@ The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% or more. <a href="https://financing.paypal.com/ppfinportal/content/forrester" target="_blank">See Details</a>.]]> </comment> + <fieldset_css>paypal-advertise-bml</fieldset_css> + <depends> + <field id="enable_paypal_paylater_experience">0</field> + </depends> <field id="bml_publisher_id" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_bml/bml_publisher_id" /> <field id="bml_wizard" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_bml/bml_wizard" /> <group id="payflow_link_settings_bml_homepage" translate="label" showInWebsite="1" sortOrder="20" showInDefault="1" showInStore="1"> @@ -223,6 +225,88 @@ </field> </group> </group> + <group id="payflow_link_advertise_paylater" translate="label" showInDefault="1" showInWebsite="1" sortOrder="60"> + <label>Advertise PayPal Paylater</label> + <field id="paylater_enabled" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/paylater_enabled" /> + <depends> + <field id="enable_paypal_paylater_experience">1</field> + </depends> + <group id="payflow_link_settings_paylater_homepage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20"> + <label>Home Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_homepage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_display"/> + <field id="paylater_homepage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_position"/> + <field id="paylater_homepage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_stylelayout"/> + <field id="paylater_homepage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_logotype"/> + <field id="paylater_homepage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_logoposition"/> + <field id="paylater_homepage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_textcolor"/> + <field id="paylater_homepage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_textsize"/> + <field id="paylater_homepage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_ratio"/> + <field id="paylater_homepage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_color"/> + </group> + <group id="payflow_link_settings_paylater_productpage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="30"> + <label>Catalog Product Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_productpage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_display"/> + <field id="paylater_productpage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_position"/> + <field id="paylater_productpage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_stylelayout"/> + <field id="paylater_productpage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_logotype"/> + <field id="paylater_productpage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_logoposition"/> + <field id="paylater_productpage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_textcolor"/> + <field id="paylater_productpage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_textsize"/> + <field id="paylater_productpage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_ratio"/> + <field id="paylater_productpage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_color"/> + </group> + <group id="payflow_link_settings_paylater_cartpage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="40"> + <label>Checkout Cart Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_cartpage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_display"/> + <field id="paylater_cartpage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_position"/> + <field id="paylater_cartpage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_stylelayout"/> + <field id="paylater_cartpage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_logotype"/> + <field id="paylater_cartpage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_logoposition"/> + <field id="paylater_cartpage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_textcolor"/> + <field id="paylater_cartpage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_textsize"/> + <field id="paylater_cartpage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_ratio"/> + <field id="paylater_cartpage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_color"/> + </group> + <group id="payflow_link_settings_paylater_checkout_payment" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="50"> + <label>Checkout Payment Step</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_checkout_payment_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_display"/> + <field id="paylater_checkout_payment_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_position"/> + <field id="paylater_checkout_payment_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_stylelayout"/> + <field id="paylater_checkout_payment_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_logotype"/> + <field id="paylater_checkout_payment_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_logoposition"/> + <field id="paylater_checkout_payment_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_textcolor"/> + <field id="paylater_checkout_payment_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_textsize"/> + <field id="paylater_checkout_payment_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_ratio"/> + <field id="paylater_checkout_payment_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_color"/> + </group> + <group id="payflow_link_settings_paylater_categorypage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="60"> + <label>Catalog Category Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_categorypage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_display"/> + <field id="paylater_categorypage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_position"/> + <field id="paylater_categorypage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_stylelayout"/> + <field id="paylater_categorypage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_logotype"/> + <field id="paylater_categorypage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_logoposition"/> + <field id="paylater_categorypage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_textcolor"/> + <field id="paylater_categorypage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_textsize"/> + <field id="paylater_categorypage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_ratio"/> + <field id="paylater_categorypage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_color"/> + </group> + </group> </group> <group id="settings_payflow_link" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20"> <label>Basic Settings - PayPal Payflow Link</label> diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/payments_pro_hosted_solution.xml b/app/code/Magento/Paypal/etc/adminhtml/system/payments_pro_hosted_solution.xml index 727bffdaf27e..b89c483e4f7d 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/payments_pro_hosted_solution.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/payments_pro_hosted_solution.xml @@ -14,7 +14,7 @@ <comment><![CDATA[Accept payments with a PCI compliant checkout that keeps customers on your site. (<u>Includes Express Checkout</u>)]]></comment> <attribute type="paypal_ec_separate">1</attribute> <group id="configuration_details" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="4"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payments-pro.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payments-pro.html</comment> <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Hint</frontend_model> </group> <group id="pphs_required_settings" translate="label" showInDefault="1" showInWebsite="1" sortOrder="10"> @@ -45,7 +45,6 @@ </requires> <frontend_class>paypal-enabler paypal-ec-separate</frontend_class> </field> - <field id="enable_express_checkout_bml" extends="payment_all_paypal/express_checkout/express_checkout_required/enable_express_checkout_bml" sortOrder="21" showInDefault="1" showInWebsite="1"> <comment><![CDATA[Payments Pro Hosted Solution lets you give customers access to financing through PayPal Credit® - at no additional cost to you. You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with PayPal Credit®. @@ -55,7 +54,8 @@ <field id="pphs_enable"/> </requires> </field> - <group id="pphs_advertise_bml" translate="label comment" showInDefault="1" showInWebsite="1" sortOrder="22"> + <field id="enable_paypal_paylater_experience" sortOrder="22" extends="payment_all_paypal/express_checkout/express_checkout_required/enable_paypal_paylater_experience"/> + <group id="pphs_advertise_bml" translate="label comment" showInDefault="1" showInWebsite="1" sortOrder="23"> <label>Advertise PayPal Credit</label> <comment> <![CDATA[<a href="https://financing.paypal.com/ppfinportal/content/whyUseFinancing" target="_blank">Why Advertise Financing?</a><br/> @@ -65,6 +65,10 @@ The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% or more. <a href="https://financing.paypal.com/ppfinportal/content/forrester" target="_blank">See Details</a>.]]> </comment> + <fieldset_css>paypal-advertise-bml</fieldset_css> + <depends> + <field id="enable_paypal_paylater_experience">0</field> + </depends> <field id="bml_publisher_id" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_bml/bml_publisher_id" /> <field id="bml_wizard" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_bml/bml_wizard" /> <group id="pphs_settings_bml_homepage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20"> @@ -149,6 +153,88 @@ </field> </group> </group> + <group id="pphs_advertise_paylater" translate="label" showInDefault="1" showInWebsite="1" sortOrder="60"> + <label>Advertise PayPal Paylater</label> + <field id="paylater_enabled" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/paylater_enabled" /> + <depends> + <field id="enable_paypal_paylater_experience">1</field> + </depends> + <group id="pphs_settings_paylater_homepage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20"> + <label>Home Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_homepage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_display"/> + <field id="paylater_homepage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_position"/> + <field id="paylater_homepage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_stylelayout"/> + <field id="paylater_homepage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_logotype"/> + <field id="paylater_homepage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_logoposition"/> + <field id="paylater_homepage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_textcolor"/> + <field id="paylater_homepage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_textsize"/> + <field id="paylater_homepage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_ratio"/> + <field id="paylater_homepage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_color"/> + </group> + <group id="pphs_settings_paylater_productpage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="30"> + <label>Catalog Product Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_productpage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_display"/> + <field id="paylater_productpage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_position"/> + <field id="paylater_productpage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_stylelayout"/> + <field id="paylater_productpage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_logotype"/> + <field id="paylater_productpage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_logoposition"/> + <field id="paylater_productpage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_textcolor"/> + <field id="paylater_productpage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_textsize"/> + <field id="paylater_productpage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_ratio"/> + <field id="paylater_productpage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_color"/> + </group> + <group id="pphs_settings_paylater_cartpage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="40"> + <label>Checkout Cart Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_cartpage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_display"/> + <field id="paylater_cartpage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_position"/> + <field id="paylater_cartpage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_stylelayout"/> + <field id="paylater_cartpage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_logotype"/> + <field id="paylater_cartpage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_logoposition"/> + <field id="paylater_cartpage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_textcolor"/> + <field id="paylater_cartpage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_textsize"/> + <field id="paylater_cartpage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_ratio"/> + <field id="paylater_cartpage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_color"/> + </group> + <group id="pphs_settings_paylater_checkout_payment" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="50"> + <label>Checkout Payment Step</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_checkout_payment_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_display"/> + <field id="paylater_checkout_payment_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_position"/> + <field id="paylater_checkout_payment_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_stylelayout"/> + <field id="paylater_checkout_payment_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_logotype"/> + <field id="paylater_checkout_payment_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_logoposition"/> + <field id="paylater_checkout_payment_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_textcolor"/> + <field id="paylater_checkout_payment_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_textsize"/> + <field id="paylater_checkout_payment_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_ratio"/> + <field id="paylater_checkout_payment_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_color"/> + </group> + <group id="pphs_settings_paylater_categorypage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="60"> + <label>Catalog Category Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_categorypage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_display"/> + <field id="paylater_categorypage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_position"/> + <field id="paylater_categorypage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_stylelayout"/> + <field id="paylater_categorypage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_logotype"/> + <field id="paylater_categorypage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_logoposition"/> + <field id="paylater_categorypage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_textcolor"/> + <field id="paylater_categorypage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_textsize"/> + <field id="paylater_categorypage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_ratio"/> + <field id="paylater_categorypage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_color"/> + </group> + </group> </group> <group id="pphs_settings" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20"> <label>Basic Settings - PayPal Payments Pro Hosted Solution</label> diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro.xml b/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro.xml index 77ec9eb0d006..58cf10c653a3 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro.xml @@ -14,7 +14,7 @@ <attribute type="activity_path">payment/payflowpro/active</attribute> <attribute type="paypal_ec_separate">1</attribute> <group id="configuration_details" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="4"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payflow-pro.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payflow-pro.html</comment> <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Hint</frontend_model> </group> <group id="paypal_payflow_required" translate="label" showInDefault="1" showInWebsite="1" sortOrder="10"> @@ -94,6 +94,89 @@ <group id="paypal_payflow_api_settings"/> </requires> </field> + <field id="enable_paypal_paylater_experience" sortOrder="30" extends="payment_all_paypal/express_checkout/express_checkout_required/enable_paypal_paylater_experience"/> + <group id="paypal_payflow_advertise_paylater" translate="label" showInDefault="1" showInWebsite="1" sortOrder="40"> + <label>Advertise PayPal Paylater</label> + <field id="paylater_enabled" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/paylater_enabled" /> + <depends> + <field id="enable_paypal_paylater_experience">1</field> + </depends> + <group id="paypal_payflow_settings_paylater_homepage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20"> + <label>Home Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_homepage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_display"/> + <field id="paylater_homepage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_position"/> + <field id="paylater_homepage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_stylelayout"/> + <field id="paylater_homepage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_logotype"/> + <field id="paylater_homepage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_logoposition"/> + <field id="paylater_homepage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_textcolor"/> + <field id="paylater_homepage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_textsize"/> + <field id="paylater_homepage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_ratio"/> + <field id="paylater_homepage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_color"/> + </group> + <group id="paypal_payflow_settings_paylater_productpage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="30"> + <label>Catalog Product Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_productpage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_display"/> + <field id="paylater_productpage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_position"/> + <field id="paylater_productpage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_stylelayout"/> + <field id="paylater_productpage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_logotype"/> + <field id="paylater_productpage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_logoposition"/> + <field id="paylater_productpage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_textcolor"/> + <field id="paylater_productpage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_textsize"/> + <field id="paylater_productpage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_ratio"/> + <field id="paylater_productpage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_color"/> + </group> + <group id="paypal_payflow_settings_paylater_cartpage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="40"> + <label>Checkout Cart Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_cartpage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_display"/> + <field id="paylater_cartpage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_position"/> + <field id="paylater_cartpage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_stylelayout"/> + <field id="paylater_cartpage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_logotype"/> + <field id="paylater_cartpage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_logoposition"/> + <field id="paylater_cartpage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_textcolor"/> + <field id="paylater_cartpage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_textsize"/> + <field id="paylater_cartpage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_ratio"/> + <field id="paylater_cartpage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_color"/> + </group> + <group id="paypal_payflow_settings_paylater_checkout_payment" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="50"> + <label>Checkout Payment Step</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_checkout_payment_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_display"/> + <field id="paylater_checkout_payment_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_position"/> + <field id="paylater_checkout_payment_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_stylelayout"/> + <field id="paylater_checkout_payment_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_logotype"/> + <field id="paylater_checkout_payment_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_logoposition"/> + <field id="paylater_checkout_payment_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_textcolor"/> + <field id="paylater_checkout_payment_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_textsize"/> + <field id="paylater_checkout_payment_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_ratio"/> + <field id="paylater_checkout_payment_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_color"/> + </group> + <group id="paypal_payflow_settings_paylater_categorypage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="60"> + <label>Catalog Category Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_categorypage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_display"/> + <field id="paylater_categorypage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_position"/> + <field id="paylater_categorypage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_stylelayout"/> + <field id="paylater_categorypage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_logotype"/> + <field id="paylater_categorypage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_logoposition"/> + <field id="paylater_categorypage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_textcolor"/> + <field id="paylater_categorypage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_textsize"/> + <field id="paylater_categorypage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_ratio"/> + <field id="paylater_categorypage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_color"/> + </group> + </group> </group> <group id="settings_paypal_payflow" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20"> <label>Basic Settings - PayPal Payflow Pro</label> diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro_with_express_checkout.xml b/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro_with_express_checkout.xml index 694e517816b2..b205d4cfb9f1 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro_with_express_checkout.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro_with_express_checkout.xml @@ -50,6 +50,7 @@ <field id="enable_express_checkout_bml_payflow">1</field> </depends> </field> + <field id="enable_paypal_paylater_experience" sortOrder="35" extends="payment_all_paypal/express_checkout/express_checkout_required/enable_paypal_paylater_experience"/> <group id="paypal_payflow_advertise_bml" translate="label comment" showInDefault="1" showInWebsite="1" sortOrder="40"> <label>Advertise PayPal Credit</label> <comment> @@ -60,6 +61,10 @@ The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15% or more. <a href="https://financing.paypal.com/ppfinportal/content/forrester" target="_blank">See Details</a>.]]> </comment> + <fieldset_css>paypal-advertise-bml</fieldset_css> + <depends> + <field id="enable_paypal_paylater_experience">0</field> + </depends> <field id="bml_publisher_id" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_bml/bml_publisher_id" /> <field id="bml_wizard" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_bml/bml_wizard" /> <group id="paypal_payflow_settings_bml_homepage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20"> @@ -144,6 +149,88 @@ </field> </group> </group> + <group id="paypal_payflow_advertise_paylater" translate="label" showInDefault="1" showInWebsite="1" sortOrder="60"> + <label>Advertise PayPal Paylater</label> + <field id="paylater_enabled" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/paylater_enabled" /> + <depends> + <field id="enable_paypal_paylater_experience">1</field> + </depends> + <group id="paypal_payflow_settings_paylater_homepage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20"> + <label>Home Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_homepage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_display"/> + <field id="paylater_homepage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_position"/> + <field id="paylater_homepage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_stylelayout"/> + <field id="paylater_homepage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_logotype"/> + <field id="paylater_homepage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_logoposition"/> + <field id="paylater_homepage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_textcolor"/> + <field id="paylater_homepage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_textsize"/> + <field id="paylater_homepage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_ratio"/> + <field id="paylater_homepage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_homepage/paylater_homepage_color"/> + </group> + <group id="paypal_payflow_settings_paylater_productpage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="30"> + <label>Catalog Product Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_productpage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_display"/> + <field id="paylater_productpage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_position"/> + <field id="paylater_productpage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_stylelayout"/> + <field id="paylater_productpage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_logotype"/> + <field id="paylater_productpage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_logoposition"/> + <field id="paylater_productpage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_textcolor"/> + <field id="paylater_productpage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_textsize"/> + <field id="paylater_productpage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_ratio"/> + <field id="paylater_productpage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_productpage/paylater_productpage_color"/> + </group> + <group id="paypal_payflow_settings_paylater_cartpage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="40"> + <label>Checkout Cart Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_cartpage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_display"/> + <field id="paylater_cartpage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_position"/> + <field id="paylater_cartpage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_stylelayout"/> + <field id="paylater_cartpage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_logotype"/> + <field id="paylater_cartpage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_logoposition"/> + <field id="paylater_cartpage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_textcolor"/> + <field id="paylater_cartpage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_textsize"/> + <field id="paylater_cartpage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_ratio"/> + <field id="paylater_cartpage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_cartpage/paylater_cartpage_color"/> + </group> + <group id="paypal_payflow_settings_paylater_checkout_payment" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="50"> + <label>Checkout Payment Step</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_checkout_payment_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_display"/> + <field id="paylater_checkout_payment_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_position"/> + <field id="paylater_checkout_payment_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_stylelayout"/> + <field id="paylater_checkout_payment_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_logotype"/> + <field id="paylater_checkout_payment_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_logoposition"/> + <field id="paylater_checkout_payment_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_textcolor"/> + <field id="paylater_checkout_payment_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_textsize"/> + <field id="paylater_checkout_payment_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_ratio"/> + <field id="paylater_checkout_payment_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_checkout_payment/paylater_checkout_payment_color"/> + </group> + <group id="paypal_payflow_settings_paylater_categorypage" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="60"> + <label>Catalog Category Page</label> + <depends> + <field id="paylater_enabled">1</field> + </depends> + <field id="paylater_categorypage_display" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_display"/> + <field id="paylater_categorypage_position" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_position"/> + <field id="paylater_categorypage_stylelayout" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_stylelayout"/> + <field id="paylater_categorypage_logotype" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_logotype"/> + <field id="paylater_categorypage_logoposition" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_logoposition"/> + <field id="paylater_categorypage_textcolor" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_textcolor"/> + <field id="paylater_categorypage_textsize" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_textsize"/> + <field id="paylater_categorypage_ratio" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_ratio"/> + <field id="paylater_categorypage_color" translate="label" extends="payment_all_paypal/express_checkout/express_checkout_required/advertise_paylater/settings_paylater_categorypage/paylater_categorypage_color"/> + </group> + </group> </group> <group id="settings_paypal_payflow" translate="label"> <group id="settings_paypal_payflow_advanced" translate="label"> diff --git a/app/code/Magento/Paypal/etc/config.xml b/app/code/Magento/Paypal/etc/config.xml index f93572537ffd..e3b4b0b43c28 100644 --- a/app/code/Magento/Paypal/etc/config.xml +++ b/app/code/Magento/Paypal/etc/config.xml @@ -187,6 +187,41 @@ <display_ec>0</display_ec> <verify_peer>1</verify_peer> </hosted_pro> + <paypal_paylater> + <experience_active>0</experience_active> + <enabled>0</enabled> + <productpage_display>0</productpage_display> + <productpage_position>header</productpage_position> + <productpage_stylelayout>text</productpage_stylelayout> + <productpage_logotype>primary</productpage_logotype> + <productpage_logoposition>left</productpage_logoposition> + <productpage_textcolor>black</productpage_textcolor> + <productpage_textsize>12</productpage_textsize> + <categorypage_display>0</categorypage_display> + <categorypage_position>header</categorypage_position> + <categorypage_stylelayout>flex</categorypage_stylelayout> + <categorypage_color>blue</categorypage_color> + <categorypage_ratio>20x1</categorypage_ratio> + <homepage_display>0</homepage_display> + <homepage_position>header</homepage_position> + <homepage_stylelayout>flex</homepage_stylelayout> + <homepage_ratio>1x1</homepage_ratio> + <homepage_color>blue</homepage_color> + <checkout_payment_display>0</checkout_payment_display> + <checkout_payment_position>header</checkout_payment_position> + <checkout_payment_stylelayout>text</checkout_payment_stylelayout> + <checkout_payment_logotype>primary</checkout_payment_logotype> + <checkout_payment_logoposition>left</checkout_payment_logoposition> + <checkout_payment_textcolor>black</checkout_payment_textcolor> + <checkout_payment_textsize>12</checkout_payment_textsize> + <cartpage_display>0</cartpage_display> + <cartpage_position>header</cartpage_position> + <cartpage_stylelayout>text</cartpage_stylelayout> + <cartpage_logotype>primary</cartpage_logotype> + <cartpage_logoposition>left</cartpage_logoposition> + <cartpage_textcolor>black</cartpage_textcolor> + <cartpage_textsize>12</cartpage_textsize> + </paypal_paylater> </payment> </default> </config> diff --git a/app/code/Magento/Paypal/etc/csp_whitelist.xml b/app/code/Magento/Paypal/etc/csp_whitelist.xml index 932664bde9e0..ee83e2864ab8 100644 --- a/app/code/Magento/Paypal/etc/csp_whitelist.xml +++ b/app/code/Magento/Paypal/etc/csp_whitelist.xml @@ -25,10 +25,25 @@ <value id="paypal_analytics" type="host">t.paypal.com</value> </values> </policy> + <policy id="connect-src"> + <values> + <value id="www_sandbox_paypal" type="host">www.sandbox.paypal.com</value> + <value id="paypal_objects" type="host">www.paypalobjects.com</value> + <value id="www_paypal" type="host">www.paypal.com</value> + </values> + </policy> <policy id="frame-src"> <values> <value id="www_paypal" type="host">www.paypal.com</value> <value id="www_sandbox_paypal" type="host">www.sandbox.paypal.com</value> + <value id="pilot_payflowlink_paypal_com" type="host">pilot-payflowlink.paypal.com</value> + </values> + </policy> + <policy id="form-action"> + <values> + <value id="www_paypal" type="host">www.paypal.com</value> + <value id="www_sandbox_paypal" type="host">www.sandbox.paypal.com</value> + <value id="pilot_payflowlink_paypal_com" type="host">pilot-payflowlink.paypal.com</value> </values> </policy> </policies> diff --git a/app/code/Magento/Paypal/etc/frontend/di.xml b/app/code/Magento/Paypal/etc/frontend/di.xml index ac3fccff39f7..0c6741fdc439 100644 --- a/app/code/Magento/Paypal/etc/frontend/di.xml +++ b/app/code/Magento/Paypal/etc/frontend/di.xml @@ -158,6 +158,19 @@ <item name="label" xsi:type="string">buynow</item> </item> </argument> + <argument name="localeResolver" xsi:type="object">Magento\Paypal\Model\Express\LocaleResolver</argument> + </arguments> + </type> + <type name="Magento\Paypal\Block\Express\InContext\Component"> + <arguments> + <argument name="localeResolver" xsi:type="object">Magento\Paypal\Model\Express\LocaleResolver</argument> + </arguments> + </type> + <type name="Magento\Checkout\Controller\Index\Index"> + <plugin name="sdk_url_configuration" type="Magento\Paypal\Plugin\CheckoutIndex" /> + </type> + <type name="Magento\Paypal\Model\SdkUrl"> + <arguments> <argument name="disallowedFundingMap" xsi:type="array"> <item name="CREDIT" xsi:type="string">credit</item> <item name="CARD" xsi:type="string">card</item> @@ -176,9 +189,11 @@ <argument name="localeResolver" xsi:type="object">Magento\Paypal\Model\Express\LocaleResolver</argument> </arguments> </type> - <type name="Magento\Paypal\Block\Express\InContext\Component"> + <type name="Magento\Checkout\Block\Onepage"> <arguments> - <argument name="localeResolver" xsi:type="object">Magento\Paypal\Model\Express\LocaleResolver</argument> + <argument name="layoutProcessors" xsi:type="array"> + <item name="payLater" xsi:type="object">Magento\Paypal\Block\PayLater\LayoutProcessor</item> + </argument> </arguments> </type> </config> diff --git a/app/code/Magento/Paypal/i18n/en_US.csv b/app/code/Magento/Paypal/i18n/en_US.csv index a8f26b422dc7..ba80baf49b7b 100644 --- a/app/code/Magento/Paypal/i18n/en_US.csv +++ b/app/code/Magento/Paypal/i18n/en_US.csv @@ -738,3 +738,30 @@ User,User "Order is suspended as an account verification transaction is suspected to be fraudulent.","Order is suspended as an account verification transaction is suspected to be fraudulent." "Payment can't be accepted since transaction was rejected by merchant.","Payment can't be accepted since transaction was rejected by merchant." "A successful payment transaction has already been completed. Please, check if the order has been placed.","A successful payment transaction has already been completed. Please, check if the order has been placed." +"Advertise PayPal PayLater","Advertise PayPal PayLater" +"Enable PayPal PayLater","Enable PayPal PayLater" +"Style Layout","Style Layout" +"Logo Type","Logo Type" +"Logo Position","Logo Position" +"Text Color","Text Color" +"Text Size","Text Size" +"Ratio","Ratio" +"White","White" +"White No Border","White No Border" +"Gray","Gray" +"Left","Left" +"Right","Right" +"Top","Top" +"Primary","Primary" +"Alternative","Alternative" +"Inline","Inline" +"None","None" +"Text","Text" +"Flex","Flex" +"Display pay later messaging on your site for offers like Pay in 3, which lets customers pay with 3 interest- free monthly payments. We’ll show messages on your site to promote this feature for you. You may not promote pay later offers with any other content, marketing, or materials","Display pay later messaging on your site for offers like Pay in 3, which lets customers pay with 3 interest- free monthly payments. We’ll show messages on your site to promote this feature for you. You may not promote pay later offers with any other content, marketing, or materials" +"Enable PayPal PayLater Experience","Enable PayPal PayLater Experience" +"Recommended. <strong>Advertise PayPal Credit</strong> is deprecated. See PayPal PayLater details and list of supported regions <a href="https://developer.paypal.com/docs/business/pay-later/us/#eligibility" target="_blank">here</a>.","Recommended. <strong>Advertise PayPal Credit</strong> is deprecated. See PayPal PayLater details and list of supported regions <a href="https://developer.paypal.com/docs/business/pay-later/us/#eligibility" target="_blank">here</a>.Recommended. <strong>Advertise PayPal Credit</strong> is deprecated. See PayPal PayLater details and list of supported regions <a href="https://developer.paypal.com/docs/business/pay-later/us/#eligibility" target="_blank">here</a>." +"Monochrome","Monochrome" +"Grayscale","Grayscale" +"Sidebar","Sidebar" +"Checkout Payment Step","Checkout Payment Step" diff --git a/app/code/Magento/Paypal/view/adminhtml/web/js/rules.js b/app/code/Magento/Paypal/view/adminhtml/web/js/rules.js index 555d2a80a861..4a8b5272a724 100644 --- a/app/code/Magento/Paypal/view/adminhtml/web/js/rules.js +++ b/app/code/Magento/Paypal/view/adminhtml/web/js/rules.js @@ -161,7 +161,7 @@ define([ var solutionConfiguration = solution.find(buttonConfiguration); unlock || typeof unlock === 'undefined' ? - solutionConfiguration.removeClass('disabled').removeAttr('disabled') : + solutionConfiguration.removeClass('disabled').prop('disabled', false) : solutionConfiguration.addClass('disabled').attr('disabled', 'disabled'); }, diff --git a/app/code/Magento/Paypal/view/adminhtml/web/js/solutions.js b/app/code/Magento/Paypal/view/adminhtml/web/js/solutions.js index d6efcae9cfc9..95e794e39b26 100644 --- a/app/code/Magento/Paypal/view/adminhtml/web/js/solutions.js +++ b/app/code/Magento/Paypal/view/adminhtml/web/js/solutions.js @@ -75,7 +75,7 @@ define([ */ wipeButtonsConfiguration: function () { $(this.buttonConfiguration).removeClass('disabled') - .removeAttr('disabled'); + .prop('disabled', false); }, /** diff --git a/app/code/Magento/Paypal/view/adminhtml/web/styles.css b/app/code/Magento/Paypal/view/adminhtml/web/styles.css index ee0bb1d0c420..ea12ad19f460 100644 --- a/app/code/Magento/Paypal/view/adminhtml/web/styles.css +++ b/app/code/Magento/Paypal/view/adminhtml/web/styles.css @@ -35,3 +35,4 @@ .paypal-recommended-header > .admin__collapsible-block > a::before {content: '' !important; width: 0; height: 0; border-color: transparent; border-top-color: #000; border-style: solid; border-width: .8rem .5rem 0 .5rem; margin-top:1px; transition: all .2s linear;} .payments-other-header > .admin__collapsible-block > a.open::before, .paypal-recommended-header > .admin__collapsible-block > a.open::before {border-color: transparent; border-bottom-color: #000; border-width: 0 .5rem .8rem .5rem;} +.paypal-advertise-bml {border-bottom-color: transparent; padding-bottom: 0;} diff --git a/app/code/Magento/Paypal/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/Paypal/view/frontend/layout/catalog_category_view.xml index 42165d035d30..4113c882d7a6 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/catalog_category_view.xml @@ -15,6 +15,13 @@ <argument name="position" xsi:type="number">1</argument> </arguments> </block> + <block class="Magento\Paypal\Block\PayLater\Banner" name="sidebar.banner.paylater" + template="Magento_Paypal::paylater/banner.phtml"> + <arguments> + <argument name="placement" xsi:type="string">category</argument> + <argument name="position" xsi:type="string">sidebar</argument> + </arguments> + </block> </referenceContainer> <referenceContainer name="top.container"> <block class="Magento\Paypal\Block\Bml\Banners" name="bml.center.logo" template="Magento_Paypal::bml.phtml"> @@ -23,6 +30,13 @@ <argument name="position" xsi:type="number">0</argument> </arguments> </block> + <block class="Magento\Paypal\Block\PayLater\Banner" name="top.banner.paylater" + template="Magento_Paypal::paylater/banner.phtml"> + <arguments> + <argument name="placement" xsi:type="string">category</argument> + <argument name="position" xsi:type="string">header</argument> + </arguments> + </block> </referenceContainer> </body> </page> diff --git a/app/code/Magento/Paypal/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/Paypal/view/frontend/layout/catalog_product_view.xml index 43bbcb643a05..f71263325c67 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/catalog_product_view.xml @@ -14,6 +14,27 @@ <argument name="position" xsi:type="number">0</argument> </arguments> </block> + <block class="Magento\Paypal\Block\PayLater\Banner" name="top.container.paylater" + template="Magento_Paypal::paylater/banner.phtml"> + <arguments> + <argument name="placement" xsi:type="string">product</argument> + <argument name="position" xsi:type="string">header</argument> + <argument name="jsLayout" xsi:type="array"> + <item name="components" xsi:type="array"> + <item name="payLater" xsi:type="array"> + <item name="config" xsi:type="array"> + <item name="displayAmount" xsi:type="boolean">true</item> + <item name="amountComponentConfig" xsi:type="array"> + <item name="component" xsi:type="string"> + Magento_Paypal/js/view/amountProviders/product + </item> + </item> + </item> + </item> + </item> + </argument> + </arguments> + </block> </referenceContainer> <referenceContainer name="product.info.addtocart"> <block class="Magento\Paypal\Block\Bml\Banners" name="bml.right.logo" template="Magento_Paypal::bml.phtml"> @@ -22,6 +43,50 @@ <argument name="position" xsi:type="number">1</argument> </arguments> </block> + <block class="Magento\Paypal\Block\PayLater\Banner" name="product.info.addtocart.paylater" + template="Magento_Paypal::paylater/banner.phtml"> + <arguments> + <argument name="placement" xsi:type="string">product</argument> + <argument name="position" xsi:type="string">near_pp_button</argument> + <argument name="jsLayout" xsi:type="array"> + <item name="components" xsi:type="array"> + <item name="payLater" xsi:type="array"> + <item name="config" xsi:type="array"> + <item name="displayAmount" xsi:type="boolean">true</item> + <item name="amountComponentConfig" xsi:type="array"> + <item name="component" xsi:type="string"> + Magento_Paypal/js/view/amountProviders/product + </item> + </item> + </item> + </item> + </item> + </argument> + </arguments> + </block> </referenceContainer> + <referenceBlock name="product.info.addtocart.additional"> + <block class="Magento\Paypal\Block\PayLater\Banner" name="product.info.addtocart.additional.paylater" + template="Magento_Paypal::paylater/banner.phtml"> + <arguments> + <argument name="placement" xsi:type="string">product</argument> + <argument name="position" xsi:type="string">near_pp_button</argument> + <argument name="jsLayout" xsi:type="array"> + <item name="components" xsi:type="array"> + <item name="payLater" xsi:type="array"> + <item name="config" xsi:type="array"> + <item name="displayAmount" xsi:type="boolean">true</item> + <item name="amountComponentConfig" xsi:type="array"> + <item name="component" xsi:type="string"> + Magento_Paypal/js/view/amountProviders/product + </item> + </item> + </item> + </item> + </item> + </argument> + </arguments> + </block> + </referenceBlock> </body> </page> diff --git a/app/code/Magento/Paypal/view/frontend/layout/catalog_product_view_type_bundle.xml b/app/code/Magento/Paypal/view/frontend/layout/catalog_product_view_type_bundle.xml new file mode 100644 index 000000000000..167c07a88111 --- /dev/null +++ b/app/code/Magento/Paypal/view/frontend/layout/catalog_product_view_type_bundle.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <body> + <referenceBlock name="product.info.addtocart.bundle"> + <block class="Magento\Paypal\Block\PayLater\Banner" name="product.info.addtocart.additional.paylater" + template="Magento_Paypal::paylater/banner.phtml"> + <arguments> + <argument name="placement" xsi:type="string">product</argument> + <argument name="position" xsi:type="string">near_pp_button</argument> + <argument name="jsLayout" xsi:type="array"> + <item name="components" xsi:type="array"> + <item name="payLater" xsi:type="array"> + <item name="config" xsi:type="array"> + <item name="refreshSelector" xsi:type="string">#bundle-slide</item> + </item> + </item> + </item> + </argument> + </arguments> + </block> + </referenceBlock> + </body> +</page> diff --git a/app/code/Magento/Paypal/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Paypal/view/frontend/layout/checkout_cart_index.xml index f57d3af72f17..505668ed6c94 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/checkout_cart_index.xml @@ -14,6 +14,27 @@ <argument name="position" xsi:type="number">0</argument> </arguments> </block> + <block class="Magento\Paypal\Block\PayLater\Banner" name="top.container.paylater" + template="Magento_Paypal::paylater/banner.phtml"> + <arguments> + <argument name="placement" xsi:type="string">cart</argument> + <argument name="position" xsi:type="string">header</argument> + <argument name="jsLayout" xsi:type="array"> + <item name="components" xsi:type="array"> + <item name="payLater" xsi:type="array"> + <item name="config" xsi:type="array"> + <item name="displayAmount" xsi:type="boolean">true</item> + <item name="amountComponentConfig" xsi:type="array"> + <item name="component" xsi:type="string"> + Magento_Paypal/js/view/amountProviders/checkout + </item> + </item> + </item> + </item> + </item> + </argument> + </arguments> + </block> </referenceContainer> <referenceContainer name="checkout.cart.methods"> <block class="Magento\Paypal\Block\Bml\Banners" name="bml.right.logo" after="checkout.cart.methods.onepage.bottom" template="Magento_Paypal::bml.phtml"> @@ -22,6 +43,28 @@ <argument name="position" xsi:type="number">1</argument> </arguments> </block> + <block class="Magento\Paypal\Block\PayLater\Banner" name="paylater.right.logo" + after="checkout.cart.methods.onepage.bottom" + template="Magento_Paypal::paylater/banner.phtml"> + <arguments> + <argument name="placement" xsi:type="string">cart</argument> + <argument name="position" xsi:type="string">near_pp_button</argument> + <argument name="jsLayout" xsi:type="array"> + <item name="components" xsi:type="array"> + <item name="payLater" xsi:type="array"> + <item name="config" xsi:type="array"> + <item name="displayAmount" xsi:type="boolean">true</item> + <item name="amountComponentConfig" xsi:type="array"> + <item name="component" xsi:type="string"> + Magento_Paypal/js/view/amountProviders/checkout + </item> + </item> + </item> + </item> + </item> + </argument> + </arguments> + </block> </referenceContainer> </body> </page> diff --git a/app/code/Magento/Paypal/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Paypal/view/frontend/layout/checkout_index_index.xml index ebf38dd2d994..4142640f802c 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/checkout_index_index.xml @@ -23,6 +23,19 @@ <item name="children" xsi:type="array"> <item name="payment" xsi:type="array"> <item name="children" xsi:type="array"> + <item name="payments-list" xsi:type="array"> + <item name="children" xsi:type="array"> + <item name="before-place-order" xsi:type="array"> + <item name="children" xsi:type="array"> + <item name="paylater-place-order" xsi:type="array"> + <item name="component" xsi:type="string">Magento_Paypal/js/view/paylater</item> + <item name="sortOrder" xsi:type="string">100</item> + <item name="displayArea" xsi:type="string">before-place-order</item> + </item> + </item> + </item> + </item> + </item> <item name="renders" xsi:type="array"> <!-- merge payment method renders here --> <item name="children" xsi:type="array"> diff --git a/app/code/Magento/Paypal/view/frontend/layout/cms_index_index.xml b/app/code/Magento/Paypal/view/frontend/layout/cms_index_index.xml index 39c4844daa40..03f1b9cfa7d1 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/cms_index_index.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/cms_index_index.xml @@ -15,6 +15,13 @@ <argument name="position" xsi:type="number">1</argument> </arguments> </block> + <block class="Magento\Paypal\Block\PayLater\Banner" name="sidebar.container.paylater" + template="Magento_Paypal::paylater/banner.phtml"> + <arguments> + <argument name="placement" xsi:type="string">home</argument> + <argument name="position" xsi:type="string">sidebar</argument> + </arguments> + </block> </referenceContainer> <referenceContainer name="top.container"> <block class="Magento\Paypal\Block\Bml\Banners" name="bml.center.logo" template="Magento_Paypal::bml.phtml"> @@ -23,6 +30,13 @@ <argument name="position" xsi:type="number">0</argument> </arguments> </block> + <block class="Magento\Paypal\Block\PayLater\Banner" name="top.container.paylater" + template="Magento_Paypal::paylater/banner.phtml"> + <arguments> + <argument name="placement" xsi:type="string">home</argument> + <argument name="position" xsi:type="string">header</argument> + </arguments> + </block> </referenceContainer> </body> </page> diff --git a/app/code/Magento/Paypal/view/frontend/templates/billing/agreement/view.phtml b/app/code/Magento/Paypal/view/frontend/templates/billing/agreement/view.phtml index 40f56fb94626..904082a30a08 100644 --- a/app/code/Magento/Paypal/view/frontend/templates/billing/agreement/view.phtml +++ b/app/code/Magento/Paypal/view/frontend/templates/billing/agreement/view.phtml @@ -21,7 +21,7 @@ $relatedOrders = $block->getRelatedOrders(); "cancelUrl" : "<?= $block->escapeUrl($block->getCancelUrl()) ?>" }}' type="button" title="<?= $block->escapeHtml(__('Cancel')) ?>" - class="secondary action cancel" /> + class="secondary action cancel"> <span><?= $block->escapeHtml(__('Cancel')) ?></span> </button> <?php endif; ?> diff --git a/app/code/Magento/Paypal/view/frontend/templates/express/review.phtml b/app/code/Magento/Paypal/view/frontend/templates/express/review.phtml index 69c7c8179850..afd1e91c6e58 100644 --- a/app/code/Magento/Paypal/view/frontend/templates/express/review.phtml +++ b/app/code/Magento/Paypal/view/frontend/templates/express/review.phtml @@ -4,9 +4,14 @@ * See COPYING.txt for license details. */ +use Magento\Framework\Escaper; +use Magento\Framework\View\Helper\SecureHtmlRenderer; +use Magento\Paypal\Block\Express\Review; + /** - * @var \Magento\Paypal\Block\Express\Review $block - * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer + * @var Review $block + * @var Escaper $escaper + * @var SecureHtmlRenderer $secureRenderer */ ?> <div class="paypal-review view"> @@ -15,11 +20,11 @@ <?php if ($block->getShippingAddress()): ?> <div class="box box-order-shipping-method"> <strong class="box-title"> - <span><?= $block->escapeHtml(__('Shipping Method')) ?></span> + <span><?= $escaper->escapeHtml(__('Shipping Method')) ?></span> </strong> <div class="box-content"> <form method="post" id="shipping-method-form" - action="<?= $block->escapeUrl($block->getShippingMethodSubmitUrl()) ?>" + action="<?= $escaper->escapeUrl($block->getShippingMethodSubmitUrl()) ?>" class="form"> <?php if ($block->canEditShippingMethod()): ?> <?php if ($groups = $block->getShippingRateGroups()): ?> @@ -28,11 +33,14 @@ <select name="shipping_method" id="shipping-method" class="select"> <?php if (!$currentRate): ?> <option value=""> - <?= $block->escapeHtml(__('Please select a shipping method...')); ?> + <?= $escaper->escapeHtml( + __('Please select a shipping method...') + ); ?> </option> <?php endif; ?> <?php foreach ($groups as $code => $rates): ?> - <optgroup label="<?= $block->escapeHtml($block->getCarrierName($code)); + <optgroup label="<?= + $escaper->escapeHtml($block->getCarrierName($code)); ?>"> <?php foreach ($rates as $rate): ?> <option value="<?= @@ -51,19 +59,10 @@ <?php endforeach; ?> </select> </div> - <div class="actions-toolbar"> - <div class="primary"> - <button id="update-shipping-method-submit" type="submit" - class="action update primary"> - <span> - <?= $block->escapeHtml(__('Update Shipping Method')) ?> - </span> - </button> - </div> - </div> + <div class="actions-toolbar"></div> <?php else: ?> <p> - <?= $block->escapeHtml(__( + <?= $escaper->escapeHtml(__( 'Sorry, no quotes are available for this order right now.' )); ?> </p> @@ -80,40 +79,40 @@ </div> <div class="box box-order-shipping-address"> <strong class="box-title"> - <span><?= $block->escapeHtml(__('Shipping Address')) ?></span> + <span><?= $escaper->escapeHtml(__('Shipping Address')) ?></span> </strong> <div class="box-content"> <address> - <?= $block->escapeHtml( + <?= $escaper->escapeHtml( $block->renderAddress($block->getShippingAddress()), ['br'] - );?> + ); ?> </address> </div> <?php if ($block->getCanEditShippingAddress()): ?> <div class="box-actions"> - <a href="<?= $block->escapeUrl($block->getEditUrl()) ?>" class="action edit"> - <span><?= $block->escapeHtml(__('Edit')) ?></span> + <a href="<?= $escaper->escapeUrl($block->getEditUrl()) ?>" class="action edit"> + <span><?= $escaper->escapeHtml(__('Edit')) ?></span> </a> </div> <?php endif; ?> </div> <?php endif; ?> <div class="box box-order-billing-address"> - <strong class="box-title"><span><?= $block->escapeHtml(__('Payment Method')) ?></span></strong> + <strong class="box-title"><span><?= $escaper->escapeHtml(__('Payment Method')) ?></span></strong> <div class="box-content"> - <?= $block->escapeHtml($block->getPaymentMethodTitle()) ?><br> - <?= $block->escapeHtml($block->getEmail()) ?> <br> + <?= $escaper->escapeHtml($block->getPaymentMethodTitle()) ?><br> + <?= $escaper->escapeHtml($block->getEmail()) ?> <br> <img src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-medium.png" alt="<?= $block->escapeHtml(__('Buy now with PayPal')) ?>"/> </div> - <?php if ($block->getEditUrl()): ?> - <div class="box-actions"> - <a href="<?= $block->escapeUrl($block->getEditUrl()) ?>" class="action edit"> - <span><?= $block->escapeHtml(__('Edit Payment Information')) ?></span> - </a> - </div> - <?php endif ?> + <?php if ($block->getEditUrl()): ?> + <div class="box-actions"> + <a href="<?= $escaper->escapeUrl($block->getEditUrl()) ?>" class="action edit"> + <span><?= $escaper->escapeHtml(__('Edit Payment Information')) ?></span> + </a> + </div> + <?php endif ?> </div> </div> </div> @@ -124,29 +123,29 @@ <div class="paypal-review-items"> <div class="paypal-review-title"> - <strong><?= $block->escapeHtml(__('Items in Your Shopping Cart')) ?></strong> - <a href="<?= $block->escapeUrl($block->getUrl('checkout/cart')) ?>" class="action edit"> - <span><?= $block->escapeHtml(__('Edit Shopping Cart')) ?></span> + <strong><?= $escaper->escapeHtml(__('Items in Your Shopping Cart')) ?></strong> + <a href="<?= $escaper->escapeUrl($block->getUrl('checkout/cart')) ?>" class="action edit"> + <span><?= $escaper->escapeHtml(__('Edit Shopping Cart')) ?></span> </a> </div> <?= $block->getChildHtml('details') ?> - <form method="post" id="order-review-form" action="<?= $block->escapeUrl($block->getPlaceOrderUrl()) ?>" + <form method="post" id="order-review-form" action="<?= $escaper->escapeUrl($block->getPlaceOrderUrl()) ?>" class="form order-review-form"> <?= $block->getChildHtml('agreements') ?> <div class="actions-toolbar" id="review-buttons-container"> <div class="primary"> <button type="button" id="review-button" class="action checkout primary" - value="<?= $block->escapeHtml(__('Place Order')) ?>"> - <span><?= $block->escapeHtml(__('Place Order')) ?></span> + value="<?= $escaper->escapeHtml(__('Place Order')) ?>"> + <span><?= $escaper->escapeHtml(__('Place Order')) ?></span> </button> </div> <span class="please-wait load indicator" id="review-please-wait" - data-text="<?= $block->escapeHtml(__('Submitting order information...')) ?>"> - <span><?= $block->escapeHtml(__('Submitting order information...')) ?></span> + data-text="<?= $escaper->escapeHtml(__('Submitting order information...')) ?>"> + <span><?= $escaper->escapeHtml(__('Submitting order information...')) ?></span> </span> - <?= /* @noEscape */ $secureRenderer->renderStyleAsTag("display: none;", 'span#review-please-wait')?> + <?= /* @noEscape */ $secureRenderer->renderStyleAsTag("display: none;", 'span#review-please-wait') ?> </div> </form> </div> @@ -158,7 +157,7 @@ "orderReview": { "shippingSubmitFormSelector": "#shipping-method-form", "shippingSelector": "#shipping-method", - "shippingMethodUpdateUrl": "<?= $block->escapeUrl($block->getUpdateShippingMethodsUrl()) ?>", + "shippingMethodUpdateUrl": "<?= $escaper->escapeJs($block->getUpdateShippingMethodsUrl()) ?>", "isAjax": <?= /* @noEscape */ $block->getUseAjax() ? 'true' : 'false' ?>, "canEditShippingMethod": <?= /* @noEscape */ $block->canEditShippingMethod() ? 'true' : 'false' ?> } diff --git a/app/code/Magento/Paypal/view/frontend/templates/paylater/banner.phtml b/app/code/Magento/Paypal/view/frontend/templates/paylater/banner.phtml new file mode 100644 index 000000000000..a0666b546752 --- /dev/null +++ b/app/code/Magento/Paypal/view/frontend/templates/paylater/banner.phtml @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +/** @var $block \Magento\Paypal\Block\PayLater\Banner */ +/** @var $cartBlock Magento\Checkout\Block\Cart */ +?> +<?php $cartBlock = $block->getLayout()->getBlock('checkout.cart'); ?> +<?php if ($block->getData('placement') !== 'cart' || is_object($cartBlock) && $cartBlock->getItemsCount()): ?> + <div id="pay-later" data-bind="scope: 'payLater'"> + <!-- ko template: getTemplate() --><!-- /ko --> + <script type="text/x-magento-init"> + { + "#pay-later": { + "Magento_Ui/js/core/app": <?= /* @noEscape */ $block->getJsLayout() ?> + } + } + </script> + </div> +<?php endif; ?> + + + + diff --git a/app/code/Magento/Paypal/view/frontend/web/js/in-context/product-express-checkout.js b/app/code/Magento/Paypal/view/frontend/web/js/in-context/product-express-checkout.js index 9469e168cdc6..7f6e2599377a 100644 --- a/app/code/Magento/Paypal/view/frontend/web/js/in-context/product-express-checkout.js +++ b/app/code/Magento/Paypal/view/frontend/web/js/in-context/product-express-checkout.js @@ -47,7 +47,7 @@ define([ var $form = $(this.productFormSelector); if (!this.declinePayment && !this.productAddedToCart) { - $form.submit(); + $form.trigger('submit'); this.formInvalid = !$form.validation('isValid'); this.productAddedToCart = true; } diff --git a/app/code/Magento/Paypal/view/frontend/web/js/order-review.js b/app/code/Magento/Paypal/view/frontend/web/js/order-review.js index e3db1010693e..e7820321d8cd 100644 --- a/app/code/Magento/Paypal/view/frontend/web/js/order-review.js +++ b/app/code/Magento/Paypal/view/frontend/web/js/order-review.js @@ -25,7 +25,6 @@ define([ shippingMethodContainer: '#shipping-method-container', agreementSelector: 'div.checkout-agreements input', isAjax: false, - updateShippingMethodSubmitSelector: '#update-shipping-method-submit', shippingMethodUpdateUrl: null, updateOrderSubmitUrl: null, canEditShippingMethod: false @@ -55,14 +54,12 @@ define([ this.options.updateOrderSubmitUrl, this.options.updateContainerSelector ) - ).find(this.options.updateOrderSelector).on('click', $.proxy(this._updateOrderHandler, this)).end() - .find(this.options.updateShippingMethodSubmitSelector).hide().end(); + ).find(this.options.updateOrderSelector).on('click', $.proxy(this._updateOrderHandler, this)).end(); this._shippingTobilling(); if ($(this.options.shippingSubmitFormSelector).length && this.options.canEditShippingMethod) { this.isShippingSubmitForm = true; $(this.options.shippingSubmitFormSelector) - .find(this.options.updateShippingMethodSubmitSelector).hide().end() .on('change', this.options.shippingSelector, $.proxy( @@ -119,7 +116,7 @@ define([ if (this._validateForm()) { this.element.find(this.options.updateOrderSelector).fadeTo(0, 0.5) .end().find(this.options.waitLoadingContainer).show() - .end().submit(); + .end().trigger('submit'); this._updateOrderSubmit(true); } }, @@ -288,7 +285,7 @@ define([ isChecked = $(this.options.billingAsShippingSelector).is(':checked'); formData = null; callBackResponseHandler = null; - shippingMethod = $.trim($(this.options.shippingSelector).val()); + shippingMethod = $(this.options.shippingSelector).val().trim(); this._shippingTobilling(); if (url && resultId && shippingMethod) { @@ -361,7 +358,7 @@ define([ * Actions on change Shipping Address data */ _onShippingChange: function () { - if (this.triggerPropertyChange && $.trim($(this.options.shippingSelector).val())) { + if (this.triggerPropertyChange && $(this.options.shippingSelector).val().trim()) { this.element.find(this.options.shippingSelector).hide().end() .find(this.options.shippingSelector + '_update').show(); } diff --git a/app/code/Magento/Paypal/view/frontend/web/js/paypal-checkout.js b/app/code/Magento/Paypal/view/frontend/web/js/paypal-checkout.js index 6704540ec060..7b2845ad06fe 100644 --- a/app/code/Magento/Paypal/view/frontend/web/js/paypal-checkout.js +++ b/app/code/Magento/Paypal/view/frontend/web/js/paypal-checkout.js @@ -89,7 +89,7 @@ define([ } $(ppCheckoutInput).val(returnUrl); - $form.submit(); + $form.trigger('submit'); } else { $.mage.redirect(returnUrl); } diff --git a/app/code/Magento/Paypal/view/frontend/web/js/view/amountProviders/checkout.js b/app/code/Magento/Paypal/view/frontend/web/js/view/amountProviders/checkout.js new file mode 100644 index 000000000000..b4161a508155 --- /dev/null +++ b/app/code/Magento/Paypal/view/frontend/web/js/view/amountProviders/checkout.js @@ -0,0 +1,51 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'jquery', + 'ko', + 'uiElement', + 'uiRegistry', + 'Magento_Checkout/js/model/quote', + 'domReady!' +], function ( + $, + ko, + Component, + registry, + quote +) { + 'use strict'; + + return Component.extend({ + defaults: { + amount: null + }, + + /** + * Initialize + * + * @returns {*} + */ + initialize: function () { + this._super(); + + this.updateAmount(); + + return this; + }, + + /** + * Update amount + */ + updateAmount: function () { + var payLater = registry.get(this.parentName); + + quote.totals.subscribe(function (newValue) { + payLater.amount(newValue['base_grand_total']); + }); + } + }); +}); diff --git a/app/code/Magento/Paypal/view/frontend/web/js/view/amountProviders/product.js b/app/code/Magento/Paypal/view/frontend/web/js/view/amountProviders/product.js new file mode 100644 index 000000000000..99a8ccd8b445 --- /dev/null +++ b/app/code/Magento/Paypal/view/frontend/web/js/view/amountProviders/product.js @@ -0,0 +1,95 @@ +/** +* Copyright © Magento, Inc. All rights reserved. +* See COPYING.txt for license details. +*/ + +define([ + 'jquery', + 'uiElement', + 'uiRegistry', + 'priceBox', + 'domReady!' +], function ( + $, + Component, + registry +) { + 'use strict'; + + return Component.extend({ + + defaults: { + priceBoxSelector: '.price-box', + qtyFieldSelector: '#product_addtocart_form [name="qty"]', + amount: null + }, + qty: 1, + price: 0, + + /** + * Initialize + * + * @returns {*} + */ + initialize: function () { + var priceBox; + + this._super(); + + priceBox = $(this.priceBoxSelector); + priceBox.on('priceUpdated', this._onPriceChange.bind(this)); + + if (priceBox.priceBox('option') && + priceBox.priceBox('option').prices && + priceBox.priceBox('option').prices.finalPrice + ) { + this.price = priceBox.priceBox('option').prices.finalPrice.amount; + } + + $(this.qtyFieldSelector).on('change', this._onQtyChange.bind(this)); + + this._updateAmount(); + + return this; + }, + + /** + * Handle changed product qty + * + * @param {jQuery.Event} event + * @private + */ + _onQtyChange: function (event) { + var qty = parseFloat($(event.target).val()); + + this.qty = !isNaN(qty) && qty ? qty : 1; + this._updateAmount(); + }, + + /** + * Handle product price change + * + * @param {jQuery.Event} event + * @param {Object} data + * @private + */ + _onPriceChange: function (event, data) { + this.price = data.finalPrice.amount; + this._updateAmount(); + }, + + /** + * Calculate and update amount + * + * @private + */ + _updateAmount: function () { + var amount = this.price * this.qty, + payLater = registry.get(this.parentName); + + if (amount !== 0) { + payLater.amount(amount); + } + } + }); +}); diff --git a/app/code/Magento/Paypal/view/frontend/web/js/view/paylater.js b/app/code/Magento/Paypal/view/frontend/web/js/view/paylater.js new file mode 100644 index 000000000000..7d976865b91f --- /dev/null +++ b/app/code/Magento/Paypal/view/frontend/web/js/view/paylater.js @@ -0,0 +1,106 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'jquery', + 'ko', + 'uiElement', + 'uiLayout', + 'Magento_Paypal/js/in-context/paypal-sdk', + 'domReady!' +], function ( + $, + ko, + Component, + layout, + paypalSdk +) { + 'use strict'; + + return Component.extend({ + + defaults: { + template: 'Magento_Paypal/paylater', + sdkUrl: '', + attributes: { + class: 'pay-later-message' + }, + refreshSelector: '', + displayAmount: false, + amountComponentConfig: { + name: '${ $.name }.amountProvider', + component: '' + } + }, + paypal: null, + amount: null, + + /** + * Initialize + * + * @returns {*} + */ + initialize: function () { + this._super() + .observe(['amount']); + + if (this.displayAmount) { + layout([this.amountComponentConfig]); + } + + if (this.sdkUrl !== '') { + this.loadPayPalSdk(this.sdkUrl) + .then(this._setPayPalObject.bind(this)); + } + + if (this.refreshSelector) { + $(this.refreshSelector).on('click', this._refreshMessages.bind(this)); + } + + return this; + }, + + /** + * Get attribute value from configuration + * + * @param {String} attributeName + * @returns {*|null} + */ + getAttribute: function (attributeName) { + return typeof this.attributes[attributeName] !== 'undefined' ? + this.attributes[attributeName] : null; + }, + + /** + * Load PP SDK with preconfigured options + * + * @param {String} sdkUrl + */ + loadPayPalSdk: function (sdkUrl) { + return paypalSdk(sdkUrl); + }, + + /** + * Set reference to paypal Sdk object + * + * @param {Object} paypal + * @private + */ + _setPayPalObject: function (paypal) { + this.paypal = paypal; + }, + + /** + * Render messages + * + * @private + */ + _refreshMessages: function () { + if (this.paypal) { + this.paypal.Messages.render(); + } + } + }); +}); diff --git a/app/code/Magento/Paypal/view/frontend/web/js/view/payment/method-renderer/iframe-methods.js b/app/code/Magento/Paypal/view/frontend/web/js/view/payment/method-renderer/iframe-methods.js index 7fb94a7e2348..bd779567a39b 100644 --- a/app/code/Magento/Paypal/view/frontend/web/js/view/payment/method-renderer/iframe-methods.js +++ b/app/code/Magento/Paypal/view/frontend/web/js/view/payment/method-renderer/iframe-methods.js @@ -74,6 +74,7 @@ define([ if (this.iframeIsLoaded) { document.getElementById(this.getCode() + '-iframe') .contentWindow.location.reload(); + this.paymentReady(false); } this.paymentReady(true); diff --git a/app/code/Magento/Paypal/view/frontend/web/template/paylater.html b/app/code/Magento/Paypal/view/frontend/web/template/paylater.html new file mode 100644 index 000000000000..ced5a7f16bb8 --- /dev/null +++ b/app/code/Magento/Paypal/view/frontend/web/template/paylater.html @@ -0,0 +1,19 @@ +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<div data-pp-message data-bind="attr: { + 'class': getAttribute('class'), + 'data-pp-amount': amount, + 'data-pp-placement': getAttribute('data-pp-placement'), + 'data-pp-style-layout': getAttribute('data-pp-style-layout'), + 'data-pp-style-logo-type': getAttribute('data-pp-style-logo-type'), + 'data-pp-style-logo-position': getAttribute('data-pp-style-logo-position'), + 'data-pp-style-text-color': getAttribute('data-pp-style-text-color'), + 'data-pp-style-text-size': getAttribute('data-pp-style-text-size'), + 'data-pp-style-color': getAttribute('data-pp-style-color'), + 'data-pp-style-ratio': getAttribute('data-pp-style-ratio'), + }" ></div> + diff --git a/app/code/Magento/Paypal/view/frontend/web/template/payment/paypal-express-in-context.html b/app/code/Magento/Paypal/view/frontend/web/template/payment/paypal-express-in-context.html index 5f3218325234..5b10a000671c 100644 --- a/app/code/Magento/Paypal/view/frontend/web/template/payment/paypal-express-in-context.html +++ b/app/code/Magento/Paypal/view/frontend/web/template/payment/paypal-express-in-context.html @@ -18,11 +18,11 @@ <!-- PayPal Logo --> <img attr="src: getPaymentAcceptanceMarkSrc(), alt: $t('Acceptance Mark')" class="payment-icon"/> <!-- PayPal Logo --> - <span text="getTitle()"/> + <span text="getTitle()"></span> <a class="action action-help" attr="href: getPaymentAcceptanceMarkHref()" click="showAcceptanceWindow" - translate="'What is PayPal?'"/> + translate="'What is PayPal?'"></a> </label> </div> <div class="payment-method-content"> @@ -30,6 +30,6 @@ <div class="checkout-agreements-block"> <each args="$parent.getRegion('before-place-order')" render=""/> </div> - <div class="actions-toolbar" attr="id: getButtonId()" afterRender="renderPayPalButtons"/> + <div class="actions-toolbar" attr="id: getButtonId()" afterRender="renderPayPalButtons"></div> </div> </div> diff --git a/app/code/Magento/PaypalCaptcha/Test/Mftf/ActionGroup/AddProductToCheckoutPageWithPayPalPayflowProActionGroup.xml b/app/code/Magento/PaypalCaptcha/Test/Mftf/ActionGroup/AddProductToCheckoutPageWithPayPalPayflowProActionGroup.xml new file mode 100644 index 000000000000..a15de07a1800 --- /dev/null +++ b/app/code/Magento/PaypalCaptcha/Test/Mftf/ActionGroup/AddProductToCheckoutPageWithPayPalPayflowProActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AddProductToCheckoutPageWithPayPalPayflowProActionGroup" extends="AddProductToCheckoutPageActionGroup"> + <annotations> + <description>Extends AddProductToCheckoutPageActionGroup to choose PayPal PayflowPro method</description> + </annotations> + <arguments> + </arguments> + <click selector="{{StorefrontPaypalCheckoutSection.creditCard}}" stepKey="clickPayPalCheckbox"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/PaypalCaptcha/Test/Mftf/LICENSE.txt b/app/code/Magento/PaypalCaptcha/Test/Mftf/LICENSE.txt new file mode 100644 index 000000000000..36b2459f6aa6 --- /dev/null +++ b/app/code/Magento/PaypalCaptcha/Test/Mftf/LICENSE.txt @@ -0,0 +1,48 @@ + +Open Software License ("OSL") v. 3.0 + +This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: + +Licensed under the Open Software License version 3.0 + + 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: + + 1. to reproduce the Original Work in copies, either alone or as part of a collective work; + + 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; + + 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License; + + 4. to perform the Original Work publicly; and + + 5. to display the Original Work publicly. + + 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. + + 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. + + 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. + + 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). + + 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. + + 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. + + 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. + + 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). + + 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. + + 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. + + 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. + + 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. + + 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. + + 16. Modification of This License. This License is Copyright (C) 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. diff --git a/app/code/Magento/PaypalCaptcha/Test/Mftf/LICENSE_AFL.txt b/app/code/Magento/PaypalCaptcha/Test/Mftf/LICENSE_AFL.txt new file mode 100644 index 000000000000..f39d641b18a1 --- /dev/null +++ b/app/code/Magento/PaypalCaptcha/Test/Mftf/LICENSE_AFL.txt @@ -0,0 +1,48 @@ + +Academic Free License ("AFL") v. 3.0 + +This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: + +Licensed under the Academic Free License version 3.0 + + 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: + + 1. to reproduce the Original Work in copies, either alone or as part of a collective work; + + 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; + + 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, under any license of your choice that does not contradict the terms and conditions, including Licensor's reserved rights and remedies, in this Academic Free License; + + 4. to perform the Original Work publicly; and + + 5. to display the Original Work publicly. + + 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. + + 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. + + 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. + + 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). + + 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. + + 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. + + 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. + + 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). + + 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. + + 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. + + 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. + + 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. + + 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. + + 16. Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. diff --git a/app/code/Magento/PaypalCaptcha/Test/Mftf/README.md b/app/code/Magento/PaypalCaptcha/Test/Mftf/README.md new file mode 100644 index 000000000000..02a049335284 --- /dev/null +++ b/app/code/Magento/PaypalCaptcha/Test/Mftf/README.md @@ -0,0 +1,3 @@ +# Captcha Functional Tests + +The Functional Test Module for **Magento PaypalCaptcha** module. diff --git a/app/code/Magento/PaypalCaptcha/Test/Mftf/Test/StorefrontPaymentsCaptchaWithPayflowProTest.xml b/app/code/Magento/PaypalCaptcha/Test/Mftf/Test/StorefrontPaymentsCaptchaWithPayflowProTest.xml new file mode 100644 index 000000000000..0a84cebfe377 --- /dev/null +++ b/app/code/Magento/PaypalCaptcha/Test/Mftf/Test/StorefrontPaymentsCaptchaWithPayflowProTest.xml @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontPaymentsCaptchaWithPayflowProTest"> + <annotations> + <features value="Captcha"/> + <stories value="Paypal PayflowPro and Captcha"/> + <title value="Storefront order creation with Paypal PayflowPro and Captcha"/> + <description value="Test for checking captcha while order creation in storefront with Paypal PayflowPro."/> + <testCaseId value="MC-41750" /> + <useCaseId value="MC-41572"/> + <severity value="AVERAGE"/> + <group value="captcha"/> + </annotations> + <before> + <!-- Configure Paypal Payflow Pro payment method --> + <createData entity="PaypalPayflowProConfig" stepKey="configurePaypalPayflowProPayment"/> + <createData entity="EnablePaypalPayflowProWithVault" stepKey="enablePaypalPayflowProPaymentWithVault"/> + + <!-- Enable captcha for Checkout/Placing Order --> + <magentoCLI command="config:set {{StorefrontCaptchaOnOnepageCheckoutConfigData.path}} {{StorefrontCaptchaOnOnepageCheckoutConfigData.value}}" stepKey="enableOnOpageCheckoutCaptcha" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAlwaysConfigData.path}} {{StorefrontCustomerCaptchaModeAlwaysConfigData.value}}" stepKey="alwaysEnableCaptcha" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaLength3ConfigData.path}} {{StorefrontCustomerCaptchaLength3ConfigData.value}}" stepKey="setCaptchaLength" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaSymbols1ConfigData.path}} {{StorefrontCustomerCaptchaSymbols1ConfigData.value}}" stepKey="setCaptchaSymbols" /> + + <!-- Create customer --> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + + <!-- Create product and category --> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="_defaultProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <!-- Login as admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <!-- Set default configuration for Paypal PayflowPro payment method --> + <createData entity="DefaultPaypalPayflowProConfig" stepKey="defaultPaypalPayflowProConfig"/> + <createData entity="RollbackPaypalPayflowPro" stepKey="rollbackPaypalPayflowProConfig"/> + + <!-- Set default configuration for captcha --> + <magentoCLI command="config:set {{StorefrontCaptchaOnOnepageCheckoutConfigData.path}} {{StorefrontCaptchaOnOnepageCheckoutConfigData.value}},{{StorefrontCaptchaOnCustomerForgotPasswordConfigData.value}}" stepKey="enableCaptchaOnDefaultForms" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAfterFailConfigData.path}} {{StorefrontCustomerCaptchaModeAfterFailConfigData.value}}" stepKey="defaultCaptchaMode" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultLengthConfigData.path}} {{StorefrontCustomerCaptchaDefaultLengthConfigData.value}}" stepKey="setDefaultCaptchaLength" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.path}} {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.value}}" stepKey="setDefaultCaptchaSymbols" /> + + <!-- Delete customer --> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + + <!-- Delete product and category--> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + + <!-- Admin logout --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> + </after> + + <!--Login to storefront as previously created customer--> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> + <argument name="Customer" value="$createCustomer$"/> + </actionGroup> + + <!-- Add product to cart and proceed to checkout payments method step --> + <actionGroup ref="AddProductToCheckoutPageWithPayPalPayflowProActionGroup" stepKey="goToCheckoutPaypalPayflowPro"> + <argument name="Category" value="$createCategory$"/> + </actionGroup> + + <!-- Fill credit card form with card number, expiration and CVV --> + <actionGroup ref="StorefrontPaypalFillCardDataActionGroup" stepKey="fillCardDataPaypal"> + <argument name="cardData" value="Visa3DSecureCard"/> + </actionGroup> + + <!-- Enter captcha value --> + <actionGroup ref="StorefrontCheckoutPaymentsWithCaptchaActionGroup" stepKey="fillCaptchaField"> + <argument name="captcha" value="{{PreconfiguredCaptcha.value}}"/> + </actionGroup> + + <!-- Place order --> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlacePurchaseOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> + + <!-- Confirm Purchased Simple Product --> + <actionGroup ref="StorefrontOpenOrderFromSuccessPageActionGroup" stepKey="openOrderFromSuccessPage"> + <argument name="orderNumber" value="{$grabOrderNumber}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/PaypalCaptcha/view/frontend/requirejs-config.js b/app/code/Magento/PaypalCaptcha/view/frontend/requirejs-config.js index 78e7add4ec69..bf706dc2da97 100644 --- a/app/code/Magento/PaypalCaptcha/view/frontend/requirejs-config.js +++ b/app/code/Magento/PaypalCaptcha/view/frontend/requirejs-config.js @@ -8,6 +8,12 @@ var config = { mixins: { 'Magento_Checkout/js/view/payment/list': { 'Magento_PaypalCaptcha/js/view/payment/list-mixin': true + }, + 'Magento_Paypal/js/view/payment/method-renderer/payflowpro-method': { + 'Magento_PaypalCaptcha/js/view/payment/method-renderer/payflowpro-method-mixin': true + }, + 'Magento_Captcha/js/view/checkout/defaultCaptcha': { + 'Magento_PaypalCaptcha/js/view/checkout/defaultCaptcha-mixin': true } } } diff --git a/app/code/Magento/PaypalCaptcha/view/frontend/web/js/model/skipRefreshCaptcha.js b/app/code/Magento/PaypalCaptcha/view/frontend/web/js/model/skipRefreshCaptcha.js new file mode 100644 index 000000000000..813b43da774a --- /dev/null +++ b/app/code/Magento/PaypalCaptcha/view/frontend/web/js/model/skipRefreshCaptcha.js @@ -0,0 +1,12 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define(['ko'], function (ko) { + 'use strict'; + + return { + skip: ko.observable(false) + }; +}); diff --git a/app/code/Magento/PaypalCaptcha/view/frontend/web/js/view/checkout/defaultCaptcha-mixin.js b/app/code/Magento/PaypalCaptcha/view/frontend/web/js/view/checkout/defaultCaptcha-mixin.js new file mode 100644 index 000000000000..524353abc01f --- /dev/null +++ b/app/code/Magento/PaypalCaptcha/view/frontend/web/js/view/checkout/defaultCaptcha-mixin.js @@ -0,0 +1,27 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'Magento_PaypalCaptcha/js/model/skipRefreshCaptcha' +], function (skipRefreshCaptcha) { + 'use strict'; + + var defaultCaptchaMixin = { + /** + * @override + */ + refresh: function () { + if (!skipRefreshCaptcha.skip()) { + this._super(); + } else { + skipRefreshCaptcha.skip(false); + } + } + }; + + return function (defaultCaptcha) { + return defaultCaptcha.extend(defaultCaptchaMixin); + }; +}); diff --git a/app/code/Magento/PaypalCaptcha/view/frontend/web/js/view/payment/method-renderer/payflowpro-method-mixin.js b/app/code/Magento/PaypalCaptcha/view/frontend/web/js/view/payment/method-renderer/payflowpro-method-mixin.js new file mode 100644 index 000000000000..1b4b63012b8f --- /dev/null +++ b/app/code/Magento/PaypalCaptcha/view/frontend/web/js/view/payment/method-renderer/payflowpro-method-mixin.js @@ -0,0 +1,24 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'Magento_PaypalCaptcha/js/model/skipRefreshCaptcha' +], function (skipRefreshCaptcha) { + 'use strict'; + + var payflowProMethodMixin = { + /** + * @override + */ + placeOrder: function () { + skipRefreshCaptcha.skip(true); + this._super(); + } + }; + + return function (payflowProMethod) { + return payflowProMethod.extend(payflowProMethodMixin); + }; +}); diff --git a/app/code/Magento/Persistent/Block/Header/Additional.php b/app/code/Magento/Persistent/Block/Header/Additional.php index dfde2adf1e6a..4f0458203a0d 100644 --- a/app/code/Magento/Persistent/Block/Header/Additional.php +++ b/app/code/Magento/Persistent/Block/Header/Additional.php @@ -66,7 +66,7 @@ public function __construct( Json $jsonSerializer = null, Data $persistentHelper = null ) { - $this->isScopePrivate = true; + $this->_isScopePrivate = true; $this->_customerViewHelper = $customerViewHelper; $this->_persistentSessionHelper = $persistentSessionHelper; $this->customerRepository = $customerRepository; diff --git a/app/code/Magento/Persistent/Model/Session.php b/app/code/Magento/Persistent/Model/Session.php index 701b4fc21d29..705f4491db12 100644 --- a/app/code/Magento/Persistent/Model/Session.php +++ b/app/code/Magento/Persistent/Model/Session.php @@ -12,6 +12,7 @@ * @method int getCustomerId() * @method Session setCustomerId() * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) * @since 100.0.2 */ class Session extends \Magento\Framework\Model\AbstractModel @@ -391,7 +392,8 @@ private function setCookie($value, $duration, $path) ->setDuration($duration) ->setPath($path) ->setSecure($this->getRequest()->isSecure()) - ->setHttpOnly(true); + ->setHttpOnly(true) + ->setSameSite('Lax'); $this->_cookieManager->setPublicCookie( self::COOKIE_NAME, $value, diff --git a/app/code/Magento/Persistent/README.md b/app/code/Magento/Persistent/README.md index 7f6e8b3d0e97..d3f015bf29d5 100644 --- a/app/code/Magento/Persistent/README.md +++ b/app/code/Magento/Persistent/README.md @@ -1,5 +1,61 @@ -Magento\Persistent module enables set customer a long-term cookie containing internal id (random hash - to exclude brute -force) of persistent session. Persistent session data is kept in DB - so it's not deleted in some days and is kept for +# Magento_Persistent module + +This module enables setting a long-term cookie containing internal id (random hash - to exclude brute +force) of persistent session for customer. Persistent session data is kept in DB - so it's not deleted in some days and is kept for as much time as we need. DB session keeps customerId + some data from real customer session that we want to sync (e.g. num items in shopping cart). For registered customer this info is synced to persistent session if choose "Remember me" checkbox during first login. + +## Installation + +Before installing this module, note that the Magento_Persistent is dependent on the following modules: +- `Magento_Checkout` +- `Magento_PageCache` + +The Magento_Persistent module creates the `persistent_session` table in the database. + +This module modifies the following tables in the database: +- `quote` - adds column `is_persistent` + +All database schema changes made by this module are rolled back when the module gets disabled and setup:upgrade command is run. + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Extensibility + +Extension developers can interact with the Magento_Persistent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Persistent module. + +A lot of functionality in the module is on JavaScript, use [mixins](https://devdocs.magento.com/guides/v2.4/javascript-dev-guide/javascript/js_mixins.html) to extend it. + +### Events + +The module dispatches the following events: + +#### Controller + +- `persistent_session_expired` event in the `\Magento\Persistent\Controller\Index\UnsetCookie::execute` method + +#### Observer + +- `persistent_session_expired` event in the `\Magento\Persistent\Observer\CheckExpirePersistentQuoteObserver::execute` method + +For information about an event in Magento 2, see [Events and observers](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). + +### Layouts + +For more information about a layout in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). + +## Additional information + +More information can get at articles: +- [Persistent Shopping Cart](https://docs.magento.com/user-guide/configuration/customers/persistent-shopping-cart.html) +- [Persistent Cart](https://docs.magento.com/user-guide/sales/cart-persistent.html) + +### Cron options + +Cron group configuration can be set at `etc/crontab.xml`: +- `persistent_clear_expired` - clear expired persistent sessions + +[Learn how to configure and run cron in Magento.](http://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-cron.html). diff --git a/app/code/Magento/Persistent/Test/Unit/Model/SessionTest.php b/app/code/Magento/Persistent/Test/Unit/Model/SessionTest.php index 2155192b04ad..d2abe6c184ed 100644 --- a/app/code/Magento/Persistent/Test/Unit/Model/SessionTest.php +++ b/app/code/Magento/Persistent/Test/Unit/Model/SessionTest.php @@ -143,6 +143,9 @@ public function testSetPersistentCookie() $cookieMetadataMock->expects($this->once()) ->method('setHttpOnly') ->with(true)->willReturnSelf(); + $cookieMetadataMock->expects($this->once()) + ->method('setSameSite') + ->with('Lax')->willReturnSelf(); $this->cookieMetadataFactoryMock->expects($this->once()) ->method('createPublicCookieMetadata') ->willReturn($cookieMetadataMock); @@ -186,6 +189,9 @@ public function testRenewPersistentCookie( $cookieMetadataMock->expects($this->exactly($numCalls)) ->method('setHttpOnly') ->with(true)->willReturnSelf(); + $cookieMetadataMock->expects($this->exactly($numCalls)) + ->method('setSameSite') + ->with('Lax')->willReturnSelf(); $this->cookieMetadataFactoryMock->expects($this->exactly($numCalls)) ->method('createPublicCookieMetadata') ->willReturn($cookieMetadataMock); diff --git a/app/code/Magento/ProductAlert/Model/Mailing/AlertProcessor.php b/app/code/Magento/ProductAlert/Model/Mailing/AlertProcessor.php new file mode 100644 index 000000000000..83ac4abd896c --- /dev/null +++ b/app/code/Magento/ProductAlert/Model/Mailing/AlertProcessor.php @@ -0,0 +1,320 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ProductAlert\Model\Mailing; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Helper\Data; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection; +use Magento\Framework\Stdlib\DateTime; +use Magento\ProductAlert\Model\Email; +use Magento\ProductAlert\Model\EmailFactory; +use Magento\ProductAlert\Model\Price; +use Magento\ProductAlert\Model\ProductSalability; +use Magento\ProductAlert\Model\ResourceModel\Stock\CollectionFactory as StockCollectionFactory; +use Magento\ProductAlert\Model\ResourceModel\Price\CollectionFactory as PriceCollectionFactory; +use Magento\ProductAlert\Model\Stock; +use Magento\Store\Api\Data\WebsiteInterface; +use Magento\Store\Model\StoreManagerInterface; +use Magento\Store\Model\Website; + +/** + * Class for mailing Product Alerts + */ +class AlertProcessor +{ + public const ALERT_TYPE_STOCK = 'stock'; + public const ALERT_TYPE_PRICE = 'price'; + + /** + * @var EmailFactory + */ + private $emailFactory; + + /** + * @var PriceCollectionFactory + */ + private $priceCollectionFactory; + + /** + * @var StockCollectionFactory + */ + private $stockCollectionFactory; + + /** + * @var CustomerRepositoryInterface + */ + private $customerRepository; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @var Data + */ + private $catalogData; + + /** + * @var ProductSalability + */ + private $productSalability; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @var ErrorEmailSender + */ + private $errorEmailSender; + + /** + * @param EmailFactory $emailFactory + * @param PriceCollectionFactory $priceCollectionFactory + * @param StockCollectionFactory $stockCollectionFactory + * @param CustomerRepositoryInterface $customerRepository + * @param ProductRepositoryInterface $productRepository + * @param Data $catalogData + * @param ProductSalability $productSalability + * @param StoreManagerInterface $storeManager + * @param ErrorEmailSender $errorEmailSender + */ + public function __construct( + EmailFactory $emailFactory, + PriceCollectionFactory $priceCollectionFactory, + StockCollectionFactory $stockCollectionFactory, + CustomerRepositoryInterface $customerRepository, + ProductRepositoryInterface $productRepository, + Data $catalogData, + ProductSalability $productSalability, + StoreManagerInterface $storeManager, + ErrorEmailSender $errorEmailSender + ) { + $this->emailFactory = $emailFactory; + $this->priceCollectionFactory = $priceCollectionFactory; + $this->stockCollectionFactory = $stockCollectionFactory; + $this->customerRepository = $customerRepository; + $this->productRepository = $productRepository; + $this->catalogData = $catalogData; + $this->productSalability = $productSalability; + $this->storeManager = $storeManager; + $this->errorEmailSender = $errorEmailSender; + } + + /** + * Process product alerts + * + * @param string $alertType + * @param array $customerIds + * @param int $websiteId + * @throws \Exception + */ + public function process(string $alertType, array $customerIds, int $websiteId): void + { + $this->validateAlertType($alertType); + $errors = $this->processAlerts($alertType, $customerIds, $websiteId); + if (!empty($errors)) { + /** @var Website $website */ + $website = $this->storeManager->getWebsite($websiteId); + $defaultStoreId = $website->getDefaultStore()->getId(); + $this->errorEmailSender->execute($errors, $defaultStoreId); + } + } + + /** + * Process product alerts + * + * @param string $alertType + * @param array $customerIds + * @param int $websiteId + * @return array + * @throws \Exception + */ + private function processAlerts(string $alertType, array $customerIds, int $websiteId): array + { + /** @var Email $email */ + $email = $this->emailFactory->create(); + $email->setType($alertType); + $email->setWebsiteId($websiteId); + $errors = []; + + try { + $collection = $this->getAlertCollection($alertType, $customerIds, $websiteId); + } catch (\Exception $e) { + $errors[] = $e->getMessage(); + return $errors; + } + + /** @var CustomerInterface $customer */ + $customer = null; + /** @var Website $website */ + $website = $this->storeManager->getWebsite($websiteId); + $defaultStoreId = $website->getDefaultStore()->getId(); + + /** @var Price|Stock $alert */ + foreach ($collection as $alert) { + try { + if ($alert->getStoreId()) { + $email->setStoreId($alert->getStoreId()); + } + if ($customer === null) { + $customer = $this->customerRepository->getById($alert->getCustomerId()); + } elseif ((int)$customer->getId() !== (int)$alert->getCustomerId()) { + $this->sendEmail($customer, $email); + $customer = $this->customerRepository->getById($alert->getCustomerId()); + } + + $product = $this->productRepository->getById($alert->getProductId(), false, $defaultStoreId); + + switch ($alertType) { + case self::ALERT_TYPE_STOCK: + $this->saveStockAlert($alert, $product, $website, $email); + break; + case self::ALERT_TYPE_PRICE: + $this->savePriceAlert($alert, $product, $customer, $email); + break; + } + } catch (\Exception $e) { + $errors[] = $e->getMessage(); + } + } + + if ($customer !== null) { + try { + $this->sendEmail($customer, $email); + } catch (\Exception $e) { + $errors[] = $e->getMessage(); + } + } + + return $errors; + } + + /** + * Validate Alert Type + * + * @param string $alertType + * @throws \InvalidArgumentException + */ + private function validateAlertType(string $alertType): void + { + if (!in_array($alertType, [self::ALERT_TYPE_STOCK, self::ALERT_TYPE_PRICE])) { + throw new \InvalidArgumentException('Invalid alert type'); + } + } + + /** + * Get alert collection + * + * @param string $alertType + * @param array $customerIds + * @param int $websiteId + * @return AbstractCollection + * @throws \InvalidArgumentException + */ + private function getAlertCollection(string $alertType, array $customerIds, int $websiteId): AbstractCollection + { + switch ($alertType) { + case self::ALERT_TYPE_STOCK: + $collection = $this->stockCollectionFactory->create(); + $collection->addFieldToFilter('customer_id', ['in' => $customerIds]) + ->addWebsiteFilter($websiteId) + ->addStatusFilter(0) + ->setCustomerOrder() + ->addOrder('product_id'); + break; + case self::ALERT_TYPE_PRICE: + $collection = $this->priceCollectionFactory->create(); + $collection->addFieldToFilter('customer_id', ['in' => $customerIds]) + ->addWebsiteFilter($websiteId) + ->setCustomerOrder() + ->addOrder('product_id'); + break; + default: + throw new \InvalidArgumentException('Invalid alert type'); + } + + return $collection; + } + + /** + * Save Price Alert + * + * @param Price $alert + * @param ProductInterface $product + * @param CustomerInterface $customer + * @param Email $email + */ + private function savePriceAlert( + Price $alert, + ProductInterface $product, + CustomerInterface $customer, + Email $email + ): void { + $product->setCustomerGroupId($customer->getGroupId()); + $finalPrice = $product->getFinalPrice(); + if ($alert->getPrice() <= $finalPrice) { + return; + } + + $product->setFinalPrice($this->catalogData->getTaxPrice($product, $finalPrice)); + $product->setPrice($this->catalogData->getTaxPrice($product, $product->getPrice())); + + $alert->setPrice($finalPrice); + $alert->setLastSendDate(date(DateTime::DATETIME_PHP_FORMAT)); + $alert->setSendCount($alert->getSendCount() + 1); + $alert->setStatus(1); + $alert->save(); + + $email->addPriceProduct($product); + } + + /** + * Save stock alert + * + * @param Stock $alert + * @param ProductInterface $product + * @param WebsiteInterface $website + * @param Email $email + */ + private function saveStockAlert( + Stock $alert, + ProductInterface $product, + WebsiteInterface $website, + Email $email + ): void { + if (!$this->productSalability->isSalable($product, $website)) { + return; + } + + $alert->setSendDate(date(DateTime::DATETIME_PHP_FORMAT)); + $alert->setSendCount($alert->getSendCount() + 1); + $alert->setStatus(1); + $alert->save(); + + $email->addStockProduct($product); + } + + /** + * Send alert email + * + * @param CustomerInterface $customer + * @param Email $email + */ + private function sendEmail(CustomerInterface $customer, Email $email): void + { + $email->setCustomerData($customer); + $email->send(); + $email->clean(); + } +} diff --git a/app/code/Magento/ProductAlert/Model/Mailing/Consumer.php b/app/code/Magento/ProductAlert/Model/Mailing/Consumer.php new file mode 100644 index 000000000000..0676b4a725c6 --- /dev/null +++ b/app/code/Magento/ProductAlert/Model/Mailing/Consumer.php @@ -0,0 +1,84 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ProductAlert\Model\Mailing; + +use Magento\AsynchronousOperations\Api\Data\OperationInterface; +use Magento\Framework\EntityManager\EntityManager; +use Magento\Framework\Serialize\Serializer\Json; +use Psr\Log\LoggerInterface; + +/** + * Class for processing Product Alerts from the messages queue + */ +class Consumer +{ + /** + * @var LoggerInterface + */ + private $logger; + + /** + * @var Json + */ + private $jsonSerializer; + + /** + * @var EntityManager + */ + private $entityManager; + + /** + * @var AlertProcessor + */ + private $alertProcessor; + + /** + * @param LoggerInterface $logger + * @param Json $jsonSerializer + * @param EntityManager $entityManager + * @param AlertProcessor $alertProcessor + */ + public function __construct( + LoggerInterface $logger, + Json $jsonSerializer, + EntityManager $entityManager, + AlertProcessor $alertProcessor + ) { + $this->logger = $logger; + $this->jsonSerializer = $jsonSerializer; + $this->entityManager = $entityManager; + $this->alertProcessor = $alertProcessor; + } + + /** + * Processing Product Alerts + * + * @param OperationInterface $operation + */ + public function process(OperationInterface $operation): void + { + $status = OperationInterface::STATUS_TYPE_COMPLETE; + $message = __('Product alerts are sent successfully.'); + $errorCode = null; + + try { + $data = $this->jsonSerializer->unserialize($operation->getSerializedData()); + $this->alertProcessor->process($data['alert_type'], $data['customer_ids'], (int)$data['website_id']); + } catch (\Throwable $e) { + $this->logger->critical($e->getMessage()); + $status = OperationInterface::STATUS_TYPE_NOT_RETRIABLY_FAILED; + $errorCode = $e->getCode(); + $message = __('Sorry, something went wrong during mailing product alerts. Please see log for details.'); + } + + $operation->setStatus($status) + ->setErrorCode($errorCode) + ->setResultMessage($message); + $this->entityManager->save($operation); + } +} diff --git a/app/code/Magento/ProductAlert/Model/Mailing/ErrorEmailSender.php b/app/code/Magento/ProductAlert/Model/Mailing/ErrorEmailSender.php new file mode 100644 index 000000000000..fc7ce3ac1ef0 --- /dev/null +++ b/app/code/Magento/ProductAlert/Model/Mailing/ErrorEmailSender.php @@ -0,0 +1,129 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ProductAlert\Model\Mailing; + +use Magento\Backend\App\Area\FrontNameResolver; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\Mail\Template\TransportBuilder; +use Magento\Framework\Translate\Inline\StateInterface; +use Magento\Store\Model\ScopeInterface; +use Psr\Log\LoggerInterface; + +/** + * Class to send error emails to administrator + */ +class ErrorEmailSender +{ + /** + * Error email template configuration + */ + private const XML_PATH_ERROR_TEMPLATE = 'catalog/productalert_cron/error_email_template'; + + /** + * Error email identity configuration + */ + private const XML_PATH_ERROR_IDENTITY = 'catalog/productalert_cron/error_email_identity'; + + /** + * 'Send error emails to' configuration + */ + private const XML_PATH_ERROR_RECIPIENT = 'catalog/productalert_cron/error_email'; + + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * @var TransportBuilder + */ + private $transportBuilder; + + /** + * @var StateInterface + */ + private $inlineTranslation; + + /** + * @var LoggerInterface + */ + private $logger; + + /** + * @param ScopeConfigInterface $scopeConfig + * @param TransportBuilder $transportBuilder + * @param StateInterface $inlineTranslation + * @param LoggerInterface $logger + */ + public function __construct( + ScopeConfigInterface $scopeConfig, + TransportBuilder $transportBuilder, + StateInterface $inlineTranslation, + LoggerInterface $logger + ) { + $this->scopeConfig = $scopeConfig; + $this->transportBuilder = $transportBuilder; + $this->inlineTranslation = $inlineTranslation; + $this->logger = $logger; + } + + /** + * Send error emails to administrator + * + * @param array $errors + * @param int $storeId + * @return void + */ + public function execute(array $errors, int $storeId): void + { + if (!count($errors)) { + return; + } + + $this->logger->error( + 'Product Alerts: ' . count($errors) . ' errors occurred during sending alerts.' + ); + + if (!$this->scopeConfig->getValue(self::XML_PATH_ERROR_TEMPLATE, ScopeInterface::SCOPE_STORE, $storeId)) { + return; + } + + $this->inlineTranslation->suspend(); + $transport = $this->transportBuilder->setTemplateIdentifier( + $this->scopeConfig->getValue( + self::XML_PATH_ERROR_TEMPLATE, + ScopeInterface::SCOPE_STORE, + $storeId + ) + )->setTemplateOptions( + [ + 'area' => FrontNameResolver::AREA_CODE, + 'store' => $storeId, + ] + )->setTemplateVars( + ['warnings' => join("\n", $errors)] + )->setFromByScope( + $this->scopeConfig->getValue( + self::XML_PATH_ERROR_IDENTITY, + ScopeInterface::SCOPE_STORE, + $storeId + ), + $storeId + )->addTo( + $this->scopeConfig->getValue( + self::XML_PATH_ERROR_RECIPIENT, + ScopeInterface::SCOPE_STORE, + $storeId + ) + )->getTransport(); + + $transport->sendMessage(); + + $this->inlineTranslation->resume(); + } +} diff --git a/app/code/Magento/ProductAlert/Model/Mailing/Publisher.php b/app/code/Magento/ProductAlert/Model/Mailing/Publisher.php new file mode 100644 index 000000000000..939a0ffd2bc6 --- /dev/null +++ b/app/code/Magento/ProductAlert/Model/Mailing/Publisher.php @@ -0,0 +1,114 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ProductAlert\Model\Mailing; + +use Magento\AsynchronousOperations\Api\Data\OperationInterfaceFactory; +use Magento\AsynchronousOperations\Api\Data\OperationInterface; +use Magento\Authorization\Model\UserContextInterface; +use Magento\Framework\Bulk\BulkManagementInterface; +use Magento\Framework\DataObject\IdentityGeneratorInterface; +use Magento\Framework\Serialize\Serializer\Json; + +/** + * Publish Mailing of Product Alerts to messages queue + */ +class Publisher +{ + /** + * Default value of bunch size for one operation + */ + private const MESSAGE_BUNCH_SIZE_DEFAULT = 5000; + + /** + * @var BulkManagementInterface + */ + private $bulkManagement; + + /** + * @var OperationInterfaceFactory + */ + private $operationFactory; + + /** + * @var IdentityGeneratorInterface + */ + private $identityService; + + /** + * @var UserContextInterface + */ + private $userContext; + + /** + * @var Json + */ + private $jsonSerializer; + + /** + * @var int|null + */ + private $messageBunchSize; + + /** + * @param BulkManagementInterface $bulkManagement + * @param OperationInterfaceFactory $operationFactory + * @param IdentityGeneratorInterface $identityService + * @param UserContextInterface $userContextInterface + * @param Json $jsonSerializer + * @param int|null $messageBunchSize + */ + public function __construct( + BulkManagementInterface $bulkManagement, + OperationInterfaceFactory $operationFactory, + IdentityGeneratorInterface $identityService, + UserContextInterface $userContextInterface, + Json $jsonSerializer, + ?int $messageBunchSize = null + ) { + $this->bulkManagement = $bulkManagement; + $this->operationFactory = $operationFactory; + $this->identityService = $identityService; + $this->userContext = $userContextInterface; + $this->jsonSerializer = $jsonSerializer; + $this->messageBunchSize = $messageBunchSize ?: self::MESSAGE_BUNCH_SIZE_DEFAULT; + } + + /** + * Schedule bulk operation + * + * @param string $alertType + * @param array $customerIds + * @param int $websiteId + */ + public function execute(string $alertType, array $customerIds, int $websiteId): void + { + foreach (array_chunk($customerIds, $this->messageBunchSize) as $bunchOfIds) { + $bulkUuid = $this->identityService->generateId(); + $serializedData = $this->jsonSerializer->serialize( + [ + 'alert_type' => $alertType, + 'customer_ids' => $bunchOfIds, + 'website_id' => $websiteId + ] + ); + /** @var OperationInterface $operation */ + $operation = $this->operationFactory->create( + [ + 'data' => [ + 'bulk_uuid' => $bulkUuid, + 'topic_name' => 'product_alert', + 'serialized_data' => $serializedData, + 'status' => OperationInterface::STATUS_TYPE_OPEN, + ] + ] + ); + $userId = $this->userContext->getUserId(); + $this->bulkManagement->scheduleBulk($bulkUuid, [$operation], _('Mailing of Product Alerts'), $userId); + } + } +} diff --git a/app/code/Magento/ProductAlert/Model/Observer.php b/app/code/Magento/ProductAlert/Model/Observer.php index addc61d2f49a..29bcc7e73dc0 100644 --- a/app/code/Magento/ProductAlert/Model/Observer.php +++ b/app/code/Magento/ProductAlert/Model/Observer.php @@ -5,26 +5,41 @@ */ namespace Magento\ProductAlert\Model; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\DB\Select; +use Magento\ProductAlert\Model\Mailing\AlertProcessor; +use Magento\ProductAlert\Model\Mailing\Publisher; +use Magento\ProductAlert\Model\ResourceModel\Stock\CollectionFactory as StockCollectionFactory; +use Magento\ProductAlert\Model\ResourceModel\Price\CollectionFactory as PriceCollectionFactory; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\StoreManagerInterface; + /** - * ProductAlert observer - * - * @author Magento Core Team <core@magentocommerce.com> - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * Product Alert observer */ class Observer { /** * Error email template configuration + * + * @deprecated + * @see \Magento\ProductAlert\Model\Mailing\ErrorEmailSender::XML_PATH_ERROR_TEMPLATE */ const XML_PATH_ERROR_TEMPLATE = 'catalog/productalert_cron/error_email_template'; /** * Error email identity configuration + * + * @deprecated + * @see \Magento\ProductAlert\Model\Mailing\ErrorEmailSender::XML_PATH_ERROR_IDENTITY */ const XML_PATH_ERROR_IDENTITY = 'catalog/productalert_cron/error_email_identity'; /** * 'Send error emails to' configuration + * + * @deprecated + * @see \Magento\ProductAlert\Model\Mailing\ErrorEmailSender::XML_PATH_ERROR_RECIPIENT */ const XML_PATH_ERROR_RECIPIENT = 'catalog/productalert_cron/error_email'; @@ -40,410 +55,111 @@ class Observer */ const XML_PATH_STOCK_ALLOW = 'catalog/productalert/allow_stock'; - /** - * Website collection array - * - * @var array - */ - protected $_websites; - - /** - * Warning (exception) errors array - * - * @var array - */ - protected $_errors = []; - - /** - * Catalog data - * - * @var \Magento\Catalog\Helper\Data - */ - protected $_catalogData = null; - /** * Core store config * - * @var \Magento\Framework\App\Config\ScopeConfigInterface + * @var ScopeConfigInterface */ - protected $_scopeConfig; + private $scopeConfig; /** - * @var \Magento\Store\Model\StoreManagerInterface + * @var StoreManagerInterface */ - protected $_storeManager; + private $storeManager; /** - * @var \Magento\ProductAlert\Model\ResourceModel\Price\CollectionFactory + * @var PriceCollectionFactory */ - protected $_priceColFactory; + private $priceCollectionFactory; /** - * @var \Magento\Customer\Api\CustomerRepositoryInterface + * @var StockCollectionFactory */ - protected $customerRepository; + private $stockCollectionFactory; /** - * @var \Magento\Catalog\Api\ProductRepositoryInterface + * @var Publisher */ - protected $productRepository; + private $publisher; - /** - * @var \Magento\Framework\Stdlib\DateTime\DateTimeFactory - */ - protected $_dateFactory; /** - * @var \Magento\ProductAlert\Model\ResourceModel\Stock\CollectionFactory - */ - protected $_stockColFactory; - - /** - * @var \Magento\Framework\Mail\Template\TransportBuilder - */ - protected $_transportBuilder; - - /** - * @var \Magento\ProductAlert\Model\EmailFactory - */ - protected $_emailFactory; - - /** - * @var \Magento\Framework\Translate\Inline\StateInterface - */ - protected $inlineTranslation; - - /** - * @var ProductSalability - */ - protected $productSalability; - - /** - * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\ProductAlert\Model\ResourceModel\Price\CollectionFactory $priceColFactory - * @param \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository - * @param \Magento\Catalog\Api\ProductRepositoryInterface $productRepository - * @param \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory - * @param \Magento\ProductAlert\Model\ResourceModel\Stock\CollectionFactory $stockColFactory - * @param \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder - * @param \Magento\ProductAlert\Model\EmailFactory $emailFactory - * @param \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation - * @param ProductSalability|null $productSalability - * @SuppressWarnings(PHPMD.ExcessiveParameterList) + * @param ScopeConfigInterface $scopeConfig + * @param StoreManagerInterface $storeManager + * @param PriceCollectionFactory $priceCollectionFactory + * @param StockCollectionFactory $stockCollectionFactory + * @param Publisher $publisher */ public function __construct( - \Magento\Catalog\Helper\Data $catalogData, - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\ProductAlert\Model\ResourceModel\Price\CollectionFactory $priceColFactory, - \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository, - \Magento\Catalog\Api\ProductRepositoryInterface $productRepository, - \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory, - \Magento\ProductAlert\Model\ResourceModel\Stock\CollectionFactory $stockColFactory, - \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder, - \Magento\ProductAlert\Model\EmailFactory $emailFactory, - \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation, - ProductSalability $productSalability = null + ScopeConfigInterface $scopeConfig, + StoreManagerInterface $storeManager, + PriceCollectionFactory $priceCollectionFactory, + StockCollectionFactory $stockCollectionFactory, + Publisher $publisher ) { - $this->_catalogData = $catalogData; - $this->_scopeConfig = $scopeConfig; - $this->_storeManager = $storeManager; - $this->_priceColFactory = $priceColFactory; - $this->customerRepository = $customerRepository; - $this->productRepository = $productRepository; - $this->_dateFactory = $dateFactory; - $this->_stockColFactory = $stockColFactory; - $this->_transportBuilder = $transportBuilder; - $this->_emailFactory = $emailFactory; - $this->inlineTranslation = $inlineTranslation; - $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); - $this->productSalability = $productSalability ?: $objectManager->get(ProductSalability::class); - } - - /** - * Retrieve website collection array - * - * @return array - * @throws \Exception - */ - protected function _getWebsites() - { - if ($this->_websites === null) { - try { - $this->_websites = $this->_storeManager->getWebsites(); - } catch (\Exception $e) { - $this->_errors[] = $e->getMessage(); - throw $e; - } - } - return $this->_websites; + $this->scopeConfig = $scopeConfig; + $this->storeManager = $storeManager; + $this->publisher = $publisher; + $this->priceCollectionFactory = $priceCollectionFactory; + $this->stockCollectionFactory = $stockCollectionFactory; } /** - * Process price emails - * - * @param \Magento\ProductAlert\Model\Email $email - * @return $this - * @throws \Exception - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) + * Process product alerts */ - protected function _processPrice(\Magento\ProductAlert\Model\Email $email) + public function process(): void { - $email->setType('price'); - foreach ($this->_getWebsites() as $website) { - /* @var $website \Magento\Store\Model\Website */ - if (!$website->getDefaultGroup() || !$website->getDefaultGroup()->getDefaultStore()) { - continue; - } - if (!$this->_scopeConfig->getValue( - self::XML_PATH_PRICE_ALLOW, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $website->getDefaultGroup()->getDefaultStore()->getId() - ) - ) { - continue; - } - try { - $collection = $this->_priceColFactory->create()->addWebsiteFilter( - $website->getId() - )->setCustomerOrder(); - } catch (\Exception $e) { - $this->_errors[] = $e->getMessage(); - throw $e; - } - - $previousCustomer = null; - $email->setWebsite($website); - foreach ($collection as $alert) { - $this->setAlertStoreId($alert, $email); - try { - if (!$previousCustomer || $previousCustomer->getId() != $alert->getCustomerId()) { - $customer = $this->customerRepository->getById($alert->getCustomerId()); - if ($previousCustomer) { - $email->send(); - } - if (!$customer) { - continue; - } - $previousCustomer = $customer; - $email->clean(); - $email->setCustomerData($customer); - } else { - $customer = $previousCustomer; - } - - $product = $this->productRepository->getById( - $alert->getProductId(), - false, - $website->getDefaultStore()->getId() - ); - - $product->setCustomerGroupId($customer->getGroupId()); - if ($alert->getPrice() > $product->getFinalPrice()) { - $productPrice = $product->getFinalPrice(); - $product->setFinalPrice($this->_catalogData->getTaxPrice($product, $productPrice)); - $product->setPrice($this->_catalogData->getTaxPrice($product, $product->getPrice())); - $email->addPriceProduct($product); - - $alert->setPrice($productPrice); - $alert->setLastSendDate($this->_dateFactory->create()->gmtDate()); - $alert->setSendCount($alert->getSendCount() + 1); - $alert->setStatus(1); - $alert->save(); - } - } catch (\Exception $e) { - $this->_errors[] = $e->getMessage(); - throw $e; + $alertTypes = [AlertProcessor::ALERT_TYPE_PRICE, AlertProcessor::ALERT_TYPE_STOCK]; + foreach ($alertTypes as $alertType) { + foreach ($this->storeManager->getWebsites() as $website) { + if (!$website->getDefaultGroup() || !$website->getDefaultGroup()->getDefaultStore()) { + continue; } - } - if ($previousCustomer) { - try { - $email->send(); - } catch (\Exception $e) { - $this->_errors[] = $e->getMessage(); - throw $e; - } - } - } - return $this; - } - - /** - * Process stock emails - * - * @param \Magento\ProductAlert\Model\Email $email - * @return $this - * @throws \Exception - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - protected function _processStock(\Magento\ProductAlert\Model\Email $email) - { - $email->setType('stock'); - - foreach ($this->_getWebsites() as $website) { - /* @var $website \Magento\Store\Model\Website */ - - if (!$website->getDefaultGroup() || !$website->getDefaultGroup()->getDefaultStore()) { - continue; - } - if (!$this->_scopeConfig->getValue( - self::XML_PATH_STOCK_ALLOW, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $website->getDefaultGroup()->getDefaultStore()->getId() - ) - ) { - continue; - } - try { - $collection = $this->_stockColFactory->create()->addWebsiteFilter( - $website->getId() - )->addStatusFilter( - 0 - )->setCustomerOrder(); - } catch (\Exception $e) { - $this->_errors[] = $e->getMessage(); - throw $e; - } - - $previousCustomer = null; - $email->setWebsite($website); - foreach ($collection as $alert) { - $this->setAlertStoreId($alert, $email); - try { - if (!$previousCustomer || $previousCustomer->getId() != $alert->getCustomerId()) { - $customer = $this->customerRepository->getById($alert->getCustomerId()); - if ($previousCustomer) { - $email->send(); - } - if (!$customer) { - continue; - } - $previousCustomer = $customer; - $email->clean(); - $email->setCustomerData($customer); - } else { - $customer = $previousCustomer; - } - - $product = $this->productRepository->getById( - $alert->getProductId(), - false, - $website->getDefaultStore()->getId() - ); + $storeId = $website->getDefaultGroup()->getDefaultStore()->getId(); - $product->setCustomerGroupId($customer->getGroupId()); - - if ($this->productSalability->isSalable($product, $website)) { - $email->addStockProduct($product); - - $alert->setSendDate($this->_dateFactory->create()->gmtDate()); - $alert->setSendCount($alert->getSendCount() + 1); - $alert->setStatus(1); - $alert->save(); - } - } catch (\Exception $e) { - $this->_errors[] = $e->getMessage(); - throw $e; + $allowConfigPath = $alertType === AlertProcessor::ALERT_TYPE_PRICE + ? self::XML_PATH_PRICE_ALLOW : self::XML_PATH_STOCK_ALLOW; + if (!$this->scopeConfig->getValue($allowConfigPath, ScopeInterface::SCOPE_STORE, $storeId)) { + continue; } - } - if ($previousCustomer) { - try { - $email->send(); - } catch (\Exception $e) { - $this->_errors[] = $e->getMessage(); - throw $e; + $customerIds = $this->loadCustomerIds($alertType, (int)$website->getId()); + if (!empty($customerIds)) { + $this->publisher->execute($alertType, $customerIds, (int)$website->getId()); } } } - - return $this; } /** - * Send email to administrator if error + * Load alert customers * - * @return $this + * @param string $alertType + * @param int $websiteId + * @return array */ - protected function _sendErrorEmail() + private function loadCustomerIds(string $alertType, int $websiteId): array { - if (count($this->_errors)) { - if (!$this->_scopeConfig->getValue( - self::XML_PATH_ERROR_TEMPLATE, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - ) { - return $this; - } - - $this->inlineTranslation->suspend(); - - $transport = $this->_transportBuilder->setTemplateIdentifier( - $this->_scopeConfig->getValue( - self::XML_PATH_ERROR_TEMPLATE, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - )->setTemplateOptions( - [ - 'area' => \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE, - 'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID, - ] - )->setTemplateVars( - ['warnings' => join("\n", $this->_errors)] - )->setFrom( - $this->_scopeConfig->getValue( - self::XML_PATH_ERROR_IDENTITY, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - )->addTo( - $this->_scopeConfig->getValue( - self::XML_PATH_ERROR_RECIPIENT, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - )->getTransport(); - - $transport->sendMessage(); - - $this->inlineTranslation->resume(); - $this->_errors[] = []; + switch ($alertType) { + case AlertProcessor::ALERT_TYPE_PRICE: + $alertCollection = $this->priceCollectionFactory->create(); + break; + case AlertProcessor::ALERT_TYPE_STOCK: + $alertCollection = $this->stockCollectionFactory->create(); + break; + default: + return []; } - return $this; - } - /** - * Run process send product alerts - * - * @return $this - */ - public function process() - { - /* @var $email \Magento\ProductAlert\Model\Email */ - $email = $this->_emailFactory->create(); - $this->_processPrice($email); - $this->_processStock($email); - $this->_sendErrorEmail(); - - return $this; - } - - /** - * Set alert store id. - * - * @param \Magento\ProductAlert\Model\Price|\Magento\ProductAlert\Model\Stock $alert - * @param Email $email - * @return Observer - */ - private function setAlertStoreId($alert, \Magento\ProductAlert\Model\Email $email) : Observer - { - $alertStoreId = $alert->getStoreId(); - if ($alertStoreId) { - $email->setStoreId((int)$alertStoreId); + $select = $alertCollection->getSelect(); + $select->reset(Select::COLUMNS); + $select->columns('customer_id') + ->group('customer_id'); + $select->where('website_id = ?', $websiteId); + if ($alertType === AlertProcessor::ALERT_TYPE_STOCK) { + $select->where('status = ?', 0); } - return $this; + return $alertCollection->getConnection()->fetchCol($select); } } diff --git a/app/code/Magento/ProductAlert/README.md b/app/code/Magento/ProductAlert/README.md index 7d5f51e8699d..27a747d6ed4c 100644 --- a/app/code/Magento/ProductAlert/README.md +++ b/app/code/Magento/ProductAlert/README.md @@ -1 +1,47 @@ -The Magento_ProductAlert module enables product alerts, which allow customers to sign up for emails about product price or stock status change. +# Magento_ProductAlert module + +This module enables product alerts, which allow customers to sign up for emails about product price or stock status change. + +## Installation + +Before installing this module, note that the Magento_ProductAlert is dependent on the following modules: +- `Magento_Catalog` +- `Magento_Customer` + +The Magento_ProductAlert module creates the following tables in the database: +- `product_alert_price` +- `product_alert_stock` + +All database schema changes made by this module are rolled back when the module gets disabled and setup:upgrade command is run. + +The Magento_ProductAlert module contains the recurring script. Script's modifications don't need to be manually reverted upon uninstallation. + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Extensibility + +Extension developers can interact with the Magento_ProductAlert module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_ProductAlert module. + +### Layouts + +This module introduces the following layouts in the `view/frontend/layout` directory: +- `catalog_product_view` +- `productalert_unsubscribe_email` + +For more information about a layout in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). + +## Additional information + +More information can get at articles: +- [Product Alerts](https://docs.magento.com/user-guide/catalog/inventory-product-alerts.html) +- [Product Alert Run Settings](https://docs.magento.com/user-guide/catalog/inventory-product-alert-run-settings.html) + +### Cron options + +Cron group configuration can be set at `etc/crontab.xml`: +- `catalog_product_alert` - send product alerts to customers + +[Learn how to configure and run cron in Magento.](http://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-cron.html). + diff --git a/app/code/Magento/ProductAlert/Test/Unit/Model/ObserverTest.php b/app/code/Magento/ProductAlert/Test/Unit/Model/ObserverTest.php index bc3ef7418320..e0a22173372c 100644 --- a/app/code/Magento/ProductAlert/Test/Unit/Model/ObserverTest.php +++ b/app/code/Magento/ProductAlert/Test/Unit/Model/ObserverTest.php @@ -7,23 +7,12 @@ namespace Magento\ProductAlert\Test\Unit\Model; -use Magento\Catalog\Api\ProductRepositoryInterface; -use Magento\Catalog\Model\Product; -use Magento\Customer\Api\CustomerRepositoryInterface; -use Magento\Customer\Api\Data\CustomerInterface; use Magento\Framework\App\Config\ScopeConfigInterface; -use Magento\Framework\DataObject; -use Magento\Framework\Mail\Template\TransportBuilder; -use Magento\Framework\ObjectManagerInterface; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\Framework\Translate\Inline\StateInterface; -use Magento\ProductAlert\Model\Email; use Magento\ProductAlert\Model\EmailFactory; +use Magento\ProductAlert\Model\Mailing\Publisher; use Magento\ProductAlert\Model\Observer; -use Magento\ProductAlert\Model\ProductSalability; -use Magento\Sitemap\Model\ResourceModel\Sitemap\Collection; -use Magento\Sitemap\Model\ResourceModel\Sitemap\CollectionFactory; -use Magento\Sitemap\Model\Sitemap; +use Magento\ProductAlert\Model\ResourceModel\Price\CollectionFactory as PriceCollectionFactory; +use Magento\ProductAlert\Model\ResourceModel\Stock\CollectionFactory as StockCollectionFactory; use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; use Magento\Store\Model\Website; @@ -34,17 +23,9 @@ * Class ObserverTest * * Is used to test Product Alert Observer - * - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - * @SuppressWarnings(PHPMD.TooManyFields) */ class ObserverTest extends TestCase { - /** - * @var ObjectManager - */ - private $objectManager; - /** * @var Observer */ @@ -55,368 +36,111 @@ class ObserverTest extends TestCase */ private $scopeConfigMock; - /** - * @var CollectionFactory|MockObject - */ - private $collectionFactoryMock; - - /** - * @var TransportBuilder|MockObject - */ - private $transportBuilderMock; - /** * @var StoreManagerInterface|MockObject */ private $storeManagerMock; /** - * @var StateInterface|MockObject - */ - private $inlineTranslationMock; - - /** - * @var Collection|MockObject - */ - private $sitemapCollectionMock; - - /** - * @var Sitemap|MockObject - */ - private $sitemapMock; - - /** - * @var EmailFactory|MockObject - */ - private $emailFactoryMock; - - /** - * @var Email|MockObject - */ - private $emailMock; - - /** - * @var \Magento\ProductAlert\Model\ResourceModel\Price\CollectionFactory|MockObject + * @var PriceCollectionFactory|MockObject */ private $priceColFactoryMock; /** - * @var \Magento\ProductAlert\Model\ResourceModel\Stock\CollectionFactory|MockObject + * @var StockCollectionFactory|MockObject */ private $stockColFactoryMock; /** - * @var Website|MockObject - */ - private $websiteMock; - - /** - * @var Store|MockObject + * @var Publisher */ - private $storeMock; + private $publisherMock; /** - * @var CustomerRepositoryInterface|MockObject - */ - private $customerRepositoryMock; - - /** - * @var ProductRepositoryInterface|MockObject - */ - private $productRepositoryMock; - - /** - * @var Product|MockObject - */ - private $productMock; - - /** - * @var ObjectManagerInterface|MockObject - */ - private $objectManagerMock; - - /** - * @var ProductSalability|MockObject - */ - private $productSalabilityMock; - - /** - * @return void + * @inheritdoc */ protected function setUp(): void { - $this->objectManagerMock = $this->getMockBuilder(ObjectManagerInterface::class) - ->getMock(); - $this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class) - ->getMock(); - $this->collectionFactoryMock = $this->getMockBuilder( - CollectionFactory::class - )->disableOriginalConstructor() - ->setMethods(['create']) - ->getMock(); - $this->transportBuilderMock = $this->getMockBuilder(TransportBuilder::class) - ->disableOriginalConstructor() - ->getMock(); - $this->storeManagerMock = $this->getMockBuilder(StoreManagerInterface::class) - ->getMock(); - $this->inlineTranslationMock = $this->getMockBuilder(StateInterface::class) - ->getMock(); - $this->sitemapCollectionMock = $this->createPartialMock( - Collection::class, - ['getIterator'] - ); - $this->sitemapMock = $this->createPartialMock(Sitemap::class, ['generateXml']); - - $this->emailFactoryMock = $this->getMockBuilder( - EmailFactory::class - )->disableOriginalConstructor() - ->setMethods(['create']) - ->getMock(); - $this->emailMock = $this->getMockBuilder(Email::class) - ->disableOriginalConstructor() - ->getMock(); - $this->priceColFactoryMock = $this->getMockBuilder( - \Magento\ProductAlert\Model\ResourceModel\Price\CollectionFactory::class - )->disableOriginalConstructor() - ->setMethods(['create', 'addWebsiteFilter', 'setCustomerOrder']) - ->getMock(); - $this->stockColFactoryMock = $this->getMockBuilder( - \Magento\ProductAlert\Model\ResourceModel\Stock\CollectionFactory::class - )->disableOriginalConstructor() - ->setMethods(['create', 'addWebsiteFilter', 'setCustomerOrder', 'addStatusFilter']) - ->getMock(); - - $this->websiteMock = $this->createPartialMock( - Website::class, - ['getDefaultGroup', 'getDefaultStore'] - ); - $this->storeMock = $this->getMockBuilder(Store::class) - ->disableOriginalConstructor() - ->setMethods(['getDefaultStore', 'getId', 'setWebsiteId']) - ->getMock(); - $this->customerRepositoryMock = $this->getMockBuilder(CustomerRepositoryInterface::class) - ->getMock(); - $this->productRepositoryMock = $this->getMockBuilder(ProductRepositoryInterface::class) - ->getMock(); - $this->productMock = $this->getMockBuilder(Product::class) - ->disableOriginalConstructor() - ->setMethods( - [ - 'setCustomerGroupId', - 'getFinalPrice', - ] - )->getMock(); - - $this->productSalabilityMock = $this->createPartialMock(ProductSalability::class, ['isSalable']); - - $this->objectManager = new ObjectManager($this); - $this->observer = $this->objectManager->getObject( - Observer::class, - [ - 'scopeConfig' => $this->scopeConfigMock, - 'collectionFactory' => $this->collectionFactoryMock, - 'storeManager' => $this->storeManagerMock, - 'transportBuilder' => $this->transportBuilderMock, - 'inlineTranslation' => $this->inlineTranslationMock, - 'emailFactory' => $this->emailFactoryMock, - 'priceColFactory' => $this->priceColFactoryMock, - 'stockColFactory' => $this->stockColFactoryMock, - 'customerRepository' => $this->customerRepositoryMock, - 'productRepository' => $this->productRepositoryMock, - 'productSalability' => $this->productSalabilityMock - ] + $this->scopeConfigMock = $this->createMock(ScopeConfigInterface::class); + $this->storeManagerMock = $this->createMock(StoreManagerInterface::class); + $this->priceColFactoryMock = $this->createMock(PriceCollectionFactory::class); + $this->stockColFactoryMock = $this->createMock(StockCollectionFactory::class); + $this->publisherMock = $this->createMock(Publisher::class); + + $this->observer = new Observer( + $this->scopeConfigMock, + $this->storeManagerMock, + $this->priceColFactoryMock, + $this->stockColFactoryMock, + $this->publisherMock ); } - public function testGetWebsitesThrowsException() - { - $this->expectException('Exception'); - $this->scopeConfigMock->expects($this->any())->method('isSetFlag')->willReturn(false); - - $this->emailFactoryMock->expects($this->once())->method('create')->willReturn($this->emailMock); - - $this->storeManagerMock->expects($this->once())->method('getWebsites')->willThrowException(new \Exception()); - - $this->observer->process(); - } - - public function testProcessPriceThrowsException() + /** + * Test process alerts with exception in loading websites + */ + public function testGetWebsitesThrowsException(): void { - $this->expectException('Exception'); - $this->scopeConfigMock->expects($this->any())->method('isSetFlag')->willReturn(false); - - $this->emailFactoryMock->expects($this->once())->method('create')->willReturn($this->emailMock); + $message = 'get website exception'; + $this->expectException(\Exception::class); + $this->expectErrorMessage($message); - $this->storeManagerMock->expects($this->once())->method('getWebsites')->willReturn([$this->websiteMock]); - $this->websiteMock->expects($this->any())->method('getDefaultGroup')->willReturn($this->storeMock); - $this->storeMock->expects($this->any())->method('getDefaultStore')->willReturnSelf(); - - $this->scopeConfigMock->expects($this->once())->method('getValue')->willReturn(true); - - $this->priceColFactoryMock->expects($this->once())->method('create')->willThrowException(new \Exception()); + $this->scopeConfigMock->method('isSetFlag')->willReturn(false); + $this->storeManagerMock->method('getWebsites') + ->willThrowException(new \Exception($message)); $this->observer->process(); } - public function testProcessPriceCustomerRepositoryThrowsException() - { - $this->expectException('Exception'); - $this->scopeConfigMock->expects($this->any())->method('isSetFlag')->willReturn(false); - - $this->emailFactoryMock->expects($this->once())->method('create')->willReturn($this->emailMock); - - $this->storeManagerMock->expects($this->once())->method('getWebsites')->willReturn([$this->websiteMock]); - $this->websiteMock->expects($this->any())->method('getDefaultGroup')->willReturn($this->storeMock); - $this->storeMock->expects($this->any())->method('getDefaultStore')->willReturnSelf(); - - $this->scopeConfigMock->expects($this->once())->method('getValue')->willReturn(true); - - $this->priceColFactoryMock->expects($this->once())->method('create')->willReturnSelf(); - $this->priceColFactoryMock->expects($this->once())->method('addWebsiteFilter')->willReturnSelf(); - $items = [ - new DataObject([ - 'customer_id' => '42' - ]) - ]; - - $this->priceColFactoryMock->expects($this->once()) - ->method('setCustomerOrder') - ->willReturn(new \ArrayIterator($items)); - - $this->customerRepositoryMock->expects($this->once())->method('getById')->willThrowException(new \Exception()); - - $this->observer->process(); - } - - public function testProcessPriceEmailThrowsException() + /** + * Test process alerts with exception in creating price collection + */ + public function testProcessPriceThrowsException(): void { - $this->expectException('Exception'); - $id = 1; - $this->scopeConfigMock->expects($this->any())->method('isSetFlag')->willReturn(false); + $message = 'create collection exception'; + $this->expectException(\Exception::class); + $this->expectErrorMessage($message); - $this->emailFactoryMock->expects($this->once())->method('create')->willReturn($this->emailMock); + $groupMock = $this->createMock(\Magento\Store\Model\Group::class); + $storeMock = $this->createMock(Store::class); + $groupMock->method('getDefaultStore')->willReturn($storeMock); - $this->storeManagerMock->expects($this->once())->method('getWebsites')->willReturn([$this->websiteMock]); - $this->websiteMock->expects($this->any())->method('getDefaultGroup')->willReturn($this->storeMock); - $this->storeMock->expects($this->any())->method('getDefaultStore')->willReturnSelf(); - $this->websiteMock->expects($this->once())->method('getDefaultStore')->willReturn($this->storeMock); - $this->storeMock->expects($this->any())->method('getId')->willReturn(2); - $this->storeMock->expects($this->any())->method('setWebsiteId')->willReturnSelf(); + $websiteMock = $this->createMock(Website::class); + $websiteMock->method('getDefaultGroup')->willReturn($groupMock); + $this->storeManagerMock->method('getWebsites')->willReturn([$websiteMock]); - $this->scopeConfigMock->expects($this->once())->method('getValue')->willReturn(true); + $this->scopeConfigMock->method('getValue')->willReturn(true); - $this->priceColFactoryMock->expects($this->once())->method('create')->willReturnSelf(); - $this->priceColFactoryMock->expects($this->once())->method('addWebsiteFilter')->willReturnSelf(); - $this->storeManagerMock->expects($this->any())->method('getStore')->willReturn($this->storeMock); - $items = [ - new DataObject([ - 'customer_id' => $id - ]) - ]; $this->priceColFactoryMock->expects($this->once()) - ->method('setCustomerOrder') - ->willReturn(new \ArrayIterator($items)); - - $customerMock = $this->getMockForAbstractClass(CustomerInterface::class); - $this->customerRepositoryMock->expects($this->once())->method('getById')->willReturn($customerMock); - - $this->productMock->expects($this->once())->method('setCustomerGroupId')->willReturnSelf(); - $this->productMock->expects($this->once())->method('getFinalPrice')->willReturn('655.99'); - $this->productRepositoryMock->expects($this->once())->method('getById')->willReturn($this->productMock); - - $this->emailMock->expects($this->once())->method('send')->willThrowException(new \Exception()); - - $this->observer->process(); - } - - public function testProcessStockThrowsException() - { - $this->expectException('Exception'); - $this->scopeConfigMock->expects($this->any())->method('isSetFlag')->willReturn(false); - - $this->emailFactoryMock->expects($this->once())->method('create')->willReturn($this->emailMock); - - $this->storeManagerMock->expects($this->once())->method('getWebsites')->willReturn([$this->websiteMock]); - $this->websiteMock->expects($this->any())->method('getDefaultGroup')->willReturn($this->storeMock); - $this->storeMock->expects($this->any())->method('getDefaultStore')->willReturnSelf(); - - $this->scopeConfigMock->expects($this->at(0))->method('getValue')->willReturn(false); - $this->scopeConfigMock->expects($this->at(1))->method('getValue')->willReturn(true); - - $this->stockColFactoryMock->expects($this->once())->method('create')->willThrowException(new \Exception()); + ->method('create') + ->willThrowException(new \Exception($message)); $this->observer->process(); } - public function testProcessStockCustomerRepositoryThrowsException() - { - $this->expectException('Exception'); - $this->scopeConfigMock->expects($this->any())->method('isSetFlag')->willReturn(false); - - $this->emailFactoryMock->expects($this->once())->method('create')->willReturn($this->emailMock); - - $this->storeManagerMock->expects($this->once())->method('getWebsites')->willReturn([$this->websiteMock]); - $this->websiteMock->expects($this->any())->method('getDefaultGroup')->willReturn($this->storeMock); - $this->storeMock->expects($this->any())->method('getDefaultStore')->willReturnSelf(); - - $this->scopeConfigMock->expects($this->at(0))->method('getValue')->willReturn(false); - $this->scopeConfigMock->expects($this->at(1))->method('getValue')->willReturn(true); - - $this->stockColFactoryMock->expects($this->once())->method('create')->willReturnSelf(); - $this->stockColFactoryMock->expects($this->once())->method('addWebsiteFilter')->willReturnSelf(); - $this->stockColFactoryMock->expects($this->once())->method('addStatusFilter')->willReturnSelf(); - $items = [ - new DataObject([ - 'customer_id' => '42' - ]) - ]; - - $this->stockColFactoryMock->expects($this->once()) - ->method('setCustomerOrder') - ->willReturn(new \ArrayIterator($items)); - - $this->customerRepositoryMock->expects($this->once())->method('getById')->willThrowException(new \Exception()); - - $this->observer->process(); - } - - public function testProcessStockEmailThrowsException() + /** + * Test process alerts with exception in creating stock collection + */ + public function testProcessStockThrowsException(): void { - $this->expectException('Exception'); - $this->scopeConfigMock->expects($this->any())->method('isSetFlag')->willReturn(false); + $message = 'create collection exception'; + $this->expectException(\Exception::class); + $this->expectErrorMessage($message); - $this->emailFactoryMock->expects($this->once())->method('create')->willReturn($this->emailMock); + $groupMock = $this->createMock(\Magento\Store\Model\Group::class); + $storeMock = $this->createMock(Store::class); + $groupMock->method('getDefaultStore')->willReturn($storeMock); - $this->storeManagerMock->expects($this->once())->method('getWebsites')->willReturn([$this->websiteMock]); - $this->websiteMock->expects($this->any())->method('getDefaultGroup')->willReturn($this->storeMock); - $this->storeMock->expects($this->any())->method('getDefaultStore')->willReturnSelf(); - $this->websiteMock->expects($this->once())->method('getDefaultStore')->willReturn($this->storeMock); - $this->storeMock->expects($this->any())->method('getId')->willReturn(2); + $websiteMock = $this->createMock(Website::class); + $websiteMock->method('getDefaultGroup')->willReturn($groupMock); + $this->storeManagerMock->method('getWebsites')->willReturn([$websiteMock]); $this->scopeConfigMock->expects($this->at(0))->method('getValue')->willReturn(false); $this->scopeConfigMock->expects($this->at(1))->method('getValue')->willReturn(true); - $this->stockColFactoryMock->expects($this->once())->method('create')->willReturnSelf(); - $this->stockColFactoryMock->expects($this->once())->method('addWebsiteFilter')->willReturnSelf(); - $this->stockColFactoryMock->expects($this->once())->method('addStatusFilter')->willReturnSelf(); - $items = [ - new DataObject([ - 'customer_id' => '42' - ]) - ]; - $this->stockColFactoryMock->expects($this->once()) - ->method('setCustomerOrder') - ->willReturn(new \ArrayIterator($items)); - - $customerMock = $this->getMockForAbstractClass(CustomerInterface::class); - $this->customerRepositoryMock->expects($this->once())->method('getById')->willReturn($customerMock); - - $this->productMock->expects($this->once())->method('setCustomerGroupId')->willReturnSelf(); - $this->productSalabilityMock->expects($this->once())->method('isSalable')->willReturn(false); - $this->productRepositoryMock->expects($this->once())->method('getById')->willReturn($this->productMock); - - $this->emailMock->expects($this->once())->method('send')->willThrowException(new \Exception()); + ->method('create') + ->willThrowException(new \Exception($message)); $this->observer->process(); } diff --git a/app/code/Magento/ProductAlert/composer.json b/app/code/Magento/ProductAlert/composer.json index bfe2a43b373c..ed704c160ca1 100644 --- a/app/code/Magento/ProductAlert/composer.json +++ b/app/code/Magento/ProductAlert/composer.json @@ -7,6 +7,9 @@ "require": { "php": "~7.3.0||~7.4.0", "magento/framework": "*", + "magento/framework-bulk": "*", + "magento/module-asynchronous-operations": "*", + "magento/module-authorization": "*", "magento/module-backend": "*", "magento/module-catalog": "*", "magento/module-customer": "*", diff --git a/app/code/Magento/ProductAlert/etc/communication.xml b/app/code/Magento/ProductAlert/etc/communication.xml new file mode 100644 index 000000000000..e67da2fefd4c --- /dev/null +++ b/app/code/Magento/ProductAlert/etc/communication.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Communication/etc/communication.xsd"> + <topic name="product_alert" request="Magento\AsynchronousOperations\Api\Data\OperationInterface"> + <handler name="productAlert" type="Magento\ProductAlert\Model\Mailing\Consumer" method="process"/> + </topic> +</config> diff --git a/app/code/Magento/ProductAlert/etc/queue.xml b/app/code/Magento/ProductAlert/etc/queue.xml new file mode 100644 index 000000000000..b59307f89c92 --- /dev/null +++ b/app/code/Magento/ProductAlert/etc/queue.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/queue.xsd"> + <broker topic="product_alert" exchange="magento-db" type="db"> + <queue name="product_alert.queue" consumer="product_alert"/> + </broker> +</config> diff --git a/app/code/Magento/ProductAlert/etc/queue_consumer.xml b/app/code/Magento/ProductAlert/etc/queue_consumer.xml new file mode 100644 index 000000000000..d7de59f54e7f --- /dev/null +++ b/app/code/Magento/ProductAlert/etc/queue_consumer.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/consumer.xsd"> + <consumer name="product_alert" queue="product_alert.queue" connection="db"/> +</config> diff --git a/app/code/Magento/ProductAlert/view/frontend/web/js/form-submitter.js b/app/code/Magento/ProductAlert/view/frontend/web/js/form-submitter.js index 7a0d5f663f3f..68160c881fbb 100644 --- a/app/code/Magento/ProductAlert/view/frontend/web/js/form-submitter.js +++ b/app/code/Magento/ProductAlert/view/frontend/web/js/form-submitter.js @@ -10,6 +10,6 @@ define([ return function (data, element) { - $(element).submit(); + $(element).trigger('submit'); }; }); diff --git a/app/code/Magento/ProductVideo/Controller/Adminhtml/Product/Gallery/RetrieveImage.php b/app/code/Magento/ProductVideo/Controller/Adminhtml/Product/Gallery/RetrieveImage.php index 914b5fa27171..dae322fbff3b 100644 --- a/app/code/Magento/ProductVideo/Controller/Adminhtml/Product/Gallery/RetrieveImage.php +++ b/app/code/Magento/ProductVideo/Controller/Adminhtml/Product/Gallery/RetrieveImage.php @@ -180,7 +180,8 @@ protected function appendResultSaveRemoteImage($fileName) $result['name'] = $fileInfo['basename']; $result['type'] = $this->imageAdapter->getMimeType(); $result['error'] = 0; - $result['size'] = filesize($this->appendAbsoluteFileSystemPath($fileName)); + $result['size'] = $this->fileSystem->getDirectoryWrite(DirectoryList::MEDIA) + ->getDriver()->stat(($this->appendAbsoluteFileSystemPath($fileName)))['size']; $result['url'] = $this->mediaConfig->getTmpMediaUrl($tmpFileName); $result['file'] = $tmpFileName; return $result; diff --git a/app/code/Magento/ProductVideo/README.md b/app/code/Magento/ProductVideo/README.md index e94e5aba8aba..76a8036e9c3c 100644 --- a/app/code/Magento/ProductVideo/README.md +++ b/app/code/Magento/ProductVideo/README.md @@ -1 +1,46 @@ -The Magento_ProductVideo module implements functionality related with linking video files from external resources to product. +# Magento_ProductVideo module + +This module implements functionality related with linking video files from external resources to product. + +## Installation + +Before installing this module, note that the Magento_ProductAlert is dependent on the following modules: +- `Magento_Catalog` +- `Magento_Backend` + +The Magento_ProductVideo module creates the `catalog_product_entity_media_gallery_value_video` table in the database. + +All database schema changes made by this module are rolled back when the module gets disabled and setup:upgrade command is run. + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Extensibility + +Extension developers can interact with the Magento_ProductVideo module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_ProductVideo module. + +A lot of functionality in the module is on JavaScript, use [mixins](https://devdocs.magento.com/guides/v2.4/javascript-dev-guide/javascript/js_mixins.html) to extend it. + +### Layouts + +This module introduces the following layouts in the `view/frontend/layout` and `view/adminhtml/layout` directories: +- `view/adminhtml/layout` + - `catalog_product_new` +- `view/frontend/layout` + - `catalog_product_view` + +For more information about a layout in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). + +### UI components + +This module extends following ui components located in the `view/adminhtml/ui_component` directory: +- `product_form` + +For information about a UI component in Magento 2, see [Overview of UI components](http://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). + +## Additional information + +More information can get at articles: +- [Learn how to add Product Video](https://docs.magento.com/user-guide/catalog/product-video.html) +- [Learn how to configure Product Video](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/themes/product-video.html) diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNavigationArrowsActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNavigationArrowsActionGroup.xml new file mode 100644 index 000000000000..72627f7e8dfe --- /dev/null +++ b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNavigationArrowsActionGroup.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <!-- Assert the navigation arrows on Storefront Product page --> + <actionGroup name="AssertProductVideoNavigationArrowsActionGroup"> + <annotations> + <description>Validates the navigation arrows on the Storefront Product page.</description> + </annotations> + <arguments> + <argument name="videoType" type="string" defaultValue="vimeo"/> + </arguments> + + <dontSeeElement selector="{{StorefrontProductMediaSection.imagePrevButton}}" stepKey="dontSeePrevButton"/> + <moveMouseOver selector="{{StorefrontProductInfoMainSection.clickPlayVideo}}" stepKey="hoverOverImage"/> + <waitForElementVisible selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="seeNextButton"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickNextButton"/> + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.productVideo(videoType)}}" stepKey="seeProductVideoDataType"/> + + <dontSeeElement selector="{{StorefrontProductInfoMainSection.clickCloseVideo}}" stepKey="dontSeeCloseVideo"/> + + <click selector="{{StorefrontProductInfoMainSection.clickPlayVideo}}" stepKey="clickToPlayVideo"/> + <wait time="5" stepKey="waitFiveSecondsToPlayVideo"/> + + <dontSeeElement selector="{{StorefrontProductMediaSection.imagePrevButton}}" stepKey="dontSeePrevButtonSecond"/> + <dontSeeElement selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="dontSeeNextButton"/> + + <seeElement selector="{{StorefrontProductInfoMainSection.clickCloseVideo}}" stepKey="seeCloseVideo"/> + <click selector="{{StorefrontProductInfoMainSection.clickCloseVideo}}" stepKey="clickToCloseVideo"/> + <wait time="2" stepKey="waitTwoSecondsToCloseVideo"/> + <dontSeeElementInDOM selector="{{StorefrontProductMediaSection.galleryNoControlsElement}}" stepKey="videoFocused"/> + <moveMouseOver selector="{{StorefrontCMSPageSection.mainTitle}}" stepKey="unFocusVideo"/> + <waitForElement selector="{{StorefrontProductMediaSection.galleryNoControlsElement}}" stepKey="waitForVideoUnFocus"/> + + <moveMouseOver selector="{{StorefrontProductInfoMainSection.clickPlayVideo}}" stepKey="hoverOverImageSecond"/> + <waitForElementVisible selector="{{StorefrontProductMediaSection.imagePrevButton}}" stepKey="seePrevButton"/> + <click selector="{{StorefrontProductMediaSection.imagePrevButton}}" stepKey="clickPrevButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoStorefrontProductPageActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoStorefrontProductPageActionGroup.xml index 61747c331247..53432ec0fd6a 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoStorefrontProductPageActionGroup.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoStorefrontProductPageActionGroup.xml @@ -17,6 +17,7 @@ <argument name="videoType" type="string" defaultValue="youtube"/> </arguments> + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.productVideo(videoType)}}" stepKey="waitVideoElementVisible"/> <seeElement selector="{{StorefrontProductInfoMainSection.productVideo(videoType)}}" stepKey="seeProductVideoDataType"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Data/ProductVideoData.xml b/app/code/Magento/ProductVideo/Test/Mftf/Data/ProductVideoData.xml index 6ecbdf6d31de..d21c657f381f 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/Data/ProductVideoData.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/Data/ProductVideoData.xml @@ -18,4 +18,7 @@ <data key="videoTitle">The New Vimeo Player (You Know, For Videos)</data> <data key="videoShortTitle">The New Vimeo Player</data> </entity> + <entity name="VimeoPrivateVideo" type="product_video"> + <data key="videoUrl">https://vimeo.com/313826626</data> + </entity> </entities> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Section/StorefrontProductInfoMainSection.xml b/app/code/Magento/ProductVideo/Test/Mftf/Section/StorefrontProductInfoMainSection.xml index e94d426ba763..44c65c197f7d 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/Section/StorefrontProductInfoMainSection.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/Section/StorefrontProductInfoMainSection.xml @@ -14,5 +14,7 @@ <element name="videoPausedMode" type="button" selector="//*[contains(@class, 'paused-mode')]"/> <element name="videoPlayedMode" type="button" selector="//*[contains(@class,'playing-mode')]"/> <element name="frameVideo" type="button" selector="widget2"/> + <element name="clickPlayVideo" type="block" selector="//*[contains(@class,'fotorama__stage__shaft')]"/> + <element name="clickCloseVideo" type="block" selector="//*[@class='fotorama__video-close fotorama-show-control']"/> </section> </sections> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminValidatePrivacyOnVimeoGetVideoInformationTest.xml b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminValidatePrivacyOnVimeoGetVideoInformationTest.xml new file mode 100644 index 000000000000..7d30ab70bfa6 --- /dev/null +++ b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminValidatePrivacyOnVimeoGetVideoInformationTest.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminValidatePrivacyOnVimeoGetVideoInformationTest"> + <annotations> + <features value="ProductVideo"/> + <stories value="Add/remove images and videos for all product types and category"/> + <title value="Admin validates Vimeo video privacy when getting video information"/> + <description value="Admin should be able to see warning message when adding Vimeo video with restricted privacy privacy when getting video information"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-42471"/> + <useCaseId value="MC-42105"/> + <group value="productVideo"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="openNewProductPage"/> + <actionGroup ref="AdminOpenProductVideoModalActionGroup" stepKey="openAddProductVideoModal"/> + <actionGroup ref="AdminFillProductVideoFieldActionGroup" stepKey="fillVideoUrlField"> + <argument name="input" value="{{AdminProductNewVideoSection.videoUrlTextField}}"/> + <argument name="value" value="{{VimeoPrivateVideo.videoUrl}}"/> + </actionGroup> + <actionGroup ref="AdminGetVideoInformationActionGroup" stepKey="clickOnGetVideoInformation"/> + <waitForElementVisible selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForWarningMessage"/> + <see selector="{{AdminConfirmationModalSection.message}}" userInput='Because of its privacy settings, this video cannot be played here.' stepKey="seeAdminWarningMessage"/> + </test> +</tests> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Test/VimeoVideoControlButtonsOnProductPageTest.xml b/app/code/Magento/ProductVideo/Test/Mftf/Test/VimeoVideoControlButtonsOnProductPageTest.xml new file mode 100644 index 000000000000..a60a5526498c --- /dev/null +++ b/app/code/Magento/ProductVideo/Test/Mftf/Test/VimeoVideoControlButtonsOnProductPageTest.xml @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="VimeoVideoControlButtonsOnProductPageTest"> + <annotations> + <features value="ProductVideo"/> + <stories value="Navigation arrow buttons not visible after video starts on product image"/> + <title value="Navigation arrow buttons not visible after video starts on product image"/> + <description value="Navigation arrow buttons not visible after video starts on product image"/> + <severity value="MAJOR"/> + <testCaseId value="MC-40398"/> + <useCaseId value="MC-39759"/> + <group value="productVideo"/> + </annotations> + <before> + <createData entity="SimpleProduct2" stepKey="createProduct"/> + <!-- Login to Admin page --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <!-- Logout from Admin page --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <!-- Open product edit page --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> + <argument name="productId" value="$createProduct.id$"/> + </actionGroup> + <!-- Add image to product --> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> + <argument name="image" value="MagentoLogo"/> + </actionGroup> + <!-- Add product video --> + <actionGroup ref="AddProductVideoActionGroup" stepKey="addProductVideo"> + <argument name="video" value="VimeoProductVideo"/> + </actionGroup> + <!-- Save product form --> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> + + <!-- Open storefront product page --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goToStorefrontProductPage"> + <argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/> + </actionGroup> + + <!-- Check the navigation arrows on Storefront Product page --> + <actionGroup ref="AssertProductVideoNavigationArrowsActionGroup" stepKey="assertProductVideoNavigationArrowsOnStorefrontProductPage"> + <argument name="videoType" value="vimeo"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml b/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml index cc2c93381235..3bc76cbc9c5b 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml @@ -53,7 +53,7 @@ <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveFirstProduct"/> <!-- Assert product video in storefront product page --> - <amOnPage url="$$createProduct.name$$.html" stepKey="goToStorefrontCategoryPage"/> + <amOnPage url="$$createProduct.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage"/> <waitForPageLoad stepKey="waitForStorefrontPageLoaded"/> <actionGroup ref="AssertProductVideoStorefrontProductPageActionGroup" stepKey="assertProductVideoStorefrontProductPage" after="waitForStorefrontPageLoaded"/> diff --git a/app/code/Magento/ProductVideo/Test/Unit/Controller/Adminhtml/Product/Gallery/RetrieveImageTest.php b/app/code/Magento/ProductVideo/Test/Unit/Controller/Adminhtml/Product/Gallery/RetrieveImageTest.php index 770eaf1d3d34..61369502bcb5 100644 --- a/app/code/Magento/ProductVideo/Test/Unit/Controller/Adminhtml/Product/Gallery/RetrieveImageTest.php +++ b/app/code/Magento/ProductVideo/Test/Unit/Controller/Adminhtml/Product/Gallery/RetrieveImageTest.php @@ -10,6 +10,7 @@ use Magento\Backend\App\Action\Context; use Magento\Catalog\Model\Product\Media\Config; use Magento\Framework\App\RequestInterface; +use Magento\Framework\Controller\Result\Raw; use Magento\Framework\Controller\Result\RawFactory; use Magento\Framework\DataObject; use Magento\Framework\Filesystem; @@ -99,6 +100,11 @@ class RetrieveImageTest extends TestCase */ private $fileDriverMock; + /** + * @var Raw|MockObject + */ + private $responseMock; + private function setupObjectManagerForCheckImageExist($return) { $objectManagerMock = $this->getMockForAbstractClass(ObjectManagerInterface::class); @@ -119,8 +125,8 @@ protected function setUp(): void ->createMock(NotProtectedExtension::class); $this->rawFactoryMock = $this->createPartialMock(RawFactory::class, ['create']); - $response = new DataObject(); - $this->rawFactoryMock->expects($this->once())->method('create')->willReturn($response); + $this->responseMock = $this->createMock(Raw::class); + $this->rawFactoryMock->expects($this->once())->method('create')->willReturn($this->responseMock); $this->configMock = $this->createMock(Config::class); $this->filesystemMock = $this->createMock(Filesystem::class); $this->adapterMock = @@ -140,6 +146,8 @@ protected function setUp(): void ->getMockForAbstractClass(); $this->contextMock->expects($this->any())->method('getRequest')->willReturn($this->request); $this->contextMock->expects($this->any())->method('getObjectManager')->willReturn($managerMock); + $this->fileDriverMock->method('stat') + ->willReturn(['size' => 200]); $this->image = $objectManager->getObject( RetrieveImage::class, @@ -172,12 +180,24 @@ public function testExecute() $writeInterface = $this->createMock( WriteInterface::class ); + $writeInterface->method('getDriver') + ->willReturn($this->fileDriverMock); $this->filesystemMock->expects($this->any())->method('getDirectoryRead')->willReturn($readInterface); $readInterface->expects($this->any())->method('getAbsolutePath')->willReturn(''); $this->abstractAdapter->expects($this->any())->method('validateUploadFile')->willReturn('true'); $this->validatorMock->expects($this->once())->method('isValid')->with('jpg')->willReturn('true'); $this->filesystemMock->expects($this->once())->method('getDirectoryWrite')->willReturn($writeInterface); $this->curlMock->expects($this->once())->method('read')->willReturn('testimage'); + $this->responseMock->expects(self::once()) + ->method('setContents') + ->with(json_encode([ + 'name' => 'test.jpg', + 'type' => null, + 'error' => 0, + 'size' => 200, + 'url' => null, + 'file' => '/t/e/test.jpg' + ], JSON_THROW_ON_ERROR)); $this->image->execute(); } @@ -192,6 +212,8 @@ public function testExecuteInvalidFileImage() ); $readInterface = $this->createMock(ReadInterface::class); $writeInterface = $this->createMock(WriteInterface::class); + $writeInterface->method('getDriver') + ->willReturn($this->fileDriverMock); $this->filesystemMock->expects($this->any())->method('getDirectoryRead')->willReturn($readInterface); $readInterface->expects($this->any())->method('getAbsolutePath')->willReturn(''); $this->abstractAdapter->expects($this->any()) @@ -216,6 +238,8 @@ public function testExecuteInvalidFileType() ); $readInterface = $this->createMock(ReadInterface::class); $writeInterface = $this->createMock(WriteInterface::class); + $writeInterface->method('getDriver') + ->willReturn($this->fileDriverMock); $this->filesystemMock->expects($this->any())->method('getDirectoryRead')->willReturn($readInterface); $readInterface->expects($this->any())->method('getAbsolutePath')->willReturn(''); $this->abstractAdapter->expects($this->never())->method('validateUploadFile'); diff --git a/app/code/Magento/ProductVideo/etc/csp_whitelist.xml b/app/code/Magento/ProductVideo/etc/csp_whitelist.xml index ca4536057104..dd5cdc37496e 100644 --- a/app/code/Magento/ProductVideo/etc/csp_whitelist.xml +++ b/app/code/Magento/ProductVideo/etc/csp_whitelist.xml @@ -10,15 +10,23 @@ <policies> <policy id="script-src"> <values> - <value id="youtube_cdn" type="host">s.ytimg.com</value> - <value id="google_video" type="host">www.googleapis.com</value> + <value id="youtube_script" type="host">s.ytimg.com</value> + <value id="google_apis" type="host">www.googleapis.com</value> <value id="vimeo" type="host">vimeo.com</value> <value id="www_vimeo" type="host">www.vimeo.com</value> + <value id="vimeo_cdn" type="host">*.vimeocdn.com</value> </values> </policy> <policy id="img-src"> <values> <value id="vimeo_cdn" type="host">*.vimeocdn.com</value> + <value id="youtube_image" type="host">i.ytimg.com</value> + </values> + </policy> + <policy id="frame-src"> + <values> + <value id="player_vimeo" type="host">player.vimeo.com</value> + <value id="player_youtube" type="host">*.youtube.com</value> </values> </policy> </policies> diff --git a/app/code/Magento/ProductVideo/etc/db_schema.xml b/app/code/Magento/ProductVideo/etc/db_schema.xml index aa3dff4a2798..a0fbb8e70d7f 100644 --- a/app/code/Magento/ProductVideo/etc/db_schema.xml +++ b/app/code/Magento/ProductVideo/etc/db_schema.xml @@ -25,7 +25,7 @@ <constraint xsi:type="foreign" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_STORE_ID_STORE_STORE_ID" table="catalog_product_entity_media_gallery_value_video" column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="CASCADE"/> - <constraint xsi:type="unique" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_VAL_ID_STORE_ID"> + <constraint xsi:type="primary" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_VAL_ID_STORE_ID"> <column name="value_id"/> <column name="store_id"/> </constraint> diff --git a/app/code/Magento/ProductVideo/etc/db_schema_whitelist.json b/app/code/Magento/ProductVideo/etc/db_schema_whitelist.json index 78fa6538da07..8515dfa1e55b 100644 --- a/app/code/Magento/ProductVideo/etc/db_schema_whitelist.json +++ b/app/code/Magento/ProductVideo/etc/db_schema_whitelist.json @@ -10,9 +10,10 @@ "metadata": true }, "constraint": { + "PRIMARY": true, "FK_6FDF205946906B0E653E60AA769899F8": true, "CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_STORE_ID_STORE_STORE_ID": true, "CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_VAL_ID_STORE_ID": true } } -} \ No newline at end of file +} diff --git a/app/code/Magento/ProductVideo/i18n/en_US.csv b/app/code/Magento/ProductVideo/i18n/en_US.csv index debcab151cc9..368a83985ba8 100644 --- a/app/code/Magento/ProductVideo/i18n/en_US.csv +++ b/app/code/Magento/ProductVideo/i18n/en_US.csv @@ -41,3 +41,4 @@ Delete,Delete "Show related video","Show related video" "Auto restart video","Auto restart video" "Delete image in all store views","Delete image in all store views" +"Because of its privacy settings, this video cannot be played here.","Because of its privacy settings, this video cannot be played here." diff --git a/app/code/Magento/ProductVideo/view/adminhtml/templates/helper/gallery.phtml b/app/code/Magento/ProductVideo/view/adminhtml/templates/helper/gallery.phtml index b75b59eeacce..bfb1be1f978b 100644 --- a/app/code/Magento/ProductVideo/view/adminhtml/templates/helper/gallery.phtml +++ b/app/code/Magento/ProductVideo/view/adminhtml/templates/helper/gallery.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** * @var $block \Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Gallery\Content * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer diff --git a/app/code/Magento/ProductVideo/view/adminhtml/templates/product/edit/base_image.phtml b/app/code/Magento/ProductVideo/view/adminhtml/templates/product/edit/base_image.phtml index 8c40c174c978..91d5a2781308 100644 --- a/app/code/Magento/ProductVideo/view/adminhtml/templates/product/edit/base_image.phtml +++ b/app/code/Magento/ProductVideo/view/adminhtml/templates/product/edit/base_image.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> <div class="row"> diff --git a/app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js b/app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js index cb56a085304a..2084075bc5ea 100644 --- a/app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js +++ b/app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js @@ -289,10 +289,10 @@ define([ * @private */ destroy: function () { - this.stop(); - if (this._player) { + this.stop(); this._player.destroy(); + this._player = undefined; } } }); @@ -495,28 +495,40 @@ define([ */ function _onVimeoLoaded(data) { var tmp, - respData; + respData, + videoDescription = ''; - if (data.length < 1) { + if (!data) { this._onRequestError($.mage.__('Video not found')); return null; } - tmp = data[0]; - respData = { - duration: this._formatVimeoDuration(tmp.duration), - channel: tmp['user_name'], - channelId: tmp['user_url'], - uploaded: tmp['upload_date'], - title: tmp.title, - description: tmp.description.replace(/( |<([^>]+)>)/ig, ''), - thumbnail: tmp['thumbnail_large'], - videoId: videoInfo.id, - videoProvider: videoInfo.type - }; - this._videoInformation = respData; - this.element.trigger(this._UPDATE_VIDEO_INFORMATION_TRIGGER, respData); - this.element.trigger(this._FINISH_UPDATE_INFORMATION_TRIGGER, true); + tmp = data; + + if (tmp.description !== null) { + videoDescription = tmp.description; + } + + if (tmp.duration == null) { + this._onRequestError( + $.mage.__('Because of its privacy settings, this video cannot be played here.') + ); + } else { + respData = { + duration: this._formatVimeoDuration(tmp.duration), + channel: tmp['author_name'], + channelId: tmp['author_url'], + uploaded: tmp['upload_date'], + title: tmp.title, + description: videoDescription.replace(/( |<([^>]+)>)/ig, ''), + thumbnail: tmp['thumbnail_url'], + videoId: videoInfo.id, + videoProvider: videoInfo.type + }; + this._videoInformation = respData; + this.element.trigger(this._UPDATE_VIDEO_INFORMATION_TRIGGER, respData); + this.element.trigger(this._FINISH_UPDATE_INFORMATION_TRIGGER, true); + } } type = videoInfo.type; @@ -539,10 +551,11 @@ define([ ); } else if (type === 'vimeo') { $.ajax({ - url: 'https://www.vimeo.com/api/v2/video/' + id + '.json', + url: 'https://vimeo.com/api/oembed.json', dataType: 'jsonp', data: { - format: 'json' + format: 'json', + url: 'https://vimeo.com/' + id }, timeout: 5000, success: $.proxy(_onVimeoLoaded, self), diff --git a/app/code/Magento/ProductVideo/view/adminhtml/web/js/new-video-dialog.js b/app/code/Magento/ProductVideo/view/adminhtml/web/js/new-video-dialog.js index 562bff2e1d47..49319f3e90dd 100644 --- a/app/code/Magento/ProductVideo/view/adminhtml/web/js/new-video-dialog.js +++ b/app/code/Magento/ProductVideo/view/adminhtml/web/js/new-video-dialog.js @@ -628,7 +628,7 @@ define([ }).css('display', 'none'); fu.parent().append(tmpInput); fileUploader = $(tmpInput).fileupload(); - fileUploader.fileupload('send', data).success(function (result, textStatus, jqXHR) { + fileUploader.fileupload('send', data).done(function (result, textStatus, jqXHR) { tmpInput.remove(); callback.call(null, result, textStatus, jqXHR); }); diff --git a/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js b/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js index acaf2afeb6c2..707d056211e5 100644 --- a/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js +++ b/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js @@ -138,10 +138,9 @@ define([ * @private */ _create: function () { - $(this.element).on('gallery:loaded', $.proxy(function () { - this.fotoramaItem = $(this.element).find('.fotorama-item'); - this._initialize(); - }, this)); + $(this.element).data('gallery') ? + this._onGalleryLoaded() : + $(this.element).on('gallery:loaded', this._onGalleryLoaded.bind(this)); }, /** @@ -171,6 +170,14 @@ define([ } }, + /** + * Callback which fired after gallery gets initialized. + */ + _onGalleryLoaded: function () { + this.fotoramaItem = $(this.element).find('.fotorama-item'); + this._initialize(); + }, + /** * Clear gallery events to prevent duplicated calls. * @@ -595,7 +602,7 @@ define([ } if (this.isFullscreen && this.fotoramaItem.data('fotorama').activeFrame.i === number) { - this.fotoramaItem.data('fotorama').activeFrame.$stageFrame[0].click(); + this.fotoramaItem.data('fotorama').activeFrame.$stageFrame[0].trigger('click'); } }, @@ -714,6 +721,7 @@ define([ } $('.' + this.FTAR).addClass(this.isFullscreen ? 'fotorama__arr--shown' : 'fotorama__arr--hidden'); + $('.' + this.FTVC).addClass('fotorama-show-control'); } }, @@ -740,14 +748,14 @@ define([ if (window.Froogaloop) { clearInterval(waitForFroogaloop); fotorama.requestFullScreen(); - this.fotoramaItem.data('fotorama').activeFrame.$stageFrame[0].click(); + this.fotoramaItem.data('fotorama').activeFrame.$stageFrame[0].trigger('click'); this.Base = false; } }, this), 50); } else { //if not a vimeo - play it immediately with a little lag in case for fotorama fullscreen setTimeout($.proxy(function () { fotorama.requestFullScreen(); - this.fotoramaItem.data('fotorama').activeFrame.$stageFrame[0].click(); + this.fotoramaItem.data('fotorama').activeFrame.$stageFrame[0].trigger('click'); this.Base = false; }, this), 50); } @@ -804,7 +812,7 @@ define([ if (self.isFullscreen && !self.fotoramaItem.data('fotorama').options.fullscreen.arrows) { if ($('.' + self.FTAR + '--prev').is(':focus') || $('.' + self.FTAR + '--next').is(':focus')) { - $(self.FTCF).focus(); + $(self.FTCF).trigger('focus'); } } }); diff --git a/app/code/Magento/Quote/Model/Cart/ShippingMethodConverter.php b/app/code/Magento/Quote/Model/Cart/ShippingMethodConverter.php index 16d53c58d42e..3fbba1f04733 100644 --- a/app/code/Magento/Quote/Model/Cart/ShippingMethodConverter.php +++ b/app/code/Magento/Quote/Model/Cart/ShippingMethodConverter.php @@ -23,6 +23,11 @@ class ShippingMethodConverter */ protected $taxHelper; + /** + * @var \Magento\Store\Model\StoreManagerInterface + */ + private $storeManager; + /** * Constructs a shipping method converter object. * diff --git a/app/code/Magento/Quote/Model/GuestCart/GuestBillingAddressManagement.php b/app/code/Magento/Quote/Model/GuestCart/GuestBillingAddressManagement.php index 3de2e0c3ff3f..3e491e0b1a24 100644 --- a/app/code/Magento/Quote/Model/GuestCart/GuestBillingAddressManagement.php +++ b/app/code/Magento/Quote/Model/GuestCart/GuestBillingAddressManagement.php @@ -46,7 +46,7 @@ public function assign($cartId, \Magento\Quote\Api\Data\AddressInterface $addres { /** @var $quoteIdMask QuoteIdMask */ $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id'); - return $this->billingAddressManagement->assign($quoteIdMask->getQuoteId(), $address, $useForShipping); + return (int)$this->billingAddressManagement->assign($quoteIdMask->getQuoteId(), $address, $useForShipping); } /** diff --git a/app/code/Magento/Quote/Model/GuestCartManagement/Plugin/Authorization.php b/app/code/Magento/Quote/Model/GuestCartManagement/Plugin/Authorization.php index 5d83757321f7..398642f734a2 100644 --- a/app/code/Magento/Quote/Model/GuestCartManagement/Plugin/Authorization.php +++ b/app/code/Magento/Quote/Model/GuestCartManagement/Plugin/Authorization.php @@ -39,7 +39,7 @@ public function beforeAssignCustomer( $customerId, $storeId ) { - if ($customerId !== (int)$this->userContext->getUserId()) { + if (((int) $customerId) !== (int)$this->userContext->getUserId()) { throw new StateException( __("You don't have the correct permissions to assign the customer to the cart.") ); diff --git a/app/code/Magento/Quote/Model/Quote/Address/Total/Shipping.php b/app/code/Magento/Quote/Model/Quote/Address/Total/Shipping.php index 3ce148ee80b8..aef9fb04c19a 100644 --- a/app/code/Magento/Quote/Model/Quote/Address/Total/Shipping.php +++ b/app/code/Magento/Quote/Model/Quote/Address/Total/Shipping.php @@ -71,15 +71,14 @@ public function collect( $address->setItemQty($data['addressQty']); $address->setWeight($data['addressWeight']); $address->setFreeMethodWeight($data['freeMethodWeight']); - $addressFreeShipping = (bool)$address->getFreeShipping(); + $isFreeShipping = $this->freeShipping->isFreeShipping($quote, $shippingAssignment->getItems()); $address->setFreeShipping($isFreeShipping); - if (!$addressFreeShipping && $isFreeShipping) { - $data = $this->getAssignmentWeightData($address, $shippingAssignment->getItems()); - $address->setItemQty($data['addressQty']); - $address->setWeight($data['addressWeight']); - $address->setFreeMethodWeight($data['freeMethodWeight']); - } + // recalculate weights + $data = $this->getAssignmentWeightData($address, $shippingAssignment->getItems()); + $address->setItemQty($data['addressQty']); + $address->setWeight($data['addressWeight']); + $address->setFreeMethodWeight($data['freeMethodWeight']); $address->collectShippingRates(); diff --git a/app/code/Magento/Quote/Model/Quote/Item.php b/app/code/Magento/Quote/Model/Quote/Item.php index 22554380ca61..580aafb15aed 100644 --- a/app/code/Magento/Quote/Model/Quote/Item.php +++ b/app/code/Magento/Quote/Model/Quote/Item.php @@ -9,6 +9,8 @@ use Magento\Framework\Api\AttributeValueFactory; use Magento\Framework\Api\ExtensionAttributesFactory; +use Magento\Framework\App\ObjectManager; +use Magento\Quote\Model\Quote\Item\Option\ComparatorInterface; /** * Sales Quote Item Model @@ -184,6 +186,13 @@ class Item extends \Magento\Quote\Model\Quote\Item\AbstractItem implements \Mage */ private $serializer; + /** + * Item options comparator + * + * @var ComparatorInterface + */ + private $itemOptionComparator; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry @@ -196,11 +205,12 @@ class Item extends \Magento\Quote\Model\Quote\Item\AbstractItem implements \Mage * @param Item\OptionFactory $itemOptionFactory * @param Item\Compare $quoteItemCompare * @param \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry - * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource - * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection + * @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource + * @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection * @param array $data * - * @param \Magento\Framework\Serialize\Serializer\Json $serializer + * @param \Magento\Framework\Serialize\Serializer\Json|null $serializer + * @param ComparatorInterface|null $itemOptionComparator * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -218,15 +228,18 @@ public function __construct( \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [], - \Magento\Framework\Serialize\Serializer\Json $serializer = null + \Magento\Framework\Serialize\Serializer\Json $serializer = null, + ?ComparatorInterface $itemOptionComparator = null ) { $this->_errorInfos = $statusListFactory->create(); $this->_localeFormat = $localeFormat; $this->_itemOptionFactory = $itemOptionFactory; $this->quoteItemCompare = $quoteItemCompare; $this->stockRegistry = $stockRegistry; - $this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance() + $this->serializer = $serializer ?: ObjectManager::getInstance() ->get(\Magento\Framework\Serialize\Serializer\Json::class); + $this->itemOptionComparator = $itemOptionComparator + ?: ObjectManager::getInstance()->get(ComparatorInterface::class); parent::__construct( $context, $registry, @@ -500,7 +513,9 @@ public function compareOptions($options1, $options2) if (in_array($code, $this->_notRepresentOptions)) { continue; } - if (!isset($options2[$code]) || $options2[$code]->getValue() != $option->getValue()) { + if (!isset($options2[$code]) + || !$this->itemOptionComparator->compare($options2[$code], $option) + ) { return false; } } diff --git a/app/code/Magento/Quote/Model/Quote/Item/Option/Comparator.php b/app/code/Magento/Quote/Model/Quote/Item/Option/Comparator.php new file mode 100644 index 000000000000..2f683c7e57dc --- /dev/null +++ b/app/code/Magento/Quote/Model/Quote/Item/Option/Comparator.php @@ -0,0 +1,58 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Quote\Model\Quote\Item\Option; + +use InvalidArgumentException; +use Magento\Framework\DataObject; + +/** + * Quote item options comparator + */ +class Comparator implements ComparatorInterface +{ + /** + * @var ComparatorInterface[] + */ + private $customComparators; + + /** + * @param ComparatorInterface[] $customComparators + */ + public function __construct( + array $customComparators = [] + ) { + foreach ($customComparators as $comparator) { + if (!$comparator instanceof ComparatorInterface) { + throw new InvalidArgumentException( + sprintf( + '%s must implement %s', + get_class($comparator), + ComparatorInterface::class + ) + ); + } + } + $this->customComparators = $customComparators; + } + + /** + * @inheritdoc + */ + public function compare( + DataObject $option1, + DataObject $option2 + ): bool { + if ($option1->getCode() === $option2->getCode()) { + return isset($this->customComparators[$option1->getCode()]) + ? $this->customComparators[$option1->getCode()]->compare($option1, $option2) + : $option1->getValue() == $option2->getValue(); + } + + return false; + } +} diff --git a/app/code/Magento/Quote/Model/Quote/Item/Option/ComparatorInterface.php b/app/code/Magento/Quote/Model/Quote/Item/Option/ComparatorInterface.php new file mode 100644 index 000000000000..b76fcffa2340 --- /dev/null +++ b/app/code/Magento/Quote/Model/Quote/Item/Option/ComparatorInterface.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Quote\Model\Quote\Item\Option; + +use Magento\Framework\DataObject; + +/** + * Quote item options comparator + */ +interface ComparatorInterface +{ + /** + * Compare two quote item options + * + * @param DataObject $option1 + * @param DataObject $option2 + * @return bool + */ + public function compare(DataObject $option1, DataObject $option2): bool; +} diff --git a/app/code/Magento/Quote/Model/QuoteManagement.php b/app/code/Magento/Quote/Model/QuoteManagement.php index 1d4b8feba07f..b767fa9ce374 100644 --- a/app/code/Magento/Quote/Model/QuoteManagement.php +++ b/app/code/Magento/Quote/Model/QuoteManagement.php @@ -553,6 +553,15 @@ protected function submitQuote(QuoteEntity $quote, $orderData = []) $order->setCustomerFirstname($quote->getCustomerFirstname()); $order->setCustomerMiddlename($quote->getCustomerMiddlename()); $order->setCustomerLastname($quote->getCustomerLastname()); + + if ($quote->getOrigOrderId()) { + $order->setEntityId($quote->getOrigOrderId()); + } + + if ($quote->getReservedOrderId()) { + $order->setIncrementId($quote->getReservedOrderId()); + } + $this->submitQuoteValidator->validateOrder($order); $this->eventManager->dispatch( diff --git a/app/code/Magento/Quote/Model/QuoteRepository/Plugin/Authorization.php b/app/code/Magento/Quote/Model/QuoteRepository/Plugin/Authorization.php index e546c95d14ec..4dd82b90bf14 100644 --- a/app/code/Magento/Quote/Model/QuoteRepository/Plugin/Authorization.php +++ b/app/code/Magento/Quote/Model/QuoteRepository/Plugin/Authorization.php @@ -72,7 +72,7 @@ public function afterGetActiveForCustomer( protected function isAllowed(\Magento\Quote\Model\Quote $quote) { return $this->userContext->getUserType() == UserContextInterface::USER_TYPE_CUSTOMER - ? $quote->getCustomerId() === null || $quote->getCustomerId() == $this->userContext->getUserId() + ? $quote->getCustomerId() === null || ((int) $quote->getCustomerId()) == $this->userContext->getUserId() : true; } } diff --git a/app/code/Magento/Quote/Model/ResourceModel/Quote/Address/Rate/Collection.php b/app/code/Magento/Quote/Model/ResourceModel/Quote/Address/Rate/Collection.php index 02839648f706..4e0650de2485 100644 --- a/app/code/Magento/Quote/Model/ResourceModel/Quote/Address/Rate/Collection.php +++ b/app/code/Magento/Quote/Model/ResourceModel/Quote/Address/Rate/Collection.php @@ -19,6 +19,11 @@ class Collection extends \Magento\Framework\Model\ResourceModel\Db\VersionContro */ protected $_allowFixedOnly = false; + /** + * @var \Magento\Shipping\Model\CarrierFactoryInterface + */ + private $_carrierFactory; + /** * @param \Magento\Framework\Data\Collection\EntityFactory $entityFactory * @param \Psr\Log\LoggerInterface $logger diff --git a/app/code/Magento/Quote/Model/ResourceModel/Quote/Item.php b/app/code/Magento/Quote/Model/ResourceModel/Quote/Item.php index 59cda0442af8..2430b733501a 100644 --- a/app/code/Magento/Quote/Model/ResourceModel/Quote/Item.php +++ b/app/code/Magento/Quote/Model/ResourceModel/Quote/Item.php @@ -5,7 +5,9 @@ */ namespace Magento\Quote\Model\ResourceModel\Quote; +use Magento\Framework\Model\AbstractModel; use Magento\Framework\Model\ResourceModel\Db\VersionControl\AbstractDb; +use Magento\Quote\Model\Quote\Item\Option; /** * Quote resource model @@ -27,19 +29,39 @@ protected function _construct() /** * {@inheritdoc} */ - public function save(\Magento\Framework\Model\AbstractModel $object) + public function save(AbstractModel $object) { $hasDataChanges = $this->isModified($object); $object->setIsOptionsSaved(false); $result = parent::save($object); - if ($hasDataChanges && !$object->isOptionsSaved()) { + if (!$object->isOptionsSaved() && ($hasDataChanges || $this->hasOptionsChanged($object))) { $object->saveItemOptions(); } return $result; } + /** + * Check if quote item options have changed. + * + * @param AbstractModel $object + * @return bool + */ + private function hasOptionsChanged(AbstractModel $object): bool + { + $hasDataChanges = false; + $options = $object->getOptions() ?? []; + foreach ($options as $option) { + /** @var Option $option */ + if (!$option->getId() || $option->getResource()->hasDataChanged($option)) { + $hasDataChanges = true; + break; + } + } + return $hasDataChanges; + } + /** * {@inheritdoc} */ diff --git a/app/code/Magento/Quote/Model/ShippingMethodManagement.php b/app/code/Magento/Quote/Model/ShippingMethodManagement.php index dab4fa98607a..8d851c71b660 100644 --- a/app/code/Magento/Quote/Model/ShippingMethodManagement.php +++ b/app/code/Magento/Quote/Model/ShippingMethodManagement.php @@ -224,7 +224,15 @@ public function apply($cartId, $carrierCode, $methodCode) $this->quoteAddressResource->delete($shippingAddress); throw new StateException(__('The shipping address is missing. Set the address and try again.')); } - $shippingAddress->setShippingMethod($carrierCode . '_' . $methodCode); + $shippingMethod = $carrierCode . '_' . $methodCode; + $shippingAddress->setShippingMethod($shippingMethod); + $shippingAssignments = $quote->getExtensionAttributes()->getShippingAssignments(); + if (!empty($shippingAssignments)) { + $shippingAssignment = $shippingAssignments[0]; + $shipping = $shippingAssignment->getShipping(); + $shipping->setMethod($shippingMethod); + $shippingAssignment->setShipping($shipping); + } } /** diff --git a/app/code/Magento/Quote/Observer/SendInvoiceEmailObserver.php b/app/code/Magento/Quote/Observer/SendInvoiceEmailObserver.php new file mode 100644 index 000000000000..4e1f37821507 --- /dev/null +++ b/app/code/Magento/Quote/Observer/SendInvoiceEmailObserver.php @@ -0,0 +1,96 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Quote\Observer; + +use Magento\Framework\Event\Observer; +use Magento\Framework\Event\ObserverInterface; +use Magento\Quote\Model\Quote; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\Email\Container\InvoiceIdentity; +use Magento\Sales\Model\Order\Email\Sender\InvoiceSender; +use Psr\Log\LoggerInterface; + +/** + * Class responsive for sending invoice emails when order created through storefront. + */ +class SendInvoiceEmailObserver implements ObserverInterface +{ + /** + * @var LoggerInterface + */ + private $logger; + + /** + * @var InvoiceSender + */ + private $invoiceSender; + + /** + * @var InvoiceIdentity + */ + private $invoiceIdentity; + + /** + * @param LoggerInterface $logger + * @param InvoiceSender $invoiceSender + * @param InvoiceIdentity $invoiceIdentity + */ + public function __construct( + LoggerInterface $logger, + InvoiceSender $invoiceSender, + InvoiceIdentity $invoiceIdentity + ) { + $this->logger = $logger; + $this->invoiceSender = $invoiceSender; + $this->invoiceIdentity = $invoiceIdentity; + } + + /** + * Send invoice email if allowed. + * + * @param Observer $observer + * + * @return void + */ + public function execute(Observer $observer) + { + if (!$this->isInvoiceEmailAllowed()) { + return; + } + + /** @var Quote $quote */ + $quote = $observer->getEvent()->getQuote(); + /** @var Order $order */ + $order = $observer->getEvent()->getOrder(); + + /** + * a flag to set that there will be redirect to third party after confirmation + */ + $redirectUrl = $quote->getPayment()->getOrderPlaceRedirectUrl(); + if (!$redirectUrl && $order->getCanSendNewEmailFlag()) { + try { + $invoice = current($order->getInvoiceCollection()->getItems()); + if ($invoice) { + $this->invoiceSender->send($invoice); + } + } catch (\Throwable $e) { + $this->logger->critical($e); + } + } + } + + /** + * Is invoice email sending enabled + * + * @return bool + */ + private function isInvoiceEmailAllowed(): bool + { + return $this->invoiceIdentity->isEnabled(); + } +} diff --git a/app/code/Magento/Quote/Observer/SubmitObserver.php b/app/code/Magento/Quote/Observer/SubmitObserver.php index db0ba7fb7793..c67d310597b0 100644 --- a/app/code/Magento/Quote/Observer/SubmitObserver.php +++ b/app/code/Magento/Quote/Observer/SubmitObserver.php @@ -9,12 +9,11 @@ use Magento\Framework\Event\ObserverInterface; use Magento\Quote\Model\Quote; use Magento\Sales\Model\Order; -use Magento\Sales\Model\Order\Email\Sender\InvoiceSender; use Magento\Sales\Model\Order\Email\Sender\OrderSender; use Psr\Log\LoggerInterface; /** - * Class responsive for sending order and invoice emails when it's created through storefront. + * Class responsive for sending order emails when it's created through storefront. */ class SubmitObserver implements ObserverInterface { @@ -28,28 +27,20 @@ class SubmitObserver implements ObserverInterface */ private $orderSender; - /** - * @var InvoiceSender - */ - private $invoiceSender; - /** * @param LoggerInterface $logger * @param OrderSender $orderSender - * @param InvoiceSender $invoiceSender */ public function __construct( LoggerInterface $logger, - OrderSender $orderSender, - InvoiceSender $invoiceSender + OrderSender $orderSender ) { $this->logger = $logger; $this->orderSender = $orderSender; - $this->invoiceSender = $invoiceSender; } /** - * Send order and invoice email. + * Send order email. * * @param Observer $observer * @@ -69,11 +60,7 @@ public function execute(Observer $observer) if (!$redirectUrl && $order->getCanSendNewEmailFlag()) { try { $this->orderSender->send($order); - $invoice = current($order->getInvoiceCollection()->getItems()); - if ($invoice) { - $this->invoiceSender->send($invoice); - } - } catch (\Exception $e) { + } catch (\Throwable $e) { $this->logger->critical($e); } } diff --git a/app/code/Magento/Quote/README.md b/app/code/Magento/Quote/README.md index 0a026ca9108a..a40884aa98e0 100644 --- a/app/code/Magento/Quote/README.md +++ b/app/code/Magento/Quote/README.md @@ -1,11 +1,297 @@ -# Overview -## Purpose of module +# Magento_Quote module +This module provides customer cart management functionality. -# Deployment -## System requirements +## Installation -The Magento_Quote module does not have any specific system requirements. +The Magento_Quote module is one of the base Magento 2 modules. You cannot disable or uninstall this module. + +The Magento_Quote module creates the following table in the database: +- `quote` +- `quote_address` +- `quote_item` +- `quote_address_item` +- `quote_item_option` +- `quote_payment` +- `quote_shipping_rate` +- `quote_id_mask` + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Extensibility + +Extension developers can interact with the Magento_Quote module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Quote module. + +### Events + +The module dispatches the following events: +- `sales_quote_address_collection_load_after` event in the `\Magento\Quote\Model\ResourceModel\Quote\Address\Collection::_afterLoad` method. Parameters: + - `quote_address_collection` is a `$this` object (`Magento\Quote\Model\ResourceModel\Quote\Address\Collection` class) + +- `items_additional_data` event in the `\Magento\Quote\Model\Cart\Totals\ItemConverter::modelToDataObject` method. Parameters: + - `item` is a quote_item object (`\Magento\Quote\Model\Quote\Item` class) + +- `sales_quote_remove_item` event in the `\Magento\Quote\Model\Quote::removeItem` method. Parameters: + - `quote_item` is a quote_item object (`\Magento\Quote\Model\Quote\Item` class) + +- `sales_quote_add_item` event in the `\Magento\Quote\Model\Quote::addItem` method. Parameters: + - `quote_item` is a quote_item object (`\Magento\Quote\Model\Quote\Item` class) + +- `sales_quote_product_add_after` event in the `\Magento\Quote\Model\Quote::addProduct` method. Parameters: + - `items` is an array with quot_item objects (`\Magento\Quote\Model\Quote\Item` class) + +- `sales_quote_merge_before` event in the `\Magento\Quote\Model\Quote::merge` method. Parameters: + - `quote` is a `$this` object (`\Magento\Quote\Model\Quote` class) + - `source` is a quote object (`\Magento\Quote\Model\Quote` class) + +- `sales_quote_merge_after` event in the `\Magento\Quote\Model\Quote::merge` method. Parameters: + - `quote` is a `$this` object (`\Magento\Quote\Model\Quote` class) + - `source` is a quote object (`\Magento\Quote\Model\Quote` class) + +- `sales_convert_quote_to_order` event in the `\Magento\Quote\Model\Quote\Address\ToOrder::convert` method. Parameters: + - `order` is an order object (`\Magento\Sales\Model\Order` class) + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + +- `sales_quote_item_qty_set_after` event in the `\Magento\Quote\Model\Quote\Item::setQty` method. Parameters: + - `item` is a `$this` object (`\Magento\Quote\Model\Quote\Item` class) + +- `sales_quote_item_set_product` event in the `\Magento\Quote\Model\Quote\Item::setProduct` method. Parameters: + - `product` is a product object (`\Magento\Catalog\Model\Product` class) + - `quote_item` is a `$this` object (`\Magento\Quote\Model\Quote\Item` class) + +- `sales_quote_payment_import_data_before` event in the `\Magento\Quote\Model\Quote\Payment::importData` method. Parameters: + - `payment` is a `$this` object (`\Magento\Quote\Model\Quote\Payment` class) + - `input` is a data object (`\Magento\Framework\DataObject` class) + +- `sales_quote_collect_totals_before` event in the `\Magento\Quote\Model\Quote\TotalsCollector::collect` method. Parameters: + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + +- `sales_quote_collect_totals_after` event in the `\Magento\Quote\Model\Quote\TotalsCollector::collect` method. Parameters: + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + +- `sales_quote_address_collect_totals_before` event in the `\Magento\Quote\Model\Quote\TotalsCollector::collectAddressTotals` method. Parameters: + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + - `shipping_assignment` is a shipping_assignment object (`\Magento\Quote\Model\ShippingAssignment` class) + - `total` is a total object (`\Magento\Quote\Model\Quote\Address\Total` class) + +- `sales_quote_address_collect_totals_after` event in the `\Magento\Quote\Model\Quote\TotalsCollector::collectAddressTotals` method. Parameters: + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + - `shipping_assignment` is a shipping_assignment object (`\Magento\Quote\Model\ShippingAssignment` class) + - `total` is a total object (`\Magento\Quote\Model\Quote\Address\Total` class) + +- `checkout_submit_before` event in the `\Magento\Quote\Model\QuoteManagement::placeOrder` method. Parameters: + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + +- `checkout_submit_all_after` event in the `\Magento\Quote\Model\QuoteManagement::placeOrder` method. Parameters: + - `order` is an order object (`\Magento\Sales\Model\Order` class) + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + +- `sales_model_service_quote_submit_before` event in the `\Magento\Quote\Model\QuoteManagement::submitQuote` method. Parameters: + - `order` is an order object (`\Magento\Sales\Model\Order` class) + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + +- `sales_model_service_quote_submit_success` event in the `\Magento\Quote\Model\QuoteManagement::submitQuote` method. Parameters: + - `order` is an order object (`\Magento\Sales\Model\Order` class) + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + +- `sales_model_service_quote_submit_failure` event in the `\Magento\Quote\Model\QuoteManagement::rollbackAddresses` method. Parameters: + - `order` is an order object (`\Magento\Sales\Model\Order` class) + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + - `exception` is an exception object (`\Exception` class) + +- `prepare_catalog_product_collection_prices` event in the `\Magento\Quote\Model\ResourceModel\Quote\Item\Collection::_assignProducts` method. Parameters: + - `collection` is a product collection object (`\Magento\Quote\Model\ResourceModel\Quote\Item\Collection` class) + - `store_id` is a store ID (`int` type) + +- `sales_quote_item_collection_products_after_load` event in the `\Magento\Quote\Model\QuoteManagement::_assignProducts` method. Parameters: + - `collection` is a product collection object (`\Magento\Catalog\Model\ResourceModel\Product\Collection` class) + +For information about an event in Magento 2, see [Events and observers](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). + +### Public APIs + +#### Data + +- `\Magento\Quote\Api\Data\AddressAdditionalDataInterface` + - provides additional data with quote address information + +- `\Magento\Quote\Api\Data\AddressInterface` + - quote address data + +- `\Magento\Quote\Api\Data\CartInterface` + - quote data + +- `\Magento\Quote\Api\Data\CartItemInterface` + - quote item data + +- `\Magento\Quote\Api\Data\CartSearchResultsInterfac` + - quote search result data + +- `\Magento\Quote\Api\Data\CurrencyInterface` + - currency data + +- `\Magento\Quote\Api\Data\EstimateAddressInterface` + - estimate address data + +- `\Magento\Quote\Api\Data\PaymentInterface` + - payment data + +- `\Magento\Quote\Api\Data\PaymentMethodInterface` + - payment method data + +- `\Magento\Quote\Api\Data\ProductOptionInterface` + - product option data + +- `\Magento\Quote\Api\Data\ShippingAssignmentInterface` + - shipping assigment data + +- `\Magento\Quote\Api\Data\ShippingInterface` + - shipping data + +- `\Magento\Quote\Api\Data\ShippingMethodInterface` + - shipping method data + +- `\Magento\Quote\Api\Data\TotalsAdditionalDataInterface` + - provides additional data for totals collection + +- `\Magento\Quote\Api\Data\TotalSegmentInterface` + - total segment data + +- `\Magento\Quote\Api\Data\TotalsInterfacee` + - quote totals data + +- `\Magento\Quote\Api\Data\TotalsItemInterface` + - quote items totals data + +#### General + +- `\Magento\Quote\Api\ChangeQuoteControlInterface` + - checks if user is allowed to change the quote + +#### Guest + +- `\Magento\Quote\Api\GuestBillingAddressManagementInterface` + - assigns a specified billing address to a specified quote + - gets the billing address for a specified quote + +- `\Magento\Quote\Api\GuestCartItemRepositoryInterface` + - gets lists items that are assigned to a specified quote + - add/update the specified cart guest item + - removes the specified item from the specified quote + +- `\Magento\Quote\Api\GuestCouponManagementInterface` + - gets coupon for a specified quote by quote ID + - adds a coupon by code to a specified quote + - deletes a coupon from a specified quote by quote ID + +- `\Magento\Quote\Api\GuestCartManagementInterface` + - gets list items that are assigned to a specified quote + - add/update the specified quote item + - deletes the specified item from the specified quote + +- `\Magento\Quote\Api\GuestPaymentMethodManagementInterface` + - adds a specified payment method to a specified shopping quote + - gets the payment method for a specified shopping quote + - gets list available payment methods for a specified shopping quote + +- `\Magento\Quote\Api\GuestShipmentEstimationInterface` + - estimates shipping by address and return list of available shipping methods + +- `\Magento\Quote\Api\GuestShippingMethodManagementInterface` + - gets list applicable shipping methods for a specified quote + - estimates shipping + +- `\Magento\Quote\Api\GuestCartRepositoryInterface` + - gets quote by quote ID for guest user + +- `\Magento\Quote\Api\GuestCartTotalManagementInterface` + - sets shipping/billing methods and additional data for a quote and collect totals for guest + +- `\Magento\Quote\Api\GuestCartTotalRepositoryInterface` + - gets quote totals by quote ID for guest user + +- `\Magento\Quote\Model\GuestCart\GuestShippingAddressManagementInterface` + - assign a specified shipping address to a specified quote + - gets the shipping address for a specified quote + +- `\Magento\Quote\Model\GuestCart\GuestShippingMethodManagementInterface` + - sets the carrier and shipping methods codes for a specified quote + - gets the selected shipping method for a specified quote + +#### Registered customer + +- `\Magento\Quote\Api\BillingAddressManagementInterface` + - assigns a specified billing address to a specified quote + - gets the billing address for a specified quote + +- `\Magento\Quote\Api\CartItemRepositoryInterface` + - gets lists items that are assigned to a specified quote + - add/update the specified quote item + - removes the specified item from the specified quote + +- `\Magento\Quote\Api\CartManagementInterface` + - creates an empty quote and quote for a guest + - creates an empty quote and quote for a specified customer if customer does not have a quote yet + - returns information for the quote for a specified customer + - assigns a specified customer to a specified shopping quote + - places an order for a specified quote + +- `\Magento\Quote\Api\CartRepositoryInterface` + - gets quote by quote ID + - gets list carts that match specified search criteria + - gets quote by customer ID + - gets active quote by quote ID + - gets active quote by customer ID + - saves quote + - deletes quote + +- `\Magento\Quote\Api\CartTotalManagementInterface` + - sets shipping/billing methods and additional data for quote and collect totals + +- `\Magento\Quote\Api\CartTotalRepositoryInterface` + - gets quote totals by quote ID + +- `\Magento\Quote\Api\CouponManagementInterface` + - gets coupon for a specified quote by quote ID + - adds a coupon by code to a specified quote + - deletes a coupon from a specified quote by quote ID + +- `\Magento\Quote\Api\PaymentMethodManagementInterface` + - adds a specified payment method to a specified shopping quote + - gets the payment method for a specified shopping quote + - gets list available payment methods for a specified shopping quote + +- `\Magento\Quote\Api\ShipmentEstimationInterface` + - estimates shipping by address and return list of available shipping methods + +- `\Magento\Quote\Api\ShippingMethodManagementInterface` + - estimates shipping by quote ID an Address + - estimates shipping by quote ID an address ID + - get lists applicable shipping methods for a specified quote + +- `\Magento\Quote\Model\ShippingAddressManagementInterface` + - assigns a specified shipping address to a specified quote + - gets the shipping address for a specified quote + +- `\Magento\Quote\Model\ShippingMethodManagementInterface` + - sets the carrier and shipping methods codes for a specified quote + - gets the selected shipping method for a specified quote + +#### Model + +- `\Magento\Quote\Model\Quote\Address\FreeShippingInterface` + - checks if is a free shipping + +- `\Magento\Quote\Model\Quote\Address\RateCollectorInterface` + - retrieves all methods for supplied shipping data + +- `\Magento\Quote\Model\MaskedQuoteIdToQuoteIdInterface` + - converts masked quote ID to the quote ID (entity ID) + +- `\Magento\Quote\Model\QuoteIdToMaskedQuoteIdInterface` + - converts quote ID to the masked quote ID + +For information about a public API in Magento 2, see [Public interfaces & APIs](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/api-concepts.html). -## Install -The Magento_Quote module is installed automatically (using the native Magento install mechanism) without any additional actions. diff --git a/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml b/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml index a14be3b533fa..b09f2fb37632 100755 --- a/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml +++ b/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml @@ -24,4 +24,10 @@ <requiredEntity type="payment_method">PaymentMethodCheckMoneyOrder</requiredEntity> <requiredEntity type="billing_address">BillingAddressTX</requiredEntity> </entity> + + <entity name="CashOnDeliveryOrderPaymentMethod" type="CustomerPaymentInformation"> + <var key="cart_id" entityKey="return" entityType="CustomerCart"/> + <requiredEntity type="payment_method">CashOnDeliveryPaymentMethod</requiredEntity> + <requiredEntity type="billing_address">BillingAddressTX</requiredEntity> + </entity> </entities> diff --git a/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml b/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml index ee5f2fccfe20..165500d8a82b 100644 --- a/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml +++ b/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml @@ -94,7 +94,7 @@ <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> </after> <!-- Step 1: Add simple product to shopping cart --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/> <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="cartAddSimpleProductToCart"> <argument name="product" value="$$createSimpleProduct$$"/> <argument name="productCount" value="1"/> @@ -129,7 +129,7 @@ <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickMiniCart"/> <dontSeeElement selector="{{StorefrontMinicartSection.quantity}}" stepKey="dontSeeCartItem"/> <!-- Add simple product to shopping cart --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct2.name$$)}}" stepKey="amOnSimpleProductPage2"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct2.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage2"/> <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="cartAddSimpleProductToCart2"> <argument name="product" value="$$createSimpleProduct2$$"/> <argument name="productCount" value="1"/> diff --git a/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestBillingAddressManagementTest.php b/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestBillingAddressManagementTest.php index 938764fd0b3a..3df82d911929 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestBillingAddressManagementTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestBillingAddressManagementTest.php @@ -97,6 +97,8 @@ public function testAssign() { $addressId = 1; $this->billingAddressManagementMock->expects($this->once())->method('assign')->willReturn($addressId); - $this->assertEquals($addressId, $this->model->assign($this->maskedCartId, $this->addressMock)); + $actualAddressId = $this->model->assign($this->maskedCartId, $this->addressMock); + $this->assertIsInt($actualAddressId); + $this->assertEquals($addressId, $actualAddressId); } } diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/CompareTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/CompareTest.php index b8db6858ea2d..7dd0bcf8f8b0 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/CompareTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/CompareTest.php @@ -13,6 +13,7 @@ use Magento\Quote\Model\Quote\Item; use Magento\Quote\Model\Quote\Item\Compare; use Magento\Quote\Model\Quote\Item\Option; +use Magento\Quote\Model\Quote\Item\Option\Comparator; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -51,15 +52,22 @@ class CompareTest extends TestCase */ protected function setUp(): void { + $objectManagerHelper = new ObjectManager($this); + $constrArgs = $objectManagerHelper->getConstructArguments( + Item::class, + [ + 'itemOptionComparator' => new Comparator() + ] + ); $this->itemMock = $this->getMockBuilder(Item::class) ->addMethods(['getProductId']) ->onlyMethods(['__wakeup', 'getOptions', 'getOptionsByCode']) - ->disableOriginalConstructor() + ->setConstructorArgs($constrArgs) ->getMock(); $this->comparedMock = $this->getMockBuilder(Item::class) ->addMethods(['getProductId']) ->onlyMethods(['__wakeup', 'getOptions', 'getOptionsByCode']) - ->disableOriginalConstructor() + ->setConstructorArgs($constrArgs) ->getMock(); $this->optionMock = $this->getMockBuilder(Option::class) ->addMethods(['getCode']) @@ -82,7 +90,6 @@ function ($value) { ->disableOriginalConstructor() ->getMock(); - $objectManagerHelper = new ObjectManager($this); $this->helper = $objectManagerHelper->getObject( Compare::class, [ diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/Option/ComparatorTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/Option/ComparatorTest.php new file mode 100644 index 000000000000..ced7873b4b1b --- /dev/null +++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/Option/ComparatorTest.php @@ -0,0 +1,111 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Quote\Test\Unit\Model\Quote\Item\Option; + +use Magento\Framework\DataObject; +use Magento\Quote\Model\Quote\Item\Option\Comparator; +use Magento\Quote\Model\Quote\Item\Option\ComparatorInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test quote item options comparator + */ +class ComparatorTest extends TestCase +{ + /** + * @var ComparatorInterface|MockObject + */ + private $customComparator; + + /** + * @var Comparator + */ + private $model; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->customComparator = $this->createMock(ComparatorInterface::class); + $this->model = new Comparator( + [ + 'custom' => $this->customComparator + ] + ); + } + + /** + * @param array $option1 + * @param array $option2 + * @param bool $expected + * @dataProvider compareDataProvider + */ + public function testCompare(array $option1, array $option2, bool $expected): void + { + $this->customComparator + ->method('compare') + ->willReturnCallback( + function ($option1, $option2) { + return $option1->getValue() === $option2->getValue(); + } + ); + $this->assertEquals($expected, $this->model->compare(new DataObject($option1), new DataObject($option2))); + } + + /** + * @return array + */ + public function compareDataProvider(): array + { + return [ + [ + ['code' => 'test', 'value' => '1'], + ['code' => 'test', 'value' => '1'], + true + ], + [ + ['code' => 'test', 'value' => '1'], + ['code' => 'test', 'value' => 1], + true + ], + [ + ['code' => 'test', 'value' => '1'], + ['code' => 'test', 'value' => '2'], + false + ], + [ + ['code' => 'test', 'value' => '1'], + ['code' => 'test1', 'value' => '1'], + false + ], + [ + ['code' => 'custom', 'value' => '1'], + ['code' => 'custom', 'value' => '1'], + true + ], + [ + ['code' => 'custom', 'value' => '1'], + ['code' => 'custom', 'value' => 1], + false + ], + [ + ['code' => 'custom', 'value' => '1'], + ['code' => 'custom', 'value' => '2'], + false + ], + [ + ['code' => 'custom', 'value' => '1'], + ['code' => 'test1', 'value' => '1'], + false + ], + ]; + } +} diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/ItemTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/ItemTest.php index 53486fed2618..f574a2385044 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Quote/ItemTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/ItemTest.php @@ -20,6 +20,7 @@ use Magento\Quote\Model\Quote\Item; use Magento\Quote\Model\Quote\Item\Compare; use Magento\Quote\Model\Quote\Item\Option; +use Magento\Quote\Model\Quote\Item\Option\Comparator; use Magento\Quote\Model\Quote\Item\OptionFactory; use Magento\Sales\Model\Status\ListFactory; use Magento\Sales\Model\Status\ListStatus; @@ -148,7 +149,8 @@ protected function setUp(): void 'statusListFactory' => $statusListFactory, 'itemOptionFactory' => $this->itemOptionFactory, 'quoteItemCompare' => $this->compareHelper, - 'serializer' => $this->serializer + 'serializer' => $this->serializer, + 'itemOptionComparator' => new Comparator() ] ); } diff --git a/app/code/Magento/Quote/Test/Unit/Model/ResourceModel/Quote/ItemTest.php b/app/code/Magento/Quote/Test/Unit/Model/ResourceModel/Quote/ItemTest.php index 3a4d6f91b627..bf664322abab 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/ResourceModel/Quote/ItemTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/ResourceModel/Quote/ItemTest.php @@ -18,7 +18,9 @@ use Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; use Magento\Quote\Model\Quote\Item as QuoteItem; +use Magento\Quote\Model\Quote\Item\Option; use Magento\Quote\Model\ResourceModel\Quote\Item; +use Magento\Quote\Model\ResourceModel\Quote\Item\Option as OptionResourceModel; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -126,7 +128,7 @@ public function testSaveNotModifiedItem() ->with($this->quoteItemMock) ->willReturn(false); - $this->quoteItemMock->expects($this->never()) + $this->quoteItemMock->expects($this->once()) ->method('isOptionsSaved'); $this->quoteItemMock->expects($this->never()) ->method('saveItemOptions'); @@ -177,4 +179,61 @@ public function testSaveModifiedItem() $this->assertEquals($this->model, $this->model->save($this->quoteItemMock)); } + + public function testSaveWithNewOption(): void + { + $this->entitySnapshotMock->expects($this->exactly(2)) + ->method('isModified') + ->with($this->quoteItemMock) + ->willReturn(false); + + $this->quoteItemMock->expects($this->once()) + ->method('isOptionsSaved') + ->willReturn(false); + $this->quoteItemMock->expects($this->once()) + ->method('saveItemOptions'); + + $this->resourceMock->expects($this->any()) + ->method('getConnection') + ->willReturn($this->connectionMock); + $optionMock = $this->createMock(Option::class); + $this->quoteItemMock->expects($this->once()) + ->method('getOptions') + ->willReturn([$optionMock]); + + $this->assertEquals($this->model, $this->model->save($this->quoteItemMock)); + } + + public function testSaveWithModifiedOption(): void + { + $this->entitySnapshotMock->expects($this->exactly(2)) + ->method('isModified') + ->with($this->quoteItemMock) + ->willReturn(false); + + $this->quoteItemMock->expects($this->once()) + ->method('isOptionsSaved') + ->willReturn(false); + $this->quoteItemMock->expects($this->once()) + ->method('saveItemOptions'); + + $this->resourceMock->expects($this->any()) + ->method('getConnection') + ->willReturn($this->connectionMock); + $optionMock = $this->createMock(Option::class); + $optionMock->method('getId') + ->willReturn(1); + $optionResourceModelMock = $this->createMock(OptionResourceModel::class); + $optionResourceModelMock->expects($this->once()) + ->method('hasDataChanged') + ->with($optionMock) + ->willReturn(true); + $optionMock->method('getResource') + ->willReturn($optionResourceModelMock); + $this->quoteItemMock->expects($this->once()) + ->method('getOptions') + ->willReturn([$optionMock]); + + $this->assertEquals($this->model, $this->model->save($this->quoteItemMock)); + } } diff --git a/app/code/Magento/Quote/Test/Unit/Model/ShippingMethodManagementTest.php b/app/code/Magento/Quote/Test/Unit/Model/ShippingMethodManagementTest.php index 24e508b50369..784bf04ddf7d 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/ShippingMethodManagementTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/ShippingMethodManagementTest.php @@ -27,6 +27,9 @@ use Magento\Store\Model\Store; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Magento\Quote\Api\Data\CartExtensionInterface; +use Magento\Sales\Model\Order\ShippingAssignmentBuilder; +use Magento\Quote\Api\Data\ShippingInterface; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -103,6 +106,21 @@ class ShippingMethodManagementTest extends TestCase */ private $quoteAddressResource; + /** + * @var CartExtensionInterface|MockObject + */ + private $extensionAttributesMock; + + /** + * @var ShippingInterface|MockObject + */ + private $shippingMock; + + /** + * @var ShippingAssignmentBuilder|MockObject + */ + private $shippingAssignmentBuilder; + protected function setUp(): void { $this->objectManager = new ObjectManager($this); @@ -135,6 +153,7 @@ protected function setUp(): void 'collectTotals', 'save', '__wakeup', + 'getExtensionAttributes' ]) ->getMock(); @@ -190,6 +209,20 @@ protected function setUp(): void 'dataProcessor', $this->dataProcessor ); + + $this->extensionAttributesMock = $this->getMockBuilder(CartExtensionInterface::class) + ->setMethods(['getShippingAssignments']) + ->getMockForAbstractClass(); + + $this->shippingMock = $this->getMockForAbstractClass(ShippingInterface::class); + + $this->shippingAssignmentBuilder = $this->getMockBuilder(ShippingAssignmentBuilder::class) + ->disableOriginalConstructor() + ->setMethods([ + 'getShipping', + 'setShipping' + ]) + ->getMock(); } public function testGetMethodWhenShippingAddressIsNotSet() @@ -424,6 +457,24 @@ public function testSetMethodWithCouldNotSaveException() $this->shippingAddress->expects($this->once()) ->method('setShippingMethod') ->with($carrierCode . '_' . $methodCode); + $this->quote->expects($this->once()) + ->method('getExtensionAttributes') + ->willReturn($this->extensionAttributesMock); + + $this->extensionAttributesMock->expects($this->once())->method('getShippingAssignments') + ->willReturn([$this->shippingAssignmentBuilder]); + + $this->shippingAssignmentBuilder->expects($this->once())->method('getShipping') + ->willReturn($this->shippingMock); + + $this->shippingMock->expects($this->once()) + ->method('setMethod') + ->with($carrierCode . '_' . $methodCode); + + $this->shippingAssignmentBuilder->expects($this->once()) + ->method('setShipping') + ->with($this->shippingMock); + $exception = new \Exception('Custom Error'); $this->quote->expects($this->once())->method('collectTotals')->willReturnSelf(); $this->quoteRepository->expects($this->once()) @@ -477,6 +528,24 @@ public function testSetMethod() ->method('getCountryId')->willReturn($countryId); $this->shippingAddress->expects($this->once()) ->method('setShippingMethod')->with($carrierCode . '_' . $methodCode); + $this->quote->expects($this->once()) + ->method('getExtensionAttributes') + ->willReturn($this->extensionAttributesMock); + + $this->extensionAttributesMock->expects($this->once())->method('getShippingAssignments') + ->willReturn([$this->shippingAssignmentBuilder]); + + $this->shippingAssignmentBuilder->expects($this->once())->method('getShipping') + ->willReturn($this->shippingMock); + + $this->shippingMock->expects($this->once()) + ->method('setMethod') + ->with($carrierCode . '_' . $methodCode); + + $this->shippingAssignmentBuilder->expects($this->once()) + ->method('setShipping') + ->with($this->shippingMock); + $this->quote->expects($this->once())->method('collectTotals')->willReturnSelf(); $this->quoteRepository->expects($this->once())->method('save')->with($this->quote); diff --git a/app/code/Magento/Quote/Test/Unit/Observer/SendInvoiceEmailObserverTest.php b/app/code/Magento/Quote/Test/Unit/Observer/SendInvoiceEmailObserverTest.php new file mode 100644 index 000000000000..c3cfc62fc0f9 --- /dev/null +++ b/app/code/Magento/Quote/Test/Unit/Observer/SendInvoiceEmailObserverTest.php @@ -0,0 +1,209 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Quote\Test\Unit\Observer; + +use Magento\Framework\Event; +use Magento\Framework\Event\Observer; +use Magento\Quote\Model\Quote; +use Magento\Quote\Model\Quote\Payment; +use Magento\Quote\Observer\SubmitObserver; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\Email\Sender\InvoiceSender; +use Magento\Sales\Model\Order\Email\Sender\OrderSender; +use Magento\Sales\Model\Order\Invoice; +use Magento\Sales\Model\ResourceModel\Order\Invoice\Collection; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; +use Psr\Log\LoggerInterface; +use Magento\Sales\Model\Order\Email\Container\InvoiceIdentity; +use Magento\Quote\Observer\SendInvoiceEmailObserver; + +/** + * Test for sending invoice email during order place on frontend + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class SendInvoiceEmailObserverTest extends TestCase +{ + /** + * @var SendInvoiceEmailObserver + */ + private $model; + + /** + * @var LoggerInterface|MockObject + */ + private $loggerMock; + + /** + * @var InvoiceSender|MockObject + */ + private $invoiceSenderMock; + + /** + * @var InvoiceIdentity|MockObject + */ + private $invoiceIdentityMock; + + /** + * @var Observer|MockObject + */ + private $observerMock; + + /** + * @var Quote|MockObject + */ + private $quoteMock; + + /** + * @var Order|MockObject + */ + private $orderMock; + + /** + * @var Payment|MockObject + */ + private $paymentMock; + + /** + * @inheirtDoc + */ + protected function setUp(): void + { + $this->loggerMock = $this->getMockForAbstractClass(LoggerInterface::class); + $this->quoteMock = $this->createMock(Quote::class); + $this->orderMock = $this->createMock(Order::class); + $this->paymentMock = $this->createMock(Payment::class); + $this->invoiceSenderMock = $this->createMock(InvoiceSender::class); + $this->invoiceIdentityMock = $this->getMockBuilder(InvoiceIdentity::class) + ->disableOriginalConstructor() + ->setMethods(['isEnabled']) + ->getMock(); + $eventMock = $this->getMockBuilder(Event::class) + ->disableOriginalConstructor() + ->setMethods(['getQuote', 'getOrder']) + ->getMock(); + $this->observerMock = $this->createPartialMock(Observer::class, ['getEvent']); + $this->observerMock->expects($this->any())->method('getEvent')->willReturn($eventMock); + $eventMock->expects($this->any())->method('getQuote')->willReturn($this->quoteMock); + $eventMock->expects($this->any())->method('getOrder')->willReturn($this->orderMock); + $this->quoteMock->expects($this->any())->method('getPayment')->willReturn($this->paymentMock); + $this->model = new SendInvoiceEmailObserver( + $this->loggerMock, + $this->invoiceSenderMock, + $this->invoiceIdentityMock + ); + } + + /** + * Tests successful email sending. + */ + public function testSendEmail() + { + $this->invoiceIdentityMock + ->expects($this->once()) + ->method('isEnabled') + ->willReturn(true); + + $this->paymentMock->method('getOrderPlaceRedirectUrl')->willReturn(''); + + $invoice = $this->createMock(Invoice::class); + $invoiceCollection = $this->createMock(Collection::class); + $invoiceCollection->method('getItems') + ->willReturn([$invoice]); + $this->orderMock->method('getInvoiceCollection') + ->willReturn($invoiceCollection); + $this->quoteMock + ->expects($this->any()) + ->method('getPayment') + ->willReturn($this->paymentMock); + + $this->orderMock->method('getCanSendNewEmailFlag')->willReturn(true); + $this->invoiceSenderMock->expects($this->once()) + ->method('send') + ->with($invoice) + ->willReturn(true); + $this->loggerMock->expects($this->never()) + ->method('critical'); + + $this->model->execute($this->observerMock); + } + + /** + * Tests email sending disabled by configuration. + */ + public function testSendEmailDisabled() + { + $this->invoiceIdentityMock + ->expects($this->once()) + ->method('isEnabled') + ->willReturn(false); + + $this->paymentMock + ->expects($this->never()) + ->method('getOrderPlaceRedirectUrl'); + $this->orderMock + ->expects($this->never()) + ->method('getInvoiceCollection'); + + $this->quoteMock + ->expects($this->never()) + ->method('getPayment'); + + $this->orderMock + ->expects($this->never()) + ->method('getCanSendNewEmailFlag'); + $this->loggerMock->expects($this->never()) + ->method('critical'); + + $this->model->execute($this->observerMock); + } + + /** + * Tests failing email sending. + */ + public function testFailToSendEmail() + { + $this->invoiceIdentityMock + ->expects($this->once()) + ->method('isEnabled') + ->willReturn(true); + $this->paymentMock->expects($this->once())->method('getOrderPlaceRedirectUrl')->willReturn(''); + + $invoice = $this->createMock(Invoice::class); + $invoiceCollection = $this->createMock(Collection::class); + $invoiceCollection->method('getItems') + ->willReturn([$invoice]); + $this->orderMock->method('getInvoiceCollection') + ->willReturn($invoiceCollection); + + $this->orderMock->expects($this->once())->method('getCanSendNewEmailFlag')->willReturn(true); + $this->invoiceSenderMock->expects($this->once())->method('send')->willThrowException( + new \Exception('Some email sending Error') + ); + $this->loggerMock->expects($this->once())->method('critical'); + $this->model->execute($this->observerMock); + } + + /** + * Tests send email when redirect. + */ + public function testSendEmailWhenRedirectUrlExists() + { + $this->invoiceIdentityMock + ->expects($this->once()) + ->method('isEnabled') + ->willReturn(true); + + $this->paymentMock->expects($this->once())->method('getOrderPlaceRedirectUrl')->willReturn(false); + $this->orderMock->expects($this->once())->method('getCanSendNewEmailFlag'); + $this->invoiceSenderMock->expects($this->never())->method('send'); + $this->loggerMock->expects($this->never())->method('critical'); + $this->model->execute($this->observerMock); + } +} diff --git a/app/code/Magento/Quote/Test/Unit/Observer/SubmitObserverTest.php b/app/code/Magento/Quote/Test/Unit/Observer/SubmitObserverTest.php index 2b7c9e6b4d94..e28ec3bf23e0 100644 --- a/app/code/Magento/Quote/Test/Unit/Observer/SubmitObserverTest.php +++ b/app/code/Magento/Quote/Test/Unit/Observer/SubmitObserverTest.php @@ -22,6 +22,8 @@ use Psr\Log\LoggerInterface; /** + * Test for sending order email during order place on frontend + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class SubmitObserverTest extends TestCase @@ -41,11 +43,6 @@ class SubmitObserverTest extends TestCase */ private $orderSenderMock; - /** - * @var InvoiceSender|MockObject - */ - private $invoiceSender; - /** * @var Observer|MockObject */ @@ -66,6 +63,9 @@ class SubmitObserverTest extends TestCase */ private $paymentMock; + /** + * @inheirtDoc + */ protected function setUp(): void { $this->loggerMock = $this->getMockForAbstractClass(LoggerInterface::class); @@ -73,7 +73,6 @@ protected function setUp(): void $this->orderMock = $this->createMock(Order::class); $this->paymentMock = $this->createMock(Payment::class); $this->orderSenderMock = $this->createMock(OrderSender::class); - $this->invoiceSender = $this->createMock(InvoiceSender::class); $eventMock = $this->getMockBuilder(Event::class) ->disableOriginalConstructor() ->setMethods(['getQuote', 'getOrder']) @@ -85,8 +84,7 @@ protected function setUp(): void $this->quoteMock->expects($this->once())->method('getPayment')->willReturn($this->paymentMock); $this->model = new SubmitObserver( $this->loggerMock, - $this->orderSenderMock, - $this->invoiceSender + $this->orderSenderMock ); } @@ -106,10 +104,6 @@ public function testSendEmail() $this->orderMock->method('getCanSendNewEmailFlag')->willReturn(true); $this->orderSenderMock->expects($this->once()) ->method('send')->willReturn(true); - $this->invoiceSender->expects($this->once()) - ->method('send') - ->with($invoice) - ->willReturn(true); $this->loggerMock->expects($this->never()) ->method('critical'); diff --git a/app/code/Magento/Quote/etc/di.xml b/app/code/Magento/Quote/etc/di.xml index f66001e7789c..8687f673abe8 100644 --- a/app/code/Magento/Quote/etc/di.xml +++ b/app/code/Magento/Quote/etc/di.xml @@ -44,6 +44,7 @@ <preference for="Magento\Quote\Api\Data\EstimateAddressInterface" type="Magento\Quote\Model\EstimateAddress" /> <preference for="Magento\Quote\Api\Data\ProductOptionInterface" type="Magento\Quote\Model\Quote\ProductOption" /> <preference for="Magento\Quote\Model\ValidationRules\QuoteValidationRuleInterface" type="Magento\Quote\Model\ValidationRules\QuoteValidationComposite\Proxy"/> + <preference for="Magento\Quote\Model\Quote\Item\Option\ComparatorInterface" type="Magento\Quote\Model\Quote\Item\Option\Comparator"/> <type name="Magento\Webapi\Controller\Rest\ParamsOverrider"> <arguments> <argument name="paramOverriders" xsi:type="array"> diff --git a/app/code/Magento/Quote/etc/frontend/events.xml b/app/code/Magento/Quote/etc/frontend/events.xml index 1e9822bbf3ef..207d3077a681 100644 --- a/app/code/Magento/Quote/etc/frontend/events.xml +++ b/app/code/Magento/Quote/etc/frontend/events.xml @@ -7,6 +7,7 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_model_service_quote_submit_success"> - <observer name="sendEmail" instance="Magento\Quote\Observer\SubmitObserver" /> + <observer name="sendEmail" instance="Magento\Quote\Observer\SubmitObserver"/> + <observer name="sendInvoiceEmail" instance="Magento\Quote\Observer\SendInvoiceEmailObserver"/> </event> </config> diff --git a/app/code/Magento/Quote/etc/webapi_rest/events.xml b/app/code/Magento/Quote/etc/webapi_rest/events.xml index 1e9822bbf3ef..207d3077a681 100644 --- a/app/code/Magento/Quote/etc/webapi_rest/events.xml +++ b/app/code/Magento/Quote/etc/webapi_rest/events.xml @@ -7,6 +7,7 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_model_service_quote_submit_success"> - <observer name="sendEmail" instance="Magento\Quote\Observer\SubmitObserver" /> + <observer name="sendEmail" instance="Magento\Quote\Observer\SubmitObserver"/> + <observer name="sendInvoiceEmail" instance="Magento\Quote\Observer\SendInvoiceEmailObserver"/> </event> </config> diff --git a/app/code/Magento/Quote/etc/webapi_soap/events.xml b/app/code/Magento/Quote/etc/webapi_soap/events.xml index 1e9822bbf3ef..207d3077a681 100644 --- a/app/code/Magento/Quote/etc/webapi_soap/events.xml +++ b/app/code/Magento/Quote/etc/webapi_soap/events.xml @@ -7,6 +7,7 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_model_service_quote_submit_success"> - <observer name="sendEmail" instance="Magento\Quote\Observer\SubmitObserver" /> + <observer name="sendEmail" instance="Magento\Quote\Observer\SubmitObserver"/> + <observer name="sendInvoiceEmail" instance="Magento\Quote\Observer\SendInvoiceEmailObserver"/> </event> </config> diff --git a/app/code/Magento/QuoteAnalytics/README.md b/app/code/Magento/QuoteAnalytics/README.md index 51c93983e2bc..c79bd7a669bb 100644 --- a/app/code/Magento/QuoteAnalytics/README.md +++ b/app/code/Magento/QuoteAnalytics/README.md @@ -1,3 +1,19 @@ -# Magento_QuoteAnalytics +# Magento_QuoteAnalytics module -The Magento_QuoteAnalytics module configures data definitions for a data collection related to the Quote module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.3/advanced-reporting/modules.html). +This module configures data definitions for a data collection related to the Quote module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.3/advanced-reporting/modules.html). + +## Installation + +Before installing this module, note that the Magento_QuoteAnalytics is dependent on the following modules: +- `Magento_Quote` +- `Magento_Analytics` + +This module does not introduce any database schema modifications or new data. + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Additional data + +More information can get at articles: +- [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/overview.html) +- [Data collection for advanced reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/data-collection.html) diff --git a/app/code/Magento/QuoteBundleOptions/Model/Cart/BuyRequest/BundleDataProvider.php b/app/code/Magento/QuoteBundleOptions/Model/Cart/BuyRequest/BundleDataProvider.php index 575784c86ace..d02b99e0c0c6 100644 --- a/app/code/Magento/QuoteBundleOptions/Model/Cart/BuyRequest/BundleDataProvider.php +++ b/app/code/Magento/QuoteBundleOptions/Model/Cart/BuyRequest/BundleDataProvider.php @@ -40,6 +40,7 @@ public function execute(CartItem $cartItem): array if ($optionType == self::OPTION_TYPE) { $bundleOptionsData['bundle_option'][$optionId] = $optionValueId; $bundleOptionsData['bundle_option_qty'][$optionId] = $optionQuantity; + $bundleOptionsData['bundle_options_data'][$optionId][$optionValueId] = $optionQuantity; } } //for bundle options with custom quantity @@ -57,6 +58,7 @@ public function execute(CartItem $cartItem): array $optionQuantity = $option->getValue(); $bundleOptionsData['bundle_option'][$optionId] = $optionValueId; $bundleOptionsData['bundle_option_qty'][$optionId] = $optionQuantity; + $bundleOptionsData['bundle_options_data'][$optionId][$optionValueId] = $optionQuantity; } } diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/CheckCartCheckoutAllowance.php b/app/code/Magento/QuoteGraphQl/Model/Cart/CheckCartCheckoutAllowance.php index fcadc38b0fa4..55423e374d99 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/CheckCartCheckoutAllowance.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/CheckCartCheckoutAllowance.php @@ -39,7 +39,7 @@ public function __construct( */ public function execute(Quote $quote): void { - if (false === $quote->getCustomerIsGuest()) { + if (!$quote->getCustomerIsGuest()) { return; } diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/MergeCarts/CartQuantityValidator.php b/app/code/Magento/QuoteGraphQl/Model/Cart/MergeCarts/CartQuantityValidator.php new file mode 100644 index 000000000000..4d44108a2b0b --- /dev/null +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/MergeCarts/CartQuantityValidator.php @@ -0,0 +1,76 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\QuoteGraphQl\Model\Cart\MergeCarts; + + +use Magento\CatalogInventory\Api\StockRegistryInterface; +use Magento\Framework\Exception\CouldNotSaveException; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Quote\Api\CartItemRepositoryInterface; +use Magento\Quote\Api\Data\CartInterface; +use Magento\Quote\Api\Data\CartItemInterface; + +class CartQuantityValidator implements CartQuantityValidatorInterface +{ + /** + * @var CartItemRepositoryInterface + */ + private $cartItemRepository; + + /** + * @var StockRegistryInterface + */ + private $stockRegistry; + + /** + * @param CartItemRepositoryInterface $cartItemRepository + * @param StockRegistryInterface $stockRegistry + */ + public function __construct( + CartItemRepositoryInterface $cartItemRepository, + StockRegistryInterface $stockRegistry + ) { + $this->cartItemRepository = $cartItemRepository; + $this->stockRegistry = $stockRegistry; + } + + /** + * Validate combined cart quantities to make sure they are within available stock + * + * @param CartInterface $customerCart + * @param CartInterface $guestCart + * @return bool + */ + public function validateFinalCartQuantities(CartInterface $customerCart, CartInterface $guestCart): bool + { + $modified = false; + /** @var CartItemInterface $guestCartItem */ + foreach ($guestCart->getAllVisibleItems() as $guestCartItem) { + foreach ($customerCart->getAllItems() as $customerCartItem) { + if ($customerCartItem->compare($guestCartItem)) { + $product = $customerCartItem->getProduct(); + $stockCurrentQty = $this->stockRegistry->getStockStatus( + $product->getId(), + $product->getStore()->getWebsiteId() + )->getQty(); + if ($stockCurrentQty < $guestCartItem->getQty() + $customerCartItem->getQty()) { + try { + $this->cartItemRepository->deleteById($guestCart->getId(), $guestCartItem->getItemId()); + $modified = true; + } catch (NoSuchEntityException $e) { + continue; + } catch (CouldNotSaveException $e) { + continue; + } + } + } + } + } + return $modified; + } +} diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/MergeCarts/CartQuantityValidatorInterface.php b/app/code/Magento/QuoteGraphQl/Model/Cart/MergeCarts/CartQuantityValidatorInterface.php new file mode 100644 index 000000000000..690f5fca94ef --- /dev/null +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/MergeCarts/CartQuantityValidatorInterface.php @@ -0,0 +1,22 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\QuoteGraphQl\Model\Cart\MergeCarts; + +use Magento\Quote\Api\Data\CartInterface; + +interface CartQuantityValidatorInterface +{ + /** + * Validate cart quantities when merging + * + * @param CartInterface $customerCart + * @param CartInterface $guestCart + * @return bool + */ + public function validateFinalCartQuantities(CartInterface $customerCart, CartInterface $guestCart): bool; +} diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php b/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php index 7f88e9e52f11..895516e783ef 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php @@ -16,6 +16,7 @@ use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; +use Magento\Quote\Api\Data\CartInterface; use Magento\Quote\Model\Quote\Address as QuoteAddress; use Magento\Quote\Model\Quote\AddressFactory as BaseQuoteAddressFactory; @@ -194,4 +195,21 @@ public function createBasedOnCustomerAddress(int $customerAddressId, int $custom } return $quoteAddress; } + + /** + * Create quote address based on the shipping address. + * + * @param CartInterface $quote + * @return QuoteAddress + */ + public function createBasedOnShippingAddress(CartInterface $quote): QuoteAddress + { + $shippingAddressData = $quote->getShippingAddress()->exportCustomerAddress(); + + /** @var QuoteAddress $quoteAddress */ + $quoteAddress = $this->quoteAddressFactory->create(); + $quoteAddress->importCustomerAddressData($shippingAddressData); + + return $quoteAddress; + } } diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php index 497819cbeec3..a7d44fa104c2 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php @@ -49,42 +49,46 @@ public function __construct( * @param array $billingAddressInput * @return void * @throws GraphQlAuthorizationException - * @throws GraphQlInputException - * @throws GraphQlNoSuchEntityException */ public function execute(ContextInterface $context, CartInterface $cart, array $billingAddressInput): void { + $this->checkForInputExceptions($billingAddressInput); + $customerAddressId = $billingAddressInput['customer_address_id'] ?? null; $addressInput = $billingAddressInput['address'] ?? null; + $useForShipping = $billingAddressInput['use_for_shipping'] ?? false; + $sameAsShipping = $billingAddressInput['same_as_shipping'] ?? false; - if (!$customerAddressId && !isset($billingAddressInput['address']['save_in_address_book']) && $addressInput) { + if (!$customerAddressId && $addressInput && !isset($addressInput['save_in_address_book'])) { $addressInput['save_in_address_book'] = true; } - // Need to keep this for BC of `use_for_shipping` field - $sameAsShipping = isset($billingAddressInput['use_for_shipping']) - ? (bool)$billingAddressInput['use_for_shipping'] : false; - $sameAsShipping = isset($billingAddressInput['same_as_shipping']) - ? (bool)$billingAddressInput['same_as_shipping'] : $sameAsShipping; - - $this->checkForInputExceptions($billingAddressInput); - - $addresses = $cart->getAllShippingAddresses(); - if ($sameAsShipping && count($addresses) > 1) { - throw new GraphQlInputException( - __('Using the "same_as_shipping" option with multishipping is not possible.') + if ($sameAsShipping) { + $this->validateCanUseShippingForBilling($cart); + $billingAddress = $this->quoteAddressFactory->createBasedOnShippingAddress($cart); + $useForShipping = false; + } elseif ($customerAddressId) { + $this->validateCanUseCustomerAddress($context); + $billingAddress = $this->quoteAddressFactory->createBasedOnCustomerAddress( + (int)$customerAddressId, + (int)$context->getUserId() ); + } else { + $billingAddress = $this->quoteAddressFactory->createBasedOnInputData($addressInput); } - $billingAddress = $this->createBillingAddress($context, $customerAddressId, $addressInput); + if ($useForShipping) { + $this->validateCanUseBillingForShipping($cart); + } - $this->assignBillingAddressToCart->execute($cart, $billingAddress, $sameAsShipping); + $this->validateBillingAddress($billingAddress); + $this->assignBillingAddressToCart->execute($cart, $billingAddress, $useForShipping); } /** * Check for the input exceptions * - * @param array $billingAddressInput + * @param array|null $billingAddressInput * @throws GraphQlInputException */ private function checkForInputExceptions( @@ -92,10 +96,11 @@ private function checkForInputExceptions( ) { $customerAddressId = $billingAddressInput['customer_address_id'] ?? null; $addressInput = $billingAddressInput['address'] ?? null; + $sameAsShipping = $billingAddressInput['same_as_shipping'] ?? null; - if (null === $customerAddressId && null === $addressInput) { + if (null === $customerAddressId && null === $addressInput && empty($sameAsShipping)) { throw new GraphQlInputException( - __('The billing address must contain either "customer_address_id" or "address".') + __('The billing address must contain either "customer_address_id", "address", or "same_as_shipping".') ); } @@ -107,41 +112,79 @@ private function checkForInputExceptions( } /** - * Create billing address + * Validate that the quote is capable of using the shipping address as the billing address. * - * @param ContextInterface $context - * @param int|null $customerAddressId - * @param array $addressInput - * @return Address - * @throws GraphQlAuthorizationException + * @param CartInterface $quote * @throws GraphQlInputException - * @throws GraphQlNoSuchEntityException */ - private function createBillingAddress( - ContextInterface $context, - ?int $customerAddressId, - ?array $addressInput - ): Address { - if (null === $customerAddressId) { - $billingAddress = $this->quoteAddressFactory->createBasedOnInputData($addressInput); - } else { - if (false === $context->getExtensionAttributes()->getIsCustomer()) { - throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.')); - } + private function validateCanUseShippingForBilling(CartInterface $quote) + { + $shippingAddresses = $quote->getAllShippingAddresses(); - $billingAddress = $this->quoteAddressFactory->createBasedOnCustomerAddress( - (int)$customerAddressId, - (int)$context->getUserId() + if (count($shippingAddresses) > 1) { + throw new GraphQlInputException( + __('Could not use the "same_as_shipping" option, because multiple shipping addresses have been set.') ); } + + if (empty($shippingAddresses) || $shippingAddresses[0]->validate() !== true) { + throw new GraphQlInputException( + __('Could not use the "same_as_shipping" option, because the shipping address has not been set.') + ); + } + } + + /** + * Validate that the quote is capable of using the billing address as the shipping address. + * + * @param CartInterface $quote + * @throws GraphQlInputException + */ + private function validateCanUseBillingForShipping(CartInterface $quote) + { + $shippingAddresses = $quote->getAllShippingAddresses(); + + if (count($shippingAddresses) > 1) { + throw new GraphQlInputException( + __('Could not use the "use_for_shipping" option, because multiple shipping addresses have already been set.') + ); + } + } + + /** + * Validate that the currently logged-in customer is authorized to use a customer address id as the billing address. + * + * @param ContextInterface $context + * @throws GraphQlAuthorizationException + */ + private function validateCanUseCustomerAddress(ContextInterface $context) + { + if (false === $context->getExtensionAttributes()->getIsCustomer()) { + throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.')); + } + } + + /** + * Validate the billing address to be set on the cart. + * + * @param Address $billingAddress + * @return Address + * @throws GraphQlInputException + */ + private function validateBillingAddress(Address $billingAddress) + { $errors = $billingAddress->validate(); + if (true !== $errors) { - $e = new GraphQlInputException(__('Billing address errors')); + $e = new GraphQlInputException(__('An error occurred while processing the billing address.')); + foreach ($errors as $error) { $e->addError(new GraphQlInputException($error)); } + throw $e; } + return $billingAddress; } } diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/SetPaymentMethodOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Cart/SetPaymentMethodOnCart.php index 81a30216f003..56ff0a4edb03 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/SetPaymentMethodOnCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/SetPaymentMethodOnCart.php @@ -9,6 +9,7 @@ use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; use Magento\Checkout\Api\PaymentProcessingRateLimiterInterface; +use Magento\Checkout\Api\PaymentSavingRateLimiterInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; @@ -22,6 +23,8 @@ /** * Saves related payment method info for a cart. + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class SetPaymentMethodOnCart { @@ -41,7 +44,7 @@ class SetPaymentMethodOnCart private $additionalDataProviderPool; /** - * @var PaymentProcessingRateLimiterInterface + * @var PaymentSavingRateLimiterInterface */ private $paymentRateLimiter; @@ -50,18 +53,22 @@ class SetPaymentMethodOnCart * @param PaymentInterfaceFactory $paymentFactory * @param AdditionalDataProviderPool $additionalDataProviderPool * @param PaymentProcessingRateLimiterInterface|null $paymentRateLimiter + * @param PaymentSavingRateLimiterInterface|null $savingRateLimiter + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( PaymentMethodManagementInterface $paymentMethodManagement, PaymentInterfaceFactory $paymentFactory, AdditionalDataProviderPool $additionalDataProviderPool, - ?PaymentProcessingRateLimiterInterface $paymentRateLimiter = null + ?PaymentProcessingRateLimiterInterface $paymentRateLimiter = null, + ?PaymentSavingRateLimiterInterface $savingRateLimiter = null ) { $this->paymentMethodManagement = $paymentMethodManagement; $this->paymentFactory = $paymentFactory; $this->additionalDataProviderPool = $additionalDataProviderPool; - $this->paymentRateLimiter = $paymentRateLimiter - ?? ObjectManager::getInstance()->get(PaymentProcessingRateLimiterInterface::class); + $this->paymentRateLimiter = $savingRateLimiter + ?? ObjectManager::getInstance()->get(PaymentSavingRateLimiterInterface::class); } /** @@ -75,7 +82,12 @@ public function __construct( public function execute(Quote $cart, array $paymentData): void { try { - $this->paymentRateLimiter->limit(); + try { + $this->paymentRateLimiter->limit(); + } catch (PaymentProcessingRateLimitExceededException $ex) { + //Limit reached + return; + } } catch (PaymentProcessingRateLimitExceededException $exception) { throw new GraphQlInputException(__($exception->getMessage()), $exception); } diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php index d4ced5b8b97b..d07a7241c9dd 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php @@ -58,6 +58,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value $currencyCode = $cartItem->getQuote()->getQuoteCurrencyCode(); return [ + 'model' => $cartItem, 'price' => [ 'currency' => $currencyCode, 'value' => $cartItem->getCalculationPrice(), diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/MergeCarts.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/MergeCarts.php index 297fd25be1fa..7f7889c8174b 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/MergeCarts.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/MergeCarts.php @@ -7,8 +7,10 @@ namespace Magento\QuoteGraphQl\Model\Resolver; +use Magento\CatalogInventory\Api\StockRegistryInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\CouldNotSaveException; +use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException; use Magento\Framework\GraphQl\Exception\GraphQlInputException; @@ -16,10 +18,14 @@ use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\GraphQl\Model\Query\ContextInterface; +use Magento\Quote\Api\CartItemRepositoryInterface; use Magento\Quote\Api\CartRepositoryInterface; +use Magento\Quote\Api\Data\CartInterface; +use Magento\Quote\Api\Data\CartItemInterface; use Magento\Quote\Model\Cart\CustomerCartResolver; use Magento\Quote\Model\QuoteIdToMaskedQuoteIdInterface; use Magento\QuoteGraphQl\Model\Cart\GetCartForUser; +use Magento\QuoteGraphQl\Model\Cart\MergeCarts\CartQuantityValidatorInterface; /** * Merge Carts Resolver @@ -48,17 +54,37 @@ class MergeCarts implements ResolverInterface */ private $quoteIdToMaskedQuoteId; + /** + * @var CartItemRepositoryInterface + */ + private $cartItemRepository; + + /** + * @var StockRegistryInterface + */ + private $stockRegistry; + + /** + * @var CartQuantityValidatorInterface + */ + private $cartQuantityValidator; + /** * @param GetCartForUser $getCartForUser * @param CartRepositoryInterface $cartRepository * @param CustomerCartResolver|null $customerCartResolver * @param QuoteIdToMaskedQuoteIdInterface|null $quoteIdToMaskedQuoteId + * @param CartItemRepositoryInterface|null $cartItemRepository + * @param StockRegistryInterface|null $stockRegistry */ public function __construct( GetCartForUser $getCartForUser, CartRepositoryInterface $cartRepository, CustomerCartResolver $customerCartResolver = null, - QuoteIdToMaskedQuoteIdInterface $quoteIdToMaskedQuoteId = null + QuoteIdToMaskedQuoteIdInterface $quoteIdToMaskedQuoteId = null, + CartItemRepositoryInterface $cartItemRepository = null, + StockRegistryInterface $stockRegistry = null, + CartQuantityValidatorInterface $cartQuantityValidator = null ) { $this->getCartForUser = $getCartForUser; $this->cartRepository = $cartRepository; @@ -66,6 +92,12 @@ public function __construct( ?: ObjectManager::getInstance()->get(CustomerCartResolver::class); $this->quoteIdToMaskedQuoteId = $quoteIdToMaskedQuoteId ?: ObjectManager::getInstance()->get(QuoteIdToMaskedQuoteIdInterface::class); + $this->cartItemRepository = $cartItemRepository + ?: ObjectManager::getInstance()->get(CartItemRepositoryInterface::class); + $this->stockRegistry = $stockRegistry + ?: ObjectManager::getInstance()->get(StockRegistryInterface::class); + $this->cartQuantityValidator = $cartQuantityValidator + ?: ObjectManager::getInstance()->get(CartQuantityValidatorInterface::class); } /** @@ -127,6 +159,13 @@ public function resolve( $currentUserId, $storeId ); + if ($this->cartQuantityValidator->validateFinalCartQuantities($customerCart, $guestCart)) { + $guestCart = $this->getCartForUser->execute( + $guestMaskedCartId, + null, + $storeId + ); + } $customerCart->merge($guestCart); $guestCart->setIsActive(false); $this->cartRepository->save($customerCart); diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/PlaceOrder.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/PlaceOrder.php index 3a10c773c5f2..397455a2412a 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/PlaceOrder.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/PlaceOrder.php @@ -15,6 +15,7 @@ use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Quote\Api\CartManagementInterface; +use Magento\Quote\Api\PaymentMethodManagementInterface; use Magento\QuoteGraphQl\Model\Cart\GetCartForUser; use Magento\Sales\Api\OrderRepositoryInterface; use Magento\QuoteGraphQl\Model\Cart\CheckCartCheckoutAllowance; @@ -44,22 +45,30 @@ class PlaceOrder implements ResolverInterface */ private $checkCartCheckoutAllowance; + /** + * @var PaymentMethodManagementInterface + */ + private $paymentMethodManagement; + /** * @param GetCartForUser $getCartForUser * @param CartManagementInterface $cartManagement * @param OrderRepositoryInterface $orderRepository * @param CheckCartCheckoutAllowance $checkCartCheckoutAllowance + * @param PaymentMethodManagementInterface $paymentMethodManagement */ public function __construct( GetCartForUser $getCartForUser, CartManagementInterface $cartManagement, OrderRepositoryInterface $orderRepository, - CheckCartCheckoutAllowance $checkCartCheckoutAllowance + CheckCartCheckoutAllowance $checkCartCheckoutAllowance, + PaymentMethodManagementInterface $paymentMethodManagement ) { $this->getCartForUser = $getCartForUser; $this->cartManagement = $cartManagement; $this->orderRepository = $orderRepository; $this->checkCartCheckoutAllowance = $checkCartCheckoutAllowance; + $this->paymentMethodManagement = $paymentMethodManagement; } /** @@ -84,7 +93,8 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value } try { - $orderId = $this->cartManagement->placeOrder($cart->getId()); + $cartId = $cart->getId(); + $orderId = $this->cartManagement->placeOrder($cartId, $this->paymentMethodManagement->get($cartId)); $order = $this->orderRepository->get($orderId); return [ diff --git a/app/code/Magento/QuoteGraphQl/Test/Unit/Model/Cart/SetPaymentMethodOnCartTest.php b/app/code/Magento/QuoteGraphQl/Test/Unit/Model/Cart/SetPaymentMethodOnCartTest.php index 281e1233d8bb..45bd3538fbcb 100644 --- a/app/code/Magento/QuoteGraphQl/Test/Unit/Model/Cart/SetPaymentMethodOnCartTest.php +++ b/app/code/Magento/QuoteGraphQl/Test/Unit/Model/Cart/SetPaymentMethodOnCartTest.php @@ -9,7 +9,7 @@ namespace Magento\QuoteGraphQl\Test\Unit\Model\Cart; use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; -use Magento\Checkout\Api\PaymentProcessingRateLimiterInterface; +use Magento\Checkout\Api\PaymentSavingRateLimiterInterface; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Quote\Model\Quote; @@ -25,7 +25,7 @@ class SetPaymentMethodOnCartTest extends TestCase private $model; /** - * @var PaymentProcessingRateLimiterInterface|MockObject + * @var PaymentSavingRateLimiterInterface|MockObject */ private $rateLimiterMock; @@ -37,10 +37,10 @@ protected function setUp(): void parent::setUp(); $objectManager = new ObjectManager($this); - $this->rateLimiterMock = $this->getMockForAbstractClass(PaymentProcessingRateLimiterInterface::class); + $this->rateLimiterMock = $this->getMockForAbstractClass(PaymentSavingRateLimiterInterface::class); $this->model = $objectManager->getObject( SetPaymentMethodOnCart::class, - ['paymentRateLimiter' => $this->rateLimiterMock] + ['savingRateLimiter' => $this->rateLimiterMock] ); } @@ -52,10 +52,9 @@ protected function setUp(): void public function testLimited(): void { $this->rateLimiterMock->method('limit') - ->willThrowException(new PaymentProcessingRateLimitExceededException(__($message = 'Error'))); - $this->expectException(GraphQlInputException::class); - $this->expectExceptionMessage($message); + ->willThrowException(new PaymentProcessingRateLimitExceededException(__('Error'))); + //There will be en error if the limiter won't stop the execution $this->model->execute($this->createMock(Quote::class), []); } } diff --git a/app/code/Magento/QuoteGraphQl/composer.json b/app/code/Magento/QuoteGraphQl/composer.json index 25f089cf75a6..7a02e25ef338 100644 --- a/app/code/Magento/QuoteGraphQl/composer.json +++ b/app/code/Magento/QuoteGraphQl/composer.json @@ -14,7 +14,8 @@ "magento/module-sales": "*", "magento/module-directory": "*", "magento/module-graph-ql": "*", - "magento/module-gift-message": "*" + "magento/module-gift-message": "*", + "magento/module-catalog-inventory": "*" }, "suggest": { "magento/module-graph-ql-cache": "*" diff --git a/app/code/Magento/QuoteGraphQl/etc/graphql/di.xml b/app/code/Magento/QuoteGraphQl/etc/graphql/di.xml index 88f97d32b71d..a123d1032fdb 100644 --- a/app/code/Magento/QuoteGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/QuoteGraphQl/etc/graphql/di.xml @@ -10,6 +10,8 @@ type="Magento\QuoteGraphQl\Model\Cart\SetShippingAddressesOnCart"/> <preference for="Magento\QuoteGraphQl\Model\Cart\SetShippingMethodsOnCartInterface" type="Magento\QuoteGraphQl\Model\Cart\SetShippingMethodsOnCart"/> + <preference for="Magento\QuoteGraphQl\Model\Cart\MergeCarts\CartQuantityValidatorInterface" + type="Magento\QuoteGraphQl\Model\Cart\MergeCarts\CartQuantityValidator"/> <type name="Magento\QuoteGraphQl\Model\Cart\BuyRequest\BuyRequestBuilder"> <arguments> <argument name="providers" xsi:type="array"> diff --git a/app/code/Magento/QuoteGraphQl/etc/graphql/events.xml b/app/code/Magento/QuoteGraphQl/etc/graphql/events.xml index 1e9822bbf3ef..207d3077a681 100644 --- a/app/code/Magento/QuoteGraphQl/etc/graphql/events.xml +++ b/app/code/Magento/QuoteGraphQl/etc/graphql/events.xml @@ -7,6 +7,7 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_model_service_quote_submit_success"> - <observer name="sendEmail" instance="Magento\Quote\Observer\SubmitObserver" /> + <observer name="sendEmail" instance="Magento\Quote\Observer\SubmitObserver"/> + <observer name="sendInvoiceEmail" instance="Magento\Quote\Observer\SendInvoiceEmailObserver"/> </event> </config> diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls index bcbbb3dc97de..21688234dc16 100644 --- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls +++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls @@ -104,8 +104,8 @@ input SetBillingAddressOnCartInput { input BillingAddressInput { customer_address_id: Int address: CartAddressInput - use_for_shipping: Boolean @doc(description: "Deprecated: use `same_as_shipping` field instead") - same_as_shipping: Boolean @doc(description: "Set billing address same as shipping") + use_for_shipping: Boolean @doc(description: "Indicates whether to additionally set the shipping address based on the provided billing address") + same_as_shipping: Boolean @doc(description: "Indicates whether to set the billing address based on the existing shipping address on the cart") } input CartAddressInput { @@ -322,11 +322,11 @@ type SetGuestEmailOnCartOutput { } type SimpleCartItem implements CartItemInterface @doc(description: "Simple Cart Item") { - customizable_options: [SelectedCustomizableOption] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") + customizable_options: [SelectedCustomizableOption]! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") } type VirtualCartItem implements CartItemInterface @doc(description: "Virtual Cart Item") { - customizable_options: [SelectedCustomizableOption] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") + customizable_options: [SelectedCustomizableOption]! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") } interface CartItemInterface @typeResolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemTypeResolver") { @@ -354,6 +354,7 @@ type SelectedCustomizableOption { id: Int! @deprecated(reason: "Use SelectedCustomizableOption.customizable_option_uid instead") customizable_option_uid: ID! @doc(description: "The unique ID for a `CustomizableRadioOption`, `CustomizableDropDownOption`, `CustomizableMultipleOption`, etc. of `CustomizableOptionInterface` objects") label: String! + type: String! is_required: Boolean! values: [SelectedCustomizableOptionValue!]! sort_order: Int! diff --git a/app/code/Magento/ReleaseNotification/README.md b/app/code/Magento/ReleaseNotification/README.md index c53e3cbde1d0..6857377fe819 100644 --- a/app/code/Magento/ReleaseNotification/README.md +++ b/app/code/Magento/ReleaseNotification/README.md @@ -14,7 +14,7 @@ The **Release Notification Module** serves to provide a notification delivery pl Release notification content is maintained by Magento for each Magento version, edition, and locale. To retrieve the content, a response is returned from a request with the following parameters: -* **version** = The Magento version that the client has installed (ex. 2.3.0). +* **version** = The Magento version that the client has installed (ex. 2.4.0). * **edition** = The Magento edition that the client has installed (ex. Community). * **locale** = The chosen locale of the admin user (ex. en_US). diff --git a/app/code/Magento/RemoteStorage/Driver/Adapter/Cache/CacheInterface.php b/app/code/Magento/RemoteStorage/Driver/Adapter/Cache/CacheInterface.php new file mode 100644 index 000000000000..678e73077e2f --- /dev/null +++ b/app/code/Magento/RemoteStorage/Driver/Adapter/Cache/CacheInterface.php @@ -0,0 +1,96 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\RemoteStorage\Driver\Adapter\Cache; + +/** + * Interface for filesystem adapter cache storage. Used in Cached adapter implementation to store metadata for + * filesystem entities in order to reduce calls to filesystem API. + */ +interface CacheInterface +{ + /** + * Cache tag + */ + public const CACHE_TAG = 'flysystem'; + + /** + * Check if path is cached as existing path. + * Returns: + * - true - path exists and there is a cache record for it + * - false - path is cached as non-existing in filesystem + * - null - no cached record on path + * + * @param string $path + * @return bool|null + */ + public function exists(string $path): ?bool; + + /** + * Get metadata for path. + * + * @param string $path + * @return array|null + */ + public function getMetadata(string $path): ?array; + + /** + * Flush the cache. + */ + public function flushCache(): void; + + /** + * Purges data enqueued for deletion. + */ + public function purgeQueue(): void; + + /** + * Rename/move a file or directory. + * + * @param string $path + * @param string $newpath + */ + public function moveFile(string $path, string $newpath): void; + + /** + * Copy file. + * + * @param string $path + * @param string $newpath + */ + public function copyFile(string $path, string $newpath): void; + + /** + * Delete an object from cache by path. + * + * @param string $path + */ + public function deleteFile(string $path): void; + + /** + * Delete objects in directory for cache. + * + * @param string $dirname + */ + public function deleteDir(string $dirname): void; + + /** + * Update metadata for the path. + * + * @param string $path + * @param array $objectMetadata + * @param bool $persist + */ + public function updateMetadata(string $path, array $objectMetadata, bool $persist = false): void; + + /** + * Store flag that path does not exist in the filesystem. + * + * @param string $path + */ + public function storeFileNotExists(string $path): void; +} diff --git a/app/code/Magento/RemoteStorage/Driver/Adapter/Cache/Generic.php b/app/code/Magento/RemoteStorage/Driver/Adapter/Cache/Generic.php new file mode 100644 index 000000000000..7adaf2de12e5 --- /dev/null +++ b/app/code/Magento/RemoteStorage/Driver/Adapter/Cache/Generic.php @@ -0,0 +1,251 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\RemoteStorage\Driver\Adapter\Cache; + +use Magento\Framework\App\CacheInterface as MagentoCacheInterface; +use Magento\Framework\Serialize\SerializerInterface; +use Magento\RemoteStorage\Driver\Adapter\PathUtil; + +/** + * Generic cache implementation for filesystem storage. + */ +class Generic implements CacheInterface +{ + /** + * @var array + */ + private $cacheData = []; + + /** + * List of cache paths to be purged when persist is called + * + * @var array + */ + private $cachePathPurgeQueue = []; + + /** + * @var string + */ + private $prefix; + + /** + * @var SerializerInterface + */ + private $serializer; + + /** + * @var MagentoCacheInterface + */ + private $cacheAdapter; + + /** + * @var PathUtil + */ + private $pathUtil; + + /** + * @param MagentoCacheInterface $cacheAdapter + * @param SerializerInterface $serializer + * @param PathUtil $pathUtil + * @param string $prefix + */ + public function __construct( + MagentoCacheInterface $cacheAdapter, + SerializerInterface $serializer, + PathUtil $pathUtil, + $prefix = 'flysystem:' + ) { + $this->prefix = $prefix; + $this->serializer = $serializer; + $this->cacheAdapter = $cacheAdapter; + $this->pathUtil = $pathUtil; + } + + /** + * @inheritdoc + */ + public function purgeQueue(): void + { + foreach ($this->cachePathPurgeQueue as $path) { + unset($this->cacheData[$path]); + $this->cacheAdapter->remove($this->prefix . $path); + } + } + + /** + * @inheritdoc + */ + public function updateMetadata(string $path, array $objectMetadata, bool $persist = false): void + { + $this->cacheData[$path] = array_merge($this->pathUtil->pathInfo($path), $objectMetadata); + if ($persist) { + $this->cacheAdapter->save( + $this->serializer->serialize([$path => $this->cacheData[$path]]), + $this->prefix . $path, + [self::CACHE_TAG] + ); + } + + $this->ensureParentDirectories($path); + } + + /** + * @inheritdoc + */ + public function storeFileNotExists(string $path): void + { + $this->cacheData[$path] = false; + $this->cacheAdapter->save( + $this->serializer->serialize([$path => $this->cacheData[$path]]), + $this->prefix . $path, + [self::CACHE_TAG] + ); + } + + /** + * @inheritdoc + */ + public function exists(string $path): ?bool + { + if (!isset($this->cacheData[$path])) { + $fileMeta = $this->cacheAdapter->load($this->prefix . $path); + + if ($fileMeta === false) { + return null; + } + + $this->setFromStorage($fileMeta); + } + + return array_key_exists($path, $this->cacheData) ? $this->cacheData[$path] !== false : null; + } + + /** + * @inheritdoc + */ + public function moveFile(string $path, string $newpath): void + { + if ($this->exists($path)) { + $object = $this->cacheData[$path]; + unset($this->cacheData[$path]); + $this->cachePathPurgeQueue[] = $path; + $object['path'] = $newpath; + $object = array_merge($object, $this->pathUtil->pathInfo($newpath)); + $this->cacheData[$newpath] = $object; + $this->cacheAdapter->save( + $this->serializer->serialize([$newpath => $this->cacheData[$newpath]]), + $this->prefix . $newpath, + [self::CACHE_TAG] + ); + $this->purgeQueue(); + } + } + + /** + * @inheritdoc + */ + public function copyFile(string $path, string $newpath): void + { + if ($this->exists($path)) { + $object = $this->cacheData[$path]; + $object = array_merge($object, $this->pathUtil->pathInfo($newpath)); + $this->updateMetadata($newpath, $object, true); + } + } + + /** + * @inheritdoc + */ + public function deleteFile(string $path): void + { + $this->storeFileNotExists($path); + } + + /** + * @inheritdoc + */ + public function deleteDir(string $dirname): void + { + foreach ($this->cacheData as $path => $object) { + if ($this->pathIsInDirectory($dirname, $path) || $path === $dirname) { + unset($this->cacheData[$path]); + $this->cachePathPurgeQueue[] = $path; + } + } + + $this->purgeQueue(); + } + + /** + * @inheritdoc + */ + public function getMetadata(string $path): ?array + { + if (isset($this->cacheData[$path]['type'])) { + return $this->cacheData[$path]; + } else { + $meta = $this->cacheAdapter->load($this->prefix . $path); + if (!$meta) { + return null; + } + $meta = $this->serializer->unserialize($meta); + if (!$meta[$path]) { + return null; + } + $this->cacheData[$path] = $meta[$path]; + return $this->cacheData[$path]; + } + } + + /** + * @inheritdoc + */ + public function flushCache(): void + { + $this->cacheData = []; + $this->cacheAdapter->clean([self::CACHE_TAG]); + } + + /** + * Load from serialized cache data. + * + * @param string $json + */ + private function setFromStorage(string $json) + { + $this->cacheData = array_merge($this->cacheData, $this->serializer->unserialize($json)); + } + + /** + * Ensure parent directories of an object. + * + * @param string $path object path + */ + private function ensureParentDirectories($path) + { + $object = $this->cacheData[$path]; + + while ($object['dirname'] !== '' && ! isset($this->cacheData[$object['dirname']])) { + $object = $this->pathUtil->pathInfo($object['dirname']); + $object['type'] = 'dir'; + $this->cacheData[$object['path']] = $object; + } + } + + /** + * Determines if the path is inside the directory. + * + * @param string $directory + * @param string $path + * @return bool + */ + private function pathIsInDirectory($directory, $path) + { + return $directory === '' || strpos((string)$path, $directory . '/') === 0; + } +} diff --git a/app/code/Magento/RemoteStorage/Driver/Adapter/CachedAdapter.php b/app/code/Magento/RemoteStorage/Driver/Adapter/CachedAdapter.php new file mode 100644 index 000000000000..605a1a66e386 --- /dev/null +++ b/app/code/Magento/RemoteStorage/Driver/Adapter/CachedAdapter.php @@ -0,0 +1,226 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\RemoteStorage\Driver\Adapter; + +use League\Flysystem\Config; +use League\Flysystem\FileAttributes; +use League\Flysystem\FilesystemAdapter; +use Magento\RemoteStorage\Driver\Adapter\Cache\CacheInterface; + +/** + * Cached adapter implementation for filesystem storage. + */ +class CachedAdapter implements CachedAdapterInterface +{ + /** + * @var FilesystemAdapter + */ + private $adapter; + + /** + * @var CacheInterface + */ + private $cache; + + /** + * @var MetadataProviderInterface + */ + private $metadataProvider; + + /** + * Constructor. + * + * @param FilesystemAdapter $adapter + * @param CacheInterface $cache + * @param MetadataProviderInterface $metadataProvider + */ + public function __construct( + FilesystemAdapter $adapter, + CacheInterface $cache, + MetadataProviderInterface $metadataProvider + ) { + $this->adapter = $adapter; + $this->cache = $cache; + $this->metadataProvider = $metadataProvider; + } + + /** + * {@inheritdoc} + */ + public function write(string $path, string $contents, Config $config): void + { + $this->adapter->write($path, $contents, $config); + $object = [ + 'type' => 'file', + 'path' => $path, + ]; + $this->cache->updateMetadata($path, $object, true); + } + + /** + * {@inheritdoc} + */ + public function writeStream(string $path, $contents, Config $config): void + { + $this->adapter->writeStream($path, $contents, $config); + $object = [ + 'type' => 'file', + 'path' => $path, + ]; + $this->cache->updateMetadata($path, $object, true); + } + + /** + * {@inheritdoc} + */ + public function move(string $source, string $destination, Config $config): void + { + $this->adapter->move($source, $destination, $config); + $this->cache->moveFile($source, $destination); + } + + /** + * {@inheritdoc} + */ + public function copy(string $source, string $destination, Config $config): void + { + $this->adapter->copy($source, $destination, $config); + $this->cache->copyFile($source, $destination); + } + + /** + * {@inheritdoc} + */ + public function delete(string $path): void + { + $this->adapter->delete($path); + $this->cache->deleteFile($path); + } + + /** + * {@inheritdoc} + */ + public function deleteDirectory(string $path): void + { + $this->adapter->deleteDirectory($path); + $this->cache->deleteDir($path); + } + + /** + * {@inheritdoc} + */ + public function createDirectory(string $path, Config $config): void + { + $this->adapter->createDirectory($path, $config); + $type = 'dir'; + $dirname = $path; + $this->cache->updateMetadata($dirname, ['path' => $path, 'type' => $type], true); + } + + /** + * {@inheritdoc} + */ + public function setVisibility(string $path, string $visibility): void + { + $this->adapter->setVisibility($path, $visibility); + $this->cache->updateMetadata($path, ['path' => $path, 'visibility' => $visibility], true); + } + + /** + * {@inheritdoc} + */ + public function fileExists(string $path): bool + { + $cacheHas = $this->cache->exists($path); + + if ($cacheHas !== null) { + return $cacheHas; + } + + $exists = $this->adapter->fileExists($path); + + if (!$exists) { + try { + // check if target is a directory + $exists = iterator_count($this->adapter->listContents($path, false)) > 0; + } catch (\Throwable $e) { + // catch closed iterator + $exists = false; + } + } + + if (!$exists) { + $this->cache->storeFileNotExists($path); + } else { + $cacheEntry = is_array($exists) ? $exists : ['path' => $path]; + $this->cache->updateMetadata($path, $cacheEntry, true); + } + + return $exists; + } + + /** + * {@inheritdoc} + */ + public function read(string $path): string + { + return $this->adapter->read($path); + } + + /** + * {@inheritdoc} + */ + public function readStream(string $path) + { + return $this->adapter->readStream($path); + } + + /** + * {@inheritdoc} + */ + public function listContents(string $path, bool $deep): iterable + { + return $this->adapter->listContents($path, $deep); + } + + /** + * {@inheritdoc} + */ + public function fileSize(string $path): FileAttributes + { + $result = $this->metadataProvider->getMetadata($path); + return new FileAttributes($path, (int)$result['size']); + } + + /** + * {@inheritdoc} + */ + public function mimeType(string $path): FileAttributes + { + $result = $this->metadataProvider->getMetadata($path); + return new FileAttributes($path, null, null, null, $result['mimetype']); + } + + /** + * {@inheritdoc} + */ + public function lastModified(string $path): FileAttributes + { + $result = $this->metadataProvider->getMetadata($path); + return new FileAttributes($path, null, null, (int)$result['timestamp']); + } + + /** + * {@inheritdoc} + */ + public function visibility(string $path): FileAttributes + { + $result = $this->metadataProvider->getMetadata($path); + return new FileAttributes($path, null, $result['visibility']); + } +} diff --git a/app/code/Magento/RemoteStorage/Driver/Adapter/CachedAdapterInterface.php b/app/code/Magento/RemoteStorage/Driver/Adapter/CachedAdapterInterface.php new file mode 100644 index 000000000000..294dc4339db4 --- /dev/null +++ b/app/code/Magento/RemoteStorage/Driver/Adapter/CachedAdapterInterface.php @@ -0,0 +1,18 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\RemoteStorage\Driver\Adapter; + +use League\Flysystem\FilesystemAdapter; + +/** + * Cached adapter interface for filesystem storage. + */ +interface CachedAdapterInterface extends FilesystemAdapter +{ + +} diff --git a/app/code/Magento/RemoteStorage/Driver/Adapter/MetadataProvider.php b/app/code/Magento/RemoteStorage/Driver/Adapter/MetadataProvider.php new file mode 100644 index 000000000000..421bddd657bb --- /dev/null +++ b/app/code/Magento/RemoteStorage/Driver/Adapter/MetadataProvider.php @@ -0,0 +1,133 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\RemoteStorage\Driver\Adapter; + +use League\Flysystem\FilesystemAdapter; +use League\Flysystem\FilesystemException; +use League\Flysystem\UnableToRetrieveMetadata; +use Magento\RemoteStorage\Driver\Adapter\Cache\CacheInterface; + +/** + * Metadata provider for filesystem storage. + */ +class MetadataProvider implements MetadataProviderInterface +{ + /** + * @var FilesystemAdapter + */ + private $adapter; + + /** + * @var Cache\CacheInterface + */ + private $cache; + + /** + * MetadataProvider constructor. + * + * @param FilesystemAdapter $adapter + * @param Cache\CacheInterface $cache + */ + public function __construct( + FilesystemAdapter $adapter, + CacheInterface $cache + ) { + $this->adapter = $adapter; + $this->cache = $cache; + } + + /** + * Check is the given path an existing directory. + * + * @param string $path + * @return bool + */ + private function isDirectory($path): bool + { + try { + return iterator_count($this->adapter->listContents($path, false)) > 0; + } catch (\Throwable $e) { + // catch closed iterator + return false; + } + } + + /** + * @inheritdoc + */ + public function getMetadata(string $path): array + { + $metadata = $this->cache->getMetadata($path); + if (isset($metadata['type']) && ($metadata['type'] == 'dir' || $this->isMetadataComplete($metadata))) { + return $metadata; + } + try { + $meta = $this->adapter->lastModified($path); + } catch (UnableToRetrieveMetadata $e) { + if ($this->isDirectory($path)) { + $data = [ + 'path' => $path, + 'type' => 'dir', + 'size' => null, + 'timestamp' => null, + 'visibility' => null, + 'mimetype' => null, + 'dirname' => dirname($path), + 'basename' => basename($path), + ]; + $this->cache->updateMetadata($path, $data, true); + return $data; + } else { + throw new UnableToRetrieveMetadata( + "Unable to retrieve metadata for file at location: {$path}. {$e->getMessage()}", + 0, + $e + ); + } + } catch (\InvalidArgumentException | FilesystemException $e) { + throw new UnableToRetrieveMetadata( + "Unable to retrieve metadata for file at location: {$path}. {$e->getMessage()}", + 0, + $e + ); + } + $data = [ + 'path' => $path, + 'type' => $meta->type(), + 'size' => $meta->fileSize(), + 'timestamp' => $meta->lastModified(), + 'visibility' => $meta->visibility(), + 'mimetype' => $meta->mimeType(), + 'dirname' => dirname($meta->path()), + 'basename' => basename($meta->path()), + ]; + $extraMetadata = $meta->extraMetadata(); + if (isset($extraMetadata['Metadata']['image-width']) && isset($extraMetadata['Metadata']['image-height'])) { + $data['extra'] = $extraMetadata['Metadata']; + } + $this->cache->updateMetadata($path, $data, true); + return $data; + } + + /** + * Check is the metadata structure complete. + * + * @param array $metadata + * @return bool + */ + private function isMetadataComplete($metadata) + { + $keys = ['type', 'size', 'timestamp', 'visibility', 'mimetype', 'dirname', 'basename']; + foreach ($keys as $key) { + if (!array_key_exists($key, $metadata)) { + return false; + } + } + return true; + } +} diff --git a/app/code/Magento/RemoteStorage/Driver/Adapter/MetadataProviderInterface.php b/app/code/Magento/RemoteStorage/Driver/Adapter/MetadataProviderInterface.php new file mode 100644 index 000000000000..fa4fb5583812 --- /dev/null +++ b/app/code/Magento/RemoteStorage/Driver/Adapter/MetadataProviderInterface.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\RemoteStorage\Driver\Adapter; + +use League\Flysystem\UnableToRetrieveMetadata; + +/** + * Interface for metadata provider. Provides metadata of the file by given path. + */ +interface MetadataProviderInterface +{ + /** + * Retrieve metadata for a file by path. + * + * @param string $path + * @return array + * @throws UnableToRetrieveMetadata + */ + public function getMetadata(string $path): array; +} diff --git a/app/code/Magento/RemoteStorage/Driver/Adapter/PathUtil.php b/app/code/Magento/RemoteStorage/Driver/Adapter/PathUtil.php new file mode 100644 index 000000000000..5bcb6b440806 --- /dev/null +++ b/app/code/Magento/RemoteStorage/Driver/Adapter/PathUtil.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\RemoteStorage\Driver\Adapter; + +/** + * Utility class for path operations. + */ +class PathUtil +{ + /** + * Get normalized path info. + * + * @param string $path + * @return array + */ + public function pathInfo($path) + { + $pathInfo = ['path' => $path]; + $dirname = dirname($path); + if ('' !== $dirname) { + $pathInfo['dirname'] = $dirname === '.' ? '' : $dirname; + } + $pathInfo['basename'] = $this->basename($path); + $pathInfo += pathinfo($pathInfo['basename']); + return $pathInfo + ['dirname' => '']; + } + + /** + * Get basename for path. + * + * @param string $path + * @return string + */ + private function basename($path) + { + $separators = DIRECTORY_SEPARATOR === '/' ? '/' : '\/'; + $path = rtrim($path, $separators); + return preg_replace('#.*?([^' . preg_quote($separators, '#') . ']+$)#', '$1', $path); + } +} diff --git a/app/code/Magento/RemoteStorage/Driver/Cache/CacheFactory.php b/app/code/Magento/RemoteStorage/Driver/Cache/CacheFactory.php deleted file mode 100644 index 703393b69ec6..000000000000 --- a/app/code/Magento/RemoteStorage/Driver/Cache/CacheFactory.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\RemoteStorage\Driver\Cache; - -use League\Flysystem\Adapter\Local; -use League\Flysystem\Cached\CacheInterface; -use League\Flysystem\Cached\Storage\Memory; -use League\Flysystem\Cached\Storage\Predis; -use League\Flysystem\Cached\Storage\Adapter; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\Filesystem; -use Magento\RemoteStorage\Driver\DriverException; -use Magento\RemoteStorage\Driver\DriverPool; -use Predis\Client; - -/** - * Provides cache adapters. - */ -class CacheFactory -{ - public const ADAPTER_PREDIS = 'predis'; - public const ADAPTER_MEMORY = 'memory'; - public const ADAPTER_LOCAL = 'local'; - - private const CACHE_KEY = 'storage'; - private const CACHE_FILE = 'storage_cache.json'; - - /** - * Cache for 30 days. - */ - private const CACHE_EXPIRATION = 30 * 86400; - - /** - * @var string - */ - private $localCacheRoot; - - /** - * @param Filesystem $filesystem - */ - public function __construct(Filesystem $filesystem) - { - $this->localCacheRoot = $filesystem->getDirectoryRead( - DirectoryList::VAR_DIR, - DriverPool::FILE - )->getAbsolutePath(); - } - - /** - * Create cache adapter. - * - * @param string $adapter - * @param array $config - * @return CacheInterface - * @throws DriverException - */ - public function create(string $adapter, array $config = []): CacheInterface - { - switch ($adapter) { - case self::ADAPTER_PREDIS: - if (!class_exists(Client::class)) { - throw new DriverException(__('Predis client is not installed')); - } - - return new Predis(new Client($config), self::CACHE_KEY, self::CACHE_EXPIRATION); - case self::ADAPTER_MEMORY: - return new Memory(); - case self::ADAPTER_LOCAL: - return new Adapter(new Local($this->localCacheRoot), self::CACHE_FILE, self::CACHE_EXPIRATION); - } - - throw new DriverException(__('Cache adapter %1 is not supported', $adapter)); - } -} diff --git a/app/code/Magento/RemoteStorage/Driver/DriverFactoryInterface.php b/app/code/Magento/RemoteStorage/Driver/DriverFactoryInterface.php index f578d1cd57b3..705c7bff0fb7 100644 --- a/app/code/Magento/RemoteStorage/Driver/DriverFactoryInterface.php +++ b/app/code/Magento/RemoteStorage/Driver/DriverFactoryInterface.php @@ -35,7 +35,7 @@ public function create(): RemoteDriverInterface; public function createConfigured( array $config, string $prefix, - string $cacheAdapter, - array $cacheConfig + string $cacheAdapter = '', + array $cacheConfig = [] ): RemoteDriverInterface; } diff --git a/app/code/Magento/RemoteStorage/Model/Config.php b/app/code/Magento/RemoteStorage/Model/Config.php index 1eedcb57d4ca..53de61194a06 100644 --- a/app/code/Magento/RemoteStorage/Model/Config.php +++ b/app/code/Magento/RemoteStorage/Model/Config.php @@ -10,7 +10,6 @@ use Magento\Framework\App\DeploymentConfig; use Magento\Framework\Exception\FileSystemException; use Magento\Framework\Exception\RuntimeException; -use Magento\RemoteStorage\Driver\Cache\CacheFactory; use Magento\RemoteStorage\Driver\DriverPool; use Magento\Framework\Filesystem\DriverPool as BaseDriverPool; @@ -94,28 +93,4 @@ public function getCache(): array { return (array)$this->config->get(DriverPool::PATH_CACHE, []); } - - /** - * Retrieves cache adapter. - * - * @return string - * @throws FileSystemException - * @throws RuntimeException - */ - public function getCacheAdapter(): string - { - return $this->getCache()['adapter'] ?? CacheFactory::ADAPTER_MEMORY; - } - - /** - * Retrieves cache config. - * - * @return array - * @throws FileSystemException - * @throws RuntimeException - */ - public function getCacheConfig(): array - { - return $this->getCache()['config'] ?? []; - } } diff --git a/app/code/Magento/RemoteStorage/Setup/ConfigOptionsList.php b/app/code/Magento/RemoteStorage/Setup/ConfigOptionsList.php index 693ee4551707..12c38b3e71eb 100644 --- a/app/code/Magento/RemoteStorage/Setup/ConfigOptionsList.php +++ b/app/code/Magento/RemoteStorage/Setup/ConfigOptionsList.php @@ -12,7 +12,6 @@ use Magento\Framework\Config\File\ConfigFilePool; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Filesystem\DriverPool; -use Magento\RemoteStorage\Driver\Cache\CacheFactory; use Magento\RemoteStorage\Driver\DriverFactoryPool; use Magento\RemoteStorage\Driver\DriverPool as RemoteDriverPool; use Magento\Framework\Setup\ConfigOptionsListInterface; @@ -164,9 +163,7 @@ public function validate(array $options, DeploymentConfig $deploymentConfig): ar try { $this->driverFactoryPool->get($driver)->createConfigured( (array)$configData->getData()['remote_storage']['config'], - (string)$options[self::OPTION_REMOTE_STORAGE_PREFIX], - CacheFactory::ADAPTER_MEMORY, - [] + (string)$options[self::OPTION_REMOTE_STORAGE_PREFIX] )->test(); } catch (LocalizedException $exception) { $message = $exception->getMessage(); diff --git a/app/code/Magento/RemoteStorage/composer.json b/app/code/Magento/RemoteStorage/composer.json index d5428b4fbe62..1b6b36136684 100644 --- a/app/code/Magento/RemoteStorage/composer.json +++ b/app/code/Magento/RemoteStorage/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "require": { "php": "~7.3.0||~7.4.0", - "magento/framework": "^100.0.2" + "magento/framework": "*" }, "suggest": { "magento/module-backend": "*", diff --git a/app/code/Magento/RemoteStorage/etc/di.xml b/app/code/Magento/RemoteStorage/etc/di.xml index d8ee5d609cb5..aa1447b84b2c 100644 --- a/app/code/Magento/RemoteStorage/etc/di.xml +++ b/app/code/Magento/RemoteStorage/etc/di.xml @@ -6,6 +6,10 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> + <preference for="Magento\RemoteStorage\Driver\Adapter\Cache\CacheInterface" type="Magento\RemoteStorage\Driver\Adapter\Cache\Generic"/> + <preference for="Magento\RemoteStorage\Driver\Adapter\CachedAdapterInterface" type="Magento\RemoteStorage\Driver\Adapter\CachedAdapter"/> + <preference for="Magento\RemoteStorage\Driver\Adapter\MetadataProviderInterface" type="Magento\RemoteStorage\Driver\Adapter\MetadataProvider"/> + <preference for="Magento\RemoteStorage\Driver\Adapter\MetadataProviderFactoryInterface" type="Magento\RemoteStorage\Driver\Adapter\MetadataProviderFactory"/> <virtualType name="remoteWriteFactory" type="Magento\Framework\Filesystem\Directory\WriteFactory"> <arguments> <argument name="driverPool" xsi:type="object">Magento\RemoteStorage\Driver\DriverPool</argument> @@ -33,11 +37,6 @@ <virtualType name="fullRemoteFilesystem" type="Magento\RemoteStorage\Filesystem" /> <virtualType name="stdFilesystem" type="Magento\Framework\Filesystem" /> <preference for="Magento\Framework\Filesystem" type="customRemoteFilesystem"/> - <type name="Magento\RemoteStorage\Driver\Cache\CacheFactory"> - <arguments> - <argument name="filesystem" xsi:type="object">stdFilesystem</argument> - </arguments> - </type> <type name="Magento\Framework\Filesystem\Directory\TargetDirectory"> <arguments> <argument name="filesystem" xsi:type="object">fullRemoteFilesystem</argument> diff --git a/app/code/Magento/Reports/Block/Adminhtml/Grid/AbstractGrid.php b/app/code/Magento/Reports/Block/Adminhtml/Grid/AbstractGrid.php index 2ff87237222f..160ddc8cfcd4 100644 --- a/app/code/Magento/Reports/Block/Adminhtml/Grid/AbstractGrid.php +++ b/app/code/Magento/Reports/Block/Adminhtml/Grid/AbstractGrid.php @@ -52,6 +52,11 @@ class AbstractGrid extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_resourceFactory; + /** + * @var string + */ + protected $_columnGroupBy; + /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper diff --git a/app/code/Magento/Reports/Model/Product/Index/Factory.php b/app/code/Magento/Reports/Model/Product/Index/Factory.php index a1498d8fe43c..443955349879 100644 --- a/app/code/Magento/Reports/Model/Product/Index/Factory.php +++ b/app/code/Magento/Reports/Model/Product/Index/Factory.php @@ -15,6 +15,11 @@ class Factory const TYPE_VIEWED = 'viewed'; + /** + * @var \Magento\Framework\ObjectManagerInterface + */ + private $_objectManager; + /** * @var array */ diff --git a/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php b/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php index ab76cad8da5c..48ee5f58499e 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php @@ -8,6 +8,7 @@ namespace Magento\Reports\Model\ResourceModel\Product; use Magento\Catalog\Model\ResourceModel\Product\Collection\ProductLimitationFactory; +use Magento\Framework\DataObject; /** * Products Report collection. @@ -64,6 +65,11 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection */ protected $quoteResource; + /** + * @var DataObject + */ + private $_totals; + /** * Collection constructor. * @@ -335,6 +341,7 @@ public function addViewsCount($from = '', $to = '') * Getting event type id for catalog_product_view event */ $eventTypes = $this->_eventTypeFactory->create()->getCollection(); + $productViewEvent = null; foreach ($eventTypes as $eventType) { if ($eventType->getEventName() == 'catalog_product_view') { $productViewEvent = (int)$eventType->getId(); diff --git a/app/code/Magento/Reports/Model/ResourceModel/Quote/Collection.php b/app/code/Magento/Reports/Model/ResourceModel/Quote/Collection.php index b69ea94aac9b..9312e8b87ec4 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Quote/Collection.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Quote/Collection.php @@ -144,24 +144,24 @@ public function addSubtotal($storeIds = '', $filter = null) $this->getSelect()->columns( ['subtotal' => '(main_table.base_subtotal_with_discount*main_table.base_to_global_rate)'] ); - $this->_joinedFields['subtotal'] = + $joinedFields['subtotal'] = '(main_table.base_subtotal_with_discount*main_table.base_to_global_rate)'; } else { $this->getSelect()->columns(['subtotal' => 'main_table.base_subtotal_with_discount']); - $this->_joinedFields['subtotal'] = 'main_table.base_subtotal_with_discount'; + $joinedFields['subtotal'] = 'main_table.base_subtotal_with_discount'; } if ($filter && is_array($filter) && isset($filter['subtotal'])) { if (isset($filter['subtotal']['from'])) { $this->getSelect()->where( - $this->_joinedFields['subtotal'] . ' >= ?', + $joinedFields['subtotal'] . ' >= ?', $filter['subtotal']['from'], \Zend_Db::FLOAT_TYPE ); } if (isset($filter['subtotal']['to'])) { $this->getSelect()->where( - $this->_joinedFields['subtotal'] . ' <= ?', + $joinedFields['subtotal'] . ' <= ?', $filter['subtotal']['to'], \Zend_Db::FLOAT_TYPE ); diff --git a/app/code/Magento/Reports/Model/ResourceModel/Report/AbstractReport.php b/app/code/Magento/Reports/Model/ResourceModel/Report/AbstractReport.php index e949589e59eb..4e0f9f71e4fc 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Report/AbstractReport.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Report/AbstractReport.php @@ -47,6 +47,11 @@ abstract class AbstractReport extends \Magento\Framework\Model\ResourceModel\Db\ */ protected $dateTime; + /** + * @var \Magento\Framework\Stdlib\DateTime\Timezone\Validator + */ + private $timezoneValidator; + /** * Constructor * diff --git a/app/code/Magento/Reports/Test/Mftf/ActionGroup/AdminGoToOrdersReportPageActionGroup.xml b/app/code/Magento/Reports/Test/Mftf/ActionGroup/AdminGoToOrdersReportPageActionGroup.xml new file mode 100644 index 000000000000..b8f117a0de4b --- /dev/null +++ b/app/code/Magento/Reports/Test/Mftf/ActionGroup/AdminGoToOrdersReportPageActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminGoToOrdersReportPageActionGroup"> + <annotations> + <description>Redirects to the Orders Report page</description> + </annotations> + + <amOnPage url="{{OrdersReportPage.url}}" stepKey="goToOrdersReportPage"/> + <waitForPageLoad stepKey="waitForOrdersReportPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminCanceledOrdersInOrderSalesReportTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminCanceledOrdersInOrderSalesReportTest.xml new file mode 100644 index 000000000000..e56d2b5bcbe6 --- /dev/null +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminCanceledOrdersInOrderSalesReportTest.xml @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCanceledOrdersInOrderSalesReportTest"> + <annotations> + <features value="Reports"/> + <stories value="Order Sales Report includes canceled orders"/> + <group value="reports"/> + <title value="Canceled orders in order sales report"/> + <description value="Verify canceling of orders in order sales report"/> + <severity value="MAJOR"/> + <testCaseId value="MAGETWO-95960"/> + <useCaseId value="MAGETWO-95823"/> + </annotations> + + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + + <createData entity="CustomerCart" stepKey="createCustomerCartOne"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItemOne"> + <requiredEntity createDataKey="createCustomerCartOne"/> + <requiredEntity createDataKey="createSimpleProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCartOne"/> + </createData> + <updateData createDataKey="createCustomerCartOne" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformationOne"> + <requiredEntity createDataKey="createCustomerCartOne"/> + </updateData> + <createData entity="Invoice" stepKey="invoiceOrderOne"> + <requiredEntity createDataKey="createCustomerCartOne"/> + </createData> + <createData entity="Shipment" stepKey="shipOrderOne"> + <requiredEntity createDataKey="createCustomerCartOne"/> + </createData> + + <createData entity="CustomerCart" stepKey="createCustomerCartTwo"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItemTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + <requiredEntity createDataKey="createSimpleProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddressTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </createData> + <updateData createDataKey="createCustomerCartTwo" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformationTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </updateData> + <createData entity="CancelOrder" stepKey="cancelOrderTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </createData> + </before> + + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="AdminGoToOrdersReportPageActionGroup" stepKey="goToOrdersReportPage1"/> + <generateDate stepKey="generateEndDate" date="+0 day" format="m/d/Y"/> + <generateDate stepKey="generateStartDate" date="-1 day" format="m/d/Y"/> + <actionGroup ref="GenerateOrderReportForNotCancelActionGroup" stepKey="generateReportAfterCancelOrderBefore"> + <argument name="orderFromDate" value="$generateStartDate"/> + <argument name="orderToDate" value="$generateEndDate"/> + <argument name="statuses" value="['closed', 'complete', 'fraud', 'holded', 'payment_review', 'paypal_canceled_reversal', 'paypal_reversed', 'processing']"/> + </actionGroup> + <waitForElement selector="{{GeneratedReportSection.ordersCount}}" stepKey="waitForOrdersCountBefore"/> + <grabTextFrom selector="{{GeneratedReportSection.ordersCount}}" stepKey="grabCanceledOrdersSpecified"/> + + <actionGroup ref="AdminGoToOrdersReportPageActionGroup" stepKey="goToOrdersReportPage2"/> + <actionGroup ref="GenerateOrderReportActionGroup" stepKey="generateReportAfterCancelOrder"> + <argument name="orderFromDate" value="$generateStartDate"/> + <argument name="orderToDate" value="$generateEndDate"/> + </actionGroup> + <waitForElement selector="{{GeneratedReportSection.ordersCount}}" stepKey="waitForOrdersCount"/> + <grabTextFrom selector="{{GeneratedReportSection.ordersCount}}" stepKey="grabCanceledOrdersAny"/> + + <assertEquals stepKey="assertEquals"> + <actualResult type="string">{$grabCanceledOrdersAny}</actualResult> + <expectedResult type="string">{$grabCanceledOrdersSpecified}</expectedResult> + </assertEquals> + </test> +</tests> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderedGroupedBySkuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderedGroupedBySkuTest.xml index beb1471bd6c4..c38307790589 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderedGroupedBySkuTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderedGroupedBySkuTest.xml @@ -30,6 +30,16 @@ <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="AdminDeleteProductAttributeByLabelActionGroup" stepKey="deleteAttributeSet"> <argument name="productAttributeLabel" value="{{colorProductAttribute.default_label}}"/> </actionGroup> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml index 6e9e8e800e07..54d3059f2453 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml @@ -7,16 +7,19 @@ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="CancelOrdersInOrderSalesReportTest"> + <test name="CancelOrdersInOrderSalesReportTest" deprecated="Use AdminCanceledOrdersInOrderSalesReportTest instead"> <annotations> <features value="Reports"/> <stories value="Order Sales Report includes canceled orders"/> <group value="reports"/> - <title value="Canceled orders in order sales report"/> + <title value="DEPRECATED. Canceled orders in order sales report"/> <description value="Verify canceling of orders in order sales report"/> <severity value="MAJOR"/> <testCaseId value="MAGETWO-95960"/> <useCaseId value="MAGETWO-95823"/> + <skip> + <issueId value="DEPRECATED">Use AdminCanceledOrdersInOrderSalesReportTest instead</issueId> + </skip> </annotations> <before> diff --git a/app/code/Magento/Reports/view/frontend/templates/product/widget/viewed/item.phtml b/app/code/Magento/Reports/view/frontend/templates/product/widget/viewed/item.phtml index 562c9a2b63a9..da11582a1613 100644 --- a/app/code/Magento/Reports/view/frontend/templates/product/widget/viewed/item.phtml +++ b/app/code/Magento/Reports/view/frontend/templates/product/widget/viewed/item.phtml @@ -60,7 +60,7 @@ $rating = 'short'; </button> <?php endif; ?> <?php else : ?> - <?php if ($item->getIsSalable()) : ?> + <?php if ($item->isAvailable()) : ?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> <?php else : ?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> diff --git a/app/code/Magento/Reports/view/frontend/templates/widget/compared/column/compared_default_list.phtml b/app/code/Magento/Reports/view/frontend/templates/widget/compared/column/compared_default_list.phtml index a54259280e38..a9d5718449cd 100644 --- a/app/code/Magento/Reports/view/frontend/templates/widget/compared/column/compared_default_list.phtml +++ b/app/code/Magento/Reports/view/frontend/templates/widget/compared/column/compared_default_list.phtml @@ -78,7 +78,7 @@ if ($exist = $block->getRecentlyComparedProducts()) { <?php endif; ?> </div> <?php else : ?> - <?php if ($_product->getIsSalable()) : ?> + <?php if ($_product->isAvailable()) : ?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> <?php else : ?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> diff --git a/app/code/Magento/Reports/view/frontend/templates/widget/compared/content/compared_grid.phtml b/app/code/Magento/Reports/view/frontend/templates/widget/compared/content/compared_grid.phtml index ad6b33820c75..122249006518 100644 --- a/app/code/Magento/Reports/view/frontend/templates/widget/compared/content/compared_grid.phtml +++ b/app/code/Magento/Reports/view/frontend/templates/widget/compared/content/compared_grid.phtml @@ -83,7 +83,7 @@ if ($exist = $block->getRecentlyComparedProducts()) { </button> <?php endif; ?> <?php else : ?> - <?php if ($_item->getIsSalable()) : ?> + <?php if ($_item->isAvailable()) : ?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> <?php else : ?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> diff --git a/app/code/Magento/Reports/view/frontend/templates/widget/compared/content/compared_list.phtml b/app/code/Magento/Reports/view/frontend/templates/widget/compared/content/compared_list.phtml index ba7a50eef648..6f7b4f4f66f2 100644 --- a/app/code/Magento/Reports/view/frontend/templates/widget/compared/content/compared_list.phtml +++ b/app/code/Magento/Reports/view/frontend/templates/widget/compared/content/compared_list.phtml @@ -84,7 +84,7 @@ if ($exist = $block->getRecentlyComparedProducts()) { </button> <?php endif; ?> <?php else : ?> - <?php if ($_item->getIsSalable()) : ?> + <?php if ($_item->isAvailable()) : ?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> <?php else : ?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> diff --git a/app/code/Magento/Reports/view/frontend/templates/widget/viewed/column/viewed_default_list.phtml b/app/code/Magento/Reports/view/frontend/templates/widget/viewed/column/viewed_default_list.phtml index 16fc2b070b95..3e5cd15bbc62 100644 --- a/app/code/Magento/Reports/view/frontend/templates/widget/viewed/column/viewed_default_list.phtml +++ b/app/code/Magento/Reports/view/frontend/templates/widget/viewed/column/viewed_default_list.phtml @@ -81,7 +81,7 @@ if ($exist = ($block->getRecentlyViewedProducts() && $block->getRecentlyViewedPr <?php endif; ?> </div> <?php else : ?> - <?php if ($_product->getIsSalable()) : ?> + <?php if ($_product->isAvailable()) : ?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> <?php else : ?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> diff --git a/app/code/Magento/Reports/view/frontend/templates/widget/viewed/content/viewed_grid.phtml b/app/code/Magento/Reports/view/frontend/templates/widget/viewed/content/viewed_grid.phtml index 567c3ebc57f9..c2f98e72909d 100644 --- a/app/code/Magento/Reports/view/frontend/templates/widget/viewed/content/viewed_grid.phtml +++ b/app/code/Magento/Reports/view/frontend/templates/widget/viewed/content/viewed_grid.phtml @@ -86,7 +86,7 @@ if ($exist = ($block->getRecentlyViewedProducts() && $block->getRecentlyViewedPr </button> <?php endif; ?> <?php else : ?> - <?php if ($_item->getIsSalable()) : ?> + <?php if ($_item->isAvailable()) : ?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> <?php else : ?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> diff --git a/app/code/Magento/Reports/view/frontend/templates/widget/viewed/content/viewed_list.phtml b/app/code/Magento/Reports/view/frontend/templates/widget/viewed/content/viewed_list.phtml index 9a8bb9c3b734..32cf0bc69d1e 100644 --- a/app/code/Magento/Reports/view/frontend/templates/widget/viewed/content/viewed_list.phtml +++ b/app/code/Magento/Reports/view/frontend/templates/widget/viewed/content/viewed_list.phtml @@ -88,7 +88,7 @@ if ($exist = ($block->getRecentlyViewedProducts() && $block->getRecentlyViewedPr </button> <?php endif; ?> <?php else : ?> - <?php if ($_item->getIsSalable()) : ?> + <?php if ($_item->isAvailable()) : ?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> <?php else : ?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> diff --git a/app/code/Magento/Review/Block/Adminhtml/Edit/Form.php b/app/code/Magento/Review/Block/Adminhtml/Edit/Form.php index 346d5b60aad1..b8514383d975 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Edit/Form.php +++ b/app/code/Magento/Review/Block/Adminhtml/Edit/Form.php @@ -187,15 +187,14 @@ protected function _prepareForm() \Magento\Backend\Block\Store\Switcher\Form\Renderer\Fieldset\Element::class ); $field->setRenderer($renderer); - $review->setSelectStores($review->getStores()); } else { $fieldset->addField( 'select_stores', 'hidden', - ['name' => 'stores[]', 'value' => $this->_storeManager->getStore(true)->getId()] + ['name' => 'stores[]', 'value' => $review->getStores()] ); - $review->setSelectStores($this->_storeManager->getStore(true)->getId()); } + $review->setSelectStores($review->getStores()); $fieldset->addField( 'nickname', diff --git a/app/code/Magento/Review/Block/Product/ReviewRenderer.php b/app/code/Magento/Review/Block/Product/ReviewRenderer.php index 0fd6327e1f77..7a881efa088d 100644 --- a/app/code/Magento/Review/Block/Product/ReviewRenderer.php +++ b/app/code/Magento/Review/Block/Product/ReviewRenderer.php @@ -1,7 +1,5 @@ <?php /** - * Review renderer - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ @@ -11,13 +9,21 @@ use Magento\Catalog\Block\Product\ReviewRendererInterface; use Magento\Catalog\Model\Product; use Magento\Framework\App\ObjectManager; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\View\Element\Template; +use Magento\Framework\View\Element\Template\Context; +use Magento\Review\Model\AppendSummaryDataFactory; +use Magento\Review\Model\Review; +use Magento\Review\Model\ReviewFactory; use Magento\Review\Model\ReviewSummaryFactory; use Magento\Review\Observer\PredispatchReviewObserver; +use Magento\Store\Model\ScopeInterface; /** - * Class ReviewRenderer + * Review renderer */ -class ReviewRenderer extends \Magento\Framework\View\Element\Template implements ReviewRendererInterface +class ReviewRenderer extends Template implements ReviewRendererInterface { /** * Array of available template name @@ -32,7 +38,7 @@ class ReviewRenderer extends \Magento\Framework\View\Element\Template implements /** * Review model factory * - * @var \Magento\Review\Model\ReviewFactory + * @var ReviewFactory */ protected $_reviewFactory; @@ -42,20 +48,29 @@ class ReviewRenderer extends \Magento\Framework\View\Element\Template implements private $reviewSummaryFactory; /** - * @param \Magento\Framework\View\Element\Template\Context $context - * @param \Magento\Review\Model\ReviewFactory $reviewFactory + * @var AppendSummaryDataFactory + */ + private $appendSummaryDataFactory; + + /** + * @param Context $context + * @param ReviewFactory $reviewFactory * @param array $data - * @param ReviewSummaryFactory $reviewSummaryFactory + * @param ReviewSummaryFactory|null $reviewSummaryFactory + * @param AppendSummaryDataFactory|null $appendSummaryDataFactory */ public function __construct( - \Magento\Framework\View\Element\Template\Context $context, - \Magento\Review\Model\ReviewFactory $reviewFactory, + Context $context, + ReviewFactory $reviewFactory, array $data = [], - ReviewSummaryFactory $reviewSummaryFactory = null + ReviewSummaryFactory $reviewSummaryFactory = null, + AppendSummaryDataFactory $appendSummaryDataFactory = null ) { $this->_reviewFactory = $reviewFactory; $this->reviewSummaryFactory = $reviewSummaryFactory ?? ObjectManager::getInstance()->get(ReviewSummaryFactory::class); + $this->appendSummaryDataFactory = $appendSummaryDataFactory ?? + ObjectManager::getInstance()->get(AppendSummaryDataFactory::class); parent::__construct($context, $data); } @@ -68,7 +83,7 @@ public function isReviewEnabled(): string { return $this->_scopeConfig->getValue( PredispatchReviewObserver::XML_PATH_REVIEW_ACTIVE, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE + ScopeInterface::SCOPE_STORE ); } @@ -80,19 +95,21 @@ public function isReviewEnabled(): string * @param bool $displayIfNoReviews * * @return string - * @throws \Magento\Framework\Exception\LocalizedException - * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws LocalizedException + * @throws NoSuchEntityException */ public function getReviewsSummaryHtml( - \Magento\Catalog\Model\Product $product, + Product $product, $templateType = self::DEFAULT_VIEW, $displayIfNoReviews = false ) { if ($product->getRatingSummary() === null) { - $this->reviewSummaryFactory->create()->appendSummaryDataToObject( - $product, - $this->_storeManager->getStore()->getId() - ); + $this->appendSummaryDataFactory->create() + ->execute( + $product, + $this->_storeManager->getStore()->getId(), + Review::ENTITY_PRODUCT_CODE + ); } if (null === $product->getRatingSummary() && !$displayIfNoReviews) { diff --git a/app/code/Magento/Review/Model/AppendSummaryData.php b/app/code/Magento/Review/Model/AppendSummaryData.php new file mode 100644 index 000000000000..e5329dedc840 --- /dev/null +++ b/app/code/Magento/Review/Model/AppendSummaryData.php @@ -0,0 +1,61 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Review\Model; + +use Magento\Framework\Model\AbstractModel; +use Magento\Review\Model\ResourceModel\Review\Summary\CollectionFactory as SummaryCollectionFactory; + +/** + * Add review summary data to object by its entity code + */ +class AppendSummaryData +{ + /** + * @var SummaryCollectionFactory + */ + private $summaryCollectionFactory; + + /** + * @param SummaryCollectionFactory $summaryCollectionFactory + */ + public function __construct( + SummaryCollectionFactory $summaryCollectionFactory + ) { + $this->summaryCollectionFactory = $summaryCollectionFactory; + } + + /** + * Append summary data to object filtered by its entity code + * + * @param AbstractModel $object + * @param int $storeId + * @param string $entityCode + * @retrun void + */ + public function execute(AbstractModel $object, int $storeId, string $entityCode): void + { + $summaryCollection = $this->summaryCollectionFactory->create(); + $summaryCollection->addStoreFilter($storeId); + $summaryCollection->getSelect() + ->joinLeft( + ['review_entity' => $summaryCollection->getResource()->getTable('review_entity')], + 'main_table.entity_type = review_entity.entity_id', + 'entity_code' + ) + ->where('entity_pk_value = ?', $object->getId()) + ->where('entity_code = ?', $entityCode); + $summaryItem = $summaryCollection->getFirstItem(); + + $object->addData( + [ + 'reviews_count' => $summaryItem->getData('reviews_count'), + 'rating_summary' => $summaryItem->getData('rating_summary'), + ] + ); + } +} diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating.php b/app/code/Magento/Review/Model/ResourceModel/Rating.php index 37a93d40b110..81f732f1b9ea 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating.php @@ -43,6 +43,11 @@ class Rating extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb */ private $scopeConfig; + /** + * @var Review\Summary + */ + private $_reviewSummary; + /** * @param \Magento\Framework\Model\ResourceModel\Db\Context $context * @param \Psr\Log\LoggerInterface $logger diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating/Option.php b/app/code/Magento/Review/Model/ResourceModel/Rating/Option.php index ef4acb6c90cb..af3137e6427e 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating/Option.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating/Option.php @@ -79,6 +79,11 @@ class Option extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb */ protected $_ratingOptionVoteF; + /** + * @var \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress + */ + private $_remoteAddress; + /** * @param \Magento\Framework\Model\ResourceModel\Db\Context $context * @param \Magento\Customer\Model\Session $customerSession diff --git a/app/code/Magento/Review/Model/ReviewSummary.php b/app/code/Magento/Review/Model/ReviewSummary.php index 46851339ae6d..a66dc73b3529 100644 --- a/app/code/Magento/Review/Model/ReviewSummary.php +++ b/app/code/Magento/Review/Model/ReviewSummary.php @@ -12,6 +12,9 @@ /** * ReviewSummary model. + * + * @deprecated Filtering collection by entity_type ID leads to wrong result if AUTO_INCREMENT begins not form 1. + * @see \Magento\Review\Model\AppendSummaryData */ class ReviewSummary { diff --git a/app/code/Magento/Review/Test/Mftf/ActionGroup/AssertStorefrontReviewAtProductReviewPageActionGroup.xml b/app/code/Magento/Review/Test/Mftf/ActionGroup/AssertStorefrontReviewAtProductReviewPageActionGroup.xml new file mode 100644 index 000000000000..0c567101fe35 --- /dev/null +++ b/app/code/Magento/Review/Test/Mftf/ActionGroup/AssertStorefrontReviewAtProductReviewPageActionGroup.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontReviewAtProductReviewPageActionGroup"> + <arguments> + <argument name="description" type="string" defaultValue="simpleProductReview"/> + </arguments> + <see selector="{{StorefrontMyProductReviewsSection.reviewDescription}}" userInput="{{description}}" stepKey="seeReviewDescription"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Review/Test/Mftf/Section/StorefrontMyProductReviewsSection.xml b/app/code/Magento/Review/Test/Mftf/Section/StorefrontMyProductReviewsSection.xml new file mode 100644 index 000000000000..e83c913039f7 --- /dev/null +++ b/app/code/Magento/Review/Test/Mftf/Section/StorefrontMyProductReviewsSection.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontMyProductReviewsSection"> + <element name="reviewDescription" type="text" selector="//td[@data-th='Review']"/> + </section> +</sections> diff --git a/app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml b/app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml index 3405314f24f7..8b75a0f60854 100644 --- a/app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml +++ b/app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml @@ -17,6 +17,9 @@ <severity value="MAJOR"/> <useCaseId value="MC-39737"/> <testCaseId value="MC-39838"/> + <skip> + <issueId value="MQE-2288" /> + </skip> </annotations> <before> <!--Step1. Login as admin--> diff --git a/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml b/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml index 81f5db6d2fd1..86f4a717f01a 100644 --- a/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml +++ b/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml @@ -42,7 +42,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="goToProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/> <dontSeeElement selector="{{StorefrontProductInfoDetailsSection.productNameForReview}}" stepKey="dontSeeReviewTab"/> <click selector="{{StorefrontProductInfoMainSection.addReviewLink}}" stepKey="clickAddReview"/> <dontSeeJsError stepKey="dontSeeJsError"/> diff --git a/app/code/Magento/Review/Test/Mftf/Test/StorefrontVerifyProductReviewInCustomerAccountTest.xml b/app/code/Magento/Review/Test/Mftf/Test/StorefrontVerifyProductReviewInCustomerAccountTest.xml new file mode 100644 index 000000000000..c581fd2757ad --- /dev/null +++ b/app/code/Magento/Review/Test/Mftf/Test/StorefrontVerifyProductReviewInCustomerAccountTest.xml @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontVerifyProductReviewInCustomerAccountTest"> + <annotations> + <features value="Review"/> + <stories value="Product Review"/> + <title value="Product Review is Available in Customer's Account"/> + <description value="Customer should be able see product review on My Product Reviews page in Customer account"/> + <severity value="MINOR"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + <createData stepKey="category" entity="SimpleSubCategory"/> + <createData stepKey="createProduct1" entity="SimpleProduct"> + <requiredEntity createDataKey="category"/> + </createData> + <createData stepKey="createProduct2" entity="SimpleProduct"> + <requiredEntity createDataKey="category"/> + </createData> + </before> + <after> + <actionGroup ref="AdminOpenReviewsPageActionGroup" stepKey="openAllReviewsPage"/> + <actionGroup ref="AdminDeleteReviewsByUserNicknameActionGroup" stepKey="deleteCustomerReview"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearNickNameReviewFilters"/> + <actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer"> + <argument name="customerEmail" value="CustomerEntityOne.email"/> + </actionGroup> + <deleteData createDataKey="createProduct1" stepKey="deleteProduct1"/> + <deleteData createDataKey="createProduct2" stepKey="deleteProduct2"/> + <deleteData createDataKey="category" stepKey="deleteCategory"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <actionGroup ref="SignUpNewUserFromStorefrontActionGroup" stepKey="signUpNewUser"> + <argument name="Customer" value="CustomerEntityOne"/> + </actionGroup> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> + <argument name="productUrl" value="$$createProduct1.custom_attributes[url_key]$$"/> + </actionGroup> + <actionGroup ref="StorefrontAddProductReviewActionGroup" stepKey="addReview"/> + <actionGroup ref="AdminOpenPendingReviewsPageActionGroup" stepKey="openReviewsPage"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilters"/> + <actionGroup ref="AdminOpenReviewByUserNicknameActionGroup" stepKey="openFirstCustomerReviews"/> + <actionGroup ref="AdminChangeReviewStatusActionGroup" stepKey="changeFirstReviewStatus"/> + <actionGroup ref="AdminSaveReviewActionGroup" stepKey="saveModeratedFirstReview"/> + <actionGroup ref="StorefrontNavigateToMyProductReviewsPageActionGroup" stepKey="navigateToProductReviewsPage"/> + <actionGroup ref="AssertStorefrontReviewAtProductReviewPageActionGroup" stepKey="assertReviewInCustomerAccount"> + <argument name="description" value="{{simpleProductReview.detail}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Review/Test/Unit/Model/AppendSummaryDataTest.php b/app/code/Magento/Review/Test/Unit/Model/AppendSummaryDataTest.php new file mode 100644 index 000000000000..0d624cad551c --- /dev/null +++ b/app/code/Magento/Review/Test/Unit/Model/AppendSummaryDataTest.php @@ -0,0 +1,170 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Review\Test\Unit\Model; + +use Magento\Catalog\Model\Product; +use Magento\Framework\DB\Select; +use Magento\Review\Model\AppendSummaryData; +use Magento\Review\Model\ResourceModel\Review\Summary as ResourceSummary; +use Magento\Review\Model\ResourceModel\Review\Summary\Collection as SummaryCollection; +use Magento\Review\Model\ResourceModel\Review\Summary\CollectionFactory as SummaryCollectionFactory; +use Magento\Review\Model\Review\Summary; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Unit tests for \Magento\Review\Model\AppendSummaryData class + */ +class AppendSummaryDataTest extends TestCase +{ + /** + * @var SummaryCollectionFactory|MockObject + */ + private $summaryCollectionFactoryMock; + + /** + * @var Product|MockObject + */ + private $productMock; + + /** + * @var Summary|MockObject + */ + private $summaryMock; + + /** + * @var SummaryCollection|MockObject + */ + private $summaryCollectionMock; + + /** + * @var Select|MockObject + */ + private $selectMock; + + /** + * @var ResourceSummary|MockObject + */ + private $resourceSummaryMock; + + /** + * @var AppendSummaryData + */ + private $model; + + /** + * @inheriDoc + */ + protected function setUp(): void + { + $this->summaryCollectionFactoryMock = $this->getMockBuilder(SummaryCollectionFactory::class) + ->disableOriginalConstructor() + ->onlyMethods(['create']) + ->getMock(); + + $this->productMock = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->onlyMethods(['getId', 'addData']) + ->getMock(); + + $this->summaryMock = $this->getMockBuilder(Summary::class) + ->disableOriginalConstructor() + ->onlyMethods(['getData']) + ->getMock(); + + $this->summaryCollectionMock = $this->getMockBuilder(SummaryCollection::class) + ->disableOriginalConstructor() + ->onlyMethods( + [ + 'addStoreFilter', + 'getSelect', + 'getResource', + 'getFirstItem', + ] + ) + ->getMock(); + + $this->selectMock = $this->getMockBuilder(Select::class) + ->disableOriginalConstructor() + ->onlyMethods(['joinLeft', 'where']) + ->getMock(); + + $this->resourceSummaryMock = $this->getMockBuilder(ResourceSummary::class) + ->disableOriginalConstructor() + ->onlyMethods(['getTable']) + ->getMock(); + + $this->model = new AppendSummaryData( + $this->summaryCollectionFactoryMock + ); + } + + /** + * @return void + */ + public function testExecute(): void + { + $productId = 6; + $storeId = 4; + $entityCode = 'product'; + $summaryData = [ + 'reviews_count' => 2, + 'rating_summary' => 80, + ]; + + $this->productMock->expects($this->once()) + ->method('getId') + ->willReturn($productId); + + $this->productMock->expects($this->once()) + ->method('addData') + ->with($summaryData) + ->willReturnSelf(); + + $this->summaryMock->expects($this->exactly(2)) + ->method('getData') + ->willReturnMap( + [ + ['reviews_count', null, $summaryData['reviews_count']], + ['rating_summary', null, $summaryData['rating_summary']], + ] + ); + + $this->summaryCollectionMock->expects($this->once()) + ->method('addStoreFilter') + ->with($storeId) + ->willReturnSelf(); + $this->summaryCollectionMock->expects($this->once()) + ->method('getSelect') + ->willReturn($this->selectMock); + $this->summaryCollectionMock->expects($this->once()) + ->method('getResource') + ->willReturn($this->resourceSummaryMock); + + $this->resourceSummaryMock->expects($this->once()) + ->method('getTable') + ->willReturn('table_name'); + + $this->summaryCollectionMock->expects($this->once()) + ->method('getFirstItem') + ->willReturn($this->summaryMock); + + $this->selectMock->expects($this->once()) + ->method('joinLeft') + ->willReturnSelf(); + $this->selectMock->expects($this->exactly(2)) + ->method('where') + ->willReturnSelf(); + + $this->summaryCollectionFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($this->summaryCollectionMock); + + $this->model->execute($this->productMock, $storeId, $entityCode); + } +} diff --git a/app/code/Magento/Review/view/frontend/templates/customer/list.phtml b/app/code/Magento/Review/view/frontend/templates/customer/list.phtml index 6dd7aa575e9d..d44dc203dab8 100644 --- a/app/code/Magento/Review/view/frontend/templates/customer/list.phtml +++ b/app/code/Magento/Review/view/frontend/templates/customer/list.phtml @@ -6,6 +6,7 @@ /** * @var \Magento\Review\Block\Customer\ListCustomer $block + * @var \Magento\Framework\Escaper $escaper * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ @@ -15,36 +16,36 @@ $reviewHelper = $block->getData('reviewHelper'); <?php if ($block->getReviews() && count($block->getReviews())): ?> <div class="table-wrapper reviews"> <table class="data table table-reviews" id="my-reviews-table"> - <caption class="table-caption"><?= $block->escapeHtml(__('Product Reviews')) ?></caption> + <caption class="table-caption"><?= $escaper->escapeHtml(__('Product Reviews')) ?></caption> <thead> <tr> - <th scope="col" class="col date"><?= $block->escapeHtml(__('Created')) ?></th> - <th scope="col" class="col item"><?= $block->escapeHtml(__('Product Name')) ?></th> - <th scope="col" class="col summary"><?= $block->escapeHtml(__('Rating')) ?></th> - <th scope="col" class="col description"><?= $block->escapeHtml(__('Review')) ?></th> + <th scope="col" class="col date"><?= $escaper->escapeHtml(__('Created')) ?></th> + <th scope="col" class="col item"><?= $escaper->escapeHtml(__('Product Name')) ?></th> + <th scope="col" class="col summary"><?= $escaper->escapeHtml(__('Rating')) ?></th> + <th scope="col" class="col description"><?= $escaper->escapeHtml(__('Review')) ?></th> <th scope="col" class="col actions"> </th> </tr> </thead> <tbody> <?php foreach ($block->getReviews() as $review): ?> <tr> - <td data-th="<?= $block->escapeHtml(__('Created')) ?>" - class="col date"><?= $block->escapeHtml($block->dateFormat($review->getReviewCreatedAt())) ?> + <td data-th="<?= $escaper->escapeHtml(__('Created')) ?>" + class="col date"><?= $escaper->escapeHtml($block->dateFormat($review->getReviewCreatedAt())) ?> </td> - <td data-th="<?= $block->escapeHtml(__('Product Name')) ?>" class="col item"> + <td data-th="<?= $escaper->escapeHtml(__('Product Name')) ?>" class="col item"> <strong class="product-name"> - <a href="<?= $block->escapeUrl($block->getProductUrl($review)) ?>"> - <?= $block->escapeHtml($review->getName()) ?> + <a href="<?= $escaper->escapeUrl($block->getProductUrl($review)) ?>"> + <?= $escaper->escapeHtml($review->getName()) ?> </a> </strong> </td> - <td data-th="<?= $block->escapeHtml(__('Rating')) ?>" class="col summary"> + <td data-th="<?= $escaper->escapeHtml(__('Rating')) ?>" class="col summary"> <?php if ($review->getSum()): ?> <div class="rating-summary"> - <span class="label"><span><?= $block->escapeHtml(__('Rating')) ?>:</span></span> + <span class="label"><span><?= $escaper->escapeHtml(__('Rating')) ?>:</span></span> <div class="rating-result" title="<?= /* @noEscape */ ((int)$review->getSum() / (int)$review->getCount()) ?>%"> - <span> + <span class="rating_<?= $escaper->escapeUrl($review->getReviewId())?>"> <span> <?= /* @noEscape */ ((int)$review->getSum() / (int)$review->getCount()) ?>% </span> @@ -53,16 +54,16 @@ $reviewHelper = $block->getData('reviewHelper'); </div> <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( "width:" . /* @noEscape */ ((int)$review->getSum() / (int)$review->getCount()) . "%;", - 'div.rating-summary div.rating-result>span:first-child' + 'div.rating-summary div.rating-result>span.rating_' . $escaper->escapeUrl($review->getReviewId()) ) ?> <?php endif; ?> </td> - <td data-th="<?= $block->escapeHtmlAttr(__('Review')) ?>" class="col description"> + <td data-th="<?= $escaper->escapeHtmlAttr(__('Review')) ?>" class="col description"> <?= $reviewHelper->getDetailHtml($review->getDetail()) ?> </td> - <td data-th="<?= $block->escapeHtmlAttr(__('Actions')) ?>" class="col actions"> - <a href="<?= $block->escapeUrl($block->getReviewUrl($review)) ?>" class="action more"> - <span><?= $block->escapeHtml(__('See Details')) ?></span> + <td data-th="<?= $escaper->escapeHtmlAttr(__('Actions')) ?>" class="col actions"> + <a href="<?= $escaper->escapeUrl($block->getReviewUrl($review)) ?>" class="action more"> + <span><?= $escaper->escapeHtml(__('See Details')) ?></span> </a> </td> </tr> @@ -76,12 +77,12 @@ $reviewHelper = $block->getData('reviewHelper'); </div> <?php endif; ?> <?php else: ?> - <div class="message info empty"><span><?= $block->escapeHtml(__('You have submitted no reviews.')) ?></span></div> + <div class="message info empty"><span><?= $escaper->escapeHtml(__('You have submitted no reviews.')) ?></span></div> <?php endif; ?> <div class="actions-toolbar"> <div class="secondary"> - <a class="action back" href="<?= $block->escapeUrl($block->getBackUrl()) ?>"> - <span><?= $block->escapeHtml(__('Back')) ?></span> + <a class="action back" href="<?= $escaper->escapeUrl($block->getBackUrl()) ?>"> + <span><?= $escaper->escapeHtml(__('Back')) ?></span> </a> </div> </div> diff --git a/app/code/Magento/Review/view/frontend/templates/customer/recent.phtml b/app/code/Magento/Review/view/frontend/templates/customer/recent.phtml index cf7d53e818c3..7a5f56153f16 100644 --- a/app/code/Magento/Review/view/frontend/templates/customer/recent.phtml +++ b/app/code/Magento/Review/view/frontend/templates/customer/recent.phtml @@ -6,15 +6,16 @@ /** * @var \Magento\Review\Block\Customer\Recent $block + * @var \Magento\Framework\Escaper $escaper * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> <?php if ($block->getReviews() && count($block->getReviews())): ?> <div class="block block-reviews-dashboard"> <div class="block-title"> - <strong><?= $block->escapeHtml(__('My Recent Reviews')) ?></strong> - <a class="action view" href="<?= $block->escapeUrl($block->getAllReviewsUrl()) ?>"> - <span><?= $block->escapeHtml(__('View All')) ?></span> + <strong><?= $escaper->escapeHtml(__('My Recent Reviews')) ?></strong> + <a class="action view" href="<?= $escaper->escapeUrl($block->getAllReviewsUrl()) ?>"> + <span><?= $escaper->escapeHtml(__('View All')) ?></span> </a> </div> <div class="block-content"> @@ -22,22 +23,22 @@ <?php foreach ($block->getReviews() as $_review): ?> <li class="item"> <strong class="product-name"> - <a href="<?= $block->escapeUrl($block->getReviewUrl($_review->getReviewId())) ?>"> - <?= $block->escapeHtml($_review->getName()) ?> + <a href="<?= $escaper->escapeUrl($block->getReviewUrl($_review->getReviewId())) ?>"> + <?= $escaper->escapeHtml($_review->getName()) ?> </a> </strong> <?php if ($_review->getSum()): ?> <?php $rating = $_review->getSum() / $_review->getCount() ?> <div class="rating-summary"> - <span class="label"><span><?= $block->escapeHtml(__('Rating')) ?>:</span></span> - <div class="rating-result" title="<?= $block->escapeHtmlAttr($rating) ?>%"> - <span> - <span><?= $block->escapeHtml($rating) ?>%</span> + <span class="label"><span><?= $escaper->escapeHtml(__('Rating')) ?>:</span></span> + <div class="rating-result" title="<?= $escaper->escapeHtmlAttr($rating) ?>%"> + <span class="rating_<?= $escaper->escapeUrl($_review->getReviewId())?>"> + <span><?= $escaper->escapeHtml($rating) ?>%</span> </span> </div> <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( - "width:". $block->escapeHtmlAttr($rating) . "%", - 'div.rating-result>span:first-child' + "width:". $escaper->escapeHtmlAttr($rating) . "%", + 'div.rating-result>span.rating_' . $escaper->escapeUrl($_review->getReviewId()) ) ?> </div> <?php endif; ?> diff --git a/app/code/Magento/Review/view/frontend/templates/customer/view.phtml b/app/code/Magento/Review/view/frontend/templates/customer/view.phtml index 862a9a466414..d1d9d3b7ccae 100644 --- a/app/code/Magento/Review/view/frontend/templates/customer/view.phtml +++ b/app/code/Magento/Review/view/frontend/templates/customer/view.phtml @@ -38,18 +38,22 @@ $product = $block->getProductData(); <?php foreach ($block->getRating() as $_rating): ?> <?php if ($_rating->getPercent()): ?> <?php $rating = ceil($_rating->getPercent()) ?> + <?php $ratingId = $_rating->getRatingId() ?> <div class="rating-summary item"> <span class="rating-label"> <span><?= $block->escapeHtml($_rating->getRatingCode()) ?></span> </span> - <div class="rating-result" title="<?= /* @noEscape */ $rating ?>%"> + <div class="rating-result" + id="rating-div-<?= $block->escapeHtml($ratingId) ?>" + title="<?= /* @noEscape */ $rating ?>%"> <span> <span><?= /* @noEscape */ $rating ?>%</span> </span> </div> <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( "width:" . /* @noEscape */ $rating . "%", - 'div.rating-result>span:first-child' + 'div#rating-div-'.$_rating->getRatingId(). + '>span:first-child' ) ?> </div> <?php endif; ?> diff --git a/app/code/Magento/Review/view/frontend/templates/detailed.phtml b/app/code/Magento/Review/view/frontend/templates/detailed.phtml index 1bd8138f9cda..444a24875268 100644 --- a/app/code/Magento/Review/view/frontend/templates/detailed.phtml +++ b/app/code/Magento/Review/view/frontend/templates/detailed.phtml @@ -20,7 +20,7 @@ <th class="label" scope="row"><?= $block->escapeHtml(__($_rating->getRatingCode())) ?></th> <td class="value"> <div class="rating box"> - <div class="rating"/> + <div class="rating"></div> </div> <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( "width:" . /* @noEscape */ ceil($_rating->getSummary()) . "%;", diff --git a/app/code/Magento/Review/view/frontend/templates/product/view/list.phtml b/app/code/Magento/Review/view/frontend/templates/product/view/list.phtml index e631f5bc1958..2fe6f7f3109f 100644 --- a/app/code/Magento/Review/view/frontend/templates/product/view/list.phtml +++ b/app/code/Magento/Review/view/frontend/templates/product/view/list.phtml @@ -4,79 +4,104 @@ * See COPYING.txt for license details. */ -/** @var Magento\Review\Block\Product\View\ListView $block */ -/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ +use Magento\Framework\Escaper; +use Magento\Framework\View\Helper\SecureHtmlRenderer; +use Magento\Review\Block\Product\View\ListView; + +/** + * @var ListView $block + * @var SecureHtmlRenderer $secureRenderer + * @var Escaper $escaper + */ $_items = $block->getReviewsCollection()->getItems(); $format = $block->getDateFormat() ?: \IntlDateFormatter::SHORT; ?> <?php if (count($_items)): ?> -<div class="block review-list" id="customer-reviews"> - <?php if (!$block->getHideTitle()): ?> - <div class="block-title"> - <strong><?= $block->escapeHtml(__('Customer Reviews')) ?></strong> - </div> - <?php endif ?> - <div class="block-content"> - <div class="toolbar review-toolbar"> - <?= $block->getChildHtml('toolbar') ?> - </div> - <ol class="items review-items"> - <?php foreach ($_items as $_review): ?> - <li class="item review-item" itemscope itemprop="review" itemtype="http://schema.org/Review"> - <div class="review-title" itemprop="name"><?= $block->escapeHtml($_review->getTitle()) ?></div> - <?php if (count($_review->getRatingVotes())): ?> - <div class="review-ratings"> - <?php foreach ($_review->getRatingVotes() as $_vote): ?> - <div class="rating-summary item" - itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"> - <span class="label rating-label"> - <span><?= $block->escapeHtml($_vote->getRatingCode()) ?></span> - </span> - <div class="rating-result" - id="review_<?= /* @noEscape */ $_review->getReviewId() - ?>_vote_<?= /* @noEscape */ $_vote->getVoteId() ?>" - title="<?= $block->escapeHtmlAttr($_vote->getPercent()) ?>%"> - <meta itemprop="worstRating" content = "1"/> - <meta itemprop="bestRating" content = "100"/> - <span> - <span itemprop="ratingValue"><?= $block->escapeHtml($_vote->getPercent()) ?>%</span> - </span> + <div class="block review-list" id="customer-reviews"> + <?php if (!$block->getHideTitle()): ?> + <div class="block-title"> + <strong><?= $escaper->escapeHtml(__('Customer Reviews')) ?></strong> + </div> + <?php endif ?> + <div class="block-content"> + <div class="toolbar review-toolbar"> + <?= $block->getChildHtml('toolbar') ?> + </div> + <ol class="items review-items"> + <?php foreach ($_items as $_review): ?> + <li class="item review-item" itemscope itemprop="review" itemtype="http://schema.org/Review"> + <div class="review-title" itemprop="name"> + <?= $escaper->escapeHtml($_review->getTitle()) ?> + </div> + <?php if (count($_review->getRatingVotes())): ?> + <div class="review-ratings"> + <?php foreach ($_review->getRatingVotes() as $_vote): ?> + <div class="rating-summary item" + itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"> + <span class="label rating-label"> + <span><?= $escaper->escapeHtml($_vote->getRatingCode()) ?></span> + </span> + <div class="rating-result" + id="review_<?= /* @noEscape */ $_review->getReviewId() + . '_vote_' + . $_vote->getVoteId() ?>" + title="<?= $escaper->escapeHtmlAttr($_vote->getPercent()) ?>%"> + <meta itemprop="worstRating" content="1"/> + <meta itemprop="bestRating" content="100"/> + <span> + <span itemprop="ratingValue"> + <?= $escaper->escapeHtml($_vote->getPercent()) ?>% + </span> + </span> + </div> + <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( + 'width:' . $_vote->getPercent() . '%', + 'div#review_' . $_review->getReviewId() + . '_vote_' . $_vote->getVoteId() . ' span' + ) ?> + </div> + <?php endforeach; ?> + </div> + <?php endif; ?> + <div class="review-content-container"> + <div class="review-content" itemprop="description"> + <?= /* @noEscape */ nl2br($escaper->escapeHtml($_review->getDetail())) ?> + </div> + <div class="review-details"> + <p class="review-author"> + <span class="review-details-label"> + <?= $escaper->escapeHtml(__('Review by')) ?> + </span> + <strong class="review-details-value" itemprop="author"> + <?= $escaper->escapeHtml($_review->getNickname()) ?> + </strong> + </p> + <p class="review-date"> + <span class="review-details-label"> + <?= $escaper->escapeHtml(__('Posted on')) ?> + </span> + <time class="review-details-value" itemprop="datePublished" + datetime="<?= $escaper->escapeHtmlAttr($block->formatDate( + $_review->getCreatedAt(), + $format + )) ?>"> + <?= $escaper->escapeHtml( + $block->formatDate( + $_review->getCreatedAt(), + $format + ) + ) ?> + </time> + </p> + </div> </div> - <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( - 'width:' . $_vote->getPercent() . '%', - 'div#review_' . $_review->getReviewId() . '_vote_' . $_vote->getVoteId() . ' span' - ) ?> - </div> - <?php endforeach; ?> - </div> - <?php endif; ?> - <div class="review-content" itemprop="description"> - <?= /* @noEscape */ nl2br($block->escapeHtml($_review->getDetail())) ?> - </div> - <div class="review-details"> - <p class="review-author"> - <span class="review-details-label"><?= $block->escapeHtml(__('Review by')) ?></span> - <strong class="review-details-value" - itemprop="author"><?= $block->escapeHtml($_review->getNickname()) ?></strong> - </p> - <p class="review-date"> - <span class="review-details-label"><?= $block->escapeHtml(__('Posted on')) ?></span> - <time class="review-details-value" - itemprop="datePublished" - datetime="<?= $block->escapeHtmlAttr($block->formatDate( - $_review->getCreatedAt(), - $format - )) ?>"><?= $block->escapeHtml($block->formatDate($_review->getCreatedAt(), $format)) ?> - </time> - </p> - </div> - </li> - <?php endforeach; ?> - </ol> - <div class="toolbar review-toolbar"> - <?= $block->getChildHtml('toolbar') ?> + </li> + <?php endforeach; ?> + </ol> + <div class="toolbar review-toolbar"> + <?= $block->getChildHtml('toolbar') ?> + </div> </div> </div> -</div> -<?php endif;?> +<?php endif; ?> diff --git a/app/code/Magento/Review/view/frontend/web/js/process-reviews.js b/app/code/Magento/Review/view/frontend/web/js/process-reviews.js index 999161d45b58..486e4b85498a 100644 --- a/app/code/Magento/Review/view/frontend/web/js/process-reviews.js +++ b/app/code/Magento/Review/view/frontend/web/js/process-reviews.js @@ -22,12 +22,12 @@ define([ }).done(function (data) { $('#product-review-container').html(data).trigger('contentUpdated'); $('[data-role="product-review"] .pages a').each(function (index, element) { - $(element).click(function (event) { //eslint-disable-line max-nested-callbacks + $(element).on('click', function (event) { //eslint-disable-line max-nested-callbacks processReviews($(element).attr('href'), true); event.preventDefault(); }); }); - }).complete(function () { + }).always(function () { if (fromPages == true) { //eslint-disable-line eqeqeq $('html, body').animate({ scrollTop: $('#reviews').offset().top - 50 @@ -49,7 +49,7 @@ define([ } $(function () { - $('.product-info-main .reviews-actions a').click(function (event) { + $('.product-info-main .reviews-actions a').on('click', function (event) { var anchor, addReviewBlock; event.preventDefault(); diff --git a/app/code/Magento/ReviewAnalytics/README.md b/app/code/Magento/ReviewAnalytics/README.md index a0ec0ad1d77e..5eb1f100c572 100644 --- a/app/code/Magento/ReviewAnalytics/README.md +++ b/app/code/Magento/ReviewAnalytics/README.md @@ -1,3 +1,3 @@ # Magento_ReviewAnalytics module -The Magento_ReviewAnalytics module configures data definitions for a data collection related to the Review module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.3/advanced-reporting/modules.html). +The Magento_ReviewAnalytics module configures data definitions for a data collection related to the Review module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html). diff --git a/app/code/Magento/Rss/Model/RssManager.php b/app/code/Magento/Rss/Model/RssManager.php index c817c362b0fb..2eafc2c329f5 100644 --- a/app/code/Magento/Rss/Model/RssManager.php +++ b/app/code/Magento/Rss/Model/RssManager.php @@ -21,6 +21,11 @@ class RssManager implements RssManagerInterface */ protected $providers; + /** + * @var \Magento\Framework\ObjectManagerInterface + */ + private $objectManager; + /** * @param \Magento\Framework\ObjectManagerInterface $objectManager * @param array $dataProviders diff --git a/app/code/Magento/Rule/Test/Mftf/Helper/RuleHelper.php b/app/code/Magento/Rule/Test/Mftf/Helper/RuleHelper.php index a8a9f78df7f2..502f2ec0822f 100644 --- a/app/code/Magento/Rule/Test/Mftf/Helper/RuleHelper.php +++ b/app/code/Magento/Rule/Test/Mftf/Helper/RuleHelper.php @@ -18,7 +18,7 @@ class RuleHelper extends Helper { /** - * Delete all Catalog Price Rules obe by one. + * Deletes all Catalog Price Rules one by one. * * @param string $emptyRow * @param string $modalAceptButton diff --git a/app/code/Magento/Sales/Api/Data/OrderInterface.php b/app/code/Magento/Sales/Api/Data/OrderInterface.php index b45fddc7d735..b483930fd7e1 100644 --- a/app/code/Magento/Sales/Api/Data/OrderInterface.php +++ b/app/code/Magento/Sales/Api/Data/OrderInterface.php @@ -913,7 +913,10 @@ public function setCreatedAt($createdAt); /** * Gets the customer date-of-birth (DOB) for the order. * - * @return string|null Customer date-of-birth (DOB). + * @return string|null In keeping with current security and privacy best practices, be sure you are aware of any + * potential legal and security risks associated with the storage of customers’ full date of birth + * (month, day, year) along with other personal identifiers (e.g., full name) before collecting or processing + * such data. */ public function getCustomerDob(); diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php index bcdeb4e7d67d..123b77760292 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php @@ -399,4 +399,18 @@ protected function getAddressStoreId() { return $this->getBackendQuoteSession()->getStoreId(); } + + /** + * @inheritdoc + */ + protected function _getAdditionalFormElementTypes() + { + return array_merge( + parent::_getAdditionalFormElementTypes(), + [ + 'file' => \Magento\Customer\Block\Adminhtml\Form\Element\Address\File::class, + 'image' => \Magento\Customer\Block\Adminhtml\Form\Element\Address\Image::class, + ] + ); + } } diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Items/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Items/Grid.php index 8ec07f976520..b0510ffbe4d9 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Items/Grid.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Items/Grid.php @@ -545,12 +545,12 @@ public function getConfigureButtonHtml($item) { $product = $item->getProduct(); - $options = ['label' => __('Configure')]; + $options = ['label' => $this->escapeHtmlAttr(__('Configure'))]; if ($product->canConfigure()) { $options['onclick'] = sprintf('order.showQuoteItemConfiguration(%s)', $item->getId()); } else { $options['class'] = ' disabled'; - $options['title'] = __('This product does not have any configurable options'); + $options['title'] = $this->escapeHtmlAttr(__('This product does not have any configurable options')); } return $this->getLayout()->createBlock( diff --git a/app/code/Magento/Sales/Block/Items/AbstractItems.php b/app/code/Magento/Sales/Block/Items/AbstractItems.php index 7680d90cdd49..474c148518f1 100644 --- a/app/code/Magento/Sales/Block/Items/AbstractItems.php +++ b/app/code/Magento/Sales/Block/Items/AbstractItems.php @@ -5,6 +5,8 @@ */ namespace Magento\Sales\Block\Items; +use Magento\Sales\ViewModel\ItemRendererTypeResolverInterface; + /** * Abstract block for display sales (quote/order/invoice etc.) items * @@ -83,6 +85,10 @@ protected function _getItemType(\Magento\Framework\DataObject $item) public function getItemHtml(\Magento\Framework\DataObject $item) { $type = $this->_getItemType($item); + $itemRendererTypeResolver = $this->getData($type . '_renderer_type_resolver'); + if ($itemRendererTypeResolver instanceof ItemRendererTypeResolverInterface) { + $type = $itemRendererTypeResolver->resolve($item) ?? $type; + } $block = $this->getItemRenderer($type)->setItem($item); $this->_prepareItem($block); diff --git a/app/code/Magento/Sales/Block/Order/Creditmemo/Items.php b/app/code/Magento/Sales/Block/Order/Creditmemo/Items.php index 936a0613ac75..43949e8142bf 100644 --- a/app/code/Magento/Sales/Block/Order/Creditmemo/Items.php +++ b/app/code/Magento/Sales/Block/Order/Creditmemo/Items.php @@ -47,6 +47,8 @@ public function getOrder() } /** + * Get CreditMemo Print Url + * * @param object $creditmemo * @return string */ @@ -56,6 +58,8 @@ public function getPrintCreditmemoUrl($creditmemo) } /** + * Get PrintAll CreditMemos Url + * * @param object $order * @return string */ @@ -92,7 +96,7 @@ public function getCommentsHtml($creditmemo) $html = ''; $comments = $this->getChildBlock('creditmemo_comments'); if ($comments) { - $comments->setEntity($creditmemo)->setTitle(__('About Your Refund')); + $comments->setEntity($creditmemo)->setTitle($this->escapeHtmlAttr(__('About Your Refund'))); $html = $comments->toHtml(); } return $html; diff --git a/app/code/Magento/Sales/Block/Order/Invoice/Items.php b/app/code/Magento/Sales/Block/Order/Invoice/Items.php index e72ee3339c77..7f93c94a9698 100644 --- a/app/code/Magento/Sales/Block/Order/Invoice/Items.php +++ b/app/code/Magento/Sales/Block/Order/Invoice/Items.php @@ -12,6 +12,8 @@ namespace Magento\Sales\Block\Order\Invoice; /** + * Sales order invoice items block + * * @api * @since 100.0.2 */ @@ -49,6 +51,8 @@ public function getOrder() } /** + * Get Print Invoice url + * * @param object $invoice * @return string */ @@ -58,6 +62,8 @@ public function getPrintInvoiceUrl($invoice) } /** + * Get PrintAll Invoice url + * * @param object $order * @return string */ @@ -94,7 +100,7 @@ public function getInvoiceCommentsHtml($invoice) $html = ''; $comments = $this->getChildBlock('invoice_comments'); if ($comments) { - $comments->setEntity($invoice)->setTitle(__('About Your Invoice')); + $comments->setEntity($invoice)->setTitle($this->escapeHtmlAttr(__('About Your Invoice'))); $html = $comments->toHtml(); } return $html; diff --git a/app/code/Magento/Sales/Block/Order/Items.php b/app/code/Magento/Sales/Block/Order/Items.php index d7255a24aead..be3f9ce14c98 100644 --- a/app/code/Magento/Sales/Block/Order/Items.php +++ b/app/code/Magento/Sales/Block/Order/Items.php @@ -9,18 +9,28 @@ */ namespace Magento\Sales\Block\Order; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Registry; +use Magento\Framework\View\Element\AbstractBlock; +use Magento\Framework\View\Element\Template\Context; +use Magento\Sales\Block\Items\AbstractItems; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\ResourceModel\Order\Item\Collection; +use Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory; +use Magento\Theme\Block\Html\Pager; + /** * Sales order view items block. * * @api * @since 100.0.2 */ -class Items extends \Magento\Sales\Block\Items\AbstractItems +class Items extends AbstractItems { /** * Core registry * - * @var \Magento\Framework\Registry + * @var Registry */ protected $_coreRegistry = null; @@ -32,30 +42,30 @@ class Items extends \Magento\Sales\Block\Items\AbstractItems private $itemsPerPage; /** - * @var \Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory + * @var CollectionFactory */ private $itemCollectionFactory; /** - * @var \Magento\Sales\Model\ResourceModel\Order\Item\Collection|null + * @var Collection|null */ private $itemCollection; /** - * @param \Magento\Framework\View\Element\Template\Context $context - * @param \Magento\Framework\Registry $registry + * @param Context $context + * @param Registry $registry * @param array $data - * @param \Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory|null $itemCollectionFactory + * @param CollectionFactory|null $itemCollectionFactory */ public function __construct( - \Magento\Framework\View\Element\Template\Context $context, - \Magento\Framework\Registry $registry, + Context $context, + Registry $registry, array $data = [], - \Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory $itemCollectionFactory = null + CollectionFactory $itemCollectionFactory = null ) { $this->_coreRegistry = $registry; - $this->itemCollectionFactory = $itemCollectionFactory ?: \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory::class); + $this->itemCollectionFactory = $itemCollectionFactory ?: ObjectManager::getInstance() + ->get(CollectionFactory::class); parent::__construct($context, $data); } @@ -68,18 +78,12 @@ public function __construct( protected function _prepareLayout() { $this->itemsPerPage = $this->_scopeConfig->getValue('sales/orders/items_per_page'); + $this->itemCollection = $this->createItemsCollection(); - $this->itemCollection = $this->itemCollectionFactory->create(); - $this->itemCollection->setOrderFilter($this->getOrder()); - - /** @var \Magento\Theme\Block\Html\Pager $pagerBlock */ + /** @var Pager $pagerBlock */ $pagerBlock = $this->getChildBlock('sales_order_item_pager'); if ($pagerBlock) { - $pagerBlock->setLimit($this->itemsPerPage); - //here pager updates collection parameters - $pagerBlock->setCollection($this->itemCollection); - $pagerBlock->setAvailableLimit([$this->itemsPerPage]); - $pagerBlock->setShowAmounts($this->isPagerDisplayed()); + $this->preparePager($pagerBlock); } return parent::_prepareLayout(); @@ -122,7 +126,7 @@ public function getItems() */ public function getPagerHtml() { - /** @var \Magento\Theme\Block\Html\Pager $pagerBlock */ + /** @var Pager $pagerBlock */ $pagerBlock = $this->getChildBlock('sales_order_item_pager'); return $pagerBlock ? $pagerBlock->toHtml() : ''; } @@ -130,10 +134,39 @@ public function getPagerHtml() /** * Retrieve current order model instance * - * @return \Magento\Sales\Model\Order + * @return Order */ public function getOrder() { return $this->_coreRegistry->registry('current_order'); } + + /** + * Prepare pager block + * + * @param AbstractBlock $pagerBlock + */ + private function preparePager(AbstractBlock $pagerBlock): void + { + $collectionToPager = $this->createItemsCollection(); + $collectionToPager->addFieldToFilter('parent_item_id', ['null' => true]); + $pagerBlock->setCollection($collectionToPager); + + $pagerBlock->setLimit($this->itemsPerPage); + $pagerBlock->setAvailableLimit([$this->itemsPerPage]); + $pagerBlock->setShowAmounts($this->isPagerDisplayed()); + } + + /** + * Create items collection + * + * @return Collection + */ + private function createItemsCollection(): Collection + { + $collection = $this->itemCollectionFactory->create(); + $collection->setOrderFilter($this->getOrder()); + + return $collection; + } } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Create/Reorder.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Create/Reorder.php index eeaf4bee1b1c..19825c985854 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Create/Reorder.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Create/Reorder.php @@ -119,7 +119,6 @@ public function execute() $this->_getOrderCreateModel()->initFromOrder($order); $resultRedirect->setPath('sales/*'); } catch (\Magento\Framework\Exception\LocalizedException $e) { - $this->logger->critical($e); $this->messageManager->addErrorMessage($e->getMessage()); return $resultRedirect->setPath('sales/*'); } catch (\Exception $e) { diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AddComment.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AddComment.php index 4e158efe9702..5c3e7e482d07 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AddComment.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AddComment.php @@ -31,7 +31,7 @@ class AddComment extends \Magento\Backend\App\Action /** * @var \Magento\Framework\View\Result\PageFactory */ - protected $pagePageFactory; + protected $resultPageFactory; /** * @var \Magento\Framework\Controller\Result\JsonFactory diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/UpdateQty.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/UpdateQty.php index d49fa8b8dc60..47a936672791 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/UpdateQty.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/UpdateQty.php @@ -25,7 +25,7 @@ class UpdateQty extends \Magento\Backend\App\Action implements HttpPostActionInt /** * @var \Magento\Framework\View\Result\PageFactory */ - protected $pagePageFactory; + protected $resultPageFactory; /** * @var \Magento\Framework\Controller\Result\JsonFactory diff --git a/app/code/Magento/Sales/Helper/Guest.php b/app/code/Magento/Sales/Helper/Guest.php index 3b7e491086b1..fd3d53d4fa53 100644 --- a/app/code/Magento/Sales/Helper/Guest.php +++ b/app/code/Magento/Sales/Helper/Guest.php @@ -211,7 +211,8 @@ private function setGuestViewCookie($cookieValue) { $metadata = $this->cookieMetadataFactory->createPublicCookieMetadata() ->setPath(self::COOKIE_PATH) - ->setHttpOnly(true); + ->setHttpOnly(true) + ->setSameSite('Lax'); $this->cookieManager->setPublicCookie(self::COOKIE_NAME, $cookieValue, $metadata); } @@ -275,9 +276,20 @@ private function compareStoredBillingDataWithInput(Order $order, array $postData $lastName = $postData['oar_billing_lastname']; $zip = $postData['oar_zip']; $billingAddress = $order->getBillingAddress(); - return strtolower($lastName) === strtolower($billingAddress->getLastname()) && - ($type === 'email' && strtolower($email) === strtolower($billingAddress->getEmail()) || - $type === 'zip' && strtolower($zip) === strtolower($billingAddress->getPostcode())); + return $this->normalizeStr($lastName) === $this->normalizeStr($billingAddress->getLastname()) && + ($type === 'email' && $this->normalizeStr($email) === $this->normalizeStr($billingAddress->getEmail()) || + $type === 'zip' && $this->normalizeStr($zip) === $this->normalizeStr($billingAddress->getPostcode())); + } + + /** + * Trim and convert to lower case + * + * @param string $str + * @return string + */ + private function normalizeStr(string $str): string + { + return trim(strtolower($str)); } /** diff --git a/app/code/Magento/Sales/Model/Convert/Order.php b/app/code/Magento/Sales/Model/Convert/Order.php index 0a35aa29da80..cedc964ca784 100644 --- a/app/code/Magento/Sales/Model/Convert/Order.php +++ b/app/code/Magento/Sales/Model/Convert/Order.php @@ -51,6 +51,11 @@ class Order extends \Magento\Framework\DataObject */ protected $_objectCopyService; + /** + * @var \Magento\Sales\Model\Order\Shipment\ItemFactory + */ + private $_shipmentItemFactory; + /** * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Sales\Api\InvoiceRepositoryInterface $invoiceRepository diff --git a/app/code/Magento/Sales/Model/Grid/LastUpdateTimeCache.php b/app/code/Magento/Sales/Model/Grid/LastUpdateTimeCache.php new file mode 100644 index 000000000000..0747f1ea5815 --- /dev/null +++ b/app/code/Magento/Sales/Model/Grid/LastUpdateTimeCache.php @@ -0,0 +1,86 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Sales\Model\Grid; + +use Magento\Framework\App\CacheInterface; + +/** + * Cache for last grid update time. + */ +class LastUpdateTimeCache +{ + /** + * Prefix for cache key. + */ + private const CACHE_PREFIX = 'LAST_GRID_UPDATE_TIME'; + + /** + * @var CacheInterface + */ + private $cache; + + /** + * @param CacheInterface $cache + */ + public function __construct(CacheInterface $cache) + { + $this->cache = $cache; + } + + /** + * Save last grid update time. + * + * @param string $gridTableName + * @param string $lastUpdatedAt + * @return void + */ + public function save(string $gridTableName, string $lastUpdatedAt): void + { + $this->cache->save( + $lastUpdatedAt, + $this->getCacheKey($gridTableName), + [], + 3600 + ); + } + + /** + * Get last grid update time. + * + * @param string $gridTableName + * @return string|null + */ + public function get(string $gridTableName): ?string + { + $lastUpdatedAt = $this->cache->load($this->getCacheKey($gridTableName)); + + return $lastUpdatedAt ?: null; + } + + /** + * Remove last grid update time. + * + * @param string $gridTableName + * @return void + */ + public function remove(string $gridTableName): void + { + $this->cache->remove($this->getCacheKey($gridTableName)); + } + + /** + * Generate cache key. + * + * @param string $gridTableName + * @return string + */ + private function getCacheKey(string $gridTableName): string + { + return self::CACHE_PREFIX . ':' . $gridTableName; + } +} diff --git a/app/code/Magento/Sales/Model/Order.php b/app/code/Magento/Sales/Model/Order.php index fc8088ffc838..6e080865a25f 100644 --- a/app/code/Magento/Sales/Model/Order.php +++ b/app/code/Magento/Sales/Model/Order.php @@ -8,6 +8,7 @@ use Magento\Config\Model\Config\Source\Nooptreq; use Magento\Directory\Model\Currency; use Magento\Directory\Model\RegionFactory; +use Magento\Directory\Model\ResourceModel\Region as RegionResource; use Magento\Framework\Api\AttributeValueFactory; use Magento\Framework\Api\SearchCriteriaBuilder; use Magento\Framework\App\Config\ScopeConfigInterface; @@ -30,6 +31,8 @@ use Magento\Sales\Model\ResourceModel\Order\Shipment\Track\Collection as TrackCollection; use Magento\Sales\Model\ResourceModel\Order\Status\History\Collection as HistoryCollection; use Magento\Store\Model\ScopeInterface; +use Magento\Framework\App\Area; +use Magento\Sales\Model\Order\StatusLabel; /** * Order model @@ -318,6 +321,16 @@ class Order extends AbstractModel implements EntityInterface, OrderInterface */ private $regionItems; + /** + * @var RegionResource + */ + private $regionResource; + + /** + * @var StatusLabel + */ + private $statusLabel; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry @@ -343,15 +356,16 @@ class Order extends AbstractModel implements EntityInterface, OrderInterface * @param ResourceModel\Order\CollectionFactory $salesOrderCollectionFactory * @param PriceCurrencyInterface $priceCurrency * @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productListFactory - * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource - * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection + * @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource + * @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection * @param array $data - * @param ResolverInterface $localeResolver + * @param ResolverInterface|null $localeResolver * @param ProductOption|null $productOption - * @param OrderItemRepositoryInterface $itemRepository - * @param SearchCriteriaBuilder $searchCriteriaBuilder - * @param ScopeConfigInterface $scopeConfig - * @param RegionFactory $regionFactory + * @param OrderItemRepositoryInterface|null $itemRepository + * @param SearchCriteriaBuilder|null $searchCriteriaBuilder + * @param ScopeConfigInterface|null $scopeConfig + * @param RegionFactory|null $regionFactory + * @param RegionResource|null $regionResource * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -387,7 +401,9 @@ public function __construct( OrderItemRepositoryInterface $itemRepository = null, SearchCriteriaBuilder $searchCriteriaBuilder = null, ScopeConfigInterface $scopeConfig = null, - RegionFactory $regionFactory = null + RegionFactory $regionFactory = null, + RegionResource $regionResource = null, + StatusLabel $statusLabel = null ) { $this->_storeManager = $storeManager; $this->_orderConfig = $orderConfig; @@ -417,8 +433,9 @@ public function __construct( ->get(SearchCriteriaBuilder::class); $this->scopeConfig = $scopeConfig ?: ObjectManager::getInstance()->get(ScopeConfigInterface::class); $this->regionFactory = $regionFactory ?: ObjectManager::getInstance()->get(RegionFactory::class); + $this->regionResource = $regionResource ?: ObjectManager::getInstance()->get(RegionResource::class); $this->regionItems = []; - + $this->statusLabel = $statusLabel ?: ObjectManager::getInstance()->get(StatusLabel::class); parent::__construct( $context, $registry, @@ -1095,7 +1112,11 @@ public function setState($state) */ public function getFrontendStatusLabel() { - return $this->getConfig()->getStatusFrontendLabel($this->getStatus()); + return $this->statusLabel->getStatusFrontendLabel( + $this->getStatus(), + Area::AREA_FRONTEND, + $this->getStoreId() + ); } /** @@ -1106,7 +1127,7 @@ public function getFrontendStatusLabel() */ public function getStatusLabel() { - return $this->getConfig()->getStatusLabel($this->getStatus()); + return $this->statusLabel->getStatusLabel($this->getStatus()); } /** @@ -1361,7 +1382,6 @@ public function getShippingMethod($asObject = false) */ public function getAddressesCollection() { - $region = $this->regionFactory->create(); $collection = $this->_addressCollectionFactory->create()->setOrderFilter($this); if ($this->getId()) { foreach ($collection as $address) { @@ -1370,7 +1390,8 @@ public function getAddressesCollection() $address->setRegion($this->regionItems[$address->getCountryId()][$address->getRegion()]); } } else { - $region->loadByName($address->getRegion(), $address->getCountryId()); + $region = $this->regionFactory->create(); + $this->regionResource->loadByName($region, $address->getRegion(), $address->getCountryId()); $this->regionItems[$address->getCountryId()][$address->getRegion()] = $region->getName(); if ($region->getName()) { $address->setRegion($region->getName()); diff --git a/app/code/Magento/Sales/Model/Order/Address/Renderer.php b/app/code/Magento/Sales/Model/Order/Address/Renderer.php index 947c92e04942..af5300a175f3 100644 --- a/app/code/Magento/Sales/Model/Order/Address/Renderer.php +++ b/app/code/Magento/Sales/Model/Order/Address/Renderer.php @@ -7,11 +7,17 @@ namespace Magento\Sales\Model\Order\Address; use Magento\Customer\Model\Address\Config as AddressConfig; +use Magento\Directory\Helper\Data; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Event\ManagerInterface as EventManager; use Magento\Sales\Model\Order\Address; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\StoreManagerInterface; /** * Class Renderer used for formatting an order address + * * @api * @since 100.0.2 */ @@ -28,17 +34,31 @@ class Renderer protected $eventManager; /** - * Constructor - * + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * @var StoreManagerInterface|null + */ + private $storeManager; + + /** * @param AddressConfig $addressConfig * @param EventManager $eventManager + * @param ScopeConfigInterface|null $scopeConfig + * @param StoreManagerInterface|null $storeManager */ public function __construct( AddressConfig $addressConfig, - EventManager $eventManager + EventManager $eventManager, + ?ScopeConfigInterface $scopeConfig = null, + ?StoreManagerInterface $storeManager = null ) { $this->addressConfig = $addressConfig; $this->eventManager = $eventManager; + $this->scopeConfig = $scopeConfig ?: ObjectManager::getInstance()->get(ScopeConfigInterface::class); + $this->storeManager = $storeManager ?: ObjectManager::getInstance()->get(StoreManagerInterface::class); } /** @@ -50,12 +70,27 @@ public function __construct( */ public function format(Address $address, $type) { - $this->addressConfig->setStore($address->getOrder()->getStoreId()); + $orderStore = $address->getOrder()->getStore(); + $this->storeManager->setCurrentStore($orderStore); $formatType = $this->addressConfig->getFormatByCode($type); if (!$formatType || !$formatType->getRenderer()) { return null; } $this->eventManager->dispatch('customer_address_format', ['type' => $formatType, 'address' => $address]); - return $formatType->getRenderer()->renderArray($address->getData()); + $addressData = $address->getData(); + $addressData['locale'] = $this->getLocaleByStoreId((int) $orderStore->getId()); + + return $formatType->getRenderer()->renderArray($addressData); + } + + /** + * Returns locale by storeId + * + * @param int $storeId + * @return string + */ + private function getLocaleByStoreId(int $storeId): string + { + return $this->scopeConfig->getValue(Data::XML_PATH_DEFAULT_LOCALE, ScopeInterface::SCOPE_STORE, $storeId); } } diff --git a/app/code/Magento/Sales/Model/Order/Config.php b/app/code/Magento/Sales/Model/Order/Config.php index 20aee5c76cc1..92d631d1f78c 100644 --- a/app/code/Magento/Sales/Model/Order/Config.php +++ b/app/code/Magento/Sales/Model/Order/Config.php @@ -5,7 +5,9 @@ */ namespace Magento\Sales\Model\Order; +use Magento\Framework\App\Area; use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\App\ObjectManager; /** * Order configuration model @@ -51,27 +53,35 @@ class Config * @var array */ protected $maskStatusesMapping = [ - \Magento\Framework\App\Area::AREA_FRONTEND => [ + Area::AREA_FRONTEND => [ \Magento\Sales\Model\Order::STATUS_FRAUD => \Magento\Sales\Model\Order::STATUS_FRAUD, \Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW => \Magento\Sales\Model\Order::STATE_PROCESSING ] ]; + /** + * @var StatusLabel + */ + private $statusLabel; + /** * Constructor * * @param \Magento\Sales\Model\Order\StatusFactory $orderStatusFactory * @param \Magento\Sales\Model\ResourceModel\Order\Status\CollectionFactory $orderStatusCollectionFactory * @param \Magento\Framework\App\State $state + * @param StatusLabel|null $statusLabel */ public function __construct( \Magento\Sales\Model\Order\StatusFactory $orderStatusFactory, \Magento\Sales\Model\ResourceModel\Order\Status\CollectionFactory $orderStatusCollectionFactory, - \Magento\Framework\App\State $state + \Magento\Framework\App\State $state, + StatusLabel $statusLabel = null ) { $this->orderStatusFactory = $orderStatusFactory; $this->orderStatusCollectionFactory = $orderStatusCollectionFactory; $this->state = $state; + $this->statusLabel = $statusLabel ?: ObjectManager::getInstance()->get(StatusLabel::class); } /** @@ -120,24 +130,6 @@ public function getStateDefaultStatus($state): ?string return $status; } - /** - * Get status label for a specified area - * - * @param string|null $code - * @param string $area - * @return string|null - */ - private function getStatusLabelForArea(?string $code, string $area): ?string - { - $code = $this->maskStatusForArea($area, $code); - $status = $this->orderStatusFactory->create()->load($code); - - if ($area === 'adminhtml') { - return $status->getLabel(); - } - - return $status->getStoreLabel(); - } /** * Retrieve status label for detected area @@ -145,11 +137,12 @@ private function getStatusLabelForArea(?string $code, string $area): ?string * @param string|null $code * @return string|null * @throws LocalizedException + * @deprecated Functionality moved to separate class + * @see \Magento\Sales\Model\Order\StatusLabel::getStatusLabel */ public function getStatusLabel($code) { - $area = $this->state->getAreaCode() ?: \Magento\Framework\App\Area::AREA_FRONTEND; - return $this->getStatusLabelForArea($code, $area); + return $this->statusLabel->getStatusLabel($code); } /** @@ -158,10 +151,12 @@ public function getStatusLabel($code) * @param string|null $code * @return string|null * @since 102.0.1 + * @deprecated Functionality moved to separate class + * @see \Magento\Sales\Model\Order\StatusLabel::getStatusFrontendLabel */ public function getStatusFrontendLabel(?string $code): ?string { - return $this->getStatusLabelForArea($code, \Magento\Framework\App\Area::AREA_FRONTEND); + return $this->statusLabel->getStatusFrontendLabel($code, Area::AREA_FRONTEND); } /** @@ -170,13 +165,12 @@ public function getStatusFrontendLabel(?string $code): ?string * @param string $area * @param string $code * @return string + * @deprecated Functionality moved to separate class + * @see \Magento\Sales\Model\Order\StatusLabel::maskStatusForArea */ protected function maskStatusForArea($area, $code) { - if (isset($this->maskStatusesMapping[$area][$code])) { - return $this->maskStatusesMapping[$area][$code]; - } - return $code; + return $this->statusLabel->maskStatusForArea($area, $code); } /** diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php index c27afe9fb5b0..db4baabdbd1f 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php @@ -100,12 +100,11 @@ public function __construct( */ public function send(Creditmemo $creditmemo, $forceSyncMode = false) { + $this->identityContainer->setStore($creditmemo->getStore()); $creditmemo->setSendEmail($this->identityContainer->isEnabled()); if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) { $order = $creditmemo->getOrder(); - $this->identityContainer->setStore($order->getStore()); - $transport = [ 'order' => $order, 'order_id' => $order->getId(), diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php index d0247294e75a..31fbf3e80900 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php @@ -102,12 +102,11 @@ public function __construct( */ public function send(Invoice $invoice, $forceSyncMode = false) { + $this->identityContainer->setStore($invoice->getStore()); $invoice->setSendEmail($this->identityContainer->isEnabled()); if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) { $order = $invoice->getOrder(); - $this->identityContainer->setStore($order->getStore()); - if ($this->checkIfPartialInvoice($order, $invoice)) { $order->setBaseSubtotal((float) $invoice->getBaseSubtotal()); $order->setBaseTaxAmount((float) $invoice->getBaseTaxAmount()); diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/OrderSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/OrderSender.php index a2d61c3b2d31..5ed017c4de74 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/OrderSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/OrderSender.php @@ -98,6 +98,7 @@ public function __construct( */ public function send(Order $order, $forceSyncMode = false) { + $this->identityContainer->setStore($order->getStore()); $order->setSendEmail($this->identityContainer->isEnabled()); if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) { diff --git a/app/code/Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php b/app/code/Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php index 44b4df17619d..ae5c3a37f532 100644 --- a/app/code/Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php +++ b/app/code/Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php @@ -104,7 +104,9 @@ public function send( $transport = [ 'order' => $order, + 'order_id' => $order->getId(), 'invoice' => $invoice, + 'invoice_id' => $invoice->getId(), 'comment' => $comment ? $comment->getComment() : '', 'billing' => $order->getBillingAddress(), 'payment_html' => $this->getPaymentHtml($order), diff --git a/app/code/Magento/Sales/Model/Order/Invoice/Total/Discount.php b/app/code/Magento/Sales/Model/Order/Invoice/Total/Discount.php index ef7205b37441..f2a99a476590 100644 --- a/app/code/Magento/Sales/Model/Order/Invoice/Total/Discount.php +++ b/app/code/Magento/Sales/Model/Order/Invoice/Total/Discount.php @@ -71,9 +71,9 @@ public function collect(Invoice $invoice) $invoice->setDiscountAmount(-$totalDiscountAmount); $invoice->setBaseDiscountAmount(-$baseTotalDiscountAmount); - $grandTotal = $invoice->getGrandTotal() - $totalDiscountAmount < 0.0001 + $grandTotal = abs($invoice->getGrandTotal() - $totalDiscountAmount) < 0.0001 ? 0 : $invoice->getGrandTotal() - $totalDiscountAmount; - $baseGrandTotal = $invoice->getBaseGrandTotal() - $baseTotalDiscountAmount < 0.0001 + $baseGrandTotal = abs($invoice->getBaseGrandTotal() - $baseTotalDiscountAmount) < 0.0001 ? 0 : $invoice->getBaseGrandTotal() - $baseTotalDiscountAmount; $invoice->setGrandTotal($grandTotal); $invoice->setBaseGrandTotal($baseGrandTotal); diff --git a/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php b/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php index 534bb127db06..0c32c21a36f9 100644 --- a/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php +++ b/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php @@ -109,11 +109,10 @@ public function send( ShipmentCommentCreationInterface $comment = null, $forceSyncMode = false ) { + $this->identityContainer->setStore($order->getStore()); $shipment->setSendEmail($this->identityContainer->isEnabled()); if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) { - $this->identityContainer->setStore($order->getStore()); - $transport = [ 'order' => $order, 'order_id' => $order->getId(), diff --git a/app/code/Magento/Sales/Model/Order/StatusLabel.php b/app/code/Magento/Sales/Model/Order/StatusLabel.php new file mode 100644 index 000000000000..bc66e1ae5dba --- /dev/null +++ b/app/code/Magento/Sales/Model/Order/StatusLabel.php @@ -0,0 +1,95 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Sales\Model\Order; + +use Magento\Framework\App\Area; +use Magento\Framework\App\State; +use Magento\Sales\Model\Order\StatusFactory; + +/** + * Class StatusLabel is responsible for retrieving order status labels based on store of order + */ +class StatusLabel +{ + /** + * @var StatusFactory + */ + private $orderStatusFactory; + + /** + * @var State + */ + private $state; + + /** + * @var array + */ + private $maskStatusesMapping; + + /** + * @param StatusFactory $orderStatusFactory + * @param State $state + * @param array $maskStatusesMapping + */ + public function __construct( + StatusFactory $orderStatusFactory, + State $state, + array $maskStatusesMapping = [] + ) { + $this->orderStatusFactory = $orderStatusFactory; + $this->state = $state; + $this->maskStatusesMapping = $maskStatusesMapping; + } + + /** + * Get status label for a specified area + * + * @param string|null $code + * @param string $area + * @param int|null $storeId + * @return string|null + */ + public function getStatusFrontendLabel(?string $code, string $area, int $storeId = null): ?string + { + $code = $this->maskStatusForArea($area, $code); + $status = $this->orderStatusFactory->create()->load($code); + + if ($area === Area::AREA_ADMINHTML) { + return $status->getLabel(); + } + + return (string) $status->getStoreLabel($storeId); + } + + /** + * Mask status for order for specified area + * + * @param string $area + * @param string|null $code + * @return string|null + */ + public function maskStatusForArea(string $area, ?string $code): ?string + { + if (isset($this->maskStatusesMapping[$area][$code])) { + return $this->maskStatusesMapping[$area][$code]; + } + return $code; + } + + /** + * Retrieve status label for detected area + * + * @param $code + * @return string|null + */ + public function getStatusLabel($code) + { + $area = $this->state->getAreaCode() ?: Area::AREA_FRONTEND; + return $this->getStatusFrontendLabel($code, $area); + } +} diff --git a/app/code/Magento/Sales/Model/OrderRepository.php b/app/code/Magento/Sales/Model/OrderRepository.php index a600d1489857..6ad8d73b1fc4 100644 --- a/app/code/Magento/Sales/Model/OrderRepository.php +++ b/app/code/Magento/Sales/Model/OrderRepository.php @@ -186,7 +186,13 @@ private function setPaymentAdditionalInfo(OrderInterface $order): void if ($extensionAttributes === null) { $extensionAttributes = $this->orderExtensionFactory->create(); } - $paymentAdditionalInformation = $order->getPayment()->getAdditionalInformation(); + + $paymentAdditionalInformation = []; + $payment = $order->getPayment(); + + if ($payment) { + $paymentAdditionalInformation = $payment->getAdditionalInformation(); + } $objects = []; foreach ($paymentAdditionalInformation as $key => $value) { diff --git a/app/code/Magento/Sales/Model/ResourceModel/Grid.php b/app/code/Magento/Sales/Model/ResourceModel/Grid.php index 432918450a69..8da260ded3f3 100644 --- a/app/code/Magento/Sales/Model/ResourceModel/Grid.php +++ b/app/code/Magento/Sales/Model/ResourceModel/Grid.php @@ -8,10 +8,11 @@ use Magento\Framework\App\ObjectManager; use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\Model\ResourceModel\Db\Context; +use Magento\Sales\Model\Grid\LastUpdateTimeCache; use Magento\Sales\Model\ResourceModel\Provider\NotSyncedDataProviderInterface; /** - * Class Grid + * Sales order grid resource model. */ class Grid extends AbstractGrid { @@ -45,6 +46,11 @@ class Grid extends AbstractGrid */ private $notSyncedDataProvider; + /** + * @var LastUpdateTimeCache + */ + private $lastUpdateTimeCache; + /** * Order grid rows batch size */ @@ -58,7 +64,8 @@ class Grid extends AbstractGrid * @param array $joins * @param array $columns * @param string $connectionName - * @param NotSyncedDataProviderInterface $notSyncedDataProvider + * @param NotSyncedDataProviderInterface|null $notSyncedDataProvider + * @param LastUpdateTimeCache|null $lastUpdateTimeCache */ public function __construct( Context $context, @@ -68,15 +75,19 @@ public function __construct( array $joins = [], array $columns = [], $connectionName = null, - NotSyncedDataProviderInterface $notSyncedDataProvider = null + NotSyncedDataProviderInterface $notSyncedDataProvider = null, + LastUpdateTimeCache $lastUpdateTimeCache = null ) { $this->mainTableName = $mainTableName; $this->gridTableName = $gridTableName; $this->orderIdField = $orderIdField; $this->joins = $joins; $this->columns = $columns; - $this->notSyncedDataProvider = - $notSyncedDataProvider ?: ObjectManager::getInstance()->get(NotSyncedDataProviderInterface::class); + $this->notSyncedDataProvider = $notSyncedDataProvider ?? + ObjectManager::getInstance()->get(NotSyncedDataProviderInterface::class); + $this->lastUpdateTimeCache = $lastUpdateTimeCache ?? + ObjectManager::getInstance()->get(LastUpdateTimeCache::class); + parent::__construct($context, $connectionName); } @@ -118,6 +129,7 @@ public function refresh($value, $field = null) */ public function refreshBySchedule() { + $lastUpdatedAt = null; $notSyncedIds = $this->notSyncedDataProvider->getIds($this->mainTableName, $this->gridTableName); foreach (array_chunk($notSyncedIds, self::BATCH_SIZE) as $bunch) { $select = $this->getGridOriginSelect()->where($this->mainTableName . '.entity_id IN (?)', $bunch); @@ -127,6 +139,15 @@ public function refreshBySchedule() $fetchResult, array_keys($this->columns) ); + + $timestamps = array_column($fetchResult, 'updated_at'); + if ($timestamps) { + $lastUpdatedAt = max(max($timestamps), $lastUpdatedAt); + } + } + + if ($lastUpdatedAt) { + $this->lastUpdateTimeCache->save($this->gridTableName, $lastUpdatedAt); } } diff --git a/app/code/Magento/Sales/Model/ResourceModel/Order/Grid/Collection.php b/app/code/Magento/Sales/Model/ResourceModel/Order/Grid/Collection.php index 82c612c1a781..094fac313d39 100644 --- a/app/code/Magento/Sales/Model/ResourceModel/Order/Grid/Collection.php +++ b/app/code/Magento/Sales/Model/ResourceModel/Order/Grid/Collection.php @@ -5,16 +5,25 @@ */ namespace Magento\Sales\Model\ResourceModel\Order\Grid; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Data\Collection\Db\FetchStrategyInterface as FetchStrategy; use Magento\Framework\Data\Collection\EntityFactoryInterface as EntityFactory; use Magento\Framework\Event\ManagerInterface as EventManager; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; +use Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult; +use Magento\Sales\Model\ResourceModel\Order; use Psr\Log\LoggerInterface as Logger; /** * Order grid collection */ -class Collection extends \Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult +class Collection extends SearchResult { + /** + * @var TimezoneInterface + */ + private $timeZone; + /** * Initialize dependencies. * @@ -24,6 +33,7 @@ class Collection extends \Magento\Framework\View\Element\UiComponent\DataProvide * @param EventManager $eventManager * @param string $mainTable * @param string $resourceModel + * @param TimezoneInterface|null $timeZone */ public function __construct( EntityFactory $entityFactory, @@ -31,9 +41,12 @@ public function __construct( FetchStrategy $fetchStrategy, EventManager $eventManager, $mainTable = 'sales_order_grid', - $resourceModel = \Magento\Sales\Model\ResourceModel\Order::class + $resourceModel = Order::class, + TimezoneInterface $timeZone = null ) { parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $mainTable, $resourceModel); + $this->timeZone = $timeZone ?: ObjectManager::getInstance() + ->get(TimezoneInterface::class); } /** @@ -50,4 +63,20 @@ protected function _initSelect() return $this; } + + /** + * @inheritDoc + */ + public function addFieldToFilter($field, $condition = null) + { + if ($field === 'created_at') { + if (is_array($condition)) { + foreach ($condition as $key => $value) { + $condition[$key] = $this->timeZone->convertConfigTimeToUtc($value); + } + } + } + + return parent::addFieldToFilter($field, $condition); + } } diff --git a/app/code/Magento/Sales/Model/ResourceModel/Provider/UpdatedAtListProvider.php b/app/code/Magento/Sales/Model/ResourceModel/Provider/UpdatedAtListProvider.php index 846fa46572fd..8285514b906c 100644 --- a/app/code/Magento/Sales/Model/ResourceModel/Provider/UpdatedAtListProvider.php +++ b/app/code/Magento/Sales/Model/ResourceModel/Provider/UpdatedAtListProvider.php @@ -7,6 +7,7 @@ use Magento\Framework\App\ResourceConnection; use Magento\Framework\DB\Adapter\AdapterInterface; +use Magento\Sales\Model\Grid\LastUpdateTimeCache; /** * Retrieves ID's of not synced by `updated_at` column entities. @@ -25,13 +26,22 @@ class UpdatedAtListProvider implements NotSyncedDataProviderInterface */ private $connection; + /** + * @var LastUpdateTimeCache + */ + private $lastUpdateTimeCache; + /** * @param ResourceConnection $resourceConnection + * @param LastUpdateTimeCache $lastUpdateTimeCache */ - public function __construct(ResourceConnection $resourceConnection) - { + public function __construct( + ResourceConnection $resourceConnection, + LastUpdateTimeCache $lastUpdateTimeCache + ) { $this->connection = $resourceConnection->getConnection('sales'); $this->resourceConnection = $resourceConnection; + $this->lastUpdateTimeCache = $lastUpdateTimeCache; } /** @@ -39,22 +49,19 @@ public function __construct(ResourceConnection $resourceConnection) */ public function getIds($mainTableName, $gridTableName) { - $mainTableName = $this->resourceConnection->getTableName($mainTableName); - $gridTableName = $this->resourceConnection->getTableName($gridTableName); $select = $this->connection->select() - ->from($mainTableName, [$mainTableName . '.entity_id']) + ->from(['main_table' => $this->resourceConnection->getTableName($mainTableName)], ['main_table.entity_id']) ->joinInner( - [$gridTableName => $gridTableName], - sprintf( - '%s.entity_id = %s.entity_id AND %s.updated_at > %s.updated_at', - $mainTableName, - $gridTableName, - $mainTableName, - $gridTableName - ), + ['grid_table' => $this->resourceConnection->getTableName($gridTableName)], + 'main_table.entity_id = grid_table.entity_id AND main_table.updated_at > grid_table.updated_at', [] ); + $lastUpdatedAt = $this->lastUpdateTimeCache->get($gridTableName); + if ($lastUpdatedAt) { + $select->where('main_table.updated_at > ?', $lastUpdatedAt); + } + return $this->connection->fetchAll($select, [], \Zend_Db::FETCH_COLUMN); } } diff --git a/app/code/Magento/Sales/Model/Service/InvoiceService.php b/app/code/Magento/Sales/Model/Service/InvoiceService.php index ceef0f054015..c55e1a650b26 100644 --- a/app/code/Magento/Sales/Model/Service/InvoiceService.php +++ b/app/code/Magento/Sales/Model/Service/InvoiceService.php @@ -194,7 +194,7 @@ private function prepareItemsQty( ): array { foreach ($order->getAllItems() as $orderItem) { if (isset($orderItemsQtyToInvoice[$orderItem->getId()])) { - if ($orderItem->isDummy() && $orderItem->getHasChildren()) { + if ($orderItem->getHasChildren()) { $orderItemsQtyToInvoice = $this->setChildItemsQtyToInvoice($orderItem, $orderItemsQtyToInvoice); } } else { diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAssertActionOnInvoiceGridPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAssertActionOnInvoiceGridPageActionGroup.xml new file mode 100644 index 000000000000..fb1e2594c145 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAssertActionOnInvoiceGridPageActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertActionOnInvoiceGridPageActionGroup"> + <arguments> + <argument name="action" type="string"/> + </arguments> + <click selector="{{AdminInvoicesGridSection.selectActions}}" stepKey="openActions"/> + <seeElement selector="{{AdminInvoicesGridSection.dropdownActionItem(action)}}" stepKey="seeAction"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup.xml new file mode 100644 index 000000000000..fe24996ba283 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup"> + <annotations> + <description>Click create new status button</description> + </annotations> + + <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> + <waitForPageLoad stepKey="waitForPageLoaded"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickRefundOfflineOnCreditMemoDetailPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickRefundOfflineOnCreditMemoDetailPageActionGroup.xml new file mode 100644 index 000000000000..b8c9916283a6 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickRefundOfflineOnCreditMemoDetailPageActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickRefundOfflineOnCreditMemoDetailPageActionGroup"> + + <click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickRefundOffline"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccesMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You created the credit memo." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToOrderStatusPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToOrderStatusPageActionGroup.xml new file mode 100644 index 000000000000..a47d9858652e --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToOrderStatusPageActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminGoToOrderStatusPageActionGroup"> + <annotations> + <description>Goes to Stores->Order Status->Order Status Page.</description> + </annotations> + + <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> + <waitForPageLoad stepKey="waitForPageLoaded"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminBillingAddressFieldsOnOrderCreateFormActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminBillingAddressFieldsOnOrderCreateFormActionGroup.xml new file mode 100644 index 000000000000..ca33f8f70fcc --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminBillingAddressFieldsOnOrderCreateFormActionGroup.xml @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminBillingAddressFieldsOnOrderCreateFormActionGroup"> + <annotations> + <description>Admin assert fields filled default billing address from customer</description> + </annotations> + <arguments> + <argument name="namePrefix" type="string" defaultValue=""/> + <argument name="firstName" type="string" defaultValue="{{US_Address_CA.firstname}}"/> + <argument name="middleName" type="string" defaultValue=""/> + <argument name="lastName" type="string" defaultValue="{{US_Address_CA.lastname}}"/> + <argument name="nameSuffix" type="string" defaultValue=""/> + <argument name="company" type="string" defaultValue="{{US_Address_CA.company}}"/> + <argument name="streetLine1" type="string" defaultValue="{{US_Address_CA.street[0]}}"/> + <argument name="streetLine2" type="string" defaultValue="{{US_Address_CA.street[1]}}"/> + <argument name="country" type="string" defaultValue="{{US_Address_CA.country}}"/> + <argument name="state" type="string" defaultValue="{{US_Address_CA.state}}"/> + <argument name="province" type="string" defaultValue=""/> + <argument name="city" type="string" defaultValue="{{US_Address_CA.city}}"/> + <argument name="postcode" type="string" defaultValue="{{US_Address_CA.postcode}}"/> + <argument name="phone" type="string" defaultValue="{{US_Address_CA.telephone}}"/> + <argument name="fax" type="string" defaultValue=""/> + <argument name="vatNumber" type="string" defaultValue="{{US_With_Vat_Number.vat_id}}"/> + </arguments> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.NamePrefix}}" stepKey="getNamePrefix"/> + <assertEquals stepKey="assertNamePrefix"> + <expectedResult type="string">{{namePrefix}}</expectedResult> + <actualResult type="variable">getNamePrefix</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.FirstName}}" stepKey="getFirstName"/> + <assertEquals stepKey="assertFirstName"> + <expectedResult type="string">{{firstName}}</expectedResult> + <actualResult type="variable">getFirstName</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.MiddleName}}" stepKey="getMiddleName"/> + <assertEquals stepKey="assertMiddleName"> + <expectedResult type="string">{{middleName}}</expectedResult> + <actualResult type="variable">getMiddleName</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.LastName}}" stepKey="getLastName"/> + <assertEquals stepKey="assertLastName"> + <expectedResult type="string">{{lastName}}</expectedResult> + <actualResult type="variable">getLastName</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.NameSuffix}}" stepKey="getNameSuffix"/> + <assertEquals stepKey="assertNameSuffix"> + <expectedResult type="string">{{nameSuffix}}</expectedResult> + <actualResult type="variable">getNameSuffix</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.Company}}" stepKey="getCompany"/> + <assertEquals stepKey="assertCompany"> + <expectedResult type="string">{{company}}</expectedResult> + <actualResult type="variable">getCompany</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" stepKey="getStreetLine1"/> + <assertEquals stepKey="assertStreetLine1"> + <expectedResult type="string">{{streetLine1}}</expectedResult> + <actualResult type="variable">getStreetLine1</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.StreetLine2}}" stepKey="getStreetLine2"/> + <assertEquals stepKey="assertStreetLine2"> + <expectedResult type="string">{{streetLine2}}</expectedResult> + <actualResult type="variable">getStreetLine2</actualResult> + </assertEquals> + <grabTextFrom selector="{{AdminOrderFormBillingAddressSection.countrySelectedOption}}" stepKey="getCountrySelectedOption"/> + <assertEquals stepKey="assertCountrySelectedOption"> + <expectedResult type="string">{{country}}</expectedResult> + <actualResult type="variable">getCountrySelectedOption</actualResult> + </assertEquals> + <grabTextFrom selector="{{AdminOrderFormBillingAddressSection.stateSelectedOption}}" stepKey="getStateSelectedOption"/> + <assertEquals stepKey="assertStateSelectedOption"> + <expectedResult type="string">{{state}}</expectedResult> + <actualResult type="variable">getStateSelectedOption</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.Province}}" stepKey="getProvince"/> + <assertEquals stepKey="assertProvince"> + <expectedResult type="string">{{province}}</expectedResult> + <actualResult type="variable">getProvince</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.City}}" stepKey="getCity"/> + <assertEquals stepKey="assertCity"> + <expectedResult type="string">{{city}}</expectedResult> + <actualResult type="variable">getCity</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" stepKey="getPostCode"/> + <assertEquals stepKey="assertPostCode"> + <expectedResult type="string">{{postcode}}</expectedResult> + <actualResult type="variable">getPostCode</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.Phone}}" stepKey="getPhone"/> + <assertEquals stepKey="assertPhone"> + <expectedResult type="string">{{phone}}</expectedResult> + <actualResult type="variable">getPhone</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.Fax}}" stepKey="getFax"/> + <assertEquals stepKey="assertFax"> + <expectedResult type="string">{{fax}}</expectedResult> + <actualResult type="variable">getFax</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.VatNumber}}" stepKey="getVatNumber"/> + <assertEquals stepKey="assertVatNumber"> + <expectedResult type="string">{{vatNumber}}</expectedResult> + <actualResult type="variable">getVatNumber</actualResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminCreateOrderFormShippingAddressActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminCreateOrderFormShippingAddressActionGroup.xml new file mode 100644 index 000000000000..32cedca015c9 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminCreateOrderFormShippingAddressActionGroup.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * seeInField COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminCreateOrderFormShippingAddressActionGroup"> + <annotations> + <description>Verify shipping address inputs on admin create order page. Start on admin create new order page.</description> + </annotations> + <arguments> + <argument name="prefix" type="string" defaultValue="{{CustomerAddressSimple.prefix}}"/> + <argument name="firstname" type="string" defaultValue="{{CustomerAddressSimple.firstname}}"/> + <argument name="middleName" type="string" defaultValue="{{CustomerAddressSimple.middlename}}"/> + <argument name="lastname" type="string" defaultValue="{{CustomerAddressSimple.lastname}}"/> + <argument name="suffix" type="string" defaultValue="{{CustomerAddressSimple.suffix}}"/> + <argument name="company" type="string" defaultValue="{{CustomerAddressSimple.company}}"/> + <argument name="streetLine1" type="string" defaultValue="{{CustomerAddressSimple.street[0]}}"/> + <argument name="streetLine2" type="string" defaultValue="{{CustomerAddressSimple.street[1]}}"/> + <argument name="city" type="string" defaultValue="{{CustomerAddressSimple.city}}"/> + <argument name="countryId" type="string" defaultValue="{{CustomerAddressSimple.country_id}}"/> + <argument name="state" type="string" defaultValue="{{CustomerAddressSimple.state}}"/> + <argument name="province" type="string" defaultValue=""/> + <argument name="postcode" type="string" defaultValue="{{CustomerAddressSimple.postcode}}"/> + <argument name="telephone" type="string" defaultValue="{{CustomerAddressSimple.telephone}}"/> + <argument name="fax" type="string" defaultValue="{{CustomerAddressSimple.fax}}"/> + <argument name="vatNumber" type="string" defaultValue=""/> + </arguments> + + <waitForElementVisible selector="{{AdminOrderFormShippingAddressSection.NamePrefix}}" stepKey="waitForInputVisible"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.NamePrefix}}" userInput="{{prefix}}" stepKey="verifyPrefix"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.FirstName}}" userInput="{{firstname}}" stepKey="verifyFirstName"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.MiddleName}}" userInput="{{middleName}}" stepKey="verifyMiddleName"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.LastName}}" userInput="{{lastname}}" stepKey="verifyLastName"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.NameSuffix}}" userInput="{{suffix}}" stepKey="verifySuffix"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.Company}}" userInput="{{company}}" stepKey="verifyCompany"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.StreetLine1}}" userInput="{{streetLine1}}" stepKey="verifyStreetLine1"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.StreetLine2}}" userInput="{{streetLine2}}" stepKey="verifyStreetLine2"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.City}}" userInput="{{city}}" stepKey="verifyCity"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.Country}}" userInput="{{countryId}}" stepKey="verifyCountry"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.State}}" userInput="{{state}}" stepKey="verifyState"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.Province}}" userInput="{{province}}" stepKey="verifyProvince"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.PostalCode}}" userInput="{{postcode}}" stepKey="verifyPostalCode"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.Phone}}" userInput="{{telephone}}" stepKey="verifyPhone"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.Fax}}" userInput="{{fax}}" stepKey="verifyFax"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.VatNumber}}" userInput="{{vatNumber}}" stepKey="verifyVatNumber"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminPaymentMethodRadioButtonExistsOnCreateOrderPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminPaymentMethodRadioButtonExistsOnCreateOrderPageActionGroup.xml new file mode 100644 index 000000000000..1f2076a4d73d --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminPaymentMethodRadioButtonExistsOnCreateOrderPageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminPaymentMethodRadioButtonExistsOnCreateOrderPageActionGroup"> + <annotations> + <description>Checks the provided payment method radio button presents on the Admin Create Order page.</description> + </annotations> + <arguments> + <argument name="paymentMethodName" type="string" defaultValue="Check / Money order"/> + </arguments> + + <conditionalClick selector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" dependentSelector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" visible="true" stepKey="clickGetAvailablePaymentMethods"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> + <seeElement selector="{{AdminOrderFormPaymentSection.paymentLabelWithRadioButton(paymentMethodName)}}" stepKey="seeLabelWithRadioButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressInformationActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressInformationActionGroup.xml index db3343794de0..3c2a5d7de065 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressInformationActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressInformationActionGroup.xml @@ -7,7 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AssertOrderAddressInformationActionGroup" extends="VerifyBasicOrderInformationActionGroup"> <remove keyForRemoval="seeCustomerName"/> <remove keyForRemoval="seeCustomerEmail"/> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressWithStateInformationActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressWithStateInformationActionGroup.xml new file mode 100644 index 000000000000..3b3c6fc4472e --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressWithStateInformationActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertOrderAddressWithStateInformationActionGroup" extends="VerifyBasicOrderInformationActionGroup"> + <remove keyForRemoval="seeCustomerName"/> + <remove keyForRemoval="seeCustomerEmail"/> + <remove keyForRemoval="seeCustomerGroup"/> + <remove keyForRemoval="seeBillingAddressCountry"/> + <remove keyForRemoval="seeShippingAddressCountry"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.state}}" stepKey="seeBillingAddressState"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.state}}" stepKey="seeShippingAddressState"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Data/CancelOrderData.xml b/app/code/Magento/Sales/Test/Mftf/Data/CancelOrderData.xml new file mode 100644 index 000000000000..d50a262a2f8b --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Data/CancelOrderData.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + + <entity name="CancelOrder" type="CancelOrder"> + <var key="quote_id" entityKey="return" entityType="CustomerCart"/> + </entity> + +</entities> diff --git a/app/code/Magento/Sales/Test/Mftf/Data/HoldOrderData.xml b/app/code/Magento/Sales/Test/Mftf/Data/HoldOrderData.xml new file mode 100644 index 000000000000..35b72f31f59a --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Data/HoldOrderData.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + + <entity name="HoldOrder" type="HoldOrder"> + <var key="quote_id" entityKey="return" entityType="CustomerCart"/> + </entity> + +</entities> diff --git a/app/code/Magento/Sales/Test/Mftf/Metadata/CancelOrderMeta.xml b/app/code/Magento/Sales/Test/Mftf/Metadata/CancelOrderMeta.xml new file mode 100644 index 000000000000..c874b5a2118d --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Metadata/CancelOrderMeta.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> + <operation name="CreateCancelOrder" dataType="CancelOrder" type="create" auth="adminOauth" url="V1/orders/{return}/cancel" method="POST"> + <contentType>application/json</contentType> + <object key="cartItem" dataType="CartItem"> + <field key="quote_id">string</field> + </object> + </operation> +</operations> diff --git a/app/code/Magento/Sales/Test/Mftf/Metadata/HoldOrderMeta.xml b/app/code/Magento/Sales/Test/Mftf/Metadata/HoldOrderMeta.xml new file mode 100644 index 000000000000..66036419815f --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Metadata/HoldOrderMeta.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> + <operation name="CreateHoldOrder" dataType="HoldOrder" type="create" auth="adminOauth" url="V1/orders/{return}/hold" method="POST"> + <contentType>application/json</contentType> + <object key="cartItem" dataType="CartItem"> + <field key="quote_id">string</field> + </object> + </operation> +</operations> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminCustomerConfigAddressTemplateSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminCustomerConfigAddressTemplateSection.xml new file mode 100644 index 000000000000..711d8b14f691 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminCustomerConfigAddressTemplateSection.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminCustomerConfigAddressTemplateSection"> + <element name="addressTemplatesTab" type="button" selector=".entry-edit-head #customer_address_templates-head" timeout="30"/> + <element name="addressTemplatesTabIsOpen" type="button" selector="//*[@class='entry-edit-head admin__collapsible-block']/a[@id='customer_address_templates-head' and @class='open']" timeout="30"/> + <element name="addressTemplateTypeDefaultCheckbox" type="checkbox" selector="#row_customer_address_templates_{{type_of_template}} #customer_address_templates_{{type_of_template}}_inherit" timeout="30" parameterized="true"/> + <element name="addressTemplateTypeValueInput" type="input" selector="#row_customer_address_templates_{{type_of_template}} #customer_address_templates_{{type_of_template}}" parameterized="true"/> + </section> +</sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoicesGridSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoicesGridSection.xml index d4c4a9a0106e..5b33008e9aad 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoicesGridSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoicesGridSection.xml @@ -13,5 +13,7 @@ <element name="filter" type="button" selector="#container > div > div.admin__data-grid-header > div:nth-child(1) > div.data-grid-filters-actions-wrap > div > button"/> <element name="firstRow" type="button" selector="tr.data-row:nth-of-type(1)"/> <element name="clearFilters" type="button" selector="button.action-clear" timeout="30"/> + <element name="selectActions" type="button" selector=".action-select-wrap > .action-select" timeout="30"/> + <element name="dropdownActionItem" type="button" selector="(//div[contains(@class, 'action-select-wrap')]//span[text()='{{action}}'])[1]" timeout="30" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormBillingAddressSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormBillingAddressSection.xml index 279cf1dde15b..391cc7ec999a 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormBillingAddressSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormBillingAddressSection.xml @@ -20,7 +20,9 @@ <element name="StreetLine2" type="input" selector="#order-billing_address_street1" timeout="30"/> <element name="City" type="input" selector="#order-billing_address_city" timeout="30"/> <element name="Country" type="select" selector="#order-billing_address_country_id" timeout="30"/> + <element name="countrySelectedOption" type="select" selector="#order-billing_address_country_id option:checked"/> <element name="State" type="select" selector="#order-billing_address_region_id" timeout="30"/> + <element name="stateSelectedOption" type="select" selector="#order-billing_address_region_id option:checked"/> <element name="Province" type="input" selector="#order-billing_address_region" timeout="30"/> <element name="PostalCode" type="input" selector="#order-billing_address_postcode" timeout="30"/> <element name="Phone" type="input" selector="#order-billing_address_telephone" timeout="30"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml index 4f065ec7eb74..2e9b8b18d058 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminOrderFormConfigureProductSection"> <element name="configure" type="button" selector="//a[@product_id='{{productId}}']" parameterized="true"/> - <element name="optionSelect" type="select" selector="//div[contains(@class,'product-options')]//select[//label[text() = '{{option}}']]" parameterized="true"/> + <element name="optionSelect" type="select" selector="//div[contains(@class,'product-options')]//select[//label[text() = '{{option}}']]" timeout="30" parameterized="true"/> <element name="optionSelectNew" type="select" selector="//label[text()='{{option1}}']/following-sibling::div/select" parameterized="true"/> <element name="quantity" type="input" selector="#product_composite_configure_input_qty"/> <element name="ok" type="button" selector=".modal-header .page-actions button[data-role='action']" timeout="30"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml index fae0bd458958..5736b6b80b69 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml @@ -11,7 +11,7 @@ <section name="AdminOrderFormItemsOrderedSection"> <element name="addProductsBySku" type="button" selector="//section[@id='order-items']//span[contains(text(),'Add Products By SKU')]"/> <element name="configureButtonBySku" type="button" selector="//div[@class='sku-configure-button']//span[contains(text(),'Configure')]"/> - <element name="configureProductOk" type="button" selector="//div[@class='page-main-actions']//span[contains(text(),'OK')]"/> + <element name="configureProductOk" type="button" selector="//div[@class='page-main-actions']//span[contains(text(),'OK')]" timeout="30"/> <element name="configureProductQtyField" type="input" selector="//*[@id='super-product-table']/tbody/tr[{{arg}}]/td[5]/input[1]" parameterized="true"/> <element name="addProductToOrder" type="input" selector="//*[@title='Add Products to Order']" timeout="30"/> <element name="itemsOrderedSummaryText" type="textarea" selector="//table[@class='data-table admin__table-primary order-tables']/tfoot/tr"/> @@ -19,5 +19,6 @@ <element name="itemsSKU" type="text" selector="(//div[contains(@class, 'product-sku-block')])[{{productNumber}}]" parameterized="true"/> <element name="moveProduct" type="select" selector="//td[contains(.,'{{productName}}')]/../..//td//select" parameterized="true"/> <element name="productMessage" type="text" selector="//section[@id = 'order-items']//span[text()='{{productName}}']/ancestor::tr/..//div[contains(@class, 'message-{{messageType}}')]" parameterized="true"/> + <element name="productPrice" type="text" selector="//div[@id = 'order-errors']//strong[text()='{{productName}}']/ancestor::tr/td[@data-column='price']" timeout="30" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormPaymentSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormPaymentSection.xml index 72fe45465c67..f17172a1f75c 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormPaymentSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormPaymentSection.xml @@ -29,5 +29,6 @@ <element name="purchaseOrderOption" type="radio" selector="#p_method_purchaseorder" timeout="30"/> <element name="purchaseOrderNumber" type="input" selector="#po_number"/> <element name="freePaymentLabel" type="text" selector="#order-billing_method_form label[for='p_method_free']"/> + <element name="paymentLabelWithRadioButton" type="text" selector="#order-billing_method_form .admin__field-option input[title='{{paymentMethodName}}'] + label" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml index a6b856f9f814..6434a4358711 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml @@ -19,15 +19,15 @@ <element name="website" type="radio" selector="//label[contains(text(), '{{arg}}')]" parameterized="true"/> <element name="addProducts" type="button" selector="#add_products" timeout="60"/> - <element name="selectProduct" type="checkbox" selector="//td[contains(text(), '{{arg}}')]/following-sibling::td[contains(@class, 'col-select col-in_products')]/label/input" parameterized="true"/> - <element name="setQuantity" type="checkbox" selector="//td[contains(text(), '{{arg}}')]/following-sibling::td[contains(@class, 'col-qty')]/input" parameterized="true"/> + <element name="selectProduct" type="checkbox" selector="//td[contains(., '{{arg}}')]/following-sibling::td[contains(@class, 'col-select col-in_products')]/label/input" parameterized="true"/> + <element name="setQuantity" type="checkbox" selector="//td[contains(., '{{arg}}')]/following-sibling::td[contains(@class, 'col-qty')]/input" parameterized="true"/> <element name="addProductsToOrder" type="button" selector="//span[text()='Add Selected Product(s) to Order']"/> - <element name="customPrice" type="checkbox" selector="//span[text()='{{arg}}']/parent::td/following-sibling::td/div//span[contains(text(),'Custom Price')]" parameterized="true"/> - <element name="customQuantity" type="input" selector="//span[text()='{{arg}}']/parent::td/following-sibling::td[@class='col-qty']/input" parameterized="true"/> + <element name="customPrice" type="checkbox" selector="//span[.='{{arg}}']/parent::td/following-sibling::td/div//span[contains(text(),'Custom Price')]" parameterized="true"/> + <element name="customQuantity" type="input" selector="//span[.='{{arg}}']/parent::td/following-sibling::td[@class='col-qty']/input" parameterized="true"/> <element name="update" type="button" selector="//span[text()='Update Items and Quantities']"/> - <element name="discount" type="text" selector="//span[text()='{{arg}}']/parent::td/following-sibling::td[@class='col-discount col-price']/span" parameterized="true"/> - <element name="productPrice" type="text" selector="//span[text()='{{arg}}']/parent::td/following-sibling::td[@class='col-price col-row-subtotal']/span" parameterized="true"/> - <element name="removeItems" type="select" selector="//span[text()='{{arg}}']/parent::td/following-sibling::td/select[@class='admin__control-select']" parameterized="true"/> + <element name="discount" type="text" selector="//span[.='{{arg}}']/parent::td/following-sibling::td[@class='col-discount col-price']/span" parameterized="true"/> + <element name="productPrice" type="text" selector="//span[.='{{arg}}']/parent::td/following-sibling::td[@class='col-price col-row-subtotal']/span" parameterized="true"/> + <element name="removeItems" type="select" selector="//span[.='{{arg}}']/parent::td/following-sibling::td/select[@class='admin__control-select']" parameterized="true"/> <element name="applyCoupon" type="input" selector="#coupons:code"/> <element name="submitOrder" type="button" selector="#submit_order_top_button" timeout="60"/> </section> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml index 12beba19b437..7cf0bf1a15cc 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml @@ -20,5 +20,6 @@ <element name="paymentMethod" type="text" selector=".box-order-billing-method dt.title"/> <element name="shippingMethod" type="text" selector=".box-order-shipping-method div.box-content"/> <element name="productNameCell" type="text" selector="//*[contains(@class, 'product-item-name')]"/> - </section> + <element name="shippingAddressBlock" type="block" selector=".block-order-details-view .box-order-shipping-address .box-content"/> + </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml index afede9755651..140a54b4b6e1 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml @@ -25,9 +25,7 @@ </createData> <!-- Enable *Free Shipping* --> <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> @@ -39,9 +37,7 @@ <actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer"> <argument name="customerEmail" value="Simple_US_Customer.email"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> -</actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/> </after> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml index 7d6e2048c943..ca3a9724e36e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml @@ -94,12 +94,8 @@ <requiredEntity createDataKey="createConfigProduct"/> <requiredEntity createDataKey="createConfigChildProduct1"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml index 9f09a59fa8d5..1a785616a910 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml @@ -35,12 +35,8 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct"> <field key="price">10.00</field> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set {{DisablePurchaseOrderConfigData.path}} {{DisablePurchaseOrderConfigData.value}}" stepKey="disablePurchaseOrderPayment"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckNewCreditMemoTotalsForFranceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckNewCreditMemoTotalsForFranceTest.xml index 03691cdd537d..41e8df9370b5 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckNewCreditMemoTotalsForFranceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckNewCreditMemoTotalsForFranceTest.xml @@ -8,7 +8,7 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminCheckNewCreditMemoTotalsForFranceTest" extends="AdminCreateCreditMemoWithCashOnDeliveryTest"> + <test name="AdminCheckNewCreditMemoTotalsForFranceTest" extends="AdminCreateCreditMemoForOrderWithCashOnDeliveryTest"> <annotations> <stories value="Credit memo entity for France locale"/> <title value="Credit memo entity for France locale"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml index 37a4782ce2e7..03dd8b28a624 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml @@ -20,44 +20,61 @@ <group value="sales"/> </annotations> <before> - <!--Create product--> <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> - <!--Create customer--> + <createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/> - <!--Login to admin page--> + + <createData entity="CustomerCart" stepKey="createCustomerCart"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + + <createData entity="CustomerCartItem" stepKey="addCartItem"> + <requiredEntity createDataKey="createCustomerCart"/> + <requiredEntity createDataKey="createSimpleProduct"/> + </createData> + + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + + <updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformation"> + <requiredEntity createDataKey="createCustomerCart"/> + </updateData> + + <createData entity="Invoice" stepKey="invoiceOrderOne"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> - <!--Delete simple product--> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> - <!--Delete customer--> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <actionGroup ref="CreateOrderActionGroup" stepKey="createOrder"> - <argument name="product" value="$$createSimpleProduct$$"/> - <argument name="customer" value="$$createCustomer$$"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="createOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="grabOrderId"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="startCreateInvoice"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="submitInvoice"/> + + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCart.return$)}}" stepKey="getOrderId"/> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrdersGridById"> + <argument name="orderId" value="{$getOrderId}"/> </actionGroup> - <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> - <!--Create invoice--> - <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startCreateInvoice"/> - <!--Submit invoice--> - <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> - <!--Create Credit Memo--> <actionGroup ref="StartToCreateCreditMemoActionGroup" stepKey="startToCreateCreditMemo"> - <argument name="orderId" value="{$grabOrderId}"/> + <argument name="orderId" value="{$getOrderId}"/> </actionGroup> <fillField selector="{{AdminCreditMemoTotalSection.refundShipping}}" userInput="0" stepKey="setRefundShipping"/> <actionGroup ref="UpdateCreditMemoTotalsActionGroup" stepKey="updateCreditMemoTotals"/> <actionGroup ref="SubmitCreditMemoActionGroup" stepKey="submitCreditMemo"/> - <!--Go to Credit Memo tab--> <click selector="{{AdminOrderDetailsOrderViewSection.creditMemos}}" stepKey="clickCreditMemosTab"/> <waitForPageLoad stepKey="waitForCreditMemosGridToLoad"/> - <!--Check refunded total --> <see selector="{{AdminOrderCreditMemosTabSection.gridRow('1')}}" userInput="$123" stepKey="seeCreditMemoInGrid"/> </test> </tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingFieldsFilledFromDefaultBillingAddressCustomerInNewOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingFieldsFilledFromDefaultBillingAddressCustomerInNewOrderTest.xml new file mode 100644 index 000000000000..4d50217d3615 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingFieldsFilledFromDefaultBillingAddressCustomerInNewOrderTest.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCheckingFieldsFilledFromDefaultBillingAddressCustomerInNewOrderTest"> + <annotations> + <features value="Sales"/> + <stories value="Create order in Admin"/> + <title value="Checking fields filled from default billing address customer"/> + <description value="Checking fields filled from default billing address customer on create new order page"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-40646"/> + <useCaseId value="MC-37657"/> + <group value="sales"/> + <group value="customer"/> + </annotations> + <before> + <createData entity="Customer_With_Vat_Number" stepKey="createCustomer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + </after> + + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> + <argument name="customer" value="$createCustomer$"/> + </actionGroup> + <actionGroup ref="AssertAdminBillingAddressFieldsOnOrderCreateFormActionGroup" stepKey="assertFieldsFilled"/> + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingPaymentMethodRadioButtonPresentAfterReloadOrderPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingPaymentMethodRadioButtonPresentAfterReloadOrderPageTest.xml new file mode 100644 index 000000000000..c29b2aa167ed --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingPaymentMethodRadioButtonPresentAfterReloadOrderPageTest.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCheckingPaymentMethodRadioButtonPresentAfterReloadOrderPageTest"> + <annotations> + <features value="Sales"/> + <stories value="Create order in Admin"/> + <title value="Checking payment method radio button is presented after reloading the order page"/> + <description value="Checking payment method radio button is presented after reloading the order page"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-40878"/> + <useCaseId value="MC-40013"/> + <group value="sales"/> + </annotations> + <before> + <!-- Enable Check/Money order payment method --> + <magentoCLI command="config:set {{EnablePaymentCheckMOConfigData.path}} {{EnablePaymentCheckMOConfigData.value}}" stepKey="enableCheckMoneyOrderPayment"/> + <!-- Enable Bank Transfer Payment method --> + <magentoCLI command="config:set {{EnablePaymentBankTransferConfigData.path}} {{EnablePaymentBankTransferConfigData.value}}" stepKey="enableBankTransferPayment"/> + <!-- Create simple product --> + <createData entity="SimpleProduct2" stepKey="createProduct"/> + <!-- Create customer --> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <!-- Login to Admin page --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <!-- Disable Bank Transfer Payment method --> + <magentoCLI command="config:set {{DisablePaymentBankTransferConfigData.path}} {{DisablePaymentBankTransferConfigData.value}}" stepKey="disableBankTransferPayment"/> + <!-- Delete entities --> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <!-- Logout from Admin page --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Create new order --> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> + <argument name="customer" value="$createCustomer$"/> + </actionGroup> + + <!-- Add Simple product to order --> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> + <argument name="product" value="$createProduct$"/> + </actionGroup> + + <!-- Assert label with radio button presents on the page --> + <actionGroup ref="AssertAdminPaymentMethodRadioButtonExistsOnCreateOrderPageActionGroup" stepKey="assertCheckMORadioButtonIsPresent"/> + <actionGroup ref="AssertAdminPaymentMethodRadioButtonExistsOnCreateOrderPageActionGroup" stepKey="assertBankTransferRadioButtonIsPresent"> + <argument name="paymentMethodName" value="Bank Transfer Payment"/> + </actionGroup> + + <actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/> + + <!-- Assert label with radio button presents after reload the page --> + <actionGroup ref="AssertAdminPaymentMethodRadioButtonExistsOnCreateOrderPageActionGroup" stepKey="assertCheckMORadioButtonIsPresentAfterReload"/> + <actionGroup ref="AssertAdminPaymentMethodRadioButtonExistsOnCreateOrderPageActionGroup" stepKey="assertBankTransferRadioButtonIsPresentAfterReload"> + <argument name="paymentMethodName" value="Bank Transfer Payment"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml index 33bc1a39ca11..3a87c5fe6338 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml @@ -57,16 +57,13 @@ </actionGroup> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> - <!--Run re-index task--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Go to bundle product page--> - <amOnPage url="{{StorefrontProductPage.url($$createCategory.name$$)}}" stepKey="navigateToBundleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToBundleProductPage"/> <!--Place order bundle product with 10 options--> - <actionGroup ref="StorefrontAddCategoryBundleProductToCartActionGroup" stepKey="addBundleProductToCart"> + <actionGroup ref="StorefrontAddCategoryBundleProductWithSingleChoiceToCartActionGroup" stepKey="addBundleProductToCart"> <argument name="product" value="$$createBundleProduct$$"/> <argument name="quantity" value="10"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoForOrderWithCashOnDeliveryTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoForOrderWithCashOnDeliveryTest.xml new file mode 100644 index 000000000000..7709b847b996 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoForOrderWithCashOnDeliveryTest.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCreateCreditMemoForOrderWithCashOnDeliveryTest"> + <annotations> + <stories value="Credit memo entity"/> + <title value="Create Credit Memo with cash on delivery payment method"/> + <description value="Create Credit Memo with cash on delivery payment and assert 0 shipping refund"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-15863"/> + <group value="sales"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="defaultSimpleProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <magentoCLI command="config:set {{enabledCashOnDeliveryPayment.label}} {{enabledCashOnDeliveryPayment.value}}" stepKey="enableBankTransfer"/> + + <createData entity="CustomerCart" stepKey="createCustomerCart"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + + <createData entity="CustomerCartItem" stepKey="addCartItem"> + <requiredEntity createDataKey="createCustomerCart"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + + <updateData createDataKey="createCustomerCart" entity="CashOnDeliveryOrderPaymentMethod" stepKey="sendCustomerPaymentInformation"> + <requiredEntity createDataKey="createCustomerCart"/> + </updateData> + + <createData entity="Invoice" stepKey="invoiceOrderOne"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + + </before> + <after> + <magentoCLI command="config:set {{disabledCashOnDeliveryPayment.label}} {{disabledCashOnDeliveryPayment.value}}" stepKey="disableBankTransfer"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCart.return$)}}" stepKey="grabOrderId"/> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrdersGridById"> + <argument name="orderId" value="{$grabOrderId}"/> + </actionGroup> + + <actionGroup ref="AdminOpenAndFillCreditMemoRefundActionGroup" stepKey="fillCreditMemoRefund"> + <argument name="itemQtyToRefund" value="1"/> + <argument name="shippingRefund" value="0"/> + <argument name="adjustmentRefund" value="5"/> + <argument name="adjustmentFee" value="10"/> + </actionGroup> + + <actionGroup ref="AdminClickRefundOfflineOnCreditMemoDetailPageActionGroup" stepKey="clickRefundOffline"/> + + <actionGroup ref="AdminOpenCreditMemoFromOrderPageActionGroup" stepKey="openCreditMemo"/> + + <actionGroup ref="AssertAdminCreditMemoViewPageTotalsActionGroup" stepKey="assertCreditMemoViewPageTotals"> + <argument name="subtotal" value="$560.00"/> + <argument name="adjustmentRefund" value="$5.00"/> + <argument name="adjustmentFee" value="$10.00"/> + <argument name="grandTotal" value="$555.00"/> + </actionGroup> + + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + + <actionGroup ref="StorefrontGoToCustomerOrderDetailsPageActionGroup" stepKey="openOrderDetailPage"> + <argument name="orderId" value="$createCustomerCart.return$"/> + <argument name="orderNumber" value="{$grabOrderId}"/> + </actionGroup> + + <actionGroup ref="StorefrontClickRefundTabCustomerOrderViewActionGroup" stepKey="clickRefund"/> + <see selector="{{StorefrontCustomerOrderSection.grandTotalRefund}}" userInput="555.00" stepKey="seeGrandTotal"/> + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml index a1027a9987b1..5ff2f19d797b 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml @@ -8,15 +8,18 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminCreateCreditMemoWithCashOnDeliveryTest"> + <test name="AdminCreateCreditMemoWithCashOnDeliveryTest" deprecated="Use AdminCreateCreditMemoForOrderWithCashOnDeliveryTest instead"> <annotations> <stories value="Credit memo entity"/> - <title value="Create Credit Memo with cash on delivery payment method"/> + <title value="DEPRECATED. Create Credit Memo with cash on delivery payment method"/> <description value="Create Credit Memo with cash on delivery payment and assert 0 shipping refund"/> <severity value="CRITICAL"/> <testCaseId value="MC-15863"/> <group value="sales"/> <group value="mtf_migrated"/> + <skip> + <issueId value="DEPRECATED">Use AdminCreateCreditMemoForOrderWithCashOnDeliveryTest instead</issueId> + </skip> </annotations> <before> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml index 96007caf0f8b..b0af455ebd93 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml @@ -19,7 +19,7 @@ <group value="sales"/> <skip> <issueId value="DEPRECATED">Use AdminInvoiceOrderTest instead</issueId> - </skip> + </skip> </annotations> <before> <createData entity="_defaultCategory" stepKey="createCategory"/> @@ -34,7 +34,7 @@ </after> <!-- todo: Create an order via the api instead of driving the browser --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml index 23dca916781f..f3ce8106c273 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml @@ -26,8 +26,8 @@ </after> <!-- Go to new order status page --> - <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> - <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> + <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> + <actionGroup ref="AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup" stepKey="clickCreateNewStatus"/> <!-- Fill the form and validate message --> <actionGroup ref="AdminOrderStatusFormFillAndSave" stepKey="fillFormAndClickSave"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml index d3cd3e8b8549..f8e7be5fdb5b 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml @@ -26,8 +26,8 @@ </after> <!-- Go to new order status page --> - <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> - <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> + <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> + <actionGroup ref="AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup" stepKey="clickCreateNewStatus"/> <!-- Fill the form and validate message --> <actionGroup ref="AdminOrderStatusFormFillAndSave" stepKey="fillFormAndClickSave"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml index a30040045a4c..c5fc6170d278 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml @@ -26,8 +26,8 @@ </after> <!-- Go to new order status page --> - <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> - <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> + <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> + <actionGroup ref="AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup" stepKey="clickCreateNewStatus"/> <!-- Fill the form and validate message --> <actionGroup ref="AdminOrderStatusFormFillAndSave" stepKey="fillFormAndClickSave"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithCustomerWithoutEmailTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithCustomerWithoutEmailTest.xml index 68a8e9d347dd..3b782aa4e22f 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithCustomerWithoutEmailTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithCustomerWithoutEmailTest.xml @@ -24,9 +24,7 @@ <requiredEntity createDataKey="category"/> </createData> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!--Clean up created test data.--> @@ -35,9 +33,7 @@ <!--Enable required 'email' field on create order page.--> <magentoCLI command="config:set {{EnableEmailRequiredForOrder.path}} {{EnableEmailRequiredForOrder.value}}" stepKey="enableRequiredFieldEmailForAdminOrderCreation"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <!--Create order.--> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml index bf8e7e186818..741928d3baa8 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml @@ -28,9 +28,7 @@ <createData entity="FreeShippinMethodConfig" stepKey="enableFreeShippingMethod"/> <createData entity="setFreeShippingSubtotal" stepKey="setFreeShippingSubtotal"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> @@ -40,9 +38,7 @@ <createData entity="FreeShippinMethodDefault" stepKey="disableFreeShippingMethod"/> <createData entity="setFreeShippingSubtotalToDefault" stepKey="setFreeShippingSubtotalToDefault"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <!--Create new order with existing customer--> <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="goToCreateOrderPage"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminInvoiceOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminInvoiceOrderTest.xml index 922037fe4a3c..c33dd04aa1b2 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminInvoiceOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminInvoiceOrderTest.xml @@ -18,8 +18,7 @@ <testCaseId value="MAGETWO-72096"/> <group value="sales"/> </annotations> - - <before> + <before> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="_defaultProduct" stepKey="createSimpleProductApi"> <requiredEntity createDataKey="createCategory"/> @@ -34,33 +33,31 @@ </createData> <updateData createDataKey="createGuestCart" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformation"> <requiredEntity createDataKey="createGuestCart"/> - </updateData> + </updateData> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> - </before> - <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createSimpleProductApi" stepKey="deleteSimpleProductApi"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> - <actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openOrder"> <argument name="entityId" value="$createGuestCart.return$"/> - </actionGroup> + </actionGroup> + + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.orderId}}" stepKey="grabOrderId"/> <actionGroup ref="AdminCreateInvoiceActionGroup" stepKey="createInvoice"/> <actionGroup ref="FilterInvoiceGridByOrderIdWithCleanFiltersActionGroup" stepKey="filterInvoiceGridByOrderId"> - <argument name="orderId" value="$createGuestCart.return$"/> + <argument name="orderId" value="$grabOrderId"/> </actionGroup> <actionGroup ref="AdminSelectFirstGridRowActionGroup" stepKey="openInvoiceFromGrid"/> <actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="checkIfOrderStatusIsProcessing"> <argument name="status" value="Processing"/> - </actionGroup> - + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndProcessingTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndProcessingTest.xml new file mode 100644 index 000000000000..2671cd6989c5 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndProcessingTest.xml @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminMassOrdersCancelClosedAndProcessingTest"> + <annotations> + <stories value="Mass Update Orders"/> + <title value="Mass cancel orders in status Processing, Closed"/> + <description value="Try to cancel orders in status Processing, Closed"/> + <severity value="MAJOR"/> + <testCaseId value="MC-16184"/> + <group value="sales"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="defaultSimpleProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <createData entity="CustomerCart" stepKey="createCustomerCartOne"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItemOne"> + <requiredEntity createDataKey="createCustomerCartOne"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCartOne"/> + </createData> + <updateData createDataKey="createCustomerCartOne" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformationOne"> + <requiredEntity createDataKey="createCustomerCartOne"/> + </updateData> + <createData entity="Invoice" stepKey="invoiceOrderOne"> + <requiredEntity createDataKey="createCustomerCartOne"/> + </createData> + + <createData entity="CustomerCart" stepKey="createCustomerCartTwo"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItemTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddressTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </createData> + <updateData createDataKey="createCustomerCartTwo" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformationTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </updateData> + <createData entity="Invoice" stepKey="invoiceOrderTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </createData> + <createData entity="CreditMemo" stepKey="refundOrderTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </createData> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCartOne.return$)}}" stepKey="getFirstOrderId"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCartTwo.return$)}}" stepKey="getSecondOrderId"/> + + <actionGroup ref="AdminTwoOrderActionOnGridActionGroup" stepKey="massActionCancel"> + <argument name="action" value="Cancel"/> + <argument name="orderId" value="{$getFirstOrderId}"/> + <argument name="secondOrderId" value="{$getSecondOrderId}"/> + </actionGroup> + <see userInput="You cannot cancel the order(s)." stepKey="assertOrderCancelMassActionFailMessage"/> + + <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder"> + <argument name="orderId" value="{$getFirstOrderId}"/> + <argument name="orderStatus" value="Processing"/> + </actionGroup> + <see userInput="{$getFirstOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertFirstOrderID"/> + <see userInput="Processing" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertFirstOrderStatus"/> + + <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeSecondOrder"> + <argument name="orderId" value="{$getSecondOrderId}"/> + <argument name="orderStatus" value="Closed"/> + </actionGroup> + <see userInput="{$getSecondOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertSecondOrderID"/> + <see userInput="Closed" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertSecondStatus"/> + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelProcessingAndClosedTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelProcessingAndClosedTest.xml index 6eb419552422..3400e07373f5 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelProcessingAndClosedTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelProcessingAndClosedTest.xml @@ -8,15 +8,18 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminMassOrdersCancelProcessingAndClosedTest"> + <test name="AdminMassOrdersCancelProcessingAndClosedTest" deprecated="Use AdminMassOrdersCancelClosedAndProcessingTest instead"> <annotations> <stories value="Mass Update Orders"/> - <title value="Mass cancel orders in status Processing, Closed"/> + <title value="DEPRECATED. Mass cancel orders in status Processing, Closed"/> <description value="Try to cancel orders in status Processing, Closed"/> <severity value="MAJOR"/> <testCaseId value="MC-16184"/> <group value="sales"/> <group value="mtf_migrated"/> + <skip> + <issueId value="DEPRECATED">Use AdminMassOrdersCancelClosedAndProcessingTest instead</issueId> + </skip> </annotations> <before> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnCompleteTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnCompleteTest.xml index 41964cbf605d..592c8b7981be 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnCompleteTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnCompleteTest.xml @@ -21,7 +21,6 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> - <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="defaultSimpleProduct" stepKey="createProduct"> @@ -29,43 +28,49 @@ </createData> </before> <after> - <!-- Delete data --> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Create order --> - <actionGroup ref="CreateOrderActionGroup" stepKey="createFirstOrder"> - <argument name="product" value="$$createProduct$$"/> - <argument name="customer" value="$$createCustomer$$"/> - </actionGroup> - <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/> - <assertNotEmpty stepKey="assertOrderIdIsNotEmpty" after="getOrderId"> - <actualResult type="const">$getOrderId</actualResult> - </assertNotEmpty> - - <!-- Create Shipment for Order --> - <actionGroup ref="AdminCreateInvoiceAndShipmentActionGroup" stepKey="createShipment"/> + <createData entity="CustomerCart" stepKey="createCustomerCart"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItem"> + <requiredEntity createDataKey="createCustomerCart"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="createFirstOrder"> + <requiredEntity createDataKey="createCustomerCart"/> + </updateData> + <createData entity="Invoice" stepKey="invoiceOrder"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="getOrderId"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertOrderIdIsNotEmpty"/> + <createData entity="Shipment" stepKey="createShipment"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> - <!-- Navigate to backend: Go to Sales > Orders --> <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCart.return$)}}" stepKey="grabOrderId"/> - <!-- Select Mass Action according to dataset: Hold --> <actionGroup ref="AdminOrderActionOnGridActionGroup" stepKey="actionHold"> <argument name="action" value="Hold"/> - <argument name="orderId" value="$getOrderId"/> + <argument name="orderId" value="$grabOrderId"/> </actionGroup> <see userInput="No order(s) were put on hold." stepKey="assertOrderOnHoldFailMessage"/> - <!--Assert order in orders grid --> <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder"> - <argument name="orderId" value="{$getOrderId}"/> + <argument name="orderId" value="{$grabOrderId}"/> <argument name="orderStatus" value="Complete"/> </actionGroup> - <see userInput="{$getOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertOrderID"/> + <see userInput="{$grabOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertOrderID"/> <see userInput="Complete" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertOrderStatus"/> </test> </tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnPendingAndProcessingTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnPendingAndProcessingTest.xml index 2a4ad174abae..7e6fe8fd6ca9 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnPendingAndProcessingTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnPendingAndProcessingTest.xml @@ -8,15 +8,18 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminMassOrdersHoldOnPendingAndProcessingTest"> + <test name="AdminMassOrdersHoldOnPendingAndProcessingTest" deprecated="Use AdminMassOrdersHoldOnProcessingAndPendingTest"> <annotations> <stories value="Mass Update Orders"/> - <title value="Mass put orders in statuses Pending, Processing on Hold"/> + <title value="DEPRECATED. Mass put orders in statuses Pending, Processing on Hold"/> <description value="Put orders in statuses Pending, Processing on Hold"/> <severity value="MAJOR"/> <testCaseId value="MC-16185"/> <group value="sales"/> <group value="mtf_migrated"/> + <skip> + <issueId value="DEPRECATED">Use AdminMassOrdersHoldOnProcessingAndPendingTest</issueId> + </skip> </annotations> <before> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnProcessingAndPendingTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnProcessingAndPendingTest.xml new file mode 100644 index 000000000000..97970cb5deed --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnProcessingAndPendingTest.xml @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminMassOrdersHoldOnProcessingAndPendingTest"> + <annotations> + <stories value="Mass Update Orders"/> + <title value="Mass put orders in statuses Pending, Processing on Hold"/> + <description value="Put orders in statuses Pending, Processing on Hold"/> + <severity value="MAJOR"/> + <testCaseId value="MC-16185"/> + <group value="sales"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="defaultSimpleProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <createData entity="CustomerCart" stepKey="createCustomerCartOne"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItemOne"> + <requiredEntity createDataKey="createCustomerCartOne"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCartOne"/> + </createData> + <updateData createDataKey="createCustomerCartOne" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformationOne"> + <requiredEntity createDataKey="createCustomerCartOne"/> + </updateData> + + <createData entity="CustomerCart" stepKey="createCustomerCartTwo"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItemTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddressTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </createData> + <updateData createDataKey="createCustomerCartTwo" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformationTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </updateData> + <createData entity="Invoice" stepKey="invoiceOrderTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </createData> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCartOne.return$)}}" stepKey="getFirstOrderId"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCartTwo.return$)}}" stepKey="getSecondOrderId"/> + + <actionGroup ref="AdminTwoOrderActionOnGridActionGroup" stepKey="massActionHold"> + <argument name="action" value="Hold"/> + <argument name="orderId" value="{$getFirstOrderId}"/> + <argument name="secondOrderId" value="{$getSecondOrderId}"/> + </actionGroup> + <see userInput="You have put 2 order(s) on hold." stepKey="assertOrderOnHoldSuccessMessage"/> + + <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder"> + <argument name="orderId" value="{$getFirstOrderId}"/> + <argument name="orderStatus" value="On Hold"/> + </actionGroup> + <see userInput="{$getFirstOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertFirstOrderID"/> + <see userInput="On Hold" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertFirstOrderStatus"/> + + <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeSecondOrder"> + <argument name="orderId" value="{$getSecondOrderId}"/> + <argument name="orderStatus" value="On Hold"/> + </actionGroup> + <see userInput="{$getSecondOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertSecondOrderID"/> + <see userInput="On Hold" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertSecondStatus"/> + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersUpdateCancelPendingOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersUpdateCancelPendingOrderTest.xml index 163da4917b50..e8b842a48890 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersUpdateCancelPendingOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersUpdateCancelPendingOrderTest.xml @@ -20,7 +20,6 @@ </annotations> <before> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> - <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="defaultSimpleProduct" stepKey="createProduct"> @@ -28,40 +27,43 @@ </createData> </before> <after> - <!-- Delete data --> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Create order --> - <actionGroup ref="CreateOrderActionGroup" stepKey="createOrder"> - <argument name="product" value="$$createProduct$$"/> - <argument name="customer" value="$$createCustomer$$"/> - </actionGroup> - <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/> - <assertNotEmpty stepKey="assertOrderIdIsNotEmpty" after="getOrderId"> - <actualResult type="const">$getOrderId</actualResult> - </assertNotEmpty> + <createData entity="CustomerCart" stepKey="createCustomerCart"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItem"> + <requiredEntity createDataKey="createCustomerCart"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="createOrder"> + <requiredEntity createDataKey="createCustomerCart"/> + </updateData> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="getOrderId"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertOrderIdIsNotEmpty"/> - <!-- Navigate to backend: Go to Sales > Orders --> <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCart.return$)}}" stepKey="grabOrderId"/> - <!-- Select Mass Action according to dataset: Cancel --> <actionGroup ref="AdminOrderActionOnGridActionGroup" stepKey="ActionCancel"> <argument name="action" value="Cancel"/> - <argument name="orderId" value="$getOrderId"/> + <argument name="orderId" value="$grabOrderId"/> </actionGroup> <see userInput="We canceled 1 order(s)." stepKey="assertOrderCancelMassActionSuccessMessage"/> - <!--Assert orders in orders grid --> <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="filterOrder"> - <argument name="orderId" value="{$getOrderId}"/> + <argument name="orderId" value="{$grabOrderId}"/> <argument name="orderStatus" value="Canceled"/> </actionGroup> - <see userInput="{$getOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertOrderID"/> + <see userInput="{$grabOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertOrderID"/> <see userInput="Canceled" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertOrderStatus"/> </test> </tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminOrdersReleaseInUnholdStatusTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminOrdersReleaseInUnholdStatusTest.xml index d2ded1cc73d2..e0576f94347c 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminOrdersReleaseInUnholdStatusTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminOrdersReleaseInUnholdStatusTest.xml @@ -21,53 +21,56 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> - <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="defaultSimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> </createData> + <createData entity="CustomerCart" stepKey="createCustomerCart"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItemOne"> + <requiredEntity createDataKey="createCustomerCart"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformationOne"> + <requiredEntity createDataKey="createCustomerCart"/> + </updateData> + <createData entity="HoldOrder" stepKey="holdOrder"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> </before> <after> - <!-- Delete data --> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Create order --> - <actionGroup ref="CreateOrderActionGroup" stepKey="createFirstOrder"> - <argument name="product" value="$$createProduct$$"/> - <argument name="customer" value="$$createCustomer$$"/> - </actionGroup> - <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/> - <assertNotEmpty stepKey="assertOrderIdIsNotEmpty" after="getOrderId"> - <actualResult type="const">$getOrderId</actualResult> - </assertNotEmpty> - - <!-- Hold Order --> - <click selector="{{AdminOrderDetailsMainActionsSection.hold}}" stepKey="pushButtonHold"/> - <waitForPageLoad stepKey="waitForHold"/> - <see userInput="You put the order on hold." stepKey="seeHoldMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="createFirstOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="getOrderId"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertOrderIdIsNotEmpty"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="pushButtonHold"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForHold"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeHoldMessage"/> - <!-- Navigate to backend: Go to Sales > Orders --> <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> - - <!-- Select Mass Action according to dataset: Unhold --> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCart.return$)}}" stepKey="grabOrderId"/> <actionGroup ref="AdminOrderActionOnGridActionGroup" stepKey="actionUnold"> <argument name="action" value="Unhold"/> - <argument name="orderId" value="$getOrderId"/> + <argument name="orderId" value="$grabOrderId"/> </actionGroup> <see userInput="1 order(s) have been released from on hold status." stepKey="assertOrderReleaseSuccessMessage"/> - <!--Assert order in orders grid --> <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder"> - <argument name="orderId" value="{$getOrderId}"/> + <argument name="orderId" value="{$grabOrderId}"/> <argument name="orderStatus" value="Pending"/> </actionGroup> - <see userInput="{$getOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertOrderID"/> + <see userInput="{$grabOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertOrderID"/> <see userInput="Pending" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertOrderStatus"/> </test> </tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml index 338975d3c1f2..38d69628d286 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml @@ -10,15 +10,13 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest"> <annotations> + <features value="Sales"/> <stories value="Admin create order"/> <title value="Product in the shopping cart could be reached by admin during order creation with multi website config"/> <description value="Product in the shopping cart could be reached by admin during order creation with multi website config"/> <severity value="MAJOR"/> - <testCaseId value="MC-6353"/> + <testCaseId value="MC-25877"/> <group value="sales"/> - <skip> - <issueId value="MC-20129"/> - </skip> </annotations> <before> <magentoCLI command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" stepKey="addStoreCodeToUrlEnable"/> @@ -38,7 +36,7 @@ <argument name="customStore" value="customStore"/> </actionGroup> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> - <argument name="productId" value="$$createProduct.id$$"/> + <argument name="productId" value="$createProduct.id$"/> </actionGroup> <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="assignProductToSecondWebsite"> <argument name="website" value="{{customWebsite.name}}"/> @@ -68,7 +66,7 @@ <!--Open product page and add to cart--> <actionGroup ref="StorefrontOpenProductPageUsingStoreCodeInUrlActionGroup" stepKey="openProductPageUsingStoreCodeInUrl"> - <argument name="product" value="$$createProduct$$"/> + <argument name="product" value="$createProduct$"/> <argument name="storeView" value="customStore"/> </actionGroup> <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProductToCart"/> @@ -81,12 +79,12 @@ <!--Assert product in Shopping cart section--> <actionGroup ref="AdminAssertProductInShoppingCartSectionActionGroup" stepKey="seeProductInShoppingCart"> - <argument name="product" value="$$createProduct.name$$"/> + <argument name="product" value="$createProduct.name$"/> </actionGroup> <!--Move product to the order from shopping cart--> <actionGroup ref="AdminMoveProductToItemsOrderedFromShoppingCartActionGroup" stepKey="addProductToItemsOrderedFromShoppingCart"> - <argument name="product" value="$$createProduct.name$$"/> + <argument name="product" value="$createProduct.name$"/> </actionGroup> <!--Fill customer address information--> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceRuleDiscountTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceRuleDiscountTest.xml index 4799984b7674..cd3b128b5c19 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceRuleDiscountTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceRuleDiscountTest.xml @@ -25,13 +25,8 @@ <createData entity="SimpleProduct2" stepKey="createSimpleProductApi"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/> - <!-- Clearing cache just in case --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <amOnPage url="{{AdminCatalogPriceRuleGridPage.url}}" stepKey="goToAdminCatalogPriceRuleGridPage2"/> <!-- It sometimes is loading too long for default 10s --> <waitForPageLoad time="60" stepKey="waitForPageFullyLoaded2"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml index beaf098eee24..1ad7b3db2127 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml @@ -10,16 +10,13 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminSubmitConfigurableProductOrderTest"> <annotations> - <title value="Create Order in Admin and update product configuration"/> - <stories value="MAGETWO-59632: Create Sales > Order from admin add configurable product and change options click OK does not update Items Ordered List"/> - <description value="Create Order in Admin and update product configuration"/> <features value="Sales"/> - <severity value="AVERAGE"/> - <testCaseId value="MAGETWO-59633"/> - <group value="Sales"/> - <skip> - <issueId value="MAGETWO-96196"/> - </skip> + <stories value="Admin create order"/> + <title value="Create Order in Admin and update product configuration"/> + <description value="Create Order as admin and update product attribute configuration during order creation"/> + <severity value="MAJOR"/> + <testCaseId value="MC-26545"/> + <group value="sales"/> </annotations> <before> @@ -87,25 +84,41 @@ <requiredEntity createDataKey="createConfigChildProduct2"/> </createData> + <!-- Reindex invalidated indices after product attribute has been created/deleted --> + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + + <deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> + <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/> + <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> + <deleteData createDataKey="createCategory" stepKey="deleteApiCategory"/> + + <!-- Reindex invalidated indices after product attribute has been created/deleted --> + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> + </after> <!--Create new customer order--> <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> - <argument name="customer" value="$$simpleCustomer$$"/> + <argument name="customer" value="$simpleCustomer$"/> </actionGroup> <!--Add configurable product to order--> <actionGroup ref="AddConfigurableProductToOrderFromAdminActionGroup" stepKey="addConfigurableProductToOrder"> - <argument name="product" value="$$createConfigProduct$$"/> - <argument name="attribute" value="$$createConfigProductAttribute$$"/> - <argument name="option" value="$$getConfigAttributeOption1$$"/> + <argument name="product" value="$createConfigProduct$"/> + <argument name="attribute" value="$createConfigProductAttribute$"/> + <argument name="option" value="$getConfigAttributeOption1$"/> </actionGroup> <!--Configure ordered configurable product--> <actionGroup ref="ConfigureOrderedConfigurableProductActionGroup" stepKey="configureOrderedConfigurableProduct"> - <argument name="attribute" value="$$createConfigProductAttribute$$"/> - <argument name="option" value="$$getConfigAttributeOption2$$"/> + <argument name="attribute" value="$createConfigProductAttribute$"/> + <argument name="option" value="$getConfigAttributeOption2$"/> <argument name="quantity" value="2"/> </actionGroup> @@ -118,20 +131,5 @@ <!--Verify order information--> <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> - - <after> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - - <deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/> - - <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> - <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/> - <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> - <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> - <deleteData createDataKey="createCategory" stepKey="deleteApiCategory"/> - - <!-- Reindex invalidated indices after product attribute has been created/deleted --> - <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> - </after> </test> </tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml index 226524341efd..814be5ccd86b 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml @@ -25,8 +25,8 @@ </after> <!--Go to new order status page--> - <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> - <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> + <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> + <actionGroup ref="AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup" stepKey="clickCreateNewStatus"/> <!--Fill the form and validate save success message--> <actionGroup ref="AdminOrderStatusFormFillAndSave" stepKey="fillFormAndClickSave"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml index a5d210a9765a..ac17d41c43c3 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml @@ -47,9 +47,9 @@ </after> <!-- Create order status --> - <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> - <waitForPageLoad stepKey="waitForOrderStatusPageLoad"/> - <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> + <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForOrderStatusPageLoad"/> + <actionGroup ref="AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup" stepKey="clickCreateNewStatus"/> <!-- Fill form and validate message --> <actionGroup ref="AdminOrderStatusFormFillAndSave" stepKey="fillFormAndClickSave"> @@ -119,8 +119,8 @@ <see selector="{{AdminMessagesSection.success}}" userInput="We canceled 1 order(s)." stepKey="seeSuccessMessage"/> <!-- Unassign order status --> - <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatus"/> - <waitForPageLoad stepKey="waitForStatusPageLoad"/> + <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatus"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStatusPageLoad"/> <actionGroup ref="FilterOrderStatusByLabelAndCodeActionGroup" stepKey="filterStatusGrid"> <argument name="statusLabel" value="{{defaultOrderStatus.label}}"/> <argument name="statusCode" value="{{defaultOrderStatus.status}}"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml index 08d5776b79ea..3a5dac85d2a8 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml @@ -75,12 +75,8 @@ <requiredEntity createDataKey="createConfigProduct"/> <requiredEntity createDataKey="createConfigChildProduct1"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <createData entity="DisableFreeShippingConfig" stepKey="disableFreeShippingConfig"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml index 739d5f0d40f6..3ee973ff2b03 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml @@ -60,7 +60,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> <!-- Place an order from Storefront as a Guest --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> <comment userInput="Adding the comment to replace action for preserving Backward Compatibility" stepKey="hoverOverProduct"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/> @@ -88,8 +88,8 @@ <!-- Checkout select Check/Money Order payment --> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment3"/> - <waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPlaceOrderButton"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml index 452d65ea5ae5..850dd9e1b579 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml @@ -57,9 +57,7 @@ <!-- Change configuration --> <magentoCLI command="config:set reports/options/enabled 1" stepKey="enableReportModule"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> </before> <after> <!-- Admin logout --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontCreateOrderWithDifferentAddressesTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontCreateOrderWithDifferentAddressesTest.xml new file mode 100644 index 000000000000..bf45d3305dcf --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontCreateOrderWithDifferentAddressesTest.xml @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontCreateOrderWithDifferentAddressesTest"> + <annotations> + <stories value="Order billing and shipping addresses should show correctly the entered data"/> + <title value="Billing and Shipping addresses should show correct data on Admin Order View"/> + <description value="Place order on Store Front with manually filled billing address state and selected shipping address state. Check that billing address show correct state on Admin Order View page"/> + <severity value="MINOR"/> + <group value="sales"/> + </annotations> + <before> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> + <createData entity="Customer_UK_US" stepKey="createCustomer"/> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCreateCustomer"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> + </after> + + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToProductPage"> + <argument name="productUrlKey" value="$createSimpleProduct.custom_attributes[url_key]$"/> + </actionGroup> + + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="cartAddSimpleProductToCart"> + <argument name="product" value="$$createSimpleProduct$$"/> + <argument name="productCount" value="1"/> + </actionGroup> + + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="navigateToCheckout"/> + <waitForPageLoad stepKey="waitForPaymentSelectionPageLoad"/> + + <actionGroup ref="LoginAsCustomerOnCheckoutPageActionGroup" stepKey="loginAsCustomer"> + <argument name="customer" value="$$createCustomer$$"/> + </actionGroup> + + <actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="gotoPaymentStep"/> + + <actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="customerPlaceOrder"> + <argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/> + <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/> + </actionGroup> + + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="getOrderNumber"/> + <assertNotEmpty stepKey="assertOrderIdIsNotEmpty" after="getOrderNumber"> + <actualResult type="const">$getOrderNumber</actualResult> + </assertNotEmpty> + + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="goToOrders"/> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById"> + <argument name="orderId" value="$getOrderNumber"/> + </actionGroup> + + <actionGroup ref="AssertOrderAddressWithStateInformationActionGroup" stepKey="AssertOrderAddressInformation"> + <argument name="customer" value=""/> + <argument name="shippingAddress" value="US_Address_NY_Default_Shipping"/> + <argument name="billingAddress" value="UK_With_State_Default_Billing"/> + </actionGroup> + <dontSee selector="{{AdminShipmentAddressInformationSection.billingAddress}}" userInput="{{US_Address_NY_Default_Shipping.state}}" stepKey="dontSeeShippingAddressStateAtBillingAddress"/> + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml index 6b6b0b2ef4a1..935a0f44ecc5 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml @@ -89,13 +89,8 @@ <!-- Customer is created --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> - <!-- Reindex and flush the cache to display products on the category page --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!-- Delete category and products --> @@ -133,7 +128,7 @@ </actionGroup> <!-- Customer placed the order with 20 products --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <scrollTo selector="{{StorefrontCategoryMainSection.perPage}}" stepKey="scrollToLimiter"/> <selectOption userInput="36" selector="{{StorefrontCategoryMainSection.perPage}}" stepKey="selectLimitOnPage"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerIsAbsentTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerIsAbsentTest.xml index 9fba25688702..752b2a5b7d82 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerIsAbsentTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerIsAbsentTest.xml @@ -122,7 +122,7 @@ </actionGroup> <!-- Customer placed the order with 20 products --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <scrollTo selector="{{StorefrontCategoryMainSection.perPage}}" stepKey="scrollToLimiter"/> <selectOption userInput="36" selector="{{StorefrontCategoryMainSection.perPage}}" stepKey="selectLimitOnPage"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml index 807437510d04..074a976de942 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml @@ -10,16 +10,14 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="StorefrontPrintOrderGuestTest"> <annotations> + <features value="Sales"/> <stories value="Print Order"/> <title value="Print Order from Guest on Frontend"/> <description value="Print Order from Guest on Frontend"/> - <severity value="BLOCKER"/> - <testCaseId value="MC-16225"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-28494"/> <group value="sales"/> <group value="mtf_migrated"/> - <skip> - <issueId value="MQE-2288" /> - </skip> </annotations> <before> <magentoCLI command="downloadable:domains:add" arguments="example.com static.magento.com" stepKey="addDownloadableDomain"/> @@ -40,7 +38,7 @@ <!-- Check Links can be purchased separately for Downloadable Product --> <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToDownloadableProduct"> - <argument name="product" value="$$downloadableProduct$$"/> + <argument name="product" value="$downloadableProduct$"/> </actionGroup> <waitForPageLoad stepKey="waitForPageLoad"/> <scrollTo selector="{{AdminProductDownloadableSection.sectionHeader}}" stepKey="scrollToDownloadableInformation"/> @@ -116,7 +114,7 @@ <!-- Grab attribute name for Configurable Product --> <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToConfigurableProduct"> - <argument name="product" value="$$createConfigProduct$$"/> + <argument name="product" value="$createConfigProduct$"/> </actionGroup> <grabTextFrom selector="{{AdminConfigurableProductFormSection.currentAttribute}}" stepKey="grabAttribute"/> <assertNotEmpty stepKey="assertNotEmpty"> @@ -151,13 +149,15 @@ <!-- Grab bundle option name for Bundle Product --> <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToBundleProduct"> - <argument name="product" value="$$createBundleProduct$$"/> + <argument name="product" value="$createBundleProduct$"/> </actionGroup> <grabTextFrom selector="{{AdminProductFormBundleSection.currentBundleOption}}" stepKey="grabBundleOption"/> <assertNotEmpty stepKey="assertBundleOptionNotEmpty"> <actualResult type="const">$grabBundleOption</actualResult> </assertNotEmpty> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductGridFilters"/> + <!-- Create sales rule --> <createData entity="ActiveSalesRuleCoupon50" stepKey="createCartPriceRule"/> <createData entity="SimpleSalesRuleCoupon" stepKey="createCouponForCartPriceRule"> @@ -170,36 +170,34 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value=""/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Place order with options according to dataset --> <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="newOrder"> - <argument name="customer" value="$$createCustomer$$"/> + <argument name="customer" value="$createCustomer$"/> </actionGroup> <actionGroup ref="AdminFilterProductInCreateOrderActionGroup" stepKey="filterConfigProduct"> - <argument name="productSKU" value="$$createConfigProduct.sku$$"/> + <argument name="productSKU" value="$createConfigProduct.sku$"/> </actionGroup> <actionGroup ref="AdminAddToOrderConfigurableProductActionGroup" stepKey="addConfProduct"> <argument name="attribute" value="{$grabAttribute}"/> - <argument name="option" value="$$getConfigAttributeOption1.label$$"/> + <argument name="option" value="$getConfigAttributeOption1.label$"/> <argument name="quantity" value="3"/> </actionGroup> <actionGroup ref="AdminFilterProductInCreateOrderActionGroup" stepKey="filterBundleProduct"> - <argument name="productSKU" value="$$createBundleProduct.sku$$"/> + <argument name="productSKU" value="$createBundleProduct.sku$"/> </actionGroup> <actionGroup ref="AdminAddToOrderBundleProductActionGroup" stepKey="addBundleProduct"> <argument name="option" value="{$grabBundleOption}"/> - <argument name="selectedProductName" value="$$simpleProduct1.name$$"/> + <argument name="selectedProductName" value="$simpleProduct1.name$"/> <argument name="quantity" value="2"/> </actionGroup> <actionGroup ref="AdminFilterProductInCreateOrderActionGroup" stepKey="filterDownloadableProduct"> - <argument name="productSKU" value="$$downloadableProduct.sku$$"/> + <argument name="productSKU" value="$downloadableProduct.sku$"/> </actionGroup> <actionGroup ref="AdminAddToOrderDownloadableProductActionGroup" stepKey="addDownloadableProduct"> <argument name="link" value="{$grabLink}"/> @@ -208,15 +206,16 @@ <!-- add Coupon --> <actionGroup ref="AdminAddToOrderCouponCodeActionGroup" stepKey="addCoupon"> - <argument name="couponCode" value="$$createCouponForCartPriceRule.code$$"/> + <argument name="couponCode" value="$createCouponForCartPriceRule.code$"/> </actionGroup> <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillOrder"> - <argument name="customer" value="$$createCustomer$$"/> + <argument name="customer" value="$createCustomer$"/> <argument name="address" value="US_Address_TX"/> </actionGroup> <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> + <actionGroup ref="SelectCheckMoneyPaymentMethodActionGroup" stepKey="selectCheckMoneyPayment"/> </before> <after> <magentoCLI command="downloadable:domains:remove" arguments="example.com static.magento.com" stepKey="removeDownloadableDomain"/> @@ -256,7 +255,7 @@ <!-- Fill the form with correspondent Order data --> <actionGroup ref="StorefrontFillOrdersAndReturnsFormActionGroup" stepKey="fillOrder"> <argument name="orderNumber" value="{$getOrderId}"/> - <argument name="customer" value="$$createCustomer$$"/> + <argument name="customer" value="$createCustomer$"/> </actionGroup> <!-- Click on the "Continue" button --> @@ -265,17 +264,17 @@ <!-- Click on the "Print Order" button --> <click selector="{{StorefrontGuestOrderViewSection.printOrder}}" stepKey="printOrder"/> - <wait time="5" stepKey="waitForPrintWindowToOpen" /> + <waitForPageLoad stepKey="waitForPrintWindowToOpen" /> <switchToWindow stepKey="switchToWindow"/> - <wait time="5" stepKey="waitForPrintTabToOpen" /> + <waitForElement selector="{{SalesOrderPrintSection.isOrderPrintPage}}" stepKey="waitForPrintTabToOpen"/> <switchToNextTab stepKey="switchToTab"/> - <wait stepKey="waitForPrintPreviewToLoad" time="5" /> + <waitForPageLoad stepKey="waitForPrintPreviewToLoad"/> <seeInCurrentUrl url="sales/guest/print/order_id/" stepKey="seePrintPage"/> <!-- AssertSalesPrintOrderProducts --> - <see userInput="$$createBundleProduct.name$$" selector="{{StorefrontOrderDetailsSection.productNameCell}}" stepKey="seeBundleProduct"/> - <see userInput="$$downloadableProduct.name$$" selector="{{StorefrontOrderDetailsSection.productNameCell}}" stepKey="seeDownloadableProduct"/> - <see userInput="$$createConfigProduct.name$$" selector="{{StorefrontOrderDetailsSection.productNameCell}}" stepKey="seeConfigurableProduct"/> + <see userInput="$createBundleProduct.name$" selector="{{StorefrontOrderDetailsSection.productNameCell}}" stepKey="seeBundleProduct"/> + <see userInput="$downloadableProduct.name$" selector="{{StorefrontOrderDetailsSection.productNameCell}}" stepKey="seeDownloadableProduct"/> + <see userInput="$createConfigProduct.name$" selector="{{StorefrontOrderDetailsSection.productNameCell}}" stepKey="seeConfigurableProduct"/> <!-- AssertSalesPrintOrderBillingAddress --> <scrollTo selector="{{StorefrontOrderDetailsSection.orderDetailsBlock}}" stepKey="scrollToFooter"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontRedirectToOrderHistoryTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontRedirectToOrderHistoryTest.xml index edc92bd2fac0..ccc675f20de0 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontRedirectToOrderHistoryTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontRedirectToOrderHistoryTest.xml @@ -10,17 +10,13 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="StorefrontRedirectToOrderHistoryTest"> <annotations> - <features value="Redirection Rules"/> - <stories value="Create Invoice"/> - <title value="Create Invoice"/> - <description - value="Check while order printing URL with an id of not relevant order redirects to order history"/> + <features value="Sales"/> + <stories value="Print Order"/> + <title value="Redirect to Order History Page"/> + <description value="Check while order printing URL with an id of not relevant order redirects to order history"/> <severity value="MAJOR"/> - <testCaseId value="MAGETWO-92854"/> + <testCaseId value="MC-28543"/> <group value="sales"/> - <skip> - <issueId value="MQE-2288" /> - </skip> </annotations> <before> <createData entity="_defaultCategory" stepKey="createCategory"/> @@ -39,32 +35,32 @@ <!--Log in to Storefront as Customer 1 --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp"> - <argument name="Customer" value="$$createCustomer$$"/> + <argument name="Customer" value="$createCustomer$"/> </actionGroup> <!--Create an order at Storefront as Customer 1 --> <actionGroup ref="CreateOrderToPrintPageWithSelectedPaymentMethodActionGroup" stepKey="createOrderToPrint"> - <argument name="Category" value="$$createCategory$$"/> + <argument name="Category" value="$createCategory$"/> </actionGroup> <!--Go to 'print order' page by grabbed order id--> <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderIdFromURL"/> - <wait time="5" stepKey="waitForPrintWindowToOpen" /> + <comment userInput="BIC workaround" stepKey="waitForPrintWindowToOpen"/> <switchToWindow stepKey="switchToPrintPage"/> <waitForElement selector="{{SalesOrderPrintSection.isOrderPrintPage}}" stepKey="checkPrintPage"/> <openNewTab stepKey="openNewTab"/> - <wait time="5" stepKey="waitForNewTabToOpen" /> + <waitForPageLoad stepKey="waitForNewTabToOpen" /> <switchToNextTab stepKey="switchForward"/> <waitForElement selector="body" stepKey="waitForNewTab3HTML" /> <amOnPage url="{{StorefrontSalesOrderPrintPage.url({$grabOrderIdFromURL})}}" stepKey="duplicatePrintPage"/> - <wait time="5" stepKey="waitForDuplicatePrintWindowToOpen" /> + <waitForPageLoad stepKey="waitForDuplicatePrintWindowToOpen" /> <switchToWindow stepKey="switchToDuplicatePrintPage"/> <waitForElement selector="{{SalesOrderPrintSection.isOrderPrintPage}}" stepKey="checkDuplicatePrintPage"/> <!--Log out as customer 1--> <openNewTab stepKey="openNewTab2"/> - <wait time="5" stepKey="waitForNewTabToOpen1" /> + <waitForPageLoad stepKey="waitForNewTabToOpen1" /> <switchToNextTab stepKey="switchForward2"/> <waitForElement selector="body" stepKey="waitForNewTab2HTML" /> @@ -73,24 +69,25 @@ <!--Log in to Storefront as Customer 2 --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp2"> - <argument name="Customer" value="$$createCustomer2$$"/> + <argument name="Customer" value="$createCustomer2$"/> </actionGroup> <!--Create an order at Storefront as Customer 2 --> <actionGroup ref="CreateOrderToPrintPageWithSelectedPaymentMethodActionGroup" stepKey="createOrderToPrint2"> - <argument name="Category" value="$$createCategory$$"/> + <argument name="Category" value="$createCategory$"/> </actionGroup> <!--Try to load 'print order' page with not relevant order id to be redirected to 'order history' page--> - <wait time="5" stepKey="waitForPrintWindowToOpen2" /> + <waitForPageLoad stepKey="waitForPrintWindowToOpen2" /> <switchToWindow stepKey="switchToPrintPage2"/> <waitForElement selector="{{SalesOrderPrintSection.isOrderPrintPage}}" stepKey="checkPrintPage2"/> <openNewTab stepKey="openNewTab3"/> - <wait time="5" stepKey="waitForNewTabToOpen2" /> + <waitForPageLoad stepKey="waitForNewTabToOpen2" /> <switchToNextTab stepKey="switchForward4"/> <waitForElement selector="body" stepKey="waitForNewTabHTML" /> <amOnPage url="{{StorefrontSalesOrderPrintPage.url({$grabOrderIdFromURL})}}" stepKey="duplicatePrintPage2"/> + <waitForPageLoad stepKey="waitForOpenDuplicatePage" /> <seeElement selector="{{StorefrontCustomerOrderSection.isMyOrdersSection}}" stepKey="waitOrderHistoryPage"/> </test> </tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifySecureURLRedirectSalesTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifySecureURLRedirectSalesTest.xml index ecf71e2bc80b..4ab85138f7c4 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifySecureURLRedirectSalesTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifySecureURLRedirectSalesTest.xml @@ -28,15 +28,11 @@ <executeJS function="return window.location.host" stepKey="hostname"/> <magentoCLI command="config:set web/secure/base_url https://{$hostname}/" stepKey="setSecureBaseURL"/> <magentoCLI command="config:set web/secure/use_in_frontend 1" stepKey="useSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set web/secure/use_in_frontend 0" stepKey="dontUseSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> </after> <executeJS function="return window.location.host" stepKey="hostname"/> diff --git a/app/code/Magento/Sales/Test/Unit/Block/Items/AbstractTest.php b/app/code/Magento/Sales/Test/Unit/Block/Items/AbstractTest.php index a85bad226164..6ed10609c7de 100644 --- a/app/code/Magento/Sales/Test/Unit/Block/Items/AbstractTest.php +++ b/app/code/Magento/Sales/Test/Unit/Block/Items/AbstractTest.php @@ -8,11 +8,13 @@ namespace Magento\Sales\Test\Unit\Block\Items; use Magento\Backend\Block\Template\Context; +use Magento\Framework\DataObject; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Framework\View\Element\AbstractBlock; use Magento\Framework\View\Element\RendererList; use Magento\Framework\View\Layout; use Magento\Sales\Block\Items\AbstractItems; +use Magento\Sales\ViewModel\ItemRendererTypeResolverInterface; use PHPUnit\Framework\TestCase; class AbstractTest extends TestCase @@ -25,41 +27,24 @@ protected function setUp(): void $this->_objectManager = new ObjectManager($this); } - public function testGetItemRenderer() + public function testGetItemRenderer(): void { $rendererType = 'some-type'; - $renderer = $this->getMockBuilder(AbstractBlock::class) - ->addMethods(['setRenderedBlock']) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - - $rendererList = $this->createMock(RendererList::class); - $rendererList->expects( - $this->once() - )->method( - 'getRenderer' - )->with( - $rendererType, - AbstractItems::DEFAULT_TYPE - )->willReturn( - $renderer - ); + $renderer = $this->getRendererMock('some output'); + $rendererList = $this->getRendererListMock([$rendererType => $renderer]); + $block = $this->getBlock($rendererList); + $this->assertSame($renderer, $block->getItemRenderer($rendererType)); + $this->assertSame($block, $renderer->getRenderedBlock()); + } + public function testGetItemRendererThrowsExceptionForNonexistentRenderer() + { + $this->expectException('RuntimeException'); + $this->expectExceptionMessage('Renderer list for block "" is not defined'); $layout = $this->createPartialMock(Layout::class, ['getChildName', 'getBlock']); + $layout->expects($this->once())->method('getChildName')->willReturn(null); - $layout->expects($this->once())->method('getChildName')->willReturn('renderer.list'); - - $layout->expects( - $this->once() - )->method( - 'getBlock' - )->with( - 'renderer.list' - )->willReturn( - $rendererList - ); - - /** @var \Magento\Sales\Block\Items\AbstractItems $block */ + /** @var AbstractItems $block */ $block = $this->_objectManager->getObject( AbstractItems::class, [ @@ -70,29 +55,125 @@ public function testGetItemRenderer() ] ); - $renderer->expects($this->once())->method('setRenderedBlock')->with($block); + $block->getItemRenderer('some-type'); + } - $this->assertSame($renderer, $block->getItemRenderer($rendererType)); + /** + * @param string $type + * @param string|null $resolvedType + * @param string $expected + * @dataProvider getItemHtmlDataProvider + */ + public function testGetItemHtml(string $type, ?string $resolvedType, string $expected): void + { + $renderers = [ + 'type1' => $this->getRendererMock('type 1 renderer'), + 'type2' => $this->getRendererMock('type 2 renderer'), + ]; + $rendererList = $this->getRendererListMock($renderers); + $block = $this->getBlock($rendererList); + $item = new DataObject(['product_type' => $type]); + $itemRendererTypeResolver = $this->getMockBuilder(ItemRendererTypeResolverInterface::class) + ->getMockForAbstractClass(); + $itemRendererTypeResolver->method('resolve') + ->willReturn($resolvedType); + $block->setData($type . '_renderer_type_resolver', $itemRendererTypeResolver); + $this->assertEquals($expected, $block->getItemHtml($item)); } - public function testGetItemRendererThrowsExceptionForNonexistentRenderer() + /** + * @return array + */ + public function getItemHtmlDataProvider(): array { - $this->expectException('RuntimeException'); - $this->expectExceptionMessage('Renderer list for block "" is not defined'); - $layout = $this->createPartialMock(Layout::class, ['getChildName', 'getBlock']); - $layout->expects($this->once())->method('getChildName')->willReturn(null); + return [ + [ + 'type1', + null, + 'type 1 renderer' + ], + [ + 'type1', + 'type2', + 'type 2 renderer' + ], + [ + 'type3', + null, + 'default renderer' + ], + [ + 'type3', + 'type1', + 'type 1 renderer' + ], + ]; + } - /** @var \Magento\Sales\Block\Items\AbstractItems $block */ - $block = $this->_objectManager->getObject( - AbstractItems::class, + /** + * @param string $html + * @return AbstractBlock + */ + private function getRendererMock(string $html): AbstractBlock + { + $renderer = $this->getMockBuilder(AbstractBlock::class) + ->onlyMethods(['toHtml']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $renderer->method('toHtml') + ->willReturn($html); + + return $renderer; + } + + /** + * @param array $renderers + * @return RendererList + */ + private function getRendererListMock(array $renderers): RendererList + { + $renderers[AbstractItems::DEFAULT_TYPE] = $this->getRendererMock('default renderer'); + $rendererList = $this->createMock(RendererList::class); + $rendererList->expects($this->once()) + ->method('getRenderer') + ->willReturnCallback( + function ($type, $default) use ($renderers) { + return $renderers[$type] ?? $renderers[$default] ?? null; + } + ); + + return $rendererList; + } + + /** + * @param RendererList $rendererList + * @return AbstractItems + */ + private function getBlock(RendererList $rendererList): AbstractItems + { + $layout = $this->createPartialMock( + Layout::class, [ - 'context' => $this->_objectManager->getObject( - Context::class, - ['layout' => $layout] - ) + 'getChildName', + 'getBlock' ] ); - $block->getItemRenderer('some-type'); + $layout->expects($this->once()) + ->method('getChildName') + ->willReturn('renderer.list'); + + $layout->expects($this->once()) + ->method('getBlock') + ->with('renderer.list') + ->willReturn($rendererList); + + $context = $this->_objectManager->getObject( + Context::class, + ['layout' => $layout] + ); + + return new AbstractItems($context); } } diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Create/ReorderTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Create/ReorderTest.php index 5fb8b2ddbc46..9644e096b524 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Create/ReorderTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Create/ReorderTest.php @@ -14,6 +14,7 @@ use Magento\Backend\Model\View\Result\Redirect; use Magento\Backend\Model\View\Result\RedirectFactory; use Magento\Framework\App\RequestInterface; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Message\ManagerInterface; use Magento\Framework\ObjectManagerInterface; @@ -26,6 +27,7 @@ use Magento\Sales\Model\Order\Reorder\UnavailableProductsProvider; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Psr\Log\LoggerInterface; /** * Verify reorder class. @@ -115,6 +117,11 @@ class ReorderTest extends TestCase */ private $orderId; + /** + * @var LoggerInterface|MockObject + */ + private $loggerMock; + /** * @inheritDoc */ @@ -141,6 +148,7 @@ protected function setUp(): void ->getMock(); $this->messageManagerMock = $this->getMockBuilder(ManagerInterface::class) ->getMockForAbstractClass(); + $this->loggerMock = $this->getMockForAbstractClass(LoggerInterface::class); $objectManager = new ObjectManager($this); $this->context = $objectManager->getObject( @@ -161,6 +169,7 @@ protected function setUp(): void 'reorderHelper' => $this->reorderHelperMock, 'context' => $this->context, 'resultForwardFactory' => $this->resultForwardFactoryMock, + 'logger' => $this->loggerMock ] ); } @@ -299,6 +308,43 @@ public function testExecuteRedirectNewOrderWithException(): void $this->assertInstanceOf(Redirect::class, $this->reorder->execute()); } + /** + * Verify redirect new order with throws out of stock exception. + * + * @return void + */ + public function testExecuteReorderWithThrowsLocalizedException(): void + { + $errorPhrase = __('This product is out of stock.'); + $exception = new LocalizedException($errorPhrase); + + $this->clearStorage(); + $this->getOrder(); + $this->canReorder(true); + $this->createRedirect(); + $this->getOrderId($this->orderId); + $this->getUnavailableProducts([]); + + $this->orderMock->expects($this->once()) + ->method('setReordered') + ->with(true) + ->willThrowException($exception); + $this->loggerMock + ->expects($this->any()) + ->method('critical') + ->willReturn($exception); + $this->messageManagerMock + ->expects($this->once()) + ->method('addErrorMessage') + ->willReturnSelf(); + $this->resultRedirectMock + ->expects($this->once()) + ->method('setPath') + ->with('sales/*') + ->willReturnSelf(); + $this->assertInstanceOf(Redirect::class, $this->reorder->execute()); + } + /** * Mock clear storage. * diff --git a/app/code/Magento/Sales/Test/Unit/Helper/GuestTest.php b/app/code/Magento/Sales/Test/Unit/Helper/GuestTest.php index 07f740f7c1fd..cf8cb5c9d893 100644 --- a/app/code/Magento/Sales/Test/Unit/Helper/GuestTest.php +++ b/app/code/Magento/Sales/Test/Unit/Helper/GuestTest.php @@ -183,9 +183,9 @@ public function testLoadValidOrderNotEmptyPost($post) ['getLastname', 'getEmail', 'getPostcode'] ); $billingAddressMock->expects($this->once())->method('getLastname') - ->willReturn(trim($post['oar_billing_lastname'])); - $billingAddressMock->expects($this->any())->method('getEmail')->willReturn(trim($post['oar_email'])); - $billingAddressMock->expects($this->any())->method('getPostcode')->willReturn(trim($post['oar_zip'])); + ->willReturn($post['oar_billing_lastname']); + $billingAddressMock->expects($this->any())->method('getEmail')->willReturn($post['oar_email']); + $billingAddressMock->expects($this->any())->method('getPostcode')->willReturn($post['oar_zip']); $this->salesOrderMock->expects($this->once())->method('getBillingAddress')->willReturn($billingAddressMock); $this->salesOrderMock->expects($this->once())->method('getProtectCode')->willReturn($protectedCode); $metaDataMock = $this->createMock(PublicCookieMetadata::class); @@ -196,6 +196,10 @@ public function testLoadValidOrderNotEmptyPost($post) ->method('setHttpOnly') ->with(true) ->willReturnSelf(); + $metaDataMock->expects($this->once()) + ->method('setSameSite') + ->with('Lax') + ->willReturnSelf(); $this->cookieMetadataFactoryMock->expects($this->once()) ->method('createPublicCookieMetadata') ->willReturn($metaDataMock); @@ -279,6 +283,10 @@ public function testLoadValidOrderStoredCookie() ->method('setHttpOnly') ->with(true) ->willReturnSelf(); + $metaDataMock->expects($this->once()) + ->method('setSameSite') + ->with('Lax') + ->willReturnSelf(); $this->cookieMetadataFactoryMock->expects($this->once()) ->method('createPublicCookieMetadata') ->willReturn($metaDataMock); diff --git a/app/code/Magento/Sales/Test/Unit/Model/InvoiceRepositoryTest.php b/app/code/Magento/Sales/Test/Unit/Model/InvoiceRepositoryTest.php index d15a948bd89e..d27ac09127a9 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/InvoiceRepositoryTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/InvoiceRepositoryTest.php @@ -41,6 +41,14 @@ class InvoiceRepositoryTest extends TestCase */ private $collectionProcessorMock; + /** + * @var Type|MockObject + */ + private $type; + + /** + * @inheritDoc + */ protected function setUp(): void { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Address/RendererTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Address/RendererTest.php index 28a74cd0f729..a4139b6ec730 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Address/RendererTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Address/RendererTest.php @@ -9,15 +9,21 @@ use Magento\Customer\Block\Address\Renderer\RendererInterface as CustomerAddressBlockRenderer; use Magento\Customer\Model\Address\Config as CustomerAddressConfig; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\DataObject; use Magento\Framework\Event\ManagerInterface as EventManager; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; use Magento\Sales\Model\Order; use Magento\Sales\Model\Order\Address as OrderAddress; use Magento\Sales\Model\Order\Address\Renderer as OrderAddressRenderer; +use Magento\Store\Api\Data\StoreInterface; +use Magento\Store\Model\StoreManagerInterface; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +/** + * Test for \Magento\Sales\Model\Order\Address\Renderer. + */ class RendererTest extends TestCase { /** @@ -55,6 +61,19 @@ class RendererTest extends TestCase */ private $customerAddressBlockRendererMock; + /** + * @var ScopeConfigInterface|MockObject + */ + private $storeConfigMock; + + /** + * @var StoreManagerInterface|MockObject + */ + private $storeManagerMck; + + /** + * @ingeritdoc + */ protected function setUp(): void { $this->customerAddressConfigMock = $this->getMockBuilder(CustomerAddressConfig::class) @@ -75,24 +94,31 @@ protected function setUp(): void ->method('getOrder') ->willReturn($this->orderMock); + $this->storeConfigMock = $this->createMock(ScopeConfigInterface::class); + $this->storeManagerMck = $this->getMockBuilder(StoreManagerInterface::class) + ->onlyMethods(['setCurrentStore']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); $this->objectManagerHelper = new ObjectManagerHelper($this); $this->orderAddressRenderer = $this->objectManagerHelper->getObject( OrderAddressRenderer::class, [ 'addressConfig' => $this->customerAddressConfigMock, - 'eventManager' => $this->eventManagerMock + 'eventManager' => $this->eventManagerMock, + 'scopeConfig' => $this->storeConfigMock, + 'storeManager' => $this->storeManagerMck, ] ); } - public function testFormat() + public function testFormat(): void { $type = 'html'; $formatType = new DataObject(['renderer' => $this->customerAddressBlockRendererMock]); - $addressData = ['address', 'data']; + $addressData = ['address', 'data', 'locale' => 1]; $result = 'result string'; - $this->setStoreExpectations(1); + $this->setStoreExpectations(); $this->customerAddressConfigMock->expects(static::atLeastOnce()) ->method('getFormatByCode') ->with($type) @@ -103,6 +129,9 @@ public function testFormat() $this->orderAddressMock->expects(static::atLeastOnce()) ->method('getData') ->willReturn($addressData); + $this->storeConfigMock->expects($this->once()) + ->method('getValue') + ->willReturn(1); $this->customerAddressBlockRendererMock->expects(static::once()) ->method('renderArray') ->with($addressData, null) @@ -111,11 +140,11 @@ public function testFormat() $this->assertEquals($result, $this->orderAddressRenderer->format($this->orderAddressMock, $type)); } - public function testFormatNoRenderer() + public function testFormatNoRenderer(): void { $type = 'html'; - $this->setStoreExpectations(1); + $this->setStoreExpectations(); $this->customerAddressConfigMock->expects(static::atLeastOnce()) ->method('getFormatByCode') ->with($type) @@ -129,17 +158,15 @@ public function testFormatNoRenderer() /** * Set expectations for store * - * @param string|int $storeId * @return void */ - private function setStoreExpectations($storeId) + private function setStoreExpectations(): void { - $this->orderMock->expects(static::atLeastOnce()) - ->method('getStoreId') - ->willReturn($storeId); - $this->customerAddressConfigMock->expects(static::atLeastOnce()) - ->method('setStore') - ->with($storeId) - ->willReturnSelf(); + $storeMock = $this->getMockBuilder(StoreInterface::class) + ->disableOriginalConstructor() + ->onlyMethods(['getId']) + ->getMockForAbstractClass(); + $this->orderMock->expects(self::once())->method('getStore')->willReturn($storeMock); + $this->storeManagerMck->expects(self::once())->method('setCurrentStore')->with($storeMock); } } diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/ConfigTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/ConfigTest.php index 877231760fd8..c6f3260c769a 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/ConfigTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/ConfigTest.php @@ -18,12 +18,28 @@ use Magento\Store\Model\StoreManagerInterface; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Magento\Sales\Model\Order\StatusLabel; /** * Test for Magento\Sales\Model\Order\Config class */ class ConfigTest extends TestCase { + /** + * Pending status stub + */ + const STUB_PENDING_STATUS_CODE = 'pending'; + + /** + * Store view with id 2 + */ + const STUB_STORE_VIEW_WITH_ID_2 = 2; + + /** + * Pending label in store view 2 + */ + const STUB_STORE_VIEW_LABEL_WITH_ID_2 = 'Pending-2'; + /** * @var Config */ @@ -49,6 +65,8 @@ class ConfigTest extends TestCase */ protected $storeManagerMock; + protected $statusLabel; + /** * @return void */ @@ -68,12 +86,14 @@ protected function setUp(): void CollectionFactory::class, ['create'] ); + $this->statusLabel = $this->createMock(StatusLabel::class); $this->salesConfig = $objectManager ->getObject( Config::class, [ 'orderStatusFactory' => $this->statusFactoryMock, - 'orderStatusCollectionFactory' => $this->orderStatusCollectionFactoryMock + 'orderStatusCollectionFactory' => $this->orderStatusCollectionFactoryMock, + 'statusLabel' => $this->statusLabel ] ); } @@ -204,6 +224,7 @@ public function testGetStatuses($state, $joinLabels, $collectionData, $expectedR $this->statusFactoryMock->method('load') ->willReturn($this->orderStatusModel); + $this->statusLabel->method('getStatusLabel')->willReturn('Pending label'); $storeMock = $this->getMockForAbstractClass(StoreInterface::class); $storeMock->method('getId') diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/SubtotalTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/SubtotalTest.php index b5dcadf83dbc..888d0b793ef6 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/SubtotalTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/SubtotalTest.php @@ -36,6 +36,14 @@ class SubtotalTest extends TestCase */ protected $orderItemMock; + /** + * @var Order|MockObject + */ + private $orderMock; + + /** + * @inheritDoc + */ protected function setUp(): void { $this->orderMock = $this->createPartialMock( diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoRepositoryTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoRepositoryTest.php index 5c720bcd5015..2ca50997d93f 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoRepositoryTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoRepositoryTest.php @@ -44,6 +44,14 @@ class CreditmemoRepositoryTest extends TestCase */ private $collectionProcessorMock; + /** + * @var Type|MockObject + */ + private $type; + + /** + * @inheritDoc + */ protected function setUp(): void { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/InvoiceCommentSenderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/InvoiceCommentSenderTest.php index 56d78789d7dd..c0b3f29065cb 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/InvoiceCommentSenderTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/InvoiceCommentSenderTest.php @@ -26,6 +26,14 @@ class InvoiceCommentSenderTest extends AbstractSenderTest */ protected $invoiceMock; + /** + * @var Invoice|MockObject + */ + private $invoiceResource; + + /** + * @inheritDoc + */ protected function setUp(): void { $this->stepMockSetup(); diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Sender/EmailSenderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Sender/EmailSenderTest.php index 4a909a21e255..fb347be26b85 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Sender/EmailSenderTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Sender/EmailSenderTest.php @@ -137,6 +137,7 @@ protected function setUp(): void $this->storeMock->expects($this->any()) ->method('getStoreId') ->willReturn(1); + $this->orderMock->expects($this->any()) ->method('getStore') ->willReturn($this->storeMock); @@ -152,7 +153,7 @@ protected function setUp(): void $this->invoiceMock = $this->getMockBuilder(\Magento\Sales\Model\Order\Invoice::class) ->disableOriginalConstructor() - ->setMethods(['setSendEmail', 'setEmailSent']) + ->setMethods(['setSendEmail', 'setEmailSent', 'getId']) ->getMock(); $this->commentMock = $this->getMockBuilder(InvoiceCommentCreationInterface::class) @@ -170,6 +171,7 @@ protected function setUp(): void $this->orderMock->expects($this->any()) ->method('getBillingAddress') ->willReturn($this->addressMock); + $this->orderMock->expects($this->any()) ->method('getShippingAddress') ->willReturn($this->addressMock); @@ -280,7 +282,9 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending if (!$configValue || $forceSyncMode) { $transport = [ 'order' => $this->orderMock, + 'order_id' => 1, 'invoice' => $this->invoiceMock, + 'invoice_id' => 1, 'comment' => $isComment ? 'Comment text' : '', 'billing' => $this->addressMock, 'payment_html' => 'Payment Info Block', @@ -315,6 +319,14 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending ->method('isEnabled') ->willReturn($emailSendingResult); + $this->orderMock->expects($this->once()) + ->method('getId') + ->willReturn(1); + + $this->invoiceMock->expects($this->once()) + ->method('getId') + ->willReturn(1); + if ($emailSendingResult) { $this->identityContainerMock->expects($this->once()) ->method('getCopyMethod') diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Total/DiscountTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Total/DiscountTest.php index f7587031337a..3623e6800f53 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Total/DiscountTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Total/DiscountTest.php @@ -98,6 +98,43 @@ public function testCollectInvoiceWithZeroGrandTotal(array $invoiceData): void $this->model->collect($this->invoice); } + /** + * Test for collect invoice with negative grand total + * + * @return void + */ + public function testCollectInvoiceWithNegativeGrandTotal(): void + { + $invoiceData = [ + 'order_item' => [ + 'qty_ordered' => 1, + 'discount_amount' => 25.34, + 'base_discount_amount' => 25.34, + ], + 'is_last' => true, + 'qty' => 1, + ]; + $invoiceItem[] = $this->getInvoiceItem($invoiceData); + $this->invoice->method('getOrder') + ->willReturn($this->order); + $this->order->method('getInvoiceCollection') + ->willReturn([]); + $this->invoice->method('getAllItems') + ->willReturn($invoiceItem); + $this->invoice->method('getGrandTotal') + ->willReturn(15.6801); + $this->invoice->method('getBaseGrandTotal') + ->willReturn(15.6801); + + $this->invoice->expects($this->exactly(1)) + ->method('setGrandTotal') + ->with(-9.6599); + $this->invoice->expects($this->exactly(1)) + ->method('setBaseGrandTotal') + ->with(-9.6599); + $this->model->collect($this->invoice); + } + /** * @return array */ diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Shipment/Sender/EmailSenderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Shipment/Sender/EmailSenderTest.php index b170a72d691e..29c755d77faa 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Shipment/Sender/EmailSenderTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Shipment/Sender/EmailSenderTest.php @@ -318,7 +318,7 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending 'is_not_virtual' => $orderData['is_not_virtual'], 'email_customer_note' => $orderData['email_customer_note'], 'frontend_status_label' => $orderData['frontend_status_label'] - ] + ], ]; $transport = new DataObject($transport); diff --git a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/GridTest.php b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/GridTest.php index 338f05bc43f8..4ddc54a5e66a 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/GridTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/GridTest.php @@ -10,6 +10,7 @@ use Magento\Framework\DB\Adapter\AdapterInterface as ConnectionAdapterInterface; use Magento\Framework\DB\Select; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Sales\Model\Grid\LastUpdateTimeCache; use Magento\Sales\Model\ResourceModel\Grid; use Magento\Sales\Model\ResourceModel\Provider\NotSyncedDataProviderInterface; use PHPUnit\Framework\MockObject\MockObject; @@ -35,6 +36,11 @@ class GridTest extends TestCase */ private $connection; + /** + * @var LastUpdateTimeCache|MockObject + */ + private $lastUpdateTimeCache; + /** * @var string */ @@ -49,8 +55,9 @@ class GridTest extends TestCase * @var array */ private $columns = [ - 'column_1_key' => 'column_1_value', - 'column_2_key' => 'column_2_value' + 'entity_id' => 'sales_order.entity_id', + 'status' => 'sales_order.status', + 'updated_at' => 'sales_order.updated_at', ]; /** @@ -59,14 +66,9 @@ class GridTest extends TestCase protected function setUp(): void { $objectManager = new ObjectManager($this); - $this->notSyncedDataProvider = $this->getMockBuilder(NotSyncedDataProviderInterface::class) - ->disableOriginalConstructor() - ->setMethods(['getIds']) - ->getMockForAbstractClass(); - $this->connection = $this->getMockBuilder(ConnectionAdapterInterface::class) - ->disableOriginalConstructor() - ->setMethods(['select', 'fetchAll', 'insertOnDuplicate']) - ->getMockForAbstractClass(); + $this->notSyncedDataProvider = $this->createMock(NotSyncedDataProviderInterface::class); + $this->connection = $this->createMock(ConnectionAdapterInterface::class); + $this->lastUpdateTimeCache = $this->createMock(LastUpdateTimeCache::class); $this->grid = $objectManager->getObject( Grid::class, @@ -76,7 +78,8 @@ protected function setUp(): void 'gridTableName' => $this->gridTable, 'connection' => $this->connection, '_tables' => ['sales_order' => $this->mainTable, 'sales_order_grid' => $this->gridTable], - 'columns' => $this->columns + 'columns' => $this->columns, + 'lastUpdateTimeCache' => $this->lastUpdateTimeCache, ] ); } @@ -87,26 +90,49 @@ protected function setUp(): void public function testRefreshBySchedule() { $notSyncedIds = ['1', '2', '3']; - $fetchResult = ['column_1' => '1', 'column_2' => '2']; - - $this->notSyncedDataProvider->expects($this->atLeastOnce())->method('getIds')->willReturn($notSyncedIds); - $select = $this->getMockBuilder(Select::class) - ->disableOriginalConstructor() - ->setMethods(['from', 'columns', 'where']) - ->getMock(); - $select->expects($this->atLeastOnce())->method('from')->with(['sales_order' => $this->mainTable], []) + $fetchResult = []; + for ($i = 1; $i <= 220; $i++) { + $fetchResult[] = [ + 'entity_id' => $i, + 'status' => 1, + 'updated_at' => '2021-01-01 01:02:03', + ]; + } + $fetchResult[50]['updated_at'] = '2021-02-03 01:02:03'; + $fetchResult[150]['updated_at'] = '2021-03-04 01:02:03'; + + $this->notSyncedDataProvider->expects($this->atLeastOnce()) + ->method('getIds') + ->willReturn($notSyncedIds); + $select = $this->createMock(Select::class); + $select->expects($this->atLeastOnce()) + ->method('from') + ->with(['sales_order' => $this->mainTable], []) + ->willReturnSelf(); + $select->expects($this->atLeastOnce()) + ->method('columns') ->willReturnSelf(); - $select->expects($this->atLeastOnce())->method('columns')->willReturnSelf(); - $select->expects($this->atLeastOnce())->method('where') + $select->expects($this->atLeastOnce()) + ->method('where') ->with($this->mainTable . '.entity_id IN (?)', $notSyncedIds) ->willReturnSelf(); - $this->connection->expects($this->atLeastOnce())->method('select')->willReturn($select); - $this->connection->expects($this->atLeastOnce())->method('fetchAll')->with($select)->willReturn($fetchResult); - $this->connection->expects($this->atLeastOnce())->method('insertOnDuplicate') + $this->connection->expects($this->atLeastOnce()) + ->method('select') + ->willReturn($select); + $this->connection->expects($this->atLeastOnce()) + ->method('fetchAll') + ->with($select) + ->willReturn($fetchResult); + $this->connection->expects($this->atLeastOnce()) + ->method('insertOnDuplicate') ->with($this->gridTable, $fetchResult, array_keys($this->columns)) ->willReturn(array_count_values($notSyncedIds)); + $this->lastUpdateTimeCache->expects($this->once()) + ->method('save') + ->with($this->gridTable, '2021-03-04 01:02:03'); + $this->grid->refreshBySchedule(); } } diff --git a/app/code/Magento/Sales/ViewModel/ItemRendererTypeResolverInterface.php b/app/code/Magento/Sales/ViewModel/ItemRendererTypeResolverInterface.php new file mode 100644 index 000000000000..e9442ec7e49a --- /dev/null +++ b/app/code/Magento/Sales/ViewModel/ItemRendererTypeResolverInterface.php @@ -0,0 +1,22 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Sales\ViewModel; + +/** + * Item renderer type resolver + */ +interface ItemRendererTypeResolverInterface +{ + /** + * Get renderer type for provided item object + * + * @param \Magento\Framework\DataObject $item + * @return string|null + */ + public function resolve(\Magento\Framework\DataObject $item): ?string; +} diff --git a/app/code/Magento/Sales/etc/adminhtml/di.xml b/app/code/Magento/Sales/etc/adminhtml/di.xml index e221467dbcf9..35ef510d277b 100644 --- a/app/code/Magento/Sales/etc/adminhtml/di.xml +++ b/app/code/Magento/Sales/etc/adminhtml/di.xml @@ -48,9 +48,4 @@ </argument> </arguments> </type> - <type name="Magento\Sales\Block\Adminhtml\Order\Create\Search\Grid\DataProvider\ProductCollection"> - <arguments> - <argument name="collectionFactory" xsi:type="object">\Magento\Catalog\Ui\DataProvider\Product\ProductCollectionFactory</argument> - </arguments> - </type> </config> diff --git a/app/code/Magento/Sales/etc/di.xml b/app/code/Magento/Sales/etc/di.xml index 80bcf2978950..b0224d758002 100644 --- a/app/code/Magento/Sales/etc/di.xml +++ b/app/code/Magento/Sales/etc/di.xml @@ -1027,4 +1027,14 @@ <argument name="productAvailabilityChecks" xsi:type="array" /> </arguments> </type> + <type name="Magento\Sales\Model\Order\StatusLabel"> + <arguments> + <argument name="maskStatusesMapping" xsi:type="array"> + <item name="frontend" xsi:type="array"> + <item name="fraud" xsi:type="const">Magento\Sales\Model\Order::STATUS_FRAUD</item> + <item name="payment_review" xsi:type="const">Magento\Sales\Model\Order::STATE_PROCESSING</item> + </item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Sales/etc/fieldset.xml b/app/code/Magento/Sales/etc/fieldset.xml index 81dc8b6fa4dd..8bf98ada3cd0 100644 --- a/app/code/Magento/Sales/etc/fieldset.xml +++ b/app/code/Magento/Sales/etc/fieldset.xml @@ -774,6 +774,9 @@ <field name="fax"> <aspect name="to_quote_address" /> </field> + <field name="vat_id"> + <aspect name="to_quote_address" /> + </field> </fieldset> <fieldset id="order_address"> <field name="prefix"> diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/create/billing/method/form.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/create/billing/method/form.phtml index f1c8b249fe68..ba98e7274c13 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/create/billing/method/form.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/create/billing/method/form.phtml @@ -4,57 +4,68 @@ * See COPYING.txt for license details. */ -/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ +use Magento\Framework\Escaper; +use Magento\Framework\View\Helper\SecureHtmlRenderer; +use Magento\Sales\Block\Adminhtml\Order\Create\Billing\Method\Form as BillingMethodForm; + +/** + * @var BillingMethodForm $block + * @var Escaper $escaper + * @var SecureHtmlRenderer $secureRenderer + */ ?> <?php if ($block->hasMethods()): ?> -<div id="order-billing_method_form"> - <dl class="admin__payment-methods control"> - <?php - $_methods = $block->getMethods(); - $_methodsCount = count($_methods); - $_counter = 0; - $currentSelectedMethod = $block->getSelectedMethodCode(); - ?> - <?php foreach ($_methods as $_method): - $_code = $_method->getCode(); - $_counter++; - ?> - <dt class="admin__field-option"> - <?php if ($_methodsCount > 1): ?> - <input id="p_method_<?= $block->escapeHtmlAttr($_code); ?>" - value="<?= $block->escapeHtmlAttr($_code); ?>" - type="radio" name="payment[method]" - title="<?= $block->escapeHtmlAttr($_method->getTitle()); ?>" - <?php if ($currentSelectedMethod == $_code): ?> - checked="checked" + <div id="order-billing_method_form"> + <dl class="admin__payment-methods control"> + <?php + $_methods = $block->getMethods(); + $_methodsCount = count($_methods); + $_counter = 0; + $currentSelectedMethod = $block->getSelectedMethodCode(); + ?> + <?php foreach ($_methods as $_method): + $_code = $_method->getCode(); + $_counter++; + ?> + <dt class="admin__field-option"> + <?php if ($_methodsCount > 1): ?> + <input id="p_method_<?= $escaper->escapeHtmlAttr($_code); ?>" + value="<?= $escaper->escapeHtmlAttr($_code); ?>" + type="radio" name="payment[method]" + title="<?= $escaper->escapeHtmlAttr($_method->getTitle()); ?>" + <?php if ($currentSelectedMethod == $_code): ?> + checked="checked" + <?php endif; ?> + data-validate="{'validate-one-required-by-name':true}" + class="admin__control-radio"/> + <?php else: ?> + <span class="no-display"> + <input id="p_method_<?= $escaper->escapeHtmlAttr($_code); ?>" + value="<?= $escaper->escapeHtmlAttr($_code); ?>" + type="radio" + name="payment[method]" class="admin__control-radio" + checked="checked"/> + </span> <?php endif; ?> - data-validate="{'validate-one-required-by-name':true}" - class="admin__control-radio"/> - <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( - 'onclick', - "payment.switchMethod('" . $block->escapeJs($_code) . "')", - 'input#p_method_' . $block->escapeJs($_code) - ) ?> - <?php else:?> - <span class="no-display"> - <input id="p_method_<?= $block->escapeHtmlAttr($_code); ?>" - value="<?= $block->escapeHtmlAttr($_code); ?>" - type="radio" - name="payment[method]" class="admin__control-radio" - checked="checked"/> - </span> - <?php endif;?> - <label class="admin__field-label" for="p_method_<?= $block->escapeHtmlAttr($_code); ?>"> - <?= $block->escapeHtml($_method->getTitle()) ?> - </label> - </dt> - <dd class="admin__payment-method-wrapper"> - <?= $block->getChildHtml('payment.method.' . $_code) ?> - </dd> - <?php endforeach; ?> - </dl> -</div> + <label class="admin__field-label" for="p_method_<?= $escaper->escapeHtmlAttr($_code); ?>"> + <?= $escaper->escapeHtml($_method->getTitle()) ?> + </label> + + <?php if ($_methodsCount > 1): ?> + <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( + 'onclick', + "payment.switchMethod('" . $escaper->escapeJs($_code) . "')", + 'input#p_method_' . $escaper->escapeJs($_code) + ) ?> + <?php endif; ?> + </dt> + <dd class="admin__payment-method-wrapper"> + <?= $block->getChildHtml('payment.method.' . $_code) ?> + </dd> + <?php endforeach; ?> + </dl> + </div> <?php $scriptString = <<<script require([ 'mage/apply/main', @@ -65,11 +76,11 @@ script; if ($_methodsCount !== 1): $scriptString .= <<<script - order.setPaymentMethod('{$block->escapeJs($currentSelectedMethod)}'); + order.setPaymentMethod('{$escaper->escapeJs($currentSelectedMethod)}'); script; else: $scriptString .= <<<script - payment.switchMethod('{$block->escapeJs($currentSelectedMethod)}'); + payment.switchMethod('{$escaper->escapeJs($currentSelectedMethod)}'); script; endif; $scriptString .= <<<script @@ -78,7 +89,8 @@ script; script; ?> - <?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?> + <?= /* @noEscape */ + $secureRenderer->renderTag('script', [], $scriptString, false) ?> <?php else: ?> - <div class="admin__message-empty"><?= $block->escapeHtml(__('No Payment Methods')); ?></div> + <div class="admin__message-empty"><?= $escaper->escapeHtml(__('No Payment Methods')); ?></div> <?php endif; ?> diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml index 638ac7e66f76..79bc1e3a8df3 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml @@ -142,9 +142,10 @@ endif; ?> order.bindAddressFields('{$block->escapeJs($_addressChoiceContainerId)}'); script; - if ($block->getIsShipping() && $block->getIsAsBilling()): - $scriptString .= <<<script - order.disableShippingAddress(true); + if ($block->getIsShipping()): + $disable = $block->getIsAsBilling() ? 'true' : 'false'; + $scriptString .= <<<script + order.disableShippingAddress({$disable}); script; endif; diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/create/shipping/method/form.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/create/shipping/method/form.phtml index fd5b7a55b496..d745a265e6d0 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/create/shipping/method/form.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/create/shipping/method/form.phtml @@ -38,11 +38,6 @@ $taxHelper = $block->getData('taxHelper'); value="<?= $block->escapeHtmlAttr($_code) ?>" id="s_method_<?= $block->escapeHtmlAttr($_code) ?>" <?= /* @noEscape */ $_checked ?> class="admin__control-radio required-entry"/> - <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( - 'onclick', - "order.setShippingMethod(this.value)", - 'input#s_method_' . $block->escapeHtmlAttr($_code) - ) ?> <label class="admin__field-label" for="s_method_<?= $block->escapeHtmlAttr($_code) ?>"> <?= $block->escapeHtml($_rate->getMethodTitle() ? $_rate->getMethodTitle() : $_rate->getMethodDescription()) ?> - @@ -59,6 +54,11 @@ $taxHelper = $block->getData('taxHelper'); <?php endif; ?> </strong> </label> + <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( + 'onclick', + "order.setShippingMethod(this.value)", + 'input#s_method_' . $block->escapeHtmlAttr($_code) + ) ?> <?php endif; ?> </li> <?php endforeach; ?> diff --git a/app/code/Magento/Sales/view/adminhtml/web/order/view/post-wrapper.js b/app/code/Magento/Sales/view/adminhtml/web/order/view/post-wrapper.js index b9bc4ccd4ff1..a1155dd436d4 100644 --- a/app/code/Magento/Sales/view/adminhtml/web/order/view/post-wrapper.js +++ b/app/code/Magento/Sales/view/adminhtml/web/order/view/post-wrapper.js @@ -12,7 +12,7 @@ define([ /** * @param {String} url - * @returns {Object} + * @returns {jQuery} */ function getForm(url) { return $('<form>', { @@ -25,7 +25,7 @@ define([ })); } - $('#order-view-cancel-button').click(function () { + $('#order-view-cancel-button').on('click', function () { var msg = $.mage.__('Are you sure you want to cancel this order?'), url = $('#order-view-cancel-button').data('url'); @@ -37,7 +37,7 @@ define([ * 'Confirm' action handler. */ confirm: function () { - getForm(url).appendTo('body').submit(); + getForm(url).appendTo('body').trigger('submit'); } } }); @@ -45,15 +45,15 @@ define([ return false; }); - $('#order-view-hold-button').click(function () { + $('#order-view-hold-button').on('click', function () { var url = $('#order-view-hold-button').data('url'); - getForm(url).appendTo('body').submit(); + getForm(url).appendTo('body').trigger('submit'); }); - $('#order-view-unhold-button').click(function () { + $('#order-view-unhold-button').on('click', function () { var url = $('#order-view-unhold-button').data('url'); - getForm(url).appendTo('body').submit(); + getForm(url).appendTo('body').trigger('submit'); }); }); diff --git a/app/code/Magento/SalesAnalytics/README.md b/app/code/Magento/SalesAnalytics/README.md index 7b6222923396..4fc110af0bae 100644 --- a/app/code/Magento/SalesAnalytics/README.md +++ b/app/code/Magento/SalesAnalytics/README.md @@ -1,3 +1,3 @@ # Magento_SalesAnalytics module -The Magento_SalesAnalytics module configures data definitions for a data collection related to the Sales module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.3/advanced-reporting/modules.html). +The Magento_SalesAnalytics module configures data definitions for a data collection related to the Sales module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html). diff --git a/app/code/Magento/SalesGraphQl/Model/Resolver/OrderTotal.php b/app/code/Magento/SalesGraphQl/Model/Resolver/OrderTotal.php index ab3ace45f336..d767cfd32cdb 100644 --- a/app/code/Magento/SalesGraphQl/Model/Resolver/OrderTotal.php +++ b/app/code/Magento/SalesGraphQl/Model/Resolver/OrderTotal.php @@ -60,7 +60,8 @@ public function resolve( ], 'taxes' => $this->getAppliedShippingTaxesDetails($order), 'discounts' => $this->getShippingDiscountDetails($order), - ] + ], + 'model' => $order ]; } diff --git a/app/code/Magento/SalesRule/Block/Rss/Discounts.php b/app/code/Magento/SalesRule/Block/Rss/Discounts.php index d939c5d272e8..efc52f87fa18 100644 --- a/app/code/Magento/SalesRule/Block/Rss/Discounts.php +++ b/app/code/Magento/SalesRule/Block/Rss/Discounts.php @@ -28,6 +28,11 @@ class Discounts extends \Magento\Framework\View\Element\AbstractBlock implements */ protected $httpContext; + /** + * @var \Magento\Framework\App\Rss\UrlBuilderInterface + */ + private $rssUrlBuilder; + /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Framework\App\Http\Context $httpContext diff --git a/app/code/Magento/SalesRule/Model/ResourceModel/Rule/Collection.php b/app/code/Magento/SalesRule/Model/ResourceModel/Rule/Collection.php index 2150db4238fb..99c70936a3e2 100644 --- a/app/code/Magento/SalesRule/Model/ResourceModel/Rule/Collection.php +++ b/app/code/Magento/SalesRule/Model/ResourceModel/Rule/Collection.php @@ -312,6 +312,20 @@ public function addWebsiteGroupDateFilter($websiteId, $customerGroupId, $now = n [] ); + // exclude websites that are limited for customer group + $this->getSelect()->joinLeft( + ['cgw' => $this->getTable('customer_group_excluded_website')], + 'customer_group_ids.' . + $entityInfo['entity_id_field'] . + ' = cgw.' . + $entityInfo['entity_id_field'] . ' AND ' . $websiteId . ' = cgw.website_id', + [] + )->where( + 'cgw.website_id IS NULL', + $websiteId, + \Zend_Db::INT_TYPE + ); + $this->getDateApplier()->applyDate($this->getSelect(), $now); $this->addIsActiveFilter(); diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleDeleteAllActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleDeleteAllActionGroup.xml index 85437650efc3..cc6b2ad6a064 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleDeleteAllActionGroup.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleDeleteAllActionGroup.xml @@ -16,7 +16,7 @@ <!-- It sometimes is loading too long for default 10s --> <waitForPageLoad time="60" stepKey="waitForPageFullyLoaded"/> <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> - <helper class="\Magento\Rule\Test\Mftf\Helper\RuleHelper" method="deleteAllRulesOneByOne" stepKey="deleteAllRulesOneByOne"> + <helper class="Magento\Rule\Test\Mftf\Helper\RuleHelper" method="deleteAllRulesOneByOne" stepKey="deleteAllRulesOneByOne"> <argument name="firstNotEmptyRow">{{AdminDataGridTableSection.firstNotEmptyRow}}</argument> <argument name="modalAcceptButton">{{AdminConfirmationModalSection.ok}}</argument> <argument name="deleteButton">{{AdminMainActionsSection.delete}}</argument> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleFillCouponInfoActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleFillCouponInfoActionGroup.xml new file mode 100644 index 000000000000..48903d39db01 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleFillCouponInfoActionGroup.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCartPriceRuleFillCouponInfoActionGroup"> + <annotations> + <description>Fill Cart Price Rule coupon info : Type, Code, Number of uses per coupon/customer.</description> + </annotations> + <arguments> + <argument name="couponType" type="string" defaultValue="Specific Coupon"/> + <argument name="couponCode" type="string" defaultValue="{{_defaultCoupon.code}}"/> + <argument name="userPerCoupon" type="string" defaultValue="500"/> + <argument name="userPerCustomer" type="string" defaultValue="1"/> + </arguments> + + <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="{{couponType}}" stepKey="selectCouponType"/> + <fillField selector="{{AdminCartPriceRulesFormSection.couponCode}}" userInput="{{couponCode}}" stepKey="fillCouponCode"/> + <fillField selector="{{AdminCartPriceRulesFormSection.userPerCoupon}}" userInput="{{userPerCoupon}}" stepKey="setUserPerCoupon"/> + <fillField selector="{{AdminCartPriceRulesFormSection.userPerCustomer}}" userInput="{{userPerCustomer}}" stepKey="setUserPerCustomer"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleFillShippingConditionActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleFillShippingConditionActionGroup.xml new file mode 100644 index 000000000000..f55fbcef9373 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleFillShippingConditionActionGroup.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCartPriceRuleFillShippingConditionActionGroup"> + <annotations> + <description>Sets the provided Cart Attribute Shipping method condition type on the Admin Cart Price Rule creation/edit page.</description> + </annotations> + <arguments> + <argument name="shippingMethodName" type="string" defaultValue="[flatrate] Fixed"/> + </arguments> + <click selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="openConditionsSection" /> + <click selector="{{AdminCartPriceRulesFormSection.addCondition('1')}}" stepKey="addCondition"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.conditionSelectDropdown('1')}}" userInput="Shipping Method" stepKey="specifyCondition"/> + <waitForPageLoad stepKey="waitForConditionLoad"/> + <click selector="{{AdminCartPriceRulesFormSection.targetEllipsis}}" stepKey="clickEllipsis"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.ruleFieldByIndex('1--1')}}" userInput="{{shippingMethodName}}" stepKey="selectShippingMethod"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionAndNotDefaultConditionOperatorActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionAndNotDefaultConditionOperatorActionGroup.xml new file mode 100644 index 000000000000..dda2c58b1132 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionAndNotDefaultConditionOperatorActionGroup.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCreateCartPriceRuleWithConditionAndNotDefaultConditionOperatorActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Sets the not default Condition value and Product Child Attribute for Actions on the Admin Cart Price Rule creation/edit page.</description> + </annotations> + <arguments> + <argument name="childAttribute" type="string" defaultValue="SKU"/> + <argument name="conditionOperator" type="string" defaultValue="is"/> + <argument name="actionValue" type="string" defaultValue="{{ApiSimpleProduct.sku}}"/> + </arguments> + <click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" after="fillDiscountAmount" stepKey="clickOnActionTab"/> + <click selector="{{AdminCartPriceRulesFormSection.conditions}}" after="clickOnActionTab" stepKey="clickConditionDropDownMenu"/> + <waitForPageLoad stepKey="waitForDropDownOpened"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.childAttribute}}" userInput="{{childAttribute}}" after="clickConditionDropDownMenu" stepKey="selectConditionAttribute"/> + <waitForPageLoad after="selectConditionAttribute" stepKey="waitForOperatorOpened"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('is')}}" after="waitForOperatorOpened" stepKey="clickToChooseCondition"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.operator}}" userInput="{{conditionOperator}}" after="clickToChooseCondition" stepKey="selectOperator"/> + <waitForPageLoad after="selectOperator" stepKey="waitForOperatorOpened1"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('...')}}" after="waitForOperatorOpened1" stepKey="clickToChooserIcon"/> + <fillField selector="{{AdminCartPriceRulesFormSection.actionValue}}" userInput="{{actionValue}}" after="clickToChooserIcon" stepKey="choseNeededCategoryFromCategoryGrid"/> + <click selector="{{AdminCartPriceRulesFormSection.applyAction}}" after="choseNeededCategoryFromCategoryGrid" stepKey="applyAction"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontShoppingCartClickApplyDiscountButtonActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontShoppingCartClickApplyDiscountButtonActionGroup.xml new file mode 100644 index 000000000000..62686fd8b440 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontShoppingCartClickApplyDiscountButtonActionGroup.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontShoppingCartClickApplyDiscountButtonActionGroup"> + <conditionalClick selector="{{DiscountSection.DiscountTab}}" dependentSelector="{{DiscountSection.CouponInput}}" visible="false" stepKey="clickToAddDiscount"/> + <click selector="{{DiscountSection.ApplyCodeBtn}}" stepKey="clickToApplyDiscount"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontShoppingCartFillCouponCodeFieldActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontShoppingCartFillCouponCodeFieldActionGroup.xml new file mode 100644 index 000000000000..81f19eebc868 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontShoppingCartFillCouponCodeFieldActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontShoppingCartFillCouponCodeFieldActionGroup"> + <arguments> + <argument name="discountCode" type="string"/> + </arguments> + <conditionalClick selector="{{DiscountSection.DiscountTab}}" dependentSelector="{{DiscountSection.CouponInput}}" visible="false" stepKey="clickToAddDiscount"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField selector="{{DiscountSection.CouponInput}}" userInput="{{discountCode}}" stepKey="fillFieldDiscountCode"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml index 5f2b40dc63e2..37125fef11fc 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml @@ -30,6 +30,10 @@ <argument name="ruleName" value="{{_defaultCoupon.code}}"/> </actionGroup> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="resetFilter"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml index 198ba1cd64f3..95f866cb290d 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml @@ -30,6 +30,10 @@ <argument name="ruleName" value="{{_defaultCoupon.code}}"/> </actionGroup> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml index bc2f115b4687..fda6b35b06f5 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml @@ -30,6 +30,10 @@ <argument name="ruleName" value="{{_defaultCoupon.code}}"/> </actionGroup> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml index c80f43385d16..492efd048ff0 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml @@ -31,6 +31,7 @@ <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSimpleProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteCreatedCartPriceRule"> <argument name="ruleName" value="{{CartPriceRuleConditionAppliedForCategory.name}}"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml index 2c3574906848..c1ba77a4a1b9 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml @@ -30,6 +30,10 @@ <argument name="ruleName" value="{{_defaultCoupon.code}}"/> </actionGroup> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml index 1b24480b5808..e7a31e83df0d 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml @@ -30,6 +30,10 @@ <argument name="ruleName" value="{{SimpleSalesRule.name}}"/> </actionGroup> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml index 724860b12603..f0c6dce98e64 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml @@ -32,6 +32,10 @@ <argument name="ruleName" value="{{_defaultCoupon.code}}"/> </actionGroup> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml index d60a81dcdcef..a0d721825149 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml @@ -123,11 +123,11 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Add the first product to the cart --> - <amOnPage url="$$createConfigChildProduct1.sku$$.html" stepKey="goToProductPage1"/> + <amOnPage url="$$createConfigChildProduct1.custom_attributes[url_key]$$.html" stepKey="goToProductPage1"/> <waitForPageLoad stepKey="waitForProductPageLoad1"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/> <!-- Add the second product to the cart --> - <amOnPage url="$$createConfigChildProduct2.sku$$.html" stepKey="goToProductPage2"/> + <amOnPage url="$$createConfigChildProduct2.custom_attributes[url_key]$$.html" stepKey="goToProductPage2"/> <waitForPageLoad stepKey="waitForProductPageLoad2"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage2"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontApplyCartPriceRuleToBundleChildProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontApplyCartPriceRuleToBundleChildProductTest.xml new file mode 100644 index 000000000000..80eb79d9cc6f --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontApplyCartPriceRuleToBundleChildProductTest.xml @@ -0,0 +1,146 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontApplyCartPriceRuleToBundleChildProductTest"> + <annotations> + <features value="SalesRule"/> + <stories value="Create cart price rule"/> + <title value="Checking Cart Price Rule for bundle products"/> + <description value="Checking Cart Price Rule for bundle products"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-36654"/> + <useCaseId value="MC-35548"/> + <group value="salesRule"/> + </annotations> + <before> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct1"> + <field key="price">5.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct2"> + <field key="price">3.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct3"> + <field key="price">7.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct4"> + <field key="price">18.00</field> + </createData> + <createData entity="ApiBundleProduct" stepKey="createBundleProduct"/> + <createData entity="DropDownBundleOption" stepKey="createDropDownBundleOption"> + <requiredEntity createDataKey="createBundleProduct"/> + </createData> + <createData entity="CheckboxOption" stepKey="createCheckboxBundleOption"> + <requiredEntity createDataKey="createBundleProduct"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkDropDownOptionToProduct1"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createDropDownBundleOption"/> + <requiredEntity createDataKey="createSimpleProduct1"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkDropDownOptionToProduct2"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createDropDownBundleOption"/> + <requiredEntity createDataKey="createSimpleProduct2"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkCheckboxOptionToProduct3"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createCheckboxBundleOption"/> + <requiredEntity createDataKey="createSimpleProduct3"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkCheckboxOptionToProduct4"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createCheckboxBundleOption"/> + <requiredEntity createDataKey="createSimpleProduct4"/> + </createData> + + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!-- Make Attribute 'sku' accessible for Promo Rule Conditions --> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="editSkuAttribute"> + <argument name="ProductAttribute" value="sku"/> + </actionGroup> + <actionGroup ref="ChangeUseForPromoRuleConditionsProductAttributeActionGroup" stepKey="changeAttributePromoRule"> + <argument name="option" value="1"/> + </actionGroup> + <actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" stepKey="deleteCartPriceRules"/> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value="cataloginventory_stock"/> + </actionGroup> + </before> + <after> + <deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/> + <deleteData createDataKey="createSimpleProduct1" stepKey="deleteSimpleProduct1"/> + <deleteData createDataKey="createSimpleProduct2" stepKey="deleteSimpleProduct2"/> + <deleteData createDataKey="createSimpleProduct3" stepKey="deleteSimpleProduct3"/> + <deleteData createDataKey="createSimpleProduct4" stepKey="deleteSimpleProduct4"/> + + <actionGroup ref="AdminDeleteCartPriceRuleActionGroup" stepKey="deleteCartPriceRule"> + <argument name="ruleName" value="CatPriceRule"/> + </actionGroup> + <!-- Revert Attribute 'sku' to it's default value (not accessible for Promo Rule Conditions) --> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="editSkuAttribute"> + <argument name="ProductAttribute" value="sku"/> + </actionGroup> + <actionGroup ref="ChangeUseForPromoRuleConditionsProductAttributeActionGroup" stepKey="changeAttributePromoRule"> + <argument name="option" value="0"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + <!-- Start to create new cart price rule via SKU conditions and not default condition value --> + <actionGroup ref="AdminCreateCartPriceRuleWithConditionAndNotDefaultConditionOperatorActionGroup" stepKey="createRule"> + <argument name="ruleName" value="CatPriceRule"/> + <argument name="conditionOperator" value="is one of"/> + <argument name="actionValue" value="$createSimpleProduct1.sku$, $createSimpleProduct2.sku$"/> + </actionGroup> + <!-- Add Bundle product with simple1 and simple3 products to the cart --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefront"> + <argument name="productUrl" value="$createBundleProduct.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickCustomizeAndAddToCart"/> + <actionGroup ref="StorefrontSelectBundleProductDropDownOptionActionGroup" stepKey="addSimpleProduct1"> + <argument name="productName" value="$createSimpleProduct1.name$"/> + </actionGroup> + <checkOption selector="{{StorefrontBundledSection.checkboxOptionThreeProducts(CheckboxOption.title, '1')}}" stepKey="selectFirstCheckboxOption"/> + <actionGroup ref="StorefrontAddToTheCartButtonActionGroup" stepKey="addToTheCartBundleProduct"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added $createBundleProduct.name$ to your shopping cart." stepKey="seeAddToCartSuccessMessage"/> + <!-- Click "mini cart" icon--> + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> + <waitForPageLoad stepKey="waitForDetailsOpen"/> + <!--Check all products and Cart Subtotal and Discount is only for SimpleProduct1--> + <actionGroup ref="StorefrontCheckCartTotalWithDiscountCategoryActionGroup" stepKey="checkDiscountIsAppliedOnlyForSimple1productOnly"> + <argument name="subtotal" value="12.00"/> + <argument name="shipping" value="5.00"/> + <argument name="discount" value="0.50"/> + <argument name="total" value="16.50"/> + </actionGroup> + <!-- Clear Shopping cart --> + <actionGroup ref="DeleteProductFromShoppingCartActionGroup" stepKey="clearShoppingCart"> + <argument name="productName" value="$createBundleProduct.name$"/> + </actionGroup> + <!-- Add Bundle product with simple2 and simple3 products to the cart --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefront2"> + <argument name="productUrl" value="$createBundleProduct.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickCustomizeAndAddToCart2"/> + <actionGroup ref="StorefrontSelectBundleProductDropDownOptionActionGroup" stepKey="addSimpleProduct2"> + <argument name="productName" value="$createSimpleProduct2.name$"/> + </actionGroup> + <checkOption selector="{{StorefrontBundledSection.checkboxOptionThreeProducts(CheckboxOption.title, '1')}}" stepKey="selectFirstCheckboxOption2"/> + <actionGroup ref="StorefrontAddToTheCartButtonActionGroup" stepKey="addToTheCartBundleProduct2"/> + <!--Click "mini cart" icon--> + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart2"/> + <waitForPageLoad stepKey="waitForDetailsOpen2"/> + <!--Check all products and Cart Subtotal and Discount is only for SimpleProduct2--> + <actionGroup ref="StorefrontCheckCartTotalWithDiscountCategoryActionGroup" stepKey="checkDiscountIsAppliedOnlyForSimple2productOnly"> + <argument name="subtotal" value="10.00"/> + <argument name="shipping" value="5.00"/> + <argument name="discount" value="0.30"/> + <argument name="total" value="14.70"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml index 42e6d9e1d5b0..ceb92a5bd280 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml @@ -33,8 +33,8 @@ <argument name="productUrl" value="$$createBundleProductCreateBundleProduct.custom_attributes[url_key]$$"/> </actionGroup> <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomize"/> - <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.sku$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="selectOption0Product1"/> - <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.sku$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="checkOption0Product1"/> + <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.name$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="selectOption0Product1"/> + <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.name$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="checkOption0Product1"/> <checkOption selector="{{StorefrontBundledSection.radioButtonOptionTwoProducts('Radio Buttons Option', '1')}}" stepKey="selectOption1Product0"/> <seeCheckboxIsChecked selector="{{StorefrontBundledSection.radioButtonOptionTwoProducts('Radio Buttons Option', '1')}}" stepKey="checkOption1Product0"/> <checkOption selector="{{StorefrontBundledSection.checkboxOptionThreeProducts('Checkbox Option', '1')}}" stepKey="selectOption2Product0"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml index 18de326a2919..cacdc611cd56 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml @@ -79,7 +79,7 @@ </actionGroup> <!-- Step: 6-7. Open the Product Page, add the product to Cart, go to Shopping Cart and Apply the same coupon code --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="openProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="openProductPage"/> <waitForPageLoad stepKey="waitForPageLoad2"/> <actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartPriceRule"> <argument name="product" value="$$createSimpleProduct$$"/> @@ -99,8 +99,8 @@ <actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/> <!-- Checkout select Check/Money Order payment --> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <waitForElement selector="{{CheckoutSuccessMainSection.success}}" time="30" stepKey="waitForLoadSuccessPage"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoadSuccessPage"/> <!-- Start the usage processing consumer --> <actionGroup ref="CliConsumerStartActionGroup" stepKey="startUsageProcessingMessageQueue1"> @@ -109,7 +109,7 @@ </actionGroup> <!-- Step: 9-10. Open the Product Page, add the product to Cart, go to Shopping Cart and Apply the same coupon code --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="openProductPage1"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="openProductPage1"/> <waitForPageLoad stepKey="waitForPageLoad3"/> <actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartPriceRule1"> <argument name="product" value="$$createSimpleProduct$$"/> @@ -125,7 +125,7 @@ <actionGroup ref="StorefrontSignOutActionGroup" stepKey="storefrontSignOut"/> <!-- Step: 12-13. Open the Product Page, add the product to Cart, go to Shopping Cart and Apply the same coupon code --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="openProductPage2"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="openProductPage2"/> <waitForPageLoad stepKey="waitForPageLoad4"/> <actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartPriceRule2"> <argument name="product" value="$$createSimpleProduct$$"/> @@ -155,7 +155,7 @@ </actionGroup> <!-- Step; 15-16. Open the Product Page, add the product to Cart, go to Shopping Cart and Apply the same coupon code --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="openProductPage3"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="openProductPage3"/> <waitForPageLoad stepKey="waitForPageLoad5"/> <actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartPriceRule3"> <argument name="product" value="$$createSimpleProduct$$"/> @@ -171,7 +171,7 @@ <resetCookie userInput="PHPSESSID" stepKey="resetCookie"/> <!-- Step: 18-19. Open the Product Page, add the product to Cart, go to Shopping Cart and Apply the same coupon code --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="openProductPage4"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="openProductPage4"/> <waitForPageLoad stepKey="waitForPageLoad6"/> <actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartPriceRule4"> <argument name="product" value="$$createSimpleProduct$$"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountryTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountryTest.xml index 3b54df544210..6b39b7c927a9 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountryTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountryTest.xml @@ -33,7 +33,7 @@ </actionGroup> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> <deleteData createDataKey="createPreReqProduct" stepKey="deletePreReqProduct"/> - <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> + <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> </after> <!-- Create the rule... --> @@ -62,7 +62,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Add the product we created to our cart --> - <amOnPage url="$$createPreReqProduct.name$$.html" stepKey="goToProductPage"/> + <amOnPage url="$$createPreReqProduct.custom_attributes[url_key]$$.html" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="1" stepKey="fillQuantity"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleForBundleProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleForBundleProductTest.xml index 56486d2331bd..099936df0487 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleForBundleProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleForBundleProductTest.xml @@ -7,7 +7,7 @@ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="StorefrontCartPriceRuleForBundleProductTest"> + <test name="StorefrontCartPriceRuleForBundleProductTest" deprecated="StorefrontApplyCartPriceRuleToBundleChildProductTest"> <annotations> <features value="SalesRule"/> <stories value="MAGETWO-28921 - Cart Price Rule for bundle products"/> @@ -17,7 +17,7 @@ <testCaseId value="MAGETWO-28921"/> <group value="SalesRule"/> <skip> - <issueId value="MQE-2288" /> + <issueId value="DEPRECATED">Use StorefrontApplyCartPriceRuleToBundleChildProductTest instead</issueId> </skip> </annotations> @@ -100,7 +100,7 @@ <argument name="option" value="0" /> </actionGroup> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <!-- Reindex invalidated indices after product attribute has been created/deleted --> <magentoCron groups="index" stepKey="reindexInvalidatedIndices2" /> @@ -130,7 +130,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Add the first product to the cart --> - <amOnPage url="$$createBundleProduct.sku$$.html" stepKey="goToProductPage1"/> + <amOnPage url="$$createBundleProduct.custom_attributes[url_key]$$.html" stepKey="goToProductPage1"/> <waitForPageLoad stepKey="waitForProductPageLoad1"/> <!--Click "Customize and Add to Cart" button--> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcodeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcodeTest.xml index d0cba156f635..0e514b54f2e1 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcodeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcodeTest.xml @@ -33,7 +33,7 @@ </actionGroup> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> <deleteData createDataKey="createPreReqProduct" stepKey="deletePreReqProduct"/> - <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> + <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> </after> <!-- Create the rule... --> @@ -66,7 +66,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Add the product we created to our cart --> - <amOnPage url="$$createPreReqProduct.name$$.html" stepKey="goToProductPage"/> + <amOnPage url="$$createPreReqProduct.custom_attributes[url_key]$$.html" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="1" stepKey="fillQuantity"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantityTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantityTest.xml index 1a449017e038..2a0e6b60162a 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantityTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantityTest.xml @@ -34,7 +34,7 @@ </actionGroup> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> <deleteData createDataKey="createPreReqProduct" stepKey="deletePreReqProduct"/> - <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> + <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> </after> <!-- Create the rule... --> @@ -64,7 +64,7 @@ <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> <!-- Add 1 product to the cart --> - <amOnPage url="$$createPreReqProduct.name$$.html" stepKey="goToProductPage"/> + <amOnPage url="$$createPreReqProduct.custom_attributes[url_key]$$.html" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="1" stepKey="fillQuantity"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/> @@ -75,7 +75,7 @@ <dontSeeElement selector="{{CheckoutCartSummarySection.discountAmount}}" stepKey="dontSeeDiscount"/> <!-- Add the same product to the cart again (2 total) --> - <amOnPage url="$$createPreReqProduct.name$$.html" stepKey="goToProductPage2"/> + <amOnPage url="$$createPreReqProduct.custom_attributes[url_key]$$.html" stepKey="goToProductPage2"/> <waitForPageLoad stepKey="waitForProductPageLoad2"/> <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="1" stepKey="fillQuantity2"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage2"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleStateTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleStateTest.xml index 68f6fc93eab9..5a967c8c6f3d 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleStateTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleStateTest.xml @@ -33,7 +33,7 @@ </actionGroup> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> <deleteData createDataKey="createPreReqProduct" stepKey="deletePreReqProduct"/> - <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> + <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> </after> <!-- Create the rule... --> @@ -62,7 +62,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Add the product we created to our cart --> - <amOnPage url="$$createPreReqProduct.name$$.html" stepKey="goToProductPage"/> + <amOnPage url="$$createPreReqProduct.custom_attributes[url_key]$$.html" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="1" stepKey="fillQuantity"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotalTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotalTest.xml index 0ffe1516d023..3583cc7c1cf1 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotalTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotalTest.xml @@ -34,7 +34,7 @@ </actionGroup> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> <deleteData createDataKey="createPreReqProduct" stepKey="deletePreReqProduct"/> - <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> + <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> </after> <!-- Create the rule... --> @@ -62,7 +62,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Add 1 product worth $123.00 to the cart --> - <amOnPage url="$$createPreReqProduct.name$$.html" stepKey="goToProductPage"/> + <amOnPage url="$$createPreReqProduct.custom_attributes[url_key]$$.html" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="1" stepKey="fillQuantity"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/> @@ -73,7 +73,7 @@ <dontSeeElement selector="{{CheckoutCartSummarySection.discountAmount}}" stepKey="dontSeeDiscount"/> <!-- Add the same product to the cart again ($246.00 subtotal) --> - <amOnPage url="$$createPreReqProduct.name$$.html" stepKey="goToProductPage2"/> + <amOnPage url="$$createPreReqProduct.custom_attributes[url_key]$$.html" stepKey="goToProductPage2"/> <waitForPageLoad stepKey="waitForProductPageLoad2"/> <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="1" stepKey="fillQuantity2"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage2"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml index 8df45937bb54..b4f4c157bbd4 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml @@ -56,12 +56,8 @@ <createData entity="SimpleProduct2" stepKey="createSimpleProductThird"> <field key="price">5.50</field> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!-- Removed created Data --> diff --git a/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml b/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml index 689ea0a1fa53..a9e9e58563ce 100644 --- a/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml +++ b/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml @@ -120,7 +120,7 @@ </validation> <dataType>number</dataType> <tooltip> - <link>https://docs.magento.com/m2/ce/user_guide/configuration/scope.html</link> + <link>https://docs.magento.com/user-guide/configuration/scope.html</link> <description>What is this?</description> </tooltip> <label translate="true">Websites</label> @@ -493,7 +493,7 @@ <field name="stop_rules_processing" formElement="checkbox"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> - <item name="default" xsi:type="number">0</item> + <item name="default" xsi:type="number">1</item> <item name="source" xsi:type="string">sales_rule</item> </item> </argument> diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/StoreFrontAssertDropDownSearchSuggestionActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/StoreFrontAssertDropDownSearchSuggestionActionGroup.xml new file mode 100644 index 000000000000..226e30486251 --- /dev/null +++ b/app/code/Magento/Search/Test/Mftf/ActionGroup/StoreFrontAssertDropDownSearchSuggestionActionGroup.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StoreFrontAssertDropDownSearchSuggestionActionGroup"> + <annotations> + <description>Fills the Storefront Quick Search field. Validates that the Search Suggestion is present</description> + </annotations> + <arguments> + <argument name="searchQuery" type="string"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" stepKey="waitForQuickSearchToBeVisible"/> + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{searchQuery}}" stepKey="fillSearchInput"/> + <waitForElementVisible selector="{{StorefrontQuickSearchSection.searchDropDownSuggestion}}" stepKey="WaitForSearchDropDownSuggestion"/> + <click selector="//div[@class='panel wrapper']" stepKey="clickOnSomewhere"/> + <dontSee selector="{{StorefrontQuickSearchSection.searchDropDownSuggestion}}" stepKey="dontSeeDropDownSuggestion"/> + <click selector="{{StorefrontQuickSearchSection.searchPhrase}}" stepKey="clickOnSearchPhrase"/> + <pressKey selector="{{StorefrontQuickSearchSection.searchPhrase}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::DOWN]" stepKey="pressDown"/> + <waitForElementVisible selector="{{StorefrontQuickSearchSection.searchDropDownSuggestion}}" stepKey="WaitForSearchDropDownSuggestionSecond"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByControlButtonsTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByControlButtonsTest.xml new file mode 100644 index 000000000000..f105942ee6bb --- /dev/null +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByControlButtonsTest.xml @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontVerifySearchSuggestionByControlButtonsTest"> + <annotations> + <stories value="Search Term"/> + <title value="Auto suggestion box not reappearing after clicking outside the text field"/> + <description value="Auto suggestion box not reappearing after clicking outside the text field"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-40466"/> + <useCaseId value="MC-40376"/> + </annotations> + + <before> + <!-- Create Simple Product --> + <createData entity="defaultSimpleProduct" stepKey="simpleProduct"/> + + <!-- Login as admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + + <!-- Perform reindex and flush cache --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> + </before> + <after> + <!-- Delete create product --> + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> + + <!-- Go to the catalog search term page --> + <actionGroup ref="AdminOpenCatalogSearchTermIndexPageActionGroup" stepKey="openAdminCatalogSearchTermIndexPage"/> + + <!-- Filter the search term --> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByThirdSearchQuery"> + <argument name="searchQuery" value="$simpleProduct.name$"/> + </actionGroup> + <!-- Delete created below search terms --> + <actionGroup ref="AdminDeleteSearchTermActionGroup" stepKey="deleteSearchTerms"/> + </after> + + <!-- Go to storefront home page --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> + + <!-- Storefront quick search by product name --> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByProductName"> + <argument name="phrase" value="$simpleProduct.name$"/> + </actionGroup> + + <!-- Verify search suggestions and select the suggestion from dropdown options --> + <actionGroup ref="StoreFrontAssertDropDownSearchSuggestionActionGroup" stepKey="seeDropDownSearchSuggestion"> + <argument name="searchQuery" value="$simpleProduct.name$"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml index 8c468cce9182..dda47677ccfc 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml @@ -20,16 +20,14 @@ <before> <!-- Login as admin --> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!-- Delete all existing products --> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteAllProducts"/> <!-- Create product with description --> <createData entity="SimpleProductWithDescription" stepKey="simpleProduct"/> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!-- Delete created product --> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml index fb1f35730fd8..579ff2c63dfc 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml @@ -25,13 +25,8 @@ <!--Create Simple Product --> <createData entity="defaultSimpleProduct" stepKey="simpleProduct"/> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!-- Delete create product --> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml index 1558f9aa5342..95ad0f75d6a6 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml @@ -25,13 +25,8 @@ <!-- Create product with short description --> <createData entity="ApiProductWithDescription" stepKey="product"/> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml index 19c12843c23a..772eaba6647f 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml @@ -25,13 +25,8 @@ <!--Create Simple Product --> <createData entity="defaultSimpleProduct" stepKey="simpleProduct"/> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> diff --git a/app/code/Magento/Search/Ui/Component/Listing/Column/Website/Options.php b/app/code/Magento/Search/Ui/Component/Listing/Column/Website/Options.php index ede04b6d3db7..3deaa15f5bd3 100644 --- a/app/code/Magento/Search/Ui/Component/Listing/Column/Website/Options.php +++ b/app/code/Magento/Search/Ui/Component/Listing/Column/Website/Options.php @@ -65,8 +65,6 @@ public function toOptionArray() $currentOptions[$name]['value'] = $website->getId(); } - $this->options = array_values($currentOptions); - return $currentOptions; } } diff --git a/app/code/Magento/Search/view/adminhtml/ui_component/search_synonyms_form.xml b/app/code/Magento/Search/view/adminhtml/ui_component/search_synonyms_form.xml index cf2b0704dc15..9cff8c07d82b 100644 --- a/app/code/Magento/Search/view/adminhtml/ui_component/search_synonyms_form.xml +++ b/app/code/Magento/Search/view/adminhtml/ui_component/search_synonyms_form.xml @@ -72,7 +72,7 @@ </validation> <dataType>text</dataType> <tooltip> - <link>https://docs.magento.com/m2/ce/user_guide/stores/websites-stores-views.html</link> + <link>https://docs.magento.com/user-guide/stores/websites-stores-views.html</link> <description translate="true">You can adjust the scope of this synonym group by selecting an option from the list.</description> </tooltip> <label translate="true">Scope</label> diff --git a/app/code/Magento/Search/view/frontend/web/js/form-mini.js b/app/code/Magento/Search/view/frontend/web/js/form-mini.js index b8034fead76d..df651feb89d4 100644 --- a/app/code/Magento/Search/view/frontend/web/js/form-mini.js +++ b/app/code/Magento/Search/view/frontend/web/js/form-mini.js @@ -253,6 +253,8 @@ define([ } this.element.val(this.responseList.selected.find('.qs-option-name').text()); this.element.attr('aria-activedescendant', this.responseList.selected.attr('id')); + this._updateAriaHasPopup(true); + this.autoComplete.show(); } break; @@ -269,6 +271,8 @@ define([ } this.element.val(this.responseList.selected.find('.qs-option-name').text()); this.element.attr('aria-activedescendant', this.responseList.selected.attr('id')); + this._updateAriaHasPopup(true); + this.autoComplete.show(); } break; default: diff --git a/app/code/Magento/Security/Model/ResourceModel/UserExpiration.php b/app/code/Magento/Security/Model/ResourceModel/UserExpiration.php index 71a331a17800..240dda2f0dfb 100644 --- a/app/code/Magento/Security/Model/ResourceModel/UserExpiration.php +++ b/app/code/Magento/Security/Model/ResourceModel/UserExpiration.php @@ -7,10 +7,19 @@ namespace Magento\Security\Model\ResourceModel; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Model\AbstractModel; +use Magento\Framework\Model\ResourceModel\Db\AbstractDb; +use Magento\Framework\Model\ResourceModel\Db\Context; +use Magento\Framework\Stdlib\DateTime\Timezone\LocalizedDateToUtcConverterInterface; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; +use Magento\Security\Model\UserExpiration as UserExpirationModel; + /** * Admin User Expiration resource model */ -class UserExpiration extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb +class UserExpiration extends AbstractDb { /** @@ -21,24 +30,31 @@ class UserExpiration extends \Magento\Framework\Model\ResourceModel\Db\AbstractD protected $_isPkAutoIncrement = false; /** - * @var \Magento\Framework\Stdlib\DateTime\TimezoneInterface + * @var TimezoneInterface */ private $timezone; /** - * UserExpiration constructor. - * - * @param \Magento\Framework\Model\ResourceModel\Db\Context $context - * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone - * @param string $connectionName + * @var LocalizedDateToUtcConverterInterface + */ + private $localizedDateToUtcConverter; + + /** + * @param Context $context + * @param TimezoneInterface $timezone + * @param string|null $connectionName + * @param LocalizedDateToUtcConverterInterface|null $localizedDateToUtcConverter */ public function __construct( - \Magento\Framework\Model\ResourceModel\Db\Context $context, - \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone, - ?string $connectionName = null + Context $context, + TimezoneInterface $timezone, + ?string $connectionName = null, + ?LocalizedDateToUtcConverterInterface $localizedDateToUtcConverter = null ) { parent::__construct($context, $connectionName); $this->timezone = $timezone; + $this->localizedDateToUtcConverter = $localizedDateToUtcConverter ?: ObjectManager::getInstance() + ->get(LocalizedDateToUtcConverterInterface::class); } /** @@ -54,15 +70,17 @@ protected function _construct() /** * Convert to UTC time. * - * @param \Magento\Framework\Model\AbstractModel $userExpiration + * @param AbstractModel $userExpiration * @return $this - * @throws \Magento\Framework\Exception\LocalizedException + * @throws LocalizedException */ - protected function _beforeSave(\Magento\Framework\Model\AbstractModel $userExpiration) + protected function _beforeSave(AbstractModel $userExpiration) { - /** @var $userExpiration \Magento\Security\Model\UserExpiration */ + /** @var $userExpiration UserExpirationModel */ $expiresAt = $userExpiration->getExpiresAt(); - $utcValue = $this->timezone->convertConfigTimeToUtc($expiresAt); + $utcValue = strtotime($expiresAt) + ? $this->timezone->convertConfigTimeToUtc($expiresAt) + : $this->localizedDateToUtcConverter->convertLocalizedDateToUtc($expiresAt); $userExpiration->setExpiresAt($utcValue); return $this; @@ -71,15 +89,16 @@ protected function _beforeSave(\Magento\Framework\Model\AbstractModel $userExpir /** * Convert to store time. * - * @param \Magento\Framework\Model\AbstractModel $userExpiration - * @return $this|\Magento\Framework\Model\ResourceModel\Db\AbstractDb + * @param AbstractModel $userExpiration + * @return $this|AbstractDb * @throws \Exception */ - protected function _afterLoad(\Magento\Framework\Model\AbstractModel $userExpiration) + protected function _afterLoad(AbstractModel $userExpiration) { - /** @var $userExpiration \Magento\Security\Model\UserExpiration */ + /** @var $userExpiration UserExpirationModel */ if ($userExpiration->getExpiresAt()) { - $storeValue = $this->timezone->date($userExpiration->getExpiresAt()); + $date = new \DateTime($userExpiration->getExpiresAt()); + $storeValue = $this->timezone->date($date); $userExpiration->setExpiresAt($storeValue->format('Y-m-d H:i:s')); } diff --git a/app/code/Magento/Security/Model/SecurityCookie.php b/app/code/Magento/Security/Model/SecurityCookie.php index 9717fa398509..a39450f047ba 100644 --- a/app/code/Magento/Security/Model/SecurityCookie.php +++ b/app/code/Magento/Security/Model/SecurityCookie.php @@ -10,6 +10,7 @@ /** * Manager for a cookie with logout reason * + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) * @api * @since 100.1.0 */ @@ -80,6 +81,7 @@ public function setLogoutReasonCookie($status) { $metaData = $this->createCookieMetaData(); $metaData->setPath('/' . $this->backendData->getAreaFrontName()); + $metaData->setSameSite('Strict'); $this->phpCookieManager->setPublicCookie( self::LOGOUT_REASON_CODE_COOKIE_NAME, diff --git a/app/code/Magento/Security/Model/UserExpiration/Validator.php b/app/code/Magento/Security/Model/UserExpiration/Validator.php index 62dbd7852ff3..ae46e2c3cf2f 100644 --- a/app/code/Magento/Security/Model/UserExpiration/Validator.php +++ b/app/code/Magento/Security/Model/UserExpiration/Validator.php @@ -7,7 +7,9 @@ namespace Magento\Security\Model\UserExpiration; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Stdlib\DateTime\DateTime; +use Magento\Framework\Stdlib\DateTime\Timezone\LocalizedDateToUtcConverterInterface; use Magento\Framework\Stdlib\DateTime\TimezoneInterface; use Magento\Framework\Validator\AbstractValidator; @@ -16,25 +18,35 @@ */ class Validator extends AbstractValidator { - - /**@var TimezoneInterface */ + /** + * @var TimezoneInterface + */ private $timezone; - /**@var DateTime */ + /** + * @var DateTime + */ private $dateTime; /** - * Validator constructor. - * + * @var LocalizedDateToUtcConverterInterface + */ + private $localizedDateToUtcConverter; + + /** * @param TimezoneInterface $timezone * @param DateTime $dateTime + * @param LocalizedDateToUtcConverterInterface|null $localizedDateToUtcConverter */ public function __construct( TimezoneInterface $timezone, - DateTime $dateTime + DateTime $dateTime, + ?LocalizedDateToUtcConverterInterface $localizedDateToUtcConverter = null ) { $this->timezone = $timezone; $this->dateTime = $dateTime; + $this->localizedDateToUtcConverter = $localizedDateToUtcConverter ?: ObjectManager::getInstance() + ->get(LocalizedDateToUtcConverterInterface::class); } /** @@ -48,18 +60,13 @@ public function isValid($value) { $this->_clearMessages(); $messages = []; - $expiresAt = $value; $label = 'Expiration date'; - if (\Zend_Validate::is($expiresAt, 'NotEmpty')) { - if (strtotime($expiresAt)) { - $currentTime = $this->dateTime->gmtTimestamp(); - $utcExpiresAt = $this->timezone->convertConfigTimeToUtc($expiresAt); - $expiresAt = $this->timezone->date($utcExpiresAt)->getTimestamp(); - if ($expiresAt < $currentTime) { - $messages['expires_at'] = __('"%1" must be later than the current date.', $label); - } - } else { - $messages['expires_at'] = __('"%1" is not a valid date.', $label); + if (\Zend_Validate::is($value, 'NotEmpty')) { + $utcExpiresAt = $this->localizedDateToUtcConverter->convertLocalizedDateToUtc($value); + $currentTime = $this->dateTime->gmtTimestamp(); + $expiresAt = $this->timezone->date($utcExpiresAt)->getTimestamp(); + if ($expiresAt < $currentTime) { + $messages['expires_at'] = __('"%1" must be later than the current date.', $label); } } $this->_addMessages($messages); diff --git a/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml b/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml index dc88ad9d2cbf..c7bfdd8bb9e9 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml @@ -48,7 +48,8 @@ <wait time="120" stepKey="waitForUserToExpire"/> <actionGroup ref="AdminOpenCustomersGridActionGroup" stepKey="navigateToCustomers"/> <!-- Confirm that user is logged out --> - <seeInCurrentUrl url="{{AdminLoginPage.url}}" stepKey="seeAdminLoginUrl"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeAdminLoginUrl"/> + <seeElement selector="{{AdminLoginFormSection.loginBlock}}" stepKey="assertAdminLoginPageIsAvailable"/> <!-- Delete created user --> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> diff --git a/app/code/Magento/Security/Test/Mftf/Test/StorefrontSecureChangingCustomerEmailTest.xml b/app/code/Magento/Security/Test/Mftf/Test/StorefrontSecureChangingCustomerEmailTest.xml index 6a89d90a2d8c..6e866893fa51 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/StorefrontSecureChangingCustomerEmailTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/StorefrontSecureChangingCustomerEmailTest.xml @@ -15,41 +15,44 @@ <title value="Changing Customer Email Test"/> <description value="Changing Customer's email with correct and wrong passwords"/> <testCaseId value="MC-14385"/> + <useCaseId value="MC-38673"/> <severity value="CRITICAL"/> <group value="security"/> <group value="mtf_migrated"/> </annotations> - <before> <createData entity="Simple_US_Customer" stepKey="customer"/> </before> <after> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> </after> - - <!-- TEST BODY --> <!-- Go to storefront home page --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> <!-- Login as created customer --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> - <argument name="Customer" value="$$customer$$"/> + <argument name="Customer" value="$customer$"/> </actionGroup> <!-- Navigate to "Account Information" tab First Time--> <actionGroup ref="StorefrontOpenCustomerAccountInfoEditPageActionGroup" stepKey="goToCustomerEditPageFirstTime"/> - <!-- Checking Email checkbox, entering new email, saving with correct password --> + <!-- Enter new email and save with correct password --> <actionGroup ref="StorefrontCustomerChangeEmailActionGroup" stepKey="changeEmailCorrectAttempt"> - <argument name="email" value="$$customer.email$$"/> - <argument name="password" value="$$customer.password$$"/> + <argument name="email" value="$customer.email$"/> + <argument name="password" value="$customer.password$"/> </actionGroup> <!-- See Success Notify--> <actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="seeSuccessMessage"> <argument name="message" value="You saved the account information."/> </actionGroup> + <see userInput="Default welcome msg!" selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" stepKey="assertWelcomeMessage"/> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccountAfterEmailChange"> + <argument name="Customer" value="$customer$"/> + </actionGroup> <!-- Navigate to "Account Information" tab Second Time--> <actionGroup ref="StorefrontOpenCustomerAccountInfoEditPageActionGroup" stepKey="goToCustomerEditPageSecondTime" /> - <!-- Checking Email checkbox, entering new email, saving with incorrect password --> + <!-- Enter new email and save with correct password --> <actionGroup ref="StorefrontCustomerChangeEmailActionGroup" stepKey="changeEmailWrongAttempt"> - <argument name="email" value="$$customer.email$$"/> + <argument name="email" value="$customer.email$"/> <argument name="password" value="WRONG_PASSWORD_123123q"/> </actionGroup> <!-- See Failure Message--> @@ -57,8 +60,5 @@ <argument name="message" value="The password doesn't match this account. Verify the password and try again."/> <argument name="messageType" value="error"/> </actionGroup> - - <!-- END TEST BODY --> - </test> </tests> diff --git a/app/code/Magento/Security/Test/Unit/Model/SecurityCookieTest.php b/app/code/Magento/Security/Test/Unit/Model/SecurityCookieTest.php index 6af1139a561b..10759d828d73 100644 --- a/app/code/Magento/Security/Test/Unit/Model/SecurityCookieTest.php +++ b/app/code/Magento/Security/Test/Unit/Model/SecurityCookieTest.php @@ -57,7 +57,7 @@ protected function setUp(): void $this->cookieMetadataMock = $this->createPartialMock( PublicCookieMetadata::class, - ['setPath', 'setDuration'] + ['setPath', 'setDuration', 'setSameSite'] ); $this->cookieReaderMock = $this->createPartialMock( @@ -118,6 +118,11 @@ public function testSetLogoutReasonCookie() ->with('/' . $frontName) ->willReturnSelf(); + $this->cookieMetadataMock->expects($this->once()) + ->method('setSameSite') + ->with('Strict') + ->willReturnSelf(); + $this->phpCookieManagerMock->expects($this->once()) ->method('setPublicCookie') ->with( diff --git a/app/code/Magento/Security/Test/Unit/Model/UserExpiration/ValidatorTest.php b/app/code/Magento/Security/Test/Unit/Model/UserExpiration/ValidatorTest.php deleted file mode 100644 index a3ffed69ca9b..000000000000 --- a/app/code/Magento/Security/Test/Unit/Model/UserExpiration/ValidatorTest.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\Security\Test\Unit\Model\UserExpiration; - -use Magento\Framework\Stdlib\DateTime\Timezone; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\Security\Model\UserExpiration\Validator; -use PHPUnit\Framework\MockObject\MockObject; -use PHPUnit\Framework\TestCase; - -/** - * Test class for \Magento\Security\Model\UserExpiration\Validator. - */ -class ValidatorTest extends TestCase -{ - - /** - * @var Validator - */ - private $validator; - - /** - * @var MockObject|\Magento\Framework\Stdlib\DateTime\DateTime - */ - private $dateTimeMock; - - /**@var \PHPUnit\Framework\MockObject\MockObject|\Magento\Framework\Stdlib\DateTime\TimezoneInterface */ - private $timezoneMock; - - protected function setUp(): void - { - $objectManager = new ObjectManager($this); - $this->dateTimeMock = - $this->createPartialMock(\Magento\Framework\Stdlib\DateTime\DateTime::class, ['gmtTimestamp']); - $this->timezoneMock = - $this->createPartialMock( - Timezone::class, - ['date', 'convertConfigTimeToUtc'] - ); - $this->validator = $objectManager->getObject( - Validator::class, - ['dateTime' => $this->dateTimeMock, 'timezone' => $this->timezoneMock] - ); - } - - public function testWithInvalidDate() - { - $expireDate = 'invalid_date'; - $this->assertFalse($this->validator->isValid($expireDate)); - $this->assertStringContainsString( - '"Expiration date" is not a valid date.', - (string)current($this->validator->getMessages()) - ); - } - - public function testWithPastDate() - { - /** @var \DateTime|MockObject $dateObject */ - $dateObject = $this->createMock(\DateTime::class); - $this->timezoneMock->expects(static::once()) - ->method('date') - ->willReturn($dateObject); - - $currentDate = new \DateTime(); - $currentDate = $currentDate->getTimestamp(); - $expireDate = new \DateTime(); - $expireDate->modify('-10 days'); - - $this->dateTimeMock->expects(static::once())->method('gmtTimestamp')->willReturn($currentDate); - $this->timezoneMock->expects(static::once())->method('date')->willReturn($expireDate); - $dateObject->expects(static::once())->method('getTimestamp')->willReturn($expireDate->getTimestamp()); - $this->assertFalse($this->validator->isValid($expireDate->format('Y-m-d H:i:s'))); - $this->assertStringContainsString( - '"Expiration date" must be later than the current date.', - (string)current($this->validator->getMessages()) - ); - } - - public function testWithFutureDate() - { - /** @var \DateTime|MockObject $dateObject */ - $dateObject = $this->createMock(\DateTime::class); - $this->timezoneMock->expects(static::once()) - ->method('date') - ->willReturn($dateObject); - $currentDate = new \DateTime(); - $currentDate = $currentDate->getTimestamp(); - $expireDate = new \DateTime(); - $expireDate->modify('+10 days'); - - $this->dateTimeMock->expects(static::once())->method('gmtTimestamp')->willReturn($currentDate); - $this->timezoneMock->expects(static::once())->method('date')->willReturn($expireDate); - $dateObject->expects(static::once())->method('getTimestamp')->willReturn($expireDate->getTimestamp()); - static::assertTrue($this->validator->isValid($expireDate->format('Y-m-d H:i:s'))); - static::assertEquals([], $this->validator->getMessages()); - } -} diff --git a/app/code/Magento/Security/view/adminhtml/web/js/confirm-redirect.js b/app/code/Magento/Security/view/adminhtml/web/js/confirm-redirect.js index 989785d251ff..60c750bacb31 100644 --- a/app/code/Magento/Security/view/adminhtml/web/js/confirm-redirect.js +++ b/app/code/Magento/Security/view/adminhtml/web/js/confirm-redirect.js @@ -9,7 +9,7 @@ define( 'use strict'; return function (config, element) { - $(element).click(config, function () { + $(element).on('click', config, function () { confirmSetLocation(config.message, config.url); }); }; diff --git a/app/code/Magento/SendFriend/Model/SendFriend.php b/app/code/Magento/SendFriend/Model/SendFriend.php index b84205b70201..bb5fda543896 100644 --- a/app/code/Magento/SendFriend/Model/SendFriend.php +++ b/app/code/Magento/SendFriend/Model/SendFriend.php @@ -8,6 +8,9 @@ namespace Magento\SendFriend\Model; use Magento\Framework\Exception\LocalizedException as CoreException; +use Magento\Framework\Stdlib\Cookie\CookieMetadata; +use Magento\Framework\Stdlib\Cookie\CookieMetadataFactory; +use Magento\Framework\App\ObjectManager; /** * SendFriend Log @@ -112,6 +115,11 @@ class SendFriend extends \Magento\Framework\Model\AbstractModel */ protected $remoteAddress; + /** + * @var CookieMetadataFactory + */ + private $cookieMetadataFactory; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry @@ -126,6 +134,7 @@ class SendFriend extends \Magento\Framework\Model\AbstractModel * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection * @param array $data + * @param CookieMetadataFactory $cookieMetadataFactory * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -141,7 +150,8 @@ public function __construct( \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, - array $data = [] + array $data = [], + CookieMetadataFactory $cookieMetadataFactory = null ) { $this->_storeManager = $storeManager; $this->_transportBuilder = $transportBuilder; @@ -151,6 +161,9 @@ public function __construct( $this->remoteAddress = $remoteAddress; $this->cookieManager = $cookieManager; $this->inlineTranslation = $inlineTranslation; + $this->cookieMetadataFactory = $cookieMetadataFactory ?? ObjectManager::getInstance()->get( + CookieMetadataFactory::class + ); parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -484,6 +497,11 @@ protected function _sentCountByCookies($increment = false) $cookieName = $this->_sendfriendData->getCookieName(); $time = time(); $newTimes = []; + $sensitiveCookMetadata = $this->cookieMetadataFactory->createSensitiveCookieMetadata( + [ + CookieMetadata::KEY_SAME_SITE => 'Lax' + ] + ); if (isset($this->_lastCookieValue[$cookieName])) { $oldTimes = $this->_lastCookieValue[$cookieName]; @@ -504,7 +522,7 @@ protected function _sentCountByCookies($increment = false) if ($increment) { $newTimes[] = $time; $newValue = implode(',', $newTimes); - $this->cookieManager->setSensitiveCookie($cookieName, $newValue); + $this->cookieManager->setSensitiveCookie($cookieName, $newValue, $sensitiveCookMetadata); $this->_lastCookieValue[$cookieName] = $newValue; } diff --git a/app/code/Magento/SendFriend/Test/Unit/Model/SendFriendTest.php b/app/code/Magento/SendFriend/Test/Unit/Model/SendFriendTest.php index c0de26a7c45f..830b6caf96a3 100644 --- a/app/code/Magento/SendFriend/Test/Unit/Model/SendFriendTest.php +++ b/app/code/Magento/SendFriend/Test/Unit/Model/SendFriendTest.php @@ -7,12 +7,15 @@ namespace Magento\SendFriend\Test\Unit\Model; +use Magento\Framework\Stdlib\Cookie\CookieMetadata; +use Magento\Framework\Stdlib\Cookie\SensitiveCookieMetadata; use Magento\Framework\Stdlib\CookieManagerInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\SendFriend\Helper\Data; use Magento\SendFriend\Model\SendFriend; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Magento\Framework\Stdlib\Cookie\CookieMetadataFactory; /** * Test SendFriend @@ -35,6 +38,11 @@ class SendFriendTest extends TestCase */ protected $sendfriendDataMock; + /** + * @var MockObject|CookieMetadataFactory + */ + protected $cookieMetadataFactoryMock; + protected function setUp(): void { $objectManager = new ObjectManager($this); @@ -42,12 +50,18 @@ protected function setUp(): void ->disableOriginalConstructor() ->getMock(); $this->cookieManagerMock = $this->getMockForAbstractClass(CookieManagerInterface::class); + $this->cookieMetadataFactoryMock = $this->getMockBuilder( + CookieMetadataFactory::class + ) + ->disableOriginalConstructor() + ->getMock(); $this->model = $objectManager->getObject( SendFriend::class, [ 'sendfriendData' => $this->sendfriendDataMock, 'cookieManager' => $this->cookieManagerMock, + 'cookieMetadataFactory' => $this->cookieMetadataFactoryMock ] ); } @@ -69,12 +83,25 @@ public function testGetSentCountWithCheckCookie() public function testSentCountByCookies() { $cookieName = 'testCookieName'; + $sensitiveCookieMetadataMock = $this->getMockBuilder( + SensitiveCookieMetadata::class + ) + ->disableOriginalConstructor() + ->getMock(); $this->sendfriendDataMock->expects($this->once())->method('getCookieName')->with()->willReturn( $cookieName ); $this->cookieManagerMock->expects($this->once())->method('getCookie')->with($cookieName); $this->cookieManagerMock->expects($this->once())->method('setSensitiveCookie'); + $this->cookieMetadataFactoryMock->expects($this->once()) + ->method('createSensitiveCookieMetadata') + ->with( + [ + CookieMetadata::KEY_SAME_SITE => 'Lax' + ] + ) + ->willReturn($sensitiveCookieMetadataMock); $sendFriendClass = new \ReflectionClass(SendFriend::class); $method = $sendFriendClass->getMethod('_sentCountByCookies'); $method->setAccessible(true); diff --git a/app/code/Magento/SendFriend/etc/adminhtml/system.xml b/app/code/Magento/SendFriend/etc/adminhtml/system.xml index 6360c42655a0..0092fe4ab291 100644 --- a/app/code/Magento/SendFriend/etc/adminhtml/system.xml +++ b/app/code/Magento/SendFriend/etc/adminhtml/system.xml @@ -16,7 +16,7 @@ <field id="enabled" translate="label comment" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> <label>Enabled</label> <comment> - <![CDATA[We strongly recommend to enable a <a href="https://devdocs.magento.com/guides/v2.3/security/google-recaptcha.html" target="_blank">CAPTCHA solution</a> alongside enabling "Email to a Friend" to ensure abuse of this feature does not occur.]]> + <![CDATA[We strongly recommend to enable a <a href="https://devdocs.magento.com/guides/v2.4/security/google-recaptcha.html" target="_blank">CAPTCHA solution</a> alongside enabling "Email to a Friend" to ensure abuse of this feature does not occur.]]> </comment> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> </field> diff --git a/app/code/Magento/SendFriend/i18n/en_US.csv b/app/code/Magento/SendFriend/i18n/en_US.csv index 8d5b596fe1ca..96a0665df4d3 100644 --- a/app/code/Magento/SendFriend/i18n/en_US.csv +++ b/app/code/Magento/SendFriend/i18n/en_US.csv @@ -45,4 +45,4 @@ Enabled,Enabled "Max Recipients","Max Recipients" "Max Products Sent in 1 Hour","Max Products Sent in 1 Hour" "Limit Sending By","Limit Sending By" -"We strongly recommend to enable a <a href=""https://devdocs.magento.com/guides/v2.3/security/google-recaptcha.html"" target="_blank">CAPTCHA solution</a> alongside enabling ""Email to a Friend"" to ensure abuse of this feature does not occur.","We strongly recommend to enable a <a href=""https://devdocs.magento.com/guides/v2.3/security/google-recaptcha.html"" target="_blank">CAPTCHA solution</a> alongside enabling ""Email to a Friend"" to ensure abuse of this feature does not occur." +"We strongly recommend to enable a <a href=""https://devdocs.magento.com/guides/v2.4/security/google-recaptcha.html"" target="_blank">CAPTCHA solution</a> alongside enabling ""Email to a Friend"" to ensure abuse of this feature does not occur.","We strongly recommend to enable a <a href=""https://devdocs.magento.com/guides/v2.4/security/google-recaptcha.html"" target="_blank">CAPTCHA solution</a> alongside enabling ""Email to a Friend"" to ensure abuse of this feature does not occur." diff --git a/app/code/Magento/SendFriend/view/frontend/templates/send.phtml b/app/code/Magento/SendFriend/view/frontend/templates/send.phtml index b1e3da8612f7..bcfc243a4364 100644 --- a/app/code/Magento/SendFriend/view/frontend/templates/send.phtml +++ b/app/code/Magento/SendFriend/view/frontend/templates/send.phtml @@ -11,6 +11,7 @@ * @var \Magento\SendFriend\Block\Send $block * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound ?> <script id="add-recipient-tmpl" type="text/x-magento-template"> diff --git a/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging.php b/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging.php index ce4521c9baa5..f66b37a9cd34 100644 --- a/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging.php +++ b/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging.php @@ -380,7 +380,7 @@ public function getContentTypes() public function getCustomValueCurrencyCode() { $orderInfo = $this->getShipment()->getOrder(); - return $orderInfo->getBaseCurrency()->getCurrencyCode(); + return $orderInfo->getOrderCurrency()->getCurrencyCode(); } /** diff --git a/app/code/Magento/Shipping/Block/Items.php b/app/code/Magento/Shipping/Block/Items.php index f6dc5daa05fd..59f92e8ea303 100644 --- a/app/code/Magento/Shipping/Block/Items.php +++ b/app/code/Magento/Shipping/Block/Items.php @@ -12,6 +12,8 @@ namespace Magento\Shipping\Block; /** + * Shipping Items Block + * * @api * @since 100.0.2 */ @@ -49,6 +51,8 @@ public function getOrder() } /** + * Get Print Shipment Url + * * @param object $shipment * @return string */ @@ -58,6 +62,8 @@ public function getPrintShipmentUrl($shipment) } /** + * Get Print All Shipments Url + * * @param object $order * @return string */ @@ -77,7 +83,7 @@ public function getCommentsHtml($shipment) $html = ''; $comments = $this->getChildBlock('shipment_comments'); if ($comments) { - $comments->setEntity($shipment)->setTitle(__('About Your Shipment')); + $comments->setEntity($shipment)->setTitle($this->escapeHtmlAttr(__('About Your Shipment'))); $html = $comments->toHtml(); } return $html; diff --git a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php index 0965c4a472c2..e80b0f89b193 100644 --- a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php +++ b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php @@ -404,6 +404,23 @@ public function getSortOrder() return $this->getConfigData('sort_order'); } + /** + * Check if the request has free shipping weight + * + * @param \Magento\Quote\Model\Quote\Address\RateRequest $request + * @return bool + */ + private function hasFreeMethodWeight($request): bool + { + return ( + $request->getFreeShipping() + || ( + $request->hasFreeMethodWeight() + && ((float) $request->getFreeMethodWeight()) !== ((float) $request->getPackageWeight()) + ) + ); + } + /** * Allows free shipping when all product items have free shipping. * @@ -414,10 +431,7 @@ public function getSortOrder() */ protected function _updateFreeMethodQuote($request) { - if (!$request->getFreeShipping()) { - return; - } - if ($request->getFreeMethodWeight() == $request->getPackageWeight() || !$request->hasFreeMethodWeight()) { + if (!$this->hasFreeMethodWeight($request)) { return; } diff --git a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php index c2238ff1a380..f88fecf84be6 100644 --- a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php +++ b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php @@ -654,7 +654,7 @@ public function getMethodPrice($cost, $method = '') 'free_shipping_enable' ) && $this->getConfigData( 'free_shipping_subtotal' - ) <= $this->_rawRequest->getBaseSubtotalInclTax() ? '0.00' : $this->getFinalPriceWithHandlingFee( + ) <= $this->_rawRequest->getValueWithDiscount() ? '0.00' : $this->getFinalPriceWithHandlingFee( $cost ); } diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml index fe2a1bf86a8c..da2561ed7cf5 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml @@ -64,9 +64,7 @@ <argument name="file" value="usa_tablerates.csv"/> </actionGroup> <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!--Delete created data--> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminValidateShippingTrackingNumberTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminValidateShippingTrackingNumberTest.xml index 0d709e1d0800..de45cbf9bb2f 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminValidateShippingTrackingNumberTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminValidateShippingTrackingNumberTest.xml @@ -19,6 +19,22 @@ <before> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> + <createData entity="CustomerCart" stepKey="createCustomerCart"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItem"> + <requiredEntity createDataKey="createCustomerCart"/> + <requiredEntity createDataKey="createSimpleProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformation"> + <requiredEntity createDataKey="createCustomerCart"/> + </updateData> + <createData entity="Shipment" stepKey="shipOrder"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> @@ -26,12 +42,11 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <actionGroup ref="CreateOrderActionGroup" stepKey="goToCreateOrderPage"> - <argument name="customer" value="$$createCustomer$$"/> - <argument name="product" value="$$createSimpleProduct$$"/> - </actionGroup> - <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> - <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="createShipmentForOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToCreateOrderPage"/> + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="openOrdersGrid"/> + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCart.return$)}}" stepKey="orderId"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="createShipmentForOrder"/> <actionGroup ref="FilterShipmentGridByOrderIdActionGroup" stepKey="filterForNewlyCreatedShipment"> <argument name="orderId" value="$orderId"/> </actionGroup> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/StorefrontAssertShippingPricesPresentAfterApplyingCartRuleTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/StorefrontAssertShippingPricesPresentAfterApplyingCartRuleTest.xml new file mode 100644 index 000000000000..53e91fbdb24c --- /dev/null +++ b/app/code/Magento/Shipping/Test/Mftf/Test/StorefrontAssertShippingPricesPresentAfterApplyingCartRuleTest.xml @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontAssertShippingPricesPresentAfterApplyingCartRuleTest"> + <annotations> + <features value="Shipping"/> + <stories value="Cart price rules"/> + <title value="Assert that shipping methods prices will be correct after cart price rule applied"/> + <description value="Shipping method prices should be displayed correctly on checkout after applied cart price rule"/> + <severity value="MAJOR"/> + <testCaseId value="MC-42229"/> + <useCaseId value="MC-24379"/> + <group value="shipping"/> + <group value="SalesRule"/> + </annotations> + <before> + <createData entity="SimpleProduct2" stepKey="createProduct"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPage"/> + <actionGroup ref="AdminSwitchWebsiteActionGroup" stepKey="switchDefaultWebsite"> + <argument name="website" value="_defaultWebsite"/> + </actionGroup> + <actionGroup ref="AdminChangeTableRatesShippingMethodStatusActionGroup" stepKey="enableTableRatesShippingMethodForDefaultWebsite"> + <argument name="status" value="1"/> + </actionGroup> + <actionGroup ref="AdminImportFileTableRatesShippingMethodActionGroup" stepKey="importCSVFile"> + <argument name="file" value="usa_tablerates.csv"/> + </actionGroup> + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig"/> + <actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" stepKey="deleteAllExistingCartPriceRules"/> + <actionGroup ref="AdminOpenNewCartPriceRuleFormPageActionGroup" stepKey="createCartPriceRule"/> + <actionGroup ref="AdminCartPriceRuleFillMainInfoActionGroup" stepKey="fillCartPriceRuleMainInfo"> + <argument name="name" value="{{CartPriceRuleConditionForSubtotalForMultiShipping.name}}"/> + <argument name="description" value="{{CartPriceRuleConditionForSubtotalForMultiShipping.description}}"/> + </actionGroup> + <actionGroup ref="AdminCartPriceRuleFillCouponInfoActionGroup" stepKey="fillCartPriceRuleCouponInfo"/> + <actionGroup ref="AdminCartPriceRuleFillShippingConditionActionGroup" stepKey="setCartAttributeConditionForCartPriceRule"/> + <actionGroup ref="AdminCreateCartPriceRuleActionsSectionDiscountFieldsActionGroup" stepKey="fillCartPriceRuleActionsSection"> + <argument name="rule" value="CartPriceRuleConditionForSubtotalForMultiShipping"/> + </actionGroup> + <actionGroup ref="AdminCreateCartPriceRuleActionsSectionFreeShippingActionGroup" stepKey="fillCartPriceRuleFreeShippingActionsSection"> + <argument name="freeShippingOption" value="{{CartPriceRuleConditionForSubtotalForMultiShipping.simple_free_shipping}}"/> + </actionGroup> + <actionGroup ref="AdminCartPriceRuleSaveActionGroup" stepKey="saveCartPriceRule"/> + </before> + <after> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" stepKey="deleteAllCartPriceRules"/> + <actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPage2"/> + <actionGroup ref="AdminSwitchWebsiteActionGroup" stepKey="switchDefaultWebsite2"> + <argument name="website" value="_defaultWebsite"/> + </actionGroup> + <actionGroup ref="AdminChangeTableRatesShippingMethodStatusActionGroup" stepKey="disableTableRatesShippingMethodForDefaultWebsite"> + <argument name="status" value="0"/> + </actionGroup> + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig2"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToProductPage"> + <argument name="productUrlKey" value="$createProduct.custom_attributes[url_key]$"/> + </actionGroup> + + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> + <argument name="product" value="$createProduct$" /> + <argument name="productCount" value="1" /> + </actionGroup> + + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> + + <actionGroup ref="GuestCheckoutFillNewShippingAddressActionGroup" stepKey="guestCheckoutFillingShippingSection"> + <argument name="customer" value="CustomerEntityOne" /> + <argument name="address" value="CustomerAddressSimple" /> + </actionGroup> + <see selector="{{CheckoutShippingMethodsSection.shippingRatePriceByName('Fixed')}}" userInput="$5.00" stepKey="assertFlatRatedMethodPrice"/> + <see selector="{{CheckoutShippingMethodsSection.shippingRatePriceByName('Table Rate')}}" userInput="$7.99" stepKey="assertTableRatedMethodPrice"/> + <click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('Flat Rate')}}" stepKey="selectFlatRateShippingMethod"/> + <actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="goToPaymentStep"/> + <actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyCoupon"> + <argument name="discountCode" value="{{_defaultCoupon.code}}"/> + </actionGroup> + + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnHomePageAfterCartRuleApplied"/> + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart2"/> + <see selector="{{CheckoutShippingMethodsSection.shippingRatePriceByName('Fixed')}}" userInput="$0.00" stepKey="assertFlatRatedMethodPriceAfterCartRule"/> + <see selector="{{CheckoutShippingMethodsSection.shippingRatePriceByName('Table Rate')}}" userInput="$7.99" stepKey="assertTableRatedMethodPriceAfterCartRule"/> + </test> +</tests> diff --git a/app/code/Magento/Shipping/view/adminhtml/templates/order/tracking.phtml b/app/code/Magento/Shipping/view/adminhtml/templates/order/tracking.phtml index 1dcc7439532b..1f5ce694939f 100644 --- a/app/code/Magento/Shipping/view/adminhtml/templates/order/tracking.phtml +++ b/app/code/Magento/Shipping/view/adminhtml/templates/order/tracking.phtml @@ -3,8 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -?> -<?php + +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** * @var $block Magento\Shipping\Block\Adminhtml\Order\Tracking * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer diff --git a/app/code/Magento/Sitemap/Model/ResourceModel/Catalog/Product.php b/app/code/Magento/Sitemap/Model/ResourceModel/Catalog/Product.php index dc15819b087b..41347263839e 100644 --- a/app/code/Magento/Sitemap/Model/ResourceModel/Catalog/Product.php +++ b/app/code/Magento/Sitemap/Model/ResourceModel/Catalog/Product.php @@ -5,11 +5,9 @@ */ namespace Magento\Sitemap\Model\ResourceModel\Catalog; -use Magento\Catalog\Helper\Product as HelperProduct; use Magento\Catalog\Model\Product\Image\UrlBuilder; use Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator; use Magento\Framework\App\ObjectManager; -use Magento\Store\Model\ScopeInterface; use Magento\Store\Model\Store; /** @@ -82,28 +80,11 @@ class Product extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb */ protected $_mediaConfig; - /** - * @var \Magento\Catalog\Model\Product - */ - private $productModel; - - /** - * @var \Magento\Catalog\Helper\Image - */ - private $catalogImageHelper; - /** * @var UrlBuilder */ private $imageUrlBuilder; - /** - * Scope Config - * - * @var \Magento\Framework\App\Config\ScopeConfigInterface - */ - private $scopeConfig; - /** * Product constructor. * @@ -122,6 +103,7 @@ class Product extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb * @param \Magento\Framework\App\Config\ScopeConfigInterface|null $scopeConfig * @param UrlBuilder $urlBuilder * @SuppressWarnings(PHPMD.ExcessiveParameterList) + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( \Magento\Framework\Model\ResourceModel\Db\Context $context, @@ -147,13 +129,7 @@ public function __construct( $this->mediaGalleryReadHandler = $mediaGalleryReadHandler; $this->_mediaConfig = $mediaConfig; $this->_sitemapData = $sitemapData; - $this->productModel = $productModel ?: ObjectManager::getInstance()->get(\Magento\Catalog\Model\Product::class); - $this->catalogImageHelper = $catalogImageHelper; $this->imageUrlBuilder = $urlBuilder ?? ObjectManager::getInstance()->get(UrlBuilder::class); - $this->catalogImageHelper = $catalogImageHelper ?: ObjectManager::getInstance() - ->get(\Magento\Catalog\Helper\Image::class); - $this->scopeConfig = $scopeConfig ?: ObjectManager::getInstance() - ->get(\Magento\Framework\App\Config\ScopeConfigInterface::class); parent::__construct($context, $connectionName); } @@ -311,11 +287,6 @@ public function getCollection($storeId) } $connection = $this->getConnection(); - $urlRewriteMetaDataCondition = ''; - if (!$this->isCategoryProductURLsConfig($storeId)) { - $urlRewriteMetaDataCondition = ' AND url_rewrite.metadata IS NULL'; - } - $this->_select = $connection->select()->from( ['e' => $this->getMainTable()], [$this->getIdFieldName(), $this->_productResource->getLinkField(), 'updated_at'] @@ -326,7 +297,7 @@ public function getCollection($storeId) )->joinLeft( ['url_rewrite' => $this->getTable('url_rewrite')], 'e.entity_id = url_rewrite.entity_id AND url_rewrite.is_autogenerated = 1' - . $urlRewriteMetaDataCondition + . ' AND url_rewrite.metadata IS NULL' . $connection->quoteInto(' AND url_rewrite.store_id = ?', $store->getId()) . $connection->quoteInto(' AND url_rewrite.entity_type = ?', ProductUrlRewriteGenerator::ENTITY_TYPE), ['url' => 'request_path'] @@ -491,20 +462,4 @@ private function getProductImageUrl($image) { return $this->imageUrlBuilder->getUrl($image, 'product_page_image_large'); } - - /** - * Return Use Categories Path for Product URLs config value - * - * @param null|string $storeId - * - * @return bool - */ - private function isCategoryProductURLsConfig($storeId) - { - return $this->scopeConfig->isSetFlag( - HelperProduct::XML_PATH_PRODUCT_URL_USE_CATEGORY, - ScopeInterface::SCOPE_STORE, - $storeId - ); - } } diff --git a/app/code/Magento/Sitemap/Test/Mftf/ActionGroup/AdminMarketingSiteMapFillFormSaveAndGenerateActionGroup.xml b/app/code/Magento/Sitemap/Test/Mftf/ActionGroup/AdminMarketingSiteMapFillFormSaveAndGenerateActionGroup.xml new file mode 100644 index 000000000000..701d224e3241 --- /dev/null +++ b/app/code/Magento/Sitemap/Test/Mftf/ActionGroup/AdminMarketingSiteMapFillFormSaveAndGenerateActionGroup.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminMarketingSiteMapFillFormSaveAndGenerateActionGroup"> + <annotations> + <description>Fill data to Site Map form and click `Save and Generate`</description> + </annotations> + <arguments> + <argument name="sitemap" type="entity" defaultValue="DefaultSiteMap"/> + </arguments> + + <fillField selector="{{AdminMarketingSiteMapEditActionSection.filename}}" userInput="{{sitemap.filename}}" stepKey="fillFilename"/> + <fillField selector="{{AdminMarketingSiteMapEditActionSection.path}}" userInput="{{sitemap.path}}" stepKey="fillPath"/> + <click selector="{{AdminMarketingSiteMapEditActionSection.saveAndGenerate}}" stepKey="saveAndGenerateSiteMap"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sitemap/Test/Mftf/ActionGroup/AdminSiteMapGridClickFirstRowLinkActionGroup.xml b/app/code/Magento/Sitemap/Test/Mftf/ActionGroup/AdminSiteMapGridClickFirstRowLinkActionGroup.xml new file mode 100644 index 000000000000..7c061cb57367 --- /dev/null +++ b/app/code/Magento/Sitemap/Test/Mftf/ActionGroup/AdminSiteMapGridClickFirstRowLinkActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminSiteMapGridClickFirstRowLinkActionGroup"> + <annotations> + <description>Click first row link in Site Map grid</description> + </annotations> + + <click selector="{{AdminMarketingSiteMapGridSection.firstRowLink}}" stepKey="clickFirstLink"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sitemap/Test/Mftf/Section/AdminMarketingSiteMapGridSection.xml b/app/code/Magento/Sitemap/Test/Mftf/Section/AdminMarketingSiteMapGridSection.xml index d315cc24e8f9..dc3a8180f807 100644 --- a/app/code/Magento/Sitemap/Test/Mftf/Section/AdminMarketingSiteMapGridSection.xml +++ b/app/code/Magento/Sitemap/Test/Mftf/Section/AdminMarketingSiteMapGridSection.xml @@ -15,5 +15,6 @@ <element name="searchButton" type="button" selector=".admin__filter-actions [title='Search']"/> <element name="firstSearchResult" type="text" selector="#sitemapGrid_table>tbody>tr:nth-child(1)"/> <element name="fileNameTextField" type="input" selector="#sitemapGrid_filter_sitemap_filename" timeout="90"/> + <element name="firstRowLink" type="button" selector="//td[contains(@class, 'col-link')][1]/a"/> </section> </sections> diff --git a/app/code/Magento/Sitemap/Test/Mftf/Test/StorefrontSitemapUseCanonicalUrlProductTest.xml b/app/code/Magento/Sitemap/Test/Mftf/Test/StorefrontSitemapUseCanonicalUrlProductTest.xml new file mode 100644 index 000000000000..e114ac436de4 --- /dev/null +++ b/app/code/Magento/Sitemap/Test/Mftf/Test/StorefrontSitemapUseCanonicalUrlProductTest.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontSitemapUseCanonicalUrlProductTest"> + <annotations> + <group value="Rss"/> + <stories value="Sitemap use canonical product url"/> + <title value="Sitemap use canonical for product url"/> + <description value="RSS Feed always use canonical url for product"/> + <severity value="MAJOR"/> + </annotations> + <before> + <magentoCLI command="config:set catalog/seo/product_use_categories 1" stepKey="enableUseCategoryPathForProductUrl"/> + <magentoCLI command="config:set catalog/seo/product_canonical_tag 1" stepKey="enableUseCanonicalForProduct"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config"/> + </actionGroup> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="_defaultProduct" stepKey="createSimpleProductApi"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToMarketingSiteMapPage"> + <argument name="menuUiId" value="{{AdminMenuMarketing.dataUiId}}"/> + <argument name="submenuUiId" value="{{AdminMenuSEOAndSearchSiteMap.dataUiId}}"/> + </actionGroup> + <actionGroup ref="AdminMarketingSiteMapNavigateNewActionGroup" stepKey="navigateToNewSitemapPage"/> + <actionGroup ref="AdminMarketingSiteMapFillFormSaveAndGenerateActionGroup" stepKey="createAndGenerateSitemap"> + <argument name="sitemap" value="UniqueSitemapName"/> + </actionGroup> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createSimpleProductApi" stepKey="deleteSimple"/> + <magentoCLI command="config:set catalog/seo/product_use_categories 0" stepKey="disableUseCategoryPathForProductUrl"/> + <magentoCLI command="config:set catalog/seo/product_canonical_tag 0" stepKey="disableUseCanonicalForProduct"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config"/> + </actionGroup> + </after> + + <actionGroup ref="AdminSiteMapGridClickFirstRowLinkActionGroup" stepKey="clickFirstLinkGrid"/> + <see userInput="{{_ENV.MAGENTO_BASE_URL}}$$createSimpleProductApi.custom_attributes[url_key]$$" stepKey="seeCanonicalUrl" /> + </test> +</tests> diff --git a/app/code/Magento/Store/App/Request/PathInfoProcessor.php b/app/code/Magento/Store/App/Request/PathInfoProcessor.php index fad0d07c3a0a..23a0ca898bfb 100644 --- a/app/code/Magento/Store/App/Request/PathInfoProcessor.php +++ b/app/code/Magento/Store/App/Request/PathInfoProcessor.php @@ -7,10 +7,13 @@ namespace Magento\Store\App\Request; +use Magento\Framework\App\Request\PathInfoProcessorInterface; +use Magento\Framework\App\RequestInterface; + /** * Processes the path and looks for the store in the url and removes it and modifies the path accordingly. */ -class PathInfoProcessor implements \Magento\Framework\App\Request\PathInfoProcessorInterface +class PathInfoProcessor implements PathInfoProcessorInterface { /** * @var StorePathInfoValidator @@ -18,20 +21,11 @@ class PathInfoProcessor implements \Magento\Framework\App\Request\PathInfoProces private $storePathInfoValidator; /** - * @var \Magento\Framework\App\Config\ReinitableConfigInterface - */ - private $config; - - /** - * @param \Magento\Store\App\Request\StorePathInfoValidator $storePathInfoValidator - * @param \Magento\Framework\App\Config\ReinitableConfigInterface $config + * @param StorePathInfoValidator $storePathInfoValidator */ - public function __construct( - \Magento\Store\App\Request\StorePathInfoValidator $storePathInfoValidator, - \Magento\Framework\App\Config\ReinitableConfigInterface $config - ) { + public function __construct(StorePathInfoValidator $storePathInfoValidator) + { $this->storePathInfoValidator = $storePathInfoValidator; - $this->config = $config; } /** @@ -39,24 +33,22 @@ public function __construct( * * This method also sets request to no route if store is not valid and store is present in url config is enabled * - * @param \Magento\Framework\App\RequestInterface $request + * @param RequestInterface $request * @param string $pathInfo * @return string */ - public function process(\Magento\Framework\App\RequestInterface $request, $pathInfo) : string + public function process(RequestInterface $request, $pathInfo) : string { - //can store code be used in url - if ((bool)$this->config->getValue(\Magento\Store\Model\Store::XML_PATH_STORE_IN_URL)) { - $storeCode = $this->storePathInfoValidator->getValidStoreCode($request, $pathInfo); - if (!empty($storeCode)) { - if (!$request->isDirectAccessFrontendName($storeCode)) { - $pathInfo = $this->trimStoreCodeFromPathInfo($pathInfo, $storeCode); - } else { - //no route in case we're trying to access a store that has the same code as a direct access - $request->setActionName(\Magento\Framework\App\Router\Base::NO_ROUTE); - } + $storeCode = $this->storePathInfoValidator->getValidStoreCode($request, $pathInfo); + if (!empty($storeCode)) { + if (!$request->isDirectAccessFrontendName($storeCode)) { + $pathInfo = $this->trimStoreCodeFromPathInfo($pathInfo, $storeCode); + } else { + //no route in case we're trying to access a store that has the same code as a direct access + $request->setActionName(\Magento\Framework\App\Router\Base::NO_ROUTE); } } + return $pathInfo; } @@ -67,7 +59,7 @@ public function process(\Magento\Framework\App\RequestInterface $request, $pathI * @param string $storeCode * @return string */ - private function trimStoreCodeFromPathInfo(string $pathInfo, string $storeCode) : ?string + private function trimStoreCodeFromPathInfo(string $pathInfo, string $storeCode) : string { if (substr($pathInfo, 0, strlen('/' . $storeCode)) == '/'. $storeCode) { $pathInfo = substr($pathInfo, strlen($storeCode)+1); diff --git a/app/code/Magento/Store/App/Request/StorePathInfoValidator.php b/app/code/Magento/Store/App/Request/StorePathInfoValidator.php index 0b66ba758600..abbf29fd0c91 100644 --- a/app/code/Magento/Store/App/Request/StorePathInfoValidator.php +++ b/app/code/Magento/Store/App/Request/StorePathInfoValidator.php @@ -7,8 +7,14 @@ namespace Magento\Store\App\Request; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\Request\Http; +use Magento\Framework\App\Request\PathInfo; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Store\Api\StoreRepositoryInterface; use Magento\Store\Model\Store; +use Magento\Store\Model\StoreIsInactiveException; +use Magento\Store\Model\Validation\StoreCodeValidator; /** * Gets the store from the path if valid @@ -18,74 +24,74 @@ class StorePathInfoValidator /** * Store Config * - * @var \Magento\Framework\App\Config\ReinitableConfigInterface + * @var ScopeConfigInterface */ private $config; /** - * @var \Magento\Store\Api\StoreRepositoryInterface + * @var StoreRepositoryInterface */ private $storeRepository; /** - * @var \Magento\Framework\App\Request\PathInfo + * @var PathInfo */ private $pathInfo; /** - * @param \Magento\Framework\App\Config\ReinitableConfigInterface $config - * @param \Magento\Store\Api\StoreRepositoryInterface $storeRepository - * @param \Magento\Framework\App\Request\PathInfo $pathInfo + * @var StoreCodeValidator + */ + private $storeCodeValidator; + + /** + * @param ScopeConfigInterface $config + * @param StoreRepositoryInterface $storeRepository + * @param PathInfo $pathInfo + * @param StoreCodeValidator $storeCodeValidator */ public function __construct( - \Magento\Framework\App\Config\ReinitableConfigInterface $config, - \Magento\Store\Api\StoreRepositoryInterface $storeRepository, - \Magento\Framework\App\Request\PathInfo $pathInfo + ScopeConfigInterface $config, + StoreRepositoryInterface $storeRepository, + PathInfo $pathInfo, + StoreCodeValidator $storeCodeValidator ) { $this->config = $config; $this->storeRepository = $storeRepository; $this->pathInfo = $pathInfo; + $this->storeCodeValidator = $storeCodeValidator; } /** * Get store code from path info validate if config value. If path info is empty the try to calculate from request. * - * @param \Magento\Framework\App\Request\Http $request + * @param Http $request * @param string $pathInfo * @return string|null */ - public function getValidStoreCode( - \Magento\Framework\App\Request\Http $request, - string $pathInfo = '' - ) : ?string { + public function getValidStoreCode(Http $request, string $pathInfo = '') : ?string + { + $useStoreCodeInUrl = (bool) $this->config->getValue(Store::XML_PATH_STORE_IN_URL); + if (!$useStoreCodeInUrl) { + return null; + } + if (empty($pathInfo)) { - $pathInfo = $this->pathInfo->getPathInfo( - $request->getRequestUri(), - $request->getBaseUrl() - ); + $pathInfo = $this->pathInfo->getPathInfo($request->getRequestUri(), $request->getBaseUrl()); } $storeCode = $this->getStoreCode($pathInfo); - if (!empty($storeCode) - && $storeCode != Store::ADMIN_CODE - && (bool)$this->config->getValue(\Magento\Store\Model\Store::XML_PATH_STORE_IN_URL) - ) { - try { - $this->storeRepository->getActiveStoreByCode($storeCode); + if (empty($storeCode) || $storeCode === Store::ADMIN_CODE || !$this->storeCodeValidator->isValid($storeCode)) { + return null; + } + + try { + $this->storeRepository->getActiveStoreByCode($storeCode); - if ((bool)$this->config->getValue( - \Magento\Store\Model\Store::XML_PATH_STORE_IN_URL, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $storeCode - )) { - return $storeCode; - } - } catch (NoSuchEntityException $e) { - //return null; - } catch (\Magento\Store\Model\StoreIsInactiveException $e) { - //return null; - } + return $storeCode; + } catch (NoSuchEntityException $e) { + return null; + } catch (StoreIsInactiveException $e) { + return null; } - return null; } /** diff --git a/app/code/Magento/Store/Model/App/Emulation.php b/app/code/Magento/Store/Model/App/Emulation.php index 256c3976aa9c..fe9df22c2433 100644 --- a/app/code/Magento/Store/Model/App/Emulation.php +++ b/app/code/Magento/Store/Model/App/Emulation.php @@ -66,6 +66,11 @@ class Emulation extends \Magento\Framework\DataObject */ private $logger; + /** + * @var \Magento\Framework\View\DesignInterface + */ + private $_viewDesign; + /** * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\View\DesignInterface $viewDesign diff --git a/app/code/Magento/Store/Model/ResourceModel/StoreWebsiteRelation.php b/app/code/Magento/Store/Model/ResourceModel/StoreWebsiteRelation.php index 875c0e6cb3b0..d2b702a5821e 100644 --- a/app/code/Magento/Store/Model/ResourceModel/StoreWebsiteRelation.php +++ b/app/code/Magento/Store/Model/ResourceModel/StoreWebsiteRelation.php @@ -50,30 +50,64 @@ public function getStoreByWebsiteId($websiteId) * @param int $websiteId * @param bool $available * @param int|null $storeGroupId + * @param int|null $storeId * @return array */ - public function getWebsiteStores(int $websiteId, bool $available = false, int $storeGroupId = null): array - { + public function getWebsiteStores( + int $websiteId, + bool $available = false, + int $storeGroupId = null, + int $storeId = null + ): array { $connection = $this->resource->getConnection(); $storeTable = $this->resource->getTableName('store'); - $storeSelect = $connection->select()->from($storeTable)->where( - 'website_id = ?', - $websiteId - ); + $storeSelect = $connection->select() + ->from(['main_table' => $storeTable]) + ->join( + ['group_table' => $this->resource->getTableName('store_group')], + 'main_table.group_id = group_table.group_id', + [ + 'store_group_code' => 'code', + 'store_group_name' => 'name', + 'default_store_id' + ] + ) + ->join( + ['website' => $this->resource->getTableName('store_website')], + 'main_table.website_id = website.website_id', + [ + 'website_code' => 'code', + 'website_name' => 'name', + 'website_sort_order' => 'sort_order', + 'default_group_id' + ] + ); if ($storeGroupId) { $storeSelect = $storeSelect->where( - 'group_id = ?', + 'main_table.group_id = ?', $storeGroupId ); } + if ($storeId) { + $storeSelect = $storeSelect->where( + 'main_table.store_id = ?', + $storeId + ); + } + if ($available) { $storeSelect = $storeSelect->where( - 'is_active = 1' + 'main_table.is_active = 1' ); } + $storeSelect = $storeSelect->where( + 'main_table.website_id = ?', + $websiteId + ); + return $connection->fetchAll($storeSelect); } } diff --git a/app/code/Magento/Store/Model/Store.php b/app/code/Magento/Store/Model/Store.php index 7bcb3282ba55..f437d9bca0b7 100644 --- a/app/code/Magento/Store/Model/Store.php +++ b/app/code/Magento/Store/Model/Store.php @@ -332,6 +332,11 @@ class Store extends AbstractExtensibleModel implements */ private $pillPut; + /** + * @var \Magento\Store\Model\Validation\StoreValidator + */ + private $modelValidator; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry @@ -359,6 +364,7 @@ class Store extends AbstractExtensibleModel implements * @param array $data optional generic object data * @param \Magento\Framework\Event\ManagerInterface|null $eventManager * @param \Magento\Framework\MessageQueue\PoisonPill\PoisonPillPutInterface|null $pillPut + * @param \Magento\Store\Model\Validation\StoreValidator|null $modelValidator * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -388,7 +394,8 @@ public function __construct( $isCustomEntryPoint = false, array $data = [], \Magento\Framework\Event\ManagerInterface $eventManager = null, - \Magento\Framework\MessageQueue\PoisonPill\PoisonPillPutInterface $pillPut = null + \Magento\Framework\MessageQueue\PoisonPill\PoisonPillPutInterface $pillPut = null, + \Magento\Store\Model\Validation\StoreValidator $modelValidator = null ) { $this->_coreFileStorageDatabase = $coreFileStorageDatabase; $this->_config = $config; @@ -411,6 +418,9 @@ public function __construct( ->get(\Magento\Framework\Event\ManagerInterface::class); $this->pillPut = $pillPut ?: \Magento\Framework\App\ObjectManager::getInstance() ->get(\Magento\Framework\MessageQueue\PoisonPill\PoisonPillPutInterface::class); + $this->modelValidator = $modelValidator ?: \Magento\Framework\App\ObjectManager::getInstance() + ->get(\Magento\Store\Model\Validation\StoreValidator::class); + parent::__construct( $context, $registry, @@ -479,23 +489,7 @@ protected function _getSession() */ protected function _getValidationRulesBeforeSave() { - $validator = new \Magento\Framework\Validator\DataObject(); - - $storeLabelRule = new \Zend_Validate_NotEmpty(); - $storeLabelRule->setMessage(__('Name is required'), \Zend_Validate_NotEmpty::IS_EMPTY); - $validator->addRule($storeLabelRule, 'name'); - - $storeCodeRule = new \Zend_Validate_Regex('/^[a-z]+[a-z0-9_]*$/i'); - $storeCodeRule->setMessage( - __( - 'The store code may contain only letters (a-z), numbers (0-9) or underscore (_),' - . ' and the first character must be a letter.' - ), - \Zend_Validate_Regex::NOT_MATCH - ); - $validator->addRule($storeCodeRule, 'code'); - - return $validator; + return $this->modelValidator; } /** diff --git a/app/code/Magento/Store/Model/StoreCookieManager.php b/app/code/Magento/Store/Model/StoreCookieManager.php index d94357caf785..71188396e799 100644 --- a/app/code/Magento/Store/Model/StoreCookieManager.php +++ b/app/code/Magento/Store/Model/StoreCookieManager.php @@ -12,6 +12,8 @@ /** * DTO class to work with cookies. + * + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) */ class StoreCookieManager implements StoreCookieManagerInterface { @@ -58,7 +60,8 @@ public function setStoreCookie(StoreInterface $store) $cookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata() ->setHttpOnly(false) ->setDurationOneYear() - ->setPath($store->getStorePath()); + ->setPath($store->getStorePath()) + ->setSameSite('Lax'); $this->cookieManager->setPublicCookie(self::COOKIE_NAME, $store->getCode(), $cookieMetadata); } diff --git a/app/code/Magento/Store/Model/StoreSwitcher/HashProcessor.php b/app/code/Magento/Store/Model/StoreSwitcher/HashProcessor.php index 45e93a5af06d..0190a6c5d958 100644 --- a/app/code/Magento/Store/Model/StoreSwitcher/HashProcessor.php +++ b/app/code/Magento/Store/Model/StoreSwitcher/HashProcessor.php @@ -96,39 +96,41 @@ public function __construct( */ public function switch(StoreInterface $fromStore, StoreInterface $targetStore, string $redirectUrl): string { - $timestamp = (int) $this->request->getParam('time_stamp'); - $signature = (string) $this->request->getParam('signature'); - $data = (string) $this->request->getParam('data'); - $context = $this->contextFactory->create( - [ - 'fromStore' => $fromStore, - 'targetStore' => $targetStore, - 'redirectUrl' => $redirectUrl - ] - ); - $redirectDataObject = $this->dataFactory->create( - [ - 'signature' => $signature, - 'timestamp' => $timestamp, - 'data' => $data - ] - ); + if ($this->request->getParam('data') !== null) { + $timestamp = (int) $this->request->getParam('time_stamp'); + $signature = (string) $this->request->getParam('signature'); + $data = (string) $this->request->getParam('data'); + $context = $this->contextFactory->create( + [ + 'fromStore' => $fromStore, + 'targetStore' => $targetStore, + 'redirectUrl' => $redirectUrl + ] + ); + $redirectDataObject = $this->dataFactory->create( + [ + 'signature' => $signature, + 'timestamp' => $timestamp, + 'data' => $data + ] + ); - try { - if ($redirectUrl && $this->dataValidator->validate($context, $redirectDataObject)) { - $this->postprocessor->process($context, $this->dataSerializer->unserialize($data)); - } else { - throw new LocalizedException( - __('The requested store cannot be found. Please check the request and try again.') + try { + if ($redirectUrl && $this->dataValidator->validate($context, $redirectDataObject)) { + $this->postprocessor->process($context, $this->dataSerializer->unserialize($data)); + } else { + throw new LocalizedException( + __('The requested store cannot be found. Please check the request and try again.') + ); + } + } catch (LocalizedException $exception) { + $this->messageManager->addErrorMessage($exception->getMessage()); + } catch (\Throwable $exception) { + $this->logger->error($exception); + $this->messageManager->addErrorMessage( + __('Something went wrong.') ); } - } catch (LocalizedException $exception) { - $this->messageManager->addErrorMessage($exception->getMessage()); - } catch (\Throwable $exception) { - $this->logger->error($exception); - $this->messageManager->addErrorMessage( - __('Something went wrong.') - ); } return $redirectUrl; diff --git a/app/code/Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php b/app/code/Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php index 66fbce08a8b3..80fd2be9c3b6 100644 --- a/app/code/Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php +++ b/app/code/Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php @@ -12,6 +12,8 @@ /** * Set private content cookie to have actual local storage data on target store after store switching. + * + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) */ class ManagePrivateContent implements StoreSwitcherInterface { @@ -46,6 +48,7 @@ public function __construct( * * @return string redirect url * @throws CannotSwitchStoreException + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function switch(StoreInterface $fromStore, StoreInterface $targetStore, string $redirectUrl): string { @@ -54,7 +57,8 @@ public function switch(StoreInterface $fromStore, StoreInterface $targetStore, s ->setDurationOneYear() ->setPath('/') ->setSecure(false) - ->setHttpOnly(false); + ->setHttpOnly(false) + ->setSameSite('Lax'); $this->cookieManager->setPublicCookie( \Magento\Framework\App\PageCache\Version::COOKIE_NAME, \uniqid('updated-', true), diff --git a/app/code/Magento/Store/Model/StoresData.php b/app/code/Magento/Store/Model/StoresData.php index b3d00bc97cd2..eb3a291f8578 100644 --- a/app/code/Magento/Store/Model/StoresData.php +++ b/app/code/Magento/Store/Model/StoresData.php @@ -56,6 +56,8 @@ public function __construct( */ public function getStoresData(string $runMode, string $scopeCode = null) : array { + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $cacheKey = 'resolved_stores_' . md5($runMode . $scopeCode); $cacheData = $this->cache->load($cacheKey); if ($cacheData) { diff --git a/app/code/Magento/Store/Model/Validation/StoreCodeValidator.php b/app/code/Magento/Store/Model/Validation/StoreCodeValidator.php new file mode 100644 index 000000000000..4dba36dfe935 --- /dev/null +++ b/app/code/Magento/Store/Model/Validation/StoreCodeValidator.php @@ -0,0 +1,49 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Store\Model\Validation; + +use Magento\Framework\Validator\AbstractValidator; +use Magento\Framework\Validator\RegexFactory; + +/** + * Validator for store code. + */ +class StoreCodeValidator extends AbstractValidator +{ + /** + * @var RegexFactory + */ + private $regexValidatorFactory; + + /** + * @param RegexFactory $regexValidatorFactory + */ + public function __construct(RegexFactory $regexValidatorFactory) + { + $this->regexValidatorFactory = $regexValidatorFactory; + } + + /** + * @inheritDoc + */ + public function isValid($value) + { + $validator = $this->regexValidatorFactory->create(['pattern' => '/^[a-z]+[a-z0-9_]*$/i']); + $validator->setMessage( + __( + 'The store code may contain only letters (a-z), numbers (0-9) or underscore (_),' + . ' and the first character must be a letter.' + ), + \Zend_Validate_Regex::NOT_MATCH + ); + $result = $validator->isValid($value); + $this->_messages = $validator->getMessages(); + + return $result; + } +} diff --git a/app/code/Magento/Store/Model/Validation/StoreNameValidator.php b/app/code/Magento/Store/Model/Validation/StoreNameValidator.php new file mode 100644 index 000000000000..7d97a37cc9f5 --- /dev/null +++ b/app/code/Magento/Store/Model/Validation/StoreNameValidator.php @@ -0,0 +1,46 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Store\Model\Validation; + +use Magento\Framework\Validator\AbstractValidator; +use Magento\Framework\Validator\NotEmptyFactory; + +/** + * Validator for store name. + */ +class StoreNameValidator extends AbstractValidator +{ + /** + * @var NotEmptyFactory + */ + private $notEmptyValidatorFactory; + + /** + * @param NotEmptyFactory $notEmptyValidatorFactory + */ + public function __construct(NotEmptyFactory $notEmptyValidatorFactory) + { + $this->notEmptyValidatorFactory = $notEmptyValidatorFactory; + } + + /** + * @inheritDoc + */ + public function isValid($value) + { + $validator = $this->notEmptyValidatorFactory->create(['options' => []]); + $validator->setMessage( + __('Name is required'), + \Zend_Validate_NotEmpty::IS_EMPTY + ); + $result = $validator->isValid($value); + $this->_messages = $validator->getMessages(); + + return $result; + } +} diff --git a/app/code/Magento/Store/Model/Validation/StoreValidator.php b/app/code/Magento/Store/Model/Validation/StoreValidator.php new file mode 100644 index 000000000000..7fa969f7c362 --- /dev/null +++ b/app/code/Magento/Store/Model/Validation/StoreValidator.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Store\Model\Validation; + +use Magento\Framework\Validator\AbstractValidator; +use Magento\Framework\Validator\DataObjectFactory; +use Magento\Framework\Validator\ValidatorInterface; + +/** + * Store model validator. + */ +class StoreValidator extends AbstractValidator +{ + /** + * @var DataObjectFactory + */ + private $dataObjectValidatorFactory; + + /** + * @var ValidatorInterface[] + */ + private $rules; + + /** + * @param DataObjectFactory $dataObjectValidatorFactory + * @param ValidatorInterface[] $rules + */ + public function __construct(DataObjectFactory $dataObjectValidatorFactory, array $rules = []) + { + $this->dataObjectValidatorFactory = $dataObjectValidatorFactory; + $this->rules = $rules; + } + + /** + * @inheritDoc + */ + public function isValid($value) + { + $validator = $this->dataObjectValidatorFactory->create(); + foreach ($this->rules as $fieldName => $rule) { + $validator->addRule($rule, $fieldName); + } + $result = $validator->isValid($value); + $this->_messages = $validator->getMessages(); + + return $result; + } +} diff --git a/app/code/Magento/Store/Model/Website.php b/app/code/Magento/Store/Model/Website.php index 42c89bbe4210..1fc96a112894 100644 --- a/app/code/Magento/Store/Model/Website.php +++ b/app/code/Magento/Store/Model/Website.php @@ -164,6 +164,11 @@ class Website extends \Magento\Framework\Model\AbstractExtensibleModel implement */ private $pillPut; + /** + * @var \Magento\Framework\App\Config\ScopeConfigInterface + */ + private $_coreConfig; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry diff --git a/app/code/Magento/Store/Test/Mftf/Test/StorefrontCheckSortOrderStoreViewTest.xml b/app/code/Magento/Store/Test/Mftf/Test/StorefrontCheckSortOrderStoreViewTest.xml index 442ee99e1279..6bced4a507df 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/StorefrontCheckSortOrderStoreViewTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/StorefrontCheckSortOrderStoreViewTest.xml @@ -38,12 +38,8 @@ <argument name="storeGroupName" value="SecondStoreGroupUnique.name"/> </actionGroup> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <actionGroup ref="AdminCreateStoreViewFillSortOrderActionGroup" stepKey="createFirstStoreView"> <argument name="StoreGroup" value="customStoreGroup"/> diff --git a/app/code/Magento/Store/Test/Unit/App/Request/PathInfoProcessorTest.php b/app/code/Magento/Store/Test/Unit/App/Request/PathInfoProcessorTest.php index c6b822553008..fd5da89a4523 100644 --- a/app/code/Magento/Store/Test/Unit/App/Request/PathInfoProcessorTest.php +++ b/app/code/Magento/Store/Test/Unit/App/Request/PathInfoProcessorTest.php @@ -7,171 +7,87 @@ namespace Magento\Store\Test\Unit\App\Request; -use Magento\Framework\App\Config\ReinitableConfigInterface; use Magento\Framework\App\Request\Http; -use Magento\Framework\App\Request\PathInfo; -use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Store\Api\StoreRepositoryInterface; use Magento\Store\App\Request\PathInfoProcessor; use Magento\Store\App\Request\StorePathInfoValidator; -use Magento\Store\Model\Store; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; class PathInfoProcessorTest extends TestCase { /** - * @var PathInfoProcessor - */ - private $model; - - /** - * @var MockObject - */ - private $requestMock; - - /** - * @var MockObject + * @var StorePathInfoValidator|MockObject */ - private $validatorConfigMock; + private $storePathInfoValidatorMock; /** - * @var MockObject - */ - private $processorConfigMock; - - /** - * @var MockObject + * @var PathInfoProcessor */ - private $pathInfoMock; + private $model; /** - * @var MockObject + * @var Http|MockObject */ - private $storeRepositoryMock; + private $requestMock; /** - * @var MockObject + * @var string */ - private $storePathInfoValidator; + private $storeCode; /** * @var string */ - protected $pathInfo = '/storeCode/node_one/'; + private $pathInfo; protected function setUp(): void { - $this->requestMock = $this->getMockBuilder(Http::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->validatorConfigMock = $this->getMockForAbstractClass(ReinitableConfigInterface::class); - - $this->processorConfigMock = $this->getMockForAbstractClass(ReinitableConfigInterface::class); + $this->storePathInfoValidatorMock = $this->createMock(StorePathInfoValidator::class); + $this->model = new PathInfoProcessor($this->storePathInfoValidatorMock); - $this->storeRepositoryMock = $this->getMockForAbstractClass(StoreRepositoryInterface::class); - - $this->pathInfoMock = $this->getMockBuilder(PathInfo ::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->storePathInfoValidator = new StorePathInfoValidator( - $this->validatorConfigMock, - $this->storeRepositoryMock, - $this->pathInfoMock - ); - - $this->model = new PathInfoProcessor( - $this->storePathInfoValidator, - $this->validatorConfigMock - ); + $this->requestMock = $this->createMock(Http::class); + $this->storeCode = 'storeCode'; + $this->pathInfo = '/' . $this->storeCode . '/node_one/'; } - public function testProcessIfStoreExistsAndIsNotDirectAccessToFrontName() + public function testProcessIfStoreIsEmpty(): void { - $this->validatorConfigMock->expects($this->any())->method('getValue')->willReturn(true); + $this->storePathInfoValidatorMock->expects($this->once()) + ->method('getValidStoreCode') + ->willReturn(null); - $store = $this->createMock(Store::class); - $this->storeRepositoryMock->expects( - $this->atLeastOnce() - )->method( - 'getActiveStoreByCode' - )->with( - 'storeCode' - )->willReturn($store); - $this->requestMock->expects( - $this->atLeastOnce() - )->method( - 'isDirectAccessFrontendName' - )->with( - 'storeCode' - )->willReturn( - false - ); - $this->assertEquals('/node_one/', $this->model->process($this->requestMock, $this->pathInfo)); + $pathInfo = $this->model->process($this->requestMock, $this->pathInfo); + $this->assertEquals($this->pathInfo, $pathInfo); } - public function testProcessIfStoreExistsAndDirectAccessToFrontName() + public function testProcessIfStoreExistsAndIsNotDirectAccessToFrontName(): void { - $this->validatorConfigMock->expects($this->atLeastOnce())->method('getValue')->willReturn(true); - - $this->storeRepositoryMock->expects( - $this->any() - )->method( - 'getActiveStoreByCode' - ); - $this->requestMock->expects( - $this->atLeastOnce() - )->method( - 'isDirectAccessFrontendName' - )->with( - 'storeCode' - )->willReturn(true); - $this->requestMock->expects($this->once())->method('setActionName')->with('noroute'); - $this->assertEquals($this->pathInfo, $this->model->process($this->requestMock, $this->pathInfo)); + $this->storePathInfoValidatorMock->expects($this->once()) + ->method('getValidStoreCode') + ->willReturn($this->storeCode); + $this->requestMock->expects($this->atLeastOnce()) + ->method('isDirectAccessFrontendName') + ->with($this->storeCode) + ->willReturn(false); + + $pathInfo = $this->model->process($this->requestMock, $this->pathInfo); + $this->assertEquals('/node_one/', $pathInfo); } - public function testProcessIfStoreIsEmpty() + public function testProcessIfStoreExistsAndDirectAccessToFrontName(): void { - $this->validatorConfigMock->expects($this->any())->method('getValue')->willReturn(true); - - $path = '/0/node_one/'; - $this->storeRepositoryMock->expects( - $this->never() - )->method( - 'getActiveStoreByCode' - ); - $this->requestMock->expects( - $this->never() - )->method( - 'isDirectAccessFrontendName' - ); - $this->requestMock->expects($this->never())->method('setActionName'); - $this->assertEquals($path, $this->model->process($this->requestMock, $path)); - } - - public function testProcessIfStoreCodeIsNotExist() - { - $this->validatorConfigMock->expects($this->atLeastOnce())->method('getValue')->willReturn(true); - - $this->storeRepositoryMock->expects($this->once())->method('getActiveStoreByCode')->with('storeCode') - ->willThrowException(new NoSuchEntityException()); - $this->requestMock->expects($this->never())->method('isDirectAccessFrontendName'); - - $this->assertEquals($this->pathInfo, $this->model->process($this->requestMock, $this->pathInfo)); - } - - public function testProcessIfStoreUrlNotEnabled() - { - $this->validatorConfigMock->expects($this->at(0))->method('getValue')->willReturn(true); - - $this->validatorConfigMock->expects($this->at(1))->method('getValue')->willReturn(true); - - $this->validatorConfigMock->expects($this->at(2))->method('getValue')->willReturn(false); - - $this->storeRepositoryMock->expects($this->once())->method('getActiveStoreByCode')->willReturn(1); - - $this->assertEquals($this->pathInfo, $this->model->process($this->requestMock, $this->pathInfo)); + $this->storePathInfoValidatorMock->expects($this->once()) + ->method('getValidStoreCode') + ->willReturn($this->storeCode); + $this->requestMock->expects($this->atLeastOnce()) + ->method('isDirectAccessFrontendName') + ->with($this->storeCode) + ->willReturn(true); + $this->requestMock->expects($this->once()) + ->method('setActionName') + ->with('noroute'); + + $pathInfo = $this->model->process($this->requestMock, $this->pathInfo); + $this->assertEquals($this->pathInfo, $pathInfo); } } diff --git a/app/code/Magento/Store/Test/Unit/App/Request/StorePathInfoValidatorTest.php b/app/code/Magento/Store/Test/Unit/App/Request/StorePathInfoValidatorTest.php new file mode 100644 index 000000000000..5c2b1fb2f6f3 --- /dev/null +++ b/app/code/Magento/Store/Test/Unit/App/Request/StorePathInfoValidatorTest.php @@ -0,0 +1,196 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Store\Test\Unit\App\Request; + +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\Request\Http; +use Magento\Framework\App\Request\PathInfo; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Store\Api\StoreRepositoryInterface; +use Magento\Store\App\Request\StorePathInfoValidator; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreIsInactiveException; +use Magento\Store\Model\Validation\StoreCodeValidator; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class StorePathInfoValidatorTest extends TestCase +{ + /** + * @var ScopeConfigInterface|MockObject + */ + private $configMock; + + /** + * @var StoreRepositoryInterface|MockObject + */ + private $storeRepositoryMock; + + /** + * @var PathInfo|MockObject + */ + private $pathInfoMock; + + /** + * @var StoreCodeValidator|MockObject + */ + private $storeCodeValidatorMock; + + /** + * @var Http|MockObject + */ + private $requestMock; + + /** + * @var StorePathInfoValidator + */ + private $storePathInfoValidator; + + protected function setUp(): void + { + $this->configMock = $this->createMock(ScopeConfigInterface::class); + $this->storeRepositoryMock = $this->createMock(StoreRepositoryInterface::class); + $this->pathInfoMock = $this->createMock(PathInfo::class); + $this->storeCodeValidatorMock = $this->createMock(StoreCodeValidator::class); + $this->storePathInfoValidator = new StorePathInfoValidator( + $this->configMock, + $this->storeRepositoryMock, + $this->pathInfoMock, + $this->storeCodeValidatorMock + ); + + $this->requestMock = $this->createMock(Http::class); + $this->requestMock->method('getRequestUri') + ->willReturn('/path/'); + $this->requestMock->method('getBaseUrl') + ->willReturn('example.com'); + } + + public function testGetValidStoreCodeWithoutStoreInUrl(): void + { + $this->pathInfoMock->method('getPathInfo') + ->willReturn('/a/b/'); + $this->storeCodeValidatorMock->method('isValid') + ->willReturn(true); + + $this->configMock->expects($this->once()) + ->method('getValue') + ->with(Store::XML_PATH_STORE_IN_URL) + ->willReturn(false); + $this->storeRepositoryMock->expects($this->never()) + ->method('getActiveStoreByCode'); + + $result = $this->storePathInfoValidator->getValidStoreCode($this->requestMock, '/b/c/'); + $this->assertNull($result); + } + + public function testGetValidStoreCodeWithoutPathInfo(): void + { + $storeCode = 'store1'; + + $this->configMock->expects($this->once()) + ->method('getValue') + ->with(Store::XML_PATH_STORE_IN_URL) + ->willReturn(true); + $this->pathInfoMock->expects($this->once()) + ->method('getPathInfo') + ->willReturn('/' . $storeCode . '/path1/'); + $this->storeCodeValidatorMock->expects($this->once()) + ->method('isValid') + ->with($storeCode) + ->willReturn(true); + $store = $this->createMock(Store::class); + $this->storeRepositoryMock->expects($this->once()) + ->method('getActiveStoreByCode') + ->with($storeCode) + ->willReturn($store); + + $result = $this->storePathInfoValidator->getValidStoreCode($this->requestMock, ''); + $this->assertEquals($storeCode, $result); + } + + public function testGetValidStoreCodeWithEmptyPathInfo(): void + { + $this->configMock->expects($this->once()) + ->method('getValue') + ->with(Store::XML_PATH_STORE_IN_URL) + ->willReturn(true); + $this->pathInfoMock->expects($this->once()) + ->method('getPathInfo') + ->willReturn(''); + $this->storeCodeValidatorMock->method('isValid') + ->willReturn(true); + $this->storeRepositoryMock->expects($this->never()) + ->method('getActiveStoreByCode'); + + $result = $this->storePathInfoValidator->getValidStoreCode($this->requestMock, ''); + $this->assertNull($result); + } + + /** + * @dataProvider getValidStoreCodeExceptionDataProvider + * @param \Throwable $exception + */ + public function testGetValidStoreCodeThrowsException(\Throwable $exception): void + { + $this->configMock->method('getValue') + ->with(Store::XML_PATH_STORE_IN_URL) + ->willReturn(true); + $this->storeCodeValidatorMock->method('isValid') + ->willReturn(true); + + $this->storeRepositoryMock->expects($this->once()) + ->method('getActiveStoreByCode') + ->willThrowException($exception); + + $result = $this->storePathInfoValidator->getValidStoreCode($this->requestMock, '/store/'); + $this->assertNull($result); + } + + public function getValidStoreCodeExceptionDataProvider(): array + { + return [ + [new NoSuchEntityException()], + [new StoreIsInactiveException()], + ]; + } + + /** + * @dataProvider getValidStoreCodeDataProvider + * @param string $pathInfo + * @param bool $isStoreCodeValid + * @param string|null $expectedResult + */ + public function testGetValidStoreCode(string $pathInfo, bool $isStoreCodeValid, ?string $expectedResult): void + { + $this->configMock->method('getValue') + ->with(Store::XML_PATH_STORE_IN_URL) + ->willReturn(true); + $this->pathInfoMock->method('getPathInfo') + ->willReturn('/store2/path2/'); + $this->storeCodeValidatorMock->method('isValid') + ->willReturn($isStoreCodeValid); + $store = $this->createMock(Store::class); + $this->storeRepositoryMock->method('getActiveStoreByCode') + ->willReturn($store); + + $result = $this->storePathInfoValidator->getValidStoreCode($this->requestMock, $pathInfo); + $this->assertEquals($expectedResult, $result); + } + + public function getValidStoreCodeDataProvider(): array + { + return [ + ['store1', true, 'store1'], + ['/store1/path1/', true, 'store1'], + ['/', true, null], + ['admin', true, null], + ['1', false, null], + ]; + } +} diff --git a/app/code/Magento/Store/Test/Unit/Model/StoreSwitcher/HashProcessorTest.php b/app/code/Magento/Store/Test/Unit/Model/StoreSwitcher/HashProcessorTest.php index 89dc1d1c99eb..c6bd515eaa3d 100644 --- a/app/code/Magento/Store/Test/Unit/Model/StoreSwitcher/HashProcessorTest.php +++ b/app/code/Magento/Store/Test/Unit/Model/StoreSwitcher/HashProcessorTest.php @@ -128,12 +128,22 @@ function ($arg) { $this->postprocessor->expects($this->once()) ->method('process') ->with($this->isInstanceOf(ContextInterface::class), ['customer_id' => 1]); + $this->messageManager->expects($this->never()) + ->method('addErrorMessage'); $this->assertEquals($redirectUrl, $this->model->switch($this->store1, $this->store2, $redirectUrl)); } public function testShouldNotProcessIfDataValidationFailed(): void { $redirectUrl = '/category-1/category-1.1.html'; + $this->request->method('getParam') + ->willReturnMap( + [ + ['time_stamp', null, time() - 1], + ['data', null, '{"customer_id":1}'], + ['signature', null, 'randomstring'], + ] + ); $this->dataValidator->method('validate') ->willReturn(false); $this->postprocessor->expects($this->never()) @@ -148,6 +158,14 @@ public function testShouldNotProcessIfDataValidationFailed(): void public function testShouldNotProcessIfDataUnserializationFailed(): void { $redirectUrl = '/category-1/category-1.1.html'; + $this->request->method('getParam') + ->willReturnMap( + [ + ['time_stamp', null, time() - 1], + ['data', null, '{"customer_id":1}'], + ['signature', null, 'randomstring'], + ] + ); $this->dataValidator->method('validate') ->willReturn(true); $this->dataSerializer->method('unserialize') @@ -160,4 +178,16 @@ public function testShouldNotProcessIfDataUnserializationFailed(): void $this->assertEquals($redirectUrl, $this->model->switch($this->store1, $this->store2, $redirectUrl)); } + + public function testShouldNotProcessIfDataIsNotPresentInTheRequest(): void + { + $redirectUrl = '/category-1/category-1.1.html'; + $this->dataValidator->expects($this->never()) + ->method('validate'); + $this->postprocessor->expects($this->never()) + ->method('process'); + $this->messageManager->expects($this->never()) + ->method('addErrorMessage'); + $this->assertEquals($redirectUrl, $this->model->switch($this->store1, $this->store2, $redirectUrl)); + } } diff --git a/app/code/Magento/Store/Test/Unit/Model/Validation/StoreCodeValidatorTest.php b/app/code/Magento/Store/Test/Unit/Model/Validation/StoreCodeValidatorTest.php new file mode 100644 index 000000000000..7dbb3e3227bf --- /dev/null +++ b/app/code/Magento/Store/Test/Unit/Model/Validation/StoreCodeValidatorTest.php @@ -0,0 +1,82 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Store\Test\Unit\Model\Validation; + +use Magento\Framework\Validator\Regex; +use Magento\Framework\Validator\RegexFactory; +use Magento\Store\Model\Validation\StoreCodeValidator; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class StoreCodeValidatorTest extends TestCase +{ + /** + * @var RegexFactory|MockObject + */ + private $regexValidatorFactoryMock; + + /** + * @var Regex|MockObject + */ + private $regexValidatorMock; + + /** + * @var StoreCodeValidator + */ + private $model; + + protected function setUp(): void + { + $this->regexValidatorFactoryMock = $this->getMockBuilder(RegexFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->regexValidatorMock = $this->createMock(Regex::class); + $this->regexValidatorFactoryMock->method('create') + ->willReturn($this->regexValidatorMock); + + $this->model = new StoreCodeValidator($this->regexValidatorFactoryMock); + } + + /** + * @dataProvider isValidDataProvider + * @param string $value + * @param bool $isValid + * @param array $messages + */ + public function testIsValid(string $value, bool $isValid, array $messages): void + { + $this->regexValidatorMock->expects($this->once()) + ->method('isValid') + ->with($value) + ->willReturn($isValid); + $this->regexValidatorMock->expects($this->once()) + ->method('getMessages') + ->willReturn($messages); + + $result = $this->model->isValid($value); + $this->assertEquals($isValid, $result); + $this->assertEquals($messages, $this->model->getMessages()); + } + + public function isValidDataProvider(): array + { + return [ + 'true' => [ + 'abc', + true, + [] + ], + 'false' => [ + '5', + false, + ['code is not valid'] + ], + ]; + } +} diff --git a/app/code/Magento/Store/Test/Unit/Model/Validation/StoreNameValidatorTest.php b/app/code/Magento/Store/Test/Unit/Model/Validation/StoreNameValidatorTest.php new file mode 100644 index 000000000000..42caa124b13b --- /dev/null +++ b/app/code/Magento/Store/Test/Unit/Model/Validation/StoreNameValidatorTest.php @@ -0,0 +1,82 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Store\Test\Unit\Model\Validation; + +use Magento\Framework\Validator\NotEmpty; +use Magento\Framework\Validator\NotEmptyFactory; +use Magento\Store\Model\Validation\StoreNameValidator; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class StoreNameValidatorTest extends TestCase +{ + /** + * @var NotEmptyFactory|MockObject + */ + private $notEmptyValidatorFactoryMock; + + /** + * @var NotEmpty|MockObject + */ + private $notEmptyValidatorMock; + + /** + * @var StoreNameValidator + */ + private $model; + + protected function setUp(): void + { + $this->notEmptyValidatorFactoryMock = $this->getMockBuilder(NotEmptyFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->notEmptyValidatorMock = $this->createMock(NotEmpty::class); + $this->notEmptyValidatorFactoryMock->method('create') + ->willReturn($this->notEmptyValidatorMock); + + $this->model = new StoreNameValidator($this->notEmptyValidatorFactoryMock); + } + + /** + * @dataProvider isValidDataProvider + * @param string $value + * @param bool $isValid + * @param array $messages + */ + public function testIsValid(string $value, bool $isValid, array $messages): void + { + $this->notEmptyValidatorMock->expects($this->once()) + ->method('isValid') + ->with($value) + ->willReturn($isValid); + $this->notEmptyValidatorMock->expects($this->once()) + ->method('getMessages') + ->willReturn($messages); + + $result = $this->model->isValid($value); + $this->assertEquals($isValid, $result); + $this->assertEquals($messages, $this->model->getMessages()); + } + + public function isValidDataProvider(): array + { + return [ + 'true' => [ + 'Name1', + true, + [] + ], + 'false' => [ + '', + false, + ['name is not valid'] + ], + ]; + } +} diff --git a/app/code/Magento/Store/Test/Unit/Model/Validation/StoreValidatorTest.php b/app/code/Magento/Store/Test/Unit/Model/Validation/StoreValidatorTest.php new file mode 100644 index 000000000000..7b089939c158 --- /dev/null +++ b/app/code/Magento/Store/Test/Unit/Model/Validation/StoreValidatorTest.php @@ -0,0 +1,100 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Store\Test\Unit\Model\Validation; + +use Magento\Framework\Validator\DataObject; +use Magento\Framework\Validator\DataObjectFactory; +use Magento\Framework\Validator\ValidatorInterface; +use Magento\Store\Model\Validation\StoreValidator; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class StoreValidatorTest extends TestCase +{ + /** + * @var DataObjectFactory|MockObject + */ + private $dataObjectValidatorFactoryMock; + + /** + * @var DataObject|MockObject + */ + private $dataObjectValidatorMock; + + /** + * @var array + */ + private $ruleMocks; + + /** + * @var StoreValidator + */ + private $model; + + protected function setUp(): void + { + $this->dataObjectValidatorFactoryMock = $this->getMockBuilder(DataObjectFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->dataObjectValidatorMock = $this->createMock(DataObject::class); + $this->dataObjectValidatorFactoryMock->method('create') + ->willReturn($this->dataObjectValidatorMock); + $ruleMock1 = $this->createMock(ValidatorInterface::class); + $ruleMock2 = $this->createMock(ValidatorInterface::class); + $this->ruleMocks = [ + [$ruleMock1, 'field1'], + [$ruleMock2, 'field2'], + ]; + + $this->model = new StoreValidator( + $this->dataObjectValidatorFactoryMock, + array_combine(array_column($this->ruleMocks, 1), array_column($this->ruleMocks, 0)) + ); + } + + /** + * @dataProvider isValidDataProvider + * @param \Magento\Framework\DataObject $value + * @param bool $isValid + * @param array $messages + */ + public function testIsValid(\Magento\Framework\DataObject $value, bool $isValid, array $messages): void + { + $this->dataObjectValidatorMock->expects($this->exactly(count($this->ruleMocks))) + ->method('addRule') + ->withConsecutive(...$this->ruleMocks); + $this->dataObjectValidatorMock->expects($this->once()) + ->method('isValid') + ->with($value) + ->willReturn($isValid); + $this->dataObjectValidatorMock->expects($this->once()) + ->method('getMessages') + ->willReturn($messages); + + $result = $this->model->isValid($value); + $this->assertEquals($isValid, $result); + $this->assertEquals($messages, $this->model->getMessages()); + } + + public function isValidDataProvider(): array + { + return [ + 'true' => [ + new \Magento\Framework\DataObject(['field1' => 'value1', 'field2' => 'value2']), + true, + [] + ], + 'false' => [ + new \Magento\Framework\DataObject(), + false, + ['store is not valid'] + ], + ]; + } +} diff --git a/app/code/Magento/Store/etc/config.xml b/app/code/Magento/Store/etc/config.xml index d4dddbb6a7df..2872b8256645 100644 --- a/app/code/Magento/Store/etc/config.xml +++ b/app/code/Magento/Store/etc/config.xml @@ -134,6 +134,7 @@ <pht>pht</pht> <svg>svg</svg> <xml>xml</xml> + <xhtml>xhtml</xhtml> </protected_extensions> <public_files_valid_paths> <protected> diff --git a/app/code/Magento/Store/etc/di.xml b/app/code/Magento/Store/etc/di.xml index ccfec562ba10..a51cb300cd80 100644 --- a/app/code/Magento/Store/etc/di.xml +++ b/app/code/Magento/Store/etc/di.xml @@ -70,8 +70,6 @@ <preference for="Magento\Framework\App\Router\PathConfigInterface" type="Magento\Store\Model\PathConfig" /> <type name="Magento\Framework\App\ActionInterface"> <plugin name="storeCheck" type="Magento\Store\App\Action\Plugin\StoreCheck"/> - <plugin name="eventDispatch" type="Magento\Framework\App\Action\Plugin\EventDispatchPlugin"/> - <plugin name="actionFlagNoDispatch" type="Magento\Framework\App\Action\Plugin\ActionFlagNoDispatchPlugin"/> </type> <type name="Magento\Framework\Url\SecurityInfo"> <plugin name="storeUrlSecurityInfo" type="Magento\Store\Url\Plugin\SecurityInfo"/> @@ -446,4 +444,12 @@ </argument> </arguments> </type> + <type name="Magento\Store\Model\Validation\StoreValidator"> + <arguments> + <argument name="rules" xsi:type="array"> + <item name="name" xsi:type="object">Magento\Store\Model\Validation\StoreNameValidator</item> + <item name="code" xsi:type="object">Magento\Store\Model\Validation\StoreCodeValidator</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/StoreGraphQl/Controller/HttpRequestValidator/StoreValidator.php b/app/code/Magento/StoreGraphQl/Controller/HttpRequestValidator/StoreValidator.php index 801196091572..91726d2c6260 100644 --- a/app/code/Magento/StoreGraphQl/Controller/HttpRequestValidator/StoreValidator.php +++ b/app/code/Magento/StoreGraphQl/Controller/HttpRequestValidator/StoreValidator.php @@ -45,7 +45,7 @@ public function validate(HttpRequestInterface $request): void $storeCode = trim($headerValue); if (!$this->isStoreActive($storeCode)) { $this->storeManager->setCurrentStore(null); - throw new GraphQlInputException(__('Requested store is not found ({$storeCode})')); + throw new GraphQlInputException(__('Requested store is not found (%1)', [$storeCode])); } } } diff --git a/app/code/Magento/StoreGraphQl/Model/Resolver/Store/StoreConfigDataProvider.php b/app/code/Magento/StoreGraphQl/Model/Resolver/Store/StoreConfigDataProvider.php index 8378b3bc7a4b..f732dea228ee 100644 --- a/app/code/Magento/StoreGraphQl/Model/Resolver/Store/StoreConfigDataProvider.php +++ b/app/code/Magento/StoreGraphQl/Model/Resolver/Store/StoreConfigDataProvider.php @@ -65,8 +65,19 @@ public function __construct( */ public function getStoreConfigData(StoreInterface $store): array { - $defaultStoreConfig = $this->storeConfigManager->getStoreConfigs([$store->getCode()]); - return $this->prepareStoreConfigData(current($defaultStoreConfig), $store->getName()); + $defaultWebsiteStore = $this->storeWebsiteRelation->getWebsiteStores( + (int) $store->getWebsiteId(), + true, + (int) $store->getStoreGroupId(), + (int) $store->getStoreId() + ); + if (empty($defaultWebsiteStore)) { + return []; + } + + $storeConfigs = $this->storeConfigManager->getStoreConfigs([$store->getCode()]); + + return $this->prepareStoreConfigData(current($storeConfigs), current($defaultWebsiteStore)); } /** @@ -86,7 +97,7 @@ public function getAvailableStoreConfig(int $websiteId, int $storeGroupId = null foreach ($storeConfigs as $storeConfig) { $key = array_search($storeConfig->getCode(), array_column($websiteStores, 'code'), true); - $storesConfigData[] = $this->prepareStoreConfigData($storeConfig, $websiteStores[$key]['name']); + $storesConfigData[] = $this->prepareStoreConfigData($storeConfig, $websiteStores[$key]); } return $storesConfigData; @@ -96,15 +107,25 @@ public function getAvailableStoreConfig(int $websiteId, int $storeGroupId = null * Prepare store config data * * @param StoreConfigInterface $storeConfig - * @param string $storeName + * @param array $storeData * @return array */ - private function prepareStoreConfigData(StoreConfigInterface $storeConfig, string $storeName): array + private function prepareStoreConfigData(StoreConfigInterface $storeConfig, array $storeData): array { return array_merge([ 'id' => $storeConfig->getId(), 'code' => $storeConfig->getCode(), + 'store_code' => $storeConfig->getCode(), + 'store_name' => $storeData['name'] ?? null, + 'store_sort_order' => $storeData['sort_order'] ?? null, + 'is_default_store' => $storeData['default_store_id'] == $storeConfig->getId() ?? null, + 'store_group_code' => $storeData['store_group_code'] ?? null, + 'store_group_name' => $storeData['store_group_name'] ?? null, + 'is_default_store_group' => $storeData['default_group_id'] == $storeData['group_id'] ?? null, + 'store_group_default_store_code' => $storeData['store_group_default_store_code'] ?? null, 'website_id' => $storeConfig->getWebsiteId(), + 'website_code' => $storeData['website_code'] ?? null, + 'website_name' => $storeData['website_name'] ?? null, 'locale' => $storeConfig->getLocale(), 'base_currency_code' => $storeConfig->getBaseCurrencyCode(), 'default_display_currency_code' => $storeConfig->getDefaultDisplayCurrencyCode(), @@ -118,7 +139,6 @@ private function prepareStoreConfigData(StoreConfigInterface $storeConfig, strin 'secure_base_link_url' => $storeConfig->getSecureBaseLinkUrl(), 'secure_base_static_url' => $storeConfig->getSecureBaseStaticUrl(), 'secure_base_media_url' => $storeConfig->getSecureBaseMediaUrl(), - 'store_name' => $storeName, ], $this->getExtendedConfigData((int)$storeConfig->getId())); } diff --git a/app/code/Magento/StoreGraphQl/Test/Unit/StoreValidatorTest.php b/app/code/Magento/StoreGraphQl/Test/Unit/StoreValidatorTest.php index 60a9c7f67132..a9dd484791f6 100644 --- a/app/code/Magento/StoreGraphQl/Test/Unit/StoreValidatorTest.php +++ b/app/code/Magento/StoreGraphQl/Test/Unit/StoreValidatorTest.php @@ -95,7 +95,7 @@ public function testValidate(array $config): void ->method('setCurrentStore') ->with(null) ->willReturnSelf(); - $this->expectExceptionMessage('Requested store is not found ({$storeCode})'); + $this->expectExceptionMessage('Requested store is not found (sv1)'); $this->storeValidator->validate($this->requestMock); } diff --git a/app/code/Magento/StoreGraphQl/etc/schema.graphqls b/app/code/Magento/StoreGraphQl/etc/schema.graphqls index 1106987cc72c..9efdb5a21040 100644 --- a/app/code/Magento/StoreGraphQl/etc/schema.graphqls +++ b/app/code/Magento/StoreGraphQl/etc/schema.graphqls @@ -17,9 +17,18 @@ type Website @doc(description: "Website is deprecated because it is should not b } type StoreConfig @doc(description: "The type contains information about a store config") { - id : Int @doc(description: "The ID number assigned to the store") - code : String @doc(description: "A code assigned to the store to identify it") - website_id : Int @doc(description: "The ID number assigned to the website store belongs") + id : Int @deprecated(reason: "Use `store_code` instead.") @doc(description: "The ID number assigned to the store") + code : String @deprecated(reason: "Use `store_code` instead.") @doc(description: "A code assigned to the store to identify it") + store_code: ID @doc(description: "The unique ID of the store view. In the Admin, this is called the Store View Code. When making a GraphQL call, assign this value to the `Store` header to provide the scope") + store_name : String @doc(description: "The label assigned to the store view") + store_sort_order : Int @doc(description: "The store view sort order") + is_default_store : Boolean @doc(description: "Indicates whether the store view has been designated as the default within the store group") + store_group_code : ID @doc(description: "The unique ID assigned to the store group. In the Admin, this is called the Store Name") + store_group_name : String @doc(description: "The label assigned to the store group") + is_default_store_group : Boolean @doc(description: "Indicates whether the store group has been designated as the default within the website") + website_id : Int @deprecated(reason: "The field should not be used on the storefront") @doc(description: "The ID number assigned to the website store") + website_code : ID @doc(description: "The unique ID for the website") + website_name : String @doc(description: "The label assigned to the website") locale : String @doc(description: "Store locale") base_currency_code : String @doc(description: "Base currency code") default_display_currency_code : String @doc(description: "Default display currency code") @@ -33,6 +42,5 @@ type StoreConfig @doc(description: "The type contains information about a store secure_base_link_url : String @doc(description: "Secure base link URL for the store") secure_base_static_url : String @doc(description: "Secure base static URL for the store") secure_base_media_url : String @doc(description: "Secure base media URL for the store") - store_name : String @doc(description: "Name of the store") use_store_in_url: Boolean @doc(description: "The configuration determines if the store code should be used in the URL") } diff --git a/app/code/Magento/Swagger/Test/Mftf/ActionGroup/StorefrontApplyAdminTokenOnSwaggerPageActionGroup.xml b/app/code/Magento/Swagger/Test/Mftf/ActionGroup/StorefrontApplyAdminTokenOnSwaggerPageActionGroup.xml new file mode 100644 index 000000000000..2aa80e3455d2 --- /dev/null +++ b/app/code/Magento/Swagger/Test/Mftf/ActionGroup/StorefrontApplyAdminTokenOnSwaggerPageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontApplyAdminTokenOnSwaggerPageActionGroup"> + <annotations> + <description>Apply Admin Token on Swagger Page</description> + </annotations> + <arguments> + <argument name="token" type="string" defaultValue=""/> + </arguments> + + <clearField selector="{{SwaggerHeaderSection.apiKeyInput}}" stepKey="clearApiTokenField"/> + <fillField selector="{{SwaggerHeaderSection.apiKeyInput}}" userInput="{{token}}" stepKey="fillApiTokenInput"/> + <click selector="{{SwaggerHeaderSection.applyButton}}" stepKey="clickApplyButton" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swagger/Test/Mftf/ActionGroup/StorefrontGoToSwaggerPageActionGroup.xml b/app/code/Magento/Swagger/Test/Mftf/ActionGroup/StorefrontGoToSwaggerPageActionGroup.xml new file mode 100644 index 000000000000..de68508ab70b --- /dev/null +++ b/app/code/Magento/Swagger/Test/Mftf/ActionGroup/StorefrontGoToSwaggerPageActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontGoToSwaggerPageActionGroup"> + <annotations> + <description>Go to the swagger page</description> + </annotations> + + <amOnPage url="{{StorefrontSwaggerPage.url}}" stepKey="goToSwaggerPage"/> + <waitForPageLoad stepKey="waitForSwaggerPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swagger/Test/Mftf/Page/SwaggerPage.xml b/app/code/Magento/Swagger/Test/Mftf/Page/SwaggerPage.xml new file mode 100644 index 000000000000..23b6f30b3aac --- /dev/null +++ b/app/code/Magento/Swagger/Test/Mftf/Page/SwaggerPage.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="StorefrontSwaggerPage" url="/swagger" area="storefront" module="Swagger"> + <section name="SwaggerHeaderSection"/> + <section name="SwaggerApiListSection"/> + </page> +</pages> diff --git a/app/code/Magento/Swagger/Test/Mftf/Section/SwaggerApiListSection.xml b/app/code/Magento/Swagger/Test/Mftf/Section/SwaggerApiListSection.xml new file mode 100644 index 000000000000..241955446a83 --- /dev/null +++ b/app/code/Magento/Swagger/Test/Mftf/Section/SwaggerApiListSection.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="SwaggerApiListSection"> + <element name="swaggerActionTitle" type="text" selector="#operations-tag-{{operationName}}" parameterized="true"/> + </section> +</sections> diff --git a/app/code/Magento/Swagger/Test/Mftf/Section/SwaggerHeaderSection.xml b/app/code/Magento/Swagger/Test/Mftf/Section/SwaggerHeaderSection.xml new file mode 100644 index 000000000000..cf4c78451648 --- /dev/null +++ b/app/code/Magento/Swagger/Test/Mftf/Section/SwaggerHeaderSection.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="SwaggerHeaderSection"> + <element name="apiKeyInput" type="input" selector="#input_apiKey"/> + <element name="applyButton" type="button" selector="#explore" timeout="30"/> + </section> +</sections> diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/swagger-ui.css b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/swagger-ui.css old mode 100644 new mode 100755 index 971751da7027..c61e5a85f7ac --- a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/swagger-ui.css +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/swagger-ui.css @@ -1,2 +1,4 @@ -.swagger-ui{font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .wrapper{width:100%;max-width:1460px;margin:0 auto;padding:0 20px;-webkit-box-sizing:border-box;box-sizing:border-box}.swagger-ui .opblock-tag-section{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.swagger-ui .opblock-tag{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:10px 20px 10px 10px;cursor:pointer;-webkit-transition:all .2s;transition:all .2s;border-bottom:1px solid rgba(59,65,81,.3)}.swagger-ui .opblock-tag:hover{background:rgba(0,0,0,.02)}.swagger-ui .opblock-tag{font-size:24px;margin:0 0 5px;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .opblock-tag.no-desc span{-webkit-box-flex:1;-ms-flex:1;flex:1}.swagger-ui .opblock-tag svg{-webkit-transition:all .4s;transition:all .4s}.swagger-ui .opblock-tag small{font-size:14px;font-weight:400;-webkit-box-flex:1;-ms-flex:1;flex:1;padding:0 10px;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .parameter__type{font-size:12px;padding:5px 0;font-family:Source Code Pro,monospace;font-weight:600;color:#3b4151}.swagger-ui .view-line-link{position:relative;top:3px;width:20px;margin:0 5px;cursor:pointer;-webkit-transition:all .5s;transition:all .5s}.swagger-ui .opblock{margin:0 0 15px;border:1px solid #000;border-radius:4px;-webkit-box-shadow:0 0 3px rgba(0,0,0,.19);box-shadow:0 0 3px rgba(0,0,0,.19)}.swagger-ui .opblock .tab-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1;flex:1}.swagger-ui .opblock .tab-header .tab-item{padding:0 40px;cursor:pointer}.swagger-ui .opblock .tab-header .tab-item:first-of-type{padding:0 40px 0 0}.swagger-ui .opblock .tab-header .tab-item.active h4 span{position:relative}.swagger-ui .opblock .tab-header .tab-item.active h4 span:after{position:absolute;bottom:-15px;left:50%;width:120%;height:4px;content:"";-webkit-transform:translateX(-50%);transform:translateX(-50%);background:gray}.swagger-ui .opblock.is-open .opblock-summary{border-bottom:1px solid #000}.swagger-ui .opblock .opblock-section-header{padding:8px 20px;min-height:50px;background:hsla(0,0%,100%,.8);-webkit-box-shadow:0 1px 2px rgba(0,0,0,.1);box-shadow:0 1px 2px rgba(0,0,0,.1)}.swagger-ui .opblock .opblock-section-header,.swagger-ui .opblock .opblock-section-header label{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.swagger-ui .opblock .opblock-section-header label{font-size:12px;font-weight:700;margin:0;margin-left:auto;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .opblock .opblock-section-header label span{padding:0 10px 0 0}.swagger-ui .opblock .opblock-section-header h4{font-size:14px;-webkit-box-flex:1;-ms-flex:1;flex:1;margin:0;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .opblock .opblock-summary-method{font-size:14px;font-weight:700;min-width:80px;padding:6px 15px;text-align:center;border-radius:3px;background:#000;text-shadow:0 1px 0 rgba(0,0,0,.1);font-family:Titillium Web,sans-serif;color:#fff}.swagger-ui .opblock .opblock-summary-operation-id,.swagger-ui .opblock .opblock-summary-path,.swagger-ui .opblock .opblock-summary-path__deprecated{font-size:16px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 3 auto;flex:0 3 auto;-webkit-box-align:center;-ms-flex-align:center;align-items:center;word-break:break-all;padding:0 10px;font-family:Source Code Pro,monospace;font-weight:600;color:#3b4151}@media (max-width:768px){.swagger-ui .opblock .opblock-summary-operation-id,.swagger-ui .opblock .opblock-summary-path,.swagger-ui .opblock .opblock-summary-path__deprecated{font-size:12px}}.swagger-ui .opblock .opblock-summary-operation-id .view-line-link,.swagger-ui .opblock .opblock-summary-path .view-line-link,.swagger-ui .opblock .opblock-summary-path__deprecated .view-line-link{position:relative;top:2px;width:0;margin:0;cursor:pointer;-webkit-transition:all .5s;transition:all .5s}.swagger-ui .opblock .opblock-summary-operation-id:hover .view-line-link,.swagger-ui .opblock .opblock-summary-path:hover .view-line-link,.swagger-ui .opblock .opblock-summary-path__deprecated:hover .view-line-link{width:18px;margin:0 5px}.swagger-ui .opblock .opblock-summary-path__deprecated{text-decoration:line-through}.swagger-ui .opblock .opblock-summary-operation-id{font-size:14px}.swagger-ui .opblock .opblock-summary-description{font-size:13px;-webkit-box-flex:1;-ms-flex:1;flex:1;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .opblock .opblock-summary{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:5px;cursor:pointer}.swagger-ui .opblock.opblock-post{border-color:#49cc90;background:rgba(73,204,144,.1)}.swagger-ui .opblock.opblock-post .opblock-summary-method{background:#49cc90}.swagger-ui .opblock.opblock-post .opblock-summary{border-color:#49cc90}.swagger-ui .opblock.opblock-post .tab-header .tab-item.active h4 span:after{background:#49cc90}.swagger-ui .opblock.opblock-put{border-color:#fca130;background:rgba(252,161,48,.1)}.swagger-ui .opblock.opblock-put .opblock-summary-method{background:#fca130}.swagger-ui .opblock.opblock-put .opblock-summary{border-color:#fca130}.swagger-ui .opblock.opblock-put .tab-header .tab-item.active h4 span:after{background:#fca130}.swagger-ui .opblock.opblock-delete{border-color:#f93e3e;background:rgba(249,62,62,.1)}.swagger-ui .opblock.opblock-delete .opblock-summary-method{background:#f93e3e}.swagger-ui .opblock.opblock-delete .opblock-summary{border-color:#f93e3e}.swagger-ui .opblock.opblock-delete .tab-header .tab-item.active h4 span:after{background:#f93e3e}.swagger-ui .opblock.opblock-get{border-color:#61affe;background:rgba(97,175,254,.1)}.swagger-ui .opblock.opblock-get .opblock-summary-method{background:#61affe}.swagger-ui .opblock.opblock-get .opblock-summary{border-color:#61affe}.swagger-ui .opblock.opblock-get .tab-header .tab-item.active h4 span:after{background:#61affe}.swagger-ui .opblock.opblock-patch{border-color:#50e3c2;background:rgba(80,227,194,.1)}.swagger-ui .opblock.opblock-patch .opblock-summary-method{background:#50e3c2}.swagger-ui .opblock.opblock-patch .opblock-summary{border-color:#50e3c2}.swagger-ui .opblock.opblock-patch .tab-header .tab-item.active h4 span:after{background:#50e3c2}.swagger-ui .opblock.opblock-head{border-color:#9012fe;background:rgba(144,18,254,.1)}.swagger-ui .opblock.opblock-head .opblock-summary-method{background:#9012fe}.swagger-ui .opblock.opblock-head .opblock-summary{border-color:#9012fe}.swagger-ui .opblock.opblock-head .tab-header .tab-item.active h4 span:after{background:#9012fe}.swagger-ui .opblock.opblock-options{border-color:#0d5aa7;background:rgba(13,90,167,.1)}.swagger-ui .opblock.opblock-options .opblock-summary-method{background:#0d5aa7}.swagger-ui .opblock.opblock-options .opblock-summary{border-color:#0d5aa7}.swagger-ui .opblock.opblock-options .tab-header .tab-item.active h4 span:after{background:#0d5aa7}.swagger-ui .opblock.opblock-deprecated{opacity:.6;border-color:#ebebeb;background:hsla(0,0%,92%,.1)}.swagger-ui .opblock.opblock-deprecated .opblock-summary-method{background:#ebebeb}.swagger-ui .opblock.opblock-deprecated .opblock-summary{border-color:#ebebeb}.swagger-ui .opblock.opblock-deprecated .tab-header .tab-item.active h4 span:after{background:#ebebeb}.swagger-ui .opblock .opblock-schemes{padding:8px 20px}.swagger-ui .opblock .opblock-schemes .schemes-title{padding:0 10px 0 0}.swagger-ui .filter .operation-filter-input{width:100%;margin:20px 0;padding:10px;border:2px solid #d8dde7}.swagger-ui .tab{display:-webkit-box;display:-ms-flexbox;display:flex;margin:20px 0 10px;padding:0;list-style:none}.swagger-ui .tab li{font-size:12px;min-width:100px;min-width:90px;padding:0;cursor:pointer;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .tab li:first-of-type{position:relative;padding-left:0}.swagger-ui .tab li:first-of-type:after{position:absolute;top:0;right:6px;width:1px;height:100%;content:"";background:rgba(0,0,0,.2)}.swagger-ui .tab li.active{font-weight:700}.swagger-ui .opblock-description-wrapper,.swagger-ui .opblock-external-docs-wrapper,.swagger-ui .opblock-title_normal{font-size:12px;margin:0 0 5px;padding:15px 20px;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .opblock-description-wrapper h4,.swagger-ui .opblock-external-docs-wrapper h4,.swagger-ui .opblock-title_normal h4{font-size:12px;margin:0 0 5px;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .opblock-description-wrapper p,.swagger-ui .opblock-external-docs-wrapper p,.swagger-ui .opblock-title_normal p{font-size:14px;margin:0;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .opblock-external-docs-wrapper h4{padding-left:0}.swagger-ui .execute-wrapper{padding:20px;text-align:right}.swagger-ui .execute-wrapper .btn{width:100%;padding:8px 40px}.swagger-ui .body-param-options{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.swagger-ui .body-param-options .body-param-edit{padding:10px 0}.swagger-ui .body-param-options label{padding:8px 0}.swagger-ui .body-param-options label select{margin:3px 0 0}.swagger-ui .responses-inner{padding:20px}.swagger-ui .responses-inner h4,.swagger-ui .responses-inner h5{font-size:12px;margin:10px 0 5px;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .response-col_status{font-size:14px;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .response-col_status .response-undocumented{font-size:11px;font-family:Source Code Pro,monospace;font-weight:600;color:#909090}.swagger-ui .response-col_links{padding-left:2em;max-width:40em;font-size:14px;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .response-col_links .response-undocumented{font-size:11px;font-family:Source Code Pro,monospace;font-weight:600;color:#909090}.swagger-ui .response-col_description__inner div.markdown,.swagger-ui .response-col_description__inner div.renderedMarkdown{font-size:12px;font-style:italic;display:block;margin:0;padding:10px;border-radius:4px;background:#41444e;font-family:Source Code Pro,monospace;font-weight:600;color:#fff}.swagger-ui .response-col_description__inner div.markdown p,.swagger-ui .response-col_description__inner div.renderedMarkdown p{margin:0;font-family:Source Code Pro,monospace;font-weight:600;color:#fff}.swagger-ui .response-col_description__inner div.markdown a,.swagger-ui .response-col_description__inner div.renderedMarkdown a{font-family:Source Code Pro,monospace;font-weight:600;color:#89bf04;text-decoration:underline}.swagger-ui .response-col_description__inner div.markdown a:hover,.swagger-ui .response-col_description__inner div.renderedMarkdown a:hover{color:#81b10c}.swagger-ui .response-col_description__inner div.markdown th,.swagger-ui .response-col_description__inner div.renderedMarkdown th{font-family:Source Code Pro,monospace;font-weight:600;color:#fff;border-bottom:1px solid #fff}.swagger-ui .opblock-body pre{font-size:12px;margin:0;padding:10px;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;word-break:break-word;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;border-radius:4px;background:#41444e;overflow-wrap:break-word;font-family:Source Code Pro,monospace;font-weight:600;color:#fff}.swagger-ui .opblock-body pre span{color:#fff!important}.swagger-ui .opblock-body pre .headerline{display:block}.swagger-ui .scheme-container{margin:0 0 20px;padding:30px 0;background:#fff;-webkit-box-shadow:0 1px 2px 0 rgba(0,0,0,.15);box-shadow:0 1px 2px 0 rgba(0,0,0,.15)}.swagger-ui .scheme-container .schemes{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.swagger-ui .scheme-container .schemes>label{font-size:12px;font-weight:700;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin:-20px 15px 0 0;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .scheme-container .schemes>label select{min-width:130px;text-transform:uppercase}.swagger-ui .loading-container{padding:40px 0 60px;margin-top:1em;min-height:1px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.swagger-ui .loading-container .loading{position:relative}.swagger-ui .loading-container .loading:after{font-size:10px;font-weight:700;position:absolute;top:50%;left:50%;content:"loading";-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);text-transform:uppercase;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .loading-container .loading:before{position:absolute;top:50%;left:50%;display:block;width:60px;height:60px;margin:-30px;content:"";-webkit-animation:rotation 1s infinite linear,opacity .5s;animation:rotation 1s infinite linear,opacity .5s;opacity:1;border:2px solid rgba(85,85,85,.1);border-top-color:rgba(0,0,0,.6);border-radius:100%;-webkit-backface-visibility:hidden;backface-visibility:hidden}@-webkit-keyframes rotation{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes rotation{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.swagger-ui .response-content-type{padding-top:1em}.swagger-ui .response-content-type.controls-accept-header select{border-color:green}.swagger-ui .response-content-type.controls-accept-header small{color:green;font-size:.7em}@-webkit-keyframes blinker{50%{opacity:0}}@keyframes blinker{50%{opacity:0}}.swagger-ui section h3{font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui a.nostyle{display:inline}.swagger-ui a.nostyle,.swagger-ui a.nostyle:visited{text-decoration:inherit;color:inherit;cursor:pointer}.swagger-ui .btn{font-size:14px;font-weight:700;padding:5px 23px;-webkit-transition:all .3s;transition:all .3s;border:2px solid gray;border-radius:4px;background:transparent;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.1);box-shadow:0 1px 2px rgba(0,0,0,.1);font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .btn.btn-sm{font-size:12px;padding:4px 23px}.swagger-ui .btn[disabled]{cursor:not-allowed;opacity:.3}.swagger-ui .btn:hover{-webkit-box-shadow:0 0 5px rgba(0,0,0,.3);box-shadow:0 0 5px rgba(0,0,0,.3)}.swagger-ui .btn.cancel{border-color:#ff6060;background-color:transparent;font-family:Titillium Web,sans-serif;color:#ff6060}.swagger-ui .btn.authorize{line-height:1;display:inline;color:#49cc90;border-color:#49cc90;background-color:transparent}.swagger-ui .btn.authorize span{float:left;padding:4px 20px 0 0}.swagger-ui .btn.authorize svg{fill:#49cc90}.swagger-ui .btn.execute{background-color:#4990e2;color:#fff;border-color:#4990e2}.swagger-ui .btn-group{display:-webkit-box;display:-ms-flexbox;display:flex;padding:30px}.swagger-ui .btn-group .btn{-webkit-box-flex:1;-ms-flex:1;flex:1}.swagger-ui .btn-group .btn:first-child{border-radius:4px 0 0 4px}.swagger-ui .btn-group .btn:last-child{border-radius:0 4px 4px 0}.swagger-ui .authorization__btn{padding:0 10px;border:none;background:none}.swagger-ui .authorization__btn.locked{opacity:1}.swagger-ui .authorization__btn.unlocked{opacity:.4}.swagger-ui .expand-methods,.swagger-ui .expand-operation{border:none;background:none}.swagger-ui .expand-methods svg,.swagger-ui .expand-operation svg{width:20px;height:20px}.swagger-ui .expand-methods{padding:0 10px}.swagger-ui .expand-methods:hover svg{fill:#404040}.swagger-ui .expand-methods svg{-webkit-transition:all .3s;transition:all .3s;fill:#707070}.swagger-ui button{cursor:pointer;outline:none}.swagger-ui button.invalid{-webkit-animation:shake .4s 1;animation:shake .4s 1;border-color:#f93e3e;background:#feebeb}.swagger-ui select{font-size:14px;font-weight:700;padding:5px 40px 5px 10px;border:2px solid #41444e;border-radius:4px;background:#f7f7f7 url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+ICAgIDxwYXRoIGQ9Ik0xMy40MTggNy44NTljLjI3MS0uMjY4LjcwOS0uMjY4Ljk3OCAwIC4yNy4yNjguMjcyLjcwMSAwIC45NjlsLTMuOTA4IDMuODNjLS4yNy4yNjgtLjcwNy4yNjgtLjk3OSAwbC0zLjkwOC0zLjgzYy0uMjctLjI2Ny0uMjctLjcwMSAwLS45NjkuMjcxLS4yNjguNzA5LS4yNjguOTc4IDBMMTAgMTFsMy40MTgtMy4xNDF6Ii8+PC9zdmc+) right 10px center no-repeat;background-size:20px;-webkit-box-shadow:0 1px 2px 0 rgba(0,0,0,.25);box-shadow:0 1px 2px 0 rgba(0,0,0,.25);font-family:Titillium Web,sans-serif;color:#3b4151;-webkit-appearance:none;-moz-appearance:none;appearance:none}.swagger-ui select[multiple]{margin:5px 0;padding:5px;background:#f7f7f7}.swagger-ui select.invalid{-webkit-animation:shake .4s 1;animation:shake .4s 1;border-color:#f93e3e;background:#feebeb}.swagger-ui .opblock-body select{min-width:230px}@media (max-width:768px){.swagger-ui .opblock-body select{min-width:180px}}.swagger-ui label{font-size:12px;font-weight:700;margin:0 0 5px;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui input[type=email],.swagger-ui input[type=file],.swagger-ui input[type=password],.swagger-ui input[type=search],.swagger-ui input[type=text]{min-width:100px;margin:5px 0;padding:8px 10px;border:1px solid #d9d9d9;border-radius:4px;background:#fff}@media (max-width:768px){.swagger-ui input[type=email],.swagger-ui input[type=file],.swagger-ui input[type=password],.swagger-ui input[type=search],.swagger-ui input[type=text]{max-width:175px}}.swagger-ui input[type=email].invalid,.swagger-ui input[type=file].invalid,.swagger-ui input[type=password].invalid,.swagger-ui input[type=search].invalid,.swagger-ui input[type=text].invalid{-webkit-animation:shake .4s 1;animation:shake .4s 1;border-color:#f93e3e;background:#feebeb}@-webkit-keyframes shake{10%,90%{-webkit-transform:translate3d(-1px,0,0);transform:translate3d(-1px,0,0)}20%,80%{-webkit-transform:translate3d(2px,0,0);transform:translate3d(2px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-4px,0,0);transform:translate3d(-4px,0,0)}40%,60%{-webkit-transform:translate3d(4px,0,0);transform:translate3d(4px,0,0)}}@keyframes shake{10%,90%{-webkit-transform:translate3d(-1px,0,0);transform:translate3d(-1px,0,0)}20%,80%{-webkit-transform:translate3d(2px,0,0);transform:translate3d(2px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-4px,0,0);transform:translate3d(-4px,0,0)}40%,60%{-webkit-transform:translate3d(4px,0,0);transform:translate3d(4px,0,0)}}.swagger-ui textarea{font-size:12px;width:100%;min-height:280px;padding:10px;border:none;border-radius:4px;outline:none;background:hsla(0,0%,100%,.8);font-family:Source Code Pro,monospace;font-weight:600;color:#3b4151}.swagger-ui textarea:focus{border:2px solid #61affe}.swagger-ui textarea.curl{font-size:12px;min-height:100px;margin:0;padding:10px;resize:none;border-radius:4px;background:#41444e;font-family:Source Code Pro,monospace;font-weight:600;color:#fff}.swagger-ui .checkbox{padding:5px 0 10px;-webkit-transition:opacity .5s;transition:opacity .5s;color:#303030}.swagger-ui .checkbox label{display:-webkit-box;display:-ms-flexbox;display:flex}.swagger-ui .checkbox p{font-weight:400!important;font-style:italic;margin:0!important;font-family:Source Code Pro,monospace;font-weight:600;color:#3b4151}.swagger-ui .checkbox input[type=checkbox]{display:none}.swagger-ui .checkbox input[type=checkbox]+label>.item{position:relative;top:3px;display:inline-block;width:16px;height:16px;margin:0 8px 0 0;padding:5px;cursor:pointer;border-radius:1px;background:#e8e8e8;-webkit-box-shadow:0 0 0 2px #e8e8e8;box-shadow:0 0 0 2px #e8e8e8;-webkit-box-flex:0;-ms-flex:none;flex:none}.swagger-ui .checkbox input[type=checkbox]+label>.item:active{-webkit-transform:scale(.9);transform:scale(.9)}.swagger-ui .checkbox input[type=checkbox]:checked+label>.item{background:#e8e8e8 url("data:image/svg+xml;charset=utf-8,%3Csvg width='10' height='8' viewBox='3 7 10 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%2341474E' fill-rule='evenodd' d='M6.333 15L3 11.667l1.333-1.334 2 2L11.667 7 13 8.333z'/%3E%3C/svg%3E") 50% no-repeat}.swagger-ui .dialog-ux{position:fixed;z-index:9999;top:0;right:0;bottom:0;left:0}.swagger-ui .dialog-ux .backdrop-ux{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.8)}.swagger-ui .dialog-ux .modal-ux{position:absolute;z-index:9999;top:50%;left:50%;width:100%;min-width:300px;max-width:650px;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);border:1px solid #ebebeb;border-radius:4px;background:#fff;-webkit-box-shadow:0 10px 30px 0 rgba(0,0,0,.2);box-shadow:0 10px 30px 0 rgba(0,0,0,.2)}.swagger-ui .dialog-ux .modal-ux-content{overflow-y:auto;max-height:540px;padding:20px}.swagger-ui .dialog-ux .modal-ux-content p{font-size:12px;margin:0 0 5px;color:#41444e;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .dialog-ux .modal-ux-content h4{font-size:18px;font-weight:600;margin:15px 0 0;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .dialog-ux .modal-ux-header{display:-webkit-box;display:-ms-flexbox;display:flex;padding:12px 0;border-bottom:1px solid #ebebeb;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.swagger-ui .dialog-ux .modal-ux-header .close-modal{padding:0 10px;border:none;background:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.swagger-ui .dialog-ux .modal-ux-header h3{font-size:20px;font-weight:600;margin:0;padding:0 20px;-webkit-box-flex:1;-ms-flex:1;flex:1;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .model{font-size:12px;font-weight:300;font-family:Source Code Pro,monospace;font-weight:600;color:#3b4151}.swagger-ui .model .deprecated span,.swagger-ui .model .deprecated td{color:#a0a0a0!important}.swagger-ui .model .deprecated>td:first-of-type{text-decoration:line-through}.swagger-ui .model-toggle{font-size:10px;position:relative;top:6px;display:inline-block;margin:auto .3em;cursor:pointer;-webkit-transition:-webkit-transform .15s ease-in;transition:-webkit-transform .15s ease-in;transition:transform .15s ease-in;transition:transform .15s ease-in,-webkit-transform .15s ease-in;-webkit-transform:rotate(90deg);transform:rotate(90deg);-webkit-transform-origin:50% 50%;transform-origin:50% 50%}.swagger-ui .model-toggle.collapsed{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.swagger-ui .model-toggle:after{display:block;width:20px;height:20px;content:"";background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z'/%3E%3C/svg%3E") 50% no-repeat;background-size:100%}.swagger-ui .model-jump-to-path{position:relative;cursor:pointer}.swagger-ui .model-jump-to-path .view-line-link{position:absolute;top:-.4em;cursor:pointer}.swagger-ui .model-title{position:relative}.swagger-ui .model-title:hover .model-hint{visibility:visible}.swagger-ui .model-hint{position:absolute;top:-1.8em;visibility:hidden;padding:.1em .5em;white-space:nowrap;color:#ebebeb;border-radius:4px;background:rgba(0,0,0,.7)}.swagger-ui .model p{margin:0 0 1em}.swagger-ui section.models{margin:30px 0;border:1px solid rgba(59,65,81,.3);border-radius:4px}.swagger-ui section.models.is-open{padding:0 0 20px}.swagger-ui section.models.is-open h4{margin:0 0 5px;border-bottom:1px solid rgba(59,65,81,.3)}.swagger-ui section.models h4{font-size:16px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0;padding:10px 20px 10px 10px;cursor:pointer;-webkit-transition:all .2s;transition:all .2s;font-family:Titillium Web,sans-serif;color:#606060}.swagger-ui section.models h4 svg{-webkit-transition:all .4s;transition:all .4s}.swagger-ui section.models h4 span{-webkit-box-flex:1;-ms-flex:1;flex:1}.swagger-ui section.models h4:hover{background:rgba(0,0,0,.02)}.swagger-ui section.models h5{font-size:16px;margin:0 0 10px;font-family:Titillium Web,sans-serif;color:#707070}.swagger-ui section.models .model-jump-to-path{position:relative;top:5px}.swagger-ui section.models .model-container{margin:0 20px 15px;-webkit-transition:all .5s;transition:all .5s;border-radius:4px;background:rgba(0,0,0,.05)}.swagger-ui section.models .model-container:hover{background:rgba(0,0,0,.07)}.swagger-ui section.models .model-container:first-of-type{margin:20px}.swagger-ui section.models .model-container:last-of-type{margin:0 20px}.swagger-ui section.models .model-box{background:none}.swagger-ui .model-box{padding:10px;border-radius:4px;background:rgba(0,0,0,.1)}.swagger-ui .model-box .model-jump-to-path{position:relative;top:4px}.swagger-ui .model-box.deprecated{opacity:.5}.swagger-ui .model-title{font-size:16px;font-family:Titillium Web,sans-serif;color:#505050}.swagger-ui .model-deprecated-warning{font-size:16px;font-weight:600;margin-right:1em;font-family:Titillium Web,sans-serif;color:#f93e3e}.swagger-ui span>span.model .brace-close{padding:0 0 0 10px}.swagger-ui .prop-name{display:inline-block;margin-right:1em}.swagger-ui .prop-type{color:#55a}.swagger-ui .prop-enum{display:block}.swagger-ui .prop-format{color:#606060}.swagger-ui .servers>label{font-size:12px;margin:-20px 15px 0 0;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .servers>label select{min-width:130px;max-width:100%}.swagger-ui .servers h4.message{padding-bottom:2em}.swagger-ui .servers table tr{width:30em}.swagger-ui .servers table td{display:inline-block;max-width:15em;vertical-align:middle;padding-top:10px;padding-bottom:10px}.swagger-ui .servers table td:first-of-type{padding-right:2em}.swagger-ui .servers table td input{width:100%;height:100%}.swagger-ui .servers .computed-url{margin:2em 0}.swagger-ui .servers .computed-url code{display:inline-block;padding:4px;font-size:16px;margin:0 1em}.swagger-ui .global-server-container{margin:0 0 20px;padding:30px 0;background:#fff;-webkit-box-shadow:0 1px 2px 0 rgba(0,0,0,.15);box-shadow:0 1px 2px 0 rgba(0,0,0,.15)}.swagger-ui .global-server-container .servers-title{line-height:2em;font-weight:700}.swagger-ui .operation-servers h4.message{margin-bottom:2em}.swagger-ui table{width:100%;padding:0 10px;border-collapse:collapse}.swagger-ui table.model tbody tr td{padding:0;vertical-align:top}.swagger-ui table.model tbody tr td:first-of-type{width:174px;padding:0 0 0 2em}.swagger-ui table.headers td{font-size:12px;font-weight:300;vertical-align:middle;font-family:Source Code Pro,monospace;font-weight:600;color:#3b4151}.swagger-ui table tbody tr td{padding:10px 0 0;vertical-align:top}.swagger-ui table tbody tr td:first-of-type{max-width:20%;min-width:6em;padding:10px 0}.swagger-ui table thead tr td,.swagger-ui table thead tr th{font-size:12px;font-weight:700;padding:12px 0;text-align:left;border-bottom:1px solid rgba(59,65,81,.2);font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .parameters-col_description input[type=text]{width:100%;max-width:340px}.swagger-ui .parameters-col_description select{border-width:1px}.swagger-ui .parameter__name{font-size:16px;font-weight:400;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .parameter__name.required{font-weight:700}.swagger-ui .parameter__name.required:after{font-size:10px;position:relative;top:-6px;padding:5px;content:"required";color:rgba(255,0,0,.6)}.swagger-ui .parameter__extension,.swagger-ui .parameter__in{font-size:12px;font-style:italic;font-family:Source Code Pro,monospace;font-weight:600;color:gray}.swagger-ui .parameter__deprecated{font-size:12px;font-style:italic;font-family:Source Code Pro,monospace;font-weight:600;color:red}.swagger-ui .table-container{padding:20px}.swagger-ui .topbar{padding:8px 0;background-color:#89bf04}.swagger-ui .topbar .topbar-wrapper,.swagger-ui .topbar a{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.swagger-ui .topbar a{font-size:1.5em;font-weight:700;-webkit-box-flex:1;-ms-flex:1;flex:1;max-width:300px;text-decoration:none;font-family:Titillium Web,sans-serif;color:#fff}.swagger-ui .topbar a span{margin:0;padding:0 10px}.swagger-ui .topbar .download-url-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:3;-ms-flex:3;flex:3;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.swagger-ui .topbar .download-url-wrapper input[type=text]{width:100%;margin:0;border:2px solid #547f00;border-radius:4px 0 0 4px;outline:none}.swagger-ui .topbar .download-url-wrapper .select-label{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;max-width:600px;margin:0}.swagger-ui .topbar .download-url-wrapper .select-label span{font-size:16px;-webkit-box-flex:1;-ms-flex:1;flex:1;padding:0 10px 0 0;text-align:right}.swagger-ui .topbar .download-url-wrapper .select-label select{-webkit-box-flex:2;-ms-flex:2;flex:2;width:100%;border:2px solid #547f00;outline:none;-webkit-box-shadow:none;box-shadow:none}.swagger-ui .topbar .download-url-wrapper .download-url-button{font-size:16px;font-weight:700;padding:4px 30px;border:none;border-radius:0 4px 4px 0;background:#547f00;font-family:Titillium Web,sans-serif;color:#fff}.swagger-ui .info{margin:50px 0}.swagger-ui .info hgroup.main{margin:0 0 20px}.swagger-ui .info hgroup.main a{font-size:12px}.swagger-ui .info li,.swagger-ui .info p,.swagger-ui .info table{font-size:14px;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .info h1,.swagger-ui .info h2,.swagger-ui .info h3,.swagger-ui .info h4,.swagger-ui .info h5{font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .info code{padding:3px 5px;border-radius:4px;background:rgba(0,0,0,.05);font-family:Source Code Pro,monospace;font-weight:600;color:#9012fe}.swagger-ui .info a{font-size:14px;-webkit-transition:all .4s;transition:all .4s;font-family:Open Sans,sans-serif;color:#4990e2}.swagger-ui .info a:hover{color:#1f69c0}.swagger-ui .info>div{margin:0 0 5px}.swagger-ui .info .base-url{font-size:12px;font-weight:300!important;margin:0;font-family:Source Code Pro,monospace;font-weight:600;color:#3b4151}.swagger-ui .info .title{font-size:36px;margin:0;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .info .title small{font-size:10px;position:relative;top:-5px;display:inline-block;margin:0 0 0 5px;padding:2px 4px;vertical-align:super;border-radius:57px;background:#7d8492}.swagger-ui .info .title small pre{margin:0;font-family:Titillium Web,sans-serif;color:#fff}.swagger-ui .auth-btn-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;padding:10px 0;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.swagger-ui .auth-btn-wrapper .btn-done{margin-right:1em}.swagger-ui .auth-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.swagger-ui .auth-wrapper .authorize{padding-right:20px}.swagger-ui .auth-container{margin:0 0 10px;padding:10px 20px;border-bottom:1px solid #ebebeb}.swagger-ui .auth-container:last-of-type{margin:0;padding:10px 20px;border:0}.swagger-ui .auth-container h4{margin:5px 0 15px!important}.swagger-ui .auth-container .wrapper{margin:0;padding:0}.swagger-ui .auth-container input[type=password],.swagger-ui .auth-container input[type=text]{min-width:230px}.swagger-ui .auth-container .errors{font-size:12px;padding:10px;border-radius:4px;font-family:Source Code Pro,monospace;font-weight:600;color:#3b4151}.swagger-ui .scopes h2{font-size:14px;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .scope-def{padding:0 0 20px}.swagger-ui .errors-wrapper{margin:20px;padding:10px 20px;-webkit-animation:scaleUp .5s;animation:scaleUp .5s;border:2px solid #f93e3e;border-radius:4px;background:rgba(249,62,62,.1)}.swagger-ui .errors-wrapper .error-wrapper{margin:0 0 10px}.swagger-ui .errors-wrapper .errors h4{font-size:14px;margin:0;font-family:Source Code Pro,monospace;font-weight:600;color:#3b4151}.swagger-ui .errors-wrapper .errors small{color:#606060}.swagger-ui .errors-wrapper hgroup{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.swagger-ui .errors-wrapper hgroup h4{font-size:20px;margin:0;-webkit-box-flex:1;-ms-flex:1;flex:1;font-family:Titillium Web,sans-serif;color:#3b4151}@-webkit-keyframes scaleUp{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes scaleUp{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}.swagger-ui .Resizer.vertical.disabled{display:none} +.swagger-ui{ + /*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */font-family:sans-serif;color:#3b4151}.swagger-ui html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}.swagger-ui body{margin:0}.swagger-ui article,.swagger-ui aside,.swagger-ui footer,.swagger-ui header,.swagger-ui nav,.swagger-ui section{display:block}.swagger-ui h1{font-size:2em;margin:.67em 0}.swagger-ui figcaption,.swagger-ui figure,.swagger-ui main{display:block}.swagger-ui figure{margin:1em 40px}.swagger-ui hr{box-sizing:content-box;height:0;overflow:visible}.swagger-ui pre{font-family:monospace,monospace;font-size:1em}.swagger-ui a{background-color:transparent;-webkit-text-decoration-skip:objects}.swagger-ui abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.swagger-ui b,.swagger-ui strong{font-weight:inherit;font-weight:bolder}.swagger-ui code,.swagger-ui kbd,.swagger-ui samp{font-family:monospace,monospace;font-size:1em}.swagger-ui dfn{font-style:italic}.swagger-ui mark{background-color:#ff0;color:#000}.swagger-ui small{font-size:80%}.swagger-ui sub,.swagger-ui sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.swagger-ui sub{bottom:-.25em}.swagger-ui sup{top:-.5em}.swagger-ui audio,.swagger-ui video{display:inline-block}.swagger-ui audio:not([controls]){display:none;height:0}.swagger-ui img{border-style:none}.swagger-ui svg:not(:root){overflow:hidden}.swagger-ui button,.swagger-ui input,.swagger-ui optgroup,.swagger-ui select,.swagger-ui textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}.swagger-ui button,.swagger-ui input{overflow:visible}.swagger-ui button,.swagger-ui select{text-transform:none}.swagger-ui [type=reset],.swagger-ui [type=submit],.swagger-ui button,.swagger-ui html [type=button]{-webkit-appearance:button}.swagger-ui [type=button]::-moz-focus-inner,.swagger-ui [type=reset]::-moz-focus-inner,.swagger-ui [type=submit]::-moz-focus-inner,.swagger-ui button::-moz-focus-inner{border-style:none;padding:0}.swagger-ui [type=button]:-moz-focusring,.swagger-ui [type=reset]:-moz-focusring,.swagger-ui [type=submit]:-moz-focusring,.swagger-ui button:-moz-focusring{outline:1px dotted ButtonText}.swagger-ui fieldset{padding:.35em .75em .625em}.swagger-ui legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}.swagger-ui progress{display:inline-block;vertical-align:baseline}.swagger-ui textarea{overflow:auto}.swagger-ui [type=checkbox],.swagger-ui [type=radio]{box-sizing:border-box;padding:0}.swagger-ui [type=number]::-webkit-inner-spin-button,.swagger-ui [type=number]::-webkit-outer-spin-button{height:auto}.swagger-ui [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.swagger-ui [type=search]::-webkit-search-cancel-button,.swagger-ui [type=search]::-webkit-search-decoration{-webkit-appearance:none}.swagger-ui ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.swagger-ui details,.swagger-ui menu{display:block}.swagger-ui summary{display:list-item}.swagger-ui canvas{display:inline-block}.swagger-ui template{display:none}.swagger-ui [hidden]{display:none}.swagger-ui .debug *{outline:1px solid gold}.swagger-ui .debug-white *{outline:1px solid #fff}.swagger-ui .debug-black *{outline:1px solid #000}.swagger-ui .debug-grid{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTRDOTY4N0U2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTRDOTY4N0Q2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3NjY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3NzY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsBS+GMAAAAjSURBVHjaYvz//z8DLsD4gcGXiYEAGBIKGBne//fFpwAgwAB98AaF2pjlUQAAAABJRU5ErkJggg==) repeat 0 0}.swagger-ui .debug-grid-16{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODYyRjhERDU2N0YyMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODYyRjhERDQ2N0YyMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3QTY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3QjY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvCS01IAAABMSURBVHjaYmR4/5+BFPBfAMFm/MBgx8RAGWCn1AAmSg34Q6kBDKMGMDCwICeMIemF/5QawEipAWwUhwEjMDvbAWlWkvVBwu8vQIABAEwBCph8U6c0AAAAAElFTkSuQmCC) repeat 0 0}.swagger-ui .debug-grid-8-solid{background:#fff url(data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAAAAD/4QMxaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzExMSA3OS4xNTgzMjUsIDIwMTUvMDkvMTAtMDE6MTA6MjAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE1IChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkIxMjI0OTczNjdCMzExRTZCMkJDRTI0MDgxMDAyMTcxIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkIxMjI0OTc0NjdCMzExRTZCMkJDRTI0MDgxMDAyMTcxIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QjEyMjQ5NzE2N0IzMTFFNkIyQkNFMjQwODEwMDIxNzEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QjEyMjQ5NzI2N0IzMTFFNkIyQkNFMjQwODEwMDIxNzEiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7/7gAOQWRvYmUAZMAAAAAB/9sAhAAbGhopHSlBJiZBQi8vL0JHPz4+P0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHAR0pKTQmND8oKD9HPzU/R0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0f/wAARCAAIAAgDASIAAhEBAxEB/8QAWQABAQAAAAAAAAAAAAAAAAAAAAYBAQEAAAAAAAAAAAAAAAAAAAIEEAEBAAMBAAAAAAAAAAAAAAABADECA0ERAAEDBQAAAAAAAAAAAAAAAAARITFBUWESIv/aAAwDAQACEQMRAD8AoOnTV1QTD7JJshP3vSM3P//Z) repeat 0 0}.swagger-ui .debug-grid-16-solid{background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NzY3MkJEN0U2N0M1MTFFNkIyQkNFMjQwODEwMDIxNzEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NzY3MkJEN0Y2N0M1MTFFNkIyQkNFMjQwODEwMDIxNzEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3QzY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3RDY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pve6J3kAAAAzSURBVHjaYvz//z8D0UDsMwMjSRoYP5Gq4SPNbRjVMEQ1fCRDg+in/6+J1AJUxsgAEGAA31BAJMS0GYEAAAAASUVORK5CYII=) repeat 0 0}.swagger-ui .border-box,.swagger-ui a,.swagger-ui article,.swagger-ui body,.swagger-ui code,.swagger-ui dd,.swagger-ui div,.swagger-ui dl,.swagger-ui dt,.swagger-ui fieldset,.swagger-ui footer,.swagger-ui form,.swagger-ui h1,.swagger-ui h2,.swagger-ui h3,.swagger-ui h4,.swagger-ui h5,.swagger-ui h6,.swagger-ui header,.swagger-ui html,.swagger-ui input[type=email],.swagger-ui input[type=number],.swagger-ui input[type=password],.swagger-ui input[type=tel],.swagger-ui input[type=text],.swagger-ui input[type=url],.swagger-ui legend,.swagger-ui li,.swagger-ui main,.swagger-ui ol,.swagger-ui p,.swagger-ui pre,.swagger-ui section,.swagger-ui table,.swagger-ui td,.swagger-ui textarea,.swagger-ui th,.swagger-ui tr,.swagger-ui ul{box-sizing:border-box}.swagger-ui .aspect-ratio{height:0;position:relative}.swagger-ui .aspect-ratio--16x9{padding-bottom:56.25%}.swagger-ui .aspect-ratio--9x16{padding-bottom:177.77%}.swagger-ui .aspect-ratio--4x3{padding-bottom:75%}.swagger-ui .aspect-ratio--3x4{padding-bottom:133.33%}.swagger-ui .aspect-ratio--6x4{padding-bottom:66.6%}.swagger-ui .aspect-ratio--4x6{padding-bottom:150%}.swagger-ui .aspect-ratio--8x5{padding-bottom:62.5%}.swagger-ui .aspect-ratio--5x8{padding-bottom:160%}.swagger-ui .aspect-ratio--7x5{padding-bottom:71.42%}.swagger-ui .aspect-ratio--5x7{padding-bottom:140%}.swagger-ui .aspect-ratio--1x1{padding-bottom:100%}.swagger-ui .aspect-ratio--object{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:100}@media screen and (min-width:30em){.swagger-ui .aspect-ratio-ns{height:0;position:relative}.swagger-ui .aspect-ratio--16x9-ns{padding-bottom:56.25%}.swagger-ui .aspect-ratio--9x16-ns{padding-bottom:177.77%}.swagger-ui .aspect-ratio--4x3-ns{padding-bottom:75%}.swagger-ui .aspect-ratio--3x4-ns{padding-bottom:133.33%}.swagger-ui .aspect-ratio--6x4-ns{padding-bottom:66.6%}.swagger-ui .aspect-ratio--4x6-ns{padding-bottom:150%}.swagger-ui .aspect-ratio--8x5-ns{padding-bottom:62.5%}.swagger-ui .aspect-ratio--5x8-ns{padding-bottom:160%}.swagger-ui .aspect-ratio--7x5-ns{padding-bottom:71.42%}.swagger-ui .aspect-ratio--5x7-ns{padding-bottom:140%}.swagger-ui .aspect-ratio--1x1-ns{padding-bottom:100%}.swagger-ui .aspect-ratio--object-ns{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:100}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .aspect-ratio-m{height:0;position:relative}.swagger-ui .aspect-ratio--16x9-m{padding-bottom:56.25%}.swagger-ui .aspect-ratio--9x16-m{padding-bottom:177.77%}.swagger-ui .aspect-ratio--4x3-m{padding-bottom:75%}.swagger-ui .aspect-ratio--3x4-m{padding-bottom:133.33%}.swagger-ui .aspect-ratio--6x4-m{padding-bottom:66.6%}.swagger-ui .aspect-ratio--4x6-m{padding-bottom:150%}.swagger-ui .aspect-ratio--8x5-m{padding-bottom:62.5%}.swagger-ui .aspect-ratio--5x8-m{padding-bottom:160%}.swagger-ui .aspect-ratio--7x5-m{padding-bottom:71.42%}.swagger-ui .aspect-ratio--5x7-m{padding-bottom:140%}.swagger-ui .aspect-ratio--1x1-m{padding-bottom:100%}.swagger-ui .aspect-ratio--object-m{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:100}}@media screen and (min-width:60em){.swagger-ui .aspect-ratio-l{height:0;position:relative}.swagger-ui .aspect-ratio--16x9-l{padding-bottom:56.25%}.swagger-ui .aspect-ratio--9x16-l{padding-bottom:177.77%}.swagger-ui .aspect-ratio--4x3-l{padding-bottom:75%}.swagger-ui .aspect-ratio--3x4-l{padding-bottom:133.33%}.swagger-ui .aspect-ratio--6x4-l{padding-bottom:66.6%}.swagger-ui .aspect-ratio--4x6-l{padding-bottom:150%}.swagger-ui .aspect-ratio--8x5-l{padding-bottom:62.5%}.swagger-ui .aspect-ratio--5x8-l{padding-bottom:160%}.swagger-ui .aspect-ratio--7x5-l{padding-bottom:71.42%}.swagger-ui .aspect-ratio--5x7-l{padding-bottom:140%}.swagger-ui .aspect-ratio--1x1-l{padding-bottom:100%}.swagger-ui .aspect-ratio--object-l{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:100}}.swagger-ui img{max-width:100%}.swagger-ui .cover{background-size:cover!important}.swagger-ui .contain{background-size:contain!important}@media screen and (min-width:30em){.swagger-ui .cover-ns{background-size:cover!important}.swagger-ui .contain-ns{background-size:contain!important}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .cover-m{background-size:cover!important}.swagger-ui .contain-m{background-size:contain!important}}@media screen and (min-width:60em){.swagger-ui .cover-l{background-size:cover!important}.swagger-ui .contain-l{background-size:contain!important}}.swagger-ui .bg-center{background-repeat:no-repeat;background-position:50%}.swagger-ui .bg-top{background-repeat:no-repeat;background-position:top}.swagger-ui .bg-right{background-repeat:no-repeat;background-position:100%}.swagger-ui .bg-bottom{background-repeat:no-repeat;background-position:bottom}.swagger-ui .bg-left{background-repeat:no-repeat;background-position:0}@media screen and (min-width:30em){.swagger-ui .bg-center-ns{background-repeat:no-repeat;background-position:50%}.swagger-ui .bg-top-ns{background-repeat:no-repeat;background-position:top}.swagger-ui .bg-right-ns{background-repeat:no-repeat;background-position:100%}.swagger-ui .bg-bottom-ns{background-repeat:no-repeat;background-position:bottom}.swagger-ui .bg-left-ns{background-repeat:no-repeat;background-position:0}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .bg-center-m{background-repeat:no-repeat;background-position:50%}.swagger-ui .bg-top-m{background-repeat:no-repeat;background-position:top}.swagger-ui .bg-right-m{background-repeat:no-repeat;background-position:100%}.swagger-ui .bg-bottom-m{background-repeat:no-repeat;background-position:bottom}.swagger-ui .bg-left-m{background-repeat:no-repeat;background-position:0}}@media screen and (min-width:60em){.swagger-ui .bg-center-l{background-repeat:no-repeat;background-position:50%}.swagger-ui .bg-top-l{background-repeat:no-repeat;background-position:top}.swagger-ui .bg-right-l{background-repeat:no-repeat;background-position:100%}.swagger-ui .bg-bottom-l{background-repeat:no-repeat;background-position:bottom}.swagger-ui .bg-left-l{background-repeat:no-repeat;background-position:0}}.swagger-ui .outline{outline:1px solid}.swagger-ui .outline-transparent{outline:1px solid transparent}.swagger-ui .outline-0{outline:0}@media screen and (min-width:30em){.swagger-ui .outline-ns{outline:1px solid}.swagger-ui .outline-transparent-ns{outline:1px solid transparent}.swagger-ui .outline-0-ns{outline:0}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .outline-m{outline:1px solid}.swagger-ui .outline-transparent-m{outline:1px solid transparent}.swagger-ui .outline-0-m{outline:0}}@media screen and (min-width:60em){.swagger-ui .outline-l{outline:1px solid}.swagger-ui .outline-transparent-l{outline:1px solid transparent}.swagger-ui .outline-0-l{outline:0}}.swagger-ui .ba{border-style:solid;border-width:1px}.swagger-ui .bt{border-top-style:solid;border-top-width:1px}.swagger-ui .br{border-right-style:solid;border-right-width:1px}.swagger-ui .bb{border-bottom-style:solid;border-bottom-width:1px}.swagger-ui .bl{border-left-style:solid;border-left-width:1px}.swagger-ui .bn{border-style:none;border-width:0}@media screen and (min-width:30em){.swagger-ui .ba-ns{border-style:solid;border-width:1px}.swagger-ui .bt-ns{border-top-style:solid;border-top-width:1px}.swagger-ui .br-ns{border-right-style:solid;border-right-width:1px}.swagger-ui .bb-ns{border-bottom-style:solid;border-bottom-width:1px}.swagger-ui .bl-ns{border-left-style:solid;border-left-width:1px}.swagger-ui .bn-ns{border-style:none;border-width:0}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .ba-m{border-style:solid;border-width:1px}.swagger-ui .bt-m{border-top-style:solid;border-top-width:1px}.swagger-ui .br-m{border-right-style:solid;border-right-width:1px}.swagger-ui .bb-m{border-bottom-style:solid;border-bottom-width:1px}.swagger-ui .bl-m{border-left-style:solid;border-left-width:1px}.swagger-ui .bn-m{border-style:none;border-width:0}}@media screen and (min-width:60em){.swagger-ui .ba-l{border-style:solid;border-width:1px}.swagger-ui .bt-l{border-top-style:solid;border-top-width:1px}.swagger-ui .br-l{border-right-style:solid;border-right-width:1px}.swagger-ui .bb-l{border-bottom-style:solid;border-bottom-width:1px}.swagger-ui .bl-l{border-left-style:solid;border-left-width:1px}.swagger-ui .bn-l{border-style:none;border-width:0}}.swagger-ui .b--black{border-color:#000}.swagger-ui .b--near-black{border-color:#111}.swagger-ui .b--dark-gray{border-color:#333}.swagger-ui .b--mid-gray{border-color:#555}.swagger-ui .b--gray{border-color:#777}.swagger-ui .b--silver{border-color:#999}.swagger-ui .b--light-silver{border-color:#aaa}.swagger-ui .b--moon-gray{border-color:#ccc}.swagger-ui .b--light-gray{border-color:#eee}.swagger-ui .b--near-white{border-color:#f4f4f4}.swagger-ui .b--white{border-color:#fff}.swagger-ui .b--white-90{border-color:hsla(0,0%,100%,.9)}.swagger-ui .b--white-80{border-color:hsla(0,0%,100%,.8)}.swagger-ui .b--white-70{border-color:hsla(0,0%,100%,.7)}.swagger-ui .b--white-60{border-color:hsla(0,0%,100%,.6)}.swagger-ui .b--white-50{border-color:hsla(0,0%,100%,.5)}.swagger-ui .b--white-40{border-color:hsla(0,0%,100%,.4)}.swagger-ui .b--white-30{border-color:hsla(0,0%,100%,.3)}.swagger-ui .b--white-20{border-color:hsla(0,0%,100%,.2)}.swagger-ui .b--white-10{border-color:hsla(0,0%,100%,.1)}.swagger-ui .b--white-05{border-color:hsla(0,0%,100%,.05)}.swagger-ui .b--white-025{border-color:hsla(0,0%,100%,.025)}.swagger-ui .b--white-0125{border-color:hsla(0,0%,100%,.0125)}.swagger-ui .b--black-90{border-color:rgba(0,0,0,.9)}.swagger-ui .b--black-80{border-color:rgba(0,0,0,.8)}.swagger-ui .b--black-70{border-color:rgba(0,0,0,.7)}.swagger-ui .b--black-60{border-color:rgba(0,0,0,.6)}.swagger-ui .b--black-50{border-color:rgba(0,0,0,.5)}.swagger-ui .b--black-40{border-color:rgba(0,0,0,.4)}.swagger-ui .b--black-30{border-color:rgba(0,0,0,.3)}.swagger-ui .b--black-20{border-color:rgba(0,0,0,.2)}.swagger-ui .b--black-10{border-color:rgba(0,0,0,.1)}.swagger-ui .b--black-05{border-color:rgba(0,0,0,.05)}.swagger-ui .b--black-025{border-color:rgba(0,0,0,.025)}.swagger-ui .b--black-0125{border-color:rgba(0,0,0,.0125)}.swagger-ui .b--dark-red{border-color:#e7040f}.swagger-ui .b--red{border-color:#ff4136}.swagger-ui .b--light-red{border-color:#ff725c}.swagger-ui .b--orange{border-color:#ff6300}.swagger-ui .b--gold{border-color:#ffb700}.swagger-ui .b--yellow{border-color:gold}.swagger-ui .b--light-yellow{border-color:#fbf1a9}.swagger-ui .b--purple{border-color:#5e2ca5}.swagger-ui .b--light-purple{border-color:#a463f2}.swagger-ui .b--dark-pink{border-color:#d5008f}.swagger-ui .b--hot-pink{border-color:#ff41b4}.swagger-ui .b--pink{border-color:#ff80cc}.swagger-ui .b--light-pink{border-color:#ffa3d7}.swagger-ui .b--dark-green{border-color:#137752}.swagger-ui .b--green{border-color:#19a974}.swagger-ui .b--light-green{border-color:#9eebcf}.swagger-ui .b--navy{border-color:#001b44}.swagger-ui .b--dark-blue{border-color:#00449e}.swagger-ui .b--blue{border-color:#357edd}.swagger-ui .b--light-blue{border-color:#96ccff}.swagger-ui .b--lightest-blue{border-color:#cdecff}.swagger-ui .b--washed-blue{border-color:#f6fffe}.swagger-ui .b--washed-green{border-color:#e8fdf5}.swagger-ui .b--washed-yellow{border-color:#fffceb}.swagger-ui .b--washed-red{border-color:#ffdfdf}.swagger-ui .b--transparent{border-color:transparent}.swagger-ui .b--inherit{border-color:inherit}.swagger-ui .br0{border-radius:0}.swagger-ui .br1{border-radius:.125rem}.swagger-ui .br2{border-radius:.25rem}.swagger-ui .br3{border-radius:.5rem}.swagger-ui .br4{border-radius:1rem}.swagger-ui .br-100{border-radius:100%}.swagger-ui .br-pill{border-radius:9999px}.swagger-ui .br--bottom{border-top-left-radius:0;border-top-right-radius:0}.swagger-ui .br--top{border-bottom-left-radius:0;border-bottom-right-radius:0}.swagger-ui .br--right{border-top-left-radius:0;border-bottom-left-radius:0}.swagger-ui .br--left{border-top-right-radius:0;border-bottom-right-radius:0}@media screen and (min-width:30em){.swagger-ui .br0-ns{border-radius:0}.swagger-ui .br1-ns{border-radius:.125rem}.swagger-ui .br2-ns{border-radius:.25rem}.swagger-ui .br3-ns{border-radius:.5rem}.swagger-ui .br4-ns{border-radius:1rem}.swagger-ui .br-100-ns{border-radius:100%}.swagger-ui .br-pill-ns{border-radius:9999px}.swagger-ui .br--bottom-ns{border-top-left-radius:0;border-top-right-radius:0}.swagger-ui .br--top-ns{border-bottom-left-radius:0;border-bottom-right-radius:0}.swagger-ui .br--right-ns{border-top-left-radius:0;border-bottom-left-radius:0}.swagger-ui .br--left-ns{border-top-right-radius:0;border-bottom-right-radius:0}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .br0-m{border-radius:0}.swagger-ui .br1-m{border-radius:.125rem}.swagger-ui .br2-m{border-radius:.25rem}.swagger-ui .br3-m{border-radius:.5rem}.swagger-ui .br4-m{border-radius:1rem}.swagger-ui .br-100-m{border-radius:100%}.swagger-ui .br-pill-m{border-radius:9999px}.swagger-ui .br--bottom-m{border-top-left-radius:0;border-top-right-radius:0}.swagger-ui .br--top-m{border-bottom-left-radius:0;border-bottom-right-radius:0}.swagger-ui .br--right-m{border-top-left-radius:0;border-bottom-left-radius:0}.swagger-ui .br--left-m{border-top-right-radius:0;border-bottom-right-radius:0}}@media screen and (min-width:60em){.swagger-ui .br0-l{border-radius:0}.swagger-ui .br1-l{border-radius:.125rem}.swagger-ui .br2-l{border-radius:.25rem}.swagger-ui .br3-l{border-radius:.5rem}.swagger-ui .br4-l{border-radius:1rem}.swagger-ui .br-100-l{border-radius:100%}.swagger-ui .br-pill-l{border-radius:9999px}.swagger-ui .br--bottom-l{border-top-left-radius:0;border-top-right-radius:0}.swagger-ui .br--top-l{border-bottom-left-radius:0;border-bottom-right-radius:0}.swagger-ui .br--right-l{border-top-left-radius:0;border-bottom-left-radius:0}.swagger-ui .br--left-l{border-top-right-radius:0;border-bottom-right-radius:0}}.swagger-ui .b--dotted{border-style:dotted}.swagger-ui .b--dashed{border-style:dashed}.swagger-ui .b--solid{border-style:solid}.swagger-ui .b--none{border-style:none}@media screen and (min-width:30em){.swagger-ui .b--dotted-ns{border-style:dotted}.swagger-ui .b--dashed-ns{border-style:dashed}.swagger-ui .b--solid-ns{border-style:solid}.swagger-ui .b--none-ns{border-style:none}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .b--dotted-m{border-style:dotted}.swagger-ui .b--dashed-m{border-style:dashed}.swagger-ui .b--solid-m{border-style:solid}.swagger-ui .b--none-m{border-style:none}}@media screen and (min-width:60em){.swagger-ui .b--dotted-l{border-style:dotted}.swagger-ui .b--dashed-l{border-style:dashed}.swagger-ui .b--solid-l{border-style:solid}.swagger-ui .b--none-l{border-style:none}}.swagger-ui .bw0{border-width:0}.swagger-ui .bw1{border-width:.125rem}.swagger-ui .bw2{border-width:.25rem}.swagger-ui .bw3{border-width:.5rem}.swagger-ui .bw4{border-width:1rem}.swagger-ui .bw5{border-width:2rem}.swagger-ui .bt-0{border-top-width:0}.swagger-ui .br-0{border-right-width:0}.swagger-ui .bb-0{border-bottom-width:0}.swagger-ui .bl-0{border-left-width:0}@media screen and (min-width:30em){.swagger-ui .bw0-ns{border-width:0}.swagger-ui .bw1-ns{border-width:.125rem}.swagger-ui .bw2-ns{border-width:.25rem}.swagger-ui .bw3-ns{border-width:.5rem}.swagger-ui .bw4-ns{border-width:1rem}.swagger-ui .bw5-ns{border-width:2rem}.swagger-ui .bt-0-ns{border-top-width:0}.swagger-ui .br-0-ns{border-right-width:0}.swagger-ui .bb-0-ns{border-bottom-width:0}.swagger-ui .bl-0-ns{border-left-width:0}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .bw0-m{border-width:0}.swagger-ui .bw1-m{border-width:.125rem}.swagger-ui .bw2-m{border-width:.25rem}.swagger-ui .bw3-m{border-width:.5rem}.swagger-ui .bw4-m{border-width:1rem}.swagger-ui .bw5-m{border-width:2rem}.swagger-ui .bt-0-m{border-top-width:0}.swagger-ui .br-0-m{border-right-width:0}.swagger-ui .bb-0-m{border-bottom-width:0}.swagger-ui .bl-0-m{border-left-width:0}}@media screen and (min-width:60em){.swagger-ui .bw0-l{border-width:0}.swagger-ui .bw1-l{border-width:.125rem}.swagger-ui .bw2-l{border-width:.25rem}.swagger-ui .bw3-l{border-width:.5rem}.swagger-ui .bw4-l{border-width:1rem}.swagger-ui .bw5-l{border-width:2rem}.swagger-ui .bt-0-l{border-top-width:0}.swagger-ui .br-0-l{border-right-width:0}.swagger-ui .bb-0-l{border-bottom-width:0}.swagger-ui .bl-0-l{border-left-width:0}}.swagger-ui .shadow-1{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-2{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-3{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-4{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.swagger-ui .shadow-5{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}@media screen and (min-width:30em){.swagger-ui .shadow-1-ns{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-2-ns{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-3-ns{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-4-ns{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.swagger-ui .shadow-5-ns{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .shadow-1-m{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-2-m{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-3-m{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-4-m{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.swagger-ui .shadow-5-m{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}}@media screen and (min-width:60em){.swagger-ui .shadow-1-l{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-2-l{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-3-l{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-4-l{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.swagger-ui .shadow-5-l{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}}.swagger-ui .pre{overflow-x:auto;overflow-y:hidden;overflow:scroll}.swagger-ui .top-0{top:0}.swagger-ui .right-0{right:0}.swagger-ui .bottom-0{bottom:0}.swagger-ui .left-0{left:0}.swagger-ui .top-1{top:1rem}.swagger-ui .right-1{right:1rem}.swagger-ui .bottom-1{bottom:1rem}.swagger-ui .left-1{left:1rem}.swagger-ui .top-2{top:2rem}.swagger-ui .right-2{right:2rem}.swagger-ui .bottom-2{bottom:2rem}.swagger-ui .left-2{left:2rem}.swagger-ui .top--1{top:-1rem}.swagger-ui .right--1{right:-1rem}.swagger-ui .bottom--1{bottom:-1rem}.swagger-ui .left--1{left:-1rem}.swagger-ui .top--2{top:-2rem}.swagger-ui .right--2{right:-2rem}.swagger-ui .bottom--2{bottom:-2rem}.swagger-ui .left--2{left:-2rem}.swagger-ui .absolute--fill{top:0;right:0;bottom:0;left:0}@media screen and (min-width:30em){.swagger-ui .top-0-ns{top:0}.swagger-ui .left-0-ns{left:0}.swagger-ui .right-0-ns{right:0}.swagger-ui .bottom-0-ns{bottom:0}.swagger-ui .top-1-ns{top:1rem}.swagger-ui .left-1-ns{left:1rem}.swagger-ui .right-1-ns{right:1rem}.swagger-ui .bottom-1-ns{bottom:1rem}.swagger-ui .top-2-ns{top:2rem}.swagger-ui .left-2-ns{left:2rem}.swagger-ui .right-2-ns{right:2rem}.swagger-ui .bottom-2-ns{bottom:2rem}.swagger-ui .top--1-ns{top:-1rem}.swagger-ui .right--1-ns{right:-1rem}.swagger-ui .bottom--1-ns{bottom:-1rem}.swagger-ui .left--1-ns{left:-1rem}.swagger-ui .top--2-ns{top:-2rem}.swagger-ui .right--2-ns{right:-2rem}.swagger-ui .bottom--2-ns{bottom:-2rem}.swagger-ui .left--2-ns{left:-2rem}.swagger-ui .absolute--fill-ns{top:0;right:0;bottom:0;left:0}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .top-0-m{top:0}.swagger-ui .left-0-m{left:0}.swagger-ui .right-0-m{right:0}.swagger-ui .bottom-0-m{bottom:0}.swagger-ui .top-1-m{top:1rem}.swagger-ui .left-1-m{left:1rem}.swagger-ui .right-1-m{right:1rem}.swagger-ui .bottom-1-m{bottom:1rem}.swagger-ui .top-2-m{top:2rem}.swagger-ui .left-2-m{left:2rem}.swagger-ui .right-2-m{right:2rem}.swagger-ui .bottom-2-m{bottom:2rem}.swagger-ui .top--1-m{top:-1rem}.swagger-ui .right--1-m{right:-1rem}.swagger-ui .bottom--1-m{bottom:-1rem}.swagger-ui .left--1-m{left:-1rem}.swagger-ui .top--2-m{top:-2rem}.swagger-ui .right--2-m{right:-2rem}.swagger-ui .bottom--2-m{bottom:-2rem}.swagger-ui .left--2-m{left:-2rem}.swagger-ui .absolute--fill-m{top:0;right:0;bottom:0;left:0}}@media screen and (min-width:60em){.swagger-ui .top-0-l{top:0}.swagger-ui .left-0-l{left:0}.swagger-ui .right-0-l{right:0}.swagger-ui .bottom-0-l{bottom:0}.swagger-ui .top-1-l{top:1rem}.swagger-ui .left-1-l{left:1rem}.swagger-ui .right-1-l{right:1rem}.swagger-ui .bottom-1-l{bottom:1rem}.swagger-ui .top-2-l{top:2rem}.swagger-ui .left-2-l{left:2rem}.swagger-ui .right-2-l{right:2rem}.swagger-ui .bottom-2-l{bottom:2rem}.swagger-ui .top--1-l{top:-1rem}.swagger-ui .right--1-l{right:-1rem}.swagger-ui .bottom--1-l{bottom:-1rem}.swagger-ui .left--1-l{left:-1rem}.swagger-ui .top--2-l{top:-2rem}.swagger-ui .right--2-l{right:-2rem}.swagger-ui .bottom--2-l{bottom:-2rem}.swagger-ui .left--2-l{left:-2rem}.swagger-ui .absolute--fill-l{top:0;right:0;bottom:0;left:0}}.swagger-ui .cf:after,.swagger-ui .cf:before{content:" ";display:table}.swagger-ui .cf:after{clear:both}.swagger-ui .cf{*zoom:1}.swagger-ui .cl{clear:left}.swagger-ui .cr{clear:right}.swagger-ui .cb{clear:both}.swagger-ui .cn{clear:none}@media screen and (min-width:30em){.swagger-ui .cl-ns{clear:left}.swagger-ui .cr-ns{clear:right}.swagger-ui .cb-ns{clear:both}.swagger-ui .cn-ns{clear:none}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .cl-m{clear:left}.swagger-ui .cr-m{clear:right}.swagger-ui .cb-m{clear:both}.swagger-ui .cn-m{clear:none}}@media screen and (min-width:60em){.swagger-ui .cl-l{clear:left}.swagger-ui .cr-l{clear:right}.swagger-ui .cb-l{clear:both}.swagger-ui .cn-l{clear:none}}.swagger-ui .flex{display:flex}.swagger-ui .inline-flex{display:inline-flex}.swagger-ui .flex-auto{flex:1 1 auto;min-width:0;min-height:0}.swagger-ui .flex-none{flex:none}.swagger-ui .flex-column{flex-direction:column}.swagger-ui .flex-row{flex-direction:row}.swagger-ui .flex-wrap{flex-wrap:wrap}.swagger-ui .flex-nowrap{flex-wrap:nowrap}.swagger-ui .flex-wrap-reverse{flex-wrap:wrap-reverse}.swagger-ui .flex-column-reverse{flex-direction:column-reverse}.swagger-ui .flex-row-reverse{flex-direction:row-reverse}.swagger-ui .items-start{align-items:flex-start}.swagger-ui .items-end{align-items:flex-end}.swagger-ui .items-center{align-items:center}.swagger-ui .items-baseline{align-items:baseline}.swagger-ui .items-stretch{align-items:stretch}.swagger-ui .self-start{align-self:flex-start}.swagger-ui .self-end{align-self:flex-end}.swagger-ui .self-center{align-self:center}.swagger-ui .self-baseline{align-self:baseline}.swagger-ui .self-stretch{align-self:stretch}.swagger-ui .justify-start{justify-content:flex-start}.swagger-ui .justify-end{justify-content:flex-end}.swagger-ui .justify-center{justify-content:center}.swagger-ui .justify-between{justify-content:space-between}.swagger-ui .justify-around{justify-content:space-around}.swagger-ui .content-start{align-content:flex-start}.swagger-ui .content-end{align-content:flex-end}.swagger-ui .content-center{align-content:center}.swagger-ui .content-between{align-content:space-between}.swagger-ui .content-around{align-content:space-around}.swagger-ui .content-stretch{align-content:stretch}.swagger-ui .order-0{order:0}.swagger-ui .order-1{order:1}.swagger-ui .order-2{order:2}.swagger-ui .order-3{order:3}.swagger-ui .order-4{order:4}.swagger-ui .order-5{order:5}.swagger-ui .order-6{order:6}.swagger-ui .order-7{order:7}.swagger-ui .order-8{order:8}.swagger-ui .order-last{order:99999}.swagger-ui .flex-grow-0{flex-grow:0}.swagger-ui .flex-grow-1{flex-grow:1}.swagger-ui .flex-shrink-0{flex-shrink:0}.swagger-ui .flex-shrink-1{flex-shrink:1}@media screen and (min-width:30em){.swagger-ui .flex-ns{display:flex}.swagger-ui .inline-flex-ns{display:inline-flex}.swagger-ui .flex-auto-ns{flex:1 1 auto;min-width:0;min-height:0}.swagger-ui .flex-none-ns{flex:none}.swagger-ui .flex-column-ns{flex-direction:column}.swagger-ui .flex-row-ns{flex-direction:row}.swagger-ui .flex-wrap-ns{flex-wrap:wrap}.swagger-ui .flex-nowrap-ns{flex-wrap:nowrap}.swagger-ui .flex-wrap-reverse-ns{flex-wrap:wrap-reverse}.swagger-ui .flex-column-reverse-ns{flex-direction:column-reverse}.swagger-ui .flex-row-reverse-ns{flex-direction:row-reverse}.swagger-ui .items-start-ns{align-items:flex-start}.swagger-ui .items-end-ns{align-items:flex-end}.swagger-ui .items-center-ns{align-items:center}.swagger-ui .items-baseline-ns{align-items:baseline}.swagger-ui .items-stretch-ns{align-items:stretch}.swagger-ui .self-start-ns{align-self:flex-start}.swagger-ui .self-end-ns{align-self:flex-end}.swagger-ui .self-center-ns{align-self:center}.swagger-ui .self-baseline-ns{align-self:baseline}.swagger-ui .self-stretch-ns{align-self:stretch}.swagger-ui .justify-start-ns{justify-content:flex-start}.swagger-ui .justify-end-ns{justify-content:flex-end}.swagger-ui .justify-center-ns{justify-content:center}.swagger-ui .justify-between-ns{justify-content:space-between}.swagger-ui .justify-around-ns{justify-content:space-around}.swagger-ui .content-start-ns{align-content:flex-start}.swagger-ui .content-end-ns{align-content:flex-end}.swagger-ui .content-center-ns{align-content:center}.swagger-ui .content-between-ns{align-content:space-between}.swagger-ui .content-around-ns{align-content:space-around}.swagger-ui .content-stretch-ns{align-content:stretch}.swagger-ui .order-0-ns{order:0}.swagger-ui .order-1-ns{order:1}.swagger-ui .order-2-ns{order:2}.swagger-ui .order-3-ns{order:3}.swagger-ui .order-4-ns{order:4}.swagger-ui .order-5-ns{order:5}.swagger-ui .order-6-ns{order:6}.swagger-ui .order-7-ns{order:7}.swagger-ui .order-8-ns{order:8}.swagger-ui .order-last-ns{order:99999}.swagger-ui .flex-grow-0-ns{flex-grow:0}.swagger-ui .flex-grow-1-ns{flex-grow:1}.swagger-ui .flex-shrink-0-ns{flex-shrink:0}.swagger-ui .flex-shrink-1-ns{flex-shrink:1}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .flex-m{display:flex}.swagger-ui .inline-flex-m{display:inline-flex}.swagger-ui .flex-auto-m{flex:1 1 auto;min-width:0;min-height:0}.swagger-ui .flex-none-m{flex:none}.swagger-ui .flex-column-m{flex-direction:column}.swagger-ui .flex-row-m{flex-direction:row}.swagger-ui .flex-wrap-m{flex-wrap:wrap}.swagger-ui .flex-nowrap-m{flex-wrap:nowrap}.swagger-ui .flex-wrap-reverse-m{flex-wrap:wrap-reverse}.swagger-ui .flex-column-reverse-m{flex-direction:column-reverse}.swagger-ui .flex-row-reverse-m{flex-direction:row-reverse}.swagger-ui .items-start-m{align-items:flex-start}.swagger-ui .items-end-m{align-items:flex-end}.swagger-ui .items-center-m{align-items:center}.swagger-ui .items-baseline-m{align-items:baseline}.swagger-ui .items-stretch-m{align-items:stretch}.swagger-ui .self-start-m{align-self:flex-start}.swagger-ui .self-end-m{align-self:flex-end}.swagger-ui .self-center-m{align-self:center}.swagger-ui .self-baseline-m{align-self:baseline}.swagger-ui .self-stretch-m{align-self:stretch}.swagger-ui .justify-start-m{justify-content:flex-start}.swagger-ui .justify-end-m{justify-content:flex-end}.swagger-ui .justify-center-m{justify-content:center}.swagger-ui .justify-between-m{justify-content:space-between}.swagger-ui .justify-around-m{justify-content:space-around}.swagger-ui .content-start-m{align-content:flex-start}.swagger-ui .content-end-m{align-content:flex-end}.swagger-ui .content-center-m{align-content:center}.swagger-ui .content-between-m{align-content:space-between}.swagger-ui .content-around-m{align-content:space-around}.swagger-ui .content-stretch-m{align-content:stretch}.swagger-ui .order-0-m{order:0}.swagger-ui .order-1-m{order:1}.swagger-ui .order-2-m{order:2}.swagger-ui .order-3-m{order:3}.swagger-ui .order-4-m{order:4}.swagger-ui .order-5-m{order:5}.swagger-ui .order-6-m{order:6}.swagger-ui .order-7-m{order:7}.swagger-ui .order-8-m{order:8}.swagger-ui .order-last-m{order:99999}.swagger-ui .flex-grow-0-m{flex-grow:0}.swagger-ui .flex-grow-1-m{flex-grow:1}.swagger-ui .flex-shrink-0-m{flex-shrink:0}.swagger-ui .flex-shrink-1-m{flex-shrink:1}}@media screen and (min-width:60em){.swagger-ui .flex-l{display:flex}.swagger-ui .inline-flex-l{display:inline-flex}.swagger-ui .flex-auto-l{flex:1 1 auto;min-width:0;min-height:0}.swagger-ui .flex-none-l{flex:none}.swagger-ui .flex-column-l{flex-direction:column}.swagger-ui .flex-row-l{flex-direction:row}.swagger-ui .flex-wrap-l{flex-wrap:wrap}.swagger-ui .flex-nowrap-l{flex-wrap:nowrap}.swagger-ui .flex-wrap-reverse-l{flex-wrap:wrap-reverse}.swagger-ui .flex-column-reverse-l{flex-direction:column-reverse}.swagger-ui .flex-row-reverse-l{flex-direction:row-reverse}.swagger-ui .items-start-l{align-items:flex-start}.swagger-ui .items-end-l{align-items:flex-end}.swagger-ui .items-center-l{align-items:center}.swagger-ui .items-baseline-l{align-items:baseline}.swagger-ui .items-stretch-l{align-items:stretch}.swagger-ui .self-start-l{align-self:flex-start}.swagger-ui .self-end-l{align-self:flex-end}.swagger-ui .self-center-l{align-self:center}.swagger-ui .self-baseline-l{align-self:baseline}.swagger-ui .self-stretch-l{align-self:stretch}.swagger-ui .justify-start-l{justify-content:flex-start}.swagger-ui .justify-end-l{justify-content:flex-end}.swagger-ui .justify-center-l{justify-content:center}.swagger-ui .justify-between-l{justify-content:space-between}.swagger-ui .justify-around-l{justify-content:space-around}.swagger-ui .content-start-l{align-content:flex-start}.swagger-ui .content-end-l{align-content:flex-end}.swagger-ui .content-center-l{align-content:center}.swagger-ui .content-between-l{align-content:space-between}.swagger-ui .content-around-l{align-content:space-around}.swagger-ui .content-stretch-l{align-content:stretch}.swagger-ui .order-0-l{order:0}.swagger-ui .order-1-l{order:1}.swagger-ui .order-2-l{order:2}.swagger-ui .order-3-l{order:3}.swagger-ui .order-4-l{order:4}.swagger-ui .order-5-l{order:5}.swagger-ui .order-6-l{order:6}.swagger-ui .order-7-l{order:7}.swagger-ui .order-8-l{order:8}.swagger-ui .order-last-l{order:99999}.swagger-ui .flex-grow-0-l{flex-grow:0}.swagger-ui .flex-grow-1-l{flex-grow:1}.swagger-ui .flex-shrink-0-l{flex-shrink:0}.swagger-ui .flex-shrink-1-l{flex-shrink:1}}.swagger-ui .dn{display:none}.swagger-ui .di{display:inline}.swagger-ui .db{display:block}.swagger-ui .dib{display:inline-block}.swagger-ui .dit{display:inline-table}.swagger-ui .dt{display:table}.swagger-ui .dtc{display:table-cell}.swagger-ui .dt-row{display:table-row}.swagger-ui .dt-row-group{display:table-row-group}.swagger-ui .dt-column{display:table-column}.swagger-ui .dt-column-group{display:table-column-group}.swagger-ui .dt--fixed{table-layout:fixed;width:100%}@media screen and (min-width:30em){.swagger-ui .dn-ns{display:none}.swagger-ui .di-ns{display:inline}.swagger-ui .db-ns{display:block}.swagger-ui .dib-ns{display:inline-block}.swagger-ui .dit-ns{display:inline-table}.swagger-ui .dt-ns{display:table}.swagger-ui .dtc-ns{display:table-cell}.swagger-ui .dt-row-ns{display:table-row}.swagger-ui .dt-row-group-ns{display:table-row-group}.swagger-ui .dt-column-ns{display:table-column}.swagger-ui .dt-column-group-ns{display:table-column-group}.swagger-ui .dt--fixed-ns{table-layout:fixed;width:100%}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .dn-m{display:none}.swagger-ui .di-m{display:inline}.swagger-ui .db-m{display:block}.swagger-ui .dib-m{display:inline-block}.swagger-ui .dit-m{display:inline-table}.swagger-ui .dt-m{display:table}.swagger-ui .dtc-m{display:table-cell}.swagger-ui .dt-row-m{display:table-row}.swagger-ui .dt-row-group-m{display:table-row-group}.swagger-ui .dt-column-m{display:table-column}.swagger-ui .dt-column-group-m{display:table-column-group}.swagger-ui .dt--fixed-m{table-layout:fixed;width:100%}}@media screen and (min-width:60em){.swagger-ui .dn-l{display:none}.swagger-ui .di-l{display:inline}.swagger-ui .db-l{display:block}.swagger-ui .dib-l{display:inline-block}.swagger-ui .dit-l{display:inline-table}.swagger-ui .dt-l{display:table}.swagger-ui .dtc-l{display:table-cell}.swagger-ui .dt-row-l{display:table-row}.swagger-ui .dt-row-group-l{display:table-row-group}.swagger-ui .dt-column-l{display:table-column}.swagger-ui .dt-column-group-l{display:table-column-group}.swagger-ui .dt--fixed-l{table-layout:fixed;width:100%}}.swagger-ui .fl{float:left;_display:inline}.swagger-ui .fr{float:right;_display:inline}.swagger-ui .fn{float:none}@media screen and (min-width:30em){.swagger-ui .fl-ns{float:left;_display:inline}.swagger-ui .fr-ns{float:right;_display:inline}.swagger-ui .fn-ns{float:none}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .fl-m{float:left;_display:inline}.swagger-ui .fr-m{float:right;_display:inline}.swagger-ui .fn-m{float:none}}@media screen and (min-width:60em){.swagger-ui .fl-l{float:left;_display:inline}.swagger-ui .fr-l{float:right;_display:inline}.swagger-ui .fn-l{float:none}}.swagger-ui .sans-serif{font-family:-apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica,helvetica neue,ubuntu,roboto,noto,segoe ui,arial,sans-serif}.swagger-ui .serif{font-family:georgia,serif}.swagger-ui .system-sans-serif{font-family:sans-serif}.swagger-ui .system-serif{font-family:serif}.swagger-ui .code,.swagger-ui code{font-family:Consolas,monaco,monospace}.swagger-ui .courier{font-family:Courier Next,courier,monospace}.swagger-ui .helvetica{font-family:helvetica neue,helvetica,sans-serif}.swagger-ui .avenir{font-family:avenir next,avenir,sans-serif}.swagger-ui .athelas{font-family:athelas,georgia,serif}.swagger-ui .georgia{font-family:georgia,serif}.swagger-ui .times{font-family:times,serif}.swagger-ui .bodoni{font-family:Bodoni MT,serif}.swagger-ui .calisto{font-family:Calisto MT,serif}.swagger-ui .garamond{font-family:garamond,serif}.swagger-ui .baskerville{font-family:baskerville,serif}.swagger-ui .i{font-style:italic}.swagger-ui .fs-normal{font-style:normal}@media screen and (min-width:30em){.swagger-ui .i-ns{font-style:italic}.swagger-ui .fs-normal-ns{font-style:normal}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .i-m{font-style:italic}.swagger-ui .fs-normal-m{font-style:normal}}@media screen and (min-width:60em){.swagger-ui .i-l{font-style:italic}.swagger-ui .fs-normal-l{font-style:normal}}.swagger-ui .normal{font-weight:400}.swagger-ui .b{font-weight:700}.swagger-ui .fw1{font-weight:100}.swagger-ui .fw2{font-weight:200}.swagger-ui .fw3{font-weight:300}.swagger-ui .fw4{font-weight:400}.swagger-ui .fw5{font-weight:500}.swagger-ui .fw6{font-weight:600}.swagger-ui .fw7{font-weight:700}.swagger-ui .fw8{font-weight:800}.swagger-ui .fw9{font-weight:900}@media screen and (min-width:30em){.swagger-ui .normal-ns{font-weight:400}.swagger-ui .b-ns{font-weight:700}.swagger-ui .fw1-ns{font-weight:100}.swagger-ui .fw2-ns{font-weight:200}.swagger-ui .fw3-ns{font-weight:300}.swagger-ui .fw4-ns{font-weight:400}.swagger-ui .fw5-ns{font-weight:500}.swagger-ui .fw6-ns{font-weight:600}.swagger-ui .fw7-ns{font-weight:700}.swagger-ui .fw8-ns{font-weight:800}.swagger-ui .fw9-ns{font-weight:900}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .normal-m{font-weight:400}.swagger-ui .b-m{font-weight:700}.swagger-ui .fw1-m{font-weight:100}.swagger-ui .fw2-m{font-weight:200}.swagger-ui .fw3-m{font-weight:300}.swagger-ui .fw4-m{font-weight:400}.swagger-ui .fw5-m{font-weight:500}.swagger-ui .fw6-m{font-weight:600}.swagger-ui .fw7-m{font-weight:700}.swagger-ui .fw8-m{font-weight:800}.swagger-ui .fw9-m{font-weight:900}}@media screen and (min-width:60em){.swagger-ui .normal-l{font-weight:400}.swagger-ui .b-l{font-weight:700}.swagger-ui .fw1-l{font-weight:100}.swagger-ui .fw2-l{font-weight:200}.swagger-ui .fw3-l{font-weight:300}.swagger-ui .fw4-l{font-weight:400}.swagger-ui .fw5-l{font-weight:500}.swagger-ui .fw6-l{font-weight:600}.swagger-ui .fw7-l{font-weight:700}.swagger-ui .fw8-l{font-weight:800}.swagger-ui .fw9-l{font-weight:900}}.swagger-ui .input-reset{-webkit-appearance:none;-moz-appearance:none}.swagger-ui .button-reset::-moz-focus-inner,.swagger-ui .input-reset::-moz-focus-inner{border:0;padding:0}.swagger-ui .h1{height:1rem}.swagger-ui .h2{height:2rem}.swagger-ui .h3{height:4rem}.swagger-ui .h4{height:8rem}.swagger-ui .h5{height:16rem}.swagger-ui .h-25{height:25%}.swagger-ui .h-50{height:50%}.swagger-ui .h-75{height:75%}.swagger-ui .h-100{height:100%}.swagger-ui .min-h-100{min-height:100%}.swagger-ui .vh-25{height:25vh}.swagger-ui .vh-50{height:50vh}.swagger-ui .vh-75{height:75vh}.swagger-ui .vh-100{height:100vh}.swagger-ui .min-vh-100{min-height:100vh}.swagger-ui .h-auto{height:auto}.swagger-ui .h-inherit{height:inherit}@media screen and (min-width:30em){.swagger-ui .h1-ns{height:1rem}.swagger-ui .h2-ns{height:2rem}.swagger-ui .h3-ns{height:4rem}.swagger-ui .h4-ns{height:8rem}.swagger-ui .h5-ns{height:16rem}.swagger-ui .h-25-ns{height:25%}.swagger-ui .h-50-ns{height:50%}.swagger-ui .h-75-ns{height:75%}.swagger-ui .h-100-ns{height:100%}.swagger-ui .min-h-100-ns{min-height:100%}.swagger-ui .vh-25-ns{height:25vh}.swagger-ui .vh-50-ns{height:50vh}.swagger-ui .vh-75-ns{height:75vh}.swagger-ui .vh-100-ns{height:100vh}.swagger-ui .min-vh-100-ns{min-height:100vh}.swagger-ui .h-auto-ns{height:auto}.swagger-ui .h-inherit-ns{height:inherit}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .h1-m{height:1rem}.swagger-ui .h2-m{height:2rem}.swagger-ui .h3-m{height:4rem}.swagger-ui .h4-m{height:8rem}.swagger-ui .h5-m{height:16rem}.swagger-ui .h-25-m{height:25%}.swagger-ui .h-50-m{height:50%}.swagger-ui .h-75-m{height:75%}.swagger-ui .h-100-m{height:100%}.swagger-ui .min-h-100-m{min-height:100%}.swagger-ui .vh-25-m{height:25vh}.swagger-ui .vh-50-m{height:50vh}.swagger-ui .vh-75-m{height:75vh}.swagger-ui .vh-100-m{height:100vh}.swagger-ui .min-vh-100-m{min-height:100vh}.swagger-ui .h-auto-m{height:auto}.swagger-ui .h-inherit-m{height:inherit}}@media screen and (min-width:60em){.swagger-ui .h1-l{height:1rem}.swagger-ui .h2-l{height:2rem}.swagger-ui .h3-l{height:4rem}.swagger-ui .h4-l{height:8rem}.swagger-ui .h5-l{height:16rem}.swagger-ui .h-25-l{height:25%}.swagger-ui .h-50-l{height:50%}.swagger-ui .h-75-l{height:75%}.swagger-ui .h-100-l{height:100%}.swagger-ui .min-h-100-l{min-height:100%}.swagger-ui .vh-25-l{height:25vh}.swagger-ui .vh-50-l{height:50vh}.swagger-ui .vh-75-l{height:75vh}.swagger-ui .vh-100-l{height:100vh}.swagger-ui .min-vh-100-l{min-height:100vh}.swagger-ui .h-auto-l{height:auto}.swagger-ui .h-inherit-l{height:inherit}}.swagger-ui .tracked{letter-spacing:.1em}.swagger-ui .tracked-tight{letter-spacing:-.05em}.swagger-ui .tracked-mega{letter-spacing:.25em}@media screen and (min-width:30em){.swagger-ui .tracked-ns{letter-spacing:.1em}.swagger-ui .tracked-tight-ns{letter-spacing:-.05em}.swagger-ui .tracked-mega-ns{letter-spacing:.25em}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .tracked-m{letter-spacing:.1em}.swagger-ui .tracked-tight-m{letter-spacing:-.05em}.swagger-ui .tracked-mega-m{letter-spacing:.25em}}@media screen and (min-width:60em){.swagger-ui .tracked-l{letter-spacing:.1em}.swagger-ui .tracked-tight-l{letter-spacing:-.05em}.swagger-ui .tracked-mega-l{letter-spacing:.25em}}.swagger-ui .lh-solid{line-height:1}.swagger-ui .lh-title{line-height:1.25}.swagger-ui .lh-copy{line-height:1.5}@media screen and (min-width:30em){.swagger-ui .lh-solid-ns{line-height:1}.swagger-ui .lh-title-ns{line-height:1.25}.swagger-ui .lh-copy-ns{line-height:1.5}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .lh-solid-m{line-height:1}.swagger-ui .lh-title-m{line-height:1.25}.swagger-ui .lh-copy-m{line-height:1.5}}@media screen and (min-width:60em){.swagger-ui .lh-solid-l{line-height:1}.swagger-ui .lh-title-l{line-height:1.25}.swagger-ui .lh-copy-l{line-height:1.5}}.swagger-ui .link{text-decoration:none}.swagger-ui .link,.swagger-ui .link:link,.swagger-ui .link:visited{transition:color .15s ease-in}.swagger-ui .link:hover{transition:color .15s ease-in}.swagger-ui .link:active{transition:color .15s ease-in}.swagger-ui .link:focus{transition:color .15s ease-in;outline:1px dotted currentColor}.swagger-ui .list{list-style-type:none}.swagger-ui .mw-100{max-width:100%}.swagger-ui .mw1{max-width:1rem}.swagger-ui .mw2{max-width:2rem}.swagger-ui .mw3{max-width:4rem}.swagger-ui .mw4{max-width:8rem}.swagger-ui .mw5{max-width:16rem}.swagger-ui .mw6{max-width:32rem}.swagger-ui .mw7{max-width:48rem}.swagger-ui .mw8{max-width:64rem}.swagger-ui .mw9{max-width:96rem}.swagger-ui .mw-none{max-width:none}@media screen and (min-width:30em){.swagger-ui .mw-100-ns{max-width:100%}.swagger-ui .mw1-ns{max-width:1rem}.swagger-ui .mw2-ns{max-width:2rem}.swagger-ui .mw3-ns{max-width:4rem}.swagger-ui .mw4-ns{max-width:8rem}.swagger-ui .mw5-ns{max-width:16rem}.swagger-ui .mw6-ns{max-width:32rem}.swagger-ui .mw7-ns{max-width:48rem}.swagger-ui .mw8-ns{max-width:64rem}.swagger-ui .mw9-ns{max-width:96rem}.swagger-ui .mw-none-ns{max-width:none}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .mw-100-m{max-width:100%}.swagger-ui .mw1-m{max-width:1rem}.swagger-ui .mw2-m{max-width:2rem}.swagger-ui .mw3-m{max-width:4rem}.swagger-ui .mw4-m{max-width:8rem}.swagger-ui .mw5-m{max-width:16rem}.swagger-ui .mw6-m{max-width:32rem}.swagger-ui .mw7-m{max-width:48rem}.swagger-ui .mw8-m{max-width:64rem}.swagger-ui .mw9-m{max-width:96rem}.swagger-ui .mw-none-m{max-width:none}}@media screen and (min-width:60em){.swagger-ui .mw-100-l{max-width:100%}.swagger-ui .mw1-l{max-width:1rem}.swagger-ui .mw2-l{max-width:2rem}.swagger-ui .mw3-l{max-width:4rem}.swagger-ui .mw4-l{max-width:8rem}.swagger-ui .mw5-l{max-width:16rem}.swagger-ui .mw6-l{max-width:32rem}.swagger-ui .mw7-l{max-width:48rem}.swagger-ui .mw8-l{max-width:64rem}.swagger-ui .mw9-l{max-width:96rem}.swagger-ui .mw-none-l{max-width:none}}.swagger-ui .w1{width:1rem}.swagger-ui .w2{width:2rem}.swagger-ui .w3{width:4rem}.swagger-ui .w4{width:8rem}.swagger-ui .w5{width:16rem}.swagger-ui .w-10{width:10%}.swagger-ui .w-20{width:20%}.swagger-ui .w-25{width:25%}.swagger-ui .w-30{width:30%}.swagger-ui .w-33{width:33%}.swagger-ui .w-34{width:34%}.swagger-ui .w-40{width:40%}.swagger-ui .w-50{width:50%}.swagger-ui .w-60{width:60%}.swagger-ui .w-70{width:70%}.swagger-ui .w-75{width:75%}.swagger-ui .w-80{width:80%}.swagger-ui .w-90{width:90%}.swagger-ui .w-100{width:100%}.swagger-ui .w-third{width:33.33333%}.swagger-ui .w-two-thirds{width:66.66667%}.swagger-ui .w-auto{width:auto}@media screen and (min-width:30em){.swagger-ui .w1-ns{width:1rem}.swagger-ui .w2-ns{width:2rem}.swagger-ui .w3-ns{width:4rem}.swagger-ui .w4-ns{width:8rem}.swagger-ui .w5-ns{width:16rem}.swagger-ui .w-10-ns{width:10%}.swagger-ui .w-20-ns{width:20%}.swagger-ui .w-25-ns{width:25%}.swagger-ui .w-30-ns{width:30%}.swagger-ui .w-33-ns{width:33%}.swagger-ui .w-34-ns{width:34%}.swagger-ui .w-40-ns{width:40%}.swagger-ui .w-50-ns{width:50%}.swagger-ui .w-60-ns{width:60%}.swagger-ui .w-70-ns{width:70%}.swagger-ui .w-75-ns{width:75%}.swagger-ui .w-80-ns{width:80%}.swagger-ui .w-90-ns{width:90%}.swagger-ui .w-100-ns{width:100%}.swagger-ui .w-third-ns{width:33.33333%}.swagger-ui .w-two-thirds-ns{width:66.66667%}.swagger-ui .w-auto-ns{width:auto}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .w1-m{width:1rem}.swagger-ui .w2-m{width:2rem}.swagger-ui .w3-m{width:4rem}.swagger-ui .w4-m{width:8rem}.swagger-ui .w5-m{width:16rem}.swagger-ui .w-10-m{width:10%}.swagger-ui .w-20-m{width:20%}.swagger-ui .w-25-m{width:25%}.swagger-ui .w-30-m{width:30%}.swagger-ui .w-33-m{width:33%}.swagger-ui .w-34-m{width:34%}.swagger-ui .w-40-m{width:40%}.swagger-ui .w-50-m{width:50%}.swagger-ui .w-60-m{width:60%}.swagger-ui .w-70-m{width:70%}.swagger-ui .w-75-m{width:75%}.swagger-ui .w-80-m{width:80%}.swagger-ui .w-90-m{width:90%}.swagger-ui .w-100-m{width:100%}.swagger-ui .w-third-m{width:33.33333%}.swagger-ui .w-two-thirds-m{width:66.66667%}.swagger-ui .w-auto-m{width:auto}}@media screen and (min-width:60em){.swagger-ui .w1-l{width:1rem}.swagger-ui .w2-l{width:2rem}.swagger-ui .w3-l{width:4rem}.swagger-ui .w4-l{width:8rem}.swagger-ui .w5-l{width:16rem}.swagger-ui .w-10-l{width:10%}.swagger-ui .w-20-l{width:20%}.swagger-ui .w-25-l{width:25%}.swagger-ui .w-30-l{width:30%}.swagger-ui .w-33-l{width:33%}.swagger-ui .w-34-l{width:34%}.swagger-ui .w-40-l{width:40%}.swagger-ui .w-50-l{width:50%}.swagger-ui .w-60-l{width:60%}.swagger-ui .w-70-l{width:70%}.swagger-ui .w-75-l{width:75%}.swagger-ui .w-80-l{width:80%}.swagger-ui .w-90-l{width:90%}.swagger-ui .w-100-l{width:100%}.swagger-ui .w-third-l{width:33.33333%}.swagger-ui .w-two-thirds-l{width:66.66667%}.swagger-ui .w-auto-l{width:auto}}.swagger-ui .overflow-visible{overflow:visible}.swagger-ui .overflow-hidden{overflow:hidden}.swagger-ui .overflow-scroll{overflow:scroll}.swagger-ui .overflow-auto{overflow:auto}.swagger-ui .overflow-x-visible{overflow-x:visible}.swagger-ui .overflow-x-hidden{overflow-x:hidden}.swagger-ui .overflow-x-scroll{overflow-x:scroll}.swagger-ui .overflow-x-auto{overflow-x:auto}.swagger-ui .overflow-y-visible{overflow-y:visible}.swagger-ui .overflow-y-hidden{overflow-y:hidden}.swagger-ui .overflow-y-scroll{overflow-y:scroll}.swagger-ui .overflow-y-auto{overflow-y:auto}@media screen and (min-width:30em){.swagger-ui .overflow-visible-ns{overflow:visible}.swagger-ui .overflow-hidden-ns{overflow:hidden}.swagger-ui .overflow-scroll-ns{overflow:scroll}.swagger-ui .overflow-auto-ns{overflow:auto}.swagger-ui .overflow-x-visible-ns{overflow-x:visible}.swagger-ui .overflow-x-hidden-ns{overflow-x:hidden}.swagger-ui .overflow-x-scroll-ns{overflow-x:scroll}.swagger-ui .overflow-x-auto-ns{overflow-x:auto}.swagger-ui .overflow-y-visible-ns{overflow-y:visible}.swagger-ui .overflow-y-hidden-ns{overflow-y:hidden}.swagger-ui .overflow-y-scroll-ns{overflow-y:scroll}.swagger-ui .overflow-y-auto-ns{overflow-y:auto}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .overflow-visible-m{overflow:visible}.swagger-ui .overflow-hidden-m{overflow:hidden}.swagger-ui .overflow-scroll-m{overflow:scroll}.swagger-ui .overflow-auto-m{overflow:auto}.swagger-ui .overflow-x-visible-m{overflow-x:visible}.swagger-ui .overflow-x-hidden-m{overflow-x:hidden}.swagger-ui .overflow-x-scroll-m{overflow-x:scroll}.swagger-ui .overflow-x-auto-m{overflow-x:auto}.swagger-ui .overflow-y-visible-m{overflow-y:visible}.swagger-ui .overflow-y-hidden-m{overflow-y:hidden}.swagger-ui .overflow-y-scroll-m{overflow-y:scroll}.swagger-ui .overflow-y-auto-m{overflow-y:auto}}@media screen and (min-width:60em){.swagger-ui .overflow-visible-l{overflow:visible}.swagger-ui .overflow-hidden-l{overflow:hidden}.swagger-ui .overflow-scroll-l{overflow:scroll}.swagger-ui .overflow-auto-l{overflow:auto}.swagger-ui .overflow-x-visible-l{overflow-x:visible}.swagger-ui .overflow-x-hidden-l{overflow-x:hidden}.swagger-ui .overflow-x-scroll-l{overflow-x:scroll}.swagger-ui .overflow-x-auto-l{overflow-x:auto}.swagger-ui .overflow-y-visible-l{overflow-y:visible}.swagger-ui .overflow-y-hidden-l{overflow-y:hidden}.swagger-ui .overflow-y-scroll-l{overflow-y:scroll}.swagger-ui .overflow-y-auto-l{overflow-y:auto}}.swagger-ui .static{position:static}.swagger-ui .relative{position:relative}.swagger-ui .absolute{position:absolute}.swagger-ui .fixed{position:fixed}@media screen and (min-width:30em){.swagger-ui .static-ns{position:static}.swagger-ui .relative-ns{position:relative}.swagger-ui .absolute-ns{position:absolute}.swagger-ui .fixed-ns{position:fixed}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .static-m{position:static}.swagger-ui .relative-m{position:relative}.swagger-ui .absolute-m{position:absolute}.swagger-ui .fixed-m{position:fixed}}@media screen and (min-width:60em){.swagger-ui .static-l{position:static}.swagger-ui .relative-l{position:relative}.swagger-ui .absolute-l{position:absolute}.swagger-ui .fixed-l{position:fixed}}.swagger-ui .o-100{opacity:1}.swagger-ui .o-90{opacity:.9}.swagger-ui .o-80{opacity:.8}.swagger-ui .o-70{opacity:.7}.swagger-ui .o-60{opacity:.6}.swagger-ui .o-50{opacity:.5}.swagger-ui .o-40{opacity:.4}.swagger-ui .o-30{opacity:.3}.swagger-ui .o-20{opacity:.2}.swagger-ui .o-10{opacity:.1}.swagger-ui .o-05{opacity:.05}.swagger-ui .o-025{opacity:.025}.swagger-ui .o-0{opacity:0}.swagger-ui .rotate-45{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swagger-ui .rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.swagger-ui .rotate-135{-webkit-transform:rotate(135deg);transform:rotate(135deg)}.swagger-ui .rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.swagger-ui .rotate-225{-webkit-transform:rotate(225deg);transform:rotate(225deg)}.swagger-ui .rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.swagger-ui .rotate-315{-webkit-transform:rotate(315deg);transform:rotate(315deg)}@media screen and (min-width:30em){.swagger-ui .rotate-45-ns{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swagger-ui .rotate-90-ns{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.swagger-ui .rotate-135-ns{-webkit-transform:rotate(135deg);transform:rotate(135deg)}.swagger-ui .rotate-180-ns{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.swagger-ui .rotate-225-ns{-webkit-transform:rotate(225deg);transform:rotate(225deg)}.swagger-ui .rotate-270-ns{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.swagger-ui .rotate-315-ns{-webkit-transform:rotate(315deg);transform:rotate(315deg)}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .rotate-45-m{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swagger-ui .rotate-90-m{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.swagger-ui .rotate-135-m{-webkit-transform:rotate(135deg);transform:rotate(135deg)}.swagger-ui .rotate-180-m{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.swagger-ui .rotate-225-m{-webkit-transform:rotate(225deg);transform:rotate(225deg)}.swagger-ui .rotate-270-m{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.swagger-ui .rotate-315-m{-webkit-transform:rotate(315deg);transform:rotate(315deg)}}@media screen and (min-width:60em){.swagger-ui .rotate-45-l{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swagger-ui .rotate-90-l{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.swagger-ui .rotate-135-l{-webkit-transform:rotate(135deg);transform:rotate(135deg)}.swagger-ui .rotate-180-l{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.swagger-ui .rotate-225-l{-webkit-transform:rotate(225deg);transform:rotate(225deg)}.swagger-ui .rotate-270-l{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.swagger-ui .rotate-315-l{-webkit-transform:rotate(315deg);transform:rotate(315deg)}}.swagger-ui .black-90{color:rgba(0,0,0,.9)}.swagger-ui .black-80{color:rgba(0,0,0,.8)}.swagger-ui .black-70{color:rgba(0,0,0,.7)}.swagger-ui .black-60{color:rgba(0,0,0,.6)}.swagger-ui .black-50{color:rgba(0,0,0,.5)}.swagger-ui .black-40{color:rgba(0,0,0,.4)}.swagger-ui .black-30{color:rgba(0,0,0,.3)}.swagger-ui .black-20{color:rgba(0,0,0,.2)}.swagger-ui .black-10{color:rgba(0,0,0,.1)}.swagger-ui .black-05{color:rgba(0,0,0,.05)}.swagger-ui .white-90{color:hsla(0,0%,100%,.9)}.swagger-ui .white-80{color:hsla(0,0%,100%,.8)}.swagger-ui .white-70{color:hsla(0,0%,100%,.7)}.swagger-ui .white-60{color:hsla(0,0%,100%,.6)}.swagger-ui .white-50{color:hsla(0,0%,100%,.5)}.swagger-ui .white-40{color:hsla(0,0%,100%,.4)}.swagger-ui .white-30{color:hsla(0,0%,100%,.3)}.swagger-ui .white-20{color:hsla(0,0%,100%,.2)}.swagger-ui .white-10{color:hsla(0,0%,100%,.1)}.swagger-ui .black{color:#000}.swagger-ui .near-black{color:#111}.swagger-ui .dark-gray{color:#333}.swagger-ui .mid-gray{color:#555}.swagger-ui .gray{color:#777}.swagger-ui .silver{color:#999}.swagger-ui .light-silver{color:#aaa}.swagger-ui .moon-gray{color:#ccc}.swagger-ui .light-gray{color:#eee}.swagger-ui .near-white{color:#f4f4f4}.swagger-ui .white{color:#fff}.swagger-ui .dark-red{color:#e7040f}.swagger-ui .red{color:#ff4136}.swagger-ui .light-red{color:#ff725c}.swagger-ui .orange{color:#ff6300}.swagger-ui .gold{color:#ffb700}.swagger-ui .yellow{color:gold}.swagger-ui .light-yellow{color:#fbf1a9}.swagger-ui .purple{color:#5e2ca5}.swagger-ui .light-purple{color:#a463f2}.swagger-ui .dark-pink{color:#d5008f}.swagger-ui .hot-pink{color:#ff41b4}.swagger-ui .pink{color:#ff80cc}.swagger-ui .light-pink{color:#ffa3d7}.swagger-ui .dark-green{color:#137752}.swagger-ui .green{color:#19a974}.swagger-ui .light-green{color:#9eebcf}.swagger-ui .navy{color:#001b44}.swagger-ui .dark-blue{color:#00449e}.swagger-ui .blue{color:#357edd}.swagger-ui .light-blue{color:#96ccff}.swagger-ui .lightest-blue{color:#cdecff}.swagger-ui .washed-blue{color:#f6fffe}.swagger-ui .washed-green{color:#e8fdf5}.swagger-ui .washed-yellow{color:#fffceb}.swagger-ui .washed-red{color:#ffdfdf}.swagger-ui .color-inherit{color:inherit}.swagger-ui .bg-black-90{background-color:rgba(0,0,0,.9)}.swagger-ui .bg-black-80{background-color:rgba(0,0,0,.8)}.swagger-ui .bg-black-70{background-color:rgba(0,0,0,.7)}.swagger-ui .bg-black-60{background-color:rgba(0,0,0,.6)}.swagger-ui .bg-black-50{background-color:rgba(0,0,0,.5)}.swagger-ui .bg-black-40{background-color:rgba(0,0,0,.4)}.swagger-ui .bg-black-30{background-color:rgba(0,0,0,.3)}.swagger-ui .bg-black-20{background-color:rgba(0,0,0,.2)}.swagger-ui .bg-black-10{background-color:rgba(0,0,0,.1)}.swagger-ui .bg-black-05{background-color:rgba(0,0,0,.05)}.swagger-ui .bg-white-90{background-color:hsla(0,0%,100%,.9)}.swagger-ui .bg-white-80{background-color:hsla(0,0%,100%,.8)}.swagger-ui .bg-white-70{background-color:hsla(0,0%,100%,.7)}.swagger-ui .bg-white-60{background-color:hsla(0,0%,100%,.6)}.swagger-ui .bg-white-50{background-color:hsla(0,0%,100%,.5)}.swagger-ui .bg-white-40{background-color:hsla(0,0%,100%,.4)}.swagger-ui .bg-white-30{background-color:hsla(0,0%,100%,.3)}.swagger-ui .bg-white-20{background-color:hsla(0,0%,100%,.2)}.swagger-ui .bg-white-10{background-color:hsla(0,0%,100%,.1)}.swagger-ui .bg-black{background-color:#000}.swagger-ui .bg-near-black{background-color:#111}.swagger-ui .bg-dark-gray{background-color:#333}.swagger-ui .bg-mid-gray{background-color:#555}.swagger-ui .bg-gray{background-color:#777}.swagger-ui .bg-silver{background-color:#999}.swagger-ui .bg-light-silver{background-color:#aaa}.swagger-ui .bg-moon-gray{background-color:#ccc}.swagger-ui .bg-light-gray{background-color:#eee}.swagger-ui .bg-near-white{background-color:#f4f4f4}.swagger-ui .bg-white{background-color:#fff}.swagger-ui .bg-transparent{background-color:transparent}.swagger-ui .bg-dark-red{background-color:#e7040f}.swagger-ui .bg-red{background-color:#ff4136}.swagger-ui .bg-light-red{background-color:#ff725c}.swagger-ui .bg-orange{background-color:#ff6300}.swagger-ui .bg-gold{background-color:#ffb700}.swagger-ui .bg-yellow{background-color:gold}.swagger-ui .bg-light-yellow{background-color:#fbf1a9}.swagger-ui .bg-purple{background-color:#5e2ca5}.swagger-ui .bg-light-purple{background-color:#a463f2}.swagger-ui .bg-dark-pink{background-color:#d5008f}.swagger-ui .bg-hot-pink{background-color:#ff41b4}.swagger-ui .bg-pink{background-color:#ff80cc}.swagger-ui .bg-light-pink{background-color:#ffa3d7}.swagger-ui .bg-dark-green{background-color:#137752}.swagger-ui .bg-green{background-color:#19a974}.swagger-ui .bg-light-green{background-color:#9eebcf}.swagger-ui .bg-navy{background-color:#001b44}.swagger-ui .bg-dark-blue{background-color:#00449e}.swagger-ui .bg-blue{background-color:#357edd}.swagger-ui .bg-light-blue{background-color:#96ccff}.swagger-ui .bg-lightest-blue{background-color:#cdecff}.swagger-ui .bg-washed-blue{background-color:#f6fffe}.swagger-ui .bg-washed-green{background-color:#e8fdf5}.swagger-ui .bg-washed-yellow{background-color:#fffceb}.swagger-ui .bg-washed-red{background-color:#ffdfdf}.swagger-ui .bg-inherit{background-color:inherit}.swagger-ui .hover-black:focus,.swagger-ui .hover-black:hover{color:#000}.swagger-ui .hover-near-black:focus,.swagger-ui .hover-near-black:hover{color:#111}.swagger-ui .hover-dark-gray:focus,.swagger-ui .hover-dark-gray:hover{color:#333}.swagger-ui .hover-mid-gray:focus,.swagger-ui .hover-mid-gray:hover{color:#555}.swagger-ui .hover-gray:focus,.swagger-ui .hover-gray:hover{color:#777}.swagger-ui .hover-silver:focus,.swagger-ui .hover-silver:hover{color:#999}.swagger-ui .hover-light-silver:focus,.swagger-ui .hover-light-silver:hover{color:#aaa}.swagger-ui .hover-moon-gray:focus,.swagger-ui .hover-moon-gray:hover{color:#ccc}.swagger-ui .hover-light-gray:focus,.swagger-ui .hover-light-gray:hover{color:#eee}.swagger-ui .hover-near-white:focus,.swagger-ui .hover-near-white:hover{color:#f4f4f4}.swagger-ui .hover-white:focus,.swagger-ui .hover-white:hover{color:#fff}.swagger-ui .hover-black-90:focus,.swagger-ui .hover-black-90:hover{color:rgba(0,0,0,.9)}.swagger-ui .hover-black-80:focus,.swagger-ui .hover-black-80:hover{color:rgba(0,0,0,.8)}.swagger-ui .hover-black-70:focus,.swagger-ui .hover-black-70:hover{color:rgba(0,0,0,.7)}.swagger-ui .hover-black-60:focus,.swagger-ui .hover-black-60:hover{color:rgba(0,0,0,.6)}.swagger-ui .hover-black-50:focus,.swagger-ui .hover-black-50:hover{color:rgba(0,0,0,.5)}.swagger-ui .hover-black-40:focus,.swagger-ui .hover-black-40:hover{color:rgba(0,0,0,.4)}.swagger-ui .hover-black-30:focus,.swagger-ui .hover-black-30:hover{color:rgba(0,0,0,.3)}.swagger-ui .hover-black-20:focus,.swagger-ui .hover-black-20:hover{color:rgba(0,0,0,.2)}.swagger-ui .hover-black-10:focus,.swagger-ui .hover-black-10:hover{color:rgba(0,0,0,.1)}.swagger-ui .hover-white-90:focus,.swagger-ui .hover-white-90:hover{color:hsla(0,0%,100%,.9)}.swagger-ui .hover-white-80:focus,.swagger-ui .hover-white-80:hover{color:hsla(0,0%,100%,.8)}.swagger-ui .hover-white-70:focus,.swagger-ui .hover-white-70:hover{color:hsla(0,0%,100%,.7)}.swagger-ui .hover-white-60:focus,.swagger-ui .hover-white-60:hover{color:hsla(0,0%,100%,.6)}.swagger-ui .hover-white-50:focus,.swagger-ui .hover-white-50:hover{color:hsla(0,0%,100%,.5)}.swagger-ui .hover-white-40:focus,.swagger-ui .hover-white-40:hover{color:hsla(0,0%,100%,.4)}.swagger-ui .hover-white-30:focus,.swagger-ui .hover-white-30:hover{color:hsla(0,0%,100%,.3)}.swagger-ui .hover-white-20:focus,.swagger-ui .hover-white-20:hover{color:hsla(0,0%,100%,.2)}.swagger-ui .hover-white-10:focus,.swagger-ui .hover-white-10:hover{color:hsla(0,0%,100%,.1)}.swagger-ui .hover-inherit:focus,.swagger-ui .hover-inherit:hover{color:inherit}.swagger-ui .hover-bg-black:focus,.swagger-ui .hover-bg-black:hover{background-color:#000}.swagger-ui .hover-bg-near-black:focus,.swagger-ui .hover-bg-near-black:hover{background-color:#111}.swagger-ui .hover-bg-dark-gray:focus,.swagger-ui .hover-bg-dark-gray:hover{background-color:#333}.swagger-ui .hover-bg-mid-gray:focus,.swagger-ui .hover-bg-mid-gray:hover{background-color:#555}.swagger-ui .hover-bg-gray:focus,.swagger-ui .hover-bg-gray:hover{background-color:#777}.swagger-ui .hover-bg-silver:focus,.swagger-ui .hover-bg-silver:hover{background-color:#999}.swagger-ui .hover-bg-light-silver:focus,.swagger-ui .hover-bg-light-silver:hover{background-color:#aaa}.swagger-ui .hover-bg-moon-gray:focus,.swagger-ui .hover-bg-moon-gray:hover{background-color:#ccc}.swagger-ui .hover-bg-light-gray:focus,.swagger-ui .hover-bg-light-gray:hover{background-color:#eee}.swagger-ui .hover-bg-near-white:focus,.swagger-ui .hover-bg-near-white:hover{background-color:#f4f4f4}.swagger-ui .hover-bg-white:focus,.swagger-ui .hover-bg-white:hover{background-color:#fff}.swagger-ui .hover-bg-transparent:focus,.swagger-ui .hover-bg-transparent:hover{background-color:transparent}.swagger-ui .hover-bg-black-90:focus,.swagger-ui .hover-bg-black-90:hover{background-color:rgba(0,0,0,.9)}.swagger-ui .hover-bg-black-80:focus,.swagger-ui .hover-bg-black-80:hover{background-color:rgba(0,0,0,.8)}.swagger-ui .hover-bg-black-70:focus,.swagger-ui .hover-bg-black-70:hover{background-color:rgba(0,0,0,.7)}.swagger-ui .hover-bg-black-60:focus,.swagger-ui .hover-bg-black-60:hover{background-color:rgba(0,0,0,.6)}.swagger-ui .hover-bg-black-50:focus,.swagger-ui .hover-bg-black-50:hover{background-color:rgba(0,0,0,.5)}.swagger-ui .hover-bg-black-40:focus,.swagger-ui .hover-bg-black-40:hover{background-color:rgba(0,0,0,.4)}.swagger-ui .hover-bg-black-30:focus,.swagger-ui .hover-bg-black-30:hover{background-color:rgba(0,0,0,.3)}.swagger-ui .hover-bg-black-20:focus,.swagger-ui .hover-bg-black-20:hover{background-color:rgba(0,0,0,.2)}.swagger-ui .hover-bg-black-10:focus,.swagger-ui .hover-bg-black-10:hover{background-color:rgba(0,0,0,.1)}.swagger-ui .hover-bg-white-90:focus,.swagger-ui .hover-bg-white-90:hover{background-color:hsla(0,0%,100%,.9)}.swagger-ui .hover-bg-white-80:focus,.swagger-ui .hover-bg-white-80:hover{background-color:hsla(0,0%,100%,.8)}.swagger-ui .hover-bg-white-70:focus,.swagger-ui .hover-bg-white-70:hover{background-color:hsla(0,0%,100%,.7)}.swagger-ui .hover-bg-white-60:focus,.swagger-ui .hover-bg-white-60:hover{background-color:hsla(0,0%,100%,.6)}.swagger-ui .hover-bg-white-50:focus,.swagger-ui .hover-bg-white-50:hover{background-color:hsla(0,0%,100%,.5)}.swagger-ui .hover-bg-white-40:focus,.swagger-ui .hover-bg-white-40:hover{background-color:hsla(0,0%,100%,.4)}.swagger-ui .hover-bg-white-30:focus,.swagger-ui .hover-bg-white-30:hover{background-color:hsla(0,0%,100%,.3)}.swagger-ui .hover-bg-white-20:focus,.swagger-ui .hover-bg-white-20:hover{background-color:hsla(0,0%,100%,.2)}.swagger-ui .hover-bg-white-10:focus,.swagger-ui .hover-bg-white-10:hover{background-color:hsla(0,0%,100%,.1)}.swagger-ui .hover-dark-red:focus,.swagger-ui .hover-dark-red:hover{color:#e7040f}.swagger-ui .hover-red:focus,.swagger-ui .hover-red:hover{color:#ff4136}.swagger-ui .hover-light-red:focus,.swagger-ui .hover-light-red:hover{color:#ff725c}.swagger-ui .hover-orange:focus,.swagger-ui .hover-orange:hover{color:#ff6300}.swagger-ui .hover-gold:focus,.swagger-ui .hover-gold:hover{color:#ffb700}.swagger-ui .hover-yellow:focus,.swagger-ui .hover-yellow:hover{color:gold}.swagger-ui .hover-light-yellow:focus,.swagger-ui .hover-light-yellow:hover{color:#fbf1a9}.swagger-ui .hover-purple:focus,.swagger-ui .hover-purple:hover{color:#5e2ca5}.swagger-ui .hover-light-purple:focus,.swagger-ui .hover-light-purple:hover{color:#a463f2}.swagger-ui .hover-dark-pink:focus,.swagger-ui .hover-dark-pink:hover{color:#d5008f}.swagger-ui .hover-hot-pink:focus,.swagger-ui .hover-hot-pink:hover{color:#ff41b4}.swagger-ui .hover-pink:focus,.swagger-ui .hover-pink:hover{color:#ff80cc}.swagger-ui .hover-light-pink:focus,.swagger-ui .hover-light-pink:hover{color:#ffa3d7}.swagger-ui .hover-dark-green:focus,.swagger-ui .hover-dark-green:hover{color:#137752}.swagger-ui .hover-green:focus,.swagger-ui .hover-green:hover{color:#19a974}.swagger-ui .hover-light-green:focus,.swagger-ui .hover-light-green:hover{color:#9eebcf}.swagger-ui .hover-navy:focus,.swagger-ui .hover-navy:hover{color:#001b44}.swagger-ui .hover-dark-blue:focus,.swagger-ui .hover-dark-blue:hover{color:#00449e}.swagger-ui .hover-blue:focus,.swagger-ui .hover-blue:hover{color:#357edd}.swagger-ui .hover-light-blue:focus,.swagger-ui .hover-light-blue:hover{color:#96ccff}.swagger-ui .hover-lightest-blue:focus,.swagger-ui .hover-lightest-blue:hover{color:#cdecff}.swagger-ui .hover-washed-blue:focus,.swagger-ui .hover-washed-blue:hover{color:#f6fffe}.swagger-ui .hover-washed-green:focus,.swagger-ui .hover-washed-green:hover{color:#e8fdf5}.swagger-ui .hover-washed-yellow:focus,.swagger-ui .hover-washed-yellow:hover{color:#fffceb}.swagger-ui .hover-washed-red:focus,.swagger-ui .hover-washed-red:hover{color:#ffdfdf}.swagger-ui .hover-bg-dark-red:focus,.swagger-ui .hover-bg-dark-red:hover{background-color:#e7040f}.swagger-ui .hover-bg-red:focus,.swagger-ui .hover-bg-red:hover{background-color:#ff4136}.swagger-ui .hover-bg-light-red:focus,.swagger-ui .hover-bg-light-red:hover{background-color:#ff725c}.swagger-ui .hover-bg-orange:focus,.swagger-ui .hover-bg-orange:hover{background-color:#ff6300}.swagger-ui .hover-bg-gold:focus,.swagger-ui .hover-bg-gold:hover{background-color:#ffb700}.swagger-ui .hover-bg-yellow:focus,.swagger-ui .hover-bg-yellow:hover{background-color:gold}.swagger-ui .hover-bg-light-yellow:focus,.swagger-ui .hover-bg-light-yellow:hover{background-color:#fbf1a9}.swagger-ui .hover-bg-purple:focus,.swagger-ui .hover-bg-purple:hover{background-color:#5e2ca5}.swagger-ui .hover-bg-light-purple:focus,.swagger-ui .hover-bg-light-purple:hover{background-color:#a463f2}.swagger-ui .hover-bg-dark-pink:focus,.swagger-ui .hover-bg-dark-pink:hover{background-color:#d5008f}.swagger-ui .hover-bg-hot-pink:focus,.swagger-ui .hover-bg-hot-pink:hover{background-color:#ff41b4}.swagger-ui .hover-bg-pink:focus,.swagger-ui .hover-bg-pink:hover{background-color:#ff80cc}.swagger-ui .hover-bg-light-pink:focus,.swagger-ui .hover-bg-light-pink:hover{background-color:#ffa3d7}.swagger-ui .hover-bg-dark-green:focus,.swagger-ui .hover-bg-dark-green:hover{background-color:#137752}.swagger-ui .hover-bg-green:focus,.swagger-ui .hover-bg-green:hover{background-color:#19a974}.swagger-ui .hover-bg-light-green:focus,.swagger-ui .hover-bg-light-green:hover{background-color:#9eebcf}.swagger-ui .hover-bg-navy:focus,.swagger-ui .hover-bg-navy:hover{background-color:#001b44}.swagger-ui .hover-bg-dark-blue:focus,.swagger-ui .hover-bg-dark-blue:hover{background-color:#00449e}.swagger-ui .hover-bg-blue:focus,.swagger-ui .hover-bg-blue:hover{background-color:#357edd}.swagger-ui .hover-bg-light-blue:focus,.swagger-ui .hover-bg-light-blue:hover{background-color:#96ccff}.swagger-ui .hover-bg-lightest-blue:focus,.swagger-ui .hover-bg-lightest-blue:hover{background-color:#cdecff}.swagger-ui .hover-bg-washed-blue:focus,.swagger-ui .hover-bg-washed-blue:hover{background-color:#f6fffe}.swagger-ui .hover-bg-washed-green:focus,.swagger-ui .hover-bg-washed-green:hover{background-color:#e8fdf5}.swagger-ui .hover-bg-washed-yellow:focus,.swagger-ui .hover-bg-washed-yellow:hover{background-color:#fffceb}.swagger-ui .hover-bg-washed-red:focus,.swagger-ui .hover-bg-washed-red:hover{background-color:#ffdfdf}.swagger-ui .hover-bg-inherit:focus,.swagger-ui .hover-bg-inherit:hover{background-color:inherit}.swagger-ui .pa0{padding:0}.swagger-ui .pa1{padding:.25rem}.swagger-ui .pa2{padding:.5rem}.swagger-ui .pa3{padding:1rem}.swagger-ui .pa4{padding:2rem}.swagger-ui .pa5{padding:4rem}.swagger-ui .pa6{padding:8rem}.swagger-ui .pa7{padding:16rem}.swagger-ui .pl0{padding-left:0}.swagger-ui .pl1{padding-left:.25rem}.swagger-ui .pl2{padding-left:.5rem}.swagger-ui .pl3{padding-left:1rem}.swagger-ui .pl4{padding-left:2rem}.swagger-ui .pl5{padding-left:4rem}.swagger-ui .pl6{padding-left:8rem}.swagger-ui .pl7{padding-left:16rem}.swagger-ui .pr0{padding-right:0}.swagger-ui .pr1{padding-right:.25rem}.swagger-ui .pr2{padding-right:.5rem}.swagger-ui .pr3{padding-right:1rem}.swagger-ui .pr4{padding-right:2rem}.swagger-ui .pr5{padding-right:4rem}.swagger-ui .pr6{padding-right:8rem}.swagger-ui .pr7{padding-right:16rem}.swagger-ui .pb0{padding-bottom:0}.swagger-ui .pb1{padding-bottom:.25rem}.swagger-ui .pb2{padding-bottom:.5rem}.swagger-ui .pb3{padding-bottom:1rem}.swagger-ui .pb4{padding-bottom:2rem}.swagger-ui .pb5{padding-bottom:4rem}.swagger-ui .pb6{padding-bottom:8rem}.swagger-ui .pb7{padding-bottom:16rem}.swagger-ui .pt0{padding-top:0}.swagger-ui .pt1{padding-top:.25rem}.swagger-ui .pt2{padding-top:.5rem}.swagger-ui .pt3{padding-top:1rem}.swagger-ui .pt4{padding-top:2rem}.swagger-ui .pt5{padding-top:4rem}.swagger-ui .pt6{padding-top:8rem}.swagger-ui .pt7{padding-top:16rem}.swagger-ui .pv0{padding-top:0;padding-bottom:0}.swagger-ui .pv1{padding-top:.25rem;padding-bottom:.25rem}.swagger-ui .pv2{padding-top:.5rem;padding-bottom:.5rem}.swagger-ui .pv3{padding-top:1rem;padding-bottom:1rem}.swagger-ui .pv4{padding-top:2rem;padding-bottom:2rem}.swagger-ui .pv5{padding-top:4rem;padding-bottom:4rem}.swagger-ui .pv6{padding-top:8rem;padding-bottom:8rem}.swagger-ui .pv7{padding-top:16rem;padding-bottom:16rem}.swagger-ui .ph0{padding-left:0;padding-right:0}.swagger-ui .ph1{padding-left:.25rem;padding-right:.25rem}.swagger-ui .ph2{padding-left:.5rem;padding-right:.5rem}.swagger-ui .ph3{padding-left:1rem;padding-right:1rem}.swagger-ui .ph4{padding-left:2rem;padding-right:2rem}.swagger-ui .ph5{padding-left:4rem;padding-right:4rem}.swagger-ui .ph6{padding-left:8rem;padding-right:8rem}.swagger-ui .ph7{padding-left:16rem;padding-right:16rem}.swagger-ui .ma0{margin:0}.swagger-ui .ma1{margin:.25rem}.swagger-ui .ma2{margin:.5rem}.swagger-ui .ma3{margin:1rem}.swagger-ui .ma4{margin:2rem}.swagger-ui .ma5{margin:4rem}.swagger-ui .ma6{margin:8rem}.swagger-ui .ma7{margin:16rem}.swagger-ui .ml0{margin-left:0}.swagger-ui .ml1{margin-left:.25rem}.swagger-ui .ml2{margin-left:.5rem}.swagger-ui .ml3{margin-left:1rem}.swagger-ui .ml4{margin-left:2rem}.swagger-ui .ml5{margin-left:4rem}.swagger-ui .ml6{margin-left:8rem}.swagger-ui .ml7{margin-left:16rem}.swagger-ui .mr0{margin-right:0}.swagger-ui .mr1{margin-right:.25rem}.swagger-ui .mr2{margin-right:.5rem}.swagger-ui .mr3{margin-right:1rem}.swagger-ui .mr4{margin-right:2rem}.swagger-ui .mr5{margin-right:4rem}.swagger-ui .mr6{margin-right:8rem}.swagger-ui .mr7{margin-right:16rem}.swagger-ui .mb0{margin-bottom:0}.swagger-ui .mb1{margin-bottom:.25rem}.swagger-ui .mb2{margin-bottom:.5rem}.swagger-ui .mb3{margin-bottom:1rem}.swagger-ui .mb4{margin-bottom:2rem}.swagger-ui .mb5{margin-bottom:4rem}.swagger-ui .mb6{margin-bottom:8rem}.swagger-ui .mb7{margin-bottom:16rem}.swagger-ui .mt0{margin-top:0}.swagger-ui .mt1{margin-top:.25rem}.swagger-ui .mt2{margin-top:.5rem}.swagger-ui .mt3{margin-top:1rem}.swagger-ui .mt4{margin-top:2rem}.swagger-ui .mt5{margin-top:4rem}.swagger-ui .mt6{margin-top:8rem}.swagger-ui .mt7{margin-top:16rem}.swagger-ui .mv0{margin-top:0;margin-bottom:0}.swagger-ui .mv1{margin-top:.25rem;margin-bottom:.25rem}.swagger-ui .mv2{margin-top:.5rem;margin-bottom:.5rem}.swagger-ui .mv3{margin-top:1rem;margin-bottom:1rem}.swagger-ui .mv4{margin-top:2rem;margin-bottom:2rem}.swagger-ui .mv5{margin-top:4rem;margin-bottom:4rem}.swagger-ui .mv6{margin-top:8rem;margin-bottom:8rem}.swagger-ui .mv7{margin-top:16rem;margin-bottom:16rem}.swagger-ui .mh0{margin-left:0;margin-right:0}.swagger-ui .mh1{margin-left:.25rem;margin-right:.25rem}.swagger-ui .mh2{margin-left:.5rem;margin-right:.5rem}.swagger-ui .mh3{margin-left:1rem;margin-right:1rem}.swagger-ui .mh4{margin-left:2rem;margin-right:2rem}.swagger-ui .mh5{margin-left:4rem;margin-right:4rem}.swagger-ui .mh6{margin-left:8rem;margin-right:8rem}.swagger-ui .mh7{margin-left:16rem;margin-right:16rem}@media screen and (min-width:30em){.swagger-ui .pa0-ns{padding:0}.swagger-ui .pa1-ns{padding:.25rem}.swagger-ui .pa2-ns{padding:.5rem}.swagger-ui .pa3-ns{padding:1rem}.swagger-ui .pa4-ns{padding:2rem}.swagger-ui .pa5-ns{padding:4rem}.swagger-ui .pa6-ns{padding:8rem}.swagger-ui .pa7-ns{padding:16rem}.swagger-ui .pl0-ns{padding-left:0}.swagger-ui .pl1-ns{padding-left:.25rem}.swagger-ui .pl2-ns{padding-left:.5rem}.swagger-ui .pl3-ns{padding-left:1rem}.swagger-ui .pl4-ns{padding-left:2rem}.swagger-ui .pl5-ns{padding-left:4rem}.swagger-ui .pl6-ns{padding-left:8rem}.swagger-ui .pl7-ns{padding-left:16rem}.swagger-ui .pr0-ns{padding-right:0}.swagger-ui .pr1-ns{padding-right:.25rem}.swagger-ui .pr2-ns{padding-right:.5rem}.swagger-ui .pr3-ns{padding-right:1rem}.swagger-ui .pr4-ns{padding-right:2rem}.swagger-ui .pr5-ns{padding-right:4rem}.swagger-ui .pr6-ns{padding-right:8rem}.swagger-ui .pr7-ns{padding-right:16rem}.swagger-ui .pb0-ns{padding-bottom:0}.swagger-ui .pb1-ns{padding-bottom:.25rem}.swagger-ui .pb2-ns{padding-bottom:.5rem}.swagger-ui .pb3-ns{padding-bottom:1rem}.swagger-ui .pb4-ns{padding-bottom:2rem}.swagger-ui .pb5-ns{padding-bottom:4rem}.swagger-ui .pb6-ns{padding-bottom:8rem}.swagger-ui .pb7-ns{padding-bottom:16rem}.swagger-ui .pt0-ns{padding-top:0}.swagger-ui .pt1-ns{padding-top:.25rem}.swagger-ui .pt2-ns{padding-top:.5rem}.swagger-ui .pt3-ns{padding-top:1rem}.swagger-ui .pt4-ns{padding-top:2rem}.swagger-ui .pt5-ns{padding-top:4rem}.swagger-ui .pt6-ns{padding-top:8rem}.swagger-ui .pt7-ns{padding-top:16rem}.swagger-ui .pv0-ns{padding-top:0;padding-bottom:0}.swagger-ui .pv1-ns{padding-top:.25rem;padding-bottom:.25rem}.swagger-ui .pv2-ns{padding-top:.5rem;padding-bottom:.5rem}.swagger-ui .pv3-ns{padding-top:1rem;padding-bottom:1rem}.swagger-ui .pv4-ns{padding-top:2rem;padding-bottom:2rem}.swagger-ui .pv5-ns{padding-top:4rem;padding-bottom:4rem}.swagger-ui .pv6-ns{padding-top:8rem;padding-bottom:8rem}.swagger-ui .pv7-ns{padding-top:16rem;padding-bottom:16rem}.swagger-ui .ph0-ns{padding-left:0;padding-right:0}.swagger-ui .ph1-ns{padding-left:.25rem;padding-right:.25rem}.swagger-ui .ph2-ns{padding-left:.5rem;padding-right:.5rem}.swagger-ui .ph3-ns{padding-left:1rem;padding-right:1rem}.swagger-ui .ph4-ns{padding-left:2rem;padding-right:2rem}.swagger-ui .ph5-ns{padding-left:4rem;padding-right:4rem}.swagger-ui .ph6-ns{padding-left:8rem;padding-right:8rem}.swagger-ui .ph7-ns{padding-left:16rem;padding-right:16rem}.swagger-ui .ma0-ns{margin:0}.swagger-ui .ma1-ns{margin:.25rem}.swagger-ui .ma2-ns{margin:.5rem}.swagger-ui .ma3-ns{margin:1rem}.swagger-ui .ma4-ns{margin:2rem}.swagger-ui .ma5-ns{margin:4rem}.swagger-ui .ma6-ns{margin:8rem}.swagger-ui .ma7-ns{margin:16rem}.swagger-ui .ml0-ns{margin-left:0}.swagger-ui .ml1-ns{margin-left:.25rem}.swagger-ui .ml2-ns{margin-left:.5rem}.swagger-ui .ml3-ns{margin-left:1rem}.swagger-ui .ml4-ns{margin-left:2rem}.swagger-ui .ml5-ns{margin-left:4rem}.swagger-ui .ml6-ns{margin-left:8rem}.swagger-ui .ml7-ns{margin-left:16rem}.swagger-ui .mr0-ns{margin-right:0}.swagger-ui .mr1-ns{margin-right:.25rem}.swagger-ui .mr2-ns{margin-right:.5rem}.swagger-ui .mr3-ns{margin-right:1rem}.swagger-ui .mr4-ns{margin-right:2rem}.swagger-ui .mr5-ns{margin-right:4rem}.swagger-ui .mr6-ns{margin-right:8rem}.swagger-ui .mr7-ns{margin-right:16rem}.swagger-ui .mb0-ns{margin-bottom:0}.swagger-ui .mb1-ns{margin-bottom:.25rem}.swagger-ui .mb2-ns{margin-bottom:.5rem}.swagger-ui .mb3-ns{margin-bottom:1rem}.swagger-ui .mb4-ns{margin-bottom:2rem}.swagger-ui .mb5-ns{margin-bottom:4rem}.swagger-ui .mb6-ns{margin-bottom:8rem}.swagger-ui .mb7-ns{margin-bottom:16rem}.swagger-ui .mt0-ns{margin-top:0}.swagger-ui .mt1-ns{margin-top:.25rem}.swagger-ui .mt2-ns{margin-top:.5rem}.swagger-ui .mt3-ns{margin-top:1rem}.swagger-ui .mt4-ns{margin-top:2rem}.swagger-ui .mt5-ns{margin-top:4rem}.swagger-ui .mt6-ns{margin-top:8rem}.swagger-ui .mt7-ns{margin-top:16rem}.swagger-ui .mv0-ns{margin-top:0;margin-bottom:0}.swagger-ui .mv1-ns{margin-top:.25rem;margin-bottom:.25rem}.swagger-ui .mv2-ns{margin-top:.5rem;margin-bottom:.5rem}.swagger-ui .mv3-ns{margin-top:1rem;margin-bottom:1rem}.swagger-ui .mv4-ns{margin-top:2rem;margin-bottom:2rem}.swagger-ui .mv5-ns{margin-top:4rem;margin-bottom:4rem}.swagger-ui .mv6-ns{margin-top:8rem;margin-bottom:8rem}.swagger-ui .mv7-ns{margin-top:16rem;margin-bottom:16rem}.swagger-ui .mh0-ns{margin-left:0;margin-right:0}.swagger-ui .mh1-ns{margin-left:.25rem;margin-right:.25rem}.swagger-ui .mh2-ns{margin-left:.5rem;margin-right:.5rem}.swagger-ui .mh3-ns{margin-left:1rem;margin-right:1rem}.swagger-ui .mh4-ns{margin-left:2rem;margin-right:2rem}.swagger-ui .mh5-ns{margin-left:4rem;margin-right:4rem}.swagger-ui .mh6-ns{margin-left:8rem;margin-right:8rem}.swagger-ui .mh7-ns{margin-left:16rem;margin-right:16rem}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .pa0-m{padding:0}.swagger-ui .pa1-m{padding:.25rem}.swagger-ui .pa2-m{padding:.5rem}.swagger-ui .pa3-m{padding:1rem}.swagger-ui .pa4-m{padding:2rem}.swagger-ui .pa5-m{padding:4rem}.swagger-ui .pa6-m{padding:8rem}.swagger-ui .pa7-m{padding:16rem}.swagger-ui .pl0-m{padding-left:0}.swagger-ui .pl1-m{padding-left:.25rem}.swagger-ui .pl2-m{padding-left:.5rem}.swagger-ui .pl3-m{padding-left:1rem}.swagger-ui .pl4-m{padding-left:2rem}.swagger-ui .pl5-m{padding-left:4rem}.swagger-ui .pl6-m{padding-left:8rem}.swagger-ui .pl7-m{padding-left:16rem}.swagger-ui .pr0-m{padding-right:0}.swagger-ui .pr1-m{padding-right:.25rem}.swagger-ui .pr2-m{padding-right:.5rem}.swagger-ui .pr3-m{padding-right:1rem}.swagger-ui .pr4-m{padding-right:2rem}.swagger-ui .pr5-m{padding-right:4rem}.swagger-ui .pr6-m{padding-right:8rem}.swagger-ui .pr7-m{padding-right:16rem}.swagger-ui .pb0-m{padding-bottom:0}.swagger-ui .pb1-m{padding-bottom:.25rem}.swagger-ui .pb2-m{padding-bottom:.5rem}.swagger-ui .pb3-m{padding-bottom:1rem}.swagger-ui .pb4-m{padding-bottom:2rem}.swagger-ui .pb5-m{padding-bottom:4rem}.swagger-ui .pb6-m{padding-bottom:8rem}.swagger-ui .pb7-m{padding-bottom:16rem}.swagger-ui .pt0-m{padding-top:0}.swagger-ui .pt1-m{padding-top:.25rem}.swagger-ui .pt2-m{padding-top:.5rem}.swagger-ui .pt3-m{padding-top:1rem}.swagger-ui .pt4-m{padding-top:2rem}.swagger-ui .pt5-m{padding-top:4rem}.swagger-ui .pt6-m{padding-top:8rem}.swagger-ui .pt7-m{padding-top:16rem}.swagger-ui .pv0-m{padding-top:0;padding-bottom:0}.swagger-ui .pv1-m{padding-top:.25rem;padding-bottom:.25rem}.swagger-ui .pv2-m{padding-top:.5rem;padding-bottom:.5rem}.swagger-ui .pv3-m{padding-top:1rem;padding-bottom:1rem}.swagger-ui .pv4-m{padding-top:2rem;padding-bottom:2rem}.swagger-ui .pv5-m{padding-top:4rem;padding-bottom:4rem}.swagger-ui .pv6-m{padding-top:8rem;padding-bottom:8rem}.swagger-ui .pv7-m{padding-top:16rem;padding-bottom:16rem}.swagger-ui .ph0-m{padding-left:0;padding-right:0}.swagger-ui .ph1-m{padding-left:.25rem;padding-right:.25rem}.swagger-ui .ph2-m{padding-left:.5rem;padding-right:.5rem}.swagger-ui .ph3-m{padding-left:1rem;padding-right:1rem}.swagger-ui .ph4-m{padding-left:2rem;padding-right:2rem}.swagger-ui .ph5-m{padding-left:4rem;padding-right:4rem}.swagger-ui .ph6-m{padding-left:8rem;padding-right:8rem}.swagger-ui .ph7-m{padding-left:16rem;padding-right:16rem}.swagger-ui .ma0-m{margin:0}.swagger-ui .ma1-m{margin:.25rem}.swagger-ui .ma2-m{margin:.5rem}.swagger-ui .ma3-m{margin:1rem}.swagger-ui .ma4-m{margin:2rem}.swagger-ui .ma5-m{margin:4rem}.swagger-ui .ma6-m{margin:8rem}.swagger-ui .ma7-m{margin:16rem}.swagger-ui .ml0-m{margin-left:0}.swagger-ui .ml1-m{margin-left:.25rem}.swagger-ui .ml2-m{margin-left:.5rem}.swagger-ui .ml3-m{margin-left:1rem}.swagger-ui .ml4-m{margin-left:2rem}.swagger-ui .ml5-m{margin-left:4rem}.swagger-ui .ml6-m{margin-left:8rem}.swagger-ui .ml7-m{margin-left:16rem}.swagger-ui .mr0-m{margin-right:0}.swagger-ui .mr1-m{margin-right:.25rem}.swagger-ui .mr2-m{margin-right:.5rem}.swagger-ui .mr3-m{margin-right:1rem}.swagger-ui .mr4-m{margin-right:2rem}.swagger-ui .mr5-m{margin-right:4rem}.swagger-ui .mr6-m{margin-right:8rem}.swagger-ui .mr7-m{margin-right:16rem}.swagger-ui .mb0-m{margin-bottom:0}.swagger-ui .mb1-m{margin-bottom:.25rem}.swagger-ui .mb2-m{margin-bottom:.5rem}.swagger-ui .mb3-m{margin-bottom:1rem}.swagger-ui .mb4-m{margin-bottom:2rem}.swagger-ui .mb5-m{margin-bottom:4rem}.swagger-ui .mb6-m{margin-bottom:8rem}.swagger-ui .mb7-m{margin-bottom:16rem}.swagger-ui .mt0-m{margin-top:0}.swagger-ui .mt1-m{margin-top:.25rem}.swagger-ui .mt2-m{margin-top:.5rem}.swagger-ui .mt3-m{margin-top:1rem}.swagger-ui .mt4-m{margin-top:2rem}.swagger-ui .mt5-m{margin-top:4rem}.swagger-ui .mt6-m{margin-top:8rem}.swagger-ui .mt7-m{margin-top:16rem}.swagger-ui .mv0-m{margin-top:0;margin-bottom:0}.swagger-ui .mv1-m{margin-top:.25rem;margin-bottom:.25rem}.swagger-ui .mv2-m{margin-top:.5rem;margin-bottom:.5rem}.swagger-ui .mv3-m{margin-top:1rem;margin-bottom:1rem}.swagger-ui .mv4-m{margin-top:2rem;margin-bottom:2rem}.swagger-ui .mv5-m{margin-top:4rem;margin-bottom:4rem}.swagger-ui .mv6-m{margin-top:8rem;margin-bottom:8rem}.swagger-ui .mv7-m{margin-top:16rem;margin-bottom:16rem}.swagger-ui .mh0-m{margin-left:0;margin-right:0}.swagger-ui .mh1-m{margin-left:.25rem;margin-right:.25rem}.swagger-ui .mh2-m{margin-left:.5rem;margin-right:.5rem}.swagger-ui .mh3-m{margin-left:1rem;margin-right:1rem}.swagger-ui .mh4-m{margin-left:2rem;margin-right:2rem}.swagger-ui .mh5-m{margin-left:4rem;margin-right:4rem}.swagger-ui .mh6-m{margin-left:8rem;margin-right:8rem}.swagger-ui .mh7-m{margin-left:16rem;margin-right:16rem}}@media screen and (min-width:60em){.swagger-ui .pa0-l{padding:0}.swagger-ui .pa1-l{padding:.25rem}.swagger-ui .pa2-l{padding:.5rem}.swagger-ui .pa3-l{padding:1rem}.swagger-ui .pa4-l{padding:2rem}.swagger-ui .pa5-l{padding:4rem}.swagger-ui .pa6-l{padding:8rem}.swagger-ui .pa7-l{padding:16rem}.swagger-ui .pl0-l{padding-left:0}.swagger-ui .pl1-l{padding-left:.25rem}.swagger-ui .pl2-l{padding-left:.5rem}.swagger-ui .pl3-l{padding-left:1rem}.swagger-ui .pl4-l{padding-left:2rem}.swagger-ui .pl5-l{padding-left:4rem}.swagger-ui .pl6-l{padding-left:8rem}.swagger-ui .pl7-l{padding-left:16rem}.swagger-ui .pr0-l{padding-right:0}.swagger-ui .pr1-l{padding-right:.25rem}.swagger-ui .pr2-l{padding-right:.5rem}.swagger-ui .pr3-l{padding-right:1rem}.swagger-ui .pr4-l{padding-right:2rem}.swagger-ui .pr5-l{padding-right:4rem}.swagger-ui .pr6-l{padding-right:8rem}.swagger-ui .pr7-l{padding-right:16rem}.swagger-ui .pb0-l{padding-bottom:0}.swagger-ui .pb1-l{padding-bottom:.25rem}.swagger-ui .pb2-l{padding-bottom:.5rem}.swagger-ui .pb3-l{padding-bottom:1rem}.swagger-ui .pb4-l{padding-bottom:2rem}.swagger-ui .pb5-l{padding-bottom:4rem}.swagger-ui .pb6-l{padding-bottom:8rem}.swagger-ui .pb7-l{padding-bottom:16rem}.swagger-ui .pt0-l{padding-top:0}.swagger-ui .pt1-l{padding-top:.25rem}.swagger-ui .pt2-l{padding-top:.5rem}.swagger-ui .pt3-l{padding-top:1rem}.swagger-ui .pt4-l{padding-top:2rem}.swagger-ui .pt5-l{padding-top:4rem}.swagger-ui .pt6-l{padding-top:8rem}.swagger-ui .pt7-l{padding-top:16rem}.swagger-ui .pv0-l{padding-top:0;padding-bottom:0}.swagger-ui .pv1-l{padding-top:.25rem;padding-bottom:.25rem}.swagger-ui .pv2-l{padding-top:.5rem;padding-bottom:.5rem}.swagger-ui .pv3-l{padding-top:1rem;padding-bottom:1rem}.swagger-ui .pv4-l{padding-top:2rem;padding-bottom:2rem}.swagger-ui .pv5-l{padding-top:4rem;padding-bottom:4rem}.swagger-ui .pv6-l{padding-top:8rem;padding-bottom:8rem}.swagger-ui .pv7-l{padding-top:16rem;padding-bottom:16rem}.swagger-ui .ph0-l{padding-left:0;padding-right:0}.swagger-ui .ph1-l{padding-left:.25rem;padding-right:.25rem}.swagger-ui .ph2-l{padding-left:.5rem;padding-right:.5rem}.swagger-ui .ph3-l{padding-left:1rem;padding-right:1rem}.swagger-ui .ph4-l{padding-left:2rem;padding-right:2rem}.swagger-ui .ph5-l{padding-left:4rem;padding-right:4rem}.swagger-ui .ph6-l{padding-left:8rem;padding-right:8rem}.swagger-ui .ph7-l{padding-left:16rem;padding-right:16rem}.swagger-ui .ma0-l{margin:0}.swagger-ui .ma1-l{margin:.25rem}.swagger-ui .ma2-l{margin:.5rem}.swagger-ui .ma3-l{margin:1rem}.swagger-ui .ma4-l{margin:2rem}.swagger-ui .ma5-l{margin:4rem}.swagger-ui .ma6-l{margin:8rem}.swagger-ui .ma7-l{margin:16rem}.swagger-ui .ml0-l{margin-left:0}.swagger-ui .ml1-l{margin-left:.25rem}.swagger-ui .ml2-l{margin-left:.5rem}.swagger-ui .ml3-l{margin-left:1rem}.swagger-ui .ml4-l{margin-left:2rem}.swagger-ui .ml5-l{margin-left:4rem}.swagger-ui .ml6-l{margin-left:8rem}.swagger-ui .ml7-l{margin-left:16rem}.swagger-ui .mr0-l{margin-right:0}.swagger-ui .mr1-l{margin-right:.25rem}.swagger-ui .mr2-l{margin-right:.5rem}.swagger-ui .mr3-l{margin-right:1rem}.swagger-ui .mr4-l{margin-right:2rem}.swagger-ui .mr5-l{margin-right:4rem}.swagger-ui .mr6-l{margin-right:8rem}.swagger-ui .mr7-l{margin-right:16rem}.swagger-ui .mb0-l{margin-bottom:0}.swagger-ui .mb1-l{margin-bottom:.25rem}.swagger-ui .mb2-l{margin-bottom:.5rem}.swagger-ui .mb3-l{margin-bottom:1rem}.swagger-ui .mb4-l{margin-bottom:2rem}.swagger-ui .mb5-l{margin-bottom:4rem}.swagger-ui .mb6-l{margin-bottom:8rem}.swagger-ui .mb7-l{margin-bottom:16rem}.swagger-ui .mt0-l{margin-top:0}.swagger-ui .mt1-l{margin-top:.25rem}.swagger-ui .mt2-l{margin-top:.5rem}.swagger-ui .mt3-l{margin-top:1rem}.swagger-ui .mt4-l{margin-top:2rem}.swagger-ui .mt5-l{margin-top:4rem}.swagger-ui .mt6-l{margin-top:8rem}.swagger-ui .mt7-l{margin-top:16rem}.swagger-ui .mv0-l{margin-top:0;margin-bottom:0}.swagger-ui .mv1-l{margin-top:.25rem;margin-bottom:.25rem}.swagger-ui .mv2-l{margin-top:.5rem;margin-bottom:.5rem}.swagger-ui .mv3-l{margin-top:1rem;margin-bottom:1rem}.swagger-ui .mv4-l{margin-top:2rem;margin-bottom:2rem}.swagger-ui .mv5-l{margin-top:4rem;margin-bottom:4rem}.swagger-ui .mv6-l{margin-top:8rem;margin-bottom:8rem}.swagger-ui .mv7-l{margin-top:16rem;margin-bottom:16rem}.swagger-ui .mh0-l{margin-left:0;margin-right:0}.swagger-ui .mh1-l{margin-left:.25rem;margin-right:.25rem}.swagger-ui .mh2-l{margin-left:.5rem;margin-right:.5rem}.swagger-ui .mh3-l{margin-left:1rem;margin-right:1rem}.swagger-ui .mh4-l{margin-left:2rem;margin-right:2rem}.swagger-ui .mh5-l{margin-left:4rem;margin-right:4rem}.swagger-ui .mh6-l{margin-left:8rem;margin-right:8rem}.swagger-ui .mh7-l{margin-left:16rem;margin-right:16rem}}.swagger-ui .na1{margin:-.25rem}.swagger-ui .na2{margin:-.5rem}.swagger-ui .na3{margin:-1rem}.swagger-ui .na4{margin:-2rem}.swagger-ui .na5{margin:-4rem}.swagger-ui .na6{margin:-8rem}.swagger-ui .na7{margin:-16rem}.swagger-ui .nl1{margin-left:-.25rem}.swagger-ui .nl2{margin-left:-.5rem}.swagger-ui .nl3{margin-left:-1rem}.swagger-ui .nl4{margin-left:-2rem}.swagger-ui .nl5{margin-left:-4rem}.swagger-ui .nl6{margin-left:-8rem}.swagger-ui .nl7{margin-left:-16rem}.swagger-ui .nr1{margin-right:-.25rem}.swagger-ui .nr2{margin-right:-.5rem}.swagger-ui .nr3{margin-right:-1rem}.swagger-ui .nr4{margin-right:-2rem}.swagger-ui .nr5{margin-right:-4rem}.swagger-ui .nr6{margin-right:-8rem}.swagger-ui .nr7{margin-right:-16rem}.swagger-ui .nb1{margin-bottom:-.25rem}.swagger-ui .nb2{margin-bottom:-.5rem}.swagger-ui .nb3{margin-bottom:-1rem}.swagger-ui .nb4{margin-bottom:-2rem}.swagger-ui .nb5{margin-bottom:-4rem}.swagger-ui .nb6{margin-bottom:-8rem}.swagger-ui .nb7{margin-bottom:-16rem}.swagger-ui .nt1{margin-top:-.25rem}.swagger-ui .nt2{margin-top:-.5rem}.swagger-ui .nt3{margin-top:-1rem}.swagger-ui .nt4{margin-top:-2rem}.swagger-ui .nt5{margin-top:-4rem}.swagger-ui .nt6{margin-top:-8rem}.swagger-ui .nt7{margin-top:-16rem}@media screen and (min-width:30em){.swagger-ui .na1-ns{margin:-.25rem}.swagger-ui .na2-ns{margin:-.5rem}.swagger-ui .na3-ns{margin:-1rem}.swagger-ui .na4-ns{margin:-2rem}.swagger-ui .na5-ns{margin:-4rem}.swagger-ui .na6-ns{margin:-8rem}.swagger-ui .na7-ns{margin:-16rem}.swagger-ui .nl1-ns{margin-left:-.25rem}.swagger-ui .nl2-ns{margin-left:-.5rem}.swagger-ui .nl3-ns{margin-left:-1rem}.swagger-ui .nl4-ns{margin-left:-2rem}.swagger-ui .nl5-ns{margin-left:-4rem}.swagger-ui .nl6-ns{margin-left:-8rem}.swagger-ui .nl7-ns{margin-left:-16rem}.swagger-ui .nr1-ns{margin-right:-.25rem}.swagger-ui .nr2-ns{margin-right:-.5rem}.swagger-ui .nr3-ns{margin-right:-1rem}.swagger-ui .nr4-ns{margin-right:-2rem}.swagger-ui .nr5-ns{margin-right:-4rem}.swagger-ui .nr6-ns{margin-right:-8rem}.swagger-ui .nr7-ns{margin-right:-16rem}.swagger-ui .nb1-ns{margin-bottom:-.25rem}.swagger-ui .nb2-ns{margin-bottom:-.5rem}.swagger-ui .nb3-ns{margin-bottom:-1rem}.swagger-ui .nb4-ns{margin-bottom:-2rem}.swagger-ui .nb5-ns{margin-bottom:-4rem}.swagger-ui .nb6-ns{margin-bottom:-8rem}.swagger-ui .nb7-ns{margin-bottom:-16rem}.swagger-ui .nt1-ns{margin-top:-.25rem}.swagger-ui .nt2-ns{margin-top:-.5rem}.swagger-ui .nt3-ns{margin-top:-1rem}.swagger-ui .nt4-ns{margin-top:-2rem}.swagger-ui .nt5-ns{margin-top:-4rem}.swagger-ui .nt6-ns{margin-top:-8rem}.swagger-ui .nt7-ns{margin-top:-16rem}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .na1-m{margin:-.25rem}.swagger-ui .na2-m{margin:-.5rem}.swagger-ui .na3-m{margin:-1rem}.swagger-ui .na4-m{margin:-2rem}.swagger-ui .na5-m{margin:-4rem}.swagger-ui .na6-m{margin:-8rem}.swagger-ui .na7-m{margin:-16rem}.swagger-ui .nl1-m{margin-left:-.25rem}.swagger-ui .nl2-m{margin-left:-.5rem}.swagger-ui .nl3-m{margin-left:-1rem}.swagger-ui .nl4-m{margin-left:-2rem}.swagger-ui .nl5-m{margin-left:-4rem}.swagger-ui .nl6-m{margin-left:-8rem}.swagger-ui .nl7-m{margin-left:-16rem}.swagger-ui .nr1-m{margin-right:-.25rem}.swagger-ui .nr2-m{margin-right:-.5rem}.swagger-ui .nr3-m{margin-right:-1rem}.swagger-ui .nr4-m{margin-right:-2rem}.swagger-ui .nr5-m{margin-right:-4rem}.swagger-ui .nr6-m{margin-right:-8rem}.swagger-ui .nr7-m{margin-right:-16rem}.swagger-ui .nb1-m{margin-bottom:-.25rem}.swagger-ui .nb2-m{margin-bottom:-.5rem}.swagger-ui .nb3-m{margin-bottom:-1rem}.swagger-ui .nb4-m{margin-bottom:-2rem}.swagger-ui .nb5-m{margin-bottom:-4rem}.swagger-ui .nb6-m{margin-bottom:-8rem}.swagger-ui .nb7-m{margin-bottom:-16rem}.swagger-ui .nt1-m{margin-top:-.25rem}.swagger-ui .nt2-m{margin-top:-.5rem}.swagger-ui .nt3-m{margin-top:-1rem}.swagger-ui .nt4-m{margin-top:-2rem}.swagger-ui .nt5-m{margin-top:-4rem}.swagger-ui .nt6-m{margin-top:-8rem}.swagger-ui .nt7-m{margin-top:-16rem}}@media screen and (min-width:60em){.swagger-ui .na1-l{margin:-.25rem}.swagger-ui .na2-l{margin:-.5rem}.swagger-ui .na3-l{margin:-1rem}.swagger-ui .na4-l{margin:-2rem}.swagger-ui .na5-l{margin:-4rem}.swagger-ui .na6-l{margin:-8rem}.swagger-ui .na7-l{margin:-16rem}.swagger-ui .nl1-l{margin-left:-.25rem}.swagger-ui .nl2-l{margin-left:-.5rem}.swagger-ui .nl3-l{margin-left:-1rem}.swagger-ui .nl4-l{margin-left:-2rem}.swagger-ui .nl5-l{margin-left:-4rem}.swagger-ui .nl6-l{margin-left:-8rem}.swagger-ui .nl7-l{margin-left:-16rem}.swagger-ui .nr1-l{margin-right:-.25rem}.swagger-ui .nr2-l{margin-right:-.5rem}.swagger-ui .nr3-l{margin-right:-1rem}.swagger-ui .nr4-l{margin-right:-2rem}.swagger-ui .nr5-l{margin-right:-4rem}.swagger-ui .nr6-l{margin-right:-8rem}.swagger-ui .nr7-l{margin-right:-16rem}.swagger-ui .nb1-l{margin-bottom:-.25rem}.swagger-ui .nb2-l{margin-bottom:-.5rem}.swagger-ui .nb3-l{margin-bottom:-1rem}.swagger-ui .nb4-l{margin-bottom:-2rem}.swagger-ui .nb5-l{margin-bottom:-4rem}.swagger-ui .nb6-l{margin-bottom:-8rem}.swagger-ui .nb7-l{margin-bottom:-16rem}.swagger-ui .nt1-l{margin-top:-.25rem}.swagger-ui .nt2-l{margin-top:-.5rem}.swagger-ui .nt3-l{margin-top:-1rem}.swagger-ui .nt4-l{margin-top:-2rem}.swagger-ui .nt5-l{margin-top:-4rem}.swagger-ui .nt6-l{margin-top:-8rem}.swagger-ui .nt7-l{margin-top:-16rem}}.swagger-ui .collapse{border-collapse:collapse;border-spacing:0}.swagger-ui .striped--light-silver:nth-child(odd){background-color:#aaa}.swagger-ui .striped--moon-gray:nth-child(odd){background-color:#ccc}.swagger-ui .striped--light-gray:nth-child(odd){background-color:#eee}.swagger-ui .striped--near-white:nth-child(odd){background-color:#f4f4f4}.swagger-ui .stripe-light:nth-child(odd){background-color:hsla(0,0%,100%,.1)}.swagger-ui .stripe-dark:nth-child(odd){background-color:rgba(0,0,0,.1)}.swagger-ui .strike{text-decoration:line-through}.swagger-ui .underline{text-decoration:underline}.swagger-ui .no-underline{text-decoration:none}@media screen and (min-width:30em){.swagger-ui .strike-ns{text-decoration:line-through}.swagger-ui .underline-ns{text-decoration:underline}.swagger-ui .no-underline-ns{text-decoration:none}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .strike-m{text-decoration:line-through}.swagger-ui .underline-m{text-decoration:underline}.swagger-ui .no-underline-m{text-decoration:none}}@media screen and (min-width:60em){.swagger-ui .strike-l{text-decoration:line-through}.swagger-ui .underline-l{text-decoration:underline}.swagger-ui .no-underline-l{text-decoration:none}}.swagger-ui .tl{text-align:left}.swagger-ui .tr{text-align:right}.swagger-ui .tc{text-align:center}.swagger-ui .tj{text-align:justify}@media screen and (min-width:30em){.swagger-ui .tl-ns{text-align:left}.swagger-ui .tr-ns{text-align:right}.swagger-ui .tc-ns{text-align:center}.swagger-ui .tj-ns{text-align:justify}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .tl-m{text-align:left}.swagger-ui .tr-m{text-align:right}.swagger-ui .tc-m{text-align:center}.swagger-ui .tj-m{text-align:justify}}@media screen and (min-width:60em){.swagger-ui .tl-l{text-align:left}.swagger-ui .tr-l{text-align:right}.swagger-ui .tc-l{text-align:center}.swagger-ui .tj-l{text-align:justify}}.swagger-ui .ttc{text-transform:capitalize}.swagger-ui .ttl{text-transform:lowercase}.swagger-ui .ttu{text-transform:uppercase}.swagger-ui .ttn{text-transform:none}@media screen and (min-width:30em){.swagger-ui .ttc-ns{text-transform:capitalize}.swagger-ui .ttl-ns{text-transform:lowercase}.swagger-ui .ttu-ns{text-transform:uppercase}.swagger-ui .ttn-ns{text-transform:none}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .ttc-m{text-transform:capitalize}.swagger-ui .ttl-m{text-transform:lowercase}.swagger-ui .ttu-m{text-transform:uppercase}.swagger-ui .ttn-m{text-transform:none}}@media screen and (min-width:60em){.swagger-ui .ttc-l{text-transform:capitalize}.swagger-ui .ttl-l{text-transform:lowercase}.swagger-ui .ttu-l{text-transform:uppercase}.swagger-ui .ttn-l{text-transform:none}}.swagger-ui .f-6,.swagger-ui .f-headline{font-size:6rem}.swagger-ui .f-5,.swagger-ui .f-subheadline{font-size:5rem}.swagger-ui .f1{font-size:3rem}.swagger-ui .f2{font-size:2.25rem}.swagger-ui .f3{font-size:1.5rem}.swagger-ui .f4{font-size:1.25rem}.swagger-ui .f5{font-size:1rem}.swagger-ui .f6{font-size:.875rem}.swagger-ui .f7{font-size:.75rem}@media screen and (min-width:30em){.swagger-ui .f-6-ns,.swagger-ui .f-headline-ns{font-size:6rem}.swagger-ui .f-5-ns,.swagger-ui .f-subheadline-ns{font-size:5rem}.swagger-ui .f1-ns{font-size:3rem}.swagger-ui .f2-ns{font-size:2.25rem}.swagger-ui .f3-ns{font-size:1.5rem}.swagger-ui .f4-ns{font-size:1.25rem}.swagger-ui .f5-ns{font-size:1rem}.swagger-ui .f6-ns{font-size:.875rem}.swagger-ui .f7-ns{font-size:.75rem}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .f-6-m,.swagger-ui .f-headline-m{font-size:6rem}.swagger-ui .f-5-m,.swagger-ui .f-subheadline-m{font-size:5rem}.swagger-ui .f1-m{font-size:3rem}.swagger-ui .f2-m{font-size:2.25rem}.swagger-ui .f3-m{font-size:1.5rem}.swagger-ui .f4-m{font-size:1.25rem}.swagger-ui .f5-m{font-size:1rem}.swagger-ui .f6-m{font-size:.875rem}.swagger-ui .f7-m{font-size:.75rem}}@media screen and (min-width:60em){.swagger-ui .f-6-l,.swagger-ui .f-headline-l{font-size:6rem}.swagger-ui .f-5-l,.swagger-ui .f-subheadline-l{font-size:5rem}.swagger-ui .f1-l{font-size:3rem}.swagger-ui .f2-l{font-size:2.25rem}.swagger-ui .f3-l{font-size:1.5rem}.swagger-ui .f4-l{font-size:1.25rem}.swagger-ui .f5-l{font-size:1rem}.swagger-ui .f6-l{font-size:.875rem}.swagger-ui .f7-l{font-size:.75rem}}.swagger-ui .measure{max-width:30em}.swagger-ui .measure-wide{max-width:34em}.swagger-ui .measure-narrow{max-width:20em}.swagger-ui .indent{text-indent:1em;margin-top:0;margin-bottom:0}.swagger-ui .small-caps{font-variant:small-caps}.swagger-ui .truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media screen and (min-width:30em){.swagger-ui .measure-ns{max-width:30em}.swagger-ui .measure-wide-ns{max-width:34em}.swagger-ui .measure-narrow-ns{max-width:20em}.swagger-ui .indent-ns{text-indent:1em;margin-top:0;margin-bottom:0}.swagger-ui .small-caps-ns{font-variant:small-caps}.swagger-ui .truncate-ns{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .measure-m{max-width:30em}.swagger-ui .measure-wide-m{max-width:34em}.swagger-ui .measure-narrow-m{max-width:20em}.swagger-ui .indent-m{text-indent:1em;margin-top:0;margin-bottom:0}.swagger-ui .small-caps-m{font-variant:small-caps}.swagger-ui .truncate-m{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}@media screen and (min-width:60em){.swagger-ui .measure-l{max-width:30em}.swagger-ui .measure-wide-l{max-width:34em}.swagger-ui .measure-narrow-l{max-width:20em}.swagger-ui .indent-l{text-indent:1em;margin-top:0;margin-bottom:0}.swagger-ui .small-caps-l{font-variant:small-caps}.swagger-ui .truncate-l{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}.swagger-ui .overflow-container{overflow-y:scroll}.swagger-ui .center{margin-right:auto;margin-left:auto}.swagger-ui .mr-auto{margin-right:auto}.swagger-ui .ml-auto{margin-left:auto}@media screen and (min-width:30em){.swagger-ui .center-ns{margin-right:auto;margin-left:auto}.swagger-ui .mr-auto-ns{margin-right:auto}.swagger-ui .ml-auto-ns{margin-left:auto}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .center-m{margin-right:auto;margin-left:auto}.swagger-ui .mr-auto-m{margin-right:auto}.swagger-ui .ml-auto-m{margin-left:auto}}@media screen and (min-width:60em){.swagger-ui .center-l{margin-right:auto;margin-left:auto}.swagger-ui .mr-auto-l{margin-right:auto}.swagger-ui .ml-auto-l{margin-left:auto}}.swagger-ui .clip{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}@media screen and (min-width:30em){.swagger-ui .clip-ns{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .clip-m{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}}@media screen and (min-width:60em){.swagger-ui .clip-l{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}}.swagger-ui .ws-normal{white-space:normal}.swagger-ui .nowrap{white-space:nowrap}.swagger-ui .pre{white-space:pre}@media screen and (min-width:30em){.swagger-ui .ws-normal-ns{white-space:normal}.swagger-ui .nowrap-ns{white-space:nowrap}.swagger-ui .pre-ns{white-space:pre}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .ws-normal-m{white-space:normal}.swagger-ui .nowrap-m{white-space:nowrap}.swagger-ui .pre-m{white-space:pre}}@media screen and (min-width:60em){.swagger-ui .ws-normal-l{white-space:normal}.swagger-ui .nowrap-l{white-space:nowrap}.swagger-ui .pre-l{white-space:pre}}.swagger-ui .v-base{vertical-align:baseline}.swagger-ui .v-mid{vertical-align:middle}.swagger-ui .v-top{vertical-align:top}.swagger-ui .v-btm{vertical-align:bottom}@media screen and (min-width:30em){.swagger-ui .v-base-ns{vertical-align:baseline}.swagger-ui .v-mid-ns{vertical-align:middle}.swagger-ui .v-top-ns{vertical-align:top}.swagger-ui .v-btm-ns{vertical-align:bottom}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .v-base-m{vertical-align:baseline}.swagger-ui .v-mid-m{vertical-align:middle}.swagger-ui .v-top-m{vertical-align:top}.swagger-ui .v-btm-m{vertical-align:bottom}}@media screen and (min-width:60em){.swagger-ui .v-base-l{vertical-align:baseline}.swagger-ui .v-mid-l{vertical-align:middle}.swagger-ui .v-top-l{vertical-align:top}.swagger-ui .v-btm-l{vertical-align:bottom}}.swagger-ui .dim{opacity:1;transition:opacity .15s ease-in}.swagger-ui .dim:focus,.swagger-ui .dim:hover{opacity:.5;transition:opacity .15s ease-in}.swagger-ui .dim:active{opacity:.8;transition:opacity .15s ease-out}.swagger-ui .glow{transition:opacity .15s ease-in}.swagger-ui .glow:focus,.swagger-ui .glow:hover{opacity:1;transition:opacity .15s ease-in}.swagger-ui .hide-child .child{opacity:0;transition:opacity .15s ease-in}.swagger-ui .hide-child:active .child,.swagger-ui .hide-child:focus .child,.swagger-ui .hide-child:hover .child{opacity:1;transition:opacity .15s ease-in}.swagger-ui .underline-hover:focus,.swagger-ui .underline-hover:hover{text-decoration:underline}.swagger-ui .grow{-moz-osx-font-smoothing:grayscale;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:translateZ(0);transform:translateZ(0);transition:-webkit-transform .25s ease-out;transition:transform .25s ease-out;transition:transform .25s ease-out, -webkit-transform .25s ease-out}.swagger-ui .grow:focus,.swagger-ui .grow:hover{-webkit-transform:scale(1.05);transform:scale(1.05)}.swagger-ui .grow:active{-webkit-transform:scale(.9);transform:scale(.9)}.swagger-ui .grow-large{-moz-osx-font-smoothing:grayscale;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:translateZ(0);transform:translateZ(0);transition:-webkit-transform .25s ease-in-out;transition:transform .25s ease-in-out;transition:transform .25s ease-in-out, -webkit-transform .25s ease-in-out}.swagger-ui .grow-large:focus,.swagger-ui .grow-large:hover{-webkit-transform:scale(1.2);transform:scale(1.2)}.swagger-ui .grow-large:active{-webkit-transform:scale(.95);transform:scale(.95)}.swagger-ui .pointer:hover{cursor:pointer}.swagger-ui .shadow-hover{cursor:pointer;position:relative;transition:all .5s cubic-bezier(.165,.84,.44,1)}.swagger-ui .shadow-hover:after{content:"";box-shadow:0 0 16px 2px rgba(0,0,0,.2);border-radius:inherit;opacity:0;position:absolute;top:0;left:0;width:100%;height:100%;z-index:-1;transition:opacity .5s cubic-bezier(.165,.84,.44,1)}.swagger-ui .shadow-hover:focus:after,.swagger-ui .shadow-hover:hover:after{opacity:1}.swagger-ui .bg-animate,.swagger-ui .bg-animate:focus,.swagger-ui .bg-animate:hover{transition:background-color .15s ease-in-out}.swagger-ui .z-0{z-index:0}.swagger-ui .z-1{z-index:1}.swagger-ui .z-2{z-index:2}.swagger-ui .z-3{z-index:3}.swagger-ui .z-4{z-index:4}.swagger-ui .z-5{z-index:5}.swagger-ui .z-999{z-index:999}.swagger-ui .z-9999{z-index:9999}.swagger-ui .z-max{z-index:2147483647}.swagger-ui .z-inherit{z-index:inherit}.swagger-ui .z-initial{z-index:auto}.swagger-ui .z-unset{z-index:unset}.swagger-ui .nested-copy-line-height ol,.swagger-ui .nested-copy-line-height p,.swagger-ui .nested-copy-line-height ul{line-height:1.5}.swagger-ui .nested-headline-line-height h1,.swagger-ui .nested-headline-line-height h2,.swagger-ui .nested-headline-line-height h3,.swagger-ui .nested-headline-line-height h4,.swagger-ui .nested-headline-line-height h5,.swagger-ui .nested-headline-line-height h6{line-height:1.25}.swagger-ui .nested-list-reset ol,.swagger-ui .nested-list-reset ul{padding-left:0;margin-left:0;list-style-type:none}.swagger-ui .nested-copy-indent p+p{text-indent:.1em;margin-top:0;margin-bottom:0}.swagger-ui .nested-copy-seperator p+p{margin-top:1.5em}.swagger-ui .nested-img img{width:100%;max-width:100%;display:block}.swagger-ui .nested-links a{color:#357edd;transition:color .15s ease-in}.swagger-ui .nested-links a:focus,.swagger-ui .nested-links a:hover{color:#96ccff;transition:color .15s ease-in}.swagger-ui .wrapper{width:100%;max-width:1460px;margin:0 auto;padding:0 20px;box-sizing:border-box}.swagger-ui .opblock-tag-section{display:flex;flex-direction:column}.swagger-ui .opblock-tag{display:flex;align-items:center;padding:10px 20px 10px 10px;cursor:pointer;transition:all .2s;border-bottom:1px solid rgba(59,65,81,.3)}.swagger-ui .opblock-tag:hover{background:rgba(0,0,0,.02)}.swagger-ui .opblock-tag{font-size:24px;margin:0 0 5px;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock-tag.no-desc span{flex:1}.swagger-ui .opblock-tag svg{transition:all .4s}.swagger-ui .opblock-tag small{font-size:14px;font-weight:400;flex:1;padding:0 10px;font-family:sans-serif;color:#3b4151}.swagger-ui .parameter__type{font-size:12px;padding:5px 0;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui .parameter-controls{margin-top:.75em}.swagger-ui .examples__title{display:block;font-size:1.1em;font-weight:700;margin-bottom:.75em}.swagger-ui .examples__section{margin-top:1.5em}.swagger-ui .examples__section-header{font-weight:700;font-size:.9rem;margin-bottom:.5rem}.swagger-ui .examples-select{margin-bottom:.75em}.swagger-ui .examples-select__section-label{font-weight:700;font-size:.9rem;margin-right:.5rem}.swagger-ui .example__section{margin-top:1.5em}.swagger-ui .example__section-header{font-weight:700;font-size:.9rem;margin-bottom:.5rem}.swagger-ui .view-line-link{position:relative;top:3px;width:20px;margin:0 5px;cursor:pointer;transition:all .5s}.swagger-ui .opblock{margin:0 0 15px;border:1px solid #000;border-radius:4px;box-shadow:0 0 3px rgba(0,0,0,.19)}.swagger-ui .opblock .tab-header{display:flex;flex:1}.swagger-ui .opblock .tab-header .tab-item{padding:0 40px;cursor:pointer}.swagger-ui .opblock .tab-header .tab-item:first-of-type{padding:0 40px 0 0}.swagger-ui .opblock .tab-header .tab-item.active h4 span{position:relative}.swagger-ui .opblock .tab-header .tab-item.active h4 span:after{position:absolute;bottom:-15px;left:50%;width:120%;height:4px;content:"";-webkit-transform:translateX(-50%);transform:translateX(-50%);background:grey}.swagger-ui .opblock.is-open .opblock-summary{border-bottom:1px solid #000}.swagger-ui .opblock .opblock-section-header{display:flex;align-items:center;padding:8px 20px;min-height:50px;background:hsla(0,0%,100%,.8);box-shadow:0 1px 2px rgba(0,0,0,.1)}.swagger-ui .opblock .opblock-section-header>label{font-size:12px;font-weight:700;display:flex;align-items:center;margin:0 0 0 auto;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock .opblock-section-header>label>span{padding:0 10px 0 0}.swagger-ui .opblock .opblock-section-header h4{font-size:14px;flex:1;margin:0;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock .opblock-summary-method{font-size:14px;font-weight:700;min-width:80px;padding:6px 15px;text-align:center;border-radius:3px;background:#000;text-shadow:0 1px 0 rgba(0,0,0,.1);font-family:sans-serif;color:#fff}.swagger-ui .opblock .opblock-summary-operation-id,.swagger-ui .opblock .opblock-summary-path,.swagger-ui .opblock .opblock-summary-path__deprecated{font-size:16px;display:flex;align-items:center;word-break:break-word;padding:0 10px;font-family:monospace;font-weight:600;color:#3b4151}@media (max-width:768px){.swagger-ui .opblock .opblock-summary-operation-id,.swagger-ui .opblock .opblock-summary-path,.swagger-ui .opblock .opblock-summary-path__deprecated{font-size:12px}}.swagger-ui .opblock .opblock-summary-path__deprecated{text-decoration:line-through}.swagger-ui .opblock .opblock-summary-operation-id{font-size:14px}.swagger-ui .opblock .opblock-summary-description{font-size:13px;flex:1 1 auto;word-break:break-word;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock .opblock-summary{display:flex;align-items:center;padding:5px;cursor:pointer}.swagger-ui .opblock .opblock-summary .view-line-link{position:relative;top:2px;width:0;margin:0;cursor:pointer;transition:all .5s}.swagger-ui .opblock .opblock-summary:hover .view-line-link{width:18px;margin:0 5px}.swagger-ui .opblock.opblock-post{border-color:#49cc90;background:rgba(73,204,144,.1)}.swagger-ui .opblock.opblock-post .opblock-summary-method{background:#49cc90}.swagger-ui .opblock.opblock-post .opblock-summary{border-color:#49cc90}.swagger-ui .opblock.opblock-post .tab-header .tab-item.active h4 span:after{background:#49cc90}.swagger-ui .opblock.opblock-put{border-color:#fca130;background:rgba(252,161,48,.1)}.swagger-ui .opblock.opblock-put .opblock-summary-method{background:#fca130}.swagger-ui .opblock.opblock-put .opblock-summary{border-color:#fca130}.swagger-ui .opblock.opblock-put .tab-header .tab-item.active h4 span:after{background:#fca130}.swagger-ui .opblock.opblock-delete{border-color:#f93e3e;background:rgba(249,62,62,.1)}.swagger-ui .opblock.opblock-delete .opblock-summary-method{background:#f93e3e}.swagger-ui .opblock.opblock-delete .opblock-summary{border-color:#f93e3e}.swagger-ui .opblock.opblock-delete .tab-header .tab-item.active h4 span:after{background:#f93e3e}.swagger-ui .opblock.opblock-get{border-color:#61affe;background:rgba(97,175,254,.1)}.swagger-ui .opblock.opblock-get .opblock-summary-method{background:#61affe}.swagger-ui .opblock.opblock-get .opblock-summary{border-color:#61affe}.swagger-ui .opblock.opblock-get .tab-header .tab-item.active h4 span:after{background:#61affe}.swagger-ui .opblock.opblock-patch{border-color:#50e3c2;background:rgba(80,227,194,.1)}.swagger-ui .opblock.opblock-patch .opblock-summary-method{background:#50e3c2}.swagger-ui .opblock.opblock-patch .opblock-summary{border-color:#50e3c2}.swagger-ui .opblock.opblock-patch .tab-header .tab-item.active h4 span:after{background:#50e3c2}.swagger-ui .opblock.opblock-head{border-color:#9012fe;background:rgba(144,18,254,.1)}.swagger-ui .opblock.opblock-head .opblock-summary-method{background:#9012fe}.swagger-ui .opblock.opblock-head .opblock-summary{border-color:#9012fe}.swagger-ui .opblock.opblock-head .tab-header .tab-item.active h4 span:after{background:#9012fe}.swagger-ui .opblock.opblock-options{border-color:#0d5aa7;background:rgba(13,90,167,.1)}.swagger-ui .opblock.opblock-options .opblock-summary-method{background:#0d5aa7}.swagger-ui .opblock.opblock-options .opblock-summary{border-color:#0d5aa7}.swagger-ui .opblock.opblock-options .tab-header .tab-item.active h4 span:after{background:#0d5aa7}.swagger-ui .opblock.opblock-deprecated{opacity:.6;border-color:#ebebeb;background:hsla(0,0%,92.2%,.1)}.swagger-ui .opblock.opblock-deprecated .opblock-summary-method{background:#ebebeb}.swagger-ui .opblock.opblock-deprecated .opblock-summary{border-color:#ebebeb}.swagger-ui .opblock.opblock-deprecated .tab-header .tab-item.active h4 span:after{background:#ebebeb}.swagger-ui .opblock .opblock-schemes{padding:8px 20px}.swagger-ui .opblock .opblock-schemes .schemes-title{padding:0 10px 0 0}.swagger-ui .filter .operation-filter-input{width:100%;margin:20px 0;padding:10px;border:2px solid #d8dde7}.swagger-ui .model-example{margin-top:1em}.swagger-ui .tab{display:flex;padding:0;list-style:none}.swagger-ui .tab li{font-size:12px;min-width:60px;padding:0;cursor:pointer;font-family:sans-serif;color:#3b4151}.swagger-ui .tab li:first-of-type{position:relative;padding-left:0;padding-right:12px}.swagger-ui .tab li:first-of-type:after{position:absolute;top:0;right:6px;width:1px;height:100%;content:"";background:rgba(0,0,0,.2)}.swagger-ui .tab li.active{font-weight:700}.swagger-ui .opblock-description-wrapper,.swagger-ui .opblock-external-docs-wrapper,.swagger-ui .opblock-title_normal{font-size:12px;margin:0 0 5px;padding:15px 20px;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock-description-wrapper h4,.swagger-ui .opblock-external-docs-wrapper h4,.swagger-ui .opblock-title_normal h4{font-size:12px;margin:0 0 5px;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock-description-wrapper p,.swagger-ui .opblock-external-docs-wrapper p,.swagger-ui .opblock-title_normal p{font-size:14px;margin:0;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock-external-docs-wrapper h4{padding-left:0}.swagger-ui .execute-wrapper{padding:20px;text-align:right}.swagger-ui .execute-wrapper .btn{width:100%;padding:8px 40px}.swagger-ui .body-param-options{display:flex;flex-direction:column}.swagger-ui .body-param-options .body-param-edit{padding:10px 0}.swagger-ui .body-param-options label{padding:8px 0}.swagger-ui .body-param-options label select{margin:3px 0 0}.swagger-ui .responses-inner{padding:20px}.swagger-ui .responses-inner h4,.swagger-ui .responses-inner h5{font-size:12px;margin:10px 0 5px;font-family:sans-serif;color:#3b4151}.swagger-ui .response-col_status{font-size:14px;font-family:sans-serif;color:#3b4151}.swagger-ui .response-col_status .response-undocumented{font-size:11px;font-family:monospace;font-weight:600;color:#909090}.swagger-ui .response-col_links{padding-left:2em;max-width:40em;font-size:14px;font-family:sans-serif;color:#3b4151}.swagger-ui .response-col_links .response-undocumented{font-size:11px;font-family:monospace;font-weight:600;color:#909090}.swagger-ui .opblock-body .opblock-loading-animation{display:block;margin:3em auto}.swagger-ui .opblock-body pre.microlight{font-size:12px;margin:0;padding:10px;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;word-break:break-word;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;border-radius:4px;background:#41444e;overflow-wrap:break-word;font-family:monospace;font-weight:600;color:#fff}.swagger-ui .opblock-body pre.microlight span{color:#fff!important}.swagger-ui .opblock-body pre.microlight .headerline{display:block}.swagger-ui .highlight-code{position:relative}.swagger-ui .highlight-code>.microlight{overflow-y:auto;max-height:400px;min-height:6em}.swagger-ui .download-contents{position:absolute;bottom:10px;right:10px;cursor:pointer;background:#7d8293;text-align:center;padding:5px;border-radius:4px;font-family:sans-serif;font-weight:600;color:#fff;font-size:14px;height:30px;width:75px}.swagger-ui .scheme-container{margin:0 0 20px;padding:30px 0;background:#fff;box-shadow:0 1px 2px 0 rgba(0,0,0,.15)}.swagger-ui .scheme-container .schemes{display:flex;align-items:flex-end}.swagger-ui .scheme-container .schemes>label{font-size:12px;font-weight:700;display:flex;flex-direction:column;margin:-20px 15px 0 0;font-family:sans-serif;color:#3b4151}.swagger-ui .scheme-container .schemes>label select{min-width:130px;text-transform:uppercase}.swagger-ui .loading-container{padding:40px 0 60px;margin-top:1em;min-height:1px;display:flex;justify-content:center;align-items:center;flex-direction:column}.swagger-ui .loading-container .loading{position:relative}.swagger-ui .loading-container .loading:after{font-size:10px;font-weight:700;position:absolute;top:50%;left:50%;content:"loading";-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);text-transform:uppercase;font-family:sans-serif;color:#3b4151}.swagger-ui .loading-container .loading:before{position:absolute;top:50%;left:50%;display:block;width:60px;height:60px;margin:-30px;content:"";-webkit-animation:rotation 1s linear infinite,opacity .5s;animation:rotation 1s linear infinite,opacity .5s;opacity:1;border:2px solid rgba(85,85,85,.1);border-top-color:rgba(0,0,0,.6);border-radius:100%;-webkit-backface-visibility:hidden;backface-visibility:hidden}@-webkit-keyframes rotation{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes rotation{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.swagger-ui .response-controls{padding-top:1em;display:flex}.swagger-ui .response-control-media-type{margin-right:1em}.swagger-ui .response-control-media-type--accept-controller select{border-color:green}.swagger-ui .response-control-media-type__accept-message{color:green;font-size:.7em}.swagger-ui .response-control-examples__title,.swagger-ui .response-control-media-type__title{display:block;margin-bottom:.2em;font-size:.7em}@-webkit-keyframes blinker{50%{opacity:0}}@keyframes blinker{50%{opacity:0}}.swagger-ui section h3{font-family:sans-serif;color:#3b4151}.swagger-ui a.nostyle{display:inline}.swagger-ui a.nostyle,.swagger-ui a.nostyle:visited{text-decoration:inherit;color:inherit;cursor:pointer}.swagger-ui .version-pragma{height:100%;padding:5em 0}.swagger-ui .version-pragma__message{display:flex;justify-content:center;height:100%;font-size:1.2em;text-align:center;line-height:1.5em;padding:0 .6em}.swagger-ui .version-pragma__message>div{max-width:55ch;flex:1}.swagger-ui .version-pragma__message code{background-color:#dedede;padding:4px 4px 2px;white-space:pre}.swagger-ui .btn{font-size:14px;font-weight:700;padding:5px 23px;transition:all .3s;border:2px solid grey;border-radius:4px;background:transparent;box-shadow:0 1px 2px rgba(0,0,0,.1);font-family:sans-serif;color:#3b4151}.swagger-ui .btn.btn-sm{font-size:12px;padding:4px 23px}.swagger-ui .btn[disabled]{cursor:not-allowed;opacity:.3}.swagger-ui .btn:hover{box-shadow:0 0 5px rgba(0,0,0,.3)}.swagger-ui .btn.cancel{border-color:#ff6060;background-color:transparent;font-family:sans-serif;color:#ff6060}.swagger-ui .btn.authorize{line-height:1;display:inline;color:#49cc90;border-color:#49cc90;background-color:transparent}.swagger-ui .btn.authorize span{float:left;padding:4px 20px 0 0}.swagger-ui .btn.authorize svg{fill:#49cc90}.swagger-ui .btn.execute{background-color:#4990e2;color:#fff;border-color:#4990e2}.swagger-ui .btn-group{display:flex;padding:30px}.swagger-ui .btn-group .btn{flex:1}.swagger-ui .btn-group .btn:first-child{border-radius:4px 0 0 4px}.swagger-ui .btn-group .btn:last-child{border-radius:0 4px 4px 0}.swagger-ui .authorization__btn{padding:0 10px;border:none;background:none}.swagger-ui .authorization__btn.locked{opacity:1}.swagger-ui .authorization__btn.unlocked{opacity:.4}.swagger-ui .expand-methods,.swagger-ui .expand-operation{border:none;background:none}.swagger-ui .expand-methods svg,.swagger-ui .expand-operation svg{width:20px;height:20px}.swagger-ui .expand-methods{padding:0 10px}.swagger-ui .expand-methods:hover svg{fill:#404040}.swagger-ui .expand-methods svg{transition:all .3s;fill:#707070}.swagger-ui button{cursor:pointer;outline:none}.swagger-ui button.invalid{-webkit-animation:shake .4s 1;animation:shake .4s 1;border-color:#f93e3e;background:#feebeb}.swagger-ui select{font-size:14px;font-weight:700;padding:5px 40px 5px 10px;border:2px solid #41444e;border-radius:4px;background:#f7f7f7 url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZD0iTTEzLjQxOCA3Ljg1OWEuNjk1LjY5NSAwIDAxLjk3OCAwIC42OC42OCAwIDAxMCAuOTY5bC0zLjkwOCAzLjgzYS42OTcuNjk3IDAgMDEtLjk3OSAwbC0zLjkwOC0zLjgzYS42OC42OCAwIDAxMC0uOTY5LjY5NS42OTUgMCAwMS45NzggMEwxMCAxMWwzLjQxOC0zLjE0MXoiLz48L3N2Zz4=) right 10px center no-repeat;background-size:20px;box-shadow:0 1px 2px 0 rgba(0,0,0,.25);font-family:sans-serif;color:#3b4151;-webkit-appearance:none;-moz-appearance:none;appearance:none}.swagger-ui select[multiple]{margin:5px 0;padding:5px;background:#f7f7f7}.swagger-ui select.invalid{-webkit-animation:shake .4s 1;animation:shake .4s 1;border-color:#f93e3e;background:#feebeb}.swagger-ui .opblock-body select{min-width:230px}@media (max-width:768px){.swagger-ui .opblock-body select{min-width:180px}}.swagger-ui label{font-size:12px;font-weight:700;margin:0 0 5px;font-family:sans-serif;color:#3b4151}.swagger-ui input[type=email],.swagger-ui input[type=file],.swagger-ui input[type=password],.swagger-ui input[type=search],.swagger-ui input[type=text],.swagger-ui textarea{min-width:100px;margin:5px 0;padding:8px 10px;border:1px solid #d9d9d9;border-radius:4px;background:#fff}@media (max-width:768px){.swagger-ui input[type=email],.swagger-ui input[type=file],.swagger-ui input[type=password],.swagger-ui input[type=search],.swagger-ui input[type=text],.swagger-ui textarea{max-width:175px}}.swagger-ui input[type=email].invalid,.swagger-ui input[type=file].invalid,.swagger-ui input[type=password].invalid,.swagger-ui input[type=search].invalid,.swagger-ui input[type=text].invalid,.swagger-ui textarea.invalid{-webkit-animation:shake .4s 1;animation:shake .4s 1;border-color:#f93e3e;background:#feebeb}.swagger-ui input[disabled],.swagger-ui select[disabled],.swagger-ui textarea[disabled]{background-color:#fafafa;color:#888;cursor:not-allowed}.swagger-ui select[disabled]{border-color:#888}.swagger-ui textarea[disabled]{background-color:#41444e;color:#fff}@-webkit-keyframes shake{10%,90%{-webkit-transform:translate3d(-1px,0,0);transform:translate3d(-1px,0,0)}20%,80%{-webkit-transform:translate3d(2px,0,0);transform:translate3d(2px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-4px,0,0);transform:translate3d(-4px,0,0)}40%,60%{-webkit-transform:translate3d(4px,0,0);transform:translate3d(4px,0,0)}}@keyframes shake{10%,90%{-webkit-transform:translate3d(-1px,0,0);transform:translate3d(-1px,0,0)}20%,80%{-webkit-transform:translate3d(2px,0,0);transform:translate3d(2px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-4px,0,0);transform:translate3d(-4px,0,0)}40%,60%{-webkit-transform:translate3d(4px,0,0);transform:translate3d(4px,0,0)}}.swagger-ui textarea{font-size:12px;width:100%;min-height:280px;padding:10px;border:none;border-radius:4px;outline:none;background:hsla(0,0%,100%,.8);font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui textarea:focus{border:2px solid #61affe}.swagger-ui textarea.curl{font-size:12px;min-height:100px;margin:0;padding:10px;resize:none;border-radius:4px;background:#41444e;font-family:monospace;font-weight:600;color:#fff}.swagger-ui .checkbox{padding:5px 0 10px;transition:opacity .5s;color:#303030}.swagger-ui .checkbox label{display:flex}.swagger-ui .checkbox p{font-weight:400!important;font-style:italic;margin:0!important;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui .checkbox input[type=checkbox]{display:none}.swagger-ui .checkbox input[type=checkbox]+label>.item{position:relative;top:3px;display:inline-block;width:16px;height:16px;margin:0 8px 0 0;padding:5px;cursor:pointer;border-radius:1px;background:#e8e8e8;box-shadow:0 0 0 2px #e8e8e8;flex:none}.swagger-ui .checkbox input[type=checkbox]+label>.item:active{-webkit-transform:scale(.9);transform:scale(.9)}.swagger-ui .checkbox input[type=checkbox]:checked+label>.item{background:#e8e8e8 url("data:image/svg+xml;charset=utf-8,%3Csvg width='10' height='8' viewBox='3 7 10 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%2341474E' fill-rule='evenodd' d='M6.333 15L3 11.667l1.333-1.334 2 2L11.667 7 13 8.333z'/%3E%3C/svg%3E") 50% no-repeat}.swagger-ui .dialog-ux{position:fixed;z-index:9999;top:0;right:0;bottom:0;left:0}.swagger-ui .dialog-ux .backdrop-ux{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.8)}.swagger-ui .dialog-ux .modal-ux{position:absolute;z-index:9999;top:50%;left:50%;width:100%;min-width:300px;max-width:650px;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);border:1px solid #ebebeb;border-radius:4px;background:#fff;box-shadow:0 10px 30px 0 rgba(0,0,0,.2)}.swagger-ui .dialog-ux .modal-ux-content{overflow-y:auto;max-height:540px;padding:20px}.swagger-ui .dialog-ux .modal-ux-content p{font-size:12px;margin:0 0 5px;color:#41444e;font-family:sans-serif;color:#3b4151}.swagger-ui .dialog-ux .modal-ux-content h4{font-size:18px;font-weight:600;margin:15px 0 0;font-family:sans-serif;color:#3b4151}.swagger-ui .dialog-ux .modal-ux-header{display:flex;padding:12px 0;border-bottom:1px solid #ebebeb;align-items:center}.swagger-ui .dialog-ux .modal-ux-header .close-modal{padding:0 10px;border:none;background:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.swagger-ui .dialog-ux .modal-ux-header h3{font-size:20px;font-weight:600;margin:0;padding:0 20px;flex:1;font-family:sans-serif;color:#3b4151}.swagger-ui .model{font-size:12px;font-weight:300;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui .model .deprecated span,.swagger-ui .model .deprecated td{color:#a0a0a0!important}.swagger-ui .model .deprecated>td:first-of-type{text-decoration:line-through}.swagger-ui .model-toggle{font-size:10px;position:relative;top:6px;display:inline-block;margin:auto .3em;cursor:pointer;transition:-webkit-transform .15s ease-in;transition:transform .15s ease-in;transition:transform .15s ease-in, -webkit-transform .15s ease-in;-webkit-transform:rotate(90deg);transform:rotate(90deg);-webkit-transform-origin:50% 50%;transform-origin:50% 50%}.swagger-ui .model-toggle.collapsed{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.swagger-ui .model-toggle:after{display:block;width:20px;height:20px;content:"";background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z'/%3E%3C/svg%3E") 50% no-repeat;background-size:100%}.swagger-ui .model-jump-to-path{position:relative;cursor:pointer}.swagger-ui .model-jump-to-path .view-line-link{position:absolute;top:-.4em;cursor:pointer}.swagger-ui .model-title{position:relative}.swagger-ui .model-title:hover .model-hint{visibility:visible}.swagger-ui .model-hint{position:absolute;top:-1.8em;visibility:hidden;padding:.1em .5em;white-space:nowrap;color:#ebebeb;border-radius:4px;background:rgba(0,0,0,.7)}.swagger-ui .model p{margin:0 0 1em}.swagger-ui section.models{margin:30px 0;border:1px solid rgba(59,65,81,.3);border-radius:4px}.swagger-ui section.models.is-open{padding:0 0 20px}.swagger-ui section.models.is-open h4{margin:0 0 5px;border-bottom:1px solid rgba(59,65,81,.3)}.swagger-ui section.models h4{font-size:16px;display:flex;align-items:center;margin:0;padding:10px 20px 10px 10px;cursor:pointer;transition:all .2s;font-family:sans-serif;color:#606060}.swagger-ui section.models h4 svg{transition:all .4s}.swagger-ui section.models h4 span{flex:1}.swagger-ui section.models h4:hover{background:rgba(0,0,0,.02)}.swagger-ui section.models h5{font-size:16px;margin:0 0 10px;font-family:sans-serif;color:#707070}.swagger-ui section.models .model-jump-to-path{position:relative;top:5px}.swagger-ui section.models .model-container{margin:0 20px 15px;position:relative;transition:all .5s;border-radius:4px;background:rgba(0,0,0,.05)}.swagger-ui section.models .model-container:hover{background:rgba(0,0,0,.07)}.swagger-ui section.models .model-container:first-of-type{margin:20px}.swagger-ui section.models .model-container:last-of-type{margin:0 20px}.swagger-ui section.models .model-container .models-jump-to-path{position:absolute;top:8px;right:5px;opacity:.65}.swagger-ui section.models .model-box{background:none}.swagger-ui .model-box{padding:10px;display:inline-block;border-radius:4px;background:rgba(0,0,0,.1)}.swagger-ui .model-box .model-jump-to-path{position:relative;top:4px}.swagger-ui .model-box.deprecated{opacity:.5}.swagger-ui .model-title{font-size:16px;font-family:sans-serif;color:#505050}.swagger-ui .model-deprecated-warning{font-size:16px;font-weight:600;margin-right:1em;font-family:sans-serif;color:#f93e3e}.swagger-ui span>span.model .brace-close{padding:0 0 0 10px}.swagger-ui .prop-name{display:inline-block;margin-right:1em}.swagger-ui .prop-type{color:#55a}.swagger-ui .prop-enum{display:block}.swagger-ui .prop-format{color:#606060}.swagger-ui .servers>label{font-size:12px;margin:-20px 15px 0 0;font-family:sans-serif;color:#3b4151}.swagger-ui .servers>label select{min-width:130px;max-width:100%}.swagger-ui .servers h4.message{padding-bottom:2em}.swagger-ui .servers table tr{width:30em}.swagger-ui .servers table td{display:inline-block;max-width:15em;vertical-align:middle;padding-top:10px;padding-bottom:10px}.swagger-ui .servers table td:first-of-type{padding-right:2em}.swagger-ui .servers table td input{width:100%;height:100%}.swagger-ui .servers .computed-url{margin:2em 0}.swagger-ui .servers .computed-url code{display:inline-block;padding:4px;font-size:16px;margin:0 1em}.swagger-ui .servers-title{font-size:12px;font-weight:700}.swagger-ui .operation-servers h4.message{margin-bottom:2em}.swagger-ui table{width:100%;padding:0 10px;border-collapse:collapse}.swagger-ui table.model tbody tr td{padding:0;vertical-align:top}.swagger-ui table.model tbody tr td:first-of-type{width:174px;padding:0 0 0 2em}.swagger-ui table.headers td{font-size:12px;font-weight:300;vertical-align:middle;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui table tbody tr td{padding:10px 0 0;vertical-align:top}.swagger-ui table tbody tr td:first-of-type{max-width:20%;min-width:6em;padding:10px 0}.swagger-ui table thead tr td,.swagger-ui table thead tr th{font-size:12px;font-weight:700;padding:12px 0;text-align:left;border-bottom:1px solid rgba(59,65,81,.2);font-family:sans-serif;color:#3b4151}.swagger-ui .parameters-col_description{width:99%;margin-bottom:2em}.swagger-ui .parameters-col_description input[type=text]{width:100%;max-width:340px}.swagger-ui .parameters-col_description select{border-width:1px}.swagger-ui .parameter__name{font-size:16px;font-weight:400;margin-right:.75em;font-family:sans-serif;color:#3b4151}.swagger-ui .parameter__name.required{font-weight:700}.swagger-ui .parameter__name.required:after{font-size:10px;position:relative;top:-6px;padding:5px;content:"required";color:rgba(255,0,0,.6)}.swagger-ui .parameter__extension,.swagger-ui .parameter__in{font-size:12px;font-style:italic;font-family:monospace;font-weight:600;color:grey}.swagger-ui .parameter__deprecated{font-size:12px;font-style:italic;font-family:monospace;font-weight:600;color:red}.swagger-ui .parameter__empty_value_toggle{font-size:13px;padding-top:5px;padding-bottom:12px}.swagger-ui .parameter__empty_value_toggle input{margin-right:7px}.swagger-ui .parameter__empty_value_toggle.disabled{opacity:.7}.swagger-ui .table-container{padding:20px}.swagger-ui .response-col_description{width:99%}.swagger-ui .response-col_links{min-width:6em}.swagger-ui .topbar{padding:10px 0;background-color:#1b1b1b}.swagger-ui .topbar .topbar-wrapper,.swagger-ui .topbar a{display:flex;align-items:center}.swagger-ui .topbar a{font-size:1.5em;font-weight:700;flex:1;max-width:300px;text-decoration:none;font-family:sans-serif;color:#fff}.swagger-ui .topbar a span{margin:0;padding:0 10px}.swagger-ui .topbar .download-url-wrapper{display:flex;flex:3;justify-content:flex-end}.swagger-ui .topbar .download-url-wrapper input[type=text]{width:100%;margin:0;border:2px solid #62a03f;border-radius:4px 0 0 4px;outline:none}.swagger-ui .topbar .download-url-wrapper .select-label{display:flex;align-items:center;width:100%;max-width:600px;margin:0;color:#f0f0f0}.swagger-ui .topbar .download-url-wrapper .select-label span{font-size:16px;flex:1;padding:0 10px 0 0;text-align:right}.swagger-ui .topbar .download-url-wrapper .select-label select{flex:2;width:100%;border:2px solid #62a03f;outline:none;box-shadow:none}.swagger-ui .topbar .download-url-wrapper .download-url-button{font-size:16px;font-weight:700;padding:4px 30px;border:none;border-radius:0 4px 4px 0;background:#62a03f;font-family:sans-serif;color:#fff}.swagger-ui .info{margin:50px 0}.swagger-ui .info hgroup.main{margin:0 0 20px}.swagger-ui .info hgroup.main a{font-size:12px}.swagger-ui .info pre{font-size:14px}.swagger-ui .info li,.swagger-ui .info p,.swagger-ui .info table{font-size:14px;font-family:sans-serif;color:#3b4151}.swagger-ui .info h1,.swagger-ui .info h2,.swagger-ui .info h3,.swagger-ui .info h4,.swagger-ui .info h5{font-family:sans-serif;color:#3b4151}.swagger-ui .info a{font-size:14px;transition:all .4s;font-family:sans-serif;color:#4990e2}.swagger-ui .info a:hover{color:#1f69c0}.swagger-ui .info>div{margin:0 0 5px}.swagger-ui .info .base-url{font-size:12px;font-weight:300!important;margin:0;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui .info .title{font-size:36px;margin:0;font-family:sans-serif;color:#3b4151}.swagger-ui .info .title small{font-size:10px;position:relative;top:-5px;display:inline-block;margin:0 0 0 5px;padding:2px 4px;vertical-align:super;border-radius:57px;background:#7d8492}.swagger-ui .info .title small pre{margin:0;padding:0;font-family:sans-serif;color:#fff}.swagger-ui .auth-btn-wrapper{display:flex;padding:10px 0;justify-content:center}.swagger-ui .auth-btn-wrapper .btn-done{margin-right:1em}.swagger-ui .auth-wrapper{display:flex;flex:1;justify-content:flex-end}.swagger-ui .auth-wrapper .authorize{padding-right:20px;margin-right:10px}.swagger-ui .auth-container{margin:0 0 10px;padding:10px 20px;border-bottom:1px solid #ebebeb}.swagger-ui .auth-container:last-of-type{margin:0;padding:10px 20px;border:0}.swagger-ui .auth-container h4{margin:5px 0 15px!important}.swagger-ui .auth-container .wrapper{margin:0;padding:0}.swagger-ui .auth-container input[type=password],.swagger-ui .auth-container input[type=text]{min-width:230px}.swagger-ui .auth-container .errors{font-size:12px;padding:10px;border-radius:4px;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui .scopes h2{font-size:14px;font-family:sans-serif;color:#3b4151}.swagger-ui .scope-def{padding:0 0 20px}.swagger-ui .errors-wrapper{margin:20px;padding:10px 20px;-webkit-animation:scaleUp .5s;animation:scaleUp .5s;border:2px solid #f93e3e;border-radius:4px;background:rgba(249,62,62,.1)}.swagger-ui .errors-wrapper .error-wrapper{margin:0 0 10px}.swagger-ui .errors-wrapper .errors h4{font-size:14px;margin:0;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui .errors-wrapper .errors small{color:#606060}.swagger-ui .errors-wrapper hgroup{display:flex;align-items:center}.swagger-ui .errors-wrapper hgroup h4{font-size:20px;margin:0;flex:1;font-family:sans-serif;color:#3b4151}@-webkit-keyframes scaleUp{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes scaleUp{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}.swagger-ui .Resizer.vertical.disabled{display:none}.swagger-ui .markdown p,.swagger-ui .markdown pre,.swagger-ui .renderedMarkdown p,.swagger-ui .renderedMarkdown pre{margin:1em auto}.swagger-ui .markdown pre,.swagger-ui .renderedMarkdown pre{color:#000;font-weight:400;white-space:pre-wrap;background:none;padding:0}.swagger-ui .markdown code,.swagger-ui .renderedMarkdown code{font-size:14px;padding:5px 7px;border-radius:4px;background:rgba(0,0,0,.05);font-family:monospace;font-weight:600;color:#9012fe}.swagger-ui .markdown pre>code,.swagger-ui .renderedMarkdown pre>code{display:block} + /*# sourceMappingURL=swagger-ui.css.map*/ \ No newline at end of file diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui-bundle.min.js b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui-bundle.min.js old mode 100644 new mode 100755 index 453934ea5362..16e565238e4a --- a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui-bundle.min.js +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui-bundle.min.js @@ -1,22 +1,35 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUIBundle=t():e.SwaggerUIBundle=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist",t(t.s=1213)}([function(e,t,n){"use strict";e.exports=n(92)},function(e,t,n){e.exports=n(996)()},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(331),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,i.default)(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}()},function(e,t,n){e.exports={default:n(592),__esModule:!0}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(565),o=r(i),a=n(330),s=r(a),u=n(48),l=r(u);t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,l.default)(t)));e.prototype=(0,s.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(o.default?(0,o.default)(e,t):e.__proto__=t)}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(48),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,i.default)(t))&&"function"!=typeof t?e:t}},function(e,t,n){!function(t,n){e.exports=n()}(0,function(){"use strict";function e(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function t(e){return o(e)?e:O(e)}function n(e){return a(e)?e:M(e)}function r(e){return s(e)?e:T(e)}function i(e){return o(e)&&!u(e)?e:P(e)}function o(e){return!(!e||!e[ln])}function a(e){return!(!e||!e[cn])}function s(e){return!(!e||!e[pn])}function u(e){return a(e)||s(e)}function l(e){return!(!e||!e[fn])}function c(e){return e.value=!1,e}function p(e){e&&(e.value=!0)}function f(){}function h(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),i=0;i<n;i++)r[i]=e[i+t];return r}function d(e){return void 0===e.size&&(e.size=e.__iterate(v)),e.size}function m(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?d(e)+t:t}function v(){return!0}function g(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function y(e,t){return b(e,t,0)}function _(e,t){return b(e,t,t)}function b(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}function x(e){this.next=e}function w(e,t,n,r){var i=0===e?t:1===e?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function k(){return{value:void 0,done:!0}}function E(e){return!!A(e)}function S(e){return e&&"function"==typeof e.next}function C(e){var t=A(e);return t&&t.call(e)}function A(e){var t=e&&(wn&&e[wn]||e[kn]);if("function"==typeof t)return t}function D(e){return e&&"number"==typeof e.length}function O(e){return null===e||void 0===e?B():o(e)?e.toSeq():z(e)}function M(e){return null===e||void 0===e?B().toKeyedSeq():o(e)?a(e)?e.toSeq():e.fromEntrySeq():L(e)}function T(e){return null===e||void 0===e?B():o(e)?a(e)?e.entrySeq():e.toIndexedSeq():q(e)}function P(e){return(null===e||void 0===e?B():o(e)?a(e)?e.entrySeq():e:q(e)).toSetSeq()}function I(e){this._array=e,this.size=e.length}function R(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function j(e){this._iterable=e,this.size=e.length||e.size}function F(e){this._iterator=e,this._iteratorCache=[]}function N(e){return!(!e||!e[Sn])}function B(){return Cn||(Cn=new I([]))}function L(e){var t=Array.isArray(e)?new I(e).fromEntrySeq():S(e)?new F(e).fromEntrySeq():E(e)?new j(e).fromEntrySeq():"object"==typeof e?new R(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function q(e){var t=U(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function z(e){var t=U(e)||"object"==typeof e&&new R(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}function U(e){return D(e)?new I(e):S(e)?new F(e):E(e)?new j(e):void 0}function W(e,t,n,r){var i=e._cache;if(i){for(var o=i.length-1,a=0;a<=o;a++){var s=i[n?o-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function V(e,t,n,r){var i=e._cache;if(i){var o=i.length-1,a=0;return new x(function(){var e=i[n?o-a:a];return a++>o?k():w(t,r?e[0]:a-1,e[1])})}return e.__iteratorUncached(t,n)}function H(e,t){return t?G(t,e,"",{"":e}):J(e)}function G(e,t,n,r){return Array.isArray(t)?e.call(r,n,T(t).map(function(n,r){return G(e,n,r,t)})):K(t)?e.call(r,n,M(t).map(function(n,r){return G(e,n,r,t)})):t}function J(e){return Array.isArray(e)?T(e).map(J).toList():K(e)?M(e).map(J).toMap():e}function K(e){return e&&(e.constructor===Object||void 0===e.constructor)}function X(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function Y(e,t){if(e===t)return!0;if(!o(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||a(e)!==a(t)||s(e)!==s(t)||l(e)!==l(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!u(e);if(l(e)){var r=e.entries();return t.every(function(e,t){var i=r.next().value;return i&&X(i[1],e)&&(n||X(i[0],t))})&&r.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var c=e;e=t,t=c}var p=!0,f=t.__iterate(function(t,r){if(n?!e.has(t):i?!X(t,e.get(r,vn)):!X(e.get(r,vn),t))return p=!1,!1});return p&&e.size===f}function $(e,t){if(!(this instanceof $))return new $(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(An)return An;An=this}}function Z(e,t){if(!e)throw new Error(t)}function Q(e,t,n){if(!(this instanceof Q))return new Q(e,t,n);if(Z(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t<e&&(n=-n),this._start=e,this._end=t,this._step=n,this.size=Math.max(0,Math.ceil((t-e)/n-1)+1),0===this.size){if(Dn)return Dn;Dn=this}}function ee(){throw TypeError("Abstract")}function te(){}function ne(){}function re(){}function ie(e){return e>>>1&1073741824|3221225471&e}function oe(e){if(!1===e||null===e||void 0===e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null===e||void 0===e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!==e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)e/=4294967295,n^=e;return ie(n)}if("string"===t)return e.length>Fn?ae(e):se(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return ue(e);if("function"==typeof e.toString)return se(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function ae(e){var t=Ln[e];return void 0===t&&(t=se(e),Bn===Nn&&(Bn=0,Ln={}),Bn++,Ln[e]=t),t}function se(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return ie(t)}function ue(e){var t;if(In&&void 0!==(t=On.get(e)))return t;if(void 0!==(t=e[jn]))return t;if(!Pn){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[jn]))return t;if(void 0!==(t=le(e)))return t}if(t=++Rn,1073741824&Rn&&(Rn=0),In)On.set(e,t);else{if(void 0!==Tn&&!1===Tn(e))throw new Error("Non-extensible objects are not allowed as keys.");if(Pn)Object.defineProperty(e,jn,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[jn]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[jn]=t}}return t}function le(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function ce(e){Z(e!==1/0,"Cannot perform this action with an infinite size.")}function pe(e){return null===e||void 0===e?we():fe(e)&&!l(e)?e:we().withMutations(function(t){var r=n(e);ce(r.size),r.forEach(function(e,n){return t.set(n,e)})})}function fe(e){return!(!e||!e[qn])}function he(e,t){this.ownerID=e,this.entries=t}function de(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function me(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function ve(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function ge(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function ye(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&be(e._root)}function _e(e,t){return w(e,t[0],t[1])}function be(e,t){return{node:e,index:0,__prev:t}}function xe(e,t,n,r){var i=Object.create(zn);return i.size=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function we(){return Un||(Un=xe(0))}function ke(e,t,n){var r,i;if(e._root){var o=c(gn),a=c(yn);if(r=Ee(e._root,e.__ownerID,0,void 0,t,n,o,a),!a.value)return e;i=e.size+(o.value?n===vn?-1:1:0)}else{if(n===vn)return e;i=1,r=new he(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=i,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?xe(i,r):we()}function Ee(e,t,n,r,i,o,a,s){return e?e.update(t,n,r,i,o,a,s):o===vn?e:(p(s),p(a),new ge(t,r,[i,o]))}function Se(e){return e.constructor===ge||e.constructor===ve}function Ce(e,t,n,r,i){if(e.keyHash===r)return new ve(t,r,[e.entry,i]);var o,a=(0===n?e.keyHash:e.keyHash>>>n)&mn,s=(0===n?r:r>>>n)&mn;return new de(t,1<<a|1<<s,a===s?[Ce(e,t,n+hn,r,i)]:(o=new ge(t,r,i),a<s?[e,o]:[o,e]))}function Ae(e,t,n,r){e||(e=new f);for(var i=new ge(e,oe(n),[n,r]),o=0;o<t.length;o++){var a=t[o];i=i.update(e,0,void 0,a[0],a[1])}return i}function De(e,t,n,r){for(var i=0,o=0,a=new Array(n),s=0,u=1,l=t.length;s<l;s++,u<<=1){var c=t[s];void 0!==c&&s!==r&&(i|=u,a[o++]=c)}return new de(e,i,a)}function Oe(e,t,n,r,i){for(var o=0,a=new Array(dn),s=0;0!==n;s++,n>>>=1)a[s]=1&n?t[o++]:void 0;return a[r]=i,new me(e,o+1,a)}function Me(e,t,r){for(var i=[],a=0;a<r.length;a++){var s=r[a],u=n(s);o(s)||(u=u.map(function(e){return H(e)})),i.push(u)}return Ie(e,t,i)}function Te(e,t,n){return e&&e.mergeDeep&&o(t)?e.mergeDeep(t):X(e,t)?e:t}function Pe(e){return function(t,n,r){if(t&&t.mergeDeepWith&&o(n))return t.mergeDeepWith(e,n);var i=e(t,n,r);return X(t,i)?t:i}}function Ie(e,t,n){return n=n.filter(function(e){return 0!==e.size}),0===n.length?e:0!==e.size||e.__ownerID||1!==n.length?e.withMutations(function(e){for(var r=t?function(n,r){e.update(r,vn,function(e){return e===vn?n:t(e,n,r)})}:function(t,n){e.set(n,t)},i=0;i<n.length;i++)n[i].forEach(r)}):e.constructor(n[0])}function Re(e,t,n,r){var i=e===vn,o=t.next();if(o.done){var a=i?n:e,s=r(a);return s===a?e:s}Z(i||e&&e.set,"invalid keyPath");var u=o.value,l=i?vn:e.get(u,vn),c=Re(l,t,n,r);return c===l?e:c===vn?e.remove(u):(i?we():e).set(u,c)}function je(e){return e-=e>>1&1431655765,e=(858993459&e)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function Fe(e,t,n,r){var i=r?e:h(e);return i[t]=n,i}function Ne(e,t,n,r){var i=e.length+1;if(r&&t+1===i)return e[t]=n,e;for(var o=new Array(i),a=0,s=0;s<i;s++)s===t?(o[s]=n,a=-1):o[s]=e[s+a];return o}function Be(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var i=new Array(r),o=0,a=0;a<r;a++)a===t&&(o=1),i[a]=e[a+o];return i}function Le(e){var t=Ve();if(null===e||void 0===e)return t;if(qe(e))return e;var n=r(e),i=n.size;return 0===i?t:(ce(i),i>0&&i<dn?We(0,i,hn,null,new ze(n.toArray())):t.withMutations(function(e){e.setSize(i),n.forEach(function(t,n){return e.set(n,t)})}))}function qe(e){return!(!e||!e[Gn])}function ze(e,t){this.array=e,this.ownerID=t}function Ue(e,t){function n(e,t,n){return 0===t?r(e,n):i(e,t,n)}function r(e,n){var r=n===s?u&&u.array:e&&e.array,i=n>o?0:o-n,l=a-n;return l>dn&&(l=dn),function(){if(i===l)return Xn;var e=t?--l:i++;return r&&r[e]}}function i(e,r,i){var s,u=e&&e.array,l=i>o?0:o-i>>r,c=1+(a-i>>r);return c>dn&&(c=dn),function(){for(;;){if(s){var e=s();if(e!==Xn)return e;s=null}if(l===c)return Xn;var o=t?--c:l++;s=n(u&&u[o],r-hn,i+(o<<r))}}}var o=e._origin,a=e._capacity,s=$e(a),u=e._tail;return n(e._root,e._level,0)}function We(e,t,n,r,i,o,a){var s=Object.create(Jn);return s.size=t-e,s._origin=e,s._capacity=t,s._level=n,s._root=r,s._tail=i,s.__ownerID=o,s.__hash=a,s.__altered=!1,s}function Ve(){return Kn||(Kn=We(0,0,hn))}function He(e,t,n){if((t=m(e,t))!==t)return e;if(t>=e.size||t<0)return e.withMutations(function(e){t<0?Xe(e,t).set(0,n):Xe(e,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,i=e._root,o=c(yn);return t>=$e(e._capacity)?r=Ge(r,e.__ownerID,0,t,n,o):i=Ge(i,e.__ownerID,e._level,t,n,o),o.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):We(e._origin,e._capacity,e._level,i,r):e}function Ge(e,t,n,r,i,o){var a=r>>>n&mn,s=e&&a<e.array.length;if(!s&&void 0===i)return e;var u;if(n>0){var l=e&&e.array[a],c=Ge(l,t,n-hn,r,i,o);return c===l?e:(u=Je(e,t),u.array[a]=c,u)}return s&&e.array[a]===i?e:(p(o),u=Je(e,t),void 0===i&&a===u.array.length-1?u.array.pop():u.array[a]=i,u)}function Je(e,t){return t&&e&&t===e.ownerID?e:new ze(e?e.array.slice():[],t)}function Ke(e,t){if(t>=$e(e._capacity))return e._tail;if(t<1<<e._level+hn){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&mn],r-=hn;return n}}function Xe(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new f,i=e._origin,o=e._capacity,a=i+t,s=void 0===n?o:n<0?o+n:i+n;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var u=e._level,l=e._root,c=0;a+c<0;)l=new ze(l&&l.array.length?[void 0,l]:[],r),u+=hn,c+=1<<u;c&&(a+=c,i+=c,s+=c,o+=c);for(var p=$e(o),h=$e(s);h>=1<<u+hn;)l=new ze(l&&l.array.length?[l]:[],r),u+=hn;var d=e._tail,m=h<p?Ke(e,s-1):h>p?new ze([],r):d;if(d&&h>p&&a<o&&d.array.length){l=Je(l,r);for(var v=l,g=u;g>hn;g-=hn){var y=p>>>g&mn;v=v.array[y]=Je(v.array[y],r)}v.array[p>>>hn&mn]=d}if(s<o&&(m=m&&m.removeAfter(r,0,s)),a>=h)a-=h,s-=h,u=hn,l=null,m=m&&m.removeBefore(r,0,a);else if(a>i||h<p){for(c=0;l;){var _=a>>>u&mn;if(_!==h>>>u&mn)break;_&&(c+=(1<<u)*_),u-=hn,l=l.array[_]}l&&a>i&&(l=l.removeBefore(r,u,a-c)),l&&h<p&&(l=l.removeAfter(r,u,h-c)),c&&(a-=c,s-=c)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=u,e._root=l,e._tail=m,e.__hash=void 0,e.__altered=!0,e):We(a,s,u,l,m)}function Ye(e,t,n){for(var i=[],a=0,s=0;s<n.length;s++){var u=n[s],l=r(u);l.size>a&&(a=l.size),o(u)||(l=l.map(function(e){return H(e)})),i.push(l)}return a>e.size&&(e=e.setSize(a)),Ie(e,t,i)}function $e(e){return e<dn?0:e-1>>>hn<<hn}function Ze(e){return null===e||void 0===e?tt():Qe(e)?e:tt().withMutations(function(t){var r=n(e);ce(r.size),r.forEach(function(e,n){return t.set(n,e)})})}function Qe(e){return fe(e)&&l(e)}function et(e,t,n,r){var i=Object.create(Ze.prototype);return i.size=e?e.size:0,i._map=e,i._list=t,i.__ownerID=n,i.__hash=r,i}function tt(){return Yn||(Yn=et(we(),Ve()))}function nt(e,t,n){var r,i,o=e._map,a=e._list,s=o.get(t),u=void 0!==s;if(n===vn){if(!u)return e;a.size>=dn&&a.size>=2*o.size?(i=a.filter(function(e,t){return void 0!==e&&s!==t}),r=i.toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(r.__ownerID=i.__ownerID=e.__ownerID)):(r=o.remove(t),i=s===a.size-1?a.pop():a.set(s,void 0))}else if(u){if(n===a.get(s)[1])return e;r=o,i=a.set(s,[t,n])}else r=o.set(t,a.size),i=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=i,e.__hash=void 0,e):et(r,i)}function rt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function it(e){this._iter=e,this.size=e.size}function ot(e){this._iter=e,this.size=e.size}function at(e){this._iter=e,this.size=e.size}function st(e){var t=Dt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Ot,t.__iterateUncached=function(t,n){var r=this;return e.__iterate(function(e,n){return!1!==t(n,e,r)},n)},t.__iteratorUncached=function(t,n){if(t===xn){var r=e.__iterator(t,n);return new x(function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===bn?_n:bn,n)},t}function ut(e,t,n){var r=Dt(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,i){var o=e.get(r,vn);return o===vn?i:t.call(n,o,r,e)},r.__iterateUncached=function(r,i){var o=this;return e.__iterate(function(e,i,a){return!1!==r(t.call(n,e,i,a),i,o)},i)},r.__iteratorUncached=function(r,i){var o=e.__iterator(xn,i);return new x(function(){var i=o.next();if(i.done)return i;var a=i.value,s=a[0];return w(r,s,t.call(n,a[1],s,e),i)})},r}function lt(e,t){var n=Dt(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=st(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=Ot,n.__iterate=function(t,n){var r=this;return e.__iterate(function(e,n){return t(e,n,r)},!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function ct(e,t,n,r){var i=Dt(e);return r&&(i.has=function(r){var i=e.get(r,vn);return i!==vn&&!!t.call(n,i,r,e)},i.get=function(r,i){var o=e.get(r,vn);return o!==vn&&t.call(n,o,r,e)?o:i}),i.__iterateUncached=function(i,o){var a=this,s=0;return e.__iterate(function(e,o,u){if(t.call(n,e,o,u))return s++,i(e,r?o:s-1,a)},o),s},i.__iteratorUncached=function(i,o){var a=e.__iterator(xn,o),s=0;return new x(function(){for(;;){var o=a.next();if(o.done)return o;var u=o.value,l=u[0],c=u[1];if(t.call(n,c,l,e))return w(i,r?l:s++,c,o)}})},i}function pt(e,t,n){var r=pe().asMutable();return e.__iterate(function(i,o){r.update(t.call(n,i,o,e),0,function(e){return e+1})}),r.asImmutable()}function ft(e,t,n){var r=a(e),i=(l(e)?Ze():pe()).asMutable();e.__iterate(function(o,a){i.update(t.call(n,o,a,e),function(e){return e=e||[],e.push(r?[a,o]:o),e})});var o=At(e);return i.map(function(t){return Et(e,o(t))})}function ht(e,t,n,r){var i=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=i:n|=0),g(t,n,i))return e;var o=y(t,i),a=_(n,i);if(o!==o||a!==a)return ht(e.toSeq().cacheResult(),t,n,r);var s,u=a-o;u===u&&(s=u<0?0:u);var l=Dt(e);return l.size=0===s?s:e.size&&s||void 0,!r&&N(e)&&s>=0&&(l.get=function(t,n){return t=m(this,t),t>=0&&t<s?e.get(t+o,n):n}),l.__iterateUncached=function(t,n){var i=this;if(0===s)return 0;if(n)return this.cacheResult().__iterate(t,n);var a=0,u=!0,l=0;return e.__iterate(function(e,n){if(!u||!(u=a++<o))return l++,!1!==t(e,r?n:l-1,i)&&l!==s}),l},l.__iteratorUncached=function(t,n){if(0!==s&&n)return this.cacheResult().__iterator(t,n);var i=0!==s&&e.__iterator(t,n),a=0,u=0;return new x(function(){for(;a++<o;)i.next();if(++u>s)return k();var e=i.next();return r||t===bn?e:t===_n?w(t,u-1,void 0,e):w(t,u-1,e.value[1],e)})},l}function dt(e,t,n){var r=Dt(e);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var a=0;return e.__iterate(function(e,i,s){return t.call(n,e,i,s)&&++a&&r(e,i,o)}),a},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var a=e.__iterator(xn,i),s=!0;return new x(function(){if(!s)return k();var e=a.next();if(e.done)return e;var i=e.value,u=i[0],l=i[1];return t.call(n,l,u,o)?r===xn?e:w(r,u,l,e):(s=!1,k())})},r}function mt(e,t,n,r){var i=Dt(e);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,u=0;return e.__iterate(function(e,o,l){if(!s||!(s=t.call(n,e,o,l)))return u++,i(e,r?o:u-1,a)}),u},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(xn,o),u=!0,l=0;return new x(function(){var e,o,c;do{if(e=s.next(),e.done)return r||i===bn?e:i===_n?w(i,l++,void 0,e):w(i,l++,e.value[1],e);var p=e.value;o=p[0],c=p[1],u&&(u=t.call(n,c,o,a))}while(u);return i===xn?e:w(i,o,c,e)})},i}function vt(e,t){var r=a(e),i=[e].concat(t).map(function(e){return o(e)?r&&(e=n(e)):e=r?L(e):q(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===i.length)return e;if(1===i.length){var u=i[0];if(u===e||r&&a(u)||s(e)&&s(u))return u}var l=new I(i);return r?l=l.toKeyedSeq():s(e)||(l=l.toSetSeq()),l=l.flatten(!0),l.size=i.reduce(function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}},0),l}function gt(e,t,n){var r=Dt(e);return r.__iterateUncached=function(r,i){function a(e,l){var c=this;e.__iterate(function(e,i){return(!t||l<t)&&o(e)?a(e,l+1):!1===r(e,n?i:s++,c)&&(u=!0),!u},i)}var s=0,u=!1;return a(e,0),s},r.__iteratorUncached=function(r,i){var a=e.__iterator(r,i),s=[],u=0;return new x(function(){for(;a;){var e=a.next();if(!1===e.done){var l=e.value;if(r===xn&&(l=l[1]),t&&!(s.length<t)||!o(l))return n?e:w(r,u++,l,e);s.push(a),a=l.__iterator(r,i)}else a=s.pop()}return k()})},r}function yt(e,t,n){var r=At(e);return e.toSeq().map(function(i,o){return r(t.call(n,i,o,e))}).flatten(!0)}function _t(e,t){var n=Dt(e);return n.size=e.size&&2*e.size-1,n.__iterateUncached=function(n,r){var i=this,o=0;return e.__iterate(function(e,r){return(!o||!1!==n(t,o++,i))&&!1!==n(e,o++,i)},r),o},n.__iteratorUncached=function(n,r){var i,o=e.__iterator(bn,r),a=0;return new x(function(){return(!i||a%2)&&(i=o.next(),i.done)?i:a%2?w(n,a++,t):w(n,a++,i.value,i)})},n}function bt(e,t,n){t||(t=Mt);var r=a(e),i=0,o=e.toSeq().map(function(t,r){return[r,t,i++,n?n(t,r,e):t]}).toArray();return o.sort(function(e,n){return t(e[3],n[3])||e[2]-n[2]}).forEach(r?function(e,t){o[t].length=2}:function(e,t){o[t]=e[1]}),r?M(o):s(e)?T(o):P(o)}function xt(e,t,n){if(t||(t=Mt),n){var r=e.toSeq().map(function(t,r){return[t,n(t,r,e)]}).reduce(function(e,n){return wt(t,e[1],n[1])?n:e});return r&&r[0]}return e.reduce(function(e,n){return wt(t,e,n)?n:e})}function wt(e,t,n){var r=e(n,t);return 0===r&&n!==t&&(void 0===n||null===n||n!==n)||r>0}function kt(e,n,r){var i=Dt(e);return i.size=new I(r).map(function(e){return e.size}).min(),i.__iterate=function(e,t){for(var n,r=this.__iterator(bn,t),i=0;!(n=r.next()).done&&!1!==e(n.value,i++,this););return i},i.__iteratorUncached=function(e,i){var o=r.map(function(e){return e=t(e),C(i?e.reverse():e)}),a=0,s=!1;return new x(function(){var t;return s||(t=o.map(function(e){return e.next()}),s=t.some(function(e){return e.done})),s?k():w(e,a++,n.apply(null,t.map(function(e){return e.value})))})},i}function Et(e,t){return N(e)?t:e.constructor(t)}function St(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Ct(e){return ce(e.size),d(e)}function At(e){return a(e)?n:s(e)?r:i}function Dt(e){return Object.create((a(e)?M:s(e)?T:P).prototype)}function Ot(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):O.prototype.cacheResult.call(this)}function Mt(e,t){return e>t?1:e<t?-1:0}function Tt(e){var n=C(e);if(!n){if(!D(e))throw new TypeError("Expected iterable or array-like: "+e);n=C(t(e))}return n}function Pt(e,t){var n,r=function(o){if(o instanceof r)return o;if(!(this instanceof r))return new r(o);if(!n){n=!0;var a=Object.keys(e);jt(i,a),i.size=a.length,i._name=t,i._keys=a,i._defaultValues=e}this._map=pe(o)},i=r.prototype=Object.create($n);return i.constructor=r,r}function It(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._map=t,r.__ownerID=n,r}function Rt(e){return e._name||e.constructor.name||"Record"}function jt(e,t){try{t.forEach(Ft.bind(void 0,e))}catch(e){}}function Ft(e,t){Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){Z(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}function Nt(e){return null===e||void 0===e?zt():Bt(e)&&!l(e)?e:zt().withMutations(function(t){var n=i(e);ce(n.size),n.forEach(function(e){return t.add(e)})})}function Bt(e){return!(!e||!e[Zn])}function Lt(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function qt(e,t){var n=Object.create(Qn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function zt(){return er||(er=qt(we()))}function Ut(e){return null===e||void 0===e?Ht():Wt(e)?e:Ht().withMutations(function(t){var n=i(e);ce(n.size),n.forEach(function(e){return t.add(e)})})}function Wt(e){return Bt(e)&&l(e)}function Vt(e,t){var n=Object.create(tr);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function Ht(){return nr||(nr=Vt(tt()))}function Gt(e){return null===e||void 0===e?Xt():Jt(e)?e:Xt().unshiftAll(e)}function Jt(e){return!(!e||!e[rr])}function Kt(e,t,n,r){var i=Object.create(ir);return i.size=e,i._head=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function Xt(){return or||(or=Kt(0))}function Yt(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}function $t(e,t){return t}function Zt(e,t){return[t,e]}function Qt(e){return function(){return!e.apply(this,arguments)}}function en(e){return function(){return-e.apply(this,arguments)}}function tn(e){return"string"==typeof e?JSON.stringify(e):String(e)}function nn(){return h(arguments)}function rn(e,t){return e<t?1:e>t?-1:0}function on(e){if(e.size===1/0)return 0;var t=l(e),n=a(e),r=t?1:0;return an(e.__iterate(n?t?function(e,t){r=31*r+sn(oe(e),oe(t))|0}:function(e,t){r=r+sn(oe(e),oe(t))|0}:t?function(e){r=31*r+oe(e)|0}:function(e){r=r+oe(e)|0}),r)}function an(e,t){return t=Mn(t,3432918353),t=Mn(t<<15|t>>>-15,461845907),t=Mn(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=Mn(t^t>>>16,2246822507),t=Mn(t^t>>>13,3266489909),t=ie(t^t>>>16)}function sn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}var un=Array.prototype.slice;e(n,t),e(r,t),e(i,t),t.isIterable=o,t.isKeyed=a,t.isIndexed=s,t.isAssociative=u,t.isOrdered=l,t.Keyed=n,t.Indexed=r,t.Set=i;var ln="@@__IMMUTABLE_ITERABLE__@@",cn="@@__IMMUTABLE_KEYED__@@",pn="@@__IMMUTABLE_INDEXED__@@",fn="@@__IMMUTABLE_ORDERED__@@",hn=5,dn=1<<hn,mn=dn-1,vn={},gn={value:!1},yn={value:!1},_n=0,bn=1,xn=2,wn="function"==typeof Symbol&&Symbol.iterator,kn="@@iterator",En=wn||kn;x.prototype.toString=function(){return"[Iterator]"},x.KEYS=_n,x.VALUES=bn,x.ENTRIES=xn,x.prototype.inspect=x.prototype.toSource=function(){return this.toString()},x.prototype[En]=function(){return this},e(O,t),O.of=function(){return O(arguments)},O.prototype.toSeq=function(){return this},O.prototype.toString=function(){return this.__toString("Seq {","}")},O.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},O.prototype.__iterate=function(e,t){return W(this,e,t,!0)},O.prototype.__iterator=function(e,t){return V(this,e,t,!0)},e(M,O),M.prototype.toKeyedSeq=function(){return this},e(T,O),T.of=function(){return T(arguments)},T.prototype.toIndexedSeq=function(){return this},T.prototype.toString=function(){return this.__toString("Seq [","]")},T.prototype.__iterate=function(e,t){return W(this,e,t,!1)},T.prototype.__iterator=function(e,t){return V(this,e,t,!1)},e(P,O),P.of=function(){return P(arguments)},P.prototype.toSetSeq=function(){return this},O.isSeq=N,O.Keyed=M,O.Set=P,O.Indexed=T;var Sn="@@__IMMUTABLE_SEQ__@@";O.prototype[Sn]=!0,e(I,T),I.prototype.get=function(e,t){return this.has(e)?this._array[m(this,e)]:t},I.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length-1,i=0;i<=r;i++)if(!1===e(n[t?r-i:i],i,this))return i+1;return i},I.prototype.__iterator=function(e,t){var n=this._array,r=n.length-1,i=0;return new x(function(){return i>r?k():w(e,i,n[t?r-i++:i++])})},e(R,M),R.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},R.prototype.has=function(e){return this._object.hasOwnProperty(e)},R.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var a=r[t?i-o:o];if(!1===e(n[a],a,this))return o+1}return o},R.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,i=r.length-1,o=0;return new x(function(){var a=r[t?i-o:o];return o++>i?k():w(e,a,n[a])})},R.prototype[fn]=!0,e(j,T),j.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=this._iterable,r=C(n),i=0;if(S(r))for(var o;!(o=r.next()).done&&!1!==e(o.value,i++,this););return i},j.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterable,r=C(n);if(!S(r))return new x(k);var i=0;return new x(function(){var t=r.next();return t.done?t:w(e,i++,t.value)})},e(F,T),F.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n=this._iterator,r=this._iteratorCache,i=0;i<r.length;)if(!1===e(r[i],i++,this))return i;for(var o;!(o=n.next()).done;){var a=o.value;if(r[i]=a,!1===e(a,i++,this))break}return i},F.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterator,r=this._iteratorCache,i=0;return new x(function(){if(i>=r.length){var t=n.next();if(t.done)return t;r[i]=t.value}return w(e,i,r[i++])})};var Cn;e($,T),$.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},$.prototype.get=function(e,t){return this.has(e)?this._value:t},$.prototype.includes=function(e){return X(this._value,e)},$.prototype.slice=function(e,t){var n=this.size;return g(e,t,n)?this:new $(this._value,_(t,n)-y(e,n))},$.prototype.reverse=function(){return this},$.prototype.indexOf=function(e){return X(this._value,e)?0:-1},$.prototype.lastIndexOf=function(e){return X(this._value,e)?this.size:-1},$.prototype.__iterate=function(e,t){for(var n=0;n<this.size;n++)if(!1===e(this._value,n,this))return n+1;return n},$.prototype.__iterator=function(e,t){var n=this,r=0;return new x(function(){return r<n.size?w(e,r++,n._value):k()})},$.prototype.equals=function(e){return e instanceof $?X(this._value,e._value):Y(e)};var An;e(Q,T),Q.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},Q.prototype.get=function(e,t){return this.has(e)?this._start+m(this,e)*this._step:t},Q.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},Q.prototype.slice=function(e,t){return g(e,t,this.size)?this:(e=y(e,this.size),t=_(t,this.size),t<=e?new Q(0,0):new Q(this.get(e,this._end),this.get(t,this._end),this._step))},Q.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var n=t/this._step;if(n>=0&&n<this.size)return n}return-1},Q.prototype.lastIndexOf=function(e){return this.indexOf(e)},Q.prototype.__iterate=function(e,t){for(var n=this.size-1,r=this._step,i=t?this._start+n*r:this._start,o=0;o<=n;o++){if(!1===e(i,o,this))return o+1;i+=t?-r:r}return o},Q.prototype.__iterator=function(e,t){var n=this.size-1,r=this._step,i=t?this._start+n*r:this._start,o=0;return new x(function(){var a=i;return i+=t?-r:r,o>n?k():w(e,o++,a)})},Q.prototype.equals=function(e){return e instanceof Q?this._start===e._start&&this._end===e._end&&this._step===e._step:Y(this,e)};var Dn;e(ee,t),e(te,ee),e(ne,ee),e(re,ee),ee.Keyed=te,ee.Indexed=ne,ee.Set=re;var On,Mn="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){e|=0,t|=0;var n=65535&e,r=65535&t;return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0},Tn=Object.isExtensible,Pn=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}(),In="function"==typeof WeakMap;In&&(On=new WeakMap);var Rn=0,jn="__immutablehash__";"function"==typeof Symbol&&(jn=Symbol(jn));var Fn=16,Nn=255,Bn=0,Ln={};e(pe,te),pe.of=function(){var e=un.call(arguments,0);return we().withMutations(function(t){for(var n=0;n<e.length;n+=2){if(n+1>=e.length)throw new Error("Missing value for key: "+e[n]);t.set(e[n],e[n+1])}})},pe.prototype.toString=function(){return this.__toString("Map {","}")},pe.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},pe.prototype.set=function(e,t){return ke(this,e,t)},pe.prototype.setIn=function(e,t){return this.updateIn(e,vn,function(){return t})},pe.prototype.remove=function(e){return ke(this,e,vn)},pe.prototype.deleteIn=function(e){return this.updateIn(e,function(){return vn})},pe.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},pe.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=Re(this,Tt(e),t,n);return r===vn?void 0:r},pe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):we()},pe.prototype.merge=function(){return Me(this,void 0,arguments)},pe.prototype.mergeWith=function(e){return Me(this,e,un.call(arguments,1))},pe.prototype.mergeIn=function(e){var t=un.call(arguments,1);return this.updateIn(e,we(),function(e){return"function"==typeof e.merge?e.merge.apply(e,t):t[t.length-1]})},pe.prototype.mergeDeep=function(){return Me(this,Te,arguments)},pe.prototype.mergeDeepWith=function(e){var t=un.call(arguments,1);return Me(this,Pe(e),t)},pe.prototype.mergeDeepIn=function(e){var t=un.call(arguments,1);return this.updateIn(e,we(),function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,t):t[t.length-1]})},pe.prototype.sort=function(e){return Ze(bt(this,e))},pe.prototype.sortBy=function(e,t){return Ze(bt(this,t,e))},pe.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},pe.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new f)},pe.prototype.asImmutable=function(){return this.__ensureOwner()},pe.prototype.wasAltered=function(){return this.__altered},pe.prototype.__iterator=function(e,t){return new ye(this,e,t)},pe.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},pe.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?xe(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},pe.isMap=fe;var qn="@@__IMMUTABLE_MAP__@@",zn=pe.prototype;zn[qn]=!0,zn.delete=zn.remove,zn.removeIn=zn.deleteIn,he.prototype.get=function(e,t,n,r){for(var i=this.entries,o=0,a=i.length;o<a;o++)if(X(n,i[o][0]))return i[o][1];return r},he.prototype.update=function(e,t,n,r,i,o,a){for(var s=i===vn,u=this.entries,l=0,c=u.length;l<c&&!X(r,u[l][0]);l++);var f=l<c;if(f?u[l][1]===i:s)return this;if(p(a),(s||!f)&&p(o),!s||1!==u.length){if(!f&&!s&&u.length>=Wn)return Ae(e,u,r,i);var d=e&&e===this.ownerID,m=d?u:h(u);return f?s?l===c-1?m.pop():m[l]=m.pop():m[l]=[r,i]:m.push([r,i]),d?(this.entries=m,this):new he(e,m)}},de.prototype.get=function(e,t,n,r){void 0===t&&(t=oe(n));var i=1<<((0===e?t:t>>>e)&mn),o=this.bitmap;return 0==(o&i)?r:this.nodes[je(o&i-1)].get(e+hn,t,n,r)},de.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=oe(r));var s=(0===t?n:n>>>t)&mn,u=1<<s,l=this.bitmap,c=0!=(l&u);if(!c&&i===vn)return this;var p=je(l&u-1),f=this.nodes,h=c?f[p]:void 0,d=Ee(h,e,t+hn,n,r,i,o,a);if(d===h)return this;if(!c&&d&&f.length>=Vn)return Oe(e,f,l,s,d);if(c&&!d&&2===f.length&&Se(f[1^p]))return f[1^p];if(c&&d&&1===f.length&&Se(d))return d;var m=e&&e===this.ownerID,v=c?d?l:l^u:l|u,g=c?d?Fe(f,p,d,m):Be(f,p,m):Ne(f,p,d,m);return m?(this.bitmap=v,this.nodes=g,this):new de(e,v,g)},me.prototype.get=function(e,t,n,r){void 0===t&&(t=oe(n));var i=(0===e?t:t>>>e)&mn,o=this.nodes[i];return o?o.get(e+hn,t,n,r):r},me.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=oe(r));var s=(0===t?n:n>>>t)&mn,u=i===vn,l=this.nodes,c=l[s];if(u&&!c)return this;var p=Ee(c,e,t+hn,n,r,i,o,a);if(p===c)return this;var f=this.count;if(c){if(!p&&--f<Hn)return De(e,l,f,s)}else f++;var h=e&&e===this.ownerID,d=Fe(l,s,p,h);return h?(this.count=f,this.nodes=d,this):new me(e,f,d)},ve.prototype.get=function(e,t,n,r){for(var i=this.entries,o=0,a=i.length;o<a;o++)if(X(n,i[o][0]))return i[o][1];return r},ve.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=oe(r));var s=i===vn;if(n!==this.keyHash)return s?this:(p(a),p(o),Ce(this,e,t,n,[r,i]));for(var u=this.entries,l=0,c=u.length;l<c&&!X(r,u[l][0]);l++);var f=l<c;if(f?u[l][1]===i:s)return this;if(p(a),(s||!f)&&p(o),s&&2===c)return new ge(e,this.keyHash,u[1^l]);var d=e&&e===this.ownerID,m=d?u:h(u);return f?s?l===c-1?m.pop():m[l]=m.pop():m[l]=[r,i]:m.push([r,i]),d?(this.entries=m,this):new ve(e,this.keyHash,m)},ge.prototype.get=function(e,t,n,r){return X(n,this.entry[0])?this.entry[1]:r},ge.prototype.update=function(e,t,n,r,i,o,a){var s=i===vn,u=X(r,this.entry[0]);return(u?i===this.entry[1]:s)?this:(p(a),s?void p(o):u?e&&e===this.ownerID?(this.entry[1]=i,this):new ge(e,this.keyHash,[r,i]):(p(o),Ce(this,e,t,oe(r),[r,i])))},he.prototype.iterate=ve.prototype.iterate=function(e,t){for(var n=this.entries,r=0,i=n.length-1;r<=i;r++)if(!1===e(n[t?i-r:r]))return!1},de.prototype.iterate=me.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,i=n.length-1;r<=i;r++){var o=n[t?i-r:r];if(o&&!1===o.iterate(e,t))return!1}},ge.prototype.iterate=function(e,t){return e(this.entry)},e(ye,x),ye.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var n,r=t.node,i=t.index++;if(r.entry){if(0===i)return _e(e,r.entry)}else if(r.entries){if(n=r.entries.length-1,i<=n)return _e(e,r.entries[this._reverse?n-i:i])}else if(n=r.nodes.length-1,i<=n){var o=r.nodes[this._reverse?n-i:i];if(o){if(o.entry)return _e(e,o.entry);t=this._stack=be(o,t)}continue}t=this._stack=this._stack.__prev}return k()};var Un,Wn=dn/4,Vn=dn/2,Hn=dn/4;e(Le,ne),Le.of=function(){return this(arguments)},Le.prototype.toString=function(){return this.__toString("List [","]")},Le.prototype.get=function(e,t){if((e=m(this,e))>=0&&e<this.size){e+=this._origin;var n=Ke(this,e);return n&&n.array[e&mn]}return t},Le.prototype.set=function(e,t){return He(this,e,t)},Le.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},Le.prototype.insert=function(e,t){return this.splice(e,0,t)},Le.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=hn,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Ve()},Le.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations(function(n){Xe(n,0,t+e.length);for(var r=0;r<e.length;r++)n.set(t+r,e[r])})},Le.prototype.pop=function(){return Xe(this,0,-1)},Le.prototype.unshift=function(){var e=arguments;return this.withMutations(function(t){Xe(t,-e.length);for(var n=0;n<e.length;n++)t.set(n,e[n])})},Le.prototype.shift=function(){return Xe(this,1)},Le.prototype.merge=function(){return Ye(this,void 0,arguments)},Le.prototype.mergeWith=function(e){return Ye(this,e,un.call(arguments,1))},Le.prototype.mergeDeep=function(){return Ye(this,Te,arguments)},Le.prototype.mergeDeepWith=function(e){var t=un.call(arguments,1);return Ye(this,Pe(e),t)},Le.prototype.setSize=function(e){return Xe(this,0,e)},Le.prototype.slice=function(e,t){var n=this.size;return g(e,t,n)?this:Xe(this,y(e,n),_(t,n))},Le.prototype.__iterator=function(e,t){var n=0,r=Ue(this,t);return new x(function(){var t=r();return t===Xn?k():w(e,n++,t)})},Le.prototype.__iterate=function(e,t){for(var n,r=0,i=Ue(this,t);(n=i())!==Xn&&!1!==e(n,r++,this););return r},Le.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?We(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)},Le.isList=qe;var Gn="@@__IMMUTABLE_LIST__@@",Jn=Le.prototype;Jn[Gn]=!0,Jn.delete=Jn.remove,Jn.setIn=zn.setIn,Jn.deleteIn=Jn.removeIn=zn.removeIn,Jn.update=zn.update,Jn.updateIn=zn.updateIn,Jn.mergeIn=zn.mergeIn,Jn.mergeDeepIn=zn.mergeDeepIn,Jn.withMutations=zn.withMutations,Jn.asMutable=zn.asMutable,Jn.asImmutable=zn.asImmutable,Jn.wasAltered=zn.wasAltered,ze.prototype.removeBefore=function(e,t,n){if(n===t?1<<t:0===this.array.length)return this;var r=n>>>t&mn;if(r>=this.array.length)return new ze([],e);var i,o=0===r;if(t>0){var a=this.array[r];if((i=a&&a.removeBefore(e,t-hn,n))===a&&o)return this}if(o&&!i)return this;var s=Je(this,e);if(!o)for(var u=0;u<r;u++)s.array[u]=void 0;return i&&(s.array[r]=i),s},ze.prototype.removeAfter=function(e,t,n){if(n===(t?1<<t:0)||0===this.array.length)return this;var r=n-1>>>t&mn;if(r>=this.array.length)return this;var i;if(t>0){var o=this.array[r];if((i=o&&o.removeAfter(e,t-hn,n))===o&&r===this.array.length-1)return this}var a=Je(this,e);return a.array.splice(r+1),i&&(a.array[r]=i),a};var Kn,Xn={};e(Ze,pe),Ze.of=function(){return this(arguments)},Ze.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Ze.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Ze.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):tt()},Ze.prototype.set=function(e,t){return nt(this,e,t)},Ze.prototype.remove=function(e){return nt(this,e,vn)},Ze.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Ze.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],n)},t)},Ze.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Ze.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?et(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Ze.isOrderedMap=Qe,Ze.prototype[fn]=!0,Ze.prototype.delete=Ze.prototype.remove;var Yn;e(rt,M),rt.prototype.get=function(e,t){return this._iter.get(e,t)},rt.prototype.has=function(e){return this._iter.has(e)},rt.prototype.valueSeq=function(){return this._iter.valueSeq()},rt.prototype.reverse=function(){var e=this,t=lt(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},rt.prototype.map=function(e,t){var n=this,r=ut(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},rt.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?Ct(this):0,function(i){return e(i,t?--n:n++,r)}),t)},rt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(bn,t),r=t?Ct(this):0;return new x(function(){var i=n.next();return i.done?i:w(e,t?--r:r++,i.value,i)})},rt.prototype[fn]=!0,e(it,T),it.prototype.includes=function(e){return this._iter.includes(e)},it.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate(function(t){return e(t,r++,n)},t)},it.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t),r=0;return new x(function(){var t=n.next();return t.done?t:w(e,r++,t.value,t)})},e(ot,P),ot.prototype.has=function(e){return this._iter.includes(e)},ot.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){return e(t,t,n)},t)},ot.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t);return new x(function(){var t=n.next();return t.done?t:w(e,t.value,t.value,t)})},e(at,M),at.prototype.entrySeq=function(){return this._iter.toSeq()},at.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){if(t){St(t);var r=o(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}},t)},at.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t);return new x(function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){St(r);var i=o(r);return w(e,i?r.get(0):r[0],i?r.get(1):r[1],t)}}})},it.prototype.cacheResult=rt.prototype.cacheResult=ot.prototype.cacheResult=at.prototype.cacheResult=Ot,e(Pt,te),Pt.prototype.toString=function(){return this.__toString(Rt(this)+" {","}")},Pt.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},Pt.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},Pt.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=It(this,we()))},Pt.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+Rt(this));if(this._map&&!this._map.has(e)){if(t===this._defaultValues[e])return this}var n=this._map&&this._map.set(e,t);return this.__ownerID||n===this._map?this:It(this,n)},Pt.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:It(this,t)},Pt.prototype.wasAltered=function(){return this._map.wasAltered()},Pt.prototype.__iterator=function(e,t){var r=this;return n(this._defaultValues).map(function(e,t){return r.get(t)}).__iterator(e,t)},Pt.prototype.__iterate=function(e,t){var r=this;return n(this._defaultValues).map(function(e,t){return r.get(t)}).__iterate(e,t)},Pt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?It(this,t,e):(this.__ownerID=e,this._map=t,this)};var $n=Pt.prototype;$n.delete=$n.remove,$n.deleteIn=$n.removeIn=zn.removeIn,$n.merge=zn.merge,$n.mergeWith=zn.mergeWith,$n.mergeIn=zn.mergeIn,$n.mergeDeep=zn.mergeDeep,$n.mergeDeepWith=zn.mergeDeepWith,$n.mergeDeepIn=zn.mergeDeepIn,$n.setIn=zn.setIn,$n.update=zn.update,$n.updateIn=zn.updateIn,$n.withMutations=zn.withMutations,$n.asMutable=zn.asMutable,$n.asImmutable=zn.asImmutable,e(Nt,re),Nt.of=function(){return this(arguments)},Nt.fromKeys=function(e){return this(n(e).keySeq())},Nt.prototype.toString=function(){return this.__toString("Set {","}")},Nt.prototype.has=function(e){return this._map.has(e)},Nt.prototype.add=function(e){return Lt(this,this._map.set(e,!0))},Nt.prototype.remove=function(e){return Lt(this,this._map.remove(e))},Nt.prototype.clear=function(){return Lt(this,this._map.clear())},Nt.prototype.union=function(){var e=un.call(arguments,0);return e=e.filter(function(e){return 0!==e.size}),0===e.length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations(function(t){for(var n=0;n<e.length;n++)i(e[n]).forEach(function(e){return t.add(e)})}):this.constructor(e[0])},Nt.prototype.intersect=function(){var e=un.call(arguments,0);if(0===e.length)return this;e=e.map(function(e){return i(e)});var t=this;return this.withMutations(function(n){t.forEach(function(t){e.every(function(e){return e.includes(t)})||n.remove(t)})})},Nt.prototype.subtract=function(){var e=un.call(arguments,0);if(0===e.length)return this;e=e.map(function(e){return i(e)});var t=this;return this.withMutations(function(n){t.forEach(function(t){e.some(function(e){return e.includes(t)})&&n.remove(t)})})},Nt.prototype.merge=function(){return this.union.apply(this,arguments)},Nt.prototype.mergeWith=function(e){var t=un.call(arguments,1);return this.union.apply(this,t)},Nt.prototype.sort=function(e){return Ut(bt(this,e))},Nt.prototype.sortBy=function(e,t){return Ut(bt(this,t,e))},Nt.prototype.wasAltered=function(){return this._map.wasAltered()},Nt.prototype.__iterate=function(e,t){var n=this;return this._map.__iterate(function(t,r){return e(r,r,n)},t)},Nt.prototype.__iterator=function(e,t){return this._map.map(function(e,t){return t}).__iterator(e,t)},Nt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):(this.__ownerID=e,this._map=t,this)},Nt.isSet=Bt;var Zn="@@__IMMUTABLE_SET__@@",Qn=Nt.prototype;Qn[Zn]=!0,Qn.delete=Qn.remove,Qn.mergeDeep=Qn.merge,Qn.mergeDeepWith=Qn.mergeWith,Qn.withMutations=zn.withMutations,Qn.asMutable=zn.asMutable,Qn.asImmutable=zn.asImmutable,Qn.__empty=zt,Qn.__make=qt;var er;e(Ut,Nt),Ut.of=function(){return this(arguments)},Ut.fromKeys=function(e){return this(n(e).keySeq())},Ut.prototype.toString=function(){return this.__toString("OrderedSet {","}")},Ut.isOrderedSet=Wt;var tr=Ut.prototype;tr[fn]=!0,tr.__empty=Ht,tr.__make=Vt;var nr;e(Gt,ne),Gt.of=function(){return this(arguments)},Gt.prototype.toString=function(){return this.__toString("Stack [","]")},Gt.prototype.get=function(e,t){var n=this._head;for(e=m(this,e);n&&e--;)n=n.next;return n?n.value:t},Gt.prototype.peek=function(){return this._head&&this._head.value},Gt.prototype.push=function(){if(0===arguments.length)return this;for(var e=this.size+arguments.length,t=this._head,n=arguments.length-1;n>=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Kt(e,t)},Gt.prototype.pushAll=function(e){if(e=r(e),0===e.size)return this;ce(e.size);var t=this.size,n=this._head;return e.reverse().forEach(function(e){t++,n={value:e,next:n}}),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Kt(t,n)},Gt.prototype.pop=function(){return this.slice(1)},Gt.prototype.unshift=function(){return this.push.apply(this,arguments)},Gt.prototype.unshiftAll=function(e){return this.pushAll(e)},Gt.prototype.shift=function(){return this.pop.apply(this,arguments)},Gt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Xt()},Gt.prototype.slice=function(e,t){if(g(e,t,this.size))return this;var n=y(e,this.size);if(_(t,this.size)!==this.size)return ne.prototype.slice.call(this,e,t);for(var r=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):Kt(r,i)},Gt.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Kt(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Gt.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},Gt.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new x(function(){if(r){var t=r.value;return r=r.next,w(e,n++,t)}return k()})},Gt.isStack=Jt;var rr="@@__IMMUTABLE_STACK__@@",ir=Gt.prototype;ir[rr]=!0,ir.withMutations=zn.withMutations,ir.asMutable=zn.asMutable,ir.asImmutable=zn.asImmutable,ir.wasAltered=zn.wasAltered;var or;t.Iterator=x,Yt(t,{toArray:function(){ce(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,n){e[n]=t}),e},toIndexedSeq:function(){return new it(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new rt(this,!0)},toMap:function(){return pe(this.toKeyedSeq())},toObject:function(){ce(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e},toOrderedMap:function(){return Ze(this.toKeyedSeq())},toOrderedSet:function(){return Ut(a(this)?this.valueSeq():this)},toSet:function(){return Nt(a(this)?this.valueSeq():this)},toSetSeq:function(){return new ot(this)},toSeq:function(){return s(this)?this.toIndexedSeq():a(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Gt(a(this)?this.valueSeq():this)},toList:function(){return Le(a(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){return Et(this,vt(this,un.call(arguments,0)))},includes:function(e){return this.some(function(t){return X(t,e)})},entries:function(){return this.__iterator(xn)},every:function(e,t){ce(this.size);var n=!0;return this.__iterate(function(r,i,o){if(!e.call(t,r,i,o))return n=!1,!1}),n},filter:function(e,t){return Et(this,ct(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return ce(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){ce(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate(function(r){n?n=!1:t+=e,t+=null!==r&&void 0!==r?r.toString():""}),t},keys:function(){return this.__iterator(_n)},map:function(e,t){return Et(this,ut(this,e,t))},reduce:function(e,t,n){ce(this.size);var r,i;return arguments.length<2?i=!0:r=t,this.__iterate(function(t,o,a){i?(i=!1,r=t):r=e.call(n,r,t,o,a)}),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Et(this,lt(this,!0))},slice:function(e,t){return Et(this,ht(this,e,t,!0))},some:function(e,t){return!this.every(Qt(e),t)},sort:function(e){return Et(this,bt(this,e))},values:function(){return this.__iterator(bn)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,t){return d(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return pt(this,e,t)},equals:function(e){return Y(this,e)},entrySeq:function(){var e=this;if(e._cache)return new I(e._cache);var t=e.toSeq().map(Zt).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Qt(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate(function(n,i,o){if(e.call(t,n,i,o))return r=[i,n],!1}),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(v)},flatMap:function(e,t){return Et(this,yt(this,e,t))},flatten:function(e){return Et(this,gt(this,e,!0))},fromEntrySeq:function(){return new at(this)},get:function(e,t){return this.find(function(t,n){return X(n,e)},void 0,t)},getIn:function(e,t){for(var n,r=this,i=Tt(e);!(n=i.next()).done;){var o=n.value;if((r=r&&r.get?r.get(o,vn):vn)===vn)return t}return r},groupBy:function(e,t){return ft(this,e,t)},has:function(e){return this.get(e,vn)!==vn},hasIn:function(e){return this.getIn(e,vn)!==vn},isSubset:function(e){return e="function"==typeof e.includes?e:t(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return e="function"==typeof e.isSubset?e:t(e),e.isSubset(this)},keyOf:function(e){return this.findKey(function(t){return X(t,e)})},keySeq:function(){return this.toSeq().map($t).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return xt(this,e)},maxBy:function(e,t){return xt(this,t,e)},min:function(e){return xt(this,e?en(e):rn)},minBy:function(e,t){return xt(this,t?en(t):rn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Et(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Et(this,mt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Qt(e),t)},sortBy:function(e,t){return Et(this,bt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Et(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Et(this,dt(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Qt(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=on(this))}});var ar=t.prototype;ar[ln]=!0,ar[En]=ar.values,ar.__toJS=ar.toArray,ar.__toStringMapper=tn,ar.inspect=ar.toSource=function(){return this.toString()},ar.chain=ar.flatMap,ar.contains=ar.includes,Yt(n,{flip:function(){return Et(this,st(this))},mapEntries:function(e,t){var n=this,r=0;return Et(this,this.toSeq().map(function(i,o){return e.call(t,[o,i],r++,n)}).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Et(this,this.toSeq().flip().map(function(r,i){return e.call(t,r,i,n)}).flip())}});var sr=n.prototype;return sr[cn]=!0,sr[En]=ar.entries,sr.__toJS=ar.toObject,sr.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+tn(e)},Yt(r,{toKeyedSeq:function(){return new rt(this,!1)},filter:function(e,t){return Et(this,ct(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Et(this,lt(this,!1))},slice:function(e,t){return Et(this,ht(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=y(e,e<0?this.count():this.size);var r=this.slice(0,e);return Et(this,1===n?r:r.concat(h(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return Et(this,gt(this,e,!1))},get:function(e,t){return e=m(this,e),e<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,n){return n===e},void 0,t)},has:function(e){return(e=m(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return Et(this,_t(this,e))},interleave:function(){var e=[this].concat(h(arguments)),t=kt(this.toSeq(),T.of,e),n=t.flatten(!0);return t.size&&(n.size=t.size*e.length),Et(this,n)},keySeq:function(){return Q(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(e,t){return Et(this,mt(this,e,t,!1))},zip:function(){return Et(this,kt(this,nn,[this].concat(h(arguments))))},zipWith:function(e){var t=h(arguments);return t[0]=this,Et(this,kt(this,e,t))}}),r.prototype[pn]=!0,r.prototype[fn]=!0,Yt(i,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),i.prototype.has=ar.includes,i.prototype.contains=i.prototype.includes,Yt(M,n.prototype),Yt(T,r.prototype),Yt(P,i.prototype),Yt(te,n.prototype),Yt(ne,r.prototype),Yt(re,i.prototype),{Iterable:t,Seq:O,Collection:ee,Map:pe,OrderedMap:Ze,List:Le,Stack:Gt,Set:Nt,OrderedSet:Ut,Record:Pt,Range:Q,Repeat:$,is:X,fromJS:H}})},function(e,t,n){"use strict";function r(e,t,n,r,o,a,s,u){if(i(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,s,u],p=0;l=new Error(t.replace(/%s/g,function(){return c[p++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var i=function(e){};e.exports=r},function(e,t,n){"use strict";(function(e){function r(e){return e&&e.__esModule?e:{default:e}}function i(e){try{var t=JSON.parse(e);if(t&&"object"===(void 0===t?"undefined":(0,N.default)(t)))return t}catch(e){}return!1}function o(e){return p(e)?oe(e)?e.toObject():e:{}}function a(e){return e?e.toArray?e.toArray():l(e):[]}function s(e){return oe(e)?e:e instanceof te.default.File?e:p(e)?Array.isArray(e)?L.default.Seq(e).map(s).toList():L.default.OrderedMap(e).map(s):e}function u(e,t){var n={};return(0,j.default)(e).filter(function(t){return"function"==typeof e[t]}).forEach(function(r){return n[r]=e[r].bind(null,t)}),n}function l(e){return Array.isArray(e)?e:[e]}function c(e){return"function"==typeof e}function p(e){return!!e&&"object"===(void 0===e?"undefined":(0,N.default)(e))}function f(e){return"function"==typeof e}function h(e){return Array.isArray(e)}function d(e,t){return(0,j.default)(e).reduce(function(n,r){return n[r]=t(e[r],r),n},{})}function m(e,t){return(0,j.default)(e).reduce(function(n,r){var i=t(e[r],r);return i&&"object"===(void 0===i?"undefined":(0,N.default)(i))&&(0,I.default)(n,i),n},{})}function v(e){return function(t){t.dispatch,t.getState;return function(t){return function(n){return"function"==typeof n?n(e()):t(n)}}}}function g(e){var t=e.keySeq();return t.contains(ie)?ie:t.filter(function(e){return"2"===(e+"")[0]}).sort().first()}function y(e,t){if(!L.default.Iterable.isIterable(e))return L.default.List();var n=e.getIn(Array.isArray(t)?t:[t]);return L.default.List.isList(n)?n:L.default.List()}function _(e){var t=document;if(!e)return"";if(e.textContent.length>5e3)return e.textContent;return function(e){for(var n,r,i,o,a,s=e.textContent,u=0,l=s[0],c=1,p=e.innerHTML="",f=0;r=n,n=f<7&&"\\"==n?1:c;){if(c=l,l=s[++u],o=p.length>1,!c||f>8&&"\n"==c||[/\S/.test(c),1,1,!/[$\w]/.test(c),("/"==n||"\n"==n)&&o,'"'==n&&o,"'"==n&&o,s[u-4]+r+n=="--\x3e",r+n=="*/"][f])for(p&&(e.appendChild(a=t.createElement("span")).setAttribute("style",["color: #555; font-weight: bold;","","","color: #555;",""][f?f<3?2:f>6?4:f>3?3:+/^(a(bstract|lias|nd|rguments|rray|s(m|sert)?|uto)|b(ase|egin|ool(ean)?|reak|yte)|c(ase|atch|har|hecked|lass|lone|ompl|onst|ontinue)|de(bugger|cimal|clare|f(ault|er)?|init|l(egate|ete)?)|do|double|e(cho|ls?if|lse(if)?|nd|nsure|num|vent|x(cept|ec|p(licit|ort)|te(nds|nsion|rn)))|f(allthrough|alse|inal(ly)?|ixed|loat|or(each)?|riend|rom|unc(tion)?)|global|goto|guard|i(f|mp(lements|licit|ort)|n(it|clude(_once)?|line|out|stanceof|t(erface|ernal)?)?|s)|l(ambda|et|ock|ong)|m(icrolight|odule|utable)|NaN|n(amespace|ative|ext|ew|il|ot|ull)|o(bject|perator|r|ut|verride)|p(ackage|arams|rivate|rotected|rotocol|ublic)|r(aise|e(adonly|do|f|gister|peat|quire(_once)?|scue|strict|try|turn))|s(byte|ealed|elf|hort|igned|izeof|tatic|tring|truct|ubscript|uper|ynchronized|witch)|t(emplate|hen|his|hrows?|ransient|rue|ry|ype(alias|def|id|name|of))|u(n(checked|def(ined)?|ion|less|signed|til)|se|sing)|v(ar|irtual|oid|olatile)|w(char_t|hen|here|hile|ith)|xor|yield)$/.test(p):0]),a.appendChild(t.createTextNode(p))),i=f&&f<7?f:i,p="",f=11;![1,/[\/{}[(\-+*=<>:;|\\.,?!&@~]/.test(c),/[\])]/.test(c),/[$\w]/.test(c),"/"==c&&i<2&&"<"!=n,'"'==c,"'"==c,c+l+s[u+1]+s[u+2]=="\x3c!--",c+l=="/*",c+l=="//","#"==c][--f];);p+=c}}(e)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:L.default.Map();if(!L.default.Map.isMap(e)||!e.size)return L.default.List();if(Array.isArray(t)||(t=[t]),t.length<1)return e.merge(n);var r=L.default.List(),i=t[0],o=!0,a=!1,s=void 0;try{for(var u,l=(0,T.default)(e.entries());!(o=(u=l.next()).done);o=!0){var c=u.value,p=(0,O.default)(c,2),f=p[0],h=p[1],d=b(h,t.slice(1),n.set(i,f));r=L.default.List.isList(d)?r.concat(d):r.push(d)}}catch(e){a=!0,s=e}finally{try{!o&&l.return&&l.return()}finally{if(a)throw s}}return r}function x(e){var t=/filename="([^;]*);?"/i.exec(e);return null===t&&(t=/filename=([^;]*);?/i.exec(e)),null!==t&&t.length>1?t[1]:null}function w(e){return(0,V.default)((0,U.default)(e))}function k(e){return w(e.replace(/\.[^.\/]*$/,""))}function E(e){return"string"!=typeof e||""===e?"":(0,q.sanitizeUrl)(e)}function S(e){if(!L.default.OrderedMap.isOrderedMap(e))return null;if(!e.size)return null;var t=e.find(function(e,t){return t.startsWith("2")&&(0,j.default)(e.get("content")||{}).length>0}),n=e.get("default")||L.default.OrderedMap(),r=(n.get("content")||L.default.OrderedMap()).keySeq().toJS(),i=r.length?n:null;return t||i}Object.defineProperty(t,"__esModule",{value:!0}),t.getExtensions=t.escapeDeepLinkPath=t.createDeepLinkPath=t.shallowEqualKeys=t.buildFormData=t.sorters=t.btoa=t.parseSearch=t.getSampleSchema=t.validateParam=t.validatePattern=t.validateMinLength=t.validateMaxLength=t.validateGuid=t.validateDateTime=t.validateString=t.validateBoolean=t.validateFile=t.validateInteger=t.validateNumber=t.validateMinimum=t.validateMaximum=t.propChecker=t.memoize=t.isImmutable=void 0;var C=n(35),A=r(C),D=n(18),O=r(D),M=n(95),T=r(M),P=n(30),I=r(P),R=n(47),j=r(R),F=n(48),N=r(F);t.isJSONObject=i,t.objectify=o,t.arrayify=a,t.fromJSOrdered=s,t.bindToState=u,t.normalizeArray=l,t.isFn=c,t.isObject=p,t.isFunc=f,t.isArray=h,t.objMap=d,t.objReduce=m,t.systemThunkMiddleware=v,t.defaultStatusCode=g,t.getList=y,t.highlight=_,t.mapToList=b,t.extractFileNameFromContentDispositionHeader=x,t.pascalCase=w,t.pascalCaseFilename=k,t.sanitizeUrl=E,t.getAcceptControllingResponse=S;var B=n(7),L=r(B),q=n(506),z=n(940),U=r(z),W=n(428),V=r(W),H=n(425),G=r(H),J=n(223),K=r(J),X=n(955),Y=r(X),$=n(120),Z=r($),Q=n(172),ee=n(46),te=r(ee),ne=n(697),re=r(ne),ie="default",oe=t.isImmutable=function(e){return L.default.Iterable.isIterable(e)},ae=(t.memoize=G.default,t.propChecker=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return(0,j.default)(e).length!==(0,j.default)(t).length||((0,Y.default)(e,function(e,n){if(r.includes(n))return!1;var i=t[n];return L.default.Iterable.isIterable(e)?!L.default.is(e,i):("object"!==(void 0===e?"undefined":(0,N.default)(e))||"object"!==(void 0===i?"undefined":(0,N.default)(i)))&&e!==i})||n.some(function(n){return!(0,Z.default)(e[n],t[n])}))},t.validateMaximum=function(e,t){if(e>t)return"Value must be less than Maximum"}),se=t.validateMinimum=function(e,t){if(e<t)return"Value must be greater than Minimum"},ue=t.validateNumber=function(e){if(!/^-?\d+(\.?\d+)?$/.test(e))return"Value must be a number"},le=t.validateInteger=function(e){if(!/^-?\d+$/.test(e))return"Value must be an integer"},ce=t.validateFile=function(e){if(e&&!(e instanceof te.default.File))return"Value must be a file"},pe=t.validateBoolean=function(e){if("true"!==e&&"false"!==e&&!0!==e&&!1!==e)return"Value must be a boolean"},fe=t.validateString=function(e){if(e&&"string"!=typeof e)return"Value must be a string"},he=t.validateDateTime=function(e){if(isNaN(Date.parse(e)))return"Value must be a DateTime"},de=t.validateGuid=function(e){if(e=e.toString().toLowerCase(),!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}[)}]?$/.test(e))return"Value must be a Guid"},me=t.validateMaxLength=function(e,t){if(e.length>t)return"Value must be less than MaxLength"},ve=t.validateMinLength=function(e,t){if(e.length<t)return"Value must be greater than MinLength"},ge=t.validatePattern=function(e,t){if(!new RegExp(t).test(e))return"Value must follow pattern "+t},ye=(t.validateParam=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=t&&"body"===e.get("in")?e.get("value_xml"):e.get("value"),o=e.get("required"),a=n?e.get("schema"):e;if(!a)return r;var s=a.get("maximum"),u=a.get("minimum"),l=a.get("type"),c=a.get("format"),p=a.get("maxLength"),f=a.get("minLength"),h=a.get("pattern");if(l&&(o||i)){var d="string"===l&&i,m="array"===l&&Array.isArray(i)&&i.length,v="array"===l&&L.default.List.isList(i)&&i.count(),g="file"===l&&i instanceof te.default.File,y="boolean"===l&&(i||!1===i),_="number"===l&&(i||0===i),b="integer"===l&&(i||0===i);if(o&&!(d||m||v||g||y||_||b))return r.push("Required field is not provided"),r;if(h){var x=ge(i,h);x&&r.push(x)}if(p||0===p){var w=me(i,p);w&&r.push(w)}if(f){var k=ve(i,f);k&&r.push(k)}if(s||0===s){var E=ae(i,s);E&&r.push(E)}if(u||0===u){var S=se(i,u);S&&r.push(S)}if("string"===l){var C=void 0;if(!(C="date-time"===c?he(i):"uuid"===c?de(i):fe(i)))return r;r.push(C)}else if("boolean"===l){var A=pe(i);if(!A)return r;r.push(A)}else if("number"===l){var D=ue(i);if(!D)return r;r.push(D)}else if("integer"===l){var O=le(i);if(!O)return r;r.push(O)}else if("array"===l){var M=void 0;if(!i.count())return r;M=a.getIn(["items","type"]),i.forEach(function(e,t){var n=void 0;"number"===M?n=ue(e):"integer"===M?n=le(e):"string"===M&&(n=fe(e)),n&&r.push({index:t,error:n})})}else if("file"===l){var T=ce(i);if(!T)return r;r.push(T)}}return r},t.getSampleSchema=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(/xml/.test(t)){if(!e.xml||!e.xml.name){if(e.xml=e.xml||{},!e.$$ref)return e.type||e.items||e.properties||e.additionalProperties?'<?xml version="1.0" encoding="UTF-8"?>\n\x3c!-- XML example cannot be generated --\x3e':null;var r=e.$$ref.match(/\S*\/(\S+)$/);e.xml.name=r[1]}return(0,Q.memoizedCreateXMLExample)(e,n)}return(0,A.default)((0,Q.memoizedSampleFromSchema)(e,n),null,2)},t.parseSearch=function(){var e={},t=te.default.location.search;if(!t)return{};if(""!=t){var n=t.substr(1).split("&");for(var r in n)n.hasOwnProperty(r)&&(r=n[r].split("="),e[decodeURIComponent(r[0])]=decodeURIComponent(r[1]))}return e},t.btoa=function(t){var n=void 0;return n=t instanceof e?t:new e(t.toString(),"utf-8"),n.toString("base64")},t.sorters={operationsSorter:{alpha:function(e,t){return e.get("path").localeCompare(t.get("path"))},method:function(e,t){return e.get("method").localeCompare(t.get("method"))}},tagsSorter:{alpha:function(e,t){return e.localeCompare(t)}}},t.buildFormData=function(e){var t=[];for(var n in e){var r=e[n];void 0!==r&&""!==r&&t.push([n,"=",encodeURIComponent(r).replace(/%20/g,"+")].join(""))}return t.join("&")},t.shallowEqualKeys=function(e,t,n){return!!(0,K.default)(n,function(n){return(0,Z.default)(e[n],t[n])})},t.createDeepLinkPath=function(e){return"string"==typeof e||e instanceof String?e.trim().replace(/\s/g,"_"):""});t.escapeDeepLinkPath=function(e){return(0,re.default)(ye(e))},t.getExtensions=function(e){return e.filter(function(e,t){return/^x-/.test(t)})}}).call(t,n(40).Buffer)},function(e,t,n){"use strict";var r=n(32),i=r;e.exports=i},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var i=new Error(n);throw i.name="Invariant Violation",i.framesToPop=1,i}e.exports=r},function(e,t,n){"use strict";function r(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":e instanceof b.Iterable?"Immutable."+e.toSource().split(" ")[0]:t}function i(e){function t(t,n,r,i,o,a){for(var s=arguments.length,u=Array(s>6?s-6:0),l=6;l<s;l++)u[l-6]=arguments[l];if(a=a||r,i=i||x,null!=n[r])return e.apply(void 0,[n,r,i,o,a].concat(u));var c=o;return t?new Error("Required "+c+" `"+a+"` was not specified in `"+i+"`."):void 0}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function o(e,t){function n(n,i,o,a,s){var u=n[i];if(!t(u)){var l=r(u);return new Error("Invalid "+a+" `"+s+"` of type `"+l+"` supplied to `"+o+"`, expected `"+e+"`.")}return null}return i(n)}function a(e,t,n){function o(i,o,a,s,u){for(var l=arguments.length,c=Array(l>5?l-5:0),p=5;p<l;p++)c[p-5]=arguments[p];var f=i[o];if(!n(f)){var h=s,d=r(f);return new Error("Invalid "+h+" `"+u+"` of type `"+d+"` supplied to `"+a+"`, expected an Immutable.js "+t+".")}if("function"!=typeof e)return new Error("Invalid typeChecker supplied to `"+a+"` for propType `"+u+"`, expected a function.");for(var m=f.toArray(),v=0,g=m.length;v<g;v++){var y=e.apply(void 0,[m,v,a,s,u+"["+v+"]"].concat(c));if(y instanceof Error)return y}}return i(o)}function s(e){function t(t,n,r,i,o){for(var a=arguments.length,s=Array(a>5?a-5:0),u=5;u<a;u++)s[u-5]=arguments[u];var l=t[n];if("function"!=typeof e)return new Error("Invalid keysTypeChecker (optional second argument) supplied to `"+r+"` for propType `"+o+"`, expected a function.");for(var c=l.keySeq().toArray(),p=0,f=c.length;p<f;p++){var h=e.apply(void 0,[c,p,r,i,o+" -> key("+c[p]+")"].concat(s));if(h instanceof Error)return h}}return i(t)}function u(e){return a(e,"List",b.List.isList)}function l(e,t,n,r){function o(){for(var i=arguments.length,o=Array(i),u=0;u<i;u++)o[u]=arguments[u];return a(e,n,r).apply(void 0,o)||t&&s(t).apply(void 0,o)}return i(o)}function c(e,t){return l(e,t,"Map",b.Map.isMap)}function p(e,t){return l(e,t,"OrderedMap",b.OrderedMap.isOrderedMap)}function f(e){return a(e,"Set",b.Set.isSet)}function h(e){return a(e,"OrderedSet",b.OrderedSet.isOrderedSet)}function d(e){return a(e,"Stack",b.Stack.isStack)}function m(e){return a(e,"Iterable",b.Iterable.isIterable)}function v(e){function t(t,n,i,o,a){for(var s=arguments.length,u=Array(s>5?s-5:0),l=5;l<s;l++)u[l-5]=arguments[l];var c=t[n];if(!(c instanceof b.Record)){var p=r(c),f=o;return new Error("Invalid "+f+" `"+a+"` of type `"+p+"` supplied to `"+i+"`, expected an Immutable.js Record.")}for(var h in e){var d=e[h];if(d){var m=c.toObject(),v=d.apply(void 0,[m,h,i,o,a+"."+h].concat(u));if(v)return v}}}return i(t)}function g(e){function t(t,i,a,s,u){for(var l=arguments.length,c=Array(l>5?l-5:0),p=5;p<l;p++)c[p-5]=arguments[p];var f=t[i];if(!o(f)){var h=r(f),d=s;return new Error("Invalid "+d+" `"+u+"` of type `"+h+"` supplied to `"+a+"`, expected an Immutable.js "+n+".")}var m=f.toObject();for(var v in e){var g=e[v];if(g){var y=g.apply(void 0,[m,v,a,s,u+"."+v].concat(c));if(y)return y}}}var n=void 0===arguments[1]?"Iterable":arguments[1],o=void 0===arguments[2]?b.Iterable.isIterable:arguments[2];return i(t)}function y(e){return g(e)}function _(e){return g(e,"Map",b.Map.isMap)}var b=n(7),x="<<anonymous>>",w={listOf:u,mapOf:c,orderedMapOf:p,setOf:f,orderedSetOf:h,stackOf:d,iterableOf:m,recordOf:v,shape:y,contains:y,mapContains:_,list:o("List",b.List.isList),map:o("Map",b.Map.isMap),orderedMap:o("OrderedMap",b.OrderedMap.isOrderedMap),set:o("Set",b.Set.isSet),orderedSet:o("OrderedSet",b.OrderedSet.isOrderedSet),stack:o("Stack",b.Stack.isStack),seq:o("Seq",b.Seq.isSeq),record:o("Record",function(e){return e instanceof b.Record}),iterable:o("Iterable",b.Iterable.isIterable)};e.exports=w},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/* +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(function(){try{return require("esprima")}catch(e){}}()):"function"==typeof define&&define.amd?define(["esprima"],t):"object"==typeof exports?exports.SwaggerUIBundle=t(function(){try{return require("esprima")}catch(e){}}()):e.SwaggerUIBundle=t(e.esprima)}(window,function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist",n(n.s=488)}([function(e,t,n){"use strict";e.exports=n(104)},function(e,t,n){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return a(e)?e:J(e)}function r(e){return s(e)?e:K(e)}function o(e){return u(e)?e:Y(e)}function i(e){return a(e)&&!c(e)?e:$(e)}function a(e){return!(!e||!e[p])}function s(e){return!(!e||!e[f])}function u(e){return!(!e||!e[h])}function c(e){return s(e)||u(e)}function l(e){return!(!e||!e[d])}t(r,n),t(o,n),t(i,n),n.isIterable=a,n.isKeyed=s,n.isIndexed=u,n.isAssociative=c,n.isOrdered=l,n.Keyed=r,n.Indexed=o,n.Set=i;var p="@@__IMMUTABLE_ITERABLE__@@",f="@@__IMMUTABLE_KEYED__@@",h="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",m=5,v=1<<m,g=v-1,y={},b={value:!1},_={value:!1};function w(e){return e.value=!1,e}function x(e){e&&(e.value=!0)}function E(){}function S(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),o=0;o<n;o++)r[o]=e[o+t];return r}function C(e){return void 0===e.size&&(e.size=e.__iterate(O)),e.size}function k(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?C(e)+t:t}function O(){return!0}function A(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function T(e,t){return P(e,t,0)}function j(e,t){return P(e,t,t)}function P(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var I=0,M=1,N=2,R="function"==typeof Symbol&&Symbol.iterator,D="@@iterator",L=R||D;function U(e){this.next=e}function q(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function F(){return{value:void 0,done:!0}}function B(e){return!!H(e)}function z(e){return e&&"function"==typeof e.next}function V(e){var t=H(e);return t&&t.call(e)}function H(e){var t=e&&(R&&e[R]||e[D]);if("function"==typeof t)return t}function W(e){return e&&"number"==typeof e.length}function J(e){return null==e?ie():a(e)?e.toSeq():function(e){var t=ue(e)||"object"==typeof e&&new te(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function K(e){return null==e?ie().toKeyedSeq():a(e)?s(e)?e.toSeq():e.fromEntrySeq():ae(e)}function Y(e){return null==e?ie():a(e)?s(e)?e.entrySeq():e.toIndexedSeq():se(e)}function $(e){return(null==e?ie():a(e)?s(e)?e.entrySeq():e:se(e)).toSetSeq()}U.prototype.toString=function(){return"[Iterator]"},U.KEYS=I,U.VALUES=M,U.ENTRIES=N,U.prototype.inspect=U.prototype.toSource=function(){return this.toString()},U.prototype[L]=function(){return this},t(J,n),J.of=function(){return J(arguments)},J.prototype.toSeq=function(){return this},J.prototype.toString=function(){return this.__toString("Seq {","}")},J.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},J.prototype.__iterate=function(e,t){return ce(this,e,t,!0)},J.prototype.__iterator=function(e,t){return le(this,e,t,!0)},t(K,J),K.prototype.toKeyedSeq=function(){return this},t(Y,J),Y.of=function(){return Y(arguments)},Y.prototype.toIndexedSeq=function(){return this},Y.prototype.toString=function(){return this.__toString("Seq [","]")},Y.prototype.__iterate=function(e,t){return ce(this,e,t,!1)},Y.prototype.__iterator=function(e,t){return le(this,e,t,!1)},t($,J),$.of=function(){return $(arguments)},$.prototype.toSetSeq=function(){return this},J.isSeq=oe,J.Keyed=K,J.Set=$,J.Indexed=Y;var G,Z,X,Q="@@__IMMUTABLE_SEQ__@@";function ee(e){this._array=e,this.size=e.length}function te(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function ne(e){this._iterable=e,this.size=e.length||e.size}function re(e){this._iterator=e,this._iteratorCache=[]}function oe(e){return!(!e||!e[Q])}function ie(){return G||(G=new ee([]))}function ae(e){var t=Array.isArray(e)?new ee(e).fromEntrySeq():z(e)?new re(e).fromEntrySeq():B(e)?new ne(e).fromEntrySeq():"object"==typeof e?new te(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function se(e){var t=ue(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function ue(e){return W(e)?new ee(e):z(e)?new re(e):B(e)?new ne(e):void 0}function ce(e,t,n,r){var o=e._cache;if(o){for(var i=o.length-1,a=0;a<=i;a++){var s=o[n?i-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function le(e,t,n,r){var o=e._cache;if(o){var i=o.length-1,a=0;return new U(function(){var e=o[n?i-a:a];return a++>i?{value:void 0,done:!0}:q(t,r?e[0]:a-1,e[1])})}return e.__iteratorUncached(t,n)}function pe(e,t){return t?function e(t,n,r,o){return Array.isArray(n)?t.call(o,r,Y(n).map(function(r,o){return e(t,r,o,n)})):he(n)?t.call(o,r,K(n).map(function(r,o){return e(t,r,o,n)})):n}(t,e,"",{"":e}):fe(e)}function fe(e){return Array.isArray(e)?Y(e).map(fe).toList():he(e)?K(e).map(fe).toMap():e}function he(e){return e&&(e.constructor===Object||void 0===e.constructor)}function de(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function me(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||s(e)!==s(t)||u(e)!==u(t)||l(e)!==l(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!c(e);if(l(e)){var r=e.entries();return t.every(function(e,t){var o=r.next().value;return o&&de(o[1],e)&&(n||de(o[0],t))})&&r.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var p=!0,f=t.__iterate(function(t,r){if(n?!e.has(t):o?!de(t,e.get(r,y)):!de(e.get(r,y),t))return p=!1,!1});return p&&e.size===f}function ve(e,t){if(!(this instanceof ve))return new ve(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(Z)return Z;Z=this}}function ge(e,t){if(!e)throw new Error(t)}function ye(e,t,n){if(!(this instanceof ye))return new ye(e,t,n);if(ge(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t<e&&(n=-n),this._start=e,this._end=t,this._step=n,this.size=Math.max(0,Math.ceil((t-e)/n-1)+1),0===this.size){if(X)return X;X=this}}function be(){throw TypeError("Abstract")}function _e(){}function we(){}function xe(){}J.prototype[Q]=!0,t(ee,Y),ee.prototype.get=function(e,t){return this.has(e)?this._array[k(this,e)]:t},ee.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length-1,o=0;o<=r;o++)if(!1===e(n[t?r-o:o],o,this))return o+1;return o},ee.prototype.__iterator=function(e,t){var n=this._array,r=n.length-1,o=0;return new U(function(){return o>r?{value:void 0,done:!0}:q(e,o,n[t?r-o++:o++])})},t(te,K),te.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},te.prototype.has=function(e){return this._object.hasOwnProperty(e)},te.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,o=r.length-1,i=0;i<=o;i++){var a=r[t?o-i:i];if(!1===e(n[a],a,this))return i+1}return i},te.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,o=r.length-1,i=0;return new U(function(){var a=r[t?o-i:i];return i++>o?{value:void 0,done:!0}:q(e,a,n[a])})},te.prototype[d]=!0,t(ne,Y),ne.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=V(this._iterable),r=0;if(z(n))for(var o;!(o=n.next()).done&&!1!==e(o.value,r++,this););return r},ne.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=V(this._iterable);if(!z(n))return new U(F);var r=0;return new U(function(){var t=n.next();return t.done?t:q(e,r++,t.value)})},t(re,Y),re.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,o=this._iteratorCache,i=0;i<o.length;)if(!1===e(o[i],i++,this))return i;for(;!(n=r.next()).done;){var a=n.value;if(o[i]=a,!1===e(a,i++,this))break}return i},re.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterator,r=this._iteratorCache,o=0;return new U(function(){if(o>=r.length){var t=n.next();if(t.done)return t;r[o]=t.value}return q(e,o,r[o++])})},t(ve,Y),ve.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},ve.prototype.get=function(e,t){return this.has(e)?this._value:t},ve.prototype.includes=function(e){return de(this._value,e)},ve.prototype.slice=function(e,t){var n=this.size;return A(e,t,n)?this:new ve(this._value,j(t,n)-T(e,n))},ve.prototype.reverse=function(){return this},ve.prototype.indexOf=function(e){return de(this._value,e)?0:-1},ve.prototype.lastIndexOf=function(e){return de(this._value,e)?this.size:-1},ve.prototype.__iterate=function(e,t){for(var n=0;n<this.size;n++)if(!1===e(this._value,n,this))return n+1;return n},ve.prototype.__iterator=function(e,t){var n=this,r=0;return new U(function(){return r<n.size?q(e,r++,n._value):{value:void 0,done:!0}})},ve.prototype.equals=function(e){return e instanceof ve?de(this._value,e._value):me(e)},t(ye,Y),ye.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},ye.prototype.get=function(e,t){return this.has(e)?this._start+k(this,e)*this._step:t},ye.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},ye.prototype.slice=function(e,t){return A(e,t,this.size)?this:(e=T(e,this.size),(t=j(t,this.size))<=e?new ye(0,0):new ye(this.get(e,this._end),this.get(t,this._end),this._step))},ye.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var n=t/this._step;if(n>=0&&n<this.size)return n}return-1},ye.prototype.lastIndexOf=function(e){return this.indexOf(e)},ye.prototype.__iterate=function(e,t){for(var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;i<=n;i++){if(!1===e(o,i,this))return i+1;o+=t?-r:r}return i},ye.prototype.__iterator=function(e,t){var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;return new U(function(){var a=o;return o+=t?-r:r,i>n?{value:void 0,done:!0}:q(e,i++,a)})},ye.prototype.equals=function(e){return e instanceof ye?this._start===e._start&&this._end===e._end&&this._step===e._step:me(this,e)},t(be,n),t(_e,be),t(we,be),t(xe,be),be.Keyed=_e,be.Indexed=we,be.Set=xe;var Ee="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function Se(e){return e>>>1&1073741824|3221225471&e}function Ce(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!=e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return Se(n)}if("string"===t)return e.length>Me?function(e){var t=De[e];return void 0===t&&(t=ke(e),Re===Ne&&(Re=0,De={}),Re++,De[e]=t),t}(e):ke(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return function(e){var t;if(je&&void 0!==(t=Oe.get(e)))return t;if(void 0!==(t=e[Ie]))return t;if(!Te){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Ie]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=++Pe,1073741824&Pe&&(Pe=0),je)Oe.set(e,t);else{if(void 0!==Ae&&!1===Ae(e))throw new Error("Non-extensible objects are not allowed as keys.");if(Te)Object.defineProperty(e,Ie,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Ie]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Ie]=t}}return t}(e);if("function"==typeof e.toString)return ke(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function ke(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return Se(t)}var Oe,Ae=Object.isExtensible,Te=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}(),je="function"==typeof WeakMap;je&&(Oe=new WeakMap);var Pe=0,Ie="__immutablehash__";"function"==typeof Symbol&&(Ie=Symbol(Ie));var Me=16,Ne=255,Re=0,De={};function Le(e){ge(e!==1/0,"Cannot perform this action with an infinite size.")}function Ue(e){return null==e?Xe():qe(e)&&!l(e)?e:Xe().withMutations(function(t){var n=r(e);Le(n.size),n.forEach(function(e,n){return t.set(n,e)})})}function qe(e){return!(!e||!e[Be])}t(Ue,_e),Ue.of=function(){var t=e.call(arguments,0);return Xe().withMutations(function(e){for(var n=0;n<t.length;n+=2){if(n+1>=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}})},Ue.prototype.toString=function(){return this.__toString("Map {","}")},Ue.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},Ue.prototype.set=function(e,t){return Qe(this,e,t)},Ue.prototype.setIn=function(e,t){return this.updateIn(e,y,function(){return t})},Ue.prototype.remove=function(e){return Qe(this,e,y)},Ue.prototype.deleteIn=function(e){return this.updateIn(e,function(){return y})},Ue.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},Ue.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=function e(t,n,r,o){var i=t===y,a=n.next();if(a.done){var s=i?r:t,u=o(s);return u===s?t:u}ge(i||t&&t.set,"invalid keyPath");var c=a.value,l=i?y:t.get(c,y),p=e(l,n,r,o);return p===l?t:p===y?t.remove(c):(i?Xe():t).set(c,p)}(this,rn(e),t,n);return r===y?void 0:r},Ue.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Xe()},Ue.prototype.merge=function(){return rt(this,void 0,arguments)},Ue.prototype.mergeWith=function(t){var n=e.call(arguments,1);return rt(this,t,n)},Ue.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Xe(),function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]})},Ue.prototype.mergeDeep=function(){return rt(this,ot,arguments)},Ue.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return rt(this,it(t),n)},Ue.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Xe(),function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]})},Ue.prototype.sort=function(e){return Tt(Jt(this,e))},Ue.prototype.sortBy=function(e,t){return Tt(Jt(this,t,e))},Ue.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},Ue.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new E)},Ue.prototype.asImmutable=function(){return this.__ensureOwner()},Ue.prototype.wasAltered=function(){return this.__altered},Ue.prototype.__iterator=function(e,t){return new Ye(this,e,t)},Ue.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},Ue.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ze(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Ue.isMap=qe;var Fe,Be="@@__IMMUTABLE_MAP__@@",ze=Ue.prototype;function Ve(e,t){this.ownerID=e,this.entries=t}function He(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function We(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function Je(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function Ke(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function Ye(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&Ge(e._root)}function $e(e,t){return q(e,t[0],t[1])}function Ge(e,t){return{node:e,index:0,__prev:t}}function Ze(e,t,n,r){var o=Object.create(ze);return o.size=e,o._root=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function Xe(){return Fe||(Fe=Ze(0))}function Qe(e,t,n){var r,o;if(e._root){var i=w(b),a=w(_);if(r=et(e._root,e.__ownerID,0,void 0,t,n,i,a),!a.value)return e;o=e.size+(i.value?n===y?-1:1:0)}else{if(n===y)return e;o=1,r=new Ve(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=o,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?Ze(o,r):Xe()}function et(e,t,n,r,o,i,a,s){return e?e.update(t,n,r,o,i,a,s):i===y?e:(x(s),x(a),new Ke(t,r,[o,i]))}function tt(e){return e.constructor===Ke||e.constructor===Je}function nt(e,t,n,r,o){if(e.keyHash===r)return new Je(t,r,[e.entry,o]);var i,a=(0===n?e.keyHash:e.keyHash>>>n)&g,s=(0===n?r:r>>>n)&g;return new He(t,1<<a|1<<s,a===s?[nt(e,t,n+m,r,o)]:(i=new Ke(t,r,o),a<s?[e,i]:[i,e]))}function rt(e,t,n){for(var o=[],i=0;i<n.length;i++){var s=n[i],u=r(s);a(s)||(u=u.map(function(e){return pe(e)})),o.push(u)}return at(e,t,o)}function ot(e,t,n){return e&&e.mergeDeep&&a(t)?e.mergeDeep(t):de(e,t)?e:t}function it(e){return function(t,n,r){if(t&&t.mergeDeepWith&&a(n))return t.mergeDeepWith(e,n);var o=e(t,n,r);return de(t,o)?t:o}}function at(e,t,n){return 0===(n=n.filter(function(e){return 0!==e.size})).length?e:0!==e.size||e.__ownerID||1!==n.length?e.withMutations(function(e){for(var r=t?function(n,r){e.update(r,y,function(e){return e===y?n:t(e,n,r)})}:function(t,n){e.set(n,t)},o=0;o<n.length;o++)n[o].forEach(r)}):e.constructor(n[0])}function st(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function ut(e,t,n,r){var o=r?e:S(e);return o[t]=n,o}ze[Be]=!0,ze.delete=ze.remove,ze.removeIn=ze.deleteIn,Ve.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(de(n,o[i][0]))return o[i][1];return r},Ve.prototype.update=function(e,t,n,r,o,i,a){for(var s=o===y,u=this.entries,c=0,l=u.length;c<l&&!de(r,u[c][0]);c++);var p=c<l;if(p?u[c][1]===o:s)return this;if(x(a),(s||!p)&&x(i),!s||1!==u.length){if(!p&&!s&&u.length>=ct)return function(e,t,n,r){e||(e=new E);for(var o=new Ke(e,Ce(n),[n,r]),i=0;i<t.length;i++){var a=t[i];o=o.update(e,0,void 0,a[0],a[1])}return o}(e,u,r,o);var f=e&&e===this.ownerID,h=f?u:S(u);return p?s?c===l-1?h.pop():h[c]=h.pop():h[c]=[r,o]:h.push([r,o]),f?(this.entries=h,this):new Ve(e,h)}},He.prototype.get=function(e,t,n,r){void 0===t&&(t=Ce(n));var o=1<<((0===e?t:t>>>e)&g),i=this.bitmap;return 0==(i&o)?r:this.nodes[st(i&o-1)].get(e+m,t,n,r)},He.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Ce(r));var s=(0===t?n:n>>>t)&g,u=1<<s,c=this.bitmap,l=0!=(c&u);if(!l&&o===y)return this;var p=st(c&u-1),f=this.nodes,h=l?f[p]:void 0,d=et(h,e,t+m,n,r,o,i,a);if(d===h)return this;if(!l&&d&&f.length>=lt)return function(e,t,n,r,o){for(var i=0,a=new Array(v),s=0;0!==n;s++,n>>>=1)a[s]=1&n?t[i++]:void 0;return a[r]=o,new We(e,i+1,a)}(e,f,c,s,d);if(l&&!d&&2===f.length&&tt(f[1^p]))return f[1^p];if(l&&d&&1===f.length&&tt(d))return d;var b=e&&e===this.ownerID,_=l?d?c:c^u:c|u,w=l?d?ut(f,p,d,b):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var o=new Array(r),i=0,a=0;a<r;a++)a===t&&(i=1),o[a]=e[a+i];return o}(f,p,b):function(e,t,n,r){var o=e.length+1;if(r&&t+1===o)return e[t]=n,e;for(var i=new Array(o),a=0,s=0;s<o;s++)s===t?(i[s]=n,a=-1):i[s]=e[s+a];return i}(f,p,d,b);return b?(this.bitmap=_,this.nodes=w,this):new He(e,_,w)},We.prototype.get=function(e,t,n,r){void 0===t&&(t=Ce(n));var o=(0===e?t:t>>>e)&g,i=this.nodes[o];return i?i.get(e+m,t,n,r):r},We.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Ce(r));var s=(0===t?n:n>>>t)&g,u=o===y,c=this.nodes,l=c[s];if(u&&!l)return this;var p=et(l,e,t+m,n,r,o,i,a);if(p===l)return this;var f=this.count;if(l){if(!p&&--f<pt)return function(e,t,n,r){for(var o=0,i=0,a=new Array(n),s=0,u=1,c=t.length;s<c;s++,u<<=1){var l=t[s];void 0!==l&&s!==r&&(o|=u,a[i++]=l)}return new He(e,o,a)}(e,c,f,s)}else f++;var h=e&&e===this.ownerID,d=ut(c,s,p,h);return h?(this.count=f,this.nodes=d,this):new We(e,f,d)},Je.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(de(n,o[i][0]))return o[i][1];return r},Je.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Ce(r));var s=o===y;if(n!==this.keyHash)return s?this:(x(a),x(i),nt(this,e,t,n,[r,o]));for(var u=this.entries,c=0,l=u.length;c<l&&!de(r,u[c][0]);c++);var p=c<l;if(p?u[c][1]===o:s)return this;if(x(a),(s||!p)&&x(i),s&&2===l)return new Ke(e,this.keyHash,u[1^c]);var f=e&&e===this.ownerID,h=f?u:S(u);return p?s?c===l-1?h.pop():h[c]=h.pop():h[c]=[r,o]:h.push([r,o]),f?(this.entries=h,this):new Je(e,this.keyHash,h)},Ke.prototype.get=function(e,t,n,r){return de(n,this.entry[0])?this.entry[1]:r},Ke.prototype.update=function(e,t,n,r,o,i,a){var s=o===y,u=de(r,this.entry[0]);return(u?o===this.entry[1]:s)?this:(x(a),s?void x(i):u?e&&e===this.ownerID?(this.entry[1]=o,this):new Ke(e,this.keyHash,[r,o]):(x(i),nt(this,e,t,Ce(r),[r,o])))},Ve.prototype.iterate=Je.prototype.iterate=function(e,t){for(var n=this.entries,r=0,o=n.length-1;r<=o;r++)if(!1===e(n[t?o-r:r]))return!1},He.prototype.iterate=We.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,o=n.length-1;r<=o;r++){var i=n[t?o-r:r];if(i&&!1===i.iterate(e,t))return!1}},Ke.prototype.iterate=function(e,t){return e(this.entry)},t(Ye,U),Ye.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var n,r=t.node,o=t.index++;if(r.entry){if(0===o)return $e(e,r.entry)}else if(r.entries){if(o<=(n=r.entries.length-1))return $e(e,r.entries[this._reverse?n-o:o])}else if(o<=(n=r.nodes.length-1)){var i=r.nodes[this._reverse?n-o:o];if(i){if(i.entry)return $e(e,i.entry);t=this._stack=Ge(i,t)}continue}t=this._stack=this._stack.__prev}return{value:void 0,done:!0}};var ct=v/4,lt=v/2,pt=v/4;function ft(e){var t=xt();if(null==e)return t;if(ht(e))return e;var n=o(e),r=n.size;return 0===r?t:(Le(r),r>0&&r<v?wt(0,r,m,null,new vt(n.toArray())):t.withMutations(function(e){e.setSize(r),n.forEach(function(t,n){return e.set(n,t)})}))}function ht(e){return!(!e||!e[dt])}t(ft,we),ft.of=function(){return this(arguments)},ft.prototype.toString=function(){return this.__toString("List [","]")},ft.prototype.get=function(e,t){if((e=k(this,e))>=0&&e<this.size){var n=Ct(this,e+=this._origin);return n&&n.array[e&g]}return t},ft.prototype.set=function(e,t){return function(e,t,n){if((t=k(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations(function(e){t<0?kt(e,t).set(0,n):kt(e,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,o=e._root,i=w(_);return t>=At(e._capacity)?r=Et(r,e.__ownerID,0,t,n,i):o=Et(o,e.__ownerID,e._level,t,n,i),i.value?e.__ownerID?(e._root=o,e._tail=r,e.__hash=void 0,e.__altered=!0,e):wt(e._origin,e._capacity,e._level,o,r):e}(this,e,t)},ft.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},ft.prototype.insert=function(e,t){return this.splice(e,0,t)},ft.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=m,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):xt()},ft.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations(function(n){kt(n,0,t+e.length);for(var r=0;r<e.length;r++)n.set(t+r,e[r])})},ft.prototype.pop=function(){return kt(this,0,-1)},ft.prototype.unshift=function(){var e=arguments;return this.withMutations(function(t){kt(t,-e.length);for(var n=0;n<e.length;n++)t.set(n,e[n])})},ft.prototype.shift=function(){return kt(this,1)},ft.prototype.merge=function(){return Ot(this,void 0,arguments)},ft.prototype.mergeWith=function(t){var n=e.call(arguments,1);return Ot(this,t,n)},ft.prototype.mergeDeep=function(){return Ot(this,ot,arguments)},ft.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return Ot(this,it(t),n)},ft.prototype.setSize=function(e){return kt(this,0,e)},ft.prototype.slice=function(e,t){var n=this.size;return A(e,t,n)?this:kt(this,T(e,n),j(t,n))},ft.prototype.__iterator=function(e,t){var n=0,r=_t(this,t);return new U(function(){var t=r();return t===bt?{value:void 0,done:!0}:q(e,n++,t)})},ft.prototype.__iterate=function(e,t){for(var n,r=0,o=_t(this,t);(n=o())!==bt&&!1!==e(n,r++,this););return r},ft.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?wt(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)},ft.isList=ht;var dt="@@__IMMUTABLE_LIST__@@",mt=ft.prototype;function vt(e,t){this.array=e,this.ownerID=t}mt[dt]=!0,mt.delete=mt.remove,mt.setIn=ze.setIn,mt.deleteIn=mt.removeIn=ze.removeIn,mt.update=ze.update,mt.updateIn=ze.updateIn,mt.mergeIn=ze.mergeIn,mt.mergeDeepIn=ze.mergeDeepIn,mt.withMutations=ze.withMutations,mt.asMutable=ze.asMutable,mt.asImmutable=ze.asImmutable,mt.wasAltered=ze.wasAltered,vt.prototype.removeBefore=function(e,t,n){if(n===t?1<<t:0===this.array.length)return this;var r=n>>>t&g;if(r>=this.array.length)return new vt([],e);var o,i=0===r;if(t>0){var a=this.array[r];if((o=a&&a.removeBefore(e,t-m,n))===a&&i)return this}if(i&&!o)return this;var s=St(this,e);if(!i)for(var u=0;u<r;u++)s.array[u]=void 0;return o&&(s.array[r]=o),s},vt.prototype.removeAfter=function(e,t,n){if(n===(t?1<<t:0)||0===this.array.length)return this;var r,o=n-1>>>t&g;if(o>=this.array.length)return this;if(t>0){var i=this.array[o];if((r=i&&i.removeAfter(e,t-m,n))===i&&o===this.array.length-1)return this}var a=St(this,e);return a.array.splice(o+1),r&&(a.array[o]=r),a};var gt,yt,bt={};function _t(e,t){var n=e._origin,r=e._capacity,o=At(r),i=e._tail;return a(e._root,e._level,0);function a(e,s,u){return 0===s?function(e,a){var s=a===o?i&&i.array:e&&e.array,u=a>n?0:n-a,c=r-a;return c>v&&(c=v),function(){if(u===c)return bt;var e=t?--c:u++;return s&&s[e]}}(e,u):function(e,o,i){var s,u=e&&e.array,c=i>n?0:n-i>>o,l=1+(r-i>>o);return l>v&&(l=v),function(){for(;;){if(s){var e=s();if(e!==bt)return e;s=null}if(c===l)return bt;var n=t?--l:c++;s=a(u&&u[n],o-m,i+(n<<o))}}}(e,s,u)}}function wt(e,t,n,r,o,i,a){var s=Object.create(mt);return s.size=t-e,s._origin=e,s._capacity=t,s._level=n,s._root=r,s._tail=o,s.__ownerID=i,s.__hash=a,s.__altered=!1,s}function xt(){return gt||(gt=wt(0,0,m))}function Et(e,t,n,r,o,i){var a,s=r>>>n&g,u=e&&s<e.array.length;if(!u&&void 0===o)return e;if(n>0){var c=e&&e.array[s],l=Et(c,t,n-m,r,o,i);return l===c?e:((a=St(e,t)).array[s]=l,a)}return u&&e.array[s]===o?e:(x(i),a=St(e,t),void 0===o&&s===a.array.length-1?a.array.pop():a.array[s]=o,a)}function St(e,t){return t&&e&&t===e.ownerID?e:new vt(e?e.array.slice():[],t)}function Ct(e,t){if(t>=At(e._capacity))return e._tail;if(t<1<<e._level+m){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&g],r-=m;return n}}function kt(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new E,o=e._origin,i=e._capacity,a=o+t,s=void 0===n?i:n<0?i+n:o+n;if(a===o&&s===i)return e;if(a>=s)return e.clear();for(var u=e._level,c=e._root,l=0;a+l<0;)c=new vt(c&&c.array.length?[void 0,c]:[],r),l+=1<<(u+=m);l&&(a+=l,o+=l,s+=l,i+=l);for(var p=At(i),f=At(s);f>=1<<u+m;)c=new vt(c&&c.array.length?[c]:[],r),u+=m;var h=e._tail,d=f<p?Ct(e,s-1):f>p?new vt([],r):h;if(h&&f>p&&a<i&&h.array.length){for(var v=c=St(c,r),y=u;y>m;y-=m){var b=p>>>y&g;v=v.array[b]=St(v.array[b],r)}v.array[p>>>m&g]=h}if(s<i&&(d=d&&d.removeAfter(r,0,s)),a>=f)a-=f,s-=f,u=m,c=null,d=d&&d.removeBefore(r,0,a);else if(a>o||f<p){for(l=0;c;){var _=a>>>u&g;if(_!==f>>>u&g)break;_&&(l+=(1<<u)*_),u-=m,c=c.array[_]}c&&a>o&&(c=c.removeBefore(r,u,a-l)),c&&f<p&&(c=c.removeAfter(r,u,f-l)),l&&(a-=l,s-=l)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=u,e._root=c,e._tail=d,e.__hash=void 0,e.__altered=!0,e):wt(a,s,u,c,d)}function Ot(e,t,n){for(var r=[],i=0,s=0;s<n.length;s++){var u=n[s],c=o(u);c.size>i&&(i=c.size),a(u)||(c=c.map(function(e){return pe(e)})),r.push(c)}return i>e.size&&(e=e.setSize(i)),at(e,t,r)}function At(e){return e<v?0:e-1>>>m<<m}function Tt(e){return null==e?It():jt(e)?e:It().withMutations(function(t){var n=r(e);Le(n.size),n.forEach(function(e,n){return t.set(n,e)})})}function jt(e){return qe(e)&&l(e)}function Pt(e,t,n,r){var o=Object.create(Tt.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=n,o.__hash=r,o}function It(){return yt||(yt=Pt(Xe(),xt()))}function Mt(e,t,n){var r,o,i=e._map,a=e._list,s=i.get(t),u=void 0!==s;if(n===y){if(!u)return e;a.size>=v&&a.size>=2*i.size?(r=(o=a.filter(function(e,t){return void 0!==e&&s!==t})).toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(r.__ownerID=o.__ownerID=e.__ownerID)):(r=i.remove(t),o=s===a.size-1?a.pop():a.set(s,void 0))}else if(u){if(n===a.get(s)[1])return e;r=i,o=a.set(s,[t,n])}else r=i.set(t,a.size),o=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=o,e.__hash=void 0,e):Pt(r,o)}function Nt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Rt(e){this._iter=e,this.size=e.size}function Dt(e){this._iter=e,this.size=e.size}function Lt(e){this._iter=e,this.size=e.size}function Ut(e){var t=en(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=tn,t.__iterateUncached=function(t,n){var r=this;return e.__iterate(function(e,n){return!1!==t(n,e,r)},n)},t.__iteratorUncached=function(t,n){if(t===N){var r=e.__iterator(t,n);return new U(function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===M?I:M,n)},t}function qt(e,t,n){var r=en(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,o){var i=e.get(r,y);return i===y?o:t.call(n,i,r,e)},r.__iterateUncached=function(r,o){var i=this;return e.__iterate(function(e,o,a){return!1!==r(t.call(n,e,o,a),o,i)},o)},r.__iteratorUncached=function(r,o){var i=e.__iterator(N,o);return new U(function(){var o=i.next();if(o.done)return o;var a=o.value,s=a[0];return q(r,s,t.call(n,a[1],s,e),o)})},r}function Ft(e,t){var n=en(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=Ut(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=tn,n.__iterate=function(t,n){var r=this;return e.__iterate(function(e,n){return t(e,n,r)},!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function Bt(e,t,n,r){var o=en(e);return r&&(o.has=function(r){var o=e.get(r,y);return o!==y&&!!t.call(n,o,r,e)},o.get=function(r,o){var i=e.get(r,y);return i!==y&&t.call(n,i,r,e)?i:o}),o.__iterateUncached=function(o,i){var a=this,s=0;return e.__iterate(function(e,i,u){if(t.call(n,e,i,u))return s++,o(e,r?i:s-1,a)},i),s},o.__iteratorUncached=function(o,i){var a=e.__iterator(N,i),s=0;return new U(function(){for(;;){var i=a.next();if(i.done)return i;var u=i.value,c=u[0],l=u[1];if(t.call(n,l,c,e))return q(o,r?c:s++,l,i)}})},o}function zt(e,t,n,r){var o=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=o:n|=0),A(t,n,o))return e;var i=T(t,o),a=j(n,o);if(i!=i||a!=a)return zt(e.toSeq().cacheResult(),t,n,r);var s,u=a-i;u==u&&(s=u<0?0:u);var c=en(e);return c.size=0===s?s:e.size&&s||void 0,!r&&oe(e)&&s>=0&&(c.get=function(t,n){return(t=k(this,t))>=0&&t<s?e.get(t+i,n):n}),c.__iterateUncached=function(t,n){var o=this;if(0===s)return 0;if(n)return this.cacheResult().__iterate(t,n);var a=0,u=!0,c=0;return e.__iterate(function(e,n){if(!u||!(u=a++<i))return c++,!1!==t(e,r?n:c-1,o)&&c!==s}),c},c.__iteratorUncached=function(t,n){if(0!==s&&n)return this.cacheResult().__iterator(t,n);var o=0!==s&&e.__iterator(t,n),a=0,u=0;return new U(function(){for(;a++<i;)o.next();if(++u>s)return{value:void 0,done:!0};var e=o.next();return r||t===M?e:q(t,u-1,t===I?void 0:e.value[1],e)})},c}function Vt(e,t,n,r){var o=en(e);return o.__iterateUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterate(o,i);var s=!0,u=0;return e.__iterate(function(e,i,c){if(!s||!(s=t.call(n,e,i,c)))return u++,o(e,r?i:u-1,a)}),u},o.__iteratorUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterator(o,i);var s=e.__iterator(N,i),u=!0,c=0;return new U(function(){var e,i,l;do{if((e=s.next()).done)return r||o===M?e:q(o,c++,o===I?void 0:e.value[1],e);var p=e.value;i=p[0],l=p[1],u&&(u=t.call(n,l,i,a))}while(u);return o===N?e:q(o,i,l,e)})},o}function Ht(e,t){var n=s(e),o=[e].concat(t).map(function(e){return a(e)?n&&(e=r(e)):e=n?ae(e):se(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===o.length)return e;if(1===o.length){var i=o[0];if(i===e||n&&s(i)||u(e)&&u(i))return i}var c=new ee(o);return n?c=c.toKeyedSeq():u(e)||(c=c.toSetSeq()),(c=c.flatten(!0)).size=o.reduce(function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}},0),c}function Wt(e,t,n){var r=en(e);return r.__iterateUncached=function(r,o){var i=0,s=!1;return function e(u,c){var l=this;u.__iterate(function(o,u){return(!t||c<t)&&a(o)?e(o,c+1):!1===r(o,n?u:i++,l)&&(s=!0),!s},o)}(e,0),i},r.__iteratorUncached=function(r,o){var i=e.__iterator(r,o),s=[],u=0;return new U(function(){for(;i;){var e=i.next();if(!1===e.done){var c=e.value;if(r===N&&(c=c[1]),t&&!(s.length<t)||!a(c))return n?e:q(r,u++,c,e);s.push(i),i=c.__iterator(r,o)}else i=s.pop()}return{value:void 0,done:!0}})},r}function Jt(e,t,n){t||(t=nn);var r=s(e),o=0,i=e.toSeq().map(function(t,r){return[r,t,o++,n?n(t,r,e):t]}).toArray();return i.sort(function(e,n){return t(e[3],n[3])||e[2]-n[2]}).forEach(r?function(e,t){i[t].length=2}:function(e,t){i[t]=e[1]}),r?K(i):u(e)?Y(i):$(i)}function Kt(e,t,n){if(t||(t=nn),n){var r=e.toSeq().map(function(t,r){return[t,n(t,r,e)]}).reduce(function(e,n){return Yt(t,e[1],n[1])?n:e});return r&&r[0]}return e.reduce(function(e,n){return Yt(t,e,n)?n:e})}function Yt(e,t,n){var r=e(n,t);return 0===r&&n!==t&&(null==n||n!=n)||r>0}function $t(e,t,r){var o=en(e);return o.size=new ee(r).map(function(e){return e.size}).min(),o.__iterate=function(e,t){for(var n,r=this.__iterator(M,t),o=0;!(n=r.next()).done&&!1!==e(n.value,o++,this););return o},o.__iteratorUncached=function(e,o){var i=r.map(function(e){return e=n(e),V(o?e.reverse():e)}),a=0,s=!1;return new U(function(){var n;return s||(n=i.map(function(e){return e.next()}),s=n.some(function(e){return e.done})),s?{value:void 0,done:!0}:q(e,a++,t.apply(null,n.map(function(e){return e.value})))})},o}function Gt(e,t){return oe(e)?t:e.constructor(t)}function Zt(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Xt(e){return Le(e.size),C(e)}function Qt(e){return s(e)?r:u(e)?o:i}function en(e){return Object.create((s(e)?K:u(e)?Y:$).prototype)}function tn(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):J.prototype.cacheResult.call(this)}function nn(e,t){return e>t?1:e<t?-1:0}function rn(e){var t=V(e);if(!t){if(!W(e))throw new TypeError("Expected iterable or array-like: "+e);t=V(n(e))}return t}function on(e,t){var n,r=function(i){if(i instanceof r)return i;if(!(this instanceof r))return new r(i);if(!n){n=!0;var a=Object.keys(e);!function(e,t){try{t.forEach(function(e,t){Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){ge(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}.bind(void 0,e))}catch(e){}}(o,a),o.size=a.length,o._name=t,o._keys=a,o._defaultValues=e}this._map=Ue(i)},o=r.prototype=Object.create(an);return o.constructor=r,r}t(Tt,Ue),Tt.of=function(){return this(arguments)},Tt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Tt.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Tt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):It()},Tt.prototype.set=function(e,t){return Mt(this,e,t)},Tt.prototype.remove=function(e){return Mt(this,e,y)},Tt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Tt.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],n)},t)},Tt.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Tt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?Pt(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Tt.isOrderedMap=jt,Tt.prototype[d]=!0,Tt.prototype.delete=Tt.prototype.remove,t(Nt,K),Nt.prototype.get=function(e,t){return this._iter.get(e,t)},Nt.prototype.has=function(e){return this._iter.has(e)},Nt.prototype.valueSeq=function(){return this._iter.valueSeq()},Nt.prototype.reverse=function(){var e=this,t=Ft(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},Nt.prototype.map=function(e,t){var n=this,r=qt(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},Nt.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?Xt(this):0,function(o){return e(o,t?--n:n++,r)}),t)},Nt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(M,t),r=t?Xt(this):0;return new U(function(){var o=n.next();return o.done?o:q(e,t?--r:r++,o.value,o)})},Nt.prototype[d]=!0,t(Rt,Y),Rt.prototype.includes=function(e){return this._iter.includes(e)},Rt.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate(function(t){return e(t,r++,n)},t)},Rt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t),r=0;return new U(function(){var t=n.next();return t.done?t:q(e,r++,t.value,t)})},t(Dt,$),Dt.prototype.has=function(e){return this._iter.includes(e)},Dt.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){return e(t,t,n)},t)},Dt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t);return new U(function(){var t=n.next();return t.done?t:q(e,t.value,t.value,t)})},t(Lt,K),Lt.prototype.entrySeq=function(){return this._iter.toSeq()},Lt.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){if(t){Zt(t);var r=a(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}},t)},Lt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t);return new U(function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){Zt(r);var o=a(r);return q(e,o?r.get(0):r[0],o?r.get(1):r[1],t)}}})},Rt.prototype.cacheResult=Nt.prototype.cacheResult=Dt.prototype.cacheResult=Lt.prototype.cacheResult=tn,t(on,_e),on.prototype.toString=function(){return this.__toString(un(this)+" {","}")},on.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},on.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},on.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=sn(this,Xe()))},on.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+un(this));if(this._map&&!this._map.has(e)&&t===this._defaultValues[e])return this;var n=this._map&&this._map.set(e,t);return this.__ownerID||n===this._map?this:sn(this,n)},on.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:sn(this,t)},on.prototype.wasAltered=function(){return this._map.wasAltered()},on.prototype.__iterator=function(e,t){var n=this;return r(this._defaultValues).map(function(e,t){return n.get(t)}).__iterator(e,t)},on.prototype.__iterate=function(e,t){var n=this;return r(this._defaultValues).map(function(e,t){return n.get(t)}).__iterate(e,t)},on.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?sn(this,t,e):(this.__ownerID=e,this._map=t,this)};var an=on.prototype;function sn(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._map=t,r.__ownerID=n,r}function un(e){return e._name||e.constructor.name||"Record"}function cn(e){return null==e?vn():ln(e)&&!l(e)?e:vn().withMutations(function(t){var n=i(e);Le(n.size),n.forEach(function(e){return t.add(e)})})}function ln(e){return!(!e||!e[fn])}an.delete=an.remove,an.deleteIn=an.removeIn=ze.removeIn,an.merge=ze.merge,an.mergeWith=ze.mergeWith,an.mergeIn=ze.mergeIn,an.mergeDeep=ze.mergeDeep,an.mergeDeepWith=ze.mergeDeepWith,an.mergeDeepIn=ze.mergeDeepIn,an.setIn=ze.setIn,an.update=ze.update,an.updateIn=ze.updateIn,an.withMutations=ze.withMutations,an.asMutable=ze.asMutable,an.asImmutable=ze.asImmutable,t(cn,xe),cn.of=function(){return this(arguments)},cn.fromKeys=function(e){return this(r(e).keySeq())},cn.prototype.toString=function(){return this.__toString("Set {","}")},cn.prototype.has=function(e){return this._map.has(e)},cn.prototype.add=function(e){return dn(this,this._map.set(e,!0))},cn.prototype.remove=function(e){return dn(this,this._map.remove(e))},cn.prototype.clear=function(){return dn(this,this._map.clear())},cn.prototype.union=function(){var t=e.call(arguments,0);return 0===(t=t.filter(function(e){return 0!==e.size})).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(e){for(var n=0;n<t.length;n++)i(t[n]).forEach(function(t){return e.add(t)})}):this.constructor(t[0])},cn.prototype.intersect=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map(function(e){return i(e)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.every(function(e){return e.includes(n)})||e.remove(n)})})},cn.prototype.subtract=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map(function(e){return i(e)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.some(function(e){return e.includes(n)})&&e.remove(n)})})},cn.prototype.merge=function(){return this.union.apply(this,arguments)},cn.prototype.mergeWith=function(t){var n=e.call(arguments,1);return this.union.apply(this,n)},cn.prototype.sort=function(e){return gn(Jt(this,e))},cn.prototype.sortBy=function(e,t){return gn(Jt(this,t,e))},cn.prototype.wasAltered=function(){return this._map.wasAltered()},cn.prototype.__iterate=function(e,t){var n=this;return this._map.__iterate(function(t,r){return e(r,r,n)},t)},cn.prototype.__iterator=function(e,t){return this._map.map(function(e,t){return t}).__iterator(e,t)},cn.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):(this.__ownerID=e,this._map=t,this)},cn.isSet=ln;var pn,fn="@@__IMMUTABLE_SET__@@",hn=cn.prototype;function dn(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function mn(e,t){var n=Object.create(hn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function vn(){return pn||(pn=mn(Xe()))}function gn(e){return null==e?xn():yn(e)?e:xn().withMutations(function(t){var n=i(e);Le(n.size),n.forEach(function(e){return t.add(e)})})}function yn(e){return ln(e)&&l(e)}hn[fn]=!0,hn.delete=hn.remove,hn.mergeDeep=hn.merge,hn.mergeDeepWith=hn.mergeWith,hn.withMutations=ze.withMutations,hn.asMutable=ze.asMutable,hn.asImmutable=ze.asImmutable,hn.__empty=vn,hn.__make=mn,t(gn,cn),gn.of=function(){return this(arguments)},gn.fromKeys=function(e){return this(r(e).keySeq())},gn.prototype.toString=function(){return this.__toString("OrderedSet {","}")},gn.isOrderedSet=yn;var bn,_n=gn.prototype;function wn(e,t){var n=Object.create(_n);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function xn(){return bn||(bn=wn(It()))}function En(e){return null==e?Tn():Sn(e)?e:Tn().unshiftAll(e)}function Sn(e){return!(!e||!e[kn])}_n[d]=!0,_n.__empty=xn,_n.__make=wn,t(En,we),En.of=function(){return this(arguments)},En.prototype.toString=function(){return this.__toString("Stack [","]")},En.prototype.get=function(e,t){var n=this._head;for(e=k(this,e);n&&e--;)n=n.next;return n?n.value:t},En.prototype.peek=function(){return this._head&&this._head.value},En.prototype.push=function(){if(0===arguments.length)return this;for(var e=this.size+arguments.length,t=this._head,n=arguments.length-1;n>=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):An(e,t)},En.prototype.pushAll=function(e){if(0===(e=o(e)).size)return this;Le(e.size);var t=this.size,n=this._head;return e.reverse().forEach(function(e){t++,n={value:e,next:n}}),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):An(t,n)},En.prototype.pop=function(){return this.slice(1)},En.prototype.unshift=function(){return this.push.apply(this,arguments)},En.prototype.unshiftAll=function(e){return this.pushAll(e)},En.prototype.shift=function(){return this.pop.apply(this,arguments)},En.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Tn()},En.prototype.slice=function(e,t){if(A(e,t,this.size))return this;var n=T(e,this.size);if(j(t,this.size)!==this.size)return we.prototype.slice.call(this,e,t);for(var r=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=r,this._head=o,this.__hash=void 0,this.__altered=!0,this):An(r,o)},En.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?An(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},En.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},En.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new U(function(){if(r){var t=r.value;return r=r.next,q(e,n++,t)}return{value:void 0,done:!0}})},En.isStack=Sn;var Cn,kn="@@__IMMUTABLE_STACK__@@",On=En.prototype;function An(e,t,n,r){var o=Object.create(On);return o.size=e,o._head=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function Tn(){return Cn||(Cn=An(0))}function jn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}On[kn]=!0,On.withMutations=ze.withMutations,On.asMutable=ze.asMutable,On.asImmutable=ze.asImmutable,On.wasAltered=ze.wasAltered,n.Iterator=U,jn(n,{toArray:function(){Le(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,n){e[n]=t}),e},toIndexedSeq:function(){return new Rt(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new Nt(this,!0)},toMap:function(){return Ue(this.toKeyedSeq())},toObject:function(){Le(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e},toOrderedMap:function(){return Tt(this.toKeyedSeq())},toOrderedSet:function(){return gn(s(this)?this.valueSeq():this)},toSet:function(){return cn(s(this)?this.valueSeq():this)},toSetSeq:function(){return new Dt(this)},toSeq:function(){return u(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return En(s(this)?this.valueSeq():this)},toList:function(){return ft(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){var t=e.call(arguments,0);return Gt(this,Ht(this,t))},includes:function(e){return this.some(function(t){return de(t,e)})},entries:function(){return this.__iterator(N)},every:function(e,t){Le(this.size);var n=!0;return this.__iterate(function(r,o,i){if(!e.call(t,r,o,i))return n=!1,!1}),n},filter:function(e,t){return Gt(this,Bt(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return Le(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Le(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate(function(r){n?n=!1:t+=e,t+=null!=r?r.toString():""}),t},keys:function(){return this.__iterator(I)},map:function(e,t){return Gt(this,qt(this,e,t))},reduce:function(e,t,n){var r,o;return Le(this.size),arguments.length<2?o=!0:r=t,this.__iterate(function(t,i,a){o?(o=!1,r=t):r=e.call(n,r,t,i,a)}),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Gt(this,Ft(this,!0))},slice:function(e,t){return Gt(this,zt(this,e,t,!0))},some:function(e,t){return!this.every(Rn(e),t)},sort:function(e){return Gt(this,Jt(this,e))},values:function(){return this.__iterator(M)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,t){return C(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,n){var r=Ue().asMutable();return e.__iterate(function(o,i){r.update(t.call(n,o,i,e),0,function(e){return e+1})}),r.asImmutable()}(this,e,t)},equals:function(e){return me(this,e)},entrySeq:function(){var e=this;if(e._cache)return new ee(e._cache);var t=e.toSeq().map(Nn).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Rn(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate(function(n,o,i){if(e.call(t,n,o,i))return r=[o,n],!1}),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(O)},flatMap:function(e,t){return Gt(this,function(e,t,n){var r=Qt(e);return e.toSeq().map(function(o,i){return r(t.call(n,o,i,e))}).flatten(!0)}(this,e,t))},flatten:function(e){return Gt(this,Wt(this,e,!0))},fromEntrySeq:function(){return new Lt(this)},get:function(e,t){return this.find(function(t,n){return de(n,e)},void 0,t)},getIn:function(e,t){for(var n,r=this,o=rn(e);!(n=o.next()).done;){var i=n.value;if((r=r&&r.get?r.get(i,y):y)===y)return t}return r},groupBy:function(e,t){return function(e,t,n){var r=s(e),o=(l(e)?Tt():Ue()).asMutable();e.__iterate(function(i,a){o.update(t.call(n,i,a,e),function(e){return(e=e||[]).push(r?[a,i]:i),e})});var i=Qt(e);return o.map(function(t){return Gt(e,i(t))})}(this,e,t)},has:function(e){return this.get(e,y)!==y},hasIn:function(e){return this.getIn(e,y)!==y},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keyOf:function(e){return this.findKey(function(t){return de(t,e)})},keySeq:function(){return this.toSeq().map(Mn).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return Kt(this,e)},maxBy:function(e,t){return Kt(this,t,e)},min:function(e){return Kt(this,e?Dn(e):qn)},minBy:function(e,t){return Kt(this,t?Dn(t):qn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Gt(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Gt(this,Vt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Rn(e),t)},sortBy:function(e,t){return Gt(this,Jt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Gt(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Gt(this,function(e,t,n){var r=en(e);return r.__iterateUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterate(r,o);var a=0;return e.__iterate(function(e,o,s){return t.call(n,e,o,s)&&++a&&r(e,o,i)}),a},r.__iteratorUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterator(r,o);var a=e.__iterator(N,o),s=!0;return new U(function(){if(!s)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var o=e.value,u=o[0],c=o[1];return t.call(n,c,u,i)?r===N?e:q(r,u,c,e):(s=!1,{value:void 0,done:!0})})},r}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Rn(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=l(e),n=s(e),r=t?1:0;return function(e,t){return t=Ee(t,3432918353),t=Ee(t<<15|t>>>-15,461845907),t=Ee(t<<13|t>>>-13,5),t=Ee((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=Se((t=Ee(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(n?t?function(e,t){r=31*r+Fn(Ce(e),Ce(t))|0}:function(e,t){r=r+Fn(Ce(e),Ce(t))|0}:t?function(e){r=31*r+Ce(e)|0}:function(e){r=r+Ce(e)|0}),r)}(this))}});var Pn=n.prototype;Pn[p]=!0,Pn[L]=Pn.values,Pn.__toJS=Pn.toArray,Pn.__toStringMapper=Ln,Pn.inspect=Pn.toSource=function(){return this.toString()},Pn.chain=Pn.flatMap,Pn.contains=Pn.includes,jn(r,{flip:function(){return Gt(this,Ut(this))},mapEntries:function(e,t){var n=this,r=0;return Gt(this,this.toSeq().map(function(o,i){return e.call(t,[i,o],r++,n)}).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Gt(this,this.toSeq().flip().map(function(r,o){return e.call(t,r,o,n)}).flip())}});var In=r.prototype;function Mn(e,t){return t}function Nn(e,t){return[t,e]}function Rn(e){return function(){return!e.apply(this,arguments)}}function Dn(e){return function(){return-e.apply(this,arguments)}}function Ln(e){return"string"==typeof e?JSON.stringify(e):String(e)}function Un(){return S(arguments)}function qn(e,t){return e<t?1:e>t?-1:0}function Fn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return In[f]=!0,In[L]=Pn.entries,In.__toJS=Pn.toObject,In.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+Ln(e)},jn(o,{toKeyedSeq:function(){return new Nt(this,!1)},filter:function(e,t){return Gt(this,Bt(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Gt(this,Ft(this,!1))},slice:function(e,t){return Gt(this,zt(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=T(e,e<0?this.count():this.size);var r=this.slice(0,e);return Gt(this,1===n?r:r.concat(S(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return Gt(this,Wt(this,e,!1))},get:function(e,t){return(e=k(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,n){return n===e},void 0,t)},has:function(e){return(e=k(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return Gt(this,function(e,t){var n=en(e);return n.size=e.size&&2*e.size-1,n.__iterateUncached=function(n,r){var o=this,i=0;return e.__iterate(function(e,r){return(!i||!1!==n(t,i++,o))&&!1!==n(e,i++,o)},r),i},n.__iteratorUncached=function(n,r){var o,i=e.__iterator(M,r),a=0;return new U(function(){return(!o||a%2)&&(o=i.next()).done?o:a%2?q(n,a++,t):q(n,a++,o.value,o)})},n}(this,e))},interleave:function(){var e=[this].concat(S(arguments)),t=$t(this.toSeq(),Y.of,e),n=t.flatten(!0);return t.size&&(n.size=t.size*e.length),Gt(this,n)},keySeq:function(){return ye(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(e,t){return Gt(this,Vt(this,e,t,!1))},zip:function(){var e=[this].concat(S(arguments));return Gt(this,$t(this,Un,e))},zipWith:function(e){var t=S(arguments);return t[0]=this,Gt(this,$t(this,e,t))}}),o.prototype[h]=!0,o.prototype[d]=!0,jn(i,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),i.prototype.has=Pn.includes,i.prototype.contains=i.prototype.includes,jn(K,r.prototype),jn(Y,o.prototype),jn($,i.prototype),jn(_e,r.prototype),jn(we,o.prototype),jn(xe,i.prototype),{Iterable:n,Seq:J,Collection:be,Map:Ue,OrderedMap:Tt,List:ft,Stack:En,Set:cn,OrderedSet:gn,Record:on,Range:ye,Repeat:ve,is:de,fromJS:pe}}()},function(e,t,n){var r=n(54);e.exports=function(e,t,n){return t in e?r(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){"use strict";(function(e){n.d(t,"t",function(){return U}),n.d(t,"A",function(){return q}),n.d(t,"i",function(){return F}),n.d(t,"w",function(){return B}),n.d(t,"r",function(){return z}),n.d(t,"u",function(){return V}),n.d(t,"s",function(){return H}),n.d(t,"q",function(){return W}),n.d(t,"v",function(){return J}),n.d(t,"y",function(){return K}),n.d(t,"z",function(){return Y}),n.d(t,"J",function(){return $}),n.d(t,"f",function(){return G}),n.d(t,"n",function(){return Z}),n.d(t,"p",function(){return X}),n.d(t,"h",function(){return Q}),n.d(t,"E",function(){return ee}),n.d(t,"K",function(){return he}),n.d(t,"o",function(){return de}),n.d(t,"D",function(){return me}),n.d(t,"a",function(){return ve}),n.d(t,"H",function(){return ge}),n.d(t,"b",function(){return ye}),n.d(t,"G",function(){return be}),n.d(t,"F",function(){return _e}),n.d(t,"k",function(){return we}),n.d(t,"d",function(){return xe}),n.d(t,"g",function(){return Ee}),n.d(t,"m",function(){return Se}),n.d(t,"l",function(){return Ce}),n.d(t,"e",function(){return ke}),n.d(t,"I",function(){return Oe}),n.d(t,"x",function(){return Ae}),n.d(t,"B",function(){return Te}),n.d(t,"C",function(){return je}),n.d(t,"j",function(){return Pe}),n.d(t,"c",function(){return Ie});var r=n(28),o=n.n(r),i=(n(13),n(92),n(16)),a=n.n(i),s=n(17),u=n.n(s),c=n(14),l=n.n(c),p=n(26),f=n.n(p),h=n(1),d=n.n(h),m=n(471),v=n(472),g=n.n(v),y=n(270),b=n.n(y),_=n(271),w=n.n(_),x=n(272),E=n.n(x),S=(n(473),n(91)),C=n.n(S),k=n(120),O=n(18),A=n.n(O),T=n(475),j=n.n(T),P=n(122),I=n(476),M=n.n(I),N=n(477),R=n.n(N),D="default",L=function(e){return d.a.Iterable.isIterable(e)};function U(e){try{var t=JSON.parse(e);if(t&&"object"===f()(t))return t}catch(e){}return!1}function q(e){return V(e)?L(e)?e.toJS():e:{}}function F(e){return L(e)?e:e instanceof A.a.File?e:V(e)?l()(e)?d.a.Seq(e).map(F).toList():d.a.OrderedMap(e).map(F):e}function B(e){return l()(e)?e:[e]}function z(e){return"function"==typeof e}function V(e){return!!e&&"object"===f()(e)}function H(e){return"function"==typeof e}function W(e){return l()(e)}var J=w.a;function K(e,t){return u()(e).reduce(function(n,r){return n[r]=t(e[r],r),n},{})}function Y(e,t){return u()(e).reduce(function(n,r){var o=t(e[r],r);return o&&"object"===f()(o)&&a()(n,o),n},{})}function $(e){return function(t){t.dispatch,t.getState;return function(t){return function(n){return"function"==typeof n?n(e()):t(n)}}}}function G(e){var t=e.keySeq();return t.contains(D)?D:t.filter(function(e){return"2"===(e+"")[0]}).sort().first()}function Z(e,t){if(!d.a.Iterable.isIterable(e))return d.a.List();var n=e.getIn(l()(t)?t:[t]);return d.a.List.isList(n)?n:d.a.List()}function X(e){var t=document;if(!e)return"";if(e.textContent.length>5e3)return e.textContent;return function(e){for(var n,r,o,i,a,s=e.textContent,u=0,c=s[0],l=1,p=e.innerHTML="",f=0;r=n,n=f<7&&"\\"==n?1:l;){if(l=c,c=s[++u],i=p.length>1,!l||f>8&&"\n"==l||[/\S/.test(l),1,1,!/[$\w]/.test(l),("/"==n||"\n"==n)&&i,'"'==n&&i,"'"==n&&i,s[u-4]+r+n=="--\x3e",r+n=="*/"][f])for(p&&(e.appendChild(a=t.createElement("span")).setAttribute("style",["color: #555; font-weight: bold;","","","color: #555;",""][f?f<3?2:f>6?4:f>3?3:+/^(a(bstract|lias|nd|rguments|rray|s(m|sert)?|uto)|b(ase|egin|ool(ean)?|reak|yte)|c(ase|atch|har|hecked|lass|lone|ompl|onst|ontinue)|de(bugger|cimal|clare|f(ault|er)?|init|l(egate|ete)?)|do|double|e(cho|ls?if|lse(if)?|nd|nsure|num|vent|x(cept|ec|p(licit|ort)|te(nds|nsion|rn)))|f(allthrough|alse|inal(ly)?|ixed|loat|or(each)?|riend|rom|unc(tion)?)|global|goto|guard|i(f|mp(lements|licit|ort)|n(it|clude(_once)?|line|out|stanceof|t(erface|ernal)?)?|s)|l(ambda|et|ock|ong)|m(icrolight|odule|utable)|NaN|n(amespace|ative|ext|ew|il|ot|ull)|o(bject|perator|r|ut|verride)|p(ackage|arams|rivate|rotected|rotocol|ublic)|r(aise|e(adonly|do|f|gister|peat|quire(_once)?|scue|strict|try|turn))|s(byte|ealed|elf|hort|igned|izeof|tatic|tring|truct|ubscript|uper|ynchronized|witch)|t(emplate|hen|his|hrows?|ransient|rue|ry|ype(alias|def|id|name|of))|u(n(checked|def(ined)?|ion|less|signed|til)|se|sing)|v(ar|irtual|oid|olatile)|w(char_t|hen|here|hile|ith)|xor|yield)$/.test(p):0]),a.appendChild(t.createTextNode(p))),o=f&&f<7?f:o,p="",f=11;![1,/[\/{}[(\-+*=<>:;|\\.,?!&@~]/.test(l),/[\])]/.test(l),/[$\w]/.test(l),"/"==l&&o<2&&"<"!=n,'"'==l,"'"==l,l+c+s[u+1]+s[u+2]=="\x3c!--",l+c=="/*",l+c=="//","#"==l][--f];);p+=l}}(e)}function Q(e){var t;if([/filename\*=[^']+'\w*'"([^"]+)";?/i,/filename\*=[^']+'\w*'([^;]+);?/i,/filename="([^;]*);?"/i,/filename=([^;]*);?/i].some(function(n){return null!==(t=n.exec(e))}),null!==t&&t.length>1)try{return decodeURIComponent(t[1])}catch(e){console.error(e)}return null}function ee(e){return t=e.replace(/\.[^.\/]*$/,""),b()(g()(t));var t}var te=function(e,t){if(e>t)return"Value must be less than Maximum"},ne=function(e,t){if(e<t)return"Value must be greater than Minimum"},re=function(e){if(!/^-?\d+(\.?\d+)?$/.test(e))return"Value must be a number"},oe=function(e){if(!/^-?\d+$/.test(e))return"Value must be an integer"},ie=function(e){if(e&&!(e instanceof A.a.File))return"Value must be a file"},ae=function(e){if("true"!==e&&"false"!==e&&!0!==e&&!1!==e)return"Value must be a boolean"},se=function(e){if(e&&"string"!=typeof e)return"Value must be a string"},ue=function(e){if(isNaN(Date.parse(e)))return"Value must be a DateTime"},ce=function(e){if(e=e.toString().toLowerCase(),!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[)}]?$/.test(e))return"Value must be a Guid"},le=function(e,t){if(e.length>t)return"Value must be less than MaxLength"},pe=function(e,t){if(e.length<t)return"Value must be greater than MinLength"},fe=function(e,t){if(!new RegExp(t).test(e))return"Value must follow pattern "+t},he=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.isOAS3,o=void 0!==r&&r,i=n.bypassRequiredCheck,a=void 0!==i&&i,s=[],u=e.get("required"),c=Object(P.a)(e,{isOAS3:o}),p=c.schema,h=c.parameterContentMediaType;if(!p)return s;var m=p.get("required"),v=p.get("maximum"),g=p.get("minimum"),y=p.get("type"),b=p.get("format"),_=p.get("maxLength"),w=p.get("minLength"),x=p.get("pattern");if(y&&(u||m||t)){var E="string"===y&&t,S="array"===y&&l()(t)&&t.length,C="array"===y&&d.a.List.isList(t)&&t.count(),k="array"===y&&"string"==typeof t&&t,O="file"===y&&t instanceof A.a.File,T="boolean"===y&&(t||!1===t),j="number"===y&&(t||0===t),I="integer"===y&&(t||0===t),M="object"===y&&"object"===f()(t)&&null!==t,N="object"===y&&"string"==typeof t&&t,R=[E,S,C,k,O,T,j,I,M,N],D=R.some(function(e){return!!e});if((u||m)&&!D&&!a)return s.push("Required field is not provided"),s;if("object"===y&&"string"==typeof t&&(null===h||"application/json"===h))try{JSON.parse(t)}catch(e){return s.push("Parameter string value must be valid JSON"),s}if(x){var L=fe(t,x);L&&s.push(L)}if(_||0===_){var U=le(t,_);U&&s.push(U)}if(w){var q=pe(t,w);q&&s.push(q)}if(v||0===v){var F=te(t,v);F&&s.push(F)}if(g||0===g){var B=ne(t,g);B&&s.push(B)}if("string"===y){var z;if(!(z="date-time"===b?ue(t):"uuid"===b?ce(t):se(t)))return s;s.push(z)}else if("boolean"===y){var V=ae(t);if(!V)return s;s.push(V)}else if("number"===y){var H=re(t);if(!H)return s;s.push(H)}else if("integer"===y){var W=oe(t);if(!W)return s;s.push(W)}else if("array"===y){var J;if(!C||!t.count())return s;J=p.getIn(["items","type"]),t.forEach(function(e,t){var n;"number"===J?n=re(e):"integer"===J?n=oe(e):"string"===J&&(n=se(e)),n&&s.push({index:t,error:n})})}else if("file"===y){var K=ie(t);if(!K)return s;s.push(K)}}return s},de=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(/xml/.test(t)){if(!e.xml||!e.xml.name){if(e.xml=e.xml||{},!e.$$ref)return e.type||e.items||e.properties||e.additionalProperties?'<?xml version="1.0" encoding="UTF-8"?>\n\x3c!-- XML example cannot be generated; root element name is undefined --\x3e':null;var r=e.$$ref.match(/\S*\/(\S+)$/);e.xml.name=r[1]}return Object(k.memoizedCreateXMLExample)(e,n)}var i=Object(k.memoizedSampleFromSchema)(e,n);return"object"===f()(i)?o()(i,null,2):i},me=function(){var e={},t=A.a.location.search;if(!t)return{};if(""!=t){var n=t.substr(1).split("&");for(var r in n)n.hasOwnProperty(r)&&(r=n[r].split("="),e[decodeURIComponent(r[0])]=r[1]&&decodeURIComponent(r[1])||"")}return e},ve=function(t){return(t instanceof e?t:new e(t.toString(),"utf-8")).toString("base64")},ge={operationsSorter:{alpha:function(e,t){return e.get("path").localeCompare(t.get("path"))},method:function(e,t){return e.get("method").localeCompare(t.get("method"))}},tagsSorter:{alpha:function(e,t){return e.localeCompare(t)}}},ye=function(e){var t=[];for(var n in e){var r=e[n];void 0!==r&&""!==r&&t.push([n,"=",encodeURIComponent(r).replace(/%20/g,"+")].join(""))}return t.join("&")},be=function(e,t,n){return!!E()(n,function(n){return C()(e[n],t[n])})};function _e(e){return"string"!=typeof e||""===e?"":Object(m.sanitizeUrl)(e)}function we(e){if(!d.a.OrderedMap.isOrderedMap(e))return null;if(!e.size)return null;var t=e.find(function(e,t){return t.startsWith("2")&&u()(e.get("content")||{}).length>0}),n=e.get("default")||d.a.OrderedMap(),r=(n.get("content")||d.a.OrderedMap()).keySeq().toJS().length?n:null;return t||r}var xe=function(e){return"string"==typeof e||e instanceof String?e.trim().replace(/\s/g,"%20"):""},Ee=function(e){return j()(xe(e).replace(/%20/g,"_"))},Se=function(e){return e.filter(function(e,t){return/^x-/.test(t)})},Ce=function(e){return e.filter(function(e,t){return/^pattern|maxLength|minLength|maximum|minimum/.test(t)})};function ke(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0};if("object"!==f()(e)||l()(e)||null===e||!t)return e;var r=a()({},e);return u()(r).forEach(function(e){e===t&&n(r[e],e)?delete r[e]:r[e]=ke(r[e],t,n)}),r}function Oe(e){if("string"==typeof e)return e;if(e&&e.toJS&&(e=e.toJS()),"object"===f()(e)&&null!==e)try{return o()(e,null,2)}catch(t){return String(e)}return null==e?"":e.toString()}function Ae(e){return"number"==typeof e?e.toString():e}function Te(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.returnAll,r=void 0!==n&&n,o=t.allowHashes,i=void 0===o||o;if(!d.a.Map.isMap(e))throw new Error("paramToIdentifier: received a non-Im.Map parameter as input");var a=e.get("name"),s=e.get("in"),u=[];return e&&e.hashCode&&s&&a&&i&&u.push("".concat(s,".").concat(a,".hash-").concat(e.hashCode())),s&&a&&u.push("".concat(s,".").concat(a)),u.push(a),r?u:u[0]||""}function je(e,t){return Te(e,{returnAll:!0}).map(function(e){return t[e]}).filter(function(e){return void 0!==e})[0]}function Pe(){return Me(M()(32).toString("base64"))}function Ie(e){return Me(R()("sha256").update(e).digest("base64"))}function Me(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}}).call(this,n(64).Buffer)},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){var r=n(54);function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),r(e,o.key,o)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}},function(e,t,n){var r=n(26),o=n(9);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},function(e,t,n){var r=n(806),o=n(420);function i(t){return e.exports=i=o?r:function(e){return e.__proto__||r(e)},i(t)}e.exports=i},function(e,t,n){var r=n(421),o=n(814);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=r(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){e.exports=n(892)()},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function o(e,t){return e===t}function i(e){var t=arguments.length<=1||void 0===arguments[1]?o:arguments[1],n=null,r=null;return function(){for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return null!==n&&n.length===i.length&&i.every(function(e,r){return t(e,n[r])})||(r=e.apply(void 0,i)),n=i,r}}function a(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(e){return"function"==typeof e})){var n=t.map(function(e){return typeof e}).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}function s(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return function(){for(var t=arguments.length,o=Array(t),i=0;i<t;i++)o[i]=arguments[i];var s=0,u=o.pop(),c=a(o),l=e.apply(void 0,[function(){return s++,u.apply(void 0,arguments)}].concat(n)),p=function(e,t){for(var n=arguments.length,o=Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];var a=c.map(function(n){return n.apply(void 0,[e,t].concat(o))});return l.apply(void 0,r(a))};return p.resultFunc=u,p.recomputations=function(){return s},p.resetRecomputations=function(){return s=0},p}}t.__esModule=!0,t.defaultMemoize=i,t.createSelectorCreator=s,t.createStructuredSelector=function(e){var t=arguments.length<=1||void 0===arguments[1]?u:arguments[1];if("object"!=typeof e)throw new Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var n=Object.keys(e);return t(n.map(function(t){return e[t]}),function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(function(e,t,r){return e[n[r]]=t,e},{})})};var u=t.createSelector=s(i)},function(e,t,n){var r=n(754),o=n(755),i=n(762);e.exports=function(e){return r(e)||o(e)||i()}},function(e,t,n){var r=n(597),o=n(598),i=n(601);e.exports=function(e,t){return r(e)||o(e,t)||i()}},function(e,t,n){e.exports=n(571)},function(e,t,n){"use strict";var r=function(e){};e.exports=function(e,t,n,o,i,a,s,u){if(r(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,o,i,a,s,u],p=0;(c=new Error(t.replace(/%s/g,function(){return l[p++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(e,t,n){e.exports=n(575)},function(e,t,n){e.exports=n(553)},function(e,t){e.exports=function(){var e={location:{},history:{},open:function(){},close:function(){},File:function(){}};if("undefined"==typeof window)return e;try{e=window;for(var t=0,n=["File","Blob","FormData"];t<n.length;t++){var r=n[t];r in window&&(e[r]=window[r])}}catch(e){console.error(e)}return e}()},function(e,t,n){"use strict";var r=n(1),o="<<anonymous>>",i={listOf:function(e){return c(e,"List",r.List.isList)},mapOf:function(e,t){return l(e,t,"Map",r.Map.isMap)},orderedMapOf:function(e,t){return l(e,t,"OrderedMap",r.OrderedMap.isOrderedMap)},setOf:function(e){return c(e,"Set",r.Set.isSet)},orderedSetOf:function(e){return c(e,"OrderedSet",r.OrderedSet.isOrderedSet)},stackOf:function(e){return c(e,"Stack",r.Stack.isStack)},iterableOf:function(e){return c(e,"Iterable",r.Iterable.isIterable)},recordOf:function(e){return s(function(t,n,o,i,s){for(var u=arguments.length,c=Array(u>5?u-5:0),l=5;l<u;l++)c[l-5]=arguments[l];var p=t[n];if(!(p instanceof r.Record)){var f=a(p);return new Error("Invalid "+i+" `"+s+"` of type `"+f+"` supplied to `"+o+"`, expected an Immutable.js Record.")}for(var h in e){var d=e[h];if(d){var m=p.toObject(),v=d.apply(void 0,[m,h,o,i,s+"."+h].concat(c));if(v)return v}}})},shape:f,contains:f,mapContains:function(e){return p(e,"Map",r.Map.isMap)},list:u("List",r.List.isList),map:u("Map",r.Map.isMap),orderedMap:u("OrderedMap",r.OrderedMap.isOrderedMap),set:u("Set",r.Set.isSet),orderedSet:u("OrderedSet",r.OrderedSet.isOrderedSet),stack:u("Stack",r.Stack.isStack),seq:u("Seq",r.Seq.isSeq),record:u("Record",function(e){return e instanceof r.Record}),iterable:u("Iterable",r.Iterable.isIterable)};function a(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":e instanceof r.Iterable?"Immutable."+e.toSource().split(" ")[0]:t}function s(e){function t(t,n,r,i,a,s){for(var u=arguments.length,c=Array(u>6?u-6:0),l=6;l<u;l++)c[l-6]=arguments[l];return s=s||r,i=i||o,null!=n[r]?e.apply(void 0,[n,r,i,a,s].concat(c)):t?new Error("Required "+a+" `"+s+"` was not specified in `"+i+"`."):void 0}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function u(e,t){return s(function(n,r,o,i,s){var u=n[r];if(!t(u)){var c=a(u);return new Error("Invalid "+i+" `"+s+"` of type `"+c+"` supplied to `"+o+"`, expected `"+e+"`.")}return null})}function c(e,t,n){return s(function(r,o,i,s,u){for(var c=arguments.length,l=Array(c>5?c-5:0),p=5;p<c;p++)l[p-5]=arguments[p];var f=r[o];if(!n(f)){var h=s,d=a(f);return new Error("Invalid "+h+" `"+u+"` of type `"+d+"` supplied to `"+i+"`, expected an Immutable.js "+t+".")}if("function"!=typeof e)return new Error("Invalid typeChecker supplied to `"+i+"` for propType `"+u+"`, expected a function.");for(var m=f.toArray(),v=0,g=m.length;v<g;v++){var y=e.apply(void 0,[m,v,i,s,u+"["+v+"]"].concat(l));if(y instanceof Error)return y}})}function l(e,t,n,r){return s(function(){for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return c(e,n,r).apply(void 0,i)||t&&(u=t,s(function(e,t,n,r,o){for(var i=arguments.length,a=Array(i>5?i-5:0),s=5;s<i;s++)a[s-5]=arguments[s];var c=e[t];if("function"!=typeof u)return new Error("Invalid keysTypeChecker (optional second argument) supplied to `"+n+"` for propType `"+o+"`, expected a function.");for(var l=c.keySeq().toArray(),p=0,f=l.length;p<f;p++){var h=u.apply(void 0,[l,p,n,r,o+" -> key("+l[p]+")"].concat(a));if(h instanceof Error)return h}})).apply(void 0,i);var u})}function p(e){var t=void 0===arguments[1]?"Iterable":arguments[1],n=void 0===arguments[2]?r.Iterable.isIterable:arguments[2];return s(function(r,o,i,s,u){for(var c=arguments.length,l=Array(c>5?c-5:0),p=5;p<c;p++)l[p-5]=arguments[p];var f=r[o];if(!n(f)){var h=a(f);return new Error("Invalid "+s+" `"+u+"` of type `"+h+"` supplied to `"+i+"`, expected an Immutable.js "+t+".")}var d=f.toObject();for(var m in e){var v=e[m];if(v){var g=v.apply(void 0,[d,m,i,s,u+"."+m].concat(l));if(g)return g}}})}function f(e){return p(e)}e.exports=i},function(e,t,n){var r=n(16);function o(){return e.exports=o=r||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}e.exports=o},function(e,t,n){"use strict";e.exports=function(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}},function(e,t){var n=e.exports={version:"2.6.5"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";var r=n(57);e.exports=r},function(e,t,n){"use strict";n.r(t),n.d(t,"isOAS3",function(){return s}),n.d(t,"isSwagger2",function(){return u}),n.d(t,"OAS3ComponentWrapFactory",function(){return c});var r=n(20),o=n.n(r),i=n(0),a=n.n(i);function s(e){var t=e.get("openapi");return"string"==typeof t&&(t.startsWith("3.0.")&&t.length>4)}function u(e){var t=e.get("swagger");return"string"==typeof t&&t.startsWith("2.0")}function c(e){return function(t,n){return function(r){return n&&n.specSelectors&&n.specSelectors.specJson?s(n.specSelectors.specJson())?a.a.createElement(e,o()({},r,n,{Ori:t})):a.a.createElement(t,r):(console.warn("OAS3 wrapper: couldn't get spec"),null)}}}},function(e,t,n){"use strict"; +/* object-assign (c) Sindre Sorhus @license MIT +*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=a(e),c=1;c<arguments.length;c++){for(var l in n=Object(arguments[c]))o.call(n,l)&&(u[l]=n[l]);if(r){s=r(n);for(var p=0;p<s.length;p++)i.call(n,s[p])&&(u[s[p]]=n[s[p]])}}return u}},function(e,t,n){var r=n(557),o=n(563);function i(e){return(i="function"==typeof o&&"symbol"==typeof r?function(e){return typeof e}:function(e){return e&&"function"==typeof o&&e.constructor===o&&e!==o.prototype?"symbol":typeof e})(e)}function a(t){return"function"==typeof o&&"symbol"===i(r)?e.exports=a=function(e){return i(e)}:e.exports=a=function(e){return e&&"function"==typeof o&&e.constructor===o&&e!==o.prototype?"symbol":i(e)},a(t)}e.exports=a},function(e,t,n){"use strict";var r=n(21),o=n(115),i=n(422),a=(n(15),o.ID_ATTRIBUTE_NAME),s=i,u="__reactInternalInstance$"+Math.random().toString(36).slice(2);function c(e,t){return 1===e.nodeType&&e.getAttribute(a)===String(t)||8===e.nodeType&&e.nodeValue===" react-text: "+t+" "||8===e.nodeType&&e.nodeValue===" react-empty: "+t+" "}function l(e){for(var t;t=e._renderedComponent;)e=t;return e}function p(e,t){var n=l(e);n._hostNode=t,t[u]=n}function f(e,t){if(!(e._flags&s.hasCachedChildNodes)){var n=e._renderedChildren,o=t.firstChild;e:for(var i in n)if(n.hasOwnProperty(i)){var a=n[i],u=l(a)._domID;if(0!==u){for(;null!==o;o=o.nextSibling)if(c(o,u)){p(a,o);continue e}r("32",u)}}e._flags|=s.hasCachedChildNodes}}function h(e){if(e[u])return e[u];for(var t,n,r=[];!e[u];){if(r.push(e),!e.parentNode)return null;e=e.parentNode}for(;e&&(n=e[u]);e=r.pop())t=n,r.length&&f(n,e);return t}var d={getClosestInstanceFromNode:h,getInstanceFromNode:function(e){var t=h(e);return null!=t&&t._hostNode===e?t:null},getNodeFromInstance:function(e){if(void 0===e._hostNode&&r("33"),e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent||r("34"),e=e._hostParent;for(;t.length;e=t.pop())f(e,e._hostNode);return e._hostNode},precacheChildNodes:f,precacheNode:p,uncacheNode:function(e){var t=e._hostNode;t&&(delete t[u],e._hostNode=null)}};e.exports=d},function(e,t,n){e.exports=n(552)},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_SPEC",function(){return $}),n.d(t,"UPDATE_URL",function(){return G}),n.d(t,"UPDATE_JSON",function(){return Z}),n.d(t,"UPDATE_PARAM",function(){return X}),n.d(t,"UPDATE_EMPTY_PARAM_INCLUSION",function(){return Q}),n.d(t,"VALIDATE_PARAMS",function(){return ee}),n.d(t,"SET_RESPONSE",function(){return te}),n.d(t,"SET_REQUEST",function(){return ne}),n.d(t,"SET_MUTATED_REQUEST",function(){return re}),n.d(t,"LOG_REQUEST",function(){return oe}),n.d(t,"CLEAR_RESPONSE",function(){return ie}),n.d(t,"CLEAR_REQUEST",function(){return ae}),n.d(t,"CLEAR_VALIDATE_PARAMS",function(){return se}),n.d(t,"UPDATE_OPERATION_META_VALUE",function(){return ue}),n.d(t,"UPDATE_RESOLVED",function(){return ce}),n.d(t,"UPDATE_RESOLVED_SUBTREE",function(){return le}),n.d(t,"SET_SCHEME",function(){return pe}),n.d(t,"updateSpec",function(){return he}),n.d(t,"updateResolved",function(){return de}),n.d(t,"updateUrl",function(){return me}),n.d(t,"updateJsonSpec",function(){return ve}),n.d(t,"parseToJson",function(){return ge}),n.d(t,"resolveSpec",function(){return be}),n.d(t,"requestResolvedSubtree",function(){return xe}),n.d(t,"changeParam",function(){return Ee}),n.d(t,"changeParamByIdentity",function(){return Se}),n.d(t,"updateResolvedSubtree",function(){return Ce}),n.d(t,"invalidateResolvedSubtreeCache",function(){return ke}),n.d(t,"validateParams",function(){return Oe}),n.d(t,"updateEmptyParamInclusion",function(){return Ae}),n.d(t,"clearValidateParams",function(){return Te}),n.d(t,"changeConsumesValue",function(){return je}),n.d(t,"changeProducesValue",function(){return Pe}),n.d(t,"setResponse",function(){return Ie}),n.d(t,"setRequest",function(){return Me}),n.d(t,"setMutatedRequest",function(){return Ne}),n.d(t,"logRequest",function(){return Re}),n.d(t,"executeRequest",function(){return De}),n.d(t,"execute",function(){return Le}),n.d(t,"clearResponse",function(){return Ue}),n.d(t,"clearRequest",function(){return qe}),n.d(t,"setScheme",function(){return Fe});var r=n(94),o=n.n(r),i=n(60),a=n.n(i),s=n(61),u=n.n(s),c=n(55),l=n.n(c),p=n(2),f=n.n(p),h=n(40),d=n.n(h),m=n(332),v=n.n(m),g=n(16),y=n.n(g),b=n(17),_=n.n(b),w=n(192),x=n.n(w),E=n(123),S=n.n(E),C=n(193),k=n.n(C),O=n(54),A=n.n(O),T=n(14),j=n.n(T),P=n(26),I=n.n(P),M=n(146),N=n.n(M),R=n(1),D=n(95),L=n.n(D),U=n(119),q=n.n(U),F=n(283),B=n.n(F),z=n(479),V=n.n(z),H=n(333),W=n.n(H),J=n(3);function K(e,t){var n=_()(e);if(l.a){var r=l()(e);t&&(r=r.filter(function(t){return u()(e,t).enumerable})),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?K(n,!0).forEach(function(t){f()(e,t,n[t])}):a.a?o()(e,a()(n)):K(n).forEach(function(t){A()(e,t,u()(n,t))})}return e}var $="spec_update_spec",G="spec_update_url",Z="spec_update_json",X="spec_update_param",Q="spec_update_empty_param_inclusion",ee="spec_validate_param",te="spec_set_response",ne="spec_set_request",re="spec_set_mutated_request",oe="spec_log_request",ie="spec_clear_response",ae="spec_clear_request",se="spec_clear_validate_param",ue="spec_update_operation_meta_value",ce="spec_update_resolved",le="spec_update_resolved_subtree",pe="set_scheme",fe=function(e){return B()(e)?e:""};function he(e){var t=fe(e).replace(/\t/g," ");if("string"==typeof e)return{type:$,payload:t}}function de(e){return{type:ce,payload:e}}function me(e){return{type:G,payload:e}}function ve(e){return{type:Z,payload:e}}var ge=function(e){return function(t){var n=t.specActions,r=t.specSelectors,o=t.errActions,i=r.specStr,a=null;try{e=e||i(),o.clear({source:"parser"}),a=N.a.safeLoad(e)}catch(e){return console.error(e),o.newSpecErr({source:"parser",level:"error",message:e.reason,line:e.mark&&e.mark.line?e.mark.line+1:void 0})}return a&&"object"===I()(a)?n.updateJsonSpec(a):{}}},ye=!1,be=function(e,t){return function(n){var r=n.specActions,o=n.specSelectors,i=n.errActions,a=n.fn,s=a.fetch,u=a.resolve,c=a.AST,l=void 0===c?{}:c,p=n.getConfigs;ye||(console.warn("specActions.resolveSpec is deprecated since v3.10.0 and will be removed in v4.0.0; use requestResolvedSubtree instead!"),ye=!0);var f=p(),h=f.modelPropertyMacro,d=f.parameterMacro,m=f.requestInterceptor,v=f.responseInterceptor;void 0===e&&(e=o.specJson()),void 0===t&&(t=o.url());var g=l.getLineNumberForPath?l.getLineNumberForPath:function(){},y=o.specStr();return u({fetch:s,spec:e,baseDoc:t,modelPropertyMacro:h,parameterMacro:d,requestInterceptor:m,responseInterceptor:v}).then(function(e){var t=e.spec,n=e.errors;if(i.clear({type:"thrown"}),j()(n)&&n.length>0){var o=n.map(function(e){return console.error(e),e.line=e.fullPath?g(y,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",A()(e,"message",{enumerable:!0,value:e.message}),e});i.newThrownErrBatch(o)}return r.updateResolved(t)})}},_e=[],we=V()(k()(S.a.mark(function e(){var t,n,r,o,i,a,s,u,c,l,p,f,h,d,m,v,g;return S.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=_e.system){e.next=4;break}return console.error("debResolveSubtrees: don't have a system to operate on, aborting."),e.abrupt("return");case 4:if(n=t.errActions,r=t.errSelectors,o=t.fn,i=o.resolveSubtree,a=o.AST,s=void 0===a?{}:a,u=t.specSelectors,c=t.specActions,i){e.next=8;break}return console.error("Error: Swagger-Client did not provide a `resolveSubtree` method, doing nothing."),e.abrupt("return");case 8:return l=s.getLineNumberForPath?s.getLineNumberForPath:function(){},p=u.specStr(),f=t.getConfigs(),h=f.modelPropertyMacro,d=f.parameterMacro,m=f.requestInterceptor,v=f.responseInterceptor,e.prev=11,e.next=14,_e.reduce(function(){var e=k()(S.a.mark(function e(t,o){var a,s,c,f,g,y,b;return S.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return a=e.sent,s=a.resultMap,c=a.specWithCurrentSubtrees,e.next=7,i(c,o,{baseDoc:u.url(),modelPropertyMacro:h,parameterMacro:d,requestInterceptor:m,responseInterceptor:v});case 7:return f=e.sent,g=f.errors,y=f.spec,r.allErrors().size&&n.clearBy(function(e){return"thrown"!==e.get("type")||"resolver"!==e.get("source")||!e.get("fullPath").every(function(e,t){return e===o[t]||void 0===o[t]})}),j()(g)&&g.length>0&&(b=g.map(function(e){return e.line=e.fullPath?l(p,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",A()(e,"message",{enumerable:!0,value:e.message}),e}),n.newThrownErrBatch(b)),W()(s,o,y),W()(c,o,y),e.abrupt("return",{resultMap:s,specWithCurrentSubtrees:c});case 15:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),x.a.resolve({resultMap:(u.specResolvedSubtree([])||Object(R.Map)()).toJS(),specWithCurrentSubtrees:u.specJson().toJS()}));case 14:g=e.sent,delete _e.system,_e=[],e.next=22;break;case 19:e.prev=19,e.t0=e.catch(11),console.error(e.t0);case 22:c.updateResolvedSubtree([],g.resultMap);case 23:case"end":return e.stop()}},e,null,[[11,19]])})),35),xe=function(e){return function(t){_e.map(function(e){return e.join("@@")}).indexOf(e.join("@@"))>-1||(_e.push(e),_e.system=t,we())}};function Ee(e,t,n,r,o){return{type:X,payload:{path:e,value:r,paramName:t,paramIn:n,isXml:o}}}function Se(e,t,n,r){return{type:X,payload:{path:e,param:t,value:n,isXml:r}}}var Ce=function(e,t){return{type:le,payload:{path:e,value:t}}},ke=function(){return{type:le,payload:{path:[],value:Object(R.Map)()}}},Oe=function(e,t){return{type:ee,payload:{pathMethod:e,isOAS3:t}}},Ae=function(e,t,n,r){return{type:Q,payload:{pathMethod:e,paramName:t,paramIn:n,includeEmptyValue:r}}};function Te(e){return{type:se,payload:{pathMethod:e}}}function je(e,t){return{type:ue,payload:{path:e,value:t,key:"consumes_value"}}}function Pe(e,t){return{type:ue,payload:{path:e,value:t,key:"produces_value"}}}var Ie=function(e,t,n){return{payload:{path:e,method:t,res:n},type:te}},Me=function(e,t,n){return{payload:{path:e,method:t,req:n},type:ne}},Ne=function(e,t,n){return{payload:{path:e,method:t,req:n},type:re}},Re=function(e){return{payload:e,type:oe}},De=function(e){return function(t){var n=t.fn,r=t.specActions,o=t.specSelectors,i=t.getConfigs,a=t.oas3Selectors,s=e.pathName,u=e.method,c=e.operation,l=i(),p=l.requestInterceptor,f=l.responseInterceptor,h=c.toJS();if(c&&c.get("parameters")&&c.get("parameters").filter(function(e){return e&&!0===e.get("allowEmptyValue")}).forEach(function(t){if(o.parameterInclusionSettingFor([s,u],t.get("name"),t.get("in"))){e.parameters=e.parameters||{};var n=Object(J.C)(t,e.parameters);(!n||n&&0===n.size)&&(e.parameters[t.get("name")]="")}}),e.contextUrl=L()(o.url()).toString(),h&&h.operationId?e.operationId=h.operationId:h&&s&&u&&(e.operationId=n.opId(h,s,u)),o.isOAS3()){var d="".concat(s,":").concat(u);e.server=a.selectedServer(d)||a.selectedServer();var m=a.serverVariables({server:e.server,namespace:d}).toJS(),g=a.serverVariables({server:e.server}).toJS();e.serverVariables=_()(m).length?m:g,e.requestContentType=a.requestContentType(s,u),e.responseContentType=a.responseContentType(s,u)||"*/*";var b=a.requestBodyValue(s,u);Object(J.t)(b)?e.requestBody=JSON.parse(b):b&&b.toJS?e.requestBody=b.toJS():e.requestBody=b}var w=y()({},e);w=n.buildRequest(w),r.setRequest(e.pathName,e.method,w);e.requestInterceptor=function(t){var n=p.apply(this,[t]),o=y()({},n);return r.setMutatedRequest(e.pathName,e.method,o),n},e.responseInterceptor=f;var x=v()();return n.execute(e).then(function(t){t.duration=v()()-x,r.setResponse(e.pathName,e.method,t)}).catch(function(t){console.error(t),r.setResponse(e.pathName,e.method,{error:!0,err:q()(t)})})}},Le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.path,n=e.method,r=d()(e,["path","method"]);return function(e){var o=e.fn.fetch,i=e.specSelectors,a=e.specActions,s=i.specJsonWithResolvedSubtrees().toJS(),u=i.operationScheme(t,n),c=i.contentTypeValues([t,n]).toJS(),l=c.requestContentType,p=c.responseContentType,f=/xml/i.test(l),h=i.parameterValues([t,n],f).toJS();return a.executeRequest(Y({},r,{fetch:o,spec:s,pathName:t,method:n,parameters:h,requestContentType:l,scheme:u,responseContentType:p}))}};function Ue(e,t){return{type:ie,payload:{path:e,method:t}}}function qe(e,t){return{type:ae,payload:{path:e,method:t}}}function Fe(e,t,n){return{type:pe,payload:{scheme:e,path:t,method:n}}}},function(e,t,n){var r=n(32),o=n(22),i=n(63),a=n(77),s=n(75),u=function(e,t,n){var c,l,p,f=e&u.F,h=e&u.G,d=e&u.S,m=e&u.P,v=e&u.B,g=e&u.W,y=h?o:o[t]||(o[t]={}),b=y.prototype,_=h?r:d?r[t]:(r[t]||{}).prototype;for(c in h&&(n=t),n)(l=!f&&_&&void 0!==_[c])&&s(y,c)||(p=l?_[c]:n[c],y[c]=h&&"function"!=typeof _[c]?n[c]:v&&l?i(p,r):g&&_[c]==p?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(p):m&&"function"==typeof p?i(Function.call,p):p,m&&((y.virtual||(y.virtual={}))[c]=p,e&u.R&&b&&!b[c]&&a(b,c,p)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){"use strict";var r=n(138),o=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],i=["scalar","sequence","mapping"];e.exports=function(e,t){var n,a;if(t=t||{},Object.keys(t).forEach(function(t){if(-1===o.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=(n=t.styleAliases||null,a={},null!==n&&Object.keys(n).forEach(function(e){n[e].forEach(function(t){a[String(t)]=e})}),a),-1===i.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(197)("wks"),o=n(199),i=n(41).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t,n){var r=n(214)("wks"),o=n(159),i=n(32).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t,n){var r=n(41),o=n(72),i=n(81),a=n(97),s=n(153),u=function(e,t,n){var c,l,p,f,h=e&u.F,d=e&u.G,m=e&u.S,v=e&u.P,g=e&u.B,y=d?r:m?r[t]||(r[t]={}):(r[t]||{}).prototype,b=d?o:o[t]||(o[t]={}),_=b.prototype||(b.prototype={});for(c in d&&(n=t),n)p=((l=!h&&y&&void 0!==y[c])?y:n)[c],f=g&&l?s(p,r):v&&"function"==typeof p?s(Function.call,p):p,y&&a(y,c,p,e&u.U),b[c]!=p&&i(b,c,f),v&&_[c]!=p&&(_[c]=p)};r.core=o,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=o},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function o(e,t){return!!e&&r.call(e,t)}var i=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function a(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function s(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var u=/&([a-z#][a-z0-9]{1,31});/gi,c=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,l=n(463);function p(e,t){var n=0;return o(l,t)?l[t]:35===t.charCodeAt(0)&&c.test(t)&&a(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?s(n):e}var f=/[&<>"]/,h=/[&<>"]/g,d={"&":"&","<":"<",">":">",'"':"""};function m(e){return d[e]}t.assign=function(e){return[].slice.call(arguments,1).forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e},t.isString=function(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)},t.has=o,t.unescapeMd=function(e){return e.indexOf("\\")<0?e:e.replace(i,"$1")},t.isValidEntityCode=a,t.fromCodePoint=s,t.replaceEntities=function(e){return e.indexOf("&")<0?e:e.replace(u,p)},t.escapeHtml=function(e){return f.test(e)?e.replace(h,m):e}},function(e,t,n){var r=n(55),o=n(771);e.exports=function(e,t){if(null==e)return{};var n,i,a=o(e,t);if(r){var s=r(e);for(i=0;i<s.length;i++)n=s[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(35),o=n(99),i=n(73),a=/"/g,s=function(e,t,n,r){var o=String(i(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,""")+'"'),s+">"+o+"</"+t+">"};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*o(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){"use strict";n.r(t),n.d(t,"NEW_THROWN_ERR",function(){return i}),n.d(t,"NEW_THROWN_ERR_BATCH",function(){return a}),n.d(t,"NEW_SPEC_ERR",function(){return s}),n.d(t,"NEW_SPEC_ERR_BATCH",function(){return u}),n.d(t,"NEW_AUTH_ERR",function(){return c}),n.d(t,"CLEAR",function(){return l}),n.d(t,"CLEAR_BY",function(){return p}),n.d(t,"newThrownErr",function(){return f}),n.d(t,"newThrownErrBatch",function(){return h}),n.d(t,"newSpecErr",function(){return d}),n.d(t,"newSpecErrBatch",function(){return m}),n.d(t,"newAuthErr",function(){return v}),n.d(t,"clear",function(){return g}),n.d(t,"clearBy",function(){return y});var r=n(119),o=n.n(r),i="err_new_thrown_err",a="err_new_thrown_err_batch",s="err_new_spec_err",u="err_new_spec_err_batch",c="err_new_auth_err",l="err_clear",p="err_clear_by";function f(e){return{type:i,payload:o()(e)}}function h(e){return{type:a,payload:e}}function d(e){return{type:s,payload:e}}function m(e){return{type:u,payload:e}}function v(e){return{type:c,payload:e}}function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:l,payload:e}}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!0};return{type:p,payload:e}}},function(e,t,n){var r=n(98);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r=n(43);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){var r=n(64),o=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a),i(o,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){var r=n(46),o=n(349),i=n(218),a=Object.defineProperty;t.f=n(50)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){e.exports=!n(82)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(366),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){"use strict";e.exports={debugTool:null}},function(e,t,n){e.exports=n(573)},function(e,t,n){e.exports=n(770)},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=45)}([function(e,t){e.exports=n(17)},function(e,t){e.exports=n(14)},function(e,t){e.exports=n(26)},function(e,t){e.exports=n(16)},function(e,t){e.exports=n(123)},function(e,t){e.exports=n(60)},function(e,t){e.exports=n(61)},function(e,t){e.exports=n(55)},function(e,t){e.exports=n(2)},function(e,t){e.exports=n(54)},function(e,t){e.exports=n(94)},function(e,t){e.exports=n(28)},function(e,t){e.exports=n(930)},function(e,t){e.exports=n(12)},function(e,t){e.exports=n(192)},function(e,t){e.exports=n(936)},function(e,t){e.exports=n(93)},function(e,t){e.exports=n(193)},function(e,t){e.exports=n(939)},function(e,t){e.exports=n(943)},function(e,t){e.exports=n(944)},function(e,t){e.exports=n(92)},function(e,t){e.exports=n(13)},function(e,t){e.exports=n(146)},function(e,t){e.exports=n(4)},function(e,t){e.exports=n(5)},function(e,t){e.exports=n(946)},function(e,t){e.exports=n(421)},function(e,t){e.exports=n(949)},function(e,t){e.exports=n(52)},function(e,t){e.exports=n(64)},function(e,t){e.exports=n(283)},function(e,t){e.exports=n(272)},function(e,t){e.exports=n(950)},function(e,t){e.exports=n(145)},function(e,t){e.exports=n(951)},function(e,t){e.exports=n(959)},function(e,t){e.exports=n(960)},function(e,t){e.exports=n(961)},function(e,t){e.exports=n(40)},function(e,t){e.exports=n(264)},function(e,t){e.exports=n(37)},function(e,t){e.exports=n(964)},function(e,t){e.exports=n(965)},function(e,t){e.exports=n(966)},function(e,t,n){e.exports=n(50)},function(e,t){e.exports=n(967)},function(e,t){e.exports=n(968)},function(e,t){e.exports=n(969)},function(e,t){e.exports=n(970)},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"path",function(){return mn}),n.d(r,"query",function(){return vn}),n.d(r,"header",function(){return yn}),n.d(r,"cookie",function(){return bn});var o=n(9),i=n.n(o),a=n(10),s=n.n(a),u=n(5),c=n.n(u),l=n(6),p=n.n(l),f=n(7),h=n.n(f),d=n(0),m=n.n(d),v=n(8),g=n.n(v),y=(n(46),n(15)),b=n.n(y),_=n(20),w=n.n(_),x=n(12),E=n.n(x),S=n(4),C=n.n(S),k=n(22),O=n.n(k),A=n(11),T=n.n(A),j=n(2),P=n.n(j),I=n(1),M=n.n(I),N=n(17),R=n.n(N),D=(n(47),n(26)),L=n.n(D),U=n(23),q=n.n(U),F=n(31),B=n.n(F),z={serializeRes:J,mergeInQueryOrForm:Z};function V(e){return H.apply(this,arguments)}function H(){return(H=R()(C.a.mark(function e(t){var n,r,o,i,a,s=arguments;return C.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=s.length>1&&void 0!==s[1]?s[1]:{},"object"===P()(t)&&(t=(n=t).url),n.headers=n.headers||{},z.mergeInQueryOrForm(n),n.headers&&m()(n.headers).forEach(function(e){var t=n.headers[e];"string"==typeof t&&(n.headers[e]=t.replace(/\n+/g," "))}),!n.requestInterceptor){e.next=12;break}return e.next=8,n.requestInterceptor(n);case 8:if(e.t0=e.sent,e.t0){e.next=11;break}e.t0=n;case 11:n=e.t0;case 12:return r=n.headers["content-type"]||n.headers["Content-Type"],/multipart\/form-data/i.test(r)&&(delete n.headers["content-type"],delete n.headers["Content-Type"]),e.prev=14,e.next=17,(n.userFetch||fetch)(n.url,n);case 17:return o=e.sent,e.next=20,z.serializeRes(o,t,n);case 20:if(o=e.sent,!n.responseInterceptor){e.next=28;break}return e.next=24,n.responseInterceptor(o);case 24:if(e.t1=e.sent,e.t1){e.next=27;break}e.t1=o;case 27:o=e.t1;case 28:e.next=38;break;case 30:if(e.prev=30,e.t2=e.catch(14),o){e.next=34;break}throw e.t2;case 34:throw(i=new Error(o.statusText)).statusCode=i.status=o.status,i.responseError=e.t2,i;case 38:if(o.ok){e.next=43;break}throw(a=new Error(o.statusText)).statusCode=a.status=o.status,a.response=o,a;case 43:return e.abrupt("return",o);case 44:case"end":return e.stop()}},e,null,[[14,30]])}))).apply(this,arguments)}var W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return/(json|xml|yaml|text)\b/.test(e)};function J(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).loadSpec,r=void 0!==n&&n,o={ok:e.ok,url:e.url||t,status:e.status,statusText:e.statusText,headers:K(e.headers)},i=o.headers["content-type"],a=r||W(i);return(a?e.text:e.blob||e.buffer).call(e).then(function(e){if(o.text=e,o.data=e,a)try{var t=function(e,t){return t&&(0===t.indexOf("application/json")||t.indexOf("+json")>0)?JSON.parse(e):q.a.safeLoad(e)}(e,i);o.body=t,o.obj=t}catch(e){o.parseError=e}return o})}function K(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return"function"==typeof e.forEach?(e.forEach(function(e,n){void 0!==t[n]?(t[n]=M()(t[n])?t[n]:[t[n]],t[n].push(e)):t[n]=e}),t):t}function Y(e,t){return t||"undefined"==typeof navigator||(t=navigator),t&&"ReactNative"===t.product?!(!e||"object"!==P()(e)||"string"!=typeof e.uri):"undefined"!=typeof File?e instanceof File:null!==e&&"object"===P()(e)&&"function"==typeof e.pipe}function $(e,t){var n=e.collectionFormat,r=e.allowEmptyValue,o="object"===P()(e)?e.value:e;if(void 0===o&&r)return"";if(Y(o)||"boolean"==typeof o)return o;var i=encodeURIComponent;return t&&(i=B()(o)?function(e){return e}:function(e){return T()(e)}),"object"!==P()(o)||M()(o)?M()(o)?M()(o)&&!n?o.map(i).join(","):"multi"===n?o.map(i):o.map(i).join({csv:",",ssv:"%20",tsv:"%09",pipes:"|"}[n]):i(o):""}function G(e){var t=m()(e).reduce(function(t,n){var r,o=e[n],i=!!o.skipEncoding,a=i?n:encodeURIComponent(n),s=(r=o)&&"object"===P()(r)&&!M()(o);return t[a]=$(s?o:{value:o},i),t},{});return L.a.stringify(t,{encode:!1,indices:!1})||""}function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.url,r=void 0===t?"":t,o=e.query,i=e.form;if(i){var a=m()(i).some(function(e){return Y(i[e].value)}),s=e.headers["content-type"]||e.headers["Content-Type"];if(a||/multipart\/form-data/i.test(s)){var u=n(48);e.body=new u,m()(i).forEach(function(t){e.body.append(t,$(i[t],!0))})}else e.body=G(i);delete e.form}if(o){var c=r.split("?"),l=O()(c,2),p=l[0],f=l[1],h="";if(f){var d=L.a.parse(f);m()(o).forEach(function(e){return delete d[e]}),h=L.a.stringify(d,{encode:!0})}var v=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.filter(function(e){return e}).join("&");return r?"?".concat(r):""}(h,G(o));e.url=p+v,delete e.query}return e}var X=n(14),Q=n.n(X),ee=n(21),te=n.n(ee),ne=n(27),re=n.n(ne),oe=n(3),ie=n.n(oe),ae=n(24),se=n.n(ae),ue=n(25),ce=n.n(ue),le=n(32),pe=n.n(le),fe=n(13),he=n.n(fe),de=n(18),me=n.n(de),ve=n(33),ge=n.n(ve),ye=n(34),be=n.n(ye),_e={add:function(e,t){return{op:"add",path:e,value:t}},replace:xe,remove:function(e,t){return{op:"remove",path:e}},merge:function(e,t){return{type:"mutation",op:"merge",path:e,value:t}},mergeDeep:function(e,t){return{type:"mutation",op:"mergeDeep",path:e,value:t}},context:function(e,t){return{type:"context",path:e,value:t}},getIn:function(e,t){return t.reduce(function(e,t){return void 0!==t&&e?e[t]:e},e)},applyPatch:function(e,t,n){if(n=n||{},"merge"===(t=ie()({},t,{path:t.path&&we(t.path)})).op){var r=Re(e,t.path);ie()(r,t.value),me.a.applyPatch(e,[xe(t.path,r)])}else if("mergeDeep"===t.op){var o=Re(e,t.path);for(var i in t.value){var a=t.value[i],s=M()(a);if(s){var u=o[i]||[];o[i]=u.concat(a)}else if(Te(a)&&!s){var c=ie()({},o[i]);for(var l in a){if(Object.prototype.hasOwnProperty.call(c,l)){c=ge()(be()({},c),a);break}ie()(c,g()({},l,a[l]))}o[i]=c}else o[i]=a}}else if("add"===t.op&&""===t.path&&Te(t.value)){var p=m()(t.value).reduce(function(e,n){return e.push({op:"add",path:"/".concat(we(n)),value:t.value[n]}),e},[]);me.a.applyPatch(e,p)}else if("replace"===t.op&&""===t.path){var f=t.value;n.allowMetaPatches&&t.meta&&Me(t)&&(M()(t.value)||Te(t.value))&&(f=ie()({},f,t.meta)),e=f}else if(me.a.applyPatch(e,[t]),n.allowMetaPatches&&t.meta&&Me(t)&&(M()(t.value)||Te(t.value))){var h=Re(e,t.path),d=ie()({},h,t.meta);me.a.applyPatch(e,[xe(t.path,d)])}return e},parentPathMatch:function(e,t){if(!M()(t))return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0},flatten:Oe,fullyNormalizeArray:function(e){return Ae(Oe(ke(e)))},normalizeArray:ke,isPromise:function(e){return Te(e)&&je(e.then)},forEachNew:function(e,t){try{return Ee(e,Ce,t)}catch(e){return e}},forEachNewPrimitive:function(e,t){try{return Ee(e,Se,t)}catch(e){return e}},isJsonPatch:Pe,isContextPatch:function(e){return Ne(e)&&"context"===e.type},isPatch:Ne,isMutation:Ie,isAdditiveMutation:Me,isGenerator:function(e){return C.a.isGeneratorFunction(e)},isFunction:je,isObject:Te,isError:function(e){return e instanceof Error}};function we(e){return M()(e)?e.length<1?"":"/"+e.map(function(e){return(e+"").replace(/~/g,"~0").replace(/\//g,"~1")}).join("/"):e}function xe(e,t,n){return{op:"replace",path:e,value:t,meta:n}}function Ee(e,t,n){return Ae(Oe(e.filter(Me).map(function(e){return t(e.value,n,e.path)})||[]))}function Se(e,t,n){return n=n||[],M()(e)?e.map(function(e,r){return Se(e,t,n.concat(r))}):Te(e)?m()(e).map(function(r){return Se(e[r],t,n.concat(r))}):t(e,n[n.length-1],n)}function Ce(e,t,n){var r=[];if((n=n||[]).length>0){var o=t(e,n[n.length-1],n);o&&(r=r.concat(o))}if(M()(e)){var i=e.map(function(e,r){return Ce(e,t,n.concat(r))});i&&(r=r.concat(i))}else if(Te(e)){var a=m()(e).map(function(r){return Ce(e[r],t,n.concat(r))});a&&(r=r.concat(a))}return r=Oe(r)}function ke(e){return M()(e)?e:[e]}function Oe(e){var t;return(t=[]).concat.apply(t,he()(e.map(function(e){return M()(e)?Oe(e):e})))}function Ae(e){return e.filter(function(e){return void 0!==e})}function Te(e){return e&&"object"===P()(e)}function je(e){return e&&"function"==typeof e}function Pe(e){if(Ne(e)){var t=e.op;return"add"===t||"remove"===t||"replace"===t}return!1}function Ie(e){return Pe(e)||Ne(e)&&"mutation"===e.type}function Me(e){return Ie(e)&&("add"===e.op||"replace"===e.op||"merge"===e.op||"mergeDeep"===e.op)}function Ne(e){return e&&"object"===P()(e)}function Re(e,t){try{return me.a.getValueByPointer(e,t)}catch(e){return console.error(e),{}}}var De=n(35),Le=n.n(De),Ue=n(36),qe=n(28),Fe=n.n(qe);function Be(e,t){function n(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack;for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.message=n[0],t&&t.apply(this,n)}return n.prototype=new Error,n.prototype.name=e,n.prototype.constructor=n,n}var ze=n(37),Ve=n.n(ze),He=["properties"],We=["properties"],Je=["definitions","parameters","responses","securityDefinitions","components/schemas","components/responses","components/parameters","components/securitySchemes"],Ke=["schema/example","items/example"];function Ye(e){var t=e[e.length-1],n=e[e.length-2],r=e.join("/");return He.indexOf(t)>-1&&-1===We.indexOf(n)||Je.indexOf(r)>-1||Ke.some(function(e){return r.indexOf(e)>-1})}function $e(e,t){var n=e.split("#"),r=O()(n,2),o=r[0],i=r[1],a=E.a.resolve(o||"",t||"");return i?"".concat(a,"#").concat(i):a}var Ge="application/json, application/yaml",Ze=new RegExp("^([a-z]+://|//)","i"),Xe=Be("JSONRefError",function(e,t,n){this.originalError=n,ie()(this,t||{})}),Qe={},et=new Le.a,tt=[function(e){return"paths"===e[0]&&"responses"===e[3]&&"content"===e[5]&&"example"===e[7]},function(e){return"paths"===e[0]&&"requestBody"===e[3]&&"content"===e[4]&&"example"===e[6]}],nt={key:"$ref",plugin:function(e,t,n,r){var o=r.getInstance(),i=n.slice(0,-1);if(!Ye(i)&&(a=i,!tt.some(function(e){return e(a)}))){var a,s=r.getContext(n).baseDoc;if("string"!=typeof e)return new Xe("$ref: must be a string (JSON-Ref)",{$ref:e,baseDoc:s,fullPath:n});var u,c,l,p=st(e),f=p[0],h=p[1]||"";try{u=s||f?it(f,s):null}catch(t){return at(t,{pointer:h,$ref:e,basePath:u,fullPath:n})}if(function(e,t,n,r){var o=et.get(r);o||(o={},et.set(r,o));var i=function(e){if(0===e.length)return"";return"/".concat(e.map(ht).join("/"))}(n),a="".concat(t||"<specmap-base>","#").concat(e),s=i.replace(/allOf\/\d+\/?/g,""),u=r.contextTree.get([]).baseDoc;if(t==u&&mt(s,e))return!0;var c="";if(n.some(function(e){return c="".concat(c,"/").concat(ht(e)),o[c]&&o[c].some(function(e){return mt(e,a)||mt(a,e)})}))return!0;o[s]=(o[s]||[]).concat(a)}(h,u,i,r)&&!o.useCircularStructures){var d=$e(e,u);return e===d?null:_e.replace(n,d)}if(null==u?(l=pt(h),void 0===(c=r.get(l))&&(c=new Xe("Could not resolve reference: ".concat(e),{pointer:h,$ref:e,baseDoc:s,fullPath:n}))):c=null!=(c=ut(u,h)).__value?c.__value:c.catch(function(t){throw at(t,{pointer:h,$ref:e,baseDoc:s,fullPath:n})}),c instanceof Error)return[_e.remove(n),c];var v=$e(e,u),g=_e.replace(i,c,{$$ref:v});if(u&&u!==s)return[g,_e.context(i,{baseDoc:u})];try{if(!function(e,t){var n=[e];return t.path.reduce(function(e,t){return n.push(e[t]),e[t]},e),function e(t){return _e.isObject(t)&&(n.indexOf(t)>=0||m()(t).some(function(n){return e(t[n])}))}(t.value)}(r.state,g)||o.useCircularStructures)return g}catch(e){return null}}}},rt=ie()(nt,{docCache:Qe,absoluteify:it,clearCache:function(e){void 0!==e?delete Qe[e]:m()(Qe).forEach(function(e){delete Qe[e]})},JSONRefError:Xe,wrapError:at,getDoc:ct,split:st,extractFromDoc:ut,fetchJSON:function(e){return Object(Ue.fetch)(e,{headers:{Accept:Ge},loadSpec:!0}).then(function(e){return e.text()}).then(function(e){return q.a.safeLoad(e)})},extract:lt,jsonPointerToArray:pt,unescapeJsonPointerToken:ft}),ot=rt;function it(e,t){if(!Ze.test(e)){if(!t)throw new Xe("Tried to resolve a relative URL, without having a basePath. path: '".concat(e,"' basePath: '").concat(t,"'"));return E.a.resolve(t,e)}return e}function at(e,t){var n;return n=e&&e.response&&e.response.body?"".concat(e.response.body.code," ").concat(e.response.body.message):e.message,new Xe("Could not resolve reference: ".concat(n),t,e)}function st(e){return(e+"").split("#")}function ut(e,t){var n=Qe[e];if(n&&!_e.isPromise(n))try{var r=lt(t,n);return ie()(Q.a.resolve(r),{__value:r})}catch(e){return Q.a.reject(e)}return ct(e).then(function(e){return lt(t,e)})}function ct(e){var t=Qe[e];return t?_e.isPromise(t)?t:Q.a.resolve(t):(Qe[e]=rt.fetchJSON(e).then(function(t){return Qe[e]=t,t}),Qe[e])}function lt(e,t){var n=pt(e);if(n.length<1)return t;var r=_e.getIn(t,n);if(void 0===r)throw new Xe("Could not resolve pointer: ".concat(e," does not exist in document"),{pointer:e});return r}function pt(e){if("string"!=typeof e)throw new TypeError("Expected a string, got a ".concat(P()(e)));return"/"===e[0]&&(e=e.substr(1)),""===e?[]:e.split("/").map(ft)}function ft(e){return"string"!=typeof e?e:Fe.a.unescape(e.replace(/~1/g,"/").replace(/~0/g,"~"))}function ht(e){return Fe.a.escape(e.replace(/~/g,"~0").replace(/\//g,"~1"))}var dt=function(e){return!e||"/"===e||"#"===e};function mt(e,t){if(dt(t))return!0;var n=e.charAt(t.length),r=t.slice(-1);return 0===e.indexOf(t)&&(!n||"/"===n||"#"===n)&&"#"!==r}var vt={key:"allOf",plugin:function(e,t,n,r,o){if(!o.meta||!o.meta.$$ref){var i=n.slice(0,-1);if(!Ye(i)){if(!M()(e)){var a=new TypeError("allOf must be an array");return a.fullPath=n,a}var s=!1,u=o.value;i.forEach(function(e){u&&(u=u[e])}),delete(u=ie()({},u)).allOf;var c=[];return c.push(r.replace(i,{})),e.forEach(function(e,t){if(!r.isObject(e)){if(s)return null;s=!0;var o=new TypeError("Elements in allOf must be objects");return o.fullPath=n,c.push(o)}c.push(r.mergeDeep(i,e));var a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.specmap,o=n.getBaseUrlForNodePath,i=void 0===o?function(e){return r.getContext([].concat(he()(t),he()(e))).baseDoc}:o,a=n.targetKeys,s=void 0===a?["$ref","$$ref"]:a,u=[];return Ve()(e).forEach(function(){if(s.indexOf(this.key)>-1){var e=this.path,n=t.concat(this.path),o=$e(this.node,i(e));u.push(r.replace(n,o))}}),u}(e,n.slice(0,-1),{getBaseUrlForNodePath:function(e){return r.getContext([].concat(he()(n),[t],he()(e))).baseDoc},specmap:r});c.push.apply(c,he()(a))}),c.push(r.mergeDeep(i,u)),u.$$ref||c.push(r.remove([].concat(i,"$$ref"))),c}}}},gt={key:"parameters",plugin:function(e,t,n,r,o){if(M()(e)&&e.length){var i=ie()([],e),a=n.slice(0,-1),s=ie()({},_e.getIn(r.spec,a));return e.forEach(function(e,t){try{i[t].default=r.parameterMacro(s,e)}catch(e){var o=new Error(e);return o.fullPath=n,o}}),_e.replace(n,i)}return _e.replace(n,e)}},yt={key:"properties",plugin:function(e,t,n,r){var o=ie()({},e);for(var i in e)try{o[i].default=r.modelPropertyMacro(o[i])}catch(e){var a=new Error(e);return a.fullPath=n,a}return _e.replace(n,o)}};function bt(e,t){var n=m()(e);if(h.a){var r=h()(e);t&&(r=r.filter(function(t){return p()(e,t).enumerable})),n.push.apply(n,r)}return n}var _t=function(){function e(t){se()(this,e),this.root=wt(t||{})}return ce()(e,[{key:"set",value:function(e,t){var n=this.getParent(e,!0);if(n){var r=e[e.length-1],o=n.children;o[r]?xt(o[r],t,n):o[r]=wt(t,n)}else xt(this.root,t,null)}},{key:"get",value:function(e){if((e=e||[]).length<1)return this.root.value;for(var t,n,r=this.root,o=0;o<e.length&&(n=e[o],(t=r.children)[n]);o++)r=t[n];return r&&r.protoValue}},{key:"getParent",value:function(e,t){return!e||e.length<1?null:e.length<2?this.root:e.slice(0,-1).reduce(function(e,n){if(!e)return e;var r=e.children;return!r[n]&&t&&(r[n]=wt(null,e)),r[n]},this.root)}}]),e}();function wt(e,t){return xt({children:{}},e,t)}function xt(e,t,n){return e.value=t||{},e.protoValue=n?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bt(n,!0).forEach(function(t){g()(e,t,n[t])}):c.a?s()(e,c()(n)):bt(n).forEach(function(t){i()(e,t,p()(n,t))})}return e}({},n.protoValue,{},e.value):e.value,m()(e.children).forEach(function(t){var n=e.children[t];e.children[t]=xt(n,n.value,e)}),e}var Et=function(){function e(t){var n=this;se()(this,e),ie()(this,{spec:"",debugLevel:"info",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new _t,showDebug:!1,allPatches:[],pluginProp:"specMap",libMethods:ie()(re()(this),_e,{getInstance:function(){return n}}),allowMetaPatches:!1},t),this.get=this._get.bind(this),this.getContext=this._getContext.bind(this),this.hasRun=this._hasRun.bind(this),this.wrappedPlugins=this.plugins.map(this.wrapPlugin.bind(this)).filter(_e.isFunction),this.patches.push(_e.add([],this.spec)),this.patches.push(_e.context([],this.context)),this.updatePatches(this.patches)}return ce()(e,[{key:"debug",value:function(e){if(this.debugLevel===e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(t=console).log.apply(t,r)}}},{key:"verbose",value:function(e){if("verbose"===this.debugLevel){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(t=console).log.apply(t,["[".concat(e,"] ")].concat(r))}}},{key:"wrapPlugin",value:function(e,t){var n,r,o,i=this.pathDiscriminator,a=null;return e[this.pluginProp]?(a=e,n=e[this.pluginProp]):_e.isFunction(e)?n=e:_e.isObject(e)&&(r=e,o=function(e,t){return!M()(e)||e.every(function(e,n){return e===t[n]})},n=C.a.mark(function e(t,n){var a,s,u,c,l,p,f,h,d;return C.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:d=function(e,t,u){var c,l,p,f,h,v,g,y,b,_,w,x,E;return C.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(_e.isObject(e)){a.next=6;break}if(r.key!==t[t.length-1]){a.next=4;break}return a.next=4,r.plugin(e,r.key,t,n);case 4:a.next=30;break;case 6:c=t.length-1,l=t[c],p=t.indexOf("properties"),f="properties"===l&&c===p,h=n.allowMetaPatches&&s[e.$$ref],v=0,g=m()(e);case 12:if(!(v<g.length)){a.next=30;break}if(y=g[v],b=e[y],_=t.concat(y),w=_e.isObject(b),x=e.$$ref,h){a.next=22;break}if(!w){a.next=22;break}return n.allowMetaPatches&&x&&(s[x]=!0),a.delegateYield(d(b,_,u),"t0",22);case 22:if(f||y!==r.key){a.next=27;break}if(E=o(i,t),i&&!E){a.next=27;break}return a.next=27,r.plugin(b,y,_,n,u);case 27:v++,a.next=12;break;case 30:case"end":return a.stop()}},a)},a=C.a.mark(d),s={},u=!0,c=!1,l=void 0,e.prev=6,p=te()(t.filter(_e.isAdditiveMutation));case 8:if(u=(f=p.next()).done){e.next=14;break}return h=f.value,e.delegateYield(d(h.value,h.path,h),"t0",11);case 11:u=!0,e.next=8;break;case 14:e.next=20;break;case 16:e.prev=16,e.t1=e.catch(6),c=!0,l=e.t1;case 20:e.prev=20,e.prev=21,u||null==p.return||p.return();case 23:if(e.prev=23,!c){e.next=26;break}throw l;case 26:return e.finish(23);case 27:return e.finish(20);case 28:case"end":return e.stop()}},e,null,[[6,16,20,28],[21,,23,27]])})),ie()(n.bind(a),{pluginName:e.name||t,isGenerator:_e.isGenerator(n)})}},{key:"nextPlugin",value:function(){var e=this;return pe()(this.wrappedPlugins,function(t){return e.getMutationsForPlugin(t).length>0})}},{key:"nextPromisedPatch",value:function(){if(this.promisedPatches.length>0)return Q.a.race(this.promisedPatches.map(function(e){return e.value}))}},{key:"getPluginHistory",value:function(e){var t=this.getPluginName(e);return this.pluginHistory[t]||[]}},{key:"getPluginRunCount",value:function(e){return this.getPluginHistory(e).length}},{key:"getPluginHistoryTip",value:function(e){var t=this.getPluginHistory(e);return t&&t[t.length-1]||{}}},{key:"getPluginMutationIndex",value:function(e){var t=this.getPluginHistoryTip(e).mutationIndex;return"number"!=typeof t?-1:t}},{key:"getPluginName",value:function(e){return e.pluginName}},{key:"updatePluginHistory",value:function(e,t){var n=this.getPluginName(e);(this.pluginHistory[n]=this.pluginHistory[n]||[]).push(t)}},{key:"updatePatches",value:function(e,t){var n=this;_e.normalizeArray(e).forEach(function(e){if(e instanceof Error)n.errors.push(e);else try{if(!_e.isObject(e))return void n.debug("updatePatches","Got a non-object patch",e);if(n.showDebug&&n.allPatches.push(e),_e.isPromise(e.value))return n.promisedPatches.push(e),void n.promisedPatchThen(e);if(_e.isContextPatch(e))return void n.setContext(e.path,e.value);if(_e.isMutation(e))return void n.updateMutations(e)}catch(e){console.error(e),n.errors.push(e)}})}},{key:"updateMutations",value:function(e){"object"===P()(e.value)&&!M()(e.value)&&this.allowMetaPatches&&(e.value=ie()({},e.value));var t=_e.applyPatch(this.state,e,{allowMetaPatches:this.allowMetaPatches});t&&(this.mutations.push(e),this.state=t)}},{key:"removePromisedPatch",value:function(e){var t=this.promisedPatches.indexOf(e);t<0?this.debug("Tried to remove a promisedPatch that isn't there!"):this.promisedPatches.splice(t,1)}},{key:"promisedPatchThen",value:function(e){var t=this;return e.value=e.value.then(function(n){var r=ie()({},e,{value:n});t.removePromisedPatch(e),t.updatePatches(r)}).catch(function(n){t.removePromisedPatch(e),t.updatePatches(n)})}},{key:"getMutations",value:function(e,t){return e=e||0,"number"!=typeof t&&(t=this.mutations.length),this.mutations.slice(e,t)}},{key:"getCurrentMutations",value:function(){return this.getMutationsForPlugin(this.getCurrentPlugin())}},{key:"getMutationsForPlugin",value:function(e){var t=this.getPluginMutationIndex(e);return this.getMutations(t+1)}},{key:"getCurrentPlugin",value:function(){return this.currentPlugin}},{key:"getPatchesOfType",value:function(e,t){return e.filter(t)}},{key:"getLib",value:function(){return this.libMethods}},{key:"_get",value:function(e){return _e.getIn(this.state,e)}},{key:"_getContext",value:function(e){return this.contextTree.get(e)}},{key:"setContext",value:function(e,t){return this.contextTree.set(e,t)}},{key:"_hasRun",value:function(e){return this.getPluginRunCount(this.getCurrentPlugin())>(e||0)}},{key:"_clone",value:function(e){return JSON.parse(T()(e))}},{key:"dispatch",value:function(){var e=this,t=this,n=this.nextPlugin();if(!n){var r=this.nextPromisedPatch();if(r)return r.then(function(){return e.dispatch()}).catch(function(){return e.dispatch()});var o={spec:this.state,errors:this.errors};return this.showDebug&&(o.patches=this.allPatches),Q.a.resolve(o)}if(t.pluginCount=t.pluginCount||{},t.pluginCount[n]=(t.pluginCount[n]||0)+1,t.pluginCount[n]>100)return Q.a.resolve({spec:t.state,errors:t.errors.concat(new Error("We've reached a hard limit of ".concat(100," plugin runs")))});if(n!==this.currentPlugin&&this.promisedPatches.length){var i=this.promisedPatches.map(function(e){return e.value});return Q.a.all(i.map(function(e){return e.then(Function,Function)})).then(function(){return e.dispatch()})}return function(){t.currentPlugin=n;var e=t.getCurrentMutations(),r=t.mutations.length-1;try{if(n.isGenerator){var o=!0,i=!1,s=void 0;try{for(var u,c=te()(n(e,t.getLib()));!(o=(u=c.next()).done);o=!0){a(u.value)}}catch(e){i=!0,s=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw s}}}else{a(n(e,t.getLib()))}}catch(e){console.error(e),a([ie()(re()(e),{plugin:n})])}finally{t.updatePluginHistory(n,{mutationIndex:r})}return t.dispatch()}();function a(e){e&&(e=_e.fullyNormalizeArray(e),t.updatePatches(e,n))}}}]),e}();var St={refs:ot,allOf:vt,parameters:gt,properties:yt},Ct=n(29),kt=n.n(Ct),Ot=function(e){return String.prototype.toLowerCase.call(e)},At=function(e){return e.replace(/[^\w]/gi,"_")};function Tt(e){var t=e.openapi;return!!t&&w()(t,"3")}function jt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).v2OperationIdCompatibilityMode;return e&&"object"===P()(e)?(e.operationId||"").replace(/\s/g,"").length?At(e.operationId):function(e,t){if((arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).v2OperationIdCompatibilityMode){var n="".concat(t.toLowerCase(),"_").concat(e).replace(/[\s!@#$%^&*()_+=[{\]};:<>|.\/?,\\'""-]/g,"_");return(n=n||"".concat(e.substring(1),"_").concat(t)).replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return"".concat(Ot(t)).concat(At(e))}(t,n,{v2OperationIdCompatibilityMode:r}):null}function Pt(e,t){return"".concat(Ot(t),"-").concat(e)}function It(e,t){return e&&e.paths?function(e,t){return Mt(e,t,!0)||null}(e,function(e){var n=e.pathName,r=e.method,o=e.operation;if(!o||"object"!==P()(o))return!1;var i=o.operationId;return[jt(o,n,r),Pt(n,r),i].some(function(e){return e&&e===t})}):null}function Mt(e,t,n){if(!e||"object"!==P()(e)||!e.paths||"object"!==P()(e.paths))return null;var r=e.paths;for(var o in r)for(var i in r[o])if("PARAMETERS"!==i.toUpperCase()){var a=r[o][i];if(a&&"object"===P()(a)){var s={spec:e,pathName:o,method:i.toUpperCase(),operation:a},u=t(s);if(n&&u)return s}}}function Nt(e){var t=e.spec,n=t.paths,r={};if(!n||t.$$normalized)return e;for(var o in n){var i=n[o];if(kt()(i)){var a=i.parameters,s=function(e){var n=i[e];if(!kt()(n))return"continue";var s=jt(n,o,e);if(s){r[s]?r[s].push(n):r[s]=[n];var u=r[s];if(u.length>1)u.forEach(function(e,t){e.__originalOperationId=e.__originalOperationId||e.operationId,e.operationId="".concat(s).concat(t+1)});else if(void 0!==n.operationId){var c=u[0];c.__originalOperationId=c.__originalOperationId||n.operationId,c.operationId=s}}if("parameters"!==e){var l=[],p={};for(var f in t)"produces"!==f&&"consumes"!==f&&"security"!==f||(p[f]=t[f],l.push(p));if(a&&(p.parameters=a,l.push(p)),l.length)for(var h=0,d=l;h<d.length;h++){var m=d[h];for(var v in m)if(n[v]){if("parameters"===v){var g=!0,y=!1,b=void 0;try{for(var _,w=function(){var e=_.value;n[v].some(function(t){return t.name&&t.name===e.name||t.$ref&&t.$ref===e.$ref||t.$$ref&&t.$$ref===e.$$ref||t===e})||n[v].push(e)},x=te()(m[v]);!(g=(_=x.next()).done);g=!0)w()}catch(e){y=!0,b=e}finally{try{g||null==x.return||x.return()}finally{if(y)throw b}}}}else n[v]=m[v]}}};for(var u in i)s(u)}}return t.$$normalized=!0,e}function Rt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.requestInterceptor,r=t.responseInterceptor,o=e.withCredentials?"include":"same-origin";return function(t){return e({url:t,loadSpec:!0,requestInterceptor:n,responseInterceptor:r,headers:{Accept:Ge},credentials:o}).then(function(e){return e.body})}}function Dt(e){var t=e.fetch,n=e.spec,r=e.url,o=e.mode,i=e.allowMetaPatches,a=void 0===i||i,s=e.pathDiscriminator,u=e.modelPropertyMacro,c=e.parameterMacro,l=e.requestInterceptor,p=e.responseInterceptor,f=e.skipNormalization,h=e.useCircularStructures,d=e.http,m=e.baseDoc;return m=m||r,d=t||d||V,n?v(n):Rt(d,{requestInterceptor:l,responseInterceptor:p})(m).then(v);function v(e){m&&(St.refs.docCache[m]=e),St.refs.fetchJSON=Rt(d,{requestInterceptor:l,responseInterceptor:p});var t,n=[St.refs];return"function"==typeof c&&n.push(St.parameters),"function"==typeof u&&n.push(St.properties),"strict"!==o&&n.push(St.allOf),(t={spec:e,context:{baseDoc:m},plugins:n,allowMetaPatches:a,pathDiscriminator:s,parameterMacro:c,modelPropertyMacro:u,useCircularStructures:h},new Et(t).dispatch()).then(f?function(){var e=R()(C.a.mark(function e(t){return C.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t);case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}():Nt)}}var Lt=n(16),Ut=n.n(Lt);function qt(e,t){var n=m()(e);if(h.a){var r=h()(e);t&&(r=r.filter(function(t){return p()(e,t).enumerable})),n.push.apply(n,r)}return n}function Ft(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qt(n,!0).forEach(function(t){g()(e,t,n[t])}):c.a?s()(e,c()(n)):qt(n).forEach(function(t){i()(e,t,p()(n,t))})}return e}function Bt(){return(Bt=R()(C.a.mark(function e(t,n){var r,o,i,a,s,u,c,l,p,f,h,d,m=arguments;return C.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=m.length>2&&void 0!==m[2]?m[2]:{},o=r.returnEntireTree,i=r.baseDoc,a=r.requestInterceptor,s=r.responseInterceptor,u=r.parameterMacro,c=r.modelPropertyMacro,l=r.useCircularStructures,p={pathDiscriminator:n,baseDoc:i,requestInterceptor:a,responseInterceptor:s,parameterMacro:u,modelPropertyMacro:c,useCircularStructures:l},f=Nt({spec:t}),h=f.spec,e.next=6,Dt(Ft({},p,{spec:h,allowMetaPatches:!0,skipNormalization:!0}));case 6:return d=e.sent,!o&&M()(n)&&n.length&&(d.spec=Ut()(d.spec,n)||null),e.abrupt("return",d);case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}var zt=n(38),Vt=n.n(zt);function Ht(e,t){var n=m()(e);if(h.a){var r=h()(e);t&&(r=r.filter(function(t){return p()(e,t).enumerable})),n.push.apply(n,r)}return n}function Wt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ht(n,!0).forEach(function(t){g()(e,t,n[t])}):c.a?s()(e,c()(n)):Ht(n).forEach(function(t){i()(e,t,p()(n,t))})}return e}var Jt=function(){return null},Kt=function(e){return M()(e)?e:[e]},Yt={mapTagOperations:function(e){var t=e.spec,n=e.cb,r=void 0===n?Jt:n,o=e.defaultTag,i=void 0===o?"default":o,a=e.v2OperationIdCompatibilityMode,s={},u={};return Mt(t,function(e){var n=e.pathName,o=e.method,c=e.operation;(c.tags?Kt(c.tags):[i]).forEach(function(e){if("string"==typeof e){var i=u[e]=u[e]||{},l=jt(c,n,o,{v2OperationIdCompatibilityMode:a}),p=r({spec:t,pathName:n,method:o,operation:c,operationId:l});if(s[l])s[l]++,i["".concat(l).concat(s[l])]=p;else if(void 0!==i[l]){var f=s[l]||1;s[l]=f+1,i["".concat(l).concat(s[l])]=p;var h=i[l];delete i[l],i["".concat(l).concat(f)]=h}else i[l]=p}})}),u},makeExecute:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var n=t.pathName,r=t.method,o=t.operationId;return function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.execute(Wt({spec:e.spec},Vt()(e,"requestInterceptor","responseInterceptor","userFetch"),{pathName:n,method:r,parameters:t,operationId:o},i))}}}};var $t=n(39),Gt=n.n($t),Zt=n(40),Xt=n.n(Zt),Qt=n(41),en=n.n(Qt),tn=n(19),nn=n.n(tn),rn=n(42),on=n.n(rn),an={body:function(e){var t=e.req,n=e.value;t.body=n},header:function(e){var t=e.req,n=e.parameter,r=e.value;t.headers=t.headers||{},void 0!==r&&(t.headers[n.name]=r)},query:function(e){var t=e.req,n=e.value,r=e.parameter;t.query=t.query||{},!1===n&&"boolean"===r.type&&(n="false");0===n&&["number","integer"].indexOf(r.type)>-1&&(n="0");if(n)t.query[r.name]={collectionFormat:r.collectionFormat,value:n};else if(r.allowEmptyValue&&void 0!==n){var o=r.name;t.query[o]=t.query[o]||{},t.query[o].allowEmptyValue=!0}},path:function(e){var t=e.req,n=e.value,r=e.parameter;t.url=t.url.split("{".concat(r.name,"}")).join(encodeURIComponent(n))},formData:function(e){var t=e.req,n=e.value,r=e.parameter;(n||r.allowEmptyValue)&&(t.form=t.form||{},t.form[r.name]={value:n,allowEmptyValue:r.allowEmptyValue,collectionFormat:r.collectionFormat})}};n(49);var sn=n(43),un=n.n(sn),cn=n(44),ln=function(e){return":/?#[]@!$&'()*+,;=".indexOf(e)>-1},pn=function(e){return/^[a-z0-9\-._~]+$/i.test(e)};function fn(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).escape,n=arguments.length>2?arguments[2]:void 0;return"number"==typeof e&&(e=e.toString()),"string"==typeof e&&e.length&&t?n?JSON.parse(e):Object(cn.stringToCharArray)(e).map(function(e){return pn(e)?e:ln(e)&&"unsafe"===t?e:(un()(e)||[]).map(function(e){return"0".concat(e.toString(16).toUpperCase()).slice(-2)}).map(function(e){return"%".concat(e)}).join("")}).join(""):e}function hn(e){var t=e.value;return M()(t)?function(e){var t=e.key,n=e.value,r=e.style,o=e.explode,i=e.escape,a=function(e){return fn(e,{escape:i})};if("simple"===r)return n.map(function(e){return a(e)}).join(",");if("label"===r)return".".concat(n.map(function(e){return a(e)}).join("."));if("matrix"===r)return n.map(function(e){return a(e)}).reduce(function(e,n){return!e||o?"".concat(e||"",";").concat(t,"=").concat(n):"".concat(e,",").concat(n)},"");if("form"===r){var s=o?"&".concat(t,"="):",";return n.map(function(e){return a(e)}).join(s)}if("spaceDelimited"===r){var u=o?"".concat(t,"="):"";return n.map(function(e){return a(e)}).join(" ".concat(u))}if("pipeDelimited"===r){var c=o?"".concat(t,"="):"";return n.map(function(e){return a(e)}).join("|".concat(c))}}(e):"object"===P()(t)?function(e){var t=e.key,n=e.value,r=e.style,o=e.explode,i=e.escape,a=function(e){return fn(e,{escape:i})},s=m()(n);if("simple"===r)return s.reduce(function(e,t){var r=a(n[t]),i=o?"=":",",s=e?"".concat(e,","):"";return"".concat(s).concat(t).concat(i).concat(r)},"");if("label"===r)return s.reduce(function(e,t){var r=a(n[t]),i=o?"=":".",s=e?"".concat(e,"."):".";return"".concat(s).concat(t).concat(i).concat(r)},"");if("matrix"===r&&o)return s.reduce(function(e,t){var r=a(n[t]),o=e?"".concat(e,";"):";";return"".concat(o).concat(t,"=").concat(r)},"");if("matrix"===r)return s.reduce(function(e,r){var o=a(n[r]),i=e?"".concat(e,","):";".concat(t,"=");return"".concat(i).concat(r,",").concat(o)},"");if("form"===r)return s.reduce(function(e,t){var r=a(n[t]),i=e?"".concat(e).concat(o?"&":","):"",s=o?"=":",";return"".concat(i).concat(t).concat(s).concat(r)},"")}(e):function(e){var t=e.key,n=e.value,r=e.style,o=e.escape,i=function(e){return fn(e,{escape:o})};if("simple"===r)return i(n);if("label"===r)return".".concat(i(n));if("matrix"===r)return";".concat(t,"=").concat(i(n));if("form"===r)return i(n);if("deepObject"===r)return i(n)}(e)}function dn(e,t){return t.includes("application/json")?"string"==typeof e?e:T()(e):e.toString()}function mn(e){var t=e.req,n=e.value,r=e.parameter,o=r.name,i=r.style,a=r.explode,s=r.content;if(s){var u=m()(s)[0];t.url=t.url.split("{".concat(o,"}")).join(fn(dn(n,u),{escape:!0}))}else{var c=hn({key:r.name,value:n,style:i||"simple",explode:a||!1,escape:!0});t.url=t.url.split("{".concat(o,"}")).join(c)}}function vn(e){var t=e.req,n=e.value,r=e.parameter;if(t.query=t.query||{},r.content){var o=m()(r.content)[0];t.query[r.name]=dn(n,o)}else if(!1===n&&(n="false"),0===n&&(n="0"),n){var i=P()(n);if("deepObject"===r.style)m()(n).forEach(function(e){var o=n[e];t.query["".concat(r.name,"[").concat(e,"]")]={value:hn({key:e,value:o,style:"deepObject",escape:r.allowReserved?"unsafe":"reserved"}),skipEncoding:!0}});else if("object"!==i||M()(n)||"form"!==r.style&&r.style||!r.explode&&void 0!==r.explode){var a=encodeURIComponent(r.name);t.query[a]={value:hn({key:a,value:n,style:r.style||"form",explode:void 0===r.explode||r.explode,escape:r.allowReserved?"unsafe":"reserved"}),skipEncoding:!0}}else{m()(n).forEach(function(e){var o=n[e];t.query[e]={value:hn({key:e,value:o,style:r.style||"form",escape:r.allowReserved?"unsafe":"reserved"}),skipEncoding:!0}})}}else if(r.allowEmptyValue&&void 0!==n){var s=r.name;t.query[s]=t.query[s]||{},t.query[s].allowEmptyValue=!0}}var gn=["accept","authorization","content-type"];function yn(e){var t=e.req,n=e.parameter,r=e.value;if(t.headers=t.headers||{},!(gn.indexOf(n.name.toLowerCase())>-1))if(n.content){var o=m()(n.content)[0];t.headers[n.name]=dn(r,o)}else void 0!==r&&(t.headers[n.name]=hn({key:n.name,value:r,style:n.style||"simple",explode:void 0!==n.explode&&n.explode,escape:!1}))}function bn(e){var t=e.req,n=e.parameter,r=e.value;t.headers=t.headers||{};var o=P()(r);if(n.content){var i=m()(n.content)[0];t.headers.Cookie="".concat(n.name,"=").concat(dn(r,i))}else if("undefined"!==o){var a="object"===o&&!M()(r)&&n.explode?"":"".concat(n.name,"=");t.headers.Cookie=a+hn({key:n.name,value:r,escape:!1,style:n.style||"form",explode:void 0!==n.explode&&n.explode})}}var _n=n(30),wn=function(e,t){var n=e.operation,r=e.requestBody,o=e.securities,i=e.spec,a=e.attachContentTypeForEmptyPayload,s=e.requestContentType;t=function(e){var t=e.request,n=e.securities,r=void 0===n?{}:n,o=e.operation,i=void 0===o?{}:o,a=e.spec,s=b()({},t),u=r.authorized,c=void 0===u?{}:u,l=i.security||a.security||[],p=c&&!!m()(c).length,f=Ut()(a,["components","securitySchemes"])||{};if(s.headers=s.headers||{},s.query=s.query||{},!m()(r).length||!p||!l||M()(i.security)&&!i.security.length)return t;return l.forEach(function(e,t){for(var n in e){var r=c[n],o=f[n];if(r){var i=r.value||r,a=o.type;if(r)if("apiKey"===a)"query"===o.in&&(s.query[o.name]=i),"header"===o.in&&(s.headers[o.name]=i),"cookie"===o.in&&(s.cookies[o.name]=i);else if("http"===a){if("basic"===o.scheme){var u=i.username,l=i.password,p=nn()("".concat(u,":").concat(l));s.headers.Authorization="Basic ".concat(p)}"bearer"===o.scheme&&(s.headers.Authorization="Bearer ".concat(i))}else if("oauth2"===a){var h=r.token||{},d=h[o["x-tokenName"]||"access_token"],m=h.token_type;m&&"bearer"!==m.toLowerCase()||(m="Bearer"),s.headers.Authorization="".concat(m," ").concat(d)}}}}),s}({request:t,securities:o,operation:n,spec:i});var u=n.requestBody||{},c=m()(u.content||{}),l=s&&c.indexOf(s)>-1;if(r||a){if(s&&l)t.headers["Content-Type"]=s;else if(!s){var p=c[0];p&&(t.headers["Content-Type"]=p,s=p)}}else s&&l&&(t.headers["Content-Type"]=s);return r&&(s?c.indexOf(s)>-1&&("application/x-www-form-urlencoded"===s||0===s.indexOf("multipart/")?"object"===P()(r)?(t.form={},m()(r).forEach(function(e){var n,o,i=r[e];"undefined"!=typeof File&&(o=i instanceof File),"undefined"!=typeof Blob&&(o=o||i instanceof Blob),void 0!==_n.Buffer&&(o=o||_n.Buffer.isBuffer(i)),n="object"!==P()(i)||o?i:M()(i)?i.toString():T()(i),t.form[e]={value:n}})):t.form=r:t.body=r):t.body=r),t};var xn=function(e,t){var n=e.spec,r=e.operation,o=e.securities,i=e.requestContentType,a=e.attachContentTypeForEmptyPayload;if((t=function(e){var t=e.request,n=e.securities,r=void 0===n?{}:n,o=e.operation,i=void 0===o?{}:o,a=e.spec,s=b()({},t),u=r.authorized,c=void 0===u?{}:u,l=r.specSecurity,p=void 0===l?[]:l,f=i.security||p,h=c&&!!m()(c).length,d=a.securityDefinitions;if(s.headers=s.headers||{},s.query=s.query||{},!m()(r).length||!h||!f||M()(i.security)&&!i.security.length)return t;return f.forEach(function(e,t){for(var n in e){var r=c[n];if(r){var o=r.token,i=r.value||r,a=d[n],u=a.type,l=a["x-tokenName"]||"access_token",p=o&&o[l],f=o&&o.token_type;if(r)if("apiKey"===u){var h="query"===a.in?"query":"headers";s[h]=s[h]||{},s[h][a.name]=i}else"basic"===u?i.header?s.headers.authorization=i.header:(i.base64=nn()("".concat(i.username,":").concat(i.password)),s.headers.authorization="Basic ".concat(i.base64)):"oauth2"===u&&p&&(f=f&&"bearer"!==f.toLowerCase()?f:"Bearer",s.headers.authorization="".concat(f," ").concat(p))}}}),s}({request:t,securities:o,operation:r,spec:n})).body||t.form||a)i?t.headers["Content-Type"]=i:M()(r.consumes)?t.headers["Content-Type"]=r.consumes[0]:M()(n.consumes)?t.headers["Content-Type"]=n.consumes[0]:r.parameters&&r.parameters.filter(function(e){return"file"===e.type}).length?t.headers["Content-Type"]="multipart/form-data":r.parameters&&r.parameters.filter(function(e){return"formData"===e.in}).length&&(t.headers["Content-Type"]="application/x-www-form-urlencoded");else if(i){var s=r.parameters&&r.parameters.filter(function(e){return"body"===e.in}).length>0,u=r.parameters&&r.parameters.filter(function(e){return"formData"===e.in}).length>0;(s||u)&&(t.headers["Content-Type"]=i)}return t};function En(e,t){var n=m()(e);if(h.a){var r=h()(e);t&&(r=r.filter(function(t){return p()(e,t).enumerable})),n.push.apply(n,r)}return n}function Sn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?En(n,!0).forEach(function(t){g()(e,t,n[t])}):c.a?s()(e,c()(n)):En(n).forEach(function(t){i()(e,t,p()(n,t))})}return e}var Cn=function(e){return M()(e)?e:[]},kn=Be("OperationNotFoundError",function(e,t,n){this.originalError=n,ie()(this,t||{})}),On=function(e,t){return t.filter(function(t){return t.name===e})},An=function(e){var t={};e.forEach(function(e){t[e.in]||(t[e.in]={}),t[e.in][e.name]=e});var n=[];return m()(t).forEach(function(e){m()(t[e]).forEach(function(r){n.push(t[e][r])})}),n},Tn={buildRequest:jn};function jn(e){var t=e.spec,n=e.operationId,o=(e.securities,e.requestContentType,e.responseContentType),i=e.scheme,a=e.requestInterceptor,s=e.responseInterceptor,u=e.contextUrl,c=e.userFetch,l=(e.requestBody,e.server),p=e.serverVariables,f=e.http,h=e.parameters,d=e.parameterBuilders,v=Tt(t);d||(d=v?r:an);var g={url:"",credentials:f&&f.withCredentials?"include":"same-origin",headers:{},cookies:{}};a&&(g.requestInterceptor=a),s&&(g.responseInterceptor=s),c&&(g.userFetch=c);var y=It(t,n);if(!y)throw new kn("Operation ".concat(n," not found"));var b,_=y.operation,w=void 0===_?{}:_,x=y.method,S=y.pathName;if(g.url+=Tt((b={spec:t,scheme:i,contextUrl:u,server:l,serverVariables:p,pathName:S,method:x}).spec)?function(e){var t=e.spec,n=e.pathName,r=e.method,o=e.server,i=e.contextUrl,a=e.serverVariables,s=void 0===a?{}:a,u=Ut()(t,["paths",n,(r||"").toLowerCase(),"servers"])||Ut()(t,["paths",n,"servers"])||Ut()(t,["servers"]),c="",l=null;if(o&&u&&u.length){var p=u.map(function(e){return e.url});p.indexOf(o)>-1&&(c=o,l=u[p.indexOf(o)])}return!c&&u&&u.length&&(c=u[0].url,l=u[0]),c.indexOf("{")>-1&&function(e){for(var t,n=[],r=/{([^}]+)}/g;t=r.exec(e);)n.push(t[1]);return n}(c).forEach(function(e){if(l.variables&&l.variables[e]){var t=l.variables[e],n=s[e]||t.default,r=new RegExp("{".concat(e,"}"),"g");c=c.replace(r,n)}}),function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=E.a.parse(t),o=E.a.parse(n),i=Pn(r.protocol)||Pn(o.protocol)||"",a=r.host||o.host,s=r.pathname||"";return"/"===(e=i&&a?"".concat(i,"://").concat(a+s):s)[e.length-1]?e.slice(0,-1):e}(c,i)}(b):function(e){var t,n=e.spec,r=e.scheme,o=e.contextUrl,i=void 0===o?"":o,a=E.a.parse(i),s=M()(n.schemes)?n.schemes[0]:null,u=r||s||Pn(a.protocol)||"http",c=n.host||a.host||"",l=n.basePath||"";return"/"===(t=u&&c?"".concat(u,"://").concat(c+l):l)[t.length-1]?t.slice(0,-1):t}(b),!n)return delete g.cookies,g;g.url+=S,g.method="".concat(x).toUpperCase(),h=h||{};var C=t.paths[S]||{};o&&(g.headers.accept=o);var k=An([].concat(Cn(w.parameters)).concat(Cn(C.parameters)));k.forEach(function(e){var n,r=d[e.in];if("body"===e.in&&e.schema&&e.schema.properties&&(n=h),void 0===(n=e&&e.name&&h[e.name])?n=e&&e.name&&h["".concat(e.in,".").concat(e.name)]:On(e.name,k).length>1&&console.warn("Parameter '".concat(e.name,"' is ambiguous because the defined spec has more than one parameter with the name: '").concat(e.name,"' and the passed-in parameter values did not define an 'in' value.")),null!==n){if(void 0!==e.default&&void 0===n&&(n=e.default),void 0===n&&e.required&&!e.allowEmptyValue)throw new Error("Required parameter ".concat(e.name," is not provided"));if(v&&e.schema&&"object"===e.schema.type&&"string"==typeof n)try{n=JSON.parse(n)}catch(e){throw new Error("Could not parse object parameter value string as JSON")}r&&r({req:g,parameter:e,value:n,operation:w,spec:t})}});var O=Sn({},e,{operation:w});if((g=v?wn(O,g):xn(O,g)).cookies&&m()(g.cookies).length){var A=m()(g.cookies).reduce(function(e,t){var n=g.cookies[t];return e+(e?"&":"")+on.a.serialize(t,n)},"");g.headers.Cookie=A}return g.cookies&&delete g.cookies,Z(g),g}var Pn=function(e){return e?e.replace(/\W/g,""):null};function In(e,t){var n=m()(e);if(h.a){var r=h()(e);t&&(r=r.filter(function(t){return p()(e,t).enumerable})),n.push.apply(n,r)}return n}function Mn(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof e?n.url=e:n=e,!(this instanceof Mn))return new Mn(n);b()(this,n);var r=this.resolve().then(function(){return t.disableInterfaces||b()(t,Mn.makeApisTagOperation(t)),t});return r.client=this,r}Mn.http=V,Mn.makeHttp=function(e,t,n){return n=n||function(e){return e},t=t||function(e){return e},function(r){return"string"==typeof r&&(r={url:r}),z.mergeInQueryOrForm(r),r=t(r),n(e(r))}}.bind(null,Mn.http),Mn.resolve=Dt,Mn.resolveSubtree=function(e,t){return Bt.apply(this,arguments)},Mn.execute=function(e){var t=e.http,n=e.fetch,r=e.spec,o=e.operationId,i=e.pathName,a=e.method,s=e.parameters,u=e.securities,c=Gt()(e,["http","fetch","spec","operationId","pathName","method","parameters","securities"]),l=t||n||V;i&&a&&!o&&(o=Pt(i,a));var p=Tn.buildRequest(Sn({spec:r,operationId:o,parameters:s,securities:u,http:l},c));return p.body&&(Xt()(p.body)||en()(p.body))&&(p.body=T()(p.body)),l(p)},Mn.serializeRes=J,Mn.serializeHeaders=K,Mn.clearCache=function(){St.refs.clearCache()},Mn.makeApisTagOperation=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Yt.makeExecute(e);return{apis:Yt.mapTagOperations({v2OperationIdCompatibilityMode:e.v2OperationIdCompatibilityMode,spec:e.spec,cb:t})}},Mn.buildRequest=jn,Mn.helpers={opId:jt},Mn.prototype={http:V,execute:function(e){return this.applyDefaults(),Mn.execute(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?In(n,!0).forEach(function(t){g()(e,t,n[t])}):c.a?s()(e,c()(n)):In(n).forEach(function(t){i()(e,t,p()(n,t))})}return e}({spec:this.spec,http:this.http,securities:{authorized:this.authorizations},contextUrl:"string"==typeof this.url?this.url:void 0},e))},resolve:function(){var e=this;return Mn.resolve({spec:this.spec,url:this.url,allowMetaPatches:this.allowMetaPatches,useCircularStructures:this.useCircularStructures,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null}).then(function(t){return e.originalSpec=e.spec,e.spec=t.spec,e.errors=t.errors,e})}},Mn.prototype.applyDefaults=function(){var e=this.spec,t=this.url;if(t&&w()(t,"http")){var n=E.a.parse(t);e.host||(e.host=n.host),e.schemes||(e.schemes=[n.protocol.replace(":","")]),e.basePath||(e.basePath="/")}};t.default=Mn}]).default},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(426),a=n(90),s=n(427),u=n(116),c=n(185),l=n(15),p=[],f=0,h=i.getPooled(),d=!1,m=null;function v(){x.ReactReconcileTransaction&&m||r("123")}var g=[{initialize:function(){this.dirtyComponentsLength=p.length},close:function(){this.dirtyComponentsLength!==p.length?(p.splice(0,this.dirtyComponentsLength),w()):p.length=0}},{initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}}];function y(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=i.getPooled(),this.reconcileTransaction=x.ReactReconcileTransaction.getPooled(!0)}function b(e,t){return e._mountOrder-t._mountOrder}function _(e){var t=e.dirtyComponentsLength;t!==p.length&&r("124",t,p.length),p.sort(b),f++;for(var n=0;n<t;n++){var o,i=p[n],a=i._pendingCallbacks;if(i._pendingCallbacks=null,s.logTopLevelRenders){var c=i;i._currentElement.type.isReactTopLevelWrapper&&(c=i._renderedComponent),o="React update: "+c.getName(),console.time(o)}if(u.performUpdateIfNecessary(i,e.reconcileTransaction,f),o&&console.timeEnd(o),a)for(var l=0;l<a.length;l++)e.callbackQueue.enqueue(a[l],i.getPublicInstance())}}o(y.prototype,c,{getTransactionWrappers:function(){return g},destructor:function(){this.dirtyComponentsLength=null,i.release(this.callbackQueue),this.callbackQueue=null,x.ReactReconcileTransaction.release(this.reconcileTransaction),this.reconcileTransaction=null},perform:function(e,t,n){return c.perform.call(this,this.reconcileTransaction.perform,this.reconcileTransaction,e,t,n)}}),a.addPoolingTo(y);var w=function(){for(;p.length||d;){if(p.length){var e=y.getPooled();e.perform(_,null,e),y.release(e)}if(d){d=!1;var t=h;h=i.getPooled(),t.notifyAll(),i.release(t)}}};var x={ReactReconcileTransaction:null,batchedUpdates:function(e,t,n,r,o,i){return v(),m.batchedUpdates(e,t,n,r,o,i)},enqueueUpdate:function e(t){v(),m.isBatchingUpdates?(p.push(t),null==t._updateBatchNumber&&(t._updateBatchNumber=f+1)):m.batchedUpdates(e,t)},flushBatchedUpdates:w,injection:{injectReconcileTransaction:function(e){e||r("126"),x.ReactReconcileTransaction=e},injectBatchingStrategy:function(e){e||r("127"),"function"!=typeof e.batchedUpdates&&r("128"),"boolean"!=typeof e.isBatchingUpdates&&r("129"),m=e}},asap:function(e,t){l(m.isBatchingUpdates,"ReactUpdates.asap: Can't enqueue an asap callback in a context whereupdates are not being batched."),h.enqueue(e,t),d=!0}};e.exports=x},function(e,t,n){var r; +/*! + Copyright (c) 2017 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames */ -var i=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=r(e),l=1;l<arguments.length;l++){n=Object(arguments[l]);for(var c in n)o.call(n,c)&&(u[c]=n[c]);if(i){s=i(n);for(var p=0;p<s.length;p++)a.call(n,s[p])&&(u[s[p]]=n[s[p]])}}return u}},function(e,t,n){"use strict";function r(e,t){return 1===e.nodeType&&e.getAttribute(d)===String(t)||8===e.nodeType&&e.nodeValue===" react-text: "+t+" "||8===e.nodeType&&e.nodeValue===" react-empty: "+t+" "}function i(e){for(var t;t=e._renderedComponent;)e=t;return e}function o(e,t){var n=i(e);n._hostNode=t,t[v]=n}function a(e){var t=e._hostNode;t&&(delete t[v],e._hostNode=null)}function s(e,t){if(!(e._flags&m.hasCachedChildNodes)){var n=e._renderedChildren,a=t.firstChild;e:for(var s in n)if(n.hasOwnProperty(s)){var u=n[s],l=i(u)._domID;if(0!==l){for(;null!==a;a=a.nextSibling)if(r(a,l)){o(u,a);continue e}p("32",l)}}e._flags|=m.hasCachedChildNodes}}function u(e){if(e[v])return e[v];for(var t=[];!e[v];){if(t.push(e),!e.parentNode)return null;e=e.parentNode}for(var n,r;e&&(r=e[v]);e=t.pop())n=r,t.length&&s(r,e);return n}function l(e){var t=u(e);return null!=t&&t._hostNode===e?t:null}function c(e){if(void 0===e._hostNode&&p("33"),e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent||p("34"),e=e._hostParent;for(;t.length;e=t.pop())s(e,e._hostNode);return e._hostNode}var p=n(11),f=n(89),h=n(453),d=(n(8),f.ID_ATTRIBUTE_NAME),m=h,v="__reactInternalInstance$"+Math.random().toString(36).slice(2),g={getClosestInstanceFromNode:u,getInstanceFromNode:l,getNodeFromInstance:c,precacheChildNodes:s,precacheNode:o,uncacheNode:a};e.exports=g},function(e,t){var n=e.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";function r(e){var t={};return null!==e&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function i(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===a.indexOf(t))throw new o('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=r(t.styleAliases||null),-1===s.indexOf(this.kind))throw new o('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var o=n(117),a=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];e.exports=i},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(564),o=r(i),a=n(95),s=r(a);t.default=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=(0,s.default)(e);!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if((0,o.default)(Object(t)))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(e,t,n){var r=n(361)("wks"),i=n(202),o=n(31).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";t.__esModule=!0;var r=n(30),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=i.default||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){var r=n(188)("wks"),i=n(134),o=n(24).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t,n){var r=n(24),i=n(15),o=n(53),a=n(56),s=function(e,t,n){var u,l,c,p=e&s.F,f=e&s.G,h=e&s.S,d=e&s.P,m=e&s.B,v=e&s.W,g=f?i:i[t]||(i[t]={}),y=g.prototype,_=f?r:h?r[t]:(r[t]||{}).prototype;f&&(n=t);for(u in n)(l=!p&&_&&void 0!==_[u])&&u in g||(c=l?_[u]:n[u],g[u]=f&&"function"!=typeof _[u]?n[u]:m&&l?o(c,r):v&&_[u]==c?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(c):d&&"function"==typeof c?o(Function.call,c):c,d&&((g.virtual||(g.virtual={}))[u]=c,e&s.R&&y&&!y[u]&&a(y,u,c)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,e.exports=s},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=i},function(e,t,n){"use strict";function r(e){return Object.prototype.toString.call(e)}function i(e){return"[object String]"===r(e)}function o(e,t){return!!e&&d.call(e,t)}function a(e){return[].slice.call(arguments,1).forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function s(e){return e.indexOf("\\")<0?e:e.replace(m,"$1")}function u(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function l(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function c(e,t){var n=0;return o(y,t)?y[t]:35===t.charCodeAt(0)&&g.test(t)&&(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10),u(n))?l(n):e}function p(e){return e.indexOf("&")<0?e:e.replace(v,c)}function f(e){return x[e]}function h(e){return _.test(e)?e.replace(b,f):e}var d=Object.prototype.hasOwnProperty,m=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g,v=/&([a-z#][a-z0-9]{1,31});/gi,g=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,y=n(488),_=/[&<>"]/,b=/[&<>"]/g,x={"&":"&","<":"<",">":">",'"':"""};t.assign=a,t.isString=i,t.has=o,t.unescapeMd=s,t.isValidEntityCode=u,t.fromCodePoint=l,t.replaceEntities=p,t.escapeHtml=h},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(31),i=n(63),o=n(64),a=n(78),s=n(136),u=function(e,t,n){var l,c,p,f,h=e&u.F,d=e&u.G,m=e&u.S,v=e&u.P,g=e&u.B,y=d?r:m?r[t]||(r[t]={}):(r[t]||{}).prototype,_=d?i:i[t]||(i[t]={}),b=_.prototype||(_.prototype={});d&&(n=t);for(l in n)c=!h&&y&&void 0!==y[l],p=(c?y:n)[l],f=g&&c?s(p,r):v&&"function"==typeof p?s(Function.call,p):p,y&&a(y,l,p,e&u.U),_[l]!=p&&o(_,l,f),v&&b[l]!=p&&(b[l]=p)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){var r=n(28),i=n(107),o=n(57),a=/"/g,s=function(e,t,n,r){var i=String(o(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,""")+'"'),s+">"+i+"</"+t+">"};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*i(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t,n){e.exports={default:n(589),__esModule:!0}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){"use strict";function r(e){return function(){return e}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e},e.exports=i},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function o(e){if(p===clearTimeout)return clearTimeout(e);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function a(){m&&h&&(m=!1,h.length?d=h.concat(d):v=-1,d.length&&s())}function s(){if(!m){var e=i(a);m=!0;for(var t=d.length;t;){for(h=d,d=[];++v<t;)h&&h[v].run();v=-1,t=d.length}h=null,m=!1,o(e)}}function u(e,t){this.fun=e,this.array=t}function l(){}var c,p,f=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{p="function"==typeof clearTimeout?clearTimeout:r}catch(e){p=r}}();var h,d=[],m=!1,v=-1;f.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new u(e,t)),1!==d.length||m||i(s)},u.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=l,f.addListener=l,f.once=l,f.off=l,f.removeListener=l,f.removeAllListeners=l,f.emit=l,f.prependListener=l,f.prependOnceListener=l,f.listeners=function(e){return[]},f.binding=function(e){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(e){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.get("openapi");return!!t&&t.startsWith("3")}function o(e){var t=e.get("swagger");return!!t&&t.startsWith("2")}function a(e){return function(t,n){return function(r){if(n&&n.specSelectors&&n.specSelectors.specJson){return i(n.specSelectors.specJson())?c.default.createElement(e,(0,u.default)({},r,n,{Ori:t})):c.default.createElement(t,r)}return console.warn("OAS3 wrapper: couldn't get spec"),null}}}Object.defineProperty(t,"__esModule",{value:!0});var s=n(21),u=r(s);t.isOAS3=i,t.isSwagger2=o,t.OAS3ComponentWrapFactory=a;var l=n(0),c=r(l)},function(e,t,n){e.exports={default:n(588),__esModule:!0}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(331),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e,t,n){return t in e?(0,i.default)(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){var r=n(27);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){function n(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=n},function(e,t,n){"use strict";var r=null;e.exports={debugTool:r}},function(e,t,n){"use strict";(function(e){function r(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(r()<t)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=o.prototype):(null===e&&(e=new o(t)),e.length=t),e}function o(e,t,n){if(!(o.TYPED_ARRAY_SUPPORT||this instanceof o))return new o(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return a(this,e,t,n)}function a(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?f(e,t,n,r):"string"==typeof t?c(e,t,n):h(e,t)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,t,n,r){return s(t),t<=0?i(e,t):void 0!==n?"string"==typeof r?i(e,t).fill(n,r):i(e,t).fill(n):i(e,t)}function l(e,t){if(s(t),e=i(e,t<0?0:0|d(t)),!o.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function c(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!o.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|v(t,n);e=i(e,r);var a=e.write(t,n);return a!==r&&(e=e.slice(0,a)),e}function p(e,t){var n=t.length<0?0:0|d(t.length);e=i(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function f(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),o.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=o.prototype):e=p(e,t),e}function h(e,t){if(o.isBuffer(t)){var n=0|d(t.length);return e=i(e,n),0===e.length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||X(t.length)?i(e,0):p(e,t);if("Buffer"===t.type&&Z(t.data))return p(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function d(e){if(e>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function m(e){return+e!=e&&(e=0),o.alloc(+e)}function v(e,t){if(o.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return J(e).length;default:if(r)return V(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,n);case"utf8":case"utf-8":return D(this,t,n);case"ascii":return M(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function _(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"==typeof t)return t&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){function o(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}var l;if(i){var c=-1;for(l=n;l<s;l++)if(o(e,l)===o(t,-1===c?0:l-c)){if(-1===c&&(c=l),l-c+1===u)return c*a}else-1!==c&&(l-=l-c),c=-1}else for(n+u>s&&(n=s-u),l=n;l>=0;l--){for(var p=!0,f=0;f<u;f++)if(o(e,l+f)!==o(t,f)){p=!1;break}if(p)return l}return-1}function x(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function w(e,t,n,r){return K(V(t,e.length-n),e,n,r)}function k(e,t,n,r){return K(H(t),e,n,r)}function E(e,t,n,r){return k(e,t,n,r)}function S(e,t,n,r){return K(J(t),e,n,r)}function C(e,t,n,r){return K(G(t,e.length-n),e,n,r)}function A(e,t,n){return 0===t&&n===e.length?Y.fromByteArray(e):Y.fromByteArray(e.slice(t,n))}function D(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o=e[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=n){var u,l,c,p;switch(s){case 1:o<128&&(a=o);break;case 2:u=e[i+1],128==(192&u)&&(p=(31&o)<<6|63&u)>127&&(a=p);break;case 3:u=e[i+1],l=e[i+2],128==(192&u)&&128==(192&l)&&(p=(15&o)<<12|(63&u)<<6|63&l)>2047&&(p<55296||p>57343)&&(a=p);break;case 4:u=e[i+1],l=e[i+2],c=e[i+3],128==(192&u)&&128==(192&l)&&128==(192&c)&&(p=(15&o)<<18|(63&u)<<12|(63&l)<<6|63&c)>65535&&p<1114112&&(a=p)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),i+=s}return O(r)}function O(e){var t=e.length;if(t<=Q)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Q));return n}function M(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function T(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function P(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=W(e[o]);return i}function I(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function R(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,n,r,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function F(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function N(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function B(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,r,i){return i||B(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(e,t,n,r,23,4),n+4}function q(e,t,n,r,i){return i||B(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(e,t,n,r,52,8),n+8}function z(e){if(e=U(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function U(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function W(e){return e<16?"0"+e.toString(16):e.toString(16)}function V(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function H(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function G(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}function J(e){return Y.toByteArray(z(e))}function K(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function X(e){return e!==e}/*! +/*! + Copyright (c) 2017 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&e.push(a)}else if("object"===i)for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){e.exports=n(765)},function(e,t,n){e.exports=n(768)},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_SELECTED_SERVER",function(){return r}),n.d(t,"UPDATE_REQUEST_BODY_VALUE",function(){return o}),n.d(t,"UPDATE_ACTIVE_EXAMPLES_MEMBER",function(){return i}),n.d(t,"UPDATE_REQUEST_CONTENT_TYPE",function(){return a}),n.d(t,"UPDATE_RESPONSE_CONTENT_TYPE",function(){return s}),n.d(t,"UPDATE_SERVER_VARIABLE_VALUE",function(){return u}),n.d(t,"setSelectedServer",function(){return c}),n.d(t,"setRequestBodyValue",function(){return l}),n.d(t,"setActiveExamplesMember",function(){return p}),n.d(t,"setRequestContentType",function(){return f}),n.d(t,"setResponseContentType",function(){return h}),n.d(t,"setServerVariableValue",function(){return d});var r="oas3_set_servers",o="oas3_set_request_body_value",i="oas3_set_active_examples_member",a="oas3_set_request_content_type",s="oas3_set_response_content_type",u="oas3_set_server_variable_value";function c(e,t){return{type:r,payload:{selectedServerUrl:e,namespace:t}}}function l(e){var t=e.value,n=e.pathMethod;return{type:o,payload:{value:t,pathMethod:n}}}function p(e){var t=e.name,n=e.pathMethod,r=e.contextType,o=e.contextName;return{type:i,payload:{name:t,pathMethod:n,contextType:r,contextName:o}}}function f(e){var t=e.value,n=e.pathMethod;return{type:a,payload:{value:t,pathMethod:n}}}function h(e){var t=e.value,n=e.path,r=e.method;return{type:s,payload:{value:t,path:n,method:r}}}function d(e){var t=e.server,n=e.namespace,r=e.key,o=e.val;return{type:u,payload:{server:t,namespace:n,key:r,val:o}}}},function(e,t,n){var r=n(132);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){"use strict";(function(e){ +/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> * @license MIT */ -var Y=n(570),$=n(764),Z=n(387);t.Buffer=o,t.SlowBuffer=m,t.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=r(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,t,n){return a(null,e,t,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(e,t,n){return u(null,e,t,n)},o.allocUnsafe=function(e){return l(null,e)},o.allocUnsafeSlow=function(e){return l(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Z(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=o.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!o.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},o.byteLength=v,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},o.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?D(this,0,e):g.apply(this,arguments)},o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},o.prototype.compare=function(e,t,n,r,i){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var a=i-r,s=n-t,u=Math.min(a,s),l=this.slice(r,i),c=e.slice(t,n),p=0;p<u;++p)if(l[p]!==c[p]){a=l[p],s=c[p];break}return a<s?-1:s<a?1:0},o.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},o.prototype.indexOf=function(e,t,n){return _(this,e,t,n,!0)},o.prototype.lastIndexOf=function(e,t,n){return _(this,e,t,n,!1)},o.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return x(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return k(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;o.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r;if(o.TYPED_ARRAY_SUPPORT)r=this.subarray(e,t),r.__proto__=o.prototype;else{var i=t-e;r=new o(i,void 0);for(var a=0;a<i;++a)r[a]=this[a+e]}return r},o.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},o.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),$.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),$.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),$.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),$.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){j(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},o.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){j(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},o.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):F(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):F(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);j(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);j(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):F(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):F(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return q(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return q(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,a=r-n;if(this===e&&n<t&&t<r)for(i=a-1;i>=0;--i)e[i+t]=this[i+n];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},o.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var a;if("number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var s=o.isBuffer(e)?e:V(new o(e,r).toString()),u=s.length;for(a=0;a<n-t;++a)this[a+t]=s[a%u]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(t,n(17))},function(e,t,n){var r=n(37),i=n(335),o=n(190),a=Object.defineProperty;t.f=n(49)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){var r=n(406),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t,n){"use strict";function r(){D.ReactReconcileTransaction&&w||c("123")}function i(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=f.getPooled(),this.reconcileTransaction=D.ReactReconcileTransaction.getPooled(!0)}function o(e,t,n,i,o,a){return r(),w.batchedUpdates(e,t,n,i,o,a)}function a(e,t){return e._mountOrder-t._mountOrder}function s(e){var t=e.dirtyComponentsLength;t!==y.length&&c("124",t,y.length),y.sort(a),_++;for(var n=0;n<t;n++){var r=y[n],i=r._pendingCallbacks;r._pendingCallbacks=null;var o;if(d.logTopLevelRenders){var s=r;r._currentElement.type.isReactTopLevelWrapper&&(s=r._renderedComponent),o="React update: "+s.getName(),console.time(o)}if(m.performUpdateIfNecessary(r,e.reconcileTransaction,_),o&&console.timeEnd(o),i)for(var u=0;u<i.length;u++)e.callbackQueue.enqueue(i[u],r.getPublicInstance())}}function u(e){if(r(),!w.isBatchingUpdates)return void w.batchedUpdates(u,e);y.push(e),null==e._updateBatchNumber&&(e._updateBatchNumber=_+1)}function l(e,t){g(w.isBatchingUpdates,"ReactUpdates.asap: Can't enqueue an asap callback in a context whereupdates are not being batched."),b.enqueue(e,t),x=!0}var c=n(11),p=n(13),f=n(451),h=n(70),d=n(456),m=n(90),v=n(161),g=n(8),y=[],_=0,b=f.getPooled(),x=!1,w=null,k={initialize:function(){this.dirtyComponentsLength=y.length},close:function(){this.dirtyComponentsLength!==y.length?(y.splice(0,this.dirtyComponentsLength),C()):y.length=0}},E={initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}},S=[k,E];p(i.prototype,v,{getTransactionWrappers:function(){return S},destructor:function(){this.dirtyComponentsLength=null,f.release(this.callbackQueue),this.callbackQueue=null,D.ReactReconcileTransaction.release(this.reconcileTransaction),this.reconcileTransaction=null},perform:function(e,t,n){return v.perform.call(this,this.reconcileTransaction.perform,this.reconcileTransaction,e,t,n)}}),h.addPoolingTo(i);var C=function(){for(;y.length||x;){if(y.length){var e=i.getPooled();e.perform(s,null,e),i.release(e)}if(x){x=!1;var t=b;b=f.getPooled(),t.notifyAll(),f.release(t)}}},A={injectReconcileTransaction:function(e){e||c("126"),D.ReactReconcileTransaction=e},injectBatchingStrategy:function(e){e||c("127"),"function"!=typeof e.batchedUpdates&&c("128"),"boolean"!=typeof e.isBatchingUpdates&&c("129"),w=e}},D={ReactReconcileTransaction:null,batchedUpdates:o,enqueueUpdate:u,flushBatchedUpdates:C,injection:A,asap:l};e.exports=D},function(e,t){(function(){var e=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1},t=function(e,t){function r(){this.constructor=e}for(var i in t)n.call(t,i)&&(e[i]=t[i]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},n={}.hasOwnProperty;this.Mark=function(){function t(e,t,n,r){this.line=e,this.column=t,this.buffer=n,this.pointer=r}return t.prototype.get_snippet=function(t,n){var r,i,o,a,s,u,l;if(null==t&&(t=4),null==n&&(n=75),null==this.buffer)return null;for(r="\0\r\n…\u2028\u2029",o="",u=this.pointer;u>0&&(a=this.buffer[u-1],e.call(r,a)<0);)if(u--,this.pointer-u>n/2-1){o=" ... ",u+=5;break}for(l="",i=this.pointer;i<this.buffer.length&&(s=this.buffer[i],e.call(r,s)<0);)if(++i-this.pointer>n/2-1){l=" ... ",i-=5;break}return""+new Array(t).join(" ")+o+this.buffer.slice(u,i)+l+"\n"+new Array(t+this.pointer-u+o.length).join(" ")+"^"},t.prototype.toString=function(){var e,t;return e=this.get_snippet(),t=" on line "+(this.line+1)+", column "+(this.column+1),e?t:t+":\n"+e},t}(),this.YAMLError=function(e){function n(e){this.message=e,n.__super__.constructor.call(this),this.stack=this.toString()+"\n"+(new Error).stack.split("\n").slice(1).join("\n")}return t(n,e),n.prototype.toString=function(){return this.message},n}(Error),this.MarkedYAMLError=function(e){function n(e,t,r,i,o){this.context=e,this.context_mark=t,this.problem=r,this.problem_mark=i,this.note=o,n.__super__.constructor.call(this)}return t(n,e),n.prototype.toString=function(){var e;return e=[],null!=this.context&&e.push(this.context),null==this.context_mark||null!=this.problem&&null!=this.problem_mark&&this.context_mark.line===this.problem_mark.line&&this.context_mark.column===this.problem_mark.column||e.push(this.context_mark.toString()),null!=this.problem&&e.push(this.problem),null!=this.problem_mark&&e.push(this.problem_mark.toString()),null!=this.note&&e.push(this.note),e.join("\n")},n}(this.YAMLError)}).call(this)},function(e,t,n){"use strict";var r=n(95),i=function(e){return e&&e.__esModule?e:{default:e}}(r);e.exports=function(){var e={location:{},history:{},open:function(){},close:function(){},File:function(){}};if("undefined"==typeof window)return e;try{e=window;var t=["File","Blob","FormData"],n=!0,r=!1,o=void 0;try{for(var a,s=(0,i.default)(t);!(n=(a=s.next()).done);n=!0){var u=a.value;u in window&&(e[u]=window[u])}}catch(e){r=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(r)throw o}}}catch(e){console.error(e)}return e}()},function(e,t,n){e.exports={default:n(593),__esModule:!0}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(567),o=r(i),a=n(566),s=r(a),u="function"==typeof s.default&&"symbol"==typeof o.default?function(e){return typeof e}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":typeof e};t.default="function"==typeof s.default&&"symbol"===u(o.default)?function(e){return void 0===e?"undefined":u(e)}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":void 0===e?"undefined":u(e)}},function(e,t,n){e.exports=!n(54)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){"use strict";function r(e,t,n){return n?[e,t]:e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n;var i=this.constructor.Interface;for(var o in i)if(i.hasOwnProperty(o)){var s=i[o];s?this[o]=s(n):"target"===o?this.target=r:this[o]=n[o]}var u=null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue;return this.isDefaultPrevented=u?a.thatReturnsTrue:a.thatReturnsFalse,this.isPropagationStopped=a.thatReturnsFalse,this}var i=n(13),o=n(70),a=n(32),s=(n(10),["dispatchConfig","_targetInst","nativeEvent","isDefaultPrevented","isPropagationStopped","_dispatchListeners","_dispatchInstances"]),u={type:null,target:null,currentTarget:a.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};i(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=a.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=a.thatReturnsTrue)},persist:function(){this.isPersistent=a.thatReturnsTrue},isPersistent:a.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;for(var n=0;n<s.length;n++)this[s[n]]=null}}),r.Interface=u,r.augmentClass=function(e,t){var n=this,r=function(){};r.prototype=n.prototype;var a=new r;i(a,e.prototype),e.prototype=a,e.prototype.constructor=e,e.Interface=i({},n.Interface,t),e.augmentClass=n.augmentClass,o.addPoolingTo(e,o.fourArgumentPooler)},o.addPoolingTo(r,o.fourArgumentPooler),e.exports=r},function(e,t,n){"use strict";var r={current:null};e.exports=r},function(e,t,n){var r=n(98);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(41),i=n(101);e.exports=n(49)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,n){function r(e){return a(e)?i(e):o(e)}var i=n(393),o=n(856),a=n(86);e.exports=r},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e,t){return e===t}function o(e){var t=arguments.length<=1||void 0===arguments[1]?i:arguments[1],n=null,r=null;return function(){for(var i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return null!==n&&n.length===o.length&&o.every(function(e,r){return t(e,n[r])})?r:(r=e.apply(void 0,o),n=o,r)}}function a(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(e){return"function"==typeof e})){var n=t.map(function(e){return typeof e}).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}function s(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return function(){for(var t=arguments.length,i=Array(t),o=0;o<t;o++)i[o]=arguments[o];var s=0,u=i.pop(),l=a(i),c=e.apply(void 0,[function(){return s++,u.apply(void 0,arguments)}].concat(n)),p=function(e,t){for(var n=arguments.length,i=Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];var a=l.map(function(n){return n.apply(void 0,[e,t].concat(i))});return c.apply(void 0,r(a))};return p.resultFunc=u,p.recomputations=function(){return s},p.resetRecomputations=function(){return s=0},p}}function u(){return s(o).apply(void 0,arguments)}function l(e){var t=arguments.length<=1||void 0===arguments[1]?u:arguments[1];if("object"!=typeof e)throw new Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var n=Object.keys(e);return t(n.map(function(t){return e[t]}),function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(function(e,t,r){return e[n[r]]=t,e},{})})}t.__esModule=!0,t.defaultMemoize=o,t.createSelectorCreator=s,t.createSelector=u,t.createStructuredSelector=l},function(e,t,n){(function(e){(function(){var t,r,i,o=[].slice,a={}.hasOwnProperty;this.StringStream=function(){function e(){this.string=""}return e.prototype.write=function(e){return this.string+=e},e}(),this.clone=function(e){return function(t){return e.extend({},t)}}(this),this.extend=function(){var e,t,n,r,i,a,s;for(e=arguments[0],a=2<=arguments.length?o.call(arguments,1):[],t=0,r=a.length;t<r;t++){i=a[t];for(n in i)s=i[n],e[n]=s}return e},this.is_empty=function(e){var t;if(Array.isArray(e)||"string"==typeof e)return 0===e.length;for(t in e)if(a.call(e,t))return!1;return!0},this.inspect=null!=(t=null!=(r=null!=(i=n(1194))?i.inspect:void 0)?r:e.inspect)?t:function(e){return""+e},this.pad_left=function(e,t,n){return e=String(e),e.length>=n?e:e.length+1===n?""+t+e:""+new Array(n-e.length+1).join(t)+e},this.to_hex=function(e){return"string"==typeof e&&(e=e.charCodeAt(0)),e.toString(16)}}).call(this)}).call(t,n(17))},function(e,t,n){var r=n(77);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=e.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(138),i=n(360);e.exports=n(106)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){"use strict";var r=n(725),i=Math.max;e.exports=function(e){return i(0,r(e))}},function(e,t,n){function r(e){return null==e?void 0===e?u:s:(e=Object(e),l&&l in e?o(e):a(e))}var i=n(82),o=n(896),a=n(925),s="[object Null]",u="[object Undefined]",l=i?i.toStringTag:void 0;e.exports=r},function(e,t,n){function r(e,t){var n=o(e,t);return i(n)?n:void 0}var i=n(854),o=n(897);e.exports=r},function(e,t){function n(e){return null!=e&&"object"==typeof e}e.exports=n},function(e,t,n){"use strict"},function(e,t,n){"use strict";var r=n(11),i=(n(8),function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)}),o=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},a=function(e,t,n){var r=this;if(r.instancePool.length){var i=r.instancePool.pop();return r.call(i,e,t,n),i}return new r(e,t,n)},s=function(e,t,n,r){var i=this;if(i.instancePool.length){var o=i.instancePool.pop();return i.call(o,e,t,n,r),o}return new i(e,t,n,r)},u=function(e){var t=this;e instanceof t||r("25"),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},l=i,c=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||l,n.poolSize||(n.poolSize=10),n.release=u,n},p={addPoolingTo:c,oneArgumentPooler:i,twoArgumentPooler:o,threeArgumentPooler:a,fourArgumentPooler:s};e.exports=p},function(e,t,n){"use strict";function r(e){if(!(this instanceof r))return new r(e);l.call(this,e),c.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",i)}function i(){this.allowHalfOpen||this._writableState.ended||a(o,this)}function o(e){e.end()}var a=n(158),s=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=r;var u=n(111);u.inherits=n(42);var l=n(479),c=n(261);u.inherits(r,l);for(var p=s(c.prototype),f=0;f<p.length;f++){var h=p[f];r.prototype[h]||(r.prototype[h]=c.prototype[h])}Object.defineProperty(r.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),r.prototype._destroy=function(e,t){this.push(null),this.end(),a(t,e)}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";var r=n(430),i=n(429),o=n(114).decodeHTML,a="&(?:#x[a-f0-9]{1,8}|#[0-9]{1,8}|[a-z][a-z0-9]{1,31});",s="<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",u="</[A-Za-z][A-Za-z0-9-]*\\s*[>]",l=new RegExp("^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>|</[A-Za-z][A-Za-z0-9-]*\\s*[>]|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)","i"),c=/[\\&]/,p="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",f=new RegExp("\\\\"+p+"|"+a,"gi"),h=new RegExp('[&<>"]',"g"),d=new RegExp(a+'|[&<>"]',"gi"),m=function(e){return 92===e.charCodeAt(0)?e.charAt(1):o(e)},v=function(e){return c.test(e)?e.replace(f,m):e},g=function(e){try{return r(i(e))}catch(t){return e}},y=function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}},_=function(e,t){return h.test(e)?t?e.replace(d,y):e.replace(h,y):e};e.exports={unescapeString:v,normalizeURI:g,escapeXml:_,reHtmlTag:l,OPENTAG:s,CLOSETAG:u,ENTITY:a,ESCAPABLE:p}},function(e,t){e.exports={}},function(e,t,n){var r=n(181),i=n(178);e.exports=function(e){return r(i(e))}},function(e,t,n){var r=n(178);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(31),i=n(64),o=n(108),a=n(202)("src"),s=Function.toString,u=(""+s).split("toString");n(63).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var l="function"==typeof n;l&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(l&&(o(n,a)||i(n,a,e[t]?""+e[t]:u.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(e,t,n){"use strict";var r=n(372)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"use strict";function r(e){return void 0===e||null===e}function i(e){return"object"==typeof e&&null!==e}function o(e){return Array.isArray(e)?e:r(e)?[]:[e]}function a(e,t){var n,r,i,o;if(t)for(o=Object.keys(t),n=0,r=o.length;n<r;n+=1)i=o[n],e[i]=t[i];return e}function s(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r}function u(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e}e.exports.isNothing=r,e.exports.isObject=i,e.exports.toArray=o,e.exports.repeat=s,e.exports.isNegativeZero=u,e.exports.extend=a},function(e,t,n){"use strict";function r(e,t,n){var i=[];return e.include.forEach(function(e){n=r(e,t,n)}),e[t].forEach(function(e){n.forEach(function(t,n){t.tag===e.tag&&t.kind===e.kind&&i.push(n)}),n.push(e)}),n.filter(function(e,t){return-1===i.indexOf(t)})}function i(){function e(e){r[e.kind][e.tag]=r.fallback[e.tag]=e}var t,n,r={scalar:{},sequence:{},mapping:{},fallback:{}};for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(e);return r}function o(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new s("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=r(this,"implicit",[]),this.compiledExplicit=r(this,"explicit",[]),this.compiledTypeMap=i(this.compiledImplicit,this.compiledExplicit)}var a=n(80),s=n(117),u=n(16);o.DEFAULT=null,o.create=function(){var e,t;switch(arguments.length){case 1:e=o.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new s("Wrong number of arguments for Schema.create function")}if(e=a.toArray(e),t=a.toArray(t),!e.every(function(e){return e instanceof o}))throw new s("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every(function(e){return e instanceof u}))throw new s("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new o({include:e,explicit:t})},e.exports=o},function(e,t,n){var r=n(43),i=r.Symbol;e.exports=i},function(e,t,n){function r(e,t){return i(e)?e:o(e,t)?[e]:a(s(e))}var i=n(20),o=n(221),a=n(936),s=n(87);e.exports=r},function(e,t,n){function r(e,t,n,r){var a=!n;n||(n={});for(var s=-1,u=t.length;++s<u;){var l=t[s],c=r?r(n[l],e[l],l,n,e):void 0;void 0===c&&(c=e[l]),a?o(n,l,c):i(n,l,c)}return n}var i=n(148),o=n(396);e.exports=r},function(e,t,n){function r(e){if("string"==typeof e||i(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}var i=n(155),o=1/0;e.exports=r},function(e,t,n){function r(e){return null!=e&&o(e.length)&&!i(e)}var i=n(420),o=n(228);e.exports=r},function(e,t,n){function r(e){return null==e?"":i(e)}var i=n(401);e.exports=r},function(e,t,n){"use strict";function r(e){if(d){var t=e.node,n=e.children;if(n.length)for(var r=0;r<n.length;r++)m(t,n[r],null);else null!=e.html?p(t,e.html):null!=e.text&&h(t,e.text)}}function i(e,t){e.parentNode.replaceChild(t.node,e),r(t)}function o(e,t){d?e.children.push(t):e.node.appendChild(t.node)}function a(e,t){d?e.html=t:p(e.node,t)}function s(e,t){d?e.text=t:h(e.node,t)}function u(){return this.node.nodeName}function l(e){return{node:e,children:[],html:null,text:null,toString:u}}var c=n(241),p=n(163),f=n(249),h=n(469),d="undefined"!=typeof document&&"number"==typeof document.documentMode||"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&/\bEdge\/\d/.test(navigator.userAgent),m=f(function(e,t,n){11===t.node.nodeType||1===t.node.nodeType&&"object"===t.node.nodeName.toLowerCase()&&(null==t.node.namespaceURI||t.node.namespaceURI===c.html)?(r(t),e.insertBefore(t.node,n)):(e.insertBefore(t.node,n),r(t))});l.insertTreeBefore=m,l.replaceChildWithTree=i,l.queueChild=o,l.queueHTML=a,l.queueText=s,e.exports=l},function(e,t,n){"use strict";function r(e,t){return(e&t)===t}var i=n(11),o=(n(8),{MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32,injectDOMPropertyConfig:function(e){var t=o,n=e.Properties||{},a=e.DOMAttributeNamespaces||{},u=e.DOMAttributeNames||{},l=e.DOMPropertyNames||{},c=e.DOMMutationMethods||{};e.isCustomAttribute&&s._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var p in n){s.properties.hasOwnProperty(p)&&i("48",p);var f=p.toLowerCase(),h=n[p],d={attributeName:f,attributeNamespace:null,propertyName:p,mutationMethod:null,mustUseProperty:r(h,t.MUST_USE_PROPERTY),hasBooleanValue:r(h,t.HAS_BOOLEAN_VALUE),hasNumericValue:r(h,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:r(h,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:r(h,t.HAS_OVERLOADED_BOOLEAN_VALUE)};if(d.hasBooleanValue+d.hasNumericValue+d.hasOverloadedBooleanValue<=1||i("50",p),u.hasOwnProperty(p)){var m=u[p];d.attributeName=m}a.hasOwnProperty(p)&&(d.attributeNamespace=a[p]),l.hasOwnProperty(p)&&(d.propertyName=l[p]),c.hasOwnProperty(p)&&(d.mutationMethod=c[p]),s.properties[p]=d}}}),a=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",s={ID_ATTRIBUTE_NAME:"data-reactid",ROOT_ATTRIBUTE_NAME:"data-reactroot",ATTRIBUTE_NAME_START_CHAR:a,ATTRIBUTE_NAME_CHAR:a+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",properties:{},getPossibleStandardName:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<s._isCustomAttributeFunctions.length;t++){if((0,s._isCustomAttributeFunctions[t])(e))return!0}return!1},injection:o};e.exports=s},function(e,t,n){"use strict";function r(){i.attachRefs(this,this._currentElement)}var i=n(1045),o=(n(39),n(10),{mountComponent:function(e,t,n,i,o,a){var s=e.mountComponent(t,n,i,o,a);return e._currentElement&&null!=e._currentElement.ref&&t.getReactMountReady().enqueue(r,e),s},getHostNode:function(e){return e.getHostNode()},unmountComponent:function(e,t){i.detachRefs(e,e._currentElement),e.unmountComponent(t)},receiveComponent:function(e,t,n,o){var a=e._currentElement;if(t!==a||o!==e._context){var s=i.shouldUpdateRefs(a,t);s&&i.detachRefs(e,a),e.receiveComponent(t,n,o),s&&e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(r,e)}},performUpdateIfNecessary:function(e,t,n){e._updateBatchNumber===n&&e.performUpdateIfNecessary(t)}});e.exports=o},function(e,t,n){"use strict";var r=n(430),i=n(429),o=n(114).decodeHTML,a="&(?:#x[a-f0-9]{1,8}|#[0-9]{1,8}|[a-z][a-z0-9]{1,31});",s="<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",u="</[A-Za-z][A-Za-z0-9-]*\\s*[>]",l=new RegExp("^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>|</[A-Za-z][A-Za-z0-9-]*\\s*[>]|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)","i"),c=/[\\&]/,p="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",f=new RegExp("\\\\"+p+"|"+a,"gi"),h=new RegExp('[&<>"]',"g"),d=new RegExp(a+'|[&<>"]',"gi"),m=function(e){return 92===e.charCodeAt(0)?e.charAt(1):o(e)},v=function(e){return c.test(e)?e.replace(f,m):e},g=function(e){try{return r(i(e))}catch(t){return e}},y=function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}},_=function(e,t){return h.test(e)?t?e.replace(d,y):e.replace(h,y):e};e.exports={unescapeString:v,normalizeURI:g,escapeXml:_,reHtmlTag:l,OPENTAG:s,CLOSETAG:u,ENTITY:a,ESCAPABLE:p}},function(e,t,n){"use strict";var r=n(13),i=n(474),o=n(1100),a=n(1101),s=n(93),u=n(1102),l=n(1103),c=n(1104),p=n(1108),f=s.createElement,h=s.createFactory,d=s.cloneElement,m=r,v=function(e){return e},g={Children:{map:o.map,forEach:o.forEach,count:o.count,toArray:o.toArray,only:p},Component:i.Component,PureComponent:i.PureComponent,createElement:f,cloneElement:d,isValidElement:s.isValidElement,PropTypes:u,createClass:c,createFactory:h,createMixin:v,DOM:a,version:l,__spread:m};e.exports=g},function(e,t,n){"use strict";function r(e){return void 0!==e.ref}function i(e){return void 0!==e.key}var o=n(13),a=n(52),s=(n(10),n(478),Object.prototype.hasOwnProperty),u=n(476),l={key:!0,ref:!0,__self:!0,__source:!0},c=function(e,t,n,r,i,o,a){var s={$$typeof:u,type:e,key:t,ref:n,props:a,_owner:o};return s};c.createElement=function(e,t,n){var o,u={},p=null,f=null;if(null!=t){r(t)&&(f=t.ref),i(t)&&(p=""+t.key),void 0===t.__self?null:t.__self,void 0===t.__source?null:t.__source;for(o in t)s.call(t,o)&&!l.hasOwnProperty(o)&&(u[o]=t[o])}var h=arguments.length-2;if(1===h)u.children=n;else if(h>1){for(var d=Array(h),m=0;m<h;m++)d[m]=arguments[m+2];u.children=d}if(e&&e.defaultProps){var v=e.defaultProps;for(o in v)void 0===u[o]&&(u[o]=v[o])}return c(e,p,f,0,0,a.current,u)},c.createFactory=function(e){var t=c.createElement.bind(null,e);return t.type=e,t},c.cloneAndReplaceKey=function(e,t){return c(e.type,t,e.ref,e._self,e._source,e._owner,e.props)},c.cloneElement=function(e,t,n){var u,p=o({},e.props),f=e.key,h=e.ref,d=(e._self,e._source,e._owner);if(null!=t){r(t)&&(h=t.ref,d=a.current),i(t)&&(f=""+t.key);var m;e.type&&e.type.defaultProps&&(m=e.type.defaultProps);for(u in t)s.call(t,u)&&!l.hasOwnProperty(u)&&(void 0===t[u]&&void 0!==m?p[u]=m[u]:p[u]=t[u])}var v=arguments.length-2;if(1===v)p.children=n;else if(v>1){for(var g=Array(v),y=0;y<v;y++)g[y]=arguments[y+2];p.children=g}return c(e.type,f,h,0,0,d,p)},c.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===u},e.exports=c},function(e,t){(function(){var e,t=function(e,t){function r(){this.constructor=e}for(var i in t)n.call(t,i)&&(e[i]=t[i]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},n={}.hasOwnProperty;e=0,this.Node=function(){function t(t,n,r,i){this.tag=t,this.value=n,this.start_mark=r,this.end_mark=i,this.unique_id="node_"+e++}return t}(),this.ScalarNode=function(e){function n(e,t,r,i,o){this.tag=e,this.value=t,this.start_mark=r,this.end_mark=i,this.style=o,n.__super__.constructor.apply(this,arguments)}return t(n,e),n.prototype.id="scalar",n}(this.Node),this.CollectionNode=function(e){function n(e,t,r,i,o){this.tag=e,this.value=t,this.start_mark=r,this.end_mark=i,this.flow_style=o,n.__super__.constructor.apply(this,arguments)}return t(n,e),n}(this.Node),this.SequenceNode=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.prototype.id="sequence",n}(this.CollectionNode),this.MappingNode=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.prototype.id="mapping",n}(this.CollectionNode)}).call(this)},function(e,t,n){e.exports={default:n(586),__esModule:!0}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(563),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return(0,i.default)(e)}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(345),i=n(180);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(41).f,i=n(55),o=n(22)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){"use strict";var r=n(617)(!0);n(339)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){n(622);for(var r=n(24),i=n(56),o=n(74),a=n(22)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u<s.length;u++){var l=s[u],c=r[l],p=c&&c.prototype;p&&!p[a]&&i(p,a,l),o[l]=o.Array}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){e.exports=!n(107)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports={}},function(e,t,n){var r=n(139),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){(function(e){function n(e){return Array.isArray?Array.isArray(e):"[object Array]"===v(e)}function r(e){return"boolean"==typeof e}function i(e){return null===e}function o(e){return null==e}function a(e){return"number"==typeof e}function s(e){return"string"==typeof e}function u(e){return"symbol"==typeof e}function l(e){return void 0===e}function c(e){return"[object RegExp]"===v(e)}function p(e){return"object"==typeof e&&null!==e}function f(e){return"[object Date]"===v(e)}function h(e){return"[object Error]"===v(e)||e instanceof Error}function d(e){return"function"==typeof e}function m(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function v(e){return Object.prototype.toString.call(e)}t.isArray=n,t.isBoolean=r,t.isNull=i,t.isNullOrUndefined=o,t.isNumber=a,t.isString=s,t.isSymbol=u,t.isUndefined=l,t.isRegExp=c,t.isObject=p,t.isDate=f,t.isError=h,t.isFunction=d,t.isPrimitive=m,t.isBuffer=e.isBuffer}).call(t,n(40).Buffer)},function(e,t,n){"use strict";function r(e){return"string"==typeof e&&i.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=/-webkit-|-moz-|-ms-/;e.exports=t.default},function(e,t){e.exports={Text:"text",Directive:"directive",Comment:"comment",Script:"script",Style:"style",Tag:"tag",CDATA:"cdata",Doctype:"doctype",isTag:function(e){return"tag"===e.type||"script"===e.type||"style"===e.type}}},function(e,t,n){var r=n(711),i=n(710);t.decode=function(e,t){return(!t||t<=0?i.XML:i.HTML)(e)},t.decodeStrict=function(e,t){return(!t||t<=0?i.XML:i.HTMLStrict)(e)},t.encode=function(e,t){return(!t||t<=0?r.XML:r.HTML)(e)},t.encodeXML=r.XML,t.encodeHTML4=t.encodeHTML5=t.encodeHTML=r.HTML,t.decodeXML=t.decodeXMLStrict=i.XML,t.decodeHTML4=t.decodeHTML5=t.decodeHTML=i.HTML,t.decodeHTML4Strict=t.decodeHTML5Strict=t.decodeHTMLStrict=i.HTMLStrict,t.escape=r.escape},function(e,t,n){"use strict";var r=n(79);e.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){function r(t,n){return delete e.exports[t],e.exports[t]=n,n}var i=n(380),o=n(700);e.exports={Parser:i,Tokenizer:n(381),ElementType:n(113),DomHandler:o,get FeedHandler(){return r("FeedHandler",n(760))},get Stream(){return r("Stream",n(762))},get WritableStream(){return r("WritableStream",n(382))},get ProxyHandler(){return r("ProxyHandler",n(761))},get DomUtils(){return r("DomUtils",n(702))},get CollectingHandler(){return r("CollectingHandler",n(759))},DefaultHandler:o,get RssHandler(){return r("RssHandler",this.FeedHandler)},parseDOM:function(e,t){var n=new o(t);return new i(n,t).end(e),n.dom},parseFeed:function(t,n){var r=new e.exports.FeedHandler(n);return new i(r,n).end(t),r.dom},createDomStream:function(e,t,n){var r=new o(e,t,n);return new i(r,t)},EVENTS:{attribute:2,cdatastart:0,cdataend:0,text:1,processinginstruction:2,comment:1,commentend:0,closetag:1,opentag:2,opentagname:1,error:1,end:0}}},function(e,t,n){"use strict";function r(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},e.exports=r},function(e,t,n){"use strict";var r=n(81);e.exports=new r({include:[n(388)],implicit:[n(814),n(807)],explicit:[n(799),n(809),n(810),n(812)]})},function(e,t,n){function r(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?s(e)?o(e[0],e[1]):i(e):u(e)}var i=n(858),o=n(859),a=n(225),s=n(20),u=n(952);e.exports=r},function(e,t){function n(e,t){return e===t||e!==e&&t!==t}e.exports=n},function(e,t){function n(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')}function r(e){var t=e.match(y);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function o(e){var n=e,o=r(e);if(o){if(!o.path)return e;n=o.path}for(var a,s=t.isAbsolute(n),u=n.split(/\/+/),l=0,c=u.length-1;c>=0;c--)a=u[c],"."===a?u.splice(c,1):".."===a?l++:l>0&&(""===a?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return n=u.join("/"),""===n&&(n=s?"/":"."),o?(o.path=n,i(o)):n}function a(e,t){""===e&&(e="."),""===t&&(t=".");var n=r(t),a=r(e);if(a&&(e=a.path||"/"),n&&!n.scheme)return a&&(n.scheme=a.scheme),i(n);if(n||t.match(_))return t;if(a&&!a.host&&!a.path)return a.host=t,i(a);var s="/"===t.charAt(0)?t:o(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=s,i(a)):s}function s(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if(e=e.slice(0,r),e.match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)}function u(e){return e}function l(e){return p(e)?"$"+e:e}function c(e){return p(e)?e.slice(1):e}function p(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function f(e,t,n){var r=d(e.source,t.source);return 0!==r?r:0!==(r=e.originalLine-t.originalLine)?r:0!==(r=e.originalColumn-t.originalColumn)||n?r:0!==(r=e.generatedColumn-t.generatedColumn)?r:(r=e.generatedLine-t.generatedLine,0!==r?r:d(e.name,t.name))}function h(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r?r:0!==(r=e.generatedColumn-t.generatedColumn)||n?r:0!==(r=d(e.source,t.source))?r:0!==(r=e.originalLine-t.originalLine)?r:(r=e.originalColumn-t.originalColumn,0!==r?r:d(e.name,t.name))}function d(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}function m(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n?n:0!==(n=e.generatedColumn-t.generatedColumn)?n:0!==(n=d(e.source,t.source))?n:0!==(n=e.originalLine-t.originalLine)?n:(n=e.originalColumn-t.originalColumn,0!==n?n:d(e.name,t.name))}function v(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}function g(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var s=r(n);if(!s)throw new Error("sourceMapURL could not be parsed");if(s.path){var u=s.path.lastIndexOf("/");u>=0&&(s.path=s.path.substring(0,u+1))}t=a(i(s),t)}return o(t)}t.getArg=n;var y=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,_=/^data:.+\,.+$/;t.urlParse=r,t.urlGenerate=i,t.normalize=o,t.join=a,t.isAbsolute=function(e){return"/"===e.charAt(0)||y.test(e)},t.relative=s;var b=function(){return!("__proto__"in Object.create(null))}();t.toSetString=b?u:l,t.fromSetString=b?u:c,t.compareByOriginalPositions=f,t.compareByGeneratedPositionsDeflated=h,t.compareByGeneratedPositionsInflated=m,t.parseSourceMapInput=v,t.computeSourceURL=g},function(e,t,n){"use strict";function r(e){return"button"===e||"input"===e||"select"===e||"textarea"===e}function i(e,t,n){switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":return!(!n.disabled||!r(t));default:return!1}}var o=n(11),a=n(242),s=n(243),u=n(247),l=n(462),c=n(463),p=(n(8),{}),f=null,h=function(e,t){e&&(s.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},d=function(e){return h(e,!0)},m=function(e){return h(e,!1)},v=function(e){return"."+e._rootNodeID},g={injection:{injectEventPluginOrder:a.injectEventPluginOrder,injectEventPluginsByName:a.injectEventPluginsByName},putListener:function(e,t,n){"function"!=typeof n&&o("94",t,typeof n);var r=v(e);(p[t]||(p[t]={}))[r]=n;var i=a.registrationNameModules[t];i&&i.didPutListener&&i.didPutListener(e,t,n)},getListener:function(e,t){var n=p[t];if(i(t,e._currentElement.type,e._currentElement.props))return null;var r=v(e);return n&&n[r]},deleteListener:function(e,t){var n=a.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t);var r=p[t];if(r){delete r[v(e)]}},deleteAllListeners:function(e){var t=v(e);for(var n in p)if(p.hasOwnProperty(n)&&p[n][t]){var r=a.registrationNameModules[n];r&&r.willDeleteListener&&r.willDeleteListener(e,n),delete p[n][t]}},extractEvents:function(e,t,n,r){for(var i,o=a.plugins,s=0;s<o.length;s++){var u=o[s];if(u){var c=u.extractEvents(e,t,n,r);c&&(i=l(i,c))}}return i},enqueueEvents:function(e){e&&(f=l(f,e))},processEventQueue:function(e){var t=f;f=null,e?c(t,d):c(t,m),f&&o("95"),u.rethrowCaughtError()},__purge:function(){p={}},__getListenerBank:function(){return p}};e.exports=g},function(e,t,n){"use strict";function r(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return g(e,r)}function i(e,t,n){var i=r(e,n,t);i&&(n._dispatchListeners=m(n._dispatchListeners,i),n._dispatchInstances=m(n._dispatchInstances,e))}function o(e){e&&e.dispatchConfig.phasedRegistrationNames&&d.traverseTwoPhase(e._targetInst,i,e)}function a(e){if(e&&e.dispatchConfig.phasedRegistrationNames){var t=e._targetInst,n=t?d.getParentInstance(t):null;d.traverseTwoPhase(n,i,e)}}function s(e,t,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,i=g(e,r);i&&(n._dispatchListeners=m(n._dispatchListeners,i),n._dispatchInstances=m(n._dispatchInstances,e))}}function u(e){e&&e.dispatchConfig.registrationName&&s(e._targetInst,null,e)}function l(e){v(e,o)}function c(e){v(e,a)}function p(e,t,n,r){d.traverseEnterLeave(n,r,s,e,t)}function f(e){v(e,u)}var h=n(122),d=n(243),m=n(462),v=n(463),g=(n(10),h.getListener),y={accumulateTwoPhaseDispatches:l,accumulateTwoPhaseDispatchesSkipTarget:c,accumulateDirectDispatches:f,accumulateEnterLeaveDispatches:p};e.exports=y},function(e,t,n){"use strict";var r={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}};e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(51),o=n(252),a={view:function(e){if(e.view)return e.view;var t=o(e);if(t.window===t)return t;var n=t.ownerDocument;return n?n.defaultView||n.parentWindow:window},detail:function(e){return e.detail||0}};i.augmentClass(r,a),e.exports=r},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var i=new Error(n);throw i.name="Invariant Violation",i.framesToPop=1,i}e.exports=r},function(e,t){(function(){var e=function(e,n){function r(){this.constructor=e}for(var i in n)t.call(n,i)&&(e[i]=n[i]);return r.prototype=n.prototype,e.prototype=new r,e.__super__=n.prototype,e},t={}.hasOwnProperty;this.Event=function(){function e(e,t){this.start_mark=e,this.end_mark=t}return e}(),this.NodeEvent=function(t){function n(e,t,n){this.anchor=e,this.start_mark=t,this.end_mark=n}return e(n,t),n}(this.Event),this.CollectionStartEvent=function(t){function n(e,t,n,r,i,o){this.anchor=e,this.tag=t,this.implicit=n,this.start_mark=r,this.end_mark=i,this.flow_style=o}return e(n,t),n}(this.NodeEvent),this.CollectionEndEvent=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n}(this.Event),this.StreamStartEvent=function(t){function n(e,t,n){this.start_mark=e,this.end_mark=t,this.encoding=n}return e(n,t),n}(this.Event),this.StreamEndEvent=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n}(this.Event),this.DocumentStartEvent=function(t){function n(e,t,n,r,i){this.start_mark=e,this.end_mark=t,this.explicit=n,this.version=r,this.tags=i}return e(n,t),n}(this.Event),this.DocumentEndEvent=function(t){function n(e,t,n){this.start_mark=e,this.end_mark=t,this.explicit=n}return e(n,t),n}(this.Event),this.AliasEvent=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n}(this.NodeEvent),this.ScalarEvent=function(t){function n(e,t,n,r,i,o,a){this.anchor=e,this.tag=t,this.implicit=n,this.value=r,this.start_mark=i,this.end_mark=o,this.style=a}return e(n,t),n}(this.NodeEvent),this.SequenceStartEvent=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n}(this.CollectionStartEvent),this.SequenceEndEvent=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n}(this.CollectionEndEvent),this.MappingStartEvent=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n}(this.CollectionStartEvent),this.MappingEndEvent=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n}(this.CollectionEndEvent)}).call(this)},function(e,t,n){"use strict";function r(e){return{type:p,payload:(0,c.default)(e)}}function i(e){return{type:f,payload:e}}function o(e){return{type:h,payload:e}}function a(e){return{type:d,payload:e}}function s(e){return{type:m,payload:e}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:v,payload:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.CLEAR=t.NEW_AUTH_ERR=t.NEW_SPEC_ERR_BATCH=t.NEW_SPEC_ERR=t.NEW_THROWN_ERR_BATCH=t.NEW_THROWN_ERR=void 0,t.newThrownErr=r,t.newThrownErrBatch=i,t.newSpecErr=o,t.newSpecErrBatch=a,t.newAuthErr=s,t.clear=u;var l=n(264),c=function(e){return e&&e.__esModule?e:{default:e}}(l),p=t.NEW_THROWN_ERR="err_new_thrown_err",f=t.NEW_THROWN_ERR_BATCH="err_new_thrown_err_batch",h=t.NEW_SPEC_ERR="err_new_spec_err",d=t.NEW_SPEC_ERR_BATCH="err_new_spec_err_batch",m=t.NEW_AUTH_ERR="err_new_auth_err",v=t.CLEAR="err_clear"},function(e,t,n){var r=n(53),i=n(338),o=n(336),a=n(37),s=n(133),u=n(193),l={},c={},t=e.exports=function(e,t,n,p,f){var h,d,m,v,g=f?function(){return e}:u(e),y=r(n,p,t?2:1),_=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(o(g)){for(h=s(e.length);h>_;_++)if((v=t?y(a(d=e[_])[0],d[1]):y(e[_]))===l||v===c)return v}else for(m=g.call(e);!(d=m.next()).done;)if((v=i(m,y,d.value,t))===l||v===c)return v};t.BREAK=l,t.RETURN=c},function(e,t){e.exports=!0},function(e,t,n){var r=n(134)("meta"),i=n(27),o=n(55),a=n(41).f,s=0,u=Object.isExtensible||function(){return!0},l=!n(54)(function(){return u(Object.preventExtensions({}))}),c=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},p=function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!u(e))return"F";if(!t)return"E";c(e)}return e[r].i},f=function(e,t){if(!o(e,r)){if(!u(e))return!0;if(!t)return!1;c(e)}return e[r].w},h=function(e){return l&&d.NEED&&u(e)&&!o(e,r)&&c(e),e},d=e.exports={KEY:r,NEED:!1,fastKey:p,getWeak:f,onFreeze:h}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(189),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(135);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){"use strict";var r=n(64),i=n(78),o=n(107),a=n(57),s=n(19);e.exports=function(e,t,n){var u=s(e),l=n(a,u,""[e]),c=l[0],p=l[1];o(function(){var t={};return t[u]=function(){return 7},7!=""[e](t)})&&(i(String.prototype,e,c),r(RegExp.prototype,u,2==t?function(e,t){return p.call(e,this,t)}:function(e){return p.call(e,this)}))}},function(e,t,n){var r=n(62),i=n(642),o=n(661),a=Object.defineProperty;t.f=n(106)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(644),i=n(57);e.exports=function(e){return r(i(e))}},function(e,t,n){"use strict";var r,i=n(373),o=n(376),a=n(729),s=n(734);r=e.exports=function(e,t){var n,r,a,u,l;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],null==e?(n=a=!0,r=!1):(n=s.call(e,"c"),r=s.call(e,"e"),a=s.call(e,"w")),l={value:t,configurable:n,enumerable:r,writable:a},u?i(o(u),l):l},r.gs=function(e,t,n){var r,u,l,c;return"string"!=typeof e?(l=n,n=t,t=e,e=null):l=arguments[3],null==t?t=void 0:a(t)?null==n?n=void 0:a(n)||(l=n,n=void 0):(l=t,t=n=void 0),null==e?(r=!0,u=!1):(r=s.call(e,"c"),u=s.call(e,"e")),c={get:t,set:n,configurable:r,enumerable:u},l?i(o(l),c):c}},function(e,t,n){"use strict";e.exports=n(726)("forEach")},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function i(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,i,s,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(n=this._events[e],a(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(o(n))for(s=Array.prototype.slice.call(arguments,1),l=n.slice(),i=l.length,u=0;u<i;u++)l[u].apply(this,s);return!0},n.prototype.addListener=function(e,t){var i;if(!r(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned&&(i=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,i,a,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],a=n.length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){i=s;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){"use strict";var r={};e.exports=r},function(e,t,n){"use strict";var r=n(81);e.exports=r.DEFAULT=new r({include:[n(118)],explicit:[n(805),n(804),n(803)]})},function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var i=n(911),o=n(912),a=n(913),s=n(914),u=n(915);r.prototype.clear=i,r.prototype.delete=o,r.prototype.get=a,r.prototype.has=s,r.prototype.set=u,e.exports=r},function(e,t){function n(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}e.exports=n},function(e,t,n){function r(e,t,n){var r=e[t];s.call(e,t)&&o(r,n)&&(void 0!==n||t in e)||i(e,t,n)}var i=n(396),o=n(120),a=Object.prototype,s=a.hasOwnProperty;e.exports=r},function(e,t,n){function r(e,t){for(var n=e.length;n--;)if(i(e[n][0],t))return n;return-1}var i=n(120);e.exports=r},function(e,t,n){function r(e,t){t=i(t,e);for(var n=0,r=t.length;null!=e&&n<r;)e=e[o(t[n++])];return n&&n==r?e:void 0}var i=n(83),o=n(85);e.exports=r},function(e,t,n){function r(e,t){var n=e.__data__;return i(t)?n["string"==typeof t?"string":"hash"]:n.map}var i=n(909);e.exports=r},function(e,t){function n(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||i.test(e))&&e>-1&&e%1==0&&e<t}var r=9007199254740991,i=/^(?:0|[1-9]\d*)$/;e.exports=n},function(e,t){function n(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)}var r=Object.prototype;e.exports=n},function(e,t,n){var r=n(67),i=r(Object,"create");e.exports=i},function(e,t,n){function r(e){return"symbol"==typeof e||o(e)&&i(e)==a}var i=n(66),o=n(68),a="[object Symbol]";e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var a=n(233),s=function(e){return e&&e.__esModule?e:{default:e}}(a),u=function(e){function t(n){r(this,t);var o=i(this,e.call(this,n));return o.type="atrule",o}return o(t,e),t.prototype.append=function(){var t;this.nodes||(this.nodes=[]);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.prototype.append).call.apply(t,[this].concat(r))},t.prototype.prepend=function(){var t;this.nodes||(this.nodes=[]);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.prototype.prepend).call.apply(t,[this].concat(r))},t}(s.default);t.default=u,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(233),l=r(u),c=n(435),p=r(c),f=function(e){function t(n){i(this,t);var r=o(this,e.call(this,n));return r.type="rule",r.nodes||(r.nodes=[]),r}return a(t,e),s(t,[{key:"selectors",get:function(){return p.default.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}}]),t}(l.default);t.default=f,e.exports=t.default},function(e,t,n){"use strict";(function(t){function n(e,n,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,n)});case 3:return t.nextTick(function(){e.call(null,n,r)});case 4:return t.nextTick(function(){e.call(null,n,r,i)});default:for(o=new Array(s-1),a=0;a<o.length;)o[a++]=arguments[a];return t.nextTick(function(){e.apply(null,o)})}}!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports=n:e.exports=t.nextTick}).call(t,n(33))},function(e,t,n){"use strict";function r(e){return Object.prototype.hasOwnProperty.call(e,m)||(e[m]=h++,p[e[m]]={}),p[e[m]]}var i,o=n(13),a=n(242),s=n(1037),u=n(461),l=n(1069),c=n(253),p={},f=!1,h=0,d={topAbort:"abort",topAnimationEnd:l("animationend")||"animationend",topAnimationIteration:l("animationiteration")||"animationiteration",topAnimationStart:l("animationstart")||"animationstart",topBlur:"blur",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topTransitionEnd:l("transitionend")||"transitionend",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},m="_reactListenersID"+String(Math.random()).slice(2),v=o({},s,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(v.handleTopLevel),v.ReactEventListener=e}},setEnabled:function(e){v.ReactEventListener&&v.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!v.ReactEventListener||!v.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var n=t,i=r(n),o=a.registrationNameDependencies[e],s=0;s<o.length;s++){var u=o[s];i.hasOwnProperty(u)&&i[u]||("topWheel"===u?c("wheel")?v.ReactEventListener.trapBubbledEvent("topWheel","wheel",n):c("mousewheel")?v.ReactEventListener.trapBubbledEvent("topWheel","mousewheel",n):v.ReactEventListener.trapBubbledEvent("topWheel","DOMMouseScroll",n):"topScroll"===u?c("scroll",!0)?v.ReactEventListener.trapCapturedEvent("topScroll","scroll",n):v.ReactEventListener.trapBubbledEvent("topScroll","scroll",v.ReactEventListener.WINDOW_HANDLE):"topFocus"===u||"topBlur"===u?(c("focus",!0)?(v.ReactEventListener.trapCapturedEvent("topFocus","focus",n),v.ReactEventListener.trapCapturedEvent("topBlur","blur",n)):c("focusin")&&(v.ReactEventListener.trapBubbledEvent("topFocus","focusin",n),v.ReactEventListener.trapBubbledEvent("topBlur","focusout",n)),i.topBlur=!0,i.topFocus=!0):d.hasOwnProperty(u)&&v.ReactEventListener.trapBubbledEvent(u,d[u],n),i[u]=!0)}},trapBubbledEvent:function(e,t,n){return v.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return v.ReactEventListener.trapCapturedEvent(e,t,n)},supportsEventPageXY:function(){if(!document.createEvent)return!1;var e=document.createEvent("MouseEvent");return null!=e&&"pageX"in e},ensureScrollValueMonitoring:function(){if(void 0===i&&(i=v.supportsEventPageXY()),!i&&!f){var e=u.refreshScrollValues;v.ReactEventListener.monitorScrollValue(e),f=!0}}});e.exports=v},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(125),o=n(461),a=n(251),s={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:a,button:function(e){var t=e.button;return"which"in e?t:2===t?2:4===t?1:0},buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},pageX:function(e){return"pageX"in e?e.pageX:e.clientX+o.currentScrollLeft},pageY:function(e){return"pageY"in e?e.pageY:e.clientY+o.currentScrollTop}};i.augmentClass(r,s),e.exports=r},function(e,t,n){"use strict";var r=n(11),i=(n(8),{}),o={reinitializeTransaction:function(){this.transactionWrappers=this.getTransactionWrappers(),this.wrapperInitData?this.wrapperInitData.length=0:this.wrapperInitData=[],this._isInTransaction=!1},_isInTransaction:!1,getTransactionWrappers:null,isInTransaction:function(){return!!this._isInTransaction},perform:function(e,t,n,i,o,a,s,u){this.isInTransaction()&&r("27");var l,c;try{this._isInTransaction=!0,l=!0,this.initializeAll(0),c=e.call(t,n,i,o,a,s,u),l=!1}finally{try{if(l)try{this.closeAll(0)}catch(e){}else this.closeAll(0)}finally{this._isInTransaction=!1}}return c},initializeAll:function(e){for(var t=this.transactionWrappers,n=e;n<t.length;n++){var r=t[n];try{this.wrapperInitData[n]=i,this.wrapperInitData[n]=r.initialize?r.initialize.call(this):null}finally{if(this.wrapperInitData[n]===i)try{this.initializeAll(n+1)}catch(e){}}}},closeAll:function(e){this.isInTransaction()||r("28");for(var t=this.transactionWrappers,n=e;n<t.length;n++){var o,a=t[n],s=this.wrapperInitData[n];try{o=!0,s!==i&&a.close&&a.close.call(this,s),o=!1}finally{if(o)try{this.closeAll(n+1)}catch(e){}}}this.wrapperInitData.length=0}};e.exports=o},function(e,t,n){"use strict";function r(e){var t=""+e,n=o.exec(t);if(!n)return t;var r,i="",a=0,s=0;for(a=n.index;a<t.length;a++){switch(t.charCodeAt(a)){case 34:r=""";break;case 38:r="&";break;case 39:r="'";break;case 60:r="<";break;case 62:r=">";break;default:continue}s!==a&&(i+=t.substring(s,a)),s=a+1,i+=r}return s!==a?i+t.substring(s,a):i}function i(e){return"boolean"==typeof e||"number"==typeof e?""+e:r(e)}var o=/["'&<>]/;e.exports=i},function(e,t,n){"use strict";var r,i=n(25),o=n(241),a=/^[ \r\n\t\f]/,s=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,u=n(249),l=u(function(e,t){if(e.namespaceURI!==o.svg||"innerHTML"in e)e.innerHTML=t;else{r=r||document.createElement("div"),r.innerHTML="<svg>"+t+"</svg>";for(var n=r.firstChild;n.firstChild;)e.appendChild(n.firstChild)}});if(i.canUseDOM){var c=document.createElement("div");c.innerHTML=" ",""===c.innerHTML&&(l=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),a.test(t)||"<"===t[0]&&s.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t}),c=null}e.exports=l},function(e,t,n){"use strict";function r(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]="number"==typeof e[n]?e[n]:e[n].val);return t}t.__esModule=!0,t.default=r,e.exports=t.default},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o=-1,a=e.posMax,s=e.pos,u=e.isInLabel;if(e.isInLabel)return-1;if(e.labelUnmatchedScopes)return e.labelUnmatchedScopes--,-1;for(e.pos=t+1,e.isInLabel=!0,n=1;e.pos<a;){if(91===(i=e.src.charCodeAt(e.pos)))n++;else if(93===i&&0===--n){r=!0;break}e.parser.skipToken(e)}return r?(o=e.pos,e.labelUnmatchedScopes=0):e.labelUnmatchedScopes=n-1,e.pos=s,e.isInLabel=u,o}},function(e,t,n){"use strict";function r(){this.__rules__=[],this.__cache__=null}r.prototype.__find__=function(e){for(var t=this.__rules__.length,n=-1;t--;)if(this.__rules__[++n].name===e)return n;return-1},r.prototype.__compile__=function(){var e=this,t=[""];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},r.prototype.at=function(e,t,n){var r=this.__find__(e),i=n||{};if(-1===r)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null},r.prototype.before=function(e,t,n,r){var i=this.__find__(e),o=r||{};if(-1===i)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},r.prototype.after=function(e,t,n,r){var i=this.__find__(e),o=r||{};if(-1===i)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},r.prototype.push=function(e,t,n){var r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},r.prototype.enable=function(e,t){e=Array.isArray(e)?e:[e],t&&this.__rules__.forEach(function(e){e.enabled=!1}),e.forEach(function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!0},this),this.__cache__=null},r.prototype.disable=function(e){e=Array.isArray(e)?e:[e],e.forEach(function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!1},this),this.__cache__=null},r.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},e.exports=r},function(e,t,n){function r(e,t){for(var n in e)t[n]=e[n]}function i(e,t,n){return a(e,t,n)}var o=n(40),a=o.Buffer;a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=o:(r(o,t),t.Buffer=i),r(a,i),i.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,t,n)},i.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=a(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o.SlowBuffer(e)}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){return{type:v,payload:e}}function o(e){return{type:g,payload:e}}function a(e){return{type:y,payload:e}}function s(e){return{type:_,payload:e}}function u(e){return{type:b,payload:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.authorizeRequest=t.authorizeAccessCodeWithBasicAuthentication=t.authorizeAccessCodeWithFormParams=t.authorizeApplication=t.authorizePassword=t.preAuthorizeImplicit=t.CONFIGURE_AUTH=t.VALIDATE=t.AUTHORIZE_OAUTH2=t.PRE_AUTHORIZE_OAUTH2=t.LOGOUT=t.AUTHORIZE=t.SHOW_AUTH_POPUP=void 0;var l=n(30),c=r(l),p=n(35),f=r(p);t.showDefinitions=i,t.authorize=o,t.logout=a,t.authorizeOauth2=s,t.configureAuth=u;var h=n(46),d=r(h),m=n(9),v=t.SHOW_AUTH_POPUP="show_popup",g=t.AUTHORIZE="authorize",y=t.LOGOUT="logout",_=(t.PRE_AUTHORIZE_OAUTH2="pre_authorize_oauth2",t.AUTHORIZE_OAUTH2="authorize_oauth2"),b=(t.VALIDATE="validate",t.CONFIGURE_AUTH="configure_auth");t.preAuthorizeImplicit=function(e){return function(t){var n=t.authActions,r=t.errActions,i=e.auth,o=e.token,a=e.isValid,s=i.schema,u=i.name,l=s.get("flow");if(delete d.default.swaggerUIRedirectOauth2,"accessCode"===l||a||r.newAuthErr({authId:u,source:"auth",level:"warning",message:"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"}),o.error)return void r.newAuthErr({authId:u,source:"auth",level:"error",message:(0,f.default)(o)});n.authorizeOauth2({auth:i,token:o})}},t.authorizePassword=function(e){return function(t){var n=t.authActions,r=e.schema,i=e.name,o=e.username,a=e.password,s=e.passwordType,u=e.clientId,l=e.clientSecret,p={grant_type:"password",scope:e.scopes.join(" ")},f={},h={};return"basic"===s?h.Authorization="Basic "+(0,m.btoa)(o+":"+a):((0,c.default)(p,{username:o},{password:a}),"query"===s?(u&&(f.client_id=u),l&&(f.client_secret=l)):h.Authorization="Basic "+(0,m.btoa)(u+":"+l)),n.authorizeRequest({body:(0,m.buildFormData)(p),url:r.get("tokenUrl"),name:i,headers:h,query:f,auth:e})}},t.authorizeApplication=function(e){return function(t){var n=t.authActions,r=e.schema,i=e.scopes,o=e.name,a=e.clientId,s=e.clientSecret,u={Authorization:"Basic "+(0,m.btoa)(a+":"+s)},l={grant_type:"client_credentials",scope:i.join(" ")};return n.authorizeRequest({body:(0,m.buildFormData)(l),name:o,url:r.get("tokenUrl"),auth:e,headers:u})}},t.authorizeAccessCodeWithFormParams=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,i=t.schema,o=t.name,a=t.clientId,s=t.clientSecret,u={grant_type:"authorization_code",code:t.code,client_id:a,client_secret:s,redirect_uri:n};return r.authorizeRequest({body:(0,m.buildFormData)(u),name:o,url:i.get("tokenUrl"),auth:t})}},t.authorizeAccessCodeWithBasicAuthentication=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,i=t.schema,o=t.name,a=t.clientId,s=t.clientSecret,u={Authorization:"Basic "+(0,m.btoa)(a+":"+s)},l={grant_type:"authorization_code",code:t.code,client_id:a,redirect_uri:n};return r.authorizeRequest({body:(0,m.buildFormData)(l),name:o,url:i.get("tokenUrl"),auth:t,headers:u})}},t.authorizeRequest=function(e){return function(t){var n=t.fn,r=t.getConfigs,i=t.authActions,o=t.errActions,a=t.authSelectors,s=e.body,u=e.query,l=void 0===u?{}:u,p=e.headers,h=void 0===p?{}:p,d=e.name,m=e.url,v=e.auth,g=a.getConfigs()||{},y=g.additionalQueryStringParams,_=m;for(var b in y)m+="&"+b+"="+encodeURIComponent(y[b]);var x=(0,c.default)({Accept:"application/json, text/plain, */*","Content-Type":"application/x-www-form-urlencoded"},h);n.fetch({url:_,method:"post",headers:x,query:l,body:s,requestInterceptor:r().requestInterceptor,responseInterceptor:r().responseInterceptor}).then(function(e){var t=JSON.parse(e.data),n=t&&(t.error||""),r=t&&(t.parseError||"");return e.ok?n||r?void o.newAuthErr({authId:d,level:"error",source:"auth",message:(0,f.default)(t)}):void i.authorizeOauth2({auth:v,token:t}):void o.newAuthErr({authId:d,level:"error",source:"auth",message:e.statusText})}).catch(function(e){var t=new Error(e);o.newAuthErr({authId:d,level:"error",source:"auth",message:t.message})})}}},function(e,t,n){"use strict";function r(e,t){return{type:s,payload:(0,a.default)({},e,t)}}function i(e){return{type:u,payload:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.TOGGLE_CONFIGS=t.UPDATE_CONFIGS=void 0;var o=n(36),a=function(e){return e&&e.__esModule?e:{default:e}}(o);t.update=r,t.toggle=i;var s=t.UPDATE_CONFIGS="configs_update",u=t.TOGGLE_CONFIGS="configs_toggle"},function(e,t,n){"use strict";function r(e){return{type:u,payload:e}}function i(e){return{type:l,payload:e}}function o(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e=(0,s.normalizeArray)(e),{type:p,payload:{thing:e,shown:t}}}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=(0,s.normalizeArray)(e),{type:c,payload:{thing:e,mode:t}}}Object.defineProperty(t,"__esModule",{value:!0}),t.SHOW=t.UPDATE_MODE=t.UPDATE_FILTER=t.UPDATE_LAYOUT=void 0,t.updateLayout=r,t.updateFilter=i,t.show=o,t.changeMode=a;var s=n(9),u=t.UPDATE_LAYOUT="layout_update_layout",l=t.UPDATE_FILTER="layout_update_filter",c=t.UPDATE_MODE="layout_update_mode",p=t.SHOW="layout_show"},function(e,t,n){"use strict";function r(e,t){return{type:u,payload:{selectedServerUrl:e,namespace:t}}}function i(e){var t=e.value,n=e.pathMethod;return{type:l,payload:{value:t,pathMethod:n}}}function o(e){var t=e.value,n=e.pathMethod;return{type:c,payload:{value:t,pathMethod:n}}}function a(e){var t=e.value,n=e.path,r=e.method;return{type:p,payload:{value:t,path:n,method:r}}}function s(e){var t=e.server,n=e.namespace,r=e.key,i=e.val;return{type:f,payload:{server:t,namespace:n,key:r,val:i}}}Object.defineProperty(t,"__esModule",{value:!0}),t.setSelectedServer=r,t.setRequestBodyValue=i,t.setRequestContentType=o,t.setResponseContentType=a,t.setServerVariableValue=s;var u=t.UPDATE_SELECTED_SERVER="oas3_set_servers",l=t.UPDATE_REQUEST_BODY_VALUE="oas3_set_request_body_value",c=t.UPDATE_REQUEST_CONTENT_TYPE="oas3_set_request_content_type",p=t.UPDATE_RESPONSE_CONTENT_TYPE="oas3_set_response_content_type",f=t.UPDATE_SERVER_VARIABLE_VALUE="oas3_set_server_variable_value"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=h(e,t);if(n)return(0,s.default)(n,{declaration:!0,indent:"\t"})}Object.defineProperty(t,"__esModule",{value:!0}),t.memoizedSampleFromSchema=t.memoizedCreateXMLExample=t.sampleXmlFromSchema=t.inferSchema=t.sampleFromSchema=void 0,t.createXMLExample=i;var o=n(9),a=n(1198),s=r(a),u=n(968),l=r(u),c={string:function(){return"string"},string_email:function(){return"user@example.com"},"string_date-time":function(){return(new Date).toISOString()},number:function(){return 0},number_float:function(){return 0},integer:function(){return 0},boolean:function(e){return"boolean"!=typeof e.default||e.default}},p=function(e){e=(0,o.objectify)(e);var t=e,n=t.type,r=t.format,i=c[n+"_"+r]||c[n];return(0,o.isFunc)(i)?i(e):"Unknown Type: "+e.type},f=t.sampleFromSchema=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,o.objectify)(t),i=r.type,a=r.example,s=r.properties,u=r.additionalProperties,l=r.items,c=n.includeReadOnly,f=n.includeWriteOnly;if(void 0!==a)return a;if(!i)if(s)i="object";else{if(!l)return;i="array"}if("object"===i){var h=(0,o.objectify)(s),d={};for(var m in h)h[m].readOnly&&!c||h[m].writeOnly&&!f||(d[m]=e(h[m],n));if(!0===u)d.additionalProp1={};else if(u)for(var v=(0,o.objectify)(u),g=e(v,n),y=1;y<4;y++)d["additionalProp"+y]=g;return d}return"array"===i?[e(l,n)]:t.enum?t.default?t.default:(0,o.normalizeArray)(t.enum)[0]:"file"!==i?p(t):void 0},h=(t.inferSchema=function(e){return e.schema&&(e=e.schema),e.properties&&(e.type="object"),e},t.sampleXmlFromSchema=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,o.objectify)(t),i=r.type,a=r.properties,s=r.additionalProperties,u=r.items,l=r.example,c=n.includeReadOnly,f=n.includeWriteOnly,h=r.default,d={},m={},v=t.xml,g=v.name,y=v.prefix,_=v.namespace,b=r.enum,x=void 0,w=void 0;if(!i)if(a||s)i="object";else{if(!u)return;i="array"}if(g=g||"notagname",x=(y?y+":":"")+g,_){m[y?"xmlns:"+y:"xmlns"]=_}if("array"===i&&u){if(u.xml=u.xml||v||{},u.xml.name=u.xml.name||v.name,v.wrapped)return d[x]=[],Array.isArray(l)?l.forEach(function(t){u.example=t,d[x].push(e(u,n))}):Array.isArray(h)?h.forEach(function(t){u.default=t,d[x].push(e(u,n))}):d[x]=[e(u,n)],m&&d[x].push({_attr:m}),d;var k=[];return Array.isArray(l)?(l.forEach(function(t){u.example=t,k.push(e(u,n))}),k):Array.isArray(h)?(h.forEach(function(t){u.default=t,k.push(e(u,n))}),k):e(u,n)}if("object"===i){var E=(0,o.objectify)(a);d[x]=[],l=l||{};for(var S in E)if(E.hasOwnProperty(S)&&(!E[S].readOnly||c)&&(!E[S].writeOnly||f))if(E[S].xml=E[S].xml||{},E[S].xml.attribute){var C=Array.isArray(E[S].enum)&&E[S].enum[0],A=E[S].example,D=E[S].default;m[E[S].xml.name||S]=void 0!==A&&A||void 0!==l[S]&&l[S]||void 0!==D&&D||C||p(E[S])}else{E[S].xml.name=E[S].xml.name||S,E[S].example=void 0!==E[S].example?E[S].example:l[S];var O=e(E[S]);Array.isArray(O)?d[x]=d[x].concat(O):d[x].push(O)}return!0===s?d[x].push({additionalProp:"Anything can be here"}):s&&d[x].push({additionalProp:p(s)}),m&&d[x].push({_attr:m}),d}return w=void 0!==l?l:void 0!==h?h:Array.isArray(b)?b[0]:p(t),d[x]=m?[{_attr:m},w]:w,d});t.memoizedCreateXMLExample=(0,l.default)(i),t.memoizedSampleFromSchema=(0,l.default)(f)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=X(e).replace(/\t/g," ");if("string"==typeof e)return{type:R,payload:t}}function o(e){return{type:J,payload:e}}function a(e){return{type:j,payload:e}}function s(e){return{type:F,payload:e}}function u(e,t,n,r,i){return{type:N,payload:{path:e,value:r,paramName:t,paramIn:n,isXml:i}}}function l(e){return{type:H,payload:{pathMethod:e}}}function c(e,t){return{type:G,payload:{path:e,value:t,key:"consumes_value"}}}function p(e,t){return{type:G,payload:{path:e,value:t,key:"produces_value"}}}function f(e,t){return{type:W,payload:{path:e,method:t}}}function h(e,t){return{type:V,payload:{path:e,method:t}}}function d(e,t,n){return{type:K,payload:{scheme:e,path:t,method:n}}}Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.executeRequest=t.logRequest=t.setMutatedRequest=t.setRequest=t.setResponse=t.validateParams=t.resolveSpec=t.parseToJson=t.SET_SCHEME=t.UPDATE_RESOLVED=t.UPDATE_OPERATION_META_VALUE=t.CLEAR_VALIDATE_PARAMS=t.CLEAR_REQUEST=t.CLEAR_RESPONSE=t.LOG_REQUEST=t.SET_MUTATED_REQUEST=t.SET_REQUEST=t.SET_RESPONSE=t.VALIDATE_PARAMS=t.UPDATE_PARAM=t.UPDATE_JSON=t.UPDATE_URL=t.UPDATE_SPEC=void 0;var m=n(21),v=r(m),g=n(96),y=r(g),_=n(30),b=r(_),x=n(47),w=r(x),k=n(48),E=r(k);t.updateSpec=i,t.updateResolved=o,t.updateUrl=a,t.updateJsonSpec=s,t.changeParam=u,t.clearValidateParams=l,t.changeConsumesValue=c,t.changeProducesValue=p,t.clearResponse=f,t.clearRequest=h,t.setScheme=d;var S=n(211),C=r(S),A=n(1187),D=r(A),O=n(264),M=r(O),T=n(422),P=r(T),I=n(9),R=t.UPDATE_SPEC="spec_update_spec",j=t.UPDATE_URL="spec_update_url",F=t.UPDATE_JSON="spec_update_json",N=t.UPDATE_PARAM="spec_update_param",B=t.VALIDATE_PARAMS="spec_validate_param",L=t.SET_RESPONSE="spec_set_response",q=t.SET_REQUEST="spec_set_request",z=t.SET_MUTATED_REQUEST="spec_set_mutated_request",U=t.LOG_REQUEST="spec_log_request",W=t.CLEAR_RESPONSE="spec_clear_response",V=t.CLEAR_REQUEST="spec_clear_request",H=t.CLEAR_VALIDATE_PARAMS="spec_clear_validate_param",G=t.UPDATE_OPERATION_META_VALUE="spec_update_operation_meta_value",J=t.UPDATE_RESOLVED="spec_update_resolved",K=t.SET_SCHEME="set_scheme",X=function(e){return(0,P.default)(e)?e:""},Y=(t.parseToJson=function(e){return function(t){var n=t.specActions,r=t.specSelectors,i=t.errActions,o=r.specStr,a=null;try{e=e||o(),i.clear({source:"parser"}),a=C.default.safeLoad(e)}catch(e){return console.error(e),i.newSpecErr({source:"parser",level:"error",message:e.reason,line:e.mark&&e.mark.line?e.mark.line+1:void 0})}return a&&"object"===(void 0===a?"undefined":(0,E.default)(a))?n.updateJsonSpec(a):{}}},t.resolveSpec=function(e,t){return function(n){var r=n.specActions,i=n.specSelectors,o=n.errActions,a=n.fn,s=a.fetch,u=a.resolve,l=a.AST,c=n.getConfigs,p=c(),f=p.modelPropertyMacro,h=p.parameterMacro,d=p.requestInterceptor,m=p.responseInterceptor;void 0===e&&(e=i.specJson()),void 0===t&&(t=i.url());var v=l.getLineNumberForPath,g=i.specStr();return u({fetch:s,spec:e,baseDoc:t,modelPropertyMacro:f,parameterMacro:h,requestInterceptor:d,responseInterceptor:m}).then(function(e){var t=e.spec,n=e.errors;if(o.clear({type:"thrown"}),Array.isArray(n)&&n.length>0){var i=n.map(function(e){return console.error(e),e.line=e.fullPath?v(g,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",Object.defineProperty(e,"message",{enumerable:!0,value:e.message}),e});o.newThrownErrBatch(i)}return r.updateResolved(t)})}},t.validateParams=function(e,t){return{type:B,payload:{pathMethod:e,isOAS3:t}}},t.setResponse=function(e,t,n){return{payload:{path:e,method:t,res:n},type:L}},t.setRequest=function(e,t,n){return{payload:{path:e,method:t,req:n},type:q}},t.setMutatedRequest=function(e,t,n){return{payload:{path:e,method:t,req:n},type:z}},t.logRequest=function(e){return{payload:e,type:U}},t.executeRequest=function(e){return function(t){var n=t.fn,r=t.specActions,i=t.specSelectors,o=t.getConfigs,a=t.oas3Selectors,s=e.pathName,u=e.method,l=e.operation,c=o(),p=c.requestInterceptor,f=c.responseInterceptor,h=l.toJS();if(e.contextUrl=(0,D.default)(i.url()).toString(),h&&h.operationId?e.operationId=h.operationId:h&&s&&u&&(e.operationId=n.opId(h,s,u)),i.isOAS3()){var d=s+":"+u;e.server=a.selectedServer(d)||a.selectedServer();var m=a.serverVariables({server:e.server,namespace:d}).toJS(),v=a.serverVariables({server:e.server}).toJS();e.serverVariables=(0,w.default)(m).length?m:v,e.requestContentType=a.requestContentType(s,u),e.responseContentType=a.responseContentType(s,u)||"*/*";var g=a.requestBodyValue(s,u);(0,I.isJSONObject)(g)?e.requestBody=JSON.parse(g):e.requestBody=g}var y=(0,b.default)({},e);y=n.buildRequest(y),r.setRequest(e.pathName,e.method,y);var _=function(t){var n=p.apply(this,[t]),i=(0,b.default)({},n);return r.setMutatedRequest(e.pathName,e.method,i),n};e.requestInterceptor=_,e.responseInterceptor=f;var x=Date.now();return n.execute(e).then(function(t){t.duration=Date.now()-x,r.setResponse(e.pathName,e.method,t)}).catch(function(t){return r.setResponse(e.pathName,e.method,{error:!0,err:(0,M.default)(t)})})}},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.path,n=e.method,r=(0,y.default)(e,["path","method"]);return function(e){var i=e.fn.fetch,o=e.specSelectors,a=e.specActions,s=o.spec().toJS(),u=o.operationScheme(t,n),l=o.contentTypeValues([t,n]).toJS(),c=l.requestContentType,p=l.responseContentType,f=/xml/i.test(c),h=o.parameterValues([t,n],f).toJS();return a.executeRequest((0,v.default)({fetch:i,spec:s,pathName:t,method:n,parameters:h,requestContentType:c,scheme:u,responseContentType:p},r))}});t.execute=Y},function(e,t,n){"use strict";function r(e){switch(e._type){case"document":case"block_quote":case"list":case"item":case"paragraph":case"heading":case"emph":case"strong":case"link":case"image":case"custom_inline":case"custom_block":return!0;default:return!1}}var i=function(e,t){this.current=e,this.entering=!0===t},o=function(){var e=this.current,t=this.entering;if(null===e)return null;var n=r(e);return t&&n?e._firstChild?(this.current=e._firstChild,this.entering=!0):this.entering=!1:e===this.root?this.current=null:null===e._next?(this.current=e._parent,this.entering=!1):(this.current=e._next,this.entering=!0),{entering:t,node:e}},a=function(e){return{current:e,root:e,entering:!0,next:o,resumeAt:i}},s=function(e,t){this._type=e,this._parent=null,this._firstChild=null,this._lastChild=null,this._prev=null,this._next=null,this._sourcepos=t,this._lastLineBlank=!1,this._open=!0,this._string_content=null,this._literal=null,this._listData={},this._info=null,this._destination=null,this._title=null,this._isFenced=!1,this._fenceChar=null,this._fenceLength=0,this._fenceOffset=null,this._level=null,this._onEnter=null,this._onExit=null},u=s.prototype;Object.defineProperty(u,"isContainer",{get:function(){return r(this)}}),Object.defineProperty(u,"type",{get:function(){return this._type}}),Object.defineProperty(u,"firstChild",{get:function(){return this._firstChild}}),Object.defineProperty(u,"lastChild",{get:function(){return this._lastChild}}),Object.defineProperty(u,"next",{get:function(){return this._next}}),Object.defineProperty(u,"prev",{get:function(){return this._prev}}),Object.defineProperty(u,"parent",{get:function(){return this._parent}}),Object.defineProperty(u,"sourcepos",{get:function(){return this._sourcepos}}),Object.defineProperty(u,"literal",{get:function(){return this._literal},set:function(e){this._literal=e}}),Object.defineProperty(u,"destination",{get:function(){return this._destination},set:function(e){this._destination=e}}),Object.defineProperty(u,"title",{get:function(){return this._title},set:function(e){this._title=e}}),Object.defineProperty(u,"info",{get:function(){return this._info},set:function(e){this._info=e}}),Object.defineProperty(u,"level",{get:function(){return this._level},set:function(e){this._level=e}}),Object.defineProperty(u,"listType",{get:function(){return this._listData.type},set:function(e){this._listData.type=e}}),Object.defineProperty(u,"listTight",{get:function(){return this._listData.tight},set:function(e){this._listData.tight=e}}),Object.defineProperty(u,"listStart",{get:function(){return this._listData.start},set:function(e){this._listData.start=e}}),Object.defineProperty(u,"listDelimiter",{get:function(){return this._listData.delimiter},set:function(e){this._listData.delimiter=e}}),Object.defineProperty(u,"onEnter",{get:function(){return this._onEnter},set:function(e){this._onEnter=e}}),Object.defineProperty(u,"onExit",{get:function(){return this._onExit},set:function(e){this._onExit=e}}),s.prototype.appendChild=function(e){e.unlink(),e._parent=this,this._lastChild?(this._lastChild._next=e,e._prev=this._lastChild,this._lastChild=e):(this._firstChild=e,this._lastChild=e)},s.prototype.prependChild=function(e){e.unlink(),e._parent=this,this._firstChild?(this._firstChild._prev=e,e._next=this._firstChild,this._firstChild=e):(this._firstChild=e,this._lastChild=e)},s.prototype.unlink=function(){this._prev?this._prev._next=this._next:this._parent&&(this._parent._firstChild=this._next),this._next?this._next._prev=this._prev:this._parent&&(this._parent._lastChild=this._prev),this._parent=null,this._next=null,this._prev=null},s.prototype.insertAfter=function(e){e.unlink(),e._next=this._next,e._next&&(e._next._prev=e),e._prev=this,this._next=e,e._parent=this._parent,e._next||(e._parent._lastChild=e)},s.prototype.insertBefore=function(e){e.unlink(),e._prev=this._prev,e._prev&&(e._prev._next=e),e._next=this,this._prev=e,e._parent=this._parent,e._prev||(e._parent._firstChild=e)},s.prototype.walker=function(){return new a(this)},e.exports=s},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(53),i=n(181),o=n(76),a=n(133),s=n(602);e.exports=function(e,t){var n=1==e,u=2==e,l=3==e,c=4==e,p=6==e,f=5==e||p,h=t||s;return function(t,s,d){for(var m,v,g=o(t),y=i(g),_=r(s,d,3),b=a(y.length),x=0,w=n?h(t,b):u?h(t,0):void 0;b>x;x++)if((f||x in y)&&(m=y[x],v=_(m,x,g),e))if(n)w[x]=v;else if(v)switch(e){case 3:return!0;case 5:return m;case 6:return x;case 2:w.push(m)}else if(c)return!1;return p?-1:l||c?c:w}}},function(e,t,n){var r=n(99),i=n(22)("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=a(t=Object(e),i))?n:o?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(27),i=n(24).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(99);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){"use strict";function r(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=i(t),this.reject=i(n)}var i=n(98);e.exports.f=function(e){return new r(e)}},function(e,t,n){var r=n(37),i=n(611),o=n(180),a=n(187)("IE_PROTO"),s=function(){},u=function(){var e,t=n(179)("iframe"),r=o.length;for(t.style.display="none",n(334).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[o[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(56);e.exports=function(e,t,n){for(var i in t)n&&e[i]?e[i]=t[i]:r(e,i,t[i]);return e}},function(e,t,n){e.exports=n(56)},function(e,t,n){var r=n(188)("keys"),i=n(134);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){var r=n(24),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});e.exports=function(e){return i[e]||(i[e]={})}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(27);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var r=n(24),i=n(15),o=n(130),a=n(192),s=n(41).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,n){t.f=n(22)},function(e,t,n){var r=n(177),i=n(22)("iterator"),o=n(74);e.exports=n(15).getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t){},function(e,t,n){var r=n(105),i=n(19)("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=a(t=Object(e),i))?n:o?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t,n){var r=n(77),i=n(31).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,n){var r=n(19)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,n){"use strict";function r(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=i(t),this.reject=i(n)}var i=n(135);e.exports.f=function(e){return new r(e)}},function(e,t,n){var r=n(138).f,i=n(108),o=n(19)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){var r=n(361)("keys"),i=n(202);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){var r=n(354),i=n(57);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(e))}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){"use strict";(function(t){/*! +var r=n(569),o=n(570),i=n(355);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return p(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=f(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(t,n),o=(e=s(e,r)).write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|h(t.length);return 0===(e=s(e,n)).length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):f(e,t);if("Buffer"===t.type&&i(t.data))return f(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function p(e,t){if(l(t),e=s(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|h(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function d(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return B(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return A(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){var i,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=n;i<s;i++)if(c(e,i)===c(t,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*a}else-1!==l&&(i-=i-l),l=-1}else for(n+u>s&&(n=s-u),i=n;i>=0;i--){for(var p=!0,f=0;f<u;f++)if(c(e,i+f)!==c(t,f)){p=!1;break}if(p)return i}return-1}function b(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function _(e,t,n,r){return V(B(t,e.length-n),e,n,r)}function w(e,t,n,r){return V(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function x(e,t,n,r){return w(e,t,n,r)}function E(e,t,n,r){return V(z(t),e,n,r)}function S(e,t,n,r){return V(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function C(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function k(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,s,u,c=e[o],l=null,p=c>239?4:c>223?3:c>191?2:1;if(o+p<=n)switch(p){case 1:c<128&&(l=c);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,p=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=p}return function(e){var t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=O));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return p(null,e)},u.allocUnsafeSlow=function(e){return p(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?k(this,0,e):m.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(r,o),l=e.slice(t,n),p=0;p<s;++p)if(c[p]!==l[p]){i=c[p],a=l[p];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function A(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function T(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function j(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=F(e[i]);return o}function P(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function I(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function N(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function R(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function D(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,r,i){return i||D(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function U(e,t,n,r,i){return i||D(e,0,n,8),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var o=t-e;n=new u(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):R(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);M(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);M(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):R(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,i=r-n;if(this===e&&n<t&&t<r)for(o=i-1;o>=0;--o)e[o+t]=this[o+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=u.isBuffer(e)?e:B(new u(e,r).toString()),s=a.length;for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this};var q=/[^+\/0-9A-Za-z-_]/g;function F(e){return e<16?"0"+e.toString(16):e.toString(16)}function B(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function z(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(36))},function(e,t,n){"use strict";e.exports={current:null}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,p=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):p=-1,c.length&&h())}function h(){if(!l){var e=s(f);l=!0;for(var t=c.length;t;){for(u=c,c=[];++p<t;)u&&u[p].run();p=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new d(e,t)),1!==c.length||l||s(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";var r=n(25),o=n(90),i=n(57),a=(n(23),["dispatchConfig","_targetInst","nativeEvent","isDefaultPrevented","isPropagationStopped","_dispatchListeners","_dispatchInstances"]),s={type:null,target:null,currentTarget:i.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};function u(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n;var o=this.constructor.Interface;for(var a in o)if(o.hasOwnProperty(a)){0;var s=o[a];s?this[a]=s(n):"target"===a?this.target=r:this[a]=n[a]}var u=null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue;return this.isDefaultPrevented=u?i.thatReturnsTrue:i.thatReturnsFalse,this.isPropagationStopped=i.thatReturnsFalse,this}r(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=i.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=i.thatReturnsTrue)},persist:function(){this.isPersistent=i.thatReturnsTrue},isPersistent:i.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;for(var n=0;n<a.length;n++)this[a[n]]=null}}),u.Interface=s,u.augmentClass=function(e,t){var n=function(){};n.prototype=this.prototype;var i=new n;r(i,e.prototype),e.prototype=i,e.prototype.constructor=e,e.Interface=r({},this.Interface,t),e.augmentClass=this.augmentClass,o.addPoolingTo(e,o.fourArgumentPooler)},o.addPoolingTo(u,o.fourArgumentPooler),e.exports=u},function(e,t,n){var r=n(365);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){"use strict";n.r(t),n.d(t,"lastError",function(){return d}),n.d(t,"url",function(){return m}),n.d(t,"specStr",function(){return v}),n.d(t,"specSource",function(){return g}),n.d(t,"specJson",function(){return y}),n.d(t,"specResolved",function(){return b}),n.d(t,"specResolvedSubtree",function(){return _}),n.d(t,"specJsonWithResolvedSubtrees",function(){return x}),n.d(t,"spec",function(){return E}),n.d(t,"isOAS3",function(){return S}),n.d(t,"info",function(){return C}),n.d(t,"externalDocs",function(){return k}),n.d(t,"version",function(){return O}),n.d(t,"semver",function(){return A}),n.d(t,"paths",function(){return T}),n.d(t,"operations",function(){return j}),n.d(t,"consumes",function(){return P}),n.d(t,"produces",function(){return I}),n.d(t,"security",function(){return M}),n.d(t,"securityDefinitions",function(){return N}),n.d(t,"findDefinition",function(){return R}),n.d(t,"definitions",function(){return D}),n.d(t,"basePath",function(){return L}),n.d(t,"host",function(){return U}),n.d(t,"schemes",function(){return q}),n.d(t,"operationsWithRootInherited",function(){return F}),n.d(t,"tags",function(){return B}),n.d(t,"tagDetails",function(){return z}),n.d(t,"operationsWithTags",function(){return V}),n.d(t,"taggedOperations",function(){return H}),n.d(t,"responses",function(){return W}),n.d(t,"requests",function(){return J}),n.d(t,"mutatedRequests",function(){return K}),n.d(t,"responseFor",function(){return Y}),n.d(t,"requestFor",function(){return $}),n.d(t,"mutatedRequestFor",function(){return G}),n.d(t,"allowTryItOutFor",function(){return Z}),n.d(t,"parameterWithMetaByIdentity",function(){return X}),n.d(t,"parameterInclusionSettingFor",function(){return Q}),n.d(t,"parameterWithMeta",function(){return ee}),n.d(t,"operationWithMeta",function(){return te}),n.d(t,"getParameter",function(){return ne}),n.d(t,"hasHost",function(){return re}),n.d(t,"parameterValues",function(){return oe}),n.d(t,"parametersIncludeIn",function(){return ie}),n.d(t,"parametersIncludeType",function(){return ae}),n.d(t,"contentTypeValues",function(){return se}),n.d(t,"currentProducesFor",function(){return ue}),n.d(t,"producesOptionsFor",function(){return ce}),n.d(t,"consumesOptionsFor",function(){return le}),n.d(t,"operationScheme",function(){return pe}),n.d(t,"canExecuteScheme",function(){return fe}),n.d(t,"validateBeforeExecute",function(){return he});var r=n(14),o=n.n(r),i=n(13),a=n.n(i),s=n(12),u=n.n(s),c=n(11),l=n(3),p=n(1),f=["get","put","post","delete","options","head","patch","trace"],h=function(e){return e||Object(p.Map)()},d=Object(c.createSelector)(h,function(e){return e.get("lastError")}),m=Object(c.createSelector)(h,function(e){return e.get("url")}),v=Object(c.createSelector)(h,function(e){return e.get("spec")||""}),g=Object(c.createSelector)(h,function(e){return e.get("specSource")||"not-editor"}),y=Object(c.createSelector)(h,function(e){return e.get("json",Object(p.Map)())}),b=Object(c.createSelector)(h,function(e){return e.get("resolved",Object(p.Map)())}),_=function(e,t){return e.getIn(["resolvedSubtrees"].concat(u()(t)),void 0)},w=function e(t,n){return p.Map.isMap(t)&&p.Map.isMap(n)?n.get("$$ref")?n:Object(p.OrderedMap)().mergeWith(e,t,n):n},x=Object(c.createSelector)(h,function(e){return Object(p.OrderedMap)().mergeWith(w,e.get("json"),e.get("resolvedSubtrees"))}),E=function(e){return y(e)},S=Object(c.createSelector)(E,function(){return!1}),C=Object(c.createSelector)(E,function(e){return de(e&&e.get("info"))}),k=Object(c.createSelector)(E,function(e){return de(e&&e.get("externalDocs"))}),O=Object(c.createSelector)(C,function(e){return e&&e.get("version")}),A=Object(c.createSelector)(O,function(e){return/v?([0-9]*)\.([0-9]*)\.([0-9]*)/i.exec(e).slice(1)}),T=Object(c.createSelector)(x,function(e){return e.get("paths")}),j=Object(c.createSelector)(T,function(e){if(!e||e.size<1)return Object(p.List)();var t=Object(p.List)();return e&&e.forEach?(e.forEach(function(e,n){if(!e||!e.forEach)return{};e.forEach(function(e,r){f.indexOf(r)<0||(t=t.push(Object(p.fromJS)({path:n,method:r,operation:e,id:"".concat(r,"-").concat(n)})))})}),t):Object(p.List)()}),P=Object(c.createSelector)(E,function(e){return Object(p.Set)(e.get("consumes"))}),I=Object(c.createSelector)(E,function(e){return Object(p.Set)(e.get("produces"))}),M=Object(c.createSelector)(E,function(e){return e.get("security",Object(p.List)())}),N=Object(c.createSelector)(E,function(e){return e.get("securityDefinitions")}),R=function(e,t){var n=e.getIn(["resolvedSubtrees","definitions",t],null),r=e.getIn(["json","definitions",t],null);return n||r||null},D=Object(c.createSelector)(E,function(e){var t=e.get("definitions");return p.Map.isMap(t)?t:Object(p.Map)()}),L=Object(c.createSelector)(E,function(e){return e.get("basePath")}),U=Object(c.createSelector)(E,function(e){return e.get("host")}),q=Object(c.createSelector)(E,function(e){return e.get("schemes",Object(p.Map)())}),F=Object(c.createSelector)(j,P,I,function(e,t,n){return e.map(function(e){return e.update("operation",function(e){if(e){if(!p.Map.isMap(e))return;return e.withMutations(function(e){return e.get("consumes")||e.update("consumes",function(e){return Object(p.Set)(e).merge(t)}),e.get("produces")||e.update("produces",function(e){return Object(p.Set)(e).merge(n)}),e})}return Object(p.Map)()})})}),B=Object(c.createSelector)(E,function(e){var t=e.get("tags",Object(p.List)());return p.List.isList(t)?t.filter(function(e){return p.Map.isMap(e)}):Object(p.List)()}),z=function(e,t){return(B(e)||Object(p.List)()).filter(p.Map.isMap).find(function(e){return e.get("name")===t},Object(p.Map)())},V=Object(c.createSelector)(F,B,function(e,t){return e.reduce(function(e,t){var n=Object(p.Set)(t.getIn(["operation","tags"]));return n.count()<1?e.update("default",Object(p.List)(),function(e){return e.push(t)}):n.reduce(function(e,n){return e.update(n,Object(p.List)(),function(e){return e.push(t)})},e)},t.reduce(function(e,t){return e.set(t.get("name"),Object(p.List)())},Object(p.OrderedMap)()))}),H=function(e){return function(t){var n=(0,t.getConfigs)(),r=n.tagsSorter,o=n.operationsSorter;return V(e).sortBy(function(e,t){return t},function(e,t){var n="function"==typeof r?r:l.H.tagsSorter[r];return n?n(e,t):null}).map(function(t,n){var r="function"==typeof o?o:l.H.operationsSorter[o],i=r?t.sort(r):t;return Object(p.Map)({tagDetails:z(e,n),operations:i})})}},W=Object(c.createSelector)(h,function(e){return e.get("responses",Object(p.Map)())}),J=Object(c.createSelector)(h,function(e){return e.get("requests",Object(p.Map)())}),K=Object(c.createSelector)(h,function(e){return e.get("mutatedRequests",Object(p.Map)())}),Y=function(e,t,n){return W(e).getIn([t,n],null)},$=function(e,t,n){return J(e).getIn([t,n],null)},G=function(e,t,n){return K(e).getIn([t,n],null)},Z=function(){return!0},X=function(e,t,n){var r=x(e).getIn(["paths"].concat(u()(t),["parameters"]),Object(p.OrderedMap)()),o=e.getIn(["meta","paths"].concat(u()(t),["parameters"]),Object(p.OrderedMap)());return r.map(function(e){var t=o.get("".concat(n.get("in"),".").concat(n.get("name"))),r=o.get("".concat(n.get("in"),".").concat(n.get("name"),".hash-").concat(n.hashCode()));return Object(p.OrderedMap)().merge(e,t,r)}).find(function(e){return e.get("in")===n.get("in")&&e.get("name")===n.get("name")},Object(p.OrderedMap)())},Q=function(e,t,n,r){var o="".concat(r,".").concat(n);return e.getIn(["meta","paths"].concat(u()(t),["parameter_inclusions",o]),!1)},ee=function(e,t,n,r){var o=x(e).getIn(["paths"].concat(u()(t),["parameters"]),Object(p.OrderedMap)()).find(function(e){return e.get("in")===r&&e.get("name")===n},Object(p.OrderedMap)());return X(e,t,o)},te=function(e,t,n){var r=x(e).getIn(["paths",t,n],Object(p.OrderedMap)()),o=e.getIn(["meta","paths",t,n],Object(p.OrderedMap)()),i=r.get("parameters",Object(p.List)()).map(function(r){return X(e,[t,n],r)});return Object(p.OrderedMap)().merge(r,o).set("parameters",i)};function ne(e,t,n,r){return t=t||[],e.getIn(["meta","paths"].concat(u()(t),["parameters"]),Object(p.fromJS)([])).find(function(e){return p.Map.isMap(e)&&e.get("name")===n&&e.get("in")===r})||Object(p.Map)()}var re=Object(c.createSelector)(E,function(e){var t=e.get("host");return"string"==typeof t&&t.length>0&&"/"!==t[0]});function oe(e,t,n){return t=t||[],te.apply(void 0,[e].concat(u()(t))).get("parameters",Object(p.List)()).reduce(function(e,t){var r=n&&"body"===t.get("in")?t.get("value_xml"):t.get("value");return e.set(Object(l.B)(t,{allowHashes:!1}),r)},Object(p.fromJS)({}))}function ie(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(p.List.isList(e))return e.some(function(e){return p.Map.isMap(e)&&e.get("in")===t})}function ae(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(p.List.isList(e))return e.some(function(e){return p.Map.isMap(e)&&e.get("type")===t})}function se(e,t){t=t||[];var n=x(e).getIn(["paths"].concat(u()(t)),Object(p.fromJS)({})),r=e.getIn(["meta","paths"].concat(u()(t)),Object(p.fromJS)({})),o=ue(e,t),i=n.get("parameters")||new p.List,a=r.get("consumes_value")?r.get("consumes_value"):ae(i,"file")?"multipart/form-data":ae(i,"formData")?"application/x-www-form-urlencoded":void 0;return Object(p.fromJS)({requestContentType:a,responseContentType:o})}function ue(e,t){t=t||[];var n=x(e).getIn(["paths"].concat(u()(t)),null);if(null!==n){var r=e.getIn(["meta","paths"].concat(u()(t),["produces_value"]),null),o=n.getIn(["produces",0],null);return r||o||"application/json"}}function ce(e,t){t=t||[];var n=x(e),r=n.getIn(["paths"].concat(u()(t)),null);if(null!==r){var o=t,i=a()(o,1)[0],s=r.get("produces",null),c=n.getIn(["paths",i,"produces"],null),l=n.getIn(["produces"],null);return s||c||l}}function le(e,t){t=t||[];var n=x(e),r=n.getIn(["paths"].concat(u()(t)),null);if(null!==r){var o=t,i=a()(o,1)[0],s=r.get("consumes",null),c=n.getIn(["paths",i,"consumes"],null),l=n.getIn(["consumes"],null);return s||c||l}}var pe=function(e,t,n){var r=e.get("url").match(/^([a-z][a-z0-9+\-.]*):/),i=o()(r)?r[1]:null;return e.getIn(["scheme",t,n])||e.getIn(["scheme","_defaultScheme"])||i||""},fe=function(e,t,n){return["http","https"].indexOf(pe(e,t,n))>-1},he=function(e,t){t=t||[];var n=e.getIn(["meta","paths"].concat(u()(t),["parameters"]),Object(p.fromJS)([])),r=!0;return n.forEach(function(e){var t=e.get("errors");t&&t.count()&&(r=!1)}),r};function de(e){return p.Map.isMap(e)?e:new p.Map}},function(e,t,n){"use strict";n.r(t),n.d(t,"SHOW_AUTH_POPUP",function(){return d}),n.d(t,"AUTHORIZE",function(){return m}),n.d(t,"LOGOUT",function(){return v}),n.d(t,"PRE_AUTHORIZE_OAUTH2",function(){return g}),n.d(t,"AUTHORIZE_OAUTH2",function(){return y}),n.d(t,"VALIDATE",function(){return b}),n.d(t,"CONFIGURE_AUTH",function(){return _}),n.d(t,"showDefinitions",function(){return w}),n.d(t,"authorize",function(){return x}),n.d(t,"logout",function(){return E}),n.d(t,"preAuthorizeImplicit",function(){return S}),n.d(t,"authorizeOauth2",function(){return C}),n.d(t,"authorizePassword",function(){return k}),n.d(t,"authorizeApplication",function(){return O}),n.d(t,"authorizeAccessCodeWithFormParams",function(){return A}),n.d(t,"authorizeAccessCodeWithBasicAuthentication",function(){return T}),n.d(t,"authorizeRequest",function(){return j}),n.d(t,"configureAuth",function(){return P});var r=n(26),o=n.n(r),i=n(16),a=n.n(i),s=n(28),u=n.n(s),c=n(95),l=n.n(c),p=n(18),f=n.n(p),h=n(3),d="show_popup",m="authorize",v="logout",g="pre_authorize_oauth2",y="authorize_oauth2",b="validate",_="configure_auth";function w(e){return{type:d,payload:e}}function x(e){return{type:m,payload:e}}function E(e){return{type:v,payload:e}}var S=function(e){return function(t){var n=t.authActions,r=t.errActions,o=e.auth,i=e.token,a=e.isValid,s=o.schema,c=o.name,l=s.get("flow");delete f.a.swaggerUIRedirectOauth2,"accessCode"===l||a||r.newAuthErr({authId:c,source:"auth",level:"warning",message:"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"}),i.error?r.newAuthErr({authId:c,source:"auth",level:"error",message:u()(i)}):n.authorizeOauth2({auth:o,token:i})}};function C(e){return{type:y,payload:e}}var k=function(e){return function(t){var n=t.authActions,r=e.schema,o=e.name,i=e.username,s=e.password,u=e.passwordType,c=e.clientId,l=e.clientSecret,p={grant_type:"password",scope:e.scopes.join(" "),username:i,password:s},f={};switch(u){case"request-body":!function(e,t,n){t&&a()(e,{client_id:t});n&&a()(e,{client_secret:n})}(p,c,l);break;case"basic":f.Authorization="Basic "+Object(h.a)(c+":"+l);break;default:console.warn("Warning: invalid passwordType ".concat(u," was passed, not including client id and secret"))}return n.authorizeRequest({body:Object(h.b)(p),url:r.get("tokenUrl"),name:o,headers:f,query:{},auth:e})}};var O=function(e){return function(t){var n=t.authActions,r=e.schema,o=e.scopes,i=e.name,a=e.clientId,s=e.clientSecret,u={Authorization:"Basic "+Object(h.a)(a+":"+s)},c={grant_type:"client_credentials",scope:o.join(" ")};return n.authorizeRequest({body:Object(h.b)(c),name:i,url:r.get("tokenUrl"),auth:e,headers:u})}},A=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,o=t.schema,i=t.name,a=t.clientId,s=t.clientSecret,u=t.codeVerifier,c={grant_type:"authorization_code",code:t.code,client_id:a,client_secret:s,redirect_uri:n,code_verifier:u};return r.authorizeRequest({body:Object(h.b)(c),name:i,url:o.get("tokenUrl"),auth:t})}},T=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,o=t.schema,i=t.name,a=t.clientId,s=t.clientSecret,u={Authorization:"Basic "+Object(h.a)(a+":"+s)},c={grant_type:"authorization_code",code:t.code,client_id:a,redirect_uri:n};return r.authorizeRequest({body:Object(h.b)(c),name:i,url:o.get("tokenUrl"),auth:t,headers:u})}},j=function(e){return function(t){var n,r=t.fn,i=t.getConfigs,s=t.authActions,c=t.errActions,p=t.oas3Selectors,f=t.specSelectors,h=t.authSelectors,d=e.body,m=e.query,v=void 0===m?{}:m,g=e.headers,y=void 0===g?{}:g,b=e.name,_=e.url,w=e.auth,x=(h.getConfigs()||{}).additionalQueryStringParams;n=f.isOAS3()?l()(_,p.selectedServer(),!0):l()(_,f.url(),!0),"object"===o()(x)&&(n.query=a()({},n.query,x));var E=n.toString(),S=a()({Accept:"application/json, text/plain, */*","Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},y);r.fetch({url:E,method:"post",headers:S,query:v,body:d,requestInterceptor:i().requestInterceptor,responseInterceptor:i().responseInterceptor}).then(function(e){var t=JSON.parse(e.data),n=t&&(t.error||""),r=t&&(t.parseError||"");e.ok?n||r?c.newAuthErr({authId:b,level:"error",source:"auth",message:u()(t)}):s.authorizeOauth2({auth:w,token:t}):c.newAuthErr({authId:b,level:"error",source:"auth",message:e.statusText})}).catch(function(e){var t=new Error(e).message;if(e.response&&e.response.data){var n=e.response.data;try{var r="string"==typeof n?JSON.parse(n):n;r.error&&(t+=", error: ".concat(r.error)),r.error_description&&(t+=", description: ".concat(r.error_description))}catch(e){}}c.newAuthErr({authId:b,level:"error",source:"auth",message:t})})}};function P(e){return{type:_,payload:e}}},function(e,t){var n=e.exports={version:"2.6.5"};"number"==typeof __e&&(__e=n)},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(127),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(211),o=n(210);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(49),o=n(133);e.exports=n(50)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_LAYOUT",function(){return o}),n.d(t,"UPDATE_FILTER",function(){return i}),n.d(t,"UPDATE_MODE",function(){return a}),n.d(t,"SHOW",function(){return s}),n.d(t,"updateLayout",function(){return u}),n.d(t,"updateFilter",function(){return c}),n.d(t,"show",function(){return l}),n.d(t,"changeMode",function(){return p});var r=n(3),o="layout_update_layout",i="layout_update_filter",a="layout_update_mode",s="layout_show";function u(e){return{type:o,payload:e}}function c(e){return{type:i,payload:e}}function l(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e=Object(r.w)(e),{type:s,payload:{thing:e,shown:t}}}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=Object(r.w)(e),{type:a,payload:{thing:e,mode:t}}}},function(e,t,n){"use strict";(function(t){ +/*! * @description Recursive object extending * @author Viacheslav Lotsmanov <lotsmanov89@gmail.com> * @license MIT * * The MIT License (MIT) * - * Copyright (c) 2013-2015 Viacheslav Lotsmanov + * Copyright (c) 2013-2018 Viacheslav Lotsmanov * * 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 @@ -35,7 +48,8 @@ var Y=n(570),$=n(764),Z=n(387);t.Buffer=o,t.SlowBuffer=m,t.INSPECT_MAX_BYTES=50, * 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. */ -function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function i(e){var t=[];return e.forEach(function(e,a){"object"==typeof e&&null!==e?Array.isArray(e)?t[a]=i(e):n(e)?t[a]=r(e):t[a]=o({},e):t[a]=e}),t}var o=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,t,a=arguments[0],s=Array.prototype.slice.call(arguments,1);return s.forEach(function(s){"object"!=typeof s||Array.isArray(s)||Object.keys(s).forEach(function(u){return t=a[u],e=s[u],e===a?void 0:"object"!=typeof e||null===e?void(a[u]=e):Array.isArray(e)?void(a[u]=i(e)):n(e)?void(a[u]=r(e)):"object"!=typeof t||null===t||Array.isArray(t)?void(a[u]=o({},e)):void(a[u]=o(t,e))})}),a}}).call(t,n(40).Buffer)},function(e,t){e.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅",in:"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺",int:"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}},function(e,t){e.exports={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}},function(e,t,n){"use strict";var r=n(722),i=n(65),o=n(115),a=Array.prototype.indexOf,s=Object.prototype.hasOwnProperty,u=Math.abs,l=Math.floor;e.exports=function(e){var t,n,c,p;if(!r(e))return a.apply(this,arguments);for(n=i(o(this).length),c=arguments[1],c=isNaN(c)?0:c>=0?l(c):i(this.length)-l(u(c)),t=c;t<n;++t)if(s.call(this,t)&&(p=this[t],r(p)))return t;return-1}},function(e,t,n){"use strict";e.exports=n(713)()?Array.from:n(714)},function(e,t,n){"use strict";function r(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!==e&&t!==t}function i(e,t){if(r(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(var a=0;a<n.length;a++)if(!o.call(t,n[a])||!r(e[n[a]],t[n[a]]))return!1;return!0}var o=Object.prototype.hasOwnProperty;e.exports=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(765),o=r(i),a=n(768),s=r(a),u=n(767),l=r(u),c=n(769),p=r(c),f=n(770),h=r(f),d=n(771),m=r(d),v=n(772),g=r(v),y=n(773),_=r(y),b=n(774),x=r(b),w=n(775),k=r(w),E=n(776),S=r(E),C=n(778),A=r(C),D=n(766),O=r(D),M=[l.default,s.default,p.default,m.default,g.default,_.default,x.default,k.default,S.default,h.default],T=(0,o.default)({prefixMap:O.default.prefixMap,plugins:M},A.default);t.default=T,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e.charAt(0).toUpperCase()+e.slice(1)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t,n){"use strict";var r=n(795);e.exports=r},function(e,t,n){"use strict";var r=n(81);e.exports=new r({explicit:[n(813),n(811),n(806)]})},function(e,t,n){var r=n(67),i=n(43),o=r(i,"Map");e.exports=o},function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var i=n(916),o=n(917),a=n(918),s=n(919),u=n(920);r.prototype.clear=i,r.prototype.delete=o,r.prototype.get=a,r.prototype.has=s,r.prototype.set=u,e.exports=r},function(e,t,n){function r(e){var t=this.__data__=new i(e);this.size=t.size}var i=n(146),o=n(930),a=n(931),s=n(932),u=n(933),l=n(934);r.prototype.clear=o,r.prototype.delete=a,r.prototype.get=s,r.prototype.has=u,r.prototype.set=l,e.exports=r},function(e,t){function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}e.exports=n},function(e,t,n){var r=n(849),i=n(887),o=i(r);e.exports=o},function(e,t,n){function r(e){var t=new e.constructor(e.byteLength);return new i(t).set(new i(e)),t}var i=n(392);e.exports=r},function(e,t,n){var r=n(222),i=r(Object.getPrototypeOf,Object);e.exports=i},function(e,t,n){var r=n(222),i=n(426),o=Object.getOwnPropertySymbols,a=o?r(o,Object):i;e.exports=a},function(e,t,n){function r(e,t){if(i(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||(s.test(e)||!a.test(e)||null!=t&&e in Object(t))}var i=n(20),o=n(155),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=r},function(e,t){function n(e,t){return function(n){return e(t(n))}}e.exports=n},function(e,t,n){var r=n(890),i=n(945),o=r(i);e.exports=o},function(e,t,n){function r(e,t,n){var r=null==e?void 0:i(e,t);return void 0===r?n:r}var i=n(150);e.exports=r},function(e,t){function n(e){return e}e.exports=n},function(e,t,n){var r=n(851),i=n(68),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},function(e,t,n){(function(e){var r=n(43),i=n(957),o="object"==typeof t&&t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===o,u=s?r.Buffer:void 0,l=u?u.isBuffer:void 0,c=l||i;e.exports=c}).call(t,n(72)(e))},function(e,t){function n(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}var r=9007199254740991;e.exports=n},function(e,t,n){"use strict";(function(t,n){var r,i;r=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},i=function(e){var t,n,i=document.createTextNode(""),o=0;return new e(function(){var e;if(t)n&&(t=n.concat(t));else{if(!n)return;t=n}if(n=t,t=null,"function"==typeof n)return e=n,n=null,void e();for(i.data=o=++o%2;n;)e=n.shift(),n.length||(n=null),e()}).observe(i,{characterData:!0}),function(e){if(r(e),t)return void("function"==typeof t?t=[t,e]:t.push(e));t=e,i.data=o=++o%2}},e.exports=function(){if("object"==typeof t&&t&&"function"==typeof t.nextTick)return t.nextTick;if("object"==typeof document&&document){if("function"==typeof MutationObserver)return i(MutationObserver);if("function"==typeof WebKitMutationObserver)return i(WebKitMutationObserver)}return"function"==typeof n?function(e){n(r(e))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(e){setTimeout(r(e),0)}:null}()}).call(t,n(33),n(496).setImmediate)},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(e){return i.exec(e).slice(1)};t.resolve=function(){for(var t="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,i="/"===a.charAt(0))}return t=n(r(t.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+t||"."},t.normalize=function(e){var i=t.isAbsolute(e),o="/"===a(e,-1);return e=n(r(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&o&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,u=0;u<a;u++)if(i[u]!==o[u]){s=u;break}for(var l=[],u=s;u<i.length;u++)l.push("..");return l=l.concat(o.slice(s)),l.join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=o(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},t.basename=function(e,t){var n=o(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){return o(e)[3]};var a="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(t,n(33))},function(e,t,n){(function(t){(function(){var n,r,i;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:void 0!==t&&null!==t&&t.hrtime?(e.exports=function(){return(n()-i)/1e6},r=t.hrtime,n=function(){var e;return e=r(),1e9*e[0]+e[1]},i=n()):Date.now?(e.exports=function(){return Date.now()-i},i=Date.now()):(e.exports=function(){return(new Date).getTime()-i},i=(new Date).getTime())}).call(this)}).call(t,n(33))},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var a=n(235),s=function(e){return e&&e.__esModule?e:{default:e}}(a),u=function(e){function t(n){r(this,t);var o=i(this,e.call(this,n));return o.type="comment",o}return o(t,e),t}(s.default);t.default=u,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){return e.map(function(e){return e.nodes&&(e.nodes=s(e.nodes)),delete e.source,e})}t.__esModule=!0;var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(234),c=r(l),p=n(232),f=r(p),h=n(235),d=r(h),m=function(e){function t(){return i(this,t),o(this,e.apply(this,arguments))}return a(t,e),t.prototype.push=function(e){return e.parent=this,this.nodes.push(e),this},t.prototype.each=function(e){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var t=this.lastEach;if(this.indexes[t]=0,this.nodes){for(var n=void 0,r=void 0;this.indexes[t]<this.nodes.length&&(n=this.indexes[t],!1!==(r=e(this.nodes[n],n)));)this.indexes[t]+=1;return delete this.indexes[t],r}},t.prototype.walk=function(e){return this.each(function(t,n){var r=e(t,n);return!1!==r&&t.walk&&(r=t.walk(e)),r})},t.prototype.walkDecls=function(e,t){return t?e instanceof RegExp?this.walk(function(n,r){if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk(function(n,r){if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("decl"===e.type)return t(e,n)}))},t.prototype.walkRules=function(e,t){return t?e instanceof RegExp?this.walk(function(n,r){if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk(function(n,r){if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("rule"===e.type)return t(e,n)}))},t.prototype.walkAtRules=function(e,t){return t?e instanceof RegExp?this.walk(function(n,r){if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk(function(n,r){if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("atrule"===e.type)return t(e,n)}))},t.prototype.walkComments=function(e){return this.walk(function(t,n){if("comment"===t.type)return e(t,n)})},t.prototype.append=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=t,i=Array.isArray(r),o=0,r=i?r:r[Symbol.iterator]();;){var a;if(i){if(o>=r.length)break;a=r[o++]}else{if(o=r.next(),o.done)break;a=o.value}for(var s=a,u=this.normalize(s,this.last),l=u,c=Array.isArray(l),p=0,l=c?l:l[Symbol.iterator]();;){var f;if(c){if(p>=l.length)break;f=l[p++]}else{if(p=l.next(),p.done)break;f=p.value}var h=f;this.nodes.push(h)}}return this},t.prototype.prepend=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];t=t.reverse();for(var r=t,i=Array.isArray(r),o=0,r=i?r:r[Symbol.iterator]();;){var a;if(i){if(o>=r.length)break;a=r[o++]}else{if(o=r.next(),o.done)break;a=o.value}for(var s=a,u=this.normalize(s,this.first,"prepend").reverse(),l=u,c=Array.isArray(l),p=0,l=c?l:l[Symbol.iterator]();;){var f;if(c){if(p>=l.length)break;f=l[p++]}else{if(p=l.next(),p.done)break;f=p.value}var h=f;this.nodes.unshift(h)}for(var d in this.indexes)this.indexes[d]=this.indexes[d]+u.length}return this},t.prototype.cleanRaws=function(t){if(e.prototype.cleanRaws.call(this,t),this.nodes)for(var n=this.nodes,r=Array.isArray(n),i=0,n=r?n:n[Symbol.iterator]();;){var o;if(r){if(i>=n.length)break;o=n[i++]}else{if(i=n.next(),i.done)break;o=i.value}var a=o;a.cleanRaws(t)}},t.prototype.insertBefore=function(e,t){e=this.index(e);for(var n=0===e&&"prepend",r=this.normalize(t,this.nodes[e],n).reverse(),i=r,o=Array.isArray(i),a=0,i=o?i:i[Symbol.iterator]();;){var s;if(o){if(a>=i.length)break;s=i[a++]}else{if(a=i.next(),a.done)break;s=a.value}var u=s;this.nodes.splice(e,0,u)}var l=void 0;for(var c in this.indexes)l=this.indexes[c],e<=l&&(this.indexes[c]=l+r.length);return this},t.prototype.insertAfter=function(e,t){e=this.index(e);for(var n=this.normalize(t,this.nodes[e]).reverse(),r=n,i=Array.isArray(r),o=0,r=i?r:r[Symbol.iterator]();;){var a;if(i){if(o>=r.length)break;a=r[o++]}else{if(o=r.next(),o.done)break;a=o.value}var s=a;this.nodes.splice(e+1,0,s)}var u=void 0;for(var l in this.indexes)u=this.indexes[l],e<u&&(this.indexes[l]=u+n.length);return this},t.prototype.removeChild=function(e){e=this.index(e),this.nodes[e].parent=void 0,this.nodes.splice(e,1);var t=void 0;for(var n in this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this},t.prototype.removeAll=function(){for(var e=this.nodes,t=Array.isArray(e),n=0,e=t?e:e[Symbol.iterator]();;){var r;if(t){if(n>=e.length)break;r=e[n++]}else{if(n=e.next(),n.done)break;r=n.value}r.parent=void 0}return this.nodes=[],this},t.prototype.replaceValues=function(e,t,n){return n||(n=t,t={}),this.walkDecls(function(r){t.props&&-1===t.props.indexOf(r.prop)||t.fast&&-1===r.value.indexOf(t.fast)||(r.value=r.value.replace(e,n))}),this},t.prototype.every=function(e){return this.nodes.every(e)},t.prototype.some=function(e){return this.nodes.some(e)},t.prototype.index=function(e){return"number"==typeof e?e:this.nodes.indexOf(e)},t.prototype.normalize=function(e,t){var r=this;if("string"==typeof e){e=s(n(236)(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var i=e,o=Array.isArray(i),a=0,i=o?i:i[Symbol.iterator]();;){var u;if(o){if(a>=i.length)break;u=i[a++]}else{if(a=i.next(),a.done)break;u=a.value}var l=u;l.parent&&l.parent.removeChild(l,"ignore")}}else if("root"===e.type){e=e.nodes.slice(0);for(var p=e,h=Array.isArray(p),d=0,p=h?p:p[Symbol.iterator]();;){var m;if(h){if(d>=p.length)break;m=p[d++]}else{if(d=p.next(),d.done)break;m=d.value}var v=m;v.parent&&v.parent.removeChild(v,"ignore")}}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new c.default(e)]}else if(e.selector){var g=n(157);e=[new g(e)]}else if(e.name){var y=n(156);e=[new y(e)]}else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new f.default(e)]}return e.map(function(e){return"function"!=typeof e.before&&(e=r.rebuild(e)),e.parent&&e.parent.removeChild(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/[^\s]/g,"")),e.parent=r,e})},t.prototype.rebuild=function(e,t){var r=this,i=void 0;if("root"===e.type){var o=n(237);i=new o}else if("atrule"===e.type){var a=n(156);i=new a}else if("rule"===e.type){var s=n(157);i=new s}else"decl"===e.type?i=new c.default:"comment"===e.type&&(i=new f.default);for(var u in e)"nodes"===u?i.nodes=e.nodes.map(function(e){return r.rebuild(e,i)}):"parent"===u&&t?i.parent=t:e.hasOwnProperty(u)&&(i[u]=e[u]);return i},u(t,[{key:"first",get:function(){if(this.nodes)return this.nodes[0]}},{key:"last",get:function(){if(this.nodes)return this.nodes[this.nodes.length-1]}}]),t}(d.default);t.default=m,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var a=n(235),s=function(e){return e&&e.__esModule?e:{default:e}}(a),u=function(e){function t(n){r(this,t);var o=i(this,e.call(this,n));return o.type="decl",o}return o(t,e),t}(s.default);t.default=u,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=n(432),s=r(a),u=n(437),l=r(u),c=n(238),p=r(c),f=n(987),h=r(f),d=function e(t,n){var r=new t.constructor;for(var i in t)if(t.hasOwnProperty(i)){var a=t[i],s=void 0===a?"undefined":o(a);"parent"===i&&"object"===s?n&&(r[i]=n):"source"===i?r[i]=a:a instanceof Array?r[i]=a.map(function(t){return e(t,r)}):("object"===s&&null!==a&&(a=e(a)),r[i]=a)}return r},m=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(i(this,e),this.raws={},"object"!==(void 0===t?"undefined":o(t))&&void 0!==t)throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(t));for(var n in t)this[n]=t[n]}return e.prototype.error=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.source){var n=this.positionBy(t);return this.source.input.error(e,n.line,n.column,t)}return new s.default(e)},e.prototype.warn=function(e,t,n){var r={node:this};for(var i in n)r[i]=n[i];return e.warn(t,r)},e.prototype.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},e.prototype.toString=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p.default;e.stringify&&(e=e.stringify);var t="";return e(this,function(e){t+=e}),t},e.prototype.clone=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=d(this);for(var n in e)t[n]=e[n];return t},e.prototype.cloneBefore=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.clone(e);return this.parent.insertBefore(this,t),t},e.prototype.cloneAfter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.clone(e);return this.parent.insertAfter(this,t),t},e.prototype.replaceWith=function(){if(this.parent){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=t,i=Array.isArray(r),o=0,r=i?r:r[Symbol.iterator]();;){var a;if(i){if(o>=r.length)break;a=r[o++]}else{if(o=r.next(),o.done)break;a=o.value}var s=a;this.parent.insertBefore(this,s)}this.remove()}return this},e.prototype.moveTo=function(e){return(0,h.default)("Node#moveTo was deprecated. Use Container#append."),this.cleanRaws(this.root()===e.root()),this.remove(),e.append(this),this},e.prototype.moveBefore=function(e){return(0,h.default)("Node#moveBefore was deprecated. Use Node#before."),this.cleanRaws(this.root()===e.root()),this.remove(),e.parent.insertBefore(e,this),this},e.prototype.moveAfter=function(e){return(0,h.default)("Node#moveAfter was deprecated. Use Node#after."),this.cleanRaws(this.root()===e.root()),this.remove(),e.parent.insertAfter(e,this),this},e.prototype.next=function(){var e=this.parent.index(this);return this.parent.nodes[e+1]},e.prototype.prev=function(){var e=this.parent.index(this);return this.parent.nodes[e-1]},e.prototype.before=function(e){return this.parent.insertBefore(this,e),this},e.prototype.after=function(e){return this.parent.insertAfter(this,e),this},e.prototype.toJSON=function(){var e={};for(var t in this)if(this.hasOwnProperty(t)&&"parent"!==t){var n=this[t];n instanceof Array?e[t]=n.map(function(e){return"object"===(void 0===e?"undefined":o(e))&&e.toJSON?e.toJSON():e}):"object"===(void 0===n?"undefined":o(n))&&n.toJSON?e[t]=n.toJSON():e[t]=n}return e},e.prototype.raw=function(e,t){return(new l.default).raw(this,e,t)},e.prototype.root=function(){for(var e=this;e.parent;)e=e.parent;return e},e.prototype.cleanRaws=function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between},e.prototype.positionInside=function(e){for(var t=this.toString(),n=this.source.start.column,r=this.source.start.line,i=0;i<e;i++)"\n"===t[i]?(n=1,r+=1):n+=1;return{line:r,column:n}},e.prototype.positionBy=function(e){var t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){var n=this.toString().indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t},e}();t.default=m,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(t&&t.safe)throw new Error('Option safe was removed. Use parser: require("postcss-safe-parser")');var n=new u.default(e,t),r=new a.default(n);try{r.parse()}catch(e){throw"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return r.root}t.__esModule=!0,t.default=i;var o=n(981),a=r(o),s=n(433),u=r(s);e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var a=n(233),s=function(e){return e&&e.__esModule?e:{default:e}}(a),u=function(e){function t(n){r(this,t);var o=i(this,e.call(this,n));return o.type="root",o.nodes||(o.nodes=[]),o}return o(t,e),t.prototype.removeChild=function(t,n){var r=this.index(t);return!n&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),e.prototype.removeChild.call(this,t)},t.prototype.normalize=function(t,n,r){var i=e.prototype.normalize.call(this,t);if(n)if("prepend"===r)this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(var o=i,a=Array.isArray(o),s=0,o=a?o:o[Symbol.iterator]();;){var u;if(a){if(s>=o.length)break;u=o[s++]}else{if(s=o.next(),s.done)break;u=s.value}var l=u;l.raws.before=n.raws.before}return i},t.prototype.toResult=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new(n(434))(new(n(436)),this,e).stringify()},t}(s.default);t.default=u,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){new o.default(t).stringify(e)}t.__esModule=!0,t.default=r;var i=n(437),o=function(e){return e&&e.__esModule?e:{default:e}}(i);e.exports=t.default},function(e,t,n){(function(t){for(var r=n(1006),i="undefined"==typeof window?t:window,o=["moz","webkit"],a="AnimationFrame",s=i["request"+a],u=i["cancel"+a]||i["cancelRequest"+a],l=0;!s&&l<o.length;l++)s=i[o[l]+"Request"+a],u=i[o[l]+"Cancel"+a]||i[o[l]+"CancelRequest"+a];if(!s||!u){var c=0,p=0,f=[];s=function(e){if(0===f.length){var t=r(),n=Math.max(0,1e3/60-(t-c));c=n+t,setTimeout(function(){var e=f.slice(0);f.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(c)}catch(e){setTimeout(function(){throw e},0)}},Math.round(n))}return f.push({handle:++p,callback:e,cancelled:!1}),p},u=function(e){for(var t=0;t<f.length;t++)f[t].handle===e&&(f[t].cancelled=!0)}}e.exports=function(e){return s.call(i,e)},e.exports.cancel=function(){u.apply(i,arguments)},e.exports.polyfill=function(e){e||(e=i),e.requestAnimationFrame=s,e.cancelAnimationFrame=u}}).call(t,n(17))},function(e,t,n){"use strict";function r(e,t){return Array.isArray(t)&&(t=t[1]),t?t.nextSibling:e.firstChild}function i(e,t,n){c.insertTreeBefore(e,t,n)}function o(e,t,n){Array.isArray(t)?s(e,t[0],t[1],n):m(e,t,n)}function a(e,t){if(Array.isArray(t)){var n=t[1];t=t[0],u(e,t,n),e.removeChild(n)}e.removeChild(t)}function s(e,t,n,r){for(var i=t;;){var o=i.nextSibling;if(m(e,i,r),i===n)break;i=o}}function u(e,t,n){for(;;){var r=t.nextSibling;if(r===n)break;e.removeChild(r)}}function l(e,t,n){var r=e.parentNode,i=e.nextSibling;i===t?n&&m(r,document.createTextNode(n),i):n?(d(i,n),u(r,i,t)):u(r,e,t)}var c=n(88),p=n(1014),f=(n(14),n(39),n(249)),h=n(163),d=n(469),m=f(function(e,t,n){e.insertBefore(t,n)}),v=p.dangerouslyReplaceNodeWithMarkup,g={dangerouslyReplaceNodeWithMarkup:v,replaceDelimitedText:l,processUpdates:function(e,t){for(var n=0;n<t.length;n++){var s=t[n];switch(s.type){case"INSERT_MARKUP":i(e,s.content,r(e,s.afterNode));break;case"MOVE_EXISTING":o(e,s.fromNode,r(e,s.afterNode));break;case"SET_MARKUP":h(e,s.content);break;case"TEXT_CONTENT":d(e,s.content);break;case"REMOVE_NODE":a(e,s.fromNode)}}}};e.exports=g},function(e,t,n){"use strict";var r={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};e.exports=r},function(e,t,n){"use strict";function r(){if(s)for(var e in u){var t=u[e],n=s.indexOf(e);if(n>-1||a("96",e),!l.plugins[n]){t.extractEvents||a("97",e),l.plugins[n]=t;var r=t.eventTypes;for(var o in r)i(r[o],t,o)||a("98",o,e)}}}function i(e,t,n){l.eventNameDispatchConfigs.hasOwnProperty(n)&&a("99",n),l.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var i in r)if(r.hasOwnProperty(i)){var s=r[i];o(s,t,n)}return!0}return!!e.registrationName&&(o(e.registrationName,t,n),!0)}function o(e,t,n){l.registrationNameModules[e]&&a("100",e),l.registrationNameModules[e]=t,l.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var a=n(11),s=(n(8),null),u={},l={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(e){s&&a("101"),s=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];u.hasOwnProperty(n)&&u[n]===i||(u[n]&&a("102",n),u[n]=i,t=!0)}t&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return l.registrationNameModules[t.registrationName]||null;if(void 0!==t.phasedRegistrationNames){var n=t.phasedRegistrationNames;for(var r in n)if(n.hasOwnProperty(r)){var i=l.registrationNameModules[n[r]];if(i)return i}}return null},_resetEventPlugins:function(){s=null;for(var e in u)u.hasOwnProperty(e)&&delete u[e];l.plugins.length=0;var t=l.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=l.registrationNameModules;for(var i in r)r.hasOwnProperty(i)&&delete r[i]}};e.exports=l},function(e,t,n){"use strict";function r(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e}function i(e){return"topMouseMove"===e||"topTouchMove"===e}function o(e){return"topMouseDown"===e||"topTouchStart"===e}function a(e,t,n,r){var i=e.type||"unknown-event";e.currentTarget=g.getNodeFromInstance(r),t?m.invokeGuardedCallbackWithCatch(i,n,e):m.invokeGuardedCallback(i,n,e),e.currentTarget=null}function s(e,t){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var i=0;i<n.length&&!e.isPropagationStopped();i++)a(e,t,n[i],r[i]);else n&&a(e,t,n,r);e._dispatchListeners=null,e._dispatchInstances=null}function u(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t)){for(var r=0;r<t.length&&!e.isPropagationStopped();r++)if(t[r](e,n[r]))return n[r]}else if(t&&t(e,n))return n;return null}function l(e){var t=u(e);return e._dispatchInstances=null,e._dispatchListeners=null,t}function c(e){var t=e._dispatchListeners,n=e._dispatchInstances;Array.isArray(t)&&d("103"),e.currentTarget=t?g.getNodeFromInstance(n):null;var r=t?t(e):null;return e.currentTarget=null,e._dispatchListeners=null,e._dispatchInstances=null,r}function p(e){return!!e._dispatchListeners}var f,h,d=n(11),m=n(247),v=(n(8),n(10),{injectComponentTree:function(e){f=e},injectTreeTraversal:function(e){h=e}}),g={isEndish:r,isMoveish:i,isStartish:o,executeDirectDispatch:c,executeDispatchesInOrder:s,executeDispatchesInOrderStopAtTrue:l,hasDispatches:p,getInstanceFromNode:function(e){return f.getInstanceFromNode(e)},getNodeFromInstance:function(e){return f.getNodeFromInstance(e)},isAncestor:function(e,t){return h.isAncestor(e,t)},getLowestCommonAncestor:function(e,t){return h.getLowestCommonAncestor(e,t)},getParentInstance:function(e){return h.getParentInstance(e)},traverseTwoPhase:function(e,t,n){return h.traverseTwoPhase(e,t,n)},traverseEnterLeave:function(e,t,n,r,i){return h.traverseEnterLeave(e,t,n,r,i)},injection:v};e.exports=g},function(e,t,n){"use strict";function r(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}function i(e){var t=/(=0|=2)/g,n={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(t,function(e){return n[e]})}var o={escape:r,unescape:i};e.exports=o},function(e,t,n){"use strict";function r(e){null!=e.checkedLink&&null!=e.valueLink&&s("87")}function i(e){r(e),(null!=e.value||null!=e.onChange)&&s("88")}function o(e){r(e),(null!=e.checked||null!=e.onChange)&&s("89")}function a(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}var s=n(11),u=n(1043),l=n(443),c=n(92),p=l(c.isValidElement),f=(n(8),n(10),{button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0}),h={value:function(e,t,n){return!e[t]||f[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,n){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:p.func},d={},m={checkPropTypes:function(e,t,n){for(var r in h){if(h.hasOwnProperty(r))var i=h[r](t,r,e,"prop",null,u);if(i instanceof Error&&!(i.message in d)){d[i.message]=!0;a(n)}}},getValue:function(e){return e.valueLink?(i(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(o(e),e.checkedLink.value):e.checked},executeOnChange:function(e,t){return e.valueLink?(i(e),e.valueLink.requestChange(t.target.value)):e.checkedLink?(o(e),e.checkedLink.requestChange(t.target.checked)):e.onChange?e.onChange.call(void 0,t):void 0}};e.exports=m},function(e,t,n){"use strict";var r=n(11),i=(n(8),!1),o={replaceNodeWithMarkup:null,processChildrenUpdates:null,injection:{injectEnvironment:function(e){i&&r("104"),o.replaceNodeWithMarkup=e.replaceNodeWithMarkup,o.processChildrenUpdates=e.processChildrenUpdates,i=!0}}};e.exports=o},function(e,t,n){"use strict";function r(e,t,n){try{t(n)}catch(e){null===i&&(i=e)}}var i=null,o={invokeGuardedCallback:r,invokeGuardedCallbackWithCatch:r,rethrowCaughtError:function(){if(i){var e=i;throw i=null,e}}};e.exports=o},function(e,t,n){"use strict";function r(e){u.enqueueUpdate(e)}function i(e){var t=typeof e;if("object"!==t)return t;var n=e.constructor&&e.constructor.name||t,r=Object.keys(e);return r.length>0&&r.length<20?n+" (keys: "+r.join(", ")+")":n}function o(e,t){var n=s.get(e);if(!n){return null}return n}var a=n(11),s=(n(52),n(124)),u=(n(39),n(44)),l=(n(8),n(10),{isMounted:function(e){var t=s.get(e);return!!t&&!!t._renderedComponent},enqueueCallback:function(e,t,n){l.validateCallback(t,n);var i=o(e);if(!i)return null;i._pendingCallbacks?i._pendingCallbacks.push(t):i._pendingCallbacks=[t],r(i)},enqueueCallbackInternal:function(e,t){e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],r(e)},enqueueForceUpdate:function(e){var t=o(e,"forceUpdate");t&&(t._pendingForceUpdate=!0,r(t))},enqueueReplaceState:function(e,t,n){var i=o(e,"replaceState");i&&(i._pendingStateQueue=[t],i._pendingReplaceState=!0,void 0!==n&&null!==n&&(l.validateCallback(n,"replaceState"),i._pendingCallbacks?i._pendingCallbacks.push(n):i._pendingCallbacks=[n]),r(i))},enqueueSetState:function(e,t){var n=o(e,"setState");if(n){(n._pendingStateQueue||(n._pendingStateQueue=[])).push(t),r(n)}},enqueueElementInternal:function(e,t,n){e._pendingElement=t,e._context=n,r(e)},validateCallback:function(e,t){e&&"function"!=typeof e&&a("122",t,i(e))}});e.exports=l},function(e,t,n){"use strict";var r=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e};e.exports=r},function(e,t,n){"use strict";function r(e){var t,n=e.keyCode;return"charCode"in e?0===(t=e.charCode)&&13===n&&(t=13):t=n,t>=32||13===t?t:0}e.exports=r},function(e,t,n){"use strict";function r(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=o[e];return!!r&&!!n[r]}function i(e){return r}var o={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};e.exports=i},function(e,t,n){"use strict";function r(e){var t=e.target||e.srcElement||window;return t.correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}e.exports=r},function(e,t,n){"use strict";/** +function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=t.alloc?t.alloc(e.length):new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function o(e){var t=[];return e.forEach(function(e,i){"object"==typeof e&&null!==e?Array.isArray(e)?t[i]=o(e):n(e)?t[i]=r(e):t[i]=a({},e):t[i]=e}),t}function i(e,t){return"__proto__"===t?void 0:e[t]}var a=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,t,s=arguments[0],u=Array.prototype.slice.call(arguments,1);return u.forEach(function(u){"object"!=typeof u||null===u||Array.isArray(u)||Object.keys(u).forEach(function(c){return t=i(s,c),(e=i(u,c))===s?void 0:"object"!=typeof e||null===e?void(s[c]=e):Array.isArray(e)?void(s[c]=o(e)):n(e)?void(s[c]=r(e)):"object"!=typeof t||null===t||Array.isArray(t)?void(s[c]=a({},e)):void(s[c]=a(t,e))})}),s}}).call(this,n(64).Buffer)},function(e,t,n){var r=n(151),o=n(336);e.exports=n(126)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(106),o=n(603),i=n(604),a="[object Null]",s="[object Undefined]",u=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?s:a:u&&u in Object(e)?o(e):i(e)}},function(e,t,n){var r=n(621),o=n(624);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(380),o=n(661),i=n(107);e.exports=function(e){return i(e)?r(e):o(e)}},function(e,t,n){"use strict";var r=n(178),o=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=p;var i=n(137);i.inherits=n(47);var a=n(390),s=n(240);i.inherits(p,a);for(var u=o(s.prototype),c=0;c<u.length;c++){var l=u[c];p.prototype[l]||(p.prototype[l]=s.prototype[l])}function p(e){if(!(this instanceof p))return new p(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",f)}function f(){this.allowHalfOpen||this._writableState.ended||r.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(p.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),p.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},function(e,t,n){"use strict";var r=n(397)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"use strict";var r=n(696),o=Math.max;e.exports=function(e){return o(0,r(e))}},function(e,t,n){},function(e,t,n){"use strict";var r=n(21),o=(n(15),function(e){if(this.instancePool.length){var t=this.instancePool.pop();return this.call(t,e),t}return new this(e)}),i=function(e){e instanceof this||r("25"),e.destructor(),this.instancePool.length<this.poolSize&&this.instancePool.push(e)},a=o,s={addPoolingTo:function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||a,n.poolSize||(n.poolSize=10),n.release=i,n},oneArgumentPooler:o,twoArgumentPooler:function(e,t){if(this.instancePool.length){var n=this.instancePool.pop();return this.call(n,e,t),n}return new this(e,t)},threeArgumentPooler:function(e,t,n){if(this.instancePool.length){var r=this.instancePool.pop();return this.call(r,e,t,n),r}return new this(e,t,n)},fourArgumentPooler:function(e,t,n,r){if(this.instancePool.length){var o=this.instancePool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)}};e.exports=s},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){e.exports=n(599)},function(e,t,n){var r=n(177);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},function(e,t,n){e.exports=n(763)},function(e,t,n){"use strict";(function(t){var r=n(803),o=n(804),i=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,a=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,s=new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");function u(e){return(e||"").toString().replace(s,"")}var c=[["#","hash"],["?","query"],function(e){return e.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],l={hash:1,query:1};function p(e){var n,r=("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{}).location||{},o={},a=typeof(e=e||r);if("blob:"===e.protocol)o=new h(unescape(e.pathname),{});else if("string"===a)for(n in o=new h(e,{}),l)delete o[n];else if("object"===a){for(n in e)n in l||(o[n]=e[n]);void 0===o.slashes&&(o.slashes=i.test(e.href))}return o}function f(e){e=u(e);var t=a.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function h(e,t,n){if(e=u(e),!(this instanceof h))return new h(e,t,n);var i,a,s,l,d,m,v=c.slice(),g=typeof t,y=this,b=0;for("object"!==g&&"string"!==g&&(n=t,t=null),n&&"function"!=typeof n&&(n=o.parse),t=p(t),i=!(a=f(e||"")).protocol&&!a.slashes,y.slashes=a.slashes||i&&t.slashes,y.protocol=a.protocol||t.protocol||"",e=a.rest,a.slashes||(v[3]=[/(.*)/,"pathname"]);b<v.length;b++)"function"!=typeof(l=v[b])?(s=l[0],m=l[1],s!=s?y[m]=e:"string"==typeof s?~(d=e.indexOf(s))&&("number"==typeof l[2]?(y[m]=e.slice(0,d),e=e.slice(d+l[2])):(y[m]=e.slice(d),e=e.slice(0,d))):(d=s.exec(e))&&(y[m]=d[1],e=e.slice(0,d.index)),y[m]=y[m]||i&&l[3]&&t[m]||"",l[4]&&(y[m]=y[m].toLowerCase())):e=l(e);n&&(y.query=n(y.query)),i&&t.slashes&&"/"!==y.pathname.charAt(0)&&(""!==y.pathname||""!==t.pathname)&&(y.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,o=n[r-1],i=!1,a=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),a++):a&&(0===r&&(i=!0),n.splice(r,1),a--);return i&&n.unshift(""),"."!==o&&".."!==o||n.push(""),n.join("/")}(y.pathname,t.pathname)),r(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(l=y.auth.split(":"),y.username=l[0]||"",y.password=l[1]||""),y.origin=y.protocol&&y.host&&"file:"!==y.protocol?y.protocol+"//"+y.host:"null",y.href=y.toString()}h.prototype={set:function(e,t,n){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||o.parse)(t)),i[e]=t;break;case"port":i[e]=t,r(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,/:\d+$/.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!n;break;case"pathname":case"hash":if(t){var a="pathname"===e?"/":"#";i[e]=t.charAt(0)!==a?a+t:t}else i[e]=t;break;default:i[e]=t}for(var s=0;s<c.length;s++){var u=c[s];u[4]&&(i[u[1]]=i[u[1]].toLowerCase())}return i.origin=i.protocol&&i.host&&"file:"!==i.protocol?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=o.stringify);var t,n=this,r=n.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var i=r+(n.slashes?"//":"");return n.username&&(i+=n.username,n.password&&(i+=":"+n.password),i+="@"),i+=n.host+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}},h.extractProtocol=f,h.location=p,h.trimLeft=u,h.qs=o,e.exports=h}).call(this,n(36))},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return a});var r=n(478),o=n.n(r),i=[n(275),n(276)];function a(e,t){var n={jsSpec:t.specSelectors.specJson().toJS()};return o()(i,function(e,t){try{return t.transform(e,n).filter(function(e){return!!e})}catch(t){return console.error("Transformer error:",t),e}},e).filter(function(e){return!!e}).map(function(e){return!e.get("line")&&e.get("path"),e})}},function(e,t,n){var r=n(41),o=n(81),i=n(152),a=n(199)("src"),s=n(494),u=(""+s).split("toString");n(72).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var c="function"==typeof n;c&&(i(n,"name")||o(n,"name",t)),e[t]!==n&&(c&&(i(n,a)||o(n,a,e[t]?""+e[t]:u.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(210);e.exports=function(e){return Object(r(e))}},function(e,t,n){"use strict";var r=n(559)(!0);n(219)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t){e.exports={}},function(e,t,n){n(561);for(var r=n(32),o=n(77),i=n(102),a=n(34)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u<s.length;u++){var c=s[u],l=r[c],p=l&&l.prototype;p&&!p[a]&&o(p,a,c),i[c]=i.Array}},function(e,t,n){"use strict";var r=n(25),o=n(357),i=n(578),a=n(583),s=n(105),u=n(584),c=n(588),l=n(589),p=n(591),f=s.createElement,h=s.createFactory,d=s.cloneElement,m=r,v={Children:{map:i.map,forEach:i.forEach,count:i.count,toArray:i.toArray,only:p},Component:o.Component,PureComponent:o.PureComponent,createElement:f,cloneElement:d,isValidElement:s.isValidElement,PropTypes:u,createClass:l,createFactory:h,createMixin:function(e){return e},DOM:a,version:c,__spread:m};e.exports=v},function(e,t,n){"use strict";var r=n(25),o=n(65),i=(n(23),n(359),Object.prototype.hasOwnProperty),a=n(360),s={key:!0,ref:!0,__self:!0,__source:!0};function u(e){return void 0!==e.ref}function c(e){return void 0!==e.key}var l=function(e,t,n,r,o,i,s){return{$$typeof:a,type:e,key:t,ref:n,props:s,_owner:i}};l.createElement=function(e,t,n){var r,a={},p=null,f=null;if(null!=t)for(r in u(t)&&(f=t.ref),c(t)&&(p=""+t.key),void 0===t.__self?null:t.__self,void 0===t.__source?null:t.__source,t)i.call(t,r)&&!s.hasOwnProperty(r)&&(a[r]=t[r]);var h=arguments.length-2;if(1===h)a.children=n;else if(h>1){for(var d=Array(h),m=0;m<h;m++)d[m]=arguments[m+2];0,a.children=d}if(e&&e.defaultProps){var v=e.defaultProps;for(r in v)void 0===a[r]&&(a[r]=v[r])}return l(e,p,f,0,0,o.current,a)},l.createFactory=function(e){var t=l.createElement.bind(null,e);return t.type=e,t},l.cloneAndReplaceKey=function(e,t){return l(e.type,t,e.ref,e._self,e._source,e._owner,e.props)},l.cloneElement=function(e,t,n){var a,p,f=r({},e.props),h=e.key,d=e.ref,m=(e._self,e._source,e._owner);if(null!=t)for(a in u(t)&&(d=t.ref,m=o.current),c(t)&&(h=""+t.key),e.type&&e.type.defaultProps&&(p=e.type.defaultProps),t)i.call(t,a)&&!s.hasOwnProperty(a)&&(void 0===t[a]&&void 0!==p?f[a]=p[a]:f[a]=t[a]);var v=arguments.length-2;if(1===v)f.children=n;else if(v>1){for(var g=Array(v),y=0;y<v;y++)g[y]=arguments[y+2];f.children=g}return l(e.type,h,d,0,0,m,f)},l.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},e.exports=l},function(e,t,n){var r=n(51).Symbol;e.exports=r},function(e,t,n){var r=n(371),o=n(233);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t,n){var r=n(37),o=n(236),i=n(669),a=n(69);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:i(a(e))}},function(e,t,n){var r=n(167),o=1/0;e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}},function(e,t,n){"use strict";var r=n(87);e.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){var r=n(48).Buffer;function o(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}o.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=r.from(e,t));for(var n=this._block,o=this._blockSize,i=e.length,a=this._len,s=0;s<i;){for(var u=a%o,c=Math.min(i-s,o-u),l=0;l<c;l++)n[u+l]=e[s+l];s+=c,(a+=c)%o==0&&this._update(n)}return this._len+=i,this},o.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,o=(n-r)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},o.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=o},function(e,t,n){var r=n(63),o=n(406),i=n(407),a=n(46),s=n(158),u=n(225),c={},l={};(t=e.exports=function(e,t,n,p,f){var h,d,m,v,g=f?function(){return e}:u(e),y=r(n,p,t?2:1),b=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(i(g)){for(h=s(e.length);h>b;b++)if((v=t?y(a(d=e[b])[0],d[1]):y(e[b]))===c||v===l)return v}else for(m=g.call(e);!(d=m.next()).done;)if((v=o(m,y,d.value,t))===c||v===l)return v}).BREAK=c,t.RETURN=l},function(e,t,n){"use strict";function r(e){return null==e}e.exports.isNothing=r,e.exports.isObject=function(e){return"object"==typeof e&&null!==e},e.exports.toArray=function(e){return Array.isArray(e)?e:r(e)?[]:[e]},e.exports.repeat=function(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r},e.exports.isNegativeZero=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},e.exports.extend=function(e,t){var n,r,o,i;if(t)for(n=0,r=(i=Object.keys(t)).length;n<r;n+=1)e[o=i[n]]=t[o];return e}},function(e,t,n){"use strict";var r=n(113),o=n(138),i=n(31);function a(e,t,n){var r=[];return e.include.forEach(function(e){n=a(e,t,n)}),e[t].forEach(function(e){n.forEach(function(t,n){t.tag===e.tag&&t.kind===e.kind&&r.push(n)}),n.push(e)}),n.filter(function(e,t){return-1===r.indexOf(t)})}function s(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new o("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=a(this,"implicit",[]),this.compiledExplicit=a(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function r(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}(this.compiledImplicit,this.compiledExplicit)}s.DEFAULT=null,s.create=function(){var e,t;switch(arguments.length){case 1:e=s.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new o("Wrong number of arguments for Schema.create function")}if(e=r.toArray(e),t=r.toArray(t),!e.every(function(e){return e instanceof s}))throw new o("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every(function(e){return e instanceof i}))throw new o("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new s({include:e,explicit:t})},e.exports=s},function(e,t,n){"use strict";var r=n(21);n(15);function o(e,t){return(e&t)===t}var i={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32,injectDOMPropertyConfig:function(e){var t=i,n=e.Properties||{},a=e.DOMAttributeNamespaces||{},u=e.DOMAttributeNames||{},c=e.DOMPropertyNames||{},l=e.DOMMutationMethods||{};for(var p in e.isCustomAttribute&&s._isCustomAttributeFunctions.push(e.isCustomAttribute),n){s.properties.hasOwnProperty(p)&&r("48",p);var f=p.toLowerCase(),h=n[p],d={attributeName:f,attributeNamespace:null,propertyName:p,mutationMethod:null,mustUseProperty:o(h,t.MUST_USE_PROPERTY),hasBooleanValue:o(h,t.HAS_BOOLEAN_VALUE),hasNumericValue:o(h,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:o(h,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:o(h,t.HAS_OVERLOADED_BOOLEAN_VALUE)};if(d.hasBooleanValue+d.hasNumericValue+d.hasOverloadedBooleanValue<=1||r("50",p),u.hasOwnProperty(p)){var m=u[p];d.attributeName=m}a.hasOwnProperty(p)&&(d.attributeNamespace=a[p]),c.hasOwnProperty(p)&&(d.propertyName=c[p]),l.hasOwnProperty(p)&&(d.mutationMethod=l[p]),s.properties[p]=d}}},a=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",s={ID_ATTRIBUTE_NAME:"data-reactid",ROOT_ATTRIBUTE_NAME:"data-reactroot",ATTRIBUTE_NAME_START_CHAR:a,ATTRIBUTE_NAME_CHAR:a+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",properties:{},getPossibleStandardName:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<s._isCustomAttributeFunctions.length;t++){if((0,s._isCustomAttributeFunctions[t])(e))return!0}return!1},injection:i};e.exports=s},function(e,t,n){"use strict";var r=n(823);n(53),n(23);function o(){r.attachRefs(this,this._currentElement)}var i={mountComponent:function(e,t,n,r,i,a){var s=e.mountComponent(t,n,r,i,a);return e._currentElement&&null!=e._currentElement.ref&&t.getReactMountReady().enqueue(o,e),s},getHostNode:function(e){return e.getHostNode()},unmountComponent:function(e,t){r.detachRefs(e,e._currentElement),e.unmountComponent(t)},receiveComponent:function(e,t,n,i){var a=e._currentElement;if(t!==a||i!==e._context){0;var s=r.shouldUpdateRefs(a,t);s&&r.detachRefs(e,a),e.receiveComponent(t,n,i),s&&e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(o,e)}},performUpdateIfNecessary:function(e,t,n){e._updateBatchNumber===n&&e.performUpdateIfNecessary(t)}};e.exports=i},function(e,t,n){"use strict";var r=n(254),o=n(187),i=n(255),a=n(431),s="undefined"!=typeof document&&"number"==typeof document.documentMode||"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&/\bEdge\/\d/.test(navigator.userAgent);function u(e){if(s){var t=e.node,n=e.children;if(n.length)for(var r=0;r<n.length;r++)c(t,n[r],null);else null!=e.html?o(t,e.html):null!=e.text&&a(t,e.text)}}var c=i(function(e,t,n){11===t.node.nodeType||1===t.node.nodeType&&"object"===t.node.nodeName.toLowerCase()&&(null==t.node.namespaceURI||t.node.namespaceURI===r.html)?(u(t),e.insertBefore(t.node,n)):(e.insertBefore(t.node,n),u(t))});function l(){return this.node.nodeName}function p(e){return{node:e,children:[],html:null,text:null,toString:l}}p.insertTreeBefore=c,p.replaceChildWithTree=function(e,t){e.parentNode.replaceChild(t.node,e),u(t)},p.queueChild=function(e,t){s?e.children.push(t):e.node.appendChild(t.node)},p.queueHTML=function(e,t){s?e.html=t:o(e.node,t)},p.queueText=function(e,t){s?e.text=t:a(e.node,t)},e.exports=p},function(e,t,n){var r=n(184),o=n(418);e.exports=function(e,t,n,i){var a=!n;n||(n={});for(var s=-1,u=t.length;++s<u;){var c=t[s],l=i?i(n[c],e[c],c,n,e):void 0;void 0===l&&(l=e[c]),a?o(n,c,l):r(n,c,l)}return n}},function(e,t,n){"use strict";e.exports=function(e){return"object"==typeof e?function e(t,n){var r;r=Array.isArray(t)?[]:{};n.push(t);Object.keys(t).forEach(function(o){var i=t[o];"function"!=typeof i&&(i&&"object"==typeof i?-1!==n.indexOf(t[o])?r[o]="[Circular]":r[o]=e(t[o],n.slice(0)):r[o]=i)});"string"==typeof t.name&&(r.name=t.name);"string"==typeof t.message&&(r.message=t.message);"string"==typeof t.stack&&(r.stack=t.stack);return r}(e,[]):"function"==typeof e?"[Function: "+(e.name||"anonymous")+"]":e}},function(e,t,n){"use strict";n.r(t),n.d(t,"sampleFromSchema",function(){return d}),n.d(t,"inferSchema",function(){return m}),n.d(t,"sampleXmlFromSchema",function(){return v}),n.d(t,"createXMLExample",function(){return g}),n.d(t,"memoizedCreateXMLExample",function(){return y}),n.d(t,"memoizedSampleFromSchema",function(){return b});var r=n(14),o=n.n(r),i=n(3),a=n(474),s=n.n(a),u=n(331),c=n.n(u),l=n(145),p=n.n(l),f={string:function(){return"string"},string_email:function(){return"user@example.com"},"string_date-time":function(){return(new Date).toISOString()},string_date:function(){return(new Date).toISOString().substring(0,10)},string_uuid:function(){return"3fa85f64-5717-4562-b3fc-2c963f66afa6"},string_hostname:function(){return"example.com"},string_ipv4:function(){return"198.51.100.42"},string_ipv6:function(){return"2001:0db8:5b96:0000:0000:426f:8e17:642a"},number:function(){return 0},number_float:function(){return 0},integer:function(){return 0},boolean:function(e){return"boolean"!=typeof e.default||e.default}},h=function(e){var t=e=Object(i.A)(e),n=t.type,r=t.format,o=f["".concat(n,"_").concat(r)]||f[n];return Object(i.s)(o)?o(e):"Unknown Type: "+e.type},d=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(i.A)(t),a=r.type,s=r.example,u=r.properties,c=r.additionalProperties,l=r.items,p=n.includeReadOnly,f=n.includeWriteOnly;if(void 0!==s)return Object(i.e)(s,"$$ref",function(e){return"string"==typeof e&&e.indexOf("#")>-1});if(!a)if(u)a="object";else{if(!l)return;a="array"}if("object"===a){var d=Object(i.A)(u),m={};for(var v in d)d[v]&&d[v].deprecated||d[v]&&d[v].readOnly&&!p||d[v]&&d[v].writeOnly&&!f||(m[v]=e(d[v],n));if(!0===c)m.additionalProp1={};else if(c)for(var g=Object(i.A)(c),y=e(g,n),b=1;b<4;b++)m["additionalProp"+b]=y;return m}return"array"===a?o()(l.anyOf)?l.anyOf.map(function(t){return e(t,n)}):o()(l.oneOf)?l.oneOf.map(function(t){return e(t,n)}):[e(l,n)]:t.enum?t.default?t.default:Object(i.w)(t.enum)[0]:"file"!==a?h(t):void 0},m=function(e){return e.schema&&(e=e.schema),e.properties&&(e.type="object"),e},v=function e(t){var n,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=p()({},Object(i.A)(t)),u=s.type,c=s.properties,l=s.additionalProperties,f=s.items,d=s.example,m=a.includeReadOnly,v=a.includeWriteOnly,g=s.default,y={},b={},_=t.xml,w=_.name,x=_.prefix,E=_.namespace,S=s.enum;if(!u)if(c||l)u="object";else{if(!f)return;u="array"}if(n=(x?x+":":"")+(w=w||"notagname"),E){var C=x?"xmlns:"+x:"xmlns";b[C]=E}if("array"===u&&f){if(f.xml=f.xml||_||{},f.xml.name=f.xml.name||_.name,_.wrapped)return y[n]=[],o()(d)?d.forEach(function(t){f.example=t,y[n].push(e(f,a))}):o()(g)?g.forEach(function(t){f.default=t,y[n].push(e(f,a))}):y[n]=[e(f,a)],b&&y[n].push({_attr:b}),y;var k=[];return o()(d)?(d.forEach(function(t){f.example=t,k.push(e(f,a))}),k):o()(g)?(g.forEach(function(t){f.default=t,k.push(e(f,a))}),k):e(f,a)}if("object"===u){var O=Object(i.A)(c);for(var A in y[n]=[],d=d||{},O)if(O.hasOwnProperty(A)&&(!O[A].readOnly||m)&&(!O[A].writeOnly||v))if(O[A].xml=O[A].xml||{},O[A].xml.attribute){var T=o()(O[A].enum)&&O[A].enum[0],j=O[A].example,P=O[A].default;b[O[A].xml.name||A]=void 0!==j&&j||void 0!==d[A]&&d[A]||void 0!==P&&P||T||h(O[A])}else{O[A].xml.name=O[A].xml.name||A,void 0===O[A].example&&void 0!==d[A]&&(O[A].example=d[A]);var I=e(O[A]);o()(I)?y[n]=y[n].concat(I):y[n].push(I)}return!0===l?y[n].push({additionalProp:"Anything can be here"}):l&&y[n].push({additionalProp:h(l)}),b&&y[n].push({_attr:b}),y}return r=void 0!==d?d:void 0!==g?g:o()(S)?S[0]:h(t),y[n]=b?[{_attr:b},r]:r,y};function g(e,t){var n=v(e,t);if(n)return s()(n,{declaration:!0,indent:"\t"})}var y=c()(g),b=c()(d)},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_CONFIGS",function(){return i}),n.d(t,"TOGGLE_CONFIGS",function(){return a}),n.d(t,"update",function(){return s}),n.d(t,"toggle",function(){return u}),n.d(t,"loaded",function(){return c});var r=n(2),o=n.n(r),i="configs_update",a="configs_toggle";function s(e,t){return{type:i,payload:o()({},e,t)}}function u(e){return{type:a,payload:e}}var c=function(){return function(){}}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),o=n.n(r),i=o.a.Set.of("type","format","items","default","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","maxItems","minItems","uniqueItems","enum","multipleOf");function a(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).isOAS3;if(!o.a.Map.isMap(e))return{schema:o.a.Map(),parameterContentMediaType:null};if(!t)return"body"===e.get("in")?{schema:e.get("schema",o.a.Map()),parameterContentMediaType:null}:{schema:e.filter(function(e,t){return i.includes(t)}),parameterContentMediaType:null};if(e.get("content")){var n=e.get("content",o.a.Map({})).keySeq().first();return{schema:e.getIn(["content",n,"schema"],o.a.Map()),parameterContentMediaType:n}}return{schema:e.get("schema",o.a.Map()),parameterContentMediaType:null}}},function(e,t,n){e.exports=n(781)},function(e,t,n){"use strict";n.r(t);var r=n(469),o="object"==typeof self&&self&&self.Object===Object&&self,i=(r.a||o||Function("return this")()).Symbol,a=Object.prototype,s=a.hasOwnProperty,u=a.toString,c=i?i.toStringTag:void 0;var l=function(e){var t=s.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var o=u.call(e);return r&&(t?e[c]=n:delete e[c]),o},p=Object.prototype.toString;var f=function(e){return p.call(e)},h="[object Null]",d="[object Undefined]",m=i?i.toStringTag:void 0;var v=function(e){return null==e?void 0===e?d:h:m&&m in Object(e)?l(e):f(e)};var g=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object);var y=function(e){return null!=e&&"object"==typeof e},b="[object Object]",_=Function.prototype,w=Object.prototype,x=_.toString,E=w.hasOwnProperty,S=x.call(Object);var C=function(e){if(!y(e)||v(e)!=b)return!1;var t=g(e);if(null===t)return!0;var n=E.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&x.call(n)==S},k=n(330),O={INIT:"@@redux/INIT"};function A(e,t,n){var r;if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(A)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var o=e,i=t,a=[],s=a,u=!1;function c(){s===a&&(s=a.slice())}function l(){return i}function p(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return c(),s.push(e),function(){if(t){t=!1,c();var n=s.indexOf(e);s.splice(n,1)}}}function f(e){if(!C(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(u)throw new Error("Reducers may not dispatch actions.");try{u=!0,i=o(i,e)}finally{u=!1}for(var t=a=s,n=0;n<t.length;n++){(0,t[n])()}return e}return f({type:O.INIT}),(r={dispatch:f,subscribe:p,getState:l,replaceReducer:function(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");o=e,f({type:O.INIT})}})[k.a]=function(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(l())}return n(),{unsubscribe:t(n)}}})[k.a]=function(){return this},e},r}function T(e,t){var n=t&&t.type;return"Given action "+(n&&'"'+n.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function j(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];0,"function"==typeof e[o]&&(n[o]=e[o])}var i=Object.keys(n);var a=void 0;try{!function(e){Object.keys(e).forEach(function(t){var n=e[t];if(void 0===n(void 0,{type:O.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+O.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}(n)}catch(e){a=e}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(a)throw a;for(var r=!1,o={},s=0;s<i.length;s++){var u=i[s],c=n[u],l=e[u],p=c(l,t);if(void 0===p){var f=T(u,t);throw new Error(f)}o[u]=p,r=r||p!==l}return r?o:e}}function P(e,t){return function(){return t(e.apply(void 0,arguments))}}function I(e,t){if("function"==typeof e)return P(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(e),r={},o=0;o<n.length;o++){var i=n[o],a=e[i];"function"==typeof a&&(r[i]=P(a,t))}return r}function M(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}var N=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function R(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,r,o){var i,a=e(n,r,o),s=a.dispatch,u={getState:a.getState,dispatch:function(e){return s(e)}};return i=t.map(function(e){return e(u)}),s=M.apply(void 0,i)(a.dispatch),N({},a,{dispatch:s})}}}n.d(t,"createStore",function(){return A}),n.d(t,"combineReducers",function(){return j}),n.d(t,"bindActionCreators",function(){return I}),n.d(t,"applyMiddleware",function(){return R}),n.d(t,"compose",function(){return M})},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){e.exports=!n(99)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){e.exports={}},function(e,t,n){var r=n(348),o=n(215);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=!0},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(49).f,o=n(75),i=n(34)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){var r=n(159)("meta"),o=n(43),i=n(75),a=n(49).f,s=0,u=Object.isExtensible||function(){return!0},c=!n(82)(function(){return u(Object.preventExtensions({}))}),l=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},p=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!u(e))return"F";if(!t)return"E";l(e)}return e[r].i},getWeak:function(e,t){if(!i(e,r)){if(!u(e))return!0;if(!t)return!1;l(e)}return e[r].w},onFreeze:function(e){return c&&p.NEED&&u(e)&&!i(e,r)&&l(e),e}}},function(e,t,n){"use strict";e.exports=function(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(64).Buffer)},function(e,t,n){"use strict";function r(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},e.exports=r},function(e,t,n){"use strict";var r=n(114);e.exports=new r({include:[n(415)],implicit:[n(792),n(793)],explicit:[n(794),n(795),n(796),n(797)]})},function(e,t,n){"use strict";var r=n(141),o=n(248),i=n(423),a=n(424),s=(n(23),r.getListener);function u(e,t,n){var r=function(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return s(e,r)}(e,n,t);r&&(n._dispatchListeners=i(n._dispatchListeners,r),n._dispatchInstances=i(n._dispatchInstances,e))}function c(e){e&&e.dispatchConfig.phasedRegistrationNames&&o.traverseTwoPhase(e._targetInst,u,e)}function l(e){if(e&&e.dispatchConfig.phasedRegistrationNames){var t=e._targetInst,n=t?o.getParentInstance(t):null;o.traverseTwoPhase(n,u,e)}}function p(e,t,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,o=s(e,r);o&&(n._dispatchListeners=i(n._dispatchListeners,o),n._dispatchInstances=i(n._dispatchInstances,e))}}function f(e){e&&e.dispatchConfig.registrationName&&p(e._targetInst,0,e)}var h={accumulateTwoPhaseDispatches:function(e){a(e,c)},accumulateTwoPhaseDispatchesSkipTarget:function(e){a(e,l)},accumulateDirectDispatches:function(e){a(e,f)},accumulateEnterLeaveDispatches:function(e,t,n,r){o.traverseEnterLeave(n,r,p,e,t)}};e.exports=h},function(e,t,n){"use strict";var r=n(21),o=n(247),i=n(248),a=n(249),s=n(423),u=n(424),c=(n(15),{}),l=null,p=function(e,t){e&&(i.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},f=function(e){return p(e,!0)},h=function(e){return p(e,!1)},d=function(e){return"."+e._rootNodeID};var m={injection:{injectEventPluginOrder:o.injectEventPluginOrder,injectEventPluginsByName:o.injectEventPluginsByName},putListener:function(e,t,n){"function"!=typeof n&&r("94",t,typeof n);var i=d(e);(c[t]||(c[t]={}))[i]=n;var a=o.registrationNameModules[t];a&&a.didPutListener&&a.didPutListener(e,t,n)},getListener:function(e,t){var n=c[t];if(function(e,t,n){switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":return!(!n.disabled||(r=t,"button"!==r&&"input"!==r&&"select"!==r&&"textarea"!==r));default:return!1}var r}(t,e._currentElement.type,e._currentElement.props))return null;var r=d(e);return n&&n[r]},deleteListener:function(e,t){var n=o.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t);var r=c[t];r&&delete r[d(e)]},deleteAllListeners:function(e){var t=d(e);for(var n in c)if(c.hasOwnProperty(n)&&c[n][t]){var r=o.registrationNameModules[n];r&&r.willDeleteListener&&r.willDeleteListener(e,n),delete c[n][t]}},extractEvents:function(e,t,n,r){for(var i,a=o.plugins,u=0;u<a.length;u++){var c=a[u];if(c){var l=c.extractEvents(e,t,n,r);l&&(i=s(i,l))}}return i},enqueueEvents:function(e){e&&(l=s(l,e))},processEventQueue:function(e){var t=l;l=null,u(t,e?f:h),l&&r("95"),a.rethrowCaughtError()},__purge:function(){c={}},__getListenerBank:function(){return c}};e.exports=m},function(e,t,n){"use strict";var r=n(68),o=n(250),i={view:function(e){if(e.view)return e.view;var t=o(e);if(t.window===t)return t;var n=t.ownerDocument;return n?n.defaultView||n.parentWindow:window},detail:function(e){return e.detail||0}};function a(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(a,i),e.exports=a},function(e,t,n){"use strict";var r={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}};e.exports=r},function(e,t,n){var r=n(43);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function o(e){return null===e?"null":void 0===e?"undefined":"object"===(void 0===e?"undefined":r(e))?Array.isArray(e)?"array":"object":void 0===e?"undefined":r(e)}function i(e){return"object"===o(e)?s(e):"array"===o(e)?a(e):e}function a(e){return e.map(i)}function s(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=i(e[n]));return t}function u(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n={arrayBehaviour:(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).arrayBehaviour||"replace"},r=t.map(function(e){return e||{}}),i=e||{},c=0;c<r.length;c++)for(var l=r[c],p=Object.keys(l),f=0;f<p.length;f++){var h=p[f],d=l[h],m=o(d),v=o(i[h]);if("object"===m)if("undefined"!==v){var g="object"===v?i[h]:{};i[h]=u({},[g,s(d)],n)}else i[h]=s(d);else if("array"===m)if("array"===v){var y=a(d);i[h]="merge"===n.arrayBehaviour?i[h].concat(y):y}else i[h]=a(d);else i[h]=d}return i}e.exports=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return u(e,n)},e.exports.noMutate=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return u({},t)},e.exports.withOptions=function(e,t,n){return u(e,t,n)}},function(e,t,n){"use strict";var r=n(782);e.exports=r},function(e,t,n){"use strict";n.r(t),n.d(t,"parseYamlConfig",function(){return i});var r=n(146),o=n.n(r),i=function(e,t){try{return o.a.safeLoad(e)}catch(e){return t&&t.errActions.newThrownErr(new Error(e)),{}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"makeMappedContainer",function(){return j}),n.d(t,"render",function(){return P}),n.d(t,"getComponent",function(){return N});var r=n(26),o=n.n(r),i=n(17),a=n.n(i),s=n(16),u=n.n(s),c=n(20),l=n.n(c),p=n(4),f=n.n(p),h=n(5),d=n.n(h),m=n(6),v=n.n(m),g=n(7),y=n.n(g),b=n(8),_=n.n(b),w=n(0),x=n.n(w),E=n(480),S=n.n(E),C=n(334),k=n(481),O=n.n(k),A=function(e,t,n){var r=function(e,t){return function(n){function r(){return f()(this,r),v()(this,y()(r).apply(this,arguments))}return _()(r,n),d()(r,[{key:"render",value:function(){return x.a.createElement(t,l()({},e(),this.props,this.context))}}]),r}(w.Component)}(e,t),o=Object(C.connect)(function(n,r){var o=u()({},r,e());return(t.prototype.mapStateToProps||function(e){return{state:e}})(n,o)})(r);return n?function(e,t){return function(n){function r(){return f()(this,r),v()(this,y()(r).apply(this,arguments))}return _()(r,n),d()(r,[{key:"render",value:function(){return x.a.createElement(C.Provider,{store:e},x.a.createElement(t,l()({},this.props,this.context)))}}]),r}(w.Component)}(n,o):o},T=function(e,t,n,r){for(var o in t){var i=t[o];"function"==typeof i&&i(n[o],r[o],e())}},j=function(e,t,n,r,o,i){return function(t){function r(t,n){var o;return f()(this,r),o=v()(this,y()(r).call(this,t,n)),T(e,i,t,{}),o}return _()(r,t),d()(r,[{key:"componentWillReceiveProps",value:function(t){T(e,i,t,this.props)}},{key:"render",value:function(){var e=O()(this.props,i?a()(i):[]),t=n(o,"root");return x.a.createElement(t,e)}}]),r}(w.Component)},P=function(e,t,n,r,o){var i=n(e,t,r,"App","root");S.a.render(x.a.createElement(i,null),o)},I=function(e){var t=e.name;return x.a.createElement("div",{style:{padding:"1em",color:"#aaa"}},"😱 ",x.a.createElement("i",null,"Could not render ","t"===t?"this component":t,", see the console."))},M=function(e){var t=function(e){return!(e.prototype&&e.prototype.isReactComponent)}(e)?function(e){return function(t){function n(){return f()(this,n),v()(this,y()(n).apply(this,arguments))}return _()(n,t),d()(n,[{key:"render",value:function(){return e(this.props)}}]),n}(w.Component)}(e):e,n=t.prototype.render;return t.prototype.render=function(){try{for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return n.apply(this,r)}catch(e){return console.error(e),x.a.createElement(I,{error:e,name:t.name})}},t},N=function(e,t,n,r,i){if("string"!=typeof r)throw new TypeError("Need a string, to fetch a component. Was given a "+o()(r));var a=n(r);return a?i?"root"===i?A(e,a,t()):A(e,M(a)):M(a):(e().log.warn("Could not find component",r),null)}},function(e,t,n){"use strict";n.r(t),n.d(t,"setHash",function(){return r});var r=function(e){return e?history.pushState(null,null,"#".concat(e)):window.location.hash=""}},function(e,t,n){var r=n(125),o=n(33)("toStringTag"),i="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:i?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,n){var r=n(45),o=n(492),i=n(493),a=Object.defineProperty;t.f=n(126)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(154);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(499),o=n(73);e.exports=function(e){return r(o(e))}},function(e,t,n){"use strict";var r=n(150),o=RegExp.prototype.exec;e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var i=n.call(e,t);if("object"!=typeof i)throw new TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(e))throw new TypeError("RegExp#exec called on incompatible receiver");return o.call(e,t)}},function(e,t,n){"use strict";n(546);var r=n(97),o=n(81),i=n(99),a=n(73),s=n(33),u=n(209),c=s("species"),l=!i(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),p=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var f=s(e),h=!i(function(){var t={};return t[f]=function(){return 7},7!=""[e](t)}),d=h?!i(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[c]=function(){return n}),n[f](""),!t}):void 0;if(!h||!d||"replace"===e&&!l||"split"===e&&!p){var m=/./[f],v=n(a,f,""[e],function(e,t,n,r,o){return t.exec===u?h&&!o?{done:!0,value:m.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),g=v[0],y=v[1];r(String.prototype,e,g),o(RegExp.prototype,f,2==t?function(e,t){return y.call(e,this,t)}:function(e){return y.call(e,this)})}}},function(e,t,n){var r=n(212),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(46),o=n(350),i=n(215),a=n(213)("IE_PROTO"),s=function(){},u=function(){var e,t=n(217)("iframe"),r=i.length;for(t.style.display="none",n(351).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[i[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:o(n,t)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(162),o=n(133),i=n(76),a=n(218),s=n(75),u=n(349),c=Object.getOwnPropertyDescriptor;t.f=n(50)?c:function(e,t){if(e=i(e),t=a(t,!0),u)try{return c(e,t)}catch(e){}if(s(e,t))return o(!r.f.call(e,t),e[t])}},function(e,t){},function(e,t,n){"use strict";e.exports={}},function(e,t,n){var r=n(130),o=n(34)("toStringTag"),i="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:i?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,n){var r=n(83),o=n(66),i="[object Symbol]";e.exports=function(e){return"symbol"==typeof e||o(e)&&r(e)==i}},function(e,t,n){var r=n(84)(Object,"create");e.exports=r},function(e,t,n){var r=n(629),o=n(630),i=n(631),a=n(632),s=n(633);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},function(e,t,n){var r=n(91);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(635);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){var r=n(640),o=n(668),i=n(237),a=n(37),s=n(673);e.exports=function(e){return"function"==typeof e?e:null==e?i:"object"==typeof e?a(e)?o(e[0],e[1]):r(e):s(e)}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var o=typeof e;return!!(t=null==t?n:t)&&("number"==o||"symbol"!=o&&r.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(663),o=n(227),i=n(664),a=n(665),s=n(666),u=n(83),c=n(372),l=c(r),p=c(o),f=c(i),h=c(a),d=c(s),m=u;(r&&"[object DataView]"!=m(new r(new ArrayBuffer(1)))||o&&"[object Map]"!=m(new o)||i&&"[object Promise]"!=m(i.resolve())||a&&"[object Set]"!=m(new a)||s&&"[object WeakMap]"!=m(new s))&&(m=function(e){var t=u(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case l:return"[object DataView]";case p:return"[object Map]";case f:return"[object Promise]";case h:return"[object Set]";case d:return"[object WeakMap]"}return t}),e.exports=m},function(e,t,n){var r=n(108),o=n(109);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n<i;)e=e[o(t[n++])];return n&&n==i?e:void 0}},function(e,t,n){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,o){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,n)});case 3:return t.nextTick(function(){e.call(null,n,r)});case 4:return t.nextTick(function(){e.call(null,n,r,o)});default:for(i=new Array(s-1),a=0;a<i.length;)i[a++]=arguments[a];return t.nextTick(function(){e.apply(null,i)})}}}:e.exports=t}).call(this,n(67))},function(e,t,n){"use strict";e.exports=n(701)("forEach")},function(e,t,n){"use strict";var r=n(399),o=n(396),i=n(241),a=n(710);(e.exports=function(e,t){var n,i,s,u,c;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],null==e?(n=s=!0,i=!1):(n=a.call(e,"c"),i=a.call(e,"e"),s=a.call(e,"w")),c={value:t,configurable:n,enumerable:i,writable:s},u?r(o(u),c):c}).gs=function(e,t,n){var s,u,c,l;return"string"!=typeof e?(c=n,n=t,t=e,e=null):c=arguments[3],null==t?t=void 0:i(t)?null==n?n=void 0:i(n)||(c=n,n=void 0):(c=t,t=n=void 0),null==e?(s=!0,u=!1):(s=a.call(e,"c"),u=a.call(e,"e")),l={get:t,set:n,configurable:s,enumerable:u},c?r(o(c),l):l}},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(77);e.exports=function(e,t,n){for(var o in t)n&&e[o]?e[o]=t[o]:r(e,o,t[o]);return e}},function(e,t,n){"use strict";var r=n(114);e.exports=r.DEFAULT=new r({include:[n(139)],explicit:[n(798),n(799),n(800)]})},function(e,t,n){var r=n(418),o=n(91),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];i.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t,n){"use strict";var r=n(21),o=(n(15),{}),i={reinitializeTransaction:function(){this.transactionWrappers=this.getTransactionWrappers(),this.wrapperInitData?this.wrapperInitData.length=0:this.wrapperInitData=[],this._isInTransaction=!1},_isInTransaction:!1,getTransactionWrappers:null,isInTransaction:function(){return!!this._isInTransaction},perform:function(e,t,n,o,i,a,s,u){var c,l;this.isInTransaction()&&r("27");try{this._isInTransaction=!0,c=!0,this.initializeAll(0),l=e.call(t,n,o,i,a,s,u),c=!1}finally{try{if(c)try{this.closeAll(0)}catch(e){}else this.closeAll(0)}finally{this._isInTransaction=!1}}return l},initializeAll:function(e){for(var t=this.transactionWrappers,n=e;n<t.length;n++){var r=t[n];try{this.wrapperInitData[n]=o,this.wrapperInitData[n]=r.initialize?r.initialize.call(this):null}finally{if(this.wrapperInitData[n]===o)try{this.initializeAll(n+1)}catch(e){}}}},closeAll:function(e){this.isInTransaction()||r("28");for(var t=this.transactionWrappers,n=e;n<t.length;n++){var i,a=t[n],s=this.wrapperInitData[n];try{i=!0,s!==o&&a.close&&a.close.call(this,s),i=!1}finally{if(i)try{this.closeAll(n+1)}catch(e){}}}this.wrapperInitData.length=0}};e.exports=i},function(e,t,n){"use strict";var r=n(142),o=n(430),i={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:n(252),button:function(e){var t=e.button;return"which"in e?t:2===t?2:4===t?1:0},buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},pageX:function(e){return"pageX"in e?e.pageX:e.clientX+o.currentScrollLeft},pageY:function(e){return"pageY"in e?e.pageY:e.clientY+o.currentScrollTop}};function a(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(a,i),e.exports=a},function(e,t,n){"use strict";var r,o=n(38),i=n(254),a=/^[ \r\n\t\f]/,s=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,u=n(255)(function(e,t){if(e.namespaceURI!==i.svg||"innerHTML"in e)e.innerHTML=t;else{(r=r||document.createElement("div")).innerHTML="<svg>"+t+"</svg>";for(var n=r.firstChild;n.firstChild;)e.appendChild(n.firstChild)}});if(o.canUseDOM){var c=document.createElement("div");c.innerHTML=" ",""===c.innerHTML&&(u=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),a.test(t)||"<"===t[0]&&s.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t}),c=null}e.exports=u},function(e,t,n){"use strict";var r=/["'&<>]/;e.exports=function(e){return"boolean"==typeof e||"number"==typeof e?""+e:function(e){var t,n=""+e,o=r.exec(n);if(!o)return n;var i="",a=0,s=0;for(a=o.index;a<n.length;a++){switch(n.charCodeAt(a)){case 34:t=""";break;case 38:t="&";break;case 39:t="'";break;case 60:t="<";break;case 62:t=">";break;default:continue}s!==a&&(i+=n.substring(s,a)),s=a+1,i+=t}return s!==a?i+n.substring(s,a):i}(e)}},function(e,t,n){"use strict";var r,o=n(25),i=n(247),a=n(844),s=n(430),u=n(845),c=n(251),l={},p=!1,f=0,h={topAbort:"abort",topAnimationEnd:u("animationend")||"animationend",topAnimationIteration:u("animationiteration")||"animationiteration",topAnimationStart:u("animationstart")||"animationstart",topBlur:"blur",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topTransitionEnd:u("transitionend")||"transitionend",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},d="_reactListenersID"+String(Math.random()).slice(2);var m=o({},a,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(m.handleTopLevel),m.ReactEventListener=e}},setEnabled:function(e){m.ReactEventListener&&m.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!m.ReactEventListener||!m.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var n=t,r=function(e){return Object.prototype.hasOwnProperty.call(e,d)||(e[d]=f++,l[e[d]]={}),l[e[d]]}(n),o=i.registrationNameDependencies[e],a=0;a<o.length;a++){var s=o[a];r.hasOwnProperty(s)&&r[s]||("topWheel"===s?c("wheel")?m.ReactEventListener.trapBubbledEvent("topWheel","wheel",n):c("mousewheel")?m.ReactEventListener.trapBubbledEvent("topWheel","mousewheel",n):m.ReactEventListener.trapBubbledEvent("topWheel","DOMMouseScroll",n):"topScroll"===s?c("scroll",!0)?m.ReactEventListener.trapCapturedEvent("topScroll","scroll",n):m.ReactEventListener.trapBubbledEvent("topScroll","scroll",m.ReactEventListener.WINDOW_HANDLE):"topFocus"===s||"topBlur"===s?(c("focus",!0)?(m.ReactEventListener.trapCapturedEvent("topFocus","focus",n),m.ReactEventListener.trapCapturedEvent("topBlur","blur",n)):c("focusin")&&(m.ReactEventListener.trapBubbledEvent("topFocus","focusin",n),m.ReactEventListener.trapBubbledEvent("topBlur","focusout",n)),r.topBlur=!0,r.topFocus=!0):h.hasOwnProperty(s)&&m.ReactEventListener.trapBubbledEvent(s,h[s],n),r[s]=!0)}},trapBubbledEvent:function(e,t,n){return m.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return m.ReactEventListener.trapCapturedEvent(e,t,n)},supportsEventPageXY:function(){if(!document.createEvent)return!1;var e=document.createEvent("MouseEvent");return null!=e&&"pageX"in e},ensureScrollValueMonitoring:function(){if(void 0===r&&(r=m.supportsEventPageXY()),!r&&!p){var e=s.refreshScrollValues;m.ReactEventListener.monitorScrollValue(e),p=!0}}});e.exports=m},function(e,t,n){"use strict";function r(){this.__rules__=[],this.__cache__=null}r.prototype.__find__=function(e){for(var t=this.__rules__.length,n=-1;t--;)if(this.__rules__[++n].name===e)return n;return-1},r.prototype.__compile__=function(){var e=this,t=[""];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},r.prototype.at=function(e,t,n){var r=this.__find__(e),o=n||{};if(-1===r)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=o.alt||[],this.__cache__=null},r.prototype.before=function(e,t,n,r){var o=this.__find__(e),i=r||{};if(-1===o)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o,0,{name:t,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},r.prototype.after=function(e,t,n,r){var o=this.__find__(e),i=r||{};if(-1===o)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},r.prototype.push=function(e,t,n){var r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},r.prototype.enable=function(e,t){e=Array.isArray(e)?e:[e],t&&this.__rules__.forEach(function(e){e.enabled=!1}),e.forEach(function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!0},this),this.__cache__=null},r.prototype.disable=function(e){(e=Array.isArray(e)?e:[e]).forEach(function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!1},this),this.__cache__=null},r.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},e.exports=r},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i=-1,a=e.posMax,s=e.pos,u=e.isInLabel;if(e.isInLabel)return-1;if(e.labelUnmatchedScopes)return e.labelUnmatchedScopes--,-1;for(e.pos=t+1,e.isInLabel=!0,n=1;e.pos<a;){if(91===(o=e.src.charCodeAt(e.pos)))n++;else if(93===o&&0===--n){r=!0;break}e.parser.skipToken(e)}return r?(i=e.pos,e.labelUnmatchedScopes=0):e.labelUnmatchedScopes=n-1,e.pos=s,e.isInLabel=u,i}},function(e,t,n){e.exports=n(774)},function(e,t,n){var r=n(192);function o(e,t,n,o,i,a,s){try{var u=e[a](s),c=u.value}catch(e){return void n(e)}u.done?t(c):r.resolve(c).then(o,i)}e.exports=function(e){return function(){var t=this,n=arguments;return new r(function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,u,"next",e)}function u(e){o(a,r,i,s,u,"throw",e)}s(void 0)})}}},function(e,t,n){"use strict";n.d(t,"b",function(){return p});var r=n(0),o=n.n(r),i=(n(10),n(195)),a=n.n(i),s=n(335),u=n.n(s),c=n(59),l=n.n(c);function p(e){return u.a.sanitize(e,{ADD_ATTR:["target"],FORBID_TAGS:["style"]})}u.a.addHook("beforeSanitizeElements",function(e){return e.href&&e.setAttribute("rel","noopener noreferrer"),e}),t.a=function(e){var t=e.source,n=e.className,r=void 0===n?"":n;if("string"!=typeof t)return null;var i=new a.a({html:!0,typographer:!0,breaks:!0,linkify:!0,linkTarget:"_blank"});i.core.ruler.disable(["replacements","smartquotes"]);var s=i.render(t),u=p(s);return t&&s&&u?o.a.createElement("div",{className:l()(r,"markdown"),dangerouslySetInnerHTML:{__html:u}}):null}},function(e,t,n){"use strict";e.exports=n(980)},function(e,t,n){"use strict";var r=n(20),o=n.n(r),i=n(4),a=n.n(i),s=n(5),u=n.n(s),c=n(6),l=n.n(c),p=n(7),f=n.n(p),h=n(9),d=n.n(h),m=n(8),v=n.n(m),g=n(2),y=n.n(g),b=n(0),_=n.n(b),w=n(1),x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},E=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var S=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,_.a.Component),E(t,[{key:"shouldComponentUpdate",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.state||{};return!(this.updateOnProps||Object.keys(x({},e,this.props))).every(function(n){return Object(w.is)(e[n],t.props[n])})||!(this.updateOnStates||Object.keys(x({},n,r))).every(function(e){return Object(w.is)(n[e],r[e])})}}]),t}(),C=n(19),k=n.n(C),O=n(10),A=n.n(O);n.d(t,"a",function(){return T});var T=function(e){function t(){var e,n;a()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=l()(this,(e=f()(t)).call.apply(e,[this].concat(o))),y()(d()(n),"getModelName",function(e){return-1!==e.indexOf("#/definitions/")?e.replace(/^.*#\/definitions\//,""):-1!==e.indexOf("#/components/schemas/")?e.replace(/^.*#\/components\/schemas\//,""):void 0}),y()(d()(n),"getRefSchema",function(e){return n.props.specSelectors.findDefinition(e)}),n}return v()(t,e),u()(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,r=e.getConfigs,i=e.specSelectors,a=e.schema,s=e.required,u=e.name,c=e.isRef,l=e.specPath,p=e.displayName,f=t("ObjectModel"),h=t("ArrayModel"),d=t("PrimitiveModel"),m="object",v=a&&a.get("$$ref");if(!u&&v&&(u=this.getModelName(v)),!a&&v&&(a=this.getRefSchema(u)),!a)return _.a.createElement("span",{className:"model model-title"},_.a.createElement("span",{className:"model-title__text"},p||u),_.a.createElement("img",{src:n(462),height:"20px",width:"20px",style:{marginLeft:"1em",position:"relative",bottom:"0px"}}));var g=i.isOAS3()&&a.get("deprecated");switch(c=void 0!==c?c:!!v,m=a&&a.get("type")||m){case"object":return _.a.createElement(f,o()({className:"object"},this.props,{specPath:l,getConfigs:r,schema:a,name:u,deprecated:g,isRef:c}));case"array":return _.a.createElement(h,o()({className:"array"},this.props,{getConfigs:r,schema:a,name:u,deprecated:g,required:s}));case"string":case"number":case"integer":case"boolean":default:return _.a.createElement(d,o()({},this.props,{getComponent:t,getConfigs:r,schema:a,name:u,deprecated:g,required:s}))}}}]),t}(S);y()(T,"propTypes",{schema:k.a.orderedMap.isRequired,getComponent:A.a.func.isRequired,getConfigs:A.a.func.isRequired,specSelectors:A.a.object.isRequired,name:A.a.string,displayName:A.a.string,isRef:A.a.bool,required:A.a.bool,expandDepth:A.a.number,depth:A.a.number,specPath:k.a.list.isRequired})},function(e,t,n){var r=n(72),o=n(41),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(198)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports=!1},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(98),o=n(41).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){var r=n(127),o=n(73);e.exports=function(e){return function(t,n){var i,a,s=String(o(t)),u=r(n),c=s.length;return u<0||u>=c?e?"":void 0:(i=s.charCodeAt(u))<55296||i>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):i:e?s.slice(u,u+2):a-56320+(i-55296<<10)+65536}}},function(e,t,n){var r=n(197)("keys"),o=n(199);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t,n){var r=n(151).f,o=n(152),i=n(33)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){var r=n(45),o=n(154),i=n(33)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||null==(n=r(a)[i])?t:o(n)}},function(e,t,n){"use strict";var r=n(154);function o(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=r(t),this.reject=r(n)}e.exports.f=function(e){return new o(e)}},function(e,t,n){var r=n(347),o=n(73);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(e))}},function(e,t,n){var r=n(33)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,n){"use strict";var r=n(201)(!0);e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},function(e,t,n){"use strict";var r,o,i=n(547),a=RegExp.prototype.exec,s=String.prototype.replace,u=a,c=(r=/a/,o=/b*/g,a.call(r,"a"),a.call(o,"a"),0!==r.lastIndex||0!==o.lastIndex),l=void 0!==/()??/.exec("")[1];(c||l)&&(u=function(e){var t,n,r,o,u=this;return l&&(n=new RegExp("^"+u.source+"$(?!\\s)",i.call(u))),c&&(t=u.lastIndex),r=a.call(u,e),c&&r&&(u.lastIndex=u.global?r.index+r[0].length:t),l&&r&&r.length>1&&s.call(r[0],n,function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)}),r}),e.exports=u},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(130);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(214)("keys"),o=n(159);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t,n){var r=n(22),o=n(32),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(131)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(30),o=n(22),i=n(82);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*i(function(){n(1)}),"Object",a)}},function(e,t,n){var r=n(43),o=n(32).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){var r=n(43);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){"use strict";var r=n(131),o=n(30),i=n(220),a=n(77),s=n(102),u=n(560),c=n(134),l=n(352),p=n(34)("iterator"),f=!([].keys&&"next"in[].keys()),h=function(){return this};e.exports=function(e,t,n,d,m,v,g){u(n,t,d);var y,b,_,w=function(e){if(!f&&e in C)return C[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",E="values"==m,S=!1,C=e.prototype,k=C[p]||C["@@iterator"]||m&&C[m],O=k||w(m),A=m?E?w("entries"):O:void 0,T="Array"==t&&C.entries||k;if(T&&(_=l(T.call(new e)))!==Object.prototype&&_.next&&(c(_,x,!0),r||"function"==typeof _[p]||a(_,p,h)),E&&k&&"values"!==k.name&&(S=!0,O=function(){return k.call(this)}),r&&!g||!f&&!S&&C[p]||a(C,p,O),s[t]=O,s[x]=h,m)if(y={values:E?O:w("values"),keys:v?O:w("keys"),entries:A},g)for(b in y)b in C||i(C,b,y[b]);else o(o.P+o.F*(f||S),t,y);return y}},function(e,t,n){e.exports=n(77)},function(e,t,n){t.f=n(34)},function(e,t,n){var r=n(32),o=n(22),i=n(131),a=n(221),s=n(49).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,n){var r=n(130);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(348),o=n(215).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},function(e,t,n){var r=n(166),o=n(34)("iterator"),i=n(102);e.exports=n(22).getIteratorMethod=function(e){if(null!=e)return e[o]||e["@@iterator"]||i[r(e)]}},function(e,t,n){var r=n(618),o=n(634),i=n(636),a=n(637),s=n(638);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},function(e,t,n){var r=n(84)(n(51),"Map");e.exports=r},function(e,t,n){var r=n(169),o=n(642),i=n(643),a=n(644),s=n(645),u=n(646);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,e.exports=c},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},function(e,t,n){var r=n(656),o=n(379),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),function(t){return i.call(e,t)}))}:o;e.exports=s},function(e,t,n){var r=n(658),o=n(66),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},function(e,t,n){(function(e){var r=n(51),o=n(659),i=t&&!t.nodeType&&t,a=i&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===i?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||o;e.exports=u}).call(this,n(173)(e))},function(e,t){var n=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(366),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,s=function(){try{var e=i&&i.require&&i.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s}).call(this,n(173)(e))},function(e,t,n){var r=n(37),o=n(167),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||(a.test(e)||!i.test(e)||null!=t&&e in Object(t))}},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";var r,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var o,i,a,s;if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);if(void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=c(e))>0&&a.length>o&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=function(){for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,i(this.listener,this.target,e))}.bind(r);return o.listener=n,r.wrapFn=o,o}function f(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):d(o,o.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function d(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)i(u,this,t);else{var c=u.length,l=d(u,c);for(n=0;n<c;++n)i(l[n],this,t)}return!0},s.prototype.addListener=function(e,t){return l(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return l(this,e,t,!0)},s.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,o,i,a;if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);if(void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return f(this,e,!0)},s.prototype.rawListeners=function(e){return f(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){(t=e.exports=n(390)).Stream=t,t.Readable=t,t.Writable=n(240),t.Duplex=n(86),t.Transform=n(395),t.PassThrough=n(691)},function(e,t,n){"use strict";(function(t,r,o){var i=n(178);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var o=r.callback;t.pendingcb--,o(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=y;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:i.nextTick;y.WritableState=g;var c=n(137);c.inherits=n(47);var l={deprecate:n(690)},p=n(391),f=n(48).Buffer,h=o.Uint8Array||function(){};var d,m=n(392);function v(){}function g(e,t){s=s||n(86),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var o=e.highWaterMark,c=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var p=!1===e.decodeStrings;this.decodeStrings=!p,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(i.nextTick(o,r),i.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(o(r),e._writableState.errorEmitted=!0,e.emit("error",r),S(e,t))}(e,n,r,t,o);else{var a=x(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||w(e,n),r?u(_,e,n,a,o):_(e,n,a,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function y(e){if(s=s||n(86),!(d.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),p.call(this)}function b(e,t,n,r,o,i,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function _(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),S(e,t)}function w(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,o=new Array(r),i=t.corkedRequestsFree;i.entry=n;for(var s=0,u=!0;n;)o[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;o.allBuffers=u,b(e,t,!0,t.length,o,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,p=n.callback;if(b(e,t,!1,t.objectMode?1:c.length,c,l,p),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),S(e,t)})}function S(e,t){var n=x(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}c.inherits(y,p),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:l.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===y&&(e&&e._writableState instanceof g)}})):d=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,n){var r,o=this._writableState,a=!1,s=!o.objectMode&&(r=e,f.isBuffer(r)||r instanceof h);return s&&!f.isBuffer(e)&&(e=function(e){return f.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=v),o.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),i.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var o=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),i.nextTick(r,a),o=!1),o}(this,o,e,n))&&(o.pendingcb++,a=function(e,t,n,r,o,i){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=f.from(t,n));return t}(t,r,o);r!==a&&(n=!0,o="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:o,isBuf:n,callback:i,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else b(e,t,!1,s,r,o,i);return u}(this,o,s,e,t,n)),a},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||w(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,S(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(67),n(393).setImmediate,n(36))},function(e,t,n){"use strict";e.exports=function(e){return"function"==typeof e}},function(e,t,n){"use strict";e.exports=n(716)()?Array.from:n(717)},function(e,t,n){"use strict";var r=n(730),o=n(88),i=n(110),a=Array.prototype.indexOf,s=Object.prototype.hasOwnProperty,u=Math.abs,c=Math.floor;e.exports=function(e){var t,n,l,p;if(!r(e))return a.apply(this,arguments);for(n=o(i(this).length),l=arguments[1],t=l=isNaN(l)?0:l>=0?c(l):o(this.length)-c(u(l));t<n;++t)if(s.call(this,t)&&(p=this[t],r(p)))return t;return-1}},function(e,t,n){"use strict";(function(t,n){var r,o;r=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},o=function(e){var t,n,o=document.createTextNode(""),i=0;return new e(function(){var e;if(t)n&&(t=n.concat(t));else{if(!n)return;t=n}if(n=t,t=null,"function"==typeof n)return e=n,n=null,void e();for(o.data=i=++i%2;n;)e=n.shift(),n.length||(n=null),e()}).observe(o,{characterData:!0}),function(e){r(e),t?"function"==typeof t?t=[t,e]:t.push(e):(t=e,o.data=i=++i%2)}},e.exports=function(){if("object"==typeof t&&t&&"function"==typeof t.nextTick)return t.nextTick;if("object"==typeof document&&document){if("function"==typeof MutationObserver)return o(MutationObserver);if("function"==typeof WebKitMutationObserver)return o(WebKitMutationObserver)}return"function"==typeof n?function(e){n(r(e))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(e){setTimeout(r(e),0)}:null}()}).call(this,n(67),n(393).setImmediate)},function(e,t,n){"use strict";var r=n(132);function o(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=r(t),this.reject=r(n)}e.exports.f=function(e){return new o(e)}},function(e,t,n){"use strict";var r=n(114);e.exports=new r({explicit:[n(785),n(786),n(787)]})},function(e,t,n){"use strict";var r=n(21),o=(n(15),null),i={};function a(){if(o)for(var e in i){var t=i[e],n=o.indexOf(e);if(n>-1||r("96",e),!c.plugins[n]){t.extractEvents||r("97",e),c.plugins[n]=t;var a=t.eventTypes;for(var u in a)s(a[u],t,u)||r("98",u,e)}}}function s(e,t,n){c.eventNameDispatchConfigs.hasOwnProperty(n)&&r("99",n),c.eventNameDispatchConfigs[n]=e;var o=e.phasedRegistrationNames;if(o){for(var i in o){if(o.hasOwnProperty(i))u(o[i],t,n)}return!0}return!!e.registrationName&&(u(e.registrationName,t,n),!0)}function u(e,t,n){c.registrationNameModules[e]&&r("100",e),c.registrationNameModules[e]=t,c.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var c={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(e){o&&r("101"),o=Array.prototype.slice.call(e),a()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];i.hasOwnProperty(n)&&i[n]===o||(i[n]&&r("102",n),i[n]=o,t=!0)}t&&a()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return c.registrationNameModules[t.registrationName]||null;if(void 0!==t.phasedRegistrationNames){var n=t.phasedRegistrationNames;for(var r in n)if(n.hasOwnProperty(r)){var o=c.registrationNameModules[n[r]];if(o)return o}}return null},_resetEventPlugins:function(){for(var e in o=null,i)i.hasOwnProperty(e)&&delete i[e];c.plugins.length=0;var t=c.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=c.registrationNameModules;for(var a in r)r.hasOwnProperty(a)&&delete r[a]}};e.exports=c},function(e,t,n){"use strict";var r,o,i=n(21),a=n(249);n(15),n(23);function s(e,t,n,r){var o=e.type||"unknown-event";e.currentTarget=u.getNodeFromInstance(r),t?a.invokeGuardedCallbackWithCatch(o,n,e):a.invokeGuardedCallback(o,n,e),e.currentTarget=null}var u={isEndish:function(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e},isMoveish:function(e){return"topMouseMove"===e||"topTouchMove"===e},isStartish:function(e){return"topMouseDown"===e||"topTouchStart"===e},executeDirectDispatch:function(e){var t=e._dispatchListeners,n=e._dispatchInstances;Array.isArray(t)&&i("103"),e.currentTarget=t?u.getNodeFromInstance(n):null;var r=t?t(e):null;return e.currentTarget=null,e._dispatchListeners=null,e._dispatchInstances=null,r},executeDispatchesInOrder:function(e,t){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var o=0;o<n.length&&!e.isPropagationStopped();o++)s(e,t,n[o],r[o]);else n&&s(e,t,n,r);e._dispatchListeners=null,e._dispatchInstances=null},executeDispatchesInOrderStopAtTrue:function(e){var t=function(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t)){for(var r=0;r<t.length&&!e.isPropagationStopped();r++)if(t[r](e,n[r]))return n[r]}else if(t&&t(e,n))return n;return null}(e);return e._dispatchInstances=null,e._dispatchListeners=null,t},hasDispatches:function(e){return!!e._dispatchListeners},getInstanceFromNode:function(e){return r.getInstanceFromNode(e)},getNodeFromInstance:function(e){return r.getNodeFromInstance(e)},isAncestor:function(e,t){return o.isAncestor(e,t)},getLowestCommonAncestor:function(e,t){return o.getLowestCommonAncestor(e,t)},getParentInstance:function(e){return o.getParentInstance(e)},traverseTwoPhase:function(e,t,n){return o.traverseTwoPhase(e,t,n)},traverseEnterLeave:function(e,t,n,r,i){return o.traverseEnterLeave(e,t,n,r,i)},injection:{injectComponentTree:function(e){r=e},injectTreeTraversal:function(e){o=e}}};e.exports=u},function(e,t,n){"use strict";var r=null;function o(e,t,n){try{t(n)}catch(e){null===r&&(r=e)}}var i={invokeGuardedCallback:o,invokeGuardedCallbackWithCatch:o,rethrowCaughtError:function(){if(r){var e=r;throw r=null,e}}};e.exports=i},function(e,t,n){"use strict";e.exports=function(e){var t=e.target||e.srcElement||window;return t.correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}},function(e,t,n){"use strict";var r,o=n(38);o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")) +/** * Checks if an event is supported in the current execution environment. * * NOTE: This will not work correctly for non-generic events such as `change`, @@ -48,52 +62,73 @@ function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}func * @return {boolean} True if the event is supported. * @internal * @license Modernizr 3.0.0pre (Custom Build) | MIT + */,e.exports=function(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var a=document.createElement("div");a.setAttribute(n,"return;"),i="function"==typeof a[n]}return!i&&r&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}},function(e,t,n){"use strict";var r={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function o(e){var t=this.nativeEvent;if(t.getModifierState)return t.getModifierState(e);var n=r[e];return!!n&&!!t[n]}e.exports=function(e){return o}},function(e,t,n){"use strict";var r=n(117),o=n(829),i=(n(27),n(53),n(255)),a=n(187),s=n(431);function u(e,t){return Array.isArray(t)&&(t=t[1]),t?t.nextSibling:e.firstChild}var c=i(function(e,t,n){e.insertBefore(t,n)});function l(e,t,n){r.insertTreeBefore(e,t,n)}function p(e,t,n){Array.isArray(t)?function(e,t,n,r){var o=t;for(;;){var i=o.nextSibling;if(c(e,o,r),o===n)break;o=i}}(e,t[0],t[1],n):c(e,t,n)}function f(e,t){if(Array.isArray(t)){var n=t[1];h(e,t=t[0],n),e.removeChild(n)}e.removeChild(t)}function h(e,t,n){for(;;){var r=t.nextSibling;if(r===n)break;e.removeChild(r)}}var d={dangerouslyReplaceNodeWithMarkup:o.dangerouslyReplaceNodeWithMarkup,replaceDelimitedText:function(e,t,n){var r=e.parentNode,o=e.nextSibling;o===t?n&&c(r,document.createTextNode(n),o):n?(s(o,n),h(r,o,t)):h(r,e,t)},processUpdates:function(e,t){for(var n=0;n<t.length;n++){var r=t[n];switch(r.type){case"INSERT_MARKUP":l(e,r.content,u(e,r.afterNode));break;case"MOVE_EXISTING":p(e,r.fromNode,u(e,r.afterNode));break;case"SET_MARKUP":a(e,r.content);break;case"TEXT_CONTENT":s(e,r.content);break;case"REMOVE_NODE":f(e,r.fromNode)}}}};e.exports=d},function(e,t,n){"use strict";e.exports={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}},function(e,t,n){"use strict";e.exports=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}},function(e,t,n){"use strict";var r=n(21),o=n(847),i=n(361)(n(104).isValidElement),a=(n(15),n(23),{button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0});function s(e){null!=e.checkedLink&&null!=e.valueLink&&r("87")}function u(e){s(e),(null!=e.value||null!=e.onChange)&&r("88")}function c(e){s(e),(null!=e.checked||null!=e.onChange)&&r("89")}var l={value:function(e,t,n){return!e[t]||a[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,n){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:i.func},p={};function f(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}var h={checkPropTypes:function(e,t,n){for(var r in l){if(l.hasOwnProperty(r))var i=l[r](t,r,e,"prop",null,o);if(i instanceof Error&&!(i.message in p)){p[i.message]=!0;f(n)}}},getValue:function(e){return e.valueLink?(u(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(c(e),e.checkedLink.value):e.checked},executeOnChange:function(e,t){return e.valueLink?(u(e),e.valueLink.requestChange(t.target.value)):e.checkedLink?(c(e),e.checkedLink.requestChange(t.target.checked)):e.onChange?e.onChange.call(void 0,t):void 0}};e.exports=h},function(e,t,n){"use strict";var r=n(21),o=(n(15),!1),i={replaceNodeWithMarkup:null,processChildrenUpdates:null,injection:{injectEnvironment:function(e){o&&r("104"),i.replaceNodeWithMarkup=e.replaceNodeWithMarkup,i.processChildrenUpdates=e.processChildrenUpdates,o=!0}}};e.exports=i},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function o(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}e.exports=function(e,t){if(o(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(var a=0;a<n.length;a++)if(!r.call(t,n[a])||!o(e[n[a]],t[n[a]]))return!1;return!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n=null===e||!1===e,r=null===t||!1===t;if(n||r)return n===r;var o=typeof e,i=typeof t;return"string"===o||"number"===o?"string"===i||"number"===i:"object"===i&&e.type===t.type&&e.key===t.key}},function(e,t,n){"use strict";var r={escape:function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})},unescape:function(e){var t={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(/(=0|=2)/g,function(e){return t[e]})}};e.exports=r},function(e,t,n){"use strict";var r=n(21),o=(n(65),n(143)),i=(n(53),n(58));n(15),n(23);function a(e){i.enqueueUpdate(e)}function s(e,t){var n=o.get(e);return n||null}var u={isMounted:function(e){var t=o.get(e);return!!t&&!!t._renderedComponent},enqueueCallback:function(e,t,n){u.validateCallback(t,n);var r=s(e);if(!r)return null;r._pendingCallbacks?r._pendingCallbacks.push(t):r._pendingCallbacks=[t],a(r)},enqueueCallbackInternal:function(e,t){e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],a(e)},enqueueForceUpdate:function(e){var t=s(e);t&&(t._pendingForceUpdate=!0,a(t))},enqueueReplaceState:function(e,t,n){var r=s(e);r&&(r._pendingStateQueue=[t],r._pendingReplaceState=!0,null!=n&&(u.validateCallback(n,"replaceState"),r._pendingCallbacks?r._pendingCallbacks.push(n):r._pendingCallbacks=[n]),a(r))},enqueueSetState:function(e,t){var n=s(e);n&&((n._pendingStateQueue||(n._pendingStateQueue=[])).push(t),a(n))},enqueueElementInternal:function(e,t,n){e._pendingElement=t,e._context=n,a(e)},validateCallback:function(e,t){e&&"function"!=typeof e&&r("122",t,function(e){var t=typeof e;if("object"!==t)return t;var n=e.constructor&&e.constructor.name||t,r=Object.keys(e);return r.length>0&&r.length<20?n+" (keys: "+r.join(", ")+")":n}(e))}};e.exports=u},function(e,t,n){"use strict";n(25);var r=n(57),o=(n(23),r);e.exports=o},function(e,t,n){"use strict";e.exports=function(e){var t,n=e.keyCode;return"charCode"in e?0===(t=e.charCode)&&13===n&&(t=13):t=n,t>=32||13===t?t:0}},function(e,t,n){var r=n(83),o=n(265),i=n(66),a="[object Object]",s=Function.prototype,u=Object.prototype,c=s.toString,l=u.hasOwnProperty,p=c.call(Object);e.exports=function(e){if(!i(e)||r(e)!=a)return!1;var t=o(e);if(null===t)return!0;var n=l.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==p}},function(e,t,n){var r=n(382)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){var r=n(376);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},function(e,t){ +/*! + * https://github.com/Starcounter-Jack/JSON-Patch + * (c) 2017 Joachim Wester + * MIT license */ -function r(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var a=document.createElement("div");a.setAttribute(n,"return;"),r="function"==typeof a[n]}return!r&&i&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var i,o=n(25);o.canUseDOM&&(i=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=r},function(e,t,n){"use strict";function r(e,t){var n=null===e||!1===e,r=null===t||!1===t;if(n||r)return n===r;var i=typeof e,o=typeof t;return"string"===i||"number"===i?"string"===o||"number"===o:"object"===o&&e.type===t.type&&e.key===t.key}e.exports=r},function(e,t,n){"use strict";var r=(n(13),n(32)),i=(n(10),r);e.exports=i},function(e,t,n){"use strict";function r(e){switch(e._type){case"Document":case"BlockQuote":case"List":case"Item":case"Paragraph":case"Heading":case"Emph":case"Strong":case"Link":case"Image":case"CustomInline":case"CustomBlock":return!0;default:return!1}}var i=function(e,t){this.current=e,this.entering=!0===t},o=function(){var e=this.current,t=this.entering;if(null===e)return null;var n=r(e);return t&&n?e._firstChild?(this.current=e._firstChild,this.entering=!0):this.entering=!1:e===this.root?this.current=null:null===e._next?(this.current=e._parent,this.entering=!1):(this.current=e._next,this.entering=!0),{entering:t,node:e}},a=function(e){return{current:e,root:e,entering:!0,next:o,resumeAt:i}},s=function(e,t){this._type=e,this._parent=null,this._firstChild=null,this._lastChild=null,this._prev=null,this._next=null,this._sourcepos=t,this._lastLineBlank=!1,this._open=!0,this._string_content=null,this._literal=null,this._listData={},this._info=null,this._destination=null,this._title=null,this._isFenced=!1,this._fenceChar=null,this._fenceLength=0,this._fenceOffset=null,this._level=null,this._onEnter=null,this._onExit=null},u=s.prototype;Object.defineProperty(u,"isContainer",{get:function(){return r(this)}}),Object.defineProperty(u,"type",{get:function(){return this._type}}),Object.defineProperty(u,"firstChild",{get:function(){return this._firstChild}}),Object.defineProperty(u,"lastChild",{get:function(){return this._lastChild}}),Object.defineProperty(u,"next",{get:function(){return this._next}}),Object.defineProperty(u,"prev",{get:function(){return this._prev}}),Object.defineProperty(u,"parent",{get:function(){return this._parent}}),Object.defineProperty(u,"sourcepos",{get:function(){return this._sourcepos}}),Object.defineProperty(u,"literal",{get:function(){return this._literal},set:function(e){this._literal=e}}),Object.defineProperty(u,"destination",{get:function(){return this._destination},set:function(e){this._destination=e}}),Object.defineProperty(u,"title",{get:function(){return this._title},set:function(e){this._title=e}}),Object.defineProperty(u,"info",{get:function(){return this._info},set:function(e){this._info=e}}),Object.defineProperty(u,"level",{get:function(){return this._level},set:function(e){this._level=e}}),Object.defineProperty(u,"listType",{get:function(){return this._listData.type},set:function(e){this._listData.type=e}}),Object.defineProperty(u,"listTight",{get:function(){return this._listData.tight},set:function(e){this._listData.tight=e}}),Object.defineProperty(u,"listStart",{get:function(){return this._listData.start},set:function(e){this._listData.start=e}}),Object.defineProperty(u,"listDelimiter",{get:function(){return this._listData.delimiter},set:function(e){this._listData.delimiter=e}}),Object.defineProperty(u,"onEnter",{get:function(){return this._onEnter},set:function(e){this._onEnter=e}}),Object.defineProperty(u,"onExit",{get:function(){return this._onExit},set:function(e){this._onExit=e}}),s.prototype.appendChild=function(e){e.unlink(),e._parent=this,this._lastChild?(this._lastChild._next=e,e._prev=this._lastChild,this._lastChild=e):(this._firstChild=e,this._lastChild=e)},s.prototype.prependChild=function(e){e.unlink(),e._parent=this,this._firstChild?(this._firstChild._prev=e,e._next=this._firstChild,this._firstChild=e):(this._firstChild=e,this._lastChild=e)},s.prototype.unlink=function(){this._prev?this._prev._next=this._next:this._parent&&(this._parent._firstChild=this._next),this._next?this._next._prev=this._prev:this._parent&&(this._parent._lastChild=this._prev),this._parent=null,this._next=null,this._prev=null},s.prototype.insertAfter=function(e){e.unlink(),e._next=this._next,e._next&&(e._next._prev=e),e._prev=this,this._next=e,e._parent=this._parent,e._next||(e._parent._lastChild=e)},s.prototype.insertBefore=function(e){e.unlink(),e._prev=this._prev,e._prev&&(e._prev._next=e),e._next=this,this._prev=e,e._parent=this._parent,e._prev||(e._parent._firstChild=e)},s.prototype.walker=function(){return new a(this)},e.exports=s},function(e,t,n){"use strict";function r(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=0);return t}t.__esModule=!0,t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(0!==n[r])return!1;var i="number"==typeof t[r]?t[r]:t[r].val;if(e[r]!==i)return!1}return!0}t.__esModule=!0,t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r,o,a,s){var u=-o*(t-r),l=-a*n,c=u+l,p=n+c*e,f=t+p*e;return Math.abs(p)<s&&Math.abs(f-r)<s?(i[0]=r,i[1]=0,i):(i[0]=f,i[1]=p,i)}t.__esModule=!0,t.default=r;var i=[0,0];e.exports=t.default},function(e,t,n){var r=n(1097),i=n(1);e.exports=function(e,t,n){var i=e[t];if(i){var o=[];if(Object.keys(i).forEach(function(e){-1===r.indexOf(e)&&o.push(e)}),o.length)throw new Error("Prop "+t+" passed to "+n+". Has invalid keys "+o.join(", "))}},e.exports.isRequired=function(t,n,r){if(!t[n])throw new Error("Prop "+n+" passed to "+r+" is required");return e.exports(t,n,r)},e.exports.supportingArrays=i.oneOfType([i.arrayOf(e.exports),e.exports])},function(e,t,n){"use strict";(function(t,r,i){function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){A(t,e)}}function a(e){return R.from(e)}function s(e){return R.isBuffer(e)||e instanceof j}function u(){}function l(e,t){O=O||n(71),e=e||{},this.objectMode=!!e.objectMode,t instanceof O&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var r=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){y(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function c(e){if(O=O||n(71),!(N.call(c,this)||this instanceof O))return new c(e);this._writableState=new l(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),I.call(this)}function p(e,t){var n=new Error("write after end");e.emit("error",n),D(t,n)}function f(e,t,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),D(r,o),i=!1),i}function h(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=R.from(t,n)),t}function d(e,t,n,r,i,o){if(!n){var a=h(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else m(e,t,!1,s,r,i,o);return u}function m(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function v(e,t,n,r,i){--t.pendingcb,n?(D(i,r),D(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),S(e,t))}function g(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function y(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(g(n),t)v(e,n,r,t,i);else{var o=w(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||x(e,n),r?M(_,e,n,o,i):_(e,n,o,i)}}function _(e,t,n,r){n||b(e,t),t.pendingcb--,r(),S(e,t)}function b(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function x(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var s=0,u=!0;n;)i[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;i.allBuffers=u,m(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t)}else{for(;n;){var l=n.chunk,c=n.encoding,p=n.callback;if(m(e,t,!1,t.objectMode?1:l.length,l,c,p),n=n.next,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=n,t.bufferProcessing=!1}function w(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),S(e,t)})}function E(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,D(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function S(e,t){var n=w(t);return n&&(E(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}function C(e,t,n){t.ending=!0,S(e,t),n&&(t.finished?D(n):e.once("finish",n)),t.ended=!0,e.writable=!1}function A(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}var D=n(158);e.exports=c;var O,M=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:D;c.WritableState=l;var T=n(111);T.inherits=n(42);var P={deprecate:n(1191)},I=n(482),R=n(167).Buffer,j=i.Uint8Array||function(){},F=n(481);T.inherits(c,I),l.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(l.prototype,"buffer",{get:P.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}();var N;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(N=Function.prototype[Symbol.hasInstance],Object.defineProperty(c,Symbol.hasInstance,{value:function(e){return!!N.call(this,e)||e&&e._writableState instanceof l}})):N=function(e){return e instanceof this},c.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},c.prototype.write=function(e,t,n){var r=this._writableState,i=!1,o=s(e)&&!r.objectMode;return o&&!R.isBuffer(e)&&(e=a(e)),"function"==typeof t&&(n=t,t=null),o?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=u),r.ended?p(this,n):(o||f(this,r,e,n))&&(r.pendingcb++,i=d(this,r,o,e,t,n)),i},c.prototype.cork=function(){this._writableState.corked++},c.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||x(this,e))},c.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},c.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},c.prototype._writev=null,c.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||C(this,r,n)},Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),c.prototype.destroy=F.destroy,c.prototype._undestroy=F.undestroy,c.prototype._destroy=function(e,t){this.end(),t(e)}}).call(t,n(33),n(496).setImmediate,n(17))},function(e,t,n){t=e.exports=n(479),t.Stream=t,t.Readable=t,t.Writable=n(261),t.Duplex=n(71),t.Transform=n(480),t.PassThrough=n(1111)},function(e,t,n){"use strict";function r(e,t,n,r,i){this.src=e,this.env=r,this.options=n,this.parser=t,this.tokens=i,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent="",this.labelUnmatchedScopes=0}r.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},r.prototype.push=function(e){this.pending&&this.pushPending(),this.tokens.push(e),this.pendingLevel=this.level},r.prototype.cacheSet=function(e,t){for(var n=this.cache.length;n<=e;n++)this.cache.push(0);this.cache[e]=t},r.prototype.cacheGet=function(e){return e<this.cache.length?this.cache[e]:0},e.exports=r},function(e,t,n){"use strict";function r(e,t){var n;return n=Array.isArray(e)?[]:{},t.push(e),Object.keys(e).forEach(function(i){var o=e[i];if("function"!=typeof o)return o&&"object"==typeof o?-1===t.indexOf(e[i])?void(n[i]=r(e[i],t.slice(0))):void(n[i]="[Circular]"):void(n[i]=o)}),n}e.exports=function(e){if("object"==typeof e){var t=r(e,[]);return"string"==typeof e.name&&(t.name=e.name),"string"==typeof e.message&&(t.message=e.message),"string"==typeof e.stack&&(t.stack=e.stack),t}return"function"==typeof e?"[Function: "+(e.name||"anonymous")+"]":e}},function(e,t,n){"use strict";function r(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function i(e){var t=r(e);if("string"!=typeof t&&(y.isEncoding===_||!_(e)))throw new Error("Unknown encoding: "+e);return t||e}function o(e){this.encoding=i(e);var t;switch(this.encoding){case"utf16le":this.text=f,this.end=h,t=4;break;case"utf8":this.fillLast=l,t=4;break;case"base64":this.text=d,this.end=m,t=3;break;default:return this.write=v,void(this.end=g)}this.lastNeed=0,this.lastTotal=0,this.lastChar=y.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:-1}function s(e,t,n){var r=t.length-1;if(r<n)return 0;var i=a(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n?0:(i=a(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n?0:(i=a(t[r]),i>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0)}function u(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�".repeat(n);if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�".repeat(n+1);if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�".repeat(n+2)}}function l(e){var t=this.lastTotal-this.lastNeed,n=u(this,e,t);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){var n=s(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�".repeat(this.lastTotal-this.lastNeed):t}function f(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function h(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function d(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function m(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function v(e){return e.toString(this.encoding)}function g(e){return e&&e.length?this.write(e):""}var y=n(167).Buffer,_=y.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},o.prototype.end=p,o.prototype.text=c,o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){(function(){var e,t,r,i=function(e,t){function n(){this.constructor=e}for(var r in t)o.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},o={}.hasOwnProperty,a=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1};t=n(94),r=n(61),e=n(45).YAMLError,this.ResolverError=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return i(t,e),t}(e),this.BaseResolver=function(){function e(){this.resolver_exact_paths=[],this.resolver_prefix_paths=[]}var n,i,o;return i="tag:yaml.org,2002:str",o="tag:yaml.org,2002:seq",n="tag:yaml.org,2002:map",e.prototype.yaml_implicit_resolvers={},e.prototype.yaml_path_resolvers={},e.add_implicit_resolver=function(e,t,n){var i,o,a,s,u;for(null==n&&(n=[null]),this.prototype.hasOwnProperty("yaml_implicit_resolvers")||(this.prototype.yaml_implicit_resolvers=r.extend({},this.prototype.yaml_implicit_resolvers)),u=[],a=0,s=n.length;a<s;a++)o=n[a],u.push((null!=(i=this.prototype.yaml_implicit_resolvers)[o]?i[o]:i[o]=[]).push([e,t]));return u},e.prototype.descend_resolver=function(e,t){var n,i,o,a,s,u,l,c,p,f,h,d,m;if(!r.is_empty(this.yaml_path_resolvers)){if(i={},p=[],e)for(n=this.resolver_prefix_paths.length,f=this.resolver_prefix_paths.slice(-1)[0],o=0,u=f.length;o<u;o++)h=f[o],c=h[0],s=h[1],this.check_resolver_prefix(n,c,s,e,t)&&(c.length>n?p.push([c,s]):i[s]=this.yaml_path_resolvers[c][s]);else for(d=this.yaml_path_resolvers,a=0,l=d.length;a<l;a++)m=d[a],c=m[0],s=m[1],c?p.push([c,s]):i[s]=this.yaml_path_resolvers[c][s];return this.resolver_exact_paths.push(i),this.resolver_prefix_paths.push(p)}},e.prototype.ascend_resolver=function(){if(!r.is_empty(this.yaml_path_resolvers))return this.resolver_exact_paths.pop(),this.resolver_prefix_paths.pop()},e.prototype.check_resolver_prefix=function(e,n,r,i,o){var a,s,u;if(u=n[e-1],s=u[0],a=u[1],"string"==typeof s){if(i.tag!==s)return}else if(null!==s&&!(i instanceof s))return;if((!0!==a||null===o)&&(!1!==a&&null!==a||null!==o)){if("string"==typeof a){if(!(o instanceof t.ScalarNode)&&a===o.value)return}else if("number"==typeof a&&a!==o)return;return!0}},e.prototype.resolve=function(e,r,s){var u,l,c,p,f,h,d,m,v,g,y,_;if(e===t.ScalarNode&&s[0]){for(y=""===r?null!=(h=this.yaml_implicit_resolvers[""])?h:[]:null!=(d=this.yaml_implicit_resolvers[r[0]])?d:[],y=y.concat(null!=(m=this.yaml_implicit_resolvers[null])?m:[]),c=0,f=y.length;c<f;c++)if(v=y[c],_=v[0],g=v[1],r.match(g))return _;s=s[1]}u=!0;for(p in this.yaml_path_resolvers)null=={}[p]&&(u=!1);if(!u){if(l=this.resolver_exact_paths.slice(-1)[0],a.call(l,e)>=0)return l[e];if(a.call(l,null)>=0)return l[null]}return e===t.ScalarNode?i:e===t.SequenceNode?o:e===t.MappingNode?n:void 0},e}(),this.Resolver=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return i(t,e),t}(this.BaseResolver),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:bool",/^(?:yes|Yes|YES|true|True|TRUE|on|On|ON|no|No|NO|false|False|FALSE|off|Off|OFF)$/,"yYnNtTfFoO"),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:float",/^(?:[-+]?(?:[0-9][0-9_]*)\.[0-9_]*(?:[eE][-+][0-9]+)?|\.[0-9_]+(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*|[-+]?\.(?:inf|Inf|INF)|\.(?:nan|NaN|NAN))$/,"-+0123456789."),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:int",/^(?:[-+]?0b[01_]+|[-+]?0[0-7_]+|[-+]?(?:0|[1-9][0-9_]*)|[-+]?0x[0-9a-fA-F_]+|[-+]?0o[0-7_]+|[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)$/,"-+0123456789"),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:merge",/^(?:<<)$/,"<"),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:null",/^(?:~|null|Null|NULL|)$/,["~","n","N",""]),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:timestamp",/^(?:[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]|[0-9][0-9][0-9][0-9]-[0-9][0-9]?-[0-9][0-9]?(?:[Tt]|[\x20\t]+)[0-9][0-9]?:[0-9][0-9]:[0-9][0-9](?:\.[0-9]*)?(?:[\x20\t]*(?:Z|[-+][0-9][0-9]?(?::[0-9][0-9])?))?)$/,"0123456789"),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:value",/^(?:=)$/,"="),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:yaml",/^(?:!|&|\*)$/,"!&*")}).call(this)},function(e,t){(function(){var e=function(e,n){function r(){this.constructor=e}for(var i in n)t.call(n,i)&&(e[i]=n[i]);return r.prototype=n.prototype,e.prototype=new r,e.__super__=n.prototype,e},t={}.hasOwnProperty;this.Token=function(){function e(e,t){this.start_mark=e,this.end_mark=t}return e}(),this.DirectiveToken=function(t){function n(e,t,n,r){this.name=e,this.value=t,this.start_mark=n,this.end_mark=r}return e(n,t),n.prototype.id="<directive>",n}(this.Token),this.DocumentStartToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="<document start>",n}(this.Token),this.DocumentEndToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="<document end>",n}(this.Token),this.StreamStartToken=function(t){function n(e,t,n){this.start_mark=e,this.end_mark=t,this.encoding=n}return e(n,t),n.prototype.id="<stream start>",n}(this.Token),this.StreamEndToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="<stream end>",n}(this.Token),this.BlockSequenceStartToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="<block sequence start>",n}(this.Token),this.BlockMappingStartToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="<block mapping end>",n}(this.Token),this.BlockEndToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="<block end>",n}(this.Token),this.FlowSequenceStartToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="[",n}(this.Token),this.FlowMappingStartToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="{",n}(this.Token),this.FlowSequenceEndToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="]",n}(this.Token),this.FlowMappingEndToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="}",n}(this.Token),this.KeyToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="?",n}(this.Token),this.ValueToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id=":",n}(this.Token),this.BlockEntryToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="-",n}(this.Token),this.FlowEntryToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id=",",n}(this.Token),this.AliasToken=function(t){function n(e,t,n){this.value=e,this.start_mark=t,this.end_mark=n}return e(n,t),n.prototype.id="<alias>",n}(this.Token),this.AnchorToken=function(t){function n(e,t,n){this.value=e,this.start_mark=t,this.end_mark=n}return e(n,t),n.prototype.id="<anchor>",n}(this.Token),this.TagToken=function(t){function n(e,t,n){this.value=e,this.start_mark=t,this.end_mark=n}return e(n,t),n.prototype.id="<tag>",n}(this.Token),this.ScalarToken=function(t){function n(e,t,n,r,i){this.value=e,this.plain=t,this.start_mark=n,this.end_mark=r,this.style=i}return e(n,t),n.prototype.id="<scalar>",n}(this.Token)}).call(this)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(function(e){return!!e}).join(" ").trim()}Object.defineProperty(t,"__esModule",{value:!0}),t.Collapse=t.Link=t.Select=t.Input=t.TextArea=t.Button=t.Row=t.Col=t.Container=void 0;var o=n(21),a=r(o),s=n(96),u=r(s),l=n(4),c=r(l),p=n(2),f=r(p),h=n(3),d=r(h),m=n(6),v=r(m),g=n(5),y=r(g),_=n(0),b=r(_),x=n(1),w=r(x),k=n(448);(t.Container=function(e){function t(){return(0,f.default)(this,t),(0,v.default)(this,(t.__proto__||(0,c.default)(t)).apply(this,arguments))}return(0,y.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e=this.props,t=e.fullscreen,n=e.full,r=(0,u.default)(e,["fullscreen","full"]);if(t)return b.default.createElement("section",r);var o="swagger-container"+(n?"-full":"");return b.default.createElement("section",(0,a.default)({},r,{className:i(r.className,o)}))}}]),t}(b.default.Component)).propTypes={fullscreen:w.default.bool,full:w.default.bool,className:w.default.string};var E={mobile:"",tablet:"-tablet",desktop:"-desktop",large:"-hd"};(t.Col=function(e){function t(){return(0,f.default)(this,t),(0,v.default)(this,(t.__proto__||(0,c.default)(t)).apply(this,arguments))}return(0,y.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e=this.props,t=e.hide,n=e.keepContents,r=(e.mobile,e.tablet,e.desktop,e.large,(0,u.default)(e,["hide","keepContents","mobile","tablet","desktop","large"]));if(t&&!n)return b.default.createElement("span",null);var o=[];for(var s in E)if(E.hasOwnProperty(s)){var l=E[s];if(s in this.props){var c=this.props[s];if(c<1){o.push("none"+l);continue}o.push("block"+l),o.push("col-"+c+l)}}var p=i.apply(void 0,[r.className].concat(o));return b.default.createElement("section",(0,a.default)({},r,{style:{display:t?"none":null},className:p}))}}]),t}(b.default.Component)).propTypes={hide:w.default.bool,keepContents:w.default.bool,mobile:w.default.number,tablet:w.default.number,desktop:w.default.number,large:w.default.number,className:w.default.string},(t.Row=function(e){function t(){return(0,f.default)(this,t),(0,v.default)(this,(t.__proto__||(0,c.default)(t)).apply(this,arguments))}return(0,y.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){return b.default.createElement("div",(0,a.default)({},this.props,{className:i(this.props.className,"wrapper")}))}}]),t}(b.default.Component)).propTypes={className:w.default.string};var S=t.Button=function(e){function t(){return(0,f.default)(this,t),(0,v.default)(this,(t.__proto__||(0,c.default)(t)).apply(this,arguments))}return(0,y.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){return b.default.createElement("button",(0,a.default)({},this.props,{className:i(this.props.className,"button")}))}}]),t}(b.default.Component);S.propTypes={className:w.default.string},S.defaultProps={className:""};var C=(t.TextArea=function(e){return b.default.createElement("textarea",e)},t.Input=function(e){return b.default.createElement("input",e)},t.Select=function(e){function t(e,n){(0,f.default)(this,t);var r=(0,v.default)(this,(t.__proto__||(0,c.default)(t)).call(this,e,n));A.call(r);var i=void 0;return i=e.value?e.value:e.multiple?[""]:"",r.state={value:i},r}return(0,y.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e=this.props,t=e.allowedValues,n=e.multiple,r=e.allowEmptyValue,i=this.state.value.toJS?this.state.value.toJS():this.state.value;return b.default.createElement("select",{className:this.props.className,multiple:n,value:i,onChange:this.onChange},r?b.default.createElement("option",{value:""},"--"):null,t.map(function(e,t){return b.default.createElement("option",{key:t,value:String(e)},String(e))}))}}]),t}(b.default.Component));C.propTypes={allowedValues:w.default.array,value:w.default.any,onChange:w.default.func,multiple:w.default.bool,allowEmptyValue:w.default.bool,className:w.default.string},C.defaultProps={multiple:!1,allowEmptyValue:!0};var A=function(){var e=this;this.onChange=function(t){var n=e.props,r=n.onChange,i=n.multiple,o=[].slice.call(t.target.options),a=void 0;a=i?o.filter(function(e){return e.selected}).map(function(e){return e.value}):t.target.value,e.setState({value:a}),r&&r(a)}};(t.Link=function(e){function t(){return(0,f.default)(this,t),(0,v.default)(this,(t.__proto__||(0,c.default)(t)).apply(this,arguments))}return(0,y.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){return b.default.createElement("a",(0,a.default)({},this.props,{className:i(this.props.className,"link")}))}}]),t}(b.default.Component)).propTypes={className:w.default.string};var D=function(e){var t=e.children;return b.default.createElement("div",{style:{height:"auto",border:"none",margin:0,padding:0}}," ",t," ")};D.propTypes={children:w.default.node};var O=t.Collapse=function(e){function t(){return(0,f.default)(this,t),(0,v.default)(this,(t.__proto__||(0,c.default)(t)).apply(this,arguments))}return(0,y.default)(t,e),(0,d.default)(t,[{key:"renderNotAnimated",value:function(){return this.props.isOpened?b.default.createElement(D,null,this.props.children):b.default.createElement("noscript",null)}},{key:"render",value:function(){var e=this.props,t=e.animated,n=e.isOpened,r=e.children;return t?(r=n?r:null,b.default.createElement(k.Collapse,{isOpened:n},b.default.createElement(D,null,r))):this.renderNotAnimated()}}]),t}(b.default.Component);O.propTypes={isOpened:w.default.bool,children:w.default.node.isRequired,animated:w.default.bool},O.defaultProps={isOpened:!1,animated:!1}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1072),_=r(y),b=n(12),x=r(b),w=n(1),k=r(w),E=function(e){function t(){var e,n,r,i;(0,l.default)(this,t);for(var o=arguments.length,a=Array(o),u=0;u<o;u++)a[u]=arguments[u];return n=r=(0,h.default)(this,(e=t.__proto__||(0,s.default)(t)).call.apply(e,[this].concat(a))),r.getModelName=function(e){return-1!==e.indexOf("#/definitions/")?e.replace(/^.*#\/definitions\//,""):-1!==e.indexOf("#/components/schemas/")?e.replace("#/components/schemas/",""):void 0},r.getRefSchema=function(e){return r.props.specSelectors.findDefinition(e)},i=n,(0,h.default)(r,i)}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.getConfigs,r=e.specSelectors,i=e.schema,a=e.required,s=e.name,u=e.isRef,l=e.specPath,c=t("ObjectModel"),p=t("ArrayModel"),f=t("PrimitiveModel"),h="object",d=i&&i.get("$$ref");!s&&d&&(s=this.getModelName(d)),!i&&d&&(i=this.getRefSchema(s));var m=r.isOAS3()&&i.get("deprecated");switch(u=void 0!==u?u:!!d,h=i&&i.get("type")||h){case"object":return g.default.createElement(c,(0,o.default)({className:"object"},this.props,{specPath:l,getConfigs:n,schema:i,name:s,deprecated:m,isRef:u}));case"array":return g.default.createElement(p,(0,o.default)({className:"array"},this.props,{getConfigs:n,schema:i,name:s,deprecated:m,required:a}));case"string":case"number":case"integer":case"boolean":default:return g.default.createElement(f,(0,o.default)({},this.props,{getComponent:t,getConfigs:n,schema:i,name:s,deprecated:m,required:a}))}}}]),t}(_.default);E.propTypes={schema:x.default.orderedMap.isRequired,getComponent:k.default.func.isRequired,getConfigs:k.default.func.isRequired,specSelectors:k.default.object.isRequired,name:k.default.string,isRef:k.default.bool,required:k.default.bool,expandDepth:k.default.number,depth:k.default.number,specPath:x.default.list.isRequired},t.default=E},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.source,n=new h.default({html:!0,typographer:!0,breaks:!0,linkify:!0,linkTarget:"_blank"}).render(t),r=o(n);return t&&n&&r?l.default.createElement("div",{className:"markdown",dangerouslySetInnerHTML:{__html:r}}):null}function o(e){return(0,m.default)(e,v)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(21),s=r(a);t.sanitizer=o;var u=n(0),l=r(u),c=n(1),p=r(c),f=n(1126),h=r(f),d=n(1179),m=r(d);i.propTypes={source:p.default.string.isRequired},t.default=i;var v={allowedTags:m.default.defaults.allowedTags.concat(["h1","h2","img","span"]),allowedAttributes:(0,s.default)({},m.default.defaults.allowedAttributes,{img:m.default.defaults.allowedAttributes.img.concat(["title"]),td:["colspan"],"*":["class"]}),textFilter:function(e){return e.replace(/"/g,'"')}}},function(e,t,n){"use strict";var r=n(9),i=n(1208);i.keys().forEach(function(t){if("./index.js"!==t){var n=i(t);e.exports[(0,r.pascalCaseFilename)(t)]=n.default?n.default:n}})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){function n(e,t,i){if(!e)return i&&i.start_mark?i.start_mark.line:0;if(t.length&&e.tag===b)for(r=0;r<e.value.length;r++){var o=e.value[r],a=o[0],s=o[1];if(a.value===t[0])return n(s,t.slice(1),e);if(a.value===t[0].replace(/\[.*/,"")){var u=parseInt(t[0].match(/\[(.*)\]/)[1]);if(1===s.value.length&&0!==u&&u)var l=(0,g.default)(s.value[0],{value:u.toString()});else var l=s.value[u];return n(l,t.slice(1),s.value)}}if(t.length&&e.tag===x){var c=e.value[t[0]];if(c&&c.tag)return n(c,t.slice(1),e.value)}return e.tag!==b||Array.isArray(i)?e.start_mark.line+1:e.start_mark.line}if("string"!=typeof e)throw new TypeError("yaml should be a string");if(!(0,m.default)(t))throw new TypeError("path should be an array of strings");var r=0;return n(_(e),t)}function o(e,t){function n(e,o){if(e.tag===b)for(i=0;i<e.value.length;i++){var a=e.value[i],s=a[0],u=a[1];if(s.value===t[0])return t.shift(),n(u,s)}if(e.tag===x){var l=e.value[t[0]];if(l&&l.tag)return t.shift(),n(l,o)}if(t.length)return r;var c={start:{line:e.start_mark.line,column:e.start_mark.column,pointer:e.start_mark.pointer},end:{line:e.end_mark.line,column:e.end_mark.column,pointer:e.end_mark.pointer}};return o&&(c.key_start={line:o.start_mark.line,column:o.start_mark.column,pointer:o.start_mark.pointer},c.key_end={line:o.end_mark.line,column:o.end_mark.column,pointer:o.end_mark.pointer}),c}if("string"!=typeof e)throw new TypeError("yaml should be a string");if(!(0,m.default)(t))throw new TypeError("path should be an array of strings");var r={start:{line:-1,column:-1},end:{line:-1,column:-1}},i=0;return n(_(e))}function a(e,t){function n(e){function r(e){return e.start_mark.line===e.end_mark.line?t.line===e.start_mark.line&&e.start_mark.column<=t.column&&e.end_mark.column>=t.column:t.line===e.start_mark.line?t.column>=e.start_mark.column:t.line===e.end_mark.line?t.column<=e.end_mark.column:e.start_mark.line<t.line&&e.end_mark.line>t.line}var o=0;if(!e||-1===[b,x].indexOf(e.tag))return i;if(e.tag===b)for(o=0;o<e.value.length;o++){var a=e.value[o],s=a[0],u=a[1];if(r(s))return i;if(r(u))return i.push(s.value),n(u)}if(e.tag===x)for(o=0;o<e.value.length;o++){var l=e.value[o];if(r(l))return i.push(o.toString()),n(l)}return i}if("string"!=typeof e)throw new TypeError("yaml should be a string");if("object"!==(void 0===t?"undefined":(0,p.default)(t))||"number"!=typeof t.line||"number"!=typeof t.column)throw new TypeError("position should be an object with line and column properties");try{var r=_(e)}catch(n){return console.error("Error composing AST",n),console.error("Problem area:\n",e.split("\n").slice(t.line-5,t.line+5).join("\n")),null}var i=[];return n(r)}function s(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return new l.default(function(t){return t(e.apply(void 0,n))})}}Object.defineProperty(t,"__esModule",{value:!0}),t.getLineNumberForPathAsync=t.positionRangeForPathAsync=t.pathForPositionAsync=void 0;var u=n(332),l=r(u),c=n(48),p=r(c);t.getLineNumberForPath=i,t.positionRangeForPath=o,t.pathForPosition=a;var f=n(1206),h=r(f),d=n(20),m=r(d),v=n(223),g=r(v),y=n(9),_=(0,y.memoize)(h.default.compose),b="tag:yaml.org,2002:map",x="tag:yaml.org,2002:seq";t.pathForPositionAsync=s(a),t.positionRangeForPathAsync=s(o),t.getLineNumberForPathAsync=s(i)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{fn:{AST:i},components:{JumpToPath:a.default}}};var r=n(272),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(r),o=n(274),a=function(e){return e&&e.__esModule?e:{default:e}}(o)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){return null}}]),t}(m.default.Component);t.default=v},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{afterLoad:function(e){this.rootInjects=this.rootInjects||{},this.rootInjects.initOAuth=e.authActions.configureAuth},statePlugins:{auth:{reducers:o.default,actions:s,selectors:l},spec:{wrapActions:p}}}};var i=n(276),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(168),s=r(a),u=n(277),l=r(u),c=n(278),p=r(c)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(36),a=r(o),s=n(30),u=r(s),l=n(18),c=r(l),p=n(7),f=n(9),h=n(168);t.default=(i={},(0,a.default)(i,h.SHOW_AUTH_POPUP,function(e,t){var n=t.payload;return e.set("showDefinitions",n)}),(0,a.default)(i,h.AUTHORIZE,function(e,t){var n=t.payload,r=(0,p.fromJS)(n),i=e.get("authorized")||(0,p.Map)();return r.entrySeq().forEach(function(e){var t=(0,c.default)(e,2),n=t[0],r=t[1],o=r.getIn(["schema","type"]);if("apiKey"===o||"http"===o)i=i.set(n,r);else if("basic"===o){var a=r.getIn(["value","username"]),s=r.getIn(["value","password"]);i=i.setIn([n,"value"],{username:a,header:"Basic "+(0,f.btoa)(a+":"+s)}),i=i.setIn([n,"schema"],r.get("schema"))}}),e.set("authorized",i)}),(0,a.default)(i,h.AUTHORIZE_OAUTH2,function(e,t){var n=t.payload,r=n.auth,i=n.token,o=void 0;return r.token=(0,u.default)({},i),o=(0,p.fromJS)(r),e.setIn(["authorized",o.get("name")],o)}),(0,a.default)(i,h.LOGOUT,function(e,t){var n=t.payload,r=e.get("authorized").withMutations(function(e){n.forEach(function(t){e.delete(t)})});return e.set("authorized",r)}),(0,a.default)(i,h.CONFIGURE_AUTH,function(e,t){var n=t.payload;return e.set("configs",n)}),i)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.getConfigs=t.isAuthorized=t.authorized=t.definitionsForRequirements=t.getDefinitionsByNames=t.definitionsToAuthorize=t.shownDefinitions=void 0;var i=n(47),o=r(i),a=n(18),s=r(a),u=n(60),l=n(7),c=function(e){return e};t.shownDefinitions=(0,u.createSelector)(c,function(e){return e.get("showDefinitions")}),t.definitionsToAuthorize=(0,u.createSelector)(c,function(){return function(e){var t=e.specSelectors,n=t.securityDefinitions()||(0,l.Map)({}),r=(0,l.List)();return n.entrySeq().forEach(function(e){var t=(0,s.default)(e,2),n=t[0],i=t[1],o=(0,l.Map)();o=o.set(n,i),r=r.push(o)}),r}}),t.getDefinitionsByNames=function(e,t){return function(e){var n=e.specSelectors;console.warn("WARNING: getDefinitionsByNames is deprecated and will be removed in the next major version.");var r=n.securityDefinitions(),i=(0,l.List)();return t.valueSeq().forEach(function(e){var t=(0,l.Map)();e.entrySeq().forEach(function(e){var n=(0,s.default)(e,2),i=n[0],o=n[1],a=r.get(i),u=void 0;"oauth2"===a.get("type")&&o.size&&(u=a.get("scopes"),u.keySeq().forEach(function(e){o.contains(e)||(u=u.delete(e))}),a=a.set("allowedScopes",u)),t=t.set(i,a)}),i=i.push(t)}),i}},t.definitionsForRequirements=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,l.List)();return function(e){return(e.authSelectors.definitionsToAuthorize()||(0,l.List)()).filter(function(e){return t.some(function(t){return t.get(e.keySeq().first())})})}},t.authorized=(0,u.createSelector)(c,function(e){return e.get("authorized")||(0,l.Map)()}),t.isAuthorized=function(e,t){return function(e){var n=e.authSelectors,r=n.authorized();return l.List.isList(t)?!!t.toJS().filter(function(e){return-1===(0,o.default)(e).map(function(e){return!!r.get(e)}).indexOf(!1)}).length:null}},t.getConfigs=(0,u.createSelector)(c,function(e){return e.get("configs")})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.execute=void 0;var r=n(21),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.execute=function(e,t){var n=t.authSelectors,r=t.specSelectors;return function(t){var o=t.path,a=t.method,s=t.operation,u=t.extras,l={authorized:n.authorized()&&n.authorized().toJS(),definitions:r.securityDefinitions()&&r.securityDefinitions().toJS(),specSecurity:r.security()&&r.security().toJS()};return e((0,i.default)({path:o,method:a,operation:s,securities:l},u))}}},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function o(){return{statePlugins:{spec:{actions:g,selectors:y},configs:{reducers:m.default,actions:p,selectors:h}}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var a=n(211),s=i(a),u=n(1007),l=i(u),c=n(169),p=r(c),f=n(281),h=r(f),d=n(280),m=i(d),v=function(e,t){try{return s.default.safeLoad(e)}catch(e){return t&&t.errActions.newThrownErr(new Error(e)),{}}},g={downloadConfig:function(e){return function(t){return(0,t.fn.fetch)(e)}},getConfigByUrl:function(e,t){return function(n){function r(n){n instanceof Error||n.status>=400?(i.updateLoadingStatus("failedConfig"),i.updateLoadingStatus("failedConfig"),i.updateUrl(""),console.error(n.statusText+" "+e),t(null)):t(v(n.text))}var i=n.specActions;if(e)return i.downloadConfig(e).then(r,r)}}},y={getLocalConfig:function(){return v(l.default)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(36),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(7),s=n(169);t.default=(r={},(0,o.default)(r,s.UPDATE_CONFIGS,function(e,t){return e.merge((0,a.fromJS)(t.payload))}),(0,o.default)(r,s.TOGGLE_CONFIGS,function(e,t){var n=t.payload,r=e.get(n);return e.set(n,!r)}),r)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.get=function(e,t){return e.getIn(Array.isArray(t)?t:[t])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.setHash=function(e){return e?history.pushState(null,null,"#"+e):window.location.hash=""}},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{statePlugins:{spec:{wrapActions:o},layout:{wrapActions:s}}}};var i=n(285),o=r(i),a=n(284),s=r(a)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.show=void 0;var r=n(18),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(282),a=n(9);t.show=function(e,t){var n=t.getConfigs;return function(){for(var t=arguments.length,r=Array(t),s=0;s<t;s++)r[s]=arguments[s];e.apply(void 0,r);var u=n().deepLinking;if(u&&"false"!==u)try{var l=r[0],c=r[1],p=(0,i.default)(l,1),f=p[0];if("operations-tag"===f||"operations"===f){if(!c)return(0,o.setHash)("/");if("operations"===f){var h=(0,i.default)(l,3),d=h[1],m=h[2];(0,o.setHash)("/"+(0,a.createDeepLinkPath)(d)+"/"+(0,a.createDeepLinkPath)(m))}if("operations-tag"===f){var v=(0,i.default)(l,2),g=v[1];(0,o.setHash)("/"+(0,a.createDeepLinkPath)(g))}}}catch(e){console.error(e)}}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.updateResolved=void 0;var i=n(18),o=r(i),a=n(1207),s=r(a),u=n(9),l=!1;t.updateResolved=function(e,t){var n=t.layoutActions,r=t.getConfigs;return function(){e.apply(void 0,arguments);var t=r().deepLinking;if(t&&"false"!==t){if(window.location.hash&&!l){var i=window.location.hash.slice(1);"!"===i[0]&&(i=i.slice(1)),"/"===i[0]&&(i=i.slice(1));var a=i.split("/"),c=(0,o.default)(a,2),p=c[0],f=c[1],h=document.querySelector(".swagger-ui"),d=s.default.createScroller(h),m=void 0;p&&f?(n.show(["operations-tag",p],!0),n.show(["operations",p,f],!0),m=document.getElementById("operations-"+(0,u.escapeDeepLinkPath)(p)+"-"+(0,u.escapeDeepLinkPath)(f))):p&&(n.show(["operations-tag",p],!0),m=document.getElementById("operations-tag-"+(0,u.escapeDeepLinkPath)(p))),m&&(d.to(m),setTimeout(function(){0===s.default.getY()&&s.default.to(m)},50))}l=!0}}}},function(e,t,n){"use strict";function r(e){var t=e.fn;return{statePlugins:{spec:{actions:{download:function(e){return function(n){function r(t){if(t instanceof Error||t.status>=400)return a.updateLoadingStatus("failed"),i.newThrownErr(new Error((t.message||t.statusText)+" "+e));a.updateLoadingStatus("success"),a.updateSpec(t.text),a.updateUrl(e)}var i=n.errActions,o=n.specSelectors,a=n.specActions,s=n.getConfigs,u=t.fetch,l=s();e=e||o.url(),a.updateLoadingStatus("loading"),u({url:e,loadSpec:!0,requestInterceptor:l.requestInterceptor||function(e){return e},responseInterceptor:l.responseInterceptor||function(e){return e},credentials:"same-origin",headers:{Accept:"application/json,*/*"}}).then(r,r)}},updateLoadingStatus:function(e){var t=[null,"loading","failed","success","failedConfig"];return-1===t.indexOf(e)&&console.error("Error: "+e+" is not one of "+(0,o.default)(t)),{type:"spec_update_loading_status",payload:e}}},reducers:{spec_update_loading_status:function(e,t){return"string"==typeof t.payload?e.set("loadingStatus",t.payload):e}},selectors:{loadingStatus:(0,a.createSelector)(function(e){return e||(0,s.Map)()},function(e){return e.get("loadingStatus")||null})}}}}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(35),o=function(e){return e&&e.__esModule?e:{default:e}}(i);t.default=r;var a=n(60),s=n(7)},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e,t){var n={jsSpec:t.specSelectors.specJson().toJS()};return(0,a.default)(h,function(e,t){try{return t.transform(e,n).filter(function(e){return!!e})}catch(t){return console.error("Transformer error:",t),e}},e).filter(function(e){return!!e}).map(function(e){return!e.get("line")&&e.get("path"),e})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var o=n(953),a=function(e){return e&&e.__esModule?e:{default:e}}(o),s=n(288),u=r(s),l=n(289),c=r(l),p=n(290),f=r(p),h=[u,c,f]},function(e,t,n){"use strict";function r(e){return e.map(function(e){var t=e.get("message").indexOf("is not of a type(s)");if(t>-1){var n=e.get("message").slice(t+"is not of a type(s)".length).split(",");return e.set("message",e.get("message").slice(0,t)+i(n))}return e})}function i(e){return e.reduce(function(e,t,n,r){return n===r.length-1&&r.length>1?e+"or "+t:r[n+1]&&r.length>2?e+t+", ":r[n+1]?e+t+" ":e+t},"should be a")}Object.defineProperty(t,"__esModule",{value:!0}),t.transform=r},function(e,t,n){"use strict";function r(e,t){t.jsSpec;return e}Object.defineProperty(t,"__esModule",{value:!0}),t.transform=r;var i=n(224);(function(e){e&&e.__esModule})(i),n(7)},function(e,t,n){"use strict";function r(e){return e.map(function(e){return e.set("message",i(e.get("message"),"instance."))})}function i(e,t){return e.replace(new RegExp(t,"g"),"")}Object.defineProperty(t,"__esModule",{value:!0}),t.transform=r},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{statePlugins:{err:{reducers:(0,o.default)(e),actions:s,selectors:l}}}};var i=n(292),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(128),s=r(a),u=n(293),l=r(u)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(36),o=r(i),a=n(30),s=r(a);t.default=function(e){var t;return t={},(0,o.default)(t,u.NEW_THROWN_ERR,function(t,n){var r=n.payload,i=(0,s.default)(m,r,{type:"thrown"});return t.update("errors",function(e){return(e||(0,p.List)()).push((0,p.fromJS)(i))}).update("errors",function(t){return(0,d.default)(t,e.getSystem())})}),(0,o.default)(t,u.NEW_THROWN_ERR_BATCH,function(t,n){var r=n.payload;return r=r.map(function(e){return(0,p.fromJS)((0,s.default)(m,e,{type:"thrown"}))}),t.update("errors",function(e){return(e||(0,p.List)()).concat((0,p.fromJS)(r))}).update("errors",function(t){return(0,d.default)(t,e.getSystem())})}),(0,o.default)(t,u.NEW_SPEC_ERR,function(t,n){var r=n.payload,i=(0,p.fromJS)(r);return i=i.set("type","spec"),t.update("errors",function(e){return(e||(0,p.List)()).push((0,p.fromJS)(i)).sortBy(function(e){return e.get("line")})}).update("errors",function(t){return(0,d.default)(t,e.getSystem())})}),(0,o.default)(t,u.NEW_SPEC_ERR_BATCH,function(t,n){var r=n.payload;return r=r.map(function(e){return(0,p.fromJS)((0,s.default)(m,e,{type:"spec"}))}),t.update("errors",function(e){return(e||(0,p.List)()).concat((0,p.fromJS)(r))}).update("errors",function(t){return(0,d.default)(t,e.getSystem())})}),(0,o.default)(t,u.NEW_AUTH_ERR,function(t,n){var r=n.payload,i=(0,p.fromJS)((0,s.default)({},r));return i=i.set("type","auth"),t.update("errors",function(e){return(e||(0,p.List)()).push((0,p.fromJS)(i))}).update("errors",function(t){return(0,d.default)(t,e.getSystem())})}),(0,o.default)(t,u.CLEAR,function(e,t){var n=t.payload;if(n){var r=f.default.fromJS((0,c.default)((e.get("errors")||(0,p.List)()).toJS(),n));return e.merge({errors:r})}}),t};var u=n(128),l=n(954),c=r(l),p=n(7),f=r(p),h=n(287),d=r(h),m={line:0,level:"error",message:"Unknown error"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lastError=t.allErrors=void 0;var r=n(7),i=n(60),o=function(e){return e},a=t.allErrors=(0,i.createSelector)(o,function(e){return e.get("errors",(0,r.List)())});t.lastError=(0,i.createSelector)(a,function(e){return e.last()})},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{statePlugins:{layout:{reducers:o.default,actions:s,selectors:l}}}};var i=n(295),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(170),s=r(a),u=n(296),l=r(u)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(36),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(7),s=n(170);t.default=(r={},(0,o.default)(r,s.UPDATE_LAYOUT,function(e,t){return e.set("layout",t.payload)}),(0,o.default)(r,s.UPDATE_FILTER,function(e,t){return e.set("filter",t.payload)}),(0,o.default)(r,s.SHOW,function(e,t){var n=t.payload.shown,r=(0,a.fromJS)(t.payload.thing);return e.update("shown",(0,a.fromJS)({}),function(e){return e.set(r,n)})}),(0,o.default)(r,s.UPDATE_MODE,function(e,t){var n=t.payload.thing,r=t.payload.mode;return e.setIn(["modes"].concat(n),(r||"")+"")}),r)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.showSummary=t.whatMode=t.isShown=t.currentFilter=t.current=void 0;var r=n(97),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(60),a=n(9),s=n(7),u=function(e){return e},l=(t.current=function(e){return e.get("layout")},t.currentFilter=function(e){return e.get("filter")},t.isShown=function(e,t,n){return t=(0,a.normalizeArray)(t),e.get("shown",(0,s.fromJS)({})).get((0,s.fromJS)(t),n)});t.whatMode=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t=(0,a.normalizeArray)(t),e.getIn(["modes"].concat((0,i.default)(t)),n)},t.showSummary=(0,o.createSelector)(u,function(e){return!l(e,"editor")})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(e){for(var t,n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];i(e)>=a&&(t=console)[e].apply(t,r)}var n=e.configs,r={debug:0,info:1,log:2,warn:3,error:4},i=function(e){return r[e]||-1},o=n.logLevel,a=i(o);return t.warn=t.bind(null,"warn"),t.error=t.bind(null,"error"),t.info=t.bind(null,"info"),t.debug=t.bind(null,"debug"),{rootInjects:{log:t}}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.definitionsToAuthorize=void 0;var i=n(36),o=r(i),a=n(18),s=r(a),u=n(60),l=n(7),c=n(34),p=function(e){return e};t.definitionsToAuthorize=function(e){return function(t,n){return function(r){for(var i=arguments.length,o=Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];var s=n.getSystem().specSelectors.specJson();return(0,c.isOAS3)(s)?e.apply(void 0,[n].concat(o)):t.apply(void 0,o)}}}((0,u.createSelector)(p,function(e){return e.specSelectors.securityDefinitions()},function(e,t){var n=(0,l.List)();return t.entrySeq().forEach(function(e){var t=(0,s.default)(e,2),r=t[0],i=t[1],a=i.get("type");"oauth2"===a&&i.get("flows").entrySeq().forEach(function(e){var t=(0,s.default)(e,2),a=t[0],u=t[1],c=(0,l.fromJS)({flow:a,authorizationUrl:u.get("authorizationUrl"),tokenUrl:u.get("tokenUrl"),scopes:u.get("scopes"),type:i.get("type")});n=n.push(new l.Map((0,o.default)({},r,c.filter(function(e){return void 0!==e}))))}),"http"!==a&&"apiKey"!==a||(n=n.push(new l.Map((0,o.default)({},r,i))))}),n}))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=r(i),a=n(0),s=r(a),u=n(1),l=r(u),c=n(12),p=r(c),f=n(7),h=function(e){var t=e.callbacks,n=e.getComponent,r=n("OperationContainer",!0);if(!t)return s.default.createElement("span",null,"No callbacks");var i=t.map(function(t,n){return s.default.createElement("div",{key:n},s.default.createElement("h2",null,n),t.map(function(t,n){return s.default.createElement("div",{key:n},t.map(function(t,i){var a=(0,f.fromJS)({operation:t});return s.default.createElement(r,(0,o.default)({},e,{op:a,key:i,tag:"",method:i,path:n,allowTryItOut:!1}))}))}))});return s.default.createElement("div",null,i)};h.propTypes={getComponent:l.default.func.isRequired,callbacks:p.default.iterable.isRequired},t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(e,n){(0,s.default)(this,t);var r=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));_.call(r);var i=r.props,a=i.name,u=i.schema,l=r.getValue();return r.state={name:a,schema:u,value:l},r}return(0,h.default)(t,e),(0,l.default)(t,[{key:"getValue",value:function(){var e=this.props,t=e.name,n=e.authorized;return n&&n.getIn([t,"value"])}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.errSelectors,i=e.name,o=n("Input"),a=n("Row"),s=n("Col"),u=n("authError"),l=n("Markdown"),c=n("JumpToPath",!0),p=t.get("scheme"),f=this.getValue(),h=r.allErrors().filter(function(e){return e.get("authId")===i});if("basic"===p){var d=f?f.get("username"):null;return m.default.createElement("div",null,m.default.createElement("h4",null,m.default.createElement("code",null,i||t.get("name")),"  (http, Basic)",m.default.createElement(c,{path:["securityDefinitions",i]})),d&&m.default.createElement("h6",null,"Authorized"),m.default.createElement(a,null,m.default.createElement(l,{source:t.get("description")})),m.default.createElement(a,null,m.default.createElement("label",null,"Username:"),d?m.default.createElement("code",null," ",d," "):m.default.createElement(s,null,m.default.createElement(o,{type:"text",required:"required",name:"username",onChange:this.onChange}))),m.default.createElement(a,null,m.default.createElement("label",null,"Password:"),d?m.default.createElement("code",null," ****** "):m.default.createElement(s,null,m.default.createElement(o,{required:"required",autoComplete:"new-password",name:"password",type:"password",onChange:this.onChange}))),h.valueSeq().map(function(e,t){return m.default.createElement(u,{error:e,key:t})}))}return"bearer"===p?m.default.createElement("div",null,m.default.createElement("h4",null,m.default.createElement("code",null,i||t.get("name")),"  (http, Bearer)",m.default.createElement(c,{path:["securityDefinitions",i]})),f&&m.default.createElement("h6",null,"Authorized"),m.default.createElement(a,null,m.default.createElement(l,{source:t.get("description")})),m.default.createElement(a,null,m.default.createElement("label",null,"Value:"),f?m.default.createElement("code",null," ****** "):m.default.createElement(s,null,m.default.createElement(o,{type:"text",onChange:this.onChange}))),h.valueSeq().map(function(e,t){return m.default.createElement(u,{error:e,key:t})})):m.default.createElement("div",null,m.default.createElement("em",null,m.default.createElement("b",null,i)," HTTP authentication: unsupported or missing scheme"))}}]),t}(m.default.Component);y.propTypes={authorized:g.default.object,getComponent:g.default.func.isRequired,errSelectors:g.default.object.isRequired,schema:g.default.object.isRequired,name:g.default.string.isRequired,onChange:g.default.func};var _=function(){var e=this;this.onChange=function(t){var n=e.props.onChange,r=t.target,i=r.value,o=r.name,a=e.state.value||{};o?a[o]=i:a=i,e.setState({value:a},function(){return n(e.state)})}};t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(299),o=r(i),a=n(305),s=r(a),u=n(302),l=r(u),c=n(306),p=r(c),f=n(304),h=r(f),d=n(300),m=r(d),v=n(303),g=r(v);t.default={Callbacks:o.default,HttpAuth:m.default,RequestBody:s.default,Servers:p.default,RequestBodyEditor:h.default,OperationServers:g.default,operationLink:l.default}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){return"string"!=typeof t?"":t.split("\n").map(function(t,n){return n>0?Array(e+1).join(" ")+t:t}).join("\n")}Object.defineProperty(t,"__esModule",{value:!0});var o=n(35),a=r(o),s=n(4),u=r(s),l=n(2),c=r(l),p=n(3),f=r(p),h=n(6),d=r(h),m=n(5),v=r(m),g=n(0),y=r(g),_=n(1),b=r(_),x=n(12),w=r(x),k=function(e){function t(){return(0,c.default)(this,t),(0,d.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,v.default)(t,e),(0,f.default)(t,[{key:"render",value:function(){var e=this.props,t=e.link,n=e.name,r=e.getComponent,o=r("Markdown"),s=t.get("operationId")||t.get("operationRef"),u=t.get("parameters")&&t.get("parameters").toJS(),l=t.get("description");return y.default.createElement("div",{style:{marginBottom:"1.5em"}},y.default.createElement("div",{style:{marginBottom:".5em"}},y.default.createElement("b",null,y.default.createElement("code",null,n)),l?y.default.createElement(o,{source:l}):null),y.default.createElement("pre",null,"Operation `",s,"`",y.default.createElement("br",null),y.default.createElement("br",null),"Parameters ",i(0,(0,a.default)(u,null,2))||"{}",y.default.createElement("br",null)))}}]),t}(g.Component);k.propTypes={getComponent:b.default.func.isRequired,link:w.default.orderedMap.isRequired,name:b.default.String},t.default=k},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=n(12),x=r(b),w=function(e){function t(){var e,n,r,i;(0,l.default)(this,t);for(var a=arguments.length,u=Array(a),c=0;c<a;c++)u[c]=arguments[c];return n=r=(0,h.default)(this,(e=t.__proto__||(0,s.default)(t)).call.apply(e,[this].concat(u))),r.setSelectedServer=function(e){var t=r.props,n=t.path,i=t.method;return r.forceUpdate(),r.props.setSelectedServer(e,n+":"+i)},r.setServerVariableValue=function(e){var t=r.props,n=t.path,i=t.method;return r.forceUpdate(),r.props.setServerVariableValue((0,o.default)({},e,{namespace:n+":"+i}))},r.getSelectedServer=function(){var e=r.props,t=e.path,n=e.method;return r.props.getSelectedServer(t+":"+n)},r.getServerVariable=function(e,t){var n=r.props,i=n.path,o=n.method;return r.props.getServerVariable({namespace:i+":"+o,server:e},t)},r.getEffectiveServerValue=function(e){var t=r.props,n=t.path,i=t.method;return r.props.getEffectiveServerValue({server:e,namespace:n+":"+i})},i=n,(0,h.default)(r,i)}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.operationServers,n=e.pathServers,r=e.getComponent;if(!t&&!n)return null;var i=r("Servers"),o=t||n,a=t?"operation":"path";return g.default.createElement("div",{className:"opblock-section operation-servers"},g.default.createElement("div",{className:"opblock-section-header"},g.default.createElement("div",{className:"tab-header"},g.default.createElement("h4",{className:"opblock-title"},"Servers"))),g.default.createElement("div",{className:"opblock-description-wrapper"},g.default.createElement("h4",{className:"message"},"These ",a,"-level options override the global server options."),g.default.createElement(i,{servers:o,currentServer:this.getSelectedServer(),setSelectedServer:this.setSelectedServer,setServerVariableValue:this.setServerVariableValue,getServerVariable:this.getServerVariable,getEffectiveServerValue:this.getEffectiveServerValue})))}}]),t}(g.default.Component);w.propTypes={path:_.default.string.isRequired,method:_.default.string.isRequired,operationServers:x.default.list,pathServers:x.default.list,setSelectedServer:_.default.func.isRequired,setServerVariableValue:_.default.func.isRequired,getSelectedServer:_.default.func.isRequired,getServerVariable:_.default.func.isRequired,getEffectiveServerValue:_.default.func.isRequired,getComponent:_.default.func.isRequired},t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(7),_=n(9),b=Function.prototype,x=function(e){function t(e,n){(0,s.default)(this,t);var r=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));return r.setValueToSample=function(e){r.onChange(r.sample(e))},r.sample=function(e){var t=r.props,n=t.requestBody,i=t.mediaType,o=n.getIn(["content",e||i,"schema"]).toJS();return(0,_.getSampleSchema)(o,e||i,{includeWriteOnly:!0})},r.onChange=function(e){r.setState({value:e}),r.props.onChange(e)},r.handleOnChange=function(e){var t=r.props.mediaType,n=/json/i.test(t),i=n?e.target.value.trim():e.target.value;r.onChange(i)},r.toggleIsEditBox=function(){return r.setState(function(e){return{isEditBox:!e.isEditBox}})},r.state={isEditBox:!1,value:""},r}return(0,h.default)(t,e),(0,l.default)(t,[{key:"componentDidMount",value:function(){this.setValueToSample.call(this)}},{key:"componentWillReceiveProps",value:function(e){this.props.mediaType!==e.mediaType&&this.setValueToSample(e.mediaType),!this.props.isExecute&&e.isExecute&&this.setState({isEditBox:!0})}},{key:"componentDidUpdate",value:function(e){this.props.requestBody!==e.requestBody&&this.setValueToSample(this.props.mediaType)}},{key:"render",value:function(){var e=this.props,t=e.isExecute,n=e.getComponent,r=n("Button"),i=n("TextArea"),o=n("highlightCode"),a=this.state,s=a.value,u=a.isEditBox;return m.default.createElement("div",{className:"body-param"},u&&t?m.default.createElement(i,{className:"body-param__text",value:s,onChange:this.handleOnChange}):s&&m.default.createElement(o,{className:"body-param__example",value:s}),m.default.createElement("div",{className:"body-param-options"},t?m.default.createElement("div",{className:"body-param-edit"},m.default.createElement(r,{className:u?"btn cancel body-param__example-edit":"btn edit body-param__example-edit",onClick:this.toggleIsEditBox},u?"Cancel":"Edit")):null))}}]),t}(d.PureComponent);x.propTypes={requestBody:g.default.object.isRequired,mediaType:g.default.string.isRequired,onChange:g.default.func,getComponent:g.default.func.isRequired,isExecute:g.default.bool,specSelectors:g.default.object.isRequired},x.defaultProps={mediaType:"application/json",requestBody:(0,y.fromJS)({}),onChange:b},t.default=x},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=r(i),a=n(1),s=r(a),u=n(12),l=r(u),c=n(7),p=function(e){var t=e.requestBody,n=e.getComponent,r=e.getConfigs,i=e.specSelectors,a=e.contentType,s=e.isExecute,u=e.specPath,l=e.onChange,p=n("Markdown"),f=n("modelExample"),h=n("RequestBodyEditor"),d=t&&t.get("description")||null,m=t&&t.get("content")||new c.OrderedMap;a=a||m.keySeq().first();var v=m.get(a);return v?o.default.createElement("div",null,d&&o.default.createElement(p,{source:d}),o.default.createElement(f,{getComponent:n,getConfigs:r,specSelectors:i,expandDepth:1,isExecute:s,schema:v.get("schema"),specPath:u.push("content",a),example:o.default.createElement(h,{requestBody:t,onChange:l,mediaType:a,getComponent:n,isExecute:s,specSelectors:i})})):null};p.propTypes={requestBody:l.default.orderedMap.isRequired,getComponent:s.default.func.isRequired,getConfigs:s.default.func.isRequired,specSelectors:s.default.object.isRequired,contentType:s.default.string,isExecute:s.default.bool.isRequired,onChange:s.default.func.isRequired,specPath:s.default.array.isRequired},t.default=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(7),g=n(1),y=r(g),_=n(12),b=r(_),x=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.onServerChange=function(e){r.setServer(e.target.value)},r.onServerVariableValueChange=function(e){var t=r.props,n=t.setServerVariableValue,i=t.currentServer,o=e.target.getAttribute("data-variable"),a=e.target.value;"function"==typeof n&&n({server:i,key:o,val:a})},r.setServer=function(e){(0,r.props.setSelectedServer)(e)},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.servers;e.currentServer||this.setServer(t.first().get("url"))}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.servers,r=t.setServerVariableValue,i=t.getServerVariable;if(this.props.currentServer!==e.currentServer){var o=n.find(function(t){return t.get("url")===e.currentServer});if(!o)return this.setServer(n.first().get("url"));(o.get("variables")||(0,v.OrderedMap)()).map(function(t,n){i(e.currentServer,n)||r({server:e.currentServer,key:n,val:t.get("default")||""})})}}},{key:"render",value:function(){var e=this,t=this.props,n=t.servers,r=t.currentServer,i=t.getServerVariable,o=t.getEffectiveServerValue,a=n.find(function(e){return e.get("url")===r})||(0,v.OrderedMap)(),s=a.get("variables")||(0,v.OrderedMap)(),u=0!==s.size;return m.default.createElement("div",{className:"servers"},m.default.createElement("label",{htmlFor:"servers"},m.default.createElement("select",{onChange:this.onServerChange},n.valueSeq().map(function(e){return m.default.createElement("option",{value:e.get("url"),key:e.get("url")},e.get("url"))}).toArray())),u?m.default.createElement("div",null,m.default.createElement("div",{className:"computed-url"},"Computed URL:",m.default.createElement("code",null,o(r))),m.default.createElement("h4",null,"Server variables"),m.default.createElement("table",null,m.default.createElement("tbody",null,s.map(function(t,n){return m.default.createElement("tr",{key:n},m.default.createElement("td",null,n),m.default.createElement("td",null,t.get("enum")?m.default.createElement("select",{"data-variable":n,onChange:e.onServerVariableValueChange},t.get("enum").map(function(e){return m.default.createElement("option",{selected:e===i(r,n),key:e,value:e},e)})):m.default.createElement("input",{type:"text",value:i(r,n)||"",onChange:e.onServerVariableValueChange,"data-variable":n})))})))):null)}}]),t}(m.default.Component);x.propTypes={servers:b.default.list.isRequired,currentServer:y.default.string.isRequired,setSelectedServer:y.default.func.isRequired,setServerVariableValue:y.default.func.isRequired,getServerVariable:y.default.func.isRequired,getEffectiveServerValue:y.default.func.isRequired},t.default=x},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{components:f.default,wrapComponents:d.default,statePlugins:{spec:{wrapSelectors:a,selectors:c},auth:{wrapSelectors:u},oas3:{actions:v,reducers:b.default,selectors:y}}}};var o=n(311),a=i(o),s=n(298),u=i(s),l=n(310),c=i(l),p=n(301),f=r(p),h=n(313),d=r(h),m=n(171),v=i(m),g=n(309),y=i(g),_=n(308),b=r(_)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(36),a=r(o),s=n(18),u=r(s),l=n(171);t.default=(i={},(0,a.default)(i,l.UPDATE_SELECTED_SERVER,function(e,t){var n=t.payload,r=n.selectedServerUrl,i=n.namespace,o=i?[i,"selectedServer"]:["selectedServer"];return e.setIn(o,r)}),(0,a.default)(i,l.UPDATE_REQUEST_BODY_VALUE,function(e,t){var n=t.payload,r=n.value,i=n.pathMethod,o=(0,u.default)(i,2),a=o[0],s=o[1];return e.setIn(["requestData",a,s,"bodyValue"],r)}),(0,a.default)(i,l.UPDATE_REQUEST_CONTENT_TYPE,function(e,t){var n=t.payload,r=n.value,i=n.pathMethod,o=(0,u.default)(i,2),a=o[0],s=o[1];return e.setIn(["requestData",a,s,"requestContentType"],r)}),(0,a.default)(i,l.UPDATE_RESPONSE_CONTENT_TYPE,function(e,t){var n=t.payload,r=n.value,i=n.path,o=n.method;return e.setIn(["requestData",i,o,"responseContentType"],r)}),(0,a.default)(i,l.UPDATE_SERVER_VARIABLE_VALUE,function(e,t){var n=t.payload,r=n.server,i=n.namespace,o=n.key,a=n.val,s=i?[i,"serverVariableValues",r,o]:["serverVariableValues",r,o];return e.setIn(s,a)}),i)},function(e,t,n){"use strict";function r(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(t){var r=t.getSystem().specSelectors.specJson();return(0,o.isOAS3)(r)?e.apply(void 0,n):null}}}Object.defineProperty(t,"__esModule",{value:!0}),t.serverEffectiveValue=t.serverVariables=t.serverVariableValue=t.responseContentType=t.requestContentType=t.requestBodyValue=t.selectedServer=void 0;var i=n(7),o=n(34);t.selectedServer=r(function(e,t){var n=t?[t,"selectedServer"]:["selectedServer"];return e.getIn(n)||""}),t.requestBodyValue=r(function(e,t,n){return e.getIn(["requestData",t,n,"bodyValue"])||null}),t.requestContentType=r(function(e,t,n){return e.getIn(["requestData",t,n,"requestContentType"])||null}),t.responseContentType=r(function(e,t,n){return e.getIn(["requestData",t,n,"responseContentType"])||null}),t.serverVariableValue=r(function(e,t,n){var r=void 0;if("string"!=typeof t){var i=t.server,o=t.namespace;r=o?[o,"serverVariableValues",i,n]:["serverVariableValues",i,n]}else{r=["serverVariableValues",t,n]}return e.getIn(r)||null}),t.serverVariables=r(function(e,t){var n=void 0;if("string"!=typeof t){var r=t.server,o=t.namespace;n=o?[o,"serverVariableValues",r]:["serverVariableValues",r]}else{n=["serverVariableValues",t]}return e.getIn(n)||(0,i.OrderedMap)()}),t.serverEffectiveValue=r(function(e,t){var n,r;if("string"!=typeof t){var o=t.server,a=t.namespace;r=o,n=a?e.getIn([a,"serverVariableValues",r]):e.getIn(["serverVariableValues",r])}else r=t,n=e.getIn(["serverVariableValues",r]);n=n||(0,i.OrderedMap)();var s=r;return n.map(function(e,t){s=s.replace(new RegExp("{"+t+"}","g"),e)}),s})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSwagger2=t.servers=void 0;var r=n(60),i=n(7),o=n(34),a=function(e){return e||(0,i.Map)()},s=(0,r.createSelector)(a,function(e){return e.get("json",(0,i.Map)())}),u=(0,r.createSelector)(a,function(e){return e.get("resolved",(0,i.Map)())}),l=function(e){var t=u(e);return t.count()<1&&(t=s(e)),t};t.servers=function(e){return function(){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=t.getSystem().specSelectors.specJson();return(0,o.isOAS3)(a)?e.apply(void 0,r):null}}}((0,r.createSelector)(l,function(e){return e.getIn(["servers"])||(0,i.Map)()})),t.isSwagger2=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return(0,o.isSwagger2)(e)}}},function(e,t,n){"use strict";function r(e){return function(t,n){return function(){var r=n.getSystem().specSelectors.specJson();return(0,a.isOAS3)(r)?e.apply(void 0,arguments):t.apply(void 0,arguments)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.isSwagger2=t.isOAS3=t.servers=t.schemes=t.produces=t.consumes=t.basePath=t.host=t.securityDefinitions=t.hasHost=t.definitions=void 0;var i=n(60),o=n(7),a=n(34),s=function(e){return e||(0,o.Map)()},u=(0,i.createSelector)(function(){return null}),l=r(u),c=(0,i.createSelector)(s,function(e){return e.get("json",(0,o.Map)())}),p=(0,i.createSelector)(s,function(e){return e.get("resolved",(0,o.Map)())}),f=function(e){var t=p(e);return t.count()<1&&(t=c(e)),t};t.definitions=r((0,i.createSelector)(f,function(e){return e.getIn(["components","schemas"])||(0,o.Map)()})),t.hasHost=r(function(e){return f(e).hasIn(["servers",0])}),t.securityDefinitions=r((0,i.createSelector)(f,function(e){return e.getIn(["components","securitySchemes"])||null})),t.host=l,t.basePath=l,t.consumes=l,t.produces=l,t.schemes=l,t.servers=r((0,i.createSelector)(f,function(e){return e.getIn(["servers"])||(0,o.Map)()})),t.isOAS3=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return(0,a.isOAS3)(o.Map.isMap(e)?e:(0,o.Map)())}},t.isSwagger2=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return(0,a.isSwagger2)(o.Map.isMap(e)?e:(0,o.Map)())}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(96),o=r(i),a=n(0),s=r(a),u=n(34);t.default=(0,u.OAS3ComponentWrapFactory)(function(e){var t=e.Ori,n=(0,o.default)(e,["Ori"]),r=n.schema,i=n.getComponent,a=n.errSelectors,u=n.authorized,l=n.onAuthChange,c=n.name,p=i("HttpAuth");return"http"===r.get("type")?s.default.createElement(p,{key:c,schema:r,name:c,errSelectors:a,authorized:u,getComponent:i,onChange:l}):s.default.createElement(t,n)})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(314),o=r(i),a=n(312),s=r(a),u=n(317),l=r(u),c=n(318),p=r(c),f=n(316),h=r(f),d=n(315),m=r(d);t.default={Markdown:o.default,AuthItem:s.default,parameters:l.default,VersionStamp:p.default,model:m.default,onlineValidatorBadge:h.default}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Markdown=void 0;var i=n(0),o=r(i),a=n(1),s=r(a),u=n(1080),l=r(u),c=n(577),p=n(34),f=n(270),h=t.Markdown=function(e){var t=e.source;if(t){var n=new c.Parser,r=new c.HtmlRenderer,i=r.render(n.parse(t||"")),a=(0,f.sanitizer)(i);return t&&i&&a?o.default.createElement(l.default,{source:a,className:"renderedMarkdown"}):null}return null};h.propTypes={source:s.default.string},t.default=(0,p.OAS3ComponentWrapFactory)(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=n(34),x=n(269),w=function(e){function t(){return(0,l.default)(this,t),(0,h.default)(this,(t.__proto__||(0,s.default)(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getConfigs,n=e.schema,r=["model-box"],i=!0===n.get("deprecated"),a=null;return i&&(r.push("deprecated"),a=g.default.createElement("span",{className:"model-deprecated-warning"},"Deprecated:")),g.default.createElement("div",{className:r.join(" ")},a,g.default.createElement(x.Model,(0,o.default)({},this.props,{getConfigs:t,depth:1,expandDepth:this.props.expandDepth||0})))}}]),t}(v.Component);w.propTypes={schema:_.default.object.isRequired,name:_.default.string,getComponent:_.default.func.isRequired,getConfigs:_.default.func.isRequired,specSelectors:_.default.object.isRequired,expandDepth:_.default.number},t.default=(0,b.OAS3ComponentWrapFactory)(w)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(34);t.default=(0,r.OAS3ComponentWrapFactory)(function(){return null})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(97),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=n(7),x=r(b),w=n(12),k=r(w),E=n(34),S=function(e,t){return e.valueSeq().filter(x.default.Map.isMap).map(t)},C=function(e){function t(e){(0,l.default)(this,t);var n=(0,h.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e));return n.onChange=function(e,t,r){var i=n.props;(0,i.specActions.changeParam)(i.onChangeKey,e.get("name"),e.get("in"),t,r)},n.onChangeConsumesWrapper=function(e){var t=n.props;(0,t.specActions.changeConsumesValue)(t.onChangeKey,e)},n.toggleTab=function(e){return"parameters"===e?n.setState({parametersVisible:!0,callbackVisible:!1}):"callbacks"===e?n.setState({callbackVisible:!0,parametersVisible:!1}):void 0},n.state={callbackVisible:!1,parametersVisible:!0},n}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.onTryoutClick,r=t.onCancelClick,i=t.parameters,a=t.allowTryItOut,s=t.tryItOutEnabled,u=t.fn,l=t.getComponent,c=t.getConfigs,p=t.specSelectors,f=t.oas3Actions,h=t.oas3Selectors,d=t.pathMethod,m=t.specPath,v=t.operation,y=l("parameterRow"),_=l("TryItOutButton"),x=l("contentType"),w=l("Callbacks",!0),k=l("RequestBody",!0),E=s&&a,C=p.isOAS3,A=v.get("requestBody"),D=m.slice(0,-1).push("requestBody");return g.default.createElement("div",{className:"opblock-section"},g.default.createElement("div",{className:"opblock-section-header"},g.default.createElement("div",{className:"tab-header"},g.default.createElement("div",{onClick:function(){return e.toggleTab("parameters")},className:"tab-item "+(this.state.parametersVisible&&"active")},g.default.createElement("h4",{className:"opblock-title"},g.default.createElement("span",null,"Parameters"))),v.get("callbacks")?g.default.createElement("div",{onClick:function(){return e.toggleTab("callbacks")},className:"tab-item "+(this.state.callbackVisible&&"active")},g.default.createElement("h4",{className:"opblock-title"},g.default.createElement("span",null,"Callbacks"))):null),a?g.default.createElement(_,{enabled:s,onCancelClick:r,onTryoutClick:n}):null),this.state.parametersVisible?g.default.createElement("div",{className:"parameters-container"},i.count()?g.default.createElement("div",{className:"table-container"},g.default.createElement("table",{className:"parameters"},g.default.createElement("thead",null,g.default.createElement("tr",null,g.default.createElement("th",{className:"col col_header parameters-col_name"},"Name"),g.default.createElement("th",{className:"col col_header parameters-col_description"},"Description"))),g.default.createElement("tbody",null,S(i,function(t,n){return g.default.createElement(y,{fn:u,getComponent:l,specPath:m.push(n),getConfigs:c,param:t,key:t.get("name"),onChange:e.onChange,onChangeConsumes:e.onChangeConsumesWrapper,specSelectors:p,pathMethod:d,isExecute:E})}).toArray()))):g.default.createElement("div",{className:"opblock-description-wrapper"},g.default.createElement("p",null,"No parameters"))):"",this.state.callbackVisible?g.default.createElement("div",{className:"callbacks-container opblock-description-wrapper"},g.default.createElement(w,{callbacks:(0,b.Map)(v.get("callbacks"))})):"",C()&&A&&this.state.parametersVisible&&g.default.createElement("div",{className:"opblock-section"},g.default.createElement("div",{className:"opblock-section-header"},g.default.createElement("h4",{className:"opblock-title parameter__name "+(A.get("required")&&"required")},"Request body"),g.default.createElement("label",null,g.default.createElement(x,{value:h.requestContentType.apply(h,(0,o.default)(d)),contentTypes:A.get("content").keySeq(),onChange:function(e){f.setRequestContentType({value:e,pathMethod:d})},className:"body-param-content-type"}))),g.default.createElement("div",{className:"opblock-description-wrapper"},g.default.createElement(k,{specPath:D,requestBody:A,isExecute:E,onChange:function(e){f.setRequestBodyValue({value:e,pathMethod:d})},contentType:h.requestContentType.apply(h,(0,o.default)(d))}))))}}]),t}(v.Component);C.propTypes={parameters:k.default.list.isRequired,specActions:_.default.object.isRequired,operation:_.default.object.isRequired,getComponent:_.default.func.isRequired,getConfigs:_.default.func.isRequired,specSelectors:_.default.object.isRequired,oas3Actions:_.default.object.isRequired,oas3Selectors:_.default.object.isRequired,fn:_.default.object.isRequired,tryItOutEnabled:_.default.bool,allowTryItOut:_.default.bool,specPath:k.default.list.isRequired,onTryoutClick:_.default.func,onCancelClick:_.default.func,onChangeKey:_.default.array,pathMethod:_.default.array.isRequired},C.defaultProps={onTryoutClick:Function.prototype,onCancelClick:Function.prototype,tryItOutEnabled:!1,allowTryItOut:!0,onChangeKey:[]},t.default=(0,E.OAS3ComponentWrapFactory)(C)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(34);t.default=(0,o.OAS3ComponentWrapFactory)(function(e){var t=e.Ori;return i.default.createElement("span",null,i.default.createElement(t,e),i.default.createElement("small",{style:{backgroundColor:"#89bf04"}},i.default.createElement("pre",{className:"version"},"OAS3")))})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{fn:i}};var r=n(172),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(r)},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{statePlugins:{spec:{wrapActions:p,reducers:o.default,actions:s,selectors:l}}}};var i=n(321),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(173),s=r(a),u=n(322),l=r(u),c=n(323),p=r(c)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(36),a=r(o),s=n(30),u=r(s),l=n(97),c=r(l),p=n(7),f=n(9),h=n(46),d=r(h),m=n(173);t.default=(i={},(0,a.default)(i,m.UPDATE_SPEC,function(e,t){return"string"==typeof t.payload?e.set("spec",t.payload):e}),(0,a.default)(i,m.UPDATE_URL,function(e,t){return e.set("url",t.payload+"")}),(0,a.default)(i,m.UPDATE_JSON,function(e,t){return e.set("json",(0,f.fromJSOrdered)(t.payload))}),(0,a.default)(i,m.UPDATE_RESOLVED,function(e,t){return e.setIn(["resolved"],(0,f.fromJSOrdered)(t.payload))}),(0,a.default)(i,m.UPDATE_PARAM,function(e,t){var n=t.payload,r=n.path,i=n.paramName,o=n.paramIn,a=n.value,s=n.isXml;return e.updateIn(["resolved","paths"].concat((0,c.default)(r),["parameters"]),(0,p.fromJS)([]),function(e){var t=e.findIndex(function(e){return e.get("name")===i&&e.get("in")===o});return a instanceof d.default.File||(a=(0,f.fromJSOrdered)(a)),e.setIn([t,s?"value_xml":"value"],a)})}),(0,a.default)(i,m.VALIDATE_PARAMS,function(e,t){var n=t.payload,r=n.pathMethod,i=n.isOAS3,o=e.getIn(["meta","paths"].concat((0,c.default)(r)),(0,p.fromJS)({})),a=/xml/i.test(o.get("consumes_value"));return e.updateIn(["resolved","paths"].concat((0,c.default)(r),["parameters"]),(0,p.fromJS)([]),function(e){return e.withMutations(function(e){for(var t=0,n=e.count();t<n;t++){var r=(0,f.validateParam)(e.get(t),a,i);e.setIn([t,"errors"],(0,p.fromJS)(r))}})})}),(0,a.default)(i,m.CLEAR_VALIDATE_PARAMS,function(e,t){var n=t.payload.pathMethod;return e.updateIn(["resolved","paths"].concat((0,c.default)(n),["parameters"]),(0,p.fromJS)([]),function(e){return e.withMutations(function(e){for(var t=0,n=e.count();t<n;t++)e.setIn([t,"errors"],(0,p.fromJS)([]))})})}),(0,a.default)(i,m.SET_RESPONSE,function(e,t){var n=t.payload,r=n.res,i=n.path,o=n.method,a=void 0;a=r.error?(0,u.default)({error:!0,name:r.err.name,message:r.err.message,statusCode:r.err.statusCode},r.err.response):r,a.headers=a.headers||{};var s=e.setIn(["responses",i,o],(0,f.fromJSOrdered)(a));return d.default.Blob&&r.data instanceof d.default.Blob&&(s=s.setIn(["responses",i,o,"text"],r.data)),s}),(0,a.default)(i,m.SET_REQUEST,function(e,t){var n=t.payload,r=n.req,i=n.path,o=n.method;return e.setIn(["requests",i,o],(0,f.fromJSOrdered)(r))}),(0,a.default)(i,m.SET_MUTATED_REQUEST,function(e,t){var n=t.payload,r=n.req,i=n.path,o=n.method;return e.setIn(["mutatedRequests",i,o],(0,f.fromJSOrdered)(r))}),(0,a.default)(i,m.UPDATE_OPERATION_META_VALUE,function(e,t){var n=t.payload,r=n.path,i=n.value,o=n.key,a=["resolved","paths"].concat((0,c.default)(r)),s=["meta","paths"].concat((0,c.default)(r));return e.getIn(a)?e.setIn([].concat((0,c.default)(s),[o]),(0,p.fromJS)(i)):e}),(0,a.default)(i,m.CLEAR_RESPONSE,function(e,t){var n=t.payload,r=n.path,i=n.method;return e.deleteIn(["responses",r,i])}),(0,a.default)(i,m.CLEAR_REQUEST,function(e,t){var n=t.payload,r=n.path,i=n.method;return e.deleteIn(["requests",r,i])}),(0,a.default)(i,m.SET_SCHEME,function(e,t){var n=t.payload,r=n.scheme,i=n.path,o=n.method;return i&&o?e.setIn(["scheme",i,o],r):i||o?void 0:e.setIn(["scheme","_defaultScheme"],r)}),i)},function(e,t,n){"use strict";function r(e,t,n,r){return t=t||[],_(e).getIn(["paths"].concat((0,f.default)(t),["parameters"]),(0,m.fromJS)([])).find(function(e){return m.Map.isMap(e)&&e.get("name")===n&&e.get("in")===r})||(0,m.Map)()}function i(e,t,n){return t=t||[],_(e).getIn(["paths"].concat((0,f.default)(t),["parameters"]),(0,m.fromJS)([])).reduce(function(e,t){var r=n&&"body"===t.get("in")?t.get("value_xml"):t.get("value");return e.set(t.get("in")+"."+t.get("name"),r)},(0,m.fromJS)({}))}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(m.List.isList(e))return e.some(function(e){return m.Map.isMap(e)&&e.get("in")===t})}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(m.List.isList(e))return e.some(function(e){return m.Map.isMap(e)&&e.get("type")===t})}function s(e,t){t=t||[];var n=_(e).getIn(["paths"].concat((0,f.default)(t)),(0,m.fromJS)({})),r=e.getIn(["meta","paths"].concat((0,f.default)(t)),(0,m.fromJS)({})),i=l(e,t),o=n.get("parameters")||new m.List,s=r.get("consumes_value")?r.get("consumes_value"):a(o,"file")?"multipart/form-data":a(o,"formData")?"application/x-www-form-urlencoded":void 0;return(0,m.fromJS)({requestContentType:s,responseContentType:i})}function u(e,t){return t=t||[],_(e).getIn(["paths"].concat((0,f.default)(t),["consumes"]),(0,m.fromJS)({}))}function l(e,t){t=t||[];var n=_(e).getIn(["paths"].concat((0,f.default)(t)),null);if(null!==n){var r=e.getIn(["meta","paths"].concat((0,f.default)(t),["produces_value"]),null),i=n.getIn(["produces",0],null);return r||i||"application/json"}}function c(e){return m.Map.isMap(e)?e:new m.Map}Object.defineProperty(t,"__esModule",{value:!0}),t.validateBeforeExecute=t.canExecuteScheme=t.operationScheme=t.hasHost=t.allowTryItOutFor=t.mutatedRequestFor=t.requestFor=t.responseFor=t.mutatedRequests=t.requests=t.responses=t.taggedOperations=t.operationsWithTags=t.tagDetails=t.tags=t.operationsWithRootInherited=t.schemes=t.host=t.basePath=t.definitions=t.findDefinition=t.securityDefinitions=t.security=t.produces=t.consumes=t.operations=t.paths=t.semver=t.version=t.externalDocs=t.info=t.isOAS3=t.spec=t.specResolved=t.specJson=t.specSource=t.specStr=t.url=t.lastError=void 0;var p=n(97),f=function(e){return e&&e.__esModule?e:{default:e}}(p);t.getParameter=r,t.parameterValues=i,t.parametersIncludeIn=o,t.parametersIncludeType=a,t.contentTypeValues=s,t.operationConsumes=u,t.currentProducesFor=l;var h=n(60),d=n(9),m=n(7),v=["get","put","post","delete","options","head","patch","trace"],g=function(e){return e||(0,m.Map)()},y=(t.lastError=(0,h.createSelector)(g,function(e){return e.get("lastError")}),t.url=(0,h.createSelector)(g,function(e){return e.get("url")}),t.specStr=(0,h.createSelector)(g,function(e){return e.get("spec")||""}),t.specSource=(0,h.createSelector)(g,function(e){return e.get("specSource")||"not-editor"}),t.specJson=(0,h.createSelector)(g,function(e){return e.get("json",(0,m.Map)())}),t.specResolved=(0,h.createSelector)(g,function(e){return e.get("resolved",(0,m.Map)())})),_=t.spec=function(e){return y(e)},b=(t.isOAS3=(0,h.createSelector)(_,function(){return!1}),t.info=(0,h.createSelector)(_,function(e){return c(e&&e.get("info"))})),x=(t.externalDocs=(0,h.createSelector)(_,function(e){return c(e&&e.get("externalDocs"))}),t.version=(0,h.createSelector)(b,function(e){return e&&e.get("version")})),w=(t.semver=(0,h.createSelector)(x,function(e){return/v?([0-9]*)\.([0-9]*)\.([0-9]*)/i.exec(e).slice(1)}),t.paths=(0,h.createSelector)(_,function(e){return e.get("paths")})),k=t.operations=(0,h.createSelector)(w,function(e){if(!e||e.size<1)return(0,m.List)();var t=(0,m.List)();return e&&e.forEach?(e.forEach(function(e,n){if(!e||!e.forEach)return{};e.forEach(function(e,r){v.indexOf(r)<0||(t=t.push((0,m.fromJS)({path:n,method:r,operation:e,id:r+"-"+n})))})}),t):(0,m.List)()}),E=t.consumes=(0,h.createSelector)(_,function(e){return(0,m.Set)(e.get("consumes"))}),S=t.produces=(0,h.createSelector)(_,function(e){return(0,m.Set)(e.get("produces"))}),C=(t.security=(0,h.createSelector)(_,function(e){return e.get("security",(0,m.List)())}),t.securityDefinitions=(0,h.createSelector)(_,function(e){return e.get("securityDefinitions")}),t.findDefinition=function(e,t){return y(e).getIn(["definitions",t],null)},t.definitions=(0,h.createSelector)(_,function(e){return e.get("definitions")||(0,m.Map)()}),t.basePath=(0,h.createSelector)(_,function(e){return e.get("basePath")}),t.host=(0,h.createSelector)(_,function(e){return e.get("host")}),t.schemes=(0,h.createSelector)(_,function(e){return e.get("schemes",(0,m.Map)())}),t.operationsWithRootInherited=(0,h.createSelector)(k,E,S,function(e,t,n){return e.map(function(e){return e.update("operation",function(e){if(e){if(!m.Map.isMap(e))return;return e.withMutations(function(e){return e.get("consumes")||e.update("consumes",function(e){return(0,m.Set)(e).merge(t)}),e.get("produces")||e.update("produces",function(e){return(0,m.Set)(e).merge(n)}),e})}return(0,m.Map)()})})})),A=t.tags=(0,h.createSelector)(_,function(e){return e.get("tags",(0,m.List)())}),D=t.tagDetails=function(e,t){return(A(e)||(0,m.List)()).filter(m.Map.isMap).find(function(e){return e.get("name")===t},(0,m.Map)())},O=t.operationsWithTags=(0,h.createSelector)(C,A,function(e,t){return e.reduce(function(e,t){var n=(0,m.Set)(t.getIn(["operation","tags"]));return n.count()<1?e.update("default",(0,m.List)(),function(e){return e.push(t)}):n.reduce(function(e,n){return e.update(n,(0,m.List)(),function(e){return e.push(t)})},e)},t.reduce(function(e,t){return e.set(t.get("name"),(0,m.List)())},(0,m.OrderedMap)()))}),M=(t.taggedOperations=function(e){return function(t){var n=t.getConfigs,r=n(),i=r.tagsSorter,o=r.operationsSorter;return O(e).sortBy(function(e,t){return t},function(e,t){var n="function"==typeof i?i:d.sorters.tagsSorter[i];return n?n(e,t):null}).map(function(t,n){var r="function"==typeof o?o:d.sorters.operationsSorter[o],i=r?t.sort(r):t;return(0,m.Map)({tagDetails:D(e,n),operations:i})})}},t.responses=(0,h.createSelector)(g,function(e){return e.get("responses",(0,m.Map)())})),T=t.requests=(0,h.createSelector)(g,function(e){return e.get("requests",(0,m.Map)())}),P=t.mutatedRequests=(0,h.createSelector)(g,function(e){return e.get("mutatedRequests",(0,m.Map)())}),I=(t.responseFor=function(e,t,n){return M(e).getIn([t,n],null)},t.requestFor=function(e,t,n){return T(e).getIn([t,n],null)},t.mutatedRequestFor=function(e,t,n){return P(e).getIn([t,n],null)},t.allowTryItOutFor=function(){return!0},t.hasHost=(0,h.createSelector)(_,function(e){var t=e.get("host");return"string"==typeof t&&t.length>0&&"/"!==t[0]}),t.operationScheme=function(e,t,n){var r=e.get("url"),i=r.match(/^([a-z][a-z0-9+\-.]*):/),o=Array.isArray(i)?i[1]:null;return e.getIn(["scheme",t,n])||e.getIn(["scheme","_defaultScheme"])||o||""});t.canExecuteScheme=function(e,t,n){return["http","https"].indexOf(I(e,t,n))>-1},t.validateBeforeExecute=function(e,t){t=t||[];var n=_(e).getIn(["paths"].concat((0,f.default)(t),["parameters"]),(0,m.fromJS)([])),r=!0;return n.forEach(function(e){var t=e.get("errors");t&&t.count()&&(r=!1)}),r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.updateSpec=function(e,t){var n=t.specActions;return function(){e.apply(void 0,arguments),n.parseToJson.apply(n,arguments)}},t.updateJsonSpec=function(e,t){var n=t.specActions;return function(){e.apply(void 0,arguments),n.resolveSpec.apply(n,arguments)}},t.executeRequest=function(e,t){var n=t.specActions;return function(t){return n.logRequest(t),e(t)}},t.validateParams=function(e,t){var n=t.specSelectors;return function(t){return e(t,n.isOAS3())}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(1093),_=r(y),b=["split-pane-mode"],x="left",w="right",k="both",E=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.initializeComponent=function(e){r.splitPane=e},r.onDragFinished=function(){var e=r.props,t=e.threshold,n=e.layoutActions,i=r.splitPane.state,o=i.position,a=i.draggedSize;r.draggedSize=a;var s=o<=t,u=a<=t;n.changeMode(b,s?w:u?x:k)},r.sizeFromMode=function(e,t){return e===x?(r.draggedSize=null,"0px"):e===w?(r.draggedSize=null,"100%"):r.draggedSize||t},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.layoutSelectors,r=n.whatMode(b),i=r===w?m.default.createElement("noscript",null):t[0],o=r===x?m.default.createElement("noscript",null):t[1],a=this.sizeFromMode(r,"50%");return m.default.createElement(_.default,{disabledClass:"",ref:this.initializeComponent,split:"vertical",defaultSize:"50%",primary:"second",minSize:0,size:a,onDragFinished:this.onDragFinished,allowResize:r!==x&&r!==w,resizerStyle:{flex:"0 0 auto",position:"relative"}},i,o)}}]),t}(m.default.Component);E.propTypes={threshold:g.default.number,children:g.default.array,layoutSelectors:g.default.object.isRequired,layoutActions:g.default.object.isRequired},E.defaultProps={threshold:100,children:[]},t.default=E},function(e,t,n){"use strict";function r(){return{components:{SplitPaneMode:o.default}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(324),o=function(e){return e&&e.__esModule?e:{default:e}}(i)},function(e,t,n){"use strict";var r=n(495),i=function(e){return e&&e.__esModule?e:{default:e}}(r);e.exports=function(e){var t=e.configs;return{fn:{fetch:i.default.makeHttp(t.preFetch,t.postFetch),buildRequest:i.default.buildRequest,execute:i.default.execute,resolve:i.default.resolve,serializeRes:i.default.serializeRes,opId:i.default.helpers.opId}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{fn:{shallowEqualKeys:r.shallowEqualKeys}}};var r=n(9)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.getComponents,n=e.getStore,r=e.getSystem,a=i.getComponent,s=i.render,u=i.makeMappedContainer,l=(0,o.memoize)(a.bind(null,r,n,t));return{rootInjects:{getComponent:l,makeMappedContainer:(0,o.memoize)(u.bind(null,r,n,l,t)),render:s.bind(null,r,n,a,t)}}};var r=n(329),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(r),o=n(9)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.getComponent=t.render=t.makeMappedContainer=void 0;var i=n(48),o=r(i),a=n(47),s=r(a),u=n(30),l=r(u),c=n(21),p=r(c),f=n(4),h=r(f),d=n(2),m=r(d),v=n(3),g=r(v),y=n(6),_=r(y),b=n(5),x=r(b),w=n(0),k=r(w),E=n(449),S=r(E),C=n(1090),A=n(950),D=r(A),O=function(e,t){return function(n){function r(){return(0,m.default)(this,r),(0,_.default)(this,(r.__proto__||(0,h.default)(r)).apply(this,arguments))}return(0,x.default)(r,n),(0,g.default)(r,[{key:"render",value:function(){return k.default.createElement(t,(0,p.default)({},e(),this.props,this.context))}}]),r}(w.Component)},M=function(e,t){return function(n){function r(){return(0,m.default)(this,r),(0,_.default)(this,(r.__proto__||(0,h.default)(r)).apply(this,arguments))}return(0,x.default)(r,n),(0,g.default)(r,[{key:"render",value:function(){return k.default.createElement(C.Provider,{store:e},k.default.createElement(t,(0,p.default)({},this.props,this.context)))}}]),r}(w.Component)},T=function(e,t,n){var r=function(n,r){var i=(0,l.default)({},r,e());return(t.prototype.mapStateToProps||function(e){return{state:e}})(n,i)},i=O(e,t),o=(0,C.connect)(r)(i);return n?M(n,o):o},P=function(e,t,n,r){for(var i in t){var o=t[i];"function"==typeof o&&o(n[i],r[i],e())}},I=(t.makeMappedContainer=function(e,t,n,r,i,o){return function(t){function r(t,n){(0,m.default)(this,r);var i=(0,_.default)(this,(r.__proto__||(0,h.default)(r)).call(this,t,n));return P(e,o,t,{}),i}return(0,x.default)(r,t),(0,g.default)(r,[{key:"componentWillReceiveProps",value:function(t){P(e,o,t,this.props)}},{key:"render",value:function(){var e=(0,D.default)(this.props,o?(0,s.default)(o):[]),t=n(i,"root");return k.default.createElement(t,e)}}]),r}(w.Component)},t.render=function(e,t,n,r,i){var o=n(e,t,r,"App","root");S.default.render(k.default.createElement(o,null),i)},function(e){return function(t){function n(){return(0,m.default)(this,n),(0,_.default)(this,(n.__proto__||(0,h.default)(n)).apply(this,arguments))}return(0,x.default)(n,t),(0,g.default)(n,[{key:"render",value:function(){return e(this.props)}}]),n}(w.Component)}),R=function(e){var t=e.name;return k.default.createElement("div",{style:{padding:"1em",color:"#aaa"}},"😱 ",k.default.createElement("i",null,"Could not render ","t"===t?"this component":t,", see the console."))},j=function(e){var t=function(e){return!(e.prototype&&e.prototype.isReactComponent)}(e)?I(e):e,n=t.prototype.render;return t.prototype.render=function(){try{for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return n.apply(this,r)}catch(e){return console.error(e),k.default.createElement(R,{error:e,name:t.name})}},t};t.getComponent=function(e,t,n,r,i){if("string"!=typeof r)throw new TypeError("Need a string, to fetch a component. Was given a "+(void 0===r?"undefined":(0,o.default)(r)));var a=n(r);return a?i?"root"===i?T(e,a,t()):T(e,j(a)):j(a):(e().log.warn("Could not find component",r),null)}},function(e,t,n){e.exports={default:n(590),__esModule:!0}},function(e,t,n){e.exports={default:n(591),__esModule:!0}},function(e,t,n){e.exports={default:n(595),__esModule:!0}},function(e,t,n){"use strict";function r(){}function i(e){var t,n,r=e.walker();for(this.buffer="",this.lastOut="\n";t=r.next();)n=t.node.type,this[n]&&this[n](t.node,t.entering);return this.buffer}function o(e){this.buffer+=e,this.lastOut=e}function a(){"\n"!==this.lastOut&&this.lit("\n")}function s(e){this.lit(e)}function u(e){return e}r.prototype.render=i,r.prototype.out=s,r.prototype.lit=o,r.prototype.cr=a,r.prototype.esc=u,e.exports=r},function(e,t,n){var r=n(24).document;e.exports=r&&r.documentElement},function(e,t,n){e.exports=!n(49)&&!n(54)(function(){return 7!=Object.defineProperty(n(179)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(74),i=n(22)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},function(e,t,n){var r=n(99);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(37);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t,n){"use strict";var r=n(130),i=n(23),o=n(186),a=n(56),s=n(55),u=n(74),l=n(608),c=n(102),p=n(344),f=n(22)("iterator"),h=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,m,v,g,y){l(n,t,m);var _,b,x,w=function(e){if(!h&&e in C)return C[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},k=t+" Iterator",E="values"==v,S=!1,C=e.prototype,A=C[f]||C["@@iterator"]||v&&C[v],D=!h&&A||w(v),O=v?E?w("entries"):D:void 0,M="Array"==t?C.entries||A:A;if(M&&(x=p(M.call(new e)))!==Object.prototype&&x.next&&(c(x,k,!0),r||s(x,f)||a(x,f,d)),E&&A&&"values"!==A.name&&(S=!0,D=function(){return A.call(this)}),r&&!y||!h&&!S&&C[f]||a(C,f,D),u[t]=D,u[k]=d,v)if(_={values:E?D:w("values"),keys:g?D:w("keys"),entries:O},y)for(b in _)b in C||o(C,b,_[b]);else i(i.P+i.F*(h||S),t,_);return _}},function(e,t,n){var r=n(22)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},e(o)}catch(e){}return n}},function(e,t,n){"use strict";var r=n(100),i=n(184),o=n(132),a=n(76),s=n(181),u=Object.assign;e.exports=!u||n(54)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=u({},e)[n]||Object.keys(u({},t)).join("")!=r})?function(e,t){for(var n=a(e),u=arguments.length,l=1,c=i.f,p=o.f;u>l;)for(var f,h=s(arguments[l++]),d=c?r(h).concat(c(h)):r(h),m=d.length,v=0;m>v;)p.call(h,f=d[v++])&&(n[f]=h[f]);return n}:u},function(e,t,n){var r=n(132),i=n(101),o=n(75),a=n(190),s=n(55),u=n(335),l=Object.getOwnPropertyDescriptor;t.f=n(49)?l:function(e,t){if(e=o(e),t=a(t,!0),u)try{return l(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t,n){var r=n(345),i=n(180).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){var r=n(55),i=n(76),o=n(187)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(55),i=n(75),o=n(600)(!1),a=n(187)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,l=[];for(n in s)n!=a&&r(s,n)&&l.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(l,n)||l.push(n));return l}},function(e,t,n){var r=n(23),i=n(15),o=n(54);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*o(function(){n(1)}),"Object",a)}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(37),i=n(27),o=n(182);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){var r=n(37),i=n(98),o=n(22)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||void 0==(n=r(a)[o])?t:i(n)}},function(e,t,n){var r,i,o,a=n(53),s=n(607),u=n(334),l=n(179),c=n(24),p=c.process,f=c.setImmediate,h=c.clearImmediate,d=c.MessageChannel,m=c.Dispatch,v=0,g={},y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},_=function(e){y.call(e.data)};f&&h||(f=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},r(v),v},h=function(e){delete g[e]},"process"==n(99)(p)?r=function(e){p.nextTick(a(y,e,1))}:m&&m.now?r=function(e){m.now(a(y,e,1))}:d?(i=new d,o=i.port2,i.port1.onmessage=_,r=a(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(r=function(e){c.postMessage(e+"","*")},c.addEventListener("message",_,!1)):r="onreadystatechange"in l("script")?function(e){u.appendChild(l("script")).onreadystatechange=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:f,clear:h}},function(e,t,n){var r=n(27);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(31).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(77),i=n(105),o=n(19)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},function(e,t,n){"use strict";var r=n(356),i=n(28),o=n(78),a=n(64),s=n(108),u=n(109),l=n(647),c=n(199),p=n(653),f=n(19)("iterator"),h=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,m,v,g,y){l(n,t,m);var _,b,x,w=function(e){if(!h&&e in C)return C[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},k=t+" Iterator",E="values"==v,S=!1,C=e.prototype,A=C[f]||C["@@iterator"]||v&&C[v],D=!h&&A||w(v),O=v?E?w("entries"):D:void 0,M="Array"==t?C.entries||A:A;if(M&&(x=p(M.call(new e)))!==Object.prototype&&x.next&&(c(x,k,!0),r||s(x,f)||a(x,f,d)),E&&A&&"values"!==A.name&&(S=!0,D=function(){return A.call(this)}),r&&!y||!h&&!S&&C[f]||a(C,f,D),u[t]=D,u[k]=d,v)if(_={values:E?D:w("values"),keys:g?D:w("keys"),entries:O},y)for(b in _)b in C||o(C,b,_[b]);else i(i.P+i.F*(h||S),t,_);return _}},function(e,t){e.exports=!1},function(e,t,n){var r=n(654),i=n(352);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(62),i=n(77),o=n(198);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(31),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});e.exports=function(e){return i[e]||(i[e]={})}},function(e,t,n){var r=n(62),i=n(135),o=n(19)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||void 0==(n=r(a)[o])?t:i(n)}},function(e,t,n){var r=n(139),i=n(57);e.exports=function(e){return function(t,n){var o,a,s=String(i(t)),u=r(n),l=s.length;return u<0||u>=l?e?"":void 0:(o=s.charCodeAt(u),o<55296||o>56319||u+1===l||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):a-56320+(o-55296<<10)+65536)}}},function(e,t,n){var r,i,o,a=n(136),s=n(643),u=n(353),l=n(196),c=n(31),p=c.process,f=c.setImmediate,h=c.clearImmediate,d=c.MessageChannel,m=c.Dispatch,v=0,g={},y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},_=function(e){y.call(e.data)};f&&h||(f=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},r(v),v},h=function(e){delete g[e]},"process"==n(105)(p)?r=function(e){p.nextTick(a(y,e,1))}:m&&m.now?r=function(e){m.now(a(y,e,1))}:d?(i=new d,o=i.port2,i.port1.onmessage=_,r=a(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(r=function(e){c.postMessage(e+"","*")},c.addEventListener("message",_,!1)):r="onreadystatechange"in l("script")?function(e){u.appendChild(l("script")).onreadystatechange=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:f,clear:h}},function(e,t,n){var r=n(139),i=Math.max,o=Math.min;e.exports=function(e,t){return e=r(e),e<0?i(e+t,0):o(e,t)}},function(e,t,n){"use strict";var r=n(363)(!0);n(355)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){"use strict";function r(e){return(0,o.default)(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(763),o=function(e){return e&&e.__esModule?e:{default:e}}(i);e.exports=t.default},function(e,t){var n=e.exports={get firstChild(){var e=this.children;return e&&e[0]||null},get lastChild(){var e=this.children;return e&&e[e.length-1]||null},get nodeType(){return i[this.type]||i.element}},r={tagName:"name",childNodes:"children",parentNode:"parent",previousSibling:"prev",nextSibling:"next",nodeValue:"data"},i={element:1,text:3,cdata:4,comment:8};Object.keys(r).forEach(function(e){var t=r[e];Object.defineProperty(n,e,{get:function(){return this[t]||null},set:function(e){return this[t]=e,e}})})},function(e,t,n){function r(e){if(e>=55296&&e<=57343||e>1114111)return"�";e in i&&(e=i[e]);var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e)}var i=n(712);e.exports=r},function(e,t){e.exports={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",amp:"&",AMP:"&",Aring:"Å",aring:"å",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",brvbar:"¦",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",iquest:"¿",Iuml:"Ï",iuml:"ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",Ntilde:"Ñ",ntilde:"ñ",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",Ograve:"Ò",ograve:"ò",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",Ouml:"Ö",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",THORN:"Þ",thorn:"þ",times:"×",Uacute:"Ú",uacute:"ú",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",Uuml:"Ü",uuml:"ü",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ"}},function(e,t,n){"use strict";var r,i,o,a,s=n(65),u=function(e,t){return t};try{Object.defineProperty(u,"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch(e){}1===u.length?(r={configurable:!0,writable:!1,enumerable:!1},i=Object.defineProperty,e.exports=function(e,t){return t=s(t),e.length===t?e:(r.value=t,i(e,"length",r))}):(a=n(375),o=function(){var e=[];return function(t){var n,r=0;if(e[t])return e[t];for(n=[];t--;)n.push("a"+(++r).toString(36));return new Function("fn","return function ("+n.join(", ")+") { return fn.apply(this, arguments); };")}}(),e.exports=function(e,t){var n;if(t=s(t),e.length===t)return e;n=o(t)(e);try{a(n,e)}catch(e){}return n})},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";e.exports=n(727)()?Object.assign:n(728)},function(e,t,n){"use strict";var r=n(58),i=n(142),o=Function.prototype.call;e.exports=function(e,t){var n={},a=arguments[2];return r(t),i(e,function(e,r,i,s){n[r]=o.call(t,a,e,r,i,s)}),n}},function(e,t,n){"use strict";var r=n(115),i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols;e.exports=function(e,t){var n,u=Object(r(t));if(e=Object(r(e)),a(u).forEach(function(r){try{i(e,r,o(t,r))}catch(e){n=e}}),"function"==typeof s&&s(u).forEach(function(r){try{i(e,r,o(t,r))}catch(e){n=e}}),void 0!==n)throw n;return e}},function(e,t,n){"use strict";var r=n(79),i=Array.prototype.forEach,o=Object.create,a=function(e,t){var n;for(n in e)t[n]=e[n]};e.exports=function(e){var t=o(null);return i.call(arguments,function(e){r(e)&&a(Object(e),t)}),t}},function(e,t,n){"use strict";var r=n(32),i={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):{remove:r}},registerDefault:function(){}};e.exports=i},function(e,t,n){"use strict";function r(e){try{e.focus()}catch(e){}}e.exports=r},function(e,t,n){"use strict";function r(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}e.exports=r},function(e,t,n){function r(e,t){this._options=t||{},this._cbs=e||{},this._tagname="",this._attribname="",this._attribvalue="",this._attribs=null,this._stack=[],this.startIndex=0,this.endIndex=null,this._lowerCaseTagNames="lowerCaseTags"in this._options?!!this._options.lowerCaseTags:!this._options.xmlMode,this._lowerCaseAttributeNames="lowerCaseAttributeNames"in this._options?!!this._options.lowerCaseAttributeNames:!this._options.xmlMode,this._options.Tokenizer&&(i=this._options.Tokenizer),this._tokenizer=new i(this._options,this),this._cbs.onparserinit&&this._cbs.onparserinit(this)}var i=n(381),o={input:!0,option:!0,optgroup:!0,select:!0,button:!0,datalist:!0,textarea:!0},a={tr:{tr:!0,th:!0,td:!0},th:{th:!0},td:{thead:!0,th:!0,td:!0},body:{head:!0,link:!0,script:!0},li:{li:!0},p:{p:!0},h1:{p:!0},h2:{p:!0},h3:{p:!0},h4:{p:!0},h5:{p:!0},h6:{p:!0},select:o,input:o,output:o,button:o,datalist:o,textarea:o,option:{option:!0},optgroup:{optgroup:!0}},s={__proto__:null,area:!0,base:!0,basefont:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,isindex:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,path:!0,circle:!0,ellipse:!0,line:!0,rect:!0,use:!0,stop:!0,polyline:!0,polygon:!0},u=/\s|\//;n(42)(r,n(143).EventEmitter),r.prototype._updatePosition=function(e){null===this.endIndex?this._tokenizer._sectionStart<=e?this.startIndex=0:this.startIndex=this._tokenizer._sectionStart-e:this.startIndex=this.endIndex+1,this.endIndex=this._tokenizer.getAbsoluteIndex()},r.prototype.ontext=function(e){this._updatePosition(1),this.endIndex--,this._cbs.ontext&&this._cbs.ontext(e)},r.prototype.onopentagname=function(e){if(this._lowerCaseTagNames&&(e=e.toLowerCase()),this._tagname=e,!this._options.xmlMode&&e in a)for(var t;(t=this._stack[this._stack.length-1])in a[e];this.onclosetag(t));!this._options.xmlMode&&e in s||this._stack.push(e),this._cbs.onopentagname&&this._cbs.onopentagname(e),this._cbs.onopentag&&(this._attribs={})},r.prototype.onopentagend=function(){this._updatePosition(1),this._attribs&&(this._cbs.onopentag&&this._cbs.onopentag(this._tagname,this._attribs),this._attribs=null),!this._options.xmlMode&&this._cbs.onclosetag&&this._tagname in s&&this._cbs.onclosetag(this._tagname),this._tagname=""},r.prototype.onclosetag=function(e){if(this._updatePosition(1),this._lowerCaseTagNames&&(e=e.toLowerCase()),!this._stack.length||e in s&&!this._options.xmlMode)this._options.xmlMode||"br"!==e&&"p"!==e||(this.onopentagname(e),this._closeCurrentTag());else{var t=this._stack.lastIndexOf(e);if(-1!==t)if(this._cbs.onclosetag)for(t=this._stack.length-t;t--;)this._cbs.onclosetag(this._stack.pop());else this._stack.length=t;else"p"!==e||this._options.xmlMode||(this.onopentagname(e),this._closeCurrentTag())}},r.prototype.onselfclosingtag=function(){this._options.xmlMode||this._options.recognizeSelfClosing?this._closeCurrentTag():this.onopentagend()},r.prototype._closeCurrentTag=function(){var e=this._tagname;this.onopentagend(),this._stack[this._stack.length-1]===e&&(this._cbs.onclosetag&&this._cbs.onclosetag(e),this._stack.pop())},r.prototype.onattribname=function(e){this._lowerCaseAttributeNames&&(e=e.toLowerCase()),this._attribname=e},r.prototype.onattribdata=function(e){this._attribvalue+=e},r.prototype.onattribend=function(){this._cbs.onattribute&&this._cbs.onattribute(this._attribname,this._attribvalue),this._attribs&&!Object.prototype.hasOwnProperty.call(this._attribs,this._attribname)&&(this._attribs[this._attribname]=this._attribvalue),this._attribname="",this._attribvalue=""},r.prototype._getInstructionName=function(e){var t=e.search(u),n=t<0?e:e.substr(0,t);return this._lowerCaseTagNames&&(n=n.toLowerCase()),n},r.prototype.ondeclaration=function(e){if(this._cbs.onprocessinginstruction){var t=this._getInstructionName(e);this._cbs.onprocessinginstruction("!"+t,"!"+e)}},r.prototype.onprocessinginstruction=function(e){if(this._cbs.onprocessinginstruction){var t=this._getInstructionName(e);this._cbs.onprocessinginstruction("?"+t,"?"+e)}},r.prototype.oncomment=function(e){this._updatePosition(4),this._cbs.oncomment&&this._cbs.oncomment(e),this._cbs.oncommentend&&this._cbs.oncommentend()},r.prototype.oncdata=function(e){this._updatePosition(1),this._options.xmlMode||this._options.recognizeCDATA?(this._cbs.oncdatastart&&this._cbs.oncdatastart(),this._cbs.ontext&&this._cbs.ontext(e),this._cbs.oncdataend&&this._cbs.oncdataend()):this.oncomment("[CDATA["+e+"]]")},r.prototype.onerror=function(e){this._cbs.onerror&&this._cbs.onerror(e)},r.prototype.onend=function(){if(this._cbs.onclosetag)for(var e=this._stack.length;e>0;this._cbs.onclosetag(this._stack[--e]));this._cbs.onend&&this._cbs.onend()},r.prototype.reset=function(){this._cbs.onreset&&this._cbs.onreset(),this._tokenizer.reset(),this._tagname="",this._attribname="",this._attribs=null,this._stack=[],this._cbs.onparserinit&&this._cbs.onparserinit(this)},r.prototype.parseComplete=function(e){this.reset(),this.end(e)},r.prototype.write=function(e){this._tokenizer.write(e)},r.prototype.end=function(e){this._tokenizer.end(e)},r.prototype.pause=function(){this._tokenizer.pause()},r.prototype.resume=function(){this._tokenizer.resume()},r.prototype.parseChunk=r.prototype.write,r.prototype.done=r.prototype.end,e.exports=r},function(e,t,n){function r(e){return" "===e||"\n"===e||"\t"===e||"\f"===e||"\r"===e}function i(e,t,n){var r=e.toLowerCase();return e===r?function(e){e===r?this._state=t:(this._state=n,this._index--)}:function(i){i===r||i===e?this._state=t:(this._state=n,this._index--)}}function o(e,t){var n=e.toLowerCase();return function(r){r===n||r===e?this._state=t:(this._state=d,this._index--)}}function a(e,t){this._state=f,this._buffer="",this._sectionStart=0,this._index=0,this._bufferOffset=0,this._baseState=f,this._special=de,this._cbs=t,this._running=!0,this._ended=!1,this._xmlMode=!(!e||!e.xmlMode),this._decodeEntities=!(!e||!e.decodeEntities)}e.exports=a;var s=n(369),u=n(204),l=n(370),c=n(205),p=0,f=p++,h=p++,d=p++,m=p++,v=p++,g=p++,y=p++,_=p++,b=p++,x=p++,w=p++,k=p++,E=p++,S=p++,C=p++,A=p++,D=p++,O=p++,M=p++,T=p++,P=p++,I=p++,R=p++,j=p++,F=p++,N=p++,B=p++,L=p++,q=p++,z=p++,U=p++,W=p++,V=p++,H=p++,G=p++,J=p++,K=p++,X=p++,Y=p++,$=p++,Z=p++,Q=p++,ee=p++,te=p++,ne=p++,re=p++,ie=p++,oe=p++,ae=p++,se=p++,ue=p++,le=p++,ce=p++,pe=p++,fe=p++,he=0,de=he++,me=he++,ve=he++;a.prototype._stateText=function(e){"<"===e?(this._index>this._sectionStart&&this._cbs.ontext(this._getSection()),this._state=h,this._sectionStart=this._index):this._decodeEntities&&this._special===de&&"&"===e&&(this._index>this._sectionStart&&this._cbs.ontext(this._getSection()),this._baseState=f,this._state=ue,this._sectionStart=this._index)},a.prototype._stateBeforeTagName=function(e){"/"===e?this._state=v:"<"===e?(this._cbs.ontext(this._getSection()),this._sectionStart=this._index):">"===e||this._special!==de||r(e)?this._state=f:"!"===e?(this._state=C,this._sectionStart=this._index+1):"?"===e?(this._state=D,this._sectionStart=this._index+1):(this._state=this._xmlMode||"s"!==e&&"S"!==e?d:U,this._sectionStart=this._index)},a.prototype._stateInTagName=function(e){("/"===e||">"===e||r(e))&&(this._emitToken("onopentagname"),this._state=_,this._index--)},a.prototype._stateBeforeCloseingTagName=function(e){r(e)||(">"===e?this._state=f:this._special!==de?"s"===e||"S"===e?this._state=W:(this._state=f,this._index--):(this._state=g,this._sectionStart=this._index))},a.prototype._stateInCloseingTagName=function(e){(">"===e||r(e))&&(this._emitToken("onclosetag"),this._state=y,this._index--)},a.prototype._stateAfterCloseingTagName=function(e){">"===e&&(this._state=f,this._sectionStart=this._index+1)},a.prototype._stateBeforeAttributeName=function(e){">"===e?(this._cbs.onopentagend(),this._state=f,this._sectionStart=this._index+1):"/"===e?this._state=m:r(e)||(this._state=b,this._sectionStart=this._index)},a.prototype._stateInSelfClosingTag=function(e){">"===e?(this._cbs.onselfclosingtag(),this._state=f,this._sectionStart=this._index+1):r(e)||(this._state=_,this._index--)},a.prototype._stateInAttributeName=function(e){("="===e||"/"===e||">"===e||r(e))&&(this._cbs.onattribname(this._getSection()),this._sectionStart=-1,this._state=x,this._index--)},a.prototype._stateAfterAttributeName=function(e){"="===e?this._state=w:"/"===e||">"===e?(this._cbs.onattribend(),this._state=_,this._index--):r(e)||(this._cbs.onattribend(),this._state=b,this._sectionStart=this._index)},a.prototype._stateBeforeAttributeValue=function(e){'"'===e?(this._state=k,this._sectionStart=this._index+1):"'"===e?(this._state=E,this._sectionStart=this._index+1):r(e)||(this._state=S,this._sectionStart=this._index,this._index--)},a.prototype._stateInAttributeValueDoubleQuotes=function(e){'"'===e?(this._emitToken("onattribdata"),this._cbs.onattribend(),this._state=_):this._decodeEntities&&"&"===e&&(this._emitToken("onattribdata"),this._baseState=this._state,this._state=ue,this._sectionStart=this._index)},a.prototype._stateInAttributeValueSingleQuotes=function(e){"'"===e?(this._emitToken("onattribdata"),this._cbs.onattribend(),this._state=_):this._decodeEntities&&"&"===e&&(this._emitToken("onattribdata"),this._baseState=this._state,this._state=ue,this._sectionStart=this._index)},a.prototype._stateInAttributeValueNoQuotes=function(e){r(e)||">"===e?(this._emitToken("onattribdata"),this._cbs.onattribend(),this._state=_,this._index--):this._decodeEntities&&"&"===e&&(this._emitToken("onattribdata"),this._baseState=this._state,this._state=ue,this._sectionStart=this._index)},a.prototype._stateBeforeDeclaration=function(e){this._state="["===e?I:"-"===e?O:A},a.prototype._stateInDeclaration=function(e){">"===e&&(this._cbs.ondeclaration(this._getSection()),this._state=f,this._sectionStart=this._index+1)},a.prototype._stateInProcessingInstruction=function(e){">"===e&&(this._cbs.onprocessinginstruction(this._getSection()),this._state=f,this._sectionStart=this._index+1)},a.prototype._stateBeforeComment=function(e){"-"===e?(this._state=M,this._sectionStart=this._index+1):this._state=A},a.prototype._stateInComment=function(e){"-"===e&&(this._state=T)},a.prototype._stateAfterComment1=function(e){this._state="-"===e?P:M},a.prototype._stateAfterComment2=function(e){">"===e?(this._cbs.oncomment(this._buffer.substring(this._sectionStart,this._index-2)),this._state=f,this._sectionStart=this._index+1):"-"!==e&&(this._state=M)},a.prototype._stateBeforeCdata1=i("C",R,A),a.prototype._stateBeforeCdata2=i("D",j,A),a.prototype._stateBeforeCdata3=i("A",F,A),a.prototype._stateBeforeCdata4=i("T",N,A),a.prototype._stateBeforeCdata5=i("A",B,A),a.prototype._stateBeforeCdata6=function(e){"["===e?(this._state=L,this._sectionStart=this._index+1):(this._state=A,this._index--)},a.prototype._stateInCdata=function(e){"]"===e&&(this._state=q)},a.prototype._stateAfterCdata1=function(e,t){return function(n){n===e&&(this._state=t)}}("]",z),a.prototype._stateAfterCdata2=function(e){">"===e?(this._cbs.oncdata(this._buffer.substring(this._sectionStart,this._index-2)),this._state=f,this._sectionStart=this._index+1):"]"!==e&&(this._state=L)},a.prototype._stateBeforeSpecial=function(e){"c"===e||"C"===e?this._state=V:"t"===e||"T"===e?this._state=ee:(this._state=d,this._index--)},a.prototype._stateBeforeSpecialEnd=function(e){this._special!==me||"c"!==e&&"C"!==e?this._special!==ve||"t"!==e&&"T"!==e?this._state=f:this._state=ie:this._state=X},a.prototype._stateBeforeScript1=o("R",H),a.prototype._stateBeforeScript2=o("I",G),a.prototype._stateBeforeScript3=o("P",J),a.prototype._stateBeforeScript4=o("T",K),a.prototype._stateBeforeScript5=function(e){("/"===e||">"===e||r(e))&&(this._special=me),this._state=d,this._index--},a.prototype._stateAfterScript1=i("R",Y,f),a.prototype._stateAfterScript2=i("I",$,f),a.prototype._stateAfterScript3=i("P",Z,f),a.prototype._stateAfterScript4=i("T",Q,f),a.prototype._stateAfterScript5=function(e){">"===e||r(e)?(this._special=de,this._state=g,this._sectionStart=this._index-6,this._index--):this._state=f},a.prototype._stateBeforeStyle1=o("Y",te),a.prototype._stateBeforeStyle2=o("L",ne),a.prototype._stateBeforeStyle3=o("E",re),a.prototype._stateBeforeStyle4=function(e){("/"===e||">"===e||r(e))&&(this._special=ve),this._state=d,this._index--},a.prototype._stateAfterStyle1=i("Y",oe,f),a.prototype._stateAfterStyle2=i("L",ae,f),a.prototype._stateAfterStyle3=i("E",se,f),a.prototype._stateAfterStyle4=function(e){">"===e||r(e)?(this._special=de,this._state=g,this._sectionStart=this._index-5,this._index--):this._state=f},a.prototype._stateBeforeEntity=i("#",le,ce),a.prototype._stateBeforeNumericEntity=i("X",fe,pe),a.prototype._parseNamedEntityStrict=function(){if(this._sectionStart+1<this._index){var e=this._buffer.substring(this._sectionStart+1,this._index),t=this._xmlMode?c:u;t.hasOwnProperty(e)&&(this._emitPartial(t[e]),this._sectionStart=this._index+1)}},a.prototype._parseLegacyEntity=function(){var e=this._sectionStart+1,t=this._index-e;for(t>6&&(t=6);t>=2;){var n=this._buffer.substr(e,t);if(l.hasOwnProperty(n))return this._emitPartial(l[n]),void(this._sectionStart+=t+1);t--}},a.prototype._stateInNamedEntity=function(e){";"===e?(this._parseNamedEntityStrict(),this._sectionStart+1<this._index&&!this._xmlMode&&this._parseLegacyEntity(),this._state=this._baseState):(e<"a"||e>"z")&&(e<"A"||e>"Z")&&(e<"0"||e>"9")&&(this._xmlMode||this._sectionStart+1===this._index||(this._baseState!==f?"="!==e&&this._parseNamedEntityStrict():this._parseLegacyEntity()),this._state=this._baseState,this._index--)},a.prototype._decodeNumericEntity=function(e,t){var n=this._sectionStart+e;if(n!==this._index){var r=this._buffer.substring(n,this._index),i=parseInt(r,t);this._emitPartial(s(i)),this._sectionStart=this._index}else this._sectionStart--;this._state=this._baseState},a.prototype._stateInNumericEntity=function(e){";"===e?(this._decodeNumericEntity(2,10),this._sectionStart++):(e<"0"||e>"9")&&(this._xmlMode?this._state=this._baseState:this._decodeNumericEntity(2,10),this._index--)},a.prototype._stateInHexEntity=function(e){";"===e?(this._decodeNumericEntity(3,16),this._sectionStart++):(e<"a"||e>"f")&&(e<"A"||e>"F")&&(e<"0"||e>"9")&&(this._xmlMode?this._state=this._baseState:this._decodeNumericEntity(3,16),this._index--)},a.prototype._cleanup=function(){this._sectionStart<0?(this._buffer="",this._bufferOffset+=this._index,this._index=0):this._running&&(this._state===f?(this._sectionStart!==this._index&&this._cbs.ontext(this._buffer.substr(this._sectionStart)),this._buffer="",this._bufferOffset+=this._index,this._index=0):this._sectionStart===this._index?(this._buffer="",this._bufferOffset+=this._index,this._index=0):(this._buffer=this._buffer.substr(this._sectionStart),this._index-=this._sectionStart,this._bufferOffset+=this._sectionStart),this._sectionStart=0)},a.prototype.write=function(e){this._ended&&this._cbs.onerror(Error(".write() after done!")),this._buffer+=e,this._parse()},a.prototype._parse=function(){for(;this._index<this._buffer.length&&this._running;){var e=this._buffer.charAt(this._index);this._state===f?this._stateText(e):this._state===h?this._stateBeforeTagName(e):this._state===d?this._stateInTagName(e):this._state===v?this._stateBeforeCloseingTagName(e):this._state===g?this._stateInCloseingTagName(e):this._state===y?this._stateAfterCloseingTagName(e):this._state===m?this._stateInSelfClosingTag(e):this._state===_?this._stateBeforeAttributeName(e):this._state===b?this._stateInAttributeName(e):this._state===x?this._stateAfterAttributeName(e):this._state===w?this._stateBeforeAttributeValue(e):this._state===k?this._stateInAttributeValueDoubleQuotes(e):this._state===E?this._stateInAttributeValueSingleQuotes(e):this._state===S?this._stateInAttributeValueNoQuotes(e):this._state===C?this._stateBeforeDeclaration(e):this._state===A?this._stateInDeclaration(e):this._state===D?this._stateInProcessingInstruction(e):this._state===O?this._stateBeforeComment(e):this._state===M?this._stateInComment(e):this._state===T?this._stateAfterComment1(e):this._state===P?this._stateAfterComment2(e):this._state===I?this._stateBeforeCdata1(e):this._state===R?this._stateBeforeCdata2(e):this._state===j?this._stateBeforeCdata3(e):this._state===F?this._stateBeforeCdata4(e):this._state===N?this._stateBeforeCdata5(e):this._state===B?this._stateBeforeCdata6(e):this._state===L?this._stateInCdata(e):this._state===q?this._stateAfterCdata1(e):this._state===z?this._stateAfterCdata2(e):this._state===U?this._stateBeforeSpecial(e):this._state===W?this._stateBeforeSpecialEnd(e):this._state===V?this._stateBeforeScript1(e):this._state===H?this._stateBeforeScript2(e):this._state===G?this._stateBeforeScript3(e):this._state===J?this._stateBeforeScript4(e):this._state===K?this._stateBeforeScript5(e):this._state===X?this._stateAfterScript1(e):this._state===Y?this._stateAfterScript2(e):this._state===$?this._stateAfterScript3(e):this._state===Z?this._stateAfterScript4(e):this._state===Q?this._stateAfterScript5(e):this._state===ee?this._stateBeforeStyle1(e):this._state===te?this._stateBeforeStyle2(e):this._state===ne?this._stateBeforeStyle3(e):this._state===re?this._stateBeforeStyle4(e):this._state===ie?this._stateAfterStyle1(e):this._state===oe?this._stateAfterStyle2(e):this._state===ae?this._stateAfterStyle3(e):this._state===se?this._stateAfterStyle4(e):this._state===ue?this._stateBeforeEntity(e):this._state===le?this._stateBeforeNumericEntity(e):this._state===ce?this._stateInNamedEntity(e):this._state===pe?this._stateInNumericEntity(e):this._state===fe?this._stateInHexEntity(e):this._cbs.onerror(Error("unknown _state"),this._state),this._index++}this._cleanup()},a.prototype.pause=function(){this._running=!1},a.prototype.resume=function(){this._running=!0,this._index<this._buffer.length&&this._parse(),this._ended&&this._finish()},a.prototype.end=function(e){this._ended&&this._cbs.onerror(Error(".end() after done!")),e&&this.write(e),this._ended=!0,this._running&&this._finish()},a.prototype._finish=function(){this._sectionStart<this._index&&this._handleTrailingData(),this._cbs.onend()},a.prototype._handleTrailingData=function(){var e=this._buffer.substr(this._sectionStart);this._state===L||this._state===q||this._state===z?this._cbs.oncdata(e):this._state===M||this._state===T||this._state===P?this._cbs.oncomment(e):this._state!==ce||this._xmlMode?this._state!==pe||this._xmlMode?this._state!==fe||this._xmlMode?this._state!==d&&this._state!==_&&this._state!==w&&this._state!==x&&this._state!==b&&this._state!==E&&this._state!==k&&this._state!==S&&this._state!==g&&this._cbs.ontext(e):(this._decodeNumericEntity(3,16),this._sectionStart<this._index&&(this._state=this._baseState,this._handleTrailingData())):(this._decodeNumericEntity(2,10),this._sectionStart<this._index&&(this._state=this._baseState,this._handleTrailingData())):(this._parseLegacyEntity(),this._sectionStart<this._index&&(this._state=this._baseState,this._handleTrailingData()))},a.prototype.reset=function(){a.call(this,{xmlMode:this._xmlMode,decodeEntities:this._decodeEntities},this._cbs)},a.prototype.getAbsoluteIndex=function(){return this._bufferOffset+this._index},a.prototype._getSection=function(){return this._buffer.substring(this._sectionStart,this._index)},a.prototype._emitToken=function(e){this._cbs[e](this._getSection()),this._sectionStart=-1},a.prototype._emitPartial=function(e){this._baseState!==f?this._cbs.onattribdata(e):this._cbs.ontext(e)}},function(e,t,n){function r(e,t){var n=this._parser=new i(e,t),r=this._decoder=new a;o.call(this,{decodeStrings:!1}),this.once("finish",function(){n.end(r.end())})}e.exports=r;var i=n(380),o=n(493).Writable||n(1209).Writable,a=n(265).StringDecoder,s=n(40).Buffer;n(42)(r,o),o.prototype._write=function(e,t,n){e instanceof s&&(e=this._decoder.write(e)),this._parser.write(e),n()}},function(e,t,n){"use strict";function r(e,t){-1===e.indexOf(t)&&e.push(t)}function i(e,t){if(Array.isArray(t))for(var n=0,i=t.length;n<i;++n)r(e,t[n]);else r(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e instanceof Object&&!Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r,i){for(var o=0,a=e.length;o<a;++o){var s=e[o](t,n,r,i);if(s)return s}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t){function n(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}e.exports=n},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";var r=n(81);e.exports=new r({include:[n(389)]})},function(e,t,n){"use strict";var r=n(81);e.exports=new r({include:[n(212)],implicit:[n(808),n(800),n(802),n(801)]})},function(e,t,n){"use strict";var r=n(821),i=r.a.Symbol;t.a=i},function(e,t,n){"use strict";function r(e){if(!n.i(a.a)(e)||n.i(i.a)(e)!=s)return!1;var t=n.i(o.a)(e);if(null===t)return!0;var r=p.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&c.call(r)==f}var i=n(815),o=n(817),a=n(822),s="[object Object]",u=Function.prototype,l=Object.prototype,c=u.toString,p=l.hasOwnProperty,f=c.call(Object);t.a=r},function(e,t,n){var r=n(43),i=r.Uint8Array;e.exports=i},function(e,t,n){function r(e,t){var n=a(e),r=!n&&o(e),c=!n&&!r&&s(e),f=!n&&!r&&!c&&l(e),h=n||r||c||f,d=h?i(e.length,String):[],m=d.length;for(var v in e)!t&&!p.call(e,v)||h&&("length"==v||c&&("offset"==v||"parent"==v)||f&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||u(v,m))||d.push(v);return d}var i=n(870),o=n(226),a=n(20),s=n(227),u=n(152),l=n(423),c=Object.prototype,p=c.hasOwnProperty;e.exports=r},function(e,t){function n(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}e.exports=n},function(e,t){function n(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}e.exports=n},function(e,t,n){function r(e,t,n){"__proto__"==t&&i?i(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var i=n(403);e.exports=r},function(e,t,n){function r(e,t,n,T,P,I){var R,j=t&k,F=t&E,N=t&S;if(n&&(R=P?n(e,T,P,I):n(e)),void 0!==R)return R;if(!x(e))return e;var B=_(e);if(B){if(R=v(e),!j)return c(e,R)}else{var L=m(e),q=L==A||L==D;if(b(e))return l(e,j);if(L==O||L==C||q&&!P){if(R=F||q?{}:y(e),!j)return F?f(e,u(R,e)):p(e,s(R,e))}else{if(!M[L])return P?e:{};R=g(e,L,r,j)}}I||(I=new i);var z=I.get(e);if(z)return z;I.set(e,R);var U=N?F?d:h:F?keysIn:w,W=B?void 0:U(e);return o(W||e,function(i,o){W&&(o=i,i=e[o]),a(R,o,r(i,t,n,o,e,I))}),R}var i=n(215),o=n(837),a=n(148),s=n(841),u=n(842),l=n(875),c=n(882),p=n(883),f=n(884),h=n(894),d=n(407),m=n(409),v=n(905),g=n(906),y=n(907),_=n(20),b=n(227),x=n(38),w=n(59),k=1,E=2,S=4,C="[object Arguments]",A="[object Function]",D="[object GeneratorFunction]",O="[object Object]",M={};M[C]=M["[object Array]"]=M["[object ArrayBuffer]"]=M["[object DataView]"]=M["[object Boolean]"]=M["[object Date]"]=M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Map]"]=M["[object Number]"]=M[O]=M["[object RegExp]"]=M["[object Set]"]=M["[object String]"]=M["[object Symbol]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M["[object Error]"]=M[A]=M["[object WeakMap]"]=!1,e.exports=r},function(e,t,n){function r(e,t,n){var r=t(e);return o(e)?r:i(r,n(e))}var i=n(216),o=n(20);e.exports=r},function(e,t,n){function r(e,t,n,s,u){return e===t||(null==e||null==t||!o(e)&&!a(t)?e!==e&&t!==t:i(e,t,n,s,r,u))}var i=n(852),o=n(38),a=n(68);e.exports=r},function(e,t){function n(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}e.exports=n},function(e,t,n){function r(e){if("string"==typeof e)return e;if(a(e))return o(e,r)+"";if(s(e))return c?c.call(e):"";var t=e+"";return"0"==t&&1/e==-u?"-0":t}var i=n(82),o=n(394),a=n(20),s=n(155),u=1/0,l=i?i.prototype:void 0,c=l?l.toString:void 0;e.exports=r},function(e,t,n){function r(e){return function(t){return i(a(o(t).replace(s,"")),e,"")}}var i=n(147),o=n(944),a=n(960),s=RegExp("['’]","g");e.exports=r},function(e,t,n){var r=n(67),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},function(e,t,n){function r(e,t,n,r,l,c){var p=n&s,f=e.length,h=t.length;if(f!=h&&!(p&&h>f))return!1;var d=c.get(e);if(d&&c.get(t))return d==t;var m=-1,v=!0,g=n&u?new i:void 0;for(c.set(e,t),c.set(t,e);++m<f;){var y=e[m],_=t[m];if(r)var b=p?r(_,y,m,t,e,c):r(y,_,m,e,t,c);if(void 0!==b){if(b)continue;v=!1;break}if(g){if(!o(t,function(e,t){if(!a(g,t)&&(y===e||l(y,e,n,r,c)))return g.push(t)})){v=!1;break}}else if(y!==_&&!l(y,_,n,r,c)){v=!1;break}}return c.delete(e),c.delete(t),v}var i=n(832),o=n(395),a=n(873),s=1,u=2;e.exports=r},function(e,t,n){function r(e){return a(o(e,void 0,i),e+"")}var i=n(946),o=n(415),a=n(417);e.exports=r},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(t,n(17))},function(e,t,n){function r(e){return i(e,a,o)}var i=n(398),o=n(408),a=n(424);e.exports=r},function(e,t,n){var r=n(216),i=n(219),o=n(220),a=n(426),s=Object.getOwnPropertySymbols,u=s?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=u},function(e,t,n){var r=n(828),i=n(213),o=n(830),a=n(831),s=n(833),u=n(66),l=n(418),c=l(r),p=l(i),f=l(o),h=l(a),d=l(s),m=u;(r&&"[object DataView]"!=m(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=m(new i)||o&&"[object Promise]"!=m(o.resolve())||a&&"[object Set]"!=m(new a)||s&&"[object WeakMap]"!=m(new s))&&(m=function(e){var t=u(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case c:return"[object DataView]";case p:return"[object Map]";case f:return"[object Promise]";case h:return"[object Set]";case d:return"[object WeakMap]"}return t}),e.exports=m},function(e,t){function n(e){return r.test(e)}var r=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=n},function(e,t,n){function r(e,t,n){if(!s(n))return!1;var r=typeof t;return!!("number"==r?o(n)&&a(t,n.length):"string"==r&&t in n)&&i(n[t],e)}var i=n(120),o=n(86),a=n(152),s=n(38);e.exports=r},function(e,t,n){function r(e){return e===e&&!i(e)}var i=n(38);e.exports=r},function(e,t){function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}e.exports=n},function(e,t){function n(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}e.exports=n},function(e,t,n){function r(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var r=arguments,a=-1,s=o(r.length-t,0),u=Array(s);++a<s;)u[a]=r[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=r[a];return l[t]=n(u),i(e,this,l)}}var i=n(836),o=Math.max;e.exports=r},function(e,t){function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}e.exports=n},function(e,t,n){var r=n(868),i=n(929),o=i(r);e.exports=o},function(e,t){function n(e){if(null!=e){try{return i.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var r=Function.prototype,i=r.toString;e.exports=n},function(e,t,n){function r(e,t){return null!=e&&o(e,t,i)}var i=n(850),o=n(898);e.exports=r},function(e,t,n){function r(e){if(!o(e))return!1;var t=i(e);return t==s||t==u||t==a||t==l}var i=n(66),o=n(38),a="[object AsyncFunction]",s="[object Function]",u="[object GeneratorFunction]",l="[object Proxy]";e.exports=r},function(e,t,n){function r(e){if(!a(e)||i(e)!=s)return!1;var t=o(e);if(null===t)return!0;var n=p.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==f}var i=n(66),o=n(219),a=n(68),s="[object Object]",u=Function.prototype,l=Object.prototype,c=u.toString,p=l.hasOwnProperty,f=c.call(Object);e.exports=r},function(e,t,n){function r(e){return"string"==typeof e||!o(e)&&a(e)&&i(e)==s}var i=n(66),o=n(20),a=n(68),s="[object String]";e.exports=r},function(e,t,n){var r=n(855),i=n(871),o=n(924),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},function(e,t,n){function r(e){return a(e)?i(e,!0):o(e)}var i=n(393),o=n(857),a=n(86);e.exports=r},function(e,t,n){function r(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(r.Cache||i),n}var i=n(214),o="Expected a function";r.Cache=i,e.exports=r},function(e,t){function n(){return[]}e.exports=n},function(e,t,n){function r(e){var t=i(e),n=t%1;return t===t?n?t-n:t:0}var i=n(958);e.exports=r},function(e,t,n){var r=n(889),i=r("toUpperCase");e.exports=i},function(e,t,n){"use strict";function r(e){var t,n,r=o[e];if(r)return r;for(r=o[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),r.push(n);for(t=0;t<e.length;t++)n=e.charCodeAt(t),r[n]="%"+("0"+n.toString(16).toUpperCase()).slice(-2);return r}function i(e,t){var n;return"string"!=typeof t&&(t=i.defaultChars),n=r(t),e.replace(/(%[a-f0-9]{2})+/gi,function(e){var t,r,i,o,a,s,u,l="";for(t=0,r=e.length;t<r;t+=3)i=parseInt(e.slice(t+1,t+3),16),i<128?l+=n[i]:192==(224&i)&&t+3<r&&128==(192&(o=parseInt(e.slice(t+4,t+6),16)))?(u=i<<6&1984|63&o,l+=u<128?"��":String.fromCharCode(u),t+=3):224==(240&i)&&t+6<r&&(o=parseInt(e.slice(t+4,t+6),16),a=parseInt(e.slice(t+7,t+9),16),128==(192&o)&&128==(192&a))?(u=i<<12&61440|o<<6&4032|63&a,l+=u<2048||u>=55296&&u<=57343?"���":String.fromCharCode(u),t+=6):240==(248&i)&&t+9<r&&(o=parseInt(e.slice(t+4,t+6),16),a=parseInt(e.slice(t+7,t+9),16),s=parseInt(e.slice(t+10,t+12),16),128==(192&o)&&128==(192&a)&&128==(192&s))?(u=i<<18&1835008|o<<12&258048|a<<6&4032|63&s,u<65536||u>1114111?l+="����":(u-=65536,l+=String.fromCharCode(55296+(u>>10),56320+(1023&u))),t+=9):l+="�";return l})}var o={};i.defaultChars=";/?:@&=+$,#",i.componentChars="",e.exports=i},function(e,t,n){"use strict";function r(e){var t,n,r=o[e];if(r)return r;for(r=o[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),/^[0-9a-z]$/i.test(n)?r.push(n):r.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2));for(t=0;t<e.length;t++)r[e.charCodeAt(t)]=e[t];return r}function i(e,t,n){var o,a,s,u,l,c="";for("string"!=typeof t&&(n=t,t=i.defaultChars),void 0===n&&(n=!0),l=r(t),o=0,a=e.length;o<a;o++)if(s=e.charCodeAt(o),n&&37===s&&o+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3)))c+=e.slice(o,o+3),o+=2;else if(s<128)c+=l[s];else if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&o+1<a&&(u=e.charCodeAt(o+1))>=56320&&u<=57343){c+=encodeURIComponent(e[o]+e[o+1]),o++;continue}c+="%EF%BF%BD"}else c+=encodeURIComponent(e[o]);return c}var o={};i.defaultChars=";/?:@&=+$,-_.!~*'()#",i.componentChars="-_.!~*'()",e.exports=i},function(e,t,n){"use strict";var r=n(65);e.exports=function(e,t,n){var i;return isNaN(e)?(i=t,i>=0?n&&i?i-1:i:1):!1!==e&&r(e)}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=n(1211),a=r(o),s=n(503),u=r(s),l=n(985),c=r(l),p=function(){function e(t,n,r,o,a,s){i(this,e),this.name="CssSyntaxError",this.reason=t,a&&(this.file=a),o&&(this.source=o),s&&(this.plugin=s),void 0!==n&&void 0!==r&&(this.line=n,this.column=r),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}return e.prototype.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},e.prototype.showSourceCode=function(e){function t(t){return e&&u.default.red?u.default.red.bold(t):t}function n(t){return e&&u.default.gray?u.default.gray(t):t}var r=this;if(!this.source)return"";var i=this.source;void 0===e&&(e=a.default),e&&(i=(0,c.default)(i));var o=i.split(/\r?\n/),s=Math.max(this.line-3,0),l=Math.min(this.line+2,o.length),p=String(l).length;return o.slice(s,l).map(function(e,i){var o=s+1+i,a=" "+(" "+o).slice(-p)+" | ";if(o===r.line){var u=n(a.replace(/\d/g," "))+e.slice(0,r.column-1).replace(/[^\t]/g," ");return t(">")+n(a)+e+"\n "+u+t("^")}return" "+n(a)+e}).join("\n")},e.prototype.toString=function(){var e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e},e}();t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(432),s=r(a),u=n(983),l=r(u),c=n(230),p=r(c),f=0,h=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,e),this.css=t.toString(),"\ufeff"!==this.css[0]&&"￾"!==this.css[0]||(this.css=this.css.slice(1)),n.from&&(/^\w+:\/\//.test(n.from)?this.file=n.from:this.file=p.default.resolve(n.from));var r=new l.default(this.css,n);if(r.text){this.map=r;var o=r.consumer().file;!this.file&&o&&(this.file=this.mapResolve(o))}this.file||(f+=1,this.id="<input css "+f+">"),this.map&&(this.map.file=this.from)}return e.prototype.error=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0,o=this.origin(t,n);return i=o?new s.default(e,o.line,o.column,o.source,o.file,r.plugin):new s.default(e,t,n,this.css,this.file,r.plugin),i.input={line:t,column:n,source:this.css},this.file&&(i.input.file=this.file),i},e.prototype.origin=function(e,t){if(!this.map)return!1;var n=this.map.consumer(),r=n.originalPositionFor({line:e,column:t});if(!r.source)return!1;var i={file:this.mapResolve(r.source),line:r.line,column:r.column},o=n.sourceContentFor(r.source);return o&&(i.source=o),i},e.prototype.mapResolve=function(e){return/^\w+:\/\//.test(e)?e:p.default.resolve(this.map.consumer().sourceRoot||".",e)},o(e,[{key:"from",get:function(){return this.file||this.id}}]),e}();t.default=h,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return"object"===(void 0===e?"undefined":s(e))&&"function"==typeof e.then}t.__esModule=!0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=n(980),l=r(u),c=n(238),p=r(c),f=n(984),h=r(f),d=n(236),m=r(d),v=function(){function e(t,n,r){i(this,e),this.stringified=!1,this.processed=!1;var o=void 0;if("object"===(void 0===n?"undefined":s(n))&&"root"===n.type)o=n;else if(n instanceof e||n instanceof h.default)o=n.root,n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var a=m.default;r.syntax&&(a=r.syntax.parse),r.parser&&(a=r.parser),a.parse&&(a=a.parse);try{o=a(n,r)}catch(e){this.error=e}}this.result=new h.default(t,o,r)}return e.prototype.warnings=function(){return this.sync().warnings()},e.prototype.toString=function(){return this.css},e.prototype.then=function(e,t){return this.async().then(e,t)},e.prototype.catch=function(e){return this.async().catch(e)},e.prototype.handleError=function(e,t){try{if(this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(t.postcssVersion){var n=t.postcssPlugin,r=t.postcssVersion,i=this.result.processor.version,o=r.split("."),a=i.split(".");(o[0]!==a[0]||parseInt(o[1])>parseInt(a[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+i+", but "+n+" uses "+r+". Perhaps this is the source of the error below.")}}else e.plugin=t.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}},e.prototype.asyncTick=function(e,t){var n=this;if(this.plugin>=this.processor.plugins.length)return this.processed=!0,e();try{var r=this.processor.plugins[this.plugin],i=this.run(r);this.plugin+=1,o(i)?i.then(function(){n.asyncTick(e,t)}).catch(function(e){n.handleError(e,r),n.processed=!0,t(e)}):this.asyncTick(e,t)}catch(e){this.processed=!0,t(e)}},e.prototype.async=function(){var e=this;return this.processed?new Promise(function(t,n){e.error?n(e.error):t(e.stringify())}):this.processing?this.processing:(this.processing=new Promise(function(t,n){if(e.error)return n(e.error);e.plugin=0,e.asyncTick(t,n)}).then(function(){return e.processed=!0,e.stringify()}),this.processing)},e.prototype.sync=function(){if(this.processed)return this.result;if(this.processed=!0,this.processing)throw new Error("Use process(css).then(cb) to work with async plugins");if(this.error)throw this.error;for(var e=this.result.processor.plugins,t=Array.isArray(e),n=0,e=t?e:e[Symbol.iterator]();;){var r;if(t){if(n>=e.length)break;r=e[n++]}else{if(n=e.next(),n.done)break;r=n.value}var i=r;if(o(this.run(i)))throw new Error("Use process(css).then(cb) to work with async plugins")}return this.result},e.prototype.run=function(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){throw this.handleError(t,e),t}},e.prototype.stringify=function(){if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts,t=p.default;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);var n=new l.default(t,this.result.root,this.result.opts),r=n.generate();return this.result.css=r[0],this.result.map=r[1],this.result},a(e,[{key:"processor",get:function(){return this.result.processor}},{key:"opts",get:function(){return this.result.opts}},{key:"css",get:function(){return this.stringify().css}},{key:"content",get:function(){return this.stringify().content}},{key:"map",get:function(){return this.stringify().map}},{key:"root",get:function(){return this.sync().root}},{key:"messages",get:function(){return this.sync().messages}}]),e}();t.default=v,e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r={split:function(e,t,n){for(var r=[],i="",o=!1,a=0,s=!1,u=!1,l=0;l<e.length;l++){var c=e[l];s?u?u=!1:"\\"===c?u=!0:c===s&&(s=!1):'"'===c||"'"===c?s=c:"("===c?a+=1:")"===c?a>0&&(a-=1):0===a&&-1!==t.indexOf(c)&&(o=!0),o?(""!==i&&r.push(i.trim()),i="",o=!1):i+=c}return(n||""!==i)&&r.push(i.trim()),r},space:function(e){var t=[" ","\n","\t"];return r.split(e,t)},comma:function(e){return r.split(e,[","],!0)}};t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=n(434),a=function(e){return e&&e.__esModule?e:{default:e}}(o),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];r(this,e),this.version="6.0.14",this.plugins=this.normalize(t)}return e.prototype.use=function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this},e.prototype.process=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new a.default(this,e,t)},e.prototype.normalize=function(e){for(var t=[],n=e,r=Array.isArray(n),o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var s=a;if(s.postcss&&(s=s.postcss),"object"===(void 0===s?"undefined":i(s))&&Array.isArray(s.plugins))t=t.concat(s.plugins);else{if("function"!=typeof s)throw"object"===(void 0===s?"undefined":i(s))&&(s.parse||s.stringify)?new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation."):new Error(s+" is not a PostCSS plugin");t.push(s)}}return t},e}();t.default=s,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){return e[0].toUpperCase()+e.slice(1)}t.__esModule=!0;var o={colon:": ",indent:" ",beforeDecl:"\n",beforeRule:"\n",beforeOpen:" ",beforeClose:"\n",beforeComment:"\n",after:"\n",emptyBody:"",commentLeft:" ",commentRight:" "},a=function(){function e(t){r(this,e),this.builder=t}return e.prototype.stringify=function(e,t){this[e.type](e,t)},e.prototype.root=function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)},e.prototype.comment=function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)},e.prototype.decl=function(e,t){var n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)},e.prototype.rule=function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")},e.prototype.atrule=function(e,t){var n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{var i=(e.raws.between||"")+(t?";":"");this.builder(n+r+i,e)}},e.prototype.body=function(e){for(var t=e.nodes.length-1;t>0&&"comment"===e.nodes[t].type;)t-=1;for(var n=this.raw(e,"semicolon"),r=0;r<e.nodes.length;r++){var i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}},e.prototype.block=function(e,t){var n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start");var r=void 0;e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")},e.prototype.raw=function(e,t,n){var r=void 0;if(n||(n=t),t&&void 0!==(r=e.raws[t]))return r;var a=e.parent;if("before"===n&&(!a||"root"===a.type&&a.first===e))return"";if(!a)return o[n];var s=e.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);var u="raw"+i(n);return this[u]?r=this[u](s,e):s.walk(function(e){if(void 0!==(r=e.raws[t]))return!1}),void 0===r&&(r=o[n]),s.rawCache[n]=r,r},e.prototype.rawSemicolon=function(e){var t=void 0;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t},e.prototype.rawEmptyBody=function(e){var t=void 0;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t},e.prototype.rawIndent=function(e){if(e.raws.indent)return e.raws.indent;var t=void 0;return e.walk(function(n){var r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){var i=n.raws.before.split("\n");return t=i[i.length-1],t=t.replace(/[^\s]/g,""),!1}}),t},e.prototype.rawBeforeComment=function(e,t){var n=void 0;return e.walkComments(function(e){if(void 0!==e.raws.before)return n=e.raws.before,-1!==n.indexOf("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/[^\s]/g,"")),n},e.prototype.rawBeforeDecl=function(e,t){var n=void 0;return e.walkDecls(function(e){if(void 0!==e.raws.before)return n=e.raws.before,-1!==n.indexOf("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/[^\s]/g,"")),n},e.prototype.rawBeforeRule=function(e){var t=void 0;return e.walk(function(n){if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,-1!==t.indexOf("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/[^\s]/g,"")),t},e.prototype.rawBeforeClose=function(e){var t=void 0;return e.walk(function(e){if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,-1!==t.indexOf("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/[^\s]/g,"")),t},e.prototype.rawBeforeOpen=function(e){var t=void 0;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t},e.prototype.rawColon=function(e){var t=void 0;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t},e.prototype.beforeAfter=function(e,t){var n=void 0;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");for(var r=e.parent,i=0;r&&"root"!==r.type;)i+=1,r=r.parent;if(-1!==n.indexOf("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var a=0;a<i;a++)n+=o}return n},e.prototype.rawValue=function(e,t){var n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n},e}();t.default=a,e.exports=t.default},function(e,t,n){"use strict";function r(e){function t(t){throw e.error("Unclosed "+t,J,K-G)}function n(){return 0===Y.length&&K>=H}function r(){if(Y.length)return Y.pop();if(!(K>=H)){switch(T=O.charCodeAt(K),(T===u||T===c||T===f&&O.charCodeAt(K+1)!==u)&&(G=K,J+=1),T){case u:case l:case p:case f:case c:P=K;do{P+=1,(T=O.charCodeAt(P))===u&&(G=P,J+=1)}while(T===l||T===u||T===p||T===f||T===c);V=["space",O.slice(K,P)],K=P-1;break;case h:V=["[","[",J,K-G];break;case d:V=["]","]",J,K-G];break;case g:V=["{","{",J,K-G];break;case y:V=["}","}",J,K-G];break;case x:V=[":",":",J,K-G];break;case _:V=[";",";",J,K-G];break;case m:if(U=X.length?X.pop()[1]:"",W=O.charCodeAt(K+1),"url"===U&&W!==i&&W!==o&&W!==l&&W!==u&&W!==p&&W!==c&&W!==f){P=K;do{if(q=!1,-1===(P=O.indexOf(")",P+1))){if(M){P=K;break}t("bracket")}for(z=P;O.charCodeAt(z-1)===a;)z-=1,q=!q}while(q);V=["brackets",O.slice(K,P+1),J,K-G,J,P-G],K=P}else P=O.indexOf(")",K+1),F=O.slice(K,P+1),-1===P||S.test(F)?V=["(","(",J,K-G]:(V=["brackets",F,J,K-G,J,P-G],K=P);break;case v:V=[")",")",J,K-G];break;case i:case o:I=T===i?"'":'"',P=K;do{if(q=!1,-1===(P=O.indexOf(I,P+1))){if(M){P=K+1;break}t("string")}for(z=P;O.charCodeAt(z-1)===a;)z-=1,q=!q}while(q);F=O.slice(K,P+1),R=F.split("\n"),j=R.length-1,j>0?(B=J+j,L=P-R[j].length):(B=J,L=G),V=["string",O.slice(K,P+1),J,K-G,B,P-L],G=L,J=B,K=P;break;case w:k.lastIndex=K+1,k.test(O),P=0===k.lastIndex?O.length-1:k.lastIndex-2,V=["at-word",O.slice(K,P+1),J,K-G,J,P-G],K=P;break;case a:for(P=K,N=!0;O.charCodeAt(P+1)===a;)P+=1,N=!N;if(T=O.charCodeAt(P+1),N&&T!==s&&T!==l&&T!==u&&T!==p&&T!==f&&T!==c&&(P+=1,C.test(O.charAt(P)))){for(;C.test(O.charAt(P+1));)P+=1;O.charCodeAt(P+1)===l&&(P+=1)}V=["word",O.slice(K,P+1),J,K-G,J,P-G],K=P;break;default:T===s&&O.charCodeAt(K+1)===b?(P=O.indexOf("*/",K+2)+1,0===P&&(M?P=O.length:t("comment")),F=O.slice(K,P+1),R=F.split("\n"),j=R.length-1,j>0?(B=J+j,L=P-R[j].length):(B=J,L=G),V=["comment",F,J,K-G,B,P-L],G=L,J=B,K=P):(E.lastIndex=K+1,E.test(O),P=0===E.lastIndex?O.length-1:E.lastIndex-2,V=["word",O.slice(K,P+1),J,K-G,J,P-G],X.push(V),K=P)}return K++,V}}function A(e){Y.push(e)}var D=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},O=e.css.valueOf(),M=D.ignoreErrors,T=void 0,P=void 0,I=void 0,R=void 0,j=void 0,F=void 0,N=void 0,B=void 0,L=void 0,q=void 0,z=void 0,U=void 0,W=void 0,V=void 0,H=O.length,G=-1,J=1,K=0,X=[],Y=[];return{back:A,nextToken:r,endOfFile:n}}t.__esModule=!0,t.default=r;var i=39,o=34,a=92,s=47,u=10,l=32,c=12,p=9,f=13,h=91,d=93,m=40,v=41,g=123,y=125,_=59,b=42,x=58,w=64,k=/[ \n\t\r\f\{\(\)'"\\;\/\[\]#]/g,E=/[ \n\t\r\f\(\)\{\}:;@!'"\\\]\[#]|\/(?=\*)/g,S=/.[\\\/\("'\n]/,C=/[a-f0-9]/i;e.exports=t.default},function(e,t,n){function r(){this._array=[],this._set=a?new Map:Object.create(null)}var i=n(121),o=Object.prototype.hasOwnProperty,a="undefined"!=typeof Map;r.fromArray=function(e,t){for(var n=new r,i=0,o=e.length;i<o;i++)n.add(e[i],t);return n},r.prototype.size=function(){return a?this._set.size:Object.getOwnPropertyNames(this._set).length},r.prototype.add=function(e,t){var n=a?e:i.toSetString(e),r=a?this.has(e):o.call(this._set,n),s=this._array.length;r&&!t||this._array.push(e),r||(a?this._set.set(e,s):this._set[n]=s)},r.prototype.has=function(e){if(a)return this._set.has(e);var t=i.toSetString(e);return o.call(this._set,t)},r.prototype.indexOf=function(e){if(a){var t=this._set.get(e);if(t>=0)return t}else{var n=i.toSetString(e);if(o.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},r.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},r.prototype.toArray=function(){return this._array.slice()},t.ArraySet=r},function(e,t,n){function r(e){return e<0?1+(-e<<1):0+(e<<1)}function i(e){var t=1==(1&e),n=e>>1;return t?-n:n}var o=n(989);t.encode=function(e){var t,n="",i=r(e);do{t=31&i,i>>>=5,i>0&&(t|=32),n+=o.encode(t)}while(i>0);return n},t.decode=function(e,t,n){var r,a,s=e.length,u=0,l=0;do{if(t>=s)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(a=o.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));r=!!(32&a),a&=31,u+=a<<l,l+=5}while(r);n.value=i(u),n.rest=t}},function(e,t,n){function r(e){e||(e={}),this._file=o.getArg(e,"file",null),this._sourceRoot=o.getArg(e,"sourceRoot",null),this._skipValidation=o.getArg(e,"skipValidation",!1),this._sources=new a,this._names=new a,this._mappings=new s,this._sourcesContents=null}var i=n(440),o=n(121),a=n(439).ArraySet,s=n(991).MappingList;r.prototype._version=3,r.fromSourceMap=function(e){var t=e.sourceRoot,n=new r({file:e.file,sourceRoot:t});return e.eachMapping(function(e){var r={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,null!=t&&(r.source=o.relative(t,r.source)),r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),n.addMapping(r)}),e.sources.forEach(function(r){var i=r;null!==t&&(i=o.relative(t,r)),n._sources.has(i)||n._sources.add(i);var a=e.sourceContentFor(r);null!=a&&n.setSourceContent(r,a)}),n},r.prototype.addMapping=function(e){var t=o.getArg(e,"generated"),n=o.getArg(e,"original",null),r=o.getArg(e,"source",null),i=o.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,r,i),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=i&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:r,name:i})},r.prototype.setSourceContent=function(e,t){var n=e;null!=this._sourceRoot&&(n=o.relative(this._sourceRoot,n)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[o.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[o.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},r.prototype.applySourceMap=function(e,t,n){var r=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file}var i=this._sourceRoot;null!=i&&(r=o.relative(i,r));var s=new a,u=new a;this._mappings.unsortedForEach(function(t){if(t.source===r&&null!=t.originalLine){var a=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=a.source&&(t.source=a.source,null!=n&&(t.source=o.join(n,t.source)),null!=i&&(t.source=o.relative(i,t.source)),t.originalLine=a.line,t.originalColumn=a.column,null!=a.name&&(t.name=a.name))}var l=t.source;null==l||s.has(l)||s.add(l);var c=t.name;null==c||u.has(c)||u.add(c)},this),this._sources=s,this._names=u,e.sources.forEach(function(t){var r=e.sourceContentFor(t);null!=r&&(null!=n&&(t=o.join(n,t)),null!=i&&(t=o.relative(i,t)),this.setSourceContent(t,r))},this)},r.prototype._validateMapping=function(e,t,n,r){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))},r.prototype._serializeMappings=function(){for(var e,t,n,r,a=0,s=1,u=0,l=0,c=0,p=0,f="",h=this._mappings.toArray(),d=0,m=h.length;d<m;d++){if(t=h[d],e="",t.generatedLine!==s)for(a=0;t.generatedLine!==s;)e+=";",s++;else if(d>0){if(!o.compareByGeneratedPositionsInflated(t,h[d-1]))continue;e+=","}e+=i.encode(t.generatedColumn-a),a=t.generatedColumn,null!=t.source&&(r=this._sources.indexOf(t.source),e+=i.encode(r-p),p=r,e+=i.encode(t.originalLine-1-l),l=t.originalLine-1,e+=i.encode(t.originalColumn-u),u=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=i.encode(n-c),c=n)),f+=e}return f},r.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;null!=t&&(e=o.relative(t,e));var n=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)},r.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},r.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=r},function(e,t,n){t.SourceMapGenerator=n(441).SourceMapGenerator,t.SourceMapConsumer=n(993).SourceMapConsumer,t.SourceNode=n(994).SourceNode},function(e,t,n){"use strict";var r=n(997);e.exports=function(e){return r(e,!1)}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r=String.prototype.replace,i=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,i,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),o=function(e){for(var t;e.length;){var n=e.pop();if(t=n.obj[n.prop],Array.isArray(t)){for(var r=[],i=0;i<t.length;++i)void 0!==t[i]&&r.push(t[i]);n.obj[n.prop]=r}}return t};t.arrayToObject=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n},t.merge=function(e,n,i){if(!n)return e;if("object"!=typeof n){if(Array.isArray(e))e.push(n);else{if("object"!=typeof e)return[e,n];(i.plainObjects||i.allowPrototypes||!r.call(Object.prototype,n))&&(e[n]=!0)}return e}if("object"!=typeof e)return[e].concat(n);var o=e;return Array.isArray(e)&&!Array.isArray(n)&&(o=t.arrayToObject(e,i)),Array.isArray(e)&&Array.isArray(n)?(n.forEach(function(n,o){r.call(e,o)?e[o]&&"object"==typeof e[o]?e[o]=t.merge(e[o],n,i):e.push(n):e[o]=n}),e):Object.keys(n).reduce(function(e,o){var a=n[o];return r.call(e,o)?e[o]=t.merge(e[o],a,i):e[o]=a,e},o)},t.assign=function(e,t){return Object.keys(t).reduce(function(e,n){return e[n]=t[n],e},e)},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.encode=function(e){if(0===e.length)return e;for(var t="string"==typeof e?e:String(e),n="",r=0;r<t.length;++r){var o=t.charCodeAt(r);45===o||46===o||95===o||126===o||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122?n+=t.charAt(r):o<128?n+=i[o]:o<2048?n+=i[192|o>>6]+i[128|63&o]:o<55296||o>=57344?n+=i[224|o>>12]+i[128|o>>6&63]+i[128|63&o]:(r+=1,o=65536+((1023&o)<<10|1023&t.charCodeAt(r)),n+=i[240|o>>18]+i[128|o>>12&63]+i[128|o>>6&63]+i[128|63&o])}return n},t.compact=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var i=t[r],a=i.obj[i.prop],s=Object.keys(a),u=0;u<s.length;++u){var l=s[u],c=a[l];"object"==typeof c&&null!==c&&-1===n.indexOf(c)&&(t.push({obj:a,prop:l}),n.push(c))}return o(t)},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null!==e&&void 0!==e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Collapse=void 0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),p=r(c),f=n(1),h=r(f),d=n(1085),m="IDLING",v=function(){return null},g={collapse:"ReactCollapse--collapse",content:"ReactCollapse--content"},y=t.Collapse=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return _.call(n),n.state={currentState:m,from:0,to:0},n}return s(t,e),l(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.isOpened,n=e.forceInitialAnimation,r=e.onRest;if(t){var i=this.getTo();if(n){var o=this.wrapper.clientHeight;this.setState({currentState:"RESIZING",from:o,to:i})}else this.setState({currentState:m,from:i,to:i})}r()}},{key:"componentWillReceiveProps",value:function(e){e.hasNestedCollapse?e.isOpened!==this.props.isOpened&&this.setState({currentState:"WAITING"}):this.state.currentState===m&&(e.isOpened||this.props.isOpened)&&this.setState({currentState:"WAITING"})}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.isOpened,i=n.onRest,o=n.onMeasure;if(this.state.currentState===m)return void i();t.to!==this.state.to&&o({height:this.state.to,width:this.content.clientWidth});var a=this.wrapper.clientHeight,s=r?this.getTo():0;if(a!==s)return void this.setState({currentState:"RESIZING",from:a,to:s});"RESTING"!==this.state.currentState&&"WAITING"!==this.state.currentState||this.setState({currentState:m,from:a,to:s})}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.raf)}},{key:"render",value:function(){return p.default.createElement(d.Motion,u({},this.getMotionProps(),{onRest:this.onRest,children:this.renderContent}))}}]),t}(p.default.PureComponent);y.propTypes={isOpened:h.default.bool.isRequired,springConfig:h.default.objectOf(h.default.number),forceInitialAnimation:h.default.bool,hasNestedCollapse:h.default.bool,fixedHeight:h.default.number,theme:h.default.objectOf(h.default.string),style:h.default.object,onRender:h.default.func,onRest:h.default.func,onMeasure:h.default.func,children:h.default.node.isRequired},y.defaultProps={forceInitialAnimation:!1,hasNestedCollapse:!1,fixedHeight:-1,style:{},theme:g,onRender:v,onRest:v,onMeasure:v};var _=function(){var e=this;this.onContentRef=function(t){e.content=t},this.onWrapperRef=function(t){e.wrapper=t},this.onRest=function(){e.raf=requestAnimationFrame(e.setResting)},this.setResting=function(){e.setState({currentState:"RESTING"})},this.getTo=function(){var t=e.props.fixedHeight;return t>-1?t:e.content.clientHeight},this.getWrapperStyle=function(t){if(e.state.currentState===m&&e.state.to){var n=e.props.fixedHeight;return n>-1?{overflow:"hidden",height:n}:{height:"auto"}}return"WAITING"!==e.state.currentState||e.state.to?{overflow:"hidden",height:Math.max(0,t)}:{overflow:"hidden",height:0}},this.getMotionProps=function(){var t=e.props.springConfig;return e.state.currentState===m?{defaultStyle:{height:e.state.to},style:{height:e.state.to}}:{defaultStyle:{height:e.state.from},style:{height:(0,d.spring)(e.state.to,u({precision:1},t))}}},this.renderContent=function(t){var n=t.height,r=e.props,o=(r.isOpened,r.springConfig,r.forceInitialAnimation,r.hasNestedCollapse,r.fixedHeight,r.theme),a=r.style,s=r.onRender,l=(r.onRest,r.onMeasure,r.children),c=i(r,["isOpened","springConfig","forceInitialAnimation","hasNestedCollapse","fixedHeight","theme","style","onRender","onRest","onMeasure","children"]),f=e.state;return s({current:n,from:f.from,to:f.to}),p.default.createElement("div",u({ref:e.onWrapperRef,className:o.collapse,style:u({},e.getWrapperStyle(Math.max(0,n)),a)},c),p.default.createElement("div",{ref:e.onContentRef,className:o.content},l))}}},function(e,t,n){"use strict";var r=n(447),i=r.Collapse,o=n(1008),a=o.UnmountClosed;a.Collapse=i,a.UnmountClosed=a,e.exports=a},function(e,t,n){"use strict";e.exports=n(1022)},function(e,t,n){"use strict";function r(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var i={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},o=["Webkit","ms","Moz","O"];Object.keys(i).forEach(function(e){o.forEach(function(t){i[r(t,e)]=i[e]})});var a={background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}},s={isUnitlessNumber:i,shorthandPropertyExpansions:a};e.exports=s},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=n(11),o=n(70),a=(n(8),function(){function e(t){r(this,e),this._callbacks=null,this._contexts=null,this._arg=t}return e.prototype.enqueue=function(e,t){this._callbacks=this._callbacks||[],this._callbacks.push(e),this._contexts=this._contexts||[],this._contexts.push(t)},e.prototype.notifyAll=function(){var e=this._callbacks,t=this._contexts,n=this._arg;if(e&&t){e.length!==t.length&&i("24"),this._callbacks=null,this._contexts=null;for(var r=0;r<e.length;r++)e[r].call(t[r],n);e.length=0,t.length=0}},e.prototype.checkpoint=function(){return this._callbacks?this._callbacks.length:0},e.prototype.rollback=function(e){this._callbacks&&this._contexts&&(this._callbacks.length=e,this._contexts.length=e)},e.prototype.reset=function(){this._callbacks=null,this._contexts=null},e.prototype.destructor=function(){this.reset()},e}());e.exports=o.addPoolingTo(a)},function(e,t,n){"use strict";function r(e){return!!l.hasOwnProperty(e)||!u.hasOwnProperty(e)&&(s.test(e)?(l[e]=!0,!0):(u[e]=!0,!1))}function i(e,t){return null==t||e.hasBooleanValue&&!t||e.hasNumericValue&&isNaN(t)||e.hasPositiveNumericValue&&t<1||e.hasOverloadedBooleanValue&&!1===t}var o=n(89),a=(n(14),n(39),n(1070)),s=(n(10),new RegExp("^["+o.ATTRIBUTE_NAME_START_CHAR+"]["+o.ATTRIBUTE_NAME_CHAR+"]*$")),u={},l={},c={createMarkupForID:function(e){return o.ID_ATTRIBUTE_NAME+"="+a(e)},setAttributeForID:function(e,t){e.setAttribute(o.ID_ATTRIBUTE_NAME,t)},createMarkupForRoot:function(){return o.ROOT_ATTRIBUTE_NAME+'=""'},setAttributeForRoot:function(e){e.setAttribute(o.ROOT_ATTRIBUTE_NAME,"")},createMarkupForProperty:function(e,t){var n=o.properties.hasOwnProperty(e)?o.properties[e]:null;if(n){if(i(n,t))return"";var r=n.attributeName;return n.hasBooleanValue||n.hasOverloadedBooleanValue&&!0===t?r+'=""':r+"="+a(t)}return o.isCustomAttribute(e)?null==t?"":e+"="+a(t):null},createMarkupForCustomAttribute:function(e,t){return r(e)&&null!=t?e+"="+a(t):""},setValueForProperty:function(e,t,n){var r=o.properties.hasOwnProperty(t)?o.properties[t]:null;if(r){var a=r.mutationMethod;if(a)a(e,n);else{if(i(r,n))return void this.deleteValueForProperty(e,t);if(r.mustUseProperty)e[r.propertyName]=n;else{var s=r.attributeName,u=r.attributeNamespace;u?e.setAttributeNS(u,s,""+n):r.hasBooleanValue||r.hasOverloadedBooleanValue&&!0===n?e.setAttribute(s,""):e.setAttribute(s,""+n)}}}else if(o.isCustomAttribute(t))return void c.setValueForAttribute(e,t,n)},setValueForAttribute:function(e,t,n){if(r(t)){null==n?e.removeAttribute(t):e.setAttribute(t,""+n)}},deleteValueForAttribute:function(e,t){e.removeAttribute(t)},deleteValueForProperty:function(e,t){var n=o.properties.hasOwnProperty(t)?o.properties[t]:null;if(n){var r=n.mutationMethod;if(r)r(e,void 0);else if(n.mustUseProperty){var i=n.propertyName;n.hasBooleanValue?e[i]=!1:e[i]=""}else e.removeAttribute(n.attributeName)}else o.isCustomAttribute(t)&&e.removeAttribute(t)}};e.exports=c},function(e,t,n){"use strict";var r={hasCachedChildNodes:1};e.exports=r},function(e,t,n){"use strict";function r(){if(this._rootNodeID&&this._wrapperState.pendingUpdate){this._wrapperState.pendingUpdate=!1;var e=this._currentElement.props,t=s.getValue(e);null!=t&&i(this,Boolean(e.multiple),t)}}function i(e,t,n){var r,i,o=u.getNodeFromInstance(e).options;if(t){for(r={},i=0;i<n.length;i++)r[""+n[i]]=!0;for(i=0;i<o.length;i++){var a=r.hasOwnProperty(o[i].value);o[i].selected!==a&&(o[i].selected=a)}}else{for(r=""+n,i=0;i<o.length;i++)if(o[i].value===r)return void(o[i].selected=!0);o.length&&(o[0].selected=!0)}}function o(e){var t=this._currentElement.props,n=s.executeOnChange(t,e);return this._rootNodeID&&(this._wrapperState.pendingUpdate=!0),l.asap(r,this),n}var a=n(13),s=n(245),u=n(14),l=n(44),c=(n(10),!1),p={getHostProps:function(e,t){return a({},t,{onChange:e._wrapperState.onChange,value:void 0})},mountWrapper:function(e,t){var n=s.getValue(t);e._wrapperState={pendingUpdate:!1,initialValue:null!=n?n:t.defaultValue,listeners:null,onChange:o.bind(e),wasMultiple:Boolean(t.multiple)},void 0===t.value||void 0===t.defaultValue||c||(c=!0)},getSelectValueContext:function(e){return e._wrapperState.initialValue},postUpdateWrapper:function(e){var t=e._currentElement.props;e._wrapperState.initialValue=void 0;var n=e._wrapperState.wasMultiple;e._wrapperState.wasMultiple=Boolean(t.multiple);var r=s.getValue(t);null!=r?(e._wrapperState.pendingUpdate=!1,i(e,Boolean(t.multiple),r)):n!==Boolean(t.multiple)&&(null!=t.defaultValue?i(e,Boolean(t.multiple),t.defaultValue):i(e,Boolean(t.multiple),t.multiple?[]:""))}};e.exports=p},function(e,t,n){"use strict";var r,i={injectEmptyComponentFactory:function(e){r=e}},o={create:function(e){return r(e)}};o.injection=i,e.exports=o},function(e,t,n){"use strict";var r={logTopLevelRenders:!1};e.exports=r},function(e,t,n){"use strict";function r(e){return s||a("111",e.type),new s(e)}function i(e){return new u(e)}function o(e){return e instanceof u}var a=n(11),s=(n(8),null),u=null,l={injectGenericComponentClass:function(e){s=e},injectTextComponentClass:function(e){u=e}},c={createInternalComponent:r,createInstanceForText:i,isTextComponent:o,injection:l};e.exports=c},function(e,t,n){"use strict";function r(e){return o(document.documentElement,e)}var i=n(1030),o=n(748),a=n(378),s=n(379),u={hasSelectionCapabilities:function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)},getSelectionInformation:function(){var e=s();return{focusedElem:e,selectionRange:u.hasSelectionCapabilities(e)?u.getSelection(e):null}},restoreSelection:function(e){var t=s(),n=e.focusedElem,i=e.selectionRange;t!==n&&r(n)&&(u.hasSelectionCapabilities(n)&&u.setSelection(n,i),a(n))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=i.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,r=t.end;if(void 0===r&&(r=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(r,e.value.length);else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var o=e.createTextRange();o.collapse(!0),o.moveStart("character",n),o.moveEnd("character",r-n),o.select()}else i.setOffsets(e,t)}};e.exports=u},function(e,t,n){"use strict";function r(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}function i(e){return e?e.nodeType===R?e.documentElement:e.firstChild:null}function o(e){return e.getAttribute&&e.getAttribute(T)||""}function a(e,t,n,r,i){var o;if(x.logTopLevelRenders){var a=e._currentElement.props.child,s=a.type;o="React mount: "+("string"==typeof s?s:s.displayName||s.name),console.time(o)}var u=E.mountComponent(e,n,null,_(e,t),i,0);o&&console.timeEnd(o),e._renderedComponent._topLevelWrapper=e,L._mountImageIntoNode(u,t,e,r,n)}function s(e,t,n,r){var i=C.ReactReconcileTransaction.getPooled(!n&&b.useCreateElement);i.perform(a,null,e,t,i,n,r),C.ReactReconcileTransaction.release(i)}function u(e,t,n){for(E.unmountComponent(e,n),t.nodeType===R&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)}function l(e){var t=i(e);if(t){var n=y.getInstanceFromNode(t);return!(!n||!n._hostParent)}}function c(e){return!(!e||e.nodeType!==I&&e.nodeType!==R&&e.nodeType!==j)}function p(e){var t=i(e),n=t&&y.getInstanceFromNode(t);return n&&!n._hostParent?n:null}function f(e){var t=p(e);return t?t._hostContainerInfo._topLevelWrapper:null}var h=n(11),d=n(88),m=n(89),v=n(92),g=n(159),y=(n(52),n(14)),_=n(1024),b=n(1026),x=n(456),w=n(124),k=(n(39),n(1040)),E=n(90),S=n(248),C=n(44),A=n(144),D=n(467),O=(n(8),n(163)),M=n(254),T=(n(10),m.ID_ATTRIBUTE_NAME),P=m.ROOT_ATTRIBUTE_NAME,I=1,R=9,j=11,F={},N=1,B=function(){this.rootID=N++};B.prototype.isReactComponent={},B.prototype.render=function(){return this.props.child},B.isReactTopLevelWrapper=!0;var L={TopLevelWrapper:B,_instancesByReactRootID:F,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r,i){return L.scrollMonitor(r,function(){S.enqueueElementInternal(e,t,n),i&&S.enqueueCallbackInternal(e,i)}),e},_renderNewRootComponent:function(e,t,n,r){c(t)||h("37"),g.ensureScrollValueMonitoring();var i=D(e,!1);C.batchedUpdates(s,i,t,n,r);var o=i._instance.rootID;return F[o]=i,i},renderSubtreeIntoContainer:function(e,t,n,r){return null!=e&&w.has(e)||h("38"),L._renderSubtreeIntoContainer(e,t,n,r)},_renderSubtreeIntoContainer:function(e,t,n,r){S.validateCallback(r,"ReactDOM.render"),v.isValidElement(t)||h("39","string"==typeof t?" Instead of passing a string like 'div', pass React.createElement('div') or <div />.":"function"==typeof t?" Instead of passing a class like Foo, pass React.createElement(Foo) or <Foo />.":null!=t&&void 0!==t.props?" This may be caused by unintentionally loading two independent copies of React.":"");var a,s=v.createElement(B,{child:t});if(e){var u=w.get(e);a=u._processChildContext(u._context)}else a=A;var c=f(n);if(c){var p=c._currentElement,d=p.props.child;if(M(d,t)){var m=c._renderedComponent.getPublicInstance(),g=r&&function(){r.call(m)};return L._updateRootComponent(c,s,a,n,g),m}L.unmountComponentAtNode(n)}var y=i(n),_=y&&!!o(y),b=l(n),x=_&&!c&&!b,k=L._renderNewRootComponent(s,n,x,a)._renderedComponent.getPublicInstance();return r&&r.call(k),k},render:function(e,t,n){return L._renderSubtreeIntoContainer(null,e,t,n)},unmountComponentAtNode:function(e){c(e)||h("40");var t=f(e);if(!t){l(e),1===e.nodeType&&e.hasAttribute(P);return!1}return delete F[t._instance.rootID],C.batchedUpdates(u,t,e,!1),!0},_mountImageIntoNode:function(e,t,n,o,a){if(c(t)||h("41"),o){var s=i(t);if(k.canReuseMarkup(e,s))return void y.precacheNode(n,s);var u=s.getAttribute(k.CHECKSUM_ATTR_NAME);s.removeAttribute(k.CHECKSUM_ATTR_NAME);var l=s.outerHTML;s.setAttribute(k.CHECKSUM_ATTR_NAME,u);var p=e,f=r(p,l),m=" (client) "+p.substring(f-20,f+20)+"\n (server) "+l.substring(f-20,f+20);t.nodeType===R&&h("42",m)}if(t.nodeType===R&&h("43"),a.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);d.insertTreeBefore(t,e,null)}else O(t,e),y.precacheNode(n,t.firstChild)}};e.exports=L},function(e,t,n){"use strict";var r=n(11),i=n(92),o=(n(8),{HOST:0,COMPOSITE:1,EMPTY:2,getType:function(e){return null===e||!1===e?o.EMPTY:i.isValidElement(e)?"function"==typeof e.type?o.COMPOSITE:o.HOST:void r("26",e)}});e.exports=o},function(e,t,n){"use strict";var r={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){r.currentScrollLeft=e.x,r.currentScrollTop=e.y}};e.exports=r},function(e,t,n){"use strict";function r(e,t){return null==t&&i("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}var i=n(11);n(8);e.exports=r},function(e,t,n){"use strict";function r(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}e.exports=r},function(e,t,n){"use strict";function r(e){for(var t;(t=e._renderedNodeType)===i.COMPOSITE;)e=e._renderedComponent;return t===i.HOST?e._renderedComponent:t===i.EMPTY?null:void 0}var i=n(460);e.exports=r},function(e,t,n){"use strict";function r(){return!o&&i.canUseDOM&&(o="textContent"in document.documentElement?"textContent":"innerText"),o}var i=n(25),o=null;e.exports=r},function(e,t,n){"use strict";function r(e){var t=e.type,n=e.nodeName;return n&&"input"===n.toLowerCase()&&("checkbox"===t||"radio"===t)}function i(e){return e._wrapperState.valueTracker}function o(e,t){e._wrapperState.valueTracker=t}function a(e){e._wrapperState.valueTracker=null}function s(e){var t;return e&&(t=r(e)?""+e.checked:e.value),t}var u=n(14),l={_getTrackerFromNode:function(e){return i(u.getInstanceFromNode(e))},track:function(e){if(!i(e)){var t=u.getNodeFromInstance(e),n=r(t)?"checked":"value",s=Object.getOwnPropertyDescriptor(t.constructor.prototype,n),l=""+t[n];t.hasOwnProperty(n)||"function"!=typeof s.get||"function"!=typeof s.set||(Object.defineProperty(t,n,{enumerable:s.enumerable,configurable:!0,get:function(){return s.get.call(this)},set:function(e){l=""+e,s.set.call(this,e)}}),o(e,{getValue:function(){return l},setValue:function(e){l=""+e},stopTracking:function(){a(e),delete t[n]}}))}},updateValueIfChanged:function(e){if(!e)return!1;var t=i(e);if(!t)return l.track(e),!0;var n=t.getValue(),r=s(u.getNodeFromInstance(e));return r!==n&&(t.setValue(r),!0)},stopTracking:function(e){var t=i(e);t&&t.stopTracking()}};e.exports=l},function(e,t,n){"use strict";function r(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}function i(e){return"function"==typeof e&&void 0!==e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function o(e,t){var n;if(null===e||!1===e)n=l.create(o);else if("object"==typeof e){var s=e,u=s.type;if("function"!=typeof u&&"string"!=typeof u){var f="";f+=r(s._owner),a("130",null==u?u:typeof u,f)}"string"==typeof s.type?n=c.createInternalComponent(s):i(s.type)?(n=new s.type(s),n.getHostNode||(n.getHostNode=n.getNativeNode)):n=new p(s)}else"string"==typeof e||"number"==typeof e?n=c.createInstanceForText(e):a("131",typeof e);return n._mountIndex=0,n._mountImage=null,n}var a=n(11),s=n(13),u=n(1021),l=n(455),c=n(457),p=(n(1106),n(8),n(10),function(e){this.construct(e)});s(p.prototype,u,{_instantiateReactComponent:o}),e.exports=o},function(e,t,n){"use strict";function r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!i[e.type]:"textarea"===t}var i={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};e.exports=r},function(e,t,n){"use strict";var r=n(25),i=n(162),o=n(163),a=function(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(a=function(e,t){if(3===e.nodeType)return void(e.nodeValue=t);o(e,i(t))})),e.exports=a},function(e,t,n){"use strict";function r(e,t){return e&&"object"==typeof e&&null!=e.key?l.escape(e.key):t.toString(36)}function i(e,t,n,o){var f=typeof e;if("undefined"!==f&&"boolean"!==f||(e=null),null===e||"string"===f||"number"===f||"object"===f&&e.$$typeof===s)return n(o,e,""===t?c+r(e,0):t),1;var h,d,m=0,v=""===t?c:t+p;if(Array.isArray(e))for(var g=0;g<e.length;g++)h=e[g],d=v+r(h,g),m+=i(h,d,n,o);else{var y=u(e);if(y){var _,b=y.call(e);if(y!==e.entries)for(var x=0;!(_=b.next()).done;)h=_.value,d=v+r(h,x++),m+=i(h,d,n,o);else for(;!(_=b.next()).done;){var w=_.value;w&&(h=w[1],d=v+l.escape(w[0])+p+r(h,0),m+=i(h,d,n,o))}}else if("object"===f){var k="",E=String(e);a("31","[object Object]"===E?"object with keys {"+Object.keys(e).join(", ")+"}":E,k)}}return m}function o(e,t,n){return null==e?0:i(e,"",t,n)}var a=n(11),s=(n(52),n(1036)),u=n(1067),l=(n(8),n(244)),c=(n(10),"."),p=":";e.exports=o},function(e,t,n){"use strict";t.__esModule=!0,t.default={noWobble:{stiffness:170,damping:26},gentle:{stiffness:120,damping:14},wobbly:{stiffness:180,damping:12},stiff:{stiffness:210,damping:20}},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r=n(1),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=i.default.shape({subscribe:i.default.func.isRequired,dispatch:i.default.func.isRequired,getState:i.default.func.isRequired})},function(e,t,n){"use strict";function r(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}t.__esModule=!0,t.default=r},function(e,t,n){"use strict";function r(e,t,n){this.props=e,this.context=t,this.refs=l,this.updater=n||u}function i(e,t,n){this.props=e,this.context=t,this.refs=l,this.updater=n||u}function o(){}var a=n(126),s=n(13),u=n(477),l=(n(478),n(144));n(8),n(1107);r.prototype.isReactComponent={},r.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&a("85"),this.updater.enqueueSetState(this,e),t&&this.updater.enqueueCallback(this,t,"setState")},r.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this),e&&this.updater.enqueueCallback(this,e,"forceUpdate")};o.prototype=r.prototype,i.prototype=new o,i.prototype.constructor=i,s(i.prototype,r.prototype),i.prototype.isPureReactComponent=!0,e.exports={Component:r,PureComponent:i}},function(e,t,n){"use strict";function r(e){var t=Function.prototype.toString,n=Object.prototype.hasOwnProperty,r=RegExp("^"+t.call(n).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");try{var i=t.call(e);return r.test(i)}catch(e){return!1}}function i(e){var t=l(e);if(t){var n=t.childIDs;c(e),n.forEach(i)}}function o(e,t,n){return"\n in "+(e||"Unknown")+(t?" (at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+")":n?" (created by "+n+")":"")}function a(e){return null==e?"#empty":"string"==typeof e||"number"==typeof e?"#text":"string"==typeof e.type?e.type:e.type.displayName||e.type.name||"Unknown"}function s(e){var t,n=S.getDisplayName(e),r=S.getElement(e),i=S.getOwnerID(e);return i&&(t=S.getDisplayName(i)),o(n,r&&r._source,t)}var u,l,c,p,f,h,d,m=n(126),v=n(52),g=(n(8),n(10),"function"==typeof Array.from&&"function"==typeof Map&&r(Map)&&null!=Map.prototype&&"function"==typeof Map.prototype.keys&&r(Map.prototype.keys)&&"function"==typeof Set&&r(Set)&&null!=Set.prototype&&"function"==typeof Set.prototype.keys&&r(Set.prototype.keys));if(g){var y=new Map,_=new Set;u=function(e,t){y.set(e,t)},l=function(e){return y.get(e)},c=function(e){y.delete(e)},p=function(){return Array.from(y.keys())},f=function(e){_.add(e)},h=function(e){_.delete(e)},d=function(){return Array.from(_.keys())}}else{var b={},x={},w=function(e){return"."+e},k=function(e){return parseInt(e.substr(1),10)};u=function(e,t){var n=w(e);b[n]=t},l=function(e){var t=w(e);return b[t]},c=function(e){var t=w(e);delete b[t]},p=function(){return Object.keys(b).map(k)},f=function(e){var t=w(e);x[t]=!0},h=function(e){var t=w(e);delete x[t]},d=function(){return Object.keys(x).map(k)}}var E=[],S={onSetChildren:function(e,t){var n=l(e);n||m("144"),n.childIDs=t;for(var r=0;r<t.length;r++){var i=t[r],o=l(i);o||m("140"),null==o.childIDs&&"object"==typeof o.element&&null!=o.element&&m("141"),o.isMounted||m("71"),null==o.parentID&&(o.parentID=e),o.parentID!==e&&m("142",i,o.parentID,e)}},onBeforeMountComponent:function(e,t,n){u(e,{element:t,parentID:n,text:null,childIDs:[],isMounted:!1,updateCount:0})},onBeforeUpdateComponent:function(e,t){var n=l(e);n&&n.isMounted&&(n.element=t)},onMountComponent:function(e){var t=l(e);t||m("144"),t.isMounted=!0,0===t.parentID&&f(e)},onUpdateComponent:function(e){var t=l(e);t&&t.isMounted&&t.updateCount++},onUnmountComponent:function(e){var t=l(e);if(t){t.isMounted=!1;0===t.parentID&&h(e)}E.push(e)},purgeUnmountedComponents:function(){if(!S._preventPurging){for(var e=0;e<E.length;e++){i(E[e])}E.length=0}},isMounted:function(e){var t=l(e);return!!t&&t.isMounted},getCurrentStackAddendum:function(e){var t="";if(e){var n=a(e),r=e._owner;t+=o(n,e._source,r&&r.getName())}var i=v.current,s=i&&i._debugID;return t+=S.getStackAddendumByID(s)},getStackAddendumByID:function(e){for(var t="";e;)t+=s(e),e=S.getParentID(e);return t},getChildIDs:function(e){var t=l(e);return t?t.childIDs:[]},getDisplayName:function(e){var t=S.getElement(e);return t?a(t):null},getElement:function(e){var t=l(e);return t?t.element:null},getOwnerID:function(e){var t=S.getElement(e);return t&&t._owner?t._owner._debugID:null},getParentID:function(e){var t=l(e);return t?t.parentID:null},getSource:function(e){var t=l(e),n=t?t.element:null;return null!=n?n._source:null},getText:function(e){var t=S.getElement(e);return"string"==typeof t?t:"number"==typeof t?""+t:null},getUpdateCount:function(e){var t=l(e);return t?t.updateCount:0},getRootIDs:d,getRegisteredIDs:p,pushNonStandardWarningStack:function(e,t){if("function"==typeof console.reactStack){var n=[],r=v.current,i=r&&r._debugID;try{for(e&&n.push({name:i?S.getDisplayName(i):null,fileName:t?t.fileName:null,lineNumber:t?t.lineNumber:null});i;){var o=S.getElement(i),a=S.getParentID(i),s=S.getOwnerID(i),u=s?S.getDisplayName(s):null,l=o&&o._source;n.push({name:u,fileName:l?l.fileName:null,lineNumber:l?l.lineNumber:null}),i=a}}catch(e){}console.reactStack(n)}},popNonStandardWarningStack:function(){"function"==typeof console.reactStackEnd&&console.reactStackEnd()}};e.exports=S},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";var r=(n(10),{isMounted:function(e){return!1},enqueueCallback:function(e,t){},enqueueForceUpdate:function(e){},enqueueReplaceState:function(e,t){},enqueueSetState:function(e,t){}});e.exports=r},function(e,t,n){"use strict";var r=!1;e.exports=r},function(e,t,n){"use strict";(function(t,r){function i(e){return N.from(e)}function o(e){return N.isBuffer(e)||e instanceof B}function a(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?R(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function s(e,t){I=I||n(71),e=e||{},this.objectMode=!!e.objectMode,t instanceof I&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new W,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(U||(U=n(265).StringDecoder),this.decoder=new U(e.encoding),this.encoding=e.encoding)}function u(e){if(I=I||n(71),!(this instanceof u))return new u(e);this._readableState=new s(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),F.call(this)}function l(e,t,n,r,o){var a=e._readableState;if(null===t)a.reading=!1,m(e,a);else{var s;o||(s=p(a,t)),s?e.emit("error",s):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===N.prototype||(t=i(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):c(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?c(e,a,t,!1):y(e,a)):c(e,a,t,!1))):r||(a.reading=!1)}return f(a)}function c(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&v(e)),y(e,t)}function p(e,t){var n;return o(t)||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function f(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function h(e){return e>=G?e=G:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function d(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=h(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function m(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,v(e)}}function v(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(z("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?P(g,e):g(e))}function g(e){z("emit readable"),e.emit("readable"),E(e)}function y(e,t){t.readingMore||(t.readingMore=!0,P(_,e,t))}function _(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(z("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function b(e){return function(){var t=e._readableState;z("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&j(e,"data")&&(t.flowing=!0,E(e))}}function x(e){z("readable nexttick read 0"),e.read(0)}function w(e,t){t.resumeScheduled||(t.resumeScheduled=!0,P(k,e,t))}function k(e,t){t.reading||(z("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),E(e),t.flowing&&!t.reading&&e.read(0)}function E(e){var t=e._readableState;for(z("flow",t.flowing);t.flowing&&null!==e.read(););}function S(e,t){if(0===t.length)return null;var n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=C(e,t.buffer,t.decoder),n}function C(e,t,n){var r;return e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?A(e,t):D(e,t),r}function A(e,t){var n=t.head,r=1,i=n.data;for(e-=i.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++r}return t.length-=r,i}function D(e,t){var n=N.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),0===(e-=a)){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}function O(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,P(M,t,e))}function M(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function T(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}var P=n(158);e.exports=u;var I,R=n(387);u.ReadableState=s;var j=(n(143).EventEmitter,function(e,t){return e.listeners(t).length}),F=n(482),N=n(167).Buffer,B=t.Uint8Array||function(){},L=n(111);L.inherits=n(42);var q=n(1212),z=void 0;z=q&&q.debuglog?q.debuglog("stream"):function(){};var U,W=n(1112),V=n(481);L.inherits(u,F);var H=["error","close","destroy","pause","resume"];Object.defineProperty(u.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),u.prototype.destroy=V.destroy,u.prototype._undestroy=V.undestroy,u.prototype._destroy=function(e,t){this.push(null),t(e)},u.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=N.from(e,t),t=""),n=!0),l(this,e,t,!1,n)},u.prototype.unshift=function(e){return l(this,e,null,!0,!1)},u.prototype.isPaused=function(){return!1===this._readableState.flowing},u.prototype.setEncoding=function(e){return U||(U=n(265).StringDecoder),this._readableState.decoder=new U(e),this._readableState.encoding=e,this};var G=8388608;u.prototype.read=function(e){z("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return z("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):v(this),null;if(0===(e=d(e,t))&&t.ended)return 0===t.length&&O(this),null;var r=t.needReadable;z("need readable",r),(0===t.length||t.length-e<t.highWaterMark)&&(r=!0,z("length less than watermark",r)),t.ended||t.reading?(r=!1,z("reading or ended",r)):r&&(z("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=d(n,t)));var i;return i=e>0?S(e,t):null,null===i?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&O(this)),null!==i&&this.emit("data",i),i},u.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},u.prototype.pipe=function(e,t){function n(e,t){z("onunpipe"),e===f&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,o())}function i(){z("onend"),e.end()}function o(){z("cleanup"),e.removeListener("close",l),e.removeListener("finish",c),e.removeListener("drain",v),e.removeListener("error",u),e.removeListener("unpipe",n),f.removeListener("end",i),f.removeListener("end",p),f.removeListener("data",s),g=!0,!h.awaitDrain||e._writableState&&!e._writableState.needDrain||v()}function s(t){z("ondata"),y=!1,!1!==e.write(t)||y||((1===h.pipesCount&&h.pipes===e||h.pipesCount>1&&-1!==T(h.pipes,e))&&!g&&(z("false write response, pause",f._readableState.awaitDrain),f._readableState.awaitDrain++,y=!0),f.pause())}function u(t){z("onerror",t),p(),e.removeListener("error",u),0===j(e,"error")&&e.emit("error",t)}function l(){e.removeListener("finish",c),p()}function c(){z("onfinish"),e.removeListener("close",l),p()}function p(){z("unpipe"),f.unpipe(e)}var f=this,h=this._readableState;switch(h.pipesCount){case 0:h.pipes=e;break;case 1:h.pipes=[h.pipes,e];break;default:h.pipes.push(e)}h.pipesCount+=1,z("pipe count=%d opts=%j",h.pipesCount,t);var d=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr,m=d?i:p;h.endEmitted?P(m):f.once("end",m),e.on("unpipe",n);var v=b(f);e.on("drain",v);var g=!1,y=!1;return f.on("data",s),a(e,"error",u),e.once("close",l),e.once("finish",c),e.emit("pipe",f),h.flowing||(z("pipe resume"),f.resume()),e},u.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,n);return this}var a=T(t.pipes,e);return-1===a?this:(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n),this)},u.prototype.on=function(e,t){var n=F.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&v(this):P(x,this))}return n},u.prototype.addListener=u.prototype.on,u.prototype.resume=function(){var e=this._readableState;return e.flowing||(z("resume"),e.flowing=!0,w(this,e)),this},u.prototype.pause=function(){return z("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(z("pause"),this._readableState.flowing=!1,this.emit("pause")),this},u.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(z("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(i){if(z("wrapped data"),t.decoder&&(i=t.decoder.write(i)),(!t.objectMode||null!==i&&void 0!==i)&&(t.objectMode||i&&i.length)){r.push(i)||(n=!0,e.pause())}});for(var i in e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<H.length;o++)e.on(H[o],r.emit.bind(r,H[o]));return r._read=function(t){z("wrapped _read",t),n&&(n=!1,e.resume())},r},u._fromList=S}).call(t,n(17),n(33))},function(e,t,n){"use strict";function r(e){this.afterTransform=function(t,n){return i(e,t,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function i(e,t,n){var r=e._transformState;r.transforming=!1;var i=r.writecb;if(!i)return e.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!==n&&void 0!==n&&e.push(n),i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);s.call(this,e),this._transformState=new r(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(e,n){a(t,e,n)}):a(t)})}function a(e,t,n){if(t)return e.emit("error",t);null!==n&&void 0!==n&&e.push(n);var r=e._writableState,i=e._transformState;if(r.length)throw new Error("Calling transform done when ws.length != 0");if(i.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}e.exports=o;var s=n(71),u=n(111);u.inherits=n(42),u.inherits(o,s),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,s.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},o.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},o.prototype._destroy=function(e,t){var n=this;s.prototype._destroy.call(this,e,function(e){t(e),n.emit("close")})}},function(e,t,n){"use strict";function r(e,t){var n=this,r=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;if(r||i)return void(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||a(o,this,e));this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a(o,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})}function i(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(e,t){e.emit("error",t)}var a=n(158);e.exports={destroy:r,undestroy:i}},function(e,t,n){e.exports=n(143).EventEmitter},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e&&"@@redux/INIT"===e.type?"initialState argument passed to createStore":"previous state received by the reducer"},e.exports=t.default},function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}t.a=r},function(e,t,n){"use strict";function r(e,t,o){function u(){y===g&&(y=g.slice())}function l(){return v}function c(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return u(),y.push(e),function(){if(t){t=!1,u();var n=y.indexOf(e);y.splice(n,1)}}}function p(e){if(!n.i(i.a)(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(_)throw new Error("Reducers may not dispatch actions.");try{_=!0,v=m(v,e)}finally{_=!1}for(var t=g=y,r=0;r<t.length;r++){(0,t[r])()}return e}function f(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");m=e,p({type:s.INIT})}function h(){var e,t=c;return e={subscribe:function(e){function n(){e.next&&e.next(l())}if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");return n(),{unsubscribe:t(n)}}},e[a.a]=function(){return this},e}var d;if("function"==typeof t&&void 0===o&&(o=t,t=void 0),void 0!==o){if("function"!=typeof o)throw new Error("Expected the enhancer to be a function.");return o(r)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var m=e,v=t,g=[],y=g,_=!1;return p({type:s.INIT}),d={dispatch:p,subscribe:c,getState:l,replaceReducer:f},d[a.a]=h,d}n.d(t,"b",function(){return s}),t.a=r;var i=n(391),o=n(1182),a=n.n(o),s={INIT:"@@redux/INIT"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(485),i=n(1123),o=n(1122),a=n(1121),s=n(484);n(487);n.d(t,"createStore",function(){return r.a}),n.d(t,"combineReducers",function(){return i.a}),n.d(t,"bindActionCreators",function(){return o.a}),n.d(t,"applyMiddleware",function(){return a.a}),n.d(t,"compose",function(){return s.a})},function(e,t,n){"use strict"},function(e,t,n){"use strict";e.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",GT:">",Gt:"≫",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",LT:"<",Lt:"≪",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}},function(e,t,n){"use strict";var r=n(26).replaceEntities;e.exports=function(e){var t=r(e);try{t=decodeURI(t)}catch(e){}return encodeURI(t)}},function(e,t,n){"use strict";e.exports=function(e){return e.trim().replace(/\s+/g," ").toUpperCase()}},function(e,t,n){"use strict";var r=n(489),i=n(26).unescapeMd;e.exports=function(e,t){var n,o,a,s=t,u=e.posMax;if(60===e.src.charCodeAt(t)){for(t++;t<u;){if(10===(n=e.src.charCodeAt(t)))return!1;if(62===n)return a=r(i(e.src.slice(s+1,t))),!!e.parser.validateLink(a)&&(e.pos=t+1,e.linkContent=a,!0);92===n&&t+1<u?t+=2:t++}return!1}for(o=0;t<u&&32!==(n=e.src.charCodeAt(t))&&!(n>8&&n<14);)if(92===n&&t+1<u)t+=2;else{if(40===n&&++o>1)break;if(41===n&&--o<0)break;t++}return s!==t&&(a=i(e.src.slice(s,t)),!!e.parser.validateLink(a)&&(e.linkContent=a,e.pos=t,!0))}},function(e,t,n){"use strict";var r=n(26).unescapeMd;e.exports=function(e,t){var n,i=t,o=e.posMax,a=e.src.charCodeAt(t);if(34!==a&&39!==a&&40!==a)return!1;for(t++,40===a&&(a=41);t<o;){if((n=e.src.charCodeAt(t))===a)return e.pos=t+1,e.linkContent=r(e.src.slice(i+1,t)),!0;92===n&&t+1<o?t+=2:t++}return!1}},function(e,t,n){function r(){i.call(this)}e.exports=r;var i=n(143).EventEmitter;n(42)(r,i),r.Readable=n(262),r.Writable=n(1115),r.Duplex=n(1110),r.Transform=n(1114),r.PassThrough=n(1113),r.Stream=r,r.prototype.pipe=function(e,t){function n(t){e.writable&&!1===e.write(t)&&l.pause&&l.pause()}function r(){l.readable&&l.resume&&l.resume()}function o(){c||(c=!0,e.end())}function a(){c||(c=!0,"function"==typeof e.destroy&&e.destroy())}function s(e){if(u(),0===i.listenerCount(this,"error"))throw e}function u(){l.removeListener("data",n),e.removeListener("drain",r),l.removeListener("end",o),l.removeListener("close",a),l.removeListener("error",s),e.removeListener("error",s),l.removeListener("end",u),l.removeListener("close",u),e.removeListener("close",u)}var l=this;l.on("data",n),e.on("drain",r),e._isStdio||t&&!1===t.end||(l.on("end",o),l.on("close",a));var c=!1;return l.on("error",s),e.on("error",s),l.on("end",u),l.on("close",u),e.on("close",u),e.emit("pipe",l),e}},function(e,t){/*! http://mths.be/repeat v0.2.0 by @mathias */ -String.prototype.repeat||function(){"use strict";var e=function(){try{var e={},t=Object.defineProperty,n=t(e,e,e)&&t}catch(e){}return n}(),t=function(e){if(null==this)throw TypeError();var t=String(this),n=e?Number(e):0;if(n!=n&&(n=0),n<0||n==1/0)throw RangeError();for(var r="";n;)n%2==1&&(r+=t),n>1&&(t+=t),n>>=1;return r};e?e(String.prototype,"repeat",{value:t,configurable:!0,writable:!0}):String.prototype.repeat=t}()},function(e,t,n){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=58)}([function(e,t){e.exports=n(47)},function(e,t){e.exports=n(30)},function(e,t){e.exports=n(48)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.openapi;return!!t&&(0,b.default)(t,"3")}function o(e){var t=e.swagger;return!!t&&(0,b.default)(t,"2")}function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e&&"object"===(void 0===e?"undefined":(0,v.default)(e))?(e.operationId||"").replace(/\s/g,"").length?w(e.operationId):s(t,n):null}function s(e,t){return""+x(t)+w(e)}function u(e,t){return x(t)+"-"+e}function l(e,t){return e&&e.paths?c(e,function(e){var n=e.pathName,r=e.method,i=e.operation;if(!i||"object"!==(void 0===i?"undefined":(0,v.default)(i)))return!1;var o=i.operationId;return[a(i,n,r),u(n,r),o].some(function(e){return e&&e===t})}):null}function c(e,t){return p(e,t,!0)||null}function p(e,t,n){if(!e||"object"!==(void 0===e?"undefined":(0,v.default)(e))||!e.paths||"object"!==(0,v.default)(e.paths))return null;var r=e.paths;for(var i in r)for(var o in r[i])if("PARAMETERS"!==o.toUpperCase()){var a=r[i][o];if(a&&"object"===(void 0===a?"undefined":(0,v.default)(a))){var s={spec:e,pathName:i,method:o.toUpperCase(),operation:a},u=t(s);if(n&&u)return s}}}function f(e){var t=e.spec,n=t.paths,r={};if(!n)return e;for(var i in n){var o=n[i];if((0,y.default)(o)){var s=o.parameters;for(var u in o)!function(e){var n=o[e];if(!(0,y.default)(n))return"continue";var u=a(n,i,e);if(u){r[u]?r[u].push(n):r[u]=[n];var l=r[u];if(l.length>1)l.forEach(function(e,t){e.__originalOperationId=e.__originalOperationId||e.operationId,e.operationId=""+u+(t+1)});else if(void 0!==n.operationId){var c=l[0];c.__originalOperationId=c.__originalOperationId||n.operationId,c.operationId=u}}if("parameters"!==e){var p=[],f={};for(var h in t)"produces"!==h&&"consumes"!==h&&"security"!==h||(f[h]=t[h],p.push(f));if(s&&(f.parameters=s,p.push(f)),p.length){var m=!0,v=!1,g=void 0;try{for(var _,b=(0,d.default)(p);!(m=(_=b.next()).done);m=!0){var x=_.value;for(var w in x)if(n[w]){if("parameters"===w){var k=!0,E=!1,S=void 0;try{for(var C,A=(0,d.default)(x[w]);!(k=(C=A.next()).done);k=!0)!function(){var e=C.value;n[w].some(function(t){return t.name===e.name})||n[w].push(e)}()}catch(e){E=!0,S=e}finally{try{!k&&A.return&&A.return()}finally{if(E)throw S}}}}else n[w]=x[w]}}catch(e){v=!0,g=e}finally{try{!m&&b.return&&b.return()}finally{if(v)throw g}}}}}(u)}}return e}Object.defineProperty(t,"__esModule",{value:!0});var h=n(13),d=r(h),m=n(2),v=r(m);t.isOAS3=i,t.isSwagger2=o,t.opId=a,t.idFromPathMethod=s,t.legacyIdFromPathMethod=u,t.getOperationRaw=l,t.findOperation=c,t.eachOperation=p,t.normalizeSwagger=f;var g=n(51),y=r(g),_=n(19),b=r(_),x=function(e){return String.prototype.toLowerCase.call(e)},w=function(e){return e.replace(/[^\w]/gi,"_")}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"object"===(void 0===e?"undefined":(0,b.default)(e))&&(t=e,e=t.url),t.headers=t.headers||{},A.mergeInQueryOrForm(t),t.requestInterceptor&&(t=t.requestInterceptor(t)||t),/multipart\/form-data/i.test(t.headers["content-type"]||t.headers["Content-Type"])&&(delete t.headers["content-type"],delete t.headers["Content-Type"]),(t.userFetch||fetch)(t.url,t).then(function(n){var r=A.serializeRes(n,e,t).then(function(e){return t.responseInterceptor&&(e=t.responseInterceptor(e)||e),e});if(!n.ok){var i=new Error(n.statusText);return i.statusCode=i.status=n.status,r.then(function(e){throw i.response=e,i},function(e){throw i.responseError=e,i})}return r})}function o(e,t){return"application/json"===t?JSON.parse(e):E.default.safeLoad(e)}function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.loadSpec,i=void 0!==r&&r,a={ok:e.ok,url:e.url||t,status:e.status,statusText:e.statusText,headers:s(e.headers)},u=a.headers["content-type"],l=i||D(u);return(l?e.text:e.blob||e.buffer).call(e).then(function(e){if(a.text=e,a.data=e,l)try{var t=o(e,u);a.body=t,a.obj=t}catch(e){a.parseError=e}return a})}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return"function"==typeof e.forEach?(e.forEach(function(e,n){void 0!==t[n]?(t[n]=Array.isArray(t[n])?t[n]:[t[n]],t[n].push(e)):t[n]=e}),t):t}function u(e){return"undefined"!=typeof File?e instanceof File:null!==e&&"object"===(void 0===e?"undefined":(0,b.default)(e))&&"function"==typeof e.pipe}function l(e,t){var n=e.collectionFormat,r=e.allowEmptyValue,i="object"===(void 0===e?"undefined":(0,b.default)(e))?e.value:e,o={csv:",",ssv:"%20",tsv:"%09",pipes:"|"};if(void 0===i&&r)return"";if(u(i)||"boolean"==typeof i)return i;var a=encodeURIComponent;return t&&(a=(0,C.default)(i)?function(e){return e}:function(e){return(0,y.default)(e)}),"object"!==(void 0===i?"undefined":(0,b.default)(i))||Array.isArray(i)?Array.isArray(i)?Array.isArray(i)&&!n?i.map(a).join(","):"multi"===n?i.map(a):i.map(a).join(o[n]):a(i):""}function c(e){var t=(0,v.default)(e).reduce(function(t,n){var r=e[n],i=!!r.skipEncoding,o=i?n:encodeURIComponent(n),a=function(e){return e&&"object"===(void 0===e?"undefined":(0,b.default)(e))}(r)&&!Array.isArray(r);return t[o]=l(a?r:{value:r},i),t},{});return w.default.stringify(t,{encode:!1,indices:!1})||""}function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.url,r=void 0===t?"":t,i=e.query,o=e.form;if(o){var a=(0,v.default)(o).some(function(e){return u(o[e].value)}),s=e.headers["content-type"]||e.headers["Content-Type"];if(a||/multipart\/form-data/i.test(s)){var p=n(46);e.body=new p,(0,v.default)(o).forEach(function(t){e.body.append(t,l(o[t],!0))})}else e.body=c(o);delete e.form}if(i){var f=r.split("?"),h=(0,d.default)(f,2),m=h[0],g=h[1],y="";if(g){var _=w.default.parse(g);(0,v.default)(i).forEach(function(e){return delete _[e]}),y=w.default.stringify(_,{encode:!0})}var b=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.filter(function(e){return e}).join("&");return r?"?"+r:""}(y,c(i));e.url=m+b,delete e.query}return e}function f(e,t,n){return n=n||function(e){return e},t=t||function(e){return e},function(r){return"string"==typeof r&&(r={url:r}),A.mergeInQueryOrForm(r),r=t(r),n(e(r))}}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldDownloadAsText=t.self=void 0;var h=n(38),d=r(h),m=n(0),v=r(m),g=n(6),y=r(g),_=n(2),b=r(_);t.default=i,t.serializeRes=a,t.serializeHeaders=s,t.encodeFormOrQuery=c,t.mergeInQueryOrForm=p,t.makeHttp=f,n(42);var x=n(55),w=r(x),k=n(47),E=r(k),S=n(53),C=r(S),A=t.self={serializeRes:a,mergeInQueryOrForm:p},D=t.shouldDownloadAsText=function(){return/(json|xml|yaml|text)\b/.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){if(n=n||{},t=(0,z.default)({},t,{path:t.path&&o(t.path)}),"merge"===t.op){var r=I(e,t.path);(0,z.default)(r,t.value),W.default.applyPatch(e,[s(t.path,r)])}else if("mergeDeep"===t.op){var i=I(e,t.path),a=(0,z.default)({},i);(0,J.default)(i,t.value);for(var u in t.value)if(Object.prototype.hasOwnProperty.call(t.value,u)){var l=t.value[u];if(Array.isArray(l)){var c=a[u]||[];i[u]=c.concat(l)}}}else if("add"===t.op&&""===t.path&&k(t.value)){var p=(0,L.default)(t.value).reduce(function(e,n){return e.push({op:"add",path:"/"+o(n),value:t.value[n]}),e},[]);W.default.applyPatch(e,p)}else if("replace"===t.op&&""===t.path){var f=t.value;n.allowMetaPatches&&t.meta&&M(t)&&(Array.isArray(t.value)||k(t.value))&&(f=(0,z.default)({},f,t.meta)),e=f}else if(W.default.applyPatch(e,[t]),n.allowMetaPatches&&t.meta&&M(t)&&(Array.isArray(t.value)||k(t.value))){var h=I(e,t.path),d=(0,z.default)({},h,t.meta);W.default.applyPatch(e,[s(t.path,d)])}return e}function o(e){return Array.isArray(e)?e.length<1?"":"/"+e.map(function(e){return(e+"").replace(/~/g,"~0").replace(/\//g,"~1")}).join("/"):e}function a(e,t){return{op:"add",path:e,value:t}}function s(e,t,n){return{op:"replace",path:e,value:t,meta:n}}function u(e,t){return{op:"remove",path:e}}function l(e,t){return{type:"mutation",op:"merge",path:e,value:t}}function c(e,t){return{type:"mutation",op:"mergeDeep",path:e,value:t}}function p(e,t){return{type:"context",path:e,value:t}}function f(e,t){try{return d(e,v,t)}catch(e){return e}}function h(e,t){try{return d(e,m,t)}catch(e){return e}}function d(e,t,n){return w(x(e.filter(M).map(function(e){return t(e.value,n,e.path)})||[]))}function m(e,t,n){return n=n||[],Array.isArray(e)?e.map(function(e,r){return m(e,t,n.concat(r))}):k(e)?(0,L.default)(e).map(function(r){return m(e[r],t,n.concat(r))}):t(e,n[n.length-1],n)}function v(e,t,n){n=n||[];var r=[];if(n.length>0){var i=t(e,n[n.length-1],n);i&&(r=r.concat(i))}if(Array.isArray(e)){var o=e.map(function(e,r){return v(e,t,n.concat(r))});o&&(r=r.concat(o))}else if(k(e)){var a=(0,L.default)(e).map(function(r){return v(e[r],t,n.concat(r))});a&&(r=r.concat(a))}return r=x(r)}function g(e,t){if(!Array.isArray(t))return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}function y(e,t){return t.reduce(function(e,t){return void 0!==t&&e?e[t]:e},e)}function _(e){return w(x(b(e)))}function b(e){return Array.isArray(e)?e:[e]}function x(e){var t;return(t=[]).concat.apply(t,(0,N.default)(e.map(function(e){return Array.isArray(e)?x(e):e})))}function w(e){return e.filter(function(e){return void 0!==e})}function k(e){return e&&"object"===(void 0===e?"undefined":(0,j.default)(e))}function E(e){return k(e)&&S(e.then)}function S(e){return e&&"function"==typeof e}function C(e){return e instanceof Error}function A(e){if(P(e)){var t=e.op;return"add"===t||"remove"===t||"replace"===t}return!1}function D(e){return H.default.isGeneratorFunction(e)}function O(e){return A(e)||P(e)&&"mutation"===e.type}function M(e){return O(e)&&("add"===e.op||"replace"===e.op||"merge"===e.op||"mergeDeep"===e.op)}function T(e){return P(e)&&"context"===e.type}function P(e){return e&&"object"===(void 0===e?"undefined":(0,j.default)(e))}function I(e,t){try{return W.default.getValueByPointer(e,t)}catch(e){return console.error(e),{}}}Object.defineProperty(t,"__esModule",{value:!0});var R=n(2),j=r(R),F=n(39),N=r(F),B=n(0),L=r(B),q=n(1),z=r(q),U=n(45),W=r(U),V=n(17),H=r(V),G=n(43),J=r(G);t.default={add:a,replace:s,remove:u,merge:l,mergeDeep:c,context:p,getIn:y,applyPatch:i,parentPathMatch:g,flatten:x,fullyNormalizeArray:_,normalizeArray:b,isPromise:E,forEachNew:f,forEachNewPrimitive:h,isJsonPatch:A,isContextPatch:T,isPatch:P,isMutation:O,isAdditiveMutation:M,isGenerator:D,isFunction:S,isObject:k,isError:C}},function(e,t){e.exports=n(35)},function(e,t){e.exports=n(21)},function(e,t){e.exports=n(939)},function(e,t){e.exports=n(572)},function(e,t){e.exports=n(497)},function(e,t,n){"use strict";function r(e){var t=e[e.length-1],n=e.join("/");return i.indexOf(t)>-1||o.indexOf(n)>-1}Object.defineProperty(t,"__esModule",{value:!0}),t.isFreelyNamed=r;var i=["properties"],o=["definitions","parameters","responses","securityDefinitions","components/schemas","components/responses","components/parameters","components/securitySchemes"]},function(e,t,n){"use strict";function r(e,t){function n(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack;for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];this.message=n[0],t&&t.apply(this,n)}return n.prototype=new Error,n.prototype.name=e,n.prototype.constructor=n,n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},function(e,t){e.exports=n(95)},function(e,t){e.exports=n(332)},function(e,t){e.exports=n(2)},function(e,t){e.exports=n(3)},function(e,t){e.exports=n(569)},function(e,t){e.exports=n(224)},function(e,t){e.exports=n(956)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof e?n.url=e:n=e,!(this instanceof i))return new i(n);(0,l.default)(this,n);var r=this.resolve().then(function(){return t.disableInterfaces||(0,l.default)(t,i.makeApisTagOperation(t)),t});return r.client=this,r}var o=n(7),a=r(o),s=n(48),u=(r(s),n(8)),l=r(u),c=n(19),p=r(c),f=n(10),h=r(f),d=n(4),m=r(d),v=n(28),g=r(v),y=n(27),_=n(21),b=n(3);i.http=m.default,i.makeHttp=d.makeHttp.bind(null,i.http),i.resolve=g.default,i.execute=_.execute,i.serializeRes=d.serializeRes,i.serializeHeaders=d.serializeHeaders,i.clearCache=v.clearCache,i.parameterBuilders=_.PARAMETER_BUILDERS,i.makeApisTagOperation=y.makeApisTagOperation,i.buildRequest=_.buildRequest,i.helpers={opId:b.opId},e.exports=i,i.prototype={http:m.default,execute:function(e){return this.applyDefaults(),i.execute((0,a.default)({spec:this.spec,http:this.http,securities:{authorized:this.authorizations}},e))},resolve:function(){var e=this;return i.resolve({spec:this.spec,url:this.url,allowMetaPatches:this.allowMetaPatches,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null}).then(function(t){return e.originalSpec=e.spec,e.spec=t.spec,e.errors=t.errors,e})}},i.prototype.applyDefaults=function(){var e=this.spec,t=this.url;if(t&&(0,p.default)(t,"http")){var n=h.default.parse(t);e.host||(e.host=n.host),e.schemes||(e.schemes=[n.protocol.replace(":","")]),e.basePath||(e.basePath="/")}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.http,n=e.fetch,r=e.spec,i=e.operationId,o=e.pathName,a=e.method,s=e.parameters,u=e.securities,l=(0,v.default)(e,["http","fetch","spec","operationId","pathName","method","parameters","securities"]),c=t||n||R.default;o&&a&&!i&&(i=(0,H.legacyIdFromPathMethod)(o,a));var p=Y.buildRequest((0,d.default)({spec:r,operationId:i,parameters:s,securities:u,http:c},l));return p.body&&((0,S.default)(p.body)||(0,A.default)(p.body))&&(p.body=(0,f.default)(p.body)),c(p)}function o(e){var t=e.spec,n=e.operationId,r=(e.securities,e.requestContentType,e.responseContentType),i=e.scheme,o=e.requestInterceptor,s=e.responseInterceptor,u=e.contextUrl,l=e.userFetch,c=(e.requestBody,e.server),p=e.serverVariables,f=e.http,h=e.parameters,m=e.parameterBuilders,v=(0,H.isOAS3)(t);m||(m=v?q.default:B.default);var g=f&&f.withCredentials?"include":"same-origin",_={url:"",credentials:g,headers:{},cookies:{}};o&&(_.requestInterceptor=o),s&&(_.responseInterceptor=s),l&&(_.userFetch=l);var b=(0,H.getOperationRaw)(t,n);if(!b)throw new J("Operation "+n+" not found");var x=b.operation,w=void 0===x?{}:x,k=b.method,E=b.pathName;if(_.url+=a({spec:t,scheme:i,contextUrl:u,server:c,serverVariables:p,pathName:E,method:k}),!n)return delete _.cookies,_;_.url+=E,_.method=(""+k).toUpperCase(),h=h||{};var S=t.paths[E]||{};r&&(_.headers.accept=r);var C=X([].concat(G(w.parameters)).concat(G(S.parameters)));C.forEach(function(e){var n=m[e.in],r=void 0;if("body"===e.in&&e.schema&&e.schema.properties&&(r=h),r=e&&e.name&&h[e.name],void 0===r?r=e&&e.name&&h[e.in+"."+e.name]:K(e.name,C).length>1&&console.warn("Parameter '"+e.name+"' is ambiguous because the defined spec has more than one parameter with the name: '"+e.name+"' and the passed-in parameter values did not define an 'in' value."),void 0!==e.default&&void 0===r&&(r=e.default),void 0===r&&e.required&&!e.allowEmptyValue)throw new Error("Required parameter "+e.name+" is not provided");n&&n({req:_,parameter:e,value:r,operation:w,spec:t})});var A=(0,d.default)({},e,{operation:w});if(_=v?(0,U.default)(A,_):(0,V.default)(A,_),_.cookies&&(0,y.default)(_.cookies).length){var D=(0,y.default)(_.cookies).reduce(function(e,t){var n=_.cookies[t];return e+(e?"&":"")+P.default.serialize(t,n)},"");_.headers.Cookie=D}return _.cookies&&delete _.cookies,(0,I.mergeInQueryOrForm)(_),_}function a(e){return(0,H.isOAS3)(e.spec)?s(e):c(e)}function s(e){var t=e.spec,n=e.pathName,r=e.method,i=e.server,o=e.contextUrl,a=e.serverVariables,s=void 0===a?{}:a,c=(0,k.default)(t,["paths",n,(r||"").toLowerCase(),"servers"])||(0,k.default)(t,["paths",n,"servers"])||(0,k.default)(t,["servers"]),p="",f=null;if(i&&c){var h=c.map(function(e){return e.url});h.indexOf(i)>-1&&(p=i,f=c[h.indexOf(i)])}return!p&&c&&(p=c[0].url,f=c[0]),p.indexOf("{")>-1&&l(p).forEach(function(e){if(f.variables&&f.variables[e]){var t=f.variables[e],n=s[e]||t.default,r=new RegExp("{"+e+"}","g");p=p.replace(r,n)}}),u(p,o)}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=M.default.parse(e),r=M.default.parse(t),i=$(n.protocol)||$(r.protocol)||"",o=n.host||r.host,a=n.pathname||"",s=void 0;return s=i&&o?i+"://"+(o+a):a,"/"===s[s.length-1]?s.slice(0,-1):s}function l(e){for(var t=[],n=/{([^}]+)}/g,r=void 0;r=n.exec(e);)t.push(r[1]);return t}function c(e){var t=e.spec,n=e.scheme,r=e.contextUrl,i=void 0===r?"":r,o=M.default.parse(i),a=Array.isArray(t.schemes)?t.schemes[0]:null,s=n||a||$(o.protocol)||"http",u=t.host||o.host||"",l=t.basePath||"",c=void 0;return c=s&&u?s+"://"+(u+l):l,"/"===c[c.length-1]?c.slice(0,-1):c}Object.defineProperty(t,"__esModule",{value:!0}),t.self=void 0;var p=n(6),f=r(p),h=n(7),d=r(h),m=n(37),v=r(m),g=n(0),y=r(g),_=n(1),b=r(_);t.execute=i,t.buildRequest=o,t.baseUrl=a;var x=n(8),w=(r(x),n(18)),k=r(w),E=n(52),S=r(E),C=n(50),A=r(C),D=n(9),O=(r(D),n(10)),M=r(O),T=n(40),P=r(T),I=n(4),R=r(I),j=n(12),F=r(j),N=n(26),B=r(N),L=n(23),q=r(L),z=n(22),U=r(z),W=n(25),V=r(W),H=n(3),G=function(e){return Array.isArray(e)?e:[]},J=(0,F.default)("OperationNotFoundError",function(e,t,n){this.originalError=n,(0,b.default)(this,t||{})}),K=function(e,t){return t.filter(function(t){return t.name===e})},X=function(e){var t={};e.forEach(function(e){t[e.in]||(t[e.in]={}),t[e.in][e.name]=e});var n=[];return(0,y.default)(t).forEach(function(e){(0,y.default)(t[e]).forEach(function(r){n.push(t[e][r])})}),n},Y=t.self={buildRequest:o},$=function(e){return e?e.replace(/\W/g,""):null}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.request,n=e.securities,r=void 0===n?{}:n,i=e.operation,o=void 0===i?{}:i,a=e.spec,s=(0,f.default)({},t),u=r.authorized,l=void 0===u?{}:u,p=o.security||a.security||[],h=l&&!!(0,c.default)(l).length,m=(0,d.default)(a,["components","securitySchemes"])||{};return s.headers=s.headers||{},s.query=s.query||{},(0,c.default)(r).length&&h&&p&&(!Array.isArray(o.security)||o.security.length)?(p.forEach(function(e,t){for(var n in e){var r=l[n],i=m[n];if(r){var o=r.value||r,a=i.type;if(r)if("apiKey"===a)"query"===i.in&&(s.query[i.name]=o),"header"===i.in&&(s.headers[i.name]=o),"cookie"===i.in&&(s.cookies[i.name]=o);else if("http"===a){if("basic"===i.scheme){var u=o.username,c=o.password,p=(0,v.default)(u+":"+c);s.headers.Authorization="Basic "+p}"bearer"===i.scheme&&(s.headers.Authorization="Bearer "+o)}else if("oauth2"===a){var f=r.token||{},h=f.access_token,d=f.token_type;d&&"bearer"!==d.toLowerCase()||(d="Bearer"),s.headers.Authorization=d+" "+h}}}}),s):t}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),a=r(o),s=n(2),u=r(s),l=n(0),c=r(l);t.default=function(e,t){var n=e.operation,r=e.requestBody,o=e.securities,s=e.spec,l=e.requestContentType;t=i({request:t,securities:o,operation:n,spec:s});var p=n.requestBody||{},f=(0,c.default)(p.content||{});if(r){var h=l&&f.indexOf(l)>-1;if(l&&h)t.headers["Content-Type"]=l;else if(!l){var d=f[0];d&&(t.headers["Content-Type"]=d,l=d)}}return r&&(l?f.indexOf(l)>-1&&("application/x-www-form-urlencoded"===l?"object"===(void 0===r?"undefined":(0,u.default)(r))?(t.form={},(0,c.default)(r).forEach(function(e){var n=r[e],i=void 0;i="object"===(void 0===n?"undefined":(0,u.default)(n))?Array.isArray(n)?n.toString():(0,a.default)(n):n,t.form[e]={value:i}})):t.form=r:t.body=r):t.body=r),t},t.applySecurities=i;var p=n(8),f=r(p),h=n(18),d=r(h),m=n(9),v=r(m)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.req,n=e.value,r=e.parameter,i=r.name,o=r.style,a=r.explode,s=(0,h.default)({key:r.name,value:n,style:o||"simple",explode:a||!1,escape:!1});t.url=t.url.replace("{"+i+"}",s)}function o(e){var t=e.req,n=e.value,r=e.parameter;if(t.query=t.query||{},!1===n&&(n="false"),0===n&&(n="0"),n){var i=void 0===n?"undefined":(0,p.default)(n);if("deepObject"===r.style)(0,l.default)(n).forEach(function(e){var i=n[e];t.query[r.name+"["+e+"]"]={value:(0,h.default)({key:e,value:i,style:"deepObject",escape:r.allowReserved?"unsafe":"reserved"}),skipEncoding:!0}});else if("object"!==i||Array.isArray(n)||"form"!==r.style&&r.style||!r.explode&&void 0!==r.explode)t.query[r.name]={value:(0,h.default)({key:r.name,value:n,style:r.style||"form",explode:void 0===r.explode||r.explode,escape:r.allowReserved?"unsafe":"reserved"}),skipEncoding:!0};else{var o=(0,l.default)(n);o.forEach(function(e){var i=n[e];t.query[e]={value:(0,h.default)({key:e,value:i,style:r.style||"form",escape:r.allowReserved?"unsafe":"reserved"}),skipEncoding:!0}})}}else if(r.allowEmptyValue){var a=r.name;t.query[a]=t.query[a]||{},t.query[a].allowEmptyValue=!0}}function a(e){var t=e.req,n=e.parameter,r=e.value;t.headers=t.headers||{},d.indexOf(n.name.toLowerCase())>-1||void 0!==r&&(t.headers[n.name]=(0,h.default)({key:n.name,value:r,style:n.style||"simple",explode:void 0!==n.explode&&n.explode,escape:!1}))}function s(e){var t=e.req,n=e.parameter,r=e.value;t.headers=t.headers||{};var i=void 0===r?"undefined":(0,p.default)(r);if("undefined"!==i){var o="object"===i&&!Array.isArray(r)&&n.explode?"":n.name+"=";t.headers.Cookie=o+(0,h.default)({key:n.name,value:r,escape:!1,style:n.style||"form",explode:void 0!==n.explode&&n.explode})}}Object.defineProperty(t,"__esModule",{value:!0});var u=n(0),l=r(u),c=n(2),p=r(c),f=n(24),h=r(f);t.default={path:i,query:o,header:a,cookie:s};var d=["accept","authorization","content-type"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.escape,r=arguments[2];return"number"==typeof e&&(e=e.toString()),"string"==typeof e&&e.length&&n?r?JSON.parse(e):(0,m.stringToCharArray)(e).map(function(e){return g(e)?e:v(e)&&"unsafe"===n?e:((0,d.default)(e)||[]).map(function(e){return e.toString(16).toUpperCase()}).map(function(e){return"%"+e}).join("")}).join(""):e}function o(e){var t=e.key,n=e.value,r=e.style,o=e.explode,a=e.escape,s=function(e){return i(e,{escape:a})};if("simple"===r)return n.map(function(e){return s(e)}).join(",");if("label"===r)return"."+n.map(function(e){return s(e)}).join(".");if("matrix"===r)return n.map(function(e){return s(e)}).reduce(function(e,n){return!e||o?(e||"")+";"+t+"="+n:e+","+n},"");if("form"===r){var u=o?"&"+t+"=":",";return n.map(function(e){return s(e)}).join(u)}if("spaceDelimited"===r){var l=o?t+"=":"";return n.map(function(e){return s(e)}).join(" "+l)}if("pipeDelimited"===r){var c=o?t+"=":"";return n.map(function(e){return s(e)}).join("|"+c)}}function a(e){var t=e.key,n=e.value,r=e.style,o=e.explode,a=e.escape,s=function(e){return i(e,{escape:a})},u=(0,l.default)(n);return"simple"===r?u.reduce(function(e,t){var r=s(n[t]),i=o?"=":",";return(e?e+",":"")+t+i+r},""):"label"===r?u.reduce(function(e,t){var r=s(n[t]),i=o?"=":".";return(e?e+".":".")+t+i+r},""):"matrix"===r&&o?u.reduce(function(e,t){var r=s(n[t]);return(e?e+";":";")+t+"="+r},""):"matrix"===r?u.reduce(function(e,r){var i=s(n[r]);return(e?e+",":";"+t+"=")+r+","+i},""):"form"===r?u.reduce(function(e,t){var r=s(n[t]);return(e?e+(o?"&":","):"")+t+(o?"=":",")+r},""):void 0}function s(e){var t=e.key,n=e.value,r=e.style,o=e.escape,a=function(e){return i(e,{escape:o})};return"simple"===r?a(n):"label"===r?"."+a(n):"matrix"===r?";"+t+"="+a(n):"form"===r?a(n):"deepObject"===r?a(n):void 0}Object.defineProperty(t,"__esModule",{value:!0});var u=n(0),l=r(u),c=n(2),p=r(c);t.encodeDisallowedCharacters=i,t.default=function(e){var t=e.value;return Array.isArray(t)?o(e):"object"===(void 0===t?"undefined":(0,p.default)(t))?a(e):s(e)};var f=n(44),h=(r(f),n(56)),d=r(h),m=n(57),v=function(e){return":/?#[]@!$&'()*+,;=".indexOf(e)>-1},g=function(e){return/^[a-z0-9\-._~]+$/i.test(e)}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.request,n=e.securities,r=void 0===n?{}:n,i=e.operation,o=void 0===i?{}:i,s=e.spec,l=(0,c.default)({},t),p=r.authorized,f=void 0===p?{}:p,h=r.specSecurity,d=void 0===h?[]:h,m=o.security||d,v=f&&!!(0,a.default)(f).length,g=s.securityDefinitions;return l.headers=l.headers||{},l.query=l.query||{},(0,a.default)(r).length&&v&&m&&(!Array.isArray(o.security)||o.security.length)?(m.forEach(function(e,t){for(var n in e){var r=f[n];if(r){var i=r.token,o=r.value||r,a=g[n],s=a.type,c=i&&i.access_token,p=i&&i.token_type;if(r)if("apiKey"===s){var h="query"===a.in?"query":"headers";l[h]=l[h]||{},l[h][a.name]=o}else"basic"===s?o.header?l.headers.authorization=o.header:(o.base64=(0,u.default)(o.username+":"+o.password),l.headers.authorization="Basic "+o.base64):"oauth2"===s&&c&&(p=p&&"bearer"!==p.toLowerCase()?p:"Bearer",l.headers.authorization=p+" "+c)}}}),l):t}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),a=r(o);t.default=function(e,t){var n=e.spec,r=e.operation,o=e.securities,a=e.requestContentType;return t=i({request:t,securities:o,operation:r,spec:n}),(t.body||t.form)&&(a?t.headers["Content-Type"]=a:Array.isArray(r.consumes)?t.headers["Content-Type"]=r.consumes[0]:Array.isArray(n.consumes)?t.headers["Content-Type"]=n.consumes[0]:r.parameters&&r.parameters.filter(function(e){return"file"===e.type}).length?t.headers["Content-Type"]="multipart/form-data":r.parameters&&r.parameters.filter(function(e){return"formData"===e.in}).length&&(t.headers["Content-Type"]="application/x-www-form-urlencoded")),t},t.applySecurities=i;var s=n(9),u=r(s),l=n(8),c=r(l);r(n(4))},function(e,t,n){"use strict";function r(e){var t=e.req,n=e.value;t.body=n}function i(e){var t=e.req,n=e.value,r=e.parameter;t.form=t.form||{},(n||r.allowEmptyValue)&&(t.form[r.name]={value:n,allowEmptyValue:r.allowEmptyValue,collectionFormat:r.collectionFormat})}function o(e){var t=e.req,n=e.parameter,r=e.value;t.headers=t.headers||{},void 0!==r&&(t.headers[n.name]=r)}function a(e){var t=e.req,n=e.value,r=e.parameter;t.url=t.url.replace("{"+r.name+"}",encodeURIComponent(n))}function s(e){var t=e.req,n=e.value,r=e.parameter;if(t.query=t.query||{},!1===n&&"boolean"===r.type&&(n="false"),0===n&&["number","integer"].indexOf(r.type)>-1&&(n="0"),n)t.query[r.name]={collectionFormat:r.collectionFormat,value:n};else if(r.allowEmptyValue){var i=r.name;t.query[i]=t.query[i]||{},t.query[i].allowEmptyValue=!0}}Object.defineProperty(t,"__esModule",{value:!0}),t.default={body:r,header:o,query:s,path:a,formData:i}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var n=t.pathName,r=t.method,i=t.operationId;return function(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.execute((0,l.default)({spec:e.spec},(0,p.default)(e,"requestInterceptor","responseInterceptor","userFetch"),{pathName:n,method:r,parameters:t,operationId:i},o))}}}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=m.makeExecute(e),n=m.mapTagOperations({spec:e.spec,cb:t}),r={};for(var i in n){r[i]={operations:{}};for(var o in n[i])r[i].operations[o]={execute:n[i][o]}}return{apis:r}}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=m.makeExecute(e);return{apis:m.mapTagOperations({spec:e.spec,cb:t})}}function s(e){var t=e.spec,n=e.cb,r=void 0===n?h:n,i=e.defaultTag,o=void 0===i?"default":i,a={},s={};return(0,f.eachOperation)(t,function(e){var n=e.pathName,i=e.method,u=e.operation;(u.tags?d(u.tags):[o]).forEach(function(e){if("string"==typeof e){var o=s[e]=s[e]||{},l=(0,f.opId)(u,n,i),c=r({spec:t,pathName:n,method:i,operation:u,operationId:l});if(a[l])a[l]++,o[""+l+a[l]]=c;else if(void 0!==o[l]){var p=a[l]||1;a[l]=p+1,o[""+l+a[l]]=c;var h=o[l];delete o[l],o[""+l+p]=h}else o[l]=c}})}),s}Object.defineProperty(t,"__esModule",{value:!0}),t.self=void 0;var u=n(7),l=r(u);t.makeExecute=i,t.makeApisTagOperationsOperationExecute=o,t.makeApisTagOperation=a,t.mapTagOperations=s;var c=n(54),p=r(c),f=n(3),h=function(){return null},d=function(e){return Array.isArray(e)?e:[e]},m=t.self={mapTagOperations:s,makeExecute:i}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.requestInterceptor,r=t.responseInterceptor,i=e.withCredentials?"include":"same-origin";return function(t){return e({url:t,loadSpec:!0,requestInterceptor:n,responseInterceptor:r,headers:{Accept:"application/json"},credentials:i}).then(function(e){return e.body})}}function o(){l.plugins.refs.clearCache()}function a(e){function t(e){y&&(l.plugins.refs.docCache[y]=e),l.plugins.refs.fetchJSON=i(g,{requestInterceptor:m,responseInterceptor:v});var t=[l.plugins.refs];return"function"==typeof d&&t.push(l.plugins.parameters),"function"==typeof h&&t.push(l.plugins.properties),"strict"!==a&&t.push(l.plugins.allOf),(0,c.default)({spec:e,context:{baseDoc:y},plugins:t,allowMetaPatches:f,parameterMacro:d,modelPropertyMacro:h}).then(p.normalizeSwagger)}var n=e.fetch,r=e.spec,o=e.url,a=e.mode,s=e.allowMetaPatches,f=void 0===s||s,h=e.modelPropertyMacro,d=e.parameterMacro,m=e.requestInterceptor,v=e.responseInterceptor,g=e.http,y=e.baseDoc;return y=y||o,g=n||g||u.default,r?t(r):i(g,{requestInterceptor:m,responseInterceptor:v})(y).then(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.makeFetchJSON=i,t.clearCache=o,t.default=a;var s=n(4),u=r(s),l=n(29),c=r(l),p=n(3)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){return new N(e).dispatch()}Object.defineProperty(t,"__esModule",{value:!0}),t.plugins=t.SpecMap=void 0;var o=n(6),a=r(o),s=n(14),u=r(s),l=n(17),c=r(l),p=n(0),f=r(p),h=n(13),d=r(h),m=n(35),v=r(m),g=n(1),y=r(g),_=n(15),b=r(_),x=n(16),w=r(x);t.default=i;var k=n(49),E=r(k),S=n(5),C=r(S),A=n(34),D=r(A),O=n(30),M=r(O),T=n(32),P=r(T),I=n(33),R=r(I),j=n(31),F=r(j),N=function(){function e(t){(0,b.default)(this,e),(0,y.default)(this,{spec:"",debugLevel:"info",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new F.default,showDebug:!1,allPatches:[],pluginProp:"specMap",libMethods:(0,y.default)((0,v.default)(this),C.default),allowMetaPatches:!1},t),this.get=this._get.bind(this),this.getContext=this._getContext.bind(this),this.hasRun=this._hasRun.bind(this),this.wrappedPlugins=this.plugins.map(this.wrapPlugin.bind(this)).filter(C.default.isFunction),this.patches.push(C.default.add([],this.spec)),this.patches.push(C.default.context([],this.context)),this.updatePatches(this.patches)}return(0,w.default)(e,[{key:"debug",value:function(e){if(this.debugLevel===e){for(var t,n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(t=console).log.apply(t,r)}}},{key:"verbose",value:function(e){if("verbose"===this.debugLevel){for(var t,n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(t=console).log.apply(t,["["+e+"] "].concat(r))}}},{key:"wrapPlugin",value:function(e,t){var n=null,r=void 0;return e[this.pluginProp]?(n=e,r=e[this.pluginProp]):C.default.isFunction(e)?r=e:C.default.isObject(e)&&(r=function(e){return c.default.mark(function t(n,r){var i,o,a,s,u,l,p,h,m;return c.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:m=function t(n,a,s){var u,l,p,h,m,v,g,y,_,b,x,w,k,E,S;return c.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(C.default.isObject(n)){i.next=6;break}if(e.key!==a[a.length-1]){i.next=4;break}return i.next=4,e.plugin(n,e.key,a,r);case 4:i.next=46;break;case 6:u=a.length-1,l=a[u],p=a.indexOf("properties"),h="properties"===l&&u===p,m=r.allowMetaPatches&&o[n.$$ref],v=!0,g=!1,y=void 0,i.prev=14,_=(0,d.default)((0,f.default)(n));case 16:if(v=(b=_.next()).done){i.next=32;break}if(x=b.value,w=n[x],k=a.concat(x),E=C.default.isObject(w),S=n.$$ref,m){i.next=26;break}if(!E){i.next=26;break}return r.allowMetaPatches&&S&&(o[S]=!0),i.delegateYield(t(w,k,s),"t0",26);case 26:if(h||x!==e.key){i.next=29;break}return i.next=29,e.plugin(w,x,k,r,s);case 29:v=!0,i.next=16;break;case 32:i.next=38;break;case 34:i.prev=34,i.t1=i.catch(14),g=!0,y=i.t1;case 38:i.prev=38,i.prev=39,!v&&_.return&&_.return();case 41:if(i.prev=41,!g){i.next=44;break}throw y;case 44:return i.finish(41);case 45:return i.finish(38);case 46:case"end":return i.stop()}},i,this,[[14,34,38,46],[39,,41,45]])},i=c.default.mark(m),o={},a=!0,s=!1,u=void 0,t.prev=6,l=(0,d.default)(n.filter(C.default.isAdditiveMutation));case 8:if(a=(p=l.next()).done){t.next=14;break}return h=p.value,t.delegateYield(m(h.value,h.path,h),"t0",11);case 11:a=!0,t.next=8;break;case 14:t.next=20;break;case 16:t.prev=16,t.t1=t.catch(6),s=!0,u=t.t1;case 20:t.prev=20,t.prev=21,!a&&l.return&&l.return();case 23:if(t.prev=23,!s){t.next=26;break}throw u;case 26:return t.finish(23);case 27:return t.finish(20);case 28:case"end":return t.stop()}},t,this,[[6,16,20,28],[21,,23,27]])})}(e)),(0,y.default)(r.bind(n),{pluginName:e.name||t,isGenerator:C.default.isGenerator(r)})}},{key:"nextPlugin",value:function(){var e=this;return(0,E.default)(this.wrappedPlugins,function(t){return e.getMutationsForPlugin(t).length>0})}},{key:"nextPromisedPatch",value:function(){if(this.promisedPatches.length>0)return u.default.race(this.promisedPatches.map(function(e){return e.value}))}},{key:"getPluginHistory",value:function(e){var t=this.getPluginName(e);return this.pluginHistory[t]||[]}},{key:"getPluginRunCount",value:function(e){return this.getPluginHistory(e).length}},{key:"getPluginHistoryTip",value:function(e){var t=this.getPluginHistory(e);return t&&t[t.length-1]||{}}},{key:"getPluginMutationIndex",value:function(e){var t=this.getPluginHistoryTip(e).mutationIndex;return"number"!=typeof t?-1:t}},{key:"getPluginName",value:function(e){return e.pluginName}},{key:"updatePluginHistory",value:function(e,t){var n=this.getPluginName(e);(this.pluginHistory[n]=this.pluginHistory[n]||[]).push(t)}},{key:"updatePatches",value:function(e,t){var n=this;C.default.normalizeArray(e).forEach(function(e){if(e instanceof Error)return void n.errors.push(e);try{if(!C.default.isObject(e))return void n.debug("updatePatches","Got a non-object patch",e);if(n.showDebug&&n.allPatches.push(e),C.default.isPromise(e.value))return n.promisedPatches.push(e),void n.promisedPatchThen(e);if(C.default.isContextPatch(e))return void n.setContext(e.path,e.value);if(C.default.isMutation(e))return void n.updateMutations(e)}catch(e){n.errors.push(e)}})}},{key:"updateMutations",value:function(e){var t=C.default.applyPatch(this.state,e,{allowMetaPatches:this.allowMetaPatches});t&&(this.mutations.push(e),this.state=t)}},{key:"removePromisedPatch",value:function(e){var t=this.promisedPatches.indexOf(e);if(t<0)return void this.debug("Tried to remove a promisedPatch that isn't there!");this.promisedPatches.splice(t,1)}},{key:"promisedPatchThen",value:function(e){var t=this;return e.value=e.value.then(function(n){var r=(0,y.default)({},e,{value:n});t.removePromisedPatch(e),t.updatePatches(r)}).catch(function(n){t.removePromisedPatch(e),t.updatePatches(n)})}},{key:"getMutations",value:function(e,t){return e=e||0,"number"!=typeof t&&(t=this.mutations.length),this.mutations.slice(e,t)}},{key:"getCurrentMutations",value:function(){return this.getMutationsForPlugin(this.getCurrentPlugin())}},{key:"getMutationsForPlugin",value:function(e){var t=this.getPluginMutationIndex(e);return this.getMutations(t+1)}},{key:"getCurrentPlugin",value:function(){return this.currentPlugin}},{key:"getPatchesOfType",value:function(e,t){return e.filter(t)}},{key:"getLib",value:function(){return this.libMethods}},{key:"_get",value:function(e){return C.default.getIn(this.state,e)}},{key:"_getContext",value:function(e){return this.contextTree.get(e)}},{key:"setContext",value:function(e,t){return this.contextTree.set(e,t)}},{key:"_hasRun",value:function(e){return this.getPluginRunCount(this.getCurrentPlugin())>(e||0)}},{key:"_clone",value:function(e){return JSON.parse((0,a.default)(e))}},{key:"dispatch",value:function(){function e(e){e&&(e=C.default.fullyNormalizeArray(e),n.updatePatches(e,r))}var t=this,n=this,r=this.nextPlugin();if(!r){var i=this.nextPromisedPatch();if(i)return i.then(function(){return t.dispatch()}).catch(function(){return t.dispatch()});var o={spec:this.state,errors:this.errors};return this.showDebug&&(o.patches=this.allPatches),u.default.resolve(o)}if(n.pluginCount=n.pluginCount||{},n.pluginCount[r]=(n.pluginCount[r]||0)+1,n.pluginCount[r]>100)return u.default.resolve({spec:n.state,errors:n.errors.concat(new Error("We've reached a hard limit of 100 plugin runs"))});if(r!==this.currentPlugin&&this.promisedPatches.length){var a=this.promisedPatches.map(function(e){return e.value});return u.default.all(a.map(function(e){return e.then(Function,Function)})).then(function(){return t.dispatch()})}return function(){n.currentPlugin=r;var t=n.getCurrentMutations(),i=n.mutations.length-1;try{if(r.isGenerator){var o=!0,a=!1,s=void 0;try{for(var u,l=(0,d.default)(r(t,n.getLib()));!(o=(u=l.next()).done);o=!0)e(u.value)}catch(e){a=!0,s=e}finally{try{!o&&l.return&&l.return()}finally{if(a)throw s}}}else e(r(t,n.getLib()))}catch(t){e([(0,y.default)((0,v.default)(t),{plugin:r})])}finally{n.updatePluginHistory(r,{mutationIndex:i})}return n.dispatch()}()}}]),e}(),B={refs:D.default,allOf:M.default,parameters:P.default,properties:R.default};t.SpecMap=N,t.plugins=B},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(11);t.default={key:"allOf",plugin:function(e,t,n,r,a){if(!a.meta||!a.meta.$$ref){var s=n.slice(0,-1);if(!(0,o.isFreelyNamed)(s)){if(!Array.isArray(e)){var u=new TypeError("allOf must be an array");return u.fullPath=n,u}var l=!1,c=a.value;s.forEach(function(e){c=c[e]}),c=(0,i.default)({},c),delete c.allOf;var p=[r.replace(s,{})].concat(e.map(function(e,t){if(!r.isObject(e)){if(l)return null;l=!0;var i=new TypeError("Elements in allOf must be objects");return i.fullPath=n,i}return r.mergeDeep(s,e)}));return p.push(r.mergeDeep(s,c)),c.$$ref||p.push(r.remove([].concat(s,"$$ref"))),p}}}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){return o({children:{}},e,t)}function o(e,t,n){return e.value=t||{},e.protoValue=n?(0,l.default)({},n.protoValue,e.value):e.value,(0,s.default)(e.children).forEach(function(t){var n=e.children[t];e.children[t]=o(n,n.value,e)}),e}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),s=r(a),u=n(7),l=r(u),c=n(15),p=r(c),f=n(16),h=r(f),d=function(){function e(t){(0,p.default)(this,e),this.root=i(t||{})}return(0,h.default)(e,[{key:"set",value:function(e,t){var n=this.getParent(e,!0);if(!n)return void o(this.root,t,null);var r=e[e.length-1],a=n.children;if(a[r])return void o(a[r],t,n);a[r]=i(t,n)}},{key:"get",value:function(e){if(e=e||[],e.length<1)return this.root.value;for(var t=this.root,n=void 0,r=void 0,i=0;i<e.length&&(r=e[i],n=t.children,n[r]);i++)t=n[r];return t&&t.protoValue}},{key:"getParent",value:function(e,t){return!e||e.length<1?null:e.length<2?this.root:e.slice(0,-1).reduce(function(e,n){if(!e)return e;var r=e.children;return!r[n]&&t&&(r[n]=i(null,e)),r[n]},this.root)}}]),e}();t.default=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(5),s=r(a);t.default={key:"parameters",plugin:function(e,t,n,r,i){if(Array.isArray(e)&&e.length){var a=(0,o.default)([],e),u=n.slice(0,-1),l=(0,o.default)({},s.default.getIn(r.spec,u));return e.forEach(function(e,t){try{a[t].default=r.parameterMacro(l,e)}catch(e){var i=new Error(e);return i.fullPath=n,i}}),s.default.replace(n,a)}return s.default.replace(n,e)}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(5),s=r(a);t.default={key:"properties",plugin:function(e,t,n,r){var i=(0,o.default)({},e);for(var a in e)try{i[a].default=r.modelPropertyMacro(i[a])}catch(e){var u=new Error(e);return u.fullPath=n,u}return s.default.replace(n,i)}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!N.test(e)){if(!t)throw new B("Tried to resolve a relative URL, without having a basePath. path: '"+e+"' basePath: '"+t+"'");return T.default.resolve(t,e)}return e}function o(e,t){return new B("Could not resolve reference because of: "+e.message,t,e)}function a(e){return(e+"").split("#")}function s(e,t){var n=L[e];if(n&&!I.default.isPromise(n))try{var r=p(t,n);return(0,D.default)(E.default.resolve(r),{__value:r})}catch(e){return E.default.reject(e)}return l(e).then(function(e){return p(t,e)})}function u(e){void 0!==e?delete L[e]:(0,w.default)(L).forEach(function(e){delete L[e]})}function l(e){var t=L[e];return t?I.default.isPromise(t)?t:E.default.resolve(t):(L[e]=U.fetchJSON(e).then(function(t){return L[e]=t,t}),L[e])}function c(e){return(0,O.fetch)(e,{headers:{Accept:"application/json, application/yaml"},loadSpec:!0}).then(function(e){return e.json()})}function p(e,t){var n=f(e);if(n.length<1)return t;var r=I.default.getIn(t,n);if(void 0===r)throw new B("Could not resolve pointer: "+e+" does not exist in document",{pointer:e});return r}function f(e){if("string"!=typeof e)throw new TypeError("Expected a string, got a "+(void 0===e?"undefined":(0,b.default)(e)));return"/"===e[0]&&(e=e.substr(1)),""===e?[]:e.split("/").map(h)}function h(e){return"string"!=typeof e?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}function d(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function m(e){return 0===e.length?"":"/"+e.map(d).join("/")}function v(e,t){if(W(t))return!0;var n=e.charAt(t.length);return 0===e.indexOf(t)&&(!n||"/"===n||"#"===n)}function g(e,t,n,r){var i=q.get(r);i||(i={},q.set(r,i));var o=m(n),a=(t||"<specmap-base>")+"#"+e;if(t==r.contextTree.get([]).baseDoc&&v(o,e))return!0;var s="";if(n.some(function(e){return s=s+"/"+d(e),i[s]&&i[s].some(function(e){return v(e,a)||v(a,e)})}))return!0;i[o]=(i[o]||[]).concat(a)}function y(e,t){function n(e){return I.default.isObject(e)&&(r.indexOf(e)>=0||(0,w.default)(e).some(function(t){return n(e[t])}))}var r=[e];return t.path.reduce(function(e,t){return r.push(e[t]),e[t]},e),n(t.value)}Object.defineProperty(t,"__esModule",{value:!0});var _=n(2),b=r(_),x=n(0),w=r(x),k=n(14),E=r(k),S=n(36),C=r(S),A=n(1),D=r(A),O=n(41),M=n(10),T=r(M),P=n(5),I=r(P),R=n(12),j=r(R),F=n(11),N=new RegExp("^([a-z]+://|//)","i"),B=(0,j.default)("JSONRefError",function(e,t,n){this.originalError=n,(0,D.default)(this,t||{})}),L={},q=new C.default,z={key:"$ref",plugin:function(e,t,n,r){var u=n.slice(0,-1);if(!(0,F.isFreelyNamed)(u)){var l=r.getContext(n).baseDoc;if("string"!=typeof e)return new B("$ref: must be a string (JSON-Ref)",{$ref:e,baseDoc:l,fullPath:n});var c=a(e),p=c[0],h=c[1]||"",d=void 0;try{d=l||p?i(p,l):null}catch(t){return o(t,{pointer:h,$ref:e,basePath:d,fullPath:n})}var m=void 0,v=void 0;if(!g(h,d,u,r)){if(null==d?(v=f(h),void 0===(m=r.get(v))&&(m=new B("Could not resolve reference: "+e,{pointer:h,$ref:e,baseDoc:l,fullPath:n}))):(m=s(d,h),m=null!=m.__value?m.__value:m.catch(function(t){throw o(t,{pointer:h,$ref:e,baseDoc:l,fullPath:n})})),m instanceof Error)return[I.default.remove(n),m];var _=I.default.replace(u,m,{$$ref:e});return d&&d!==l?[_,I.default.context(u,{baseDoc:d})]:y(r.state,_)?void 0:_}}}},U=(0,D.default)(z,{docCache:L,absoluteify:i,clearCache:u,JSONRefError:B,wrapError:o,getDoc:l,split:a,extractFromDoc:s,fetchJSON:c,extract:p,jsonPointerToArray:f,unescapeJsonPointerToken:h});t.default=U;var W=function(e){return!e||"/"===e||"#"===e}},function(e,t){e.exports=n(330)},function(e,t){e.exports=n(568)},function(e,t){e.exports=n(96)},function(e,t){e.exports=n(18)},function(e,t){e.exports=n(97)},function(e,t){e.exports=n(582)},function(e,t){e.exports=n(696)},function(e,t){e.exports=n(695)},function(e,t){e.exports=n(203)},function(e,t){e.exports=n(709)},function(e,t){e.exports=n(745)},function(e,t){e.exports=n(794)},function(e,t){e.exports=n(211)},function(e,t){e.exports=n(942)},function(e,t){e.exports=n(223)},function(e,t){e.exports=n(20)},function(e,t){e.exports=n(38)},function(e,t){e.exports=n(421)},function(e,t){e.exports=n(422)},function(e,t){e.exports=n(951)},function(e,t){e.exports=n(999)},function(e,t){e.exports=n(1189)},function(e,t){e.exports=n(1190)},function(e,t,n){e.exports=n(20)}])},function(e,t,n){function r(e,t){this._id=e,this._clearFn=t}var i=Function.prototype.apply;t.setTimeout=function(){return new r(i.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new r(i.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(1180),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,n){"use strict";function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(e,t,n){if(e&&l.isObject(e)&&e instanceof r)return e;var i=new r;return i.parse(e,t,n),i}function o(e){return l.isString(e)&&(e=i(e)),e instanceof r?e.format():r.prototype.format.call(e)}function a(e,t){return i(e,!1,!0).resolve(t)}function s(e,t){return e?i(e,!1,!0).resolveObject(t):t}var u=n(998),l=n(1188);t.parse=i,t.resolve=a,t.resolveObject=s,t.format=o,t.Url=r;var c=/^([a-z0-9.+-]+:)/i,p=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,h=["<",">",'"',"`"," ","\r","\n","\t"],d=["{","}","|","\\","^","`"].concat(h),m=["'"].concat(d),v=["%","/","?",";","#"].concat(m),g=["/","?","#"],y=/^[+a-z0-9A-Z_-]{0,63}$/,_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},x={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},k=n(1004);r.prototype.parse=function(e,t,n){if(!l.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),i=-1!==r&&r<e.indexOf("#")?"?":"#",o=e.split(i),a=/\\/g;o[0]=o[0].replace(a,"/"),e=o.join(i);var s=e;if(s=s.trim(),!n&&1===e.split("#").length){var p=f.exec(s);if(p)return this.path=s,this.href=s,this.pathname=p[1],p[2]?(this.search=p[2],this.query=t?k.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var h=c.exec(s);if(h){h=h[0];var d=h.toLowerCase();this.protocol=d,s=s.substr(h.length)}if(n||h||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===s.substr(0,2);!E||h&&x[h]||(s=s.substr(2),this.slashes=!0)}if(!x[h]&&(E||h&&!w[h])){for(var S=-1,C=0;C<g.length;C++){var A=s.indexOf(g[C]);-1!==A&&(-1===S||A<S)&&(S=A)}var D,O;O=-1===S?s.lastIndexOf("@"):s.lastIndexOf("@",S),-1!==O&&(D=s.slice(0,O),s=s.slice(O+1),this.auth=decodeURIComponent(D)),S=-1;for(var C=0;C<v.length;C++){var A=s.indexOf(v[C]);-1!==A&&(-1===S||A<S)&&(S=A)}-1===S&&(S=s.length),this.host=s.slice(0,S),s=s.slice(S),this.parseHost(),this.hostname=this.hostname||"";var M="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!M)for(var T=this.hostname.split(/\./),C=0,P=T.length;C<P;C++){var I=T[C];if(I&&!I.match(y)){for(var R="",j=0,F=I.length;j<F;j++)I.charCodeAt(j)>127?R+="x":R+=I[j];if(!R.match(y)){var N=T.slice(0,C),B=T.slice(C+1),L=I.match(_);L&&(N.push(L[1]),B.unshift(L[2])),B.length&&(s="/"+B.join(".")+s),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),M||(this.hostname=u.toASCII(this.hostname));var q=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+q,this.href+=this.host,M&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!b[d])for(var C=0,P=m.length;C<P;C++){var U=m[C];if(-1!==s.indexOf(U)){var W=encodeURIComponent(U);W===U&&(W=escape(U)),s=s.split(U).join(W)}}var V=s.indexOf("#");-1!==V&&(this.hash=s.substr(V),s=s.slice(0,V));var H=s.indexOf("?");if(-1!==H?(this.search=s.substr(H),this.query=s.substr(H+1),t&&(this.query=k.parse(this.query)),s=s.slice(0,H)):t&&(this.search="",this.query={}),s&&(this.pathname=s),w[d]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var q=this.pathname||"",G=this.search||"";this.path=q+G}return this.href=this.format(),this},r.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&l.isObject(this.query)&&Object.keys(this.query).length&&(o=k.stringify(this.query));var a=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||w[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),a=a.replace("#","%23"),t+i+n+a+r},r.prototype.resolve=function(e){return this.resolveObject(i(e,!1,!0)).format()},r.prototype.resolveObject=function(e){if(l.isString(e)){var t=new r;t.parse(e,!1,!0),e=t}for(var n=new r,i=Object.keys(this),o=0;o<i.length;o++){var a=i[o];n[a]=this[a]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),u=0;u<s.length;u++){var c=s[u];"protocol"!==c&&(n[c]=e[c])}return w[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!w[e.protocol]){for(var p=Object.keys(e),f=0;f<p.length;f++){var h=p[f];n[h]=e[h]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||x[e.protocol])n.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),n.pathname=d.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var m=n.pathname||"",v=n.search||"";n.path=m+v}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var g=n.pathname&&"/"===n.pathname.charAt(0),y=e.host||e.pathname&&"/"===e.pathname.charAt(0),_=y||g||n.host&&e.pathname,b=_,k=n.pathname&&n.pathname.split("/")||[],d=e.pathname&&e.pathname.split("/")||[],E=n.protocol&&!w[n.protocol];if(E&&(n.hostname="",n.port=null,n.host&&(""===k[0]?k[0]=n.host:k.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),_=_&&(""===d[0]||""===k[0])),y)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,k=d;else if(d.length)k||(k=[]),k.pop(),k=k.concat(d),n.search=e.search,n.query=e.query;else if(!l.isNullOrUndefined(e.search)){if(E){n.hostname=n.host=k.shift();var S=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");S&&(n.auth=S.shift(),n.host=n.hostname=S.shift())}return n.search=e.search,n.query=e.query,l.isNull(n.pathname)&&l.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!k.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var C=k.slice(-1)[0],A=(n.host||e.host||k.length>1)&&("."===C||".."===C)||""===C,D=0,O=k.length;O>=0;O--)C=k[O],"."===C?k.splice(O,1):".."===C?(k.splice(O,1),D++):D&&(k.splice(O,1),D--);if(!_&&!b)for(;D--;D)k.unshift("..");!_||""===k[0]||k[0]&&"/"===k[0].charAt(0)||k.unshift(""),A&&"/"!==k.join("/").substr(-1)&&k.push("");var M=""===k[0]||k[0]&&"/"===k[0].charAt(0);if(E){n.hostname=n.host=M?"":k.length?k.shift():"";var S=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");S&&(n.auth=S.shift(),n.host=n.hostname=S.shift())}return _=_||n.host&&k.length,_&&!M&&k.unshift(""),k.length?n.pathname=k.join("/"):(n.pathname=null,n.path=null),l.isNull(n.pathname)&&l.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var e=this.host,t=p.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){(function(){var e,r,i,o=function(e,t){function n(){this.constructor=e}for(var r in t)a.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},a={}.hasOwnProperty;r=n(127),e=n(45).MarkedYAMLError,i=n(94),this.ComposerError=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return o(t,e),t}(e),this.Composer=function(){function e(){this.anchors={}}return e.prototype.check_node=function(){return this.check_event(r.StreamStartEvent)&&this.get_event(),!this.check_event(r.StreamEndEvent)},e.prototype.get_node=function(){if(!this.check_event(r.StreamEndEvent))return this.compose_document()},e.prototype.get_single_node=function(){var e,n;if(this.get_event(),e=null,this.check_event(r.StreamEndEvent)||(e=this.compose_document()),!this.check_event(r.StreamEndEvent))throw n=this.get_event(),new t.ComposerError("expected a single document in the stream",e.start_mark,"but found another document",n.start_mark);return this.get_event(),e},e.prototype.compose_document=function(){var e;return this.get_event(),e=this.compose_node(),this.get_event(),this.anchors={},e},e.prototype.compose_node=function(e,n){var i,o,a;if(this.check_event(r.AliasEvent)){if(o=this.get_event(),!((i=o.anchor)in this.anchors))throw new t.ComposerError(null,null,"found undefined alias "+i,o.start_mark);return this.anchors[i]}if(o=this.peek_event(),null!==(i=o.anchor)&&i in this.anchors)throw new t.ComposerError("found duplicate anchor "+i+"; first occurence",this.anchors[i].start_mark,"second occurrence",o.start_mark);return this.descend_resolver(e,n),this.check_event(r.ScalarEvent)?a=this.compose_scalar_node(i):this.check_event(r.SequenceStartEvent)?a=this.compose_sequence_node(i):this.check_event(r.MappingStartEvent)&&(a=this.compose_mapping_node(i)),this.ascend_resolver(),a},e.prototype.compose_scalar_node=function(e){var t,n,r;return t=this.get_event(),r=t.tag,null!==r&&"!"!==r||(r=this.resolve(i.ScalarNode,t.value,t.implicit)),n=new i.ScalarNode(r,t.value,t.start_mark,t.end_mark,t.style),null!==e&&(this.anchors[e]=n),n},e.prototype.compose_sequence_node=function(e){var t,n,o,a,s;for(a=this.get_event(),s=a.tag,null!==s&&"!"!==s||(s=this.resolve(i.SequenceNode,null,a.implicit)),o=new i.SequenceNode(s,[],a.start_mark,null,a.flow_style),null!==e&&(this.anchors[e]=o),n=0;!this.check_event(r.SequenceEndEvent);)o.value.push(this.compose_node(o,n)),n++;return t=this.get_event(),o.end_mark=t.end_mark,o},e.prototype.compose_mapping_node=function(e){var t,n,o,a,s,u;for(s=this.get_event(),u=s.tag,null!==u&&"!"!==u||(u=this.resolve(i.MappingNode,null,s.implicit)),a=new i.MappingNode(u,[],s.start_mark,null,s.flow_style),null!==e&&(this.anchors[e]=a);!this.check_event(r.MappingEndEvent);)n=this.compose_node(a),o=this.compose_node(a,n),a.value.push([n,o]);return t=this.get_event(),a.end_mark=t.end_mark,a},e}()}).call(this)},function(e,t,n){(function(e){(function(){var r,i,o,a=function(e,t){function n(){this.constructor=e}for(var r in t)s.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},s={}.hasOwnProperty,u=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1};r=n(45).MarkedYAMLError,i=n(94),o=n(61),this.ConstructorError=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return a(t,e),t}(r),this.BaseConstructor=function(){function e(){this.constructed_objects={},this.constructing_nodes=[],this.deferred_constructors=[]}return e.prototype.yaml_constructors={},e.prototype.yaml_multi_constructors={},e.add_constructor=function(e,t){return this.prototype.hasOwnProperty("yaml_constructors")||(this.prototype.yaml_constructors=o.extend({},this.prototype.yaml_constructors)),this.prototype.yaml_constructors[e]=t},e.add_multi_constructor=function(e,t){return this.prototype.hasOwnProperty("yaml_multi_constructors")||(this.prototype.yaml_multi_constructors=o.extend({},this.prototype.yaml_multi_constructors)),this.prototype.yaml_multi_constructors[e]=t},e.prototype.check_data=function(){return this.check_node()},e.prototype.get_data=function(){if(this.check_node())return this.construct_document(this.get_node())},e.prototype.get_single_data=function(){var e;return e=this.get_single_node(),null!=e?this.construct_document(e):null},e.prototype.construct_document=function(e){var t;for(t=this.construct_object(e);!o.is_empty(this.deferred_constructors);)this.deferred_constructors.pop()();return t},e.prototype.defer=function(e){return this.deferred_constructors.push(e)},e.prototype.construct_object=function(e){var n,r,o,a,s;if(e.unique_id in this.constructed_objects)return this.constructed_objects[e.unique_id];if(o=e.unique_id,u.call(this.constructing_nodes,o)>=0)throw new t.ConstructorError(null,null,"found unconstructable recursive node",e.start_mark);if(this.constructing_nodes.push(e.unique_id),n=null,s=null,e.tag in this.yaml_constructors)n=this.yaml_constructors[e.tag];else{for(a in this.yaml_multi_constructors)if(e.tag.indexOf(0===a)){s=e.tag.slice(a.length),n=this.yaml_multi_constructors[a];break}null==n&&(null in this.yaml_multi_constructors?(s=e.tag,n=this.yaml_multi_constructors[null]):null in this.yaml_constructors?n=this.yaml_constructors[null]:e instanceof i.ScalarNode?n=this.construct_scalar:e instanceof i.SequenceNode?n=this.construct_sequence:e instanceof i.MappingNode&&(n=this.construct_mapping))}return r=n.call(this,null!=s?s:e,e),this.constructed_objects[e.unique_id]=r,this.constructing_nodes.pop(),r},e.prototype.construct_scalar=function(e){if(!(e instanceof i.ScalarNode))throw new t.ConstructorError(null,null,"expected a scalar node but found "+e.id,e.start_mark);return e.value},e.prototype.construct_sequence=function(e){var n,r,o,a,s;if(!(e instanceof i.SequenceNode))throw new t.ConstructorError(null,null,"expected a sequence node but found "+e.id,e.start_mark);for(a=e.value,s=[],r=0,o=a.length;r<o;r++)n=a[r],s.push(this.construct_object(n));return s},e.prototype.construct_mapping=function(e){var n,r,o,a,s,u,l,c,p;if(!(e instanceof i.MappingNode))throw new ConstructorError(null,null,"expected a mapping node but found "+e.id,e.start_mark);for(s={},u=e.value,n=0,a=u.length;n<a;n++){if(l=u[n],o=l[0],p=l[1],"object"==typeof(r=this.construct_object(o)))throw new t.ConstructorError("while constructing a mapping",e.start_mark,"found unhashable key",o.start_mark);c=this.construct_object(p),s[r]=c}return s},e.prototype.construct_pairs=function(e){var n,r,o,a,s,u,l,c,p;if(!(e instanceof i.MappingNode))throw new t.ConstructorError(null,null,"expected a mapping node but found "+e.id,e.start_mark);for(s=[],u=e.value,n=0,a=u.length;n<a;n++)l=u[n],o=l[0],p=l[1],r=this.construct_object(o),c=this.construct_object(p),s.push([r,c]);return s},e}(),this.Constructor=function(n){function r(){return r.__super__.constructor.apply(this,arguments)}var o,s,l;return a(r,n),o={on:!0,off:!1,true:!0,false:!1,yes:!0,no:!1},l=/^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[\x20\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\.([0-9]*))?(?:[\x20\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?)?$/,s={year:1,month:2,day:3,hour:4,minute:5,second:6,fraction:7,tz:8,tz_sign:9,tz_hour:10,tz_minute:11},r.prototype.construct_scalar=function(e){var t,n,o,a,s,u;if(e instanceof i.MappingNode)for(a=e.value,t=0,o=a.length;t<o;t++)if(s=a[t],n=s[0],u=s[1],"tag:yaml.org,2002:value"===n.tag)return this.construct_scalar(u);return r.__super__.construct_scalar.call(this,e)},r.prototype.flatten_mapping=function(e){var n,r,o,a,s,u,l,c,p,f,h,d,m;for(l=[],r=0;r<e.value.length;)if(c=e.value[r],a=c[0],m=c[1],"tag:yaml.org,2002:merge"===a.tag)if(e.value.splice(r,1),m instanceof i.MappingNode)this.flatten_mapping(m),l=l.concat(m.value);else{if(!(m instanceof i.SequenceNode))throw new t.ConstructorError("while constructing a mapping",e.start_mark,"expected a mapping or list of mappings for merging but found "+m.id,m.start_mark);for(f=[],p=m.value,n=0,s=p.length;n<s;n++){if(!((h=p[n])instanceof i.MappingNode))throw new t.ConstructorError("while constructing a mapping",e.start_mark,"expected a mapping for merging, but found "+h.id,h.start_mark);this.flatten_mapping(h),f.push(h.value)}for(f.reverse(),o=0,u=f.length;o<u;o++)d=f[o],l=l.concat(d)}else"tag:yaml.org,2002:value"===a.tag?(a.tag="tag:yaml.org,2002:str",r++):r++;if(l.length)return e.value=l.concat(e.value)},r.prototype.construct_mapping=function(e){return e instanceof i.MappingNode&&this.flatten_mapping(e),r.__super__.construct_mapping.call(this,e)},r.prototype.construct_yaml_null=function(e){return this.construct_scalar(e),null},r.prototype.construct_yaml_bool=function(e){var t;return t=this.construct_scalar(e),o[t.toLowerCase()]},r.prototype.construct_yaml_int=function(e){var t,n,r,i,o,a,s,l,c;if(c=this.construct_scalar(e),c=c.replace(/_/g,""),l="-"===c[0]?-1:1,s=c[0],u.call("+-",s)>=0&&(c=c.slice(1)),"0"===c)return 0;if(0===c.indexOf("0b"))return l*parseInt(c.slice(2),2);if(0===c.indexOf("0x"))return l*parseInt(c.slice(2),16);if(0===c.indexOf("0o"))return l*parseInt(c.slice(2),8);if("0"===c[0])return l*parseInt(c,8);if(u.call(c,":")>=0){for(r=function(){var e,t,n,r;for(n=c.split(/:/g),r=[],e=0,t=n.length;e<t;e++)a=n[e],r.push(parseInt(a));return r}(),r.reverse(),t=1,c=0,i=0,o=r.length;i<o;i++)n=r[i],c+=n*t,t*=60;return l*c}return l*parseInt(c)},r.prototype.construct_yaml_float=function(e){var t,n,r,i,o,a,s,l,c;if(c=this.construct_scalar(e),c=c.replace(/_/g,"").toLowerCase(),l="-"===c[0]?-1:1,s=c[0],u.call("+-",s)>=0&&(c=c.slice(1)),".inf"===c)return Infinity*l;if(".nan"===c)return NaN;if(u.call(c,":")>=0){for(r=function(){var e,t,n,r;for(n=c.split(/:/g),r=[],e=0,t=n.length;e<t;e++)a=n[e],r.push(parseFloat(a));return r}(),r.reverse(),t=1,c=0,i=0,o=r.length;i<o;i++)n=r[i],c+=n*t,t*=60;return l*c}return l*parseFloat(c)},r.prototype.construct_yaml_binary=function(n){var r,i;i=this.construct_scalar(n);try{return"undefined"!=typeof window&&null!==window?atob(i):new e(i,"base64").toString("ascii")}catch(e){throw r=e,new t.ConstructorError(null,null,"failed to decode base64 data: "+r,n.start_mark)}},r.prototype.construct_yaml_timestamp=function(e){var t,n,r,i,o,a,u,c,p,f,h,d,m,v,g;this.construct_scalar(e),a=e.value.match(l),v={};for(o in s)i=s[o],v[o]=a[i];if(g=parseInt(v.year),p=parseInt(v.month)-1,t=parseInt(v.day),!v.hour)return new Date(Date.UTC(g,p,t));if(r=parseInt(v.hour),c=parseInt(v.minute),f=parseInt(v.second),u=0,v.fraction){for(n=v.fraction.slice(0,6);n.length<6;)n+="0";n=parseInt(n),u=Math.round(n/1e3)}return v.tz_sign&&(m="-"===v.tz_sign?1:-1,(h=parseInt(v.tz_hour))&&(r+=m*h),(d=parseInt(v.tz_minute))&&(c+=m*d)),new Date(Date.UTC(g,p,t,r,c,f,u))},r.prototype.construct_yaml_pair_list=function(e,n){var r;if(r=[],!(n instanceof i.SequenceNode))throw new t.ConstructorError("while constructing "+e,n.start_mark,"expected a sequence but found "+n.id,n.start_mark);return this.defer(function(o){return function(){var a,s,u,l,c,p,f,h,d,m;for(c=n.value,f=[],a=0,l=c.length;a<l;a++){if(!((h=c[a])instanceof i.MappingNode))throw new t.ConstructorError("while constructing "+e,n.start_mark,"expected a mapping of length 1 but found "+h.id,h.start_mark);if(1!==h.value.length)throw new t.ConstructorError("while constructing "+e,n.start_mark,"expected a mapping of length 1 but found "+h.id,h.start_mark);p=h.value[0],u=p[0],m=p[1],s=o.construct_object(u),d=o.construct_object(m),f.push(r.push([s,d]))}return f}}(this)),r},r.prototype.construct_yaml_omap=function(e){return this.construct_yaml_pair_list("an ordered map",e)},r.prototype.construct_yaml_pairs=function(e){return this.construct_yaml_pair_list("pairs",e)},r.prototype.construct_yaml_set=function(e){var t;return t=[],this.defer(function(n){return function(){var r,i;i=[];for(r in n.construct_mapping(e))i.push(t.push(r));return i}}(this)),t},r.prototype.construct_yaml_str=function(e){return this.construct_scalar(e)},r.prototype.construct_yaml_seq=function(e){var t;return t=[],this.defer(function(n){return function(){var r,i,o,a,s;for(a=n.construct_sequence(e),s=[],r=0,o=a.length;r<o;r++)i=a[r],s.push(t.push(i));return s}}(this)),t},r.prototype.construct_yaml_map=function(e){var t;return t={},this.defer(function(n){return function(){var r,i,o,a;i=n.construct_mapping(e),o=[];for(r in i)a=i[r],o.push(t[r]=a);return o}}(this)),t},r.prototype.construct_yaml_object=function(e,t){var n;return n=new t,this.defer(function(t){return function(){var r,i,o,a;i=t.construct_mapping(e,!0),o=[];for(r in i)a=i[r],o.push(n[r]=a);return o}}(this)),n},r.prototype.construct_undefined=function(e){throw new t.ConstructorError(null,null,"could not determine a constructor for the tag "+e.tag,e.start_mark)},r}(this.BaseConstructor),this.Constructor.add_constructor("tag:yaml.org,2002:null",this.Constructor.prototype.construct_yaml_null),this.Constructor.add_constructor("tag:yaml.org,2002:bool",this.Constructor.prototype.construct_yaml_bool),this.Constructor.add_constructor("tag:yaml.org,2002:int",this.Constructor.prototype.construct_yaml_int),this.Constructor.add_constructor("tag:yaml.org,2002:float",this.Constructor.prototype.construct_yaml_float),this.Constructor.add_constructor("tag:yaml.org,2002:binary",this.Constructor.prototype.construct_yaml_binary),this.Constructor.add_constructor("tag:yaml.org,2002:timestamp",this.Constructor.prototype.construct_yaml_timestamp),this.Constructor.add_constructor("tag:yaml.org,2002:omap",this.Constructor.prototype.construct_yaml_omap),this.Constructor.add_constructor("tag:yaml.org,2002:pairs",this.Constructor.prototype.construct_yaml_pairs),this.Constructor.add_constructor("tag:yaml.org,2002:set",this.Constructor.prototype.construct_yaml_set),this.Constructor.add_constructor("tag:yaml.org,2002:str",this.Constructor.prototype.construct_yaml_str),this.Constructor.add_constructor("tag:yaml.org,2002:seq",this.Constructor.prototype.construct_yaml_seq),this.Constructor.add_constructor("tag:yaml.org,2002:map",this.Constructor.prototype.construct_yaml_map),this.Constructor.add_constructor(null,this.Constructor.prototype.construct_undefined)}).call(this)}).call(t,n(40).Buffer)},function(e,t,n){(function(){var e,r,i,o=function(e,t){function n(){this.constructor=e}for(var r in t)a.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},a={}.hasOwnProperty,s=[].slice;r=n(127),e=n(45).MarkedYAMLError,i=n(267),this.ParserError=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return o(t,e),t}(e),this.Parser=function(){function e(){this.current_event=null,this.yaml_version=null,this.tag_handles={},this.states=[],this.marks=[],this.state="parse_stream_start"}var n;return n={"!":"!","!!":"tag:yaml.org,2002:"},e.prototype.dispose=function(){return this.states=[],this.state=null},e.prototype.check_event=function(){var e,t,n,r;if(t=1<=arguments.length?s.call(arguments,0):[],null===this.current_event&&null!=this.state&&(this.current_event=this[this.state]()),null!==this.current_event){if(0===t.length)return!0;for(n=0,r=t.length;n<r;n++)if(e=t[n],this.current_event instanceof e)return!0}return!1},e.prototype.peek_event=function(){return null===this.current_event&&null!=this.state&&(this.current_event=this[this.state]()),this.current_event},e.prototype.get_event=function(){var e;return null===this.current_event&&null!=this.state&&(this.current_event=this[this.state]()),e=this.current_event,this.current_event=null,e},e.prototype.parse_stream_start=function(){var e,t;return t=this.get_token(),e=new r.StreamStartEvent(t.start_mark,t.end_mark),this.state="parse_implicit_document_start",e},e.prototype.parse_implicit_document_start=function(){var e,t,o,a;return this.check_token(i.DirectiveToken,i.DocumentStartToken,i.StreamEndToken)?this.parse_document_start():(this.tag_handles=n,a=this.peek_token(),o=e=a.start_mark,t=new r.DocumentStartEvent(o,e,!1),this.states.push("parse_document_end"),this.state="parse_block_node",t)},e.prototype.parse_document_start=function(){for(var e,n,o,a,s,u,l;this.check_token(i.DocumentEndToken);)this.get_token();if(this.check_token(i.StreamEndToken)){if(u=this.get_token(),n=new r.StreamEndEvent(u.start_mark,u.end_mark),0!==this.states.length)throw new Error("assertion error, states should be empty");if(0!==this.marks.length)throw new Error("assertion error, marks should be empty");this.state=null}else{if(a=this.peek_token().start_mark,o=this.process_directives(),l=o[0],s=o[1],!this.check_token(i.DocumentStartToken))throw new t.ParserError("expected '<document start>', but found "+this.peek_token().id,this.peek_token().start_mark);u=this.get_token(),e=u.end_mark,n=new r.DocumentStartEvent(a,e,!0,l,s),this.states.push("parse_document_end"),this.state="parse_document_content"}return n},e.prototype.parse_document_end=function(){var e,t,n,o,a;return a=this.peek_token(),o=e=a.start_mark,n=!1,this.check_token(i.DocumentEndToken)&&(a=this.get_token(),e=a.end_mark,n=!0),t=new r.DocumentEndEvent(o,e,n),this.state="parse_document_start",t},e.prototype.parse_document_content=function(){var e;return this.check_token(i.DirectiveToken,i.DocumentStartToken,i.DocumentEndToken,i.StreamEndToken)?(e=this.process_empty_scalar(this.peek_token().start_mark),this.state=this.states.pop(),e):this.parse_block_node()},e.prototype.process_directives=function(){var e,r,o,s,u,l,c,p,f;for(this.yaml_version=null,this.tag_handles={};this.check_token(i.DirectiveToken);)if(p=this.get_token(),"YAML"===p.name){if(null!==this.yaml_version)throw new t.ParserError(null,null,"found duplicate YAML directive",p.start_mark);if(s=p.value,r=s[0],s[1],1!==r)throw new t.ParserError(null,null,"found incompatible YAML document (version 1.* is required)",p.start_mark);this.yaml_version=p.value}else if("TAG"===p.name){if(u=p.value,e=u[0],o=u[1],e in this.tag_handles)throw new t.ParserError(null,null,"duplicate tag handle "+e,p.start_mark);this.tag_handles[e]=o}c=null,l=this.tag_handles;for(e in l)a.call(l,e)&&(o=l[e],null==c&&(c={}),c[e]=o);f=[this.yaml_version,c];for(e in n)a.call(n,e)&&((o=n[e])in this.tag_handles||(this.tag_handles[e]=o));return f},e.prototype.parse_block_node=function(){return this.parse_node(!0)},e.prototype.parse_flow_node=function(){return this.parse_node()},e.prototype.parse_block_node_or_indentless_sequence=function(){return this.parse_node(!0,!0)},e.prototype.parse_node=function(e,n){var o,a,s,u,l,c,p,f,h,d,m;if(null==e&&(e=!1),null==n&&(n=!1),this.check_token(i.AliasToken))m=this.get_token(),s=new r.AliasEvent(m.value,m.start_mark,m.end_mark),this.state=this.states.pop();else{if(o=null,h=null,p=a=d=null,this.check_token(i.AnchorToken)?(m=this.get_token(),p=m.start_mark,a=m.end_mark,o=m.value,this.check_token(i.TagToken)&&(m=this.get_token(),d=m.start_mark,a=m.end_mark,h=m.value)):this.check_token(i.TagToken)&&(m=this.get_token(),p=d=m.start_mark,a=m.end_mark,h=m.value,this.check_token(i.AnchorToken)&&(m=this.get_token(),a=m.end_mark,o=m.value)),null!==h)if(u=h[0],f=h[1],null!==u){if(!(u in this.tag_handles))throw new t.ParserError("while parsing a node",p,"found undefined tag handle "+u,d);h=this.tag_handles[u]+f}else h=f;if(null===p&&(p=a=this.peek_token().start_mark),s=null,l=null===h||"!"===h,n&&this.check_token(i.BlockEntryToken))a=this.peek_token().end_mark,s=new r.SequenceStartEvent(o,h,l,p,a),this.state="parse_indentless_sequence_entry";else if(this.check_token(i.ScalarToken))m=this.get_token(),a=m.end_mark,l=m.plain&&null===h||"!"===h?[!0,!1]:null===h?[!1,!0]:[!1,!1],s=new r.ScalarEvent(o,h,l,m.value,p,a,m.style),this.state=this.states.pop();else if(this.check_token(i.FlowSequenceStartToken))a=this.peek_token().end_mark,s=new r.SequenceStartEvent(o,h,l,p,a,!0),this.state="parse_flow_sequence_first_entry";else if(this.check_token(i.FlowMappingStartToken))a=this.peek_token().end_mark,s=new r.MappingStartEvent(o,h,l,p,a,!0),this.state="parse_flow_mapping_first_key";else if(e&&this.check_token(i.BlockSequenceStartToken))a=this.peek_token().end_mark,s=new r.SequenceStartEvent(o,h,l,p,a,!1),this.state="parse_block_sequence_first_entry";else if(e&&this.check_token(i.BlockMappingStartToken))a=this.peek_token().end_mark,s=new r.MappingStartEvent(o,h,l,p,a,!1),this.state="parse_block_mapping_first_key";else{if(null===o&&null===h)throw c=e?"block":"flow",m=this.peek_token(),new t.ParserError("while parsing a "+c+" node",p,"expected the node content, but found "+m.id,m.start_mark);s=new r.ScalarEvent(o,h,[l,!1],"",p,a),this.state=this.states.pop()}}return s},e.prototype.parse_block_sequence_first_entry=function(){var e;return e=this.get_token(),this.marks.push(e.start_mark),this.parse_block_sequence_entry()},e.prototype.parse_block_sequence_entry=function(){var e,n;if(this.check_token(i.BlockEntryToken))return n=this.get_token(),this.check_token(i.BlockEntryToken,i.BlockEndToken)?(this.state="parse_block_sequence_entry",this.process_empty_scalar(n.end_mark)):(this.states.push("parse_block_sequence_entry"),this.parse_block_node());if(!this.check_token(i.BlockEndToken))throw n=this.peek_token(),new t.ParserError("while parsing a block collection",this.marks.slice(-1)[0],"expected <block end>, but found "+n.id,n.start_mark);return n=this.get_token(),e=new r.SequenceEndEvent(n.start_mark,n.end_mark),this.state=this.states.pop(),this.marks.pop(),e},e.prototype.parse_indentless_sequence_entry=function(){var e,t;return this.check_token(i.BlockEntryToken)?(t=this.get_token(),this.check_token(i.BlockEntryToken,i.KeyToken,i.ValueToken,i.BlockEndToken)?(this.state="parse_indentless_sequence_entry",this.process_empty_scalar(t.end_mark)):(this.states.push("parse_indentless_sequence_entry"),this.parse_block_node())):(t=this.peek_token(),e=new r.SequenceEndEvent(t.start_mark,t.start_mark),this.state=this.states.pop(),e)},e.prototype.parse_block_mapping_first_key=function(){var e;return e=this.get_token(),this.marks.push(e.start_mark),this.parse_block_mapping_key()},e.prototype.parse_block_mapping_key=function(){var e,n;if(this.check_token(i.KeyToken))return n=this.get_token(),this.check_token(i.KeyToken,i.ValueToken,i.BlockEndToken)?(this.state="parse_block_mapping_value",this.process_empty_scalar(n.end_mark)):(this.states.push("parse_block_mapping_value"),this.parse_block_node_or_indentless_sequence());if(!this.check_token(i.BlockEndToken))throw n=this.peek_token(),new t.ParserError("while parsing a block mapping",this.marks.slice(-1)[0],"expected <block end>, but found "+n.id,n.start_mark);return n=this.get_token(),e=new r.MappingEndEvent(n.start_mark,n.end_mark),this.state=this.states.pop(),this.marks.pop(),e},e.prototype.parse_block_mapping_value=function(){var e;return this.check_token(i.ValueToken)?(e=this.get_token(),this.check_token(i.KeyToken,i.ValueToken,i.BlockEndToken)?(this.state="parse_block_mapping_key",this.process_empty_scalar(e.end_mark)):(this.states.push("parse_block_mapping_key"),this.parse_block_node_or_indentless_sequence())):(this.state="parse_block_mapping_key",e=this.peek_token(),this.process_empty_scalar(e.start_mark))},e.prototype.parse_flow_sequence_first_entry=function(){var e;return e=this.get_token(),this.marks.push(e.start_mark),this.parse_flow_sequence_entry(!0)},e.prototype.parse_flow_sequence_entry=function(e){var n,o;if(null==e&&(e=!1),!this.check_token(i.FlowSequenceEndToken)){if(!e){if(!this.check_token(i.FlowEntryToken))throw o=this.peek_token(),new t.ParserError("while parsing a flow sequence",this.marks.slice(-1)[0],"expected ',' or ']', but got "+o.id,o.start_mark);this.get_token()}if(this.check_token(i.KeyToken))return o=this.peek_token(),n=new r.MappingStartEvent(null,null,!0,o.start_mark,o.end_mark,!0),this.state="parse_flow_sequence_entry_mapping_key",n;if(!this.check_token(i.FlowSequenceEndToken))return this.states.push("parse_flow_sequence_entry"),this.parse_flow_node()}return o=this.get_token(),n=new r.SequenceEndEvent(o.start_mark,o.end_mark),this.state=this.states.pop(),this.marks.pop(),n},e.prototype.parse_flow_sequence_entry_mapping_key=function(){var e;return e=this.get_token(),this.check_token(i.ValueToken,i.FlowEntryToken,i.FlowSequenceEndToken)?(this.state="parse_flow_sequence_entry_mapping_value",this.process_empty_scalar(e.end_mark)):(this.states.push("parse_flow_sequence_entry_mapping_value"),this.parse_flow_node())},e.prototype.parse_flow_sequence_entry_mapping_value=function(){var e;return this.check_token(i.ValueToken)?(e=this.get_token(),this.check_token(i.FlowEntryToken,i.FlowSequenceEndToken)?(this.state="parse_flow_sequence_entry_mapping_end",this.process_empty_scalar(e.end_mark)):(this.states.push("parse_flow_sequence_entry_mapping_end"),this.parse_flow_node())):(this.state="parse_flow_sequence_entry_mapping_end",e=this.peek_token(),this.process_empty_scalar(e.start_mark))},e.prototype.parse_flow_sequence_entry_mapping_end=function(){var e;return this.state="parse_flow_sequence_entry",e=this.peek_token(),new r.MappingEndEvent(e.start_mark,e.start_mark)},e.prototype.parse_flow_mapping_first_key=function(){var e;return e=this.get_token(),this.marks.push(e.start_mark),this.parse_flow_mapping_key(!0)},e.prototype.parse_flow_mapping_key=function(e){var n,o;if(null==e&&(e=!1),!this.check_token(i.FlowMappingEndToken)){if(!e){if(!this.check_token(i.FlowEntryToken))throw o=this.peek_token(),new t.ParserError("while parsing a flow mapping",this.marks.slice(-1)[0],"expected ',' or '}', but got "+o.id,o.start_mark);this.get_token()}if(this.check_token(i.KeyToken))return o=this.get_token(),this.check_token(i.ValueToken,i.FlowEntryToken,i.FlowMappingEndToken)?(this.state="parse_flow_mapping_value",this.process_empty_scalar(o.end_mark)):(this.states.push("parse_flow_mapping_value"),this.parse_flow_node());if(!this.check_token(i.FlowMappingEndToken))return this.states.push("parse_flow_mapping_empty_value"),this.parse_flow_node()}return o=this.get_token(),n=new r.MappingEndEvent(o.start_mark,o.end_mark),this.state=this.states.pop(),this.marks.pop(),n},e.prototype.parse_flow_mapping_value=function(){var e;return this.check_token(i.ValueToken)?(e=this.get_token(),this.check_token(i.FlowEntryToken,i.FlowMappingEndToken)?(this.state="parse_flow_mapping_key",this.process_empty_scalar(e.end_mark)):(this.states.push("parse_flow_mapping_key"),this.parse_flow_node())):(this.state="parse_flow_mapping_key",e=this.peek_token(),this.process_empty_scalar(e.start_mark))},e.prototype.parse_flow_mapping_empty_value=function(){return this.state="parse_flow_mapping_key",this.process_empty_scalar(this.peek_token().start_mark)},e.prototype.process_empty_scalar=function(e){return new r.ScalarEvent(null,null,[!0,!1],"",e,e)},e}()}).call(this)},function(e,t,n){(function(){var e,r,i,o=function(e,t){function n(){this.constructor=e}for(var r in t)a.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},a={}.hasOwnProperty,s=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1};i=n(45),e=i.Mark,r=i.YAMLError,this.ReaderError=function(e){function t(e,n,r){this.position=e,this.character=n,this.reason=r,t.__super__.constructor.call(this)}return o(t,e),t.prototype.toString=function(){return"unacceptable character #"+this.character.charCodeAt(0).toString(16)+": "+this.reason+"\n position "+this.position},t}(r),this.Reader=function(){function n(e){this.string=e,this.line=0,this.column=0,this.index=0,this.check_printable(),this.string+="\0"}var r;return r=/[^\x09\x0A\x0D\x20-\x7E\x85\xA0-\uFFFD]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,n.prototype.peek=function(e){return null==e&&(e=0),this.string[this.index+e]},n.prototype.prefix=function(e){return null==e&&(e=1),this.string.slice(this.index,this.index+e)},n.prototype.forward=function(e){var t,n;for(null==e&&(e=1),n=[];e;)t=this.string[this.index],this.index++,s.call("\n…₂\u2029",t)>=0||"\r"===t&&"\n"!==this.string[this.index]?(this.line++,this.column=0):this.column++,n.push(e--);return n},n.prototype.get_mark=function(){return new e(this.line,this.column,this.string,this.index)},n.prototype.check_printable=function(){var e,n,i;if(n=r.exec(this.string))throw e=n[0],i=this.string.length-this.index+n.index,new t.ReaderError(i,e,"special characters are not allowed")},n}()}).call(this)},function(e,t,n){(function(){var e,r,i,o,a=function(e,t){function n(){this.constructor=e}for(var r in t)s.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},s={}.hasOwnProperty,u=[].slice,l=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1};e=n(45).MarkedYAMLError,i=n(267),o=n(61),this.ScannerError=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return a(t,e),t}(e),r=function(){function e(e,t,n,r,i,o){this.token_number=e,this.required=t,this.index=n,this.line=r,this.column=i,this.mark=o}return e}(),this.Scanner=function(){function e(){this.done=!1,this.flow_level=0,this.tokens=[],this.fetch_stream_start(),this.tokens_taken=0,this.indent=-1,this.indents=[],this.allow_simple_key=!0,this.possible_simple_keys={}}var n,a,c,p,f;return n="\r\n…\u2028\u2029",c="\t ",a="0123456789",f={0:"\0",a:"",b:"\b",t:"\t","\t":"\t",n:"\n",v:"\v",f:"\f",r:"\r",e:""," ":" ",'"':'"',"\\":"\\",N:"…",_:" ",L:"\u2028",P:"\u2029"},p={x:2,u:4,U:8},e.prototype.check_token=function(){var e,t,n,r;for(t=1<=arguments.length?u.call(arguments,0):[];this.need_more_tokens();)this.fetch_more_tokens();if(0!==this.tokens.length){if(0===t.length)return!0;for(n=0,r=t.length;n<r;n++)if(e=t[n],this.tokens[0]instanceof e)return!0}return!1},e.prototype.peek_token=function(){for(;this.need_more_tokens();)this.fetch_more_tokens();if(0!==this.tokens.length)return this.tokens[0]},e.prototype.get_token=function(){for(;this.need_more_tokens();)this.fetch_more_tokens();if(0!==this.tokens.length)return this.tokens_taken++,this.tokens.shift()},e.prototype.need_more_tokens=function(){return!this.done&&(0===this.tokens.length||(this.stale_possible_simple_keys(),this.next_possible_simple_key()===this.tokens_taken))},e.prototype.fetch_more_tokens=function(){var e;if(this.scan_to_next_token(),this.stale_possible_simple_keys(),this.unwind_indent(this.column),"\0"===(e=this.peek()))return this.fetch_stream_end();if("%"===e&&this.check_directive())return this.fetch_directive();if("-"===e&&this.check_document_start())return this.fetch_document_start();if("."===e&&this.check_document_end())return this.fetch_document_end();if("["===e)return this.fetch_flow_sequence_start();if("{"===e)return this.fetch_flow_mapping_start();if("]"===e)return this.fetch_flow_sequence_end();if("}"===e)return this.fetch_flow_mapping_end();if(","===e)return this.fetch_flow_entry();if("-"===e&&this.check_block_entry())return this.fetch_block_entry();if("?"===e&&this.check_key())return this.fetch_key();if(":"===e&&this.check_value())return this.fetch_value();if("*"===e)return this.fetch_alias();if("&"===e)return this.fetch_anchor();if("!"===e)return this.fetch_tag();if("|"===e&&0===this.flow_level)return this.fetch_literal();if(">"===e&&0===this.flow_level)return this.fetch_folded();if("'"===e)return this.fetch_single();if('"'===e)return this.fetch_double();if(this.check_plain())return this.fetch_plain();throw new t.ScannerError("while scanning for the next token",null,"found character "+e+" that cannot start any token",this.get_mark())},e.prototype.next_possible_simple_key=function(){var e,t,n,r;n=null,r=this.possible_simple_keys;for(t in r)s.call(r,t)&&(e=r[t],(null===n||e.token_number<n)&&(n=e.token_number));return n},e.prototype.stale_possible_simple_keys=function(){var e,n,r,i;r=this.possible_simple_keys,i=[];for(n in r)if(s.call(r,n)&&(e=r[n],!(e.line===this.line&&this.index-e.index<=1024))){if(e.required)throw new t.ScannerError("while scanning a simple key",e.mark,"could not find expected ':'",this.get_mark());i.push(delete this.possible_simple_keys[n])}return i},e.prototype.save_possible_simple_key=function(){var e,t;if((e=0===this.flow_level&&this.indent===this.column)&&!this.allow_simple_key)throw new Error("logic failure");if(this.allow_simple_key)return this.remove_possible_simple_key(),t=this.tokens_taken+this.tokens.length,this.possible_simple_keys[this.flow_level]=new r(t,e,this.index,this.line,this.column,this.get_mark())},e.prototype.remove_possible_simple_key=function(){var e;if(e=this.possible_simple_keys[this.flow_level]){if(e.required)throw new t.ScannerError("while scanning a simple key",e.mark,"could not find expected ':'",this.get_mark());return delete this.possible_simple_keys[this.flow_level]}},e.prototype.unwind_indent=function(e){var t,n;if(0===this.flow_level){for(n=[];this.indent>e;)t=this.get_mark(),this.indent=this.indents.pop(),n.push(this.tokens.push(new i.BlockEndToken(t,t)));return n}},e.prototype.add_indent=function(e){return e>this.indent&&(this.indents.push(this.indent),this.indent=e,!0)},e.prototype.fetch_stream_start=function(){var e;return e=this.get_mark(),this.tokens.push(new i.StreamStartToken(e,e,this.encoding))},e.prototype.fetch_stream_end=function(){var e;return this.unwind_indent(-1),this.remove_possible_simple_key(),this.allow_possible_simple_key=!1,this.possible_simple_keys={},e=this.get_mark(),this.tokens.push(new i.StreamEndToken(e,e)),this.done=!0},e.prototype.fetch_directive=function(){return this.unwind_indent(-1),this.remove_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_directive())},e.prototype.fetch_document_start=function(){return this.fetch_document_indicator(i.DocumentStartToken)},e.prototype.fetch_document_end=function(){return this.fetch_document_indicator(i.DocumentEndToken)},e.prototype.fetch_document_indicator=function(e){var t;return this.unwind_indent(-1),this.remove_possible_simple_key(),this.allow_simple_key=!1,t=this.get_mark(),this.forward(3),this.tokens.push(new e(t,this.get_mark()))},e.prototype.fetch_flow_sequence_start=function(){return this.fetch_flow_collection_start(i.FlowSequenceStartToken)},e.prototype.fetch_flow_mapping_start=function(){return this.fetch_flow_collection_start(i.FlowMappingStartToken)},e.prototype.fetch_flow_collection_start=function(e){var t;return this.save_possible_simple_key(),this.flow_level++,this.allow_simple_key=!0,t=this.get_mark(),this.forward(),this.tokens.push(new e(t,this.get_mark()))},e.prototype.fetch_flow_sequence_end=function(){return this.fetch_flow_collection_end(i.FlowSequenceEndToken)},e.prototype.fetch_flow_mapping_end=function(){return this.fetch_flow_collection_end(i.FlowMappingEndToken)},e.prototype.fetch_flow_collection_end=function(e){var t;return this.remove_possible_simple_key(),this.flow_level--,this.allow_simple_key=!1,t=this.get_mark(),this.forward(),this.tokens.push(new e(t,this.get_mark()))},e.prototype.fetch_flow_entry=function(){var e;return this.allow_simple_key=!0,this.remove_possible_simple_key(),e=this.get_mark(),this.forward(),this.tokens.push(new i.FlowEntryToken(e,this.get_mark()))},e.prototype.fetch_block_entry=function(){var e,n;if(0===this.flow_level){if(!this.allow_simple_key)throw new t.ScannerError(null,null,"sequence entries are not allowed here",this.get_mark());this.add_indent(this.column)&&(e=this.get_mark(),this.tokens.push(new i.BlockSequenceStartToken(e,e)))}return this.allow_simple_key=!0,this.remove_possible_simple_key(),n=this.get_mark(),this.forward(),this.tokens.push(new i.BlockEntryToken(n,this.get_mark()))},e.prototype.fetch_key=function(){var e,n;if(0===this.flow_level){if(!this.allow_simple_key)throw new t.ScannerError(null,null,"mapping keys are not allowed here",this.get_mark());this.add_indent(this.column)&&(e=this.get_mark(),this.tokens.push(new i.BlockMappingStartToken(e,e)))}return this.allow_simple_key=!this.flow_level,this.remove_possible_simple_key(),n=this.get_mark(),this.forward(),this.tokens.push(new i.KeyToken(n,this.get_mark()))},e.prototype.fetch_value=function(){var e,n,r;if(e=this.possible_simple_keys[this.flow_level])delete this.possible_simple_keys[this.flow_level],this.tokens.splice(e.token_number-this.tokens_taken,0,new i.KeyToken(e.mark,e.mark)),0===this.flow_level&&this.add_indent(e.column)&&this.tokens.splice(e.token_number-this.tokens_taken,0,new i.BlockMappingStartToken(e.mark,e.mark)),this.allow_simple_key=!1;else{if(0===this.flow_level){if(!this.allow_simple_key)throw new t.ScannerError(null,null,"mapping values are not allowed here",this.get_mark());this.add_indent(this.column)&&(n=this.get_mark(),this.tokens.push(new i.BlockMappingStartToken(n,n)))}this.allow_simple_key=!this.flow_level,this.remove_possible_simple_key()}return r=this.get_mark(),this.forward(),this.tokens.push(new i.ValueToken(r,this.get_mark()))},e.prototype.fetch_alias=function(){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_anchor(i.AliasToken))},e.prototype.fetch_anchor=function(){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_anchor(i.AnchorToken))},e.prototype.fetch_tag=function(){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_tag())},e.prototype.fetch_literal=function(){return this.fetch_block_scalar("|")},e.prototype.fetch_folded=function(){return this.fetch_block_scalar(">")},e.prototype.fetch_block_scalar=function(e){return this.allow_simple_key=!0,this.remove_possible_simple_key(),this.tokens.push(this.scan_block_scalar(e))},e.prototype.fetch_single=function(){return this.fetch_flow_scalar("'")},e.prototype.fetch_double=function(){return this.fetch_flow_scalar('"')},e.prototype.fetch_flow_scalar=function(e){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_flow_scalar(e))},e.prototype.fetch_plain=function(){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_plain())},e.prototype.check_directive=function(){return 0===this.column},e.prototype.check_document_start=function(){var e;return 0===this.column&&"---"===this.prefix(3)&&(e=this.peek(3),l.call(n+c+"\0",e)>=0)},e.prototype.check_document_end=function(){var e;return 0===this.column&&"..."===this.prefix(3)&&(e=this.peek(3),l.call(n+c+"\0",e)>=0)},e.prototype.check_block_entry=function(){var e;return e=this.peek(1),l.call(n+c+"\0",e)>=0},e.prototype.check_key=function(){var e;return 0!==this.flow_level||(e=this.peek(1),l.call(n+c+"\0",e)>=0)},e.prototype.check_value=function(){var e;return 0!==this.flow_level||(e=this.peek(1),l.call(n+c+"\0",e)>=0)},e.prototype.check_plain=function(){var e,t;return e=this.peek(),l.call(n+c+"\0-?:,[]{}#&*!|>'\"%@`",e)<0||(t=this.peek(1),l.call(n+c+"\0",t)<0&&("-"===e||0===this.flow_level&&l.call("?:",e)>=0))},e.prototype.scan_to_next_token=function(){var e,t,r;for(0===this.index&&"\ufeff"===this.peek()&&this.forward(),e=!1,r=[];!e;){for(;" "===this.peek();)this.forward();if("#"===this.peek())for(;t=this.peek(),l.call(n+"\0",t)<0;)this.forward();this.scan_line_break()?0===this.flow_level?r.push(this.allow_simple_key=!0):r.push(void 0):r.push(e=!0)}return r},e.prototype.scan_directive=function(){var e,t,r,o,a;if(o=this.get_mark(),this.forward(),t=this.scan_directive_name(o),a=null,"YAML"===t)a=this.scan_yaml_directive_value(o),e=this.get_mark();else if("TAG"===t)a=this.scan_tag_directive_value(o),e=this.get_mark();else for(e=this.get_mark();r=this.peek(),l.call(n+"\0",r)<0;)this.forward();return this.scan_directive_ignored_line(o),new i.DirectiveToken(t,a,o,e)},e.prototype.scan_directive_name=function(e){var r,i,o;for(i=0,r=this.peek(i);"0"<=r&&r<="9"||"A"<=r&&r<="Z"||"a"<=r&&r<="z"||l.call("-_",r)>=0;)i++,r=this.peek(i);if(0===i)throw new t.ScannerError("while scanning a directive",e,"expected alphanumeric or numeric character but found "+r,this.get_mark());if(o=this.prefix(i),this.forward(i),r=this.peek(),l.call(n+"\0 ",r)<0)throw new t.ScannerError("while scanning a directive",e,"expected alphanumeric or numeric character but found "+r,this.get_mark());return o},e.prototype.scan_yaml_directive_value=function(e){for(var r,i,o;" "===this.peek();)this.forward();if(r=this.scan_yaml_directive_number(e),"."!==this.peek())throw new t.ScannerError("while scanning a directive",e,"expected a digit or '.' but found "+this.peek(),this.get_mark());if(this.forward(),i=this.scan_yaml_directive_number(e),o=this.peek(),l.call(n+"\0 ",o)<0)throw new t.ScannerError("while scanning a directive",e,"expected a digit or ' ' but found "+this.peek(),this.get_mark());return[r,i]},e.prototype.scan_yaml_directive_number=function(e){var n,r,i,o;if(!("0"<=(n=this.peek())&&n<="9"))throw new t.ScannerError("while scanning a directive",e,"expected a digit but found "+n,this.get_mark());for(r=0;"0"<=(i=this.peek(r))&&i<="9";)r++;return o=parseInt(this.prefix(r)),this.forward(r),o},e.prototype.scan_tag_directive_value=function(e){for(var t,n;" "===this.peek();)this.forward();for(t=this.scan_tag_directive_handle(e);" "===this.peek();)this.forward();return n=this.scan_tag_directive_prefix(e),[t,n]},e.prototype.scan_tag_directive_handle=function(e){var n,r;if(r=this.scan_tag_handle("directive",e)," "!==(n=this.peek()))throw new t.ScannerError("while scanning a directive",e,"expected ' ' but found "+n,this.get_mark());return r},e.prototype.scan_tag_directive_prefix=function(e){var r,i;if(i=this.scan_tag_uri("directive",e),r=this.peek(),l.call(n+"\0 ",r)<0)throw new t.ScannerError("while scanning a directive",e,"expected ' ' but found "+r,this.get_mark());return i},e.prototype.scan_directive_ignored_line=function(e){for(var r,i;" "===this.peek();)this.forward();if("#"===this.peek())for(;i=this.peek(),l.call(n+"\0",i)<0;)this.forward();if(r=this.peek(),l.call(n+"\0",r)<0)throw new t.ScannerError("while scanning a directive",e,"expected a comment or a line break but found "+r,this.get_mark());return this.scan_line_break()},e.prototype.scan_anchor=function(e){var r,i,o,a,s,u;for(s=this.get_mark(),i=this.peek(),a="*"===i?"alias":"anchor",this.forward(),o=0,r=this.peek(o);"0"<=r&&r<="9"||"A"<=r&&r<="Z"||"a"<=r&&r<="z"||l.call("-_",r)>=0;)o++,r=this.peek(o);if(0===o)throw new t.ScannerError("while scanning an "+a,s,"expected alphabetic or numeric character but found '"+r+"'",this.get_mark());if(u=this.prefix(o),this.forward(o),r=this.peek(),l.call(n+c+"\0?:,]}%@`",r)<0)throw new t.ScannerError("while scanning an "+a,s,"expected alphabetic or numeric character but found '"+r+"'",this.get_mark());return new e(u,s,this.get_mark())},e.prototype.scan_tag=function(){var e,r,o,a,s,u;if(a=this.get_mark(),"<"===(e=this.peek(1))){if(r=null,this.forward(2),s=this.scan_tag_uri("tag",a),">"!==this.peek())throw new t.ScannerError("while parsing a tag",a,"expected '>' but found "+this.peek(),this.get_mark());this.forward()}else if(l.call(n+c+"\0",e)>=0)r=null,s="!",this.forward();else{for(o=1,u=!1;l.call(n+"\0 ",e)<0;){if("!"===e){u=!0;break}o++,e=this.peek(o)}u?r=this.scan_tag_handle("tag",a):(r="!",this.forward()),s=this.scan_tag_uri("tag",a)}if(e=this.peek(),l.call(n+"\0 ",e)<0)throw new t.ScannerError("while scanning a tag",a,"expected ' ' but found "+e,this.get_mark());return new i.TagToken([r,s],a,this.get_mark())},e.prototype.scan_block_scalar=function(e){var t,r,a,s,u,c,p,f,h,d,m,v,g,y,_,b,x,w,k,E;for(u=">"===e,a=[],E=this.get_mark(),this.forward(),g=this.scan_block_scalar_indicators(E),r=g[0],c=g[1],this.scan_block_scalar_ignored_line(E),v=this.indent+1,v<1&&(v=1),null==c?(y=this.scan_block_scalar_indentation(),t=y[0],m=y[1],s=y[2],p=Math.max(v,m)):(p=v+c-1,_=this.scan_block_scalar_breaks(p),t=_[0],s=_[1]),d="";this.column===p&&"\0"!==this.peek();){for(a=a.concat(t),b=this.peek(),f=l.call(" \t",b)<0,h=0;x=this.peek(h),l.call(n+"\0",x)<0;)h++;if(a.push(this.prefix(h)),this.forward(h),d=this.scan_line_break(),w=this.scan_block_scalar_breaks(p),t=w[0],s=w[1],this.column!==p||"\0"===this.peek())break;u&&"\n"===d&&f&&(k=this.peek(),l.call(" \t",k)<0)?o.is_empty(t)&&a.push(" "):a.push(d)}return!1!==r&&a.push(d),!0===r&&(a=a.concat(t)),new i.ScalarToken(a.join(""),!1,E,s,e)},e.prototype.scan_block_scalar_indicators=function(e){var r,i,o;if(i=null,o=null,r=this.peek(),l.call("+-",r)>=0){if(i="+"===r,this.forward(),r=this.peek(),l.call(a,r)>=0){if(0===(o=parseInt(r)))throw new t.ScannerError("while scanning a block scalar",e,"expected indentation indicator in the range 1-9 but found 0",this.get_mark());this.forward()}}else if(l.call(a,r)>=0){if(0===(o=parseInt(r)))throw new t.ScannerError("while scanning a block scalar",e,"expected indentation indicator in the range 1-9 but found 0",this.get_mark());this.forward(),r=this.peek(),l.call("+-",r)>=0&&(i="+"===r,this.forward())}if(r=this.peek(),l.call(n+"\0 ",r)<0)throw new t.ScannerError("while scanning a block scalar",e,"expected chomping or indentation indicators, but found "+r,this.get_mark());return[i,o]},e.prototype.scan_block_scalar_ignored_line=function(e){for(var r,i;" "===this.peek();)this.forward();if("#"===this.peek())for(;i=this.peek(),l.call(n+"\0",i)<0;)this.forward();if(r=this.peek(),l.call(n+"\0",r)<0)throw new t.ScannerError("while scanning a block scalar",e,"expected a comment or a line break but found "+r,this.get_mark());return this.scan_line_break()},e.prototype.scan_block_scalar_indentation=function(){var e,t,r,i;for(e=[],r=0,t=this.get_mark();i=this.peek(),l.call(n+" ",i)>=0;)" "!==this.peek()?(e.push(this.scan_line_break()),t=this.get_mark()):(this.forward(),this.column>r&&(r=this.column));return[e,r,t]},e.prototype.scan_block_scalar_breaks=function(e){var t,r,i;for(t=[],r=this.get_mark();this.column<e&&" "===this.peek();)this.forward();for(;i=this.peek(),l.call(n,i)>=0;)for(t.push(this.scan_line_break()),r=this.get_mark();this.column<e&&" "===this.peek();)this.forward();return[t,r]},e.prototype.scan_flow_scalar=function(e){var t,n,r,o;for(n='"'===e,t=[],o=this.get_mark(),r=this.peek(),this.forward(),t=t.concat(this.scan_flow_scalar_non_spaces(n,o));this.peek()!==r;)t=t.concat(this.scan_flow_scalar_spaces(n,o)),t=t.concat(this.scan_flow_scalar_non_spaces(n,o));return this.forward(),new i.ScalarToken(t.join(""),!1,o,this.get_mark(),e)},e.prototype.scan_flow_scalar_non_spaces=function(e,r){var i,o,s,u,h,d,m,v,g;for(o=[];;){for(d=0;m=this.peek(d),l.call(n+c+"'\"\\\0",m)<0;)d++;if(0!==d&&(o.push(this.prefix(d)),this.forward(d)),i=this.peek(),e||"'"!==i||"'"!==this.peek(1))if(e&&"'"===i||!e&&l.call('"\\',i)>=0)o.push(i),this.forward();else{if(!e||"\\"!==i)return o;if(this.forward(),(i=this.peek())in f)o.push(f[i]),this.forward();else if(i in p){for(d=p[i],this.forward(),h=u=0,v=d;0<=v?u<v:u>v;h=0<=v?++u:--u)if(g=this.peek(h),l.call(a+"ABCDEFabcdef",g)<0)throw new t.ScannerError("while scanning a double-quoted scalar",r,"expected escape sequence of "+d+" hexadecimal numbers, but found "+this.peek(h),this.get_mark());s=parseInt(this.prefix(d),16),o.push(String.fromCharCode(s)),this.forward(d)}else{if(!(l.call(n,i)>=0))throw new t.ScannerError("while scanning a double-quoted scalar",r,"found unknown escape character "+i,this.get_mark());this.scan_line_break(),o=o.concat(this.scan_flow_scalar_breaks(e,r))}}else o.push("'"),this.forward(2)}},e.prototype.scan_flow_scalar_spaces=function(e,r){var i,o,a,s,u,p,f;for(a=[],s=0;p=this.peek(s),l.call(c,p)>=0;)s++;if(f=this.prefix(s),this.forward(s),"\0"===(o=this.peek()))throw new t.ScannerError("while scanning a quoted scalar",r,"found unexpected end of stream",this.get_mark());return l.call(n,o)>=0?(u=this.scan_line_break(),i=this.scan_flow_scalar_breaks(e,r),"\n"!==u?a.push(u):0===i.length&&a.push(" "),a=a.concat(i)):a.push(f),a},e.prototype.scan_flow_scalar_breaks=function(e,r){var i,o,a,s,u;for(i=[];;){if("---"===(o=this.prefix(3))||"..."===o&&(a=this.peek(3),l.call(n+c+"\0",a)>=0))throw new t.ScannerError("while scanning a quoted scalar",r,"found unexpected document separator",this.get_mark());for(;s=this.peek(),l.call(c,s)>=0;)this.forward();if(u=this.peek(),!(l.call(n,u)>=0))return i;i.push(this.scan_line_break())}},e.prototype.scan_plain=function(){var e,r,o,a,s,u,p,f,h;for(r=[],h=o=this.get_mark(),a=this.indent+1,f=[];;){if(s=0,"#"===this.peek())break;for(;;){if(e=this.peek(s),l.call(n+c+"\0",e)>=0||0===this.flow_level&&":"===e&&(u=this.peek(s+1),l.call(n+c+"\0",u)>=0)||0!==this.flow_level&&l.call(",:?[]{}",e)>=0)break;s++}if(0!==this.flow_level&&":"===e&&(p=this.peek(s+1),l.call(n+c+"\0,[]{}",p)<0))throw this.forward(s),new t.ScannerError("while scanning a plain scalar",h,"found unexpected ':'",this.get_mark(),"Please check http://pyyaml.org/wiki/YAMLColonInFlowContext");if(0===s)break;if(this.allow_simple_key=!1,r=r.concat(f),r.push(this.prefix(s)),this.forward(s),o=this.get_mark(),null==(f=this.scan_plain_spaces(a,h))||0===f.length||"#"===this.peek()||0===this.flow_level&&this.column<a)break}return new i.ScalarToken(r.join(""),!0,h,o)},e.prototype.scan_plain_spaces=function(e,t){var r,i,o,a,s,u,p,f,h,d,m;for(o=[],a=0;p=this.peek(a),l.call(" ",p)>=0;)a++;if(m=this.prefix(a),this.forward(a),i=this.peek(),l.call(n,i)>=0){if(s=this.scan_line_break(),this.allow_simple_key=!0,"---"===(u=this.prefix(3))||"..."===u&&(f=this.peek(3),l.call(n+c+"\0",f)>=0))return;for(r=[];d=this.peek(),l.call(n+" ",d)>=0;)if(" "===this.peek())this.forward();else if(r.push(this.scan_line_break()),"---"===(u=this.prefix(3))||"..."===u&&(h=this.peek(3),l.call(n+c+"\0",h)>=0))return;"\n"!==s?o.push(s):0===r.length&&o.push(" "),o=o.concat(r)}else m&&o.push(m);return o},e.prototype.scan_tag_handle=function(e,n){var r,i,o;if("!"!==(r=this.peek()))throw new t.ScannerError("while scanning a "+e,n,"expected '!' but found "+r,this.get_mark());if(i=1," "!==(r=this.peek(i))){for(;"0"<=r&&r<="9"||"A"<=r&&r<="Z"||"a"<=r&&r<="z"||l.call("-_",r)>=0;)i++,r=this.peek(i);if("!"!==r)throw this.forward(i),new t.ScannerError("while scanning a "+e,n,"expected '!' but found "+r,this.get_mark());i++}return o=this.prefix(i),this.forward(i),o},e.prototype.scan_tag_uri=function(e,n){var r,i,o;for(i=[],o=0,r=this.peek(o);"0"<=r&&r<="9"||"A"<=r&&r<="Z"||"a"<=r&&r<="z"||l.call("-;/?:@&=+$,_.!~*'()[]%",r)>=0;)"%"===r?(i.push(this.prefix(o)),this.forward(o),o=0,i.push(this.scan_uri_escapes(e,n))):o++,r=this.peek(o);if(0!==o&&(i.push(this.prefix(o)),this.forward(o),o=0),0===i.length)throw new t.ScannerError("while parsing a "+e,n,"expected URI but found "+r,this.get_mark());return i.join("")},e.prototype.scan_uri_escapes=function(e,n){var r,i,o;for(r=[],this.get_mark();"%"===this.peek();){for(this.forward(),o=i=0;i<=2;o=++i)throw new t.ScannerError("while scanning a "+e,n,"expected URI escape sequence of 2 hexadecimal numbers but found "+this.peek(o),this.get_mark());r.push(String.fromCharCode(parseInt(this.prefix(2),16))),this.forward(2)}return r.join("")},e.prototype.scan_line_break=function(){var e;return e=this.peek(),l.call("\r\n…",e)>=0?("\r\n"===this.prefix(2)?this.forward(2):this.forward(),"\n"):l.call("\u2028\u2029",e)>=0?(this.forward(),e):""},e}()}).call(this)},function(e,t){},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(35),o=r(i),a=n(47),s=r(a),u=n(48),l=r(u),c=n(203),p=r(c),f=n(562),h=r(f),d=n(46),m=r(d),v=n(560),g=r(v),y=n(271),_=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(y),b=n(9),x={PACKAGE_VERSION:"3.10.0",GIT_COMMIT:"g2e05bb99",GIT_DIRTY:!0,HOSTNAME:"banjo",BUILD_TIME:"Sat, 10 Feb 2018 04:32:34 GMT"},w=x.GIT_DIRTY,k=x.GIT_COMMIT,E=x.PACKAGE_VERSION,S=x.HOSTNAME,C=x.BUILD_TIME;e.exports=function(e){m.default.versions=m.default.versions||{},m.default.versions.swaggerUi={version:E,gitRevision:k,gitDirty:w,buildTimestamp:C,machine:S};var t={dom_id:null,domNode:null,spec:{},url:"",urls:null,layout:"BaseLayout",docExpansion:"list",maxDisplayedTags:null,filter:null,validatorUrl:"https://online.swagger.io/validator",configs:{},custom:{},displayOperationId:!1,displayRequestDuration:!1,deepLinking:!1,requestInterceptor:function(e){return e},responseInterceptor:function(e){return e},showMutatedRequest:!0,defaultModelRendering:"example",defaultModelExpandDepth:1,defaultModelsExpandDepth:1,showExtensions:!1,supportedSubmitMethods:["get","put","post","delete","options","head","patch","trace"],presets:[g.default],plugins:[],initialState:{},fn:{},components:{}},n=(0,b.parseSearch)(),r=e.domNode;delete e.domNode;var i=(0,p.default)({},t,e,n),a={system:{configs:i.configs},plugins:i.presets,state:(0,p.default)({layout:{layout:i.layout,filter:i.filter},spec:{spec:"",url:i.url}},i.initialState)};if(i.initialState)for(var u in i.initialState)i.initialState.hasOwnProperty(u)&&void 0===i.initialState[u]&&delete a.state[u];var c=function(){return{fn:i.fn,components:i.components,state:i.state}},f=new h.default(a);f.register([i.plugins,c]);var d=f.getSystem(),v=function(e){if("object"!==(void 0===i?"undefined":(0,l.default)(i)))return d;var t=d.specSelectors.getLocalConfig?d.specSelectors.getLocalConfig():{},a=(0,p.default)({},t,i,e||{},n);if(r&&(a.domNode=r),f.setConfigs(a),null!==e&&(!n.url&&"object"===(0,l.default)(a.spec)&&(0,s.default)(a.spec).length?(d.specActions.updateUrl(""),d.specActions.updateLoadingStatus("success"),d.specActions.updateSpec((0,o.default)(a.spec))):d.specActions.download&&a.url&&(d.specActions.updateUrl(a.url),d.specActions.download(a.url))),a.domNode)d.render(a.domNode,"App");else if(a.dom_id){var u=document.querySelector(a.dom_id);d.render(u,"App")}else null===a.dom_id||null===a.domNode||console.error("Skipped rendering: no `dom_id` or `domNode` was specified");return d},y=n.config||i.configUrl;return!y||!d.specActions.getConfigByUrl||d.specActions.getConfigByUrl&&!d.specActions.getConfigByUrl(y,v)?v():d},e.exports.presets={apis:g.default},e.exports.plugins=_},function(e,t,n){"use strict";var r=n(46);void 0===function(e){return e&&e.__esModule?e:{default:e}}(r).default.Promise&&n(584),String.prototype.startsWith||n(583)},function(e,t,n){"use strict";function r(e){return u.indexOf(e[0])>-1}function i(e){var t,n,i=e.replace(a,"");return r(i)?i:(n=i.match(s))?(t=n[0],o.test(t)?"about:blank":i):"about:blank"}var o=/^(%20|\s)*(javascript|data)/im,a=/[^\x20-\x7E]/gim,s=/^([^:]+):/gm,u=[".","/"];e.exports={sanitizeUrl:i}},function(e,t,n){"use strict";(function(t){function n(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}function r(e){var t=new Set;return e.filter(function(e){return!t.has(e)&&(t.add(e),!0)})}function i(e){var t=[];return new Set(e).forEach(function(e){t.push(e)}),t}"Set"in t?"function"==typeof Set.prototype.forEach&&function(){var e=!1;return new Set([!0]).forEach(function(t){e=t}),!0===e}()?e.exports=i:e.exports=r:e.exports=n}).call(t,n(17))},function(e,t,n){var r,i;!function(n,o){r=[],void 0!==(i=function(){return n.Autolinker=o()}.apply(t,r))&&(e.exports=i)}(this,function(){/*! - * Autolinker.js - * 0.15.3 +var n=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},r=Object.prototype.hasOwnProperty;function o(e,t){return r.call(e,t)}function i(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);t=[];for(var r in e)o(e,r)&&t.push(r);return t}function a(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function s(e,t){var n;for(var r in e)if(o(e,r)){if(e[r]===t)return a(r)+"/";if("object"==typeof e[r]&&""!=(n=s(e[r],t)))return a(r)+"/"+n}return""}function u(e,t){var n=[e];for(var r in t){var o="object"==typeof t[r]?JSON.stringify(t[r],null,2):t[r];void 0!==o&&n.push(r+": "+o)}return n.join("\n")}t.hasOwnProperty=o,t._objectKeys=i,t._deepClone=function(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}},t.isInteger=function(e){for(var t,n=0,r=e.length;n<r;){if(!((t=e.charCodeAt(n))>=48&&t<=57))return!1;n++}return!0},t.escapePathComponent=a,t.unescapePathComponent=function(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")},t._getPathRecursive=s,t.getPath=function(e,t){if(e===t)return"/";var n=s(e,t);if(""===n)throw new Error("Object not found in root");return"/"+n},t.hasUndefined=function e(t){if(void 0===t)return!0;if(t)if(Array.isArray(t)){for(var n=0,r=t.length;n<r;n++)if(e(t[n]))return!0}else if("object"==typeof t){var o=i(t),a=o.length;for(n=0;n<a;n++)if(e(t[o[n]]))return!0}return!1};var c=function(e){function t(t,n,r,o,i){e.call(this,u(t,{name:n,index:r,operation:o,tree:i})),this.name=n,this.index=r,this.operation=o,this.tree=i,this.message=u(t,{name:n,index:r,operation:o,tree:i})}return n(t,e),t}(Error);t.PatchError=c},function(e,t,n){var r=n(63),o=n(211),i=n(100),a=n(158),s=n(954);e.exports=function(e,t){var n=1==e,u=2==e,c=3==e,l=4==e,p=6==e,f=5==e||p,h=t||s;return function(t,s,d){for(var m,v,g=i(t),y=o(g),b=r(s,d,3),_=a(y.length),w=0,x=n?h(t,_):u?h(t,0):void 0;_>w;w++)if((f||w in y)&&(v=b(m=y[w],w,g),e))if(n)x[w]=v;else if(v)switch(e){case 3:return!0;case 5:return m;case 6:return w;case 2:x.push(m)}else if(l)return!1;return p?-1:c||l?l:x}}},function(e,t,n){"use strict";function r(e,t,n,r,o){this.src=e,this.env=r,this.options=n,this.parser=t,this.tokens=o,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent="",this.labelUnmatchedScopes=0}r.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},r.prototype.push=function(e){this.pending&&this.pushPending(),this.tokens.push(e),this.pendingLevel=this.level},r.prototype.cacheSet=function(e,t){for(var n=this.cache.length;n<=e;n++)this.cache.push(0);this.cache[e]=t},r.prototype.cacheGet=function(e){return e<this.cache.length?this.cache[e]:0},e.exports=r},function(e,t,n){var r=n(605)("toUpperCase");e.exports=r},function(e,t,n){var r=n(226),o="Expected a function";function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},function(e,t,n){var r=n(639)(n(676));e.exports=r},function(e,t,n){"use strict";n.r(t);var r=n(274),o=n(44),i=n(277);t.default=function(e){return{statePlugins:{err:{reducers:Object(r.default)(e),actions:o,selectors:i}}}}},function(e,t,n){"use strict";n.r(t);var r=n(2),o=n.n(r),i=n(16),a=n.n(i),s=n(44),u=n(1),c=n(96),l={line:0,level:"error",message:"Unknown error"};t.default=function(e){var t;return t={},o()(t,s.NEW_THROWN_ERR,function(t,n){var r=n.payload,o=a()(l,r,{type:"thrown"});return t.update("errors",function(e){return(e||Object(u.List)()).push(Object(u.fromJS)(o))}).update("errors",function(t){return Object(c.default)(t,e.getSystem())})}),o()(t,s.NEW_THROWN_ERR_BATCH,function(t,n){var r=n.payload;return r=r.map(function(e){return Object(u.fromJS)(a()(l,e,{type:"thrown"}))}),t.update("errors",function(e){return(e||Object(u.List)()).concat(Object(u.fromJS)(r))}).update("errors",function(t){return Object(c.default)(t,e.getSystem())})}),o()(t,s.NEW_SPEC_ERR,function(t,n){var r=n.payload,o=Object(u.fromJS)(r);return o=o.set("type","spec"),t.update("errors",function(e){return(e||Object(u.List)()).push(Object(u.fromJS)(o)).sortBy(function(e){return e.get("line")})}).update("errors",function(t){return Object(c.default)(t,e.getSystem())})}),o()(t,s.NEW_SPEC_ERR_BATCH,function(t,n){var r=n.payload;return r=r.map(function(e){return Object(u.fromJS)(a()(l,e,{type:"spec"}))}),t.update("errors",function(e){return(e||Object(u.List)()).concat(Object(u.fromJS)(r))}).update("errors",function(t){return Object(c.default)(t,e.getSystem())})}),o()(t,s.NEW_AUTH_ERR,function(t,n){var r=n.payload,o=Object(u.fromJS)(a()({},r));return o=o.set("type","auth"),t.update("errors",function(e){return(e||Object(u.List)()).push(Object(u.fromJS)(o))}).update("errors",function(t){return Object(c.default)(t,e.getSystem())})}),o()(t,s.CLEAR,function(e,t){var n=t.payload;if(!n||!e.get("errors"))return e;var r=e.get("errors").filter(function(e){return e.keySeq().every(function(t){var r=e.get(t),o=n[t];return!o||r!==o})});return e.merge({errors:r})}),o()(t,s.CLEAR_BY,function(e,t){var n=t.payload;if(!n||"function"!=typeof n)return e;var r=e.get("errors").filter(function(e){return n(e)});return e.merge({errors:r})}),t}},function(e,t,n){"use strict";function r(e){return e.map(function(e){var t=e.get("message").indexOf("is not of a type(s)");if(t>-1){var n=e.get("message").slice(t+"is not of a type(s)".length).split(",");return e.set("message",e.get("message").slice(0,t)+function(e){return e.reduce(function(e,t,n,r){return n===r.length-1&&r.length>1?e+"or "+t:r[n+1]&&r.length>2?e+t+", ":r[n+1]?e+t+" ":e+t},"should be a")}(n))}return e})}n.r(t),n.d(t,"transform",function(){return r})},function(e,t,n){"use strict";n.r(t),n.d(t,"transform",function(){return r});n(93),n(1);function r(e,t){t.jsSpec;return e}},function(e,t,n){"use strict";n.r(t),n.d(t,"allErrors",function(){return i}),n.d(t,"lastError",function(){return a});var r=n(1),o=n(11),i=Object(o.createSelector)(function(e){return e},function(e){return e.get("errors",Object(r.List)())}),a=Object(o.createSelector)(i,function(e){return e.last()})},function(e,t,n){"use strict";n.r(t);var r=n(279),o=n(79),i=n(280);t.default=function(){return{statePlugins:{layout:{reducers:r.default,actions:o,selectors:i}}}}},function(e,t,n){"use strict";n.r(t);var r,o=n(2),i=n.n(o),a=n(1),s=n(79);t.default=(r={},i()(r,s.UPDATE_LAYOUT,function(e,t){return e.set("layout",t.payload)}),i()(r,s.UPDATE_FILTER,function(e,t){return e.set("filter",t.payload)}),i()(r,s.SHOW,function(e,t){var n=t.payload.shown,r=Object(a.fromJS)(t.payload.thing);return e.update("shown",Object(a.fromJS)({}),function(e){return e.set(r,n)})}),i()(r,s.UPDATE_MODE,function(e,t){var n=t.payload.thing,r=t.payload.mode;return e.setIn(["modes"].concat(n),(r||"")+"")}),r)},function(e,t,n){"use strict";n.r(t),n.d(t,"current",function(){return u}),n.d(t,"currentFilter",function(){return c}),n.d(t,"isShown",function(){return l}),n.d(t,"whatMode",function(){return p}),n.d(t,"showSummary",function(){return f});var r=n(12),o=n.n(r),i=n(11),a=n(3),s=n(1),u=function(e){return e.get("layout")},c=function(e){return e.get("filter")},l=function(e,t,n){return t=Object(a.w)(t),e.get("shown",Object(s.fromJS)({})).get(Object(s.fromJS)(t),n)},p=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t=Object(a.w)(t),e.getIn(["modes"].concat(o()(t)),n)},f=Object(i.createSelector)(function(e){return e},function(e){return!l(e,"editor")})},function(e,t,n){"use strict";n.r(t);var r=n(282),o=n(29),i=n(70),a=n(284);t.default=function(){return{statePlugins:{spec:{wrapActions:a,reducers:r.default,actions:o,selectors:i}}}}},function(e,t,n){"use strict";n.r(t);var r,o=n(2),i=n.n(o),a=n(16),s=n.n(a),u=n(12),c=n.n(u),l=n(1),p=n(3),f=n(18),h=n.n(f),d=n(70),m=n(29);t.default=(r={},i()(r,m.UPDATE_SPEC,function(e,t){return"string"==typeof t.payload?e.set("spec",t.payload):e}),i()(r,m.UPDATE_URL,function(e,t){return e.set("url",t.payload+"")}),i()(r,m.UPDATE_JSON,function(e,t){return e.set("json",Object(p.i)(t.payload))}),i()(r,m.UPDATE_RESOLVED,function(e,t){return e.setIn(["resolved"],Object(p.i)(t.payload))}),i()(r,m.UPDATE_RESOLVED_SUBTREE,function(e,t){var n=t.payload,r=n.value,o=n.path;return e.setIn(["resolvedSubtrees"].concat(c()(o)),Object(p.i)(r))}),i()(r,m.UPDATE_PARAM,function(e,t){var n=t.payload,r=n.path,o=n.paramName,i=n.paramIn,a=n.param,s=n.value,u=n.isXml,l=a?Object(p.B)(a):"".concat(i,".").concat(o),f=u?"value_xml":"value";return e.setIn(["meta","paths"].concat(c()(r),["parameters",l,f]),s)}),i()(r,m.UPDATE_EMPTY_PARAM_INCLUSION,function(e,t){var n=t.payload,r=n.pathMethod,o=n.paramName,i=n.paramIn,a=n.includeEmptyValue;if(!o||!i)return console.warn("Warning: UPDATE_EMPTY_PARAM_INCLUSION could not generate a paramKey."),e;var s="".concat(i,".").concat(o);return e.setIn(["meta","paths"].concat(c()(r),["parameter_inclusions",s]),a)}),i()(r,m.VALIDATE_PARAMS,function(e,t){var n=t.payload,r=n.pathMethod,o=n.isOAS3,i=Object(d.specJsonWithResolvedSubtrees)(e).getIn(["paths"].concat(c()(r))),a=Object(d.parameterValues)(e,r).toJS();return e.updateIn(["meta","paths"].concat(c()(r),["parameters"]),Object(l.fromJS)({}),function(t){return i.get("parameters",Object(l.List)()).reduce(function(t,n){var i=Object(p.C)(n,a),s=Object(d.parameterInclusionSettingFor)(e,r,n.get("name"),n.get("in")),u=Object(p.K)(n,i,{bypassRequiredCheck:s,isOAS3:o});return t.setIn([Object(p.B)(n),"errors"],Object(l.fromJS)(u))},t)})}),i()(r,m.CLEAR_VALIDATE_PARAMS,function(e,t){var n=t.payload.pathMethod;return e.updateIn(["meta","paths"].concat(c()(n),["parameters"]),Object(l.fromJS)([]),function(e){return e.map(function(e){return e.set("errors",Object(l.fromJS)([]))})})}),i()(r,m.SET_RESPONSE,function(e,t){var n,r=t.payload,o=r.res,i=r.path,a=r.method;(n=o.error?s()({error:!0,name:o.err.name,message:o.err.message,statusCode:o.err.statusCode},o.err.response):o).headers=n.headers||{};var u=e.setIn(["responses",i,a],Object(p.i)(n));return h.a.Blob&&o.data instanceof h.a.Blob&&(u=u.setIn(["responses",i,a,"text"],o.data)),u}),i()(r,m.SET_REQUEST,function(e,t){var n=t.payload,r=n.req,o=n.path,i=n.method;return e.setIn(["requests",o,i],Object(p.i)(r))}),i()(r,m.SET_MUTATED_REQUEST,function(e,t){var n=t.payload,r=n.req,o=n.path,i=n.method;return e.setIn(["mutatedRequests",o,i],Object(p.i)(r))}),i()(r,m.UPDATE_OPERATION_META_VALUE,function(e,t){var n=t.payload,r=n.path,o=n.value,i=n.key,a=["paths"].concat(c()(r)),s=["meta","paths"].concat(c()(r));return e.getIn(["json"].concat(c()(a)))||e.getIn(["resolved"].concat(c()(a)))||e.getIn(["resolvedSubtrees"].concat(c()(a)))?e.setIn([].concat(c()(s),[i]),Object(l.fromJS)(o)):e}),i()(r,m.CLEAR_RESPONSE,function(e,t){var n=t.payload,r=n.path,o=n.method;return e.deleteIn(["responses",r,o])}),i()(r,m.CLEAR_REQUEST,function(e,t){var n=t.payload,r=n.path,o=n.method;return e.deleteIn(["requests",r,o])}),i()(r,m.SET_SCHEME,function(e,t){var n=t.payload,r=n.scheme,o=n.path,i=n.method;return o&&i?e.setIn(["scheme",o,i],r):o||i?void 0:e.setIn(["scheme","_defaultScheme"],r)}),r)},function(e,t,n){var r=n(83),o=n(37),i=n(66),a="[object String]";e.exports=function(e){return"string"==typeof e||!o(e)&&i(e)&&r(e)==a}},function(e,t,n){"use strict";n.r(t),n.d(t,"updateSpec",function(){return s}),n.d(t,"updateJsonSpec",function(){return u}),n.d(t,"executeRequest",function(){return c}),n.d(t,"validateParams",function(){return l});var r=n(17),o=n.n(r),i=n(93),a=n.n(i),s=function(e,t){var n=t.specActions;return function(){e.apply(void 0,arguments),n.parseToJson.apply(n,arguments)}},u=function(e,t){var n=t.specActions;return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.apply(void 0,r),n.invalidateResolvedSubtreeCache();var s=r[0],u=a()(s,["paths"])||{},c=o()(u);c.forEach(function(e){a()(u,[e]).$ref&&n.requestResolvedSubtree(["paths",e])}),n.requestResolvedSubtree(["components","securitySchemes"])}},c=function(e,t){var n=t.specActions;return function(t){return n.logRequest(t),e(t)}},l=function(e,t){var n=t.specSelectors;return function(t){return e(t,n.isOAS3())}}},function(e,t,n){"use strict";n.r(t);var r=n(148),o=n(3);t.default=function(e){var t=e.getComponents,n=e.getStore,i=e.getSystem,a=r.getComponent,s=r.render,u=r.makeMappedContainer,c=Object(o.v)(a.bind(null,i,n,t));return{rootInjects:{getComponent:c,makeMappedContainer:Object(o.v)(u.bind(null,i,n,c,t)),render:s.bind(null,i,n,a,t)}}}},function(e,t,n){"use strict";n.r(t);var r=n(120);t.default=function(){return{fn:r}}},function(e,t,n){"use strict";n.r(t),t.default=function(e){var t=e.configs,n={debug:0,info:1,log:2,warn:3,error:4},r=function(e){return n[e]||-1},o=t.logLevel,i=r(o);function a(e){for(var t,n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];r(e)>=i&&(t=console)[e].apply(t,o)}return a.warn=a.bind(null,"warn"),a.error=a.bind(null,"error"),a.info=a.bind(null,"info"),a.debug=a.bind(null,"debug"),{rootInjects:{log:a}}}},function(e,t,n){"use strict";n.r(t);var r=n(56),o=n.n(r),i=n(289);t.default=function(e){var t=e.configs,n=e.getConfigs;return{fn:{fetch:o.a.makeHttp(t.preFetch,t.postFetch),buildRequest:o.a.buildRequest,execute:o.a.execute,resolve:o.a.resolve,resolveSubtree:function(e,t,r){if(void 0===r){var i=n();r={modelPropertyMacro:i.modelPropertyMacro,parameterMacro:i.parameterMacro,requestInterceptor:i.requestInterceptor,responseInterceptor:i.responseInterceptor}}for(var a=arguments.length,s=new Array(a>3?a-3:0),u=3;u<a;u++)s[u-3]=arguments[u];return o.a.resolveSubtree.apply(o.a,[e,t,r].concat(s))},serializeRes:o.a.serializeRes,opId:o.a.helpers.opId},statePlugins:{configs:{wrapActions:i}}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"loaded",function(){return r});var r=function(e,t){return function(){e.apply(void 0,arguments);var n=t.getConfigs().withCredentials;void 0!==n&&(t.fn.fetch.withCredentials="string"==typeof n?"true"===n:!!n)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"preauthorizeBasic",function(){return c}),n.d(t,"preauthorizeApiKey",function(){return l});var r=n(2),o=n.n(r),i=n(291),a=n(71),s=n(292),u=n(293);function c(e,t,n,r){var i=e.authActions.authorize,a=e.specSelectors,s=a.specJson,u=(0,a.isOAS3)()?["components","securitySchemes"]:["securityDefinitions"],c=s().getIn([].concat(u,[t]));return c?i(o()({},t,{value:{username:n,password:r},schema:c.toJS()})):null}function l(e,t,n){var r=e.authActions.authorize,i=e.specSelectors,a=i.specJson,s=(0,i.isOAS3)()?["components","securitySchemes"]:["securityDefinitions"],u=a().getIn([].concat(s,[t]));return u?r(o()({},t,{value:n,schema:u.toJS()})):null}t.default=function(){return{afterLoad:function(e){this.rootInjects=this.rootInjects||{},this.rootInjects.initOAuth=e.authActions.configureAuth,this.rootInjects.preauthorizeApiKey=l.bind(null,e),this.rootInjects.preauthorizeBasic=c.bind(null,e)},statePlugins:{auth:{reducers:i.default,actions:a,selectors:s},spec:{wrapActions:u}}}}},function(e,t,n){"use strict";n.r(t);var r,o=n(2),i=n.n(o),a=n(16),s=n.n(a),u=n(13),c=n.n(u),l=n(1),p=n(3),f=n(71);t.default=(r={},i()(r,f.SHOW_AUTH_POPUP,function(e,t){var n=t.payload;return e.set("showDefinitions",n)}),i()(r,f.AUTHORIZE,function(e,t){var n=t.payload,r=Object(l.fromJS)(n),o=e.get("authorized")||Object(l.Map)();return r.entrySeq().forEach(function(e){var t=c()(e,2),n=t[0],r=t[1],i=r.getIn(["schema","type"]);if("apiKey"===i||"http"===i)o=o.set(n,r);else if("basic"===i){var a=r.getIn(["value","username"]),s=r.getIn(["value","password"]);o=(o=o.setIn([n,"value"],{username:a,header:"Basic "+Object(p.a)(a+":"+s)})).setIn([n,"schema"],r.get("schema"))}}),e.set("authorized",o)}),i()(r,f.AUTHORIZE_OAUTH2,function(e,t){var n,r=t.payload,o=r.auth,i=r.token;return o.token=s()({},i),n=Object(l.fromJS)(o),e.setIn(["authorized",n.get("name")],n)}),i()(r,f.LOGOUT,function(e,t){var n=t.payload,r=e.get("authorized").withMutations(function(e){n.forEach(function(t){e.delete(t)})});return e.set("authorized",r)}),i()(r,f.CONFIGURE_AUTH,function(e,t){var n=t.payload;return e.set("configs",n)}),r)},function(e,t,n){"use strict";n.r(t),n.d(t,"shownDefinitions",function(){return l}),n.d(t,"definitionsToAuthorize",function(){return p}),n.d(t,"getDefinitionsByNames",function(){return f}),n.d(t,"definitionsForRequirements",function(){return h}),n.d(t,"authorized",function(){return d}),n.d(t,"isAuthorized",function(){return m}),n.d(t,"getConfigs",function(){return v});var r=n(17),o=n.n(r),i=n(13),a=n.n(i),s=n(11),u=n(1),c=function(e){return e},l=Object(s.createSelector)(c,function(e){return e.get("showDefinitions")}),p=Object(s.createSelector)(c,function(){return function(e){var t=e.specSelectors.securityDefinitions()||Object(u.Map)({}),n=Object(u.List)();return t.entrySeq().forEach(function(e){var t=a()(e,2),r=t[0],o=t[1],i=Object(u.Map)();i=i.set(r,o),n=n.push(i)}),n}}),f=function(e,t){return function(e){var n=e.specSelectors;console.warn("WARNING: getDefinitionsByNames is deprecated and will be removed in the next major version.");var r=n.securityDefinitions(),o=Object(u.List)();return t.valueSeq().forEach(function(e){var t=Object(u.Map)();e.entrySeq().forEach(function(e){var n,o=a()(e,2),i=o[0],s=o[1],u=r.get(i);"oauth2"===u.get("type")&&s.size&&((n=u.get("scopes")).keySeq().forEach(function(e){s.contains(e)||(n=n.delete(e))}),u=u.set("allowedScopes",n)),t=t.set(i,u)}),o=o.push(t)}),o}},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(u.List)();return function(e){return(e.authSelectors.definitionsToAuthorize()||Object(u.List)()).filter(function(e){return t.some(function(t){return t.get(e.keySeq().first())})})}},d=Object(s.createSelector)(c,function(e){return e.get("authorized")||Object(u.Map)()}),m=function(e,t){return function(e){var n=e.authSelectors.authorized();return u.List.isList(t)?!!t.toJS().filter(function(e){return-1===o()(e).map(function(e){return!!n.get(e)}).indexOf(!1)}).length:null}},v=Object(s.createSelector)(c,function(e){return e.get("configs")})},function(e,t,n){"use strict";n.r(t),n.d(t,"execute",function(){return y});var r=n(54),o=n.n(r),i=n(94),a=n.n(i),s=n(60),u=n.n(s),c=n(61),l=n.n(c),p=n(55),f=n.n(p),h=n(17),d=n.n(h),m=n(2),v=n.n(m);function g(e,t){var n=d()(e);if(f.a){var r=f()(e);t&&(r=r.filter(function(t){return l()(e,t).enumerable})),n.push.apply(n,r)}return n}var y=function(e,t){var n=t.authSelectors,r=t.specSelectors;return function(t){var i=t.path,s=t.method,c=t.operation,p=t.extras,f={authorized:n.authorized()&&n.authorized().toJS(),definitions:r.securityDefinitions()&&r.securityDefinitions().toJS(),specSecurity:r.security()&&r.security().toJS()};return e(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(n,!0).forEach(function(t){v()(e,t,n[t])}):u.a?a()(e,u()(n)):g(n).forEach(function(t){o()(e,t,l()(n,t))})}return e}({path:i,method:s,operation:c,securities:f},p))}}},function(e,t,n){"use strict";n.r(t);var r=n(3);t.default=function(){return{fn:{shallowEqualKeys:r.G}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return p});var r=n(28),o=n.n(r),i=n(16),a=n.n(i),s=n(11),u=n(1),c=n(18),l=n.n(c);function p(e){var t=e.fn;return{statePlugins:{spec:{actions:{download:function(e){return function(n){var r=n.errActions,o=n.specSelectors,i=n.specActions,s=n.getConfigs,u=t.fetch,c=s();function p(t){if(t instanceof Error||t.status>=400)return i.updateLoadingStatus("failed"),r.newThrownErr(a()(new Error((t.message||t.statusText)+" "+e),{source:"fetch"})),void(!t.status&&t instanceof Error&&function(){try{var t;if("URL"in l.a?t=new URL(e):(t=document.createElement("a")).href=e,"https:"!==t.protocol&&"https:"===l.a.location.protocol){var n=a()(new Error("Possible mixed-content issue? The page was loaded over https:// but a ".concat(t.protocol,"// URL was specified. Check that you are not attempting to load mixed content.")),{source:"fetch"});return void r.newThrownErr(n)}if(t.origin!==l.a.location.origin){var o=a()(new Error("Possible cross-origin (CORS) issue? The URL origin (".concat(t.origin,") does not match the page (").concat(l.a.location.origin,"). Check the server returns the correct 'Access-Control-Allow-*' headers.")),{source:"fetch"});r.newThrownErr(o)}}catch(e){return}}());i.updateLoadingStatus("success"),i.updateSpec(t.text),o.url()!==e&&i.updateUrl(e)}e=e||o.url(),i.updateLoadingStatus("loading"),r.clear({source:"fetch"}),u({url:e,loadSpec:!0,requestInterceptor:c.requestInterceptor||function(e){return e},responseInterceptor:c.responseInterceptor||function(e){return e},credentials:"same-origin",headers:{Accept:"application/json,*/*"}}).then(p,p)}},updateLoadingStatus:function(e){var t=[null,"loading","failed","success","failedConfig"];return-1===t.indexOf(e)&&console.error("Error: ".concat(e," is not one of ").concat(o()(t))),{type:"spec_update_loading_status",payload:e}}},reducers:{spec_update_loading_status:function(e,t){return"string"==typeof t.payload?e.set("loadingStatus",t.payload):e}},selectors:{loadingStatus:Object(s.createSelector)(function(e){return e||Object(u.Map)()},function(e){return e.get("loadingStatus")||null})}}}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"downloadConfig",function(){return o}),n.d(t,"getConfigByUrl",function(){return i});var r=n(147),o=function(e){return function(t){return(0,t.fn.fetch)(e)}},i=function(e,t){return function(n){var o=n.specActions;if(e)return o.downloadConfig(e).then(i,i);function i(n){n instanceof Error||n.status>=400?(o.updateLoadingStatus("failedConfig"),o.updateLoadingStatus("failedConfig"),o.updateUrl(""),console.error(n.statusText+" "+e.url),t(null)):t(Object(r.parseYamlConfig)(n.text))}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"get",function(){return i});var r=n(14),o=n.n(r),i=function(e,t){return e.getIn(o()(t)?t:[t])}},function(e,t,n){"use strict";n.r(t);var r,o=n(2),i=n.n(o),a=n(1),s=n(121);t.default=(r={},i()(r,s.UPDATE_CONFIGS,function(e,t){return e.merge(Object(a.fromJS)(t.payload))}),i()(r,s.TOGGLE_CONFIGS,function(e,t){var n=t.payload,r=e.get(n);return e.set(n,!r)}),r)},function(e,t,n){"use strict";n.r(t);var r=n(300),o=n(301),i=n(302);t.default=function(){return[r.default,{statePlugins:{configs:{wrapActions:{loaded:function(e,t){return function(){e.apply(void 0,arguments);var n=decodeURIComponent(window.location.hash);t.layoutActions.parseDeepLinkHash(n)}}}}},wrapComponents:{operation:o.default,OperationTag:i.default}}]}},function(e,t,n){"use strict";n.r(t),n.d(t,"show",function(){return v}),n.d(t,"scrollTo",function(){return g}),n.d(t,"parseDeepLinkHash",function(){return y}),n.d(t,"readyToScroll",function(){return b}),n.d(t,"scrollToElement",function(){return _}),n.d(t,"clearScrollTo",function(){return w});var r,o=n(2),i=n.n(o),a=n(13),s=n.n(a),u=n(14),c=n.n(u),l=n(149),p=n(482),f=n.n(p),h=n(3),d=n(1),m=n.n(d),v=function(e,t){var n=t.getConfigs,r=t.layoutSelectors;return function(){for(var t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];if(e.apply(void 0,o),n().deepLinking)try{var a=o[0],u=o[1];a=c()(a)?a:[a];var p=r.urlHashArrayFromIsShownKey(a);if(!p.length)return;var f=s()(p,2),d=f[0],m=f[1];if(!u)return Object(l.setHash)("/");2===p.length?Object(l.setHash)(Object(h.d)("/".concat(encodeURIComponent(d),"/").concat(encodeURIComponent(m)))):1===p.length&&Object(l.setHash)(Object(h.d)("/".concat(encodeURIComponent(d))))}catch(e){console.error(e)}}},g=function(e){return{type:"layout_scroll_to",payload:c()(e)?e:[e]}},y=function(e){return function(t){var n=t.layoutActions,r=t.layoutSelectors;if((0,t.getConfigs)().deepLinking&&e){var o=e.slice(1);"!"===o[0]&&(o=o.slice(1)),"/"===o[0]&&(o=o.slice(1));var i=o.split("/").map(function(e){return e||""}),a=r.isShownKeyFromUrlHashArray(i),u=s()(a,3),c=u[0],l=u[1],p=void 0===l?"":l,f=u[2],h=void 0===f?"":f;if("operations"===c){var d=r.isShownKeyFromUrlHashArray([p]);p.indexOf("_")>-1&&(console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."),n.show(d.map(function(e){return e.replace(/_/g," ")}),!0)),n.show(d,!0)}(p.indexOf("_")>-1||h.indexOf("_")>-1)&&(console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."),n.show(a.map(function(e){return e.replace(/_/g," ")}),!0)),n.show(a,!0),n.scrollTo(a)}}},b=function(e,t){return function(n){var r=n.layoutSelectors.getScrollToKey();m.a.is(r,Object(d.fromJS)(e))&&(n.layoutActions.scrollToElement(t),n.layoutActions.clearScrollTo())}},_=function(e,t){return function(n){try{t=t||n.fn.getScrollParent(e),f.a.createScroller(t).to(e)}catch(e){console.error(e)}}},w=function(){return{type:"layout_clear_scroll"}};t.default={fn:{getScrollParent:function(e,t){var n=document.documentElement,r=getComputedStyle(e),o="absolute"===r.position,i=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===r.position)return n;for(var a=e;a=a.parentElement;)if(r=getComputedStyle(a),(!o||"static"!==r.position)&&i.test(r.overflow+r.overflowY+r.overflowX))return a;return n}},statePlugins:{layout:{actions:{scrollToElement:_,scrollTo:g,clearScrollTo:w,readyToScroll:b,parseDeepLinkHash:y},selectors:{getScrollToKey:function(e){return e.get("scrollToKey")},isShownKeyFromUrlHashArray:function(e,t){var n=s()(t,2),r=n[0],o=n[1];return o?["operations",r,o]:r?["operations-tag",r]:[]},urlHashArrayFromIsShownKey:function(e,t){var n=s()(t,3),r=n[0],o=n[1],i=n[2];return"operations"==r?[o,i]:"operations-tag"==r?[o]:[]}},reducers:(r={},i()(r,"layout_scroll_to",function(e,t){return e.set("scrollToKey",m.a.fromJS(t.payload))}),i()(r,"layout_clear_scroll",function(e){return e.delete("scrollToKey")}),r),wrapActions:{show:v}}}}},function(e,t,n){"use strict";n.r(t);var r=n(4),o=n.n(r),i=n(5),a=n.n(i),s=n(6),u=n.n(s),c=n(7),l=n.n(c),p=n(9),f=n.n(p),h=n(8),d=n.n(h),m=n(2),v=n.n(m),g=n(0),y=n.n(g);n(19);t.default=function(e,t){return function(n){function r(){var e,n;o()(this,r);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=u()(this,(e=l()(r)).call.apply(e,[this].concat(a))),v()(f()(n),"onLoad",function(e){var r=n.props.operation.toObject(),o=["operations",r.tag,r.operationId];t.layoutActions.readyToScroll(o,e)}),n}return d()(r,n),a()(r,[{key:"render",value:function(){return y.a.createElement("span",{ref:this.onLoad},y.a.createElement(e,this.props))}}]),r}(y.a.Component)}},function(e,t,n){"use strict";n.r(t);var r=n(4),o=n.n(r),i=n(5),a=n.n(i),s=n(6),u=n.n(s),c=n(7),l=n.n(c),p=n(9),f=n.n(p),h=n(8),d=n.n(h),m=n(2),v=n.n(m),g=n(0),y=n.n(g);n(10);t.default=function(e,t){return function(n){function r(){var e,n;o()(this,r);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=u()(this,(e=l()(r)).call.apply(e,[this].concat(a))),v()(f()(n),"onLoad",function(e){var r=["operations-tag",n.props.tag];t.layoutActions.readyToScroll(r,e)}),n}return d()(r,n),a()(r,[{key:"render",value:function(){return y.a.createElement("span",{ref:this.onLoad},y.a.createElement(e,this.props))}}]),r}(y.a.Component)}},function(e,t,n){"use strict";n.r(t);var r=n(304);t.default=function(){return{fn:{opsFilter:r.default}}}},function(e,t,n){"use strict";n.r(t),t.default=function(e,t){return e.filter(function(e,n){return-1!==n.indexOf(t)})}},function(e,t,n){"use strict";n.r(t);var r=!1;t.default=function(){return{statePlugins:{spec:{wrapActions:{updateSpec:function(e){return function(){return r=!0,e.apply(void 0,arguments)}},updateJsonSpec:function(e,t){return function(){var n=t.getConfigs().onComplete;return r&&"function"==typeof n&&(setTimeout(n,0),r=!1),e.apply(void 0,arguments)}}}}}}}},function(e,t,n){"use strict";n.r(t);var r=n(307),o=n(308),i=n(309),a=n(310),s=n(319),u=n(62),c=n(326),l=n(327);t.default=function(){return{components:a.default,wrapComponents:s.default,statePlugins:{spec:{wrapSelectors:r,selectors:i},auth:{wrapSelectors:o},oas3:{actions:u,reducers:l.default,selectors:c}}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"definitions",function(){return h}),n.d(t,"hasHost",function(){return d}),n.d(t,"securityDefinitions",function(){return m}),n.d(t,"host",function(){return v}),n.d(t,"basePath",function(){return g}),n.d(t,"consumes",function(){return y}),n.d(t,"produces",function(){return b}),n.d(t,"schemes",function(){return _}),n.d(t,"servers",function(){return w}),n.d(t,"isOAS3",function(){return x}),n.d(t,"isSwagger2",function(){return E});var r=n(11),o=n(70),i=n(1),a=n(24);function s(e){return function(t,n){return function(){var r=n.getSystem().specSelectors.specJson();return Object(a.isOAS3)(r)?e.apply(void 0,arguments):t.apply(void 0,arguments)}}}var u=function(e){return e||Object(i.Map)()},c=s(Object(r.createSelector)(function(){return null})),l=Object(r.createSelector)(u,function(e){return e.get("json",Object(i.Map)())}),p=Object(r.createSelector)(u,function(e){return e.get("resolved",Object(i.Map)())}),f=function(e){var t=p(e);return t.count()<1&&(t=l(e)),t},h=s(Object(r.createSelector)(f,function(e){var t=e.getIn(["components","schemas"]);return i.Map.isMap(t)?t:Object(i.Map)()})),d=s(function(e){return f(e).hasIn(["servers",0])}),m=s(Object(r.createSelector)(o.specJsonWithResolvedSubtrees,function(e){return e.getIn(["components","securitySchemes"])||null})),v=c,g=c,y=c,b=c,_=c,w=s(Object(r.createSelector)(f,function(e){return e.getIn(["servers"])||Object(i.Map)()})),x=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return Object(a.isOAS3)(i.Map.isMap(e)?e:Object(i.Map)())}},E=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return Object(a.isSwagger2)(i.Map.isMap(e)?e:Object(i.Map)())}}},function(e,t,n){"use strict";n.r(t),n.d(t,"definitionsToAuthorize",function(){return p});var r=n(2),o=n.n(r),i=n(13),a=n.n(i),s=n(11),u=n(1),c=n(24);var l,p=(l=Object(s.createSelector)(function(e){return e},function(e){return e.specSelectors.securityDefinitions()},function(e,t){var n=Object(u.List)();return t?(t.entrySeq().forEach(function(e){var t=a()(e,2),r=t[0],i=t[1],s=i.get("type");"oauth2"===s&&i.get("flows").entrySeq().forEach(function(e){var t=a()(e,2),s=t[0],c=t[1],l=Object(u.fromJS)({flow:s,authorizationUrl:c.get("authorizationUrl"),tokenUrl:c.get("tokenUrl"),scopes:c.get("scopes"),type:i.get("type")});n=n.push(new u.Map(o()({},r,l.filter(function(e){return void 0!==e}))))}),"http"!==s&&"apiKey"!==s||(n=n.push(new u.Map(o()({},r,i))))}),n):n}),function(e,t){return function(n){for(var r=t.getSystem().specSelectors.specJson(),o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return Object(c.isOAS3)(r)?l.apply(void 0,[t].concat(i)):e.apply(void 0,i)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"servers",function(){return l}),n.d(t,"isSwagger2",function(){return p});var r=n(11),o=n(1),i=n(24);var a,s=function(e){return e||Object(o.Map)()},u=Object(r.createSelector)(s,function(e){return e.get("json",Object(o.Map)())}),c=Object(r.createSelector)(s,function(e){return e.get("resolved",Object(o.Map)())}),l=(a=Object(r.createSelector)(function(e){var t=c(e);return t.count()<1&&(t=u(e)),t},function(e){return e.getIn(["servers"])||Object(o.Map)()}),function(){return function(e){var t=e.getSystem().specSelectors.specJson();if(Object(i.isOAS3)(t)){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return a.apply(void 0,r)}return null}}),p=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return Object(i.isSwagger2)(e)}}},function(e,t,n){"use strict";n.r(t);var r=n(311),o=n(312),i=n(313),a=n(314),s=n(315),u=n(316),c=n(317),l=n(318);t.default={Callbacks:r.default,HttpAuth:c.default,RequestBody:o.default,Servers:a.default,ServersContainer:s.default,RequestBodyEditor:u.default,OperationServers:l.default,operationLink:i.default}},function(e,t,n){"use strict";n.r(t);var r=n(20),o=n.n(r),i=n(0),a=n.n(i),s=(n(10),n(19),n(1));t.default=function(e){var t=e.callbacks,n=e.getComponent,r=e.specPath,i=n("OperationContainer",!0);if(!t)return a.a.createElement("span",null,"No callbacks");var u=t.map(function(t,n){return a.a.createElement("div",{key:n},a.a.createElement("h2",null,n),t.map(function(t,u){return"$$ref"===u?null:a.a.createElement("div",{key:u},t.map(function(t,c){if("$$ref"===c)return null;var l=Object(s.fromJS)({operation:t});return a.a.createElement(i,o()({},e,{op:l,key:c,tag:"",method:c,path:u,specPath:r.push(n,u,c),allowTryItOut:!1}))}))}))});return a.a.createElement("div",null,u)}},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),i=(n(10),n(19),n(1)),a=n(3);function s(e,t,n){var r=e.getIn(["content",t]),o=r.get("schema").toJS(),i=void 0!==r.get("example")?Object(a.I)(r.get("example")):null,s=r.getIn(["examples",n,"value"]);return r.get("examples")?Object(a.I)(s)||"":Object(a.I)(i||Object(a.o)(o,t,{includeWriteOnly:!0})||"")}t.default=function(e){var t=e.requestBody,n=e.requestBodyValue,r=e.getComponent,u=e.getConfigs,c=e.specSelectors,l=e.fn,p=e.contentType,f=e.isExecute,h=e.specPath,d=e.onChange,m=e.activeExamplesKey,v=e.updateActiveExamplesKey,g=r("Markdown"),y=r("modelExample"),b=r("RequestBodyEditor"),_=r("highlightCode"),w=r("ExamplesSelectValueRetainer"),x=r("Example"),E=u().showCommonExtensions,S=t&&t.get("description")||null,C=t&&t.get("content")||new i.OrderedMap;p=p||C.keySeq().first()||"";var k=C.get(p,Object(i.OrderedMap)()),O=k.get("schema",Object(i.OrderedMap)()),A=k.get("examples",null);if(!k.size)return null;var T="object"===k.getIn(["schema","type"]);if("application/octet-stream"===p||0===p.indexOf("image/")||0===p.indexOf("audio/")||0===p.indexOf("video/")){var j=r("Input");return f?o.a.createElement(j,{type:"file",onChange:function(e){d(e.target.files[0])}}):o.a.createElement("i",null,"Example values are not available for ",o.a.createElement("code",null,"application/octet-stream")," media types.")}if(T&&("application/x-www-form-urlencoded"===p||0===p.indexOf("multipart/"))&&O.get("properties",Object(i.OrderedMap)()).size>0){var P=r("JsonSchemaForm"),I=r("ParameterExt"),M=O.get("properties",Object(i.OrderedMap)());return n=i.Map.isMap(n)?n:Object(i.OrderedMap)(),o.a.createElement("div",{className:"table-container"},S&&o.a.createElement(g,{source:S}),o.a.createElement("table",null,o.a.createElement("tbody",null,M.map(function(e,t){var s=E?Object(a.l)(e):null,u=O.get("required",Object(i.List)()).includes(t),c=e.get("type"),p=e.get("format"),h=e.get("description"),m=n.get(t),v=e.get("default")||e.get("example")||"";""===v&&"object"===c&&(v=Object(a.o)(e,!1,{includeWriteOnly:!0})),"string"!=typeof v&&"object"===c&&(v=Object(a.I)(v));var y="string"===c&&("binary"===p||"base64"===p);return o.a.createElement("tr",{key:t,className:"parameters","data-property-name":t},o.a.createElement("td",{className:"parameters-col_name"},o.a.createElement("div",{className:u?"parameter__name required":"parameter__name"},t,u?o.a.createElement("span",{style:{color:"red"}}," *"):null),o.a.createElement("div",{className:"parameter__type"},c,p&&o.a.createElement("span",{className:"prop-format"},"($",p,")"),E&&s.size?s.map(function(e,t){return o.a.createElement(I,{key:"".concat(t,"-").concat(e),xKey:t,xVal:e})}):null),o.a.createElement("div",{className:"parameter__deprecated"},e.get("deprecated")?"deprecated":null)),o.a.createElement("td",{className:"parameters-col_description"},o.a.createElement(g,{source:h}),f?o.a.createElement("div",null,o.a.createElement(P,{fn:l,dispatchInitialValue:!y,schema:e,description:t,getComponent:r,value:void 0===m?v:m,onChange:function(e){d(e,[t])}})):null))}))))}return o.a.createElement("div",null,S&&o.a.createElement(g,{source:S}),A?o.a.createElement(w,{examples:A,currentKey:m,currentUserInputValue:n,onSelect:function(e){v(e)},updateValue:d,defaultToFirstExample:!0,getComponent:r}):null,f?o.a.createElement("div",null,o.a.createElement(b,{value:n,defaultValue:s(t,p,m),onChange:d,getComponent:r})):o.a.createElement(y,{getComponent:r,getConfigs:u,specSelectors:c,expandDepth:1,isExecute:f,schema:k.get("schema"),specPath:h.push("content",p),example:o.a.createElement(_,{className:"body-param__example",value:Object(a.I)(n)||s(t,p,m)})}),A?o.a.createElement(x,{example:A.get(m),getComponent:r}):null)}},function(e,t,n){"use strict";n.r(t);var r=n(28),o=n.n(r),i=n(4),a=n.n(i),s=n(5),u=n.n(s),c=n(6),l=n.n(c),p=n(7),f=n.n(p),h=n(8),d=n.n(h),m=n(0),v=n.n(m),g=(n(10),n(19),function(e){function t(){return a()(this,t),l()(this,f()(t).apply(this,arguments))}return d()(t,e),u()(t,[{key:"render",value:function(){var e=this.props,t=e.link,n=e.name,r=(0,e.getComponent)("Markdown"),i=t.get("operationId")||t.get("operationRef"),a=t.get("parameters")&&t.get("parameters").toJS(),s=t.get("description");return v.a.createElement("div",{style:{marginBottom:"1.5em"}},v.a.createElement("div",{style:{marginBottom:".5em"}},v.a.createElement("b",null,v.a.createElement("code",null,n)),s?v.a.createElement(r,{source:s}):null),v.a.createElement("pre",null,"Operation `",i,"`",v.a.createElement("br",null),v.a.createElement("br",null),"Parameters ",function(e,t){if("string"!=typeof t)return"";return t.split("\n").map(function(t,n){return n>0?Array(e+1).join(" ")+t:t}).join("\n")}(0,o()(a,null,2))||"{}",v.a.createElement("br",null)))}}]),t}(m.Component));t.default=g},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return _});var r=n(4),o=n.n(r),i=n(5),a=n.n(i),s=n(6),u=n.n(s),c=n(7),l=n.n(c),p=n(9),f=n.n(p),h=n(8),d=n.n(h),m=n(2),v=n.n(m),g=n(0),y=n.n(g),b=n(1),_=(n(10),n(19),function(e){function t(){var e,n;o()(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=u()(this,(e=l()(t)).call.apply(e,[this].concat(i))),v()(f()(n),"onServerChange",function(e){n.setServer(e.target.value)}),v()(f()(n),"onServerVariableValueChange",function(e){var t=n.props,r=t.setServerVariableValue,o=t.currentServer,i=e.target.getAttribute("data-variable"),a=e.target.value;"function"==typeof r&&r({server:o,key:i,val:a})}),v()(f()(n),"setServer",function(e){(0,n.props.setSelectedServer)(e)}),n}return d()(t,e),a()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.servers;e.currentServer||this.setServer(t.first().get("url"))}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.servers,r=t.setServerVariableValue,o=t.getServerVariable;if(this.props.currentServer!==e.currentServer){var i=n.find(function(t){return t.get("url")===e.currentServer});if(!i)return this.setServer(n.first().get("url"));(i.get("variables")||Object(b.OrderedMap)()).map(function(t,n){o(e.currentServer,n)||r({server:e.currentServer,key:n,val:t.get("default")||""})})}}},{key:"render",value:function(){var e=this,t=this.props,n=t.servers,r=t.currentServer,o=t.getServerVariable,i=t.getEffectiveServerValue,a=(n.find(function(e){return e.get("url")===r})||Object(b.OrderedMap)()).get("variables")||Object(b.OrderedMap)(),s=0!==a.size;return y.a.createElement("div",{className:"servers"},y.a.createElement("label",{htmlFor:"servers"},y.a.createElement("select",{onChange:this.onServerChange},n.valueSeq().map(function(e){return y.a.createElement("option",{value:e.get("url"),key:e.get("url")},e.get("url"),e.get("description")&&" - ".concat(e.get("description")))}).toArray())),s?y.a.createElement("div",null,y.a.createElement("div",{className:"computed-url"},"Computed URL:",y.a.createElement("code",null,i(r))),y.a.createElement("h4",null,"Server variables"),y.a.createElement("table",null,y.a.createElement("tbody",null,a.map(function(t,n){return y.a.createElement("tr",{key:n},y.a.createElement("td",null,n),y.a.createElement("td",null,t.get("enum")?y.a.createElement("select",{"data-variable":n,onChange:e.onServerVariableValueChange},t.get("enum").map(function(e){return y.a.createElement("option",{selected:e===o(r,n),key:e,value:e},e)})):y.a.createElement("input",{type:"text",value:o(r,n)||"",onChange:e.onServerVariableValueChange,"data-variable":n})))})))):null)}}]),t}(y.a.Component))},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return m});var r=n(4),o=n.n(r),i=n(5),a=n.n(i),s=n(6),u=n.n(s),c=n(7),l=n.n(c),p=n(8),f=n.n(p),h=n(0),d=n.n(h),m=(n(10),function(e){function t(){return o()(this,t),u()(this,l()(t).apply(this,arguments))}return f()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.oas3Selectors,r=e.oas3Actions,o=e.getComponent,i=t.servers(),a=o("Servers");return i&&i.size?d.a.createElement("div",null,d.a.createElement("span",{className:"servers-title"},"Servers"),d.a.createElement(a,{servers:i,currentServer:n.selectedServer(),setSelectedServer:r.setSelectedServer,setServerVariableValue:r.setServerVariableValue,getServerVariable:n.serverVariableValue,getEffectiveServerValue:n.serverEffectiveValue})):null}}]),t}(d.a.Component))},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return w});var r=n(4),o=n.n(r),i=n(5),a=n.n(i),s=n(6),u=n.n(s),c=n(7),l=n.n(c),p=n(9),f=n.n(p),h=n(8),d=n.n(h),m=n(2),v=n.n(m),g=n(0),y=n.n(g),b=(n(10),n(3)),_=Function.prototype,w=function(e){function t(e,n){var r;return o()(this,t),r=u()(this,l()(t).call(this,e,n)),v()(f()(r),"applyDefaultValue",function(e){var t=e||r.props,n=t.onChange,o=t.defaultValue;return r.setState({value:o}),n(o)}),v()(f()(r),"onChange",function(e){r.props.onChange(Object(b.I)(e))}),v()(f()(r),"onDomChange",function(e){var t=e.target.value;r.setState({value:t},function(){return r.onChange(t)})}),r.state={value:Object(b.I)(e.value)||e.defaultValue},e.onChange(e.value),r}return d()(t,e),a()(t,[{key:"componentWillReceiveProps",value:function(e){this.props.value!==e.value&&e.value!==this.state.value&&this.setState({value:Object(b.I)(e.value)}),!e.value&&e.defaultValue&&this.state.value&&this.applyDefaultValue(e)}},{key:"render",value:function(){var e=this.props.getComponent,t=this.state.value,n=e("TextArea");return y.a.createElement("div",{className:"body-param"},y.a.createElement(n,{className:"body-param__text",value:t,onChange:this.onDomChange}))}}]),t}(g.PureComponent);v()(w,"defaultProps",{onChange:_})},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return w});var r=n(16),o=n.n(r),i=n(4),a=n.n(i),s=n(5),u=n.n(s),c=n(6),l=n.n(c),p=n(7),f=n.n(p),h=n(9),d=n.n(h),m=n(8),v=n.n(m),g=n(2),y=n.n(g),b=n(0),_=n.n(b),w=(n(10),function(e){function t(e,n){var r;a()(this,t),r=l()(this,f()(t).call(this,e,n)),y()(d()(r),"onChange",function(e){var t=r.props.onChange,n=e.target,i=n.value,a=n.name,s=o()({},r.state.value);a?s[a]=i:s=i,r.setState({value:s},function(){return t(r.state)})});var i=r.props,s=i.name,u=i.schema,c=r.getValue();return r.state={name:s,schema:u,value:c},r}return v()(t,e),u()(t,[{key:"getValue",value:function(){var e=this.props,t=e.name,n=e.authorized;return n&&n.getIn([t,"value"])}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.errSelectors,o=e.name,i=n("Input"),a=n("Row"),s=n("Col"),u=n("authError"),c=n("Markdown"),l=n("JumpToPath",!0),p=(t.get("scheme")||"").toLowerCase(),f=this.getValue(),h=r.allErrors().filter(function(e){return e.get("authId")===o});if("basic"===p){var d=f?f.get("username"):null;return _.a.createElement("div",null,_.a.createElement("h4",null,_.a.createElement("code",null,o||t.get("name")),"  (http, Basic)",_.a.createElement(l,{path:["securityDefinitions",o]})),d&&_.a.createElement("h6",null,"Authorized"),_.a.createElement(a,null,_.a.createElement(c,{source:t.get("description")})),_.a.createElement(a,null,_.a.createElement("label",null,"Username:"),d?_.a.createElement("code",null," ",d," "):_.a.createElement(s,null,_.a.createElement(i,{type:"text",required:"required",name:"username",onChange:this.onChange}))),_.a.createElement(a,null,_.a.createElement("label",null,"Password:"),d?_.a.createElement("code",null," ****** "):_.a.createElement(s,null,_.a.createElement(i,{required:"required",autoComplete:"new-password",name:"password",type:"password",onChange:this.onChange}))),h.valueSeq().map(function(e,t){return _.a.createElement(u,{error:e,key:t})}))}return"bearer"===p?_.a.createElement("div",null,_.a.createElement("h4",null,_.a.createElement("code",null,o||t.get("name")),"  (http, Bearer)",_.a.createElement(l,{path:["securityDefinitions",o]})),f&&_.a.createElement("h6",null,"Authorized"),_.a.createElement(a,null,_.a.createElement(c,{source:t.get("description")})),_.a.createElement(a,null,_.a.createElement("label",null,"Value:"),f?_.a.createElement("code",null," ****** "):_.a.createElement(s,null,_.a.createElement(i,{type:"text",onChange:this.onChange}))),h.valueSeq().map(function(e,t){return _.a.createElement(u,{error:e,key:t})})):_.a.createElement("div",null,_.a.createElement("em",null,_.a.createElement("b",null,o)," HTTP authentication: unsupported scheme ","'".concat(p,"'")))}}]),t}(_.a.Component))},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return I});var r=n(54),o=n.n(r),i=n(94),a=n.n(i),s=n(60),u=n.n(s),c=n(61),l=n.n(c),p=n(55),f=n.n(p),h=n(17),d=n.n(h),m=n(4),v=n.n(m),g=n(5),y=n.n(g),b=n(6),_=n.n(b),w=n(7),x=n.n(w),E=n(9),S=n.n(E),C=n(8),k=n.n(C),O=n(2),A=n.n(O),T=n(0),j=n.n(T);n(10),n(19);function P(e,t){var n=d()(e);if(f.a){var r=f()(e);t&&(r=r.filter(function(t){return l()(e,t).enumerable})),n.push.apply(n,r)}return n}var I=function(e){function t(){var e,n;v()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=_()(this,(e=x()(t)).call.apply(e,[this].concat(i))),A()(S()(n),"setSelectedServer",function(e){var t=n.props,r=t.path,o=t.method;return n.forceUpdate(),n.props.setSelectedServer(e,"".concat(r,":").concat(o))}),A()(S()(n),"setServerVariableValue",function(e){var t=n.props,r=t.path,i=t.method;return n.forceUpdate(),n.props.setServerVariableValue(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(n,!0).forEach(function(t){A()(e,t,n[t])}):u.a?a()(e,u()(n)):P(n).forEach(function(t){o()(e,t,l()(n,t))})}return e}({},e,{namespace:"".concat(r,":").concat(i)}))}),A()(S()(n),"getSelectedServer",function(){var e=n.props,t=e.path,r=e.method;return n.props.getSelectedServer("".concat(t,":").concat(r))}),A()(S()(n),"getServerVariable",function(e,t){var r=n.props,o=r.path,i=r.method;return n.props.getServerVariable({namespace:"".concat(o,":").concat(i),server:e},t)}),A()(S()(n),"getEffectiveServerValue",function(e){var t=n.props,r=t.path,o=t.method;return n.props.getEffectiveServerValue({server:e,namespace:"".concat(r,":").concat(o)})}),n}return k()(t,e),y()(t,[{key:"render",value:function(){var e=this.props,t=e.operationServers,n=e.pathServers,r=e.getComponent;if(!t&&!n)return null;var o=r("Servers"),i=t||n,a=t?"operation":"path";return j.a.createElement("div",{className:"opblock-section operation-servers"},j.a.createElement("div",{className:"opblock-section-header"},j.a.createElement("div",{className:"tab-header"},j.a.createElement("h4",{className:"opblock-title"},"Servers"))),j.a.createElement("div",{className:"opblock-description-wrapper"},j.a.createElement("h4",{className:"message"},"These ",a,"-level options override the global server options."),j.a.createElement(o,{servers:i,currentServer:this.getSelectedServer(),setSelectedServer:this.setSelectedServer,setServerVariableValue:this.setServerVariableValue,getServerVariable:this.getServerVariable,getEffectiveServerValue:this.getEffectiveServerValue})))}}]),t}(j.a.Component)},function(e,t,n){"use strict";n.r(t);var r=n(320),o=n(321),i=n(322),a=n(323),s=n(324),u=n(325);t.default={Markdown:r.default,AuthItem:o.default,JsonSchema_string:u.default,VersionStamp:i.default,model:s.default,onlineValidatorBadge:a.default}},function(e,t,n){"use strict";n.r(t),n.d(t,"Markdown",function(){return f});var r=n(0),o=n.n(r),i=(n(10),n(59)),a=n.n(i),s=n(195),u=n.n(s),c=n(24),l=n(194),p=new u.a("commonmark");p.block.ruler.enable(["table"]),p.set({linkTarget:"_blank"});var f=function(e){var t=e.source,n=e.className,r=void 0===n?"":n;if("string"!=typeof t)return null;if(t){var i,s=p.render(t),u=Object(l.b)(s);return"string"==typeof u&&(i=u.trim()),o.a.createElement("div",{dangerouslySetInnerHTML:{__html:i},className:a()(r,"renderedMarkdown")})}return null};t.default=Object(c.OAS3ComponentWrapFactory)(f)},function(e,t,n){"use strict";n.r(t);var r=n(40),o=n.n(r),i=n(0),a=n.n(i),s=n(24);t.default=Object(s.OAS3ComponentWrapFactory)(function(e){var t=e.Ori,n=o()(e,["Ori"]),r=n.schema,i=n.getComponent,s=n.errSelectors,u=n.authorized,c=n.onAuthChange,l=n.name,p=i("HttpAuth");return"http"===r.get("type")?a.a.createElement(p,{key:l,schema:r,name:l,errSelectors:s,authorized:u,getComponent:i,onChange:c}):a.a.createElement(t,n)})},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),i=n(24);t.default=Object(i.OAS3ComponentWrapFactory)(function(e){var t=e.Ori;return o.a.createElement("span",null,o.a.createElement(t,e),o.a.createElement("small",{style:{backgroundColor:"#89bf04"}},o.a.createElement("pre",{className:"version"},"OAS3")))})},function(e,t,n){"use strict";n.r(t);var r=n(24);t.default=Object(r.OAS3ComponentWrapFactory)(function(){return null})},function(e,t,n){"use strict";n.r(t);var r=n(20),o=n.n(r),i=n(4),a=n.n(i),s=n(5),u=n.n(s),c=n(6),l=n.n(c),p=n(7),f=n.n(p),h=n(8),d=n.n(h),m=n(0),v=n.n(m),g=(n(10),n(24)),y=n(196),b=function(e){function t(){return a()(this,t),l()(this,f()(t).apply(this,arguments))}return d()(t,e),u()(t,[{key:"render",value:function(){var e=this.props,t=e.getConfigs,n=["model-box"],r=null;return!0===e.schema.get("deprecated")&&(n.push("deprecated"),r=v.a.createElement("span",{className:"model-deprecated-warning"},"Deprecated:")),v.a.createElement("div",{className:n.join(" ")},r,v.a.createElement(y.a,o()({},this.props,{getConfigs:t,depth:1,expandDepth:this.props.expandDepth||0})))}}]),t}(m.Component);t.default=Object(g.OAS3ComponentWrapFactory)(b)},function(e,t,n){"use strict";n.r(t);var r=n(40),o=n.n(r),i=n(0),a=n.n(i),s=n(24);t.default=Object(s.OAS3ComponentWrapFactory)(function(e){var t=e.Ori,n=o()(e,["Ori"]),r=n.schema,i=n.getComponent,s=n.errors,u=n.onChange,c=r.type,l=r.format,p=i("Input");return"string"!==c||"binary"!==l&&"base64"!==l?a.a.createElement(t,n):a.a.createElement(p,{type:"file",className:s.length?"invalid":"",title:s.length?s:"",onChange:function(e){u(e.target.files[0])},disabled:t.isDisabled})})},function(e,t,n){"use strict";n.r(t),n.d(t,"selectedServer",function(){return a}),n.d(t,"requestBodyValue",function(){return s}),n.d(t,"activeExamplesMember",function(){return u}),n.d(t,"requestContentType",function(){return c}),n.d(t,"responseContentType",function(){return l}),n.d(t,"serverVariableValue",function(){return p}),n.d(t,"serverVariables",function(){return f}),n.d(t,"serverEffectiveValue",function(){return h});var r=n(1),o=n(24);function i(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(t){var r=t.getSystem().specSelectors.specJson();return Object(o.isOAS3)(r)?e.apply(void 0,n):null}}}var a=i(function(e,t){var n=t?[t,"selectedServer"]:["selectedServer"];return e.getIn(n)||""}),s=i(function(e,t,n){return e.getIn(["requestData",t,n,"bodyValue"])||null}),u=i(function(e,t,n,r,o){return e.getIn(["examples",t,n,r,o,"activeExample"])||null}),c=i(function(e,t,n){return e.getIn(["requestData",t,n,"requestContentType"])||null}),l=i(function(e,t,n){return e.getIn(["requestData",t,n,"responseContentType"])||null}),p=i(function(e,t,n){var r;if("string"!=typeof t){var o=t.server,i=t.namespace;r=i?[i,"serverVariableValues",o,n]:["serverVariableValues",o,n]}else{r=["serverVariableValues",t,n]}return e.getIn(r)||null}),f=i(function(e,t){var n;if("string"!=typeof t){var o=t.server,i=t.namespace;n=i?[i,"serverVariableValues",o]:["serverVariableValues",o]}else{n=["serverVariableValues",t]}return e.getIn(n)||Object(r.OrderedMap)()}),h=i(function(e,t){var n,o;if("string"!=typeof t){var i=t.server,a=t.namespace;o=i,n=a?e.getIn([a,"serverVariableValues",o]):e.getIn(["serverVariableValues",o])}else o=t,n=e.getIn(["serverVariableValues",o]);n=n||Object(r.OrderedMap)();var s=o;return n.map(function(e,t){s=s.replace(new RegExp("{".concat(t,"}"),"g"),e)}),s})},function(e,t,n){"use strict";n.r(t);var r,o=n(2),i=n.n(o),a=n(13),s=n.n(a),u=n(62);t.default=(r={},i()(r,u.UPDATE_SELECTED_SERVER,function(e,t){var n=t.payload,r=n.selectedServerUrl,o=n.namespace,i=o?[o,"selectedServer"]:["selectedServer"];return e.setIn(i,r)}),i()(r,u.UPDATE_REQUEST_BODY_VALUE,function(e,t){var n=t.payload,r=n.value,o=n.pathMethod,i=s()(o,2),a=i[0],u=i[1];return e.setIn(["requestData",a,u,"bodyValue"],r)}),i()(r,u.UPDATE_ACTIVE_EXAMPLES_MEMBER,function(e,t){var n=t.payload,r=n.name,o=n.pathMethod,i=n.contextType,a=n.contextName,u=s()(o,2),c=u[0],l=u[1];return e.setIn(["examples",c,l,i,a,"activeExample"],r)}),i()(r,u.UPDATE_REQUEST_CONTENT_TYPE,function(e,t){var n=t.payload,r=n.value,o=n.pathMethod,i=s()(o,2),a=i[0],u=i[1];return e.setIn(["requestData",a,u,"requestContentType"],r)}),i()(r,u.UPDATE_RESPONSE_CONTENT_TYPE,function(e,t){var n=t.payload,r=n.value,o=n.path,i=n.method;return e.setIn(["requestData",o,i,"responseContentType"],r)}),i()(r,u.UPDATE_SERVER_VARIABLE_VALUE,function(e,t){var n=t.payload,r=n.server,o=n.namespace,i=n.key,a=n.val,s=o?[o,"serverVariableValues",r,i]:["serverVariableValues",r,i];return e.setIn(s,a)}),r)},function(e,t,n){"use strict";n.r(t);var r=n(3),o=n(1033),i={};o.keys().forEach(function(e){if("./index.js"!==e){var t=o(e);i[Object(r.E)(e)]=t.default?t.default:t}}),t.default=i},function(e,t,n){"use strict";n.r(t);var r=n(147),o=n(121),i=n(296),a=n(297),s=n(298);n.d(t,"default",function(){return c});var u={getLocalConfig:function(){return Object(r.parseYamlConfig)('---\nurl: "https://petstore.swagger.io/v2/swagger.json"\ndom_id: "#swagger-ui"\nvalidatorUrl: "https://validator.swagger.io/validator"\n')}};function c(){return{statePlugins:{spec:{actions:i,selectors:u},configs:{reducers:s.default,actions:o,selectors:a}}}}},function(e,t,n){"use strict";(function(e,r){var o,i=n(468);o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var a=Object(i.a)(o);t.a=a}).call(this,n(36),n(592)(e))},function(e,t,n){"use strict";var r=n(396),o=n(398),i=n(700);e.exports=function(e){var t,a=r(arguments[1]);return a.normalizer||0!==(t=a.length=o(a.length,e.length,a.async))&&(a.primitive?!1===t?a.normalizer=n(727):t>1&&(a.normalizer=n(728)(t)):a.normalizer=!1===t?n(729)():1===t?n(733)():n(734)(t)),a.async&&n(735),a.promise&&n(736),a.dispose&&n(742),a.maxAge&&n(743),a.max&&n(746),a.refCounter&&n(748),i(e,a)}},function(e,t,n){e.exports=n(772)},function(e,t,n){var r=n(417);e.exports=function(e,t,n){return null==e?e:r(e,t,n)}},function(e,t,n){"use strict";t.__esModule=!0,t.connect=t.Provider=void 0;var r=i(n(891)),o=i(n(893));function i(e){return e&&e.__esModule?e:{default:e}}t.Provider=r.default,t.connect=o.default},function(e,t,n){e.exports=function(){"use strict";var e=Object.freeze||function(e){return e},t=e(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),n=e(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","audio","canvas","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","video","view","vkern"]),r=e(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),o=e(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),i=e(["#text"]),a=Object.freeze||function(e){return e},s=a(["accept","action","align","alt","autocomplete","background","bgcolor","border","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","coords","crossorigin","datetime","default","dir","disabled","download","enctype","face","for","headers","height","hidden","high","href","hreflang","id","integrity","ismap","label","lang","list","loop","low","max","maxlength","media","method","min","minlength","multiple","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","type","usemap","valign","value","width","xmlns"]),u=a(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),c=a(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),l=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),p=Object.hasOwnProperty,f=Object.setPrototypeOf,h=("undefined"!=typeof Reflect&&Reflect).apply;function d(e,t){f&&f(e,null);for(var n=t.length;n--;){var r=t[n];if("string"==typeof r){var o=r.toLowerCase();o!==r&&(Object.isFrozen(t)||(t[n]=o),r=o)}e[r]=!0}return e}function m(e){var t={},n=void 0;for(n in e)h(p,e,[n])&&(t[n]=e[n]);return t}h||(h=function(e,t,n){return e.apply(t,n)});var v=Object.seal||function(e){return e},g=v(/\{\{[\s\S]*|[\s\S]*\}\}/gm),y=v(/<%[\s\S]*|[\s\S]*%>/gm),b=v(/^data-[\-\w.\u00B7-\uFFFF]/),_=v(/^aria-[\-\w]+$/),w=v(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),x=v(/^(?:\w+script|data):/i),E=v(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g),S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function C(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var k=("undefined"!=typeof Reflect&&Reflect).apply,O=Array.prototype.slice,A=Object.freeze,T=function(){return"undefined"==typeof window?null:window};k||(k=function(e,t,n){return e.apply(t,n)});var j=function(e,t){if("object"!==(void 0===e?"undefined":S(e))||"function"!=typeof e.createPolicy)return null;var n=null;t.currentScript&&t.currentScript.hasAttribute("data-tt-policy-suffix")&&(n=t.currentScript.getAttribute("data-tt-policy-suffix"));var r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};return function e(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T(),p=function(t){return e(t)};if(p.version="2.0.7",p.removed=[],!a||!a.document||9!==a.document.nodeType)return p.isSupported=!1,p;var f=a.document,h=!1,v=!1,P=a.document,I=a.DocumentFragment,M=a.HTMLTemplateElement,N=a.Node,R=a.NodeFilter,D=a.NamedNodeMap,L=void 0===D?a.NamedNodeMap||a.MozNamedAttrMap:D,U=a.Text,q=a.Comment,F=a.DOMParser,B=a.TrustedTypes;if("function"==typeof M){var z=P.createElement("template");z.content&&z.content.ownerDocument&&(P=z.content.ownerDocument)}var V=j(B,f),H=V?V.createHTML(""):"",W=P,J=W.implementation,K=W.createNodeIterator,Y=W.getElementsByTagName,$=W.createDocumentFragment,G=f.importNode,Z={};p.isSupported=J&&void 0!==J.createHTMLDocument&&9!==P.documentMode;var X=g,Q=y,ee=b,te=_,ne=x,re=E,oe=w,ie=null,ae=d({},[].concat(C(t),C(n),C(r),C(o),C(i))),se=null,ue=d({},[].concat(C(s),C(u),C(c),C(l))),ce=null,le=null,pe=!0,fe=!0,he=!1,de=!1,me=!1,ve=!1,ge=!1,ye=!1,be=!1,_e=!1,we=!1,xe=!1,Ee=!0,Se=!0,Ce=!1,ke={},Oe=d({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ae=d({},["audio","video","img","source","image"]),Te=null,je=d({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),Pe=null,Ie=P.createElement("form"),Me=function(e){Pe&&Pe===e||(e&&"object"===(void 0===e?"undefined":S(e))||(e={}),ie="ALLOWED_TAGS"in e?d({},e.ALLOWED_TAGS):ae,se="ALLOWED_ATTR"in e?d({},e.ALLOWED_ATTR):ue,Te="ADD_URI_SAFE_ATTR"in e?d(m(je),e.ADD_URI_SAFE_ATTR):je,ce="FORBID_TAGS"in e?d({},e.FORBID_TAGS):{},le="FORBID_ATTR"in e?d({},e.FORBID_ATTR):{},ke="USE_PROFILES"in e&&e.USE_PROFILES,pe=!1!==e.ALLOW_ARIA_ATTR,fe=!1!==e.ALLOW_DATA_ATTR,he=e.ALLOW_UNKNOWN_PROTOCOLS||!1,de=e.SAFE_FOR_JQUERY||!1,me=e.SAFE_FOR_TEMPLATES||!1,ve=e.WHOLE_DOCUMENT||!1,be=e.RETURN_DOM||!1,_e=e.RETURN_DOM_FRAGMENT||!1,we=e.RETURN_DOM_IMPORT||!1,xe=e.RETURN_TRUSTED_TYPE||!1,ye=e.FORCE_BODY||!1,Ee=!1!==e.SANITIZE_DOM,Se=!1!==e.KEEP_CONTENT,Ce=e.IN_PLACE||!1,oe=e.ALLOWED_URI_REGEXP||oe,me&&(fe=!1),_e&&(be=!0),ke&&(ie=d({},[].concat(C(i))),se=[],!0===ke.html&&(d(ie,t),d(se,s)),!0===ke.svg&&(d(ie,n),d(se,u),d(se,l)),!0===ke.svgFilters&&(d(ie,r),d(se,u),d(se,l)),!0===ke.mathMl&&(d(ie,o),d(se,c),d(se,l))),e.ADD_TAGS&&(ie===ae&&(ie=m(ie)),d(ie,e.ADD_TAGS)),e.ADD_ATTR&&(se===ue&&(se=m(se)),d(se,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&d(Te,e.ADD_URI_SAFE_ATTR),Se&&(ie["#text"]=!0),ve&&d(ie,["html","head","body"]),ie.table&&(d(ie,["tbody"]),delete ce.tbody),A&&A(e),Pe=e)},Ne=function(e){p.removed.push({element:e});try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=H}},Re=function(e,t){try{p.removed.push({attribute:t.getAttributeNode(e),from:t})}catch(e){p.removed.push({attribute:null,from:t})}t.removeAttribute(e)},De=function(e){var t=void 0,n=void 0;if(ye)e="<remove></remove>"+e;else{var r=e.match(/^[\s]+/);(n=r&&r[0])&&(e=e.slice(n.length))}if(h)try{t=(new F).parseFromString(e,"text/html")}catch(e){}if(v&&d(ce,["title"]),!t||!t.documentElement){var o=(t=J.createHTMLDocument("")).body;o.parentNode.removeChild(o.parentNode.firstElementChild),o.outerHTML=V?V.createHTML(e):e}return e&&n&&t.body.insertBefore(P.createTextNode(n),t.body.childNodes[0]||null),Y.call(t,ve?"html":"body")[0]};p.isSupported&&(function(){try{De('<svg><p><textarea><img src="</textarea><img src=x abc=1//">').querySelector("svg img")&&(h=!0)}catch(e){}}(),function(){try{var e=De("<x/><title></title><img>");/<\/title/.test(e.querySelector("title").innerHTML)&&(v=!0)}catch(e){}}());var Le=function(e){return K.call(e.ownerDocument||e,e,R.SHOW_ELEMENT|R.SHOW_COMMENT|R.SHOW_TEXT,function(){return R.FILTER_ACCEPT},!1)},Ue=function(e){return"object"===(void 0===N?"undefined":S(N))?e instanceof N:e&&"object"===(void 0===e?"undefined":S(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},qe=function(e,t,n){Z[e]&&Z[e].forEach(function(e){e.call(p,t,n,Pe)})},Fe=function(e){var t,n=void 0;if(qe("beforeSanitizeElements",e,null),!((t=e)instanceof U||t instanceof q||"string"==typeof t.nodeName&&"string"==typeof t.textContent&&"function"==typeof t.removeChild&&t.attributes instanceof L&&"function"==typeof t.removeAttribute&&"function"==typeof t.setAttribute&&"string"==typeof t.namespaceURI))return Ne(e),!0;var r=e.nodeName.toLowerCase();if(qe("uponSanitizeElement",e,{tagName:r,allowedTags:ie}),("svg"===r||"math"===r)&&0!==e.querySelectorAll("p, br").length)return Ne(e),!0;if(!ie[r]||ce[r]){if(Se&&!Oe[r]&&"function"==typeof e.insertAdjacentHTML)try{var o=e.innerHTML;e.insertAdjacentHTML("AfterEnd",V?V.createHTML(o):o)}catch(e){}return Ne(e),!0}return"noscript"===r&&/<\/noscript/i.test(e.innerHTML)?(Ne(e),!0):"noembed"===r&&/<\/noembed/i.test(e.innerHTML)?(Ne(e),!0):(!de||e.firstElementChild||e.content&&e.content.firstElementChild||!/</g.test(e.textContent)||(p.removed.push({element:e.cloneNode()}),e.innerHTML?e.innerHTML=e.innerHTML.replace(/</g,"<"):e.innerHTML=e.textContent.replace(/</g,"<")),me&&3===e.nodeType&&(n=(n=(n=e.textContent).replace(X," ")).replace(Q," "),e.textContent!==n&&(p.removed.push({element:e.cloneNode()}),e.textContent=n)),qe("afterSanitizeElements",e,null),!1)},Be=function(e,t,n){if(Ee&&("id"===t||"name"===t)&&(n in P||n in Ie))return!1;if(fe&&ee.test(t));else if(pe&&te.test(t));else{if(!se[t]||le[t])return!1;if(Te[t]);else if(oe.test(n.replace(re,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==n.indexOf("data:")||!Ae[e])if(he&&!ne.test(n.replace(re,"")));else if(n)return!1}return!0},ze=function(e){var t=void 0,n=void 0,r=void 0,o=void 0,i=void 0;qe("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:se};for(i=a.length;i--;){var u=t=a[i],c=u.name,l=u.namespaceURI;if(n=t.value.trim(),r=c.toLowerCase(),s.attrName=r,s.attrValue=n,s.keepAttr=!0,qe("uponSanitizeAttribute",e,s),n=s.attrValue,"name"===r&&"IMG"===e.nodeName&&a.id)o=a.id,a=k(O,a,[]),Re("id",e),Re(c,e),a.indexOf(o)>i&&e.setAttribute("id",o.value);else{if("INPUT"===e.nodeName&&"type"===r&&"file"===n&&s.keepAttr&&(se[r]||!le[r]))continue;"id"===c&&e.setAttribute(c,""),Re(c,e)}if(s.keepAttr)if(/svg|math/i.test(e.namespaceURI)&&new RegExp("</("+Object.keys(Oe).join("|")+")","i").test(n))Re(c,e);else{me&&(n=(n=n.replace(X," ")).replace(Q," "));var f=e.nodeName.toLowerCase();if(Be(f,r,n))try{l?e.setAttributeNS(l,c,n):e.setAttribute(c,n),p.removed.pop()}catch(e){}}}qe("afterSanitizeAttributes",e,null)}},Ve=function e(t){var n=void 0,r=Le(t);for(qe("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)qe("uponSanitizeShadowNode",n,null),Fe(n)||(n.content instanceof I&&e(n.content),ze(n));qe("afterSanitizeShadowDOM",t,null)};return p.sanitize=function(e,t){var n=void 0,r=void 0,o=void 0,i=void 0,s=void 0;if(e||(e="\x3c!--\x3e"),"string"!=typeof e&&!Ue(e)){if("function"!=typeof e.toString)throw new TypeError("toString is not a function");if("string"!=typeof(e=e.toString()))throw new TypeError("dirty is not a string, aborting")}if(!p.isSupported){if("object"===S(a.toStaticHTML)||"function"==typeof a.toStaticHTML){if("string"==typeof e)return a.toStaticHTML(e);if(Ue(e))return a.toStaticHTML(e.outerHTML)}return e}if(ge||Me(t),p.removed=[],Ce);else if(e instanceof N)1===(r=(n=De("\x3c!--\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===r.nodeName?n=r:"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!be&&!me&&!ve&&xe&&-1===e.indexOf("<"))return V?V.createHTML(e):e;if(!(n=De(e)))return be?null:H}n&&ye&&Ne(n.firstChild);for(var u=Le(Ce?e:n);o=u.nextNode();)3===o.nodeType&&o===i||Fe(o)||(o.content instanceof I&&Ve(o.content),ze(o),i=o);if(i=null,Ce)return e;if(be){if(_e)for(s=$.call(n.ownerDocument);n.firstChild;)s.appendChild(n.firstChild);else s=n;return we&&(s=G.call(f,s,!0)),s}var c=ve?n.outerHTML:n.innerHTML;return me&&(c=(c=c.replace(X," ")).replace(Q," ")),V&&xe?V.createHTML(c):c},p.setConfig=function(e){Me(e),ge=!0},p.clearConfig=function(){Pe=null,ge=!1},p.isValidAttribute=function(e,t,n){Pe||Me({});var r=e.toLowerCase(),o=t.toLowerCase();return Be(r,o,n)},p.addHook=function(e,t){"function"==typeof t&&(Z[e]=Z[e]||[],Z[e].push(t))},p.removeHook=function(e){Z[e]&&Z[e].pop()},p.removeHooks=function(e){Z[e]&&(Z[e]=[])},p.removeAllHooks=function(){Z={}},p}()}()},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){"use strict";var r=n(201)(!0);n(338)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){"use strict";var r=n(198),o=n(35),i=n(97),a=n(81),s=n(128),u=n(495),c=n(203),l=n(501),p=n(33)("iterator"),f=!([].keys&&"next"in[].keys()),h=function(){return this};e.exports=function(e,t,n,d,m,v,g){u(n,t,d);var y,b,_,w=function(e){if(!f&&e in C)return C[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",E="values"==m,S=!1,C=e.prototype,k=C[p]||C["@@iterator"]||m&&C[m],O=k||w(m),A=m?E?w("entries"):O:void 0,T="Array"==t&&C.entries||k;if(T&&(_=l(T.call(new e)))!==Object.prototype&&_.next&&(c(_,x,!0),r||"function"==typeof _[p]||a(_,p,h)),E&&k&&"values"!==k.name&&(S=!0,O=function(){return k.call(this)}),r&&!g||!f&&!S&&C[p]||a(C,p,O),s[t]=O,s[x]=h,m)if(y={values:E?O:w("values"),keys:v?O:w("keys"),entries:A},g)for(b in y)b in C||i(C,b,y[b]);else o(o.P+o.F*(f||S),t,y);return y}},function(e,t,n){var r=n(498),o=n(341);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(127),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(41).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(73);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r,o,i,a=n(153),s=n(512),u=n(342),c=n(200),l=n(41),p=l.process,f=l.setImmediate,h=l.clearImmediate,d=l.MessageChannel,m=l.Dispatch,v=0,g={},y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},b=function(e){y.call(e.data)};f&&h||(f=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},r(v),v},h=function(e){delete g[e]},"process"==n(125)(p)?r=function(e){p.nextTick(a(y,e,1))}:m&&m.now?r=function(e){m.now(a(y,e,1))}:d?(i=(o=new d).port2,o.port1.onmessage=b,r=a(i.postMessage,i,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(e){l.postMessage(e+"","*")},l.addEventListener("message",b,!1)):r="onreadystatechange"in c("script")?function(e){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:f,clear:h}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(45),o=n(98),i=n(205);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){var r=n(98),o=n(125),i=n(33)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},function(e,t,n){var r=n(75),o=n(76),i=n(555)(!1),a=n(213)("IE_PROTO");e.exports=function(e,t){var n,s=o(e),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~i(c,n)||c.push(n));return c}},function(e,t,n){e.exports=!n(50)&&!n(82)(function(){return 7!=Object.defineProperty(n(217)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(49),o=n(46),i=n(129);e.exports=n(50)?Object.defineProperties:function(e,t){o(e);for(var n,a=i(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(32).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(75),o=n(100),i=n(213)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){"use strict";var r=n(32),o=n(75),i=n(50),a=n(30),s=n(220),u=n(135).KEY,c=n(82),l=n(214),p=n(134),f=n(159),h=n(34),d=n(221),m=n(222),v=n(565),g=n(223),y=n(46),b=n(43),_=n(76),w=n(218),x=n(133),E=n(160),S=n(566),C=n(163),k=n(49),O=n(129),A=C.f,T=k.f,j=S.f,P=r.Symbol,I=r.JSON,M=I&&I.stringify,N=h("_hidden"),R=h("toPrimitive"),D={}.propertyIsEnumerable,L=l("symbol-registry"),U=l("symbols"),q=l("op-symbols"),F=Object.prototype,B="function"==typeof P,z=r.QObject,V=!z||!z.prototype||!z.prototype.findChild,H=i&&c(function(){return 7!=E(T({},"a",{get:function(){return T(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=A(F,t);r&&delete F[t],T(e,t,n),r&&e!==F&&T(F,t,r)}:T,W=function(e){var t=U[e]=E(P.prototype);return t._k=e,t},J=B&&"symbol"==typeof P.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof P},K=function(e,t,n){return e===F&&K(q,t,n),y(e),t=w(t,!0),y(n),o(U,t)?(n.enumerable?(o(e,N)&&e[N][t]&&(e[N][t]=!1),n=E(n,{enumerable:x(0,!1)})):(o(e,N)||T(e,N,x(1,{})),e[N][t]=!0),H(e,t,n)):T(e,t,n)},Y=function(e,t){y(e);for(var n,r=v(t=_(t)),o=0,i=r.length;i>o;)K(e,n=r[o++],t[n]);return e},$=function(e){var t=D.call(this,e=w(e,!0));return!(this===F&&o(U,e)&&!o(q,e))&&(!(t||!o(this,e)||!o(U,e)||o(this,N)&&this[N][e])||t)},G=function(e,t){if(e=_(e),t=w(t,!0),e!==F||!o(U,t)||o(q,t)){var n=A(e,t);return!n||!o(U,t)||o(e,N)&&e[N][t]||(n.enumerable=!0),n}},Z=function(e){for(var t,n=j(_(e)),r=[],i=0;n.length>i;)o(U,t=n[i++])||t==N||t==u||r.push(t);return r},X=function(e){for(var t,n=e===F,r=j(n?q:_(e)),i=[],a=0;r.length>a;)!o(U,t=r[a++])||n&&!o(F,t)||i.push(U[t]);return i};B||(s((P=function(){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(n){this===F&&t.call(q,n),o(this,N)&&o(this[N],e)&&(this[N][e]=!1),H(this,e,x(1,n))};return i&&V&&H(F,e,{configurable:!0,set:t}),W(e)}).prototype,"toString",function(){return this._k}),C.f=G,k.f=K,n(224).f=S.f=Z,n(162).f=$,n(161).f=X,i&&!n(131)&&s(F,"propertyIsEnumerable",$,!0),d.f=function(e){return W(h(e))}),a(a.G+a.W+a.F*!B,{Symbol:P});for(var Q="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;Q.length>ee;)h(Q[ee++]);for(var te=O(h.store),ne=0;te.length>ne;)m(te[ne++]);a(a.S+a.F*!B,"Symbol",{for:function(e){return o(L,e+="")?L[e]:L[e]=P(e)},keyFor:function(e){if(!J(e))throw TypeError(e+" is not a symbol!");for(var t in L)if(L[t]===e)return t},useSetter:function(){V=!0},useSimple:function(){V=!1}}),a(a.S+a.F*!B,"Object",{create:function(e,t){return void 0===t?E(e):Y(E(e),t)},defineProperty:K,defineProperties:Y,getOwnPropertyDescriptor:G,getOwnPropertyNames:Z,getOwnPropertySymbols:X}),I&&a(a.S+a.F*(!B||c(function(){var e=P();return"[null]"!=M([e])||"{}"!=M({a:e})||"{}"!=M(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=t=r[1],(b(t)||void 0!==e)&&!J(e))return g(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!J(t))return t}),r[1]=t,M.apply(I,r)}}),P.prototype[R]||n(77)(P.prototype,R,P.prototype.valueOf),p(P,"Symbol"),p(Math,"Math",!0),p(r.JSON,"JSON",!0)},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";var r=n(129),o=n(161),i=n(162),a=n(100),s=n(211),u=Object.assign;e.exports=!u||n(82)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=u({},e)[n]||Object.keys(u({},t)).join("")!=r})?function(e,t){for(var n=a(e),u=arguments.length,c=1,l=o.f,p=i.f;u>c;)for(var f,h=s(arguments[c++]),d=l?r(h).concat(l(h)):r(h),m=d.length,v=0;m>v;)p.call(h,f=d[v++])&&(n[f]=h[f]);return n}:u},function(e,t,n){"use strict";var r=n(136),o=n(25),i=n(358),a=(n(359),n(165));n(15),n(577);function s(e,t,n){this.props=e,this.context=t,this.refs=a,this.updater=n||i}function u(e,t,n){this.props=e,this.context=t,this.refs=a,this.updater=n||i}function c(){}s.prototype.isReactComponent={},s.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&r("85"),this.updater.enqueueSetState(this,e),t&&this.updater.enqueueCallback(this,t,"setState")},s.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this),e&&this.updater.enqueueCallback(this,e,"forceUpdate")},c.prototype=s.prototype,u.prototype=new c,u.prototype.constructor=u,o(u.prototype,s.prototype),u.prototype.isPureReactComponent=!0,e.exports={Component:s,PureComponent:u}},function(e,t,n){"use strict";n(23);var r={isMounted:function(e){return!1},enqueueCallback:function(e,t){},enqueueForceUpdate:function(e){},enqueueReplaceState:function(e,t){},enqueueSetState:function(e,t){}};e.exports=r},function(e,t,n){"use strict";e.exports=!1},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";var r=n(585);e.exports=function(e){return r(e,!1)}},function(e,t,n){"use strict";e.exports=n(586)},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e&&"@@redux/INIT"===e.type?"initialState argument passed to createStore":"previous state received by the reducer"},e.exports=t.default},function(e,t,n){var r=n(106),o=n(367),i=n(37),a=n(167),s=1/0,u=r?r.prototype:void 0,c=u?u.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(a(t))return c?c.call(t):"";var n=t+"";return"0"==n&&1/t==-s?"-0":n}},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(36))},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},function(e,t){e.exports=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}},function(e,t){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return n.test(e)}},function(e,t){e.exports=function(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}},function(e,t,n){var r=n(83),o=n(52),i="[object AsyncFunction]",a="[object Function]",s="[object GeneratorFunction]",u="[object Proxy]";e.exports=function(e){if(!o(e))return!1;var t=r(e);return t==a||t==s||t==i||t==u}},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(647),o=n(66);e.exports=function e(t,n,i,a,s){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,i,a,e,s))}},function(e,t,n){var r=n(648),o=n(375),i=n(651),a=1,s=2;e.exports=function(e,t,n,u,c,l){var p=n&a,f=e.length,h=t.length;if(f!=h&&!(p&&h>f))return!1;var d=l.get(e);if(d&&l.get(t))return d==t;var m=-1,v=!0,g=n&s?new r:void 0;for(l.set(e,t),l.set(t,e);++m<f;){var y=e[m],b=t[m];if(u)var _=p?u(b,y,m,t,e,l):u(y,b,m,e,t,l);if(void 0!==_){if(_)continue;v=!1;break}if(g){if(!o(t,function(e,t){if(!i(g,t)&&(y===e||c(y,e,n,u,l)))return g.push(t)})){v=!1;break}}else if(y!==b&&!c(y,b,n,u,l)){v=!1;break}}return l.delete(e),l.delete(t),v}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t,n){var r=n(51).Uint8Array;e.exports=r},function(e,t,n){var r=n(378),o=n(230),i=n(85);e.exports=function(e){return r(e,i,o)}},function(e,t,n){var r=n(229),o=n(37);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(657),o=n(231),i=n(37),a=n(232),s=n(174),u=n(381),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),l=!n&&o(e),p=!n&&!l&&a(e),f=!n&&!l&&!p&&u(e),h=n||l||p||f,d=h?r(e.length,String):[],m=d.length;for(var v in e)!t&&!c.call(e,v)||h&&("length"==v||p&&("offset"==v||"parent"==v)||f&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,m))||d.push(v);return d}},function(e,t,n){var r=n(660),o=n(234),i=n(235),a=i&&i.isTypedArray,s=a?o(a):r;e.exports=s},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(52);e.exports=function(e){return e==e&&!r(e)}},function(e,t){e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},function(e,t,n){var r=n(671),o=n(672);e.exports=function(e,t){return null!=e&&o(e,t,r)}},function(e,t,n){var r=n(678);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},function(e,t,n){var r=n(52),o=n(167),i=NaN,a=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return i;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var n=u.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):s.test(e)?i:+e}},function(e,t,n){var r=n(680),o=n(683)(r);e.exports=o},function(e,t,n){var r=n(91),o=n(107),i=n(174),a=n(52);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?o(n)&&i(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},function(e,t,n){"use strict";(function(t,r){var o=n(178);e.exports=b;var i,a=n(355);b.ReadableState=y;n(238).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=n(391),c=n(48).Buffer,l=t.Uint8Array||function(){};var p=n(137);p.inherits=n(47);var f=n(686),h=void 0;h=f&&f.debuglog?f.debuglog("stream"):function(){};var d,m=n(687),v=n(392);p.inherits(b,u);var g=["error","close","destroy","pause","resume"];function y(e,t){e=e||{};var r=t instanceof(i=i||n(86));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var o=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(d||(d=n(394).StringDecoder),this.decoder=new d(e.encoding),this.encoding=e.encoding)}function b(e){if(i=i||n(86),!(this instanceof b))return new b(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function _(e,t,n,r,o){var i,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,S(e)}(e,a)):(o||(i=function(e,t){var n;r=t,c.isBuffer(r)||r instanceof l||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(a,t)),i?e.emit("error",i):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?w(e,a,t,!1):k(e,a)):w(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function w(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&S(e)),k(e,t)}Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),b.prototype.destroy=v.destroy,b.prototype._undestroy=v.undestroy,b.prototype._destroy=function(e,t){this.push(null),t(e)},b.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=c.from(e,t),t=""),n=!0),_(this,e,t,!1,n)},b.prototype.unshift=function(e){return _(this,e,null,!0,!1)},b.prototype.isPaused=function(){return!1===this._readableState.flowing},b.prototype.setEncoding=function(e){return d||(d=n(394).StringDecoder),this._readableState.decoder=new d(e),this._readableState.encoding=e,this};var x=8388608;function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=x?e=x:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function S(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?o.nextTick(C,e):C(e))}function C(e){h("emit readable"),e.emit("readable"),j(e)}function k(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(O,e,t))}function O(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function A(e){h("readable nexttick read 0"),e.read(0)}function T(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),j(e),t.flowing&&!t.reading&&e.read(0)}function j(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function P(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,o=n.data;e-=o.length;for(;n=n.next;){var i=n.data,a=e>i.length?i.length:e;if(a===i.length?o+=i:o+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(a));break}++r}return t.length-=r,o}(e,t):function(e,t){var n=c.allocUnsafe(e),r=t.head,o=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(n,n.length-e,0,a),0===(e-=a)){a===i.length?(++o,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(a));break}++o}return t.length-=o,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function I(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,o.nextTick(M,t,e))}function M(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function N(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}b.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):S(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&I(this),null;var r,o=t.needReadable;return h("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",o=!0),t.ended||t.reading?h("reading or ended",o=!1):o&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(n,t))),null===(r=e>0?P(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&I(this)),null!==r&&this.emit("data",r),r},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?l:b;function c(t,r){h("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",p),e.removeListener("error",v),e.removeListener("unpipe",c),n.removeListener("end",l),n.removeListener("end",b),n.removeListener("data",m),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||p())}function l(){h("onend"),e.end()}i.endEmitted?o.nextTick(u):n.once("end",u),e.on("unpipe",c);var p=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,j(e))}}(n);e.on("drain",p);var f=!1;var d=!1;function m(t){h("ondata"),d=!1,!1!==e.write(t)||d||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==N(i.pipes,e))&&!f&&(h("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function v(t){h("onerror",t),b(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),b()}function y(){h("onfinish"),e.removeListener("close",g),b()}function b(){h("unpipe"),n.unpipe(e)}return n.on("data",m),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",v),e.once("close",g),e.once("finish",y),e.emit("pipe",n),i.flowing||(h("pipe resume"),n.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)r[i].emit("unpipe",this,n);return this}var a=N(t.pipes,e);return-1===a?this:(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n),this)},b.prototype.on=function(e,t){var n=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&S(this):o.nextTick(A,this))}return n},b.prototype.addListener=b.prototype.on,b.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(T,e,t))}(this,e)),this},b.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},b.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",function(){if(h("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){(h("wrapped data"),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&null==o)||(n.objectMode||o&&o.length)&&(t.push(o)||(r=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i<g.length;i++)e.on(g[i],this.emit.bind(this,g[i]));return this._read=function(t){h("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),b._fromList=P}).call(this,n(36),n(67))},function(e,t,n){e.exports=n(238).EventEmitter},function(e,t,n){"use strict";var r=n(178);function o(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,i=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return i||a?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(o,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(r.nextTick(o,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(689),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(36))},function(e,t,n){"use strict";var r=n(48).Buffer,o=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=p,t=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var o=a(t[r]);if(o>=0)return o>0&&(e.lastNeed=o-1),o;if(--r<n||-2===o)return 0;if((o=a(t[r]))>=0)return o>0&&(e.lastNeed=o-2),o;if(--r<n||-2===o)return 0;if((o=a(t[r]))>=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=a;var r=n(86),o=n(137);function i(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);r.call(this,e),this._transformState={afterTransform:i.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush(function(t,n){u(e,t,n)}):u(this,null,null)}function u(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}o.inherits=n(47),o.inherits(a,r),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var o=this._readableState;(r.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,function(e){t(e),n.emit("close")})}},function(e,t,n){"use strict";var r=n(87),o=Array.prototype.forEach,i=Object.create,a=function(e,t){var n;for(n in e)t[n]=e[n]};e.exports=function(e){var t=i(null);return o.call(arguments,function(e){r(e)&&a(Object(e),t)}),t}},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";var r=n(88);e.exports=function(e,t,n){var o;return isNaN(e)?(o=t)>=0?n&&o?o-1:o:1:!1!==e&&r(e)}},function(e,t,n){"use strict";e.exports=n(704)()?Object.assign:n(705)},function(e,t,n){"use strict";var r,o,i,a,s,u=n(88),c=function(e,t){return t};try{Object.defineProperty(c,"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch(e){}1===c.length?(r={configurable:!0,writable:!1,enumerable:!1},o=Object.defineProperty,e.exports=function(e,t){return t=u(t),e.length===t?e:(r.value=t,o(e,"length",r))}):(a=n(401),s=[],i=function(e){var t,n=0;if(s[e])return s[e];for(t=[];e--;)t.push("a"+(++n).toString(36));return new Function("fn","return function ("+t.join(", ")+") { return fn.apply(this, arguments); };")},e.exports=function(e,t){var n;if(t=u(t),e.length===t)return e;n=i(t)(e);try{a(n,e)}catch(e){}return n})},function(e,t,n){"use strict";var r=n(110),o=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols;e.exports=function(e,t){var n,u=Object(r(t));if(e=Object(r(e)),a(u).forEach(function(r){try{o(e,r,i(t,r))}catch(e){n=e}}),"function"==typeof s&&s(u).forEach(function(r){try{o(e,r,i(t,r))}catch(e){n=e}}),void 0!==n)throw n;return e}},function(e,t,n){"use strict";var r=n(78),o=n(179),i=Function.prototype.call;e.exports=function(e,t){var n={},a=arguments[2];return r(t),o(e,function(e,r,o,s){n[r]=i.call(t,a,e,r,o,s)}),n}},function(e,t){e.exports=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}},function(e,t,n){var r=n(47),o=n(111),i=n(48).Buffer,a=[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],s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}function c(e,t,n){return n^e&(t^n)}function l(e,t,n){return e&t|n&(e|t)}function p(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function f(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}r(u,o),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,o=0|this._b,i=0|this._c,s=0|this._d,u=0|this._e,d=0|this._f,m=0|this._g,v=0|this._h,g=0;g<16;++g)n[g]=e.readInt32BE(4*g);for(;g<64;++g)n[g]=0|(((t=n[g-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+n[g-7]+h(n[g-15])+n[g-16];for(var y=0;y<64;++y){var b=v+f(u)+c(u,d,m)+a[y]+n[y]|0,_=p(r)+l(r,o,i)|0;v=m,m=d,d=u,u=s+b|0,s=i,i=o,o=r,r=b+_|0}this._a=r+this._a|0,this._b=o+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=d+this._f|0,this._g=m+this._g|0,this._h=v+this._h|0},u.prototype._hash=function(){var e=i.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},function(e,t,n){var r=n(47),o=n(111),i=n(48).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}function c(e,t,n){return n^e&(t^n)}function l(e,t,n){return e&t|n&(e|t)}function p(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function f(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function v(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return e>>>0<t>>>0?1:0}r(u,o),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(e){for(var t=this._w,n=0|this._ah,r=0|this._bh,o=0|this._ch,i=0|this._dh,s=0|this._eh,u=0|this._fh,y=0|this._gh,b=0|this._hh,_=0|this._al,w=0|this._bl,x=0|this._cl,E=0|this._dl,S=0|this._el,C=0|this._fl,k=0|this._gl,O=0|this._hl,A=0;A<32;A+=2)t[A]=e.readInt32BE(4*A),t[A+1]=e.readInt32BE(4*A+4);for(;A<160;A+=2){var T=t[A-30],j=t[A-30+1],P=h(T,j),I=d(j,T),M=m(T=t[A-4],j=t[A-4+1]),N=v(j,T),R=t[A-14],D=t[A-14+1],L=t[A-32],U=t[A-32+1],q=I+D|0,F=P+R+g(q,I)|0;F=(F=F+M+g(q=q+N|0,N)|0)+L+g(q=q+U|0,U)|0,t[A]=F,t[A+1]=q}for(var B=0;B<160;B+=2){F=t[B],q=t[B+1];var z=l(n,r,o),V=l(_,w,x),H=p(n,_),W=p(_,n),J=f(s,S),K=f(S,s),Y=a[B],$=a[B+1],G=c(s,u,y),Z=c(S,C,k),X=O+K|0,Q=b+J+g(X,O)|0;Q=(Q=(Q=Q+G+g(X=X+Z|0,Z)|0)+Y+g(X=X+$|0,$)|0)+F+g(X=X+q|0,q)|0;var ee=W+V|0,te=H+z+g(ee,W)|0;b=y,O=k,y=u,k=C,u=s,C=S,s=i+Q+g(S=E+X|0,E)|0,i=o,E=x,o=r,x=w,r=n,w=_,n=Q+te+g(_=X+ee|0,X)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+x|0,this._dl=this._dl+E|0,this._el=this._el+S|0,this._fl=this._fl+C|0,this._gl=this._gl+k|0,this._hl=this._hl+O|0,this._ah=this._ah+n+g(this._al,_)|0,this._bh=this._bh+r+g(this._bl,w)|0,this._ch=this._ch+o+g(this._cl,x)|0,this._dh=this._dh+i+g(this._dl,E)|0,this._eh=this._eh+s+g(this._el,S)|0,this._fh=this._fh+u+g(this._fl,C)|0,this._gh=this._gh+y+g(this._gl,k)|0,this._hh=this._hh+b+g(this._hl,O)|0},u.prototype._hash=function(){var e=i.allocUnsafe(64);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},function(e,t,n){var r=n(46);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){var r=n(102),o=n(34)("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[o]===e)}},function(e,t,n){"use strict";var r=n(49),o=n(133);e.exports=function(e,t,n){t in e?r.f(e,t,o(0,n)):e[t]=n}},function(e,t,n){var r=n(34)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],a=i[r]();a.next=function(){return{done:n=!0}},i[r]=function(){return a},e(i)}catch(e){}return n}},function(e,t,n){var r=n(46),o=n(132),i=n(34)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||null==(n=r(a)[i])?t:o(n)}},function(e,t,n){var r,o,i,a=n(63),s=n(776),u=n(351),c=n(217),l=n(32),p=l.process,f=l.setImmediate,h=l.clearImmediate,d=l.MessageChannel,m=l.Dispatch,v=0,g={},y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},b=function(e){y.call(e.data)};f&&h||(f=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},r(v),v},h=function(e){delete g[e]},"process"==n(130)(p)?r=function(e){p.nextTick(a(y,e,1))}:m&&m.now?r=function(e){m.now(a(y,e,1))}:d?(i=(o=new d).port2,o.port1.onmessage=b,r=a(i.postMessage,i,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(e){l.postMessage(e+"","*")},l.addEventListener("message",b,!1)):r="onreadystatechange"in c("script")?function(e){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:f,clear:h}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(46),o=n(43),i=n(245);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";var r=n(32),o=n(22),i=n(49),a=n(50),s=n(34)("species");e.exports=function(e){var t="function"==typeof o[e]?o[e]:r[e];a&&t&&!t[s]&&i.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){"use strict";var r=n(114);e.exports=new r({include:[n(416)]})},function(e,t,n){"use strict";var r=n(114);e.exports=new r({include:[n(246)],implicit:[n(788),n(789),n(790),n(791)]})},function(e,t,n){var r=n(184),o=n(108),i=n(174),a=n(52),s=n(109);e.exports=function(e,t,n,u){if(!a(e))return e;for(var c=-1,l=(t=o(t,e)).length,p=l-1,f=e;null!=f&&++c<l;){var h=s(t[c]),d=n;if(c!=p){var m=f[h];void 0===(d=u?u(m,h,f):void 0)&&(d=a(m)?m:i(t[c+1])?[]:{})}r(f,h,d),f=f[h]}return e}},function(e,t,n){var r=n(419);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(84),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},function(e,t,n){e.exports=n(809)},function(e,t,n){e.exports=n(812)},function(e,t,n){"use strict";e.exports={hasCachedChildNodes:1}},function(e,t,n){"use strict";var r=n(21);n(15);e.exports=function(e,t){return null==t&&r("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}},function(e,t,n){"use strict";e.exports=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}},function(e,t,n){"use strict";var r=n(38),o=null;e.exports=function(){return!o&&r.canUseDOM&&(o="textContent"in document.documentElement?"textContent":"innerText"),o}},function(e,t,n){"use strict";var r=n(21);var o=n(90),i=(n(15),function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._callbacks=null,this._contexts=null,this._arg=t}return e.prototype.enqueue=function(e,t){this._callbacks=this._callbacks||[],this._callbacks.push(e),this._contexts=this._contexts||[],this._contexts.push(t)},e.prototype.notifyAll=function(){var e=this._callbacks,t=this._contexts,n=this._arg;if(e&&t){e.length!==t.length&&r("24"),this._callbacks=null,this._contexts=null;for(var o=0;o<e.length;o++)e[o].call(t[o],n);e.length=0,t.length=0}},e.prototype.checkpoint=function(){return this._callbacks?this._callbacks.length:0},e.prototype.rollback=function(e){this._callbacks&&this._contexts&&(this._callbacks.length=e,this._contexts.length=e)},e.prototype.reset=function(){this._callbacks=null,this._contexts=null},e.prototype.destructor=function(){this.reset()},e}());e.exports=o.addPoolingTo(i)},function(e,t,n){"use strict";e.exports={logTopLevelRenders:!1}},function(e,t,n){"use strict";var r=n(27);function o(e){var t=e.type,n=e.nodeName;return n&&"input"===n.toLowerCase()&&("checkbox"===t||"radio"===t)}function i(e){return e._wrapperState.valueTracker}var a={_getTrackerFromNode:function(e){return i(r.getInstanceFromNode(e))},track:function(e){if(!i(e)){var t=r.getNodeFromInstance(e),n=o(t)?"checked":"value",a=Object.getOwnPropertyDescriptor(t.constructor.prototype,n),s=""+t[n];t.hasOwnProperty(n)||"function"!=typeof a.get||"function"!=typeof a.set||(Object.defineProperty(t,n,{enumerable:a.enumerable,configurable:!0,get:function(){return a.get.call(this)},set:function(e){s=""+e,a.set.call(this,e)}}),function(e,t){e._wrapperState.valueTracker=t}(e,{getValue:function(){return s},setValue:function(e){s=""+e},stopTracking:function(){!function(e){e._wrapperState.valueTracker=null}(e),delete t[n]}}))}},updateValueIfChanged:function(e){if(!e)return!1;var t=i(e);if(!t)return a.track(e),!0;var n,s,u=t.getValue(),c=((n=r.getNodeFromInstance(e))&&(s=o(n)?""+n.checked:n.value),s);return c!==u&&(t.setValue(c),!0)},stopTracking:function(e){var t=i(e);t&&t.stopTracking()}};e.exports=a},function(e,t,n){"use strict";var r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};e.exports=function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!r[e.type]:"textarea"===t}},function(e,t,n){"use strict";var r={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){r.currentScrollLeft=e.x,r.currentScrollTop=e.y}};e.exports=r},function(e,t,n){"use strict";var r=n(38),o=n(188),i=n(187),a=function(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(a=function(e,t){3!==e.nodeType?i(e,o(t)):e.nodeValue=t})),e.exports=a},function(e,t,n){"use strict";e.exports=function(e){try{e.focus()}catch(e){}}},function(e,t,n){"use strict";var r={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};var o=["Webkit","ms","Moz","O"];Object.keys(r).forEach(function(e){o.forEach(function(t){r[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(t,e)]=r[e]})});var i={isUnitlessNumber:r,shorthandPropertyExpansions:{background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}}};e.exports=i},function(e,t,n){"use strict";var r=n(115),o=(n(27),n(53),n(843)),i=(n(23),new RegExp("^["+r.ATTRIBUTE_NAME_START_CHAR+"]["+r.ATTRIBUTE_NAME_CHAR+"]*$")),a={},s={};function u(e){return!!s.hasOwnProperty(e)||!a.hasOwnProperty(e)&&(i.test(e)?(s[e]=!0,!0):(a[e]=!0,!1))}function c(e,t){return null==t||e.hasBooleanValue&&!t||e.hasNumericValue&&isNaN(t)||e.hasPositiveNumericValue&&t<1||e.hasOverloadedBooleanValue&&!1===t}var l={createMarkupForID:function(e){return r.ID_ATTRIBUTE_NAME+"="+o(e)},setAttributeForID:function(e,t){e.setAttribute(r.ID_ATTRIBUTE_NAME,t)},createMarkupForRoot:function(){return r.ROOT_ATTRIBUTE_NAME+'=""'},setAttributeForRoot:function(e){e.setAttribute(r.ROOT_ATTRIBUTE_NAME,"")},createMarkupForProperty:function(e,t){var n=r.properties.hasOwnProperty(e)?r.properties[e]:null;if(n){if(c(n,t))return"";var i=n.attributeName;return n.hasBooleanValue||n.hasOverloadedBooleanValue&&!0===t?i+'=""':i+"="+o(t)}return r.isCustomAttribute(e)?null==t?"":e+"="+o(t):null},createMarkupForCustomAttribute:function(e,t){return u(e)&&null!=t?e+"="+o(t):""},setValueForProperty:function(e,t,n){var o=r.properties.hasOwnProperty(t)?r.properties[t]:null;if(o){var i=o.mutationMethod;if(i)i(e,n);else{if(c(o,n))return void this.deleteValueForProperty(e,t);if(o.mustUseProperty)e[o.propertyName]=n;else{var a=o.attributeName,s=o.attributeNamespace;s?e.setAttributeNS(s,a,""+n):o.hasBooleanValue||o.hasOverloadedBooleanValue&&!0===n?e.setAttribute(a,""):e.setAttribute(a,""+n)}}}else if(r.isCustomAttribute(t))return void l.setValueForAttribute(e,t,n)},setValueForAttribute:function(e,t,n){u(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForAttribute:function(e,t){e.removeAttribute(t)},deleteValueForProperty:function(e,t){var n=r.properties.hasOwnProperty(t)?r.properties[t]:null;if(n){var o=n.mutationMethod;if(o)o(e,void 0);else if(n.mustUseProperty){var i=n.propertyName;n.hasBooleanValue?e[i]=!1:e[i]=""}else e.removeAttribute(n.attributeName)}else r.isCustomAttribute(t)&&e.removeAttribute(t)}};e.exports=l},function(e,t,n){"use strict";var r=n(25),o=n(256),i=n(27),a=n(58),s=(n(23),!1);function u(){if(this._rootNodeID&&this._wrapperState.pendingUpdate){this._wrapperState.pendingUpdate=!1;var e=this._currentElement.props,t=o.getValue(e);null!=t&&c(this,Boolean(e.multiple),t)}}function c(e,t,n){var r,o,a=i.getNodeFromInstance(e).options;if(t){for(r={},o=0;o<n.length;o++)r[""+n[o]]=!0;for(o=0;o<a.length;o++){var s=r.hasOwnProperty(a[o].value);a[o].selected!==s&&(a[o].selected=s)}}else{for(r=""+n,o=0;o<a.length;o++)if(a[o].value===r)return void(a[o].selected=!0);a.length&&(a[0].selected=!0)}}var l={getHostProps:function(e,t){return r({},t,{onChange:e._wrapperState.onChange,value:void 0})},mountWrapper:function(e,t){var n=o.getValue(t);e._wrapperState={pendingUpdate:!1,initialValue:null!=n?n:t.defaultValue,listeners:null,onChange:p.bind(e),wasMultiple:Boolean(t.multiple)},void 0===t.value||void 0===t.defaultValue||s||(s=!0)},getSelectValueContext:function(e){return e._wrapperState.initialValue},postUpdateWrapper:function(e){var t=e._currentElement.props;e._wrapperState.initialValue=void 0;var n=e._wrapperState.wasMultiple;e._wrapperState.wasMultiple=Boolean(t.multiple);var r=o.getValue(t);null!=r?(e._wrapperState.pendingUpdate=!1,c(e,Boolean(t.multiple),r)):n!==Boolean(t.multiple)&&(null!=t.defaultValue?c(e,Boolean(t.multiple),t.defaultValue):c(e,Boolean(t.multiple),t.multiple?[]:""))}};function p(e){var t=this._currentElement.props,n=o.executeOnChange(t,e);return this._rootNodeID&&(this._wrapperState.pendingUpdate=!0),a.asap(u,this),n}e.exports=l},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(852),a=n(438),s=n(439),u=(n(853),n(15),n(23),function(e){this.construct(e)});function c(e,t){var n;if(null===e||!1===e)n=a.create(c);else if("object"==typeof e){var o=e,i=o.type;if("function"!=typeof i&&"string"!=typeof i){var l="";0,l+=function(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}(o._owner),r("130",null==i?i:typeof i,l)}"string"==typeof o.type?n=s.createInternalComponent(o):!function(e){return"function"==typeof e&&void 0!==e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}(o.type)?n=new u(o):(n=new o.type(o)).getHostNode||(n.getHostNode=n.getNativeNode)}else"string"==typeof e||"number"==typeof e?n=s.createInstanceForText(e):r("131",typeof e);return n._mountIndex=0,n._mountImage=null,n}o(u.prototype,i,{_instantiateReactComponent:c}),e.exports=c},function(e,t,n){"use strict";var r=n(21),o=n(104),i=(n(15),{HOST:0,COMPOSITE:1,EMPTY:2,getType:function(e){return null===e||!1===e?i.EMPTY:o.isValidElement(e)?"function"==typeof e.type?i.COMPOSITE:i.HOST:void r("26",e)}});e.exports=i},function(e,t,n){"use strict";var r,o={injectEmptyComponentFactory:function(e){r=e}},i={create:function(e){return r(e)}};i.injection=o,e.exports=i},function(e,t,n){"use strict";var r=n(21),o=(n(15),null),i=null;var a={createInternalComponent:function(e){return o||r("111",e.type),new o(e)},createInstanceForText:function(e){return new i(e)},isTextComponent:function(e){return e instanceof i},injection:{injectGenericComponentClass:function(e){o=e},injectTextComponentClass:function(e){i=e}}};e.exports=a},function(e,t,n){"use strict";var r=n(21),o=(n(65),n(854)),i=n(855),a=(n(15),n(260)),s=(n(23),"."),u=":";function c(e,t){return e&&"object"==typeof e&&null!=e.key?a.escape(e.key):t.toString(36)}e.exports=function(e,t,n){return null==e?0:function e(t,n,l,p){var f,h=typeof t;if("undefined"!==h&&"boolean"!==h||(t=null),null===t||"string"===h||"number"===h||"object"===h&&t.$$typeof===o)return l(p,t,""===n?s+c(t,0):n),1;var d=0,m=""===n?s:n+u;if(Array.isArray(t))for(var v=0;v<t.length;v++)d+=e(f=t[v],m+c(f,v),l,p);else{var g=i(t);if(g){var y,b=g.call(t);if(g!==t.entries)for(var _=0;!(y=b.next()).done;)d+=e(f=y.value,m+c(f,_++),l,p);else for(;!(y=b.next()).done;){var w=y.value;w&&(d+=e(f=w[1],m+a.escape(w[0])+u+c(f,0),l,p))}}else if("object"===h){var x=String(t);r("31","[object Object]"===x?"object with keys {"+Object.keys(t).join(", ")+"}":x,"")}}return d}(e,"",t,n)}},function(e,t,n){"use strict";var r,o,i,a,s,u,c,l=n(136),p=n(65);n(15),n(23);function f(e){var t=Function.prototype.toString,n=Object.prototype.hasOwnProperty,r=RegExp("^"+t.call(n).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");try{var o=t.call(e);return r.test(o)}catch(e){return!1}}if("function"==typeof Array.from&&"function"==typeof Map&&f(Map)&&null!=Map.prototype&&"function"==typeof Map.prototype.keys&&f(Map.prototype.keys)&&"function"==typeof Set&&f(Set)&&null!=Set.prototype&&"function"==typeof Set.prototype.keys&&f(Set.prototype.keys)){var h=new Map,d=new Set;r=function(e,t){h.set(e,t)},o=function(e){return h.get(e)},i=function(e){h.delete(e)},a=function(){return Array.from(h.keys())},s=function(e){d.add(e)},u=function(e){d.delete(e)},c=function(){return Array.from(d.keys())}}else{var m={},v={},g=function(e){return"."+e},y=function(e){return parseInt(e.substr(1),10)};r=function(e,t){var n=g(e);m[n]=t},o=function(e){var t=g(e);return m[t]},i=function(e){var t=g(e);delete m[t]},a=function(){return Object.keys(m).map(y)},s=function(e){var t=g(e);v[t]=!0},u=function(e){var t=g(e);delete v[t]},c=function(){return Object.keys(v).map(y)}}var b=[];function _(e){var t=o(e);if(t){var n=t.childIDs;i(e),n.forEach(_)}}function w(e,t,n){return"\n in "+(e||"Unknown")+(t?" (at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+")":n?" (created by "+n+")":"")}function x(e){return null==e?"#empty":"string"==typeof e||"number"==typeof e?"#text":"string"==typeof e.type?e.type:e.type.displayName||e.type.name||"Unknown"}function E(e){var t,n=S.getDisplayName(e),r=S.getElement(e),o=S.getOwnerID(e);return o&&(t=S.getDisplayName(o)),w(n,r&&r._source,t)}var S={onSetChildren:function(e,t){var n=o(e);n||l("144"),n.childIDs=t;for(var r=0;r<t.length;r++){var i=t[r],a=o(i);a||l("140"),null==a.childIDs&&"object"==typeof a.element&&null!=a.element&&l("141"),a.isMounted||l("71"),null==a.parentID&&(a.parentID=e),a.parentID!==e&&l("142",i,a.parentID,e)}},onBeforeMountComponent:function(e,t,n){r(e,{element:t,parentID:n,text:null,childIDs:[],isMounted:!1,updateCount:0})},onBeforeUpdateComponent:function(e,t){var n=o(e);n&&n.isMounted&&(n.element=t)},onMountComponent:function(e){var t=o(e);t||l("144"),t.isMounted=!0,0===t.parentID&&s(e)},onUpdateComponent:function(e){var t=o(e);t&&t.isMounted&&t.updateCount++},onUnmountComponent:function(e){var t=o(e);t&&(t.isMounted=!1,0===t.parentID&&u(e));b.push(e)},purgeUnmountedComponents:function(){if(!S._preventPurging){for(var e=0;e<b.length;e++){_(b[e])}b.length=0}},isMounted:function(e){var t=o(e);return!!t&&t.isMounted},getCurrentStackAddendum:function(e){var t="";if(e){var n=x(e),r=e._owner;t+=w(n,e._source,r&&r.getName())}var o=p.current,i=o&&o._debugID;return t+=S.getStackAddendumByID(i)},getStackAddendumByID:function(e){for(var t="";e;)t+=E(e),e=S.getParentID(e);return t},getChildIDs:function(e){var t=o(e);return t?t.childIDs:[]},getDisplayName:function(e){var t=S.getElement(e);return t?x(t):null},getElement:function(e){var t=o(e);return t?t.element:null},getOwnerID:function(e){var t=S.getElement(e);return t&&t._owner?t._owner._debugID:null},getParentID:function(e){var t=o(e);return t?t.parentID:null},getSource:function(e){var t=o(e),n=t?t.element:null;return null!=n?n._source:null},getText:function(e){var t=S.getElement(e);return"string"==typeof t?t:"number"==typeof t?""+t:null},getUpdateCount:function(e){var t=o(e);return t?t.updateCount:0},getRootIDs:c,getRegisteredIDs:a,pushNonStandardWarningStack:function(e,t){if("function"==typeof console.reactStack){var n=[],r=p.current,o=r&&r._debugID;try{for(e&&n.push({name:o?S.getDisplayName(o):null,fileName:t?t.fileName:null,lineNumber:t?t.lineNumber:null});o;){var i=S.getElement(o),a=S.getParentID(o),s=S.getOwnerID(o),u=s?S.getDisplayName(s):null,c=i&&i._source;n.push({name:u,fileName:c?c.fileName:null,lineNumber:c?c.lineNumber:null}),o=a}}catch(e){}console.reactStack(n)}},popNonStandardWarningStack:function(){"function"==typeof console.reactStackEnd&&console.reactStackEnd()}};e.exports=S},function(e,t,n){"use strict";var r=n(57),o={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):{remove:r}},registerDefault:function(){}};e.exports=o},function(e,t,n){"use strict";var r=n(867),o=n(869),i=n(432),a=n(444);var s={hasSelectionCapabilities:function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)},getSelectionInformation:function(){var e=a();return{focusedElem:e,selectionRange:s.hasSelectionCapabilities(e)?s.getSelection(e):null}},restoreSelection:function(e){var t,n=a(),r=e.focusedElem,u=e.selectionRange;n!==r&&(t=r,o(document.documentElement,t))&&(s.hasSelectionCapabilities(r)&&s.setSelection(r,u),i(r))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=r.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,o=t.end;if(void 0===o&&(o=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(o,e.value.length);else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var i=e.createTextRange();i.collapse(!0),i.moveStart("character",n),i.moveEnd("character",o-n),i.select()}else r.setOffsets(e,t)}};e.exports=s},function(e,t,n){"use strict";e.exports=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}},function(e,t,n){"use strict";var r=n(21),o=n(117),i=n(115),a=n(104),s=n(189),u=(n(65),n(27)),c=n(884),l=n(885),p=n(427),f=n(143),h=(n(53),n(886)),d=n(116),m=n(261),v=n(58),g=n(165),y=n(436),b=(n(15),n(187)),_=n(259),w=(n(23),i.ID_ATTRIBUTE_NAME),x=i.ROOT_ATTRIBUTE_NAME,E=1,S=9,C=11,k={};function O(e){return e?e.nodeType===S?e.documentElement:e.firstChild:null}function A(e,t,n,r,o){var i;if(p.logTopLevelRenders){var a=e._currentElement.props.child.type;i="React mount: "+("string"==typeof a?a:a.displayName||a.name),console.time(i)}var s=d.mountComponent(e,n,null,c(e,t),o,0);i&&console.timeEnd(i),e._renderedComponent._topLevelWrapper=e,D._mountImageIntoNode(s,t,e,r,n)}function T(e,t,n,r){var o=v.ReactReconcileTransaction.getPooled(!n&&l.useCreateElement);o.perform(A,null,e,t,o,n,r),v.ReactReconcileTransaction.release(o)}function j(e,t,n){for(0,d.unmountComponent(e,n),t.nodeType===S&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)}function P(e){var t=O(e);if(t){var n=u.getInstanceFromNode(t);return!(!n||!n._hostParent)}}function I(e){return!(!e||e.nodeType!==E&&e.nodeType!==S&&e.nodeType!==C)}function M(e){var t=function(e){var t=O(e),n=t&&u.getInstanceFromNode(t);return n&&!n._hostParent?n:null}(e);return t?t._hostContainerInfo._topLevelWrapper:null}var N=1,R=function(){this.rootID=N++};R.prototype.isReactComponent={},R.prototype.render=function(){return this.props.child},R.isReactTopLevelWrapper=!0;var D={TopLevelWrapper:R,_instancesByReactRootID:k,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r,o){return D.scrollMonitor(r,function(){m.enqueueElementInternal(e,t,n),o&&m.enqueueCallbackInternal(e,o)}),e},_renderNewRootComponent:function(e,t,n,o){I(t)||r("37"),s.ensureScrollValueMonitoring();var i=y(e,!1);v.batchedUpdates(T,i,t,n,o);var a=i._instance.rootID;return k[a]=i,i},renderSubtreeIntoContainer:function(e,t,n,o){return null!=e&&f.has(e)||r("38"),D._renderSubtreeIntoContainer(e,t,n,o)},_renderSubtreeIntoContainer:function(e,t,n,o){m.validateCallback(o,"ReactDOM.render"),a.isValidElement(t)||r("39","string"==typeof t?" Instead of passing a string like 'div', pass React.createElement('div') or <div />.":"function"==typeof t?" Instead of passing a class like Foo, pass React.createElement(Foo) or <Foo />.":null!=t&&void 0!==t.props?" This may be caused by unintentionally loading two independent copies of React.":"");var i,s=a.createElement(R,{child:t});if(e){var u=f.get(e);i=u._processChildContext(u._context)}else i=g;var c=M(n);if(c){var l=c._currentElement.props.child;if(_(l,t)){var p=c._renderedComponent.getPublicInstance(),h=o&&function(){o.call(p)};return D._updateRootComponent(c,s,i,n,h),p}D.unmountComponentAtNode(n)}var d,v=O(n),y=v&&!(!(d=v).getAttribute||!d.getAttribute(w)),b=P(n),x=y&&!c&&!b,E=D._renderNewRootComponent(s,n,x,i)._renderedComponent.getPublicInstance();return o&&o.call(E),E},render:function(e,t,n){return D._renderSubtreeIntoContainer(null,e,t,n)},unmountComponentAtNode:function(e){I(e)||r("40");var t=M(e);if(!t){P(e),1===e.nodeType&&e.hasAttribute(x);return!1}return delete k[t._instance.rootID],v.batchedUpdates(j,t,e,!1),!0},_mountImageIntoNode:function(e,t,n,i,a){if(I(t)||r("41"),i){var s=O(t);if(h.canReuseMarkup(e,s))return void u.precacheNode(n,s);var c=s.getAttribute(h.CHECKSUM_ATTR_NAME);s.removeAttribute(h.CHECKSUM_ATTR_NAME);var l=s.outerHTML;s.setAttribute(h.CHECKSUM_ATTR_NAME,c);var p=e,f=function(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}(p,l),d=" (client) "+p.substring(f-20,f+20)+"\n (server) "+l.substring(f-20,f+20);t.nodeType===S&&r("42",d)}if(t.nodeType===S&&r("43"),a.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);o.insertTreeBefore(t,e,null)}else b(t,e),u.precacheNode(n,t.firstChild)}};e.exports=D},function(e,t,n){"use strict";var r=n(437);e.exports=function(e){for(var t;(t=e._renderedNodeType)===r.COMPOSITE;)e=e._renderedComponent;return t===r.HOST?e._renderedComponent:t===r.EMPTY?null:void 0}},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(10),i=(r=o)&&r.__esModule?r:{default:r};t.default=i.default.shape({subscribe:i.default.func.isRequired,dispatch:i.default.func.isRequired,getState:i.default.func.isRequired})},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}},function(e,t,n){var r=n(228),o=n(898),i=n(184),a=n(899),s=n(900),u=n(903),c=n(904),l=n(905),p=n(906),f=n(377),h=n(452),d=n(176),m=n(907),v=n(908),g=n(913),y=n(37),b=n(232),_=n(915),w=n(52),x=n(917),E=n(85),S=1,C=2,k=4,O="[object Arguments]",A="[object Function]",T="[object GeneratorFunction]",j="[object Object]",P={};P[O]=P["[object Array]"]=P["[object ArrayBuffer]"]=P["[object DataView]"]=P["[object Boolean]"]=P["[object Date]"]=P["[object Float32Array]"]=P["[object Float64Array]"]=P["[object Int8Array]"]=P["[object Int16Array]"]=P["[object Int32Array]"]=P["[object Map]"]=P["[object Number]"]=P[j]=P["[object RegExp]"]=P["[object Set]"]=P["[object String]"]=P["[object Symbol]"]=P["[object Uint8Array]"]=P["[object Uint8ClampedArray]"]=P["[object Uint16Array]"]=P["[object Uint32Array]"]=!0,P["[object Error]"]=P[A]=P["[object WeakMap]"]=!1,e.exports=function e(t,n,I,M,N,R){var D,L=n&S,U=n&C,q=n&k;if(I&&(D=N?I(t,M,N,R):I(t)),void 0!==D)return D;if(!w(t))return t;var F=y(t);if(F){if(D=m(t),!L)return c(t,D)}else{var B=d(t),z=B==A||B==T;if(b(t))return u(t,L);if(B==j||B==O||z&&!N){if(D=U||z?{}:g(t),!L)return U?p(t,s(D,t)):l(t,a(D,t))}else{if(!P[B])return N?t:{};D=v(t,B,L)}}R||(R=new r);var V=R.get(t);if(V)return V;R.set(t,D),x(t)?t.forEach(function(r){D.add(e(r,n,I,r,t,R))}):_(t)&&t.forEach(function(r,o){D.set(o,e(r,n,I,o,t,R))});var H=q?U?h:f:U?keysIn:E,W=F?void 0:H(t);return o(W||t,function(r,o){W&&(r=t[o=r]),i(D,o,e(r,n,I,o,t,R))}),D}},function(e,t,n){var r=n(380),o=n(901),i=n(107);e.exports=function(e){return i(e)?r(e,!0):o(e)}},function(e,t,n){var r=n(229),o=n(265),i=n(230),a=n(379),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;e.exports=s},function(e,t,n){var r=n(378),o=n(451),i=n(450);e.exports=function(e){return r(e,i,o)}},function(e,t,n){var r=n(923),o=n(454),i=n(455);e.exports=function(e){return i(o(e,void 0,r),e+"")}},function(e,t,n){var r=n(926),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,s=o(i.length-t,0),u=Array(s);++a<s;)u[a]=i[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=i[a];return c[t]=n(u),r(e,this,c)}}},function(e,t,n){var r=n(927),o=n(929)(r);e.exports=o},function(e,t,n){var r={strict:!0},o=n(940),i=function(e,t){return o(e,t,r)},a=n(267);t.JsonPatchError=a.PatchError,t.deepClone=a._deepClone;var s={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=c(n,this.path);r&&(r=a._deepClone(r));var o=l(n,{op:"remove",path:this.from}).removed;return l(n,{op:"add",path:this.path,value:o}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=c(n,this.from);return l(n,{op:"add",path:this.path,value:a._deepClone(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:i(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},u={add:function(e,t,n){return a.isInteger(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:s.move,copy:s.copy,test:s.test,_get:s._get};function c(e,t){if(""==t)return e;var n={op:"_get",path:t};return l(e,n),n.value}function l(e,n,r,o,l,p){if(void 0===r&&(r=!1),void 0===o&&(o=!0),void 0===l&&(l=!0),void 0===p&&(p=0),r&&("function"==typeof r?r(n,0,e,n.path):f(n,0)),""===n.path){var h={newDocument:e};if("add"===n.op)return h.newDocument=n.value,h;if("replace"===n.op)return h.newDocument=n.value,h.removed=e,h;if("move"===n.op||"copy"===n.op)return h.newDocument=c(e,n.from),"move"===n.op&&(h.removed=e),h;if("test"===n.op){if(h.test=i(e,n.value),!1===h.test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",p,n,e);return h.newDocument=e,h}if("remove"===n.op)return h.removed=e,h.newDocument=null,h;if("_get"===n.op)return n.value=e,h;if(r)throw new t.JsonPatchError("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",p,n,e);return h}o||(e=a._deepClone(e));var d=(n.path||"").split("/"),m=e,v=1,g=d.length,y=void 0,b=void 0,_=void 0;for(_="function"==typeof r?r:f;;){if(b=d[v],l&&"__proto__"==b)throw new TypeError("JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&void 0===y&&(void 0===m[b]?y=d.slice(0,v).join("/"):v==g-1&&(y=n.path),void 0!==y&&_(n,0,e,y)),v++,Array.isArray(m)){if("-"===b)b=m.length;else{if(r&&!a.isInteger(b))throw new t.JsonPatchError("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",p,n,e);a.isInteger(b)&&(b=~~b)}if(v>=g){if(r&&"add"===n.op&&b>m.length)throw new t.JsonPatchError("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",p,n,e);if(!1===(h=u[n.op].call(n,m,b,e)).test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",p,n,e);return h}}else if(b&&-1!=b.indexOf("~")&&(b=a.unescapePathComponent(b)),v>=g){if(!1===(h=s[n.op].call(n,m,b,e)).test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",p,n,e);return h}m=m[b]}}function p(e,n,r,o,i){if(void 0===o&&(o=!0),void 0===i&&(i=!0),r&&!Array.isArray(n))throw new t.JsonPatchError("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");o||(e=a._deepClone(e));for(var s=new Array(n.length),u=0,c=n.length;u<c;u++)s[u]=l(e,n[u],r,!0,i,u),e=s[u].newDocument;return s.newDocument=e,s}function f(e,n,r,o){if("object"!=typeof e||null===e||Array.isArray(e))throw new t.JsonPatchError("Operation is not an object","OPERATION_NOT_AN_OBJECT",n,e,r);if(!s[e.op])throw new t.JsonPatchError("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",n,e,r);if("string"!=typeof e.path)throw new t.JsonPatchError("Operation `path` property is not a string","OPERATION_PATH_INVALID",n,e,r);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new t.JsonPatchError('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",n,e,r);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new t.JsonPatchError("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",n,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new t.JsonPatchError("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",n,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&a.hasUndefined(e.value))throw new t.JsonPatchError("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",n,e,r);if(r)if("add"==e.op){var i=e.path.split("/").length,u=o.split("/").length;if(i!==u+1&&i!==u)throw new t.JsonPatchError("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",n,e,r)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==o)throw new t.JsonPatchError("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",n,e,r)}else if("move"===e.op||"copy"===e.op){var c=h([{op:"_get",path:e.from,value:void 0}],r);if(c&&"OPERATION_PATH_UNRESOLVABLE"===c.name)throw new t.JsonPatchError("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",n,e,r)}}function h(e,n,r){try{if(!Array.isArray(e))throw new t.JsonPatchError("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(n)p(a._deepClone(n),a._deepClone(e),r||!0);else{r=r||f;for(var o=0;o<e.length;o++)r(e[o],o,n,void 0)}}catch(e){if(e instanceof t.JsonPatchError)return e;throw e}}t.getValueByPointer=c,t.applyOperation=l,t.applyPatch=p,t.applyReducer=function(e,n,r){var o=l(e,n);if(!1===o.test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",r,n,e);return o.newDocument},t.validator=f,t.validate=h},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,o=Array.isArray,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:a,assign:function(e,t){return Object.keys(t).reduce(function(e,n){return e[n]=t[n],e},e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var i=t[r],a=i.obj[i.prop],s=Object.keys(a),u=0;u<s.length;++u){var c=s[u],l=a[c];"object"==typeof l&&null!==l&&-1===n.indexOf(l)&&(t.push({obj:a,prop:c}),n.push(l))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(o(n)){for(var r=[],i=0;i<n.length;++i)void 0!==n[i]&&r.push(n[i]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n){if(0===e.length)return e;var r="string"==typeof e?e:String(e);if("iso-8859-1"===n)return escape(r).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var o="",a=0;a<r.length;++a){var s=r.charCodeAt(a);45===s||46===s||95===s||126===s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122?o+=r.charAt(a):s<128?o+=i[s]:s<2048?o+=i[192|s>>6]+i[128|63&s]:s<55296||s>=57344?o+=i[224|s>>12]+i[128|s>>6&63]+i[128|63&s]:(a+=1,s=65536+((1023&s)<<10|1023&r.charCodeAt(a)),o+=i[240|s>>18]+i[128|s>>12&63]+i[128|s>>6&63]+i[128|63&s])}return o},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,n,i){if(!n)return t;if("object"!=typeof n){if(o(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(i&&(i.plainObjects||i.allowPrototypes)||!r.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var s=t;return o(t)&&!o(n)&&(s=a(t,i)),o(t)&&o(n)?(n.forEach(function(n,o){if(r.call(t,o)){var a=t[o];a&&"object"==typeof a&&n&&"object"==typeof n?t[o]=e(a,n,i):t.push(n)}else t[o]=n}),t):Object.keys(n).reduce(function(t,o){var a=n[o];return r.call(t,o)?t[o]=e(t[o],a,i):t[o]=a,t},s)}}},function(e,t,n){"use strict";var r=String.prototype.replace,o=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,o,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,n){"use strict";var r=n(32),o=n(30),i=n(135),a=n(82),s=n(77),u=n(182),c=n(112),l=n(181),p=n(43),f=n(134),h=n(49).f,d=n(268)(0),m=n(50);e.exports=function(e,t,n,v,g,y){var b=r[e],_=b,w=g?"set":"add",x=_&&_.prototype,E={};return m&&"function"==typeof _&&(y||x.forEach&&!a(function(){(new _).entries().next()}))?(_=t(function(t,n){l(t,_,e,"_c"),t._c=new b,null!=n&&c(n,g,t[w],t)}),d("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(e){var t="add"==e||"set"==e;e in x&&(!y||"clear"!=e)&&s(_.prototype,e,function(n,r){if(l(this,_,e),!t&&y&&!p(n))return"get"==e&&void 0;var o=this._c[e](0===n?0:n,r);return t?this:o})}),y||h(_.prototype,"size",{get:function(){return this._c.size}})):(_=v.getConstructor(t,e,g,w),u(_.prototype,n),i.NEED=!0),f(_,e),E[e]=_,o(o.G+o.W+o.F,E),y||v.setStrong(_,e,g),_}},function(e,t,n){"use strict";var r=n(30);e.exports=function(e){r(r.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})}},function(e,t,n){"use strict";var r=n(30),o=n(132),i=n(63),a=n(112);e.exports=function(e){r(r.S,e,{from:function(e){var t,n,r,s,u=arguments[1];return o(this),(t=void 0!==u)&&o(u),null==e?new this:(n=[],t?(r=0,s=i(u,arguments[2],2),a(e,!1,function(e){n.push(s(e,r++))})):a(e,!1,n.push,n),new this(n))}})}},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwcHgiICBoZWlnaHQ9IjIwMHB4IiAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiIGNsYXNzPSJsZHMtcm9sbGluZyIgc3R5bGU9ImJhY2tncm91bmQtaW1hZ2U6IG5vbmU7IGJhY2tncm91bmQtcG9zaXRpb246IGluaXRpYWwgaW5pdGlhbDsgYmFja2dyb3VuZC1yZXBlYXQ6IGluaXRpYWwgaW5pdGlhbDsiPjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIGZpbGw9Im5vbmUiIG5nLWF0dHItc3Ryb2tlPSJ7e2NvbmZpZy5jb2xvcn19IiBuZy1hdHRyLXN0cm9rZS13aWR0aD0ie3tjb25maWcud2lkdGh9fSIgbmctYXR0ci1yPSJ7e2NvbmZpZy5yYWRpdXN9fSIgbmctYXR0ci1zdHJva2UtZGFzaGFycmF5PSJ7e2NvbmZpZy5kYXNoYXJyYXl9fSIgc3Ryb2tlPSIjNTU1NTU1IiBzdHJva2Utd2lkdGg9IjEwIiByPSIzNSIgc3Ryb2tlLWRhc2hhcnJheT0iMTY0LjkzMzYxNDMxMzQ2NDE1IDU2Ljk3Nzg3MTQzNzgyMTM4Ij48YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InJvdGF0ZSIgY2FsY01vZGU9ImxpbmVhciIgdmFsdWVzPSIwIDUwIDUwOzM2MCA1MCA1MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49IjBzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlVHJhbnNmb3JtPjwvY2lyY2xlPjwvc3ZnPgo="},function(e,t,n){"use strict";e.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",GT:">",Gt:"≫",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",LT:"<",Lt:"≪",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}},function(e,t,n){"use strict";var r=n(465),o=n(39).unescapeMd;e.exports=function(e,t){var n,i,a,s=t,u=e.posMax;if(60===e.src.charCodeAt(t)){for(t++;t<u;){if(10===(n=e.src.charCodeAt(t)))return!1;if(62===n)return a=r(o(e.src.slice(s+1,t))),!!e.parser.validateLink(a)&&(e.pos=t+1,e.linkContent=a,!0);92===n&&t+1<u?t+=2:t++}return!1}for(i=0;t<u&&32!==(n=e.src.charCodeAt(t))&&!(n<32||127===n);)if(92===n&&t+1<u)t+=2;else{if(40===n&&++i>1)break;if(41===n&&--i<0)break;t++}return s!==t&&(a=o(e.src.slice(s,t)),!!e.parser.validateLink(a)&&(e.linkContent=a,e.pos=t,!0))}},function(e,t,n){"use strict";var r=n(39).replaceEntities;e.exports=function(e){var t=r(e);try{t=decodeURI(t)}catch(e){}return encodeURI(t)}},function(e,t,n){"use strict";var r=n(39).unescapeMd;e.exports=function(e,t){var n,o=t,i=e.posMax,a=e.src.charCodeAt(t);if(34!==a&&39!==a&&40!==a)return!1;for(t++,40===a&&(a=41);t<i;){if((n=e.src.charCodeAt(t))===a)return e.pos=t+1,e.linkContent=r(e.src.slice(o+1,t)),!0;92===n&&t+1<i?t+=2:t++}return!1}},function(e,t,n){"use strict";e.exports=function(e){return e.trim().replace(/\s+/g," ").toUpperCase()}},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(this,n(36))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineReducers=void 0;var r,o=n(593),i=(r=o)&&r.__esModule?r:{default:r};t.combineReducers=i.default},function(e,t,n){"use strict";var r=/^(%20|\s)*(javascript|data)/im,o=/[^\x20-\x7E]/gim,i=/^([^:]+):/gm,a=[".","/"];e.exports={sanitizeUrl:function(e){if(!e)return"about:blank";var t,n,s=e.replace(o,"").trim();return function(e){return a.indexOf(e[0])>-1}(s)?s:(n=s.match(i))?(t=n[0],r.test(t)?"about:blank":s):"about:blank"}}},function(e,t,n){var r=n(602),o=n(610)(function(e,t,n){return t=t.toLowerCase(),e+(n?r(t):t)});e.exports=o},function(e,t,n){var r=n(375),o=n(172),i=n(679),a=n(37),s=n(389);e.exports=function(e,t,n){var u=a(e)?r:i;return n&&s(e,t,n)&&(t=void 0),u(e,o(t,3))}},function(e,t,n){(function(t){var r=n(684),o=n(685).Stream,i=" ";function a(e,t,n){n=n||0;var o,i,s=(o=t,new Array(n||0).join(o||"")),u=e;if("object"==typeof e&&((u=e[i=Object.keys(e)[0]])&&u._elem))return u._elem.name=i,u._elem.icount=n,u._elem.indent=t,u._elem.indents=s,u._elem.interrupt=u,u._elem;var c,l=[],p=[];function f(e){Object.keys(e).forEach(function(t){l.push(function(e,t){return e+'="'+r(t)+'"'}(t,e[t]))})}switch(typeof u){case"object":if(null===u)break;u._attr&&f(u._attr),u._cdata&&p.push(("<![CDATA["+u._cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")+"]]>"),u.forEach&&(c=!1,p.push(""),u.forEach(function(e){"object"==typeof e?"_attr"==Object.keys(e)[0]?f(e._attr):p.push(a(e,t,n+1)):(p.pop(),c=!0,p.push(r(e)))}),c||p.push(""));break;default:p.push(r(u))}return{name:i,interrupt:!1,attributes:l,content:p,icount:n,indents:s,indent:t}}function s(e,t,n){if("object"!=typeof t)return e(!1,t);var r=t.interrupt?1:t.content.length;function o(){for(;t.content.length;){var o=t.content.shift();if(void 0!==o){if(i(o))return;s(e,o)}}e(!1,(r>1?t.indents:"")+(t.name?"</"+t.name+">":"")+(t.indent&&!n?"\n":"")),n&&n()}function i(t){return!!t.interrupt&&(t.interrupt.append=e,t.interrupt.end=o,t.interrupt=!1,e(!0),!0)}if(e(!1,t.indents+(t.name?"<"+t.name:"")+(t.attributes.length?" "+t.attributes.join(" "):"")+(r?t.name?">":"":t.name?"/>":"")+(t.indent&&r>1?"\n":"")),!r)return e(!1,t.indent?"\n":"");i(t)||o()}e.exports=function(e,n){"object"!=typeof n&&(n={indent:n});var r,u,c=n.stream?new o:null,l="",p=!1,f=n.indent?!0===n.indent?i:n.indent:"",h=!0;function d(e){h?t.nextTick(e):e()}function m(e,t){if(void 0!==t&&(l+=t),e&&!p&&(c=c||new o,p=!0),e&&p){var n=l;d(function(){c.emit("data",n)}),l=""}}function v(e,t){s(m,a(e,f,f?1:0),t)}function g(){if(c){var e=l;d(function(){c.emit("data",e),c.emit("end"),c.readable=!1,c.emit("close")})}}return d(function(){h=!1}),n.declaration&&(r=n.declaration,u={version:"1.0",encoding:r.encoding||"UTF-8"},r.standalone&&(u.standalone=r.standalone),v({"?xml":{_attr:u}}),l=l.replace("/>","?>")),e&&e.forEach?e.forEach(function(t,n){var r;n+1===e.length&&(r=g),v(t,r)}):v(e,g),c?(c.readable=!0,c):l},e.exports.element=e.exports.Element=function(){var e={_elem:a(Array.prototype.slice.call(arguments)),push:function(e){if(!this.append)throw new Error("not assigned to a parent!");var t=this,n=this._elem.indent;s(this.append,a(e,n,this._elem.icount+(n?1:0)),function(){t.append(!0)})},close:function(e){void 0!==e&&this.push(e),this.end&&this.end()}};return e}}).call(this,n(67))},function(e,t,n){(function(t){var n;n=void 0!==t?t:this,e.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,n=String(e),r=n.length,o=-1,i="",a=n.charCodeAt(0);++o<r;)0!=(t=n.charCodeAt(o))?i+=t>=1&&t<=31||127==t||0==o&&t>=48&&t<=57||1==o&&t>=48&&t<=57&&45==a?"\\"+t.toString(16)+" ":0==o&&1==r&&45==t||!(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?"\\"+n.charAt(o):n.charAt(o):i+="�";return i};return e.CSS||(e.CSS={}),e.CSS.escape=t,t}(n)}).call(this,n(36))},function(e,t,n){"use strict";(function(t,r){var o=65536,i=4294967295;var a=n(48).Buffer,s=t.crypto||t.msCrypto;s&&s.getRandomValues?e.exports=function(e,t){if(e>i)throw new RangeError("requested too many random bytes");var n=a.allocUnsafe(e);if(e>0)if(e>o)for(var u=0;u<e;u+=o)s.getRandomValues(n.slice(u,u+o));else s.getRandomValues(n);if("function"==typeof t)return r.nextTick(function(){t(null,n)});return n}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,n(36),n(67))},function(e,t,n){(t=e.exports=function(e){e=e.toLowerCase();var n=t[e];if(!n)throw new Error(e+" is not supported (we accept pull requests)");return new n}).sha=n(749),t.sha1=n(750),t.sha224=n(751),t.sha256=n(404),t.sha384=n(752),t.sha512=n(405)},function(e,t,n){var r=n(370),o=n(388),i=n(172),a=n(753),s=n(37);e.exports=function(e,t,n){var u=s(e)?r:a,c=arguments.length<3;return u(e,i(t,4),n,c,o)}},function(e,t,n){var r=n(52),o=n(805),i=n(387),a="Expected a function",s=Math.max,u=Math.min;e.exports=function(e,t,n){var c,l,p,f,h,d,m=0,v=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError(a);function b(t){var n=c,r=l;return c=l=void 0,m=t,f=e.apply(r,n)}function _(e){var n=e-d;return void 0===d||n>=t||n<0||g&&e-m>=p}function w(){var e=o();if(_(e))return x(e);h=setTimeout(w,function(e){var n=t-(e-d);return g?u(n,p-(e-m)):n}(e))}function x(e){return h=void 0,y&&c?b(e):(c=l=void 0,f)}function E(){var e=o(),n=_(e);if(c=arguments,l=this,d=e,n){if(void 0===h)return function(e){return m=e,h=setTimeout(w,t),v?b(e):f}(d);if(g)return clearTimeout(h),h=setTimeout(w,t),b(d)}return void 0===h&&(h=setTimeout(w,t)),f}return t=i(t)||0,r(n)&&(v=!!n.leading,p=(g="maxWait"in n)?s(i(n.maxWait)||0,t):p,y="trailing"in n?!!n.trailing:y),E.cancel=function(){void 0!==h&&clearTimeout(h),m=0,c=d=l=h=void 0},E.flush=function(){return void 0===h?f:x(o())},E}},function(e,t,n){"use strict";e.exports=n(815)},function(e,t,n){var r=n(367),o=n(449),i=n(919),a=n(108),s=n(118),u=n(922),c=n(453),l=n(452),p=c(function(e,t){var n={};if(null==e)return n;var c=!1;t=r(t,function(t){return t=a(t,e),c||(c=t.length>1),t}),s(e,l(e),n),c&&(n=o(n,7,u));for(var p=t.length;p--;)i(n,t[p]);return n});e.exports=p},function(e,t,n){var r,o,i;o=[],r=function(){"use strict";var e=function(e){return e&&"getComputedStyle"in window&&"smooth"===window.getComputedStyle(e)["scroll-behavior"]};if("undefined"==typeof window||!("document"in window))return{};var t=function(t,n,r){var o;n=n||999,r||0===r||(r=9);var i=function(e){o=e},a=function(){clearTimeout(o),i(0)},s=function(e){return Math.max(0,t.getTopOf(e)-r)},u=function(r,o,s){if(a(),0===o||o&&o<0||e(t.body))t.toY(r),s&&s();else{var u=t.getY(),c=Math.max(0,r)-u,l=(new Date).getTime();o=o||Math.min(Math.abs(c),n),function e(){i(setTimeout(function(){var n=Math.min(1,((new Date).getTime()-l)/o),r=Math.max(0,Math.floor(u+c*(n<.5?2*n*n:n*(4-2*n)-1)));t.toY(r),n<1&&t.getHeight()+r<t.body.scrollHeight?e():(setTimeout(a,99),s&&s())},9))}()}},c=function(e,t,n){u(s(e),t,n)};return{setup:function(e,t){return(0===e||e)&&(n=e),(0===t||t)&&(r=t),{defaultDuration:n,edgeOffset:r}},to:c,toY:u,intoView:function(e,n,o){var i=e.getBoundingClientRect().height,a=t.getTopOf(e)+i,l=t.getHeight(),p=t.getY(),f=p+l;s(e)<p||i+r>l?c(e,n,o):a+r>f?u(a-l+r,n,o):o&&o()},center:function(e,n,r,o){u(Math.max(0,t.getTopOf(e)-t.getHeight()/2+(r||e.getBoundingClientRect().height/2)),n,o)},stop:a,moving:function(){return!!o},getY:t.getY,getTopOf:t.getTopOf}},n=document.documentElement,r=function(){return window.scrollY||n.scrollTop},o=t({body:document.scrollingElement||document.body,toY:function(e){window.scrollTo(0,e)},getY:r,getHeight:function(){return window.innerHeight||n.clientHeight},getTopOf:function(e){return e.getBoundingClientRect().top+r()-n.offsetTop}});if(o.createScroller=function(e,r,o){return t({body:e,toY:function(t){e.scrollTop=t},getY:function(){return e.scrollTop},getHeight:function(){return Math.min(e.clientHeight,window.innerHeight||n.clientHeight)},getTopOf:function(e){return e.offsetTop}},r,o)},"addEventListener"in window&&!window.noZensmooth&&!e(document.body)){var i="history"in window&&"pushState"in history,a=i&&"scrollRestoration"in history;a&&(history.scrollRestoration="auto"),window.addEventListener("load",function(){a&&(setTimeout(function(){history.scrollRestoration="manual"},9),window.addEventListener("popstate",function(e){e.state&&"zenscrollY"in e.state&&o.toY(e.state.zenscrollY)},!1)),window.location.hash&&setTimeout(function(){var e=o.setup().edgeOffset;if(e){var t=document.getElementById(window.location.href.split("#")[1]);if(t){var n=Math.max(0,o.getTopOf(t)-e),r=o.getY()-n;0<=r&&r<9&&window.scrollTo(0,n)}}},9)},!1);var s=new RegExp("(^|\\s)noZensmooth(\\s|$)");window.addEventListener("click",function(e){for(var t=e.target;t&&"A"!==t.tagName;)t=t.parentNode;if(!(!t||1!==e.which||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)){if(a){var n=history.state&&"object"==typeof history.state?history.state:{};n.zenscrollY=o.getY();try{history.replaceState(n,"")}catch(e){}}var r=t.getAttribute("href")||"";if(0===r.indexOf("#")&&!s.test(t.className)){var u=0,c=document.getElementById(r.substring(1));if("#"!==r){if(!c)return;u=o.getTopOf(c)}e.preventDefault();var l=function(){window.location=r},p=o.setup().edgeOffset;p&&(u=Math.max(0,u-p),i&&(l=function(){history.pushState({},"",r)})),o.toY(u,null,l)}}},!1)}return o}(),void 0===(i="function"==typeof r?r.apply(t,o):r)||(e.exports=i)},function(e,t,n){e.exports=n(971)},function(e,t){e.exports=function(e,t,n){var r=new Blob([e],{type:n||"application/octet-stream"});if(void 0!==window.navigator.msSaveBlob)window.navigator.msSaveBlob(r,t);else{var o=window.URL.createObjectURL(r),i=document.createElement("a");i.style.display="none",i.href=o,i.setAttribute("download",t),void 0===i.download&&i.setAttribute("target","_blank"),document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(o)}}},function(e,t,n){"use strict";var r=n(979),o=function(e){return e.split(/(<\/?[^>]+>)/g).filter(function(e){return""!==e.trim()})},i=function(e){return/<\/+[^>]+>/.test(e)},a=function(e){return/<[^>]+\/>/.test(e)},s=function(e){return function(e){return/<[^>!]+>/.test(e)}(e)&&!i(e)&&!a(e)};function u(e){return o(e).map(function(e){return{value:e,type:c(e)}})}function c(e){return i(e)?"ClosingTag":s(e)?"OpeningTag":a(e)?"SelfClosingTag":"Text"}e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.indentor,o=t.textNodesOnSameLine,i=0,a=[];n=n||" ";var s=u(e).map(function(e,t,s){var u=e.value,c=e.type;"ClosingTag"===c&&i--;var l=r(n,i),p=l+u;if("OpeningTag"===c&&i++,o){var f=s[t-1],h=s[t-2];"ClosingTag"===c&&"Text"===f.type&&"OpeningTag"===h.type&&(p=""+l+h.value+f.value+u,a.push(t-2,t-1))}return p});return a.forEach(function(e){return s[e]=null}),s.filter(function(e){return!!e}).join("\n")}},function(e,t,n){var r=n(69);e.exports=function(e){return r(e).toLowerCase()}},function(e,t,n){"use strict";var r=n(1031).DebounceInput;r.DebounceInput=r,e.exports=r},function(e,t,n){n(489),e.exports=n(1034)},function(e,t,n){"use strict";n.r(t);var r=n(18);void 0===n.n(r).a.Promise&&n(490),String.prototype.startsWith||n(520)},function(e,t,n){n(491),n(337),n(502),n(506),n(518),n(519),e.exports=n(72).Promise},function(e,t,n){"use strict";var r=n(150),o={};o[n(33)("toStringTag")]="z",o+""!="[object z]"&&n(97)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(e,t,n){e.exports=!n(126)&&!n(99)(function(){return 7!=Object.defineProperty(n(200)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(98);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){e.exports=n(197)("native-function-to-string",Function.toString)},function(e,t,n){"use strict";var r=n(496),o=n(336),i=n(203),a={};n(81)(a,n(33)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){var r=n(45),o=n(497),i=n(341),a=n(202)("IE_PROTO"),s=function(){},u=function(){var e,t=n(200)("iframe"),r=i.length;for(t.style.display="none",n(342).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[i[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:o(n,t)}},function(e,t,n){var r=n(151),o=n(45),i=n(339);e.exports=n(126)?Object.defineProperties:function(e,t){o(e);for(var n,a=i(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(152),o=n(155),i=n(500)(!1),a=n(202)("IE_PROTO");e.exports=function(e,t){var n,s=o(e),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~i(c,n)||c.push(n));return c}},function(e,t,n){var r=n(125);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(155),o=n(74),i=n(340);e.exports=function(e){return function(t,n,a){var s,u=r(t),c=o(u.length),l=i(a,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(152),o=n(343),i=n(202)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){for(var r=n(503),o=n(339),i=n(97),a=n(41),s=n(81),u=n(128),c=n(33),l=c("iterator"),p=c("toStringTag"),f=u.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},d=o(h),m=0;m<d.length;m++){var v,g=d[m],y=h[g],b=a[g],_=b&&b.prototype;if(_&&(_[l]||s(_,l,f),_[p]||s(_,p,g),u[g]=f,y))for(v in r)_[v]||i(_,v,r[v],!0)}},function(e,t,n){"use strict";var r=n(504),o=n(505),i=n(128),a=n(155);e.exports=n(338)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(e,t,n){var r=n(33)("unscopables"),o=Array.prototype;null==o[r]&&n(81)(o,r,{}),e.exports=function(e){o[r][e]=!0}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){"use strict";var r,o,i,a,s=n(198),u=n(41),c=n(153),l=n(150),p=n(35),f=n(98),h=n(154),d=n(507),m=n(508),v=n(204),g=n(344).set,y=n(513)(),b=n(205),_=n(345),w=n(514),x=n(346),E=u.TypeError,S=u.process,C=S&&S.versions,k=C&&C.v8||"",O=u.Promise,A="process"==l(S),T=function(){},j=o=b.f,P=!!function(){try{var e=O.resolve(1),t=(e.constructor={})[n(33)("species")]=function(e){e(T,T)};return(A||"function"==typeof PromiseRejectionEvent)&&e.then(T)instanceof t&&0!==k.indexOf("6.6")&&-1===w.indexOf("Chrome/66")}catch(e){}}(),I=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},M=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var r=e._v,o=1==e._s,i=0,a=function(t){var n,i,a,s=o?t.ok:t.fail,u=t.resolve,c=t.reject,l=t.domain;try{s?(o||(2==e._h&&D(e),e._h=1),!0===s?n=r:(l&&l.enter(),n=s(r),l&&(l.exit(),a=!0)),n===t.promise?c(E("Promise-chain cycle")):(i=I(n))?i.call(n,u,c):u(n)):c(r)}catch(e){l&&!a&&l.exit(),c(e)}};n.length>i;)a(n[i++]);e._c=[],e._n=!1,t&&!e._h&&N(e)})}},N=function(e){g.call(u,function(){var t,n,r,o=e._v,i=R(e);if(i&&(t=_(function(){A?S.emit("unhandledRejection",o,e):(n=u.onunhandledrejection)?n({promise:e,reason:o}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",o)}),e._h=A||R(e)?2:1),e._a=void 0,i&&t.e)throw t.v})},R=function(e){return 1!==e._h&&0===(e._a||e._c).length},D=function(e){g.call(u,function(){var t;A?S.emit("rejectionHandled",e):(t=u.onrejectionhandled)&&t({promise:e,reason:e._v})})},L=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),M(t,!0))},U=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw E("Promise can't be resolved itself");(t=I(e))?y(function(){var r={_w:n,_d:!1};try{t.call(e,c(U,r,1),c(L,r,1))}catch(e){L.call(r,e)}}):(n._v=e,n._s=1,M(n,!1))}catch(e){L.call({_w:n,_d:!1},e)}}};P||(O=function(e){d(this,O,"Promise","_h"),h(e),r.call(this);try{e(c(U,this,1),c(L,this,1))}catch(e){L.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(515)(O.prototype,{then:function(e,t){var n=j(v(this,O));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=A?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r;this.promise=e,this.resolve=c(U,e,1),this.reject=c(L,e,1)},b.f=j=function(e){return e===O||e===a?new i(e):o(e)}),p(p.G+p.W+p.F*!P,{Promise:O}),n(203)(O,"Promise"),n(516)("Promise"),a=n(72).Promise,p(p.S+p.F*!P,"Promise",{reject:function(e){var t=j(this);return(0,t.reject)(e),t.promise}}),p(p.S+p.F*(s||!P),"Promise",{resolve:function(e){return x(s&&this===a?O:this,e)}}),p(p.S+p.F*!(P&&n(517)(function(e){O.all(e).catch(T)})),"Promise",{all:function(e){var t=this,n=j(t),r=n.resolve,o=n.reject,i=_(function(){var n=[],i=0,a=1;m(e,!1,function(e){var s=i++,u=!1;n.push(void 0),a++,t.resolve(e).then(function(e){u||(u=!0,n[s]=e,--a||r(n))},o)}),--a||r(n)});return i.e&&o(i.v),n.promise},race:function(e){var t=this,n=j(t),r=n.reject,o=_(function(){m(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(153),o=n(509),i=n(510),a=n(45),s=n(74),u=n(511),c={},l={};(t=e.exports=function(e,t,n,p,f){var h,d,m,v,g=f?function(){return e}:u(e),y=r(n,p,t?2:1),b=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(i(g)){for(h=s(e.length);h>b;b++)if((v=t?y(a(d=e[b])[0],d[1]):y(e[b]))===c||v===l)return v}else for(m=g.call(e);!(d=m.next()).done;)if((v=o(m,y,d.value,t))===c||v===l)return v}).BREAK=c,t.RETURN=l},function(e,t,n){var r=n(45);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){var r=n(128),o=n(33)("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[o]===e)}},function(e,t,n){var r=n(150),o=n(33)("iterator"),i=n(128);e.exports=n(72).getIteratorMethod=function(e){if(null!=e)return e[o]||e["@@iterator"]||i[r(e)]}},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(41),o=n(344).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,u="process"==n(125)(a);e.exports=function(){var e,t,n,c=function(){var r,o;for(u&&(r=a.domain)&&r.exit();e;){o=e.fn,e=e.next;try{o()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){a.nextTick(c)};else if(!i||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var l=s.resolve(void 0);n=function(){l.then(c)}}else n=function(){o.call(r,c)};else{var p=!0,f=document.createTextNode("");new i(c).observe(f,{characterData:!0}),n=function(){f.data=p=!p}}return function(r){var o={fn:r,next:void 0};t&&(t.next=o),e||(e=o,n()),t=o}}},function(e,t,n){var r=n(41).navigator;e.exports=r&&r.userAgent||""},function(e,t,n){var r=n(97);e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},function(e,t,n){"use strict";var r=n(41),o=n(151),i=n(126),a=n(33)("species");e.exports=function(e){var t=r[e];i&&t&&!t[a]&&o.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,n){var r=n(33)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],a=i[r]();a.next=function(){return{done:n=!0}},i[r]=function(){return a},e(i)}catch(e){}return n}},function(e,t,n){"use strict";var r=n(35),o=n(72),i=n(41),a=n(204),s=n(346);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,o.Promise||i.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(35),o=n(205),i=n(345);r(r.S,"Promise",{try:function(e){var t=o.f(this),n=i(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){n(521),n(522),n(523),n(337),n(526),n(527),n(528),n(529),n(531),n(532),n(533),n(534),n(535),n(536),n(537),n(538),n(539),n(540),n(541),n(542),n(543),n(544),n(545),n(548),n(549),n(551),e.exports=n(72).String},function(e,t,n){var r=n(35),o=n(340),i=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,a=0;r>a;){if(t=+arguments[a++],o(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?i(t):i(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}})},function(e,t,n){var r=n(35),o=n(155),i=n(74);r(r.S,"String",{raw:function(e){for(var t=o(e.raw),n=i(t.length),r=arguments.length,a=[],s=0;n>s;)a.push(String(t[s++])),s<r&&a.push(String(arguments[s]));return a.join("")}})},function(e,t,n){"use strict";n(524)("trim",function(e){return function(){return e(this,3)}})},function(e,t,n){var r=n(35),o=n(73),i=n(99),a=n(525),s="["+a+"]",u=RegExp("^"+s+s+"*"),c=RegExp(s+s+"*$"),l=function(e,t,n){var o={},s=i(function(){return!!a[e]()||"​…"!="​…"[e]()}),u=o[e]=s?t(p):a[e];n&&(o[n]=u),r(r.P+r.F*s,"String",o)},p=l.trim=function(e,t){return e=String(o(e)),1&t&&(e=e.replace(u,"")),2&t&&(e=e.replace(c,"")),e};e.exports=l},function(e,t){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(e,t,n){"use strict";var r=n(35),o=n(201)(!1);r(r.P,"String",{codePointAt:function(e){return o(this,e)}})},function(e,t,n){"use strict";var r=n(35),o=n(74),i=n(206),a="".endsWith;r(r.P+r.F*n(207)("endsWith"),"String",{endsWith:function(e){var t=i(this,e,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=o(t.length),s=void 0===n?r:Math.min(o(n),r),u=String(e);return a?a.call(t,u,s):t.slice(s-u.length,s)===u}})},function(e,t,n){"use strict";var r=n(35),o=n(206);r(r.P+r.F*n(207)("includes"),"String",{includes:function(e){return!!~o(this,e,"includes").indexOf(e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(35);r(r.P,"String",{repeat:n(530)})},function(e,t,n){"use strict";var r=n(127),o=n(73);e.exports=function(e){var t=String(o(this)),n="",i=r(e);if(i<0||i==1/0)throw RangeError("Count can't be negative");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n}},function(e,t,n){"use strict";var r=n(35),o=n(74),i=n(206),a="".startsWith;r(r.P+r.F*n(207)("startsWith"),"String",{startsWith:function(e){var t=i(this,e,"startsWith"),n=o(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return a?a.call(t,r,n):t.slice(n,n+r.length)===r}})},function(e,t,n){"use strict";n(42)("anchor",function(e){return function(t){return e(this,"a","name",t)}})},function(e,t,n){"use strict";n(42)("big",function(e){return function(){return e(this,"big","","")}})},function(e,t,n){"use strict";n(42)("blink",function(e){return function(){return e(this,"blink","","")}})},function(e,t,n){"use strict";n(42)("bold",function(e){return function(){return e(this,"b","","")}})},function(e,t,n){"use strict";n(42)("fixed",function(e){return function(){return e(this,"tt","","")}})},function(e,t,n){"use strict";n(42)("fontcolor",function(e){return function(t){return e(this,"font","color",t)}})},function(e,t,n){"use strict";n(42)("fontsize",function(e){return function(t){return e(this,"font","size",t)}})},function(e,t,n){"use strict";n(42)("italics",function(e){return function(){return e(this,"i","","")}})},function(e,t,n){"use strict";n(42)("link",function(e){return function(t){return e(this,"a","href",t)}})},function(e,t,n){"use strict";n(42)("small",function(e){return function(){return e(this,"small","","")}})},function(e,t,n){"use strict";n(42)("strike",function(e){return function(){return e(this,"strike","","")}})},function(e,t,n){"use strict";n(42)("sub",function(e){return function(){return e(this,"sub","","")}})},function(e,t,n){"use strict";n(42)("sup",function(e){return function(){return e(this,"sup","","")}})},function(e,t,n){"use strict";var r=n(45),o=n(74),i=n(208),a=n(156);n(157)("match",1,function(e,t,n,s){return[function(n){var r=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=s(n,e,this);if(t.done)return t.value;var u=r(e),c=String(this);if(!u.global)return a(u,c);var l=u.unicode;u.lastIndex=0;for(var p,f=[],h=0;null!==(p=a(u,c));){var d=String(p[0]);f[h]=d,""===d&&(u.lastIndex=i(c,o(u.lastIndex),l)),h++}return 0===h?null:f}]})},function(e,t,n){"use strict";var r=n(209);n(35)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},function(e,t,n){"use strict";var r=n(45);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){"use strict";var r=n(45),o=n(343),i=n(74),a=n(127),s=n(208),u=n(156),c=Math.max,l=Math.min,p=Math.floor,f=/\$([$&`']|\d\d?|<[^>]*>)/g,h=/\$([$&`']|\d\d?)/g;n(157)("replace",2,function(e,t,n,d){return[function(r,o){var i=e(this),a=null==r?void 0:r[t];return void 0!==a?a.call(r,i,o):n.call(String(i),r,o)},function(e,t){var o=d(n,e,this,t);if(o.done)return o.value;var p=r(e),f=String(this),h="function"==typeof t;h||(t=String(t));var v=p.global;if(v){var g=p.unicode;p.lastIndex=0}for(var y=[];;){var b=u(p,f);if(null===b)break;if(y.push(b),!v)break;""===String(b[0])&&(p.lastIndex=s(f,i(p.lastIndex),g))}for(var _,w="",x=0,E=0;E<y.length;E++){b=y[E];for(var S=String(b[0]),C=c(l(a(b.index),f.length),0),k=[],O=1;O<b.length;O++)k.push(void 0===(_=b[O])?_:String(_));var A=b.groups;if(h){var T=[S].concat(k,C,f);void 0!==A&&T.push(A);var j=String(t.apply(void 0,T))}else j=m(S,f,C,k,A,t);C>=x&&(w+=f.slice(x,C)+j,x=C+S.length)}return w+f.slice(x)}];function m(e,t,r,i,a,s){var u=r+e.length,c=i.length,l=h;return void 0!==a&&(a=o(a),l=f),n.call(s,l,function(n,o){var s;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(u);case"<":s=a[o.slice(1,-1)];break;default:var l=+o;if(0===l)return n;if(l>c){var f=p(l/10);return 0===f?n:f<=c?void 0===i[f-1]?o.charAt(1):i[f-1]+o.charAt(1):n}s=i[l-1]}return void 0===s?"":s})}})},function(e,t,n){"use strict";var r=n(45),o=n(550),i=n(156);n(157)("search",1,function(e,t,n,a){return[function(n){var r=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=a(n,e,this);if(t.done)return t.value;var s=r(e),u=String(this),c=s.lastIndex;o(c,0)||(s.lastIndex=0);var l=i(s,u);return o(s.lastIndex,c)||(s.lastIndex=c),null===l?-1:l.index}]})},function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},function(e,t,n){"use strict";var r=n(347),o=n(45),i=n(204),a=n(208),s=n(74),u=n(156),c=n(209),l=n(99),p=Math.min,f=[].push,h=!l(function(){RegExp(4294967295,"y")});n(157)("split",2,function(e,t,n,l){var d;return d="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,t){var o=String(this);if(void 0===e&&0===t)return[];if(!r(e))return n.call(o,e,t);for(var i,a,s,u=[],l=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),p=0,h=void 0===t?4294967295:t>>>0,d=new RegExp(e.source,l+"g");(i=c.call(d,o))&&!((a=d.lastIndex)>p&&(u.push(o.slice(p,i.index)),i.length>1&&i.index<o.length&&f.apply(u,i.slice(1)),s=i[0].length,p=a,u.length>=h));)d.lastIndex===i.index&&d.lastIndex++;return p===o.length?!s&&d.test("")||u.push(""):u.push(o.slice(p)),u.length>h?u.slice(0,h):u}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var o=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,o,r):d.call(String(o),n,r)},function(e,t){var r=l(d,e,this,t,d!==n);if(r.done)return r.value;var c=o(e),f=String(this),m=i(c,RegExp),v=c.unicode,g=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(h?"y":"g"),y=new m(h?c:"^(?:"+c.source+")",g),b=void 0===t?4294967295:t>>>0;if(0===b)return[];if(0===f.length)return null===u(y,f)?[f]:[];for(var _=0,w=0,x=[];w<f.length;){y.lastIndex=h?w:0;var E,S=u(y,h?f:f.slice(w));if(null===S||(E=p(s(y.lastIndex+(h?0:w)),f.length))===_)w=a(f,w,v);else{if(x.push(f.slice(_,w)),x.length===b)return x;for(var C=1;C<=S.length-1;C++)if(x.push(S[C]),x.length===b)return x;w=_=E}}return x.push(f.slice(_)),x}]})},function(e,t,n){var r=n(22),o=r.JSON||(r.JSON={stringify:JSON.stringify});e.exports=function(e){return o.stringify.apply(o,arguments)}},function(e,t,n){n(554),e.exports=n(22).Object.keys},function(e,t,n){var r=n(100),o=n(129);n(216)("keys",function(){return function(e){return o(r(e))}})},function(e,t,n){var r=n(76),o=n(158),i=n(556);e.exports=function(e){return function(t,n,a){var s,u=r(t),c=o(u.length),l=i(a,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(212),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t,n){e.exports=n(558)},function(e,t,n){n(101),n(103),e.exports=n(221).f("iterator")},function(e,t,n){var r=n(212),o=n(210);e.exports=function(e){return function(t,n){var i,a,s=String(o(t)),u=r(n),c=s.length;return u<0||u>=c?e?"":void 0:(i=s.charCodeAt(u))<55296||i>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):i:e?s.slice(u,u+2):a-56320+(i-55296<<10)+65536}}},function(e,t,n){"use strict";var r=n(160),o=n(133),i=n(134),a={};n(77)(a,n(34)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){"use strict";var r=n(562),o=n(353),i=n(102),a=n(76);e.exports=n(219)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(e,t){e.exports=function(){}},function(e,t,n){e.exports=n(564)},function(e,t,n){n(354),n(164),n(567),n(568),e.exports=n(22).Symbol},function(e,t,n){var r=n(129),o=n(161),i=n(162);e.exports=function(e){var t=r(e),n=o.f;if(n)for(var a,s=n(e),u=i.f,c=0;s.length>c;)u.call(e,a=s[c++])&&t.push(a);return t}},function(e,t,n){var r=n(76),o=n(224).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==i.call(e)?function(e){try{return o(e)}catch(e){return a.slice()}}(e):o(r(e))}},function(e,t,n){n(222)("asyncIterator")},function(e,t,n){n(222)("observable")},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){for(var t,n=c(e),r=n[0],a=n[1],s=new i(function(e,t,n){return 3*(t+n)/4-n}(0,r,a)),u=0,l=a>0?r-4:r,p=0;p<l;p+=4)t=o[e.charCodeAt(p)]<<18|o[e.charCodeAt(p+1)]<<12|o[e.charCodeAt(p+2)]<<6|o[e.charCodeAt(p+3)],s[u++]=t>>16&255,s[u++]=t>>8&255,s[u++]=255&t;2===a&&(t=o[e.charCodeAt(p)]<<2|o[e.charCodeAt(p+1)]>>4,s[u++]=255&t);1===a&&(t=o[e.charCodeAt(p)]<<10|o[e.charCodeAt(p+1)]<<4|o[e.charCodeAt(p+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t);return s},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;a<s;a+=16383)i.push(l(e,a,a+16383>s?s:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)r[s]=a[s],o[a.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<<s)-1,c=u>>1,l=-7,p=n?o-1:0,f=n?-1:1,h=e[t+p];for(p+=f,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+p],p+=f,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+p],p+=f,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=c}return(h?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,p=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,d=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+p>=1?f/u:f*Math.pow(2,1-p))*u>=2&&(a++,u/=2),a+p>=l?(s=0,a=l):a+p>=1?(s=(t*u-1)*Math.pow(2,o),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=d,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+h]=255&a,h+=d,a/=256,c-=8);e[n+h-d]|=128*m}},function(e,t,n){n(572),e.exports=n(22).Array.isArray},function(e,t,n){var r=n(30);r(r.S,"Array",{isArray:n(223)})},function(e,t,n){n(574);var r=n(22).Object;e.exports=function(e,t,n){return r.defineProperty(e,t,n)}},function(e,t,n){var r=n(30);r(r.S+r.F*!n(50),"Object",{defineProperty:n(49).f})},function(e,t,n){n(576),e.exports=n(22).Object.assign},function(e,t,n){var r=n(30);r(r.S+r.F,"Object",{assign:n(356)})},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";var r=n(579),o=n(105),i=n(57),a=n(580),s=r.twoArgumentPooler,u=r.fourArgumentPooler,c=/\/+/g;function l(e){return(""+e).replace(c,"$&/")}function p(e,t){this.func=e,this.context=t,this.count=0}function f(e,t,n){var r=e.func,o=e.context;r.call(o,t,e.count++)}function h(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function d(e,t,n){var r=e.result,a=e.keyPrefix,s=e.func,u=e.context,c=s.call(u,t,e.count++);Array.isArray(c)?m(c,r,n,i.thatReturnsArgument):null!=c&&(o.isValidElement(c)&&(c=o.cloneAndReplaceKey(c,a+(!c.key||t&&t.key===c.key?"":l(c.key)+"/")+n)),r.push(c))}function m(e,t,n,r,o){var i="";null!=n&&(i=l(n)+"/");var s=h.getPooled(t,i,r,o);a(e,d,s),h.release(s)}function v(e,t,n){return null}p.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},r.addPoolingTo(p,s),h.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},r.addPoolingTo(h,u);var g={forEach:function(e,t,n){if(null==e)return e;var r=p.getPooled(t,n);a(e,f,r),p.release(r)},map:function(e,t,n){if(null==e)return e;var r=[];return m(e,r,null,t,n),r},mapIntoWithKeyPrefixInternal:m,count:function(e,t){return a(e,v,null)},toArray:function(e){var t=[];return m(e,t,null,i.thatReturnsArgument),t}};e.exports=g},function(e,t,n){"use strict";var r=n(136),o=(n(15),function(e){if(this.instancePool.length){var t=this.instancePool.pop();return this.call(t,e),t}return new this(e)}),i=function(e){e instanceof this||r("25"),e.destructor(),this.instancePool.length<this.poolSize&&this.instancePool.push(e)},a=o,s={addPoolingTo:function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||a,n.poolSize||(n.poolSize=10),n.release=i,n},oneArgumentPooler:o,twoArgumentPooler:function(e,t){if(this.instancePool.length){var n=this.instancePool.pop();return this.call(n,e,t),n}return new this(e,t)},threeArgumentPooler:function(e,t,n){if(this.instancePool.length){var r=this.instancePool.pop();return this.call(r,e,t,n),r}return new this(e,t,n)},fourArgumentPooler:function(e,t,n,r){if(this.instancePool.length){var o=this.instancePool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)}};e.exports=s},function(e,t,n){"use strict";var r=n(136),o=(n(65),n(360)),i=n(581),a=(n(15),n(582)),s=(n(23),"."),u=":";function c(e,t){return e&&"object"==typeof e&&null!=e.key?a.escape(e.key):t.toString(36)}e.exports=function(e,t,n){return null==e?0:function e(t,n,l,p){var f,h=typeof t;if("undefined"!==h&&"boolean"!==h||(t=null),null===t||"string"===h||"number"===h||"object"===h&&t.$$typeof===o)return l(p,t,""===n?s+c(t,0):n),1;var d=0,m=""===n?s:n+u;if(Array.isArray(t))for(var v=0;v<t.length;v++)d+=e(f=t[v],m+c(f,v),l,p);else{var g=i(t);if(g){var y,b=g.call(t);if(g!==t.entries)for(var _=0;!(y=b.next()).done;)d+=e(f=y.value,m+c(f,_++),l,p);else for(;!(y=b.next()).done;){var w=y.value;w&&(d+=e(f=w[1],m+a.escape(w[0])+u+c(f,0),l,p))}}else if("object"===h){var x=String(t);r("31","[object Object]"===x?"object with keys {"+Object.keys(t).join(", ")+"}":x,"")}}return d}(e,"",t,n)}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";e.exports=function(e){var t=e&&(r&&e[r]||e[o]);if("function"==typeof t)return t}},function(e,t,n){"use strict";var r={escape:function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})},unescape:function(e){var t={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(/(=0|=2)/g,function(e){return t[e]})}};e.exports=r},function(e,t,n){"use strict";var r=n(105).createFactory,o={a:r("a"),abbr:r("abbr"),address:r("address"),area:r("area"),article:r("article"),aside:r("aside"),audio:r("audio"),b:r("b"),base:r("base"),bdi:r("bdi"),bdo:r("bdo"),big:r("big"),blockquote:r("blockquote"),body:r("body"),br:r("br"),button:r("button"),canvas:r("canvas"),caption:r("caption"),cite:r("cite"),code:r("code"),col:r("col"),colgroup:r("colgroup"),data:r("data"),datalist:r("datalist"),dd:r("dd"),del:r("del"),details:r("details"),dfn:r("dfn"),dialog:r("dialog"),div:r("div"),dl:r("dl"),dt:r("dt"),em:r("em"),embed:r("embed"),fieldset:r("fieldset"),figcaption:r("figcaption"),figure:r("figure"),footer:r("footer"),form:r("form"),h1:r("h1"),h2:r("h2"),h3:r("h3"),h4:r("h4"),h5:r("h5"),h6:r("h6"),head:r("head"),header:r("header"),hgroup:r("hgroup"),hr:r("hr"),html:r("html"),i:r("i"),iframe:r("iframe"),img:r("img"),input:r("input"),ins:r("ins"),kbd:r("kbd"),keygen:r("keygen"),label:r("label"),legend:r("legend"),li:r("li"),link:r("link"),main:r("main"),map:r("map"),mark:r("mark"),menu:r("menu"),menuitem:r("menuitem"),meta:r("meta"),meter:r("meter"),nav:r("nav"),noscript:r("noscript"),object:r("object"),ol:r("ol"),optgroup:r("optgroup"),option:r("option"),output:r("output"),p:r("p"),param:r("param"),picture:r("picture"),pre:r("pre"),progress:r("progress"),q:r("q"),rp:r("rp"),rt:r("rt"),ruby:r("ruby"),s:r("s"),samp:r("samp"),script:r("script"),section:r("section"),select:r("select"),small:r("small"),source:r("source"),span:r("span"),strong:r("strong"),style:r("style"),sub:r("sub"),summary:r("summary"),sup:r("sup"),table:r("table"),tbody:r("tbody"),td:r("td"),textarea:r("textarea"),tfoot:r("tfoot"),th:r("th"),thead:r("thead"),time:r("time"),title:r("title"),tr:r("tr"),track:r("track"),u:r("u"),ul:r("ul"),var:r("var"),video:r("video"),wbr:r("wbr"),circle:r("circle"),clipPath:r("clipPath"),defs:r("defs"),ellipse:r("ellipse"),g:r("g"),image:r("image"),line:r("line"),linearGradient:r("linearGradient"),mask:r("mask"),path:r("path"),pattern:r("pattern"),polygon:r("polygon"),polyline:r("polyline"),radialGradient:r("radialGradient"),rect:r("rect"),stop:r("stop"),svg:r("svg"),text:r("text"),tspan:r("tspan")};e.exports=o},function(e,t,n){"use strict";var r=n(105).isValidElement,o=n(361);e.exports=o(r)},function(e,t,n){"use strict";var r=n(362),o=n(25),i=n(363),a=n(587),s=Function.call.bind(Object.prototype.hasOwnProperty),u=function(){};function c(){return null}e.exports=function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,l="@@iterator";var p="<<anonymous>>",f={array:v("array"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:m(c),arrayOf:function(e){return m(function(t,n,r,o,a){if("function"!=typeof e)return new d("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s))return new d("Invalid "+o+" `"+a+"` of type `"+y(s)+"` supplied to `"+r+"`, expected an array.");for(var u=0;u<s.length;u++){var c=e(s,u,r,o,a+"["+u+"]",i);if(c instanceof Error)return c}return null})},element:m(function(t,n,r,o,i){var a=t[n];return e(a)?null:new d("Invalid "+o+" `"+i+"` of type `"+y(a)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:m(function(e,t,n,o,i){var a=e[t];return r.isValidElementType(a)?null:new d("Invalid "+o+" `"+i+"` of type `"+y(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return m(function(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||p;return new d("Invalid "+o+" `"+i+"` of type `"+function(e){if(!e.constructor||!e.constructor.name)return p;return e.constructor.name}(t[n])+"` supplied to `"+r+"`, expected instance of `"+a+"`.")}return null})},node:m(function(e,t,n,r,o){return g(e[t])?null:new d("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return m(function(t,n,r,o,a){if("function"!=typeof e)return new d("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var u=t[n],c=y(u);if("object"!==c)return new d("Invalid "+o+" `"+a+"` of type `"+c+"` supplied to `"+r+"`, expected an object.");for(var l in u)if(s(u,l)){var p=e(u,l,r,o,a+"."+l,i);if(p instanceof Error)return p}return null})},oneOf:function(e){if(!Array.isArray(e))return c;return m(function(t,n,r,o,i){for(var a=t[n],s=0;s<e.length;s++)if(h(a,e[s]))return null;var u=JSON.stringify(e,function(e,t){return"symbol"===b(t)?String(t):t});return new d("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+r+"`, expected one of "+u+".")})},oneOfType:function(e){if(!Array.isArray(e))return c;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return u("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+_(n)+" at index "+t+"."),c}return m(function(t,n,r,o,a){for(var s=0;s<e.length;s++){if(null==(0,e[s])(t,n,r,o,a,i))return null}return new d("Invalid "+o+" `"+a+"` supplied to `"+r+"`.")})},shape:function(e){return m(function(t,n,r,o,a){var s=t[n],u=y(s);if("object"!==u)return new d("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var c in e){var l=e[c];if(l){var p=l(s,c,r,o,a+"."+c,i);if(p)return p}}return null})},exact:function(e){return m(function(t,n,r,a,s){var u=t[n],c=y(u);if("object"!==c)return new d("Invalid "+a+" `"+s+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");var l=o({},t[n],e);for(var p in l){var f=e[p];if(!f)return new d("Invalid "+a+" `"+s+"` key `"+p+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=f(u,p,r,a,s+"."+p,i);if(h)return h}return null})}};function h(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function d(e){this.message=e,this.stack=""}function m(e){function n(n,r,o,a,s,u,c){if((a=a||p,u=u||o,c!==i)&&t){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}return null==r[o]?n?null===r[o]?new d("The "+s+" `"+u+"` is marked as required in `"+a+"`, but its value is `null`."):new d("The "+s+" `"+u+"` is marked as required in `"+a+"`, but its value is `undefined`."):null:e(r,o,a,s,u)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function v(e){return m(function(t,n,r,o,i,a){var s=t[n];return y(s)!==e?new d("Invalid "+o+" `"+i+"` of type `"+b(s)+"` supplied to `"+r+"`, expected `"+e+"`."):null})}function g(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(g);if(null===t||e(t))return!0;var r=function(e){var t=e&&(n&&e[n]||e[l]);if("function"==typeof t)return t}(t);if(!r)return!1;var o,i=r.call(t);if(r!==t.entries){for(;!(o=i.next()).done;)if(!g(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!g(a[1]))return!1}return!0;default:return!1}}function y(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function b(e){if(null==e)return""+e;var t=y(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function _(e){var t=b(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return d.prototype=Error.prototype,f.checkPropTypes=a,f.resetWarningCache=a.resetWarningCache,f.PropTypes=f,f}},function(e,t,n){"use strict"; +/** @license React v16.8.6 + * react-is.production.min.js * - * Copyright(c) 2015 Gregory Jacobs <greg@greg-jacobs.com> - * MIT Licensed. http://www.opensource.org/licenses/mit-license.php + * Copyright (c) Facebook, Inc. and its affiliates. * - * https://github.com/gregjacobs/Autolinker.js + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116;function g(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case p:case f:case a:case u:case s:case d:return e;default:switch(e=e&&e.$$typeof){case l:case h:case c:return e;default:return t}}case v:case m:case i:return t}}}function y(e){return g(e)===f}t.typeOf=g,t.AsyncMode=p,t.ConcurrentMode=f,t.ContextConsumer=l,t.ContextProvider=c,t.Element=o,t.ForwardRef=h,t.Fragment=a,t.Lazy=v,t.Memo=m,t.Portal=i,t.Profiler=u,t.StrictMode=s,t.Suspense=d,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===f||e===u||e===s||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===c||e.$$typeof===l||e.$$typeof===h)},t.isAsyncMode=function(e){return y(e)||g(e)===p},t.isConcurrentMode=y,t.isContextConsumer=function(e){return g(e)===l},t.isContextProvider=function(e){return g(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return g(e)===h},t.isFragment=function(e){return g(e)===a},t.isLazy=function(e){return g(e)===v},t.isMemo=function(e){return g(e)===m},t.isPortal=function(e){return g(e)===i},t.isProfiler=function(e){return g(e)===u},t.isStrictMode=function(e){return g(e)===s},t.isSuspense=function(e){return g(e)===d}},function(e,t,n){"use strict";function r(e,t,n,r,o){}r.resetWarningCache=function(){0},e.exports=r},function(e,t,n){"use strict";e.exports="15.6.2"},function(e,t,n){"use strict";var r=n(357).Component,o=n(105).isValidElement,i=n(358),a=n(590);e.exports=a(r,o,i)},function(e,t,n){"use strict";var r=n(25),o=n(165),i=n(15),a="mixins";e.exports=function(e,t,n){var s=[],u={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",UNSAFE_componentWillMount:"DEFINE_MANY",UNSAFE_componentWillReceiveProps:"DEFINE_MANY",UNSAFE_componentWillUpdate:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},c={getDerivedStateFromProps:"DEFINE_MANY_MERGED"},l={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)f(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=r({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=r({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=d(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){e.propTypes=r({},e.propTypes,t)},statics:function(e,t){!function(e,t){if(!t)return;for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){if(i(!(n in l),'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n),n in e){var o=c.hasOwnProperty(n)?c[n]:null;return i("DEFINE_MANY_MERGED"===o,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),void(e[n]=d(e[n],r))}e[n]=r}}}(e,t)},autobind:function(){}};function p(e,t){var n=u.hasOwnProperty(t)?u[t]:null;b.hasOwnProperty(t)&&i("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&i("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function f(e,n){if(n){i("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),i(!t(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,o=r.__reactAutoBindPairs;for(var s in n.hasOwnProperty(a)&&l.mixins(e,n.mixins),n)if(n.hasOwnProperty(s)&&s!==a){var c=n[s],f=r.hasOwnProperty(s);if(p(f,s),l.hasOwnProperty(s))l[s](e,c);else{var h=u.hasOwnProperty(s);if("function"==typeof c&&!h&&!f&&!1!==n.autobind)o.push(s,c),r[s]=c;else if(f){var v=u[s];i(h&&("DEFINE_MANY_MERGED"===v||"DEFINE_MANY"===v),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",v,s),"DEFINE_MANY_MERGED"===v?r[s]=d(r[s],c):"DEFINE_MANY"===v&&(r[s]=m(r[s],c))}else r[s]=c}}}else;}function h(e,t){for(var n in i(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects."),t)t.hasOwnProperty(n)&&(i(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function d(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return h(o,n),h(o,r),o}}function m(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function v(e,t){return t.bind(e)}var g={componentDidMount:function(){this.__isMounted=!0}},y={componentWillUnmount:function(){this.__isMounted=!1}},b={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return!!this.__isMounted}},_=function(){};return r(_.prototype,e.prototype,b),function(e){var t=function(e,r,a){this.__reactAutoBindPairs.length&&function(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],o=t[n+1];e[r]=v(e,o)}}(this),this.props=e,this.context=r,this.refs=o,this.updater=a||n,this.state=null;var s=this.getInitialState?this.getInitialState():null;i("object"==typeof s&&!Array.isArray(s),"%s.getInitialState(): must return an object or null",t.displayName||"ReactCompositeComponent"),this.state=s};for(var r in t.prototype=new _,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],s.forEach(f.bind(null,t)),f(t,g),f(t,e),f(t,y),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),i(t.prototype.render,"createClass(...): Class specification must implement a `render` method."),u)t.prototype[r]||(t.prototype[r]=null);return t}}},function(e,t,n){"use strict";var r=n(136),o=n(105);n(15);e.exports=function(e){return o.isValidElement(e)||r("143"),e}},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(1),i=(r=o)&&r.__esModule?r:{default:r},a=n(594);t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.default.Map,n=Object.keys(e);return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t(),o=arguments[1];return r.withMutations(function(t){n.forEach(function(n){var r=(0,e[n])(t.get(n),o);(0,a.validateNextState)(r,n,o),t.set(n,r)})})}},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateNextState=t.getUnexpectedInvocationParameterMessage=t.getStateName=void 0;var r=a(n(364)),o=a(n(595)),i=a(n(596));function a(e){return e&&e.__esModule?e:{default:e}}t.getStateName=r.default,t.getUnexpectedInvocationParameterMessage=o.default,t.validateNextState=i.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(1)),o=i(n(364));function i(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t,n){var i=Object.keys(t);if(!i.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";var a=(0,o.default)(n);if(!r.default.Iterable.isIterable(e))return"The "+a+' is of unexpected type. Expected argument to be an instance of Immutable.Iterable with the following properties: "'+i.join('", "')+'".';var s=e.keySeq().toArray().filter(function(e){return!t.hasOwnProperty(e)});return s.length>0?"Unexpected "+(1===s.length?"property":"properties")+' "'+s.join('", "')+'" found in '+a+'. Expected to find one of the known reducer property names instead: "'+i.join('", "')+'". Unexpected properties will be ignored.':null},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if(void 0===e)throw new Error('Reducer "'+t+'" returned undefined when handling "'+n.type+'" action. To ignore an action, you must explicitly return the previous state.')},e.exports=t.default},function(e,t,n){var r=n(14);e.exports=function(e){if(r(e))return e}},function(e,t,n){var r=n(92);e.exports=function(e,t){var n=[],o=!0,i=!1,a=void 0;try{for(var s,u=r(e);!(o=(s=u.next()).done)&&(n.push(s.value),!t||n.length!==t);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}return n}},function(e,t,n){n(103),n(101),e.exports=n(600)},function(e,t,n){var r=n(46),o=n(225);e.exports=n(22).getIterator=function(e){var t=o(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return r(t.call(e))}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){var r=n(69),o=n(270);e.exports=function(e){return o(r(e).toLowerCase())}},function(e,t,n){var r=n(106),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[s]=n:delete e[s]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r=n(606),o=n(369),i=n(607),a=n(69);e.exports=function(e){return function(t){t=a(t);var n=o(t)?i(t):void 0,s=n?n[0]:t.charAt(0),u=n?r(n,1).join(""):t.slice(1);return s[e]()+u}}},function(e,t,n){var r=n(368);e.exports=function(e,t,n){var o=e.length;return n=void 0===n?o:n,!t&&n>=o?e:r(e,t,n)}},function(e,t,n){var r=n(608),o=n(369),i=n(609);e.exports=function(e){return o(e)?i(e):r(e)}},function(e,t){e.exports=function(e){return e.split("")}},function(e,t){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",i="[^\\ud800-\\udfff]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+r+"|"+o+")"+"?",c="[\\ufe0e\\ufe0f]?"+u+("(?:\\u200d(?:"+[i,a,s].join("|")+")[\\ufe0e\\ufe0f]?"+u+")*"),l="(?:"+[i+r+"?",r,a,s,n].join("|")+")",p=RegExp(o+"(?="+o+")|"+l+c,"g");e.exports=function(e){return e.match(p)||[]}},function(e,t,n){var r=n(370),o=n(611),i=n(614),a=RegExp("['’]","g");e.exports=function(e){return function(t){return r(i(o(t).replace(a,"")),e,"")}}},function(e,t,n){var r=n(612),o=n(69),i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,a=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=o(e))&&e.replace(i,r).replace(a,"")}},function(e,t,n){var r=n(613)({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});e.exports=r},function(e,t){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},function(e,t,n){var r=n(615),o=n(616),i=n(69),a=n(617);e.exports=function(e,t,n){return e=i(e),void 0===(t=n?void 0:t)?o(e)?a(e):r(e):e.match(t)||[]}},function(e,t){var n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(n)||[]}},function(e,t){var n=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return n.test(e)}},function(e,t){var n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",r="["+n+"]",o="\\d+",i="[\\u2700-\\u27bf]",a="[a-z\\xdf-\\xf6\\xf8-\\xff]",s="[^\\ud800-\\udfff"+n+o+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",u="(?:\\ud83c[\\udde6-\\uddff]){2}",c="[\\ud800-\\udbff][\\udc00-\\udfff]",l="[A-Z\\xc0-\\xd6\\xd8-\\xde]",p="(?:"+a+"|"+s+")",f="(?:"+l+"|"+s+")",h="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",d="[\\ufe0e\\ufe0f]?"+h+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",u,c].join("|")+")[\\ufe0e\\ufe0f]?"+h+")*"),m="(?:"+[i,u,c].join("|")+")"+d,v=RegExp([l+"?"+a+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[r,l,"$"].join("|")+")",f+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[r,l+p,"$"].join("|")+")",l+"?"+p+"+(?:['’](?:d|ll|m|re|s|t|ve))?",l+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",o,m].join("|"),"g");e.exports=function(e){return e.match(v)||[]}},function(e,t,n){var r=n(619),o=n(169),i=n(227);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(e,t,n){var r=n(620),o=n(625),i=n(626),a=n(627),s=n(628);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},function(e,t,n){var r=n(168);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t,n){var r=n(371),o=n(622),i=n(52),a=n(372),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,p=c.hasOwnProperty,f=RegExp("^"+l.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?f:s).test(a(e))}},function(e,t,n){var r,o=n(623),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},function(e,t,n){var r=n(51)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(168),o="__lodash_hash_undefined__",i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return n===o?void 0:n}return i.call(t,e)?t[e]:void 0}},function(e,t,n){var r=n(168),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},function(e,t,n){var r=n(168),o="__lodash_hash_undefined__";e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?o:t,this}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(170),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}},function(e,t,n){var r=n(170);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(170);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(170);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(171);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(171);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(171);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(171);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},function(e,t,n){var r=n(172),o=n(107),i=n(85);e.exports=function(e){return function(t,n,a){var s=Object(t);if(!o(t)){var u=r(n,3);t=i(t),n=function(e){return u(s[e],e,s)}}var c=e(t,n,a);return c>-1?s[u?t[c]:c]:void 0}}},function(e,t,n){var r=n(641),o=n(667),i=n(384);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?i(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(228),o=n(373),i=1,a=2;e.exports=function(e,t,n,s){var u=n.length,c=u,l=!s;if(null==e)return!c;for(e=Object(e);u--;){var p=n[u];if(l&&p[2]?p[1]!==e[p[0]]:!(p[0]in e))return!1}for(;++u<c;){var f=(p=n[u])[0],h=e[f],d=p[1];if(l&&p[2]){if(void 0===h&&!(f in e))return!1}else{var m=new r;if(s)var v=s(h,d,f,e,t,m);if(!(void 0===v?o(d,h,i|a,s,m):v))return!1}}return!0}},function(e,t,n){var r=n(169);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(169),o=n(227),i=n(226),a=200;e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!o||s.length<a-1)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(s)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(228),o=n(374),i=n(652),a=n(655),s=n(176),u=n(37),c=n(232),l=n(381),p=1,f="[object Arguments]",h="[object Array]",d="[object Object]",m=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,v,g,y){var b=u(e),_=u(t),w=b?h:s(e),x=_?h:s(t),E=(w=w==f?d:w)==d,S=(x=x==f?d:x)==d,C=w==x;if(C&&c(e)){if(!c(t))return!1;b=!0,E=!1}if(C&&!E)return y||(y=new r),b||l(e)?o(e,t,n,v,g,y):i(e,t,w,n,v,g,y);if(!(n&p)){var k=E&&m.call(e,"__wrapped__"),O=S&&m.call(t,"__wrapped__");if(k||O){var A=k?e.value():e,T=O?t.value():t;return y||(y=new r),g(A,T,n,v,y)}}return!!C&&(y||(y=new r),a(e,t,n,v,g,y))}},function(e,t,n){var r=n(226),o=n(649),i=n(650);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,e.exports=a},function(e,t){var n="__lodash_hash_undefined__";e.exports=function(e){return this.__data__.set(e,n),this}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t,n){var r=n(106),o=n(376),i=n(91),a=n(374),s=n(653),u=n(654),c=1,l=2,p="[object Boolean]",f="[object Date]",h="[object Error]",d="[object Map]",m="[object Number]",v="[object RegExp]",g="[object Set]",y="[object String]",b="[object Symbol]",_="[object ArrayBuffer]",w="[object DataView]",x=r?r.prototype:void 0,E=x?x.valueOf:void 0;e.exports=function(e,t,n,r,x,S,C){switch(n){case w:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _:return!(e.byteLength!=t.byteLength||!S(new o(e),new o(t)));case p:case f:case m:return i(+e,+t);case h:return e.name==t.name&&e.message==t.message;case v:case y:return e==t+"";case d:var k=s;case g:var O=r&c;if(k||(k=u),e.size!=t.size&&!O)return!1;var A=C.get(e);if(A)return A==t;r|=l,C.set(e,t);var T=a(k(e),k(t),r,x,S,C);return C.delete(e),T;case b:if(E)return E.call(e)==E.call(t)}return!1}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},function(e,t,n){var r=n(377),o=1,i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,a,s,u){var c=n&o,l=r(e),p=l.length;if(p!=r(t).length&&!c)return!1;for(var f=p;f--;){var h=l[f];if(!(c?h in t:i.call(t,h)))return!1}var d=u.get(e);if(d&&u.get(t))return d==t;var m=!0;u.set(e,t),u.set(t,e);for(var v=c;++f<p;){var g=e[h=l[f]],y=t[h];if(a)var b=c?a(y,g,h,t,e,u):a(g,y,h,e,t,u);if(!(void 0===b?g===y||s(g,y,n,a,u):b)){m=!1;break}v||(v="constructor"==h)}if(m&&!v){var _=e.constructor,w=t.constructor;_!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof _&&_ instanceof _&&"function"==typeof w&&w instanceof w)&&(m=!1)}return u.delete(e),u.delete(t),m}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},function(e,t,n){var r=n(83),o=n(66),i="[object Arguments]";e.exports=function(e){return o(e)&&r(e)==i}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(83),o=n(233),i=n(66),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[r(e)]}},function(e,t,n){var r=n(175),o=n(662),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t,n){var r=n(382)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(84)(n(51),"DataView");e.exports=r},function(e,t,n){var r=n(84)(n(51),"Promise");e.exports=r},function(e,t,n){var r=n(84)(n(51),"Set");e.exports=r},function(e,t,n){var r=n(84)(n(51),"WeakMap");e.exports=r},function(e,t,n){var r=n(383),o=n(85);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,r(a)]}return t}},function(e,t,n){var r=n(373),o=n(93),i=n(385),a=n(236),s=n(383),u=n(384),c=n(109),l=1,p=2;e.exports=function(e,t){return a(e)&&s(t)?u(c(e),t):function(n){var a=o(n,e);return void 0===a&&a===t?i(n,e):r(t,a,l|p)}}},function(e,t,n){var r=n(670),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,function(e,n,r,o){t.push(r?o.replace(i,"$1"):n||e)}),t});e.exports=a},function(e,t,n){var r=n(271),o=500;e.exports=function(e){var t=r(e,function(e){return n.size===o&&n.clear(),e}),n=t.cache;return t}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,n){var r=n(108),o=n(231),i=n(37),a=n(174),s=n(233),u=n(109);e.exports=function(e,t,n){for(var c=-1,l=(t=r(t,e)).length,p=!1;++c<l;){var f=u(t[c]);if(!(p=null!=e&&n(e,f)))break;e=e[f]}return p||++c!=l?p:!!(l=null==e?0:e.length)&&s(l)&&a(f,l)&&(i(e)||o(e))}},function(e,t,n){var r=n(674),o=n(675),i=n(236),a=n(109);e.exports=function(e){return i(e)?r(a(e)):o(e)}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,n){var r=n(177);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){var r=n(677),o=n(172),i=n(386),a=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var u=null==n?0:i(n);return u<0&&(u=a(s+u,0)),r(e,o(t,3),u)}},function(e,t){e.exports=function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}},function(e,t,n){var r=n(387),o=1/0,i=17976931348623157e292;e.exports=function(e){return e?(e=r(e))===o||e===-o?(e<0?-1:1)*i:e==e?e:0:0===e?e:0}},function(e,t,n){var r=n(388);e.exports=function(e,t){var n;return r(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}},function(e,t,n){var r=n(681),o=n(85);e.exports=function(e,t){return e&&r(e,t,o)}},function(e,t,n){var r=n(682)();e.exports=r},function(e,t){e.exports=function(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++o];if(!1===n(i[u],u,i))break}return t}}},function(e,t,n){var r=n(107);e.exports=function(e,t){return function(n,o){if(null==n)return n;if(!r(n))return e(n,o);for(var i=n.length,a=t?i:-1,s=Object(n);(t?a--:++a<i)&&!1!==o(s[a],a,s););return n}}},function(e,t){var n={"&":"&",'"':""","'":"'","<":"<",">":">"};e.exports=function(e){return e&&e.replace?e.replace(/([&"<>'])/g,function(e,t){return n[t]}):e}},function(e,t,n){e.exports=o;var r=n(238).EventEmitter;function o(){r.call(this)}n(47)(o,r),o.Readable=n(239),o.Writable=n(692),o.Duplex=n(693),o.Transform=n(694),o.PassThrough=n(695),o.Stream=o,o.prototype.pipe=function(e,t){var n=this;function o(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",o),e.on("drain",i),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(l(),0===r.listenerCount(this,"error"))throw e}function l(){n.removeListener("data",o),e.removeListener("drain",i),n.removeListener("end",s),n.removeListener("close",u),n.removeListener("error",c),e.removeListener("error",c),n.removeListener("end",l),n.removeListener("close",l),e.removeListener("close",l)}return n.on("error",c),e.on("error",c),n.on("end",l),n.on("close",l),e.on("close",l),e.emit("pipe",n),e}},function(e,t){},function(e,t,n){"use strict";var r=n(48).Buffer,o=n(688);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,o,i=r.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,n=i,o=s,t.copy(n,o),s+=a.data.length,a=a.next;return i},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,s,u=1,c={},l=!1,p=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){d(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){i.port2.postMessage(e)}):p&&"onreadystatechange"in p.createElement("script")?(o=p.documentElement,r=function(e){var t=p.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(d,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&d(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return c[u]=o,r(u),u++},f.clearImmediate=h}function h(e){delete c[e]}function d(e){if(l)setTimeout(d,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{h(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(36),n(67))},function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n(36))},function(e,t,n){"use strict";e.exports=i;var r=n(395),o=n(137);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}o.inherits=n(47),o.inherits(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){e.exports=n(240)},function(e,t,n){e.exports=n(86)},function(e,t,n){e.exports=n(239).Transform},function(e,t,n){e.exports=n(239).PassThrough},function(e,t,n){"use strict";var r=n(697),o=Math.abs,i=Math.floor;e.exports=function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?r(e)*i(o(e)):e}},function(e,t,n){"use strict";e.exports=n(698)()?Math.sign:n(699)},function(e,t,n){"use strict";e.exports=function(){var e=Math.sign;return"function"==typeof e&&(1===e(10)&&-1===e(-20))}},function(e,t,n){"use strict";e.exports=function(e){return e=Number(e),isNaN(e)||0===e?e:e>0?1:-1}},function(e,t,n){"use strict";var r=n(78),o=n(179),i=n(89),a=n(702),s=n(398);e.exports=function e(t){var n,u,c;if(r(t),(n=Object(arguments[1])).async&&n.promise)throw new Error("Options 'async' and 'promise' cannot be used together");return hasOwnProperty.call(t,"__memoized__")&&!n.force?t:(u=s(n.length,t.length,n.async&&i.async),c=a(t,u,n),o(i,function(e,t){n[t]&&e(n[t],c,n)}),e.__profiler__&&e.__profiler__(c),c.updateEnv(),c.memoized)}},function(e,t,n){"use strict";var r=n(78),o=n(110),i=Function.prototype.bind,a=Function.prototype.call,s=Object.keys,u=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(n,c){var l,p=arguments[2],f=arguments[3];return n=Object(o(n)),r(c),l=s(n),f&&l.sort("function"==typeof f?i.call(f,n):void 0),"function"!=typeof e&&(e=l[e]),a.call(e,l,function(e,r){return u.call(n,e)?a.call(c,p,n[e],e,n,r):t})}}},function(e,t,n){"use strict";var r=n(703),o=n(400),i=n(180),a=n(713).methods,s=n(714),u=n(726),c=Function.prototype.apply,l=Function.prototype.call,p=Object.create,f=Object.defineProperties,h=a.on,d=a.emit;e.exports=function(e,t,n){var a,m,v,g,y,b,_,w,x,E,S,C,k,O,A,T=p(null);return m=!1!==t?t:isNaN(e.length)?1:e.length,n.normalizer&&(E=u(n.normalizer),v=E.get,g=E.set,y=E.delete,b=E.clear),null!=n.resolvers&&(A=s(n.resolvers)),O=v?o(function(t){var n,o,i=arguments;if(A&&(i=A(i)),null!==(n=v(i))&&hasOwnProperty.call(T,n))return S&&a.emit("get",n,i,this),T[n];if(o=1===i.length?l.call(e,this,i[0]):c.call(e,this,i),null===n){if(null!==(n=v(i)))throw r("Circular invocation","CIRCULAR_INVOCATION");n=g(i)}else if(hasOwnProperty.call(T,n))throw r("Circular invocation","CIRCULAR_INVOCATION");return T[n]=o,C&&a.emit("set",n,null,o),o},m):0===t?function(){var t;if(hasOwnProperty.call(T,"data"))return S&&a.emit("get","data",arguments,this),T.data;if(t=arguments.length?c.call(e,this,arguments):l.call(e,this),hasOwnProperty.call(T,"data"))throw r("Circular invocation","CIRCULAR_INVOCATION");return T.data=t,C&&a.emit("set","data",null,t),t}:function(t){var n,o,i=arguments;if(A&&(i=A(arguments)),o=String(i[0]),hasOwnProperty.call(T,o))return S&&a.emit("get",o,i,this),T[o];if(n=1===i.length?l.call(e,this,i[0]):c.call(e,this,i),hasOwnProperty.call(T,o))throw r("Circular invocation","CIRCULAR_INVOCATION");return T[o]=n,C&&a.emit("set",o,null,n),n},a={original:e,memoized:O,profileName:n.profileName,get:function(e){return A&&(e=A(e)),v?v(e):String(e[0])},has:function(e){return hasOwnProperty.call(T,e)},delete:function(e){var t;hasOwnProperty.call(T,e)&&(y&&y(e),t=T[e],delete T[e],k&&a.emit("delete",e,t))},clear:function(){var e=T;b&&b(),T=p(null),a.emit("clear",e)},on:function(e,t){return"get"===e?S=!0:"set"===e?C=!0:"delete"===e&&(k=!0),h.call(this,e,t)},emit:d,updateEnv:function(){e=a.original}},_=v?o(function(e){var t,n=arguments;A&&(n=A(n)),null!==(t=v(n))&&a.delete(t)},m):0===t?function(){return a.delete("data")}:function(e){return A&&(e=A(arguments)[0]),a.delete(e)},w=o(function(){var e,n=arguments;return 0===t?T.data:(A&&(n=A(n)),e=v?v(n):String(n[0]),T[e])}),x=o(function(){var e,n=arguments;return 0===t?a.has("data"):(A&&(n=A(n)),null!==(e=v?v(n):String(n[0]))&&a.has(e))}),f(O,{__memoized__:i(!0),delete:i(_),clear:i(a.clear),_get:i(w),_has:i(x)}),a}},function(e,t,n){"use strict";var r=n(399),o=n(709),i=n(87),a=Error.captureStackTrace;t=e.exports=function(e){var n=new Error(e),s=arguments[1],u=arguments[2];return i(u)||o(s)&&(u=s,s=null),i(u)&&r(n,u),i(s)&&(n.code=s),a&&a(n,t),n}},function(e,t,n){"use strict";e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,n){"use strict";var r=n(706),o=n(110),i=Math.max;e.exports=function(e,t){var n,a,s,u=i(arguments.length,2);for(e=Object(o(e)),s=function(r){try{e[r]=t[r]}catch(e){n||(n=e)}},a=1;a<u;++a)t=arguments[a],r(t).forEach(s);if(void 0!==n)throw n;return e}},function(e,t,n){"use strict";e.exports=n(707)()?Object.keys:n(708)},function(e,t,n){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,n){"use strict";var r=n(87),o=Object.keys;e.exports=function(e){return o(r(e)?Object(e):e)}},function(e,t,n){"use strict";var r=n(87),o={function:!0,object:!0};e.exports=function(e){return r(e)&&o[typeof e]||!1}},function(e,t,n){"use strict";e.exports=n(711)()?String.prototype.contains:n(712)},function(e,t,n){"use strict";var r="razdwatrzy";e.exports=function(){return"function"==typeof r.contains&&(!0===r.contains("dwa")&&!1===r.contains("foo"))}},function(e,t,n){"use strict";var r=String.prototype.indexOf;e.exports=function(e){return r.call(this,e,arguments[1])>-1}},function(e,t,n){"use strict";var r,o,i,a,s,u,c,l=n(180),p=n(78),f=Function.prototype.apply,h=Function.prototype.call,d=Object.create,m=Object.defineProperty,v=Object.defineProperties,g=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};o=function(e,t){var n,o;return p(t),o=this,r.call(this,e,n=function(){i.call(o,e,n),f.call(t,this,arguments)}),n.__eeOnceListener__=t,this},s={on:r=function(e,t){var n;return p(t),g.call(this,"__ee__")?n=this.__ee__:(n=y.value=d(null),m(this,"__ee__",y),y.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},once:o,off:i=function(e,t){var n,r,o,i;if(p(t),!g.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"==typeof(r=n[e]))for(i=0;o=r[i];++i)o!==t&&o.__eeOnceListener__!==t||(2===r.length?n[e]=r[i?0:1]:r.splice(i,1));else r!==t&&r.__eeOnceListener__!==t||delete n[e];return this},emit:a=function(e){var t,n,r,o,i;if(g.call(this,"__ee__")&&(o=this.__ee__[e]))if("object"==typeof o){for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];for(o=o.slice(),t=0;r=o[t];++t)f.call(r,this,i)}else switch(arguments.length){case 1:h.call(o,this);break;case 2:h.call(o,this,arguments[1]);break;case 3:h.call(o,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];f.call(o,this,i)}}},u={on:l(r),once:l(o),off:l(i),emit:l(a)},c=v({},u),e.exports=t=function(e){return null==e?d(c):v(Object(e),u)},t.methods=s},function(e,t,n){"use strict";var r,o=n(715),i=n(87),a=n(78),s=Array.prototype.slice;r=function(e){return this.map(function(t,n){return t?t(e[n]):e[n]}).concat(s.call(e,this.length))},e.exports=function(e){return(e=o(e)).forEach(function(e){i(e)&&a(e)}),r.bind(e)}},function(e,t,n){"use strict";var r=n(242),o=Array.isArray;e.exports=function(e){return o(e)?e:r(e)}},function(e,t,n){"use strict";e.exports=function(){var e,t,n=Array.from;return"function"==typeof n&&(t=n(e=["raz","dwa"]),Boolean(t&&t!==e&&"dwa"===t[1]))}},function(e,t,n){"use strict";var r=n(718).iterator,o=n(723),i=n(724),a=n(88),s=n(78),u=n(110),c=n(87),l=n(725),p=Array.isArray,f=Function.prototype.call,h={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;e.exports=function(e){var t,n,m,v,g,y,b,_,w,x,E=arguments[1],S=arguments[2];if(e=Object(u(e)),c(E)&&s(E),this&&this!==Array&&i(this))t=this;else{if(!E){if(o(e))return 1!==(g=e.length)?Array.apply(null,e):((v=new Array(1))[0]=e[0],v);if(p(e)){for(v=new Array(g=e.length),n=0;n<g;++n)v[n]=e[n];return v}}v=[]}if(!p(e))if(void 0!==(w=e[r])){for(b=s(w).call(e),t&&(v=new t),_=b.next(),n=0;!_.done;)x=E?f.call(E,S,_.value,n):_.value,t?(h.value=x,d(v,n,h)):v[n]=x,_=b.next(),++n;g=n}else if(l(e)){for(g=e.length,t&&(v=new t),n=0,m=0;n<g;++n)x=e[n],n+1<g&&(y=x.charCodeAt(0))>=55296&&y<=56319&&(x+=e[++n]),x=E?f.call(E,S,x,m):x,t?(h.value=x,d(v,m,h)):v[m]=x,++m;g=m}if(void 0===g)for(g=a(e.length),t&&(v=new t(g)),n=0;n<g;++n)x=E?f.call(E,S,e[n],n):e[n],t?(h.value=x,d(v,n,h)):v[n]=x;return t&&(h.value=null,v.length=g),v}},function(e,t,n){"use strict";e.exports=n(719)()?Symbol:n(720)},function(e,t,n){"use strict";var r={object:!0,symbol:!0};e.exports=function(){var e;if("function"!=typeof Symbol)return!1;e=Symbol("test symbol");try{String(e)}catch(e){return!1}return!!r[typeof Symbol.iterator]&&(!!r[typeof Symbol.toPrimitive]&&!!r[typeof Symbol.toStringTag])}},function(e,t,n){"use strict";var r,o,i,a,s=n(180),u=n(721),c=Object.create,l=Object.defineProperties,p=Object.defineProperty,f=Object.prototype,h=c(null);if("function"==typeof Symbol){r=Symbol;try{String(r()),a=!0}catch(e){}}var d,m=(d=c(null),function(e){for(var t,n,r=0;d[e+(r||"")];)++r;return d[e+=r||""]=!0,p(f,t="@@"+e,s.gs(null,function(e){n||(n=!0,p(this,t,s(e)),n=!1)})),t});i=function(e){if(this instanceof i)throw new TypeError("Symbol is not a constructor");return o(e)},e.exports=o=function e(t){var n;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return a?r(t):(n=c(i.prototype),t=void 0===t?"":String(t),l(n,{__description__:s("",t),__name__:s("",m(t))}))},l(o,{for:s(function(e){return h[e]?h[e]:h[e]=o(String(e))}),keyFor:s(function(e){var t;for(t in u(e),h)if(h[t]===e)return t}),hasInstance:s("",r&&r.hasInstance||o("hasInstance")),isConcatSpreadable:s("",r&&r.isConcatSpreadable||o("isConcatSpreadable")),iterator:s("",r&&r.iterator||o("iterator")),match:s("",r&&r.match||o("match")),replace:s("",r&&r.replace||o("replace")),search:s("",r&&r.search||o("search")),species:s("",r&&r.species||o("species")),split:s("",r&&r.split||o("split")),toPrimitive:s("",r&&r.toPrimitive||o("toPrimitive")),toStringTag:s("",r&&r.toStringTag||o("toStringTag")),unscopables:s("",r&&r.unscopables||o("unscopables"))}),l(i.prototype,{constructor:s(o),toString:s("",function(){return this.__name__})}),l(o.prototype,{toString:s(function(){return"Symbol ("+u(this).__description__+")"}),valueOf:s(function(){return u(this)})}),p(o.prototype,o.toPrimitive,s("",function(){var e=u(this);return"symbol"==typeof e?e:e.toString()})),p(o.prototype,o.toStringTag,s("c","Symbol")),p(i.prototype,o.toStringTag,s("c",o.prototype[o.toStringTag])),p(i.prototype,o.toPrimitive,s("c",o.prototype[o.toPrimitive]))},function(e,t,n){"use strict";var r=n(722);e.exports=function(e){if(!r(e))throw new TypeError(e+" is not a symbol");return e}},function(e,t,n){"use strict";e.exports=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&("Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag]))}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=r.call(function(){return arguments}());e.exports=function(e){return r.call(e)===o}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=r.call(n(397));e.exports=function(e){return"function"==typeof e&&r.call(e)===o}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=r.call("");e.exports=function(e){return"string"==typeof e||e&&"object"==typeof e&&(e instanceof String||r.call(e)===o)||!1}},function(e,t,n){"use strict";var r=n(78);e.exports=function(e){var t;return"function"==typeof e?{set:e,get:e}:(t={get:r(e.get)},void 0!==e.set?(t.set=r(e.set),e.delete&&(t.delete=r(e.delete)),e.clear&&(t.clear=r(e.clear)),t):(t.set=t.get,t))}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r=e.length;if(!r)return"";for(t=String(e[n=0]);--r;)t+=""+e[++n];return t}},function(e,t,n){"use strict";e.exports=function(e){return e?function(t){for(var n=String(t[0]),r=0,o=e;--o;)n+=""+t[++r];return n}:function(){return""}}},function(e,t,n){"use strict";var r=n(243),o=Object.create;e.exports=function(){var e=0,t=[],n=o(null);return{get:function(e){var n,o=0,i=t,a=e.length;if(0===a)return i[a]||null;if(i=i[a]){for(;o<a-1;){if(-1===(n=r.call(i[0],e[o])))return null;i=i[1][n],++o}return-1===(n=r.call(i[0],e[o]))?null:i[1][n]||null}return null},set:function(o){var i,a=0,s=t,u=o.length;if(0===u)s[u]=++e;else{for(s[u]||(s[u]=[[],[]]),s=s[u];a<u-1;)-1===(i=r.call(s[0],o[a]))&&(i=s[0].push(o[a])-1,s[1].push([[],[]])),s=s[1][i],++a;-1===(i=r.call(s[0],o[a]))&&(i=s[0].push(o[a])-1),s[1][i]=++e}return n[e]=o,e},delete:function(e){var o,i=0,a=t,s=n[e],u=s.length,c=[];if(0===u)delete a[u];else if(a=a[u]){for(;i<u-1;){if(-1===(o=r.call(a[0],s[i])))return;c.push(a,o),a=a[1][o],++i}if(-1===(o=r.call(a[0],s[i])))return;for(e=a[1][o],a[0].splice(o,1),a[1].splice(o,1);!a[0].length&&c.length;)o=c.pop(),(a=c.pop())[0].splice(o,1),a[1].splice(o,1)}delete n[e]},clear:function(){t=[],n=o(null)}}}},function(e,t,n){"use strict";e.exports=n(731)()?Number.isNaN:n(732)},function(e,t,n){"use strict";e.exports=function(){var e=Number.isNaN;return"function"==typeof e&&(!e({})&&e(NaN)&&!e(34))}},function(e,t,n){"use strict";e.exports=function(e){return e!=e}},function(e,t,n){"use strict";var r=n(243);e.exports=function(){var e=0,t=[],n=[];return{get:function(e){var o=r.call(t,e[0]);return-1===o?null:n[o]},set:function(r){return t.push(r[0]),n.push(++e),e},delete:function(e){var o=r.call(n,e);-1!==o&&(t.splice(o,1),n.splice(o,1))},clear:function(){t=[],n=[]}}}},function(e,t,n){"use strict";var r=n(243),o=Object.create;e.exports=function(e){var t=0,n=[[],[]],i=o(null);return{get:function(t){for(var o,i=0,a=n;i<e-1;){if(-1===(o=r.call(a[0],t[i])))return null;a=a[1][o],++i}return-1===(o=r.call(a[0],t[i]))?null:a[1][o]||null},set:function(o){for(var a,s=0,u=n;s<e-1;)-1===(a=r.call(u[0],o[s]))&&(a=u[0].push(o[s])-1,u[1].push([[],[]])),u=u[1][a],++s;return-1===(a=r.call(u[0],o[s]))&&(a=u[0].push(o[s])-1),u[1][a]=++t,i[t]=o,t},delete:function(t){for(var o,a=0,s=n,u=[],c=i[t];a<e-1;){if(-1===(o=r.call(s[0],c[a])))return;u.push(s,o),s=s[1][o],++a}if(-1!==(o=r.call(s[0],c[a]))){for(t=s[1][o],s[0].splice(o,1),s[1].splice(o,1);!s[0].length&&u.length;)o=u.pop(),(s=u.pop())[0].splice(o,1),s[1].splice(o,1);delete i[t]}},clear:function(){n=[[],[]],i=o(null)}}}},function(e,t,n){"use strict";var r=n(242),o=n(402),i=n(401),a=n(400),s=n(244),u=Array.prototype.slice,c=Function.prototype.apply,l=Object.create;n(89).async=function(e,t){var n,p,f,h=l(null),d=l(null),m=t.memoized,v=t.original;t.memoized=a(function(e){var t=arguments,r=t[t.length-1];return"function"==typeof r&&(n=r,t=u.call(t,0,-1)),m.apply(p=this,f=t)},m);try{i(t.memoized,m)}catch(e){}t.on("get",function(e){var r,o,i;if(n){if(h[e])return"function"==typeof h[e]?h[e]=[h[e],n]:h[e].push(n),void(n=null);r=n,o=p,i=f,n=p=f=null,s(function(){var a;hasOwnProperty.call(d,e)?(a=d[e],t.emit("getasync",e,i,o),c.call(r,a.context,a.args)):(n=r,p=o,f=i,m.apply(o,i))})}}),t.original=function(){var e,o,i,a;return n?(e=r(arguments),o=function e(n){var o,i,u=e.id;if(null!=u){if(delete e.id,o=h[u],delete h[u],o)return i=r(arguments),t.has(u)&&(n?t.delete(u):(d[u]={context:this,args:i},t.emit("setasync",u,"function"==typeof o?1:o.length))),"function"==typeof o?a=c.call(o,this,i):o.forEach(function(e){a=c.call(e,this,i)},this),a}else s(c.bind(e,this,arguments))},i=n,n=p=f=null,e.push(o),a=c.call(v,this,e),o.cb=i,n=o,a):c.call(v,this,arguments)},t.on("set",function(e){n?(h[e]?"function"==typeof h[e]?h[e]=[h[e],n.cb]:h[e].push(n.cb):h[e]=n.cb,delete n.cb,n.id=e,n=null):t.delete(e)}),t.on("delete",function(e){var n;hasOwnProperty.call(h,e)||d[e]&&(n=d[e],delete d[e],t.emit("deleteasync",e,u.call(n.args,1)))}),t.on("clear",function(){var e=d;d=l(null),t.emit("clearasync",o(e,function(e){return u.call(e.args,1)}))})}},function(e,t,n){"use strict";var r=n(402),o=n(737),i=n(738),a=n(740),s=n(403),u=n(244),c=Object.create,l=o("then","then:finally","done","done:finally");n(89).promise=function(e,t){var n=c(null),o=c(null),p=c(null);if(!0===e)e=null;else if(e=i(e),!l[e])throw new TypeError("'"+a(e)+"' is not valid promise mode");t.on("set",function(r,i,a){var c=!1;if(!s(a))return o[r]=a,void t.emit("setasync",r,1);n[r]=1,p[r]=a;var l=function(e){var i=n[r];if(c)throw new Error("Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode)\nConsider to rely on 'then' or 'done' mode instead.");i&&(delete n[r],o[r]=e,t.emit("setasync",r,i))},f=function(){c=!0,n[r]&&(delete n[r],delete p[r],t.delete(r))},h=e;if(h||(h="then"),"then"===h){var d=function(){u(f)};"function"==typeof(a=a.then(function(e){u(l.bind(this,e))},d)).finally&&a.finally(d)}else if("done"===h){if("function"!=typeof a.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");a.done(l,f)}else if("done:finally"===h){if("function"!=typeof a.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if("function"!=typeof a.finally)throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");a.done(l),a.finally(f)}}),t.on("get",function(e,r,o){var i;if(n[e])++n[e];else{i=p[e];var a=function(){t.emit("getasync",e,r,o)};s(i)?"function"==typeof i.done?i.done(a):i.then(function(){u(a)}):a()}}),t.on("delete",function(e){if(delete p[e],n[e])delete n[e];else if(hasOwnProperty.call(o,e)){var r=o[e];delete o[e],t.emit("deleteasync",e,[r])}}),t.on("clear",function(){var e=o;o=c(null),n=c(null),p=c(null),t.emit("clearasync",r(e,function(e){return[e]}))})}},function(e,t,n){"use strict";var r=Array.prototype.forEach,o=Object.create;e.exports=function(e){var t=o(null);return r.call(arguments,function(e){t[e]=!0}),t}},function(e,t,n){"use strict";var r=n(110),o=n(739);e.exports=function(e){return o(r(e))}},function(e,t,n){"use strict";var r=n(241);e.exports=function(e){try{return e&&r(e.toString)?e.toString():String(e)}catch(e){throw new TypeError("Passed argument cannot be stringifed")}}},function(e,t,n){"use strict";var r=n(741),o=/[\n\r\u2028\u2029]/g;e.exports=function(e){var t=r(e);return t.length>100&&(t=t.slice(0,99)+"…"),t=t.replace(o,function(e){return JSON.stringify(e).slice(1,-1)})}},function(e,t,n){"use strict";var r=n(241);e.exports=function(e){try{return e&&r(e.toString)?e.toString():String(e)}catch(e){return"<Non-coercible to string value>"}}},function(e,t,n){"use strict";var r=n(78),o=n(179),i=n(89),a=Function.prototype.apply;i.dispose=function(e,t,n){var s;if(r(e),n.async&&i.async||n.promise&&i.promise)return t.on("deleteasync",s=function(t,n){a.call(e,null,n)}),void t.on("clearasync",function(e){o(e,function(e,t){s(t,e)})});t.on("delete",s=function(t,n){e(n)}),t.on("clear",function(e){o(e,function(e,t){s(t,e)})})}},function(e,t,n){"use strict";var r=n(242),o=n(179),i=n(244),a=n(403),s=n(744),u=n(89),c=Function.prototype,l=Math.max,p=Math.min,f=Object.create;u.maxAge=function(e,t,n){var h,d,m,v;(e=s(e))&&(h=f(null),d=n.async&&u.async||n.promise&&u.promise?"async":"",t.on("set"+d,function(n){h[n]=setTimeout(function(){t.delete(n)},e),"function"==typeof h[n].unref&&h[n].unref(),v&&(v[n]&&"nextTick"!==v[n]&&clearTimeout(v[n]),v[n]=setTimeout(function(){delete v[n]},m),"function"==typeof v[n].unref&&v[n].unref())}),t.on("delete"+d,function(e){clearTimeout(h[e]),delete h[e],v&&("nextTick"!==v[e]&&clearTimeout(v[e]),delete v[e])}),n.preFetch&&(m=!0===n.preFetch||isNaN(n.preFetch)?.333:l(p(Number(n.preFetch),1),0))&&(v={},m=(1-m)*e,t.on("get"+d,function(e,o,s){v[e]||(v[e]="nextTick",i(function(){var i;"nextTick"===v[e]&&(delete v[e],t.delete(e),n.async&&(o=r(o)).push(c),i=t.memoized.apply(s,o),n.promise&&a(i)&&("function"==typeof i.done?i.done(c,c):i.then(c,c)))}))})),t.on("clear"+d,function(){o(h,function(e){clearTimeout(e)}),h={},v&&(o(v,function(e){"nextTick"!==e&&clearTimeout(e)}),v={})}))}},function(e,t,n){"use strict";var r=n(88),o=n(745);e.exports=function(e){if((e=r(e))>o)throw new TypeError(e+" exceeds maximum possible timeout");return e}},function(e,t,n){"use strict";e.exports=2147483647},function(e,t,n){"use strict";var r=n(88),o=n(747),i=n(89);i.max=function(e,t,n){var a,s,u;(e=r(e))&&(s=o(e),a=n.async&&i.async||n.promise&&i.promise?"async":"",t.on("set"+a,u=function(e){void 0!==(e=s.hit(e))&&t.delete(e)}),t.on("get"+a,u),t.on("delete"+a,s.delete),t.on("clear"+a,s.clear))}},function(e,t,n){"use strict";var r=n(88),o=Object.create,i=Object.prototype.hasOwnProperty;e.exports=function(e){var t,n=0,a=1,s=o(null),u=o(null),c=0;return e=r(e),{hit:function(r){var o=u[r],l=++c;if(s[l]=r,u[r]=l,!o){if(++n<=e)return;return r=s[a],t(r),r}if(delete s[o],a===o)for(;!i.call(s,++a);)continue},delete:t=function(e){var t=u[e];if(t&&(delete s[t],delete u[e],--n,a===t)){if(!n)return c=0,void(a=1);for(;!i.call(s,++a);)continue}},clear:function(){n=0,a=1,s=o(null),u=o(null),c=0}}}},function(e,t,n){"use strict";var r=n(180),o=n(89),i=Object.create,a=Object.defineProperties;o.refCounter=function(e,t,n){var s,u;s=i(null),u=n.async&&o.async||n.promise&&o.promise?"async":"",t.on("set"+u,function(e,t){s[e]=t||1}),t.on("get"+u,function(e){++s[e]}),t.on("delete"+u,function(e){delete s[e]}),t.on("clear"+u,function(){s={}}),a(t.memoized,{deleteRef:r(function(){var e=t.get(arguments);return null===e?null:s[e]?!--s[e]&&(t.delete(e),!0):null}),getRefCount:r(function(){var e=t.get(arguments);return null===e?0:s[e]?s[e]:0})})}},function(e,t,n){var r=n(47),o=n(111),i=n(48).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,o.call(this,64,56)}function c(e){return e<<30|e>>>2}function l(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r(u,o),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,o=0|this._b,i=0|this._c,s=0|this._d,u=0|this._e,p=0;p<16;++p)n[p]=e.readInt32BE(4*p);for(;p<80;++p)n[p]=n[p-3]^n[p-8]^n[p-14]^n[p-16];for(var f=0;f<80;++f){var h=~~(f/20),d=0|((t=r)<<5|t>>>27)+l(h,o,i,s)+u+n[f]+a[h];u=s,s=i,i=c(o),o=r,r=d}this._a=r+this._a|0,this._b=o+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,n){var r=n(47),o=n(111),i=n(48).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,o.call(this,64,56)}function c(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function p(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r(u,o),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,o=0|this._b,i=0|this._c,s=0|this._d,u=0|this._e,f=0;f<16;++f)n[f]=e.readInt32BE(4*f);for(;f<80;++f)n[f]=(t=n[f-3]^n[f-8]^n[f-14]^n[f-16])<<1|t>>>31;for(var h=0;h<80;++h){var d=~~(h/20),m=c(r)+p(d,o,i,s)+u+n[h]+a[d]|0;u=s,s=i,i=l(o),o=r,r=m}this._a=r+this._a|0,this._b=o+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,n){var r=n(47),o=n(404),i=n(111),a=n(48).Buffer,s=new Array(64);function u(){this.init(),this._w=s,i.call(this,64,56)}r(u,o),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},function(e,t,n){var r=n(47),o=n(405),i=n(111),a=n(48).Buffer,s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}r(u,o),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},function(e,t){e.exports=function(e,t,n,r,o){return o(e,function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)}),n}},function(e,t,n){var r=n(14);e.exports=function(e){if(r(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}},function(e,t,n){var r=n(756),o=n(759);e.exports=function(e){if(o(Object(e))||"[object Arguments]"===Object.prototype.toString.call(e))return r(e)}},function(e,t,n){e.exports=n(757)},function(e,t,n){n(101),n(758),e.exports=n(22).Array.from},function(e,t,n){"use strict";var r=n(63),o=n(30),i=n(100),a=n(406),s=n(407),u=n(158),c=n(408),l=n(225);o(o.S+o.F*!n(409)(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,o,p,f=i(e),h="function"==typeof this?this:Array,d=arguments.length,m=d>1?arguments[1]:void 0,v=void 0!==m,g=0,y=l(f);if(v&&(m=r(m,d>2?arguments[2]:void 0,2)),null==y||h==Array&&s(y))for(n=new h(t=u(f.length));t>g;g++)c(n,g,v?m(f[g],g):f[g]);else for(p=y.call(f),n=new h;!(o=p.next()).done;g++)c(n,g,v?a(p,m,[o.value,g],!0):o.value);return n.length=g,n}})},function(e,t,n){e.exports=n(760)},function(e,t,n){n(103),n(101),e.exports=n(761)},function(e,t,n){var r=n(166),o=n(34)("iterator"),i=n(102);e.exports=n(22).isIterable=function(e){var t=Object(e);return void 0!==t[o]||"@@iterator"in t||i.hasOwnProperty(r(t))}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t,n){n(764);var r=n(22).Object;e.exports=function(e,t){return r.defineProperties(e,t)}},function(e,t,n){var r=n(30);r(r.S+r.F*!n(50),"Object",{defineProperties:n(350)})},function(e,t,n){n(766),e.exports=n(22).Object.getOwnPropertyDescriptors},function(e,t,n){var r=n(30),o=n(767),i=n(76),a=n(163),s=n(408);r(r.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=i(e),u=a.f,c=o(r),l={},p=0;c.length>p;)void 0!==(n=u(r,t=c[p++]))&&s(l,t,n);return l}})},function(e,t,n){var r=n(224),o=n(161),i=n(46),a=n(32).Reflect;e.exports=a&&a.ownKeys||function(e){var t=r.f(i(e)),n=o.f;return n?t.concat(n(e)):t}},function(e,t,n){n(769);var r=n(22).Object;e.exports=function(e,t){return r.getOwnPropertyDescriptor(e,t)}},function(e,t,n){var r=n(76),o=n(163).f;n(216)("getOwnPropertyDescriptor",function(){return function(e,t){return o(r(e),t)}})},function(e,t,n){n(354),e.exports=n(22).Object.getOwnPropertySymbols},function(e,t,n){var r=n(17);e.exports=function(e,t){if(null==e)return{};var n,o,i={},a=r(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}},function(e,t,n){n(773),e.exports=n(22).Date.now},function(e,t,n){var r=n(30);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},function(e,t,n){n(164),n(101),n(103),n(775),n(779),n(780),e.exports=n(22).Promise},function(e,t,n){"use strict";var r,o,i,a,s=n(131),u=n(32),c=n(63),l=n(166),p=n(30),f=n(43),h=n(132),d=n(181),m=n(112),v=n(410),g=n(411).set,y=n(777)(),b=n(245),_=n(412),w=n(778),x=n(413),E=u.TypeError,S=u.process,C=S&&S.versions,k=C&&C.v8||"",O=u.Promise,A="process"==l(S),T=function(){},j=o=b.f,P=!!function(){try{var e=O.resolve(1),t=(e.constructor={})[n(34)("species")]=function(e){e(T,T)};return(A||"function"==typeof PromiseRejectionEvent)&&e.then(T)instanceof t&&0!==k.indexOf("6.6")&&-1===w.indexOf("Chrome/66")}catch(e){}}(),I=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},M=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var r=e._v,o=1==e._s,i=0,a=function(t){var n,i,a,s=o?t.ok:t.fail,u=t.resolve,c=t.reject,l=t.domain;try{s?(o||(2==e._h&&D(e),e._h=1),!0===s?n=r:(l&&l.enter(),n=s(r),l&&(l.exit(),a=!0)),n===t.promise?c(E("Promise-chain cycle")):(i=I(n))?i.call(n,u,c):u(n)):c(r)}catch(e){l&&!a&&l.exit(),c(e)}};n.length>i;)a(n[i++]);e._c=[],e._n=!1,t&&!e._h&&N(e)})}},N=function(e){g.call(u,function(){var t,n,r,o=e._v,i=R(e);if(i&&(t=_(function(){A?S.emit("unhandledRejection",o,e):(n=u.onunhandledrejection)?n({promise:e,reason:o}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",o)}),e._h=A||R(e)?2:1),e._a=void 0,i&&t.e)throw t.v})},R=function(e){return 1!==e._h&&0===(e._a||e._c).length},D=function(e){g.call(u,function(){var t;A?S.emit("rejectionHandled",e):(t=u.onrejectionhandled)&&t({promise:e,reason:e._v})})},L=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),M(t,!0))},U=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw E("Promise can't be resolved itself");(t=I(e))?y(function(){var r={_w:n,_d:!1};try{t.call(e,c(U,r,1),c(L,r,1))}catch(e){L.call(r,e)}}):(n._v=e,n._s=1,M(n,!1))}catch(e){L.call({_w:n,_d:!1},e)}}};P||(O=function(e){d(this,O,"Promise","_h"),h(e),r.call(this);try{e(c(U,this,1),c(L,this,1))}catch(e){L.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(182)(O.prototype,{then:function(e,t){var n=j(v(this,O));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=A?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r;this.promise=e,this.resolve=c(U,e,1),this.reject=c(L,e,1)},b.f=j=function(e){return e===O||e===a?new i(e):o(e)}),p(p.G+p.W+p.F*!P,{Promise:O}),n(134)(O,"Promise"),n(414)("Promise"),a=n(22).Promise,p(p.S+p.F*!P,"Promise",{reject:function(e){var t=j(this);return(0,t.reject)(e),t.promise}}),p(p.S+p.F*(s||!P),"Promise",{resolve:function(e){return x(s&&this===a?O:this,e)}}),p(p.S+p.F*!(P&&n(409)(function(e){O.all(e).catch(T)})),"Promise",{all:function(e){var t=this,n=j(t),r=n.resolve,o=n.reject,i=_(function(){var n=[],i=0,a=1;m(e,!1,function(e){var s=i++,u=!1;n.push(void 0),a++,t.resolve(e).then(function(e){u||(u=!0,n[s]=e,--a||r(n))},o)}),--a||r(n)});return i.e&&o(i.v),n.promise},race:function(e){var t=this,n=j(t),r=n.reject,o=_(function(){m(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(32),o=n(411).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,u="process"==n(130)(a);e.exports=function(){var e,t,n,c=function(){var r,o;for(u&&(r=a.domain)&&r.exit();e;){o=e.fn,e=e.next;try{o()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){a.nextTick(c)};else if(!i||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var l=s.resolve(void 0);n=function(){l.then(c)}}else n=function(){o.call(r,c)};else{var p=!0,f=document.createTextNode("");new i(c).observe(f,{characterData:!0}),n=function(){f.data=p=!p}}return function(r){var o={fn:r,next:void 0};t&&(t.next=o),e||(e=o,n()),t=o}}},function(e,t,n){var r=n(32).navigator;e.exports=r&&r.userAgent||""},function(e,t,n){"use strict";var r=n(30),o=n(22),i=n(32),a=n(410),s=n(413);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,o.Promise||i.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(30),o=n(245),i=n(412);r(r.S,"Promise",{try:function(e){var t=o.f(this),n=i(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,i=Object.create(o.prototype),a=new O(r||[]);return i._invoke=function(e,t,n){var r=l;return function(o,i){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return T()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=S(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var u=c(e,t,n);if("normal"===u.type){if(r=n.done?h:p,u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=h,n.method="throw",n.arg=u.arg)}}}(e,n,a),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l="suspendedStart",p="suspendedYield",f="executing",h="completed",d={};function m(){}function v(){}function g(){}var y={};y[i]=function(){return this};var b=Object.getPrototypeOf,_=b&&b(b(A([])));_&&_!==n&&r.call(_,i)&&(y=_);var w=g.prototype=m.prototype=Object.create(y);function x(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function E(e){var t;this._invoke=function(n,o){function i(){return new Promise(function(t,i){!function t(n,o,i,a){var s=c(e[n],e,o);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then(function(e){t("next",e,i,a)},function(e){t("throw",e,i,a)}):Promise.resolve(l).then(function(e){u.value=e,i(u)},function(e){return t("throw",e,i,a)})}a(s.arg)}(n,o,t,i)})}return t=t?t.then(i,i):i()}}function S(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method))return d;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=c(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,d):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function A(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:T}}function T(){return{value:t,done:!0}}return v.prototype=w.constructor=g,g.constructor=v,g[s]=v.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},x(E.prototype),E.prototype[a]=function(){return this},e.AsyncIterator=E,e.async=function(t,n,r,o){var i=new E(u(t,n,r,o));return e.isGeneratorFunction(n)?i:i.next().then(function(e){return e.done?e.value:i.next()})},x(w),w[s]="Generator",w[i]=function(){return this},w.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=A,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),d}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){"use strict";var r=n(783),o=n(802);function i(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}e.exports.Type=n(31),e.exports.Schema=n(114),e.exports.FAILSAFE_SCHEMA=n(246),e.exports.JSON_SCHEMA=n(416),e.exports.CORE_SCHEMA=n(415),e.exports.DEFAULT_SAFE_SCHEMA=n(139),e.exports.DEFAULT_FULL_SCHEMA=n(183),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.safeLoad=r.safeLoad,e.exports.safeLoadAll=r.safeLoadAll,e.exports.dump=o.dump,e.exports.safeDump=o.safeDump,e.exports.YAMLException=n(138),e.exports.MINIMAL_SCHEMA=n(246),e.exports.SAFE_SCHEMA=n(139),e.exports.DEFAULT_SCHEMA=n(183),e.exports.scan=i("scan"),e.exports.parse=i("parse"),e.exports.compose=i("compose"),e.exports.addConstructor=i("addConstructor")},function(e,t,n){"use strict";var r=n(113),o=n(138),i=n(784),a=n(139),s=n(183),u=Object.prototype.hasOwnProperty,c=1,l=2,p=3,f=4,h=1,d=2,m=3,v=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,g=/[\x85\u2028\u2029]/,y=/[,\[\]\{\}]/,b=/^(?:!|!!|![a-z\-]+!)$/i,_=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function w(e){return Object.prototype.toString.call(e)}function x(e){return 10===e||13===e}function E(e){return 9===e||32===e}function S(e){return 9===e||32===e||10===e||13===e}function C(e){return 44===e||91===e||93===e||123===e||125===e}function k(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function O(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e?"\t":9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function A(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var T=new Array(256),j=new Array(256),P=0;P<256;P++)T[P]=O(P)?1:0,j[P]=O(P);function I(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||s,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function M(e,t){return new o(t,new i(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function N(e,t){throw M(e,t)}function R(e,t){e.onWarning&&e.onWarning.call(null,M(e,t))}var D={YAML:function(e,t,n){var r,o,i;null!==e.version&&N(e,"duplication of %YAML directive"),1!==n.length&&N(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&N(e,"ill-formed argument of the YAML directive"),o=parseInt(r[1],10),i=parseInt(r[2],10),1!==o&&N(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=i<2,1!==i&&2!==i&&R(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,o;2!==n.length&&N(e,"TAG directive accepts exactly two arguments"),r=n[0],o=n[1],b.test(r)||N(e,"ill-formed tag handle (first argument) of the TAG directive"),u.call(e.tagMap,r)&&N(e,'there is a previously declared suffix for "'+r+'" tag handle'),_.test(o)||N(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[r]=o}};function L(e,t,n,r){var o,i,a,s;if(t<n){if(s=e.input.slice(t,n),r)for(o=0,i=s.length;o<i;o+=1)9===(a=s.charCodeAt(o))||32<=a&&a<=1114111||N(e,"expected valid JSON character");else v.test(s)&&N(e,"the stream contains non-printable characters");e.result+=s}}function U(e,t,n,o){var i,a,s,c;for(r.isObject(n)||N(e,"cannot merge mappings; the provided source object is unacceptable"),s=0,c=(i=Object.keys(n)).length;s<c;s+=1)a=i[s],u.call(t,a)||(t[a]=n[a],o[a]=!0)}function q(e,t,n,r,o,i,a,s){var c,l;if(Array.isArray(o))for(c=0,l=(o=Array.prototype.slice.call(o)).length;c<l;c+=1)Array.isArray(o[c])&&N(e,"nested arrays are not supported inside keys"),"object"==typeof o&&"[object Object]"===w(o[c])&&(o[c]="[object Object]");if("object"==typeof o&&"[object Object]"===w(o)&&(o="[object Object]"),o=String(o),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(i))for(c=0,l=i.length;c<l;c+=1)U(e,t,i[c],n);else U(e,t,i,n);else e.json||u.call(n,o)||!u.call(t,o)||(e.line=a||e.line,e.position=s||e.position,N(e,"duplicated mapping key")),t[o]=i,delete n[o];return t}function F(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):N(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function B(e,t,n){for(var r=0,o=e.input.charCodeAt(e.position);0!==o;){for(;E(o);)o=e.input.charCodeAt(++e.position);if(t&&35===o)do{o=e.input.charCodeAt(++e.position)}while(10!==o&&13!==o&&0!==o);if(!x(o))break;for(F(e),o=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===o;)e.lineIndent++,o=e.input.charCodeAt(++e.position)}return-1!==n&&0!==r&&e.lineIndent<n&&R(e,"deficient indentation"),r}function z(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!S(t)))}function V(e,t){1===t?e.result+=" ":t>1&&(e.result+=r.repeat("\n",t-1))}function H(e,t){var n,r,o=e.tag,i=e.anchor,a=[],s=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),r=e.input.charCodeAt(e.position);0!==r&&45===r&&S(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,B(e,!0,-1)&&e.lineIndent<=t)a.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,K(e,t,p,!1,!0),a.push(e.result),B(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)N(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!s&&(e.tag=o,e.anchor=i,e.kind="sequence",e.result=a,!0)}function W(e){var t,n,r,o,i=!1,a=!1;if(33!==(o=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&N(e,"duplication of a tag property"),60===(o=e.input.charCodeAt(++e.position))?(i=!0,o=e.input.charCodeAt(++e.position)):33===o?(a=!0,n="!!",o=e.input.charCodeAt(++e.position)):n="!",t=e.position,i){do{o=e.input.charCodeAt(++e.position)}while(0!==o&&62!==o);e.position<e.length?(r=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):N(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==o&&!S(o);)33===o&&(a?N(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),b.test(n)||N(e,"named tag handle cannot contain such characters"),a=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),y.test(r)&&N(e,"tag suffix cannot contain flow indicator characters")}return r&&!_.test(r)&&N(e,"tag name cannot contain such characters: "+r),i?e.tag=r:u.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:N(e,'undeclared tag handle "'+n+'"'),!0}function J(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&N(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!S(n)&&!C(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&N(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function K(e,t,n,o,i){var a,s,v,g,y,b,_,w,O=1,P=!1,I=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=s=v=f===n||p===n,o&&B(e,!0,-1)&&(P=!0,e.lineIndent>t?O=1:e.lineIndent===t?O=0:e.lineIndent<t&&(O=-1)),1===O)for(;W(e)||J(e);)B(e,!0,-1)?(P=!0,v=a,e.lineIndent>t?O=1:e.lineIndent===t?O=0:e.lineIndent<t&&(O=-1)):v=!1;if(v&&(v=P||i),1!==O&&f!==n||(_=c===n||l===n?t:t+1,w=e.position-e.lineStart,1===O?v&&(H(e,w)||function(e,t,n){var r,o,i,a,s,u=e.tag,c=e.anchor,p={},h={},d=null,m=null,v=null,g=!1,y=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=p),s=e.input.charCodeAt(e.position);0!==s;){if(r=e.input.charCodeAt(e.position+1),i=e.line,a=e.position,63!==s&&58!==s||!S(r)){if(!K(e,n,l,!1,!0))break;if(e.line===i){for(s=e.input.charCodeAt(e.position);E(s);)s=e.input.charCodeAt(++e.position);if(58===s)S(s=e.input.charCodeAt(++e.position))||N(e,"a whitespace character is expected after the key-value separator within a block mapping"),g&&(q(e,p,h,d,m,null),d=m=v=null),y=!0,g=!1,o=!1,d=e.tag,m=e.result;else{if(!y)return e.tag=u,e.anchor=c,!0;N(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!y)return e.tag=u,e.anchor=c,!0;N(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===s?(g&&(q(e,p,h,d,m,null),d=m=v=null),y=!0,g=!0,o=!0):g?(g=!1,o=!0):N(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,s=r;if((e.line===i||e.lineIndent>t)&&(K(e,t,f,!0,o)&&(g?m=e.result:v=e.result),g||(q(e,p,h,d,m,v,i,a),d=m=v=null),B(e,!0,-1),s=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==s)N(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return g&&q(e,p,h,d,m,null),y&&(e.tag=u,e.anchor=c,e.kind="mapping",e.result=p),y}(e,w,_))||function(e,t){var n,r,o,i,a,s,u,l,p,f,h=!0,d=e.tag,m=e.anchor,v={};if(91===(f=e.input.charCodeAt(e.position)))o=93,s=!1,r=[];else{if(123!==f)return!1;o=125,s=!0,r={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=r),f=e.input.charCodeAt(++e.position);0!==f;){if(B(e,!0,t),(f=e.input.charCodeAt(e.position))===o)return e.position++,e.tag=d,e.anchor=m,e.kind=s?"mapping":"sequence",e.result=r,!0;h||N(e,"missed comma between flow collection entries"),p=null,i=a=!1,63===f&&S(e.input.charCodeAt(e.position+1))&&(i=a=!0,e.position++,B(e,!0,t)),n=e.line,K(e,t,c,!1,!0),l=e.tag,u=e.result,B(e,!0,t),f=e.input.charCodeAt(e.position),!a&&e.line!==n||58!==f||(i=!0,f=e.input.charCodeAt(++e.position),B(e,!0,t),K(e,t,c,!1,!0),p=e.result),s?q(e,r,v,l,u,p):i?r.push(q(e,null,v,l,u,p)):r.push(u),B(e,!0,t),44===(f=e.input.charCodeAt(e.position))?(h=!0,f=e.input.charCodeAt(++e.position)):h=!1}N(e,"unexpected end of the stream within a flow collection")}(e,_)?I=!0:(s&&function(e,t){var n,o,i,a,s,u=h,c=!1,l=!1,p=t,f=0,v=!1;if(124===(a=e.input.charCodeAt(e.position)))o=!1;else{if(62!==a)return!1;o=!0}for(e.kind="scalar",e.result="";0!==a;)if(43===(a=e.input.charCodeAt(++e.position))||45===a)h===u?u=43===a?m:d:N(e,"repeat of a chomping mode identifier");else{if(!((i=48<=(s=a)&&s<=57?s-48:-1)>=0))break;0===i?N(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?N(e,"repeat of an indentation width identifier"):(p=t+i-1,l=!0)}if(E(a)){do{a=e.input.charCodeAt(++e.position)}while(E(a));if(35===a)do{a=e.input.charCodeAt(++e.position)}while(!x(a)&&0!==a)}for(;0!==a;){for(F(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!l||e.lineIndent<p)&&32===a;)e.lineIndent++,a=e.input.charCodeAt(++e.position);if(!l&&e.lineIndent>p&&(p=e.lineIndent),x(a))f++;else{if(e.lineIndent<p){u===m?e.result+=r.repeat("\n",c?1+f:f):u===h&&c&&(e.result+="\n");break}for(o?E(a)?(v=!0,e.result+=r.repeat("\n",c?1+f:f)):v?(v=!1,e.result+=r.repeat("\n",f+1)):0===f?c&&(e.result+=" "):e.result+=r.repeat("\n",f):e.result+=r.repeat("\n",c?1+f:f),c=!0,l=!0,f=0,n=e.position;!x(a)&&0!==a;)a=e.input.charCodeAt(++e.position);L(e,n,e.position,!1)}}return!0}(e,_)||function(e,t){var n,r,o;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=o=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(L(e,r,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;r=e.position,e.position++,o=e.position}else x(n)?(L(e,r,o,!0),V(e,B(e,!1,t)),r=o=e.position):e.position===e.lineStart&&z(e)?N(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);N(e,"unexpected end of the stream within a single quoted scalar")}(e,_)||function(e,t){var n,r,o,i,a,s,u;if(34!==(s=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(s=e.input.charCodeAt(e.position));){if(34===s)return L(e,n,e.position,!0),e.position++,!0;if(92===s){if(L(e,n,e.position,!0),x(s=e.input.charCodeAt(++e.position)))B(e,!1,t);else if(s<256&&T[s])e.result+=j[s],e.position++;else if((a=120===(u=s)?2:117===u?4:85===u?8:0)>0){for(o=a,i=0;o>0;o--)(a=k(s=e.input.charCodeAt(++e.position)))>=0?i=(i<<4)+a:N(e,"expected hexadecimal character");e.result+=A(i),e.position++}else N(e,"unknown escape sequence");n=r=e.position}else x(s)?(L(e,n,r,!0),V(e,B(e,!1,t)),n=r=e.position):e.position===e.lineStart&&z(e)?N(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}N(e,"unexpected end of the stream within a double quoted scalar")}(e,_)?I=!0:!function(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!S(r)&&!C(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&N(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),e.anchorMap.hasOwnProperty(n)||N(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],B(e,!0,-1),!0}(e)?function(e,t,n){var r,o,i,a,s,u,c,l,p=e.kind,f=e.result;if(S(l=e.input.charCodeAt(e.position))||C(l)||35===l||38===l||42===l||33===l||124===l||62===l||39===l||34===l||37===l||64===l||96===l)return!1;if((63===l||45===l)&&(S(r=e.input.charCodeAt(e.position+1))||n&&C(r)))return!1;for(e.kind="scalar",e.result="",o=i=e.position,a=!1;0!==l;){if(58===l){if(S(r=e.input.charCodeAt(e.position+1))||n&&C(r))break}else if(35===l){if(S(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&z(e)||n&&C(l))break;if(x(l)){if(s=e.line,u=e.lineStart,c=e.lineIndent,B(e,!1,-1),e.lineIndent>=t){a=!0,l=e.input.charCodeAt(e.position);continue}e.position=i,e.line=s,e.lineStart=u,e.lineIndent=c;break}}a&&(L(e,o,i,!1),V(e,e.line-s),o=i=e.position,a=!1),E(l)||(i=e.position+1),l=e.input.charCodeAt(++e.position)}return L(e,o,i,!1),!!e.result||(e.kind=p,e.result=f,!1)}(e,_,c===n)&&(I=!0,null===e.tag&&(e.tag="?")):(I=!0,null===e.tag&&null===e.anchor||N(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===O&&(I=v&&H(e,w))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(g=0,y=e.implicitTypes.length;g<y;g+=1)if((b=e.implicitTypes[g]).resolve(e.result)){e.result=b.construct(e.result),e.tag=b.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else u.call(e.typeMap[e.kind||"fallback"],e.tag)?(b=e.typeMap[e.kind||"fallback"][e.tag],null!==e.result&&b.kind!==e.kind&&N(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+b.kind+'", not "'+e.kind+'"'),b.resolve(e.result)?(e.result=b.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):N(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):N(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||I}function Y(e){var t,n,r,o,i=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(o=e.input.charCodeAt(e.position))&&(B(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==o));){for(a=!0,o=e.input.charCodeAt(++e.position),t=e.position;0!==o&&!S(o);)o=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&N(e,"directive name must not be less than one character in length");0!==o;){for(;E(o);)o=e.input.charCodeAt(++e.position);if(35===o){do{o=e.input.charCodeAt(++e.position)}while(0!==o&&!x(o));break}if(x(o))break;for(t=e.position;0!==o&&!S(o);)o=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==o&&F(e),u.call(D,n)?D[n](e,n,r):R(e,'unknown document directive "'+n+'"')}B(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,B(e,!0,-1)):a&&N(e,"directives end mark is expected"),K(e,e.lineIndent-1,f,!1,!0),B(e,!0,-1),e.checkLineBreaks&&g.test(e.input.slice(i,e.position))&&R(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&z(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,B(e,!0,-1)):e.position<e.length-1&&N(e,"end of the stream or a document separator is expected")}function $(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new I(e,t);for(n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Y(n);return n.documents}function G(e,t,n){var r,o,i=$(e,n);if("function"!=typeof t)return i;for(r=0,o=i.length;r<o;r+=1)t(i[r])}function Z(e,t){var n=$(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new o("expected a single document in the stream, but found more")}}e.exports.loadAll=G,e.exports.load=Z,e.exports.safeLoadAll=function(e,t,n){if("function"!=typeof t)return G(e,r.extend({schema:a},n));G(e,t,r.extend({schema:a},n))},e.exports.safeLoad=function(e,t){return Z(e,r.extend({schema:a},t))}},function(e,t,n){"use strict";var r=n(113);function o(e,t,n,r,o){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=o}o.prototype.getSnippet=function(e,t){var n,o,i,a,s;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",o=this.position;o>0&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(o-1));)if(o-=1,this.position-o>t/2-1){n=" ... ",o+=5;break}for(i="",a=this.position;a<this.buffer.length&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(a));)if((a+=1)-this.position>t/2-1){i=" ... ",a-=5;break}return s=this.buffer.slice(o,a),r.repeat(" ",e)+n+s+i+"\n"+r.repeat(" ",e+this.position-o+n.length)+"^"},o.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet())&&(n+=":\n"+t),n},e.exports=o},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},function(e,t,n){"use strict";var r=n(113),o=n(31);function i(e){return 48<=e&&e<=55}function a(e){return 48<=e&&e<=57}e.exports=new o("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=e.length,o=0,s=!1;if(!r)return!1;if("-"!==(t=e[o])&&"+"!==t||(t=e[++o]),"0"===t){if(o+1===r)return!0;if("b"===(t=e[++o])){for(o++;o<r;o++)if("_"!==(t=e[o])){if("0"!==t&&"1"!==t)return!1;s=!0}return s&&"_"!==t}if("x"===t){for(o++;o<r;o++)if("_"!==(t=e[o])){if(!(48<=(n=e.charCodeAt(o))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;s=!0}return s&&"_"!==t}for(;o<r;o++)if("_"!==(t=e[o])){if(!i(e.charCodeAt(o)))return!1;s=!0}return s&&"_"!==t}if("_"===t)return!1;for(;o<r;o++)if("_"!==(t=e[o])){if(":"===t)break;if(!a(e.charCodeAt(o)))return!1;s=!0}return!(!s||"_"===t)&&(":"!==t||/^(:[0-5]?[0-9])+$/.test(e.slice(o)))},construct:function(e){var t,n,r=e,o=1,i=[];return-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),"-"!==(t=r[0])&&"+"!==t||("-"===t&&(o=-1),t=(r=r.slice(1))[0]),"0"===r?0:"0"===t?"b"===r[1]?o*parseInt(r.slice(2),2):"x"===r[1]?o*parseInt(r,16):o*parseInt(r,8):-1!==r.indexOf(":")?(r.split(":").forEach(function(e){i.unshift(parseInt(e,10))}),r=0,n=1,i.forEach(function(e){r+=e*n,n*=60}),o*r):o*parseInt(r,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!r.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},function(e,t,n){"use strict";var r=n(113),o=n(31),i=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var a=/^[-+]?[0-9]+e/;e.exports=new o("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!i.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n,r,o;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,o=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:t.indexOf(":")>=0?(t.split(":").forEach(function(e){o.unshift(parseFloat(e,10))}),t=0,r=1,o.forEach(function(e){t+=e*r,r*=60}),n*t):n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||r.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(e))return"-0.0";return n=e.toString(10),a.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},function(e,t,n){"use strict";var r=n(31),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");e.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==o.exec(e)||null!==i.exec(e))},construct:function(e){var t,n,r,a,s,u,c,l,p=0,f=null;if(null===(t=o.exec(e))&&(t=i.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,a=+t[3],!t[4])return new Date(Date.UTC(n,r,a));if(s=+t[4],u=+t[5],c=+t[6],t[7]){for(p=t[7].slice(0,3);p.length<3;)p+="0";p=+p}return t[9]&&(f=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(f=-f)),l=new Date(Date.UTC(n,r,a,s,u,c,p)),f&&l.setTime(l.getTime()-f),l},instanceOf:Date,represent:function(e){return e.toISOString()}})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})},function(e,t,n){"use strict";var r;try{r=n(64).Buffer}catch(e){}var o=n(31),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";e.exports=new o("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,o=e.length,a=i;for(n=0;n<o;n++)if(!((t=a.indexOf(e.charAt(n)))>64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,o=e.replace(/[\r\n=]/g,""),a=o.length,s=i,u=0,c=[];for(t=0;t<a;t++)t%4==0&&t&&(c.push(u>>16&255),c.push(u>>8&255),c.push(255&u)),u=u<<6|s.indexOf(o.charAt(t));return 0===(n=a%4*6)?(c.push(u>>16&255),c.push(u>>8&255),c.push(255&u)):18===n?(c.push(u>>10&255),c.push(u>>2&255)):12===n&&c.push(u>>4&255),r?r.from?r.from(c):new r(c):c},predicate:function(e){return r&&r.isBuffer(e)},represent:function(e){var t,n,r="",o=0,a=e.length,s=i;for(t=0;t<a;t++)t%3==0&&t&&(r+=s[o>>18&63],r+=s[o>>12&63],r+=s[o>>6&63],r+=s[63&o]),o=(o<<8)+e[t];return 0===(n=a%3)?(r+=s[o>>18&63],r+=s[o>>12&63],r+=s[o>>6&63],r+=s[63&o]):2===n?(r+=s[o>>10&63],r+=s[o>>4&63],r+=s[o<<2&63],r+=s[64]):1===n&&(r+=s[o>>2&63],r+=s[o<<4&63],r+=s[64],r+=s[64]),r}})},function(e,t,n){"use strict";var r=n(31),o=Object.prototype.hasOwnProperty,i=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,a,s,u=[],c=e;for(t=0,n=c.length;t<n;t+=1){if(r=c[t],s=!1,"[object Object]"!==i.call(r))return!1;for(a in r)if(o.call(r,a)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==u.indexOf(a))return!1;u.push(a)}return!0},construct:function(e){return null!==e?e:[]}})},function(e,t,n){"use strict";var r=n(31),o=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,i,a,s=e;for(a=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(r=s[t],"[object Object]"!==o.call(r))return!1;if(1!==(i=Object.keys(r)).length)return!1;a[t]=[i[0],r[i[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,r,o,i,a=e;for(i=new Array(a.length),t=0,n=a.length;t<n;t+=1)r=a[t],o=Object.keys(r),i[t]=[o[0],r[o[0]]];return i}})},function(e,t,n){"use strict";var r=n(31),o=Object.prototype.hasOwnProperty;e.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(o.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(e){return void 0===e},represent:function(){return""}})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";if("/"===t[0]){if(n&&(r=n[1]),r.length>3)return!1;if("/"!==t[t.length-r.length-1])return!1}return!0},construct:function(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return"/"===t[0]&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)},predicate:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},represent:function(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}})},function(e,t,n){"use strict";var r;try{r=n(801)}catch(e){"undefined"!=typeof window&&(r=window.esprima)}var o=n(31);e.exports=new o("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(e){if(null===e)return!1;try{var t="("+e+")",n=r.parse(t,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&("ArrowFunctionExpression"===n.body[0].expression.type||"FunctionExpression"===n.body[0].expression.type)}catch(e){return!1}},construct:function(e){var t,n="("+e+")",o=r.parse(n,{range:!0}),i=[];if("Program"!==o.type||1!==o.body.length||"ExpressionStatement"!==o.body[0].type||"ArrowFunctionExpression"!==o.body[0].expression.type&&"FunctionExpression"!==o.body[0].expression.type)throw new Error("Failed to resolve function");return o.body[0].expression.params.forEach(function(e){i.push(e.name)}),t=o.body[0].expression.body.range,"BlockStatement"===o.body[0].expression.body.type?new Function(i,n.slice(t[0]+1,t[1]-1)):new Function(i,"return "+n.slice(t[0],t[1]))},predicate:function(e){return"[object Function]"===Object.prototype.toString.call(e)},represent:function(e){return e.toString()}})},function(t,n){if(void 0===e){var r=new Error("Cannot find module 'esprima'");throw r.code="MODULE_NOT_FOUND",r}t.exports=e},function(e,t,n){"use strict";var r=n(113),o=n(138),i=n(183),a=n(139),s=Object.prototype.toString,u=Object.prototype.hasOwnProperty,c=9,l=10,p=32,f=33,h=34,d=35,m=37,v=38,g=39,y=42,b=44,_=45,w=58,x=62,E=63,S=64,C=91,k=93,O=96,A=123,T=124,j=125,P={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},I=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function M(e){var t,n,i;if(t=e.toString(16).toUpperCase(),e<=255)n="x",i=2;else if(e<=65535)n="u",i=4;else{if(!(e<=4294967295))throw new o("code point within a string may not be greater than 0xFFFFFFFF");n="U",i=8}return"\\"+n+r.repeat("0",i-t.length)+t}function N(e){this.schema=e.schema||i,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=r.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,r,o,i,a,s,c;if(null===t)return{};for(n={},o=0,i=(r=Object.keys(t)).length;o<i;o+=1)a=r[o],s=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),(c=e.compiledTypeMap.fallback[a])&&u.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[a]=s;return n}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function R(e,t){for(var n,o=r.repeat(" ",t),i=0,a=-1,s="",u=e.length;i<u;)-1===(a=e.indexOf("\n",i))?(n=e.slice(i),i=u):(n=e.slice(i,a+1),i=a+1),n.length&&"\n"!==n&&(s+=o),s+=n;return s}function D(e,t){return"\n"+r.repeat(" ",e.indent*t)}function L(e){return e===p||e===c}function U(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&65279!==e||65536<=e&&e<=1114111}function q(e){return U(e)&&65279!==e&&e!==b&&e!==C&&e!==k&&e!==A&&e!==j&&e!==w&&e!==d}function F(e){return/^\n* /.test(e)}var B=1,z=2,V=3,H=4,W=5;function J(e,t,n,r,o){var i,a,s,u=!1,c=!1,p=-1!==r,P=-1,I=U(s=e.charCodeAt(0))&&65279!==s&&!L(s)&&s!==_&&s!==E&&s!==w&&s!==b&&s!==C&&s!==k&&s!==A&&s!==j&&s!==d&&s!==v&&s!==y&&s!==f&&s!==T&&s!==x&&s!==g&&s!==h&&s!==m&&s!==S&&s!==O&&!L(e.charCodeAt(e.length-1));if(t)for(i=0;i<e.length;i++){if(!U(a=e.charCodeAt(i)))return W;I=I&&q(a)}else{for(i=0;i<e.length;i++){if((a=e.charCodeAt(i))===l)u=!0,p&&(c=c||i-P-1>r&&" "!==e[P+1],P=i);else if(!U(a))return W;I=I&&q(a)}c=c||p&&i-P-1>r&&" "!==e[P+1]}return u||c?n>9&&F(e)?W:c?H:V:I&&!o(e)?B:z}function K(e,t,n,r){e.dump=function(){if(0===t.length)return"''";if(!e.noCompatMode&&-1!==I.indexOf(t))return"'"+t+"'";var i=e.indent*Math.max(1,n),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),s=r||e.flowLevel>-1&&n>=e.flowLevel;switch(J(t,s,e.indent,a,function(t){return function(e,t){var n,r;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)})){case B:return t;case z:return"'"+t.replace(/'/g,"''")+"'";case V:return"|"+Y(t,e.indent)+$(R(t,i));case H:return">"+Y(t,e.indent)+$(R(function(e,t){var n,r,o=/(\n+)([^\n]*)/g,i=(s=e.indexOf("\n"),s=-1!==s?s:e.length,o.lastIndex=s,G(e.slice(0,s),t)),a="\n"===e[0]||" "===e[0];var s;for(;r=o.exec(e);){var u=r[1],c=r[2];n=" "===c[0],i+=u+(a||n||""===c?"":"\n")+G(c,t),a=n}return i}(t,a),i));case W:return'"'+function(e){for(var t,n,r,o="",i=0;i<e.length;i++)(t=e.charCodeAt(i))>=55296&&t<=56319&&(n=e.charCodeAt(i+1))>=56320&&n<=57343?(o+=M(1024*(t-55296)+n-56320+65536),i++):(r=P[t],o+=!r&&U(t)?e[i]:r||M(t));return o}(t)+'"';default:throw new o("impossible error: invalid scalar style")}}()}function Y(e,t){var n=F(e)?String(t):"",r="\n"===e[e.length-1];return n+(r&&("\n"===e[e.length-2]||"\n"===e)?"+":r?"":"-")+"\n"}function $(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function G(e,t){if(""===e||" "===e[0])return e;for(var n,r,o=/ [^ ]/g,i=0,a=0,s=0,u="";n=o.exec(e);)(s=n.index)-i>t&&(r=a>i?a:s,u+="\n"+e.slice(i,r),i=r+1),a=s;return u+="\n",e.length-i>t&&a>i?u+=e.slice(i,a)+"\n"+e.slice(a+1):u+=e.slice(i),u.slice(1)}function Z(e,t,n){var r,i,a,c,l,p;for(a=0,c=(i=n?e.explicitTypes:e.implicitTypes).length;a<c;a+=1)if(((l=i[a]).instanceOf||l.predicate)&&(!l.instanceOf||"object"==typeof t&&t instanceof l.instanceOf)&&(!l.predicate||l.predicate(t))){if(e.tag=n?l.tag:"?",l.represent){if(p=e.styleMap[l.tag]||l.defaultStyle,"[object Function]"===s.call(l.represent))r=l.represent(t,p);else{if(!u.call(l.represent,p))throw new o("!<"+l.tag+'> tag resolver accepts not "'+p+'" style');r=l.represent[p](t,p)}e.dump=r}return!0}return!1}function X(e,t,n,r,i,a){e.tag=null,e.dump=n,Z(e,n,!1)||Z(e,n,!0);var u=s.call(e.dump);r&&(r=e.flowLevel<0||e.flowLevel>t);var c,p,f="[object Object]"===u||"[object Array]"===u;if(f&&(p=-1!==(c=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||p||2!==e.indent&&t>0)&&(i=!1),p&&e.usedDuplicates[c])e.dump="*ref_"+c;else{if(f&&p&&!e.usedDuplicates[c]&&(e.usedDuplicates[c]=!0),"[object Object]"===u)r&&0!==Object.keys(e.dump).length?(!function(e,t,n,r){var i,a,s,u,c,p,f="",h=e.tag,d=Object.keys(n);if(!0===e.sortKeys)d.sort();else if("function"==typeof e.sortKeys)d.sort(e.sortKeys);else if(e.sortKeys)throw new o("sortKeys must be a boolean or a function");for(i=0,a=d.length;i<a;i+=1)p="",r&&0===i||(p+=D(e,t)),u=n[s=d[i]],X(e,t+1,s,!0,!0,!0)&&((c=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&l===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,c&&(p+=D(e,t)),X(e,t+1,u,!0,c)&&(e.dump&&l===e.dump.charCodeAt(0)?p+=":":p+=": ",f+=p+=e.dump));e.tag=h,e.dump=f||"{}"}(e,t,e.dump,i),p&&(e.dump="&ref_"+c+e.dump)):(!function(e,t,n){var r,o,i,a,s,u="",c=e.tag,l=Object.keys(n);for(r=0,o=l.length;r<o;r+=1)s=e.condenseFlow?'"':"",0!==r&&(s+=", "),a=n[i=l[r]],X(e,t,i,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),X(e,t,a,!1,!1)&&(u+=s+=e.dump));e.tag=c,e.dump="{"+u+"}"}(e,t,e.dump),p&&(e.dump="&ref_"+c+" "+e.dump));else if("[object Array]"===u){var h=e.noArrayIndent&&t>0?t-1:t;r&&0!==e.dump.length?(!function(e,t,n,r){var o,i,a="",s=e.tag;for(o=0,i=n.length;o<i;o+=1)X(e,t+1,n[o],!0,!0)&&(r&&0===o||(a+=D(e,t)),e.dump&&l===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=s,e.dump=a||"[]"}(e,h,e.dump,i),p&&(e.dump="&ref_"+c+e.dump)):(!function(e,t,n){var r,o,i="",a=e.tag;for(r=0,o=n.length;r<o;r+=1)X(e,t,n[r],!1,!1)&&(0!==r&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=a,e.dump="["+i+"]"}(e,h,e.dump),p&&(e.dump="&ref_"+c+" "+e.dump))}else{if("[object String]"!==u){if(e.skipInvalid)return!1;throw new o("unacceptable kind of an object to dump "+u)}"?"!==e.tag&&K(e,e.dump,t,a)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function Q(e,t){var n,r,o=[],i=[];for(function e(t,n,r){var o,i,a;if(null!==t&&"object"==typeof t)if(-1!==(i=n.indexOf(t)))-1===r.indexOf(i)&&r.push(i);else if(n.push(t),Array.isArray(t))for(i=0,a=t.length;i<a;i+=1)e(t[i],n,r);else for(o=Object.keys(t),i=0,a=o.length;i<a;i+=1)e(t[o[i]],n,r)}(e,o,i),n=0,r=i.length;n<r;n+=1)t.duplicates.push(o[i[n]]);t.usedDuplicates=new Array(r)}function ee(e,t){var n=new N(t=t||{});return n.noRefs||Q(e,n),X(n,0,e,!0,!0)?n.dump+"\n":""}e.exports.dump=ee,e.exports.safeDump=function(e,t){return ee(e,r.extend({schema:a},t))}},function(e,t,n){"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},function(e,t,n){"use strict";var r,o=Object.prototype.hasOwnProperty;function i(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}t.stringify=function(e,t){t=t||"";var n,i,a=[];for(i in"string"!=typeof t&&(t="?"),e)if(o.call(e,i)){if((n=e[i])||null!==n&&n!==r&&!isNaN(n)||(n=""),i=encodeURIComponent(i),n=encodeURIComponent(n),null===i||null===n)continue;a.push(i+"="+n)}return a.length?t+a.join("&"):""},t.parse=function(e){for(var t,n=/([^=?&]+)=?([^&]*)/g,r={};t=n.exec(e);){var o=i(t[1]),a=i(t[2]);null===o||null===a||o in r||(r[o]=a)}return r}},function(e,t,n){var r=n(51);e.exports=function(){return r.Date.now()}},function(e,t,n){e.exports=n(807)},function(e,t,n){n(808),e.exports=n(22).Object.getPrototypeOf},function(e,t,n){var r=n(100),o=n(352);n(216)("getPrototypeOf",function(){return function(e){return o(r(e))}})},function(e,t,n){n(810),e.exports=n(22).Object.setPrototypeOf},function(e,t,n){var r=n(30);r(r.S,"Object",{setPrototypeOf:n(811).set})},function(e,t,n){var r=n(43),o=n(46),i=function(e,t){if(o(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(63)(Function.call,n(163).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return i(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:i}},function(e,t,n){n(813);var r=n(22).Object;e.exports=function(e,t){return r.create(e,t)}},function(e,t,n){var r=n(30);r(r.S,"Object",{create:n(160)})},function(e,t,n){var r=n(420);function o(t,n){return e.exports=o=r||function(e,t){return e.__proto__=t,e},o(t,n)}e.exports=o},function(e,t,n){"use strict";var r=n(27),o=n(816),i=n(445),a=n(116),s=n(58),u=n(888),c=n(889),l=n(446),p=n(890);n(23);o.inject();var f={findDOMNode:c,render:i.render,unmountComponentAtNode:i.unmountComponentAtNode,version:u,unstable_batchedUpdates:s.batchedUpdates,unstable_renderSubtreeIntoContainer:p};"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ComponentTree:{getClosestInstanceFromNode:r.getClosestInstanceFromNode,getNodeFromInstance:function(e){return e._renderedComponent&&(e=l(e)),e?r.getNodeFromInstance(e):null}},Mount:i,Reconciler:a}),e.exports=f},function(e,t,n){"use strict";var r=n(817),o=n(818),i=n(822),a=n(825),s=n(826),u=n(827),c=n(828),l=n(834),p=n(27),f=n(859),h=n(860),d=n(861),m=n(862),v=n(863),g=n(865),y=n(866),b=n(872),_=n(873),w=n(874),x=!1;e.exports={inject:function(){x||(x=!0,g.EventEmitter.injectReactEventListener(v),g.EventPluginHub.injectEventPluginOrder(a),g.EventPluginUtils.injectComponentTree(p),g.EventPluginUtils.injectTreeTraversal(h),g.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:w,EnterLeaveEventPlugin:s,ChangeEventPlugin:i,SelectEventPlugin:_,BeforeInputEventPlugin:o}),g.HostComponent.injectGenericComponentClass(l),g.HostComponent.injectTextComponentClass(d),g.DOMProperty.injectDOMPropertyConfig(r),g.DOMProperty.injectDOMPropertyConfig(u),g.DOMProperty.injectDOMPropertyConfig(b),g.EmptyComponent.injectEmptyComponentFactory(function(e){return new f(e)}),g.Updates.injectReconcileTransaction(y),g.Updates.injectBatchingStrategy(m),g.Component.injectEnvironment(c))}}},function(e,t,n){"use strict";e.exports={Properties:{"aria-current":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0},DOMAttributeNames:{},DOMPropertyNames:{}}},function(e,t,n){"use strict";var r=n(140),o=n(38),i=n(819),a=n(820),s=n(821),u=[9,13,27,32],c=229,l=o.canUseDOM&&"CompositionEvent"in window,p=null;o.canUseDOM&&"documentMode"in document&&(p=document.documentMode);var f,h=o.canUseDOM&&"TextEvent"in window&&!p&&!("object"==typeof(f=window.opera)&&"function"==typeof f.version&&parseInt(f.version(),10)<=12),d=o.canUseDOM&&(!l||p&&p>8&&p<=11);var m=32,v=String.fromCharCode(m),g={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:["topBlur","topCompositionEnd","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:["topBlur","topCompositionStart","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:["topBlur","topCompositionUpdate","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]}},y=!1;function b(e,t){switch(e){case"topKeyUp":return-1!==u.indexOf(t.keyCode);case"topKeyDown":return t.keyCode!==c;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function _(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}var w=null;function x(e,t,n,o){var s,u;if(l?s=function(e){switch(e){case"topCompositionStart":return g.compositionStart;case"topCompositionEnd":return g.compositionEnd;case"topCompositionUpdate":return g.compositionUpdate}}(e):w?b(e,n)&&(s=g.compositionEnd):function(e,t){return"topKeyDown"===e&&t.keyCode===c}(e,n)&&(s=g.compositionStart),!s)return null;d&&(w||s!==g.compositionStart?s===g.compositionEnd&&w&&(u=w.getData()):w=i.getPooled(o));var p=a.getPooled(s,t,n,o);if(u)p.data=u;else{var f=_(n);null!==f&&(p.data=f)}return r.accumulateTwoPhaseDispatches(p),p}function E(e,t,n,o){var a;if(!(a=h?function(e,t){switch(e){case"topCompositionEnd":return _(t);case"topKeyPress":return t.which!==m?null:(y=!0,v);case"topTextInput":var n=t.data;return n===v&&y?null:n;default:return null}}(e,n):function(e,t){if(w){if("topCompositionEnd"===e||!l&&b(e,t)){var n=w.getData();return i.release(w),w=null,n}return null}switch(e){case"topPaste":return null;case"topKeyPress":return t.which&&!function(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}(t)?String.fromCharCode(t.which):null;case"topCompositionEnd":return d?null:t.data;default:return null}}(e,n)))return null;var u=s.getPooled(g.beforeInput,t,n,o);return u.data=a,r.accumulateTwoPhaseDispatches(u),u}var S={eventTypes:g,extractEvents:function(e,t,n,r){return[x(e,t,n,r),E(e,t,n,r)]}};e.exports=S},function(e,t,n){"use strict";var r=n(25),o=n(90),i=n(425);function a(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}r(a.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[i()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,o=this.getText(),i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);var s=t>1?1-t:void 0;return this._fallbackText=o.slice(e,s),this._fallbackText}}),o.addPoolingTo(a),e.exports=a},function(e,t,n){"use strict";var r=n(68);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{data:null}),e.exports=o},function(e,t,n){"use strict";var r=n(68);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{data:null}),e.exports=o},function(e,t,n){"use strict";var r=n(141),o=n(140),i=n(38),a=n(27),s=n(58),u=n(68),c=n(428),l=n(250),p=n(251),f=n(429),h={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:["topBlur","topChange","topClick","topFocus","topInput","topKeyDown","topKeyUp","topSelectionChange"]}};function d(e,t,n){var r=u.getPooled(h.change,e,t,n);return r.type="change",o.accumulateTwoPhaseDispatches(r),r}var m=null,v=null;var g=!1;function y(e){var t=d(v,e,l(e));s.batchedUpdates(b,t)}function b(e){r.enqueueEvents(e),r.processEventQueue(!1)}function _(){m&&(m.detachEvent("onchange",y),m=null,v=null)}function w(e,t){var n=c.updateValueIfChanged(e),r=!0===t.simulated&&P._allowSimulatedPassThrough;if(n||r)return e}function x(e,t){if("topChange"===e)return t}function E(e,t,n){"topFocus"===e?(_(),function(e,t){v=t,(m=e).attachEvent("onchange",y)}(t,n)):"topBlur"===e&&_()}i.canUseDOM&&(g=p("change")&&(!document.documentMode||document.documentMode>8));var S=!1;function C(){m&&(m.detachEvent("onpropertychange",k),m=null,v=null)}function k(e){"value"===e.propertyName&&w(v,e)&&y(e)}function O(e,t,n){"topFocus"===e?(C(),function(e,t){v=t,(m=e).attachEvent("onpropertychange",k)}(t,n)):"topBlur"===e&&C()}function A(e,t,n){if("topSelectionChange"===e||"topKeyUp"===e||"topKeyDown"===e)return w(v,n)}function T(e,t,n){if("topClick"===e)return w(t,n)}function j(e,t,n){if("topInput"===e||"topChange"===e)return w(t,n)}i.canUseDOM&&(S=p("input")&&(!document.documentMode||document.documentMode>9));var P={eventTypes:h,_allowSimulatedPassThrough:!0,_isInputEventSupported:S,extractEvents:function(e,t,n,r){var o,i,s,u,c=t?a.getNodeFromInstance(t):window;if("select"===(u=(s=c).nodeName&&s.nodeName.toLowerCase())||"input"===u&&"file"===s.type?g?o=x:i=E:f(c)?S?o=j:(o=A,i=O):function(e){var t=e.nodeName;return t&&"input"===t.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}(c)&&(o=T),o){var l=o(e,t,n);if(l)return d(l,n,r)}i&&i(e,c,t),"topBlur"===e&&function(e,t){if(null!=e){var n=e._wrapperState||t._wrapperState;if(n&&n.controlled&&"number"===t.type){var r=""+t.value;t.getAttribute("value")!==r&&t.setAttribute("value",r)}}}(t,c)}};e.exports=P},function(e,t,n){"use strict";var r=n(824),o={};o.attachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&function(e,t,n){"function"==typeof e?e(t.getPublicInstance()):r.addComponentAsRefTo(t,e,n)}(n,e,t._owner)}},o.shouldUpdateRefs=function(e,t){var n=null,r=null;null!==e&&"object"==typeof e&&(n=e.ref,r=e._owner);var o=null,i=null;return null!==t&&"object"==typeof t&&(o=t.ref,i=t._owner),n!==o||"string"==typeof o&&i!==r},o.detachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&function(e,t,n){"function"==typeof e?e(null):r.removeComponentAsRefFrom(t,e,n)}(n,e,t._owner)}},e.exports=o},function(e,t,n){"use strict";var r=n(21);n(15);function o(e){return!(!e||"function"!=typeof e.attachRef||"function"!=typeof e.detachRef)}var i={addComponentAsRefTo:function(e,t,n){o(n)||r("119"),n.attachRef(t,e)},removeComponentAsRefFrom:function(e,t,n){o(n)||r("120");var i=n.getPublicInstance();i&&i.refs[t]===e.getPublicInstance()&&n.detachRef(t)}};e.exports=i},function(e,t,n){"use strict";e.exports=["ResponderEventPlugin","SimpleEventPlugin","TapEventPlugin","EnterLeaveEventPlugin","ChangeEventPlugin","SelectEventPlugin","BeforeInputEventPlugin"]},function(e,t,n){"use strict";var r=n(140),o=n(27),i=n(186),a={mouseEnter:{registrationName:"onMouseEnter",dependencies:["topMouseOut","topMouseOver"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["topMouseOut","topMouseOver"]}},s={eventTypes:a,extractEvents:function(e,t,n,s){if("topMouseOver"===e&&(n.relatedTarget||n.fromElement))return null;if("topMouseOut"!==e&&"topMouseOver"!==e)return null;var u,c,l;if(s.window===s)u=s;else{var p=s.ownerDocument;u=p?p.defaultView||p.parentWindow:window}if("topMouseOut"===e){c=t;var f=n.relatedTarget||n.toElement;l=f?o.getClosestInstanceFromNode(f):null}else c=null,l=t;if(c===l)return null;var h=null==c?u:o.getNodeFromInstance(c),d=null==l?u:o.getNodeFromInstance(l),m=i.getPooled(a.mouseLeave,c,n,s);m.type="mouseleave",m.target=h,m.relatedTarget=d;var v=i.getPooled(a.mouseEnter,l,n,s);return v.type="mouseenter",v.target=d,v.relatedTarget=h,r.accumulateEnterLeaveDispatches(m,v,c,l),[m,v]}};e.exports=s},function(e,t,n){"use strict";var r=n(115),o=r.injection.MUST_USE_PROPERTY,i=r.injection.HAS_BOOLEAN_VALUE,a=r.injection.HAS_NUMERIC_VALUE,s=r.injection.HAS_POSITIVE_NUMERIC_VALUE,u=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE,c={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+r.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:i,allowTransparency:0,alt:0,as:0,async:i,autoComplete:0,autoPlay:i,capture:i,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:o|i,cite:0,classID:0,className:0,cols:s,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:i,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:i,defer:i,dir:0,disabled:i,download:u,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:i,formTarget:0,frameBorder:0,headers:0,height:0,hidden:i,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:i,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:o|i,muted:o|i,name:0,nonce:0,noValidate:i,open:i,optimum:0,pattern:0,placeholder:0,playsInline:i,poster:0,preload:0,profile:0,radioGroup:0,readOnly:i,referrerPolicy:0,rel:0,required:i,reversed:i,role:0,rows:s,rowSpan:a,sandbox:0,scope:0,scoped:i,scrolling:0,seamless:i,selected:o|i,shape:0,size:s,sizes:0,span:s,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:a,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:i,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{},DOMMutationMethods:{value:function(e,t){if(null==t)return e.removeAttribute("value");"number"!==e.type||!1===e.hasAttribute("value")?e.setAttribute("value",""+t):e.validity&&!e.validity.badInput&&e.ownerDocument.activeElement!==e&&e.setAttribute("value",""+t)}}};e.exports=c},function(e,t,n){"use strict";var r=n(253),o={processChildrenUpdates:n(833).dangerouslyProcessChildrenUpdates,replaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup};e.exports=o},function(e,t,n){"use strict";var r=n(21),o=n(117),i=n(38),a=n(830),s=n(57),u=(n(15),{dangerouslyReplaceNodeWithMarkup:function(e,t){if(i.canUseDOM||r("56"),t||r("57"),"HTML"===e.nodeName&&r("58"),"string"==typeof t){var n=a(t,s)[0];e.parentNode.replaceChild(n,e)}else o.replaceChildWithTree(e,t)}});e.exports=u},function(e,t,n){"use strict";var r=n(38),o=n(831),i=n(832),a=n(15),s=r.canUseDOM?document.createElement("div"):null,u=/^\s*<(\w+)/;e.exports=function(e,t){var n=s;s||a(!1);var r=function(e){var t=e.match(u);return t&&t[1].toLowerCase()}(e),c=r&&i(r);if(c){n.innerHTML=c[1]+e+c[2];for(var l=c[0];l--;)n=n.lastChild}else n.innerHTML=e;var p=n.getElementsByTagName("script");p.length&&(t||a(!1),o(p).forEach(t));for(var f=Array.from(n.childNodes);n.lastChild;)n.removeChild(n.lastChild);return f}},function(e,t,n){"use strict";var r=n(15);e.exports=function(e){return function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}(e)?Array.isArray(e)?e.slice():function(e){var t=e.length;if((Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e)&&r(!1),"number"!=typeof t&&r(!1),0===t||t-1 in e||r(!1),"function"==typeof e.callee&&r(!1),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(e){}for(var n=Array(t),o=0;o<t;o++)n[o]=e[o];return n}(e):[e]}},function(e,t,n){"use strict";var r=n(38),o=n(15),i=r.canUseDOM?document.createElement("div"):null,a={},s=[1,'<select multiple="true">',"</select>"],u=[1,"<table>","</table>"],c=[3,"<table><tbody><tr>","</tr></tbody></table>"],l=[1,'<svg xmlns="http://www.w3.org/2000/svg">',"</svg>"],p={"*":[1,"?<div>","</div>"],area:[1,"<map>","</map>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],legend:[1,"<fieldset>","</fieldset>"],param:[1,"<object>","</object>"],tr:[2,"<table><tbody>","</tbody></table>"],optgroup:s,option:s,caption:u,colgroup:u,tbody:u,tfoot:u,thead:u,td:c,th:c};["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"].forEach(function(e){p[e]=l,a[e]=!0}),e.exports=function(e){return i||o(!1),p.hasOwnProperty(e)||(e="*"),a.hasOwnProperty(e)||(i.innerHTML="*"===e?"<link />":"<"+e+"></"+e+">",a[e]=!i.firstChild),a[e]?p[e]:null}},function(e,t,n){"use strict";var r=n(253),o=n(27),i={dangerouslyProcessChildrenUpdates:function(e,t){var n=o.getNodeFromInstance(e);r.processUpdates(n,t)}};e.exports=i},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(835),a=n(836),s=n(117),u=n(254),c=n(115),l=n(434),p=n(141),f=n(247),h=n(189),d=n(422),m=n(27),v=n(846),g=n(848),y=n(435),b=n(849),_=(n(53),n(850)),w=n(857),x=(n(57),n(188)),E=(n(15),n(251),n(258),n(428)),S=(n(262),n(23),d),C=p.deleteListener,k=m.getNodeFromInstance,O=h.listenTo,A=f.registrationNameModules,T={string:!0,number:!0},j="__html",P={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null},I=11;function M(e,t){t&&(W[e._tag]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&r("137",e._tag,e._currentElement._owner?" Check the render method of "+e._currentElement._owner.getName()+".":""),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&r("60"),"object"==typeof t.dangerouslySetInnerHTML&&j in t.dangerouslySetInnerHTML||r("61")),null!=t.style&&"object"!=typeof t.style&&r("62",function(e){if(e){var t=e._currentElement._owner||null;if(t){var n=t.getName();if(n)return" This DOM node was rendered by `"+n+"`."}}return""}(e)))}function N(e,t,n,r){if(!(r instanceof w)){0;var o=e._hostContainerInfo,i=o._node&&o._node.nodeType===I?o._node:o._ownerDocument;O(t,i),r.getReactMountReady().enqueue(R,{inst:e,registrationName:t,listener:n})}}function R(){p.putListener(this.inst,this.registrationName,this.listener)}function D(){v.postMountWrapper(this)}function L(){b.postMountWrapper(this)}function U(){g.postMountWrapper(this)}var q={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"};function F(){E.track(this)}function B(){this._rootNodeID||r("63");var e=k(this);switch(e||r("64"),this._tag){case"iframe":case"object":this._wrapperState.listeners=[h.trapBubbledEvent("topLoad","load",e)];break;case"video":case"audio":for(var t in this._wrapperState.listeners=[],q)q.hasOwnProperty(t)&&this._wrapperState.listeners.push(h.trapBubbledEvent(t,q[t],e));break;case"source":this._wrapperState.listeners=[h.trapBubbledEvent("topError","error",e)];break;case"img":this._wrapperState.listeners=[h.trapBubbledEvent("topError","error",e),h.trapBubbledEvent("topLoad","load",e)];break;case"form":this._wrapperState.listeners=[h.trapBubbledEvent("topReset","reset",e),h.trapBubbledEvent("topSubmit","submit",e)];break;case"input":case"select":case"textarea":this._wrapperState.listeners=[h.trapBubbledEvent("topInvalid","invalid",e)]}}function z(){y.postUpdateWrapper(this)}var V={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},H={listing:!0,pre:!0,textarea:!0},W=o({menuitem:!0},V),J=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,K={},Y={}.hasOwnProperty;function $(e,t){return e.indexOf("-")>=0||null!=t.is}var G=1;function Z(e){var t=e.type;!function(e){Y.call(K,e)||(J.test(e)||r("65",e),K[e]=!0)}(t),this._currentElement=e,this._tag=t.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._hostNode=null,this._hostParent=null,this._rootNodeID=0,this._domID=0,this._hostContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0}Z.displayName="ReactDOMComponent",Z.Mixin={mountComponent:function(e,t,n,r){this._rootNodeID=G++,this._domID=n._idCounter++,this._hostParent=t,this._hostContainerInfo=n;var o,a,c,p=this._currentElement.props;switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":this._wrapperState={listeners:null},e.getReactMountReady().enqueue(B,this);break;case"input":v.mountWrapper(this,p,t),p=v.getHostProps(this,p),e.getReactMountReady().enqueue(F,this),e.getReactMountReady().enqueue(B,this);break;case"option":g.mountWrapper(this,p,t),p=g.getHostProps(this,p);break;case"select":y.mountWrapper(this,p,t),p=y.getHostProps(this,p),e.getReactMountReady().enqueue(B,this);break;case"textarea":b.mountWrapper(this,p,t),p=b.getHostProps(this,p),e.getReactMountReady().enqueue(F,this),e.getReactMountReady().enqueue(B,this)}if(M(this,p),null!=t?(o=t._namespaceURI,a=t._tag):n._tag&&(o=n._namespaceURI,a=n._tag),(null==o||o===u.svg&&"foreignobject"===a)&&(o=u.html),o===u.html&&("svg"===this._tag?o=u.svg:"math"===this._tag&&(o=u.mathml)),this._namespaceURI=o,e.useCreateElement){var f,h=n._ownerDocument;if(o===u.html)if("script"===this._tag){var d=h.createElement("div"),_=this._currentElement.type;d.innerHTML="<"+_+"></"+_+">",f=d.removeChild(d.firstChild)}else f=p.is?h.createElement(this._currentElement.type,p.is):h.createElement(this._currentElement.type);else f=h.createElementNS(o,this._currentElement.type);m.precacheNode(this,f),this._flags|=S.hasCachedChildNodes,this._hostParent||l.setAttributeForRoot(f),this._updateDOMProperties(null,p,e);var w=s(f);this._createInitialChildren(e,p,r,w),c=w}else{var x=this._createOpenTagMarkupAndPutListeners(e,p),E=this._createContentMarkup(e,p,r);c=!E&&V[this._tag]?x+"/>":x+">"+E+"</"+this._currentElement.type+">"}switch(this._tag){case"input":e.getReactMountReady().enqueue(D,this),p.autoFocus&&e.getReactMountReady().enqueue(i.focusDOMComponent,this);break;case"textarea":e.getReactMountReady().enqueue(L,this),p.autoFocus&&e.getReactMountReady().enqueue(i.focusDOMComponent,this);break;case"select":case"button":p.autoFocus&&e.getReactMountReady().enqueue(i.focusDOMComponent,this);break;case"option":e.getReactMountReady().enqueue(U,this)}return c},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(null!=i)if(A.hasOwnProperty(r))i&&N(this,r,i,e);else{"style"===r&&(i&&(i=this._previousStyleCopy=o({},t.style)),i=a.createMarkupForStyles(i,this));var s=null;null!=this._tag&&$(this._tag,t)?P.hasOwnProperty(r)||(s=l.createMarkupForCustomAttribute(r,i)):s=l.createMarkupForProperty(r,i),s&&(n+=" "+s)}}return e.renderToStaticMarkup?n:(this._hostParent||(n+=" "+l.createMarkupForRoot()),n+=" "+l.createMarkupForID(this._domID))},_createContentMarkup:function(e,t,n){var r="",o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&(r=o.__html);else{var i=T[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)r=x(i);else if(null!=a){r=this.mountChildren(a,e,n).join("")}}return H[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&s.queueHTML(r,o.__html);else{var i=T[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)""!==i&&s.queueText(r,i);else if(null!=a)for(var u=this.mountChildren(a,e,n),c=0;c<u.length;c++)s.queueChild(r,u[c])}},receiveComponent:function(e,t,n){var r=this._currentElement;this._currentElement=e,this.updateComponent(t,r,e,n)},updateComponent:function(e,t,n,r){var o=t.props,i=this._currentElement.props;switch(this._tag){case"input":o=v.getHostProps(this,o),i=v.getHostProps(this,i);break;case"option":o=g.getHostProps(this,o),i=g.getHostProps(this,i);break;case"select":o=y.getHostProps(this,o),i=y.getHostProps(this,i);break;case"textarea":o=b.getHostProps(this,o),i=b.getHostProps(this,i)}switch(M(this,i),this._updateDOMProperties(o,i,e),this._updateDOMChildren(o,i,e,r),this._tag){case"input":v.updateWrapper(this),E.updateValueIfChanged(this);break;case"textarea":b.updateWrapper(this);break;case"select":e.getReactMountReady().enqueue(z,this)}},_updateDOMProperties:function(e,t,n){var r,i,s;for(r in e)if(!t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&null!=e[r])if("style"===r){var u=this._previousStyleCopy;for(i in u)u.hasOwnProperty(i)&&((s=s||{})[i]="");this._previousStyleCopy=null}else A.hasOwnProperty(r)?e[r]&&C(this,r):$(this._tag,e)?P.hasOwnProperty(r)||l.deleteValueForAttribute(k(this),r):(c.properties[r]||c.isCustomAttribute(r))&&l.deleteValueForProperty(k(this),r);for(r in t){var p=t[r],f="style"===r?this._previousStyleCopy:null!=e?e[r]:void 0;if(t.hasOwnProperty(r)&&p!==f&&(null!=p||null!=f))if("style"===r)if(p?p=this._previousStyleCopy=o({},p):this._previousStyleCopy=null,f){for(i in f)!f.hasOwnProperty(i)||p&&p.hasOwnProperty(i)||((s=s||{})[i]="");for(i in p)p.hasOwnProperty(i)&&f[i]!==p[i]&&((s=s||{})[i]=p[i])}else s=p;else if(A.hasOwnProperty(r))p?N(this,r,p,n):f&&C(this,r);else if($(this._tag,t))P.hasOwnProperty(r)||l.setValueForAttribute(k(this),r,p);else if(c.properties[r]||c.isCustomAttribute(r)){var h=k(this);null!=p?l.setValueForProperty(h,r,p):l.deleteValueForProperty(h,r)}}s&&a.setValueForStyles(k(this),s,this)},_updateDOMChildren:function(e,t,n,r){var o=T[typeof e.children]?e.children:null,i=T[typeof t.children]?t.children:null,a=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,s=t.dangerouslySetInnerHTML&&t.dangerouslySetInnerHTML.__html,u=null!=o?null:e.children,c=null!=i?null:t.children,l=null!=o||null!=a,p=null!=i||null!=s;null!=u&&null==c?this.updateChildren(null,n,r):l&&!p&&this.updateTextContent(""),null!=i?o!==i&&this.updateTextContent(""+i):null!=s?a!==s&&this.updateMarkup(""+s):null!=c&&this.updateChildren(c,n,r)},getHostNode:function(){return k(this)},unmountComponent:function(e){switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":var t=this._wrapperState.listeners;if(t)for(var n=0;n<t.length;n++)t[n].remove();break;case"input":case"textarea":E.stopTracking(this);break;case"html":case"head":case"body":r("66",this._tag)}this.unmountChildren(e),m.uncacheNode(this),p.deleteAllListeners(this),this._rootNodeID=0,this._domID=0,this._wrapperState=null},getPublicInstance:function(){return k(this)}},o(Z.prototype,Z.Mixin,_.Mixin),e.exports=Z},function(e,t,n){"use strict";var r=n(27),o=n(432),i={focusDOMComponent:function(){o(r.getNodeFromInstance(this))}};e.exports=i},function(e,t,n){"use strict";var r=n(433),o=n(38),i=(n(53),n(837),n(839)),a=n(840),s=n(842),u=(n(23),s(function(e){return a(e)})),c=!1,l="cssFloat";if(o.canUseDOM){var p=document.createElement("div").style;try{p.font=""}catch(e){c=!0}void 0===document.documentElement.style.cssFloat&&(l="styleFloat")}var f={createMarkupForStyles:function(e,t){var n="";for(var r in e)if(e.hasOwnProperty(r)){var o=0===r.indexOf("--"),a=e[r];0,null!=a&&(n+=u(r)+":",n+=i(r,a,t,o)+";")}return n||null},setValueForStyles:function(e,t,n){var o=e.style;for(var a in t)if(t.hasOwnProperty(a)){var s=0===a.indexOf("--");0;var u=i(a,t[a],n,s);if("float"!==a&&"cssFloat"!==a||(a=l),s)o.setProperty(a,u);else if(u)o[a]=u;else{var p=c&&r.shorthandPropertyExpansions[a];if(p)for(var f in p)o[f]="";else o[a]=""}}}};e.exports=f},function(e,t,n){"use strict";var r=n(838),o=/^-ms-/;e.exports=function(e){return r(e.replace(o,"ms-"))}},function(e,t,n){"use strict";var r=/-(.)/g;e.exports=function(e){return e.replace(r,function(e,t){return t.toUpperCase()})}},function(e,t,n){"use strict";var r=n(433),o=(n(23),r.isUnitlessNumber);e.exports=function(e,t,n,r){if(null==t||"boolean"==typeof t||""===t)return"";var i=isNaN(t);return r||i||0===t||o.hasOwnProperty(e)&&o[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}},function(e,t,n){"use strict";var r=n(841),o=/^ms-/;e.exports=function(e){return r(e).replace(o,"-ms-")}},function(e,t,n){"use strict";var r=/([A-Z])/g;e.exports=function(e){return e.replace(r,"-$1").toLowerCase()}},function(e,t,n){"use strict";e.exports=function(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}},function(e,t,n){"use strict";var r=n(188);e.exports=function(e){return'"'+r(e)+'"'}},function(e,t,n){"use strict";var r=n(141);var o={handleTopLevel:function(e,t,n,o){!function(e){r.enqueueEvents(e),r.processEventQueue(!1)}(r.extractEvents(e,t,n,o))}};e.exports=o},function(e,t,n){"use strict";var r=n(38);function o(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}var i={animationend:o("Animation","AnimationEnd"),animationiteration:o("Animation","AnimationIteration"),animationstart:o("Animation","AnimationStart"),transitionend:o("Transition","TransitionEnd")},a={},s={};r.canUseDOM&&(s=document.createElement("div").style,"AnimationEvent"in window||(delete i.animationend.animation,delete i.animationiteration.animation,delete i.animationstart.animation),"TransitionEvent"in window||delete i.transitionend.transition),e.exports=function(e){if(a[e])return a[e];if(!i[e])return e;var t=i[e];for(var n in t)if(t.hasOwnProperty(n)&&n in s)return a[e]=t[n];return""}},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(434),a=n(256),s=n(27),u=n(58);n(15),n(23);function c(){this._rootNodeID&&p.updateWrapper(this)}function l(e){return"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}var p={getHostProps:function(e,t){var n=a.getValue(t),r=a.getChecked(t);return o({type:void 0,step:void 0,min:void 0,max:void 0},t,{defaultChecked:void 0,defaultValue:void 0,value:null!=n?n:e._wrapperState.initialValue,checked:null!=r?r:e._wrapperState.initialChecked,onChange:e._wrapperState.onChange})},mountWrapper:function(e,t){var n=t.defaultValue;e._wrapperState={initialChecked:null!=t.checked?t.checked:t.defaultChecked,initialValue:null!=t.value?t.value:n,listeners:null,onChange:f.bind(e),controlled:l(t)}},updateWrapper:function(e){var t=e._currentElement.props,n=t.checked;null!=n&&i.setValueForProperty(s.getNodeFromInstance(e),"checked",n||!1);var r=s.getNodeFromInstance(e),o=a.getValue(t);if(null!=o)if(0===o&&""===r.value)r.value="0";else if("number"===t.type){var u=parseFloat(r.value,10)||0;(o!=u||o==u&&r.value!=o)&&(r.value=""+o)}else r.value!==""+o&&(r.value=""+o);else null==t.value&&null!=t.defaultValue&&r.defaultValue!==""+t.defaultValue&&(r.defaultValue=""+t.defaultValue),null==t.checked&&null!=t.defaultChecked&&(r.defaultChecked=!!t.defaultChecked)},postMountWrapper:function(e){var t=e._currentElement.props,n=s.getNodeFromInstance(e);switch(t.type){case"submit":case"reset":break;case"color":case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":n.value="",n.value=n.defaultValue;break;default:n.value=n.value}var r=n.name;""!==r&&(n.name=""),n.defaultChecked=!n.defaultChecked,n.defaultChecked=!n.defaultChecked,""!==r&&(n.name=r)}};function f(e){var t=this._currentElement.props,n=a.executeOnChange(t,e);u.asap(c,this);var o=t.name;if("radio"===t.type&&null!=o){for(var i=s.getNodeFromInstance(this),l=i;l.parentNode;)l=l.parentNode;for(var p=l.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),f=0;f<p.length;f++){var h=p[f];if(h!==i&&h.form===i.form){var d=s.getInstanceFromNode(h);d||r("90"),u.asap(c,d)}}}return n}e.exports=p},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r=n(25),o=n(104),i=n(27),a=n(435),s=(n(23),!1);function u(e){var t="";return o.Children.forEach(e,function(e){null!=e&&("string"==typeof e||"number"==typeof e?t+=e:s||(s=!0))}),t}var c={mountWrapper:function(e,t,n){var r=null;if(null!=n){var o=n;"optgroup"===o._tag&&(o=o._hostParent),null!=o&&"select"===o._tag&&(r=a.getSelectValueContext(o))}var i,s=null;if(null!=r)if(i=null!=t.value?t.value+"":u(t.children),s=!1,Array.isArray(r)){for(var c=0;c<r.length;c++)if(""+r[c]===i){s=!0;break}}else s=""+r===i;e._wrapperState={selected:s}},postMountWrapper:function(e){var t=e._currentElement.props;null!=t.value&&i.getNodeFromInstance(e).setAttribute("value",t.value)},getHostProps:function(e,t){var n=r({selected:void 0,children:void 0},t);null!=e._wrapperState.selected&&(n.selected=e._wrapperState.selected);var o=u(t.children);return o&&(n.children=o),n}};e.exports=c},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(256),a=n(27),s=n(58);n(15),n(23);function u(){this._rootNodeID&&c.updateWrapper(this)}var c={getHostProps:function(e,t){return null!=t.dangerouslySetInnerHTML&&r("91"),o({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue,onChange:e._wrapperState.onChange})},mountWrapper:function(e,t){var n=i.getValue(t),o=n;if(null==n){var a=t.defaultValue,s=t.children;null!=s&&(null!=a&&r("92"),Array.isArray(s)&&(s.length<=1||r("93"),s=s[0]),a=""+s),null==a&&(a=""),o=a}e._wrapperState={initialValue:""+o,listeners:null,onChange:l.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,n=a.getNodeFromInstance(e),r=i.getValue(t);if(null!=r){var o=""+r;o!==n.value&&(n.value=o),null==t.defaultValue&&(n.defaultValue=o)}null!=t.defaultValue&&(n.defaultValue=t.defaultValue)},postMountWrapper:function(e){var t=a.getNodeFromInstance(e),n=t.textContent;n===e._wrapperState.initialValue&&(t.value=n)}};function l(e){var t=this._currentElement.props,n=i.executeOnChange(t,e);return s.asap(u,this),n}e.exports=c},function(e,t,n){"use strict";var r=n(21),o=n(257),i=(n(143),n(53),n(65),n(116)),a=n(851),s=(n(57),n(856));n(15);function u(e,t){return t&&(e=e||[]).push(t),e}function c(e,t){o.processChildrenUpdates(e,t)}var l={Mixin:{_reconcilerInstantiateChildren:function(e,t,n){return a.instantiateChildren(e,t,n)},_reconcilerUpdateChildren:function(e,t,n,r,o,i){var u;return u=s(t,0),a.updateChildren(e,u,n,r,o,this,this._hostContainerInfo,i,0),u},mountChildren:function(e,t,n){var r=this._reconcilerInstantiateChildren(e,t,n);this._renderedChildren=r;var o=[],a=0;for(var s in r)if(r.hasOwnProperty(s)){var u=r[s];0;var c=i.mountComponent(u,t,this,this._hostContainerInfo,n,0);u._mountIndex=a++,o.push(c)}return o},updateTextContent:function(e){var t,n=this._renderedChildren;for(var o in a.unmountChildren(n,!1),n)n.hasOwnProperty(o)&&r("118");c(this,[(t=e,{type:"TEXT_CONTENT",content:t,fromIndex:null,fromNode:null,toIndex:null,afterNode:null})])},updateMarkup:function(e){var t,n=this._renderedChildren;for(var o in a.unmountChildren(n,!1),n)n.hasOwnProperty(o)&&r("118");c(this,[(t=e,{type:"SET_MARKUP",content:t,fromIndex:null,fromNode:null,toIndex:null,afterNode:null})])},updateChildren:function(e,t,n){this._updateChildren(e,t,n)},_updateChildren:function(e,t,n){var r=this._renderedChildren,o={},a=[],s=this._reconcilerUpdateChildren(r,e,a,o,t,n);if(s||r){var l,p=null,f=0,h=0,d=0,m=null;for(l in s)if(s.hasOwnProperty(l)){var v=r&&r[l],g=s[l];v===g?(p=u(p,this.moveChild(v,m,f,h)),h=Math.max(v._mountIndex,h),v._mountIndex=f):(v&&(h=Math.max(v._mountIndex,h)),p=u(p,this._mountChildAtIndex(g,a[d],m,f,t,n)),d++),f++,m=i.getHostNode(g)}for(l in o)o.hasOwnProperty(l)&&(p=u(p,this._unmountChild(r[l],o[l])));p&&c(this,p),this._renderedChildren=s}},unmountChildren:function(e){var t=this._renderedChildren;a.unmountChildren(t,e),this._renderedChildren=null},moveChild:function(e,t,n,r){if(e._mountIndex<r)return function(e,t,n){return{type:"MOVE_EXISTING",content:null,fromIndex:e._mountIndex,fromNode:i.getHostNode(e),toIndex:n,afterNode:t}}(e,t,n)},createChild:function(e,t,n){return function(e,t,n){return{type:"INSERT_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:n,afterNode:t}}(n,t,e._mountIndex)},removeChild:function(e,t){return function(e,t){return{type:"REMOVE_NODE",content:null,fromIndex:e._mountIndex,fromNode:t,toIndex:null,afterNode:null}}(e,t)},_mountChildAtIndex:function(e,t,n,r,o,i){return e._mountIndex=r,this.createChild(e,n,t)},_unmountChild:function(e,t){var n=this.removeChild(e,t);return e._mountIndex=null,n}}};e.exports=l},function(e,t,n){"use strict";(function(t){var r=n(116),o=n(436),i=(n(260),n(259)),a=n(440);n(23);function s(e,t,n,r){var i=void 0===e[n];null!=t&&i&&(e[n]=o(t,!0))}void 0!==t&&t.env;var u={instantiateChildren:function(e,t,n,r){if(null==e)return null;var o={};return a(e,s,o),o},updateChildren:function(e,t,n,a,s,u,c,l,p){if(t||e){var f,h;for(f in t)if(t.hasOwnProperty(f)){var d=(h=e&&e[f])&&h._currentElement,m=t[f];if(null!=h&&i(d,m))r.receiveComponent(h,m,s,l),t[f]=h;else{h&&(a[f]=r.getHostNode(h),r.unmountComponent(h,!1));var v=o(m,!0);t[f]=v;var g=r.mountComponent(v,s,u,c,l,p);n.push(g)}}for(f in e)!e.hasOwnProperty(f)||t&&t.hasOwnProperty(f)||(h=e[f],a[f]=r.getHostNode(h),r.unmountComponent(h,!1))}},unmountChildren:function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];r.unmountComponent(o,t)}}};e.exports=u}).call(this,n(67))},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(104),a=n(257),s=n(65),u=n(249),c=n(143),l=(n(53),n(437)),p=n(116),f=n(165),h=(n(15),n(258)),d=n(259),m=(n(23),0),v=1,g=2;function y(e){}function b(e,t){0}y.prototype.render=function(){var e=c.get(this)._currentElement.type,t=e(this.props,this.context,this.updater);return b(e,t),t};var _=1,w={construct:function(e){this._currentElement=e,this._rootNodeID=0,this._compositeType=null,this._instance=null,this._hostParent=null,this._hostContainerInfo=null,this._updateBatchNumber=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedNodeType=null,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._topLevelWrapper=null,this._pendingCallbacks=null,this._calledComponentWillUnmount=!1},mountComponent:function(e,t,n,o){this._context=o,this._mountOrder=_++,this._hostParent=t,this._hostContainerInfo=n;var a,s=this._currentElement.props,u=this._processContext(o),l=this._currentElement.type,p=e.getUpdateQueue(),h=function(e){return!(!e.prototype||!e.prototype.isReactComponent)}(l),d=this._constructComponent(h,s,u,p);h||null!=d&&null!=d.render?!function(e){return!(!e.prototype||!e.prototype.isPureReactComponent)}(l)?this._compositeType=m:this._compositeType=v:(a=d,b(),null===d||!1===d||i.isValidElement(d)||r("105",l.displayName||l.name||"Component"),d=new y(l),this._compositeType=g),d.props=s,d.context=u,d.refs=f,d.updater=p,this._instance=d,c.set(d,this);var w,x=d.state;return void 0===x&&(d.state=x=null),("object"!=typeof x||Array.isArray(x))&&r("106",this.getName()||"ReactCompositeComponent"),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,w=d.unstable_handleError?this.performInitialMountWithErrorHandling(a,t,n,e,o):this.performInitialMount(a,t,n,e,o),d.componentDidMount&&e.getReactMountReady().enqueue(d.componentDidMount,d),w},_constructComponent:function(e,t,n,r){return this._constructComponentWithoutOwner(e,t,n,r)},_constructComponentWithoutOwner:function(e,t,n,r){var o=this._currentElement.type;return e?new o(t,n,r):o(t,n,r)},performInitialMountWithErrorHandling:function(e,t,n,r,o){var i,a=r.checkpoint();try{i=this.performInitialMount(e,t,n,r,o)}catch(s){r.rollback(a),this._instance.unstable_handleError(s),this._pendingStateQueue&&(this._instance.state=this._processPendingState(this._instance.props,this._instance.context)),a=r.checkpoint(),this._renderedComponent.unmountComponent(!0),r.rollback(a),i=this.performInitialMount(e,t,n,r,o)}return i},performInitialMount:function(e,t,n,r,o){var i=this._instance;i.componentWillMount&&(i.componentWillMount(),this._pendingStateQueue&&(i.state=this._processPendingState(i.props,i.context))),void 0===e&&(e=this._renderValidatedComponent());var a=l.getType(e);this._renderedNodeType=a;var s=this._instantiateReactComponent(e,a!==l.EMPTY);return this._renderedComponent=s,p.mountComponent(s,r,t,n,this._processChildContext(o),0)},getHostNode:function(){return p.getHostNode(this._renderedComponent)},unmountComponent:function(e){if(this._renderedComponent){var t=this._instance;if(t.componentWillUnmount&&!t._calledComponentWillUnmount)if(t._calledComponentWillUnmount=!0,e){var n=this.getName()+".componentWillUnmount()";u.invokeGuardedCallback(n,t.componentWillUnmount.bind(t))}else t.componentWillUnmount();this._renderedComponent&&(p.unmountComponent(this._renderedComponent,e),this._renderedNodeType=null,this._renderedComponent=null,this._instance=null),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=0,this._topLevelWrapper=null,c.remove(t)}},_maskContext:function(e){var t=this._currentElement.type.contextTypes;if(!t)return f;var n={};for(var r in t)n[r]=e[r];return n},_processContext:function(e){return this._maskContext(e)},_processChildContext:function(e){var t,n=this._currentElement.type,i=this._instance;if(i.getChildContext&&(t=i.getChildContext()),t){for(var a in"object"!=typeof n.childContextTypes&&r("107",this.getName()||"ReactCompositeComponent"),t)a in n.childContextTypes||r("108",this.getName()||"ReactCompositeComponent",a);return o({},e,t)}return e},_checkContextTypes:function(e,t,n){0},receiveComponent:function(e,t,n){var r=this._currentElement,o=this._context;this._pendingElement=null,this.updateComponent(t,r,e,o,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement?p.receiveComponent(this,this._pendingElement,e,this._context):null!==this._pendingStateQueue||this._pendingForceUpdate?this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context):this._updateBatchNumber=null},updateComponent:function(e,t,n,o,i){var a=this._instance;null==a&&r("136",this.getName()||"ReactCompositeComponent");var s,u=!1;this._context===i?s=a.context:(s=this._processContext(i),u=!0);var c=t.props,l=n.props;t!==n&&(u=!0),u&&a.componentWillReceiveProps&&a.componentWillReceiveProps(l,s);var p=this._processPendingState(l,s),f=!0;this._pendingForceUpdate||(a.shouldComponentUpdate?f=a.shouldComponentUpdate(l,p,s):this._compositeType===v&&(f=!h(c,l)||!h(a.state,p))),this._updateBatchNumber=null,f?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,l,p,s,e,i)):(this._currentElement=n,this._context=i,a.props=l,a.state=p,a.context=s)},_processPendingState:function(e,t){var n=this._instance,r=this._pendingStateQueue,i=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!r)return n.state;if(i&&1===r.length)return r[0];for(var a=o({},i?r[0]:n.state),s=i?1:0;s<r.length;s++){var u=r[s];o(a,"function"==typeof u?u.call(n,a,e,t):u)}return a},_performComponentUpdate:function(e,t,n,r,o,i){var a,s,u,c=this._instance,l=Boolean(c.componentDidUpdate);l&&(a=c.props,s=c.state,u=c.context),c.componentWillUpdate&&c.componentWillUpdate(t,n,r),this._currentElement=e,this._context=i,c.props=t,c.state=n,c.context=r,this._updateRenderedComponent(o,i),l&&o.getReactMountReady().enqueue(c.componentDidUpdate.bind(c,a,s,u),c)},_updateRenderedComponent:function(e,t){var n=this._renderedComponent,r=n._currentElement,o=this._renderValidatedComponent();if(d(r,o))p.receiveComponent(n,o,e,this._processChildContext(t));else{var i=p.getHostNode(n);p.unmountComponent(n,!1);var a=l.getType(o);this._renderedNodeType=a;var s=this._instantiateReactComponent(o,a!==l.EMPTY);this._renderedComponent=s;var u=p.mountComponent(s,e,this._hostParent,this._hostContainerInfo,this._processChildContext(t),0);this._replaceNodeWithMarkup(i,u,n)}},_replaceNodeWithMarkup:function(e,t,n){a.replaceNodeWithMarkup(e,t,n)},_renderValidatedComponentWithoutOwnerOrContext:function(){return this._instance.render()},_renderValidatedComponent:function(){var e;if(this._compositeType!==g){s.current=this;try{e=this._renderValidatedComponentWithoutOwnerOrContext()}finally{s.current=null}}else e=this._renderValidatedComponentWithoutOwnerOrContext();return null===e||!1===e||i.isValidElement(e)||r("109",this.getName()||"ReactCompositeComponent"),e},attachRef:function(e,t){var n=this.getPublicInstance();null==n&&r("110");var o=t.getPublicInstance();(n.refs===f?n.refs={}:n.refs)[e]=o},detachRef:function(e){delete this.getPublicInstance().refs[e]},getName:function(){var e=this._currentElement.type,t=this._instance&&this._instance.constructor;return e.displayName||t&&t.displayName||e.name||t&&t.name||null},getPublicInstance:function(){var e=this._instance;return this._compositeType===g?null:e},_instantiateReactComponent:null};e.exports=w},function(e,t,n){"use strict";var r=1;e.exports=function(){return r++}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";e.exports=function(e){var t=e&&(r&&e[r]||e[o]);if("function"==typeof t)return t}},function(e,t,n){"use strict";(function(t){n(260);var r=n(440);n(23);function o(e,t,n,r){if(e&&"object"==typeof e){var o=e;0,void 0===o[n]&&null!=t&&(o[n]=t)}}void 0!==t&&t.env,e.exports=function(e,t){if(null==e)return e;var n={};return r(e,o,n),n}}).call(this,n(67))},function(e,t,n){"use strict";var r=n(25),o=n(90),i=n(185),a=(n(53),n(858)),s=[];var u={enqueue:function(){}};function c(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.useCreateElement=!1,this.updateQueue=new a(this)}var l={getTransactionWrappers:function(){return s},getReactMountReady:function(){return u},getUpdateQueue:function(){return this.updateQueue},destructor:function(){},checkpoint:function(){},rollback:function(){}};r(c.prototype,i,l),o.addPoolingTo(c),e.exports=c},function(e,t,n){"use strict";var r=n(261);n(23);var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.transaction=t}return e.prototype.isMounted=function(e){return!1},e.prototype.enqueueCallback=function(e,t,n){this.transaction.isInTransaction()&&r.enqueueCallback(e,t,n)},e.prototype.enqueueForceUpdate=function(e){this.transaction.isInTransaction()&&r.enqueueForceUpdate(e)},e.prototype.enqueueReplaceState=function(e,t){this.transaction.isInTransaction()&&r.enqueueReplaceState(e,t)},e.prototype.enqueueSetState=function(e,t){this.transaction.isInTransaction()&&r.enqueueSetState(e,t)},e}();e.exports=o},function(e,t,n){"use strict";var r=n(25),o=n(117),i=n(27),a=function(e){this._currentElement=null,this._hostNode=null,this._hostParent=null,this._hostContainerInfo=null,this._domID=0};r(a.prototype,{mountComponent:function(e,t,n,r){var a=n._idCounter++;this._domID=a,this._hostParent=t,this._hostContainerInfo=n;var s=" react-empty: "+this._domID+" ";if(e.useCreateElement){var u=n._ownerDocument.createComment(s);return i.precacheNode(this,u),o(u)}return e.renderToStaticMarkup?"":"\x3c!--"+s+"--\x3e"},receiveComponent:function(){},getHostNode:function(){return i.getNodeFromInstance(this)},unmountComponent:function(){i.uncacheNode(this)}}),e.exports=a},function(e,t,n){"use strict";var r=n(21);n(15);function o(e,t){"_hostNode"in e||r("33"),"_hostNode"in t||r("33");for(var n=0,o=e;o;o=o._hostParent)n++;for(var i=0,a=t;a;a=a._hostParent)i++;for(;n-i>0;)e=e._hostParent,n--;for(;i-n>0;)t=t._hostParent,i--;for(var s=n;s--;){if(e===t)return e;e=e._hostParent,t=t._hostParent}return null}e.exports={isAncestor:function(e,t){"_hostNode"in e||r("35"),"_hostNode"in t||r("35");for(;t;){if(t===e)return!0;t=t._hostParent}return!1},getLowestCommonAncestor:o,getParentInstance:function(e){return"_hostNode"in e||r("36"),e._hostParent},traverseTwoPhase:function(e,t,n){for(var r,o=[];e;)o.push(e),e=e._hostParent;for(r=o.length;r-- >0;)t(o[r],"captured",n);for(r=0;r<o.length;r++)t(o[r],"bubbled",n)},traverseEnterLeave:function(e,t,n,r,i){for(var a=e&&t?o(e,t):null,s=[];e&&e!==a;)s.push(e),e=e._hostParent;for(var u,c=[];t&&t!==a;)c.push(t),t=t._hostParent;for(u=0;u<s.length;u++)n(s[u],"bubbled",r);for(u=c.length;u-- >0;)n(c[u],"captured",i)}}},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(253),a=n(117),s=n(27),u=n(188),c=(n(15),n(262),function(e){this._currentElement=e,this._stringText=""+e,this._hostNode=null,this._hostParent=null,this._domID=0,this._mountIndex=0,this._closingComment=null,this._commentNodes=null});o(c.prototype,{mountComponent:function(e,t,n,r){var o=n._idCounter++,i=" react-text: "+o+" ";if(this._domID=o,this._hostParent=t,e.useCreateElement){var c=n._ownerDocument,l=c.createComment(i),p=c.createComment(" /react-text "),f=a(c.createDocumentFragment());return a.queueChild(f,a(l)),this._stringText&&a.queueChild(f,a(c.createTextNode(this._stringText))),a.queueChild(f,a(p)),s.precacheNode(this,l),this._closingComment=p,f}var h=u(this._stringText);return e.renderToStaticMarkup?h:"\x3c!--"+i+"--\x3e"+h+"\x3c!-- /react-text --\x3e"},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var r=this.getHostNode();i.replaceDelimitedText(r[0],r[1],n)}}},getHostNode:function(){var e=this._commentNodes;if(e)return e;if(!this._closingComment)for(var t=s.getNodeFromInstance(this).nextSibling;;){if(null==t&&r("67",this._domID),8===t.nodeType&&" /react-text "===t.nodeValue){this._closingComment=t;break}t=t.nextSibling}return e=[this._hostNode,this._closingComment],this._commentNodes=e,e},unmountComponent:function(){this._closingComment=null,this._commentNodes=null,s.uncacheNode(this)}}),e.exports=c},function(e,t,n){"use strict";var r=n(25),o=n(58),i=n(185),a=n(57),s={initialize:a,close:function(){p.isBatchingUpdates=!1}},u=[{initialize:a,close:o.flushBatchedUpdates.bind(o)},s];function c(){this.reinitializeTransaction()}r(c.prototype,i,{getTransactionWrappers:function(){return u}});var l=new c,p={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,o,i){var a=p.isBatchingUpdates;return p.isBatchingUpdates=!0,a?e(t,n,r,o,i):l.perform(e,null,t,n,r,o,i)}};e.exports=p},function(e,t,n){"use strict";var r=n(25),o=n(442),i=n(38),a=n(90),s=n(27),u=n(58),c=n(250),l=n(864);function p(e){for(;e._hostParent;)e=e._hostParent;var t=s.getNodeFromInstance(e).parentNode;return s.getClosestInstanceFromNode(t)}function f(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function h(e){var t=c(e.nativeEvent),n=s.getClosestInstanceFromNode(t),r=n;do{e.ancestors.push(r),r=r&&p(r)}while(r);for(var o=0;o<e.ancestors.length;o++)n=e.ancestors[o],d._handleTopLevel(e.topLevelType,n,e.nativeEvent,c(e.nativeEvent))}r(f.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),a.addPoolingTo(f,a.twoArgumentPooler);var d={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:i.canUseDOM?window:null,setHandleTopLevel:function(e){d._handleTopLevel=e},setEnabled:function(e){d._enabled=!!e},isEnabled:function(){return d._enabled},trapBubbledEvent:function(e,t,n){return n?o.listen(n,t,d.dispatchEvent.bind(null,e)):null},trapCapturedEvent:function(e,t,n){return n?o.capture(n,t,d.dispatchEvent.bind(null,e)):null},monitorScrollValue:function(e){var t=function(e){e(l(window))}.bind(null,e);o.listen(window,"scroll",t)},dispatchEvent:function(e,t){if(d._enabled){var n=f.getPooled(e,t);try{u.batchedUpdates(h,n)}finally{f.release(n)}}}};e.exports=d},function(e,t,n){"use strict";e.exports=function(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}},function(e,t,n){"use strict";var r=n(115),o=n(141),i=n(248),a=n(257),s=n(438),u=n(189),c=n(439),l=n(58),p={Component:a.injection,DOMProperty:r.injection,EmptyComponent:s.injection,EventPluginHub:o.injection,EventPluginUtils:i.injection,EventEmitter:u.injection,HostComponent:c.injection,Updates:l.injection};e.exports=p},function(e,t,n){"use strict";var r=n(25),o=n(426),i=n(90),a=n(189),s=n(443),u=(n(53),n(185)),c=n(261),l=[{initialize:s.getSelectionInformation,close:s.restoreSelection},{initialize:function(){var e=a.isEnabled();return a.setEnabled(!1),e},close:function(e){a.setEnabled(e)}},{initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}}];function p(e){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=o.getPooled(null),this.useCreateElement=e}var f={getTransactionWrappers:function(){return l},getReactMountReady:function(){return this.reactMountReady},getUpdateQueue:function(){return c},checkpoint:function(){return this.reactMountReady.checkpoint()},rollback:function(e){this.reactMountReady.rollback(e)},destructor:function(){o.release(this.reactMountReady),this.reactMountReady=null}};r(p.prototype,u,f),i.addPoolingTo(p),e.exports=p},function(e,t,n){"use strict";var r=n(38),o=n(868),i=n(425);function a(e,t,n,r){return e===n&&t===r}var s=r.canUseDOM&&"selection"in document&&!("getSelection"in window),u={getOffsets:s?function(e){var t=document.selection.createRange(),n=t.text.length,r=t.duplicate();r.moveToElementText(e),r.setEndPoint("EndToStart",t);var o=r.text.length;return{start:o,end:o+n}}:function(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.anchorNode,r=t.anchorOffset,o=t.focusNode,i=t.focusOffset,s=t.getRangeAt(0);try{s.startContainer.nodeType,s.endContainer.nodeType}catch(e){return null}var u=a(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)?0:s.toString().length,c=s.cloneRange();c.selectNodeContents(e),c.setEnd(s.startContainer,s.startOffset);var l=a(c.startContainer,c.startOffset,c.endContainer,c.endOffset)?0:c.toString().length,p=l+u,f=document.createRange();f.setStart(n,r),f.setEnd(o,i);var h=f.collapsed;return{start:h?p:l,end:h?l:p}},setOffsets:s?function(e,t){var n,r,o=document.selection.createRange().duplicate();void 0===t.end?r=n=t.start:t.start>t.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}:function(e,t){if(window.getSelection){var n=window.getSelection(),r=e[i()].length,a=Math.min(t.start,r),s=void 0===t.end?a:Math.min(t.end,r);if(!n.extend&&a>s){var u=s;s=a,a=u}var c=o(e,a),l=o(e,s);if(c&&l){var p=document.createRange();p.setStart(c.node,c.offset),n.removeAllRanges(),a>s?(n.addRange(p),n.extend(l.node,l.offset)):(p.setEnd(l.node,l.offset),n.addRange(p))}}}};e.exports=u},function(e,t,n){"use strict";function r(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function o(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}e.exports=function(e,t){for(var n=r(e),i=0,a=0;n;){if(3===n.nodeType){if(a=i+n.textContent.length,i<=t&&a>=t)return{node:n,offset:t-i};i=a}n=r(o(n))}}},function(e,t,n){"use strict";var r=n(870);e.exports=function e(t,n){return!(!t||!n)&&(t===n||!r(t)&&(r(n)?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}},function(e,t,n){"use strict";var r=n(871);e.exports=function(e){return r(e)&&3==e.nodeType}},function(e,t,n){"use strict";e.exports=function(e){var t=(e?e.ownerDocument||e:document).defaultView||window;return!(!e||!("function"==typeof t.Node?e instanceof t.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}},function(e,t,n){"use strict";var r="http://www.w3.org/1999/xlink",o="http://www.w3.org/XML/1998/namespace",i={accentHeight:"accent-height",accumulate:0,additive:0,alignmentBaseline:"alignment-baseline",allowReorder:"allowReorder",alphabetic:0,amplitude:0,arabicForm:"arabic-form",ascent:0,attributeName:"attributeName",attributeType:"attributeType",autoReverse:"autoReverse",azimuth:0,baseFrequency:"baseFrequency",baseProfile:"baseProfile",baselineShift:"baseline-shift",bbox:0,begin:0,bias:0,by:0,calcMode:"calcMode",capHeight:"cap-height",clip:0,clipPath:"clip-path",clipRule:"clip-rule",clipPathUnits:"clipPathUnits",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",contentScriptType:"contentScriptType",contentStyleType:"contentStyleType",cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:"diffuseConstant",direction:0,display:0,divisor:0,dominantBaseline:"dominant-baseline",dur:0,dx:0,dy:0,edgeMode:"edgeMode",elevation:0,enableBackground:"enable-background",end:0,exponent:0,externalResourcesRequired:"externalResourcesRequired",fill:0,fillOpacity:"fill-opacity",fillRule:"fill-rule",filter:0,filterRes:"filterRes",filterUnits:"filterUnits",floodColor:"flood-color",floodOpacity:"flood-opacity",focusable:0,fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",glyphRef:"glyphRef",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",hanging:0,horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",ideographic:0,imageRendering:"image-rendering",in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:"kernelMatrix",kernelUnitLength:"kernelUnitLength",kerning:0,keyPoints:"keyPoints",keySplines:"keySplines",keyTimes:"keyTimes",lengthAdjust:"lengthAdjust",letterSpacing:"letter-spacing",lightingColor:"lighting-color",limitingConeAngle:"limitingConeAngle",local:0,markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",markerHeight:"markerHeight",markerUnits:"markerUnits",markerWidth:"markerWidth",mask:0,maskContentUnits:"maskContentUnits",maskUnits:"maskUnits",mathematical:0,mode:0,numOctaves:"numOctaves",offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pathLength:"pathLength",patternContentUnits:"patternContentUnits",patternTransform:"patternTransform",patternUnits:"patternUnits",pointerEvents:"pointer-events",points:0,pointsAtX:"pointsAtX",pointsAtY:"pointsAtY",pointsAtZ:"pointsAtZ",preserveAlpha:"preserveAlpha",preserveAspectRatio:"preserveAspectRatio",primitiveUnits:"primitiveUnits",r:0,radius:0,refX:"refX",refY:"refY",renderingIntent:"rendering-intent",repeatCount:"repeatCount",repeatDur:"repeatDur",requiredExtensions:"requiredExtensions",requiredFeatures:"requiredFeatures",restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:"shape-rendering",slope:0,spacing:0,specularConstant:"specularConstant",specularExponent:"specularExponent",speed:0,spreadMethod:"spreadMethod",startOffset:"startOffset",stdDeviation:"stdDeviation",stemh:0,stemv:0,stitchTiles:"stitchTiles",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",string:0,stroke:0,strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",surfaceScale:"surfaceScale",systemLanguage:"systemLanguage",tableValues:"tableValues",targetX:"targetX",targetY:"targetY",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",textLength:"textLength",to:0,transform:0,u1:0,u2:0,underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicode:0,unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",values:0,vectorEffect:"vector-effect",version:0,vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewBox",viewTarget:"viewTarget",visibility:0,widths:0,wordSpacing:"word-spacing",writingMode:"writing-mode",x:0,xHeight:"x-height",x1:0,x2:0,xChannelSelector:"xChannelSelector",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlns:0,xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space",y:0,y1:0,y2:0,yChannelSelector:"yChannelSelector",z:0,zoomAndPan:"zoomAndPan"},a={Properties:{},DOMAttributeNamespaces:{xlinkActuate:r,xlinkArcrole:r,xlinkHref:r,xlinkRole:r,xlinkShow:r,xlinkTitle:r,xlinkType:r,xmlBase:o,xmlLang:o,xmlSpace:o},DOMAttributeNames:{}};Object.keys(i).forEach(function(e){a.Properties[e]=0,i[e]&&(a.DOMAttributeNames[e]=i[e])}),e.exports=a},function(e,t,n){"use strict";var r=n(140),o=n(38),i=n(27),a=n(443),s=n(68),u=n(444),c=n(429),l=n(258),p=o.canUseDOM&&"documentMode"in document&&document.documentMode<=11,f={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:["topBlur","topContextMenu","topFocus","topKeyDown","topKeyUp","topMouseDown","topMouseUp","topSelectionChange"]}},h=null,d=null,m=null,v=!1,g=!1;function y(e,t){if(v||null==h||h!==u())return null;var n=function(e){if("selectionStart"in e&&a.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(window.getSelection){var t=window.getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}if(document.selection){var n=document.selection.createRange();return{parentElement:n.parentElement(),text:n.text,top:n.boundingTop,left:n.boundingLeft}}}(h);if(!m||!l(m,n)){m=n;var o=s.getPooled(f.select,d,e,t);return o.type="select",o.target=h,r.accumulateTwoPhaseDispatches(o),o}return null}var b={eventTypes:f,extractEvents:function(e,t,n,r){if(!g)return null;var o=t?i.getNodeFromInstance(t):window;switch(e){case"topFocus":(c(o)||"true"===o.contentEditable)&&(h=o,d=t,m=null);break;case"topBlur":h=null,d=null,m=null;break;case"topMouseDown":v=!0;break;case"topContextMenu":case"topMouseUp":return v=!1,y(n,r);case"topSelectionChange":if(p)break;case"topKeyDown":case"topKeyUp":return y(n,r)}return null},didPutListener:function(e,t,n){"onSelect"===t&&(g=!0)}};e.exports=b},function(e,t,n){"use strict";var r=n(21),o=n(442),i=n(140),a=n(27),s=n(875),u=n(876),c=n(68),l=n(877),p=n(878),f=n(186),h=n(880),d=n(881),m=n(882),v=n(142),g=n(883),y=n(57),b=n(263),_=(n(15),{}),w={};["abort","animationEnd","animationIteration","animationStart","blur","canPlay","canPlayThrough","click","contextMenu","copy","cut","doubleClick","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","durationChange","emptied","encrypted","ended","error","focus","input","invalid","keyDown","keyPress","keyUp","load","loadedData","loadedMetadata","loadStart","mouseDown","mouseMove","mouseOut","mouseOver","mouseUp","paste","pause","play","playing","progress","rateChange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeUpdate","touchCancel","touchEnd","touchMove","touchStart","transitionEnd","volumeChange","waiting","wheel"].forEach(function(e){var t=e[0].toUpperCase()+e.slice(1),n="on"+t,r="top"+t,o={phasedRegistrationNames:{bubbled:n,captured:n+"Capture"},dependencies:[r]};_[e]=o,w[r]=o});var x={};function E(e){return"."+e._rootNodeID}function S(e){return"button"===e||"input"===e||"select"===e||"textarea"===e}var C={eventTypes:_,extractEvents:function(e,t,n,o){var a,y=w[e];if(!y)return null;switch(e){case"topAbort":case"topCanPlay":case"topCanPlayThrough":case"topDurationChange":case"topEmptied":case"topEncrypted":case"topEnded":case"topError":case"topInput":case"topInvalid":case"topLoad":case"topLoadedData":case"topLoadedMetadata":case"topLoadStart":case"topPause":case"topPlay":case"topPlaying":case"topProgress":case"topRateChange":case"topReset":case"topSeeked":case"topSeeking":case"topStalled":case"topSubmit":case"topSuspend":case"topTimeUpdate":case"topVolumeChange":case"topWaiting":a=c;break;case"topKeyPress":if(0===b(n))return null;case"topKeyDown":case"topKeyUp":a=p;break;case"topBlur":case"topFocus":a=l;break;case"topClick":if(2===n.button)return null;case"topDoubleClick":case"topMouseDown":case"topMouseMove":case"topMouseUp":case"topMouseOut":case"topMouseOver":case"topContextMenu":a=f;break;case"topDrag":case"topDragEnd":case"topDragEnter":case"topDragExit":case"topDragLeave":case"topDragOver":case"topDragStart":case"topDrop":a=h;break;case"topTouchCancel":case"topTouchEnd":case"topTouchMove":case"topTouchStart":a=d;break;case"topAnimationEnd":case"topAnimationIteration":case"topAnimationStart":a=s;break;case"topTransitionEnd":a=m;break;case"topScroll":a=v;break;case"topWheel":a=g;break;case"topCopy":case"topCut":case"topPaste":a=u}a||r("86",e);var _=a.getPooled(y,t,n,o);return i.accumulateTwoPhaseDispatches(_),_},didPutListener:function(e,t,n){if("onClick"===t&&!S(e._tag)){var r=E(e),i=a.getNodeFromInstance(e);x[r]||(x[r]=o.listen(i,"click",y))}},willDeleteListener:function(e,t){if("onClick"===t&&!S(e._tag)){var n=E(e);x[n].remove(),delete x[n]}}};e.exports=C},function(e,t,n){"use strict";var r=n(68);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{animationName:null,elapsedTime:null,pseudoElement:null}),e.exports=o},function(e,t,n){"use strict";var r=n(68),o={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};function i(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(i,o),e.exports=i},function(e,t,n){"use strict";var r=n(142);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{relatedTarget:null}),e.exports=o},function(e,t,n){"use strict";var r=n(142),o=n(263),i={key:n(879),location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:n(252),charCode:function(e){return"keypress"===e.type?o(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?o(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};function a(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(a,i),e.exports=a},function(e,t,n){"use strict";var r=n(263),o={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},i={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};e.exports=function(e){if(e.key){var t=o[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=r(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?i[e.keyCode]||"Unidentified":""}},function(e,t,n){"use strict";var r=n(186);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{dataTransfer:null}),e.exports=o},function(e,t,n){"use strict";var r=n(142),o={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:n(252)};function i(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(i,o),e.exports=i},function(e,t,n){"use strict";var r=n(68);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{propertyName:null,elapsedTime:null,pseudoElement:null}),e.exports=o},function(e,t,n){"use strict";var r=n(186);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),e.exports=o},function(e,t,n){"use strict";n(262);var r=9;e.exports=function(e,t){return{_topLevelWrapper:e,_idCounter:1,_ownerDocument:t?t.nodeType===r?t:t.ownerDocument:null,_node:t,_tag:t?t.nodeName.toLowerCase():null,_namespaceURI:t?t.namespaceURI:null}}},function(e,t,n){"use strict";e.exports={useCreateElement:!0,useFiber:!1}},function(e,t,n){"use strict";var r=n(887),o=/\/?>/,i=/^<\!\-\-/,a={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return i.test(e)?e:e.replace(o," "+a.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(a.CHECKSUM_ATTR_NAME);return n=n&&parseInt(n,10),r(e)===n}};e.exports=a},function(e,t,n){"use strict";var r=65521;e.exports=function(e){for(var t=1,n=0,o=0,i=e.length,a=-4&i;o<a;){for(var s=Math.min(o+4096,a);o<s;o+=4)n+=(t+=e.charCodeAt(o))+(t+=e.charCodeAt(o+1))+(t+=e.charCodeAt(o+2))+(t+=e.charCodeAt(o+3));t%=r,n%=r}for(;o<i;o++)n+=t+=e.charCodeAt(o);return(t%=r)|(n%=r)<<16}},function(e,t,n){"use strict";e.exports="15.6.2"},function(e,t,n){"use strict";var r=n(21),o=(n(65),n(27)),i=n(143),a=n(446);n(15),n(23);e.exports=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=i.get(e);if(t)return(t=a(t))?o.getNodeFromInstance(t):null;"function"==typeof e.render?r("44"):r("45",Object.keys(e))}},function(e,t,n){"use strict";var r=n(445);e.exports=r.renderSubtreeIntoContainer},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(0),o=a(n(10)),i=a(n(447));a(n(448));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));return o.store=n.store,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getChildContext=function(){return{store:this.store}},t.prototype.render=function(){return r.Children.only(this.props.children)},t}(r.Component);t.default=s,s.propTypes={store:i.default.isRequired,children:o.default.element.isRequired},s.childContextTypes={store:i.default.isRequired}},function(e,t,n){"use strict";var r=n(363);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";t.__esModule=!0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=function(e,t,n){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},v=Boolean(e),g=e||p,y=void 0;y="function"==typeof t?t:t?(0,s.default)(t):f;var b=n||h,_=l.pure,w=void 0===_||_,x=l.withRef,E=void 0!==x&&x,S=w&&b!==h,C=m++;return function(e){var t="Connect("+function(e){return e.displayName||e.name||"Component"}(e)+")";var n=function(n){function i(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,n.call(this,e,r));o.version=C,o.store=e.store||r.store,(0,c.default)(o.store,'Could not find "store" in either the context or props of "'+t+'". Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "'+t+'".');var a=o.store.getState();return o.state={storeState:a},o.clearCache(),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,n),i.prototype.shouldComponentUpdate=function(){return!w||this.haveOwnPropsChanged||this.hasStoreStateChanged},i.prototype.computeStateProps=function(e,t){if(!this.finalMapStateToProps)return this.configureFinalMapState(e,t);var n=e.getState();return this.doStatePropsDependOnOwnProps?this.finalMapStateToProps(n,t):this.finalMapStateToProps(n)},i.prototype.configureFinalMapState=function(e,t){var n=g(e.getState(),t),r="function"==typeof n;return this.finalMapStateToProps=r?n:g,this.doStatePropsDependOnOwnProps=1!==this.finalMapStateToProps.length,r?this.computeStateProps(e,t):n},i.prototype.computeDispatchProps=function(e,t){if(!this.finalMapDispatchToProps)return this.configureFinalMapDispatch(e,t);var n=e.dispatch;return this.doDispatchPropsDependOnOwnProps?this.finalMapDispatchToProps(n,t):this.finalMapDispatchToProps(n)},i.prototype.configureFinalMapDispatch=function(e,t){var n=y(e.dispatch,t),r="function"==typeof n;return this.finalMapDispatchToProps=r?n:y,this.doDispatchPropsDependOnOwnProps=1!==this.finalMapDispatchToProps.length,r?this.computeDispatchProps(e,t):n},i.prototype.updateStatePropsIfNeeded=function(){var e=this.computeStateProps(this.store,this.props);return(!this.stateProps||!(0,a.default)(e,this.stateProps))&&(this.stateProps=e,!0)},i.prototype.updateDispatchPropsIfNeeded=function(){var e=this.computeDispatchProps(this.store,this.props);return(!this.dispatchProps||!(0,a.default)(e,this.dispatchProps))&&(this.dispatchProps=e,!0)},i.prototype.updateMergedPropsIfNeeded=function(){var e,t,n,r=(e=this.stateProps,t=this.dispatchProps,n=this.props,b(e,t,n));return!(this.mergedProps&&S&&(0,a.default)(r,this.mergedProps))&&(this.mergedProps=r,!0)},i.prototype.isSubscribed=function(){return"function"==typeof this.unsubscribe},i.prototype.trySubscribe=function(){v&&!this.unsubscribe&&(this.unsubscribe=this.store.subscribe(this.handleChange.bind(this)),this.handleChange())},i.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},i.prototype.componentDidMount=function(){this.trySubscribe()},i.prototype.componentWillReceiveProps=function(e){w&&(0,a.default)(e,this.props)||(this.haveOwnPropsChanged=!0)},i.prototype.componentWillUnmount=function(){this.tryUnsubscribe(),this.clearCache()},i.prototype.clearCache=function(){this.dispatchProps=null,this.stateProps=null,this.mergedProps=null,this.haveOwnPropsChanged=!0,this.hasStoreStateChanged=!0,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,this.renderedElement=null,this.finalMapDispatchToProps=null,this.finalMapStateToProps=null},i.prototype.handleChange=function(){if(this.unsubscribe){var e=this.store.getState(),t=this.state.storeState;if(!w||t!==e){if(w&&!this.doStatePropsDependOnOwnProps){var n=function(e,t){try{return e.apply(t)}catch(e){return d.value=e,d}}(this.updateStatePropsIfNeeded,this);if(!n)return;n===d&&(this.statePropsPrecalculationError=d.value),this.haveStatePropsBeenPrecalculated=!0}this.hasStoreStateChanged=!0,this.setState({storeState:e})}}},i.prototype.getWrappedInstance=function(){return(0,c.default)(E,"To access the wrapped instance, you need to specify { withRef: true } as the fourth argument of the connect() call."),this.refs.wrappedInstance},i.prototype.render=function(){var t=this.haveOwnPropsChanged,n=this.hasStoreStateChanged,i=this.haveStatePropsBeenPrecalculated,a=this.statePropsPrecalculationError,s=this.renderedElement;if(this.haveOwnPropsChanged=!1,this.hasStoreStateChanged=!1,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,a)throw a;var u=!0,c=!0;w&&s&&(u=n||t&&this.doStatePropsDependOnOwnProps,c=t&&this.doDispatchPropsDependOnOwnProps);var l=!1,p=!1;i?l=!0:u&&(l=this.updateStatePropsIfNeeded()),c&&(p=this.updateDispatchPropsIfNeeded());return!(!!(l||p||t)&&this.updateMergedPropsIfNeeded())&&s?s:(this.renderedElement=E?(0,o.createElement)(e,r({},this.mergedProps,{ref:"wrappedInstance"})):(0,o.createElement)(e,this.mergedProps),this.renderedElement)},i}(o.Component);return n.displayName=t,n.WrappedComponent=e,n.contextTypes={store:i.default},n.propTypes={store:i.default},(0,u.default)(n,e)}};var o=n(0),i=l(n(447)),a=l(n(894)),s=l(n(895)),u=(l(n(448)),l(n(264)),l(n(896))),c=l(n(897));function l(e){return e&&e.__esModule?e:{default:e}}var p=function(e){return{}},f=function(e){return{dispatch:e}},h=function(e,t,n){return r({},n,e,t)};var d={value:null};var m=0},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=Object.prototype.hasOwnProperty,i=0;i<n.length;i++)if(!o.call(t,n[i])||e[n[i]]!==t[n[i]])return!1;return!0}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){return function(t){return(0,r.bindActionCreators)(e,t)}};var r=n(124)},function(e,t,n){"use strict";var r=n(362),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var c=Object.defineProperty,l=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,d=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(d){var o=h(n);o&&o!==d&&e(t,o,r)}var a=l(n);p&&(a=a.concat(p(n)));for(var s=u(t),m=u(n),v=0;v<a.length;++v){var g=a[v];if(!(i[g]||r&&r[g]||m&&m[g]||s&&s[g])){var y=f(n,g);try{c(t,g,y)}catch(e){}}}return t}return t}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,i,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,a,s],l=0;(u=new Error(t.replace(/%s/g,function(){return c[l++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},function(e,t,n){var r=n(118),o=n(85);e.exports=function(e,t){return e&&r(t,o(t),e)}},function(e,t,n){var r=n(118),o=n(450);e.exports=function(e,t){return e&&r(t,o(t),e)}},function(e,t,n){var r=n(52),o=n(175),i=n(902),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=o(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},function(e,t){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},function(e,t,n){(function(e){var r=n(51),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}}).call(this,n(173)(e))},function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},function(e,t,n){var r=n(118),o=n(230);e.exports=function(e,t){return r(e,o(e),t)}},function(e,t,n){var r=n(118),o=n(451);e.exports=function(e,t){return r(e,o(e),t)}},function(e,t){var n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&n.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},function(e,t,n){var r=n(266),o=n(909),i=n(910),a=n(911),s=n(912),u="[object Boolean]",c="[object Date]",l="[object Map]",p="[object Number]",f="[object RegExp]",h="[object Set]",d="[object String]",m="[object Symbol]",v="[object ArrayBuffer]",g="[object DataView]",y="[object Float32Array]",b="[object Float64Array]",_="[object Int8Array]",w="[object Int16Array]",x="[object Int32Array]",E="[object Uint8Array]",S="[object Uint8ClampedArray]",C="[object Uint16Array]",k="[object Uint32Array]";e.exports=function(e,t,n){var O=e.constructor;switch(t){case v:return r(e);case u:case c:return new O(+e);case g:return o(e,n);case y:case b:case _:case w:case x:case E:case S:case C:case k:return s(e,n);case l:return new O;case p:case d:return new O(e);case f:return i(e);case h:return new O;case m:return a(e)}}},function(e,t,n){var r=n(266);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},function(e,t){var n=/\w*$/;e.exports=function(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}},function(e,t,n){var r=n(106),o=r?r.prototype:void 0,i=o?o.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},function(e,t,n){var r=n(266);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},function(e,t,n){var r=n(914),o=n(265),i=n(175);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:r(o(e))}},function(e,t,n){var r=n(52),o=Object.create,i=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=i},function(e,t,n){var r=n(916),o=n(234),i=n(235),a=i&&i.isMap,s=a?o(a):r;e.exports=s},function(e,t,n){var r=n(176),o=n(66),i="[object Map]";e.exports=function(e){return o(e)&&r(e)==i}},function(e,t,n){var r=n(918),o=n(234),i=n(235),a=i&&i.isSet,s=a?o(a):r;e.exports=s},function(e,t,n){var r=n(176),o=n(66),i="[object Set]";e.exports=function(e){return o(e)&&r(e)==i}},function(e,t,n){var r=n(108),o=n(920),i=n(921),a=n(109);e.exports=function(e,t){return t=r(t,e),null==(e=i(e,t))||delete e[a(o(t))]}},function(e,t){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},function(e,t,n){var r=n(177),o=n(368);e.exports=function(e,t){return t.length<2?e:r(e,o(t,0,-1))}},function(e,t,n){var r=n(264);e.exports=function(e){return r(e)?void 0:e}},function(e,t,n){var r=n(924);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},function(e,t,n){var r=n(229),o=n(925);e.exports=function e(t,n,i,a,s){var u=-1,c=t.length;for(i||(i=o),s||(s=[]);++u<c;){var l=t[u];n>0&&i(l)?n>1?e(l,n-1,i,a,s):r(s,l):a||(s[s.length]=l)}return s}},function(e,t,n){var r=n(106),o=n(231),i=n(37),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||o(e)||!!(a&&e&&e[a])}},function(e,t){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},function(e,t,n){var r=n(928),o=n(419),i=n(237),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:i;e.exports=a},function(e,t){e.exports=function(e){return function(){return e}}},function(e,t){var n=800,r=16,o=Date.now;e.exports=function(e){var t=0,i=0;return function(){var a=o(),s=r-(a-i);if(i=a,s>0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,n){"use strict";var r=n(931),o=n(932);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){o.isString(e)&&(e=b(e));return e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),p=["%","/","?",";","#"].concat(l),f=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(933);function b(e,t,n){if(e&&o.isObject(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}i.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i<e.indexOf("#")?"?":"#",c=e.split(s);c[0]=c[0].replace(/\\/g,"/");var b=e=c.join(s);if(b=b.trim(),!n&&1===e.split("#").length){var _=u.exec(b);if(_)return this.path=b,this.href=b,this.pathname=_[1],_[2]?(this.search=_[2],this.query=t?y.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=a.exec(b);if(w){var x=(w=w[0]).toLowerCase();this.protocol=x,b=b.substr(w.length)}if(n||w||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===b.substr(0,2);!E||w&&v[w]||(b=b.substr(2),this.slashes=!0)}if(!v[w]&&(E||w&&!g[w])){for(var S,C,k=-1,O=0;O<f.length;O++){-1!==(A=b.indexOf(f[O]))&&(-1===k||A<k)&&(k=A)}-1!==(C=-1===k?b.lastIndexOf("@"):b.lastIndexOf("@",k))&&(S=b.slice(0,C),b=b.slice(C+1),this.auth=decodeURIComponent(S)),k=-1;for(O=0;O<p.length;O++){var A;-1!==(A=b.indexOf(p[O]))&&(-1===k||A<k)&&(k=A)}-1===k&&(k=b.length),this.host=b.slice(0,k),b=b.slice(k),this.parseHost(),this.hostname=this.hostname||"";var T="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!T)for(var j=this.hostname.split(/\./),P=(O=0,j.length);O<P;O++){var I=j[O];if(I&&!I.match(h)){for(var M="",N=0,R=I.length;N<R;N++)I.charCodeAt(N)>127?M+="x":M+=I[N];if(!M.match(h)){var D=j.slice(0,O),L=j.slice(O+1),U=I.match(d);U&&(D.push(U[1]),L.unshift(U[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=r.toASCII(this.hostname));var q=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+q,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[x])for(O=0,P=l.length;O<P;O++){var B=l[O];if(-1!==b.indexOf(B)){var z=encodeURIComponent(B);z===B&&(z=escape(B)),b=b.split(B).join(z)}}var V=b.indexOf("#");-1!==V&&(this.hash=b.substr(V),b=b.slice(0,V));var H=b.indexOf("?");if(-1!==H?(this.search=b.substr(H),this.query=b.substr(H+1),t&&(this.query=y.parse(this.query)),b=b.slice(0,H)):t&&(this.search="",this.query={}),b&&(this.pathname=b),g[x]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){q=this.pathname||"";var W=this.search||"";this.path=q+W}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,a="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(a=y.stringify(this.query));var s=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||g[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+r},i.prototype.resolve=function(e){return this.resolveObject(b(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if(o.isString(e)){var t=new i;t.parse(e,!1,!0),e=t}for(var n=new i,r=Object.keys(this),a=0;a<r.length;a++){var s=r[a];n[s]=this[s]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),c=0;c<u.length;c++){var l=u[c];"protocol"!==l&&(n[l]=e[l])}return g[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!g[e.protocol]){for(var p=Object.keys(e),f=0;f<p.length;f++){var h=p[f];n[h]=e[h]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||v[e.protocol])n.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),n.pathname=d.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var m=n.pathname||"",y=n.search||"";n.path=m+y}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var b=n.pathname&&"/"===n.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=_||b||n.host&&e.pathname,x=w,E=n.pathname&&n.pathname.split("/")||[],S=(d=e.pathname&&e.pathname.split("/")||[],n.protocol&&!g[n.protocol]);if(S&&(n.hostname="",n.port=null,n.host&&(""===E[0]?E[0]=n.host:E.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),w=w&&(""===d[0]||""===E[0])),_)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,E=d;else if(d.length)E||(E=[]),E.pop(),E=E.concat(d),n.search=e.search,n.query=e.query;else if(!o.isNullOrUndefined(e.search)){if(S)n.hostname=n.host=E.shift(),(T=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=T.shift(),n.host=n.hostname=T.shift());return n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!E.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var C=E.slice(-1)[0],k=(n.host||e.host||E.length>1)&&("."===C||".."===C)||""===C,O=0,A=E.length;A>=0;A--)"."===(C=E[A])?E.splice(A,1):".."===C?(E.splice(A,1),O++):O&&(E.splice(A,1),O--);if(!w&&!x)for(;O--;O)E.unshift("..");!w||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),k&&"/"!==E.join("/").substr(-1)&&E.push("");var T,j=""===E[0]||E[0]&&"/"===E[0].charAt(0);S&&(n.hostname=n.host=j?"":E.length?E.shift():"",(T=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=T.shift(),n.host=n.hostname=T.shift()));return(w=w||n.host&&E.length)&&!j&&E.unshift(""),E.length?n.pathname=E.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){(function(e,r){var o;/*! https://mths.be/punycode v1.3.2 by @mathias */!function(i){t&&t.nodeType,e&&e.nodeType;var a="object"==typeof r&&r;a.global!==a&&a.window!==a&&a.self;var s,u=2147483647,c=36,l=1,p=26,f=38,h=700,d=72,m=128,v="-",g=/^xn--/,y=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=c-l,x=Math.floor,E=String.fromCharCode;function S(e){throw RangeError(_[e])}function C(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function k(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+C((e=e.replace(b,".")).split("."),t).join(".")}function O(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function A(e){return C(e,function(e){var t="";return e>65535&&(t+=E((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=E(e)}).join("")}function T(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:c}function j(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function P(e,t,n){var r=0;for(e=n?x(e/h):e>>1,e+=x(e/t);e>w*p>>1;r+=c)e=x(e/w);return x(r+(w+1)*e/(e+f))}function I(e){var t,n,r,o,i,a,s,f,h,g,y=[],b=e.length,_=0,w=m,E=d;for((n=e.lastIndexOf(v))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&S("not-basic"),y.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<b;){for(i=_,a=1,s=c;o>=b&&S("invalid-input"),((f=T(e.charCodeAt(o++)))>=c||f>x((u-_)/a))&&S("overflow"),_+=f*a,!(f<(h=s<=E?l:s>=E+p?p:s-E));s+=c)a>x(u/(g=c-h))&&S("overflow"),a*=g;E=P(_-i,t=y.length+1,0==i),x(_/t)>u-w&&S("overflow"),w+=x(_/t),_%=t,y.splice(_++,0,w)}return A(y)}function M(e){var t,n,r,o,i,a,s,f,h,g,y,b,_,w,C,k=[];for(b=(e=O(e)).length,t=m,n=0,i=d,a=0;a<b;++a)(y=e[a])<128&&k.push(E(y));for(r=o=k.length,o&&k.push(v);r<b;){for(s=u,a=0;a<b;++a)(y=e[a])>=t&&y<s&&(s=y);for(s-t>x((u-n)/(_=r+1))&&S("overflow"),n+=(s-t)*_,t=s,a=0;a<b;++a)if((y=e[a])<t&&++n>u&&S("overflow"),y==t){for(f=n,h=c;!(f<(g=h<=i?l:h>=i+p?p:h-i));h+=c)C=f-g,w=c-g,k.push(E(j(g+C%w,0))),f=x(C/w);k.push(E(j(f,0))),i=P(n,_,r==o),n=0,++r}++n,++t}return k.join("")}s={version:"1.3.2",ucs2:{decode:O,encode:A},decode:I,encode:M,toASCII:function(e){return k(e,function(e){return y.test(e)?"xn--"+M(e):e})},toUnicode:function(e){return k(e,function(e){return g.test(e)?I(e.slice(4).toLowerCase()):e})}},void 0===(o=function(){return s}.call(t,n,t,e))||(e.exports=o)}()}).call(this,n(173)(e),n(36))},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){"use strict";t.decode=t.parse=n(934),t.encode=t.stringify=n(935)},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,i){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;i&&"number"==typeof i.maxKeys&&(u=i.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;l<c;++l){var p,f,h,d,m=e[l].replace(s,"%20"),v=m.indexOf(n);v>=0?(p=m.substr(0,v),f=m.substr(v+1)):(p=m,f=""),h=decodeURIComponent(p),d=decodeURIComponent(f),r(a,h)?o(a[h])?a[h].push(d):a[h]=[a[h],d]:a[h]=d}return a};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?i(a(e),function(a){var s=encodeURIComponent(r(a))+n;return o(e[a])?i(e[a],function(e){return s+encodeURIComponent(r(e))}).join(t):s+encodeURIComponent(r(e[a]))}).join(t):s?encodeURIComponent(r(s))+n+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function i(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var a=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t,n){var r=n(184),o=n(118),i=n(937),a=n(107),s=n(175),u=n(85),c=Object.prototype.hasOwnProperty,l=i(function(e,t){if(s(t)||a(t))o(t,u(t),e);else for(var n in t)c.call(t,n)&&r(e,n,t[n])});e.exports=l},function(e,t,n){var r=n(938),o=n(389);e.exports=function(e){return r(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,s&&o(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var u=n[r];u&&e(t,u,r,a)}return t})}},function(e,t,n){var r=n(237),o=n(454),i=n(455);e.exports=function(e,t){return i(o(e,t,r),e+"")}},function(e,t,n){ +/*! + * https://github.com/Starcounter-Jack/JSON-Patch + * (c) 2017 Joachim Wester + * MIT license */ -var e=function(t){e.Util.assign(this,t)};return e.prototype={constructor:e,urls:!0,email:!0,twitter:!0,newWindow:!0,stripPrefix:!0,truncate:void 0,className:"",htmlParser:void 0,matchParser:void 0,tagBuilder:void 0,link:function(e){for(var t=this.getHtmlParser(),n=t.parse(e),r=0,i=[],o=0,a=n.length;o<a;o++){var s=n[o],u=s.getType(),l=s.getText();if("element"===u)"a"===s.getTagName()&&(s.isClosing()?r=Math.max(r-1,0):r++),i.push(l);else if("entity"===u)i.push(l);else if(0===r){var c=this.linkifyStr(l);i.push(c)}else i.push(l)}return i.join("")},linkifyStr:function(e){return this.getMatchParser().replace(e,this.createMatchReturnVal,this)},createMatchReturnVal:function(t){var n;return this.replaceFn&&(n=this.replaceFn.call(this,this,t)),"string"==typeof n?n:!1===n?t.getMatchedText():n instanceof e.HtmlTag?n.toString():this.getTagBuilder().build(t).toString()},getHtmlParser:function(){var t=this.htmlParser;return t||(t=this.htmlParser=new e.htmlParser.HtmlParser),t},getMatchParser:function(){var t=this.matchParser;return t||(t=this.matchParser=new e.matchParser.MatchParser({urls:this.urls,email:this.email,twitter:this.twitter,stripPrefix:this.stripPrefix})),t},getTagBuilder:function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new e.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t}},e.link=function(t,n){return new e(n).link(t)},e.match={},e.htmlParser={},e.matchParser={},e.Util={abstractMethod:function(){throw"abstract"},assign:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},extend:function(t,n){var r=t.prototype,i=function(){};i.prototype=r;var o;o=n.hasOwnProperty("constructor")?n.constructor:function(){r.constructor.apply(this,arguments)};var a=o.prototype=new i;return a.constructor=o,a.superclass=r,delete n.constructor,e.Util.assign(a,n),o},ellipsis:function(e,t,n){return e.length>t&&(n=null==n?"..":n,e=e.substring(0,t-n.length)+n),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var n,r=[],i=0;n=t.exec(e);)r.push(e.substring(i,n.index)),r.push(n[0]),i=n.index+n[0].length;return r.push(e.substring(i)),r}},e.HtmlTag=e.Util.extend(Object,{whitespaceRegex:/\s+/,constructor:function(t){e.Util.assign(this,t),this.innerHtml=this.innerHtml||this.innerHTML},setTagName:function(e){return this.tagName=e,this},getTagName:function(){return this.tagName||""},setAttr:function(e,t){return this.getAttrs()[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(t){var n=this.getAttrs();return e.Util.assign(n,t),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(t){for(var n,r=this.getClass(),i=this.whitespaceRegex,o=e.Util.indexOf,a=r?r.split(i):[],s=t.split(i);n=s.shift();)-1===o(a,n)&&a.push(n);return this.getAttrs().class=a.join(" "),this},removeClass:function(t){for(var n,r=this.getClass(),i=this.whitespaceRegex,o=e.Util.indexOf,a=r?r.split(i):[],s=t.split(i);a.length&&(n=s.shift());){var u=o(a,n);-1!==u&&a.splice(u,1)}return this.getAttrs().class=a.join(" "),this},getClass:function(){return this.getAttrs().class||""},hasClass:function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},setInnerHtml:function(e){return this.innerHtml=e,this},getInnerHtml:function(){return this.innerHtml||""},toString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return t=t?" "+t:"",["<",e,t,">",this.getInnerHtml(),"</",e,">"].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+'="'+e[n]+'"');return t.join(" ")}}),e.AnchorTagBuilder=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},build:function(t){return new e.HtmlTag({tagName:"a",attrs:this.createAttrs(t.getType(),t.getAnchorHref()),innerHtml:this.processAnchorText(t.getAnchorText())})},createAttrs:function(e,t){var n={href:t},r=this.createCssClass(e);return r&&(n.class=r),this.newWindow&&(n.target="_blank"),n},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(t){return e.Util.ellipsis(t,this.truncate||Number.POSITIVE_INFINITY)}}),e.htmlParser.HtmlParser=e.Util.extend(Object,{htmlRegex:function(){var e=/[0-9a-zA-Z][0-9a-zA-Z:]*/,t=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,n=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,r=t.source+"(?:\\s*=\\s*"+n.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",r,"|",n.source+")",")*",">",")","|","(?:","<(/)?","("+e.source+")","(?:","\\s+",r,")*","\\s*/?",">",")"].join(""),"gi")}(),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){for(var t,n,r=this.htmlRegex,i=0,o=[];null!==(t=r.exec(e));){var a=t[0],s=t[1]||t[3],u=!!t[2],l=e.substring(i,t.index);l&&(n=this.parseTextAndEntityNodes(l),o.push.apply(o,n)),o.push(this.createElementNode(a,s,u)),i=t.index+a.length}if(i<e.length){var c=e.substring(i);c&&(n=this.parseTextAndEntityNodes(c),o.push.apply(o,n))}return o},parseTextAndEntityNodes:function(t){for(var n=[],r=e.Util.splitAndCapture(t,this.htmlCharacterEntitiesRegex),i=0,o=r.length;i<o;i+=2){var a=r[i],s=r[i+1];a&&n.push(this.createTextNode(a)),s&&n.push(this.createEntityNode(s))}return n},createElementNode:function(t,n,r){return new e.htmlParser.ElementNode({text:t,tagName:n.toLowerCase(),closing:r})},createEntityNode:function(t){return new e.htmlParser.EntityNode({text:t})},createTextNode:function(t){return new e.htmlParser.TextNode({text:t})}}),e.htmlParser.HtmlNode=e.Util.extend(Object,{text:"",constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getText:function(){return this.text}}),e.htmlParser.ElementNode=e.Util.extend(e.htmlParser.HtmlNode,{tagName:"",closing:!1,getType:function(){return"element"},getTagName:function(){return this.tagName},isClosing:function(){return this.closing}}),e.htmlParser.EntityNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"entity"}}),e.htmlParser.TextNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"text"}}),e.matchParser.MatchParser=e.Util.extend(Object,{urls:!0,email:!0,twitter:!0,stripPrefix:!0,matcherRegex:function(){var e=/(^|[^\w])@(\w{1,15})/,t=/(?:[\-;:&=\+\$,\w\.]+@)/,n=/(?:[A-Za-z][-.+A-Za-z0-9]+:(?![A-Za-z][-.+A-Za-z0-9]+:\/\/)(?!\d+\/?)(?:\/\/)?)/,r=/(?:www\.)/,i=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,o=/\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/,a=/[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]?!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]]/;return new RegExp(["(",e.source,")","|","(",t.source,i.source,o.source,")","|","(","(?:","(",n.source,i.source,")","|","(?:","(.?//)?",r.source,i.source,")","|","(?:","(.?//)?",i.source,o.source,")",")","(?:"+a.source+")?",")"].join(""),"gi")}(),charBeforeProtocolRelMatchRegex:/^(.)?\/\//,constructor:function(t){e.Util.assign(this,t),this.matchValidator=new e.MatchValidator},replace:function(e,t,n){var r=this;return e.replace(this.matcherRegex,function(e,i,o,a,s,u,l,c,p){var f=r.processCandidateMatch(e,i,o,a,s,u,l,c,p);if(f){var h=t.call(n,f.match);return f.prefixStr+h+f.suffixStr}return e})},processCandidateMatch:function(t,n,r,i,o,a,s,u,l){var c,p=u||l,f="",h="";if(n&&!this.twitter||o&&!this.email||a&&!this.urls||!this.matchValidator.isValidMatch(a,s,p))return null;if(this.matchHasUnbalancedClosingParen(t)&&(t=t.substr(0,t.length-1),h=")"),o)c=new e.match.Email({matchedText:t,email:o});else if(n)r&&(f=r,t=t.slice(1)),c=new e.match.Twitter({matchedText:t,twitterHandle:i});else{if(p){var d=p.match(this.charBeforeProtocolRelMatchRegex)[1]||"";d&&(f=d,t=t.slice(1))}c=new e.match.Url({matchedText:t,url:t,protocolUrlMatch:!!s,protocolRelativeMatch:!!p,stripPrefix:this.stripPrefix})}return{prefixStr:f,suffixStr:h,match:c}},matchHasUnbalancedClosingParen:function(e){if(")"===e.charAt(e.length-1)){var t=e.match(/\(/g),n=e.match(/\)/g);if((t&&t.length||0)<(n&&n.length||0))return!0}return!1}}),e.MatchValidator=e.Util.extend(Object,{invalidProtocolRelMatchRegex:/^[\w]\/\//,hasFullProtocolRegex:/^[A-Za-z][-.+A-Za-z0-9]+:\/\//,uriSchemeRegex:/^[A-Za-z][-.+A-Za-z0-9]+:/,hasWordCharAfterProtocolRegex:/:[^\s]*?[A-Za-z]/,isValidMatch:function(e,t,n){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)||this.isInvalidProtocolRelativeMatch(n))},isValidUriScheme:function(e){var t=e.match(this.uriSchemeRegex)[0].toLowerCase();return"javascript:"!==t&&"vbscript:"!==t},urlMatchDoesNotHaveProtocolOrDot:function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},urlMatchDoesNotHaveAtLeastOneWordChar:function(e,t){return!(!e||!t)&&!this.hasWordCharAfterProtocolRegex.test(e)},isInvalidProtocolRelativeMatch:function(e){return!!e&&this.invalidProtocolRelMatchRegex.test(e)}}),e.match.Match=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getMatchedText:function(){return this.matchedText},getAnchorHref:e.Util.abstractMethod,getAnchorText:e.Util.abstractMethod}),e.match.Email=e.Util.extend(e.match.Match,{getType:function(){return"email"},getEmail:function(){return this.email},getAnchorHref:function(){return"mailto:"+this.email},getAnchorText:function(){return this.email}}),e.match.Twitter=e.Util.extend(e.match.Match,{getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}}),e.match.Url=e.Util.extend(e.match.Match,{urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,protocolRelativeRegex:/^\/\//,protocolPrepended:!1,getType:function(){return"url"},getUrl:function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},getAnchorHref:function(){return this.getUrl().replace(/&/g,"&")},getAnchorText:function(){var e=this.getUrl();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix&&(e=this.stripUrlPrefix(e)),e=this.removeTrailingSlash(e)},stripUrlPrefix:function(e){return e.replace(this.urlPrefixRegex,"")},stripProtocolRelativePrefix:function(e){return e.replace(this.protocolRelativeRegex,"")},removeTrailingSlash:function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e}}),e})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"getLayout",value:function(){var e=this.props,t=e.getComponent,n=e.layoutSelectors,r=n.current(),i=t(r,!0);return i||function(){return m.default.createElement("h1",null,' No layout defined for "',r,'" ')}}},{key:"render",value:function(){var e=this.getLayout();return m.default.createElement(e,null)}}]),t}(m.default.Component);t.default=y,y.propTypes={getComponent:g.default.func.isRequired,layoutSelectors:g.default.object.isRequired},y.defaultProps={}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=r(i),a=n(18),s=r(a),u=n(4),l=r(u),c=n(2),p=r(c),f=n(3),h=r(f),d=n(6),m=r(d),v=n(5),g=r(v),y=n(0),_=r(y),b=n(1),x=r(b),w=n(12),k=r(w),E={color:"#999",fontStyle:"italic"},S=function(e){function t(){return(0,p.default)(this,t),(0,m.default)(this,(t.__proto__||(0,l.default)(t)).apply(this,arguments))}return(0,g.default)(t,e),(0,h.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.getConfigs,r=e.schema,i=e.depth,a=e.expandDepth,u=e.name,l=e.specPath,c=r.get("description"),p=r.get("items"),f=r.get("title")||u,h=r.filter(function(e,t){return-1===["type","items","description","$$ref"].indexOf(t)}),d=t("Markdown"),m=t("ModelCollapse"),v=t("Model"),g=t("Property"),y=f&&_.default.createElement("span",{className:"model-title"},_.default.createElement("span",{className:"model-title__text"},f));return _.default.createElement("span",{className:"model"},_.default.createElement(m,{title:y,expanded:i<=a,collapsedContent:"[...]"},"[",h.size?h.entrySeq().map(function(e){var t=(0,s.default)(e,2),n=t[0],r=t[1];return _.default.createElement(g,{key:n+"-"+r,propKey:n,propVal:r,propStyle:E})}):null,c?_.default.createElement(d,{source:c}):null,_.default.createElement("span",null,_.default.createElement(v,(0,o.default)({},this.props,{getConfigs:n,specPath:l.push("items"),name:null,schema:p,required:!1,depth:i+1}))),"]"))}}]),t}(y.Component);S.propTypes={schema:x.default.object.isRequired,getComponent:x.default.func.isRequired,getConfigs:x.default.func.isRequired,specSelectors:x.default.object.isRequired,name:x.default.string,required:x.default.bool,expandDepth:x.default.number,specPath:k.default.list.isRequired,depth:x.default.number},t.default=S},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(30),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=function(e){function t(e,n){(0,l.default)(this,t);var r=(0,h.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,n));x.call(r);var i=r.props,o=i.name,a=i.schema,u=r.getValue();return r.state={name:o,schema:a,value:u},r}return(0,m.default)(t,e),(0,p.default)(t,[{key:"getValue",value:function(){var e=this.props,t=e.name,n=e.authorized;return n&&n.getIn([t,"value"])}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.errSelectors,i=e.name,o=n("Input"),a=n("Row"),s=n("Col"),u=n("authError"),l=n("Markdown"),c=n("JumpToPath",!0),p=this.getValue(),f=r.allErrors().filter(function(e){return e.get("authId")===i});return g.default.createElement("div",null,g.default.createElement("h4",null,g.default.createElement("code",null,i||t.get("name")),"  (apiKey)",g.default.createElement(c,{path:["securityDefinitions",i]})),p&&g.default.createElement("h6",null,"Authorized"),g.default.createElement(a,null,g.default.createElement(l,{source:t.get("description")})),g.default.createElement(a,null,g.default.createElement("p",null,"Name: ",g.default.createElement("code",null,t.get("name")))),g.default.createElement(a,null,g.default.createElement("p",null,"In: ",g.default.createElement("code",null,t.get("in")))),g.default.createElement(a,null,g.default.createElement("label",null,"Value:"),p?g.default.createElement("code",null," ****** "):g.default.createElement(s,null,g.default.createElement(o,{type:"text",onChange:this.onChange}))),f.valueSeq().map(function(e,t){return g.default.createElement(u,{error:e,key:t})}))}}]),t}(g.default.Component);b.propTypes={authorized:_.default.object,getComponent:_.default.func.isRequired,errSelectors:_.default.object.isRequired,schema:_.default.object.isRequired,name:_.default.string.isRequired,onChange:_.default.func};var x=function(){var e=this;this.onChange=function(t){var n=e.props.onChange,r=t.target.value,i=(0,o.default)({},e.state,{value:r});e.setState(i),n(i)}};t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(12),_=r(y),b=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.schema,n=e.name,r=e.getComponent,i=e.onAuthChange,o=e.authorized,a=e.errSelectors,s=r("apiKeyAuth"),u=r("basicAuth"),l=void 0,c=t.get("type");switch(c){case"apiKey":l=m.default.createElement(s,{key:n,schema:t,name:n,errSelectors:a,authorized:o,getComponent:r,onChange:i});break;case"basic":l=m.default.createElement(u,{key:n,schema:t,name:n,errSelectors:a,authorized:o,getComponent:r,onChange:i});break;default:l=m.default.createElement("div",{key:n},"Unknown security definition type ",c)}return m.default.createElement("div",{key:n+"-jump"},l)}}]),t}(m.default.Component);b.propTypes={schema:_.default.orderedMap.isRequired,name:g.default.string.isRequired,onAuthChange:g.default.func.isRequired,authorized:_.default.orderedMap.isRequired},b.propTypes={errSelectors:g.default.object.isRequired,getComponent:g.default.func.isRequired,authSelectors:g.default.object.isRequired,specSelectors:g.default.object.isRequired,authActions:g.default.object.isRequired,definitions:_.default.iterable.isRequired},t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.close=function(){r.props.authActions.showDefinitions(!1)},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.authSelectors,n=e.authActions,r=e.getComponent,i=e.errSelectors,o=e.specSelectors,a=e.fn.AST,s=t.shownDefinitions(),u=r("auths");return m.default.createElement("div",{className:"dialog-ux"},m.default.createElement("div",{className:"backdrop-ux"}),m.default.createElement("div",{className:"modal-ux"},m.default.createElement("div",{className:"modal-dialog-ux"},m.default.createElement("div",{className:"modal-ux-inner"},m.default.createElement("div",{className:"modal-ux-header"},m.default.createElement("h3",null,"Available authorizations"),m.default.createElement("button",{type:"button",className:"close-modal",onClick:this.close},m.default.createElement("svg",{width:"20",height:"20"},m.default.createElement("use",{href:"#close",xlinkHref:"#close"})))),m.default.createElement("div",{className:"modal-ux-content"},s.valueSeq().map(function(e,s){return m.default.createElement(u,{key:s,AST:a,definitions:e,getComponent:r,errSelectors:i,authSelectors:t,authActions:n,specSelectors:o})}))))))}}]),t}(m.default.Component);y.propTypes={fn:g.default.object.isRequired,getComponent:g.default.func.isRequired,authSelectors:g.default.object.isRequired,specSelectors:g.default.object.isRequired,errSelectors:g.default.object.isRequired,authActions:g.default.object.isRequired},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.onClick=function(){var e=r.props,t=e.authActions,n=e.authSelectors,i=n.definitionsToAuthorize();t.showDefinitions(i)},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.authSelectors,n=e.getComponent,r=n("authorizationPopup",!0),i=!!t.shownDefinitions(),o=!!t.authorized().size;return m.default.createElement("div",{className:"auth-wrapper"},m.default.createElement("button",{className:o?"btn authorize locked":"btn authorize unlocked",onClick:this.onClick},m.default.createElement("span",null,"Authorize"),m.default.createElement("svg",{width:"20",height:"20"},m.default.createElement("use",{href:o?"#locked":"#unlocked",xlinkHref:o?"#locked":"#unlocked"}))),i&&m.default.createElement(r,null))}}]),t}(m.default.Component);y.propTypes={className:g.default.string},y.propTypes={getComponent:g.default.func.isRequired,authSelectors:g.default.object.isRequired,errActions:g.default.object.isRequired,authActions:g.default.object.isRequired},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.onClick=function(e){e.stopPropagation();var t=r.props.onClick;t&&t()},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props.isAuthorized;return m.default.createElement("button",{className:e?"authorization__btn locked":"authorization__btn unlocked","aria-label":e?"authorization button locked":"authorization button unlocked",onClick:this.onClick},m.default.createElement("svg",{width:"20",height:"20"},m.default.createElement("use",{href:e?"#locked":"#unlocked",xlinkHref:e?"#locked":"#unlocked"})))}}]),t}(m.default.Component);y.propTypes={isAuthorized:g.default.bool.isRequired,onClick:g.default.func},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(36),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=n(12),x=r(b),w=function(e){function t(e,n){(0,l.default)(this,t);var r=(0,h.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,n));return r.onAuthChange=function(e){var t=e.name;r.setState((0,o.default)({},t,e))},r.submitAuth=function(e){e.preventDefault(),r.props.authActions.authorize(r.state)},r.logoutClick=function(e){e.preventDefault();var t=r.props,n=t.authActions,i=t.definitions,o=i.map(function(e,t){return t}).toArray();n.logout(o)},r.close=function(e){e.preventDefault(),r.props.authActions.showDefinitions(!1)},r.state={},r}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.definitions,r=t.getComponent,i=t.authSelectors,o=t.errSelectors,a=r("AuthItem"),s=r("oauth2",!0),u=r("Button"),l=i.authorized(),c=n.filter(function(e,t){return!!l.get(t)}),p=n.filter(function(e){return"oauth2"!==e.get("type")}),f=n.filter(function(e){return"oauth2"===e.get("type")});return g.default.createElement("div",{className:"auth-container"},!!p.size&&g.default.createElement("form",{onSubmit:this.submitAuth},p.map(function(t,n){return g.default.createElement(a,{key:n,schema:t,name:n,getComponent:r,onAuthChange:e.onAuthChange,authorized:l,errSelectors:o})}).toArray(),g.default.createElement("div",{className:"auth-btn-wrapper"},g.default.createElement(u,{className:"btn modal-btn auth btn-done",onClick:this.close},"Done"),p.size===c.size?g.default.createElement(u,{className:"btn modal-btn auth",onClick:this.logoutClick},"Logout"):g.default.createElement(u,{type:"submit",className:"btn modal-btn auth authorize"},"Authorize"))),f&&f.size?g.default.createElement("div",null,g.default.createElement("div",{className:"scope-def"},g.default.createElement("p",null,"Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes."),g.default.createElement("p",null,"API requires the following scopes. Select which ones you want to grant to Swagger UI.")),n.filter(function(e){return"oauth2"===e.get("type")}).map(function(e,t){return g.default.createElement("div",{key:t},g.default.createElement(s,{authorized:l,schema:e,name:t}))}).toArray()):null)}}]),t}(g.default.Component);w.propTypes={definitions:_.default.object.isRequired,getComponent:_.default.func.isRequired,authSelectors:_.default.object.isRequired,authActions:_.default.object.isRequired,specSelectors:_.default.object.isRequired},w.propTypes={errSelectors:_.default.object.isRequired,getComponent:_.default.func.isRequired,authSelectors:_.default.object.isRequired,specSelectors:_.default.object.isRequired,authActions:_.default.object.isRequired,definitions:x.default.iterable.isRequired},t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(12),_=r(y),b=function(e){function t(e,n){(0,s.default)(this,t);var r=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));x.call(r);var i=r.props,a=i.schema,u=i.name,l=r.getValue(),c=l.username;return r.state={name:u,schema:a,value:c?{username:c}:{}},r}return(0,h.default)(t,e),(0,l.default)(t,[{key:"getValue",value:function(){var e=this.props,t=e.authorized,n=e.name;return t&&t.getIn([n,"value"])||{}}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.name,i=e.errSelectors,o=n("Input"),a=n("Row"),s=n("Col"),u=n("authError"),l=n("JumpToPath",!0),c=n("Markdown"),p=this.getValue().username,f=i.allErrors().filter(function(e){return e.get("authId")===r});return m.default.createElement("div",null,m.default.createElement("h4",null,"Basic authorization",m.default.createElement(l,{path:["securityDefinitions",r]})),p&&m.default.createElement("h6",null,"Authorized"),m.default.createElement(a,null,m.default.createElement(c,{source:t.get("description")})),m.default.createElement(a,null,m.default.createElement("label",null,"Username:"),p?m.default.createElement("code",null," ",p," "):m.default.createElement(s,null,m.default.createElement(o,{type:"text",required:"required",name:"username",onChange:this.onChange}))),m.default.createElement(a,null,m.default.createElement("label",null,"Password:"),p?m.default.createElement("code",null," ****** "):m.default.createElement(s,null,m.default.createElement(o,{required:"required",autoComplete:"new-password",name:"password",type:"password",onChange:this.onChange}))),f.valueSeq().map(function(e,t){return m.default.createElement(u,{error:e,key:t})}))}}]),t}(m.default.Component);b.propTypes={authorized:g.default.object,getComponent:g.default.func.isRequired,schema:g.default.object.isRequired,onChange:g.default.func.isRequired},b.propTypes={name:g.default.string.isRequired,errSelectors:g.default.object.isRequired,getComponent:g.default.func.isRequired,onChange:g.default.func,schema:_.default.map,authorized:_.default.map};var x=function(){var e=this;this.onChange=function(t){var n=e.props.onChange,r=t.target,i=r.value,o=r.name,a=e.state.value;a[o]=i,e.setState({value:a}),n(e.state)}};t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props.error,t=e.get("level"),n=e.get("message"),r=e.get("source");return m.default.createElement("div",{className:"errors",style:{backgroundColor:"#ffeeee",color:"red",margin:"1em"}},m.default.createElement("b",{style:{textTransform:"capitalize",marginRight:"1em"}},r," ",t),m.default.createElement("span",null,n))}}]),t}(m.default.Component);y.propTypes={error:g.default.object.isRequired},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(36),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=n(559),x=r(b),w=function(e){function t(e,n){(0,l.default)(this,t);var r=(0,h.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,n));k.call(r);var i=r.props,o=i.name,a=i.schema,u=i.authorized,c=i.authSelectors,p=u&&u.get(o),f=c.getConfigs()||{},d=p&&p.get("username")||"",m=p&&p.get("clientId")||f.clientId||"",v=p&&p.get("clientSecret")||f.clientSecret||"",g=p&&p.get("passwordType")||"request-body";return r.state={appName:f.appName,name:o,schema:a,scopes:[],clientId:m,clientSecret:v,username:d,password:"",passwordType:g},r}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.schema,r=t.getComponent,i=t.authSelectors,o=t.errSelectors,a=t.name,s=t.specSelectors,u=r("Input"),l=r("Row"),c=r("Col"),p=r("Button"),f=r("authError"),h=r("JumpToPath",!0),d=r("Markdown"),m=s.isOAS3,v=m()?"authorizationCode":"accessCode",y=m()?"clientCredentials":"application",_=n.get("flow"),b=n.get("allowedScopes")||n.get("scopes"),x=i.authorized().get(a),w=!!x,k=o.allErrors().filter(function(e){return e.get("authId")===a}),E=!k.filter(function(e){return"validation"===e.get("source")}).size,S=n.get("description");return g.default.createElement("div",null,g.default.createElement("h4",null,a," (OAuth2, ",n.get("flow"),") ",g.default.createElement(h,{path:["securityDefinitions",a]})),this.state.appName?g.default.createElement("h5",null,"Application: ",this.state.appName," "):null,S&&g.default.createElement(d,{source:n.get("description")}),w&&g.default.createElement("h6",null,"Authorized"),("implicit"===_||_===v)&&g.default.createElement("p",null,"Authorization URL: ",g.default.createElement("code",null,n.get("authorizationUrl"))),("password"===_||_===v||_===y)&&g.default.createElement("p",null,"Token URL:",g.default.createElement("code",null," ",n.get("tokenUrl"))),g.default.createElement("p",{className:"flow"},"Flow: ",g.default.createElement("code",null,n.get("flow"))),"password"!==_?null:g.default.createElement(l,null,g.default.createElement(l,null,g.default.createElement("label",{htmlFor:"oauth_username"},"username:"),w?g.default.createElement("code",null," ",this.state.username," "):g.default.createElement(c,{tablet:10,desktop:10},g.default.createElement("input",{id:"oauth_username",type:"text","data-name":"username",onChange:this.onInputChange}))),g.default.createElement(l,null,g.default.createElement("label",{htmlFor:"oauth_password"},"password:"),w?g.default.createElement("code",null," ****** "):g.default.createElement(c,{tablet:10,desktop:10},g.default.createElement("input",{id:"oauth_password",type:"password","data-name":"password",onChange:this.onInputChange}))),g.default.createElement(l,null,g.default.createElement("label",{htmlFor:"password_type"},"type:"),w?g.default.createElement("code",null," ",this.state.passwordType," "):g.default.createElement(c,{tablet:10,desktop:10},g.default.createElement("select",{id:"password_type","data-name":"passwordType",onChange:this.onInputChange},g.default.createElement("option",{value:"request-body"},"Request body"),g.default.createElement("option",{value:"basic"},"Basic auth"),g.default.createElement("option",{value:"query"},"Query parameters"))))),(_===y||"implicit"===_||_===v||"password"===_&&"basic"!==this.state.passwordType)&&(!w||w&&this.state.clientId)&&g.default.createElement(l,null,g.default.createElement("label",{htmlFor:"client_id"},"client_id:"),w?g.default.createElement("code",null," ****** "):g.default.createElement(c,{tablet:10,desktop:10},g.default.createElement("input",{id:"client_id",type:"text",required:"password"===_,value:this.state.clientId,"data-name":"clientId",onChange:this.onInputChange}))),(_===y||_===v||"password"===_&&"basic"!==this.state.passwordType)&&g.default.createElement(l,null,g.default.createElement("label",{htmlFor:"client_secret"},"client_secret:"),w?g.default.createElement("code",null," ****** "):g.default.createElement(c,{tablet:10,desktop:10},g.default.createElement("input",{id:"client_secret",value:this.state.clientSecret,type:"text","data-name":"clientSecret",onChange:this.onInputChange}))),!w&&b&&b.size?g.default.createElement("div",{className:"scopes"},g.default.createElement("h2",null,"Scopes:"),b.map(function(t,n){return g.default.createElement(l,{key:n},g.default.createElement("div",{className:"checkbox"},g.default.createElement(u,{"data-value":n,id:n+"-"+_+"-checkbox-"+e.state.name,disabled:w,type:"checkbox",onChange:e.onScopeChange}),g.default.createElement("label",{htmlFor:n+"-"+_+"-checkbox-"+e.state.name},g.default.createElement("span",{className:"item"}),g.default.createElement("div",{className:"text"},g.default.createElement("p",{className:"name"},n),g.default.createElement("p",{className:"description"},t)))))}).toArray()):null,k.valueSeq().map(function(e,t){return g.default.createElement(f,{error:e,key:t})}),g.default.createElement("div",{className:"auth-btn-wrapper"},E&&(w?g.default.createElement(p,{className:"btn modal-btn auth authorize",onClick:this.logout},"Logout"):g.default.createElement(p,{className:"btn modal-btn auth authorize",onClick:this.authorize},"Authorize"))))}}]),t}(g.default.Component);w.propTypes={name:_.default.string,authorized:_.default.object,getComponent:_.default.func.isRequired,schema:_.default.object.isRequired,authSelectors:_.default.object.isRequired,authActions:_.default.object.isRequired,errSelectors:_.default.object.isRequired,specSelectors:_.default.object.isRequired,errActions:_.default.object.isRequired,getConfigs:_.default.any};var k=function(){var e=this;this.authorize=function(){var t=e.props,n=t.authActions,r=t.errActions,i=t.getConfigs,o=t.authSelectors,a=i(),s=o.getConfigs();r.clear({authId:name,type:"auth",source:"auth"}),(0,x.default)({auth:e.state,authActions:n,errActions:r,configs:a,authConfigs:s})},this.onScopeChange=function(t){var n=t.target,r=n.checked,i=n.dataset.value;if(r&&-1===e.state.scopes.indexOf(i)){var o=e.state.scopes.concat([i]);e.setState({scopes:o})}else!r&&e.state.scopes.indexOf(i)>-1&&e.setState({scopes:e.state.scopes.filter(function(e){return e!==i})})},this.onInputChange=function(t){var n=t.target,r=n.dataset.name,i=n.value,a=(0,o.default)({},r,i);e.setState(a)},this.logout=function(t){t.preventDefault();var n=e.props,r=n.authActions,i=n.errActions,o=n.name;i.clear({authId:o,type:"auth",source:"auth"}),r.logout([o])}};t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.onClick=function(){var e=r.props,t=e.specActions,n=e.path,i=e.method;t.clearResponse(n,i),t.clearRequest(n,i)},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){return m.default.createElement("button",{className:"btn btn-clear opblock-control__btn",onClick:this.onClick},"Clear")}}]),t}(d.Component);y.propTypes={specActions:g.default.object.isRequired,path:g.default.string.isRequired,method:g.default.string.isRequired},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(12),_=r(y),b=n(7),x=function(){},w=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.onChangeWrapper=function(e){return r.props.onChange(e.target.value)},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"componentDidMount",value:function(){this.props.contentTypes&&this.props.onChange(this.props.contentTypes.first())}},{key:"componentWillReceiveProps",value:function(e){e.contentTypes&&e.contentTypes.size&&(e.contentTypes.includes(e.value)||e.onChange(e.contentTypes.first()))}},{key:"render",value:function(){var e=this.props,t=e.contentTypes,n=e.className,r=e.value;return t&&t.size?m.default.createElement("div",{className:"content-type-wrapper "+(n||"")},m.default.createElement("select",{className:"content-type",value:r||"",onChange:this.onChangeWrapper},t.map(function(e){return m.default.createElement("option",{key:e,value:e},e)}).toArray())):null}}]),t}(m.default.Component);w.propTypes={contentTypes:g.default.oneOfType([_.default.list,_.default.set,_.default.seq]),value:g.default.string,onChange:g.default.func,className:g.default.string},w.defaultProps={onChange:x,value:null,contentTypes:(0,b.fromJS)(["application/json"])},t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(557),_=r(y),b=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"handleFocus",value:function(e){e.target.select(),document.execCommand("copy")}},{key:"render",value:function(){var e=this.props.request,t=(0,_.default)(e);return m.default.createElement("div",null,m.default.createElement("h4",null,"Curl"),m.default.createElement("div",{className:"copy-paste"},m.default.createElement("textarea",{onFocus:this.handleFocus,readOnly:"true",className:"curl",style:{whiteSpace:"normal"},value:t})))}}]),t}(m.default.Component);b.propTypes={request:g.default.object.isRequired},t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.DeepLink=void 0;var i=n(0),o=r(i),a=n(1),s=r(a),u=t.DeepLink=function(e){var t=e.enabled,n=e.path,r=e.text;return o.default.createElement("a",{className:"nostyle",onClick:t?function(e){return e.preventDefault()}:null,href:t?"#/"+n:null},o.default.createElement("span",null,r))};u.propTypes={enabled:s.default.bool,isShown:s.default.bool,path:s.default.string,text:s.default.string},t.default=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=r(i),a=n(12),s=r(a),u=function(e){var t=e.value,n=e.getComponent,r=n("ModelCollapse"),i=o.default.createElement("span",null,"Array [ ",t.count()," ]");return o.default.createElement("span",{className:"prop-enum"},"Enum:",o.default.createElement("br",null),o.default.createElement(r,{collapsedContent:i},"[ ",t.join(", ")," ]"))};u.propTypes={value:s.default.iterable,getComponent:s.default.func},t.default=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){return(e||"").split(" ").map(function(e){return e[0].toUpperCase()+e.slice(1)}).join(" ")}Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),a=r(o),s=n(2),u=r(s),l=n(3),c=r(l),p=n(6),f=r(p),h=n(5),d=r(h),m=n(0),v=r(m),g=n(1),y=r(g),_=n(7),b=n(448),x=function(e){function t(){return(0,u.default)(this,t),(0,f.default)(this,(t.__proto__||(0,a.default)(t)).apply(this,arguments))}return(0,d.default)(t,e),(0,c.default)(t,[{key:"render",value:function(){var e=this.props,t=e.editorActions,n=e.errSelectors,r=e.layoutSelectors,i=e.layoutActions;if(t&&t.jumpToLine)var o=t.jumpToLine;var a=n.allErrors(),s=a.filter(function(e){return"thrown"===e.get("type")||"error"===e.get("level")});if(!s||s.count()<1)return null;var u=r.isShown(["errorPane"],!0),l=function(){return i.show(["errorPane"],!u)},c=s.sortBy(function(e){return e.get("line")});return v.default.createElement("pre",{className:"errors-wrapper"},v.default.createElement("hgroup",{className:"error"},v.default.createElement("h4",{className:"errors__title"},"Errors"),v.default.createElement("button",{className:"btn errors__clear-btn",onClick:l},u?"Hide":"Show")),v.default.createElement(b.Collapse,{isOpened:u,animated:!0},v.default.createElement("div",{className:"errors"},c.map(function(e,t){var n=e.get("type");return"thrown"===n||"auth"===n?v.default.createElement(w,{key:t,error:e.get("error")||e,jumpToLine:o}):"spec"===n?v.default.createElement(k,{key:t,error:e,jumpToLine:o}):void 0}))))}}]),t}(v.default.Component);x.propTypes={editorActions:y.default.object,errSelectors:y.default.object.isRequired,layoutSelectors:y.default.object.isRequired,layoutActions:y.default.object.isRequired},t.default=x;var w=function(e){var t=e.error,n=e.jumpToLine;if(!t)return null;var r=t.get("line");return v.default.createElement("div",{className:"error-wrapper"},t?v.default.createElement("div",null,v.default.createElement("h4",null,t.get("source")&&t.get("level")?i(t.get("source"))+" "+t.get("level"):"",t.get("path")?v.default.createElement("small",null," at ",t.get("path")):null),v.default.createElement("span",{style:{whiteSpace:"pre-line",maxWidth:"100%"}},t.get("message")),v.default.createElement("div",{style:{"text-decoration":"underline",cursor:"pointer"}},r&&n?v.default.createElement("a",{onClick:n.bind(null,r)},"Jump to line ",r):null)):null)},k=function(e){var t=e.error,n=e.jumpToLine,r=null;return t.get("path")?r=_.List.isList(t.get("path"))?v.default.createElement("small",null,"at ",t.get("path").join(".")):v.default.createElement("small",null,"at ",t.get("path")):t.get("line")&&!n&&(r=v.default.createElement("small",null,"on line ",t.get("line"))),v.default.createElement("div",{className:"error-wrapper"},t?v.default.createElement("div",null,v.default.createElement("h4",null,i(t.get("source"))+" "+t.get("level")," ",r),v.default.createElement("span",{style:{whiteSpace:"pre-line"}},t.get("message")),v.default.createElement("div",{style:{"text-decoration":"underline",cursor:"pointer"}},n?v.default.createElement("a",{onClick:n.bind(null,t.get("line"))},"Jump to line ",t.get("line")):null)):null)};w.propTypes={error:y.default.object.isRequired,jumpToLine:y.default.func},w.defaultProps={jumpToLine:null},k.propTypes={error:y.default.object.isRequired,jumpToLine:y.default.func}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.onClick=function(){var e=r.props,t=e.specSelectors,n=e.specActions,i=e.operation,o=e.path,a=e.method;n.validateParams([o,a]),t.validateBeforeExecute([o,a])&&(r.props.onExecute&&r.props.onExecute(),n.execute({operation:i,path:o,method:a}))},r.onChangeProducesWrapper=function(e){return r.props.specActions.changeProducesValue([r.props.path,r.props.method],e)},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){return m.default.createElement("button",{className:"btn execute opblock-control__btn",onClick:this.onClick},"Execute")}}]),t}(d.Component);y.propTypes={specSelectors:g.default.object.isRequired,specActions:g.default.object.isRequired,operation:g.default.object.isRequired,path:g.default.string.isRequired,method:g.default.string.isRequired,onExecute:g.default.func},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){return m.default.createElement("div",{className:"footer"})}}]),t}(m.default.Component);t.default=v},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=n(7),x=r(b),w={color:"#999",fontStyle:"italic"},k=function(e){function t(){return(0,l.default)(this,t),(0,h.default)(this,(t.__proto__||(0,s.default)(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.headers,n=e.getComponent,r=n("Property");return t&&t.size?g.default.createElement("div",{className:"headers-wrapper"},g.default.createElement("h4",{className:"headers__title"},"Headers:"),g.default.createElement("table",{className:"headers"},g.default.createElement("thead",null,g.default.createElement("tr",{className:"header-row"},g.default.createElement("th",{className:"header-col"},"Name"),g.default.createElement("th",{className:"header-col"},"Description"),g.default.createElement("th",{className:"header-col"},"Type"))),g.default.createElement("tbody",null,t.entrySeq().map(function(e){var t=(0,o.default)(e,2),n=t[0],i=t[1];if(!x.default.Map.isMap(i))return null;var a=i.getIn(["schema"])?i.getIn(["schema","type"]):i.getIn(["type"]),s=i.getIn(["schema","example"]);return g.default.createElement("tr",{key:n},g.default.createElement("td",{className:"header-col"},n),g.default.createElement("td",{className:"header-col"},i.get("description")),g.default.createElement("td",{className:"header-col"},a," ",s?g.default.createElement(r,{propKey:"Example",propVal:s,propStyle:w}):null))}).toArray()))):null}}]),t}(g.default.Component);k.propTypes={headers:_.default.object.isRequired,getComponent:_.default.func.isRequired},t.default=k},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(9),_=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.initializeComponent=function(e){r.el=e},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"componentDidMount",value:function(){(0,y.highlight)(this.el)}},{key:"componentDidUpdate",value:function(){(0,y.highlight)(this.el)}},{key:"render",value:function(){var e=this.props,t=e.value,n=e.className;return n=n||"",m.default.createElement("pre",{ref:this.initializeComponent,className:n+" microlight"},t)}}]),t}(d.Component);_.propTypes={value:g.default.string.isRequired,className:g.default.string},t.default=_},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(7),_=n(12),b=r(_),x=n(9),w=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.host,n=e.basePath;return m.default.createElement("pre",{className:"base-url"},"[ Base URL: ",t,n," ]")}}]),t}(m.default.Component);w.propTypes={host:g.default.string,basePath:g.default.string};var k=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props.data,t=e.get("name")||"the developer",n=e.get("url"),r=e.get("email");return m.default.createElement("div",null,n&&m.default.createElement("div",null,m.default.createElement("a",{href:(0,x.sanitizeUrl)(n),target:"_blank"},t," - Website")),r&&m.default.createElement("a",{href:(0,x.sanitizeUrl)("mailto:"+r)},n?"Send email to "+t:"Contact "+t))}}]),t}(m.default.Component);k.propTypes={data:g.default.object};var E=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props.license,t=e.get("name")||"License",n=e.get("url");return m.default.createElement("div",null,n?m.default.createElement("a",{target:"_blank",href:(0,x.sanitizeUrl)(n)},t):m.default.createElement("span",null,t))}}]),t}(m.default.Component);E.propTypes={license:g.default.object};var S=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.info,n=e.url,r=e.host,i=e.basePath,o=e.getComponent,a=e.externalDocs,s=t.get("version"),u=t.get("description"),l=t.get("title"),c=t.get("termsOfService"),p=t.get("contact"),f=t.get("license"),h=(a||(0,y.fromJS)({})).toJS(),d=h.url,v=h.description,g=o("Markdown"),_=o("VersionStamp");return m.default.createElement("div",{className:"info"},m.default.createElement("hgroup",{className:"main"},m.default.createElement("h2",{className:"title"},l,s&&m.default.createElement(_,{version:s})),r||i?m.default.createElement(w,{host:r,basePath:i}):null,n&&m.default.createElement("a",{target:"_blank",href:(0,x.sanitizeUrl)(n)},m.default.createElement("span",{className:"url"}," ",n," "))),m.default.createElement("div",{className:"description"},m.default.createElement(g,{source:u})),c&&m.default.createElement("div",null,m.default.createElement("a",{target:"_blank",href:(0,x.sanitizeUrl)(c)},"Terms of service")),p&&p.size?m.default.createElement(k,{data:p}):null,f&&f.size?m.default.createElement(E,{license:f}):null,d?m.default.createElement("a",{target:"_blank",href:(0,x.sanitizeUrl)(d)},v||d):null)}}]),t}(m.default.Component);S.propTypes={info:g.default.object,url:g.default.string,host:g.default.string,basePath:g.default.string,externalDocs:b.default.map,getComponent:g.default.func.isRequired},t.default=S,S.propTypes={title:g.default.any,description:g.default.any,version:g.default.any,url:g.default.string}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.onFilterChange=function(e){var t=e.target.value;r.props.layoutActions.updateFilter(t)},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.specActions,r=e.getComponent,i=e.layoutSelectors,o=e.oas3Selectors,a=e.oas3Actions,s=t.info(),u=t.url(),l=t.basePath(),c=t.host(),p=t.securityDefinitions(),f=t.externalDocs(),h=t.schemes(),d=t.servers(),v=r("info"),g=r("operations",!0),y=r("Models",!0),_=r("authorizeBtn",!0),b=r("Row"),x=r("Col"),w=r("Servers"),k=r("errors",!0),E="loading"===t.loadingStatus(),S="failed"===t.loadingStatus(),C=i.currentFilter(),A={};S&&(A.color="red"),E&&(A.color="#aaa");var D=r("schemes");if(!t.specStr()){var O=void 0;return O=E?m.default.createElement("div",{className:"loading"}):m.default.createElement("h4",null,"No API definition provided."),m.default.createElement("div",{className:"swagger-ui"},m.default.createElement("div",{className:"loading-container"},O))}return m.default.createElement("div",{className:"swagger-ui"},m.default.createElement("div",null,m.default.createElement(k,null),m.default.createElement(b,{className:"information-container"},m.default.createElement(x,{mobile:12},s.count()?m.default.createElement(v,{info:s,url:u,host:c,basePath:l,externalDocs:f,getComponent:r}):null)),h&&h.size||p?m.default.createElement("div",{className:"scheme-container"},m.default.createElement(x,{className:"schemes wrapper",mobile:12},h&&h.size?m.default.createElement(D,{currentScheme:t.operationScheme(),schemes:h,specActions:n}):null,p?m.default.createElement(_,null):null)):null,d&&d.size?m.default.createElement("div",{className:"global-server-container"},m.default.createElement(x,{className:"servers wrapper",mobile:12},m.default.createElement("span",{className:"servers-title"},"Server"),m.default.createElement(w,{servers:d,currentServer:o.selectedServer(),setSelectedServer:a.setSelectedServer,setServerVariableValue:a.setServerVariableValue,getServerVariable:o.serverVariableValue,getEffectiveServerValue:o.serverEffectiveValue}))):null,null===C||!1===C?null:m.default.createElement("div",{className:"filter-container"},m.default.createElement(x,{className:"filter wrapper",mobile:12},m.default.createElement("input",{className:"operation-filter-input",placeholder:"Filter by tag",type:"text",onChange:this.onFilterChange,value:!0===C||"true"===C?"":C,disabled:E,style:A}))),m.default.createElement(b,null,m.default.createElement(x,{mobile:12,desktop:12},m.default.createElement(g,null))),m.default.createElement(b,null,m.default.createElement(x,{mobile:12,desktop:12},m.default.createElement(y,null)))))}}]),t}(m.default.Component);y.propTypes={errSelectors:g.default.object.isRequired,errActions:g.default.object.isRequired,specActions:g.default.object.isRequired,specSelectors:g.default.object.isRequired,oas3Selectors:g.default.object.isRequired,oas3Actions:g.default.object.isRequired,layoutSelectors:g.default.object.isRequired,layoutActions:g.default.object.isRequired,getComponent:g.default.func.isRequired},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(47),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=n(12),x=r(b),w=n(7),k=function(e){var t=e.headers;return g.default.createElement("div",null,g.default.createElement("h5",null,"Response headers"),g.default.createElement("pre",null,t))};k.propTypes={headers:_.default.array.isRequired};var E=function(e){var t=e.duration;return g.default.createElement("div",null,g.default.createElement("h5",null,"Request duration"),g.default.createElement("pre",null,t," ms"))};E.propTypes={duration:_.default.number.isRequired};var S=function(e){function t(){return(0,l.default)(this,t),(0,h.default)(this,(t.__proto__||(0,s.default)(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,p.default)(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.response!==e.response||this.props.path!==e.path||this.props.method!==e.method||this.props.displayRequestDuration!==e.displayRequestDuration}},{key:"render",value:function(){var e=this.props,t=e.response,n=e.getComponent,r=e.getConfigs,i=e.displayRequestDuration,a=e.specSelectors,s=e.path,u=e.method,l=r(),c=l.showMutatedRequest,p=c?a.mutatedRequestFor(s,u):a.requestFor(s,u),f=t.get("status"),h=p.get("url"),d=t.get("headers").toJS(),m=t.get("notDocumented"),v=t.get("error"),y=t.get("text"),_=t.get("duration"),b=(0,o.default)(d),x=d["content-type"],w=n("curl"),S=n("responseBody"),C=b.map(function(e){return g.default.createElement("span",{className:"headerline",key:e}," ",e,": ",d[e]," ")}),A=0!==C.length;return g.default.createElement("div",null,p&&g.default.createElement(w,{request:p}),h&&g.default.createElement("div",null,g.default.createElement("h4",null,"Request URL"),g.default.createElement("div",{className:"request-url"},g.default.createElement("pre",null,h))),g.default.createElement("h4",null,"Server response"),g.default.createElement("table",{className:"responses-table"},g.default.createElement("thead",null,g.default.createElement("tr",{className:"responses-header"},g.default.createElement("td",{className:"col col_header response-col_status"},"Code"),g.default.createElement("td",{className:"col col_header response-col_description"},"Details"))),g.default.createElement("tbody",null,g.default.createElement("tr",{className:"response"},g.default.createElement("td",{className:"col response-col_status"},f,m?g.default.createElement("div",{className:"response-undocumented"},g.default.createElement("i",null," Undocumented ")):null),g.default.createElement("td",{className:"col response-col_description"},v?g.default.createElement("span",null,t.get("name")+": "+t.get("message")):null,y?g.default.createElement(S,{content:y,contentType:x,url:h,headers:d,getComponent:n}):null,A?g.default.createElement(k,{headers:C}):null,i&&_?g.default.createElement(E,{duration:_}):null)))))}}]),t}(g.default.Component);S.propTypes={response:_.default.instanceOf(w.Iterable).isRequired,path:_.default.string.isRequired,method:_.default.string.isRequired,displayRequestDuration:_.default.bool.isRequired,specSelectors:_.default.object.isRequired,getComponent:_.default.func.isRequired,getConfigs:_.default.func.isRequired},S.propTypes={getComponent:_.default.func.isRequired,response:x.default.map},t.default=S},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(e,n){(0,s.default)(this,t);var r=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));r.toggleCollapsed=function(){r.props.onToggle&&r.props.onToggle(r.props.modelName,!r.state.expanded),r.setState({expanded:!r.state.expanded})};var i=r.props,a=i.expanded,u=i.collapsedContent;return r.state={expanded:a,collapsedContent:u||t.defaultProps.collapsedContent},r}return(0,h.default)(t,e),(0,l.default)(t,[{key:"componentWillReceiveProps",value:function(e){this.props.expanded!=e.expanded&&this.setState({expanded:e.expanded})}},{key:"render",value:function(){var e=this.props.title;return m.default.createElement("span",null,e&&m.default.createElement("span",{onClick:this.toggleCollapsed,style:{cursor:"pointer"}},e),m.default.createElement("span",{onClick:this.toggleCollapsed,style:{cursor:"pointer"}},m.default.createElement("span",{className:"model-toggle"+(this.state.expanded?"":" collapsed")})),this.state.expanded?this.props.children:this.state.collapsedContent)}}]),t}(d.Component);y.propTypes={collapsedContent:g.default.any,expanded:g.default.bool,children:g.default.any,title:g.default.element,modelName:g.default.string,onToggle:g.default.func},y.defaultProps={collapsedContent:"{...}",expanded:!1,title:null,onToggle:function(){}},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(12),_=r(y),b=function(e){function t(e,n){(0,s.default)(this,t);var r=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));r.activeTab=function(e){var t=e.target.dataset.name;r.setState({activeTab:t})};var i=r.props.getConfigs,a=i(),u=a.defaultModelRendering;return"example"!==u&&"model"!==u&&(u="example"),r.state={activeTab:u},r}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.specSelectors,r=e.schema,i=e.example,o=e.isExecute,a=e.getConfigs,s=e.specPath,u=a(),l=u.defaultModelExpandDepth,c=t("ModelWrapper");return m.default.createElement("div",null,m.default.createElement("ul",{className:"tab"},m.default.createElement("li",{className:"tabitem"+(o||"example"===this.state.activeTab?" active":"")},m.default.createElement("a",{className:"tablinks","data-name":"example",onClick:this.activeTab},"Example Value")),r?m.default.createElement("li",{className:"tabitem"+(o||"model"!==this.state.activeTab?"":" active")},m.default.createElement("a",{className:"tablinks"+(o?" inactive":""),"data-name":"model",onClick:this.activeTab},"Model")):null),m.default.createElement("div",null,(o||"example"===this.state.activeTab)&&i,!o&&"model"===this.state.activeTab&&m.default.createElement(c,{schema:r,getComponent:t,getConfigs:a,specSelectors:n,expandDepth:l,specPath:s})))}}]),t}(m.default.Component);b.propTypes={getComponent:g.default.func.isRequired,specSelectors:g.default.object.isRequired,schema:g.default.object.isRequired,example:g.default.any.isRequired,isExecute:g.default.bool,getConfigs:g.default.func.isRequired,specPath:_.default.list.isRequired},t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=function(e){function t(){var e,n,r,i;(0,l.default)(this,t);for(var o=arguments.length,a=Array(o),u=0;u<o;u++)a[u]=arguments[u];return n=r=(0,h.default)(this,(e=t.__proto__||(0,s.default)(t)).call.apply(e,[this].concat(a))),r.onToggle=function(e,t){r.props.layoutActions&&r.props.layoutActions.show(["models",e],t)},i=n,(0,h.default)(r,i)}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.getConfigs,r=t("Model"),i=void 0;return this.props.layoutSelectors&&(i=this.props.layoutSelectors.isShown(["models",this.props.name])),g.default.createElement("div",{className:"model-box"},g.default.createElement(r,(0,o.default)({},this.props,{getConfigs:n,expanded:i,depth:1,onToggle:this.onToggle,expandDepth:this.props.expandDepth||0})))}}]),t}(v.Component);b.propTypes={schema:_.default.object.isRequired,name:_.default.string,getComponent:_.default.func.isRequired,getConfigs:_.default.func.isRequired,specSelectors:_.default.object.isRequired,expandDepth:_.default.number,layoutActions:_.default.object,layoutSelectors:_.default.object.isRequired},t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(7),_=r(y),b=n(1),x=r(b),w=function(e){function t(){return(0,l.default)(this,t),(0,h.default)(this,(t.__proto__||(0,s.default)(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.getComponent,r=e.layoutSelectors,i=e.layoutActions,a=e.getConfigs,s=t.definitions(),u=a(),l=u.docExpansion,c=u.defaultModelsExpandDepth;if(!s.size||c<0)return null;var p=r.isShown("models",c>0&&"none"!==l),f=t.isOAS3()?["components","schemas"]:["definitions"],h=n("ModelWrapper"),d=n("Collapse");return g.default.createElement("section",{className:p?"models is-open":"models"},g.default.createElement("h4",{onClick:function(){return i.show("models",!p)}},g.default.createElement("span",null,"Models"),g.default.createElement("svg",{width:"20",height:"20"},g.default.createElement("use",{xlinkHref:p?"#large-arrow-down":"#large-arrow"}))),g.default.createElement(d,{isOpened:p},s.entrySeq().map(function(e){var s=(0,o.default)(e,2),u=s[0],l=s[1];return g.default.createElement("div",{id:"model-"+u,className:"model-container",key:"models-section-"+u},g.default.createElement(h,{name:u,expandDepth:c,schema:l,specPath:_.default.List([].concat(f,[u])),getComponent:n,specSelectors:t,getConfigs:a,layoutSelectors:r,layoutActions:i}))}).toArray()))}}]),t}(v.Component);w.propTypes={getComponent:x.default.func,specSelectors:x.default.object,layoutSelectors:x.default.object,layoutActions:x.default.object,getConfigs:x.default.func.isRequired},t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(35),o=r(i),a=n(21),s=r(a),u=n(18),l=r(u),c=n(96),p=r(c),f=n(4),h=r(f),d=n(2),m=r(d),v=n(3),g=r(v),y=n(6),_=r(y),b=n(5),x=r(b),w=n(0),k=r(w),E=n(1),S=r(E),C=n(7),A=n(12),D=r(A),O=function(e){function t(){return(0,m.default)(this,t),(0,_.default)(this,(t.__proto__||(0,h.default)(t)).apply(this,arguments))}return(0,x.default)(t,e),(0,g.default)(t,[{key:"render",value:function(){var e=this.props,t=e.schema,n=e.name,r=e.isRef,i=e.getComponent,a=e.getConfigs,u=e.depth,c=e.onToggle,f=e.expanded,h=e.specPath,d=(0,p.default)(e,["schema","name","isRef","getComponent","getConfigs","depth","onToggle","expanded","specPath"]),m=d.specSelectors,v=d.expandDepth,g=m.isOAS3;if(!t)return null;var y=a(),_=y.showExtensions,b=t.get("description"),x=t.get("properties"),w=t.get("additionalProperties"),E=t.get("title")||n,S=t.get("required"),A=i("JumpToPath",!0),D=i("Markdown"),O=i("Model"),M=i("ModelCollapse"),T=function(){return k.default.createElement("span",{className:"model-jump-to-path"},k.default.createElement(A,{specPath:h}))},P=k.default.createElement("span",null,k.default.createElement("span",null,"{"),"...",k.default.createElement("span",null,"}"),r?k.default.createElement(T,null):""),I=m.isOAS3()?t.get("anyOf"):null,R=m.isOAS3()?t.get("oneOf"):null,j=m.isOAS3()?t.get("not"):null,F=E&&k.default.createElement("span",{className:"model-title"},r&&t.get("$$ref")&&k.default.createElement("span",{className:"model-hint"},t.get("$$ref")),k.default.createElement("span",{className:"model-title__text"},E));return k.default.createElement("span",{className:"model"},k.default.createElement(M,{modelName:n,title:F,onToggle:c,expanded:!!f||u<=v,collapsedContent:P},k.default.createElement("span",{className:"brace-open object"},"{"),r?k.default.createElement(T,null):null,k.default.createElement("span",{className:"inner-object"},k.default.createElement("table",{className:"model"},k.default.createElement("tbody",null,b?k.default.createElement("tr",{style:{color:"#999",fontStyle:"italic"}},k.default.createElement("td",null,"description:"),k.default.createElement("td",null,k.default.createElement(D,{source:b}))):null,x&&x.size?x.entrySeq().map(function(e){var t=(0,l.default)(e,2),r=t[0],o=t[1],c=g()&&o.get("deprecated"),p=C.List.isList(S)&&S.contains(r),f={verticalAlign:"top",paddingRight:"0.2em"};return p&&(f.fontWeight="bold"),k.default.createElement("tr",{key:r,className:c&&"deprecated"},k.default.createElement("td",{style:f},r,p&&k.default.createElement("span",{style:{color:"red"}},"*")),k.default.createElement("td",{style:{verticalAlign:"top"}},k.default.createElement(O,(0,s.default)({key:"object-"+n+"-"+r+"_"+o},d,{required:p,getComponent:i,specPath:h.push("properties",r),getConfigs:a,schema:o,depth:u+1}))))}).toArray():null,_?k.default.createElement("tr",null," "):null,_?t.entrySeq().map(function(e){var t=(0,l.default)(e,2),n=t[0],r=t[1];if("x-"===n.slice(0,2)){var i=r?r.toJS?r.toJS():r:null;return k.default.createElement("tr",{key:n,style:{color:"#777"}},k.default.createElement("td",null,n),k.default.createElement("td",{style:{verticalAlign:"top"}},(0,o.default)(i)))}}).toArray():null,w&&w.size?k.default.createElement("tr",null,k.default.createElement("td",null,"< * >:"),k.default.createElement("td",null,k.default.createElement(O,(0,s.default)({},d,{required:!1,getComponent:i,specPath:h.push("additionalProperties"),getConfigs:a,schema:w,depth:u+1})))):null,I?k.default.createElement("tr",null,k.default.createElement("td",null,"anyOf ->"),k.default.createElement("td",null,I.map(function(e,t){return k.default.createElement("div",{key:t},k.default.createElement(O,(0,s.default)({},d,{required:!1,getComponent:i,specPath:h.push("anyOf",t),getConfigs:a,schema:e,depth:u+1})))}))):null,R?k.default.createElement("tr",null,k.default.createElement("td",null,"oneOf ->"),k.default.createElement("td",null,R.map(function(e,t){return k.default.createElement("div",{key:t},k.default.createElement(O,(0,s.default)({},d,{required:!1,getComponent:i,specPath:h.push("oneOf",t),getConfigs:a,schema:e,depth:u+1})))}))):null,j?k.default.createElement("tr",null,k.default.createElement("td",null,"not ->"),k.default.createElement("td",null,k.default.createElement("div",null,k.default.createElement(O,(0,s.default)({},d,{required:!1,getComponent:i,specPath:h.push("not"),getConfigs:a,schema:j,depth:u+1}))))):null))),k.default.createElement("span",{className:"brace-close"},"}")))}}]),t}(w.Component);O.propTypes={schema:S.default.object.isRequired,getComponent:S.default.func.isRequired,getConfigs:S.default.func.isRequired,expanded:S.default.bool,onToggle:S.default.func,specSelectors:S.default.object.isRequired,name:S.default.string,isRef:S.default.bool,expandDepth:S.default.number,depth:S.default.number,specPath:D.default.list.isRequired},t.default=O},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(47),o=r(i),a=n(48),s=r(a),u=n(4),l=r(u),c=n(2),p=r(c),f=n(3),h=r(f),d=n(6),m=r(d),v=n(5),g=r(v),y=n(0),_=r(y),b=n(1),x=r(b),w=n(9),k=function(e){function t(e,n){(0,p.default)(this,t);var r=(0,m.default)(this,(t.__proto__||(0,l.default)(t)).call(this,e,n)),i=e.specSelectors,o=e.getConfigs,a=o(),s=a.validatorUrl;return r.state={url:i.url(),validatorUrl:void 0===s?"https://online.swagger.io/validator":s},r}return(0,g.default)(t,e),(0,h.default)(t,[{key:"componentWillReceiveProps",value:function(e){var t=e.specSelectors,n=e.getConfigs,r=n(),i=r.validatorUrl;this.setState({url:t.url(),validatorUrl:void 0===i?"https://online.swagger.io/validator":i})}},{key:"render",value:function(){var e=this.props.getConfigs,t=e(),n=t.spec,r=(0,w.sanitizeUrl)(this.state.validatorUrl);return"object"===(void 0===n?"undefined":(0,s.default)(n))&&(0,o.default)(n).length?null:!this.state.url||!this.state.validatorUrl||this.state.url.indexOf("localhost")>=0||this.state.url.indexOf("127.0.0.1")>=0?null:_.default.createElement("span",{style:{float:"right"}},_.default.createElement("a",{target:"_blank",href:r+"/debug?url="+this.state.url},_.default.createElement(E,{src:r+"?url="+this.state.url,alt:"Online validator badge"})))}}]),t}(_.default.Component);k.propTypes={getComponent:x.default.func.isRequired,getConfigs:x.default.func.isRequired,specSelectors:x.default.object.isRequired},t.default=k;var E=function(e){function t(e){(0,p.default)(this,t);var n=(0,m.default)(this,(t.__proto__||(0,l.default)(t)).call(this,e));return n.state={loaded:!1,error:!1},n}return(0,g.default)(t,e),(0,h.default)(t,[{key:"componentDidMount",value:function(){var e=this,t=new Image;t.onload=function(){e.setState({loaded:!0})},t.onerror=function(){e.setState({error:!0})},t.src=this.props.src}},{key:"componentWillReceiveProps",value:function(e){var t=this;if(e.src!==this.props.src){var n=new Image;n.onload=function(){t.setState({loaded:!0})},n.onerror=function(){t.setState({error:!0})},n.src=e.src}}},{key:"render",value:function(){return this.state.error?_.default.createElement("img",{alt:"Error"}):this.state.loaded?_.default.createElement("img",{src:this.props.src,alt:this.props.alt}):_.default.createElement("img",{alt:"Loading..."})}}]),t}(_.default.Component);E.propTypes={src:x.default.string,alt:x.default.string}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.OperationExtRow=void 0;var i=n(35),o=r(i),a=n(0),s=r(a),u=n(1),l=r(u),c=t.OperationExtRow=function(e){var t=e.xKey,n=e.xVal,r=n?n.toJS?n.toJS():n:null;return s.default.createElement("tr",null,s.default.createElement("td",null,t),s.default.createElement("td",null,(0,o.default)(r)))};c.propTypes={xKey:l.default.string,xVal:l.default.any},t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.OperationExt=void 0;var i=n(18),o=r(i),a=n(0),s=r(a),u=n(1),l=r(u),c=t.OperationExt=function(e){var t=e.extensions,n=e.getComponent,r=n("OperationExtRow");return s.default.createElement("div",{className:"opblock-section"},s.default.createElement("div",{className:"opblock-section-header"},s.default.createElement("h4",null,"Extensions")),s.default.createElement("div",{className:"table-container"},s.default.createElement("table",null,s.default.createElement("thead",null,s.default.createElement("tr",null,s.default.createElement("td",{className:"col col_header"},"Field"),s.default.createElement("td",{className:"col col_header"},"Value"))),s.default.createElement("tbody",null,t.entrySeq().map(function(e){var t=(0,o.default)(e,2),n=t[0],i=t[1];return s.default.createElement(r,{key:n+"-"+i,xKey:n,xVal:i})})))))};c.propTypes={extensions:l.default.object.isRequired,getComponent:l.default.func.isRequired},t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(9),_=n(7),b=n(12),x=r(b),w=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.specPath,n=e.response,r=e.request,i=e.toggleShown,o=e.onTryoutClick,a=e.onCancelClick,s=e.onExecute,u=e.fn,l=e.getComponent,c=e.getConfigs,p=e.specActions,f=e.specSelectors,h=e.authActions,d=e.authSelectors,v=e.oas3Actions,g=e.oas3Selectors,_=this.props.operation,b=_.toJS(),x=b.isShown,w=b.isAuthorized,k=b.path,E=b.method,S=b.op,C=b.tag,A=b.showSummary,D=b.operationId,O=b.allowTryItOut,M=b.displayOperationId,T=b.displayRequestDuration,P=b.isDeepLinkingEnabled,I=b.tryItOutEnabled,R=b.executeInProgress,j=S.operation,F=j.summary,N=j.description,B=j.deprecated,L=j.externalDocs,q=j.schemes,z=_.getIn(["op","operation"]),U=_.get("security"),W=z.get("responses"),V=z.get("produces"),H=(0,y.getList)(z,["parameters"]),G=f.operationScheme(k,E),J=["operations",C,D],K=(0,y.getExtensions)(z),X=l("responses"),Y=l("parameters"),$=l("execute"),Z=l("clear"),Q=l("authorizeOperationBtn"),ee=l("JumpToPath",!0),te=l("Collapse"),ne=l("Markdown"),re=l("schemes"),ie=l("OperationServers"),oe=l("OperationExt"),ae=l("DeepLink"),se=c(),ue=se.showExtensions;if(W&&n&&n.size>0){var le=!W.get(String(n.get("status")))&&!W.get("default");n=n.set("notDocumented",le)}var ce=[k,E];return m.default.createElement("div",{className:B?"opblock opblock-deprecated":x?"opblock opblock-"+E+" is-open":"opblock opblock-"+E,id:J.join("-")},m.default.createElement("div",{className:"opblock-summary opblock-summary-"+E,onClick:i},m.default.createElement("span",{className:"opblock-summary-method"},E.toUpperCase()),m.default.createElement("span",{className:B?"opblock-summary-path__deprecated":"opblock-summary-path"},m.default.createElement(ae,{enabled:P,isShown:x,path:""+J.join("/"),text:k}),m.default.createElement(ee,{path:t})," "),A?m.default.createElement("div",{className:"opblock-summary-description"},F):null,M&&D?m.default.createElement("span",{className:"opblock-summary-operation-id"},D):null,U&&U.count()?m.default.createElement(Q,{isAuthorized:w,onClick:function(){var e=d.definitionsForRequirements(U);h.showDefinitions(e)}}):null),m.default.createElement(te,{isOpened:x},m.default.createElement("div",{className:"opblock-body"},B&&m.default.createElement("h4",{className:"opblock-title_normal"}," Warning: Deprecated"),N&&m.default.createElement("div",{className:"opblock-description-wrapper"},m.default.createElement("div",{className:"opblock-description"},m.default.createElement(ne,{source:N}))),L&&L.url?m.default.createElement("div",{className:"opblock-external-docs-wrapper"},m.default.createElement("h4",{className:"opblock-title_normal"},"Find more details"),m.default.createElement("div",{className:"opblock-external-docs"},m.default.createElement("span",{className:"opblock-external-docs__description"},m.default.createElement(ne,{source:L.description})),m.default.createElement("a",{target:"_blank",className:"opblock-external-docs__link",href:(0,y.sanitizeUrl)(L.url)},L.url))):null,m.default.createElement(Y,{parameters:H,specPath:t.push("parameters"),operation:z,onChangeKey:ce,onTryoutClick:o,onCancelClick:a,tryItOutEnabled:I,allowTryItOut:O,fn:u,getComponent:l,specActions:p,specSelectors:f,pathMethod:[k,E],getConfigs:c}),I?m.default.createElement(ie,{getComponent:l,path:k,method:E,operationServers:z.get("servers"),pathServers:f.paths().getIn([k,"servers"]),getSelectedServer:g.selectedServer,setSelectedServer:v.setSelectedServer,setServerVariableValue:v.setServerVariableValue,getServerVariable:g.serverVariableValue,getEffectiveServerValue:g.serverEffectiveValue}):null,I&&O&&q&&q.size?m.default.createElement("div",{className:"opblock-schemes"},m.default.createElement(re,{schemes:q,path:k,method:E,specActions:p,currentScheme:G})):null,m.default.createElement("div",{className:I&&n&&O?"btn-group":"execute-wrapper"},I&&O?m.default.createElement($,{operation:z,specActions:p,specSelectors:f,path:k,method:E,onExecute:s}):null,I&&n&&O?m.default.createElement(Z,{specActions:p,path:k,method:E}):null),R?m.default.createElement("div",{className:"loading-container"},m.default.createElement("div",{className:"loading"})):null,W?m.default.createElement(X,{responses:W,request:r,tryItOutResponse:n,getComponent:l,getConfigs:c,specSelectors:f,oas3Actions:v,specActions:p,produces:V,producesValue:f.currentProducesFor([k,E]),specPath:t.push("responses"),path:k,method:E,displayRequestDuration:T,fn:u}):null,ue&&K.size?m.default.createElement(oe,{extensions:K,getComponent:l}):null)))}}]),t}(d.PureComponent);w.propTypes={specPath:x.default.list.isRequired,operation:g.default.instanceOf(_.Iterable).isRequired,response:g.default.instanceOf(_.Iterable),request:g.default.instanceOf(_.Iterable),toggleShown:g.default.func.isRequired,onTryoutClick:g.default.func.isRequired,onCancelClick:g.default.func.isRequired,onExecute:g.default.func.isRequired,getComponent:g.default.func.isRequired,getConfigs:g.default.func.isRequired,authActions:g.default.object,authSelectors:g.default.object,specActions:g.default.object.isRequired,specSelectors:g.default.object.isRequired,oas3Actions:g.default.object.isRequired,oas3Selectors:g.default.object.isRequired,layoutActions:g.default.object.isRequired,layoutSelectors:g.default.object.isRequired,fn:g.default.object.isRequired},w.defaultProps={operation:null,response:null,request:null,specPath:(0,_.List)()},t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(7),_=r(y),b=n(9),x=["get","put","post","delete","options","head","patch"],w=x.concat(["trace"]),k=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.getComponent,r=e.layoutSelectors,i=e.layoutActions,o=e.getConfigs,a=t.taggedOperations(),s=n("OperationContainer",!0),u=n("Collapse"),l=n("Markdown"),c=n("DeepLink"),p=o(),f=p.docExpansion,h=p.maxDisplayedTags,d=p.deepLinking,v=d&&"false"!==d,g=r.currentFilter();return g&&!0!==g&&(a=a.filter(function(e,t){return-1!==t.indexOf(g)})),h&&!isNaN(h)&&h>=0&&(a=a.slice(0,h)),m.default.createElement("div",null,a.map(function(e,n){var o=e.get("operations"),a=e.getIn(["tagDetails","description"],null),p=e.getIn(["tagDetails","externalDocs","description"]),h=e.getIn(["tagDetails","externalDocs","url"]),d=["operations-tag",(0,b.createDeepLinkPath)(n)],g=r.isShown(d,"full"===f||"list"===f);return m.default.createElement("div",{className:g?"opblock-tag-section is-open":"opblock-tag-section",key:"operation-"+n},m.default.createElement("h4",{onClick:function(){return i.show(d,!g)},className:a?"opblock-tag":"opblock-tag no-desc",id:d.join("-")},m.default.createElement(c,{enabled:v,isShown:g,path:n,text:n}),a?m.default.createElement("small",null,m.default.createElement(l,{source:a})):m.default.createElement("small",null),m.default.createElement("div",null,p?m.default.createElement("small",null,p,h?": ":null,h?m.default.createElement("a",{href:(0,b.sanitizeUrl)(h),onClick:function(e){return e.stopPropagation()},target:"_blank"},h):null):null),m.default.createElement("button",{className:"expand-operation",title:g?"Collapse operation":"Expand operation",onClick:function(){return i.show(d,!g)}},m.default.createElement("svg",{className:"arrow",width:"20",height:"20"},m.default.createElement("use",{href:g?"#large-arrow-down":"#large-arrow",xlinkHref:g?"#large-arrow-down":"#large-arrow"})))),m.default.createElement(u,{isOpened:g},o.map(function(e){var r=e.get("path"),i=e.get("method"),o=_.default.List(["paths",r,i]);return-1===(t.isOAS3()?w:x).indexOf(i)?null:m.default.createElement(s,{key:r+"-"+i,specPath:o,op:e,path:r,method:i,tag:n})}).toArray()))}).toArray(),a.size<1?m.default.createElement("h3",null," No operations defined in spec! "):null)}}]),t}(m.default.Component);k.propTypes={specSelectors:g.default.object.isRequired,specActions:g.default.object.isRequired,oas3Actions:g.default.object.isRequired,getComponent:g.default.func.isRequired,layoutSelectors:g.default.object.isRequired,layoutActions:g.default.object.isRequired,authActions:g.default.object.isRequired,authSelectors:g.default.object.isRequired,getConfigs:g.default.func.isRequired},t.default=k,k.propTypes={layoutActions:g.default.object.isRequired,specSelectors:g.default.object.isRequired,specActions:g.default.object.isRequired,layoutSelectors:g.default.object.isRequired,getComponent:g.default.func.isRequired,fn:g.default.object.isRequired}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.OperationLink=void 0;var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(268),_=function(e){function t(){var e;(0,s.default)(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];var a=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(r)));return a.setTagShown=a._setTagShown.bind(a),a}return(0,h.default)(t,e),(0,l.default)(t,[{key:"_setTagShown",value:function(e,t){this.props.layoutActions.show(e,t)}},{key:"showOp",value:function(e,t){this.props.layoutActions.show(e,t)}},{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.layoutSelectors,r=e.layoutActions,i=e.getComponent,o=t.taggedOperations(),a=i("Collapse");return m.default.createElement("div",null,m.default.createElement("h4",{className:"overview-title"},"Overview"),o.map(function(e,t){var i=e.get("operations"),o=["overview-tags",t],s=n.isShown(o,!0),u=function(){return r.show(o,!s)};return m.default.createElement("div",{key:"overview-"+t},m.default.createElement("h4",{onClick:u,className:"link overview-tag"}," ",s?"-":"+",t),m.default.createElement(a,{isOpened:s,animated:!0},i.map(function(e){var t=e.toObject(),i=t.path,o=t.method,a=t.id,s=a,u=n.isShown(["operations",s]);return m.default.createElement(b,{key:a,path:i,method:o,id:i+"-"+o,shown:u,showOpId:s,showOpIdPrefix:"operations",href:"#operation-"+s,onClick:r.show})}).toArray()))}).toArray(),o.size<1&&m.default.createElement("h3",null," No operations defined in spec! "))}}]),t}(m.default.Component);t.default=_,_.propTypes={layoutSelectors:g.default.object.isRequired,specSelectors:g.default.object.isRequired,layoutActions:g.default.object.isRequired,getComponent:g.default.func.isRequired};var b=t.OperationLink=function(e){function t(e){(0,s.default)(this,t);var n=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e));return n.onClick=n._onClick.bind(n),n}return(0,h.default)(t,e),(0,l.default)(t,[{key:"_onClick",value:function(){var e=this.props,t=e.showOpId,n=e.showOpIdPrefix;(0,e.onClick)([n,t],!e.shown)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.method,r=e.shown,i=e.href;return m.default.createElement(y.Link,{href:i,style:{fontWeight:r?"bold":"normal"},onClick:this.onClick,className:"block opblock-link"},m.default.createElement("div",null,m.default.createElement("small",{className:"bold-label-"+n},n.toUpperCase()),m.default.createElement("span",{className:"bold-label"},t)))}}]),t}(m.default.Component);b.propTypes={href:g.default.string,onClick:g.default.func,id:g.default.string.isRequired,method:g.default.string.isRequired,shown:g.default.bool.isRequired,showOpId:g.default.string.isRequired,showOpIdPrefix:g.default.string.isRequired}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(7),_=n(9),b=Function.prototype,x=function(e){function t(e,n){(0,s.default)(this,t);var r=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));return w.call(r),r.state={isEditBox:!1,value:""},r}return(0,h.default)(t,e),(0,l.default)(t,[{key:"componentDidMount",value:function(){this.updateValues.call(this,this.props)}},{key:"componentWillReceiveProps",value:function(e){this.updateValues.call(this,e)}},{key:"render",value:function(){var e=this.props,n=e.onChangeConsumes,r=e.param,i=e.isExecute,o=e.specSelectors,a=e.pathMethod,s=e.getComponent,u=s("Button"),l=s("TextArea"),c=s("highlightCode"),p=s("contentType"),f=o?o.getParameter(a,r.get("name"),r.get("in")):r,h=f.get("errors",(0,y.List)()),d=o.contentTypeValues(a).get("requestContentType"),v=this.props.consumes&&this.props.consumes.size?this.props.consumes:t.defaultProp.consumes,g=this.state,_=g.value,b=g.isEditBox;return m.default.createElement("div",{className:"body-param"},b&&i?m.default.createElement(l,{className:"body-param__text"+(h.count()?" invalid":""),value:_,onChange:this.handleOnChange}):_&&m.default.createElement(c,{className:"body-param__example",value:_}),m.default.createElement("div",{className:"body-param-options"},i?m.default.createElement("div",{className:"body-param-edit"},m.default.createElement(u,{className:b?"btn cancel body-param__example-edit":"btn edit body-param__example-edit",onClick:this.toggleIsEditBox},b?"Cancel":"Edit")):null,m.default.createElement("label",{htmlFor:""},m.default.createElement("span",null,"Parameter content type"),m.default.createElement(p,{value:d,contentTypes:v,onChange:n,className:"body-param-content-type"}))))}}]),t}(d.PureComponent);x.propTypes={param:g.default.object,onChange:g.default.func,onChangeConsumes:g.default.func,consumes:g.default.object,consumesValue:g.default.string,fn:g.default.object.isRequired,getComponent:g.default.func.isRequired,isExecute:g.default.bool,specSelectors:g.default.object.isRequired,pathMethod:g.default.array.isRequired},x.defaultProp={consumes:(0,y.fromJS)(["application/json"]),param:(0,y.fromJS)({}),onChange:b,onChangeConsumes:b};var w=function(){var e=this;this.updateValues=function(t){var n=t.specSelectors,r=t.pathMethod,i=t.param,o=t.isExecute,a=t.consumesValue,s=void 0===a?"":a,u=n?n.getParameter(r,i.get("name"),i.get("in")):(0,y.fromJS)({}),l=/xml/i.test(s),c=/json/i.test(s),p=l?u.get("value_xml"):u.get("value");if(void 0!==p){var f=!p&&c?"{}":p;e.setState({value:f}),e.onChange(f,{isXml:l,isEditBox:o})}else l?e.onChange(e.sample("xml"),{isXml:l,isEditBox:o}):e.onChange(e.sample(),{isEditBox:o})},this.sample=function(t){var n=e.props,r=n.param,i=n.fn.inferSchema,o=i(r.toJS());return(0,_.getSampleSchema)(o,t,{includeWriteOnly:!0})},this.onChange=function(t,n){var r=n.isEditBox,i=n.isXml;e.setState({value:t,isEditBox:r}),e._onChange(t,i)},this._onChange=function(t,n){(e.props.onChange||b)(e.props.param,t,n)},this.handleOnChange=function(t){var n=e.props.consumesValue,r=/json/i.test(n),i=/xml/i.test(n),o=r?t.target.value.trim():t.target.value;e.onChange(o,{isXml:i})},this.toggleIsEditBox=function(){return e.setState(function(e){return{isEditBox:!e.isEditBox}})}};t.default=x},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ParameterExt=void 0;var i=n(0),o=r(i),a=n(1),s=r(a),u=t.ParameterExt=function(e){var t=e.xKey,n=e.xVal;return o.default.createElement("div",{className:"parameter__extension"},t,": ",String(n))};u.propTypes={xKey:s.default.string,xVal:s.default.any},t.default=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(7),g=n(1),y=r(g),_=n(12),b=r(_),x=n(46),w=r(x),k=n(9),E=function(e){function t(e,n){(0,s.default)(this,t);var r=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));S.call(r);var i=e.specSelectors,a=e.pathMethod,u=e.param,l=u.get("default"),c=i.getParameter(a,u.get("name"),u.get("in")),f=c?c.get("value"):"";return void 0!==l&&void 0===f&&r.onChangeWrapper(l),r}return(0,h.default)(t,e),(0,l.default)(t,[{key:"componentWillReceiveProps",value:function(e){var t=e.specSelectors,n=e.pathMethod,r=e.param,i=t.isOAS3,o=r.get("example"),a=r.get("default"),s=t.getParameter(n,r.get("name"),r.get("in")),u=void 0;if(i()){u=(r.get("schema")||(0,v.Map)()).get("enum")}else u=s?s.get("enum"):void 0;var l=s?s.get("value"):void 0,c=void 0;void 0!==l?c=l:void 0!==o?c=o:void 0!==a?c=a:r.get("required")&&u&&u.size&&(c=u.first()),void 0!==c&&this.onChangeWrapper(c)}},{key:"render",value:function(){var e=this.props,t=e.param,n=e.onChange,r=e.getComponent,i=e.getConfigs,o=e.isExecute,a=e.fn,s=e.onChangeConsumes,u=e.specSelectors,l=e.pathMethod,c=e.specPath,p=u.isOAS3,f=i(),h=f.showExtensions,d=r("JsonSchemaForm"),v=r("ParamBody"),g=t.get("in"),y="body"!==g?null:m.default.createElement(v,{getComponent:r,fn:a,param:t,consumes:u.operationConsumes(l),consumesValue:u.contentTypeValues(l).get("requestContentType"),onChange:n,onChangeConsumes:s,isExecute:o,specSelectors:u,pathMethod:l}),_=r("modelExample"),b=r("Markdown"),x=r("ParameterExt"),E=t.get("schema"),S=p&&p()?t.getIn(["schema","type"]):t.get("type"),C="formData"===g,A="FormData"in w.default,D=t.get("required"),O=t.getIn(p&&p()?["schema","items","type"]:["items","type"]),M=u.getParameter(l,t.get("name"),t.get("in")),T=M?M.get("value"):"",P=(0,k.getExtensions)(t),I=void 0,R=void 0,j=!1;void 0!==t&&(I=t.get("items")),void 0!==I&&(R=t.get("items").get("enum")),void 0!==R&&R.size>0&&(j=!0);var F=void 0,N=void 0;return void 0!==t&&(F=t.get("default"),N=t.get("example")),j&&(F=I.get("default")),m.default.createElement("tr",null,m.default.createElement("td",{className:"col parameters-col_name"},m.default.createElement("div",{className:D?"parameter__name required":"parameter__name"},t.get("name"),D?m.default.createElement("span",{style:{color:"red"}}," *"):null),m.default.createElement("div",{className:"parameter__type"},S," ",O&&"["+O+"]"),m.default.createElement("div",{className:"parameter__deprecated"},p&&p()&&t.get("deprecated")?"deprecated":null),m.default.createElement("div",{className:"parameter__in"},"(",t.get("in"),")"),h&&P.size?P.map(function(e,t){return m.default.createElement(x,{key:t+"-"+e,xKey:t,xVal:e})}):null),m.default.createElement("td",{className:"col parameters-col_description"},m.default.createElement(b,{source:t.get("description")}),!y&&o||!j?null:m.default.createElement(b,{source:"<i>Available values</i>: "+R.map(function(e){return e}).toArray().join(", ")}),!y&&o||void 0===F?null:m.default.createElement(b,{source:"<i>Default value</i>: "+F}),!y&&o||void 0===N?null:m.default.createElement(b,{source:"<i>Example</i>: "+N}),C&&!A&&m.default.createElement("div",null,"Error: your browser does not support FormData"),y||!o?null:m.default.createElement(d,{fn:a,getComponent:r,value:T,required:D,description:t.get("description")?t.get("name")+" - "+t.get("description"):""+t.get("name"),onChange:this.onChangeWrapper,errors:t.get("errors"),schema:p&&p()?t.get("schema"):t}),y&&E?m.default.createElement(_,{getComponent:r,specPath:c.push("schema"),getConfigs:i,isExecute:o,specSelectors:u,schema:E,example:y}):null))}}]),t}(d.Component);E.propTypes={onChange:y.default.func.isRequired,param:y.default.object.isRequired,getComponent:y.default.func.isRequired,fn:y.default.object.isRequired,isExecute:y.default.bool,onChangeConsumes:y.default.func.isRequired,specSelectors:y.default.object.isRequired,pathMethod:y.default.array.isRequired,getConfigs:y.default.func.isRequired,specPath:b.default.list.isRequired};var S=function(){var e=this;this.onChangeWrapper=function(t){var n=e.props;return(0,n.onChange)(n.param,t)}};t.default=E},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(12),_=r(y),b=n(7),x=r(b),w=function(e,t){return e.valueSeq().filter(x.default.Map.isMap).map(t)},k=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.onChange=function(e,t,n){var i=r.props;(0,i.specActions.changeParam)(i.onChangeKey,e.get("name"),e.get("in"),t,n)},r.onChangeConsumesWrapper=function(e){var t=r.props;(0,t.specActions.changeConsumesValue)(t.onChangeKey,e)},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.onTryoutClick,r=t.onCancelClick,i=t.parameters,o=t.allowTryItOut,a=t.tryItOutEnabled,s=t.specPath,u=t.fn,l=t.getComponent,c=t.getConfigs,p=t.specSelectors,f=t.pathMethod,h=l("parameterRow"),d=l("TryItOutButton"),v=a&&o;return m.default.createElement("div",{className:"opblock-section"},m.default.createElement("div",{className:"opblock-section-header"},m.default.createElement("div",{className:"tab-header"},m.default.createElement("h4",{className:"opblock-title"},"Parameters")),o?m.default.createElement(d,{enabled:a,onCancelClick:r,onTryoutClick:n}):null),i.count()?m.default.createElement("div",{className:"table-container"},m.default.createElement("table",{className:"parameters"},m.default.createElement("thead",null,m.default.createElement("tr",null,m.default.createElement("th",{className:"col col_header parameters-col_name"},"Name"),m.default.createElement("th",{className:"col col_header parameters-col_description"},"Description"))),m.default.createElement("tbody",null,w(i,function(t,n){return m.default.createElement(h,{fn:u,specPath:s.push(n.toString()),getComponent:l,getConfigs:c,param:t,key:t.get("in")+"."+t.get("name"),onChange:e.onChange,onChangeConsumes:e.onChangeConsumesWrapper,specSelectors:p,pathMethod:f,isExecute:v})}).toArray()))):m.default.createElement("div",{className:"opblock-description-wrapper"},m.default.createElement("p",null,"No parameters")))}}]),t}(d.Component);k.propTypes={parameters:_.default.list.isRequired,specActions:g.default.object.isRequired,getComponent:g.default.func.isRequired,specSelectors:g.default.object.isRequired,fn:g.default.object.isRequired,tryItOutEnabled:g.default.bool,allowTryItOut:g.default.bool,onTryoutClick:g.default.func,onCancelClick:g.default.func,onChangeKey:g.default.array,pathMethod:g.default.array.isRequired,getConfigs:g.default.func.isRequired,specPath:_.default.list.isRequired},k.defaultProps={onTryoutClick:Function.prototype,onCancelClick:Function.prototype,tryItOutEnabled:!1,allowTryItOut:!0,onChangeKey:[],specPath:[]},t.default=k},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=n(9),x={color:"#6b6b6b",fontStyle:"italic"},w=function(e){function t(){return(0,l.default)(this,t),(0,h.default)(this,(t.__proto__||(0,s.default)(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.getConfigs,i=e.name,a=e.depth,s=r(),u=s.showExtensions;if(!t||!t.get)return g.default.createElement("div",null);var l=t.get("type"),c=t.get("format"),p=t.get("xml"),f=t.get("enum"),h=t.get("title")||i,d=t.get("description"),m=(0,b.getExtensions)(t),v=t.filter(function(e,t){return-1===["enum","type","format","description","$$ref"].indexOf(t)}).filterNot(function(e,t){return m.has(t)}),y=n("Markdown"),_=n("EnumModel"),w=n("Property");return g.default.createElement("span",{className:"model"},g.default.createElement("span",{className:"prop"},i&&g.default.createElement("span",{className:(1===a&&"model-title")+" prop-name"},h),g.default.createElement("span",{className:"prop-type"},l),c&&g.default.createElement("span",{className:"prop-format"},"($",c,")"),v.size?v.entrySeq().map(function(e){var t=(0,o.default)(e,2),n=t[0],r=t[1];return g.default.createElement(w,{key:n+"-"+r,propKey:n,propVal:r,propStyle:x})}):null,u&&m.size?m.entrySeq().map(function(e){var t=(0,o.default)(e,2),n=t[0],r=t[1];return g.default.createElement(w,{key:n+"-"+r,propKey:n,propVal:r,propStyle:x})}):null,d?g.default.createElement(y,{source:d}):null,p&&p.size?g.default.createElement("span",null,g.default.createElement("br",null),g.default.createElement("span",{style:x},"xml:"),p.entrySeq().map(function(e){var t=(0,o.default)(e,2),n=t[0],r=t[1];return g.default.createElement("span",{key:n+"-"+r,style:x},g.default.createElement("br",null),"   ",n,": ",String(r))}).toArray()):null,f&&g.default.createElement(_,{value:f,getComponent:n})))}}]),t}(v.Component);w.propTypes={schema:_.default.object.isRequired,getComponent:_.default.func.isRequired,getConfigs:_.default.func.isRequired,name:_.default.string,depth:_.default.number},t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Property=void 0;var i=n(0),o=r(i),a=n(1),s=r(a),u=t.Property=function(e){var t=e.propKey,n=e.propVal,r=e.propStyle;return o.default.createElement("span",{style:r},o.default.createElement("br",null),t,": ",String(n))};u.propTypes={propKey:s.default.string,propVal:s.default.any,propStyle:s.default.object},t.default=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(35),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=n(1196),x=r(b),w=n(948),k=r(w),E=n(9),S=function(e){function t(){return(0,l.default)(this,t),(0,h.default)(this,(t.__proto__||(0,s.default)(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.content,n=e.contentType,r=e.url,i=e.headers,a=void 0===i?{}:i,s=e.getComponent,u=s("highlightCode"),l=void 0,c=void 0;if(r=r||"",/^application\/octet-stream/i.test(n)||a["Content-Disposition"]&&/attachment/i.test(a["Content-Disposition"])||a["content-disposition"]&&/attachment/i.test(a["content-disposition"])||a["Content-Description"]&&/File Transfer/i.test(a["Content-Description"])||a["content-description"]&&/File Transfer/i.test(a["content-description"])){if(!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&"Blob"in window){var p=n||"text/html",f=t instanceof Blob?t:new Blob([t],{type:p}),h=window.URL.createObjectURL(f),d=r.substr(r.lastIndexOf("/")+1),m=[p,d,h].join(":"),v=a["content-disposition"]||a["Content-Disposition"];if(void 0!==v){var y=(0,E.extractFileNameFromContentDispositionHeader)(v);null!==y&&(m=y)}c=g.default.createElement("div",null,g.default.createElement("a",{href:h,download:m},"Download file"))}else c=g.default.createElement("pre",null,"Download headers detected but your browser does not support downloading binary via XHR (Blob).")}else if(/json/i.test(n)){try{l=(0,o.default)(JSON.parse(t),null," ")}catch(e){l="can't parse JSON. Raw result:\n\n"+t}c=g.default.createElement(u,{value:l})}else/xml/i.test(n)?(l=(0,x.default)(t,{textNodesOnSameLine:!0,indentor:" "}),c=g.default.createElement(u,{value:l})):c="text/html"===(0,k.default)(n)||/text\/plain/.test(n)?g.default.createElement(u,{value:t}):/^image\//i.test(n)?n.includes("svg")?g.default.createElement("div",null," ",t," "):g.default.createElement("img",{style:{maxWidth:"100%"},src:window.URL.createObjectURL(t)}):/^audio\//i.test(n)?g.default.createElement("pre",null,g.default.createElement("audio",{controls:!0},g.default.createElement("source",{src:r,type:n}))):"string"==typeof t?g.default.createElement(u,{value:t}):t.size>0?g.default.createElement("div",null,"Unknown response type"):null;return c?g.default.createElement("div",null,g.default.createElement("h5",null,"Response body"),c):null}}]),t}(g.default.Component);S.propTypes={content:_.default.any.isRequired,contentType:_.default.string,getComponent:_.default.func.isRequired,headers:_.default.object,url:_.default.string},t.default=S},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(35),m=r(d),v=n(18),g=r(v),y=n(0),_=r(y),b=n(1),x=r(b),w=n(12),k=r(w),E=n(573),S=r(E),C=n(7),A=n(9),D=function(e,t,n){return t&&t.size?t.entrySeq().map(function(e){var t=(0,g.default)(e,2),r=t[0],i=t[1],o=i;if(i.toJS)try{o=(0,m.default)(i.toJS(),null,2)}catch(e){o=String(i)}return _.default.createElement("div",{key:r},_.default.createElement("h5",null,r),_.default.createElement(n,{className:"example",value:o}))}).toArray():e?_.default.createElement("div",null,_.default.createElement(n,{className:"example",value:e})):null},O=function(e){function t(e,n){(0,s.default)(this,t);var r=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));return r._onContentTypeChange=function(e){var t=r.props,n=t.onContentTypeChange,i=t.controlsAcceptHeader;r.setState({responseContentType:e}),n({value:e,controlsAcceptHeader:i})},r.state={responseContentType:""},r}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e,t,n,r=this.props,i=r.code,o=r.response,a=r.className,s=r.specPath,u=r.fn,l=r.getComponent,c=r.getConfigs,p=r.specSelectors,f=r.contentType,h=r.controlsAcceptHeader,d=u.inferSchema,m=p.isOAS3,v=o.get("headers"),g=o.get("examples"),y=o.get("links"),b=l("headers"),x=l("highlightCode"),w=l("modelExample"),k=l("Markdown"),E=l("operationLink"),O=l("contentType");if(m()){var M=(0,C.List)(["content",this.state.responseContentType,"schema"]),T=o.getIn(M);e=T?(0,A.getSampleSchema)(T.toJS(),this.state.responseContentType,{includeReadOnly:!0}):null,t=T?d(T.toJS()):null,n=T?M:s}else t=d(o.toJS()),n=o.has("schema")?s.push("schema"):s,e=t?(0,A.getSampleSchema)(t,f,{includeReadOnly:!0,includeWriteOnly:!0}):null;g&&(g=g.map(function(e){return e.set?e.set("$$ref",void 0):e}));var P=D(e,g,x);return _.default.createElement("tr",{className:"response "+(a||"")},_.default.createElement("td",{className:"col response-col_status"},i),_.default.createElement("td",{className:"col response-col_description"},_.default.createElement("div",{className:"response-col_description__inner"},_.default.createElement(k,{source:o.get("description")})),m?_.default.createElement("div",{className:(0,S.default)("response-content-type",{"controls-accept-header":h})},_.default.createElement(O,{value:this.state.responseContentType,contentTypes:o.get("content")?o.get("content").keySeq():(0,C.Seq)(),onChange:this._onContentTypeChange}),h?_.default.createElement("small",null,"Controls ",_.default.createElement("code",null,"Accept")," header."):null):null,P?_.default.createElement(w,{specPath:n,getComponent:l,getConfigs:c,specSelectors:p,schema:(0,A.fromJSOrdered)(t),example:P}):null,v?_.default.createElement(b,{headers:v,getComponent:l}):null),p.isOAS3()?_.default.createElement("td",{className:"col response-col_links"},y?y.toSeq().map(function(e,t){return _.default.createElement(E,{key:t,name:t,link:e,getComponent:l})}):_.default.createElement("i",null,"No links")):null)}}]),t}(_.default.Component);O.propTypes={code:x.default.string.isRequired,response:x.default.instanceOf(C.Iterable),className:x.default.string,getComponent:x.default.func.isRequired,getConfigs:x.default.func.isRequired,specSelectors:x.default.object.isRequired,specPath:k.default.list.isRequired,fn:x.default.object.isRequired,contentType:x.default.string,controlsAcceptHeader:x.default.bool,onContentTypeChange:x.default.func},O.defaultProps={response:(0,C.fromJS)({}),onContentTypeChange:function(){}},t.default=O},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(7),_=n(1),b=r(_),x=n(12),w=r(x),k=n(9),E=function(e){function t(){var e,n,r,i;(0,l.default)(this,t);for(var o=arguments.length,a=Array(o),u=0;u<o;u++)a[u]=arguments[u];return n=r=(0,h.default)(this,(e=t.__proto__||(0,s.default)(t)).call.apply(e,[this].concat(a))),r.onChangeProducesWrapper=function(e){return r.props.specActions.changeProducesValue([r.props.path,r.props.method],e)},r.onResponseContentTypeChange=function(e){var t=e.controlsAcceptHeader,n=e.value,i=r.props,o=i.oas3Actions,a=i.path,s=i.method;t&&o.setResponseContentType({value:n,path:a,method:s})},i=n,(0,h.default)(r,i)}return(0,m.default)(t,e),(0,p.default)(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.tryItOutResponse!==e.tryItOutResponse||this.props.responses!==e.responses||this.props.produces!==e.produces||this.props.producesValue!==e.producesValue||this.props.displayRequestDuration!==e.displayRequestDuration||this.props.path!==e.path||this.props.method!==e.method}},{key:"render",value:function(){var e=this,n=this.props,r=n.responses,i=n.tryItOutResponse,a=n.getComponent,s=n.getConfigs,u=n.specSelectors,l=n.fn,c=n.producesValue,p=n.displayRequestDuration,f=n.specPath,h=(0,k.defaultStatusCode)(r),d=a("contentType"),m=a("liveResponse"),v=a("response"),y=this.props.produces&&this.props.produces.size?this.props.produces:t.defaultProps.produces,_=u.isOAS3(),b=_?(0,k.getAcceptControllingResponse)(r):null;return g.default.createElement("div",{className:"responses-wrapper"},g.default.createElement("div",{className:"opblock-section-header"},g.default.createElement("h4",null,"Responses"),u.isOAS3()?null:g.default.createElement("label",null,g.default.createElement("span",null,"Response content type"),g.default.createElement(d,{value:c,onChange:this.onChangeProducesWrapper,contentTypes:y,className:"execute-content-type"}))),g.default.createElement("div",{className:"responses-inner"},i?g.default.createElement("div",null,g.default.createElement(m,{response:i,getComponent:a,getConfigs:s,specSelectors:u,path:this.props.path,method:this.props.method,displayRequestDuration:p}),g.default.createElement("h4",null,"Responses")):null,g.default.createElement("table",{className:"responses-table"},g.default.createElement("thead",null,g.default.createElement("tr",{className:"responses-header"},g.default.createElement("td",{className:"col col_header response-col_status"},"Code"),g.default.createElement("td",{className:"col col_header response-col_description"},"Description"),u.isOAS3()?g.default.createElement("td",{className:"col col_header response-col_links"},"Links"):null)),g.default.createElement("tbody",null,r.entrySeq().map(function(t){var n=(0,o.default)(t,2),r=n[0],p=n[1],d=i&&i.get("status")==r?"response_current":"";return g.default.createElement(v,{key:r,specPath:f.push(r),isDefault:h===r,fn:l,className:d,code:r,response:p,specSelectors:u,controlsAcceptHeader:p===b,onContentTypeChange:e.onResponseContentTypeChange,contentType:c,getConfigs:s,getComponent:a})}).toArray()))))}}]),t}(g.default.Component);E.propTypes={tryItOutResponse:b.default.instanceOf(y.Iterable),responses:b.default.instanceOf(y.Iterable).isRequired,produces:b.default.instanceOf(y.Iterable),producesValue:b.default.any,displayRequestDuration:b.default.bool.isRequired,path:b.default.string.isRequired,method:b.default.string.isRequired,getComponent:b.default.func.isRequired,getConfigs:b.default.func.isRequired,specSelectors:b.default.object.isRequired,specActions:b.default.object.isRequired,oas3Actions:b.default.object.isRequired,specPath:w.default.list.isRequired,fn:b.default.object.isRequired},E.defaultProps={tryItOutResponse:null,produces:(0,y.fromJS)(["application/json"]),displayRequestDuration:!1},t.default=E},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.onChange=function(e){r.setScheme(e.target.value)},r.setScheme=function(e){var t=r.props,n=t.path,i=t.method;t.specActions.setScheme(e,n,i)},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"componentWillMount",value:function(){var e=this.props.schemes;this.setScheme(e.first())}},{key:"componentWillReceiveProps",value:function(e){this.props.currentScheme&&e.schemes.includes(this.props.currentScheme)||this.setScheme(e.schemes.first())}},{key:"render",value:function(){var e=this.props.schemes;return m.default.createElement("label",{htmlFor:"schemes"},m.default.createElement("span",{className:"schemes-title"},"Schemes"),m.default.createElement("select",{onChange:this.onChange},e.valueSeq().map(function(e){return m.default.createElement("option",{value:e,key:e},e)}).toArray()))}}]),t}(m.default.Component);y.propTypes={specActions:g.default.object.isRequired,schemes:g.default.object.isRequired,currentScheme:g.default.string.isRequired,path:g.default.string,method:g.default.string},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.onTryoutClick,n=e.onCancelClick,r=e.enabled;return m.default.createElement("div",{className:"try-out"},r?m.default.createElement("button",{className:"btn try-out__btn cancel",onClick:t},"Cancel"):m.default.createElement("button",{className:"btn try-out__btn",onClick:n},"Try it out "))}}]),t}(m.default.Component);y.propTypes={onTryoutClick:g.default.func,onCancelClick:g.default.func,enabled:g.default.bool},y.defaultProps={onTryoutClick:Function.prototype,onCancelClick:Function.prototype,enabled:!1},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=r(i),a=n(1),s=r(a),u=function(e){var t=e.version;return o.default.createElement("small",null,o.default.createElement("pre",{className:"version"}," ",t," "))};u.propTypes={version:s.default.string.isRequired},t.default=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(12),_=r(y),b=n(495),x=n(7),w=b.helpers.opId,k=function(e){function t(e,n){(0,s.default)(this,t);var r=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));return r.toggleShown=function(){var e=r.props,t=e.layoutActions,n=e.tag,i=e.operationId,o=e.isShown;t.show(["operations",n,i],!o)},r.onTryoutClick=function(){r.setState({tryItOutEnabled:!r.state.tryItOutEnabled})},r.onCancelClick=function(){var e=r.props,t=e.specActions,n=e.path,i=e.method;r.setState({tryItOutEnabled:!r.state.tryItOutEnabled}),t.clearValidateParams([n,i])},r.onExecute=function(){r.setState({executeInProgress:!0})},r.state={tryItOutEnabled:!1,executeInProgress:!1},r}return(0,h.default)(t,e),(0,l.default)(t,[{key:"mapStateToProps",value:function(e,t){var n=t.op,r=t.layoutSelectors,i=t.getConfigs,o=i(),a=o.docExpansion,s=o.deepLinking,u=o.displayOperationId,l=o.displayRequestDuration,c=o.supportedSubmitMethods,p=r.showSummary(),f=n.getIn(["operation","operationId"])||n.getIn(["operation","__originalOperationId"])||w(n.get("operation"),t.path,t.method)||n.get("id"),h=["operations",t.tag,f],d=s&&"false"!==s,m=c.indexOf(t.method)>=0&&(void 0===t.allowTryItOut?t.specSelectors.allowTryItOutFor(t.path,t.method):t.allowTryItOut),v=n.getIn(["operation","security"])||t.specSelectors.security();return{operationId:f,isDeepLinkingEnabled:d,showSummary:p,displayOperationId:u,displayRequestDuration:l,allowTryItOut:m,security:v,isAuthorized:t.authSelectors.isAuthorized(v),isShown:r.isShown(h,"full"===a),jumpToKey:"paths."+t.path+"."+t.method,response:t.specSelectors.responseFor(t.path,t.method),request:t.specSelectors.requestFor(t.path,t.method)}}},{key:"componentWillReceiveProps",value:function(e){e.response!==this.props.response&&this.setState({executeInProgress:!1})}},{key:"render",value:function(){var e=this.props,t=e.op,n=e.tag,r=e.path,i=e.method,o=e.security,a=e.isAuthorized,s=e.operationId,u=e.showSummary,l=e.isShown,c=e.jumpToKey,p=e.allowTryItOut,f=e.response,h=e.request,d=e.displayOperationId,v=e.displayRequestDuration,g=e.isDeepLinkingEnabled,y=e.specPath,_=e.specSelectors,b=e.specActions,w=e.getComponent,k=e.getConfigs,E=e.layoutSelectors,S=e.layoutActions,C=e.authActions,A=e.authSelectors,D=e.oas3Actions,O=e.oas3Selectors,M=e.fn,T=w("operation"),P=(0,x.fromJS)({op:t,tag:n,path:r,method:i,security:o,isAuthorized:a,operationId:s,showSummary:u,isShown:l,jumpToKey:c,allowTryItOut:p,request:h,displayOperationId:d,displayRequestDuration:v,isDeepLinkingEnabled:g,executeInProgress:this.state.executeInProgress,tryItOutEnabled:this.state.tryItOutEnabled});return m.default.createElement(T,{operation:P,response:f,request:h,isShown:l,toggleShown:this.toggleShown,onTryoutClick:this.onTryoutClick,onCancelClick:this.onCancelClick,onExecute:this.onExecute,specPath:y,specActions:b,specSelectors:_,oas3Actions:D,oas3Selectors:O,layoutActions:S,layoutSelectors:E,authActions:C,authSelectors:A,getComponent:w,getConfigs:k,fn:M})}}]),t}(d.PureComponent);k.propTypes={op:g.default.instanceOf(x.Iterable).isRequired,tag:g.default.string.isRequired,path:g.default.string.isRequired,method:g.default.string.isRequired,operationId:g.default.string.isRequired,showSummary:g.default.bool.isRequired,isShown:g.default.bool.isRequired,jumpToKey:g.default.string.isRequired,allowTryItOut:g.default.bool,displayOperationId:g.default.bool,isAuthorized:g.default.bool,displayRequestDuration:g.default.bool,response:g.default.instanceOf(x.Iterable),request:g.default.instanceOf(x.Iterable),security:g.default.instanceOf(x.Iterable),isDeepLinkingEnabled:g.default.bool.isRequired,specPath:_.default.list.isRequired,getComponent:g.default.func.isRequired,authActions:g.default.object,oas3Actions:g.default.object,oas3Selectors:g.default.object,authSelectors:g.default.object,specActions:g.default.object.isRequired,specSelectors:g.default.object.isRequired,layoutActions:g.default.object.isRequired,layoutSelectors:g.default.object.isRequired,fn:g.default.object.isRequired,getConfigs:g.default.func.isRequired},k.defaultProps={showSummary:!0,response:null,allowTryItOut:!0,displayOperationId:!1,displayRequestDuration:!1},t.default=k},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=[],n="",r=e.get("headers");if(t.push("curl"),t.push("-X",e.get("method")),t.push('"'+e.get("url")+'"'),r&&r.size){var i=!0,o=!1,s=void 0;try{for(var l,p=(0,c.default)(e.get("headers").entries());!(i=(l=p.next()).done);i=!0){var h=l.value,d=(0,u.default)(h,2),m=d[0],v=d[1];n=v,t.push("-H "),t.push('"'+m+": "+v+'"')}}catch(e){o=!0,s=e}finally{try{!i&&p.return&&p.return()}finally{if(o)throw s}}}if(e.get("body"))if("multipart/form-data"===n&&"POST"===e.get("method")){var g=!0,y=!1,_=void 0;try{for(var b,x=(0,c.default)(e.get("body").entrySeq());!(g=(b=x.next()).done);g=!0){var w=(0,u.default)(b.value,2),k=w[0],v=w[1];t.push("-F"),v instanceof f.default.File?t.push('"'+k+"=@"+v.name+";type="+v.type+'"'):t.push('"'+k+"="+v+'"')}}catch(e){y=!0,_=e}finally{try{!g&&x.return&&x.return()}finally{if(y)throw _}}}else t.push("-d"),t.push((0,a.default)(e.get("body")).replace(/\\n/g,""));return t.join(" ")}Object.defineProperty(t,"__esModule",{value:!0});var o=n(35),a=r(o),s=n(18),u=r(s),l=n(95),c=r(l);t.default=i;var p=n(46),f=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.JsonSchema_boolean=t.JsonSchema_array=t.JsonSchema_string=t.JsonSchemaForm=void 0;var i=n(30),o=r(i),a=n(21),s=r(a),u=n(4),l=r(u),c=n(2),p=r(c),f=n(3),h=r(f),d=n(6),m=r(d),v=n(5),g=r(v),y=n(0),_=r(y),b=n(1),x=r(b),w=n(7),k=n(12),E=r(k),S=function(){},C={getComponent:x.default.func.isRequired,value:x.default.any,onChange:x.default.func,keyName:x.default.any,fn:x.default.object.isRequired,schema:x.default.object,errors:E.default.list,required:x.default.bool,description:x.default.any},A={value:"",onChange:S,schema:{},keyName:"",required:!1,errors:(0,w.List)()},D=t.JsonSchemaForm=function(e){function t(){return(0,p.default)(this,t),(0,m.default)(this,(t.__proto__||(0,l.default)(t)).apply(this,arguments))}return(0,g.default)(t,e),(0,h.default)(t,[{key:"render",value:function(){var e=this.props,t=e.schema,n=e.errors,r=e.value,i=e.onChange,o=e.getComponent,a=e.fn;t.toJS&&(t=t.toJS());var u=t,l=u.type,c=u.format,p=void 0===c?"":c,f=o(p?"JsonSchema_"+l+"_"+p:"JsonSchema_"+l)||o("JsonSchema_string");return _.default.createElement(f,(0,s.default)({},this.props,{errors:n,fn:a,getComponent:o,value:r,onChange:i,schema:t}))}}]),t}(y.Component);D.propTypes=C,D.defaultProps=A;var O=t.JsonSchema_string=function(e){function t(){var e,n,r,i;(0,p.default)(this,t);for(var o=arguments.length,a=Array(o),s=0;s<o;s++)a[s]=arguments[s];return n=r=(0,m.default)(this,(e=t.__proto__||(0,l.default)(t)).call.apply(e,[this].concat(a))),r.onChange=function(e){var t="file"===r.props.schema.type?e.target.files[0]:e.target.value;r.props.onChange(t,r.props.keyName)},r.onEnumChange=function(e){return r.props.onChange(e)},i=n,(0,m.default)(r,i)}return(0,g.default)(t,e),(0,h.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.value,r=e.schema,i=e.errors,o=e.required,a=e.description,s=r.enum;if(i=i.toJS?i.toJS():[],s){var u=t("Select");return _.default.createElement(u,{className:i.length?"invalid":"",title:i.length?i:"",allowedValues:s,value:n,allowEmptyValue:!o,onChange:this.onEnumChange})}var l="formData"===r.in&&!("FormData"in window),c=t("Input");return"file"===r.type?_.default.createElement(c,{type:"file",className:i.length?"invalid":"",title:i.length?i:"",onChange:this.onChange,disabled:l}):_.default.createElement(c,{type:"password"===r.format?"password":"text",className:i.length?"invalid":"",title:i.length?i:"",value:n,placeholder:a,onChange:this.onChange,disabled:l})}}]),t}(y.Component);O.propTypes=C,O.defaultProps=A;var M=t.JsonSchema_array=function(e){function t(e,n){(0,p.default)(this,t);var r=(0,m.default)(this,(t.__proto__||(0,l.default)(t)).call(this,e,n));return r.onChange=function(){return r.props.onChange(r.state.value)},r.onItemChange=function(e,t){r.setState(function(n){return{value:n.value.set(t,e)}},r.onChange)},r.removeItem=function(e){r.setState(function(t){return{value:t.value.remove(e)}},r.onChange)},r.addItem=function(){r.setState(function(e){return e.value=e.value||(0,w.List)(),{value:e.value.push("")}},r.onChange)},r.onEnumChange=function(e){r.setState(function(){return{value:e}},r.onChange)},r.state={value:e.value},r}return(0,g.default)(t,e),(0,h.default)(t,[{key:"componentWillReceiveProps",value:function(e){e.value!==this.state.value&&this.setState({value:e.value})}},{key:"render",value:function(){var e=this,t=this.props,n=t.getComponent,r=t.required,i=t.schema,a=t.errors,s=t.fn;a=a.toJS?a.toJS():[];var u=s.inferSchema(i.items),l=n("JsonSchemaForm"),c=n("Button"),p=u.enum,f=this.state.value;if(p){var h=n("Select");return _.default.createElement(h,{className:a.length?"invalid":"",title:a.length?a:"",multiple:!0,value:f,allowedValues:p,allowEmptyValue:!r,onChange:this.onEnumChange})}return _.default.createElement("div",null,!f||f.count()<1?null:f.map(function(t,r){var i=(0,o.default)({},u);if(a.length){var p=a.filter(function(e){return e.index===r});p.length&&(a=[p[0].error+r])}return _.default.createElement("div",{key:r,className:"json-schema-form-item"},_.default.createElement(l,{fn:s,getComponent:n,value:t,onChange:function(t){return e.onItemChange(t,r)},schema:i}),_.default.createElement(c,{className:"btn btn-sm json-schema-form-item-remove",onClick:function(){return e.removeItem(r)}}," - "))}).toArray(),_.default.createElement(c,{className:"btn btn-sm json-schema-form-item-add "+(a.length?"invalid":null),onClick:this.addItem}," Add item "))}}]),t}(y.PureComponent);M.propTypes=C,M.defaultProps=A;var T=t.JsonSchema_boolean=function(e){function t(){var e,n,r,i;(0,p.default)(this,t);for(var o=arguments.length,a=Array(o),s=0;s<o;s++)a[s]=arguments[s];return n=r=(0,m.default)(this,(e=t.__proto__||(0,l.default)(t)).call.apply(e,[this].concat(a))),r.onEnumChange=function(e){return r.props.onChange(e)},i=n,(0,m.default)(r,i)}return(0,g.default)(t,e),(0,h.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.value,r=e.errors,i=e.schema;r=r.toJS?r.toJS():[];var o=t("Select");return _.default.createElement(o,{className:r.length?"invalid":"",title:r.length?r:"",value:String(n),allowedValues:(0,w.fromJS)(i.enum||["true","false"]),allowEmptyValue:!this.props.required,onChange:this.onEnumChange})}}]),t}(y.Component);T.propTypes=C,T.defaultProps=A},function(e,t,n){"use strict";function r(e){var t=e.auth,n=e.authActions,r=e.errActions,i=e.configs,s=e.authConfigs,u=void 0===s?{}:s,l=t.schema,c=t.scopes,p=t.name,f=t.clientId,h=l.get("flow"),d=[];switch(h){case"password":return void n.authorizePassword(t);case"application":return void n.authorizeApplication(t);case"accessCode":d.push("response_type=code");break;case"implicit":d.push("response_type=token");break;case"clientCredentials":return void n.authorizeApplication(t);case"authorizationCode":d.push("response_type=code")}"string"==typeof f&&d.push("client_id="+encodeURIComponent(f));var m=i.oauth2RedirectUrl;if(void 0===m)return void r.newAuthErr({authId:p,source:"validation",level:"error",message:"oauth2RedirectUrl configuration is not passed. Oauth2 authorization cannot be performed."});if(d.push("redirect_uri="+encodeURIComponent(m)),Array.isArray(c)&&0<c.length){var v=u.scopeSeparator||" ";d.push("scope="+encodeURIComponent(c.join(v)))}var g=(0,a.btoa)(new Date);d.push("state="+encodeURIComponent(g)),void 0!==u.realm&&d.push("realm="+encodeURIComponent(u.realm));var y=u.additionalQueryStringParams;for(var _ in y)void 0!==y[_]&&d.push([_,y[_]].map(encodeURIComponent).join("="));var b=l.get("authorizationUrl"),x=[b,d.join("&")].join(-1===b.indexOf("?")?"?":"&"),w=void 0;w="implicit"===h?n.preAuthorizeImplicit:u.useBasicAuthenticationWithAccessCodeGrant?n.authorizeAccessCodeWithBasicAuthentication:n.authorizeAccessCodeWithFormParams,o.default.swaggerUIRedirectOauth2={auth:t,state:g,redirectUrl:m,callback:w,errCb:r.newAuthErr},o.default.open(x)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(46),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(9)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return[a.default,u.default]}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var o=n(561),a=r(o),s=n(307),u=r(s)},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e={components:{App:F.default,authorizationPopup:B.default,authorizeBtn:q.default,authorizeOperationBtn:U.default,auths:V.default,AuthItem:G.default,authError:K.default,oauth2:ee.default,apiKeyAuth:Y.default,basicAuth:Z.default,clear:ne.default,liveResponse:ie.default,info:qe.default,onlineValidatorBadge:ae.default,operations:ue.default,operation:ce.default,highlightCode:ve.default,responses:ye.default,response:be.default,responseBody:we.default,parameters:Ee.default,parameterRow:De.default,execute:Me.default,headers:Pe.default,errors:Re.default,contentType:Fe.default,overview:Be.default,footer:Ue.default,ParamBody:Ve.default,curl:Ge.default,schemes:Ke.default,modelExample:Ze.default,ModelWrapper:et.default,ModelCollapse:Ye.default,Model:nt.default,Models:it.default,EnumModel:at.default,ObjectModel:ut.default,ArrayModel:ct.default,PrimitiveModel:ft.default,Property:dt.default,TryItOutButton:vt.default,Markdown:wt.default,BaseLayout:Et.default,VersionStamp:yt.default,OperationExt:fe.default,OperationExtRow:de.default,ParameterExt:Ce.default,OperationContainer:R.default,DeepLink:bt.default}},t={components:Ct},n={components:Dt};return[M.default,E.default,v.default,f.default,c.default,a.default,u.default,d.default,e,t,b.default,n,w.default,y.default,C.default,D.default,P.default]};var o=n(291),a=i(o),s=n(294),u=i(s),l=n(320),c=i(l),p=n(328),f=i(p),h=n(319),d=i(h),m=n(297),v=i(m),g=n(273),y=i(g),_=n(326),b=i(_),x=n(275),w=i(x),k=n(327),E=i(k),S=n(325),C=i(S),A=n(286),D=i(A),O=n(279),M=i(O),T=n(283),P=i(T),I=n(556),R=i(I),j=n(509),F=i(j),N=n(513),B=i(N),L=n(514),q=i(L),z=n(515),U=i(z),W=n(516),V=i(W),H=n(512),G=i(H),J=n(518),K=i(J),X=n(511),Y=i(X),$=n(517),Z=i($),Q=n(519),ee=i(Q),te=n(520),ne=i(te),re=n(532),ie=i(re),oe=n(538),ae=i(oe),se=n(542),ue=i(se),le=n(541),ce=i(le),pe=n(540),fe=i(pe),he=n(539),de=i(he),me=n(529),ve=i(me),ge=n(552),ye=i(ge),_e=n(551),be=i(_e),xe=n(550),we=i(xe),ke=n(547),Ee=i(ke),Se=n(545),Ce=i(Se),Ae=n(546),De=i(Ae),Oe=n(526),Me=i(Oe),Te=n(528),Pe=i(Te),Ie=n(525),Re=i(Ie),je=n(521),Fe=i(je),Ne=n(543),Be=i(Ne),Le=n(530),qe=i(Le),ze=n(527),Ue=i(ze),We=n(544),Ve=i(We),He=n(522),Ge=i(He),Je=n(553),Ke=i(Je),Xe=n(533),Ye=i(Xe),$e=n(534),Ze=i($e),Qe=n(535),et=i(Qe),tt=n(269),nt=i(tt),rt=n(536),it=i(rt),ot=n(524),at=i(ot),st=n(537),ut=i(st),lt=n(510),ct=i(lt),pt=n(548),ft=i(pt),ht=n(549),dt=i(ht),mt=n(554),vt=i(mt),gt=n(555),yt=i(gt),_t=n(523),bt=i(_t),xt=n(270),wt=i(xt),kt=n(531),Et=i(kt),St=n(268),Ct=r(St),At=n(558),Dt=r(At)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){var r=[(0,F.systemThunkMiddleware)(n)],i=j.default.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||S.compose;return(0,S.createStore)(e,t,i(S.applyMiddleware.apply(void 0,r)))}function o(e,t){return(0,F.isObject)(e)&&!(0,F.isArray)(e)?e:(0,F.isFunc)(e)?o(e(t),t):(0,F.isArray)(e)?e.map(function(e){return o(e,t)}).reduce(s,{}):{}}function a(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.hasLoaded,o=i;return(0,F.isObject)(e)&&!(0,F.isArray)(e)&&"function"==typeof e.afterLoad&&(o=!0,p(e.afterLoad).call(this,t)),(0,F.isFunc)(e)?a.call(this,e(t),t,{hasLoaded:o}):(0,F.isArray)(e)?e.map(function(e){return a.call(n,e,t,{hasLoaded:o})}):o}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(0,F.isObject)(e))return{};if(!(0,F.isObject)(t))return e;t.wrapComponents&&((0,F.objMap)(t.wrapComponents,function(n,r){var i=e.components&&e.components[r];i&&Array.isArray(i)?(e.components[r]=i.concat([n]),delete t.wrapComponents[r]):i&&(e.components[r]=[i,n],delete t.wrapComponents[r])}),(0,d.default)(t.wrapComponents).length||delete t.wrapComponents);var n=e.statePlugins;if((0,F.isObject)(n))for(var r in n){var i=n[r];if((0,F.isObject)(i)&&(0,F.isObject)(i.wrapActions)){var o=i.wrapActions;for(var a in o){var s=o[a];Array.isArray(s)||(s=[s],o[a]=s),t&&t.statePlugins&&t.statePlugins[r]&&t.statePlugins[r].wrapActions&&t.statePlugins[r].wrapActions[a]&&(t.statePlugins[r].wrapActions[a]=o[a].concat(t.statePlugins[r].wrapActions[a]))}}}return(0,O.default)(e,t)}function u(e){return l((0,F.objMap)(e,function(e){return e.reducers}))}function l(e){var t=(0,d.default)(e).reduce(function(t,n){return t[n]=c(e[n]),t},{});return(0,d.default)(t).length?(0,M.combineReducers)(t):N}function c(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new C.Map,n=arguments[1];if(!e)return t;var r=e[n.type];if(r){var i=p(r)(t,n);return null===i?t:i}return t}}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.logErrors,r=void 0===n||n;return"function"!=typeof e?e:function(){try{for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return e.call.apply(e,[this].concat(n))}catch(e){return r&&console.error(e),null}}}function f(e,t,n){return i(e,t,n)}Object.defineProperty(t,"__esModule",{value:!0});var h=n(47),d=r(h),m=n(36),v=r(m),g=n(30),y=r(g),_=n(2),b=r(_),x=n(3),w=r(x),k=n(0),E=r(k),S=n(486),C=n(7),A=r(C),D=n(203),O=r(D),M=n(1117),T=n(264),P=r(T),I=n(128),R=n(46),j=r(R),F=n(9),N=function(e){return e},B=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,b.default)(this,e),(0,O.default)(this,{state:{},plugins:[],system:{configs:{},fn:{},components:{},rootInjects:{},statePlugins:{}},boundSystem:{},toolbox:{}},t),this.getSystem=this._getSystem.bind(this),this.store=f(N,(0,C.fromJS)(this.state),this.getSystem),this.buildSystem(!1),this.register(this.plugins)}return(0,w.default)(e,[{key:"getStore",value:function(){return this.store}},{key:"register",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=o(e,this.getSystem());s(this.system,n),t&&this.buildSystem(),a.call(this.system,e,this.getSystem())&&this.buildSystem()}},{key:"buildSystem",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.getStore().dispatch,n=this.getStore().getState;this.boundSystem=(0,y.default)({},this.getRootInjects(),this.getWrappedAndBoundActions(t),this.getWrappedAndBoundSelectors(n,this.getSystem),this.getStateThunks(n),this.getFn(),this.getConfigs()),e&&this.rebuildReducer()}},{key:"_getSystem",value:function(){return this.boundSystem}},{key:"getRootInjects",value:function(){return(0,y.default)({getSystem:this.getSystem,getStore:this.getStore.bind(this),getComponents:this.getComponents.bind(this),getState:this.getStore().getState,getConfigs:this._getConfigs.bind(this),Im:A.default,React:E.default},this.system.rootInjects||{})}},{key:"_getConfigs",value:function(){return this.system.configs}},{key:"getConfigs",value:function(){return{configs:this.system.configs}}},{key:"setConfigs",value:function(e){this.system.configs=e}},{key:"rebuildReducer",value:function(){this.store.replaceReducer(u(this.system.statePlugins))}},{key:"getType",value:function(e){var t=e[0].toUpperCase()+e.slice(1);return(0,F.objReduce)(this.system.statePlugins,function(n,r){var i=n[e];if(i)return(0,v.default)({},r+t,i)})}},{key:"getSelectors",value:function(){return this.getType("selectors")}},{key:"getActions",value:function(){var e=this.getType("actions");return(0,F.objMap)(e,function(e){return(0,F.objReduce)(e,function(e,t){if((0,F.isFn)(e))return(0,v.default)({},t,e)})})}},{key:"getWrappedAndBoundActions",value:function(e){var t=this,n=this.getBoundActions(e);return(0,F.objMap)(n,function(e,n){var r=t.system.statePlugins[n.slice(0,-7)].wrapActions;return r?(0,F.objMap)(e,function(e,n){var i=r[n];return i?(Array.isArray(i)||(i=[i]),i.reduce(function(e,n){var r=function(){return n(e,t.getSystem()).apply(void 0,arguments)};if(!(0,F.isFn)(r))throw new TypeError("wrapActions needs to return a function that returns a new function (ie the wrapped action)");return p(r)},e||Function.prototype)):e}):e})}},{key:"getWrappedAndBoundSelectors",value:function(e,t){var n=this,r=this.getBoundSelectors(e,t);return(0,F.objMap)(r,function(t,r){var i=[r.slice(0,-9)],o=n.system.statePlugins[i].wrapSelectors;return o?(0,F.objMap)(t,function(t,r){var a=o[r];return a?(Array.isArray(a)||(a=[a]),a.reduce(function(t,r){var o=function(){for(var o=arguments.length,a=Array(o),s=0;s<o;s++)a[s]=arguments[s];return r(t,n.getSystem()).apply(void 0,[e().getIn(i)].concat(a))};if(!(0,F.isFn)(o))throw new TypeError("wrapSelector needs to return a function that returns a new function (ie the wrapped action)");return o},t||Function.prototype)):t}):t})}},{key:"getStates",value:function(e){return(0,d.default)(this.system.statePlugins).reduce(function(t,n){return t[n]=e.get(n),t},{})}},{key:"getStateThunks",value:function(e){return(0,d.default)(this.system.statePlugins).reduce(function(t,n){return t[n]=function(){return e().get(n)},t},{})}},{key:"getFn",value:function(){return{fn:this.system.fn}}},{key:"getComponents",value:function(e){var t=this,n=this.system.components[e];return Array.isArray(n)?n.reduce(function(e,n){return n(e,t.getSystem())}):void 0!==e?this.system.components[e]:this.system.components}},{key:"getBoundSelectors",value:function(e,t){return(0,F.objMap)(this.getSelectors(),function(n,r){var i=[r.slice(0,-9)],o=function(){return e().getIn(i)};return(0,F.objMap)(n,function(e){return function(){for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];var a=p(e).apply(null,[o()].concat(r));return"function"==typeof a&&(a=p(a)(t())),a}})})}},{key:"getBoundActions",value:function(e){e=e||this.getStore().dispatch;var t=this.getActions(),n=function e(t){return"function"!=typeof t?(0,F.objMap)(t,function(t){return e(t)}):function(){var e=null;try{e=t.apply(void 0,arguments)}catch(t){e={type:I.NEW_THROWN_ERR,error:!0,payload:(0,P.default)(t)}}finally{return e}}};return(0,F.objMap)(t,function(t){return(0,S.bindActionCreators)(n(t),e)})}},{key:"getMapStateToProps",value:function(){var e=this;return function(){return(0,y.default)({},e.getSystem())}}},{key:"getMapDispatchToProps",value:function(e){var t=this;return function(n){return(0,O.default)({},t.getWrappedAndBoundActions(n),t.getFn(),e)}}}]),e}();t.default=B},function(e,t,n){e.exports={default:n(585),__esModule:!0}},function(e,t,n){e.exports={default:n(587),__esModule:!0}},function(e,t,n){e.exports={default:n(594),__esModule:!0}},function(e,t,n){e.exports={default:n(596),__esModule:!0}},function(e,t,n){e.exports={default:n(597),__esModule:!0}},function(e,t,n){e.exports={default:n(598),__esModule:!0}},function(e,t,n){e.exports=n(1124)},function(e,t,n){"use strict";function r(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-r(e)}function o(e){var t,n,i,o,a,s=e.length;o=r(e),a=new p(3*s/4-o),n=o>0?s-4:s;var u=0;for(t=0;t<n;t+=4)i=c[e.charCodeAt(t)]<<18|c[e.charCodeAt(t+1)]<<12|c[e.charCodeAt(t+2)]<<6|c[e.charCodeAt(t+3)],a[u++]=i>>16&255,a[u++]=i>>8&255,a[u++]=255&i;return 2===o?(i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,a[u++]=255&i):1===o&&(i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i),a}function a(e){return l[e>>18&63]+l[e>>12&63]+l[e>>6&63]+l[63&e]}function s(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(a(r));return i.join("")}function u(e){for(var t,n=e.length,r=n%3,i="",o=[],a=0,u=n-r;a<u;a+=16383)o.push(s(e,a,a+16383>u?u:a+16383));return 1===r?(t=e[n-1],i+=l[t>>2],i+=l[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=l[t>>10],i+=l[t>>4&63],i+=l[t<<2&63],i+="="),o.push(i),o.join("")}t.byteLength=i,t.toByteArray=o,t.fromByteArray=u;for(var l=[],c=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,d=f.length;h<d;++h)l[h]=f[h],c[f.charCodeAt(h)]=h;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},function(e,t,n){/*! - * Bowser - a browser detector - * https://github.com/ded/bowser - * MIT License | (c) Dustin Diaz 2015 +var r=n(267),o=n(456),i=n(456);t.applyOperation=i.applyOperation,t.applyPatch=i.applyPatch,t.applyReducer=i.applyReducer,t.getValueByPointer=i.getValueByPointer,t.validate=i.validate,t.validator=i.validator;var a=n(267);t.JsonPatchError=a.PatchError,t.deepClone=a._deepClone,t.escapePathComponent=a.escapePathComponent,t.unescapePathComponent=a.unescapePathComponent;var s=new WeakMap,u=function(e){this.observers=new Map,this.obj=e},c=function(e,t){this.callback=e,this.observer=t};function l(e){var t=s.get(e.object);p(t.value,e.object,e.patches,""),e.patches.length&&o.applyPatch(t.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function p(e,t,n,o){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var i=r._objectKeys(t),a=r._objectKeys(e),s=!1,u=a.length-1;u>=0;u--){var c=e[f=a[u]];if(!r.hasOwnProperty(t,f)||void 0===t[f]&&void 0!==c&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(n.push({op:"remove",path:o+"/"+r.escapePathComponent(f)}),s=!0):(n.push({op:"replace",path:o,value:t}),!0);else{var l=t[f];"object"==typeof c&&null!=c&&"object"==typeof l&&null!=l?p(c,l,n,o+"/"+r.escapePathComponent(f)):c!==l&&(!0,n.push({op:"replace",path:o+"/"+r.escapePathComponent(f),value:r._deepClone(l)}))}}if(s||i.length!=a.length)for(u=0;u<i.length;u++){var f=i[u];r.hasOwnProperty(e,f)||void 0===t[f]||n.push({op:"add",path:o+"/"+r.escapePathComponent(f),value:r._deepClone(t[f])})}}}t.unobserve=function(e,t){t.unobserve()},t.observe=function(e,t){var n,o=function(e){return s.get(e)}(e);if(o){var i=function(e,t){return e.observers.get(t)}(o,t);n=i&&i.observer}else o=new u(e),s.set(e,o);if(n)return n;if(n={},o.value=r._deepClone(e),t){n.callback=t,n.next=null;var a=function(){l(n)},p=function(){clearTimeout(n.next),n.next=setTimeout(a)};"undefined"!=typeof window&&(window.addEventListener?(window.addEventListener("mouseup",p),window.addEventListener("keyup",p),window.addEventListener("mousedown",p),window.addEventListener("keydown",p),window.addEventListener("change",p)):(document.documentElement.attachEvent("onmouseup",p),document.documentElement.attachEvent("onkeyup",p),document.documentElement.attachEvent("onmousedown",p),document.documentElement.attachEvent("onkeydown",p),document.documentElement.attachEvent("onchange",p)))}return n.patches=[],n.object=e,n.unobserve=function(){l(n),clearTimeout(n.next),function(e,t){e.observers.delete(t.callback)}(o,n),"undefined"!=typeof window&&(window.removeEventListener?(window.removeEventListener("mouseup",p),window.removeEventListener("keyup",p),window.removeEventListener("mousedown",p),window.removeEventListener("keydown",p)):(document.documentElement.detachEvent("onmouseup",p),document.documentElement.detachEvent("onkeyup",p),document.documentElement.detachEvent("onmousedown",p),document.documentElement.detachEvent("onkeydown",p)))},o.observers.set(t,new c(t,n)),n},t.generate=l,t.compare=function(e,t){var n=[];return p(e,t,n,""),n}},function(e,t,n){var r=Array.prototype.slice,o=n(941),i=n(942),a=e.exports=function(e,t,n){return n||(n={}),e===t||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:function(e,t,n){var c,l;if(s(e)||s(t))return!1;if(e.prototype!==t.prototype)return!1;if(i(e))return!!i(t)&&(e=r.call(e),t=r.call(t),a(e,t,n));if(u(e)){if(!u(t))return!1;if(e.length!==t.length)return!1;for(c=0;c<e.length;c++)if(e[c]!==t[c])return!1;return!0}try{var p=o(e),f=o(t)}catch(e){return!1}if(p.length!=f.length)return!1;for(p.sort(),f.sort(),c=p.length-1;c>=0;c--)if(p[c]!=f[c])return!1;for(c=p.length-1;c>=0;c--)if(l=p[c],!a(e[l],t[l],n))return!1;return typeof e==typeof t}(e,t,n))};function s(e){return null==e}function u(e){return!(!e||"object"!=typeof e||"number"!=typeof e.length)&&("function"==typeof e.copy&&"function"==typeof e.slice&&!(e.length>0&&"number"!=typeof e[0]))}},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}(e.exports="function"==typeof Object.keys?Object.keys:n).shim=n},function(e,t){var n="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();function r(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function o(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}(t=e.exports=n?r:o).supported=r,t.unsupported=o},function(e,t,n){(function(t){!function(){"use strict";e.exports=function(e){return(e instanceof t?e:new t(e.toString(),"binary")).toString("base64")}}()}).call(this,n(64).Buffer)},function(e,t,n){var r=n(945),o=n(365),i=n(386),a=n(69);e.exports=function(e,t,n){return e=a(e),n=null==n?0:r(i(n),0,e.length),t=o(t),e.slice(n,n+t.length)==t}},function(e,t){e.exports=function(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}},function(e,t,n){"use strict";var r=n(947),o=n(948),i=n(458);e.exports={formats:i,parse:o,stringify:r}},function(e,t,n){"use strict";var r=n(457),o=n(458),i=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},s=Array.isArray,u=Array.prototype.push,c=function(e,t){u.apply(e,s(t)?t:[t])},l=Date.prototype.toISOString,p={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,formatter:o.formatters[o.default],indices:!1,serializeDate:function(e){return l.call(e)},skipNulls:!1,strictNullHandling:!1},f=function e(t,n,o,i,a,u,l,f,h,d,m,v,g){var y=t;if("function"==typeof l?y=l(n,y):y instanceof Date?y=d(y):"comma"===o&&s(y)&&(y=y.join(",")),null===y){if(i)return u&&!v?u(n,p.encoder,g):n;y=""}if("string"==typeof y||"number"==typeof y||"boolean"==typeof y||r.isBuffer(y))return u?[m(v?n:u(n,p.encoder,g))+"="+m(u(y,p.encoder,g))]:[m(n)+"="+m(String(y))];var b,_=[];if(void 0===y)return _;if(s(l))b=l;else{var w=Object.keys(y);b=f?w.sort(f):w}for(var x=0;x<b.length;++x){var E=b[x];a&&null===y[E]||(s(y)?c(_,e(y[E],"function"==typeof o?o(n,E):n,o,i,a,u,l,f,h,d,m,v,g)):c(_,e(y[E],n+(h?"."+E:"["+E+"]"),o,i,a,u,l,f,h,d,m,v,g)))}return _};e.exports=function(e,t){var n,r=e,u=function(e){if(!e)return p;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||p.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=o.default;if(void 0!==e.format){if(!i.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=o.formatters[n],a=p.filter;return("function"==typeof e.filter||s(e.filter))&&(a=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:p.addQueryPrefix,allowDots:void 0===e.allowDots?p.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:p.charsetSentinel,delimiter:void 0===e.delimiter?p.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:p.encode,encoder:"function"==typeof e.encoder?e.encoder:p.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:p.encodeValuesOnly,filter:a,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:p.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:p.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:p.strictNullHandling}}(t);"function"==typeof u.filter?r=(0,u.filter)("",r):s(u.filter)&&(n=u.filter);var l,h=[];if("object"!=typeof r||null===r)return"";l=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var d=a[l];n||(n=Object.keys(r)),u.sort&&n.sort(u.sort);for(var m=0;m<n.length;++m){var v=n[m];u.skipNulls&&null===r[v]||c(h,f(r[v],v,d,u.strictNullHandling,u.skipNulls,u.encode?u.encoder:null,u.filter,u.sort,u.allowDots,u.serializeDate,u.formatter,u.encodeValuesOnly,u.charset))}var g=h.join(u.delimiter),y=!0===u.addQueryPrefix?"?":"";return u.charsetSentinel&&("iso-8859-1"===u.charset?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),g.length>0?y+g:""}},function(e,t,n){"use strict";var r=n(457),o=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},s=function(e,t,n){if(e){var r=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(r),s=a?r.slice(0,a.index):r,u=[];if(s){if(!n.plainObjects&&o.call(Object.prototype,s)&&!n.allowPrototypes)return;u.push(s)}for(var c=0;null!==(a=i.exec(r))&&c<n.depth;){if(c+=1,!n.plainObjects&&o.call(Object.prototype,a[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(a[1])}return a&&u.push("["+r.slice(a.index)+"]"),function(e,t,n){for(var r=t,o=e.length-1;o>=0;--o){var i,a=e[o];if("[]"===a&&n.parseArrays)i=[].concat(r);else{i=n.plainObjects?Object.create(null):{};var s="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,u=parseInt(s,10);n.parseArrays||""!==s?!isNaN(u)&&a!==s&&String(u)===s&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(i=[])[u]=r:i[s]=r:i={0:r}}r=i}return r}(u,t,n)}};e.exports=function(e,t){var n=function(e){if(!e)return i;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?i.charset:e.charset;return{allowDots:void 0===e.allowDots?i.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:i.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:i.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:i.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:i.comma,decoder:"function"==typeof e.decoder?e.decoder:i.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:i.delimiter,depth:"number"==typeof e.depth?e.depth:i.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:i.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:i.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:i.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var n,s={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,c=t.parameterLimit===1/0?void 0:t.parameterLimit,l=u.split(t.delimiter,c),p=-1,f=t.charset;if(t.charsetSentinel)for(n=0;n<l.length;++n)0===l[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===l[n]?f="utf-8":"utf8=%26%2310003%3B"===l[n]&&(f="iso-8859-1"),p=n,n=l.length);for(n=0;n<l.length;++n)if(n!==p){var h,d,m=l[n],v=m.indexOf("]="),g=-1===v?m.indexOf("="):v+1;-1===g?(h=t.decoder(m,i.decoder,f),d=t.strictNullHandling?null:""):(h=t.decoder(m.slice(0,g),i.decoder,f),d=t.decoder(m.slice(g+1),i.decoder,f)),d&&t.interpretNumericEntities&&"iso-8859-1"===f&&(d=a(d)),d&&t.comma&&d.indexOf(",")>-1&&(d=d.split(",")),o.call(s,h)?s[h]=r.combine(s[h],d):s[h]=d}return s}(e,n):e,c=n.plainObjects?Object.create(null):{},l=Object.keys(u),p=0;p<l.length;++p){var f=l[p],h=s(f,u[f],n);c=r.merge(c,h,n)}return r.compact(c)}},function(e,t,n){"use strict";var r=t,o=n(64).Buffer;function i(e,t){try{return decodeURIComponent(e)}catch(n){return r.unescapeBuffer(e,t).toString()}}r.unescapeBuffer=function(e,t){for(var n,r,i,a=new o(e.length),s=0,u=0,c=0;u<=e.length;u++){var l=u<e.length?e.charCodeAt(u):NaN;switch(s){case 0:switch(l){case 37:n=0,r=0,s=1;break;case 43:t&&(l=32);default:a[c++]=l}break;case 1:if(i=l,l>=48&&l<=57)n=l-48;else if(l>=65&&l<=70)n=l-65+10;else{if(!(l>=97&&l<=102)){a[c++]=37,a[c++]=l,s=0;break}n=l-97+10}s=2;break;case 2:if(s=0,l>=48&&l<=57)r=l-48;else if(l>=65&&l<=70)r=l-65+10;else{if(!(l>=97&&l<=102)){a[c++]=37,a[c++]=i,a[c++]=l;break}r=l-97+10}a[c++]=16*n+r}}return a.slice(0,c-1)},r.unescape=i;for(var a=new Array(256),s=0;s<256;++s)a[s]="%"+((s<16?"0":"")+s.toString(16)).toUpperCase();r.escape=function(e){"string"!=typeof e&&(e+="");for(var t="",n=0,r=0;r<e.length;++r){var o=e.charCodeAt(r);if(!(33===o||45===o||46===o||95===o||126===o||o>=39&&o<=42||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122))if(r-n>0&&(t+=e.slice(n,r)),o<128)n=r+1,t+=a[o];else if(o<2048)n=r+1,t+=a[192|o>>6]+a[128|63&o];else if(o<55296||o>=57344)n=r+1,t+=a[224|o>>12]+a[128|o>>6&63]+a[128|63&o];else{var i;if(!(++r<e.length))throw new URIError("URI malformed");i=1023&e.charCodeAt(r),n=r+1,t+=a[240|(o=65536+((1023&o)<<10|i))>>18]+a[128|o>>12&63]+a[128|o>>6&63]+a[128|63&o]}}return 0===n?e:n<e.length?t+e.slice(n):t};var u=function(e){return"string"==typeof e?e:"number"==typeof e&&isFinite(e)?""+e:"boolean"==typeof e?e?"true":"false":""};function c(e,t){try{return t(e)}catch(t){return r.unescape(e,!0)}}r.stringify=r.encode=function(e,t,n,o){t=t||"&",n=n||"=";var i=r.escape;if(o&&"function"==typeof o.encodeURIComponent&&(i=o.encodeURIComponent),null!==e&&"object"==typeof e){for(var a=Object.keys(e),s=a.length,c=s-1,l="",p=0;p<s;++p){var f=a[p],h=e[f],d=i(u(f))+n;if(Array.isArray(h)){for(var m=h.length,v=m-1,g=0;g<m;++g)l+=d+i(u(h[g])),g<v&&(l+=t);m&&p<c&&(l+=t)}else l+=d+i(u(h)),p<c&&(l+=t)}return l}return""},r.parse=r.decode=function(e,t,n,o){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;"string"!=typeof t&&(t+="");var s=n.length,u=t.length,l=1e3;o&&"number"==typeof o.maxKeys&&(l=o.maxKeys);var p=1/0;l>0&&(p=l);var f=r.unescape;o&&"function"==typeof o.decodeURIComponent&&(f=o.decodeURIComponent);for(var h=f!==i,d=[],m=0,v=0,g=0,y="",b="",_=h,w=h,x=0,E=0;E<e.length;++E){var S=e.charCodeAt(E);if(S!==t.charCodeAt(v)){if(v=0,w||(37===S?x=1:x>0&&(S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102)?3==++x&&(w=!0):x=0),g<s){if(S===n.charCodeAt(g)){if(++g===s)m<(k=E-g+1)&&(y+=e.slice(m,k)),x=0,m=E+1;continue}g=0,_||(37===S?x=1:x>0&&(S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102)?3==++x&&(_=!0):x=0)}43===S&&(g<s?(E-m>0&&(y+=e.slice(m,E)),y+="%20",_=!0):(E-m>0&&(b+=e.slice(m,E)),b+="%20",w=!0),m=E+1)}else if(++v===u){var C,k=E-v+1;if(g<s?m<k&&(y+=e.slice(m,k)):m<k&&(b+=e.slice(m,k)),_&&(y=c(y,f)),w&&(b=c(b,f)),-1===d.indexOf(y))a[y]=b,d[d.length]=y;else(C=a[y])instanceof Array?C[C.length]=b:a[y]=[C,b];if(0==--p)break;_=w=h,x=0,y=b="",m=E+1,v=g=0}}p>0&&(m<e.length||g>0)&&(m<e.length&&(g<s?y+=e.slice(m):v<u&&(b+=e.slice(m))),_&&(y=c(y,f)),w&&(b=c(b,f)),-1===d.indexOf(y)?(a[y]=b,d[d.length]=y):(C=a[y])instanceof Array?C[C.length]=b:a[y]=[C,b]);return a}},function(e,t,n){"use strict";(function(t){ +/*! + * @description Recursive object extending + * @author Viacheslav Lotsmanov <lotsmanov89@gmail.com> + * @license MIT + * + * The MIT License (MIT) + * + * Copyright (c) 2013-2018 Viacheslav Lotsmanov + * + * 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. */ -!function(t,r,i){void 0!==e&&e.exports?e.exports=i():n(1195)("bowser",i)}(0,0,function(){function e(e){function t(t){var n=e.match(t);return n&&n.length>1&&n[1]||""}function n(t){var n=e.match(t);return n&&n.length>1&&n[2]||""}var r,i=t(/(ipod|iphone|ipad)/i).toLowerCase(),o=/like android/i.test(e),s=!o&&/android/i.test(e),u=/nexus\s*[0-6]\s*/i.test(e),l=!u&&/nexus\s*[0-9]+/i.test(e),c=/CrOS/.test(e),p=/silk/i.test(e),f=/sailfish/i.test(e),h=/tizen/i.test(e),d=/(web|hpw)os/i.test(e),m=/windows phone/i.test(e),v=(/SamsungBrowser/i.test(e),!m&&/windows/i.test(e)),g=!i&&!p&&/macintosh/i.test(e),y=!s&&!f&&!h&&!d&&/linux/i.test(e),_=n(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),b=t(/version\/(\d+(\.\d+)?)/i),x=/tablet/i.test(e)&&!/tablet pc/i.test(e),w=!x&&/[^-]mobi/i.test(e),k=/xbox/i.test(e);/opera/i.test(e)?r={name:"Opera",opera:a,version:b||t(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(e)?r={name:"Opera",opera:a,version:t(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||b}:/SamsungBrowser/i.test(e)?r={name:"Samsung Internet for Android",samsungBrowser:a,version:b||t(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(e)?r={name:"Opera Coast",coast:a,version:b||t(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(e)?r={name:"Yandex Browser",yandexbrowser:a,version:b||t(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(e)?r={name:"UC Browser",ucbrowser:a,version:t(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(e)?r={name:"Maxthon",maxthon:a,version:t(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(e)?r={name:"Epiphany",epiphany:a,version:t(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(e)?r={name:"Puffin",puffin:a,version:t(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(e)?r={name:"Sleipnir",sleipnir:a,version:t(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(e)?r={name:"K-Meleon",kMeleon:a,version:t(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:m?(r={name:"Windows Phone",osname:"Windows Phone",windowsphone:a},_?(r.msedge=a,r.version=_):(r.msie=a,r.version=t(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(e)?r={name:"Internet Explorer",msie:a,version:t(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:c?r={name:"Chrome",osname:"Chrome OS",chromeos:a,chromeBook:a,chrome:a,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(e)?r={name:"Microsoft Edge",msedge:a,version:_}:/vivaldi/i.test(e)?r={name:"Vivaldi",vivaldi:a,version:t(/vivaldi\/(\d+(\.\d+)?)/i)||b}:f?r={name:"Sailfish",osname:"Sailfish OS",sailfish:a,version:t(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(e)?r={name:"SeaMonkey",seamonkey:a,version:t(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(e)?(r={name:"Firefox",firefox:a,version:t(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(e)&&(r.firefoxos=a,r.osname="Firefox OS")):p?r={name:"Amazon Silk",silk:a,version:t(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(e)?r={name:"PhantomJS",phantom:a,version:t(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(e)?r={name:"SlimerJS",slimer:a,version:t(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(e)||/rim\stablet/i.test(e)?r={name:"BlackBerry",osname:"BlackBerry OS",blackberry:a,version:b||t(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:d?(r={name:"WebOS",osname:"WebOS",webos:a,version:b||t(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(e)&&(r.touchpad=a)):/bada/i.test(e)?r={name:"Bada",osname:"Bada",bada:a,version:t(/dolfin\/(\d+(\.\d+)?)/i)}:h?r={name:"Tizen",osname:"Tizen",tizen:a,version:t(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||b}:/qupzilla/i.test(e)?r={name:"QupZilla",qupzilla:a,version:t(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||b}:/chromium/i.test(e)?r={name:"Chromium",chromium:a,version:t(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||b}:/chrome|crios|crmo/i.test(e)?r={name:"Chrome",chrome:a,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:s?r={name:"Android",version:b}:/safari|applewebkit/i.test(e)?(r={name:"Safari",safari:a},b&&(r.version=b)):i?(r={name:"iphone"==i?"iPhone":"ipad"==i?"iPad":"iPod"},b&&(r.version=b)):r=/googlebot/i.test(e)?{name:"Googlebot",googlebot:a,version:t(/googlebot\/(\d+(\.\d+))/i)||b}:{name:t(/^(.*)\/(.*) /),version:n(/^(.*)\/(.*) /)},!r.msedge&&/(apple)?webkit/i.test(e)?(/(apple)?webkit\/537\.36/i.test(e)?(r.name=r.name||"Blink",r.blink=a):(r.name=r.name||"Webkit",r.webkit=a),!r.version&&b&&(r.version=b)):!r.opera&&/gecko\//i.test(e)&&(r.name=r.name||"Gecko",r.gecko=a,r.version=r.version||t(/gecko\/(\d+(\.\d+)?)/i)),r.windowsphone||!s&&!r.silk?!r.windowsphone&&i?(r[i]=a,r.ios=a,r.osname="iOS"):g?(r.mac=a,r.osname="macOS"):k?(r.xbox=a,r.osname="Xbox"):v?(r.windows=a,r.osname="Windows"):y&&(r.linux=a,r.osname="Linux"):(r.android=a,r.osname="Android");var E="";r.windows?E=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}(t(/Windows ((NT|XP)( \d\d?.\d)?)/i)):r.windowsphone?E=t(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):r.mac?(E=t(/Mac OS X (\d+([_\.\s]\d+)*)/i),E=E.replace(/[_\s]/g,".")):i?(E=t(/os (\d+([_\s]\d+)*) like mac os x/i),E=E.replace(/[_\s]/g,".")):s?E=t(/android[ \/-](\d+(\.\d+)*)/i):r.webos?E=t(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):r.blackberry?E=t(/rim\stablet\sos\s(\d+(\.\d+)*)/i):r.bada?E=t(/bada\/(\d+(\.\d+)*)/i):r.tizen&&(E=t(/tizen[\/\s](\d+(\.\d+)*)/i)),E&&(r.osversion=E);var S=!r.windows&&E.split(".")[0];return x||l||"ipad"==i||s&&(3==S||S>=4&&!w)||r.silk?r.tablet=a:(w||"iphone"==i||"ipod"==i||s||u||r.blackberry||r.webos||r.bada)&&(r.mobile=a),r.msedge||r.msie&&r.version>=10||r.yandexbrowser&&r.version>=15||r.vivaldi&&r.version>=1||r.chrome&&r.version>=20||r.samsungBrowser&&r.version>=4||r.firefox&&r.version>=20||r.safari&&r.version>=6||r.opera&&r.version>=10||r.ios&&r.osversion&&r.osversion.split(".")[0]>=6||r.blackberry&&r.version>=10.1||r.chromium&&r.version>=20?r.a=a:r.msie&&r.version<10||r.chrome&&r.version<20||r.firefox&&r.version<20||r.safari&&r.version<6||r.opera&&r.version<10||r.ios&&r.osversion&&r.osversion.split(".")[0]<6||r.chromium&&r.version<20?r.c=a:r.x=a,r}function t(e){return e.split(".").length}function n(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n++)r.push(t(e[n]));return r}function r(e){for(var r=Math.max(t(e[0]),t(e[1])),i=n(e,function(e){var i=r-t(e);return e+=new Array(i+1).join(".0"),n(e.split("."),function(e){return new Array(20-e.length).join("0")+e}).reverse()});--r>=0;){if(i[0][r]>i[1][r])return 1;if(i[0][r]!==i[1][r])return-1;if(0===r)return 0}}function i(t,n,i){var o=s;"string"==typeof n&&(i=n,n=void 0),void 0===n&&(n=!1),i&&(o=e(i));var a=""+o.version;for(var u in t)if(t.hasOwnProperty(u)&&o[u]){if("string"!=typeof t[u])throw new Error("Browser version in the minVersion map should be a string: "+u+": "+String(t));return r([a,t[u]])<0}return n}function o(e,t,n){return!i(e,t,n)}var a=!0,s=e("undefined"!=typeof navigator?navigator.userAgent||"":"");return s.test=function(e){for(var t=0;t<e.length;++t){var n=e[t];if("string"==typeof n&&n in s)return!0}return!1},s.isUnsupportedBrowser=i,s.compareVersions=r,s.check=o,s._detect=e,s})},function(e,t,n){(function(t){!function(){"use strict";function n(e){var n;return n=e instanceof t?e:new t(e.toString(),"binary"),n.toString("base64")}e.exports=n}()}).call(t,n(40).Buffer)},function(e,t,n){var r,i;/*! - Copyright (c) 2016 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ -!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r))e.push(n.apply(null,r));else if("object"===i)for(var a in r)o.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}var o={}.hasOwnProperty;void 0!==e&&e.exports?e.exports=n:(r=[],void 0!==(i=function(){return n}.apply(t,r))&&(e.exports=i))}()},function(e,t,n){"use strict";function r(e){return{key:e.nodeKey,className:e.className,"data-sourcepos":e["data-sourcepos"]}}function i(e){var t=e.toLowerCase(),n=w[t]||t;return void 0!==k[n]?n:e}function o(e){return Object.keys(e||{}).reduce(function(t,n){return t[i(n)]=e[n],t},{})}function a(e){var t=r(e),n=e.escapeHtml?{}:{dangerouslySetInnerHTML:{__html:e.literal}},i=e.escapeHtml?[e.literal]:null;if(e.escapeHtml||!e.skipHtml){var o=y(t,n);return l(e.isBlock?"div":"span",o,i)}}function s(e){var t=e.parent.parent;return t&&"list"===t.type.toLowerCase()&&t.listTight}function u(e,t){var n=e;do{n=n.parent}while(!n.react);n.react.children.push(t)}function l(e,t,n){var r=Array.isArray(n)&&n.reduce(c,[]),i=[e,t].concat(r||n);return g.createElement.apply(g,i)}function c(e,t){var n=e.length-1;return"string"==typeof t&&"string"==typeof e[n]?e[n]+=t:e.push(t),e}function p(e){return[e[0][0],":",e[0][1],"-",e[1][0],":",e[1][1]].map(String).join("")}function f(e,t,n,r){var o={key:t};n.sourcePos&&e.sourcepos&&(o["data-sourcepos"]=p(e.sourcepos));var a=i(e.type);switch(a){case"html_inline":case"html_block":o.isBlock="html_block"===a,o.escapeHtml=n.escapeHtml,o.skipHtml=n.skipHtml;break;case"code_block":var s=e.info?e.info.split(/ +/):[];s.length>0&&s[0].length>0&&(o.language=s[0],o.codeinfo=s);break;case"code":o.children=e.literal,o.inline=!0;break;case"heading":o.level=e.level;break;case"softbreak":o.softBreak=n.softBreak;break;case"link":o.href=n.transformLinkUri?n.transformLinkUri(e.destination):e.destination,o.title=e.title||void 0,n.linkTarget&&(o.target=n.linkTarget);break;case"image":o.src=n.transformImageUri?n.transformImageUri(e.destination):e.destination,o.title=e.title||void 0,o.alt=e.react.children.join(""),e.react.children=void 0;break;case"list":o.start=e.listStart,o.type=e.listType,o.tight=e.listTight}"string"!=typeof r&&(o.literal=e.literal);var u=o.children||e.react&&e.react.children;return Array.isArray(u)&&(o.children=u.reduce(c,[])||null),o}function h(e){return e?e.sourcepos?p(e.sourcepos):h(e.parent):null}function d(e){for(var t,n,r,o,a,l,c,p,d,m=e.walker(),v={sourcePos:this.sourcePos,escapeHtml:this.escapeHtml,skipHtml:this.skipHtml,transformLinkUri:this.transformLinkUri,transformImageUri:this.transformImageUri,softBreak:this.softBreak,linkTarget:this.linkTarget},_=0;t=m.next();){var b=h(t.node.sourcepos?t.node:t.node.parent);if(d===b?(c=b+_,_++):(c=b,_=0),d=b,r=t.entering,o=!r,n=t.node,a=i(n.type),p=null,l){if(n!==l&&!("paragraph"===a&&s(n)||this.skipHtml&&("html_block"===a||"html_inline"===a))){var w=n===l,k=-1===this.allowedTypes.indexOf(a),E=!1,S=n.isContainer&&o,C=this.renderers[a];if(this.allowNode&&(S||!n.isContainer)){var A=S?n.react.children:[];p=f(n,c,v,C),E=!this.allowNode({type:x(a),renderer:this.renderers[a],props:p,children:A})}if(w||!E&&!k){var D="text"===a||"softbreak"===a;if("function"!=typeof C&&!D&&"string"!=typeof C)throw new Error("Renderer for type `"+x(n.type)+"` not defined or is not renderable");if(n.isContainer&&r)n.react={component:C,props:{},children:[]};else{var O=p||f(n,c,v,C);if(C)O="string"==typeof C?O:y(O,{nodeKey:O.key}),u(n,g.createElement(C,O));else if("text"===a)u(n,n.literal);else if("softbreak"===a){var M="br"===this.softBreak?g.createElement("br",{key:c}):this.softBreak;u(n,M)}}}else!this.unwrapDisallowed&&r&&n.isContainer&&m.resumeAt(n,!1)}}else l=n,n.react={children:[]}}return l.react.children}function m(e){var t=e.replace(/file:\/\//g,"x-file://");return decodeURI(b.uriInDoubleQuotedAttr(t))}function v(e){var t=e||{};if(t.allowedTypes&&t.disallowedTypes)throw new Error("Only one of `allowedTypes` and `disallowedTypes` should be defined");if(t.allowedTypes&&!Array.isArray(t.allowedTypes))throw new Error("`allowedTypes` must be an array");if(t.disallowedTypes&&!Array.isArray(t.disallowedTypes))throw new Error("`disallowedTypes` must be an array");if(t.allowNode&&"function"!=typeof t.allowNode)throw new Error("`allowNode` must be a function");var n=t.transformLinkUri;if(void 0===n)n=m;else if(n&&"function"!=typeof n)throw new Error("`transformLinkUri` must either be a function, or `null` to disable");var r=t.transformImageUri;if(void 0!==r&&"function"!=typeof r)throw new Error("`transformImageUri` must be a function");if(t.renderers&&!_(t.renderers))throw new Error("`renderers` must be a plain object of `Type`: `Renderer` pairs");var a=t.allowedTypes&&t.allowedTypes.map(i)||E;if(t.disallowedTypes){var s=t.disallowedTypes.map(i);a=a.filter(function(e){return-1===s.indexOf(e)})}return{sourcePos:Boolean(t.sourcePos),softBreak:t.softBreak||"\n",renderers:y({},k,o(t.renderers)),escapeHtml:Boolean(t.escapeHtml),skipHtml:Boolean(t.skipHtml),transformLinkUri:n,transformImageUri:r,allowNode:t.allowNode,allowedTypes:a,unwrapDisallowed:Boolean(t.unwrapDisallowed),render:d,linkTarget:t.linkTarget||!1}}var g=n(0),y=n(823),_=n(826),b=n(1199),x=n(979),w={blockquote:"block_quote",thematicbreak:"thematic_break",htmlblock:"html_block",htmlinline:"html_inline",codeblock:"code_block",hardbreak:"linebreak"},k={block_quote:"blockquote",emph:"em",linebreak:"br",image:"img",item:"li",link:"a",paragraph:"p",strong:"strong",thematic_break:"hr",html_block:a,html_inline:a,list:function(e){var t="bullet"===e.type.toLowerCase()?"ul":"ol",n=r(e);return null!==e.start&&1!==e.start&&(n.start=e.start.toString()),l(t,n,e.children)},code_block:function(e){var t=e.language&&"language-"+e.language,n=l("code",{className:t},e.literal);return l("pre",r(e),n)},code:function(e){return l("code",r(e),e.children)},heading:function(e){return l("h"+e.level,r(e),e.children)},text:null,softbreak:null},E=Object.keys(k);v.uriTransformer=m,v.types=E.map(x),v.renderers=E.reduce(function(e,t){return e[x(t)]=k[t],e},{}),e.exports=v},function(e,t,n){"use strict";function r(e){return{doc:new B,blocks:M,blockStarts:T,tip:this.doc,oldtip:this.doc,currentLine:"",lineNumber:0,offset:0,column:0,nextNonspace:0,nextNonspaceColumn:0,indent:0,indented:!1,blank:!1,partiallyConsumedTab:!1,allClosed:!0,lastMatchedContainer:this.doc,refmap:{},lastLineLength:0,inlineParser:new u(e),findNextNonspace:R,advanceOffset:P,advanceNextNonspace:I,addLine:S,addChild:C,incorporateLine:j,finalize:F,processInlines:N,closeUnmatchedBlocks:O,parse:L,options:e||{}}}var i=n(174),o=n(73).unescapeString,a=n(73).OPENTAG,s=n(73).CLOSETAG,u=n(578),l=[/./,/^<(?:script|pre|style)(?:\s|>|$)/i,/^<!--/,/^<[?]/,/^<![A-Z]/,/^<!\[CDATA\[/,/^<[\/]?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[123456]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|title|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|[\/]?[>]|$)/i,new RegExp("^(?:"+a+"|"+s+")\\s*$","i")],c=[/./,/<\/(?:script|pre|style)>/i,/-->/,/\?>/,/>/,/\]\]>/],p=/^(?:(?:\*[ \t]*){3,}|(?:_[ \t]*){3,}|(?:-[ \t]*){3,})[ \t]*$/,f=/^[#`~*+_=<>0-9-]/,h=/[^ \t\f\v\r\n]/,d=/^[*+-]/,m=/^(\d{1,9})([.)])/,v=/^#{1,6}(?:[ \t]+|$)/,g=/^`{3,}(?!.*`)|^~{3,}(?!.*~)/,y=/^(?:`{3,}|~{3,})(?= *$)/,_=/^(?:=+|-+)[ \t]*$/,b=/\r\n|\n|\r/,x=function(e){return!h.test(e)},w=function(e){return 32===e||9===e},k=function(e,t){return t<e.length?e.charCodeAt(t):-1},E=function(e){for(;e;){if(e._lastLineBlank)return!0;var t=e.type;if("list"!==t&&"item"!==t)break;e=e._lastChild}return!1},S=function(){if(this.partiallyConsumedTab){this.offset+=1;var e=4-this.column%4;this.tip._string_content+=" ".repeat(e)}this.tip._string_content+=this.currentLine.slice(this.offset)+"\n"},C=function(e,t){for(;!this.blocks[this.tip.type].canContain(e);)this.finalize(this.tip,this.lineNumber-1);var n=t+1,r=new i(e,[[this.lineNumber,n],[0,0]]);return r._string_content="",this.tip.appendChild(r),this.tip=r,r},A=function(e,t){var n,r,i,o,a=e.currentLine.slice(e.nextNonspace),s={type:null,tight:!0,bulletChar:null,start:null,delimiter:null,padding:null,markerOffset:e.indent};if(n=a.match(d))s.type="bullet",s.bulletChar=n[0][0];else{if(!(n=a.match(m))||"paragraph"===t.type&&"1"!==n[1])return null;s.type="ordered",s.start=parseInt(n[1]),s.delimiter=n[2]}if(-1!==(r=k(e.currentLine,e.nextNonspace+n[0].length))&&9!==r&&32!==r)return null;if("paragraph"===t.type&&!e.currentLine.slice(e.nextNonspace+n[0].length).match(h))return null;e.advanceNextNonspace(),e.advanceOffset(n[0].length,!0),i=e.column,o=e.offset;do{e.advanceOffset(1,!0),r=k(e.currentLine,e.offset)}while(e.column-i<5&&w(r));var u=-1===k(e.currentLine,e.offset),l=e.column-i;return l>=5||l<1||u?(s.padding=n[0].length+1,e.column=i,e.offset=o,w(k(e.currentLine,e.offset))&&e.advanceOffset(1,!0)):s.padding=n[0].length+l,s},D=function(e,t){return e.type===t.type&&e.delimiter===t.delimiter&&e.bulletChar===t.bulletChar},O=function(){if(!this.allClosed){for(;this.oldtip!==this.lastMatchedContainer;){var e=this.oldtip._parent;this.finalize(this.oldtip,this.lineNumber-1),this.oldtip=e}this.allClosed=!0}},M={document:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},list:{continue:function(){return 0},finalize:function(e,t){for(var n=t._firstChild;n;){if(E(n)&&n._next){t._listData.tight=!1;break}for(var r=n._firstChild;r;){if(E(r)&&(n._next||r._next)){t._listData.tight=!1;break}r=r._next}n=n._next}},canContain:function(e){return"item"===e},acceptsLines:!1},block_quote:{continue:function(e){var t=e.currentLine;return e.indented||62!==k(t,e.nextNonspace)?1:(e.advanceNextNonspace(),e.advanceOffset(1,!1),w(k(t,e.offset))&&e.advanceOffset(1,!0),0)},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},item:{continue:function(e,t){if(e.blank){if(null==t._firstChild)return 1;e.advanceNextNonspace()}else{if(!(e.indent>=t._listData.markerOffset+t._listData.padding))return 1;e.advanceOffset(t._listData.markerOffset+t._listData.padding,!0)}return 0},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},heading:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},thematic_break:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},code_block:{continue:function(e,t){var n=e.currentLine,r=e.indent;if(t._isFenced){var i=r<=3&&n.charAt(e.nextNonspace)===t._fenceChar&&n.slice(e.nextNonspace).match(y);if(i&&i[0].length>=t._fenceLength)return e.finalize(t,e.lineNumber),2;for(var o=t._fenceOffset;o>0&&w(k(n,e.offset));)e.advanceOffset(1,!0),o--}else if(r>=4)e.advanceOffset(4,!0);else{if(!e.blank)return 1;e.advanceNextNonspace()}return 0},finalize:function(e,t){if(t._isFenced){var n=t._string_content,r=n.indexOf("\n"),i=n.slice(0,r),a=n.slice(r+1);t.info=o(i.trim()),t._literal=a}else t._literal=t._string_content.replace(/(\n *)+$/,"\n");t._string_content=null},canContain:function(){return!1},acceptsLines:!0},html_block:{continue:function(e,t){return!e.blank||6!==t._htmlBlockType&&7!==t._htmlBlockType?0:1},finalize:function(e,t){t._literal=t._string_content.replace(/(\n *)+$/,""),t._string_content=null},canContain:function(){return!1},acceptsLines:!0},paragraph:{continue:function(e){return e.blank?1:0},finalize:function(e,t){for(var n,r=!1;91===k(t._string_content,0)&&(n=e.inlineParser.parseReference(t._string_content,e.refmap));)t._string_content=t._string_content.slice(n),r=!0;r&&x(t._string_content)&&t.unlink()},canContain:function(){return!1},acceptsLines:!0}},T=[function(e){return e.indented||62!==k(e.currentLine,e.nextNonspace)?0:(e.advanceNextNonspace(),e.advanceOffset(1,!1),w(k(e.currentLine,e.offset))&&e.advanceOffset(1,!0),e.closeUnmatchedBlocks(),e.addChild("block_quote",e.nextNonspace),1)},function(e){var t;if(!e.indented&&(t=e.currentLine.slice(e.nextNonspace).match(v))){e.advanceNextNonspace(),e.advanceOffset(t[0].length,!1),e.closeUnmatchedBlocks();var n=e.addChild("heading",e.nextNonspace);return n.level=t[0].trim().length,n._string_content=e.currentLine.slice(e.offset).replace(/^[ \t]*#+[ \t]*$/,"").replace(/[ \t]+#+[ \t]*$/,""),e.advanceOffset(e.currentLine.length-e.offset),2}return 0},function(e){var t;if(!e.indented&&(t=e.currentLine.slice(e.nextNonspace).match(g))){var n=t[0].length;e.closeUnmatchedBlocks();var r=e.addChild("code_block",e.nextNonspace);return r._isFenced=!0,r._fenceLength=n,r._fenceChar=t[0][0],r._fenceOffset=e.indent,e.advanceNextNonspace(),e.advanceOffset(n,!1),2}return 0},function(e,t){if(!e.indented&&60===k(e.currentLine,e.nextNonspace)){var n,r=e.currentLine.slice(e.nextNonspace);for(n=1;n<=7;n++)if(l[n].test(r)&&(n<7||"paragraph"!==t.type)){e.closeUnmatchedBlocks();var i=e.addChild("html_block",e.offset);return i._htmlBlockType=n,2}}return 0},function(e,t){var n;if(!e.indented&&"paragraph"===t.type&&(n=e.currentLine.slice(e.nextNonspace).match(_))){e.closeUnmatchedBlocks();var r=new i("heading",t.sourcepos);return r.level="="===n[0][0]?1:2,r._string_content=t._string_content,t.insertAfter(r),t.unlink(),e.tip=r,e.advanceOffset(e.currentLine.length-e.offset,!1),2}return 0},function(e){return!e.indented&&p.test(e.currentLine.slice(e.nextNonspace))?(e.closeUnmatchedBlocks(),e.addChild("thematic_break",e.nextNonspace),e.advanceOffset(e.currentLine.length-e.offset,!1),2):0},function(e,t){var n;return e.indented&&"list"!==t.type||!(n=A(e,t))?0:(e.closeUnmatchedBlocks(),"list"===e.tip.type&&D(t._listData,n)||(t=e.addChild("list",e.nextNonspace),t._listData=n),t=e.addChild("item",e.nextNonspace),t._listData=n,1)},function(e){return e.indented&&"paragraph"!==e.tip.type&&!e.blank?(e.advanceOffset(4,!0),e.closeUnmatchedBlocks(),e.addChild("code_block",e.offset),2):0}],P=function(e,t){for(var n,r,i,o=this.currentLine;e>0&&(i=o[this.offset]);)"\t"===i?(n=4-this.column%4,t?(this.partiallyConsumedTab=n>e,r=n>e?e:n,this.column+=r,this.offset+=this.partiallyConsumedTab?0:1,e-=r):(this.partiallyConsumedTab=!1,this.column+=n,this.offset+=1,e-=1)):(this.partiallyConsumedTab=!1,this.offset+=1,this.column+=1,e-=1)},I=function(){this.offset=this.nextNonspace,this.column=this.nextNonspaceColumn,this.partiallyConsumedTab=!1},R=function(){for(var e,t=this.currentLine,n=this.offset,r=this.column;""!==(e=t.charAt(n));)if(" "===e)n++,r++;else{if("\t"!==e)break;n++,r+=4-r%4}this.blank="\n"===e||"\r"===e||""===e,this.nextNonspace=n,this.nextNonspaceColumn=r,this.indent=this.nextNonspaceColumn-this.column,this.indented=this.indent>=4},j=function(e){var t,n=!0,r=this.doc;this.oldtip=this.tip,this.offset=0,this.column=0,this.blank=!1,this.partiallyConsumedTab=!1,this.lineNumber+=1,-1!==e.indexOf("\0")&&(e=e.replace(/\0/g,"�")),this.currentLine=e;for(var i;(i=r._lastChild)&&i._open;){switch(r=i,this.findNextNonspace(),this.blocks[r.type].continue(this,r)){case 0:break;case 1:n=!1;break;case 2:return void(this.lastLineLength=e.length);default:throw"continue returned illegal value, must be 0, 1, or 2"}if(!n){r=r._parent;break}}this.allClosed=r===this.oldtip,this.lastMatchedContainer=r;for(var o="paragraph"!==r.type&&M[r.type].acceptsLines,a=this.blockStarts,s=a.length;!o;){if(this.findNextNonspace(),!this.indented&&!f.test(e.slice(this.nextNonspace))){this.advanceNextNonspace();break}for(var u=0;u<s;){var l=a[u](this,r);if(1===l){r=this.tip;break}if(2===l){r=this.tip,o=!0;break}u++}if(u===s){this.advanceNextNonspace();break}}if(this.allClosed||this.blank||"paragraph"!==this.tip.type){this.closeUnmatchedBlocks(),this.blank&&r.lastChild&&(r.lastChild._lastLineBlank=!0),t=r.type;for(var p=this.blank&&!("block_quote"===t||"code_block"===t&&r._isFenced||"item"===t&&!r._firstChild&&r.sourcepos[0][0]===this.lineNumber),h=r;h;)h._lastLineBlank=p,h=h._parent;this.blocks[t].acceptsLines?(this.addLine(),"html_block"===t&&r._htmlBlockType>=1&&r._htmlBlockType<=5&&c[r._htmlBlockType].test(this.currentLine.slice(this.offset))&&this.finalize(r,this.lineNumber)):this.offset<e.length&&!this.blank&&(r=this.addChild("paragraph",this.offset),this.advanceNextNonspace(),this.addLine())}else this.addLine();this.lastLineLength=e.length},F=function(e,t){var n=e._parent;e._open=!1,e.sourcepos[1]=[t,this.lastLineLength],this.blocks[e.type].finalize(this,e),this.tip=n},N=function(e){var t,n,r,i=e.walker();for(this.inlineParser.refmap=this.refmap,this.inlineParser.options=this.options;n=i.next();)t=n.node,r=t.type,n.entering||"paragraph"!==r&&"heading"!==r||this.inlineParser.parse(t)},B=function(){return new i("document",[[1,1],[0,0]])},L=function(e){this.doc=new B,this.tip=this.doc,this.refmap={},this.lineNumber=0,this.lastLineLength=0,this.offset=0,this.column=0,this.lastMatchedContainer=this.doc,this.currentLine="",this.options.time&&console.time("preparing input");var t=e.split(b),n=t.length;10===e.charCodeAt(e.length-1)&&(n-=1),this.options.time&&console.timeEnd("preparing input"),this.options.time&&console.time("block parsing");for(var r=0;r<n;r++)this.incorporateLine(t[r]);for(;this.tip;)this.finalize(this.tip,n);return this.options.time&&console.timeEnd("block parsing"),this.options.time&&console.time("inline parsing"),this.processInlines(this.doc),this.options.time&&console.timeEnd("inline parsing"),this.doc};e.exports=r},function(e,t,n){"use strict";/*! http://mths.be/fromcodepoint v0.2.1 by @mathias */ -if(String.fromCodePoint)e.exports=function(e){try{return String.fromCodePoint(e)}catch(e){if(e instanceof RangeError)return String.fromCharCode(65533);throw e}};else{var r=String.fromCharCode,i=Math.floor,o=function(){var e,t,n=[],o=-1,a=arguments.length;if(!a)return"";for(var s="";++o<a;){var u=Number(arguments[o]);if(!isFinite(u)||u<0||u>1114111||i(u)!==u)return String.fromCharCode(65533);u<=65535?n.push(u):(u-=65536,e=55296+(u>>10),t=u%1024+56320,n.push(e,t)),(o+1===a||n.length>16384)&&(s+=r.apply(null,n),n.length=0)}return s};e.exports=o}},function(e,t,n){"use strict";e.exports.Node=n(174),e.exports.Parser=n(575),e.exports.HtmlRenderer=n(580),e.exports.XmlRenderer=n(581)},function(e,t,n){"use strict";function r(e){return{subject:"",delimiters:null,brackets:null,pos:0,refmap:{},match:F,peek:N,spnl:B,parseBackticks:L,parseBackslash:q,parseAutolink:z,parseHtmlTag:U,scanDelims:W,handleDelim:V,parseLinkTitle:K,parseLinkDestination:X,parseLinkLabel:Y,parseOpenBracket:$,parseBang:Z,parseCloseBracket:Q,addBracket:ee,removeBracket:te,parseEntity:ne,parseString:re,parseNewline:ie,parseReference:oe,parseInline:ae,processEmphasis:J,removeDelimiter:H,options:e||{},parse:se}}var i=n(174),o=n(73),a=n(579),s=o.normalizeURI,u=o.unescapeString,l=n(576),c=n(114).decodeHTML;n(494);var p=o.ESCAPABLE,f="\\\\"+p,h=o.ENTITY,d=o.reHtmlTag,m=new RegExp(/[!"#$%&'()*+,\-.\/:;<=>?@\[\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/),v=new RegExp('^(?:"('+f+'|[^"\\x00])*"|\'('+f+"|[^'\\x00])*'|\\(("+f+"|[^)\\x00])*\\))"),g=new RegExp("^(?:[<](?:[^ <>\\t\\n\\\\\\x00]|"+f+"|\\\\)*[>])"),y=new RegExp("^"+p),_=new RegExp("^"+h,"i"),b=/`+/,x=/^`+/,w=/\.\.\./g,k=/--+/g,E=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,S=/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>/i,C=/^ *(?:\n *)?/,A=/^[ \t\n\x0b\x0c\x0d]/,D=/[ \t\n\x0b\x0c\x0d]+/g,O=/^\s/,M=/ *$/,T=/^ */,P=/^ *(?:\n|$)/,I=new RegExp("^\\[(?:[^\\\\\\[\\]]|"+f+"|\\\\){0,1000}\\]"),R=/^[^\n`\[\]\\!<&*_'"]+/m,j=function(e){var t=new i("text");return t._literal=e,t},F=function(e){var t=e.exec(this.subject.slice(this.pos));return null===t?null:(this.pos+=t.index+t[0].length,t[0])},N=function(){return this.pos<this.subject.length?this.subject.charCodeAt(this.pos):-1},B=function(){return this.match(C),!0},L=function(e){var t=this.match(x);if(null===t)return!1;for(var n,r,o=this.pos;null!==(n=this.match(b));)if(n===t)return r=new i("code"),r._literal=this.subject.slice(o,this.pos-t.length).trim().replace(D," "),e.appendChild(r),!0;return this.pos=o,e.appendChild(j(t)),!0},q=function(e){var t,n=this.subject;return this.pos+=1,10===this.peek()?(this.pos+=1,t=new i("linebreak"),e.appendChild(t)):y.test(n.charAt(this.pos))?(e.appendChild(j(n.charAt(this.pos))),this.pos+=1):e.appendChild(j("\\")),!0},z=function(e){var t,n,r;return(t=this.match(E))?(n=t.slice(1,t.length-1),r=new i("link"),r._destination=s("mailto:"+n),r._title="",r.appendChild(j(n)),e.appendChild(r),!0):!!(t=this.match(S))&&(n=t.slice(1,t.length-1),r=new i("link"),r._destination=s(n),r._title="",r.appendChild(j(n)),e.appendChild(r),!0)},U=function(e){var t=this.match(d);if(null===t)return!1;var n=new i("html_inline");return n._literal=t,e.appendChild(n),!0},W=function(e){var t,n,r,i,o,a,s,u,c,p,f,h=0,d=this.pos;if(39===e||34===e)h++,this.pos++;else for(;this.peek()===e;)h++,this.pos++;return 0===h?null:(t=0===d?"\n":this.subject.charAt(d-1),r=this.peek(),n=-1===r?"\n":l(r),u=O.test(n),c=m.test(n),p=O.test(t),f=m.test(t),i=!u&&(!c||p||f),o=!p&&(!f||u||c),95===e?(a=i&&(!o||f),s=o&&(!i||c)):39===e||34===e?(a=i&&!o,s=o):(a=i,s=o),this.pos=d,{numdelims:h,can_open:a,can_close:s})},V=function(e,t){var n=this.scanDelims(e);if(!n)return!1;var r,i=n.numdelims,o=this.pos;this.pos+=i,r=39===e?"’":34===e?"“":this.subject.slice(o,this.pos);var a=j(r);return t.appendChild(a),this.delimiters={cc:e,numdelims:i,origdelims:i,node:a,previous:this.delimiters,next:null,can_open:n.can_open,can_close:n.can_close},null!==this.delimiters.previous&&(this.delimiters.previous.next=this.delimiters),!0},H=function(e){null!==e.previous&&(e.previous.next=e.next),null===e.next?this.delimiters=e.previous:e.next.previous=e.previous},G=function(e,t){e.next!==t&&(e.next=t,t.previous=e)},J=function(e){var t,n,r,o,a,s,u,l,c,p,f=[],h=!1;for(f[95]=e,f[42]=e,f[39]=e,f[34]=e,n=this.delimiters;null!==n&&n.previous!==e;)n=n.previous;for(;null!==n;){var d=n.cc;if(n.can_close){for(t=n.previous,p=!1;null!==t&&t!==e&&t!==f[d];){if(h=(n.can_open||t.can_close)&&(t.origdelims+n.origdelims)%3==0,t.cc===n.cc&&t.can_open&&!h){p=!0;break}t=t.previous}if(r=n,42===d||95===d)if(p){u=n.numdelims>=2&&t.numdelims>=2?2:1,o=t.node,a=n.node,t.numdelims-=u,n.numdelims-=u,o._literal=o._literal.slice(0,o._literal.length-u),a._literal=a._literal.slice(0,a._literal.length-u);var m=new i(1===u?"emph":"strong");for(l=o._next;l&&l!==a;)c=l._next,l.unlink(),m.appendChild(l),l=c;o.insertAfter(m),G(t,n),0===t.numdelims&&(o.unlink(),this.removeDelimiter(t)),0===n.numdelims&&(a.unlink(),s=n.next,this.removeDelimiter(n),n=s)}else n=n.next;else 39===d?(n.node._literal="’",p&&(t.node._literal="‘"),n=n.next):34===d&&(n.node._literal="”",p&&(t.node.literal="“"),n=n.next);p||h||(f[d]=r.previous,r.can_open||this.removeDelimiter(r))}else n=n.next}for(;null!==this.delimiters&&this.delimiters!==e;)this.removeDelimiter(this.delimiters)},K=function(){var e=this.match(v);return null===e?null:u(e.substr(1,e.length-2))},X=function(){var e=this.match(g);if(null===e){for(var t,n=this.pos,r=0;-1!==(t=this.peek());)if(92===t)this.pos+=1,-1!==this.peek()&&(this.pos+=1);else if(40===t)this.pos+=1,r+=1;else if(41===t){if(r<1)break;this.pos+=1,r-=1}else{if(null!==A.exec(l(t)))break;this.pos+=1}return e=this.subject.substr(n,this.pos-n),s(u(e))}return s(u(e.substr(1,e.length-2)))},Y=function(){var e=this.match(I);return null===e||e.length>1001||/[^\\]\\\]$/.exec(e)?0:e.length},$=function(e){var t=this.pos;this.pos+=1;var n=j("[");return e.appendChild(n),this.addBracket(n,t,!1),!0},Z=function(e){var t=this.pos;if(this.pos+=1,91===this.peek()){this.pos+=1;var n=j("![");e.appendChild(n),this.addBracket(n,t+1,!0)}else e.appendChild(j("!"));return!0},Q=function(e){var t,n,r,o,s,u,l=!1;if(this.pos+=1,t=this.pos,null===(u=this.brackets))return e.appendChild(j("]")),!0;if(!u.active)return e.appendChild(j("]")),this.removeBracket(),!0;n=u.image;var c=this.pos;if(40===this.peek()&&(this.pos++,this.spnl()&&null!==(r=this.parseLinkDestination())&&this.spnl()&&(A.test(this.subject.charAt(this.pos-1))&&(o=this.parseLinkTitle()),!0)&&this.spnl()&&41===this.peek()?(this.pos+=1,l=!0):this.pos=c),!l){var p=this.pos,f=this.parseLinkLabel();if(f>2?s=this.subject.slice(p,p+f):u.bracketAfter||(s=this.subject.slice(u.index,t)),0===f&&(this.pos=c),s){var h=this.refmap[a(s)];h&&(r=h.destination,o=h.title,l=!0)}}if(l){var d=new i(n?"image":"link");d._destination=r,d._title=o||"";var m,v;for(m=u.node._next;m;)v=m._next,m.unlink(),d.appendChild(m),m=v;if(e.appendChild(d),this.processEmphasis(u.previousDelimiter),this.removeBracket(),u.node.unlink(),!n)for(u=this.brackets;null!==u;)u.image||(u.active=!1),u=u.previous;return!0}return this.removeBracket(),this.pos=t,e.appendChild(j("]")),!0},ee=function(e,t,n){null!==this.brackets&&(this.brackets.bracketAfter=!0),this.brackets={node:e,previous:this.brackets,previousDelimiter:this.delimiters,index:t,image:n,active:!0}},te=function(){this.brackets=this.brackets.previous},ne=function(e){var t;return!!(t=this.match(_))&&(e.appendChild(j(c(t))),!0)},re=function(e){var t;return!!(t=this.match(R))&&(this.options.smart?e.appendChild(j(t.replace(w,"…").replace(k,function(e){var t=0,n=0;return e.length%3==0?n=e.length/3:e.length%2==0?t=e.length/2:e.length%3==2?(t=1,n=(e.length-2)/3):(t=2,n=(e.length-4)/3),"—".repeat(n)+"–".repeat(t)}))):e.appendChild(j(t)),!0)},ie=function(e){this.pos+=1;var t=e._lastChild;if(t&&"text"===t.type&&" "===t._literal[t._literal.length-1]){var n=" "===t._literal[t._literal.length-2];t._literal=t._literal.replace(M,""),e.appendChild(new i(n?"linebreak":"softbreak"))}else e.appendChild(new i("softbreak"));return this.match(T),!0},oe=function(e,t){this.subject=e,this.pos=0;var n,r,i,o,s=this.pos;if(0===(o=this.parseLinkLabel()))return 0;if(n=this.subject.substr(0,o),58!==this.peek())return this.pos=s,0;if(this.pos++,this.spnl(),null===(r=this.parseLinkDestination())||0===r.length)return this.pos=s,0;var u=this.pos;this.spnl(),null===(i=this.parseLinkTitle())&&(i="",this.pos=u);var l=!0;if(null===this.match(P)&&(""===i?l=!1:(i="",this.pos=u,l=null!==this.match(P))),!l)return this.pos=s,0;var c=a(n);return""===c?(this.pos=s,0):(t[c]||(t[c]={destination:r,title:i}),this.pos-s)},ae=function(e){var t=!1,n=this.peek();if(-1===n)return!1;switch(n){case 10:t=this.parseNewline(e);break;case 92:t=this.parseBackslash(e);break;case 96:t=this.parseBackticks(e);break;case 42:case 95:t=this.handleDelim(n,e);break;case 39:case 34:t=this.options.smart&&this.handleDelim(n,e);break;case 91:t=this.parseOpenBracket(e);break;case 33:t=this.parseBang(e);break;case 93:t=this.parseCloseBracket(e);break;case 60:t=this.parseAutolink(e)||this.parseHtmlTag(e);break;case 38:t=this.parseEntity(e);break;default:t=this.parseString(e)}return t||(this.pos+=1,e.appendChild(j(l(n)))),!0},se=function(e){for(this.subject=e._string_content.trim(),this.pos=0,this.delimiters=null,this.brackets=null;this.parseInline(e););e._string_content=null,this.processEmphasis(null)};e.exports=r},function(e,t,n){"use strict";var r=/[ \t\r\n]+|[A-Z\xB5\xC0-\xD6\xD8-\xDF\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u0149\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u017F\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C5\u01C7\u01C8\u01CA\u01CB\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F0-\u01F2\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0345\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03AB\u03B0\u03C2\u03CF-\u03D1\u03D5\u03D6\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F0\u03F1\u03F4\u03F5\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u0587\u10A0-\u10C5\u10C7\u10CD\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E96-\u1E9B\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F50\u1F52\u1F54\u1F56\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1F80-\u1FAF\u1FB2-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD2\u1FD3\u1FD6-\u1FDB\u1FE2-\u1FE4\u1FE6-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A\u212B\u2132\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AD\uA7B0\uA7B1\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A]|\uD801[\uDC00-\uDC27]|\uD806[\uDCA0-\uDCBF]/g,i={A:"a",B:"b",C:"c",D:"d",E:"e",F:"f",G:"g",H:"h",I:"i",J:"j",K:"k",L:"l",M:"m",N:"n",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",U:"u",V:"v",W:"w",X:"x",Y:"y",Z:"z","µ":"μ","À":"à","Á":"á","Â":"â","Ã":"ã","Ä":"ä","Å":"å","Æ":"æ","Ç":"ç","È":"è","É":"é","Ê":"ê","Ë":"ë","Ì":"ì","Í":"í","Î":"î","Ï":"ï","Ð":"ð","Ñ":"ñ","Ò":"ò","Ó":"ó","Ô":"ô","Õ":"õ","Ö":"ö","Ø":"ø","Ù":"ù","Ú":"ú","Û":"û","Ü":"ü","Ý":"ý","Þ":"þ","Ā":"ā","Ă":"ă","Ą":"ą","Ć":"ć","Ĉ":"ĉ","Ċ":"ċ","Č":"č","Ď":"ď","Đ":"đ","Ē":"ē","Ĕ":"ĕ","Ė":"ė","Ę":"ę","Ě":"ě","Ĝ":"ĝ","Ğ":"ğ","Ġ":"ġ","Ģ":"ģ","Ĥ":"ĥ","Ħ":"ħ","Ĩ":"ĩ","Ī":"ī","Ĭ":"ĭ","Į":"į","IJ":"ij","Ĵ":"ĵ","Ķ":"ķ","Ĺ":"ĺ","Ļ":"ļ","Ľ":"ľ","Ŀ":"ŀ","Ł":"ł","Ń":"ń","Ņ":"ņ","Ň":"ň","Ŋ":"ŋ","Ō":"ō","Ŏ":"ŏ","Ő":"ő","Œ":"œ","Ŕ":"ŕ","Ŗ":"ŗ","Ř":"ř","Ś":"ś","Ŝ":"ŝ","Ş":"ş","Š":"š","Ţ":"ţ","Ť":"ť","Ŧ":"ŧ","Ũ":"ũ","Ū":"ū","Ŭ":"ŭ","Ů":"ů","Ű":"ű","Ų":"ų","Ŵ":"ŵ","Ŷ":"ŷ","Ÿ":"ÿ","Ź":"ź","Ż":"ż","Ž":"ž","ſ":"s","Ɓ":"ɓ","Ƃ":"ƃ","Ƅ":"ƅ","Ɔ":"ɔ","Ƈ":"ƈ","Ɖ":"ɖ","Ɗ":"ɗ","Ƌ":"ƌ","Ǝ":"ǝ","Ə":"ə","Ɛ":"ɛ","Ƒ":"ƒ","Ɠ":"ɠ","Ɣ":"ɣ","Ɩ":"ɩ","Ɨ":"ɨ","Ƙ":"ƙ","Ɯ":"ɯ","Ɲ":"ɲ","Ɵ":"ɵ","Ơ":"ơ","Ƣ":"ƣ","Ƥ":"ƥ","Ʀ":"ʀ","Ƨ":"ƨ","Ʃ":"ʃ","Ƭ":"ƭ","Ʈ":"ʈ","Ư":"ư","Ʊ":"ʊ","Ʋ":"ʋ","Ƴ":"ƴ","Ƶ":"ƶ","Ʒ":"ʒ","Ƹ":"ƹ","Ƽ":"ƽ","DŽ":"dž","Dž":"dž","LJ":"lj","Lj":"lj","NJ":"nj","Nj":"nj","Ǎ":"ǎ","Ǐ":"ǐ","Ǒ":"ǒ","Ǔ":"ǔ","Ǖ":"ǖ","Ǘ":"ǘ","Ǚ":"ǚ","Ǜ":"ǜ","Ǟ":"ǟ","Ǡ":"ǡ","Ǣ":"ǣ","Ǥ":"ǥ","Ǧ":"ǧ","Ǩ":"ǩ","Ǫ":"ǫ","Ǭ":"ǭ","Ǯ":"ǯ","DZ":"dz","Dz":"dz","Ǵ":"ǵ","Ƕ":"ƕ","Ƿ":"ƿ","Ǹ":"ǹ","Ǻ":"ǻ","Ǽ":"ǽ","Ǿ":"ǿ","Ȁ":"ȁ","Ȃ":"ȃ","Ȅ":"ȅ","Ȇ":"ȇ","Ȉ":"ȉ","Ȋ":"ȋ","Ȍ":"ȍ","Ȏ":"ȏ","Ȑ":"ȑ","Ȓ":"ȓ","Ȕ":"ȕ","Ȗ":"ȗ","Ș":"ș","Ț":"ț","Ȝ":"ȝ","Ȟ":"ȟ","Ƞ":"ƞ","Ȣ":"ȣ","Ȥ":"ȥ","Ȧ":"ȧ","Ȩ":"ȩ","Ȫ":"ȫ","Ȭ":"ȭ","Ȯ":"ȯ","Ȱ":"ȱ","Ȳ":"ȳ","Ⱥ":"ⱥ","Ȼ":"ȼ","Ƚ":"ƚ","Ⱦ":"ⱦ","Ɂ":"ɂ","Ƀ":"ƀ","Ʉ":"ʉ","Ʌ":"ʌ","Ɇ":"ɇ","Ɉ":"ɉ","Ɋ":"ɋ","Ɍ":"ɍ","Ɏ":"ɏ","ͅ":"ι","Ͱ":"ͱ","Ͳ":"ͳ","Ͷ":"ͷ","Ϳ":"ϳ","Ά":"ά","Έ":"έ","Ή":"ή","Ί":"ί","Ό":"ό","Ύ":"ύ","Ώ":"ώ","Α":"α","Β":"β","Γ":"γ","Δ":"δ","Ε":"ε","Ζ":"ζ","Η":"η","Θ":"θ","Ι":"ι","Κ":"κ","Λ":"λ","Μ":"μ","Ν":"ν","Ξ":"ξ","Ο":"ο","Π":"π","Ρ":"ρ","Σ":"σ","Τ":"τ","Υ":"υ","Φ":"φ","Χ":"χ","Ψ":"ψ","Ω":"ω","Ϊ":"ϊ","Ϋ":"ϋ","ς":"σ","Ϗ":"ϗ","ϐ":"β","ϑ":"θ","ϕ":"φ","ϖ":"π","Ϙ":"ϙ","Ϛ":"ϛ","Ϝ":"ϝ","Ϟ":"ϟ","Ϡ":"ϡ","Ϣ":"ϣ","Ϥ":"ϥ","Ϧ":"ϧ","Ϩ":"ϩ","Ϫ":"ϫ","Ϭ":"ϭ","Ϯ":"ϯ","ϰ":"κ","ϱ":"ρ","ϴ":"θ","ϵ":"ε","Ϸ":"ϸ","Ϲ":"ϲ","Ϻ":"ϻ","Ͻ":"ͻ","Ͼ":"ͼ","Ͽ":"ͽ","Ѐ":"ѐ","Ё":"ё","Ђ":"ђ","Ѓ":"ѓ","Є":"є","Ѕ":"ѕ","І":"і","Ї":"ї","Ј":"ј","Љ":"љ","Њ":"њ","Ћ":"ћ","Ќ":"ќ","Ѝ":"ѝ","Ў":"ў","Џ":"џ","А":"а","Б":"б","В":"в","Г":"г","Д":"д","Е":"е","Ж":"ж","З":"з","И":"и","Й":"й","К":"к","Л":"л","М":"м","Н":"н","О":"о","П":"п","Р":"р","С":"с","Т":"т","У":"у","Ф":"ф","Х":"х","Ц":"ц","Ч":"ч","Ш":"ш","Щ":"щ","Ъ":"ъ","Ы":"ы","Ь":"ь","Э":"э","Ю":"ю","Я":"я","Ѡ":"ѡ","Ѣ":"ѣ","Ѥ":"ѥ","Ѧ":"ѧ","Ѩ":"ѩ","Ѫ":"ѫ","Ѭ":"ѭ","Ѯ":"ѯ","Ѱ":"ѱ","Ѳ":"ѳ","Ѵ":"ѵ","Ѷ":"ѷ","Ѹ":"ѹ","Ѻ":"ѻ","Ѽ":"ѽ","Ѿ":"ѿ","Ҁ":"ҁ","Ҋ":"ҋ","Ҍ":"ҍ","Ҏ":"ҏ","Ґ":"ґ","Ғ":"ғ","Ҕ":"ҕ","Җ":"җ","Ҙ":"ҙ","Қ":"қ","Ҝ":"ҝ","Ҟ":"ҟ","Ҡ":"ҡ","Ң":"ң","Ҥ":"ҥ","Ҧ":"ҧ","Ҩ":"ҩ","Ҫ":"ҫ","Ҭ":"ҭ","Ү":"ү","Ұ":"ұ","Ҳ":"ҳ","Ҵ":"ҵ","Ҷ":"ҷ","Ҹ":"ҹ","Һ":"һ","Ҽ":"ҽ","Ҿ":"ҿ","Ӏ":"ӏ","Ӂ":"ӂ","Ӄ":"ӄ","Ӆ":"ӆ","Ӈ":"ӈ","Ӊ":"ӊ","Ӌ":"ӌ","Ӎ":"ӎ","Ӑ":"ӑ","Ӓ":"ӓ","Ӕ":"ӕ","Ӗ":"ӗ","Ә":"ә","Ӛ":"ӛ","Ӝ":"ӝ","Ӟ":"ӟ","Ӡ":"ӡ","Ӣ":"ӣ","Ӥ":"ӥ","Ӧ":"ӧ","Ө":"ө","Ӫ":"ӫ","Ӭ":"ӭ","Ӯ":"ӯ","Ӱ":"ӱ","Ӳ":"ӳ","Ӵ":"ӵ","Ӷ":"ӷ","Ӹ":"ӹ","Ӻ":"ӻ","Ӽ":"ӽ","Ӿ":"ӿ","Ԁ":"ԁ","Ԃ":"ԃ","Ԅ":"ԅ","Ԇ":"ԇ","Ԉ":"ԉ","Ԋ":"ԋ","Ԍ":"ԍ","Ԏ":"ԏ","Ԑ":"ԑ","Ԓ":"ԓ","Ԕ":"ԕ","Ԗ":"ԗ","Ԙ":"ԙ","Ԛ":"ԛ","Ԝ":"ԝ","Ԟ":"ԟ","Ԡ":"ԡ","Ԣ":"ԣ","Ԥ":"ԥ","Ԧ":"ԧ","Ԩ":"ԩ","Ԫ":"ԫ","Ԭ":"ԭ","Ԯ":"ԯ","Ա":"ա","Բ":"բ","Գ":"գ","Դ":"դ","Ե":"ե","Զ":"զ","Է":"է","Ը":"ը","Թ":"թ","Ժ":"ժ","Ի":"ի","Լ":"լ","Խ":"խ","Ծ":"ծ","Կ":"կ","Հ":"հ","Ձ":"ձ","Ղ":"ղ","Ճ":"ճ","Մ":"մ","Յ":"յ","Ն":"ն","Շ":"շ","Ո":"ո","Չ":"չ","Պ":"պ","Ջ":"ջ","Ռ":"ռ","Ս":"ս","Վ":"վ","Տ":"տ","Ր":"ր","Ց":"ց","Ւ":"ւ","Փ":"փ","Ք":"ք","Օ":"օ","Ֆ":"ֆ","Ⴀ":"ⴀ","Ⴁ":"ⴁ","Ⴂ":"ⴂ","Ⴃ":"ⴃ","Ⴄ":"ⴄ","Ⴅ":"ⴅ","Ⴆ":"ⴆ","Ⴇ":"ⴇ","Ⴈ":"ⴈ","Ⴉ":"ⴉ","Ⴊ":"ⴊ","Ⴋ":"ⴋ","Ⴌ":"ⴌ","Ⴍ":"ⴍ","Ⴎ":"ⴎ","Ⴏ":"ⴏ","Ⴐ":"ⴐ","Ⴑ":"ⴑ","Ⴒ":"ⴒ","Ⴓ":"ⴓ","Ⴔ":"ⴔ","Ⴕ":"ⴕ","Ⴖ":"ⴖ","Ⴗ":"ⴗ","Ⴘ":"ⴘ","Ⴙ":"ⴙ","Ⴚ":"ⴚ","Ⴛ":"ⴛ","Ⴜ":"ⴜ","Ⴝ":"ⴝ","Ⴞ":"ⴞ","Ⴟ":"ⴟ","Ⴠ":"ⴠ","Ⴡ":"ⴡ","Ⴢ":"ⴢ","Ⴣ":"ⴣ","Ⴤ":"ⴤ","Ⴥ":"ⴥ","Ⴧ":"ⴧ","Ⴭ":"ⴭ","Ḁ":"ḁ","Ḃ":"ḃ","Ḅ":"ḅ","Ḇ":"ḇ","Ḉ":"ḉ","Ḋ":"ḋ","Ḍ":"ḍ","Ḏ":"ḏ","Ḑ":"ḑ","Ḓ":"ḓ","Ḕ":"ḕ","Ḗ":"ḗ","Ḙ":"ḙ","Ḛ":"ḛ","Ḝ":"ḝ","Ḟ":"ḟ","Ḡ":"ḡ","Ḣ":"ḣ","Ḥ":"ḥ","Ḧ":"ḧ","Ḩ":"ḩ","Ḫ":"ḫ","Ḭ":"ḭ","Ḯ":"ḯ","Ḱ":"ḱ","Ḳ":"ḳ","Ḵ":"ḵ","Ḷ":"ḷ","Ḹ":"ḹ","Ḻ":"ḻ","Ḽ":"ḽ","Ḿ":"ḿ","Ṁ":"ṁ","Ṃ":"ṃ","Ṅ":"ṅ","Ṇ":"ṇ","Ṉ":"ṉ","Ṋ":"ṋ","Ṍ":"ṍ","Ṏ":"ṏ","Ṑ":"ṑ","Ṓ":"ṓ","Ṕ":"ṕ","Ṗ":"ṗ","Ṙ":"ṙ","Ṛ":"ṛ","Ṝ":"ṝ","Ṟ":"ṟ","Ṡ":"ṡ","Ṣ":"ṣ","Ṥ":"ṥ","Ṧ":"ṧ","Ṩ":"ṩ","Ṫ":"ṫ","Ṭ":"ṭ","Ṯ":"ṯ","Ṱ":"ṱ","Ṳ":"ṳ","Ṵ":"ṵ","Ṷ":"ṷ","Ṹ":"ṹ","Ṻ":"ṻ","Ṽ":"ṽ","Ṿ":"ṿ","Ẁ":"ẁ","Ẃ":"ẃ","Ẅ":"ẅ","Ẇ":"ẇ","Ẉ":"ẉ","Ẋ":"ẋ","Ẍ":"ẍ","Ẏ":"ẏ","Ẑ":"ẑ","Ẓ":"ẓ","Ẕ":"ẕ","ẛ":"ṡ","Ạ":"ạ","Ả":"ả","Ấ":"ấ","Ầ":"ầ","Ẩ":"ẩ","Ẫ":"ẫ","Ậ":"ậ","Ắ":"ắ","Ằ":"ằ","Ẳ":"ẳ","Ẵ":"ẵ","Ặ":"ặ","Ẹ":"ẹ","Ẻ":"ẻ","Ẽ":"ẽ","Ế":"ế","Ề":"ề","Ể":"ể","Ễ":"ễ","Ệ":"ệ","Ỉ":"ỉ","Ị":"ị","Ọ":"ọ","Ỏ":"ỏ","Ố":"ố","Ồ":"ồ","Ổ":"ổ","Ỗ":"ỗ","Ộ":"ộ","Ớ":"ớ","Ờ":"ờ","Ở":"ở","Ỡ":"ỡ","Ợ":"ợ","Ụ":"ụ","Ủ":"ủ","Ứ":"ứ","Ừ":"ừ","Ử":"ử","Ữ":"ữ","Ự":"ự","Ỳ":"ỳ","Ỵ":"ỵ","Ỷ":"ỷ","Ỹ":"ỹ","Ỻ":"ỻ","Ỽ":"ỽ","Ỿ":"ỿ","Ἀ":"ἀ","Ἁ":"ἁ","Ἂ":"ἂ","Ἃ":"ἃ","Ἄ":"ἄ","Ἅ":"ἅ","Ἆ":"ἆ","Ἇ":"ἇ","Ἐ":"ἐ","Ἑ":"ἑ","Ἒ":"ἒ","Ἓ":"ἓ","Ἔ":"ἔ","Ἕ":"ἕ","Ἠ":"ἠ","Ἡ":"ἡ","Ἢ":"ἢ","Ἣ":"ἣ","Ἤ":"ἤ","Ἥ":"ἥ","Ἦ":"ἦ","Ἧ":"ἧ","Ἰ":"ἰ","Ἱ":"ἱ","Ἲ":"ἲ","Ἳ":"ἳ","Ἴ":"ἴ","Ἵ":"ἵ","Ἶ":"ἶ","Ἷ":"ἷ","Ὀ":"ὀ","Ὁ":"ὁ","Ὂ":"ὂ","Ὃ":"ὃ","Ὄ":"ὄ","Ὅ":"ὅ","Ὑ":"ὑ","Ὓ":"ὓ","Ὕ":"ὕ","Ὗ":"ὗ","Ὠ":"ὠ","Ὡ":"ὡ","Ὢ":"ὢ","Ὣ":"ὣ","Ὤ":"ὤ","Ὥ":"ὥ","Ὦ":"ὦ","Ὧ":"ὧ","Ᾰ":"ᾰ","Ᾱ":"ᾱ","Ὰ":"ὰ","Ά":"ά","ι":"ι","Ὲ":"ὲ","Έ":"έ","Ὴ":"ὴ","Ή":"ή","Ῐ":"ῐ","Ῑ":"ῑ","Ὶ":"ὶ","Ί":"ί","Ῠ":"ῠ","Ῡ":"ῡ","Ὺ":"ὺ","Ύ":"ύ","Ῥ":"ῥ","Ὸ":"ὸ","Ό":"ό","Ὼ":"ὼ","Ώ":"ώ","Ω":"ω","K":"k","Å":"å","Ⅎ":"ⅎ","Ⅰ":"ⅰ","Ⅱ":"ⅱ","Ⅲ":"ⅲ","Ⅳ":"ⅳ","Ⅴ":"ⅴ","Ⅵ":"ⅵ","Ⅶ":"ⅶ","Ⅷ":"ⅷ","Ⅸ":"ⅸ","Ⅹ":"ⅹ","Ⅺ":"ⅺ","Ⅻ":"ⅻ","Ⅼ":"ⅼ","Ⅽ":"ⅽ","Ⅾ":"ⅾ","Ⅿ":"ⅿ","Ↄ":"ↄ","Ⓐ":"ⓐ","Ⓑ":"ⓑ","Ⓒ":"ⓒ","Ⓓ":"ⓓ","Ⓔ":"ⓔ","Ⓕ":"ⓕ","Ⓖ":"ⓖ","Ⓗ":"ⓗ","Ⓘ":"ⓘ","Ⓙ":"ⓙ","Ⓚ":"ⓚ","Ⓛ":"ⓛ","Ⓜ":"ⓜ","Ⓝ":"ⓝ","Ⓞ":"ⓞ","Ⓟ":"ⓟ","Ⓠ":"ⓠ","Ⓡ":"ⓡ","Ⓢ":"ⓢ","Ⓣ":"ⓣ","Ⓤ":"ⓤ","Ⓥ":"ⓥ","Ⓦ":"ⓦ","Ⓧ":"ⓧ","Ⓨ":"ⓨ","Ⓩ":"ⓩ","Ⰰ":"ⰰ","Ⰱ":"ⰱ","Ⰲ":"ⰲ","Ⰳ":"ⰳ","Ⰴ":"ⰴ","Ⰵ":"ⰵ","Ⰶ":"ⰶ","Ⰷ":"ⰷ","Ⰸ":"ⰸ","Ⰹ":"ⰹ","Ⰺ":"ⰺ","Ⰻ":"ⰻ","Ⰼ":"ⰼ","Ⰽ":"ⰽ","Ⰾ":"ⰾ","Ⰿ":"ⰿ","Ⱀ":"ⱀ","Ⱁ":"ⱁ","Ⱂ":"ⱂ","Ⱃ":"ⱃ","Ⱄ":"ⱄ","Ⱅ":"ⱅ","Ⱆ":"ⱆ","Ⱇ":"ⱇ","Ⱈ":"ⱈ","Ⱉ":"ⱉ","Ⱊ":"ⱊ","Ⱋ":"ⱋ","Ⱌ":"ⱌ","Ⱍ":"ⱍ","Ⱎ":"ⱎ","Ⱏ":"ⱏ","Ⱐ":"ⱐ","Ⱑ":"ⱑ","Ⱒ":"ⱒ","Ⱓ":"ⱓ","Ⱔ":"ⱔ","Ⱕ":"ⱕ","Ⱖ":"ⱖ","Ⱗ":"ⱗ","Ⱘ":"ⱘ","Ⱙ":"ⱙ","Ⱚ":"ⱚ","Ⱛ":"ⱛ","Ⱜ":"ⱜ","Ⱝ":"ⱝ","Ⱞ":"ⱞ","Ⱡ":"ⱡ","Ɫ":"ɫ","Ᵽ":"ᵽ","Ɽ":"ɽ","Ⱨ":"ⱨ","Ⱪ":"ⱪ","Ⱬ":"ⱬ","Ɑ":"ɑ","Ɱ":"ɱ","Ɐ":"ɐ","Ɒ":"ɒ","Ⱳ":"ⱳ","Ⱶ":"ⱶ","Ȿ":"ȿ","Ɀ":"ɀ","Ⲁ":"ⲁ","Ⲃ":"ⲃ","Ⲅ":"ⲅ","Ⲇ":"ⲇ","Ⲉ":"ⲉ","Ⲋ":"ⲋ","Ⲍ":"ⲍ","Ⲏ":"ⲏ","Ⲑ":"ⲑ","Ⲓ":"ⲓ","Ⲕ":"ⲕ","Ⲗ":"ⲗ","Ⲙ":"ⲙ","Ⲛ":"ⲛ","Ⲝ":"ⲝ","Ⲟ":"ⲟ","Ⲡ":"ⲡ","Ⲣ":"ⲣ","Ⲥ":"ⲥ","Ⲧ":"ⲧ","Ⲩ":"ⲩ","Ⲫ":"ⲫ","Ⲭ":"ⲭ","Ⲯ":"ⲯ","Ⲱ":"ⲱ","Ⲳ":"ⲳ","Ⲵ":"ⲵ","Ⲷ":"ⲷ","Ⲹ":"ⲹ","Ⲻ":"ⲻ","Ⲽ":"ⲽ","Ⲿ":"ⲿ","Ⳁ":"ⳁ","Ⳃ":"ⳃ","Ⳅ":"ⳅ","Ⳇ":"ⳇ","Ⳉ":"ⳉ","Ⳋ":"ⳋ","Ⳍ":"ⳍ","Ⳏ":"ⳏ","Ⳑ":"ⳑ","Ⳓ":"ⳓ","Ⳕ":"ⳕ","Ⳗ":"ⳗ","Ⳙ":"ⳙ","Ⳛ":"ⳛ","Ⳝ":"ⳝ","Ⳟ":"ⳟ","Ⳡ":"ⳡ","Ⳣ":"ⳣ","Ⳬ":"ⳬ","Ⳮ":"ⳮ","Ⳳ":"ⳳ","Ꙁ":"ꙁ","Ꙃ":"ꙃ","Ꙅ":"ꙅ","Ꙇ":"ꙇ","Ꙉ":"ꙉ","Ꙋ":"ꙋ","Ꙍ":"ꙍ","Ꙏ":"ꙏ","Ꙑ":"ꙑ","Ꙓ":"ꙓ","Ꙕ":"ꙕ","Ꙗ":"ꙗ","Ꙙ":"ꙙ","Ꙛ":"ꙛ","Ꙝ":"ꙝ","Ꙟ":"ꙟ","Ꙡ":"ꙡ","Ꙣ":"ꙣ","Ꙥ":"ꙥ","Ꙧ":"ꙧ","Ꙩ":"ꙩ","Ꙫ":"ꙫ","Ꙭ":"ꙭ","Ꚁ":"ꚁ","Ꚃ":"ꚃ","Ꚅ":"ꚅ","Ꚇ":"ꚇ","Ꚉ":"ꚉ","Ꚋ":"ꚋ","Ꚍ":"ꚍ","Ꚏ":"ꚏ","Ꚑ":"ꚑ","Ꚓ":"ꚓ","Ꚕ":"ꚕ","Ꚗ":"ꚗ","Ꚙ":"ꚙ","Ꚛ":"ꚛ","Ꜣ":"ꜣ","Ꜥ":"ꜥ","Ꜧ":"ꜧ","Ꜩ":"ꜩ","Ꜫ":"ꜫ","Ꜭ":"ꜭ","Ꜯ":"ꜯ","Ꜳ":"ꜳ","Ꜵ":"ꜵ","Ꜷ":"ꜷ","Ꜹ":"ꜹ","Ꜻ":"ꜻ","Ꜽ":"ꜽ","Ꜿ":"ꜿ","Ꝁ":"ꝁ","Ꝃ":"ꝃ","Ꝅ":"ꝅ","Ꝇ":"ꝇ","Ꝉ":"ꝉ","Ꝋ":"ꝋ","Ꝍ":"ꝍ","Ꝏ":"ꝏ","Ꝑ":"ꝑ","Ꝓ":"ꝓ","Ꝕ":"ꝕ","Ꝗ":"ꝗ","Ꝙ":"ꝙ","Ꝛ":"ꝛ","Ꝝ":"ꝝ","Ꝟ":"ꝟ","Ꝡ":"ꝡ","Ꝣ":"ꝣ","Ꝥ":"ꝥ","Ꝧ":"ꝧ","Ꝩ":"ꝩ","Ꝫ":"ꝫ","Ꝭ":"ꝭ","Ꝯ":"ꝯ","Ꝺ":"ꝺ","Ꝼ":"ꝼ","Ᵹ":"ᵹ","Ꝿ":"ꝿ","Ꞁ":"ꞁ","Ꞃ":"ꞃ","Ꞅ":"ꞅ","Ꞇ":"ꞇ","Ꞌ":"ꞌ","Ɥ":"ɥ","Ꞑ":"ꞑ","Ꞓ":"ꞓ","Ꞗ":"ꞗ","Ꞙ":"ꞙ","Ꞛ":"ꞛ","Ꞝ":"ꞝ","Ꞟ":"ꞟ","Ꞡ":"ꞡ","Ꞣ":"ꞣ","Ꞥ":"ꞥ","Ꞧ":"ꞧ","Ꞩ":"ꞩ","Ɦ":"ɦ","Ɜ":"ɜ","Ɡ":"ɡ","Ɬ":"ɬ","Ʞ":"ʞ","Ʇ":"ʇ","A":"a","B":"b","C":"c","D":"d","E":"e","F":"f","G":"g","H":"h","I":"i","J":"j","K":"k","L":"l","M":"m","N":"n","O":"o","P":"p","Q":"q","R":"r","S":"s","T":"t","U":"u","V":"v","W":"w","X":"x","Y":"y","Z":"z","𐐀":"𐐨","𐐁":"𐐩","𐐂":"𐐪","𐐃":"𐐫","𐐄":"𐐬","𐐅":"𐐭","𐐆":"𐐮","𐐇":"𐐯","𐐈":"𐐰","𐐉":"𐐱","𐐊":"𐐲","𐐋":"𐐳","𐐌":"𐐴","𐐍":"𐐵","𐐎":"𐐶","𐐏":"𐐷","𐐐":"𐐸","𐐑":"𐐹","𐐒":"𐐺","𐐓":"𐐻","𐐔":"𐐼","𐐕":"𐐽","𐐖":"𐐾","𐐗":"𐐿","𐐘":"𐑀","𐐙":"𐑁","𐐚":"𐑂","𐐛":"𐑃","𐐜":"𐑄","𐐝":"𐑅","𐐞":"𐑆","𐐟":"𐑇","𐐠":"𐑈","𐐡":"𐑉","𐐢":"𐑊","𐐣":"𐑋","𐐤":"𐑌","𐐥":"𐑍","𐐦":"𐑎","𐐧":"𐑏","𑢠":"𑣀","𑢡":"𑣁","𑢢":"𑣂","𑢣":"𑣃","𑢤":"𑣄","𑢥":"𑣅","𑢦":"𑣆","𑢧":"𑣇","𑢨":"𑣈","𑢩":"𑣉","𑢪":"𑣊","𑢫":"𑣋","𑢬":"𑣌","𑢭":"𑣍","𑢮":"𑣎","𑢯":"𑣏","𑢰":"𑣐","𑢱":"𑣑","𑢲":"𑣒","𑢳":"𑣓","𑢴":"𑣔","𑢵":"𑣕","𑢶":"𑣖","𑢷":"𑣗","𑢸":"𑣘","𑢹":"𑣙","𑢺":"𑣚","𑢻":"𑣛","𑢼":"𑣜","𑢽":"𑣝","𑢾":"𑣞","𑢿":"𑣟","ß":"ss","İ":"i̇","ʼn":"ʼn","ǰ":"ǰ","ΐ":"ΐ","ΰ":"ΰ","և":"եւ","ẖ":"ẖ","ẗ":"ẗ","ẘ":"ẘ","ẙ":"ẙ","ẚ":"aʾ","ẞ":"ss","ὐ":"ὐ","ὒ":"ὒ","ὔ":"ὔ","ὖ":"ὖ","ᾀ":"ἀι","ᾁ":"ἁι","ᾂ":"ἂι","ᾃ":"ἃι","ᾄ":"ἄι","ᾅ":"ἅι","ᾆ":"ἆι","ᾇ":"ἇι","ᾈ":"ἀι","ᾉ":"ἁι","ᾊ":"ἂι","ᾋ":"ἃι","ᾌ":"ἄι","ᾍ":"ἅι","ᾎ":"ἆι","ᾏ":"ἇι","ᾐ":"ἠι","ᾑ":"ἡι","ᾒ":"ἢι","ᾓ":"ἣι","ᾔ":"ἤι","ᾕ":"ἥι","ᾖ":"ἦι","ᾗ":"ἧι","ᾘ":"ἠι","ᾙ":"ἡι","ᾚ":"ἢι","ᾛ":"ἣι","ᾜ":"ἤι","ᾝ":"ἥι","ᾞ":"ἦι","ᾟ":"ἧι","ᾠ":"ὠι","ᾡ":"ὡι","ᾢ":"ὢι","ᾣ":"ὣι","ᾤ":"ὤι","ᾥ":"ὥι","ᾦ":"ὦι","ᾧ":"ὧι","ᾨ":"ὠι","ᾩ":"ὡι","ᾪ":"ὢι","ᾫ":"ὣι","ᾬ":"ὤι","ᾭ":"ὥι","ᾮ":"ὦι","ᾯ":"ὧι","ᾲ":"ὰι","ᾳ":"αι","ᾴ":"άι","ᾶ":"ᾶ","ᾷ":"ᾶι","ᾼ":"αι","ῂ":"ὴι","ῃ":"ηι","ῄ":"ήι","ῆ":"ῆ","ῇ":"ῆι","ῌ":"ηι","ῒ":"ῒ","ΐ":"ΐ","ῖ":"ῖ","ῗ":"ῗ","ῢ":"ῢ","ΰ":"ΰ","ῤ":"ῤ","ῦ":"ῦ","ῧ":"ῧ","ῲ":"ὼι","ῳ":"ωι","ῴ":"ώι","ῶ":"ῶ","ῷ":"ῶι","ῼ":"ωι","ff":"ff","fi":"fi","fl":"fl","ffi":"ffi","ffl":"ffl","ſt":"st","st":"st","ﬓ":"մն","ﬔ":"մե","ﬕ":"մի","ﬖ":"վն","ﬗ":"մխ"};e.exports=function(e){return e.slice(1,e.length-1).trim().replace(r,function(e){return i[e]||" "})}},function(e,t,n){"use strict";function r(e,t,n){if(!(this.disableTags>0)){if(this.buffer+="<"+e,t&&t.length>0)for(var r,i=0;void 0!==(r=t[i]);)this.buffer+=" "+r[0]+'="'+r[1]+'"',i++;n&&(this.buffer+=" /"),this.buffer+=">",this.lastOut=">"}}function i(e){e=e||{},e.softbreak=e.softbreak||"\n",this.disableTags=0,this.lastOut="\n",this.options=e}function o(e){this.out(e.literal)}function a(){this.lit(this.options.softbreak)}function s(){this.tag("br",[],!0),this.cr()}function u(e,t){var n=this.attrs(e);t?(this.options.safe&&O(e.destination)||n.push(["href",this.esc(e.destination,!0)]),e.title&&n.push(["title",this.esc(e.title,!0)]),this.tag("a",n)):this.tag("/a")}function l(e,t){t?(0===this.disableTags&&(this.options.safe&&O(e.destination)?this.lit('<img src="" alt="'):this.lit('<img src="'+this.esc(e.destination,!0)+'" alt="')),this.disableTags+=1):(this.disableTags-=1,0===this.disableTags&&(e.title&&this.lit('" title="'+this.esc(e.title,!0)),this.lit('" />')))}function c(e,t){this.tag(t?"em":"/em")}function p(e,t){this.tag(t?"strong":"/strong")}function f(e,t){var n=e.parent.parent,r=this.attrs(e);null!==n&&"list"===n.type&&n.listTight||(t?(this.cr(),this.tag("p",r)):(this.tag("/p"),this.cr()))}function h(e,t){var n="h"+e.level,r=this.attrs(e);t?(this.cr(),this.tag(n,r)):(this.tag("/"+n),this.cr())}function d(e){this.tag("code"),this.out(e.literal),this.tag("/code")}function m(e){var t=e.info?e.info.split(/\s+/):[],n=this.attrs(e);t.length>0&&t[0].length>0&&n.push(["class","language-"+this.esc(t[0],!0)]),this.cr(),this.tag("pre"),this.tag("code",n),this.out(e.literal),this.tag("/code"),this.tag("/pre"),this.cr()}function v(e){var t=this.attrs(e);this.cr(),this.tag("hr",t,!0),this.cr()}function g(e,t){var n=this.attrs(e);t?(this.cr(),this.tag("blockquote",n),this.cr()):(this.cr(),this.tag("/blockquote"),this.cr())}function y(e,t){var n="bullet"===e.listType?"ul":"ol",r=this.attrs(e);if(t){var i=e.listStart;null!==i&&1!==i&&r.push(["start",i.toString()]),this.cr(),this.tag(n,r),this.cr()}else this.cr(),this.tag("/"+n),this.cr()}function _(e,t){var n=this.attrs(e);t?this.tag("li",n):(this.tag("/li"),this.cr())}function b(e){this.options.safe?this.lit("\x3c!-- raw HTML omitted --\x3e"):this.lit(e.literal)}function x(e){this.cr(),this.options.safe?this.lit("\x3c!-- raw HTML omitted --\x3e"):this.lit(e.literal),this.cr()}function w(e,t){t&&e.onEnter?this.lit(e.onEnter):!t&&e.onExit&&this.lit(e.onExit)}function k(e,t){this.cr(),t&&e.onEnter?this.lit(e.onEnter):!t&&e.onExit&&this.lit(e.onExit),this.cr()}function E(e){this.lit(this.esc(e,!1))}function S(e){var t=[];if(this.options.sourcepos){var n=e.sourcepos;n&&t.push(["data-sourcepos",String(n[0][0])+":"+String(n[0][1])+"-"+String(n[1][0])+":"+String(n[1][1])])}return t}var C=n(333),A=/^javascript:|vbscript:|file:|data:/i,D=/^data:image\/(?:png|gif|jpeg|webp)/i,O=function(e){return A.test(e)&&!D.test(e)};i.prototype=Object.create(C.prototype),i.prototype.text=o,i.prototype.html_inline=b,i.prototype.html_block=x,i.prototype.softbreak=a,i.prototype.linebreak=s,i.prototype.link=u,i.prototype.image=l,i.prototype.emph=c,i.prototype.strong=p,i.prototype.paragraph=f,i.prototype.heading=h,i.prototype.code=d,i.prototype.code_block=m,i.prototype.thematic_break=v,i.prototype.block_quote=g,i.prototype.list=y,i.prototype.item=_,i.prototype.custom_inline=w,i.prototype.custom_block=k,i.prototype.esc=n(73).escapeXml,i.prototype.out=E,i.prototype.tag=r,i.prototype.attrs=S,e.exports=i},function(e,t,n){"use strict";function r(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase()}function i(e){e=e||{},this.disableTags=0,this.lastOut="\n",this.indentLevel=0,this.indent=" ",this.options=e}function o(e){this.buffer="";var t,n,i,o,a,s,u,l,c=e.walker(),p=this.options;for(p.time&&console.time("rendering"),this.buffer+='<?xml version="1.0" encoding="UTF-8"?>\n',this.buffer+='<!DOCTYPE document SYSTEM "CommonMark.dtd">\n';i=c.next();)if(a=i.entering,o=i.node,l=o.type,s=o.isContainer,u="thematic_break"===l||"linebreak"===l||"softbreak"===l,n=r(l),a){switch(t=[],l){case"document":t.push(["xmlns","http://commonmark.org/xml/1.0"]);break;case"list":null!==o.listType&&t.push(["type",o.listType.toLowerCase()]),null!==o.listStart&&t.push(["start",String(o.listStart)]),null!==o.listTight&&t.push(["tight",o.listTight?"true":"false"]);var f=o.listDelimiter;if(null!==f){var h="";h="."===f?"period":"paren",t.push(["delimiter",h])}break;case"code_block":o.info&&t.push(["info",o.info]);break;case"heading":t.push(["level",String(o.level)]);break;case"link":case"image":t.push(["destination",o.destination]),t.push(["title",o.title]);break;case"custom_inline":case"custom_block":t.push(["on_enter",o.onEnter]),t.push(["on_exit",o.onExit])}if(p.sourcepos){var d=o.sourcepos;d&&t.push(["sourcepos",String(d[0][0])+":"+String(d[0][1])+"-"+String(d[1][0])+":"+String(d[1][1])])}if(this.cr(),this.out(this.tag(n,t,u)),s)this.indentLevel+=1;else if(!s&&!u){var m=o.literal;m&&this.out(this.esc(m)),this.out(this.tag("/"+n))}}else this.indentLevel-=1,this.cr(),this.out(this.tag("/"+n));return p.time&&console.timeEnd("rendering"),this.buffer+="\n",this.buffer}function a(e){this.disableTags>0?this.buffer+=e.replace(c,""):this.buffer+=e,this.lastOut=e}function s(){if("\n"!==this.lastOut){this.buffer+="\n",this.lastOut="\n";for(var e=this.indentLevel;e>0;e--)this.buffer+=this.indent}}function u(e,t,n){var r="<"+e;if(t&&t.length>0)for(var i,o=0;void 0!==(i=t[o]);)r+=" "+i[0]+'="'+this.esc(i[1])+'"',o++;return n&&(r+=" /"),r+=">"}var l=n(333),c=/\<[^>]*\>/;i.prototype=Object.create(l.prototype),i.prototype.render=o,i.prototype.out=a,i.prototype.cr=s,i.prototype.tag=u,i.prototype.esc=n(73).escapeXml,e.exports=i},function(e,t,n){"use strict";function r(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},r=t||{},i=e.split(u),s=r.decode||a,l=0;l<i.length;l++){var c=i[l],p=c.indexOf("=");if(!(p<0)){var f=c.substr(0,p).trim(),h=c.substr(++p,c.length).trim();'"'==h[0]&&(h=h.slice(1,-1)),void 0==n[f]&&(n[f]=o(h,s))}}return n}function i(e,t,n){var r=n||{},i=r.encode||s;if("function"!=typeof i)throw new TypeError("option encode is invalid");if(!l.test(e))throw new TypeError("argument name is invalid");var o=i(t);if(o&&!l.test(o))throw new TypeError("argument val is invalid");var a=e+"="+o;if(null!=r.maxAge){var u=r.maxAge-0;if(isNaN(u))throw new Error("maxAge should be a Number");a+="; Max-Age="+Math.floor(u)}if(r.domain){if(!l.test(r.domain))throw new TypeError("option domain is invalid");a+="; Domain="+r.domain}if(r.path){if(!l.test(r.path))throw new TypeError("option path is invalid");a+="; Path="+r.path}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");a+="; Expires="+r.expires.toUTCString()}if(r.httpOnly&&(a+="; HttpOnly"),r.secure&&(a+="; Secure"),r.sameSite){switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;default:throw new TypeError("option sameSite is invalid")}}return a}function o(e,t){try{return t(e)}catch(t){return e}}/*! +function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=t.alloc?t.alloc(e.length):new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function o(e){var t=[];return e.forEach(function(e,i){"object"==typeof e&&null!==e?Array.isArray(e)?t[i]=o(e):n(e)?t[i]=r(e):t[i]=a({},e):t[i]=e}),t}function i(e,t){return"__proto__"===t?void 0:e[t]}var a=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,t,s=arguments[0],u=Array.prototype.slice.call(arguments,1);return u.forEach(function(u){"object"!=typeof u||null===u||Array.isArray(u)||Object.keys(u).forEach(function(c){return t=i(s,c),(e=i(u,c))===s?void 0:"object"!=typeof e||null===e?void(s[c]=e):Array.isArray(e)?void(s[c]=o(e)):n(e)?void(s[c]=r(e)):"object"!=typeof t||null===t||Array.isArray(t)?void(s[c]=a({},e)):void(s[c]=a(t,e))})}),s}}).call(this,n(64).Buffer)},function(e,t,n){e.exports=n(952)},function(e,t,n){n(164),n(103),n(953),n(957),n(958),e.exports=n(22).WeakMap},function(e,t,n){"use strict";var r,o=n(32),i=n(268)(0),a=n(220),s=n(135),u=n(356),c=n(956),l=n(43),p=n(144),f=n(144),h=!o.ActiveXObject&&"ActiveXObject"in o,d=s.getWeak,m=Object.isExtensible,v=c.ufstore,g=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},y={get:function(e){if(l(e)){var t=d(e);return!0===t?v(p(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return c.def(p(this,"WeakMap"),e,t)}},b=e.exports=n(459)("WeakMap",g,y,c,!0,!0);f&&h&&(u((r=c.getConstructor(g,"WeakMap")).prototype,y),s.NEED=!0,i(["delete","has","get","set"],function(e){var t=b.prototype,n=t[e];a(t,e,function(t,o){if(l(t)&&!m(t)){this._f||(this._f=new r);var i=this._f[e](t,o);return"set"==e?this:i}return n.call(this,t,o)})}))},function(e,t,n){var r=n(955);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var r=n(43),o=n(223),i=n(34)("species");e.exports=function(e){var t;return o(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!o(t.prototype)||(t=void 0),r(t)&&null===(t=t[i])&&(t=void 0)),void 0===t?Array:t}},function(e,t,n){"use strict";var r=n(182),o=n(135).getWeak,i=n(46),a=n(43),s=n(181),u=n(112),c=n(268),l=n(75),p=n(144),f=c(5),h=c(6),d=0,m=function(e){return e._l||(e._l=new v)},v=function(){this.a=[]},g=function(e,t){return f(e.a,function(e){return e[0]===t})};v.prototype={get:function(e){var t=g(this,e);if(t)return t[1]},has:function(e){return!!g(this,e)},set:function(e,t){var n=g(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=h(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,i){var c=e(function(e,r){s(e,c,t,"_i"),e._t=t,e._i=d++,e._l=void 0,null!=r&&u(r,n,e[i],e)});return r(c.prototype,{delete:function(e){if(!a(e))return!1;var n=o(e);return!0===n?m(p(this,t)).delete(e):n&&l(n,this._i)&&delete n[this._i]},has:function(e){if(!a(e))return!1;var n=o(e);return!0===n?m(p(this,t)).has(e):n&&l(n,this._i)}}),c},def:function(e,t,n){var r=o(i(t),!0);return!0===r?m(e).set(t,n):r[e._i]=n,e},ufstore:m}},function(e,t,n){n(460)("WeakMap")},function(e,t,n){n(461)("WeakMap")},function(e,t){var n={};!function(e){"use strict";function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function r(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return d.iterable&&(t[Symbol.iterator]=function(){return t}),t}function o(e){this.map={},e instanceof o?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function i(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function a(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function s(e){var t=new FileReader,n=a(t);return t.readAsArrayBuffer(e),n}function u(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function c(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(d.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(d.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(d.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(d.arrayBuffer&&d.blob&&v(e))this._bodyArrayBuffer=u(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!d.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!g(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=u(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):d.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},d.blob&&(this.blob=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=a(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},d.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function l(e,t){var n=(t=t||{}).body;if(e instanceof l){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new o(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new o(t.headers)),this.method=function(e){var t=e.toUpperCase();return y.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function p(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function f(e){var t=new o;return e.split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t}function h(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new o(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var d={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(d.arrayBuffer)var m=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v=function(e){return e&&DataView.prototype.isPrototypeOf(e)},g=ArrayBuffer.isView||function(e){return e&&m.indexOf(Object.prototype.toString.call(e))>-1};o.prototype.append=function(e,r){e=t(e),r=n(r);var o=this.map[e];this.map[e]=o?o+","+r:r},o.prototype.delete=function(e){delete this.map[t(e)]},o.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},o.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},o.prototype.set=function(e,r){this.map[t(e)]=n(r)},o.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},o.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),r(e)},o.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),r(e)},o.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),r(e)},d.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];l.prototype.clone=function(){return new l(this,{body:this._bodyInit})},c.call(l.prototype),c.call(h.prototype),h.prototype.clone=function(){return new h(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},h.error=function(){var e=new h(null,{status:0,statusText:""});return e.type="error",e};var b=[301,302,303,307,308];h.redirect=function(e,t){if(-1===b.indexOf(t))throw new RangeError("Invalid status code");return new h(null,{status:t,headers:{location:e}})},e.Headers=o,e.Request=l,e.Response=h,e.fetch=function(e,t){return new Promise(function(n,r){var o=new l(e,t),i=new XMLHttpRequest;i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:f(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var t="response"in i?i.response:i.responseText;n(new h(t,e))},i.onerror=function(){r(new TypeError("Network request failed"))},i.ontimeout=function(){r(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&d.blob&&(i.responseType="blob"),o.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}(void 0!==n?n:this),e.exports=n},function(e,t){var n=e.exports=function(e){return new r(e)};function r(e){this.value=e}function o(e,t,n){var r=[],o=[],s=!0;return function e(p){var f=n?i(p):p,h={},d=!0,m={node:f,node_:p,path:[].concat(r),parent:o[o.length-1],parents:o,key:r.slice(-1)[0],isRoot:0===r.length,level:r.length,circular:null,update:function(e,t){m.isRoot||(m.parent.node[m.key]=e),m.node=e,t&&(d=!1)},delete:function(e){delete m.parent.node[m.key],e&&(d=!1)},remove:function(e){u(m.parent.node)?m.parent.node.splice(m.key,1):delete m.parent.node[m.key],e&&(d=!1)},keys:null,before:function(e){h.before=e},after:function(e){h.after=e},pre:function(e){h.pre=e},post:function(e){h.post=e},stop:function(){s=!1},block:function(){d=!1}};if(!s)return m;function v(){if("object"==typeof m.node&&null!==m.node){m.keys&&m.node_===m.node||(m.keys=a(m.node)),m.isLeaf=0==m.keys.length;for(var e=0;e<o.length;e++)if(o[e].node_===p){m.circular=o[e];break}}else m.isLeaf=!0,m.keys=null;m.notLeaf=!m.isLeaf,m.notRoot=!m.isRoot}v();var g=t.call(m,m.node);return void 0!==g&&m.update&&m.update(g),h.before&&h.before.call(m,m.node),d?("object"!=typeof m.node||null===m.node||m.circular||(o.push(m),v(),c(m.keys,function(t,o){r.push(t),h.pre&&h.pre.call(m,m.node[t],t);var i=e(m.node[t]);n&&l.call(m.node,t)&&(m.node[t]=i.node),i.isLast=o==m.keys.length-1,i.isFirst=0==o,h.post&&h.post.call(m,i),r.pop()}),o.pop()),h.after&&h.after.call(m,m.node),m):m}(e).node}function i(e){if("object"==typeof e&&null!==e){var t;if(u(e))t=[];else if("[object Date]"===s(e))t=new Date(e.getTime?e.getTime():e);else if(function(e){return"[object RegExp]"===s(e)}(e))t=new RegExp(e);else if(function(e){return"[object Error]"===s(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===s(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===s(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===s(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},r=function(){};r.prototype=n,t=new r}return c(a(e),function(n){t[n]=e[n]}),t}return e}r.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!l.call(t,r)){t=void 0;break}t=t[r]}return t},r.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!l.call(t,r))return!1;t=t[r]}return!0},r.prototype.set=function(e,t){for(var n=this.value,r=0;r<e.length-1;r++){var o=e[r];l.call(n,o)||(n[o]={}),n=n[o]}return n[e[r]]=t,t},r.prototype.map=function(e){return o(this.value,e,!0)},r.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},r.prototype.reduce=function(e,t){var n=1===arguments.length,r=n?this.value:t;return this.forEach(function(t){this.isRoot&&n||(r=e.call(this,r,t))}),r},r.prototype.paths=function(){var e=[];return this.forEach(function(t){e.push(this.path)}),e},r.prototype.nodes=function(){var e=[];return this.forEach(function(t){e.push(this.node)}),e},r.prototype.clone=function(){var e=[],t=[];return function n(r){for(var o=0;o<e.length;o++)if(e[o]===r)return t[o];if("object"==typeof r&&null!==r){var s=i(r);return e.push(r),t.push(s),c(a(r),function(e){s[e]=n(r[e])}),e.pop(),t.pop(),s}return r}(this.value)};var a=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function s(e){return Object.prototype.toString.call(e)}var u=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},c=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};c(a(r.prototype),function(e){n[e]=function(t){var n=[].slice.call(arguments,1),o=new r(t);return o[e].apply(o,n)}});var l=Object.hasOwnProperty||function(e,t){return t in e}},function(e,t,n){var r=n(962),o=n(453)(function(e,t){return null==e?{}:r(e,t)});e.exports=o},function(e,t,n){var r=n(963),o=n(385);e.exports=function(e,t){return r(e,t,function(t,n){return o(e,n)})}},function(e,t,n){var r=n(177),o=n(417),i=n(108);e.exports=function(e,t,n){for(var a=-1,s=t.length,u={};++a<s;){var c=t[a],l=r(e,c);n(l,c)&&o(u,i(c,e),l)}return u}},function(e,t,n){"use strict"; +/*! * cookie * Copyright(c) 2012-2014 Roman Shtylman * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed - */ -t.parse=r,t.serialize=i;var a=decodeURIComponent,s=encodeURIComponent,u=/; */,l=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/},function(e,t,n){n(679),n(683),n(690),n(366),n(674),n(675),n(680),n(684),n(686),n(670),n(671),n(672),n(673),n(676),n(677),n(678),n(681),n(682),n(685),n(687),n(688),n(689),n(666),n(667),n(668),n(669),e.exports=n(63).String},function(e,t,n){n(664),n(366),n(693),n(665),n(691),n(692),e.exports=n(63).Promise},function(e,t,n){n(103),n(621),e.exports=n(15).Array.from},function(e,t,n){n(104),n(103),e.exports=n(619)},function(e,t,n){n(104),n(103),e.exports=n(620)},function(e,t,n){var r=n(15),i=r.JSON||(r.JSON={stringify:JSON.stringify});e.exports=function(e){return i.stringify.apply(i,arguments)}},function(e,t,n){n(623),e.exports=n(15).Object.assign},function(e,t,n){n(624);var r=n(15).Object;e.exports=function(e,t){return r.create(e,t)}},function(e,t,n){n(625);var r=n(15).Object;e.exports=function(e,t,n){return r.defineProperty(e,t,n)}},function(e,t,n){n(626),e.exports=n(15).Object.getPrototypeOf},function(e,t,n){n(627),e.exports=n(15).Object.keys},function(e,t,n){n(628),e.exports=n(15).Object.setPrototypeOf},function(e,t,n){n(194),n(103),n(104),n(629),n(632),n(633),e.exports=n(15).Promise},function(e,t,n){n(630),n(194),n(634),n(635),e.exports=n(15).Symbol},function(e,t,n){n(103),n(104),e.exports=n(192).f("iterator")},function(e,t,n){n(194),n(104),n(631),n(637),n(636),e.exports=n(15).WeakMap},function(e,t){e.exports=function(){}},function(e,t,n){var r=n(75),i=n(133),o=n(618);e.exports=function(e){return function(t,n,a){var s,u=r(t),l=i(u.length),c=o(a,l);if(e&&n!=n){for(;l>c;)if((s=u[c++])!=s)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===n)return e||c||0;return!e&&-1}}},function(e,t,n){var r=n(27),i=n(337),o=n(22)("species");e.exports=function(e){var t;return i(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!i(t.prototype)||(t=void 0),r(t)&&null===(t=t[o])&&(t=void 0)),void 0===t?Array:t}},function(e,t,n){var r=n(601);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){"use strict";var r=n(185),i=n(131).getWeak,o=n(37),a=n(27),s=n(175),u=n(129),l=n(176),c=n(55),p=n(351),f=l(5),h=l(6),d=0,m=function(e){return e._l||(e._l=new v)},v=function(){this.a=[]},g=function(e,t){return f(e.a,function(e){return e[0]===t})};v.prototype={get:function(e){var t=g(this,e);if(t)return t[1]},has:function(e){return!!g(this,e)},set:function(e,t){var n=g(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=h(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,o){var l=e(function(e,r){s(e,l,t,"_i"),e._t=t,e._i=d++,e._l=void 0,void 0!=r&&u(r,n,e[o],e)});return r(l.prototype,{delete:function(e){if(!a(e))return!1;var n=i(e);return!0===n?m(p(this,t)).delete(e):n&&c(n,this._i)&&delete n[this._i]},has:function(e){if(!a(e))return!1;var n=i(e);return!0===n?m(p(this,t)).has(e):n&&c(n,this._i)}}),l},def:function(e,t,n){var r=i(o(t),!0);return!0===r?m(e).set(t,n):r[e._i]=n,e},ufstore:m}},function(e,t,n){"use strict";var r=n(24),i=n(23),o=n(131),a=n(54),s=n(56),u=n(185),l=n(129),c=n(175),p=n(27),f=n(102),h=n(41).f,d=n(176)(0),m=n(49);e.exports=function(e,t,n,v,g,y){var _=r[e],b=_,x=g?"set":"add",w=b&&b.prototype,k={};return m&&"function"==typeof b&&(y||w.forEach&&!a(function(){(new b).entries().next()}))?(b=t(function(t,n){c(t,b,e,"_c"),t._c=new _,void 0!=n&&l(n,g,t[x],t)}),d("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(e){var t="add"==e||"set"==e;e in w&&(!y||"clear"!=e)&&s(b.prototype,e,function(n,r){if(c(this,b,e),!t&&y&&!p(n))return"get"==e&&void 0;var i=this._c[e](0===n?0:n,r);return t?this:i})}),y||h(b.prototype,"size",{get:function(){return this._c.size}})):(b=v.getConstructor(t,e,g,x),u(b.prototype,n),o.NEED=!0),f(b,e),k[e]=b,i(i.G+i.W+i.F,k),y||v.setStrong(b,e,g),b}},function(e,t,n){"use strict";var r=n(41),i=n(101);e.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},function(e,t,n){var r=n(100),i=n(184),o=n(132);e.exports=function(e){var t=r(e),n=i.f;if(n)for(var a,s=n(e),u=o.f,l=0;s.length>l;)u.call(e,a=s[l++])&&t.push(a);return t}},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){"use strict";var r=n(183),i=n(101),o=n(102),a={};n(56)(a,n(22)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(24),i=n(350).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,u="process"==n(99)(a);e.exports=function(){var e,t,n,l=function(){var r,i;for(u&&(r=a.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){a.nextTick(l)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var c=s.resolve();n=function(){c.then(l)}}else n=function(){i.call(r,l)};else{var p=!0,f=document.createTextNode("");new o(l).observe(f,{characterData:!0}),n=function(){f.data=p=!p}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},function(e,t,n){var r=n(41),i=n(37),o=n(100);e.exports=n(49)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(75),i=n(343).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return i(e)}catch(e){return a.slice()}};e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?s(e):i(r(e))}},function(e,t,n){"use strict";var r=n(23),i=n(98),o=n(53),a=n(129);e.exports=function(e){r(r.S,e,{from:function(e){var t,n,r,s,u=arguments[1];return i(this),t=void 0!==u,t&&i(u),void 0==e?new this:(n=[],t?(r=0,s=o(u,arguments[2],2),a(e,!1,function(e){n.push(s(e,r++))})):a(e,!1,n.push,n),new this(n))}})}},function(e,t,n){"use strict";var r=n(23);e.exports=function(e){r(r.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})}},function(e,t,n){var r=n(27),i=n(37),o=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{r=n(53)(Function.call,n(342).f(Object.prototype,"__proto__").set,2),r(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return o(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:o}},function(e,t,n){"use strict";var r=n(24),i=n(15),o=n(41),a=n(49),s=n(22)("species");e.exports=function(e){var t="function"==typeof i[e]?i[e]:r[e];a&&t&&!t[s]&&o.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){var r=n(189),i=n(178);e.exports=function(e){return function(t,n){var o,a,s=String(i(t)),u=r(n),l=s.length;return u<0||u>=l?e?"":void 0:(o=s.charCodeAt(u),o<55296||o>56319||u+1===l||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):a-56320+(o-55296<<10)+65536)}}},function(e,t,n){var r=n(189),i=Math.max,o=Math.min;e.exports=function(e,t){return e=r(e),e<0?i(e+t,0):o(e,t)}},function(e,t,n){var r=n(37),i=n(193);e.exports=n(15).getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return r(t.call(e))}},function(e,t,n){var r=n(177),i=n(22)("iterator"),o=n(74);e.exports=n(15).isIterable=function(e){var t=Object(e);return void 0!==t[i]||"@@iterator"in t||o.hasOwnProperty(r(t))}},function(e,t,n){"use strict";var r=n(53),i=n(23),o=n(76),a=n(338),s=n(336),u=n(133),l=n(605),c=n(193);i(i.S+i.F*!n(340)(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,i,p,f=o(e),h="function"==typeof this?this:Array,d=arguments.length,m=d>1?arguments[1]:void 0,v=void 0!==m,g=0,y=c(f);if(v&&(m=r(m,d>2?arguments[2]:void 0,2)),void 0==y||h==Array&&s(y))for(t=u(f.length),n=new h(t);t>g;g++)l(n,g,v?m(f[g],g):f[g]);else for(p=y.call(f),n=new h;!(i=p.next()).done;g++)l(n,g,v?a(p,m,[i.value,g],!0):i.value);return n.length=g,n}})},function(e,t,n){"use strict";var r=n(599),i=n(609),o=n(74),a=n(75);e.exports=n(339)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):"keys"==t?i(0,n):"values"==t?i(0,e[n]):i(0,[n,e[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t,n){var r=n(23);r(r.S+r.F,"Object",{assign:n(341)})},function(e,t,n){var r=n(23);r(r.S,"Object",{create:n(183)})},function(e,t,n){var r=n(23);r(r.S+r.F*!n(49),"Object",{defineProperty:n(41).f})},function(e,t,n){var r=n(76),i=n(344);n(346)("getPrototypeOf",function(){return function(e){return i(r(e))}})},function(e,t,n){var r=n(76),i=n(100);n(346)("keys",function(){return function(e){return i(r(e))}})},function(e,t,n){var r=n(23);r(r.S,"Object",{setPrototypeOf:n(615).set})},function(e,t,n){"use strict";var r,i,o,a,s=n(130),u=n(24),l=n(53),c=n(177),p=n(23),f=n(27),h=n(98),d=n(175),m=n(129),v=n(349),g=n(350).set,y=n(610)(),_=n(182),b=n(347),x=n(348),w=u.TypeError,k=u.process,E=u.Promise,S="process"==c(k),C=function(){},A=i=_.f,D=!!function(){try{var e=E.resolve(1),t=(e.constructor={})[n(22)("species")]=function(e){e(C,C)};return(S||"function"==typeof PromiseRejectionEvent)&&e.then(C)instanceof t}catch(e){}}(),O=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},M=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var r=e._v,i=1==e._s,o=0;n.length>o;)!function(t){var n,o,a=i?t.ok:t.fail,s=t.resolve,u=t.reject,l=t.domain;try{a?(i||(2==e._h&&I(e),e._h=1),!0===a?n=r:(l&&l.enter(),n=a(r),l&&l.exit()),n===t.promise?u(w("Promise-chain cycle")):(o=O(n))?o.call(n,s,u):s(n)):u(r)}catch(e){u(e)}}(n[o++]);e._c=[],e._n=!1,t&&!e._h&&T(e)})}},T=function(e){g.call(u,function(){var t,n,r,i=e._v,o=P(e);if(o&&(t=b(function(){S?k.emit("unhandledRejection",i,e):(n=u.onunhandledrejection)?n({promise:e,reason:i}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",i)}),e._h=S||P(e)?2:1),e._a=void 0,o&&t.e)throw t.v})},P=function(e){return 1!==e._h&&0===(e._a||e._c).length},I=function(e){g.call(u,function(){var t;S?k.emit("rejectionHandled",e):(t=u.onrejectionhandled)&&t({promise:e,reason:e._v})})},R=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,t._a||(t._a=t._c.slice()),M(t,!0))},j=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw w("Promise can't be resolved itself");(t=O(e))?y(function(){var r={_w:n,_d:!1};try{t.call(e,l(j,r,1),l(R,r,1))}catch(e){R.call(r,e)}}):(n._v=e,n._s=1,M(n,!1))}catch(e){R.call({_w:n,_d:!1},e)}}};D||(E=function(e){d(this,E,"Promise","_h"),h(e),r.call(this);try{e(l(j,this,1),l(R,this,1))}catch(e){R.call(this,e)}},r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(185)(E.prototype,{then:function(e,t){var n=A(v(this,E));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=S?k.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r;this.promise=e,this.resolve=l(j,e,1),this.reject=l(R,e,1)},_.f=A=function(e){return e===E||e===a?new o(e):i(e)}),p(p.G+p.W+p.F*!D,{Promise:E}),n(102)(E,"Promise"),n(616)("Promise"),a=n(15).Promise,p(p.S+p.F*!D,"Promise",{reject:function(e){var t=A(this);return(0,t.reject)(e),t.promise}}),p(p.S+p.F*(s||!D),"Promise",{resolve:function(e){return x(s&&this===a?E:this,e)}}),p(p.S+p.F*!(D&&n(340)(function(e){E.all(e).catch(C)})),"Promise",{all:function(e){var t=this,n=A(t),r=n.resolve,i=n.reject,o=b(function(){var n=[],o=0,a=1;m(e,!1,function(e){var s=o++,u=!1;n.push(void 0),a++,t.resolve(e).then(function(e){u||(u=!0,n[s]=e,--a||r(n))},i)}),--a||r(n)});return o.e&&i(o.v),n.promise},race:function(e){var t=this,n=A(t),r=n.reject,i=b(function(){m(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},function(e,t,n){"use strict";var r=n(24),i=n(55),o=n(49),a=n(23),s=n(186),u=n(131).KEY,l=n(54),c=n(188),p=n(102),f=n(134),h=n(22),d=n(192),m=n(191),v=n(606),g=n(337),y=n(37),_=n(27),b=n(75),x=n(190),w=n(101),k=n(183),E=n(612),S=n(342),C=n(41),A=n(100),D=S.f,O=C.f,M=E.f,T=r.Symbol,P=r.JSON,I=P&&P.stringify,R=h("_hidden"),j=h("toPrimitive"),F={}.propertyIsEnumerable,N=c("symbol-registry"),B=c("symbols"),L=c("op-symbols"),q=Object.prototype,z="function"==typeof T,U=r.QObject,W=!U||!U.prototype||!U.prototype.findChild,V=o&&l(function(){return 7!=k(O({},"a",{get:function(){return O(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=D(q,t);r&&delete q[t],O(e,t,n),r&&e!==q&&O(q,t,r)}:O,H=function(e){var t=B[e]=k(T.prototype);return t._k=e,t},G=z&&"symbol"==typeof T.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof T},J=function(e,t,n){return e===q&&J(L,t,n),y(e),t=x(t,!0),y(n),i(B,t)?(n.enumerable?(i(e,R)&&e[R][t]&&(e[R][t]=!1),n=k(n,{enumerable:w(0,!1)})):(i(e,R)||O(e,R,w(1,{})),e[R][t]=!0),V(e,t,n)):O(e,t,n)},K=function(e,t){y(e);for(var n,r=v(t=b(t)),i=0,o=r.length;o>i;)J(e,n=r[i++],t[n]);return e},X=function(e,t){return void 0===t?k(e):K(k(e),t)},Y=function(e){var t=F.call(this,e=x(e,!0));return!(this===q&&i(B,e)&&!i(L,e))&&(!(t||!i(this,e)||!i(B,e)||i(this,R)&&this[R][e])||t)},$=function(e,t){if(e=b(e),t=x(t,!0),e!==q||!i(B,t)||i(L,t)){var n=D(e,t);return!n||!i(B,t)||i(e,R)&&e[R][t]||(n.enumerable=!0),n}},Z=function(e){for(var t,n=M(b(e)),r=[],o=0;n.length>o;)i(B,t=n[o++])||t==R||t==u||r.push(t);return r},Q=function(e){for(var t,n=e===q,r=M(n?L:b(e)),o=[],a=0;r.length>a;)!i(B,t=r[a++])||n&&!i(q,t)||o.push(B[t]);return o};z||(T=function(){if(this instanceof T)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(n){this===q&&t.call(L,n),i(this,R)&&i(this[R],e)&&(this[R][e]=!1),V(this,e,w(1,n))};return o&&W&&V(q,e,{configurable:!0,set:t}),H(e)},s(T.prototype,"toString",function(){return this._k}),S.f=$,C.f=J,n(343).f=E.f=Z,n(132).f=Y,n(184).f=Q,o&&!n(130)&&s(q,"propertyIsEnumerable",Y,!0),d.f=function(e){return H(h(e))}),a(a.G+a.W+a.F*!z,{Symbol:T});for(var ee="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),te=0;ee.length>te;)h(ee[te++]);for(var ne=A(h.store),re=0;ne.length>re;)m(ne[re++]);a(a.S+a.F*!z,"Symbol",{for:function(e){return i(N,e+="")?N[e]:N[e]=T(e)},keyFor:function(e){if(!G(e))throw TypeError(e+" is not a symbol!");for(var t in N)if(N[t]===e)return t},useSetter:function(){W=!0},useSimple:function(){W=!1}}),a(a.S+a.F*!z,"Object",{create:X,defineProperty:J,defineProperties:K,getOwnPropertyDescriptor:$,getOwnPropertyNames:Z,getOwnPropertySymbols:Q}),P&&a(a.S+a.F*(!z||l(function(){var e=T();return"[null]"!=I([e])||"{}"!=I({a:e})||"{}"!=I(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(_(t)||void 0!==e)&&!G(e))return g(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!G(t))return t}),r[1]=t,I.apply(P,r)}}),T.prototype[j]||n(56)(T.prototype,j,T.prototype.valueOf),p(T,"Symbol"),p(Math,"Math",!0),p(r.JSON,"JSON",!0)},function(e,t,n){"use strict";var r,i=n(176)(0),o=n(186),a=n(131),s=n(341),u=n(603),l=n(27),c=n(54),p=n(351),f=a.getWeak,h=Object.isExtensible,d=u.ufstore,m={},v=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},g={get:function(e){if(l(e)){var t=f(e);return!0===t?d(p(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return u.def(p(this,"WeakMap"),e,t)}},y=e.exports=n(604)("WeakMap",v,g,u,!0,!0);c(function(){return 7!=(new y).set((Object.freeze||Object)(m),7).get(m)})&&(r=u.getConstructor(v,"WeakMap"),s(r.prototype,g),a.NEED=!0,i(["delete","has","get","set"],function(e){var t=y.prototype,n=t[e];o(t,e,function(t,i){if(l(t)&&!h(t)){this._f||(this._f=new r);var o=this._f[e](t,i);return"set"==e?this:o}return n.call(this,t,i)})}))},function(e,t,n){"use strict";var r=n(23),i=n(15),o=n(24),a=n(349),s=n(348);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,i.Promise||o.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(23),i=n(182),o=n(347);r(r.S,"Promise",{try:function(e){var t=i.f(this),n=o(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){n(191)("asyncIterator")},function(e,t,n){n(191)("observable")},function(e,t,n){n(613)("WeakMap")},function(e,t,n){n(614)("WeakMap")},function(e,t,n){var r=n(19)("unscopables"),i=Array.prototype;void 0==i[r]&&n(64)(i,r,{}),e.exports=function(e){i[r][e]=!0}},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(140),i=n(110),o=n(365);e.exports=function(e){return function(t,n,a){var s,u=r(t),l=i(u.length),c=o(a,l);if(e&&n!=n){for(;l>c;)if((s=u[c++])!=s)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===n)return e||c||0;return!e&&-1}}},function(e,t,n){var r=n(136),i=n(646),o=n(645),a=n(62),s=n(110),u=n(662),l={},c={},t=e.exports=function(e,t,n,p,f){var h,d,m,v,g=f?function(){return e}:u(e),y=r(n,p,t?2:1),_=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(o(g)){for(h=s(e.length);h>_;_++)if((v=t?y(a(d=e[_])[0],d[1]):y(e[_]))===l||v===c)return v}else for(m=g.call(e);!(d=m.next()).done;)if((v=i(m,y,d.value,t))===l||v===c)return v};t.BREAK=l,t.RETURN=c},function(e,t,n){e.exports=!n(106)&&!n(107)(function(){return 7!=Object.defineProperty(n(196)("div"),"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(105);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(109),i=n(19)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},function(e,t,n){var r=n(62);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t,n){"use strict";var r=n(651),i=n(360),o=n(199),a={};n(64)(a,n(19)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(19)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},e(o)}catch(e){}return n}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(31),i=n(364).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,u="process"==n(105)(a);e.exports=function(){var e,t,n,l=function(){var r,i;for(u&&(r=a.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){a.nextTick(l)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var c=s.resolve();n=function(){c.then(l)}}else n=function(){i.call(r,l)};else{var p=!0,f=document.createTextNode("");new o(l).observe(f,{characterData:!0}),n=function(){f.data=p=!p}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},function(e,t,n){var r=n(62),i=n(652),o=n(352),a=n(200)("IE_PROTO"),s=function(){},u=function(){var e,t=n(196)("iframe"),r=o.length;for(t.style.display="none",n(353).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[o[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(138),i=n(62),o=n(357);e.exports=n(106)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(108),i=n(660),o=n(200)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(108),i=n(140),o=n(640)(!1),a=n(200)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,l=[];for(n in s)n!=a&&r(s,n)&&l.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(l,n)||l.push(n));return l}},function(e,t,n){var r=n(78);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},function(e,t,n){"use strict";var r=n(31),i=n(138),o=n(106),a=n(19)("species");e.exports=function(e){var t=r[e];o&&t&&!t[a]&&i.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,n){"use strict";var r=n(139),i=n(57);e.exports=function(e){var t=String(i(this)),n="",o=r(e);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(n+=t);return n}},function(e,t,n){var r=n(28),i=n(57),o=n(107),a=n(659),s="["+a+"]",u="​…",l=RegExp("^"+s+s+"*"),c=RegExp(s+s+"*$"),p=function(e,t,n){var i={},s=o(function(){return!!a[e]()||u[e]()!=u}),l=i[e]=s?t(f):a[e];n&&(i[n]=l),r(r.P+r.F*s,"String",i)},f=p.trim=function(e,t){return e=String(i(e)),1&t&&(e=e.replace(l,"")),2&t&&(e=e.replace(c,"")),e};e.exports=p},function(e,t){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(e,t,n){var r=n(57);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(77);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var r=n(195),i=n(19)("iterator"),o=n(109);e.exports=n(63).getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){"use strict";var r=n(638),i=n(649),o=n(109),a=n(140);e.exports=n(355)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):"keys"==t?i(0,n):"values"==t?i(0,e[n]):i(0,[n,e[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t,n){"use strict";var r=n(195),i={};i[n(19)("toStringTag")]="z",i+""!="[object z]"&&n(78)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(e,t,n){"use strict";var r,i,o,a,s=n(356),u=n(31),l=n(136),c=n(195),p=n(28),f=n(77),h=n(135),d=n(639),m=n(641),v=n(362),g=n(364).set,y=n(650)(),_=n(198),b=n(358),x=n(359),w=u.TypeError,k=u.process,E=u.Promise,S="process"==c(k),C=function(){},A=i=_.f,D=!!function(){try{var e=E.resolve(1),t=(e.constructor={})[n(19)("species")]=function(e){e(C,C)};return(S||"function"==typeof PromiseRejectionEvent)&&e.then(C)instanceof t}catch(e){}}(),O=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},M=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var r=e._v,i=1==e._s,o=0;n.length>o;)!function(t){var n,o,a=i?t.ok:t.fail,s=t.resolve,u=t.reject,l=t.domain;try{a?(i||(2==e._h&&I(e),e._h=1),!0===a?n=r:(l&&l.enter(),n=a(r),l&&l.exit()),n===t.promise?u(w("Promise-chain cycle")):(o=O(n))?o.call(n,s,u):s(n)):u(r)}catch(e){u(e)}}(n[o++]);e._c=[],e._n=!1,t&&!e._h&&T(e)})}},T=function(e){g.call(u,function(){var t,n,r,i=e._v,o=P(e);if(o&&(t=b(function(){S?k.emit("unhandledRejection",i,e):(n=u.onunhandledrejection)?n({promise:e,reason:i}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",i)}),e._h=S||P(e)?2:1),e._a=void 0,o&&t.e)throw t.v})},P=function(e){return 1!==e._h&&0===(e._a||e._c).length},I=function(e){g.call(u,function(){var t;S?k.emit("rejectionHandled",e):(t=u.onrejectionhandled)&&t({promise:e,reason:e._v})})},R=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,t._a||(t._a=t._c.slice()),M(t,!0))},j=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw w("Promise can't be resolved itself");(t=O(e))?y(function(){var r={_w:n,_d:!1};try{t.call(e,l(j,r,1),l(R,r,1))}catch(e){R.call(r,e)}}):(n._v=e,n._s=1,M(n,!1))}catch(e){R.call({_w:n,_d:!1},e)}}};D||(E=function(e){d(this,E,"Promise","_h"),h(e),r.call(this);try{e(l(j,this,1),l(R,this,1))}catch(e){R.call(this,e)}},r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(655)(E.prototype,{then:function(e,t){var n=A(v(this,E));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=S?k.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r;this.promise=e,this.resolve=l(j,e,1),this.reject=l(R,e,1)},_.f=A=function(e){return e===E||e===a?new o(e):i(e)}),p(p.G+p.W+p.F*!D,{Promise:E}),n(199)(E,"Promise"),n(656)("Promise"),a=n(63).Promise,p(p.S+p.F*!D,"Promise",{reject:function(e){var t=A(this);return(0,t.reject)(e),t.promise}}),p(p.S+p.F*(s||!D),"Promise",{resolve:function(e){return x(s&&this===a?E:this,e)}}),p(p.S+p.F*!(D&&n(648)(function(e){E.all(e).catch(C)})),"Promise",{all:function(e){var t=this,n=A(t),r=n.resolve,i=n.reject,o=b(function(){var n=[],o=0,a=1;m(e,!1,function(e){var s=o++,u=!1;n.push(void 0),a++,t.resolve(e).then(function(e){u||(u=!0,n[s]=e,--a||r(n))},i)}),--a||r(n)});return o.e&&i(o.v),n.promise},race:function(e){var t=this,n=A(t),r=n.reject,i=b(function(){m(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},function(e,t,n){n(137)("match",1,function(e,t,n){return[function(n){"use strict";var r=e(this),i=void 0==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},n]})},function(e,t,n){n(137)("replace",2,function(e,t,n){return[function(r,i){"use strict";var o=e(this),a=void 0==r?void 0:r[t];return void 0!==a?a.call(r,o,i):n.call(String(o),r,i)},n]})},function(e,t,n){n(137)("search",1,function(e,t,n){return[function(n){"use strict";var r=e(this),i=void 0==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},n]})},function(e,t,n){n(137)("split",2,function(e,t,r){"use strict";var i=n(354),o=r,a=[].push,s="length";if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[s]||2!="ab".split(/(?:ab)*/)[s]||4!=".".split(/(.?)(.?)/)[s]||".".split(/()()/)[s]>1||"".split(/.?/)[s]){var u=void 0===/()??/.exec("")[1];r=function(e,t){var n=String(this);if(void 0===e&&0===t)return[];if(!i(e))return o.call(n,e,t);var r,l,c,p,f,h=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),m=0,v=void 0===t?4294967295:t>>>0,g=new RegExp(e.source,d+"g");for(u||(r=new RegExp("^"+g.source+"$(?!\\s)",d));(l=g.exec(n))&&!((c=l.index+l[0][s])>m&&(h.push(n.slice(m,l.index)),!u&&l[s]>1&&l[0].replace(r,function(){for(f=1;f<arguments[s]-2;f++)void 0===arguments[f]&&(l[f]=void 0)}),l[s]>1&&l.index<n[s]&&a.apply(h,l.slice(1)),p=l[0][s],m=c,h[s]>=v));)g.lastIndex===l.index&&g.lastIndex++;return m===n[s]?!p&&g.test("")||h.push(""):h.push(n.slice(m)),h[s]>v?h.slice(0,v):h}}else"0".split(void 0,0)[s]&&(r=function(e,t){return void 0===e&&0===t?[]:o.call(this,e,t)});return[function(n,i){var o=e(this),a=void 0==n?void 0:n[t];return void 0!==a?a.call(n,o,i):r.call(String(o),n,i)},r]})},function(e,t,n){"use strict";n(29)("anchor",function(e){return function(t){return e(this,"a","name",t)}})},function(e,t,n){"use strict";n(29)("big",function(e){return function(){return e(this,"big","","")}})},function(e,t,n){"use strict";n(29)("blink",function(e){return function(){return e(this,"blink","","")}})},function(e,t,n){"use strict";n(29)("bold",function(e){return function(){return e(this,"b","","")}})},function(e,t,n){"use strict";var r=n(28),i=n(363)(!1);r(r.P,"String",{codePointAt:function(e){return i(this,e)}})},function(e,t,n){"use strict";var r=n(28),i=n(110),o=n(201),a="".endsWith;r(r.P+r.F*n(197)("endsWith"),"String",{endsWith:function(e){var t=o(this,e,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=i(t.length),s=void 0===n?r:Math.min(i(n),r),u=String(e);return a?a.call(t,u,s):t.slice(s-u.length,s)===u}})},function(e,t,n){"use strict";n(29)("fixed",function(e){return function(){return e(this,"tt","","")}})},function(e,t,n){"use strict";n(29)("fontcolor",function(e){return function(t){return e(this,"font","color",t)}})},function(e,t,n){"use strict";n(29)("fontsize",function(e){return function(t){return e(this,"font","size",t)}})},function(e,t,n){var r=n(28),i=n(365),o=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,a=0;r>a;){if(t=+arguments[a++],i(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?o(t):o(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}})},function(e,t,n){"use strict";var r=n(28),i=n(201);r(r.P+r.F*n(197)("includes"),"String",{includes:function(e){return!!~i(this,e,"includes").indexOf(e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){"use strict";n(29)("italics",function(e){return function(){return e(this,"i","","")}})},function(e,t,n){"use strict";n(29)("link",function(e){return function(t){return e(this,"a","href",t)}})},function(e,t,n){var r=n(28),i=n(140),o=n(110);r(r.S,"String",{raw:function(e){for(var t=i(e.raw),n=o(t.length),r=arguments.length,a=[],s=0;n>s;)a.push(String(t[s++])),s<r&&a.push(String(arguments[s]));return a.join("")}})},function(e,t,n){var r=n(28);r(r.P,"String",{repeat:n(657)})},function(e,t,n){"use strict";n(29)("small",function(e){return function(){return e(this,"small","","")}})},function(e,t,n){"use strict";var r=n(28),i=n(110),o=n(201),a="".startsWith;r(r.P+r.F*n(197)("startsWith"),"String",{startsWith:function(e){var t=o(this,e,"startsWith"),n=i(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return a?a.call(t,r,n):t.slice(n,n+r.length)===r}})},function(e,t,n){"use strict";n(29)("strike",function(e){return function(){return e(this,"strike","","")}})},function(e,t,n){"use strict";n(29)("sub",function(e){return function(){return e(this,"sub","","")}})},function(e,t,n){"use strict";n(29)("sup",function(e){return function(){return e(this,"sup","","")}})},function(e,t,n){"use strict";n(658)("trim",function(e){return function(){return e(this,3)}})},function(e,t,n){"use strict";var r=n(28),i=n(63),o=n(31),a=n(362),s=n(359);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,i.Promise||o.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(28),i=n(198),o=n(358);r(r.S,"Promise",{try:function(e){var t=i.f(this),n=o(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){for(var r=n(663),i=n(357),o=n(78),a=n(31),s=n(64),u=n(109),l=n(19),c=l("iterator"),p=l("toStringTag"),f=u.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},d=i(h),m=0;m<d.length;m++){var v,g=d[m],y=h[g],_=a[g],b=_&&_.prototype;if(b&&(b[c]||s(b,c,f),b[p]||s(b,p,g),u[g]=f,y))for(v in r)b[v]||o(b,v,r[v],!0)}},function(e,t,n){"use strict";function r(e){return e}function i(e,t,n){function i(e,t){var n=y.hasOwnProperty(t)?y[t]:null;w.hasOwnProperty(t)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function l(e,n){if(n){s("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!t(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,o=r.__reactAutoBindPairs;n.hasOwnProperty(u)&&_.mixins(e,n.mixins);for(var a in n)if(n.hasOwnProperty(a)&&a!==u){var l=n[a],c=r.hasOwnProperty(a);if(i(c,a),_.hasOwnProperty(a))_[a](e,l);else{var p=y.hasOwnProperty(a),d="function"==typeof l,m=d&&!p&&!c&&!1!==n.autobind;if(m)o.push(a,l),r[a]=l;else if(c){var v=y[a];s(p&&("DEFINE_MANY_MERGED"===v||"DEFINE_MANY"===v),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",v,a),"DEFINE_MANY_MERGED"===v?r[a]=f(r[a],l):"DEFINE_MANY"===v&&(r[a]=h(r[a],l))}else r[a]=l}}}else;}function c(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var i=n in _;s(!i,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var o=n in e;s(!o,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=r}}}function p(e,t){s(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(s(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function f(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var i={};return p(i,n),p(i,r),i}}function h(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function d(e,t){var n=t.bind(e);return n}function m(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],i=t[n+1];e[r]=d(e,i)}}function v(e){var t=r(function(e,r,i){this.__reactAutoBindPairs.length&&m(this),this.props=e,this.context=r,this.refs=a,this.updater=i||n,this.state=null;var o=this.getInitialState?this.getInitialState():null;s("object"==typeof o&&!Array.isArray(o),"%s.getInitialState(): must return an object or null",t.displayName||"ReactCompositeComponent"),this.state=o});t.prototype=new k,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],g.forEach(l.bind(null,t)),l(t,b),l(t,e),l(t,x),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),s(t.prototype.render,"createClass(...): Class specification must implement a `render` method.");for(var i in y)t.prototype[i]||(t.prototype[i]=null);return t}var g=[],y={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},_={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)l(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=o({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=o({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=f(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){e.propTypes=o({},e.propTypes,t)},statics:function(e,t){c(e,t)},autobind:function(){}},b={componentDidMount:function(){this.__isMounted=!0}},x={componentWillUnmount:function(){this.__isMounted=!1}},w={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return!!this.__isMounted}},k=function(){};return o(k.prototype,e.prototype,w),v}var o=n(13),a=n(144),s=n(8),u="mixins";e.exports=i},function(e,t){!function(e){"use strict";function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function r(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return g.iterable&&(t[Symbol.iterator]=function(){return t}),t}function i(e){this.map={},e instanceof i?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function o(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function a(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function s(e){var t=new FileReader,n=a(t);return t.readAsArrayBuffer(e),n}function u(e){var t=new FileReader,n=a(t);return t.readAsText(e),n}function l(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}function c(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(g.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(g.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(g.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(g.arrayBuffer&&g.blob&&_(e))this._bodyArrayBuffer=c(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!g.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!b(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=c(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):g.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},g.blob&&(this.blob=function(){var e=o(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?o(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var e=o(this);if(e)return e;if(this._bodyBlob)return u(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(l(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},g.formData&&(this.formData=function(){return this.text().then(d)}),this.json=function(){return this.text().then(JSON.parse)},this}function f(e){var t=e.toUpperCase();return x.indexOf(t)>-1?t:e}function h(e,t){var n=(t=t||{}).body;if(e instanceof h){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new i(t.headers)),this.method=f(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function d(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}}),t}function m(e){var t=new i;return e.split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}}),t}function v(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var g={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(g.arrayBuffer)var y=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],_=function(e){return e&&DataView.prototype.isPrototypeOf(e)},b=ArrayBuffer.isView||function(e){return e&&y.indexOf(Object.prototype.toString.call(e))>-1};i.prototype.append=function(e,r){e=t(e),r=n(r);var i=this.map[e];this.map[e]=i?i+","+r:r},i.prototype.delete=function(e){delete this.map[t(e)]},i.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},i.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},i.prototype.set=function(e,r){this.map[t(e)]=n(r)},i.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),r(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),r(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),r(e)},g.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);var x=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.clone=function(){return new h(this,{body:this._bodyInit})},p.call(h.prototype),p.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},v.error=function(){var e=new v(null,{status:0,statusText:""});return e.type="error",e};var w=[301,302,303,307,308];v.redirect=function(e,t){if(-1===w.indexOf(t))throw new RangeError("Invalid status code");return new v(null,{status:t,headers:{location:e}})},e.Headers=i,e.Request=h,e.Response=v,e.fetch=function(e,t){return new Promise(function(n,r){var i=new h(e,t),o=new XMLHttpRequest;o.onload=function(){var e={status:o.status,statusText:o.statusText,headers:m(o.getAllResponseHeaders()||"")};e.url="responseURL"in o?o.responseURL:e.headers.get("X-Request-URL");var t="response"in o?o.response:o.responseText;n(new v(t,e))},o.onerror=function(){r(new TypeError("Network request failed"))},o.ontimeout=function(){r(new TypeError("Network request failed"))},o.open(i.method,i.url,!0),"include"===i.credentials&&(o.withCredentials=!0),"responseType"in o&&g.blob&&(o.responseType="blob"),i.headers.forEach(function(e,t){o.setRequestHeader(t,e)}),o.send(void 0===i._bodyInit?null:i._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(e,t){var n={};!function(e){"use strict";function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function r(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return g.iterable&&(t[Symbol.iterator]=function(){return t}),t}function i(e){this.map={},e instanceof i?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function o(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function a(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function s(e){var t=new FileReader,n=a(t);return t.readAsArrayBuffer(e),n}function u(e){var t=new FileReader,n=a(t);return t.readAsText(e),n}function l(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}function c(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(g.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(g.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(g.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(g.arrayBuffer&&g.blob&&_(e))this._bodyArrayBuffer=c(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!g.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!b(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=c(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):g.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},g.blob&&(this.blob=function(){var e=o(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?o(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var e=o(this);if(e)return e;if(this._bodyBlob)return u(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(l(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},g.formData&&(this.formData=function(){return this.text().then(d)}),this.json=function(){return this.text().then(JSON.parse)},this}function f(e){var t=e.toUpperCase();return x.indexOf(t)>-1?t:e}function h(e,t){var n=(t=t||{}).body;if(e instanceof h){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new i(t.headers)),this.method=f(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function d(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}}),t}function m(e){var t=new i;return e.split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}}),t}function v(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var g={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(g.arrayBuffer)var y=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],_=function(e){return e&&DataView.prototype.isPrototypeOf(e)},b=ArrayBuffer.isView||function(e){return e&&y.indexOf(Object.prototype.toString.call(e))>-1};i.prototype.append=function(e,r){e=t(e),r=n(r);var i=this.map[e];this.map[e]=i?i+","+r:r},i.prototype.delete=function(e){delete this.map[t(e)]},i.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},i.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},i.prototype.set=function(e,r){this.map[t(e)]=n(r)},i.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),r(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),r(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),r(e)},g.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);var x=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.clone=function(){return new h(this,{body:this._bodyInit})},p.call(h.prototype),p.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},v.error=function(){var e=new v(null,{status:0,statusText:""});return e.type="error",e};var w=[301,302,303,307,308];v.redirect=function(e,t){if(-1===w.indexOf(t))throw new RangeError("Invalid status code");return new v(null,{status:t,headers:{location:e}})},e.Headers=i,e.Request=h,e.Response=v,e.fetch=function(e,t){return new Promise(function(n,r){var i=new h(e,t),o=new XMLHttpRequest;o.onload=function(){var e={status:o.status,statusText:o.statusText,headers:m(o.getAllResponseHeaders()||"")};e.url="responseURL"in o?o.responseURL:e.headers.get("X-Request-URL");var t="response"in o?o.response:o.responseText;n(new v(t,e))},o.onerror=function(){r(new TypeError("Network request failed"))},o.ontimeout=function(){r(new TypeError("Network request failed"))},o.open(i.method,i.url,!0),"include"===i.credentials&&(o.withCredentials=!0),"responseType"in o&&g.blob&&(o.responseType="blob"),i.headers.forEach(function(e,t){o.setRequestHeader(t,e)}),o.send(void 0===i._bodyInit?null:i._bodyInit)})},e.fetch.polyfill=!0}}(void 0!==n?n:this),e.exports=n},function(e,t,n){(function(t){!function(t,n){e.exports=n(t)}(void 0!==t?t:this,function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,n=String(e),r=n.length,i=-1,o="",a=n.charCodeAt(0);++i<r;)t=n.charCodeAt(i),o+=0!=t?t>=1&&t<=31||127==t||0==i&&t>=48&&t<=57||1==i&&t>=48&&t<=57&&45==a?"\\"+t.toString(16)+" ":(0!=i||1!=r||45!=t)&&(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?n.charAt(i):"\\"+n.charAt(i):"�";return o};return e.CSS||(e.CSS={}),e.CSS.escape=t,t})}).call(t,n(17))},function(e,t,n){function r(e,t){if(e){var n,r="";for(var i in e)n=e[i],r&&(r+=" "),!n&&p[i]?r+=i:r+=i+'="'+(t.decodeEntities?c.encodeXML(n):n)+'"';return r}}function i(e,t){"svg"===e.name&&(t={decodeEntities:t.decodeEntities,xmlMode:!0});var n="<"+e.name,i=r(e.attribs,t);return i&&(n+=" "+i),!t.xmlMode||e.children&&0!==e.children.length?(n+=">",e.children&&(n+=d(e.children,t)),h[e.name]&&!t.xmlMode||(n+="</"+e.name+">")):n+="/>",n}function o(e){return"<"+e.data+">"}function a(e,t){var n=e.data||"";return!t.decodeEntities||e.parent&&e.parent.name in f||(n=c.encodeXML(n)),n}function s(e){return"<![CDATA["+e.children[0].data+"]]>"}function u(e){return"\x3c!--"+e.data+"--\x3e"}var l=n(699),c=n(114),p={__proto__:null,allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,hidden:!0,ismap:!0,loop:!0,multiple:!0,muted:!0,open:!0,readonly:!0,required:!0,reversed:!0,scoped:!0,seamless:!0,selected:!0,typemustmatch:!0},f={__proto__:null,style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,plaintext:!0,noscript:!0},h={__proto__:null,area:!0,base:!0,basefont:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,isindex:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},d=e.exports=function(e,t){Array.isArray(e)||e.cheerio||(e=[e]),t=t||{};for(var n="",r=0;r<e.length;r++){var c=e[r];"root"===c.type?n+=d(c.children,t):l.isTag(c)?n+=i(c,t):c.type===l.Directive?n+=o(c):c.type===l.Comment?n+=u(c):c.type===l.CDATA?n+=s(c):n+=a(c,t)}return n}},function(e,t){e.exports={Text:"text",Directive:"directive",Comment:"comment",Script:"script",Style:"style",Tag:"tag",CDATA:"cdata",isTag:function(e){return"tag"===e.type||"script"===e.type||"style"===e.type}}},function(e,t,n){function r(e,t,n){"object"==typeof e?(n=t,t=e,e=null):"function"==typeof t&&(n=t,t=u),this._callback=e,this._options=t||u,this._elementCB=n,this.dom=[],this._done=!1,this._tagStack=[],this._parser=this._parser||null}var i=n(113),o=/\s+/g,a=n(368),s=n(701),u={normalizeWhitespace:!1,withStartIndices:!1,withEndIndices:!1};r.prototype.onparserinit=function(e){this._parser=e},r.prototype.onreset=function(){r.call(this,this._callback,this._options,this._elementCB)},r.prototype.onend=function(){this._done||(this._done=!0,this._parser=null,this._handleCallback(null))},r.prototype._handleCallback=r.prototype.onerror=function(e){if("function"==typeof this._callback)this._callback(e,this.dom);else if(e)throw e},r.prototype.onclosetag=function(){var e=this._tagStack.pop();this._options.withEndIndices&&(e.endIndex=this._parser.endIndex),this._elementCB&&this._elementCB(e)},r.prototype._createDomElement=function(e){if(!this._options.withDomLvl1)return e;var t;t="tag"===e.type?Object.create(s):Object.create(a);for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},r.prototype._addDomElement=function(e){var t=this._tagStack[this._tagStack.length-1],n=t?t.children:this.dom,r=n[n.length-1];e.next=null,this._options.withStartIndices&&(e.startIndex=this._parser.startIndex),this._options.withEndIndices&&(e.endIndex=this._parser.endIndex),r?(e.prev=r,r.next=e):e.prev=null,n.push(e),e.parent=t||null},r.prototype.onopentag=function(e,t){var n={type:"script"===e?i.Script:"style"===e?i.Style:i.Tag,name:e,attribs:t,children:[]},r=this._createDomElement(n);this._addDomElement(r),this._tagStack.push(r)},r.prototype.ontext=function(e){var t,n=this._options.normalizeWhitespace||this._options.ignoreWhitespace;if(!this._tagStack.length&&this.dom.length&&(t=this.dom[this.dom.length-1]).type===i.Text)n?t.data=(t.data+e).replace(o," "):t.data+=e;else if(this._tagStack.length&&(t=this._tagStack[this._tagStack.length-1])&&(t=t.children[t.children.length-1])&&t.type===i.Text)n?t.data=(t.data+e).replace(o," "):t.data+=e;else{n&&(e=e.replace(o," "));var r=this._createDomElement({data:e,type:i.Text});this._addDomElement(r)}},r.prototype.oncomment=function(e){var t=this._tagStack[this._tagStack.length-1];if(t&&t.type===i.Comment)return void(t.data+=e);var n={data:e,type:i.Comment},r=this._createDomElement(n);this._addDomElement(r),this._tagStack.push(r)},r.prototype.oncdatastart=function(){var e={children:[{data:"",type:i.Text}],type:i.CDATA},t=this._createDomElement(e);this._addDomElement(t),this._tagStack.push(t)},r.prototype.oncommentend=r.prototype.oncdataend=function(){this._tagStack.pop()},r.prototype.onprocessinginstruction=function(e,t){var n=this._createDomElement({name:e,data:t,type:i.Directive});this._addDomElement(n)},e.exports=r},function(e,t,n){var r=n(368),i=e.exports=Object.create(r),o={tagName:"name"};Object.keys(o).forEach(function(e){var t=o[e];Object.defineProperty(i,e,{get:function(){return this[t]||null},set:function(e){return this[t]=e,e}})})},function(e,t,n){var r=e.exports;[n(707),n(708),n(705),n(706),n(704),n(703)].forEach(function(e){Object.keys(e).forEach(function(t){r[t]=e[t].bind(r)})})},function(e,t){t.removeSubsets=function(e){for(var t,n,r,i=e.length;--i>-1;){for(t=n=e[i],e[i]=null,r=!0;n;){if(e.indexOf(n)>-1){r=!1,e.splice(i,1);break}n=n.parent}r&&(e[i]=t)}return e};var n={DISCONNECTED:1,PRECEDING:2,FOLLOWING:4,CONTAINS:8,CONTAINED_BY:16},r=t.compareDocumentPosition=function(e,t){var r,i,o,a,s,u,l=[],c=[];if(e===t)return 0;for(r=e;r;)l.unshift(r),r=r.parent;for(r=t;r;)c.unshift(r),r=r.parent;for(u=0;l[u]===c[u];)u++;return 0===u?n.DISCONNECTED:(i=l[u-1],o=i.children,a=l[u],s=c[u],o.indexOf(a)>o.indexOf(s)?i===t?n.FOLLOWING|n.CONTAINED_BY:n.FOLLOWING:i===e?n.PRECEDING|n.CONTAINS:n.PRECEDING)};t.uniqueSort=function(e){var t,i,o=e.length;for(e=e.slice();--o>-1;)t=e[o],(i=e.indexOf(t))>-1&&i<o&&e.splice(o,1);return e.sort(function(e,t){var i=r(e,t);return i&n.PRECEDING?-1:i&n.FOLLOWING?1:0}),e}},function(e,t,n){function r(e,t){return"function"==typeof t?function(n){return n.attribs&&t(n.attribs[e])}:function(n){return n.attribs&&n.attribs[e]===t}}function i(e,t){return function(n){return e(n)||t(n)}}var o=n(113),a=t.isTag=o.isTag;t.testElement=function(e,t){for(var n in e)if(e.hasOwnProperty(n)){if("tag_name"===n){if(!a(t)||!e.tag_name(t.name))return!1}else if("tag_type"===n){if(!e.tag_type(t.type))return!1}else if("tag_contains"===n){if(a(t)||!e.tag_contains(t.data))return!1}else if(!t.attribs||!e[n](t.attribs[n]))return!1}else;return!0};var s={tag_name:function(e){return"function"==typeof e?function(t){return a(t)&&e(t.name)}:"*"===e?a:function(t){return a(t)&&t.name===e}},tag_type:function(e){return"function"==typeof e?function(t){return e(t.type)}:function(t){return t.type===e}},tag_contains:function(e){return"function"==typeof e?function(t){return!a(t)&&e(t.data)}:function(t){return!a(t)&&t.data===e}}};t.getElements=function(e,t,n,o){var a=Object.keys(e).map(function(t){var n=e[t];return t in s?s[t](n):r(t,n)});return 0===a.length?[]:this.filter(a.reduce(i),t,n,o)},t.getElementById=function(e,t,n){return Array.isArray(t)||(t=[t]),this.findOne(r("id",e),t,!1!==n)},t.getElementsByTagName=function(e,t,n,r){return this.filter(s.tag_name(e),t,n,r)},t.getElementsByTagType=function(e,t,n,r){return this.filter(s.tag_type(e),t,n,r)}},function(e,t){t.removeElement=function(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){var t=e.parent.children;t.splice(t.lastIndexOf(e),1)}},t.replaceElement=function(e,t){var n=t.prev=e.prev;n&&(n.next=t);var r=t.next=e.next;r&&(r.prev=t);var i=t.parent=e.parent;if(i){var o=i.children;o[o.lastIndexOf(e)]=t}},t.appendChild=function(e,t){if(t.parent=e,1!==e.children.push(t)){var n=e.children[e.children.length-2];n.next=t,t.prev=n,t.next=null}},t.append=function(e,t){var n=e.parent,r=e.next;if(t.next=r,t.prev=e,e.next=t,t.parent=n,r){if(r.prev=t,n){var i=n.children;i.splice(i.lastIndexOf(r),0,t)}}else n&&n.children.push(t)},t.prepend=function(e,t){var n=e.parent;if(n){var r=n.children;r.splice(r.lastIndexOf(e),0,t)}e.prev&&(e.prev.next=t),t.parent=n,t.prev=e.prev,t.next=e,e.prev=t}},function(e,t,n){function r(e,t,n,r){return Array.isArray(t)||(t=[t]),"number"==typeof r&&isFinite(r)||(r=1/0),i(e,t,!1!==n,r)}function i(e,t,n,r){for(var o,a=[],s=0,u=t.length;s<u&&!(e(t[s])&&(a.push(t[s]),--r<=0))&&(o=t[s].children,!(n&&o&&o.length>0&&(o=i(e,o,n,r),a=a.concat(o),(r-=o.length)<=0)));s++);return a}function o(e,t){for(var n=0,r=t.length;n<r;n++)if(e(t[n]))return t[n];return null}function a(e,t){for(var n=null,r=0,i=t.length;r<i&&!n;r++)l(t[r])&&(e(t[r])?n=t[r]:t[r].children.length>0&&(n=a(e,t[r].children)));return n}function s(e,t){for(var n=0,r=t.length;n<r;n++)if(l(t[n])&&(e(t[n])||t[n].children.length>0&&s(e,t[n].children)))return!0;return!1}function u(e,t){for(var n=[],r=[t];r.length;){for(var i=r.pop(),o=0,a=i.length;o<a;o++)l(i[o])&&e(i[o])&&n.push(i[o]);for(;a-- >0;)i[a].children&&i[a].children.length>0&&r.push(i[a].children)}return n}var l=n(113).isTag;e.exports={filter:r,find:i,findOneChild:o,findOne:a,existsOne:s,findAll:u}},function(e,t,n){function r(e,t){return e.children?e.children.map(function(e){return a(e,t)}).join(""):""}function i(e){return Array.isArray(e)?e.map(i).join(""):s(e)?"br"===e.name?"\n":i(e.children):e.type===o.CDATA?i(e.children):e.type===o.Text?e.data:""}var o=n(113),a=n(698),s=o.isTag;e.exports={getInnerHTML:r,getOuterHTML:a,getText:i}},function(e,t){var n=t.getChildren=function(e){return e.children},r=t.getParent=function(e){return e.parent};t.getSiblings=function(e){var t=r(e);return t?n(t):[e]},t.getAttributeValue=function(e,t){return e.attribs&&e.attribs[t]},t.hasAttrib=function(e,t){return!!e.attribs&&hasOwnProperty.call(e.attribs,t)},t.getName=function(e){return e.name}},function(e,t,n){"use strict";var r=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})};e.exports=r},function(e,t,n){function r(e){var t=Object.keys(e).join("|"),n=o(e);t+="|#[xX][\\da-fA-F]+|#\\d+";var r=new RegExp("&(?:"+t+");","g");return function(e){return String(e).replace(r,n)}}function i(e,t){return e<t?1:-1}function o(e){return function(t){return"#"===t.charAt(1)?l("X"===t.charAt(2)||"x"===t.charAt(2)?parseInt(t.substr(3),16):parseInt(t.substr(2),10)):e[t.slice(1,-1)]}}var a=n(204),s=n(370),u=n(205),l=n(369),c=r(u),p=r(a),f=function(){function e(e){return";"!==e.substr(-1)&&(e+=";"),c(e)}for(var t=Object.keys(s).sort(i),n=Object.keys(a).sort(i),r=0,u=0;r<n.length;r++)t[u]===n[r]?(n[r]+=";?",u++):n[r]+=";";var l=new RegExp("&(?:"+n.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),c=o(a);return function(t){return String(t).replace(l,e)}}();e.exports={XML:c,HTML:f,HTMLStrict:p}},function(e,t,n){function r(e){return Object.keys(e).sort().reduce(function(t,n){return t[e[n]]="&"+n+";",t},{})}function i(e){var t=[],n=[];return Object.keys(e).forEach(function(e){1===e.length?t.push("\\"+e):n.push(e)}),n.unshift("["+t.join("")+"]"),new RegExp(n.join("|"),"g")}function o(e){return"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"}function a(e){return"&#x"+(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536).toString(16).toUpperCase()+";"}function s(e,t){function n(t){return e[t]}return function(e){return e.replace(t,n).replace(d,a).replace(h,o)}}function u(e){return e.replace(m,o).replace(d,a).replace(h,o)}var l=r(n(205)),c=i(l);t.XML=s(l,c);var p=r(n(204)),f=i(p);t.HTML=s(p,f);var h=/[^\0-\x7F]/g,d=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,m=i(l);t.escape=u},function(e,t){e.exports={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376}},function(e,t,n){"use strict";e.exports=function(){var e,t,n=Array.from;return"function"==typeof n&&(e=["raz","dwa"],t=n(e),Boolean(t&&t!==e&&"dwa"===t[1]))}},function(e,t,n){"use strict";var r=n(738).iterator,i=n(717),o=n(718),a=n(65),s=n(58),u=n(115),l=n(79),c=n(737),p=Array.isArray,f=Function.prototype.call,h={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;e.exports=function(e){var t,n,m,v,g,y,_,b,x,w,k=arguments[1],E=arguments[2];if(e=Object(u(e)),l(k)&&s(k),this&&this!==Array&&o(this))t=this;else{if(!k){if(i(e))return 1!==(g=e.length)?Array.apply(null,e):(v=new Array(1),v[0]=e[0],v);if(p(e)){for(v=new Array(g=e.length),n=0;n<g;++n)v[n]=e[n];return v}}v=[]}if(!p(e))if(void 0!==(x=e[r])){for(_=s(x).call(e),t&&(v=new t),b=_.next(),n=0;!b.done;)w=k?f.call(k,E,b.value,n):b.value,t?(h.value=w,d(v,n,h)):v[n]=w,b=_.next(),++n;g=n}else if(c(e)){for(g=e.length,t&&(v=new t),n=0,m=0;n<g;++n)w=e[n],n+1<g&&(y=w.charCodeAt(0))>=55296&&y<=56319&&(w+=e[++n]),w=k?f.call(k,E,w,m):w,t?(h.value=w,d(v,m,h)):v[m]=w,++m;g=m}if(void 0===g)for(g=a(e.length),t&&(v=new t(g)),n=0;n<g;++n)w=k?f.call(k,E,e[n],n):e[n],t?(h.value=w,d(v,n,h)):v[n]=w;return t&&(h.value=null,v.length=g),v}},function(e,t,n){"use strict";var r=n(207),i=Array.isArray;e.exports=function(e){return i(e)?e:r(e)}},function(e,t,n){"use strict";var r=n(373),i=n(730),o=n(79),a=Error.captureStackTrace;t=e.exports=function(e){var n=new Error(e),s=arguments[1],u=arguments[2];return o(u)||i(s)&&(u=s,s=null),o(u)&&r(n,u),o(s)&&(n.code=s),a&&a(n,t),n}},function(e,t,n){"use strict";var r=Object.prototype.toString,i=r.call(function(){return arguments}());e.exports=function(e){return r.call(e)===i}},function(e,t,n){"use strict";var r=Object.prototype.toString,i=r.call(n(372));e.exports=function(e){return"function"==typeof e&&r.call(e)===i}},function(e,t,n){"use strict";e.exports=n(720)()?Math.sign:n(721)},function(e,t,n){"use strict";e.exports=function(){var e=Math.sign;return"function"==typeof e&&(1===e(10)&&-1===e(-20))}},function(e,t,n){"use strict";e.exports=function(e){return e=Number(e),isNaN(e)||0===e?e:e>0?1:-1}},function(e,t,n){"use strict";e.exports=n(723)()?Number.isNaN:n(724)},function(e,t,n){"use strict";e.exports=function(){var e=Number.isNaN;return"function"==typeof e&&(!e({})&&e(NaN)&&!e(34))}},function(e,t,n){"use strict";e.exports=function(e){return e!==e}},function(e,t,n){"use strict";var r=n(719),i=Math.abs,o=Math.floor;e.exports=function(e){return isNaN(e)?0:(e=Number(e),0!==e&&isFinite(e)?r(e)*o(i(e)):e)}},function(e,t,n){"use strict";var r=n(58),i=n(115),o=Function.prototype.bind,a=Function.prototype.call,s=Object.keys,u=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(n,l){var c,p=arguments[2],f=arguments[3];return n=Object(i(n)),r(l),c=s(n),f&&c.sort("function"==typeof f?o.call(f,n):void 0),"function"!=typeof e&&(e=c[e]),a.call(e,c,function(e,r){return u.call(n,e)?a.call(l,p,n[e],e,n,r):t})}}},function(e,t,n){"use strict";e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(e={foo:"raz"},t(e,{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,n){"use strict";var r=n(731),i=n(115),o=Math.max;e.exports=function(e,t){var n,a,s,u=o(arguments.length,2);for(e=Object(i(e)),s=function(r){try{e[r]=t[r]}catch(e){n||(n=e)}},a=1;a<u;++a)t=arguments[a],r(t).forEach(s);if(void 0!==n)throw n;return e}},function(e,t,n){"use strict";e.exports=function(e){return"function"==typeof e}},function(e,t,n){"use strict";var r=n(79),i={function:!0,object:!0};e.exports=function(e){return r(e)&&i[typeof e]||!1}},function(e,t,n){"use strict";e.exports=n(732)()?Object.keys:n(733)},function(e,t,n){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,n){"use strict";var r=n(79),i=Object.keys;e.exports=function(e){return i(r(e)?Object(e):e)}},function(e,t,n){"use strict";e.exports=n(735)()?String.prototype.contains:n(736)},function(e,t,n){"use strict";var r="razdwatrzy";e.exports=function(){return"function"==typeof r.contains&&(!0===r.contains("dwa")&&!1===r.contains("foo"))}},function(e,t,n){"use strict";var r=String.prototype.indexOf;e.exports=function(e){return r.call(this,e,arguments[1])>-1}},function(e,t,n){"use strict";var r=Object.prototype.toString,i=r.call("");e.exports=function(e){return"string"==typeof e||e&&"object"==typeof e&&(e instanceof String||r.call(e)===i)||!1}},function(e,t,n){"use strict";e.exports=n(739)()?Symbol:n(741)},function(e,t,n){"use strict";var r={object:!0,symbol:!0};e.exports=function(){var e;if("function"!=typeof Symbol)return!1;e=Symbol("test symbol");try{String(e)}catch(e){return!1}return!!r[typeof Symbol.iterator]&&(!!r[typeof Symbol.toPrimitive]&&!!r[typeof Symbol.toStringTag])}},function(e,t,n){"use strict";e.exports=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&("Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag]))}},function(e,t,n){"use strict";var r,i,o,a,s=n(141),u=n(742),l=Object.create,c=Object.defineProperties,p=Object.defineProperty,f=Object.prototype,h=l(null);if("function"==typeof Symbol){r=Symbol;try{String(r()),a=!0}catch(e){}}var d=function(){var e=l(null);return function(t){for(var n,r,i=0;e[t+(i||"")];)++i;return t+=i||"",e[t]=!0,n="@@"+t,p(f,n,s.gs(null,function(e){r||(r=!0,p(this,n,s(e)),r=!1)})),n}}();o=function(e){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return i(e)},e.exports=i=function e(t){var n;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return a?r(t):(n=l(o.prototype),t=void 0===t?"":String(t),c(n,{__description__:s("",t),__name__:s("",d(t))}))},c(i,{for:s(function(e){return h[e]?h[e]:h[e]=i(String(e))}),keyFor:s(function(e){var t;u(e);for(t in h)if(h[t]===e)return t}),hasInstance:s("",r&&r.hasInstance||i("hasInstance")),isConcatSpreadable:s("",r&&r.isConcatSpreadable||i("isConcatSpreadable")),iterator:s("",r&&r.iterator||i("iterator")),match:s("",r&&r.match||i("match")),replace:s("",r&&r.replace||i("replace")),search:s("",r&&r.search||i("search")),species:s("",r&&r.species||i("species")),split:s("",r&&r.split||i("split")),toPrimitive:s("",r&&r.toPrimitive||i("toPrimitive")),toStringTag:s("",r&&r.toStringTag||i("toStringTag")),unscopables:s("",r&&r.unscopables||i("unscopables"))}),c(o.prototype,{constructor:s(i),toString:s("",function(){return this.__name__})}),c(i.prototype,{toString:s(function(){return"Symbol ("+u(this).__description__+")"}),valueOf:s(function(){return u(this)})}),p(i.prototype,i.toPrimitive,s("",function(){var e=u(this);return"symbol"==typeof e?e:e.toString()})),p(i.prototype,i.toStringTag,s("c","Symbol")),p(o.prototype,i.toStringTag,s("c",i.prototype[i.toStringTag])),p(o.prototype,i.toPrimitive,s("c",i.prototype[i.toPrimitive]))},function(e,t,n){"use strict";var r=n(740);e.exports=function(e){if(!r(e))throw new TypeError(e+" is not a symbol");return e}},function(e,t,n){!function(t,n){e.exports=n()}(0,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e,t,n){var r=null,i=function(e,t){n&&n(e,t),r&&r.visit(e,t)},o="function"==typeof n?i:null,a=!1;if(t){a="boolean"==typeof t.comment&&t.comment;var c="boolean"==typeof t.attachComment&&t.attachComment;(a||c)&&(r=new s.CommentHandler,r.attach=c,t.comment=!0,o=i)}var p=!1;t&&"string"==typeof t.sourceType&&(p="module"===t.sourceType);var f;f=t&&"boolean"==typeof t.jsx&&t.jsx?new u.JSXParser(e,t,o):new l.Parser(e,t,o);var h=p?f.parseModule():f.parseScript(),d=h;return a&&r&&(d.comments=r.comments),f.config.tokens&&(d.tokens=f.tokens),f.config.tolerant&&(d.errors=f.errorHandler.errors),d}function i(e,t,n){var i=t||{};return i.sourceType="module",r(e,i,n)}function o(e,t,n){var i=t||{};return i.sourceType="script",r(e,i,n)}function a(e,t,n){var r,i=new c.Tokenizer(e,t);r=[];try{for(;;){var o=i.getNextToken();if(!o)break;n&&(o=n(o)),r.push(o)}}catch(e){i.errorHandler.tolerate(e)}return i.errorHandler.tolerant&&(r.errors=i.errors()),r}Object.defineProperty(t,"__esModule",{value:!0});var s=n(1),u=n(3),l=n(8),c=n(15);t.parse=r,t.parseModule=i,t.parseScript=o,t.tokenize=a;var p=n(2);t.Syntax=p.Syntax,t.version="4.0.0"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(){function e(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return e.prototype.insertInnerComments=function(e,t){if(e.type===r.Syntax.BlockStatement&&0===e.body.length){for(var n=[],i=this.leading.length-1;i>=0;--i){var o=this.leading[i];t.end.offset>=o.start&&(n.unshift(o.comment),this.leading.splice(i,1),this.trailing.splice(i,1))}n.length&&(e.innerComments=n)}},e.prototype.findTrailingComments=function(e){var t=[];if(this.trailing.length>0){for(var n=this.trailing.length-1;n>=0;--n){var r=this.trailing[n];r.start>=e.end.offset&&t.unshift(r.comment)}return this.trailing.length=0,t}var i=this.stack[this.stack.length-1];if(i&&i.node.trailingComments){var o=i.node.trailingComments[0];o&&o.range[0]>=e.end.offset&&(t=i.node.trailingComments,delete i.node.trailingComments)}return t},e.prototype.findLeadingComments=function(e){for(var t,n=[];this.stack.length>0;){var r=this.stack[this.stack.length-1];if(!(r&&r.start>=e.start.offset))break;t=r.node,this.stack.pop()}if(t){for(var i=t.leadingComments?t.leadingComments.length:0,o=i-1;o>=0;--o){var a=t.leadingComments[o];a.range[1]<=e.start.offset&&(n.unshift(a),t.leadingComments.splice(o,1))}return t.leadingComments&&0===t.leadingComments.length&&delete t.leadingComments,n}for(var o=this.leading.length-1;o>=0;--o){var r=this.leading[o];r.start<=e.start.offset&&(n.unshift(r.comment),this.leading.splice(o,1))}return n},e.prototype.visitNode=function(e,t){if(!(e.type===r.Syntax.Program&&e.body.length>0)){this.insertInnerComments(e,t);var n=this.findTrailingComments(t),i=this.findLeadingComments(t);i.length>0&&(e.leadingComments=i),n.length>0&&(e.trailingComments=n),this.stack.push({node:e,start:t.start.offset})}},e.prototype.visitComment=function(e,t){var n="L"===e.type[0]?"Line":"Block",r={type:n,value:e.value};if(e.range&&(r.range=e.range),e.loc&&(r.loc=e.loc),this.comments.push(r),this.attach){var i={comment:{type:n,value:e.value,range:[t.start.offset,t.end.offset]},start:t.start.offset};e.loc&&(i.comment.loc=e.loc),e.type=n,this.leading.push(i),this.trailing.push(i)}},e.prototype.visit=function(e,t){"LineComment"===e.type?this.visitComment(e,t):"BlockComment"===e.type?this.visitComment(e,t):this.attach&&this.visitNode(e,t)},e}();t.CommentHandler=i},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(e,t,n){"use strict";function r(e){var t;switch(e.type){case s.JSXSyntax.JSXIdentifier:t=e.name;break;case s.JSXSyntax.JSXNamespacedName:var n=e;t=r(n.namespace)+":"+r(n.name);break;case s.JSXSyntax.JSXMemberExpression:var i=e;t=r(i.object)+"."+r(i.property)}return t}var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),a=n(5),s=n(6),u=n(7),l=n(8),c=n(13),p=n(14);c.TokenName[100]="JSXIdentifier",c.TokenName[101]="JSXText";var f=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}return i(t,e),t.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():e.prototype.parsePrimaryExpression.call(this)},t.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},t.prototype.finishJSX=function(){this.nextToken()},t.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},t.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.scanXHTMLEntity=function(e){for(var t="&",n=!0,r=!1,i=!1,a=!1;!this.scanner.eof()&&n&&!r;){var s=this.scanner.source[this.scanner.index];if(s===e)break;if(r=";"===s,t+=s,++this.scanner.index,!r)switch(t.length){case 2:i="#"===s;break;case 3:i&&(a="x"===s,n=a||o.Character.isDecimalDigit(s.charCodeAt(0)),i=i&&!a);break;default:n=n&&!(i&&!o.Character.isDecimalDigit(s.charCodeAt(0))),n=n&&!(a&&!o.Character.isHexDigit(s.charCodeAt(0)))}}if(n&&r&&t.length>2){var u=t.substr(1,t.length-2);i&&u.length>1?t=String.fromCharCode(parseInt(u.substr(1),10)):a&&u.length>2?t=String.fromCharCode(parseInt("0"+u.substr(1),16)):i||a||!p.XHTMLEntities[u]||(t=p.XHTMLEntities[u])}return t},t.prototype.lexJSX=function(){var e=this.scanner.source.charCodeAt(this.scanner.index);if(60===e||62===e||47===e||58===e||61===e||123===e||125===e){var t=this.scanner.source[this.scanner.index++];return{type:7,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index}}if(34===e||39===e){for(var n=this.scanner.index,r=this.scanner.source[this.scanner.index++],i="";!this.scanner.eof();){var a=this.scanner.source[this.scanner.index++];if(a===r)break;i+="&"===a?this.scanXHTMLEntity(r):a}return{type:8,value:i,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}if(46===e){var s=this.scanner.source.charCodeAt(this.scanner.index+1),u=this.scanner.source.charCodeAt(this.scanner.index+2),t=46===s&&46===u?"...":".",n=this.scanner.index;return this.scanner.index+=t.length,{type:7,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}if(96===e)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(o.Character.isIdentifierStart(e)&&92!==e){var n=this.scanner.index;for(++this.scanner.index;!this.scanner.eof();){var a=this.scanner.source.charCodeAt(this.scanner.index);if(o.Character.isIdentifierPart(a)&&92!==a)++this.scanner.index;else{if(45!==a)break;++this.scanner.index}}return{type:100,value:this.scanner.source.slice(n,this.scanner.index),lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}return this.scanner.lex()},t.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var e=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(e)),e},t.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var e=this.scanner.index,t="";!this.scanner.eof();){var n=this.scanner.source[this.scanner.index];if("{"===n||"<"===n)break;++this.scanner.index,t+=n,o.Character.isLineTerminator(n.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===n&&"\n"===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var r={type:101,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index};return t.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(r)),r},t.prototype.peekJSXToken=function(){var e=this.scanner.saveState();this.scanner.scanComments();var t=this.lexJSX();return this.scanner.restoreState(e),t},t.prototype.expectJSX=function(e){var t=this.nextJSXToken();7===t.type&&t.value===e||this.throwUnexpectedToken(t)},t.prototype.matchJSX=function(e){var t=this.peekJSXToken();return 7===t.type&&t.value===e},t.prototype.parseJSXIdentifier=function(){var e=this.createJSXNode(),t=this.nextJSXToken();return 100!==t.type&&this.throwUnexpectedToken(t),this.finalize(e,new a.JSXIdentifier(t.value))},t.prototype.parseJSXElementName=function(){var e=this.createJSXNode(),t=this.parseJSXIdentifier();if(this.matchJSX(":")){var n=t;this.expectJSX(":");var r=this.parseJSXIdentifier();t=this.finalize(e,new a.JSXNamespacedName(n,r))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var i=t;this.expectJSX(".");var o=this.parseJSXIdentifier();t=this.finalize(e,new a.JSXMemberExpression(i,o))}return t},t.prototype.parseJSXAttributeName=function(){var e,t=this.createJSXNode(),n=this.parseJSXIdentifier();if(this.matchJSX(":")){var r=n;this.expectJSX(":");var i=this.parseJSXIdentifier();e=this.finalize(t,new a.JSXNamespacedName(r,i))}else e=n;return e},t.prototype.parseJSXStringLiteralAttribute=function(){var e=this.createJSXNode(),t=this.nextJSXToken();8!==t.type&&this.throwUnexpectedToken(t);var n=this.getTokenRaw(t);return this.finalize(e,new u.Literal(t.value,n))},t.prototype.parseJSXExpressionAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new a.JSXExpressionContainer(t))},t.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},t.prototype.parseJSXNameValueAttribute=function(){var e=this.createJSXNode(),t=this.parseJSXAttributeName(),n=null;return this.matchJSX("=")&&(this.expectJSX("="),n=this.parseJSXAttributeValue()),this.finalize(e,new a.JSXAttribute(t,n))},t.prototype.parseJSXSpreadAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new a.JSXSpreadAttribute(t))},t.prototype.parseJSXAttributes=function(){for(var e=[];!this.matchJSX("/")&&!this.matchJSX(">");){var t=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();e.push(t)}return e},t.prototype.parseJSXOpeningElement=function(){var e=this.createJSXNode();this.expectJSX("<");var t=this.parseJSXElementName(),n=this.parseJSXAttributes(),r=this.matchJSX("/");return r&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new a.JSXOpeningElement(t,r,n))},t.prototype.parseJSXBoundaryElement=function(){var e=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var t=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(e,new a.JSXClosingElement(t))}var n=this.parseJSXElementName(),r=this.parseJSXAttributes(),i=this.matchJSX("/");return i&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new a.JSXOpeningElement(n,i,r))},t.prototype.parseJSXEmptyExpression=function(){var e=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(e,new a.JSXEmptyExpression)},t.prototype.parseJSXExpressionContainer=function(){var e=this.createJSXNode();this.expectJSX("{");var t;return this.matchJSX("}")?(t=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),t=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(e,new a.JSXExpressionContainer(t))},t.prototype.parseJSXChildren=function(){for(var e=[];!this.scanner.eof();){var t=this.createJSXChildNode(),n=this.nextJSXText();if(n.start<n.end){var r=this.getTokenRaw(n),i=this.finalize(t,new a.JSXText(n.value,r));e.push(i)}if("{"!==this.scanner.source[this.scanner.index])break;var o=this.parseJSXExpressionContainer();e.push(o)}return e},t.prototype.parseComplexJSXElement=function(e){for(var t=[];!this.scanner.eof();){e.children=e.children.concat(this.parseJSXChildren());var n=this.createJSXChildNode(),i=this.parseJSXBoundaryElement();if(i.type===s.JSXSyntax.JSXOpeningElement){var o=i;if(o.selfClosing){var u=this.finalize(n,new a.JSXElement(o,[],null));e.children.push(u)}else t.push(e),e={node:n,opening:o,closing:null,children:[]}}if(i.type===s.JSXSyntax.JSXClosingElement){e.closing=i;var l=r(e.opening.name);if(l!==r(e.closing.name)&&this.tolerateError("Expected corresponding JSX closing tag for %0",l),!(t.length>0))break;var u=this.finalize(e.node,new a.JSXElement(e.opening,e.children,e.closing));e=t[t.length-1],e.children.push(u),t.pop()}}return e},t.prototype.parseJSXElement=function(){var e=this.createJSXNode(),t=this.parseJSXOpeningElement(),n=[],r=null;if(!t.selfClosing){var i=this.parseComplexJSXElement({node:e,opening:t,closing:r,children:n});n=i.children,r=i.closing}return this.finalize(e,new a.JSXElement(t,n,r))},t.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var e=this.parseJSXElement();return this.finishJSX(),e},t.prototype.isStartOfExpression=function(){return e.prototype.isStartOfExpression.call(this)||this.match("<")},t}(l.Parser);t.JSXParser=f},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={NonAsciiIdentifierStart:/[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\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\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\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u1877\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\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\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-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};t.Character={fromCodePoint:function(e){return e<65536?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023))},isWhiteSpace:function(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0},isLineTerminator:function(e){return 10===e||13===e||8232===e||8233===e},isIdentifierStart:function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&n.NonAsciiIdentifierStart.test(t.Character.fromCodePoint(e))},isIdentifierPart:function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&n.NonAsciiIdentifierPart.test(t.Character.fromCodePoint(e))},isDecimalDigit:function(e){return e>=48&&e<=57},isHexDigit:function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},isOctalDigit:function(e){return e>=48&&e<=55}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),i=function(){function e(e){this.type=r.JSXSyntax.JSXClosingElement,this.name=e}return e}();t.JSXClosingElement=i;var o=function(){function e(e,t,n){this.type=r.JSXSyntax.JSXElement,this.openingElement=e,this.children=t,this.closingElement=n}return e}();t.JSXElement=o;var a=function(){function e(){this.type=r.JSXSyntax.JSXEmptyExpression}return e}();t.JSXEmptyExpression=a;var s=function(){function e(e){this.type=r.JSXSyntax.JSXExpressionContainer,this.expression=e}return e}();t.JSXExpressionContainer=s;var u=function(){function e(e){this.type=r.JSXSyntax.JSXIdentifier,this.name=e}return e}();t.JSXIdentifier=u;var l=function(){function e(e,t){this.type=r.JSXSyntax.JSXMemberExpression,this.object=e,this.property=t}return e}();t.JSXMemberExpression=l;var c=function(){function e(e,t){this.type=r.JSXSyntax.JSXAttribute,this.name=e,this.value=t}return e}();t.JSXAttribute=c;var p=function(){function e(e,t){this.type=r.JSXSyntax.JSXNamespacedName,this.namespace=e,this.name=t}return e}();t.JSXNamespacedName=p;var f=function(){function e(e,t,n){this.type=r.JSXSyntax.JSXOpeningElement,this.name=e,this.selfClosing=t,this.attributes=n}return e}();t.JSXOpeningElement=f;var h=function(){function e(e){this.type=r.JSXSyntax.JSXSpreadAttribute,this.argument=e}return e}();t.JSXSpreadAttribute=h;var d=function(){function e(e,t){this.type=r.JSXSyntax.JSXText,this.value=e,this.raw=t}return e}();t.JSXText=d},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(){function e(e){this.type=r.Syntax.ArrayExpression,this.elements=e}return e}();t.ArrayExpression=i;var o=function(){function e(e){this.type=r.Syntax.ArrayPattern,this.elements=e}return e}();t.ArrayPattern=o;var a=function(){function e(e,t,n){this.type=r.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=n,this.async=!1}return e}();t.ArrowFunctionExpression=a;var s=function(){function e(e,t,n){this.type=r.Syntax.AssignmentExpression,this.operator=e,this.left=t,this.right=n}return e}();t.AssignmentExpression=s;var u=function(){function e(e,t){this.type=r.Syntax.AssignmentPattern,this.left=e,this.right=t}return e}();t.AssignmentPattern=u;var l=function(){function e(e,t,n){this.type=r.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=n,this.async=!0}return e}();t.AsyncArrowFunctionExpression=l;var c=function(){function e(e,t,n){this.type=r.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=n,this.generator=!1,this.expression=!1,this.async=!0}return e}();t.AsyncFunctionDeclaration=c;var p=function(){function e(e,t,n){this.type=r.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=n,this.generator=!1,this.expression=!1,this.async=!0}return e}();t.AsyncFunctionExpression=p;var f=function(){function e(e){this.type=r.Syntax.AwaitExpression,this.argument=e}return e}();t.AwaitExpression=f;var h=function(){function e(e,t,n){var i="||"===e||"&&"===e;this.type=i?r.Syntax.LogicalExpression:r.Syntax.BinaryExpression,this.operator=e,this.left=t,this.right=n}return e}();t.BinaryExpression=h;var d=function(){function e(e){this.type=r.Syntax.BlockStatement,this.body=e}return e}();t.BlockStatement=d;var m=function(){function e(e){this.type=r.Syntax.BreakStatement,this.label=e}return e}();t.BreakStatement=m;var v=function(){function e(e,t){this.type=r.Syntax.CallExpression,this.callee=e,this.arguments=t}return e}();t.CallExpression=v;var g=function(){function e(e,t){this.type=r.Syntax.CatchClause,this.param=e,this.body=t}return e}();t.CatchClause=g;var y=function(){function e(e){this.type=r.Syntax.ClassBody,this.body=e}return e}();t.ClassBody=y;var _=function(){function e(e,t,n){this.type=r.Syntax.ClassDeclaration,this.id=e,this.superClass=t,this.body=n}return e}();t.ClassDeclaration=_;var b=function(){function e(e,t,n){this.type=r.Syntax.ClassExpression,this.id=e,this.superClass=t,this.body=n}return e}();t.ClassExpression=b;var x=function(){function e(e,t){this.type=r.Syntax.MemberExpression,this.computed=!0,this.object=e,this.property=t}return e}();t.ComputedMemberExpression=x;var w=function(){function e(e,t,n){this.type=r.Syntax.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=n}return e}();t.ConditionalExpression=w;var k=function(){function e(e){this.type=r.Syntax.ContinueStatement,this.label=e}return e}();t.ContinueStatement=k;var E=function(){function e(){this.type=r.Syntax.DebuggerStatement}return e}();t.DebuggerStatement=E;var S=function(){function e(e,t){this.type=r.Syntax.ExpressionStatement,this.expression=e,this.directive=t}return e}();t.Directive=S;var C=function(){function e(e,t){this.type=r.Syntax.DoWhileStatement,this.body=e,this.test=t}return e}();t.DoWhileStatement=C;var A=function(){function e(){this.type=r.Syntax.EmptyStatement}return e}();t.EmptyStatement=A;var D=function(){function e(e){this.type=r.Syntax.ExportAllDeclaration,this.source=e}return e}();t.ExportAllDeclaration=D;var O=function(){function e(e){this.type=r.Syntax.ExportDefaultDeclaration,this.declaration=e}return e}();t.ExportDefaultDeclaration=O;var M=function(){function e(e,t,n){this.type=r.Syntax.ExportNamedDeclaration,this.declaration=e,this.specifiers=t,this.source=n}return e}();t.ExportNamedDeclaration=M;var T=function(){function e(e,t){this.type=r.Syntax.ExportSpecifier,this.exported=t,this.local=e}return e}();t.ExportSpecifier=T;var P=function(){function e(e){this.type=r.Syntax.ExpressionStatement,this.expression=e}return e}();t.ExpressionStatement=P;var I=function(){function e(e,t,n){this.type=r.Syntax.ForInStatement,this.left=e,this.right=t,this.body=n,this.each=!1}return e}();t.ForInStatement=I;var R=function(){function e(e,t,n){this.type=r.Syntax.ForOfStatement,this.left=e,this.right=t,this.body=n}return e}();t.ForOfStatement=R;var j=function(){function e(e,t,n,i){this.type=r.Syntax.ForStatement,this.init=e,this.test=t,this.update=n,this.body=i}return e}();t.ForStatement=j;var F=function(){function e(e,t,n,i){this.type=r.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=n,this.generator=i,this.expression=!1,this.async=!1}return e}();t.FunctionDeclaration=F;var N=function(){function e(e,t,n,i){this.type=r.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=n,this.generator=i,this.expression=!1,this.async=!1}return e}();t.FunctionExpression=N;var B=function(){function e(e){this.type=r.Syntax.Identifier,this.name=e}return e}();t.Identifier=B;var L=function(){function e(e,t,n){this.type=r.Syntax.IfStatement,this.test=e,this.consequent=t,this.alternate=n}return e}();t.IfStatement=L;var q=function(){function e(e,t){this.type=r.Syntax.ImportDeclaration,this.specifiers=e,this.source=t}return e}();t.ImportDeclaration=q;var z=function(){function e(e){this.type=r.Syntax.ImportDefaultSpecifier,this.local=e}return e}();t.ImportDefaultSpecifier=z;var U=function(){function e(e){this.type=r.Syntax.ImportNamespaceSpecifier,this.local=e}return e}();t.ImportNamespaceSpecifier=U;var W=function(){function e(e,t){this.type=r.Syntax.ImportSpecifier,this.local=e,this.imported=t}return e}();t.ImportSpecifier=W;var V=function(){function e(e,t){this.type=r.Syntax.LabeledStatement,this.label=e,this.body=t}return e}();t.LabeledStatement=V;var H=function(){function e(e,t){this.type=r.Syntax.Literal,this.value=e,this.raw=t}return e}();t.Literal=H;var G=function(){function e(e,t){this.type=r.Syntax.MetaProperty,this.meta=e,this.property=t}return e}();t.MetaProperty=G;var J=function(){function e(e,t,n,i,o){this.type=r.Syntax.MethodDefinition,this.key=e,this.computed=t,this.value=n,this.kind=i,this.static=o}return e}();t.MethodDefinition=J;var K=function(){function e(e){this.type=r.Syntax.Program,this.body=e,this.sourceType="module"}return e}();t.Module=K;var X=function(){function e(e,t){this.type=r.Syntax.NewExpression,this.callee=e,this.arguments=t}return e}();t.NewExpression=X;var Y=function(){function e(e){this.type=r.Syntax.ObjectExpression,this.properties=e}return e}();t.ObjectExpression=Y;var $=function(){function e(e){this.type=r.Syntax.ObjectPattern,this.properties=e}return e}();t.ObjectPattern=$;var Z=function(){function e(e,t,n,i,o,a){this.type=r.Syntax.Property,this.key=t,this.computed=n,this.value=i,this.kind=e,this.method=o,this.shorthand=a}return e}();t.Property=Z;var Q=function(){function e(e,t,n,i){this.type=r.Syntax.Literal,this.value=e,this.raw=t,this.regex={pattern:n,flags:i}}return e}();t.RegexLiteral=Q;var ee=function(){function e(e){this.type=r.Syntax.RestElement,this.argument=e}return e}();t.RestElement=ee;var te=function(){function e(e){this.type=r.Syntax.ReturnStatement,this.argument=e}return e}();t.ReturnStatement=te;var ne=function(){function e(e){this.type=r.Syntax.Program,this.body=e,this.sourceType="script"}return e}();t.Script=ne;var re=function(){function e(e){this.type=r.Syntax.SequenceExpression,this.expressions=e}return e}();t.SequenceExpression=re;var ie=function(){function e(e){this.type=r.Syntax.SpreadElement,this.argument=e}return e}();t.SpreadElement=ie;var oe=function(){function e(e,t){this.type=r.Syntax.MemberExpression,this.computed=!1,this.object=e,this.property=t}return e}();t.StaticMemberExpression=oe;var ae=function(){function e(){this.type=r.Syntax.Super}return e}();t.Super=ae;var se=function(){function e(e,t){this.type=r.Syntax.SwitchCase,this.test=e,this.consequent=t}return e}();t.SwitchCase=se;var ue=function(){function e(e,t){this.type=r.Syntax.SwitchStatement,this.discriminant=e,this.cases=t}return e}();t.SwitchStatement=ue;var le=function(){function e(e,t){this.type=r.Syntax.TaggedTemplateExpression,this.tag=e,this.quasi=t}return e}();t.TaggedTemplateExpression=le;var ce=function(){function e(e,t){this.type=r.Syntax.TemplateElement,this.value=e,this.tail=t}return e}();t.TemplateElement=ce;var pe=function(){function e(e,t){this.type=r.Syntax.TemplateLiteral,this.quasis=e,this.expressions=t}return e}();t.TemplateLiteral=pe;var fe=function(){function e(){this.type=r.Syntax.ThisExpression}return e}();t.ThisExpression=fe;var he=function(){function e(e){this.type=r.Syntax.ThrowStatement,this.argument=e}return e}();t.ThrowStatement=he;var de=function(){function e(e,t,n){this.type=r.Syntax.TryStatement,this.block=e,this.handler=t,this.finalizer=n}return e}();t.TryStatement=de;var me=function(){function e(e,t){this.type=r.Syntax.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0}return e}();t.UnaryExpression=me;var ve=function(){function e(e,t,n){this.type=r.Syntax.UpdateExpression,this.operator=e,this.argument=t,this.prefix=n}return e}();t.UpdateExpression=ve;var ge=function(){function e(e,t){this.type=r.Syntax.VariableDeclaration,this.declarations=e,this.kind=t}return e}();t.VariableDeclaration=ge;var ye=function(){function e(e,t){this.type=r.Syntax.VariableDeclarator,this.id=e,this.init=t}return e}();t.VariableDeclarator=ye;var _e=function(){function e(e,t){this.type=r.Syntax.WhileStatement,this.test=e,this.body=t}return e}();t.WhileStatement=_e;var be=function(){function e(e,t){this.type=r.Syntax.WithStatement,this.object=e,this.body=t}return e}();t.WithStatement=be;var xe=function(){function e(e,t){this.type=r.Syntax.YieldExpression,this.argument=e,this.delegate=t}return e}();t.YieldExpression=xe},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),i=n(10),o=n(11),a=n(7),s=n(12),u=n(2),l=n(13),c=function(){function e(e,t,n){void 0===t&&(t={}),this.config={range:"boolean"==typeof t.range&&t.range,loc:"boolean"==typeof t.loc&&t.loc,source:null,tokens:"boolean"==typeof t.tokens&&t.tokens,comment:"boolean"==typeof t.comment&&t.comment,tolerant:"boolean"==typeof t.tolerant&&t.tolerant},this.config.loc&&t.source&&null!==t.source&&(this.config.source=String(t.source)),this.delegate=n,this.errorHandler=new i.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new s.Scanner(e,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return e.prototype.throwError=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=Array.prototype.slice.call(arguments,1),o=e.replace(/%(\d)/g,function(e,t){return r.assert(t<i.length,"Message reference must be in range"),i[t]}),a=this.lastMarker.index,s=this.lastMarker.line,u=this.lastMarker.column+1;throw this.errorHandler.createError(a,s,u,o)},e.prototype.tolerateError=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=Array.prototype.slice.call(arguments,1),o=e.replace(/%(\d)/g,function(e,t){return r.assert(t<i.length,"Message reference must be in range"),i[t]}),a=this.lastMarker.index,s=this.scanner.lineNumber,u=this.lastMarker.column+1;this.errorHandler.tolerateError(a,s,u,o)},e.prototype.unexpectedTokenError=function(e,t){var n,r=t||o.Messages.UnexpectedToken;if(e?(t||(r=2===e.type?o.Messages.UnexpectedEOS:3===e.type?o.Messages.UnexpectedIdentifier:6===e.type?o.Messages.UnexpectedNumber:8===e.type?o.Messages.UnexpectedString:10===e.type?o.Messages.UnexpectedTemplate:o.Messages.UnexpectedToken,4===e.type&&(this.scanner.isFutureReservedWord(e.value)?r=o.Messages.UnexpectedReserved:this.context.strict&&this.scanner.isStrictModeReservedWord(e.value)&&(r=o.Messages.StrictReservedWord))),n=e.value):n="ILLEGAL",r=r.replace("%0",n),e&&"number"==typeof e.lineNumber){var i=e.start,a=e.lineNumber,s=this.lastMarker.index-this.lastMarker.column,u=e.start-s+1;return this.errorHandler.createError(i,a,u,r)}var i=this.lastMarker.index,a=this.lastMarker.line,u=this.lastMarker.column+1;return this.errorHandler.createError(i,a,u,r)},e.prototype.throwUnexpectedToken=function(e,t){throw this.unexpectedTokenError(e,t)},e.prototype.tolerateUnexpectedToken=function(e,t){this.errorHandler.tolerate(this.unexpectedTokenError(e,t))},e.prototype.collectComments=function(){if(this.config.comment){var e=this.scanner.scanComments();if(e.length>0&&this.delegate)for(var t=0;t<e.length;++t){var n=e[t],r=void 0;r={type:n.multiLine?"BlockComment":"LineComment",value:this.scanner.source.slice(n.slice[0],n.slice[1])},this.config.range&&(r.range=n.range),this.config.loc&&(r.loc=n.loc);var i={start:{line:n.loc.start.line,column:n.loc.start.column,offset:n.range[0]},end:{line:n.loc.end.line,column:n.loc.end.column,offset:n.range[1]}};this.delegate(r,i)}}else this.scanner.scanComments()},e.prototype.getTokenRaw=function(e){return this.scanner.source.slice(e.start,e.end)},e.prototype.convertToken=function(e){var t={type:l.TokenName[e.type],value:this.getTokenRaw(e)};if(this.config.range&&(t.range=[e.start,e.end]),this.config.loc&&(t.loc={start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}),9===e.type){var n=e.pattern,r=e.flags;t.regex={pattern:n,flags:r}}return t},e.prototype.nextToken=function(){var e=this.lookahead;this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.collectComments(),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart);var t=this.scanner.lex();return this.hasLineTerminator=e.lineNumber!==t.lineNumber,t&&this.context.strict&&3===t.type&&this.scanner.isStrictModeReservedWord(t.value)&&(t.type=4),this.lookahead=t,this.config.tokens&&2!==t.type&&this.tokens.push(this.convertToken(t)),e},e.prototype.nextRegexToken=function(){this.collectComments();var e=this.scanner.scanRegExp();return this.config.tokens&&(this.tokens.pop(),this.tokens.push(this.convertToken(e))),this.lookahead=e,this.nextToken(),e},e.prototype.createNode=function(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}},e.prototype.startNode=function(e){return{index:e.start,line:e.lineNumber,column:e.start-e.lineStart}},e.prototype.finalize=function(e,t){if(this.config.range&&(t.range=[e.index,this.lastMarker.index]),this.config.loc&&(t.loc={start:{line:e.line,column:e.column},end:{line:this.lastMarker.line,column:this.lastMarker.column}},this.config.source&&(t.loc.source=this.config.source)),this.delegate){var n={start:{line:e.line,column:e.column,offset:e.index},end:{line:this.lastMarker.line,column:this.lastMarker.column,offset:this.lastMarker.index}};this.delegate(t,n)}return t},e.prototype.expect=function(e){var t=this.nextToken();7===t.type&&t.value===e||this.throwUnexpectedToken(t)},e.prototype.expectCommaSeparator=function(){if(this.config.tolerant){var e=this.lookahead;7===e.type&&","===e.value?this.nextToken():7===e.type&&";"===e.value?(this.nextToken(),this.tolerateUnexpectedToken(e)):this.tolerateUnexpectedToken(e,o.Messages.UnexpectedToken)}else this.expect(",")},e.prototype.expectKeyword=function(e){var t=this.nextToken();4===t.type&&t.value===e||this.throwUnexpectedToken(t)},e.prototype.match=function(e){return 7===this.lookahead.type&&this.lookahead.value===e},e.prototype.matchKeyword=function(e){return 4===this.lookahead.type&&this.lookahead.value===e},e.prototype.matchContextualKeyword=function(e){return 3===this.lookahead.type&&this.lookahead.value===e},e.prototype.matchAssign=function(){if(7!==this.lookahead.type)return!1;var e=this.lookahead.value;return"="===e||"*="===e||"**="===e||"/="===e||"%="===e||"+="===e||"-="===e||"<<="===e||">>="===e||">>>="===e||"&="===e||"^="===e||"|="===e},e.prototype.isolateCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,r=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=e.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=t,this.context.isAssignmentTarget=n,this.context.firstCoverInitializedNameError=r,i},e.prototype.inheritCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,r=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=e.call(this);return this.context.isBindingElement=this.context.isBindingElement&&t,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&n,this.context.firstCoverInitializedNameError=r||this.context.firstCoverInitializedNameError,i},e.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(2===this.lookahead.type||this.match("}")||this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},e.prototype.parsePrimaryExpression=function(){var e,t,n,r=this.createNode();switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),e=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(r,new a.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,o.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),n=this.getTokenRaw(t),e=this.finalize(r,new a.Literal(t.value,n));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),n=this.getTokenRaw(t),e=this.finalize(r,new a.Literal("true"===t.value,n));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),n=this.getTokenRaw(t),e=this.finalize(r,new a.Literal(null,n));break;case 10:e=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,e=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":e=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":e=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,t=this.nextRegexToken(),n=this.getTokenRaw(t),e=this.finalize(r,new a.RegexLiteral(t.regex,n,t.pattern,t.flags));break;default:e=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?e=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?e=this.finalize(r,new a.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?e=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),e=this.finalize(r,new a.ThisExpression)):e=this.matchKeyword("class")?this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:e=this.throwUnexpectedToken(this.nextToken())}return e},e.prototype.parseSpreadElement=function(){var e=this.createNode();this.expect("...");var t=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(e,new a.SpreadElement(t))},e.prototype.parseArrayInitializer=function(){var e=this.createNode(),t=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),t.push(null);else if(this.match("...")){var n=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),t.push(n)}else t.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(e,new a.ArrayExpression(t))},e.prototype.parsePropertyMethod=function(e){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var t=this.context.strict,n=this.context.allowStrictDirective;this.context.allowStrictDirective=e.simple;var r=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&e.firstRestricted&&this.tolerateUnexpectedToken(e.firstRestricted,e.message),this.context.strict&&e.stricted&&this.tolerateUnexpectedToken(e.stricted,e.message),this.context.strict=t,this.context.allowStrictDirective=n,r},e.prototype.parsePropertyMethodFunction=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!1;var n=this.parseFormalParameters(),r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new a.FunctionExpression(null,n.params,r,!1))},e.prototype.parsePropertyMethodAsyncFunction=function(){var e=this.createNode(),t=this.context.allowYield,n=this.context.await;this.context.allowYield=!1,this.context.await=!0;var r=this.parseFormalParameters(),i=this.parsePropertyMethod(r);return this.context.allowYield=t,this.context.await=n,this.finalize(e,new a.AsyncFunctionExpression(null,r.params,i))},e.prototype.parseObjectPropertyKey=function(){var e,t=this.createNode(),n=this.nextToken();switch(n.type){case 8:case 6:this.context.strict&&n.octal&&this.tolerateUnexpectedToken(n,o.Messages.StrictOctalLiteral);var r=this.getTokenRaw(n);e=this.finalize(t,new a.Literal(n.value,r));break;case 3:case 1:case 5:case 4:e=this.finalize(t,new a.Identifier(n.value));break;case 7:"["===n.value?(e=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):e=this.throwUnexpectedToken(n);break;default:e=this.throwUnexpectedToken(n)}return e},e.prototype.isPropertyKey=function(e,t){return e.type===u.Syntax.Identifier&&e.name===t||e.type===u.Syntax.Literal&&e.value===t},e.prototype.parseObjectProperty=function(e){var t,n=this.createNode(),r=this.lookahead,i=null,s=null,u=!1,l=!1,c=!1,p=!1;if(3===r.type){var f=r.value;this.nextToken(),u=this.match("["),p=!(this.hasLineTerminator||"async"!==f||this.match(":")||this.match("(")||this.match("*")),i=p?this.parseObjectPropertyKey():this.finalize(n,new a.Identifier(f))}else this.match("*")?this.nextToken():(u=this.match("["),i=this.parseObjectPropertyKey());var h=this.qualifiedPropertyName(this.lookahead);if(3===r.type&&!p&&"get"===r.value&&h)t="get",u=this.match("["),i=this.parseObjectPropertyKey(),this.context.allowYield=!1,s=this.parseGetterMethod();else if(3===r.type&&!p&&"set"===r.value&&h)t="set",u=this.match("["),i=this.parseObjectPropertyKey(),s=this.parseSetterMethod();else if(7===r.type&&"*"===r.value&&h)t="init",u=this.match("["),i=this.parseObjectPropertyKey(),s=this.parseGeneratorMethod(),l=!0;else if(i||this.throwUnexpectedToken(this.lookahead),t="init",this.match(":")&&!p)!u&&this.isPropertyKey(i,"__proto__")&&(e.value&&this.tolerateError(o.Messages.DuplicateProtoProperty),e.value=!0),this.nextToken(),s=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))s=p?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),l=!0;else if(3===r.type){var f=this.finalize(n,new a.Identifier(r.value));if(this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),c=!0;var d=this.isolateCoverGrammar(this.parseAssignmentExpression);s=this.finalize(n,new a.AssignmentPattern(f,d))}else c=!0,s=f}else this.throwUnexpectedToken(this.nextToken());return this.finalize(n,new a.Property(t,i,u,s,l,c))},e.prototype.parseObjectInitializer=function(){var e=this.createNode();this.expect("{");for(var t=[],n={value:!1};!this.match("}");)t.push(this.parseObjectProperty(n)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(e,new a.ObjectExpression(t))},e.prototype.parseTemplateHead=function(){r.assert(this.lookahead.head,"Template literal must start with a template head");var e=this.createNode(),t=this.nextToken(),n=t.value,i=t.cooked;return this.finalize(e,new a.TemplateElement({raw:n,cooked:i},t.tail))},e.prototype.parseTemplateElement=function(){10!==this.lookahead.type&&this.throwUnexpectedToken();var e=this.createNode(),t=this.nextToken(),n=t.value,r=t.cooked;return this.finalize(e,new a.TemplateElement({raw:n,cooked:r},t.tail))},e.prototype.parseTemplateLiteral=function(){var e=this.createNode(),t=[],n=[],r=this.parseTemplateHead();for(n.push(r);!r.tail;)t.push(this.parseExpression()),r=this.parseTemplateElement(),n.push(r);return this.finalize(e,new a.TemplateLiteral(n,t))},e.prototype.reinterpretExpressionAsPattern=function(e){switch(e.type){case u.Syntax.Identifier:case u.Syntax.MemberExpression:case u.Syntax.RestElement:case u.Syntax.AssignmentPattern:break;case u.Syntax.SpreadElement:e.type=u.Syntax.RestElement,this.reinterpretExpressionAsPattern(e.argument);break;case u.Syntax.ArrayExpression:e.type=u.Syntax.ArrayPattern;for(var t=0;t<e.elements.length;t++)null!==e.elements[t]&&this.reinterpretExpressionAsPattern(e.elements[t]);break;case u.Syntax.ObjectExpression:e.type=u.Syntax.ObjectPattern;for(var t=0;t<e.properties.length;t++)this.reinterpretExpressionAsPattern(e.properties[t].value);break;case u.Syntax.AssignmentExpression:e.type=u.Syntax.AssignmentPattern,delete e.operator,this.reinterpretExpressionAsPattern(e.left)}},e.prototype.parseGroupExpression=function(){var e;if(this.expect("("),this.match(")"))this.nextToken(),this.match("=>")||this.expect("=>"),e={type:"ArrowParameterPlaceHolder",params:[],async:!1};else{var t=this.lookahead,n=[];if(this.match("..."))e=this.parseRestElement(n),this.expect(")"),this.match("=>")||this.expect("=>"),e={type:"ArrowParameterPlaceHolder",params:[e],async:!1};else{var r=!1;if(this.context.isBindingElement=!0,e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var i=[];for(this.context.isAssignmentTarget=!1,i.push(e);2!==this.lookahead.type&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var o=0;o<i.length;o++)this.reinterpretExpressionAsPattern(i[o]);r=!0,e={type:"ArrowParameterPlaceHolder",params:i,async:!1}}else if(this.match("...")){this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),i.push(this.parseRestElement(n)),this.expect(")"),this.match("=>")||this.expect("=>"),this.context.isBindingElement=!1;for(var o=0;o<i.length;o++)this.reinterpretExpressionAsPattern(i[o]);r=!0,e={type:"ArrowParameterPlaceHolder",params:i,async:!1}}else i.push(this.inheritCoverGrammar(this.parseAssignmentExpression));if(r)break}r||(e=this.finalize(this.startNode(t),new a.SequenceExpression(i)))}if(!r){if(this.expect(")"),this.match("=>")&&(e.type===u.Syntax.Identifier&&"yield"===e.name&&(r=!0,e={type:"ArrowParameterPlaceHolder",params:[e],async:!1}),!r)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),e.type===u.Syntax.SequenceExpression)for(var o=0;o<e.expressions.length;o++)this.reinterpretExpressionAsPattern(e.expressions[o]);else this.reinterpretExpressionAsPattern(e);e={type:"ArrowParameterPlaceHolder",params:e.type===u.Syntax.SequenceExpression?e.expressions:[e],async:!1}}this.context.isBindingElement=!1}}}return e},e.prototype.parseArguments=function(){this.expect("(");var e=[];if(!this.match(")"))for(;;){var t=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAssignmentExpression);if(e.push(t),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),e},e.prototype.isIdentifierName=function(e){return 3===e.type||4===e.type||1===e.type||5===e.type},e.prototype.parseIdentifierName=function(){var e=this.createNode(),t=this.nextToken();return this.isIdentifierName(t)||this.throwUnexpectedToken(t),this.finalize(e,new a.Identifier(t.value))},e.prototype.parseNewExpression=function(){var e=this.createNode(),t=this.parseIdentifierName();r.assert("new"===t.name,"New expression must start with `new`");var n;if(this.match("."))if(this.nextToken(),3===this.lookahead.type&&this.context.inFunctionBody&&"target"===this.lookahead.value){var i=this.parseIdentifierName();n=new a.MetaProperty(t,i)}else this.throwUnexpectedToken(this.lookahead);else{var o=this.isolateCoverGrammar(this.parseLeftHandSideExpression),s=this.match("(")?this.parseArguments():[];n=new a.NewExpression(o,s),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return this.finalize(e,n)},e.prototype.parseAsyncArgument=function(){var e=this.parseAssignmentExpression();return this.context.firstCoverInitializedNameError=null,e},e.prototype.parseAsyncArguments=function(){this.expect("(");var e=[];if(!this.match(")"))for(;;){var t=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAsyncArgument);if(e.push(t),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),e},e.prototype.parseLeftHandSideExpressionAllowCall=function(){var e=this.lookahead,t=this.matchContextualKeyword("async"),n=this.context.allowIn;this.context.allowIn=!0;var r;for(this.matchKeyword("super")&&this.context.inFunctionBody?(r=this.createNode(),this.nextToken(),r=this.finalize(r,new a.Super),this.match("(")||this.match(".")||this.match("[")||this.throwUnexpectedToken(this.lookahead)):r=this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var i=this.parseIdentifierName();r=this.finalize(this.startNode(e),new a.StaticMemberExpression(r,i))}else if(this.match("(")){var o=t&&e.lineNumber===this.lookahead.lineNumber;this.context.isBindingElement=!1,this.context.isAssignmentTarget=!1;var s=o?this.parseAsyncArguments():this.parseArguments();if(r=this.finalize(this.startNode(e),new a.CallExpression(r,s)),o&&this.match("=>")){for(var u=0;u<s.length;++u)this.reinterpretExpressionAsPattern(s[u]);r={type:"ArrowParameterPlaceHolder",params:s,async:!0}}}else if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var i=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),r=this.finalize(this.startNode(e),new a.ComputedMemberExpression(r,i))}else{if(10!==this.lookahead.type||!this.lookahead.head)break;var l=this.parseTemplateLiteral();r=this.finalize(this.startNode(e),new a.TaggedTemplateExpression(r,l))}return this.context.allowIn=n,r},e.prototype.parseSuper=function(){var e=this.createNode();return this.expectKeyword("super"),this.match("[")||this.match(".")||this.throwUnexpectedToken(this.lookahead),this.finalize(e,new a.Super)},e.prototype.parseLeftHandSideExpression=function(){r.assert(this.context.allowIn,"callee of new expression always allow in keyword.");for(var e=this.startNode(this.lookahead),t=this.matchKeyword("super")&&this.context.inFunctionBody?this.parseSuper():this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var n=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),t=this.finalize(e,new a.ComputedMemberExpression(t,n))}else if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var n=this.parseIdentifierName();t=this.finalize(e,new a.StaticMemberExpression(t,n))}else{if(10!==this.lookahead.type||!this.lookahead.head)break;var i=this.parseTemplateLiteral();t=this.finalize(e,new a.TaggedTemplateExpression(t,i))}return t},e.prototype.parseUpdateExpression=function(){var e,t=this.lookahead;if(this.match("++")||this.match("--")){var n=this.startNode(t),r=this.nextToken();e=this.inheritCoverGrammar(this.parseUnaryExpression),this.context.strict&&e.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(e.name)&&this.tolerateError(o.Messages.StrictLHSPrefix),this.context.isAssignmentTarget||this.tolerateError(o.Messages.InvalidLHSInAssignment);var i=!0;e=this.finalize(n,new a.UpdateExpression(r.value,e,i)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(e=this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall),!this.hasLineTerminator&&7===this.lookahead.type&&(this.match("++")||this.match("--"))){this.context.strict&&e.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(e.name)&&this.tolerateError(o.Messages.StrictLHSPostfix),this.context.isAssignmentTarget||this.tolerateError(o.Messages.InvalidLHSInAssignment),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var s=this.nextToken().value,i=!1;e=this.finalize(this.startNode(t),new a.UpdateExpression(s,e,i))}return e},e.prototype.parseAwaitExpression=function(){var e=this.createNode();this.nextToken();var t=this.parseUnaryExpression();return this.finalize(e,new a.AwaitExpression(t))},e.prototype.parseUnaryExpression=function(){var e;if(this.match("+")||this.match("-")||this.match("~")||this.match("!")||this.matchKeyword("delete")||this.matchKeyword("void")||this.matchKeyword("typeof")){var t=this.startNode(this.lookahead),n=this.nextToken();e=this.inheritCoverGrammar(this.parseUnaryExpression),e=this.finalize(t,new a.UnaryExpression(n.value,e)),this.context.strict&&"delete"===e.operator&&e.argument.type===u.Syntax.Identifier&&this.tolerateError(o.Messages.StrictDelete),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else e=this.context.await&&this.matchContextualKeyword("await")?this.parseAwaitExpression():this.parseUpdateExpression();return e},e.prototype.parseExponentiationExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseUnaryExpression);if(t.type!==u.Syntax.UnaryExpression&&this.match("**")){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var n=t,r=this.isolateCoverGrammar(this.parseExponentiationExpression);t=this.finalize(this.startNode(e),new a.BinaryExpression("**",n,r))}return t},e.prototype.binaryPrecedence=function(e){var t=e.value;return 7===e.type?this.operatorPrecedence[t]||0:4===e.type&&("instanceof"===t||this.context.allowIn&&"in"===t)?7:0},e.prototype.parseBinaryExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseExponentiationExpression),n=this.lookahead,r=this.binaryPrecedence(n);if(r>0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var i=[e,this.lookahead],o=t,s=this.isolateCoverGrammar(this.parseExponentiationExpression),u=[o,n.value,s],l=[r];;){if((r=this.binaryPrecedence(this.lookahead))<=0)break;for(;u.length>2&&r<=l[l.length-1];){s=u.pop();var c=u.pop();l.pop(),o=u.pop(),i.pop();var p=this.startNode(i[i.length-1]);u.push(this.finalize(p,new a.BinaryExpression(c,o,s)))}u.push(this.nextToken().value),l.push(r),i.push(this.lookahead),u.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var f=u.length-1;for(t=u[f],i.pop();f>1;){var p=this.startNode(i.pop()),c=u[f-1];t=this.finalize(p,new a.BinaryExpression(c,u[f-2],t)),f-=2}}return t},e.prototype.parseConditionalExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var n=this.context.allowIn;this.context.allowIn=!0;var r=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=n,this.expect(":");var i=this.isolateCoverGrammar(this.parseAssignmentExpression);t=this.finalize(this.startNode(e),new a.ConditionalExpression(t,r,i)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return t},e.prototype.checkPatternParam=function(e,t){switch(t.type){case u.Syntax.Identifier:this.validateParam(e,t,t.name);break;case u.Syntax.RestElement:this.checkPatternParam(e,t.argument);break;case u.Syntax.AssignmentPattern:this.checkPatternParam(e,t.left);break;case u.Syntax.ArrayPattern:for(var n=0;n<t.elements.length;n++)null!==t.elements[n]&&this.checkPatternParam(e,t.elements[n]);break;case u.Syntax.ObjectPattern:for(var n=0;n<t.properties.length;n++)this.checkPatternParam(e,t.properties[n].value)}e.simple=e.simple&&t instanceof a.Identifier},e.prototype.reinterpretAsCoverFormalsList=function(e){var t,n=[e],r=!1;switch(e.type){case u.Syntax.Identifier:break;case"ArrowParameterPlaceHolder":n=e.params,r=e.async;break;default:return null}t={simple:!0,paramSet:{}};for(var i=0;i<n.length;++i){var a=n[i];a.type===u.Syntax.AssignmentPattern?a.right.type===u.Syntax.YieldExpression&&(a.right.argument&&this.throwUnexpectedToken(this.lookahead),a.right.type=u.Syntax.Identifier,a.right.name="yield",delete a.right.argument,delete a.right.delegate):r&&a.type===u.Syntax.Identifier&&"await"===a.name&&this.throwUnexpectedToken(this.lookahead),this.checkPatternParam(t,a),n[i]=a}if(this.context.strict||!this.context.allowYield)for(var i=0;i<n.length;++i){var a=n[i];a.type===u.Syntax.YieldExpression&&this.throwUnexpectedToken(this.lookahead)}if(t.message===o.Messages.StrictParamDupe){var s=this.context.strict?t.stricted:t.firstRestricted;this.throwUnexpectedToken(s,t.message)}return{simple:t.simple,params:n,stricted:t.stricted,firstRestricted:t.firstRestricted,message:t.message}},e.prototype.parseAssignmentExpression=function(){var e;if(!this.context.allowYield&&this.matchKeyword("yield"))e=this.parseYieldExpression();else{var t=this.lookahead,n=t;if(e=this.parseConditionalExpression(),3===n.type&&n.lineNumber===this.lookahead.lineNumber&&"async"===n.value&&(3===this.lookahead.type||this.matchKeyword("yield"))){var r=this.parsePrimaryExpression();this.reinterpretExpressionAsPattern(r),e={type:"ArrowParameterPlaceHolder",params:[r],async:!0}}if("ArrowParameterPlaceHolder"===e.type||this.match("=>")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var i=e.async,s=this.reinterpretAsCoverFormalsList(e);if(s){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var l=this.context.strict,c=this.context.allowStrictDirective;this.context.allowStrictDirective=s.simple;var p=this.context.allowYield,f=this.context.await;this.context.allowYield=!0,this.context.await=i;var h=this.startNode(t);this.expect("=>");var d=void 0;if(this.match("{")){var m=this.context.allowIn;this.context.allowIn=!0,d=this.parseFunctionSourceElements(),this.context.allowIn=m}else d=this.isolateCoverGrammar(this.parseAssignmentExpression);var v=d.type!==u.Syntax.BlockStatement;this.context.strict&&s.firstRestricted&&this.throwUnexpectedToken(s.firstRestricted,s.message),this.context.strict&&s.stricted&&this.tolerateUnexpectedToken(s.stricted,s.message),e=i?this.finalize(h,new a.AsyncArrowFunctionExpression(s.params,d,v)):this.finalize(h,new a.ArrowFunctionExpression(s.params,d,v)),this.context.strict=l,this.context.allowStrictDirective=c,this.context.allowYield=p,this.context.await=f}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(o.Messages.InvalidLHSInAssignment),this.context.strict&&e.type===u.Syntax.Identifier){var g=e;this.scanner.isRestrictedWord(g.name)&&this.tolerateUnexpectedToken(n,o.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(g.name)&&this.tolerateUnexpectedToken(n,o.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(e):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1),n=this.nextToken();var y=n.value,_=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new a.AssignmentExpression(y,e,_)),this.context.firstCoverInitializedNameError=null}}return e},e.prototype.parseExpression=function(){var e=this.lookahead,t=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var n=[];for(n.push(t);2!==this.lookahead.type&&this.match(",");)this.nextToken(),n.push(this.isolateCoverGrammar(this.parseAssignmentExpression));t=this.finalize(this.startNode(e),new a.SequenceExpression(n))}return t},e.prototype.parseStatementListItem=function(){var e;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,4===this.lookahead.type)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,o.Messages.IllegalExportDeclaration),e=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,o.Messages.IllegalImportDeclaration),e=this.parseImportDeclaration();break;case"const":e=this.parseLexicalDeclaration({inFor:!1});break;case"function":e=this.parseFunctionDeclaration();break;case"class":e=this.parseClassDeclaration();break;case"let":e=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:e=this.parseStatement()}else e=this.parseStatement();return e},e.prototype.parseBlock=function(){var e=this.createNode();this.expect("{");for(var t=[];;){if(this.match("}"))break;t.push(this.parseStatementListItem())}return this.expect("}"),this.finalize(e,new a.BlockStatement(t))},e.prototype.parseLexicalBinding=function(e,t){var n=this.createNode(),r=[],i=this.parsePattern(r,e);this.context.strict&&i.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(i.name)&&this.tolerateError(o.Messages.StrictVarName);var s=null;return"const"===e?this.matchKeyword("in")||this.matchContextualKeyword("of")||(this.match("=")?(this.nextToken(),s=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(o.Messages.DeclarationMissingInitializer,"const")):(!t.inFor&&i.type!==u.Syntax.Identifier||this.match("="))&&(this.expect("="),s=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(n,new a.VariableDeclarator(i,s))},e.prototype.parseBindingList=function(e,t){for(var n=[this.parseLexicalBinding(e,t)];this.match(",");)this.nextToken(),n.push(this.parseLexicalBinding(e,t));return n},e.prototype.isLexicalDeclaration=function(){var e=this.scanner.saveState();this.scanner.scanComments();var t=this.scanner.lex();return this.scanner.restoreState(e),3===t.type||7===t.type&&"["===t.value||7===t.type&&"{"===t.value||4===t.type&&"let"===t.value||4===t.type&&"yield"===t.value},e.prototype.parseLexicalDeclaration=function(e){var t=this.createNode(),n=this.nextToken().value;r.assert("let"===n||"const"===n,"Lexical declaration must be either let or const");var i=this.parseBindingList(n,e);return this.consumeSemicolon(),this.finalize(t,new a.VariableDeclaration(i,n))},e.prototype.parseBindingRestElement=function(e,t){var n=this.createNode();this.expect("...");var r=this.parsePattern(e,t);return this.finalize(n,new a.RestElement(r))},e.prototype.parseArrayPattern=function(e,t){var n=this.createNode();this.expect("[");for(var r=[];!this.match("]");)if(this.match(","))this.nextToken(),r.push(null);else{if(this.match("...")){r.push(this.parseBindingRestElement(e,t));break}r.push(this.parsePatternWithDefault(e,t)),this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(n,new a.ArrayPattern(r))},e.prototype.parsePropertyPattern=function(e,t){var n,r,i=this.createNode(),o=!1,s=!1;if(3===this.lookahead.type){var u=this.lookahead;n=this.parseVariableIdentifier();var l=this.finalize(i,new a.Identifier(u.value));if(this.match("=")){e.push(u),s=!0,this.nextToken();var c=this.parseAssignmentExpression();r=this.finalize(this.startNode(u),new a.AssignmentPattern(l,c))}else this.match(":")?(this.expect(":"),r=this.parsePatternWithDefault(e,t)):(e.push(u),s=!0,r=l)}else o=this.match("["),n=this.parseObjectPropertyKey(),this.expect(":"),r=this.parsePatternWithDefault(e,t);return this.finalize(i,new a.Property("init",n,o,r,!1,s))},e.prototype.parseObjectPattern=function(e,t){var n=this.createNode(),r=[];for(this.expect("{");!this.match("}");)r.push(this.parsePropertyPattern(e,t)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(n,new a.ObjectPattern(r))},e.prototype.parsePattern=function(e,t){var n;return this.match("[")?n=this.parseArrayPattern(e,t):this.match("{")?n=this.parseObjectPattern(e,t):(!this.matchKeyword("let")||"const"!==t&&"let"!==t||this.tolerateUnexpectedToken(this.lookahead,o.Messages.LetInLexicalBinding),e.push(this.lookahead),n=this.parseVariableIdentifier(t)),n},e.prototype.parsePatternWithDefault=function(e,t){var n=this.lookahead,r=this.parsePattern(e,t);if(this.match("=")){this.nextToken();var i=this.context.allowYield;this.context.allowYield=!0;var o=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=i,r=this.finalize(this.startNode(n),new a.AssignmentPattern(r,o))}return r},e.prototype.parseVariableIdentifier=function(e){var t=this.createNode(),n=this.nextToken();return 4===n.type&&"yield"===n.value?this.context.strict?this.tolerateUnexpectedToken(n,o.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(n):3!==n.type?this.context.strict&&4===n.type&&this.scanner.isStrictModeReservedWord(n.value)?this.tolerateUnexpectedToken(n,o.Messages.StrictReservedWord):(this.context.strict||"let"!==n.value||"var"!==e)&&this.throwUnexpectedToken(n):(this.context.isModule||this.context.await)&&3===n.type&&"await"===n.value&&this.tolerateUnexpectedToken(n),this.finalize(t,new a.Identifier(n.value))},e.prototype.parseVariableDeclaration=function(e){var t=this.createNode(),n=[],r=this.parsePattern(n,"var");this.context.strict&&r.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(r.name)&&this.tolerateError(o.Messages.StrictVarName);var i=null;return this.match("=")?(this.nextToken(),i=this.isolateCoverGrammar(this.parseAssignmentExpression)):r.type===u.Syntax.Identifier||e.inFor||this.expect("="),this.finalize(t,new a.VariableDeclarator(r,i))},e.prototype.parseVariableDeclarationList=function(e){var t={inFor:e.inFor},n=[];for(n.push(this.parseVariableDeclaration(t));this.match(",");)this.nextToken(),n.push(this.parseVariableDeclaration(t));return n},e.prototype.parseVariableStatement=function(){var e=this.createNode();this.expectKeyword("var");var t=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(e,new a.VariableDeclaration(t,"var"))},e.prototype.parseEmptyStatement=function(){var e=this.createNode();return this.expect(";"),this.finalize(e,new a.EmptyStatement)},e.prototype.parseExpressionStatement=function(){var e=this.createNode(),t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new a.ExpressionStatement(t))},e.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(o.Messages.StrictFunction),this.parseStatement()},e.prototype.parseIfStatement=function(){var e,t=this.createNode(),n=null;this.expectKeyword("if"),this.expect("(");var r=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new a.EmptyStatement)):(this.expect(")"),e=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),n=this.parseIfClause())),this.finalize(t,new a.IfStatement(r,e,n))},e.prototype.parseDoWhileStatement=function(){var e=this.createNode();this.expectKeyword("do");var t=this.context.inIteration;this.context.inIteration=!0;var n=this.parseStatement();this.context.inIteration=t,this.expectKeyword("while"),this.expect("(");var r=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(e,new a.DoWhileStatement(n,r))},e.prototype.parseWhileStatement=function(){var e,t=this.createNode();this.expectKeyword("while"),this.expect("(");var n=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new a.EmptyStatement);else{this.expect(")");var r=this.context.inIteration;this.context.inIteration=!0,e=this.parseStatement(),this.context.inIteration=r}return this.finalize(t,new a.WhileStatement(n,e))},e.prototype.parseForStatement=function(){var e,t,n=null,r=null,i=null,s=!0,l=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){n=this.createNode(),this.nextToken();var c=this.context.allowIn;this.context.allowIn=!1;var p=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=c,1===p.length&&this.matchKeyword("in")){var f=p[0];f.init&&(f.id.type===u.Syntax.ArrayPattern||f.id.type===u.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(o.Messages.ForInOfLoopInitializer,"for-in"),n=this.finalize(n,new a.VariableDeclaration(p,"var")),this.nextToken(),e=n,t=this.parseExpression(),n=null}else 1===p.length&&null===p[0].init&&this.matchContextualKeyword("of")?(n=this.finalize(n,new a.VariableDeclaration(p,"var")),this.nextToken(),e=n,t=this.parseAssignmentExpression(),n=null,s=!1):(n=this.finalize(n,new a.VariableDeclaration(p,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){n=this.createNode();var h=this.nextToken().value;if(this.context.strict||"in"!==this.lookahead.value){var c=this.context.allowIn;this.context.allowIn=!1;var p=this.parseBindingList(h,{inFor:!0});this.context.allowIn=c,1===p.length&&null===p[0].init&&this.matchKeyword("in")?(n=this.finalize(n,new a.VariableDeclaration(p,h)),this.nextToken(),e=n,t=this.parseExpression(),n=null):1===p.length&&null===p[0].init&&this.matchContextualKeyword("of")?(n=this.finalize(n,new a.VariableDeclaration(p,h)),this.nextToken(),e=n,t=this.parseAssignmentExpression(),n=null,s=!1):(this.consumeSemicolon(),n=this.finalize(n,new a.VariableDeclaration(p,h)))}else n=this.finalize(n,new a.Identifier(h)),this.nextToken(),e=n,t=this.parseExpression(),n=null}else{var d=this.lookahead,c=this.context.allowIn;if(this.context.allowIn=!1,n=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=c,this.matchKeyword("in"))this.context.isAssignmentTarget&&n.type!==u.Syntax.AssignmentExpression||this.tolerateError(o.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(n),e=n,t=this.parseExpression(),n=null;else if(this.matchContextualKeyword("of"))this.context.isAssignmentTarget&&n.type!==u.Syntax.AssignmentExpression||this.tolerateError(o.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(n),e=n,t=this.parseAssignmentExpression(),n=null,s=!1;else{if(this.match(",")){for(var m=[n];this.match(",");)this.nextToken(),m.push(this.isolateCoverGrammar(this.parseAssignmentExpression));n=this.finalize(this.startNode(d),new a.SequenceExpression(m))}this.expect(";")}}void 0===e&&(this.match(";")||(r=this.parseExpression()),this.expect(";"),this.match(")")||(i=this.parseExpression()));var v;if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),v=this.finalize(this.createNode(),new a.EmptyStatement);else{this.expect(")");var g=this.context.inIteration;this.context.inIteration=!0,v=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=g}return void 0===e?this.finalize(l,new a.ForStatement(n,r,i,v)):s?this.finalize(l,new a.ForInStatement(e,t,v)):this.finalize(l,new a.ForOfStatement(e,t,v))},e.prototype.parseContinueStatement=function(){var e=this.createNode();this.expectKeyword("continue");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier();t=n;var r="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)||this.throwError(o.Messages.UnknownLabel,n.name)}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.throwError(o.Messages.IllegalContinue),this.finalize(e,new a.ContinueStatement(t))},e.prototype.parseBreakStatement=function(){var e=this.createNode();this.expectKeyword("break");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier(),r="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)||this.throwError(o.Messages.UnknownLabel,n.name),t=n}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.context.inSwitch||this.throwError(o.Messages.IllegalBreak),this.finalize(e,new a.BreakStatement(t))},e.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(o.Messages.IllegalReturn);var e=this.createNode();this.expectKeyword("return");var t=!this.match(";")&&!this.match("}")&&!this.hasLineTerminator&&2!==this.lookahead.type,n=t?this.parseExpression():null;return this.consumeSemicolon(),this.finalize(e,new a.ReturnStatement(n))},e.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(o.Messages.StrictModeWith);var e,t=this.createNode();this.expectKeyword("with"),this.expect("(");var n=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new a.EmptyStatement)):(this.expect(")"),e=this.parseStatement()),this.finalize(t,new a.WithStatement(n,e))},e.prototype.parseSwitchCase=function(){var e,t=this.createNode();this.matchKeyword("default")?(this.nextToken(),e=null):(this.expectKeyword("case"),e=this.parseExpression()),this.expect(":");for(var n=[];;){if(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"))break;n.push(this.parseStatementListItem())}return this.finalize(t,new a.SwitchCase(e,n))},e.prototype.parseSwitchStatement=function(){var e=this.createNode();this.expectKeyword("switch"),this.expect("(");var t=this.parseExpression();this.expect(")");var n=this.context.inSwitch;this.context.inSwitch=!0;var r=[],i=!1;for(this.expect("{");;){if(this.match("}"))break;var s=this.parseSwitchCase();null===s.test&&(i&&this.throwError(o.Messages.MultipleDefaultsInSwitch),i=!0),r.push(s)}return this.expect("}"),this.context.inSwitch=n,this.finalize(e,new a.SwitchStatement(t,r))},e.prototype.parseLabelledStatement=function(){var e,t=this.createNode(),n=this.parseExpression();if(n.type===u.Syntax.Identifier&&this.match(":")){this.nextToken();var r=n,i="$"+r.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,i)&&this.throwError(o.Messages.Redeclaration,"Label",r.name),this.context.labelSet[i]=!0;var s=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),s=this.parseClassDeclaration();else if(this.matchKeyword("function")){var l=this.lookahead,c=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(l,o.Messages.StrictFunction):c.generator&&this.tolerateUnexpectedToken(l,o.Messages.GeneratorInLegacyContext),s=c}else s=this.parseStatement();delete this.context.labelSet[i],e=new a.LabeledStatement(r,s)}else this.consumeSemicolon(),e=new a.ExpressionStatement(n);return this.finalize(t,e)},e.prototype.parseThrowStatement=function(){var e=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(o.Messages.NewlineAfterThrow);var t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new a.ThrowStatement(t))},e.prototype.parseCatchClause=function(){var e=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var t=[],n=this.parsePattern(t),r={},i=0;i<t.length;i++){var s="$"+t[i].value;Object.prototype.hasOwnProperty.call(r,s)&&this.tolerateError(o.Messages.DuplicateBinding,t[i].value),r[s]=!0}this.context.strict&&n.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(n.name)&&this.tolerateError(o.Messages.StrictCatchVariable),this.expect(")");var l=this.parseBlock();return this.finalize(e,new a.CatchClause(n,l))},e.prototype.parseFinallyClause=function(){return this.expectKeyword("finally"),this.parseBlock()},e.prototype.parseTryStatement=function(){var e=this.createNode();this.expectKeyword("try");var t=this.parseBlock(),n=this.matchKeyword("catch")?this.parseCatchClause():null,r=this.matchKeyword("finally")?this.parseFinallyClause():null;return n||r||this.throwError(o.Messages.NoCatchOrFinally),this.finalize(e,new a.TryStatement(t,n,r))},e.prototype.parseDebuggerStatement=function(){var e=this.createNode();return this.expectKeyword("debugger"),this.consumeSemicolon(),this.finalize(e,new a.DebuggerStatement)},e.prototype.parseStatement=function(){var e;switch(this.lookahead.type){case 1:case 5:case 6:case 8:case 10:case 9:e=this.parseExpressionStatement();break;case 7:var t=this.lookahead.value;e="{"===t?this.parseBlock():"("===t?this.parseExpressionStatement():";"===t?this.parseEmptyStatement():this.parseExpressionStatement();break;case 3:e=this.matchAsyncFunction()?this.parseFunctionDeclaration():this.parseLabelledStatement();break;case 4:switch(this.lookahead.value){case"break":e=this.parseBreakStatement();break;case"continue":e=this.parseContinueStatement();break;case"debugger":e=this.parseDebuggerStatement();break;case"do":e=this.parseDoWhileStatement();break;case"for":e=this.parseForStatement();break;case"function":e=this.parseFunctionDeclaration();break;case"if":e=this.parseIfStatement();break;case"return":e=this.parseReturnStatement();break;case"switch":e=this.parseSwitchStatement();break;case"throw":e=this.parseThrowStatement();break;case"try":e=this.parseTryStatement();break;case"var":e=this.parseVariableStatement();break;case"while":e=this.parseWhileStatement();break;case"with":e=this.parseWithStatement();break;default:e=this.parseExpressionStatement()}break;default:e=this.throwUnexpectedToken(this.lookahead)}return e},e.prototype.parseFunctionSourceElements=function(){var e=this.createNode();this.expect("{");var t=this.parseDirectivePrologues(),n=this.context.labelSet,r=this.context.inIteration,i=this.context.inSwitch,o=this.context.inFunctionBody;for(this.context.labelSet={},this.context.inIteration=!1,this.context.inSwitch=!1,this.context.inFunctionBody=!0;2!==this.lookahead.type&&!this.match("}");)t.push(this.parseStatementListItem());return this.expect("}"),this.context.labelSet=n,this.context.inIteration=r,this.context.inSwitch=i,this.context.inFunctionBody=o,this.finalize(e,new a.BlockStatement(t))},e.prototype.validateParam=function(e,t,n){var r="$"+n;this.context.strict?(this.scanner.isRestrictedWord(n)&&(e.stricted=t,e.message=o.Messages.StrictParamName),Object.prototype.hasOwnProperty.call(e.paramSet,r)&&(e.stricted=t,e.message=o.Messages.StrictParamDupe)):e.firstRestricted||(this.scanner.isRestrictedWord(n)?(e.firstRestricted=t,e.message=o.Messages.StrictParamName):this.scanner.isStrictModeReservedWord(n)?(e.firstRestricted=t,e.message=o.Messages.StrictReservedWord):Object.prototype.hasOwnProperty.call(e.paramSet,r)&&(e.stricted=t,e.message=o.Messages.StrictParamDupe)),"function"==typeof Object.defineProperty?Object.defineProperty(e.paramSet,r,{value:!0,enumerable:!0,writable:!0,configurable:!0}):e.paramSet[r]=!0},e.prototype.parseRestElement=function(e){var t=this.createNode();this.expect("...");var n=this.parsePattern(e);return this.match("=")&&this.throwError(o.Messages.DefaultRestParameter),this.match(")")||this.throwError(o.Messages.ParameterAfterRestParameter),this.finalize(t,new a.RestElement(n))},e.prototype.parseFormalParameter=function(e){for(var t=[],n=this.match("...")?this.parseRestElement(t):this.parsePatternWithDefault(t),r=0;r<t.length;r++)this.validateParam(e,t[r],t[r].value);e.simple=e.simple&&n instanceof a.Identifier,e.params.push(n)},e.prototype.parseFormalParameters=function(e){var t;if(t={simple:!0,params:[],firstRestricted:e},this.expect("("),!this.match(")"))for(t.paramSet={};2!==this.lookahead.type&&(this.parseFormalParameter(t),!this.match(")"))&&(this.expect(","),!this.match(")")););return this.expect(")"),{simple:t.simple,params:t.params,stricted:t.stricted,firstRestricted:t.firstRestricted,message:t.message}},e.prototype.matchAsyncFunction=function(){var e=this.matchContextualKeyword("async");if(e){var t=this.scanner.saveState();this.scanner.scanComments();var n=this.scanner.lex();this.scanner.restoreState(t),e=t.lineNumber===n.lineNumber&&4===n.type&&"function"===n.value}return e},e.prototype.parseFunctionDeclaration=function(e){var t=this.createNode(),n=this.matchContextualKeyword("async");n&&this.nextToken(),this.expectKeyword("function");var r=!n&&this.match("*");r&&this.nextToken();var i,s=null,u=null;if(!e||!this.match("(")){var l=this.lookahead;s=this.parseVariableIdentifier(),this.context.strict?this.scanner.isRestrictedWord(l.value)&&this.tolerateUnexpectedToken(l,o.Messages.StrictFunctionName):this.scanner.isRestrictedWord(l.value)?(u=l,i=o.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(l.value)&&(u=l,i=o.Messages.StrictReservedWord)}var c=this.context.await,p=this.context.allowYield;this.context.await=n,this.context.allowYield=!r;var f=this.parseFormalParameters(u),h=f.params,d=f.stricted;u=f.firstRestricted,f.message&&(i=f.message);var m=this.context.strict,v=this.context.allowStrictDirective;this.context.allowStrictDirective=f.simple;var g=this.parseFunctionSourceElements();return this.context.strict&&u&&this.throwUnexpectedToken(u,i),this.context.strict&&d&&this.tolerateUnexpectedToken(d,i),this.context.strict=m,this.context.allowStrictDirective=v,this.context.await=c,this.context.allowYield=p,n?this.finalize(t,new a.AsyncFunctionDeclaration(s,h,g)):this.finalize(t,new a.FunctionDeclaration(s,h,g,r))},e.prototype.parseFunctionExpression=function(){var e=this.createNode(),t=this.matchContextualKeyword("async");t&&this.nextToken(),this.expectKeyword("function");var n=!t&&this.match("*");n&&this.nextToken();var r,i,s=null,u=this.context.await,l=this.context.allowYield;if(this.context.await=t,this.context.allowYield=!n,!this.match("(")){var c=this.lookahead;s=this.context.strict||n||!this.matchKeyword("yield")?this.parseVariableIdentifier():this.parseIdentifierName(),this.context.strict?this.scanner.isRestrictedWord(c.value)&&this.tolerateUnexpectedToken(c,o.Messages.StrictFunctionName):this.scanner.isRestrictedWord(c.value)?(i=c,r=o.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(c.value)&&(i=c,r=o.Messages.StrictReservedWord)}var p=this.parseFormalParameters(i),f=p.params,h=p.stricted;i=p.firstRestricted,p.message&&(r=p.message);var d=this.context.strict,m=this.context.allowStrictDirective;this.context.allowStrictDirective=p.simple;var v=this.parseFunctionSourceElements();return this.context.strict&&i&&this.throwUnexpectedToken(i,r),this.context.strict&&h&&this.tolerateUnexpectedToken(h,r),this.context.strict=d,this.context.allowStrictDirective=m,this.context.await=u,this.context.allowYield=l,t?this.finalize(e,new a.AsyncFunctionExpression(s,f,v)):this.finalize(e,new a.FunctionExpression(s,f,v,n))},e.prototype.parseDirective=function(){var e=this.lookahead,t=this.createNode(),n=this.parseExpression(),r=n.type===u.Syntax.Literal?this.getTokenRaw(e).slice(1,-1):null;return this.consumeSemicolon(),this.finalize(t,r?new a.Directive(n,r):new a.ExpressionStatement(n))},e.prototype.parseDirectivePrologues=function(){for(var e=null,t=[];;){var n=this.lookahead;if(8!==n.type)break;var r=this.parseDirective();t.push(r);var i=r.directive;if("string"!=typeof i)break;"use strict"===i?(this.context.strict=!0,e&&this.tolerateUnexpectedToken(e,o.Messages.StrictOctalLiteral),this.context.allowStrictDirective||this.tolerateUnexpectedToken(n,o.Messages.IllegalLanguageModeDirective)):!e&&n.octal&&(e=n)}return t},e.prototype.qualifiedPropertyName=function(e){switch(e.type){case 3:case 8:case 1:case 5:case 6:case 4:return!0;case 7:return"["===e.value}return!1},e.prototype.parseGetterMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!1;var n=this.parseFormalParameters();n.params.length>0&&this.tolerateError(o.Messages.BadGetterArity);var r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new a.FunctionExpression(null,n.params,r,!1))},e.prototype.parseSetterMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!1;var n=this.parseFormalParameters();1!==n.params.length?this.tolerateError(o.Messages.BadSetterArity):n.params[0]instanceof a.RestElement&&this.tolerateError(o.Messages.BadSetterRestParameter);var r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new a.FunctionExpression(null,n.params,r,!1))},e.prototype.parseGeneratorMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();this.context.allowYield=!1;var r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new a.FunctionExpression(null,n.params,r,!0))},e.prototype.isStartOfExpression=function(){var e=!0,t=this.lookahead.value;switch(this.lookahead.type){case 7:e="["===t||"("===t||"{"===t||"+"===t||"-"===t||"!"===t||"~"===t||"++"===t||"--"===t||"/"===t||"/="===t;break;case 4:e="class"===t||"delete"===t||"function"===t||"let"===t||"new"===t||"super"===t||"this"===t||"typeof"===t||"void"===t||"yield"===t}return e},e.prototype.parseYieldExpression=function(){var e=this.createNode();this.expectKeyword("yield");var t=null,n=!1;if(!this.hasLineTerminator){var r=this.context.allowYield;this.context.allowYield=!1,n=this.match("*"),n?(this.nextToken(),t=this.parseAssignmentExpression()):this.isStartOfExpression()&&(t=this.parseAssignmentExpression()),this.context.allowYield=r}return this.finalize(e,new a.YieldExpression(t,n))},e.prototype.parseClassElement=function(e){var t=this.lookahead,n=this.createNode(),r="",i=null,s=null,u=!1,l=!1,c=!1,p=!1;if(this.match("*"))this.nextToken();else{u=this.match("["),i=this.parseObjectPropertyKey();if("static"===i.name&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(t=this.lookahead,c=!0,u=this.match("["),this.match("*")?this.nextToken():i=this.parseObjectPropertyKey()),3===t.type&&!this.hasLineTerminator&&"async"===t.value){var f=this.lookahead.value;":"!==f&&"("!==f&&"*"!==f&&(p=!0,t=this.lookahead,i=this.parseObjectPropertyKey(),3===t.type&&("get"===t.value||"set"===t.value?this.tolerateUnexpectedToken(t):"constructor"===t.value&&this.tolerateUnexpectedToken(t,o.Messages.ConstructorIsAsync)))}}var h=this.qualifiedPropertyName(this.lookahead);return 3===t.type?"get"===t.value&&h?(r="get",u=this.match("["),i=this.parseObjectPropertyKey(),this.context.allowYield=!1,s=this.parseGetterMethod()):"set"===t.value&&h&&(r="set",u=this.match("["),i=this.parseObjectPropertyKey(),s=this.parseSetterMethod()):7===t.type&&"*"===t.value&&h&&(r="init",u=this.match("["),i=this.parseObjectPropertyKey(),s=this.parseGeneratorMethod(),l=!0),!r&&i&&this.match("(")&&(r="init",s=p?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),l=!0),r||this.throwUnexpectedToken(this.lookahead),"init"===r&&(r="method"),u||(c&&this.isPropertyKey(i,"prototype")&&this.throwUnexpectedToken(t,o.Messages.StaticPrototype),!c&&this.isPropertyKey(i,"constructor")&&(("method"!==r||!l||s&&s.generator)&&this.throwUnexpectedToken(t,o.Messages.ConstructorSpecialMethod),e.value?this.throwUnexpectedToken(t,o.Messages.DuplicateConstructor):e.value=!0,r="constructor")),this.finalize(n,new a.MethodDefinition(i,u,s,r,c))},e.prototype.parseClassElementList=function(){var e=[],t={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():e.push(this.parseClassElement(t));return this.expect("}"),e},e.prototype.parseClassBody=function(){var e=this.createNode(),t=this.parseClassElementList();return this.finalize(e,new a.ClassBody(t))},e.prototype.parseClassDeclaration=function(e){var t=this.createNode(),n=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var r=e&&3!==this.lookahead.type?null:this.parseVariableIdentifier(),i=null;this.matchKeyword("extends")&&(this.nextToken(),i=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var o=this.parseClassBody();return this.context.strict=n,this.finalize(t,new a.ClassDeclaration(r,i,o))},e.prototype.parseClassExpression=function(){var e=this.createNode(),t=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var n=3===this.lookahead.type?this.parseVariableIdentifier():null,r=null;this.matchKeyword("extends")&&(this.nextToken(),r=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var i=this.parseClassBody();return this.context.strict=t,this.finalize(e,new a.ClassExpression(n,r,i))},e.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0;for(var e=this.createNode(),t=this.parseDirectivePrologues();2!==this.lookahead.type;)t.push(this.parseStatementListItem());return this.finalize(e,new a.Module(t))},e.prototype.parseScript=function(){for(var e=this.createNode(),t=this.parseDirectivePrologues();2!==this.lookahead.type;)t.push(this.parseStatementListItem());return this.finalize(e,new a.Script(t))},e.prototype.parseModuleSpecifier=function(){var e=this.createNode();8!==this.lookahead.type&&this.throwError(o.Messages.InvalidModuleSpecifier);var t=this.nextToken(),n=this.getTokenRaw(t);return this.finalize(e,new a.Literal(t.value,n))},e.prototype.parseImportSpecifier=function(){var e,t,n=this.createNode();return 3===this.lookahead.type?(e=this.parseVariableIdentifier(),t=e,this.matchContextualKeyword("as")&&(this.nextToken(),t=this.parseVariableIdentifier())):(e=this.parseIdentifierName(),t=e,this.matchContextualKeyword("as")?(this.nextToken(),t=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(n,new a.ImportSpecifier(t,e))},e.prototype.parseNamedImports=function(){this.expect("{");for(var e=[];!this.match("}");)e.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),e},e.prototype.parseImportDefaultSpecifier=function(){var e=this.createNode(),t=this.parseIdentifierName();return this.finalize(e,new a.ImportDefaultSpecifier(t))},e.prototype.parseImportNamespaceSpecifier=function(){var e=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(o.Messages.NoAsAfterImportNamespace),this.nextToken();var t=this.parseIdentifierName();return this.finalize(e,new a.ImportNamespaceSpecifier(t))},e.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(o.Messages.IllegalImportDeclaration);var e=this.createNode();this.expectKeyword("import");var t,n=[];if(8===this.lookahead.type)t=this.parseModuleSpecifier();else{if(this.match("{")?n=n.concat(this.parseNamedImports()):this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(n.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.match("{")?n=n.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var r=this.lookahead.value?o.Messages.UnexpectedToken:o.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}this.nextToken(),t=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(e,new a.ImportDeclaration(n,t))},e.prototype.parseExportSpecifier=function(){var e=this.createNode(),t=this.parseIdentifierName(),n=t;return this.matchContextualKeyword("as")&&(this.nextToken(),n=this.parseIdentifierName()),this.finalize(e,new a.ExportSpecifier(t,n))},e.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(o.Messages.IllegalExportDeclaration);var e=this.createNode();this.expectKeyword("export");var t;if(this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var n=this.parseFunctionDeclaration(!0);t=this.finalize(e,new a.ExportDefaultDeclaration(n))}else if(this.matchKeyword("class")){var n=this.parseClassDeclaration(!0);t=this.finalize(e,new a.ExportDefaultDeclaration(n))}else if(this.matchContextualKeyword("async")){var n=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression();t=this.finalize(e,new a.ExportDefaultDeclaration(n))}else{this.matchContextualKeyword("from")&&this.throwError(o.Messages.UnexpectedToken,this.lookahead.value);var n=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression();this.consumeSemicolon(),t=this.finalize(e,new a.ExportDefaultDeclaration(n))}else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var r=this.lookahead.value?o.Messages.UnexpectedToken:o.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}this.nextToken();var i=this.parseModuleSpecifier();this.consumeSemicolon(),t=this.finalize(e,new a.ExportAllDeclaration(i))}else if(4===this.lookahead.type){var n=void 0;switch(this.lookahead.value){case"let":case"const":n=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":n=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}t=this.finalize(e,new a.ExportNamedDeclaration(n,[],null))}else if(this.matchAsyncFunction()){var n=this.parseFunctionDeclaration();t=this.finalize(e,new a.ExportNamedDeclaration(n,[],null))}else{var s=[],u=null,l=!1;for(this.expect("{");!this.match("}");)l=l||this.matchKeyword("default"),s.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");if(this.expect("}"),this.matchContextualKeyword("from"))this.nextToken(),u=this.parseModuleSpecifier(),this.consumeSemicolon();else if(l){var r=this.lookahead.value?o.Messages.UnexpectedToken:o.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}else this.consumeSemicolon();t=this.finalize(e,new a.ExportNamedDeclaration(null,s,u))}return t},e}();t.Parser=c},function(e,t){"use strict";function n(e,t){if(!e)throw new Error("ASSERT: "+t)}Object.defineProperty(t,"__esModule",{value:!0}),t.assert=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this.errors=[],this.tolerant=!1}return e.prototype.recordError=function(e){this.errors.push(e)},e.prototype.tolerate=function(e){if(!this.tolerant)throw e;this.recordError(e)},e.prototype.constructError=function(e,t){var n=new Error(e);try{throw n}catch(e){Object.create&&Object.defineProperty&&(n=Object.create(e),Object.defineProperty(n,"column",{value:t}))}return n},e.prototype.createError=function(e,t,n,r){var i="Line "+t+": "+r,o=this.constructError(i,n);return o.index=e,o.lineNumber=t,o.description=r,o},e.prototype.throwError=function(e,t,n,r){throw this.createError(e,t,n,r)},e.prototype.tolerateError=function(e,t,n,r){var i=this.createError(e,t,n,r);if(!this.tolerant)throw i;this.recordError(i)},e}();t.ErrorHandler=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(e,t,n){"use strict";function r(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function i(e){return"01234567".indexOf(e)}Object.defineProperty(t,"__esModule",{value:!0});var o=n(9),a=n(4),s=n(11),u=function(){function e(e,t){this.source=e,this.errorHandler=t,this.trackComment=!1,this.length=e.length,this.index=0,this.lineNumber=e.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return e.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},e.prototype.restoreState=function(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart},e.prototype.eof=function(){return this.index>=this.length},e.prototype.throwUnexpectedToken=function(e){return void 0===e&&(e=s.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.tolerateUnexpectedToken=function(e){void 0===e&&(e=s.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.skipSingleLineComment=function(e){var t,n,r=[];for(this.trackComment&&(r=[],t=this.index-e,n={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{}});!this.eof();){var i=this.source.charCodeAt(this.index);if(++this.index,a.Character.isLineTerminator(i)){if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart-1};var o={multiLine:!1,slice:[t+e,this.index-1],range:[t,this.index-1],loc:n};r.push(o)}return 13===i&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,r}}if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart};var o={multiLine:!1,slice:[t+e,this.index],range:[t,this.index],loc:n};r.push(o)}return r},e.prototype.skipMultiLineComment=function(){var e,t,n=[];for(this.trackComment&&(n=[],e=this.index-2,t={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var r=this.source.charCodeAt(this.index);if(a.Character.isLineTerminator(r))13===r&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===r){if(47===this.source.charCodeAt(this.index+1)){if(this.index+=2,this.trackComment){t.end={line:this.lineNumber,column:this.index-this.lineStart};var i={multiLine:!0,slice:[e+2,this.index-2],range:[e,this.index],loc:t};n.push(i)}return n}++this.index}else++this.index}if(this.trackComment){t.end={line:this.lineNumber,column:this.index-this.lineStart};var i={multiLine:!0,slice:[e+2,this.index],range:[e,this.index],loc:t};n.push(i)}return this.tolerateUnexpectedToken(),n},e.prototype.scanComments=function(){var e;this.trackComment&&(e=[]);for(var t=0===this.index;!this.eof();){var n=this.source.charCodeAt(this.index);if(a.Character.isWhiteSpace(n))++this.index;else if(a.Character.isLineTerminator(n))++this.index,13===n&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t=!0;else if(47===n)if(47===(n=this.source.charCodeAt(this.index+1))){this.index+=2;var r=this.skipSingleLineComment(2);this.trackComment&&(e=e.concat(r)),t=!0}else{if(42!==n)break;this.index+=2;var r=this.skipMultiLineComment();this.trackComment&&(e=e.concat(r))}else if(t&&45===n){if(45!==this.source.charCodeAt(this.index+1)||62!==this.source.charCodeAt(this.index+2))break;this.index+=3;var r=this.skipSingleLineComment(3);this.trackComment&&(e=e.concat(r))}else{if(60!==n)break;if("!--"!==this.source.slice(this.index+1,this.index+4))break;this.index+=4;var r=this.skipSingleLineComment(4);this.trackComment&&(e=e.concat(r))}}return e},e.prototype.isFutureReservedWord=function(e){switch(e){case"enum":case"export":case"import":case"super":return!0;default:return!1}},e.prototype.isStrictModeReservedWord=function(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},e.prototype.isRestrictedWord=function(e){return"eval"===e||"arguments"===e},e.prototype.isKeyword=function(e){switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}},e.prototype.codePointAt=function(e){var t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){var n=this.source.charCodeAt(e+1);if(n>=56320&&n<=57343){t=1024*(t-55296)+n-56320+65536}}return t},e.prototype.scanHexEscape=function(e){for(var t="u"===e?4:2,n=0,i=0;i<t;++i){if(this.eof()||!a.Character.isHexDigit(this.source.charCodeAt(this.index)))return null;n=16*n+r(this.source[this.index++])}return String.fromCharCode(n)},e.prototype.scanUnicodeCodePointEscape=function(){var e=this.source[this.index],t=0;for("}"===e&&this.throwUnexpectedToken();!this.eof()&&(e=this.source[this.index++],a.Character.isHexDigit(e.charCodeAt(0)));)t=16*t+r(e);return(t>1114111||"}"!==e)&&this.throwUnexpectedToken(),a.Character.fromCodePoint(t)},e.prototype.getIdentifier=function(){for(var e=this.index++;!this.eof();){var t=this.source.charCodeAt(this.index);if(92===t)return this.index=e,this.getComplexIdentifier();if(t>=55296&&t<57343)return this.index=e,this.getComplexIdentifier();if(!a.Character.isIdentifierPart(t))break;++this.index}return this.source.slice(e,this.index)},e.prototype.getComplexIdentifier=function(){var e=this.codePointAt(this.index),t=a.Character.fromCodePoint(e);this.index+=t.length;var n;for(92===e&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,n=this.scanUnicodeCodePointEscape()):null!==(n=this.scanHexEscape("u"))&&"\\"!==n&&a.Character.isIdentifierStart(n.charCodeAt(0))||this.throwUnexpectedToken(),t=n);!this.eof()&&(e=this.codePointAt(this.index),a.Character.isIdentifierPart(e));)n=a.Character.fromCodePoint(e),t+=n,this.index+=n.length,92===e&&(t=t.substr(0,t.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,n=this.scanUnicodeCodePointEscape()):null!==(n=this.scanHexEscape("u"))&&"\\"!==n&&a.Character.isIdentifierPart(n.charCodeAt(0))||this.throwUnexpectedToken(),t+=n);return t},e.prototype.octalToDecimal=function(e){var t="0"!==e,n=i(e);return!this.eof()&&a.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,n=8*n+i(this.source[this.index++]),"0123".indexOf(e)>=0&&!this.eof()&&a.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+i(this.source[this.index++]))),{code:n,octal:t}},e.prototype.scanIdentifier=function(){var e,t=this.index,n=92===this.source.charCodeAt(t)?this.getComplexIdentifier():this.getIdentifier();if(3!==(e=1===n.length?3:this.isKeyword(n)?4:"null"===n?5:"true"===n||"false"===n?1:3)&&t+n.length!==this.index){var r=this.index;this.index=t,this.tolerateUnexpectedToken(s.Messages.InvalidEscapedReservedWord),this.index=r}return{type:e,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.scanPunctuator=function(){var e=this.index,t=this.source[this.index];switch(t){case"(":case"{":"{"===t&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,t="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:t=this.source.substr(this.index,4),">>>="===t?this.index+=4:(t=t.substr(0,3),"==="===t||"!=="===t||">>>"===t||"<<="===t||">>="===t||"**="===t?this.index+=3:(t=t.substr(0,2),"&&"===t||"||"===t||"=="===t||"!="===t||"+="===t||"-="===t||"*="===t||"/="===t||"++"===t||"--"===t||"<<"===t||">>"===t||"&="===t||"|="===t||"^="===t||"%="===t||"<="===t||">="===t||"=>"===t||"**"===t?this.index+=2:(t=this.source[this.index],"<>=!+-*%&|^/".indexOf(t)>=0&&++this.index)))}return this.index===e&&this.throwUnexpectedToken(),{type:7,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanHexLiteral=function(e){for(var t="";!this.eof()&&a.Character.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index++];return 0===t.length&&this.throwUnexpectedToken(),a.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+t,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanBinaryLiteral=function(e){for(var t,n="";!this.eof()&&("0"===(t=this.source[this.index])||"1"===t);)n+=this.source[this.index++];return 0===n.length&&this.throwUnexpectedToken(),this.eof()||(t=this.source.charCodeAt(this.index),(a.Character.isIdentifierStart(t)||a.Character.isDecimalDigit(t))&&this.throwUnexpectedToken()),{type:6,value:parseInt(n,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanOctalLiteral=function(e,t){var n="",r=!1;for(a.Character.isOctalDigit(e.charCodeAt(0))?(r=!0,n="0"+this.source[this.index++]):++this.index;!this.eof()&&a.Character.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return r||0!==n.length||this.throwUnexpectedToken(),(a.Character.isIdentifierStart(this.source.charCodeAt(this.index))||a.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(n,8),octal:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.isImplicitOctalLiteral=function(){for(var e=this.index+1;e<this.length;++e){var t=this.source[e];if("8"===t||"9"===t)return!1;if(!a.Character.isOctalDigit(t.charCodeAt(0)))return!0}return!0},e.prototype.scanNumericLiteral=function(){var e=this.index,t=this.source[e];o.assert(a.Character.isDecimalDigit(t.charCodeAt(0))||"."===t,"Numeric literal must start with a decimal digit or a decimal point");var n="";if("."!==t){if(n=this.source[this.index++],t=this.source[this.index],"0"===n){if("x"===t||"X"===t)return++this.index,this.scanHexLiteral(e);if("b"===t||"B"===t)return++this.index,this.scanBinaryLiteral(e);if("o"===t||"O"===t)return this.scanOctalLiteral(t,e);if(t&&a.Character.isOctalDigit(t.charCodeAt(0))&&this.isImplicitOctalLiteral())return this.scanOctalLiteral(t,e)}for(;a.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];t=this.source[this.index]}if("."===t){for(n+=this.source[this.index++];a.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];t=this.source[this.index]}if("e"===t||"E"===t)if(n+=this.source[this.index++],t=this.source[this.index],"+"!==t&&"-"!==t||(n+=this.source[this.index++]),a.Character.isDecimalDigit(this.source.charCodeAt(this.index)))for(;a.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];else this.throwUnexpectedToken();return a.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseFloat(n),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanStringLiteral=function(){var e=this.index,t=this.source[e];o.assert("'"===t||'"'===t,"String literal must starts with a quote"),++this.index;for(var n=!1,r="";!this.eof();){var i=this.source[this.index++];if(i===t){t="";break}if("\\"===i)if((i=this.source[this.index++])&&a.Character.isLineTerminator(i.charCodeAt(0)))++this.lineNumber,"\r"===i&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;else switch(i){case"u":if("{"===this.source[this.index])++this.index,r+=this.scanUnicodeCodePointEscape();else{var u=this.scanHexEscape(i);null===u&&this.throwUnexpectedToken(),r+=u}break;case"x":var l=this.scanHexEscape(i);null===l&&this.throwUnexpectedToken(s.Messages.InvalidHexEscapeSequence),r+=l;break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;case"8":case"9":r+=i,this.tolerateUnexpectedToken();break;default:if(i&&a.Character.isOctalDigit(i.charCodeAt(0))){var c=this.octalToDecimal(i);n=c.octal||n,r+=String.fromCharCode(c.code)}else r+=i}else{if(a.Character.isLineTerminator(i.charCodeAt(0)))break;r+=i}}return""!==t&&(this.index=e,this.throwUnexpectedToken()),{type:8,value:r,octal:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanTemplate=function(){var e="",t=!1,n=this.index,r="`"===this.source[n],i=!1,o=2;for(++this.index;!this.eof();){var u=this.source[this.index++];if("`"===u){o=1,i=!0,t=!0;break}if("$"===u){if("{"===this.source[this.index]){this.curlyStack.push("${"),++this.index,t=!0;break}e+=u}else if("\\"===u)if(u=this.source[this.index++],a.Character.isLineTerminator(u.charCodeAt(0)))++this.lineNumber,"\r"===u&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;else switch(u){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"u":if("{"===this.source[this.index])++this.index,e+=this.scanUnicodeCodePointEscape();else{var l=this.index,c=this.scanHexEscape(u);null!==c?e+=c:(this.index=l,e+=u)}break;case"x":var p=this.scanHexEscape(u);null===p&&this.throwUnexpectedToken(s.Messages.InvalidHexEscapeSequence),e+=p;break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:"0"===u?(a.Character.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(s.Messages.TemplateOctalLiteral),e+="\0"):a.Character.isOctalDigit(u.charCodeAt(0))?this.throwUnexpectedToken(s.Messages.TemplateOctalLiteral):e+=u}else a.Character.isLineTerminator(u.charCodeAt(0))?(++this.lineNumber,"\r"===u&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index,e+="\n"):e+=u}return t||this.throwUnexpectedToken(),r||this.curlyStack.pop(),{type:10,value:this.source.slice(n+1,this.index-o),cooked:e,head:r,tail:i,lineNumber:this.lineNumber,lineStart:this.lineStart,start:n,end:this.index}},e.prototype.testRegExp=function(e,t){var n=e,r=this;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(e,t,n){var i=parseInt(t||n,16);return i>1114111&&r.throwUnexpectedToken(s.Messages.InvalidRegExp),i<=65535?String.fromCharCode(i):"￿"}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"￿"));try{RegExp(n)}catch(e){this.throwUnexpectedToken(s.Messages.InvalidRegExp)}try{return new RegExp(e,t)}catch(e){return null}},e.prototype.scanRegExpBody=function(){var e=this.source[this.index];o.assert("/"===e,"Regular expression literal must start with a slash");for(var t=this.source[this.index++],n=!1,r=!1;!this.eof();)if(e=this.source[this.index++],t+=e,"\\"===e)e=this.source[this.index++],a.Character.isLineTerminator(e.charCodeAt(0))&&this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),t+=e;else if(a.Character.isLineTerminator(e.charCodeAt(0)))this.throwUnexpectedToken(s.Messages.UnterminatedRegExp);else if(n)"]"===e&&(n=!1);else{if("/"===e){r=!0;break}"["===e&&(n=!0)}return r||this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),t.substr(1,t.length-2)},e.prototype.scanRegExpFlags=function(){for(var e="",t="";!this.eof();){var n=this.source[this.index];if(!a.Character.isIdentifierPart(n.charCodeAt(0)))break;if(++this.index,"\\"!==n||this.eof())t+=n,e+=n;else if("u"===(n=this.source[this.index])){++this.index;var r=this.index,i=this.scanHexEscape("u");if(null!==i)for(t+=i,e+="\\u";r<this.index;++r)e+=this.source[r];else this.index=r,t+="u",e+="\\u";this.tolerateUnexpectedToken()}else e+="\\",this.tolerateUnexpectedToken()}return t},e.prototype.scanRegExp=function(){var e=this.index,t=this.scanRegExpBody(),n=this.scanRegExpFlags();return{type:9,value:"",pattern:t,flags:n,regex:this.testRegExp(t,n),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.lex=function(){if(this.eof())return{type:2,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};var e=this.source.charCodeAt(this.index);return a.Character.isIdentifierStart(e)?this.scanIdentifier():40===e||41===e||59===e?this.scanPunctuator():39===e||34===e?this.scanStringLiteral():46===e?a.Character.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():a.Character.isDecimalDigit(e)?this.scanNumericLiteral():96===e||125===e&&"${"===this.curlyStack[this.curlyStack.length-1]?this.scanTemplate():e>=55296&&e<57343&&a.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},e}();t.Scanner=u},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenName={},t.TokenName[1]="Boolean",t.TokenName[2]="<end>",t.TokenName[3]="Identifier",t.TokenName[4]="Keyword",t.TokenName[5]="Null",t.TokenName[6]="Numeric",t.TokenName[7]="Punctuator",t.TokenName[8]="String",t.TokenName[9]="RegularExpression",t.TokenName[10]="Template"},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",lang:"⟨",rang:"⟩"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(12),o=n(13),a=function(){function e(){this.values=[],this.curly=this.paren=-1}return e.prototype.beforeFunctionExpression=function(e){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(e)>=0},e.prototype.isRegexStart=function(){var e=this.values[this.values.length-1],t=null!==e;switch(e){case"this":case"]":t=!1;break;case")":var n=this.values[this.paren-1];t="if"===n||"while"===n||"for"===n||"with"===n;break;case"}":if(t=!1,"function"===this.values[this.curly-3]){var r=this.values[this.curly-4];t=!!r&&!this.beforeFunctionExpression(r)}else if("function"===this.values[this.curly-4]){var r=this.values[this.curly-5];t=!r||!this.beforeFunctionExpression(r)}}return t},e.prototype.push=function(e){7===e.type||4===e.type?("{"===e.value?this.curly=this.values.length:"("===e.value&&(this.paren=this.values.length),this.values.push(e.value)):this.values.push(null)},e}(),s=function(){function e(e,t){this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=!!t&&("boolean"==typeof t.tolerant&&t.tolerant),this.scanner=new i.Scanner(e,this.errorHandler),this.scanner.trackComment=!!t&&("boolean"==typeof t.comment&&t.comment),this.trackRange=!!t&&("boolean"==typeof t.range&&t.range),this.trackLoc=!!t&&("boolean"==typeof t.loc&&t.loc),this.buffer=[],this.reader=new a}return e.prototype.errors=function(){return this.errorHandler.errors},e.prototype.getNextToken=function(){if(0===this.buffer.length){var e=this.scanner.scanComments();if(this.scanner.trackComment)for(var t=0;t<e.length;++t){var n=e[t],r=this.scanner.source.slice(n.slice[0],n.slice[1]),i={type:n.multiLine?"BlockComment":"LineComment",value:r};this.trackRange&&(i.range=n.range),this.trackLoc&&(i.loc=n.loc),this.buffer.push(i)}if(!this.scanner.eof()){var a=void 0;this.trackLoc&&(a={start:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},end:{}});var s="/"===this.scanner.source[this.scanner.index]&&this.reader.isRegexStart(),u=s?this.scanner.scanRegExp():this.scanner.lex();this.reader.push(u);var l={type:o.TokenName[u.type],value:this.scanner.source.slice(u.start,u.end)};if(this.trackRange&&(l.range=[u.start,u.end]),this.trackLoc&&(a.end={line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},l.loc=a),9===u.type){var c=u.pattern,p=u.flags;l.regex={pattern:c,flags:p}}this.buffer.push(l)}}return this.buffer.shift()},e}();t.Tokenizer=s}])})},function(e,t,n){"use strict";var r,i,o,a,s,u,l,c=n(141),p=n(58),f=Function.prototype.apply,h=Function.prototype.call,d=Object.create,m=Object.defineProperty,v=Object.defineProperties,g=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};r=function(e,t){var n;return p(t),g.call(this,"__ee__")?n=this.__ee__:(n=y.value=d(null),m(this,"__ee__",y),y.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},i=function(e,t){var n,i;return p(t),i=this,r.call(this,e,n=function(){o.call(i,e,n),f.call(t,this,arguments)}),n.__eeOnceListener__=t,this},o=function(e,t){var n,r,i,o;if(p(t),!g.call(this,"__ee__"))return this;if(n=this.__ee__,!n[e])return this;if("object"==typeof(r=n[e]))for(o=0;i=r[o];++o)i!==t&&i.__eeOnceListener__!==t||(2===r.length?n[e]=r[o?0:1]:r.splice(o,1));else r!==t&&r.__eeOnceListener__!==t||delete n[e];return this},a=function(e){var t,n,r,i,o;if(g.call(this,"__ee__")&&(i=this.__ee__[e]))if("object"==typeof i){for(n=arguments.length,o=new Array(n-1),t=1;t<n;++t)o[t-1]=arguments[t];for(i=i.slice(),t=0;r=i[t];++t)f.call(r,this,o)}else switch(arguments.length){case 1:h.call(i,this);break;case 2:h.call(i,this,arguments[1]);break;case 3:h.call(i,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),t=1;t<n;++t)o[t-1]=arguments[t];f.call(i,this,o)}},s={on:r,once:i,off:o,emit:a},u={on:c(r),once:c(i),off:c(o),emit:c(a)},l=v({},u),e.exports=t=function(e){return null==e?d(l):v(Object(e),u)},t.methods=s},function(e,t){/*! - * https://github.com/Starcounter-Jack/JSON-Patch - * json-patch-duplex.js version: 1.2.2 - * (c) 2013 Joachim Wester - * MIT license - */ -var n;if(function(e){function t(e,n){switch(typeof e){case"undefined":case"boolean":case"string":case"number":return e===n;case"object":if(null===e)return null===n;if(k(e)){if(!k(n)||e.length!==n.length)return!1;for(var r=0,i=e.length;r<i;r++)if(!t(e[r],n[r]))return!1;return!0}for(var o=E(e),a=E(n),s=0;s<o.length;s++){var u=o[s];if(!t(e[u],n[u]))return!1;var l=a.indexOf(u);l>=0&&a.splice(l,1)}for(var c=0;c<a.length;c++){var p=a[c];if(!t(e[p],n[p]))return!1}return!0;default:return!1}}function n(e){for(var t=0,n=A.length;t<n;t++)if(A[t].obj===e)return A[t]}function r(e,t){for(var n=0,r=e.observers.length;n<r;n++)if(e.observers[n].callback===t)return e.observers[n].observer}function i(e,t){for(var n=0,r=e.observers.length;n<r;n++)if(e.observers[n].observer===t)return void e.observers.splice(n,1)}function o(e,t){t.unobserve()}function a(e,t){var o,a=[],u=n(e);if(u?o=r(u,t):(u=new D(e),A.push(u)),o)return o;if(o={},u.value=c(e),t){o.callback=t,o.next=null;var l=function(){s(o)},p=function(){clearTimeout(o.next),o.next=setTimeout(l)};"undefined"!=typeof window&&(window.addEventListener?(window.addEventListener("mouseup",p),window.addEventListener("keyup",p),window.addEventListener("mousedown",p),window.addEventListener("keydown",p),window.addEventListener("change",p)):(document.documentElement.attachEvent("onmouseup",p),document.documentElement.attachEvent("onkeyup",p),document.documentElement.attachEvent("onmousedown",p),document.documentElement.attachEvent("onkeydown",p),document.documentElement.attachEvent("onchange",p)))}return o.patches=a,o.object=e,o.unobserve=function(){s(o),clearTimeout(o.next),i(u,o),"undefined"!=typeof window&&(window.removeEventListener?(window.removeEventListener("mouseup",p),window.removeEventListener("keyup",p),window.removeEventListener("mousedown",p),window.removeEventListener("keydown",p)):(document.documentElement.detachEvent("onmouseup",p),document.documentElement.detachEvent("onkeyup",p),document.documentElement.detachEvent("onmousedown",p),document.documentElement.detachEvent("onkeydown",p)))},u.observers.push(new O(t,o)),o}function s(e){for(var t,n=0,r=A.length;n<r;n++)if(A[n].obj===e.object){t=A[n];break}u(t.value,e.object,e.patches,""),e.patches.length&&m(t.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function u(e,t,n,r){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var i=E(t),o=E(e),a=!1,s=o.length-1;s>=0;s--){var l=o[s],f=e[l];if(!t.hasOwnProperty(l)||void 0===t[l]&&void 0!==f&&!1===k(t))n.push({op:"remove",path:r+"/"+p(l)}),a=!0;else{var h=t[l];"object"==typeof f&&null!=f&&"object"==typeof h&&null!=h?u(f,h,n,r+"/"+p(l)):f!==h&&(!0,n.push({op:"replace",path:r+"/"+p(l),value:c(h)}))}}if(a||i.length!=o.length)for(var s=0;s<i.length;s++){var l=i[s];e.hasOwnProperty(l)||void 0===t[l]||n.push({op:"add",path:r+"/"+p(l),value:c(t[l])})}}}function l(e){for(var t,n=0,r=e.length;n<r;){t=e.charCodeAt(n);{if(!(t>=48&&t<=57))return!1;n++}}return!0}function c(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function p(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function f(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function h(e,t){if(""==t)return e;var n={op:"_get",path:t};return d(e,n),n.value}function d(e,n,r,i){if(void 0===r&&(r=!1),void 0===i&&(i=!0),r&&("function"==typeof r?r(n,0,e,n.path):b(n,0)),""===n.path){var o={newDocument:e};if("add"===n.op)return o.newDocument=n.value,o;if("replace"===n.op)return o.newDocument=n.value,o.removed=e,o;if("move"===n.op||"copy"===n.op)return o.newDocument=h(e,n.from),"move"===n.op&&(o.removed=e),o;if("test"===n.op){if(o.test=t(e,n.value),!1===o.test)throw new M("Test operation failed","TEST_OPERATION_FAILED",0,n,e);return o.newDocument=e,o}if("remove"===n.op)return o.removed=e,o.newDocument=null,o;if("_get"===n.op)return n.value=e,o;if(r)throw new M("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",0,n,e);return o}i||(e=c(e));var a=n.path||"",s=a.split("/"),u=e,p=1,d=s.length,m=void 0,v=void 0,g=void 0;for(g="function"==typeof r?r:b;;){if(v=s[p],r&&void 0===m&&(void 0===u[v]?m=s.slice(0,p).join("/"):p==d-1&&(m=n.path),void 0!==m&&g(n,0,e,m)),p++,k(u)){if("-"===v)v=u.length;else{if(r&&!l(v))throw new M("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",0,n.path,n);v=~~v}if(p>=d){if(r&&"add"===n.op&&v>u.length)throw new M("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",0,n.path,n);var o=C[n.op].call(n,u,v,e);if(!1===o.test)throw new M("Test operation failed","TEST_OPERATION_FAILED",0,n,e);return o}}else if(v&&-1!=v.indexOf("~")&&(v=f(v)),p>=d){var o=S[n.op].call(n,u,v,e);if(!1===o.test)throw new M("Test operation failed","TEST_OPERATION_FAILED",0,n,e);return o}u=u[v]}}function m(e,t,n){for(var r=new Array(t.length),i=0,o=t.length;i<o;i++)r[i]=d(e,t[i],n),e=r[i].newDocument;return r.newDocument=e,r}function v(e,t,n){console.warn("jsonpatch.apply is deprecated, please use `applyPatch` for applying patch sequences, or `applyOperation` to apply individual operations.");for(var r=new Array(t.length),i=0,o=t.length;i<o;i++)!function(i,o){if(""==t[i].path&&"remove"!=t[i].op&&"test"!=t[i].op){var a;if("_get"==t[i].op)return t[i].value=e,"continue";"replace"!=t[i].op&&"move"!=t[i].op||(r[i]=c(e)),"copy"!=t[i].op&&"move"!=t[i].op||(a=h(e,t[i].from)),"replace"!=t[i].op&&"add"!=t[i].op||(a=t[i].value),Object.keys(e).forEach(function(t){return delete e[t]}),Object.keys(a).forEach(function(t){return e[t]=a[t]})}else r[i]=d(e,t[i],n),r[i]=r[i].removed||r[i].test}(i);return r}function g(e,t){var n=d(e,t);if(!1===n.test)throw new M("Test operation failed","TEST_OPERATION_FAILED",0,t,e);return n.newDocument}function y(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function _(e){if(void 0===e)return!0;if(e)if(k(e)){for(var t=0,n=e.length;t<n;t++)if(_(e[t]))return!0}else if("object"==typeof e)for(var r=E(e),i=r.length,t=0;t<i;t++)if(_(e[r[t]]))return!0;return!1}function b(e,t,n,r){if("object"!=typeof e||null===e||k(e))throw new M("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(!S[e.op])throw new M("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n);if("string"!=typeof e.path)throw new M("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new M('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new M("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new M("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&_(e.value))throw new M("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n)if("add"==e.op){var i=e.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new M("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==r)throw new M("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if("move"===e.op||"copy"===e.op){var a={op:"_get",path:e.from,value:void 0},s=x([a],n);if(s&&"OPERATION_PATH_UNRESOLVABLE"===s.name)throw new M("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}function x(e,t,n){try{if(!k(e))throw new M("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)m(c(t),c(e),n||!0);else{n=n||b;for(var r=0;r<e.length;r++)n(e[r],r,t,void 0)}}catch(e){if(e instanceof M)return e;throw e}}function w(e,t){var n=[];return u(e,t,n,""),n}var k,E=function(e){if(k(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t},S={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=h(n,this.path);r&&(r=c(r));var i=d(n,{op:"remove",path:this.from}).removed;return d(n,{op:"add",path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=h(n,this.from);return d(n,{op:"add",path:this.path,value:c(r)}),{newDocument:n}},test:function(e,n,r){return{newDocument:r,test:t(e[n],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},C={add:function(e,t,n){return e.splice(t,0,this.value),{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:S.move,copy:S.copy,test:S.test,_get:S._get};k=Array.isArray?Array.isArray:function(e){return e.push&&"number"==typeof e.length};var A=[],D=function(){function e(e){this.observers=[],this.obj=e}return e}(),O=function(){function e(e,t){this.callback=e,this.observer=t}return e}();e.unobserve=o,e.observe=a,e.generate=s;var k;k=Array.isArray?Array.isArray:function(e){return e.push&&"number"==typeof e.length},e.deepClone=c,e.escapePathComponent=p,e.unescapePathComponent=f,e.getValueByPointer=h,e.applyOperation=d,e.applyPatch=m,e.apply=v,e.applyReducer=g;var M=function(e){function t(t,n,r,i,o){e.call(this,t),this.message=t,this.name=n,this.index=r,this.operation=i,this.tree=o}return y(t,e),t}(Error);e.JsonPatchError=M,e.validator=b,e.validate=x,e.compare=w}(n||(n={})),void 0!==t)t.apply=n.apply,t.applyPatch=n.applyPatch,t.applyOperation=n.applyOperation,t.applyReducer=n.applyReducer,t.getValueByPointer=n.getValueByPointer,t.deepClone=n.deepClone,t.escapePathComponent=n.escapePathComponent,t.unescapePathComponent=n.unescapePathComponent,t.observe=n.observe,t.unobserve=n.unobserve,t.generate=n.generate,t.compare=n.compare,t.validate=n.validate,t.validator=n.validator,t.JsonPatchError=n.JsonPatchError;else var t={},r=!0;Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,r&&(t=void 0)},function(e,t,n){"use strict";function r(e){return e.replace(i,function(e,t){return t.toUpperCase()})}var i=/-(.)/g;e.exports=r},function(e,t,n){"use strict";function r(e){return i(e.replace(o,"ms-"))}var i=n(746),o=/^-ms-/;e.exports=r},function(e,t,n){"use strict";function r(e,t){return!(!e||!t)&&(e===t||!i(e)&&(i(t)?r(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}var i=n(756);e.exports=r},function(e,t,n){"use strict";function r(e){var t=e.length;if((Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e)&&a(!1),"number"!=typeof t&&a(!1),0===t||t-1 in e||a(!1),"function"==typeof e.callee&&a(!1),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(e){}for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}function i(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}function o(e){return i(e)?Array.isArray(e)?e.slice():r(e):[e]}var a=n(8);e.exports=o},function(e,t,n){"use strict";function r(e){var t=e.match(c);return t&&t[1].toLowerCase()}function i(e,t){var n=l;l||u(!1);var i=r(e),o=i&&s(i);if(o){n.innerHTML=o[1]+e+o[2];for(var c=o[0];c--;)n=n.lastChild}else n.innerHTML=e;var p=n.getElementsByTagName("script");p.length&&(t||u(!1),a(p).forEach(t));for(var f=Array.from(n.childNodes);n.lastChild;)n.removeChild(n.lastChild);return f}var o=n(25),a=n(749),s=n(751),u=n(8),l=o.canUseDOM?document.createElement("div"):null,c=/^\s*<(\w+)/;e.exports=i},function(e,t,n){"use strict";function r(e){return a||o(!1),f.hasOwnProperty(e)||(e="*"),s.hasOwnProperty(e)||(a.innerHTML="*"===e?"<link />":"<"+e+"></"+e+">",s[e]=!a.firstChild),s[e]?f[e]:null}var i=n(25),o=n(8),a=i.canUseDOM?document.createElement("div"):null,s={},u=[1,'<select multiple="true">',"</select>"],l=[1,"<table>","</table>"],c=[3,"<table><tbody><tr>","</tr></tbody></table>"],p=[1,'<svg xmlns="http://www.w3.org/2000/svg">',"</svg>"],f={"*":[1,"?<div>","</div>"],area:[1,"<map>","</map>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],legend:[1,"<fieldset>","</fieldset>"],param:[1,"<object>","</object>"],tr:[2,"<table><tbody>","</tbody></table>"],optgroup:u,option:u,caption:l,colgroup:l,tbody:l,tfoot:l,thead:l,td:c,th:c};["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"].forEach(function(e){f[e]=p,s[e]=!0}),e.exports=r},function(e,t,n){"use strict";function r(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}e.exports=r},function(e,t,n){"use strict";function r(e){return e.replace(i,"-$1").toLowerCase()}var i=/([A-Z])/g;e.exports=r},function(e,t,n){"use strict";function r(e){return i(e).replace(o,"-ms-")}var i=n(753),o=/^ms-/;e.exports=r},function(e,t,n){"use strict";function r(e){var t=e?e.ownerDocument||e:document,n=t.defaultView||window;return!(!e||!("function"==typeof n.Node?e instanceof n.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}e.exports=r},function(e,t,n){"use strict";function r(e){return i(e)&&3==e.nodeType}var i=n(755);e.exports=r},function(e,t,n){"use strict";function r(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}e.exports=r},function(e,t,n){"use strict";var r={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0},o="function"==typeof Object.getOwnPropertySymbols;e.exports=function(e,t,n){if("string"!=typeof t){var a=Object.getOwnPropertyNames(t);o&&(a=a.concat(Object.getOwnPropertySymbols(t)));for(var s=0;s<a.length;++s)if(!(r[a[s]]||i[a[s]]||n&&n[a[s]]))try{e[a[s]]=t[a[s]]}catch(e){}}return e}},function(e,t,n){function r(e){this._cbs=e||{},this.events=[]}e.exports=r;var i=n(116).EVENTS;Object.keys(i).forEach(function(e){if(0===i[e])e="on"+e,r.prototype[e]=function(){this.events.push([e]),this._cbs[e]&&this._cbs[e]()};else if(1===i[e])e="on"+e,r.prototype[e]=function(t){this.events.push([e,t]),this._cbs[e]&&this._cbs[e](t)};else{if(2!==i[e])throw Error("wrong number of arguments");e="on"+e,r.prototype[e]=function(t,n){this.events.push([e,t,n]),this._cbs[e]&&this._cbs[e](t,n)}}}),r.prototype.onreset=function(){this.events=[],this._cbs.onreset&&this._cbs.onreset()},r.prototype.restart=function(){this._cbs.onreset&&this._cbs.onreset();for(var e=0,t=this.events.length;e<t;e++)if(this._cbs[this.events[e][0]]){var n=this.events[e].length;1===n?this._cbs[this.events[e][0]]():2===n?this._cbs[this.events[e][0]](this.events[e][1]):this._cbs[this.events[e][0]](this.events[e][1],this.events[e][2])}}},function(e,t,n){function r(e,t){this.init(e,t)}function i(e,t){return c.getElementsByTagName(e,t,!0)}function o(e,t){return c.getElementsByTagName(e,t,!0,1)[0]}function a(e,t,n){return c.getText(c.getElementsByTagName(e,t,n,1)).trim()}function s(e,t,n,r,i){var o=a(n,r,i);o&&(e[t]=o)}var u=n(116),l=u.DomHandler,c=u.DomUtils;n(42)(r,l),r.prototype.init=l;var p=function(e){return"rss"===e||"feed"===e||"rdf:RDF"===e};r.prototype.onend=function(){var e,t,n={},r=o(p,this.dom);r&&("feed"===r.name?(t=r.children,n.type="atom",s(n,"id","id",t),s(n,"title","title",t),(e=o("link",t))&&(e=e.attribs)&&(e=e.href)&&(n.link=e),s(n,"description","subtitle",t),(e=a("updated",t))&&(n.updated=new Date(e)),s(n,"author","email",t,!0),n.items=i("entry",t).map(function(e){var t,n={};return e=e.children,s(n,"id","id",e),s(n,"title","title",e),(t=o("link",e))&&(t=t.attribs)&&(t=t.href)&&(n.link=t),(t=a("summary",e)||a("content",e))&&(n.description=t),(t=a("updated",e))&&(n.pubDate=new Date(t)),n})):(t=o("channel",r.children).children,n.type=r.name.substr(0,3),n.id="",s(n,"title","title",t),s(n,"link","link",t),s(n,"description","description",t),(e=a("lastBuildDate",t))&&(n.updated=new Date(e)),s(n,"author","managingEditor",t,!0),n.items=i("item",r.children).map(function(e){var t,n={};return e=e.children,s(n,"id","guid",e),s(n,"title","title",e),s(n,"link","link",e),s(n,"description","description",e),(t=a("pubDate",e))&&(n.pubDate=new Date(t)),n}))),this.dom=n,l.prototype._handleCallback.call(this,r?null:Error("couldn't find root of feed"))},e.exports=r},function(e,t,n){function r(e){this._cbs=e||{}}e.exports=r;var i=n(116).EVENTS;Object.keys(i).forEach(function(e){if(0===i[e])e="on"+e,r.prototype[e]=function(){this._cbs[e]&&this._cbs[e]()};else if(1===i[e])e="on"+e,r.prototype[e]=function(t){this._cbs[e]&&this._cbs[e](t)};else{if(2!==i[e])throw Error("wrong number of arguments");e="on"+e,r.prototype[e]=function(t,n){this._cbs[e]&&this._cbs[e](t,n)}}})},function(e,t,n){function r(e){o.call(this,new i(this),e)}function i(e){this.scope=e}e.exports=r;var o=n(382);n(42)(r,o),r.prototype.readable=!0;var a=n(116).EVENTS;Object.keys(a).forEach(function(e){if(0===a[e])i.prototype["on"+e]=function(){this.scope.emit(e)};else if(1===a[e])i.prototype["on"+e]=function(t){this.scope.emit(e,t)};else{if(2!==a[e])throw Error("wrong number of arguments!");i.prototype["on"+e]=function(t,n){this.scope.emit(e,t,n)}}})},function(e,t,n){"use strict";function r(e){return e in a?a[e]:a[e]=e.replace(i,"-$&").toLowerCase().replace(o,"-ms-")}var i=/[A-Z]/g,o=/^ms-/,a={};e.exports=r},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,l=u>>1,c=-7,p=n?i-1:0,f=n?-1:1,h=e[t+p];for(p+=f,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+e[t+p],p+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+p],p+=f,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=l}return(h?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,p=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,d=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),t+=a+p>=1?f/u:f*Math.pow(2,1-p),t*u>=2&&(a++,u/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(t*u-1)*Math.pow(2,i),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&s,h+=d,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[n+h]=255&a,h+=d,a/=256,l-=8);e[n+h-d]|=128*m}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){var t=e.prefixMap,n=e.plugins,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e};return function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r="undefined"!=typeof navigator?navigator.userAgent:void 0;if(this._userAgent=n.userAgent||r,this._keepUnprefixed=n.keepUnprefixed||!1,this._userAgent&&(this._browserInfo=(0,u.default)(this._userAgent)),!this._browserInfo||!this._browserInfo.cssPrefix)return this._useFallback=!0,!1;this.prefixedKeyframes=(0,c.default)(this._browserInfo.browserName,this._browserInfo.browserVersion,this._browserInfo.cssPrefix);var o=this._browserInfo.browserName&&t[this._browserInfo.browserName];if(o){this._requiresPrefix={};for(var a in o)o[a]>=this._browserInfo.browserVersion&&(this._requiresPrefix[a]=!0);this._hasPropsRequiringPrefix=Object.keys(this._requiresPrefix).length>0}else this._useFallback=!0;this._metaData={browserVersion:this._browserInfo.browserVersion,browserName:this._browserInfo.browserName,cssPrefix:this._browserInfo.cssPrefix,jsPrefix:this._browserInfo.jsPrefix,keepUnprefixed:this._keepUnprefixed,requiresPrefix:this._requiresPrefix}}return a(e,[{key:"prefix",value:function(e){return this._useFallback?r(e):this._hasPropsRequiringPrefix?this._prefixStyle(e):e}},{key:"_prefixStyle",value:function(e){for(var t in e){var r=e[t];if((0,v.default)(r))e[t]=this.prefix(r);else if(Array.isArray(r)){for(var i=[],o=0,a=r.length;o<a;++o){var s=(0,y.default)(n,t,r[o],e,this._metaData);(0,d.default)(i,s||r[o])}i.length>0&&(e[t]=i)}else{var u=(0,y.default)(n,t,r,e,this._metaData);u&&(e[t]=u),this._requiresPrefix.hasOwnProperty(t)&&(e[this._browserInfo.jsPrefix+(0,f.default)(t)]=r,this._keepUnprefixed||delete e[t])}}return e}}],[{key:"prefixAll",value:function(e){return r(e)}}]),e}()}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.default=o;var s=n(790),u=r(s),l=n(791),c=r(l),p=n(210),f=r(p),h=n(383),d=r(h),m=n(384),v=r(m),g=n(385),y=r(g);e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={plugins:[],prefixMap:{chrome:{appearance:64,userSelect:53,textEmphasisPosition:64,textEmphasis:64,textEmphasisStyle:64,textEmphasisColor:64,boxDecorationBreak:64,clipPath:54,maskImage:64,maskMode:64,maskRepeat:64,maskPosition:64,maskClip:64,maskOrigin:64,maskSize:64,maskComposite:64,mask:64,maskBorderSource:64,maskBorderMode:64,maskBorderSlice:64,maskBorderWidth:64,maskBorderOutset:64,maskBorderRepeat:64,maskBorder:64,maskType:64,textDecorationStyle:56,textDecorationSkip:56,textDecorationLine:56,textDecorationColor:56,filter:52,fontFeatureSettings:47,breakAfter:49,breakBefore:49,breakInside:49,columnCount:49,columnFill:49,columnGap:49,columnRule:49,columnRuleColor:49,columnRuleStyle:49,columnRuleWidth:49,columns:49,columnSpan:49,columnWidth:49,writingMode:47},safari:{flex:8,flexBasis:8,flexDirection:8,flexGrow:8,flexFlow:8,flexShrink:8,flexWrap:8,alignContent:8,alignItems:8,alignSelf:8,justifyContent:8,order:8,transform:8,transformOrigin:8,transformOriginX:8,transformOriginY:8,backfaceVisibility:8,perspective:8,perspectiveOrigin:8,transformStyle:8,transformOriginZ:8,animation:8,animationDelay:8,animationDirection:8,animationFillMode:8,animationDuration:8,animationIterationCount:8,animationName:8,animationPlayState:8,animationTimingFunction:8,appearance:11,userSelect:11,backdropFilter:11,fontKerning:9,scrollSnapType:10.1,scrollSnapPointsX:10.1,scrollSnapPointsY:10.1,scrollSnapDestination:10.1,scrollSnapCoordinate:10.1,boxDecorationBreak:11,clipPath:11,maskImage:11,maskMode:11,maskRepeat:11,maskPosition:11,maskClip:11,maskOrigin:11,maskSize:11,maskComposite:11,mask:11,maskBorderSource:11,maskBorderMode:11,maskBorderSlice:11,maskBorderWidth:11,maskBorderOutset:11,maskBorderRepeat:11,maskBorder:11,maskType:11,textDecorationStyle:11,textDecorationSkip:11,textDecorationLine:11,textDecorationColor:11,shapeImageThreshold:10,shapeImageMargin:10,shapeImageOutside:10,filter:9,hyphens:11,flowInto:11,flowFrom:11,breakBefore:8,breakAfter:8,breakInside:8,regionFragment:11,columnCount:8,columnFill:8,columnGap:8,columnRule:8,columnRuleColor:8,columnRuleStyle:8,columnRuleWidth:8,columns:8,columnSpan:8,columnWidth:8,writingMode:11},firefox:{appearance:58,userSelect:58,textAlignLast:48,tabSize:58,hyphens:42,breakAfter:51,breakBefore:51,breakInside:51,columnCount:51,columnFill:51,columnGap:51,columnRule:51,columnRuleColor:51,columnRuleStyle:51,columnRuleWidth:51,columns:51,columnSpan:51,columnWidth:51},opera:{flex:16,flexBasis:16,flexDirection:16,flexGrow:16,flexFlow:16,flexShrink:16,flexWrap:16,alignContent:16,alignItems:16,alignSelf:16,justifyContent:16,order:16,transform:22,transformOrigin:22,transformOriginX:22,transformOriginY:22,backfaceVisibility:22,perspective:22,perspectiveOrigin:22,transformStyle:22,transformOriginZ:22,animation:29,animationDelay:29,animationDirection:29,animationFillMode:29,animationDuration:29,animationIterationCount:29,animationName:29,animationPlayState:29,animationTimingFunction:29,appearance:49,userSelect:40,fontKerning:19,textEmphasisPosition:49,textEmphasis:49,textEmphasisStyle:49,textEmphasisColor:49,boxDecorationBreak:49,clipPath:41,maskImage:49,maskMode:49,maskRepeat:49,maskPosition:49,maskClip:49,maskOrigin:49,maskSize:49,maskComposite:49,mask:49,maskBorderSource:49,maskBorderMode:49,maskBorderSlice:49,maskBorderWidth:49,maskBorderOutset:49,maskBorderRepeat:49,maskBorder:49,maskType:49,textDecorationStyle:43,textDecorationSkip:43,textDecorationLine:43,textDecorationColor:43,filter:39,fontFeatureSettings:34,breakAfter:36,breakBefore:36,breakInside:36,columnCount:36,columnFill:36,columnGap:36,columnRule:36,columnRuleColor:36,columnRuleStyle:36,columnRuleWidth:36,columns:36,columnSpan:36,columnWidth:36,writingMode:34},ie:{userSelect:11,wrapFlow:11,wrapThrough:11,wrapMargin:11,scrollSnapType:11,scrollSnapPointsX:11,scrollSnapPointsY:11,scrollSnapDestination:11,scrollSnapCoordinate:11,hyphens:11,flowInto:11,flowFrom:11,breakBefore:11,breakAfter:11,breakInside:11,regionFragment:11,gridTemplateColumns:11,gridTemplateRows:11,gridTemplateAreas:11,gridTemplate:11,gridAutoColumns:11,gridAutoRows:11,gridAutoFlow:11,grid:11,gridRowStart:11,gridColumnStart:11,gridRowEnd:11,gridRow:11,gridColumn:11,gridColumnEnd:11,gridColumnGap:11,gridRowGap:11,gridArea:11,gridGap:11,textSizeAdjust:11,writingMode:11},edge:{userSelect:16,wrapFlow:16,wrapThrough:16,wrapMargin:16,scrollSnapType:16,scrollSnapPointsX:16,scrollSnapPointsY:16,scrollSnapDestination:16,scrollSnapCoordinate:16,hyphens:16,flowInto:16,flowFrom:16,breakBefore:16,breakAfter:16,breakInside:16,regionFragment:16,gridTemplateColumns:15,gridTemplateRows:15,gridTemplateAreas:15,gridTemplate:15,gridAutoColumns:15,gridAutoRows:15,gridAutoFlow:15,grid:15,gridRowStart:15,gridColumnStart:15,gridRowEnd:15,gridRow:15,gridColumn:15,gridColumnEnd:15,gridColumnGap:15,gridRowGap:15,gridArea:15,gridGap:15},ios_saf:{flex:8.1,flexBasis:8.1,flexDirection:8.1,flexGrow:8.1,flexFlow:8.1,flexShrink:8.1,flexWrap:8.1,alignContent:8.1,alignItems:8.1,alignSelf:8.1,justifyContent:8.1,order:8.1,transform:8.1,transformOrigin:8.1,transformOriginX:8.1,transformOriginY:8.1,backfaceVisibility:8.1,perspective:8.1,perspectiveOrigin:8.1,transformStyle:8.1,transformOriginZ:8.1,animation:8.1,animationDelay:8.1,animationDirection:8.1,animationFillMode:8.1,animationDuration:8.1,animationIterationCount:8.1,animationName:8.1,animationPlayState:8.1,animationTimingFunction:8.1,appearance:11,userSelect:11,backdropFilter:11,fontKerning:11,scrollSnapType:11,scrollSnapPointsX:11,scrollSnapPointsY:11,scrollSnapDestination:11,scrollSnapCoordinate:11,boxDecorationBreak:11,clipPath:11,maskImage:11,maskMode:11,maskRepeat:11,maskPosition:11,maskClip:11,maskOrigin:11,maskSize:11,maskComposite:11,mask:11,maskBorderSource:11,maskBorderMode:11,maskBorderSlice:11,maskBorderWidth:11,maskBorderOutset:11,maskBorderRepeat:11,maskBorder:11,maskType:11,textSizeAdjust:11,textDecorationStyle:11,textDecorationSkip:11,textDecorationLine:11,textDecorationColor:11,shapeImageThreshold:10,shapeImageMargin:10,shapeImageOutside:10,filter:9,hyphens:11,flowInto:11,flowFrom:11,breakBefore:8.1,breakAfter:8.1,breakInside:8.1,regionFragment:11,columnCount:8.1,columnFill:8.1,columnGap:8.1,columnRule:8.1,columnRuleColor:8.1,columnRuleStyle:8.1,columnRuleWidth:8.1,columns:8.1,columnSpan:8.1,columnWidth:8.1,writingMode:11},android:{borderImage:4.2,borderImageOutset:4.2,borderImageRepeat:4.2,borderImageSlice:4.2,borderImageSource:4.2,borderImageWidth:4.2,flex:4.2,flexBasis:4.2,flexDirection:4.2,flexGrow:4.2,flexFlow:4.2,flexShrink:4.2,flexWrap:4.2,alignContent:4.2,alignItems:4.2,alignSelf:4.2,justifyContent:4.2,order:4.2,transition:4.2,transitionDelay:4.2,transitionDuration:4.2,transitionProperty:4.2,transitionTimingFunction:4.2,transform:4.4,transformOrigin:4.4,transformOriginX:4.4,transformOriginY:4.4,backfaceVisibility:4.4,perspective:4.4,perspectiveOrigin:4.4,transformStyle:4.4,transformOriginZ:4.4,animation:4.4,animationDelay:4.4,animationDirection:4.4,animationFillMode:4.4,animationDuration:4.4,animationIterationCount:4.4,animationName:4.4,animationPlayState:4.4,animationTimingFunction:4.4,appearance:56,userSelect:4.4,fontKerning:4.4,textEmphasisPosition:56,textEmphasis:56,textEmphasisStyle:56,textEmphasisColor:56,boxDecorationBreak:56,clipPath:4.4,maskImage:56,maskMode:56,maskRepeat:56,maskPosition:56,maskClip:56,maskOrigin:56,maskSize:56,maskComposite:56,mask:56,maskBorderSource:56,maskBorderMode:56,maskBorderSlice:56,maskBorderWidth:56,maskBorderOutset:56,maskBorderRepeat:56,maskBorder:56,maskType:56,filter:4.4,fontFeatureSettings:4.4,breakAfter:4.4,breakBefore:4.4,breakInside:4.4,columnCount:4.4,columnFill:4.4,columnGap:4.4,columnRule:4.4,columnRuleColor:4.4,columnRuleStyle:4.4,columnRuleWidth:4.4,columns:4.4,columnSpan:4.4,columnWidth:4.4,writingMode:4.4},and_chr:{appearance:61,textEmphasisPosition:61,textEmphasis:61,textEmphasisStyle:61,textEmphasisColor:61,boxDecorationBreak:61,maskImage:61,maskMode:61,maskRepeat:61,maskPosition:61,maskClip:61,maskOrigin:61,maskSize:61,maskComposite:61,mask:61,maskBorderSource:61,maskBorderMode:61,maskBorderSlice:61,maskBorderWidth:61,maskBorderOutset:61,maskBorderRepeat:61,maskBorder:61,maskType:61},and_uc:{flex:11.4,flexBasis:11.4,flexDirection:11.4,flexGrow:11.4,flexFlow:11.4,flexShrink:11.4,flexWrap:11.4,alignContent:11.4,alignItems:11.4,alignSelf:11.4,justifyContent:11.4,order:11.4,transform:11.4,transformOrigin:11.4,transformOriginX:11.4,transformOriginY:11.4,backfaceVisibility:11.4,perspective:11.4,perspectiveOrigin:11.4,transformStyle:11.4,transformOriginZ:11.4,animation:11.4,animationDelay:11.4,animationDirection:11.4,animationFillMode:11.4,animationDuration:11.4,animationIterationCount:11.4,animationName:11.4,animationPlayState:11.4,animationTimingFunction:11.4,appearance:11.4,userSelect:11.4,textEmphasisPosition:11.4,textEmphasis:11.4,textEmphasisStyle:11.4,textEmphasisColor:11.4,clipPath:11.4,maskImage:11.4,maskMode:11.4,maskRepeat:11.4,maskPosition:11.4,maskClip:11.4,maskOrigin:11.4,maskSize:11.4,maskComposite:11.4,mask:11.4,maskBorderSource:11.4,maskBorderMode:11.4,maskBorderSlice:11.4,maskBorderWidth:11.4,maskBorderOutset:11.4,maskBorderRepeat:11.4,maskBorder:11.4,maskType:11.4,textSizeAdjust:11.4,filter:11.4,hyphens:11.4,fontFeatureSettings:11.4,breakAfter:11.4,breakBefore:11.4,breakInside:11.4,columnCount:11.4,columnFill:11.4,columnGap:11.4,columnRule:11.4,columnRuleColor:11.4,columnRuleStyle:11.4,columnRuleWidth:11.4,columns:11.4,columnSpan:11.4,columnWidth:11.4,writingMode:11.4},op_mini:{}}},e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.browserName,a=r.browserVersion,s=r.cssPrefix,u=r.keepUnprefixed;if("string"==typeof t&&t.indexOf("cross-fade(")>-1&&("chrome"===i||"opera"===i||"and_chr"===i||("ios_saf"===i||"safari"===i)&&a<10))return(0,o.default)(t.replace(/cross-fade\(/g,s+"cross-fade("),t,u)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(50),o=function(e){return e&&e.__esModule?e:{default:e}}(i);e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.browserName,u=r.browserVersion,l=r.cssPrefix,c=r.keepUnprefixed;return"cursor"!==e||!a[t]||"firefox"!==i&&"chrome"!==i&&"safari"!==i&&"opera"!==i?"cursor"===e&&s[t]&&("firefox"===i&&u<24||"chrome"===i&&u<37||"safari"===i&&u<9||"opera"===i&&u<24)?(0,o.default)(l+t,t,c):void 0:(0,o.default)(l+t,t,c)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(50),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a={grab:!0,grabbing:!0},s={"zoom-in":!0,"zoom-out":!0};e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.browserName,a=r.browserVersion,s=r.cssPrefix,u=r.keepUnprefixed;if("string"==typeof t&&t.indexOf("filter(")>-1&&("ios_saf"===i||"safari"===i&&a<9.1))return(0,o.default)(t.replace(/filter\(/g,s+"filter("),t,u)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(50),o=function(e){return e&&e.__esModule?e:{default:e}}(i);e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.browserName,s=r.browserVersion,u=r.cssPrefix,l=r.keepUnprefixed;if("display"===e&&a[t]&&("chrome"===i&&s<29&&s>20||("safari"===i||"ios_saf"===i)&&s<9&&s>6||"opera"===i&&(15===s||16===s)))return(0,o.default)(u+t,t,l)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(50),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a={flex:!0,"inline-flex":!0};e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.browserName,u=r.browserVersion,c=r.cssPrefix,p=r.keepUnprefixed,f=r.requiresPrefix;if((l.indexOf(e)>-1||"display"===e&&"string"==typeof t&&t.indexOf("flex")>-1)&&("firefox"===i&&u<22||"chrome"===i&&u<21||("safari"===i||"ios_saf"===i)&&u<=6.1||"android"===i&&u<4.4||"and_uc"===i)){if(delete f[e],p||Array.isArray(n[e])||delete n[e],"flexDirection"===e&&"string"==typeof t&&(t.indexOf("column")>-1?n.WebkitBoxOrient="vertical":n.WebkitBoxOrient="horizontal",t.indexOf("reverse")>-1?n.WebkitBoxDirection="reverse":n.WebkitBoxDirection="normal"),"display"===e&&a.hasOwnProperty(t))return(0,o.default)(c+a[t],t,p);s.hasOwnProperty(e)&&(n[s[e]]=a[t]||t)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(50),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a={"space-around":"justify","space-between":"justify","flex-start":"start","flex-end":"end","wrap-reverse":"multiple",wrap:"multiple",flex:"box","inline-flex":"inline-box"},s={alignItems:"WebkitBoxAlign",justifyContent:"WebkitBoxPack",flexWrap:"WebkitBoxLines"},u=["alignContent","alignSelf","order","flexGrow","flexShrink","flexBasis","flexDirection"],l=Object.keys(s).concat(u);e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.browserName,s=r.browserVersion,u=r.cssPrefix,l=r.keepUnprefixed;if("string"==typeof t&&a.test(t)&&("firefox"===i&&s<16||"chrome"===i&&s<26||("safari"===i||"ios_saf"===i)&&s<7||("opera"===i||"op_mini"===i)&&s<12.1||"android"===i&&s<4.4||"and_uc"===i))return(0,o.default)(u+t,t,l)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(50),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=/linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/;e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.browserName,a=r.cssPrefix,s=r.keepUnprefixed;if("string"==typeof t&&t.indexOf("image-set(")>-1&&("chrome"===i||"opera"===i||"and_chr"===i||"and_uc"===i||"ios_saf"===i||"safari"===i))return(0,o.default)(t.replace(/image-set\(/g,a+"image-set("),t,s)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(50),o=function(e){return e&&e.__esModule?e:{default:e}}(i);e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.browserName,a=r.cssPrefix,s=r.keepUnprefixed;if("position"===e&&"sticky"===t&&("safari"===i||"ios_saf"===i))return(0,o.default)(a+t,t,s)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(50),o=function(e){return e&&e.__esModule?e:{default:e}}(i);e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.cssPrefix,u=r.keepUnprefixed;if(a.hasOwnProperty(e)&&s.hasOwnProperty(t))return(0,o.default)(i+t,t,u)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(50),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},s={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.cssPrefix,u=r.keepUnprefixed,l=r.requiresPrefix;if("string"==typeof t&&a.hasOwnProperty(e)){s||(s=Object.keys(l).map(function(e){return(0,o.default)(e)}));var c=t.split(/,(?![^()]*(?:\([^()]*\))?\))/g);return s.forEach(function(e){c.forEach(function(t,n){t.indexOf(e)>-1&&"order"!==e&&(c[n]=t.replace(e,i+e)+(u?","+t:""))})}),c.join(",")}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(367),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},s=void 0;e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){function t(e){for(var i in e){var o=e[i];if((0,f.default)(o))e[i]=t(o);else if(Array.isArray(o)){for(var s=[],l=0,p=o.length;l<p;++l){var h=(0,u.default)(r,i,o[l],e,n);(0,c.default)(s,h||o[l])}s.length>0&&(e[i]=s)}else{var d=(0,u.default)(r,i,o,e,n);d&&(e[i]=d),(0,a.default)(n,i,e)}}return e}var n=e.prefixMap,r=e.plugins;return t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var o=n(792),a=r(o),s=n(385),u=r(s),l=n(383),c=r(l),p=n(384),f=r(p);e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(777),o=r(i),a=n(789),s=r(a),u=n(780),l=r(u),c=n(779),p=r(c),f=n(781),h=r(f),d=n(782),m=r(d),v=n(783),g=r(v),y=n(784),_=r(y),b=n(785),x=r(b),w=n(786),k=r(w),E=n(787),S=r(E),C=n(788),A=r(C),D=[p.default,l.default,h.default,g.default,_.default,x.default,k.default,S.default,A.default,m.default];t.default=(0,o.default)({prefixMap:s.default.prefixMap,plugins:D}),e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if("string"==typeof t&&!(0,o.default)(t)&&t.indexOf("cross-fade(")>-1)return a.map(function(e){return t.replace(/cross-fade\(/g,e+"cross-fade(")})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(112),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=["-webkit-",""];e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if("cursor"===e&&o.hasOwnProperty(t))return i.map(function(e){return e+t})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=["-webkit-","-moz-",""],o={"zoom-in":!0,"zoom-out":!0,grab:!0,grabbing:!0};e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if("string"==typeof t&&!(0,o.default)(t)&&t.indexOf("filter(")>-1)return a.map(function(e){return t.replace(/filter\(/g,e+"filter(")})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(112),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=["-webkit-",""];e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if("display"===e&&i.hasOwnProperty(t))return i[t]}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i={flex:["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex","flex"],"inline-flex":["-webkit-inline-box","-moz-inline-box","-ms-inline-flexbox","-webkit-inline-flex","inline-flex"]};e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n){"flexDirection"===e&&"string"==typeof t&&(t.indexOf("column")>-1?n.WebkitBoxOrient="vertical":n.WebkitBoxOrient="horizontal",t.indexOf("reverse")>-1?n.WebkitBoxDirection="reverse":n.WebkitBoxDirection="normal"),o.hasOwnProperty(e)&&(n[o[e]]=i[t]||t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i={"space-around":"justify","space-between":"justify","flex-start":"start","flex-end":"end","wrap-reverse":"multiple",wrap:"multiple"},o={alignItems:"WebkitBoxAlign",justifyContent:"WebkitBoxPack",flexWrap:"WebkitBoxLines"};e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if("string"==typeof t&&!(0,o.default)(t)&&s.test(t))return a.map(function(e){return e+t})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(112),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=["-webkit-","-moz-",""],s=/linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/;e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if("string"==typeof t&&!(0,o.default)(t)&&t.indexOf("image-set(")>-1)return a.map(function(e){return t.replace(/image-set\(/g,e+"image-set(")})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(112),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=["-webkit-",""];e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if("position"===e&&"sticky"===t)return["-webkit-sticky","sticky"]}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(o.hasOwnProperty(e)&&a.hasOwnProperty(t))return i.map(function(e){return e+t})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=["-webkit-","-moz-",""],o={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},a={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if((0,l.default)(e))return e;for(var n=e.split(/,(?![^()]*(?:\([^()]*\))?\))/g),r=0,i=n.length;r<i;++r){var o=n[r],a=[o];for(var u in t){var c=(0,s.default)(u);if(o.indexOf(c)>-1&&"order"!==c)for(var p=t[u],f=0,d=p.length;f<d;++f)a.unshift(o.replace(c,h[p[f]]+c))}n[r]=a.join(",")}return n.join(",")}function o(e,t,n,r){if("string"==typeof t&&f.hasOwnProperty(e)){var o=i(t,r),a=o.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(e){return!/-moz-|-ms-/.test(e)}).join(",");if(e.indexOf("Webkit")>-1)return a;var s=o.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(e){return!/-webkit-|-ms-/.test(e)}).join(",");return e.indexOf("Moz")>-1?s:(n["Webkit"+(0,p.default)(e)]=a,n["Moz"+(0,p.default)(e)]=s,o)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var a=n(367),s=r(a),u=n(112),l=r(u),c=n(210),p=r(c),f={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},h={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"};e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=["Webkit"],i=["Moz"],o=["ms"],a=["Webkit","Moz"],s=["Webkit","ms"],u=["Webkit","Moz","ms"];t.default={plugins:[],prefixMap:{appearance:a,userSelect:u,textEmphasisPosition:r,textEmphasis:r,textEmphasisStyle:r,textEmphasisColor:r,boxDecorationBreak:r,clipPath:r,maskImage:r,maskMode:r,maskRepeat:r,maskPosition:r,maskClip:r,maskOrigin:r,maskSize:r,maskComposite:r,mask:r,maskBorderSource:r,maskBorderMode:r,maskBorderSlice:r,maskBorderWidth:r,maskBorderOutset:r,maskBorderRepeat:r,maskBorder:r,maskType:r,textDecorationStyle:r,textDecorationSkip:r,textDecorationLine:r,textDecorationColor:r,filter:r,fontFeatureSettings:r,breakAfter:u,breakBefore:u,breakInside:u,columnCount:a,columnFill:a,columnGap:a,columnRule:a,columnRuleColor:a,columnRuleStyle:a,columnRuleWidth:a,columns:a,columnSpan:a,columnWidth:a,writingMode:s,flex:r,flexBasis:r,flexDirection:r,flexGrow:r,flexFlow:r,flexShrink:r,flexWrap:r,alignContent:r,alignItems:r,alignSelf:r,justifyContent:r,order:r,transform:r,transformOrigin:r,transformOriginX:r,transformOriginY:r,backfaceVisibility:r,perspective:r,perspectiveOrigin:r,transformStyle:r,transformOriginZ:r,animation:r,animationDelay:r,animationDirection:r,animationFillMode:r,animationDuration:r,animationIterationCount:r,animationName:r,animationPlayState:r,animationTimingFunction:r,backdropFilter:r,fontKerning:r,scrollSnapType:s,scrollSnapPointsX:s,scrollSnapPointsY:s,scrollSnapDestination:s,scrollSnapCoordinate:s,shapeImageThreshold:r,shapeImageMargin:r,shapeImageOutside:r,hyphens:u,flowInto:s,flowFrom:s,regionFragment:s,textAlignLast:i,tabSize:i,wrapFlow:o,wrapThrough:o,wrapMargin:o,gridTemplateColumns:o,gridTemplateRows:o,gridTemplateAreas:o,gridTemplate:o,gridAutoColumns:o,gridAutoRows:o,gridAutoFlow:o,grid:o,gridRowStart:o,gridColumnStart:o,gridRowEnd:o,gridRow:o,gridColumn:o,gridColumnEnd:o,gridColumnGap:o,gridRowGap:o,gridArea:o,gridGap:o,textSizeAdjust:s,borderImage:r,borderImageOutset:r,borderImageRepeat:r,borderImageSlice:r,borderImageSource:r,borderImageWidth:r,transitionDelay:r,transitionDuration:r,transitionProperty:r,transitionTimingFunction:r}},e.exports=t.default},function(e,t,n){"use strict";function r(e){if(e.firefox)return"firefox";if(e.mobile||e.tablet){if(e.ios)return"ios_saf";if(e.android)return"android";if(e.opera)return"op_mini"}for(var t in u)if(e.hasOwnProperty(t))return u[t]}function i(e){var t=a.default._detect(e);t.yandexbrowser&&(t=a.default._detect(e.replace(/YaBrowser\/[0-9.]*/,"")));for(var n in s)if(t.hasOwnProperty(n)){var i=s[n];t.jsPrefix=i,t.cssPrefix="-"+i.toLowerCase()+"-";break}return t.browserName=r(t),t.version?t.browserVersion=parseFloat(t.version):t.browserVersion=parseInt(parseFloat(t.osversion),10),t.osVersion=parseFloat(t.osversion),"ios_saf"===t.browserName&&t.browserVersion>t.osVersion&&(t.browserVersion=t.osVersion),"android"===t.browserName&&t.chrome&&t.browserVersion>37&&(t.browserName="and_chr"),"android"===t.browserName&&t.osVersion<5&&(t.browserVersion=t.osVersion),"android"===t.browserName&&t.samsungBrowser&&(t.browserName="and_chr",t.browserVersion=44),t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var o=n(571),a=function(e){return e&&e.__esModule?e:{default:e}}(o),s={chrome:"Webkit",safari:"Webkit",ios:"Webkit",android:"Webkit",phantom:"Webkit",opera:"Webkit",webos:"Webkit",blackberry:"Webkit",bada:"Webkit",tizen:"Webkit",chromium:"Webkit",vivaldi:"Webkit",firefox:"Moz",seamoney:"Moz",sailfish:"Moz",msie:"ms",msedge:"ms"},u={chrome:"chrome",chromium:"chrome",safari:"safari",firfox:"firefox",msedge:"edge",opera:"opera",vivaldi:"opera",msie:"ie"};e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n){return"chrome"===e&&t<43||("safari"===e||"ios_saf"===e)&&t<9||"opera"===e&&t<30||"android"===e&&t<=4.4||"and_uc"===e?n+"keyframes":"keyframes"}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n){if(e.hasOwnProperty(t))for(var r=e[t],i=0,a=r.length;i<a;++i)n[r[i]+(0,o.default)(t)]=n[t]}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(210),o=function(e){return e&&e.__esModule?e:{default:e}}(i);e.exports=t.default},function(e,t,n){"use strict";var r=function(e,t,n,r,i,o,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,o,a,s],c=0;u=new Error(t.replace(/%s/g,function(){return l[c++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};e.exports=r},function(e,t){e.exports=FormData},function(e,t,n){"use strict";function r(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}var i=n(797),o=n(796);e.exports.Type=n(16),e.exports.Schema=n(81),e.exports.FAILSAFE_SCHEMA=n(212),e.exports.JSON_SCHEMA=n(389),e.exports.CORE_SCHEMA=n(388),e.exports.DEFAULT_SAFE_SCHEMA=n(118),e.exports.DEFAULT_FULL_SCHEMA=n(145),e.exports.load=i.load,e.exports.loadAll=i.loadAll,e.exports.safeLoad=i.safeLoad,e.exports.safeLoadAll=i.safeLoadAll,e.exports.dump=o.dump,e.exports.safeDump=o.safeDump,e.exports.YAMLException=n(117),e.exports.MINIMAL_SCHEMA=n(212),e.exports.SAFE_SCHEMA=n(118),e.exports.DEFAULT_SCHEMA=n(145),e.exports.scan=r("scan"),e.exports.parse=r("parse"),e.exports.compose=r("compose"),e.exports.addConstructor=r("addConstructor")},function(e,t,n){"use strict";function r(e,t){var n,r,i,o,a,s,u;if(null===t)return{};for(n={},r=Object.keys(t),i=0,o=r.length;i<o;i+=1)a=r[i],s=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),u=e.compiledTypeMap.fallback[a],u&&j.call(u.styleAliases,s)&&(s=u.styleAliases[s]),n[a]=s;return n}function i(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else{if(!(e<=4294967295))throw new T("code point within a string may not be greater than 0xFFFFFFFF");n="U",r=8}return"\\"+n+M.repeat("0",r-t.length)+t}function o(e){this.schema=e.schema||P,this.indent=Math.max(1,e.indent||2),this.skipInvalid=e.skipInvalid||!1,this.flowLevel=M.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=r(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function a(e,t){for(var n,r=M.repeat(" ",t),i=0,o=-1,a="",s=e.length;i<s;)o=e.indexOf("\n",i),-1===o?(n=e.slice(i),i=s):(n=e.slice(i,o+1),i=o+1),n.length&&"\n"!==n&&(a+=r),a+=n;return a}function s(e,t){return"\n"+M.repeat(" ",e.indent*t)}function u(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function l(e){return e===B||e===F}function c(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&65279!==e||65536<=e&&e<=1114111}function p(e){return c(e)&&65279!==e&&e!==G&&e!==Z&&e!==Q&&e!==te&&e!==re&&e!==K&&e!==z}function f(e){return c(e)&&65279!==e&&!l(e)&&e!==J&&e!==Y&&e!==K&&e!==G&&e!==Z&&e!==Q&&e!==te&&e!==re&&e!==z&&e!==W&&e!==H&&e!==L&&e!==ne&&e!==X&&e!==V&&e!==q&&e!==U&&e!==$&&e!==ee}function h(e,t,n,r,i){var o,a,s=!1,u=!1,h=-1!==r,d=-1,m=f(e.charCodeAt(0))&&!l(e.charCodeAt(e.length-1));if(t)for(o=0;o<e.length;o++){if(a=e.charCodeAt(o),!c(a))return ce;m=m&&p(a)}else{for(o=0;o<e.length;o++){if((a=e.charCodeAt(o))===N)s=!0,h&&(u=u||o-d-1>r&&" "!==e[d+1],d=o);else if(!c(a))return ce;m=m&&p(a)}u=u||h&&o-d-1>r&&" "!==e[d+1]}return s||u?" "===e[0]&&n>9?ce:u?le:ue:m&&!i(e)?ae:se}function d(e,t,n,r){e.dump=function(){function i(t){return u(e,t)}if(0===t.length)return"''";if(!e.noCompatMode&&-1!==oe.indexOf(t))return"'"+t+"'";var o=e.indent*Math.max(1,n),s=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),l=r||e.flowLevel>-1&&n>=e.flowLevel;switch(h(t,l,e.indent,s,i)){case ae:return t;case se:return"'"+t.replace(/'/g,"''")+"'";case ue:return"|"+m(t,e.indent)+v(a(t,o));case le:return">"+m(t,e.indent)+v(a(g(t,s),o));case ce:return'"'+_(t)+'"';default:throw new T("impossible error: invalid scalar style")}}()}function m(e,t){var n=" "===e[0]?String(t):"",r="\n"===e[e.length-1];return n+(!r||"\n"!==e[e.length-2]&&"\n"!==e?r?"":"-":"+")+"\n"}function v(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function g(e,t){for(var n,r,i=/(\n+)([^\n]*)/g,o=function(){var n=e.indexOf("\n");return n=-1!==n?n:e.length,i.lastIndex=n,y(e.slice(0,n),t)}(),a="\n"===e[0]||" "===e[0];r=i.exec(e);){var s=r[1],u=r[2];n=" "===u[0],o+=s+(a||n||""===u?"":"\n")+y(u,t),a=n}return o}function y(e,t){if(""===e||" "===e[0])return e;for(var n,r,i=/ [^ ]/g,o=0,a=0,s=0,u="";n=i.exec(e);)s=n.index,s-o>t&&(r=a>o?a:s,u+="\n"+e.slice(o,r),o=r+1),a=s;return u+="\n",e.length-o>t&&a>o?u+=e.slice(o,a)+"\n"+e.slice(a+1):u+=e.slice(o),u.slice(1)}function _(e){for(var t,n,r,o="",a=0;a<e.length;a++)t=e.charCodeAt(a),t>=55296&&t<=56319&&(n=e.charCodeAt(a+1))>=56320&&n<=57343?(o+=i(1024*(t-55296)+n-56320+65536),a++):(r=ie[t],o+=!r&&c(t)?e[a]:r||i(t));return o}function b(e,t,n){var r,i,o="",a=e.tag;for(r=0,i=n.length;r<i;r+=1)S(e,t,n[r],!1,!1)&&(0!==r&&(o+=","+(e.condenseFlow?"":" ")),o+=e.dump);e.tag=a,e.dump="["+o+"]"}function x(e,t,n,r){var i,o,a="",u=e.tag;for(i=0,o=n.length;i<o;i+=1)S(e,t+1,n[i],!0,!0)&&(r&&0===i||(a+=s(e,t)),e.dump&&N===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=u,e.dump=a||"[]"}function w(e,t,n){var r,i,o,a,s,u="",l=e.tag,c=Object.keys(n);for(r=0,i=c.length;r<i;r+=1)s=e.condenseFlow?'"':"",0!==r&&(s+=", "),o=c[r],a=n[o],S(e,t,o,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),S(e,t,a,!1,!1)&&(s+=e.dump,u+=s));e.tag=l,e.dump="{"+u+"}"}function k(e,t,n,r){var i,o,a,u,l,c,p="",f=e.tag,h=Object.keys(n);if(!0===e.sortKeys)h.sort();else if("function"==typeof e.sortKeys)h.sort(e.sortKeys);else if(e.sortKeys)throw new T("sortKeys must be a boolean or a function");for(i=0,o=h.length;i<o;i+=1)c="",r&&0===i||(c+=s(e,t)),a=h[i],u=n[a],S(e,t+1,a,!0,!0,!0)&&(l=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024,l&&(e.dump&&N===e.dump.charCodeAt(0)?c+="?":c+="? "),c+=e.dump,l&&(c+=s(e,t)),S(e,t+1,u,!0,l)&&(e.dump&&N===e.dump.charCodeAt(0)?c+=":":c+=": ",c+=e.dump,p+=c));e.tag=f,e.dump=p||"{}"}function E(e,t,n){var r,i,o,a,s,u;for(i=n?e.explicitTypes:e.implicitTypes,o=0,a=i.length;o<a;o+=1)if(s=i[o],(s.instanceOf||s.predicate)&&(!s.instanceOf||"object"==typeof t&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(e.tag=n?s.tag:"?",s.represent){if(u=e.styleMap[s.tag]||s.defaultStyle,"[object Function]"===R.call(s.represent))r=s.represent(t,u);else{if(!j.call(s.represent,u))throw new T("!<"+s.tag+'> tag resolver accepts not "'+u+'" style');r=s.represent[u](t,u)}e.dump=r}return!0}return!1}function S(e,t,n,r,i,o){e.tag=null,e.dump=n,E(e,n,!1)||E(e,n,!0);var a=R.call(e.dump);r&&(r=e.flowLevel<0||e.flowLevel>t);var s,u,l="[object Object]"===a||"[object Array]"===a;if(l&&(s=e.duplicates.indexOf(n),u=-1!==s),(null!==e.tag&&"?"!==e.tag||u||2!==e.indent&&t>0)&&(i=!1),u&&e.usedDuplicates[s])e.dump="*ref_"+s;else{if(l&&u&&!e.usedDuplicates[s]&&(e.usedDuplicates[s]=!0),"[object Object]"===a)r&&0!==Object.keys(e.dump).length?(k(e,t,e.dump,i),u&&(e.dump="&ref_"+s+e.dump)):(w(e,t,e.dump),u&&(e.dump="&ref_"+s+" "+e.dump));else if("[object Array]"===a)r&&0!==e.dump.length?(x(e,t,e.dump,i),u&&(e.dump="&ref_"+s+e.dump)):(b(e,t,e.dump),u&&(e.dump="&ref_"+s+" "+e.dump));else{if("[object String]"!==a){if(e.skipInvalid)return!1;throw new T("unacceptable kind of an object to dump "+a)}"?"!==e.tag&&d(e,e.dump,t,o)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function C(e,t){var n,r,i=[],o=[];for(A(e,i,o),n=0,r=o.length;n<r;n+=1)t.duplicates.push(i[o[n]]);t.usedDuplicates=new Array(r)}function A(e,t,n){var r,i,o;if(null!==e&&"object"==typeof e)if(-1!==(i=t.indexOf(e)))-1===n.indexOf(i)&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,o=e.length;i<o;i+=1)A(e[i],t,n);else for(r=Object.keys(e),i=0,o=r.length;i<o;i+=1)A(e[r[i]],t,n)}function D(e,t){t=t||{};var n=new o(t);return n.noRefs||C(e,n),S(n,0,e,!0,!0)?n.dump+"\n":""}function O(e,t){return D(e,M.extend({schema:I},t))}var M=n(80),T=n(117),P=n(145),I=n(118),R=Object.prototype.toString,j=Object.prototype.hasOwnProperty,F=9,N=10,B=32,L=33,q=34,z=35,U=37,W=38,V=39,H=42,G=44,J=45,K=58,X=62,Y=63,$=64,Z=91,Q=93,ee=96,te=123,ne=124,re=125,ie={};ie[0]="\\0",ie[7]="\\a",ie[8]="\\b",ie[9]="\\t",ie[10]="\\n",ie[11]="\\v",ie[12]="\\f",ie[13]="\\r",ie[27]="\\e",ie[34]='\\"',ie[92]="\\\\",ie[133]="\\N",ie[160]="\\_",ie[8232]="\\L",ie[8233]="\\P";var oe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],ae=1,se=2,ue=3,le=4,ce=5;e.exports.dump=D,e.exports.safeDump=O},function(e,t,n){"use strict";function r(e){return 10===e||13===e}function i(e){return 9===e||32===e}function o(e){return 9===e||32===e||10===e||13===e}function a(e){return 44===e||91===e||93===e||123===e||125===e}function s(e){var t;return 48<=e&&e<=57?e-48:(t=32|e,97<=t&&t<=102?t-97+10:-1)}function u(e){return 120===e?2:117===e?4:85===e?8:0}function l(e){return 48<=e&&e<=57?e-48:-1}function c(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e?"\t":9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function p(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}function f(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||V,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function h(e,t){return new z(t,new U(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function d(e,t){throw h(e,t)}function m(e,t){e.onWarning&&e.onWarning.call(null,h(e,t))}function v(e,t,n,r){var i,o,a,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,o=s.length;i<o;i+=1)9===(a=s.charCodeAt(i))||32<=a&&a<=1114111||d(e,"expected valid JSON character");else Q.test(s)&&d(e,"the stream contains non-printable characters");e.result+=s}}function g(e,t,n,r){var i,o,a,s;for(q.isObject(n)||d(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),a=0,s=i.length;a<s;a+=1)o=i[a],H.call(t,o)||(t[o]=n[o],r[o]=!0)}function y(e,t,n,r,i,o,a,s){var u,l;if(i=String(i),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(o))for(u=0,l=o.length;u<l;u+=1)g(e,t,o[u],n);else g(e,t,o,n);else e.json||H.call(n,i)||!H.call(t,i)||(e.line=a||e.line,e.position=s||e.position,d(e,"duplicated mapping key")),t[i]=o,delete n[i];return t}function _(e){var t;t=e.input.charCodeAt(e.position),10===t?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):d(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function b(e,t,n){for(var o=0,a=e.input.charCodeAt(e.position);0!==a;){for(;i(a);)a=e.input.charCodeAt(++e.position);if(t&&35===a)do{a=e.input.charCodeAt(++e.position)}while(10!==a&&13!==a&&0!==a);if(!r(a))break;for(_(e),a=e.input.charCodeAt(e.position),o++,e.lineIndent=0;32===a;)e.lineIndent++,a=e.input.charCodeAt(++e.position)}return-1!==n&&0!==o&&e.lineIndent<n&&m(e,"deficient indentation"),o}function x(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!o(t)))}function w(e,t){1===t?e.result+=" ":t>1&&(e.result+=q.repeat("\n",t-1))}function k(e,t,n){var s,u,l,c,p,f,h,d,m,g=e.kind,y=e.result;if(m=e.input.charCodeAt(e.position),o(m)||a(m)||35===m||38===m||42===m||33===m||124===m||62===m||39===m||34===m||37===m||64===m||96===m)return!1;if((63===m||45===m)&&(u=e.input.charCodeAt(e.position+1),o(u)||n&&a(u)))return!1;for(e.kind="scalar",e.result="",l=c=e.position,p=!1;0!==m;){if(58===m){if(u=e.input.charCodeAt(e.position+1),o(u)||n&&a(u))break}else if(35===m){if(s=e.input.charCodeAt(e.position-1),o(s))break}else{if(e.position===e.lineStart&&x(e)||n&&a(m))break;if(r(m)){if(f=e.line,h=e.lineStart,d=e.lineIndent,b(e,!1,-1),e.lineIndent>=t){p=!0,m=e.input.charCodeAt(e.position);continue}e.position=c,e.line=f,e.lineStart=h,e.lineIndent=d;break}}p&&(v(e,l,c,!1),w(e,e.line-f),l=c=e.position,p=!1),i(m)||(c=e.position+1),m=e.input.charCodeAt(++e.position)}return v(e,l,c,!1),!!e.result||(e.kind=g,e.result=y,!1)}function E(e,t){var n,i,o;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(v(e,i,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;i=e.position,e.position++,o=e.position}else r(n)?(v(e,i,o,!0),w(e,b(e,!1,t)),i=o=e.position):e.position===e.lineStart&&x(e)?d(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);d(e,"unexpected end of the stream within a single quoted scalar")}function S(e,t){var n,i,o,a,l,c;if(34!==(c=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;0!==(c=e.input.charCodeAt(e.position));){if(34===c)return v(e,n,e.position,!0),e.position++,!0;if(92===c){if(v(e,n,e.position,!0),c=e.input.charCodeAt(++e.position),r(c))b(e,!1,t);else if(c<256&&ie[c])e.result+=oe[c],e.position++;else if((l=u(c))>0){for(o=l,a=0;o>0;o--)c=e.input.charCodeAt(++e.position),(l=s(c))>=0?a=(a<<4)+l:d(e,"expected hexadecimal character");e.result+=p(a),e.position++}else d(e,"unknown escape sequence");n=i=e.position}else r(c)?(v(e,n,i,!0),w(e,b(e,!1,t)),n=i=e.position):e.position===e.lineStart&&x(e)?d(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}d(e,"unexpected end of the stream within a double quoted scalar")}function C(e,t){var n,r,i,a,s,u,l,c,p,f,h,m=!0,v=e.tag,g=e.anchor,_={};if(91===(h=e.input.charCodeAt(e.position)))a=93,l=!1,r=[];else{if(123!==h)return!1;a=125,l=!0,r={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=r),h=e.input.charCodeAt(++e.position);0!==h;){if(b(e,!0,t),(h=e.input.charCodeAt(e.position))===a)return e.position++,e.tag=v,e.anchor=g,e.kind=l?"mapping":"sequence",e.result=r,!0;m||d(e,"missed comma between flow collection entries"),p=c=f=null,s=u=!1,63===h&&(i=e.input.charCodeAt(e.position+1),o(i)&&(s=u=!0,e.position++,b(e,!0,t))),n=e.line,I(e,t,G,!1,!0),p=e.tag,c=e.result,b(e,!0,t),h=e.input.charCodeAt(e.position),!u&&e.line!==n||58!==h||(s=!0,h=e.input.charCodeAt(++e.position),b(e,!0,t),I(e,t,G,!1,!0),f=e.result),l?y(e,r,_,p,c,f):s?r.push(y(e,null,_,p,c,f)):r.push(c),b(e,!0,t),h=e.input.charCodeAt(e.position),44===h?(m=!0,h=e.input.charCodeAt(++e.position)):m=!1}d(e,"unexpected end of the stream within a flow collection")}function A(e,t){var n,o,a,s,u=Y,c=!1,p=!1,f=t,h=0,m=!1;if(124===(s=e.input.charCodeAt(e.position)))o=!1;else{if(62!==s)return!1;o=!0}for(e.kind="scalar",e.result="";0!==s;)if(43===(s=e.input.charCodeAt(++e.position))||45===s)Y===u?u=43===s?Z:$:d(e,"repeat of a chomping mode identifier");else{if(!((a=l(s))>=0))break;0===a?d(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):p?d(e,"repeat of an indentation width identifier"):(f=t+a-1,p=!0)}if(i(s)){do{s=e.input.charCodeAt(++e.position)}while(i(s));if(35===s)do{s=e.input.charCodeAt(++e.position)}while(!r(s)&&0!==s)}for(;0!==s;){for(_(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!p||e.lineIndent<f)&&32===s;)e.lineIndent++,s=e.input.charCodeAt(++e.position);if(!p&&e.lineIndent>f&&(f=e.lineIndent),r(s))h++;else{if(e.lineIndent<f){u===Z?e.result+=q.repeat("\n",c?1+h:h):u===Y&&c&&(e.result+="\n");break}for(o?i(s)?(m=!0,e.result+=q.repeat("\n",c?1+h:h)):m?(m=!1,e.result+=q.repeat("\n",h+1)):0===h?c&&(e.result+=" "):e.result+=q.repeat("\n",h):e.result+=q.repeat("\n",c?1+h:h),c=!0,p=!0,h=0,n=e.position;!r(s)&&0!==s;)s=e.input.charCodeAt(++e.position);v(e,n,e.position,!1)}}return!0}function D(e,t){var n,r,i,a=e.tag,s=e.anchor,u=[],l=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=u),i=e.input.charCodeAt(e.position);0!==i&&45===i&&(r=e.input.charCodeAt(e.position+1),o(r));)if(l=!0,e.position++,b(e,!0,-1)&&e.lineIndent<=t)u.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,I(e,t,K,!1,!0),u.push(e.result),b(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)d(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!l&&(e.tag=a,e.anchor=s,e.kind="sequence",e.result=u,!0)}function O(e,t,n){var r,a,s,u,l,c=e.tag,p=e.anchor,f={},h={},m=null,v=null,g=null,_=!1,x=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=f),l=e.input.charCodeAt(e.position);0!==l;){if(r=e.input.charCodeAt(e.position+1),s=e.line,u=e.position,63!==l&&58!==l||!o(r)){if(!I(e,n,J,!1,!0))break;if(e.line===s){for(l=e.input.charCodeAt(e.position);i(l);)l=e.input.charCodeAt(++e.position);if(58===l)l=e.input.charCodeAt(++e.position),o(l)||d(e,"a whitespace character is expected after the key-value separator within a block mapping"),_&&(y(e,f,h,m,v,null),m=v=g=null),x=!0,_=!1,a=!1,m=e.tag,v=e.result;else{if(!x)return e.tag=c,e.anchor=p,!0;d(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!x)return e.tag=c,e.anchor=p,!0;d(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===l?(_&&(y(e,f,h,m,v,null),m=v=g=null),x=!0,_=!0,a=!0):_?(_=!1,a=!0):d(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,l=r;if((e.line===s||e.lineIndent>t)&&(I(e,t,X,!0,a)&&(_?v=e.result:g=e.result),_||(y(e,f,h,m,v,g,s,u),m=v=g=null),b(e,!0,-1),l=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==l)d(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return _&&y(e,f,h,m,v,null),x&&(e.tag=c,e.anchor=p,e.kind="mapping",e.result=f),x}function M(e){var t,n,r,i,a=!1,s=!1;if(33!==(i=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&d(e,"duplication of a tag property"),i=e.input.charCodeAt(++e.position),60===i?(a=!0,i=e.input.charCodeAt(++e.position)):33===i?(s=!0,n="!!",i=e.input.charCodeAt(++e.position)):n="!",t=e.position,a){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&62!==i);e.position<e.length?(r=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):d(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!o(i);)33===i&&(s?d(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),ne.test(n)||d(e,"named tag handle cannot contain such characters"),s=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),te.test(r)&&d(e,"tag suffix cannot contain flow indicator characters")}return r&&!re.test(r)&&d(e,"tag name cannot contain such characters: "+r),a?e.tag=r:H.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:d(e,'undeclared tag handle "'+n+'"'),!0}function T(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&d(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!o(n)&&!a(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&d(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function P(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!o(r)&&!a(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&d(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),e.anchorMap.hasOwnProperty(n)||d(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],b(e,!0,-1),!0}function I(e,t,n,r,i){var o,a,s,u,l,c,p,f,h=1,m=!1,v=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=a=s=X===n||K===n,r&&b(e,!0,-1)&&(m=!0,e.lineIndent>t?h=1:e.lineIndent===t?h=0:e.lineIndent<t&&(h=-1)),1===h)for(;M(e)||T(e);)b(e,!0,-1)?(m=!0,s=o,e.lineIndent>t?h=1:e.lineIndent===t?h=0:e.lineIndent<t&&(h=-1)):s=!1;if(s&&(s=m||i),1!==h&&X!==n||(p=G===n||J===n?t:t+1,f=e.position-e.lineStart,1===h?s&&(D(e,f)||O(e,f,p))||C(e,p)?v=!0:(a&&A(e,p)||E(e,p)||S(e,p)?v=!0:P(e)?(v=!0,null===e.tag&&null===e.anchor||d(e,"alias node should not have any properties")):k(e,p,G===n)&&(v=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===h&&(v=s&&D(e,f))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(u=0,l=e.implicitTypes.length;u<l;u+=1)if(c=e.implicitTypes[u],c.resolve(e.result)){e.result=c.construct(e.result),e.tag=c.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else H.call(e.typeMap[e.kind||"fallback"],e.tag)?(c=e.typeMap[e.kind||"fallback"][e.tag],null!==e.result&&c.kind!==e.kind&&d(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+c.kind+'", not "'+e.kind+'"'),c.resolve(e.result)?(e.result=c.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):d(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):d(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||v}function R(e){var t,n,a,s,u=e.position,l=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(s=e.input.charCodeAt(e.position))&&(b(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==s));){for(l=!0,s=e.input.charCodeAt(++e.position),t=e.position;0!==s&&!o(s);)s=e.input.charCodeAt(++e.position);for(n=e.input.slice(t,e.position),a=[],n.length<1&&d(e,"directive name must not be less than one character in length");0!==s;){for(;i(s);)s=e.input.charCodeAt(++e.position);if(35===s){do{s=e.input.charCodeAt(++e.position)}while(0!==s&&!r(s));break}if(r(s))break;for(t=e.position;0!==s&&!o(s);)s=e.input.charCodeAt(++e.position);a.push(e.input.slice(t,e.position))}0!==s&&_(e),H.call(se,n)?se[n](e,n,a):m(e,'unknown document directive "'+n+'"')}if(b(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,b(e,!0,-1)):l&&d(e,"directives end mark is expected"),I(e,e.lineIndent-1,X,!1,!0),b(e,!0,-1),e.checkLineBreaks&&ee.test(e.input.slice(u,e.position))&&m(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&x(e))return void(46===e.input.charCodeAt(e.position)&&(e.position+=3,b(e,!0,-1)));e.position<e.length-1&&d(e,"end of the stream or a document separator is expected")}function j(e,t){e=String(e),t=t||{},0!==e.length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new f(e,t);for(n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)R(n);return n.documents}function F(e,t,n){var r,i,o=j(e,n);if("function"!=typeof t)return o;for(r=0,i=o.length;r<i;r+=1)t(o[r])}function N(e,t){var n=j(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new z("expected a single document in the stream, but found more")}}function B(e,t,n){if("function"!=typeof t)return F(e,q.extend({schema:W},n));F(e,t,q.extend({schema:W},n))}function L(e,t){return N(e,q.extend({schema:W},t))}for(var q=n(80),z=n(117),U=n(798),W=n(118),V=n(145),H=Object.prototype.hasOwnProperty,G=1,J=2,K=3,X=4,Y=1,$=2,Z=3,Q=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ee=/[\x85\u2028\u2029]/,te=/[,\[\]\{\}]/,ne=/^(?:!|!!|![a-z\-]+!)$/i,re=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i,ie=new Array(256),oe=new Array(256),ae=0;ae<256;ae++)ie[ae]=c(ae)?1:0,oe[ae]=c(ae);var se={YAML:function(e,t,n){var r,i,o;null!==e.version&&d(e,"duplication of %YAML directive"),1!==n.length&&d(e,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),null===r&&d(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&d(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&m(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&d(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],ne.test(r)||d(e,"ill-formed tag handle (first argument) of the TAG directive"),H.call(e.tagMap,r)&&d(e,'there is a previously declared suffix for "'+r+'" tag handle'),re.test(i)||d(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[r]=i}};e.exports.loadAll=F,e.exports.load=N,e.exports.safeLoadAll=B,e.exports.safeLoad=L},function(e,t,n){"use strict";function r(e,t,n,r,i){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=i}var i=n(80);r.prototype.getSnippet=function(e,t){var n,r,o,a,s;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",r=this.position;r>0&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(r-1));)if(r-=1,this.position-r>t/2-1){n=" ... ",r+=5;break}for(o="",a=this.position;a<this.buffer.length&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(a));)if((a+=1)-this.position>t/2-1){o=" ... ",a-=5;break}return s=this.buffer.slice(r,a),i.repeat(" ",e)+n+s+o+"\n"+i.repeat(" ",e+this.position-r+n.length)+"^"},r.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet())&&(n+=":\n"+t),n},e.exports=r},function(e,t,n){"use strict";function r(e){if(null===e)return!1;var t,n,r=0,i=e.length,o=l;for(n=0;n<i;n++)if(!((t=o.indexOf(e.charAt(n)))>64)){if(t<0)return!1;r+=6}return r%8==0}function i(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,o=l,a=0,u=[];for(t=0;t<i;t++)t%4==0&&t&&(u.push(a>>16&255),u.push(a>>8&255),u.push(255&a)),a=a<<6|o.indexOf(r.charAt(t));return n=i%4*6,0===n?(u.push(a>>16&255),u.push(a>>8&255),u.push(255&a)):18===n?(u.push(a>>10&255),u.push(a>>2&255)):12===n&&u.push(a>>4&255),s?s.from?s.from(u):new s(u):u}function o(e){var t,n,r="",i=0,o=e.length,a=l;for(t=0;t<o;t++)t%3==0&&t&&(r+=a[i>>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]),i=(i<<8)+e[t];return n=o%3,0===n?(r+=a[i>>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]):2===n?(r+=a[i>>10&63],r+=a[i>>4&63],r+=a[i<<2&63],r+=a[64]):1===n&&(r+=a[i>>2&63],r+=a[i<<4&63],r+=a[64],r+=a[64]),r}function a(e){return s&&s.isBuffer(e)}var s;try{s=n(40).Buffer}catch(e){}var u=n(16),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";e.exports=new u("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:i,predicate:a,represent:o})},function(e,t,n){"use strict";function r(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)}function i(e){return"true"===e||"True"===e||"TRUE"===e}function o(e){return"[object Boolean]"===Object.prototype.toString.call(e)}var a=n(16);e.exports=new a("tag:yaml.org,2002:bool",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},function(e,t,n){"use strict";function r(e){return null!==e&&!(!l.test(e)||"_"===e[e.length-1])}function i(e){var t,n,r,i;return t=e.replace(/_/g,"").toLowerCase(),n="-"===t[0]?-1:1,i=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:t.indexOf(":")>=0?(t.split(":").forEach(function(e){i.unshift(parseFloat(e,10))}),t=0,r=1,i.forEach(function(e){t+=e*r,r*=60}),n*t):n*parseFloat(t,10)}function o(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(s.isNegativeZero(e))return"-0.0";return n=e.toString(10),c.test(n)?n.replace("e",".e"):n}function a(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||s.isNegativeZero(e))}var s=n(80),u=n(16),l=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),c=/^[-+]?[0-9]+e/;e.exports=new u("tag:yaml.org,2002:float",{kind:"scalar",resolve:r,construct:i,predicate:a,represent:o,defaultStyle:"lowercase"})},function(e,t,n){"use strict";function r(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function i(e){return 48<=e&&e<=55}function o(e){return 48<=e&&e<=57}function a(e){if(null===e)return!1;var t,n=e.length,a=0,s=!1;if(!n)return!1;if(t=e[a],"-"!==t&&"+"!==t||(t=e[++a]),"0"===t){if(a+1===n)return!0;if("b"===(t=e[++a])){for(a++;a<n;a++)if("_"!==(t=e[a])){if("0"!==t&&"1"!==t)return!1;s=!0}return s&&"_"!==t}if("x"===t){for(a++;a<n;a++)if("_"!==(t=e[a])){if(!r(e.charCodeAt(a)))return!1;s=!0}return s&&"_"!==t}for(;a<n;a++)if("_"!==(t=e[a])){if(!i(e.charCodeAt(a)))return!1;s=!0}return s&&"_"!==t}if("_"===t)return!1;for(;a<n;a++)if("_"!==(t=e[a])){if(":"===t)break;if(!o(e.charCodeAt(a)))return!1;s=!0}return!(!s||"_"===t)&&(":"!==t||/^(:[0-5]?[0-9])+$/.test(e.slice(a)))}function s(e){var t,n,r=e,i=1,o=[];return-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),t=r[0],"-"!==t&&"+"!==t||("-"===t&&(i=-1),r=r.slice(1),t=r[0]),"0"===r?0:"0"===t?"b"===r[1]?i*parseInt(r.slice(2),2):"x"===r[1]?i*parseInt(r,16):i*parseInt(r,8):-1!==r.indexOf(":")?(r.split(":").forEach(function(e){o.unshift(parseInt(e,10))}),r=0,n=1,o.forEach(function(e){r+=e*n,n*=60}),i*r):i*parseInt(r,10)}function u(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!l.isNegativeZero(e)}var l=n(80),c=n(16);e.exports=new c("tag:yaml.org,2002:int",{kind:"scalar",resolve:a,construct:s,predicate:u,represent:{binary:function(e){return"0b"+e.toString(2)},octal:function(e){return"0"+e.toString(8)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return"0x"+e.toString(16).toUpperCase()}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},function(e,t,n){"use strict";function r(e){if(null===e)return!1;try{var t="("+e+")",n=s.parse(t,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&"FunctionExpression"===n.body[0].expression.type}catch(e){return!1}}function i(e){var t,n="("+e+")",r=s.parse(n,{range:!0}),i=[];if("Program"!==r.type||1!==r.body.length||"ExpressionStatement"!==r.body[0].type||"FunctionExpression"!==r.body[0].expression.type)throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach(function(e){i.push(e.name)}),t=r.body[0].expression.body.range,new Function(i,n.slice(t[0]+1,t[1]-1))}function o(e){return e.toString()}function a(e){return"[object Function]"===Object.prototype.toString.call(e)}var s;try{s=n(743)}catch(e){"undefined"!=typeof window&&(s=window.esprima)}var u=n(16);e.exports=new u("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:r,construct:i,predicate:a,represent:o})},function(e,t,n){"use strict";function r(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";if("/"===t[0]){if(n&&(r=n[1]),r.length>3)return!1;if("/"!==t[t.length-r.length-1])return!1}return!0}function i(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return"/"===t[0]&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)}function o(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function a(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var s=n(16);e.exports=new s("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:r,construct:i,predicate:a,represent:o})},function(e,t,n){"use strict";function r(){return!0}function i(){}function o(){return""}function a(e){return void 0===e}var s=n(16);e.exports=new s("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:r,construct:i,predicate:a,represent:o})},function(e,t,n){"use strict";var r=n(16);e.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},function(e,t,n){"use strict";function r(e){return"<<"===e||null===e}var i=n(16);e.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:r})},function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)}function i(){return null}function o(e){return null===e}var a=n(16);e.exports=new a("tag:yaml.org,2002:null",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t,n,r,i,o,u=[],l=e;for(t=0,n=l.length;t<n;t+=1){if(r=l[t],o=!1,"[object Object]"!==s.call(r))return!1;for(i in r)if(a.call(r,i)){if(o)return!1;o=!0}if(!o)return!1;if(-1!==u.indexOf(i))return!1;u.push(i)}return!0}function i(e){return null!==e?e:[]}var o=n(16),a=Object.prototype.hasOwnProperty,s=Object.prototype.toString;e.exports=new o("tag:yaml.org,2002:omap",{kind:"sequence",resolve:r,construct:i})},function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t,n,r,i,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(r=s[t],"[object Object]"!==a.call(r))return!1;if(i=Object.keys(r),1!==i.length)return!1;o[t]=[i[0],r[i[0]]]}return!0}function i(e){if(null===e)return[];var t,n,r,i,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t<n;t+=1)r=a[t],i=Object.keys(r),o[t]=[i[0],r[i[0]]];return o}var o=n(16),a=Object.prototype.toString;e.exports=new o("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:i})},function(e,t,n){"use strict";var r=n(16);e.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t,n=e;for(t in n)if(a.call(n,t)&&null!==n[t])return!1;return!0}function i(e){return null!==e?e:{}}var o=n(16),a=Object.prototype.hasOwnProperty;e.exports=new o("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:i})},function(e,t,n){"use strict";var r=n(16);e.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},function(e,t,n){"use strict";function r(e){return null!==e&&(null!==s.exec(e)||null!==u.exec(e))}function i(e){var t,n,r,i,o,a,l,c,p,f,h=0,d=null;if(t=s.exec(e),null===t&&(t=u.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(o=+t[4],a=+t[5],l=+t[6],t[7]){for(h=t[7].slice(0,3);h.length<3;)h+="0";h=+h}return t[9]&&(c=+t[10],p=+(t[11]||0),d=6e4*(60*c+p),"-"===t[9]&&(d=-d)),f=new Date(Date.UTC(n,r,i,o,a,l,h)),d&&f.setTime(f.getTime()-d),f}function o(e){return e.toISOString()}var a=n(16),s=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),u=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");e.exports=new a("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:r,construct:i,instanceOf:Date,represent:o})},function(e,t,n){"use strict";function r(e){return null==e?void 0===e?u:s:l&&l in Object(e)?n.i(o.a)(e):n.i(a.a)(e)}var i=n(390),o=n(818),a=n(819),s="[object Null]",u="[object Undefined]",l=i.a?i.a.toStringTag:void 0;t.a=r},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(t,n(17))},function(e,t,n){"use strict";var r=n(820),i=n.i(r.a)(Object.getPrototypeOf,Object);t.a=i},function(e,t,n){"use strict";function r(e){var t=a.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[u]=n:delete e[u]),i}var i=n(390),o=Object.prototype,a=o.hasOwnProperty,s=o.toString,u=i.a?i.a.toStringTag:void 0;t.a=r},function(e,t,n){"use strict";function r(e){return o.call(e)}var i=Object.prototype,o=i.toString;t.a=r},function(e,t,n){"use strict";function r(e,t){return function(n){return e(t(n))}}t.a=r},function(e,t,n){"use strict";var r=n(816),i="object"==typeof self&&self&&self.Object===Object&&self,o=r.a||i||Function("return this")();t.a=o},function(e,t,n){"use strict";function r(e){return null!=e&&"object"==typeof e}t.a=r},function(e,t){function n(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function r(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function i(e,t){var n=I(e)||h(e)?r(e.length,String):[],i=n.length,o=!!i;for(var a in e)!t&&!A.call(e,a)||o&&("length"==a||l(a,i))||n.push(a);return n}function o(e,t,n){var r=e[t];A.call(e,t)&&f(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function a(e){if(!p(e))return M(e);var t=[];for(var n in Object(e))A.call(e,n)&&"constructor"!=n&&t.push(n);return t}function s(e,t){return t=T(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=T(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=a,n(e,this,s)}}function u(e,t,n,r){n||(n={});for(var i=-1,a=t.length;++i<a;){var s=t[i],u=r?r(n[s],e[s],s,n,e):void 0;o(n,s,void 0===u?e[s]:u)}return n}function l(e,t){return!!(t=null==t?x:t)&&("number"==typeof e||S.test(e))&&e>-1&&e%1==0&&e<t}function c(e,t,n){if(!y(n))return!1;var r=typeof t;return!!("number"==r?d(n)&&l(t,n.length):"string"==r&&t in n)&&f(n[t],e)}function p(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||C)}function f(e,t){return e===t||e!==e&&t!==t}function h(e){return m(e)&&A.call(e,"callee")&&(!O.call(e,"callee")||D.call(e)==w)}function d(e){return null!=e&&g(e.length)&&!v(e)}function m(e){return _(e)&&d(e)}function v(e){var t=y(e)?D.call(e):"";return t==k||t==E}function g(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=x}function y(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function _(e){return!!e&&"object"==typeof e}function b(e){return d(e)?i(e):a(e)}var x=9007199254740991,w="[object Arguments]",k="[object Function]",E="[object GeneratorFunction]",S=/^(?:0|[1-9]\d*)$/,C=Object.prototype,A=C.hasOwnProperty,D=C.toString,O=C.propertyIsEnumerable,M=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),T=Math.max,P=!O.call({valueOf:1},"valueOf"),I=Array.isArray,R=function(e){return s(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&c(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,o)}return t})}(function(e,t){if(P||p(t)||d(t))return void u(t,b(t),e);for(var n in t)A.call(t,n)&&o(e,n,t[n])});e.exports=R},function(e,t,n){(function(e,n){function r(e,t){return e.set(t[0],t[1]),e}function i(e,t){return e.add(t),e}function o(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););return e}function a(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function s(e,t,n,r){var i=-1,o=e?e.length:0;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function u(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function l(e,t){return null==e?void 0:e[t]}function c(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function p(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function f(e,t){return function(n){return e(t(n))}}function h(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function d(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function m(){this.__data__=jt?jt(null):{}}function v(e){return this.has(e)&&delete this.__data__[e]}function g(e){var t=this.__data__;if(jt){var n=t[e];return n===Oe?void 0:n}return gt.call(t,e)?t[e]:void 0}function y(e){var t=this.__data__;return jt?void 0!==t[e]:gt.call(t,e)}function _(e,t){return this.__data__[e]=jt&&void 0===t?Oe:t,this}function b(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function x(){this.__data__=[]}function w(e){var t=this.__data__,n=q(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ct.call(t,n,1),!0)}function k(e){var t=this.__data__,n=q(t,e);return n<0?void 0:t[n][1]}function E(e){return q(this.__data__,e)>-1}function S(e,t){var n=this.__data__,r=q(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}function C(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function A(){this.__data__={hash:new d,map:new(Tt||b),string:new d}}function D(e){return ae(this,e).delete(e)}function O(e){return ae(this,e).get(e)}function M(e){return ae(this,e).has(e)}function T(e,t){return ae(this,e).set(e,t),this}function P(e){this.__data__=new b(e)}function I(){this.__data__=new b}function R(e){return this.__data__.delete(e)}function j(e){return this.__data__.get(e)}function F(e){return this.__data__.has(e)}function N(e,t){var n=this.__data__;if(n instanceof b){var r=n.__data__;if(!Tt||r.length<De-1)return r.push([e,t]),this;n=this.__data__=new C(r)}return n.set(e,t),this}function B(e,t){var n=Ht(e)||ye(e)?u(e.length,String):[],r=n.length,i=!!r;for(var o in e)!t&&!gt.call(e,o)||i&&("length"==o||pe(o,r))||n.push(o);return n}function L(e,t,n){var r=e[t];gt.call(e,t)&&ge(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function q(e,t){for(var n=e.length;n--;)if(ge(e[n][0],t))return n;return-1}function z(e,t){return e&&re(t,Se(t),e)}function U(e,t,n,r,i,a,s){var u;if(r&&(u=a?r(e,i,a,s):r(e)),void 0!==u)return u;if(!ke(e))return e;var l=Ht(e);if(l){if(u=ue(e),!t)return ne(e,u)}else{var p=Vt(e),f=p==Re||p==je;if(Gt(e))return K(e,t);if(p==Be||p==Te||f&&!a){if(c(e))return a?e:{};if(u=le(f?{}:e),!t)return ie(e,z(u,e))}else{if(!it[p])return a?e:{};u=ce(e,p,U,t)}}s||(s=new P);var h=s.get(e);if(h)return h;if(s.set(e,u),!l)var d=n?oe(e):Se(e);return o(d||e,function(i,o){d&&(o=i,i=e[o]),L(u,o,U(i,t,n,r,o,e,s))}),u}function W(e){return ke(e)?Et(e):{}}function V(e,t,n){var r=t(e);return Ht(e)?r:a(r,n(e))}function H(e){return yt.call(e)}function G(e){return!(!ke(e)||he(e))&&(xe(e)||c(e)?_t:nt).test(me(e))}function J(e){if(!de(e))return Ot(e);var t=[];for(var n in Object(e))gt.call(e,n)&&"constructor"!=n&&t.push(n);return t}function K(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}function X(e){var t=new e.constructor(e.byteLength);return new wt(t).set(new wt(e)),t}function Y(e,t){var n=t?X(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function $(e,t,n){return s(t?n(p(e),!0):p(e),r,new e.constructor)}function Z(e){var t=new e.constructor(e.source,tt.exec(e));return t.lastIndex=e.lastIndex,t}function Q(e,t,n){return s(t?n(h(e),!0):h(e),i,new e.constructor)}function ee(e){return Ut?Object(Ut.call(e)):{}}function te(e,t){var n=t?X(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function ne(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function re(e,t,n,r){n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],s=r?r(n[a],e[a],a,n,e):void 0;L(n,a,void 0===s?e[a]:s)}return n}function ie(e,t){return re(e,Wt(e),t)}function oe(e){return V(e,Se,Wt)}function ae(e,t){var n=e.__data__;return fe(t)?n["string"==typeof t?"string":"hash"]:n.map}function se(e,t){var n=l(e,t);return G(n)?n:void 0}function ue(e){var t=e.length,n=e.constructor(t);return t&&"string"==typeof e[0]&>.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function le(e){return"function"!=typeof e.constructor||de(e)?{}:W(kt(e))}function ce(e,t,n,r){var i=e.constructor;switch(t){case We:return X(e);case Pe:case Ie:return new i(+e);case Ve:return Y(e,r);case He:case Ge:case Je:case Ke:case Xe:case Ye:case $e:case Ze:case Qe:return te(e,r);case Fe:return $(e,r,n);case Ne:case ze:return new i(e);case Le:return Z(e);case qe:return Q(e,r,n);case Ue:return ee(e)}}function pe(e,t){return!!(t=null==t?Me:t)&&("number"==typeof e||rt.test(e))&&e>-1&&e%1==0&&e<t}function fe(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function he(e){return!!mt&&mt in e}function de(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ht)}function me(e){if(null!=e){try{return vt.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function ve(e){return U(e,!0,!0)}function ge(e,t){return e===t||e!==e&&t!==t}function ye(e){return be(e)&>.call(e,"callee")&&(!St.call(e,"callee")||yt.call(e)==Te)}function _e(e){return null!=e&&we(e.length)&&!xe(e)}function be(e){return Ee(e)&&_e(e)}function xe(e){var t=ke(e)?yt.call(e):"";return t==Re||t==je}function we(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Me}function ke(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ee(e){return!!e&&"object"==typeof e}function Se(e){return _e(e)?B(e):J(e)}function Ce(){return[]}function Ae(){return!1}var De=200,Oe="__lodash_hash_undefined__",Me=9007199254740991,Te="[object Arguments]",Pe="[object Boolean]",Ie="[object Date]",Re="[object Function]",je="[object GeneratorFunction]",Fe="[object Map]",Ne="[object Number]",Be="[object Object]",Le="[object RegExp]",qe="[object Set]",ze="[object String]",Ue="[object Symbol]",We="[object ArrayBuffer]",Ve="[object DataView]",He="[object Float32Array]",Ge="[object Float64Array]",Je="[object Int8Array]",Ke="[object Int16Array]",Xe="[object Int32Array]",Ye="[object Uint8Array]",$e="[object Uint8ClampedArray]",Ze="[object Uint16Array]",Qe="[object Uint32Array]",et=/[\\^$.*+?()[\]{}|]/g,tt=/\w*$/,nt=/^\[object .+?Constructor\]$/,rt=/^(?:0|[1-9]\d*)$/,it={};it[Te]=it["[object Array]"]=it[We]=it[Ve]=it[Pe]=it[Ie]=it[He]=it[Ge]=it[Je]=it[Ke]=it[Xe]=it[Fe]=it[Ne]=it[Be]=it[Le]=it[qe]=it[ze]=it[Ue]=it[Ye]=it[$e]=it[Ze]=it[Qe]=!0,it["[object Error]"]=it[Re]=it["[object WeakMap]"]=!1;var ot="object"==typeof e&&e&&e.Object===Object&&e,at="object"==typeof self&&self&&self.Object===Object&&self,st=ot||at||Function("return this")(),ut="object"==typeof t&&t&&!t.nodeType&&t,lt=ut&&"object"==typeof n&&n&&!n.nodeType&&n,ct=lt&<.exports===ut,pt=Array.prototype,ft=Function.prototype,ht=Object.prototype,dt=st["__core-js_shared__"],mt=function(){var e=/[^.]+$/.exec(dt&&dt.keys&&dt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),vt=ft.toString,gt=ht.hasOwnProperty,yt=ht.toString,_t=RegExp("^"+vt.call(gt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),bt=ct?st.Buffer:void 0,xt=st.Symbol,wt=st.Uint8Array,kt=f(Object.getPrototypeOf,Object),Et=Object.create,St=ht.propertyIsEnumerable,Ct=pt.splice,At=Object.getOwnPropertySymbols,Dt=bt?bt.isBuffer:void 0,Ot=f(Object.keys,Object),Mt=se(st,"DataView"),Tt=se(st,"Map"),Pt=se(st,"Promise"),It=se(st,"Set"),Rt=se(st,"WeakMap"),jt=se(Object,"create"),Ft=me(Mt),Nt=me(Tt),Bt=me(Pt),Lt=me(It),qt=me(Rt),zt=xt?xt.prototype:void 0,Ut=zt?zt.valueOf:void 0;d.prototype.clear=m,d.prototype.delete=v,d.prototype.get=g,d.prototype.has=y,d.prototype.set=_,b.prototype.clear=x,b.prototype.delete=w,b.prototype.get=k,b.prototype.has=E,b.prototype.set=S,C.prototype.clear=A,C.prototype.delete=D,C.prototype.get=O,C.prototype.has=M,C.prototype.set=T,P.prototype.clear=I,P.prototype.delete=R,P.prototype.get=j,P.prototype.has=F,P.prototype.set=N;var Wt=At?f(At,Object):Ce,Vt=H;(Mt&&Vt(new Mt(new ArrayBuffer(1)))!=Ve||Tt&&Vt(new Tt)!=Fe||Pt&&"[object Promise]"!=Vt(Pt.resolve())||It&&Vt(new It)!=qe||Rt&&"[object WeakMap]"!=Vt(new Rt))&&(Vt=function(e){var t=yt.call(e),n=t==Be?e.constructor:void 0,r=n?me(n):void 0;if(r)switch(r){case Ft:return Ve;case Nt:return Fe;case Bt:return"[object Promise]";case Lt:return qe;case qt:return"[object WeakMap]"}return t});var Ht=Array.isArray,Gt=Dt||Ae;n.exports=ve}).call(t,n(17),n(72)(e))},function(e,t,n){(function(t){function n(e){if("string"==typeof e)return e;if(i(e))return y?y.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}function r(e){return!!e&&"object"==typeof e}function i(e){return"symbol"==typeof e||r(e)&&m.call(e)==u}function o(e){return null==e?"":n(e)}function a(e){return e=o(e),e&&c.test(e)?e.replace(l,"\\$&"):e}var s=1/0,u="[object Symbol]",l=/[\\^$.*+?()[\]{}|]/g,c=RegExp(l.source),p="object"==typeof t&&t&&t.Object===Object&&t,f="object"==typeof self&&self&&self.Object===Object&&self,h=p||f||Function("return this")(),d=Object.prototype,m=d.toString,v=h.Symbol,g=v?v.prototype:void 0,y=g?g.toString:void 0;e.exports=a}).call(t,n(17))},function(e,t){function n(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function r(e){return!!e&&"object"==typeof e}function i(e){if(!r(e)||p.call(e)!=o||n(e))return!1;var t=f(e);if(null===t)return!0;var i=l.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&u.call(i)==c}var o="[object Object]",a=Function.prototype,s=Object.prototype,u=a.toString,l=s.hasOwnProperty,c=u.call(Object),p=s.toString,f=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object);e.exports=i},function(e,t,n){(function(e,n){function r(e,t){return e.set(t[0],t[1]),e}function i(e,t){return e.add(t),e}function o(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function a(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););return e}function s(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function u(e,t,n,r){var i=-1,o=e?e.length:0;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function l(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function c(e,t){return null==e?void 0:e[t]}function p(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function f(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function h(e,t){return function(n){return e(t(n))}}function d(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function m(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function v(){this.__data__=Qt?Qt(null):{}}function g(e){return this.has(e)&&delete this.__data__[e]}function y(e){var t=this.__data__;if(Qt){var n=t[e];return n===qe?void 0:n}return It.call(t,e)?t[e]:void 0}function _(e){var t=this.__data__;return Qt?void 0!==t[e]:It.call(t,e)}function b(e,t){return this.__data__[e]=Qt&&void 0===t?qe:t,this}function x(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function w(){this.__data__=[]}function k(e){var t=this.__data__,n=U(t,e);return!(n<0)&&(n==t.length-1?t.pop():Wt.call(t,n,1),!0)}function E(e){var t=this.__data__,n=U(t,e);return n<0?void 0:t[n][1]}function S(e){return U(this.__data__,e)>-1}function C(e,t){var n=this.__data__,r=U(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}function A(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function D(){this.__data__={hash:new m,map:new(Xt||x),string:new m}}function O(e){return he(this,e).delete(e)}function M(e){return he(this,e).get(e)}function T(e){return he(this,e).has(e)}function P(e,t){return he(this,e).set(e,t),this}function I(e){this.__data__=new x(e)}function R(){this.__data__=new x}function j(e){return this.__data__.delete(e)}function F(e){return this.__data__.get(e)}function N(e){return this.__data__.has(e)}function B(e,t){var n=this.__data__;if(n instanceof x){var r=n.__data__;if(!Xt||r.length<Le-1)return r.push([e,t]),this;n=this.__data__=new A(r)}return n.set(e,t),this}function L(e,t){var n=cn(e)||Ce(e)?l(e.length,String):[],r=n.length,i=!!r;for(var o in e)!t&&!It.call(e,o)||i&&("length"==o||ye(o,r))||n.push(o);return n}function q(e,t,n){(void 0===n||Se(e[t],n))&&("number"!=typeof t||void 0!==n||t in e)||(e[t]=n)}function z(e,t,n){var r=e[t];It.call(e,t)&&Se(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function U(e,t){for(var n=e.length;n--;)if(Se(e[n][0],t))return n;return-1}function W(e,t){return e&&ce(t,je(t),e)}function V(e,t,n,r,i,o,s){var u;if(r&&(u=o?r(e,i,o,s):r(e)),void 0!==u)return u;if(!Te(e))return e;var l=cn(e);if(l){if(u=me(e),!t)return le(e,u)}else{var c=ln(e),f=c==He||c==Ge;if(pn(e))return te(e,t);if(c==Xe||c==Ue||f&&!o){if(p(e))return o?e:{};if(u=ve(f?{}:e),!t)return pe(e,W(u,e))}else{if(!gt[c])return o?e:{};u=ge(e,c,V,t)}}s||(s=new I);var h=s.get(e);if(h)return h;if(s.set(e,u),!l)var d=n?fe(e):je(e);return a(d||e,function(i,o){d&&(o=i,i=e[o]),z(u,o,V(i,t,n,r,o,e,s))}),u}function H(e){return Te(e)?zt(e):{}}function G(e,t,n){var r=t(e);return cn(e)?r:s(r,n(e))}function J(e){return jt.call(e)}function K(e){return!(!Te(e)||xe(e))&&(Oe(e)||p(e)?Ft:dt).test(Ee(e))}function X(e){return Pe(e)&&Me(e.length)&&!!vt[jt.call(e)]}function Y(e){if(!we(e))return Gt(e);var t=[];for(var n in Object(e))It.call(e,n)&&"constructor"!=n&&t.push(n);return t}function $(e){if(!Te(e))return ke(e);var t=we(e),n=[];for(var r in e)("constructor"!=r||!t&&It.call(e,r))&&n.push(r);return n}function Z(e,t,n,r,i){if(e!==t){if(!cn(t)&&!fn(t))var o=$(t);a(o||t,function(a,s){if(o&&(s=a,a=t[s]),Te(a))i||(i=new I),Q(e,t,s,n,Z,r,i);else{var u=r?r(e[s],a,s+"",e,t,i):void 0;void 0===u&&(u=a),q(e,s,u)}})}}function Q(e,t,n,r,i,o,a){var s=e[n],u=t[n],l=a.get(u);if(l)return void q(e,n,l);var c=o?o(s,u,n+"",e,t,a):void 0,p=void 0===c;p&&(c=u,cn(u)||fn(u)?cn(s)?c=s:De(s)?c=le(s):(p=!1,c=V(u,!0)):Ie(u)||Ce(u)?Ce(s)?c=Re(s):!Te(s)||r&&Oe(s)?(p=!1,c=V(u,!0)):c=s:p=!1),p&&(a.set(u,c),i(c,u,r,o,a),a.delete(u)),q(e,n,c)}function ee(e,t){return t=Jt(void 0===t?e.length-1:t,0),function(){for(var n=arguments,r=-1,i=Jt(n.length-t,0),a=Array(i);++r<i;)a[r]=n[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=n[r];return s[t]=a,o(e,this,s)}}function te(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}function ne(e){var t=new e.constructor(e.byteLength);return new Lt(t).set(new Lt(e)),t}function re(e,t){var n=t?ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function ie(e,t,n){return u(t?n(f(e),!0):f(e),r,new e.constructor)}function oe(e){var t=new e.constructor(e.source,ht.exec(e));return t.lastIndex=e.lastIndex,t}function ae(e,t,n){return u(t?n(d(e),!0):d(e),i,new e.constructor)}function se(e){return sn?Object(sn.call(e)):{}}function ue(e,t){var n=t?ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function le(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function ce(e,t,n,r){n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],s=r?r(n[a],e[a],a,n,e):void 0;z(n,a,void 0===s?e[a]:s)}return n}function pe(e,t){return ce(e,un(e),t)}function fe(e){return G(e,je,un)}function he(e,t){var n=e.__data__;return be(t)?n["string"==typeof t?"string":"hash"]:n.map}function de(e,t){var n=c(e,t);return K(n)?n:void 0}function me(e){var t=e.length,n=e.constructor(t);return t&&"string"==typeof e[0]&&It.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function ve(e){return"function"!=typeof e.constructor||we(e)?{}:H(qt(e))}function ge(e,t,n,r){var i=e.constructor;switch(t){case tt:return ne(e);case We:case Ve:return new i(+e);case nt:return re(e,r);case rt:case it:case ot:case at:case st:case ut:case lt:case ct:case pt:return ue(e,r);case Je:return ie(e,r,n);case Ke:case Ze:return new i(e);case Ye:return oe(e);case $e:return ae(e,r,n);case Qe:return se(e)}}function ye(e,t){return!!(t=null==t?ze:t)&&("number"==typeof e||mt.test(e))&&e>-1&&e%1==0&&e<t}function _e(e,t,n){if(!Te(n))return!1;var r=typeof t;return!!("number"==r?Ae(n)&&ye(t,n.length):"string"==r&&t in n)&&Se(n[t],e)}function be(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function xe(e){return!!Tt&&Tt in e}function we(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ot)}function ke(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}function Ee(e){if(null!=e){try{return Pt.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Se(e,t){return e===t||e!==e&&t!==t}function Ce(e){return De(e)&&It.call(e,"callee")&&(!Ut.call(e,"callee")||jt.call(e)==Ue)}function Ae(e){return null!=e&&Me(e.length)&&!Oe(e)}function De(e){return Pe(e)&&Ae(e)}function Oe(e){var t=Te(e)?jt.call(e):"";return t==He||t==Ge}function Me(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=ze}function Te(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Pe(e){return!!e&&"object"==typeof e}function Ie(e){if(!Pe(e)||jt.call(e)!=Xe||p(e))return!1;var t=qt(e);if(null===t)return!0;var n=It.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Pt.call(n)==Rt}function Re(e){return ce(e,Fe(e))}function je(e){return Ae(e)?L(e):Y(e)}function Fe(e){return Ae(e)?L(e,!0):$(e)}function Ne(){return[]}function Be(){return!1}var Le=200,qe="__lodash_hash_undefined__",ze=9007199254740991,Ue="[object Arguments]",We="[object Boolean]",Ve="[object Date]",He="[object Function]",Ge="[object GeneratorFunction]",Je="[object Map]",Ke="[object Number]",Xe="[object Object]",Ye="[object RegExp]",$e="[object Set]",Ze="[object String]",Qe="[object Symbol]",et="[object WeakMap]",tt="[object ArrayBuffer]",nt="[object DataView]",rt="[object Float32Array]",it="[object Float64Array]",ot="[object Int8Array]",at="[object Int16Array]",st="[object Int32Array]",ut="[object Uint8Array]",lt="[object Uint8ClampedArray]",ct="[object Uint16Array]",pt="[object Uint32Array]",ft=/[\\^$.*+?()[\]{}|]/g,ht=/\w*$/,dt=/^\[object .+?Constructor\]$/,mt=/^(?:0|[1-9]\d*)$/,vt={};vt[rt]=vt[it]=vt[ot]=vt[at]=vt[st]=vt[ut]=vt[lt]=vt[ct]=vt[pt]=!0,vt[Ue]=vt["[object Array]"]=vt[tt]=vt[We]=vt[nt]=vt[Ve]=vt["[object Error]"]=vt[He]=vt[Je]=vt[Ke]=vt[Xe]=vt[Ye]=vt[$e]=vt[Ze]=vt[et]=!1;var gt={};gt[Ue]=gt["[object Array]"]=gt[tt]=gt[nt]=gt[We]=gt[Ve]=gt[rt]=gt[it]=gt[ot]=gt[at]=gt[st]=gt[Je]=gt[Ke]=gt[Xe]=gt[Ye]=gt[$e]=gt[Ze]=gt[Qe]=gt[ut]=gt[lt]=gt[ct]=gt[pt]=!0,gt["[object Error]"]=gt[He]=gt[et]=!1;var yt="object"==typeof e&&e&&e.Object===Object&&e,_t="object"==typeof self&&self&&self.Object===Object&&self,bt=yt||_t||Function("return this")(),xt="object"==typeof t&&t&&!t.nodeType&&t,wt=xt&&"object"==typeof n&&n&&!n.nodeType&&n,kt=wt&&wt.exports===xt,Et=kt&&yt.process,St=function(){try{return Et&&Et.binding("util")}catch(e){}}(),Ct=St&&St.isTypedArray,At=Array.prototype,Dt=Function.prototype,Ot=Object.prototype,Mt=bt["__core-js_shared__"],Tt=function(){var e=/[^.]+$/.exec(Mt&&Mt.keys&&Mt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Pt=Dt.toString,It=Ot.hasOwnProperty,Rt=Pt.call(Object),jt=Ot.toString,Ft=RegExp("^"+Pt.call(It).replace(ft,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Nt=kt?bt.Buffer:void 0,Bt=bt.Symbol,Lt=bt.Uint8Array,qt=h(Object.getPrototypeOf,Object),zt=Object.create,Ut=Ot.propertyIsEnumerable,Wt=At.splice,Vt=Object.getOwnPropertySymbols,Ht=Nt?Nt.isBuffer:void 0,Gt=h(Object.keys,Object),Jt=Math.max,Kt=de(bt,"DataView"),Xt=de(bt,"Map"),Yt=de(bt,"Promise"),$t=de(bt,"Set"),Zt=de(bt,"WeakMap"),Qt=de(Object,"create"),en=Ee(Kt),tn=Ee(Xt),nn=Ee(Yt),rn=Ee($t),on=Ee(Zt),an=Bt?Bt.prototype:void 0,sn=an?an.valueOf:void 0;m.prototype.clear=v,m.prototype.delete=g,m.prototype.get=y,m.prototype.has=_,m.prototype.set=b,x.prototype.clear=w,x.prototype.delete=k,x.prototype.get=E,x.prototype.has=S,x.prototype.set=C,A.prototype.clear=D,A.prototype.delete=O,A.prototype.get=M,A.prototype.has=T,A.prototype.set=P,I.prototype.clear=R,I.prototype.delete=j,I.prototype.get=F,I.prototype.has=N,I.prototype.set=B;var un=Vt?h(Vt,Object):Ne,ln=J;(Kt&&ln(new Kt(new ArrayBuffer(1)))!=nt||Xt&&ln(new Xt)!=Je||Yt&&"[object Promise]"!=ln(Yt.resolve())||$t&&ln(new $t)!=$e||Zt&&ln(new Zt)!=et)&&(ln=function(e){var t=jt.call(e),n=t==Xe?e.constructor:void 0,r=n?Ee(n):void 0;if(r)switch(r){case en:return nt;case tn:return Je;case nn:return"[object Promise]";case rn:return $e;case on:return et}return t});var cn=Array.isArray,pn=Ht||Be,fn=Ct?function(e){return function(t){return e(t)}}(Ct):X,hn=function(e){return ee(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&_e(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,o)}return t})}(function(e,t,n,r){Z(e,t,n,r)});n.exports=hn}).call(t,n(17),n(72)(e))},function(e,t,n){var r=n(67),i=n(43),o=r(i,"DataView");e.exports=o},function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var i=n(900),o=n(901),a=n(902),s=n(903),u=n(904);r.prototype.clear=i,r.prototype.delete=o,r.prototype.get=a,r.prototype.has=s,r.prototype.set=u,e.exports=r},function(e,t,n){var r=n(67),i=n(43),o=r(i,"Promise");e.exports=o},function(e,t,n){var r=n(67),i=n(43),o=r(i,"Set");e.exports=o},function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new i;++t<n;)this.add(e[t])}var i=n(214),o=n(927),a=n(928);r.prototype.add=r.prototype.push=o,r.prototype.has=a,e.exports=r},function(e,t,n){var r=n(67),i=n(43),o=r(i,"WeakMap");e.exports=o},function(e,t){function n(e,t){return e.set(t[0],t[1]),e}e.exports=n},function(e,t){function n(e,t){return e.add(t),e}e.exports=n},function(e,t){function n(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}e.exports=n},function(e,t){function n(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}e.exports=n},function(e,t){function n(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}e.exports=n},function(e,t){function n(e){return e.split("")}e.exports=n},function(e,t){function n(e){return e.match(r)||[]}var r=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=n},function(e,t,n){function r(e,t){return e&&i(t,o(t),e)}var i=n(84),o=n(59);e.exports=r},function(e,t,n){function r(e,t){return e&&i(t,o(t),e)}var i=n(84),o=n(424);e.exports=r},function(e,t){function n(e,t,n){return e===e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}e.exports=n},function(e,t,n){var r=n(38),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},function(e,t,n){function r(e,t){var n=[];return i(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}var i=n(217);e.exports=r},function(e,t){function n(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}e.exports=n},function(e,t,n){function r(e,t,n,a,s){var u=-1,l=e.length;for(n||(n=o),s||(s=[]);++u<l;){var c=e[u];t>0&&n(c)?t>1?r(c,t-1,n,a,s):i(s,c):a||(s[s.length]=c)}return s}var i=n(216),o=n(908);e.exports=r},function(e,t,n){var r=n(888),i=r();e.exports=i},function(e,t,n){function r(e,t){return e&&i(e,t,o)}var i=n(848),o=n(59);e.exports=r},function(e,t){function n(e,t){return null!=e&&t in Object(e)}e.exports=n},function(e,t,n){function r(e){return o(e)&&i(e)==a}var i=n(66),o=n(68),a="[object Arguments]";e.exports=r},function(e,t,n){function r(e,t,n,r,v,y){var _=l(e),b=l(t),x=d,w=d;_||(x=u(e),x=x==h?m:x),b||(w=u(t),w=w==h?m:w);var k=x==m,E=w==m,S=x==w;if(S&&c(e)){if(!c(t))return!1;_=!0,k=!1}if(S&&!k)return y||(y=new i),_||p(e)?o(e,t,n,r,v,y):a(e,t,x,n,r,v,y);if(!(n&f)){var C=k&&g.call(e,"__wrapped__"),A=E&&g.call(t,"__wrapped__");if(C||A){var D=C?e.value():e,O=A?t.value():t;return y||(y=new i),v(D,O,n,r,y)}}return!!S&&(y||(y=new i),s(e,t,n,r,v,y))}var i=n(215),o=n(404),a=n(892),s=n(893),u=n(409),l=n(20),c=n(227),p=n(423),f=1,h="[object Arguments]",d="[object Array]",m="[object Object]",v=Object.prototype,g=v.hasOwnProperty;e.exports=r},function(e,t,n){function r(e,t,n,r){var u=n.length,l=u,c=!r;if(null==e)return!l;for(e=Object(e);u--;){var p=n[u];if(c&&p[2]?p[1]!==e[p[0]]:!(p[0]in e))return!1}for(;++u<l;){p=n[u];var f=p[0],h=e[f],d=p[1];if(c&&p[2]){if(void 0===h&&!(f in e))return!1}else{var m=new i;if(r)var v=r(h,d,f,e,t,m);if(!(void 0===v?o(d,h,a|s,r,m):v))return!1}}return!0}var i=n(215),o=n(399),a=1,s=2;e.exports=r},function(e,t,n){function r(e){return!(!a(e)||o(e))&&(i(e)?d:l).test(s(e))}var i=n(420),o=n(910),a=n(38),s=n(418),u=/[\\^$.*+?()[\]{}|]/g,l=/^\[object .+?Constructor\]$/,c=Function.prototype,p=Object.prototype,f=c.toString,h=p.hasOwnProperty,d=RegExp("^"+f.call(h).replace(u,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=r},function(e,t,n){function r(e){return a(e)&&o(e.length)&&!!s[i(e)]}var i=n(66),o=n(228),a=n(68),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=r},function(e,t,n){function r(e){if(!i(e))return o(e);var t=[];for(var n in Object(e))s.call(e,n)&&"constructor"!=n&&t.push(n);return t}var i=n(153),o=n(922),a=Object.prototype,s=a.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){if(!i(e))return a(e);var t=o(e),n=[];for(var r in e)("constructor"!=r||!t&&u.call(e,r))&&n.push(r);return n}var i=n(38),o=n(153),a=n(923),s=Object.prototype,u=s.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){var t=o(e);return 1==t.length&&t[0][2]?a(t[0][0],t[0][1]):function(n){return n===e||i(n,e,t)}}var i=n(853),o=n(895),a=n(414);e.exports=r},function(e,t,n){function r(e,t){return s(e)&&u(t)?l(c(e),t):function(n){var r=o(n,e);return void 0===r&&r===t?a(n,e):i(t,r,p|f)}}var i=n(399),o=n(224),a=n(419),s=n(221),u=n(412),l=n(414),c=n(85),p=1,f=2;e.exports=r},function(e,t,n){function r(e,t){return e=Object(e),i(e,t,function(t,n){return o(e,n)})}var i=n(861),o=n(419);e.exports=r},function(e,t,n){function r(e,t,n){for(var r=-1,s=t.length,u={};++r<s;){var l=t[r],c=i(e,l);n(c,l)&&o(u,a(l,e),c)}return u}var i=n(150),o=n(867),a=n(83);e.exports=r},function(e,t){function n(e){return function(t){return null==t?void 0:t[e]}}e.exports=n},function(e,t,n){function r(e){return function(t){return i(t,e)}}var i=n(150);e.exports=r},function(e,t){function n(e){return function(t){return null==e?void 0:e[t]}}e.exports=n},function(e,t){function n(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}e.exports=n},function(e,t,n){function r(e,t){return a(o(e,t,i),e+"")}var i=n(225),o=n(415),a=n(417);e.exports=r},function(e,t,n){function r(e,t,n,r){if(!s(e))return e;t=o(t,e);for(var l=-1,c=t.length,p=c-1,f=e;null!=f&&++l<c;){var h=u(t[l]),d=n;if(l!=p){var m=f[h];d=r?r(m,h,f):void 0,void 0===d&&(d=s(m)?m:a(t[l+1])?[]:{})}i(f,h,d),f=f[h]}return e}var i=n(148),o=n(83),a=n(152),s=n(38),u=n(85);e.exports=r},function(e,t,n){var r=n(943),i=n(403),o=n(225),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},function(e,t,n){function r(e,t){var n;return i(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}var i=n(217);e.exports=r},function(e,t){function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}e.exports=n},function(e,t){function n(e){return function(t){return e(t)}}e.exports=n},function(e,t,n){function r(e,t){return t=i(t,e),null==(e=a(e,t))||delete e[s(o(t))]}var i=n(83),o=n(947),a=n(926),s=n(85);e.exports=r},function(e,t){function n(e,t){return e.has(t)}e.exports=n},function(e,t,n){function r(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:i(e,t,n)}var i=n(400);e.exports=r},function(e,t,n){(function(e){function r(e,t){if(t)return e.slice();var n=e.length,r=l?l(n):new e.constructor(n);return e.copy(r),r}var i=n(43),o="object"==typeof t&&t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===o,u=s?i.Buffer:void 0,l=u?u.allocUnsafe:void 0;e.exports=r}).call(t,n(72)(e))},function(e,t,n){function r(e,t){var n=t?i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var i=n(218);e.exports=r},function(e,t,n){function r(e,t,n){var r=t?n(a(e),s):a(e);return o(r,i,new e.constructor)}var i=n(834),o=n(147),a=n(413),s=1;e.exports=r},function(e,t){function n(e){var t=new e.constructor(e.source,r.exec(e));return t.lastIndex=e.lastIndex,t}var r=/\w*$/;e.exports=n},function(e,t,n){function r(e,t,n){var r=t?n(a(e),s):a(e);return o(r,i,new e.constructor)}var i=n(835),o=n(147),a=n(416),s=1;e.exports=r},function(e,t,n){function r(e){return a?Object(a.call(e)):{}}var i=n(82),o=i?i.prototype:void 0,a=o?o.valueOf:void 0;e.exports=r},function(e,t,n){function r(e,t){var n=t?i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var i=n(218);e.exports=r},function(e,t){function n(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}e.exports=n},function(e,t,n){function r(e,t){return i(e,o(e),t)}var i=n(84),o=n(220);e.exports=r},function(e,t,n){function r(e,t){return i(e,o(e),t)}var i=n(84),o=n(408);e.exports=r},function(e,t,n){var r=n(43),i=r["__core-js_shared__"];e.exports=i},function(e,t,n){function r(e){return i(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,s&&o(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var u=n[r];u&&e(t,u,r,a)}return t})}var i=n(866),o=n(411);e.exports=r},function(e,t,n){function r(e,t){return function(n,r){if(null==n)return n;if(!i(n))return e(n,r);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a<o)&&!1!==r(s[a],a,s););return n}}var i=n(86);e.exports=r},function(e,t){function n(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===n(o[u],u,o))break}return t}}e.exports=n},function(e,t,n){function r(e){return function(t){t=s(t);var n=o(t)?a(t):void 0,r=n?n[0]:t.charAt(0),u=n?i(n,1).join(""):t.slice(1);return r[e]()+u}}var i=n(874),o=n(410),a=n(935),s=n(87);e.exports=r},function(e,t,n){function r(e){return function(t,n,r){var s=Object(t);if(!o(t)){var u=i(n,3);t=a(t),n=function(e){return u(s[e],e,s)}}var l=e(t,n,r);return l>-1?s[u?t[l]:l]:void 0}}var i=n(119),o=n(86),a=n(59);e.exports=r},function(e,t,n){var r=n(864),i={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},o=r(i);e.exports=o},function(e,t,n){function r(e,t,n,r,i,k,S){switch(n){case w:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case x:return!(e.byteLength!=t.byteLength||!k(new o(e),new o(t)));case f:case h:case v:return a(+e,+t);case d:return e.name==t.name&&e.message==t.message;case g:case _:return e==t+"";case m:var C=u;case y:var A=r&c;if(C||(C=l),e.size!=t.size&&!A)return!1;var D=S.get(e);if(D)return D==t;r|=p,S.set(e,t);var O=s(C(e),C(t),r,i,k,S);return S.delete(e),O;case b:if(E)return E.call(e)==E.call(t)}return!1}var i=n(82),o=n(392),a=n(120),s=n(404),u=n(413),l=n(416),c=1,p=2,f="[object Boolean]",h="[object Date]",d="[object Error]",m="[object Map]",v="[object Number]",g="[object RegExp]",y="[object Set]",_="[object String]",b="[object Symbol]",x="[object ArrayBuffer]",w="[object DataView]",k=i?i.prototype:void 0,E=k?k.valueOf:void 0;e.exports=r},function(e,t,n){function r(e,t,n,r,a,u){var l=n&o,c=i(e),p=c.length;if(p!=i(t).length&&!l)return!1;for(var f=p;f--;){var h=c[f];if(!(l?h in t:s.call(t,h)))return!1}var d=u.get(e);if(d&&u.get(t))return d==t;var m=!0;u.set(e,t),u.set(t,e);for(var v=l;++f<p;){h=c[f];var g=e[h],y=t[h];if(r)var _=l?r(y,g,h,t,e,u):r(g,y,h,e,t,u);if(!(void 0===_?g===y||a(g,y,n,r,u):_)){m=!1;break}v||(v="constructor"==h)}if(m&&!v){var b=e.constructor,x=t.constructor;b!=x&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof x&&x instanceof x)&&(m=!1)}return u.delete(e),u.delete(t),m}var i=n(59),o=1,a=Object.prototype,s=a.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){return i(e,a,o)}var i=n(398),o=n(220),a=n(59);e.exports=r},function(e,t,n){function r(e){for(var t=o(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,i(a)]}return t}var i=n(412),o=n(59);e.exports=r},function(e,t,n){function r(e){var t=a.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[u]=n:delete e[u]),i}var i=n(82),o=Object.prototype,a=o.hasOwnProperty,s=o.toString,u=i?i.toStringTag:void 0;e.exports=r},function(e,t){function n(e,t){return null==e?void 0:e[t]}e.exports=n},function(e,t,n){function r(e,t,n){t=i(t,e);for(var r=-1,c=t.length,p=!1;++r<c;){var f=l(t[r]);if(!(p=null!=e&&n(e,f)))break;e=e[f]}return p||++r!=c?p:!!(c=null==e?0:e.length)&&u(c)&&s(f,c)&&(a(e)||o(e))}var i=n(83),o=n(226),a=n(20),s=n(152),u=n(228),l=n(85);e.exports=r},function(e,t){function n(e){return r.test(e)}var r=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=n},function(e,t,n){function r(){this.__data__=i?i(null):{},this.size=0}var i=n(154);e.exports=r},function(e,t){function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}e.exports=n},function(e,t,n){function r(e){var t=this.__data__;if(i){var n=t[e];return n===o?void 0:n}return s.call(t,e)?t[e]:void 0}var i=n(154),o="__lodash_hash_undefined__",a=Object.prototype,s=a.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){var t=this.__data__;return i?void 0!==t[e]:a.call(t,e)}var i=n(154),o=Object.prototype,a=o.hasOwnProperty;e.exports=r},function(e,t,n){function r(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=i&&void 0===t?o:t,this}var i=n(154),o="__lodash_hash_undefined__";e.exports=r},function(e,t){function n(e){var t=e.length,n=e.constructor(t);return t&&"string"==typeof e[0]&&i.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var r=Object.prototype,i=r.hasOwnProperty;e.exports=n},function(e,t,n){function r(e,t,n,r){var M=e.constructor;switch(t){case _:return i(e);case p:case f:return new M(+e);case b:return o(e,r);case x:case w:case k:case E:case S:case C:case A:case D:case O:return c(e,r);case h:return a(e,r,n);case d:case g:return new M(e);case m:return s(e);case v:return u(e,r,n);case y:return l(e)}}var i=n(218),o=n(876),a=n(877),s=n(878),u=n(879),l=n(880),c=n(881),p="[object Boolean]",f="[object Date]",h="[object Map]",d="[object Number]",m="[object RegExp]",v="[object Set]",g="[object String]",y="[object Symbol]",_="[object ArrayBuffer]",b="[object DataView]",x="[object Float32Array]",w="[object Float64Array]",k="[object Int8Array]",E="[object Int16Array]",S="[object Int32Array]",C="[object Uint8Array]",A="[object Uint8ClampedArray]",D="[object Uint16Array]",O="[object Uint32Array]";e.exports=r},function(e,t,n){function r(e){return"function"!=typeof e.constructor||a(e)?{}:i(o(e))}var i=n(844),o=n(219),a=n(153);e.exports=r},function(e,t,n){function r(e){return a(e)||o(e)||!!(s&&e&&e[s])}var i=n(82),o=n(226),a=n(20),s=i?i.isConcatSpreadable:void 0;e.exports=r},function(e,t){function n(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}e.exports=n},function(e,t,n){function r(e){return!!o&&o in e}var i=n(885),o=function(){var e=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.exports=r},function(e,t){function n(){this.__data__=[],this.size=0}e.exports=n},function(e,t,n){function r(e){var t=this.__data__,n=i(t,e);return!(n<0)&&(n==t.length-1?t.pop():a.call(t,n,1),--this.size,!0)}var i=n(149),o=Array.prototype,a=o.splice;e.exports=r},function(e,t,n){function r(e){var t=this.__data__,n=i(t,e);return n<0?void 0:t[n][1]}var i=n(149);e.exports=r},function(e,t,n){function r(e){return i(this.__data__,e)>-1}var i=n(149);e.exports=r},function(e,t,n){function r(e,t){var n=this.__data__,r=i(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var i=n(149);e.exports=r},function(e,t,n){function r(){this.size=0,this.__data__={hash:new i,map:new(a||o),string:new i}}var i=n(829),o=n(146),a=n(213);e.exports=r},function(e,t,n){function r(e){var t=i(this,e).delete(e);return this.size-=t?1:0,t}var i=n(151);e.exports=r},function(e,t,n){function r(e){return i(this,e).get(e)}var i=n(151);e.exports=r},function(e,t,n){function r(e){return i(this,e).has(e)}var i=n(151);e.exports=r},function(e,t,n){function r(e,t){var n=i(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var i=n(151);e.exports=r},function(e,t,n){function r(e){var t=i(e,function(e){return n.size===o&&n.clear(),e}),n=t.cache;return t}var i=n(425),o=500;e.exports=r},function(e,t,n){var r=n(222),i=r(Object.keys,Object);e.exports=i},function(e,t){function n(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}e.exports=n},function(e,t,n){(function(e){var r=n(406),i="object"==typeof t&&t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===i,s=a&&r.process,u=function(){try{return s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=u}).call(t,n(72)(e))},function(e,t){function n(e){return i.call(e)}var r=Object.prototype,i=r.toString;e.exports=n},function(e,t,n){function r(e,t){return t.length<2?e:i(e,o(t,0,-1))}var i=n(150),o=n(400);e.exports=r},function(e,t){function n(e){return this.__data__.set(e,r),this}var r="__lodash_hash_undefined__";e.exports=n},function(e,t){function n(e){return this.__data__.has(e)}e.exports=n},function(e,t){function n(e){var t=0,n=0;return function(){var a=o(),s=i-(a-n);if(n=a,s>0){if(++t>=r)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var r=800,i=16,o=Date.now;e.exports=n},function(e,t,n){function r(){this.__data__=new i,this.size=0}var i=n(146);e.exports=r},function(e,t){function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}e.exports=n},function(e,t){function n(e){return this.__data__.get(e)}e.exports=n},function(e,t){function n(e){return this.__data__.has(e)}e.exports=n},function(e,t,n){function r(e,t){var n=this.__data__;if(n instanceof i){var r=n.__data__;if(!o||r.length<s-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new a(r)}return n.set(e,t),this.size=n.size,this}var i=n(146),o=n(213),a=n(214),s=200;e.exports=r},function(e,t,n){function r(e){return o(e)?a(e):i(e)}var i=n(839),o=n(410),a=n(937);e.exports=r},function(e,t,n){var r=n(921),i=/^\./,o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,s=r(function(e){var t=[];return i.test(e)&&t.push(""),e.replace(o,function(e,n,r,i){t.push(r?i.replace(a,"$1"):n||e)}),t});e.exports=s},function(e,t){function n(e){return e.match(p)||[]}var r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",u="(?:\\u200d(?:"+["[^\\ud800-\\udfff]",o,a].join("|")+")[\\ufe0e\\ufe0f]?"+s+")*",l="[\\ufe0e\\ufe0f]?"+s+u,c="(?:"+["[^\\ud800-\\udfff]"+r+"?",r,o,a,"[\\ud800-\\udfff]"].join("|")+")",p=RegExp(i+"(?="+i+")|"+c+l,"g");e.exports=n},function(e,t){function n(e){return e.match(m)||[]}var r="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",i="["+r+"]",o="[a-z\\xdf-\\xf6\\xf8-\\xff]",a="[^\\ud800-\\udfff"+r+"\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",s="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",l="[A-Z\\xc0-\\xd6\\xd8-\\xde]",c="(?:"+o+"|"+a+")",p="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",f="(?:\\u200d(?:"+["[^\\ud800-\\udfff]",s,u].join("|")+")[\\ufe0e\\ufe0f]?"+p+")*",h="[\\ufe0e\\ufe0f]?"+p+f,d="(?:"+["[\\u2700-\\u27bf]",s,u].join("|")+")"+h,m=RegExp([l+"?"+o+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[i,l,"$"].join("|")+")","(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[i,l+c,"$"].join("|")+")",l+"?"+c+"+(?:['’](?:d|ll|m|re|s|t|ve))?",l+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)","\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)","\\d+",d].join("|"),"g");e.exports=n},function(e,t,n){var r=n(148),i=n(84),o=n(886),a=n(86),s=n(153),u=n(59),l=Object.prototype,c=l.hasOwnProperty,p=o(function(e,t){if(s(t)||a(t))return void i(t,u(t),e);for(var n in t)c.call(t,n)&&r(e,n,t[n])});e.exports=p},function(e,t,n){var r=n(941),i=n(402),o=i(function(e,t,n){return t=t.toLowerCase(),e+(n?r(t):t)});e.exports=o},function(e,t,n){function r(e){return o(i(e).toLowerCase())}var i=n(87),o=n(428);e.exports=r},function(e,t,n){function r(e){return i(e,o|a)}var i=n(397),o=1,a=4;e.exports=r},function(e,t){function n(e){return function(){return e}}e.exports=n},function(e,t,n){function r(e){return(e=o(e))&&e.replace(a,i).replace(s,"")}var i=n(891),o=n(87),a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,s=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=r},function(e,t,n){function r(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var u=null==n?0:a(n);return u<0&&(u=s(r+u,0)),i(e,o(t,3),u)}var i=n(846),o=n(119),a=n(427),s=Math.max;e.exports=r},function(e,t,n){function r(e){return(null==e?0:e.length)?i(e,1):[]}var i=n(847);e.exports=r},function(e,t){function n(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}e.exports=n},function(e,t,n){var r=n(402),i=r(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()});e.exports=i},function(e,t){function n(e){if("function"!=typeof e)throw new TypeError(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}var r="Expected a function";e.exports=n},function(e,t,n){var r=n(394),i=n(397),o=n(872),a=n(83),s=n(84),u=n(405),l=n(407),c=u(function(e,t){var n={};if(null==e)return n;var u=!1;t=r(t,function(t){return t=a(t,e),u||(u=t.length>1),t}),s(e,l(e),n),u&&(n=i(n,7));for(var c=t.length;c--;)o(n,t[c]);return n});e.exports=c},function(e,t,n){var r=n(860),i=n(405),o=i(function(e,t){return null==e?{}:r(e,t)});e.exports=o},function(e,t,n){function r(e){return a(e)?i(s(e)):o(e)}var i=n(862),o=n(863),a=n(221),s=n(85);e.exports=r},function(e,t,n){function r(e,t,n){var r=u(e)?i:s,l=arguments.length<3;return r(e,a(t,4),n,l,o)}var i=n(147),o=n(217),a=n(119),s=n(865),u=n(20);e.exports=r},function(e,t,n){function r(e,t){return(s(e)?i:o)(e,u(a(t,3)))}var i=n(838),o=n(845),a=n(119),s=n(20),u=n(949);e.exports=r},function(e,t,n){function r(e,t,n){var r=s(e)?i:a;return n&&u(e,t,n)&&(t=void 0),r(e,o(t,3))}var i=n(395),o=n(119),a=n(869),s=n(20),u=n(411);e.exports=r},function(e,t,n){function r(e,t,n){return e=s(e),n=i(a(n),0,e.length),t=o(t),e.slice(n,n+t.length)==t}var i=n(843),o=n(401),a=n(427),s=n(87);e.exports=r},function(e,t){function n(){return!1}e.exports=n},function(e,t,n){function r(e){if(!e)return 0===e?e:0;if((e=i(e))===o||e===-o){return(e<0?-1:1)*a}return e===e?e:0}var i=n(959),o=1/0,a=1.7976931348623157e308;e.exports=r},function(e,t,n){function r(e){if("number"==typeof e)return e;if(o(e))return a;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(s,"");var n=l.test(e);return n||c.test(e)?p(e.slice(2),n?2:8):u.test(e)?a:+e}var i=n(38),o=n(155),a=NaN,s=/^\s+|\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,p=parseInt;e.exports=r},function(e,t,n){function r(e,t,n){return e=a(e),t=n?void 0:t,void 0===t?o(e)?s(e):i(e):e.match(t)||[]}var i=n(840),o=n(899),a=n(87),s=n(938);e.exports=r},function(e,t,n){"use strict";var r=n(65),i=Object.create,o=Object.prototype.hasOwnProperty;e.exports=function(e){var t,n=0,a=1,s=i(null),u=i(null),l=0;return e=r(e),{hit:function(r){var i=u[r],c=++l;if(s[c]=r,u[r]=c,!i){if(++n<=e)return;return r=s[a],t(r),r}if(delete s[i],a===i)for(;!o.call(s,++a);)continue},delete:t=function(e){var t=u[e];if(t&&(delete s[t],delete u[e],--n,a===t)){if(!n)return l=0,void(a=1);for(;!o.call(s,++a);)continue}},clear:function(){n=0,a=1,s=i(null),u=i(null),l=0}}}},function(e,t,n){"use strict";var r=n(207),i=n(374),o=n(375),a=n(371),s=n(229),u=Array.prototype.slice,l=Function.prototype.apply,c=Object.create,p=Object.prototype.hasOwnProperty;n(69).async=function(e,t){var n,f,h,d=c(null),m=c(null),v=t.memoized,g=t.original;t.memoized=a(function(e){var t=arguments,r=t[t.length-1];return"function"==typeof r&&(n=r,t=u.call(t,0,-1)),v.apply(f=this,h=t)},v);try{o(t.memoized,v)}catch(e){}t.on("get",function(e){var r,i,o;if(n){if(d[e])return"function"==typeof d[e]?d[e]=[d[e],n]:d[e].push(n),void(n=null);r=n,i=f,o=h,n=f=h=null,s(function(){var a;p.call(m,e)?(a=m[e],t.emit("getasync",e,o,i),l.call(r,a.context,a.args)):(n=r,f=i,h=o,v.apply(i,o))})}}),t.original=function(){var e,i,o,a;return n?(e=r(arguments),i=function e(n){var i,o,u=e.id;return null==u?void s(l.bind(e,this,arguments)):(delete e.id,i=d[u],delete d[u],i?(o=r(arguments),t.has(u)&&(n?t.delete(u):(m[u]={context:this,args:o},t.emit("setasync",u,"function"==typeof i?1:i.length))),"function"==typeof i?a=l.call(i,this,o):i.forEach(function(e){a=l.call(e,this,o)},this),a):void 0)},o=n,n=f=h=null,e.push(i),a=l.call(g,this,e),i.cb=o,n=i,a):l.call(g,this,arguments)},t.on("set",function(e){if(!n)return void t.delete(e);d[e]?"function"==typeof d[e]?d[e]=[d[e],n.cb]:d[e].push(n.cb):d[e]=n.cb,delete n.cb,n.id=e,n=null}),t.on("delete",function(e){var n;p.call(d,e)||m[e]&&(n=m[e],delete m[e],t.emit("deleteasync",e,u.call(n.args,1)))}),t.on("clear",function(){var e=m;m=c(null),t.emit("clearasync",i(e,function(e){return u.call(e.args,1)}))})}},function(e,t,n){"use strict";var r=n(58),i=n(142),o=n(69),a=Function.prototype.apply;o.dispose=function(e,t,n){var s;if(r(e),n.async&&o.async||n.promise&&o.promise)return t.on("deleteasync",s=function(t,n){a.call(e,null,n)}),void t.on("clearasync",function(e){i(e,function(e,t){s(t,e)})});t.on("delete",s=function(t,n){e(n)}),t.on("clear",function(e){i(e,function(e,t){s(t,e)})})}},function(e,t,n){"use strict";var r=n(207),i=n(142),o=n(229),a=n(386),s=n(1186),u=n(69),l=Function.prototype,c=Math.max,p=Math.min,f=Object.create;u.maxAge=function(e,t,n){var h,d,m,v;(e=s(e))&&(h=f(null),d=n.async&&u.async||n.promise&&u.promise?"async":"",t.on("set"+d,function(n){h[n]=setTimeout(function(){t.delete(n)},e),v&&(v[n]&&"nextTick"!==v[n]&&clearTimeout(v[n]),v[n]=setTimeout(function(){delete v[n]},m))}),t.on("delete"+d,function(e){clearTimeout(h[e]),delete h[e],v&&("nextTick"!==v[e]&&clearTimeout(v[e]),delete v[e])}),n.preFetch&&(m=!0===n.preFetch||isNaN(n.preFetch)?.333:c(p(Number(n.preFetch),1),0))&&(v={},m=(1-m)*e,t.on("get"+d,function(e,i,s){v[e]||(v[e]="nextTick",o(function(){var o;"nextTick"===v[e]&&(delete v[e],t.delete(e),n.async&&(i=r(i),i.push(l)),o=t.memoized.apply(s,i),n.promise&&a(o)&&("function"==typeof o.done?o.done(l,l):o.then(l,l)))}))})),t.on("clear"+d,function(){i(h,function(e){clearTimeout(e)}),h={},v&&(i(v,function(e){"nextTick"!==e&&clearTimeout(e)}),v={})}))}},function(e,t,n){"use strict";var r=n(65),i=n(961),o=n(69);o.max=function(e,t,n){var a,s,u;(e=r(e))&&(s=i(e),a=n.async&&o.async||n.promise&&o.promise?"async":"",t.on("set"+a,u=function(e){void 0!==(e=s.hit(e))&&t.delete(e)}),t.on("get"+a,u),t.on("delete"+a,s.delete),t.on("clear"+a,s.clear))}},function(e,t,n){"use strict";var r=n(374),i=n(386),o=n(229),a=Object.create,s=Object.prototype.hasOwnProperty;n(69).promise=function(e,t){var n=a(null),u=a(null),l=a(null);t.on("set",function(r,a,s){if(!i(s))return u[r]=s,void t.emit("setasync",r,1);n[r]=1,l[r]=s;var c=function(e){var i=n[r];i&&(delete n[r],u[r]=e,t.emit("setasync",r,i))},p=function(){n[r]&&(delete n[r],delete l[r],t.delete(r))};"then"!==e&&"function"==typeof s.done?"done"!==e&&"function"==typeof s.finally?(s.done(c),s.finally(p)):s.done(c,p):s.then(function(e){o(c.bind(this,e))},function(){o(p)})}),t.on("get",function(e,r,a){var s;if(n[e])return void++n[e];s=l[e];var u=function(){t.emit("getasync",e,r,a)};i(s)?"function"==typeof s.done?s.done(u):s.then(function(){o(u)}):u()}),t.on("delete",function(e){if(delete l[e],n[e])return void delete n[e];if(s.call(u,e)){var r=u[e];delete u[e],t.emit("deleteasync",e,[r])}}),t.on("clear",function(){var e=u;u=a(null),n=a(null),l=a(null),t.emit("clearasync",r(e,function(e){return[e]}))})}},function(e,t,n){"use strict";var r=n(141),i=n(69),o=Object.create,a=Object.defineProperties;i.refCounter=function(e,t,n){var s,u;s=o(null),u=n.async&&i.async||n.promise&&i.promise?"async":"",t.on("set"+u,function(e,t){s[e]=t||1}),t.on("get"+u,function(e){++s[e]}),t.on("delete"+u,function(e){delete s[e]}),t.on("clear"+u,function(){s={}}),a(t.memoized,{deleteRef:r(function(){var e=t.get(arguments);return null===e?null:s[e]?!--s[e]&&(t.delete(e),!0):null}),getRefCount:r(function(){var e=t.get(arguments);return null===e?0:s[e]?s[e]:0})})}},function(e,t,n){"use strict";var r=n(376),i=n(431),o=n(977);e.exports=function(e){var t,a=r(arguments[1]);return a.normalizer||0!==(t=a.length=i(a.length,e.length,a.async))&&(a.primitive?!1===t?a.normalizer=n(976):t>1&&(a.normalizer=n(974)(t)):a.normalizer=!1===t?n(975)():1===t?n(972)():n(973)(t)),a.async&&n(962),a.promise&&n(966),a.dispose&&n(963),a.maxAge&&n(964),a.max&&n(965),a.refCounter&&n(967),o(e,a)}},function(e,t,n){"use strict";var r=n(716),i=n(371),o=n(141),a=n(744).methods,s=n(971),u=n(970),l=Function.prototype.apply,c=Function.prototype.call,p=Object.create,f=Object.prototype.hasOwnProperty,h=Object.defineProperties,d=a.on,m=a.emit;e.exports=function(e,t,n){var a,v,g,y,_,b,x,w,k,E,S,C,A,D=p(null);return v=!1!==t?t:isNaN(e.length)?1:e.length,n.normalizer&&(w=u(n.normalizer),g=w.get,y=w.set,_=w.delete,b=w.clear),null!=n.resolvers&&(A=s(n.resolvers)),C=g?i(function(t){var n,i,o=arguments;if(A&&(o=A(o)),null!==(n=g(o))&&f.call(D,n))return k&&a.emit("get",n,o,this),D[n];if(i=1===o.length?c.call(e,this,o[0]):l.call(e,this,o),null===n){if(null!==(n=g(o)))throw r("Circular invocation","CIRCULAR_INVOCATION");n=y(o)}else if(f.call(D,n))throw r("Circular invocation","CIRCULAR_INVOCATION");return D[n]=i,E&&a.emit("set",n,null,i),i},v):0===t?function(){var t;if(f.call(D,"data"))return k&&a.emit("get","data",arguments,this),D.data;if(t=arguments.length?l.call(e,this,arguments):c.call(e,this),f.call(D,"data"))throw r("Circular invocation","CIRCULAR_INVOCATION");return D.data=t,E&&a.emit("set","data",null,t),t}:function(t){var n,i,o=arguments;if(A&&(o=A(arguments)),i=String(o[0]),f.call(D,i))return k&&a.emit("get",i,o,this),D[i];if(n=1===o.length?c.call(e,this,o[0]):l.call(e,this,o),f.call(D,i))throw r("Circular invocation","CIRCULAR_INVOCATION");return D[i]=n,E&&a.emit("set",i,null,n),n},a={original:e,memoized:C,get:function(e){return A&&(e=A(e)),g?g(e):String(e[0])},has:function(e){return f.call(D,e)},delete:function(e){var t;f.call(D,e)&&(_&&_(e),t=D[e],delete D[e],S&&a.emit("delete",e,t))},clear:function(){var e=D;b&&b(),D=p(null),a.emit("clear",e)},on:function(e,t){return"get"===e?k=!0:"set"===e?E=!0:"delete"===e&&(S=!0),d.call(this,e,t)},emit:m,updateEnv:function(){e=a.original}},x=g?i(function(e){var t,n=arguments;A&&(n=A(n)),null!==(t=g(n))&&a.delete(t)},v):0===t?function(){return a.delete("data")}:function(e){return A&&(e=A(arguments)[0]),a.delete(e)},h(C,{__memoized__:o(!0),delete:o(x),clear:o(a.clear)}),a}},function(e,t,n){"use strict";var r=n(58);e.exports=function(e){var t;return"function"==typeof e?{set:e,get:e}:(t={get:r(e.get)},void 0!==e.set?(t.set=r(e.set),t.delete=r(e.delete),t.clear=r(e.clear),t):(t.set=t.get,t))}},function(e,t,n){"use strict";var r,i=n(715),o=n(58),a=Array.prototype.slice;r=function(e){return this.map(function(t,n){return t?t(e[n]):e[n]}).concat(a.call(e,this.length))},e.exports=function(e){return e=i(e),e.forEach(function(e){null!=e&&o(e)}),r.bind(e)}},function(e,t,n){"use strict";var r=n(206);e.exports=function(){var e=0,t=[],n=[];return{get:function(e){var i=r.call(t,e[0]);return-1===i?null:n[i]},set:function(r){return t.push(r[0]),n.push(++e),e},delete:function(e){var i=r.call(n,e);-1!==i&&(t.splice(i,1),n.splice(i,1))},clear:function(){t=[],n=[]}}}},function(e,t,n){"use strict";var r=n(206),i=Object.create;e.exports=function(e){var t=0,n=[[],[]],o=i(null);return{get:function(t){for(var i,o=0,a=n;o<e-1;){if(-1===(i=r.call(a[0],t[o])))return null;a=a[1][i],++o}return i=r.call(a[0],t[o]),-1===i?null:a[1][i]||null},set:function(i){for(var a,s=0,u=n;s<e-1;)a=r.call(u[0],i[s]),-1===a&&(a=u[0].push(i[s])-1,u[1].push([[],[]])),u=u[1][a],++s;return a=r.call(u[0],i[s]),-1===a&&(a=u[0].push(i[s])-1),u[1][a]=++t,o[t]=i,t},delete:function(t){for(var i,a=0,s=n,u=[],l=o[t];a<e-1;){if(-1===(i=r.call(s[0],l[a])))return;u.push(s,i),s=s[1][i],++a}if(-1!==(i=r.call(s[0],l[a]))){for(t=s[1][i],s[0].splice(i,1),s[1].splice(i,1);!s[0].length&&u.length;)i=u.pop(),s=u.pop(),s[0].splice(i,1),s[1].splice(i,1);delete o[t]}},clear:function(){n=[[],[]],o=i(null)}}}},function(e,t,n){"use strict";e.exports=function(e){return e?function(t){for(var n=String(t[0]),r=0,i=e;--i;)n+=""+t[++r];return n}:function(){return""}}},function(e,t,n){"use strict";var r=n(206),i=Object.create;e.exports=function(){var e=0,t=[],n=i(null);return{get:function(e){var n,i=0,o=t,a=e.length;if(0===a)return o[a]||null;if(o=o[a]){for(;i<a-1;){if(-1===(n=r.call(o[0],e[i])))return null;o=o[1][n],++i}return n=r.call(o[0],e[i]),-1===n?null:o[1][n]||null}return null},set:function(i){var o,a=0,s=t,u=i.length;if(0===u)s[u]=++e;else{for(s[u]||(s[u]=[[],[]]),s=s[u];a<u-1;)o=r.call(s[0],i[a]),-1===o&&(o=s[0].push(i[a])-1,s[1].push([[],[]])),s=s[1][o],++a;o=r.call(s[0],i[a]),-1===o&&(o=s[0].push(i[a])-1),s[1][o]=++e}return n[e]=i,e},delete:function(e){var i,o=0,a=t,s=n[e],u=s.length,l=[];if(0===u)delete a[u];else if(a=a[u]){for(;o<u-1;){if(-1===(i=r.call(a[0],s[o])))return;l.push(a,i),a=a[1][i],++o}if(-1===(i=r.call(a[0],s[o])))return;for(e=a[1][i],a[0].splice(i,1),a[1].splice(i,1);!a[0].length&&l.length;)i=l.pop(),a=l.pop(),a[0].splice(i,1),a[1].splice(i,1)}delete n[e]},clear:function(){t=[],n=i(null)}}}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r=e.length;if(!r)return"";for(t=String(e[n=0]);--r;)t+=""+e[++n];return t}},function(e,t,n){"use strict";var r=n(58),i=n(142),o=n(69),a=n(969),s=n(431),u=Object.prototype.hasOwnProperty;e.exports=function e(t){var n,l,c;if(r(t),n=Object(arguments[1]),n.async&&n.promise)throw new Error("Options 'async' and 'promise' cannot be used together");return u.call(t,"__memoized__")&&!n.force?t:(l=s(n.length,t.length,n.async&&o.async),c=a(t,l,n),i(o,function(e,t){n[t]&&e(n[t],c,n)}),e.__profiler__&&e.__profiler__(c),c.updateEnv(),c.memoized)}},function(e,t,n){"use strict";e.exports=Number.isNaN||function(e){return e!==e}},function(e,t){/*! - * pascalcase <https://github.com/jonschlinkert/pascalcase> - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ -function n(e){if("string"!=typeof e)throw new TypeError("expected a string.");return e=e.replace(/([A-Z])/g," $1"),1===e.length?e.toUpperCase():(e=e.replace(/^[\W_]+|[\W_]+$/g,"").toLowerCase(),e=e.charAt(0).toUpperCase()+e.slice(1),e.replace(/[\W_]+(\w|$)/g,function(e,t){return t.toUpperCase()}))}e.exports=n},function(e,t,n){"use strict";(function(r){function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var a=n(442),s=i(a),u=n(230),l=i(u),c=function(){function e(t,n,r){o(this,e),this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r}return e.prototype.isMap=function(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0},e.prototype.previous=function(){var e=this;return this.previousMaps||(this.previousMaps=[],this.root.walk(function(t){if(t.source&&t.source.input.map){var n=t.source.input.map;-1===e.previousMaps.indexOf(n)&&e.previousMaps.push(n)}})),this.previousMaps},e.prototype.isInline=function(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))},e.prototype.isSourcesContent=function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})},e.prototype.clearAnnotation=function(){if(!1!==this.mapOpts.annotation)for(var e=void 0,t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)},e.prototype.setSourcesContent=function(){var e=this,t={};this.root.walk(function(n){if(n.source){var r=n.source.input.from;if(r&&!t[r]){t[r]=!0;var i=e.relative(r);e.map.setSourceContent(i,n.source.input.css)}}})},e.prototype.applyPrevMaps=function(){for(var e=this.previous(),t=Array.isArray(e),n=0,e=t?e:e[Symbol.iterator]();;){var r;if(t){if(n>=e.length)break;r=e[n++]}else{if(n=e.next(),n.done)break;r=n.value}var i=r,o=this.relative(i.file),a=i.root||l.default.dirname(i.file),u=void 0;!1===this.mapOpts.sourcesContent?(u=new s.default.SourceMapConsumer(i.text),u.sourcesContent&&(u.sourcesContent=u.sourcesContent.map(function(){return null}))):u=i.consumer(),this.map.applySourceMap(u,o,this.relative(a))}},e.prototype.isAnnotation=function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))},e.prototype.toBase64=function(e){return r?r.from&&r.from!==Uint8Array.from?r.from(e).toString("base64"):new r(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))},e.prototype.addAnnotation=function(){var e=void 0;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:this.outputFile()+".map";var t="\n";-1!==this.css.indexOf("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"},e.prototype.outputFile=function(){return this.opts.to?this.relative(this.opts.to):this.opts.from?this.relative(this.opts.from):"to.css"},e.prototype.generateMap=function(){return this.generateString(),this.isSourcesContent()&&this.setSourcesContent(),this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]},e.prototype.relative=function(e){if(0===e.indexOf("<"))return e;if(/^\w+:\/\//.test(e))return e;var t=this.opts.to?l.default.dirname(this.opts.to):".";return"string"==typeof this.mapOpts.annotation&&(t=l.default.dirname(l.default.resolve(t,this.mapOpts.annotation))),e=l.default.relative(t,e),"\\"===l.default.sep?e.replace(/\\/g,"/"):e},e.prototype.sourcePath=function(e){return this.mapOpts.from?this.mapOpts.from:this.relative(e.source.input.from)},e.prototype.generateString=function(){var e=this;this.css="",this.map=new s.default.SourceMapGenerator({file:this.outputFile()});var t=1,n=1,r=void 0,i=void 0;this.stringify(this.root,function(o,a,s){e.css+=o,a&&"end"!==s&&(a.source&&a.source.start?e.map.addMapping({source:e.sourcePath(a),generated:{line:t,column:n-1},original:{line:a.source.start.line,column:a.source.start.column-1}}):e.map.addMapping({source:"<no source>",original:{line:1,column:0},generated:{line:t,column:n-1}})),r=o.match(/\n/g),r?(t+=r.length,i=o.lastIndexOf("\n"),n=o.length-i):n+=o.length,a&&"start"!==s&&(a.source&&a.source.end?e.map.addMapping({source:e.sourcePath(a),generated:{line:t,column:n-1},original:{line:a.source.end.line,column:a.source.end.column}}):e.map.addMapping({source:"<no source>",original:{line:1,column:0},generated:{line:t,column:n-1}}))})},e.prototype.generate=function(){if(this.clearAnnotation(),this.isMap())return this.generateMap();var e="";return this.stringify(this.root,function(t){e+=t}),[e]},e}();t.default=c,e.exports=t.default}).call(t,n(40).Buffer)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=n(234),a=r(o),s=n(438),u=r(s),l=n(232),c=r(l),p=n(156),f=r(p),h=n(237),d=r(h),m=n(157),v=r(m),g=function(){function e(t){i(this,e),this.input=t,this.root=new d.default,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{line:1,column:1}}}return e.prototype.createTokenizer=function(){this.tokenizer=(0,u.default)(this.input)},e.prototype.parse=function(){for(var e=void 0;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()},e.prototype.comment=function(e){var t=new c.default;this.init(t,e[2],e[3]),t.source.end={line:e[4],column:e[5]};var n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{var r=n.match(/^(\s*)([^]*[^\s])(\s*)$/);t.text=r[2],t.raws.left=r[1],t.raws.right=r[3]}},e.prototype.emptyRule=function(e){var t=new v.default;this.init(t,e[2],e[3]),t.selector="",t.raws.between="",this.current=t},e.prototype.other=function(e){for(var t=!1,n=null,r=!1,i=null,o=[],a=[],s=e;s;){if(n=s[0],a.push(s),"("===n||"["===n)i||(i=s),o.push("("===n?")":"]");else if(0===o.length){if(";"===n){if(r)return void this.decl(a);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));s=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&r){for(;a.length&&("space"===(s=a[a.length-1][0])||"comment"===s);)this.tokenizer.back(a.pop());return void this.decl(a)}this.unknownWord(a)},e.prototype.rule=function(e){e.pop();var t=new v.default;this.init(t,e[0][2],e[0][3]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t},e.prototype.decl=function(e){var t=new a.default;this.init(t);var n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),n[4]?t.source.end={line:n[4],column:n[5]}:t.source.end={line:n[2],column:n[3]};"word"!==e[0][0];)1===e.length&&this.unknownWord(e),t.raws.before+=e.shift()[1];for(t.source.start={line:e[0][2],column:e[0][3]},t.prop="";e.length;){var r=e[0][0];if(":"===r||"space"===r||"comment"===r)break;t.prop+=e.shift()[1]}t.raws.between="";for(var i=void 0;e.length;){if(i=e.shift(),":"===i[0]){t.raws.between+=i[1];break}t.raws.between+=i[1]}"_"!==t.prop[0]&&"*"!==t.prop[0]||(t.raws.before+=t.prop[0],t.prop=t.prop.slice(1)),t.raws.between+=this.spacesAndCommentsFromStart(e),this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){if(i=e[o],"!important"===i[1].toLowerCase()){t.important=!0;var s=this.stringFrom(e,o);s=this.spacesFromEnd(e)+s," !important"!==s&&(t.raws.important=s);break}if("important"===i[1].toLowerCase()){for(var u=e.slice(0),l="",c=o;c>0;c--){var p=u[c][0];if(0===l.trim().indexOf("!")&&"space"!==p)break;l=u.pop()[1]+l}0===l.trim().indexOf("!")&&(t.important=!0,t.raws.important=l,e=u)}if("space"!==i[0]&&"comment"!==i[0])break}this.raw(t,"value",e),-1!==t.value.indexOf(":")&&this.checkMissedSemicolon(e)},e.prototype.atrule=function(e){var t=new f.default;t.name=e[1].slice(1),""===t.name&&this.unnamedAtrule(t,e),this.init(t,e[2],e[3]);for(var n=void 0,r=void 0,i=!1,o=!1,a=[];!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),";"===e[0]){t.source.end={line:e[2],column:e[3]},this.semicolon=!0;break}if("{"===e[0]){o=!0;break}if("}"===e[0]){if(a.length>0){for(r=a.length-1,n=a[r];n&&"space"===n[0];)n=a[--r];n&&(t.source.end={line:n[4],column:n[5]})}this.end(e);break}if(a.push(e),this.tokenizer.endOfFile()){i=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),i&&(e=a[a.length-1],t.source.end={line:e[4],column:e[5]},this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),o&&(t.nodes=[],this.current=t)},e.prototype.end=function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end={line:e[2],column:e[3]},this.current=this.current.parent):this.unexpectedClose(e)},e.prototype.endFile=function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces},e.prototype.freeSemicolon=function(e){if(this.spaces+=e[1],this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}},e.prototype.init=function(e,t,n){this.current.push(e),e.source={start:{line:t,column:n},input:this.input},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)},e.prototype.raw=function(e,t,n){for(var r=void 0,i=void 0,o=n.length,a="",s=!0,u=0;u<o;u+=1)r=n[u],i=r[0],"comment"===i||"space"===i&&u===o-1?s=!1:a+=r[1];if(!s){var l=n.reduce(function(e,t){return e+t[1]},"");e.raws[t]={value:a,raw:l}}e[t]=a},e.prototype.spacesAndCommentsFromEnd=function(e){for(var t=void 0,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n},e.prototype.spacesAndCommentsFromStart=function(e){for(var t=void 0,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n},e.prototype.spacesFromEnd=function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t},e.prototype.stringFrom=function(e,t){for(var n="",r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n},e.prototype.colon=function(e){for(var t=0,n=void 0,r=void 0,i=void 0,o=0;o<e.length;o++){if(n=e[o],"("===(r=n[0]))t+=1;else if(")"===r)t-=1;else if(0===t&&":"===r){if(i){if("word"===i[0]&&"progid"===i[1])continue;return o}this.doubleColon(n)}i=n}return!1},e.prototype.unclosedBracket=function(e){throw this.input.error("Unclosed bracket",e[2],e[3])},e.prototype.unknownWord=function(e){throw this.input.error("Unknown word",e[0][2],e[0][3])},e.prototype.unexpectedClose=function(e){throw this.input.error("Unexpected }",e[2],e[3])},e.prototype.unclosedBlock=function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)},e.prototype.doubleColon=function(e){throw this.input.error("Double colon",e[2],e[3])},e.prototype.unnamedAtrule=function(e,t){throw this.input.error("At-rule without name",t[2],t[3])},e.prototype.precheckMissedSemicolon=function(e){},e.prototype.checkMissedSemicolon=function(e){var t=this.colon(e);if(!1!==t){for(var n=0,r=void 0,i=t-1;i>=0&&(r=e[i],"space"===r[0]||2!==(n+=1));i--);throw this.input.error("Missed semicolon",r[2],r[3])}},e}();t.default=g,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new u.default(t)}t.__esModule=!0;var o=n(234),a=r(o),s=n(436),u=r(s),l=n(238),c=r(l),p=n(232),f=r(p),h=n(156),d=r(h),m=n(986),v=r(m),g=n(236),y=r(g),_=n(435),b=r(_),x=n(157),w=r(x),k=n(237),E=r(k);i.plugin=function(e,t){var n=function(){var n=t.apply(void 0,arguments);return n.postcssPlugin=e,n.postcssVersion=(new u.default).version,n},r=void 0;return Object.defineProperty(n,"postcss",{get:function(){return r||(r=n()),r}}),n.process=function(e,t,r){return i([n(r)]).process(e,t)},n},i.stringify=c.default,i.parse=y.default,i.vendor=v.default,i.list=b.default,i.comment=function(e){return new f.default(e)},i.atRule=function(e){return new d.default(e)},i.decl=function(e){return new a.default(e)},i.rule=function(e){return new w.default(e)},i.root=function(e){return new E.default(e)},t.default=i,e.exports=t.default},function(e,t,n){"use strict";(function(r){function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return r?r.from&&r.from!==Uint8Array.from?r.from(e,"base64").toString():new r(e,"base64").toString():window.atob(e)}t.__esModule=!0;var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=n(442),l=i(u),c=n(230),p=i(c),f=n(1210),h=i(f),d=function(){function e(t,n){o(this,e),this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");var r=n.map?n.map.prev:void 0,i=this.loadMap(n.from,r);i&&(this.text=i)}return e.prototype.consumer=function(){return this.consumerCache||(this.consumerCache=new l.default.SourceMapConsumer(this.text)),this.consumerCache},e.prototype.withContent=function(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)},e.prototype.startWith=function(e,t){return!!e&&e.substr(0,t.length)===t},e.prototype.loadAnnotation=function(e){var t=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//);t&&(this.annotation=t[1].trim())},e.prototype.decodeInline=function(e){var t=/^data:application\/json;(?:charset=utf-?8;)?base64,/,n="data:application/json,";if(this.startWith(e,n))return decodeURIComponent(e.substr(n.length));if(t.test(e))return a(e.substr(RegExp.lastMatch.length));var r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)},e.prototype.loadMap=function(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"==typeof t){var n=t(e);if(n&&h.default.existsSync&&h.default.existsSync(n))return h.default.readFileSync(n,"utf-8").toString().trim();throw new Error("Unable to load previous source map: "+n.toString())}if(t instanceof l.default.SourceMapConsumer)return l.default.SourceMapGenerator.fromSourceMap(t).toString();if(t instanceof l.default.SourceMapGenerator)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){var r=this.annotation;return e&&(r=p.default.join(p.default.dirname(e),r)),this.root=p.default.dirname(r),!(!h.default.existsSync||!h.default.existsSync(r))&&h.default.readFileSync(r,"utf-8").toString().trim()}},e.prototype.isMap=function(e){return"object"===(void 0===e?"undefined":s(e))&&("string"==typeof e.mappings||"string"==typeof e._mappings)},e}();t.default=d,e.exports=t.default}).call(t,n(40).Buffer)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(988),a=function(e){return e&&e.__esModule?e:{default:e}}(o),s=function(){function e(t,n,i){r(this,e),this.processor=t,this.messages=[],this.root=n,this.opts=i,this.css=void 0,this.map=void 0}return e.prototype.toString=function(){return this.css},e.prototype.warn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);var n=new a.default(e,t);return this.messages.push(n),n},e.prototype.warnings=function(){return this.messages.filter(function(e){return"warning"===e.type})},i(e,[{key:"content",get:function(){return this.css}}]),e}();t.default=s,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=e[0],r=e[1];if("word"===n){if("."===r[0])return"class";if("#"===r[0])return"hash"}if(!t.endOfFile()){var i=t.nextToken();if(t.back(i),"brackets"===i[0]||"("===i[0])return"call"}return n}function o(e){for(var t=(0,l.default)(new p.default(e),{ignoreErrors:!0}),n="";!t.endOfFile();)!function(){var e=t.nextToken(),r=f[i(e,t)];n+=r?e[1].split(/\r?\n/).map(function(e){return r(e)}).join("\n"):e[1]}();return n}t.__esModule=!0;var a=n(503),s=r(a),u=n(438),l=r(u),c=n(433),p=r(c),f={brackets:s.default.cyan,"at-word":s.default.cyan,call:s.default.cyan,comment:s.default.gray,string:s.default.green,class:s.default.yellow,hash:s.default.magenta,"(":s.default.cyan,")":s.default.cyan,"{":s.default.yellow,"}":s.default.yellow,"[":s.default.yellow,"]":s.default.yellow,":":s.default.yellow,";":s.default.yellow};t.default=o,e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r={prefix:function(e){var t=e.match(/^(-\w+-)/);return t?t[0]:""},unprefixed:function(e){return e.replace(/^-\w+-/,"")}};t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e){i[e]||(i[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}t.__esModule=!0,t.default=r;var i={};e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r(this,e),this.type="warning",this.text=t,n.node&&n.node.source){var i=n.node.positionBy(n);this.line=i.line,this.column=i.column}for(var o in n)this[o]=n[o]}return e.prototype.toString=function(){return this.node?this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text},e}();t.default=i,e.exports=t.default},function(e,t){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e<n.length)return n[e];throw new TypeError("Must be between 0 and 63: "+e)},t.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1}},function(e,t){function n(e,r,i,o,a,s){var u=Math.floor((r-e)/2)+e,l=a(i,o[u],!0);return 0===l?u:l>0?r-u>1?n(u,r,i,o,a,s):s==t.LEAST_UPPER_BOUND?r<o.length?r:-1:u:u-e>1?n(e,u,i,o,a,s):s==t.LEAST_UPPER_BOUND?u:e<0?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,r,i,o){if(0===r.length)return-1;var a=n(-1,r.length,e,r,i,o||t.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&0===i(r[a],r[a-1],!0);)--a;return a}},function(e,t,n){function r(e,t){var n=e.generatedLine,r=t.generatedLine,i=e.generatedColumn,a=t.generatedColumn;return r>n||r==n&&a>=i||o.compareByGeneratedPositionsInflated(e,t)<=0}function i(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var o=n(121);i.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},i.prototype.add=function(e){r(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},i.prototype.toArray=function(){return this._sorted||(this._array.sort(o.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.MappingList=i},function(e,t){function n(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function r(e,t){return Math.round(e+Math.random()*(t-e))}function i(e,t,o,a){if(o<a){var s=r(o,a),u=o-1;n(e,s,a);for(var l=e[a],c=o;c<a;c++)t(e[c],l)<=0&&(u+=1,n(e,u,c));n(e,u+1,c);var p=u+1;i(e,t,o,p-1),i(e,t,p+1,a)}}t.quickSort=function(e,t){i(e,t,0,e.length-1)}},function(e,t,n){function r(e,t){var n=e;return"string"==typeof e&&(n=s.parseSourceMapInput(e)),null!=n.sections?new a(n,t):new i(n,t)}function i(e,t){var n=e;"string"==typeof e&&(n=s.parseSourceMapInput(e));var r=s.getArg(n,"version"),i=s.getArg(n,"sources"),o=s.getArg(n,"names",[]),a=s.getArg(n,"sourceRoot",null),u=s.getArg(n,"sourcesContent",null),c=s.getArg(n,"mappings"),p=s.getArg(n,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);a&&(a=s.normalize(a)),i=i.map(String).map(s.normalize).map(function(e){return a&&s.isAbsolute(a)&&s.isAbsolute(e)?s.relative(a,e):e}),this._names=l.fromArray(o.map(String),!0),this._sources=l.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(e){return s.computeSourceURL(a,e,t)}),this.sourceRoot=a,this.sourcesContent=u,this._mappings=c,this._sourceMapURL=t,this.file=p}function o(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function a(e,t){var n=e;"string"==typeof e&&(n=s.parseSourceMapInput(e));var i=s.getArg(n,"version"),o=s.getArg(n,"sections");if(i!=this._version)throw new Error("Unsupported version: "+i);this._sources=new l,this._names=new l;var a={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var n=s.getArg(e,"offset"),i=s.getArg(n,"line"),o=s.getArg(n,"column");if(i<a.line||i===a.line&&o<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=n,{generatedOffset:{generatedLine:i+1,generatedColumn:o+1},consumer:new r(s.getArg(e,"map"),t)}})}var s=n(121),u=n(990),l=n(439).ArraySet,c=n(440),p=n(992).quickSort;r.fromSourceMap=function(e,t){return i.fromSourceMap(e,t)},r.prototype._version=3,r.prototype.__generatedMappings=null,Object.defineProperty(r.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),r.prototype.__originalMappings=null,Object.defineProperty(r.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),r.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return";"===n||","===n},r.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},r.GENERATED_ORDER=1,r.ORIGINAL_ORDER=2,r.GREATEST_LOWER_BOUND=1,r.LEAST_UPPER_BOUND=2,r.prototype.eachMapping=function(e,t,n){var i,o=t||null,a=n||r.GENERATED_ORDER;switch(a){case r.GENERATED_ORDER:i=this._generatedMappings;break;case r.ORIGINAL_ORDER:i=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;i.map(function(e){var t=null===e.source?null:this._sources.at(e.source);return t=s.computeSourceURL(u,t,this._sourceMapURL),{source:t,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}},this).forEach(e,o)},r.prototype.allGeneratedPositionsFor=function(e){var t=s.getArg(e,"line"),n={source:s.getArg(e,"source"),originalLine:t,originalColumn:s.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var r=[],i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,u.LEAST_UPPER_BOUND);if(i>=0){var o=this._originalMappings[i];if(void 0===e.column)for(var a=o.originalLine;o&&o.originalLine===a;)r.push({line:s.getArg(o,"generatedLine",null),column:s.getArg(o,"generatedColumn",null),lastColumn:s.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++i];else for(var l=o.originalColumn;o&&o.originalLine===t&&o.originalColumn==l;)r.push({line:s.getArg(o,"generatedLine",null),column:s.getArg(o,"generatedColumn",null),lastColumn:s.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++i]}return r},t.SourceMapConsumer=r,i.prototype=Object.create(r.prototype),i.prototype.consumer=r,i.prototype._findSourceIndex=function(e){var t=e;if(null!=this.sourceRoot&&(t=s.relative(this.sourceRoot,t)),this._sources.has(t))return this._sources.indexOf(t);var n;for(n=0;n<this._absoluteSources.length;++n)if(this._absoluteSources[n]==e)return n;return-1},i.fromSourceMap=function(e,t){var n=Object.create(i.prototype),r=n._names=l.fromArray(e._names.toArray(),!0),a=n._sources=l.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=t,n._absoluteSources=n._sources.toArray().map(function(e){return s.computeSourceURL(n.sourceRoot,e,t)});for(var u=e._mappings.toArray().slice(),c=n.__generatedMappings=[],f=n.__originalMappings=[],h=0,d=u.length;h<d;h++){var m=u[h],v=new o;v.generatedLine=m.generatedLine,v.generatedColumn=m.generatedColumn,m.source&&(v.source=a.indexOf(m.source),v.originalLine=m.originalLine,v.originalColumn=m.originalColumn,m.name&&(v.name=r.indexOf(m.name)),f.push(v)),c.push(v)}return p(n.__originalMappings,s.compareByOriginalPositions),n},i.prototype._version=3,Object.defineProperty(i.prototype,"sources",{get:function(){return this._absoluteSources.slice()}}),i.prototype._parseMappings=function(e,t){for(var n,r,i,a,u,l=1,f=0,h=0,d=0,m=0,v=0,g=e.length,y=0,_={},b={},x=[],w=[];y<g;)if(";"===e.charAt(y))l++,y++,f=0;else if(","===e.charAt(y))y++;else{for(n=new o,n.generatedLine=l,a=y;a<g&&!this._charIsMappingSeparator(e,a);a++);if(r=e.slice(y,a),i=_[r])y+=r.length;else{for(i=[];y<a;)c.decode(e,y,b),u=b.value,y=b.rest,i.push(u);if(2===i.length)throw new Error("Found a source, but no line and column");if(3===i.length)throw new Error("Found a source and line, but no column");_[r]=i}n.generatedColumn=f+i[0],f=n.generatedColumn,i.length>1&&(n.source=m+i[1],m+=i[1],n.originalLine=h+i[2],h=n.originalLine,n.originalLine+=1,n.originalColumn=d+i[3],d=n.originalColumn,i.length>4&&(n.name=v+i[4],v+=i[4])),w.push(n),"number"==typeof n.originalLine&&x.push(n)}p(w,s.compareByGeneratedPositionsDeflated),this.__generatedMappings=w,p(x,s.compareByOriginalPositions),this.__originalMappings=x},i.prototype._findMapping=function(e,t,n,r,i,o){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return u.search(e,t,i,o)},i.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},i.prototype.originalPositionFor=function(e){var t={generatedLine:s.getArg(e,"line"),generatedColumn:s.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",s.compareByGeneratedPositionsDeflated,s.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===t.generatedLine){var o=s.getArg(i,"source",null);null!==o&&(o=this._sources.at(o),o=s.computeSourceURL(this.sourceRoot,o,this._sourceMapURL));var a=s.getArg(i,"name",null);return null!==a&&(a=this._names.at(a)),{source:o,line:s.getArg(i,"originalLine",null),column:s.getArg(i,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},i.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},i.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var r=e;null!=this.sourceRoot&&(r=s.relative(this.sourceRoot,r));var i;if(null!=this.sourceRoot&&(i=s.urlParse(this.sourceRoot))){var o=r.replace(/^file:\/\//,"");if("file"==i.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!i.path||"/"==i.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},i.prototype.generatedPositionFor=function(e){var t=s.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:s.getArg(e,"line"),originalColumn:s.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,s.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(i>=0){var o=this._originalMappings[i];if(o.source===n.source)return{line:s.getArg(o,"generatedLine",null),column:s.getArg(o,"generatedColumn",null),lastColumn:s.getArg(o,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},t.BasicSourceMapConsumer=i,a.prototype=Object.create(r.prototype),a.prototype.constructor=r,a.prototype._version=3,Object.defineProperty(a.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var n=0;n<this._sections[t].consumer.sources.length;n++)e.push(this._sections[t].consumer.sources[n]);return e}}),a.prototype.originalPositionFor=function(e){var t={generatedLine:s.getArg(e,"line"),generatedColumn:s.getArg(e,"column")},n=u.search(t,this._sections,function(e,t){var n=e.generatedLine-t.generatedOffset.generatedLine;return n||e.generatedColumn-t.generatedOffset.generatedColumn}),r=this._sections[n];return r?r.consumer.originalPositionFor({line:t.generatedLine-(r.generatedOffset.generatedLine-1),column:t.generatedColumn-(r.generatedOffset.generatedLine===t.generatedLine?r.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},a.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},a.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var r=this._sections[n],i=r.consumer.sourceContentFor(e,!0);if(i)return i}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},a.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(-1!==n.consumer._findSourceIndex(s.getArg(e,"source"))){var r=n.consumer.generatedPositionFor(e);if(r){return{line:r.line+(n.generatedOffset.generatedLine-1),column:r.column+(n.generatedOffset.generatedLine===r.line?n.generatedOffset.generatedColumn-1:0)}}}}return{line:null,column:null}},a.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var r=this._sections[n],i=r.consumer._generatedMappings,o=0;o<i.length;o++){var a=i[o],u=r.consumer._sources.at(a.source);u=s.computeSourceURL(r.consumer.sourceRoot,u,this._sourceMapURL),this._sources.add(u),u=this._sources.indexOf(u);var l=null;a.name&&(l=r.consumer._names.at(a.name),this._names.add(l),l=this._names.indexOf(l));var c={source:u,generatedLine:a.generatedLine+(r.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(r.generatedOffset.generatedLine===a.generatedLine?r.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:l};this.__generatedMappings.push(c),"number"==typeof c.originalLine&&this.__originalMappings.push(c)}p(this.__generatedMappings,s.compareByGeneratedPositionsDeflated),p(this.__originalMappings,s.compareByOriginalPositions)},t.IndexedSourceMapConsumer=a},function(e,t,n){function r(e,t,n,r,i){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==n?null:n,this.name=null==i?null:i,this[s]=!0,null!=r&&this.add(r)}var i=n(441).SourceMapGenerator,o=n(121),a=/(\r?\n)/,s="$$$isSourceNode$$$";r.fromStringWithSourceMap=function(e,t,n){function i(e,t){if(null===e||void 0===e.source)s.add(t);else{var i=n?o.join(n,e.source):e.source;s.add(new r(e.originalLine,e.originalColumn,i,t,e.name))}}var s=new r,u=e.split(a),l=0,c=function(){function e(){return l<u.length?u[l++]:void 0}return e()+(e()||"")},p=1,f=0,h=null;return t.eachMapping(function(e){if(null!==h){if(!(p<e.generatedLine)){var t=u[l]||"",n=t.substr(0,e.generatedColumn-f);return u[l]=t.substr(e.generatedColumn-f),f=e.generatedColumn,i(h,n),void(h=e)}i(h,c()),p++,f=0}for(;p<e.generatedLine;)s.add(c()),p++;if(f<e.generatedColumn){var t=u[l]||"";s.add(t.substr(0,e.generatedColumn)),u[l]=t.substr(e.generatedColumn),f=e.generatedColumn}h=e},this),l<u.length&&(h&&i(h,c()),s.add(u.splice(l).join(""))),t.sources.forEach(function(e){var r=t.sourceContentFor(e);null!=r&&(null!=n&&(e=o.join(n,e)),s.setSourceContent(e,r))}),s},r.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else{if(!e[s]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},r.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[s]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},r.prototype.walk=function(e){for(var t,n=0,r=this.children.length;n<r;n++)t=this.children[n],t[s]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},r.prototype.join=function(e){var t,n,r=this.children.length;if(r>0){for(t=[],n=0;n<r-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this},r.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[s]?n.replaceRight(e,t):"string"==typeof n?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this},r.prototype.setSourceContent=function(e,t){this.sourceContents[o.toSetString(e)]=t},r.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;t<n;t++)this.children[t][s]&&this.children[t].walkSourceContents(e);for(var r=Object.keys(this.sourceContents),t=0,n=r.length;t<n;t++)e(o.fromSetString(r[t]),this.sourceContents[r[t]])},r.prototype.toString=function(){var e="";return this.walk(function(t){e+=t}),e},r.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new i(e),r=!1,o=null,a=null,s=null,u=null;return this.walk(function(e,i){t.code+=e,null!==i.source&&null!==i.line&&null!==i.column?(o===i.source&&a===i.line&&s===i.column&&u===i.name||n.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:t.line,column:t.column},name:i.name}),o=i.source,a=i.line,s=i.column,u=i.name,r=!0):r&&(n.addMapping({generated:{line:t.line,column:t.column}}),o=null,r=!1);for(var l=0,c=e.length;l<c;l++)10===e.charCodeAt(l)?(t.line++,t.column=0,l+1===c?(o=null,r=!1):r&&n.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:t.line,column:t.column},name:i.name})):t.column++}),this.walkSourceContents(function(e,t){n.setSourceContent(e,t)}),{code:t.code,map:n}},t.SourceNode=r},function(e,t,n){"use strict";function r(e,t,n,r,i){}e.exports=r},function(e,t,n){"use strict";var r=n(32),i=n(8),o=n(444);e.exports=function(){function e(e,t,n,r,a,s){s!==o&&i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";var r=n(32),i=n(8),o=n(10),a=n(13),s=n(444),u=n(995);e.exports=function(e,t){function n(e){var t=e&&(C&&e[C]||e[A]);if("function"==typeof t)return t}function l(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function c(e){this.message=e,this.stack=""}function p(e){function n(n,r,o,a,u,l,p){if(a=a||D,l=l||o,p!==s)if(t)i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else;return null==r[o]?n?new c(null===r[o]?"The "+u+" `"+l+"` is marked as required in `"+a+"`, but its value is `null`.":"The "+u+" `"+l+"` is marked as required in `"+a+"`, but its value is `undefined`."):null:e(r,o,a,u,l)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function f(e){function t(t,n,r,i,o,a){var s=t[n];if(w(s)!==e)return new c("Invalid "+i+" `"+o+"` of type `"+k(s)+"` supplied to `"+r+"`, expected `"+e+"`.");return null}return p(t)}function h(e){function t(t,n,r,i,o){if("function"!=typeof e)return new c("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a)){return new c("Invalid "+i+" `"+o+"` of type `"+w(a)+"` supplied to `"+r+"`, expected an array.")}for(var u=0;u<a.length;u++){var l=e(a,u,r,i,o+"["+u+"]",s);if(l instanceof Error)return l}return null}return p(t)}function d(e){function t(t,n,r,i,o){if(!(t[n]instanceof e)){var a=e.name||D;return new c("Invalid "+i+" `"+o+"` of type `"+S(t[n])+"` supplied to `"+r+"`, expected instance of `"+a+"`.")}return null}return p(t)}function m(e){function t(t,n,r,i,o){for(var a=t[n],s=0;s<e.length;s++)if(l(a,e[s]))return null;return new c("Invalid "+i+" `"+o+"` of value `"+a+"` supplied to `"+r+"`, expected one of "+JSON.stringify(e)+".")}return Array.isArray(e)?p(t):r.thatReturnsNull}function v(e){function t(t,n,r,i,o){if("function"!=typeof e)return new c("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=t[n],u=w(a);if("object"!==u)return new c("Invalid "+i+" `"+o+"` of type `"+u+"` supplied to `"+r+"`, expected an object.");for(var l in a)if(a.hasOwnProperty(l)){var p=e(a,l,r,i,o+"."+l,s);if(p instanceof Error)return p}return null}return p(t)}function g(e){function t(t,n,r,i,o){for(var a=0;a<e.length;a++){if(null==(0,e[a])(t,n,r,i,o,s))return null}return new c("Invalid "+i+" `"+o+"` supplied to `"+r+"`.")}if(!Array.isArray(e))return r.thatReturnsNull;for(var n=0;n<e.length;n++){var i=e[n];if("function"!=typeof i)return o(!1,"Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.",E(i),n),r.thatReturnsNull}return p(t)}function y(e){function t(t,n,r,i,o){var a=t[n],u=w(a);if("object"!==u)return new c("Invalid "+i+" `"+o+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var l in e){var p=e[l];if(p){var f=p(a,l,r,i,o+"."+l,s);if(f)return f}}return null}return p(t)}function _(e){function t(t,n,r,i,o){var u=t[n],l=w(u);if("object"!==l)return new c("Invalid "+i+" `"+o+"` of type `"+l+"` supplied to `"+r+"`, expected `object`.");var p=a({},t[n],e);for(var f in p){var h=e[f];if(!h)return new c("Invalid "+i+" `"+o+"` key `"+f+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var d=h(u,f,r,i,o+"."+f,s);if(d)return d}return null}return p(t)}function b(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(b);if(null===t||e(t))return!0;var r=n(t);if(!r)return!1;var i,o=r.call(t);if(r!==t.entries){for(;!(i=o.next()).done;)if(!b(i.value))return!1}else for(;!(i=o.next()).done;){var a=i.value;if(a&&!b(a[1]))return!1}return!0;default:return!1}}function x(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function w(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":x(t,e)?"symbol":t}function k(e){if(void 0===e||null===e)return""+e;var t=w(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function E(e){var t=k(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function S(e){return e.constructor&&e.constructor.name?e.constructor.name:D}var C="function"==typeof Symbol&&Symbol.iterator,A="@@iterator",D="<<anonymous>>",O={array:f("array"),bool:f("boolean"),func:f("function"),number:f("number"),object:f("object"),string:f("string"),symbol:f("symbol"),any:function(){return p(r.thatReturnsNull)}(),arrayOf:h,element:function(){function t(t,n,r,i,o){var a=t[n];if(!e(a)){return new c("Invalid "+i+" `"+o+"` of type `"+w(a)+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return p(t)}(),instanceOf:d,node:function(){function e(e,t,n,r,i){return b(e[t])?null:new c("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")}return p(e)}(),objectOf:v,oneOf:m,oneOfType:g,shape:y,exact:_};return c.prototype=Error.prototype,O.checkPropTypes=u,O.PropTypes=O,O}},function(e,t,n){(function(e,r){var i;!function(o){function a(e){throw RangeError(P[e])}function s(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function u(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(T,"."),r+s(e.split("."),t).join(".")}function l(e){for(var t,n,r=[],i=0,o=e.length;i<o;)t=e.charCodeAt(i++),t>=55296&&t<=56319&&i<o?(n=e.charCodeAt(i++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--)):r.push(t);return r}function c(e){return s(e,function(e){var t="";return e>65535&&(e-=65536,t+=j(e>>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function p(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:x}function f(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function h(e,t,n){var r=0;for(e=n?R(e/S):e>>1,e+=R(e/t);e>I*k>>1;r+=x)e=R(e/I);return R(r+(I+1)*e/(e+E))}function d(e){var t,n,r,i,o,s,u,l,f,d,m=[],v=e.length,g=0,y=A,_=C;for(n=e.lastIndexOf(D),n<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&a("not-basic"),m.push(e.charCodeAt(r));for(i=n>0?n+1:0;i<v;){for(o=g,s=1,u=x;i>=v&&a("invalid-input"),l=p(e.charCodeAt(i++)),(l>=x||l>R((b-g)/s))&&a("overflow"),g+=l*s,f=u<=_?w:u>=_+k?k:u-_,!(l<f);u+=x)d=x-f,s>R(b/d)&&a("overflow"),s*=d;t=m.length+1,_=h(g-o,t,0==o),R(g/t)>b-y&&a("overflow"),y+=R(g/t),g%=t,m.splice(g++,0,y)}return c(m)}function m(e){var t,n,r,i,o,s,u,c,p,d,m,v,g,y,_,E=[];for(e=l(e),v=e.length,t=A,n=0,o=C,s=0;s<v;++s)(m=e[s])<128&&E.push(j(m));for(r=i=E.length,i&&E.push(D);r<v;){for(u=b,s=0;s<v;++s)(m=e[s])>=t&&m<u&&(u=m);for(g=r+1,u-t>R((b-n)/g)&&a("overflow"),n+=(u-t)*g,t=u,s=0;s<v;++s)if(m=e[s],m<t&&++n>b&&a("overflow"),m==t){for(c=n,p=x;d=p<=o?w:p>=o+k?k:p-o,!(c<d);p+=x)_=c-d,y=x-d,E.push(j(f(d+_%y,0))),c=R(_/y);E.push(j(f(c,0))),o=h(n,g,r==i),n=0,++r}++n,++t}return E.join("")}function v(e){return u(e,function(e){return O.test(e)?d(e.slice(4).toLowerCase()):e})}function g(e){return u(e,function(e){return M.test(e)?"xn--"+m(e):e})}var y=("object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType,"object"==typeof r&&r);var _,b=2147483647,x=36,w=1,k=26,E=38,S=700,C=72,A=128,D="-",O=/^xn--/,M=/[^\x20-\x7E]/,T=/[\x2E\u3002\uFF0E\uFF61]/g,P={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},I=x-w,R=Math.floor,j=String.fromCharCode;_={version:"1.3.2",ucs2:{decode:l,encode:c},decode:d,encode:m,toASCII:g,toUnicode:v},void 0!==(i=function(){return _}.call(t,n,t,e))&&(e.exports=i)}()}).call(t,n(72)(e),n(17))},function(e,t,n){"use strict";var r=n(1001),i=n(1e3),o=n(445);e.exports={formats:o,parse:i,stringify:r}},function(e,t,n){"use strict";var r=n(446),i=Object.prototype.hasOwnProperty,o={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:r.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},a=function(e,t){for(var n={},r=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,s=r.split(t.delimiter,a),u=0;u<s.length;++u){var l,c,p=s[u],f=p.indexOf("]="),h=-1===f?p.indexOf("="):f+1;-1===h?(l=t.decoder(p,o.decoder),c=t.strictNullHandling?null:""):(l=t.decoder(p.slice(0,h),o.decoder),c=t.decoder(p.slice(h+1),o.decoder)),i.call(n,l)?n[l]=[].concat(n[l]).concat(c):n[l]=c}return n},s=function(e,t,n){for(var r=t,i=e.length-1;i>=0;--i){var o,a=e[i];if("[]"===a)o=[],o=o.concat(r);else{o=n.plainObjects?Object.create(null):{};var s="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,u=parseInt(s,10);!isNaN(u)&&a!==s&&String(u)===s&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(o=[],o[u]=r):o[s]=r}r=o}return r},u=function(e,t,n){if(e){var r=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,u=o.exec(r),l=u?r.slice(0,u.index):r,c=[];if(l){if(!n.plainObjects&&i.call(Object.prototype,l)&&!n.allowPrototypes)return;c.push(l)}for(var p=0;null!==(u=a.exec(r))&&p<n.depth;){if(p+=1,!n.plainObjects&&i.call(Object.prototype,u[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(u[1])}return u&&c.push("["+r.slice(u.index)+"]"),s(c,t,n)}};e.exports=function(e,t){var n=t?r.assign({},t):{};if(null!==n.decoder&&void 0!==n.decoder&&"function"!=typeof n.decoder)throw new TypeError("Decoder has to be a function.");if(n.ignoreQueryPrefix=!0===n.ignoreQueryPrefix,n.delimiter="string"==typeof n.delimiter||r.isRegExp(n.delimiter)?n.delimiter:o.delimiter,n.depth="number"==typeof n.depth?n.depth:o.depth,n.arrayLimit="number"==typeof n.arrayLimit?n.arrayLimit:o.arrayLimit,n.parseArrays=!1!==n.parseArrays,n.decoder="function"==typeof n.decoder?n.decoder:o.decoder,n.allowDots="boolean"==typeof n.allowDots?n.allowDots:o.allowDots,n.plainObjects="boolean"==typeof n.plainObjects?n.plainObjects:o.plainObjects,n.allowPrototypes="boolean"==typeof n.allowPrototypes?n.allowPrototypes:o.allowPrototypes,n.parameterLimit="number"==typeof n.parameterLimit?n.parameterLimit:o.parameterLimit,n.strictNullHandling="boolean"==typeof n.strictNullHandling?n.strictNullHandling:o.strictNullHandling,""===e||null===e||void 0===e)return n.plainObjects?Object.create(null):{};for(var i="string"==typeof e?a(e,n):e,s=n.plainObjects?Object.create(null):{},l=Object.keys(i),c=0;c<l.length;++c){var p=l[c],f=u(p,i[p],n);s=r.merge(s,f,n)}return r.compact(s)}},function(e,t,n){"use strict";var r=n(446),i=n(445),o={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},a=Date.prototype.toISOString,s={delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,serializeDate:function(e){return a.call(e)},skipNulls:!1,strictNullHandling:!1},u=function e(t,n,i,o,a,u,l,c,p,f,h,d){var m=t;if("function"==typeof l)m=l(n,m);else if(m instanceof Date)m=f(m);else if(null===m){if(o)return u&&!d?u(n,s.encoder):n;m=""}if("string"==typeof m||"number"==typeof m||"boolean"==typeof m||r.isBuffer(m)){if(u){return[h(d?n:u(n,s.encoder))+"="+h(u(m,s.encoder))]}return[h(n)+"="+h(String(m))]}var v=[];if(void 0===m)return v;var g;if(Array.isArray(l))g=l;else{var y=Object.keys(m);g=c?y.sort(c):y}for(var _=0;_<g.length;++_){var b=g[_];a&&null===m[b]||(v=Array.isArray(m)?v.concat(e(m[b],i(n,b),i,o,a,u,l,c,p,f,h,d)):v.concat(e(m[b],n+(p?"."+b:"["+b+"]"),i,o,a,u,l,c,p,f,h,d)))}return v};e.exports=function(e,t){var n=e,a=t?r.assign({},t):{};if(null!==a.encoder&&void 0!==a.encoder&&"function"!=typeof a.encoder)throw new TypeError("Encoder has to be a function.");var l=void 0===a.delimiter?s.delimiter:a.delimiter,c="boolean"==typeof a.strictNullHandling?a.strictNullHandling:s.strictNullHandling,p="boolean"==typeof a.skipNulls?a.skipNulls:s.skipNulls,f="boolean"==typeof a.encode?a.encode:s.encode,h="function"==typeof a.encoder?a.encoder:s.encoder,d="function"==typeof a.sort?a.sort:null,m=void 0!==a.allowDots&&a.allowDots,v="function"==typeof a.serializeDate?a.serializeDate:s.serializeDate,g="boolean"==typeof a.encodeValuesOnly?a.encodeValuesOnly:s.encodeValuesOnly;if(void 0===a.format)a.format=i.default;else if(!Object.prototype.hasOwnProperty.call(i.formatters,a.format))throw new TypeError("Unknown format option provided.");var y,_,b=i.formatters[a.format];"function"==typeof a.filter?(_=a.filter,n=_("",n)):Array.isArray(a.filter)&&(_=a.filter,y=_);var x=[];if("object"!=typeof n||null===n)return"";var w;w=a.arrayFormat in o?a.arrayFormat:"indices"in a?a.indices?"indices":"repeat":"indices";var k=o[w];y||(y=Object.keys(n)),d&&y.sort(d);for(var E=0;E<y.length;++E){var S=y[E];p&&null===n[S]||(x=x.concat(u(n[S],S,k,c,p,f?h:null,_,d,m,v,b,g)))}var C=x.join(l),A=!0===a.addQueryPrefix?"?":"";return C.length>0?A+C:""}},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,o){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var l=e.length;u>0&&l>u&&(l=u);for(var c=0;c<l;++c){var p,f,h,d,m=e[c].replace(s,"%20"),v=m.indexOf(n);v>=0?(p=m.substr(0,v),f=m.substr(v+1)):(p=m,f=""),h=decodeURIComponent(p),d=decodeURIComponent(f),r(a,h)?i(a[h])?a[h].push(d):a[h]=[a[h],d]:a[h]=d}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";function r(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?r(a(e),function(a){var s=encodeURIComponent(i(a))+n;return o(e[a])?r(e[a],function(e){return s+encodeURIComponent(i(e))}).join(t):s+encodeURIComponent(i(e[a]))}).join(t):s?encodeURIComponent(i(s))+n+encodeURIComponent(i(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t,n){"use strict";t.decode=t.parse=n(1002),t.encode=t.stringify=n(1003)},function(e,t,n){"use strict";function r(e){return decodeURIComponent(e.replace(/\+/g," "))}function i(e){for(var t,n=/([^=?&]+)=?([^&]*)/g,i={};t=n.exec(e);i[r(t[1])]=r(t[2]));return i}function o(e,t){t=t||"";var n=[];"string"!=typeof t&&(t="?");for(var r in e)a.call(e,r)&&n.push(encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return n.length?t+n.join("&"):""}var a=Object.prototype.hasOwnProperty;t.stringify=o,t.parse=i},function(e,t,n){(function(t){(function(){var n,r,i,o,a,s;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:void 0!==t&&null!==t&&t.hrtime?(e.exports=function(){return(n()-a)/1e6},r=t.hrtime,n=function(){var e;return e=r(),1e9*e[0]+e[1]},o=n(),s=1e9*t.uptime(),a=o-s):Date.now?(e.exports=function(){return Date.now()-i},i=Date.now()):(e.exports=function(){return(new Date).getTime()-i},i=(new Date).getTime())}).call(this)}).call(t,n(33))},function(e,t){e.exports='---\nurl: "http://petstore.swagger.io/v2/swagger.json"\ndom_id: "#swagger-ui"\nvalidatorUrl: "https://online.swagger.io/validator"\noauth2RedirectUrl: "http://localhost:3200/oauth2-redirect.html"\n'},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.UnmountClosed=void 0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),p=r(c),f=n(1),h=r(f),d=n(447);(t.UnmountClosed=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.componentWillReceiveProps=function(e){var t=e.isOpened;!n.props.isOpened&&t&&n.setState({forceInitialAnimation:!0,shouldUnmount:!1})},n.onRest=function(){var e=n.props,t=e.isOpened,r=e.onRest;t||n.setState({shouldUnmount:!0}),r&&r.apply(void 0,arguments)},n.state={shouldUnmount:!n.props.isOpened,forceInitialAnimation:!n.props.isOpened},n}return s(t,e),l(t,[{key:"render",value:function(){var e=this.props,t=e.isOpened,n=(e.onRest,i(e,["isOpened","onRest"])),r=this.state,o=r.forceInitialAnimation;return r.shouldUnmount?null:p.default.createElement(d.Collapse,u({forceInitialAnimation:o,isOpened:t,onRest:this.onRest},n))}}]),t}(p.default.PureComponent)).propTypes={isOpened:h.default.bool.isRequired,onRest:h.default.func}},function(e,t,n){"use strict";var r={Properties:{"aria-current":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0},DOMAttributeNames:{},DOMPropertyNames:{}};e.exports=r},function(e,t,n){"use strict";var r=n(14),i=n(378),o={focusDOMComponent:function(){i(r.getNodeFromInstance(this))}};e.exports=o},function(e,t,n){"use strict";function r(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}function i(e){switch(e){case"topCompositionStart":return S.compositionStart;case"topCompositionEnd":return S.compositionEnd;case"topCompositionUpdate":return S.compositionUpdate}}function o(e,t){return"topKeyDown"===e&&t.keyCode===y}function a(e,t){switch(e){case"topKeyUp":return-1!==g.indexOf(t.keyCode);case"topKeyDown":return t.keyCode!==y;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function s(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}function u(e,t,n,r){var u,l;if(_?u=i(e):A?a(e,n)&&(u=S.compositionEnd):o(e,n)&&(u=S.compositionStart),!u)return null;w&&(A||u!==S.compositionStart?u===S.compositionEnd&&A&&(l=A.getData()):A=d.getPooled(r));var c=m.getPooled(u,t,n,r);if(l)c.data=l;else{var p=s(n);null!==p&&(c.data=p)}return f.accumulateTwoPhaseDispatches(c),c}function l(e,t){switch(e){case"topCompositionEnd":return s(t);case"topKeyPress":return t.which!==k?null:(C=!0,E);case"topTextInput":var n=t.data;return n===E&&C?null:n;default:return null}}function c(e,t){if(A){if("topCompositionEnd"===e||!_&&a(e,t)){var n=A.getData();return d.release(A),A=null,n}return null}switch(e){case"topPaste":return null;case"topKeyPress":return t.which&&!r(t)?String.fromCharCode(t.which):null;case"topCompositionEnd":return w?null:t.data;default:return null}}function p(e,t,n,r){var i;if(!(i=x?l(e,n):c(e,n)))return null;var o=v.getPooled(S.beforeInput,t,n,r);return o.data=i,f.accumulateTwoPhaseDispatches(o),o}var f=n(123),h=n(25),d=n(1017),m=n(1054),v=n(1057),g=[9,13,27,32],y=229,_=h.canUseDOM&&"CompositionEvent"in window,b=null;h.canUseDOM&&"documentMode"in document&&(b=document.documentMode);var x=h.canUseDOM&&"TextEvent"in window&&!b&&!function(){var e=window.opera;return"object"==typeof e&&"function"==typeof e.version&&parseInt(e.version(),10)<=12}(),w=h.canUseDOM&&(!_||b&&b>8&&b<=11),k=32,E=String.fromCharCode(k),S={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:["topBlur","topCompositionEnd","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:["topBlur","topCompositionStart","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:["topBlur","topCompositionUpdate","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]}},C=!1,A=null,D={eventTypes:S,extractEvents:function(e,t,n,r){return[u(e,t,n,r),p(e,t,n,r)]}};e.exports=D},function(e,t,n){"use strict";var r=n(450),i=n(25),o=(n(39),n(747),n(1063)),a=n(754),s=n(757),u=(n(10),s(function(e){return a(e)})),l=!1,c="cssFloat";if(i.canUseDOM){var p=document.createElement("div").style;try{p.font=""}catch(e){l=!0}void 0===document.documentElement.style.cssFloat&&(c="styleFloat")}var f={createMarkupForStyles:function(e,t){var n="";for(var r in e)if(e.hasOwnProperty(r)){var i=0===r.indexOf("--"),a=e[r];null!=a&&(n+=u(r)+":",n+=o(r,a,t,i)+";")}return n||null},setValueForStyles:function(e,t,n){var i=e.style;for(var a in t)if(t.hasOwnProperty(a)){var s=0===a.indexOf("--"),u=o(a,t[a],n,s);if("float"!==a&&"cssFloat"!==a||(a=c),s)i.setProperty(a,u);else if(u)i[a]=u;else{var p=l&&r.shorthandPropertyExpansions[a];if(p)for(var f in p)i[f]="";else i[a]=""}}}};e.exports=f},function(e,t,n){"use strict";function r(e,t,n){var r=C.getPooled(T.change,e,t,n);return r.type="change",w.accumulateTwoPhaseDispatches(r),r}function i(e){var t=e.nodeName&&e.nodeName.toLowerCase();return"select"===t||"input"===t&&"file"===e.type}function o(e){var t=r(I,e,D(e));S.batchedUpdates(a,t)}function a(e){x.enqueueEvents(e),x.processEventQueue(!1)}function s(e,t){P=e,I=t,P.attachEvent("onchange",o)}function u(){P&&(P.detachEvent("onchange",o),P=null,I=null)}function l(e,t){var n=A.updateValueIfChanged(e),r=!0===t.simulated&&F._allowSimulatedPassThrough;if(n||r)return e}function c(e,t){if("topChange"===e)return t}function p(e,t,n){"topFocus"===e?(u(),s(t,n)):"topBlur"===e&&u()}function f(e,t){P=e,I=t,P.attachEvent("onpropertychange",d)}function h(){P&&(P.detachEvent("onpropertychange",d),P=null,I=null)}function d(e){"value"===e.propertyName&&l(I,e)&&o(e)}function m(e,t,n){"topFocus"===e?(h(),f(t,n)):"topBlur"===e&&h()}function v(e,t,n){if("topSelectionChange"===e||"topKeyUp"===e||"topKeyDown"===e)return l(I,n)}function g(e){var t=e.nodeName;return t&&"input"===t.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}function y(e,t,n){if("topClick"===e)return l(t,n)}function _(e,t,n){if("topInput"===e||"topChange"===e)return l(t,n)}function b(e,t){if(null!=e){var n=e._wrapperState||t._wrapperState;if(n&&n.controlled&&"number"===t.type){var r=""+t.value;t.getAttribute("value")!==r&&t.setAttribute("value",r)}}}var x=n(122),w=n(123),k=n(25),E=n(14),S=n(44),C=n(51),A=n(466),D=n(252),O=n(253),M=n(468),T={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:["topBlur","topChange","topClick","topFocus","topInput","topKeyDown","topKeyUp","topSelectionChange"]}},P=null,I=null,R=!1;k.canUseDOM&&(R=O("change")&&(!document.documentMode||document.documentMode>8));var j=!1;k.canUseDOM&&(j=O("input")&&(!document.documentMode||document.documentMode>9));var F={eventTypes:T,_allowSimulatedPassThrough:!0,_isInputEventSupported:j,extractEvents:function(e,t,n,o){var a,s,u=t?E.getNodeFromInstance(t):window;if(i(u)?R?a=c:s=p:M(u)?j?a=_:(a=v,s=m):g(u)&&(a=y),a){var l=a(e,t,n);if(l){return r(l,n,o)}}s&&s(e,u,t),"topBlur"===e&&b(t,u)}};e.exports=F},function(e,t,n){"use strict";var r=n(11),i=n(88),o=n(25),a=n(750),s=n(32),u=(n(8),{dangerouslyReplaceNodeWithMarkup:function(e,t){if(o.canUseDOM||r("56"),t||r("57"),"HTML"===e.nodeName&&r("58"),"string"==typeof t){var n=a(t,s)[0];e.parentNode.replaceChild(n,e)}else i.replaceChildWithTree(e,t)}});e.exports=u},function(e,t,n){"use strict";var r=["ResponderEventPlugin","SimpleEventPlugin","TapEventPlugin","EnterLeaveEventPlugin","ChangeEventPlugin","SelectEventPlugin","BeforeInputEventPlugin"];e.exports=r},function(e,t,n){"use strict";var r=n(123),i=n(14),o=n(160),a={mouseEnter:{registrationName:"onMouseEnter",dependencies:["topMouseOut","topMouseOver"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["topMouseOut","topMouseOver"]}},s={eventTypes:a,extractEvents:function(e,t,n,s){if("topMouseOver"===e&&(n.relatedTarget||n.fromElement))return null;if("topMouseOut"!==e&&"topMouseOver"!==e)return null;var u;if(s.window===s)u=s;else{var l=s.ownerDocument;u=l?l.defaultView||l.parentWindow:window}var c,p;if("topMouseOut"===e){c=t;var f=n.relatedTarget||n.toElement;p=f?i.getClosestInstanceFromNode(f):null}else c=null,p=t;if(c===p)return null;var h=null==c?u:i.getNodeFromInstance(c),d=null==p?u:i.getNodeFromInstance(p),m=o.getPooled(a.mouseLeave,c,n,s);m.type="mouseleave",m.target=h,m.relatedTarget=d;var v=o.getPooled(a.mouseEnter,p,n,s);return v.type="mouseenter",v.target=d,v.relatedTarget=h,r.accumulateEnterLeaveDispatches(m,v,c,p),[m,v]}};e.exports=s},function(e,t,n){"use strict";function r(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}var i=n(13),o=n(70),a=n(465);i(r.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[a()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,i=this.getText(),o=i.length;for(e=0;e<r&&n[e]===i[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===i[o-t];t++);var s=t>1?1-t:void 0;return this._fallbackText=i.slice(e,s),this._fallbackText}}),o.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";var r=n(89),i=r.injection.MUST_USE_PROPERTY,o=r.injection.HAS_BOOLEAN_VALUE,a=r.injection.HAS_NUMERIC_VALUE,s=r.injection.HAS_POSITIVE_NUMERIC_VALUE,u=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE,l={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+r.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:o,allowTransparency:0,alt:0,as:0,async:o,autoComplete:0,autoPlay:o,capture:o,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:i|o,cite:0,classID:0,className:0,cols:s,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:o,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:o,defer:o,dir:0,disabled:o,download:u,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:o,formTarget:0,frameBorder:0,headers:0,height:0,hidden:o,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:o,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:i|o,muted:i|o,name:0,nonce:0,noValidate:o,open:o,optimum:0,pattern:0,placeholder:0,playsInline:o,poster:0,preload:0,profile:0,radioGroup:0,readOnly:o,referrerPolicy:0,rel:0,required:o,reversed:o,role:0,rows:s,rowSpan:a,sandbox:0,scope:0,scoped:o,scrolling:0,seamless:o,selected:i|o,shape:0,size:s,sizes:0,span:s,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:a,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:o,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{},DOMMutationMethods:{value:function(e,t){if(null==t)return e.removeAttribute("value");"number"!==e.type||!1===e.hasAttribute("value")?e.setAttribute("value",""+t):e.validity&&!e.validity.badInput&&e.ownerDocument.activeElement!==e&&e.setAttribute("value",""+t)}}};e.exports=l},function(e,t,n){"use strict";(function(t){function r(e,t,n,r){var i=void 0===e[n];null!=t&&i&&(e[n]=o(t,!0))}var i=n(90),o=n(467),a=(n(244),n(254)),s=n(470);n(10);void 0!==t&&n.i({NODE_ENV:"production",WEBPACK_INLINE_STYLES:!1});var u={instantiateChildren:function(e,t,n,i){if(null==e)return null;var o={};return s(e,r,o),o},updateChildren:function(e,t,n,r,s,u,l,c,p){if(t||e){var f,h;for(f in t)if(t.hasOwnProperty(f)){h=e&&e[f];var d=h&&h._currentElement,m=t[f];if(null!=h&&a(d,m))i.receiveComponent(h,m,s,c),t[f]=h;else{h&&(r[f]=i.getHostNode(h),i.unmountComponent(h,!1));var v=o(m,!0);t[f]=v;var g=i.mountComponent(v,s,u,l,c,p);n.push(g)}}for(f in e)!e.hasOwnProperty(f)||t&&t.hasOwnProperty(f)||(h=e[f],r[f]=i.getHostNode(h),i.unmountComponent(h,!1))}},unmountChildren:function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];i.unmountComponent(r,t)}}};e.exports=u}).call(t,n(33))},function(e,t,n){"use strict";var r=n(240),i=n(1027),o={processChildrenUpdates:i.dangerouslyProcessChildrenUpdates,replaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup};e.exports=o},function(e,t,n){"use strict";function r(e){}function i(e){return!(!e.prototype||!e.prototype.isReactComponent)}function o(e){return!(!e.prototype||!e.prototype.isPureReactComponent)}var a=n(11),s=n(13),u=n(92),l=n(246),c=n(52),p=n(247),f=n(124),h=(n(39),n(460)),d=n(90),m=n(144),v=(n(8),n(208)),g=n(254),y=(n(10),{ImpureClass:0,PureClass:1,StatelessFunctional:2});r.prototype.render=function(){var e=f.get(this)._currentElement.type,t=e(this.props,this.context,this.updater);return t};var _=1,b={construct:function(e){this._currentElement=e,this._rootNodeID=0,this._compositeType=null,this._instance=null,this._hostParent=null,this._hostContainerInfo=null,this._updateBatchNumber=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedNodeType=null,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._topLevelWrapper=null,this._pendingCallbacks=null,this._calledComponentWillUnmount=!1},mountComponent:function(e,t,n,s){this._context=s,this._mountOrder=_++,this._hostParent=t,this._hostContainerInfo=n;var l,c=this._currentElement.props,p=this._processContext(s),h=this._currentElement.type,d=e.getUpdateQueue(),v=i(h),g=this._constructComponent(v,c,p,d);v||null!=g&&null!=g.render?o(h)?this._compositeType=y.PureClass:this._compositeType=y.ImpureClass:(l=g,null===g||!1===g||u.isValidElement(g)||a("105",h.displayName||h.name||"Component"),g=new r(h),this._compositeType=y.StatelessFunctional);g.props=c,g.context=p,g.refs=m,g.updater=d,this._instance=g,f.set(g,this);var b=g.state;void 0===b&&(g.state=b=null),("object"!=typeof b||Array.isArray(b))&&a("106",this.getName()||"ReactCompositeComponent"),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1;var x;return x=g.unstable_handleError?this.performInitialMountWithErrorHandling(l,t,n,e,s):this.performInitialMount(l,t,n,e,s),g.componentDidMount&&e.getReactMountReady().enqueue(g.componentDidMount,g),x},_constructComponent:function(e,t,n,r){return this._constructComponentWithoutOwner(e,t,n,r)},_constructComponentWithoutOwner:function(e,t,n,r){var i=this._currentElement.type;return e?new i(t,n,r):i(t,n,r)},performInitialMountWithErrorHandling:function(e,t,n,r,i){var o,a=r.checkpoint();try{o=this.performInitialMount(e,t,n,r,i)}catch(s){r.rollback(a),this._instance.unstable_handleError(s),this._pendingStateQueue&&(this._instance.state=this._processPendingState(this._instance.props,this._instance.context)),a=r.checkpoint(),this._renderedComponent.unmountComponent(!0),r.rollback(a),o=this.performInitialMount(e,t,n,r,i)}return o},performInitialMount:function(e,t,n,r,i){var o=this._instance,a=0;o.componentWillMount&&(o.componentWillMount(),this._pendingStateQueue&&(o.state=this._processPendingState(o.props,o.context))),void 0===e&&(e=this._renderValidatedComponent());var s=h.getType(e);this._renderedNodeType=s;var u=this._instantiateReactComponent(e,s!==h.EMPTY);this._renderedComponent=u;var l=d.mountComponent(u,r,t,n,this._processChildContext(i),a);return l},getHostNode:function(){return d.getHostNode(this._renderedComponent)},unmountComponent:function(e){if(this._renderedComponent){var t=this._instance;if(t.componentWillUnmount&&!t._calledComponentWillUnmount)if(t._calledComponentWillUnmount=!0,e){var n=this.getName()+".componentWillUnmount()";p.invokeGuardedCallback(n,t.componentWillUnmount.bind(t))}else t.componentWillUnmount();this._renderedComponent&&(d.unmountComponent(this._renderedComponent,e),this._renderedNodeType=null,this._renderedComponent=null,this._instance=null),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=0,this._topLevelWrapper=null,f.remove(t)}},_maskContext:function(e){var t=this._currentElement.type,n=t.contextTypes;if(!n)return m;var r={};for(var i in n)r[i]=e[i];return r},_processContext:function(e){var t=this._maskContext(e);return t},_processChildContext:function(e){var t,n=this._currentElement.type,r=this._instance;if(r.getChildContext&&(t=r.getChildContext()),t){"object"!=typeof n.childContextTypes&&a("107",this.getName()||"ReactCompositeComponent");for(var i in t)i in n.childContextTypes||a("108",this.getName()||"ReactCompositeComponent",i);return s({},e,t)}return e},_checkContextTypes:function(e,t,n){},receiveComponent:function(e,t,n){var r=this._currentElement,i=this._context;this._pendingElement=null,this.updateComponent(t,r,e,i,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement?d.receiveComponent(this,this._pendingElement,e,this._context):null!==this._pendingStateQueue||this._pendingForceUpdate?this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context):this._updateBatchNumber=null},updateComponent:function(e,t,n,r,i){var o=this._instance;null==o&&a("136",this.getName()||"ReactCompositeComponent");var s,u=!1;this._context===i?s=o.context:(s=this._processContext(i),u=!0);var l=t.props,c=n.props;t!==n&&(u=!0),u&&o.componentWillReceiveProps&&o.componentWillReceiveProps(c,s);var p=this._processPendingState(c,s),f=!0;this._pendingForceUpdate||(o.shouldComponentUpdate?f=o.shouldComponentUpdate(c,p,s):this._compositeType===y.PureClass&&(f=!v(l,c)||!v(o.state,p))),this._updateBatchNumber=null,f?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,c,p,s,e,i)):(this._currentElement=n,this._context=i,o.props=c,o.state=p,o.context=s)},_processPendingState:function(e,t){var n=this._instance,r=this._pendingStateQueue,i=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!r)return n.state;if(i&&1===r.length)return r[0];for(var o=s({},i?r[0]:n.state),a=i?1:0;a<r.length;a++){var u=r[a];s(o,"function"==typeof u?u.call(n,o,e,t):u)}return o},_performComponentUpdate:function(e,t,n,r,i,o){var a,s,u,l=this._instance,c=Boolean(l.componentDidUpdate);c&&(a=l.props,s=l.state,u=l.context),l.componentWillUpdate&&l.componentWillUpdate(t,n,r),this._currentElement=e,this._context=o,l.props=t,l.state=n,l.context=r,this._updateRenderedComponent(i,o),c&&i.getReactMountReady().enqueue(l.componentDidUpdate.bind(l,a,s,u),l)},_updateRenderedComponent:function(e,t){var n=this._renderedComponent,r=n._currentElement,i=this._renderValidatedComponent(),o=0;if(g(r,i))d.receiveComponent(n,i,e,this._processChildContext(t));else{var a=d.getHostNode(n);d.unmountComponent(n,!1);var s=h.getType(i);this._renderedNodeType=s;var u=this._instantiateReactComponent(i,s!==h.EMPTY);this._renderedComponent=u;var l=d.mountComponent(u,e,this._hostParent,this._hostContainerInfo,this._processChildContext(t),o);this._replaceNodeWithMarkup(a,l,n)}},_replaceNodeWithMarkup:function(e,t,n){l.replaceNodeWithMarkup(e,t,n)},_renderValidatedComponentWithoutOwnerOrContext:function(){var e=this._instance;return e.render()},_renderValidatedComponent:function(){var e;if(this._compositeType!==y.StatelessFunctional){c.current=this;try{e=this._renderValidatedComponentWithoutOwnerOrContext()}finally{c.current=null}}else e=this._renderValidatedComponentWithoutOwnerOrContext();return null===e||!1===e||u.isValidElement(e)||a("109",this.getName()||"ReactCompositeComponent"),e},attachRef:function(e,t){var n=this.getPublicInstance();null==n&&a("110");var r=t.getPublicInstance();(n.refs===m?n.refs={}:n.refs)[e]=r},detachRef:function(e){delete this.getPublicInstance().refs[e]},getName:function(){var e=this._currentElement.type,t=this._instance&&this._instance.constructor;return e.displayName||t&&t.displayName||e.name||t&&t.name||null},getPublicInstance:function(){var e=this._instance;return this._compositeType===y.StatelessFunctional?null:e},_instantiateReactComponent:null};e.exports=b},function(e,t,n){"use strict";var r=n(14),i=n(1035),o=n(459),a=n(90),s=n(44),u=n(1048),l=n(1064),c=n(464),p=n(1071);n(10);i.inject();var f={findDOMNode:l,render:o.render,unmountComponentAtNode:o.unmountComponentAtNode,version:u,unstable_batchedUpdates:s.batchedUpdates,unstable_renderSubtreeIntoContainer:p};"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ComponentTree:{getClosestInstanceFromNode:r.getClosestInstanceFromNode,getNodeFromInstance:function(e){return e._renderedComponent&&(e=c(e)),e?r.getNodeFromInstance(e):null}},Mount:o,Reconciler:a});e.exports=f},function(e,t,n){"use strict";function r(e){if(e){var t=e._currentElement._owner||null;if(t){var n=t.getName();if(n)return" This DOM node was rendered by `"+n+"`."}}return""}function i(e,t){t&&(X[e._tag]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&v("137",e._tag,e._currentElement._owner?" Check the render method of "+e._currentElement._owner.getName()+".":""),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&v("60"),"object"==typeof t.dangerouslySetInnerHTML&&W in t.dangerouslySetInnerHTML||v("61")),null!=t.style&&"object"!=typeof t.style&&v("62",r(e)))}function o(e,t,n,r){if(!(r instanceof R)){var i=e._hostContainerInfo,o=i._node&&i._node.nodeType===H,s=o?i._node:i._ownerDocument;q(t,s),r.getReactMountReady().enqueue(a,{inst:e,registrationName:t,listener:n})}}function a(){var e=this;E.putListener(e.inst,e.registrationName,e.listener)}function s(){var e=this;O.postMountWrapper(e)}function u(){var e=this;P.postMountWrapper(e)}function l(){var e=this;M.postMountWrapper(e)}function c(){F.track(this)}function p(){var e=this;e._rootNodeID||v("63");var t=L(e);switch(t||v("64"),e._tag){case"iframe":case"object":e._wrapperState.listeners=[C.trapBubbledEvent("topLoad","load",t)];break;case"video":case"audio":e._wrapperState.listeners=[];for(var n in G)G.hasOwnProperty(n)&&e._wrapperState.listeners.push(C.trapBubbledEvent(n,G[n],t));break;case"source":e._wrapperState.listeners=[C.trapBubbledEvent("topError","error",t)];break;case"img":e._wrapperState.listeners=[C.trapBubbledEvent("topError","error",t),C.trapBubbledEvent("topLoad","load",t)];break;case"form":e._wrapperState.listeners=[C.trapBubbledEvent("topReset","reset",t),C.trapBubbledEvent("topSubmit","submit",t)];break;case"input":case"select":case"textarea":e._wrapperState.listeners=[C.trapBubbledEvent("topInvalid","invalid",t)]}}function f(){T.postUpdateWrapper(this)}function h(e){Z.call($,e)||(Y.test(e)||v("65",e),$[e]=!0)}function d(e,t){return e.indexOf("-")>=0||null!=t.is}function m(e){var t=e.type;h(t),this._currentElement=e,this._tag=t.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._hostNode=null,this._hostParent=null,this._rootNodeID=0,this._domID=0,this._hostContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0}var v=n(11),g=n(13),y=n(1010),_=n(1012),b=n(88),x=n(241),w=n(89),k=n(452),E=n(122),S=n(242),C=n(159),A=n(453),D=n(14),O=n(1028),M=n(1029),T=n(454),P=n(1032),I=(n(39),n(1041)),R=n(1046),j=(n(32),n(162)),F=(n(8),n(253),n(208),n(466)),N=(n(255),n(10),A),B=E.deleteListener,L=D.getNodeFromInstance,q=C.listenTo,z=S.registrationNameModules,U={string:!0,number:!0},W="__html",V={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null},H=11,G={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},J={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},K={listing:!0,pre:!0,textarea:!0},X=g({menuitem:!0},J),Y=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,$={},Z={}.hasOwnProperty,Q=1;m.displayName="ReactDOMComponent",m.Mixin={mountComponent:function(e,t,n,r){this._rootNodeID=Q++,this._domID=n._idCounter++,this._hostParent=t,this._hostContainerInfo=n;var o=this._currentElement.props;switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":this._wrapperState={listeners:null},e.getReactMountReady().enqueue(p,this);break;case"input":O.mountWrapper(this,o,t),o=O.getHostProps(this,o),e.getReactMountReady().enqueue(c,this),e.getReactMountReady().enqueue(p,this);break;case"option":M.mountWrapper(this,o,t),o=M.getHostProps(this,o);break;case"select":T.mountWrapper(this,o,t),o=T.getHostProps(this,o),e.getReactMountReady().enqueue(p,this);break;case"textarea":P.mountWrapper(this,o,t),o=P.getHostProps(this,o),e.getReactMountReady().enqueue(c,this),e.getReactMountReady().enqueue(p,this)}i(this,o);var a,f;null!=t?(a=t._namespaceURI,f=t._tag):n._tag&&(a=n._namespaceURI,f=n._tag),(null==a||a===x.svg&&"foreignobject"===f)&&(a=x.html),a===x.html&&("svg"===this._tag?a=x.svg:"math"===this._tag&&(a=x.mathml)),this._namespaceURI=a;var h;if(e.useCreateElement){var d,m=n._ownerDocument;if(a===x.html)if("script"===this._tag){var v=m.createElement("div"),g=this._currentElement.type;v.innerHTML="<"+g+"></"+g+">",d=v.removeChild(v.firstChild)}else d=o.is?m.createElement(this._currentElement.type,o.is):m.createElement(this._currentElement.type);else d=m.createElementNS(a,this._currentElement.type);D.precacheNode(this,d),this._flags|=N.hasCachedChildNodes,this._hostParent||k.setAttributeForRoot(d),this._updateDOMProperties(null,o,e);var _=b(d);this._createInitialChildren(e,o,r,_),h=_}else{var w=this._createOpenTagMarkupAndPutListeners(e,o),E=this._createContentMarkup(e,o,r);h=!E&&J[this._tag]?w+"/>":w+">"+E+"</"+this._currentElement.type+">"}switch(this._tag){case"input":e.getReactMountReady().enqueue(s,this),o.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"textarea":e.getReactMountReady().enqueue(u,this),o.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"select":case"button":o.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"option":e.getReactMountReady().enqueue(l,this)}return h},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(null!=i)if(z.hasOwnProperty(r))i&&o(this,r,i,e);else{"style"===r&&(i&&(i=this._previousStyleCopy=g({},t.style)),i=_.createMarkupForStyles(i,this));var a=null;null!=this._tag&&d(this._tag,t)?V.hasOwnProperty(r)||(a=k.createMarkupForCustomAttribute(r,i)):a=k.createMarkupForProperty(r,i),a&&(n+=" "+a)}}return e.renderToStaticMarkup?n:(this._hostParent||(n+=" "+k.createMarkupForRoot()),n+=" "+k.createMarkupForID(this._domID))},_createContentMarkup:function(e,t,n){var r="",i=t.dangerouslySetInnerHTML;if(null!=i)null!=i.__html&&(r=i.__html);else{var o=U[typeof t.children]?t.children:null,a=null!=o?null:t.children;if(null!=o)r=j(o);else if(null!=a){var s=this.mountChildren(a,e,n);r=s.join("")}}return K[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var i=t.dangerouslySetInnerHTML;if(null!=i)null!=i.__html&&b.queueHTML(r,i.__html);else{var o=U[typeof t.children]?t.children:null,a=null!=o?null:t.children;if(null!=o)""!==o&&b.queueText(r,o);else if(null!=a)for(var s=this.mountChildren(a,e,n),u=0;u<s.length;u++)b.queueChild(r,s[u])}},receiveComponent:function(e,t,n){var r=this._currentElement;this._currentElement=e,this.updateComponent(t,r,e,n)},updateComponent:function(e,t,n,r){var o=t.props,a=this._currentElement.props;switch(this._tag){case"input":o=O.getHostProps(this,o),a=O.getHostProps(this,a);break;case"option":o=M.getHostProps(this,o),a=M.getHostProps(this,a);break;case"select":o=T.getHostProps(this,o),a=T.getHostProps(this,a);break;case"textarea":o=P.getHostProps(this,o),a=P.getHostProps(this,a)}switch(i(this,a),this._updateDOMProperties(o,a,e),this._updateDOMChildren(o,a,e,r),this._tag){case"input":O.updateWrapper(this),F.updateValueIfChanged(this);break;case"textarea":P.updateWrapper(this);break;case"select":e.getReactMountReady().enqueue(f,this)}},_updateDOMProperties:function(e,t,n){var r,i,a;for(r in e)if(!t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&null!=e[r])if("style"===r){var s=this._previousStyleCopy;for(i in s)s.hasOwnProperty(i)&&(a=a||{},a[i]="");this._previousStyleCopy=null}else z.hasOwnProperty(r)?e[r]&&B(this,r):d(this._tag,e)?V.hasOwnProperty(r)||k.deleteValueForAttribute(L(this),r):(w.properties[r]||w.isCustomAttribute(r))&&k.deleteValueForProperty(L(this),r);for(r in t){var u=t[r],l="style"===r?this._previousStyleCopy:null!=e?e[r]:void 0;if(t.hasOwnProperty(r)&&u!==l&&(null!=u||null!=l))if("style"===r)if(u?u=this._previousStyleCopy=g({},u):this._previousStyleCopy=null,l){for(i in l)!l.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(a=a||{},a[i]="");for(i in u)u.hasOwnProperty(i)&&l[i]!==u[i]&&(a=a||{},a[i]=u[i])}else a=u;else if(z.hasOwnProperty(r))u?o(this,r,u,n):l&&B(this,r);else if(d(this._tag,t))V.hasOwnProperty(r)||k.setValueForAttribute(L(this),r,u);else if(w.properties[r]||w.isCustomAttribute(r)){var c=L(this);null!=u?k.setValueForProperty(c,r,u):k.deleteValueForProperty(c,r)}}a&&_.setValueForStyles(L(this),a,this)},_updateDOMChildren:function(e,t,n,r){var i=U[typeof e.children]?e.children:null,o=U[typeof t.children]?t.children:null,a=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,s=t.dangerouslySetInnerHTML&&t.dangerouslySetInnerHTML.__html,u=null!=i?null:e.children,l=null!=o?null:t.children,c=null!=i||null!=a,p=null!=o||null!=s;null!=u&&null==l?this.updateChildren(null,n,r):c&&!p&&this.updateTextContent(""),null!=o?i!==o&&this.updateTextContent(""+o):null!=s?a!==s&&this.updateMarkup(""+s):null!=l&&this.updateChildren(l,n,r)},getHostNode:function(){return L(this)},unmountComponent:function(e){switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":var t=this._wrapperState.listeners;if(t)for(var n=0;n<t.length;n++)t[n].remove();break;case"input":case"textarea":F.stopTracking(this);break;case"html":case"head":case"body":v("66",this._tag)}this.unmountChildren(e),D.uncacheNode(this),E.deleteAllListeners(this),this._rootNodeID=0,this._domID=0,this._wrapperState=null},getPublicInstance:function(){return L(this)}},g(m.prototype,m.Mixin,I.Mixin),e.exports=m},function(e,t,n){"use strict";function r(e,t){var n={_topLevelWrapper:e,_idCounter:1,_ownerDocument:t?t.nodeType===i?t:t.ownerDocument:null,_node:t,_tag:t?t.nodeName.toLowerCase():null,_namespaceURI:t?t.namespaceURI:null};return n}var i=(n(255),9);e.exports=r},function(e,t,n){"use strict";var r=n(13),i=n(88),o=n(14),a=function(e){this._currentElement=null,this._hostNode=null,this._hostParent=null,this._hostContainerInfo=null,this._domID=0};r(a.prototype,{mountComponent:function(e,t,n,r){var a=n._idCounter++;this._domID=a,this._hostParent=t,this._hostContainerInfo=n;var s=" react-empty: "+this._domID+" ";if(e.useCreateElement){var u=n._ownerDocument,l=u.createComment(s);return o.precacheNode(this,l),i(l)}return e.renderToStaticMarkup?"":"\x3c!--"+s+"--\x3e"},receiveComponent:function(){},getHostNode:function(){return o.getNodeFromInstance(this)},unmountComponent:function(){o.uncacheNode(this)}}),e.exports=a},function(e,t,n){"use strict";var r={useCreateElement:!0,useFiber:!1};e.exports=r},function(e,t,n){"use strict";var r=n(240),i=n(14),o={dangerouslyProcessChildrenUpdates:function(e,t){var n=i.getNodeFromInstance(e);r.processUpdates(n,t)}};e.exports=o},function(e,t,n){"use strict";function r(){this._rootNodeID&&f.updateWrapper(this)}function i(e){return"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}function o(e){var t=this._currentElement.props,n=l.executeOnChange(t,e);p.asap(r,this);var i=t.name;if("radio"===t.type&&null!=i){for(var o=c.getNodeFromInstance(this),s=o;s.parentNode;)s=s.parentNode;for(var u=s.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),f=0;f<u.length;f++){var h=u[f];if(h!==o&&h.form===o.form){var d=c.getInstanceFromNode(h);d||a("90"),p.asap(r,d)}}}return n}var a=n(11),s=n(13),u=n(452),l=n(245),c=n(14),p=n(44),f=(n(8),n(10),{getHostProps:function(e,t){var n=l.getValue(t),r=l.getChecked(t);return s({type:void 0,step:void 0,min:void 0,max:void 0},t,{defaultChecked:void 0,defaultValue:void 0,value:null!=n?n:e._wrapperState.initialValue,checked:null!=r?r:e._wrapperState.initialChecked,onChange:e._wrapperState.onChange})},mountWrapper:function(e,t){var n=t.defaultValue;e._wrapperState={initialChecked:null!=t.checked?t.checked:t.defaultChecked,initialValue:null!=t.value?t.value:n,listeners:null,onChange:o.bind(e),controlled:i(t)}},updateWrapper:function(e){var t=e._currentElement.props,n=t.checked;null!=n&&u.setValueForProperty(c.getNodeFromInstance(e),"checked",n||!1);var r=c.getNodeFromInstance(e),i=l.getValue(t);if(null!=i)if(0===i&&""===r.value)r.value="0";else if("number"===t.type){var o=parseFloat(r.value,10)||0;(i!=o||i==o&&r.value!=i)&&(r.value=""+i)}else r.value!==""+i&&(r.value=""+i);else null==t.value&&null!=t.defaultValue&&r.defaultValue!==""+t.defaultValue&&(r.defaultValue=""+t.defaultValue),null==t.checked&&null!=t.defaultChecked&&(r.defaultChecked=!!t.defaultChecked)},postMountWrapper:function(e){var t=e._currentElement.props,n=c.getNodeFromInstance(e);switch(t.type){case"submit":case"reset":break;case"color":case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":n.value="",n.value=n.defaultValue;break;default:n.value=n.value}var r=n.name;""!==r&&(n.name=""),n.defaultChecked=!n.defaultChecked,n.defaultChecked=!n.defaultChecked,""!==r&&(n.name=r)}});e.exports=f},function(e,t,n){"use strict";function r(e){var t="";return o.Children.forEach(e,function(e){null!=e&&("string"==typeof e||"number"==typeof e?t+=e:u||(u=!0))}),t}var i=n(13),o=n(92),a=n(14),s=n(454),u=(n(10),!1),l={mountWrapper:function(e,t,n){var i=null;if(null!=n){var o=n;"optgroup"===o._tag&&(o=o._hostParent),null!=o&&"select"===o._tag&&(i=s.getSelectValueContext(o))}var a=null;if(null!=i){var u;if(u=null!=t.value?t.value+"":r(t.children),a=!1,Array.isArray(i)){for(var l=0;l<i.length;l++)if(""+i[l]===u){a=!0;break}}else a=""+i===u}e._wrapperState={selected:a}},postMountWrapper:function(e){var t=e._currentElement.props;if(null!=t.value){a.getNodeFromInstance(e).setAttribute("value",t.value)}},getHostProps:function(e,t){var n=i({selected:void 0,children:void 0},t);null!=e._wrapperState.selected&&(n.selected=e._wrapperState.selected);var o=r(t.children);return o&&(n.children=o),n}};e.exports=l},function(e,t,n){"use strict";function r(e,t,n,r){return e===n&&t===r}function i(e){var t=document.selection,n=t.createRange(),r=n.text.length,i=n.duplicate();i.moveToElementText(e),i.setEndPoint("EndToStart",n);var o=i.text.length;return{start:o,end:o+r}}function o(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.anchorNode,i=t.anchorOffset,o=t.focusNode,a=t.focusOffset,s=t.getRangeAt(0);try{s.startContainer.nodeType,s.endContainer.nodeType}catch(e){return null}var u=r(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset),l=u?0:s.toString().length,c=s.cloneRange();c.selectNodeContents(e),c.setEnd(s.startContainer,s.startOffset);var p=r(c.startContainer,c.startOffset,c.endContainer,c.endOffset),f=p?0:c.toString().length,h=f+l,d=document.createRange();d.setStart(n,i),d.setEnd(o,a);var m=d.collapsed;return{start:m?h:f,end:m?f:h}}function a(e,t){var n,r,i=document.selection.createRange().duplicate();void 0===t.end?(n=t.start,r=n):t.start>t.end?(n=t.end,r=t.start):(n=t.start,r=t.end),i.moveToElementText(e),i.moveStart("character",n),i.setEndPoint("EndToStart",i),i.moveEnd("character",r-n),i.select()}function s(e,t){if(window.getSelection){var n=window.getSelection(),r=e[c()].length,i=Math.min(t.start,r),o=void 0===t.end?i:Math.min(t.end,r);if(!n.extend&&i>o){var a=o;o=i,i=a}var s=l(e,i),u=l(e,o);if(s&&u){var p=document.createRange();p.setStart(s.node,s.offset),n.removeAllRanges(),i>o?(n.addRange(p),n.extend(u.node,u.offset)):(p.setEnd(u.node,u.offset),n.addRange(p))}}}var u=n(25),l=n(1068),c=n(465),p=u.canUseDOM&&"selection"in document&&!("getSelection"in window),f={getOffsets:p?i:o,setOffsets:p?a:s};e.exports=f},function(e,t,n){"use strict";var r=n(11),i=n(13),o=n(240),a=n(88),s=n(14),u=n(162),l=(n(8),n(255),function(e){this._currentElement=e,this._stringText=""+e,this._hostNode=null,this._hostParent=null,this._domID=0,this._mountIndex=0,this._closingComment=null,this._commentNodes=null});i(l.prototype,{mountComponent:function(e,t,n,r){var i=n._idCounter++,o=" react-text: "+i+" ";if(this._domID=i,this._hostParent=t,e.useCreateElement){var l=n._ownerDocument,c=l.createComment(o),p=l.createComment(" /react-text "),f=a(l.createDocumentFragment());return a.queueChild(f,a(c)),this._stringText&&a.queueChild(f,a(l.createTextNode(this._stringText))),a.queueChild(f,a(p)),s.precacheNode(this,c),this._closingComment=p,f}var h=u(this._stringText);return e.renderToStaticMarkup?h:"\x3c!--"+o+"--\x3e"+h+"\x3c!-- /react-text --\x3e"},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var r=this.getHostNode();o.replaceDelimitedText(r[0],r[1],n)}}},getHostNode:function(){var e=this._commentNodes;if(e)return e;if(!this._closingComment)for(var t=s.getNodeFromInstance(this),n=t.nextSibling;;){if(null==n&&r("67",this._domID),8===n.nodeType&&" /react-text "===n.nodeValue){this._closingComment=n;break}n=n.nextSibling}return e=[this._hostNode,this._closingComment],this._commentNodes=e,e},unmountComponent:function(){this._closingComment=null,this._commentNodes=null,s.uncacheNode(this)}}),e.exports=l},function(e,t,n){"use strict";function r(){this._rootNodeID&&c.updateWrapper(this)}function i(e){var t=this._currentElement.props,n=s.executeOnChange(t,e);return l.asap(r,this),n}var o=n(11),a=n(13),s=n(245),u=n(14),l=n(44),c=(n(8),n(10),{getHostProps:function(e,t){return null!=t.dangerouslySetInnerHTML&&o("91"),a({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue,onChange:e._wrapperState.onChange})},mountWrapper:function(e,t){var n=s.getValue(t),r=n;if(null==n){var a=t.defaultValue,u=t.children;null!=u&&(null!=a&&o("92"),Array.isArray(u)&&(u.length<=1||o("93"),u=u[0]),a=""+u),null==a&&(a=""),r=a}e._wrapperState={initialValue:""+r,listeners:null,onChange:i.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,n=u.getNodeFromInstance(e),r=s.getValue(t);if(null!=r){var i=""+r;i!==n.value&&(n.value=i),null==t.defaultValue&&(n.defaultValue=i)}null!=t.defaultValue&&(n.defaultValue=t.defaultValue)},postMountWrapper:function(e){var t=u.getNodeFromInstance(e),n=t.textContent;n===e._wrapperState.initialValue&&(t.value=n)}});e.exports=c},function(e,t,n){"use strict";function r(e,t){"_hostNode"in e||u("33"),"_hostNode"in t||u("33");for(var n=0,r=e;r;r=r._hostParent)n++;for(var i=0,o=t;o;o=o._hostParent)i++;for(;n-i>0;)e=e._hostParent,n--;for(;i-n>0;)t=t._hostParent,i--;for(var a=n;a--;){if(e===t)return e;e=e._hostParent,t=t._hostParent}return null}function i(e,t){"_hostNode"in e||u("35"),"_hostNode"in t||u("35");for(;t;){if(t===e)return!0;t=t._hostParent}return!1}function o(e){return"_hostNode"in e||u("36"),e._hostParent}function a(e,t,n){for(var r=[];e;)r.push(e),e=e._hostParent;var i;for(i=r.length;i-- >0;)t(r[i],"captured",n);for(i=0;i<r.length;i++)t(r[i],"bubbled",n)}function s(e,t,n,i,o){for(var a=e&&t?r(e,t):null,s=[];e&&e!==a;)s.push(e),e=e._hostParent;for(var u=[];t&&t!==a;)u.push(t),t=t._hostParent;var l;for(l=0;l<s.length;l++)n(s[l],"bubbled",i);for(l=u.length;l-- >0;)n(u[l],"captured",o)}var u=n(11);n(8);e.exports={isAncestor:i,getLowestCommonAncestor:r,getParentInstance:o,traverseTwoPhase:a,traverseEnterLeave:s}},function(e,t,n){"use strict";function r(){this.reinitializeTransaction()}var i=n(13),o=n(44),a=n(161),s=n(32),u={initialize:s,close:function(){f.isBatchingUpdates=!1}},l={initialize:s,close:o.flushBatchedUpdates.bind(o)},c=[l,u];i(r.prototype,a,{getTransactionWrappers:function(){return c}});var p=new r,f={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,i,o){var a=f.isBatchingUpdates;return f.isBatchingUpdates=!0,a?e(t,n,r,i,o):p.perform(e,null,t,n,r,i,o)}};e.exports=f},function(e,t,n){"use strict";function r(){k||(k=!0,y.EventEmitter.injectReactEventListener(g),y.EventPluginHub.injectEventPluginOrder(s),y.EventPluginUtils.injectComponentTree(f),y.EventPluginUtils.injectTreeTraversal(d),y.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:w,EnterLeaveEventPlugin:u,ChangeEventPlugin:a,SelectEventPlugin:x,BeforeInputEventPlugin:o}),y.HostComponent.injectGenericComponentClass(p),y.HostComponent.injectTextComponentClass(m),y.DOMProperty.injectDOMPropertyConfig(i),y.DOMProperty.injectDOMPropertyConfig(l),y.DOMProperty.injectDOMPropertyConfig(b),y.EmptyComponent.injectEmptyComponentFactory(function(e){return new h(e)}),y.Updates.injectReconcileTransaction(_),y.Updates.injectBatchingStrategy(v),y.Component.injectEnvironment(c))}var i=n(1009),o=n(1011),a=n(1013),s=n(1015),u=n(1016),l=n(1018),c=n(1020),p=n(1023),f=n(14),h=n(1025),d=n(1033),m=n(1031),v=n(1034),g=n(1038),y=n(1039),_=n(1044),b=n(1049),x=n(1050),w=n(1051),k=!1;e.exports={inject:r}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";function r(e){i.enqueueEvents(e),i.processEventQueue(!1)}var i=n(122),o={handleTopLevel:function(e,t,n,o){r(i.extractEvents(e,t,n,o))}};e.exports=o},function(e,t,n){"use strict";function r(e){for(;e._hostParent;)e=e._hostParent;var t=p.getNodeFromInstance(e),n=t.parentNode;return p.getClosestInstanceFromNode(n)}function i(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function o(e){var t=h(e.nativeEvent),n=p.getClosestInstanceFromNode(t),i=n;do{e.ancestors.push(i),i=i&&r(i)}while(i);for(var o=0;o<e.ancestors.length;o++)n=e.ancestors[o],m._handleTopLevel(e.topLevelType,n,e.nativeEvent,h(e.nativeEvent))}function a(e){e(d(window))}var s=n(13),u=n(377),l=n(25),c=n(70),p=n(14),f=n(44),h=n(252),d=n(752);s(i.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),c.addPoolingTo(i,c.twoArgumentPooler);var m={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:l.canUseDOM?window:null,setHandleTopLevel:function(e){m._handleTopLevel=e},setEnabled:function(e){m._enabled=!!e},isEnabled:function(){return m._enabled},trapBubbledEvent:function(e,t,n){return n?u.listen(n,t,m.dispatchEvent.bind(null,e)):null},trapCapturedEvent:function(e,t,n){return n?u.capture(n,t,m.dispatchEvent.bind(null,e)):null},monitorScrollValue:function(e){var t=a.bind(null,e);u.listen(window,"scroll",t)},dispatchEvent:function(e,t){if(m._enabled){var n=i.getPooled(e,t);try{f.batchedUpdates(o,n)}finally{i.release(n)}}}};e.exports=m},function(e,t,n){"use strict";var r=n(89),i=n(122),o=n(243),a=n(246),s=n(455),u=n(159),l=n(457),c=n(44),p={Component:a.injection,DOMProperty:r.injection,EmptyComponent:s.injection,EventPluginHub:i.injection,EventPluginUtils:o.injection,EventEmitter:u.injection,HostComponent:l.injection,Updates:c.injection};e.exports=p},function(e,t,n){"use strict";var r=n(1062),i=/\/?>/,o=/^<\!\-\-/,a={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return o.test(e)?e:e.replace(i," "+a.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(a.CHECKSUM_ATTR_NAME);return n=n&&parseInt(n,10),r(e)===n}};e.exports=a},function(e,t,n){"use strict";function r(e,t,n){return{type:"INSERT_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:n,afterNode:t}}function i(e,t,n){return{type:"MOVE_EXISTING",content:null,fromIndex:e._mountIndex,fromNode:f.getHostNode(e),toIndex:n,afterNode:t}}function o(e,t){return{type:"REMOVE_NODE",content:null,fromIndex:e._mountIndex,fromNode:t,toIndex:null,afterNode:null}}function a(e){return{type:"SET_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function s(e){return{type:"TEXT_CONTENT",content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function u(e,t){return t&&(e=e||[],e.push(t)),e}function l(e,t){p.processChildrenUpdates(e,t)}var c=n(11),p=n(246),f=(n(124),n(39),n(52),n(90)),h=n(1019),d=(n(32),n(1065)),m=(n(8),{Mixin:{_reconcilerInstantiateChildren:function(e,t,n){return h.instantiateChildren(e,t,n)},_reconcilerUpdateChildren:function(e,t,n,r,i,o){var a,s=0;return a=d(t,s),h.updateChildren(e,a,n,r,i,this,this._hostContainerInfo,o,s),a},mountChildren:function(e,t,n){var r=this._reconcilerInstantiateChildren(e,t,n);this._renderedChildren=r;var i=[],o=0;for(var a in r)if(r.hasOwnProperty(a)){var s=r[a],u=0,l=f.mountComponent(s,t,this,this._hostContainerInfo,n,u);s._mountIndex=o++,i.push(l)}return i},updateTextContent:function(e){var t=this._renderedChildren;h.unmountChildren(t,!1);for(var n in t)t.hasOwnProperty(n)&&c("118");l(this,[s(e)])},updateMarkup:function(e){var t=this._renderedChildren;h.unmountChildren(t,!1);for(var n in t)t.hasOwnProperty(n)&&c("118");l(this,[a(e)])},updateChildren:function(e,t,n){this._updateChildren(e,t,n)},_updateChildren:function(e,t,n){var r=this._renderedChildren,i={},o=[],a=this._reconcilerUpdateChildren(r,e,o,i,t,n);if(a||r){var s,c=null,p=0,h=0,d=0,m=null;for(s in a)if(a.hasOwnProperty(s)){var v=r&&r[s],g=a[s];v===g?(c=u(c,this.moveChild(v,m,p,h)),h=Math.max(v._mountIndex,h),v._mountIndex=p):(v&&(h=Math.max(v._mountIndex,h)),c=u(c,this._mountChildAtIndex(g,o[d],m,p,t,n)),d++),p++,m=f.getHostNode(g)}for(s in i)i.hasOwnProperty(s)&&(c=u(c,this._unmountChild(r[s],i[s])));c&&l(this,c),this._renderedChildren=a}},unmountChildren:function(e){var t=this._renderedChildren;h.unmountChildren(t,e),this._renderedChildren=null},moveChild:function(e,t,n,r){if(e._mountIndex<r)return i(e,t,n)},createChild:function(e,t,n){return r(n,t,e._mountIndex)},removeChild:function(e,t){return o(e,t)},_mountChildAtIndex:function(e,t,n,r,i,o){return e._mountIndex=r,this.createChild(e,n,t)},_unmountChild:function(e,t){var n=this.removeChild(e,t);return e._mountIndex=null,n}}});e.exports=m},function(e,t,n){"use strict";function r(e){return!(!e||"function"!=typeof e.attachRef||"function"!=typeof e.detachRef)}var i=n(11),o=(n(8),{addComponentAsRefTo:function(e,t,n){r(n)||i("119"),n.attachRef(t,e)},removeComponentAsRefFrom:function(e,t,n){r(n)||i("120");var o=n.getPublicInstance();o&&o.refs[t]===e.getPublicInstance()&&n.detachRef(t)}});e.exports=o},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=o.getPooled(null),this.useCreateElement=e}var i=n(13),o=n(451),a=n(70),s=n(159),u=n(458),l=(n(39),n(161)),c=n(248),p={initialize:u.getSelectionInformation,close:u.restoreSelection},f={initialize:function(){var e=s.isEnabled();return s.setEnabled(!1),e},close:function(e){s.setEnabled(e)}},h={initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}},d=[p,f,h],m={getTransactionWrappers:function(){return d},getReactMountReady:function(){return this.reactMountReady},getUpdateQueue:function(){return c},checkpoint:function(){return this.reactMountReady.checkpoint()},rollback:function(e){this.reactMountReady.rollback(e)},destructor:function(){o.release(this.reactMountReady),this.reactMountReady=null}};i(r.prototype,l,m),a.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";function r(e,t,n){"function"==typeof e?e(t.getPublicInstance()):o.addComponentAsRefTo(t,e,n)}function i(e,t,n){"function"==typeof e?e(null):o.removeComponentAsRefFrom(t,e,n)}var o=n(1042),a={};a.attachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&r(n,e,t._owner)}},a.shouldUpdateRefs=function(e,t){var n=null,r=null;null!==e&&"object"==typeof e&&(n=e.ref,r=e._owner);var i=null,o=null;return null!==t&&"object"==typeof t&&(i=t.ref,o=t._owner),n!==i||"string"==typeof i&&o!==r},a.detachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&i(n,e,t._owner)}},e.exports=a},function(e,t,n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.useCreateElement=!1,this.updateQueue=new s(this)}var i=n(13),o=n(70),a=n(161),s=(n(39),n(1047)),u=[],l={enqueue:function(){}},c={getTransactionWrappers:function(){return u},getReactMountReady:function(){return l},getUpdateQueue:function(){return this.updateQueue},destructor:function(){},checkpoint:function(){},rollback:function(){}};i(r.prototype,a,c),o.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=n(248),o=(n(10),function(){function e(t){r(this,e),this.transaction=t}return e.prototype.isMounted=function(e){return!1},e.prototype.enqueueCallback=function(e,t,n){this.transaction.isInTransaction()&&i.enqueueCallback(e,t,n)},e.prototype.enqueueForceUpdate=function(e){this.transaction.isInTransaction()&&i.enqueueForceUpdate(e)},e.prototype.enqueueReplaceState=function(e,t){this.transaction.isInTransaction()&&i.enqueueReplaceState(e,t)},e.prototype.enqueueSetState=function(e,t){this.transaction.isInTransaction()&&i.enqueueSetState(e,t)},e}());e.exports=o},function(e,t,n){"use strict";e.exports="15.6.2"},function(e,t,n){"use strict";var r={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},i={accentHeight:"accent-height",accumulate:0,additive:0,alignmentBaseline:"alignment-baseline",allowReorder:"allowReorder",alphabetic:0,amplitude:0,arabicForm:"arabic-form",ascent:0,attributeName:"attributeName",attributeType:"attributeType",autoReverse:"autoReverse",azimuth:0,baseFrequency:"baseFrequency",baseProfile:"baseProfile",baselineShift:"baseline-shift",bbox:0,begin:0,bias:0,by:0,calcMode:"calcMode",capHeight:"cap-height",clip:0,clipPath:"clip-path",clipRule:"clip-rule",clipPathUnits:"clipPathUnits",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",contentScriptType:"contentScriptType",contentStyleType:"contentStyleType",cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:"diffuseConstant",direction:0,display:0,divisor:0,dominantBaseline:"dominant-baseline",dur:0,dx:0,dy:0,edgeMode:"edgeMode",elevation:0,enableBackground:"enable-background",end:0,exponent:0,externalResourcesRequired:"externalResourcesRequired",fill:0,fillOpacity:"fill-opacity",fillRule:"fill-rule",filter:0,filterRes:"filterRes",filterUnits:"filterUnits",floodColor:"flood-color",floodOpacity:"flood-opacity",focusable:0,fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",glyphRef:"glyphRef",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",hanging:0,horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",ideographic:0,imageRendering:"image-rendering",in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:"kernelMatrix",kernelUnitLength:"kernelUnitLength",kerning:0,keyPoints:"keyPoints",keySplines:"keySplines",keyTimes:"keyTimes",lengthAdjust:"lengthAdjust",letterSpacing:"letter-spacing",lightingColor:"lighting-color",limitingConeAngle:"limitingConeAngle",local:0,markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",markerHeight:"markerHeight",markerUnits:"markerUnits",markerWidth:"markerWidth",mask:0,maskContentUnits:"maskContentUnits",maskUnits:"maskUnits",mathematical:0,mode:0,numOctaves:"numOctaves",offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pathLength:"pathLength",patternContentUnits:"patternContentUnits",patternTransform:"patternTransform",patternUnits:"patternUnits",pointerEvents:"pointer-events",points:0,pointsAtX:"pointsAtX",pointsAtY:"pointsAtY",pointsAtZ:"pointsAtZ",preserveAlpha:"preserveAlpha",preserveAspectRatio:"preserveAspectRatio",primitiveUnits:"primitiveUnits",r:0,radius:0,refX:"refX",refY:"refY",renderingIntent:"rendering-intent",repeatCount:"repeatCount",repeatDur:"repeatDur",requiredExtensions:"requiredExtensions",requiredFeatures:"requiredFeatures",restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:"shape-rendering",slope:0,spacing:0,specularConstant:"specularConstant",specularExponent:"specularExponent",speed:0,spreadMethod:"spreadMethod",startOffset:"startOffset",stdDeviation:"stdDeviation",stemh:0,stemv:0,stitchTiles:"stitchTiles",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",string:0,stroke:0,strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",surfaceScale:"surfaceScale",systemLanguage:"systemLanguage",tableValues:"tableValues",targetX:"targetX",targetY:"targetY",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",textLength:"textLength",to:0,transform:0,u1:0,u2:0,underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicode:0,unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",values:0,vectorEffect:"vector-effect",version:0,vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewBox",viewTarget:"viewTarget",visibility:0,widths:0,wordSpacing:"word-spacing",writingMode:"writing-mode",x:0,xHeight:"x-height",x1:0,x2:0,xChannelSelector:"xChannelSelector",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlns:0,xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space",y:0,y1:0,y2:0,yChannelSelector:"yChannelSelector",z:0,zoomAndPan:"zoomAndPan"},o={Properties:{},DOMAttributeNamespaces:{xlinkActuate:r.xlink,xlinkArcrole:r.xlink,xlinkHref:r.xlink,xlinkRole:r.xlink,xlinkShow:r.xlink,xlinkTitle:r.xlink,xlinkType:r.xlink,xmlBase:r.xml,xmlLang:r.xml,xmlSpace:r.xml},DOMAttributeNames:{}};Object.keys(i).forEach(function(e){o.Properties[e]=0,i[e]&&(o.DOMAttributeNames[e]=i[e])}),e.exports=o},function(e,t,n){"use strict";function r(e){if("selectionStart"in e&&u.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(window.getSelection){var t=window.getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}if(document.selection){var n=document.selection.createRange();return{parentElement:n.parentElement(),text:n.text,top:n.boundingTop,left:n.boundingLeft}}}function i(e,t){if(y||null==m||m!==c())return null;var n=r(m);if(!g||!f(g,n)){g=n;var i=l.getPooled(d.select,v,e,t);return i.type="select",i.target=m,o.accumulateTwoPhaseDispatches(i),i}return null}var o=n(123),a=n(25),s=n(14),u=n(458),l=n(51),c=n(379),p=n(468),f=n(208),h=a.canUseDOM&&"documentMode"in document&&document.documentMode<=11,d={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:["topBlur","topContextMenu","topFocus","topKeyDown","topKeyUp","topMouseDown","topMouseUp","topSelectionChange"]}},m=null,v=null,g=null,y=!1,_=!1,b={eventTypes:d,extractEvents:function(e,t,n,r){if(!_)return null;var o=t?s.getNodeFromInstance(t):window;switch(e){case"topFocus":(p(o)||"true"===o.contentEditable)&&(m=o,v=t,g=null);break;case"topBlur":m=null,v=null,g=null;break;case"topMouseDown":y=!0;break;case"topContextMenu":case"topMouseUp":return y=!1,i(n,r);case"topSelectionChange":if(h)break;case"topKeyDown":case"topKeyUp":return i(n,r)}return null},didPutListener:function(e,t,n){"onSelect"===t&&(_=!0)}};e.exports=b},function(e,t,n){"use strict";function r(e){return"."+e._rootNodeID}function i(e){return"button"===e||"input"===e||"select"===e||"textarea"===e}var o=n(11),a=n(377),s=n(123),u=n(14),l=n(1052),c=n(1053),p=n(51),f=n(1056),h=n(1058),d=n(160),m=n(1055),v=n(1059),g=n(1060),y=n(125),_=n(1061),b=n(32),x=n(250),w=(n(8),{}),k={};["abort","animationEnd","animationIteration","animationStart","blur","canPlay","canPlayThrough","click","contextMenu","copy","cut","doubleClick","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","durationChange","emptied","encrypted","ended","error","focus","input","invalid","keyDown","keyPress","keyUp","load","loadedData","loadedMetadata","loadStart","mouseDown","mouseMove","mouseOut","mouseOver","mouseUp","paste","pause","play","playing","progress","rateChange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeUpdate","touchCancel","touchEnd","touchMove","touchStart","transitionEnd","volumeChange","waiting","wheel"].forEach(function(e){var t=e[0].toUpperCase()+e.slice(1),n="on"+t,r="top"+t,i={phasedRegistrationNames:{bubbled:n,captured:n+"Capture"},dependencies:[r]};w[e]=i,k[r]=i});var E={},S={eventTypes:w,extractEvents:function(e,t,n,r){var i=k[e];if(!i)return null;var a;switch(e){case"topAbort":case"topCanPlay":case"topCanPlayThrough":case"topDurationChange":case"topEmptied":case"topEncrypted":case"topEnded":case"topError":case"topInput":case"topInvalid":case"topLoad":case"topLoadedData":case"topLoadedMetadata":case"topLoadStart":case"topPause":case"topPlay":case"topPlaying":case"topProgress":case"topRateChange":case"topReset":case"topSeeked":case"topSeeking":case"topStalled":case"topSubmit":case"topSuspend":case"topTimeUpdate":case"topVolumeChange":case"topWaiting":a=p;break;case"topKeyPress":if(0===x(n))return null;case"topKeyDown":case"topKeyUp":a=h;break;case"topBlur":case"topFocus":a=f;break;case"topClick":if(2===n.button)return null;case"topDoubleClick":case"topMouseDown":case"topMouseMove":case"topMouseUp":case"topMouseOut":case"topMouseOver":case"topContextMenu":a=d;break;case"topDrag":case"topDragEnd":case"topDragEnter":case"topDragExit":case"topDragLeave":case"topDragOver":case"topDragStart":case"topDrop":a=m;break;case"topTouchCancel":case"topTouchEnd":case"topTouchMove":case"topTouchStart":a=v;break;case"topAnimationEnd":case"topAnimationIteration":case"topAnimationStart":a=l;break;case"topTransitionEnd":a=g;break;case"topScroll":a=y;break;case"topWheel":a=_;break;case"topCopy":case"topCut":case"topPaste":a=c}a||o("86",e);var u=a.getPooled(i,t,n,r);return s.accumulateTwoPhaseDispatches(u),u},didPutListener:function(e,t,n){if("onClick"===t&&!i(e._tag)){var o=r(e),s=u.getNodeFromInstance(e);E[o]||(E[o]=a.listen(s,"click",b))}},willDeleteListener:function(e,t){if("onClick"===t&&!i(e._tag)){var n=r(e);E[n].remove(),delete E[n]}}};e.exports=S},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(51),o={animationName:null,elapsedTime:null,pseudoElement:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(51),o={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(51),o={data:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(160),o={dataTransfer:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(125),o={relatedTarget:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(51),o={data:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(125),o=n(250),a=n(1066),s=n(251),u={key:a,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:s,charCode:function(e){return"keypress"===e.type?o(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?o(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};i.augmentClass(r,u),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(125),o=n(251),a={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:o};i.augmentClass(r,a),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(51),o={propertyName:null,elapsedTime:null,pseudoElement:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(160),o={deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e){for(var t=1,n=0,r=0,o=e.length,a=-4&o;r<a;){for(var s=Math.min(r+4096,a);r<s;r+=4)n+=(t+=e.charCodeAt(r))+(t+=e.charCodeAt(r+1))+(t+=e.charCodeAt(r+2))+(t+=e.charCodeAt(r+3));t%=i,n%=i}for(;r<o;r++)n+=t+=e.charCodeAt(r);return t%=i,n%=i,t|n<<16}var i=65521;e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){if(null==t||"boolean"==typeof t||""===t)return"";var i=isNaN(t);if(r||i||0===t||o.hasOwnProperty(e)&&o[e])return""+t;if("string"==typeof t){t=t.trim()}return t+"px"}var i=n(450),o=(n(10),i.isUnitlessNumber);e.exports=r},function(e,t,n){"use strict";function r(e){if(null==e)return null;if(1===e.nodeType)return e;var t=a.get(e);if(t)return t=s(t),t?o.getNodeFromInstance(t):null;"function"==typeof e.render?i("44"):i("45",Object.keys(e))}var i=n(11),o=(n(52),n(14)),a=n(124),s=n(464);n(8),n(10);e.exports=r},function(e,t,n){"use strict";(function(t){function r(e,t,n,r){if(e&&"object"==typeof e){var i=e,o=void 0===i[n];o&&null!=t&&(i[n]=t)}}function i(e,t){if(null==e)return e;var n={};return o(e,r,n),n}var o=(n(244),n(470));n(10);void 0!==t&&n.i({NODE_ENV:"production",WEBPACK_INLINE_STYLES:!1}),e.exports=i}).call(t,n(33))},function(e,t,n){"use strict";function r(e){if(e.key){var t=o[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=i(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?a[e.keyCode]||"Unidentified":""}var i=n(250),o={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};e.exports=r},function(e,t,n){"use strict";function r(e){var t=e&&(i&&e[i]||e[o]);if("function"==typeof t)return t}var i="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";e.exports=r},function(e,t,n){"use strict";function r(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function i(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function o(e,t){for(var n=r(e),o=0,a=0;n;){if(3===n.nodeType){if(a=o+n.textContent.length,o<=t&&a>=t)return{node:n,offset:t-o};o=a}n=r(i(n))}}e.exports=o},function(e,t,n){"use strict";function r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}function i(e){if(s[e])return s[e];if(!a[e])return e;var t=a[e];for(var n in t)if(t.hasOwnProperty(n)&&n in u)return s[e]=t[n];return""}var o=n(25),a={animationend:r("Animation","AnimationEnd"),animationiteration:r("Animation","AnimationIteration"),animationstart:r("Animation","AnimationStart"),transitionend:r("Transition","TransitionEnd")},s={},u={};o.canUseDOM&&(u=document.createElement("div").style,"AnimationEvent"in window||(delete a.animationend.animation,delete a.animationiteration.animation,delete a.animationstart.animation),"TransitionEvent"in window||delete a.transitionend.transition),e.exports=i},function(e,t,n){"use strict";function r(e){return'"'+i(e)+'"'}var i=n(162);e.exports=r},function(e,t,n){"use strict";var r=n(459);e.exports=r.renderSubtreeIntoContainer},function(e,t,n){!function(e,r){r(t,n(0),n(7))}(0,function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t=t&&"default"in t?t.default:t;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),s(t,[{key:"shouldComponentUpdate",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.state||{};return!(this.updateOnProps||Object.keys(a({},e,this.props))).every(function(r){return n.is(e[r],t.props[r])})||!(this.updateOnStates||Object.keys(a({},r,i))).every(function(e){return n.is(r[e],i[e])})}}]),t}(t.Component);e.ImmutablePureComponent=u,e.default=u,Object.defineProperty(e,"__esModule",{value:!0})})},function(e,t,n){"use strict";function r(e){return{doc:new B,blocks:M,blockStarts:T,tip:this.doc,oldtip:this.doc,currentLine:"",lineNumber:0,offset:0,column:0,nextNonspace:0,nextNonspaceColumn:0,indent:0,indented:!1,blank:!1,allClosed:!0,lastMatchedContainer:this.doc,refmap:{},lastLineLength:0,inlineParser:new u(e),findNextNonspace:R,advanceOffset:P,advanceNextNonspace:I,breakOutOfLists:E,addLine:S,addChild:C,incorporateLine:j,finalize:F,processInlines:N,closeUnmatchedBlocks:O,parse:L,options:e||{}}}var i=n(256),o=n(91).unescapeString,a=n(91).OPENTAG,s=n(91).CLOSETAG,u=n(1077),l=[/./,/^<(?:script|pre|style)(?:\s|>|$)/i,/^<!--/,/^<[?]/,/^<![A-Z]/,/^<!\[CDATA\[/,/^<[\/]?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|title|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|[\/]?[>]|$)/i,new RegExp("^(?:"+a+"|"+s+")s*$","i")],c=[/./,/<\/(?:script|pre|style)>/i,/-->/,/\?>/,/>/,/\]\]>/],p=/^(?:(?:\* *){3,}|(?:_ *){3,}|(?:- *){3,}) *$/,f=/^[#`~*+_=<>0-9-]/,h=/[^ \t\f\v\r\n]/,d=/^[*+-]/,m=/^(\d{1,9})([.)])/,v=/^#{1,6}(?: +|$)/,g=/^`{3,}(?!.*`)|^~{3,}(?!.*~)/,y=/^(?:`{3,}|~{3,})(?= *$)/,_=/^(?:=+|-+) *$/,b=/\r\n|\n|\r/,x=function(e){return!h.test(e)},w=function(e,t){return t<e.length?e.charCodeAt(t):-1},k=function(e){for(;e;){if(e._lastLineBlank)return!0;var t=e.type;if("List"!==t&&"Item"!==t)break;e=e._lastChild}return!1},E=function(e){var t=e,n=null;do{"List"===t.type&&(n=t),t=t._parent}while(t);if(n){for(;e!==n;)this.finalize(e,this.lineNumber),e=e._parent;this.finalize(n,this.lineNumber),this.tip=n._parent}},S=function(){this.tip._string_content+=this.currentLine.slice(this.offset)+"\n"},C=function(e,t){for(;!this.blocks[this.tip.type].canContain(e);)this.finalize(this.tip,this.lineNumber-1);var n=t+1,r=new i(e,[[this.lineNumber,n],[0,0]]);return r._string_content="",this.tip.appendChild(r),this.tip=r,r},A=function(e){var t,n,r,i,o=e.currentLine.slice(e.nextNonspace),a={type:null,tight:!0,bulletChar:null,start:null,delimiter:null,padding:null,markerOffset:e.indent};if(t=o.match(d))a.type="Bullet",a.bulletChar=t[0][0];else{if(!(t=o.match(m)))return null;a.type="Ordered",a.start=parseInt(t[1]),a.delimiter=t[2]}if(-1!==(n=w(e.currentLine,e.nextNonspace+t[0].length))&&9!==n&&32!==n)return null;e.advanceNextNonspace(),e.advanceOffset(t[0].length,!0),r=e.column,i=e.offset;do{e.advanceOffset(1,!0),n=w(e.currentLine,e.offset)}while(e.column-r<5&&(32===n||9===n));var s=-1===w(e.currentLine,e.offset),u=e.column-r;return u>=5||u<1||s?(a.padding=t[0].length+1,e.column=r,e.offset=i,32===w(e.currentLine,e.offset)&&e.advanceOffset(1,!0)):a.padding=t[0].length+u,a},D=function(e,t){return e.type===t.type&&e.delimiter===t.delimiter&&e.bulletChar===t.bulletChar},O=function(){if(!this.allClosed){for(;this.oldtip!==this.lastMatchedContainer;){var e=this.oldtip._parent;this.finalize(this.oldtip,this.lineNumber-1),this.oldtip=e}this.allClosed=!0}},M={Document:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"Item"!==e},acceptsLines:!1},List:{continue:function(){return 0},finalize:function(e,t){for(var n=t._firstChild;n;){if(k(n)&&n._next){t._listData.tight=!1;break}for(var r=n._firstChild;r;){if(k(r)&&(n._next||r._next)){t._listData.tight=!1;break}r=r._next}n=n._next}},canContain:function(e){return"Item"===e},acceptsLines:!1},BlockQuote:{continue:function(e){var t=e.currentLine;return e.indented||62!==w(t,e.nextNonspace)?1:(e.advanceNextNonspace(),e.advanceOffset(1,!1),32===w(t,e.offset)&&e.offset++,0)},finalize:function(){},canContain:function(e){return"Item"!==e},acceptsLines:!1},Item:{continue:function(e,t){if(e.blank&&null!==t._firstChild)e.advanceNextNonspace();else{if(!(e.indent>=t._listData.markerOffset+t._listData.padding))return 1;e.advanceOffset(t._listData.markerOffset+t._listData.padding,!0)}return 0},finalize:function(){},canContain:function(e){return"Item"!==e},acceptsLines:!1},Heading:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},ThematicBreak:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},CodeBlock:{continue:function(e,t){var n=e.currentLine,r=e.indent;if(t._isFenced){var i=r<=3&&n.charAt(e.nextNonspace)===t._fenceChar&&n.slice(e.nextNonspace).match(y);if(i&&i[0].length>=t._fenceLength)return e.finalize(t,e.lineNumber),2;for(var o=t._fenceOffset;o>0&&32===w(n,e.offset);)e.advanceOffset(1,!1),o--}else if(r>=4)e.advanceOffset(4,!0);else{if(!e.blank)return 1;e.advanceNextNonspace()}return 0},finalize:function(e,t){if(t._isFenced){var n=t._string_content,r=n.indexOf("\n"),i=n.slice(0,r),a=n.slice(r+1);t.info=o(i.trim()),t._literal=a}else t._literal=t._string_content.replace(/(\n *)+$/,"\n");t._string_content=null},canContain:function(){return!1},acceptsLines:!0},HtmlBlock:{continue:function(e,t){return!e.blank||6!==t._htmlBlockType&&7!==t._htmlBlockType?0:1},finalize:function(e,t){t._literal=t._string_content.replace(/(\n *)+$/,""),t._string_content=null},canContain:function(){return!1},acceptsLines:!0},Paragraph:{continue:function(e){return e.blank?1:0},finalize:function(e,t){for(var n,r=!1;91===w(t._string_content,0)&&(n=e.inlineParser.parseReference(t._string_content,e.refmap));)t._string_content=t._string_content.slice(n),r=!0;r&&x(t._string_content)&&t.unlink()},canContain:function(){return!1},acceptsLines:!0}},T=[function(e){return e.indented||62!==w(e.currentLine,e.nextNonspace)?0:(e.advanceNextNonspace(),e.advanceOffset(1,!1),32===w(e.currentLine,e.offset)&&e.advanceOffset(1,!1),e.closeUnmatchedBlocks(),e.addChild("BlockQuote",e.nextNonspace),1)},function(e){var t;if(!e.indented&&(t=e.currentLine.slice(e.nextNonspace).match(v))){e.advanceNextNonspace(),e.advanceOffset(t[0].length,!1),e.closeUnmatchedBlocks();var n=e.addChild("Heading",e.nextNonspace);return n.level=t[0].trim().length,n._string_content=e.currentLine.slice(e.offset).replace(/^ *#+ *$/,"").replace(/ +#+ *$/,""),e.advanceOffset(e.currentLine.length-e.offset),2}return 0},function(e){var t;if(!e.indented&&(t=e.currentLine.slice(e.nextNonspace).match(g))){var n=t[0].length;e.closeUnmatchedBlocks();var r=e.addChild("CodeBlock",e.nextNonspace);return r._isFenced=!0,r._fenceLength=n,r._fenceChar=t[0][0],r._fenceOffset=e.indent,e.advanceNextNonspace(),e.advanceOffset(n,!1),2}return 0},function(e,t){if(!e.indented&&60===w(e.currentLine,e.nextNonspace)){var n,r=e.currentLine.slice(e.nextNonspace);for(n=1;n<=7;n++)if(l[n].test(r)&&(n<7||"Paragraph"!==t.type)){e.closeUnmatchedBlocks();var i=e.addChild("HtmlBlock",e.offset);return i._htmlBlockType=n,2}}return 0},function(e,t){var n;if(!e.indented&&"Paragraph"===t.type&&(n=e.currentLine.slice(e.nextNonspace).match(_))){e.closeUnmatchedBlocks();var r=new i("Heading",t.sourcepos);return r.level="="===n[0][0]?1:2,r._string_content=t._string_content,t.insertAfter(r),t.unlink(),e.tip=r,e.advanceOffset(e.currentLine.length-e.offset,!1),2}return 0},function(e){return!e.indented&&p.test(e.currentLine.slice(e.nextNonspace))?(e.closeUnmatchedBlocks(),e.addChild("ThematicBreak",e.nextNonspace),e.advanceOffset(e.currentLine.length-e.offset,!1),2):0},function(e,t){var n;return e.indented&&"List"!==t.type||!(n=A(e))?0:(e.closeUnmatchedBlocks(),"List"===e.tip.type&&D(t._listData,n)||(t=e.addChild("List",e.nextNonspace),t._listData=n),t=e.addChild("Item",e.nextNonspace),t._listData=n,1)},function(e){return e.indented&&"Paragraph"!==e.tip.type&&!e.blank?(e.advanceOffset(4,!0),e.closeUnmatchedBlocks(),e.addChild("CodeBlock",e.offset),2):0}],P=function(e,t){for(var n,r,i=0,o=this.currentLine;e>0&&(r=o[this.offset]);)"\t"===r?(n=4-this.column%4,this.column+=n,this.offset+=1,e-=t?n:1):(i+=1,this.offset+=1,this.column+=1,e-=1)},I=function(){this.offset=this.nextNonspace,this.column=this.nextNonspaceColumn},R=function(){for(var e,t=this.currentLine,n=this.offset,r=this.column;""!==(e=t.charAt(n));)if(" "===e)n++,r++;else{if("\t"!==e)break;n++,r+=4-r%4}this.blank="\n"===e||"\r"===e||""===e,this.nextNonspace=n,this.nextNonspaceColumn=r,this.indent=this.nextNonspaceColumn-this.column,this.indented=this.indent>=4},j=function(e){var t,n=!0,r=this.doc;this.oldtip=this.tip,this.offset=0,this.column=0,this.lineNumber+=1,-1!==e.indexOf("\0")&&(e=e.replace(/\0/g,"�")),this.currentLine=e;for(var i;(i=r._lastChild)&&i._open;){switch(r=i,this.findNextNonspace(),this.blocks[r.type].continue(this,r)){case 0:break;case 1:n=!1;break;case 2:return void(this.lastLineLength=e.length);default:throw"continue returned illegal value, must be 0, 1, or 2"}if(!n){r=r._parent;break}}this.allClosed=r===this.oldtip,this.lastMatchedContainer=r,this.blank&&r._lastLineBlank&&(this.breakOutOfLists(r),r=this.tip);for(var o="Paragraph"!==r.type&&M[r.type].acceptsLines,a=this.blockStarts,s=a.length;!o;){if(this.findNextNonspace(),!this.indented&&!f.test(e.slice(this.nextNonspace))){this.advanceNextNonspace();break}for(var u=0;u<s;){var l=a[u](this,r);if(1===l){r=this.tip;break}if(2===l){r=this.tip,o=!0;break}u++}if(u===s){this.advanceNextNonspace();break}}if(this.allClosed||this.blank||"Paragraph"!==this.tip.type){this.closeUnmatchedBlocks(),this.blank&&r.lastChild&&(r.lastChild._lastLineBlank=!0),t=r.type;for(var p=this.blank&&!("BlockQuote"===t||"CodeBlock"===t&&r._isFenced||"Item"===t&&!r._firstChild&&r.sourcepos[0][0]===this.lineNumber),h=r;h;)h._lastLineBlank=p,h=h._parent;this.blocks[t].acceptsLines?(this.addLine(),"HtmlBlock"===t&&r._htmlBlockType>=1&&r._htmlBlockType<=5&&c[r._htmlBlockType].test(this.currentLine.slice(this.offset))&&this.finalize(r,this.lineNumber)):this.offset<e.length&&!this.blank&&(r=this.addChild("Paragraph",this.offset),this.advanceNextNonspace(),this.addLine())}else this.addLine();this.lastLineLength=e.length},F=function(e,t){var n=e._parent;e._open=!1,e.sourcepos[1]=[t,this.lastLineLength],this.blocks[e.type].finalize(this,e),this.tip=n},N=function(e){var t,n,r,i=e.walker();for(this.inlineParser.refmap=this.refmap,this.inlineParser.options=this.options;n=i.next();)t=n.node,r=t.type,n.entering||"Paragraph"!==r&&"Heading"!==r||this.inlineParser.parse(t)},B=function(){return new i("Document",[[1,1],[0,0]])},L=function(e){this.doc=new B,this.tip=this.doc,this.refmap={},this.lineNumber=0,this.lastLineLength=0,this.offset=0,this.column=0,this.lastMatchedContainer=this.doc,this.currentLine="",this.options.time&&console.time("preparing input");var t=e.split(b),n=t.length;10===e.charCodeAt(e.length-1)&&(n-=1),this.options.time&&console.timeEnd("preparing input"),this.options.time&&console.time("block parsing");for(var r=0;r<n;r++)this.incorporateLine(t[r]);for(;this.tip;)this.finalize(this.tip,n);return this.options.time&&console.timeEnd("block parsing"),this.options.time&&console.time("inline parsing"),this.processInlines(this.doc),this.options.time&&console.timeEnd("inline parsing"),this.doc};e.exports=r},function(e,t,n){"use strict";/*! http://mths.be/fromcodepoint v0.2.1 by @mathias */ -if(String.fromCodePoint)e.exports=function(e){try{return String.fromCodePoint(e)}catch(e){if(e instanceof RangeError)return String.fromCharCode(65533);throw e}};else{var r=String.fromCharCode,i=Math.floor,o=function(){var e,t,n=[],o=-1,a=arguments.length;if(!a)return"";for(var s="";++o<a;){var u=Number(arguments[o]);if(!isFinite(u)||u<0||u>1114111||i(u)!==u)return String.fromCharCode(65533);u<=65535?n.push(u):(u-=65536,e=55296+(u>>10),t=u%1024+56320,n.push(e,t)),(o+1===a||n.length>16384)&&(s+=r.apply(null,n),n.length=0)}return s};e.exports=o}},function(e,t,n){"use strict";function r(e){return{softbreak:"\n",escape:i,options:e||{},render:c}}var i=n(91).escapeXml,o=function(e,t,n){var r="<"+e;if(t&&t.length>0)for(var i,o=0;void 0!==(i=t[o]);)r+=" "+i[0]+'="'+i[1]+'"',o++;return n&&(r+=" /"),r+=">"},a=/\<[^>]*\>/,s=/^javascript:|vbscript:|file:|data:/i,u=/^data:image\/(?:png|gif|jpeg|webp)/i,l=function(e){return s.test(e)&&!u.test(e)},c=function(e){var t,n,r,i,s,u,c,p=e.walker(),f="",h="\n",d=0,m=function(e){f+=d>0?e.replace(a,""):e,h=e},v=this.escape,g=function(){"\n"!==h&&(f+="\n",h="\n")},y=this.options;for(y.time&&console.time("rendering");i=p.next();){if(u=i.entering,s=i.node,t=[],y.sourcepos){var _=s.sourcepos;_&&t.push(["data-sourcepos",String(_[0][0])+":"+String(_[0][1])+"-"+String(_[1][0])+":"+String(_[1][1])])}switch(s.type){case"Text":m(v(s.literal,!1));break;case"Softbreak":m(this.softbreak);break;case"Hardbreak":m(o("br",[],!0)),g();break;case"Emph":m(o(u?"em":"/em"));break;case"Strong":m(o(u?"strong":"/strong"));break;case"HtmlInline":m(y.safe?"\x3c!-- raw HTML omitted --\x3e":s.literal);break;case"CustomInline":u&&s.onEnter?m(s.onEnter):!u&&s.onExit&&m(s.onExit);break;case"Link":u?(y.safe&&l(s.destination)||t.push(["href",v(s.destination,!0)]),s.title&&t.push(["title",v(s.title,!0)]),m(o("a",t))):m(o("/a"));break;case"Image":u?(0===d&&m(y.safe&&l(s.destination)?'<img src="" alt="':'<img src="'+v(s.destination,!0)+'" alt="'),d+=1):0===(d-=1)&&(s.title&&m('" title="'+v(s.title,!0)),m('" />'));break;case"Code":m(o("code")+v(s.literal,!1)+o("/code"));break;case"Document":break;case"Paragraph":if(null!==(c=s.parent.parent)&&"List"===c.type&&c.listTight)break;u?(g(),m(o("p",t))):(m(o("/p")),g());break;case"BlockQuote":u?(g(),m(o("blockquote",t)),g()):(g(),m(o("/blockquote")),g());break;case"Item":u?m(o("li",t)):(m(o("/li")),g());break;case"List":if(r="Bullet"===s.listType?"ul":"ol",u){var b=s.listStart;null!==b&&1!==b&&t.push(["start",b.toString()]),g(),m(o(r,t)),g()}else g(),m(o("/"+r)),g();break;case"Heading":r="h"+s.level,u?(g(),m(o(r,t))):(m(o("/"+r)),g());break;case"CodeBlock":n=s.info?s.info.split(/\s+/):[],n.length>0&&n[0].length>0&&t.push(["class","language-"+v(n[0],!0)]),g(),m(o("pre")+o("code",t)),m(v(s.literal,!1)),m(o("/code")+o("/pre")),g();break;case"HtmlBlock":g(),m(y.safe?"\x3c!-- raw HTML omitted --\x3e":s.literal),g();break;case"CustomBlock":g(),u&&s.onEnter?m(s.onEnter):!u&&s.onExit&&m(s.onExit),g();break;case"ThematicBreak":g(),m(o("hr",t,!0)),g();break;default:throw"Unknown node type "+s.type}}return y.time&&console.timeEnd("rendering"),f};e.exports=r},function(e,t,n){"use strict";e.exports.version="0.24.0",e.exports.Node=n(256),e.exports.Parser=n(1073),e.exports.HtmlRenderer=n(1075),e.exports.XmlRenderer=n(1079)},function(e,t,n){"use strict";function r(e){return{subject:"",delimiters:null,pos:0,refmap:{},match:N,peek:B,spnl:L,parseBackticks:q,parseBackslash:z,parseAutolink:U,parseHtmlTag:W,scanDelims:V,handleDelim:H,parseLinkTitle:X,parseLinkDestination:Y,parseLinkLabel:$,parseOpenBracket:Z,parseCloseBracket:ee,parseBang:Q,parseEntity:te,parseString:ne,parseNewline:re,parseReference:ie,parseInline:oe,processEmphasis:K,removeDelimiter:G,options:e||{},parse:ae}}var i=n(256),o=n(91),a=n(1078),s=o.normalizeURI,u=o.unescapeString,l=n(1074),c=n(114).decodeHTML;n(494);var p=o.ESCAPABLE,f="\\\\"+p,h="\\(([^\\\\()\\x00-\\x20]|"+f+"|\\\\)*\\)",d=o.ENTITY,m=o.reHtmlTag,v=new RegExp(/^[\u2000-\u206F\u2E00-\u2E7F\\'!"#\$%&\(\)\*\+,\-\.\/:;<=>\?@\[\]\^_`\{\|\}~]/),g=new RegExp('^(?:"('+f+'|[^"\\x00])*"|\'('+f+"|[^'\\x00])*'|\\(("+f+"|[^)\\x00])*\\))"),y=new RegExp("^(?:[<](?:[^ <>\\t\\n\\\\\\x00]|"+f+"|\\\\)*[>])"),_=new RegExp("^(?:[^\\\\()\\x00-\\x20]+|"+f+"|\\\\|"+h+")*"),b=new RegExp("^"+p),x=new RegExp("^"+d,"i"),w=/`+/,k=/^`+/,E=/\.\.\./g,S=/--+/g,C=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,A=/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>/i,D=/^ *(?:\n *)?/,O=/^\s/,M=/\s+/g,T=/ *$/,P=/^ */,I=/^ *(?:\n|$)/,R=new RegExp("^\\[(?:[^\\\\\\[\\]]|"+f+"|\\\\){0,1000}\\]"),j=/^[^\n`\[\]\\!<&*_'"]+/m,F=function(e){var t=new i("Text");return t._literal=e,t},N=function(e){var t=e.exec(this.subject.slice(this.pos));return null===t?null:(this.pos+=t.index+t[0].length,t[0])},B=function(){return this.pos<this.subject.length?this.subject.charCodeAt(this.pos):-1},L=function(){return this.match(D),!0},q=function(e){var t=this.match(k);if(null===t)return!1;for(var n,r,o=this.pos;null!==(n=this.match(w));)if(n===t)return r=new i("Code"),r._literal=this.subject.slice(o,this.pos-t.length).trim().replace(M," "),e.appendChild(r),!0;return this.pos=o,e.appendChild(F(t)),!0},z=function(e){var t,n=this.subject;return this.pos+=1,10===this.peek()?(this.pos+=1,t=new i("Hardbreak"),e.appendChild(t)):b.test(n.charAt(this.pos))?(e.appendChild(F(n.charAt(this.pos))),this.pos+=1):e.appendChild(F("\\")),!0},U=function(e){var t,n,r;return(t=this.match(C))?(n=t.slice(1,t.length-1),r=new i("Link"),r._destination=s("mailto:"+n),r._title="",r.appendChild(F(n)),e.appendChild(r),!0):!!(t=this.match(A))&&(n=t.slice(1,t.length-1),r=new i("Link"),r._destination=s(n),r._title="",r.appendChild(F(n)),e.appendChild(r),!0)},W=function(e){var t=this.match(m);if(null===t)return!1;var n=new i("HtmlInline");return n._literal=t,e.appendChild(n),!0},V=function(e){var t,n,r,i,o,a,s,u,c,p,f,h=0,d=this.pos;if(39===e||34===e)h++,this.pos++;else for(;this.peek()===e;)h++,this.pos++;return 0===h?null:(t=0===d?"\n":this.subject.charAt(d-1),r=this.peek(),n=-1===r?"\n":l(r),u=O.test(n),c=v.test(n),p=O.test(t),f=v.test(t),i=!(u||c&&!p&&!f),o=!(p||f&&!u&&!c),95===e?(a=i&&(!o||f),s=o&&(!i||c)):39===e||34===e?(a=i&&!o,s=o):(a=i,s=o),this.pos=d,{numdelims:h,can_open:a,can_close:s})},H=function(e,t){var n=this.scanDelims(e);if(!n)return!1;var r,i=n.numdelims,o=this.pos;this.pos+=i,r=39===e?"’":34===e?"“":this.subject.slice(o,this.pos);var a=F(r);return t.appendChild(a),this.delimiters={cc:e,numdelims:i,node:a,previous:this.delimiters,next:null,can_open:n.can_open,can_close:n.can_close,active:!0},null!==this.delimiters.previous&&(this.delimiters.previous.next=this.delimiters),!0},G=function(e){null!==e.previous&&(e.previous.next=e.next),null===e.next?this.delimiters=e.previous:e.next.previous=e.previous},J=function(e,t){e.next!==t&&(e.next=t,t.previous=e)},K=function(e){var t,n,r,o,a,s,u,l,c,p,f=[];for(f[95]=e,f[42]=e,f[39]=e,f[34]=e,n=this.delimiters;null!==n&&n.previous!==e;)n=n.previous;for(;null!==n;){var h=n.cc;if(!n.can_close||95!==h&&42!==h&&39!==h&&34!==h)n=n.next;else{for(t=n.previous,p=!1;null!==t&&t!==e&&t!==f[h];){if(t.cc===n.cc&&t.can_open){p=!0;break}t=t.previous}if(r=n,42===h||95===h)if(p){u=n.numdelims<3||t.numdelims<3?n.numdelims<=t.numdelims?n.numdelims:t.numdelims:n.numdelims%2==0?2:1,o=t.node,a=n.node,t.numdelims-=u,n.numdelims-=u,o._literal=o._literal.slice(0,o._literal.length-u),a._literal=a._literal.slice(0,a._literal.length-u);var d=new i(1===u?"Emph":"Strong");for(l=o._next;l&&l!==a;)c=l._next,l.unlink(),d.appendChild(l),l=c;o.insertAfter(d),J(t,n),0===t.numdelims&&(o.unlink(),this.removeDelimiter(t)),0===n.numdelims&&(a.unlink(),s=n.next,this.removeDelimiter(n),n=s)}else n=n.next;else 39===h?(n.node._literal="’",p&&(t.node._literal="‘"),n=n.next):34===h&&(n.node._literal="”",p&&(t.node.literal="“"),n=n.next);p||(f[h]=r.previous,r.can_open||this.removeDelimiter(r))}}for(;null!==this.delimiters&&this.delimiters!==e;)this.removeDelimiter(this.delimiters)},X=function(){var e=this.match(g);return null===e?null:u(e.substr(1,e.length-2))},Y=function(){var e=this.match(y);return null===e?(e=this.match(_),null===e?null:s(u(e))):s(u(e.substr(1,e.length-2)))},$=function(){var e=this.match(R);return null===e||e.length>1001?0:e.length},Z=function(e){var t=this.pos;this.pos+=1;var n=F("[");return e.appendChild(n),this.delimiters={cc:91,numdelims:1,node:n,previous:this.delimiters,next:null,can_open:!0,can_close:!1,index:t,active:!0},null!==this.delimiters.previous&&(this.delimiters.previous.next=this.delimiters),!0},Q=function(e){var t=this.pos;if(this.pos+=1,91===this.peek()){this.pos+=1;var n=F("![");e.appendChild(n),this.delimiters={cc:33,numdelims:1,node:n,previous:this.delimiters,next:null,can_open:!0,can_close:!1,index:t+1,active:!0},null!==this.delimiters.previous&&(this.delimiters.previous.next=this.delimiters)}else e.appendChild(F("!"));return!0},ee=function(e){var t,n,r,o,s,u,l=!1;for(this.pos+=1,t=this.pos,u=this.delimiters;null!==u&&91!==u.cc&&33!==u.cc;)u=u.previous;if(null===u)return e.appendChild(F("]")),!0;if(!u.active)return e.appendChild(F("]")),this.removeDelimiter(u),!0;if(n=33===u.cc,40===this.peek())this.pos++,this.spnl()&&null!==(r=this.parseLinkDestination())&&this.spnl()&&(O.test(this.subject.charAt(this.pos-1))&&(o=this.parseLinkTitle()),!0)&&this.spnl()&&41===this.peek()&&(this.pos+=1,l=!0);else{var c=this.pos,p=this.pos,f=this.parseLinkLabel();s=0===f||2===f?this.subject.slice(u.index,t):this.subject.slice(p,p+f),0===f&&(this.pos=c);var h=this.refmap[a(s)];h&&(r=h.destination,o=h.title,l=!0)}if(l){var d=new i(n?"Image":"Link");d._destination=r,d._title=o||"";var m,v;for(m=u.node._next;m;)v=m._next,m.unlink(),d.appendChild(m),m=v;if(e.appendChild(d),this.processEmphasis(u.previous),u.node.unlink(),!n)for(u=this.delimiters;null!==u;)91===u.cc&&(u.active=!1),u=u.previous;return!0}return this.removeDelimiter(u),this.pos=t,e.appendChild(F("]")),!0},te=function(e){var t;return!!(t=this.match(x))&&(e.appendChild(F(c(t))),!0)},ne=function(e){var t;return!!(t=this.match(j))&&(this.options.smart?e.appendChild(F(t.replace(E,"…").replace(S,function(e){var t=0,n=0;return e.length%3==0?n=e.length/3:e.length%2==0?t=e.length/2:e.length%3==2?(t=1,n=(e.length-2)/3):(t=2,n=(e.length-4)/3),"—".repeat(n)+"–".repeat(t)}))):e.appendChild(F(t)),!0)},re=function(e){this.pos+=1;var t=e._lastChild;if(t&&"Text"===t.type&&" "===t._literal[t._literal.length-1]){var n=" "===t._literal[t._literal.length-2];t._literal=t._literal.replace(T,""),e.appendChild(new i(n?"Hardbreak":"Softbreak"))}else e.appendChild(new i("Softbreak"));return this.match(P),!0},ie=function(e,t){this.subject=e,this.pos=0;var n,r,i,o,s=this.pos;if(0===(o=this.parseLinkLabel()))return 0;if(n=this.subject.substr(0,o),58!==this.peek())return this.pos=s,0;if(this.pos++,this.spnl(),null===(r=this.parseLinkDestination())||0===r.length)return this.pos=s,0;var u=this.pos;this.spnl(),null===(i=this.parseLinkTitle())&&(i="",this.pos=u);var l=!0;if(null===this.match(I)&&(""===i?l=!1:(i="",this.pos=u,l=null!==this.match(I))),!l)return this.pos=s,0;var c=a(n);return""===c?(this.pos=s,0):(t[c]||(t[c]={destination:r,title:i}),this.pos-s)},oe=function(e){var t=!1,n=this.peek();if(-1===n)return!1;switch(n){case 10:t=this.parseNewline(e);break;case 92:t=this.parseBackslash(e);break;case 96:t=this.parseBackticks(e);break;case 42:case 95:t=this.handleDelim(n,e);break;case 39:case 34:t=this.options.smart&&this.handleDelim(n,e);break;case 91:t=this.parseOpenBracket(e);break;case 33:t=this.parseBang(e);break;case 93:t=this.parseCloseBracket(e);break;case 60:t=this.parseAutolink(e)||this.parseHtmlTag(e);break;case 38:t=this.parseEntity(e);break;default:t=this.parseString(e)}return t||(this.pos+=1,e.appendChild(F(l(n)))),!0},ae=function(e){for(this.subject=e._string_content.trim(),this.pos=0,this.delimiters=null;this.parseInline(e););e._string_content=null,this.processEmphasis(null)};e.exports=r},function(e,t,n){"use strict";var r=/[ \t\r\n]+|[A-Z\xB5\xC0-\xD6\xD8-\xDF\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u0149\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u017F\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C5\u01C7\u01C8\u01CA\u01CB\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F0-\u01F2\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0345\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03AB\u03B0\u03C2\u03CF-\u03D1\u03D5\u03D6\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F0\u03F1\u03F4\u03F5\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u0587\u10A0-\u10C5\u10C7\u10CD\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E96-\u1E9B\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F50\u1F52\u1F54\u1F56\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1F80-\u1FAF\u1FB2-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD2\u1FD3\u1FD6-\u1FDB\u1FE2-\u1FE4\u1FE6-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A\u212B\u2132\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AD\uA7B0\uA7B1\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A]|\uD801[\uDC00-\uDC27]|\uD806[\uDCA0-\uDCBF]/g,i={A:"a",B:"b",C:"c",D:"d",E:"e",F:"f",G:"g",H:"h",I:"i",J:"j",K:"k",L:"l",M:"m",N:"n",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",U:"u",V:"v",W:"w",X:"x",Y:"y",Z:"z","µ":"μ","À":"à","Á":"á","Â":"â","Ã":"ã","Ä":"ä","Å":"å","Æ":"æ","Ç":"ç","È":"è","É":"é","Ê":"ê","Ë":"ë","Ì":"ì","Í":"í","Î":"î","Ï":"ï","Ð":"ð","Ñ":"ñ","Ò":"ò","Ó":"ó","Ô":"ô","Õ":"õ","Ö":"ö","Ø":"ø","Ù":"ù","Ú":"ú","Û":"û","Ü":"ü","Ý":"ý","Þ":"þ","Ā":"ā","Ă":"ă","Ą":"ą","Ć":"ć","Ĉ":"ĉ","Ċ":"ċ","Č":"č","Ď":"ď","Đ":"đ","Ē":"ē","Ĕ":"ĕ","Ė":"ė","Ę":"ę","Ě":"ě","Ĝ":"ĝ","Ğ":"ğ","Ġ":"ġ","Ģ":"ģ","Ĥ":"ĥ","Ħ":"ħ","Ĩ":"ĩ","Ī":"ī","Ĭ":"ĭ","Į":"į","IJ":"ij","Ĵ":"ĵ","Ķ":"ķ","Ĺ":"ĺ","Ļ":"ļ","Ľ":"ľ","Ŀ":"ŀ","Ł":"ł","Ń":"ń","Ņ":"ņ","Ň":"ň","Ŋ":"ŋ","Ō":"ō","Ŏ":"ŏ","Ő":"ő","Œ":"œ","Ŕ":"ŕ","Ŗ":"ŗ","Ř":"ř","Ś":"ś","Ŝ":"ŝ","Ş":"ş","Š":"š","Ţ":"ţ","Ť":"ť","Ŧ":"ŧ","Ũ":"ũ","Ū":"ū","Ŭ":"ŭ","Ů":"ů","Ű":"ű","Ų":"ų","Ŵ":"ŵ","Ŷ":"ŷ","Ÿ":"ÿ","Ź":"ź","Ż":"ż","Ž":"ž","ſ":"s","Ɓ":"ɓ","Ƃ":"ƃ","Ƅ":"ƅ","Ɔ":"ɔ","Ƈ":"ƈ","Ɖ":"ɖ","Ɗ":"ɗ","Ƌ":"ƌ","Ǝ":"ǝ","Ə":"ə","Ɛ":"ɛ","Ƒ":"ƒ","Ɠ":"ɠ","Ɣ":"ɣ","Ɩ":"ɩ","Ɨ":"ɨ","Ƙ":"ƙ","Ɯ":"ɯ","Ɲ":"ɲ","Ɵ":"ɵ","Ơ":"ơ","Ƣ":"ƣ","Ƥ":"ƥ","Ʀ":"ʀ","Ƨ":"ƨ","Ʃ":"ʃ","Ƭ":"ƭ","Ʈ":"ʈ","Ư":"ư","Ʊ":"ʊ","Ʋ":"ʋ","Ƴ":"ƴ","Ƶ":"ƶ","Ʒ":"ʒ","Ƹ":"ƹ","Ƽ":"ƽ","DŽ":"dž","Dž":"dž","LJ":"lj","Lj":"lj","NJ":"nj","Nj":"nj","Ǎ":"ǎ","Ǐ":"ǐ","Ǒ":"ǒ","Ǔ":"ǔ","Ǖ":"ǖ","Ǘ":"ǘ","Ǚ":"ǚ","Ǜ":"ǜ","Ǟ":"ǟ","Ǡ":"ǡ","Ǣ":"ǣ","Ǥ":"ǥ","Ǧ":"ǧ","Ǩ":"ǩ","Ǫ":"ǫ","Ǭ":"ǭ","Ǯ":"ǯ","DZ":"dz","Dz":"dz","Ǵ":"ǵ","Ƕ":"ƕ","Ƿ":"ƿ","Ǹ":"ǹ","Ǻ":"ǻ","Ǽ":"ǽ","Ǿ":"ǿ","Ȁ":"ȁ","Ȃ":"ȃ","Ȅ":"ȅ","Ȇ":"ȇ","Ȉ":"ȉ","Ȋ":"ȋ","Ȍ":"ȍ","Ȏ":"ȏ","Ȑ":"ȑ","Ȓ":"ȓ","Ȕ":"ȕ","Ȗ":"ȗ","Ș":"ș","Ț":"ț","Ȝ":"ȝ","Ȟ":"ȟ","Ƞ":"ƞ","Ȣ":"ȣ","Ȥ":"ȥ","Ȧ":"ȧ","Ȩ":"ȩ","Ȫ":"ȫ","Ȭ":"ȭ","Ȯ":"ȯ","Ȱ":"ȱ","Ȳ":"ȳ","Ⱥ":"ⱥ","Ȼ":"ȼ","Ƚ":"ƚ","Ⱦ":"ⱦ","Ɂ":"ɂ","Ƀ":"ƀ","Ʉ":"ʉ","Ʌ":"ʌ","Ɇ":"ɇ","Ɉ":"ɉ","Ɋ":"ɋ","Ɍ":"ɍ","Ɏ":"ɏ","ͅ":"ι","Ͱ":"ͱ","Ͳ":"ͳ","Ͷ":"ͷ","Ϳ":"ϳ","Ά":"ά","Έ":"έ","Ή":"ή","Ί":"ί","Ό":"ό","Ύ":"ύ","Ώ":"ώ","Α":"α","Β":"β","Γ":"γ","Δ":"δ","Ε":"ε","Ζ":"ζ","Η":"η","Θ":"θ","Ι":"ι","Κ":"κ","Λ":"λ","Μ":"μ","Ν":"ν","Ξ":"ξ","Ο":"ο","Π":"π","Ρ":"ρ","Σ":"σ","Τ":"τ","Υ":"υ","Φ":"φ","Χ":"χ","Ψ":"ψ","Ω":"ω","Ϊ":"ϊ","Ϋ":"ϋ","ς":"σ","Ϗ":"ϗ","ϐ":"β","ϑ":"θ","ϕ":"φ","ϖ":"π","Ϙ":"ϙ","Ϛ":"ϛ","Ϝ":"ϝ","Ϟ":"ϟ","Ϡ":"ϡ","Ϣ":"ϣ","Ϥ":"ϥ","Ϧ":"ϧ","Ϩ":"ϩ","Ϫ":"ϫ","Ϭ":"ϭ","Ϯ":"ϯ","ϰ":"κ","ϱ":"ρ","ϴ":"θ","ϵ":"ε","Ϸ":"ϸ","Ϲ":"ϲ","Ϻ":"ϻ","Ͻ":"ͻ","Ͼ":"ͼ","Ͽ":"ͽ","Ѐ":"ѐ","Ё":"ё","Ђ":"ђ","Ѓ":"ѓ","Є":"є","Ѕ":"ѕ","І":"і","Ї":"ї","Ј":"ј","Љ":"љ","Њ":"њ","Ћ":"ћ","Ќ":"ќ","Ѝ":"ѝ","Ў":"ў","Џ":"џ","А":"а","Б":"б","В":"в","Г":"г","Д":"д","Е":"е","Ж":"ж","З":"з","И":"и","Й":"й","К":"к","Л":"л","М":"м","Н":"н","О":"о","П":"п","Р":"р","С":"с","Т":"т","У":"у","Ф":"ф","Х":"х","Ц":"ц","Ч":"ч","Ш":"ш","Щ":"щ","Ъ":"ъ","Ы":"ы","Ь":"ь","Э":"э","Ю":"ю","Я":"я","Ѡ":"ѡ","Ѣ":"ѣ","Ѥ":"ѥ","Ѧ":"ѧ","Ѩ":"ѩ","Ѫ":"ѫ","Ѭ":"ѭ","Ѯ":"ѯ","Ѱ":"ѱ","Ѳ":"ѳ","Ѵ":"ѵ","Ѷ":"ѷ","Ѹ":"ѹ","Ѻ":"ѻ","Ѽ":"ѽ","Ѿ":"ѿ","Ҁ":"ҁ","Ҋ":"ҋ","Ҍ":"ҍ","Ҏ":"ҏ","Ґ":"ґ","Ғ":"ғ","Ҕ":"ҕ","Җ":"җ","Ҙ":"ҙ","Қ":"қ","Ҝ":"ҝ","Ҟ":"ҟ","Ҡ":"ҡ","Ң":"ң","Ҥ":"ҥ","Ҧ":"ҧ","Ҩ":"ҩ","Ҫ":"ҫ","Ҭ":"ҭ","Ү":"ү","Ұ":"ұ","Ҳ":"ҳ","Ҵ":"ҵ","Ҷ":"ҷ","Ҹ":"ҹ","Һ":"һ","Ҽ":"ҽ","Ҿ":"ҿ","Ӏ":"ӏ","Ӂ":"ӂ","Ӄ":"ӄ","Ӆ":"ӆ","Ӈ":"ӈ","Ӊ":"ӊ","Ӌ":"ӌ","Ӎ":"ӎ","Ӑ":"ӑ","Ӓ":"ӓ","Ӕ":"ӕ","Ӗ":"ӗ","Ә":"ә","Ӛ":"ӛ","Ӝ":"ӝ","Ӟ":"ӟ","Ӡ":"ӡ","Ӣ":"ӣ","Ӥ":"ӥ","Ӧ":"ӧ","Ө":"ө","Ӫ":"ӫ","Ӭ":"ӭ","Ӯ":"ӯ","Ӱ":"ӱ","Ӳ":"ӳ","Ӵ":"ӵ","Ӷ":"ӷ","Ӹ":"ӹ","Ӻ":"ӻ","Ӽ":"ӽ","Ӿ":"ӿ","Ԁ":"ԁ","Ԃ":"ԃ","Ԅ":"ԅ","Ԇ":"ԇ","Ԉ":"ԉ","Ԋ":"ԋ","Ԍ":"ԍ","Ԏ":"ԏ","Ԑ":"ԑ","Ԓ":"ԓ","Ԕ":"ԕ","Ԗ":"ԗ","Ԙ":"ԙ","Ԛ":"ԛ","Ԝ":"ԝ","Ԟ":"ԟ","Ԡ":"ԡ","Ԣ":"ԣ","Ԥ":"ԥ","Ԧ":"ԧ","Ԩ":"ԩ","Ԫ":"ԫ","Ԭ":"ԭ","Ԯ":"ԯ","Ա":"ա","Բ":"բ","Գ":"գ","Դ":"դ","Ե":"ե","Զ":"զ","Է":"է","Ը":"ը","Թ":"թ","Ժ":"ժ","Ի":"ի","Լ":"լ","Խ":"խ","Ծ":"ծ","Կ":"կ","Հ":"հ","Ձ":"ձ","Ղ":"ղ","Ճ":"ճ","Մ":"մ","Յ":"յ","Ն":"ն","Շ":"շ","Ո":"ո","Չ":"չ","Պ":"պ","Ջ":"ջ","Ռ":"ռ","Ս":"ս","Վ":"վ","Տ":"տ","Ր":"ր","Ց":"ց","Ւ":"ւ","Փ":"փ","Ք":"ք","Օ":"օ","Ֆ":"ֆ","Ⴀ":"ⴀ","Ⴁ":"ⴁ","Ⴂ":"ⴂ","Ⴃ":"ⴃ","Ⴄ":"ⴄ","Ⴅ":"ⴅ","Ⴆ":"ⴆ","Ⴇ":"ⴇ","Ⴈ":"ⴈ","Ⴉ":"ⴉ","Ⴊ":"ⴊ","Ⴋ":"ⴋ","Ⴌ":"ⴌ","Ⴍ":"ⴍ","Ⴎ":"ⴎ","Ⴏ":"ⴏ","Ⴐ":"ⴐ","Ⴑ":"ⴑ","Ⴒ":"ⴒ","Ⴓ":"ⴓ","Ⴔ":"ⴔ","Ⴕ":"ⴕ","Ⴖ":"ⴖ","Ⴗ":"ⴗ","Ⴘ":"ⴘ","Ⴙ":"ⴙ","Ⴚ":"ⴚ","Ⴛ":"ⴛ","Ⴜ":"ⴜ","Ⴝ":"ⴝ","Ⴞ":"ⴞ","Ⴟ":"ⴟ","Ⴠ":"ⴠ","Ⴡ":"ⴡ","Ⴢ":"ⴢ","Ⴣ":"ⴣ","Ⴤ":"ⴤ","Ⴥ":"ⴥ","Ⴧ":"ⴧ","Ⴭ":"ⴭ","Ḁ":"ḁ","Ḃ":"ḃ","Ḅ":"ḅ","Ḇ":"ḇ","Ḉ":"ḉ","Ḋ":"ḋ","Ḍ":"ḍ","Ḏ":"ḏ","Ḑ":"ḑ","Ḓ":"ḓ","Ḕ":"ḕ","Ḗ":"ḗ","Ḙ":"ḙ","Ḛ":"ḛ","Ḝ":"ḝ","Ḟ":"ḟ","Ḡ":"ḡ","Ḣ":"ḣ","Ḥ":"ḥ","Ḧ":"ḧ","Ḩ":"ḩ","Ḫ":"ḫ","Ḭ":"ḭ","Ḯ":"ḯ","Ḱ":"ḱ","Ḳ":"ḳ","Ḵ":"ḵ","Ḷ":"ḷ","Ḹ":"ḹ","Ḻ":"ḻ","Ḽ":"ḽ","Ḿ":"ḿ","Ṁ":"ṁ","Ṃ":"ṃ","Ṅ":"ṅ","Ṇ":"ṇ","Ṉ":"ṉ","Ṋ":"ṋ","Ṍ":"ṍ","Ṏ":"ṏ","Ṑ":"ṑ","Ṓ":"ṓ","Ṕ":"ṕ","Ṗ":"ṗ","Ṙ":"ṙ","Ṛ":"ṛ","Ṝ":"ṝ","Ṟ":"ṟ","Ṡ":"ṡ","Ṣ":"ṣ","Ṥ":"ṥ","Ṧ":"ṧ","Ṩ":"ṩ","Ṫ":"ṫ","Ṭ":"ṭ","Ṯ":"ṯ","Ṱ":"ṱ","Ṳ":"ṳ","Ṵ":"ṵ","Ṷ":"ṷ","Ṹ":"ṹ","Ṻ":"ṻ","Ṽ":"ṽ","Ṿ":"ṿ","Ẁ":"ẁ","Ẃ":"ẃ","Ẅ":"ẅ","Ẇ":"ẇ","Ẉ":"ẉ","Ẋ":"ẋ","Ẍ":"ẍ","Ẏ":"ẏ","Ẑ":"ẑ","Ẓ":"ẓ","Ẕ":"ẕ","ẛ":"ṡ","Ạ":"ạ","Ả":"ả","Ấ":"ấ","Ầ":"ầ","Ẩ":"ẩ","Ẫ":"ẫ","Ậ":"ậ","Ắ":"ắ","Ằ":"ằ","Ẳ":"ẳ","Ẵ":"ẵ","Ặ":"ặ","Ẹ":"ẹ","Ẻ":"ẻ","Ẽ":"ẽ","Ế":"ế","Ề":"ề","Ể":"ể","Ễ":"ễ","Ệ":"ệ","Ỉ":"ỉ","Ị":"ị","Ọ":"ọ","Ỏ":"ỏ","Ố":"ố","Ồ":"ồ","Ổ":"ổ","Ỗ":"ỗ","Ộ":"ộ","Ớ":"ớ","Ờ":"ờ","Ở":"ở","Ỡ":"ỡ","Ợ":"ợ","Ụ":"ụ","Ủ":"ủ","Ứ":"ứ","Ừ":"ừ","Ử":"ử","Ữ":"ữ","Ự":"ự","Ỳ":"ỳ","Ỵ":"ỵ","Ỷ":"ỷ","Ỹ":"ỹ","Ỻ":"ỻ","Ỽ":"ỽ","Ỿ":"ỿ","Ἀ":"ἀ","Ἁ":"ἁ","Ἂ":"ἂ","Ἃ":"ἃ","Ἄ":"ἄ","Ἅ":"ἅ","Ἆ":"ἆ","Ἇ":"ἇ","Ἐ":"ἐ","Ἑ":"ἑ","Ἒ":"ἒ","Ἓ":"ἓ","Ἔ":"ἔ","Ἕ":"ἕ","Ἠ":"ἠ","Ἡ":"ἡ","Ἢ":"ἢ","Ἣ":"ἣ","Ἤ":"ἤ","Ἥ":"ἥ","Ἦ":"ἦ","Ἧ":"ἧ","Ἰ":"ἰ","Ἱ":"ἱ","Ἲ":"ἲ","Ἳ":"ἳ","Ἴ":"ἴ","Ἵ":"ἵ","Ἶ":"ἶ","Ἷ":"ἷ","Ὀ":"ὀ","Ὁ":"ὁ","Ὂ":"ὂ","Ὃ":"ὃ","Ὄ":"ὄ","Ὅ":"ὅ","Ὑ":"ὑ","Ὓ":"ὓ","Ὕ":"ὕ","Ὗ":"ὗ","Ὠ":"ὠ","Ὡ":"ὡ","Ὢ":"ὢ","Ὣ":"ὣ","Ὤ":"ὤ","Ὥ":"ὥ","Ὦ":"ὦ","Ὧ":"ὧ","Ᾰ":"ᾰ","Ᾱ":"ᾱ","Ὰ":"ὰ","Ά":"ά","ι":"ι","Ὲ":"ὲ","Έ":"έ","Ὴ":"ὴ","Ή":"ή","Ῐ":"ῐ","Ῑ":"ῑ","Ὶ":"ὶ","Ί":"ί","Ῠ":"ῠ","Ῡ":"ῡ","Ὺ":"ὺ","Ύ":"ύ","Ῥ":"ῥ","Ὸ":"ὸ","Ό":"ό","Ὼ":"ὼ","Ώ":"ώ","Ω":"ω","K":"k","Å":"å","Ⅎ":"ⅎ","Ⅰ":"ⅰ","Ⅱ":"ⅱ","Ⅲ":"ⅲ","Ⅳ":"ⅳ","Ⅴ":"ⅴ","Ⅵ":"ⅵ","Ⅶ":"ⅶ","Ⅷ":"ⅷ","Ⅸ":"ⅸ","Ⅹ":"ⅹ","Ⅺ":"ⅺ","Ⅻ":"ⅻ","Ⅼ":"ⅼ","Ⅽ":"ⅽ","Ⅾ":"ⅾ","Ⅿ":"ⅿ","Ↄ":"ↄ","Ⓐ":"ⓐ","Ⓑ":"ⓑ","Ⓒ":"ⓒ","Ⓓ":"ⓓ","Ⓔ":"ⓔ","Ⓕ":"ⓕ","Ⓖ":"ⓖ","Ⓗ":"ⓗ","Ⓘ":"ⓘ","Ⓙ":"ⓙ","Ⓚ":"ⓚ","Ⓛ":"ⓛ","Ⓜ":"ⓜ","Ⓝ":"ⓝ","Ⓞ":"ⓞ","Ⓟ":"ⓟ","Ⓠ":"ⓠ","Ⓡ":"ⓡ","Ⓢ":"ⓢ","Ⓣ":"ⓣ","Ⓤ":"ⓤ","Ⓥ":"ⓥ","Ⓦ":"ⓦ","Ⓧ":"ⓧ","Ⓨ":"ⓨ","Ⓩ":"ⓩ","Ⰰ":"ⰰ","Ⰱ":"ⰱ","Ⰲ":"ⰲ","Ⰳ":"ⰳ","Ⰴ":"ⰴ","Ⰵ":"ⰵ","Ⰶ":"ⰶ","Ⰷ":"ⰷ","Ⰸ":"ⰸ","Ⰹ":"ⰹ","Ⰺ":"ⰺ","Ⰻ":"ⰻ","Ⰼ":"ⰼ","Ⰽ":"ⰽ","Ⰾ":"ⰾ","Ⰿ":"ⰿ","Ⱀ":"ⱀ","Ⱁ":"ⱁ","Ⱂ":"ⱂ","Ⱃ":"ⱃ","Ⱄ":"ⱄ","Ⱅ":"ⱅ","Ⱆ":"ⱆ","Ⱇ":"ⱇ","Ⱈ":"ⱈ","Ⱉ":"ⱉ","Ⱊ":"ⱊ","Ⱋ":"ⱋ","Ⱌ":"ⱌ","Ⱍ":"ⱍ","Ⱎ":"ⱎ","Ⱏ":"ⱏ","Ⱐ":"ⱐ","Ⱑ":"ⱑ","Ⱒ":"ⱒ","Ⱓ":"ⱓ","Ⱔ":"ⱔ","Ⱕ":"ⱕ","Ⱖ":"ⱖ","Ⱗ":"ⱗ","Ⱘ":"ⱘ","Ⱙ":"ⱙ","Ⱚ":"ⱚ","Ⱛ":"ⱛ","Ⱜ":"ⱜ","Ⱝ":"ⱝ","Ⱞ":"ⱞ","Ⱡ":"ⱡ","Ɫ":"ɫ","Ᵽ":"ᵽ","Ɽ":"ɽ","Ⱨ":"ⱨ","Ⱪ":"ⱪ","Ⱬ":"ⱬ","Ɑ":"ɑ","Ɱ":"ɱ","Ɐ":"ɐ","Ɒ":"ɒ","Ⱳ":"ⱳ","Ⱶ":"ⱶ","Ȿ":"ȿ","Ɀ":"ɀ","Ⲁ":"ⲁ","Ⲃ":"ⲃ","Ⲅ":"ⲅ","Ⲇ":"ⲇ","Ⲉ":"ⲉ","Ⲋ":"ⲋ","Ⲍ":"ⲍ","Ⲏ":"ⲏ","Ⲑ":"ⲑ","Ⲓ":"ⲓ","Ⲕ":"ⲕ","Ⲗ":"ⲗ","Ⲙ":"ⲙ","Ⲛ":"ⲛ","Ⲝ":"ⲝ","Ⲟ":"ⲟ","Ⲡ":"ⲡ","Ⲣ":"ⲣ","Ⲥ":"ⲥ","Ⲧ":"ⲧ","Ⲩ":"ⲩ","Ⲫ":"ⲫ","Ⲭ":"ⲭ","Ⲯ":"ⲯ","Ⲱ":"ⲱ","Ⲳ":"ⲳ","Ⲵ":"ⲵ","Ⲷ":"ⲷ","Ⲹ":"ⲹ","Ⲻ":"ⲻ","Ⲽ":"ⲽ","Ⲿ":"ⲿ","Ⳁ":"ⳁ","Ⳃ":"ⳃ","Ⳅ":"ⳅ","Ⳇ":"ⳇ","Ⳉ":"ⳉ","Ⳋ":"ⳋ","Ⳍ":"ⳍ","Ⳏ":"ⳏ","Ⳑ":"ⳑ","Ⳓ":"ⳓ","Ⳕ":"ⳕ","Ⳗ":"ⳗ","Ⳙ":"ⳙ","Ⳛ":"ⳛ","Ⳝ":"ⳝ","Ⳟ":"ⳟ","Ⳡ":"ⳡ","Ⳣ":"ⳣ","Ⳬ":"ⳬ","Ⳮ":"ⳮ","Ⳳ":"ⳳ","Ꙁ":"ꙁ","Ꙃ":"ꙃ","Ꙅ":"ꙅ","Ꙇ":"ꙇ","Ꙉ":"ꙉ","Ꙋ":"ꙋ","Ꙍ":"ꙍ","Ꙏ":"ꙏ","Ꙑ":"ꙑ","Ꙓ":"ꙓ","Ꙕ":"ꙕ","Ꙗ":"ꙗ","Ꙙ":"ꙙ","Ꙛ":"ꙛ","Ꙝ":"ꙝ","Ꙟ":"ꙟ","Ꙡ":"ꙡ","Ꙣ":"ꙣ","Ꙥ":"ꙥ","Ꙧ":"ꙧ","Ꙩ":"ꙩ","Ꙫ":"ꙫ","Ꙭ":"ꙭ","Ꚁ":"ꚁ","Ꚃ":"ꚃ","Ꚅ":"ꚅ","Ꚇ":"ꚇ","Ꚉ":"ꚉ","Ꚋ":"ꚋ","Ꚍ":"ꚍ","Ꚏ":"ꚏ","Ꚑ":"ꚑ","Ꚓ":"ꚓ","Ꚕ":"ꚕ","Ꚗ":"ꚗ","Ꚙ":"ꚙ","Ꚛ":"ꚛ","Ꜣ":"ꜣ","Ꜥ":"ꜥ","Ꜧ":"ꜧ","Ꜩ":"ꜩ","Ꜫ":"ꜫ","Ꜭ":"ꜭ","Ꜯ":"ꜯ","Ꜳ":"ꜳ","Ꜵ":"ꜵ","Ꜷ":"ꜷ","Ꜹ":"ꜹ","Ꜻ":"ꜻ","Ꜽ":"ꜽ","Ꜿ":"ꜿ","Ꝁ":"ꝁ","Ꝃ":"ꝃ","Ꝅ":"ꝅ","Ꝇ":"ꝇ","Ꝉ":"ꝉ","Ꝋ":"ꝋ","Ꝍ":"ꝍ","Ꝏ":"ꝏ","Ꝑ":"ꝑ","Ꝓ":"ꝓ","Ꝕ":"ꝕ","Ꝗ":"ꝗ","Ꝙ":"ꝙ","Ꝛ":"ꝛ","Ꝝ":"ꝝ","Ꝟ":"ꝟ","Ꝡ":"ꝡ","Ꝣ":"ꝣ","Ꝥ":"ꝥ","Ꝧ":"ꝧ","Ꝩ":"ꝩ","Ꝫ":"ꝫ","Ꝭ":"ꝭ","Ꝯ":"ꝯ","Ꝺ":"ꝺ","Ꝼ":"ꝼ","Ᵹ":"ᵹ","Ꝿ":"ꝿ","Ꞁ":"ꞁ","Ꞃ":"ꞃ","Ꞅ":"ꞅ","Ꞇ":"ꞇ","Ꞌ":"ꞌ","Ɥ":"ɥ","Ꞑ":"ꞑ","Ꞓ":"ꞓ","Ꞗ":"ꞗ","Ꞙ":"ꞙ","Ꞛ":"ꞛ","Ꞝ":"ꞝ","Ꞟ":"ꞟ","Ꞡ":"ꞡ","Ꞣ":"ꞣ","Ꞥ":"ꞥ","Ꞧ":"ꞧ","Ꞩ":"ꞩ","Ɦ":"ɦ","Ɜ":"ɜ","Ɡ":"ɡ","Ɬ":"ɬ","Ʞ":"ʞ","Ʇ":"ʇ","A":"a","B":"b","C":"c","D":"d","E":"e","F":"f","G":"g","H":"h","I":"i","J":"j","K":"k","L":"l","M":"m","N":"n","O":"o","P":"p","Q":"q","R":"r","S":"s","T":"t","U":"u","V":"v","W":"w","X":"x","Y":"y","Z":"z","𐐀":"𐐨","𐐁":"𐐩","𐐂":"𐐪","𐐃":"𐐫","𐐄":"𐐬","𐐅":"𐐭","𐐆":"𐐮","𐐇":"𐐯","𐐈":"𐐰","𐐉":"𐐱","𐐊":"𐐲","𐐋":"𐐳","𐐌":"𐐴","𐐍":"𐐵","𐐎":"𐐶","𐐏":"𐐷","𐐐":"𐐸","𐐑":"𐐹","𐐒":"𐐺","𐐓":"𐐻","𐐔":"𐐼","𐐕":"𐐽","𐐖":"𐐾","𐐗":"𐐿","𐐘":"𐑀","𐐙":"𐑁","𐐚":"𐑂","𐐛":"𐑃","𐐜":"𐑄","𐐝":"𐑅","𐐞":"𐑆","𐐟":"𐑇","𐐠":"𐑈","𐐡":"𐑉","𐐢":"𐑊","𐐣":"𐑋","𐐤":"𐑌","𐐥":"𐑍","𐐦":"𐑎","𐐧":"𐑏","𑢠":"𑣀","𑢡":"𑣁","𑢢":"𑣂","𑢣":"𑣃","𑢤":"𑣄","𑢥":"𑣅","𑢦":"𑣆","𑢧":"𑣇","𑢨":"𑣈","𑢩":"𑣉","𑢪":"𑣊","𑢫":"𑣋","𑢬":"𑣌","𑢭":"𑣍","𑢮":"𑣎","𑢯":"𑣏","𑢰":"𑣐","𑢱":"𑣑","𑢲":"𑣒","𑢳":"𑣓","𑢴":"𑣔","𑢵":"𑣕","𑢶":"𑣖","𑢷":"𑣗","𑢸":"𑣘","𑢹":"𑣙","𑢺":"𑣚","𑢻":"𑣛","𑢼":"𑣜","𑢽":"𑣝","𑢾":"𑣞","𑢿":"𑣟","ß":"ss","İ":"i̇","ʼn":"ʼn","ǰ":"ǰ","ΐ":"ΐ","ΰ":"ΰ","և":"եւ","ẖ":"ẖ","ẗ":"ẗ","ẘ":"ẘ","ẙ":"ẙ","ẚ":"aʾ","ẞ":"ss","ὐ":"ὐ","ὒ":"ὒ","ὔ":"ὔ","ὖ":"ὖ","ᾀ":"ἀι","ᾁ":"ἁι","ᾂ":"ἂι","ᾃ":"ἃι","ᾄ":"ἄι","ᾅ":"ἅι","ᾆ":"ἆι","ᾇ":"ἇι","ᾈ":"ἀι","ᾉ":"ἁι","ᾊ":"ἂι","ᾋ":"ἃι","ᾌ":"ἄι","ᾍ":"ἅι","ᾎ":"ἆι","ᾏ":"ἇι","ᾐ":"ἠι","ᾑ":"ἡι","ᾒ":"ἢι","ᾓ":"ἣι","ᾔ":"ἤι","ᾕ":"ἥι","ᾖ":"ἦι","ᾗ":"ἧι","ᾘ":"ἠι","ᾙ":"ἡι","ᾚ":"ἢι","ᾛ":"ἣι","ᾜ":"ἤι","ᾝ":"ἥι","ᾞ":"ἦι","ᾟ":"ἧι","ᾠ":"ὠι","ᾡ":"ὡι","ᾢ":"ὢι","ᾣ":"ὣι","ᾤ":"ὤι","ᾥ":"ὥι","ᾦ":"ὦι","ᾧ":"ὧι","ᾨ":"ὠι","ᾩ":"ὡι","ᾪ":"ὢι","ᾫ":"ὣι","ᾬ":"ὤι","ᾭ":"ὥι","ᾮ":"ὦι","ᾯ":"ὧι","ᾲ":"ὰι","ᾳ":"αι","ᾴ":"άι","ᾶ":"ᾶ","ᾷ":"ᾶι","ᾼ":"αι","ῂ":"ὴι","ῃ":"ηι","ῄ":"ήι","ῆ":"ῆ","ῇ":"ῆι","ῌ":"ηι","ῒ":"ῒ","ΐ":"ΐ","ῖ":"ῖ","ῗ":"ῗ","ῢ":"ῢ","ΰ":"ΰ","ῤ":"ῤ","ῦ":"ῦ","ῧ":"ῧ","ῲ":"ὼι","ῳ":"ωι","ῴ":"ώι","ῶ":"ῶ","ῷ":"ῶι","ῼ":"ωι","ff":"ff","fi":"fi","fl":"fl","ffi":"ffi","ffl":"ffl","ſt":"st","st":"st","ﬓ":"մն","ﬔ":"մե","ﬕ":"մի","ﬖ":"վն","ﬗ":"մխ"};e.exports=function(e){return e.slice(1,e.length-1).trim().replace(r,function(e){return i[e]||" "})}},function(e,t,n){"use strict";function r(e){return{softbreak:"\n",escape:i,options:e||{},render:s}}var i=n(91).escapeXml,o=function(e,t,n){var r="<"+e;if(t&&t.length>0)for(var i,o=0;void 0!==(i=t[o]);)r+=" "+i[0]+'="'+i[1]+'"',o++;return n&&(r+=" /"),r+=">"},a=function(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase()},s=function(e){var t,n,r,i,s,u,l,c,p=e.walker(),f="",h="\n",d=0,m=function(e){f+=e,h=e},v=this.escape,g=function(){if("\n"!==h){f+="\n",h="\n";for(var e=d;e>0;e--)f+=" "}},y=this.options;for(y.time&&console.time("rendering"),f+='<?xml version="1.0" encoding="UTF-8"?>\n',f+='<!DOCTYPE CommonMark SYSTEM "CommonMark.dtd">\n';r=p.next();)if(s=r.entering,i=r.node,c=i.type,u=i.isContainer,l="ThematicBreak"===c||"Hardbreak"===c||"Softbreak"===c,n=a(c),s){switch(t=[],c){case"Document":t.push(["xmlns","http://commonmark.org/xml/1.0"]);break;case"List":null!==i.listType&&t.push(["type",i.listType.toLowerCase()]),null!==i.listStart&&t.push(["start",String(i.listStart)]),null!==i.listTight&&t.push(["tight",i.listTight?"true":"false"]);var _=i.listDelimiter;if(null!==_){var b="";b="."===_?"period":"paren",t.push(["delimiter",b])}break;case"CodeBlock":i.info&&t.push(["info",i.info]);break;case"Heading":t.push(["level",String(i.level)]);break;case"Link":case"Image":t.push(["destination",i.destination]),t.push(["title",i.title]);break;case"CustomInline":case"CustomBlock":t.push(["on_enter",i.onEnter]),t.push(["on_exit",i.onExit])}if(y.sourcepos){var x=i.sourcepos;x&&t.push(["sourcepos",String(x[0][0])+":"+String(x[0][1])+"-"+String(x[1][0])+":"+String(x[1][1])])}if(g(),m(o(n,t,l)),u)d+=1;else if(!u&&!l){var w=i.literal;w&&m(v(w)),m(o("/"+n))}}else d-=1,g(),m(o("/"+n));return y.time&&console.timeEnd("rendering"),f+="\n"};e.exports=r},function(e,t,n){"use strict";function r(e){i.Component.call(this,e)}var i=n(0),o=n(1076).Parser,a=n(574),s=n(1);r.prototype=Object.create(i.Component.prototype),r.prototype.constructor=r,r.prototype.render=function(){var e=this.props.containerProps||{},t=new a(this.props),n=new o(this.props.parserOptions),r=n.parse(this.props.source||"");if(this.props.walker)for(var s,u=r.walker();s=u.next();)this.props.walker.call(this,s,u);return this.props.className&&(e.className=this.props.className),i.createElement.apply(i,[this.props.containerTagName,e,this.props.childBefore].concat(t.render(r).concat([this.props.childAfter])))},r.propTypes={className:s.string,containerProps:s.object,source:s.string.isRequired,containerTagName:s.string,childBefore:s.object,childAfter:s.object,sourcePos:s.bool,escapeHtml:s.bool,skipHtml:s.bool,softBreak:s.string,allowNode:s.func,allowedTypes:s.array,disallowedTypes:s.array,transformLinkUri:s.func,transformImageUri:s.func,unwrapDisallowed:s.bool,renderers:s.object,walker:s.func,parserOptions:s.object},r.defaultProps={containerTagName:"div",parserOptions:{}},r.types=a.types,r.renderers=a.renderers,r.uriTransformer=a.uriTransformer,e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(257),l=r(u),c=n(164),p=r(c),f=n(259),h=r(f),d=n(231),m=r(d),v=n(239),g=r(v),y=n(258),_=r(y),b=n(0),x=r(b),w=n(1),k=r(w),E=1e3/60,S=function(e){function t(n){var r=this;i(this,t),e.call(this,n),this.wasAnimating=!1,this.animationID=null,this.prevTime=0,this.accumulatedTime=0,this.unreadPropStyle=null,this.clearUnreadPropStyle=function(e){var t=!1,n=r.state,i=n.currentStyle,o=n.currentVelocity,s=n.lastIdealStyle,u=n.lastIdealVelocity;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var c=e[l];"number"==typeof c&&(t||(t=!0,i=a({},i),o=a({},o),s=a({},s),u=a({},u)),i[l]=c,o[l]=0,s[l]=c,u[l]=0)}t&&r.setState({currentStyle:i,currentVelocity:o,lastIdealStyle:s,lastIdealVelocity:u})},this.startAnimationIfNecessary=function(){r.animationID=g.default(function(e){var t=r.props.style;if(_.default(r.state.currentStyle,t,r.state.currentVelocity))return r.wasAnimating&&r.props.onRest&&r.props.onRest(),r.animationID=null,r.wasAnimating=!1,void(r.accumulatedTime=0);r.wasAnimating=!0;var n=e||m.default(),i=n-r.prevTime;if(r.prevTime=n,r.accumulatedTime=r.accumulatedTime+i,r.accumulatedTime>10*E&&(r.accumulatedTime=0),0===r.accumulatedTime)return r.animationID=null,void r.startAnimationIfNecessary();var o=(r.accumulatedTime-Math.floor(r.accumulatedTime/E)*E)/E,a=Math.floor(r.accumulatedTime/E),s={},u={},l={},c={};for(var p in t)if(Object.prototype.hasOwnProperty.call(t,p)){var f=t[p];if("number"==typeof f)l[p]=f,c[p]=0,s[p]=f,u[p]=0;else{for(var d=r.state.lastIdealStyle[p],v=r.state.lastIdealVelocity[p],g=0;g<a;g++){var y=h.default(E/1e3,d,v,f.val,f.stiffness,f.damping,f.precision);d=y[0],v=y[1]}var b=h.default(E/1e3,d,v,f.val,f.stiffness,f.damping,f.precision),x=b[0],w=b[1];l[p]=d+(x-d)*o,c[p]=v+(w-v)*o,s[p]=d,u[p]=v}}r.animationID=null,r.accumulatedTime-=a*E,r.setState({currentStyle:l,currentVelocity:c,lastIdealStyle:s,lastIdealVelocity:u}),r.unreadPropStyle=null,r.startAnimationIfNecessary()})},this.state=this.defaultState()}return o(t,e),s(t,null,[{key:"propTypes",value:{defaultStyle:k.default.objectOf(k.default.number),style:k.default.objectOf(k.default.oneOfType([k.default.number,k.default.object])).isRequired,children:k.default.func.isRequired,onRest:k.default.func},enumerable:!0}]),t.prototype.defaultState=function(){var e=this.props,t=e.defaultStyle,n=e.style,r=t||p.default(n),i=l.default(r);return{currentStyle:r,currentVelocity:i,lastIdealStyle:r,lastIdealVelocity:i}},t.prototype.componentDidMount=function(){this.prevTime=m.default(),this.startAnimationIfNecessary()},t.prototype.componentWillReceiveProps=function(e){null!=this.unreadPropStyle&&this.clearUnreadPropStyle(this.unreadPropStyle),this.unreadPropStyle=e.style,null==this.animationID&&(this.prevTime=m.default(),this.startAnimationIfNecessary())},t.prototype.componentWillUnmount=function(){null!=this.animationID&&(g.default.cancel(this.animationID),this.animationID=null)},t.prototype.render=function(){var e=this.props.children(this.state.currentStyle);return e&&x.default.Children.only(e)},t}(x.default.Component);t.default=S,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t,n){for(var r=0;r<e.length;r++)if(!b.default(e[r],t[r],n[r]))return!1;return!0}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(257),c=r(l),p=n(164),f=r(p),h=n(259),d=r(h),m=n(231),v=r(m),g=n(239),y=r(g),_=n(258),b=r(_),x=n(0),w=r(x),k=n(1),E=r(k),S=1e3/60,C=function(e){function t(n){var r=this;i(this,t),e.call(this,n),this.animationID=null,this.prevTime=0,this.accumulatedTime=0,this.unreadPropStyles=null,this.clearUnreadPropStyle=function(e){for(var t=r.state,n=t.currentStyles,i=t.currentVelocities,o=t.lastIdealStyles,a=t.lastIdealVelocities,u=!1,l=0;l<e.length;l++){var c=e[l],p=!1;for(var f in c)if(Object.prototype.hasOwnProperty.call(c,f)){var h=c[f];"number"==typeof h&&(p||(p=!0,u=!0,n[l]=s({},n[l]),i[l]=s({},i[l]),o[l]=s({},o[l]),a[l]=s({},a[l])),n[l][f]=h,i[l][f]=0,o[l][f]=h,a[l][f]=0)}}u&&r.setState({currentStyles:n,currentVelocities:i,lastIdealStyles:o,lastIdealVelocities:a})},this.startAnimationIfNecessary=function(){r.animationID=y.default(function(e){var t=r.props.styles(r.state.lastIdealStyles);if(a(r.state.currentStyles,t,r.state.currentVelocities))return r.animationID=null,void(r.accumulatedTime=0);var n=e||v.default(),i=n-r.prevTime;if(r.prevTime=n,r.accumulatedTime=r.accumulatedTime+i,r.accumulatedTime>10*S&&(r.accumulatedTime=0),0===r.accumulatedTime)return r.animationID=null,void r.startAnimationIfNecessary();for(var o=(r.accumulatedTime-Math.floor(r.accumulatedTime/S)*S)/S,s=Math.floor(r.accumulatedTime/S),u=[],l=[],c=[],p=[],f=0;f<t.length;f++){var h=t[f],m={},g={},y={},_={};for(var b in h)if(Object.prototype.hasOwnProperty.call(h,b)){var x=h[b];if("number"==typeof x)m[b]=x,g[b]=0,y[b]=x,_[b]=0;else{for(var w=r.state.lastIdealStyles[f][b],k=r.state.lastIdealVelocities[f][b],E=0;E<s;E++){var C=d.default(S/1e3,w,k,x.val,x.stiffness,x.damping,x.precision);w=C[0],k=C[1]}var A=d.default(S/1e3,w,k,x.val,x.stiffness,x.damping,x.precision),D=A[0],O=A[1];m[b]=w+(D-w)*o,g[b]=k+(O-k)*o,y[b]=w,_[b]=k}}c[f]=m,p[f]=g,u[f]=y,l[f]=_}r.animationID=null,r.accumulatedTime-=s*S,r.setState({currentStyles:c,currentVelocities:p,lastIdealStyles:u,lastIdealVelocities:l}),r.unreadPropStyles=null,r.startAnimationIfNecessary()})},this.state=this.defaultState()}return o(t,e),u(t,null,[{key:"propTypes",value:{defaultStyles:E.default.arrayOf(E.default.objectOf(E.default.number)),styles:E.default.func.isRequired,children:E.default.func.isRequired},enumerable:!0}]),t.prototype.defaultState=function(){var e=this.props,t=e.defaultStyles,n=e.styles,r=t||n().map(f.default),i=r.map(function(e){return c.default(e)});return{currentStyles:r,currentVelocities:i,lastIdealStyles:r,lastIdealVelocities:i}},t.prototype.componentDidMount=function(){this.prevTime=v.default(),this.startAnimationIfNecessary()},t.prototype.componentWillReceiveProps=function(e){null!=this.unreadPropStyles&&this.clearUnreadPropStyle(this.unreadPropStyles),this.unreadPropStyles=e.styles(this.state.lastIdealStyles),null==this.animationID&&(this.prevTime=v.default(),this.startAnimationIfNecessary())},t.prototype.componentWillUnmount=function(){null!=this.animationID&&(y.default.cancel(this.animationID),this.animationID=null)},t.prototype.render=function(){var e=this.props.children(this.state.currentStyles);return e&&w.default.Children.only(e)},t}(w.default.Component);t.default=C,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t,n){var r=t;return null==r?e.map(function(e,t){return{key:e.key,data:e.data,style:n[t]}}):e.map(function(e,t){for(var i=0;i<r.length;i++)if(r[i].key===e.key)return{key:r[i].key,data:r[i].data,style:n[t]};return{key:e.key,data:e.data,style:n[t]}})}function s(e,t,n,r){if(r.length!==t.length)return!1;for(var i=0;i<r.length;i++)if(r[i].key!==t[i].key)return!1;for(var i=0;i<r.length;i++)if(!E.default(e[i],t[i].style,n[i]))return!1;return!0}function u(e,t,n,r,i,o,a,s,u){for(var l=y.default(r,i,function(e,r){var i=t(r);return null==i?(n({key:r.key,data:r.data}),null):E.default(o[e],i,a[e])?(n({key:r.key,data:r.data}),null):{key:r.key,data:r.data,style:i}}),c=[],p=[],h=[],d=[],m=0;m<l.length;m++){for(var v=l[m],g=null,_=0;_<r.length;_++)if(r[_].key===v.key){g=_;break}if(null==g){var b=e(v);c[m]=b,h[m]=b;var x=f.default(v.style);p[m]=x,d[m]=x}else c[m]=o[g],h[m]=s[g],p[m]=a[g],d[m]=u[g]}return[l,c,p,h,d]}t.__esModule=!0;var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=n(257),f=r(p),h=n(164),d=r(h),m=n(259),v=r(m),g=n(1084),y=r(g),_=n(231),b=r(_),x=n(239),w=r(x),k=n(258),E=r(k),S=n(0),C=r(S),A=n(1),D=r(A),O=1e3/60,M=function(e){function t(n){var r=this;i(this,t),e.call(this,n),this.unmounting=!1,this.animationID=null,this.prevTime=0,this.accumulatedTime=0,this.unreadPropStyles=null,this.clearUnreadPropStyle=function(e){for(var t=u(r.props.willEnter,r.props.willLeave,r.props.didLeave,r.state.mergedPropsStyles,e,r.state.currentStyles,r.state.currentVelocities,r.state.lastIdealStyles,r.state.lastIdealVelocities),n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],c=0;c<e.length;c++){var p=e[c].style,f=!1;for(var h in p)if(Object.prototype.hasOwnProperty.call(p,h)){var d=p[h];"number"==typeof d&&(f||(f=!0,i[c]=l({},i[c]),o[c]=l({},o[c]),a[c]=l({},a[c]),s[c]=l({},s[c]),n[c]={key:n[c].key,data:n[c].data,style:l({},n[c].style)}),i[c][h]=d,o[c][h]=0,a[c][h]=d,s[c][h]=0,n[c].style[h]=d)}}r.setState({currentStyles:i,currentVelocities:o,mergedPropsStyles:n,lastIdealStyles:a,lastIdealVelocities:s})},this.startAnimationIfNecessary=function(){r.unmounting||(r.animationID=w.default(function(e){if(!r.unmounting){var t=r.props.styles,n="function"==typeof t?t(a(r.state.mergedPropsStyles,r.unreadPropStyles,r.state.lastIdealStyles)):t;if(s(r.state.currentStyles,n,r.state.currentVelocities,r.state.mergedPropsStyles))return r.animationID=null,void(r.accumulatedTime=0);var i=e||b.default(),o=i-r.prevTime;if(r.prevTime=i,r.accumulatedTime=r.accumulatedTime+o,r.accumulatedTime>10*O&&(r.accumulatedTime=0),0===r.accumulatedTime)return r.animationID=null,void r.startAnimationIfNecessary();for(var l=(r.accumulatedTime-Math.floor(r.accumulatedTime/O)*O)/O,c=Math.floor(r.accumulatedTime/O),p=u(r.props.willEnter,r.props.willLeave,r.props.didLeave,r.state.mergedPropsStyles,n,r.state.currentStyles,r.state.currentVelocities,r.state.lastIdealStyles,r.state.lastIdealVelocities),f=p[0],h=p[1],d=p[2],m=p[3],g=p[4],y=0;y<f.length;y++){var _=f[y].style,x={},w={},k={},E={};for(var S in _)if(Object.prototype.hasOwnProperty.call(_,S)){var C=_[S];if("number"==typeof C)x[S]=C,w[S]=0,k[S]=C,E[S]=0;else{for(var A=m[y][S],D=g[y][S],M=0;M<c;M++){var T=v.default(O/1e3,A,D,C.val,C.stiffness,C.damping,C.precision);A=T[0],D=T[1]}var P=v.default(O/1e3,A,D,C.val,C.stiffness,C.damping,C.precision),I=P[0],R=P[1];x[S]=A+(I-A)*l,w[S]=D+(R-D)*l,k[S]=A,E[S]=D}}m[y]=k,g[y]=E,h[y]=x,d[y]=w}r.animationID=null,r.accumulatedTime-=c*O,r.setState({currentStyles:h,currentVelocities:d,lastIdealStyles:m,lastIdealVelocities:g,mergedPropsStyles:f}),r.unreadPropStyles=null,r.startAnimationIfNecessary()}}))},this.state=this.defaultState()}return o(t,e),c(t,null,[{key:"propTypes",value:{defaultStyles:D.default.arrayOf(D.default.shape({key:D.default.string.isRequired,data:D.default.any,style:D.default.objectOf(D.default.number).isRequired})),styles:D.default.oneOfType([D.default.func,D.default.arrayOf(D.default.shape({key:D.default.string.isRequired,data:D.default.any,style:D.default.objectOf(D.default.oneOfType([D.default.number,D.default.object])).isRequired}))]).isRequired,children:D.default.func.isRequired,willEnter:D.default.func,willLeave:D.default.func,didLeave:D.default.func},enumerable:!0},{key:"defaultProps",value:{willEnter:function(e){return d.default(e.style)},willLeave:function(){return null},didLeave:function(){}},enumerable:!0}]),t.prototype.defaultState=function(){var e=this.props,t=e.defaultStyles,n=e.styles,r=e.willEnter,i=e.willLeave,o=e.didLeave,a="function"==typeof n?n(t):n,s=void 0;s=null==t?a:t.map(function(e){for(var t=0;t<a.length;t++)if(a[t].key===e.key)return a[t];return e});var l=null==t?a.map(function(e){return d.default(e.style)}):t.map(function(e){return d.default(e.style)}),c=null==t?a.map(function(e){return f.default(e.style)}):t.map(function(e){return f.default(e.style)}),p=u(r,i,o,s,a,l,c,l,c),h=p[0];return{currentStyles:p[1],currentVelocities:p[2],lastIdealStyles:p[3],lastIdealVelocities:p[4],mergedPropsStyles:h}},t.prototype.componentDidMount=function(){this.prevTime=b.default(),this.startAnimationIfNecessary()},t.prototype.componentWillReceiveProps=function(e){this.unreadPropStyles&&this.clearUnreadPropStyle(this.unreadPropStyles);var t=e.styles;this.unreadPropStyles="function"==typeof t?t(a(this.state.mergedPropsStyles,this.unreadPropStyles,this.state.lastIdealStyles)):t,null==this.animationID&&(this.prevTime=b.default(),this.startAnimationIfNecessary())},t.prototype.componentWillUnmount=function(){this.unmounting=!0,null!=this.animationID&&(w.default.cancel(this.animationID),this.animationID=null)},t.prototype.render=function(){var e=a(this.state.mergedPropsStyles,this.unreadPropStyles,this.state.currentStyles),t=this.props.children(e);return t&&C.default.Children.only(t)},t}(C.default.Component);t.default=M,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n){for(var r={},i=0;i<e.length;i++)r[e[i].key]=i;for(var o={},i=0;i<t.length;i++)o[t[i].key]=i;for(var a=[],i=0;i<t.length;i++)a[i]=t[i];for(var i=0;i<e.length;i++)if(!Object.prototype.hasOwnProperty.call(o,e[i].key)){var s=n(i,e[i]);null!=s&&a.push(s)}return a.sort(function(e,n){var i=o[e.key],a=o[n.key],s=r[e.key],u=r[n.key];if(null!=i&&null!=a)return o[e.key]-o[n.key];if(null!=s&&null!=u)return r[e.key]-r[n.key];if(null!=i){for(var l=0;l<t.length;l++){var c=t[l].key;if(Object.prototype.hasOwnProperty.call(r,c)){if(i<o[c]&&u>r[c])return-1;if(i>o[c]&&u<r[c])return 1}}return 1}for(var l=0;l<t.length;l++){var c=t[l].key;if(Object.prototype.hasOwnProperty.call(r,c)){if(a<o[c]&&s>r[c])return 1;if(a>o[c]&&s<r[c])return-1}}return-1})}t.__esModule=!0,t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e.default:e}t.__esModule=!0;var i=n(1081);t.Motion=r(i);var o=n(1082);t.StaggeredMotion=r(o);var a=n(1083);t.TransitionMotion=r(a);var s=n(1087);t.spring=r(s);var u=n(471);t.presets=r(u);var l=n(164);t.stripStyle=r(l);var c=n(1086);t.reorderKeys=r(c)},function(e,t,n){"use strict";function r(){}t.__esModule=!0,t.default=r;e.exports=t.default},function(e,t,n){"use strict";function r(e,t){return i({},s,t,{val:e})}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=r;var o=n(471),a=function(e){return e&&e.__esModule?e:{default:e}}(o),s=i({},a.default.noWobble,{precision:.01});e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0,t.default=void 0;var s=n(0),u=n(1),l=r(u),c=n(472),p=r(c),f=n(473),h=(r(f),function(e){function t(n,r){i(this,t);var a=o(this,e.call(this,n,r));return a.store=n.store,a}return a(t,e),t.prototype.getChildContext=function(){return{store:this.store}},t.prototype.render=function(){return s.Children.only(this.props.children)},t}(s.Component));t.default=h,h.propTypes={store:p.default.isRequired,children:l.default.element.isRequired},h.childContextTypes={store:p.default.isRequired}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){return e.displayName||e.name||"Component"}function u(e,t){try{return e.apply(t)}catch(e){return A.value=e,A}}function l(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=Boolean(e),f=e||E,d=void 0;d="function"==typeof t?t:t?(0,g.default)(t):S;var v=n||C,y=r.pure,_=void 0===y||y,b=r.withRef,w=void 0!==b&&b,O=_&&v!==C,M=D++;return function(e){function t(e,t,n){var r=v(e,t,n);return r}var n="Connect("+s(e)+")",r=function(r){function s(e,t){i(this,s);var a=o(this,r.call(this,e,t));a.version=M,a.store=e.store||t.store,(0,k.default)(a.store,'Could not find "store" in either the context or props of "'+n+'". Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "'+n+'".');var u=a.store.getState();return a.state={storeState:u},a.clearCache(),a}return a(s,r),s.prototype.shouldComponentUpdate=function(){return!_||this.haveOwnPropsChanged||this.hasStoreStateChanged},s.prototype.computeStateProps=function(e,t){if(!this.finalMapStateToProps)return this.configureFinalMapState(e,t);var n=e.getState(),r=this.doStatePropsDependOnOwnProps?this.finalMapStateToProps(n,t):this.finalMapStateToProps(n);return r},s.prototype.configureFinalMapState=function(e,t){var n=f(e.getState(),t),r="function"==typeof n;return this.finalMapStateToProps=r?n:f,this.doStatePropsDependOnOwnProps=1!==this.finalMapStateToProps.length,r?this.computeStateProps(e,t):n},s.prototype.computeDispatchProps=function(e,t){if(!this.finalMapDispatchToProps)return this.configureFinalMapDispatch(e,t);var n=e.dispatch,r=this.doDispatchPropsDependOnOwnProps?this.finalMapDispatchToProps(n,t):this.finalMapDispatchToProps(n);return r},s.prototype.configureFinalMapDispatch=function(e,t){var n=d(e.dispatch,t),r="function"==typeof n;return this.finalMapDispatchToProps=r?n:d,this.doDispatchPropsDependOnOwnProps=1!==this.finalMapDispatchToProps.length,r?this.computeDispatchProps(e,t):n},s.prototype.updateStatePropsIfNeeded=function(){var e=this.computeStateProps(this.store,this.props);return(!this.stateProps||!(0,m.default)(e,this.stateProps))&&(this.stateProps=e,!0)},s.prototype.updateDispatchPropsIfNeeded=function(){var e=this.computeDispatchProps(this.store,this.props);return(!this.dispatchProps||!(0,m.default)(e,this.dispatchProps))&&(this.dispatchProps=e,!0)},s.prototype.updateMergedPropsIfNeeded=function(){var e=t(this.stateProps,this.dispatchProps,this.props);return!(this.mergedProps&&O&&(0,m.default)(e,this.mergedProps))&&(this.mergedProps=e,!0)},s.prototype.isSubscribed=function(){return"function"==typeof this.unsubscribe},s.prototype.trySubscribe=function(){l&&!this.unsubscribe&&(this.unsubscribe=this.store.subscribe(this.handleChange.bind(this)),this.handleChange())},s.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},s.prototype.componentDidMount=function(){this.trySubscribe()},s.prototype.componentWillReceiveProps=function(e){_&&(0,m.default)(e,this.props)||(this.haveOwnPropsChanged=!0)},s.prototype.componentWillUnmount=function(){this.tryUnsubscribe(),this.clearCache()},s.prototype.clearCache=function(){this.dispatchProps=null,this.stateProps=null,this.mergedProps=null,this.haveOwnPropsChanged=!0,this.hasStoreStateChanged=!0,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,this.renderedElement=null,this.finalMapDispatchToProps=null,this.finalMapStateToProps=null},s.prototype.handleChange=function(){if(this.unsubscribe){var e=this.store.getState(),t=this.state.storeState;if(!_||t!==e){if(_&&!this.doStatePropsDependOnOwnProps){var n=u(this.updateStatePropsIfNeeded,this);if(!n)return;n===A&&(this.statePropsPrecalculationError=A.value),this.haveStatePropsBeenPrecalculated=!0}this.hasStoreStateChanged=!0,this.setState({storeState:e})}}},s.prototype.getWrappedInstance=function(){return(0,k.default)(w,"To access the wrapped instance, you need to specify { withRef: true } as the fourth argument of the connect() call."),this.refs.wrappedInstance},s.prototype.render=function(){var t=this.haveOwnPropsChanged,n=this.hasStoreStateChanged,r=this.haveStatePropsBeenPrecalculated,i=this.statePropsPrecalculationError,o=this.renderedElement;if(this.haveOwnPropsChanged=!1,this.hasStoreStateChanged=!1,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,i)throw i;var a=!0,s=!0;_&&o&&(a=n||t&&this.doStatePropsDependOnOwnProps,s=t&&this.doDispatchPropsDependOnOwnProps);var u=!1,l=!1;r?u=!0:a&&(u=this.updateStatePropsIfNeeded()),s&&(l=this.updateDispatchPropsIfNeeded());return!(!!(u||l||t)&&this.updateMergedPropsIfNeeded())&&o?o:(this.renderedElement=w?(0,p.createElement)(e,c({},this.mergedProps,{ref:"wrappedInstance"})):(0,p.createElement)(e,this.mergedProps),this.renderedElement)},s}(p.Component);return r.displayName=n,r.WrappedComponent=e,r.contextTypes={store:h.default},r.propTypes={store:h.default},(0,x.default)(r,e)}}t.__esModule=!0;var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=l;var p=n(0),f=n(472),h=r(f),d=n(1091),m=r(d),v=n(1092),g=r(v),y=n(473),_=(r(y),n(421)),b=(r(_),n(758)),x=r(b),w=n(793),k=r(w),E=function(e){return{}},S=function(e){return{dispatch:e}},C=function(e,t,n){return c({},n,e,t)},A={value:null},D=0},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.connect=t.Provider=void 0;var i=n(1088),o=r(i),a=n(1089),s=r(a);t.Provider=o.default,t.connect=s.default},function(e,t,n){"use strict";function r(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty,o=0;o<n.length;o++)if(!i.call(t,n[o])||e[n[o]]!==t[n[o]])return!1;return!0}t.__esModule=!0,t.default=r},function(e,t,n){"use strict";function r(e){return function(t){return(0,i.bindActionCreators)(e,t)}}t.__esModule=!0,t.default=r;var i=n(486)},function(e,t,n){var r=n(1096);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),c=r(l),p=n(1),f=r(p),h=n(209),d=r(h),m=n(260),v=r(m),g="undefined"!=typeof navigator?navigator.userAgent:"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.2 (KHTML, like Gecko) Safari/537.2",y=function(e){function t(e){i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={size:n.props.size},n}return a(t,e),u(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.prefixer,i=e.split,o=e.style,a=this.state.size,u=["Pane",i,n],l=s({},o||{},{flex:1,position:"relative",outline:"none"});return void 0!==a&&("vertical"===i?l.width=a:(l.height=a,l.display="flex"),l.flex="none"),c.default.createElement("div",{className:u.join(" "),style:r.prefix(l)},t)}}]),t}(c.default.Component);y.propTypes={className:f.default.string.isRequired,children:f.default.node.isRequired,prefixer:f.default.instanceOf(d.default).isRequired,size:f.default.oneOfType([f.default.string,f.default.number]),split:f.default.oneOf(["vertical","horizontal"]),style:v.default},y.defaultProps={prefixer:new d.default({userAgent:g})},t.default=y,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.RESIZER_DEFAULT_CLASSNAME=void 0;var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),l=r(u),c=n(1),p=r(c),f=n(209),h=r(f),d=n(260),m=r(d),v="undefined"!=typeof navigator?navigator.userAgent:"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.2 (KHTML, like Gecko) Safari/537.2",g=t.RESIZER_DEFAULT_CLASSNAME="Resizer",y=function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),s(t,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.onClick,r=e.onDoubleClick,i=e.onMouseDown,o=e.onTouchEnd,a=e.onTouchStart,s=e.prefixer,u=e.resizerClassName,c=e.split,p=e.style,f=[u,c,t];return l.default.createElement("span",{className:f.join(" "),style:s.prefix(p)||{},onMouseDown:function(e){return i(e)},onTouchStart:function(e){e.preventDefault(),a(e)},onTouchEnd:function(e){e.preventDefault(),o(e)},onClick:function(e){n&&(e.preventDefault(),n(e))},onDoubleClick:function(e){r&&(e.preventDefault(),r(e))}})}}]),t}(l.default.Component);y.propTypes={className:p.default.string.isRequired,onClick:p.default.func,onDoubleClick:p.default.func,onMouseDown:p.default.func.isRequired,onTouchStart:p.default.func.isRequired,onTouchEnd:p.default.func.isRequired,prefixer:p.default.instanceOf(h.default).isRequired,split:p.default.oneOf(["vertical","horizontal"]),style:m.default,resizerClassName:p.default.string.isRequired},y.defaultProps={prefixer:new h.default({userAgent:v}),resizerClassName:g},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t){if(e.selection)e.selection.empty();else try{t.getSelection().removeAllRanges()}catch(e){}}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),p=r(c),f=n(1),h=r(f),d=n(449),m=r(d),v=n(209),g=r(v),y=n(260),_=r(y),b=n(1094),x=r(b),w=n(1095),k=r(w),E="undefined"!=typeof navigator?navigator.userAgent:"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.2 (KHTML, like Gecko) Safari/537.2",S=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.onMouseDown=e.onMouseDown.bind(e),e.onTouchStart=e.onTouchStart.bind(e),e.onMouseMove=e.onMouseMove.bind(e),e.onTouchMove=e.onTouchMove.bind(e),e.onMouseUp=e.onMouseUp.bind(e),e.state={active:!1,resized:!1},e}return a(t,e),l(t,[{key:"componentDidMount",value:function(){this.setSize(this.props,this.state),document.addEventListener("mouseup",this.onMouseUp),document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("touchmove",this.onTouchMove)}},{key:"componentWillReceiveProps",value:function(e){this.setSize(e,this.state)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("touchmove",this.onTouchMove)}},{key:"onMouseDown",value:function(e){var t=u({},e,{touches:[{clientX:e.clientX,clientY:e.clientY}]});this.onTouchStart(t)}},{key:"onTouchStart",value:function(e){var t=this.props,n=t.allowResize,r=t.onDragStarted,i=t.split;if(n){s(document,window);var o="vertical"===i?e.touches[0].clientX:e.touches[0].clientY;"function"==typeof r&&r(),this.setState({active:!0,position:o})}}},{key:"onMouseMove",value:function(e){var t=u({},e,{touches:[{clientX:e.clientX,clientY:e.clientY}]});this.onTouchMove(t)}},{key:"onTouchMove",value:function(e){var t=this.props,n=t.allowResize,r=t.maxSize,i=t.minSize,o=t.onChange,a=t.split,u=t.step,l=this.state,c=l.active,p=l.position;if(n&&c){s(document,window);var f="first"===this.props.primary,h=f?this.pane1:this.pane2;if(h){var d=m.default.findDOMNode(h);if(d.getBoundingClientRect){var v=d.getBoundingClientRect().width,g=d.getBoundingClientRect().height,y="vertical"===a?e.touches[0].clientX:e.touches[0].clientY,_="vertical"===a?v:g,b=p-y;if(u){if(Math.abs(b)<u)return;b=~~(b/u)*u}var x=f?b:-b,w=r;if(void 0!==r&&r<=0){var k=this.splitPane;w="vertical"===a?k.getBoundingClientRect().width+r:k.getBoundingClientRect().height+r}var E=_-x,S=p-b;E<i?E=i:void 0!==r&&E>w?E=w:this.setState({position:S,resized:!0}),o&&o(E),this.setState({draggedSize:E}),h.setState({size:E})}}}}},{key:"onMouseUp",value:function(){var e=this.props,t=e.allowResize,n=e.onDragFinished,r=this.state,i=r.active,o=r.draggedSize;t&&i&&("function"==typeof n&&n(o),this.setState({active:!1}))}},{key:"setSize",value:function(e,t){var n=this.props.primary,r="first"===n?this.pane1:this.pane2,i=void 0;r&&(i=e.size||t&&t.draggedSize||e.defaultSize||e.minSize,r.setState({size:i}),e.size!==t.draggedSize&&this.setState({draggedSize:i}))}},{key:"render",value:function(){var e=this,t=this.props,n=t.allowResize,r=t.children,i=t.className,o=t.defaultSize,a=t.minSize,s=t.onResizerClick,l=t.onResizerDoubleClick,c=t.paneClassName,f=t.pane1ClassName,h=t.pane2ClassName,d=t.paneStyle,m=t.pane1Style,v=t.pane2Style,g=t.primary,y=t.prefixer,_=t.resizerClassName,b=t.resizerStyle,E=t.size,S=t.split,C=t.style,A=n?"":"disabled",D=_?_+" "+w.RESIZER_DEFAULT_CLASSNAME:_,O=u({},{display:"flex",flex:1,height:"100%",position:"absolute",outline:"none",overflow:"hidden",MozUserSelect:"text",WebkitUserSelect:"text",msUserSelect:"text",userSelect:"text"},C||{});"vertical"===S?u(O,{flexDirection:"row",left:0,right:0}):u(O,{bottom:0,flexDirection:"column",minHeight:"100%",top:0,width:"100%"});var M=["SplitPane",i,S,A],T=y.prefix(u({},d||{},m||{})),P=y.prefix(u({},d||{},v||{})),I=["Pane1",c,f].join(" "),R=["Pane2",c,h].join(" ");return p.default.createElement("div",{className:M.join(" "),ref:function(t){e.splitPane=t},style:y.prefix(O)},p.default.createElement(x.default,{className:I,key:"pane1",ref:function(t){e.pane1=t},size:"first"===g?E||o||a:void 0,split:S,style:T},r[0]),p.default.createElement(k.default,{className:A,onClick:s,onDoubleClick:l,onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,onTouchEnd:this.onMouseUp,key:"resizer",ref:function(t){e.resizer=t},resizerClassName:D,split:S,style:b||{}}),p.default.createElement(x.default,{className:R,key:"pane2",ref:function(t){e.pane2=t},size:"second"===g?E||o||a:void 0,split:S,style:P},r[1]))}}]),t}(p.default.Component);S.propTypes={allowResize:h.default.bool,children:h.default.arrayOf(h.default.node).isRequired,className:h.default.string,primary:h.default.oneOf(["first","second"]),minSize:h.default.oneOfType([h.default.string,h.default.number]),maxSize:h.default.oneOfType([h.default.string,h.default.number]),defaultSize:h.default.oneOfType([h.default.string,h.default.number]),size:h.default.oneOfType([h.default.string,h.default.number]),split:h.default.oneOf(["vertical","horizontal"]),onDragStarted:h.default.func,onDragFinished:h.default.func,onChange:h.default.func,onResizerClick:h.default.func,onResizerDoubleClick:h.default.func,prefixer:h.default.instanceOf(g.default).isRequired,style:_.default,resizerStyle:_.default,paneClassName:h.default.string,pane1ClassName:h.default.string,pane2ClassName:h.default.string,paneStyle:_.default,pane1Style:_.default,pane2Style:_.default,resizerClassName:h.default.string,step:h.default.number},S.defaultProps={allowResize:!0,minSize:50,prefixer:new g.default({userAgent:E}),primary:"first",split:"vertical",paneClassName:"",pane1ClassName:"",pane2ClassName:""},t.default=S,e.exports=t.default},function(e,t){e.exports=["alignContent","MozAlignContent","WebkitAlignContent","MSAlignContent","OAlignContent","alignItems","MozAlignItems","WebkitAlignItems","MSAlignItems","OAlignItems","alignSelf","MozAlignSelf","WebkitAlignSelf","MSAlignSelf","OAlignSelf","all","MozAll","WebkitAll","MSAll","OAll","animation","MozAnimation","WebkitAnimation","MSAnimation","OAnimation","animationDelay","MozAnimationDelay","WebkitAnimationDelay","MSAnimationDelay","OAnimationDelay","animationDirection","MozAnimationDirection","WebkitAnimationDirection","MSAnimationDirection","OAnimationDirection","animationDuration","MozAnimationDuration","WebkitAnimationDuration","MSAnimationDuration","OAnimationDuration","animationFillMode","MozAnimationFillMode","WebkitAnimationFillMode","MSAnimationFillMode","OAnimationFillMode","animationIterationCount","MozAnimationIterationCount","WebkitAnimationIterationCount","MSAnimationIterationCount","OAnimationIterationCount","animationName","MozAnimationName","WebkitAnimationName","MSAnimationName","OAnimationName","animationPlayState","MozAnimationPlayState","WebkitAnimationPlayState","MSAnimationPlayState","OAnimationPlayState","animationTimingFunction","MozAnimationTimingFunction","WebkitAnimationTimingFunction","MSAnimationTimingFunction","OAnimationTimingFunction","backfaceVisibility","MozBackfaceVisibility","WebkitBackfaceVisibility","MSBackfaceVisibility","OBackfaceVisibility","background","MozBackground","WebkitBackground","MSBackground","OBackground","backgroundAttachment","MozBackgroundAttachment","WebkitBackgroundAttachment","MSBackgroundAttachment","OBackgroundAttachment","backgroundBlendMode","MozBackgroundBlendMode","WebkitBackgroundBlendMode","MSBackgroundBlendMode","OBackgroundBlendMode","backgroundClip","MozBackgroundClip","WebkitBackgroundClip","MSBackgroundClip","OBackgroundClip","backgroundColor","MozBackgroundColor","WebkitBackgroundColor","MSBackgroundColor","OBackgroundColor","backgroundImage","MozBackgroundImage","WebkitBackgroundImage","MSBackgroundImage","OBackgroundImage","backgroundOrigin","MozBackgroundOrigin","WebkitBackgroundOrigin","MSBackgroundOrigin","OBackgroundOrigin","backgroundPosition","MozBackgroundPosition","WebkitBackgroundPosition","MSBackgroundPosition","OBackgroundPosition","backgroundRepeat","MozBackgroundRepeat","WebkitBackgroundRepeat","MSBackgroundRepeat","OBackgroundRepeat","backgroundSize","MozBackgroundSize","WebkitBackgroundSize","MSBackgroundSize","OBackgroundSize","blockSize","MozBlockSize","WebkitBlockSize","MSBlockSize","OBlockSize","border","MozBorder","WebkitBorder","MSBorder","OBorder","borderBlockEnd","MozBorderBlockEnd","WebkitBorderBlockEnd","MSBorderBlockEnd","OBorderBlockEnd","borderBlockEndColor","MozBorderBlockEndColor","WebkitBorderBlockEndColor","MSBorderBlockEndColor","OBorderBlockEndColor","borderBlockEndStyle","MozBorderBlockEndStyle","WebkitBorderBlockEndStyle","MSBorderBlockEndStyle","OBorderBlockEndStyle","borderBlockEndWidth","MozBorderBlockEndWidth","WebkitBorderBlockEndWidth","MSBorderBlockEndWidth","OBorderBlockEndWidth","borderBlockStart","MozBorderBlockStart","WebkitBorderBlockStart","MSBorderBlockStart","OBorderBlockStart","borderBlockStartColor","MozBorderBlockStartColor","WebkitBorderBlockStartColor","MSBorderBlockStartColor","OBorderBlockStartColor","borderBlockStartStyle","MozBorderBlockStartStyle","WebkitBorderBlockStartStyle","MSBorderBlockStartStyle","OBorderBlockStartStyle","borderBlockStartWidth","MozBorderBlockStartWidth","WebkitBorderBlockStartWidth","MSBorderBlockStartWidth","OBorderBlockStartWidth","borderBottom","MozBorderBottom","WebkitBorderBottom","MSBorderBottom","OBorderBottom","borderBottomColor","MozBorderBottomColor","WebkitBorderBottomColor","MSBorderBottomColor","OBorderBottomColor","borderBottomLeftRadius","MozBorderBottomLeftRadius","WebkitBorderBottomLeftRadius","MSBorderBottomLeftRadius","OBorderBottomLeftRadius","borderBottomRightRadius","MozBorderBottomRightRadius","WebkitBorderBottomRightRadius","MSBorderBottomRightRadius","OBorderBottomRightRadius","borderBottomStyle","MozBorderBottomStyle","WebkitBorderBottomStyle","MSBorderBottomStyle","OBorderBottomStyle","borderBottomWidth","MozBorderBottomWidth","WebkitBorderBottomWidth","MSBorderBottomWidth","OBorderBottomWidth","borderCollapse","MozBorderCollapse","WebkitBorderCollapse","MSBorderCollapse","OBorderCollapse","borderColor","MozBorderColor","WebkitBorderColor","MSBorderColor","OBorderColor","borderImage","MozBorderImage","WebkitBorderImage","MSBorderImage","OBorderImage","borderImageOutset","MozBorderImageOutset","WebkitBorderImageOutset","MSBorderImageOutset","OBorderImageOutset","borderImageRepeat","MozBorderImageRepeat","WebkitBorderImageRepeat","MSBorderImageRepeat","OBorderImageRepeat","borderImageSlice","MozBorderImageSlice","WebkitBorderImageSlice","MSBorderImageSlice","OBorderImageSlice","borderImageSource","MozBorderImageSource","WebkitBorderImageSource","MSBorderImageSource","OBorderImageSource","borderImageWidth","MozBorderImageWidth","WebkitBorderImageWidth","MSBorderImageWidth","OBorderImageWidth","borderInlineEnd","MozBorderInlineEnd","WebkitBorderInlineEnd","MSBorderInlineEnd","OBorderInlineEnd","borderInlineEndColor","MozBorderInlineEndColor","WebkitBorderInlineEndColor","MSBorderInlineEndColor","OBorderInlineEndColor","borderInlineEndStyle","MozBorderInlineEndStyle","WebkitBorderInlineEndStyle","MSBorderInlineEndStyle","OBorderInlineEndStyle","borderInlineEndWidth","MozBorderInlineEndWidth","WebkitBorderInlineEndWidth","MSBorderInlineEndWidth","OBorderInlineEndWidth","borderInlineStart","MozBorderInlineStart","WebkitBorderInlineStart","MSBorderInlineStart","OBorderInlineStart","borderInlineStartColor","MozBorderInlineStartColor","WebkitBorderInlineStartColor","MSBorderInlineStartColor","OBorderInlineStartColor","borderInlineStartStyle","MozBorderInlineStartStyle","WebkitBorderInlineStartStyle","MSBorderInlineStartStyle","OBorderInlineStartStyle","borderInlineStartWidth","MozBorderInlineStartWidth","WebkitBorderInlineStartWidth","MSBorderInlineStartWidth","OBorderInlineStartWidth","borderLeft","MozBorderLeft","WebkitBorderLeft","MSBorderLeft","OBorderLeft","borderLeftColor","MozBorderLeftColor","WebkitBorderLeftColor","MSBorderLeftColor","OBorderLeftColor","borderLeftStyle","MozBorderLeftStyle","WebkitBorderLeftStyle","MSBorderLeftStyle","OBorderLeftStyle","borderLeftWidth","MozBorderLeftWidth","WebkitBorderLeftWidth","MSBorderLeftWidth","OBorderLeftWidth","borderRadius","MozBorderRadius","WebkitBorderRadius","MSBorderRadius","OBorderRadius","borderRight","MozBorderRight","WebkitBorderRight","MSBorderRight","OBorderRight","borderRightColor","MozBorderRightColor","WebkitBorderRightColor","MSBorderRightColor","OBorderRightColor","borderRightStyle","MozBorderRightStyle","WebkitBorderRightStyle","MSBorderRightStyle","OBorderRightStyle","borderRightWidth","MozBorderRightWidth","WebkitBorderRightWidth","MSBorderRightWidth","OBorderRightWidth","borderSpacing","MozBorderSpacing","WebkitBorderSpacing","MSBorderSpacing","OBorderSpacing","borderStyle","MozBorderStyle","WebkitBorderStyle","MSBorderStyle","OBorderStyle","borderTop","MozBorderTop","WebkitBorderTop","MSBorderTop","OBorderTop","borderTopColor","MozBorderTopColor","WebkitBorderTopColor","MSBorderTopColor","OBorderTopColor","borderTopLeftRadius","MozBorderTopLeftRadius","WebkitBorderTopLeftRadius","MSBorderTopLeftRadius","OBorderTopLeftRadius","borderTopRightRadius","MozBorderTopRightRadius","WebkitBorderTopRightRadius","MSBorderTopRightRadius","OBorderTopRightRadius","borderTopStyle","MozBorderTopStyle","WebkitBorderTopStyle","MSBorderTopStyle","OBorderTopStyle","borderTopWidth","MozBorderTopWidth","WebkitBorderTopWidth","MSBorderTopWidth","OBorderTopWidth","borderWidth","MozBorderWidth","WebkitBorderWidth","MSBorderWidth","OBorderWidth","bottom","MozBottom","WebkitBottom","MSBottom","OBottom","boxDecorationBreak","MozBoxDecorationBreak","WebkitBoxDecorationBreak","MSBoxDecorationBreak","OBoxDecorationBreak","boxShadow","MozBoxShadow","WebkitBoxShadow","MSBoxShadow","OBoxShadow","boxSizing","MozBoxSizing","WebkitBoxSizing","MSBoxSizing","OBoxSizing","breakAfter","MozBreakAfter","WebkitBreakAfter","MSBreakAfter","OBreakAfter","breakBefore","MozBreakBefore","WebkitBreakBefore","MSBreakBefore","OBreakBefore","breakInside","MozBreakInside","WebkitBreakInside","MSBreakInside","OBreakInside","captionSide","MozCaptionSide","WebkitCaptionSide","MSCaptionSide","OCaptionSide","caretColor","MozCaretColor","WebkitCaretColor","MSCaretColor","OCaretColor","ch","MozCh","WebkitCh","MSCh","OCh","clear","MozClear","WebkitClear","MSClear","OClear","clip","MozClip","WebkitClip","MSClip","OClip","clipPath","MozClipPath","WebkitClipPath","MSClipPath","OClipPath","cm","MozCm","WebkitCm","MSCm","OCm","color","MozColor","WebkitColor","MSColor","OColor","columnCount","MozColumnCount","WebkitColumnCount","MSColumnCount","OColumnCount","columnFill","MozColumnFill","WebkitColumnFill","MSColumnFill","OColumnFill","columnGap","MozColumnGap","WebkitColumnGap","MSColumnGap","OColumnGap","columnRule","MozColumnRule","WebkitColumnRule","MSColumnRule","OColumnRule","columnRuleColor","MozColumnRuleColor","WebkitColumnRuleColor","MSColumnRuleColor","OColumnRuleColor","columnRuleStyle","MozColumnRuleStyle","WebkitColumnRuleStyle","MSColumnRuleStyle","OColumnRuleStyle","columnRuleWidth","MozColumnRuleWidth","WebkitColumnRuleWidth","MSColumnRuleWidth","OColumnRuleWidth","columnSpan","MozColumnSpan","WebkitColumnSpan","MSColumnSpan","OColumnSpan","columnWidth","MozColumnWidth","WebkitColumnWidth","MSColumnWidth","OColumnWidth","columns","MozColumns","WebkitColumns","MSColumns","OColumns","content","MozContent","WebkitContent","MSContent","OContent","counterIncrement","MozCounterIncrement","WebkitCounterIncrement","MSCounterIncrement","OCounterIncrement","counterReset","MozCounterReset","WebkitCounterReset","MSCounterReset","OCounterReset","cursor","MozCursor","WebkitCursor","MSCursor","OCursor","deg","MozDeg","WebkitDeg","MSDeg","ODeg","direction","MozDirection","WebkitDirection","MSDirection","ODirection","display","MozDisplay","WebkitDisplay","MSDisplay","ODisplay","dpcm","MozDpcm","WebkitDpcm","MSDpcm","ODpcm","dpi","MozDpi","WebkitDpi","MSDpi","ODpi","dppx","MozDppx","WebkitDppx","MSDppx","ODppx","em","MozEm","WebkitEm","MSEm","OEm","emptyCells","MozEmptyCells","WebkitEmptyCells","MSEmptyCells","OEmptyCells","ex","MozEx","WebkitEx","MSEx","OEx","filter","MozFilter","WebkitFilter","MSFilter","OFilter","flexBasis","MozFlexBasis","WebkitFlexBasis","MSFlexBasis","OFlexBasis","flexDirection","MozFlexDirection","WebkitFlexDirection","MSFlexDirection","OFlexDirection","flexFlow","MozFlexFlow","WebkitFlexFlow","MSFlexFlow","OFlexFlow","flexGrow","MozFlexGrow","WebkitFlexGrow","MSFlexGrow","OFlexGrow","flexShrink","MozFlexShrink","WebkitFlexShrink","MSFlexShrink","OFlexShrink","flexWrap","MozFlexWrap","WebkitFlexWrap","MSFlexWrap","OFlexWrap","float","MozFloat","WebkitFloat","MSFloat","OFloat","font","MozFont","WebkitFont","MSFont","OFont","fontFamily","MozFontFamily","WebkitFontFamily","MSFontFamily","OFontFamily","fontFeatureSettings","MozFontFeatureSettings","WebkitFontFeatureSettings","MSFontFeatureSettings","OFontFeatureSettings","fontKerning","MozFontKerning","WebkitFontKerning","MSFontKerning","OFontKerning","fontLanguageOverride","MozFontLanguageOverride","WebkitFontLanguageOverride","MSFontLanguageOverride","OFontLanguageOverride","fontSize","MozFontSize","WebkitFontSize","MSFontSize","OFontSize","fontSizeAdjust","MozFontSizeAdjust","WebkitFontSizeAdjust","MSFontSizeAdjust","OFontSizeAdjust","fontStretch","MozFontStretch","WebkitFontStretch","MSFontStretch","OFontStretch","fontStyle","MozFontStyle","WebkitFontStyle","MSFontStyle","OFontStyle","fontSynthesis","MozFontSynthesis","WebkitFontSynthesis","MSFontSynthesis","OFontSynthesis","fontVariant","MozFontVariant","WebkitFontVariant","MSFontVariant","OFontVariant","fontVariantAlternates","MozFontVariantAlternates","WebkitFontVariantAlternates","MSFontVariantAlternates","OFontVariantAlternates","fontVariantCaps","MozFontVariantCaps","WebkitFontVariantCaps","MSFontVariantCaps","OFontVariantCaps","fontVariantEastAsian","MozFontVariantEastAsian","WebkitFontVariantEastAsian","MSFontVariantEastAsian","OFontVariantEastAsian","fontVariantLigatures","MozFontVariantLigatures","WebkitFontVariantLigatures","MSFontVariantLigatures","OFontVariantLigatures","fontVariantNumeric","MozFontVariantNumeric","WebkitFontVariantNumeric","MSFontVariantNumeric","OFontVariantNumeric","fontVariantPosition","MozFontVariantPosition","WebkitFontVariantPosition","MSFontVariantPosition","OFontVariantPosition","fontWeight","MozFontWeight","WebkitFontWeight","MSFontWeight","OFontWeight","fr","MozFr","WebkitFr","MSFr","OFr","grad","MozGrad","WebkitGrad","MSGrad","OGrad","grid","MozGrid","WebkitGrid","MSGrid","OGrid","gridArea","MozGridArea","WebkitGridArea","MSGridArea","OGridArea","gridAutoColumns","MozGridAutoColumns","WebkitGridAutoColumns","MSGridAutoColumns","OGridAutoColumns","gridAutoFlow","MozGridAutoFlow","WebkitGridAutoFlow","MSGridAutoFlow","OGridAutoFlow","gridAutoRows","MozGridAutoRows","WebkitGridAutoRows","MSGridAutoRows","OGridAutoRows","gridColumn","MozGridColumn","WebkitGridColumn","MSGridColumn","OGridColumn","gridColumnEnd","MozGridColumnEnd","WebkitGridColumnEnd","MSGridColumnEnd","OGridColumnEnd","gridColumnGap","MozGridColumnGap","WebkitGridColumnGap","MSGridColumnGap","OGridColumnGap","gridColumnStart","MozGridColumnStart","WebkitGridColumnStart","MSGridColumnStart","OGridColumnStart","gridGap","MozGridGap","WebkitGridGap","MSGridGap","OGridGap","gridRow","MozGridRow","WebkitGridRow","MSGridRow","OGridRow","gridRowEnd","MozGridRowEnd","WebkitGridRowEnd","MSGridRowEnd","OGridRowEnd","gridRowGap","MozGridRowGap","WebkitGridRowGap","MSGridRowGap","OGridRowGap","gridRowStart","MozGridRowStart","WebkitGridRowStart","MSGridRowStart","OGridRowStart","gridTemplate","MozGridTemplate","WebkitGridTemplate","MSGridTemplate","OGridTemplate","gridTemplateAreas","MozGridTemplateAreas","WebkitGridTemplateAreas","MSGridTemplateAreas","OGridTemplateAreas","gridTemplateColumns","MozGridTemplateColumns","WebkitGridTemplateColumns","MSGridTemplateColumns","OGridTemplateColumns","gridTemplateRows","MozGridTemplateRows","WebkitGridTemplateRows","MSGridTemplateRows","OGridTemplateRows","height","MozHeight","WebkitHeight","MSHeight","OHeight","hyphens","MozHyphens","WebkitHyphens","MSHyphens","OHyphens","hz","MozHz","WebkitHz","MSHz","OHz","imageOrientation","MozImageOrientation","WebkitImageOrientation","MSImageOrientation","OImageOrientation","imageRendering","MozImageRendering","WebkitImageRendering","MSImageRendering","OImageRendering","imageResolution","MozImageResolution","WebkitImageResolution","MSImageResolution","OImageResolution","imeMode","MozImeMode","WebkitImeMode","MSImeMode","OImeMode","in","MozIn","WebkitIn","MSIn","OIn","inherit","MozInherit","WebkitInherit","MSInherit","OInherit","initial","MozInitial","WebkitInitial","MSInitial","OInitial","inlineSize","MozInlineSize","WebkitInlineSize","MSInlineSize","OInlineSize","isolation","MozIsolation","WebkitIsolation","MSIsolation","OIsolation","justifyContent","MozJustifyContent","WebkitJustifyContent","MSJustifyContent","OJustifyContent","khz","MozKhz","WebkitKhz","MSKhz","OKhz","left","MozLeft","WebkitLeft","MSLeft","OLeft","letterSpacing","MozLetterSpacing","WebkitLetterSpacing","MSLetterSpacing","OLetterSpacing","lineBreak","MozLineBreak","WebkitLineBreak","MSLineBreak","OLineBreak","lineHeight","MozLineHeight","WebkitLineHeight","MSLineHeight","OLineHeight","listStyle","MozListStyle","WebkitListStyle","MSListStyle","OListStyle","listStyleImage","MozListStyleImage","WebkitListStyleImage","MSListStyleImage","OListStyleImage","listStylePosition","MozListStylePosition","WebkitListStylePosition","MSListStylePosition","OListStylePosition","listStyleType","MozListStyleType","WebkitListStyleType","MSListStyleType","OListStyleType","margin","MozMargin","WebkitMargin","MSMargin","OMargin","marginBlockEnd","MozMarginBlockEnd","WebkitMarginBlockEnd","MSMarginBlockEnd","OMarginBlockEnd","marginBlockStart","MozMarginBlockStart","WebkitMarginBlockStart","MSMarginBlockStart","OMarginBlockStart","marginBottom","MozMarginBottom","WebkitMarginBottom","MSMarginBottom","OMarginBottom","marginInlineEnd","MozMarginInlineEnd","WebkitMarginInlineEnd","MSMarginInlineEnd","OMarginInlineEnd","marginInlineStart","MozMarginInlineStart","WebkitMarginInlineStart","MSMarginInlineStart","OMarginInlineStart","marginLeft","MozMarginLeft","WebkitMarginLeft","MSMarginLeft","OMarginLeft","marginRight","MozMarginRight","WebkitMarginRight","MSMarginRight","OMarginRight","marginTop","MozMarginTop","WebkitMarginTop","MSMarginTop","OMarginTop","mask","MozMask","WebkitMask","MSMask","OMask","maskClip","MozMaskClip","WebkitMaskClip","MSMaskClip","OMaskClip","maskComposite","MozMaskComposite","WebkitMaskComposite","MSMaskComposite","OMaskComposite","maskImage","MozMaskImage","WebkitMaskImage","MSMaskImage","OMaskImage","maskMode","MozMaskMode","WebkitMaskMode","MSMaskMode","OMaskMode","maskOrigin","MozMaskOrigin","WebkitMaskOrigin","MSMaskOrigin","OMaskOrigin","maskPosition","MozMaskPosition","WebkitMaskPosition","MSMaskPosition","OMaskPosition","maskRepeat","MozMaskRepeat","WebkitMaskRepeat","MSMaskRepeat","OMaskRepeat","maskSize","MozMaskSize","WebkitMaskSize","MSMaskSize","OMaskSize","maskType","MozMaskType","WebkitMaskType","MSMaskType","OMaskType","maxHeight","MozMaxHeight","WebkitMaxHeight","MSMaxHeight","OMaxHeight","maxWidth","MozMaxWidth","WebkitMaxWidth","MSMaxWidth","OMaxWidth","minBlockSize","MozMinBlockSize","WebkitMinBlockSize","MSMinBlockSize","OMinBlockSize","minHeight","MozMinHeight","WebkitMinHeight","MSMinHeight","OMinHeight","minInlineSize","MozMinInlineSize","WebkitMinInlineSize","MSMinInlineSize","OMinInlineSize","minWidth","MozMinWidth","WebkitMinWidth","MSMinWidth","OMinWidth","mixBlendMode","MozMixBlendMode","WebkitMixBlendMode","MSMixBlendMode","OMixBlendMode","mm","MozMm","WebkitMm","MSMm","OMm","ms","MozMs","WebkitMs","MSMs","OMs","objectFit","MozObjectFit","WebkitObjectFit","MSObjectFit","OObjectFit","objectPosition","MozObjectPosition","WebkitObjectPosition","MSObjectPosition","OObjectPosition","offsetBlockEnd","MozOffsetBlockEnd","WebkitOffsetBlockEnd","MSOffsetBlockEnd","OOffsetBlockEnd","offsetBlockStart","MozOffsetBlockStart","WebkitOffsetBlockStart","MSOffsetBlockStart","OOffsetBlockStart","offsetInlineEnd","MozOffsetInlineEnd","WebkitOffsetInlineEnd","MSOffsetInlineEnd","OOffsetInlineEnd","offsetInlineStart","MozOffsetInlineStart","WebkitOffsetInlineStart","MSOffsetInlineStart","OOffsetInlineStart","opacity","MozOpacity","WebkitOpacity","MSOpacity","OOpacity","order","MozOrder","WebkitOrder","MSOrder","OOrder","orphans","MozOrphans","WebkitOrphans","MSOrphans","OOrphans","outline","MozOutline","WebkitOutline","MSOutline","OOutline","outlineColor","MozOutlineColor","WebkitOutlineColor","MSOutlineColor","OOutlineColor","outlineOffset","MozOutlineOffset","WebkitOutlineOffset","MSOutlineOffset","OOutlineOffset","outlineStyle","MozOutlineStyle","WebkitOutlineStyle","MSOutlineStyle","OOutlineStyle","outlineWidth","MozOutlineWidth","WebkitOutlineWidth","MSOutlineWidth","OOutlineWidth","overflow","MozOverflow","WebkitOverflow","MSOverflow","OOverflow","overflowWrap","MozOverflowWrap","WebkitOverflowWrap","MSOverflowWrap","OOverflowWrap","overflowX","MozOverflowX","WebkitOverflowX","MSOverflowX","OOverflowX","overflowY","MozOverflowY","WebkitOverflowY","MSOverflowY","OOverflowY","padding","MozPadding","WebkitPadding","MSPadding","OPadding","paddingBlockEnd","MozPaddingBlockEnd","WebkitPaddingBlockEnd","MSPaddingBlockEnd","OPaddingBlockEnd","paddingBlockStart","MozPaddingBlockStart","WebkitPaddingBlockStart","MSPaddingBlockStart","OPaddingBlockStart","paddingBottom","MozPaddingBottom","WebkitPaddingBottom","MSPaddingBottom","OPaddingBottom","paddingInlineEnd","MozPaddingInlineEnd","WebkitPaddingInlineEnd","MSPaddingInlineEnd","OPaddingInlineEnd","paddingInlineStart","MozPaddingInlineStart","WebkitPaddingInlineStart","MSPaddingInlineStart","OPaddingInlineStart","paddingLeft","MozPaddingLeft","WebkitPaddingLeft","MSPaddingLeft","OPaddingLeft","paddingRight","MozPaddingRight","WebkitPaddingRight","MSPaddingRight","OPaddingRight","paddingTop","MozPaddingTop","WebkitPaddingTop","MSPaddingTop","OPaddingTop","pageBreakAfter","MozPageBreakAfter","WebkitPageBreakAfter","MSPageBreakAfter","OPageBreakAfter","pageBreakBefore","MozPageBreakBefore","WebkitPageBreakBefore","MSPageBreakBefore","OPageBreakBefore","pageBreakInside","MozPageBreakInside","WebkitPageBreakInside","MSPageBreakInside","OPageBreakInside","pc","MozPc","WebkitPc","MSPc","OPc","perspective","MozPerspective","WebkitPerspective","MSPerspective","OPerspective","perspectiveOrigin","MozPerspectiveOrigin","WebkitPerspectiveOrigin","MSPerspectiveOrigin","OPerspectiveOrigin","pointerEvents","MozPointerEvents","WebkitPointerEvents","MSPointerEvents","OPointerEvents","position","MozPosition","WebkitPosition","MSPosition","OPosition","pt","MozPt","WebkitPt","MSPt","OPt","px","MozPx","WebkitPx","MSPx","OPx","q","MozQ","WebkitQ","MSQ","OQ","quotes","MozQuotes","WebkitQuotes","MSQuotes","OQuotes","rad","MozRad","WebkitRad","MSRad","ORad","rem","MozRem","WebkitRem","MSRem","ORem","resize","MozResize","WebkitResize","MSResize","OResize","revert","MozRevert","WebkitRevert","MSRevert","ORevert","right","MozRight","WebkitRight","MSRight","ORight","rubyAlign","MozRubyAlign","WebkitRubyAlign","MSRubyAlign","ORubyAlign","rubyMerge","MozRubyMerge","WebkitRubyMerge","MSRubyMerge","ORubyMerge","rubyPosition","MozRubyPosition","WebkitRubyPosition","MSRubyPosition","ORubyPosition","s","MozS","WebkitS","MSS","OS","scrollBehavior","MozScrollBehavior","WebkitScrollBehavior","MSScrollBehavior","OScrollBehavior","scrollSnapCoordinate","MozScrollSnapCoordinate","WebkitScrollSnapCoordinate","MSScrollSnapCoordinate","OScrollSnapCoordinate","scrollSnapDestination","MozScrollSnapDestination","WebkitScrollSnapDestination","MSScrollSnapDestination","OScrollSnapDestination","scrollSnapType","MozScrollSnapType","WebkitScrollSnapType","MSScrollSnapType","OScrollSnapType","shapeImageThreshold","MozShapeImageThreshold","WebkitShapeImageThreshold","MSShapeImageThreshold","OShapeImageThreshold","shapeMargin","MozShapeMargin","WebkitShapeMargin","MSShapeMargin","OShapeMargin","shapeOutside","MozShapeOutside","WebkitShapeOutside","MSShapeOutside","OShapeOutside","tabSize","MozTabSize","WebkitTabSize","MSTabSize","OTabSize","tableLayout","MozTableLayout","WebkitTableLayout","MSTableLayout","OTableLayout","textAlign","MozTextAlign","WebkitTextAlign","MSTextAlign","OTextAlign","textAlignLast","MozTextAlignLast","WebkitTextAlignLast","MSTextAlignLast","OTextAlignLast","textCombineUpright","MozTextCombineUpright","WebkitTextCombineUpright","MSTextCombineUpright","OTextCombineUpright","textDecoration","MozTextDecoration","WebkitTextDecoration","MSTextDecoration","OTextDecoration","textDecorationColor","MozTextDecorationColor","WebkitTextDecorationColor","MSTextDecorationColor","OTextDecorationColor","textDecorationLine","MozTextDecorationLine","WebkitTextDecorationLine","MSTextDecorationLine","OTextDecorationLine","textDecorationStyle","MozTextDecorationStyle","WebkitTextDecorationStyle","MSTextDecorationStyle","OTextDecorationStyle","textEmphasis","MozTextEmphasis","WebkitTextEmphasis","MSTextEmphasis","OTextEmphasis","textEmphasisColor","MozTextEmphasisColor","WebkitTextEmphasisColor","MSTextEmphasisColor","OTextEmphasisColor","textEmphasisPosition","MozTextEmphasisPosition","WebkitTextEmphasisPosition","MSTextEmphasisPosition","OTextEmphasisPosition","textEmphasisStyle","MozTextEmphasisStyle","WebkitTextEmphasisStyle","MSTextEmphasisStyle","OTextEmphasisStyle","textIndent","MozTextIndent","WebkitTextIndent","MSTextIndent","OTextIndent","textOrientation","MozTextOrientation","WebkitTextOrientation","MSTextOrientation","OTextOrientation","textOverflow","MozTextOverflow","WebkitTextOverflow","MSTextOverflow","OTextOverflow","textRendering","MozTextRendering","WebkitTextRendering","MSTextRendering","OTextRendering","textShadow","MozTextShadow","WebkitTextShadow","MSTextShadow","OTextShadow","textTransform","MozTextTransform","WebkitTextTransform","MSTextTransform","OTextTransform","textUnderlinePosition","MozTextUnderlinePosition","WebkitTextUnderlinePosition","MSTextUnderlinePosition","OTextUnderlinePosition","top","MozTop","WebkitTop","MSTop","OTop","touchAction","MozTouchAction","WebkitTouchAction","MSTouchAction","OTouchAction","transform","MozTransform","WebkitTransform","msTransform","OTransform","transformBox","MozTransformBox","WebkitTransformBox","MSTransformBox","OTransformBox","transformOrigin","MozTransformOrigin","WebkitTransformOrigin","MSTransformOrigin","OTransformOrigin","transformStyle","MozTransformStyle","WebkitTransformStyle","MSTransformStyle","OTransformStyle","transition","MozTransition","WebkitTransition","MSTransition","OTransition","transitionDelay","MozTransitionDelay","WebkitTransitionDelay","MSTransitionDelay","OTransitionDelay","transitionDuration","MozTransitionDuration","WebkitTransitionDuration","MSTransitionDuration","OTransitionDuration","transitionProperty","MozTransitionProperty","WebkitTransitionProperty","MSTransitionProperty","OTransitionProperty","transitionTimingFunction","MozTransitionTimingFunction","WebkitTransitionTimingFunction","MSTransitionTimingFunction","OTransitionTimingFunction","turn","MozTurn","WebkitTurn","MSTurn","OTurn","unicodeBidi","MozUnicodeBidi","WebkitUnicodeBidi","MSUnicodeBidi","OUnicodeBidi","unset","MozUnset","WebkitUnset","MSUnset","OUnset","verticalAlign","MozVerticalAlign","WebkitVerticalAlign","MSVerticalAlign","OVerticalAlign","vh","MozVh","WebkitVh","MSVh","OVh","visibility","MozVisibility","WebkitVisibility","MSVisibility","OVisibility","vmax","MozVmax","WebkitVmax","MSVmax","OVmax","vmin","MozVmin","WebkitVmin","MSVmin","OVmin","vw","MozVw","WebkitVw","MSVw","OVw","whiteSpace","MozWhiteSpace","WebkitWhiteSpace","MSWhiteSpace","OWhiteSpace","widows","MozWidows","WebkitWidows","MSWidows","OWidows","width","MozWidth","WebkitWidth","MSWidth","OWidth","willChange","MozWillChange","WebkitWillChange","MSWillChange","OWillChange","wordBreak","MozWordBreak","WebkitWordBreak","MSWordBreak","OWordBreak","wordSpacing","MozWordSpacing","WebkitWordSpacing","MSWordSpacing","OWordSpacing","wordWrap","MozWordWrap","WebkitWordWrap","MSWordWrap","OWordWrap","writingMode","MozWritingMode","WebkitWritingMode","MSWritingMode","OWritingMode","zIndex","MozZIndex","WebkitZIndex","MSZIndex","OZIndex","fontSize","MozFontSize","WebkitFontSize","MSFontSize","OFontSize","flex","MozFlex","WebkitFlex","MSFlex","OFlex","fr","MozFr","WebkitFr","MSFr","OFr","overflowScrolling","MozOverflowScrolling","WebkitOverflowScrolling","MSOverflowScrolling","OOverflowScrolling"]},function(e,t,n){"use strict";function r(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}function i(e){var t=/(=0|=2)/g,n={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(t,function(e){return n[e]})}var o={escape:r,unescape:i};e.exports=o},function(e,t,n){"use strict";var r=n(126),i=(n(8),function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)}),o=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},a=function(e,t,n){var r=this;if(r.instancePool.length){var i=r.instancePool.pop();return r.call(i,e,t,n),i}return new r(e,t,n)},s=function(e,t,n,r){var i=this;if(i.instancePool.length){var o=i.instancePool.pop();return i.call(o,e,t,n,r),o}return new i(e,t,n,r)},u=function(e){var t=this;e instanceof t||r("25"),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},l=i,c=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||l,n.poolSize||(n.poolSize=10),n.release=u,n},p={addPoolingTo:c,oneArgumentPooler:i,twoArgumentPooler:o,threeArgumentPooler:a,fourArgumentPooler:s};e.exports=p},function(e,t,n){"use strict";function r(e){return(""+e).replace(b,"$&/")}function i(e,t){this.func=e,this.context=t,this.count=0}function o(e,t,n){var r=e.func,i=e.context;r.call(i,t,e.count++)}function a(e,t,n){if(null==e)return e;var r=i.getPooled(t,n);g(e,o,r),i.release(r)}function s(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function u(e,t,n){var i=e.result,o=e.keyPrefix,a=e.func,s=e.context,u=a.call(s,t,e.count++);Array.isArray(u)?l(u,i,n,v.thatReturnsArgument):null!=u&&(m.isValidElement(u)&&(u=m.cloneAndReplaceKey(u,o+(!u.key||t&&t.key===u.key?"":r(u.key)+"/")+n)),i.push(u))}function l(e,t,n,i,o){var a="";null!=n&&(a=r(n)+"/");var l=s.getPooled(t,a,i,o);g(e,u,l),s.release(l)}function c(e,t,n){if(null==e)return e;var r=[];return l(e,r,null,t,n),r}function p(e,t,n){return null}function f(e,t){return g(e,p,null)}function h(e){var t=[];return l(e,t,null,v.thatReturnsArgument),t}var d=n(1099),m=n(93),v=n(32),g=n(1109),y=d.twoArgumentPooler,_=d.fourArgumentPooler,b=/\/+/g;i.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},d.addPoolingTo(i,y),s.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},d.addPoolingTo(s,_);var x={forEach:a,map:c,mapIntoWithKeyPrefixInternal:l,count:f,toArray:h};e.exports=x},function(e,t,n){"use strict";var r=n(93),i=r.createFactory,o={a:i("a"),abbr:i("abbr"),address:i("address"),area:i("area"),article:i("article"),aside:i("aside"),audio:i("audio"),b:i("b"),base:i("base"),bdi:i("bdi"),bdo:i("bdo"),big:i("big"),blockquote:i("blockquote"),body:i("body"),br:i("br"),button:i("button"),canvas:i("canvas"),caption:i("caption"),cite:i("cite"),code:i("code"),col:i("col"),colgroup:i("colgroup"),data:i("data"),datalist:i("datalist"),dd:i("dd"),del:i("del"),details:i("details"),dfn:i("dfn"),dialog:i("dialog"),div:i("div"),dl:i("dl"),dt:i("dt"),em:i("em"),embed:i("embed"),fieldset:i("fieldset"),figcaption:i("figcaption"),figure:i("figure"),footer:i("footer"),form:i("form"),h1:i("h1"),h2:i("h2"),h3:i("h3"),h4:i("h4"),h5:i("h5"),h6:i("h6"),head:i("head"),header:i("header"),hgroup:i("hgroup"),hr:i("hr"),html:i("html"),i:i("i"),iframe:i("iframe"),img:i("img"),input:i("input"),ins:i("ins"),kbd:i("kbd"),keygen:i("keygen"),label:i("label"),legend:i("legend"),li:i("li"),link:i("link"),main:i("main"),map:i("map"),mark:i("mark"),menu:i("menu"),menuitem:i("menuitem"),meta:i("meta"),meter:i("meter"),nav:i("nav"),noscript:i("noscript"),object:i("object"),ol:i("ol"),optgroup:i("optgroup"),option:i("option"),output:i("output"),p:i("p"),param:i("param"),picture:i("picture"),pre:i("pre"),progress:i("progress"),q:i("q"),rp:i("rp"),rt:i("rt"),ruby:i("ruby"),s:i("s"),samp:i("samp"),script:i("script"),section:i("section"),select:i("select"),small:i("small"),source:i("source"),span:i("span"),strong:i("strong"),style:i("style"),sub:i("sub"),summary:i("summary"),sup:i("sup"),table:i("table"),tbody:i("tbody"),td:i("td"),textarea:i("textarea"),tfoot:i("tfoot"),th:i("th"),thead:i("thead"),time:i("time"),title:i("title"),tr:i("tr"),track:i("track"),u:i("u"),ul:i("ul"),var:i("var"),video:i("video"),wbr:i("wbr"),circle:i("circle"),clipPath:i("clipPath"),defs:i("defs"),ellipse:i("ellipse"),g:i("g"),image:i("image"),line:i("line"),linearGradient:i("linearGradient"),mask:i("mask"),path:i("path"),pattern:i("pattern"),polygon:i("polygon"),polyline:i("polyline"),radialGradient:i("radialGradient"),rect:i("rect"),stop:i("stop"),svg:i("svg"),text:i("text"),tspan:i("tspan")};e.exports=o},function(e,t,n){"use strict";var r=n(93),i=r.isValidElement,o=n(443);e.exports=o(i)},function(e,t,n){"use strict";e.exports="15.6.2"},function(e,t,n){"use strict";var r=n(474),i=r.Component,o=n(93),a=o.isValidElement,s=n(477),u=n(694);e.exports=u(i,a,s)},function(e,t,n){"use strict";function r(e){var t=e&&(i&&e[i]||e[o]);if("function"==typeof t)return t}var i="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";e.exports=r},function(e,t,n){"use strict";function r(){return i++}var i=1;e.exports=r},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";function r(e){return o.isValidElement(e)||i("143"),e}var i=n(126),o=n(93);n(8);e.exports=r},function(e,t,n){"use strict";function r(e,t){return e&&"object"==typeof e&&null!=e.key?l.escape(e.key):t.toString(36)}function i(e,t,n,o){var f=typeof e;if("undefined"!==f&&"boolean"!==f||(e=null),null===e||"string"===f||"number"===f||"object"===f&&e.$$typeof===s)return n(o,e,""===t?c+r(e,0):t),1;var h,d,m=0,v=""===t?c:t+p;if(Array.isArray(e))for(var g=0;g<e.length;g++)h=e[g],d=v+r(h,g),m+=i(h,d,n,o);else{var y=u(e);if(y){var _,b=y.call(e);if(y!==e.entries)for(var x=0;!(_=b.next()).done;)h=_.value,d=v+r(h,x++),m+=i(h,d,n,o);else for(;!(_=b.next()).done;){var w=_.value;w&&(h=w[1],d=v+l.escape(w[0])+p+r(h,0),m+=i(h,d,n,o))}}else if("object"===f){var k="",E=String(e);a("31","[object Object]"===E?"object with keys {"+Object.keys(e).join(", ")+"}":E,k)}}return m}function o(e,t,n){return null==e?0:i(e,"",t,n)}var a=n(126),s=(n(52),n(476)),u=n(1105),l=(n(8),n(1098)),c=(n(10),"."),p=":";e.exports=o},function(e,t,n){e.exports=n(71)},function(e,t,n){"use strict";function r(e){if(!(this instanceof r))return new r(e);i.call(this,e)}e.exports=r;var i=n(480),o=n(111);o.inherits=n(42),o.inherits(r,i),r.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t,n){e.copy(t,n)}var o=n(167).Buffer;e.exports=function(){function e(){r(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return o.alloc(0);if(1===this.length)return this.head.data;for(var t=o.allocUnsafe(e>>>0),n=this.head,r=0;n;)i(n.data,t,r),r+=n.data.length,n=n.next;return t},e}()},function(e,t,n){e.exports=n(262).PassThrough},function(e,t,n){e.exports=n(262).Transform},function(e,t,n){e.exports=n(261)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(1119);t.default=function(e){var t=Object.keys(e);return function(){var n=arguments.length<=0||void 0===arguments[0]?i.default.Map():arguments[0],r=arguments[1];return n.withMutations(function(n){t.forEach(function(t){var i=e[t],a=n.get(t),s=i(a,r);(0,o.validateNextState)(s,t,r),n.set(t,s)})})}},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineReducers=void 0;var r=n(1116),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.combineReducers=i.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(7),o=r(i),a=n(483),s=r(a);t.default=function(e,t,n){var r=Object.keys(t);if(!r.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";var i=(0,s.default)(n);if(!o.default.Iterable.isIterable(e))return"The "+i+' is of unexpected type. Expected argument to be an instance of Immutable.Iterable with the following properties: "'+r.join('", "')+'".';var a=e.keySeq().toArray().filter(function(e){return!t.hasOwnProperty(e)});return a.length>0?"Unexpected "+(1===a.length?"property":"properties")+' "'+a.join('", "')+'" found in '+i+'. Expected to find one of the known reducer property names instead: "'+r.join('", "')+'". Unexpected properties will be ignored.':null},e.exports=t.default},function(e,t,n){"use strict";"create index";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.validateNextState=t.getUnexpectedInvocationParameterMessage=t.getStateName=void 0;var i=n(483),o=r(i),a=n(1118),s=r(a),u=n(1120),l=r(u);t.getStateName=o.default,t.getUnexpectedInvocationParameterMessage=s.default,t.validateNextState=l.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if(void 0===e)throw new Error('Reducer "'+t+'" returned undefined when handling "'+n.type+'" action. To ignore an action, you must explicitly return the previous state.');return null},e.exports=t.default},function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,r,a){var s=e(n,r,a),u=s.dispatch,l=[],c={getState:s.getState,dispatch:function(e){return u(e)}};return l=t.map(function(e){return e(c)}),u=i.a.apply(void 0,l)(s.dispatch),o({},s,{dispatch:u})}}}t.a=r;var i=n(484),o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){"use strict";function r(e,t){return function(){return t(e.apply(void 0,arguments))}}function i(e,t){if("function"==typeof e)return r(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(e),i={},o=0;o<n.length;o++){var a=n[o],s=e[a];"function"==typeof s&&(i[a]=r(s,t))}return i}t.a=i},function(e,t,n){"use strict";function r(e,t){var n=t&&t.type;return"Given action "+(n&&'"'+n.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function i(e){Object.keys(e).forEach(function(t){var n=e[t];if(void 0===n(void 0,{type:a.b.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+a.b.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}function o(e){for(var t=Object.keys(e),n={},o=0;o<t.length;o++){var a=t[o];"function"==typeof e[a]&&(n[a]=e[a])}var s=Object.keys(n),u=void 0;try{i(n)}catch(e){u=e}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(u)throw u;for(var i=!1,o={},a=0;a<s.length;a++){var l=s[a],c=n[l],p=e[l],f=c(p,t);if(void 0===f){var h=r(l,t);throw new Error(h)}o[l]=f,i=i||f!==p}return i?o:e}}t.a=o;var a=n(485);n(391),n(487)},function(e,t,n){var r=function(){return this}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,e.exports=n(1125),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(e){r.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";function n(e,t,n,r){var o=t&&t.prototype instanceof i?t:i,a=Object.create(o.prototype),s=new h(r||[]);return a._invoke=l(e,n,s),a}function r(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function i(){}function o(){}function a(){}function s(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function u(e){function t(n,i,o,a){var s=r(e[n],e,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&y.call(l,"__await")?Promise.resolve(l.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):Promise.resolve(l).then(function(e){u.value=e,o(u)},a)}a(s.arg)}function n(e,n){function r(){return new Promise(function(r,i){t(e,n,r,i)})}return i=i?i.then(r,r):r()}var i;this._invoke=n}function l(e,t,n){var i=S;return function(o,a){if(i===A)throw new Error("Generator is already running");if(i===D){if("throw"===o)throw a;return m()}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=c(s,n);if(u){if(u===O)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===S)throw i=D,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=A;var l=r(e,t,n);if("normal"===l.type){if(i=n.done?D:C,l.arg===O)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=D,n.method="throw",n.arg=l.arg)}}}function c(e,t){var n=e.iterator[t.method];if(n===v){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=v,c(e,t),"throw"===t.method))return O;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return O}var i=r(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,O;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=v),t.delegate=null,O):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,O)}function p(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function f(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function h(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(p,this),this.reset(!0)}function d(e){if(e){var t=e[b];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(y.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=v,t.done=!0,t};return r.next=r}}return{next:m}}function m(){return{value:v,done:!0}}var v,g=Object.prototype,y=g.hasOwnProperty,_="function"==typeof Symbol?Symbol:{},b=_.iterator||"@@iterator",x=_.asyncIterator||"@@asyncIterator",w=_.toStringTag||"@@toStringTag",k="object"==typeof e,E=t.regeneratorRuntime;if(E)return void(k&&(e.exports=E));E=t.regeneratorRuntime=k?e.exports:{},E.wrap=n;var S="suspendedStart",C="suspendedYield",A="executing",D="completed",O={},M={};M[b]=function(){return this};var T=Object.getPrototypeOf,P=T&&T(T(d([])));P&&P!==g&&y.call(P,b)&&(M=P);var I=a.prototype=i.prototype=Object.create(M);o.prototype=I.constructor=a,a.constructor=o,a[w]=o.displayName="GeneratorFunction",E.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===o||"GeneratorFunction"===(t.displayName||t.name))},E.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,w in e||(e[w]="GeneratorFunction")),e.prototype=Object.create(I),e},E.awrap=function(e){return{__await:e}},s(u.prototype),u.prototype[x]=function(){return this},E.AsyncIterator=u,E.async=function(e,t,r,i){var o=new u(n(e,t,r,i));return E.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},s(I),I[w]="Generator",I[b]=function(){return this},I.toString=function(){return"[object Generator]"},E.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},E.values=d,h.prototype={constructor:h,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=v,this.done=!1,this.delegate=null,this.method="next",this.arg=v,this.tryEntries.forEach(f),!e)for(var t in this)"t"===t.charAt(0)&&y.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=v)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){function t(t,r){return o.type="throw",o.arg=e,n.next=t,r&&(n.method="next",n.arg=v),!!r}if(this.done)throw e;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var a=y.call(i,"catchLoc"),s=y.call(i,"finallyLoc");if(a&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&y.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,O):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),O},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),f(n),O}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;f(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:d(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=v),O}}}(function(){return this}()||Function("return this")())},function(e,t,n){"use strict";e.exports=n(1133)},function(e,t,n){"use strict";var r={};["article","aside","button","blockquote","body","canvas","caption","col","colgroup","dd","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","li","map","object","ol","output","p","pre","progress","script","section","style","table","tbody","td","textarea","tfoot","th","tr","thead","ul","video"].forEach(function(e){r[e]=!0}),e.exports=r},function(e,t,n){"use strict";function r(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,e=e.replace(r,i),n):new RegExp(e,t)}}var i=/[a-zA-Z_:][a-zA-Z0-9:._-]*/,o=/[^"'=<>`\x00-\x20]+/,a=/'[^']*'/,s=/"[^"]*"/,u=r(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",o)("single_quoted",a)("double_quoted",s)(),l=r(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",i)("attr_value",u)(),c=r(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute",l)(),p=/<\/[A-Za-z][A-Za-z0-9]*\s*>/,f=/<!--([^-]+|[-][^-]+)*-->/,h=/<[?].*?[?]>/,d=/<![A-Z]+\s+[^>]*>/,m=/<!\[CDATA\[([^\]]+|\][^\]]|\]\][^>])*\]\]>/,v=r(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",c)("close_tag",p)("comment",f)("processing",h)("declaration",d)("cdata",m)();e.exports.HTML_TAG_RE=v},function(e,t,n){"use strict";e.exports=["coap","doi","javascript","aaa","aaas","about","acap","cap","cid","crid","data","dav","dict","dns","file","ftp","geo","go","gopher","h323","http","https","iax","icap","im","imap","info","ipp","iris","iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid","msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp","opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve","sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet","tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon","xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s","adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin","bolo","callto","chrome","chrome-extension","com-eventbrite-attendee","content","cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb","ed2k","facetime","feed","finger","fish","gg","git","gizmoproject","gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms","keyparc","lastfm","ldaps","magnet","maps","market","message","mms","ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi","platform","proxy","psyc","query","res","resource","rmi","rsync","rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify","ssh","steam","svn","teamspeak","things","udp","unreal","ut2004","ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri","ymsgr"]},function(e,t,n){"use strict";e.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","abbr2"]},block:{rules:["blockquote","code","fences","heading","hr","htmlblock","lheading","list","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","htmltag","links","newline","text"]}}}},function(e,t,n){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","replacements","linkify","smartquotes","references","abbr2","footnote_tail"]},block:{rules:["blockquote","code","fences","footnote","heading","hr","htmlblock","lheading","list","paragraph","table"]},inline:{rules:["autolink","backticks","del","emphasis","entity","escape","footnote_ref","htmltag","links","newline","text"]}}}},function(e,t,n){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}}},function(e,t,n){"use strict";function r(e,t,n){this.src=t,this.env=n,this.options=e.options,this.tokens=[],this.inlineMode=!1,this.inline=e.inline,this.block=e.block,this.renderer=e.renderer,this.typographer=e.typographer}function i(e,t){"string"!=typeof e&&(t=e,e="default"),this.inline=new l,this.block=new u,this.core=new s,this.renderer=new a,this.ruler=new c,this.options={},this.configure(p[e]),this.set(t||{})}var o=n(26).assign,a=n(1137),s=n(1135),u=n(1134),l=n(1136),c=n(166),p={default:n(1131),full:n(1132),commonmark:n(1130)};i.prototype.set=function(e){o(this.options,e)},i.prototype.configure=function(e){var t=this;if(!e)throw new Error("Wrong `remarkable` preset, check name/content");e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enable(e.components[n].rules,!0)})},i.prototype.use=function(e,t){return e(this,t),this},i.prototype.parse=function(e,t){var n=new r(this,e,t);return this.core.process(n),n.tokens},i.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},i.prototype.parseInline=function(e,t){var n=new r(this,e,t);return n.inlineMode=!0,this.core.process(n),n.tokens},i.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},e.exports=i,e.exports.utils=n(26)},function(e,t,n){"use strict";function r(){this.ruler=new i;for(var e=0;e<a.length;e++)this.ruler.push(a[e][0],a[e][1],{alt:(a[e][2]||[]).slice()})}var i=n(166),o=n(1150),a=[["code",n(1140)],["fences",n(1142),["paragraph","blockquote","list"]],["blockquote",n(1139),["paragraph","blockquote","list"]],["hr",n(1145),["paragraph","blockquote","list"]],["list",n(1148),["paragraph","blockquote"]],["footnote",n(1143),["paragraph"]],["heading",n(1144),["paragraph","blockquote"]],["lheading",n(1147)],["htmlblock",n(1146),["paragraph","blockquote"]],["table",n(1151),["paragraph"]],["deflist",n(1141),["paragraph"]],["paragraph",n(1149)]];r.prototype.tokenize=function(e,t,n){for(var r,i=this.ruler.getRules(""),o=i.length,a=t,s=!1;a<n&&(e.line=a=e.skipEmptyLines(a),!(a>=n))&&!(e.tShift[a]<e.blkIndent);){for(r=0;r<o&&!i[r](e,a,n,!1);r++);if(e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),(a=e.line)<n&&e.isEmpty(a)){if(s=!0,++a<n&&"list"===e.parentType&&e.isEmpty(a))break;e.line=a}}};var s=/[\n\t]/g,u=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,l=/\u00a0/g;r.prototype.parse=function(e,t,n,r){var i,a=0,c=0;if(!e)return[];e=e.replace(l," "),e=e.replace(u,"\n"),e.indexOf("\t")>=0&&(e=e.replace(s,function(t,n){var r;return 10===e.charCodeAt(n)?(a=n+1,c=0,t):(r=" ".slice((n-a-c)%4),c=n-a+1,r)})),i=new o(e,this,t,n,r),this.tokenize(i,i.line,i.lineMax)},e.exports=r},function(e,t,n){"use strict";function r(){this.options={},this.ruler=new i;for(var e=0;e<o.length;e++)this.ruler.push(o[e][0],o[e][1])}var i=n(166),o=[["block",n(1154)],["abbr",n(1152)],["references",n(1158)],["inline",n(1156)],["footnote_tail",n(1155)],["abbr2",n(1153)],["replacements",n(1159)],["smartquotes",n(1160)],["linkify",n(1157)]];r.prototype.process=function(e){var t,n,r;for(r=this.ruler.getRules(""),t=0,n=r.length;t<n;t++)r[t](e)},e.exports=r},function(e,t,n){"use strict";function r(){this.ruler=new o;for(var e=0;e<u.length;e++)this.ruler.push(u[e][0],u[e][1]);this.validateLink=i}function i(e){var t=["vbscript","javascript","file","data"],n=e.trim().toLowerCase();return n=s.replaceEntities(n),-1===n.indexOf(":")||-1===t.indexOf(n.split(":")[0])}var o=n(166),a=n(263),s=n(26),u=[["text",n(1176)],["newline",n(1173)],["escape",n(1166)],["backticks",n(1162)],["del",n(1163)],["ins",n(1170)],["mark",n(1172)],["emphasis",n(1164)],["sub",n(1174)],["sup",n(1175)],["links",n(1171)],["footnote_inline",n(1167)],["footnote_ref",n(1168)],["autolink",n(1161)],["htmltag",n(1169)],["entity",n(1165)]];r.prototype.skipToken=function(e){var t,n,r=this.ruler.getRules(""),i=r.length,o=e.pos;if((n=e.cacheGet(o))>0)return void(e.pos=n);for(t=0;t<i;t++)if(r[t](e,!0))return void e.cacheSet(o,e.pos);e.pos++,e.cacheSet(o,e.pos)},r.prototype.tokenize=function(e){for(var t,n,r=this.ruler.getRules(""),i=r.length,o=e.posMax;e.pos<o;){for(n=0;n<i&&!(t=r[n](e,!1));n++);if(t){if(e.pos>=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},r.prototype.parse=function(e,t,n,r){var i=new a(e,this,t,n,r);this.tokenize(i)},e.exports=r},function(e,t,n){"use strict";function r(){this.rules=i.assign({},o),this.getBreak=o.getBreak}var i=n(26),o=n(1138);e.exports=r,r.prototype.renderInline=function(e,t,n){for(var r=this.rules,i=e.length,o=0,a="";i--;)a+=r[e[o].type](e,o++,t,n,this);return a},r.prototype.render=function(e,t,n){for(var r=this.rules,i=e.length,o=-1,a="";++o<i;)"inline"===e[o].type?a+=this.renderInline(e[o].children,t,n):a+=r[e[o].type](e,o,t,n,this);return a}},function(e,t,n){"use strict";function r(e,t){return++t>=e.length-2?t:"paragraph_open"===e[t].type&&e[t].tight&&"inline"===e[t+1].type&&0===e[t+1].content.length&&"paragraph_close"===e[t+2].type&&e[t+2].tight?r(e,t+2):t}var i=n(26).has,o=n(26).unescapeMd,a=n(26).replaceEntities,s=n(26).escapeHtml,u={};u.blockquote_open=function(){return"<blockquote>\n"},u.blockquote_close=function(e,t){return"</blockquote>"+l(e,t)},u.code=function(e,t){return e[t].block?"<pre><code>"+s(e[t].content)+"</code></pre>"+l(e,t):"<code>"+s(e[t].content)+"</code>"},u.fence=function(e,t,n,r,u){var c,p,f,h=e[t],d="",m=n.langPrefix,v="";if(h.params){if(c=h.params.split(/\s+/g),p=c.join(" "),i(u.rules.fence_custom,c[0]))return u.rules.fence_custom[c[0]](e,t,n,r,u);v=s(a(o(p))),d=' class="'+m+v+'"'}return f=n.highlight?n.highlight.apply(n.highlight,[h.content].concat(c))||s(h.content):s(h.content),"<pre><code"+d+">"+f+"</code></pre>"+l(e,t)},u.fence_custom={},u.heading_open=function(e,t){return"<h"+e[t].hLevel+">"},u.heading_close=function(e,t){return"</h"+e[t].hLevel+">\n"},u.hr=function(e,t,n){return(n.xhtmlOut?"<hr />":"<hr>")+l(e,t)},u.bullet_list_open=function(){return"<ul>\n"},u.bullet_list_close=function(e,t){return"</ul>"+l(e,t)},u.list_item_open=function(){return"<li>"},u.list_item_close=function(){return"</li>\n"},u.ordered_list_open=function(e,t){var n=e[t];return"<ol"+(n.order>1?' start="'+n.order+'"':"")+">\n"},u.ordered_list_close=function(e,t){return"</ol>"+l(e,t)},u.paragraph_open=function(e,t){return e[t].tight?"":"<p>"},u.paragraph_close=function(e,t){var n=!(e[t].tight&&t&&"inline"===e[t-1].type&&!e[t-1].content);return(e[t].tight?"":"</p>")+(n?l(e,t):"")},u.link_open=function(e,t,n){var r=e[t].title?' title="'+s(a(e[t].title))+'"':"",i=n.linkTarget?' target="'+n.linkTarget+'"':"";return'<a href="'+s(e[t].href)+'"'+r+i+">"},u.link_close=function(){return"</a>"},u.image=function(e,t,n){var r=' src="'+s(e[t].src)+'"',i=e[t].title?' title="'+s(a(e[t].title))+'"':"";return"<img"+r+' alt="'+(e[t].alt?s(a(o(e[t].alt))):"")+'"'+i+(n.xhtmlOut?" /":"")+">"},u.table_open=function(){return"<table>\n"},u.table_close=function(){return"</table>\n"},u.thead_open=function(){return"<thead>\n"},u.thead_close=function(){return"</thead>\n"},u.tbody_open=function(){return"<tbody>\n"},u.tbody_close=function(){return"</tbody>\n"},u.tr_open=function(){return"<tr>"},u.tr_close=function(){return"</tr>\n"},u.th_open=function(e,t){var n=e[t];return"<th"+(n.align?' style="text-align:'+n.align+'"':"")+">"},u.th_close=function(){return"</th>"},u.td_open=function(e,t){var n=e[t];return"<td"+(n.align?' style="text-align:'+n.align+'"':"")+">"},u.td_close=function(){return"</td>"},u.strong_open=function(){return"<strong>"},u.strong_close=function(){return"</strong>"},u.em_open=function(){return"<em>"},u.em_close=function(){return"</em>"},u.del_open=function(){return"<del>"},u.del_close=function(){return"</del>"},u.ins_open=function(){return"<ins>"},u.ins_close=function(){return"</ins>"},u.mark_open=function(){return"<mark>"},u.mark_close=function(){return"</mark>"},u.sub=function(e,t){return"<sub>"+s(e[t].content)+"</sub>"},u.sup=function(e,t){return"<sup>"+s(e[t].content)+"</sup>"},u.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},u.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},u.text=function(e,t){return s(e[t].content)},u.htmlblock=function(e,t){return e[t].content},u.htmltag=function(e,t){return e[t].content},u.abbr_open=function(e,t){return'<abbr title="'+s(a(e[t].title))+'">'},u.abbr_close=function(){return"</abbr>"},u.footnote_ref=function(e,t){var n=Number(e[t].id+1).toString(),r="fnref"+n;return e[t].subId>0&&(r+=":"+e[t].subId),'<sup class="footnote-ref"><a href="#fn'+n+'" id="'+r+'">['+n+"]</a></sup>"},u.footnote_block_open=function(e,t,n){return(n.xhtmlOut?'<hr class="footnotes-sep" />\n':'<hr class="footnotes-sep">\n')+'<section class="footnotes">\n<ol class="footnotes-list">\n'},u.footnote_block_close=function(){return"</ol>\n</section>\n"},u.footnote_open=function(e,t){return'<li id="fn'+Number(e[t].id+1).toString()+'" class="footnote-item">'},u.footnote_close=function(){return"</li>\n"},u.footnote_anchor=function(e,t){var n=Number(e[t].id+1).toString(),r="fnref"+n;return e[t].subId>0&&(r+=":"+e[t].subId),' <a href="#'+r+'" class="footnote-backref">↩</a>'},u.dl_open=function(){return"<dl>\n"},u.dt_open=function(){return"<dt>"},u.dd_open=function(){return"<dd>"},u.dl_close=function(){return"</dl>\n"},u.dt_close=function(){return"</dt>\n"},u.dd_close=function(){return"</dd>\n"};var l=u.getBreak=function(e,t){return t=r(e,t),t<e.length&&"list_item_close"===e[t].type?"":"\n"};e.exports=u},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var i,o,a,s,u,l,c,p,f,h,d,m=e.bMarks[t]+e.tShift[t],v=e.eMarks[t];if(m>v)return!1;if(62!==e.src.charCodeAt(m++))return!1;if(e.level>=e.options.maxNesting)return!1;if(r)return!0;for(32===e.src.charCodeAt(m)&&m++,u=e.blkIndent,e.blkIndent=0,s=[e.bMarks[t]],e.bMarks[t]=m,m=m<v?e.skipSpaces(m):m,o=m>=v,a=[e.tShift[t]],e.tShift[t]=m-e.bMarks[t],p=e.parser.ruler.getRules("blockquote"),i=t+1;i<n&&(m=e.bMarks[i]+e.tShift[i],v=e.eMarks[i],!(m>=v));i++)if(62!==e.src.charCodeAt(m++)){if(o)break;for(d=!1,f=0,h=p.length;f<h;f++)if(p[f](e,i,n,!0)){d=!0;break}if(d)break;s.push(e.bMarks[i]),a.push(e.tShift[i]),e.tShift[i]=-1337}else 32===e.src.charCodeAt(m)&&m++,s.push(e.bMarks[i]),e.bMarks[i]=m,m=m<v?e.skipSpaces(m):m,o=m>=v,a.push(e.tShift[i]),e.tShift[i]=m-e.bMarks[i];for(l=e.parentType,e.parentType="blockquote",e.tokens.push({type:"blockquote_open",lines:c=[t,0],level:e.level++}),e.parser.tokenize(e,t,i),e.tokens.push({type:"blockquote_close",level:--e.level}),e.parentType=l,c[1]=e.line,f=0;f<a.length;f++)e.bMarks[f+t]=s[f],e.tShift[f+t]=a[f];return e.blkIndent=u,!0}},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,i;if(e.tShift[t]-e.blkIndent<4)return!1;for(i=r=t+1;r<n;)if(e.isEmpty(r))r++;else{if(!(e.tShift[r]-e.blkIndent>=4))break;r++,i=r}return e.line=r,e.tokens.push({type:"code",content:e.getLines(t,i,4+e.blkIndent,!0),block:!0,lines:[t,e.line],level:e.level}),!0}},function(e,t,n){"use strict";function r(e,t){var n,r,i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return i>=o?-1:126!==(r=e.src.charCodeAt(i++))&&58!==r?-1:(n=e.skipSpaces(i),i===n?-1:n>=o?-1:n)}function i(e,t){var n,r,i=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===i&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}e.exports=function(e,t,n,o){var a,s,u,l,c,p,f,h,d,m,v,g,y,_;if(o)return!(e.ddIndent<0)&&r(e,t)>=0;if(f=t+1,e.isEmpty(f)&&++f>n)return!1;if(e.tShift[f]<e.blkIndent)return!1;if((a=r(e,f))<0)return!1;if(e.level>=e.options.maxNesting)return!1;p=e.tokens.length,e.tokens.push({type:"dl_open",lines:c=[t,0],level:e.level++}),u=t,s=f;e:for(;;){for(_=!0,y=!1,e.tokens.push({type:"dt_open",lines:[u,u],level:e.level++}),e.tokens.push({type:"inline",content:e.getLines(u,u+1,e.blkIndent,!1).trim(),level:e.level+1,lines:[u,u],children:[]}),e.tokens.push({type:"dt_close",level:--e.level});;){if(e.tokens.push({type:"dd_open",lines:l=[f,0],level:e.level++}),g=e.tight,d=e.ddIndent,h=e.blkIndent,v=e.tShift[s],m=e.parentType,e.blkIndent=e.ddIndent=e.tShift[s]+2,e.tShift[s]=a-e.bMarks[s],e.tight=!0,e.parentType="deflist",e.parser.tokenize(e,s,n,!0),e.tight&&!y||(_=!1),y=e.line-s>1&&e.isEmpty(e.line-1),e.tShift[s]=v,e.tight=g,e.parentType=m,e.blkIndent=h,e.ddIndent=d,e.tokens.push({type:"dd_close",level:--e.level}),l[1]=f=e.line,f>=n)break e;if(e.tShift[f]<e.blkIndent)break e;if((a=r(e,f))<0)break;s=f}if(f>=n)break;if(u=f,e.isEmpty(u))break;if(e.tShift[u]<e.blkIndent)break;if((s=u+1)>=n)break;if(e.isEmpty(s)&&s++,s>=n)break;if(e.tShift[s]<e.blkIndent)break;if((a=r(e,s))<0)break}return e.tokens.push({type:"dl_close",level:--e.level}),c[1]=f,e.line=f,_&&i(e,p),!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var i,o,a,s,u,l=!1,c=e.bMarks[t]+e.tShift[t],p=e.eMarks[t];if(c+3>p)return!1;if(126!==(i=e.src.charCodeAt(c))&&96!==i)return!1;if(u=c,c=e.skipChars(c,i),(o=c-u)<3)return!1;if(a=e.src.slice(c,p).trim(),a.indexOf("`")>=0)return!1;if(r)return!0;for(s=t;!(++s>=n)&&(c=u=e.bMarks[s]+e.tShift[s],p=e.eMarks[s],!(c<p&&e.tShift[s]<e.blkIndent));)if(e.src.charCodeAt(c)===i&&!(e.tShift[s]-e.blkIndent>=4||(c=e.skipChars(c,i))-u<o||(c=e.skipSpaces(c))<p)){l=!0;break}return o=e.tShift[t],e.line=s+(l?1:0),e.tokens.push({type:"fence",params:a,content:e.getLines(t+1,s,o,!0),lines:[t,e.line],level:e.level}),!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var i,o,a,s,u,l=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(l+4>c)return!1;if(91!==e.src.charCodeAt(l))return!1;if(94!==e.src.charCodeAt(l+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(s=l+2;s<c;s++){if(32===e.src.charCodeAt(s))return!1;if(93===e.src.charCodeAt(s))break}return s!==l+2&&(!(s+1>=c||58!==e.src.charCodeAt(++s))&&(!!r||(s++,e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.refs||(e.env.footnotes.refs={}),u=e.src.slice(l+2,s-2),e.env.footnotes.refs[":"+u]=-1,e.tokens.push({type:"footnote_reference_open",label:u,level:e.level++}),i=e.bMarks[t],o=e.tShift[t],a=e.parentType,e.tShift[t]=e.skipSpaces(s)-s,e.bMarks[t]=s,e.blkIndent+=4,e.parentType="footnote",e.tShift[t]<e.blkIndent&&(e.tShift[t]+=e.blkIndent,e.bMarks[t]-=e.blkIndent),e.parser.tokenize(e,t,n,!0),e.parentType=a,e.blkIndent-=4,e.tShift[t]=o,e.bMarks[t]=i,e.tokens.push({type:"footnote_reference_close",level:--e.level}),!0)))}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var i,o,a,s=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(s>=u)return!1;if(35!==(i=e.src.charCodeAt(s))||s>=u)return!1;for(o=1,i=e.src.charCodeAt(++s);35===i&&s<u&&o<=6;)o++,i=e.src.charCodeAt(++s);return!(o>6||s<u&&32!==i)&&(!!r||(u=e.skipCharsBack(u,32,s),a=e.skipCharsBack(u,35,s),a>s&&32===e.src.charCodeAt(a-1)&&(u=a),e.line=t+1,e.tokens.push({type:"heading_open",hLevel:o,lines:[t,e.line],level:e.level}),s<u&&e.tokens.push({type:"inline",content:e.src.slice(s,u).trim(),level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"heading_close",hLevel:o,level:e.level}),!0))}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var i,o,a,s=e.bMarks[t],u=e.eMarks[t];if((s+=e.tShift[t])>u)return!1;if(42!==(i=e.src.charCodeAt(s++))&&45!==i&&95!==i)return!1;for(o=1;s<u;){if((a=e.src.charCodeAt(s++))!==i&&32!==a)return!1;a===i&&o++}return!(o<3)&&(!!r||(e.line=t+1,e.tokens.push({type:"hr",lines:[t,e.line],level:e.level}),!0))}},function(e,t,n){"use strict";function r(e){var t=32|e;return t>=97&&t<=122}var i=n(1127),o=/^<([a-zA-Z]{1,15})[\s\/>]/,a=/^<\/([a-zA-Z]{1,15})[\s>]/;e.exports=function(e,t,n,s){var u,l,c,p=e.bMarks[t],f=e.eMarks[t],h=e.tShift[t];if(p+=h,!e.options.html)return!1;if(h>3||p+2>=f)return!1;if(60!==e.src.charCodeAt(p))return!1;if(33===(u=e.src.charCodeAt(p+1))||63===u){if(s)return!0}else{if(47!==u&&!r(u))return!1;if(47===u){if(!(l=e.src.slice(p,f).match(a)))return!1}else if(!(l=e.src.slice(p,f).match(o)))return!1;if(!0!==i[l[1].toLowerCase()])return!1;if(s)return!0}for(c=t+1;c<e.lineMax&&!e.isEmpty(c);)c++;return e.line=c,e.tokens.push({type:"htmlblock",level:e.level,lines:[t,e.line],content:e.getLines(t,c,0,!0)}),!0}},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,i,o,a=t+1;return!(a>=n)&&(!(e.tShift[a]<e.blkIndent)&&(!(e.tShift[a]-e.blkIndent>3)&&(i=e.bMarks[a]+e.tShift[a],o=e.eMarks[a],!(i>=o)&&((45===(r=e.src.charCodeAt(i))||61===r)&&(i=e.skipChars(i,r),!((i=e.skipSpaces(i))<o)&&(i=e.bMarks[t]+e.tShift[t],e.line=a+1,e.tokens.push({type:"heading_open",hLevel:61===r?1:2,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:e.src.slice(i,e.eMarks[t]).trim(),level:e.level+1,lines:[t,e.line-1],children:[]}),e.tokens.push({type:"heading_close",hLevel:61===r?1:2,level:e.level}),!0))))))}},function(e,t,n){"use strict";function r(e,t){var n,r,i;return r=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],r>=i?-1:(n=e.src.charCodeAt(r++),42!==n&&45!==n&&43!==n?-1:r<i&&32!==e.src.charCodeAt(r)?-1:r)}function i(e,t){var n,r=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(r+1>=i)return-1;if((n=e.src.charCodeAt(r++))<48||n>57)return-1;for(;;){if(r>=i)return-1;if(!((n=e.src.charCodeAt(r++))>=48&&n<=57)){if(41===n||46===n)break;return-1}}return r<i&&32!==e.src.charCodeAt(r)?-1:r}function o(e,t){var n,r,i=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===i&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}e.exports=function(e,t,n,a){var s,u,l,c,p,f,h,d,m,v,g,y,_,b,x,w,k,E,S,C,A,D,O=!0;if((d=i(e,t))>=0)_=!0;else{if(!((d=r(e,t))>=0))return!1;_=!1}if(e.level>=e.options.maxNesting)return!1;if(y=e.src.charCodeAt(d-1),a)return!0;for(x=e.tokens.length,_?(h=e.bMarks[t]+e.tShift[t],g=Number(e.src.substr(h,d-h-1)),e.tokens.push({type:"ordered_list_open",order:g,lines:k=[t,0],level:e.level++})):e.tokens.push({type:"bullet_list_open",lines:k=[t,0],level:e.level++}),s=t,w=!1,S=e.parser.ruler.getRules("list");!(!(s<n)||(b=e.skipSpaces(d),m=e.eMarks[s],v=b>=m?1:b-d,v>4&&(v=1),v<1&&(v=1),u=d-e.bMarks[s]+v,e.tokens.push({type:"list_item_open",lines:E=[t,0],level:e.level++}),c=e.blkIndent,p=e.tight,l=e.tShift[t],f=e.parentType,e.tShift[t]=b-e.bMarks[t],e.blkIndent=u,e.tight=!0,e.parentType="list",e.parser.tokenize(e,t,n,!0),e.tight&&!w||(O=!1),w=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=c,e.tShift[t]=l,e.tight=p,e.parentType=f,e.tokens.push({type:"list_item_close",level:--e.level}),s=t=e.line,E[1]=s,b=e.bMarks[t],s>=n)||e.isEmpty(s)||e.tShift[s]<e.blkIndent);){for(D=!1,C=0,A=S.length;C<A;C++)if(S[C](e,s,n,!0)){D=!0;break}if(D)break;if(_){if((d=i(e,s))<0)break}else if((d=r(e,s))<0)break;if(y!==e.src.charCodeAt(d-1))break}return e.tokens.push({type:_?"ordered_list_close":"bullet_list_close",level:--e.level}),k[1]=s,e.line=s,O&&o(e,x),!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o,a,s,u=t+1;if(n=e.lineMax,u<n&&!e.isEmpty(u))for(s=e.parser.ruler.getRules("paragraph");u<n&&!e.isEmpty(u);u++)if(!(e.tShift[u]-e.blkIndent>3)){for(i=!1,o=0,a=s.length;o<a;o++)if(s[o](e,u,n,!0)){i=!0;break}if(i)break}return r=e.getLines(t,u,e.blkIndent,!1).trim(),e.line=u,r.length&&(e.tokens.push({type:"paragraph_open",tight:!1,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:r,level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"paragraph_close",tight:!1,level:e.level})),!0}},function(e,t,n){"use strict";function r(e,t,n,r,i){var o,a,s,u,l,c,p;for(this.src=e,this.parser=t,this.options=n,this.env=r,this.tokens=i,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",a=this.src,c=0,p=!1,s=u=c=0,l=a.length;u<l;u++){if(o=a.charCodeAt(u),!p){if(32===o){c++;continue}p=!0}10!==o&&u!==l-1||(10!==o&&u++,this.bMarks.push(s),this.eMarks.push(u),this.tShift.push(c),p=!1,c=0,s=u+1)}this.bMarks.push(a.length),this.eMarks.push(a.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}r.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},r.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},r.prototype.skipSpaces=function(e){for(var t=this.src.length;e<t&&32===this.src.charCodeAt(e);e++);return e},r.prototype.skipChars=function(e,t){for(var n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},r.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},r.prototype.getLines=function(e,t,n,r){var i,o,a,s,u,l=e;if(e>=t)return"";if(l+1===t)return o=this.bMarks[l]+Math.min(this.tShift[l],n),a=r?this.eMarks[l]+1:this.eMarks[l],this.src.slice(o,a);for(s=new Array(t-e),i=0;l<t;l++,i++)u=this.tShift[l],u>n&&(u=n),u<0&&(u=0),o=this.bMarks[l]+u,a=l+1<t||r?this.eMarks[l]+1:this.eMarks[l],s[i]=this.src.slice(o,a);return s.join("")},e.exports=r},function(e,t,n){"use strict";function r(e,t){var n=e.bMarks[t]+e.blkIndent,r=e.eMarks[t];return e.src.substr(n,r-n)}e.exports=function(e,t,n,i){var o,a,s,u,l,c,p,f,h,d,m;if(t+2>n)return!1;if(l=t+1,e.tShift[l]<e.blkIndent)return!1;if((s=e.bMarks[l]+e.tShift[l])>=e.eMarks[l])return!1;if(124!==(o=e.src.charCodeAt(s))&&45!==o&&58!==o)return!1;if(a=r(e,t+1),!/^[-:| ]+$/.test(a))return!1;if((c=a.split("|"))<=2)return!1;for(f=[],u=0;u<c.length;u++){if(!(h=c[u].trim())){if(0===u||u===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(h))return!1;58===h.charCodeAt(h.length-1)?f.push(58===h.charCodeAt(0)?"center":"right"):58===h.charCodeAt(0)?f.push("left"):f.push("")}if(a=r(e,t).trim(),-1===a.indexOf("|"))return!1;if(c=a.replace(/^\||\|$/g,"").split("|"),f.length!==c.length)return!1;if(i)return!0;for(e.tokens.push({type:"table_open",lines:d=[t,0],level:e.level++}),e.tokens.push({type:"thead_open",lines:[t,t+1],level:e.level++}),e.tokens.push({type:"tr_open",lines:[t,t+1],level:e.level++}),u=0;u<c.length;u++)e.tokens.push({type:"th_open",align:f[u],lines:[t,t+1],level:e.level++}),e.tokens.push({type:"inline",content:c[u].trim(),lines:[t,t+1],level:e.level,children:[]}),e.tokens.push({type:"th_close",level:--e.level});for(e.tokens.push({type:"tr_close",level:--e.level}),e.tokens.push({type:"thead_close",level:--e.level}),e.tokens.push({type:"tbody_open",lines:m=[t+2,0],level:e.level++}),l=t+2;l<n&&!(e.tShift[l]<e.blkIndent)&&(a=r(e,l).trim(),-1!==a.indexOf("|"));l++){for(c=a.replace(/^\||\|$/g,"").split("|"),e.tokens.push({type:"tr_open",level:e.level++}),u=0;u<c.length;u++)e.tokens.push({type:"td_open",align:f[u],level:e.level++}),p=c[u].substring(124===c[u].charCodeAt(0)?1:0,124===c[u].charCodeAt(c[u].length-1)?c[u].length-1:c[u].length).trim(),e.tokens.push({type:"inline",content:p,level:e.level,children:[]}),e.tokens.push({type:"td_close",level:--e.level});e.tokens.push({type:"tr_close",level:--e.level})}return e.tokens.push({type:"tbody_close",level:--e.level}),e.tokens.push({type:"table_close",level:--e.level}),d[1]=m[1]=l,e.line=l,!0}},function(e,t,n){"use strict";function r(e,t,n,r){var a,s,u,l,c,p;if(42!==e.charCodeAt(0))return-1;if(91!==e.charCodeAt(1))return-1;if(-1===e.indexOf("]:"))return-1;if(a=new i(e,t,n,r,[]),(s=o(a,1))<0||58!==e.charCodeAt(s+1))return-1;for(l=a.posMax,u=s+2;u<l&&10!==a.src.charCodeAt(u);u++);return c=e.slice(2,s),p=e.slice(s+2,u).trim(),0===p.length?-1:(r.abbreviations||(r.abbreviations={}),void 0===r.abbreviations[":"+c]&&(r.abbreviations[":"+c]=p),u)}var i=n(263),o=n(165);e.exports=function(e){var t,n,i,o,a=e.tokens;if(!e.inlineMode)for(t=1,n=a.length-1;t<n;t++)if("paragraph_open"===a[t-1].type&&"inline"===a[t].type&&"paragraph_close"===a[t+1].type){for(i=a[t].content;i.length&&!((o=r(i,e.inline,e.options,e.env))<0);)i=i.slice(o).trim();a[t].content=i,i.length||(a[t-1].tight=!0,a[t+1].tight=!0)}}},function(e,t,n){"use strict";function r(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1")}var i=" \n()[]'\".,!?-";e.exports=function(e){var t,n,o,a,s,u,l,c,p,f,h,d,m=e.tokens;if(e.env.abbreviations)for(e.env.abbrRegExp||(d="(^|["+i.split("").map(r).join("")+"])("+Object.keys(e.env.abbreviations).map(function(e){return e.substr(1)}).sort(function(e,t){return t.length-e.length}).map(r).join("|")+")($|["+i.split("").map(r).join("")+"])",e.env.abbrRegExp=new RegExp(d,"g")),f=e.env.abbrRegExp,n=0,o=m.length;n<o;n++)if("inline"===m[n].type)for(a=m[n].children,t=a.length-1;t>=0;t--)if(s=a[t],"text"===s.type){for(c=0,u=s.content,f.lastIndex=0,p=s.level,l=[];h=f.exec(u);)f.lastIndex>c&&l.push({type:"text",content:u.slice(c,h.index+h[1].length),level:p}),l.push({type:"abbr_open",title:e.env.abbreviations[":"+h[2]],level:p++}),l.push({type:"text",content:h[2],level:p}),l.push({type:"abbr_close",level:--p}),c=f.lastIndex-h[3].length;l.length&&(c<u.length&&l.push({type:"text",content:u.slice(c),level:p}),m[n].children=a=[].concat(a.slice(0,t),l,a.slice(t+1)))}}},function(e,t,n){"use strict";e.exports=function(e){e.inlineMode?e.tokens.push({type:"inline",content:e.src.replace(/\n/g," ").trim(),level:0,lines:[0,1],children:[]}):e.block.parse(e.src,e.options,e.env,e.tokens)}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r,i,o,a,s,u,l,c=0,p=!1,f={};if(e.env.footnotes&&(e.tokens=e.tokens.filter(function(e){return"footnote_reference_open"===e.type?(p=!0,u=[],l=e.label,!1):"footnote_reference_close"===e.type?(p=!1,f[":"+l]=u,!1):(p&&u.push(e),!p)}),e.env.footnotes.list)){for(a=e.env.footnotes.list,e.tokens.push({type:"footnote_block_open",level:c++}),t=0,n=a.length;t<n;t++){for(e.tokens.push({type:"footnote_open",id:t,level:c++}),a[t].tokens?(s=[],s.push({type:"paragraph_open",tight:!1,level:c++}),s.push({type:"inline",content:"",level:c,children:a[t].tokens}),s.push({type:"paragraph_close",tight:!1,level:--c})):a[t].label&&(s=f[":"+a[t].label]),e.tokens=e.tokens.concat(s),o="paragraph_close"===e.tokens[e.tokens.length-1].type?e.tokens.pop():null,i=a[t].count>0?a[t].count:1,r=0;r<i;r++)e.tokens.push({type:"footnote_anchor",id:t,subId:r,level:c});o&&e.tokens.push(o),e.tokens.push({type:"footnote_close",level:--c})}e.tokens.push({type:"footnote_block_close",level:--c})}}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r,i=e.tokens;for(n=0,r=i.length;n<r;n++)t=i[n],"inline"===t.type&&e.inline.parse(t.content,e.options,e.env,t.children)}},function(e,t,n){"use strict";function r(e){return/^<a[>\s]/i.test(e)}function i(e){return/^<\/a\s*>/i.test(e)}function o(){var e=[],t=new a({stripPrefix:!1,url:!0,email:!0,twitter:!1,replaceFn:function(t,n){switch(n.getType()){case"url":e.push({text:n.matchedText,url:n.getUrl()});break;case"email":e.push({text:n.matchedText,url:"mailto:"+n.getEmail().replace(/^mailto:/i,"")})}return!1}});return{links:e,autolinker:t}}var a=n(508),s=/www|@|\:\/\//;e.exports=function(e){var t,n,a,u,l,c,p,f,h,d,m,v,g,y=e.tokens,_=null;if(e.options.linkify)for(n=0,a=y.length;n<a;n++)if("inline"===y[n].type)for(u=y[n].children,m=0,t=u.length-1;t>=0;t--)if(l=u[t],"link_close"!==l.type){if("htmltag"===l.type&&(r(l.content)&&m>0&&m--,i(l.content)&&m++),!(m>0)&&"text"===l.type&&s.test(l.content)){if(_||(_=o(),v=_.links,g=_.autolinker),c=l.content,v.length=0,g.link(c),!v.length)continue;for(p=[],d=l.level,f=0;f<v.length;f++)e.inline.validateLink(v[f].url)&&(h=c.indexOf(v[f].text),h&&(d=d,p.push({type:"text",content:c.slice(0,h),level:d})),p.push({type:"link_open",href:v[f].url,title:"",level:d++}),p.push({type:"text",content:v[f].text,level:d}),p.push({type:"link_close",level:--d}),c=c.slice(h+v[f].text.length));c.length&&p.push({type:"text",content:c,level:d}),y[n].children=u=[].concat(u.slice(0,t),p,u.slice(t+1))}}else for(t--;u[t].level!==l.level&&"link_open"!==u[t].type;)t--}},function(e,t,n){"use strict";function r(e,t,n,r){var l,c,p,f,h,d,m,v,g;if(91!==e.charCodeAt(0))return-1;if(-1===e.indexOf("]:"))return-1;if(l=new i(e,t,n,r,[]),(c=o(l,0))<0||58!==e.charCodeAt(c+1))return-1;for(f=l.posMax,p=c+2;p<f&&(32===(h=l.src.charCodeAt(p))||10===h);p++);if(!a(l,p))return-1;for(m=l.linkContent,p=l.pos,d=p,p+=1;p<f&&(32===(h=l.src.charCodeAt(p))||10===h);p++);for(p<f&&d!==p&&s(l,p)?(v=l.linkContent,p=l.pos):(v="",p=d);p<f&&32===l.src.charCodeAt(p);)p++;return p<f&&10!==l.src.charCodeAt(p)?-1:(g=u(e.slice(1,c)),void 0===r.references[g]&&(r.references[g]={title:v,href:m}),p)}var i=n(263),o=n(165),a=n(491),s=n(492),u=n(490);e.exports=function(e){var t,n,i,o,a=e.tokens;if(e.env.references=e.env.references||{},!e.inlineMode)for(t=1,n=a.length-1;t<n;t++)if("inline"===a[t].type&&"paragraph_open"===a[t-1].type&&"paragraph_close"===a[t+1].type){for(i=a[t].content;i.length&&!((o=r(i,e.inline,e.options,e.env))<0);)i=i.slice(o).trim();a[t].content=i,i.length||(a[t-1].tight=!0,a[t+1].tight=!0)}}},function(e,t,n){"use strict";function r(e){return e.indexOf("(")<0?e:e.replace(o,function(e,t){return a[t.toLowerCase()]})}var i=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,o=/\((c|tm|r|p)\)/gi,a={c:"©",r:"®",p:"§",tm:"™"};e.exports=function(e){var t,n,o,a,s;if(e.options.typographer)for(s=e.tokens.length-1;s>=0;s--)if("inline"===e.tokens[s].type)for(a=e.tokens[s].children,t=a.length-1;t>=0;t--)n=a[t],"text"===n.type&&(o=n.content,o=r(o),i.test(o)&&(o=o.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),n.content=o)}},function(e,t,n){"use strict";function r(e,t){return!(t<0||t>=e.length)&&!s.test(e[t])}function i(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}var o=/['"]/,a=/['"]/g,s=/[-\s()\[\]]/;e.exports=function(e){var t,n,s,u,l,c,p,f,h,d,m,v,g,y,_,b,x;if(e.options.typographer)for(x=[],_=e.tokens.length-1;_>=0;_--)if("inline"===e.tokens[_].type)for(b=e.tokens[_].children,x.length=0,t=0;t<b.length;t++)if(n=b[t],"text"===n.type&&!o.test(n.text)){for(p=b[t].level,g=x.length-1;g>=0&&!(x[g].level<=p);g--);x.length=g+1,s=n.content,l=0,c=s.length;e:for(;l<c&&(a.lastIndex=l,u=a.exec(s));)if(f=!r(s,u.index-1),l=u.index+1,y="'"===u[0],(h=!r(s,l))||f){if(m=!h,v=!f)for(g=x.length-1;g>=0&&(d=x[g],!(x[g].level<p));g--)if(d.single===y&&x[g].level===p){d=x[g],y?(b[d.token].content=i(b[d.token].content,d.pos,e.options.quotes[2]),n.content=i(n.content,u.index,e.options.quotes[3])):(b[d.token].content=i(b[d.token].content,d.pos,e.options.quotes[0]),n.content=i(n.content,u.index,e.options.quotes[1])),x.length=g;continue e}m?x.push({token:t,pos:u.index,single:y,level:p}):v&&y&&(n.content=i(n.content,u.index,"’"))}else y&&(n.content=i(n.content,u.index,"’"))}}},function(e,t,n){"use strict";var r=n(1129),i=n(489),o=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,a=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;e.exports=function(e,t){var n,s,u,l,c,p=e.pos;return 60===e.src.charCodeAt(p)&&(n=e.src.slice(p),!(n.indexOf(">")<0)&&((s=n.match(a))?!(r.indexOf(s[1].toLowerCase())<0)&&(l=s[0].slice(1,-1),c=i(l),!!e.parser.validateLink(l)&&(t||(e.push({type:"link_open",href:c,level:e.level}),e.push({type:"text",content:l,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=s[0].length,!0)):!!(u=n.match(o))&&(l=u[0].slice(1,-1),c=i("mailto:"+l),!!e.parser.validateLink(c)&&(t||(e.push({type:"link_open",href:c,level:e.level}),e.push({type:"text",content:l,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=u[0].length,!0))))}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o,a,s=e.pos;if(96!==e.src.charCodeAt(s))return!1;for(n=s,s++,r=e.posMax;s<r&&96===e.src.charCodeAt(s);)s++;for(i=e.src.slice(n,s),o=a=s;-1!==(o=e.src.indexOf("`",a));){for(a=o+1;a<r&&96===e.src.charCodeAt(a);)a++;if(a-o===i.length)return t||e.push({type:"code",content:e.src.slice(s,o).replace(/[ \n]+/g," ").trim(),block:!1,level:e.level}),e.pos=a,!0}return t||(e.pending+=i),e.pos+=i.length,!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o,a,s=e.posMax,u=e.pos;if(126!==e.src.charCodeAt(u))return!1;if(t)return!1;if(u+4>=s)return!1;if(126!==e.src.charCodeAt(u+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(o=u>0?e.src.charCodeAt(u-1):-1,a=e.src.charCodeAt(u+2),126===o)return!1;if(126===a)return!1;if(32===a||10===a)return!1;for(r=u+2;r<s&&126===e.src.charCodeAt(r);)r++;if(r>u+3)return e.pos+=r-u,t||(e.pending+=e.src.slice(u,r)),!0;for(e.pos=u+2,i=1;e.pos+1<s;){if(126===e.src.charCodeAt(e.pos)&&126===e.src.charCodeAt(e.pos+1)&&(o=e.src.charCodeAt(e.pos-1),126!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&126!==o&&(32!==o&&10!==o?i--:32!==a&&10!==a&&i++,i<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=u+2,t||(e.push({type:"del_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"del_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=u,!1)}},function(e,t,n){"use strict";function r(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function i(e,t){var n,i,o,a=t,s=!0,u=!0,l=e.posMax,c=e.src.charCodeAt(t);for(n=t>0?e.src.charCodeAt(t-1):-1;a<l&&e.src.charCodeAt(a)===c;)a++;return a>=l&&(s=!1),o=a-t,o>=4?s=u=!1:(i=a<l?e.src.charCodeAt(a):-1,32!==i&&10!==i||(s=!1),32!==n&&10!==n||(u=!1),95===c&&(r(n)&&(s=!1),r(i)&&(u=!1))),{can_open:s,can_close:u,delims:o}}e.exports=function(e,t){var n,r,o,a,s,u,l,c=e.posMax,p=e.pos,f=e.src.charCodeAt(p);if(95!==f&&42!==f)return!1;if(t)return!1;if(l=i(e,p),n=l.delims,!l.can_open)return e.pos+=n,t||(e.pending+=e.src.slice(p,e.pos)),!0;if(e.level>=e.options.maxNesting)return!1;for(e.pos=p+n,u=[n];e.pos<c;)if(e.src.charCodeAt(e.pos)!==f)e.parser.skipToken(e);else{if(l=i(e,e.pos),r=l.delims,l.can_close){for(a=u.pop(),s=r;a!==s;){if(s<a){u.push(a-s);break}if(s-=a,0===u.length)break;e.pos+=a,a=u.pop()}if(0===u.length){n=a,o=!0;break}e.pos+=r;continue}l.can_open&&u.push(r),e.pos+=r}return o?(e.posMax=e.pos,e.pos=p+n,t||(2!==n&&3!==n||e.push({type:"strong_open",level:e.level++}),1!==n&&3!==n||e.push({type:"em_open",level:e.level++}),e.parser.tokenize(e),1!==n&&3!==n||e.push({type:"em_close",level:--e.level}),2!==n&&3!==n||e.push({type:"strong_close",level:--e.level})),e.pos=e.posMax+n,e.posMax=c,!0):(e.pos=p,!1)}},function(e,t,n){"use strict";var r=n(488),i=n(26).has,o=n(26).isValidEntityCode,a=n(26).fromCodePoint,s=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,u=/^&([a-z][a-z0-9]{1,31});/i;e.exports=function(e,t){var n,l,c=e.pos,p=e.posMax;if(38!==e.src.charCodeAt(c))return!1;if(c+1<p)if(35===e.src.charCodeAt(c+1)){if(l=e.src.slice(c).match(s))return t||(n="x"===l[1][0].toLowerCase()?parseInt(l[1].slice(1),16):parseInt(l[1],10),e.pending+=a(o(n)?n:65533)),e.pos+=l[0].length,!0}else if((l=e.src.slice(c).match(u))&&i(r,l[1]))return t||(e.pending+=r[l[1]]),e.pos+=l[0].length,!0;return t||(e.pending+="&"),e.pos++,!0}},function(e,t,n){"use strict";for(var r=[],i=0;i<256;i++)r.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){r[e.charCodeAt(0)]=1}),e.exports=function(e,t){var n,i=e.pos,o=e.posMax;if(92!==e.src.charCodeAt(i))return!1;if(++i<o){if((n=e.src.charCodeAt(i))<256&&0!==r[n])return t||(e.pending+=e.src[i]),e.pos+=2,!0;if(10===n){for(t||e.push({type:"hardbreak",level:e.level}),i++;i<o&&32===e.src.charCodeAt(i);)i++;return e.pos=i,!0}}return t||(e.pending+="\\"),e.pos++,!0}},function(e,t,n){"use strict";var r=n(165);e.exports=function(e,t){var n,i,o,a,s=e.posMax,u=e.pos;return!(u+2>=s)&&(94===e.src.charCodeAt(u)&&(91===e.src.charCodeAt(u+1)&&(!(e.level>=e.options.maxNesting)&&(n=u+2,!((i=r(e,u+1))<0)&&(t||(e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.list||(e.env.footnotes.list=[]),o=e.env.footnotes.list.length,e.pos=n,e.posMax=i,e.push({type:"footnote_ref",id:o,level:e.level}),e.linkLevel++,a=e.tokens.length,e.parser.tokenize(e),e.env.footnotes.list[o]={tokens:e.tokens.splice(a)},e.linkLevel--),e.pos=i+1,e.posMax=s,!0)))))}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o,a=e.posMax,s=e.pos;if(s+3>a)return!1;if(!e.env.footnotes||!e.env.footnotes.refs)return!1;if(91!==e.src.charCodeAt(s))return!1;if(94!==e.src.charCodeAt(s+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(r=s+2;r<a;r++){if(32===e.src.charCodeAt(r))return!1;if(10===e.src.charCodeAt(r))return!1;if(93===e.src.charCodeAt(r))break}return r!==s+2&&(!(r>=a)&&(r++,n=e.src.slice(s+2,r-1),void 0!==e.env.footnotes.refs[":"+n]&&(t||(e.env.footnotes.list||(e.env.footnotes.list=[]),e.env.footnotes.refs[":"+n]<0?(i=e.env.footnotes.list.length,e.env.footnotes.list[i]={label:n,count:0},e.env.footnotes.refs[":"+n]=i):i=e.env.footnotes.refs[":"+n],o=e.env.footnotes.list[i].count,e.env.footnotes.list[i].count++,e.push({type:"footnote_ref",id:i,subId:o,level:e.level})),e.pos=r,e.posMax=a,!0)))}},function(e,t,n){"use strict";function r(e){var t=32|e;return t>=97&&t<=122}var i=n(1128).HTML_TAG_RE;e.exports=function(e,t){var n,o,a,s=e.pos;return!!e.options.html&&(a=e.posMax,!(60!==e.src.charCodeAt(s)||s+2>=a)&&(!(33!==(n=e.src.charCodeAt(s+1))&&63!==n&&47!==n&&!r(n))&&(!!(o=e.src.slice(s).match(i))&&(t||e.push({type:"htmltag",content:e.src.slice(s,s+o[0].length),level:e.level}),e.pos+=o[0].length,!0))))}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o,a,s=e.posMax,u=e.pos;if(43!==e.src.charCodeAt(u))return!1;if(t)return!1;if(u+4>=s)return!1;if(43!==e.src.charCodeAt(u+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(o=u>0?e.src.charCodeAt(u-1):-1,a=e.src.charCodeAt(u+2),43===o)return!1;if(43===a)return!1;if(32===a||10===a)return!1;for(r=u+2;r<s&&43===e.src.charCodeAt(r);)r++;if(r!==u+2)return e.pos+=r-u,t||(e.pending+=e.src.slice(u,r)),!0;for(e.pos=u+2,i=1;e.pos+1<s;){if(43===e.src.charCodeAt(e.pos)&&43===e.src.charCodeAt(e.pos+1)&&(o=e.src.charCodeAt(e.pos-1),43!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&43!==o&&(32!==o&&10!==o?i--:32!==a&&10!==a&&i++,i<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=u+2,t||(e.push({type:"ins_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"ins_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=u,!1)}},function(e,t,n){"use strict";var r=n(165),i=n(491),o=n(492),a=n(490);e.exports=function(e,t){var n,s,u,l,c,p,f,h,d=!1,m=e.pos,v=e.posMax,g=e.pos,y=e.src.charCodeAt(g);if(33===y&&(d=!0,y=e.src.charCodeAt(++g)),91!==y)return!1;if(e.level>=e.options.maxNesting)return!1;if(n=g+1,(s=r(e,g))<0)return!1;if((p=s+1)<v&&40===e.src.charCodeAt(p)){for(p++;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);if(p>=v)return!1;for(g=p,i(e,p)?(l=e.linkContent,p=e.pos):l="",g=p;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);if(p<v&&g!==p&&o(e,p))for(c=e.linkContent,p=e.pos;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);else c="";if(p>=v||41!==e.src.charCodeAt(p))return e.pos=m,!1;p++}else{if(e.linkLevel>0)return!1;for(;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);if(p<v&&91===e.src.charCodeAt(p)&&(g=p+1,p=r(e,p),p>=0?u=e.src.slice(g,p++):p=g-1),u||(void 0===u&&(p=s+1),u=e.src.slice(n,s)),!(f=e.env.references[a(u)]))return e.pos=m,!1;l=f.href,c=f.title}return t||(e.pos=n,e.posMax=s,d?e.push({type:"image",src:l,title:c,alt:e.src.substr(n,s-n),level:e.level}):(e.push({type:"link_open",href:l,title:c,level:e.level++}),e.linkLevel++,e.parser.tokenize(e),e.linkLevel--,e.push({type:"link_close",level:--e.level}))),e.pos=p,e.posMax=v,!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o,a,s=e.posMax,u=e.pos;if(61!==e.src.charCodeAt(u))return!1;if(t)return!1;if(u+4>=s)return!1;if(61!==e.src.charCodeAt(u+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(o=u>0?e.src.charCodeAt(u-1):-1,a=e.src.charCodeAt(u+2),61===o)return!1;if(61===a)return!1;if(32===a||10===a)return!1;for(r=u+2;r<s&&61===e.src.charCodeAt(r);)r++;if(r!==u+2)return e.pos+=r-u,t||(e.pending+=e.src.slice(u,r)),!0;for(e.pos=u+2,i=1;e.pos+1<s;){if(61===e.src.charCodeAt(e.pos)&&61===e.src.charCodeAt(e.pos+1)&&(o=e.src.charCodeAt(e.pos-1),61!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&61!==o&&(32!==o&&10!==o?i--:32!==a&&10!==a&&i++,i<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=u+2,t||(e.push({type:"mark_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"mark_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=u,!1)}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i=e.pos;if(10!==e.src.charCodeAt(i))return!1;if(n=e.pending.length-1,r=e.posMax,!t)if(n>=0&&32===e.pending.charCodeAt(n))if(n>=1&&32===e.pending.charCodeAt(n-1)){for(var o=n-2;o>=0;o--)if(32!==e.pending.charCodeAt(o)){e.pending=e.pending.substring(0,o+1);break}e.push({type:"hardbreak",level:e.level})}else e.pending=e.pending.slice(0,-1),e.push({type:"softbreak",level:e.level});else e.push({type:"softbreak",level:e.level});for(i++;i<r&&32===e.src.charCodeAt(i);)i++;return e.pos=i,!0}},function(e,t,n){"use strict";var r=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;e.exports=function(e,t){var n,i,o=e.posMax,a=e.pos;if(126!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+2>=o)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=a+1;e.pos<o;){if(126===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&a+1!==e.pos?(i=e.src.slice(a+1,e.pos),i.match(/(^|[^\\])(\\\\)*\s/)?(e.pos=a,!1):(e.posMax=e.pos,e.pos=a+1,t||e.push({type:"sub",level:e.level,content:i.replace(r,"$1")}),e.pos=e.posMax+1,e.posMax=o,!0)):(e.pos=a,!1)}},function(e,t,n){"use strict";var r=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;e.exports=function(e,t){var n,i,o=e.posMax,a=e.pos;if(94!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+2>=o)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=a+1;e.pos<o;){if(94===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&a+1!==e.pos?(i=e.src.slice(a+1,e.pos),i.match(/(^|[^\\])(\\\\)*\s/)?(e.pos=a,!1):(e.posMax=e.pos,e.pos=a+1,t||e.push({type:"sup",level:e.level,content:i.replace(r,"$1")}),e.pos=e.posMax+1,e.posMax=o,!0)):(e.pos=a,!1)}},function(e,t,n){"use strict";function r(e){switch(e){case 10:case 92:case 96:case 42:case 95:case 94:case 91:case 93:case 33:case 38:case 60:case 62:case 123:case 125:case 36:case 37:case 64:case 126:case 43:case 61:case 58:return!0;default:return!1}}e.exports=function(e,t){for(var n=e.pos;n<e.posMax&&!r(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}},function(e,t,n){"use strict";function r(e,t){if("string"!=typeof e)throw new TypeError("expected a string");if(1===t)return e;if(2===t)return e+e;var n=e.length*t;if(i!==e||void 0===i)i=e,o="";else if(o.length>=n)return o.substr(0,n);for(;n>o.length&&t>1;)1&t&&(o+=e),t>>=1,e+=e;return o+=e,o=o.substr(0,n)}/*! + */t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},o=t||{},a=e.split(i),u=o.decode||r,c=0;c<a.length;c++){var l=a[c],p=l.indexOf("=");if(!(p<0)){var f=l.substr(0,p).trim(),h=l.substr(++p,l.length).trim();'"'==h[0]&&(h=h.slice(1,-1)),null==n[f]&&(n[f]=s(h,u))}}return n},t.serialize=function(e,t,n){var r=n||{},i=r.encode||o;if("function"!=typeof i)throw new TypeError("option encode is invalid");if(!a.test(e))throw new TypeError("argument name is invalid");var s=i(t);if(s&&!a.test(s))throw new TypeError("argument val is invalid");var u=e+"="+s;if(null!=r.maxAge){var c=r.maxAge-0;if(isNaN(c))throw new Error("maxAge should be a Number");u+="; Max-Age="+Math.floor(c)}if(r.domain){if(!a.test(r.domain))throw new TypeError("option domain is invalid");u+="; Domain="+r.domain}if(r.path){if(!a.test(r.path))throw new TypeError("option path is invalid");u+="; Path="+r.path}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");u+="; Expires="+r.expires.toUTCString()}r.httpOnly&&(u+="; HttpOnly");r.secure&&(u+="; Secure");if(r.sameSite){switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:u+="; SameSite=Strict";break;case"lax":u+="; SameSite=Lax";break;case"strict":u+="; SameSite=Strict";break;default:throw new TypeError("option sameSite is invalid")}}return u};var r=decodeURIComponent,o=encodeURIComponent,i=/; */,a=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(e,t){try{return t(e)}catch(t){return e}}},function(e,t){e.exports=function(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r>=55296&&r<=56319&&n+1<e.length){var o=e.charCodeAt(n+1);if(o>=56320&&o<=57343){var i=1024*(r-55296)+o-56320+65536;t.push(240+Math.floor(i/64/64/64),128+Math.floor(i/64/64)%64,128+Math.floor(i/64)%64,128+i%64),n+=1;continue}}r>=2048?t.push(224+Math.floor(r/64/64),128+Math.floor(r/64)%64,128+r%64):r>=128?t.push(192+Math.floor(r/64),128+r%64):t.push(r)}return t}},function(e,t,n){!function(){var e;function n(e,t){function n(e,t,n){if(!r(e))return n;for(var o=0,i=0;;){var a,s=t.exec(e);for(a=s?s.index:e.length;i<n;){if(o==a){i<n&&(i++,s?o+=s[0].length:o++);break}o++,i++}if(i==n)break;if(o>=e.length||!s)return-1}return o}function r(e){return a.test(e)}function o(e,n){null==e&&(e=["[^]"]),null==n&&(n="g");var r=[];return t.forEach(function(e){r.push(e.source)}),r.push(i.source),r=r.concat(e),new RegExp(r.join("|"),n)}e.findCharIndex=function(e,t){if(t>=e.length)return-1;if(!r(e))return t;for(var n=o(),i=0;null!==n.exec(e)&&!(n.lastIndex>t);)i++;return i},e.findByteIndex=function(e,t){return t>=this.length(e)?-1:n(e,o(),t)},e.charAt=function(e,t){var n=this.findByteIndex(e,t);if(n<0||n>=e.length)return"";var r=e.slice(n,n+8),o=a.exec(r);return null===o?r[0]:o[0]},e.charCodeAt=function(e,t){var r=function(e,t){return n(e,new RegExp(i.source,"g"),t)}(e,t);if(r<0)return NaN;var o=e.charCodeAt(r);return 55296<=o&&o<=56319?1024*(o-55296)+(e.charCodeAt(r+1)-56320)+65536:o},e.fromCharCode=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):String.fromCharCode(e)},e.indexOf=function(e,t,n){null==n&&(n=0);var r=this.findByteIndex(e,n),o=e.indexOf(t,r);return o<0?-1:this.findCharIndex(e,o)},e.lastIndexOf=function(e,t,n){var r;if(null==n)r=e.lastIndexOf(t);else{var o=this.findByteIndex(e,n);r=e.lastIndexOf(t,o)}return r<0?-1:this.findCharIndex(e,r)},e.slice=function(e,t,n){var r,o=this.findByteIndex(e,t);return o<0&&(o=e.length),null==n?r=e.length:(r=this.findByteIndex(e,n))<0&&(r=e.length),e.slice(o,r)},e.substr=function(e,t,n){return t<0&&(t=this.length(e)+t),null==n?this.slice(e,t):this.slice(e,t,t+n)},e.substring=e.slice,e.length=function(e){return this.findCharIndex(e,e.length-1)+1},e.stringToCodePoints=function(e){for(var t=[],n=0;n<e.length&&(codePoint=this.charCodeAt(e,n),codePoint);n++)t.push(codePoint);return t},e.codePointsToString=function(e){for(var t=[],n=0;n<e.length;n++)t.push(this.fromCharCode(e[n]));return t.join("")},e.stringToBytes=function(e){for(var t=[],n=0;n<e.length;n++){for(var r=e.charCodeAt(n),o=[];r>0;)o.push(255&r),r>>=8;1==o.length&&o.push(0),t=t.concat(o.reverse())}return t},e.bytesToString=function(e){for(var t=[],n=0;n<e.length;n+=2){var r=e[n]<<8|e[n+1];t.push(String.fromCharCode(r))}return t.join("")},e.stringToCharArray=function(e){var t=[],n=o();do{var r=n.exec(e);if(null===r)break;t.push(r[0])}while(null!==r);return t};var i=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,a=o([],"")}null!==t?e=t:"undefined"!=typeof window&&null!==window&&(void 0!==window.UtfString&&null!==window.UtfString||(window.UtfString={}),e=window.UtfString);e.visual={},n(e,[]),n(e.visual,[/\uD83C[\uDDE6-\uDDFF]\uD83C[\uDDE6-\uDDFF]/])}()},function(e,t,n){var r=n(449),o=1,i=4;e.exports=function(e){return r(e,o|i)}},function(e,t){!function(e){"use strict";function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function r(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return d.iterable&&(t[Symbol.iterator]=function(){return t}),t}function o(e){this.map={},e instanceof o?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function i(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function a(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function s(e){var t=new FileReader,n=a(t);return t.readAsArrayBuffer(e),n}function u(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function c(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(d.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(d.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(d.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(d.arrayBuffer&&d.blob&&v(e))this._bodyArrayBuffer=u(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!d.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!g(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=u(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):d.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},d.blob&&(this.blob=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=a(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},d.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function l(e,t){var n=(t=t||{}).body;if(e instanceof l){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new o(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new o(t.headers)),this.method=function(e){var t=e.toUpperCase();return y.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function p(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function f(e){var t=new o;return e.split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t}function h(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new o(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var d={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(d.arrayBuffer)var m=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v=function(e){return e&&DataView.prototype.isPrototypeOf(e)},g=ArrayBuffer.isView||function(e){return e&&m.indexOf(Object.prototype.toString.call(e))>-1};o.prototype.append=function(e,r){e=t(e),r=n(r);var o=this.map[e];this.map[e]=o?o+","+r:r},o.prototype.delete=function(e){delete this.map[t(e)]},o.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},o.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},o.prototype.set=function(e,r){this.map[t(e)]=n(r)},o.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},o.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),r(e)},o.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),r(e)},o.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),r(e)},d.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];l.prototype.clone=function(){return new l(this,{body:this._bodyInit})},c.call(l.prototype),c.call(h.prototype),h.prototype.clone=function(){return new h(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},h.error=function(){var e=new h(null,{status:0,statusText:""});return e.type="error",e};var b=[301,302,303,307,308];h.redirect=function(e,t){if(-1===b.indexOf(t))throw new RangeError("Invalid status code");return new h(null,{status:t,headers:{location:e}})},e.Headers=o,e.Request=l,e.Response=h,e.fetch=function(e,t){return new Promise(function(n,r){var o=new l(e,t),i=new XMLHttpRequest;i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:f(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var t="response"in i?i.response:i.responseText;n(new h(t,e))},i.onerror=function(){r(new TypeError("Network request failed"))},i.ontimeout=function(){r(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&d.blob&&(i.responseType="blob"),o.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(e,t){e.exports=FormData},function(e,t,n){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}},function(e,t,n){n(164),n(101),n(103),n(972),n(974),n(977),n(978),e.exports=n(22).Map},function(e,t,n){"use strict";var r=n(973),o=n(144);e.exports=n(459)("Map",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=r.getEntry(o(this,"Map"),e);return t&&t.v},set:function(e,t){return r.def(o(this,"Map"),0===e?0:e,t)}},r,!0)},function(e,t,n){"use strict";var r=n(49).f,o=n(160),i=n(182),a=n(63),s=n(181),u=n(112),c=n(219),l=n(353),p=n(414),f=n(50),h=n(135).fastKey,d=n(144),m=f?"_s":"size",v=function(e,t){var n,r=h(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,c){var l=e(function(e,r){s(e,l,t,"_i"),e._t=t,e._i=o(null),e._f=void 0,e._l=void 0,e[m]=0,null!=r&&u(r,n,e[c],e)});return i(l.prototype,{clear:function(){for(var e=d(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[m]=0},delete:function(e){var n=d(this,t),r=v(n,e);if(r){var o=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=o),o&&(o.p=i),n._f==r&&(n._f=o),n._l==r&&(n._l=i),n[m]--}return!!r},forEach:function(e){d(this,t);for(var n,r=a(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!v(d(this,t),e)}}),f&&r(l.prototype,"size",{get:function(){return d(this,t)[m]}}),l},def:function(e,t,n){var r,o,i=v(e,t);return i?i.v=n:(e._l=i={i:o=h(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=i),r&&(r.n=i),e[m]++,"F"!==o&&(e._i[o]=i)),e},getEntry:v,setStrong:function(e,t,n){c(e,t,function(e,n){this._t=d(e,t),this._k=n,this._l=void 0},function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?l(0,"keys"==e?t.k:"values"==e?t.v:[t.k,t.v]):(this._t=void 0,l(1))},n?"entries":"values",!n,!0),p(t)}}},function(e,t,n){var r=n(30);r(r.P+r.R,"Map",{toJSON:n(975)("Map")})},function(e,t,n){var r=n(166),o=n(976);e.exports=function(e){return function(){if(r(this)!=e)throw TypeError(e+"#toJSON isn't generic");return o(this)}}},function(e,t,n){var r=n(112);e.exports=function(e,t){var n=[];return r(e,!1,n.push,n,t),n}},function(e,t,n){n(460)("Map")},function(e,t,n){n(461)("Map")},function(e,t,n){"use strict"; +/*! * repeat-string <https://github.com/jonschlinkert/repeat-string> * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. - */ -var i,o="";e.exports=r},function(e,t,n){"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},function(e,t,n){"use strict";function r(e,t){e&&Object.keys(e).forEach(function(n){t(e[n],n)})}function i(e,t){return{}.hasOwnProperty.call(e,t)}function o(e,t){var n=[];return r(e,function(e){t(e)&&n.push(e)}),n}function a(e,t,n){function g(e,t){var n=this;this.tag=e,this.attribs=t||{},this.tagPosition=E.length,this.text="",this.updateParentNodeText=function(){if(P.length){P[P.length-1].text+=n.text}}}function y(e){return"string"!=typeof e&&(e+=""),e.replace(/\&/g,"&").replace(/</g,"<").replace(/\>/g,">").replace(/\"/g,""")}function _(e,n){n=n.replace(/[\x00-\x20]+/g,""),n=n.replace(/<\!\-\-.*?\-\-\>/g,"");var r=n.match(/^([a-zA-Z]+)\:/);if(!r)return!!n.match(/^[\/\\]{2}/)&&!t.allowProtocolRelative;var o=r[1].toLowerCase();return i(t.allowedSchemesByTag,e)?-1===t.allowedSchemesByTag[e].indexOf(o):!t.allowedSchemes||-1===t.allowedSchemes.indexOf(o)}function b(e,t){if(!t)return e;var n,r=c(e),i=e.nodes[0];return n=t[i.selector]&&t["*"]?p(c(t[i.selector]),t["*"],function(e,t){if(Array.isArray(e))return e.concat(t)}):t[i.selector]||t["*"],n&&(r.nodes[0].nodes=i.nodes.reduce(w(n),[])),r}function x(e){return e.nodes[0].nodes.reduce(function(e,t){return e.push(t.prop+":"+t.value+";"),e},[]).join("")}function w(e){return function(t,n){if(e.hasOwnProperty(n.prop)){e[n.prop].some(function(e){return e.test(n.value)})&&t.push(n)}return t}}function k(e,t){return t?(e=e.split(/\s+/),e.filter(function(e){return-1!==t.indexOf(e)}).join(" ")):e}var E="";t?(t=u(a.defaults,t),t.parser?t.parser=u(v,t.parser):t.parser=v):(t=a.defaults,t.parser=v);var S,C,A=t.nonTextTags||["script","style","textarea"];t.allowedAttributes&&(S={},C={},r(t.allowedAttributes,function(e,t){S[t]=[];var n=[];e.forEach(function(e){e.indexOf("*")>=0?n.push(l(e).replace(/\\\*/g,".*")):S[t].push(e)}),C[t]=new RegExp("^("+n.join("|")+")$")}));var D={};r(t.allowedClasses,function(e,t){S&&(i(S,t)||(S[t]=[]),S[t].push("class")),D[t]=e});var O,M={};r(t.transformTags,function(e,t){var n;"function"==typeof e?n=e:"string"==typeof e&&(n=a.simpleTransform(e)),"*"===t?O=n:M[t]=n});var T=0,P=[],I={},R={},j=!1,F=0,N=new s.Parser({onopentag:function(e,n){if(j)return void F++;var a=new g(e,n);P.push(a);var s,u=!1,l=!!a.text;i(M,e)&&(s=M[e](e,n),a.attribs=n=s.attribs,void 0!==s.text&&(a.innerText=s.text),e!==s.tagName&&(a.name=e=s.tagName,R[T]=s.tagName)),O&&(s=O(e,n),a.attribs=n=s.attribs,e!==s.tagName&&(a.name=e=s.tagName,R[T]=s.tagName)),t.allowedTags&&-1===t.allowedTags.indexOf(e)&&(u=!0,-1!==A.indexOf(e)&&(j=!0,F=1),I[T]=!0),T++,u||(E+="<"+e,(!S||i(S,e)||S["*"])&&r(n,function(n,s){if(!m.test(s))return void delete a.attribs[s];var u;if(!S||i(S,e)&&-1!==S[e].indexOf(s)||S["*"]&&-1!==S["*"].indexOf(s)||i(C,e)&&C[e].test(s)||C["*"]&&C["*"].test(s)){if(("href"===s||"src"===s)&&_(e,n))return void delete a.attribs[s];if("iframe"===e&&"src"===s){if("//"===n.substring(0,2)){n="https:".concat(n)}try{if(u=d.parse(n),t.allowedIframeHostnames){if(!t.allowedIframeHostnames.find(function(e){return e===u.hostname}))return void delete a.attribs[s]}}catch(e){return void delete a.attribs[s]}}if("srcset"===s)try{if(u=f.parse(n),r(u,function(e){_("srcset",e.url)&&(e.evil=!0)}),u=o(u,function(e){return!e.evil}),!u.length)return void delete a.attribs[s];n=f.stringify(o(u,function(e){return!e.evil})),a.attribs[s]=n}catch(e){return void delete a.attribs[s]}if("class"===s&&(n=k(n,D[e]),!n.length))return void delete a.attribs[s];if("style"===s)try{if(n=x(b(h.parse(e+" {"+n+"}"),t.allowedStyles)),0===n.length)return void delete a.attribs[s]}catch(e){return void delete a.attribs[s]}E+=" "+s,n.length&&(E+='="'+y(n)+'"')}else delete a.attribs[s]}),-1!==t.selfClosing.indexOf(e)?E+=" />":(E+=">",!a.innerText||l||t.textFilter||(E+=a.innerText)))},ontext:function(e){if(!j){var n,r=P[P.length-1];if(r&&(n=r.tag,e=void 0!==r.innerText?r.innerText:e),"script"===n||"style"===n)E+=e;else{var i=y(e);t.textFilter?E+=t.textFilter(i):E+=i}if(P.length){P[P.length-1].text+=e}}},onclosetag:function(e){if(j){if(--F)return;j=!1}var n=P.pop();if(n){if(j=!1,T--,I[T])return delete I[T],void n.updateParentNodeText();if(R[T]&&(e=R[T],delete R[T]),t.exclusiveFilter&&t.exclusiveFilter(n))return void(E=E.substr(0,n.tagPosition));n.updateParentNodeText(),-1===t.selfClosing.indexOf(e)&&(E+="</"+e+">")}}},t.parser);return N.write(e),N.end(),E}var s=n(116),u=n(1200),l=n(825),c=n(824),p=n(827),f=n(1181),h=n(982),d=n(497);e.exports=a;var m=/^[^\0\t\n\f\r \/<=>]+$/,v={decodeEntities:!0};a.defaults={allowedTags:["h3","h4","h5","h6","blockquote","p","a","ul","ol","nl","li","b","i","strong","em","strike","code","hr","br","div","table","thead","caption","tbody","tr","th","td","pre","iframe"],allowedAttributes:{a:["href","name","target"],img:["src"]},selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto"],allowedSchemesByTag:{},allowProtocolRelative:!0},a.simpleTransform=function(e,t,n){return n=void 0===n||n,t=t||{},function(r,i){var o;if(n)for(o in t)i[o]=t[o];else i=t;return{tagName:e,attribs:i}}}},function(e,t,n){(function(e,t){!function(e,n){"use strict";function r(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var r={callback:e,args:t};return l[u]=r,s(u),u++}function i(e){delete l[e]}function o(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}function a(e){if(c)setTimeout(a,0,e);else{var t=l[e];if(t){c=!0;try{o(t)}finally{i(e),c=!1}}}}if(!e.setImmediate){var s,u=1,l={},c=!1,p=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?function(){s=function(e){t.nextTick(function(){a(e)})}}():function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?function(){var t="setImmediate$"+Math.random()+"$",n=function(n){n.source===e&&"string"==typeof n.data&&0===n.data.indexOf(t)&&a(+n.data.slice(t.length))};e.addEventListener?e.addEventListener("message",n,!1):e.attachEvent("onmessage",n),s=function(n){e.postMessage(t+n,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){a(e.data)},s=function(t){e.port2.postMessage(t)}}():p&&"onreadystatechange"in p.createElement("script")?function(){var e=p.documentElement;s=function(t){var n=p.createElement("script");n.onreadystatechange=function(){a(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():function(){s=function(e){setTimeout(a,0,e)}}(),f.setImmediate=r,f.clearImmediate=i}}("undefined"==typeof self?void 0===e?this:e:self)}).call(t,n(17),n(33))},function(e,t,n){"use strict";function r(e){return e.sort().filter(function(t,n){return JSON.stringify(t)!==JSON.stringify(e[n-1])})}var i=n(978),o=n(507),a=/^\d+$/;t.parse=function(e){return r(e.split(",").map(function(e){var t={};return e.trim().split(/\s+/).forEach(function(e,n){if(0===n)return t.url=e;var r=e.substring(0,e.length-1),o=e[e.length-1],s=parseInt(r,10),u=parseFloat(r);if("w"===o&&a.test(r))t.width=s;else if("h"===o&&a.test(r))t.height=s;else{if("x"!==o||i(u))throw new Error("Invalid srcset descriptor: "+e+".");t.density=u}}),t}))},t.stringify=function(e){return o(e.map(function(e){if(!e.url)throw new Error("URL is required.");var t=[e.url];return e.width&&t.push(e.width+"w"),e.height&&t.push(e.height+"h"),e.density&&t.push(e.density+"x"),t.join(" ")})).join(", ")}},function(e,t,n){e.exports=n(1183)},function(e,t,n){"use strict";(function(e,r){Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(1184),a=function(e){return e&&e.__esModule?e:{default:e}}(o);i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var s=(0,a.default)(i);t.default=s}).call(t,n(17),n(72)(e))},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},function(e,t,n){"use strict";e.exports=2147483647},function(e,t,n){"use strict";var r=n(65),i=n(1185);e.exports=function(e){if((e=r(e))>i)throw new TypeError(e+" exceeds maximum possible timeout");return e}},function(e,t,n){"use strict";(function(t){function r(e){e=e||t.location||{};var n,r={},i=typeof e;if("blob:"===e.protocol)r=new a(unescape(e.pathname),{});else if("string"===i){r=new a(e,{});for(n in d)delete r[n]}else if("object"===i){for(n in e)n in d||(r[n]=e[n]);void 0===r.slashes&&(r.slashes=f.test(e.href))}return r}function i(e){var t=p.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function o(e,t){for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,i=n[r-1],o=!1,a=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),a++):a&&(0===r&&(o=!0),n.splice(r,1),a--);return o&&n.unshift(""),"."!==i&&".."!==i||n.push(""),n.join("/")}function a(e,t,n){if(!(this instanceof a))return new a(e,t,n);var s,u,p,f,d,m,v=h.slice(),g=typeof t,y=this,_=0;for("object"!==g&&"string"!==g&&(n=t,t=null),n&&"function"!=typeof n&&(n=c.parse),t=r(t),u=i(e||""),s=!u.protocol&&!u.slashes,y.slashes=u.slashes||s&&t.slashes,y.protocol=u.protocol||t.protocol||"",e=u.rest,u.slashes||(v[2]=[/(.*)/,"pathname"]);_<v.length;_++)f=v[_],p=f[0],m=f[1],p!==p?y[m]=e:"string"==typeof p?~(d=e.indexOf(p))&&("number"==typeof f[2]?(y[m]=e.slice(0,d),e=e.slice(d+f[2])):(y[m]=e.slice(d),e=e.slice(0,d))):(d=p.exec(e))&&(y[m]=d[1],e=e.slice(0,d.index)),y[m]=y[m]||(s&&f[3]?t[m]||"":""),f[4]&&(y[m]=y[m].toLowerCase());n&&(y.query=n(y.query)),s&&t.slashes&&"/"!==y.pathname.charAt(0)&&(""!==y.pathname||""!==t.pathname)&&(y.pathname=o(y.pathname,t.pathname)),l(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(f=y.auth.split(":"),y.username=f[0]||"",y.password=f[1]||""),y.origin=y.protocol&&y.host&&"file:"!==y.protocol?y.protocol+"//"+y.host:"null",y.href=y.toString()}function s(e,t,n){var r=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||c.parse)(t)),r[e]=t;break;case"port":r[e]=t,l(t,r.protocol)?t&&(r.host=r.hostname+":"+t):(r.host=r.hostname,r[e]="");break;case"hostname":r[e]=t,r.port&&(t+=":"+r.port),r.host=t;break;case"host":r[e]=t,/:\d+$/.test(t)?(t=t.split(":"),r.port=t.pop(),r.hostname=t.join(":")):(r.hostname=t,r.port="");break;case"protocol":r.protocol=t.toLowerCase(),r.slashes=!n;break;case"pathname":case"hash":if(t){var i="pathname"===e?"/":"#";r[e]=t.charAt(0)!==i?i+t:t}else r[e]=t;break;default:r[e]=t}for(var o=0;o<h.length;o++){var a=h[o];a[4]&&(r[a[1]]=r[a[1]].toLowerCase())}return r.origin=r.protocol&&r.host&&"file:"!==r.protocol?r.protocol+"//"+r.host:"null",r.href=r.toString(),r}function u(e){e&&"function"==typeof e||(e=c.stringify);var t,n=this,r=n.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var i=r+(n.slashes?"//":"");return n.username&&(i+=n.username,n.password&&(i+=":"+n.password),i+="@"),i+=n.host+n.pathname,t="object"==typeof n.query?e(n.query):n.query,t&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}var l=n(1178),c=n(1005),p=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,f=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,h=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],d={hash:1,query:1};a.prototype={set:s,toString:u},a.extractProtocol=i,a.location=r,a.qs=c,e.exports=a}).call(t,n(17))},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t){e.exports=function(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r>=55296&&r<=56319&&n+1<e.length){var i=e.charCodeAt(n+1);if(i>=56320&&i<=57343){var o=1024*(r-55296)+i-56320+65536;t.push(240+Math.floor(o/64/64/64),128+Math.floor(o/64/64)%64,128+Math.floor(o/64)%64,128+o%64),n+=1;continue}}r>=2048?t.push(224+Math.floor(r/64/64),128+Math.floor(r/64)%64,128+r%64):r>=128?t.push(192+Math.floor(r/64),128+r%64):t.push(r)}return t}},function(e,t){!function(){function e(e,t){function n(e,t){return r(e,new RegExp(a.source,"g"),t)}function r(e,t,n){if(!i(e))return n;var r=0,o=0;do{var a=t.exec(e);if(null===a)break;if(!(o<n))break;r+=a[0].length,o++}while(null!==a);return r>=e.length?-1:r}function i(e){return s.test(e)}function o(e,n){void 0==e&&(e=["[^]"]),void 0==n&&(n="g");var r=[];return t.forEach(function(e){r.push(e.source)}),r.push(a.source),r=r.concat(e),new RegExp(r.join("|"),n)}e.findCharIndex=function(e,t){if(t>=e.length)return-1;if(!i(e))return t;for(var n=o(),r=0;null!==n.exec(e)&&!(n.lastIndex>t);)r++;return r},e.findByteIndex=function(e,t){return t>=this.length(e)?-1:r(e,o(),t)},e.charAt=function(e,t){var n=this.findByteIndex(e,t);if(n<0||n>=e.length)return"";var r=e.slice(n,n+8),i=s.exec(r);return null===i?r[0]:i[0]},e.charCodeAt=function(e,t){var r=n(e,t);if(r<0)return NaN;var i=e.charCodeAt(r);if(55296<=i&&i<=56319){return 1024*(i-55296)+(e.charCodeAt(r+1)-56320)+65536}return i},e.fromCharCode=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):String.fromCharCode(e)},e.indexOf=function(e,t,n){void 0!==n&&null!==n||(n=0);var r=this.findByteIndex(e,n),i=e.indexOf(t,r);return i<0?-1:this.findCharIndex(e,i)},e.lastIndexOf=function(e,t,n){var r;if(void 0===n||null===n)r=e.lastIndexOf(t);else{var i=this.findByteIndex(e,n);r=e.lastIndexOf(t,i)}return r<0?-1:this.findCharIndex(e,r)},e.slice=function(e,t,n){var r,i=this.findByteIndex(e,t);return i<0&&(i=e.length),void 0===n||null===n?r=e.length:(r=this.findByteIndex(e,n))<0&&(r=e.length),e.slice(i,r)},e.substr=function(e,t,n){return t<0&&(t=this.length(e)+t),void 0===n||null===n?this.slice(e,t):this.slice(e,t,t+n)},e.substring=e.slice,e.length=function(e){return this.findCharIndex(e,e.length-1)+1},e.stringToCodePoints=function(e){for(var t=[],n=0;n<e.length&&(codePoint=this.charCodeAt(e,n),codePoint);n++)t.push(codePoint);return t},e.codePointsToString=function(e){for(var t=[],n=0;n<e.length;n++)t.push(this.fromCharCode(e[n]));return t.join("")},e.stringToBytes=function(e){for(var t=[],n=0;n<e.length;n++){for(var r=e.charCodeAt(n),i=[];r>0;)i.push(255&r),r>>=8;1==i.length&&i.push(0),t=t.concat(i.reverse())}return t},e.bytesToString=function(e){for(var t=[],n=0;n<e.length;n+=2){var r=e[n],i=e[n+1],o=r<<8|i;t.push(String.fromCharCode(o))}return t.join("")},e.stringToCharArray=function(e){var t=[],n=o();do{var r=n.exec(e);if(null===r)break;t.push(r[0])}while(null!==r);return t};var a=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,s=o([],"")}var n;void 0!==t&&null!==t?n=t:"undefined"!=typeof window&&null!==window&&(void 0!==window.UtfString&&null!==window.UtfString||(window.UtfString={}),n=window.UtfString);var r=/\uD83C[\uDDE6-\uDDFF]\uD83C[\uDDE6-\uDDFF]/;n.visual={},e(n,[]),e(n.visual,[r])}()},function(e,t,n){(function(t){function n(e,t){function n(){if(!i){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}if(r("noDeprecation"))return e;var i=!1;return n}function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=n}).call(t,n(17))},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t,n){(function(e,r){function i(e,n){var r={seen:[],stylize:a};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(n)?r.showHidden=n:n&&t._extend(r,n),x(r.showHidden)&&(r.showHidden=!1),x(r.depth)&&(r.depth=2),x(r.colors)&&(r.colors=!1),x(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),u(r,e,r.depth)}function o(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function a(e,t){return e}function s(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function u(e,n,r){if(e.customInspect&&n&&C(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return _(i)||(i=u(e,i,r)),i}var o=l(e,n);if(o)return o;var a=Object.keys(n),m=s(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),S(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(n);if(0===a.length){if(C(n)){var v=n.name?": "+n.name:"";return e.stylize("[Function"+v+"]","special")}if(w(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(E(n))return e.stylize(Date.prototype.toString.call(n),"date");if(S(n))return c(n)}var g="",y=!1,b=["{","}"];if(d(n)&&(y=!0,b=["[","]"]),C(n)){g=" [Function"+(n.name?": "+n.name:"")+"]"}if(w(n)&&(g=" "+RegExp.prototype.toString.call(n)),E(n)&&(g=" "+Date.prototype.toUTCString.call(n)),S(n)&&(g=" "+c(n)),0===a.length&&(!y||0==n.length))return b[0]+g+b[1];if(r<0)return w(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special");e.seen.push(n);var x;return x=y?p(e,n,r,m,a):a.map(function(t){return f(e,n,r,m,t,y)}),e.seen.pop(),h(x,g,b)}function l(e,t){if(x(t))return e.stylize("undefined","undefined");if(_(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return y(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,n,r,i){for(var o=[],a=0,s=t.length;a<s;++a)T(t,String(a))?o.push(f(e,t,n,r,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(f(e,t,n,r,i,!0))}),o}function f(e,t,n,r,i,o){var a,s,l;if(l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},l.get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),T(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=v(n)?u(e,l.value,null):u(e,l.value,n-1),s.indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n"))):s=e.stylize("[Circular]","special")),x(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function h(e,t,n){var r=0;return e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function d(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function v(e){return null===e}function g(e){return null==e}function y(e){return"number"==typeof e}function _(e){return"string"==typeof e}function b(e){return"symbol"==typeof e}function x(e){return void 0===e}function w(e){return k(e)&&"[object RegExp]"===D(e)}function k(e){return"object"==typeof e&&null!==e}function E(e){return k(e)&&"[object Date]"===D(e)}function S(e){return k(e)&&("[object Error]"===D(e)||e instanceof Error)}function C(e){return"function"==typeof e}function A(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function D(e){return Object.prototype.toString.call(e)}function O(e){return e<10?"0"+e.toString(10):e.toString(10)}function M(){var e=new Date,t=[O(e.getHours()),O(e.getMinutes()),O(e.getSeconds())].join(":");return[e.getDate(),j[e.getMonth()],t].join(" ")}function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var P=/%[sdj%]/g;t.format=function(e){if(!_(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(i(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,o=r.length,a=String(e).replace(P,function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),s=r[n];n<o;s=r[++n])v(s)||!k(s)?a+=" "+s:a+=" "+i(s);return a},t.deprecate=function(n,i){function o(){if(!a){if(r.throwDeprecation)throw new Error(i);r.traceDeprecation?console.trace(i):console.error(i),a=!0}return n.apply(this,arguments)}if(x(e.process))return function(){return t.deprecate(n,i).apply(this,arguments)};if(!0===r.noDeprecation)return n;var a=!1;return o};var I,R={};t.debuglog=function(e){if(x(I)&&(I=n.i({NODE_ENV:"production",WEBPACK_INLINE_STYLES:!1}).NODE_DEBUG||""),e=e.toUpperCase(),!R[e])if(new RegExp("\\b"+e+"\\b","i").test(I)){var i=r.pid;R[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,i,n)}}else R[e]=function(){};return R[e]},t.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=m,t.isNull=v,t.isNullOrUndefined=g,t.isNumber=y,t.isString=_,t.isSymbol=b,t.isUndefined=x,t.isRegExp=w,t.isObject=k,t.isDate=E,t.isError=S,t.isFunction=C,t.isPrimitive=A,t.isBuffer=n(1193);var j=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];t.log=function(){console.log("%s - %s",M(),t.format.apply(t,arguments))},t.inherits=n(1192),t._extend=function(e,t){if(!t||!k(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(t,n(17),n(33))},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,n){"use strict";function r(e){return a(e).map(function(e){return{value:e,type:i(e)}})}function i(e){return u(e)?"ClosingTag":c(e)?"OpeningTag":l(e)?"SelfClosingTag":"Text"}var o=n(1177),a=function(e){return e.split(/(<\/?[^>]+>)/g).filter(function(e){return""!==e.trim()})},s=function(e){return/<[^>!]+>/.test(e)},u=function(e){return/<\/+[^>]+>/.test(e)},l=function(e){return/<[^>]+\/>/.test(e)},c=function(e){return s(e)&&!u(e)&&!l(e)};e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.indentor,i=t.textNodesOnSameLine,a=0,s=[];n=n||" ";var u=r(e).map(function(e,t,r){var u=e.value,l=e.type;"ClosingTag"===l&&a--;var c=o(n,a),p=c+u;if("OpeningTag"===l&&a++,i){var f=r[t-1],h=r[t-2];"ClosingTag"===l&&"Text"===f.type&&"OpeningTag"===h.type&&(p=""+c+h.value+f.value+u,s.push(t-2,t-1))}return p});return s.forEach(function(e){return u[e]=null}),u.filter(function(e){return!!e}).join("\n")}},function(e,t){function n(e){return e&&e.replace?e.replace(/([&"<>'])/g,function(e,t){return r[t]}):e}var r={"&":"&",'"':""","'":"'","<":"<",">":">"};e.exports=n},function(e,t,n){(function(t){function r(e,n){function r(e){m?t.nextTick(e):e()}function i(e,t){if(void 0!==t&&(f+=t),e&&!h&&(l=l||new c,h=!0),e&&h){var n=f;r(function(){l.emit("data",n)}),f=""}}function o(e,t){s(i,a(e,d,d?1:0),t)}function u(){if(l){var e=f;r(function(){l.emit("data",e),l.emit("end"),l.readable=!1,l.emit("close")})}}"object"!=typeof n&&(n={indent:n});var l=n.stream?new c:null,f="",h=!1,d=n.indent?!0===n.indent?p:n.indent:"",m=!0;return r(function(){m=!1}),n.declaration&&function(e){var t=e.encoding||"UTF-8",n={version:"1.0",encoding:t};e.standalone&&(n.standalone=e.standalone),o({"?xml":{_attr:n}}),f=f.replace("/>","?>")}(n.declaration),e&&e.forEach?e.forEach(function(t,n){var r;n+1===e.length&&(r=u),o(t,r)}):o(e,u),l?(l.readable=!0,l):f}function i(){var e=Array.prototype.slice.call(arguments),t={_elem:a(e)};return t.push=function(e){if(!this.append)throw new Error("not assigned to a parent!");var t=this,n=this._elem.indent;s(this.append,a(e,n,this._elem.icount+(n?1:0)),function(){t.append(!0)})},t.close=function(e){void 0!==e&&this.push(e),this.end&&this.end()},t}function o(e,t){return new Array(t||0).join(e||"")}function a(e,t,n){function r(e){Object.keys(e).forEach(function(t){f.push(u(t,e[t]))})}n=n||0;var i,s=o(t,n),c=e;if("object"==typeof e){if(i=Object.keys(e)[0],(c=e[i])&&c._elem)return c._elem.name=i,c._elem.icount=n,c._elem.indent=t,c._elem.indents=s,c._elem.interrupt=c,c._elem}var p,f=[],h=[];switch(typeof c){case"object":if(null===c)break;c._attr&&r(c._attr),c._cdata&&h.push(("<![CDATA["+c._cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")+"]]>"),c.forEach&&(p=!1,h.push(""),c.forEach(function(e){if("object"==typeof e){"_attr"==Object.keys(e)[0]?r(e._attr):h.push(a(e,t,n+1))}else h.pop(),p=!0,h.push(l(e))}),p||h.push(""));break;default:h.push(l(c))}return{name:i,interrupt:!1,attributes:f,content:h,icount:n,indents:s,indent:t}}function s(e,t,n){function r(){for(;t.content.length;){var r=t.content.shift();if(void 0!==r){if(i(r))return;s(e,r)}}e(!1,(o>1?t.indents:"")+(t.name?"</"+t.name+">":"")+(t.indent&&!n?"\n":"")),n&&n()}function i(t){return!!t.interrupt&&(t.interrupt.append=e,t.interrupt.end=r,t.interrupt=!1,e(!0),!0)}if("object"!=typeof t)return e(!1,t);var o=t.interrupt?1:t.content.length;if(e(!1,t.indents+(t.name?"<"+t.name:"")+(t.attributes.length?" "+t.attributes.join(" "):"")+(o?t.name?">":"":t.name?"/>":"")+(t.indent&&o>1?"\n":"")),!o)return e(!1,t.indent?"\n":"");i(t)||r()}function u(e,t){return e+'="'+l(t)+'"'}var l=n(1197),c=n(493).Stream,p=" ";e.exports=r,e.exports.element=e.exports.Element=i}).call(t,n(33))},function(e,t){function n(e,t,n){return r.yubl(t((n||r.yufull)(e)))}t._getPrivFilters=function(){function e(e){var t=e.split(k,2);return!t[0]||2!==t.length&&e.length===t[0].length?null:t[0]}function t(e,t,n,r){function i(e,n,i,a){return n?(n=Number(n[0]<="9"?n:"0"+n),r?A(n):128===n?"€":130===n?"‚":131===n?"ƒ":132===n?"„":133===n?"…":134===n?"†":135===n?"‡":136===n?"ˆ":137===n?"‰":138===n?"Š":139===n?"‹":140===n?"Œ":142===n?"Ž":145===n?"‘":146===n?"’":147===n?"“":148===n?"”":149===n?"•":150===n?"–":151===n?"—":152===n?"˜":153===n?"™":154===n?"š":155===n?"›":156===n?"œ":158===n?"ž":159===n?"Ÿ":n>=55296&&n<=57343||13===n?"�":o.frCoPt(n)):t[i||a]||e}return t=t||m,n=n||d,void 0===e?"undefined":null===e?"null":e.toString().replace(c,"�").replace(n,i)}function n(e){return"\\"+e.charCodeAt(0).toString(16).toLowerCase()+" "}function r(e){return e.replace(_,function(e){return"-x-"+e})}function i(n){n=o.yufull(t(n));var r=e(n);return r&&w[r.toLowerCase()]?"##"+n:n}var o,a=/</g,s=/"/g,u=/'/g,l=/&/g,c=/\x00/g,p=/(?:^$|[\x00\x09-\x0D "'`=<>])/g,f=/[&<>"'`]/g,h=/(?:\x00|^-*!?>|--!?>|--?!?$|\]>|\]$)/g,d=/&(?:#([xX][0-9A-Fa-f]+|\d+);?|(Tab|NewLine|colon|semi|lpar|rpar|apos|sol|comma|excl|ast|midast|ensp|emsp|thinsp);|(nbsp|amp|AMP|lt|LT|gt|GT|quot|QUOT);?)/g,m={Tab:"\t",NewLine:"\n",colon:":",semi:";",lpar:"(",rpar:")",apos:"'",sol:"/",comma:",",excl:"!",ast:"*",midast:"*",ensp:" ",emsp:" ",thinsp:" ",nbsp:" ",amp:"&",lt:"<",gt:">",quot:'"',QUOT:'"'},v=/^(?:(?!-*expression)#?[-\w]+|[+-]?(?:\d+|\d*\.\d+)(?:r?em|ex|ch|cm|mm|in|px|pt|pc|%|vh|vw|vmin|vmax)?|!important|)$/i,g=/[\x00-\x1F\x7F\[\]{}\\"]/g,y=/[\x00-\x1F\x7F\[\]{}\\']/g,_=/url[\(\u207D\u208D]+/g,b=/['\(\)]/g,x=/\/\/%5[Bb]([A-Fa-f0-9:]+)%5[Dd]/,w={javascript:1,data:1,vbscript:1,mhtml:1,"x-schema":1},k=/(?::|&#[xX]0*3[aA];?|�*58;?|:)/,E=/(?:^[\x00-\x20]+|[\t\n\r\x00]+)/g,S={Tab:"\t",NewLine:"\n"},C=function(e,t,n){return void 0===e?"undefined":null===e?"null":e.toString().replace(t,n)},A=String.fromCodePoint||function(e){return 0===arguments.length?"":e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),e%1024+56320))};return o={frCoPt:function(e){return void 0===e||null===e?"":!isFinite(e=Number(e))||e<=0||e>1114111||e>=1&&e<=8||e>=14&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||11===e||65535==(65535&e)||65534==(65535&e)?"�":A(e)},d:t,yup:function(n){return n=e(n.replace(c,"")),n?t(n,S,null,!0).replace(E,"").toLowerCase():null},y:function(e){return C(e,f,function(e){return"&"===e?"&":"<"===e?"<":">"===e?">":'"'===e?""":"'"===e?"'":"`"})},ya:function(e){return C(e,l,"&")},yd:function(e){return C(e,a,"<")},yc:function(e){return C(e,h,function(e){return"\0"===e?"�":"--!"===e||"--"===e||"-"===e||"]"===e?e+" ":e.slice(0,-1)+" >"})},yavd:function(e){return C(e,s,""")},yavs:function(e){return C(e,u,"'")},yavu:function(e){return C(e,p,function(e){return"\t"===e?" ":"\n"===e?" ":"\v"===e?" ":"\f"===e?" ":"\r"===e?" ":" "===e?" ":"="===e?"=":"<"===e?"<":">"===e?">":'"'===e?""":"'"===e?"'":"`"===e?"`":"�"})},yu:encodeURI,yuc:encodeURIComponent,yubl:function(e){return w[o.yup(e)]?"x-"+e:e},yufull:function(e){return o.yu(e).replace(x,function(e,t){return"//["+t+"]"})},yublf:function(e){return o.yubl(o.yufull(e))},yceu:function(e){return e=t(e),v.test(e)?e:";-x:'"+r(e.replace(y,n))+"';-v:"},yced:function(e){return r(t(e).replace(g,n))},yces:function(e){return r(t(e).replace(y,n))},yceuu:function(e){return i(e).replace(b,function(e){return"'"===e?"\\27 ":"("===e?"%28":"%29"})},yceud:function(e){return i(e)},yceus:function(e){return i(e).replace(u,"\\27 ")}}};var r=t._privFilters=t._getPrivFilters();t.inHTMLData=r.yd,t.inHTMLComment=r.yc,t.inSingleQuotedAttr=r.yavs,t.inDoubleQuotedAttr=r.yavd,t.inUnQuotedAttr=r.yavu,t.uriInSingleQuotedAttr=function(e){return n(e,r.yavs)},t.uriInDoubleQuotedAttr=function(e){return n(e,r.yavd)},t.uriInUnQuotedAttr=function(e){return n(e,r.yavu)},t.uriInHTMLData=r.yufull,t.uriInHTMLComment=function(e){return r.yc(r.yufull(e))},t.uriPathInSingleQuotedAttr=function(e){return n(e,r.yavs,r.yu)},t.uriPathInDoubleQuotedAttr=function(e){return n(e,r.yavd,r.yu)},t.uriPathInUnQuotedAttr=function(e){return n(e,r.yavu,r.yu)},t.uriPathInHTMLData=r.yu,t.uriPathInHTMLComment=function(e){return r.yc(r.yu(e))},t.uriQueryInSingleQuotedAttr=t.uriPathInSingleQuotedAttr,t.uriQueryInDoubleQuotedAttr=t.uriPathInDoubleQuotedAttr,t.uriQueryInUnQuotedAttr=t.uriPathInUnQuotedAttr,t.uriQueryInHTMLData=t.uriPathInHTMLData,t.uriQueryInHTMLComment=t.uriPathInHTMLComment,t.uriComponentInSingleQuotedAttr=function(e){return r.yavs(r.yuc(e))},t.uriComponentInDoubleQuotedAttr=function(e){return r.yavd(r.yuc(e))},t.uriComponentInUnQuotedAttr=function(e){return r.yavu(r.yuc(e))},t.uriComponentInHTMLData=r.yuc,t.uriComponentInHTMLComment=function(e){return r.yc(r.yuc(e))},t.uriFragmentInSingleQuotedAttr=function(e){return r.yubl(r.yavs(r.yuc(e)))},t.uriFragmentInDoubleQuotedAttr=function(e){return r.yubl(r.yavd(r.yuc(e)))},t.uriFragmentInUnQuotedAttr=function(e){return r.yubl(r.yavu(r.yuc(e)))},t.uriFragmentInHTMLData=t.uriComponentInHTMLData,t.uriFragmentInHTMLComment=t.uriComponentInHTMLComment},function(e,t){function n(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var i in n)r.call(n,i)&&(e[i]=n[i])}return e}e.exports=n;var r=Object.prototype.hasOwnProperty},function(e,t,n){(function(){var e,t,r,i,o,a=[].slice;o=n(61),e=n(1202),i=n(1205),t=n(1204),r=n(266),this.make_dumper=function(n,s,u,l){var c;return null==n&&(n=e.Emitter),null==s&&(s=i.Serializer),null==u&&(u=t.Representer),null==l&&(l=r.Resolver),c=[n,s,u,l],function(){function e(e,n){var r,i,o;for(null==n&&(n={}),c[0].call(this,e,n),o=c.slice(1),r=0,i=o.length;r<i;r++)t=o[r],t.call(this,n)}var t;return o.extend.apply(o,[e.prototype].concat(a.call(function(){var e,n,r;for(r=[],e=0,n=c.length;e<n;e++)t=c[e],r.push(t.prototype);return r}()))),e}()},this.Dumper=this.make_dumper()}).call(this)},function(e,t,n){(function(){var e,r,i,o,a=function(e,t){function n(){this.constructor=e}for(var r in t)s.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},s={}.hasOwnProperty,u=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1};i=n(127),o=n(61),r=n(45).YAMLError,this.EmitterError=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return a(t,e),t}(r),this.Emitter=function(){function n(e,t){var n;this.stream=e,this.encoding=null,this.states=[],this.state=this.expect_stream_start,this.events=[],this.event=null,this.indents=[],this.indent=null,this.flow_level=0,this.root_context=!1,this.sequence_context=!1,this.mapping_context=!1,this.simple_key_context=!1,this.line=0,this.column=0,this.whitespace=!0,this.indentation=!0,this.open_ended=!1,this.canonical=t.canonical,this.allow_unicode=t.allow_unicode,null==this.canonical&&(this.canonical=!1),null==this.allow_unicode&&(this.allow_unicode=!0),this.best_indent=1<t.indent&&t.indent<10?t.indent:2,this.best_width=t.width>2*this.indent?t.width:80,this.best_line_break="\r"===(n=t.line_break)||"\n"===n||"\r\n"===n?t.line_break:"\n",this.tag_prefixes=null,this.prepared_anchor=null,this.prepared_tag=null,this.analysis=null,this.style=null}var r,a,l;return r="\0 \t\r\n…\u2028\u2029",a={"!":"!","tag:yaml.org,2002:":"!!"},l={"\0":"0","":"a","\b":"b","\t":"t","\n":"n","\v":"v","\f":"f","\r":"r","":"e",'"':'"',"\\":"\\","…":"N"," ":"_","\u2028":"L","\u2029":"P"},n.prototype.dispose=function(){return this.states=[],this.state=null},n.prototype.emit=function(e){var t;for(this.events.push(e),t=[];!this.need_more_events();)this.event=this.events.shift(),this.state(),t.push(this.event=null);return t},n.prototype.need_more_events=function(){var e;return 0===this.events.length||(e=this.events[0],e instanceof i.DocumentStartEvent?this.need_events(1):e instanceof i.SequenceStartEvent?this.need_events(2):e instanceof i.MappingStartEvent&&this.need_events(3))},n.prototype.need_events=function(e){var t,n,r,o,a;for(o=0,a=this.events.slice(1),n=0,r=a.length;n<r;n++)if(t=a[n],t instanceof i.DocumentStartEvent||t instanceof i.CollectionStartEvent?o++:t instanceof i.DocumentEndEvent||t instanceof i.CollectionEndEvent?o--:t instanceof i.StreamEndEvent&&(o=-1),o<0)return!1;return this.events.length<e+1},n.prototype.increase_indent=function(e){return null==e&&(e={}),this.indents.push(this.indent),null==this.indent?this.indent=e.flow?this.best_indent:0:e.indentless?void 0:this.indent+=this.best_indent},n.prototype.expect_stream_start=function(){return this.event instanceof i.StreamStartEvent?(!this.event.encoding||"encoding"in this.stream||(this.encoding=this.event.encoding),this.write_stream_start(),this.state=this.expect_first_document_start):this.error("expected StreamStartEvent, but got",this.event)},n.prototype.expect_nothing=function(){return this.error("expected nothing, but got",this.event)},n.prototype.expect_first_document_start=function(){return this.expect_document_start(!0)},n.prototype.expect_document_start=function(e){var t,n,r,u,l,c,p;if(null==e&&(e=!1),this.event instanceof i.DocumentStartEvent){if((this.event.version||this.event.tags)&&this.open_ended&&(this.write_indicator("...",!0),this.write_indent()),this.event.version&&this.write_version_directive(this.prepare_version(this.event.version)),this.tag_prefixes=o.clone(a),this.event.tags)for(p=function(){var e,t;e=this.event.tags,t=[];for(u in e)s.call(e,u)&&t.push(u);return t}.call(this).sort(),r=0,l=p.length;r<l;r++)n=p[r],c=this.event.tags[n],this.tag_prefixes[c]=n,this.write_tag_directive(this.prepare_tag_handle(n),this.prepare_tag_prefix(c));return t=!e||this.event.explicit||this.canonical||this.event.version||this.event.tags||this.check_empty_document(),t&&(this.write_indent(),this.write_indicator("---",!0),this.canonical&&this.write_indent()),this.state=this.expect_document_root}return this.event instanceof i.StreamEndEvent?(this.open_ended&&(this.write_indicator("...",!0),this.write_indent()),this.write_stream_end(),this.state=this.expect_nothing):this.error("expected DocumentStartEvent, but got",this.event)},n.prototype.expect_document_end=function(){return this.event instanceof i.DocumentEndEvent?(this.write_indent(),this.event.explicit&&(this.write_indicator("...",!0),this.write_indent()),this.flush_stream(),this.state=this.expect_document_start):this.error("expected DocumentEndEvent, but got",this.event)},n.prototype.expect_document_root=function(){return this.states.push(this.expect_document_end),this.expect_node({root:!0})},n.prototype.expect_node=function(e){return null==e&&(e={}),this.root_context=!!e.root,this.sequence_context=!!e.sequence,this.mapping_context=!!e.mapping,this.simple_key_context=!!e.simple_key,this.event instanceof i.AliasEvent?this.expect_alias():this.event instanceof i.ScalarEvent||this.event instanceof i.CollectionStartEvent?(this.process_anchor("&"),this.process_tag(),this.event instanceof i.ScalarEvent?this.expect_scalar():this.event instanceof i.SequenceStartEvent?this.flow_level||this.canonical||this.event.flow_style||this.check_empty_sequence()?this.expect_flow_sequence():this.expect_block_sequence():this.event instanceof i.MappingStartEvent?this.flow_level||this.canonical||this.event.flow_style||this.check_empty_mapping()?this.expect_flow_mapping():this.expect_block_mapping():void 0):this.error("expected NodeEvent, but got",this.event)},n.prototype.expect_alias=function(){return this.event.anchor||this.error("anchor is not specified for alias"),this.process_anchor("*"),this.state=this.states.pop()},n.prototype.expect_scalar=function(){return this.increase_indent({flow:!0}),this.process_scalar(),this.indent=this.indents.pop(),this.state=this.states.pop()},n.prototype.expect_flow_sequence=function(){return this.write_indicator("[",!0,{whitespace:!0}),this.flow_level++,this.increase_indent({flow:!0}),this.state=this.expect_first_flow_sequence_item},n.prototype.expect_first_flow_sequence_item=function(){return this.event instanceof i.SequenceEndEvent?(this.indent=this.indents.pop(),this.flow_level--,this.write_indicator("]",!1),this.state=this.states.pop()):((this.canonical||this.column>this.best_width)&&this.write_indent(),this.states.push(this.expect_flow_sequence_item),this.expect_node({sequence:!0}))},n.prototype.expect_flow_sequence_item=function(){return this.event instanceof i.SequenceEndEvent?(this.indent=this.indents.pop(),this.flow_level--,this.canonical&&(this.write_indicator(",",!1),this.write_indent()),this.write_indicator("]",!1),this.state=this.states.pop()):(this.write_indicator(",",!1),(this.canonical||this.column>this.best_width)&&this.write_indent(),this.states.push(this.expect_flow_sequence_item),this.expect_node({sequence:!0}))},n.prototype.expect_flow_mapping=function(){return this.write_indicator("{",!0,{whitespace:!0}),this.flow_level++,this.increase_indent({flow:!0}),this.state=this.expect_first_flow_mapping_key},n.prototype.expect_first_flow_mapping_key=function(){return this.event instanceof i.MappingEndEvent?(this.indent=this.indents.pop(),this.flow_level--,this.write_indicator("}",!1),this.state=this.states.pop()):((this.canonical||this.column>this.best_width)&&this.write_indent(),!this.canonical&&this.check_simple_key()?(this.states.push(this.expect_flow_mapping_simple_value),this.expect_node({mapping:!0,simple_key:!0})):(this.write_indicator("?",!0),this.states.push(this.expect_flow_mapping_value),this.expect_node({mapping:!0})))},n.prototype.expect_flow_mapping_key=function(){return this.event instanceof i.MappingEndEvent?(this.indent=this.indents.pop(),this.flow_level--,this.canonical&&(this.write_indicator(",",!1),this.write_indent()),this.write_indicator("}",!1),this.state=this.states.pop()):(this.write_indicator(",",!1),(this.canonical||this.column>this.best_width)&&this.write_indent(),!this.canonical&&this.check_simple_key()?(this.states.push(this.expect_flow_mapping_simple_value),this.expect_node({mapping:!0,simple_key:!0})):(this.write_indicator("?",!0),this.states.push(this.expect_flow_mapping_value),this.expect_node({mapping:!0})))},n.prototype.expect_flow_mapping_simple_value=function(){return this.write_indicator(":",!1),this.states.push(this.expect_flow_mapping_key),this.expect_node({mapping:!0})},n.prototype.expect_flow_mapping_value=function(){return(this.canonical||this.column>this.best_width)&&this.write_indent(),this.write_indicator(":",!0),this.states.push(this.expect_flow_mapping_key),this.expect_node({mapping:!0})},n.prototype.expect_block_sequence=function(){var e;return e=this.mapping_context&&!this.indentation,this.increase_indent({indentless:e}),this.state=this.expect_first_block_sequence_item},n.prototype.expect_first_block_sequence_item=function(){return this.expect_block_sequence_item(!0)},n.prototype.expect_block_sequence_item=function(e){return null==e&&(e=!1),!e&&this.event instanceof i.SequenceEndEvent?(this.indent=this.indents.pop(),this.state=this.states.pop()):(this.write_indent(),this.write_indicator("-",!0,{indentation:!0}),this.states.push(this.expect_block_sequence_item),this.expect_node({sequence:!0}))},n.prototype.expect_block_mapping=function(){return this.increase_indent(),this.state=this.expect_first_block_mapping_key},n.prototype.expect_first_block_mapping_key=function(){return this.expect_block_mapping_key(!0)},n.prototype.expect_block_mapping_key=function(e){return null==e&&(e=!1),!e&&this.event instanceof i.MappingEndEvent?(this.indent=this.indents.pop(),this.state=this.states.pop()):(this.write_indent(),this.check_simple_key()?(this.states.push(this.expect_block_mapping_simple_value),this.expect_node({mapping:!0,simple_key:!0})):(this.write_indicator("?",!0,{indentation:!0}),this.states.push(this.expect_block_mapping_value),this.expect_node({mapping:!0})))},n.prototype.expect_block_mapping_simple_value=function(){return this.write_indicator(":",!1),this.states.push(this.expect_block_mapping_key),this.expect_node({mapping:!0})},n.prototype.expect_block_mapping_value=function(){return this.write_indent(),this.write_indicator(":",!0,{indentation:!0}),this.states.push(this.expect_block_mapping_key),this.expect_node({mapping:!0})},n.prototype.check_empty_document=function(){var e;return this.event instanceof i.DocumentStartEvent&&0!==this.events.length&&((e=this.events[0])instanceof i.ScalarEvent&&null==e.anchor&&null==e.tag&&e.implicit&&""===e.value)},n.prototype.check_empty_sequence=function(){return this.event instanceof i.SequenceStartEvent&&this.events[0]instanceof i.SequenceEndEvent},n.prototype.check_empty_mapping=function(){return this.event instanceof i.MappingStartEvent&&this.events[0]instanceof i.MappingEndEvent},n.prototype.check_simple_key=function(){var e;return e=0,this.event instanceof i.NodeEvent&&null!=this.event.anchor&&(null==this.prepared_anchor&&(this.prepared_anchor=this.prepare_anchor(this.event.anchor)),e+=this.prepared_anchor.length),null!=this.event.tag&&(this.event instanceof i.ScalarEvent||this.event instanceof i.CollectionStartEvent)&&(null==this.prepared_tag&&(this.prepared_tag=this.prepare_tag(this.event.tag)),e+=this.prepared_tag.length),this.event instanceof i.ScalarEvent&&(null==this.analysis&&(this.analysis=this.analyze_scalar(this.event.value)),e+=this.analysis.scalar.length),e<128&&(this.event instanceof i.AliasEvent||this.event instanceof i.ScalarEvent&&!this.analysis.empty&&!this.analysis.multiline||this.check_empty_sequence()||this.check_empty_mapping())},n.prototype.process_anchor=function(e){return null==this.event.anchor?void(this.prepared_anchor=null):(null==this.prepared_anchor&&(this.prepared_anchor=this.prepare_anchor(this.event.anchor)),this.prepared_anchor&&this.write_indicator(""+e+this.prepared_anchor,!0),this.prepared_anchor=null)},n.prototype.process_tag=function(){var e;if(e=this.event.tag,this.event instanceof i.ScalarEvent){if(null==this.style&&(this.style=this.choose_scalar_style()),(!this.canonical||null==e)&&(""===this.style&&this.event.implicit[0]||""!==this.style&&this.event.implicit[1]))return void(this.prepared_tag=null);this.event.implicit[0]&&null==e&&(e="!",this.prepared_tag=null)}else if((!this.canonical||null==e)&&this.event.implicit)return void(this.prepared_tag=null);return null==e&&this.error("tag is not specified"),null==this.prepared_tag&&(this.prepared_tag=this.prepare_tag(e)),this.write_indicator(this.prepared_tag,!0),this.prepared_tag=null},n.prototype.process_scalar=function(){var e;switch(null==this.analysis&&(this.analysis=this.analyze_scalar(this.event.value)),null==this.style&&(this.style=this.choose_scalar_style()),e=!this.simple_key_context,this.style){case'"':this.write_double_quoted(this.analysis.scalar,e);break;case"'":this.write_single_quoted(this.analysis.scalar,e);break;case">":this.write_folded(this.analysis.scalar);break;case"|":this.write_literal(this.analysis.scalar);break;default:this.write_plain(this.analysis.scalar,e)}return this.analysis=null,this.style=null},n.prototype.choose_scalar_style=function(){var e;return null==this.analysis&&(this.analysis=this.analyze_scalar(this.event.value)),'"'===this.event.style||this.canonical?'"':this.event.style||!this.event.implicit[0]||this.simple_key_context&&(this.analysis.empty||this.analysis.multiline)||!(this.flow_level&&this.analysis.allow_flow_plain||!this.flow_level&&this.analysis.allow_block_plain)?this.event.style&&(e=this.event.style,u.call("|>",e)>=0)&&!this.flow_level&&!this.simple_key_context&&this.analysis.allow_block?this.event.style:this.event.style&&"'"!==this.event.style||!this.analysis.allow_single_quoted||this.simple_key_context&&this.analysis.multiline?'"':"'":""},n.prototype.prepare_version=function(e){var t,n,r;return t=e[0],n=e[1],r=t+"."+n,1===t?r:this.error("unsupported YAML version",r)},n.prototype.prepare_tag_handle=function(e){var t,n,r,i;for(e||this.error("tag handle must not be empty"),"!"===e[0]&&"!"===e.slice(-1)||this.error("tag handle must start and end with '!':",e),i=e.slice(1,-1),n=0,r=i.length;n<r;n++)"0"<=(t=i[n])&&t<="9"||"A"<=t&&t<="Z"||"a"<=t&&t<="z"||u.call("-_",t)>=0||this.error("invalid character '"+t+"' in the tag handle:",e);return e},n.prototype.prepare_tag_prefix=function(e){var t,n,r,i;for(e||this.error("tag prefix must not be empty"),n=[],i=0,r=+("!"===e[0]);r<e.length;)t=e[r],"0"<=t&&t<="9"||"A"<=t&&t<="Z"||"a"<=t&&t<="z"||u.call("-;/?!:@&=+$,_.~*'()[]",t)>=0?r++:(i<r&&n.push(e.slice(i,r)),i=r+=1,n.push(t));return i<r&&n.push(e.slice(i,r)),n.join("")},n.prototype.prepare_tag=function(e){var t,n,r,i,o,a,l,c,p,f,h,d;if(e||this.error("tag must not be empty"),"!"===e)return e;for(i=null,h=e,p=function(){var e,t;e=this.tag_prefixes,t=[];for(a in e)s.call(e,a)&&t.push(a);return t}.call(this).sort(),o=0,l=p.length;o<l;o++)c=p[o],0===e.indexOf(c)&&("!"===c||c.length<e.length)&&(i=this.tag_prefixes[c],h=e.slice(c.length));for(n=[],f=r=0;r<h.length;)t=h[r],"0"<=t&&t<="9"||"A"<=t&&t<="Z"||"a"<=t&&t<="z"||u.call("-;/?!:@&=+$,_.~*'()[]",t)>=0||"!"===t&&"!"!==i?r++:(f<r&&n.push(h.slice(f,r)),f=r+=1,n.push(t));return f<r&&n.push(h.slice(f,r)),d=n.join(""),i?""+i+d:"!<"+d+">"},n.prototype.prepare_anchor=function(e){var t,n,r;for(e||this.error("anchor must not be empty"),n=0,r=e.length;n<r;n++)"0"<=(t=e[n])&&t<="9"||"A"<=t&&t<="Z"||"a"<=t&&t<="z"||u.call("-_",t)>=0||this.error("invalid character '"+t+"' in the anchor:",e);return e},n.prototype.analyze_scalar=function(t){var n,i,o,a,s,l,c,p,f,h,d,m,v,g,y,_,b,x,w,k,E,S,C,A,D;for(t||new e(t,!0,!1,!1,!0,!0,!0,!1),l=!1,f=!1,_=!1,C=!1,!1,g=!1,v=!1,D=!1,A=!1,c=!1,S=!1,0!==t.indexOf("---")&&0!==t.indexOf("...")||(l=!0,f=!0),b=!0,h=1===t.length||(k=t[1],u.call("\0 \t\r\n…\u2028\u2029",k)>=0),w=!1,x=!1,m=0,m=d=0,y=t.length;d<y;m=++d)p=t[m],0===m?u.call("#,[]{}&*!|>'\"%@`",p)>=0||"-"===p&&h?(f=!0,l=!0):u.call("?:",p)>=0&&(f=!0,h&&(l=!0)):u.call(",?[]{}",p)>=0?f=!0:":"===p?(f=!0,h&&(l=!0)):"#"===p&&b&&(f=!0,l=!0),u.call("\n…\u2028\u2029",p)>=0&&(_=!0),"\n"===p||" "<=p&&p<="~"||("\ufeff"!==p&&("…"===p||" "<=p&&p<="퟿"||""<=p&&p<="�")?(!0,this.allow_unicode||(C=!0)):C=!0)," "===p?(0===m&&(g=!0),m===t.length-1&&(D=!0),x&&(c=!0),x=!1,w=!0):u.call("\n…\u2028\u2029",p)>=0?(0===m&&(v=!0),m===t.length-1&&(A=!0),w&&(S=!0),x=!0,w=!1):(x=!1,w=!1),b=u.call(r,p)>=0,h=m+2>=t.length||(E=t[m+2],u.call(r,E)>=0);return a=!0,i=!0,s=!0,o=!0,n=!0,(g||v||D||A)&&(a=i=!1),D&&(n=!1),c&&(a=i=s=!1),(S||C)&&(a=i=s=n=!1),_&&(a=i=!1),f&&(a=!1),l&&(i=!1),new e(t,!1,_,a,i,s,o,n)},n.prototype.write_stream_start=function(){if(this.encoding&&0===this.encoding.indexOf("utf-16"))return this.stream.write("\ufeff",this.encoding)},n.prototype.write_stream_end=function(){return this.flush_stream()},n.prototype.write_indicator=function(e,t,n){var r;return null==n&&(n={}),r=this.whitespace||!t?e:" "+e,this.whitespace=!!n.whitespace,this.indentation&&(this.indentation=!!n.indentation),this.column+=r.length,this.open_ended=!1,this.stream.write(r,this.encoding)},n.prototype.write_indent=function(){var e,t,n;if(t=null!=(n=this.indent)?n:0,(!this.indentation||this.column>t||this.column===t&&!this.whitespace)&&this.write_line_break(),this.column<t)return this.whitespace=!0,e=new Array(t-this.column+1).join(" "),this.column=t,this.stream.write(e,this.encoding)},n.prototype.write_line_break=function(e){return this.whitespace=!0,this.indentation=!0,this.line+=1,this.column=0,this.stream.write(null!=e?e:this.best_line_break,this.encoding)},n.prototype.write_version_directive=function(e){return this.stream.write("%YAML "+e,this.encoding),this.write_line_break()},n.prototype.write_tag_directive=function(e,t){return this.stream.write("%TAG "+e+" "+t,this.encoding),this.write_line_break()},n.prototype.write_single_quoted=function(e,t){var n,r,i,o,a,s,l,c,p,f;for(null==t&&(t=!0),this.write_indicator("'",!0),p=!1,r=!1,f=a=0;a<=e.length;){if(i=e[a],p)null!=i&&" "===i||(f+1===a&&this.column>this.best_width&&t&&0!==f&&a!==e.length?this.write_indent():(o=e.slice(f,a),this.column+=o.length,this.stream.write(o,this.encoding)),f=a);else if(r){if(null==i||u.call("\n…\u2028\u2029",i)<0){for("\n"===e[f]&&this.write_line_break(),c=e.slice(f,a),s=0,l=c.length;s<l;s++)n=c[s],"\n"===n?this.write_line_break():this.write_line_break(n);this.write_indent(),f=a}}else(null==i||u.call(" \n…\u2028\u2029",i)>=0||"'"===i)&&f<a&&(o=e.slice(f,a),this.column+=o.length,this.stream.write(o,this.encoding),f=a);"'"===i&&(this.column+=2,this.stream.write("''",this.encoding),f=a+1),null!=i&&(p=" "===i,r=u.call("\n…\u2028\u2029",i)>=0),a++}return this.write_indicator("'",!1)},n.prototype.write_double_quoted=function(e,t){var n,r,i,a;for(null==t&&(t=!0),this.write_indicator('"',!0),a=i=0;i<=e.length;)n=e[i],(null==n||u.call('"\\…\u2028\u2029\ufeff',n)>=0||!(" "<=n&&n<="~"||this.allow_unicode&&(" "<=n&&n<="퟿"||""<=n&&n<="�")))&&(a<i&&(r=e.slice(a,i),this.column+=r.length,this.stream.write(r,this.encoding),a=i),null!=n&&(r=n in l?"\\"+l[n]:n<="ÿ"?"\\x"+o.pad_left(o.to_hex(n),"0",2):n<="￿"?"\\u"+o.pad_left(o.to_hex(n),"0",4):"\\U"+o.pad_left(o.to_hex(n),"0",16),this.column+=r.length,this.stream.write(r,this.encoding),a=i+1)),t&&0<i&&i<e.length-1&&(" "===n||a>=i)&&this.column+(i-a)>this.best_width&&(r=e.slice(a,i)+"\\",a<i&&(a=i),this.column+=r.length,this.stream.write(r,this.encoding),this.write_indent(),this.whitespace=!1,this.indentation=!1," "===e[a]&&(r="\\",this.column+=r.length,this.stream.write(r,this.encoding))),i++;return this.write_indicator('"',!1)},n.prototype.write_folded=function(e){var t,n,r,i,o,a,s,l,c,p,f,h,d;for(a=this.determine_block_hints(e),this.write_indicator(">"+a,!0),"+"===a.slice(-1)&&(this.open_ended=!0),this.write_line_break(),l=!0,n=!0,h=!1,d=o=0,f=[];o<=e.length;){if(r=e[o],n){if(null==r||u.call("\n…\u2028\u2029",r)<0){for(l||null==r||" "===r||"\n"!==e[d]||this.write_line_break(),l=" "===r,p=e.slice(d,o),s=0,c=p.length;s<c;s++)t=p[s],"\n"===t?this.write_line_break():this.write_line_break(t);null!=r&&this.write_indent(),d=o}}else h?" "!==r&&(d+1===o&&this.column>this.best_width?this.write_indent():(i=e.slice(d,o),this.column+=i.length,this.stream.write(i,this.encoding)),d=o):(null==r||u.call(" \n…\u2028\u2029",r)>=0)&&(i=e.slice(d,o),this.column+=i.length,this.stream.write(i,this.encoding),null==r&&this.write_line_break(),d=o);null!=r&&(n=u.call("\n…\u2028\u2029",r)>=0,h=" "===r),f.push(o++)}return f},n.prototype.write_literal=function(e){var t,n,r,i,o,a,s,l,c,p,f;for(a=this.determine_block_hints(e),this.write_indicator("|"+a,!0),"+"===a.slice(-1)&&(this.open_ended=!0),this.write_line_break(),n=!0,f=o=0,p=[];o<=e.length;){if(r=e[o],n){if(null==r||u.call("\n…\u2028\u2029",r)<0){for(c=e.slice(f,o),s=0,l=c.length;s<l;s++)t=c[s],"\n"===t?this.write_line_break():this.write_line_break(t);null!=r&&this.write_indent(),f=o}}else(null==r||u.call("\n…\u2028\u2029",r)>=0)&&(i=e.slice(f,o),this.stream.write(i,this.encoding),null==r&&this.write_line_break(),f=o);null!=r&&(n=u.call("\n…\u2028\u2029",r)>=0),p.push(o++)}return p},n.prototype.write_plain=function(e,t){var n,r,i,o,a,s,l,c,p,f,h;if(null==t&&(t=!0),e){for(this.root_context&&(this.open_ended=!0),this.whitespace||(o=" ",this.column+=o.length,this.stream.write(o,this.encoding)),this.whitespace=!1,this.indentation=!1,f=!1,r=!1,h=a=0,p=[];a<=e.length;){if(i=e[a],f)" "!==i&&(h+1===a&&this.column>this.best_width&&t?(this.write_indent(),this.whitespace=!1,this.indentation=!1):(o=e.slice(h,a),this.column+=o.length,this.stream.write(o,this.encoding)),h=a);else if(r){if(u.call("\n…\u2028\u2029",i)<0){for("\n"===e[h]&&this.write_line_break(),c=e.slice(h,a),s=0,l=c.length;s<l;s++)n=c[s],"\n"===n?this.write_line_break():this.write_line_break(n);this.write_indent(),this.whitespace=!1,this.indentation=!1,h=a}}else(null==i||u.call(" \n…\u2028\u2029",i)>=0)&&(o=e.slice(h,a),this.column+=o.length,this.stream.write(o,this.encoding),h=a);null!=i&&(f=" "===i,r=u.call("\n…\u2028\u2029",i)>=0),p.push(a++)}return p}},n.prototype.determine_block_hints=function(e){var t,n,r,i,o;return n="",t=e[0],r=e.length-2,o=e[r++],i=e[r++],u.call(" \n…\u2028\u2029",t)>=0&&(n+=this.best_indent),u.call("\n…\u2028\u2029",i)<0?n+="-":(1===e.length||u.call("\n…\u2028\u2029",o)>=0)&&(n+="+"),n},n.prototype.flush_stream=function(){var e;return"function"==typeof(e=this.stream).flush?e.flush():void 0},n.prototype.error=function(e,n){var r,i;throw n&&(n=null!=(r=null!=n&&null!=(i=n.constructor)?i.name:void 0)?r:o.inspect(n)),new t.EmitterError(e+(n?" "+n:""))},n}(),e=function(){function e(e,t,n,r,i,o,a,s){this.scalar=e,this.empty=t,this.multiline=n,this.allow_flow_plain=r,this.allow_block_plain=i,this.allow_single_quoted=o,this.allow_double_quoted=a,this.allow_block=s}return e}()}).call(this)},function(e,t,n){(function(){var e,t,r,i,o,a,s,u=[].slice;s=n(61),i=n(501),a=n(502),r=n(500),e=n(498),o=n(266),t=n(499),this.make_loader=function(n,l,c,p,f,h){var d;return null==n&&(n=i.Reader),null==l&&(l=a.Scanner),null==c&&(c=r.Parser),null==p&&(p=e.Composer),null==f&&(f=o.Resolver),null==h&&(h=t.Constructor),d=[n,l,c,p,f,h],function(){function e(e){var n,r,i;for(d[0].call(this,e),i=d.slice(1),n=0,r=i.length;n<r;n++)t=i[n],t.call(this)}var t;return s.extend.apply(s,[e.prototype].concat(u.call(function(){var e,n,r;for(r=[],e=0,n=d.length;e<n;e++)t=d[e],r.push(t.prototype);return r}()))),e}()},this.Loader=this.make_loader()}).call(this)},function(e,t,n){(function(){var e,r,i=function(e,t){function n(){this.constructor=e}for(var r in t)o.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},o={}.hasOwnProperty;r=n(94),e=n(45).YAMLError,this.RepresenterError=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return i(t,e),t}(e),this.BaseRepresenter=function(){function e(e){var t;t=null!=e?e:{},this.default_style=t.default_style,this.default_flow_style=t.default_flow_style,this.represented_objects={},this.object_keeper=[],this.alias_key=null}return e.prototype.yaml_representers_types=[],e.prototype.yaml_representers_handlers=[],e.prototype.yaml_multi_representers_types=[],e.prototype.yaml_multi_representers_handlers=[],e.add_representer=function(e,t){return this.prototype.hasOwnProperty("yaml_representers_types")||(this.prototype.yaml_representers_types=[].concat(this.prototype.yaml_representers_types)),this.prototype.hasOwnProperty("yaml_representers_handlers")||(this.prototype.yaml_representers_handlers=[].concat(this.prototype.yaml_representers_handlers)),this.prototype.yaml_representers_types.push(e),this.prototype.yaml_representers_handlers.push(t)},e.add_multi_representer=function(e,t){return this.prototype.hasOwnProperty("yaml_multi_representers_types")||(this.prototype.yaml_multi_representers_types=[].concat(this.prototype.yaml_multi_representers_types)),this.prototype.hasOwnProperty("yaml_multi_representers_handlers")||(this.prototype.yaml_multi_representers_handlers=[].concat(this.prototype.yaml_multi_representers_handlers)),this.prototype.yaml_multi_representers_types.push(e),this.prototype.yaml_multi_representers_handlers.push(t)},e.prototype.represent=function(e){var t;return t=this.represent_data(e),this.serialize(t),this.represented_objects={},this.object_keeper=[],this.alias_key=null},e.prototype.represent_data=function(e){var t,n,i,o,a,s,u;if(this.ignore_aliases(e))this.alias_key=null;else if(-1!==(n=this.object_keeper.indexOf(e))){if(this.alias_key=n,this.alias_key in this.represented_objects)return this.represented_objects[this.alias_key]}else this.alias_key=this.object_keeper.length,this.object_keeper.push(e);if(s=null,t=null===e?"null":typeof e,"object"===t&&(t=e.constructor),-1!==(n=this.yaml_representers_types.lastIndexOf(t))&&(s=this.yaml_representers_handlers[n]),null==s)for(a=this.yaml_multi_representers_types,n=i=0,o=a.length;i<o;n=++i)if(u=a[n],e instanceof u){s=this.yaml_multi_representers_handlers[n];break}return null==s&&(-1!==(n=this.yaml_multi_representers_types.lastIndexOf(void 0))?s=this.yaml_multi_representers_handlers[n]:-1!==(n=this.yaml_representers_types.lastIndexOf(void 0))&&(s=this.yaml_representers_handlers[n])),null!=s?s.call(this,e):new r.ScalarNode(null,""+e)},e.prototype.represent_scalar=function(e,t,n){var i;return null==n&&(n=this.default_style),i=new r.ScalarNode(e,t,null,null,n),null!=this.alias_key&&(this.represented_objects[this.alias_key]=i),i},e.prototype.represent_sequence=function(e,t,n){var i,o,a,s,u,l,c,p;for(p=[],u=new r.SequenceNode(e,p,null,null,n),null!=this.alias_key&&(this.represented_objects[this.alias_key]=u),i=!0,a=0,s=t.length;a<s;a++)o=t[a],l=this.represent_data(o),l instanceof r.ScalarNode||l.style||(i=!1),p.push(l);return null==n&&(u.flow_style=null!=(c=this.default_flow_style)?c:i),u},e.prototype.represent_mapping=function(e,t,n){var i,a,s,u,l,c,p,f;f=[],u=new r.MappingNode(e,f,n),this.alias_key&&(this.represented_objects[this.alias_key]=u),i=!0;for(a in t)o.call(t,a)&&(s=t[a],l=this.represent_data(a),c=this.represent_data(s),l instanceof r.ScalarNode||l.style||(i=!1),c instanceof r.ScalarNode||c.style||(i=!1),f.push([l,c]));return n||(u.flow_style=null!=(p=this.default_flow_style)?p:i),u},e.prototype.ignore_aliases=function(e){return!1},e}(),this.Representer=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return i(n,e),n.prototype.represent_boolean=function(e){return this.represent_scalar("tag:yaml.org,2002:bool",e?"true":"false")},n.prototype.represent_null=function(e){return this.represent_scalar("tag:yaml.org,2002:null","null")},n.prototype.represent_number=function(e){var t,n;return t="tag:yaml.org,2002:"+(e%1==0?"int":"float"),n=e!==e?".nan":Infinity===e?".inf":-Infinity===e?"-.inf":e.toString(),this.represent_scalar(t,n)},n.prototype.represent_string=function(e){return this.represent_scalar("tag:yaml.org,2002:str",e)},n.prototype.represent_array=function(e){return this.represent_sequence("tag:yaml.org,2002:seq",e)},n.prototype.represent_date=function(e){return this.represent_scalar("tag:yaml.org,2002:timestamp",e.toISOString())},n.prototype.represent_object=function(e){return this.represent_mapping("tag:yaml.org,2002:map",e)},n.prototype.represent_undefined=function(e){throw new t.RepresenterError("cannot represent an onbject: "+e)},n.prototype.ignore_aliases=function(e){var t;return null==e||("boolean"==(t=typeof e)||"number"===t||"string"===t)},n}(this.BaseRepresenter),this.Representer.add_representer("boolean",this.Representer.prototype.represent_boolean),this.Representer.add_representer("null",this.Representer.prototype.represent_null),this.Representer.add_representer("number",this.Representer.prototype.represent_number),this.Representer.add_representer("string",this.Representer.prototype.represent_string),this.Representer.add_representer(Array,this.Representer.prototype.represent_array),this.Representer.add_representer(Date,this.Representer.prototype.represent_date),this.Representer.add_representer(Object,this.Representer.prototype.represent_object),this.Representer.add_representer(null,this.Representer.prototype.represent_undefined)}).call(this)},function(e,t,n){(function(){var e,t,r,i,o=function(e,t){function n(){this.constructor=e}for(var r in t)a.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},a={}.hasOwnProperty;t=n(127),r=n(94),i=n(61),e=n(45).YAMLError,this.SerializerError=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return o(t,e),t}(e),this.Serializer=function(){function e(e){var t;t=null!=e?e:{},this.encoding=t.encoding,this.explicit_start=t.explicit_start,this.explicit_end=t.explicit_end,this.version=t.version,this.tags=t.tags,this.serialized_nodes={},this.anchors={},this.last_anchor_id=0,this.closed=null}return e.prototype.open=function(){if(null===this.closed)return this.emit(new t.StreamStartEvent(this.encoding)),this.closed=!1;throw this.closed?new SerializerError("serializer is closed"):new SerializerError("serializer is already open")},e.prototype.close=function(){if(null===this.closed)throw new SerializerError("serializer is not opened");if(!this.closed)return this.emit(new t.StreamEndEvent),this.closed=!0},e.prototype.serialize=function(e){if(null===this.closed)throw new SerializerError("serializer is not opened");if(this.closed)throw new SerializerError("serializer is closed");return null!=e&&(this.emit(new t.DocumentStartEvent(void 0,void 0,this.explicit_start,this.version,this.tags)),this.anchor_node(e),this.serialize_node(e),this.emit(new t.DocumentEndEvent(void 0,void 0,this.explicit_end))),this.serialized_nodes={},this.anchors={},this.last_anchor_id=0},e.prototype.anchor_node=function(e){var t,n,i,o,a,s,u,l,c,p,f,h,d,m;if(e.unique_id in this.anchors)return null!=(t=this.anchors)[l=e.unique_id]?t[l]:t[l]=this.generate_anchor(e);if(this.anchors[e.unique_id]=null,e instanceof r.SequenceNode){for(c=e.value,h=[],n=0,s=c.length;n<s;n++)i=c[n],h.push(this.anchor_node(i));return h}if(e instanceof r.MappingNode){for(p=e.value,d=[],o=0,u=p.length;o<u;o++)f=p[o],a=f[0],m=f[1],this.anchor_node(a),d.push(this.anchor_node(m));return d}},e.prototype.generate_anchor=function(e){return"id"+i.pad_left(++this.last_anchor_id,"0",4)},e.prototype.serialize_node=function(e,n,i){var o,a,s,u,l,c,p,f,h,d,m,v,g,y;if(o=this.anchors[e.unique_id],e.unique_id in this.serialized_nodes)return this.emit(new t.AliasEvent(o));if(this.serialized_nodes[e.unique_id]=!0,this.descend_resolver(n,i),e instanceof r.ScalarNode)s=this.resolve(r.ScalarNode,e.value,[!0,!1]),a=this.resolve(r.ScalarNode,e.value,[!1,!0]),l=[e.tag===s,e.tag===a],this.emit(new t.ScalarEvent(o,e.tag,l,e.value,void 0,void 0,e.style));else if(e instanceof r.SequenceNode){for(l=e.tag===this.resolve(r.SequenceNode,e.value,!0),this.emit(new t.SequenceStartEvent(o,e.tag,l,void 0,void 0,e.flow_style)),m=e.value,i=u=0,h=m.length;u<h;i=++u)c=m[i],this.serialize_node(c,e,i);this.emit(new t.SequenceEndEvent)}else if(e instanceof r.MappingNode){for(l=e.tag===this.resolve(r.MappingNode,e.value,!0),this.emit(new t.MappingStartEvent(o,e.tag,l,void 0,void 0,e.flow_style)),v=e.value,p=0,d=v.length;p<d;p++)g=v[p],f=g[0],y=g[1],this.serialize_node(f,e,null),this.serialize_node(y,e,f);this.emit(new t.MappingEndEvent)}return this.ascend_resolver()},e}()}).call(this)},function(e,t,n){(function(){var e,r,i;this.composer=n(498),this.constructor=n(499),e=this.dumper=n(1201),this.errors=n(45),this.events=n(127),r=this.loader=n(1203),this.nodes=n(94),this.parser=n(500),this.reader=n(501),this.resolver=n(266),this.scanner=n(502),this.tokens=n(267),i=n(61),this.scan=function(e,t){var n,i;for(null==t&&(t=r.Loader),n=new t(e),i=[];n.check_token();)i.push(n.get_token());return i},this.parse=function(e,t){var n,i;for(null==t&&(t=r.Loader),n=new t(e),i=[];n.check_event();)i.push(n.get_event());return i},this.compose=function(e,t){var n;return null==t&&(t=r.Loader),n=new t(e),n.get_single_node()},this.compose_all=function(e,t){var n,i;for(null==t&&(t=r.Loader),n=new t(e),i=[];n.check_node();)i.push(n.get_node());return i},this.load=function(e,t){var n;return null==t&&(t=r.Loader),n=new t(e),n.get_single_data()},this.load_all=function(e,t){var n,i;for(null==t&&(t=r.Loader),n=new t(e),i=[];n.check_data();)i.push(n.get_data());return i},this.emit=function(t,n,r,o){var a,s,u,l,c;null==r&&(r=e.Dumper),null==o&&(o={}),s=n||new i.StringStream,a=new r(s,o);try{for(l=0,c=t.length;l<c;l++)u=t[l],a.emit(u)}finally{a.dispose()}return n||s.string},this.serialize=function(n,r,i,o){return null==i&&(i=e.Dumper),null==o&&(o={}),t.serialize_all([n],r,i,o)},this.serialize_all=function(t,n,r,o){var a,s,u,l,c;null==r&&(r=e.Dumper),null==o&&(o={}),s=n||new i.StringStream,a=new r(s,o);try{for(a.open(),u=0,l=t.length;u<l;u++)c=t[u],a.serialize(c);a.close()}finally{a.dispose()}return n||s.string},this.dump=function(n,r,i,o){return null==i&&(i=e.Dumper),null==o&&(o={}),t.dump_all([n],r,i,o)},this.dump_all=function(t,n,r,o){var a,s,u,l,c;null==r&&(r=e.Dumper),null==o&&(o={}),s=n||new i.StringStream,a=new r(s,o);try{for(a.open(),l=0,c=t.length;l<c;l++)u=t[l],a.represent(u);a.close()}finally{a.dispose()}return n||s.string}}).call(this)},function(e,t,n){var r,i,o;!function(n,a){i=[],r=a(),void 0!==(o="function"==typeof r?r.apply(t,i):r)&&(e.exports=o)}(0,function(){"use strict";var e=function(e){return"getComputedStyle"in window&&"smooth"===window.getComputedStyle(e)["scroll-behavior"]};if("undefined"==typeof window||!("document"in window))return{};var t=function(t,n,r){n=n||999,r||0===r||(r=9);var i,o=function(e){i=e},a=function(){clearTimeout(i),o(0)},s=function(e){return Math.max(0,t.getTopOf(e)-r)},u=function(r,i,s){if(a(),0===i||i&&i<0||e(t.body))t.toY(r),s&&s();else{var u=t.getY(),l=Math.max(0,r)-u,c=(new Date).getTime();i=i||Math.min(Math.abs(l),n),function e(){o(setTimeout(function(){var n=Math.min(1,((new Date).getTime()-c)/i),r=Math.max(0,Math.floor(u+l*(n<.5?2*n*n:n*(4-2*n)-1)));t.toY(r),n<1&&t.getHeight()+r<t.body.scrollHeight?e():(setTimeout(a,99),s&&s())},9))}()}},l=function(e,t,n){u(s(e),t,n)},c=function(e,n,i){var o=e.getBoundingClientRect().height,a=t.getTopOf(e)+o,c=t.getHeight(),p=t.getY(),f=p+c;s(e)<p||o+r>c?l(e,n,i):a+r>f?u(a-c+r,n,i):i&&i()},p=function(e,n,r,i){u(Math.max(0,t.getTopOf(e)-t.getHeight()/2+(r||e.getBoundingClientRect().height/2)),n,i)};return{setup:function(e,t){return(0===e||e)&&(n=e),(0===t||t)&&(r=t),{defaultDuration:n,edgeOffset:r}},to:l,toY:u,intoView:c,center:p,stop:a,moving:function(){return!!i},getY:t.getY,getTopOf:t.getTopOf}},n=document.documentElement,r=function(){return window.scrollY||n.scrollTop},i=t({body:document.scrollingElement||document.body,toY:function(e){window.scrollTo(0,e)},getY:r,getHeight:function(){return window.innerHeight||n.clientHeight},getTopOf:function(e){return e.getBoundingClientRect().top+r()-n.offsetTop}});if(i.createScroller=function(e,r,i){return t({body:e,toY:function(t){e.scrollTop=t},getY:function(){return e.scrollTop},getHeight:function(){return Math.min(e.clientHeight,window.innerHeight||n.clientHeight)},getTopOf:function(e){return e.offsetTop}},r,i)},"addEventListener"in window&&!window.noZensmooth&&!e(document.body)){var o="scrollRestoration"in history;o&&(history.scrollRestoration="auto"),window.addEventListener("load",function(){o&&(setTimeout(function(){history.scrollRestoration="manual"},9),window.addEventListener("popstate",function(e){e.state&&"zenscrollY"in e.state&&i.toY(e.state.zenscrollY)},!1)),window.location.hash&&setTimeout(function(){var e=i.setup().edgeOffset;if(e){var t=document.getElementById(window.location.href.split("#")[1]);if(t){var n=Math.max(0,i.getTopOf(t)-e),r=i.getY()-n;0<=r&&r<9&&window.scrollTo(0,n)}}},9)},!1);var a=new RegExp("(^|\\s)noZensmooth(\\s|$)");window.addEventListener("click",function(e){for(var t=e.target;t&&"A"!==t.tagName;)t=t.parentNode;if(!(!t||1!==e.which||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)){if(o)try{history.replaceState({zenscrollY:i.getY()},"")}catch(e){}var n=t.getAttribute("href")||"";if(0===n.indexOf("#")&&!a.test(t.className)){var r=0,s=document.getElementById(n.substring(1));if("#"!==n){if(!s)return;r=i.getTopOf(s)}e.preventDefault();var u=function(){window.location=n},l=i.setup().edgeOffset;l&&(r=Math.max(0,r-l),u=function(){history.pushState(null,"",n)}),i.toY(r,null,u)}}},!1)}return i})},function(e,t,n){function r(e){return n(i(e))}function i(e){var t=o[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}var o={"./all.js":271,"./ast/ast.js":272,"./ast/index.js":273,"./ast/jump-to-path.jsx":274,"./auth/actions.js":168,"./auth/index.js":275,"./auth/reducers.js":276,"./auth/selectors.js":277,"./auth/spec-wrap-actions.js":278,"./configs/actions.js":169,"./configs/index.js":279,"./configs/reducers.js":280,"./configs/selectors.js":281,"./deep-linking/helpers.js":282,"./deep-linking/index.js":283,"./deep-linking/layout-wrap-actions.js":284,"./deep-linking/spec-wrap-actions.js":285,"./download-url.js":286,"./err/actions.js":128,"./err/error-transformers/hook.js":287,"./err/error-transformers/transformers/not-of-type.js":288,"./err/error-transformers/transformers/parameter-oneof.js":289,"./err/error-transformers/transformers/strip-instance.js":290,"./err/index.js":291,"./err/reducers.js":292,"./err/selectors.js":293,"./layout/actions.js":170,"./layout/index.js":294,"./layout/reducers.js":295,"./layout/selectors.js":296,"./logs/index.js":297,"./oas3/actions.js":171,"./oas3/auth-extensions/wrap-selectors.js":298,"./oas3/components/callbacks.jsx":299,"./oas3/components/http-auth.jsx":300,"./oas3/components/index.js":301,"./oas3/components/operation-link.jsx":302,"./oas3/components/operation-servers.jsx":303,"./oas3/components/request-body-editor.jsx":304,"./oas3/components/request-body.jsx":305,"./oas3/components/servers.jsx":306,"./oas3/helpers.js":34,"./oas3/index.js":307,"./oas3/reducers.js":308,"./oas3/selectors.js":309,"./oas3/spec-extensions/selectors.js":310,"./oas3/spec-extensions/wrap-selectors.js":311,"./oas3/wrap-components/auth-item.jsx":312,"./oas3/wrap-components/index.js":313,"./oas3/wrap-components/markdown.js":314,"./oas3/wrap-components/model.jsx":315,"./oas3/wrap-components/online-validator-badge.js":316,"./oas3/wrap-components/parameters.jsx":317,"./oas3/wrap-components/version-stamp.jsx":318,"./samples/fn.js":172,"./samples/index.js":319,"./spec/actions.js":173,"./spec/index.js":320,"./spec/reducers.js":321,"./spec/selectors.js":322,"./spec/wrap-actions.js":323,"./split-pane-mode/components/split-pane-mode.jsx":324,"./split-pane-mode/index.js":325,"./swagger-js/index.js":326,"./util/index.js":327,"./view/index.js":328,"./view/root-injects.js":329};r.keys=function(){return Object.keys(o)},r.resolve=i,e.exports=r,r.id=1208},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){n(505),e.exports=n(504)}])}); -//# sourceMappingURL=swagger-ui-bundle.js.map + */var r,o="";e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("expected a string");if(1===t)return e;if(2===t)return e+e;var n=e.length*t;if(r!==e||void 0===r)r=e,o="";else if(o.length>=n)return o.substr(0,n);for(;n>o.length&&t>1;)1&t&&(o+=e),t>>=1,e+=e;return o=(o+=e).substr(0,n)}},function(e,t,n){"use strict";var r=n(39).assign,o=n(981),i=n(983),a=n(994),s=n(1009),u=n(190),c={default:n(1028),full:n(1029),commonmark:n(1030)};function l(e,t,n){this.src=t,this.env=n,this.options=e.options,this.tokens=[],this.inlineMode=!1,this.inline=e.inline,this.block=e.block,this.renderer=e.renderer,this.typographer=e.typographer}function p(e,t){"string"!=typeof e&&(t=e,e="default"),this.inline=new s,this.block=new a,this.core=new i,this.renderer=new o,this.ruler=new u,this.options={},this.configure(c[e]),this.set(t||{})}p.prototype.set=function(e){r(this.options,e)},p.prototype.configure=function(e){var t=this;if(!e)throw new Error("Wrong `remarkable` preset, check name/content");e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enable(e.components[n].rules,!0)})},p.prototype.use=function(e,t){return e(this,t),this},p.prototype.parse=function(e,t){var n=new l(this,e,t);return this.core.process(n),n.tokens},p.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},p.prototype.parseInline=function(e,t){var n=new l(this,e,t);return n.inlineMode=!0,this.core.process(n),n.tokens},p.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},e.exports=p,e.exports.utils=n(39)},function(e,t,n){"use strict";var r=n(39),o=n(982);function i(){this.rules=r.assign({},o),this.getBreak=o.getBreak}e.exports=i,i.prototype.renderInline=function(e,t,n){for(var r=this.rules,o=e.length,i=0,a="";o--;)a+=r[e[i].type](e,i++,t,n,this);return a},i.prototype.render=function(e,t,n){for(var r=this.rules,o=e.length,i=-1,a="";++i<o;)"inline"===e[i].type?a+=this.renderInline(e[i].children,t,n):a+=r[e[i].type](e,i,t,n,this);return a}},function(e,t,n){"use strict";var r=n(39).has,o=n(39).unescapeMd,i=n(39).replaceEntities,a=n(39).escapeHtml,s={};s.blockquote_open=function(){return"<blockquote>\n"},s.blockquote_close=function(e,t){return"</blockquote>"+u(e,t)},s.code=function(e,t){return e[t].block?"<pre><code>"+a(e[t].content)+"</code></pre>"+u(e,t):"<code>"+a(e[t].content)+"</code>"},s.fence=function(e,t,n,s,c){var l,p,f=e[t],h="",d=n.langPrefix;if(f.params){if(p=(l=f.params.split(/\s+/g)).join(" "),r(c.rules.fence_custom,l[0]))return c.rules.fence_custom[l[0]](e,t,n,s,c);h=' class="'+d+a(i(o(p)))+'"'}return"<pre><code"+h+">"+(n.highlight&&n.highlight.apply(n.highlight,[f.content].concat(l))||a(f.content))+"</code></pre>"+u(e,t)},s.fence_custom={},s.heading_open=function(e,t){return"<h"+e[t].hLevel+">"},s.heading_close=function(e,t){return"</h"+e[t].hLevel+">\n"},s.hr=function(e,t,n){return(n.xhtmlOut?"<hr />":"<hr>")+u(e,t)},s.bullet_list_open=function(){return"<ul>\n"},s.bullet_list_close=function(e,t){return"</ul>"+u(e,t)},s.list_item_open=function(){return"<li>"},s.list_item_close=function(){return"</li>\n"},s.ordered_list_open=function(e,t){var n=e[t];return"<ol"+(n.order>1?' start="'+n.order+'"':"")+">\n"},s.ordered_list_close=function(e,t){return"</ol>"+u(e,t)},s.paragraph_open=function(e,t){return e[t].tight?"":"<p>"},s.paragraph_close=function(e,t){var n=!(e[t].tight&&t&&"inline"===e[t-1].type&&!e[t-1].content);return(e[t].tight?"":"</p>")+(n?u(e,t):"")},s.link_open=function(e,t,n){var r=e[t].title?' title="'+a(i(e[t].title))+'"':"",o=n.linkTarget?' target="'+n.linkTarget+'"':"";return'<a href="'+a(e[t].href)+'"'+r+o+">"},s.link_close=function(){return"</a>"},s.image=function(e,t,n){var r=' src="'+a(e[t].src)+'"',s=e[t].title?' title="'+a(i(e[t].title))+'"':"";return"<img"+r+(' alt="'+(e[t].alt?a(i(o(e[t].alt))):"")+'"')+s+(n.xhtmlOut?" /":"")+">"},s.table_open=function(){return"<table>\n"},s.table_close=function(){return"</table>\n"},s.thead_open=function(){return"<thead>\n"},s.thead_close=function(){return"</thead>\n"},s.tbody_open=function(){return"<tbody>\n"},s.tbody_close=function(){return"</tbody>\n"},s.tr_open=function(){return"<tr>"},s.tr_close=function(){return"</tr>\n"},s.th_open=function(e,t){var n=e[t];return"<th"+(n.align?' style="text-align:'+n.align+'"':"")+">"},s.th_close=function(){return"</th>"},s.td_open=function(e,t){var n=e[t];return"<td"+(n.align?' style="text-align:'+n.align+'"':"")+">"},s.td_close=function(){return"</td>"},s.strong_open=function(){return"<strong>"},s.strong_close=function(){return"</strong>"},s.em_open=function(){return"<em>"},s.em_close=function(){return"</em>"},s.del_open=function(){return"<del>"},s.del_close=function(){return"</del>"},s.ins_open=function(){return"<ins>"},s.ins_close=function(){return"</ins>"},s.mark_open=function(){return"<mark>"},s.mark_close=function(){return"</mark>"},s.sub=function(e,t){return"<sub>"+a(e[t].content)+"</sub>"},s.sup=function(e,t){return"<sup>"+a(e[t].content)+"</sup>"},s.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},s.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},s.text=function(e,t){return a(e[t].content)},s.htmlblock=function(e,t){return e[t].content},s.htmltag=function(e,t){return e[t].content},s.abbr_open=function(e,t){return'<abbr title="'+a(i(e[t].title))+'">'},s.abbr_close=function(){return"</abbr>"},s.footnote_ref=function(e,t){var n=Number(e[t].id+1).toString(),r="fnref"+n;return e[t].subId>0&&(r+=":"+e[t].subId),'<sup class="footnote-ref"><a href="#fn'+n+'" id="'+r+'">['+n+"]</a></sup>"},s.footnote_block_open=function(e,t,n){return(n.xhtmlOut?'<hr class="footnotes-sep" />\n':'<hr class="footnotes-sep">\n')+'<section class="footnotes">\n<ol class="footnotes-list">\n'},s.footnote_block_close=function(){return"</ol>\n</section>\n"},s.footnote_open=function(e,t){return'<li id="fn'+Number(e[t].id+1).toString()+'" class="footnote-item">'},s.footnote_close=function(){return"</li>\n"},s.footnote_anchor=function(e,t){var n="fnref"+Number(e[t].id+1).toString();return e[t].subId>0&&(n+=":"+e[t].subId),' <a href="#'+n+'" class="footnote-backref">↩</a>'},s.dl_open=function(){return"<dl>\n"},s.dt_open=function(){return"<dt>"},s.dd_open=function(){return"<dd>"},s.dl_close=function(){return"</dl>\n"},s.dt_close=function(){return"</dt>\n"},s.dd_close=function(){return"</dd>\n"};var u=s.getBreak=function(e,t){return(t=function e(t,n){return++n>=t.length-2?n:"paragraph_open"===t[n].type&&t[n].tight&&"inline"===t[n+1].type&&0===t[n+1].content.length&&"paragraph_close"===t[n+2].type&&t[n+2].tight?e(t,n+2):n}(e,t))<e.length&&"list_item_close"===e[t].type?"":"\n"};e.exports=s},function(e,t,n){"use strict";var r=n(190),o=[["block",n(984)],["abbr",n(985)],["references",n(986)],["inline",n(987)],["footnote_tail",n(988)],["abbr2",n(989)],["replacements",n(990)],["smartquotes",n(991)],["linkify",n(992)]];function i(){this.options={},this.ruler=new r;for(var e=0;e<o.length;e++)this.ruler.push(o[e][0],o[e][1])}i.prototype.process=function(e){var t,n,r;for(t=0,n=(r=this.ruler.getRules("")).length;t<n;t++)r[t](e)},e.exports=i},function(e,t,n){"use strict";e.exports=function(e){e.inlineMode?e.tokens.push({type:"inline",content:e.src.replace(/\n/g," ").trim(),level:0,lines:[0,1],children:[]}):e.block.parse(e.src,e.options,e.env,e.tokens)}},function(e,t,n){"use strict";var r=n(269),o=n(191);function i(e,t,n,i){var a,s,u,c,l,p;if(42!==e.charCodeAt(0))return-1;if(91!==e.charCodeAt(1))return-1;if(-1===e.indexOf("]:"))return-1;if(a=new r(e,t,n,i,[]),(s=o(a,1))<0||58!==e.charCodeAt(s+1))return-1;for(c=a.posMax,u=s+2;u<c&&10!==a.src.charCodeAt(u);u++);return l=e.slice(2,s),0===(p=e.slice(s+2,u).trim()).length?-1:(i.abbreviations||(i.abbreviations={}),void 0===i.abbreviations[":"+l]&&(i.abbreviations[":"+l]=p),u)}e.exports=function(e){var t,n,r,o,a=e.tokens;if(!e.inlineMode)for(t=1,n=a.length-1;t<n;t++)if("paragraph_open"===a[t-1].type&&"inline"===a[t].type&&"paragraph_close"===a[t+1].type){for(r=a[t].content;r.length&&!((o=i(r,e.inline,e.options,e.env))<0);)r=r.slice(o).trim();a[t].content=r,r.length||(a[t-1].tight=!0,a[t+1].tight=!0)}}},function(e,t,n){"use strict";var r=n(269),o=n(191),i=n(464),a=n(466),s=n(467);function u(e,t,n,u){var c,l,p,f,h,d,m,v,g;if(91!==e.charCodeAt(0))return-1;if(-1===e.indexOf("]:"))return-1;if(c=new r(e,t,n,u,[]),(l=o(c,0))<0||58!==e.charCodeAt(l+1))return-1;for(f=c.posMax,p=l+2;p<f&&(32===(h=c.src.charCodeAt(p))||10===h);p++);if(!i(c,p))return-1;for(m=c.linkContent,d=p=c.pos,p+=1;p<f&&(32===(h=c.src.charCodeAt(p))||10===h);p++);for(p<f&&d!==p&&a(c,p)?(v=c.linkContent,p=c.pos):(v="",p=d);p<f&&32===c.src.charCodeAt(p);)p++;return p<f&&10!==c.src.charCodeAt(p)?-1:(g=s(e.slice(1,l)),void 0===u.references[g]&&(u.references[g]={title:v,href:m}),p)}e.exports=function(e){var t,n,r,o,i=e.tokens;if(e.env.references=e.env.references||{},!e.inlineMode)for(t=1,n=i.length-1;t<n;t++)if("inline"===i[t].type&&"paragraph_open"===i[t-1].type&&"paragraph_close"===i[t+1].type){for(r=i[t].content;r.length&&!((o=u(r,e.inline,e.options,e.env))<0);)r=r.slice(o).trim();i[t].content=r,r.length||(i[t-1].tight=!0,i[t+1].tight=!0)}}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r,o=e.tokens;for(n=0,r=o.length;n<r;n++)"inline"===(t=o[n]).type&&e.inline.parse(t.content,e.options,e.env,t.children)}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r,o,i,a,s,u,c,l=0,p=!1,f={};if(e.env.footnotes&&(e.tokens=e.tokens.filter(function(e){return"footnote_reference_open"===e.type?(p=!0,u=[],c=e.label,!1):"footnote_reference_close"===e.type?(p=!1,f[":"+c]=u,!1):(p&&u.push(e),!p)}),e.env.footnotes.list)){for(a=e.env.footnotes.list,e.tokens.push({type:"footnote_block_open",level:l++}),t=0,n=a.length;t<n;t++){for(e.tokens.push({type:"footnote_open",id:t,level:l++}),a[t].tokens?((s=[]).push({type:"paragraph_open",tight:!1,level:l++}),s.push({type:"inline",content:"",level:l,children:a[t].tokens}),s.push({type:"paragraph_close",tight:!1,level:--l})):a[t].label&&(s=f[":"+a[t].label]),e.tokens=e.tokens.concat(s),i="paragraph_close"===e.tokens[e.tokens.length-1].type?e.tokens.pop():null,o=a[t].count>0?a[t].count:1,r=0;r<o;r++)e.tokens.push({type:"footnote_anchor",id:t,subId:r,level:l});i&&e.tokens.push(i),e.tokens.push({type:"footnote_close",level:--l})}e.tokens.push({type:"footnote_block_close",level:--l})}}},function(e,t,n){"use strict";function r(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1")}e.exports=function(e){var t,n,o,i,a,s,u,c,l,p,f,h,d=e.tokens;if(e.env.abbreviations)for(e.env.abbrRegExp||(h="(^|["+" \n()[]'\".,!?-".split("").map(r).join("")+"])("+Object.keys(e.env.abbreviations).map(function(e){return e.substr(1)}).sort(function(e,t){return t.length-e.length}).map(r).join("|")+")($|["+" \n()[]'\".,!?-".split("").map(r).join("")+"])",e.env.abbrRegExp=new RegExp(h,"g")),p=e.env.abbrRegExp,n=0,o=d.length;n<o;n++)if("inline"===d[n].type)for(t=(i=d[n].children).length-1;t>=0;t--)if("text"===(a=i[t]).type){for(c=0,s=a.content,p.lastIndex=0,l=a.level,u=[];f=p.exec(s);)p.lastIndex>c&&u.push({type:"text",content:s.slice(c,f.index+f[1].length),level:l}),u.push({type:"abbr_open",title:e.env.abbreviations[":"+f[2]],level:l++}),u.push({type:"text",content:f[2],level:l}),u.push({type:"abbr_close",level:--l}),c=p.lastIndex-f[3].length;u.length&&(c<s.length&&u.push({type:"text",content:s.slice(c),level:l}),d[n].children=i=[].concat(i.slice(0,t),u,i.slice(t+1)))}}},function(e,t,n){"use strict";var r=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,o=/\((c|tm|r|p)\)/gi,i={c:"©",r:"®",p:"§",tm:"™"};e.exports=function(e){var t,n,a,s,u,c;if(e.options.typographer)for(u=e.tokens.length-1;u>=0;u--)if("inline"===e.tokens[u].type)for(t=(s=e.tokens[u].children).length-1;t>=0;t--)"text"===(n=s[t]).type&&(a=n.content,a=(c=a).indexOf("(")<0?c:c.replace(o,function(e,t){return i[t.toLowerCase()]}),r.test(a)&&(a=a.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),n.content=a)}},function(e,t,n){"use strict";var r=/['"]/,o=/['"]/g,i=/[-\s()\[\]]/;function a(e,t){return!(t<0||t>=e.length)&&!i.test(e[t])}function s(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}e.exports=function(e){var t,n,i,u,c,l,p,f,h,d,m,v,g,y,b,_,w;if(e.options.typographer)for(w=[],b=e.tokens.length-1;b>=0;b--)if("inline"===e.tokens[b].type)for(_=e.tokens[b].children,w.length=0,t=0;t<_.length;t++)if("text"===(n=_[t]).type&&!r.test(n.text)){for(p=_[t].level,g=w.length-1;g>=0&&!(w[g].level<=p);g--);w.length=g+1,c=0,l=(i=n.content).length;e:for(;c<l&&(o.lastIndex=c,u=o.exec(i));)if(f=!a(i,u.index-1),c=u.index+1,y="'"===u[0],(h=!a(i,c))||f){if(m=!h,v=!f)for(g=w.length-1;g>=0&&(d=w[g],!(w[g].level<p));g--)if(d.single===y&&w[g].level===p){d=w[g],y?(_[d.token].content=s(_[d.token].content,d.pos,e.options.quotes[2]),n.content=s(n.content,u.index,e.options.quotes[3])):(_[d.token].content=s(_[d.token].content,d.pos,e.options.quotes[0]),n.content=s(n.content,u.index,e.options.quotes[1])),w.length=g;continue e}m?w.push({token:t,pos:u.index,single:y,level:p}):v&&y&&(n.content=s(n.content,u.index,"’"))}else y&&(n.content=s(n.content,u.index,"’"))}}},function(e,t,n){"use strict";var r=n(993),o=/www|@|\:\/\//;function i(e){return/^<\/a\s*>/i.test(e)}function a(){var e=[],t=new r({stripPrefix:!1,url:!0,email:!0,twitter:!1,replaceFn:function(t,n){switch(n.getType()){case"url":e.push({text:n.matchedText,url:n.getUrl()});break;case"email":e.push({text:n.matchedText,url:"mailto:"+n.getEmail().replace(/^mailto:/i,"")})}return!1}});return{links:e,autolinker:t}}e.exports=function(e){var t,n,r,s,u,c,l,p,f,h,d,m,v,g,y=e.tokens,b=null;if(e.options.linkify)for(n=0,r=y.length;n<r;n++)if("inline"===y[n].type)for(d=0,t=(s=y[n].children).length-1;t>=0;t--)if("link_close"!==(u=s[t]).type){if("htmltag"===u.type&&(g=u.content,/^<a[>\s]/i.test(g)&&d>0&&d--,i(u.content)&&d++),!(d>0)&&"text"===u.type&&o.test(u.content)){if(b||(m=(b=a()).links,v=b.autolinker),c=u.content,m.length=0,v.link(c),!m.length)continue;for(l=[],h=u.level,p=0;p<m.length;p++)e.inline.validateLink(m[p].url)&&((f=c.indexOf(m[p].text))&&(h=h,l.push({type:"text",content:c.slice(0,f),level:h})),l.push({type:"link_open",href:m[p].url,title:"",level:h++}),l.push({type:"text",content:m[p].text,level:h}),l.push({type:"link_close",level:--h}),c=c.slice(f+m[p].text.length));c.length&&l.push({type:"text",content:c,level:h}),y[n].children=s=[].concat(s.slice(0,t),l,s.slice(t+1))}}else for(t--;s[t].level!==u.level&&"link_open"!==s[t].type;)t--}},function(e,t,n){var r,o,i; +/*! + * Autolinker.js + * 0.28.1 + * + * Copyright(c) 2016 Gregory Jacobs <greg@greg-jacobs.com> + * MIT License + * + * https://github.com/gregjacobs/Autolinker.js + */o=[],void 0===(i="function"==typeof(r=function(){var e,t,n,r,o,i,a,s=function(e){e=e||{},this.version=s.version,this.urls=this.normalizeUrlsCfg(e.urls),this.email="boolean"!=typeof e.email||e.email,this.twitter="boolean"!=typeof e.twitter||e.twitter,this.phone="boolean"!=typeof e.phone||e.phone,this.hashtag=e.hashtag||!1,this.newWindow="boolean"!=typeof e.newWindow||e.newWindow,this.stripPrefix="boolean"!=typeof e.stripPrefix||e.stripPrefix;var t=this.hashtag;if(!1!==t&&"twitter"!==t&&"facebook"!==t&&"instagram"!==t)throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(e.truncate),this.className=e.className||"",this.replaceFn=e.replaceFn||null,this.htmlParser=null,this.matchers=null,this.tagBuilder=null};return s.link=function(e,t){return new s(t).link(e)},s.version="0.28.1",s.prototype={constructor:s,normalizeUrlsCfg:function(e){return null==e&&(e=!0),"boolean"==typeof e?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:"boolean"!=typeof e.schemeMatches||e.schemeMatches,wwwMatches:"boolean"!=typeof e.wwwMatches||e.wwwMatches,tldMatches:"boolean"!=typeof e.tldMatches||e.tldMatches}},normalizeTruncateCfg:function(e){return"number"==typeof e?{length:e,location:"end"}:s.Util.defaults(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},parse:function(e){for(var t=this.getHtmlParser().parse(e),n=0,r=[],o=0,i=t.length;o<i;o++){var a=t[o],s=a.getType();if("element"===s&&"a"===a.getTagName())a.isClosing()?n=Math.max(n-1,0):n++;else if("text"===s&&0===n){var u=this.parseText(a.getText(),a.getOffset());r.push.apply(r,u)}}return r=this.compactMatches(r),r=this.removeUnwantedMatches(r)},compactMatches:function(e){e.sort(function(e,t){return e.getOffset()-t.getOffset()});for(var t=0;t<e.length-1;t++)for(var n=e[t],r=n.getOffset()+n.getMatchedText().length;t+1<e.length&&e[t+1].getOffset()<=r;)e.splice(t+1,1);return e},removeUnwantedMatches:function(e){var t=s.Util.remove;return this.hashtag||t(e,function(e){return"hashtag"===e.getType()}),this.email||t(e,function(e){return"email"===e.getType()}),this.phone||t(e,function(e){return"phone"===e.getType()}),this.twitter||t(e,function(e){return"twitter"===e.getType()}),this.urls.schemeMatches||t(e,function(e){return"url"===e.getType()&&"scheme"===e.getUrlMatchType()}),this.urls.wwwMatches||t(e,function(e){return"url"===e.getType()&&"www"===e.getUrlMatchType()}),this.urls.tldMatches||t(e,function(e){return"url"===e.getType()&&"tld"===e.getUrlMatchType()}),e},parseText:function(e,t){t=t||0;for(var n=this.getMatchers(),r=[],o=0,i=n.length;o<i;o++){for(var a=n[o].parseMatches(e),s=0,u=a.length;s<u;s++)a[s].setOffset(t+a[s].getOffset());r.push.apply(r,a)}return r},link:function(e){if(!e)return"";for(var t=this.parse(e),n=[],r=0,o=0,i=t.length;o<i;o++){var a=t[o];n.push(e.substring(r,a.getOffset())),n.push(this.createMatchReturnVal(a)),r=a.getOffset()+a.getMatchedText().length}return n.push(e.substring(r)),n.join("")},createMatchReturnVal:function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this,this,e)),"string"==typeof t?t:!1===t?e.getMatchedText():t instanceof s.HtmlTag?t.toAnchorString():e.buildTag().toAnchorString()},getHtmlParser:function(){var e=this.htmlParser;return e||(e=this.htmlParser=new s.htmlParser.HtmlParser),e},getMatchers:function(){if(this.matchers)return this.matchers;var e=s.matcher,t=this.getTagBuilder(),n=[new e.Hashtag({tagBuilder:t,serviceName:this.hashtag}),new e.Email({tagBuilder:t}),new e.Phone({tagBuilder:t}),new e.Twitter({tagBuilder:t}),new e.Url({tagBuilder:t,stripPrefix:this.stripPrefix})];return this.matchers=n},getTagBuilder:function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new s.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e}},s.match={},s.matcher={},s.htmlParser={},s.truncate={},s.Util={abstractMethod:function(){throw"abstract"},trimRegex:/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,assign:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},defaults:function(e,t){for(var n in t)t.hasOwnProperty(n)&&void 0===e[n]&&(e[n]=t[n]);return e},extend:function(e,t){var n,r=e.prototype,o=function(){};o.prototype=r;var i=(n=t.hasOwnProperty("constructor")?t.constructor:function(){r.constructor.apply(this,arguments)}).prototype=new o;return i.constructor=n,i.superclass=r,delete t.constructor,s.Util.assign(i,t),n},ellipsis:function(e,t,n){return e.length>t&&(n=null==n?"..":n,e=e.substring(0,t-n.length)+n),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},remove:function(e,t){for(var n=e.length-1;n>=0;n--)!0===t(e[n])&&e.splice(n,1)},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var n,r=[],o=0;n=t.exec(e);)r.push(e.substring(o,n.index)),r.push(n[0]),o=n.index+n[0].length;return r.push(e.substring(o)),r},trim:function(e){return e.replace(this.trimRegex,"")}},s.HtmlTag=s.Util.extend(Object,{whitespaceRegex:/\s+/,constructor:function(e){s.Util.assign(this,e),this.innerHtml=this.innerHtml||this.innerHTML},setTagName:function(e){return this.tagName=e,this},getTagName:function(){return this.tagName||""},setAttr:function(e,t){return this.getAttrs()[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(e){var t=this.getAttrs();return s.Util.assign(t,e),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,o=s.Util.indexOf,i=n?n.split(r):[],a=e.split(r);t=a.shift();)-1===o(i,t)&&i.push(t);return this.getAttrs().class=i.join(" "),this},removeClass:function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,o=s.Util.indexOf,i=n?n.split(r):[],a=e.split(r);i.length&&(t=a.shift());){var u=o(i,t);-1!==u&&i.splice(u,1)}return this.getAttrs().class=i.join(" "),this},getClass:function(){return this.getAttrs().class||""},hasClass:function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},setInnerHtml:function(e){return this.innerHtml=e,this},getInnerHtml:function(){return this.innerHtml||""},toAnchorString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+'="'+e[n]+'"');return t.join(" ")}}),s.RegexLib={alphaNumericCharsStr:a="A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢴऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛱ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿕ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞭꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ0-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯෦-෯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꧰-꧹꩐-꩙꯰-꯹0-9",domainNameRegex:new RegExp("["+a+".\\-]*["+a+"\\-]"),tldRegex:/(?:travelersinsurance|sandvikcoromant|kerryproperties|cancerresearch|weatherchannel|kerrylogistics|spreadbetting|international|wolterskluwer|lifeinsurance|construction|pamperedchef|scholarships|versicherung|bridgestone|creditunion|kerryhotels|investments|productions|blackfriday|enterprises|lamborghini|photography|motorcycles|williamhill|playstation|contractors|barclaycard|accountants|redumbrella|engineering|management|telefonica|protection|consulting|tatamotors|creditcard|vlaanderen|schaeffler|associates|properties|foundation|republican|bnpparibas|boehringer|eurovision|extraspace|industries|immobilien|university|technology|volkswagen|healthcare|restaurant|cuisinella|vistaprint|apartments|accountant|travelers|homedepot|institute|vacations|furniture|fresenius|insurance|christmas|bloomberg|solutions|barcelona|firestone|financial|kuokgroup|fairwinds|community|passagens|goldpoint|equipment|lifestyle|yodobashi|aquarelle|marketing|analytics|education|amsterdam|statefarm|melbourne|allfinanz|directory|microsoft|stockholm|montblanc|accenture|lancaster|landrover|everbank|istanbul|graphics|grainger|ipiranga|softbank|attorney|pharmacy|saarland|catering|airforce|yokohama|mortgage|frontier|mutuelle|stcgroup|memorial|pictures|football|symantec|cipriani|ventures|telecity|cityeats|verisign|flsmidth|boutique|cleaning|firmdale|clinique|clothing|redstone|infiniti|deloitte|feedback|services|broadway|plumbing|commbank|training|barclays|exchange|computer|brussels|software|delivery|barefoot|builders|business|bargains|engineer|holdings|download|security|helsinki|lighting|movistar|discount|hdfcbank|supplies|marriott|property|diamonds|capetown|partners|democrat|jpmorgan|bradesco|budapest|rexroth|zuerich|shriram|academy|science|support|youtube|singles|surgery|alibaba|statoil|dentist|schwarz|android|cruises|cricket|digital|markets|starhub|systems|courses|coupons|netbank|country|domains|corsica|network|neustar|realtor|lincoln|limited|schmidt|yamaxun|cooking|contact|auction|spiegel|liaison|leclerc|latrobe|lasalle|abogado|compare|lanxess|exposed|express|company|cologne|college|avianca|lacaixa|fashion|recipes|ferrero|komatsu|storage|wanggou|clubmed|sandvik|fishing|fitness|bauhaus|kitchen|flights|florist|flowers|watches|weather|temasek|samsung|bentley|forsale|channel|theater|frogans|theatre|okinawa|website|tickets|jewelry|gallery|tiffany|iselect|shiksha|brother|organic|wedding|genting|toshiba|origins|philips|hyundai|hotmail|hoteles|hosting|rentals|windows|cartier|bugatti|holiday|careers|whoswho|hitachi|panerai|caravan|reviews|guitars|capital|trading|hamburg|hangout|finance|stream|family|abbott|health|review|travel|report|hermes|hiphop|gratis|career|toyota|hockey|dating|repair|google|social|soccer|reisen|global|otsuka|giving|unicom|casino|photos|center|broker|rocher|orange|bostik|garden|insure|ryukyu|bharti|safety|physio|sakura|oracle|online|jaguar|gallup|piaget|tienda|futbol|pictet|joburg|webcam|berlin|office|juegos|kaufen|chanel|chrome|xihuan|church|tennis|circle|kinder|flickr|bayern|claims|clinic|viajes|nowruz|xperia|norton|yachts|studio|coffee|camera|sanofi|nissan|author|expert|events|comsec|lawyer|tattoo|viking|estate|villas|condos|realty|yandex|energy|emerck|virgin|vision|durban|living|school|coupon|london|taobao|natura|taipei|nagoya|luxury|walter|aramco|sydney|madrid|credit|maison|makeup|schule|market|anquan|direct|design|swatch|suzuki|alsace|vuelos|dental|alipay|voyage|shouji|voting|airtel|mutual|degree|supply|agency|museum|mobily|dealer|monash|select|mormon|active|moscow|racing|datsun|quebec|nissay|rodeo|email|gifts|works|photo|chloe|edeka|cheap|earth|vista|tushu|koeln|glass|shoes|globo|tunes|gmail|nokia|space|kyoto|black|ricoh|seven|lamer|sener|epson|cisco|praxi|trust|citic|crown|shell|lease|green|legal|lexus|ninja|tatar|gripe|nikon|group|video|wales|autos|gucci|party|nexus|guide|linde|adult|parts|amica|lixil|boats|azure|loans|locus|cymru|lotte|lotto|stada|click|poker|quest|dabur|lupin|nadex|paris|faith|dance|canon|place|gives|trade|skype|rocks|mango|cloud|boots|smile|final|swiss|homes|honda|media|horse|cards|deals|watch|bosch|house|pizza|miami|osaka|tours|total|xerox|coach|sucks|style|delta|toray|iinet|tools|money|codes|beats|tokyo|salon|archi|movie|baidu|study|actor|yahoo|store|apple|world|forex|today|bible|tmall|tirol|irish|tires|forum|reise|vegas|vodka|sharp|omega|weber|jetzt|audio|promo|build|bingo|chase|gallo|drive|dubai|rehab|press|solar|sale|beer|bbva|bank|band|auto|sapo|sarl|saxo|audi|asia|arte|arpa|army|yoga|ally|zara|scor|scot|sexy|seat|zero|seek|aero|adac|zone|aarp|maif|meet|meme|menu|surf|mini|mobi|mtpc|porn|desi|star|ltda|name|talk|navy|love|loan|live|link|news|limo|like|spot|life|nico|lidl|lgbt|land|taxi|team|tech|kred|kpmg|sony|song|kiwi|kddi|jprs|jobs|sohu|java|itau|tips|info|immo|icbc|hsbc|town|host|page|toys|here|help|pars|haus|guru|guge|tube|goog|golf|gold|sncf|gmbh|gift|ggee|gent|gbiz|game|vana|pics|fund|ford|ping|pink|fish|film|fast|farm|play|fans|fail|plus|skin|pohl|fage|moda|post|erni|dvag|prod|doha|prof|docs|viva|diet|luxe|site|dell|sina|dclk|show|qpon|date|vote|cyou|voto|read|coop|cool|wang|club|city|chat|cern|cash|reit|rent|casa|cars|care|camp|rest|call|cafe|weir|wien|rich|wiki|buzz|wine|book|bond|room|work|rsvp|shia|ruhr|blue|bing|shaw|bike|safe|xbox|best|pwc|mtn|lds|aig|boo|fyi|nra|nrw|ntt|car|gal|obi|zip|aeg|vin|how|one|ong|onl|dad|ooo|bet|esq|org|htc|bar|uol|ibm|ovh|gdn|ice|icu|uno|gea|ifm|bot|top|wtf|lol|day|pet|eus|wtc|ubs|tvs|aco|ing|ltd|ink|tab|abb|afl|cat|int|pid|pin|bid|cba|gle|com|cbn|ads|man|wed|ceb|gmo|sky|ist|gmx|tui|mba|fan|ski|iwc|app|pro|med|ceo|jcb|jcp|goo|dev|men|aaa|meo|pub|jlc|bom|jll|gop|jmp|mil|got|gov|win|jot|mma|joy|trv|red|cfa|cfd|bio|moe|moi|mom|ren|biz|aws|xin|bbc|dnp|buy|kfh|mov|thd|xyz|fit|kia|rio|rip|kim|dog|vet|nyc|bcg|mtr|bcn|bms|bmw|run|bzh|rwe|tel|stc|axa|kpn|fly|krd|cab|bnl|foo|crs|eat|tci|sap|srl|nec|sas|net|cal|sbs|sfr|sca|scb|csc|edu|new|xxx|hiv|fox|wme|ngo|nhk|vip|sex|frl|lat|yun|law|you|tax|soy|sew|om|ac|hu|se|sc|sg|sh|sb|sa|rw|ru|rs|ro|re|qa|py|si|pw|pt|ps|sj|sk|pr|pn|pm|pl|sl|sm|pk|sn|ph|so|pg|pf|pe|pa|zw|nz|nu|nr|np|no|nl|ni|ng|nf|sr|ne|st|nc|na|mz|my|mx|mw|mv|mu|mt|ms|mr|mq|mp|mo|su|mn|mm|ml|mk|mh|mg|me|sv|md|mc|sx|sy|ma|ly|lv|sz|lu|lt|ls|lr|lk|li|lc|lb|la|tc|kz|td|ky|kw|kr|kp|kn|km|ki|kh|tf|tg|th|kg|ke|jp|jo|jm|je|it|is|ir|tj|tk|tl|tm|iq|tn|to|io|in|im|il|ie|ad|sd|ht|hr|hn|hm|tr|hk|gy|gw|gu|gt|gs|gr|gq|tt|gp|gn|gm|gl|tv|gi|tw|tz|ua|gh|ug|uk|gg|gf|ge|gd|us|uy|uz|va|gb|ga|vc|ve|fr|fo|fm|fk|fj|vg|vi|fi|eu|et|es|er|eg|ee|ec|dz|do|dm|dk|vn|dj|de|cz|cy|cx|cw|vu|cv|cu|cr|co|cn|cm|cl|ck|ci|ch|cg|cf|cd|cc|ca|wf|bz|by|bw|bv|bt|bs|br|bo|bn|bm|bj|bi|ws|bh|bg|bf|be|bd|bb|ba|az|ax|aw|au|at|as|ye|ar|aq|ao|am|al|yt|ai|za|ag|af|ae|zm|id)\b/},s.AnchorTagBuilder=s.Util.extend(Object,{constructor:function(e){s.Util.assign(this,e)},build:function(e){return new s.HtmlTag({tagName:"a",attrs:this.createAttrs(e.getType(),e.getAnchorHref()),innerHtml:this.processAnchorText(e.getAnchorText())})},createAttrs:function(e,t){var n={href:t},r=this.createCssClass(e);return r&&(n.class=r),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),n},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(e){var t=this.truncate;if(!t||!t.length)return e;var n=t.length,r=t.location;return"smart"===r?s.truncate.TruncateSmart(e,n,".."):"middle"===r?s.truncate.TruncateMiddle(e,n,".."):s.truncate.TruncateEnd(e,n,"..")}}),s.htmlParser.HtmlParser=s.Util.extend(Object,{htmlRegex:(o=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,i=/[^\s"'>\/=\x00-\x1F\x7F]+/.source+"(?:\\s*=\\s*"+o.source+")?",new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",i,"|",o.source+")",")*",">",")","|","(?:","<(/)?","(?:",/!--([\s\S]+?)--/.source,"|","(?:","("+/[0-9a-zA-Z][0-9a-zA-Z:]*/.source+")","(?:","(?:\\s+|\\b)",i,")*","\\s*/?",")",")",">",")"].join(""),"gi")),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){for(var t,n,r=this.htmlRegex,o=0,i=[];null!==(t=r.exec(e));){var a=t[0],s=t[3],u=t[1]||t[4],c=!!t[2],l=t.index,p=e.substring(o,l);p&&(n=this.parseTextAndEntityNodes(o,p),i.push.apply(i,n)),s?i.push(this.createCommentNode(l,a,s)):i.push(this.createElementNode(l,a,u,c)),o=l+a.length}if(o<e.length){var f=e.substring(o);f&&(n=this.parseTextAndEntityNodes(o,f),i.push.apply(i,n))}return i},parseTextAndEntityNodes:function(e,t){for(var n=[],r=s.Util.splitAndCapture(t,this.htmlCharacterEntitiesRegex),o=0,i=r.length;o<i;o+=2){var a=r[o],u=r[o+1];a&&(n.push(this.createTextNode(e,a)),e+=a.length),u&&(n.push(this.createEntityNode(e,u)),e+=u.length)}return n},createCommentNode:function(e,t,n){return new s.htmlParser.CommentNode({offset:e,text:t,comment:s.Util.trim(n)})},createElementNode:function(e,t,n,r){return new s.htmlParser.ElementNode({offset:e,text:t,tagName:n.toLowerCase(),closing:r})},createEntityNode:function(e,t){return new s.htmlParser.EntityNode({offset:e,text:t})},createTextNode:function(e,t){return new s.htmlParser.TextNode({offset:e,text:t})}}),s.htmlParser.HtmlNode=s.Util.extend(Object,{offset:void 0,text:void 0,constructor:function(e){if(s.Util.assign(this,e),null==this.offset)throw new Error("`offset` cfg required");if(null==this.text)throw new Error("`text` cfg required")},getType:s.Util.abstractMethod,getOffset:function(){return this.offset},getText:function(){return this.text}}),s.htmlParser.CommentNode=s.Util.extend(s.htmlParser.HtmlNode,{comment:"",getType:function(){return"comment"},getComment:function(){return this.comment}}),s.htmlParser.ElementNode=s.Util.extend(s.htmlParser.HtmlNode,{tagName:"",closing:!1,getType:function(){return"element"},getTagName:function(){return this.tagName},isClosing:function(){return this.closing}}),s.htmlParser.EntityNode=s.Util.extend(s.htmlParser.HtmlNode,{getType:function(){return"entity"}}),s.htmlParser.TextNode=s.Util.extend(s.htmlParser.HtmlNode,{getType:function(){return"text"}}),s.match.Match=s.Util.extend(Object,{constructor:function(e){if(null==e.tagBuilder)throw new Error("`tagBuilder` cfg required");if(null==e.matchedText)throw new Error("`matchedText` cfg required");if(null==e.offset)throw new Error("`offset` cfg required");this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset},getType:s.Util.abstractMethod,getMatchedText:function(){return this.matchedText},setOffset:function(e){this.offset=e},getOffset:function(){return this.offset},getAnchorHref:s.Util.abstractMethod,getAnchorText:s.Util.abstractMethod,buildTag:function(){return this.tagBuilder.build(this)}}),s.match.Email=s.Util.extend(s.match.Match,{constructor:function(e){if(s.match.Match.prototype.constructor.call(this,e),!e.email)throw new Error("`email` cfg required");this.email=e.email},getType:function(){return"email"},getEmail:function(){return this.email},getAnchorHref:function(){return"mailto:"+this.email},getAnchorText:function(){return this.email}}),s.match.Hashtag=s.Util.extend(s.match.Match,{constructor:function(e){if(s.match.Match.prototype.constructor.call(this,e),!e.hashtag)throw new Error("`hashtag` cfg required");this.serviceName=e.serviceName,this.hashtag=e.hashtag},getType:function(){return"hashtag"},getServiceName:function(){return this.serviceName},getHashtag:function(){return this.hashtag},getAnchorHref:function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;case"instagram":return"https://instagram.com/explore/tags/"+t;default:throw new Error("Unknown service name to point hashtag to: ",e)}},getAnchorText:function(){return"#"+this.hashtag}}),s.match.Phone=s.Util.extend(s.match.Match,{constructor:function(e){if(s.match.Match.prototype.constructor.call(this,e),!e.number)throw new Error("`number` cfg required");if(null==e.plusSign)throw new Error("`plusSign` cfg required");this.number=e.number,this.plusSign=e.plusSign},getType:function(){return"phone"},getNumber:function(){return this.number},getAnchorHref:function(){return"tel:"+(this.plusSign?"+":"")+this.number},getAnchorText:function(){return this.matchedText}}),s.match.Twitter=s.Util.extend(s.match.Match,{constructor:function(e){if(s.match.Match.prototype.constructor.call(this,e),!e.twitterHandle)throw new Error("`twitterHandle` cfg required");this.twitterHandle=e.twitterHandle},getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}}),s.match.Url=s.Util.extend(s.match.Match,{constructor:function(e){if(s.match.Match.prototype.constructor.call(this,e),"scheme"!==e.urlMatchType&&"www"!==e.urlMatchType&&"tld"!==e.urlMatchType)throw new Error('`urlMatchType` cfg must be one of: "scheme", "www", or "tld"');if(!e.url)throw new Error("`url` cfg required");if(null==e.protocolUrlMatch)throw new Error("`protocolUrlMatch` cfg required");if(null==e.protocolRelativeMatch)throw new Error("`protocolRelativeMatch` cfg required");if(null==e.stripPrefix)throw new Error("`stripPrefix` cfg required");this.urlMatchType=e.urlMatchType,this.url=e.url,this.protocolUrlMatch=e.protocolUrlMatch,this.protocolRelativeMatch=e.protocolRelativeMatch,this.stripPrefix=e.stripPrefix},urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,protocolRelativeRegex:/^\/\//,protocolPrepended:!1,getType:function(){return"url"},getUrlMatchType:function(){return this.urlMatchType},getUrl:function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},getAnchorHref:function(){return this.getUrl().replace(/&/g,"&")},getAnchorText:function(){var e=this.getMatchedText();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix&&(e=this.stripUrlPrefix(e)),e=this.removeTrailingSlash(e)},stripUrlPrefix:function(e){return e.replace(this.urlPrefixRegex,"")},stripProtocolRelativePrefix:function(e){return e.replace(this.protocolRelativeRegex,"")},removeTrailingSlash:function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e}}),s.matcher.Matcher=s.Util.extend(Object,{constructor:function(e){if(!e.tagBuilder)throw new Error("`tagBuilder` cfg required");this.tagBuilder=e.tagBuilder},parseMatches:s.Util.abstractMethod}),s.matcher.Email=s.Util.extend(s.matcher.Matcher,{matcherRegex:(e=s.RegexLib.alphaNumericCharsStr,t=new RegExp("["+e+"\\-_';:&=+$.,]+@"),n=s.RegexLib.domainNameRegex,r=s.RegexLib.tldRegex,new RegExp([t.source,n.source,"\\.",r.source].join(""),"gi")),parseMatches:function(e){for(var t,n=this.matcherRegex,r=this.tagBuilder,o=[];null!==(t=n.exec(e));){var i=t[0];o.push(new s.match.Email({tagBuilder:r,matchedText:i,offset:t.index,email:i}))}return o}}),s.matcher.Hashtag=s.Util.extend(s.matcher.Matcher,{matcherRegex:new RegExp("#[_"+s.RegexLib.alphaNumericCharsStr+"]{1,139}","g"),nonWordCharRegex:new RegExp("[^"+s.RegexLib.alphaNumericCharsStr+"]"),constructor:function(e){s.matcher.Matcher.prototype.constructor.call(this,e),this.serviceName=e.serviceName},parseMatches:function(e){for(var t,n=this.matcherRegex,r=this.nonWordCharRegex,o=this.serviceName,i=this.tagBuilder,a=[];null!==(t=n.exec(e));){var u=t.index,c=e.charAt(u-1);if(0===u||r.test(c)){var l=t[0],p=t[0].slice(1);a.push(new s.match.Hashtag({tagBuilder:i,matchedText:l,offset:u,serviceName:o,hashtag:p}))}}return a}}),s.matcher.Phone=s.Util.extend(s.matcher.Matcher,{matcherRegex:/(?:(\+)?\d{1,3}[-\040.])?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]\d{4}/g,parseMatches:function(e){for(var t,n=this.matcherRegex,r=this.tagBuilder,o=[];null!==(t=n.exec(e));){var i=t[0],a=i.replace(/\D/g,""),u=!!t[1];o.push(new s.match.Phone({tagBuilder:r,matchedText:i,offset:t.index,number:a,plusSign:u}))}return o}}),s.matcher.Twitter=s.Util.extend(s.matcher.Matcher,{matcherRegex:new RegExp("@[_"+s.RegexLib.alphaNumericCharsStr+"]{1,20}","g"),nonWordCharRegex:new RegExp("[^"+s.RegexLib.alphaNumericCharsStr+"]"),parseMatches:function(e){for(var t,n=this.matcherRegex,r=this.nonWordCharRegex,o=this.tagBuilder,i=[];null!==(t=n.exec(e));){var a=t.index,u=e.charAt(a-1);if(0===a||r.test(u)){var c=t[0],l=t[0].slice(1);i.push(new s.match.Twitter({tagBuilder:o,matchedText:c,offset:a,twitterHandle:l}))}}return i}}),s.matcher.Url=s.Util.extend(s.matcher.Matcher,{matcherRegex:function(){var e=s.RegexLib.domainNameRegex,t=s.RegexLib.tldRegex,n=s.RegexLib.alphaNumericCharsStr,r=new RegExp("["+n+"\\-+&@#/%=~_()|'$*\\[\\]?!:,.;]*["+n+"\\-+&@#/%=~_()|'$*\\[\\]]");return new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]*:(?![A-Za-z][-.+A-Za-z0-9]*:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,e.source,")","|","(","(//)?",/(?:www\.)/.source,e.source,")","|","(","(//)?",e.source+"\\.",t.source,")",")","(?:"+r.source+")?"].join(""),"gi")}(),wordCharRegExp:/\w/,openParensRe:/\(/g,closeParensRe:/\)/g,constructor:function(e){if(s.matcher.Matcher.prototype.constructor.call(this,e),this.stripPrefix=e.stripPrefix,null==this.stripPrefix)throw new Error("`stripPrefix` cfg required")},parseMatches:function(e){for(var t,n=this.matcherRegex,r=this.stripPrefix,o=this.tagBuilder,i=[];null!==(t=n.exec(e));){var a=t[0],u=t[1],c=t[2],l=t[3],p=t[5],f=t.index,h=l||p,d=e.charAt(f-1);if(s.matcher.UrlMatchValidator.isValid(a,u)&&!(f>0&&"@"===d||f>0&&h&&this.wordCharRegExp.test(d))){if(this.matchHasUnbalancedClosingParen(a))a=a.substr(0,a.length-1);else{var m=this.matchHasInvalidCharAfterTld(a,u);m>-1&&(a=a.substr(0,m))}var v=u?"scheme":c?"www":"tld",g=!!u;i.push(new s.match.Url({tagBuilder:o,matchedText:a,offset:f,urlMatchType:v,url:a,protocolUrlMatch:g,protocolRelativeMatch:!!h,stripPrefix:r}))}}return i},matchHasUnbalancedClosingParen:function(e){if(")"===e.charAt(e.length-1)){var t=e.match(this.openParensRe),n=e.match(this.closeParensRe);if((t&&t.length||0)<(n&&n.length||0))return!0}return!1},matchHasInvalidCharAfterTld:function(e,t){if(!e)return-1;var n=0;t&&(n=e.indexOf(":"),e=e.slice(n));var r=/^((.?\/\/)?[A-Za-z0-9\u00C0-\u017F\.\-]*[A-Za-z0-9\u00C0-\u017F\-]\.[A-Za-z]+)/.exec(e);return null===r?-1:(n+=r[1].length,e=e.slice(r[1].length),/^[^.A-Za-z:\/?#]/.test(e)?n:-1)}}),s.matcher.UrlMatchValidator={hasFullProtocolRegex:/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,uriSchemeRegex:/^[A-Za-z][-.+A-Za-z0-9]*:/,hasWordCharAfterProtocolRegex:/:[^\s]*?[A-Za-z\u00C0-\u017F]/,ipRegex:/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,isValid:function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e))},isValidIpAddress:function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return null!==e.match(t)},isValidUriScheme:function(e){var t=e.match(this.uriSchemeRegex)[0].toLowerCase();return"javascript:"!==t&&"vbscript:"!==t},urlMatchDoesNotHaveProtocolOrDot:function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},urlMatchDoesNotHaveAtLeastOneWordChar:function(e,t){return!(!e||!t||this.hasWordCharAfterProtocolRegex.test(e))}},s.truncate.TruncateEnd=function(e,t,n){return s.Util.ellipsis(e,t,n)},s.truncate.TruncateMiddle=function(e,t,n){if(e.length<=t)return e;var r=t-n.length,o="";return r>0&&(o=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+o).substr(0,t)},s.truncate.TruncateSmart=function(e,t,n){var r=function(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t},o=function(e,t){var r=t/2,o=Math.ceil(r),i=-1*Math.floor(r),a="";return i<0&&(a=e.substr(i)),e.substr(0,o)+n+a};if(e.length<=t)return e;var i=t-n.length,a=function(e){var t={},n=e,r=n.match(/^([a-z]+):\/\//i);return r&&(t.scheme=r[1],n=n.substr(r[0].length)),(r=n.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(t.host=r[1],n=n.substr(r[0].length)),(r=n.match(/^\/(.*?)(?=(\?|#|$))/i))&&(t.path=r[1],n=n.substr(r[0].length)),(r=n.match(/^\?(.*?)(?=(#|$))/i))&&(t.query=r[1],n=n.substr(r[0].length)),(r=n.match(/^#(.*?)$/i))&&(t.fragment=r[1]),t}(e);if(a.query){var s=a.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);s&&(a.query=a.query.substr(0,s[1].length),e=r(a))}if(e.length<=t)return e;if(a.host&&(a.host=a.host.replace(/^www\./,""),e=r(a)),e.length<=t)return e;var u="";if(a.host&&(u+=a.host),u.length>=i)return a.host.length==t?(a.host.substr(0,t-n.length)+n).substr(0,t):o(u,i).substr(0,t);var c="";if(a.path&&(c+="/"+a.path),a.query&&(c+="?"+a.query),c){if((u+c).length>=i)return(u+c).length==t?(u+c).substr(0,t):(u+o(c,i-u.length)).substr(0,t);u+=c}if(a.fragment){var l="#"+a.fragment;if((u+l).length>=i)return(u+l).length==t?(u+l).substr(0,t):(u+o(l,i-u.length)).substr(0,t);u+=l}if(a.scheme&&a.host){var p=a.scheme+"://";if((u+p).length<i)return(p+u).substr(0,t)}if(u.length<=t)return u;var f="";return i>0&&(f=u.substr(-1*Math.floor(i/2))),(u.substr(0,Math.ceil(i/2))+n+f).substr(0,t)},s})?r.apply(t,o):r)||(e.exports=i)},function(e,t,n){"use strict";var r=n(190),o=n(995),i=[["code",n(996)],["fences",n(997),["paragraph","blockquote","list"]],["blockquote",n(998),["paragraph","blockquote","list"]],["hr",n(999),["paragraph","blockquote","list"]],["list",n(1e3),["paragraph","blockquote"]],["footnote",n(1001),["paragraph"]],["heading",n(1002),["paragraph","blockquote"]],["lheading",n(1003)],["htmlblock",n(1004),["paragraph","blockquote"]],["table",n(1006),["paragraph"]],["deflist",n(1007),["paragraph"]],["paragraph",n(1008)]];function a(){this.ruler=new r;for(var e=0;e<i.length;e++)this.ruler.push(i[e][0],i[e][1],{alt:(i[e][2]||[]).slice()})}a.prototype.tokenize=function(e,t,n){for(var r,o=this.ruler.getRules(""),i=o.length,a=t,s=!1;a<n&&(e.line=a=e.skipEmptyLines(a),!(a>=n))&&!(e.tShift[a]<e.blkIndent);){for(r=0;r<i&&!o[r](e,a,n,!1);r++);if(e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),(a=e.line)<n&&e.isEmpty(a)){if(s=!0,++a<n&&"list"===e.parentType&&e.isEmpty(a))break;e.line=a}}};var s=/[\n\t]/g,u=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,c=/\u00a0/g;a.prototype.parse=function(e,t,n,r){var i,a=0,l=0;if(!e)return[];(e=(e=e.replace(c," ")).replace(u,"\n")).indexOf("\t")>=0&&(e=e.replace(s,function(t,n){var r;return 10===e.charCodeAt(n)?(a=n+1,l=0,t):(r=" ".slice((n-a-l)%4),l=n-a+1,r)})),i=new o(e,this,t,n,r),this.tokenize(i,i.line,i.lineMax)},e.exports=a},function(e,t,n){"use strict";function r(e,t,n,r,o){var i,a,s,u,c,l,p;for(this.src=e,this.parser=t,this.options=n,this.env=r,this.tokens=o,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",l=0,p=!1,s=u=l=0,c=(a=this.src).length;u<c;u++){if(i=a.charCodeAt(u),!p){if(32===i){l++;continue}p=!0}10!==i&&u!==c-1||(10!==i&&u++,this.bMarks.push(s),this.eMarks.push(u),this.tShift.push(l),p=!1,l=0,s=u+1)}this.bMarks.push(a.length),this.eMarks.push(a.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}r.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},r.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},r.prototype.skipSpaces=function(e){for(var t=this.src.length;e<t&&32===this.src.charCodeAt(e);e++);return e},r.prototype.skipChars=function(e,t){for(var n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},r.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},r.prototype.getLines=function(e,t,n,r){var o,i,a,s,u,c=e;if(e>=t)return"";if(c+1===t)return i=this.bMarks[c]+Math.min(this.tShift[c],n),a=r?this.eMarks[c]+1:this.eMarks[c],this.src.slice(i,a);for(s=new Array(t-e),o=0;c<t;c++,o++)(u=this.tShift[c])>n&&(u=n),u<0&&(u=0),i=this.bMarks[c]+u,a=c+1<t||r?this.eMarks[c]+1:this.eMarks[c],s[o]=this.src.slice(i,a);return s.join("")},e.exports=r},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,o;if(e.tShift[t]-e.blkIndent<4)return!1;for(o=r=t+1;r<n;)if(e.isEmpty(r))r++;else{if(!(e.tShift[r]-e.blkIndent>=4))break;o=++r}return e.line=r,e.tokens.push({type:"code",content:e.getLines(t,o,4+e.blkIndent,!0),block:!0,lines:[t,e.line],level:e.level}),!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,s,u,c=!1,l=e.bMarks[t]+e.tShift[t],p=e.eMarks[t];if(l+3>p)return!1;if(126!==(o=e.src.charCodeAt(l))&&96!==o)return!1;if(u=l,(i=(l=e.skipChars(l,o))-u)<3)return!1;if((a=e.src.slice(l,p).trim()).indexOf("`")>=0)return!1;if(r)return!0;for(s=t;!(++s>=n)&&!((l=u=e.bMarks[s]+e.tShift[s])<(p=e.eMarks[s])&&e.tShift[s]<e.blkIndent);)if(e.src.charCodeAt(l)===o&&!(e.tShift[s]-e.blkIndent>=4||(l=e.skipChars(l,o))-u<i||(l=e.skipSpaces(l))<p)){c=!0;break}return i=e.tShift[t],e.line=s+(c?1:0),e.tokens.push({type:"fence",params:a,content:e.getLines(t+1,s,i,!0),lines:[t,e.line],level:e.level}),!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,s,u,c,l,p,f,h,d,m=e.bMarks[t]+e.tShift[t],v=e.eMarks[t];if(m>v)return!1;if(62!==e.src.charCodeAt(m++))return!1;if(e.level>=e.options.maxNesting)return!1;if(r)return!0;for(32===e.src.charCodeAt(m)&&m++,u=e.blkIndent,e.blkIndent=0,s=[e.bMarks[t]],e.bMarks[t]=m,i=(m=m<v?e.skipSpaces(m):m)>=v,a=[e.tShift[t]],e.tShift[t]=m-e.bMarks[t],p=e.parser.ruler.getRules("blockquote"),o=t+1;o<n&&!((m=e.bMarks[o]+e.tShift[o])>=(v=e.eMarks[o]));o++)if(62!==e.src.charCodeAt(m++)){if(i)break;for(d=!1,f=0,h=p.length;f<h;f++)if(p[f](e,o,n,!0)){d=!0;break}if(d)break;s.push(e.bMarks[o]),a.push(e.tShift[o]),e.tShift[o]=-1337}else 32===e.src.charCodeAt(m)&&m++,s.push(e.bMarks[o]),e.bMarks[o]=m,i=(m=m<v?e.skipSpaces(m):m)>=v,a.push(e.tShift[o]),e.tShift[o]=m-e.bMarks[o];for(c=e.parentType,e.parentType="blockquote",e.tokens.push({type:"blockquote_open",lines:l=[t,0],level:e.level++}),e.parser.tokenize(e,t,o),e.tokens.push({type:"blockquote_close",level:--e.level}),e.parentType=c,l[1]=e.line,f=0;f<a.length;f++)e.bMarks[f+t]=s[f],e.tShift[f+t]=a[f];return e.blkIndent=u,!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,s=e.bMarks[t],u=e.eMarks[t];if((s+=e.tShift[t])>u)return!1;if(42!==(o=e.src.charCodeAt(s++))&&45!==o&&95!==o)return!1;for(i=1;s<u;){if((a=e.src.charCodeAt(s++))!==o&&32!==a)return!1;a===o&&i++}return!(i<3)&&(!!r||(e.line=t+1,e.tokens.push({type:"hr",lines:[t,e.line],level:e.level}),!0))}},function(e,t,n){"use strict";function r(e,t){var n,r,o;return(r=e.bMarks[t]+e.tShift[t])>=(o=e.eMarks[t])?-1:42!==(n=e.src.charCodeAt(r++))&&45!==n&&43!==n?-1:r<o&&32!==e.src.charCodeAt(r)?-1:r}function o(e,t){var n,r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(r+1>=o)return-1;if((n=e.src.charCodeAt(r++))<48||n>57)return-1;for(;;){if(r>=o)return-1;if(!((n=e.src.charCodeAt(r++))>=48&&n<=57)){if(41===n||46===n)break;return-1}}return r<o&&32!==e.src.charCodeAt(r)?-1:r}e.exports=function(e,t,n,i){var a,s,u,c,l,p,f,h,d,m,v,g,y,b,_,w,x,E,S,C,k,O=!0;if((h=o(e,t))>=0)g=!0;else{if(!((h=r(e,t))>=0))return!1;g=!1}if(e.level>=e.options.maxNesting)return!1;if(v=e.src.charCodeAt(h-1),i)return!0;for(b=e.tokens.length,g?(f=e.bMarks[t]+e.tShift[t],m=Number(e.src.substr(f,h-f-1)),e.tokens.push({type:"ordered_list_open",order:m,lines:w=[t,0],level:e.level++})):e.tokens.push({type:"bullet_list_open",lines:w=[t,0],level:e.level++}),a=t,_=!1,E=e.parser.ruler.getRules("list");!(!(a<n)||((d=(y=e.skipSpaces(h))>=e.eMarks[a]?1:y-h)>4&&(d=1),d<1&&(d=1),s=h-e.bMarks[a]+d,e.tokens.push({type:"list_item_open",lines:x=[t,0],level:e.level++}),c=e.blkIndent,l=e.tight,u=e.tShift[t],p=e.parentType,e.tShift[t]=y-e.bMarks[t],e.blkIndent=s,e.tight=!0,e.parentType="list",e.parser.tokenize(e,t,n,!0),e.tight&&!_||(O=!1),_=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=c,e.tShift[t]=u,e.tight=l,e.parentType=p,e.tokens.push({type:"list_item_close",level:--e.level}),a=t=e.line,x[1]=a,y=e.bMarks[t],a>=n)||e.isEmpty(a)||e.tShift[a]<e.blkIndent);){for(k=!1,S=0,C=E.length;S<C;S++)if(E[S](e,a,n,!0)){k=!0;break}if(k)break;if(g){if((h=o(e,a))<0)break}else if((h=r(e,a))<0)break;if(v!==e.src.charCodeAt(h-1))break}return e.tokens.push({type:g?"ordered_list_close":"bullet_list_close",level:--e.level}),w[1]=a,e.line=a,O&&function(e,t){var n,r,o=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===o&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}(e,b),!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,s,u,c=e.bMarks[t]+e.tShift[t],l=e.eMarks[t];if(c+4>l)return!1;if(91!==e.src.charCodeAt(c))return!1;if(94!==e.src.charCodeAt(c+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(s=c+2;s<l;s++){if(32===e.src.charCodeAt(s))return!1;if(93===e.src.charCodeAt(s))break}return s!==c+2&&(!(s+1>=l||58!==e.src.charCodeAt(++s))&&(!!r||(s++,e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.refs||(e.env.footnotes.refs={}),u=e.src.slice(c+2,s-2),e.env.footnotes.refs[":"+u]=-1,e.tokens.push({type:"footnote_reference_open",label:u,level:e.level++}),o=e.bMarks[t],i=e.tShift[t],a=e.parentType,e.tShift[t]=e.skipSpaces(s)-s,e.bMarks[t]=s,e.blkIndent+=4,e.parentType="footnote",e.tShift[t]<e.blkIndent&&(e.tShift[t]+=e.blkIndent,e.bMarks[t]-=e.blkIndent),e.parser.tokenize(e,t,n,!0),e.parentType=a,e.blkIndent-=4,e.tShift[t]=i,e.bMarks[t]=o,e.tokens.push({type:"footnote_reference_close",level:--e.level}),!0)))}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,s=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(s>=u)return!1;if(35!==(o=e.src.charCodeAt(s))||s>=u)return!1;for(i=1,o=e.src.charCodeAt(++s);35===o&&s<u&&i<=6;)i++,o=e.src.charCodeAt(++s);return!(i>6||s<u&&32!==o)&&(!!r||(u=e.skipCharsBack(u,32,s),(a=e.skipCharsBack(u,35,s))>s&&32===e.src.charCodeAt(a-1)&&(u=a),e.line=t+1,e.tokens.push({type:"heading_open",hLevel:i,lines:[t,e.line],level:e.level}),s<u&&e.tokens.push({type:"inline",content:e.src.slice(s,u).trim(),level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"heading_close",hLevel:i,level:e.level}),!0))}},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,o,i,a=t+1;return!(a>=n)&&(!(e.tShift[a]<e.blkIndent)&&(!(e.tShift[a]-e.blkIndent>3)&&(!((o=e.bMarks[a]+e.tShift[a])>=(i=e.eMarks[a]))&&((45===(r=e.src.charCodeAt(o))||61===r)&&(o=e.skipChars(o,r),!((o=e.skipSpaces(o))<i)&&(o=e.bMarks[t]+e.tShift[t],e.line=a+1,e.tokens.push({type:"heading_open",hLevel:61===r?1:2,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:e.src.slice(o,e.eMarks[t]).trim(),level:e.level+1,lines:[t,e.line-1],children:[]}),e.tokens.push({type:"heading_close",hLevel:61===r?1:2,level:e.level}),!0))))))}},function(e,t,n){"use strict";var r=n(1005),o=/^<([a-zA-Z]{1,15})[\s\/>]/,i=/^<\/([a-zA-Z]{1,15})[\s>]/;e.exports=function(e,t,n,a){var s,u,c,l=e.bMarks[t],p=e.eMarks[t],f=e.tShift[t];if(l+=f,!e.options.html)return!1;if(f>3||l+2>=p)return!1;if(60!==e.src.charCodeAt(l))return!1;if(33===(s=e.src.charCodeAt(l+1))||63===s){if(a)return!0}else{if(47!==s&&!function(e){var t=32|e;return t>=97&&t<=122}(s))return!1;if(47===s){if(!(u=e.src.slice(l,p).match(i)))return!1}else if(!(u=e.src.slice(l,p).match(o)))return!1;if(!0!==r[u[1].toLowerCase()])return!1;if(a)return!0}for(c=t+1;c<e.lineMax&&!e.isEmpty(c);)c++;return e.line=c,e.tokens.push({type:"htmlblock",level:e.level,lines:[t,e.line],content:e.getLines(t,c,0,!0)}),!0}},function(e,t,n){"use strict";var r={};["article","aside","button","blockquote","body","canvas","caption","col","colgroup","dd","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","li","map","object","ol","output","p","pre","progress","script","section","style","table","tbody","td","textarea","tfoot","th","tr","thead","ul","video"].forEach(function(e){r[e]=!0}),e.exports=r},function(e,t,n){"use strict";function r(e,t){var n=e.bMarks[t]+e.blkIndent,r=e.eMarks[t];return e.src.substr(n,r-n)}e.exports=function(e,t,n,o){var i,a,s,u,c,l,p,f,h,d,m;if(t+2>n)return!1;if(c=t+1,e.tShift[c]<e.blkIndent)return!1;if((s=e.bMarks[c]+e.tShift[c])>=e.eMarks[c])return!1;if(124!==(i=e.src.charCodeAt(s))&&45!==i&&58!==i)return!1;if(a=r(e,t+1),!/^[-:| ]+$/.test(a))return!1;if((l=a.split("|"))<=2)return!1;for(f=[],u=0;u<l.length;u++){if(!(h=l[u].trim())){if(0===u||u===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(h))return!1;58===h.charCodeAt(h.length-1)?f.push(58===h.charCodeAt(0)?"center":"right"):58===h.charCodeAt(0)?f.push("left"):f.push("")}if(-1===(a=r(e,t).trim()).indexOf("|"))return!1;if(l=a.replace(/^\||\|$/g,"").split("|"),f.length!==l.length)return!1;if(o)return!0;for(e.tokens.push({type:"table_open",lines:d=[t,0],level:e.level++}),e.tokens.push({type:"thead_open",lines:[t,t+1],level:e.level++}),e.tokens.push({type:"tr_open",lines:[t,t+1],level:e.level++}),u=0;u<l.length;u++)e.tokens.push({type:"th_open",align:f[u],lines:[t,t+1],level:e.level++}),e.tokens.push({type:"inline",content:l[u].trim(),lines:[t,t+1],level:e.level,children:[]}),e.tokens.push({type:"th_close",level:--e.level});for(e.tokens.push({type:"tr_close",level:--e.level}),e.tokens.push({type:"thead_close",level:--e.level}),e.tokens.push({type:"tbody_open",lines:m=[t+2,0],level:e.level++}),c=t+2;c<n&&!(e.tShift[c]<e.blkIndent)&&-1!==(a=r(e,c).trim()).indexOf("|");c++){for(l=a.replace(/^\||\|$/g,"").split("|"),e.tokens.push({type:"tr_open",level:e.level++}),u=0;u<l.length;u++)e.tokens.push({type:"td_open",align:f[u],level:e.level++}),p=l[u].substring(124===l[u].charCodeAt(0)?1:0,124===l[u].charCodeAt(l[u].length-1)?l[u].length-1:l[u].length).trim(),e.tokens.push({type:"inline",content:p,level:e.level,children:[]}),e.tokens.push({type:"td_close",level:--e.level});e.tokens.push({type:"tr_close",level:--e.level})}return e.tokens.push({type:"tbody_close",level:--e.level}),e.tokens.push({type:"table_close",level:--e.level}),d[1]=m[1]=c,e.line=c,!0}},function(e,t,n){"use strict";function r(e,t){var n,r,o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return o>=i?-1:126!==(r=e.src.charCodeAt(o++))&&58!==r?-1:o===(n=e.skipSpaces(o))?-1:n>=i?-1:n}e.exports=function(e,t,n,o){var i,a,s,u,c,l,p,f,h,d,m,v,g,y;if(o)return!(e.ddIndent<0)&&r(e,t)>=0;if(p=t+1,e.isEmpty(p)&&++p>n)return!1;if(e.tShift[p]<e.blkIndent)return!1;if((i=r(e,p))<0)return!1;if(e.level>=e.options.maxNesting)return!1;l=e.tokens.length,e.tokens.push({type:"dl_open",lines:c=[t,0],level:e.level++}),s=t,a=p;e:for(;;){for(y=!0,g=!1,e.tokens.push({type:"dt_open",lines:[s,s],level:e.level++}),e.tokens.push({type:"inline",content:e.getLines(s,s+1,e.blkIndent,!1).trim(),level:e.level+1,lines:[s,s],children:[]}),e.tokens.push({type:"dt_close",level:--e.level});;){if(e.tokens.push({type:"dd_open",lines:u=[p,0],level:e.level++}),v=e.tight,h=e.ddIndent,f=e.blkIndent,m=e.tShift[a],d=e.parentType,e.blkIndent=e.ddIndent=e.tShift[a]+2,e.tShift[a]=i-e.bMarks[a],e.tight=!0,e.parentType="deflist",e.parser.tokenize(e,a,n,!0),e.tight&&!g||(y=!1),g=e.line-a>1&&e.isEmpty(e.line-1),e.tShift[a]=m,e.tight=v,e.parentType=d,e.blkIndent=f,e.ddIndent=h,e.tokens.push({type:"dd_close",level:--e.level}),u[1]=p=e.line,p>=n)break e;if(e.tShift[p]<e.blkIndent)break e;if((i=r(e,p))<0)break;a=p}if(p>=n)break;if(s=p,e.isEmpty(s))break;if(e.tShift[s]<e.blkIndent)break;if((a=s+1)>=n)break;if(e.isEmpty(a)&&a++,a>=n)break;if(e.tShift[a]<e.blkIndent)break;if((i=r(e,a))<0)break}return e.tokens.push({type:"dl_close",level:--e.level}),c[1]=p,e.line=p,y&&function(e,t){var n,r,o=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===o&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}(e,l),!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,s,u=t+1;if(u<(n=e.lineMax)&&!e.isEmpty(u))for(s=e.parser.ruler.getRules("paragraph");u<n&&!e.isEmpty(u);u++)if(!(e.tShift[u]-e.blkIndent>3)){for(o=!1,i=0,a=s.length;i<a;i++)if(s[i](e,u,n,!0)){o=!0;break}if(o)break}return r=e.getLines(t,u,e.blkIndent,!1).trim(),e.line=u,r.length&&(e.tokens.push({type:"paragraph_open",tight:!1,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:r,level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"paragraph_close",tight:!1,level:e.level})),!0}},function(e,t,n){"use strict";var r=n(190),o=n(269),i=n(39),a=[["text",n(1010)],["newline",n(1011)],["escape",n(1012)],["backticks",n(1013)],["del",n(1014)],["ins",n(1015)],["mark",n(1016)],["emphasis",n(1017)],["sub",n(1018)],["sup",n(1019)],["links",n(1020)],["footnote_inline",n(1021)],["footnote_ref",n(1022)],["autolink",n(1023)],["htmltag",n(1025)],["entity",n(1027)]];function s(){this.ruler=new r;for(var e=0;e<a.length;e++)this.ruler.push(a[e][0],a[e][1]);this.validateLink=u}function u(e){var t=e.trim().toLowerCase();return-1===(t=i.replaceEntities(t)).indexOf(":")||-1===["vbscript","javascript","file","data"].indexOf(t.split(":")[0])}s.prototype.skipToken=function(e){var t,n,r=this.ruler.getRules(""),o=r.length,i=e.pos;if((n=e.cacheGet(i))>0)e.pos=n;else{for(t=0;t<o;t++)if(r[t](e,!0))return void e.cacheSet(i,e.pos);e.pos++,e.cacheSet(i,e.pos)}},s.prototype.tokenize=function(e){for(var t,n,r=this.ruler.getRules(""),o=r.length,i=e.posMax;e.pos<i;){for(n=0;n<o&&!(t=r[n](e,!1));n++);if(t){if(e.pos>=i)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},s.prototype.parse=function(e,t,n,r){var i=new o(e,this,t,n,r);this.tokenize(i)},e.exports=s},function(e,t,n){"use strict";function r(e){switch(e){case 10:case 92:case 96:case 42:case 95:case 94:case 91:case 93:case 33:case 38:case 60:case 62:case 123:case 125:case 36:case 37:case 64:case 126:case 43:case 61:case 58:return!0;default:return!1}}e.exports=function(e,t){for(var n=e.pos;n<e.posMax&&!r(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o=e.pos;if(10!==e.src.charCodeAt(o))return!1;if(n=e.pending.length-1,r=e.posMax,!t)if(n>=0&&32===e.pending.charCodeAt(n))if(n>=1&&32===e.pending.charCodeAt(n-1)){for(var i=n-2;i>=0;i--)if(32!==e.pending.charCodeAt(i)){e.pending=e.pending.substring(0,i+1);break}e.push({type:"hardbreak",level:e.level})}else e.pending=e.pending.slice(0,-1),e.push({type:"softbreak",level:e.level});else e.push({type:"softbreak",level:e.level});for(o++;o<r&&32===e.src.charCodeAt(o);)o++;return e.pos=o,!0}},function(e,t,n){"use strict";for(var r=[],o=0;o<256;o++)r.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){r[e.charCodeAt(0)]=1}),e.exports=function(e,t){var n,o=e.pos,i=e.posMax;if(92!==e.src.charCodeAt(o))return!1;if(++o<i){if((n=e.src.charCodeAt(o))<256&&0!==r[n])return t||(e.pending+=e.src[o]),e.pos+=2,!0;if(10===n){for(t||e.push({type:"hardbreak",level:e.level}),o++;o<i&&32===e.src.charCodeAt(o);)o++;return e.pos=o,!0}}return t||(e.pending+="\\"),e.pos++,!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,s=e.pos;if(96!==e.src.charCodeAt(s))return!1;for(n=s,s++,r=e.posMax;s<r&&96===e.src.charCodeAt(s);)s++;for(o=e.src.slice(n,s),i=a=s;-1!==(i=e.src.indexOf("`",a));){for(a=i+1;a<r&&96===e.src.charCodeAt(a);)a++;if(a-i===o.length)return t||e.push({type:"code",content:e.src.slice(s,i).replace(/[ \n]+/g," ").trim(),block:!1,level:e.level}),e.pos=a,!0}return t||(e.pending+=o),e.pos+=o.length,!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,s=e.posMax,u=e.pos;if(126!==e.src.charCodeAt(u))return!1;if(t)return!1;if(u+4>=s)return!1;if(126!==e.src.charCodeAt(u+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(i=u>0?e.src.charCodeAt(u-1):-1,a=e.src.charCodeAt(u+2),126===i)return!1;if(126===a)return!1;if(32===a||10===a)return!1;for(r=u+2;r<s&&126===e.src.charCodeAt(r);)r++;if(r>u+3)return e.pos+=r-u,t||(e.pending+=e.src.slice(u,r)),!0;for(e.pos=u+2,o=1;e.pos+1<s;){if(126===e.src.charCodeAt(e.pos)&&126===e.src.charCodeAt(e.pos+1)&&(i=e.src.charCodeAt(e.pos-1),126!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&126!==i&&(32!==i&&10!==i?o--:32!==a&&10!==a&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=u+2,t||(e.push({type:"del_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"del_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=u,!1)}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,s=e.posMax,u=e.pos;if(43!==e.src.charCodeAt(u))return!1;if(t)return!1;if(u+4>=s)return!1;if(43!==e.src.charCodeAt(u+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(i=u>0?e.src.charCodeAt(u-1):-1,a=e.src.charCodeAt(u+2),43===i)return!1;if(43===a)return!1;if(32===a||10===a)return!1;for(r=u+2;r<s&&43===e.src.charCodeAt(r);)r++;if(r!==u+2)return e.pos+=r-u,t||(e.pending+=e.src.slice(u,r)),!0;for(e.pos=u+2,o=1;e.pos+1<s;){if(43===e.src.charCodeAt(e.pos)&&43===e.src.charCodeAt(e.pos+1)&&(i=e.src.charCodeAt(e.pos-1),43!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&43!==i&&(32!==i&&10!==i?o--:32!==a&&10!==a&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=u+2,t||(e.push({type:"ins_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"ins_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=u,!1)}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,s=e.posMax,u=e.pos;if(61!==e.src.charCodeAt(u))return!1;if(t)return!1;if(u+4>=s)return!1;if(61!==e.src.charCodeAt(u+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(i=u>0?e.src.charCodeAt(u-1):-1,a=e.src.charCodeAt(u+2),61===i)return!1;if(61===a)return!1;if(32===a||10===a)return!1;for(r=u+2;r<s&&61===e.src.charCodeAt(r);)r++;if(r!==u+2)return e.pos+=r-u,t||(e.pending+=e.src.slice(u,r)),!0;for(e.pos=u+2,o=1;e.pos+1<s;){if(61===e.src.charCodeAt(e.pos)&&61===e.src.charCodeAt(e.pos+1)&&(i=e.src.charCodeAt(e.pos-1),61!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&61!==i&&(32!==i&&10!==i?o--:32!==a&&10!==a&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=u+2,t||(e.push({type:"mark_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"mark_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=u,!1)}},function(e,t,n){"use strict";function r(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function o(e,t){var n,o,i,a=t,s=!0,u=!0,c=e.posMax,l=e.src.charCodeAt(t);for(n=t>0?e.src.charCodeAt(t-1):-1;a<c&&e.src.charCodeAt(a)===l;)a++;return a>=c&&(s=!1),(i=a-t)>=4?s=u=!1:(32!==(o=a<c?e.src.charCodeAt(a):-1)&&10!==o||(s=!1),32!==n&&10!==n||(u=!1),95===l&&(r(n)&&(s=!1),r(o)&&(u=!1))),{can_open:s,can_close:u,delims:i}}e.exports=function(e,t){var n,r,i,a,s,u,c,l=e.posMax,p=e.pos,f=e.src.charCodeAt(p);if(95!==f&&42!==f)return!1;if(t)return!1;if(n=(c=o(e,p)).delims,!c.can_open)return e.pos+=n,t||(e.pending+=e.src.slice(p,e.pos)),!0;if(e.level>=e.options.maxNesting)return!1;for(e.pos=p+n,u=[n];e.pos<l;)if(e.src.charCodeAt(e.pos)!==f)e.parser.skipToken(e);else{if(r=(c=o(e,e.pos)).delims,c.can_close){for(a=u.pop(),s=r;a!==s;){if(s<a){u.push(a-s);break}if(s-=a,0===u.length)break;e.pos+=a,a=u.pop()}if(0===u.length){n=a,i=!0;break}e.pos+=r;continue}c.can_open&&u.push(r),e.pos+=r}return i?(e.posMax=e.pos,e.pos=p+n,t||(2!==n&&3!==n||e.push({type:"strong_open",level:e.level++}),1!==n&&3!==n||e.push({type:"em_open",level:e.level++}),e.parser.tokenize(e),1!==n&&3!==n||e.push({type:"em_close",level:--e.level}),2!==n&&3!==n||e.push({type:"strong_close",level:--e.level})),e.pos=e.posMax+n,e.posMax=l,!0):(e.pos=p,!1)}},function(e,t,n){"use strict";var r=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;e.exports=function(e,t){var n,o,i=e.posMax,a=e.pos;if(126!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+2>=i)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=a+1;e.pos<i;){if(126===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&a+1!==e.pos?(o=e.src.slice(a+1,e.pos)).match(/(^|[^\\])(\\\\)*\s/)?(e.pos=a,!1):(e.posMax=e.pos,e.pos=a+1,t||e.push({type:"sub",level:e.level,content:o.replace(r,"$1")}),e.pos=e.posMax+1,e.posMax=i,!0):(e.pos=a,!1)}},function(e,t,n){"use strict";var r=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;e.exports=function(e,t){var n,o,i=e.posMax,a=e.pos;if(94!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+2>=i)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=a+1;e.pos<i;){if(94===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&a+1!==e.pos?(o=e.src.slice(a+1,e.pos)).match(/(^|[^\\])(\\\\)*\s/)?(e.pos=a,!1):(e.posMax=e.pos,e.pos=a+1,t||e.push({type:"sup",level:e.level,content:o.replace(r,"$1")}),e.pos=e.posMax+1,e.posMax=i,!0):(e.pos=a,!1)}},function(e,t,n){"use strict";var r=n(191),o=n(464),i=n(466),a=n(467);e.exports=function(e,t){var n,s,u,c,l,p,f,h,d=!1,m=e.pos,v=e.posMax,g=e.pos,y=e.src.charCodeAt(g);if(33===y&&(d=!0,y=e.src.charCodeAt(++g)),91!==y)return!1;if(e.level>=e.options.maxNesting)return!1;if(n=g+1,(s=r(e,g))<0)return!1;if((p=s+1)<v&&40===e.src.charCodeAt(p)){for(p++;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);if(p>=v)return!1;for(g=p,o(e,p)?(c=e.linkContent,p=e.pos):c="",g=p;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);if(p<v&&g!==p&&i(e,p))for(l=e.linkContent,p=e.pos;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);else l="";if(p>=v||41!==e.src.charCodeAt(p))return e.pos=m,!1;p++}else{if(e.linkLevel>0)return!1;for(;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);if(p<v&&91===e.src.charCodeAt(p)&&(g=p+1,(p=r(e,p))>=0?u=e.src.slice(g,p++):p=g-1),u||(void 0===u&&(p=s+1),u=e.src.slice(n,s)),!(f=e.env.references[a(u)]))return e.pos=m,!1;c=f.href,l=f.title}return t||(e.pos=n,e.posMax=s,d?e.push({type:"image",src:c,title:l,alt:e.src.substr(n,s-n),level:e.level}):(e.push({type:"link_open",href:c,title:l,level:e.level++}),e.linkLevel++,e.parser.tokenize(e),e.linkLevel--,e.push({type:"link_close",level:--e.level}))),e.pos=p,e.posMax=v,!0}},function(e,t,n){"use strict";var r=n(191);e.exports=function(e,t){var n,o,i,a,s=e.posMax,u=e.pos;return!(u+2>=s)&&(94===e.src.charCodeAt(u)&&(91===e.src.charCodeAt(u+1)&&(!(e.level>=e.options.maxNesting)&&(n=u+2,!((o=r(e,u+1))<0)&&(t||(e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.list||(e.env.footnotes.list=[]),i=e.env.footnotes.list.length,e.pos=n,e.posMax=o,e.push({type:"footnote_ref",id:i,level:e.level}),e.linkLevel++,a=e.tokens.length,e.parser.tokenize(e),e.env.footnotes.list[i]={tokens:e.tokens.splice(a)},e.linkLevel--),e.pos=o+1,e.posMax=s,!0)))))}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a=e.posMax,s=e.pos;if(s+3>a)return!1;if(!e.env.footnotes||!e.env.footnotes.refs)return!1;if(91!==e.src.charCodeAt(s))return!1;if(94!==e.src.charCodeAt(s+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(r=s+2;r<a;r++){if(32===e.src.charCodeAt(r))return!1;if(10===e.src.charCodeAt(r))return!1;if(93===e.src.charCodeAt(r))break}return r!==s+2&&(!(r>=a)&&(r++,n=e.src.slice(s+2,r-1),void 0!==e.env.footnotes.refs[":"+n]&&(t||(e.env.footnotes.list||(e.env.footnotes.list=[]),e.env.footnotes.refs[":"+n]<0?(o=e.env.footnotes.list.length,e.env.footnotes.list[o]={label:n,count:0},e.env.footnotes.refs[":"+n]=o):o=e.env.footnotes.refs[":"+n],i=e.env.footnotes.list[o].count,e.env.footnotes.list[o].count++,e.push({type:"footnote_ref",id:o,subId:i,level:e.level})),e.pos=r,e.posMax=a,!0)))}},function(e,t,n){"use strict";var r=n(1024),o=n(465),i=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,a=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;e.exports=function(e,t){var n,s,u,c,l,p=e.pos;return 60===e.src.charCodeAt(p)&&(!((n=e.src.slice(p)).indexOf(">")<0)&&((s=n.match(a))?!(r.indexOf(s[1].toLowerCase())<0)&&(c=s[0].slice(1,-1),l=o(c),!!e.parser.validateLink(c)&&(t||(e.push({type:"link_open",href:l,level:e.level}),e.push({type:"text",content:c,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=s[0].length,!0)):!!(u=n.match(i))&&(c=u[0].slice(1,-1),l=o("mailto:"+c),!!e.parser.validateLink(l)&&(t||(e.push({type:"link_open",href:l,level:e.level}),e.push({type:"text",content:c,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=u[0].length,!0))))}},function(e,t,n){"use strict";e.exports=["coap","doi","javascript","aaa","aaas","about","acap","cap","cid","crid","data","dav","dict","dns","file","ftp","geo","go","gopher","h323","http","https","iax","icap","im","imap","info","ipp","iris","iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid","msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp","opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve","sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet","tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon","xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s","adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin","bolo","callto","chrome","chrome-extension","com-eventbrite-attendee","content","cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb","ed2k","facetime","feed","finger","fish","gg","git","gizmoproject","gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms","keyparc","lastfm","ldaps","magnet","maps","market","message","mms","ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi","platform","proxy","psyc","query","res","resource","rmi","rsync","rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify","ssh","steam","svn","teamspeak","things","udp","unreal","ut2004","ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri","ymsgr"]},function(e,t,n){"use strict";var r=n(1026).HTML_TAG_RE;e.exports=function(e,t){var n,o,i,a=e.pos;return!!e.options.html&&(i=e.posMax,!(60!==e.src.charCodeAt(a)||a+2>=i)&&(!(33!==(n=e.src.charCodeAt(a+1))&&63!==n&&47!==n&&!function(e){var t=32|e;return t>=97&&t<=122}(n))&&(!!(o=e.src.slice(a).match(r))&&(t||e.push({type:"htmltag",content:e.src.slice(a,a+o[0].length),level:e.level}),e.pos+=o[0].length,!0))))}},function(e,t,n){"use strict";function r(e,t){return e=e.source,t=t||"",function n(r,o){return r?(o=o.source||o,e=e.replace(r,o),n):new RegExp(e,t)}}var o=r(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",/[^"'=<>`\x00-\x20]+/)("single_quoted",/'[^']*'/)("double_quoted",/"[^"]*"/)(),i=r(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",/[a-zA-Z_:][a-zA-Z0-9:._-]*/)("attr_value",o)(),a=r(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute",i)(),s=r(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",a)("close_tag",/<\/[A-Za-z][A-Za-z0-9]*\s*>/)("comment",/<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/)("processing",/<[?].*?[?]>/)("declaration",/<![A-Z]+\s+[^>]*>/)("cdata",/<!\[CDATA\[[\s\S]*?\]\]>/)();e.exports.HTML_TAG_RE=s},function(e,t,n){"use strict";var r=n(463),o=n(39).has,i=n(39).isValidEntityCode,a=n(39).fromCodePoint,s=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,u=/^&([a-z][a-z0-9]{1,31});/i;e.exports=function(e,t){var n,c,l=e.pos,p=e.posMax;if(38!==e.src.charCodeAt(l))return!1;if(l+1<p)if(35===e.src.charCodeAt(l+1)){if(c=e.src.slice(l).match(s))return t||(n="x"===c[1][0].toLowerCase()?parseInt(c[1].slice(1),16):parseInt(c[1],10),e.pending+=i(n)?a(n):a(65533)),e.pos+=c[0].length,!0}else if((c=e.src.slice(l).match(u))&&o(r,c[1]))return t||(e.pending+=r[c[1]]),e.pos+=c[0].length,!0;return t||(e.pending+="&"),e.pos++,!0}},function(e,t,n){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","replacements","linkify","smartquotes","references","abbr2","footnote_tail"]},block:{rules:["blockquote","code","fences","footnote","heading","hr","htmlblock","lheading","list","paragraph","table"]},inline:{rules:["autolink","backticks","del","emphasis","entity","escape","footnote_ref","htmltag","links","newline","text"]}}}},function(e,t,n){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}}},function(e,t,n){"use strict";e.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","abbr2"]},block:{rules:["blockquote","code","fences","heading","hr","htmlblock","lheading","list","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","htmltag","links","newline","text"]}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebounceInput=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=s(n(0)),a=s(n(1032));function s(e){return e&&e.__esModule?e:{default:e}}(t.DebounceInput=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onChange=function(e){e.persist();var t=n.state.value;n.setState({value:e.target.value},function(){var o=n.state.value;o.length>=n.props.minLength?n.notify(e):t.length>o.length&&n.notify(r({},e,{target:r({},e.target,{value:""})}))})},n.onKeyDown=function(e){var t=n.props.onKeyDown;"Enter"===e.key&&n.forceNotify(e),t&&t(e)},n.onBlur=function(e){var t=n.props.onBlur;n.forceNotify(e),t&&t(e)},n.createNotifier=function(e){if(e<0)n.notify=function(){return null};else if(0===e)n.notify=n.doNotify;else{var t=(0,a.default)(function(e){n.isDebouncing=!1,n.doNotify(e)},e);n.notify=function(e){n.isDebouncing=!0,t(e)},n.flush=function(){return t.flush()},n.cancel=function(){n.isDebouncing=!1,t.cancel()}}},n.doNotify=function(){var e=n.props.onChange;e.apply(void 0,arguments)},n.forceNotify=function(e){if(n.isDebouncing){n.cancel&&n.cancel();var t=n.state.value,o=n.props.minLength;t.length>=o?n.doNotify(e):n.doNotify(r({},e,{target:r({},e.target,{value:t})}))}},n.state={value:e.value||""},n.isDebouncing=!1,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.default.PureComponent),o(t,[{key:"componentWillMount",value:function(){this.createNotifier(this.props.debounceTimeout)}},{key:"componentWillReceiveProps",value:function(e){var t=e.value,n=e.debounceTimeout;this.isDebouncing||(void 0!==t&&this.state.value!==t&&this.setState({value:t}),n!==this.props.debounceTimeout&&this.createNotifier(n))}},{key:"componentWillUnmount",value:function(){this.flush&&this.flush()}},{key:"render",value:function(){var e=this.props,t=e.element,n=(e.onChange,e.value,e.minLength,e.debounceTimeout,e.forceNotifyByEnter),o=e.forceNotifyOnBlur,a=e.onKeyDown,s=e.onBlur,u=e.inputRef,c=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["element","onChange","value","minLength","debounceTimeout","forceNotifyByEnter","forceNotifyOnBlur","onKeyDown","onBlur","inputRef"]),l=void 0;l=n?{onKeyDown:this.onKeyDown}:a?{onKeyDown:a}:{};var p=void 0;p=o?{onBlur:this.onBlur}:s?{onBlur:s}:{};var f=u?{ref:u}:{};return i.default.createElement(t,r({},c,{onChange:this.onChange,value:this.state.value},l,p,f))}}]),t}()).defaultProps={element:"input",type:"text",onKeyDown:void 0,onBlur:void 0,value:void 0,minLength:0,debounceTimeout:100,forceNotifyByEnter:!0,forceNotifyOnBlur:!0,inputRef:void 0}},function(e,t,n){(function(t){var n="Expected a function",r=NaN,o="[object Symbol]",i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt,l="object"==typeof t&&t&&t.Object===Object&&t,p="object"==typeof self&&self&&self.Object===Object&&self,f=l||p||Function("return this")(),h=Object.prototype.toString,d=Math.max,m=Math.min,v=function(){return f.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&h.call(e)==o}(e))return r;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=s.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):a.test(e)?r:+e}e.exports=function(e,t,r){var o,i,a,s,u,c,l=0,p=!1,f=!1,h=!0;if("function"!=typeof e)throw new TypeError(n);function b(t){var n=o,r=i;return o=i=void 0,l=t,s=e.apply(r,n)}function _(e){var n=e-c;return void 0===c||n>=t||n<0||f&&e-l>=a}function w(){var e=v();if(_(e))return x(e);u=setTimeout(w,function(e){var n=t-(e-c);return f?m(n,a-(e-l)):n}(e))}function x(e){return u=void 0,h&&o?b(e):(o=i=void 0,s)}function E(){var e=v(),n=_(e);if(o=arguments,i=this,c=e,n){if(void 0===u)return function(e){return l=e,u=setTimeout(w,t),p?b(e):s}(c);if(f)return u=setTimeout(w,t),b(c)}return void 0===u&&(u=setTimeout(w,t)),s}return t=y(t)||0,g(r)&&(p=!!r.leading,a=(f="maxWait"in r)?d(y(r.maxWait)||0,t):a,h="trailing"in r?!!r.trailing:h),E.cancel=function(){void 0!==u&&clearTimeout(u),l=0,o=c=i=u=void 0},E.flush=function(){return void 0===u?s:x(v())},E}}).call(this,n(36))},function(e,t,n){var r={"./all.js":328,"./auth/actions.js":71,"./auth/index.js":290,"./auth/reducers.js":291,"./auth/selectors.js":292,"./auth/spec-wrap-actions.js":293,"./configs/actions.js":121,"./configs/helpers.js":147,"./configs/index.js":329,"./configs/reducers.js":298,"./configs/selectors.js":297,"./configs/spec-actions.js":296,"./deep-linking/helpers.js":149,"./deep-linking/index.js":299,"./deep-linking/layout.js":300,"./deep-linking/operation-tag-wrapper.jsx":302,"./deep-linking/operation-wrapper.jsx":301,"./download-url.js":295,"./err/actions.js":44,"./err/error-transformers/hook.js":96,"./err/error-transformers/transformers/not-of-type.js":275,"./err/error-transformers/transformers/parameter-oneof.js":276,"./err/index.js":273,"./err/reducers.js":274,"./err/selectors.js":277,"./filter/index.js":303,"./filter/opsFilter.js":304,"./layout/actions.js":79,"./layout/index.js":278,"./layout/reducers.js":279,"./layout/selectors.js":280,"./logs/index.js":287,"./oas3/actions.js":62,"./oas3/auth-extensions/wrap-selectors.js":308,"./oas3/components/callbacks.jsx":311,"./oas3/components/http-auth.jsx":317,"./oas3/components/index.js":310,"./oas3/components/operation-link.jsx":313,"./oas3/components/operation-servers.jsx":318,"./oas3/components/request-body-editor.jsx":316,"./oas3/components/request-body.jsx":312,"./oas3/components/servers-container.jsx":315,"./oas3/components/servers.jsx":314,"./oas3/helpers.jsx":24,"./oas3/index.js":306,"./oas3/reducers.js":327,"./oas3/selectors.js":326,"./oas3/spec-extensions/selectors.js":309,"./oas3/spec-extensions/wrap-selectors.js":307,"./oas3/wrap-components/auth-item.jsx":321,"./oas3/wrap-components/index.js":319,"./oas3/wrap-components/json-schema-string.jsx":325,"./oas3/wrap-components/markdown.jsx":320,"./oas3/wrap-components/model.jsx":324,"./oas3/wrap-components/online-validator-badge.js":323,"./oas3/wrap-components/version-stamp.jsx":322,"./on-complete/index.js":305,"./samples/fn.js":120,"./samples/index.js":286,"./spec/actions.js":29,"./spec/index.js":281,"./spec/reducers.js":282,"./spec/selectors.js":70,"./spec/wrap-actions.js":284,"./swagger-js/configs-wrap-actions.js":289,"./swagger-js/index.js":288,"./util/index.js":294,"./view/index.js":285,"./view/root-injects.jsx":148};function o(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=i,e.exports=o,o.id=1033},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"Container",function(){return jt}),n.d(r,"Col",function(){return It}),n.d(r,"Row",function(){return Mt}),n.d(r,"Button",function(){return Nt}),n.d(r,"TextArea",function(){return Rt}),n.d(r,"Input",function(){return Dt}),n.d(r,"Select",function(){return Lt}),n.d(r,"Link",function(){return Ut}),n.d(r,"Collapse",function(){return Ft});var o={};n.r(o),n.d(o,"JsonSchemaForm",function(){return Tn}),n.d(o,"JsonSchema_string",function(){return jn}),n.d(o,"JsonSchema_array",function(){return Pn}),n.d(o,"JsonSchema_boolean",function(){return In}),n.d(o,"JsonSchema_object",function(){return Mn});var i=n(28),a=n.n(i),s=n(17),u=n.n(s),c=n(26),l=n.n(c),p=n(80),f=n.n(p),h=n(14),d=n.n(h),m=n(2),v=n.n(m),g=n(16),y=n.n(g),b=n(4),_=n.n(b),w=n(5),x=n.n(w),E=n(0),S=n.n(E),C=n(124),k=n(1),O=n.n(k),A=n(470),T=n(119),j=n.n(T),P=n(145),I=n.n(P),M=n(44),N=n(18),R=n.n(N),D=n(3),L=function(e){return e};var U=function(){function e(){var t,n,r,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_()(this,e),f()(this,{state:{},plugins:[],system:{configs:{},fn:{},components:{},rootInjects:{},statePlugins:{}},boundSystem:{},toolbox:{}},o),this.getSystem=this._getSystem.bind(this),this.store=(t=L,n=Object(k.fromJS)(this.state),r=this.getSystem,function(e,t,n){var r=[Object(D.J)(n)],o=R.a.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||C.compose;return Object(C.createStore)(e,t,o(C.applyMiddleware.apply(void 0,r)))}(t,n,r)),this.buildSystem(!1),this.register(this.plugins)}return x()(e,[{key:"getStore",value:function(){return this.store}},{key:"register",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=q(e,this.getSystem());B(this.system,n),t&&this.buildSystem();var r=F.call(this.system,e,this.getSystem());r&&this.buildSystem()}},{key:"buildSystem",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.getStore().dispatch,n=this.getStore().getState;this.boundSystem=y()({},this.getRootInjects(),this.getWrappedAndBoundActions(t),this.getWrappedAndBoundSelectors(n,this.getSystem),this.getStateThunks(n),this.getFn(),this.getConfigs()),e&&this.rebuildReducer()}},{key:"_getSystem",value:function(){return this.boundSystem}},{key:"getRootInjects",value:function(){return y()({getSystem:this.getSystem,getStore:this.getStore.bind(this),getComponents:this.getComponents.bind(this),getState:this.getStore().getState,getConfigs:this._getConfigs.bind(this),Im:O.a,React:S.a},this.system.rootInjects||{})}},{key:"_getConfigs",value:function(){return this.system.configs}},{key:"getConfigs",value:function(){return{configs:this.system.configs}}},{key:"setConfigs",value:function(e){this.system.configs=e}},{key:"rebuildReducer",value:function(){var e,t,n;this.store.replaceReducer((n=this.system.statePlugins,e=Object(D.y)(n,function(e){return e.reducers}),t=u()(e).reduce(function(t,n){var r;return t[n]=(r=e[n],function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new k.Map,t=arguments.length>1?arguments[1]:void 0;if(!r)return e;var n=r[t.type];if(n){var o=z(n)(e,t);return null===o?e:o}return e}),t},{}),u()(t).length?Object(A.combineReducers)(t):L))}},{key:"getType",value:function(e){var t=e[0].toUpperCase()+e.slice(1);return Object(D.z)(this.system.statePlugins,function(n,r){var o=n[e];if(o)return v()({},r+t,o)})}},{key:"getSelectors",value:function(){return this.getType("selectors")}},{key:"getActions",value:function(){var e=this.getType("actions");return Object(D.y)(e,function(e){return Object(D.z)(e,function(e,t){if(Object(D.r)(e))return v()({},t,e)})})}},{key:"getWrappedAndBoundActions",value:function(e){var t=this,n=this.getBoundActions(e);return Object(D.y)(n,function(e,n){var r=t.system.statePlugins[n.slice(0,-7)].wrapActions;return r?Object(D.y)(e,function(e,n){var o=r[n];return o?(d()(o)||(o=[o]),o.reduce(function(e,n){var r=function(){return n(e,t.getSystem()).apply(void 0,arguments)};if(!Object(D.r)(r))throw new TypeError("wrapActions needs to return a function that returns a new function (ie the wrapped action)");return z(r)},e||Function.prototype)):e}):e})}},{key:"getWrappedAndBoundSelectors",value:function(e,t){var n=this,r=this.getBoundSelectors(e,t);return Object(D.y)(r,function(t,r){var o=[r.slice(0,-9)],i=n.system.statePlugins[o].wrapSelectors;return i?Object(D.y)(t,function(t,r){var a=i[r];return a?(d()(a)||(a=[a]),a.reduce(function(t,r){var i=function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r(t,n.getSystem()).apply(void 0,[e().getIn(o)].concat(a))};if(!Object(D.r)(i))throw new TypeError("wrapSelector needs to return a function that returns a new function (ie the wrapped action)");return i},t||Function.prototype)):t}):t})}},{key:"getStates",value:function(e){return u()(this.system.statePlugins).reduce(function(t,n){return t[n]=e.get(n),t},{})}},{key:"getStateThunks",value:function(e){return u()(this.system.statePlugins).reduce(function(t,n){return t[n]=function(){return e().get(n)},t},{})}},{key:"getFn",value:function(){return{fn:this.system.fn}}},{key:"getComponents",value:function(e){var t=this,n=this.system.components[e];return d()(n)?n.reduce(function(e,n){return n(e,t.getSystem())}):void 0!==e?this.system.components[e]:this.system.components}},{key:"getBoundSelectors",value:function(e,t){return Object(D.y)(this.getSelectors(),function(n,r){var o=[r.slice(0,-9)],i=function(){return e().getIn(o)};return Object(D.y)(n,function(e){return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=z(e).apply(null,[i()].concat(r));return"function"==typeof a&&(a=z(a)(t())),a}})})}},{key:"getBoundActions",value:function(e){e=e||this.getStore().dispatch;var t=this.getActions();return Object(D.y)(t,function(t){return Object(C.bindActionCreators)(function e(t){return"function"!=typeof t?Object(D.y)(t,function(t){return e(t)}):function(){var e=null;try{e=t.apply(void 0,arguments)}catch(t){e={type:M.NEW_THROWN_ERR,error:!0,payload:j()(t)}}finally{return e}}}(t),e)})}},{key:"getMapStateToProps",value:function(){var e=this;return function(){return y()({},e.getSystem())}}},{key:"getMapDispatchToProps",value:function(e){var t=this;return function(n){return f()({},t.getWrappedAndBoundActions(n),t.getFn(),e)}}}]),e}();function q(e,t){return Object(D.u)(e)&&!Object(D.q)(e)?I()({},e):Object(D.s)(e)?q(e(t),t):Object(D.q)(e)?e.map(function(e){return q(e,t)}).reduce(B,{}):{}}function F(e,t){var n=this,r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).hasLoaded;return Object(D.u)(e)&&!Object(D.q)(e)&&"function"==typeof e.afterLoad&&(r=!0,z(e.afterLoad).call(this,t)),Object(D.s)(e)?F.call(this,e(t),t,{hasLoaded:r}):Object(D.q)(e)?e.map(function(e){return F.call(n,e,t,{hasLoaded:r})}):r}function B(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Object(D.u)(e))return{};if(!Object(D.u)(t))return e;t.wrapComponents&&(Object(D.y)(t.wrapComponents,function(n,r){var o=e.components&&e.components[r];o&&d()(o)?(e.components[r]=o.concat([n]),delete t.wrapComponents[r]):o&&(e.components[r]=[o,n],delete t.wrapComponents[r])}),u()(t.wrapComponents).length||delete t.wrapComponents);var n=e.statePlugins;if(Object(D.u)(n))for(var r in n){var o=n[r];if(Object(D.u)(o)&&Object(D.u)(o.wrapActions)){var i=o.wrapActions;for(var a in i){var s=i[a];d()(s)||(s=[s],i[a]=s),t&&t.statePlugins&&t.statePlugins[r]&&t.statePlugins[r].wrapActions&&t.statePlugins[r].wrapActions[a]&&(t.statePlugins[r].wrapActions[a]=i[a].concat(t.statePlugins[r].wrapActions[a]))}}}return f()(e,t)}function z(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).logErrors,n=void 0===t||t;return"function"!=typeof e?e:function(){try{for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return e.call.apply(e,[this].concat(r))}catch(e){return n&&console.error(e),null}}}var V=n(273),H=n(278),W=n(281),J=n(285),K=n(286),Y=n(287),$=n(288),G=n(290),Z=n(294),X=n(295),Q=n(329),ee=n(299),te=n(303),ne=n(305),re=n(6),oe=n.n(re),ie=n(7),ae=n.n(ie),se=n(9),ue=n.n(se),ce=n(8),le=n.n(ce),pe=(n(10),n(19),n(56).helpers.opId),fe=function(e){function t(e,n){var r;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"toggleShown",function(){var e=r.props,t=e.layoutActions,n=e.tag,o=e.operationId,i=e.isShown,a=r.getResolvedSubtree();i||void 0!==a||r.requestResolvedSubtree(),t.show(["operations",n,o],!i)}),v()(ue()(r),"onCancelClick",function(){r.setState({tryItOutEnabled:!r.state.tryItOutEnabled})}),v()(ue()(r),"onTryoutClick",function(){var e=r.props,t=e.specActions,n=e.path,o=e.method;r.setState({tryItOutEnabled:!r.state.tryItOutEnabled}),t.clearValidateParams([n,o])}),v()(ue()(r),"onExecute",function(){r.setState({executeInProgress:!0})}),v()(ue()(r),"getResolvedSubtree",function(){var e=r.props,t=e.specSelectors,n=e.path,o=e.method,i=e.specPath;return i?t.specResolvedSubtree(i.toJS()):t.specResolvedSubtree(["paths",n,o])}),v()(ue()(r),"requestResolvedSubtree",function(){var e=r.props,t=e.specActions,n=e.path,o=e.method,i=e.specPath;return i?t.requestResolvedSubtree(i.toJS()):t.requestResolvedSubtree(["paths",n,o])}),r.state={tryItOutEnabled:!1,executeInProgress:!1},r}return le()(t,e),x()(t,[{key:"mapStateToProps",value:function(e,t){var n=t.op,r=t.layoutSelectors,o=(0,t.getConfigs)(),i=o.docExpansion,a=o.deepLinking,s=o.displayOperationId,u=o.displayRequestDuration,c=o.supportedSubmitMethods,l=r.showSummary(),p=n.getIn(["operation","__originalOperationId"])||n.getIn(["operation","operationId"])||pe(n.get("operation"),t.path,t.method)||n.get("id"),f=["operations",t.tag,p],h=a&&"false"!==a,d=c.indexOf(t.method)>=0&&(void 0===t.allowTryItOut?t.specSelectors.allowTryItOutFor(t.path,t.method):t.allowTryItOut),m=n.getIn(["operation","security"])||t.specSelectors.security();return{operationId:p,isDeepLinkingEnabled:h,showSummary:l,displayOperationId:s,displayRequestDuration:u,allowTryItOut:d,security:m,isAuthorized:t.authSelectors.isAuthorized(m),isShown:r.isShown(f,"full"===i),jumpToKey:"paths.".concat(t.path,".").concat(t.method),response:t.specSelectors.responseFor(t.path,t.method),request:t.specSelectors.requestFor(t.path,t.method)}}},{key:"componentDidMount",value:function(){var e=this.props.isShown,t=this.getResolvedSubtree();e&&void 0===t&&this.requestResolvedSubtree()}},{key:"componentWillReceiveProps",value:function(e){var t=e.response,n=e.isShown,r=this.getResolvedSubtree();t!==this.props.response&&this.setState({executeInProgress:!1}),n&&void 0===r&&this.requestResolvedSubtree()}},{key:"render",value:function(){var e=this.props,t=e.op,n=e.tag,r=e.path,o=e.method,i=e.security,a=e.isAuthorized,s=e.operationId,u=e.showSummary,c=e.isShown,l=e.jumpToKey,p=e.allowTryItOut,f=e.response,h=e.request,d=e.displayOperationId,m=e.displayRequestDuration,v=e.isDeepLinkingEnabled,g=e.specPath,y=e.specSelectors,b=e.specActions,_=e.getComponent,w=e.getConfigs,x=e.layoutSelectors,E=e.layoutActions,C=e.authActions,O=e.authSelectors,A=e.oas3Actions,T=e.oas3Selectors,j=e.fn,P=_("operation"),I=this.getResolvedSubtree()||Object(k.Map)(),M=Object(k.fromJS)({op:I,tag:n,path:r,summary:t.getIn(["operation","summary"])||"",deprecated:I.get("deprecated")||t.getIn(["operation","deprecated"])||!1,method:o,security:i,isAuthorized:a,operationId:s,originalOperationId:I.getIn(["operation","__originalOperationId"]),showSummary:u,isShown:c,jumpToKey:l,allowTryItOut:p,request:h,displayOperationId:d,displayRequestDuration:m,isDeepLinkingEnabled:v,executeInProgress:this.state.executeInProgress,tryItOutEnabled:this.state.tryItOutEnabled});return S.a.createElement(P,{operation:M,response:f,request:h,isShown:c,toggleShown:this.toggleShown,onTryoutClick:this.onTryoutClick,onCancelClick:this.onCancelClick,onExecute:this.onExecute,specPath:g,specActions:b,specSelectors:y,oas3Actions:A,oas3Selectors:T,layoutActions:E,layoutSelectors:x,authActions:C,authSelectors:O,getComponent:_,getConfigs:w,fn:j})}}]),t}(E.PureComponent);v()(fe,"defaultProps",{showSummary:!0,response:null,allowTryItOut:!0,displayOperationId:!1,displayRequestDuration:!1});var he=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"getLayout",value:function(){var e=this.props,t=e.getComponent,n=e.layoutSelectors.current(),r=t(n,!0);return r||function(){return S.a.createElement("h1",null,' No layout defined for "',n,'" ')}}},{key:"render",value:function(){var e=this.getLayout();return S.a.createElement(e,null)}}]),t}(S.a.Component);he.defaultProps={};var de=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"close",function(){n.props.authActions.showDefinitions(!1)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.authSelectors,n=e.authActions,r=e.getComponent,o=e.errSelectors,i=e.specSelectors,a=e.fn.AST,s=void 0===a?{}:a,u=t.shownDefinitions(),c=r("auths");return S.a.createElement("div",{className:"dialog-ux"},S.a.createElement("div",{className:"backdrop-ux"}),S.a.createElement("div",{className:"modal-ux"},S.a.createElement("div",{className:"modal-dialog-ux"},S.a.createElement("div",{className:"modal-ux-inner"},S.a.createElement("div",{className:"modal-ux-header"},S.a.createElement("h3",null,"Available authorizations"),S.a.createElement("button",{type:"button",className:"close-modal",onClick:this.close},S.a.createElement("svg",{width:"20",height:"20"},S.a.createElement("use",{href:"#close",xlinkHref:"#close"})))),S.a.createElement("div",{className:"modal-ux-content"},u.valueSeq().map(function(e,a){return S.a.createElement(c,{key:a,AST:s,definitions:e,getComponent:r,errSelectors:o,authSelectors:t,authActions:n,specSelectors:i})}))))))}}]),t}(S.a.Component),me=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.isAuthorized,n=e.showPopup,r=e.onClick,o=(0,e.getComponent)("authorizationPopup",!0);return S.a.createElement("div",{className:"auth-wrapper"},S.a.createElement("button",{className:t?"btn authorize locked":"btn authorize unlocked",onClick:r},S.a.createElement("span",null,"Authorize"),S.a.createElement("svg",{width:"20",height:"20"},S.a.createElement("use",{href:t?"#locked":"#unlocked",xlinkHref:t?"#locked":"#unlocked"}))),n&&S.a.createElement(o,null))}}]),t}(S.a.Component),ve=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.authActions,n=e.authSelectors,r=e.specSelectors,o=e.getComponent,i=r.securityDefinitions(),a=n.definitionsToAuthorize(),s=o("authorizeBtn");return i?S.a.createElement(s,{onClick:function(){return t.showDefinitions(a)},isAuthorized:!!n.authorized().size,showPopup:!!n.shownDefinitions(),getComponent:o}):null}}]),t}(S.a.Component),ge=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onClick",function(e){e.stopPropagation();var t=n.props.onClick;t&&t()}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props.isAuthorized;return S.a.createElement("button",{className:e?"authorization__btn locked":"authorization__btn unlocked","aria-label":e?"authorization button locked":"authorization button unlocked",onClick:this.onClick},S.a.createElement("svg",{width:"20",height:"20"},S.a.createElement("use",{href:e?"#locked":"#unlocked",xlinkHref:e?"#locked":"#unlocked"})))}}]),t}(S.a.Component),ye=function(e){function t(e,n){var r;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"onAuthChange",function(e){var t=e.name;r.setState(v()({},t,e))}),v()(ue()(r),"submitAuth",function(e){e.preventDefault(),r.props.authActions.authorize(r.state)}),v()(ue()(r),"logoutClick",function(e){e.preventDefault();var t=r.props,n=t.authActions,o=t.definitions.map(function(e,t){return t}).toArray();r.setState(o.reduce(function(e,t){return e[t]="",e},{})),n.logout(o)}),v()(ue()(r),"close",function(e){e.preventDefault(),r.props.authActions.showDefinitions(!1)}),r.state={},r}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.definitions,r=t.getComponent,o=t.authSelectors,i=t.errSelectors,a=r("AuthItem"),s=r("oauth2",!0),u=r("Button"),c=o.authorized(),l=n.filter(function(e,t){return!!c.get(t)}),p=n.filter(function(e){return"oauth2"!==e.get("type")}),f=n.filter(function(e){return"oauth2"===e.get("type")});return S.a.createElement("div",{className:"auth-container"},!!p.size&&S.a.createElement("form",{onSubmit:this.submitAuth},p.map(function(t,n){return S.a.createElement(a,{key:n,schema:t,name:n,getComponent:r,onAuthChange:e.onAuthChange,authorized:c,errSelectors:i})}).toArray(),S.a.createElement("div",{className:"auth-btn-wrapper"},p.size===l.size?S.a.createElement(u,{className:"btn modal-btn auth",onClick:this.logoutClick},"Logout"):S.a.createElement(u,{type:"submit",className:"btn modal-btn auth authorize"},"Authorize"),S.a.createElement(u,{className:"btn modal-btn auth btn-done",onClick:this.close},"Close"))),f&&f.size?S.a.createElement("div",null,S.a.createElement("div",{className:"scope-def"},S.a.createElement("p",null,"Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes."),S.a.createElement("p",null,"API requires the following scopes. Select which ones you want to grant to Swagger UI.")),n.filter(function(e){return"oauth2"===e.get("type")}).map(function(e,t){return S.a.createElement("div",{key:t},S.a.createElement(s,{authorized:c,schema:e,name:t}))}).toArray()):null)}}]),t}(S.a.Component),be=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e,t=this.props,n=t.schema,r=t.name,o=t.getComponent,i=t.onAuthChange,a=t.authorized,s=t.errSelectors,u=o("apiKeyAuth"),c=o("basicAuth"),l=n.get("type");switch(l){case"apiKey":e=S.a.createElement(u,{key:r,schema:n,name:r,errSelectors:s,authorized:a,getComponent:o,onChange:i});break;case"basic":e=S.a.createElement(c,{key:r,schema:n,name:r,errSelectors:s,authorized:a,getComponent:o,onChange:i});break;default:e=S.a.createElement("div",{key:r},"Unknown security definition type ",l)}return S.a.createElement("div",{key:"".concat(r,"-jump")},e)}}]),t}(S.a.Component),_e=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props.error,t=e.get("level"),n=e.get("message"),r=e.get("source");return S.a.createElement("div",{className:"errors",style:{backgroundColor:"#ffeeee",color:"red",margin:"1em"}},S.a.createElement("b",{style:{textTransform:"capitalize",marginRight:"1em"}},r," ",t),S.a.createElement("span",null,n))}}]),t}(S.a.Component),we=function(e){function t(e,n){var r;_()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"onChange",function(e){var t=r.props.onChange,n=e.target.value,o=y()({},r.state,{value:n});r.setState(o),t(o)});var o=r.props,i=o.name,a=o.schema,s=r.getValue();return r.state={name:i,schema:a,value:s},r}return le()(t,e),x()(t,[{key:"getValue",value:function(){var e=this.props,t=e.name,n=e.authorized;return n&&n.getIn([t,"value"])}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.errSelectors,o=e.name,i=n("Input"),a=n("Row"),s=n("Col"),u=n("authError"),c=n("Markdown"),l=n("JumpToPath",!0),p=this.getValue(),f=r.allErrors().filter(function(e){return e.get("authId")===o});return S.a.createElement("div",null,S.a.createElement("h4",null,S.a.createElement("code",null,o||t.get("name")),"  (apiKey)",S.a.createElement(l,{path:["securityDefinitions",o]})),p&&S.a.createElement("h6",null,"Authorized"),S.a.createElement(a,null,S.a.createElement(c,{source:t.get("description")})),S.a.createElement(a,null,S.a.createElement("p",null,"Name: ",S.a.createElement("code",null,t.get("name")))),S.a.createElement(a,null,S.a.createElement("p",null,"In: ",S.a.createElement("code",null,t.get("in")))),S.a.createElement(a,null,S.a.createElement("label",null,"Value:"),p?S.a.createElement("code",null," ****** "):S.a.createElement(s,null,S.a.createElement(i,{type:"text",onChange:this.onChange}))),f.valueSeq().map(function(e,t){return S.a.createElement(u,{error:e,key:t})}))}}]),t}(S.a.Component),xe=function(e){function t(e,n){var r;_()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"onChange",function(e){var t=r.props.onChange,n=e.target,o=n.value,i=n.name,a=r.state.value;a[i]=o,r.setState({value:a}),t(r.state)});var o=r.props,i=o.schema,a=o.name,s=r.getValue().username;return r.state={name:a,schema:i,value:s?{username:s}:{}},r}return le()(t,e),x()(t,[{key:"getValue",value:function(){var e=this.props,t=e.authorized,n=e.name;return t&&t.getIn([n,"value"])||{}}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.name,o=e.errSelectors,i=n("Input"),a=n("Row"),s=n("Col"),u=n("authError"),c=n("JumpToPath",!0),l=n("Markdown"),p=this.getValue().username,f=o.allErrors().filter(function(e){return e.get("authId")===r});return S.a.createElement("div",null,S.a.createElement("h4",null,"Basic authorization",S.a.createElement(c,{path:["securityDefinitions",r]})),p&&S.a.createElement("h6",null,"Authorized"),S.a.createElement(a,null,S.a.createElement(l,{source:t.get("description")})),S.a.createElement(a,null,S.a.createElement("label",null,"Username:"),p?S.a.createElement("code",null," ",p," "):S.a.createElement(s,null,S.a.createElement(i,{type:"text",required:"required",name:"username",onChange:this.onChange}))),S.a.createElement(a,null,S.a.createElement("label",null,"Password:"),p?S.a.createElement("code",null," ****** "):S.a.createElement(s,null,S.a.createElement(i,{required:"required",autoComplete:"new-password",name:"password",type:"password",onChange:this.onChange}))),f.valueSeq().map(function(e,t){return S.a.createElement(u,{error:e,key:t})}))}}]),t}(S.a.Component);function Ee(e){var t=e.example,n=e.showValue,r=e.getComponent,o=r("Markdown"),i=r("highlightCode");return t?S.a.createElement("div",{className:"example"},t.get("description")?S.a.createElement("section",{className:"example__section"},S.a.createElement("div",{className:"example__section-header"},"Example Description"),S.a.createElement("p",null,S.a.createElement(o,{source:t.get("description")}))):null,n&&t.has("value")?S.a.createElement("section",{className:"example__section"},S.a.createElement("div",{className:"example__section-header"},"Example Value"),S.a.createElement(i,{value:Object(D.I)(t.get("value"))})):null):null}var Se=n(483),Ce=n.n(Se),ke=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"_onSelect",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.isSyntheticChange,o=void 0!==r&&r;"function"==typeof n.props.onSelect&&n.props.onSelect(e,{isSyntheticChange:o})}),v()(ue()(n),"_onDomSelect",function(e){if("function"==typeof n.props.onSelect){var t=e.target.selectedOptions[0].getAttribute("value");n._onSelect(t,{isSyntheticChange:!1})}}),v()(ue()(n),"getCurrentExample",function(){var e=n.props,t=e.examples,r=e.currentExampleKey,o=t.get(r),i=t.keySeq().first(),a=t.get(i);return o||a||Ce()({})}),n}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.onSelect,n=e.examples;if("function"==typeof t){var r=n.first(),o=n.keyOf(r);this._onSelect(o,{isSyntheticChange:!0})}}},{key:"componentWillReceiveProps",value:function(e){var t=e.currentExampleKey,n=e.examples;if(n!==this.props.examples&&!n.has(t)){var r=n.first(),o=n.keyOf(r);this._onSelect(o,{isSyntheticChange:!0})}}},{key:"render",value:function(){var e=this.props,t=e.examples,n=e.currentExampleKey,r=e.isValueModified,o=e.isModifiedValueAvailable,i=e.showLabels;return S.a.createElement("div",{className:"examples-select"},i?S.a.createElement("span",{className:"examples-select__section-label"},"Examples: "):null,S.a.createElement("select",{onChange:this._onDomSelect,value:o&&r?"__MODIFIED__VALUE__":n||""},o?S.a.createElement("option",{value:"__MODIFIED__VALUE__"},"[Modified value]"):null,t.map(function(e,t){return S.a.createElement("option",{key:t,value:t},e.get("summary")||t)}).valueSeq()))}}]),t}(S.a.PureComponent);v()(ke,"defaultProps",{examples:O.a.Map({}),onSelect:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=console).log.apply(e,["DEBUG: ExamplesSelect was not given an onSelect callback"].concat(n))},currentExampleKey:null,showLabels:!0});var Oe=function(e){return k.List.isList(e)?e:Object(D.I)(e)},Ae=function(e){function t(e){var n;_()(this,t),n=oe()(this,ae()(t).call(this,e)),v()(ue()(n),"_getStateForCurrentNamespace",function(){var e=n.props.currentNamespace;return(n.state[e]||Object(k.Map)()).toObject()}),v()(ue()(n),"_setStateForCurrentNamespace",function(e){var t=n.props.currentNamespace;return n._setStateForNamespace(t,e)}),v()(ue()(n),"_setStateForNamespace",function(e,t){var r=(n.state[e]||Object(k.Map)()).mergeDeep(t);return n.setState(v()({},e,r))}),v()(ue()(n),"_isCurrentUserInputSameAsExampleValue",function(){var e=n.props.currentUserInputValue;return n._getCurrentExampleValue()===e}),v()(ue()(n),"_getValueForExample",function(e,t){var r=(t||n.props).examples;return Oe((r||Object(k.Map)({})).getIn([e,"value"]))}),v()(ue()(n),"_getCurrentExampleValue",function(e){var t=(e||n.props).currentKey;return n._getValueForExample(t,e||n.props)}),v()(ue()(n),"_onExamplesSelect",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.isSyntheticChange,o=n.props,i=o.onSelect,a=o.updateValue,s=o.currentUserInputValue,u=n._getStateForCurrentNamespace(),c=u.lastUserEditedValue,l=n._getValueForExample(e);if("__MODIFIED__VALUE__"===e)return a(Oe(c)),n._setStateForCurrentNamespace({isModifiedValueSelected:!0});if("function"==typeof i){for(var p=arguments.length,f=new Array(p>2?p-2:0),h=2;h<p;h++)f[h-2]=arguments[h];i.apply(void 0,[e,{isSyntheticChange:r}].concat(f))}n._setStateForCurrentNamespace({lastDownstreamValue:l,isModifiedValueSelected:r&&!!s&&s!==l}),r||"function"==typeof a&&a(Oe(l))});var r=n._getCurrentExampleValue();return n.state=v()({},e.currentNamespace,Object(k.Map)({lastUserEditedValue:n.props.currentUserInputValue,lastDownstreamValue:r,isModifiedValueSelected:n.props.currentUserInputValue!==r})),n}return le()(t,e),x()(t,[{key:"componentWillReceiveProps",value:function(e){var t=e.currentUserInputValue,n=e.examples,r=e.onSelect,o=this._getStateForCurrentNamespace(),i=o.lastUserEditedValue,a=o.lastDownstreamValue,s=this._getValueForExample(e.currentKey,e),u=n.find(function(e){return e.get("value")===t||Object(D.I)(e.get("value"))===t});u?r(n.keyOf(u),{isSyntheticChange:!0}):t!==this.props.currentUserInputValue&&t!==i&&t!==a&&this._setStateForNamespace(e.currentNamespace,{lastUserEditedValue:e.currentUserInputValue,isModifiedValueSelected:t!==s})}},{key:"render",value:function(){var e=this.props,t=e.currentUserInputValue,n=e.examples,r=e.currentKey,o=e.getComponent,i=this._getStateForCurrentNamespace(),a=i.lastDownstreamValue,s=i.lastUserEditedValue,u=i.isModifiedValueSelected,c=o("ExamplesSelect");return S.a.createElement(c,{examples:n,currentExampleKey:r,onSelect:this._onExamplesSelect,isModifiedValueAvailable:!!s&&s!==a,isValueModified:void 0!==t&&u&&t!==this._getCurrentExampleValue()})}}]),t}(S.a.PureComponent);v()(Ae,"defaultProps",{examples:Object(k.Map)({}),currentNamespace:"__DEFAULT__NAMESPACE__",onSelect:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=console).log.apply(e,["ExamplesSelectValueRetainer: no `onSelect` function was provided"].concat(n))},updateValue:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=console).log.apply(e,["ExamplesSelectValueRetainer: no `updateValue` function was provided"].concat(n))}});var Te=function(e){function t(e,n){var r;_()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"close",function(e){e.preventDefault(),r.props.authActions.showDefinitions(!1)}),v()(ue()(r),"authorize",function(){var e=r.props,t=e.authActions,n=e.errActions,o=e.getConfigs,i=e.authSelectors,a=o(),s=i.getConfigs();n.clear({authId:name,type:"auth",source:"auth"}),function(e){var t=e.auth,n=e.authActions,r=e.errActions,o=e.configs,i=e.authConfigs,a=void 0===i?{}:i,s=t.schema,u=t.scopes,c=t.name,l=t.clientId,p=s.get("flow"),f=[];switch(p){case"password":return void n.authorizePassword(t);case"application":return void n.authorizeApplication(t);case"accessCode":f.push("response_type=code");break;case"implicit":f.push("response_type=token");break;case"clientCredentials":return void n.authorizeApplication(t);case"authorizationCode":f.push("response_type=code")}"string"==typeof l&&f.push("client_id="+encodeURIComponent(l));var h=o.oauth2RedirectUrl;if(void 0!==h){if(f.push("redirect_uri="+encodeURIComponent(h)),d()(u)&&0<u.length){var m=a.scopeSeparator||" ";f.push("scope="+encodeURIComponent(u.join(m)))}var v=Object(D.a)(new Date);if(f.push("state="+encodeURIComponent(v)),void 0!==a.realm&&f.push("realm="+encodeURIComponent(a.realm)),"authorizationCode"===p&&a.usePkceWithAuthorizationCodeGrant){var g=Object(D.j)(),y=Object(D.c)(g);f.push("code_challenge="+y),f.push("code_challenge_method=S256"),t.codeVerifier=g}var b=a.additionalQueryStringParams;for(var _ in b)void 0!==b[_]&&f.push([_,b[_]].map(encodeURIComponent).join("="));var w,x=s.get("authorizationUrl"),E=[Object(D.F)(x),f.join("&")].join(-1===x.indexOf("?")?"?":"&");w="implicit"===p?n.preAuthorizeImplicit:a.useBasicAuthenticationWithAccessCodeGrant?n.authorizeAccessCodeWithBasicAuthentication:n.authorizeAccessCodeWithFormParams,R.a.swaggerUIRedirectOauth2={auth:t,state:v,redirectUrl:h,callback:w,errCb:r.newAuthErr},R.a.open(E)}else r.newAuthErr({authId:c,source:"validation",level:"error",message:"oauth2RedirectUrl configuration is not passed. Oauth2 authorization cannot be performed."})}({auth:r.state,authActions:t,errActions:n,configs:a,authConfigs:s})}),v()(ue()(r),"onScopeChange",function(e){var t=e.target,n=t.checked,o=t.dataset.value;if(n&&-1===r.state.scopes.indexOf(o)){var i=r.state.scopes.concat([o]);r.setState({scopes:i})}else!n&&r.state.scopes.indexOf(o)>-1&&r.setState({scopes:r.state.scopes.filter(function(e){return e!==o})})}),v()(ue()(r),"onInputChange",function(e){var t=e.target,n=t.dataset.name,o=t.value,i=v()({},n,o);r.setState(i)}),v()(ue()(r),"logout",function(e){e.preventDefault();var t=r.props,n=t.authActions,o=t.errActions,i=t.name;o.clear({authId:i,type:"auth",source:"auth"}),n.logout([i])});var o=r.props,i=o.name,a=o.schema,s=o.authorized,u=o.authSelectors,c=s&&s.get(i),l=u.getConfigs()||{},p=c&&c.get("username")||"",f=c&&c.get("clientId")||l.clientId||"",h=c&&c.get("clientSecret")||l.clientSecret||"",m=c&&c.get("passwordType")||"basic";return r.state={appName:l.appName,name:i,schema:a,scopes:[],clientId:f,clientSecret:h,username:p,password:"",passwordType:m},r}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.schema,r=t.getComponent,o=t.authSelectors,i=t.errSelectors,a=t.name,s=t.specSelectors,u=r("Input"),c=r("Row"),l=r("Col"),p=r("Button"),f=r("authError"),h=r("JumpToPath",!0),d=r("Markdown"),m=r("InitializedInput"),v=s.isOAS3,g=v()?"authorizationCode":"accessCode",y=v()?"clientCredentials":"application",b=n.get("flow"),_=n.get("allowedScopes")||n.get("scopes"),w=!!o.authorized().get(a),x=i.allErrors().filter(function(e){return e.get("authId")===a}),E=!x.filter(function(e){return"validation"===e.get("source")}).size,C=n.get("description");return S.a.createElement("div",null,S.a.createElement("h4",null,a," (OAuth2, ",n.get("flow"),") ",S.a.createElement(h,{path:["securityDefinitions",a]})),this.state.appName?S.a.createElement("h5",null,"Application: ",this.state.appName," "):null,C&&S.a.createElement(d,{source:n.get("description")}),w&&S.a.createElement("h6",null,"Authorized"),("implicit"===b||b===g)&&S.a.createElement("p",null,"Authorization URL: ",S.a.createElement("code",null,n.get("authorizationUrl"))),("password"===b||b===g||b===y)&&S.a.createElement("p",null,"Token URL:",S.a.createElement("code",null," ",n.get("tokenUrl"))),S.a.createElement("p",{className:"flow"},"Flow: ",S.a.createElement("code",null,n.get("flow"))),"password"!==b?null:S.a.createElement(c,null,S.a.createElement(c,null,S.a.createElement("label",{htmlFor:"oauth_username"},"username:"),w?S.a.createElement("code",null," ",this.state.username," "):S.a.createElement(l,{tablet:10,desktop:10},S.a.createElement("input",{id:"oauth_username",type:"text","data-name":"username",onChange:this.onInputChange}))),S.a.createElement(c,null,S.a.createElement("label",{htmlFor:"oauth_password"},"password:"),w?S.a.createElement("code",null," ****** "):S.a.createElement(l,{tablet:10,desktop:10},S.a.createElement("input",{id:"oauth_password",type:"password","data-name":"password",onChange:this.onInputChange}))),S.a.createElement(c,null,S.a.createElement("label",{htmlFor:"password_type"},"Client credentials location:"),w?S.a.createElement("code",null," ",this.state.passwordType," "):S.a.createElement(l,{tablet:10,desktop:10},S.a.createElement("select",{id:"password_type","data-name":"passwordType",onChange:this.onInputChange},S.a.createElement("option",{value:"basic"},"Authorization header"),S.a.createElement("option",{value:"request-body"},"Request body"))))),(b===y||"implicit"===b||b===g||"password"===b)&&(!w||w&&this.state.clientId)&&S.a.createElement(c,null,S.a.createElement("label",{htmlFor:"client_id"},"client_id:"),w?S.a.createElement("code",null," ****** "):S.a.createElement(l,{tablet:10,desktop:10},S.a.createElement(m,{id:"client_id",type:"text",required:"password"===b,initialValue:this.state.clientId,"data-name":"clientId",onChange:this.onInputChange}))),(b===y||b===g||"password"===b)&&S.a.createElement(c,null,S.a.createElement("label",{htmlFor:"client_secret"},"client_secret:"),w?S.a.createElement("code",null," ****** "):S.a.createElement(l,{tablet:10,desktop:10},S.a.createElement(m,{id:"client_secret",initialValue:this.state.clientSecret,type:"password","data-name":"clientSecret",onChange:this.onInputChange}))),!w&&_&&_.size?S.a.createElement("div",{className:"scopes"},S.a.createElement("h2",null,"Scopes:"),_.map(function(t,n){return S.a.createElement(c,{key:n},S.a.createElement("div",{className:"checkbox"},S.a.createElement(u,{"data-value":n,id:"".concat(n,"-").concat(b,"-checkbox-").concat(e.state.name),disabled:w,type:"checkbox",onChange:e.onScopeChange}),S.a.createElement("label",{htmlFor:"".concat(n,"-").concat(b,"-checkbox-").concat(e.state.name)},S.a.createElement("span",{className:"item"}),S.a.createElement("div",{className:"text"},S.a.createElement("p",{className:"name"},n),S.a.createElement("p",{className:"description"},t)))))}).toArray()):null,x.valueSeq().map(function(e,t){return S.a.createElement(f,{error:e,key:t})}),S.a.createElement("div",{className:"auth-btn-wrapper"},E&&(w?S.a.createElement(p,{className:"btn modal-btn auth authorize",onClick:this.logout},"Logout"):S.a.createElement(p,{className:"btn modal-btn auth authorize",onClick:this.authorize},"Authorize")),S.a.createElement(p,{className:"btn modal-btn auth btn-done",onClick:this.close},"Close")))}}]),t}(S.a.Component),je=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onClick",function(){var e=n.props,t=e.specActions,r=e.path,o=e.method;t.clearResponse(r,o),t.clearRequest(r,o)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){return S.a.createElement("button",{className:"btn btn-clear opblock-control__btn",onClick:this.onClick},"Clear")}}]),t}(E.Component),Pe=function(e){var t=e.headers;return S.a.createElement("div",null,S.a.createElement("h5",null,"Response headers"),S.a.createElement("pre",{className:"microlight"},t))},Ie=function(e){var t=e.duration;return S.a.createElement("div",null,S.a.createElement("h5",null,"Request duration"),S.a.createElement("pre",{className:"microlight"},t," ms"))},Me=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.response!==e.response||this.props.path!==e.path||this.props.method!==e.method||this.props.displayRequestDuration!==e.displayRequestDuration}},{key:"render",value:function(){var e=this.props,t=e.response,n=e.getComponent,r=e.getConfigs,o=e.displayRequestDuration,i=e.specSelectors,a=e.path,s=e.method,c=r().showMutatedRequest?i.mutatedRequestFor(a,s):i.requestFor(a,s),l=t.get("status"),p=c.get("url"),f=t.get("headers").toJS(),h=t.get("notDocumented"),d=t.get("error"),m=t.get("text"),v=t.get("duration"),g=u()(f),y=f["content-type"]||f["Content-Type"],b=n("curl"),_=n("responseBody"),w=g.map(function(e){return S.a.createElement("span",{className:"headerline",key:e}," ",e,": ",f[e]," ")}),x=0!==w.length;return S.a.createElement("div",null,c&&S.a.createElement(b,{request:c}),p&&S.a.createElement("div",null,S.a.createElement("h4",null,"Request URL"),S.a.createElement("div",{className:"request-url"},S.a.createElement("pre",{className:"microlight"},p))),S.a.createElement("h4",null,"Server response"),S.a.createElement("table",{className:"responses-table live-responses-table"},S.a.createElement("thead",null,S.a.createElement("tr",{className:"responses-header"},S.a.createElement("td",{className:"col_header response-col_status"},"Code"),S.a.createElement("td",{className:"col_header response-col_description"},"Details"))),S.a.createElement("tbody",null,S.a.createElement("tr",{className:"response"},S.a.createElement("td",{className:"response-col_status"},l,h?S.a.createElement("div",{className:"response-undocumented"},S.a.createElement("i",null," Undocumented ")):null),S.a.createElement("td",{className:"response-col_description"},d?S.a.createElement("span",null,"".concat(t.get("name"),": ").concat(t.get("message"))):null,m?S.a.createElement(_,{content:m,contentType:y,url:p,headers:f,getComponent:n}):null,x?S.a.createElement(Pe,{headers:w}):null,o&&v?S.a.createElement(Ie,{duration:v}):null)))))}}]),t}(S.a.Component),Ne=n(95),Re=n.n(Ne),De=function(e){function t(e,n){var r;_()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"getDefinitionUrl",function(){var e=r.props.specSelectors;return new Re.a(e.url(),R.a.location).toString()});var o=(0,e.getConfigs)().validatorUrl;return r.state={url:r.getDefinitionUrl(),validatorUrl:void 0===o?"https://validator.swagger.io/validator":o},r}return le()(t,e),x()(t,[{key:"componentWillReceiveProps",value:function(e){var t=(0,e.getConfigs)().validatorUrl;this.setState({url:this.getDefinitionUrl(),validatorUrl:void 0===t?"https://validator.swagger.io/validator":t})}},{key:"render",value:function(){var e=(0,this.props.getConfigs)().spec,t=Object(D.F)(this.state.validatorUrl);return"object"===l()(e)&&u()(e).length?null:!this.state.url||!this.state.validatorUrl||this.state.url.indexOf("localhost")>=0||this.state.url.indexOf("127.0.0.1")>=0?null:S.a.createElement("span",{style:{float:"right"}},S.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"".concat(t,"/debug?url=").concat(encodeURIComponent(this.state.url))},S.a.createElement(Le,{src:"".concat(t,"?url=").concat(encodeURIComponent(this.state.url)),alt:"Online validator badge"})))}}]),t}(S.a.Component),Le=function(e){function t(e){var n;return _()(this,t),(n=oe()(this,ae()(t).call(this,e))).state={loaded:!1,error:!1},n}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){var e=this,t=new Image;t.onload=function(){e.setState({loaded:!0})},t.onerror=function(){e.setState({error:!0})},t.src=this.props.src}},{key:"componentWillReceiveProps",value:function(e){var t=this;if(e.src!==this.props.src){var n=new Image;n.onload=function(){t.setState({loaded:!0})},n.onerror=function(){t.setState({error:!0})},n.src=e.src}}},{key:"render",value:function(){return this.state.error?S.a.createElement("img",{alt:"Error"}):this.state.loaded?S.a.createElement("img",{src:this.props.src,alt:this.props.alt}):null}}]),t}(S.a.Component),Ue=["get","put","post","delete","options","head","patch"],qe=Ue.concat(["trace"]),Fe=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.getComponent,r=e.layoutSelectors,o=e.layoutActions,i=e.getConfigs,a=e.fn,s=t.taggedOperations(),u=n("OperationContainer",!0),c=n("OperationTag"),l=i().maxDisplayedTags,p=r.currentFilter();return p&&!0!==p&&(s=a.opsFilter(s,p)),l&&!isNaN(l)&&l>=0&&(s=s.slice(0,l)),S.a.createElement("div",null,s.map(function(e,a){var s=e.get("operations");return S.a.createElement(c,{key:"operation-"+a,tagObj:e,tag:a,layoutSelectors:r,layoutActions:o,getConfigs:i,getComponent:n},s.map(function(e){var n=e.get("path"),r=e.get("method"),o=O.a.List(["paths",n,r]);return-1===(t.isOAS3()?qe:Ue).indexOf(r)?null:S.a.createElement(u,{key:"".concat(n,"-").concat(r),specPath:o,op:e,path:n,method:r,tag:a})}).toArray())}).toArray(),s.size<1?S.a.createElement("h3",null," No operations defined in spec! "):null)}}]),t}(S.a.Component),Be=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.tagObj,n=e.tag,r=e.children,o=e.layoutSelectors,i=e.layoutActions,a=e.getConfigs,s=e.getComponent,u=a(),c=u.docExpansion,l=u.deepLinking,p=l&&"false"!==l,f=s("Collapse"),h=s("Markdown"),d=s("DeepLink"),m=s("Link"),v=t.getIn(["tagDetails","description"],null),g=t.getIn(["tagDetails","externalDocs","description"]),y=t.getIn(["tagDetails","externalDocs","url"]),b=["operations-tag",n],_=o.isShown(b,"full"===c||"list"===c);return S.a.createElement("div",{className:_?"opblock-tag-section is-open":"opblock-tag-section"},S.a.createElement("h4",{onClick:function(){return i.show(b,!_)},className:v?"opblock-tag":"opblock-tag no-desc",id:b.map(function(e){return Object(D.g)(e)}).join("-"),"data-tag":n,"data-is-open":_},S.a.createElement(d,{enabled:p,isShown:_,path:Object(D.d)(n),text:n}),v?S.a.createElement("small",null,S.a.createElement(h,{source:v})):S.a.createElement("small",null),S.a.createElement("div",null,g?S.a.createElement("small",null,g,y?": ":null,y?S.a.createElement(m,{href:Object(D.F)(y),onClick:function(e){return e.stopPropagation()},target:"_blank"},y):null):null),S.a.createElement("button",{className:"expand-operation",title:_?"Collapse operation":"Expand operation",onClick:function(){return i.show(b,!_)}},S.a.createElement("svg",{className:"arrow",width:"20",height:"20"},S.a.createElement("use",{href:_?"#large-arrow-down":"#large-arrow",xlinkHref:_?"#large-arrow-down":"#large-arrow"})))),S.a.createElement(f,{isOpened:_},r))}}]),t}(S.a.Component);v()(Be,"defaultProps",{tagObj:O.a.fromJS({}),tag:""});var ze=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.specPath,r=e.response,o=e.request,i=e.toggleShown,a=e.onTryoutClick,s=e.onCancelClick,u=e.onExecute,c=e.fn,l=e.getComponent,p=e.getConfigs,f=e.specActions,h=e.specSelectors,d=e.authActions,m=e.authSelectors,v=e.oas3Actions,g=e.oas3Selectors,y=this.props.operation,b=y.toJS(),_=b.deprecated,w=b.isShown,x=b.path,E=b.method,C=b.op,k=b.tag,O=b.operationId,A=b.allowTryItOut,T=b.displayRequestDuration,j=b.tryItOutEnabled,P=b.executeInProgress,I=C.description,M=C.externalDocs,N=C.schemes,R=y.getIn(["op"]),L=R.get("responses"),U=Object(D.n)(R,["parameters"]),q=h.operationScheme(x,E),F=["operations",k,O],B=Object(D.m)(R),z=l("responses"),V=l("parameters"),H=l("execute"),W=l("clear"),J=l("Collapse"),K=l("Markdown"),Y=l("schemes"),$=l("OperationServers"),G=l("OperationExt"),Z=l("OperationSummary"),X=l("Link"),Q=p().showExtensions;if(L&&r&&r.size>0){var ee=!L.get(String(r.get("status")))&&!L.get("default");r=r.set("notDocumented",ee)}var te=[x,E];return S.a.createElement("div",{className:_?"opblock opblock-deprecated":w?"opblock opblock-".concat(E," is-open"):"opblock opblock-".concat(E),id:Object(D.g)(F.join("-"))},S.a.createElement(Z,{operationProps:y,toggleShown:i,getComponent:l,authActions:d,authSelectors:m,specPath:t}),S.a.createElement(J,{isOpened:w},S.a.createElement("div",{className:"opblock-body"},R&&R.size||null===R?null:S.a.createElement("img",{height:"32px",width:"32px",src:n(462),className:"opblock-loading-animation"}),_&&S.a.createElement("h4",{className:"opblock-title_normal"}," Warning: Deprecated"),I&&S.a.createElement("div",{className:"opblock-description-wrapper"},S.a.createElement("div",{className:"opblock-description"},S.a.createElement(K,{source:I}))),M&&M.url?S.a.createElement("div",{className:"opblock-external-docs-wrapper"},S.a.createElement("h4",{className:"opblock-title_normal"},"Find more details"),S.a.createElement("div",{className:"opblock-external-docs"},S.a.createElement("span",{className:"opblock-external-docs__description"},S.a.createElement(K,{source:M.description})),S.a.createElement(X,{target:"_blank",className:"opblock-external-docs__link",href:Object(D.F)(M.url)},M.url))):null,R&&R.size?S.a.createElement(V,{parameters:U,specPath:t.push("parameters"),operation:R,onChangeKey:te,onTryoutClick:a,onCancelClick:s,tryItOutEnabled:j,allowTryItOut:A,fn:c,getComponent:l,specActions:f,specSelectors:h,pathMethod:[x,E],getConfigs:p,oas3Actions:v,oas3Selectors:g}):null,j?S.a.createElement($,{getComponent:l,path:x,method:E,operationServers:R.get("servers"),pathServers:h.paths().getIn([x,"servers"]),getSelectedServer:g.selectedServer,setSelectedServer:v.setSelectedServer,setServerVariableValue:v.setServerVariableValue,getServerVariable:g.serverVariableValue,getEffectiveServerValue:g.serverEffectiveValue}):null,j&&A&&N&&N.size?S.a.createElement("div",{className:"opblock-schemes"},S.a.createElement(Y,{schemes:N,path:x,method:E,specActions:f,currentScheme:q})):null,S.a.createElement("div",{className:j&&r&&A?"btn-group":"execute-wrapper"},j&&A?S.a.createElement(H,{operation:R,specActions:f,specSelectors:h,path:x,method:E,onExecute:u}):null,j&&r&&A?S.a.createElement(W,{specActions:f,path:x,method:E}):null),P?S.a.createElement("div",{className:"loading-container"},S.a.createElement("div",{className:"loading"})):null,L?S.a.createElement(z,{responses:L,request:o,tryItOutResponse:r,getComponent:l,getConfigs:p,specSelectors:h,oas3Actions:v,oas3Selectors:g,specActions:f,produces:h.producesOptionsFor([x,E]),producesValue:h.currentProducesFor([x,E]),specPath:t.push("responses"),path:x,method:E,displayRequestDuration:T,fn:c}):null,Q&&B.size?S.a.createElement(G,{extensions:B,getComponent:l}):null)))}}]),t}(E.PureComponent);v()(ze,"defaultProps",{operation:null,response:null,request:null,specPath:Object(k.List)(),summary:""});var Ve=n(69),He=n.n(Ve),We=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.toggleShown,n=e.getComponent,r=e.authActions,o=e.authSelectors,i=e.operationProps,a=e.specPath,s=i.toJS(),u=s.summary,c=s.isAuthorized,l=s.method,p=s.op,f=s.showSummary,h=s.operationId,d=s.originalOperationId,m=s.displayOperationId,v=p.summary,g=i.get("security"),y=n("authorizeOperationBtn"),b=n("OperationSummaryMethod"),_=n("OperationSummaryPath"),w=n("JumpToPath",!0);return S.a.createElement("div",{className:"opblock-summary opblock-summary-".concat(l),onClick:t},S.a.createElement(b,{method:l}),S.a.createElement(_,{getComponent:n,operationProps:i,specPath:a}),f?S.a.createElement("div",{className:"opblock-summary-description"},He()(v||u)):null,m&&(d||h)?S.a.createElement("span",{className:"opblock-summary-operation-id"},d||h):null,g&&g.count()?S.a.createElement(y,{isAuthorized:c,onClick:function(){var e=o.definitionsForRequirements(g);r.showDefinitions(e)}}):null,S.a.createElement(w,{path:a}))}}]),t}(E.PureComponent);v()(We,"defaultProps",{operationProps:null,specPath:Object(k.List)(),summary:""});var Je=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props.method;return S.a.createElement("span",{className:"opblock-summary-method"},e.toUpperCase())}}]),t}(E.PureComponent);v()(Je,"defaultProps",{operationProps:null});var Ke=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onCopyCapture",function(e){e.clipboardData.setData("text/plain",n.props.operationProps.get("path")),e.preventDefault()}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.operationProps.toJS(),r=n.deprecated,o=n.isShown,i=n.path,a=n.tag,s=n.operationId,u=n.isDeepLinkingEnabled,c=t("DeepLink");return S.a.createElement("span",{className:r?"opblock-summary-path__deprecated":"opblock-summary-path",onCopyCapture:this.onCopyCapture,"data-path":i},S.a.createElement(c,{enabled:u,isShown:o,path:Object(D.d)("".concat(a,"/").concat(s)),text:i.replace(/\//g,"​/")}))}}]),t}(E.PureComponent),Ye=n(13),$e=n.n(Ye),Ge=function(e){var t=e.extensions,n=(0,e.getComponent)("OperationExtRow");return S.a.createElement("div",{className:"opblock-section"},S.a.createElement("div",{className:"opblock-section-header"},S.a.createElement("h4",null,"Extensions")),S.a.createElement("div",{className:"table-container"},S.a.createElement("table",null,S.a.createElement("thead",null,S.a.createElement("tr",null,S.a.createElement("td",{className:"col_header"},"Field"),S.a.createElement("td",{className:"col_header"},"Value"))),S.a.createElement("tbody",null,t.entrySeq().map(function(e){var t=$e()(e,2),r=t[0],o=t[1];return S.a.createElement(n,{key:"".concat(r,"-").concat(o),xKey:r,xVal:o})})))))},Ze=function(e){var t=e.xKey,n=e.xVal,r=n?n.toJS?n.toJS():n:null;return S.a.createElement("tr",null,S.a.createElement("td",null,t),S.a.createElement("td",null,a()(r)))},Xe=n(484),Qe=n.n(Xe),et=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"initializeComponent",function(e){n.el=e}),v()(ue()(n),"downloadText",function(){Qe()(n.props.value,n.props.fileName||"response.txt")}),v()(ue()(n),"preventYScrollingBeyondElement",function(e){var t=e.target,n=e.nativeEvent.deltaY,r=t.scrollHeight,o=t.offsetHeight,i=t.scrollTop;r>o&&(0===i&&n<0||o+i>=r&&n>0)&&e.preventDefault()}),n}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){Object(D.p)(this.el)}},{key:"componentDidUpdate",value:function(){Object(D.p)(this.el)}},{key:"render",value:function(){var e=this.props,t=e.value,n=e.className,r=e.downloadable;return n=n||"",S.a.createElement("div",{className:"highlight-code"},r?S.a.createElement("div",{className:"download-contents",onClick:this.downloadText},"Download"):null,S.a.createElement("pre",{ref:this.initializeComponent,onWheel:this.preventYScrollingBeyondElement,className:n+" microlight"},t))}}]),t}(E.Component),tt=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onChangeProducesWrapper",function(e){return n.props.specActions.changeProducesValue([n.props.path,n.props.method],e)}),v()(ue()(n),"onResponseContentTypeChange",function(e){var t=e.controlsAcceptHeader,r=e.value,o=n.props,i=o.oas3Actions,a=o.path,s=o.method;t&&i.setResponseContentType({value:r,path:a,method:s})}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this,n=this.props,r=n.responses,o=n.tryItOutResponse,i=n.getComponent,a=n.getConfigs,s=n.specSelectors,u=n.fn,c=n.producesValue,l=n.displayRequestDuration,p=n.specPath,f=n.path,h=n.method,d=n.oas3Selectors,m=n.oas3Actions,v=Object(D.f)(r),g=i("contentType"),y=i("liveResponse"),b=i("response"),_=this.props.produces&&this.props.produces.size?this.props.produces:t.defaultProps.produces,w=s.isOAS3()?Object(D.k)(r):null;return S.a.createElement("div",{className:"responses-wrapper"},S.a.createElement("div",{className:"opblock-section-header"},S.a.createElement("h4",null,"Responses"),s.isOAS3()?null:S.a.createElement("label",null,S.a.createElement("span",null,"Response content type"),S.a.createElement(g,{value:c,onChange:this.onChangeProducesWrapper,contentTypes:_,className:"execute-content-type"}))),S.a.createElement("div",{className:"responses-inner"},o?S.a.createElement("div",null,S.a.createElement(y,{response:o,getComponent:i,getConfigs:a,specSelectors:s,path:this.props.path,method:this.props.method,displayRequestDuration:l}),S.a.createElement("h4",null,"Responses")):null,S.a.createElement("table",{className:"responses-table"},S.a.createElement("thead",null,S.a.createElement("tr",{className:"responses-header"},S.a.createElement("td",{className:"col_header response-col_status"},"Code"),S.a.createElement("td",{className:"col_header response-col_description"},"Description"),s.isOAS3()?S.a.createElement("td",{className:"col col_header response-col_links"},"Links"):null)),S.a.createElement("tbody",null,r.entrySeq().map(function(t){var n=$e()(t,2),r=n[0],l=n[1],g=o&&o.get("status")==r?"response_current":"";return S.a.createElement(b,{key:r,path:f,method:h,specPath:p.push(r),isDefault:v===r,fn:u,className:g,code:r,response:l,specSelectors:s,controlsAcceptHeader:l===w,onContentTypeChange:e.onResponseContentTypeChange,contentType:c,getConfigs:a,activeExamplesKey:d.activeExamplesMember(f,h,"responses",r),oas3Actions:m,getComponent:i})}).toArray()))))}}]),t}(S.a.Component);v()(tt,"defaultProps",{tryItOutResponse:null,produces:Object(k.fromJS)(["application/json"]),displayRequestDuration:!1});var nt=n(59),rt=n.n(nt),ot=function(e){function t(e,n){var r;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"_onContentTypeChange",function(e){var t=r.props,n=t.onContentTypeChange,o=t.controlsAcceptHeader;r.setState({responseContentType:e}),n({value:e,controlsAcceptHeader:o})}),v()(ue()(r),"getTargetExamplesKey",function(){var e=r.props,t=e.response,n=e.contentType,o=e.activeExamplesKey,i=r.state.responseContentType||n,a=t.getIn(["content",i],Object(k.Map)({})).get("examples",null).keySeq().first();return o||a}),r.state={responseContentType:""},r}return le()(t,e),x()(t,[{key:"render",value:function(){var e,t,n,r=this.props,o=r.path,i=r.method,a=r.code,s=r.response,u=r.className,c=r.specPath,l=r.fn,p=r.getComponent,f=r.getConfigs,h=r.specSelectors,d=r.contentType,m=r.controlsAcceptHeader,v=r.oas3Actions,g=l.inferSchema,y=h.isOAS3(),b=s.get("headers"),_=s.get("links"),w=p("headers"),x=p("highlightCode"),E=p("modelExample"),C=p("Markdown"),O=p("operationLink"),A=p("contentType"),T=p("ExamplesSelect"),j=p("Example"),P=this.state.responseContentType||d,I=s.getIn(["content",P],Object(k.Map)({})),M=I.get("examples",null);if(y){var N=I.get("schema");t=N?g(N.toJS()):null,n=N?Object(k.List)(["content",this.state.responseContentType,"schema"]):c}else t=s.get("schema"),n=s.has("schema")?c.push("schema"):c;if(y){var R=I.get("schema",Object(k.Map)({}));if(M){var L=this.getTargetExamplesKey(),U=M.get(L,Object(k.Map)({}));e=Object(D.I)(U.get("value"))}else e=void 0!==I.get("example")?Object(D.I)(I.get("example")):Object(D.o)(R.toJS(),this.state.responseContentType,{includeReadOnly:!0})}else e=s.getIn(["examples",P])?s.getIn(["examples",P]):t?Object(D.o)(t.toJS(),P,{includeReadOnly:!0,includeWriteOnly:!0}):null;var q=function(e,t){return null!=e?S.a.createElement("div",null,S.a.createElement(t,{className:"example",value:Object(D.I)(e)})):null}(e,x);return S.a.createElement("tr",{className:"response "+(u||""),"data-code":a},S.a.createElement("td",{className:"response-col_status"},a),S.a.createElement("td",{className:"response-col_description"},S.a.createElement("div",{className:"response-col_description__inner"},S.a.createElement(C,{source:s.get("description")})),y&&s.get("content")?S.a.createElement("section",{className:"response-controls"},S.a.createElement("div",{className:rt()("response-control-media-type",{"response-control-media-type--accept-controller":m})},S.a.createElement("small",{className:"response-control-media-type__title"},"Media type"),S.a.createElement(A,{value:this.state.responseContentType,contentTypes:s.get("content")?s.get("content").keySeq():Object(k.Seq)(),onChange:this._onContentTypeChange}),m?S.a.createElement("small",{className:"response-control-media-type__accept-message"},"Controls ",S.a.createElement("code",null,"Accept")," header."):null),M?S.a.createElement("div",{className:"response-control-examples"},S.a.createElement("small",{className:"response-control-examples__title"},"Examples"),S.a.createElement(T,{examples:M,currentExampleKey:this.getTargetExamplesKey(),onSelect:function(e){return v.setActiveExamplesMember({name:e,pathMethod:[o,i],contextType:"responses",contextName:a})},showLabels:!1})):null):null,q||t?S.a.createElement(E,{specPath:n,getComponent:p,getConfigs:f,specSelectors:h,schema:Object(D.i)(t),example:q}):null,y&&M?S.a.createElement(j,{example:M.get(this.getTargetExamplesKey(),Object(k.Map)({})),getComponent:p,omitValue:!0}):null,b?S.a.createElement(w,{headers:b,getComponent:p}):null),y?S.a.createElement("td",{className:"response-col_links"},_?_.toSeq().map(function(e,t){return S.a.createElement(O,{key:t,name:t,link:e,getComponent:p})}):S.a.createElement("i",null,"No links")):null)}}]),t}(S.a.Component);v()(ot,"defaultProps",{response:Object(k.fromJS)({}),onContentTypeChange:function(){}});var it=n(485),at=n.n(it),st=n(486),ut=n.n(st),ct=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"state",{parsedContent:null}),v()(ue()(n),"updateParsedContent",function(e){var t=n.props.content;if(e!==t)if(t&&t instanceof Blob){var r=new FileReader;r.onload=function(){n.setState({parsedContent:r.result})},r.readAsText(t)}else n.setState({parsedContent:t.toString()})}),n}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){this.updateParsedContent(null)}},{key:"componentDidUpdate",value:function(e){this.updateParsedContent(e.content)}},{key:"render",value:function(){var e,t,n=this.props,r=n.content,o=n.contentType,i=n.url,s=n.headers,u=void 0===s?{}:s,c=n.getComponent,l=this.state.parsedContent,p=c("highlightCode"),f="response_"+(new Date).getTime();if(i=i||"",/^application\/octet-stream/i.test(o)||u["Content-Disposition"]&&/attachment/i.test(u["Content-Disposition"])||u["content-disposition"]&&/attachment/i.test(u["content-disposition"])||u["Content-Description"]&&/File Transfer/i.test(u["Content-Description"])||u["content-description"]&&/File Transfer/i.test(u["content-description"]))if("Blob"in window){var h=o||"text/html",d=r instanceof Blob?r:new Blob([r],{type:h}),m=window.URL.createObjectURL(d),v=[h,i.substr(i.lastIndexOf("/")+1),m].join(":"),g=u["content-disposition"]||u["Content-Disposition"];if(void 0!==g){var y=Object(D.h)(g);null!==y&&(v=y)}t=R.a.navigator&&R.a.navigator.msSaveOrOpenBlob?S.a.createElement("div",null,S.a.createElement("a",{href:m,onClick:function(){return R.a.navigator.msSaveOrOpenBlob(d,v)}},"Download file")):S.a.createElement("div",null,S.a.createElement("a",{href:m,download:v},"Download file"))}else t=S.a.createElement("pre",{className:"microlight"},"Download headers detected but your browser does not support downloading binary via XHR (Blob).");else if(/json/i.test(o)){try{e=a()(JSON.parse(r),null," ")}catch(t){e="can't parse JSON. Raw result:\n\n"+r}t=S.a.createElement(p,{downloadable:!0,fileName:"".concat(f,".json"),value:e})}else/xml/i.test(o)?(e=at()(r,{textNodesOnSameLine:!0,indentor:" "}),t=S.a.createElement(p,{downloadable:!0,fileName:"".concat(f,".xml"),value:e})):t="text/html"===ut()(o)||/text\/plain/.test(o)?S.a.createElement(p,{downloadable:!0,fileName:"".concat(f,".html"),value:r}):/^image\//i.test(o)?o.includes("svg")?S.a.createElement("div",null," ",r," "):S.a.createElement("img",{style:{maxWidth:"100%"},src:window.URL.createObjectURL(r)}):/^audio\//i.test(o)?S.a.createElement("pre",{className:"microlight"},S.a.createElement("audio",{controls:!0},S.a.createElement("source",{src:i,type:o}))):"string"==typeof r?S.a.createElement(p,{downloadable:!0,fileName:"".concat(f,".txt"),value:r}):r.size>0?l?S.a.createElement("div",null,S.a.createElement("p",{className:"i"},"Unrecognized response type; displaying content as text."),S.a.createElement(p,{downloadable:!0,fileName:"".concat(f,".txt"),value:l})):S.a.createElement("p",{className:"i"},"Unrecognized response type; unable to display."):null;return t?S.a.createElement("div",null,S.a.createElement("h5",null,"Response body"),t):null}}]),t}(S.a.PureComponent),lt=n(12),pt=n.n(lt),ft=function(e){function t(e){var n;return _()(this,t),n=oe()(this,ae()(t).call(this,e)),v()(ue()(n),"onChange",function(e,t,r){var o=n.props;(0,o.specActions.changeParamByIdentity)(o.onChangeKey,e,t,r)}),v()(ue()(n),"onChangeConsumesWrapper",function(e){var t=n.props;(0,t.specActions.changeConsumesValue)(t.onChangeKey,e)}),v()(ue()(n),"toggleTab",function(e){return"parameters"===e?n.setState({parametersVisible:!0,callbackVisible:!1}):"callbacks"===e?n.setState({callbackVisible:!0,parametersVisible:!1}):void 0}),n.state={callbackVisible:!1,parametersVisible:!0},n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.onTryoutClick,r=t.onCancelClick,o=t.parameters,i=t.allowTryItOut,a=t.tryItOutEnabled,s=t.specPath,u=t.fn,c=t.getComponent,l=t.getConfigs,p=t.specSelectors,f=t.specActions,h=t.pathMethod,d=t.oas3Actions,m=t.oas3Selectors,v=t.operation,g=c("parameterRow"),y=c("TryItOutButton"),b=c("contentType"),_=c("Callbacks",!0),w=c("RequestBody",!0),x=a&&i,E=p.isOAS3(),C=v.get("requestBody");return S.a.createElement("div",{className:"opblock-section"},S.a.createElement("div",{className:"opblock-section-header"},E?S.a.createElement("div",{className:"tab-header"},S.a.createElement("div",{onClick:function(){return e.toggleTab("parameters")},className:"tab-item ".concat(this.state.parametersVisible&&"active")},S.a.createElement("h4",{className:"opblock-title"},S.a.createElement("span",null,"Parameters"))),v.get("callbacks")?S.a.createElement("div",{onClick:function(){return e.toggleTab("callbacks")},className:"tab-item ".concat(this.state.callbackVisible&&"active")},S.a.createElement("h4",{className:"opblock-title"},S.a.createElement("span",null,"Callbacks"))):null):S.a.createElement("div",{className:"tab-header"},S.a.createElement("h4",{className:"opblock-title"},"Parameters")),i?S.a.createElement(y,{enabled:a,onCancelClick:r,onTryoutClick:n}):null),this.state.parametersVisible?S.a.createElement("div",{className:"parameters-container"},o.count()?S.a.createElement("div",{className:"table-container"},S.a.createElement("table",{className:"parameters"},S.a.createElement("thead",null,S.a.createElement("tr",null,S.a.createElement("th",{className:"col_header parameters-col_name"},"Name"),S.a.createElement("th",{className:"col_header parameters-col_description"},"Description"))),S.a.createElement("tbody",null,function(e,t){return e.valueSeq().filter(O.a.Map.isMap).map(t)}(o,function(t,n){return S.a.createElement(g,{fn:u,specPath:s.push(n.toString()),getComponent:c,getConfigs:l,rawParam:t,param:p.parameterWithMetaByIdentity(h,t),key:"".concat(t.get("in"),".").concat(t.get("name")),onChange:e.onChange,onChangeConsumes:e.onChangeConsumesWrapper,specSelectors:p,specActions:f,oas3Actions:d,oas3Selectors:m,pathMethod:h,isExecute:x})}).toArray()))):S.a.createElement("div",{className:"opblock-description-wrapper"},S.a.createElement("p",null,"No parameters"))):null,this.state.callbackVisible?S.a.createElement("div",{className:"callbacks-container opblock-description-wrapper"},S.a.createElement(_,{callbacks:Object(k.Map)(v.get("callbacks")),specPath:s.slice(0,-1).push("callbacks")})):null,E&&C&&this.state.parametersVisible&&S.a.createElement("div",{className:"opblock-section opblock-section-request-body"},S.a.createElement("div",{className:"opblock-section-header"},S.a.createElement("h4",{className:"opblock-title parameter__name ".concat(C.get("required")&&"required")},"Request body"),S.a.createElement("label",null,S.a.createElement(b,{value:m.requestContentType.apply(m,pt()(h)),contentTypes:C.get("content",Object(k.List)()).keySeq(),onChange:function(e){d.setRequestContentType({value:e,pathMethod:h})},className:"body-param-content-type"}))),S.a.createElement("div",{className:"opblock-description-wrapper"},S.a.createElement(w,{specPath:s.slice(0,-1).push("requestBody"),requestBody:C,requestBodyValue:m.requestBodyValue.apply(m,pt()(h)),isExecute:x,activeExamplesKey:m.activeExamplesMember.apply(m,pt()(h).concat(["requestBody","requestBody"])),updateActiveExamplesKey:function(t){e.props.oas3Actions.setActiveExamplesMember({name:t,pathMethod:e.props.pathMethod,contextType:"requestBody",contextName:"requestBody"})},onChange:function(e,t){if(t){var n=m.requestBodyValue.apply(m,pt()(h)),r=k.Map.isMap(n)?n:Object(k.Map)();return d.setRequestBodyValue({pathMethod:h,value:r.setIn(t,e)})}d.setRequestBodyValue({value:e,pathMethod:h})},contentType:m.requestContentType.apply(m,pt()(h))}))))}}]),t}(E.Component);v()(ft,"defaultProps",{onTryoutClick:Function.prototype,onCancelClick:Function.prototype,tryItOutEnabled:!1,allowTryItOut:!0,onChangeKey:[],specPath:[]});var ht=function(e){var t=e.xKey,n=e.xVal;return S.a.createElement("div",{className:"parameter__extension"},t,": ",String(n))},dt=function(e){var t=e.param,n=e.isIncluded,r=e.onChange,o=e.isDisabled;return t.get("allowEmptyValue")?S.a.createElement("div",{className:rt()("parameter__empty_value_toggle",{disabled:o})},S.a.createElement("input",{type:"checkbox",disabled:o,checked:!o&&n,onChange:function(e){r(e.target.checked)}}),"Send empty value"):null},mt=n(122),vt=function(e){function t(e,n){var r;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"onChangeWrapper",function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=r.props,o=n.onChange,i=n.rawParam;return o(i,""===e||e&&0===e.size?null:e,t)}),v()(ue()(r),"_onExampleSelect",function(e){r.props.oas3Actions.setActiveExamplesMember({name:e,pathMethod:r.props.pathMethod,contextType:"parameters",contextName:r.getParamKey()})}),v()(ue()(r),"onChangeIncludeEmpty",function(e){var t=r.props,n=t.specActions,o=t.param,i=t.pathMethod,a=o.get("name"),s=o.get("in");return n.updateEmptyParamInclusion(i,a,s,e)}),v()(ue()(r),"setDefaultValue",function(){var e=r.props,t=e.specSelectors,n=e.pathMethod,o=e.rawParam,i=e.oas3Selectors,a=t.parameterWithMetaByIdentity(n,o)||Object(k.Map)(),s=Object(mt.a)(a,{isOAS3:t.isOAS3()}).schema,u=a.get("content",Object(k.Map)()).keySeq().first(),c=Object(D.o)(s.toJS(),u,{includeWriteOnly:!0});if(a&&void 0===a.get("value")&&"body"!==a.get("in")){var l;if(t.isSwagger2())l=a.get("x-example")||a.getIn(["schema","example"])||s.getIn(["default"]);else if(t.isOAS3()){var p=i.activeExamplesMember.apply(i,pt()(n).concat(["parameters",r.getParamKey()]));l=a.getIn(["examples",p,"value"])||a.getIn(["content",u,"example"])||a.get("example")||s.get("example")||s.get("default")||a.get("default")}void 0===l||k.List.isList(l)||(l=Object(D.I)(l)),void 0!==l?r.onChangeWrapper(l):"object"===s.get("type")&&c&&!a.get("examples")&&r.onChangeWrapper(k.List.isList(c)?c:Object(D.I)(c))}}),r.setDefaultValue(),r}return le()(t,e),x()(t,[{key:"componentWillReceiveProps",value:function(e){var t,n=e.specSelectors,r=e.pathMethod,o=e.rawParam,i=n.isOAS3(),a=n.parameterWithMetaByIdentity(r,o)||new k.Map;(a=a.isEmpty()?o:a,i)?t=Object(mt.a)(a,{isOAS3:i}).schema.get("enum"):t=a?a.get("enum"):void 0;var s,u=a?a.get("value"):void 0;void 0!==u?s=u:o.get("required")&&t&&t.size&&(s=t.first()),void 0!==s&&s!==u&&this.onChangeWrapper(Object(D.x)(s)),this.setDefaultValue()}},{key:"getParamKey",value:function(){var e=this.props.param;return e?"".concat(e.get("name"),"-").concat(e.get("in")):null}},{key:"render",value:function(){var e=this.props,t=e.param,n=e.rawParam,r=e.getComponent,o=e.getConfigs,i=e.isExecute,a=e.fn,s=e.onChangeConsumes,u=e.specSelectors,c=e.pathMethod,l=e.specPath,p=e.oas3Selectors,f=u.isOAS3(),h=o(),d=h.showExtensions,m=h.showCommonExtensions;if(t||(t=n),!n)return null;var v,g,y,b=r("JsonSchemaForm"),_=r("ParamBody"),w=t.get("in"),x="body"!==w?null:S.a.createElement(_,{getComponent:r,fn:a,param:t,consumes:u.consumesOptionsFor(c),consumesValue:u.contentTypeValues(c).get("requestContentType"),onChange:this.onChangeWrapper,onChangeConsumes:s,isExecute:i,specSelectors:u,pathMethod:c}),E=r("modelExample"),C=r("Markdown"),O=r("ParameterExt"),A=r("ParameterIncludeEmpty"),T=r("ExamplesSelectValueRetainer"),j=r("Example"),P=Object(mt.a)(t,{isOAS3:f}).schema,I=u.parameterWithMetaByIdentity(c,n)||Object(k.Map)(),M=t.get("format"),N=P.get("type"),L="formData"===w,U="FormData"in R.a,q=t.get("required"),F=P.getIn(["items","type"]),B=I?I.get("value"):"",z=m?Object(D.l)(t):null,V=d?Object(D.m)(t):null,H=!1;return void 0!==t&&(v=P.get("items")),void 0!==v?(g=v.get("enum"),y=v.get("default")):g=P.get("enum"),void 0!==g&&g.size>0&&(H=!0),void 0!==t&&(void 0===(y=P.get("default"))&&(y=t.get("default")),void 0===t.get("example")&&t.get("x-example")),S.a.createElement("tr",{"data-param-name":t.get("name"),"data-param-in":t.get("in")},S.a.createElement("td",{className:"parameters-col_name"},S.a.createElement("div",{className:q?"parameter__name required":"parameter__name"},t.get("name"),q?S.a.createElement("span",{style:{color:"red"}}," *"):null),S.a.createElement("div",{className:"parameter__type"},N,F&&"[".concat(F,"]"),M&&S.a.createElement("span",{className:"prop-format"},"($",M,")")),S.a.createElement("div",{className:"parameter__deprecated"},f&&t.get("deprecated")?"deprecated":null),S.a.createElement("div",{className:"parameter__in"},"(",t.get("in"),")"),m&&z.size?z.map(function(e,t){return S.a.createElement(O,{key:"".concat(t,"-").concat(e),xKey:t,xVal:e})}):null,d&&V.size?V.map(function(e,t){return S.a.createElement(O,{key:"".concat(t,"-").concat(e),xKey:t,xVal:e})}):null),S.a.createElement("td",{className:"parameters-col_description"},t.get("description")?S.a.createElement(C,{source:t.get("description")}):null,!x&&i||!H?null:S.a.createElement(C,{className:"parameter__enum",source:"<i>Available values</i> : "+g.map(function(e){return e}).toArray().join(", ")}),!x&&i||void 0===y?null:S.a.createElement(C,{className:"parameter__default",source:"<i>Default value</i> : "+y}),L&&!U&&S.a.createElement("div",null,"Error: your browser does not support FormData"),f&&t.get("examples")?S.a.createElement("section",{className:"parameter-controls"},S.a.createElement(T,{examples:t.get("examples"),onSelect:this._onExampleSelect,updateValue:this.onChangeWrapper,getComponent:r,defaultToFirstExample:!0,currentKey:p.activeExamplesMember.apply(p,pt()(c).concat(["parameters",this.getParamKey()])),currentUserInputValue:B})):null,x?null:S.a.createElement(b,{fn:a,getComponent:r,value:B,required:q,disabled:!i,description:t.get("description")?"".concat(t.get("name")," - ").concat(t.get("description")):"".concat(t.get("name")),onChange:this.onChangeWrapper,errors:I.get("errors"),schema:P}),x&&P?S.a.createElement(E,{getComponent:r,specPath:l.push("schema"),getConfigs:o,isExecute:i,specSelectors:u,schema:P,example:x}):null,!x&&i?S.a.createElement(A,{onChange:this.onChangeIncludeEmpty,isIncluded:u.parameterInclusionSettingFor(c,t.get("name"),t.get("in")),isDisabled:B&&0!==B.size,param:t}):null,f&&t.get("examples")?S.a.createElement(j,{example:t.getIn(["examples",p.activeExamplesMember.apply(p,pt()(c).concat(["parameters",this.getParamKey()]))]),getComponent:r}):null))}}]),t}(E.Component),gt=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onClick",function(){var e=n.props,t=e.specSelectors,r=e.specActions,o=e.operation,i=e.path,a=e.method;r.validateParams([i,a]),t.validateBeforeExecute([i,a])&&(n.props.onExecute&&n.props.onExecute(),r.execute({operation:o,path:i,method:a}))}),v()(ue()(n),"onChangeProducesWrapper",function(e){return n.props.specActions.changeProducesValue([n.props.path,n.props.method],e)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){return S.a.createElement("button",{className:"btn execute opblock-control__btn",onClick:this.onClick},"Execute")}}]),t}(E.Component),yt={color:"#999",fontStyle:"italic"},bt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.headers,n=e.getComponent,r=n("Property"),o=n("Markdown");return t&&t.size?S.a.createElement("div",{className:"headers-wrapper"},S.a.createElement("h4",{className:"headers__title"},"Headers:"),S.a.createElement("table",{className:"headers"},S.a.createElement("thead",null,S.a.createElement("tr",{className:"header-row"},S.a.createElement("th",{className:"header-col"},"Name"),S.a.createElement("th",{className:"header-col"},"Description"),S.a.createElement("th",{className:"header-col"},"Type"))),S.a.createElement("tbody",null,t.entrySeq().map(function(e){var t=$e()(e,2),n=t[0],i=t[1];if(!O.a.Map.isMap(i))return null;var a=i.get("description"),s=i.getIn(["schema"])?i.getIn(["schema","type"]):i.getIn(["type"]),u=i.getIn(["schema","example"]);return S.a.createElement("tr",{key:n},S.a.createElement("td",{className:"header-col"},n),S.a.createElement("td",{className:"header-col"},a?S.a.createElement(o,{source:a}):null),S.a.createElement("td",{className:"header-col"},s," ",u?S.a.createElement(r,{propKey:"Example",propVal:u,propStyle:yt}):null))}).toArray()))):null}}]),t}(S.a.Component),_t=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.editorActions,n=e.errSelectors,r=e.layoutSelectors,o=e.layoutActions,i=(0,e.getComponent)("Collapse");if(t&&t.jumpToLine)var a=t.jumpToLine;var s=n.allErrors().filter(function(e){return"thrown"===e.get("type")||"error"===e.get("level")});if(!s||s.count()<1)return null;var u=r.isShown(["errorPane"],!0),c=s.sortBy(function(e){return e.get("line")});return S.a.createElement("pre",{className:"errors-wrapper"},S.a.createElement("hgroup",{className:"error"},S.a.createElement("h4",{className:"errors__title"},"Errors"),S.a.createElement("button",{className:"btn errors__clear-btn",onClick:function(){return o.show(["errorPane"],!u)}},u?"Hide":"Show")),S.a.createElement(i,{isOpened:u,animated:!0},S.a.createElement("div",{className:"errors"},c.map(function(e,t){var n=e.get("type");return"thrown"===n||"auth"===n?S.a.createElement(wt,{key:t,error:e.get("error")||e,jumpToLine:a}):"spec"===n?S.a.createElement(xt,{key:t,error:e,jumpToLine:a}):void 0}))))}}]),t}(S.a.Component),wt=function(e){var t=e.error,n=e.jumpToLine;if(!t)return null;var r=t.get("line");return S.a.createElement("div",{className:"error-wrapper"},t?S.a.createElement("div",null,S.a.createElement("h4",null,t.get("source")&&t.get("level")?Et(t.get("source"))+" "+t.get("level"):"",t.get("path")?S.a.createElement("small",null," at ",t.get("path")):null),S.a.createElement("span",{style:{whiteSpace:"pre-line",maxWidth:"100%"}},t.get("message")),S.a.createElement("div",{style:{"text-decoration":"underline",cursor:"pointer"}},r&&n?S.a.createElement("a",{onClick:n.bind(null,r)},"Jump to line ",r):null)):null)},xt=function(e){var t=e.error,n=e.jumpToLine,r=null;return t.get("path")?r=k.List.isList(t.get("path"))?S.a.createElement("small",null,"at ",t.get("path").join(".")):S.a.createElement("small",null,"at ",t.get("path")):t.get("line")&&!n&&(r=S.a.createElement("small",null,"on line ",t.get("line"))),S.a.createElement("div",{className:"error-wrapper"},t?S.a.createElement("div",null,S.a.createElement("h4",null,Et(t.get("source"))+" "+t.get("level")," ",r),S.a.createElement("span",{style:{whiteSpace:"pre-line"}},t.get("message")),S.a.createElement("div",{style:{"text-decoration":"underline",cursor:"pointer"}},n?S.a.createElement("a",{onClick:n.bind(null,t.get("line"))},"Jump to line ",t.get("line")):null)):null)};function Et(e){return(e||"").split(" ").map(function(e){return e[0].toUpperCase()+e.slice(1)}).join(" ")}wt.defaultProps={jumpToLine:null};var St=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onChangeWrapper",function(e){return n.props.onChange(e.target.value)}),n}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){this.props.contentTypes&&this.props.onChange(this.props.contentTypes.first())}},{key:"componentWillReceiveProps",value:function(e){e.contentTypes&&e.contentTypes.size&&(e.contentTypes.includes(e.value)||e.onChange(e.contentTypes.first()))}},{key:"render",value:function(){var e=this.props,t=e.contentTypes,n=e.className,r=e.value;return t&&t.size?S.a.createElement("div",{className:"content-type-wrapper "+(n||"")},S.a.createElement("select",{className:"content-type",value:r||"",onChange:this.onChangeWrapper},t.map(function(e){return S.a.createElement("option",{key:e,value:e},e)}).toArray())):null}}]),t}(S.a.Component);v()(St,"defaultProps",{onChange:function(){},value:null,contentTypes:Object(k.fromJS)(["application/json"])});var Ct=n(20),kt=n.n(Ct),Ot=n(40),At=n.n(Ot);function Tt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(function(e){return!!e}).join(" ").trim()}var jt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.fullscreen,n=e.full,r=At()(e,["fullscreen","full"]);if(t)return S.a.createElement("section",r);var o="swagger-container"+(n?"-full":"");return S.a.createElement("section",kt()({},r,{className:Tt(r.className,o)}))}}]),t}(S.a.Component),Pt={mobile:"",tablet:"-tablet",desktop:"-desktop",large:"-hd"},It=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.hide,n=e.keepContents,r=(e.mobile,e.tablet,e.desktop,e.large,At()(e,["hide","keepContents","mobile","tablet","desktop","large"]));if(t&&!n)return S.a.createElement("span",null);var o=[];for(var i in Pt)if(Pt.hasOwnProperty(i)){var a=Pt[i];if(i in this.props){var s=this.props[i];if(s<1){o.push("none"+a);continue}o.push("block"+a),o.push("col-"+s+a)}}var u=Tt.apply(void 0,[r.className].concat(o));return S.a.createElement("section",kt()({},r,{style:{display:t?"none":null},className:u}))}}]),t}(S.a.Component),Mt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){return S.a.createElement("div",kt()({},this.props,{className:Tt(this.props.className,"wrapper")}))}}]),t}(S.a.Component),Nt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){return S.a.createElement("button",kt()({},this.props,{className:Tt(this.props.className,"button")}))}}]),t}(S.a.Component);v()(Nt,"defaultProps",{className:""});var Rt=function(e){return S.a.createElement("textarea",e)},Dt=function(e){return S.a.createElement("input",e)},Lt=function(e){function t(e,n){var r,o;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"onChange",function(e){var t,n=r.props,o=n.onChange,i=n.multiple,a=[].slice.call(e.target.options);t=i?a.filter(function(e){return e.selected}).map(function(e){return e.value}):e.target.value,r.setState({value:t}),o&&o(t)}),o=e.value?e.value:e.multiple?[""]:"",r.state={value:o},r}return le()(t,e),x()(t,[{key:"componentWillReceiveProps",value:function(e){e.value!==this.props.value&&this.setState({value:e.value})}},{key:"render",value:function(){var e,t,n=this.props,r=n.allowedValues,o=n.multiple,i=n.allowEmptyValue,a=n.disabled,s=(null===(e=this.state.value)||void 0===e?void 0:null===(t=e.toJS)||void 0===t?void 0:t.call(e))||this.state.value;return S.a.createElement("select",{className:this.props.className,multiple:o,value:s,onChange:this.onChange,disabled:a},i?S.a.createElement("option",{value:""},"--"):null,r.map(function(e,t){return S.a.createElement("option",{key:t,value:String(e)},String(e))}))}}]),t}(S.a.Component);v()(Lt,"defaultProps",{multiple:!1,allowEmptyValue:!0});var Ut=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){return S.a.createElement("a",kt()({},this.props,{rel:"noopener noreferrer",className:Tt(this.props.className,"link")}))}}]),t}(S.a.Component),qt=function(e){var t=e.children;return S.a.createElement("div",{style:{height:"auto",border:"none",margin:0,padding:0}}," ",t," ")},Ft=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"renderNotAnimated",value:function(){return this.props.isOpened?S.a.createElement(qt,null,this.props.children):S.a.createElement("noscript",null)}},{key:"render",value:function(){var e=this.props,t=e.animated,n=e.isOpened,r=e.children;return t?(r=n?r:null,S.a.createElement(qt,null,r)):this.renderNotAnimated()}}]),t}(S.a.Component);v()(Ft,"defaultProps",{isOpened:!1,animated:!1});var Bt=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return(n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o)))).setTagShown=n._setTagShown.bind(ue()(n)),n}return le()(t,e),x()(t,[{key:"_setTagShown",value:function(e,t){this.props.layoutActions.show(e,t)}},{key:"showOp",value:function(e,t){this.props.layoutActions.show(e,t)}},{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.layoutSelectors,r=e.layoutActions,o=e.getComponent,i=t.taggedOperations(),a=o("Collapse");return S.a.createElement("div",null,S.a.createElement("h4",{className:"overview-title"},"Overview"),i.map(function(e,t){var o=e.get("operations"),i=["overview-tags",t],s=n.isShown(i,!0);return S.a.createElement("div",{key:"overview-"+t},S.a.createElement("h4",{onClick:function(){return r.show(i,!s)},className:"link overview-tag"}," ",s?"-":"+",t),S.a.createElement(a,{isOpened:s,animated:!0},o.map(function(e){var t=e.toObject(),o=t.path,i=t.method,a=t.id,s=a,u=n.isShown(["operations",s]);return S.a.createElement(zt,{key:a,path:o,method:i,id:o+"-"+i,shown:u,showOpId:s,showOpIdPrefix:"operations",href:"#operation-".concat(s),onClick:r.show})}).toArray()))}).toArray(),i.size<1&&S.a.createElement("h3",null," No operations defined in spec! "))}}]),t}(S.a.Component),zt=function(e){function t(e){var n;return _()(this,t),(n=oe()(this,ae()(t).call(this,e))).onClick=n._onClick.bind(ue()(n)),n}return le()(t,e),x()(t,[{key:"_onClick",value:function(){var e=this.props,t=e.showOpId,n=e.showOpIdPrefix;(0,e.onClick)([n,t],!e.shown)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.method,r=e.shown,o=e.href;return S.a.createElement(Ut,{href:o,style:{fontWeight:r?"bold":"normal"},onClick:this.onClick,className:"block opblock-link"},S.a.createElement("div",null,S.a.createElement("small",{className:"bold-label-".concat(n)},n.toUpperCase()),S.a.createElement("span",{className:"bold-label"},t)))}}]),t}(S.a.Component),Vt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){this.props.initialValue&&(this.inputRef.value=this.props.initialValue)}},{key:"render",value:function(){var e=this,t=this.props,n=(t.value,t.defaultValue,At()(t,["value","defaultValue"]));return S.a.createElement("input",kt()({},n,{ref:function(t){return e.inputRef=t}}))}}]),t}(S.a.Component),Ht=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.host,n=e.basePath;return S.a.createElement("pre",{className:"base-url"},"[ Base URL: ",t,n," ]")}}]),t}(S.a.Component),Wt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.data,n=e.getComponent,r=t.get("name")||"the developer",o=t.get("url"),i=t.get("email"),a=n("Link");return S.a.createElement("div",{className:"info__contact"},o&&S.a.createElement("div",null,S.a.createElement(a,{href:Object(D.F)(o),target:"_blank"},r," - Website")),i&&S.a.createElement(a,{href:Object(D.F)("mailto:".concat(i))},o?"Send email to ".concat(r):"Contact ".concat(r)))}}]),t}(S.a.Component),Jt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.license,n=(0,e.getComponent)("Link"),r=t.get("name")||"License",o=t.get("url");return S.a.createElement("div",{className:"info__license"},o?S.a.createElement(n,{target:"_blank",href:Object(D.F)(o)},r):S.a.createElement("span",null,r))}}]),t}(S.a.Component),Kt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.url,n=(0,e.getComponent)("Link");return S.a.createElement(n,{target:"_blank",href:Object(D.F)(t)},S.a.createElement("span",{className:"url"}," ",t," "))}}]),t}(S.a.PureComponent),Yt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.info,n=e.url,r=e.host,o=e.basePath,i=e.getComponent,a=e.externalDocs,s=t.get("version"),u=t.get("description"),c=t.get("title"),l=t.get("termsOfService"),p=t.get("contact"),f=t.get("license"),h=(a||Object(k.fromJS)({})).toJS(),d=h.url,m=h.description,v=i("Markdown"),g=i("Link"),y=i("VersionStamp"),b=i("InfoUrl"),_=i("InfoBasePath");return S.a.createElement("div",{className:"info"},S.a.createElement("hgroup",{className:"main"},S.a.createElement("h2",{className:"title"},c,s&&S.a.createElement(y,{version:s})),r||o?S.a.createElement(_,{host:r,basePath:o}):null,n&&S.a.createElement(b,{getComponent:i,url:n})),S.a.createElement("div",{className:"description"},S.a.createElement(v,{source:u})),l&&S.a.createElement("div",{className:"info__tos"},S.a.createElement(g,{target:"_blank",href:Object(D.F)(l)},"Terms of service")),p&&p.size?S.a.createElement(Wt,{getComponent:i,data:p}):null,f&&f.size?S.a.createElement(Jt,{getComponent:i,license:f}):null,d?S.a.createElement(g,{className:"info__extdocs",target:"_blank",href:Object(D.F)(d)},m||d):null)}}]),t}(S.a.Component),$t=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.getComponent,r=t.info(),o=t.url(),i=t.basePath(),a=t.host(),s=t.externalDocs(),u=n("info");return S.a.createElement("div",null,r&&r.count()?S.a.createElement(u,{info:r,url:o,host:a,basePath:i,externalDocs:s,getComponent:n}):null)}}]),t}(S.a.Component),Gt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){return null}}]),t}(S.a.Component),Zt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){return S.a.createElement("div",{className:"footer"})}}]),t}(S.a.Component),Xt=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onFilterChange",function(e){var t=e.target.value;n.props.layoutActions.updateFilter(t)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.layoutSelectors,r=(0,e.getComponent)("Col"),o="loading"===t.loadingStatus(),i="failed"===t.loadingStatus(),a=n.currentFilter(),s={};return i&&(s.color="red"),o&&(s.color="#aaa"),S.a.createElement("div",null,null===a||!1===a?null:S.a.createElement("div",{className:"filter-container"},S.a.createElement(r,{className:"filter wrapper",mobile:12},S.a.createElement("input",{className:"operation-filter-input",placeholder:"Filter by tag",type:"text",onChange:this.onFilterChange,value:!0===a||"true"===a?"":a,disabled:o,style:s}))))}}]),t}(S.a.Component),Qt=Function.prototype,en=function(e){function t(e,n){var r;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"updateValues",function(e){var t=e.param,n=e.isExecute,o=e.consumesValue,i=void 0===o?"":o,a=/xml/i.test(i),s=/json/i.test(i),u=a?t.get("value_xml"):t.get("value");if(void 0!==u){var c=!u&&s?"{}":u;r.setState({value:c}),r.onChange(c,{isXml:a,isEditBox:n})}else a?r.onChange(r.sample("xml"),{isXml:a,isEditBox:n}):r.onChange(r.sample(),{isEditBox:n})}),v()(ue()(r),"sample",function(e){var t=r.props,n=t.param,o=(0,t.fn.inferSchema)(n.toJS());return Object(D.o)(o,e,{includeWriteOnly:!0})}),v()(ue()(r),"onChange",function(e,t){var n=t.isEditBox,o=t.isXml;r.setState({value:e,isEditBox:n}),r._onChange(e,o)}),v()(ue()(r),"_onChange",function(e,t){(r.props.onChange||Qt)(e,t)}),v()(ue()(r),"handleOnChange",function(e){var t=r.props.consumesValue,n=/xml/i.test(t),o=e.target.value;r.onChange(o,{isXml:n})}),v()(ue()(r),"toggleIsEditBox",function(){return r.setState(function(e){return{isEditBox:!e.isEditBox}})}),r.state={isEditBox:!1,value:""},r}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){this.updateValues.call(this,this.props)}},{key:"componentWillReceiveProps",value:function(e){this.updateValues.call(this,e)}},{key:"render",value:function(){var e=this.props,n=e.onChangeConsumes,r=e.param,o=e.isExecute,i=e.specSelectors,a=e.pathMethod,s=e.getComponent,u=s("Button"),c=s("TextArea"),l=s("highlightCode"),p=s("contentType"),f=(i?i.parameterWithMetaByIdentity(a,r):r).get("errors",Object(k.List)()),h=i.contentTypeValues(a).get("requestContentType"),d=this.props.consumes&&this.props.consumes.size?this.props.consumes:t.defaultProp.consumes,m=this.state,v=m.value,g=m.isEditBox;return S.a.createElement("div",{className:"body-param","data-param-name":r.get("name"),"data-param-in":r.get("in")},g&&o?S.a.createElement(c,{className:"body-param__text"+(f.count()?" invalid":""),value:v,onChange:this.handleOnChange}):v&&S.a.createElement(l,{className:"body-param__example",value:v}),S.a.createElement("div",{className:"body-param-options"},o?S.a.createElement("div",{className:"body-param-edit"},S.a.createElement(u,{className:g?"btn cancel body-param__example-edit":"btn edit body-param__example-edit",onClick:this.toggleIsEditBox},g?"Cancel":"Edit")):null,S.a.createElement("label",{htmlFor:""},S.a.createElement("span",null,"Parameter content type"),S.a.createElement(p,{value:h,contentTypes:d,onChange:n,className:"body-param-content-type"}))))}}]),t}(E.PureComponent);v()(en,"defaultProp",{consumes:Object(k.fromJS)(["application/json"]),param:Object(k.fromJS)({}),onChange:Qt,onChangeConsumes:Qt});var tn=n(92),nn=n.n(tn);var rn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"handleFocus",value:function(e){e.target.select(),document.execCommand("copy")}},{key:"render",value:function(){var e=function(e){var t=[],n="",r=e.get("headers");if(t.push("curl"),t.push("-X",e.get("method")),t.push('"'.concat(e.get("url"),'"')),r&&r.size){var o=!0,i=!1,s=void 0;try{for(var u,c=nn()(e.get("headers").entries());!(o=(u=c.next()).done);o=!0){var l=u.value,p=$e()(l,2),f=p[0],h=p[1];n=h,t.push("-H "),t.push('"'.concat(f,": ").concat(h,'"'))}}catch(e){i=!0,s=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw s}}}if(e.get("body"))if("multipart/form-data"===n&&"POST"===e.get("method")){var d=!0,m=!1,v=void 0;try{for(var g,y=nn()(e.get("body").entrySeq());!(d=(g=y.next()).done);d=!0){var b=$e()(g.value,2),_=b[0],w=b[1];t.push("-F"),w instanceof R.a.File?t.push('"'.concat(_,"=@").concat(w.name).concat(w.type?";type=".concat(w.type):"",'"')):t.push('"'.concat(_,"=").concat(w,'"'))}}catch(e){m=!0,v=e}finally{try{d||null==y.return||y.return()}finally{if(m)throw v}}}else t.push("-d"),t.push(a()(e.get("body")).replace(/\\n/g,""));return t.join(" ")}(this.props.request);return S.a.createElement("div",null,S.a.createElement("h4",null,"Curl"),S.a.createElement("div",{className:"copy-paste"},S.a.createElement("textarea",{onFocus:this.handleFocus,readOnly:!0,className:"curl",style:{whiteSpace:"normal"},value:e})))}}]),t}(S.a.Component),on=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onChange",function(e){n.setScheme(e.target.value)}),v()(ue()(n),"setScheme",function(e){var t=n.props,r=t.path,o=t.method;t.specActions.setScheme(e,r,o)}),n}return le()(t,e),x()(t,[{key:"componentWillMount",value:function(){var e=this.props.schemes;this.setScheme(e.first())}},{key:"componentWillReceiveProps",value:function(e){this.props.currentScheme&&e.schemes.includes(this.props.currentScheme)||this.setScheme(e.schemes.first())}},{key:"render",value:function(){var e=this.props,t=e.schemes,n=e.currentScheme;return S.a.createElement("label",{htmlFor:"schemes"},S.a.createElement("span",{className:"schemes-title"},"Schemes"),S.a.createElement("select",{onChange:this.onChange,value:n},t.valueSeq().map(function(e){return S.a.createElement("option",{value:e,key:e},e)}).toArray()))}}]),t}(S.a.Component),an=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.specActions,n=e.specSelectors,r=e.getComponent,o=n.operationScheme(),i=n.schemes(),a=r("schemes");return i&&i.size?S.a.createElement(a,{currentScheme:o,schemes:i,specActions:t}):null}}]),t}(S.a.Component),sn=function(e){function t(e,n){var r;_()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"toggleCollapsed",function(){r.props.onToggle&&r.props.onToggle(r.props.modelName,!r.state.expanded),r.setState({expanded:!r.state.expanded})});var o=r.props,i=o.expanded,a=o.collapsedContent;return r.state={expanded:i,collapsedContent:a||t.defaultProps.collapsedContent},r}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.hideSelfOnExpand,n=e.expanded,r=e.modelName;t&&n&&this.props.onToggle(r,n)}},{key:"componentWillReceiveProps",value:function(e){this.props.expanded!==e.expanded&&this.setState({expanded:e.expanded})}},{key:"render",value:function(){var e=this.props,t=e.title,n=e.classes;return this.state.expanded&&this.props.hideSelfOnExpand?S.a.createElement("span",{className:n||""},this.props.children):S.a.createElement("span",{className:n||""},t&&S.a.createElement("span",{onClick:this.toggleCollapsed,style:{cursor:"pointer"}},t),S.a.createElement("span",{onClick:this.toggleCollapsed,style:{cursor:"pointer"}},S.a.createElement("span",{className:"model-toggle"+(this.state.expanded?"":" collapsed")})),this.state.expanded?this.props.children:this.state.collapsedContent)}}]),t}(E.Component);v()(sn,"defaultProps",{collapsedContent:"{...}",expanded:!1,title:null,onToggle:function(){},hideSelfOnExpand:!1});var un=function(e){function t(e,n){var r;_()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"activeTab",function(e){var t=e.target.dataset.name;r.setState({activeTab:t})});var o=r.props,i=o.getConfigs,a=o.isExecute,s=i().defaultModelRendering,u=s;return"example"!==s&&"model"!==s&&(u="example"),a&&(u="example"),r.state={activeTab:u},r}return le()(t,e),x()(t,[{key:"componentWillReceiveProps",value:function(e){e.isExecute&&!this.props.isExecute&&this.props.example&&this.setState({activeTab:"example"})}},{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.specSelectors,r=e.schema,o=e.example,i=e.isExecute,a=e.getConfigs,s=e.specPath,u=a().defaultModelExpandDepth,c=t("ModelWrapper"),l=t("highlightCode"),p=n.isOAS3();return S.a.createElement("div",{className:"model-example"},S.a.createElement("ul",{className:"tab"},S.a.createElement("li",{className:"tabitem"+("example"===this.state.activeTab?" active":"")},S.a.createElement("a",{className:"tablinks","data-name":"example",onClick:this.activeTab},i?"Edit Value":"Example Value")),r?S.a.createElement("li",{className:"tabitem"+("model"===this.state.activeTab?" active":"")},S.a.createElement("a",{className:"tablinks"+(i?" inactive":""),"data-name":"model",onClick:this.activeTab},p?"Schema":"Model")):null),S.a.createElement("div",null,"example"===this.state.activeTab?o||S.a.createElement(l,{value:"(no example available)"}):null,"model"===this.state.activeTab&&S.a.createElement(c,{schema:r,getComponent:t,getConfigs:a,specSelectors:n,expandDepth:u,specPath:s})))}}]),t}(S.a.Component),cn=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onToggle",function(e,t){n.props.layoutActions&&n.props.layoutActions.show(["models",e],t)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e,t=this.props,n=t.getComponent,r=t.getConfigs,o=n("Model");return this.props.layoutSelectors&&(e=this.props.layoutSelectors.isShown(["models",this.props.name])),S.a.createElement("div",{className:"model-box"},S.a.createElement(o,kt()({},this.props,{getConfigs:r,expanded:e,depth:1,onToggle:this.onToggle,expandDepth:this.props.expandDepth||0})))}}]),t}(E.Component),ln=n(196),pn=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"getSchemaBasePath",function(){return n.props.specSelectors.isOAS3()?["components","schemas"]:["definitions"]}),v()(ue()(n),"getCollapsedContent",function(){return" "}),v()(ue()(n),"handleToggle",function(e,t){n.props.layoutActions.show(["models",e],t),t&&n.props.specActions.requestResolvedSubtree([].concat(pt()(n.getSchemaBasePath()),[e]))}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.specSelectors,r=t.getComponent,o=t.layoutSelectors,i=t.layoutActions,a=t.getConfigs,s=n.definitions(),u=a(),c=u.docExpansion,l=u.defaultModelsExpandDepth;if(!s.size||l<0)return null;var p=o.isShown("models",l>0&&"none"!==c),f=this.getSchemaBasePath(),h=n.isOAS3(),d=r("ModelWrapper"),m=r("Collapse"),v=r("ModelCollapse"),g=r("JumpToPath");return S.a.createElement("section",{className:p?"models is-open":"models"},S.a.createElement("h4",{onClick:function(){return i.show("models",!p)}},S.a.createElement("span",null,h?"Schemas":"Models"),S.a.createElement("svg",{width:"20",height:"20"},S.a.createElement("use",{xlinkHref:p?"#large-arrow-down":"#large-arrow"}))),S.a.createElement(m,{isOpened:p},s.entrySeq().map(function(t){var s=$e()(t,1)[0],u=[].concat(pt()(f),[s]),c=n.specResolvedSubtree(u),p=n.specJson().getIn(u),h=k.Map.isMap(c)?c:O.a.Map(),m=k.Map.isMap(p)?p:O.a.Map(),y=h.get("title")||m.get("title")||s,b=o.isShown(["models",s],!1);b&&0===h.size&&m.size>0&&e.props.specActions.requestResolvedSubtree([].concat(pt()(e.getSchemaBasePath()),[s]));var _=O.a.List([].concat(pt()(f),[s])),w=S.a.createElement(d,{name:s,expandDepth:l,schema:h||O.a.Map(),displayName:y,specPath:_,getComponent:r,specSelectors:n,getConfigs:a,layoutSelectors:o,layoutActions:i}),x=S.a.createElement("span",{className:"model-box"},S.a.createElement("span",{className:"model model-title"},y));return S.a.createElement("div",{id:"model-".concat(s),className:"model-container",key:"models-section-".concat(s)},S.a.createElement("span",{className:"models-jump-to-path"},S.a.createElement(g,{specPath:_})),S.a.createElement(v,{classes:"model-box",collapsedContent:e.getCollapsedContent(s),onToggle:e.handleToggle,title:x,displayName:y,modelName:s,hideSelfOnExpand:!0,expanded:l>0&&b},w))}).toArray()))}}]),t}(E.Component),fn=function(e){var t=e.value,n=(0,e.getComponent)("ModelCollapse"),r=S.a.createElement("span",null,"Array [ ",t.count()," ]");return S.a.createElement("span",{className:"prop-enum"},"Enum:",S.a.createElement("br",null),S.a.createElement(n,{collapsedContent:r},"[ ",t.join(", ")," ]"))},hn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.schema,n=e.name,r=e.displayName,o=e.isRef,i=e.getComponent,s=e.getConfigs,u=e.depth,c=e.onToggle,l=e.expanded,p=e.specPath,f=At()(e,["schema","name","displayName","isRef","getComponent","getConfigs","depth","onToggle","expanded","specPath"]),h=f.specSelectors,d=f.expandDepth,m=h.isOAS3;if(!t)return null;var v=s().showExtensions,g=t.get("description"),y=t.get("properties"),b=t.get("additionalProperties"),_=t.get("title")||r||n,w=t.get("required"),x=i("JumpToPath",!0),E=i("Markdown"),C=i("Model"),O=i("ModelCollapse"),A=function(){return S.a.createElement("span",{className:"model-jump-to-path"},S.a.createElement(x,{specPath:p}))},T=S.a.createElement("span",null,S.a.createElement("span",null,"{"),"...",S.a.createElement("span",null,"}"),o?S.a.createElement(A,null):""),j=h.isOAS3()?t.get("anyOf"):null,P=h.isOAS3()?t.get("oneOf"):null,I=h.isOAS3()?t.get("not"):null,M=_&&S.a.createElement("span",{className:"model-title"},o&&t.get("$$ref")&&S.a.createElement("span",{className:"model-hint"},t.get("$$ref")),S.a.createElement("span",{className:"model-title__text"},_));return S.a.createElement("span",{className:"model"},S.a.createElement(O,{modelName:n,title:M,onToggle:c,expanded:!!l||u<=d,collapsedContent:T},S.a.createElement("span",{className:"brace-open object"},"{"),o?S.a.createElement(A,null):null,S.a.createElement("span",{className:"inner-object"},S.a.createElement("table",{className:"model"},S.a.createElement("tbody",null,g?S.a.createElement("tr",{style:{color:"#666",fontWeight:"normal"}},S.a.createElement("td",{style:{fontWeight:"bold"}},"description:"),S.a.createElement("td",null,S.a.createElement(E,{source:g}))):null,y&&y.size?y.entrySeq().map(function(e){var t=$e()(e,2),r=t[0],o=t[1],a=m()&&o.get("deprecated"),c=k.List.isList(w)&&w.contains(r),l={verticalAlign:"top",paddingRight:"0.2em"};return c&&(l.fontWeight="bold"),S.a.createElement("tr",{key:r,className:a&&"deprecated"},S.a.createElement("td",{style:l},r,c&&S.a.createElement("span",{style:{color:"red"}},"*")),S.a.createElement("td",{style:{verticalAlign:"top"}},S.a.createElement(C,kt()({key:"object-".concat(n,"-").concat(r,"_").concat(o)},f,{required:c,getComponent:i,specPath:p.push("properties",r),getConfigs:s,schema:o,depth:u+1}))))}).toArray():null,v?S.a.createElement("tr",null," "):null,v?t.entrySeq().map(function(e){var t=$e()(e,2),n=t[0],r=t[1];if("x-"===n.slice(0,2)){var o=r?r.toJS?r.toJS():r:null;return S.a.createElement("tr",{key:n,style:{color:"#777"}},S.a.createElement("td",null,n),S.a.createElement("td",{style:{verticalAlign:"top"}},a()(o)))}}).toArray():null,b&&b.size?S.a.createElement("tr",null,S.a.createElement("td",null,"< * >:"),S.a.createElement("td",null,S.a.createElement(C,kt()({},f,{required:!1,getComponent:i,specPath:p.push("additionalProperties"),getConfigs:s,schema:b,depth:u+1})))):null,j?S.a.createElement("tr",null,S.a.createElement("td",null,"anyOf ->"),S.a.createElement("td",null,j.map(function(e,t){return S.a.createElement("div",{key:t},S.a.createElement(C,kt()({},f,{required:!1,getComponent:i,specPath:p.push("anyOf",t),getConfigs:s,schema:e,depth:u+1})))}))):null,P?S.a.createElement("tr",null,S.a.createElement("td",null,"oneOf ->"),S.a.createElement("td",null,P.map(function(e,t){return S.a.createElement("div",{key:t},S.a.createElement(C,kt()({},f,{required:!1,getComponent:i,specPath:p.push("oneOf",t),getConfigs:s,schema:e,depth:u+1})))}))):null,I?S.a.createElement("tr",null,S.a.createElement("td",null,"not ->"),S.a.createElement("td",null,S.a.createElement("div",null,S.a.createElement(C,kt()({},f,{required:!1,getComponent:i,specPath:p.push("not"),getConfigs:s,schema:I,depth:u+1}))))):null))),S.a.createElement("span",{className:"brace-close"},"}")))}}]),t}(E.Component),dn={color:"#999",fontStyle:"italic"},mn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.getConfigs,r=e.schema,o=e.depth,i=e.expandDepth,a=e.name,s=e.displayName,u=e.specPath,c=r.get("description"),l=r.get("items"),p=r.get("title")||s||a,f=r.filter(function(e,t){return-1===["type","items","description","$$ref"].indexOf(t)}),h=t("Markdown"),d=t("ModelCollapse"),m=t("Model"),v=t("Property"),g=p&&S.a.createElement("span",{className:"model-title"},S.a.createElement("span",{className:"model-title__text"},p));return S.a.createElement("span",{className:"model"},S.a.createElement(d,{title:g,expanded:o<=i,collapsedContent:"[...]"},"[",f.size?f.entrySeq().map(function(e){var t=$e()(e,2),n=t[0],r=t[1];return S.a.createElement(v,{key:"".concat(n,"-").concat(r),propKey:n,propVal:r,propStyle:dn})}):null,c?S.a.createElement(h,{source:c}):f.size?S.a.createElement("div",{className:"markdown"}):null,S.a.createElement("span",null,S.a.createElement(m,kt()({},this.props,{getConfigs:n,specPath:u.push("items"),name:null,schema:l,required:!1,depth:o+1}))),"]"))}}]),t}(E.Component),vn={color:"#6b6b6b",fontStyle:"italic"},gn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.getConfigs,o=e.name,i=e.displayName,a=e.depth,s=r().showExtensions;if(!t||!t.get)return S.a.createElement("div",null);var u=t.get("type"),c=t.get("format"),l=t.get("xml"),p=t.get("enum"),f=t.get("title")||i||o,h=t.get("description"),d=Object(D.m)(t),m=t.filter(function(e,t){return-1===["enum","type","format","description","$$ref"].indexOf(t)}).filterNot(function(e,t){return d.has(t)}),v=n("Markdown"),g=n("EnumModel"),y=n("Property");return S.a.createElement("span",{className:"model"},S.a.createElement("span",{className:"prop"},o&&S.a.createElement("span",{className:"".concat(1===a&&"model-title"," prop-name")},f),S.a.createElement("span",{className:"prop-type"},u),c&&S.a.createElement("span",{className:"prop-format"},"($",c,")"),m.size?m.entrySeq().map(function(e){var t=$e()(e,2),n=t[0],r=t[1];return S.a.createElement(y,{key:"".concat(n,"-").concat(r),propKey:n,propVal:r,propStyle:vn})}):null,s&&d.size?d.entrySeq().map(function(e){var t=$e()(e,2),n=t[0],r=t[1];return S.a.createElement(y,{key:"".concat(n,"-").concat(r),propKey:n,propVal:r,propStyle:vn})}):null,h?S.a.createElement(v,{source:h}):null,l&&l.size?S.a.createElement("span",null,S.a.createElement("br",null),S.a.createElement("span",{style:vn},"xml:"),l.entrySeq().map(function(e){var t=$e()(e,2),n=t[0],r=t[1];return S.a.createElement("span",{key:"".concat(n,"-").concat(r),style:vn},S.a.createElement("br",null),"   ",n,": ",String(r))}).toArray()):null,p&&S.a.createElement(g,{value:p,getComponent:n})))}}]),t}(E.Component),yn=function(e){var t=e.propKey,n=e.propVal,r=e.propStyle;return S.a.createElement("span",{style:r},S.a.createElement("br",null),t,": ",String(n))},bn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.onTryoutClick,n=e.onCancelClick,r=e.enabled;return S.a.createElement("div",{className:"try-out"},r?S.a.createElement("button",{className:"btn try-out__btn cancel",onClick:n},"Cancel"):S.a.createElement("button",{className:"btn try-out__btn",onClick:t},"Try it out "))}}]),t}(S.a.Component);v()(bn,"defaultProps",{onTryoutClick:Function.prototype,onCancelClick:Function.prototype,enabled:!1});var _n=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.bypass,n=e.isSwagger2,r=e.isOAS3,o=e.alsoShow;return t?S.a.createElement("div",null,this.props.children):n&&r?S.a.createElement("div",{className:"version-pragma"},o,S.a.createElement("div",{className:"version-pragma__message version-pragma__message--ambiguous"},S.a.createElement("div",null,S.a.createElement("h3",null,"Unable to render this definition"),S.a.createElement("p",null,S.a.createElement("code",null,"swagger")," and ",S.a.createElement("code",null,"openapi")," fields cannot be present in the same Swagger or OpenAPI definition. Please remove one of the fields."),S.a.createElement("p",null,"Supported version fields are ",S.a.createElement("code",null,"swagger: ",'"2.0"')," and those that match ",S.a.createElement("code",null,"openapi: 3.0.n")," (for example, ",S.a.createElement("code",null,"openapi: 3.0.0"),").")))):n||r?S.a.createElement("div",null,this.props.children):S.a.createElement("div",{className:"version-pragma"},o,S.a.createElement("div",{className:"version-pragma__message version-pragma__message--missing"},S.a.createElement("div",null,S.a.createElement("h3",null,"Unable to render this definition"),S.a.createElement("p",null,"The provided definition does not specify a valid version field."),S.a.createElement("p",null,"Please indicate a valid Swagger or OpenAPI version field. Supported version fields are ",S.a.createElement("code",null,"swagger: ",'"2.0"')," and those that match ",S.a.createElement("code",null,"openapi: 3.0.n")," (for example, ",S.a.createElement("code",null,"openapi: 3.0.0"),")."))))}}]),t}(S.a.PureComponent);v()(_n,"defaultProps",{alsoShow:null,children:null,bypass:!1});var wn=function(e){var t=e.version;return S.a.createElement("small",null,S.a.createElement("pre",{className:"version"}," ",t," "))},xn=function(e){var t=e.enabled,n=e.path,r=e.text;return S.a.createElement("a",{className:"nostyle",onClick:t?function(e){return e.preventDefault()}:null,href:t?"#/".concat(n):null},S.a.createElement("span",null,r))},En=function(){return S.a.createElement("div",null,S.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",style:{position:"absolute",width:0,height:0}},S.a.createElement("defs",null,S.a.createElement("symbol",{viewBox:"0 0 20 20",id:"unlocked"},S.a.createElement("path",{d:"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z"})),S.a.createElement("symbol",{viewBox:"0 0 20 20",id:"locked"},S.a.createElement("path",{d:"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z"})),S.a.createElement("symbol",{viewBox:"0 0 20 20",id:"close"},S.a.createElement("path",{d:"M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z"})),S.a.createElement("symbol",{viewBox:"0 0 20 20",id:"large-arrow"},S.a.createElement("path",{d:"M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z"})),S.a.createElement("symbol",{viewBox:"0 0 20 20",id:"large-arrow-down"},S.a.createElement("path",{d:"M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z"})),S.a.createElement("symbol",{viewBox:"0 0 24 24",id:"jump-to"},S.a.createElement("path",{d:"M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z"})),S.a.createElement("symbol",{viewBox:"0 0 24 24",id:"expand"},S.a.createElement("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"})))))},Sn=n(194),Cn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.errSelectors,n=e.specSelectors,r=e.getComponent,o=r("SvgAssets"),i=r("InfoContainer",!0),a=r("VersionPragmaFilter"),s=r("operations",!0),u=r("Models",!0),c=r("Row"),l=r("Col"),p=r("errors",!0),f=r("ServersContainer",!0),h=r("SchemesContainer",!0),d=r("AuthorizeBtnContainer",!0),m=r("FilterContainer",!0),v=n.isSwagger2(),g=n.isOAS3(),y=!n.specStr(),b=n.loadingStatus(),_=null;if("loading"===b&&(_=S.a.createElement("div",{className:"info"},S.a.createElement("div",{className:"loading-container"},S.a.createElement("div",{className:"loading"})))),"failed"===b&&(_=S.a.createElement("div",{className:"info"},S.a.createElement("div",{className:"loading-container"},S.a.createElement("h4",{className:"title"},"Failed to load API definition."),S.a.createElement(p,null)))),"failedConfig"===b){var w=t.lastError(),x=w?w.get("message"):"";_=S.a.createElement("div",{className:"info",style:{maxWidth:"880px",marginLeft:"auto",marginRight:"auto",textAlign:"center"}},S.a.createElement("div",{className:"loading-container"},S.a.createElement("h4",{className:"title"},"Failed to load remote configuration."),S.a.createElement("p",null,x)))}if(!_&&y&&(_=S.a.createElement("h4",null,"No API definition provided.")),_)return S.a.createElement("div",{className:"swagger-ui"},S.a.createElement("div",{className:"loading-container"},_));var E=n.servers(),C=n.schemes(),k=E&&E.size,O=C&&C.size,A=!!n.securityDefinitions();return S.a.createElement("div",{className:"swagger-ui"},S.a.createElement(o,null),S.a.createElement(a,{isSwagger2:v,isOAS3:g,alsoShow:S.a.createElement(p,null)},S.a.createElement(p,null),S.a.createElement(c,{className:"information-container"},S.a.createElement(l,{mobile:12},S.a.createElement(i,null))),k||O||A?S.a.createElement("div",{className:"scheme-container"},S.a.createElement(l,{className:"schemes wrapper",mobile:12},k?S.a.createElement(f,null):null,O?S.a.createElement(h,null):null,A?S.a.createElement(d,null):null)):null,S.a.createElement(m,null),S.a.createElement(c,null,S.a.createElement(l,{mobile:12,desktop:12},S.a.createElement(s,null))),S.a.createElement(c,null,S.a.createElement(l,{mobile:12,desktop:12},S.a.createElement(u,null)))))}}]),t}(S.a.Component),kn=n(487),On=n.n(kn),An={value:"",onChange:function(){},schema:{},keyName:"",required:!1,errors:Object(k.List)()},Tn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.dispatchInitialValue,n=e.value,r=e.onChange;t&&r(n)}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.errors,r=e.value,o=e.onChange,i=e.getComponent,a=e.fn,s=e.disabled;t.toJS&&(t=t.toJS());var u=t,c=u.type,l=u.format,p=void 0===l?"":l,f=i(p?"JsonSchema_".concat(c,"_").concat(p):"JsonSchema_".concat(c))||i("JsonSchema_string");return S.a.createElement(f,kt()({},this.props,{errors:n,fn:a,getComponent:i,value:r,onChange:o,schema:t,disabled:s}))}}]),t}(E.Component);v()(Tn,"defaultProps",An);var jn=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onChange",function(e){var t="file"===n.props.schema.type?e.target.files[0]:e.target.value;n.props.onChange(t,n.props.keyName)}),v()(ue()(n),"onEnumChange",function(e){return n.props.onChange(e)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.value,r=e.schema,o=e.errors,i=e.required,a=e.description,s=e.disabled,u=r.enum;if(o=o.toJS?o.toJS():[],u){var c=t("Select");return S.a.createElement(c,{className:o.length?"invalid":"",title:o.length?o:"",allowedValues:u,value:n,allowEmptyValue:!i,disabled:s,onChange:this.onEnumChange})}var l=s||"formData"===r.in&&!("FormData"in window),p=t("Input");return"file"===r.type?S.a.createElement(p,{type:"file",className:o.length?"invalid":"",title:o.length?o:"",onChange:this.onChange,disabled:l}):S.a.createElement(On.a,{type:"password"===r.format?"password":"text",className:o.length?"invalid":"",title:o.length?o:"",value:n,minLength:0,debounceTimeout:350,placeholder:a,onChange:this.onChange,disabled:l})}}]),t}(E.Component);v()(jn,"defaultProps",An);var Pn=function(e){function t(e,n){var r;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"onChange",function(){return r.props.onChange(r.state.value)}),v()(ue()(r),"onItemChange",function(e,t){r.setState(function(n){return{value:n.value.set(t,e)}},r.onChange)}),v()(ue()(r),"removeItem",function(e){r.setState(function(t){return{value:t.value.remove(e)}},r.onChange)}),v()(ue()(r),"addItem",function(){r.setState(function(e){return e.value=Nn(e.value),{value:e.value.push("")}},r.onChange)}),v()(ue()(r),"onEnumChange",function(e){r.setState(function(){return{value:e}},r.onChange)}),r.state={value:Nn(e.value)},r}return le()(t,e),x()(t,[{key:"componentWillReceiveProps",value:function(e){e.value!==this.state.value&&this.setState({value:e.value})}},{key:"render",value:function(){var e=this,t=this.props,n=t.getComponent,r=t.required,o=t.schema,i=t.errors,a=t.fn,s=t.disabled;i=i.toJS?i.toJS():[];var u=a.inferSchema(o.items),c=n("JsonSchemaForm"),l=n("Button"),p=u.enum,f=this.state.value;if(p){var h=n("Select");return S.a.createElement(h,{className:i.length?"invalid":"",title:i.length?i:"",multiple:!0,value:f,disabled:s,allowedValues:p,allowEmptyValue:!r,onChange:this.onEnumChange})}return S.a.createElement("div",{className:"json-schema-array"},!f||!f.count||f.count()<1?null:f.map(function(t,r){var o=y()({},u);if(i.length){var p=i.filter(function(e){return e.index===r});p.length&&(i=[p[0].error+r])}return S.a.createElement("div",{key:r,className:"json-schema-form-item"},S.a.createElement(c,{fn:a,getComponent:n,value:t,onChange:function(t){return e.onItemChange(t,r)},schema:o,disabled:s}),s?null:S.a.createElement(l,{className:"btn btn-sm json-schema-form-item-remove",onClick:function(){return e.removeItem(r)}}," - "))}).toArray(),s?null:S.a.createElement(l,{className:"btn btn-sm json-schema-form-item-add ".concat(i.length?"invalid":null),onClick:this.addItem},"Add item"))}}]),t}(E.PureComponent);v()(Pn,"defaultProps",An);var In=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onEnumChange",function(e){return n.props.onChange(e)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.value,r=e.errors,o=e.schema,i=e.required,a=e.disabled;r=r.toJS?r.toJS():[];var s=t("Select");return S.a.createElement(s,{className:r.length?"invalid":"",title:r.length?r:"",value:String(n),disabled:a,allowedValues:Object(k.fromJS)(o.enum||["true","false"]),allowEmptyValue:!o.enum||!i,onChange:this.onEnumChange})}}]),t}(E.Component);v()(In,"defaultProps",An);var Mn=function(e){function t(){var e;return _()(this,t),e=oe()(this,ae()(t).call(this)),v()(ue()(e),"onChange",function(t){e.props.onChange(t)}),v()(ue()(e),"handleOnChange",function(t){var n=t.target.value;e.onChange(n)}),e}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.value,r=e.errors,o=e.disabled,i=t("TextArea");return S.a.createElement("div",null,S.a.createElement(i,{className:rt()({invalid:r.size}),title:r.size?r.join(", "):"",value:Object(D.I)(n),disabled:o,onChange:this.handleOnChange}))}}]),t}(E.PureComponent);function Nn(e){return k.List.isList(e)?e:Object(k.List)()}v()(Mn,"defaultProps",An);var Rn=function(){var e={components:{App:he,authorizationPopup:de,authorizeBtn:me,AuthorizeBtnContainer:ve,authorizeOperationBtn:ge,auths:ye,AuthItem:be,authError:_e,oauth2:Te,apiKeyAuth:we,basicAuth:xe,clear:je,liveResponse:Me,InitializedInput:Vt,info:Yt,InfoContainer:$t,JumpToPath:Gt,onlineValidatorBadge:De,operations:Fe,operation:ze,OperationSummary:We,OperationSummaryMethod:Je,OperationSummaryPath:Ke,highlightCode:et,responses:tt,response:ot,responseBody:ct,parameters:ft,parameterRow:vt,execute:gt,headers:bt,errors:_t,contentType:St,overview:Bt,footer:Zt,FilterContainer:Xt,ParamBody:en,curl:rn,schemes:on,SchemesContainer:an,modelExample:un,ModelWrapper:cn,ModelCollapse:sn,Model:ln.a,Models:pn,EnumModel:fn,ObjectModel:hn,ArrayModel:mn,PrimitiveModel:gn,Property:yn,TryItOutButton:bn,Markdown:Sn.a,BaseLayout:Cn,VersionPragmaFilter:_n,VersionStamp:wn,OperationExt:Ge,OperationExtRow:Ze,ParameterExt:ht,ParameterIncludeEmpty:dt,OperationTag:Be,OperationContainer:fe,DeepLink:xn,InfoUrl:Kt,InfoBasePath:Ht,SvgAssets:En,Example:Ee,ExamplesSelect:ke,ExamplesSelectValueRetainer:Ae}},t={components:r},n={components:o};return[Q.default,Z.default,Y.default,J.default,W.default,V.default,H.default,K.default,e,t,$.default,n,G.default,X.default,ee.default,te.default,ne.default]},Dn=n(306);function Ln(){return[Rn,Dn.default]}var Un=n(328);n.d(t,"default",function(){return Hn});var qn=!0,Fn="g3911391",Bn="3.25.0",zn="ip-172-31-21-173",Vn="Fri, 17 Jan 2020 21:38:59 GMT";function Hn(e){R.a.versions=R.a.versions||{},R.a.versions.swaggerUi={version:Bn,gitRevision:Fn,gitDirty:qn,buildTimestamp:Vn,machine:zn};var t={dom_id:null,domNode:null,spec:{},url:"",urls:null,layout:"BaseLayout",docExpansion:"list",maxDisplayedTags:null,filter:null,validatorUrl:"https://validator.swagger.io/validator",oauth2RedirectUrl:"".concat(window.location.protocol,"//").concat(window.location.host,"/oauth2-redirect.html"),configs:{},custom:{},displayOperationId:!1,displayRequestDuration:!1,deepLinking:!1,requestInterceptor:function(e){return e},responseInterceptor:function(e){return e},showMutatedRequest:!0,defaultModelRendering:"example",defaultModelExpandDepth:1,defaultModelsExpandDepth:1,showExtensions:!1,showCommonExtensions:!1,withCredentials:void 0,supportedSubmitMethods:["get","put","post","delete","options","head","patch","trace"],presets:[Ln],plugins:[],initialState:{},fn:{},components:{}},n=Object(D.D)(),r=e.domNode;delete e.domNode;var o=f()({},t,e,n),i={system:{configs:o.configs},plugins:o.presets,state:f()({layout:{layout:o.layout,filter:o.filter},spec:{spec:"",url:o.url}},o.initialState)};if(o.initialState)for(var s in o.initialState)o.initialState.hasOwnProperty(s)&&void 0===o.initialState[s]&&delete i.state[s];var c=new U(i);c.register([o.plugins,function(){return{fn:o.fn,components:o.components,state:o.state}}]);var p=c.getSystem(),h=function(e){var t=p.specSelectors.getLocalConfig?p.specSelectors.getLocalConfig():{},i=f()({},t,o,e||{},n);if(r&&(i.domNode=r),c.setConfigs(i),p.configsActions.loaded(),null!==e&&(!n.url&&"object"===l()(i.spec)&&u()(i.spec).length?(p.specActions.updateUrl(""),p.specActions.updateLoadingStatus("success"),p.specActions.updateSpec(a()(i.spec))):p.specActions.download&&i.url&&!i.urls&&(p.specActions.updateUrl(i.url),p.specActions.download(i.url))),i.domNode)p.render(i.domNode,"App");else if(i.dom_id){var s=document.querySelector(i.dom_id);p.render(s,"App")}else null===i.dom_id||null===i.domNode||console.error("Skipped rendering: no `dom_id` or `domNode` was specified");return p},d=n.config||o.configUrl;return d&&p.specActions&&p.specActions.getConfigByUrl&&(!p.specActions.getConfigByUrl||p.specActions.getConfigByUrl({url:d,loadRemoteConfig:!0,requestInterceptor:o.requestInterceptor,responseInterceptor:o.responseInterceptor},h))?(p.specActions.getConfigByUrl(d,h),p):h()}Hn.presets={apis:Ln},Hn.plugins=Un.default}]).default}); +//# sourceMappingURL=swagger-ui-bundle.js.map \ No newline at end of file diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui-standalone-preset.min.js b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui-standalone-preset.min.js old mode 100644 new mode 100755 index cd5a1d085991..66f7007f7478 --- a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui-standalone-preset.min.js +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui-standalone-preset.min.js @@ -1,13 +1,22 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SwaggerUIStandalonePreset=e():t.SwaggerUIStandalonePreset=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist",e(e.s=275)}([function(t,e,n){"use strict";function r(t){var e={};return null!==t&&Object.keys(t).forEach(function(n){t[n].forEach(function(t){e[String(t)]=n})}),e}function i(t,e){if(e=e||{},Object.keys(e).forEach(function(e){if(-1===s.indexOf(e))throw new o('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=r(e.styleAliases||null),-1===a.indexOf(this.kind))throw new o('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}var o=n(33),s=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],a=["scalar","sequence","mapping"];t.exports=i},function(t,e,n){var r=n(103)("wks"),i=n(70),o=n(4).Symbol,s="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))}).store=r},function(t,e,n){var r=n(4),i=n(13),o=n(14),s=n(22),a=n(40),u=function(t,e,n){var c,h,l,p,f=t&u.F,d=t&u.G,m=t&u.S,y=t&u.P,v=t&u.B,x=d?r:m?r[e]||(r[e]={}):(r[e]||{}).prototype,g=d?i:i[e]||(i[e]={}),D=g.prototype||(g.prototype={});d&&(n=e);for(c in n)h=!f&&x&&void 0!==x[c],l=(h?x:n)[c],p=v&&h?a(l,r):y&&"function"==typeof l?a(Function.call,l):l,x&&s(x,c,l,t&u.U),g[c]!=l&&o(g,c,p),y&&D[c]!=l&&(D[c]=l)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e,n){var r=n(2),i=n(29),o=n(8),s=/"/g,a=function(t,e,n,r){var i=String(o(t)),a="<"+e;return""!==n&&(a+=" "+n+'="'+String(r).replace(s,""")+'"'),a+">"+i+"</"+e+">"};t.exports=function(t,e){var n={};n[t]=e(a),r(r.P+r.F*i(function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}),"String",n)}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(58)("wks"),i=n(38),o=n(6).Symbol,s="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))}).store=r},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){t.exports=!n(26)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(16),i=n(83),o=n(60),s=Object.defineProperty;e.f=n(9)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(21);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(42),i=n(102);t.exports=n(28)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){"use strict";function r(t,e,n,r,o,s,a,u){if(i(e),!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var h=[n,r,o,s,a,u],l=0;c=new Error(e.replace(/%s/g,function(){return h[l++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var i=function(t){};t.exports=r},function(t,e,n){var r=n(19);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var r=n(6),i=n(5),o=n(81),s=n(18),a=function(t,e,n){var u,c,h,l=t&a.F,p=t&a.G,f=t&a.S,d=t&a.P,m=t&a.B,y=t&a.W,v=p?i:i[e]||(i[e]={}),x=v.prototype,g=p?r:f?r[e]:(r[e]||{}).prototype;p&&(n=e);for(u in n)(c=!l&&g&&void 0!==g[u])&&u in v||(h=c?g[u]:n[u],v[u]=p&&"function"!=typeof g[u]?n[u]:m&&c?o(h,r):y&&g[u]==h?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(h):d&&"function"==typeof h?o(Function.call,h):h,d&&((v.virtual||(v.virtual={}))[u]=h,t&a.R&&x&&!x[u]&&s(x,u,h)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e,n){var r=n(11),i=n(37);t.exports=n(9)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(151),i=n(50);t.exports=function(t){return r(i(t))}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(4),i=n(14),o=n(30),s=n(70)("src"),a=Function.toString,u=(""+a).split("toString");n(13).inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,n,a){var c="function"==typeof n;c&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(c&&(o(n,s)||i(n,s,t[e]?""+t[e]:u.join(String(e)))),t===r?t[e]=n:a?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[s]||a.call(this)})},function(t,e,n){"use strict";function r(t){return void 0===t||null===t}function i(t){return"object"==typeof t&&null!==t}function o(t){return Array.isArray(t)?t:r(t)?[]:[t]}function s(t,e){var n,r,i,o;if(e)for(o=Object.keys(e),n=0,r=o.length;n<r;n+=1)i=o[n],t[i]=e[i];return t}function a(t,e){var n,r="";for(n=0;n<e;n+=1)r+=t;return r}function u(t){return 0===t&&Number.NEGATIVE_INFINITY===1/t}t.exports.isNothing=r,t.exports.isObject=i,t.exports.toArray=o,t.exports.repeat=a,t.exports.isNegativeZero=u,t.exports.extend=s},function(t,e,n){"use strict";function r(t,e,n){var i=[];return t.include.forEach(function(t){n=r(t,e,n)}),t[e].forEach(function(t){n.forEach(function(e,n){e.tag===t.tag&&e.kind===t.kind&&i.push(n)}),n.push(t)}),n.filter(function(t,e){return-1===i.indexOf(e)})}function i(){function t(t){r[t.kind][t.tag]=r.fallback[t.tag]=t}var e,n,r={scalar:{},sequence:{},mapping:{},fallback:{}};for(e=0,n=arguments.length;e<n;e+=1)arguments[e].forEach(t);return r}function o(t){this.include=t.include||[],this.implicit=t.implicit||[],this.explicit=t.explicit||[],this.implicit.forEach(function(t){if(t.loadKind&&"scalar"!==t.loadKind)throw new a("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=r(this,"implicit",[]),this.compiledExplicit=r(this,"explicit",[]),this.compiledTypeMap=i(this.compiledImplicit,this.compiledExplicit)}var s=n(23),a=n(33),u=n(0);o.DEFAULT=null,o.create=function(){var t,e;switch(arguments.length){case 1:t=o.DEFAULT,e=arguments[0];break;case 2:t=arguments[0],e=arguments[1];break;default:throw new a("Wrong number of arguments for Schema.create function")}if(t=s.toArray(t),e=s.toArray(e),!t.every(function(t){return t instanceof o}))throw new a("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!e.every(function(t){return t instanceof u}))throw new a("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new o({include:t,explicit:e})},t.exports=o},function(t,e,n){"use strict";function r(t){return void 0!==t.ref}function i(t){return void 0!==t.key}var o=n(35),s=n(115),a=(n(46),n(118),Object.prototype.hasOwnProperty),u=n(116),c={key:!0,ref:!0,__self:!0,__source:!0},h=function(t,e,n,r,i,o,s){var a={$$typeof:u,type:t,key:e,ref:n,props:s,_owner:o};return a};h.createElement=function(t,e,n){var o,u={},l=null,p=null;if(null!=e){r(e)&&(p=e.ref),i(e)&&(l=""+e.key),void 0===e.__self?null:e.__self,void 0===e.__source?null:e.__source;for(o in e)a.call(e,o)&&!c.hasOwnProperty(o)&&(u[o]=e[o])}var f=arguments.length-2;if(1===f)u.children=n;else if(f>1){for(var d=Array(f),m=0;m<f;m++)d[m]=arguments[m+2];u.children=d}if(t&&t.defaultProps){var y=t.defaultProps;for(o in y)void 0===u[o]&&(u[o]=y[o])}return h(t,l,p,0,0,s.current,u)},h.createFactory=function(t){var e=h.createElement.bind(null,t);return e.type=t,e},h.cloneAndReplaceKey=function(t,e){return h(t.type,e,t.ref,t._self,t._source,t._owner,t.props)},h.cloneElement=function(t,e,n){var u,l=o({},t.props),p=t.key,f=t.ref,d=(t._self,t._source,t._owner);if(null!=e){r(e)&&(f=e.ref,d=s.current),i(e)&&(p=""+e.key);var m;t.type&&t.type.defaultProps&&(m=t.type.defaultProps);for(u in e)a.call(e,u)&&!c.hasOwnProperty(u)&&(void 0===e[u]&&void 0!==m?l[u]=m[u]:l[u]=e[u])}var y=arguments.length-2;if(1===y)l.children=n;else if(y>1){for(var v=Array(y),x=0;x<y;x++)v[x]=arguments[x+2];l.children=v}return h(t.type,p,f,0,0,d,l)},h.isValidElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===u},t.exports=h},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){t.exports=!n(29)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){t.exports={}},function(t,e,n){var r=n(43),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){"use strict";function r(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(t){var e=this.name+": ";return e+=this.reason||"(unknown reason)",!t&&this.mark&&(e+=" "+this.mark.toString()),e},t.exports=r},function(t,e,n){"use strict";var r=n(24);t.exports=new r({include:[n(110)],implicit:[n(255),n(248)],explicit:[n(240),n(250),n(251),n(253)]})},function(t,e,n){"use strict";function r(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}/* +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(function(){try{return require("esprima")}catch(t){}}()):"function"==typeof define&&define.amd?define(["esprima"],e):"object"==typeof exports?exports.SwaggerUIStandalonePreset=e(function(){try{return require("esprima")}catch(t){}}()):t.SwaggerUIStandalonePreset=e(t.esprima)}(window,function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist",n(n.s=183)}([function(t,e,n){t.exports=function(){"use strict";var t=Array.prototype.slice;function e(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function n(t){return u(t)?t:q(t)}function r(t){return s(t)?t:J(t)}function i(t){return a(t)?t:Z(t)}function o(t){return u(t)&&!c(t)?t:V(t)}function u(t){return!(!t||!t[l])}function s(t){return!(!t||!t[h])}function a(t){return!(!t||!t[p])}function c(t){return s(t)||a(t)}function f(t){return!(!t||!t[d])}e(r,n),e(i,n),e(o,n),n.isIterable=u,n.isKeyed=s,n.isIndexed=a,n.isAssociative=c,n.isOrdered=f,n.Keyed=r,n.Indexed=i,n.Set=o;var l="@@__IMMUTABLE_ITERABLE__@@",h="@@__IMMUTABLE_KEYED__@@",p="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",y=5,w=1<<y,v=w-1,g={},M={value:!1},_={value:!1};function m(t){return t.value=!1,t}function L(t){t&&(t.value=!0)}function b(){}function j(t,e){e=e||0;for(var n=Math.max(0,t.length-e),r=new Array(n),i=0;i<n;i++)r[i]=t[i+e];return r}function x(t){return void 0===t.size&&(t.size=t.__iterate(S)),t.size}function N(t,e){if("number"!=typeof e){var n=e>>>0;if(""+n!==e||4294967295===n)return NaN;e=n}return e<0?x(t)+e:e}function S(){return!0}function D(t,e,n){return(0===t||void 0!==n&&t<=-n)&&(void 0===e||void 0!==n&&e>=n)}function I(t,e){return C(t,e,0)}function E(t,e){return C(t,e,e)}function C(t,e,n){return void 0===t?n:t<0?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}var T=0,A=1,O=2,z="function"==typeof Symbol&&Symbol.iterator,k="@@iterator",Y=z||k;function U(t){this.next=t}function P(t,e,n,r){var i=0===t?e:1===t?n:[e,n];return r?r.value=i:r={value:i,done:!1},r}function R(){return{value:void 0,done:!0}}function Q(t){return!!G(t)}function F(t){return t&&"function"==typeof t.next}function B(t){var e=G(t);return e&&e.call(t)}function G(t){var e=t&&(z&&t[z]||t[k]);if("function"==typeof e)return e}function W(t){return t&&"number"==typeof t.length}function q(t){return null==t?ot():u(t)?t.toSeq():function(t){var e=at(t)||"object"==typeof t&&new et(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}(t)}function J(t){return null==t?ot().toKeyedSeq():u(t)?s(t)?t.toSeq():t.fromEntrySeq():ut(t)}function Z(t){return null==t?ot():u(t)?s(t)?t.entrySeq():t.toIndexedSeq():st(t)}function V(t){return(null==t?ot():u(t)?s(t)?t.entrySeq():t:st(t)).toSetSeq()}U.prototype.toString=function(){return"[Iterator]"},U.KEYS=T,U.VALUES=A,U.ENTRIES=O,U.prototype.inspect=U.prototype.toSource=function(){return this.toString()},U.prototype[Y]=function(){return this},e(q,n),q.of=function(){return q(arguments)},q.prototype.toSeq=function(){return this},q.prototype.toString=function(){return this.__toString("Seq {","}")},q.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},q.prototype.__iterate=function(t,e){return ct(this,t,e,!0)},q.prototype.__iterator=function(t,e){return ft(this,t,e,!0)},e(J,q),J.prototype.toKeyedSeq=function(){return this},e(Z,q),Z.of=function(){return Z(arguments)},Z.prototype.toIndexedSeq=function(){return this},Z.prototype.toString=function(){return this.__toString("Seq [","]")},Z.prototype.__iterate=function(t,e){return ct(this,t,e,!1)},Z.prototype.__iterator=function(t,e){return ft(this,t,e,!1)},e(V,q),V.of=function(){return V(arguments)},V.prototype.toSetSeq=function(){return this},q.isSeq=it,q.Keyed=J,q.Set=V,q.Indexed=Z;var X,H,K,$="@@__IMMUTABLE_SEQ__@@";function tt(t){this._array=t,this.size=t.length}function et(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function nt(t){this._iterable=t,this.size=t.length||t.size}function rt(t){this._iterator=t,this._iteratorCache=[]}function it(t){return!(!t||!t[$])}function ot(){return X||(X=new tt([]))}function ut(t){var e=Array.isArray(t)?new tt(t).fromEntrySeq():F(t)?new rt(t).fromEntrySeq():Q(t)?new nt(t).fromEntrySeq():"object"==typeof t?new et(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function st(t){var e=at(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function at(t){return W(t)?new tt(t):F(t)?new rt(t):Q(t)?new nt(t):void 0}function ct(t,e,n,r){var i=t._cache;if(i){for(var o=i.length-1,u=0;u<=o;u++){var s=i[n?o-u:u];if(!1===e(s[1],r?s[0]:u,t))return u+1}return u}return t.__iterateUncached(e,n)}function ft(t,e,n,r){var i=t._cache;if(i){var o=i.length-1,u=0;return new U(function(){var t=i[n?o-u:u];return u++>o?{value:void 0,done:!0}:P(e,r?t[0]:u-1,t[1])})}return t.__iteratorUncached(e,n)}function lt(t,e){return e?function t(e,n,r,i){return Array.isArray(n)?e.call(i,r,Z(n).map(function(r,i){return t(e,r,i,n)})):pt(n)?e.call(i,r,J(n).map(function(r,i){return t(e,r,i,n)})):n}(e,t,"",{"":t}):ht(t)}function ht(t){return Array.isArray(t)?Z(t).map(ht).toList():pt(t)?J(t).map(ht).toMap():t}function pt(t){return t&&(t.constructor===Object||void 0===t.constructor)}function dt(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if((t=t.valueOf())===(e=e.valueOf())||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!("function"!=typeof t.equals||"function"!=typeof e.equals||!t.equals(e))}function yt(t,e){if(t===e)return!0;if(!u(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||s(t)!==s(e)||a(t)!==a(e)||f(t)!==f(e))return!1;if(0===t.size&&0===e.size)return!0;var n=!c(t);if(f(t)){var r=t.entries();return e.every(function(t,e){var i=r.next().value;return i&&dt(i[1],t)&&(n||dt(i[0],e))})&&r.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var o=t;t=e,e=o}var l=!0,h=e.__iterate(function(e,r){if(n?!t.has(e):i?!dt(e,t.get(r,g)):!dt(t.get(r,g),e))return l=!1,!1});return l&&t.size===h}function wt(t,e){if(!(this instanceof wt))return new wt(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(H)return H;H=this}}function vt(t,e){if(!t)throw new Error(e)}function gt(t,e,n){if(!(this instanceof gt))return new gt(t,e,n);if(vt(0!==n,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),n=void 0===n?1:Math.abs(n),e<t&&(n=-n),this._start=t,this._end=e,this._step=n,this.size=Math.max(0,Math.ceil((e-t)/n-1)+1),0===this.size){if(K)return K;K=this}}function Mt(){throw TypeError("Abstract")}function _t(){}function mt(){}function Lt(){}q.prototype[$]=!0,e(tt,Z),tt.prototype.get=function(t,e){return this.has(t)?this._array[N(this,t)]:e},tt.prototype.__iterate=function(t,e){for(var n=this._array,r=n.length-1,i=0;i<=r;i++)if(!1===t(n[e?r-i:i],i,this))return i+1;return i},tt.prototype.__iterator=function(t,e){var n=this._array,r=n.length-1,i=0;return new U(function(){return i>r?{value:void 0,done:!0}:P(t,i,n[e?r-i++:i++])})},e(et,J),et.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},et.prototype.has=function(t){return this._object.hasOwnProperty(t)},et.prototype.__iterate=function(t,e){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var u=r[e?i-o:o];if(!1===t(n[u],u,this))return o+1}return o},et.prototype.__iterator=function(t,e){var n=this._object,r=this._keys,i=r.length-1,o=0;return new U(function(){var u=r[e?i-o:o];return o++>i?{value:void 0,done:!0}:P(t,u,n[u])})},et.prototype[d]=!0,e(nt,Z),nt.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var n=B(this._iterable),r=0;if(F(n))for(var i;!(i=n.next()).done&&!1!==t(i.value,r++,this););return r},nt.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var n=B(this._iterable);if(!F(n))return new U(R);var r=0;return new U(function(){var e=n.next();return e.done?e:P(t,r++,e.value)})},e(rt,Z),rt.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var n,r=this._iterator,i=this._iteratorCache,o=0;o<i.length;)if(!1===t(i[o],o++,this))return o;for(;!(n=r.next()).done;){var u=n.value;if(i[o]=u,!1===t(u,o++,this))break}return o},rt.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var n=this._iterator,r=this._iteratorCache,i=0;return new U(function(){if(i>=r.length){var e=n.next();if(e.done)return e;r[i]=e.value}return P(t,i,r[i++])})},e(wt,Z),wt.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},wt.prototype.get=function(t,e){return this.has(t)?this._value:e},wt.prototype.includes=function(t){return dt(this._value,t)},wt.prototype.slice=function(t,e){var n=this.size;return D(t,e,n)?this:new wt(this._value,E(e,n)-I(t,n))},wt.prototype.reverse=function(){return this},wt.prototype.indexOf=function(t){return dt(this._value,t)?0:-1},wt.prototype.lastIndexOf=function(t){return dt(this._value,t)?this.size:-1},wt.prototype.__iterate=function(t,e){for(var n=0;n<this.size;n++)if(!1===t(this._value,n,this))return n+1;return n},wt.prototype.__iterator=function(t,e){var n=this,r=0;return new U(function(){return r<n.size?P(t,r++,n._value):{value:void 0,done:!0}})},wt.prototype.equals=function(t){return t instanceof wt?dt(this._value,t._value):yt(t)},e(gt,Z),gt.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},gt.prototype.get=function(t,e){return this.has(t)?this._start+N(this,t)*this._step:e},gt.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e<this.size&&e===Math.floor(e)},gt.prototype.slice=function(t,e){return D(t,e,this.size)?this:(t=I(t,this.size),(e=E(e,this.size))<=t?new gt(0,0):new gt(this.get(t,this._end),this.get(e,this._end),this._step))},gt.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step==0){var n=e/this._step;if(n>=0&&n<this.size)return n}return-1},gt.prototype.lastIndexOf=function(t){return this.indexOf(t)},gt.prototype.__iterate=function(t,e){for(var n=this.size-1,r=this._step,i=e?this._start+n*r:this._start,o=0;o<=n;o++){if(!1===t(i,o,this))return o+1;i+=e?-r:r}return o},gt.prototype.__iterator=function(t,e){var n=this.size-1,r=this._step,i=e?this._start+n*r:this._start,o=0;return new U(function(){var u=i;return i+=e?-r:r,o>n?{value:void 0,done:!0}:P(t,o++,u)})},gt.prototype.equals=function(t){return t instanceof gt?this._start===t._start&&this._end===t._end&&this._step===t._step:yt(this,t)},e(Mt,n),e(_t,Mt),e(mt,Mt),e(Lt,Mt),Mt.Keyed=_t,Mt.Indexed=mt,Mt.Set=Lt;var bt="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var n=65535&(t|=0),r=65535&(e|=0);return n*r+((t>>>16)*r+n*(e>>>16)<<16>>>0)|0};function jt(t){return t>>>1&1073741824|3221225471&t}function xt(t){if(!1===t||null==t)return 0;if("function"==typeof t.valueOf&&(!1===(t=t.valueOf())||null==t))return 0;if(!0===t)return 1;var e=typeof t;if("number"===e){if(t!=t||t===1/0)return 0;var n=0|t;for(n!==t&&(n^=4294967295*t);t>4294967295;)n^=t/=4294967295;return jt(n)}if("string"===e)return t.length>At?function(t){var e=kt[t];return void 0===e&&(e=Nt(t),zt===Ot&&(zt=0,kt={}),zt++,kt[t]=e),e}(t):Nt(t);if("function"==typeof t.hashCode)return t.hashCode();if("object"===e)return function(t){var e;if(Et&&void 0!==(e=St.get(t)))return e;if(void 0!==(e=t[Tt]))return e;if(!It){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Tt]))return e;if(void 0!==(e=function(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}(t)))return e}if(e=++Ct,1073741824&Ct&&(Ct=0),Et)St.set(t,e);else{if(void 0!==Dt&&!1===Dt(t))throw new Error("Non-extensible objects are not allowed as keys.");if(It)Object.defineProperty(t,Tt,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[Tt]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[Tt]=e}}return e}(t);if("function"==typeof t.toString)return Nt(t.toString());throw new Error("Value type "+e+" cannot be hashed.")}function Nt(t){for(var e=0,n=0;n<t.length;n++)e=31*e+t.charCodeAt(n)|0;return jt(e)}var St,Dt=Object.isExtensible,It=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),Et="function"==typeof WeakMap;Et&&(St=new WeakMap);var Ct=0,Tt="__immutablehash__";"function"==typeof Symbol&&(Tt=Symbol(Tt));var At=16,Ot=255,zt=0,kt={};function Yt(t){vt(t!==1/0,"Cannot perform this action with an infinite size.")}function Ut(t){return null==t?Kt():Pt(t)&&!f(t)?t:Kt().withMutations(function(e){var n=r(t);Yt(n.size),n.forEach(function(t,n){return e.set(n,t)})})}function Pt(t){return!(!t||!t[Qt])}e(Ut,_t),Ut.of=function(){var e=t.call(arguments,0);return Kt().withMutations(function(t){for(var n=0;n<e.length;n+=2){if(n+1>=e.length)throw new Error("Missing value for key: "+e[n]);t.set(e[n],e[n+1])}})},Ut.prototype.toString=function(){return this.__toString("Map {","}")},Ut.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},Ut.prototype.set=function(t,e){return $t(this,t,e)},Ut.prototype.setIn=function(t,e){return this.updateIn(t,g,function(){return e})},Ut.prototype.remove=function(t){return $t(this,t,g)},Ut.prototype.deleteIn=function(t){return this.updateIn(t,function(){return g})},Ut.prototype.update=function(t,e,n){return 1===arguments.length?t(this):this.updateIn([t],e,n)},Ut.prototype.updateIn=function(t,e,n){n||(n=e,e=void 0);var r=function t(e,n,r,i){var o=e===g,u=n.next();if(u.done){var s=o?r:e,a=i(s);return a===s?e:a}vt(o||e&&e.set,"invalid keyPath");var c=u.value,f=o?g:e.get(c,g),l=t(f,n,r,i);return l===f?e:l===g?e.remove(c):(o?Kt():e).set(c,l)}(this,rn(t),e,n);return r===g?void 0:r},Ut.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Kt()},Ut.prototype.merge=function(){return re(this,void 0,arguments)},Ut.prototype.mergeWith=function(e){var n=t.call(arguments,1);return re(this,e,n)},Ut.prototype.mergeIn=function(e){var n=t.call(arguments,1);return this.updateIn(e,Kt(),function(t){return"function"==typeof t.merge?t.merge.apply(t,n):n[n.length-1]})},Ut.prototype.mergeDeep=function(){return re(this,ie,arguments)},Ut.prototype.mergeDeepWith=function(e){var n=t.call(arguments,1);return re(this,oe(e),n)},Ut.prototype.mergeDeepIn=function(e){var n=t.call(arguments,1);return this.updateIn(e,Kt(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,n):n[n.length-1]})},Ut.prototype.sort=function(t){return Ie(qe(this,t))},Ut.prototype.sortBy=function(t,e){return Ie(qe(this,e,t))},Ut.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},Ut.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new b)},Ut.prototype.asImmutable=function(){return this.__ensureOwner()},Ut.prototype.wasAltered=function(){return this.__altered},Ut.prototype.__iterator=function(t,e){return new Zt(this,t,e)},Ut.prototype.__iterate=function(t,e){var n=this,r=0;return this._root&&this._root.iterate(function(e){return r++,t(e[1],e[0],n)},e),r},Ut.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ht(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Ut.isMap=Pt;var Rt,Qt="@@__IMMUTABLE_MAP__@@",Ft=Ut.prototype;function Bt(t,e){this.ownerID=t,this.entries=e}function Gt(t,e,n){this.ownerID=t,this.bitmap=e,this.nodes=n}function Wt(t,e,n){this.ownerID=t,this.count=e,this.nodes=n}function qt(t,e,n){this.ownerID=t,this.keyHash=e,this.entries=n}function Jt(t,e,n){this.ownerID=t,this.keyHash=e,this.entry=n}function Zt(t,e,n){this._type=e,this._reverse=n,this._stack=t._root&&Xt(t._root)}function Vt(t,e){return P(t,e[0],e[1])}function Xt(t,e){return{node:t,index:0,__prev:e}}function Ht(t,e,n,r){var i=Object.create(Ft);return i.size=t,i._root=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function Kt(){return Rt||(Rt=Ht(0))}function $t(t,e,n){var r,i;if(t._root){var o=m(M),u=m(_);if(r=te(t._root,t.__ownerID,0,void 0,e,n,o,u),!u.value)return t;i=t.size+(o.value?n===g?-1:1:0)}else{if(n===g)return t;i=1,r=new Bt(t.__ownerID,[[e,n]])}return t.__ownerID?(t.size=i,t._root=r,t.__hash=void 0,t.__altered=!0,t):r?Ht(i,r):Kt()}function te(t,e,n,r,i,o,u,s){return t?t.update(e,n,r,i,o,u,s):o===g?t:(L(s),L(u),new Jt(e,r,[i,o]))}function ee(t){return t.constructor===Jt||t.constructor===qt}function ne(t,e,n,r,i){if(t.keyHash===r)return new qt(e,r,[t.entry,i]);var o,u=(0===n?t.keyHash:t.keyHash>>>n)&v,s=(0===n?r:r>>>n)&v;return new Gt(e,1<<u|1<<s,u===s?[ne(t,e,n+y,r,i)]:(o=new Jt(e,r,i),u<s?[t,o]:[o,t]))}function re(t,e,n){for(var i=[],o=0;o<n.length;o++){var s=n[o],a=r(s);u(s)||(a=a.map(function(t){return lt(t)})),i.push(a)}return ue(t,e,i)}function ie(t,e,n){return t&&t.mergeDeep&&u(e)?t.mergeDeep(e):dt(t,e)?t:e}function oe(t){return function(e,n,r){if(e&&e.mergeDeepWith&&u(n))return e.mergeDeepWith(t,n);var i=t(e,n,r);return dt(e,i)?e:i}}function ue(t,e,n){return 0===(n=n.filter(function(t){return 0!==t.size})).length?t:0!==t.size||t.__ownerID||1!==n.length?t.withMutations(function(t){for(var r=e?function(n,r){t.update(r,g,function(t){return t===g?n:e(t,n,r)})}:function(e,n){t.set(n,e)},i=0;i<n.length;i++)n[i].forEach(r)}):t.constructor(n[0])}function se(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function ae(t,e,n,r){var i=r?t:j(t);return i[e]=n,i}Ft[Qt]=!0,Ft.delete=Ft.remove,Ft.removeIn=Ft.deleteIn,Bt.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(dt(n,i[o][0]))return i[o][1];return r},Bt.prototype.update=function(t,e,n,r,i,o,u){for(var s=i===g,a=this.entries,c=0,f=a.length;c<f&&!dt(r,a[c][0]);c++);var l=c<f;if(l?a[c][1]===i:s)return this;if(L(u),(s||!l)&&L(o),!s||1!==a.length){if(!l&&!s&&a.length>=ce)return function(t,e,n,r){t||(t=new b);for(var i=new Jt(t,xt(n),[n,r]),o=0;o<e.length;o++){var u=e[o];i=i.update(t,0,void 0,u[0],u[1])}return i}(t,a,r,i);var h=t&&t===this.ownerID,p=h?a:j(a);return l?s?c===f-1?p.pop():p[c]=p.pop():p[c]=[r,i]:p.push([r,i]),h?(this.entries=p,this):new Bt(t,p)}},Gt.prototype.get=function(t,e,n,r){void 0===e&&(e=xt(n));var i=1<<((0===t?e:e>>>t)&v),o=this.bitmap;return 0==(o&i)?r:this.nodes[se(o&i-1)].get(t+y,e,n,r)},Gt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=xt(r));var s=(0===e?n:n>>>e)&v,a=1<<s,c=this.bitmap,f=0!=(c&a);if(!f&&i===g)return this;var l=se(c&a-1),h=this.nodes,p=f?h[l]:void 0,d=te(p,t,e+y,n,r,i,o,u);if(d===p)return this;if(!f&&d&&h.length>=fe)return function(t,e,n,r,i){for(var o=0,u=new Array(w),s=0;0!==n;s++,n>>>=1)u[s]=1&n?e[o++]:void 0;return u[r]=i,new Wt(t,o+1,u)}(t,h,c,s,d);if(f&&!d&&2===h.length&&ee(h[1^l]))return h[1^l];if(f&&d&&1===h.length&&ee(d))return d;var M=t&&t===this.ownerID,_=f?d?c:c^a:c|a,m=f?d?ae(h,l,d,M):function(t,e,n){var r=t.length-1;if(n&&e===r)return t.pop(),t;for(var i=new Array(r),o=0,u=0;u<r;u++)u===e&&(o=1),i[u]=t[u+o];return i}(h,l,M):function(t,e,n,r){var i=t.length+1;if(r&&e+1===i)return t[e]=n,t;for(var o=new Array(i),u=0,s=0;s<i;s++)s===e?(o[s]=n,u=-1):o[s]=t[s+u];return o}(h,l,d,M);return M?(this.bitmap=_,this.nodes=m,this):new Gt(t,_,m)},Wt.prototype.get=function(t,e,n,r){void 0===e&&(e=xt(n));var i=(0===t?e:e>>>t)&v,o=this.nodes[i];return o?o.get(t+y,e,n,r):r},Wt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=xt(r));var s=(0===e?n:n>>>e)&v,a=i===g,c=this.nodes,f=c[s];if(a&&!f)return this;var l=te(f,t,e+y,n,r,i,o,u);if(l===f)return this;var h=this.count;if(f){if(!l&&--h<le)return function(t,e,n,r){for(var i=0,o=0,u=new Array(n),s=0,a=1,c=e.length;s<c;s++,a<<=1){var f=e[s];void 0!==f&&s!==r&&(i|=a,u[o++]=f)}return new Gt(t,i,u)}(t,c,h,s)}else h++;var p=t&&t===this.ownerID,d=ae(c,s,l,p);return p?(this.count=h,this.nodes=d,this):new Wt(t,h,d)},qt.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(dt(n,i[o][0]))return i[o][1];return r},qt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=xt(r));var s=i===g;if(n!==this.keyHash)return s?this:(L(u),L(o),ne(this,t,e,n,[r,i]));for(var a=this.entries,c=0,f=a.length;c<f&&!dt(r,a[c][0]);c++);var l=c<f;if(l?a[c][1]===i:s)return this;if(L(u),(s||!l)&&L(o),s&&2===f)return new Jt(t,this.keyHash,a[1^c]);var h=t&&t===this.ownerID,p=h?a:j(a);return l?s?c===f-1?p.pop():p[c]=p.pop():p[c]=[r,i]:p.push([r,i]),h?(this.entries=p,this):new qt(t,this.keyHash,p)},Jt.prototype.get=function(t,e,n,r){return dt(n,this.entry[0])?this.entry[1]:r},Jt.prototype.update=function(t,e,n,r,i,o,u){var s=i===g,a=dt(r,this.entry[0]);return(a?i===this.entry[1]:s)?this:(L(u),s?void L(o):a?t&&t===this.ownerID?(this.entry[1]=i,this):new Jt(t,this.keyHash,[r,i]):(L(o),ne(this,t,e,xt(r),[r,i])))},Bt.prototype.iterate=qt.prototype.iterate=function(t,e){for(var n=this.entries,r=0,i=n.length-1;r<=i;r++)if(!1===t(n[e?i-r:r]))return!1},Gt.prototype.iterate=Wt.prototype.iterate=function(t,e){for(var n=this.nodes,r=0,i=n.length-1;r<=i;r++){var o=n[e?i-r:r];if(o&&!1===o.iterate(t,e))return!1}},Jt.prototype.iterate=function(t,e){return t(this.entry)},e(Zt,U),Zt.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var n,r=e.node,i=e.index++;if(r.entry){if(0===i)return Vt(t,r.entry)}else if(r.entries){if(i<=(n=r.entries.length-1))return Vt(t,r.entries[this._reverse?n-i:i])}else if(i<=(n=r.nodes.length-1)){var o=r.nodes[this._reverse?n-i:i];if(o){if(o.entry)return Vt(t,o.entry);e=this._stack=Xt(o,e)}continue}e=this._stack=this._stack.__prev}return{value:void 0,done:!0}};var ce=w/4,fe=w/2,le=w/4;function he(t){var e=Le();if(null==t)return e;if(pe(t))return t;var n=i(t),r=n.size;return 0===r?e:(Yt(r),r>0&&r<w?me(0,r,y,null,new we(n.toArray())):e.withMutations(function(t){t.setSize(r),n.forEach(function(e,n){return t.set(n,e)})}))}function pe(t){return!(!t||!t[de])}e(he,mt),he.of=function(){return this(arguments)},he.prototype.toString=function(){return this.__toString("List [","]")},he.prototype.get=function(t,e){if((t=N(this,t))>=0&&t<this.size){var n=xe(this,t+=this._origin);return n&&n.array[t&v]}return e},he.prototype.set=function(t,e){return function(t,e,n){if((e=N(t,e))!=e)return t;if(e>=t.size||e<0)return t.withMutations(function(t){e<0?Ne(t,e).set(0,n):Ne(t,0,e+1).set(e,n)});e+=t._origin;var r=t._tail,i=t._root,o=m(_);return e>=De(t._capacity)?r=be(r,t.__ownerID,0,e,n,o):i=be(i,t.__ownerID,t._level,e,n,o),o.value?t.__ownerID?(t._root=i,t._tail=r,t.__hash=void 0,t.__altered=!0,t):me(t._origin,t._capacity,t._level,i,r):t}(this,t,e)},he.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},he.prototype.insert=function(t,e){return this.splice(t,0,e)},he.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=y,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Le()},he.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations(function(n){Ne(n,0,e+t.length);for(var r=0;r<t.length;r++)n.set(e+r,t[r])})},he.prototype.pop=function(){return Ne(this,0,-1)},he.prototype.unshift=function(){var t=arguments;return this.withMutations(function(e){Ne(e,-t.length);for(var n=0;n<t.length;n++)e.set(n,t[n])})},he.prototype.shift=function(){return Ne(this,1)},he.prototype.merge=function(){return Se(this,void 0,arguments)},he.prototype.mergeWith=function(e){var n=t.call(arguments,1);return Se(this,e,n)},he.prototype.mergeDeep=function(){return Se(this,ie,arguments)},he.prototype.mergeDeepWith=function(e){var n=t.call(arguments,1);return Se(this,oe(e),n)},he.prototype.setSize=function(t){return Ne(this,0,t)},he.prototype.slice=function(t,e){var n=this.size;return D(t,e,n)?this:Ne(this,I(t,n),E(e,n))},he.prototype.__iterator=function(t,e){var n=0,r=_e(this,e);return new U(function(){var e=r();return e===Me?{value:void 0,done:!0}:P(t,n++,e)})},he.prototype.__iterate=function(t,e){for(var n,r=0,i=_e(this,e);(n=i())!==Me&&!1!==t(n,r++,this););return r},he.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?me(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)},he.isList=pe;var de="@@__IMMUTABLE_LIST__@@",ye=he.prototype;function we(t,e){this.array=t,this.ownerID=e}ye[de]=!0,ye.delete=ye.remove,ye.setIn=Ft.setIn,ye.deleteIn=ye.removeIn=Ft.removeIn,ye.update=Ft.update,ye.updateIn=Ft.updateIn,ye.mergeIn=Ft.mergeIn,ye.mergeDeepIn=Ft.mergeDeepIn,ye.withMutations=Ft.withMutations,ye.asMutable=Ft.asMutable,ye.asImmutable=Ft.asImmutable,ye.wasAltered=Ft.wasAltered,we.prototype.removeBefore=function(t,e,n){if(n===e?1<<e:0===this.array.length)return this;var r=n>>>e&v;if(r>=this.array.length)return new we([],t);var i,o=0===r;if(e>0){var u=this.array[r];if((i=u&&u.removeBefore(t,e-y,n))===u&&o)return this}if(o&&!i)return this;var s=je(this,t);if(!o)for(var a=0;a<r;a++)s.array[a]=void 0;return i&&(s.array[r]=i),s},we.prototype.removeAfter=function(t,e,n){if(n===(e?1<<e:0)||0===this.array.length)return this;var r,i=n-1>>>e&v;if(i>=this.array.length)return this;if(e>0){var o=this.array[i];if((r=o&&o.removeAfter(t,e-y,n))===o&&i===this.array.length-1)return this}var u=je(this,t);return u.array.splice(i+1),r&&(u.array[i]=r),u};var ve,ge,Me={};function _e(t,e){var n=t._origin,r=t._capacity,i=De(r),o=t._tail;return u(t._root,t._level,0);function u(t,s,a){return 0===s?function(t,u){var s=u===i?o&&o.array:t&&t.array,a=u>n?0:n-u,c=r-u;return c>w&&(c=w),function(){if(a===c)return Me;var t=e?--c:a++;return s&&s[t]}}(t,a):function(t,i,o){var s,a=t&&t.array,c=o>n?0:n-o>>i,f=1+(r-o>>i);return f>w&&(f=w),function(){for(;;){if(s){var t=s();if(t!==Me)return t;s=null}if(c===f)return Me;var n=e?--f:c++;s=u(a&&a[n],i-y,o+(n<<i))}}}(t,s,a)}}function me(t,e,n,r,i,o,u){var s=Object.create(ye);return s.size=e-t,s._origin=t,s._capacity=e,s._level=n,s._root=r,s._tail=i,s.__ownerID=o,s.__hash=u,s.__altered=!1,s}function Le(){return ve||(ve=me(0,0,y))}function be(t,e,n,r,i,o){var u,s=r>>>n&v,a=t&&s<t.array.length;if(!a&&void 0===i)return t;if(n>0){var c=t&&t.array[s],f=be(c,e,n-y,r,i,o);return f===c?t:((u=je(t,e)).array[s]=f,u)}return a&&t.array[s]===i?t:(L(o),u=je(t,e),void 0===i&&s===u.array.length-1?u.array.pop():u.array[s]=i,u)}function je(t,e){return e&&t&&e===t.ownerID?t:new we(t?t.array.slice():[],e)}function xe(t,e){if(e>=De(t._capacity))return t._tail;if(e<1<<t._level+y){for(var n=t._root,r=t._level;n&&r>0;)n=n.array[e>>>r&v],r-=y;return n}}function Ne(t,e,n){void 0!==e&&(e|=0),void 0!==n&&(n|=0);var r=t.__ownerID||new b,i=t._origin,o=t._capacity,u=i+e,s=void 0===n?o:n<0?o+n:i+n;if(u===i&&s===o)return t;if(u>=s)return t.clear();for(var a=t._level,c=t._root,f=0;u+f<0;)c=new we(c&&c.array.length?[void 0,c]:[],r),f+=1<<(a+=y);f&&(u+=f,i+=f,s+=f,o+=f);for(var l=De(o),h=De(s);h>=1<<a+y;)c=new we(c&&c.array.length?[c]:[],r),a+=y;var p=t._tail,d=h<l?xe(t,s-1):h>l?new we([],r):p;if(p&&h>l&&u<o&&p.array.length){for(var w=c=je(c,r),g=a;g>y;g-=y){var M=l>>>g&v;w=w.array[M]=je(w.array[M],r)}w.array[l>>>y&v]=p}if(s<o&&(d=d&&d.removeAfter(r,0,s)),u>=h)u-=h,s-=h,a=y,c=null,d=d&&d.removeBefore(r,0,u);else if(u>i||h<l){for(f=0;c;){var _=u>>>a&v;if(_!==h>>>a&v)break;_&&(f+=(1<<a)*_),a-=y,c=c.array[_]}c&&u>i&&(c=c.removeBefore(r,a,u-f)),c&&h<l&&(c=c.removeAfter(r,a,h-f)),f&&(u-=f,s-=f)}return t.__ownerID?(t.size=s-u,t._origin=u,t._capacity=s,t._level=a,t._root=c,t._tail=d,t.__hash=void 0,t.__altered=!0,t):me(u,s,a,c,d)}function Se(t,e,n){for(var r=[],o=0,s=0;s<n.length;s++){var a=n[s],c=i(a);c.size>o&&(o=c.size),u(a)||(c=c.map(function(t){return lt(t)})),r.push(c)}return o>t.size&&(t=t.setSize(o)),ue(t,e,r)}function De(t){return t<w?0:t-1>>>y<<y}function Ie(t){return null==t?Te():Ee(t)?t:Te().withMutations(function(e){var n=r(t);Yt(n.size),n.forEach(function(t,n){return e.set(n,t)})})}function Ee(t){return Pt(t)&&f(t)}function Ce(t,e,n,r){var i=Object.create(Ie.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=n,i.__hash=r,i}function Te(){return ge||(ge=Ce(Kt(),Le()))}function Ae(t,e,n){var r,i,o=t._map,u=t._list,s=o.get(e),a=void 0!==s;if(n===g){if(!a)return t;u.size>=w&&u.size>=2*o.size?(r=(i=u.filter(function(t,e){return void 0!==t&&s!==e})).toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(r.__ownerID=i.__ownerID=t.__ownerID)):(r=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(n===u.get(s)[1])return t;r=o,i=u.set(s,[e,n])}else r=o.set(e,u.size),i=u.set(u.size,[e,n]);return t.__ownerID?(t.size=r.size,t._map=r,t._list=i,t.__hash=void 0,t):Ce(r,i)}function Oe(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function ze(t){this._iter=t,this.size=t.size}function ke(t){this._iter=t,this.size=t.size}function Ye(t){this._iter=t,this.size=t.size}function Ue(t){var e=tn(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=en,e.__iterateUncached=function(e,n){var r=this;return t.__iterate(function(t,n){return!1!==e(n,t,r)},n)},e.__iteratorUncached=function(e,n){if(e===O){var r=t.__iterator(e,n);return new U(function(){var t=r.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===A?T:A,n)},e}function Pe(t,e,n){var r=tn(t);return r.size=t.size,r.has=function(e){return t.has(e)},r.get=function(r,i){var o=t.get(r,g);return o===g?i:e.call(n,o,r,t)},r.__iterateUncached=function(r,i){var o=this;return t.__iterate(function(t,i,u){return!1!==r(e.call(n,t,i,u),i,o)},i)},r.__iteratorUncached=function(r,i){var o=t.__iterator(O,i);return new U(function(){var i=o.next();if(i.done)return i;var u=i.value,s=u[0];return P(r,s,e.call(n,u[1],s,t),i)})},r}function Re(t,e){var n=tn(t);return n._iter=t,n.size=t.size,n.reverse=function(){return t},t.flip&&(n.flip=function(){var e=Ue(t);return e.reverse=function(){return t.flip()},e}),n.get=function(n,r){return t.get(e?n:-1-n,r)},n.has=function(n){return t.has(e?n:-1-n)},n.includes=function(e){return t.includes(e)},n.cacheResult=en,n.__iterate=function(e,n){var r=this;return t.__iterate(function(t,n){return e(t,n,r)},!n)},n.__iterator=function(e,n){return t.__iterator(e,!n)},n}function Qe(t,e,n,r){var i=tn(t);return r&&(i.has=function(r){var i=t.get(r,g);return i!==g&&!!e.call(n,i,r,t)},i.get=function(r,i){var o=t.get(r,g);return o!==g&&e.call(n,o,r,t)?o:i}),i.__iterateUncached=function(i,o){var u=this,s=0;return t.__iterate(function(t,o,a){if(e.call(n,t,o,a))return s++,i(t,r?o:s-1,u)},o),s},i.__iteratorUncached=function(i,o){var u=t.__iterator(O,o),s=0;return new U(function(){for(;;){var o=u.next();if(o.done)return o;var a=o.value,c=a[0],f=a[1];if(e.call(n,f,c,t))return P(i,r?c:s++,f,o)}})},i}function Fe(t,e,n,r){var i=t.size;if(void 0!==e&&(e|=0),void 0!==n&&(n===1/0?n=i:n|=0),D(e,n,i))return t;var o=I(e,i),u=E(n,i);if(o!=o||u!=u)return Fe(t.toSeq().cacheResult(),e,n,r);var s,a=u-o;a==a&&(s=a<0?0:a);var c=tn(t);return c.size=0===s?s:t.size&&s||void 0,!r&&it(t)&&s>=0&&(c.get=function(e,n){return(e=N(this,e))>=0&&e<s?t.get(e+o,n):n}),c.__iterateUncached=function(e,n){var i=this;if(0===s)return 0;if(n)return this.cacheResult().__iterate(e,n);var u=0,a=!0,c=0;return t.__iterate(function(t,n){if(!a||!(a=u++<o))return c++,!1!==e(t,r?n:c-1,i)&&c!==s}),c},c.__iteratorUncached=function(e,n){if(0!==s&&n)return this.cacheResult().__iterator(e,n);var i=0!==s&&t.__iterator(e,n),u=0,a=0;return new U(function(){for(;u++<o;)i.next();if(++a>s)return{value:void 0,done:!0};var t=i.next();return r||e===A?t:P(e,a-1,e===T?void 0:t.value[1],t)})},c}function Be(t,e,n,r){var i=tn(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,a=0;return t.__iterate(function(t,o,c){if(!s||!(s=e.call(n,t,o,c)))return a++,i(t,r?o:a-1,u)}),a},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var s=t.__iterator(O,o),a=!0,c=0;return new U(function(){var t,o,f;do{if((t=s.next()).done)return r||i===A?t:P(i,c++,i===T?void 0:t.value[1],t);var l=t.value;o=l[0],f=l[1],a&&(a=e.call(n,f,o,u))}while(a);return i===O?t:P(i,o,f,t)})},i}function Ge(t,e){var n=s(t),i=[t].concat(e).map(function(t){return u(t)?n&&(t=r(t)):t=n?ut(t):st(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===i.length)return t;if(1===i.length){var o=i[0];if(o===t||n&&s(o)||a(t)&&a(o))return o}var c=new tt(i);return n?c=c.toKeyedSeq():a(t)||(c=c.toSetSeq()),(c=c.flatten(!0)).size=i.reduce(function(t,e){if(void 0!==t){var n=e.size;if(void 0!==n)return t+n}},0),c}function We(t,e,n){var r=tn(t);return r.__iterateUncached=function(r,i){var o=0,s=!1;return function t(a,c){var f=this;a.__iterate(function(i,a){return(!e||c<e)&&u(i)?t(i,c+1):!1===r(i,n?a:o++,f)&&(s=!0),!s},i)}(t,0),o},r.__iteratorUncached=function(r,i){var o=t.__iterator(r,i),s=[],a=0;return new U(function(){for(;o;){var t=o.next();if(!1===t.done){var c=t.value;if(r===O&&(c=c[1]),e&&!(s.length<e)||!u(c))return n?t:P(r,a++,c,t);s.push(o),o=c.__iterator(r,i)}else o=s.pop()}return{value:void 0,done:!0}})},r}function qe(t,e,n){e||(e=nn);var r=s(t),i=0,o=t.toSeq().map(function(e,r){return[r,e,i++,n?n(e,r,t):e]}).toArray();return o.sort(function(t,n){return e(t[3],n[3])||t[2]-n[2]}).forEach(r?function(t,e){o[e].length=2}:function(t,e){o[e]=t[1]}),r?J(o):a(t)?Z(o):V(o)}function Je(t,e,n){if(e||(e=nn),n){var r=t.toSeq().map(function(e,r){return[e,n(e,r,t)]}).reduce(function(t,n){return Ze(e,t[1],n[1])?n:t});return r&&r[0]}return t.reduce(function(t,n){return Ze(e,t,n)?n:t})}function Ze(t,e,n){var r=t(n,e);return 0===r&&n!==e&&(null==n||n!=n)||r>0}function Ve(t,e,r){var i=tn(t);return i.size=new tt(r).map(function(t){return t.size}).min(),i.__iterate=function(t,e){for(var n,r=this.__iterator(A,e),i=0;!(n=r.next()).done&&!1!==t(n.value,i++,this););return i},i.__iteratorUncached=function(t,i){var o=r.map(function(t){return t=n(t),B(i?t.reverse():t)}),u=0,s=!1;return new U(function(){var n;return s||(n=o.map(function(t){return t.next()}),s=n.some(function(t){return t.done})),s?{value:void 0,done:!0}:P(t,u++,e.apply(null,n.map(function(t){return t.value})))})},i}function Xe(t,e){return it(t)?e:t.constructor(e)}function He(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Ke(t){return Yt(t.size),x(t)}function $e(t){return s(t)?r:a(t)?i:o}function tn(t){return Object.create((s(t)?J:a(t)?Z:V).prototype)}function en(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):q.prototype.cacheResult.call(this)}function nn(t,e){return t>e?1:t<e?-1:0}function rn(t){var e=B(t);if(!e){if(!W(t))throw new TypeError("Expected iterable or array-like: "+t);e=B(n(t))}return e}function on(t,e){var n,r=function(o){if(o instanceof r)return o;if(!(this instanceof r))return new r(o);if(!n){n=!0;var u=Object.keys(t);!function(t,e){try{e.forEach(function(t,e){Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){vt(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}.bind(void 0,t))}catch(t){}}(i,u),i.size=u.length,i._name=e,i._keys=u,i._defaultValues=t}this._map=Ut(o)},i=r.prototype=Object.create(un);return i.constructor=r,r}e(Ie,Ut),Ie.of=function(){return this(arguments)},Ie.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Ie.prototype.get=function(t,e){var n=this._map.get(t);return void 0!==n?this._list.get(n)[1]:e},Ie.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):Te()},Ie.prototype.set=function(t,e){return Ae(this,t,e)},Ie.prototype.remove=function(t){return Ae(this,t,g)},Ie.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Ie.prototype.__iterate=function(t,e){var n=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],n)},e)},Ie.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},Ie.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),n=this._list.__ensureOwner(t);return t?Ce(e,n,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=n,this)},Ie.isOrderedMap=Ee,Ie.prototype[d]=!0,Ie.prototype.delete=Ie.prototype.remove,e(Oe,J),Oe.prototype.get=function(t,e){return this._iter.get(t,e)},Oe.prototype.has=function(t){return this._iter.has(t)},Oe.prototype.valueSeq=function(){return this._iter.valueSeq()},Oe.prototype.reverse=function(){var t=this,e=Re(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},Oe.prototype.map=function(t,e){var n=this,r=Pe(this,t,e);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(t,e)}),r},Oe.prototype.__iterate=function(t,e){var n,r=this;return this._iter.__iterate(this._useKeys?function(e,n){return t(e,n,r)}:(n=e?Ke(this):0,function(i){return t(i,e?--n:n++,r)}),e)},Oe.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var n=this._iter.__iterator(A,e),r=e?Ke(this):0;return new U(function(){var i=n.next();return i.done?i:P(t,e?--r:r++,i.value,i)})},Oe.prototype[d]=!0,e(ze,Z),ze.prototype.includes=function(t){return this._iter.includes(t)},ze.prototype.__iterate=function(t,e){var n=this,r=0;return this._iter.__iterate(function(e){return t(e,r++,n)},e)},ze.prototype.__iterator=function(t,e){var n=this._iter.__iterator(A,e),r=0;return new U(function(){var e=n.next();return e.done?e:P(t,r++,e.value,e)})},e(ke,V),ke.prototype.has=function(t){return this._iter.includes(t)},ke.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){return t(e,e,n)},e)},ke.prototype.__iterator=function(t,e){var n=this._iter.__iterator(A,e);return new U(function(){var e=n.next();return e.done?e:P(t,e.value,e.value,e)})},e(Ye,J),Ye.prototype.entrySeq=function(){return this._iter.toSeq()},Ye.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){if(e){He(e);var r=u(e);return t(r?e.get(1):e[1],r?e.get(0):e[0],n)}},e)},Ye.prototype.__iterator=function(t,e){var n=this._iter.__iterator(A,e);return new U(function(){for(;;){var e=n.next();if(e.done)return e;var r=e.value;if(r){He(r);var i=u(r);return P(t,i?r.get(0):r[0],i?r.get(1):r[1],e)}}})},ze.prototype.cacheResult=Oe.prototype.cacheResult=ke.prototype.cacheResult=Ye.prototype.cacheResult=en,e(on,_t),on.prototype.toString=function(){return this.__toString(an(this)+" {","}")},on.prototype.has=function(t){return this._defaultValues.hasOwnProperty(t)},on.prototype.get=function(t,e){if(!this.has(t))return e;var n=this._defaultValues[t];return this._map?this._map.get(t,n):n},on.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=this.constructor;return t._empty||(t._empty=sn(this,Kt()))},on.prototype.set=function(t,e){if(!this.has(t))throw new Error('Cannot set unknown key "'+t+'" on '+an(this));if(this._map&&!this._map.has(t)&&e===this._defaultValues[t])return this;var n=this._map&&this._map.set(t,e);return this.__ownerID||n===this._map?this:sn(this,n)},on.prototype.remove=function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:sn(this,e)},on.prototype.wasAltered=function(){return this._map.wasAltered()},on.prototype.__iterator=function(t,e){var n=this;return r(this._defaultValues).map(function(t,e){return n.get(e)}).__iterator(t,e)},on.prototype.__iterate=function(t,e){var n=this;return r(this._defaultValues).map(function(t,e){return n.get(e)}).__iterate(t,e)},on.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?sn(this,e,t):(this.__ownerID=t,this._map=e,this)};var un=on.prototype;function sn(t,e,n){var r=Object.create(Object.getPrototypeOf(t));return r._map=e,r.__ownerID=n,r}function an(t){return t._name||t.constructor.name||"Record"}function cn(t){return null==t?wn():fn(t)&&!f(t)?t:wn().withMutations(function(e){var n=o(t);Yt(n.size),n.forEach(function(t){return e.add(t)})})}function fn(t){return!(!t||!t[hn])}un.delete=un.remove,un.deleteIn=un.removeIn=Ft.removeIn,un.merge=Ft.merge,un.mergeWith=Ft.mergeWith,un.mergeIn=Ft.mergeIn,un.mergeDeep=Ft.mergeDeep,un.mergeDeepWith=Ft.mergeDeepWith,un.mergeDeepIn=Ft.mergeDeepIn,un.setIn=Ft.setIn,un.update=Ft.update,un.updateIn=Ft.updateIn,un.withMutations=Ft.withMutations,un.asMutable=Ft.asMutable,un.asImmutable=Ft.asImmutable,e(cn,Lt),cn.of=function(){return this(arguments)},cn.fromKeys=function(t){return this(r(t).keySeq())},cn.prototype.toString=function(){return this.__toString("Set {","}")},cn.prototype.has=function(t){return this._map.has(t)},cn.prototype.add=function(t){return dn(this,this._map.set(t,!0))},cn.prototype.remove=function(t){return dn(this,this._map.remove(t))},cn.prototype.clear=function(){return dn(this,this._map.clear())},cn.prototype.union=function(){var e=t.call(arguments,0);return 0===(e=e.filter(function(t){return 0!==t.size})).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations(function(t){for(var n=0;n<e.length;n++)o(e[n]).forEach(function(e){return t.add(e)})}):this.constructor(e[0])},cn.prototype.intersect=function(){var e=t.call(arguments,0);if(0===e.length)return this;e=e.map(function(t){return o(t)});var n=this;return this.withMutations(function(t){n.forEach(function(n){e.every(function(t){return t.includes(n)})||t.remove(n)})})},cn.prototype.subtract=function(){var e=t.call(arguments,0);if(0===e.length)return this;e=e.map(function(t){return o(t)});var n=this;return this.withMutations(function(t){n.forEach(function(n){e.some(function(t){return t.includes(n)})&&t.remove(n)})})},cn.prototype.merge=function(){return this.union.apply(this,arguments)},cn.prototype.mergeWith=function(e){var n=t.call(arguments,1);return this.union.apply(this,n)},cn.prototype.sort=function(t){return vn(qe(this,t))},cn.prototype.sortBy=function(t,e){return vn(qe(this,e,t))},cn.prototype.wasAltered=function(){return this._map.wasAltered()},cn.prototype.__iterate=function(t,e){var n=this;return this._map.__iterate(function(e,r){return t(r,r,n)},e)},cn.prototype.__iterator=function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},cn.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):(this.__ownerID=t,this._map=e,this)},cn.isSet=fn;var ln,hn="@@__IMMUTABLE_SET__@@",pn=cn.prototype;function dn(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function yn(t,e){var n=Object.create(pn);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function wn(){return ln||(ln=yn(Kt()))}function vn(t){return null==t?Ln():gn(t)?t:Ln().withMutations(function(e){var n=o(t);Yt(n.size),n.forEach(function(t){return e.add(t)})})}function gn(t){return fn(t)&&f(t)}pn[hn]=!0,pn.delete=pn.remove,pn.mergeDeep=pn.merge,pn.mergeDeepWith=pn.mergeWith,pn.withMutations=Ft.withMutations,pn.asMutable=Ft.asMutable,pn.asImmutable=Ft.asImmutable,pn.__empty=wn,pn.__make=yn,e(vn,cn),vn.of=function(){return this(arguments)},vn.fromKeys=function(t){return this(r(t).keySeq())},vn.prototype.toString=function(){return this.__toString("OrderedSet {","}")},vn.isOrderedSet=gn;var Mn,_n=vn.prototype;function mn(t,e){var n=Object.create(_n);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function Ln(){return Mn||(Mn=mn(Te()))}function bn(t){return null==t?In():jn(t)?t:In().unshiftAll(t)}function jn(t){return!(!t||!t[Nn])}_n[d]=!0,_n.__empty=Ln,_n.__make=mn,e(bn,mt),bn.of=function(){return this(arguments)},bn.prototype.toString=function(){return this.__toString("Stack [","]")},bn.prototype.get=function(t,e){var n=this._head;for(t=N(this,t);n&&t--;)n=n.next;return n?n.value:e},bn.prototype.peek=function(){return this._head&&this._head.value},bn.prototype.push=function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,n=arguments.length-1;n>=0;n--)e={value:arguments[n],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):Dn(t,e)},bn.prototype.pushAll=function(t){if(0===(t=i(t)).size)return this;Yt(t.size);var e=this.size,n=this._head;return t.reverse().forEach(function(t){e++,n={value:t,next:n}}),this.__ownerID?(this.size=e,this._head=n,this.__hash=void 0,this.__altered=!0,this):Dn(e,n)},bn.prototype.pop=function(){return this.slice(1)},bn.prototype.unshift=function(){return this.push.apply(this,arguments)},bn.prototype.unshiftAll=function(t){return this.pushAll(t)},bn.prototype.shift=function(){return this.pop.apply(this,arguments)},bn.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):In()},bn.prototype.slice=function(t,e){if(D(t,e,this.size))return this;var n=I(t,this.size);if(E(e,this.size)!==this.size)return mt.prototype.slice.call(this,t,e);for(var r=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):Dn(r,i)},bn.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Dn(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},bn.prototype.__iterate=function(t,e){if(e)return this.reverse().__iterate(t);for(var n=0,r=this._head;r&&!1!==t(r.value,n++,this);)r=r.next;return n},bn.prototype.__iterator=function(t,e){if(e)return this.reverse().__iterator(t);var n=0,r=this._head;return new U(function(){if(r){var e=r.value;return r=r.next,P(t,n++,e)}return{value:void 0,done:!0}})},bn.isStack=jn;var xn,Nn="@@__IMMUTABLE_STACK__@@",Sn=bn.prototype;function Dn(t,e,n,r){var i=Object.create(Sn);return i.size=t,i._head=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function In(){return xn||(xn=Dn(0))}function En(t,e){var n=function(n){t.prototype[n]=e[n]};return Object.keys(e).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(n),t}Sn[Nn]=!0,Sn.withMutations=Ft.withMutations,Sn.asMutable=Ft.asMutable,Sn.asImmutable=Ft.asImmutable,Sn.wasAltered=Ft.wasAltered,n.Iterator=U,En(n,{toArray:function(){Yt(this.size);var t=new Array(this.size||0);return this.valueSeq().__iterate(function(e,n){t[n]=e}),t},toIndexedSeq:function(){return new ze(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS()},toJSON:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJSON?t.toJSON():t}).__toJS()},toKeyedSeq:function(){return new Oe(this,!0)},toMap:function(){return Ut(this.toKeyedSeq())},toObject:function(){Yt(this.size);var t={};return this.__iterate(function(e,n){t[n]=e}),t},toOrderedMap:function(){return Ie(this.toKeyedSeq())},toOrderedSet:function(){return vn(s(this)?this.valueSeq():this)},toSet:function(){return cn(s(this)?this.valueSeq():this)},toSetSeq:function(){return new ke(this)},toSeq:function(){return a(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return bn(s(this)?this.valueSeq():this)},toList:function(){return he(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){var e=t.call(arguments,0);return Xe(this,Ge(this,e))},includes:function(t){return this.some(function(e){return dt(e,t)})},entries:function(){return this.__iterator(O)},every:function(t,e){Yt(this.size);var n=!0;return this.__iterate(function(r,i,o){if(!t.call(e,r,i,o))return n=!1,!1}),n},filter:function(t,e){return Xe(this,Qe(this,t,e,!0))},find:function(t,e,n){var r=this.findEntry(t,e);return r?r[1]:n},forEach:function(t,e){return Yt(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){Yt(this.size),t=void 0!==t?""+t:",";var e="",n=!0;return this.__iterate(function(r){n?n=!1:e+=t,e+=null!=r?r.toString():""}),e},keys:function(){return this.__iterator(T)},map:function(t,e){return Xe(this,Pe(this,t,e))},reduce:function(t,e,n){var r,i;return Yt(this.size),arguments.length<2?i=!0:r=e,this.__iterate(function(e,o,u){i?(i=!1,r=e):r=t.call(n,r,e,o,u)}),r},reduceRight:function(t,e,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Xe(this,Re(this,!0))},slice:function(t,e){return Xe(this,Fe(this,t,e,!0))},some:function(t,e){return!this.every(zn(t),e)},sort:function(t){return Xe(this,qe(this,t))},values:function(){return this.__iterator(A)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(t,e){return x(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return function(t,e,n){var r=Ut().asMutable();return t.__iterate(function(i,o){r.update(e.call(n,i,o,t),0,function(t){return t+1})}),r.asImmutable()}(this,t,e)},equals:function(t){return yt(this,t)},entrySeq:function(){var t=this;if(t._cache)return new tt(t._cache);var e=t.toSeq().map(On).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(zn(t),e)},findEntry:function(t,e,n){var r=n;return this.__iterate(function(n,i,o){if(t.call(e,n,i,o))return r=[i,n],!1}),r},findKey:function(t,e){var n=this.findEntry(t,e);return n&&n[0]},findLast:function(t,e,n){return this.toKeyedSeq().reverse().find(t,e,n)},findLastEntry:function(t,e,n){return this.toKeyedSeq().reverse().findEntry(t,e,n)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(){return this.find(S)},flatMap:function(t,e){return Xe(this,function(t,e,n){var r=$e(t);return t.toSeq().map(function(i,o){return r(e.call(n,i,o,t))}).flatten(!0)}(this,t,e))},flatten:function(t){return Xe(this,We(this,t,!0))},fromEntrySeq:function(){return new Ye(this)},get:function(t,e){return this.find(function(e,n){return dt(n,t)},void 0,e)},getIn:function(t,e){for(var n,r=this,i=rn(t);!(n=i.next()).done;){var o=n.value;if((r=r&&r.get?r.get(o,g):g)===g)return e}return r},groupBy:function(t,e){return function(t,e,n){var r=s(t),i=(f(t)?Ie():Ut()).asMutable();t.__iterate(function(o,u){i.update(e.call(n,o,u,t),function(t){return(t=t||[]).push(r?[u,o]:o),t})});var o=$e(t);return i.map(function(e){return Xe(t,o(e))})}(this,t,e)},has:function(t){return this.get(t,g)!==g},hasIn:function(t){return this.getIn(t,g)!==g},isSubset:function(t){return t="function"==typeof t.includes?t:n(t),this.every(function(e){return t.includes(e)})},isSuperset:function(t){return(t="function"==typeof t.isSubset?t:n(t)).isSubset(this)},keyOf:function(t){return this.findKey(function(e){return dt(e,t)})},keySeq:function(){return this.toSeq().map(An).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return Je(this,t)},maxBy:function(t,e){return Je(this,e,t)},min:function(t){return Je(this,t?kn(t):Pn)},minBy:function(t,e){return Je(this,e?kn(e):Pn,t)},rest:function(){return this.slice(1)},skip:function(t){return this.slice(Math.max(0,t))},skipLast:function(t){return Xe(this,this.toSeq().reverse().skip(t).reverse())},skipWhile:function(t,e){return Xe(this,Be(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(zn(t),e)},sortBy:function(t,e){return Xe(this,qe(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return Xe(this,this.toSeq().reverse().take(t).reverse())},takeWhile:function(t,e){return Xe(this,function(t,e,n){var r=tn(t);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var u=0;return t.__iterate(function(t,i,s){return e.call(n,t,i,s)&&++u&&r(t,i,o)}),u},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var u=t.__iterator(O,i),s=!0;return new U(function(){if(!s)return{value:void 0,done:!0};var t=u.next();if(t.done)return t;var i=t.value,a=i[0],c=i[1];return e.call(n,c,a,o)?r===O?t:P(r,a,c,t):(s=!1,{value:void 0,done:!0})})},r}(this,t,e))},takeUntil:function(t,e){return this.takeWhile(zn(t),e)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(t){if(t.size===1/0)return 0;var e=f(t),n=s(t),r=e?1:0;return function(t,e){return e=bt(e,3432918353),e=bt(e<<15|e>>>-15,461845907),e=bt(e<<13|e>>>-13,5),e=bt((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=jt((e=bt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(n?e?function(t,e){r=31*r+Rn(xt(t),xt(e))|0}:function(t,e){r=r+Rn(xt(t),xt(e))|0}:e?function(t){r=31*r+xt(t)|0}:function(t){r=r+xt(t)|0}),r)}(this))}});var Cn=n.prototype;Cn[l]=!0,Cn[Y]=Cn.values,Cn.__toJS=Cn.toArray,Cn.__toStringMapper=Yn,Cn.inspect=Cn.toSource=function(){return this.toString()},Cn.chain=Cn.flatMap,Cn.contains=Cn.includes,En(r,{flip:function(){return Xe(this,Ue(this))},mapEntries:function(t,e){var n=this,r=0;return Xe(this,this.toSeq().map(function(i,o){return t.call(e,[o,i],r++,n)}).fromEntrySeq())},mapKeys:function(t,e){var n=this;return Xe(this,this.toSeq().flip().map(function(r,i){return t.call(e,r,i,n)}).flip())}});var Tn=r.prototype;function An(t,e){return e}function On(t,e){return[e,t]}function zn(t){return function(){return!t.apply(this,arguments)}}function kn(t){return function(){return-t.apply(this,arguments)}}function Yn(t){return"string"==typeof t?JSON.stringify(t):String(t)}function Un(){return j(arguments)}function Pn(t,e){return t<e?1:t>e?-1:0}function Rn(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}return Tn[h]=!0,Tn[Y]=Cn.entries,Tn.__toJS=Cn.toObject,Tn.__toStringMapper=function(t,e){return JSON.stringify(e)+": "+Yn(t)},En(i,{toKeyedSeq:function(){return new Oe(this,!1)},filter:function(t,e){return Xe(this,Qe(this,t,e,!1))},findIndex:function(t,e){var n=this.findEntry(t,e);return n?n[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return Xe(this,Re(this,!1))},slice:function(t,e){return Xe(this,Fe(this,t,e,!1))},splice:function(t,e){var n=arguments.length;if(e=Math.max(0|e,0),0===n||2===n&&!e)return this;t=I(t,t<0?this.count():this.size);var r=this.slice(0,t);return Xe(this,1===n?r:r.concat(j(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var n=this.findLastEntry(t,e);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(t){return Xe(this,We(this,t,!1))},get:function(t,e){return(t=N(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find(function(e,n){return n===t},void 0,e)},has:function(t){return(t=N(this,t))>=0&&(void 0!==this.size?this.size===1/0||t<this.size:-1!==this.indexOf(t))},interpose:function(t){return Xe(this,function(t,e){var n=tn(t);return n.size=t.size&&2*t.size-1,n.__iterateUncached=function(n,r){var i=this,o=0;return t.__iterate(function(t,r){return(!o||!1!==n(e,o++,i))&&!1!==n(t,o++,i)},r),o},n.__iteratorUncached=function(n,r){var i,o=t.__iterator(A,r),u=0;return new U(function(){return(!i||u%2)&&(i=o.next()).done?i:u%2?P(n,u++,e):P(n,u++,i.value,i)})},n}(this,t))},interleave:function(){var t=[this].concat(j(arguments)),e=Ve(this.toSeq(),Z.of,t),n=e.flatten(!0);return e.size&&(n.size=e.size*t.length),Xe(this,n)},keySeq:function(){return gt(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(t,e){return Xe(this,Be(this,t,e,!1))},zip:function(){var t=[this].concat(j(arguments));return Xe(this,Ve(this,Un,t))},zipWith:function(t){var e=j(arguments);return e[0]=this,Xe(this,Ve(this,t,e))}}),i.prototype[p]=!0,i.prototype[d]=!0,En(o,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}}),o.prototype.has=Cn.includes,o.prototype.contains=o.prototype.includes,En(J,r.prototype),En(Z,i.prototype),En(V,o.prototype),En(_t,r.prototype),En(mt,i.prototype),En(Lt,o.prototype),{Iterable:n,Seq:q,Collection:Mt,Map:Ut,OrderedMap:Ie,List:he,Stack:bn,Set:cn,OrderedSet:vn,Record:on,Range:gt,Repeat:wt,is:dt,fromJS:lt}}()},function(t,e,n){"use strict";t.exports=n(218)},function(t,e,n){t.exports=n(241)},function(t,e,n){"use strict";var r=n(47),i=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];t.exports=function(t,e){var n,u;if(e=e||{},Object.keys(e).forEach(function(e){if(-1===i.indexOf(e))throw new r('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=(n=e.styleAliases||null,u={},null!==n&&Object.keys(n).forEach(function(t){n[t].forEach(function(e){u[String(e)]=t})}),u),-1===o.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}},function(t,e){var n=t.exports={version:"2.6.5"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(110);t.exports=function(t,e,n){return e in t?r(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){"use strict";(function(t){n.d(e,"d",function(){return g}),n.d(e,"c",function(){return M}),n.d(e,"b",function(){return m}),n.d(e,"e",function(){return L}),n.d(e,"f",function(){return b}),n.d(e,"a",function(){return j});n(106),n(171),n(103);var r=n(107),i=n.n(r),o=n(14),u=n.n(o),s=n(2),a=n.n(s),c=n(9),f=n.n(c),l=n(0),h=n.n(l),p=(n(172),n(173),n(104),n(105)),d=n.n(p),y=(n(174),n(175),n(38),n(108),n(49)),w=n.n(y),v=(n(178),n(179),n(180),n(181),function(t){return h.a.Iterable.isIterable(t)});function g(t){return _(t)?v(t)?t.toJS():t:{}}function M(t){return a()(t)?t:[t]}function _(t){return!!t&&"object"===f()(t)}function m(t){return"function"==typeof t}d.a;var L=function(){var t={},e=w.a.location.search;if(!e)return{};if(""!=e){var n=e.substr(1).split("&");for(var r in n)n.hasOwnProperty(r)&&(r=n[r].split("="),t[decodeURIComponent(r[0])]=r[1]&&decodeURIComponent(r[1])||"")}return t},b=function(t){return u()(t).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])}).join("&")};function j(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0};if("object"!==f()(t)||a()(t)||null===t||!e)return t;var r=i()({},t);return u()(r).forEach(function(t){t===e&&n(r[t],t)?delete r[t]:r[t]=j(r[t],e,n)}),r}}).call(this,n(57).Buffer)},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){var r=n(57),i=r.Buffer;function o(t,e){for(var n in t)e[n]=t[n]}function u(t,e,n){return i(t,e,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=u),o(i,u),u.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,n)},u.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=i(t);return void 0!==e?"string"==typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},u.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},u.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},function(t,e,n){var r=n(187),i=n(199);function o(t){return(o="function"==typeof i&&"symbol"==typeof r?function(t){return typeof t}:function(t){return t&&"function"==typeof i&&t.constructor===i&&t!==i.prototype?"symbol":typeof t})(t)}function u(e){return"function"==typeof i&&"symbol"===o(r)?t.exports=u=function(t){return o(t)}:t.exports=u=function(t){return t&&"function"==typeof i&&t.constructor===i&&t!==i.prototype?"symbol":o(t)},u(e)}t.exports=u},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(136),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},function(t,e){var n=Array.isArray;t.exports=n},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e,n){t.exports=n(252)},function(t,e,n){var r=n(16),i=n(4),o=n(111),u=n(27),s=n(21),a=function(t,e,n){var c,f,l,h=t&a.F,p=t&a.G,d=t&a.S,y=t&a.P,w=t&a.B,v=t&a.W,g=p?i:i[e]||(i[e]={}),M=g.prototype,_=p?r:d?r[e]:(r[e]||{}).prototype;for(c in p&&(n=e),n)(f=!h&&_&&void 0!==_[c])&&s(g,c)||(l=f?_[c]:n[c],g[c]=p&&"function"!=typeof _[c]?n[c]:w&&f?o(l,r):v&&_[c]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):y&&"function"==typeof l?o(Function.call,l):l,y&&((g.virtual||(g.virtual={}))[c]=l,t&a.R&&M&&!M[c]&&u(M,c,l)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(82)("wks"),i=n(53),o=n(16).Symbol,u="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=r},function(t,e,n){"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e,n){var r=n(28),i=n(112),o=n(76),u=Object.defineProperty;e.f=n(20)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){t.exports=!n(30)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(t){r=u}}();var a,c=[],f=!1,l=-1;function h(){f&&a&&(f=!1,a.length?c=a.concat(c):l=-1,c.length&&p())}function p(){if(!f){var t=s(h);f=!0;for(var e=c.length;e;){for(a=c,c=[];++l<e;)a&&a[l].run();l=-1,e=c.length}a=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new d(t,e)),1!==c.length||f||s(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){"use strict";var r=n(67),i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=l;var o=n(46);o.inherits=n(7);var u=n(152),s=n(97);o.inherits(l,u);for(var a=i(s.prototype),c=0;c<a.length;c++){var f=a[c];l.prototype[f]||(l.prototype[f]=s.prototype[f])}function l(t){if(!(this instanceof l))return new l(t);u.call(this,t),s.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||r.nextTick(p,this)}function p(t){t.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),l.prototype._destroy=function(t,e){this.push(null),this.end(),r.nextTick(e,t)}},function(t,e,n){"use strict";var r=n(159)();t.exports=function(t){return t!==r&&null!==t}},function(t,e,n){"use strict";var r=n(371),i=Math.max;t.exports=function(t){return i(0,r(t))}},function(t,e,n){},function(t,e,n){var r=n(19),i=n(50);t.exports=n(20)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(29);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(118),i=n(78);t.exports=function(t){return r(i(t))}},function(t,e,n){"use strict";var r=n(40),i=n(131),o=(n(88),n(129),Object.prototype.hasOwnProperty),u=n(132),s={key:!0,ref:!0,__self:!0,__source:!0};function a(t){return void 0!==t.ref}function c(t){return void 0!==t.key}var f=function(t,e,n,r,i,o,s){return{$$typeof:u,type:t,key:e,ref:n,props:s,_owner:o}};f.createElement=function(t,e,n){var r,u={},l=null,h=null;if(null!=e)for(r in a(e)&&(h=e.ref),c(e)&&(l=""+e.key),void 0===e.__self?null:e.__self,void 0===e.__source?null:e.__source,e)o.call(e,r)&&!s.hasOwnProperty(r)&&(u[r]=e[r]);var p=arguments.length-2;if(1===p)u.children=n;else if(p>1){for(var d=Array(p),y=0;y<p;y++)d[y]=arguments[y+2];0,u.children=d}if(t&&t.defaultProps){var w=t.defaultProps;for(r in w)void 0===u[r]&&(u[r]=w[r])}return f(t,l,h,0,0,i.current,u)},f.createFactory=function(t){var e=f.createElement.bind(null,t);return e.type=t,e},f.cloneAndReplaceKey=function(t,e){return f(t.type,e,t.ref,t._self,t._source,t._owner,t.props)},f.cloneElement=function(t,e,n){var u,l,h=r({},t.props),p=t.key,d=t.ref,y=(t._self,t._source,t._owner);if(null!=e)for(u in a(e)&&(d=e.ref,y=i.current),c(e)&&(p=""+e.key),t.type&&t.type.defaultProps&&(l=t.type.defaultProps),e)o.call(e,u)&&!s.hasOwnProperty(u)&&(void 0===e[u]&&void 0!==l?h[u]=l[u]:h[u]=e[u]);var w=arguments.length-2;if(1===w)h.children=n;else if(w>1){for(var v=Array(w),g=0;g<w;g++)v[g]=arguments[g+2];h.children=v}return f(t.type,p,d,0,0,y,h)},f.isValidElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===u},t.exports=f},function(t,e,n){var r=n(277),i=n(280);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},function(t,e,n){"use strict";var r=n(24);t.exports=function(t){if(!r(t))throw new TypeError("Cannot use null or undefined");return t}},function(t,e,n){var r=n(8).Buffer;function i(t,e){this._block=r.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=r.from(t,e));for(var n=this._block,i=this._blockSize,o=t.length,u=this._len,s=0;s<o;){for(var a=u%i,c=Math.min(o-s,i-a),f=0;f<c;f++)n[a+f]=t[s+f];s+=c,(u+=c)%i==0&&this._update(n)}return this._len+=o,this},i.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},function(t,e,n){"use strict";function r(t){return null==t}t.exports.isNothing=r,t.exports.isObject=function(t){return"object"==typeof t&&null!==t},t.exports.toArray=function(t){return Array.isArray(t)?t:r(t)?[]:[t]},t.exports.repeat=function(t,e){var n,r="";for(n=0;n<e;n+=1)r+=t;return r},t.exports.isNegativeZero=function(t){return 0===t&&Number.NEGATIVE_INFINITY===1/t},t.exports.extend=function(t,e){var n,r,i,o;if(e)for(n=0,r=(o=Object.keys(e)).length;n<r;n+=1)t[i=o[n]]=e[i];return t}},function(t,e,n){"use strict";var r=n(36),i=n(47),o=n(3);function u(t,e,n){var r=[];return t.include.forEach(function(t){n=u(t,e,n)}),t[e].forEach(function(t){n.forEach(function(e,n){e.tag===t.tag&&e.kind===t.kind&&r.push(n)}),n.push(t)}),n.filter(function(t,e){return-1===r.indexOf(e)})}function s(t){this.include=t.include||[],this.implicit=t.implicit||[],this.explicit=t.explicit||[],this.implicit.forEach(function(t){if(t.loadKind&&"scalar"!==t.loadKind)throw new i("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=u(this,"implicit",[]),this.compiledExplicit=u(this,"explicit",[]),this.compiledTypeMap=function(){var t,e,n={scalar:{},sequence:{},mapping:{},fallback:{}};function r(t){n[t.kind][t.tag]=n.fallback[t.tag]=t}for(t=0,e=arguments.length;t<e;t+=1)arguments[t].forEach(r);return n}(this.compiledImplicit,this.compiledExplicit)}s.DEFAULT=null,s.create=function(){var t,e;switch(arguments.length){case 1:t=s.DEFAULT,e=arguments[0];break;case 2:t=arguments[0],e=arguments[1];break;default:throw new i("Wrong number of arguments for Schema.create function")}if(t=r.toArray(t),e=r.toArray(e),!t.every(function(t){return t instanceof s}))throw new i("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!e.every(function(t){return t instanceof o}))throw new i("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new s({include:t,explicit:e})},t.exports=s},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(117),i=n(83);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){"use strict"; +/* object-assign (c) Sindre Sorhus @license MIT -*/ -var i=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,a,u=r(t),c=1;c<arguments.length;c++){n=Object(arguments[c]);for(var h in n)o.call(n,h)&&(u[h]=n[h]);if(i){a=i(n);for(var l=0;l<a.length;l++)s.call(n,a[l])&&(u[a[l]]=n[a[l]])}}return u}},function(t,e){t.exports={}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(39);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){"use strict";var r=n(14),i=n(22),o=n(29),s=n(8),a=n(1);t.exports=function(t,e,n){var u=a(t),c=n(s,u,""[t]),h=c[0],l=c[1];o(function(){var e={};return e[u]=function(){return 7},7!=""[t](e)})&&(i(String.prototype,t,h),r(RegExp.prototype,u,2==e?function(t,e){return l.call(t,this,e)}:function(t){return l.call(t,this)}))}},function(t,e,n){var r=n(12),i=n(178),o=n(197),s=Object.defineProperty;e.f=n(28)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(180),i=n(8);t.exports=function(t){return r(i(t))}},function(t,e,n){"use strict";function r(t){return function(){return t}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(t){return t},t.exports=i},function(t,e,n){"use strict";var r=n(45),i=r;t.exports=i},function(t,e,n){"use strict";var r=n(24);t.exports=r.DEFAULT=new r({include:[n(34)],explicit:[n(246),n(245),n(244)]})},function(t,e,n){"use strict";function r(t){for(var e=arguments.length-1,n="Minified React error #"+t+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+t,r=0;r<e;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var i=new Error(n);throw i.name="Invariant Violation",i.framesToPop=1,i}t.exports=r},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e){t.exports=!0},function(t,e,n){var r=n(16),i=n(156),o=n(51),s=n(57)("IE_PROTO"),a=function(){},u=function(){var t,e=n(82)("iframe"),r=o.length;for(e.style.display="none",n(150).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;r--;)delete u.prototype[o[r]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(a.prototype=r(t),n=new a,a.prototype=null,n[s]=t):n=u(),void 0===e?n:i(n,e)}},function(t,e,n){var r=n(89),i=n(51);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(11).f,i=n(10),o=n(7)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){var r=n(58)("keys"),i=n(38);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){var r=n(6),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(19);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(6),i=n(5),o=n(52),s=n(62),a=n(11).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:s.f(t)})}},function(t,e,n){e.f=n(7)},function(t,e,n){var r=n(27),i=n(1)("toStringTag"),o="Arguments"==r(function(){return arguments}()),s=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=s(e=Object(t),i))?n:o?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){var r=n(21),i=n(4).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){var r=n(1)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},function(t,e,n){"use strict";function r(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=i(e),this.reject=i(n)}var i=n(39);t.exports.f=function(t){return new r(t)}},function(t,e,n){var r=n(42).f,i=n(30),o=n(1)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){var r=n(103)("keys"),i=n(70);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){var r=n(96),i=n(8);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){"use strict";var r=n(24);t.exports=new r({explicit:[n(254),n(252),n(247)]})},function(t,e,n){"use strict";function r(t,e){return{type:a,payload:(0,s.default)({},t,e)}}function i(t){return{type:u,payload:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.TOGGLE_CONFIGS=e.UPDATE_CONFIGS=void 0;var o=n(77),s=function(t){return t&&t.__esModule?t:{default:t}}(o);e.update=r,e.toggle=i;var a=e.UPDATE_CONFIGS="configs_update",u=e.TOGGLE_CONFIGS="configs_toggle"},function(t,e,n){t.exports={default:n(140),__esModule:!0}},function(t,e,n){t.exports={default:n(141),__esModule:!0}},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";e.__esModule=!0;var r=n(73),i=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,i.default)(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}()},function(t,e,n){"use strict";e.__esModule=!0;var r=n(73),i=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=function(t,e,n){return e in t?(0,i.default)(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n(131),o=r(i),s=n(130),a=r(s),u=n(80),c=r(u);e.default=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":(0,c.default)(e)));t.prototype=(0,a.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(o.default?(0,o.default)(t,e):t.__proto__=e)}},function(t,e,n){"use strict";e.__esModule=!0;var r=n(80),i=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==(void 0===e?"undefined":(0,i.default)(e))&&"function"!=typeof e?t:e}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n(133),o=r(i),s=n(132),a=r(s),u="function"==typeof a.default&&"symbol"==typeof o.default?function(t){return typeof t}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":typeof t};e.default="function"==typeof a.default&&"symbol"===u(o.default)?function(t){return void 0===t?"undefined":u(t)}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":void 0===t?"undefined":u(t)}},function(t,e,n){var r=n(145);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var r=n(19),i=n(6).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){t.exports=!n(9)&&!n(26)(function(){return 7!=Object.defineProperty(n(82)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){"use strict";var r=n(52),i=n(17),o=n(90),s=n(18),a=n(10),u=n(36),c=n(153),h=n(56),l=n(88),p=n(7)("iterator"),f=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,e,n,m,y,v,x){c(n,e,m);var g,D,E,A=function(t){if(!f&&t in _)return _[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",w="values"==y,C=!1,_=t.prototype,b=_[p]||_["@@iterator"]||y&&_[y],F=!f&&b||A(y),k=y?w?A("entries"):F:void 0,I="Array"==e?_.entries||b:b;if(I&&(E=l(I.call(new t)))!==Object.prototype&&E.next&&(h(E,S,!0),r||a(E,p)||s(E,p,d)),w&&b&&"values"!==b.name&&(C=!0,F=function(){return b.call(this)}),r&&!x||!f&&!C&&_[p]||s(_,p,F),u[e]=F,u[S]=d,y)if(g={values:w?F:A("values"),keys:v?F:A("keys"),entries:k},x)for(D in g)D in _||o(_,D,g[D]);else i(i.P+i.F*(f||C),e,g);return g}},function(t,e,n){var r=n(55),i=n(37),o=n(20),s=n(60),a=n(10),u=n(83),c=Object.getOwnPropertyDescriptor;e.f=n(9)?c:function(t,e){if(t=o(t),e=s(e,!0),u)try{return c(t,e)}catch(t){}if(a(t,e))return i(!r.f.call(t,e),t[e])}},function(t,e,n){var r=n(89),i=n(51).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(10),i=n(91),o=n(57)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e,n){var r=n(10),i=n(20),o=n(147)(!1),s=n(57)("IE_PROTO");t.exports=function(t,e){var n,a=i(t),u=0,c=[];for(n in a)n!=s&&r(a,n)&&c.push(n);for(;e.length>u;)r(a,n=e[u++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){t.exports=n(18)},function(t,e,n){var r=n(50);t.exports=function(t){return Object(r(t))}},function(t,e,n){"use strict";var r=n(160)(!0);n(84)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){n(165);for(var r=n(6),i=n(18),o=n(36),s=n(7)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u<a.length;u++){var c=a[u],h=r[c],l=h&&h.prototype;l&&!l[s]&&i(l,s,c),o[c]=o.Array}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(4).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(21),i=n(27),o=n(1)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},function(t,e,n){"use strict";var r=n(98),i=n(2),o=n(22),s=n(14),a=n(30),u=n(31),c=n(183),h=n(67),l=n(189),p=n(1)("iterator"),f=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,e,n,m,y,v,x){c(n,e,m);var g,D,E,A=function(t){if(!f&&t in _)return _[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",w="values"==y,C=!1,_=t.prototype,b=_[p]||_["@@iterator"]||y&&_[y],F=!f&&b||A(y),k=y?w?A("entries"):F:void 0,I="Array"==e?_.entries||b:b;if(I&&(E=l(I.call(new t)))!==Object.prototype&&E.next&&(h(E,S,!0),r||a(E,p)||s(E,p,d)),w&&b&&"values"!==b.name&&(C=!0,F=function(){return b.call(this)}),r&&!x||!f&&!C&&_[p]||s(_,p,F),u[e]=F,u[S]=d,y)if(g={values:w?F:A("values"),keys:v?F:A("keys"),entries:k},x)for(D in g)D in _||o(_,D,g[D]);else i(i.P+i.F*(f||C),e,g);return g}},function(t,e){t.exports=!1},function(t,e,n){var r=n(190),i=n(94);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,n){var r=n(12),i=n(21),o=n(66);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(4),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e,n){var r=n(12),i=n(39),o=n(1)("species");t.exports=function(t,e){var n,s=r(t).constructor;return void 0===s||void 0==(n=r(s)[o])?e:i(n)}},function(t,e,n){var r=n(43),i=n(8);t.exports=function(t){return function(e,n){var o,s,a=String(i(e)),u=r(n),c=a.length;return u<0||u>=c?t?"":void 0:(o=a.charCodeAt(u),o<55296||o>56319||u+1===c||(s=a.charCodeAt(u+1))<56320||s>57343?t?a.charAt(u):o:t?a.slice(u,u+2):s-56320+(o-55296<<10)+65536)}}},function(t,e,n){var r,i,o,s=n(40),a=n(179),u=n(95),c=n(64),h=n(4),l=h.process,p=h.setImmediate,f=h.clearImmediate,d=h.MessageChannel,m=h.Dispatch,y=0,v={},x=function(){var t=+this;if(v.hasOwnProperty(t)){var e=v[t];delete v[t],e()}},g=function(t){x.call(t.data)};p&&f||(p=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return v[++y]=function(){a("function"==typeof t?t:Function(t),e)},r(y),y},f=function(t){delete v[t]},"process"==n(27)(l)?r=function(t){l.nextTick(s(x,t,1))}:m&&m.now?r=function(t){m.now(s(x,t,1))}:d?(i=new d,o=i.port2,i.port1.onmessage=g,r=s(o.postMessage,o,1)):h.addEventListener&&"function"==typeof postMessage&&!h.importScripts?(r=function(t){h.postMessage(t+"","*")},h.addEventListener("message",g,!1)):r="onreadystatechange"in c("script")?function(t){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),x.call(t)}}:function(t){setTimeout(s(x,t,1),0)}),t.exports={set:p,clear:f}},function(t,e,n){var r=n(43),i=Math.max,o=Math.min;t.exports=function(t,e){return t=r(t),t<0?i(t+e,0):o(t,e)}},function(t,e,n){"use strict";var r=n(105)(!0);n(97)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){"use strict";var r={};t.exports=r},function(t,e,n){"use strict";var r=n(24);t.exports=new r({include:[n(111)]})},function(t,e,n){"use strict";var r=n(24);t.exports=new r({include:[n(71)],implicit:[n(249),n(241),n(243),n(242)]})},function(t,e,n){t.exports=n(258)()},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){"use strict";function r(t,e,n){this.props=t,this.context=e,this.refs=c,this.updater=n||u}function i(t,e,n){this.props=t,this.context=e,this.refs=c,this.updater=n||u}function o(){}var s=n(48),a=n(35),u=n(117),c=(n(118),n(109));n(15),n(270);r.prototype.isReactComponent={},r.prototype.setState=function(t,e){"object"!=typeof t&&"function"!=typeof t&&null!=t&&s("85"),this.updater.enqueueSetState(this,t),e&&this.updater.enqueueCallback(this,e,"setState")},r.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this),t&&this.updater.enqueueCallback(this,t,"forceUpdate")};o.prototype=r.prototype,i.prototype=new o,i.prototype.constructor=i,a(i.prototype,r.prototype),i.prototype.isPureReactComponent=!0,t.exports={Component:r,PureComponent:i}},function(t,e,n){"use strict";var r={current:null};t.exports=r},function(t,e,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;t.exports=r},function(t,e,n){"use strict";var r=(n(46),{isMounted:function(t){return!1},enqueueCallback:function(t,e){},enqueueForceUpdate:function(t){},enqueueReplaceState:function(t,e){},enqueueSetState:function(t,e){}});t.exports=r},function(t,e,n){"use strict";var r=!1;t.exports=r},function(t,e,n){"use strict";t.exports=n(263)},function(t,e,n){"use strict";var r=n(125);void 0===function(t){return t&&t.__esModule?t:{default:t}}(r).default.Promise&&n(137),String.prototype.startsWith||n(136)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i=n(128),o=r(i),s=n(126),a=r(s),u=n(122),c=r(u),h=[a.default,c.default,function(){return{components:{StandaloneLayout:o.default}}}];t.exports=h},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function i(t){return t&&t.__esModule?t:{default:t}}function o(){return{statePlugins:{spec:{actions:v,selectors:x},configs:{reducers:m.default,actions:l,selectors:f}}}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var s=n(235),a=i(s),u=n(260),c=i(u),h=n(72),l=r(h),p=n(124),f=r(p),d=n(123),m=i(d),y=function(t,e){try{return a.default.safeLoad(t)}catch(t){return e&&e.errActions.newThrownErr(new Error(t)),{}}},v={downloadConfig:function(t){return function(e){return(0,e.fn.fetch)(t)}},getConfigByUrl:function(t,e){return function(n){function r(n){n instanceof Error||n.status>=400?(i.updateLoadingStatus("failedConfig"),i.updateLoadingStatus("failedConfig"),i.updateUrl(""),console.error(n.statusText+" "+t),e(null)):e(y(n.text))}var i=n.specActions;if(t)return i.downloadConfig(t).then(r,r)}}},x={getLocalConfig:function(){return y(c.default)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(77),o=function(t){return t&&t.__esModule?t:{default:t}}(i),s=n(233),a=n(72);e.default=(r={},(0,o.default)(r,a.UPDATE_CONFIGS,function(t,e){return t.merge((0,s.fromJS)(e.payload))}),(0,o.default)(r,a.TOGGLE_CONFIGS,function(t,e){var n=e.payload,r=t.get(n);return t.set(n,!r)}),r)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.get=function(t,e){return t.getIn(Array.isArray(e)?e:[e])}},function(t,e,n){"use strict";var r=n(129),i=function(t){return t&&t.__esModule?t:{default:t}}(r);t.exports=function(){var t={location:{},history:{},open:function(){},close:function(){},File:function(){}};if("undefined"==typeof window)return t;try{t=window;var e=["File","Blob","FormData"],n=!0,r=!1,o=void 0;try{for(var s,a=(0,i.default)(e);!(n=(s=a.next()).done);n=!0){var u=s.value;u in window&&(t[u]=window[u])}}catch(t){r=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(r)throw o}}}catch(t){console.error(t)}return t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return{components:{Topbar:i.default}}};var r=n(127),i=function(t){return t&&t.__esModule?t:{default:t}}(r)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(74),o=r(i),s=n(75),a=r(s),u=n(76),c=r(u),h=n(79),l=r(h),p=n(78),f=r(p),d=n(119),m=r(d),y=n(112),v=r(y),x=n(273),g=r(x),D=function(t){function e(t,n){(0,a.default)(this,e);var r=(0,l.default)(this,(e.__proto__||(0,o.default)(e)).call(this,t,n));return r.onUrlChange=function(t){var e=t.target.value;r.setState({url:e})},r.loadSpec=function(t){r.props.specActions.updateUrl(t),r.props.specActions.download(t)},r.onUrlSelect=function(t){var e=t.target.value||t.target.href;r.loadSpec(e),r.setSelectedUrl(e),t.preventDefault()},r.downloadUrl=function(t){r.loadSpec(r.state.url),t.preventDefault()},r.setSelectedUrl=function(t){var e=r.props.getConfigs(),n=e.urls||[];n&&n.length&&t&&n.forEach(function(e,n){e.url===t&&r.setState({selectedIndex:n})})},r.onFilterChange=function(t){var e=t.target.value;r.props.layoutActions.updateFilter(e)},r.state={url:t.specSelectors.url(),selectedIndex:0},r}return(0,f.default)(e,t),(0,c.default)(e,[{key:"componentWillReceiveProps",value:function(t){this.setState({url:t.specSelectors.url()})}},{key:"componentWillMount",value:function(){var t=this,e=this.props.getConfigs(),n=e.urls||[];if(n&&n.length){var r=e["urls.primaryName"];r&&n.forEach(function(e,n){e.name===r&&t.setState({selectedIndex:n})})}}},{key:"componentDidMount",value:function(){var t=this.props.getConfigs().urls||[];t&&t.length&&this.loadSpec(t[this.state.selectedIndex].url)}},{key:"render",value:function(){var t=this.props,e=t.getComponent,n=t.specSelectors,r=t.getConfigs,i=e("Button"),o=e("Link"),s="loading"===n.loadingStatus(),a="failed"===n.loadingStatus(),u={};a&&(u.color="red"),s&&(u.color="#aaa");var c=r(),h=c.urls,l=[],p=null;if(h){var f=[];h.forEach(function(t,e){f.push(m.default.createElement("option",{key:e,value:t.url},t.name))}),l.push(m.default.createElement("label",{className:"select-label",htmlFor:"select"},m.default.createElement("span",null,"Select a spec"),m.default.createElement("select",{id:"select",disabled:s,onChange:this.onUrlSelect,value:h[this.state.selectedIndex].url},f)))}else p=this.downloadUrl,l.push(m.default.createElement("input",{className:"download-url-input",type:"text",onChange:this.onUrlChange,value:this.state.url,disabled:s,style:u})),l.push(m.default.createElement(i,{className:"download-url-button",onClick:this.downloadUrl},"Explore"));return m.default.createElement("div",{className:"topbar"},m.default.createElement("div",{className:"wrapper"},m.default.createElement("div",{className:"topbar-wrapper"},m.default.createElement(o,{href:"#"},m.default.createElement("img",{height:"30",width:"30",src:g.default,alt:"Swagger UI"}),m.default.createElement("span",null,"swagger")),m.default.createElement("form",{className:"download-url-wrapper",onSubmit:p},l.map(function(t,e){return(0,d.cloneElement)(t,{key:e})})))))}}]),e}(m.default.Component);D.propTypes={layoutActions:v.default.object.isRequired},e.default=D,D.propTypes={specSelectors:v.default.object.isRequired,specActions:v.default.object.isRequired,getComponent:v.default.func.isRequired,getConfigs:v.default.func.isRequired}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(74),o=r(i),s=n(75),a=r(s),u=n(76),c=r(u),h=n(79),l=r(h),p=n(78),f=r(p),d=n(119),m=r(d),y=n(112),v=r(y),x=function(t){function e(){return(0,a.default)(this,e),(0,l.default)(this,(e.__proto__||(0,o.default)(e)).apply(this,arguments))}return(0,f.default)(e,t),(0,c.default)(e,[{key:"render",value:function(){var t=this.props,e=t.getComponent,n=t.specSelectors,r=t.errSelectors,i=e("Container"),o=e("Row"),s=e("Col"),a=e("Topbar",!0),u=e("BaseLayout",!0),c=e("onlineValidatorBadge",!0),h=n.loadingStatus(),l=r.lastError(),p=l?l.get("message"):"";return m.default.createElement(i,{className:"swagger-ui"},a?m.default.createElement(a,null):null,"loading"===h&&m.default.createElement("div",{className:"info"},m.default.createElement("div",{className:"loading-container"},m.default.createElement("div",{className:"loading"}))),"failed"===h&&m.default.createElement("div",{className:"info"},m.default.createElement("div",{className:"loading-container"},m.default.createElement("h4",{className:"title"},"Failed to load API definition."),m.default.createElement("p",null,p))),"failedConfig"===h&&m.default.createElement("div",{className:"info",style:{maxWidth:"880px",marginLeft:"auto",marginRight:"auto",textAlign:"center"}},m.default.createElement("div",{className:"loading-container"},m.default.createElement("h4",{className:"title"},"Failed to load remote configuration."),m.default.createElement("p",null,p))),!h||"success"===h&&m.default.createElement(u,null),m.default.createElement(o,null,m.default.createElement(s,null,m.default.createElement(c,null))))}}]),e}(m.default.Component);x.propTypes={errSelectors:v.default.object.isRequired,errActions:v.default.object.isRequired,specActions:v.default.object.isRequired,specSelectors:v.default.object.isRequired,layoutSelectors:v.default.object.isRequired,layoutActions:v.default.object.isRequired,getComponent:v.default.func.isRequired},e.default=x},function(t,e,n){t.exports={default:n(138),__esModule:!0}},function(t,e,n){t.exports={default:n(139),__esModule:!0}},function(t,e,n){t.exports={default:n(142),__esModule:!0}},function(t,e,n){t.exports={default:n(143),__esModule:!0}},function(t,e,n){t.exports={default:n(144),__esModule:!0}},function(t,e,n){"use strict";function r(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return 3*t.length/4-r(t)}function o(t){var e,n,i,o,s,a=t.length;o=r(t),s=new l(3*a/4-o),n=o>0?a-4:a;var u=0;for(e=0;e<n;e+=4)i=h[t.charCodeAt(e)]<<18|h[t.charCodeAt(e+1)]<<12|h[t.charCodeAt(e+2)]<<6|h[t.charCodeAt(e+3)],s[u++]=i>>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=h[t.charCodeAt(e)]<<2|h[t.charCodeAt(e+1)]>>4,s[u++]=255&i):1===o&&(i=h[t.charCodeAt(e)]<<10|h[t.charCodeAt(e+1)]<<4|h[t.charCodeAt(e+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}function s(t){return c[t>>18&63]+c[t>>12&63]+c[t>>6&63]+c[63&t]}function a(t,e,n){for(var r,i=[],o=e;o<n;o+=3)r=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(s(r));return i.join("")}function u(t){for(var e,n=t.length,r=n%3,i="",o=[],s=0,u=n-r;s<u;s+=16383)o.push(a(t,s,s+16383>u?u:s+16383));return 1===r?(e=t[n-1],i+=c[e>>2],i+=c[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=c[e>>10],i+=c[e>>4&63],i+=c[e<<2&63],i+="="),o.push(i),o.join("")}e.byteLength=i,e.toByteArray=o,e.fromByteArray=u;for(var c=[],h=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,d=p.length;f<d;++f)c[f]=p[f],h[p.charCodeAt(f)]=f;h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},function(t,e,n){"use strict";(function(t){function r(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(t,e){if(r()<e)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=o.prototype):(null===t&&(t=new o(e)),t.length=e),t}function o(t,e,n){if(!(o.TYPED_ARRAY_SUPPORT||this instanceof o))return new o(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,e,n)}function s(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?p(t,e,n,r):"string"==typeof e?h(t,e,n):f(t,e)}function a(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function u(t,e,n,r){return a(e),e<=0?i(t,e):void 0!==n?"string"==typeof r?i(t,e).fill(n,r):i(t,e).fill(n):i(t,e)}function c(t,e){if(a(e),t=i(t,e<0?0:0|d(e)),!o.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function h(t,e,n){if("string"==typeof n&&""!==n||(n="utf8"),!o.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|y(e,n);t=i(t,r);var s=t.write(e,n);return s!==r&&(t=t.slice(0,s)),t}function l(t,e){var n=e.length<0?0:0|d(e.length);t=i(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function p(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r),o.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=o.prototype):t=l(t,e),t}function f(t,e){if(o.isBuffer(e)){var n=0|d(e.length);return t=i(t,n),0===t.length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||H(e.length)?i(t,0):l(t,e);if("Buffer"===e.type&&Z(e.data))return l(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function d(t){if(t>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function m(t){return+t!=t&&(t=0),o.alloc(+t)}function y(t,e){if(o.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(t).length;default:if(r)return q(t).length;e=(""+e).toLowerCase(),r=!0}}function v(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return B(this,e,n);case"utf8":case"utf-8":return F(this,e,n);case"ascii":return I(this,e,n);case"latin1":case"binary":return T(this,e,n);case"base64":return b(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function x(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function g(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=o.from(e,r)),o.isBuffer(e))return 0===e.length?-1:D(t,e,n,r,i);if("number"==typeof e)return e&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):D(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function D(t,e,n,r,i){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}var c;if(i){var h=-1;for(c=n;c<a;c++)if(o(t,c)===o(e,-1===h?0:c-h)){if(-1===h&&(h=c),c-h+1===u)return h*s}else-1!==h&&(c-=c-h),h=-1}else for(n+u>a&&(n=a-u),c=n;c>=0;c--){for(var l=!0,p=0;p<u;p++)if(o(t,c+p)!==o(e,p)){l=!1;break}if(l)return c}return-1}function E(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[n+s]=a}return s}function A(t,e,n,r){return G(q(e,t.length-n),t,n,r)}function S(t,e,n,r){return G(K(e),t,n,r)}function w(t,e,n,r){return S(t,e,n,r)}function C(t,e,n,r){return G(W(e),t,n,r)}function _(t,e,n,r){return G(Y(e,t.length-n),t,n,r)}function b(t,e,n){return 0===e&&n===t.length?V.fromByteArray(t):V.fromByteArray(t.slice(e,n))}function F(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o=t[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=n){var u,c,h,l;switch(a){case 1:o<128&&(s=o);break;case 2:u=t[i+1],128==(192&u)&&(l=(31&o)<<6|63&u)>127&&(s=l);break;case 3:u=t[i+1],c=t[i+2],128==(192&u)&&128==(192&c)&&(l=(15&o)<<12|(63&u)<<6|63&c)>2047&&(l<55296||l>57343)&&(s=l);break;case 4:u=t[i+1],c=t[i+2],h=t[i+3],128==(192&u)&&128==(192&c)&&128==(192&h)&&(l=(15&o)<<18|(63&u)<<12|(63&c)<<6|63&h)>65535&&l<1114112&&(s=l)}}null===s?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=a}return k(r)}function k(t){var e=t.length;if(e<=Q)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=Q));return n}function I(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function T(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function B(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=X(t[o]);return i}function M(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function P(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,n,r,i,s){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function O(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function R(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function U(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function j(t,e,n,r,i){return i||U(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(t,e,n,r,23,4),n+4}function L(t,e,n,r,i){return i||U(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(t,e,n,r,52,8),n+8}function z(t){if(t=J(t).replace(tt,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function J(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function X(t){return t<16?"0"+t.toString(16):t.toString(16)}function q(t,e){e=e||1/0;for(var n,r=t.length,i=null,o=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function K(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}function Y(t,e){for(var n,r,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}function W(t){return V.toByteArray(z(t))}function G(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function H(t){return t!==t}/*! +*/var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function u(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,s,a=u(t),c=1;c<arguments.length;c++){for(var f in n=Object(arguments[c]))i.call(n,f)&&(a[f]=n[f]);if(r){s=r(n);for(var l=0;l<s.length;l++)o.call(n,s[l])&&(a[s[l]]=n[s[l]])}}return a}},function(t,e,n){"use strict";var r=function(t){};t.exports=function(t,e,n,i,o,u,s,a){if(r(e),!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[n,i,o,u,s,a],l=0;(c=new Error(e.replace(/%s/g,function(){return f[l++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(t,e,n){var r=n(255);t.exports=function(t){return null==t?"":r(t)}},function(t,e,n){var r=n(58),i=n(257),o=n(258),u="[object Null]",s="[object Undefined]",a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?s:u:a&&a in Object(t)?i(t):o(t)}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){(function(t){function n(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===n(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===n(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===n(t)},e.isError=function(t){return"[object Error]"===n(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(this,n(57).Buffer)},function(t,e,n){"use strict";function r(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(t){var e=this.name+": ";return e+=this.reason||"(unknown reason)",!t&&this.mark&&(e+=" "+this.mark.toString()),e},t.exports=r},function(t,e,n){"use strict";var r=n(37);t.exports=new r({include:[n(168)],implicit:[n(438),n(439)],explicit:[n(440),n(441),n(442),n(443)]})},function(t,e){t.exports=function(){var t={location:{},history:{},open:function(){},close:function(){},File:function(){}};if("undefined"==typeof window)return t;try{t=window;for(var e=0,n=["File","Blob","FormData"];e<n.length;e++){var r=n[e];r in window&&(t[r]=window[r])}}catch(t){console.error(t)}return t}()},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){t.exports=!0},function(t,e){t.exports={}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(78);t.exports=function(t){return Object(r(t))}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){"use strict";t.exports=function(t){for(var e=arguments.length-1,n="Minified React error #"+t+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+t,r=0;r<e;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var i=new Error(n);throw i.name="Invariant Violation",i.framesToPop=1,i}},function(t,e,n){"use strict";(function(t){ +/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> * @license MIT */ -var V=n(134),$=n(232),Z=n(234);e.Buffer=o,e.SlowBuffer=m,e.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=r(),o.poolSize=8192,o._augment=function(t){return t.__proto__=o.prototype,t},o.from=function(t,e,n){return s(null,t,e,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(t,e,n){return u(null,t,e,n)},o.allocUnsafe=function(t){return c(null,t)},o.allocUnsafeSlow=function(t){return c(null,t)},o.isBuffer=function(t){return!(null==t||!t._isBuffer)},o.compare=function(t,e){if(!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,s=Math.min(n,r);i<s;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,e){if(!Z(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return o.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=o.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var s=t[n];if(!o.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,i),i+=s.length}return r},o.byteLength=y,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)x(this,e,e+1);return this},o.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)x(this,e,e+3),x(this,e+1,e+2);return this},o.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)x(this,e,e+7),x(this,e+1,e+6),x(this,e+2,e+5),x(this,e+3,e+4);return this},o.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?F(this,0,t):v.apply(this,arguments)},o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===o.compare(this,t)},o.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},o.prototype.compare=function(t,e,n,r,i){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,i>>>=0,this===t)return 0;for(var s=i-r,a=n-e,u=Math.min(s,a),c=this.slice(r,i),h=t.slice(e,n),l=0;l<u;++l)if(c[l]!==h[l]){s=c[l],a=h[l];break}return s<a?-1:a<s?1:0},o.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},o.prototype.indexOf=function(t,e,n){return g(this,t,e,n,!0)},o.prototype.lastIndexOf=function(t,e,n){return g(this,t,e,n,!1)},o.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return E(this,t,e,n);case"utf8":case"utf-8":return A(this,t,e,n);case"ascii":return S(this,t,e,n);case"latin1":case"binary":return w(this,t,e,n);case"base64":return C(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;o.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);var r;if(o.TYPED_ARRAY_SUPPORT)r=this.subarray(t,e),r.__proto__=o.prototype;else{var i=e-t;r=new o(i,void 0);for(var s=0;s<i;++s)r[s]=this[s+t]}return r},o.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},o.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},o.prototype.readUInt8=function(t,e){return e||P(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return e||P(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return e||P(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,e){return e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*e)),r},o.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},o.prototype.readInt8=function(t,e){return e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){e||P(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(t,e){e||P(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(t,e){return e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return e||P(t,4,this.length),$.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return e||P(t,4,this.length),$.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return e||P(t,8,this.length),$.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return e||P(t,8,this.length),$.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){N(this,t,e,n,Math.pow(2,8*n)-1,0)}var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},o.prototype.writeUIntBE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){N(this,t,e,n,Math.pow(2,8*n)-1,0)}var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},o.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,1,255,0),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},o.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},o.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):R(this,t,e,!0),e+4},o.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},o.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);N(this,t,e,n,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<n&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},o.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);N(this,t,e,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},o.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,1,127,-128),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},o.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},o.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):R(this,t,e,!0),e+4},o.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},o.prototype.writeFloatLE=function(t,e,n){return j(this,t,e,!0,n)},o.prototype.writeFloatBE=function(t,e,n){return j(this,t,e,!1,n)},o.prototype.writeDoubleLE=function(t,e,n){return L(this,t,e,!0,n)},o.prototype.writeDoubleBE=function(t,e,n){return L(this,t,e,!1,n)},o.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,s=r-n;if(this===t&&n<e&&e<r)for(i=s-1;i>=0;--i)t[i+e]=this[i+n];else if(s<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i<s;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+s),e);return s},o.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var s;if("number"==typeof t)for(s=e;s<n;++s)this[s]=t;else{var a=o.isBuffer(t)?t:q(new o(t,r).toString()),u=a.length;for(s=0;s<n-e;++s)this[s+e]=a[s%u]}return this};var tt=/[^+\/0-9A-Za-z-_]/g}).call(e,n(274))},function(t,e,n){n(215),n(219),n(226),n(108),n(210),n(211),n(216),n(220),n(222),n(206),n(207),n(208),n(209),n(212),n(213),n(214),n(217),n(218),n(221),n(223),n(224),n(225),n(202),n(203),n(204),n(205),t.exports=n(13).String},function(t,e,n){n(200),n(108),n(229),n(201),n(227),n(228),t.exports=n(13).Promise},function(t,e,n){n(93),n(92),t.exports=n(164)},function(t,e,n){n(166);var r=n(5).Object;t.exports=function(t,e){return r.create(t,e)}},function(t,e,n){n(167);var r=n(5).Object;t.exports=function(t,e,n){return r.defineProperty(t,e,n)}},function(t,e,n){n(168),t.exports=n(5).Object.getPrototypeOf},function(t,e,n){n(169),t.exports=n(5).Object.setPrototypeOf},function(t,e,n){n(171),n(170),n(172),n(173),t.exports=n(5).Symbol},function(t,e,n){n(92),n(93),t.exports=n(62).f("iterator")},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){t.exports=function(){}},function(t,e,n){var r=n(20),i=n(162),o=n(161);t.exports=function(t){return function(e,n,s){var a,u=r(e),c=i(u.length),h=o(s,c);if(t&&n!=n){for(;c>h;)if((a=u[h++])!=a)return!0}else for(;c>h;h++)if((t||h in u)&&u[h]===n)return t||h||0;return!t&&-1}}},function(t,e,n){var r=n(49),i=n(7)("toStringTag"),o="Arguments"==r(function(){return arguments}()),s=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=s(e=Object(t),i))?n:o?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){var r=n(54),i=n(87),o=n(55);t.exports=function(t){var e=r(t),n=i.f;if(n)for(var s,a=n(t),u=o.f,c=0;a.length>c;)u.call(t,s=a[c++])&&e.push(s);return e}},function(t,e,n){var r=n(6).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(49);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(49);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){"use strict";var r=n(53),i=n(37),o=n(56),s={};n(18)(s,n(7)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(s,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){var r=n(38)("meta"),i=n(19),o=n(10),s=n(11).f,a=0,u=Object.isExtensible||function(){return!0},c=!n(26)(function(){return u(Object.preventExtensions({}))}),h=function(t){s(t,r,{value:{i:"O"+ ++a,w:{}}})},l=function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!u(t))return"F";if(!e)return"E";h(t)}return t[r].i},p=function(t,e){if(!o(t,r)){if(!u(t))return!0;if(!e)return!1;h(t)}return t[r].w},f=function(t){return c&&d.NEED&&u(t)&&!o(t,r)&&h(t),t},d=t.exports={KEY:r,NEED:!1,fastKey:l,getWeak:p,onFreeze:f}},function(t,e,n){var r=n(11),i=n(16),o=n(54);t.exports=n(9)?Object.defineProperties:function(t,e){i(t);for(var n,s=o(e),a=s.length,u=0;a>u;)r.f(t,n=s[u++],e[n]);return t}},function(t,e,n){var r=n(20),i=n(86).f,o={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return i(t)}catch(t){return s.slice()}};t.exports.f=function(t){return s&&"[object Window]"==o.call(t)?a(t):i(r(t))}},function(t,e,n){var r=n(17),i=n(5),o=n(26);t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],s={};s[t]=e(n),r(r.S+r.F*o(function(){n(1)}),"Object",s)}},function(t,e,n){var r=n(19),i=n(16),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{r=n(81)(Function.call,n(85).f(Object.prototype,"__proto__").set,2),r(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:o}},function(t,e,n){var r=n(59),i=n(50);t.exports=function(t){return function(e,n){var o,s,a=String(i(e)),u=r(n),c=a.length;return u<0||u>=c?t?"":void 0:(o=a.charCodeAt(u),o<55296||o>56319||u+1===c||(s=a.charCodeAt(u+1))<56320||s>57343?t?a.charAt(u):o:t?a.slice(u,u+2):s-56320+(o-55296<<10)+65536)}}},function(t,e,n){var r=n(59),i=Math.max,o=Math.min;t.exports=function(t,e){return t=r(t),t<0?i(t+e,0):o(t,e)}},function(t,e,n){var r=n(59),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){var r=n(148),i=n(7)("iterator"),o=n(36);t.exports=n(5).getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e,n){var r=n(16),i=n(163);t.exports=n(5).getIterator=function(t){var e=i(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return r(e.call(t))}},function(t,e,n){"use strict";var r=n(146),i=n(154),o=n(36),s=n(20);t.exports=n(84)(Array,"Array",function(t,e){this._t=s(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):"keys"==e?i(0,n):"values"==e?i(0,t[n]):i(0,[n,t[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e,n){var r=n(17);r(r.S,"Object",{create:n(53)})},function(t,e,n){var r=n(17);r(r.S+r.F*!n(9),"Object",{defineProperty:n(11).f})},function(t,e,n){var r=n(91),i=n(88);n(158)("getPrototypeOf",function(){return function(t){return i(r(t))}})},function(t,e,n){var r=n(17);r(r.S,"Object",{setPrototypeOf:n(159).set})},function(t,e){},function(t,e,n){"use strict";var r=n(6),i=n(10),o=n(9),s=n(17),a=n(90),u=n(155).KEY,c=n(26),h=n(58),l=n(56),p=n(38),f=n(7),d=n(62),m=n(61),y=n(149),v=n(152),x=n(16),g=n(19),D=n(20),E=n(60),A=n(37),S=n(53),w=n(157),C=n(85),_=n(11),b=n(54),F=C.f,k=_.f,I=w.f,T=r.Symbol,B=r.JSON,M=B&&B.stringify,P=f("_hidden"),N=f("toPrimitive"),O={}.propertyIsEnumerable,R=h("symbol-registry"),U=h("symbols"),j=h("op-symbols"),L=Object.prototype,z="function"==typeof T,J=r.QObject,X=!J||!J.prototype||!J.prototype.findChild,q=o&&c(function(){return 7!=S(k({},"a",{get:function(){return k(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=F(L,e);r&&delete L[e],k(t,e,n),r&&t!==L&&k(L,e,r)}:k,K=function(t){var e=U[t]=S(T.prototype);return e._k=t,e},Y=z&&"symbol"==typeof T.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof T},W=function(t,e,n){return t===L&&W(j,e,n),x(t),e=E(e,!0),x(n),i(U,e)?(n.enumerable?(i(t,P)&&t[P][e]&&(t[P][e]=!1),n=S(n,{enumerable:A(0,!1)})):(i(t,P)||k(t,P,A(1,{})),t[P][e]=!0),q(t,e,n)):k(t,e,n)},G=function(t,e){x(t);for(var n,r=y(e=D(e)),i=0,o=r.length;o>i;)W(t,n=r[i++],e[n]);return t},H=function(t,e){return void 0===e?S(t):G(S(t),e)},V=function(t){var e=O.call(this,t=E(t,!0));return!(this===L&&i(U,t)&&!i(j,t))&&(!(e||!i(this,t)||!i(U,t)||i(this,P)&&this[P][t])||e)},$=function(t,e){if(t=D(t),e=E(e,!0),t!==L||!i(U,e)||i(j,e)){var n=F(t,e);return!n||!i(U,e)||i(t,P)&&t[P][e]||(n.enumerable=!0),n}},Z=function(t){for(var e,n=I(D(t)),r=[],o=0;n.length>o;)i(U,e=n[o++])||e==P||e==u||r.push(e);return r},Q=function(t){for(var e,n=t===L,r=I(n?j:D(t)),o=[],s=0;r.length>s;)!i(U,e=r[s++])||n&&!i(L,e)||o.push(U[e]);return o};z||(T=function(){if(this instanceof T)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(n){this===L&&e.call(j,n),i(this,P)&&i(this[P],t)&&(this[P][t]=!1),q(this,t,A(1,n))};return o&&X&&q(L,t,{configurable:!0,set:e}),K(t)},a(T.prototype,"toString",function(){return this._k}),C.f=$,_.f=W,n(86).f=w.f=Z,n(55).f=V,n(87).f=Q,o&&!n(52)&&a(L,"propertyIsEnumerable",V,!0),d.f=function(t){return K(f(t))}),s(s.G+s.W+s.F*!z,{Symbol:T});for(var tt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),et=0;tt.length>et;)f(tt[et++]);for(var nt=b(f.store),rt=0;nt.length>rt;)m(nt[rt++]);s(s.S+s.F*!z,"Symbol",{for:function(t){return i(R,t+="")?R[t]:R[t]=T(t)},keyFor:function(t){if(!Y(t))throw TypeError(t+" is not a symbol!");for(var e in R)if(R[e]===t)return e},useSetter:function(){X=!0},useSimple:function(){X=!1}}),s(s.S+s.F*!z,"Object",{create:H,defineProperty:W,defineProperties:G,getOwnPropertyDescriptor:$,getOwnPropertyNames:Z,getOwnPropertySymbols:Q}),B&&s(s.S+s.F*(!z||c(function(){var t=T();return"[null]"!=M([t])||"{}"!=M({a:t})||"{}"!=M(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(g(e)||void 0!==t)&&!Y(t))return v(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!Y(e))return e}),r[1]=e,M.apply(B,r)}}),T.prototype[N]||n(18)(T.prototype,N,T.prototype.valueOf),l(T,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(t,e,n){n(61)("asyncIterator")},function(t,e,n){n(61)("observable")},function(t,e,n){var r=n(1)("unscopables"),i=Array.prototype;void 0==i[r]&&n(14)(i,r,{}),t.exports=function(t){i[r][t]=!0}},function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var r=n(44),i=n(32),o=n(107);t.exports=function(t){return function(e,n,s){var a,u=r(e),c=i(u.length),h=o(s,c);if(t&&n!=n){for(;c>h;)if((a=u[h++])!=a)return!0}else for(;c>h;h++)if((t||h in u)&&u[h]===n)return t||h||0;return!t&&-1}}},function(t,e,n){var r=n(40),i=n(182),o=n(181),s=n(12),a=n(32),u=n(198),c={},h={},e=t.exports=function(t,e,n,l,p){var f,d,m,y,v=p?function(){return t}:u(t),x=r(n,l,e?2:1),g=0;if("function"!=typeof v)throw TypeError(t+" is not iterable!");if(o(v)){for(f=a(t.length);f>g;g++)if((y=e?x(s(d=t[g])[0],d[1]):x(t[g]))===c||y===h)return y}else for(m=v.call(t);!(d=m.next()).done;)if((y=i(m,x,d.value,e))===c||y===h)return y};e.BREAK=c,e.RETURN=h},function(t,e,n){t.exports=!n(28)&&!n(29)(function(){return 7!=Object.defineProperty(n(64)("div"),"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var r=n(27);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(31),i=n(1)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},function(t,e,n){var r=n(12);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},function(t,e,n){"use strict";var r=n(187),i=n(102),o=n(67),s={};n(14)(s,n(1)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(s,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e,n){var r=n(1)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],s=o[r]();s.next=function(){return{done:n=!0}},o[r]=function(){return s},t(o)}catch(t){}return n}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){var r=n(4),i=n(106).set,o=r.MutationObserver||r.WebKitMutationObserver,s=r.process,a=r.Promise,u="process"==n(27)(s);t.exports=function(){var t,e,n,c=function(){var r,i;for(u&&(r=s.domain)&&r.exit();t;){i=t.fn,t=t.next;try{i()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(u)n=function(){s.nextTick(c)};else if(!o||r.navigator&&r.navigator.standalone)if(a&&a.resolve){var h=a.resolve();n=function(){h.then(c)}}else n=function(){i.call(r,c)};else{var l=!0,p=document.createTextNode("");new o(c).observe(p,{characterData:!0}),n=function(){p.data=l=!l}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},function(t,e,n){var r=n(12),i=n(188),o=n(94),s=n(68)("IE_PROTO"),a=function(){},u=function(){var t,e=n(64)("iframe"),r=o.length;for(e.style.display="none",n(95).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;r--;)delete u.prototype[o[r]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(a.prototype=r(t),n=new a,a.prototype=null,n[s]=t):n=u(),void 0===e?n:i(n,e)}},function(t,e,n){var r=n(42),i=n(12),o=n(99);t.exports=n(28)?Object.defineProperties:function(t,e){i(t);for(var n,s=o(e),a=s.length,u=0;a>u;)r.f(t,n=s[u++],e[n]);return t}},function(t,e,n){var r=n(30),i=n(196),o=n(68)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e,n){var r=n(30),i=n(44),o=n(176)(!1),s=n(68)("IE_PROTO");t.exports=function(t,e){var n,a=i(t),u=0,c=[];for(n in a)n!=s&&r(a,n)&&c.push(n);for(;e.length>u;)r(a,n=e[u++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){var r=n(22);t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},function(t,e,n){"use strict";var r=n(4),i=n(42),o=n(28),s=n(1)("species");t.exports=function(t){var e=r[t];o&&e&&!e[s]&&i.f(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,n){"use strict";var r=n(43),i=n(8);t.exports=function(t){var e=String(i(this)),n="",o=r(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},function(t,e,n){var r=n(2),i=n(8),o=n(29),s=n(195),a="["+s+"]",u="​…",c=RegExp("^"+a+a+"*"),h=RegExp(a+a+"*$"),l=function(t,e,n){var i={},a=o(function(){return!!s[t]()||u[t]()!=u}),c=i[t]=a?e(p):s[t];n&&(i[n]=c),r(r.P+r.F*a,"String",i)},p=l.trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(c,"")),2&e&&(t=t.replace(h,"")),t};t.exports=l},function(t,e){t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(t,e,n){var r=n(8);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(21);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(63),i=n(1)("iterator"),o=n(31);t.exports=n(13).getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e,n){"use strict";var r=n(174),i=n(185),o=n(31),s=n(44);t.exports=n(97)(Array,"Array",function(t,e){this._t=s(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):"keys"==e?i(0,n):"values"==e?i(0,t[n]):i(0,[n,t[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e,n){"use strict";var r=n(63),i={};i[n(1)("toStringTag")]="z",i+""!="[object z]"&&n(22)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(t,e,n){"use strict";var r,i,o,s,a=n(98),u=n(4),c=n(40),h=n(63),l=n(2),p=n(21),f=n(39),d=n(175),m=n(177),y=n(104),v=n(106).set,x=n(186)(),g=n(66),D=n(100),E=n(101),A=u.TypeError,S=u.process,w=u.Promise,C="process"==h(S),_=function(){},b=i=g.f,F=!!function(){try{var t=w.resolve(1),e=(t.constructor={})[n(1)("species")]=function(t){t(_,_)};return(C||"function"==typeof PromiseRejectionEvent)&&t.then(_)instanceof e}catch(t){}}(),k=function(t){var e;return!(!p(t)||"function"!=typeof(e=t.then))&&e},I=function(t,e){if(!t._n){t._n=!0;var n=t._c;x(function(){for(var r=t._v,i=1==t._s,o=0;n.length>o;)!function(e){var n,o,s=i?e.ok:e.fail,a=e.resolve,u=e.reject,c=e.domain;try{s?(i||(2==t._h&&M(t),t._h=1),!0===s?n=r:(c&&c.enter(),n=s(r),c&&c.exit()),n===e.promise?u(A("Promise-chain cycle")):(o=k(n))?o.call(n,a,u):a(n)):u(r)}catch(t){u(t)}}(n[o++]);t._c=[],t._n=!1,e&&!t._h&&T(t)})}},T=function(t){v.call(u,function(){var e,n,r,i=t._v,o=B(t);if(o&&(e=D(function(){C?S.emit("unhandledRejection",i,t):(n=u.onunhandledrejection)?n({promise:t,reason:i}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",i)}),t._h=C||B(t)?2:1),t._a=void 0,o&&e.e)throw e.v})},B=function(t){return 1!==t._h&&0===(t._a||t._c).length},M=function(t){v.call(u,function(){var e;C?S.emit("rejectionHandled",t):(e=u.onrejectionhandled)&&e({promise:t,reason:t._v})})},P=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),I(e,!0))},N=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw A("Promise can't be resolved itself");(e=k(t))?x(function(){var r={_w:n,_d:!1};try{e.call(t,c(N,r,1),c(P,r,1))}catch(t){P.call(r,t)}}):(n._v=t,n._s=1,I(n,!1))}catch(t){P.call({_w:n,_d:!1},t)}}};F||(w=function(t){d(this,w,"Promise","_h"),f(t),r.call(this);try{t(c(N,this,1),c(P,this,1))}catch(t){P.call(this,t)}},r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(191)(w.prototype,{then:function(t,e){var n=b(y(this,w));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=C?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&I(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=c(N,t,1),this.reject=c(P,t,1)},g.f=b=function(t){return t===w||t===s?new o(t):i(t)}),l(l.G+l.W+l.F*!F,{Promise:w}),n(67)(w,"Promise"),n(192)("Promise"),s=n(13).Promise,l(l.S+l.F*!F,"Promise",{reject:function(t){var e=b(this);return(0,e.reject)(t),e.promise}}),l(l.S+l.F*(a||!F),"Promise",{resolve:function(t){return E(a&&this===s?w:this,t)}}),l(l.S+l.F*!(F&&n(184)(function(t){w.all(t).catch(_)})),"Promise",{all:function(t){var e=this,n=b(e),r=n.resolve,i=n.reject,o=D(function(){var n=[],o=0,s=1;m(t,!1,function(t){var a=o++,u=!1;n.push(void 0),s++,e.resolve(t).then(function(t){u||(u=!0,n[a]=t,--s||r(n))},i)}),--s||r(n)});return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=b(e),r=n.reject,i=D(function(){m(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},function(t,e,n){n(41)("match",1,function(t,e,n){return[function(n){"use strict";var r=t(this),i=void 0==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},n]})},function(t,e,n){n(41)("replace",2,function(t,e,n){return[function(r,i){"use strict";var o=t(this),s=void 0==r?void 0:r[e];return void 0!==s?s.call(r,o,i):n.call(String(o),r,i)},n]})},function(t,e,n){n(41)("search",1,function(t,e,n){return[function(n){"use strict";var r=t(this),i=void 0==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},n]})},function(t,e,n){n(41)("split",2,function(t,e,r){"use strict";var i=n(96),o=r,s=[].push,a="length";if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[a]||2!="ab".split(/(?:ab)*/)[a]||4!=".".split(/(.?)(.?)/)[a]||".".split(/()()/)[a]>1||"".split(/.?/)[a]){var u=void 0===/()??/.exec("")[1];r=function(t,e){var n=String(this);if(void 0===t&&0===e)return[];if(!i(t))return o.call(n,t,e);var r,c,h,l,p,f=[],d=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),m=0,y=void 0===e?4294967295:e>>>0,v=new RegExp(t.source,d+"g");for(u||(r=new RegExp("^"+v.source+"$(?!\\s)",d));(c=v.exec(n))&&!((h=c.index+c[0][a])>m&&(f.push(n.slice(m,c.index)),!u&&c[a]>1&&c[0].replace(r,function(){for(p=1;p<arguments[a]-2;p++)void 0===arguments[p]&&(c[p]=void 0)}),c[a]>1&&c.index<n[a]&&s.apply(f,c.slice(1)),l=c[0][a],m=h,f[a]>=y));)v.lastIndex===c.index&&v.lastIndex++;return m===n[a]?!l&&v.test("")||f.push(""):f.push(n.slice(m)),f[a]>y?f.slice(0,y):f}}else"0".split(void 0,0)[a]&&(r=function(t,e){return void 0===t&&0===e?[]:o.call(this,t,e)});return[function(n,i){var o=t(this),s=void 0==n?void 0:n[e];return void 0!==s?s.call(n,o,i):r.call(String(o),n,i)},r]})},function(t,e,n){"use strict";n(3)("anchor",function(t){return function(e){return t(this,"a","name",e)}})},function(t,e,n){"use strict";n(3)("big",function(t){return function(){return t(this,"big","","")}})},function(t,e,n){"use strict";n(3)("blink",function(t){return function(){return t(this,"blink","","")}})},function(t,e,n){"use strict";n(3)("bold",function(t){return function(){return t(this,"b","","")}})},function(t,e,n){"use strict";var r=n(2),i=n(105)(!1);r(r.P,"String",{codePointAt:function(t){return i(this,t)}})},function(t,e,n){"use strict";var r=n(2),i=n(32),o=n(69),s="".endsWith;r(r.P+r.F*n(65)("endsWith"),"String",{endsWith:function(t){var e=o(this,t,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=i(e.length),a=void 0===n?r:Math.min(i(n),r),u=String(t);return s?s.call(e,u,a):e.slice(a-u.length,a)===u}})},function(t,e,n){"use strict";n(3)("fixed",function(t){return function(){return t(this,"tt","","")}})},function(t,e,n){"use strict";n(3)("fontcolor",function(t){return function(e){return t(this,"font","color",e)}})},function(t,e,n){"use strict";n(3)("fontsize",function(t){return function(e){return t(this,"font","size",e)}})},function(t,e,n){var r=n(2),i=n(107),o=String.fromCharCode,s=String.fromCodePoint;r(r.S+r.F*(!!s&&1!=s.length),"String",{fromCodePoint:function(t){for(var e,n=[],r=arguments.length,s=0;r>s;){if(e=+arguments[s++],i(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?o(e):o(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},function(t,e,n){"use strict";var r=n(2),i=n(69);r(r.P+r.F*n(65)("includes"),"String",{includes:function(t){return!!~i(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";n(3)("italics",function(t){return function(){return t(this,"i","","")}})},function(t,e,n){"use strict";n(3)("link",function(t){return function(e){return t(this,"a","href",e)}})},function(t,e,n){var r=n(2),i=n(44),o=n(32);r(r.S,"String",{raw:function(t){for(var e=i(t.raw),n=o(e.length),r=arguments.length,s=[],a=0;n>a;)s.push(String(e[a++])),a<r&&s.push(String(arguments[a]));return s.join("")}})},function(t,e,n){var r=n(2);r(r.P,"String",{repeat:n(193)})},function(t,e,n){"use strict";n(3)("small",function(t){return function(){return t(this,"small","","")}})},function(t,e,n){"use strict";var r=n(2),i=n(32),o=n(69),s="".startsWith;r(r.P+r.F*n(65)("startsWith"),"String",{startsWith:function(t){var e=o(this,t,"startsWith"),n=i(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return s?s.call(e,r,n):e.slice(n,n+r.length)===r}})},function(t,e,n){"use strict";n(3)("strike",function(t){return function(){return t(this,"strike","","")}})},function(t,e,n){"use strict";n(3)("sub",function(t){return function(){return t(this,"sub","","")}})},function(t,e,n){"use strict";n(3)("sup",function(t){return function(){return t(this,"sup","","")}})},function(t,e,n){"use strict";n(194)("trim",function(t){return function(){return t(this,3)}})},function(t,e,n){"use strict";var r=n(2),i=n(13),o=n(4),s=n(104),a=n(101);r(r.P+r.R,"Promise",{finally:function(t){var e=s(this,i.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return a(e,t()).then(function(){return n})}:t,n?function(n){return a(e,t()).then(function(){throw n})}:t)}})},function(t,e,n){"use strict";var r=n(2),i=n(66),o=n(100);r(r.S,"Promise",{try:function(t){var e=i.f(this),n=o(t);return(n.e?e.reject:e.resolve)(n.v),e.promise}})},function(t,e,n){for(var r=n(199),i=n(99),o=n(22),s=n(4),a=n(14),u=n(31),c=n(1),h=c("iterator"),l=c("toStringTag"),p=u.Array,f={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},d=i(f),m=0;m<d.length;m++){var y,v=d[m],x=f[v],g=s[v],D=g&&g.prototype;if(D&&(D[h]||a(D,h,p),D[l]||a(D,l,v),u[v]=p,x))for(y in r)D[y]||o(D,y,r[y],!0)}},function(t,e,n){"use strict";function r(t){return t}function i(t,e,n){function i(t,e){var n=x.hasOwnProperty(e)?x[e]:null;A.hasOwnProperty(e)&&a("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",e),t&&a("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",e)}function c(t,n){if(n){a("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),a(!e(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=t.prototype,o=r.__reactAutoBindPairs;n.hasOwnProperty(u)&&g.mixins(t,n.mixins);for(var s in n)if(n.hasOwnProperty(s)&&s!==u){var c=n[s],h=r.hasOwnProperty(s);if(i(h,s),g.hasOwnProperty(s))g[s](t,c);else{var l=x.hasOwnProperty(s),d="function"==typeof c,m=d&&!l&&!h&&!1!==n.autobind;if(m)o.push(s,c),r[s]=c;else if(h){var y=x[s];a(l&&("DEFINE_MANY_MERGED"===y||"DEFINE_MANY"===y),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",y,s),"DEFINE_MANY_MERGED"===y?r[s]=p(r[s],c):"DEFINE_MANY"===y&&(r[s]=f(r[s],c))}else r[s]=c}}}else;}function h(t,e){if(e)for(var n in e){var r=e[n];if(e.hasOwnProperty(n)){var i=n in g;a(!i,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var o=n in t;a(!o,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),t[n]=r}}}function l(t,e){a(t&&e&&"object"==typeof t&&"object"==typeof e,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in e)e.hasOwnProperty(n)&&(a(void 0===t[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),t[n]=e[n]);return t}function p(t,e){return function(){var n=t.apply(this,arguments),r=e.apply(this,arguments);if(null==n)return r;if(null==r)return n;var i={};return l(i,n),l(i,r),i}}function f(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function d(t,e){var n=e.bind(t);return n}function m(t){for(var e=t.__reactAutoBindPairs,n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];t[r]=d(t,i)}}function y(t){var e=r(function(t,r,i){this.__reactAutoBindPairs.length&&m(this),this.props=t,this.context=r,this.refs=s,this.updater=i||n,this.state=null;var o=this.getInitialState?this.getInitialState():null;a("object"==typeof o&&!Array.isArray(o),"%s.getInitialState(): must return an object or null",e.displayName||"ReactCompositeComponent"),this.state=o});e.prototype=new S,e.prototype.constructor=e,e.prototype.__reactAutoBindPairs=[],v.forEach(c.bind(null,e)),c(e,D),c(e,t),c(e,E),e.getDefaultProps&&(e.defaultProps=e.getDefaultProps()),a(e.prototype.render,"createClass(...): Class specification must implement a `render` method.");for(var i in x)e.prototype[i]||(e.prototype[i]=null);return e}var v=[],x={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},g={displayName:function(t,e){t.displayName=e},mixins:function(t,e){if(e)for(var n=0;n<e.length;n++)c(t,e[n])},childContextTypes:function(t,e){t.childContextTypes=o({},t.childContextTypes,e)},contextTypes:function(t,e){t.contextTypes=o({},t.contextTypes,e)},getDefaultProps:function(t,e){t.getDefaultProps?t.getDefaultProps=p(t.getDefaultProps,e):t.getDefaultProps=e},propTypes:function(t,e){t.propTypes=o({},t.propTypes,e)},statics:function(t,e){h(t,e)},autobind:function(){}},D={componentDidMount:function(){this.__isMounted=!0}},E={componentWillUnmount:function(){this.__isMounted=!1}},A={replaceState:function(t,e){this.updater.enqueueReplaceState(this,t,e)},isMounted:function(){return!!this.__isMounted}},S=function(){};return o(S.prototype,t.prototype,A),y}var o=n(35),s=n(109),a=n(15),u="mixins";t.exports=i},function(t,e,n){!function(e,n){t.exports=n()}(0,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t,e,n){var r=null,i=function(t,e){n&&n(t,e),r&&r.visit(t,e)},o="function"==typeof n?i:null,s=!1;if(e){s="boolean"==typeof e.comment&&e.comment;var h="boolean"==typeof e.attachComment&&e.attachComment;(s||h)&&(r=new a.CommentHandler,r.attach=h,e.comment=!0,o=i)}var l=!1;e&&"string"==typeof e.sourceType&&(l="module"===e.sourceType);var p;p=e&&"boolean"==typeof e.jsx&&e.jsx?new u.JSXParser(t,e,o):new c.Parser(t,e,o);var f=l?p.parseModule():p.parseScript(),d=f;return s&&r&&(d.comments=r.comments),p.config.tokens&&(d.tokens=p.tokens),p.config.tolerant&&(d.errors=p.errorHandler.errors),d}function i(t,e,n){var i=e||{};return i.sourceType="module",r(t,i,n)}function o(t,e,n){var i=e||{};return i.sourceType="script",r(t,i,n)}function s(t,e,n){var r,i=new h.Tokenizer(t,e);r=[];try{for(;;){var o=i.getNextToken();if(!o)break;n&&(o=n(o)),r.push(o)}}catch(t){i.errorHandler.tolerate(t)}return i.errorHandler.tolerant&&(r.errors=i.errors()),r}Object.defineProperty(e,"__esModule",{value:!0});var a=n(1),u=n(3),c=n(8),h=n(15);e.parse=r,e.parseModule=i,e.parseScript=o,e.tokenize=s;var l=n(2);e.Syntax=l.Syntax,e.version="4.0.0"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),i=function(){function t(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return t.prototype.insertInnerComments=function(t,e){if(t.type===r.Syntax.BlockStatement&&0===t.body.length){for(var n=[],i=this.leading.length-1;i>=0;--i){var o=this.leading[i];e.end.offset>=o.start&&(n.unshift(o.comment),this.leading.splice(i,1),this.trailing.splice(i,1))}n.length&&(t.innerComments=n)}},t.prototype.findTrailingComments=function(t){var e=[];if(this.trailing.length>0){for(var n=this.trailing.length-1;n>=0;--n){var r=this.trailing[n];r.start>=t.end.offset&&e.unshift(r.comment)}return this.trailing.length=0,e}var i=this.stack[this.stack.length-1];if(i&&i.node.trailingComments){var o=i.node.trailingComments[0];o&&o.range[0]>=t.end.offset&&(e=i.node.trailingComments,delete i.node.trailingComments)}return e},t.prototype.findLeadingComments=function(t){for(var e,n=[];this.stack.length>0;){var r=this.stack[this.stack.length-1];if(!(r&&r.start>=t.start.offset))break;e=r.node,this.stack.pop()}if(e){for(var i=e.leadingComments?e.leadingComments.length:0,o=i-1;o>=0;--o){var s=e.leadingComments[o];s.range[1]<=t.start.offset&&(n.unshift(s),e.leadingComments.splice(o,1))}return e.leadingComments&&0===e.leadingComments.length&&delete e.leadingComments,n}for(var o=this.leading.length-1;o>=0;--o){var r=this.leading[o];r.start<=t.start.offset&&(n.unshift(r.comment),this.leading.splice(o,1))}return n},t.prototype.visitNode=function(t,e){if(!(t.type===r.Syntax.Program&&t.body.length>0)){this.insertInnerComments(t,e);var n=this.findTrailingComments(e),i=this.findLeadingComments(e);i.length>0&&(t.leadingComments=i),n.length>0&&(t.trailingComments=n),this.stack.push({node:t,start:e.start.offset})}},t.prototype.visitComment=function(t,e){var n="L"===t.type[0]?"Line":"Block",r={type:n,value:t.value};if(t.range&&(r.range=t.range),t.loc&&(r.loc=t.loc),this.comments.push(r),this.attach){var i={comment:{type:n,value:t.value,range:[e.start.offset,e.end.offset]},start:e.start.offset};t.loc&&(i.comment.loc=t.loc),t.type=n,this.leading.push(i),this.trailing.push(i)}},t.prototype.visit=function(t,e){"LineComment"===t.type?this.visitComment(t,e):"BlockComment"===t.type?this.visitComment(t,e):this.attach&&this.visitNode(t,e)},t}();e.CommentHandler=i},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(t,e,n){"use strict";function r(t){var e;switch(t.type){case a.JSXSyntax.JSXIdentifier:e=t.name;break;case a.JSXSyntax.JSXNamespacedName:var n=t;e=r(n.namespace)+":"+r(n.name);break;case a.JSXSyntax.JSXMemberExpression:var i=t;e=r(i.object)+"."+r(i.property)}return e}var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(4),s=n(5),a=n(6),u=n(7),c=n(8),h=n(13),l=n(14);h.TokenName[100]="JSXIdentifier",h.TokenName[101]="JSXText";var p=function(t){function e(e,n,r){return t.call(this,e,n,r)||this}return i(e,t),e.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():t.prototype.parsePrimaryExpression.call(this)},e.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},e.prototype.finishJSX=function(){this.nextToken()},e.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},e.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},e.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},e.prototype.scanXHTMLEntity=function(t){for(var e="&",n=!0,r=!1,i=!1,s=!1;!this.scanner.eof()&&n&&!r;){var a=this.scanner.source[this.scanner.index];if(a===t)break;if(r=";"===a,e+=a,++this.scanner.index,!r)switch(e.length){case 2:i="#"===a;break;case 3:i&&(s="x"===a,n=s||o.Character.isDecimalDigit(a.charCodeAt(0)),i=i&&!s);break;default:n=n&&!(i&&!o.Character.isDecimalDigit(a.charCodeAt(0))),n=n&&!(s&&!o.Character.isHexDigit(a.charCodeAt(0)))}}if(n&&r&&e.length>2){var u=e.substr(1,e.length-2);i&&u.length>1?e=String.fromCharCode(parseInt(u.substr(1),10)):s&&u.length>2?e=String.fromCharCode(parseInt("0"+u.substr(1),16)):i||s||!l.XHTMLEntities[u]||(e=l.XHTMLEntities[u])}return e},e.prototype.lexJSX=function(){var t=this.scanner.source.charCodeAt(this.scanner.index);if(60===t||62===t||47===t||58===t||61===t||123===t||125===t){var e=this.scanner.source[this.scanner.index++];return{type:7,value:e,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index}}if(34===t||39===t){for(var n=this.scanner.index,r=this.scanner.source[this.scanner.index++],i="";!this.scanner.eof();){var s=this.scanner.source[this.scanner.index++];if(s===r)break;i+="&"===s?this.scanXHTMLEntity(r):s}return{type:8,value:i,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}if(46===t){var a=this.scanner.source.charCodeAt(this.scanner.index+1),u=this.scanner.source.charCodeAt(this.scanner.index+2),e=46===a&&46===u?"...":".",n=this.scanner.index;return this.scanner.index+=e.length,{type:7,value:e,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}if(96===t)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(o.Character.isIdentifierStart(t)&&92!==t){var n=this.scanner.index;for(++this.scanner.index;!this.scanner.eof();){var s=this.scanner.source.charCodeAt(this.scanner.index);if(o.Character.isIdentifierPart(s)&&92!==s)++this.scanner.index;else{if(45!==s)break;++this.scanner.index}}return{type:100,value:this.scanner.source.slice(n,this.scanner.index),lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}return this.scanner.lex()},e.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var t=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(t)),t},e.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var t=this.scanner.index,e="";!this.scanner.eof();){var n=this.scanner.source[this.scanner.index];if("{"===n||"<"===n)break;++this.scanner.index,e+=n,o.Character.isLineTerminator(n.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===n&&"\n"===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var r={type:101,value:e,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index};return e.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(r)),r},e.prototype.peekJSXToken=function(){var t=this.scanner.saveState();this.scanner.scanComments();var e=this.lexJSX();return this.scanner.restoreState(t),e},e.prototype.expectJSX=function(t){var e=this.nextJSXToken();7===e.type&&e.value===t||this.throwUnexpectedToken(e)},e.prototype.matchJSX=function(t){var e=this.peekJSXToken();return 7===e.type&&e.value===t},e.prototype.parseJSXIdentifier=function(){var t=this.createJSXNode(),e=this.nextJSXToken();return 100!==e.type&&this.throwUnexpectedToken(e),this.finalize(t,new s.JSXIdentifier(e.value))},e.prototype.parseJSXElementName=function(){var t=this.createJSXNode(),e=this.parseJSXIdentifier();if(this.matchJSX(":")){var n=e;this.expectJSX(":");var r=this.parseJSXIdentifier();e=this.finalize(t,new s.JSXNamespacedName(n,r))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var i=e;this.expectJSX(".");var o=this.parseJSXIdentifier();e=this.finalize(t,new s.JSXMemberExpression(i,o))}return e},e.prototype.parseJSXAttributeName=function(){var t,e=this.createJSXNode(),n=this.parseJSXIdentifier();if(this.matchJSX(":")){var r=n;this.expectJSX(":");var i=this.parseJSXIdentifier();t=this.finalize(e,new s.JSXNamespacedName(r,i))}else t=n;return t},e.prototype.parseJSXStringLiteralAttribute=function(){var t=this.createJSXNode(),e=this.nextJSXToken();8!==e.type&&this.throwUnexpectedToken(e);var n=this.getTokenRaw(e);return this.finalize(t,new u.Literal(e.value,n))},e.prototype.parseJSXExpressionAttribute=function(){var t=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var e=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(t,new s.JSXExpressionContainer(e))},e.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},e.prototype.parseJSXNameValueAttribute=function(){var t=this.createJSXNode(),e=this.parseJSXAttributeName(),n=null;return this.matchJSX("=")&&(this.expectJSX("="),n=this.parseJSXAttributeValue()),this.finalize(t,new s.JSXAttribute(e,n))},e.prototype.parseJSXSpreadAttribute=function(){var t=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var e=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(t,new s.JSXSpreadAttribute(e))},e.prototype.parseJSXAttributes=function(){for(var t=[];!this.matchJSX("/")&&!this.matchJSX(">");){var e=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();t.push(e)}return t},e.prototype.parseJSXOpeningElement=function(){var t=this.createJSXNode();this.expectJSX("<");var e=this.parseJSXElementName(),n=this.parseJSXAttributes(),r=this.matchJSX("/");return r&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(t,new s.JSXOpeningElement(e,r,n))},e.prototype.parseJSXBoundaryElement=function(){var t=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var e=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(t,new s.JSXClosingElement(e))}var n=this.parseJSXElementName(),r=this.parseJSXAttributes(),i=this.matchJSX("/");return i&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(t,new s.JSXOpeningElement(n,i,r))},e.prototype.parseJSXEmptyExpression=function(){var t=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(t,new s.JSXEmptyExpression)},e.prototype.parseJSXExpressionContainer=function(){var t=this.createJSXNode();this.expectJSX("{");var e;return this.matchJSX("}")?(e=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),e=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(t,new s.JSXExpressionContainer(e))},e.prototype.parseJSXChildren=function(){for(var t=[];!this.scanner.eof();){var e=this.createJSXChildNode(),n=this.nextJSXText();if(n.start<n.end){var r=this.getTokenRaw(n),i=this.finalize(e,new s.JSXText(n.value,r));t.push(i)}if("{"!==this.scanner.source[this.scanner.index])break;var o=this.parseJSXExpressionContainer();t.push(o)}return t},e.prototype.parseComplexJSXElement=function(t){for(var e=[];!this.scanner.eof();){t.children=t.children.concat(this.parseJSXChildren());var n=this.createJSXChildNode(),i=this.parseJSXBoundaryElement();if(i.type===a.JSXSyntax.JSXOpeningElement){var o=i;if(o.selfClosing){var u=this.finalize(n,new s.JSXElement(o,[],null));t.children.push(u)}else e.push(t),t={node:n,opening:o,closing:null,children:[]}}if(i.type===a.JSXSyntax.JSXClosingElement){t.closing=i;var c=r(t.opening.name);if(c!==r(t.closing.name)&&this.tolerateError("Expected corresponding JSX closing tag for %0",c),!(e.length>0))break;var u=this.finalize(t.node,new s.JSXElement(t.opening,t.children,t.closing));t=e[e.length-1],t.children.push(u),e.pop()}}return t},e.prototype.parseJSXElement=function(){var t=this.createJSXNode(),e=this.parseJSXOpeningElement(),n=[],r=null;if(!e.selfClosing){var i=this.parseComplexJSXElement({node:t,opening:e,closing:r,children:n});n=i.children,r=i.closing}return this.finalize(t,new s.JSXElement(e,n,r))},e.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var t=this.parseJSXElement();return this.finishJSX(),t},e.prototype.isStartOfExpression=function(){return t.prototype.isStartOfExpression.call(this)||this.match("<")},e}(c.Parser);e.JSXParser=p},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={NonAsciiIdentifierStart:/[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\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\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\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u1877\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\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\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-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};e.Character={fromCodePoint:function(t){return t<65536?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10))+String.fromCharCode(56320+(t-65536&1023))},isWhiteSpace:function(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0},isLineTerminator:function(t){return 10===t||13===t||8232===t||8233===t},isIdentifierStart:function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&n.NonAsciiIdentifierStart.test(e.Character.fromCodePoint(t))},isIdentifierPart:function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&n.NonAsciiIdentifierPart.test(e.Character.fromCodePoint(t))},isDecimalDigit:function(t){return t>=48&&t<=57},isHexDigit:function(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102},isOctalDigit:function(t){return t>=48&&t<=55}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(6),i=function(){function t(t){this.type=r.JSXSyntax.JSXClosingElement,this.name=t}return t}();e.JSXClosingElement=i;var o=function(){function t(t,e,n){this.type=r.JSXSyntax.JSXElement,this.openingElement=t,this.children=e,this.closingElement=n}return t}();e.JSXElement=o;var s=function(){function t(){this.type=r.JSXSyntax.JSXEmptyExpression}return t}();e.JSXEmptyExpression=s;var a=function(){function t(t){this.type=r.JSXSyntax.JSXExpressionContainer,this.expression=t}return t}();e.JSXExpressionContainer=a;var u=function(){function t(t){this.type=r.JSXSyntax.JSXIdentifier,this.name=t}return t}();e.JSXIdentifier=u;var c=function(){function t(t,e){this.type=r.JSXSyntax.JSXMemberExpression,this.object=t,this.property=e}return t}();e.JSXMemberExpression=c;var h=function(){function t(t,e){this.type=r.JSXSyntax.JSXAttribute,this.name=t,this.value=e}return t}();e.JSXAttribute=h;var l=function(){function t(t,e){this.type=r.JSXSyntax.JSXNamespacedName,this.namespace=t,this.name=e}return t}();e.JSXNamespacedName=l;var p=function(){function t(t,e,n){this.type=r.JSXSyntax.JSXOpeningElement,this.name=t,this.selfClosing=e,this.attributes=n}return t}();e.JSXOpeningElement=p;var f=function(){function t(t){this.type=r.JSXSyntax.JSXSpreadAttribute,this.argument=t}return t}();e.JSXSpreadAttribute=f;var d=function(){function t(t,e){this.type=r.JSXSyntax.JSXText,this.value=t,this.raw=e}return t}();e.JSXText=d},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),i=function(){function t(t){this.type=r.Syntax.ArrayExpression,this.elements=t}return t}();e.ArrayExpression=i;var o=function(){function t(t){this.type=r.Syntax.ArrayPattern,this.elements=t}return t}();e.ArrayPattern=o;var s=function(){function t(t,e,n){this.type=r.Syntax.ArrowFunctionExpression,this.id=null,this.params=t,this.body=e,this.generator=!1,this.expression=n,this.async=!1}return t}();e.ArrowFunctionExpression=s;var a=function(){function t(t,e,n){this.type=r.Syntax.AssignmentExpression,this.operator=t,this.left=e,this.right=n}return t}();e.AssignmentExpression=a;var u=function(){function t(t,e){this.type=r.Syntax.AssignmentPattern,this.left=t,this.right=e}return t}();e.AssignmentPattern=u;var c=function(){function t(t,e,n){this.type=r.Syntax.ArrowFunctionExpression,this.id=null,this.params=t,this.body=e,this.generator=!1,this.expression=n,this.async=!0}return t}();e.AsyncArrowFunctionExpression=c;var h=function(){function t(t,e,n){this.type=r.Syntax.FunctionDeclaration,this.id=t,this.params=e,this.body=n,this.generator=!1,this.expression=!1,this.async=!0}return t}();e.AsyncFunctionDeclaration=h;var l=function(){function t(t,e,n){this.type=r.Syntax.FunctionExpression,this.id=t,this.params=e,this.body=n,this.generator=!1,this.expression=!1,this.async=!0}return t}();e.AsyncFunctionExpression=l;var p=function(){function t(t){this.type=r.Syntax.AwaitExpression,this.argument=t}return t}();e.AwaitExpression=p;var f=function(){function t(t,e,n){var i="||"===t||"&&"===t;this.type=i?r.Syntax.LogicalExpression:r.Syntax.BinaryExpression,this.operator=t,this.left=e,this.right=n}return t}();e.BinaryExpression=f;var d=function(){function t(t){this.type=r.Syntax.BlockStatement,this.body=t}return t}();e.BlockStatement=d;var m=function(){function t(t){this.type=r.Syntax.BreakStatement,this.label=t}return t}();e.BreakStatement=m;var y=function(){function t(t,e){this.type=r.Syntax.CallExpression,this.callee=t,this.arguments=e}return t}();e.CallExpression=y;var v=function(){function t(t,e){this.type=r.Syntax.CatchClause,this.param=t,this.body=e}return t}();e.CatchClause=v;var x=function(){function t(t){this.type=r.Syntax.ClassBody,this.body=t}return t}();e.ClassBody=x;var g=function(){function t(t,e,n){this.type=r.Syntax.ClassDeclaration,this.id=t,this.superClass=e,this.body=n}return t}();e.ClassDeclaration=g;var D=function(){function t(t,e,n){this.type=r.Syntax.ClassExpression,this.id=t,this.superClass=e,this.body=n}return t}();e.ClassExpression=D;var E=function(){function t(t,e){this.type=r.Syntax.MemberExpression,this.computed=!0,this.object=t,this.property=e}return t}();e.ComputedMemberExpression=E;var A=function(){function t(t,e,n){this.type=r.Syntax.ConditionalExpression,this.test=t,this.consequent=e,this.alternate=n}return t}();e.ConditionalExpression=A;var S=function(){function t(t){this.type=r.Syntax.ContinueStatement,this.label=t}return t}();e.ContinueStatement=S;var w=function(){function t(){this.type=r.Syntax.DebuggerStatement}return t}();e.DebuggerStatement=w;var C=function(){function t(t,e){this.type=r.Syntax.ExpressionStatement,this.expression=t,this.directive=e}return t}();e.Directive=C;var _=function(){function t(t,e){this.type=r.Syntax.DoWhileStatement,this.body=t,this.test=e}return t}();e.DoWhileStatement=_;var b=function(){function t(){this.type=r.Syntax.EmptyStatement}return t}();e.EmptyStatement=b;var F=function(){function t(t){this.type=r.Syntax.ExportAllDeclaration,this.source=t}return t}();e.ExportAllDeclaration=F;var k=function(){function t(t){this.type=r.Syntax.ExportDefaultDeclaration,this.declaration=t}return t}();e.ExportDefaultDeclaration=k;var I=function(){function t(t,e,n){this.type=r.Syntax.ExportNamedDeclaration,this.declaration=t,this.specifiers=e,this.source=n}return t}();e.ExportNamedDeclaration=I;var T=function(){function t(t,e){this.type=r.Syntax.ExportSpecifier,this.exported=e,this.local=t}return t}();e.ExportSpecifier=T;var B=function(){function t(t){this.type=r.Syntax.ExpressionStatement,this.expression=t}return t}();e.ExpressionStatement=B;var M=function(){function t(t,e,n){this.type=r.Syntax.ForInStatement,this.left=t,this.right=e,this.body=n,this.each=!1}return t}();e.ForInStatement=M;var P=function(){function t(t,e,n){this.type=r.Syntax.ForOfStatement,this.left=t,this.right=e,this.body=n}return t}();e.ForOfStatement=P;var N=function(){function t(t,e,n,i){this.type=r.Syntax.ForStatement,this.init=t,this.test=e,this.update=n,this.body=i}return t}();e.ForStatement=N;var O=function(){function t(t,e,n,i){this.type=r.Syntax.FunctionDeclaration,this.id=t,this.params=e,this.body=n,this.generator=i,this.expression=!1,this.async=!1}return t}();e.FunctionDeclaration=O;var R=function(){function t(t,e,n,i){this.type=r.Syntax.FunctionExpression,this.id=t,this.params=e,this.body=n,this.generator=i,this.expression=!1,this.async=!1}return t}();e.FunctionExpression=R;var U=function(){function t(t){this.type=r.Syntax.Identifier,this.name=t}return t}();e.Identifier=U;var j=function(){function t(t,e,n){this.type=r.Syntax.IfStatement,this.test=t,this.consequent=e,this.alternate=n}return t}();e.IfStatement=j;var L=function(){function t(t,e){this.type=r.Syntax.ImportDeclaration,this.specifiers=t,this.source=e}return t}();e.ImportDeclaration=L;var z=function(){function t(t){this.type=r.Syntax.ImportDefaultSpecifier,this.local=t}return t}();e.ImportDefaultSpecifier=z;var J=function(){function t(t){this.type=r.Syntax.ImportNamespaceSpecifier,this.local=t}return t}();e.ImportNamespaceSpecifier=J;var X=function(){function t(t,e){this.type=r.Syntax.ImportSpecifier,this.local=t,this.imported=e}return t}();e.ImportSpecifier=X;var q=function(){function t(t,e){this.type=r.Syntax.LabeledStatement,this.label=t,this.body=e}return t}();e.LabeledStatement=q;var K=function(){function t(t,e){this.type=r.Syntax.Literal,this.value=t,this.raw=e}return t}();e.Literal=K;var Y=function(){function t(t,e){this.type=r.Syntax.MetaProperty,this.meta=t,this.property=e}return t}();e.MetaProperty=Y;var W=function(){function t(t,e,n,i,o){this.type=r.Syntax.MethodDefinition,this.key=t,this.computed=e,this.value=n,this.kind=i,this.static=o}return t}();e.MethodDefinition=W;var G=function(){function t(t){this.type=r.Syntax.Program,this.body=t,this.sourceType="module"}return t}();e.Module=G;var H=function(){function t(t,e){this.type=r.Syntax.NewExpression,this.callee=t,this.arguments=e}return t}();e.NewExpression=H;var V=function(){function t(t){this.type=r.Syntax.ObjectExpression,this.properties=t}return t}();e.ObjectExpression=V;var $=function(){function t(t){this.type=r.Syntax.ObjectPattern,this.properties=t}return t}();e.ObjectPattern=$;var Z=function(){function t(t,e,n,i,o,s){this.type=r.Syntax.Property,this.key=e,this.computed=n,this.value=i,this.kind=t,this.method=o,this.shorthand=s}return t}();e.Property=Z;var Q=function(){function t(t,e,n,i){this.type=r.Syntax.Literal,this.value=t,this.raw=e,this.regex={pattern:n,flags:i}}return t}();e.RegexLiteral=Q;var tt=function(){function t(t){this.type=r.Syntax.RestElement,this.argument=t}return t}();e.RestElement=tt;var et=function(){function t(t){this.type=r.Syntax.ReturnStatement,this.argument=t}return t}();e.ReturnStatement=et;var nt=function(){function t(t){this.type=r.Syntax.Program,this.body=t,this.sourceType="script"}return t}();e.Script=nt;var rt=function(){function t(t){this.type=r.Syntax.SequenceExpression,this.expressions=t}return t}();e.SequenceExpression=rt;var it=function(){function t(t){this.type=r.Syntax.SpreadElement,this.argument=t}return t}();e.SpreadElement=it;var ot=function(){function t(t,e){this.type=r.Syntax.MemberExpression,this.computed=!1,this.object=t,this.property=e}return t}();e.StaticMemberExpression=ot;var st=function(){function t(){this.type=r.Syntax.Super}return t}();e.Super=st;var at=function(){function t(t,e){this.type=r.Syntax.SwitchCase,this.test=t,this.consequent=e}return t}();e.SwitchCase=at;var ut=function(){function t(t,e){this.type=r.Syntax.SwitchStatement,this.discriminant=t,this.cases=e}return t}();e.SwitchStatement=ut;var ct=function(){function t(t,e){this.type=r.Syntax.TaggedTemplateExpression,this.tag=t,this.quasi=e}return t}();e.TaggedTemplateExpression=ct;var ht=function(){function t(t,e){this.type=r.Syntax.TemplateElement,this.value=t,this.tail=e}return t}();e.TemplateElement=ht;var lt=function(){function t(t,e){this.type=r.Syntax.TemplateLiteral,this.quasis=t,this.expressions=e}return t}();e.TemplateLiteral=lt;var pt=function(){function t(){this.type=r.Syntax.ThisExpression}return t}();e.ThisExpression=pt;var ft=function(){function t(t){this.type=r.Syntax.ThrowStatement,this.argument=t}return t}();e.ThrowStatement=ft;var dt=function(){function t(t,e,n){this.type=r.Syntax.TryStatement,this.block=t,this.handler=e,this.finalizer=n}return t}();e.TryStatement=dt;var mt=function(){function t(t,e){this.type=r.Syntax.UnaryExpression,this.operator=t,this.argument=e,this.prefix=!0}return t}();e.UnaryExpression=mt;var yt=function(){function t(t,e,n){this.type=r.Syntax.UpdateExpression,this.operator=t,this.argument=e,this.prefix=n}return t}();e.UpdateExpression=yt;var vt=function(){function t(t,e){this.type=r.Syntax.VariableDeclaration,this.declarations=t,this.kind=e}return t}();e.VariableDeclaration=vt;var xt=function(){function t(t,e){this.type=r.Syntax.VariableDeclarator,this.id=t,this.init=e}return t}();e.VariableDeclarator=xt;var gt=function(){function t(t,e){this.type=r.Syntax.WhileStatement,this.test=t,this.body=e}return t}();e.WhileStatement=gt;var Dt=function(){function t(t,e){this.type=r.Syntax.WithStatement,this.object=t,this.body=e}return t}();e.WithStatement=Dt;var Et=function(){function t(t,e){this.type=r.Syntax.YieldExpression,this.argument=t,this.delegate=e}return t}();e.YieldExpression=Et},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(9),i=n(10),o=n(11),s=n(7),a=n(12),u=n(2),c=n(13),h=function(){function t(t,e,n){void 0===e&&(e={}),this.config={range:"boolean"==typeof e.range&&e.range,loc:"boolean"==typeof e.loc&&e.loc,source:null,tokens:"boolean"==typeof e.tokens&&e.tokens,comment:"boolean"==typeof e.comment&&e.comment,tolerant:"boolean"==typeof e.tolerant&&e.tolerant},this.config.loc&&e.source&&null!==e.source&&(this.config.source=String(e.source)),this.delegate=n,this.errorHandler=new i.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new a.Scanner(t,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return t.prototype.throwError=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=Array.prototype.slice.call(arguments,1),o=t.replace(/%(\d)/g,function(t,e){return r.assert(e<i.length,"Message reference must be in range"),i[e]}),s=this.lastMarker.index,a=this.lastMarker.line,u=this.lastMarker.column+1;throw this.errorHandler.createError(s,a,u,o)},t.prototype.tolerateError=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=Array.prototype.slice.call(arguments,1),o=t.replace(/%(\d)/g,function(t,e){return r.assert(e<i.length,"Message reference must be in range"),i[e]}),s=this.lastMarker.index,a=this.scanner.lineNumber,u=this.lastMarker.column+1;this.errorHandler.tolerateError(s,a,u,o)},t.prototype.unexpectedTokenError=function(t,e){var n,r=e||o.Messages.UnexpectedToken;if(t?(e||(r=2===t.type?o.Messages.UnexpectedEOS:3===t.type?o.Messages.UnexpectedIdentifier:6===t.type?o.Messages.UnexpectedNumber:8===t.type?o.Messages.UnexpectedString:10===t.type?o.Messages.UnexpectedTemplate:o.Messages.UnexpectedToken,4===t.type&&(this.scanner.isFutureReservedWord(t.value)?r=o.Messages.UnexpectedReserved:this.context.strict&&this.scanner.isStrictModeReservedWord(t.value)&&(r=o.Messages.StrictReservedWord))),n=t.value):n="ILLEGAL",r=r.replace("%0",n),t&&"number"==typeof t.lineNumber){var i=t.start,s=t.lineNumber,a=this.lastMarker.index-this.lastMarker.column,u=t.start-a+1;return this.errorHandler.createError(i,s,u,r)}var i=this.lastMarker.index,s=this.lastMarker.line,u=this.lastMarker.column+1;return this.errorHandler.createError(i,s,u,r)},t.prototype.throwUnexpectedToken=function(t,e){throw this.unexpectedTokenError(t,e)},t.prototype.tolerateUnexpectedToken=function(t,e){this.errorHandler.tolerate(this.unexpectedTokenError(t,e))},t.prototype.collectComments=function(){if(this.config.comment){var t=this.scanner.scanComments();if(t.length>0&&this.delegate)for(var e=0;e<t.length;++e){var n=t[e],r=void 0;r={type:n.multiLine?"BlockComment":"LineComment",value:this.scanner.source.slice(n.slice[0],n.slice[1])},this.config.range&&(r.range=n.range),this.config.loc&&(r.loc=n.loc);var i={start:{line:n.loc.start.line,column:n.loc.start.column,offset:n.range[0]},end:{line:n.loc.end.line,column:n.loc.end.column,offset:n.range[1]}};this.delegate(r,i)}}else this.scanner.scanComments()},t.prototype.getTokenRaw=function(t){return this.scanner.source.slice(t.start,t.end)},t.prototype.convertToken=function(t){var e={type:c.TokenName[t.type],value:this.getTokenRaw(t)};if(this.config.range&&(e.range=[t.start,t.end]),this.config.loc&&(e.loc={start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}),9===t.type){var n=t.pattern,r=t.flags;e.regex={pattern:n,flags:r}}return e},t.prototype.nextToken=function(){var t=this.lookahead;this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.collectComments(),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart);var e=this.scanner.lex();return this.hasLineTerminator=t.lineNumber!==e.lineNumber,e&&this.context.strict&&3===e.type&&this.scanner.isStrictModeReservedWord(e.value)&&(e.type=4),this.lookahead=e,this.config.tokens&&2!==e.type&&this.tokens.push(this.convertToken(e)),t},t.prototype.nextRegexToken=function(){this.collectComments();var t=this.scanner.scanRegExp();return this.config.tokens&&(this.tokens.pop(),this.tokens.push(this.convertToken(t))),this.lookahead=t,this.nextToken(),t},t.prototype.createNode=function(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}},t.prototype.startNode=function(t){return{index:t.start,line:t.lineNumber,column:t.start-t.lineStart}},t.prototype.finalize=function(t,e){if(this.config.range&&(e.range=[t.index,this.lastMarker.index]),this.config.loc&&(e.loc={start:{line:t.line,column:t.column},end:{line:this.lastMarker.line,column:this.lastMarker.column}},this.config.source&&(e.loc.source=this.config.source)),this.delegate){var n={start:{line:t.line,column:t.column,offset:t.index},end:{line:this.lastMarker.line,column:this.lastMarker.column,offset:this.lastMarker.index}};this.delegate(e,n)}return e},t.prototype.expect=function(t){var e=this.nextToken();7===e.type&&e.value===t||this.throwUnexpectedToken(e)},t.prototype.expectCommaSeparator=function(){if(this.config.tolerant){var t=this.lookahead;7===t.type&&","===t.value?this.nextToken():7===t.type&&";"===t.value?(this.nextToken(),this.tolerateUnexpectedToken(t)):this.tolerateUnexpectedToken(t,o.Messages.UnexpectedToken)}else this.expect(",")},t.prototype.expectKeyword=function(t){var e=this.nextToken();4===e.type&&e.value===t||this.throwUnexpectedToken(e)},t.prototype.match=function(t){return 7===this.lookahead.type&&this.lookahead.value===t},t.prototype.matchKeyword=function(t){return 4===this.lookahead.type&&this.lookahead.value===t},t.prototype.matchContextualKeyword=function(t){return 3===this.lookahead.type&&this.lookahead.value===t},t.prototype.matchAssign=function(){if(7!==this.lookahead.type)return!1;var t=this.lookahead.value;return"="===t||"*="===t||"**="===t||"/="===t||"%="===t||"+="===t||"-="===t||"<<="===t||">>="===t||">>>="===t||"&="===t||"^="===t||"|="===t},t.prototype.isolateCoverGrammar=function(t){var e=this.context.isBindingElement,n=this.context.isAssignmentTarget,r=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=t.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=e,this.context.isAssignmentTarget=n,this.context.firstCoverInitializedNameError=r,i},t.prototype.inheritCoverGrammar=function(t){var e=this.context.isBindingElement,n=this.context.isAssignmentTarget,r=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=t.call(this);return this.context.isBindingElement=this.context.isBindingElement&&e,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&n,this.context.firstCoverInitializedNameError=r||this.context.firstCoverInitializedNameError,i},t.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(2===this.lookahead.type||this.match("}")||this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},t.prototype.parsePrimaryExpression=function(){var t,e,n,r=this.createNode();switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),t=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(r,new s.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,o.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,e=this.nextToken(),n=this.getTokenRaw(e),t=this.finalize(r,new s.Literal(e.value,n));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,e=this.nextToken(),n=this.getTokenRaw(e),t=this.finalize(r,new s.Literal("true"===e.value,n));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,e=this.nextToken(),n=this.getTokenRaw(e),t=this.finalize(r,new s.Literal(null,n));break;case 10:t=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,t=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":t=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":t=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,e=this.nextRegexToken(),n=this.getTokenRaw(e),t=this.finalize(r,new s.RegexLiteral(e.regex,n,e.pattern,e.flags));break;default:t=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?t=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?t=this.finalize(r,new s.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?t=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),t=this.finalize(r,new s.ThisExpression)):t=this.matchKeyword("class")?this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:t=this.throwUnexpectedToken(this.nextToken())}return t},t.prototype.parseSpreadElement=function(){var t=this.createNode();this.expect("...");var e=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(t,new s.SpreadElement(e))},t.prototype.parseArrayInitializer=function(){var t=this.createNode(),e=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),e.push(null);else if(this.match("...")){var n=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),e.push(n)}else e.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(t,new s.ArrayExpression(e))},t.prototype.parsePropertyMethod=function(t){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var e=this.context.strict,n=this.context.allowStrictDirective;this.context.allowStrictDirective=t.simple;var r=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&t.firstRestricted&&this.tolerateUnexpectedToken(t.firstRestricted,t.message),this.context.strict&&t.stricted&&this.tolerateUnexpectedToken(t.stricted,t.message),this.context.strict=e,this.context.allowStrictDirective=n,r},t.prototype.parsePropertyMethodFunction=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!1;var n=this.parseFormalParameters(),r=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new s.FunctionExpression(null,n.params,r,!1))},t.prototype.parsePropertyMethodAsyncFunction=function(){var t=this.createNode(),e=this.context.allowYield,n=this.context.await;this.context.allowYield=!1,this.context.await=!0;var r=this.parseFormalParameters(),i=this.parsePropertyMethod(r);return this.context.allowYield=e,this.context.await=n,this.finalize(t,new s.AsyncFunctionExpression(null,r.params,i))},t.prototype.parseObjectPropertyKey=function(){var t,e=this.createNode(),n=this.nextToken();switch(n.type){case 8:case 6:this.context.strict&&n.octal&&this.tolerateUnexpectedToken(n,o.Messages.StrictOctalLiteral);var r=this.getTokenRaw(n);t=this.finalize(e,new s.Literal(n.value,r));break;case 3:case 1:case 5:case 4:t=this.finalize(e,new s.Identifier(n.value));break;case 7:"["===n.value?(t=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):t=this.throwUnexpectedToken(n);break;default:t=this.throwUnexpectedToken(n)}return t},t.prototype.isPropertyKey=function(t,e){return t.type===u.Syntax.Identifier&&t.name===e||t.type===u.Syntax.Literal&&t.value===e},t.prototype.parseObjectProperty=function(t){var e,n=this.createNode(),r=this.lookahead,i=null,a=null,u=!1,c=!1,h=!1,l=!1;if(3===r.type){var p=r.value;this.nextToken(),u=this.match("["),l=!(this.hasLineTerminator||"async"!==p||this.match(":")||this.match("(")||this.match("*")),i=l?this.parseObjectPropertyKey():this.finalize(n,new s.Identifier(p))}else this.match("*")?this.nextToken():(u=this.match("["),i=this.parseObjectPropertyKey());var f=this.qualifiedPropertyName(this.lookahead);if(3===r.type&&!l&&"get"===r.value&&f)e="get",u=this.match("["),i=this.parseObjectPropertyKey(),this.context.allowYield=!1,a=this.parseGetterMethod();else if(3===r.type&&!l&&"set"===r.value&&f)e="set",u=this.match("["),i=this.parseObjectPropertyKey(),a=this.parseSetterMethod();else if(7===r.type&&"*"===r.value&&f)e="init",u=this.match("["),i=this.parseObjectPropertyKey(),a=this.parseGeneratorMethod(),c=!0;else if(i||this.throwUnexpectedToken(this.lookahead),e="init",this.match(":")&&!l)!u&&this.isPropertyKey(i,"__proto__")&&(t.value&&this.tolerateError(o.Messages.DuplicateProtoProperty),t.value=!0),this.nextToken(),a=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))a=l?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),c=!0;else if(3===r.type){var p=this.finalize(n,new s.Identifier(r.value));if(this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),h=!0;var d=this.isolateCoverGrammar(this.parseAssignmentExpression);a=this.finalize(n,new s.AssignmentPattern(p,d))}else h=!0,a=p}else this.throwUnexpectedToken(this.nextToken());return this.finalize(n,new s.Property(e,i,u,a,c,h))},t.prototype.parseObjectInitializer=function(){var t=this.createNode();this.expect("{");for(var e=[],n={value:!1};!this.match("}");)e.push(this.parseObjectProperty(n)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(t,new s.ObjectExpression(e))},t.prototype.parseTemplateHead=function(){r.assert(this.lookahead.head,"Template literal must start with a template head");var t=this.createNode(),e=this.nextToken(),n=e.value,i=e.cooked;return this.finalize(t,new s.TemplateElement({raw:n,cooked:i},e.tail))},t.prototype.parseTemplateElement=function(){10!==this.lookahead.type&&this.throwUnexpectedToken();var t=this.createNode(),e=this.nextToken(),n=e.value,r=e.cooked;return this.finalize(t,new s.TemplateElement({raw:n,cooked:r},e.tail))},t.prototype.parseTemplateLiteral=function(){var t=this.createNode(),e=[],n=[],r=this.parseTemplateHead();for(n.push(r);!r.tail;)e.push(this.parseExpression()),r=this.parseTemplateElement(),n.push(r);return this.finalize(t,new s.TemplateLiteral(n,e))},t.prototype.reinterpretExpressionAsPattern=function(t){switch(t.type){case u.Syntax.Identifier:case u.Syntax.MemberExpression:case u.Syntax.RestElement:case u.Syntax.AssignmentPattern:break;case u.Syntax.SpreadElement:t.type=u.Syntax.RestElement,this.reinterpretExpressionAsPattern(t.argument);break;case u.Syntax.ArrayExpression:t.type=u.Syntax.ArrayPattern;for(var e=0;e<t.elements.length;e++)null!==t.elements[e]&&this.reinterpretExpressionAsPattern(t.elements[e]);break;case u.Syntax.ObjectExpression:t.type=u.Syntax.ObjectPattern;for(var e=0;e<t.properties.length;e++)this.reinterpretExpressionAsPattern(t.properties[e].value);break;case u.Syntax.AssignmentExpression:t.type=u.Syntax.AssignmentPattern,delete t.operator,this.reinterpretExpressionAsPattern(t.left)}},t.prototype.parseGroupExpression=function(){var t;if(this.expect("("),this.match(")"))this.nextToken(),this.match("=>")||this.expect("=>"),t={type:"ArrowParameterPlaceHolder",params:[],async:!1};else{var e=this.lookahead,n=[];if(this.match("..."))t=this.parseRestElement(n),this.expect(")"),this.match("=>")||this.expect("=>"),t={type:"ArrowParameterPlaceHolder",params:[t],async:!1};else{var r=!1;if(this.context.isBindingElement=!0,t=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var i=[];for(this.context.isAssignmentTarget=!1,i.push(t);2!==this.lookahead.type&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var o=0;o<i.length;o++)this.reinterpretExpressionAsPattern(i[o]);r=!0,t={type:"ArrowParameterPlaceHolder",params:i,async:!1}}else if(this.match("...")){this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),i.push(this.parseRestElement(n)),this.expect(")"),this.match("=>")||this.expect("=>"),this.context.isBindingElement=!1;for(var o=0;o<i.length;o++)this.reinterpretExpressionAsPattern(i[o]);r=!0,t={type:"ArrowParameterPlaceHolder",params:i,async:!1}}else i.push(this.inheritCoverGrammar(this.parseAssignmentExpression));if(r)break}r||(t=this.finalize(this.startNode(e),new s.SequenceExpression(i)))}if(!r){if(this.expect(")"),this.match("=>")&&(t.type===u.Syntax.Identifier&&"yield"===t.name&&(r=!0,t={type:"ArrowParameterPlaceHolder",params:[t],async:!1}),!r)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),t.type===u.Syntax.SequenceExpression)for(var o=0;o<t.expressions.length;o++)this.reinterpretExpressionAsPattern(t.expressions[o]);else this.reinterpretExpressionAsPattern(t);t={type:"ArrowParameterPlaceHolder",params:t.type===u.Syntax.SequenceExpression?t.expressions:[t],async:!1}}this.context.isBindingElement=!1}}}return t},t.prototype.parseArguments=function(){this.expect("(");var t=[];if(!this.match(")"))for(;;){var e=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAssignmentExpression);if(t.push(e),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),t},t.prototype.isIdentifierName=function(t){return 3===t.type||4===t.type||1===t.type||5===t.type},t.prototype.parseIdentifierName=function(){var t=this.createNode(),e=this.nextToken();return this.isIdentifierName(e)||this.throwUnexpectedToken(e),this.finalize(t,new s.Identifier(e.value))},t.prototype.parseNewExpression=function(){var t=this.createNode(),e=this.parseIdentifierName();r.assert("new"===e.name,"New expression must start with `new`");var n;if(this.match("."))if(this.nextToken(),3===this.lookahead.type&&this.context.inFunctionBody&&"target"===this.lookahead.value){var i=this.parseIdentifierName();n=new s.MetaProperty(e,i)}else this.throwUnexpectedToken(this.lookahead);else{var o=this.isolateCoverGrammar(this.parseLeftHandSideExpression),a=this.match("(")?this.parseArguments():[];n=new s.NewExpression(o,a),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return this.finalize(t,n)},t.prototype.parseAsyncArgument=function(){var t=this.parseAssignmentExpression();return this.context.firstCoverInitializedNameError=null,t},t.prototype.parseAsyncArguments=function(){this.expect("(");var t=[];if(!this.match(")"))for(;;){var e=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAsyncArgument);if(t.push(e),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),t},t.prototype.parseLeftHandSideExpressionAllowCall=function(){var t=this.lookahead,e=this.matchContextualKeyword("async"),n=this.context.allowIn;this.context.allowIn=!0;var r;for(this.matchKeyword("super")&&this.context.inFunctionBody?(r=this.createNode(),this.nextToken(),r=this.finalize(r,new s.Super),this.match("(")||this.match(".")||this.match("[")||this.throwUnexpectedToken(this.lookahead)):r=this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var i=this.parseIdentifierName();r=this.finalize(this.startNode(t),new s.StaticMemberExpression(r,i))}else if(this.match("(")){var o=e&&t.lineNumber===this.lookahead.lineNumber;this.context.isBindingElement=!1,this.context.isAssignmentTarget=!1;var a=o?this.parseAsyncArguments():this.parseArguments();if(r=this.finalize(this.startNode(t),new s.CallExpression(r,a)),o&&this.match("=>")){for(var u=0;u<a.length;++u)this.reinterpretExpressionAsPattern(a[u]);r={type:"ArrowParameterPlaceHolder",params:a,async:!0}}}else if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var i=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),r=this.finalize(this.startNode(t),new s.ComputedMemberExpression(r,i))}else{if(10!==this.lookahead.type||!this.lookahead.head)break;var c=this.parseTemplateLiteral();r=this.finalize(this.startNode(t),new s.TaggedTemplateExpression(r,c))}return this.context.allowIn=n,r},t.prototype.parseSuper=function(){var t=this.createNode();return this.expectKeyword("super"),this.match("[")||this.match(".")||this.throwUnexpectedToken(this.lookahead),this.finalize(t,new s.Super)},t.prototype.parseLeftHandSideExpression=function(){r.assert(this.context.allowIn,"callee of new expression always allow in keyword.");for(var t=this.startNode(this.lookahead),e=this.matchKeyword("super")&&this.context.inFunctionBody?this.parseSuper():this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var n=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),e=this.finalize(t,new s.ComputedMemberExpression(e,n))}else if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var n=this.parseIdentifierName();e=this.finalize(t,new s.StaticMemberExpression(e,n))}else{if(10!==this.lookahead.type||!this.lookahead.head)break;var i=this.parseTemplateLiteral();e=this.finalize(t,new s.TaggedTemplateExpression(e,i))}return e},t.prototype.parseUpdateExpression=function(){var t,e=this.lookahead;if(this.match("++")||this.match("--")){var n=this.startNode(e),r=this.nextToken();t=this.inheritCoverGrammar(this.parseUnaryExpression),this.context.strict&&t.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(t.name)&&this.tolerateError(o.Messages.StrictLHSPrefix),this.context.isAssignmentTarget||this.tolerateError(o.Messages.InvalidLHSInAssignment);var i=!0;t=this.finalize(n,new s.UpdateExpression(r.value,t,i)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(t=this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall),!this.hasLineTerminator&&7===this.lookahead.type&&(this.match("++")||this.match("--"))){this.context.strict&&t.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(t.name)&&this.tolerateError(o.Messages.StrictLHSPostfix),this.context.isAssignmentTarget||this.tolerateError(o.Messages.InvalidLHSInAssignment),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var a=this.nextToken().value,i=!1;t=this.finalize(this.startNode(e),new s.UpdateExpression(a,t,i))}return t},t.prototype.parseAwaitExpression=function(){var t=this.createNode();this.nextToken();var e=this.parseUnaryExpression();return this.finalize(t,new s.AwaitExpression(e))},t.prototype.parseUnaryExpression=function(){var t;if(this.match("+")||this.match("-")||this.match("~")||this.match("!")||this.matchKeyword("delete")||this.matchKeyword("void")||this.matchKeyword("typeof")){var e=this.startNode(this.lookahead),n=this.nextToken();t=this.inheritCoverGrammar(this.parseUnaryExpression),t=this.finalize(e,new s.UnaryExpression(n.value,t)),this.context.strict&&"delete"===t.operator&&t.argument.type===u.Syntax.Identifier&&this.tolerateError(o.Messages.StrictDelete),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else t=this.context.await&&this.matchContextualKeyword("await")?this.parseAwaitExpression():this.parseUpdateExpression();return t},t.prototype.parseExponentiationExpression=function(){var t=this.lookahead,e=this.inheritCoverGrammar(this.parseUnaryExpression);if(e.type!==u.Syntax.UnaryExpression&&this.match("**")){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var n=e,r=this.isolateCoverGrammar(this.parseExponentiationExpression);e=this.finalize(this.startNode(t),new s.BinaryExpression("**",n,r))}return e},t.prototype.binaryPrecedence=function(t){var e=t.value;return 7===t.type?this.operatorPrecedence[e]||0:4===t.type&&("instanceof"===e||this.context.allowIn&&"in"===e)?7:0},t.prototype.parseBinaryExpression=function(){var t=this.lookahead,e=this.inheritCoverGrammar(this.parseExponentiationExpression),n=this.lookahead,r=this.binaryPrecedence(n);if(r>0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var i=[t,this.lookahead],o=e,a=this.isolateCoverGrammar(this.parseExponentiationExpression),u=[o,n.value,a],c=[r];;){if((r=this.binaryPrecedence(this.lookahead))<=0)break;for(;u.length>2&&r<=c[c.length-1];){a=u.pop();var h=u.pop();c.pop(),o=u.pop(),i.pop();var l=this.startNode(i[i.length-1]);u.push(this.finalize(l,new s.BinaryExpression(h,o,a)))}u.push(this.nextToken().value),c.push(r),i.push(this.lookahead),u.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var p=u.length-1;for(e=u[p],i.pop();p>1;){var l=this.startNode(i.pop()),h=u[p-1];e=this.finalize(l,new s.BinaryExpression(h,u[p-2],e)),p-=2}}return e},t.prototype.parseConditionalExpression=function(){var t=this.lookahead,e=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var n=this.context.allowIn;this.context.allowIn=!0;var r=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=n,this.expect(":");var i=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new s.ConditionalExpression(e,r,i)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return e},t.prototype.checkPatternParam=function(t,e){switch(e.type){case u.Syntax.Identifier:this.validateParam(t,e,e.name);break;case u.Syntax.RestElement:this.checkPatternParam(t,e.argument);break;case u.Syntax.AssignmentPattern:this.checkPatternParam(t,e.left);break;case u.Syntax.ArrayPattern:for(var n=0;n<e.elements.length;n++)null!==e.elements[n]&&this.checkPatternParam(t,e.elements[n]);break;case u.Syntax.ObjectPattern:for(var n=0;n<e.properties.length;n++)this.checkPatternParam(t,e.properties[n].value)}t.simple=t.simple&&e instanceof s.Identifier},t.prototype.reinterpretAsCoverFormalsList=function(t){var e,n=[t],r=!1;switch(t.type){case u.Syntax.Identifier:break;case"ArrowParameterPlaceHolder":n=t.params,r=t.async;break;default:return null}e={simple:!0,paramSet:{}};for(var i=0;i<n.length;++i){var s=n[i];s.type===u.Syntax.AssignmentPattern?s.right.type===u.Syntax.YieldExpression&&(s.right.argument&&this.throwUnexpectedToken(this.lookahead),s.right.type=u.Syntax.Identifier,s.right.name="yield",delete s.right.argument,delete s.right.delegate):r&&s.type===u.Syntax.Identifier&&"await"===s.name&&this.throwUnexpectedToken(this.lookahead),this.checkPatternParam(e,s),n[i]=s}if(this.context.strict||!this.context.allowYield)for(var i=0;i<n.length;++i){var s=n[i];s.type===u.Syntax.YieldExpression&&this.throwUnexpectedToken(this.lookahead)}if(e.message===o.Messages.StrictParamDupe){var a=this.context.strict?e.stricted:e.firstRestricted;this.throwUnexpectedToken(a,e.message)}return{simple:e.simple,params:n,stricted:e.stricted,firstRestricted:e.firstRestricted,message:e.message}},t.prototype.parseAssignmentExpression=function(){var t;if(!this.context.allowYield&&this.matchKeyword("yield"))t=this.parseYieldExpression();else{var e=this.lookahead,n=e;if(t=this.parseConditionalExpression(),3===n.type&&n.lineNumber===this.lookahead.lineNumber&&"async"===n.value&&(3===this.lookahead.type||this.matchKeyword("yield"))){var r=this.parsePrimaryExpression();this.reinterpretExpressionAsPattern(r),t={type:"ArrowParameterPlaceHolder",params:[r],async:!0}}if("ArrowParameterPlaceHolder"===t.type||this.match("=>")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var i=t.async,a=this.reinterpretAsCoverFormalsList(t);if(a){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var c=this.context.strict,h=this.context.allowStrictDirective;this.context.allowStrictDirective=a.simple;var l=this.context.allowYield,p=this.context.await;this.context.allowYield=!0,this.context.await=i;var f=this.startNode(e);this.expect("=>");var d=void 0;if(this.match("{")){var m=this.context.allowIn;this.context.allowIn=!0,d=this.parseFunctionSourceElements(),this.context.allowIn=m}else d=this.isolateCoverGrammar(this.parseAssignmentExpression);var y=d.type!==u.Syntax.BlockStatement;this.context.strict&&a.firstRestricted&&this.throwUnexpectedToken(a.firstRestricted,a.message),this.context.strict&&a.stricted&&this.tolerateUnexpectedToken(a.stricted,a.message),t=i?this.finalize(f,new s.AsyncArrowFunctionExpression(a.params,d,y)):this.finalize(f,new s.ArrowFunctionExpression(a.params,d,y)),this.context.strict=c,this.context.allowStrictDirective=h,this.context.allowYield=l,this.context.await=p}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(o.Messages.InvalidLHSInAssignment),this.context.strict&&t.type===u.Syntax.Identifier){var v=t;this.scanner.isRestrictedWord(v.name)&&this.tolerateUnexpectedToken(n,o.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(v.name)&&this.tolerateUnexpectedToken(n,o.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(t):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1),n=this.nextToken();var x=n.value,g=this.isolateCoverGrammar(this.parseAssignmentExpression);t=this.finalize(this.startNode(e),new s.AssignmentExpression(x,t,g)),this.context.firstCoverInitializedNameError=null}}return t},t.prototype.parseExpression=function(){var t=this.lookahead,e=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var n=[];for(n.push(e);2!==this.lookahead.type&&this.match(",");)this.nextToken(),n.push(this.isolateCoverGrammar(this.parseAssignmentExpression));e=this.finalize(this.startNode(t),new s.SequenceExpression(n))}return e},t.prototype.parseStatementListItem=function(){var t;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,4===this.lookahead.type)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,o.Messages.IllegalExportDeclaration),t=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,o.Messages.IllegalImportDeclaration),t=this.parseImportDeclaration();break;case"const":t=this.parseLexicalDeclaration({inFor:!1});break;case"function":t=this.parseFunctionDeclaration();break;case"class":t=this.parseClassDeclaration();break;case"let":t=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:t=this.parseStatement()}else t=this.parseStatement();return t},t.prototype.parseBlock=function(){var t=this.createNode();this.expect("{");for(var e=[];;){if(this.match("}"))break;e.push(this.parseStatementListItem())}return this.expect("}"),this.finalize(t,new s.BlockStatement(e))},t.prototype.parseLexicalBinding=function(t,e){var n=this.createNode(),r=[],i=this.parsePattern(r,t);this.context.strict&&i.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(i.name)&&this.tolerateError(o.Messages.StrictVarName);var a=null;return"const"===t?this.matchKeyword("in")||this.matchContextualKeyword("of")||(this.match("=")?(this.nextToken(),a=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(o.Messages.DeclarationMissingInitializer,"const")):(!e.inFor&&i.type!==u.Syntax.Identifier||this.match("="))&&(this.expect("="),a=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(n,new s.VariableDeclarator(i,a))},t.prototype.parseBindingList=function(t,e){for(var n=[this.parseLexicalBinding(t,e)];this.match(",");)this.nextToken(),n.push(this.parseLexicalBinding(t,e));return n},t.prototype.isLexicalDeclaration=function(){var t=this.scanner.saveState();this.scanner.scanComments();var e=this.scanner.lex();return this.scanner.restoreState(t),3===e.type||7===e.type&&"["===e.value||7===e.type&&"{"===e.value||4===e.type&&"let"===e.value||4===e.type&&"yield"===e.value},t.prototype.parseLexicalDeclaration=function(t){var e=this.createNode(),n=this.nextToken().value;r.assert("let"===n||"const"===n,"Lexical declaration must be either let or const");var i=this.parseBindingList(n,t);return this.consumeSemicolon(),this.finalize(e,new s.VariableDeclaration(i,n))},t.prototype.parseBindingRestElement=function(t,e){var n=this.createNode();this.expect("...");var r=this.parsePattern(t,e);return this.finalize(n,new s.RestElement(r))},t.prototype.parseArrayPattern=function(t,e){var n=this.createNode();this.expect("[");for(var r=[];!this.match("]");)if(this.match(","))this.nextToken(),r.push(null);else{if(this.match("...")){r.push(this.parseBindingRestElement(t,e));break}r.push(this.parsePatternWithDefault(t,e)),this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(n,new s.ArrayPattern(r))},t.prototype.parsePropertyPattern=function(t,e){var n,r,i=this.createNode(),o=!1,a=!1;if(3===this.lookahead.type){var u=this.lookahead;n=this.parseVariableIdentifier();var c=this.finalize(i,new s.Identifier(u.value));if(this.match("=")){t.push(u),a=!0,this.nextToken();var h=this.parseAssignmentExpression();r=this.finalize(this.startNode(u),new s.AssignmentPattern(c,h))}else this.match(":")?(this.expect(":"),r=this.parsePatternWithDefault(t,e)):(t.push(u),a=!0,r=c)}else o=this.match("["),n=this.parseObjectPropertyKey(),this.expect(":"),r=this.parsePatternWithDefault(t,e);return this.finalize(i,new s.Property("init",n,o,r,!1,a))},t.prototype.parseObjectPattern=function(t,e){var n=this.createNode(),r=[];for(this.expect("{");!this.match("}");)r.push(this.parsePropertyPattern(t,e)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(n,new s.ObjectPattern(r))},t.prototype.parsePattern=function(t,e){var n;return this.match("[")?n=this.parseArrayPattern(t,e):this.match("{")?n=this.parseObjectPattern(t,e):(!this.matchKeyword("let")||"const"!==e&&"let"!==e||this.tolerateUnexpectedToken(this.lookahead,o.Messages.LetInLexicalBinding),t.push(this.lookahead),n=this.parseVariableIdentifier(e)),n},t.prototype.parsePatternWithDefault=function(t,e){var n=this.lookahead,r=this.parsePattern(t,e);if(this.match("=")){this.nextToken();var i=this.context.allowYield;this.context.allowYield=!0;var o=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=i,r=this.finalize(this.startNode(n),new s.AssignmentPattern(r,o))}return r},t.prototype.parseVariableIdentifier=function(t){var e=this.createNode(),n=this.nextToken();return 4===n.type&&"yield"===n.value?this.context.strict?this.tolerateUnexpectedToken(n,o.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(n):3!==n.type?this.context.strict&&4===n.type&&this.scanner.isStrictModeReservedWord(n.value)?this.tolerateUnexpectedToken(n,o.Messages.StrictReservedWord):(this.context.strict||"let"!==n.value||"var"!==t)&&this.throwUnexpectedToken(n):(this.context.isModule||this.context.await)&&3===n.type&&"await"===n.value&&this.tolerateUnexpectedToken(n),this.finalize(e,new s.Identifier(n.value))},t.prototype.parseVariableDeclaration=function(t){var e=this.createNode(),n=[],r=this.parsePattern(n,"var");this.context.strict&&r.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(r.name)&&this.tolerateError(o.Messages.StrictVarName);var i=null;return this.match("=")?(this.nextToken(),i=this.isolateCoverGrammar(this.parseAssignmentExpression)):r.type===u.Syntax.Identifier||t.inFor||this.expect("="),this.finalize(e,new s.VariableDeclarator(r,i))},t.prototype.parseVariableDeclarationList=function(t){var e={inFor:t.inFor},n=[];for(n.push(this.parseVariableDeclaration(e));this.match(",");)this.nextToken(),n.push(this.parseVariableDeclaration(e));return n},t.prototype.parseVariableStatement=function(){var t=this.createNode();this.expectKeyword("var");var e=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(t,new s.VariableDeclaration(e,"var"))},t.prototype.parseEmptyStatement=function(){var t=this.createNode();return this.expect(";"),this.finalize(t,new s.EmptyStatement)},t.prototype.parseExpressionStatement=function(){var t=this.createNode(),e=this.parseExpression();return this.consumeSemicolon(),this.finalize(t,new s.ExpressionStatement(e))},t.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(o.Messages.StrictFunction),this.parseStatement()},t.prototype.parseIfStatement=function(){var t,e=this.createNode(),n=null;this.expectKeyword("if"),this.expect("(");var r=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new s.EmptyStatement)):(this.expect(")"),t=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),n=this.parseIfClause())),this.finalize(e,new s.IfStatement(r,t,n))},t.prototype.parseDoWhileStatement=function(){var t=this.createNode();this.expectKeyword("do");var e=this.context.inIteration;this.context.inIteration=!0;var n=this.parseStatement();this.context.inIteration=e,this.expectKeyword("while"),this.expect("(");var r=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(t,new s.DoWhileStatement(n,r))},t.prototype.parseWhileStatement=function(){var t,e=this.createNode();this.expectKeyword("while"),this.expect("(");var n=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new s.EmptyStatement);else{this.expect(")");var r=this.context.inIteration;this.context.inIteration=!0,t=this.parseStatement(),this.context.inIteration=r}return this.finalize(e,new s.WhileStatement(n,t))},t.prototype.parseForStatement=function(){var t,e,n=null,r=null,i=null,a=!0,c=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){n=this.createNode(),this.nextToken();var h=this.context.allowIn;this.context.allowIn=!1;var l=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=h,1===l.length&&this.matchKeyword("in")){var p=l[0];p.init&&(p.id.type===u.Syntax.ArrayPattern||p.id.type===u.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(o.Messages.ForInOfLoopInitializer,"for-in"),n=this.finalize(n,new s.VariableDeclaration(l,"var")),this.nextToken(),t=n,e=this.parseExpression(),n=null}else 1===l.length&&null===l[0].init&&this.matchContextualKeyword("of")?(n=this.finalize(n,new s.VariableDeclaration(l,"var")),this.nextToken(),t=n,e=this.parseAssignmentExpression(),n=null,a=!1):(n=this.finalize(n,new s.VariableDeclaration(l,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){n=this.createNode();var f=this.nextToken().value;if(this.context.strict||"in"!==this.lookahead.value){var h=this.context.allowIn;this.context.allowIn=!1;var l=this.parseBindingList(f,{inFor:!0});this.context.allowIn=h,1===l.length&&null===l[0].init&&this.matchKeyword("in")?(n=this.finalize(n,new s.VariableDeclaration(l,f)),this.nextToken(),t=n,e=this.parseExpression(),n=null):1===l.length&&null===l[0].init&&this.matchContextualKeyword("of")?(n=this.finalize(n,new s.VariableDeclaration(l,f)),this.nextToken(),t=n,e=this.parseAssignmentExpression(),n=null,a=!1):(this.consumeSemicolon(),n=this.finalize(n,new s.VariableDeclaration(l,f)))}else n=this.finalize(n,new s.Identifier(f)),this.nextToken(),t=n,e=this.parseExpression(),n=null}else{var d=this.lookahead,h=this.context.allowIn;if(this.context.allowIn=!1,n=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=h,this.matchKeyword("in"))this.context.isAssignmentTarget&&n.type!==u.Syntax.AssignmentExpression||this.tolerateError(o.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(n),t=n,e=this.parseExpression(),n=null;else if(this.matchContextualKeyword("of"))this.context.isAssignmentTarget&&n.type!==u.Syntax.AssignmentExpression||this.tolerateError(o.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(n),t=n,e=this.parseAssignmentExpression(),n=null,a=!1;else{if(this.match(",")){for(var m=[n];this.match(",");)this.nextToken(),m.push(this.isolateCoverGrammar(this.parseAssignmentExpression));n=this.finalize(this.startNode(d),new s.SequenceExpression(m))}this.expect(";")}}void 0===t&&(this.match(";")||(r=this.parseExpression()),this.expect(";"),this.match(")")||(i=this.parseExpression()));var y;if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),y=this.finalize(this.createNode(),new s.EmptyStatement);else{this.expect(")");var v=this.context.inIteration;this.context.inIteration=!0,y=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=v}return void 0===t?this.finalize(c,new s.ForStatement(n,r,i,y)):a?this.finalize(c,new s.ForInStatement(t,e,y)):this.finalize(c,new s.ForOfStatement(t,e,y))},t.prototype.parseContinueStatement=function(){var t=this.createNode();this.expectKeyword("continue");var e=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier();e=n;var r="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)||this.throwError(o.Messages.UnknownLabel,n.name)}return this.consumeSemicolon(),null!==e||this.context.inIteration||this.throwError(o.Messages.IllegalContinue),this.finalize(t,new s.ContinueStatement(e))},t.prototype.parseBreakStatement=function(){var t=this.createNode();this.expectKeyword("break");var e=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier(),r="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)||this.throwError(o.Messages.UnknownLabel,n.name),e=n}return this.consumeSemicolon(),null!==e||this.context.inIteration||this.context.inSwitch||this.throwError(o.Messages.IllegalBreak),this.finalize(t,new s.BreakStatement(e))},t.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(o.Messages.IllegalReturn);var t=this.createNode();this.expectKeyword("return");var e=!this.match(";")&&!this.match("}")&&!this.hasLineTerminator&&2!==this.lookahead.type,n=e?this.parseExpression():null;return this.consumeSemicolon(),this.finalize(t,new s.ReturnStatement(n))},t.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(o.Messages.StrictModeWith);var t,e=this.createNode();this.expectKeyword("with"),this.expect("(");var n=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new s.EmptyStatement)):(this.expect(")"),t=this.parseStatement()),this.finalize(e,new s.WithStatement(n,t))},t.prototype.parseSwitchCase=function(){var t,e=this.createNode();this.matchKeyword("default")?(this.nextToken(),t=null):(this.expectKeyword("case"),t=this.parseExpression()),this.expect(":");for(var n=[];;){if(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"))break;n.push(this.parseStatementListItem())}return this.finalize(e,new s.SwitchCase(t,n))},t.prototype.parseSwitchStatement=function(){var t=this.createNode();this.expectKeyword("switch"),this.expect("(");var e=this.parseExpression();this.expect(")");var n=this.context.inSwitch;this.context.inSwitch=!0;var r=[],i=!1;for(this.expect("{");;){if(this.match("}"))break;var a=this.parseSwitchCase();null===a.test&&(i&&this.throwError(o.Messages.MultipleDefaultsInSwitch),i=!0),r.push(a)}return this.expect("}"),this.context.inSwitch=n,this.finalize(t,new s.SwitchStatement(e,r))},t.prototype.parseLabelledStatement=function(){var t,e=this.createNode(),n=this.parseExpression();if(n.type===u.Syntax.Identifier&&this.match(":")){this.nextToken();var r=n,i="$"+r.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,i)&&this.throwError(o.Messages.Redeclaration,"Label",r.name),this.context.labelSet[i]=!0;var a=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),a=this.parseClassDeclaration();else if(this.matchKeyword("function")){var c=this.lookahead,h=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(c,o.Messages.StrictFunction):h.generator&&this.tolerateUnexpectedToken(c,o.Messages.GeneratorInLegacyContext),a=h}else a=this.parseStatement();delete this.context.labelSet[i],t=new s.LabeledStatement(r,a)}else this.consumeSemicolon(),t=new s.ExpressionStatement(n);return this.finalize(e,t)},t.prototype.parseThrowStatement=function(){var t=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(o.Messages.NewlineAfterThrow);var e=this.parseExpression();return this.consumeSemicolon(),this.finalize(t,new s.ThrowStatement(e))},t.prototype.parseCatchClause=function(){var t=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var e=[],n=this.parsePattern(e),r={},i=0;i<e.length;i++){var a="$"+e[i].value;Object.prototype.hasOwnProperty.call(r,a)&&this.tolerateError(o.Messages.DuplicateBinding,e[i].value),r[a]=!0}this.context.strict&&n.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(n.name)&&this.tolerateError(o.Messages.StrictCatchVariable),this.expect(")");var c=this.parseBlock();return this.finalize(t,new s.CatchClause(n,c))},t.prototype.parseFinallyClause=function(){return this.expectKeyword("finally"),this.parseBlock()},t.prototype.parseTryStatement=function(){var t=this.createNode();this.expectKeyword("try");var e=this.parseBlock(),n=this.matchKeyword("catch")?this.parseCatchClause():null,r=this.matchKeyword("finally")?this.parseFinallyClause():null;return n||r||this.throwError(o.Messages.NoCatchOrFinally),this.finalize(t,new s.TryStatement(e,n,r))},t.prototype.parseDebuggerStatement=function(){var t=this.createNode();return this.expectKeyword("debugger"),this.consumeSemicolon(),this.finalize(t,new s.DebuggerStatement)},t.prototype.parseStatement=function(){var t;switch(this.lookahead.type){case 1:case 5:case 6:case 8:case 10:case 9:t=this.parseExpressionStatement();break;case 7:var e=this.lookahead.value;t="{"===e?this.parseBlock():"("===e?this.parseExpressionStatement():";"===e?this.parseEmptyStatement():this.parseExpressionStatement();break;case 3:t=this.matchAsyncFunction()?this.parseFunctionDeclaration():this.parseLabelledStatement();break;case 4:switch(this.lookahead.value){case"break":t=this.parseBreakStatement();break;case"continue":t=this.parseContinueStatement();break;case"debugger":t=this.parseDebuggerStatement();break;case"do":t=this.parseDoWhileStatement();break;case"for":t=this.parseForStatement();break;case"function":t=this.parseFunctionDeclaration();break;case"if":t=this.parseIfStatement();break;case"return":t=this.parseReturnStatement();break;case"switch":t=this.parseSwitchStatement();break;case"throw":t=this.parseThrowStatement();break;case"try":t=this.parseTryStatement();break;case"var":t=this.parseVariableStatement();break;case"while":t=this.parseWhileStatement();break;case"with":t=this.parseWithStatement();break;default:t=this.parseExpressionStatement()}break;default:t=this.throwUnexpectedToken(this.lookahead)}return t},t.prototype.parseFunctionSourceElements=function(){var t=this.createNode();this.expect("{");var e=this.parseDirectivePrologues(),n=this.context.labelSet,r=this.context.inIteration,i=this.context.inSwitch,o=this.context.inFunctionBody;for(this.context.labelSet={},this.context.inIteration=!1,this.context.inSwitch=!1,this.context.inFunctionBody=!0;2!==this.lookahead.type&&!this.match("}");)e.push(this.parseStatementListItem());return this.expect("}"),this.context.labelSet=n,this.context.inIteration=r,this.context.inSwitch=i,this.context.inFunctionBody=o,this.finalize(t,new s.BlockStatement(e))},t.prototype.validateParam=function(t,e,n){var r="$"+n;this.context.strict?(this.scanner.isRestrictedWord(n)&&(t.stricted=e,t.message=o.Messages.StrictParamName),Object.prototype.hasOwnProperty.call(t.paramSet,r)&&(t.stricted=e,t.message=o.Messages.StrictParamDupe)):t.firstRestricted||(this.scanner.isRestrictedWord(n)?(t.firstRestricted=e,t.message=o.Messages.StrictParamName):this.scanner.isStrictModeReservedWord(n)?(t.firstRestricted=e,t.message=o.Messages.StrictReservedWord):Object.prototype.hasOwnProperty.call(t.paramSet,r)&&(t.stricted=e,t.message=o.Messages.StrictParamDupe)),"function"==typeof Object.defineProperty?Object.defineProperty(t.paramSet,r,{value:!0,enumerable:!0,writable:!0,configurable:!0}):t.paramSet[r]=!0},t.prototype.parseRestElement=function(t){var e=this.createNode();this.expect("...");var n=this.parsePattern(t);return this.match("=")&&this.throwError(o.Messages.DefaultRestParameter),this.match(")")||this.throwError(o.Messages.ParameterAfterRestParameter),this.finalize(e,new s.RestElement(n))},t.prototype.parseFormalParameter=function(t){for(var e=[],n=this.match("...")?this.parseRestElement(e):this.parsePatternWithDefault(e),r=0;r<e.length;r++)this.validateParam(t,e[r],e[r].value);t.simple=t.simple&&n instanceof s.Identifier,t.params.push(n)},t.prototype.parseFormalParameters=function(t){var e;if(e={simple:!0,params:[],firstRestricted:t},this.expect("("),!this.match(")"))for(e.paramSet={};2!==this.lookahead.type&&(this.parseFormalParameter(e),!this.match(")"))&&(this.expect(","),!this.match(")")););return this.expect(")"),{simple:e.simple,params:e.params,stricted:e.stricted,firstRestricted:e.firstRestricted,message:e.message}},t.prototype.matchAsyncFunction=function(){var t=this.matchContextualKeyword("async");if(t){var e=this.scanner.saveState();this.scanner.scanComments();var n=this.scanner.lex();this.scanner.restoreState(e),t=e.lineNumber===n.lineNumber&&4===n.type&&"function"===n.value}return t},t.prototype.parseFunctionDeclaration=function(t){var e=this.createNode(),n=this.matchContextualKeyword("async");n&&this.nextToken(),this.expectKeyword("function");var r=!n&&this.match("*");r&&this.nextToken();var i,a=null,u=null;if(!t||!this.match("(")){var c=this.lookahead;a=this.parseVariableIdentifier(),this.context.strict?this.scanner.isRestrictedWord(c.value)&&this.tolerateUnexpectedToken(c,o.Messages.StrictFunctionName):this.scanner.isRestrictedWord(c.value)?(u=c,i=o.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(c.value)&&(u=c,i=o.Messages.StrictReservedWord)}var h=this.context.await,l=this.context.allowYield;this.context.await=n,this.context.allowYield=!r;var p=this.parseFormalParameters(u),f=p.params,d=p.stricted;u=p.firstRestricted,p.message&&(i=p.message);var m=this.context.strict,y=this.context.allowStrictDirective;this.context.allowStrictDirective=p.simple;var v=this.parseFunctionSourceElements();return this.context.strict&&u&&this.throwUnexpectedToken(u,i),this.context.strict&&d&&this.tolerateUnexpectedToken(d,i),this.context.strict=m,this.context.allowStrictDirective=y,this.context.await=h,this.context.allowYield=l,n?this.finalize(e,new s.AsyncFunctionDeclaration(a,f,v)):this.finalize(e,new s.FunctionDeclaration(a,f,v,r))},t.prototype.parseFunctionExpression=function(){var t=this.createNode(),e=this.matchContextualKeyword("async");e&&this.nextToken(),this.expectKeyword("function");var n=!e&&this.match("*");n&&this.nextToken();var r,i,a=null,u=this.context.await,c=this.context.allowYield;if(this.context.await=e,this.context.allowYield=!n,!this.match("(")){var h=this.lookahead;a=this.context.strict||n||!this.matchKeyword("yield")?this.parseVariableIdentifier():this.parseIdentifierName(),this.context.strict?this.scanner.isRestrictedWord(h.value)&&this.tolerateUnexpectedToken(h,o.Messages.StrictFunctionName):this.scanner.isRestrictedWord(h.value)?(i=h,r=o.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(h.value)&&(i=h,r=o.Messages.StrictReservedWord)}var l=this.parseFormalParameters(i),p=l.params,f=l.stricted;i=l.firstRestricted,l.message&&(r=l.message);var d=this.context.strict,m=this.context.allowStrictDirective;this.context.allowStrictDirective=l.simple;var y=this.parseFunctionSourceElements();return this.context.strict&&i&&this.throwUnexpectedToken(i,r),this.context.strict&&f&&this.tolerateUnexpectedToken(f,r),this.context.strict=d,this.context.allowStrictDirective=m,this.context.await=u,this.context.allowYield=c,e?this.finalize(t,new s.AsyncFunctionExpression(a,p,y)):this.finalize(t,new s.FunctionExpression(a,p,y,n))},t.prototype.parseDirective=function(){var t=this.lookahead,e=this.createNode(),n=this.parseExpression(),r=n.type===u.Syntax.Literal?this.getTokenRaw(t).slice(1,-1):null;return this.consumeSemicolon(),this.finalize(e,r?new s.Directive(n,r):new s.ExpressionStatement(n))},t.prototype.parseDirectivePrologues=function(){for(var t=null,e=[];;){var n=this.lookahead;if(8!==n.type)break;var r=this.parseDirective();e.push(r);var i=r.directive;if("string"!=typeof i)break;"use strict"===i?(this.context.strict=!0,t&&this.tolerateUnexpectedToken(t,o.Messages.StrictOctalLiteral),this.context.allowStrictDirective||this.tolerateUnexpectedToken(n,o.Messages.IllegalLanguageModeDirective)):!t&&n.octal&&(t=n)}return e},t.prototype.qualifiedPropertyName=function(t){switch(t.type){case 3:case 8:case 1:case 5:case 6:case 4:return!0;case 7:return"["===t.value}return!1},t.prototype.parseGetterMethod=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!1;var n=this.parseFormalParameters();n.params.length>0&&this.tolerateError(o.Messages.BadGetterArity);var r=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new s.FunctionExpression(null,n.params,r,!1))},t.prototype.parseSetterMethod=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!1;var n=this.parseFormalParameters();1!==n.params.length?this.tolerateError(o.Messages.BadSetterArity):n.params[0]instanceof s.RestElement&&this.tolerateError(o.Messages.BadSetterRestParameter);var r=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new s.FunctionExpression(null,n.params,r,!1))},t.prototype.parseGeneratorMethod=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();this.context.allowYield=!1;var r=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new s.FunctionExpression(null,n.params,r,!0))},t.prototype.isStartOfExpression=function(){var t=!0,e=this.lookahead.value;switch(this.lookahead.type){case 7:t="["===e||"("===e||"{"===e||"+"===e||"-"===e||"!"===e||"~"===e||"++"===e||"--"===e||"/"===e||"/="===e;break;case 4:t="class"===e||"delete"===e||"function"===e||"let"===e||"new"===e||"super"===e||"this"===e||"typeof"===e||"void"===e||"yield"===e}return t},t.prototype.parseYieldExpression=function(){var t=this.createNode();this.expectKeyword("yield");var e=null,n=!1;if(!this.hasLineTerminator){var r=this.context.allowYield;this.context.allowYield=!1,n=this.match("*"),n?(this.nextToken(),e=this.parseAssignmentExpression()):this.isStartOfExpression()&&(e=this.parseAssignmentExpression()),this.context.allowYield=r}return this.finalize(t,new s.YieldExpression(e,n))},t.prototype.parseClassElement=function(t){var e=this.lookahead,n=this.createNode(),r="",i=null,a=null,u=!1,c=!1,h=!1,l=!1;if(this.match("*"))this.nextToken();else{u=this.match("["),i=this.parseObjectPropertyKey();if("static"===i.name&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(e=this.lookahead,h=!0,u=this.match("["),this.match("*")?this.nextToken():i=this.parseObjectPropertyKey()),3===e.type&&!this.hasLineTerminator&&"async"===e.value){var p=this.lookahead.value;":"!==p&&"("!==p&&"*"!==p&&(l=!0,e=this.lookahead,i=this.parseObjectPropertyKey(),3===e.type&&("get"===e.value||"set"===e.value?this.tolerateUnexpectedToken(e):"constructor"===e.value&&this.tolerateUnexpectedToken(e,o.Messages.ConstructorIsAsync)))}}var f=this.qualifiedPropertyName(this.lookahead);return 3===e.type?"get"===e.value&&f?(r="get",u=this.match("["),i=this.parseObjectPropertyKey(),this.context.allowYield=!1,a=this.parseGetterMethod()):"set"===e.value&&f&&(r="set",u=this.match("["),i=this.parseObjectPropertyKey(),a=this.parseSetterMethod()):7===e.type&&"*"===e.value&&f&&(r="init",u=this.match("["),i=this.parseObjectPropertyKey(),a=this.parseGeneratorMethod(),c=!0),!r&&i&&this.match("(")&&(r="init",a=l?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),c=!0),r||this.throwUnexpectedToken(this.lookahead),"init"===r&&(r="method"),u||(h&&this.isPropertyKey(i,"prototype")&&this.throwUnexpectedToken(e,o.Messages.StaticPrototype),!h&&this.isPropertyKey(i,"constructor")&&(("method"!==r||!c||a&&a.generator)&&this.throwUnexpectedToken(e,o.Messages.ConstructorSpecialMethod),t.value?this.throwUnexpectedToken(e,o.Messages.DuplicateConstructor):t.value=!0,r="constructor")),this.finalize(n,new s.MethodDefinition(i,u,a,r,h))},t.prototype.parseClassElementList=function(){var t=[],e={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():t.push(this.parseClassElement(e));return this.expect("}"),t},t.prototype.parseClassBody=function(){var t=this.createNode(),e=this.parseClassElementList();return this.finalize(t,new s.ClassBody(e))},t.prototype.parseClassDeclaration=function(t){var e=this.createNode(),n=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var r=t&&3!==this.lookahead.type?null:this.parseVariableIdentifier(),i=null;this.matchKeyword("extends")&&(this.nextToken(),i=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var o=this.parseClassBody();return this.context.strict=n,this.finalize(e,new s.ClassDeclaration(r,i,o))},t.prototype.parseClassExpression=function(){var t=this.createNode(),e=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var n=3===this.lookahead.type?this.parseVariableIdentifier():null,r=null;this.matchKeyword("extends")&&(this.nextToken(),r=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var i=this.parseClassBody();return this.context.strict=e,this.finalize(t,new s.ClassExpression(n,r,i))},t.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0;for(var t=this.createNode(),e=this.parseDirectivePrologues();2!==this.lookahead.type;)e.push(this.parseStatementListItem());return this.finalize(t,new s.Module(e))},t.prototype.parseScript=function(){for(var t=this.createNode(),e=this.parseDirectivePrologues();2!==this.lookahead.type;)e.push(this.parseStatementListItem());return this.finalize(t,new s.Script(e))},t.prototype.parseModuleSpecifier=function(){var t=this.createNode();8!==this.lookahead.type&&this.throwError(o.Messages.InvalidModuleSpecifier);var e=this.nextToken(),n=this.getTokenRaw(e);return this.finalize(t,new s.Literal(e.value,n))},t.prototype.parseImportSpecifier=function(){var t,e,n=this.createNode();return 3===this.lookahead.type?(t=this.parseVariableIdentifier(),e=t,this.matchContextualKeyword("as")&&(this.nextToken(),e=this.parseVariableIdentifier())):(t=this.parseIdentifierName(),e=t,this.matchContextualKeyword("as")?(this.nextToken(),e=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(n,new s.ImportSpecifier(e,t))},t.prototype.parseNamedImports=function(){this.expect("{");for(var t=[];!this.match("}");)t.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),t},t.prototype.parseImportDefaultSpecifier=function(){var t=this.createNode(),e=this.parseIdentifierName();return this.finalize(t,new s.ImportDefaultSpecifier(e))},t.prototype.parseImportNamespaceSpecifier=function(){var t=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(o.Messages.NoAsAfterImportNamespace),this.nextToken();var e=this.parseIdentifierName();return this.finalize(t,new s.ImportNamespaceSpecifier(e))},t.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(o.Messages.IllegalImportDeclaration);var t=this.createNode();this.expectKeyword("import");var e,n=[];if(8===this.lookahead.type)e=this.parseModuleSpecifier();else{if(this.match("{")?n=n.concat(this.parseNamedImports()):this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(n.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.match("{")?n=n.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var r=this.lookahead.value?o.Messages.UnexpectedToken:o.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}this.nextToken(),e=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(t,new s.ImportDeclaration(n,e))},t.prototype.parseExportSpecifier=function(){var t=this.createNode(),e=this.parseIdentifierName(),n=e;return this.matchContextualKeyword("as")&&(this.nextToken(),n=this.parseIdentifierName()),this.finalize(t,new s.ExportSpecifier(e,n))},t.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(o.Messages.IllegalExportDeclaration);var t=this.createNode();this.expectKeyword("export");var e;if(this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var n=this.parseFunctionDeclaration(!0);e=this.finalize(t,new s.ExportDefaultDeclaration(n))}else if(this.matchKeyword("class")){var n=this.parseClassDeclaration(!0);e=this.finalize(t,new s.ExportDefaultDeclaration(n))}else if(this.matchContextualKeyword("async")){var n=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression();e=this.finalize(t,new s.ExportDefaultDeclaration(n))}else{this.matchContextualKeyword("from")&&this.throwError(o.Messages.UnexpectedToken,this.lookahead.value);var n=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression();this.consumeSemicolon(),e=this.finalize(t,new s.ExportDefaultDeclaration(n))}else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var r=this.lookahead.value?o.Messages.UnexpectedToken:o.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}this.nextToken();var i=this.parseModuleSpecifier();this.consumeSemicolon(),e=this.finalize(t,new s.ExportAllDeclaration(i))}else if(4===this.lookahead.type){var n=void 0;switch(this.lookahead.value){case"let":case"const":n=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":n=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}e=this.finalize(t,new s.ExportNamedDeclaration(n,[],null))}else if(this.matchAsyncFunction()){var n=this.parseFunctionDeclaration();e=this.finalize(t,new s.ExportNamedDeclaration(n,[],null))}else{var a=[],u=null,c=!1;for(this.expect("{");!this.match("}");)c=c||this.matchKeyword("default"),a.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");if(this.expect("}"),this.matchContextualKeyword("from"))this.nextToken(),u=this.parseModuleSpecifier(),this.consumeSemicolon();else if(c){var r=this.lookahead.value?o.Messages.UnexpectedToken:o.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}else this.consumeSemicolon();e=this.finalize(t,new s.ExportNamedDeclaration(null,a,u))}return e},t}();e.Parser=h},function(t,e){"use strict";function n(t,e){if(!t)throw new Error("ASSERT: "+e)}Object.defineProperty(e,"__esModule",{value:!0}),e.assert=n},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){this.errors=[],this.tolerant=!1}return t.prototype.recordError=function(t){this.errors.push(t)},t.prototype.tolerate=function(t){if(!this.tolerant)throw t;this.recordError(t)},t.prototype.constructError=function(t,e){var n=new Error(t);try{throw n}catch(t){Object.create&&Object.defineProperty&&(n=Object.create(t),Object.defineProperty(n,"column",{value:e}))}return n},t.prototype.createError=function(t,e,n,r){var i="Line "+e+": "+r,o=this.constructError(i,n);return o.index=t,o.lineNumber=e,o.description=r,o},t.prototype.throwError=function(t,e,n,r){throw this.createError(t,e,n,r)},t.prototype.tolerateError=function(t,e,n,r){var i=this.createError(t,e,n,r);if(!this.tolerant)throw i;this.recordError(i)},t}();e.ErrorHandler=n},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(t,e,n){"use strict";function r(t){return"0123456789abcdef".indexOf(t.toLowerCase())}function i(t){return"01234567".indexOf(t)}Object.defineProperty(e,"__esModule",{value:!0});var o=n(9),s=n(4),a=n(11),u=function(){function t(t,e){this.source=t,this.errorHandler=e,this.trackComment=!1,this.length=t.length,this.index=0,this.lineNumber=t.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return t.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},t.prototype.restoreState=function(t){this.index=t.index,this.lineNumber=t.lineNumber,this.lineStart=t.lineStart},t.prototype.eof=function(){return this.index>=this.length},t.prototype.throwUnexpectedToken=function(t){return void 0===t&&(t=a.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,t)},t.prototype.tolerateUnexpectedToken=function(t){void 0===t&&(t=a.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,t)},t.prototype.skipSingleLineComment=function(t){var e,n,r=[];for(this.trackComment&&(r=[],e=this.index-t,n={start:{line:this.lineNumber,column:this.index-this.lineStart-t},end:{}});!this.eof();){var i=this.source.charCodeAt(this.index);if(++this.index,s.Character.isLineTerminator(i)){if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart-1};var o={multiLine:!1,slice:[e+t,this.index-1],range:[e,this.index-1],loc:n};r.push(o)}return 13===i&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,r}}if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart};var o={multiLine:!1,slice:[e+t,this.index],range:[e,this.index],loc:n};r.push(o)}return r},t.prototype.skipMultiLineComment=function(){var t,e,n=[];for(this.trackComment&&(n=[],t=this.index-2,e={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var r=this.source.charCodeAt(this.index);if(s.Character.isLineTerminator(r))13===r&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===r){if(47===this.source.charCodeAt(this.index+1)){if(this.index+=2,this.trackComment){e.end={line:this.lineNumber,column:this.index-this.lineStart};var i={multiLine:!0,slice:[t+2,this.index-2],range:[t,this.index],loc:e};n.push(i)}return n}++this.index}else++this.index}if(this.trackComment){e.end={line:this.lineNumber,column:this.index-this.lineStart};var i={multiLine:!0,slice:[t+2,this.index],range:[t,this.index],loc:e};n.push(i)}return this.tolerateUnexpectedToken(),n},t.prototype.scanComments=function(){var t;this.trackComment&&(t=[]);for(var e=0===this.index;!this.eof();){var n=this.source.charCodeAt(this.index);if(s.Character.isWhiteSpace(n))++this.index;else if(s.Character.isLineTerminator(n))++this.index,13===n&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,e=!0;else if(47===n)if(47===(n=this.source.charCodeAt(this.index+1))){this.index+=2;var r=this.skipSingleLineComment(2);this.trackComment&&(t=t.concat(r)),e=!0}else{if(42!==n)break;this.index+=2;var r=this.skipMultiLineComment();this.trackComment&&(t=t.concat(r))}else if(e&&45===n){if(45!==this.source.charCodeAt(this.index+1)||62!==this.source.charCodeAt(this.index+2))break;this.index+=3;var r=this.skipSingleLineComment(3);this.trackComment&&(t=t.concat(r))}else{if(60!==n)break;if("!--"!==this.source.slice(this.index+1,this.index+4))break;this.index+=4;var r=this.skipSingleLineComment(4);this.trackComment&&(t=t.concat(r))}}return t},t.prototype.isFutureReservedWord=function(t){switch(t){case"enum":case"export":case"import":case"super":return!0;default:return!1}},t.prototype.isStrictModeReservedWord=function(t){switch(t){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},t.prototype.isRestrictedWord=function(t){return"eval"===t||"arguments"===t},t.prototype.isKeyword=function(t){switch(t.length){case 2:return"if"===t||"in"===t||"do"===t;case 3:return"var"===t||"for"===t||"new"===t||"try"===t||"let"===t;case 4:return"this"===t||"else"===t||"case"===t||"void"===t||"with"===t||"enum"===t;case 5:return"while"===t||"break"===t||"catch"===t||"throw"===t||"const"===t||"yield"===t||"class"===t||"super"===t;case 6:return"return"===t||"typeof"===t||"delete"===t||"switch"===t||"export"===t||"import"===t;case 7:return"default"===t||"finally"===t||"extends"===t;case 8:return"function"===t||"continue"===t||"debugger"===t;case 10:return"instanceof"===t;default:return!1}},t.prototype.codePointAt=function(t){var e=this.source.charCodeAt(t);if(e>=55296&&e<=56319){var n=this.source.charCodeAt(t+1);if(n>=56320&&n<=57343){e=1024*(e-55296)+n-56320+65536}}return e},t.prototype.scanHexEscape=function(t){for(var e="u"===t?4:2,n=0,i=0;i<e;++i){if(this.eof()||!s.Character.isHexDigit(this.source.charCodeAt(this.index)))return null;n=16*n+r(this.source[this.index++])}return String.fromCharCode(n)},t.prototype.scanUnicodeCodePointEscape=function(){var t=this.source[this.index],e=0;for("}"===t&&this.throwUnexpectedToken();!this.eof()&&(t=this.source[this.index++],s.Character.isHexDigit(t.charCodeAt(0)));)e=16*e+r(t);return(e>1114111||"}"!==t)&&this.throwUnexpectedToken(),s.Character.fromCodePoint(e)},t.prototype.getIdentifier=function(){for(var t=this.index++;!this.eof();){var e=this.source.charCodeAt(this.index);if(92===e)return this.index=t,this.getComplexIdentifier();if(e>=55296&&e<57343)return this.index=t,this.getComplexIdentifier();if(!s.Character.isIdentifierPart(e))break;++this.index}return this.source.slice(t,this.index)},t.prototype.getComplexIdentifier=function(){var t=this.codePointAt(this.index),e=s.Character.fromCodePoint(t);this.index+=e.length;var n;for(92===t&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,n=this.scanUnicodeCodePointEscape()):null!==(n=this.scanHexEscape("u"))&&"\\"!==n&&s.Character.isIdentifierStart(n.charCodeAt(0))||this.throwUnexpectedToken(),e=n);!this.eof()&&(t=this.codePointAt(this.index),s.Character.isIdentifierPart(t));)n=s.Character.fromCodePoint(t),e+=n,this.index+=n.length,92===t&&(e=e.substr(0,e.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,n=this.scanUnicodeCodePointEscape()):null!==(n=this.scanHexEscape("u"))&&"\\"!==n&&s.Character.isIdentifierPart(n.charCodeAt(0))||this.throwUnexpectedToken(),e+=n);return e},t.prototype.octalToDecimal=function(t){var e="0"!==t,n=i(t);return!this.eof()&&s.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(e=!0,n=8*n+i(this.source[this.index++]),"0123".indexOf(t)>=0&&!this.eof()&&s.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+i(this.source[this.index++]))),{code:n,octal:e}},t.prototype.scanIdentifier=function(){var t,e=this.index,n=92===this.source.charCodeAt(e)?this.getComplexIdentifier():this.getIdentifier();if(3!==(t=1===n.length?3:this.isKeyword(n)?4:"null"===n?5:"true"===n||"false"===n?1:3)&&e+n.length!==this.index){var r=this.index;this.index=e,this.tolerateUnexpectedToken(a.Messages.InvalidEscapedReservedWord),this.index=r}return{type:t,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.scanPunctuator=function(){var t=this.index,e=this.source[this.index];switch(e){case"(":case"{":"{"===e&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,e="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:e=this.source.substr(this.index,4),">>>="===e?this.index+=4:(e=e.substr(0,3),"==="===e||"!=="===e||">>>"===e||"<<="===e||">>="===e||"**="===e?this.index+=3:(e=e.substr(0,2),"&&"===e||"||"===e||"=="===e||"!="===e||"+="===e||"-="===e||"*="===e||"/="===e||"++"===e||"--"===e||"<<"===e||">>"===e||"&="===e||"|="===e||"^="===e||"%="===e||"<="===e||">="===e||"=>"===e||"**"===e?this.index+=2:(e=this.source[this.index],"<>=!+-*%&|^/".indexOf(e)>=0&&++this.index)))}return this.index===t&&this.throwUnexpectedToken(),{type:7,value:e,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanHexLiteral=function(t){for(var e="";!this.eof()&&s.Character.isHexDigit(this.source.charCodeAt(this.index));)e+=this.source[this.index++];return 0===e.length&&this.throwUnexpectedToken(),s.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+e,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanBinaryLiteral=function(t){for(var e,n="";!this.eof()&&("0"===(e=this.source[this.index])||"1"===e);)n+=this.source[this.index++];return 0===n.length&&this.throwUnexpectedToken(),this.eof()||(e=this.source.charCodeAt(this.index),(s.Character.isIdentifierStart(e)||s.Character.isDecimalDigit(e))&&this.throwUnexpectedToken()),{type:6,value:parseInt(n,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanOctalLiteral=function(t,e){var n="",r=!1;for(s.Character.isOctalDigit(t.charCodeAt(0))?(r=!0,n="0"+this.source[this.index++]):++this.index;!this.eof()&&s.Character.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return r||0!==n.length||this.throwUnexpectedToken(),(s.Character.isIdentifierStart(this.source.charCodeAt(this.index))||s.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(n,8),octal:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.isImplicitOctalLiteral=function(){for(var t=this.index+1;t<this.length;++t){var e=this.source[t];if("8"===e||"9"===e)return!1;if(!s.Character.isOctalDigit(e.charCodeAt(0)))return!0}return!0},t.prototype.scanNumericLiteral=function(){var t=this.index,e=this.source[t];o.assert(s.Character.isDecimalDigit(e.charCodeAt(0))||"."===e,"Numeric literal must start with a decimal digit or a decimal point");var n="";if("."!==e){if(n=this.source[this.index++],e=this.source[this.index],"0"===n){if("x"===e||"X"===e)return++this.index,this.scanHexLiteral(t);if("b"===e||"B"===e)return++this.index,this.scanBinaryLiteral(t);if("o"===e||"O"===e)return this.scanOctalLiteral(e,t);if(e&&s.Character.isOctalDigit(e.charCodeAt(0))&&this.isImplicitOctalLiteral())return this.scanOctalLiteral(e,t)}for(;s.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];e=this.source[this.index]}if("."===e){for(n+=this.source[this.index++];s.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];e=this.source[this.index]}if("e"===e||"E"===e)if(n+=this.source[this.index++],e=this.source[this.index],"+"!==e&&"-"!==e||(n+=this.source[this.index++]),s.Character.isDecimalDigit(this.source.charCodeAt(this.index)))for(;s.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];else this.throwUnexpectedToken();return s.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseFloat(n),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanStringLiteral=function(){var t=this.index,e=this.source[t];o.assert("'"===e||'"'===e,"String literal must starts with a quote"),++this.index;for(var n=!1,r="";!this.eof();){var i=this.source[this.index++];if(i===e){e="";break}if("\\"===i)if((i=this.source[this.index++])&&s.Character.isLineTerminator(i.charCodeAt(0)))++this.lineNumber,"\r"===i&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;else switch(i){case"u":if("{"===this.source[this.index])++this.index,r+=this.scanUnicodeCodePointEscape();else{var u=this.scanHexEscape(i);null===u&&this.throwUnexpectedToken(),r+=u}break;case"x":var c=this.scanHexEscape(i);null===c&&this.throwUnexpectedToken(a.Messages.InvalidHexEscapeSequence),r+=c;break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;case"8":case"9":r+=i,this.tolerateUnexpectedToken();break;default:if(i&&s.Character.isOctalDigit(i.charCodeAt(0))){var h=this.octalToDecimal(i);n=h.octal||n,r+=String.fromCharCode(h.code)}else r+=i}else{if(s.Character.isLineTerminator(i.charCodeAt(0)))break;r+=i}}return""!==e&&(this.index=t,this.throwUnexpectedToken()),{type:8,value:r,octal:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanTemplate=function(){var t="",e=!1,n=this.index,r="`"===this.source[n],i=!1,o=2;for(++this.index;!this.eof();){var u=this.source[this.index++];if("`"===u){o=1,i=!0,e=!0;break}if("$"===u){if("{"===this.source[this.index]){this.curlyStack.push("${"),++this.index,e=!0;break}t+=u}else if("\\"===u)if(u=this.source[this.index++],s.Character.isLineTerminator(u.charCodeAt(0)))++this.lineNumber,"\r"===u&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;else switch(u){case"n":t+="\n";break;case"r":t+="\r";break;case"t":t+="\t";break;case"u":if("{"===this.source[this.index])++this.index,t+=this.scanUnicodeCodePointEscape();else{var c=this.index,h=this.scanHexEscape(u);null!==h?t+=h:(this.index=c,t+=u)}break;case"x":var l=this.scanHexEscape(u);null===l&&this.throwUnexpectedToken(a.Messages.InvalidHexEscapeSequence),t+=l;break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:"0"===u?(s.Character.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(a.Messages.TemplateOctalLiteral),t+="\0"):s.Character.isOctalDigit(u.charCodeAt(0))?this.throwUnexpectedToken(a.Messages.TemplateOctalLiteral):t+=u}else s.Character.isLineTerminator(u.charCodeAt(0))?(++this.lineNumber,"\r"===u&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index,t+="\n"):t+=u}return e||this.throwUnexpectedToken(),r||this.curlyStack.pop(),{type:10,value:this.source.slice(n+1,this.index-o),cooked:t,head:r,tail:i,lineNumber:this.lineNumber,lineStart:this.lineStart,start:n,end:this.index}},t.prototype.testRegExp=function(t,e){var n=t,r=this;e.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(t,e,n){var i=parseInt(e||n,16);return i>1114111&&r.throwUnexpectedToken(a.Messages.InvalidRegExp),i<=65535?String.fromCharCode(i):"￿"}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"￿"));try{RegExp(n)}catch(t){this.throwUnexpectedToken(a.Messages.InvalidRegExp)}try{return new RegExp(t,e)}catch(t){return null}},t.prototype.scanRegExpBody=function(){var t=this.source[this.index];o.assert("/"===t,"Regular expression literal must start with a slash");for(var e=this.source[this.index++],n=!1,r=!1;!this.eof();)if(t=this.source[this.index++],e+=t,"\\"===t)t=this.source[this.index++],s.Character.isLineTerminator(t.charCodeAt(0))&&this.throwUnexpectedToken(a.Messages.UnterminatedRegExp),e+=t;else if(s.Character.isLineTerminator(t.charCodeAt(0)))this.throwUnexpectedToken(a.Messages.UnterminatedRegExp);else if(n)"]"===t&&(n=!1);else{if("/"===t){r=!0;break}"["===t&&(n=!0)}return r||this.throwUnexpectedToken(a.Messages.UnterminatedRegExp),e.substr(1,e.length-2)},t.prototype.scanRegExpFlags=function(){for(var t="",e="";!this.eof();){var n=this.source[this.index];if(!s.Character.isIdentifierPart(n.charCodeAt(0)))break;if(++this.index,"\\"!==n||this.eof())e+=n,t+=n;else if("u"===(n=this.source[this.index])){++this.index;var r=this.index,i=this.scanHexEscape("u");if(null!==i)for(e+=i,t+="\\u";r<this.index;++r)t+=this.source[r];else this.index=r,e+="u",t+="\\u";this.tolerateUnexpectedToken()}else t+="\\",this.tolerateUnexpectedToken()}return e},t.prototype.scanRegExp=function(){var t=this.index,e=this.scanRegExpBody(),n=this.scanRegExpFlags();return{type:9,value:"",pattern:e,flags:n,regex:this.testRegExp(e,n),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.lex=function(){if(this.eof())return{type:2,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};var t=this.source.charCodeAt(this.index);return s.Character.isIdentifierStart(t)?this.scanIdentifier():40===t||41===t||59===t?this.scanPunctuator():39===t||34===t?this.scanStringLiteral():46===t?s.Character.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():s.Character.isDecimalDigit(t)?this.scanNumericLiteral():96===t||125===t&&"${"===this.curlyStack[this.curlyStack.length-1]?this.scanTemplate():t>=55296&&t<57343&&s.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},t}();e.Scanner=u},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TokenName={},e.TokenName[1]="Boolean",e.TokenName[2]="<end>",e.TokenName[3]="Identifier",e.TokenName[4]="Keyword",e.TokenName[5]="Null",e.TokenName[6]="Numeric",e.TokenName[7]="Punctuator",e.TokenName[8]="String",e.TokenName[9]="RegularExpression",e.TokenName[10]="Template"},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",lang:"⟨",rang:"⟩"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(10),i=n(12),o=n(13),s=function(){function t(){this.values=[],this.curly=this.paren=-1}return t.prototype.beforeFunctionExpression=function(t){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(t)>=0},t.prototype.isRegexStart=function(){var t=this.values[this.values.length-1],e=null!==t;switch(t){case"this":case"]":e=!1;break;case")":var n=this.values[this.paren-1];e="if"===n||"while"===n||"for"===n||"with"===n;break;case"}":if(e=!1,"function"===this.values[this.curly-3]){var r=this.values[this.curly-4];e=!!r&&!this.beforeFunctionExpression(r)}else if("function"===this.values[this.curly-4]){var r=this.values[this.curly-5];e=!r||!this.beforeFunctionExpression(r)}}return e},t.prototype.push=function(t){7===t.type||4===t.type?("{"===t.value?this.curly=this.values.length:"("===t.value&&(this.paren=this.values.length),this.values.push(t.value)):this.values.push(null)},t}(),a=function(){function t(t,e){this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=!!e&&("boolean"==typeof e.tolerant&&e.tolerant),this.scanner=new i.Scanner(t,this.errorHandler),this.scanner.trackComment=!!e&&("boolean"==typeof e.comment&&e.comment),this.trackRange=!!e&&("boolean"==typeof e.range&&e.range),this.trackLoc=!!e&&("boolean"==typeof e.loc&&e.loc),this.buffer=[],this.reader=new s}return t.prototype.errors=function(){return this.errorHandler.errors},t.prototype.getNextToken=function(){if(0===this.buffer.length){var t=this.scanner.scanComments();if(this.scanner.trackComment)for(var e=0;e<t.length;++e){var n=t[e],r=this.scanner.source.slice(n.slice[0],n.slice[1]),i={type:n.multiLine?"BlockComment":"LineComment",value:r};this.trackRange&&(i.range=n.range),this.trackLoc&&(i.loc=n.loc),this.buffer.push(i)}if(!this.scanner.eof()){var s=void 0;this.trackLoc&&(s={start:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},end:{}});var a="/"===this.scanner.source[this.scanner.index]&&this.reader.isRegexStart(),u=a?this.scanner.scanRegExp():this.scanner.lex();this.reader.push(u);var c={type:o.TokenName[u.type],value:this.scanner.source.slice(u.start,u.end)};if(this.trackRange&&(c.range=[u.start,u.end]),this.trackLoc&&(s.end={line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},c.loc=s),9===u.type){var h=u.pattern,l=u.flags;c.regex={pattern:h,flags:l}}this.buffer.push(c)}}return this.buffer.shift()},t}();e.Tokenizer=a}])})},function(t,e){e.read=function(t,e,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,c=u>>1,h=-7,l=n?i-1:0,p=n?-1:1,f=t[e+l];for(l+=p,o=f&(1<<-h)-1,f>>=-h,h+=a;h>0;o=256*o+t[e+l],l+=p,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=r;h>0;s=256*s+t[e+l],l+=p,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,r),o-=c}return(f?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var s,a,u,c=8*o-i-1,h=(1<<c)-1,l=h>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,d=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),e+=s+l>=1?p/u:p*Math.pow(2,1-l),e*u>=2&&(s++,u/=2),s+l>=h?(a=0,s=h):s+l>=1?(a=(e*u-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[n+f]=255&a,f+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;t[n+f]=255&s,f+=d,s/=256,c-=8);t[n+f-d]|=128*m}},function(t,e,n){!function(e,n){t.exports=n()}(0,function(){"use strict";function t(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function e(t){return o(t)?t:k(t)}function n(t){return s(t)?t:I(t)}function r(t){return a(t)?t:T(t)}function i(t){return o(t)&&!u(t)?t:B(t)}function o(t){return!(!t||!t[cn])}function s(t){return!(!t||!t[hn])}function a(t){return!(!t||!t[ln])}function u(t){return s(t)||a(t)}function c(t){return!(!t||!t[pn])}function h(t){return t.value=!1,t}function l(t){t&&(t.value=!0)}function p(){}function f(t,e){e=e||0;for(var n=Math.max(0,t.length-e),r=new Array(n),i=0;i<n;i++)r[i]=t[i+e];return r}function d(t){return void 0===t.size&&(t.size=t.__iterate(y)),t.size}function m(t,e){if("number"!=typeof e){var n=e>>>0;if(""+n!==e||4294967295===n)return NaN;e=n}return e<0?d(t)+e:e}function y(){return!0}function v(t,e,n){return(0===t||void 0!==n&&t<=-n)&&(void 0===e||void 0!==n&&e>=n)}function x(t,e){return D(t,e,0)}function g(t,e){return D(t,e,e)}function D(t,e,n){return void 0===t?n:t<0?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function E(t){this.next=t}function A(t,e,n,r){var i=0===t?e:1===t?n:[e,n];return r?r.value=i:r={value:i,done:!1},r}function S(){return{value:void 0,done:!0}}function w(t){return!!b(t)}function C(t){return t&&"function"==typeof t.next}function _(t){var e=b(t);return e&&e.call(t)}function b(t){var e=t&&(An&&t[An]||t[Sn]);if("function"==typeof e)return e}function F(t){return t&&"number"==typeof t.length}function k(t){return null===t||void 0===t?U():o(t)?t.toSeq():z(t)}function I(t){return null===t||void 0===t?U().toKeyedSeq():o(t)?s(t)?t.toSeq():t.fromEntrySeq():j(t)}function T(t){return null===t||void 0===t?U():o(t)?s(t)?t.entrySeq():t.toIndexedSeq():L(t)}function B(t){return(null===t||void 0===t?U():o(t)?s(t)?t.entrySeq():t:L(t)).toSetSeq()}function M(t){this._array=t,this.size=t.length}function P(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function N(t){this._iterable=t,this.size=t.length||t.size}function O(t){this._iterator=t,this._iteratorCache=[]}function R(t){return!(!t||!t[Cn])}function U(){return _n||(_n=new M([]))}function j(t){var e=Array.isArray(t)?new M(t).fromEntrySeq():C(t)?new O(t).fromEntrySeq():w(t)?new N(t).fromEntrySeq():"object"==typeof t?new P(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function L(t){var e=J(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function z(t){var e=J(t)||"object"==typeof t&&new P(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function J(t){return F(t)?new M(t):C(t)?new O(t):w(t)?new N(t):void 0}function X(t,e,n,r){var i=t._cache;if(i){for(var o=i.length-1,s=0;s<=o;s++){var a=i[n?o-s:s];if(!1===e(a[1],r?a[0]:s,t))return s+1}return s}return t.__iterateUncached(e,n)}function q(t,e,n,r){var i=t._cache;if(i){var o=i.length-1,s=0;return new E(function(){var t=i[n?o-s:s];return s++>o?S():A(e,r?t[0]:s-1,t[1])})}return t.__iteratorUncached(e,n)}function K(t,e){return e?Y(e,t,"",{"":t}):W(t)}function Y(t,e,n,r){return Array.isArray(e)?t.call(r,n,T(e).map(function(n,r){return Y(t,n,r,e)})):G(e)?t.call(r,n,I(e).map(function(n,r){return Y(t,n,r,e)})):e}function W(t){return Array.isArray(t)?T(t).map(W).toList():G(t)?I(t).map(W).toMap():t}function G(t){return t&&(t.constructor===Object||void 0===t.constructor)}function H(t,e){if(t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if(t=t.valueOf(),e=e.valueOf(),t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1}return!("function"!=typeof t.equals||"function"!=typeof e.equals||!t.equals(e))}function V(t,e){if(t===e)return!0;if(!o(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||s(t)!==s(e)||a(t)!==a(e)||c(t)!==c(e))return!1;if(0===t.size&&0===e.size)return!0;var n=!u(t);if(c(t)){var r=t.entries();return e.every(function(t,e){var i=r.next().value;return i&&H(i[1],t)&&(n||H(i[0],e))})&&r.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var h=t;t=e,e=h}var l=!0,p=e.__iterate(function(e,r){if(n?!t.has(e):i?!H(e,t.get(r,yn)):!H(t.get(r,yn),e))return l=!1,!1});return l&&t.size===p}function $(t,e){if(!(this instanceof $))return new $(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(bn)return bn;bn=this}}function Z(t,e){if(!t)throw new Error(e)}function Q(t,e,n){if(!(this instanceof Q))return new Q(t,e,n);if(Z(0!==n,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),n=void 0===n?1:Math.abs(n),e<t&&(n=-n),this._start=t,this._end=e,this._step=n,this.size=Math.max(0,Math.ceil((e-t)/n-1)+1),0===this.size){if(Fn)return Fn;Fn=this}}function tt(){throw TypeError("Abstract")}function et(){}function nt(){}function rt(){}function it(t){return t>>>1&1073741824|3221225471&t}function ot(t){if(!1===t||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&(!1===(t=t.valueOf())||null===t||void 0===t))return 0;if(!0===t)return 1;var e=typeof t;if("number"===e){if(t!==t||t===1/0)return 0;var n=0|t;for(n!==t&&(n^=4294967295*t);t>4294967295;)t/=4294967295,n^=t;return it(n)}if("string"===e)return t.length>On?st(t):at(t);if("function"==typeof t.hashCode)return t.hashCode();if("object"===e)return ut(t);if("function"==typeof t.toString)return at(t.toString());throw new Error("Value type "+e+" cannot be hashed.")}function st(t){var e=jn[t];return void 0===e&&(e=at(t),Un===Rn&&(Un=0,jn={}),Un++,jn[t]=e),e}function at(t){for(var e=0,n=0;n<t.length;n++)e=31*e+t.charCodeAt(n)|0;return it(e)}function ut(t){var e;if(Mn&&void 0!==(e=kn.get(t)))return e;if(void 0!==(e=t[Nn]))return e;if(!Bn){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Nn]))return e;if(void 0!==(e=ct(t)))return e}if(e=++Pn,1073741824&Pn&&(Pn=0),Mn)kn.set(t,e);else{if(void 0!==Tn&&!1===Tn(t))throw new Error("Non-extensible objects are not allowed as keys.");if(Bn)Object.defineProperty(t,Nn,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[Nn]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[Nn]=e}}return e}function ct(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function ht(t){Z(t!==1/0,"Cannot perform this action with an infinite size.")}function lt(t){return null===t||void 0===t?At():pt(t)&&!c(t)?t:At().withMutations(function(e){var r=n(t);ht(r.size),r.forEach(function(t,n){return e.set(n,t)})})}function pt(t){return!(!t||!t[Ln])}function ft(t,e){this.ownerID=t,this.entries=e}function dt(t,e,n){this.ownerID=t,this.bitmap=e,this.nodes=n}function mt(t,e,n){this.ownerID=t,this.count=e,this.nodes=n}function yt(t,e,n){this.ownerID=t,this.keyHash=e,this.entries=n}function vt(t,e,n){this.ownerID=t,this.keyHash=e,this.entry=n}function xt(t,e,n){this._type=e,this._reverse=n,this._stack=t._root&&Dt(t._root)}function gt(t,e){return A(t,e[0],e[1])}function Dt(t,e){return{node:t,index:0,__prev:e}}function Et(t,e,n,r){var i=Object.create(zn);return i.size=t,i._root=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function At(){return Jn||(Jn=Et(0))}function St(t,e,n){var r,i;if(t._root){var o=h(vn),s=h(xn);if(r=wt(t._root,t.__ownerID,0,void 0,e,n,o,s),!s.value)return t;i=t.size+(o.value?n===yn?-1:1:0)}else{if(n===yn)return t;i=1,r=new ft(t.__ownerID,[[e,n]])}return t.__ownerID?(t.size=i,t._root=r,t.__hash=void 0,t.__altered=!0,t):r?Et(i,r):At()}function wt(t,e,n,r,i,o,s,a){return t?t.update(e,n,r,i,o,s,a):o===yn?t:(l(a),l(s),new vt(e,r,[i,o]))}function Ct(t){return t.constructor===vt||t.constructor===yt}function _t(t,e,n,r,i){if(t.keyHash===r)return new yt(e,r,[t.entry,i]);var o,s=(0===n?t.keyHash:t.keyHash>>>n)&mn,a=(0===n?r:r>>>n)&mn;return new dt(e,1<<s|1<<a,s===a?[_t(t,e,n+fn,r,i)]:(o=new vt(e,r,i),s<a?[t,o]:[o,t]))}function bt(t,e,n,r){t||(t=new p);for(var i=new vt(t,ot(n),[n,r]),o=0;o<e.length;o++){var s=e[o];i=i.update(t,0,void 0,s[0],s[1])}return i}function Ft(t,e,n,r){for(var i=0,o=0,s=new Array(n),a=0,u=1,c=e.length;a<c;a++,u<<=1){var h=e[a];void 0!==h&&a!==r&&(i|=u,s[o++]=h)}return new dt(t,i,s)}function kt(t,e,n,r,i){for(var o=0,s=new Array(dn),a=0;0!==n;a++,n>>>=1)s[a]=1&n?e[o++]:void 0;return s[r]=i,new mt(t,o+1,s)}function It(t,e,r){for(var i=[],s=0;s<r.length;s++){var a=r[s],u=n(a);o(a)||(u=u.map(function(t){return K(t)})),i.push(u)}return Mt(t,e,i)}function Tt(t,e,n){return t&&t.mergeDeep&&o(e)?t.mergeDeep(e):H(t,e)?t:e}function Bt(t){return function(e,n,r){if(e&&e.mergeDeepWith&&o(n))return e.mergeDeepWith(t,n);var i=t(e,n,r);return H(e,i)?e:i}}function Mt(t,e,n){return n=n.filter(function(t){return 0!==t.size}),0===n.length?t:0!==t.size||t.__ownerID||1!==n.length?t.withMutations(function(t){for(var r=e?function(n,r){t.update(r,yn,function(t){return t===yn?n:e(t,n,r)})}:function(e,n){t.set(n,e)},i=0;i<n.length;i++)n[i].forEach(r)}):t.constructor(n[0])}function Pt(t,e,n,r){var i=t===yn,o=e.next();if(o.done){var s=i?n:t,a=r(s);return a===s?t:a}Z(i||t&&t.set,"invalid keyPath");var u=o.value,c=i?yn:t.get(u,yn),h=Pt(c,e,n,r);return h===c?t:h===yn?t.remove(u):(i?At():t).set(u,h)}function Nt(t){return t-=t>>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function Ot(t,e,n,r){var i=r?t:f(t);return i[e]=n,i}function Rt(t,e,n,r){var i=t.length+1;if(r&&e+1===i)return t[e]=n,t;for(var o=new Array(i),s=0,a=0;a<i;a++)a===e?(o[a]=n,s=-1):o[a]=t[a+s];return o}function Ut(t,e,n){var r=t.length-1;if(n&&e===r)return t.pop(),t;for(var i=new Array(r),o=0,s=0;s<r;s++)s===e&&(o=1),i[s]=t[s+o];return i}function jt(t){var e=qt();if(null===t||void 0===t)return e;if(Lt(t))return t;var n=r(t),i=n.size;return 0===i?e:(ht(i),i>0&&i<dn?Xt(0,i,fn,null,new zt(n.toArray())):e.withMutations(function(t){t.setSize(i),n.forEach(function(e,n){return t.set(n,e)})}))}function Lt(t){return!(!t||!t[Yn])}function zt(t,e){this.array=t,this.ownerID=e}function Jt(t,e){function n(t,e,n){return 0===e?r(t,n):i(t,e,n)}function r(t,n){var r=n===a?u&&u.array:t&&t.array,i=n>o?0:o-n,c=s-n;return c>dn&&(c=dn),function(){if(i===c)return Hn;var t=e?--c:i++;return r&&r[t]}}function i(t,r,i){var a,u=t&&t.array,c=i>o?0:o-i>>r,h=1+(s-i>>r);return h>dn&&(h=dn),function(){for(;;){if(a){var t=a();if(t!==Hn)return t;a=null}if(c===h)return Hn;var o=e?--h:c++;a=n(u&&u[o],r-fn,i+(o<<r))}}}var o=t._origin,s=t._capacity,a=$t(s),u=t._tail;return n(t._root,t._level,0)}function Xt(t,e,n,r,i,o,s){var a=Object.create(Wn);return a.size=e-t,a._origin=t,a._capacity=e,a._level=n,a._root=r,a._tail=i,a.__ownerID=o,a.__hash=s,a.__altered=!1,a}function qt(){return Gn||(Gn=Xt(0,0,fn))}function Kt(t,e,n){if((e=m(t,e))!==e)return t;if(e>=t.size||e<0)return t.withMutations(function(t){e<0?Ht(t,e).set(0,n):Ht(t,0,e+1).set(e,n)});e+=t._origin;var r=t._tail,i=t._root,o=h(xn);return e>=$t(t._capacity)?r=Yt(r,t.__ownerID,0,e,n,o):i=Yt(i,t.__ownerID,t._level,e,n,o),o.value?t.__ownerID?(t._root=i,t._tail=r,t.__hash=void 0,t.__altered=!0,t):Xt(t._origin,t._capacity,t._level,i,r):t}function Yt(t,e,n,r,i,o){var s=r>>>n&mn,a=t&&s<t.array.length;if(!a&&void 0===i)return t;var u;if(n>0){var c=t&&t.array[s],h=Yt(c,e,n-fn,r,i,o);return h===c?t:(u=Wt(t,e),u.array[s]=h,u)}return a&&t.array[s]===i?t:(l(o),u=Wt(t,e),void 0===i&&s===u.array.length-1?u.array.pop():u.array[s]=i,u)}function Wt(t,e){return e&&t&&e===t.ownerID?t:new zt(t?t.array.slice():[],e)}function Gt(t,e){if(e>=$t(t._capacity))return t._tail;if(e<1<<t._level+fn){for(var n=t._root,r=t._level;n&&r>0;)n=n.array[e>>>r&mn],r-=fn;return n}}function Ht(t,e,n){void 0!==e&&(e|=0),void 0!==n&&(n|=0);var r=t.__ownerID||new p,i=t._origin,o=t._capacity,s=i+e,a=void 0===n?o:n<0?o+n:i+n;if(s===i&&a===o)return t;if(s>=a)return t.clear();for(var u=t._level,c=t._root,h=0;s+h<0;)c=new zt(c&&c.array.length?[void 0,c]:[],r),u+=fn,h+=1<<u;h&&(s+=h,i+=h,a+=h,o+=h);for(var l=$t(o),f=$t(a);f>=1<<u+fn;)c=new zt(c&&c.array.length?[c]:[],r),u+=fn;var d=t._tail,m=f<l?Gt(t,a-1):f>l?new zt([],r):d;if(d&&f>l&&s<o&&d.array.length){c=Wt(c,r);for(var y=c,v=u;v>fn;v-=fn){var x=l>>>v&mn;y=y.array[x]=Wt(y.array[x],r)}y.array[l>>>fn&mn]=d}if(a<o&&(m=m&&m.removeAfter(r,0,a)),s>=f)s-=f,a-=f,u=fn,c=null,m=m&&m.removeBefore(r,0,s);else if(s>i||f<l){for(h=0;c;){var g=s>>>u&mn;if(g!==f>>>u&mn)break;g&&(h+=(1<<u)*g),u-=fn,c=c.array[g]}c&&s>i&&(c=c.removeBefore(r,u,s-h)),c&&f<l&&(c=c.removeAfter(r,u,f-h)),h&&(s-=h,a-=h)}return t.__ownerID?(t.size=a-s,t._origin=s,t._capacity=a,t._level=u,t._root=c,t._tail=m,t.__hash=void 0,t.__altered=!0,t):Xt(s,a,u,c,m)}function Vt(t,e,n){for(var i=[],s=0,a=0;a<n.length;a++){var u=n[a],c=r(u);c.size>s&&(s=c.size),o(u)||(c=c.map(function(t){return K(t)})),i.push(c)}return s>t.size&&(t=t.setSize(s)),Mt(t,e,i)}function $t(t){return t<dn?0:t-1>>>fn<<fn}function Zt(t){return null===t||void 0===t?ee():Qt(t)?t:ee().withMutations(function(e){var r=n(t);ht(r.size),r.forEach(function(t,n){return e.set(n,t)})})}function Qt(t){return pt(t)&&c(t)}function te(t,e,n,r){var i=Object.create(Zt.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=n,i.__hash=r,i}function ee(){return Vn||(Vn=te(At(),qt()))}function ne(t,e,n){var r,i,o=t._map,s=t._list,a=o.get(e),u=void 0!==a;if(n===yn){if(!u)return t;s.size>=dn&&s.size>=2*o.size?(i=s.filter(function(t,e){return void 0!==t&&a!==e}),r=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(r.__ownerID=i.__ownerID=t.__ownerID)):(r=o.remove(e),i=a===s.size-1?s.pop():s.set(a,void 0))}else if(u){if(n===s.get(a)[1])return t;r=o,i=s.set(a,[e,n])}else r=o.set(e,s.size),i=s.set(s.size,[e,n]);return t.__ownerID?(t.size=r.size,t._map=r,t._list=i,t.__hash=void 0,t):te(r,i)}function re(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function ie(t){this._iter=t,this.size=t.size}function oe(t){this._iter=t,this.size=t.size}function se(t){this._iter=t,this.size=t.size}function ae(t){var e=Fe(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=ke,e.__iterateUncached=function(e,n){var r=this;return t.__iterate(function(t,n){return!1!==e(n,t,r)},n)},e.__iteratorUncached=function(e,n){if(e===En){var r=t.__iterator(e,n);return new E(function(){var t=r.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===Dn?gn:Dn,n)},e}function ue(t,e,n){var r=Fe(t);return r.size=t.size,r.has=function(e){return t.has(e)},r.get=function(r,i){var o=t.get(r,yn);return o===yn?i:e.call(n,o,r,t)},r.__iterateUncached=function(r,i){var o=this;return t.__iterate(function(t,i,s){return!1!==r(e.call(n,t,i,s),i,o)},i)},r.__iteratorUncached=function(r,i){var o=t.__iterator(En,i);return new E(function(){var i=o.next();if(i.done)return i;var s=i.value,a=s[0];return A(r,a,e.call(n,s[1],a,t),i)})},r}function ce(t,e){var n=Fe(t);return n._iter=t,n.size=t.size,n.reverse=function(){return t},t.flip&&(n.flip=function(){var e=ae(t);return e.reverse=function(){return t.flip()},e}),n.get=function(n,r){return t.get(e?n:-1-n,r)},n.has=function(n){return t.has(e?n:-1-n)},n.includes=function(e){return t.includes(e)},n.cacheResult=ke,n.__iterate=function(e,n){var r=this;return t.__iterate(function(t,n){return e(t,n,r)},!n)},n.__iterator=function(e,n){return t.__iterator(e,!n)},n}function he(t,e,n,r){var i=Fe(t);return r&&(i.has=function(r){var i=t.get(r,yn);return i!==yn&&!!e.call(n,i,r,t)},i.get=function(r,i){var o=t.get(r,yn);return o!==yn&&e.call(n,o,r,t)?o:i}),i.__iterateUncached=function(i,o){var s=this,a=0;return t.__iterate(function(t,o,u){if(e.call(n,t,o,u))return a++,i(t,r?o:a-1,s)},o),a},i.__iteratorUncached=function(i,o){var s=t.__iterator(En,o),a=0;return new E(function(){for(;;){var o=s.next();if(o.done)return o;var u=o.value,c=u[0],h=u[1];if(e.call(n,h,c,t))return A(i,r?c:a++,h,o)}})},i}function le(t,e,n){var r=lt().asMutable();return t.__iterate(function(i,o){r.update(e.call(n,i,o,t),0,function(t){return t+1})}),r.asImmutable()}function pe(t,e,n){var r=s(t),i=(c(t)?Zt():lt()).asMutable();t.__iterate(function(o,s){i.update(e.call(n,o,s,t),function(t){return t=t||[],t.push(r?[s,o]:o),t})});var o=be(t);return i.map(function(e){return we(t,o(e))})}function fe(t,e,n,r){var i=t.size;if(void 0!==e&&(e|=0),void 0!==n&&(n===1/0?n=i:n|=0),v(e,n,i))return t;var o=x(e,i),s=g(n,i);if(o!==o||s!==s)return fe(t.toSeq().cacheResult(),e,n,r);var a,u=s-o;u===u&&(a=u<0?0:u);var c=Fe(t);return c.size=0===a?a:t.size&&a||void 0,!r&&R(t)&&a>=0&&(c.get=function(e,n){return e=m(this,e),e>=0&&e<a?t.get(e+o,n):n}),c.__iterateUncached=function(e,n){var i=this;if(0===a)return 0;if(n)return this.cacheResult().__iterate(e,n);var s=0,u=!0,c=0;return t.__iterate(function(t,n){if(!u||!(u=s++<o))return c++,!1!==e(t,r?n:c-1,i)&&c!==a}),c},c.__iteratorUncached=function(e,n){if(0!==a&&n)return this.cacheResult().__iterator(e,n);var i=0!==a&&t.__iterator(e,n),s=0,u=0;return new E(function(){for(;s++<o;)i.next();if(++u>a)return S();var t=i.next();return r||e===Dn?t:e===gn?A(e,u-1,void 0,t):A(e,u-1,t.value[1],t)})},c}function de(t,e,n){var r=Fe(t);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var s=0;return t.__iterate(function(t,i,a){return e.call(n,t,i,a)&&++s&&r(t,i,o)}),s},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var s=t.__iterator(En,i),a=!0;return new E(function(){if(!a)return S();var t=s.next();if(t.done)return t;var i=t.value,u=i[0],c=i[1];return e.call(n,c,u,o)?r===En?t:A(r,u,c,t):(a=!1,S())})},r}function me(t,e,n,r){var i=Fe(t);return i.__iterateUncached=function(i,o){var s=this;if(o)return this.cacheResult().__iterate(i,o);var a=!0,u=0;return t.__iterate(function(t,o,c){if(!a||!(a=e.call(n,t,o,c)))return u++,i(t,r?o:u-1,s)}),u},i.__iteratorUncached=function(i,o){var s=this;if(o)return this.cacheResult().__iterator(i,o);var a=t.__iterator(En,o),u=!0,c=0;return new E(function(){var t,o,h;do{if(t=a.next(),t.done)return r||i===Dn?t:i===gn?A(i,c++,void 0,t):A(i,c++,t.value[1],t);var l=t.value;o=l[0],h=l[1],u&&(u=e.call(n,h,o,s))}while(u);return i===En?t:A(i,o,h,t)})},i}function ye(t,e){var r=s(t),i=[t].concat(e).map(function(t){return o(t)?r&&(t=n(t)):t=r?j(t):L(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===i.length)return t;if(1===i.length){var u=i[0];if(u===t||r&&s(u)||a(t)&&a(u))return u}var c=new M(i);return r?c=c.toKeyedSeq():a(t)||(c=c.toSetSeq()),c=c.flatten(!0),c.size=i.reduce(function(t,e){if(void 0!==t){var n=e.size;if(void 0!==n)return t+n}},0),c}function ve(t,e,n){var r=Fe(t);return r.__iterateUncached=function(r,i){function s(t,c){var h=this;t.__iterate(function(t,i){return(!e||c<e)&&o(t)?s(t,c+1):!1===r(t,n?i:a++,h)&&(u=!0),!u},i)}var a=0,u=!1;return s(t,0),a},r.__iteratorUncached=function(r,i){var s=t.__iterator(r,i),a=[],u=0;return new E(function(){for(;s;){var t=s.next();if(!1===t.done){var c=t.value;if(r===En&&(c=c[1]),e&&!(a.length<e)||!o(c))return n?t:A(r,u++,c,t);a.push(s),s=c.__iterator(r,i)}else s=a.pop()}return S()})},r}function xe(t,e,n){var r=be(t);return t.toSeq().map(function(i,o){return r(e.call(n,i,o,t))}).flatten(!0)}function ge(t,e){var n=Fe(t);return n.size=t.size&&2*t.size-1,n.__iterateUncached=function(n,r){var i=this,o=0;return t.__iterate(function(t,r){return(!o||!1!==n(e,o++,i))&&!1!==n(t,o++,i)},r),o},n.__iteratorUncached=function(n,r){var i,o=t.__iterator(Dn,r),s=0;return new E(function(){return(!i||s%2)&&(i=o.next(),i.done)?i:s%2?A(n,s++,e):A(n,s++,i.value,i)})},n}function De(t,e,n){e||(e=Ie);var r=s(t),i=0,o=t.toSeq().map(function(e,r){return[r,e,i++,n?n(e,r,t):e]}).toArray();return o.sort(function(t,n){return e(t[3],n[3])||t[2]-n[2]}).forEach(r?function(t,e){o[e].length=2}:function(t,e){o[e]=t[1]}),r?I(o):a(t)?T(o):B(o)}function Ee(t,e,n){if(e||(e=Ie),n){var r=t.toSeq().map(function(e,r){return[e,n(e,r,t)]}).reduce(function(t,n){return Ae(e,t[1],n[1])?n:t});return r&&r[0]}return t.reduce(function(t,n){return Ae(e,t,n)?n:t})}function Ae(t,e,n){var r=t(n,e);return 0===r&&n!==e&&(void 0===n||null===n||n!==n)||r>0}function Se(t,n,r){var i=Fe(t);return i.size=new M(r).map(function(t){return t.size}).min(),i.__iterate=function(t,e){for(var n,r=this.__iterator(Dn,e),i=0;!(n=r.next()).done&&!1!==t(n.value,i++,this););return i},i.__iteratorUncached=function(t,i){var o=r.map(function(t){return t=e(t),_(i?t.reverse():t)}),s=0,a=!1;return new E(function(){var e;return a||(e=o.map(function(t){return t.next()}),a=e.some(function(t){return t.done})),a?S():A(t,s++,n.apply(null,e.map(function(t){return t.value})))})},i}function we(t,e){return R(t)?e:t.constructor(e)}function Ce(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function _e(t){return ht(t.size),d(t)}function be(t){return s(t)?n:a(t)?r:i}function Fe(t){return Object.create((s(t)?I:a(t)?T:B).prototype)}function ke(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):k.prototype.cacheResult.call(this)}function Ie(t,e){return t>e?1:t<e?-1:0}function Te(t){var n=_(t);if(!n){if(!F(t))throw new TypeError("Expected iterable or array-like: "+t);n=_(e(t))}return n}function Be(t,e){var n,r=function(o){if(o instanceof r)return o;if(!(this instanceof r))return new r(o);if(!n){n=!0;var s=Object.keys(t);Ne(i,s),i.size=s.length,i._name=e,i._keys=s,i._defaultValues=t}this._map=lt(o)},i=r.prototype=Object.create($n);return i.constructor=r,r}function Me(t,e,n){var r=Object.create(Object.getPrototypeOf(t));return r._map=e,r.__ownerID=n,r}function Pe(t){return t._name||t.constructor.name||"Record"}function Ne(t,e){try{e.forEach(Oe.bind(void 0,t))}catch(t){}}function Oe(t,e){Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){Z(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}function Re(t){return null===t||void 0===t?ze():Ue(t)&&!c(t)?t:ze().withMutations(function(e){var n=i(t);ht(n.size),n.forEach(function(t){return e.add(t)})})}function Ue(t){return!(!t||!t[Zn])}function je(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Le(t,e){var n=Object.create(Qn);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function ze(){return tr||(tr=Le(At()))}function Je(t){return null===t||void 0===t?Ke():Xe(t)?t:Ke().withMutations(function(e){var n=i(t);ht(n.size),n.forEach(function(t){return e.add(t)})})}function Xe(t){return Ue(t)&&c(t)}function qe(t,e){var n=Object.create(er);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function Ke(){return nr||(nr=qe(ee()))}function Ye(t){return null===t||void 0===t?He():We(t)?t:He().unshiftAll(t)}function We(t){return!(!t||!t[rr])}function Ge(t,e,n,r){var i=Object.create(ir);return i.size=t,i._head=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function He(){return or||(or=Ge(0))}function Ve(t,e){var n=function(n){t.prototype[n]=e[n]};return Object.keys(e).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(n),t}function $e(t,e){return e}function Ze(t,e){return[e,t]}function Qe(t){return function(){return!t.apply(this,arguments)}}function tn(t){return function(){return-t.apply(this,arguments)}}function en(t){return"string"==typeof t?JSON.stringify(t):String(t)}function nn(){return f(arguments)}function rn(t,e){return t<e?1:t>e?-1:0}function on(t){if(t.size===1/0)return 0;var e=c(t),n=s(t),r=e?1:0;return sn(t.__iterate(n?e?function(t,e){r=31*r+an(ot(t),ot(e))|0}:function(t,e){r=r+an(ot(t),ot(e))|0}:e?function(t){r=31*r+ot(t)|0}:function(t){r=r+ot(t)|0}),r)}function sn(t,e){return e=In(e,3432918353),e=In(e<<15|e>>>-15,461845907),e=In(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=In(e^e>>>16,2246822507),e=In(e^e>>>13,3266489909),e=it(e^e>>>16)}function an(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}var un=Array.prototype.slice;t(n,e),t(r,e),t(i,e),e.isIterable=o,e.isKeyed=s,e.isIndexed=a,e.isAssociative=u,e.isOrdered=c,e.Keyed=n,e.Indexed=r,e.Set=i;var cn="@@__IMMUTABLE_ITERABLE__@@",hn="@@__IMMUTABLE_KEYED__@@",ln="@@__IMMUTABLE_INDEXED__@@",pn="@@__IMMUTABLE_ORDERED__@@",fn=5,dn=1<<fn,mn=dn-1,yn={},vn={value:!1},xn={value:!1},gn=0,Dn=1,En=2,An="function"==typeof Symbol&&Symbol.iterator,Sn="@@iterator",wn=An||Sn;E.prototype.toString=function(){return"[Iterator]"},E.KEYS=gn,E.VALUES=Dn,E.ENTRIES=En,E.prototype.inspect=E.prototype.toSource=function(){return this.toString()},E.prototype[wn]=function(){return this},t(k,e),k.of=function(){return k(arguments)},k.prototype.toSeq=function(){return this},k.prototype.toString=function(){return this.__toString("Seq {","}")},k.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},k.prototype.__iterate=function(t,e){return X(this,t,e,!0)},k.prototype.__iterator=function(t,e){return q(this,t,e,!0)},t(I,k),I.prototype.toKeyedSeq=function(){return this},t(T,k),T.of=function(){return T(arguments)},T.prototype.toIndexedSeq=function(){return this},T.prototype.toString=function(){return this.__toString("Seq [","]")},T.prototype.__iterate=function(t,e){return X(this,t,e,!1)},T.prototype.__iterator=function(t,e){return q(this,t,e,!1)},t(B,k),B.of=function(){return B(arguments)},B.prototype.toSetSeq=function(){return this},k.isSeq=R,k.Keyed=I,k.Set=B,k.Indexed=T;var Cn="@@__IMMUTABLE_SEQ__@@";k.prototype[Cn]=!0,t(M,T),M.prototype.get=function(t,e){return this.has(t)?this._array[m(this,t)]:e},M.prototype.__iterate=function(t,e){for(var n=this._array,r=n.length-1,i=0;i<=r;i++)if(!1===t(n[e?r-i:i],i,this))return i+1;return i},M.prototype.__iterator=function(t,e){var n=this._array,r=n.length-1,i=0;return new E(function(){return i>r?S():A(t,i,n[e?r-i++:i++])})},t(P,I),P.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},P.prototype.has=function(t){return this._object.hasOwnProperty(t)},P.prototype.__iterate=function(t,e){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var s=r[e?i-o:o];if(!1===t(n[s],s,this))return o+1}return o},P.prototype.__iterator=function(t,e){var n=this._object,r=this._keys,i=r.length-1,o=0;return new E(function(){var s=r[e?i-o:o];return o++>i?S():A(t,s,n[s])})},P.prototype[pn]=!0,t(N,T),N.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var n=this._iterable,r=_(n),i=0;if(C(r))for(var o;!(o=r.next()).done&&!1!==t(o.value,i++,this););return i},N.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var n=this._iterable,r=_(n);if(!C(r))return new E(S);var i=0;return new E(function(){var e=r.next();return e.done?e:A(t,i++,e.value)})},t(O,T),O.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var n=this._iterator,r=this._iteratorCache,i=0;i<r.length;)if(!1===t(r[i],i++,this))return i;for(var o;!(o=n.next()).done;){var s=o.value;if(r[i]=s,!1===t(s,i++,this))break}return i},O.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var n=this._iterator,r=this._iteratorCache,i=0;return new E(function(){if(i>=r.length){var e=n.next();if(e.done)return e;r[i]=e.value}return A(t,i,r[i++])})};var _n;t($,T),$.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},$.prototype.get=function(t,e){return this.has(t)?this._value:e},$.prototype.includes=function(t){return H(this._value,t)},$.prototype.slice=function(t,e){var n=this.size;return v(t,e,n)?this:new $(this._value,g(e,n)-x(t,n))},$.prototype.reverse=function(){return this},$.prototype.indexOf=function(t){return H(this._value,t)?0:-1},$.prototype.lastIndexOf=function(t){return H(this._value,t)?this.size:-1},$.prototype.__iterate=function(t,e){for(var n=0;n<this.size;n++)if(!1===t(this._value,n,this))return n+1;return n},$.prototype.__iterator=function(t,e){var n=this,r=0;return new E(function(){return r<n.size?A(t,r++,n._value):S()})},$.prototype.equals=function(t){return t instanceof $?H(this._value,t._value):V(t)};var bn;t(Q,T),Q.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},Q.prototype.get=function(t,e){return this.has(t)?this._start+m(this,t)*this._step:e},Q.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e<this.size&&e===Math.floor(e)},Q.prototype.slice=function(t,e){return v(t,e,this.size)?this:(t=x(t,this.size),e=g(e,this.size),e<=t?new Q(0,0):new Q(this.get(t,this._end),this.get(e,this._end),this._step))},Q.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step==0){var n=e/this._step;if(n>=0&&n<this.size)return n}return-1},Q.prototype.lastIndexOf=function(t){return this.indexOf(t)},Q.prototype.__iterate=function(t,e){for(var n=this.size-1,r=this._step,i=e?this._start+n*r:this._start,o=0;o<=n;o++){if(!1===t(i,o,this))return o+1;i+=e?-r:r}return o},Q.prototype.__iterator=function(t,e){var n=this.size-1,r=this._step,i=e?this._start+n*r:this._start,o=0;return new E(function(){var s=i;return i+=e?-r:r,o>n?S():A(t,o++,s)})},Q.prototype.equals=function(t){return t instanceof Q?this._start===t._start&&this._end===t._end&&this._step===t._step:V(this,t)};var Fn;t(tt,e),t(et,tt),t(nt,tt),t(rt,tt),tt.Keyed=et,tt.Indexed=nt,tt.Set=rt;var kn,In="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){t|=0,e|=0;var n=65535&t,r=65535&e;return n*r+((t>>>16)*r+n*(e>>>16)<<16>>>0)|0},Tn=Object.isExtensible,Bn=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),Mn="function"==typeof WeakMap;Mn&&(kn=new WeakMap);var Pn=0,Nn="__immutablehash__";"function"==typeof Symbol&&(Nn=Symbol(Nn));var On=16,Rn=255,Un=0,jn={};t(lt,et),lt.of=function(){var t=un.call(arguments,0);return At().withMutations(function(e){for(var n=0;n<t.length;n+=2){if(n+1>=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}})},lt.prototype.toString=function(){return this.__toString("Map {","}")},lt.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},lt.prototype.set=function(t,e){return St(this,t,e)},lt.prototype.setIn=function(t,e){return this.updateIn(t,yn,function(){return e})},lt.prototype.remove=function(t){return St(this,t,yn)},lt.prototype.deleteIn=function(t){return this.updateIn(t,function(){return yn})},lt.prototype.update=function(t,e,n){return 1===arguments.length?t(this):this.updateIn([t],e,n)},lt.prototype.updateIn=function(t,e,n){n||(n=e,e=void 0);var r=Pt(this,Te(t),e,n);return r===yn?void 0:r},lt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):At()},lt.prototype.merge=function(){return It(this,void 0,arguments)},lt.prototype.mergeWith=function(t){return It(this,t,un.call(arguments,1))},lt.prototype.mergeIn=function(t){var e=un.call(arguments,1);return this.updateIn(t,At(),function(t){return"function"==typeof t.merge?t.merge.apply(t,e):e[e.length-1]})},lt.prototype.mergeDeep=function(){return It(this,Tt,arguments)},lt.prototype.mergeDeepWith=function(t){var e=un.call(arguments,1);return It(this,Bt(t),e)},lt.prototype.mergeDeepIn=function(t){var e=un.call(arguments,1);return this.updateIn(t,At(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,e):e[e.length-1]})},lt.prototype.sort=function(t){return Zt(De(this,t))},lt.prototype.sortBy=function(t,e){return Zt(De(this,e,t))},lt.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},lt.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new p)},lt.prototype.asImmutable=function(){return this.__ensureOwner()},lt.prototype.wasAltered=function(){return this.__altered},lt.prototype.__iterator=function(t,e){return new xt(this,t,e)},lt.prototype.__iterate=function(t,e){var n=this,r=0;return this._root&&this._root.iterate(function(e){return r++,t(e[1],e[0],n)},e),r},lt.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Et(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},lt.isMap=pt;var Ln="@@__IMMUTABLE_MAP__@@",zn=lt.prototype;zn[Ln]=!0,zn.delete=zn.remove,zn.removeIn=zn.deleteIn,ft.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,s=i.length;o<s;o++)if(H(n,i[o][0]))return i[o][1];return r},ft.prototype.update=function(t,e,n,r,i,o,s){for(var a=i===yn,u=this.entries,c=0,h=u.length;c<h&&!H(r,u[c][0]);c++);var p=c<h;if(p?u[c][1]===i:a)return this;if(l(s),(a||!p)&&l(o),!a||1!==u.length){if(!p&&!a&&u.length>=Xn)return bt(t,u,r,i);var d=t&&t===this.ownerID,m=d?u:f(u);return p?a?c===h-1?m.pop():m[c]=m.pop():m[c]=[r,i]:m.push([r,i]),d?(this.entries=m,this):new ft(t,m)}},dt.prototype.get=function(t,e,n,r){void 0===e&&(e=ot(n));var i=1<<((0===t?e:e>>>t)&mn),o=this.bitmap;return 0==(o&i)?r:this.nodes[Nt(o&i-1)].get(t+fn,e,n,r)},dt.prototype.update=function(t,e,n,r,i,o,s){void 0===n&&(n=ot(r));var a=(0===e?n:n>>>e)&mn,u=1<<a,c=this.bitmap,h=0!=(c&u);if(!h&&i===yn)return this;var l=Nt(c&u-1),p=this.nodes,f=h?p[l]:void 0,d=wt(f,t,e+fn,n,r,i,o,s);if(d===f)return this;if(!h&&d&&p.length>=qn)return kt(t,p,c,a,d);if(h&&!d&&2===p.length&&Ct(p[1^l]))return p[1^l];if(h&&d&&1===p.length&&Ct(d))return d;var m=t&&t===this.ownerID,y=h?d?c:c^u:c|u,v=h?d?Ot(p,l,d,m):Ut(p,l,m):Rt(p,l,d,m);return m?(this.bitmap=y,this.nodes=v,this):new dt(t,y,v)},mt.prototype.get=function(t,e,n,r){void 0===e&&(e=ot(n));var i=(0===t?e:e>>>t)&mn,o=this.nodes[i];return o?o.get(t+fn,e,n,r):r},mt.prototype.update=function(t,e,n,r,i,o,s){void 0===n&&(n=ot(r));var a=(0===e?n:n>>>e)&mn,u=i===yn,c=this.nodes,h=c[a];if(u&&!h)return this;var l=wt(h,t,e+fn,n,r,i,o,s);if(l===h)return this;var p=this.count;if(h){if(!l&&--p<Kn)return Ft(t,c,p,a)}else p++;var f=t&&t===this.ownerID,d=Ot(c,a,l,f);return f?(this.count=p,this.nodes=d,this):new mt(t,p,d)},yt.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,s=i.length;o<s;o++)if(H(n,i[o][0]))return i[o][1];return r},yt.prototype.update=function(t,e,n,r,i,o,s){void 0===n&&(n=ot(r));var a=i===yn;if(n!==this.keyHash)return a?this:(l(s),l(o),_t(this,t,e,n,[r,i]));for(var u=this.entries,c=0,h=u.length;c<h&&!H(r,u[c][0]);c++);var p=c<h;if(p?u[c][1]===i:a)return this;if(l(s),(a||!p)&&l(o),a&&2===h)return new vt(t,this.keyHash,u[1^c]);var d=t&&t===this.ownerID,m=d?u:f(u);return p?a?c===h-1?m.pop():m[c]=m.pop():m[c]=[r,i]:m.push([r,i]),d?(this.entries=m,this):new yt(t,this.keyHash,m)},vt.prototype.get=function(t,e,n,r){return H(n,this.entry[0])?this.entry[1]:r},vt.prototype.update=function(t,e,n,r,i,o,s){var a=i===yn,u=H(r,this.entry[0]);return(u?i===this.entry[1]:a)?this:(l(s),a?void l(o):u?t&&t===this.ownerID?(this.entry[1]=i,this):new vt(t,this.keyHash,[r,i]):(l(o),_t(this,t,e,ot(r),[r,i])))},ft.prototype.iterate=yt.prototype.iterate=function(t,e){for(var n=this.entries,r=0,i=n.length-1;r<=i;r++)if(!1===t(n[e?i-r:r]))return!1},dt.prototype.iterate=mt.prototype.iterate=function(t,e){for(var n=this.nodes,r=0,i=n.length-1;r<=i;r++){var o=n[e?i-r:r];if(o&&!1===o.iterate(t,e))return!1}},vt.prototype.iterate=function(t,e){return t(this.entry)},t(xt,E),xt.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var n,r=e.node,i=e.index++;if(r.entry){if(0===i)return gt(t,r.entry)}else if(r.entries){if(n=r.entries.length-1,i<=n)return gt(t,r.entries[this._reverse?n-i:i])}else if(n=r.nodes.length-1,i<=n){var o=r.nodes[this._reverse?n-i:i];if(o){if(o.entry)return gt(t,o.entry);e=this._stack=Dt(o,e)}continue}e=this._stack=this._stack.__prev}return S()};var Jn,Xn=dn/4,qn=dn/2,Kn=dn/4;t(jt,nt),jt.of=function(){return this(arguments)},jt.prototype.toString=function(){return this.__toString("List [","]")},jt.prototype.get=function(t,e){if((t=m(this,t))>=0&&t<this.size){t+=this._origin;var n=Gt(this,t);return n&&n.array[t&mn]}return e},jt.prototype.set=function(t,e){return Kt(this,t,e)},jt.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},jt.prototype.insert=function(t,e){return this.splice(t,0,e)},jt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=fn,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):qt()},jt.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations(function(n){Ht(n,0,e+t.length);for(var r=0;r<t.length;r++)n.set(e+r,t[r])})},jt.prototype.pop=function(){return Ht(this,0,-1)},jt.prototype.unshift=function(){var t=arguments;return this.withMutations(function(e){Ht(e,-t.length);for(var n=0;n<t.length;n++)e.set(n,t[n])})},jt.prototype.shift=function(){return Ht(this,1)},jt.prototype.merge=function(){return Vt(this,void 0,arguments)},jt.prototype.mergeWith=function(t){return Vt(this,t,un.call(arguments,1))},jt.prototype.mergeDeep=function(){return Vt(this,Tt,arguments)},jt.prototype.mergeDeepWith=function(t){var e=un.call(arguments,1);return Vt(this,Bt(t),e)},jt.prototype.setSize=function(t){return Ht(this,0,t)},jt.prototype.slice=function(t,e){var n=this.size;return v(t,e,n)?this:Ht(this,x(t,n),g(e,n))},jt.prototype.__iterator=function(t,e){var n=0,r=Jt(this,e);return new E(function(){var e=r();return e===Hn?S():A(t,n++,e)})},jt.prototype.__iterate=function(t,e){for(var n,r=0,i=Jt(this,e);(n=i())!==Hn&&!1!==t(n,r++,this););return r},jt.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Xt(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)},jt.isList=Lt;var Yn="@@__IMMUTABLE_LIST__@@",Wn=jt.prototype;Wn[Yn]=!0,Wn.delete=Wn.remove,Wn.setIn=zn.setIn,Wn.deleteIn=Wn.removeIn=zn.removeIn,Wn.update=zn.update,Wn.updateIn=zn.updateIn,Wn.mergeIn=zn.mergeIn,Wn.mergeDeepIn=zn.mergeDeepIn,Wn.withMutations=zn.withMutations,Wn.asMutable=zn.asMutable,Wn.asImmutable=zn.asImmutable,Wn.wasAltered=zn.wasAltered,zt.prototype.removeBefore=function(t,e,n){if(n===e?1<<e:0===this.array.length)return this;var r=n>>>e&mn;if(r>=this.array.length)return new zt([],t);var i,o=0===r;if(e>0){var s=this.array[r];if((i=s&&s.removeBefore(t,e-fn,n))===s&&o)return this}if(o&&!i)return this;var a=Wt(this,t);if(!o)for(var u=0;u<r;u++)a.array[u]=void 0;return i&&(a.array[r]=i),a},zt.prototype.removeAfter=function(t,e,n){if(n===(e?1<<e:0)||0===this.array.length)return this;var r=n-1>>>e&mn;if(r>=this.array.length)return this;var i;if(e>0){var o=this.array[r];if((i=o&&o.removeAfter(t,e-fn,n))===o&&r===this.array.length-1)return this}var s=Wt(this,t);return s.array.splice(r+1),i&&(s.array[r]=i),s};var Gn,Hn={};t(Zt,lt),Zt.of=function(){return this(arguments)},Zt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Zt.prototype.get=function(t,e){var n=this._map.get(t);return void 0!==n?this._list.get(n)[1]:e},Zt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):ee()},Zt.prototype.set=function(t,e){return ne(this,t,e)},Zt.prototype.remove=function(t){return ne(this,t,yn)},Zt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Zt.prototype.__iterate=function(t,e){var n=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],n)},e)},Zt.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},Zt.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),n=this._list.__ensureOwner(t);return t?te(e,n,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=n,this)},Zt.isOrderedMap=Qt,Zt.prototype[pn]=!0,Zt.prototype.delete=Zt.prototype.remove;var Vn;t(re,I),re.prototype.get=function(t,e){return this._iter.get(t,e)},re.prototype.has=function(t){return this._iter.has(t)},re.prototype.valueSeq=function(){return this._iter.valueSeq()},re.prototype.reverse=function(){var t=this,e=ce(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},re.prototype.map=function(t,e){var n=this,r=ue(this,t,e);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(t,e)}),r},re.prototype.__iterate=function(t,e){var n,r=this;return this._iter.__iterate(this._useKeys?function(e,n){return t(e,n,r)}:(n=e?_e(this):0,function(i){return t(i,e?--n:n++,r)}),e)},re.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var n=this._iter.__iterator(Dn,e),r=e?_e(this):0;return new E(function(){var i=n.next();return i.done?i:A(t,e?--r:r++,i.value,i)})},re.prototype[pn]=!0,t(ie,T),ie.prototype.includes=function(t){return this._iter.includes(t)},ie.prototype.__iterate=function(t,e){var n=this,r=0;return this._iter.__iterate(function(e){return t(e,r++,n)},e)},ie.prototype.__iterator=function(t,e){var n=this._iter.__iterator(Dn,e),r=0;return new E(function(){var e=n.next();return e.done?e:A(t,r++,e.value,e)})},t(oe,B),oe.prototype.has=function(t){return this._iter.includes(t)},oe.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){return t(e,e,n)},e)},oe.prototype.__iterator=function(t,e){var n=this._iter.__iterator(Dn,e);return new E(function(){var e=n.next();return e.done?e:A(t,e.value,e.value,e)})},t(se,I),se.prototype.entrySeq=function(){return this._iter.toSeq()},se.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){if(e){Ce(e);var r=o(e);return t(r?e.get(1):e[1],r?e.get(0):e[0],n)}},e)},se.prototype.__iterator=function(t,e){var n=this._iter.__iterator(Dn,e);return new E(function(){for(;;){var e=n.next();if(e.done)return e;var r=e.value;if(r){Ce(r);var i=o(r);return A(t,i?r.get(0):r[0],i?r.get(1):r[1],e)}}})},ie.prototype.cacheResult=re.prototype.cacheResult=oe.prototype.cacheResult=se.prototype.cacheResult=ke,t(Be,et),Be.prototype.toString=function(){return this.__toString(Pe(this)+" {","}")},Be.prototype.has=function(t){return this._defaultValues.hasOwnProperty(t)},Be.prototype.get=function(t,e){if(!this.has(t))return e;var n=this._defaultValues[t];return this._map?this._map.get(t,n):n},Be.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=this.constructor;return t._empty||(t._empty=Me(this,At()))},Be.prototype.set=function(t,e){if(!this.has(t))throw new Error('Cannot set unknown key "'+t+'" on '+Pe(this));if(this._map&&!this._map.has(t)){if(e===this._defaultValues[t])return this}var n=this._map&&this._map.set(t,e);return this.__ownerID||n===this._map?this:Me(this,n)},Be.prototype.remove=function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:Me(this,e)},Be.prototype.wasAltered=function(){return this._map.wasAltered()},Be.prototype.__iterator=function(t,e){var r=this;return n(this._defaultValues).map(function(t,e){return r.get(e)}).__iterator(t,e)},Be.prototype.__iterate=function(t,e){var r=this;return n(this._defaultValues).map(function(t,e){return r.get(e)}).__iterate(t,e)},Be.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?Me(this,e,t):(this.__ownerID=t,this._map=e,this)};var $n=Be.prototype;$n.delete=$n.remove,$n.deleteIn=$n.removeIn=zn.removeIn,$n.merge=zn.merge,$n.mergeWith=zn.mergeWith,$n.mergeIn=zn.mergeIn,$n.mergeDeep=zn.mergeDeep,$n.mergeDeepWith=zn.mergeDeepWith,$n.mergeDeepIn=zn.mergeDeepIn,$n.setIn=zn.setIn,$n.update=zn.update,$n.updateIn=zn.updateIn,$n.withMutations=zn.withMutations,$n.asMutable=zn.asMutable,$n.asImmutable=zn.asImmutable,t(Re,rt),Re.of=function(){return this(arguments)},Re.fromKeys=function(t){return this(n(t).keySeq())},Re.prototype.toString=function(){return this.__toString("Set {","}")},Re.prototype.has=function(t){return this._map.has(t)},Re.prototype.add=function(t){return je(this,this._map.set(t,!0))},Re.prototype.remove=function(t){return je(this,this._map.remove(t))},Re.prototype.clear=function(){return je(this,this._map.clear())},Re.prototype.union=function(){var t=un.call(arguments,0);return t=t.filter(function(t){return 0!==t.size}),0===t.length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(e){for(var n=0;n<t.length;n++)i(t[n]).forEach(function(t){return e.add(t)})}):this.constructor(t[0])},Re.prototype.intersect=function(){var t=un.call(arguments,0);if(0===t.length)return this;t=t.map(function(t){return i(t)});var e=this;return this.withMutations(function(n){e.forEach(function(e){t.every(function(t){return t.includes(e)})||n.remove(e)})})},Re.prototype.subtract=function(){var t=un.call(arguments,0);if(0===t.length)return this;t=t.map(function(t){return i(t)});var e=this;return this.withMutations(function(n){e.forEach(function(e){t.some(function(t){return t.includes(e)})&&n.remove(e)})})},Re.prototype.merge=function(){return this.union.apply(this,arguments)},Re.prototype.mergeWith=function(t){var e=un.call(arguments,1);return this.union.apply(this,e)},Re.prototype.sort=function(t){return Je(De(this,t))},Re.prototype.sortBy=function(t,e){return Je(De(this,e,t))},Re.prototype.wasAltered=function(){return this._map.wasAltered()},Re.prototype.__iterate=function(t,e){var n=this;return this._map.__iterate(function(e,r){return t(r,r,n)},e)},Re.prototype.__iterator=function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},Re.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):(this.__ownerID=t,this._map=e,this)},Re.isSet=Ue;var Zn="@@__IMMUTABLE_SET__@@",Qn=Re.prototype;Qn[Zn]=!0,Qn.delete=Qn.remove,Qn.mergeDeep=Qn.merge,Qn.mergeDeepWith=Qn.mergeWith,Qn.withMutations=zn.withMutations,Qn.asMutable=zn.asMutable,Qn.asImmutable=zn.asImmutable,Qn.__empty=ze,Qn.__make=Le;var tr;t(Je,Re),Je.of=function(){return this(arguments)},Je.fromKeys=function(t){return this(n(t).keySeq())},Je.prototype.toString=function(){return this.__toString("OrderedSet {","}")},Je.isOrderedSet=Xe;var er=Je.prototype;er[pn]=!0,er.__empty=Ke,er.__make=qe;var nr;t(Ye,nt),Ye.of=function(){return this(arguments)},Ye.prototype.toString=function(){return this.__toString("Stack [","]")},Ye.prototype.get=function(t,e){var n=this._head;for(t=m(this,t);n&&t--;)n=n.next;return n?n.value:e},Ye.prototype.peek=function(){return this._head&&this._head.value},Ye.prototype.push=function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,n=arguments.length-1;n>=0;n--)e={value:arguments[n],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):Ge(t,e)},Ye.prototype.pushAll=function(t){if(t=r(t),0===t.size)return this;ht(t.size);var e=this.size,n=this._head;return t.reverse().forEach(function(t){e++,n={value:t,next:n}}),this.__ownerID?(this.size=e,this._head=n,this.__hash=void 0,this.__altered=!0,this):Ge(e,n)},Ye.prototype.pop=function(){return this.slice(1)},Ye.prototype.unshift=function(){return this.push.apply(this,arguments)},Ye.prototype.unshiftAll=function(t){return this.pushAll(t)},Ye.prototype.shift=function(){return this.pop.apply(this,arguments)},Ye.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):He()},Ye.prototype.slice=function(t,e){if(v(t,e,this.size))return this;var n=x(t,this.size);if(g(e,this.size)!==this.size)return nt.prototype.slice.call(this,t,e);for(var r=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):Ge(r,i)},Ye.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ge(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Ye.prototype.__iterate=function(t,e){if(e)return this.reverse().__iterate(t);for(var n=0,r=this._head;r&&!1!==t(r.value,n++,this);)r=r.next;return n},Ye.prototype.__iterator=function(t,e){if(e)return this.reverse().__iterator(t);var n=0,r=this._head;return new E(function(){if(r){var e=r.value;return r=r.next,A(t,n++,e)}return S()})},Ye.isStack=We;var rr="@@__IMMUTABLE_STACK__@@",ir=Ye.prototype;ir[rr]=!0,ir.withMutations=zn.withMutations,ir.asMutable=zn.asMutable,ir.asImmutable=zn.asImmutable,ir.wasAltered=zn.wasAltered;var or;e.Iterator=E,Ve(e,{toArray:function(){ht(this.size);var t=new Array(this.size||0);return this.valueSeq().__iterate(function(e,n){t[n]=e}),t},toIndexedSeq:function(){return new ie(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS()},toJSON:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJSON?t.toJSON():t}).__toJS()},toKeyedSeq:function(){return new re(this,!0)},toMap:function(){return lt(this.toKeyedSeq())},toObject:function(){ht(this.size);var t={};return this.__iterate(function(e,n){t[n]=e}),t},toOrderedMap:function(){return Zt(this.toKeyedSeq())},toOrderedSet:function(){return Je(s(this)?this.valueSeq():this)},toSet:function(){return Re(s(this)?this.valueSeq():this)},toSetSeq:function(){return new oe(this)},toSeq:function(){return a(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Ye(s(this)?this.valueSeq():this)},toList:function(){return jt(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){return we(this,ye(this,un.call(arguments,0)))},includes:function(t){return this.some(function(e){return H(e,t)})},entries:function(){return this.__iterator(En)},every:function(t,e){ht(this.size);var n=!0;return this.__iterate(function(r,i,o){if(!t.call(e,r,i,o))return n=!1,!1}),n},filter:function(t,e){return we(this,he(this,t,e,!0))},find:function(t,e,n){var r=this.findEntry(t,e);return r?r[1]:n},forEach:function(t,e){return ht(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){ht(this.size),t=void 0!==t?""+t:",";var e="",n=!0;return this.__iterate(function(r){n?n=!1:e+=t,e+=null!==r&&void 0!==r?r.toString():""}),e},keys:function(){return this.__iterator(gn)},map:function(t,e){return we(this,ue(this,t,e))},reduce:function(t,e,n){ht(this.size);var r,i;return arguments.length<2?i=!0:r=e,this.__iterate(function(e,o,s){i?(i=!1,r=e):r=t.call(n,r,e,o,s)}),r},reduceRight:function(t,e,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return we(this,ce(this,!0))},slice:function(t,e){return we(this,fe(this,t,e,!0))},some:function(t,e){return!this.every(Qe(t),e)},sort:function(t){return we(this,De(this,t))},values:function(){return this.__iterator(Dn)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(t,e){return d(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return le(this,t,e)},equals:function(t){return V(this,t)},entrySeq:function(){var t=this;if(t._cache)return new M(t._cache);var e=t.toSeq().map(Ze).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(Qe(t),e)},findEntry:function(t,e,n){var r=n;return this.__iterate(function(n,i,o){if(t.call(e,n,i,o))return r=[i,n],!1}),r},findKey:function(t,e){var n=this.findEntry(t,e);return n&&n[0]},findLast:function(t,e,n){return this.toKeyedSeq().reverse().find(t,e,n)},findLastEntry:function(t,e,n){return this.toKeyedSeq().reverse().findEntry(t,e,n)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(){return this.find(y)},flatMap:function(t,e){return we(this,xe(this,t,e))},flatten:function(t){return we(this,ve(this,t,!0))},fromEntrySeq:function(){return new se(this)},get:function(t,e){return this.find(function(e,n){return H(n,t)},void 0,e)},getIn:function(t,e){for(var n,r=this,i=Te(t);!(n=i.next()).done;){var o=n.value;if((r=r&&r.get?r.get(o,yn):yn)===yn)return e}return r},groupBy:function(t,e){return pe(this,t,e)},has:function(t){return this.get(t,yn)!==yn},hasIn:function(t){return this.getIn(t,yn)!==yn},isSubset:function(t){return t="function"==typeof t.includes?t:e(t),this.every(function(e){return t.includes(e)})},isSuperset:function(t){return t="function"==typeof t.isSubset?t:e(t),t.isSubset(this)},keyOf:function(t){return this.findKey(function(e){return H(e,t)})},keySeq:function(){return this.toSeq().map($e).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return Ee(this,t)},maxBy:function(t,e){return Ee(this,e,t)},min:function(t){return Ee(this,t?tn(t):rn)},minBy:function(t,e){return Ee(this,e?tn(e):rn,t)},rest:function(){return this.slice(1)},skip:function(t){return this.slice(Math.max(0,t))},skipLast:function(t){return we(this,this.toSeq().reverse().skip(t).reverse())},skipWhile:function(t,e){return we(this,me(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(Qe(t),e)},sortBy:function(t,e){return we(this,De(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return we(this,this.toSeq().reverse().take(t).reverse())},takeWhile:function(t,e){return we(this,de(this,t,e))},takeUntil:function(t,e){return this.takeWhile(Qe(t),e)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=on(this))}});var sr=e.prototype;sr[cn]=!0,sr[wn]=sr.values,sr.__toJS=sr.toArray,sr.__toStringMapper=en,sr.inspect=sr.toSource=function(){return this.toString()},sr.chain=sr.flatMap,sr.contains=sr.includes,Ve(n,{flip:function(){return we(this,ae(this))},mapEntries:function(t,e){var n=this,r=0;return we(this,this.toSeq().map(function(i,o){return t.call(e,[o,i],r++,n)}).fromEntrySeq())},mapKeys:function(t,e){var n=this;return we(this,this.toSeq().flip().map(function(r,i){return t.call(e,r,i,n)}).flip())}});var ar=n.prototype;return ar[hn]=!0,ar[wn]=sr.entries,ar.__toJS=sr.toObject,ar.__toStringMapper=function(t,e){return JSON.stringify(e)+": "+en(t)},Ve(r,{toKeyedSeq:function(){return new re(this,!1)},filter:function(t,e){return we(this,he(this,t,e,!1))},findIndex:function(t,e){var n=this.findEntry(t,e);return n?n[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return we(this,ce(this,!1))},slice:function(t,e){return we(this,fe(this,t,e,!1))},splice:function(t,e){var n=arguments.length;if(e=Math.max(0|e,0),0===n||2===n&&!e)return this;t=x(t,t<0?this.count():this.size);var r=this.slice(0,t);return we(this,1===n?r:r.concat(f(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var n=this.findLastEntry(t,e);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(t){return we(this,ve(this,t,!1))},get:function(t,e){return t=m(this,t),t<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find(function(e,n){return n===t},void 0,e)},has:function(t){return(t=m(this,t))>=0&&(void 0!==this.size?this.size===1/0||t<this.size:-1!==this.indexOf(t))},interpose:function(t){return we(this,ge(this,t))},interleave:function(){var t=[this].concat(f(arguments)),e=Se(this.toSeq(),T.of,t),n=e.flatten(!0);return e.size&&(n.size=e.size*t.length),we(this,n)},keySeq:function(){return Q(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(t,e){return we(this,me(this,t,e,!1))},zip:function(){return we(this,Se(this,nn,[this].concat(f(arguments))))},zipWith:function(t){var e=f(arguments);return e[0]=this,we(this,Se(this,t,e))}}),r.prototype[ln]=!0,r.prototype[pn]=!0,Ve(i,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}}),i.prototype.has=sr.includes,i.prototype.contains=i.prototype.includes,Ve(I,n.prototype),Ve(T,r.prototype),Ve(B,i.prototype),Ve(et,n.prototype),Ve(nt,r.prototype),Ve(rt,i.prototype),{Iterable:e,Seq:k,Collection:tt,Map:lt,OrderedMap:Zt,List:jt,Stack:Ye,Set:Re,OrderedSet:Je,Record:Be,Range:Q,Repeat:$,is:H,fromJS:K}})},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";var r=n(236);t.exports=r},function(t,e,n){"use strict";function r(t){return function(){throw new Error("Function "+t+" is deprecated and cannot be used.")}}var i=n(238),o=n(237);t.exports.Type=n(0),t.exports.Schema=n(24),t.exports.FAILSAFE_SCHEMA=n(71),t.exports.JSON_SCHEMA=n(111),t.exports.CORE_SCHEMA=n(110),t.exports.DEFAULT_SAFE_SCHEMA=n(34),t.exports.DEFAULT_FULL_SCHEMA=n(47),t.exports.load=i.load,t.exports.loadAll=i.loadAll,t.exports.safeLoad=i.safeLoad,t.exports.safeLoadAll=i.safeLoadAll,t.exports.dump=o.dump,t.exports.safeDump=o.safeDump,t.exports.YAMLException=n(33),t.exports.MINIMAL_SCHEMA=n(71),t.exports.SAFE_SCHEMA=n(34),t.exports.DEFAULT_SCHEMA=n(47),t.exports.scan=r("scan"),t.exports.parse=r("parse"),t.exports.compose=r("compose"),t.exports.addConstructor=r("addConstructor")},function(t,e,n){"use strict";function r(t,e){var n,r,i,o,s,a,u;if(null===e)return{};for(n={},r=Object.keys(e),i=0,o=r.length;i<o;i+=1)s=r[i],a=String(e[s]),"!!"===s.slice(0,2)&&(s="tag:yaml.org,2002:"+s.slice(2)),u=t.compiledTypeMap.fallback[s],u&&N.call(u.styleAliases,a)&&(a=u.styleAliases[a]),n[s]=a;return n}function i(t){var e,n,r;if(e=t.toString(16).toUpperCase(),t<=255)n="x",r=2;else if(t<=65535)n="u",r=4;else{if(!(t<=4294967295))throw new T("code point within a string may not be greater than 0xFFFFFFFF");n="U",r=8}return"\\"+n+I.repeat("0",r-e.length)+e}function o(t){this.schema=t.schema||B,this.indent=Math.max(1,t.indent||2),this.skipInvalid=t.skipInvalid||!1,this.flowLevel=I.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=r(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function s(t,e){for(var n,r=I.repeat(" ",e),i=0,o=-1,s="",a=t.length;i<a;)o=t.indexOf("\n",i),-1===o?(n=t.slice(i),i=a):(n=t.slice(i,o+1),i=o+1),n.length&&"\n"!==n&&(s+=r),s+=n;return s}function a(t,e){return"\n"+I.repeat(" ",t.indent*e)}function u(t,e){var n,r,i;for(n=0,r=t.implicitTypes.length;n<r;n+=1)if(i=t.implicitTypes[n],i.resolve(e))return!0;return!1}function c(t){return t===U||t===O}function h(t){return 32<=t&&t<=126||161<=t&&t<=55295&&8232!==t&&8233!==t||57344<=t&&t<=65533&&65279!==t||65536<=t&&t<=1114111}function l(t){return h(t)&&65279!==t&&t!==Y&&t!==Z&&t!==Q&&t!==et&&t!==rt&&t!==G&&t!==z}function p(t){return h(t)&&65279!==t&&!c(t)&&t!==W&&t!==V&&t!==G&&t!==Y&&t!==Z&&t!==Q&&t!==et&&t!==rt&&t!==z&&t!==X&&t!==K&&t!==j&&t!==nt&&t!==H&&t!==q&&t!==L&&t!==J&&t!==$&&t!==tt}function f(t,e,n,r,i){var o,s,a=!1,u=!1,f=-1!==r,d=-1,m=p(t.charCodeAt(0))&&!c(t.charCodeAt(t.length-1));if(e)for(o=0;o<t.length;o++){if(s=t.charCodeAt(o),!h(s))return ht;m=m&&l(s)}else{for(o=0;o<t.length;o++){if((s=t.charCodeAt(o))===R)a=!0,f&&(u=u||o-d-1>r&&" "!==t[d+1],d=o);else if(!h(s))return ht;m=m&&l(s)}u=u||f&&o-d-1>r&&" "!==t[d+1]}return a||u?" "===t[0]&&n>9?ht:u?ct:ut:m&&!i(t)?st:at}function d(t,e,n,r){t.dump=function(){function i(e){return u(t,e)}if(0===e.length)return"''";if(!t.noCompatMode&&-1!==ot.indexOf(e))return"'"+e+"'";var o=t.indent*Math.max(1,n),a=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),c=r||t.flowLevel>-1&&n>=t.flowLevel;switch(f(e,c,t.indent,a,i)){case st:return e;case at:return"'"+e.replace(/'/g,"''")+"'";case ut:return"|"+m(e,t.indent)+y(s(e,o));case ct:return">"+m(e,t.indent)+y(s(v(e,a),o));case ht:return'"'+g(e)+'"';default:throw new T("impossible error: invalid scalar style")}}()}function m(t,e){var n=" "===t[0]?String(e):"",r="\n"===t[t.length-1];return n+(!r||"\n"!==t[t.length-2]&&"\n"!==t?r?"":"-":"+")+"\n"}function y(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function v(t,e){for(var n,r,i=/(\n+)([^\n]*)/g,o=function(){var n=t.indexOf("\n");return n=-1!==n?n:t.length,i.lastIndex=n,x(t.slice(0,n),e)}(),s="\n"===t[0]||" "===t[0];r=i.exec(t);){var a=r[1],u=r[2];n=" "===u[0],o+=a+(s||n||""===u?"":"\n")+x(u,e),s=n}return o}function x(t,e){if(""===t||" "===t[0])return t;for(var n,r,i=/ [^ ]/g,o=0,s=0,a=0,u="";n=i.exec(t);)a=n.index,a-o>e&&(r=s>o?s:a,u+="\n"+t.slice(o,r),o=r+1),s=a;return u+="\n",t.length-o>e&&s>o?u+=t.slice(o,s)+"\n"+t.slice(s+1):u+=t.slice(o),u.slice(1)}function g(t){for(var e,n,r,o="",s=0;s<t.length;s++)e=t.charCodeAt(s),e>=55296&&e<=56319&&(n=t.charCodeAt(s+1))>=56320&&n<=57343?(o+=i(1024*(e-55296)+n-56320+65536),s++):(r=it[e],o+=!r&&h(e)?t[s]:r||i(e));return o}function D(t,e,n){var r,i,o="",s=t.tag;for(r=0,i=n.length;r<i;r+=1)C(t,e,n[r],!1,!1)&&(0!==r&&(o+=","+(t.condenseFlow?"":" ")),o+=t.dump);t.tag=s,t.dump="["+o+"]"}function E(t,e,n,r){var i,o,s="",u=t.tag;for(i=0,o=n.length;i<o;i+=1)C(t,e+1,n[i],!0,!0)&&(r&&0===i||(s+=a(t,e)),t.dump&&R===t.dump.charCodeAt(0)?s+="-":s+="- ",s+=t.dump);t.tag=u,t.dump=s||"[]"}function A(t,e,n){var r,i,o,s,a,u="",c=t.tag,h=Object.keys(n);for(r=0,i=h.length;r<i;r+=1)a=t.condenseFlow?'"':"",0!==r&&(a+=", "),o=h[r],s=n[o],C(t,e,o,!1,!1)&&(t.dump.length>1024&&(a+="? "),a+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),C(t,e,s,!1,!1)&&(a+=t.dump,u+=a));t.tag=c,t.dump="{"+u+"}"}function S(t,e,n,r){var i,o,s,u,c,h,l="",p=t.tag,f=Object.keys(n);if(!0===t.sortKeys)f.sort();else if("function"==typeof t.sortKeys)f.sort(t.sortKeys);else if(t.sortKeys)throw new T("sortKeys must be a boolean or a function");for(i=0,o=f.length;i<o;i+=1)h="",r&&0===i||(h+=a(t,e)),s=f[i],u=n[s],C(t,e+1,s,!0,!0,!0)&&(c=null!==t.tag&&"?"!==t.tag||t.dump&&t.dump.length>1024,c&&(t.dump&&R===t.dump.charCodeAt(0)?h+="?":h+="? "),h+=t.dump,c&&(h+=a(t,e)),C(t,e+1,u,!0,c)&&(t.dump&&R===t.dump.charCodeAt(0)?h+=":":h+=": ",h+=t.dump,l+=h));t.tag=p,t.dump=l||"{}"}function w(t,e,n){var r,i,o,s,a,u;for(i=n?t.explicitTypes:t.implicitTypes,o=0,s=i.length;o<s;o+=1)if(a=i[o],(a.instanceOf||a.predicate)&&(!a.instanceOf||"object"==typeof e&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(t.tag=n?a.tag:"?",a.represent){if(u=t.styleMap[a.tag]||a.defaultStyle,"[object Function]"===P.call(a.represent))r=a.represent(e,u);else{if(!N.call(a.represent,u))throw new T("!<"+a.tag+'> tag resolver accepts not "'+u+'" style');r=a.represent[u](e,u)}t.dump=r}return!0}return!1}function C(t,e,n,r,i,o){t.tag=null,t.dump=n,w(t,n,!1)||w(t,n,!0);var s=P.call(t.dump);r&&(r=t.flowLevel<0||t.flowLevel>e);var a,u,c="[object Object]"===s||"[object Array]"===s;if(c&&(a=t.duplicates.indexOf(n),u=-1!==a),(null!==t.tag&&"?"!==t.tag||u||2!==t.indent&&e>0)&&(i=!1),u&&t.usedDuplicates[a])t.dump="*ref_"+a;else{if(c&&u&&!t.usedDuplicates[a]&&(t.usedDuplicates[a]=!0),"[object Object]"===s)r&&0!==Object.keys(t.dump).length?(S(t,e,t.dump,i),u&&(t.dump="&ref_"+a+t.dump)):(A(t,e,t.dump),u&&(t.dump="&ref_"+a+" "+t.dump));else if("[object Array]"===s)r&&0!==t.dump.length?(E(t,e,t.dump,i),u&&(t.dump="&ref_"+a+t.dump)):(D(t,e,t.dump),u&&(t.dump="&ref_"+a+" "+t.dump));else{if("[object String]"!==s){if(t.skipInvalid)return!1;throw new T("unacceptable kind of an object to dump "+s)}"?"!==t.tag&&d(t,t.dump,e,o)}null!==t.tag&&"?"!==t.tag&&(t.dump="!<"+t.tag+"> "+t.dump)}return!0}function _(t,e){var n,r,i=[],o=[];for(b(t,i,o),n=0,r=o.length;n<r;n+=1)e.duplicates.push(i[o[n]]);e.usedDuplicates=new Array(r)}function b(t,e,n){var r,i,o;if(null!==t&&"object"==typeof t)if(-1!==(i=e.indexOf(t)))-1===n.indexOf(i)&&n.push(i);else if(e.push(t),Array.isArray(t))for(i=0,o=t.length;i<o;i+=1)b(t[i],e,n);else for(r=Object.keys(t),i=0,o=r.length;i<o;i+=1)b(t[r[i]],e,n)}function F(t,e){e=e||{};var n=new o(e);return n.noRefs||_(t,n),C(n,0,t,!0,!0)?n.dump+"\n":""}function k(t,e){return F(t,I.extend({schema:M},e))}var I=n(23),T=n(33),B=n(47),M=n(34),P=Object.prototype.toString,N=Object.prototype.hasOwnProperty,O=9,R=10,U=32,j=33,L=34,z=35,J=37,X=38,q=39,K=42,Y=44,W=45,G=58,H=62,V=63,$=64,Z=91,Q=93,tt=96,et=123,nt=124,rt=125,it={};it[0]="\\0",it[7]="\\a",it[8]="\\b",it[9]="\\t",it[10]="\\n",it[11]="\\v",it[12]="\\f",it[13]="\\r",it[27]="\\e",it[34]='\\"',it[92]="\\\\",it[133]="\\N",it[160]="\\_",it[8232]="\\L",it[8233]="\\P";var ot=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],st=1,at=2,ut=3,ct=4,ht=5;t.exports.dump=F,t.exports.safeDump=k},function(t,e,n){"use strict";function r(t){return 10===t||13===t}function i(t){return 9===t||32===t}function o(t){return 9===t||32===t||10===t||13===t}function s(t){return 44===t||91===t||93===t||123===t||125===t}function a(t){var e;return 48<=t&&t<=57?t-48:(e=32|t,97<=e&&e<=102?e-97+10:-1)}function u(t){return 120===t?2:117===t?4:85===t?8:0}function c(t){return 48<=t&&t<=57?t-48:-1}function h(t){return 48===t?"\0":97===t?"":98===t?"\b":116===t?"\t":9===t?"\t":110===t?"\n":118===t?"\v":102===t?"\f":114===t?"\r":101===t?"":32===t?" ":34===t?'"':47===t?"/":92===t?"\\":78===t?"…":95===t?" ":76===t?"\u2028":80===t?"\u2029":""}function l(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}function p(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||q,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function f(t,e){return new z(e,new J(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function d(t,e){throw f(t,e)}function m(t,e){t.onWarning&&t.onWarning.call(null,f(t,e))}function y(t,e,n,r){var i,o,s,a;if(e<n){if(a=t.input.slice(e,n),r)for(i=0,o=a.length;i<o;i+=1)9===(s=a.charCodeAt(i))||32<=s&&s<=1114111||d(t,"expected valid JSON character");else Q.test(a)&&d(t,"the stream contains non-printable characters");t.result+=a}}function v(t,e,n,r){var i,o,s,a;for(L.isObject(n)||d(t,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),s=0,a=i.length;s<a;s+=1)o=i[s],K.call(e,o)||(e[o]=n[o],r[o]=!0)}function x(t,e,n,r,i,o,s,a){var u,c;if(i=String(i),null===e&&(e={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(o))for(u=0,c=o.length;u<c;u+=1)v(t,e,o[u],n);else v(t,e,o,n);else t.json||K.call(n,i)||!K.call(e,i)||(t.line=s||t.line,t.position=a||t.position,d(t,"duplicated mapping key")),e[i]=o,delete n[i];return e}function g(t){var e;e=t.input.charCodeAt(t.position),10===e?t.position++:13===e?(t.position++,10===t.input.charCodeAt(t.position)&&t.position++):d(t,"a line break is expected"),t.line+=1,t.lineStart=t.position}function D(t,e,n){for(var o=0,s=t.input.charCodeAt(t.position);0!==s;){for(;i(s);)s=t.input.charCodeAt(++t.position);if(e&&35===s)do{s=t.input.charCodeAt(++t.position)}while(10!==s&&13!==s&&0!==s);if(!r(s))break;for(g(t),s=t.input.charCodeAt(t.position),o++,t.lineIndent=0;32===s;)t.lineIndent++,s=t.input.charCodeAt(++t.position)}return-1!==n&&0!==o&&t.lineIndent<n&&m(t,"deficient indentation"),o}function E(t){var e,n=t.position;return!(45!==(e=t.input.charCodeAt(n))&&46!==e||e!==t.input.charCodeAt(n+1)||e!==t.input.charCodeAt(n+2)||(n+=3,0!==(e=t.input.charCodeAt(n))&&!o(e)))}function A(t,e){1===e?t.result+=" ":e>1&&(t.result+=L.repeat("\n",e-1))}function S(t,e,n){var a,u,c,h,l,p,f,d,m,v=t.kind,x=t.result;if(m=t.input.charCodeAt(t.position),o(m)||s(m)||35===m||38===m||42===m||33===m||124===m||62===m||39===m||34===m||37===m||64===m||96===m)return!1;if((63===m||45===m)&&(u=t.input.charCodeAt(t.position+1),o(u)||n&&s(u)))return!1;for(t.kind="scalar",t.result="",c=h=t.position,l=!1;0!==m;){if(58===m){if(u=t.input.charCodeAt(t.position+1),o(u)||n&&s(u))break}else if(35===m){if(a=t.input.charCodeAt(t.position-1),o(a))break}else{if(t.position===t.lineStart&&E(t)||n&&s(m))break;if(r(m)){if(p=t.line,f=t.lineStart,d=t.lineIndent,D(t,!1,-1),t.lineIndent>=e){l=!0,m=t.input.charCodeAt(t.position);continue}t.position=h,t.line=p,t.lineStart=f,t.lineIndent=d;break}}l&&(y(t,c,h,!1),A(t,t.line-p),c=h=t.position,l=!1),i(m)||(h=t.position+1),m=t.input.charCodeAt(++t.position)}return y(t,c,h,!1),!!t.result||(t.kind=v,t.result=x,!1)}function w(t,e){var n,i,o;if(39!==(n=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,i=o=t.position;0!==(n=t.input.charCodeAt(t.position));)if(39===n){if(y(t,i,t.position,!0),39!==(n=t.input.charCodeAt(++t.position)))return!0;i=t.position,t.position++,o=t.position}else r(n)?(y(t,i,o,!0),A(t,D(t,!1,e)),i=o=t.position):t.position===t.lineStart&&E(t)?d(t,"unexpected end of the document within a single quoted scalar"):(t.position++,o=t.position);d(t,"unexpected end of the stream within a single quoted scalar")}function C(t,e){var n,i,o,s,c,h;if(34!==(h=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;0!==(h=t.input.charCodeAt(t.position));){if(34===h)return y(t,n,t.position,!0),t.position++,!0;if(92===h){if(y(t,n,t.position,!0),h=t.input.charCodeAt(++t.position),r(h))D(t,!1,e);else if(h<256&&it[h])t.result+=ot[h],t.position++;else if((c=u(h))>0){for(o=c,s=0;o>0;o--)h=t.input.charCodeAt(++t.position),(c=a(h))>=0?s=(s<<4)+c:d(t,"expected hexadecimal character");t.result+=l(s),t.position++}else d(t,"unknown escape sequence");n=i=t.position}else r(h)?(y(t,n,i,!0),A(t,D(t,!1,e)),n=i=t.position):t.position===t.lineStart&&E(t)?d(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}d(t,"unexpected end of the stream within a double quoted scalar")}function _(t,e){var n,r,i,s,a,u,c,h,l,p,f,m=!0,y=t.tag,v=t.anchor,g={};if(91===(f=t.input.charCodeAt(t.position)))s=93,c=!1,r=[];else{if(123!==f)return!1;s=125,c=!0,r={}}for(null!==t.anchor&&(t.anchorMap[t.anchor]=r),f=t.input.charCodeAt(++t.position);0!==f;){if(D(t,!0,e),(f=t.input.charCodeAt(t.position))===s)return t.position++,t.tag=y,t.anchor=v,t.kind=c?"mapping":"sequence",t.result=r,!0;m||d(t,"missed comma between flow collection entries"),l=h=p=null,a=u=!1,63===f&&(i=t.input.charCodeAt(t.position+1),o(i)&&(a=u=!0,t.position++,D(t,!0,e))),n=t.line,M(t,e,Y,!1,!0),l=t.tag,h=t.result,D(t,!0,e),f=t.input.charCodeAt(t.position),!u&&t.line!==n||58!==f||(a=!0,f=t.input.charCodeAt(++t.position),D(t,!0,e),M(t,e,Y,!1,!0),p=t.result),c?x(t,r,g,l,h,p):a?r.push(x(t,null,g,l,h,p)):r.push(h),D(t,!0,e),f=t.input.charCodeAt(t.position),44===f?(m=!0,f=t.input.charCodeAt(++t.position)):m=!1}d(t,"unexpected end of the stream within a flow collection")}function b(t,e){var n,o,s,a,u=V,h=!1,l=!1,p=e,f=0,m=!1;if(124===(a=t.input.charCodeAt(t.position)))o=!1;else{if(62!==a)return!1;o=!0}for(t.kind="scalar",t.result="";0!==a;)if(43===(a=t.input.charCodeAt(++t.position))||45===a)V===u?u=43===a?Z:$:d(t,"repeat of a chomping mode identifier");else{if(!((s=c(a))>=0))break;0===s?d(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?d(t,"repeat of an indentation width identifier"):(p=e+s-1,l=!0)}if(i(a)){do{a=t.input.charCodeAt(++t.position)}while(i(a));if(35===a)do{a=t.input.charCodeAt(++t.position)}while(!r(a)&&0!==a)}for(;0!==a;){for(g(t),t.lineIndent=0,a=t.input.charCodeAt(t.position);(!l||t.lineIndent<p)&&32===a;)t.lineIndent++,a=t.input.charCodeAt(++t.position);if(!l&&t.lineIndent>p&&(p=t.lineIndent),r(a))f++;else{if(t.lineIndent<p){u===Z?t.result+=L.repeat("\n",h?1+f:f):u===V&&h&&(t.result+="\n");break}for(o?i(a)?(m=!0,t.result+=L.repeat("\n",h?1+f:f)):m?(m=!1,t.result+=L.repeat("\n",f+1)):0===f?h&&(t.result+=" "):t.result+=L.repeat("\n",f):t.result+=L.repeat("\n",h?1+f:f),h=!0,l=!0,f=0,n=t.position;!r(a)&&0!==a;)a=t.input.charCodeAt(++t.position);y(t,n,t.position,!1)}}return!0}function F(t,e){var n,r,i,s=t.tag,a=t.anchor,u=[],c=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=u),i=t.input.charCodeAt(t.position);0!==i&&45===i&&(r=t.input.charCodeAt(t.position+1),o(r));)if(c=!0,t.position++,D(t,!0,-1)&&t.lineIndent<=e)u.push(null),i=t.input.charCodeAt(t.position);else if(n=t.line,M(t,e,G,!1,!0),u.push(t.result),D(t,!0,-1),i=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&0!==i)d(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break;return!!c&&(t.tag=s,t.anchor=a,t.kind="sequence",t.result=u,!0)}function k(t,e,n){var r,s,a,u,c,h=t.tag,l=t.anchor,p={},f={},m=null,y=null,v=null,g=!1,E=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=p),c=t.input.charCodeAt(t.position);0!==c;){if(r=t.input.charCodeAt(t.position+1),a=t.line,u=t.position,63!==c&&58!==c||!o(r)){if(!M(t,n,W,!1,!0))break;if(t.line===a){for(c=t.input.charCodeAt(t.position);i(c);)c=t.input.charCodeAt(++t.position);if(58===c)c=t.input.charCodeAt(++t.position),o(c)||d(t,"a whitespace character is expected after the key-value separator within a block mapping"),g&&(x(t,p,f,m,y,null),m=y=v=null),E=!0,g=!1,s=!1,m=t.tag,y=t.result;else{if(!E)return t.tag=h,t.anchor=l,!0;d(t,"can not read an implicit mapping pair; a colon is missed")}}else{if(!E)return t.tag=h,t.anchor=l,!0;d(t,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===c?(g&&(x(t,p,f,m,y,null),m=y=v=null),E=!0,g=!0,s=!0):g?(g=!1,s=!0):d(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,c=r;if((t.line===a||t.lineIndent>e)&&(M(t,e,H,!0,s)&&(g?y=t.result:v=t.result),g||(x(t,p,f,m,y,v,a,u),m=y=v=null),D(t,!0,-1),c=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==c)d(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return g&&x(t,p,f,m,y,null),E&&(t.tag=h,t.anchor=l,t.kind="mapping",t.result=p),E}function I(t){var e,n,r,i,s=!1,a=!1;if(33!==(i=t.input.charCodeAt(t.position)))return!1;if(null!==t.tag&&d(t,"duplication of a tag property"),i=t.input.charCodeAt(++t.position),60===i?(s=!0,i=t.input.charCodeAt(++t.position)):33===i?(a=!0,n="!!",i=t.input.charCodeAt(++t.position)):n="!",e=t.position,s){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&62!==i);t.position<t.length?(r=t.input.slice(e,t.position),i=t.input.charCodeAt(++t.position)):d(t,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!o(i);)33===i&&(a?d(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(e-1,t.position+1),nt.test(n)||d(t,"named tag handle cannot contain such characters"),a=!0,e=t.position+1)),i=t.input.charCodeAt(++t.position);r=t.input.slice(e,t.position),et.test(r)&&d(t,"tag suffix cannot contain flow indicator characters")}return r&&!rt.test(r)&&d(t,"tag name cannot contain such characters: "+r),s?t.tag=r:K.call(t.tagMap,n)?t.tag=t.tagMap[n]+r:"!"===n?t.tag="!"+r:"!!"===n?t.tag="tag:yaml.org,2002:"+r:d(t,'undeclared tag handle "'+n+'"'),!0}function T(t){var e,n;if(38!==(n=t.input.charCodeAt(t.position)))return!1;for(null!==t.anchor&&d(t,"duplication of an anchor property"),n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!o(n)&&!s(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&d(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function B(t){var e,n,r;if(42!==(r=t.input.charCodeAt(t.position)))return!1;for(r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!o(r)&&!s(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&d(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),t.anchorMap.hasOwnProperty(n)||d(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],D(t,!0,-1),!0}function M(t,e,n,r,i){var o,s,a,u,c,h,l,p,f=1,m=!1,y=!1;if(null!==t.listener&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,o=s=a=H===n||G===n,r&&D(t,!0,-1)&&(m=!0,t.lineIndent>e?f=1:t.lineIndent===e?f=0:t.lineIndent<e&&(f=-1)),1===f)for(;I(t)||T(t);)D(t,!0,-1)?(m=!0,a=o,t.lineIndent>e?f=1:t.lineIndent===e?f=0:t.lineIndent<e&&(f=-1)):a=!1;if(a&&(a=m||i),1!==f&&H!==n||(l=Y===n||W===n?e:e+1,p=t.position-t.lineStart,1===f?a&&(F(t,p)||k(t,p,l))||_(t,l)?y=!0:(s&&b(t,l)||w(t,l)||C(t,l)?y=!0:B(t)?(y=!0,null===t.tag&&null===t.anchor||d(t,"alias node should not have any properties")):S(t,l,Y===n)&&(y=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===f&&(y=a&&F(t,p))),null!==t.tag&&"!"!==t.tag)if("?"===t.tag){for(u=0,c=t.implicitTypes.length;u<c;u+=1)if(h=t.implicitTypes[u],h.resolve(t.result)){t.result=h.construct(t.result),t.tag=h.tag,null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);break}}else K.call(t.typeMap[t.kind||"fallback"],t.tag)?(h=t.typeMap[t.kind||"fallback"][t.tag],null!==t.result&&h.kind!==t.kind&&d(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+h.kind+'", not "'+t.kind+'"'),h.resolve(t.result)?(t.result=h.construct(t.result),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):d(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")):d(t,"unknown tag !<"+t.tag+">");return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||y}function P(t){var e,n,s,a,u=t.position,c=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap={},t.anchorMap={};0!==(a=t.input.charCodeAt(t.position))&&(D(t,!0,-1),a=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==a));){for(c=!0,a=t.input.charCodeAt(++t.position),e=t.position;0!==a&&!o(a);)a=t.input.charCodeAt(++t.position);for(n=t.input.slice(e,t.position),s=[],n.length<1&&d(t,"directive name must not be less than one character in length");0!==a;){for(;i(a);)a=t.input.charCodeAt(++t.position);if(35===a){do{a=t.input.charCodeAt(++t.position)}while(0!==a&&!r(a));break}if(r(a))break;for(e=t.position;0!==a&&!o(a);)a=t.input.charCodeAt(++t.position);s.push(t.input.slice(e,t.position))}0!==a&&g(t),K.call(at,n)?at[n](t,n,s):m(t,'unknown document directive "'+n+'"')}if(D(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,D(t,!0,-1)):c&&d(t,"directives end mark is expected"),M(t,t.lineIndent-1,H,!1,!0),D(t,!0,-1),t.checkLineBreaks&&tt.test(t.input.slice(u,t.position))&&m(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&E(t))return void(46===t.input.charCodeAt(t.position)&&(t.position+=3,D(t,!0,-1)));t.position<t.length-1&&d(t,"end of the stream or a document separator is expected")}function N(t,e){t=String(t),e=e||{},0!==t.length&&(10!==t.charCodeAt(t.length-1)&&13!==t.charCodeAt(t.length-1)&&(t+="\n"),65279===t.charCodeAt(0)&&(t=t.slice(1)));var n=new p(t,e);for(n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)P(n);return n.documents}function O(t,e,n){var r,i,o=N(t,n);if("function"!=typeof e)return o;for(r=0,i=o.length;r<i;r+=1)e(o[r])}function R(t,e){var n=N(t,e);if(0!==n.length){if(1===n.length)return n[0];throw new z("expected a single document in the stream, but found more")}}function U(t,e,n){if("function"!=typeof e)return O(t,L.extend({schema:X},n));O(t,e,L.extend({schema:X},n))}function j(t,e){return R(t,L.extend({schema:X},e))}for(var L=n(23),z=n(33),J=n(239),X=n(34),q=n(47),K=Object.prototype.hasOwnProperty,Y=1,W=2,G=3,H=4,V=1,$=2,Z=3,Q=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,tt=/[\x85\u2028\u2029]/,et=/[,\[\]\{\}]/,nt=/^(?:!|!!|![a-z\-]+!)$/i,rt=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i,it=new Array(256),ot=new Array(256),st=0;st<256;st++)it[st]=h(st)?1:0,ot[st]=h(st);var at={YAML:function(t,e,n){var r,i,o;null!==t.version&&d(t,"duplication of %YAML directive"),1!==n.length&&d(t,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),null===r&&d(t,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&d(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=o<2,1!==o&&2!==o&&m(t,"unsupported YAML version of the document")},TAG:function(t,e,n){var r,i;2!==n.length&&d(t,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],nt.test(r)||d(t,"ill-formed tag handle (first argument) of the TAG directive"),K.call(t.tagMap,r)&&d(t,'there is a previously declared suffix for "'+r+'" tag handle'),rt.test(i)||d(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[r]=i}};t.exports.loadAll=O,t.exports.load=R,t.exports.safeLoadAll=U,t.exports.safeLoad=j},function(t,e,n){"use strict";function r(t,e,n,r,i){this.name=t,this.buffer=e,this.position=n,this.line=r,this.column=i}var i=n(23);r.prototype.getSnippet=function(t,e){var n,r,o,s,a;if(!this.buffer)return null;for(t=t||4,e=e||75,n="",r=this.position;r>0&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(r-1));)if(r-=1,this.position-r>e/2-1){n=" ... ",r+=5;break}for(o="",s=this.position;s<this.buffer.length&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(s));)if((s+=1)-this.position>e/2-1){o=" ... ",s-=5;break}return a=this.buffer.slice(r,s),i.repeat(" ",t)+n+a+o+"\n"+i.repeat(" ",t+this.position-r+n.length)+"^"},r.prototype.toString=function(t){var e,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),t||(e=this.getSnippet())&&(n+=":\n"+e),n},t.exports=r},function(t,e,n){"use strict";function r(t){if(null===t)return!1;var e,n,r=0,i=t.length,o=c;for(n=0;n<i;n++)if(!((e=o.indexOf(t.charAt(n)))>64)){if(e<0)return!1;r+=6}return r%8==0}function i(t){var e,n,r=t.replace(/[\r\n=]/g,""),i=r.length,o=c,s=0,u=[];for(e=0;e<i;e++)e%4==0&&e&&(u.push(s>>16&255),u.push(s>>8&255),u.push(255&s)),s=s<<6|o.indexOf(r.charAt(e));return n=i%4*6,0===n?(u.push(s>>16&255),u.push(s>>8&255),u.push(255&s)):18===n?(u.push(s>>10&255),u.push(s>>2&255)):12===n&&u.push(s>>4&255),a?a.from?a.from(u):new a(u):u}function o(t){var e,n,r="",i=0,o=t.length,s=c;for(e=0;e<o;e++)e%3==0&&e&&(r+=s[i>>18&63],r+=s[i>>12&63],r+=s[i>>6&63],r+=s[63&i]),i=(i<<8)+t[e];return n=o%3,0===n?(r+=s[i>>18&63],r+=s[i>>12&63],r+=s[i>>6&63],r+=s[63&i]):2===n?(r+=s[i>>10&63],r+=s[i>>4&63],r+=s[i<<2&63],r+=s[64]):1===n&&(r+=s[i>>2&63],r+=s[i<<4&63],r+=s[64],r+=s[64]),r}function s(t){return a&&a.isBuffer(t)}var a;try{a=n(135).Buffer}catch(t){}var u=n(0),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new u("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:i,predicate:s,represent:o})},function(t,e,n){"use strict";function r(t){if(null===t)return!1;var e=t.length;return 4===e&&("true"===t||"True"===t||"TRUE"===t)||5===e&&("false"===t||"False"===t||"FALSE"===t)}function i(t){return"true"===t||"True"===t||"TRUE"===t}function o(t){return"[object Boolean]"===Object.prototype.toString.call(t)}var s=n(0);t.exports=new s("tag:yaml.org,2002:bool",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"})},function(t,e,n){"use strict";function r(t){return null!==t&&!(!c.test(t)||"_"===t[t.length-1])}function i(t){var e,n,r,i;return e=t.replace(/_/g,"").toLowerCase(),n="-"===e[0]?-1:1,i=[],"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:e.indexOf(":")>=0?(e.split(":").forEach(function(t){i.unshift(parseFloat(t,10))}),e=0,r=1,i.forEach(function(t){e+=t*r,r*=60}),n*e):n*parseFloat(e,10)}function o(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(a.isNegativeZero(t))return"-0.0";return n=t.toString(10),h.test(n)?n.replace("e",".e"):n}function s(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||a.isNegativeZero(t))}var a=n(23),u=n(0),c=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),h=/^[-+]?[0-9]+e/;t.exports=new u("tag:yaml.org,2002:float",{kind:"scalar",resolve:r,construct:i,predicate:s,represent:o,defaultStyle:"lowercase"})},function(t,e,n){"use strict";function r(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function i(t){return 48<=t&&t<=55}function o(t){return 48<=t&&t<=57}function s(t){if(null===t)return!1;var e,n=t.length,s=0,a=!1;if(!n)return!1;if(e=t[s],"-"!==e&&"+"!==e||(e=t[++s]),"0"===e){if(s+1===n)return!0;if("b"===(e=t[++s])){for(s++;s<n;s++)if("_"!==(e=t[s])){if("0"!==e&&"1"!==e)return!1;a=!0}return a&&"_"!==e}if("x"===e){for(s++;s<n;s++)if("_"!==(e=t[s])){if(!r(t.charCodeAt(s)))return!1;a=!0}return a&&"_"!==e}for(;s<n;s++)if("_"!==(e=t[s])){if(!i(t.charCodeAt(s)))return!1;a=!0}return a&&"_"!==e}if("_"===e)return!1;for(;s<n;s++)if("_"!==(e=t[s])){if(":"===e)break;if(!o(t.charCodeAt(s)))return!1;a=!0}return!(!a||"_"===e)&&(":"!==e||/^(:[0-5]?[0-9])+$/.test(t.slice(s)))}function a(t){var e,n,r=t,i=1,o=[];return-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),e=r[0],"-"!==e&&"+"!==e||("-"===e&&(i=-1),r=r.slice(1),e=r[0]),"0"===r?0:"0"===e?"b"===r[1]?i*parseInt(r.slice(2),2):"x"===r[1]?i*parseInt(r,16):i*parseInt(r,8):-1!==r.indexOf(":")?(r.split(":").forEach(function(t){o.unshift(parseInt(t,10))}),r=0,n=1,o.forEach(function(t){r+=t*n,n*=60}),i*r):i*parseInt(r,10)}function u(t){return"[object Number]"===Object.prototype.toString.call(t)&&t%1==0&&!c.isNegativeZero(t)}var c=n(23),h=n(0);t.exports=new h("tag:yaml.org,2002:int",{kind:"scalar",resolve:s,construct:a,predicate:u,represent:{binary:function(t){return"0b"+t.toString(2)},octal:function(t){return"0"+t.toString(8)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return"0x"+t.toString(16).toUpperCase()}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},function(t,e,n){"use strict";function r(t){if(null===t)return!1;try{var e="("+t+")",n=a.parse(e,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&"FunctionExpression"===n.body[0].expression.type}catch(t){return!1}}function i(t){var e,n="("+t+")",r=a.parse(n,{range:!0}),i=[];if("Program"!==r.type||1!==r.body.length||"ExpressionStatement"!==r.body[0].type||"FunctionExpression"!==r.body[0].expression.type)throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach(function(t){i.push(t.name)}),e=r.body[0].expression.body.range,new Function(i,n.slice(e[0]+1,e[1]-1))}function o(t){return t.toString()}function s(t){return"[object Function]"===Object.prototype.toString.call(t)}var a;try{a=n(231)}catch(t){"undefined"!=typeof window&&(a=window.esprima)}var u=n(0);t.exports=new u("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:r,construct:i,predicate:s,represent:o})},function(t,e,n){"use strict";function r(t){if(null===t)return!1;if(0===t.length)return!1;var e=t,n=/\/([gim]*)$/.exec(t),r="";if("/"===e[0]){if(n&&(r=n[1]),r.length>3)return!1;if("/"!==e[e.length-r.length-1])return!1}return!0}function i(t){var e=t,n=/\/([gim]*)$/.exec(t),r="";return"/"===e[0]&&(n&&(r=n[1]),e=e.slice(1,e.length-r.length-1)),new RegExp(e,r)}function o(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}function s(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var a=n(0);t.exports=new a("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:r,construct:i,predicate:s,represent:o})},function(t,e,n){"use strict";function r(){return!0}function i(){}function o(){return""}function s(t){return void 0===t}var a=n(0);t.exports=new a("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:r,construct:i,predicate:s,represent:o})},function(t,e,n){"use strict";var r=n(0);t.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return null!==t?t:{}}})},function(t,e,n){"use strict";function r(t){return"<<"===t||null===t}var i=n(0);t.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:r})},function(t,e,n){"use strict";function r(t){if(null===t)return!0;var e=t.length;return 1===e&&"~"===t||4===e&&("null"===t||"Null"===t||"NULL"===t)}function i(){return null}function o(t){return null===t}var s=n(0);t.exports=new s("tag:yaml.org,2002:null",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},function(t,e,n){"use strict";function r(t){if(null===t)return!0;var e,n,r,i,o,u=[],c=t;for(e=0,n=c.length;e<n;e+=1){if(r=c[e],o=!1,"[object Object]"!==a.call(r))return!1;for(i in r)if(s.call(r,i)){if(o)return!1;o=!0}if(!o)return!1;if(-1!==u.indexOf(i))return!1;u.push(i)}return!0}function i(t){return null!==t?t:[]}var o=n(0),s=Object.prototype.hasOwnProperty,a=Object.prototype.toString;t.exports=new o("tag:yaml.org,2002:omap",{kind:"sequence",resolve:r,construct:i})},function(t,e,n){"use strict";function r(t){if(null===t)return!0;var e,n,r,i,o,a=t;for(o=new Array(a.length),e=0,n=a.length;e<n;e+=1){if(r=a[e],"[object Object]"!==s.call(r))return!1;if(i=Object.keys(r),1!==i.length)return!1;o[e]=[i[0],r[i[0]]]}return!0}function i(t){if(null===t)return[];var e,n,r,i,o,s=t;for(o=new Array(s.length),e=0,n=s.length;e<n;e+=1)r=s[e],i=Object.keys(r),o[e]=[i[0],r[i[0]]];return o}var o=n(0),s=Object.prototype.toString;t.exports=new o("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:i})},function(t,e,n){"use strict";var r=n(0);t.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return null!==t?t:[]}})},function(t,e,n){"use strict";function r(t){if(null===t)return!0;var e,n=t;for(e in n)if(s.call(n,e)&&null!==n[e])return!1;return!0}function i(t){return null!==t?t:{}}var o=n(0),s=Object.prototype.hasOwnProperty;t.exports=new o("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:i})},function(t,e,n){"use strict";var r=n(0);t.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return null!==t?t:""}})},function(t,e,n){"use strict";function r(t){return null!==t&&(null!==a.exec(t)||null!==u.exec(t))}function i(t){var e,n,r,i,o,s,c,h,l,p,f=0,d=null;if(e=a.exec(t),null===e&&(e=u.exec(t)),null===e)throw new Error("Date resolve error");if(n=+e[1],r=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(n,r,i));if(o=+e[4],s=+e[5],c=+e[6],e[7]){for(f=e[7].slice(0,3);f.length<3;)f+="0";f=+f}return e[9]&&(h=+e[10],l=+(e[11]||0),d=6e4*(60*h+l),"-"===e[9]&&(d=-d)),p=new Date(Date.UTC(n,r,i,o,s,c,f)),d&&p.setTime(p.getTime()-d),p}function o(t){return t.toISOString()}var s=n(0),a=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),u=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");t.exports=new s("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:r,construct:i,instanceOf:Date,represent:o})},function(t,e,n){"use strict";function r(t,e,n,r,i){}t.exports=r},function(t,e,n){"use strict";var r=n(259);t.exports=function(t){return r(t,!1)}},function(t,e,n){"use strict";var r=n(45),i=n(15),o=n(113);t.exports=function(){function t(t,e,n,r,s,a){a!==o&&i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=r,n.PropTypes=n,n}},function(t,e,n){"use strict";var r=n(45),i=n(15),o=n(46),s=n(35),a=n(113),u=n(256);t.exports=function(t,e){function n(t){var e=t&&(_&&t[_]||t[b]);if("function"==typeof e)return e}function c(t,e){return t===e?0!==t||1/t==1/e:t!==t&&e!==e}function h(t){this.message=t,this.stack=""}function l(t){function n(n,r,o,s,u,c,l){if(s=s||F,c=c||o,l!==a)if(e)i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else;return null==r[o]?n?new h(null===r[o]?"The "+u+" `"+c+"` is marked as required in `"+s+"`, but its value is `null`.":"The "+u+" `"+c+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:t(r,o,s,u,c)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function p(t){function e(e,n,r,i,o,s){var a=e[n];if(A(a)!==t)return new h("Invalid "+i+" `"+o+"` of type `"+S(a)+"` supplied to `"+r+"`, expected `"+t+"`.");return null}return l(e)}function f(t){function e(e,n,r,i,o){if("function"!=typeof t)return new h("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=e[n];if(!Array.isArray(s)){return new h("Invalid "+i+" `"+o+"` of type `"+A(s)+"` supplied to `"+r+"`, expected an array.")}for(var u=0;u<s.length;u++){var c=t(s,u,r,i,o+"["+u+"]",a);if(c instanceof Error)return c}return null}return l(e)}function d(t){function e(e,n,r,i,o){if(!(e[n]instanceof t)){var s=t.name||F;return new h("Invalid "+i+" `"+o+"` of type `"+C(e[n])+"` supplied to `"+r+"`, expected instance of `"+s+"`.")}return null}return l(e)}function m(t){function e(e,n,r,i,o){for(var s=e[n],a=0;a<t.length;a++)if(c(s,t[a]))return null;return new h("Invalid "+i+" `"+o+"` of value `"+s+"` supplied to `"+r+"`, expected one of "+JSON.stringify(t)+".")}return Array.isArray(t)?l(e):r.thatReturnsNull}function y(t){function e(e,n,r,i,o){if("function"!=typeof t)return new h("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var s=e[n],u=A(s);if("object"!==u)return new h("Invalid "+i+" `"+o+"` of type `"+u+"` supplied to `"+r+"`, expected an object.");for(var c in s)if(s.hasOwnProperty(c)){var l=t(s,c,r,i,o+"."+c,a);if(l instanceof Error)return l}return null}return l(e)}function v(t){function e(e,n,r,i,o){for(var s=0;s<t.length;s++){if(null==(0,t[s])(e,n,r,i,o,a))return null}return new h("Invalid "+i+" `"+o+"` supplied to `"+r+"`.")}if(!Array.isArray(t))return r.thatReturnsNull;for(var n=0;n<t.length;n++){var i=t[n];if("function"!=typeof i)return o(!1,"Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.",w(i),n),r.thatReturnsNull}return l(e)}function x(t){function e(e,n,r,i,o){var s=e[n],u=A(s);if("object"!==u)return new h("Invalid "+i+" `"+o+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var c in t){var l=t[c];if(l){var p=l(s,c,r,i,o+"."+c,a);if(p)return p}}return null}return l(e)}function g(t){function e(e,n,r,i,o){var u=e[n],c=A(u);if("object"!==c)return new h("Invalid "+i+" `"+o+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");var l=s({},e[n],t);for(var p in l){var f=t[p];if(!f)return new h("Invalid "+i+" `"+o+"` key `"+p+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(e[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(t),null," "));var d=f(u,p,r,i,o+"."+p,a);if(d)return d}return null}return l(e)}function D(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(D);if(null===e||t(e))return!0;var r=n(e);if(!r)return!1;var i,o=r.call(e);if(r!==e.entries){for(;!(i=o.next()).done;)if(!D(i.value))return!1}else for(;!(i=o.next()).done;){var s=i.value;if(s&&!D(s[1]))return!1}return!0;default:return!1}}function E(t,e){return"symbol"===t||("Symbol"===e["@@toStringTag"]||"function"==typeof Symbol&&e instanceof Symbol)}function A(t){var e=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":E(e,t)?"symbol":e}function S(t){if(void 0===t||null===t)return""+t;var e=A(t);if("object"===e){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return e}function w(t){var e=S(t);switch(e){case"array":case"object":return"an "+e;case"boolean":case"date":case"regexp":return"a "+e;default:return e}}function C(t){return t.constructor&&t.constructor.name?t.constructor.name:F}var _="function"==typeof Symbol&&Symbol.iterator,b="@@iterator",F="<<anonymous>>",k={array:p("array"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:function(){return l(r.thatReturnsNull)}(),arrayOf:f,element:function(){function e(e,n,r,i,o){var s=e[n];if(!t(s)){return new h("Invalid "+i+" `"+o+"` of type `"+A(s)+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return l(e)}(),instanceOf:d,node:function(){function t(t,e,n,r,i){return D(t[e])?null:new h("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")}return l(t)}(),objectOf:y,oneOf:m,oneOfType:v,shape:x,exact:g};return h.prototype=Error.prototype,k.checkPropTypes=u,k.PropTypes=k,k}},function(t,e){t.exports='---\nurl: "http://petstore.swagger.io/v2/swagger.json"\ndom_id: "#swagger-ui"\nvalidatorUrl: "https://online.swagger.io/validator"\noauth2RedirectUrl: "http://localhost:3200/oauth2-redirect.html"\n'},function(t,e,n){"use strict";function r(t){var e={"=":"=0",":":"=2"};return"$"+(""+t).replace(/[=:]/g,function(t){return e[t]})}function i(t){var e=/(=0|=2)/g,n={"=0":"=","=2":":"};return(""+("."===t[0]&&"$"===t[1]?t.substring(2):t.substring(1))).replace(e,function(t){return n[t]})}var o={escape:r,unescape:i};t.exports=o},function(t,e,n){"use strict";var r=n(48),i=(n(15),function(t){var e=this;if(e.instancePool.length){var n=e.instancePool.pop();return e.call(n,t),n}return new e(t)}),o=function(t,e){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,t,e),r}return new n(t,e)},s=function(t,e,n){var r=this;if(r.instancePool.length){var i=r.instancePool.pop();return r.call(i,t,e,n),i}return new r(t,e,n)},a=function(t,e,n,r){var i=this;if(i.instancePool.length){var o=i.instancePool.pop();return i.call(o,t,e,n,r),o}return new i(t,e,n,r)},u=function(t){var e=this;t instanceof e||r("25"),t.destructor(),e.instancePool.length<e.poolSize&&e.instancePool.push(t)},c=i,h=function(t,e){var n=t;return n.instancePool=[],n.getPooled=e||c,n.poolSize||(n.poolSize=10),n.release=u,n},l={addPoolingTo:h,oneArgumentPooler:i,twoArgumentPooler:o,threeArgumentPooler:s,fourArgumentPooler:a};t.exports=l},function(t,e,n){"use strict";var r=n(35),i=n(114),o=n(264),s=n(265),a=n(25),u=n(266),c=n(267),h=n(268),l=n(271),p=a.createElement,f=a.createFactory,d=a.cloneElement,m=r,y=function(t){return t},v={Children:{map:o.map,forEach:o.forEach,count:o.count,toArray:o.toArray,only:l},Component:i.Component,PureComponent:i.PureComponent,createElement:p,cloneElement:d,isValidElement:a.isValidElement,PropTypes:u,createClass:h,createFactory:f,createMixin:y,DOM:s,version:c,__spread:m};t.exports=v},function(t,e,n){"use strict";function r(t){return(""+t).replace(D,"$&/")}function i(t,e){this.func=t,this.context=e,this.count=0}function o(t,e,n){var r=t.func,i=t.context;r.call(i,e,t.count++)}function s(t,e,n){if(null==t)return t;var r=i.getPooled(e,n);v(t,o,r),i.release(r)}function a(t,e,n,r){this.result=t,this.keyPrefix=e,this.func=n,this.context=r,this.count=0}function u(t,e,n){var i=t.result,o=t.keyPrefix,s=t.func,a=t.context,u=s.call(a,e,t.count++);Array.isArray(u)?c(u,i,n,y.thatReturnsArgument):null!=u&&(m.isValidElement(u)&&(u=m.cloneAndReplaceKey(u,o+(!u.key||e&&e.key===u.key?"":r(u.key)+"/")+n)),i.push(u))}function c(t,e,n,i,o){var s="";null!=n&&(s=r(n)+"/");var c=a.getPooled(e,s,i,o);v(t,u,c),a.release(c)}function h(t,e,n){if(null==t)return t;var r=[];return c(t,r,null,e,n),r}function l(t,e,n){return null}function p(t,e){return v(t,l,null)}function f(t){var e=[];return c(t,e,null,y.thatReturnsArgument),e}var d=n(262),m=n(25),y=n(45),v=n(272),x=d.twoArgumentPooler,g=d.fourArgumentPooler,D=/\/+/g;i.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},d.addPoolingTo(i,x),a.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},d.addPoolingTo(a,g);var E={forEach:s,map:h,mapIntoWithKeyPrefixInternal:c,count:p,toArray:f};t.exports=E},function(t,e,n){"use strict";var r=n(25),i=r.createFactory,o={a:i("a"),abbr:i("abbr"),address:i("address"),area:i("area"),article:i("article"),aside:i("aside"),audio:i("audio"),b:i("b"),base:i("base"),bdi:i("bdi"),bdo:i("bdo"),big:i("big"),blockquote:i("blockquote"),body:i("body"),br:i("br"),button:i("button"),canvas:i("canvas"),caption:i("caption"),cite:i("cite"),code:i("code"),col:i("col"),colgroup:i("colgroup"),data:i("data"),datalist:i("datalist"),dd:i("dd"),del:i("del"),details:i("details"),dfn:i("dfn"),dialog:i("dialog"),div:i("div"),dl:i("dl"),dt:i("dt"),em:i("em"),embed:i("embed"),fieldset:i("fieldset"),figcaption:i("figcaption"),figure:i("figure"),footer:i("footer"),form:i("form"),h1:i("h1"),h2:i("h2"),h3:i("h3"),h4:i("h4"),h5:i("h5"),h6:i("h6"),head:i("head"),header:i("header"),hgroup:i("hgroup"),hr:i("hr"),html:i("html"),i:i("i"),iframe:i("iframe"),img:i("img"),input:i("input"),ins:i("ins"),kbd:i("kbd"),keygen:i("keygen"),label:i("label"),legend:i("legend"),li:i("li"),link:i("link"),main:i("main"),map:i("map"),mark:i("mark"),menu:i("menu"),menuitem:i("menuitem"),meta:i("meta"),meter:i("meter"),nav:i("nav"),noscript:i("noscript"),object:i("object"),ol:i("ol"),optgroup:i("optgroup"),option:i("option"),output:i("output"),p:i("p"),param:i("param"),picture:i("picture"),pre:i("pre"),progress:i("progress"),q:i("q"),rp:i("rp"),rt:i("rt"),ruby:i("ruby"),s:i("s"),samp:i("samp"),script:i("script"),section:i("section"),select:i("select"),small:i("small"),source:i("source"),span:i("span"),strong:i("strong"),style:i("style"),sub:i("sub"),summary:i("summary"),sup:i("sup"),table:i("table"),tbody:i("tbody"),td:i("td"),textarea:i("textarea"),tfoot:i("tfoot"),th:i("th"),thead:i("thead"),time:i("time"),title:i("title"),tr:i("tr"),track:i("track"),u:i("u"),ul:i("ul"),var:i("var"),video:i("video"),wbr:i("wbr"),circle:i("circle"),clipPath:i("clipPath"),defs:i("defs"),ellipse:i("ellipse"),g:i("g"),image:i("image"),line:i("line"),linearGradient:i("linearGradient"),mask:i("mask"),path:i("path"),pattern:i("pattern"),polygon:i("polygon"),polyline:i("polyline"),radialGradient:i("radialGradient"),rect:i("rect"),stop:i("stop"),svg:i("svg"),text:i("text"),tspan:i("tspan")};t.exports=o},function(t,e,n){"use strict";var r=n(25),i=r.isValidElement,o=n(257);t.exports=o(i)},function(t,e,n){"use strict";t.exports="15.6.2"},function(t,e,n){"use strict";var r=n(114),i=r.Component,o=n(25),s=o.isValidElement,a=n(117),u=n(230);t.exports=u(i,s,a)},function(t,e,n){"use strict";function r(t){var e=t&&(i&&t[i]||t[o]);if("function"==typeof e)return e}var i="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";t.exports=r},function(t,e,n){"use strict";var r=function(){};t.exports=r},function(t,e,n){"use strict";function r(t){return o.isValidElement(t)||i("143"),t}var i=n(48),o=n(25);n(15);t.exports=r},function(t,e,n){"use strict";function r(t,e){return t&&"object"==typeof t&&null!=t.key?c.escape(t.key):e.toString(36)}function i(t,e,n,o){var p=typeof t;if("undefined"!==p&&"boolean"!==p||(t=null),null===t||"string"===p||"number"===p||"object"===p&&t.$$typeof===a)return n(o,t,""===e?h+r(t,0):e),1;var f,d,m=0,y=""===e?h:e+l;if(Array.isArray(t))for(var v=0;v<t.length;v++)f=t[v],d=y+r(f,v),m+=i(f,d,n,o);else{var x=u(t);if(x){var g,D=x.call(t);if(x!==t.entries)for(var E=0;!(g=D.next()).done;)f=g.value,d=y+r(f,E++),m+=i(f,d,n,o);else for(;!(g=D.next()).done;){var A=g.value;A&&(f=A[1],d=y+c.escape(A[0])+l+r(f,0),m+=i(f,d,n,o))}}else if("object"===p){var S="",w=String(t);s("31","[object Object]"===w?"object with keys {"+Object.keys(t).join(", ")+"}":w,S)}}return m}function o(t,e,n){return null==t?0:i(t,"",e,n)}var s=n(48),a=(n(115),n(116)),u=n(269),c=(n(15),n(261)),h=(n(46),"."),l=":";t.exports=o},function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAMAAAAM7l6QAAAAYFBMVEUAAABUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwB0lzB/n0BfhxBpjyC0x4////+qv4CJp1D09++ft3C/z5/K16/U379UfwDf58/q79+Ur2D2RCk9AAAAHXRSTlMAEEAwn9//z3Agv4/vYID/////////////////UMeji1kAAAD8SURBVHgBlZMFAoQwDATRxbXB7f+vPKnlXAZn6k2cf3A9z/PfOC8IIYni5FmmABM8FMhwT17c9hnhiZL1CwvEL1tmPD0qSKq6gaStW/kMXanVmAVRDUlH1OvuuTINo6k90Sxf8qsOtF6g4ff1osP3OnMcV7d4pzdIUtu1oA4V0DZoKmxmlEYvtDUjjS3tmKmqB+pYy8pD1VPf7jPE0I40HHcaBwnue6fGzgyS5tXIU96PV7rkDWHNLV0DK4FkoKmFpN5oUnvi8KoeA2/JXsmXQuokx0siR1G8tLkN6eB9sLwJp/yymcyaP/TrP+RPmbMMixcJVgTR1aUZ93oGXsgXQAaG6EwAAAAASUVORK5CYII="},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){n(120),t.exports=n(121)}])}); -//# sourceMappingURL=swagger-ui-standalone-preset.js.map +var r=n(237),i=n(238),o=n(135);function u(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(u()<e)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=a.prototype:(null===t&&(t=new a(e)),t.length=e),t}function a(t,e,n){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);a.TYPED_ARRAY_SUPPORT?(t=e).__proto__=a.prototype:t=h(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!a.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,n),i=(t=s(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(a.isBuffer(e)){var n=0|p(e.length);return 0===(t=s(t,n)).length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?s(t,0):h(t,e);if("Buffer"===e.type&&o(e.data))return h(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e){if(f(e),t=s(t,e<0?0:0|p(e)),!a.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function h(t,e){var n=e.length<0?0:0|p(e.length);t=s(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function p(t){if(t>=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|t}function d(t,e){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return F(t).length;default:if(r)return Q(t).length;e=(""+e).toLowerCase(),r=!0}}function y(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return E(this,e,n);case"utf8":case"utf-8":return N(this,e,n);case"ascii":return D(this,e,n);case"latin1":case"binary":return I(this,e,n);case"base64":return x(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function w(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function v(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=a.from(e,r)),a.isBuffer(e))return 0===e.length?-1:g(t,e,n,r,i);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):g(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function g(t,e,n,r,i){var o,u=1,s=t.length,a=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;u=2,s/=2,a/=2,n/=2}function c(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(i){var f=-1;for(o=n;o<s;o++)if(c(t,o)===c(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===a)return f*u}else-1!==f&&(o-=o-f),f=-1}else for(n+a>s&&(n=s-a),o=n;o>=0;o--){for(var l=!0,h=0;h<a;h++)if(c(t,o+h)!==c(e,h)){l=!1;break}if(l)return o}return-1}function M(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var u=0;u<r;++u){var s=parseInt(e.substr(2*u,2),16);if(isNaN(s))return u;t[n+u]=s}return u}function _(t,e,n,r){return B(Q(e,t.length-n),t,n,r)}function m(t,e,n,r){return B(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function L(t,e,n,r){return m(t,e,n,r)}function b(t,e,n,r){return B(F(e),t,n,r)}function j(t,e,n,r){return B(function(t,e){for(var n,r,i,o=[],u=0;u<t.length&&!((e-=2)<0);++u)n=t.charCodeAt(u),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function x(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function N(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,u,s,a,c=t[i],f=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=n)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=t[i+1]))&&(a=(31&c)<<6|63&o)>127&&(f=a);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(a=(15&c)<<12|(63&o)<<6|63&u)>2047&&(a<55296||a>57343)&&(f=a);break;case 4:o=t[i+1],u=t[i+2],s=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&s)&&(a=(15&c)<<18|(63&o)<<12|(63&u)<<6|63&s)>65535&&a<1114112&&(f=a)}null===f?(f=65533,l=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=l}return function(t){var e=t.length;if(e<=S)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=S));return n}(r)}e.Buffer=a,e.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},e.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=u(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,n){return c(null,t,e,n)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,n){return function(t,e,n,r){return f(e),e<=0?s(t,e):void 0!==n?"string"==typeof r?s(t,e).fill(n,r):s(t,e).fill(n):s(t,e)}(null,t,e,n)},a.allocUnsafe=function(t){return l(null,t)},a.allocUnsafeSlow=function(t){return l(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=a.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var u=t[n];if(!a.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(r,i),i+=u.length}return r},a.byteLength=d,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)w(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)w(this,e,e+3),w(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)w(this,e,e+7),w(this,e+1,e+6),w(this,e+2,e+5),w(this,e+3,e+4);return this},a.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?N(this,0,t):y.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},a.prototype.compare=function(t,e,n,r,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),u=(n>>>=0)-(e>>>=0),s=Math.min(o,u),c=this.slice(r,i),f=t.slice(e,n),l=0;l<s;++l)if(c[l]!==f[l]){o=c[l],u=f[l];break}return o<u?-1:u<o?1:0},a.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},a.prototype.indexOf=function(t,e,n){return v(this,t,e,n,!0)},a.prototype.lastIndexOf=function(t,e,n){return v(this,t,e,n,!1)},a.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return M(this,t,e,n);case"utf8":case"utf-8":return _(this,t,e,n);case"ascii":return m(this,t,e,n);case"latin1":case"binary":return L(this,t,e,n);case"base64":return b(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function D(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function I(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function E(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=R(t[o]);return i}function C(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function T(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function A(t,e,n,r,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function O(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function z(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function k(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Y(t,e,n,r,o){return o||k(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function U(t,e,n,r,o){return o||k(t,0,n,8),i.write(t,e,n,r,52,8),n+8}a.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),a.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=a.prototype;else{var i=e-t;n=new a(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},a.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},a.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},a.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},a.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),i.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),i.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),i.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),i.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||A(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},a.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||A(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},a.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):z(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):z(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);A(this,t,e,n,i-1,-i)}var o=0,u=1,s=0;for(this[e]=255&t;++o<n&&(u*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/u>>0)-s&255;return e+n},a.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);A(this,t,e,n,i-1,-i)}var o=n-1,u=1,s=0;for(this[e+o]=255&t;--o>=0&&(u*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/u>>0)-s&255;return e+n},a.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):z(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):z(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,n){return Y(this,t,e,!0,n)},a.prototype.writeFloatBE=function(t,e,n){return Y(this,t,e,!1,n)},a.prototype.writeDoubleLE=function(t,e,n){return U(this,t,e,!0,n)},a.prototype.writeDoubleBE=function(t,e,n){return U(this,t,e,!1,n)},a.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},a.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var u=a.isBuffer(t)?t:Q(new a(t,r).toString()),s=u.length;for(o=0;o<n-e;++o)this[o+e]=u[o%s]}return this};var P=/[^+\/0-9A-Za-z-_]/g;function R(t){return t<16?"0"+t.toString(16):t.toString(16)}function Q(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],u=0;u<r;++u){if((n=t.charCodeAt(u))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(u+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function F(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function B(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(10))},function(t,e,n){var r=n(11).Symbol;t.exports=r},function(t,e,n){var r=n(43),i=n(44),o="[object Symbol]";t.exports=function(t){return"symbol"==typeof t||i(t)&&r(t)==o}},function(t,e,n){var r=n(33)(Object,"create");t.exports=r},function(t,e,n){var r=n(285),i=n(286),o=n(287),u=n(288),s=n(289);function a(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}a.prototype.clear=r,a.prototype.delete=i,a.prototype.get=o,a.prototype.has=u,a.prototype.set=s,t.exports=a},function(t,e,n){var r=n(38);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e,n){var r=n(291);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e,n){var r=n(319),i=n(326),o=n(65);t.exports=function(t){return o(t)?r(t):i(t)}},function(t,e,n){var r=n(138),i=n(93);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},function(t,e,n){var r=n(59),i=1/0;t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-i?"-0":e}},function(t,e,n){"use strict";(function(e){!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,n,r,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,u,s=arguments.length;switch(s){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,n)});case 3:return e.nextTick(function(){t.call(null,n,r)});case 4:return e.nextTick(function(){t.call(null,n,r,i)});default:for(o=new Array(s-1),u=0;u<o.length;)o[u++]=arguments[u];return e.nextTick(function(){t.apply(null,o)})}}}:t.exports=e}).call(this,n(22))},function(t,e,n){"use strict";t.exports=n(376)("forEach")},function(t,e,n){"use strict";var r=n(161),i=n(158),o=n(98),u=n(385);(t.exports=function(t,e){var n,o,s,a,c;return arguments.length<2||"string"!=typeof t?(a=e,e=t,t=null):a=arguments[2],null==t?(n=s=!0,o=!1):(n=u.call(t,"c"),o=u.call(t,"e"),s=u.call(t,"w")),c={value:e,configurable:n,enumerable:o,writable:s},a?r(i(a),c):c}).gs=function(t,e,n){var s,a,c,f;return"string"!=typeof t?(c=n,n=e,e=t,t=null):c=arguments[3],null==e?e=void 0:o(e)?null==n?n=void 0:o(n)||(c=n,n=void 0):(c=e,e=n=void 0),null==t?(s=!0,a=!1):(s=u.call(t,"c"),a=u.call(t,"e")),f={get:e,set:n,configurable:s,enumerable:a},c?r(i(c),f):f}},function(t,e,n){"use strict";var r=n(37);t.exports=r.DEFAULT=new r({include:[n(48)],explicit:[n(444),n(445),n(446)]})},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){var r=n(110);function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r(t,i.key,i)}}t.exports=function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}},function(t,e,n){var r=n(9),i=n(13);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?i(t):e}},function(t,e,n){var r=n(208),i=n(125);function o(e){return t.exports=o=i?r:function(t){return t.__proto__||r(t)},o(e)}t.exports=o},function(t,e,n){var r=n(214),i=n(217);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=r(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)}},function(t,e,n){var r=n(29);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(28),i=n(191),o=n(83),u=n(81)("IE_PROTO"),s=function(){},a=function(){var t,e=n(113)("iframe"),r=o.length;for(e.style.display="none",n(195).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),a=t.F;r--;)delete a.prototype[o[r]];return a()};t.exports=Object.create||function(t,e){var n;return null!==t?(s.prototype=r(t),n=new s,s.prototype=null,n[u]=t):n=a(),void 0===e?n:i(n,e)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(82)("keys"),i=n(53);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){var r=n(4),i=n(16),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(51)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(19).f,i=n(21),o=n(17)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){e.f=n(17)},function(t,e,n){var r=n(16),i=n(4),o=n(51),u=n(85),s=n(19).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:u.f(t)})}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){"use strict";var r=n(128);t.exports=r},function(t,e,n){var r=n(274),i=n(290),o=n(292),u=n(293),s=n(294);function a(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}a.prototype.clear=r,a.prototype.delete=i,a.prototype.get=o,a.prototype.has=u,a.prototype.set=s,t.exports=a},function(t,e,n){var r=n(33)(n(11),"Map");t.exports=r},function(t,e,n){var r=n(296),i=n(336),o=n(343),u=n(12),s=n(344);t.exports=function(t){return"function"==typeof t?t:null==t?o:"object"==typeof t?u(t)?i(t[0],t[1]):r(t):s(t)}},function(t,e){var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var i=typeof t;return!!(e=null==e?n:e)&&("number"==i||"symbol"!=i&&r.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e){var n=9007199254740991;t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}},function(t,e,n){var r=n(12),i=n(59),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!i(t))||(u.test(t)||!o.test(t)||null!=e&&t in Object(e))}},function(t,e,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var u=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function c(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function f(t,e,n,r){var i,o,u,s;if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);if(void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),u=o[e]),void 0===u)u=o[e]=n,++t._eventsCount;else if("function"==typeof u?u=o[e]=r?[n,u]:[u,n]:r?u.unshift(n):u.push(n),(i=c(t))>0&&u.length>i&&!u.warned){u.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=u.length,s=a,console&&console.warn&&console.warn(s)}return t}function l(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=function(){for(var t=[],e=0;e<arguments.length;e++)t.push(arguments[e]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,o(this.listener,this.target,t))}.bind(r);return i.listener=n,r.wrapFn=i,i}function h(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(i):d(i,i.length)}function p(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function d(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||u(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||u(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var u;if(e.length>0&&(u=e[0]),u instanceof Error)throw u;var s=new Error("Unhandled error."+(u?" ("+u.message+")":""));throw s.context=u,s}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var c=a.length,f=d(a,c);for(n=0;n<c;++n)o(f[n],this,e)}return!0},s.prototype.addListener=function(t,e){return f(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return f(this,t,e,!0)},s.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.on(t,l(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.prependListener(t,l(this,t,e)),this},s.prototype.removeListener=function(t,e){var n,r,i,o,u;if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);if(void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===e||n[o].listener===e){u=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,i),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,u||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},s.prototype.listeners=function(t){return h(this,t,!0)},s.prototype.rawListeners=function(t){return h(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){(e=t.exports=n(152)).Stream=e,e.Readable=e,e.Writable=n(97),e.Duplex=n(23),e.Transform=n(157),e.PassThrough=n(366)},function(t,e,n){"use strict";(function(e,r,i){var o=n(67);function u(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var r=t.entry;t.entry=null;for(;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=g;var s,a=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?r:o.nextTick;g.WritableState=v;var c=n(46);c.inherits=n(7);var f={deprecate:n(365)},l=n(153),h=n(8).Buffer,p=i.Uint8Array||function(){};var d,y=n(154);function w(){}function v(t,e){s=s||n(23),t=t||{};var r=e instanceof s;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,c=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(c||0===c)?c:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,r=n.sync,i=n.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,r,i){--e.pendingcb,n?(o.nextTick(i,r),o.nextTick(j,t,e),t._writableState.errorEmitted=!0,t.emit("error",r)):(i(r),t._writableState.errorEmitted=!0,t.emit("error",r),j(t,e))}(t,n,r,e,i);else{var u=L(n);u||n.corked||n.bufferProcessing||!n.bufferedRequest||m(t,n),r?a(_,t,n,u,i):_(t,n,u,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new u(this)}function g(t){if(s=s||n(23),!(d.call(g,this)||this instanceof s))return new g(t);this._writableState=new v(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),l.call(this)}function M(t,e,n,r,i,o,u){e.writelen=r,e.writecb=u,e.writing=!0,e.sync=!0,n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function _(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),j(t,e)}function m(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,i=new Array(r),o=e.corkedRequestsFree;o.entry=n;for(var s=0,a=!0;n;)i[s]=n,n.isBuf||(a=!1),n=n.next,s+=1;i.allBuffers=a,M(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new u(e),e.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,f=n.encoding,l=n.callback;if(M(t,e,!1,e.objectMode?1:c.length,c,f,l),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function L(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function b(t,e){t._final(function(n){e.pendingcb--,n&&t.emit("error",n),e.prefinished=!0,t.emit("prefinish"),j(t,e)})}function j(t,e){var n=L(e);return n&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(b,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),n}c.inherits(g,l),v.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(v.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(t){return!!d.call(this,t)||this===g&&(t&&t._writableState instanceof v)}})):d=function(t){return t instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(t,e,n){var r,i=this._writableState,u=!1,s=!i.objectMode&&(r=t,h.isBuffer(r)||r instanceof p);return s&&!h.isBuffer(t)&&(t=function(t){return h.from(t)}(t)),"function"==typeof e&&(n=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof n&&(n=w),i.ended?function(t,e){var n=new Error("write after end");t.emit("error",n),o.nextTick(e,n)}(this,n):(s||function(t,e,n,r){var i=!0,u=!1;return null===n?u=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||e.objectMode||(u=new TypeError("Invalid non-string/buffer chunk")),u&&(t.emit("error",u),o.nextTick(r,u),i=!1),i}(this,i,t,n))&&(i.pendingcb++,u=function(t,e,n,r,i,o){if(!n){var u=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=h.from(e,n));return e}(e,r,i);r!==u&&(n=!0,i="buffer",r=u)}var s=e.objectMode?1:r.length;e.length+=s;var a=e.length<e.highWaterMark;a||(e.needDrain=!0);if(e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else M(t,e,!1,s,r,i,o);return a}(this,i,s,t,e,n)),u},g.prototype.cork=function(){this._writableState.corked++},g.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||m(this,t))},g.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(t,e,n){var r=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(t,e,n){e.ending=!0,j(t,e),n&&(e.finished?o.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,r,n)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),g.prototype.destroy=y.destroy,g.prototype._undestroy=y.undestroy,g.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,n(22),n(155).setImmediate,n(10))},function(t,e,n){"use strict";t.exports=function(t){return"function"==typeof t}},function(t,e,n){"use strict";t.exports=n(391)()?Array.from:n(392)},function(t,e,n){"use strict";var r=n(405),i=n(25),o=n(34),u=Array.prototype.indexOf,s=Object.prototype.hasOwnProperty,a=Math.abs,c=Math.floor;t.exports=function(t){var e,n,f,l;if(!r(t))return u.apply(this,arguments);for(n=i(o(this).length),f=arguments[1],e=f=isNaN(f)?0:f>=0?c(f):i(this.length)-c(a(f));e<n;++e)if(s.call(this,e)&&(l=this[e],r(l)))return e;return-1}},function(t,e,n){"use strict";(function(e,n){var r,i;r=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t},i=function(t){var e,n,i=document.createTextNode(""),o=0;return new t(function(){var t;if(e)n&&(e=n.concat(e));else{if(!n)return;e=n}if(n=e,e=null,"function"==typeof n)return t=n,n=null,void t();for(i.data=o=++o%2;n;)t=n.shift(),n.length||(n=null),t()}).observe(i,{characterData:!0}),function(t){r(t),e?"function"==typeof e?e=[e,t]:e.push(t):(e=t,i.data=o=++o%2)}},t.exports=function(){if("object"==typeof e&&e&&"function"==typeof e.nextTick)return e.nextTick;if("object"==typeof document&&document){if("function"==typeof MutationObserver)return i(MutationObserver);if("function"==typeof WebKitMutationObserver)return i(WebKitMutationObserver)}return"function"==typeof n?function(t){n(r(t))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(t){setTimeout(r(t),0)}:null}()}).call(this,n(22),n(155).setImmediate)},function(t,e,n){"use strict";var r=n(37);t.exports=new r({explicit:[n(431),n(432),n(433)]})},function(t,e,n){t.exports=n(244)},function(t,e,n){var r=n(259)("toUpperCase");t.exports=r},function(t,e,n){var r=n(89),i="Expected a function";function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(i);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var u=t.apply(this,r);return n.cache=o.set(i,u)||o,u};return n.cache=new(o.Cache||r),n}o.Cache=r,t.exports=o},function(t,e,n){t.exports=n(239)},function(t,e,n){t.exports=n(249)},function(t,e,n){"use strict";n.d(e,"a",function(){return y}),n.d(e,"b",function(){return w});var r=n(2),i=n.n(r),o=n(6),u=n(176),s=n.n(u),a=n(109),c=n.n(a),f=n(177),l=n.n(f),h={string:function(){return"string"},string_email:function(){return"user@example.com"},"string_date-time":function(){return(new Date).toISOString()},string_date:function(){return(new Date).toISOString().substring(0,10)},string_uuid:function(){return"3fa85f64-5717-4562-b3fc-2c963f66afa6"},string_hostname:function(){return"example.com"},string_ipv4:function(){return"198.51.100.42"},string_ipv6:function(){return"2001:0db8:5b96:0000:0000:426f:8e17:642a"},number:function(){return 0},number_float:function(){return 0},integer:function(){return 0},boolean:function(t){return"boolean"!=typeof t.default||t.default}},p=function(t){var e=t=Object(o.d)(t),n=e.type,r=e.format,i=h["".concat(n,"_").concat(r)]||h[n];return Object(o.b)(i)?i(t):"Unknown Type: "+t.type},d=function t(e){var n,r,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=l()({},Object(o.d)(e)),a=s.type,c=s.properties,f=s.additionalProperties,h=s.items,d=s.example,y=u.includeReadOnly,w=u.includeWriteOnly,v=s.default,g={},M={},_=e.xml,m=_.name,L=_.prefix,b=_.namespace,j=s.enum;if(!a)if(c||f)a="object";else{if(!h)return;a="array"}if(n=(L?L+":":"")+(m=m||"notagname"),b){var x=L?"xmlns:"+L:"xmlns";M[x]=b}if("array"===a&&h){if(h.xml=h.xml||_||{},h.xml.name=h.xml.name||_.name,_.wrapped)return g[n]=[],i()(d)?d.forEach(function(e){h.example=e,g[n].push(t(h,u))}):i()(v)?v.forEach(function(e){h.default=e,g[n].push(t(h,u))}):g[n]=[t(h,u)],M&&g[n].push({_attr:M}),g;var N=[];return i()(d)?(d.forEach(function(e){h.example=e,N.push(t(h,u))}),N):i()(v)?(v.forEach(function(e){h.default=e,N.push(t(h,u))}),N):t(h,u)}if("object"===a){var S=Object(o.d)(c);for(var D in g[n]=[],d=d||{},S)if(S.hasOwnProperty(D)&&(!S[D].readOnly||y)&&(!S[D].writeOnly||w))if(S[D].xml=S[D].xml||{},S[D].xml.attribute){var I=i()(S[D].enum)&&S[D].enum[0],E=S[D].example,C=S[D].default;M[S[D].xml.name||D]=void 0!==E&&E||void 0!==d[D]&&d[D]||void 0!==C&&C||I||p(S[D])}else{S[D].xml.name=S[D].xml.name||D,void 0===S[D].example&&void 0!==d[D]&&(S[D].example=d[D]);var T=t(S[D]);i()(T)?g[n]=g[n].concat(T):g[n].push(T)}return!0===f?g[n].push({additionalProp:"Anything can be here"}):f&&g[n].push({additionalProp:p(f)}),M&&g[n].push({_attr:M}),g}return r=void 0!==d?d:void 0!==v?v:i()(j)?j[0]:p(e),g[n]=M?[{_attr:M},r]:r,g};var y=c()(function(t,e){var n=d(t,e);if(n)return s()(n,{declaration:!0,indent:"\t"})}),w=c()(function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(o.d)(e),u=r.type,s=r.example,a=r.properties,c=r.additionalProperties,f=r.items,l=n.includeReadOnly,h=n.includeWriteOnly;if(void 0!==s)return Object(o.a)(s,"$$ref",function(t){return"string"==typeof t&&t.indexOf("#")>-1});if(!u)if(a)u="object";else{if(!f)return;u="array"}if("object"===u){var d=Object(o.d)(a),y={};for(var w in d)d[w]&&d[w].deprecated||d[w]&&d[w].readOnly&&!l||d[w]&&d[w].writeOnly&&!h||(y[w]=t(d[w],n));if(!0===c)y.additionalProp1={};else if(c)for(var v=Object(o.d)(c),g=t(v,n),M=1;M<4;M++)y["additionalProp"+M]=g;return y}return"array"===u?i()(f.anyOf)?f.anyOf.map(function(e){return t(e,n)}):i()(f.oneOf)?f.oneOf.map(function(e){return t(e,n)}):[t(f,n)]:e.enum?e.default?e.default:Object(o.c)(e.enum)[0]:"file"!==u?p(e):void 0})},function(t,e,n){"use strict";var r=n(158),i=n(160),o=n(375);t.exports=function(t){var e,u=r(arguments[1]);return u.normalizer||0!==(e=u.length=i(u.length,t.length,u.async))&&(u.primitive?!1===e?u.normalizer=n(402):e>1&&(u.normalizer=n(403)(e)):u.normalizer=!1===e?n(404)():1===e?n(408)():n(409)(e)),u.async&&n(410),u.promise&&n(411),u.dispose&&n(417),u.maxAge&&n(418),u.max&&n(421),u.refCounter&&n(423),o(t,u)}},function(t,e,n){t.exports=n(184)},function(t,e,n){var r=n(186);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){t.exports=!n(20)&&!n(30)(function(){return 7!=Object.defineProperty(n(113)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(29),i=n(16).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){"use strict";var r=n(189)(!0);n(115)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){"use strict";var r=n(51),i=n(15),o=n(116),u=n(27),s=n(52),a=n(190),c=n(84),f=n(119),l=n(17)("iterator"),h=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(t,e,n,d,y,w,v){a(n,e,d);var g,M,_,m=function(t){if(!h&&t in x)return x[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},L=e+" Iterator",b="values"==y,j=!1,x=t.prototype,N=x[l]||x["@@iterator"]||y&&x[y],S=N||m(y),D=y?b?m("entries"):S:void 0,I="Array"==e&&x.entries||N;if(I&&(_=f(I.call(new t)))!==Object.prototype&&_.next&&(c(_,L,!0),r||"function"==typeof _[l]||u(_,l,p)),b&&N&&"values"!==N.name&&(j=!0,S=function(){return N.call(this)}),r&&!v||!h&&!j&&x[l]||u(x,l,S),s[e]=S,s[L]=p,y)if(g={values:b?S:m("values"),keys:w?S:m("keys"),entries:D},v)for(M in g)M in x||o(x,M,g[M]);else i(i.P+i.F*(h||j),e,g);return g}},function(t,e,n){t.exports=n(27)},function(t,e,n){var r=n(21),i=n(31),o=n(192)(!1),u=n(81)("IE_PROTO");t.exports=function(t,e){var n,s=i(t),a=0,c=[];for(n in s)n!=u&&r(s,n)&&c.push(n);for(;e.length>a;)r(s,n=e[a++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){var r=n(80);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(21),i=n(54),o=n(81)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,e,n){n(196);for(var r=n(16),i=n(27),o=n(52),u=n(17)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),a=0;a<s.length;a++){var c=s[a],f=r[c],l=f&&f.prototype;l&&!l[u]&&i(l,u,c),o[c]=o.Array}},function(t,e,n){var r=n(80);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){var r=n(117),i=n(83).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},function(t,e,n){var r=n(55),i=n(50),o=n(31),u=n(76),s=n(21),a=n(112),c=Object.getOwnPropertyDescriptor;e.f=n(20)?c:function(t,e){if(t=o(t),e=u(e,!0),a)try{return c(t,e)}catch(t){}if(s(t,e))return i(!r.f.call(t,e),t[e])}},function(t,e,n){var r=n(15),i=n(4),o=n(30);t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],u={};u[t]=e(n),r(r.S+r.F*o(function(){n(1)}),"Object",u)}},function(t,e,n){t.exports=n(211)},function(t,e,n){"use strict";var r=n(56),i=n(40),o=n(127),u=(n(129),n(130));n(41),n(219);function s(t,e,n){this.props=t,this.context=e,this.refs=u,this.updater=n||o}function a(t,e,n){this.props=t,this.context=e,this.refs=u,this.updater=n||o}function c(){}s.prototype.isReactComponent={},s.prototype.setState=function(t,e){"object"!=typeof t&&"function"!=typeof t&&null!=t&&r("85"),this.updater.enqueueSetState(this,t),e&&this.updater.enqueueCallback(this,e,"setState")},s.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this),t&&this.updater.enqueueCallback(this,t,"forceUpdate")},c.prototype=s.prototype,a.prototype=new c,a.prototype.constructor=a,i(a.prototype,s.prototype),a.prototype.isPureReactComponent=!0,t.exports={Component:s,PureComponent:a}},function(t,e,n){"use strict";n(88);var r={isMounted:function(t){return!1},enqueueCallback:function(t,e){},enqueueForceUpdate:function(t){},enqueueReplaceState:function(t,e){},enqueueSetState:function(t,e){}};t.exports=r},function(t,e,n){"use strict";function r(t){return function(){return t}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(t){return t},t.exports=i},function(t,e,n){"use strict";t.exports=!1},function(t,e,n){"use strict";t.exports={}},function(t,e,n){"use strict";t.exports={current:null}},function(t,e,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;t.exports=r},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){t.exports=n(236)()},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n(10))},function(t,e){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=function(t){return n.test(t)}},function(t,e,n){var r=n(43),i=n(45),o="[object AsyncFunction]",u="[object Function]",s="[object GeneratorFunction]",a="[object Proxy]";t.exports=function(t){if(!i(t))return!1;var e=r(t);return e==u||e==s||e==o||e==a}},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,n){var r=n(61),i=n(298),o=n(299),u=n(300),s=n(301),a=n(302);function c(t){var e=this.__data__=new r(t);this.size=e.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=u,c.prototype.has=s,c.prototype.set=a,t.exports=c},function(t,e,n){var r=n(303),i=n(44);t.exports=function t(e,n,o,u,s){return e===n||(null==e||null==n||!i(e)&&!i(n)?e!=e&&n!=n:r(e,n,o,u,t,s))}},function(t,e,n){var r=n(304),i=n(143),o=n(307),u=1,s=2;t.exports=function(t,e,n,a,c,f){var l=n&u,h=t.length,p=e.length;if(h!=p&&!(l&&p>h))return!1;var d=f.get(t);if(d&&f.get(e))return d==e;var y=-1,w=!0,v=n&s?new r:void 0;for(f.set(t,e),f.set(e,t);++y<h;){var g=t[y],M=e[y];if(a)var _=l?a(M,g,y,e,t,f):a(g,M,y,t,e,f);if(void 0!==_){if(_)continue;w=!1;break}if(v){if(!i(e,function(t,e){if(!o(v,e)&&(g===t||c(g,t,n,a,f)))return v.push(e)})){w=!1;break}}else if(g!==M&&!c(g,M,n,a,f)){w=!1;break}}return f.delete(t),f.delete(e),w}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}},function(t,e,n){var r=n(321),i=n(44),o=Object.prototype,u=o.hasOwnProperty,s=o.propertyIsEnumerable,a=r(function(){return arguments}())?r:function(t){return i(t)&&u.call(t,"callee")&&!s.call(t,"callee")};t.exports=a},function(t,e,n){(function(t){var r=n(11),i=n(322),o=e&&!e.nodeType&&e,u=o&&"object"==typeof t&&t&&!t.nodeType&&t,s=u&&u.exports===o?r.Buffer:void 0,a=(s?s.isBuffer:void 0)||i;t.exports=a}).call(this,n(146)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){var r=n(323),i=n(324),o=n(325),u=o&&o.isTypedArray,s=u?i(u):r;t.exports=s},function(t,e,n){var r=n(45);t.exports=function(t){return t==t&&!r(t)}},function(t,e){t.exports=function(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}},function(t,e,n){var r=n(151),i=n(66);t.exports=function(t,e){for(var n=0,o=(e=r(e,t)).length;null!=t&&n<o;)t=t[i(e[n++])];return n&&n==o?t:void 0}},function(t,e,n){var r=n(12),i=n(94),o=n(338),u=n(42);t.exports=function(t,e){return r(t)?t:i(t,e)?[t]:o(u(t))}},function(t,e,n){"use strict";(function(e,r){var i=n(67);t.exports=M;var o,u=n(135);M.ReadableState=g;n(95).EventEmitter;var s=function(t,e){return t.listeners(e).length},a=n(153),c=n(8).Buffer,f=e.Uint8Array||function(){};var l=n(46);l.inherits=n(7);var h=n(361),p=void 0;p=h&&h.debuglog?h.debuglog("stream"):function(){};var d,y=n(362),w=n(154);l.inherits(M,a);var v=["error","close","destroy","pause","resume"];function g(t,e){t=t||{};var r=e instanceof(o=o||n(23));this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,u=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(u||0===u)?u:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new y,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(d||(d=n(156).StringDecoder),this.decoder=new d(t.encoding),this.encoding=t.encoding)}function M(t){if(o=o||n(23),!(this instanceof M))return new M(t);this._readableState=new g(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function _(t,e,n,r,i){var o,u=t._readableState;null===e?(u.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,j(t)}(t,u)):(i||(o=function(t,e){var n;r=e,c.isBuffer(r)||r instanceof f||"string"==typeof e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(u,e)),o?t.emit("error",o):u.objectMode||e&&e.length>0?("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function(t){return c.from(t)}(e)),r?u.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):m(t,u,e,!0):u.ended?t.emit("error",new Error("stream.push() after EOF")):(u.reading=!1,u.decoder&&!n?(e=u.decoder.write(e),u.objectMode||0!==e.length?m(t,u,e,!1):N(t,u)):m(t,u,e,!1))):r||(u.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(u)}function m(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&j(t)),N(t,e)}Object.defineProperty(M.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),M.prototype.destroy=w.destroy,M.prototype._undestroy=w.undestroy,M.prototype._destroy=function(t,e){this.push(null),e(t)},M.prototype.push=function(t,e){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=c.from(t,e),e=""),n=!0),_(this,t,e,!1,n)},M.prototype.unshift=function(t){return _(this,t,null,!0,!1)},M.prototype.isPaused=function(){return!1===this._readableState.flowing},M.prototype.setEncoding=function(t){return d||(d=n(156).StringDecoder),this._readableState.decoder=new d(t),this._readableState.encoding=t,this};var L=8388608;function b(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=L?t=L:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function j(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(p("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(x,t):x(t))}function x(t){p("emit readable"),t.emit("readable"),E(t)}function N(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(S,t,e))}function S(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(p("maybeReadMore read 0"),t.read(0),n!==e.length);)n=e.length;e.readingMore=!1}function D(t){p("readable nexttick read 0"),t.read(0)}function I(t,e){e.reading||(p("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),E(t),e.flowing&&!e.reading&&t.read(0)}function E(t){var e=t._readableState;for(p("flow",e.flowing);e.flowing&&null!==t.read(););}function C(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=function(t,e,n){var r;t<e.head.data.length?(r=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):r=t===e.head.data.length?e.shift():n?function(t,e){var n=e.head,r=1,i=n.data;t-=i.length;for(;n=n.next;){var o=n.data,u=t>o.length?o.length:t;if(u===o.length?i+=o:i+=o.slice(0,t),0===(t-=u)){u===o.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(u));break}++r}return e.length-=r,i}(t,e):function(t,e){var n=c.allocUnsafe(t),r=e.head,i=1;r.data.copy(n),t-=r.data.length;for(;r=r.next;){var o=r.data,u=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,u),0===(t-=u)){u===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(u));break}++i}return e.length-=i,n}(t,e);return r}(t,e.buffer,e.decoder),n);var n}function T(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(A,e,t))}function A(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function O(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}M.prototype.read=function(t){p("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return p("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?T(this):j(this),null;if(0===(t=b(t,e))&&e.ended)return 0===e.length&&T(this),null;var r,i=e.needReadable;return p("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&p("length less than watermark",i=!0),e.ended||e.reading?p("reading or ended",i=!1):i&&(p("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=b(n,e))),null===(r=t>0?C(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&T(this)),null!==r&&this.emit("data",r),r},M.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},M.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,p("pipe count=%d opts=%j",o.pipesCount,e);var a=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?f:M;function c(e,r){p("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,p("cleanup"),t.removeListener("close",v),t.removeListener("finish",g),t.removeListener("drain",l),t.removeListener("error",w),t.removeListener("unpipe",c),n.removeListener("end",f),n.removeListener("end",M),n.removeListener("data",y),h=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||l())}function f(){p("onend"),t.end()}o.endEmitted?i.nextTick(a):n.once("end",a),t.on("unpipe",c);var l=function(t){return function(){var e=t._readableState;p("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,E(t))}}(n);t.on("drain",l);var h=!1;var d=!1;function y(e){p("ondata"),d=!1,!1!==t.write(e)||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==O(o.pipes,t))&&!h&&(p("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function w(e){p("onerror",e),M(),t.removeListener("error",w),0===s(t,"error")&&t.emit("error",e)}function v(){t.removeListener("finish",g),M()}function g(){p("onfinish"),t.removeListener("close",v),M()}function M(){p("unpipe"),n.unpipe(t)}return n.on("data",y),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?u(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",w),t.once("close",v),t.once("finish",g),t.emit("pipe",n),o.flowing||(p("pipe resume"),n.resume()),t},M.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n),this);if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,n);return this}var u=O(e.pipes,t);return-1===u?this:(e.pipes.splice(u,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n),this)},M.prototype.on=function(t,e){var n=a.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&j(this):i.nextTick(D,this))}return n},M.prototype.addListener=M.prototype.on,M.prototype.resume=function(){var t=this._readableState;return t.flowing||(p("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(I,t,e))}(this,t)),this},M.prototype.pause=function(){return p("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(p("pause"),this._readableState.flowing=!1,this.emit("pause")),this},M.prototype.wrap=function(t){var e=this,n=this._readableState,r=!1;for(var i in t.on("end",function(){if(p("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(i){(p("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i)||(n.objectMode||i&&i.length)&&(e.push(i)||(r=!0,t.pause()))}),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<v.length;o++)t.on(v[o],this.emit.bind(this,v[o]));return this._read=function(e){p("wrapped _read",e),r&&(r=!1,t.resume())},this},Object.defineProperty(M.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),M._fromList=C}).call(this,n(10),n(22))},function(t,e,n){t.exports=n(95).EventEmitter},function(t,e,n){"use strict";var r=n(67);function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var n=this,o=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return o||u?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(r.nextTick(i,n,t),n._writableState&&(n._writableState.errorEmitted=!0)):e&&e(t)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(364),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(10))},function(t,e,n){"use strict";var r=n(8).Buffer,i=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=a,this.end=c,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function u(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function a(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function f(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var n=function(t,e,n){var r=e.length-1;if(r<n)return 0;var i=u(e[r]);if(i>=0)return i>0&&(t.lastNeed=i-1),i;if(--r<n||-2===i)return 0;if((i=u(e[r]))>=0)return i>0&&(t.lastNeed=i-2),i;if(--r<n||-2===i)return 0;if((i=u(e[r]))>=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,n){"use strict";t.exports=u;var r=n(23),i=n(46);function o(t,e){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=e&&this.push(e),r(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function u(t){if(!(this instanceof u))return new u(t);r.call(this,t),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",s)}function s(){var t=this;"function"==typeof this._flush?this._flush(function(e,n){a(t,e,n)}):a(this,null,null)}function a(t,e,n){if(e)return t.emit("error",e);if(null!=n&&t.push(n),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}i.inherits=n(7),i.inherits(u,r),u.prototype.push=function(t,e){return this._transformState.needTransform=!1,r.prototype.push.call(this,t,e)},u.prototype._transform=function(t,e,n){throw new Error("_transform() is not implemented")},u.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},u.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},u.prototype._destroy=function(t,e){var n=this;r.prototype._destroy.call(this,t,function(t){e(t),n.emit("close")})}},function(t,e,n){"use strict";var r=n(24),i=Array.prototype.forEach,o=Object.create,u=function(t,e){var n;for(n in t)e[n]=t[n]};t.exports=function(t){var e=o(null);return i.call(arguments,function(t){r(t)&&u(Object(t),e)}),e}},function(t,e,n){"use strict";t.exports=function(){}},function(t,e,n){"use strict";var r=n(25);t.exports=function(t,e,n){var i;return isNaN(t)?(i=e)>=0?n&&i?i-1:i:1:!1!==t&&r(t)}},function(t,e,n){"use strict";t.exports=n(379)()?Object.assign:n(380)},function(t,e,n){"use strict";var r,i,o,u,s,a=n(25),c=function(t,e){return e};try{Object.defineProperty(c,"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch(t){}1===c.length?(r={configurable:!0,writable:!1,enumerable:!1},i=Object.defineProperty,t.exports=function(t,e){return e=a(e),t.length===e?t:(r.value=e,i(t,"length",r))}):(u=n(163),s=[],o=function(t){var e,n=0;if(s[t])return s[t];for(e=[];t--;)e.push("a"+(++n).toString(36));return new Function("fn","return function ("+e.join(", ")+") { return fn.apply(this, arguments); };")},t.exports=function(t,e){var n;if(e=a(e),t.length===e)return t;n=o(e)(t);try{u(n,t)}catch(t){}return n})},function(t,e,n){"use strict";var r=n(34),i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols;t.exports=function(t,e){var n,a=Object(r(e));if(t=Object(r(t)),u(a).forEach(function(r){try{i(t,r,o(e,r))}catch(t){n=t}}),"function"==typeof s&&s(a).forEach(function(r){try{i(t,r,o(e,r))}catch(t){n=t}}),void 0!==n)throw n;return t}},function(t,e,n){"use strict";var r=n(18),i=n(68),o=Function.prototype.call;t.exports=function(t,e){var n={},u=arguments[2];return r(e),i(t,function(t,r,i,s){n[r]=o.call(e,u,t,r,i,s)}),n}},function(t,e){t.exports=function(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then}},function(t,e,n){var r=n(7),i=n(35),o=n(8).Buffer,u=[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],s=new Array(64);function a(){this.init(),this._w=s,i.call(this,64,56)}function c(t,e,n){return n^t&(e^n)}function f(t,e,n){return t&e|n&(t|e)}function l(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function h(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function p(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}r(a,i),a.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},a.prototype._update=function(t){for(var e,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,d=0|this._f,y=0|this._g,w=0|this._h,v=0;v<16;++v)n[v]=t.readInt32BE(4*v);for(;v<64;++v)n[v]=0|(((e=n[v-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+n[v-7]+p(n[v-15])+n[v-16];for(var g=0;g<64;++g){var M=w+h(a)+c(a,d,y)+u[g]+n[g]|0,_=l(r)+f(r,i,o)|0;w=y,y=d,d=a,a=s+M|0,s=o,o=i,i=r,r=M+_|0}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0,this._f=d+this._f|0,this._g=y+this._g|0,this._h=w+this._h|0},a.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=a},function(t,e,n){var r=n(7),i=n(35),o=n(8).Buffer,u=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function a(){this.init(),this._w=s,i.call(this,128,112)}function c(t,e,n){return n^t&(e^n)}function f(t,e,n){return t&e|n&(t|e)}function l(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function h(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function y(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function w(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function v(t,e){return t>>>0<e>>>0?1:0}r(a,i),a.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},a.prototype._update=function(t){for(var e=this._w,n=0|this._ah,r=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,a=0|this._fh,g=0|this._gh,M=0|this._hh,_=0|this._al,m=0|this._bl,L=0|this._cl,b=0|this._dl,j=0|this._el,x=0|this._fl,N=0|this._gl,S=0|this._hl,D=0;D<32;D+=2)e[D]=t.readInt32BE(4*D),e[D+1]=t.readInt32BE(4*D+4);for(;D<160;D+=2){var I=e[D-30],E=e[D-30+1],C=p(I,E),T=d(E,I),A=y(I=e[D-4],E=e[D-4+1]),O=w(E,I),z=e[D-14],k=e[D-14+1],Y=e[D-32],U=e[D-32+1],P=T+k|0,R=C+z+v(P,T)|0;R=(R=R+A+v(P=P+O|0,O)|0)+Y+v(P=P+U|0,U)|0,e[D]=R,e[D+1]=P}for(var Q=0;Q<160;Q+=2){R=e[Q],P=e[Q+1];var F=f(n,r,i),B=f(_,m,L),G=l(n,_),W=l(_,n),q=h(s,j),J=h(j,s),Z=u[Q],V=u[Q+1],X=c(s,a,g),H=c(j,x,N),K=S+J|0,$=M+q+v(K,S)|0;$=($=($=$+X+v(K=K+H|0,H)|0)+Z+v(K=K+V|0,V)|0)+R+v(K=K+P|0,P)|0;var tt=W+B|0,et=G+F+v(tt,W)|0;M=g,S=N,g=a,N=x,a=s,x=j,s=o+$+v(j=b+K|0,b)|0,o=i,b=L,i=r,L=m,r=n,m=_,n=$+et+v(_=K+tt|0,K)|0}this._al=this._al+_|0,this._bl=this._bl+m|0,this._cl=this._cl+L|0,this._dl=this._dl+b|0,this._el=this._el+j|0,this._fl=this._fl+x|0,this._gl=this._gl+N|0,this._hl=this._hl+S|0,this._ah=this._ah+n+v(this._al,_)|0,this._bh=this._bh+r+v(this._bl,m)|0,this._ch=this._ch+i+v(this._cl,L)|0,this._dh=this._dh+o+v(this._dl,b)|0,this._eh=this._eh+s+v(this._el,j)|0,this._fh=this._fh+a+v(this._fl,x)|0,this._gh=this._gh+g+v(this._gl,N)|0,this._hh=this._hh+M+v(this._hl,S)|0},a.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,n,r){t.writeInt32BE(e,r),t.writeInt32BE(n,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=a},function(t,e,n){"use strict";var r=n(37);t.exports=new r({include:[n(169)]})},function(t,e,n){"use strict";var r=n(37);t.exports=new r({include:[n(102)],implicit:[n(434),n(435),n(436),n(437)]})},function(t,e){t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgNDA3IDExNiI+DQogIDxkZWZzPg0KICAgIDxzdHlsZT4NCiAgICAgIC5jbHMtMSB7DQogICAgICAgIGNsaXAtcGF0aDogdXJsKCNjbGlwLVNXX1RNLWxvZ28tb24tZGFyayk7DQogICAgICB9DQoNCiAgICAgIC5jbHMtMiB7DQogICAgICAgIGZpbGw6ICNmZmY7DQogICAgICB9DQoNCiAgICAgIC5jbHMtMyB7DQogICAgICAgIGZpbGw6ICM4NWVhMmQ7DQogICAgICB9DQoNCiAgICAgIC5jbHMtNCB7DQogICAgICAgIGZpbGw6ICMxNzM2NDc7DQogICAgICB9DQogICAgPC9zdHlsZT4NCiAgICA8Y2xpcFBhdGggaWQ9ImNsaXAtU1dfVE0tbG9nby1vbi1kYXJrIj4NCiAgICAgIDxyZWN0IHdpZHRoPSI0MDciIGhlaWdodD0iMTE2Ii8+DQogICAgPC9jbGlwUGF0aD4NCiAgPC9kZWZzPg0KICA8ZyBpZD0iU1dfVE0tbG9nby1vbi1kYXJrIiBjbGFzcz0iY2xzLTEiPg0KICAgIDxnIGlkPSJTV19Jbi1Qcm9kdWN0IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMC4zMDEpIj4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5MzYiIGRhdGEtbmFtZT0iUGF0aCAyOTM2IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zNTkuMTUsNzAuNjc0aC0uN1Y2Ni45OTJoLTEuMjZ2LS42aDMuMjE5di42SDM1OS4xNVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5MzciIGRhdGEtbmFtZT0iUGF0aCAyOTM3IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zNjMuMjE3LDcwLjY3NCwzNjEuOTc1LDY3LjFoLS4wMjNxLjA1LjguMDUsMS40OTR2Mi4wODNoLS42MzZWNjYuMzkxaC45ODdsMS4xOSwzLjQwN2guMDE3bDEuMjI1LTMuNDA3aC45OXY0LjI4M0gzNjUuMVY2OC41NTZjMC0uMjEzLjAwNi0uNDkuMDE2LS44MzJzLjAyLS41NDkuMDI4LS42MjFoLS4wMjNsLTEuMjg2LDMuNTcxWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjkzOCIgZGF0YS1uYW1lPSJQYXRoIDI5MzgiIGNsYXNzPSJjbHMtMyIgZD0iTTUwLjMyOCw5Ny42NjlBNDcuNjQyLDQ3LjY0MiwwLDEsMSw5Ny45NzEsNTAuMDI3LDQ3LjY0Miw0Ny42NDIsMCwwLDEsNTAuMzI4LDk3LjY2OVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5MzkiIGRhdGEtbmFtZT0iUGF0aCAyOTM5IiBjbGFzcz0iY2xzLTMiIGQ9Ik01MC4zMjgsNC43NjlBNDUuMjU4LDQ1LjI1OCwwLDEsMSw1LjA3LDUwLjAyNyw0NS4yNTgsNDUuMjU4LDAsMCwxLDUwLjMyOCw0Ljc2OW0wLTQuNzY5YTUwLjAyNyw1MC4wMjcsMCwxLDAsNTAuMDI3LDUwLjAyN0E1MC4wMjcsNTAuMDI3LDAsMCwwLDUwLjMyOCwwWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk0MCIgZGF0YS1uYW1lPSJQYXRoIDI5NDAiIGNsYXNzPSJjbHMtNCIgZD0iTTMxLjgsMzMuODU0Yy0uMTU0LDEuNzEyLjA1OCwzLjQ4Mi0uMDU3LDUuMjEzYTQyLjY2NSw0Mi42NjUsMCwwLDEtLjY5Myw1LjE1Niw5LjUzLDkuNTMsMCwwLDEtNC4xLDUuODI5YzQuMDc5LDIuNjU0LDQuNTQsNi43NzEsNC44MSwxMC45NDYuMTM1LDIuMjUuMDc3LDQuNTIuMzA4LDYuNzUyLjE3MywxLjczMS44NDYsMi4xNzQsMi42MzYsMi4yMzEuNzMuMDIsMS40OCwwLDIuMzI3LDBWNzUuMzNjLTUuMjkuOS05LjY1Ny0uNi0xMC43MzQtNS4wNzlhMzAuNzYsMzAuNzYsMCwwLDEtLjY1NC01Yy0uMTE3LTEuNzg5LjA3Ni0zLjU3OC0uMDU4LTUuMzY3LS4zODYtNC45MDYtMS4wMi02LjU2LTUuNzEzLTYuNzkxdi02LjFBOS4xOTEsOS4xOTEsMCwwLDEsMjAuOSw0Ni44MmMyLjU3Ny0uMTM1LDMuNjc0LS45MjQsNC4yMzEtMy40NjNhMjkuMywyOS4zLDAsMCwwLC40ODEtNC4zMjksODIuMSw4Mi4xLDAsMCwxLC42LTguNDA2Yy42NzMtMy45ODIsMy4xMzYtNS45MDYsNy4yMzQtNi4xMzcsMS4xNTQtLjA1NywyLjMyNywwLDMuNjU1LDB2NS40NjRjLS41NTguMDM4LTEuMDM5LjExNS0xLjUzOS4xMTVDMzIuMjI2LDI5Ljk0OSwzMi4wNTIsMzEuMDg0LDMxLjgsMzMuODU0Wm02LjQwNiwxMi42NThoLS4wNzdhMy41MTUsMy41MTUsMCwxLDAtLjM0Niw3LjAyMWguMjMxYTMuNDYxLDMuNDYxLDAsMCwwLDMuNjU1LTMuMjUxVjUwLjA5YTMuNTIzLDMuNTIzLDAsMCwwLTMuNDYxLTMuNTc4Wm0xMi4wNjIsMGEzLjM3MywzLjM3MywwLDAsMC0zLjQ4MiwzLjI1MSwxLjc5LDEuNzksMCwwLDAsLjAyLjMyNywzLjMsMy4zLDAsMCwwLDMuNTc4LDMuNDQzLDMuMjYzLDMuMjYzLDAsMCwwLDMuNDQzLTMuNTU4LDMuMzA4LDMuMzA4LDAsMCwwLTMuNTU3LTMuNDYzWm0xMi4zNTEsMGEzLjU5MiwzLjU5MiwwLDAsMC0zLjY1NSwzLjQ4MkEzLjUyOSwzLjUyOSwwLDAsMCw2Mi41LDUzLjUzM2guMDM5YzEuNzY5LjMwOSwzLjU1OS0xLjQsMy42NzQtMy40NjJhMy41NzEsMy41NzEsMCwwLDAtMy42LTMuNTU5Wm0xNi45NDguMjg4Yy0yLjIzMi0uMS0zLjM0OC0uODQ2LTMuOS0yLjk2MmEyMS40NDcsMjEuNDQ3LDAsMCwxLS42MzUtNC4xMzZjLS4xNTQtMi41NzgtLjEzNS01LjE3NS0uMzA4LTcuNzUzLS40LTYuMTE3LTQuODI4LTguMjUyLTExLjI1NC03LjE5NXY1LjMxYzEuMDE5LDAsMS44MDgsMCwyLjYuMDE5LDEuMzY2LjAxOSwyLjQuNTM5LDIuNTM5LDIuMDU5LjEzNSwxLjM4NS4xMzUsMi43ODkuMjcsNC4xOTMuMjY5LDIuNzkuNDIyLDUuNjE4LjksOC4zNjlBOC43MTUsOC43MTUsMCwwLDAsNzMuNyw1MC4wNTJjLTMuNCwyLjI4OS00LjQwNiw1LjU1OS00LjU3OCw5LjIzNC0uMSwyLjUyLS4xNTQsNS4wNTktLjI4OSw3LjYtLjExNSwyLjMwOC0uOTIzLDMuMDU4LTMuMjUxLDMuMTE2LS42NTQuMDE5LTEuMjg5LjA3Ny0yLjAxOS4xMTV2NS40NDVjMS4zNjUsMCwyLjYxNi4wNzcsMy44NjYsMCwzLjg4Ni0uMjMxLDYuMjMzLTIuMTE3LDctNS44ODdBNDkuMDc5LDQ5LjA3OSwwLDAsMCw3NSw2My40Yy4xMzUtMS45MjMuMTE2LTMuODY2LjMwOC01Ljc3MS4yODktMi45ODIsMS42NTUtNC4yMTMsNC42MzYtNC40YTQuMDM3LDQuMDM3LDAsMCwwLC44MjgtLjE5MnYtNi4xYy0uNS0uMDU4LS44NDMtLjExNS0xLjIwOC0uMTM1WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk0MSIgZGF0YS1uYW1lPSJQYXRoIDI5NDEiIGNsYXNzPSJjbHMtMiIgZD0iTTE1Mi4yNzMsNTguMTIyYTExLjIyOCwxMS4yMjgsMCwwLDEtNC4zODQsOS40MjRxLTQuMzgzLDMuMzgyLTExLjksMy4zODItOC4xNCwwLTEyLjUyNC0yLjFWNjMuN2EzMi45LDMyLjksMCwwLDAsNi4xMzcsMS44NzksMzIuMywzMi4zLDAsMCwwLDYuNTc1LjY4OXE1LjMyMiwwLDguMDE1LTIuMDJhNi42MjYsNi42MjYsMCwwLDAsMi42OTItNS42Miw3LjIyMiw3LjIyMiwwLDAsMC0uOTU0LTMuOSw4Ljg4NSw4Ljg4NSwwLDAsMC0zLjE5NC0yLjgsNDQuNjM0LDQ0LjYzNCwwLDAsMC02LjgxLTIuOTExcS02LjM4Ny0yLjI4Ni05LjEyNi01LjQxN2ExMS45NTUsMTEuOTU1LDAsMCwxLTIuNzQtOC4xNzJBMTAuMTY0LDEwLjE2NCwwLDAsMSwxMjguMDM5LDI3cTMuOTc3LTMuMTMxLDEwLjUyLTMuMTMxYTMxLDMxLDAsMCwxLDEyLjU1NSwyLjVMMTQ5LjQ1NSwzMWEyOC4zODIsMjguMzgyLDAsMCwwLTExLjAyMS0yLjM4LDEwLjY2OCwxMC42NjgsMCwwLDAtNi42MDYsMS44MTYsNS45ODQsNS45ODQsMCwwLDAtMi4zOCw1LjA0MSw3LjcyMiw3LjcyMiwwLDAsMCwuODc3LDMuOSw4LjI0Miw4LjI0MiwwLDAsMCwyLjk1OSwyLjc4NiwzNi43LDM2LjcsMCwwLDAsNi4zNzEsMi44cTcuMiwyLjU2Niw5LjkxLDUuNTFBMTAuODQsMTAuODQsMCwwLDEsMTUyLjI3Myw1OC4xMjJaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQyIiBkYXRhLW5hbWU9IlBhdGggMjk0MiIgY2xhc3M9ImNscy0yIiBkPSJNMTg1LjI4OCw3MC4zLDE3OSw1MC4xN3EtLjU5NC0xLjg0OC0yLjIyMi04LjM5MWgtLjI1MXEtMS4yNTIsNS40NzktMi4xOTIsOC40NTNMMTY3Ljg0OSw3MC4zaC02LjAxMWwtOS4zNjEtMzQuMzE1aDUuNDQ3cTMuMzE4LDEyLjkzMSw1LjA1NywxOS42OTNhODAuMTEyLDgwLjExMiwwLDAsMSwxLjk4OCw5LjExMWguMjVxLjM0NS0xLjc4NSwxLjExMi00LjYxOHQxLjMzLTQuNDkzbDYuMjk0LTE5LjY5M2g1LjYzNWw2LjEzNywxOS42OTNhNjYuMzY5LDY2LjM2OSwwLDAsMSwyLjM3OSw5LjA0OGguMjUxYTMzLjE2MywzMy4xNjMsMCwwLDEsLjY3My0zLjQ3NXEuNTQ4LTIuMzQ3LDYuNTI4LTI1LjI2Nmg1LjM4NUwxOTEuNDU2LDcwLjNaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQzIiBkYXRhLW5hbWU9IlBhdGggMjk0MyIgY2xhc3M9ImNscy0yIiBkPSJNMjI1LjExNSw3MC4zbC0xLjAzMy00Ljg4NWgtLjI1YTE0LjQ0NiwxNC40NDYsMCwwLDEtNS4xMTksNC4zNjgsMTUuNjA4LDE1LjYwOCwwLDAsMS02LjM3MiwxLjE0M3EtNS4xLDAtOC0yLjYzdC0yLjktNy40ODNxMC0xMC40LDE2LjYyNi0xMC45bDUuODIzLS4xODhWNDcuNnEwLTQuMDM4LTEuNzM4LTUuOTY0VDIxNi42LDM5LjcxM2EyMi42MzMsMjIuNjMzLDAsMCwwLTkuNzA2LDIuNjNsLTEuNi0zLjk3N2EyNC40MzcsMjQuNDM3LDAsMCwxLDUuNTU3LTIuMTYsMjQuMDU2LDI0LjA1NiwwLDAsMSw2LjA1OC0uNzgzcTYuMTM2LDAsOS4xLDIuNzI0dDIuOTU5LDguNzM1VjcwLjNabS0xMS43NDEtMy42NjNBMTAuNTQ5LDEwLjU0OSwwLDAsMCwyMjEsNjMuOTc3YTkuODQ1LDkuODQ1LDAsMCwwLDIuNzcxLTcuNDUxdi0zLjFsLTUuMi4yMTlxLTYuMi4yMTktOC45MzksMS45MjZhNS44LDUuOCwwLDAsMC0yLjc0LDUuMzA2LDUuMzU0LDUuMzU0LDAsMCwwLDEuNzA3LDQuMjksNy4wODEsNy4wODEsMCwwLDAsNC43NzUsMS40NzJaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQ0IiBkYXRhLW5hbWU9IlBhdGggMjk0NCIgY2xhc3M9ImNscy0yIiBkPSJNMjY0LjYsMzUuOTg3djMuMjg3bC02LjM1Ni43NTJhMTEuMTYsMTEuMTYsMCwwLDEsMi4yNTUsNi44NTYsMTAuMTQ4LDEwLjE0OCwwLDAsMS0zLjQ0NCw4LjA0N3EtMy40NDQsMy05LjQ1NiwzYTE1LjczNCwxNS43MzQsMCwwLDEtMi44OC0uMjVRMjQxLjQsNTkuNDM4LDI0MS40LDYyLjFhMi4yNDIsMi4yNDIsMCwwLDAsMS4xNTksMi4wODIsOC40NTYsOC40NTYsMCwwLDAsMy45NzYuNjczaDYuMDc0cTUuNTczLDAsOC41NjMsMi4zNDhhOC4xNTgsOC4xNTgsMCwwLDEsMi45OSw2LjgyNSw5Ljc0Myw5Ljc0MywwLDAsMS00LjU3MSw4LjY4OHEtNC41NzIsMi45ODktMTMuMzM4LDIuOTktNi43MzIsMC0xMC4zNzktMi41YTguMDg3LDguMDg3LDAsMCwxLTMuNjQ3LTcuMDc2LDcuOTQ2LDcuOTQ2LDAsMCwxLDItNS40MTcsMTAuMjExLDEwLjIxMSwwLDAsMSw1LjYzNi0zLjEsNS40MjksNS40MjksMCwwLDEtMi4yMDctMS44NDcsNC44OSw0Ljg5LDAsMCwxLS44OTMtMi45MTIsNS41Myw1LjUzLDAsMCwxLDEtMy4yODgsMTAuNTI5LDEwLjUyOSwwLDAsMSwzLjE2Mi0yLjcyMyw5LjI3NSw5LjI3NSwwLDAsMS00LjMzNi0zLjcyNiwxMC45NDUsMTAuOTQ1LDAsMCwxLTEuNjc1LTYuMDEycTAtNS42MzQsMy4zODItOC42ODh0OS41OC0zLjA1MmExNy40MzksMTcuNDM5LDAsMCwxLDQuODUzLjYyNlpNMjM3LjIzMyw3Ni4wNjJhNC42Niw0LjY2LDAsMCwwLDIuMzQ4LDQuMjI3LDEyLjk3MywxMi45NzMsMCwwLDAsNi43MzIsMS40NHE2LjU0MywwLDkuNjktMS45NTZhNS45OTIsNS45OTIsMCwwLDAsMy4xNDctNS4zMDdxMC0yLjc4Ny0xLjcyMy0zLjg2N3QtNi40ODEtMS4wOGgtNi4yM2E4LjIwNSw4LjIwNSwwLDAsMC01LjUxLDEuNjksNi4wNDMsNi4wNDMsMCwwLDAtMS45NzMsNC44NTNabTIuODE4LTI5LjA4NmE2Ljk4NCw2Ljk4NCwwLDAsMCwyLjAzNSw1LjQ0OCw4LjEyMyw4LjEyMywwLDAsMCw1LjY2NywxLjg0N3E3LjYwOCwwLDcuNjA4LTcuMzg5LDAtNy43MzMtNy43LTcuNzMzYTcuNjI4LDcuNjI4LDAsMCwwLTUuNjM1LDEuOTcycS0xLjk3NiwxLjk3My0xLjk3NSw1Ljg1NVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NDUiIGRhdGEtbmFtZT0iUGF0aCAyOTQ1IiBjbGFzcz0iY2xzLTIiIGQ9Ik0yOTkuMTM2LDM1Ljk4N3YzLjI4N2wtNi4zNTYuNzUyYTExLjE2OCwxMS4xNjgsMCwwLDEsMi4yNTQsNi44NTYsMTAuMTQ1LDEwLjE0NSwwLDAsMS0zLjQ0NCw4LjA0N3EtMy40NDQsMy05LjQ1NSwzYTE1LjczNCwxNS43MzQsMCwwLDEtMi44OC0uMjVxLTMuMzIsMS43NTQtMy4zMTksNC40MTVhMi4yNDMsMi4yNDMsMCwwLDAsMS4xNTgsMi4wODIsOC40NTksOC40NTksMCwwLDAsMy45NzYuNjczaDYuMDc0cTUuNTc0LDAsOC41NjMsMi4zNDhhOC4xNTgsOC4xNTgsMCwwLDEsMi45OSw2LjgyNSw5Ljc0Myw5Ljc0MywwLDAsMS00LjU3MSw4LjY4OHEtNC41NywyLjk4OS0xMy4zMzcsMi45OS02LjczMiwwLTEwLjM3OS0yLjVhOC4wODgsOC4wODgsMCwwLDEtMy42NDgtNy4wNzYsNy45NDcsNy45NDcsMCwwLDEsMi01LjQxNywxMC4yMDcsMTAuMjA3LDAsMCwxLDUuNjM2LTMuMSw1LjQzMiw1LjQzMiwwLDAsMS0yLjIwOC0xLjg0Nyw0Ljg4OSw0Ljg4OSwwLDAsMS0uODkyLTIuOTEyLDUuNTMsNS41MywwLDAsMSwxLTMuMjg4LDEwLjUyOSwxMC41MjksMCwwLDEsMy4xNjItMi43MjMsOS4yNzEsOS4yNzEsMCwwLDEtNC4zMzYtMy43MjYsMTAuOTQ1LDEwLjk0NSwwLDAsMS0xLjY3NS02LjAxMnEwLTUuNjM0LDMuMzgxLTguNjg4dDkuNTgxLTMuMDUyYTE3LjQ0NCwxNy40NDQsMCwwLDEsNC44NTMuNjI2Wk0yNzEuNzcyLDc2LjA2MmE0LjY1OCw0LjY1OCwwLDAsMCwyLjM0OCw0LjIyNywxMi45NjksMTIuOTY5LDAsMCwwLDYuNzMxLDEuNDRxNi41NDQsMCw5LjY5MS0xLjk1NmE1Ljk5Myw1Ljk5MywwLDAsMCwzLjE0Ni01LjMwN3EwLTIuNzg3LTEuNzIyLTMuODY3dC02LjQ4MS0xLjA4aC02LjIzYTguMjA4LDguMjA4LDAsMCwwLTUuNTExLDEuNjlBNi4wNDIsNi4wNDIsMCwwLDAsMjcxLjc3Miw3Ni4wNjJabTIuODE4LTI5LjA4NmE2Ljk4NCw2Ljk4NCwwLDAsMCwyLjAzNSw1LjQ0OCw4LjEyMSw4LjEyMSwwLDAsMCw1LjY2NywxLjg0N3E3LjYwNywwLDcuNjA4LTcuMzg5LDAtNy43MzMtNy43LTcuNzMzYTcuNjI5LDcuNjI5LDAsMCwwLTUuNjM1LDEuOTcycS0xLjk3NSwxLjk3My0xLjk3NSw1Ljg1NVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NDYiIGRhdGEtbmFtZT0iUGF0aCAyOTQ2IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zMTYuNzc4LDcwLjkyOHEtNy42MDgsMC0xMi4wMDctNC42MzR0LTQuNC0xMi44NjhxMC04LjMsNC4wODYtMTMuMTgxYTEzLjU3MywxMy41NzMsMCwwLDEsMTAuOTc0LTQuODg0QTEyLjkzOCwxMi45MzgsMCwwLDEsMzI1LjYzOCwzOS42cTMuNzYyLDQuMjQ3LDMuNzYyLDExLjJ2My4yODdIMzA1Ljc1N3EuMTU2LDYuMDQ0LDMuMDUzLDkuMTc0dDguMTU2LDMuMTMxYTI3LjYzMywyNy42MzMsMCwwLDAsMTAuOTU4LTIuMzE3djQuNjM0YTI3LjUsMjcuNSwwLDAsMS01LjIxMywxLjcwNiwyOS4yNTEsMjkuMjUxLDAsMCwxLTUuOTMzLjUxM1ptLTEuNDA5LTMxLjIxNWE4LjQ4OSw4LjQ4OSwwLDAsMC02LjU5MSwyLjY5MiwxMi40MTYsMTIuNDE2LDAsMCwwLTIuOSw3LjQ1MmgxNy45NHEwLTQuOTE2LTIuMTkxLTcuNTNhNy43MTQsNy43MTQsMCwwLDAtNi4yNTgtMi42MTRaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQ3IiBkYXRhLW5hbWU9IlBhdGggMjk0NyIgY2xhc3M9ImNscy0yIiBkPSJNMzUwLjksMzUuMzYxYTIwLjM4LDIwLjM4LDAsMCwxLDQuMS4zNzVsLS43MjEsNC44MjJhMTcuNzEyLDE3LjcxMiwwLDAsMC0zLjc1Ny0uNDdBOS4xNDIsOS4xNDIsMCwwLDAsMzQzLjQsNDMuNDdhMTIuMzI3LDEyLjMyNywwLDAsMC0yLjk1OSw4LjQyMlY3MC4zaC01LjJWMzUuOTg3aDQuMjlsLjYsNi4zNTZoLjI1YTE1LjA3MiwxNS4wNzIsMCwwLDEsNC42LTUuMTY2LDEwLjM1NiwxMC4zNTYsMCwwLDEsNS45MTktMS44MTZaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQ4IiBkYXRhLW5hbWU9IlBhdGggMjk0OCIgY2xhc3M9ImNscy0yIiBkPSJNMjU1Ljg1Nyw5Ni42MzhzLTMuNDMtLjM5MS00Ljg1LS4zOTFjLTIuMDU4LDAtMy4xMTEuNzM1LTMuMTExLDIuMTgsMCwxLjU2OC44ODIsMS45MzUsMy43NDgsMi43MTksMy41MjcuOTgsNC44LDEuOTExLDQuOCw0Ljc3NywwLDMuNjc1LTIuMyw1LjI2Ny01LjYxLDUuMjY3YTM1LjY4NywzNS42ODcsMCwwLDEtNS40ODctLjY2MmwuMjctMi4xOHMzLjMwNi40NDEsNS4wNDYuNDQxYzIuMDgyLDAsMy4wMzctLjkzMSwzLjAzNy0yLjcsMC0xLjQyMS0uNzU5LTEuOTEtMy4zMzEtMi41MjMtMy42MjYtLjkzLTUuMTkzLTIuMDMzLTUuMTkzLTQuOTQ4LDAtMy4zODEsMi4yMjktNC43NzYsNS41ODUtNC43NzZhMzcuMiwzNy4yLDAsMCwxLDUuMzE1LjU4N1oiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NDkiIGRhdGEtbmFtZT0iUGF0aCAyOTQ5IiBjbGFzcz0iY2xzLTIiIGQ9Ik0yNjIuOTY3LDk0LjE0SDI2Ny43bDMuNzQ4LDEzLjEwNkwyNzUuMiw5NC4xNGg0Ljc1MnYxNi43OEgyNzcuMlY5Ni40MmgtLjE0NWwtNC4xOTEsMTMuODE2aC0yLjg0MkwyNjUuODMxLDk2LjQyaC0uMTQ1djE0LjVoLTIuNzE5WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk1MCIgZGF0YS1uYW1lPSJQYXRoIDI5NTAiIGNsYXNzPSJjbHMtMiIgZD0iTTMyMi4wNTcsOTQuMTRIMzM0LjN2Mi40MjVoLTQuNzI4VjExMC45MmgtMi43NDNWOTYuNTY1aC00Ljc3N1oiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NTEiIGRhdGEtbmFtZT0iUGF0aCAyOTUxIiBjbGFzcz0iY2xzLTIiIGQ9Ik0zNDYuMTM3LDk0LjE0YzMuMzMyLDAsNS4xMiwxLjI0OSw1LjEyLDQuMzYxLDAsMi4wMzMtLjYzNywzLjAzNy0xLjk4NCwzLjc3MiwxLjQ0NS41NjMsMi40LDEuNTkyLDIuNCwzLjksMCwzLjQzLTIuMDgxLDQuNzUyLTUuMzM5LDQuNzUyaC02LjU2NlY5NC4xNFptLTMuNjUsMi4zNTJ2NC44aDMuNmMxLjY2NiwwLDIuNC0uODMyLDIuNC0yLjQ3NCwwLTEuNjE3LS44MzMtMi4zMjctMi41LTIuMzI3Wm0wLDcuMXY0Ljk3M2gzLjdjMS42ODksMCwyLjY5NC0uNTM5LDIuNjk0LTIuNTQ4LDAtMS45MTEtMS40MjEtMi40MjUtMi43NDQtMi40MjVaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTUyIiBkYXRhLW5hbWU9IlBhdGggMjk1MiIgY2xhc3M9ImNscy0yIiBkPSJNMzU4LjQxNCw5NC4xNEgzNjl2Mi4zNzdoLTcuODY0djQuNzUxaDYuMzk0VjEwMy42aC02LjM5NHY0LjkyNEgzNjl2Mi40SDM1OC40MTRaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTUzIiBkYXRhLW5hbWU9IlBhdGggMjk1MyIgY2xhc3M9ImNscy0yIiBkPSJNMzc4Ljc0Nyw5NC4xNGg1LjQxNGw0LjE2NCwxNi43OGgtMi43NDRMMzg0LjM0MiwxMDZoLTUuNzc3bC0xLjIzOSw0LjkyM2gtMi43MTlabS4zNjEsOS40NTZoNC43MDhsLTEuNzM3LTcuMTc4aC0xLjIyNVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NTQiIGRhdGEtbmFtZT0iUGF0aCAyOTU0IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zOTcuMSwxMDUuOTQ3djQuOTczaC0yLjcxOVY5NC4xNGg2LjM3YzMuNywwLDUuNjgzLDIuMTIsNS42ODMsNS44NDMsMCwyLjM3Ni0uOTU2LDQuNTE5LTIuNzQ0LDUuMzUybDIuNzY5LDUuNTg1SDQwMy40N2wtMi40MjYtNC45NzNabTMuNjUxLTkuNDU1SDM5Ny4xdjcuMWgzLjdjMi4wNTcsMCwyLjg0MS0xLjg1LDIuODQxLTMuNTg5LDAtMS45LS45MzQtMy41MTEtMi44OTQtMy41MTFaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTU1IiBkYXRhLW5hbWU9IlBhdGggMjk1NSIgY2xhc3M9ImNscy0yIiBkPSJNMjkwLjAxMyw5NC4xNGg1LjQxM2w0LjE2NCwxNi43OGgtMi43NDNMMjk1LjYwOCwxMDZoLTUuNzc3bC0xLjIzOSw0LjkyM2gtMi43MTlabS4zNjEsOS40NTZoNC43MDdsLTEuNzM3LTcuMTc4aC0xLjIyNVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NTYiIGRhdGEtbmFtZT0iUGF0aCAyOTU2IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zMDguMzYyLDEwNS45NDd2NC45NzNoLTIuNzE5Vjk0LjE0aDYuMzY5YzMuNywwLDUuNjgzLDIuMTIsNS42ODMsNS44NDMsMCwyLjM3Ni0uOTU1LDQuNTE5LTIuNzQzLDUuMzUybDIuNzY4LDUuNTg1aC0yLjk4OWwtMi40MjUtNC45NzNabTMuNjUtOS40NTVoLTMuNjV2Ny4xaDMuN2MyLjA1OCwwLDIuODQxLTEuODUsMi44NDEtMy41ODlDMzE0LjksOTguMSwzMTMuOTcyLDk2LjQ5MiwzMTIuMDEyLDk2LjQ5MloiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NTciIGRhdGEtbmFtZT0iUGF0aCAyOTU3IiBjbGFzcz0iY2xzLTIiIGQ9Ik0xMzAuNjA2LDEwNy42NDNhMy4wMiwzLjAyLDAsMCwxLTEuMTgsMi41MzcsNS4xMTMsNS4xMTMsMCwwLDEtMy4yLjkxLDguMDMsOC4wMywwLDAsMS0zLjM3MS0uNTY0di0xLjM4M2E4Ljc5Myw4Ljc5MywwLDAsMCwxLjY1Mi41MDYsOC42NzIsOC42NzIsMCwwLDAsMS43Ny4xODYsMy41NjUsMy41NjUsMCwwLDAsMi4xNTctLjU0NCwxLjc4MywxLjc4MywwLDAsMCwuNzI1LTEuNTEyLDEuOTQ3LDEuOTQ3LDAsMCwwLS4yNTctMS4wNSwyLjM5MywyLjM5MywwLDAsMC0uODYtLjc1NCwxMi4xNzEsMTIuMTcxLDAsMCwwLTEuODMzLS43ODQsNS44NDIsNS44NDIsMCwwLDEtMi40NTYtMS40NTgsMy4yMTMsMy4yMTMsMCwwLDEtLjczOC0yLjIsMi43MzYsMi43MzYsMCwwLDEsMS4wNzEtMi4yNjcsNC40NDQsNC40NDQsMCwwLDEsMi44MzEtLjg0Myw4LjM0MSw4LjM0MSwwLDAsMSwzLjM4LjY3NWwtLjQ0NywxLjI0N2E3LjYzOSw3LjYzOSwwLDAsMC0yLjk2Ni0uNjQxLDIuODc4LDIuODc4LDAsMCwwLTEuNzc5LjQ4OSwxLjYxMiwxLjYxMiwwLDAsMC0uNjQsMS4zNTcsMi4wODEsMi4wODEsMCwwLDAsLjIzNiwxLjA0OSwyLjIzMSwyLjIzMSwwLDAsMCwuOC43NSw5Ljg3OCw5Ljg3OCwwLDAsMCwxLjcxNS43NTQsNi44LDYuOCwwLDAsMSwyLjY2NywxLjQ4MywyLjkxOSwyLjkxOSwwLDAsMSwuNzIzLDIuMDU3WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk1OCIgZGF0YS1uYW1lPSJQYXRoIDI5NTgiIGNsYXNzPSJjbHMtMiIgZD0iTTEzNC40NDcsMTAxLjY4NnY1Ljk5MWEyLjQxMSwyLjQxMSwwLDAsMCwuNTE1LDEuNjg2LDIuMDksMi4wOSwwLDAsMCwxLjYwOS41NTYsMi42MjksMi42MjksMCwwLDAsMi4xMi0uNzkyLDQsNCwwLDAsMCwuNjctMi41ODd2LTQuODU0aDEuNHY5LjIzNkgxMzkuNmwtLjItMS4yMzloLS4wNzVhMi43OTMsMi43OTMsMCwwLDEtMS4xOTMsMS4wNDUsNCw0LDAsMCwxLTEuNzQuMzYyLDMuNTI5LDMuNTI5LDAsMCwxLTIuNTI0LS44LDMuNDA5LDMuNDA5LDAsMCwxLS44MzktMi41NjJ2LTYuMDQyWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk1OSIgZGF0YS1uYW1lPSJQYXRoIDI5NTkiIGNsYXNzPSJjbHMtMiIgZD0iTTE0OC4yMDYsMTExLjA5YTMuOTkzLDMuOTkzLDAsMCwxLTEuNjQ3LS4zMzMsMy4xLDMuMSwwLDAsMS0xLjI1Mi0xLjAyM2gtLjFhMTIuMjY1LDEyLjI2NSwwLDAsMSwuMSwxLjUzM3YzLjhoLTEuNFYxMDEuNjg2aDEuMTM3bC4xOTQsMS4yNjRoLjA2N2EzLjI1NywzLjI1NywwLDAsMSwxLjI1Ni0xLjEsMy44MzEsMy44MzEsMCwwLDEsMS42NDMtLjMzNywzLjQxMywzLjQxMywwLDAsMSwyLjgzNiwxLjI1Niw2LjY4Myw2LjY4MywwLDAsMS0uMDE3LDcuMDU3LDMuNDIsMy40MiwwLDAsMS0yLjgxNywxLjI2NFptLS4yLTguMzg1YTIuNDgyLDIuNDgyLDAsMCwwLTIuMDQ4Ljc4NCw0LjA0MSw0LjA0MSwwLDAsMC0uNjQ5LDIuNDk0di4zMTJhNC42MjUsNC42MjUsMCwwLDAsLjY0OSwyLjc4NSwyLjQ2NywyLjQ2NywwLDAsMCwyLjA4Mi44MzksMi4xNjQsMi4xNjQsMCwwLDAsMS44NzUtLjk2OSw0LjYsNC42LDAsMCwwLC42NzgtMi42NzEsNC40MjgsNC40MjgsMCwwLDAtLjY3OC0yLjY1MSwyLjIzMiwyLjIzMiwwLDAsMC0xLjkxNS0uOTIzWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2MCIgZGF0YS1uYW1lPSJQYXRoIDI5NjAiIGNsYXNzPSJjbHMtMiIgZD0iTTE1OS4wMzksMTExLjA5YTMuOTkzLDMuOTkzLDAsMCwxLTEuNjQ3LS4zMzMsMy4xLDMuMSwwLDAsMS0xLjI1Mi0xLjAyM2gtLjFhMTIuMjY1LDEyLjI2NSwwLDAsMSwuMSwxLjUzM3YzLjhoLTEuNFYxMDEuNjg2aDEuMTM3bC4xOTQsMS4yNjRoLjA2N2EzLjI1NywzLjI1NywwLDAsMSwxLjI1Ni0xLjEsMy44MzEsMy44MzEsMCwwLDEsMS42NDMtLjMzNywzLjQxMywzLjQxMywwLDAsMSwyLjgzNiwxLjI1Niw2LjY4Myw2LjY4MywwLDAsMS0uMDE3LDcuMDU3LDMuNDIsMy40MiwwLDAsMS0yLjgxNywxLjI2NFptLS4yLTguMzg1YTIuNDgyLDIuNDgyLDAsMCwwLTIuMDQ4Ljc4NCw0LjA0MSw0LjA0MSwwLDAsMC0uNjQ5LDIuNDk0di4zMTJhNC42MjUsNC42MjUsMCwwLDAsLjY0OSwyLjc4NSwyLjQ2NywyLjQ2NywwLDAsMCwyLjA4Mi44MzksMi4xNjQsMi4xNjQsMCwwLDAsMS44NzUtLjk2OSw0LjYsNC42LDAsMCwwLC42NzgtMi42NzEsNC40MjgsNC40MjgsMCwwLDAtLjY3OC0yLjY1MSwyLjIzMiwyLjIzMiwwLDAsMC0xLjkxMS0uOTIzWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2MSIgZGF0YS1uYW1lPSJQYXRoIDI5NjEiIGNsYXNzPSJjbHMtMiIgZD0iTTE3My42MTIsMTA2LjNhNS4wOTMsNS4wOTMsMCwwLDEtMS4xMzcsMy41MjcsNC4wMDUsNC4wMDUsMCwwLDEtMy4xNDMsMS4yNjgsNC4xNzIsNC4xNzIsMCwwLDEtMi4yLS41ODEsMy44NCwzLjg0LDAsMCwxLTEuNDgzLTEuNjY5LDUuOCw1LjgsMCwwLDEtLjUyMi0yLjU0NSw1LjA4Nyw1LjA4NywwLDAsMSwxLjEyOS0zLjUxOCwzLjk5MSwzLjk5MSwwLDAsMSwzLjEzNS0xLjI2LDMuOTA3LDMuOTA3LDAsMCwxLDMuMDgsMS4yOSw1LjA3MSw1LjA3MSwwLDAsMSwxLjE0MSwzLjQ4OFptLTcuMDM2LDBhNC4zODQsNC4zODQsMCwwLDAsLjcwOCwyLjcsMi44MDksMi44MDksMCwwLDAsNC4xNjcsMCw0LjM2NSw0LjM2NSwwLDAsMCwuNzEyLTIuNyw0LjI5Myw0LjI5MywwLDAsMC0uNzEyLTIuNjc1LDIuNSwyLjUsMCwwLDAtMi4xLS45MTUsMi40NjEsMi40NjEsMCwwLDAtMi4wNzIuOSw0LjMzNCw0LjMzNCwwLDAsMC0uNywyLjY5WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2MiIgZGF0YS1uYW1lPSJQYXRoIDI5NjIiIGNsYXNzPSJjbHMtMiIgZD0iTTE4MC41MjUsMTAxLjUxN2E1LjUwNiw1LjUwNiwwLDAsMSwxLjEuMWwtLjE5NCwxLjNhNC43ODYsNC43ODYsMCwwLDAtMS4wMTEtLjEyNywyLjQ2LDIuNDYsMCwwLDAtMS45MTcuOTExLDMuMzE4LDMuMzE4LDAsMCwwLS44LDIuMjY3djQuOTU1aC0xLjR2LTkuMjM2aDEuMTU0bC4xNiwxLjcxaC4wNjhhNC4wNTQsNC4wNTQsMCwwLDEsMS4yMzgtMS4zOSwyLjc4NywyLjc4NywwLDAsMSwxLjYtLjQ5WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2MyIgZGF0YS1uYW1lPSJQYXRoIDI5NjMiIGNsYXNzPSJjbHMtMiIgZD0iTTE4Ny4zNjMsMTA5LjkzNmE0LjUwNiw0LjUwNiwwLDAsMCwuNzE2LS4wNTUsNC4zODcsNC4zODcsMCwwLDAsLjU0OC0uMTE0djEuMDdhMi41LDIuNSwwLDAsMS0uNjcuMTgxLDUsNSwwLDAsMS0uOC4wNzJxLTIuNjgsMC0yLjY4LTIuODIzdi01LjQ5NGgtMS4zMjNWMTAyLjFsMS4zMjMtLjU4Mi41OS0xLjk3MmguODA5djIuMTQxaDIuNjh2MS4wODdoLTIuNjh2NS40MzVhMS44NjksMS44NjksMCwwLDAsLjQsMS4yODFBMS4zNzcsMS4zNzcsMCwwLDAsMTg3LjM2MywxMDkuOTM2WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2NCIgZGF0YS1uYW1lPSJQYXRoIDI5NjQiIGNsYXNzPSJjbHMtMiIgZD0iTTE5NC41MzgsMTExLjA5YTQuMjM5LDQuMjM5LDAsMCwxLTMuMjMxLTEuMjQ3LDQuODI0LDQuODI0LDAsMCwxLTEuMTg0LTMuNDYzLDUuMzU1LDUuMzU1LDAsMCwxLDEuMS0zLjU0OCwzLjY1MiwzLjY1MiwwLDAsMSwyLjk1NC0xLjMxNSwzLjQ4NCwzLjQ4NCwwLDAsMSwyLjc0NywxLjE0Miw0LjM3OCw0LjM3OCwwLDAsMSwxLjAxMSwzLjAxM3YuODg1aC02LjM2MmEzLjY2LDMuNjYsMCwwLDAsLjgyMiwyLjQ2OSwyLjg0MywyLjg0MywwLDAsMCwyLjIuODQzLDcuNDMxLDcuNDMxLDAsMCwwLDIuOTQ5LS42MjR2MS4yNDdhNy4zNzcsNy4zNzcsMCwwLDEtMS40LjQ1OSw3Ljg2Myw3Ljg2MywwLDAsMS0xLjYuMTM5Wm0tLjM3OS04LjRhMi4yODYsMi4yODYsMCwwLDAtMS43NzQuNzI1LDMuMzM3LDMuMzM3LDAsMCwwLS43NzksMi4wMDZoNC44MjhhMy4wNzIsMy4wNzIsMCwwLDAtLjU5LTIuMDI3LDIuMDc2LDIuMDc2LDAsMCwwLTEuNjg1LS43MDZaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTY1IiBkYXRhLW5hbWU9IlBhdGggMjk2NSIgY2xhc3M9ImNscy0yIiBkPSJNMjA2Ljk1MSwxMDkuNjgzaC0uMDc2YTMuMjg3LDMuMjg3LDAsMCwxLTIuOSwxLjQwNywzLjQyNywzLjQyNywwLDAsMS0yLjgxOS0xLjIzOSw1LjQ1Miw1LjQ1MiwwLDAsMS0xLjAwNi0zLjUyMiw1LjU0Miw1LjU0MiwwLDAsMSwxLjAxMS0zLjU0OCwzLjQsMy40LDAsMCwxLDIuODE0LTEuMjY0LDMuMzYxLDMuMzYxLDAsMCwxLDIuODgzLDEuMzY1aC4xMDlsLS4wNTktLjY2NS0uMDM0LS42NDlWOTcuODA5aDEuNHYxMy4xMTNoLTEuMTM4Wm0tMi44LjIzNmEyLjU1MSwyLjU1MSwwLDAsMCwyLjA3OC0uNzc5LDMuOTQ3LDMuOTQ3LDAsMCwwLC42NDQtMi41MTZ2LS4zYTQuNjM4LDQuNjM4LDAsMCwwLS42NTMtMi44LDIuNDgxLDIuNDgxLDAsMCwwLTIuMDg2LS44MzksMi4xNCwyLjE0LDAsMCwwLTEuODgzLjk1Nyw0Ljc2LDQuNzYsMCwwLDAtLjY1MywyLjcsNC41NTQsNC41NTQsMCwwLDAsLjY0OSwyLjY3MSwyLjE5NCwyLjE5NCwwLDAsMCwxLjkwNi45MDZaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTY2IiBkYXRhLW5hbWU9IlBhdGggMjk2NiIgY2xhc3M9ImNscy0yIiBkPSJNMjIwLjcxMiwxMDEuNTM0YTMuNDM1LDMuNDM1LDAsMCwxLDIuODI3LDEuMjQzLDYuNjUzLDYuNjUzLDAsMCwxLS4wMDksNy4wNTMsMy40MTcsMy40MTcsMCwwLDEtMi44MTgsMS4yNiw0LDQsMCwwLDEtMS42NDgtLjMzMywzLjA5NCwzLjA5NCwwLDAsMS0xLjI1MS0xLjAyM2gtLjFsLS4yOTUsMS4xODhoLTFWOTcuODA5aDEuNFYxMDFxMCwxLjA2OS0uMDY4LDEuOTIxaC4wNjhhMy4zMjIsMy4zMjIsMCwwLDEsMi44OTQtMS4zODdabS0uMiwxLjE3MWEyLjQ0LDIuNDQsMCwwLDAtMi4wNjQuODIyLDYuMzM4LDYuMzM4LDAsMCwwLC4wMTcsNS41NTMsMi40NjQsMi40NjQsMCwwLDAsMi4wODEuODM5LDIuMTU4LDIuMTU4LDAsMCwwLDEuOTIyLS45NCw0LjgyOCw0LjgyOCwwLDAsMCwuNjMyLTIuNyw0LjY0NSw0LjY0NSwwLDAsMC0uNjMyLTIuNjg5LDIuMjQyLDIuMjQyLDAsMCwwLTEuOTU5LS44ODVaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTY3IiBkYXRhLW5hbWU9IlBhdGggMjk2NyIgY2xhc3M9ImNscy0yIiBkPSJNMjI1Ljc1OCwxMDEuNjg2aDEuNWwyLjAyMyw1LjI2N2EyMC4xODgsMjAuMTg4LDAsMCwxLC44MjYsMi42aC4wNjdxLjEwOS0uNDMxLjQ1OS0xLjQ3MXQyLjI4OC02LjRoMS41TDIzMC40NTIsMTEyLjJhNS4yNTMsNS4yNTMsMCwwLDEtMS4zNzgsMi4yMTIsMi45MzIsMi45MzIsMCwwLDEtMS45MzQuNjUzLDUuNjU5LDUuNjU5LDAsMCwxLTEuMjY0LS4xNDNWMTEzLjhhNC45LDQuOSwwLDAsMCwxLjAzNy4xLDIuMTM2LDIuMTM2LDAsMCwwLDIuMDU2LTEuNjE4bC41MTQtMS4zMTRaIi8+DQogICAgPC9nPg0KICA8L2c+DQo8L3N2Zz4NCg=="},function(t,e,n){var r=n(240),i=n(243),o=n(248);t.exports=function(t,e){return r(t)||i(t,e)||o()}},function(t,e,n){"use strict";var r=/^(%20|\s)*(javascript|data)/im,i=/[^\x20-\x7E]/gim,o=/^([^:]+):/gm,u=[".","/"];t.exports={sanitizeUrl:function(t){if(!t)return"about:blank";var e,n,s=t.replace(i,"").trim();return function(t){return u.indexOf(t[0])>-1}(s)?s:(n=s.match(o))?(e=n[0],r.test(e)?"about:blank":s):"about:blank"}}},function(t,e,n){var r=n(254),i=n(265)(function(t,e,n){return e=e.toLowerCase(),t+(n?r(e):e)});t.exports=i},function(t,e,n){var r=n(295)(n(347));t.exports=r},function(t,e,n){var r=n(143),i=n(91),o=n(352),u=n(12),s=n(358);t.exports=function(t,e,n){var a=u(t)?r:o;return n&&s(t,e,n)&&(e=void 0),a(t,i(e,3))}},function(t,e,n){(function(e){var r=n(359),i=n(360).Stream,o=" ";function u(t,e,n){n=n||0;var i,o,s=(i=e,new Array(n||0).join(i||"")),a=t;if("object"==typeof t&&((a=t[o=Object.keys(t)[0]])&&a._elem))return a._elem.name=o,a._elem.icount=n,a._elem.indent=e,a._elem.indents=s,a._elem.interrupt=a,a._elem;var c,f=[],l=[];function h(t){Object.keys(t).forEach(function(e){f.push(function(t,e){return t+'="'+r(e)+'"'}(e,t[e]))})}switch(typeof a){case"object":if(null===a)break;a._attr&&h(a._attr),a._cdata&&l.push(("<![CDATA["+a._cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")+"]]>"),a.forEach&&(c=!1,l.push(""),a.forEach(function(t){"object"==typeof t?"_attr"==Object.keys(t)[0]?h(t._attr):l.push(u(t,e,n+1)):(l.pop(),c=!0,l.push(r(t)))}),c||l.push(""));break;default:l.push(r(a))}return{name:o,interrupt:!1,attributes:f,content:l,icount:n,indents:s,indent:e}}function s(t,e,n){if("object"!=typeof e)return t(!1,e);var r=e.interrupt?1:e.content.length;function i(){for(;e.content.length;){var i=e.content.shift();if(void 0!==i){if(o(i))return;s(t,i)}}t(!1,(r>1?e.indents:"")+(e.name?"</"+e.name+">":"")+(e.indent&&!n?"\n":"")),n&&n()}function o(e){return!!e.interrupt&&(e.interrupt.append=t,e.interrupt.end=i,e.interrupt=!1,t(!0),!0)}if(t(!1,e.indents+(e.name?"<"+e.name:"")+(e.attributes.length?" "+e.attributes.join(" "):"")+(r?e.name?">":"":e.name?"/>":"")+(e.indent&&r>1?"\n":"")),!r)return t(!1,e.indent?"\n":"");o(e)||i()}t.exports=function(t,n){"object"!=typeof n&&(n={indent:n});var r,a,c=n.stream?new i:null,f="",l=!1,h=n.indent?!0===n.indent?o:n.indent:"",p=!0;function d(t){p?e.nextTick(t):t()}function y(t,e){if(void 0!==e&&(f+=e),t&&!l&&(c=c||new i,l=!0),t&&l){var n=f;d(function(){c.emit("data",n)}),f=""}}function w(t,e){s(y,u(t,h,h?1:0),e)}function v(){if(c){var t=f;d(function(){c.emit("data",t),c.emit("end"),c.readable=!1,c.emit("close")})}}return d(function(){p=!1}),n.declaration&&(r=n.declaration,a={version:"1.0",encoding:r.encoding||"UTF-8"},r.standalone&&(a.standalone=r.standalone),w({"?xml":{_attr:a}}),f=f.replace("/>","?>")),t&&t.forEach?t.forEach(function(e,n){var r;n+1===t.length&&(r=v),w(e,r)}):w(t,v),c?(c.readable=!0,c):f},t.exports.element=t.exports.Element=function(){var t={_elem:u(Array.prototype.slice.call(arguments)),push:function(t){if(!this.append)throw new Error("not assigned to a parent!");var e=this,n=this._elem.indent;s(this.append,u(t,n,this._elem.icount+(n?1:0)),function(){e.append(!0)})},close:function(t){void 0!==t&&this.push(t),this.end&&this.end()}};return t}}).call(this,n(22))},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function i(t){return null===t?"null":void 0===t?"undefined":"object"===(void 0===t?"undefined":r(t))?Array.isArray(t)?"array":"object":void 0===t?"undefined":r(t)}function o(t){return"object"===i(t)?s(t):"array"===i(t)?u(t):t}function u(t){return t.map(o)}function s(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=o(t[n]));return e}function a(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n={arrayBehaviour:(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).arrayBehaviour||"replace"},r=e.map(function(t){return t||{}}),o=t||{},c=0;c<r.length;c++)for(var f=r[c],l=Object.keys(f),h=0;h<l.length;h++){var p=l[h],d=f[p],y=i(d),w=i(o[p]);if("object"===y)if("undefined"!==w){var v="object"===w?o[p]:{};o[p]=a({},[v,s(d)],n)}else o[p]=s(d);else if("array"===y)if("array"===w){var g=u(d);o[p]="merge"===n.arrayBehaviour?o[p].concat(g):g}else o[p]=u(d);else o[p]=d}return o}t.exports=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return a(t,n)},t.exports.noMutate=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return a({},e)},t.exports.withOptions=function(t,e,n){return a(t,e,n)}},function(t,e,n){(function(e){var n;n=void 0!==e?e:this,t.exports=function(t){if(t.CSS&&t.CSS.escape)return t.CSS.escape;var e=function(t){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var e,n=String(t),r=n.length,i=-1,o="",u=n.charCodeAt(0);++i<r;)0!=(e=n.charCodeAt(i))?o+=e>=1&&e<=31||127==e||0==i&&e>=48&&e<=57||1==i&&e>=48&&e<=57&&45==u?"\\"+e.toString(16)+" ":0==i&&1==r&&45==e||!(e>=128||45==e||95==e||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122)?"\\"+n.charAt(i):n.charAt(i):o+="�";return o};return t.CSS||(t.CSS={}),t.CSS.escape=e,e}(n)}).call(this,n(10))},function(t,e,n){"use strict";n.d(e,"a",function(){return u});var r=n(0),i=n.n(r),o=i.a.Set.of("type","format","items","default","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","maxItems","minItems","uniqueItems","enum","multipleOf");function u(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).isOAS3;if(!i.a.Map.isMap(t))return{schema:i.a.Map(),parameterContentMediaType:null};if(!e)return"body"===t.get("in")?{schema:t.get("schema",i.a.Map()),parameterContentMediaType:null}:{schema:t.filter(function(t,e){return o.includes(e)}),parameterContentMediaType:null};if(t.get("content")){var n=t.get("content",i.a.Map({})).keySeq().first();return{schema:t.getIn(["content",n,"schema"],i.a.Map()),parameterContentMediaType:n}}return{schema:t.get("schema",i.a.Map()),parameterContentMediaType:null}}},function(t,e,n){"use strict";(function(e,r){var i=65536,o=4294967295;var u=n(8).Buffer,s=e.crypto||e.msCrypto;s&&s.getRandomValues?t.exports=function(t,e){if(t>o)throw new RangeError("requested too many random bytes");var n=u.allocUnsafe(t);if(t>0)if(t>i)for(var a=0;a<t;a+=i)s.getRandomValues(n.slice(a,a+i));else s.getRandomValues(n);if("function"==typeof e)return r.nextTick(function(){e(null,n)});return n}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,n(10),n(22))},function(t,e,n){(e=t.exports=function(t){t=t.toLowerCase();var n=e[t];if(!n)throw new Error(t+" is not supported (we accept pull requests)");return new n}).sha=n(424),e.sha1=n(425),e.sha224=n(426),e.sha256=n(166),e.sha384=n(427),e.sha512=n(167)},function(t,e,n){"use strict";var r=n(428);t.exports=r},function(t,e,n){t.exports=n(449)},function(t,e,n){n(185);var r=n(4).Object;t.exports=function(t,e,n){return r.defineProperty(t,e,n)}},function(t,e,n){var r=n(15);r(r.S+r.F*!n(20),"Object",{defineProperty:n(19).f})},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){t.exports=n(188)},function(t,e,n){n(114),n(120),t.exports=n(85).f("iterator")},function(t,e,n){var r=n(77),i=n(78);t.exports=function(t){return function(e,n){var o,u,s=String(i(e)),a=r(n),c=s.length;return a<0||a>=c?t?"":void 0:(o=s.charCodeAt(a))<55296||o>56319||a+1===c||(u=s.charCodeAt(a+1))<56320||u>57343?t?s.charAt(a):o:t?s.slice(a,a+2):u-56320+(o-55296<<10)+65536}}},function(t,e,n){"use strict";var r=n(79),i=n(50),o=n(84),u={};n(27)(u,n(17)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(u,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e,n){var r=n(19),i=n(28),o=n(39);t.exports=n(20)?Object.defineProperties:function(t,e){i(t);for(var n,u=o(e),s=u.length,a=0;s>a;)r.f(t,n=u[a++],e[n]);return t}},function(t,e,n){var r=n(31),i=n(193),o=n(194);t.exports=function(t){return function(e,n,u){var s,a=r(e),c=i(a.length),f=o(u,c);if(t&&n!=n){for(;c>f;)if((s=a[f++])!=s)return!0}else for(;c>f;f++)if((t||f in a)&&a[f]===n)return t||f||0;return!t&&-1}}},function(t,e,n){var r=n(77),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){var r=n(77),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},function(t,e,n){var r=n(16).document;t.exports=r&&r.documentElement},function(t,e,n){"use strict";var r=n(197),i=n(198),o=n(52),u=n(31);t.exports=n(115)(Array,"Array",function(t,e){this._t=u(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){t.exports=n(200)},function(t,e,n){n(201),n(205),n(206),n(207),t.exports=n(4).Symbol},function(t,e,n){"use strict";var r=n(16),i=n(21),o=n(20),u=n(15),s=n(116),a=n(202).KEY,c=n(30),f=n(82),l=n(84),h=n(53),p=n(17),d=n(85),y=n(86),w=n(203),v=n(121),g=n(28),M=n(29),_=n(31),m=n(76),L=n(50),b=n(79),j=n(204),x=n(123),N=n(19),S=n(39),D=x.f,I=N.f,E=j.f,C=r.Symbol,T=r.JSON,A=T&&T.stringify,O=p("_hidden"),z=p("toPrimitive"),k={}.propertyIsEnumerable,Y=f("symbol-registry"),U=f("symbols"),P=f("op-symbols"),R=Object.prototype,Q="function"==typeof C,F=r.QObject,B=!F||!F.prototype||!F.prototype.findChild,G=o&&c(function(){return 7!=b(I({},"a",{get:function(){return I(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=D(R,e);r&&delete R[e],I(t,e,n),r&&t!==R&&I(R,e,r)}:I,W=function(t){var e=U[t]=b(C.prototype);return e._k=t,e},q=Q&&"symbol"==typeof C.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof C},J=function(t,e,n){return t===R&&J(P,e,n),g(t),e=m(e,!0),g(n),i(U,e)?(n.enumerable?(i(t,O)&&t[O][e]&&(t[O][e]=!1),n=b(n,{enumerable:L(0,!1)})):(i(t,O)||I(t,O,L(1,{})),t[O][e]=!0),G(t,e,n)):I(t,e,n)},Z=function(t,e){g(t);for(var n,r=w(e=_(e)),i=0,o=r.length;o>i;)J(t,n=r[i++],e[n]);return t},V=function(t){var e=k.call(this,t=m(t,!0));return!(this===R&&i(U,t)&&!i(P,t))&&(!(e||!i(this,t)||!i(U,t)||i(this,O)&&this[O][t])||e)},X=function(t,e){if(t=_(t),e=m(e,!0),t!==R||!i(U,e)||i(P,e)){var n=D(t,e);return!n||!i(U,e)||i(t,O)&&t[O][e]||(n.enumerable=!0),n}},H=function(t){for(var e,n=E(_(t)),r=[],o=0;n.length>o;)i(U,e=n[o++])||e==O||e==a||r.push(e);return r},K=function(t){for(var e,n=t===R,r=E(n?P:_(t)),o=[],u=0;r.length>u;)!i(U,e=r[u++])||n&&!i(R,e)||o.push(U[e]);return o};Q||(s((C=function(){if(this instanceof C)throw TypeError("Symbol is not a constructor!");var t=h(arguments.length>0?arguments[0]:void 0),e=function(n){this===R&&e.call(P,n),i(this,O)&&i(this[O],t)&&(this[O][t]=!1),G(this,t,L(1,n))};return o&&B&&G(R,t,{configurable:!0,set:e}),W(t)}).prototype,"toString",function(){return this._k}),x.f=X,N.f=J,n(122).f=j.f=H,n(55).f=V,n(87).f=K,o&&!n(51)&&s(R,"propertyIsEnumerable",V,!0),d.f=function(t){return W(p(t))}),u(u.G+u.W+u.F*!Q,{Symbol:C});for(var $="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),tt=0;$.length>tt;)p($[tt++]);for(var et=S(p.store),nt=0;et.length>nt;)y(et[nt++]);u(u.S+u.F*!Q,"Symbol",{for:function(t){return i(Y,t+="")?Y[t]:Y[t]=C(t)},keyFor:function(t){if(!q(t))throw TypeError(t+" is not a symbol!");for(var e in Y)if(Y[e]===t)return e},useSetter:function(){B=!0},useSimple:function(){B=!1}}),u(u.S+u.F*!Q,"Object",{create:function(t,e){return void 0===e?b(t):Z(b(t),e)},defineProperty:J,defineProperties:Z,getOwnPropertyDescriptor:X,getOwnPropertyNames:H,getOwnPropertySymbols:K}),T&&u(u.S+u.F*(!Q||c(function(){var t=C();return"[null]"!=A([t])||"{}"!=A({a:t})||"{}"!=A(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(M(e)||void 0!==t)&&!q(t))return v(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!q(e))return e}),r[1]=e,A.apply(T,r)}}),C.prototype[z]||n(27)(C.prototype,z,C.prototype.valueOf),l(C,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(t,e,n){var r=n(53)("meta"),i=n(29),o=n(21),u=n(19).f,s=0,a=Object.isExtensible||function(){return!0},c=!n(30)(function(){return a(Object.preventExtensions({}))}),f=function(t){u(t,r,{value:{i:"O"+ ++s,w:{}}})},l=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!a(t))return"F";if(!e)return"E";f(t)}return t[r].i},getWeak:function(t,e){if(!o(t,r)){if(!a(t))return!0;if(!e)return!1;f(t)}return t[r].w},onFreeze:function(t){return c&&l.NEED&&a(t)&&!o(t,r)&&f(t),t}}},function(t,e,n){var r=n(39),i=n(87),o=n(55);t.exports=function(t){var e=r(t),n=i.f;if(n)for(var u,s=n(t),a=o.f,c=0;s.length>c;)a.call(t,u=s[c++])&&e.push(u);return e}},function(t,e,n){var r=n(31),i=n(122).f,o={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return u&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(t){return u.slice()}}(t):i(r(t))}},function(t,e){},function(t,e,n){n(86)("asyncIterator")},function(t,e,n){n(86)("observable")},function(t,e,n){t.exports=n(209)},function(t,e,n){n(210),t.exports=n(4).Object.getPrototypeOf},function(t,e,n){var r=n(54),i=n(119);n(124)("getPrototypeOf",function(){return function(t){return i(r(t))}})},function(t,e,n){n(212),t.exports=n(4).Object.setPrototypeOf},function(t,e,n){var r=n(15);r(r.S,"Object",{setPrototypeOf:n(213).set})},function(t,e,n){var r=n(29),i=n(28),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=n(111)(Function.call,n(123).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:o}},function(t,e,n){t.exports=n(215)},function(t,e,n){n(216);var r=n(4).Object;t.exports=function(t,e){return r.create(t,e)}},function(t,e,n){var r=n(15);r(r.S,"Object",{create:n(79)})},function(t,e,n){var r=n(125);function i(e,n){return t.exports=i=r||function(t,e){return t.__proto__=e,t},i(e,n)}t.exports=i},function(t,e,n){"use strict";var r=n(40),i=n(126),o=n(220),u=n(225),s=n(32),a=n(226),c=n(232),f=n(233),l=n(235),h=s.createElement,p=s.createFactory,d=s.cloneElement,y=r,w={Children:{map:o.map,forEach:o.forEach,count:o.count,toArray:o.toArray,only:l},Component:i.Component,PureComponent:i.PureComponent,createElement:h,cloneElement:d,isValidElement:s.isValidElement,PropTypes:a,createClass:f,createFactory:p,createMixin:function(t){return t},DOM:u,version:c,__spread:y};t.exports=w},function(t,e,n){"use strict";t.exports=function(){}},function(t,e,n){"use strict";var r=n(221),i=n(32),o=n(128),u=n(222),s=r.twoArgumentPooler,a=r.fourArgumentPooler,c=/\/+/g;function f(t){return(""+t).replace(c,"$&/")}function l(t,e){this.func=t,this.context=e,this.count=0}function h(t,e,n){var r=t.func,i=t.context;r.call(i,e,t.count++)}function p(t,e,n,r){this.result=t,this.keyPrefix=e,this.func=n,this.context=r,this.count=0}function d(t,e,n){var r=t.result,u=t.keyPrefix,s=t.func,a=t.context,c=s.call(a,e,t.count++);Array.isArray(c)?y(c,r,n,o.thatReturnsArgument):null!=c&&(i.isValidElement(c)&&(c=i.cloneAndReplaceKey(c,u+(!c.key||e&&e.key===c.key?"":f(c.key)+"/")+n)),r.push(c))}function y(t,e,n,r,i){var o="";null!=n&&(o=f(n)+"/");var s=p.getPooled(e,o,r,i);u(t,d,s),p.release(s)}function w(t,e,n){return null}l.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},r.addPoolingTo(l,s),p.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},r.addPoolingTo(p,a);var v={forEach:function(t,e,n){if(null==t)return t;var r=l.getPooled(e,n);u(t,h,r),l.release(r)},map:function(t,e,n){if(null==t)return t;var r=[];return y(t,r,null,e,n),r},mapIntoWithKeyPrefixInternal:y,count:function(t,e){return u(t,w,null)},toArray:function(t){var e=[];return y(t,e,null,o.thatReturnsArgument),e}};t.exports=v},function(t,e,n){"use strict";var r=n(56),i=(n(41),function(t){if(this.instancePool.length){var e=this.instancePool.pop();return this.call(e,t),e}return new this(t)}),o=function(t){t instanceof this||r("25"),t.destructor(),this.instancePool.length<this.poolSize&&this.instancePool.push(t)},u=i,s={addPoolingTo:function(t,e){var n=t;return n.instancePool=[],n.getPooled=e||u,n.poolSize||(n.poolSize=10),n.release=o,n},oneArgumentPooler:i,twoArgumentPooler:function(t,e){if(this.instancePool.length){var n=this.instancePool.pop();return this.call(n,t,e),n}return new this(t,e)},threeArgumentPooler:function(t,e,n){if(this.instancePool.length){var r=this.instancePool.pop();return this.call(r,t,e,n),r}return new this(t,e,n)},fourArgumentPooler:function(t,e,n,r){if(this.instancePool.length){var i=this.instancePool.pop();return this.call(i,t,e,n,r),i}return new this(t,e,n,r)}};t.exports=s},function(t,e,n){"use strict";var r=n(56),i=(n(131),n(132)),o=n(223),u=(n(41),n(224)),s=(n(88),"."),a=":";function c(t,e){return t&&"object"==typeof t&&null!=t.key?u.escape(t.key):e.toString(36)}t.exports=function(t,e,n){return null==t?0:function t(e,n,f,l){var h,p=typeof e;if("undefined"!==p&&"boolean"!==p||(e=null),null===e||"string"===p||"number"===p||"object"===p&&e.$$typeof===i)return f(l,e,""===n?s+c(e,0):n),1;var d=0,y=""===n?s:n+a;if(Array.isArray(e))for(var w=0;w<e.length;w++)d+=t(h=e[w],y+c(h,w),f,l);else{var v=o(e);if(v){var g,M=v.call(e);if(v!==e.entries)for(var _=0;!(g=M.next()).done;)d+=t(h=g.value,y+c(h,_++),f,l);else for(;!(g=M.next()).done;){var m=g.value;m&&(d+=t(h=m[1],y+u.escape(m[0])+a+c(h,0),f,l))}}else if("object"===p){var L=String(e);r("31","[object Object]"===L?"object with keys {"+Object.keys(e).join(", ")+"}":L,"")}}return d}(t,"",e,n)}},function(t,e,n){"use strict";var r="function"==typeof Symbol&&Symbol.iterator,i="@@iterator";t.exports=function(t){var e=t&&(r&&t[r]||t[i]);if("function"==typeof e)return e}},function(t,e,n){"use strict";var r={escape:function(t){var e={"=":"=0",":":"=2"};return"$"+(""+t).replace(/[=:]/g,function(t){return e[t]})},unescape:function(t){var e={"=0":"=","=2":":"};return(""+("."===t[0]&&"$"===t[1]?t.substring(2):t.substring(1))).replace(/(=0|=2)/g,function(t){return e[t]})}};t.exports=r},function(t,e,n){"use strict";var r=n(32).createFactory,i={a:r("a"),abbr:r("abbr"),address:r("address"),area:r("area"),article:r("article"),aside:r("aside"),audio:r("audio"),b:r("b"),base:r("base"),bdi:r("bdi"),bdo:r("bdo"),big:r("big"),blockquote:r("blockquote"),body:r("body"),br:r("br"),button:r("button"),canvas:r("canvas"),caption:r("caption"),cite:r("cite"),code:r("code"),col:r("col"),colgroup:r("colgroup"),data:r("data"),datalist:r("datalist"),dd:r("dd"),del:r("del"),details:r("details"),dfn:r("dfn"),dialog:r("dialog"),div:r("div"),dl:r("dl"),dt:r("dt"),em:r("em"),embed:r("embed"),fieldset:r("fieldset"),figcaption:r("figcaption"),figure:r("figure"),footer:r("footer"),form:r("form"),h1:r("h1"),h2:r("h2"),h3:r("h3"),h4:r("h4"),h5:r("h5"),h6:r("h6"),head:r("head"),header:r("header"),hgroup:r("hgroup"),hr:r("hr"),html:r("html"),i:r("i"),iframe:r("iframe"),img:r("img"),input:r("input"),ins:r("ins"),kbd:r("kbd"),keygen:r("keygen"),label:r("label"),legend:r("legend"),li:r("li"),link:r("link"),main:r("main"),map:r("map"),mark:r("mark"),menu:r("menu"),menuitem:r("menuitem"),meta:r("meta"),meter:r("meter"),nav:r("nav"),noscript:r("noscript"),object:r("object"),ol:r("ol"),optgroup:r("optgroup"),option:r("option"),output:r("output"),p:r("p"),param:r("param"),picture:r("picture"),pre:r("pre"),progress:r("progress"),q:r("q"),rp:r("rp"),rt:r("rt"),ruby:r("ruby"),s:r("s"),samp:r("samp"),script:r("script"),section:r("section"),select:r("select"),small:r("small"),source:r("source"),span:r("span"),strong:r("strong"),style:r("style"),sub:r("sub"),summary:r("summary"),sup:r("sup"),table:r("table"),tbody:r("tbody"),td:r("td"),textarea:r("textarea"),tfoot:r("tfoot"),th:r("th"),thead:r("thead"),time:r("time"),title:r("title"),tr:r("tr"),track:r("track"),u:r("u"),ul:r("ul"),var:r("var"),video:r("video"),wbr:r("wbr"),circle:r("circle"),clipPath:r("clipPath"),defs:r("defs"),ellipse:r("ellipse"),g:r("g"),image:r("image"),line:r("line"),linearGradient:r("linearGradient"),mask:r("mask"),path:r("path"),pattern:r("pattern"),polygon:r("polygon"),polyline:r("polyline"),radialGradient:r("radialGradient"),rect:r("rect"),stop:r("stop"),svg:r("svg"),text:r("text"),tspan:r("tspan")};t.exports=i},function(t,e,n){"use strict";var r=n(32).isValidElement,i=n(227);t.exports=i(r)},function(t,e,n){"use strict";var r=n(228);t.exports=function(t){return r(t,!1)}},function(t,e,n){"use strict";var r=n(229),i=n(40),o=n(133),u=n(231),s=Function.call.bind(Object.prototype.hasOwnProperty),a=function(){};function c(){return null}t.exports=function(t,e){var n="function"==typeof Symbol&&Symbol.iterator,f="@@iterator";var l="<<anonymous>>",h={array:w("array"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:y(c),arrayOf:function(t){return y(function(e,n,r,i,u){if("function"!=typeof t)return new d("Property `"+u+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=e[n];if(!Array.isArray(s))return new d("Invalid "+i+" `"+u+"` of type `"+g(s)+"` supplied to `"+r+"`, expected an array.");for(var a=0;a<s.length;a++){var c=t(s,a,r,i,u+"["+a+"]",o);if(c instanceof Error)return c}return null})},element:y(function(e,n,r,i,o){var u=e[n];return t(u)?null:new d("Invalid "+i+" `"+o+"` of type `"+g(u)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:y(function(t,e,n,i,o){var u=t[e];return r.isValidElementType(u)?null:new d("Invalid "+i+" `"+o+"` of type `"+g(u)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(t){return y(function(e,n,r,i,o){if(!(e[n]instanceof t)){var u=t.name||l;return new d("Invalid "+i+" `"+o+"` of type `"+function(t){if(!t.constructor||!t.constructor.name)return l;return t.constructor.name}(e[n])+"` supplied to `"+r+"`, expected instance of `"+u+"`.")}return null})},node:y(function(t,e,n,r,i){return v(t[e])?null:new d("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(t){return y(function(e,n,r,i,u){if("function"!=typeof t)return new d("Property `"+u+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=e[n],c=g(a);if("object"!==c)return new d("Invalid "+i+" `"+u+"` of type `"+c+"` supplied to `"+r+"`, expected an object.");for(var f in a)if(s(a,f)){var l=t(a,f,r,i,u+"."+f,o);if(l instanceof Error)return l}return null})},oneOf:function(t){if(!Array.isArray(t))return c;return y(function(e,n,r,i,o){for(var u=e[n],s=0;s<t.length;s++)if(p(u,t[s]))return null;var a=JSON.stringify(t,function(t,e){return"symbol"===M(e)?String(e):e});return new d("Invalid "+i+" `"+o+"` of value `"+String(u)+"` supplied to `"+r+"`, expected one of "+a+".")})},oneOfType:function(t){if(!Array.isArray(t))return c;for(var e=0;e<t.length;e++){var n=t[e];if("function"!=typeof n)return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+_(n)+" at index "+e+"."),c}return y(function(e,n,r,i,u){for(var s=0;s<t.length;s++){if(null==(0,t[s])(e,n,r,i,u,o))return null}return new d("Invalid "+i+" `"+u+"` supplied to `"+r+"`.")})},shape:function(t){return y(function(e,n,r,i,u){var s=e[n],a=g(s);if("object"!==a)return new d("Invalid "+i+" `"+u+"` of type `"+a+"` supplied to `"+r+"`, expected `object`.");for(var c in t){var f=t[c];if(f){var l=f(s,c,r,i,u+"."+c,o);if(l)return l}}return null})},exact:function(t){return y(function(e,n,r,u,s){var a=e[n],c=g(a);if("object"!==c)return new d("Invalid "+u+" `"+s+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");var f=i({},e[n],t);for(var l in f){var h=t[l];if(!h)return new d("Invalid "+u+" `"+s+"` key `"+l+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(e[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(t),null," "));var p=h(a,l,r,u,s+"."+l,o);if(p)return p}return null})}};function p(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function d(t){this.message=t,this.stack=""}function y(t){function n(n,r,i,u,s,a,c){if((u=u||l,a=a||i,c!==o)&&e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}return null==r[i]?n?null===r[i]?new d("The "+s+" `"+a+"` is marked as required in `"+u+"`, but its value is `null`."):new d("The "+s+" `"+a+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:t(r,i,u,s,a)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function w(t){return y(function(e,n,r,i,o,u){var s=e[n];return g(s)!==t?new d("Invalid "+i+" `"+o+"` of type `"+M(s)+"` supplied to `"+r+"`, expected `"+t+"`."):null})}function v(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(v);if(null===e||t(e))return!0;var r=function(t){var e=t&&(n&&t[n]||t[f]);if("function"==typeof e)return e}(e);if(!r)return!1;var i,o=r.call(e);if(r!==e.entries){for(;!(i=o.next()).done;)if(!v(i.value))return!1}else for(;!(i=o.next()).done;){var u=i.value;if(u&&!v(u[1]))return!1}return!0;default:return!1}}function g(t){var e=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":function(t,e){return"symbol"===t||!!e&&("Symbol"===e["@@toStringTag"]||"function"==typeof Symbol&&e instanceof Symbol)}(e,t)?"symbol":e}function M(t){if(null==t)return""+t;var e=g(t);if("object"===e){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return e}function _(t){var e=M(t);switch(e){case"array":case"object":return"an "+e;case"boolean":case"date":case"regexp":return"a "+e;default:return e}}return d.prototype=Error.prototype,h.checkPropTypes=u,h.resetWarningCache=u.resetWarningCache,h.PropTypes=h,h}},function(t,e,n){"use strict";t.exports=n(230)},function(t,e,n){"use strict"; +/** @license React v16.8.6 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,u=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,f=r?Symbol.for("react.context"):60110,l=r?Symbol.for("react.async_mode"):60111,h=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,y=r?Symbol.for("react.memo"):60115,w=r?Symbol.for("react.lazy"):60116;function v(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case i:switch(t=t.type){case l:case h:case u:case a:case s:case d:return t;default:switch(t=t&&t.$$typeof){case f:case p:case c:return t;default:return e}}case w:case y:case o:return e}}}function g(t){return v(t)===h}e.typeOf=v,e.AsyncMode=l,e.ConcurrentMode=h,e.ContextConsumer=f,e.ContextProvider=c,e.Element=i,e.ForwardRef=p,e.Fragment=u,e.Lazy=w,e.Memo=y,e.Portal=o,e.Profiler=a,e.StrictMode=s,e.Suspense=d,e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===u||t===h||t===a||t===s||t===d||"object"==typeof t&&null!==t&&(t.$$typeof===w||t.$$typeof===y||t.$$typeof===c||t.$$typeof===f||t.$$typeof===p)},e.isAsyncMode=function(t){return g(t)||v(t)===l},e.isConcurrentMode=g,e.isContextConsumer=function(t){return v(t)===f},e.isContextProvider=function(t){return v(t)===c},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===i},e.isForwardRef=function(t){return v(t)===p},e.isFragment=function(t){return v(t)===u},e.isLazy=function(t){return v(t)===w},e.isMemo=function(t){return v(t)===y},e.isPortal=function(t){return v(t)===o},e.isProfiler=function(t){return v(t)===a},e.isStrictMode=function(t){return v(t)===s},e.isSuspense=function(t){return v(t)===d}},function(t,e,n){"use strict";function r(t,e,n,r,i){}r.resetWarningCache=function(){0},t.exports=r},function(t,e,n){"use strict";t.exports="15.6.2"},function(t,e,n){"use strict";var r=n(126).Component,i=n(32).isValidElement,o=n(127),u=n(234);t.exports=u(r,i,o)},function(t,e,n){"use strict";var r=n(40),i=n(130),o=n(41),u="mixins";t.exports=function(t,e,n){var s=[],a={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",UNSAFE_componentWillMount:"DEFINE_MANY",UNSAFE_componentWillReceiveProps:"DEFINE_MANY",UNSAFE_componentWillUpdate:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},c={getDerivedStateFromProps:"DEFINE_MANY_MERGED"},f={displayName:function(t,e){t.displayName=e},mixins:function(t,e){if(e)for(var n=0;n<e.length;n++)h(t,e[n])},childContextTypes:function(t,e){t.childContextTypes=r({},t.childContextTypes,e)},contextTypes:function(t,e){t.contextTypes=r({},t.contextTypes,e)},getDefaultProps:function(t,e){t.getDefaultProps?t.getDefaultProps=d(t.getDefaultProps,e):t.getDefaultProps=e},propTypes:function(t,e){t.propTypes=r({},t.propTypes,e)},statics:function(t,e){!function(t,e){if(!e)return;for(var n in e){var r=e[n];if(e.hasOwnProperty(n)){if(o(!(n in f),'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n),n in t){var i=c.hasOwnProperty(n)?c[n]:null;return o("DEFINE_MANY_MERGED"===i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),void(t[n]=d(t[n],r))}t[n]=r}}}(t,e)},autobind:function(){}};function l(t,e){var n=a.hasOwnProperty(e)?a[e]:null;M.hasOwnProperty(e)&&o("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",e),t&&o("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",e)}function h(t,n){if(n){o("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),o(!e(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=t.prototype,i=r.__reactAutoBindPairs;for(var s in n.hasOwnProperty(u)&&f.mixins(t,n.mixins),n)if(n.hasOwnProperty(s)&&s!==u){var c=n[s],h=r.hasOwnProperty(s);if(l(h,s),f.hasOwnProperty(s))f[s](t,c);else{var p=a.hasOwnProperty(s);if("function"==typeof c&&!p&&!h&&!1!==n.autobind)i.push(s,c),r[s]=c;else if(h){var w=a[s];o(p&&("DEFINE_MANY_MERGED"===w||"DEFINE_MANY"===w),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",w,s),"DEFINE_MANY_MERGED"===w?r[s]=d(r[s],c):"DEFINE_MANY"===w&&(r[s]=y(r[s],c))}else r[s]=c}}}else;}function p(t,e){for(var n in o(t&&e&&"object"==typeof t&&"object"==typeof e,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects."),e)e.hasOwnProperty(n)&&(o(void 0===t[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),t[n]=e[n]);return t}function d(t,e){return function(){var n=t.apply(this,arguments),r=e.apply(this,arguments);if(null==n)return r;if(null==r)return n;var i={};return p(i,n),p(i,r),i}}function y(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function w(t,e){return e.bind(t)}var v={componentDidMount:function(){this.__isMounted=!0}},g={componentWillUnmount:function(){this.__isMounted=!1}},M={replaceState:function(t,e){this.updater.enqueueReplaceState(this,t,e)},isMounted:function(){return!!this.__isMounted}},_=function(){};return r(_.prototype,t.prototype,M),function(t){var e=function(t,r,u){this.__reactAutoBindPairs.length&&function(t){for(var e=t.__reactAutoBindPairs,n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];t[r]=w(t,i)}}(this),this.props=t,this.context=r,this.refs=i,this.updater=u||n,this.state=null;var s=this.getInitialState?this.getInitialState():null;o("object"==typeof s&&!Array.isArray(s),"%s.getInitialState(): must return an object or null",e.displayName||"ReactCompositeComponent"),this.state=s};for(var r in e.prototype=new _,e.prototype.constructor=e,e.prototype.__reactAutoBindPairs=[],s.forEach(h.bind(null,e)),h(e,v),h(e,t),h(e,g),e.getDefaultProps&&(e.defaultProps=e.getDefaultProps()),o(e.prototype.render,"createClass(...): Class specification must implement a `render` method."),a)e.prototype[r]||(e.prototype[r]=null);return e}}},function(t,e,n){"use strict";var r=n(56),i=n(32);n(41);t.exports=function(t){return i.isValidElement(t)||r("143"),t}},function(t,e,n){"use strict";var r=n(133);function i(){}function o(){}o.resetWarningCache=i,t.exports=function(){function t(t,e,n,i,o,u){if(u!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){for(var e,n=c(t),r=n[0],u=n[1],s=new o(function(t,e,n){return 3*(e+n)/4-n}(0,r,u)),a=0,f=u>0?r-4:r,l=0;l<f;l+=4)e=i[t.charCodeAt(l)]<<18|i[t.charCodeAt(l+1)]<<12|i[t.charCodeAt(l+2)]<<6|i[t.charCodeAt(l+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=255&e;2===u&&(e=i[t.charCodeAt(l)]<<2|i[t.charCodeAt(l+1)]>>4,s[a++]=255&e);1===u&&(e=i[t.charCodeAt(l)]<<10|i[t.charCodeAt(l+1)]<<4|i[t.charCodeAt(l+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e);return s},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],u=0,s=n-i;u<s;u+=16383)o.push(f(t,u,u+16383>s?s:u+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=u.length;s<a;++s)r[s]=u[s],i[u.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function f(t,e,n){for(var i,o,u=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),u.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return u.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var o,u,s=8*i-r-1,a=(1<<s)-1,c=a>>1,f=-7,l=n?i-1:0,h=n?-1:1,p=t[e+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=s;f>0;o=256*o+t[e+l],l+=h,f-=8);for(u=o&(1<<-f)-1,o>>=-f,f+=r;f>0;u=256*u+t[e+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===a)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,r),o-=c}return(p?-1:1)*u*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var u,s,a,c=8*o-i-1,f=(1<<c)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,u=f):(u=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-u))<1&&(u--,a*=2),(e+=u+l>=1?h/a:h*Math.pow(2,1-l))*a>=2&&(u++,a/=2),u+l>=f?(s=0,u=f):u+l>=1?(s=(e*a-1)*Math.pow(2,i),u+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),u=0));i>=8;t[n+p]=255&s,p+=d,s/=256,i-=8);for(u=u<<i|s,c+=i;c>0;t[n+p]=255&u,p+=d,u/=256,c-=8);t[n+p-d]|=128*y}},function(t,e,n){var r=n(4),i=r.JSON||(r.JSON={stringify:JSON.stringify});t.exports=function(t){return i.stringify.apply(i,arguments)}},function(t,e,n){var r=n(2);t.exports=function(t){if(r(t))return t}},function(t,e,n){n(242),t.exports=n(4).Array.isArray},function(t,e,n){var r=n(15);r(r.S,"Array",{isArray:n(121)})},function(t,e,n){var r=n(103);t.exports=function(t,e){var n=[],i=!0,o=!1,u=void 0;try{for(var s,a=r(t);!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){o=!0,u=t}finally{try{i||null==a.return||a.return()}finally{if(o)throw u}}return n}},function(t,e,n){n(120),n(114),t.exports=n(245)},function(t,e,n){var r=n(28),i=n(246);t.exports=n(4).getIterator=function(t){var e=i(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return r(e.call(t))}},function(t,e,n){var r=n(247),i=n(17)("iterator"),o=n(52);t.exports=n(4).getIteratorMethod=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e,n){var r=n(80),i=n(17)("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:o?r(e):"Object"==(u=r(e))&&"function"==typeof e.callee?"Arguments":u}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e,n){n(250),t.exports=n(4).Object.assign},function(t,e,n){var r=n(15);r(r.S+r.F,"Object",{assign:n(251)})},function(t,e,n){"use strict";var r=n(39),i=n(87),o=n(55),u=n(54),s=n(118),a=Object.assign;t.exports=!a||n(30)(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=a({},t)[n]||Object.keys(a({},e)).join("")!=r})?function(t,e){for(var n=u(t),a=arguments.length,c=1,f=i.f,l=o.f;a>c;)for(var h,p=s(arguments[c++]),d=f?r(p).concat(f(p)):r(p),y=d.length,w=0;y>w;)l.call(p,h=d[w++])&&(n[h]=p[h]);return n}:a},function(t,e,n){n(253),t.exports=n(4).Object.keys},function(t,e,n){var r=n(54),i=n(39);n(124)("keys",function(){return function(t){return i(r(t))}})},function(t,e,n){var r=n(42),i=n(104);t.exports=function(t){return i(r(t).toLowerCase())}},function(t,e,n){var r=n(58),i=n(256),o=n(12),u=n(59),s=1/0,a=r?r.prototype:void 0,c=a?a.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return i(e,t)+"";if(u(e))return c?c.call(e):"";var n=e+"";return"0"==n&&1/e==-s?"-0":n}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}},function(t,e,n){var r=n(58),i=Object.prototype,o=i.hasOwnProperty,u=i.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var i=u.call(t);return r&&(e?t[s]=n:delete t[s]),i}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r=n(260),i=n(137),o=n(262),u=n(42);t.exports=function(t){return function(e){e=u(e);var n=i(e)?o(e):void 0,s=n?n[0]:e.charAt(0),a=n?r(n,1).join(""):e.slice(1);return s[t]()+a}}},function(t,e,n){var r=n(261);t.exports=function(t,e,n){var i=t.length;return n=void 0===n?i:n,!e&&n>=i?t:r(t,e,n)}},function(t,e){t.exports=function(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}},function(t,e,n){var r=n(263),i=n(137),o=n(264);t.exports=function(t){return i(t)?o(t):r(t)}},function(t,e){t.exports=function(t){return t.split("")}},function(t,e){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^\\ud800-\\udfff]",u="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",a="(?:"+r+"|"+i+")"+"?",c="[\\ufe0e\\ufe0f]?"+a+("(?:\\u200d(?:"+[o,u,s].join("|")+")[\\ufe0e\\ufe0f]?"+a+")*"),f="(?:"+[o+r+"?",r,u,s,n].join("|")+")",l=RegExp(i+"(?="+i+")|"+f+c,"g");t.exports=function(t){return t.match(l)||[]}},function(t,e,n){var r=n(266),i=n(267),o=n(270),u=RegExp("['’]","g");t.exports=function(t){return function(e){return r(o(i(e).replace(u,"")),t,"")}}},function(t,e){t.exports=function(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}},function(t,e,n){var r=n(268),i=n(42),o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,u=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");t.exports=function(t){return(t=i(t))&&t.replace(o,r).replace(u,"")}},function(t,e,n){var r=n(269)({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});t.exports=r},function(t,e){t.exports=function(t){return function(e){return null==t?void 0:t[e]}}},function(t,e,n){var r=n(271),i=n(272),o=n(42),u=n(273);t.exports=function(t,e,n){return t=o(t),void 0===(e=n?void 0:e)?i(t)?u(t):r(t):t.match(e)||[]}},function(t,e){var n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;t.exports=function(t){return t.match(n)||[]}},function(t,e){var n=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;t.exports=function(t){return n.test(t)}},function(t,e){var n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",r="["+n+"]",i="\\d+",o="[\\u2700-\\u27bf]",u="[a-z\\xdf-\\xf6\\xf8-\\xff]",s="[^\\ud800-\\udfff"+n+i+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",c="[\\ud800-\\udbff][\\udc00-\\udfff]",f="[A-Z\\xc0-\\xd6\\xd8-\\xde]",l="(?:"+u+"|"+s+")",h="(?:"+f+"|"+s+")",p="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",d="[\\ufe0e\\ufe0f]?"+p+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",a,c].join("|")+")[\\ufe0e\\ufe0f]?"+p+")*"),y="(?:"+[o,a,c].join("|")+")"+d,w=RegExp([f+"?"+u+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[r,f,"$"].join("|")+")",h+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[r,f+l,"$"].join("|")+")",f+"?"+l+"+(?:['’](?:d|ll|m|re|s|t|ve))?",f+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",i,y].join("|"),"g");t.exports=function(t){return t.match(w)||[]}},function(t,e,n){var r=n(275),i=n(61),o=n(90);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(t,e,n){var r=n(276),i=n(281),o=n(282),u=n(283),s=n(284);function a(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}a.prototype.clear=r,a.prototype.delete=i,a.prototype.get=o,a.prototype.has=u,a.prototype.set=s,t.exports=a},function(t,e,n){var r=n(60);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(t,e,n){var r=n(138),i=n(278),o=n(45),u=n(139),s=/^\[object .+?Constructor\]$/,a=Function.prototype,c=Object.prototype,f=a.toString,l=c.hasOwnProperty,h=RegExp("^"+f.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(r(t)?h:s).test(u(t))}},function(t,e,n){var r,i=n(279),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!o&&o in t}},function(t,e,n){var r=n(11)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,n){var r=n(60),i="__lodash_hash_undefined__",o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return n===i?void 0:n}return o.call(e,t)?e[t]:void 0}},function(t,e,n){var r=n(60),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:i.call(e,t)}},function(t,e,n){var r=n(60),i="__lodash_hash_undefined__";t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?i:e,this}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(62),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():i.call(e,n,1),--this.size,!0)}},function(t,e,n){var r=n(62);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var r=n(62);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,n){var r=n(62);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var r=n(63);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var r=n(63);t.exports=function(t){return r(this,t).get(t)}},function(t,e,n){var r=n(63);t.exports=function(t){return r(this,t).has(t)}},function(t,e,n){var r=n(63);t.exports=function(t,e){var n=r(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}},function(t,e,n){var r=n(91),i=n(65),o=n(64);t.exports=function(t){return function(e,n,u){var s=Object(e);if(!i(e)){var a=r(n,3);e=o(e),n=function(t){return a(s[t],t,s)}}var c=t(e,n,u);return c>-1?s[a?e[c]:c]:void 0}}},function(t,e,n){var r=n(297),i=n(335),o=n(149);t.exports=function(t){var e=i(t);return 1==e.length&&e[0][2]?o(e[0][0],e[0][1]):function(n){return n===t||r(n,t,e)}}},function(t,e,n){var r=n(140),i=n(141),o=1,u=2;t.exports=function(t,e,n,s){var a=n.length,c=a,f=!s;if(null==t)return!c;for(t=Object(t);a--;){var l=n[a];if(f&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++a<c;){var h=(l=n[a])[0],p=t[h],d=l[1];if(f&&l[2]){if(void 0===p&&!(h in t))return!1}else{var y=new r;if(s)var w=s(p,d,h,t,e,y);if(!(void 0===w?i(d,p,o|u,s,y):w))return!1}}return!0}},function(t,e,n){var r=n(61);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(61),i=n(90),o=n(89),u=200;t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!i||s.length<u-1)return s.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(s)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var r=n(140),i=n(142),o=n(308),u=n(312),s=n(330),a=n(12),c=n(145),f=n(147),l=1,h="[object Arguments]",p="[object Array]",d="[object Object]",y=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,w,v,g){var M=a(t),_=a(e),m=M?p:s(t),L=_?p:s(e),b=(m=m==h?d:m)==d,j=(L=L==h?d:L)==d,x=m==L;if(x&&c(t)){if(!c(e))return!1;M=!0,b=!1}if(x&&!b)return g||(g=new r),M||f(t)?i(t,e,n,w,v,g):o(t,e,m,n,w,v,g);if(!(n&l)){var N=b&&y.call(t,"__wrapped__"),S=j&&y.call(e,"__wrapped__");if(N||S){var D=N?t.value():t,I=S?e.value():e;return g||(g=new r),v(D,I,n,w,g)}}return!!x&&(g||(g=new r),u(t,e,n,w,v,g))}},function(t,e,n){var r=n(89),i=n(305),o=n(306);function u(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}u.prototype.add=u.prototype.push=i,u.prototype.has=o,t.exports=u},function(t,e){var n="__lodash_hash_undefined__";t.exports=function(t){return this.__data__.set(t,n),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e){t.exports=function(t,e){return t.has(e)}},function(t,e,n){var r=n(58),i=n(309),o=n(38),u=n(142),s=n(310),a=n(311),c=1,f=2,l="[object Boolean]",h="[object Date]",p="[object Error]",d="[object Map]",y="[object Number]",w="[object RegExp]",v="[object Set]",g="[object String]",M="[object Symbol]",_="[object ArrayBuffer]",m="[object DataView]",L=r?r.prototype:void 0,b=L?L.valueOf:void 0;t.exports=function(t,e,n,r,L,j,x){switch(n){case m:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case _:return!(t.byteLength!=e.byteLength||!j(new i(t),new i(e)));case l:case h:case y:return o(+t,+e);case p:return t.name==e.name&&t.message==e.message;case w:case g:return t==e+"";case d:var N=s;case v:var S=r&c;if(N||(N=a),t.size!=e.size&&!S)return!1;var D=x.get(t);if(D)return D==e;r|=f,x.set(t,e);var I=u(N(t),N(e),r,L,j,x);return x.delete(t),I;case M:if(b)return b.call(t)==b.call(e)}return!1}},function(t,e,n){var r=n(11).Uint8Array;t.exports=r},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}},function(t,e,n){var r=n(313),i=1,o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,u,s,a){var c=n&i,f=r(t),l=f.length;if(l!=r(e).length&&!c)return!1;for(var h=l;h--;){var p=f[h];if(!(c?p in e:o.call(e,p)))return!1}var d=a.get(t);if(d&&a.get(e))return d==e;var y=!0;a.set(t,e),a.set(e,t);for(var w=c;++h<l;){var v=t[p=f[h]],g=e[p];if(u)var M=c?u(g,v,p,e,t,a):u(v,g,p,t,e,a);if(!(void 0===M?v===g||s(v,g,n,u,a):M)){y=!1;break}w||(w="constructor"==p)}if(y&&!w){var _=t.constructor,m=e.constructor;_!=m&&"constructor"in t&&"constructor"in e&&!("function"==typeof _&&_ instanceof _&&"function"==typeof m&&m instanceof m)&&(y=!1)}return a.delete(t),a.delete(e),y}},function(t,e,n){var r=n(314),i=n(316),o=n(64);t.exports=function(t){return r(t,o,i)}},function(t,e,n){var r=n(315),i=n(12);t.exports=function(t,e,n){var o=e(t);return i(t)?o:r(o,n(t))}},function(t,e){t.exports=function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}},function(t,e,n){var r=n(317),i=n(318),o=Object.prototype.propertyIsEnumerable,u=Object.getOwnPropertySymbols,s=u?function(t){return null==t?[]:(t=Object(t),r(u(t),function(e){return o.call(t,e)}))}:i;t.exports=s},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var u=t[n];e(u,n,t)&&(o[i++]=u)}return o}},function(t,e){t.exports=function(){return[]}},function(t,e,n){var r=n(320),i=n(144),o=n(12),u=n(145),s=n(92),a=n(147),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=o(t),f=!n&&i(t),l=!n&&!f&&u(t),h=!n&&!f&&!l&&a(t),p=n||f||l||h,d=p?r(t.length,String):[],y=d.length;for(var w in t)!e&&!c.call(t,w)||p&&("length"==w||l&&("offset"==w||"parent"==w)||h&&("buffer"==w||"byteLength"==w||"byteOffset"==w)||s(w,y))||d.push(w);return d}},function(t,e){t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},function(t,e,n){var r=n(43),i=n(44),o="[object Arguments]";t.exports=function(t){return i(t)&&r(t)==o}},function(t,e){t.exports=function(){return!1}},function(t,e,n){var r=n(43),i=n(93),o=n(44),u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u["[object Arguments]"]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u["[object Map]"]=u["[object Number]"]=u["[object Object]"]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!u[r(t)]}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,n){(function(t){var r=n(136),i=e&&!e.nodeType&&e,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,u=o&&o.exports===i&&r.process,s=function(){try{var t=o&&o.require&&o.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(t){}}();t.exports=s}).call(this,n(146)(t))},function(t,e,n){var r=n(327),i=n(328),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=[];for(var n in Object(t))o.call(t,n)&&"constructor"!=n&&e.push(n);return e}},function(t,e){var n=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},function(t,e,n){var r=n(329)(Object.keys,Object);t.exports=r},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){var r=n(331),i=n(90),o=n(332),u=n(333),s=n(334),a=n(43),c=n(139),f=c(r),l=c(i),h=c(o),p=c(u),d=c(s),y=a;(r&&"[object DataView]"!=y(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=y(new i)||o&&"[object Promise]"!=y(o.resolve())||u&&"[object Set]"!=y(new u)||s&&"[object WeakMap]"!=y(new s))&&(y=function(t){var e=a(t),n="[object Object]"==e?t.constructor:void 0,r=n?c(n):"";if(r)switch(r){case f:return"[object DataView]";case l:return"[object Map]";case h:return"[object Promise]";case p:return"[object Set]";case d:return"[object WeakMap]"}return e}),t.exports=y},function(t,e,n){var r=n(33)(n(11),"DataView");t.exports=r},function(t,e,n){var r=n(33)(n(11),"Promise");t.exports=r},function(t,e,n){var r=n(33)(n(11),"Set");t.exports=r},function(t,e,n){var r=n(33)(n(11),"WeakMap");t.exports=r},function(t,e,n){var r=n(148),i=n(64);t.exports=function(t){for(var e=i(t),n=e.length;n--;){var o=e[n],u=t[o];e[n]=[o,u,r(u)]}return e}},function(t,e,n){var r=n(141),i=n(337),o=n(340),u=n(94),s=n(148),a=n(149),c=n(66),f=1,l=2;t.exports=function(t,e){return u(t)&&s(e)?a(c(t),e):function(n){var u=i(n,t);return void 0===u&&u===e?o(n,t):r(e,u,f|l)}}},function(t,e,n){var r=n(150);t.exports=function(t,e,n){var i=null==t?void 0:r(t,e);return void 0===i?n:i}},function(t,e,n){var r=n(339),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,u=r(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(i,function(t,n,r,i){e.push(r?i.replace(o,"$1"):n||t)}),e});t.exports=u},function(t,e,n){var r=n(105),i=500;t.exports=function(t){var e=r(t,function(t){return n.size===i&&n.clear(),t}),n=e.cache;return e}},function(t,e,n){var r=n(341),i=n(342);t.exports=function(t,e){return null!=t&&i(t,e,r)}},function(t,e){t.exports=function(t,e){return null!=t&&e in Object(t)}},function(t,e,n){var r=n(151),i=n(144),o=n(12),u=n(92),s=n(93),a=n(66);t.exports=function(t,e,n){for(var c=-1,f=(e=r(e,t)).length,l=!1;++c<f;){var h=a(e[c]);if(!(l=null!=t&&n(t,h)))break;t=t[h]}return l||++c!=f?l:!!(f=null==t?0:t.length)&&s(f)&&u(h,f)&&(o(t)||i(t))}},function(t,e){t.exports=function(t){return t}},function(t,e,n){var r=n(345),i=n(346),o=n(94),u=n(66);t.exports=function(t){return o(t)?r(u(t)):i(t)}},function(t,e){t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},function(t,e,n){var r=n(150);t.exports=function(t){return function(e){return r(e,t)}}},function(t,e,n){var r=n(348),i=n(91),o=n(349),u=Math.max;t.exports=function(t,e,n){var s=null==t?0:t.length;if(!s)return-1;var a=null==n?0:o(n);return a<0&&(a=u(s+a,0)),r(t,i(e,3),a)}},function(t,e){t.exports=function(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}},function(t,e,n){var r=n(350);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},function(t,e,n){var r=n(351),i=1/0,o=17976931348623157e292;t.exports=function(t){return t?(t=r(t))===i||t===-i?(t<0?-1:1)*o:t==t?t:0:0===t?t:0}},function(t,e,n){var r=n(45),i=n(59),o=NaN,u=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return o;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(u,"");var n=a.test(t);return n||c.test(t)?f(t.slice(2),n?2:8):s.test(t)?o:+t}},function(t,e,n){var r=n(353);t.exports=function(t,e){var n;return r(t,function(t,r,i){return!(n=e(t,r,i))}),!!n}},function(t,e,n){var r=n(354),i=n(357)(r);t.exports=i},function(t,e,n){var r=n(355),i=n(64);t.exports=function(t,e){return t&&r(t,e,i)}},function(t,e,n){var r=n(356)();t.exports=r},function(t,e){t.exports=function(t){return function(e,n,r){for(var i=-1,o=Object(e),u=r(e),s=u.length;s--;){var a=u[t?s:++i];if(!1===n(o[a],a,o))break}return e}}},function(t,e,n){var r=n(65);t.exports=function(t,e){return function(n,i){if(null==n)return n;if(!r(n))return t(n,i);for(var o=n.length,u=e?o:-1,s=Object(n);(e?u--:++u<o)&&!1!==i(s[u],u,s););return n}}},function(t,e,n){var r=n(38),i=n(65),o=n(92),u=n(45);t.exports=function(t,e,n){if(!u(n))return!1;var s=typeof e;return!!("number"==s?i(n)&&o(e,n.length):"string"==s&&e in n)&&r(n[e],t)}},function(t,e){var n={"&":"&",'"':""","'":"'","<":"<",">":">"};t.exports=function(t){return t&&t.replace?t.replace(/([&"<>'])/g,function(t,e){return n[e]}):t}},function(t,e,n){t.exports=i;var r=n(95).EventEmitter;function i(){r.call(this)}n(7)(i,r),i.Readable=n(96),i.Writable=n(367),i.Duplex=n(368),i.Transform=n(369),i.PassThrough=n(370),i.Stream=i,i.prototype.pipe=function(t,e){var n=this;function i(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(n.on("end",s),n.on("close",a));var u=!1;function s(){u||(u=!0,t.end())}function a(){u||(u=!0,"function"==typeof t.destroy&&t.destroy())}function c(t){if(f(),0===r.listenerCount(this,"error"))throw t}function f(){n.removeListener("data",i),t.removeListener("drain",o),n.removeListener("end",s),n.removeListener("close",a),n.removeListener("error",c),t.removeListener("error",c),n.removeListener("end",f),n.removeListener("close",f),t.removeListener("close",f)}return n.on("error",c),t.on("error",c),n.on("end",f),n.on("close",f),t.on("close",f),t.emit("pipe",n),t}},function(t,e){},function(t,e,n){"use strict";var r=n(8).Buffer,i=n(363);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},t.prototype.concat=function(t){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var e,n,i,o=r.allocUnsafe(t>>>0),u=this.head,s=0;u;)e=u.data,n=o,i=s,e.copy(n,i),s+=u.data.length,u=u.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,o,u,s,a=1,c={},f=!1,l=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick(function(){d(t)})}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){d(t.data)},r=function(t){o.port2.postMessage(t)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,r=function(t){var e=l.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(d,0,t)}:(u="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(u)&&d(+e.data.slice(u.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),r=function(e){t.postMessage(u+e,"*")}),h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var i={callback:t,args:e};return c[a]=i,r(a),a++},h.clearImmediate=p}function p(t){delete c[t]}function d(t){if(f)setTimeout(d,0,t);else{var e=c[t];if(e){f=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(n,r)}}(e)}finally{p(t),f=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n(10),n(22))},function(t,e,n){(function(e){function n(t){try{if(!e.localStorage)return!1}catch(t){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}}).call(this,n(10))},function(t,e,n){"use strict";t.exports=o;var r=n(157),i=n(46);function o(t){if(!(this instanceof o))return new o(t);r.call(this,t)}i.inherits=n(7),i.inherits(o,r),o.prototype._transform=function(t,e,n){n(null,t)}},function(t,e,n){t.exports=n(97)},function(t,e,n){t.exports=n(23)},function(t,e,n){t.exports=n(96).Transform},function(t,e,n){t.exports=n(96).PassThrough},function(t,e,n){"use strict";var r=n(372),i=Math.abs,o=Math.floor;t.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?r(t)*o(i(t)):t}},function(t,e,n){"use strict";t.exports=n(373)()?Math.sign:n(374)},function(t,e,n){"use strict";t.exports=function(){var t=Math.sign;return"function"==typeof t&&(1===t(10)&&-1===t(-20))}},function(t,e,n){"use strict";t.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}},function(t,e,n){"use strict";var r=n(18),i=n(68),o=n(26),u=n(377),s=n(160);t.exports=function t(e){var n,a,c;if(r(e),(n=Object(arguments[1])).async&&n.promise)throw new Error("Options 'async' and 'promise' cannot be used together");return hasOwnProperty.call(e,"__memoized__")&&!n.force?e:(a=s(n.length,e.length,n.async&&o.async),c=u(e,a,n),i(o,function(t,e){n[e]&&t(n[e],c,n)}),t.__profiler__&&t.__profiler__(c),c.updateEnv(),c.memoized)}},function(t,e,n){"use strict";var r=n(18),i=n(34),o=Function.prototype.bind,u=Function.prototype.call,s=Object.keys,a=Object.prototype.propertyIsEnumerable;t.exports=function(t,e){return function(n,c){var f,l=arguments[2],h=arguments[3];return n=Object(i(n)),r(c),f=s(n),h&&f.sort("function"==typeof h?o.call(h,n):void 0),"function"!=typeof t&&(t=f[t]),u.call(t,f,function(t,r){return a.call(n,t)?u.call(c,l,n[t],t,n,r):e})}}},function(t,e,n){"use strict";var r=n(378),i=n(162),o=n(69),u=n(388).methods,s=n(389),a=n(401),c=Function.prototype.apply,f=Function.prototype.call,l=Object.create,h=Object.defineProperties,p=u.on,d=u.emit;t.exports=function(t,e,n){var u,y,w,v,g,M,_,m,L,b,j,x,N,S,D,I=l(null);return y=!1!==e?e:isNaN(t.length)?1:t.length,n.normalizer&&(b=a(n.normalizer),w=b.get,v=b.set,g=b.delete,M=b.clear),null!=n.resolvers&&(D=s(n.resolvers)),S=w?i(function(e){var n,i,o=arguments;if(D&&(o=D(o)),null!==(n=w(o))&&hasOwnProperty.call(I,n))return j&&u.emit("get",n,o,this),I[n];if(i=1===o.length?f.call(t,this,o[0]):c.call(t,this,o),null===n){if(null!==(n=w(o)))throw r("Circular invocation","CIRCULAR_INVOCATION");n=v(o)}else if(hasOwnProperty.call(I,n))throw r("Circular invocation","CIRCULAR_INVOCATION");return I[n]=i,x&&u.emit("set",n,null,i),i},y):0===e?function(){var e;if(hasOwnProperty.call(I,"data"))return j&&u.emit("get","data",arguments,this),I.data;if(e=arguments.length?c.call(t,this,arguments):f.call(t,this),hasOwnProperty.call(I,"data"))throw r("Circular invocation","CIRCULAR_INVOCATION");return I.data=e,x&&u.emit("set","data",null,e),e}:function(e){var n,i,o=arguments;if(D&&(o=D(arguments)),i=String(o[0]),hasOwnProperty.call(I,i))return j&&u.emit("get",i,o,this),I[i];if(n=1===o.length?f.call(t,this,o[0]):c.call(t,this,o),hasOwnProperty.call(I,i))throw r("Circular invocation","CIRCULAR_INVOCATION");return I[i]=n,x&&u.emit("set",i,null,n),n},u={original:t,memoized:S,profileName:n.profileName,get:function(t){return D&&(t=D(t)),w?w(t):String(t[0])},has:function(t){return hasOwnProperty.call(I,t)},delete:function(t){var e;hasOwnProperty.call(I,t)&&(g&&g(t),e=I[t],delete I[t],N&&u.emit("delete",t,e))},clear:function(){var t=I;M&&M(),I=l(null),u.emit("clear",t)},on:function(t,e){return"get"===t?j=!0:"set"===t?x=!0:"delete"===t&&(N=!0),p.call(this,t,e)},emit:d,updateEnv:function(){t=u.original}},_=w?i(function(t){var e,n=arguments;D&&(n=D(n)),null!==(e=w(n))&&u.delete(e)},y):0===e?function(){return u.delete("data")}:function(t){return D&&(t=D(arguments)[0]),u.delete(t)},m=i(function(){var t,n=arguments;return 0===e?I.data:(D&&(n=D(n)),t=w?w(n):String(n[0]),I[t])}),L=i(function(){var t,n=arguments;return 0===e?u.has("data"):(D&&(n=D(n)),null!==(t=w?w(n):String(n[0]))&&u.has(t))}),h(S,{__memoized__:o(!0),delete:o(_),clear:o(u.clear),_get:o(m),_has:o(L)}),u}},function(t,e,n){"use strict";var r=n(161),i=n(384),o=n(24),u=Error.captureStackTrace;e=t.exports=function(t){var n=new Error(t),s=arguments[1],a=arguments[2];return o(a)||i(s)&&(a=s,s=null),o(a)&&r(n,a),o(s)&&(n.code=s),u&&u(n,e),n}},function(t,e,n){"use strict";t.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},function(t,e,n){"use strict";var r=n(381),i=n(34),o=Math.max;t.exports=function(t,e){var n,u,s,a=o(arguments.length,2);for(t=Object(i(t)),s=function(r){try{t[r]=e[r]}catch(t){n||(n=t)}},u=1;u<a;++u)e=arguments[u],r(e).forEach(s);if(void 0!==n)throw n;return t}},function(t,e,n){"use strict";t.exports=n(382)()?Object.keys:n(383)},function(t,e,n){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e,n){"use strict";var r=n(24),i=Object.keys;t.exports=function(t){return i(r(t)?Object(t):t)}},function(t,e,n){"use strict";var r=n(24),i={function:!0,object:!0};t.exports=function(t){return r(t)&&i[typeof t]||!1}},function(t,e,n){"use strict";t.exports=n(386)()?String.prototype.contains:n(387)},function(t,e,n){"use strict";var r="razdwatrzy";t.exports=function(){return"function"==typeof r.contains&&(!0===r.contains("dwa")&&!1===r.contains("foo"))}},function(t,e,n){"use strict";var r=String.prototype.indexOf;t.exports=function(t){return r.call(this,t,arguments[1])>-1}},function(t,e,n){"use strict";var r,i,o,u,s,a,c,f=n(69),l=n(18),h=Function.prototype.apply,p=Function.prototype.call,d=Object.create,y=Object.defineProperty,w=Object.defineProperties,v=Object.prototype.hasOwnProperty,g={configurable:!0,enumerable:!1,writable:!0};i=function(t,e){var n,i;return l(e),i=this,r.call(this,t,n=function(){o.call(i,t,n),h.call(e,this,arguments)}),n.__eeOnceListener__=e,this},s={on:r=function(t,e){var n;return l(e),v.call(this,"__ee__")?n=this.__ee__:(n=g.value=d(null),y(this,"__ee__",g),g.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},once:i,off:o=function(t,e){var n,r,i,o;if(l(e),!v.call(this,"__ee__"))return this;if(!(n=this.__ee__)[t])return this;if("object"==typeof(r=n[t]))for(o=0;i=r[o];++o)i!==e&&i.__eeOnceListener__!==e||(2===r.length?n[t]=r[o?0:1]:r.splice(o,1));else r!==e&&r.__eeOnceListener__!==e||delete n[t];return this},emit:u=function(t){var e,n,r,i,o;if(v.call(this,"__ee__")&&(i=this.__ee__[t]))if("object"==typeof i){for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];for(i=i.slice(),e=0;r=i[e];++e)h.call(r,this,o)}else switch(arguments.length){case 1:p.call(i,this);break;case 2:p.call(i,this,arguments[1]);break;case 3:p.call(i,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];h.call(i,this,o)}}},a={on:f(r),once:f(i),off:f(o),emit:f(u)},c=w({},a),t.exports=e=function(t){return null==t?d(c):w(Object(t),a)},e.methods=s},function(t,e,n){"use strict";var r,i=n(390),o=n(24),u=n(18),s=Array.prototype.slice;r=function(t){return this.map(function(e,n){return e?e(t[n]):t[n]}).concat(s.call(t,this.length))},t.exports=function(t){return(t=i(t)).forEach(function(t){o(t)&&u(t)}),r.bind(t)}},function(t,e,n){"use strict";var r=n(99),i=Array.isArray;t.exports=function(t){return i(t)?t:r(t)}},function(t,e,n){"use strict";t.exports=function(){var t,e,n=Array.from;return"function"==typeof n&&(e=n(t=["raz","dwa"]),Boolean(e&&e!==t&&"dwa"===e[1]))}},function(t,e,n){"use strict";var r=n(393).iterator,i=n(398),o=n(399),u=n(25),s=n(18),a=n(34),c=n(24),f=n(400),l=Array.isArray,h=Function.prototype.call,p={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;t.exports=function(t){var e,n,y,w,v,g,M,_,m,L,b=arguments[1],j=arguments[2];if(t=Object(a(t)),c(b)&&s(b),this&&this!==Array&&o(this))e=this;else{if(!b){if(i(t))return 1!==(v=t.length)?Array.apply(null,t):((w=new Array(1))[0]=t[0],w);if(l(t)){for(w=new Array(v=t.length),n=0;n<v;++n)w[n]=t[n];return w}}w=[]}if(!l(t))if(void 0!==(m=t[r])){for(M=s(m).call(t),e&&(w=new e),_=M.next(),n=0;!_.done;)L=b?h.call(b,j,_.value,n):_.value,e?(p.value=L,d(w,n,p)):w[n]=L,_=M.next(),++n;v=n}else if(f(t)){for(v=t.length,e&&(w=new e),n=0,y=0;n<v;++n)L=t[n],n+1<v&&(g=L.charCodeAt(0))>=55296&&g<=56319&&(L+=t[++n]),L=b?h.call(b,j,L,y):L,e?(p.value=L,d(w,y,p)):w[y]=L,++y;v=y}if(void 0===v)for(v=u(t.length),e&&(w=new e(v)),n=0;n<v;++n)L=b?h.call(b,j,t[n],n):t[n],e?(p.value=L,d(w,n,p)):w[n]=L;return e&&(p.value=null,w.length=v),w}},function(t,e,n){"use strict";t.exports=n(394)()?Symbol:n(395)},function(t,e,n){"use strict";var r={object:!0,symbol:!0};t.exports=function(){var t;if("function"!=typeof Symbol)return!1;t=Symbol("test symbol");try{String(t)}catch(t){return!1}return!!r[typeof Symbol.iterator]&&(!!r[typeof Symbol.toPrimitive]&&!!r[typeof Symbol.toStringTag])}},function(t,e,n){"use strict";var r,i,o,u,s=n(69),a=n(396),c=Object.create,f=Object.defineProperties,l=Object.defineProperty,h=Object.prototype,p=c(null);if("function"==typeof Symbol){r=Symbol;try{String(r()),u=!0}catch(t){}}var d,y=(d=c(null),function(t){for(var e,n,r=0;d[t+(r||"")];)++r;return d[t+=r||""]=!0,l(h,e="@@"+t,s.gs(null,function(t){n||(n=!0,l(this,e,s(t)),n=!1)})),e});o=function(t){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return i(t)},t.exports=i=function t(e){var n;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return u?r(e):(n=c(o.prototype),e=void 0===e?"":String(e),f(n,{__description__:s("",e),__name__:s("",y(e))}))},f(i,{for:s(function(t){return p[t]?p[t]:p[t]=i(String(t))}),keyFor:s(function(t){var e;for(e in a(t),p)if(p[e]===t)return e}),hasInstance:s("",r&&r.hasInstance||i("hasInstance")),isConcatSpreadable:s("",r&&r.isConcatSpreadable||i("isConcatSpreadable")),iterator:s("",r&&r.iterator||i("iterator")),match:s("",r&&r.match||i("match")),replace:s("",r&&r.replace||i("replace")),search:s("",r&&r.search||i("search")),species:s("",r&&r.species||i("species")),split:s("",r&&r.split||i("split")),toPrimitive:s("",r&&r.toPrimitive||i("toPrimitive")),toStringTag:s("",r&&r.toStringTag||i("toStringTag")),unscopables:s("",r&&r.unscopables||i("unscopables"))}),f(o.prototype,{constructor:s(i),toString:s("",function(){return this.__name__})}),f(i.prototype,{toString:s(function(){return"Symbol ("+a(this).__description__+")"}),valueOf:s(function(){return a(this)})}),l(i.prototype,i.toPrimitive,s("",function(){var t=a(this);return"symbol"==typeof t?t:t.toString()})),l(i.prototype,i.toStringTag,s("c","Symbol")),l(o.prototype,i.toStringTag,s("c",i.prototype[i.toStringTag])),l(o.prototype,i.toPrimitive,s("c",i.prototype[i.toPrimitive]))},function(t,e,n){"use strict";var r=n(397);t.exports=function(t){if(!r(t))throw new TypeError(t+" is not a symbol");return t}},function(t,e,n){"use strict";t.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&("Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag]))}},function(t,e,n){"use strict";var r=Object.prototype.toString,i=r.call(function(){return arguments}());t.exports=function(t){return r.call(t)===i}},function(t,e,n){"use strict";var r=Object.prototype.toString,i=r.call(n(159));t.exports=function(t){return"function"==typeof t&&r.call(t)===i}},function(t,e,n){"use strict";var r=Object.prototype.toString,i=r.call("");t.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||r.call(t)===i)||!1}},function(t,e,n){"use strict";var r=n(18);t.exports=function(t){var e;return"function"==typeof t?{set:t,get:t}:(e={get:r(t.get)},void 0!==t.set?(e.set=r(t.set),t.delete&&(e.delete=r(t.delete)),t.clear&&(e.clear=r(t.clear)),e):(e.set=e.get,e))}},function(t,e,n){"use strict";t.exports=function(t){var e,n,r=t.length;if(!r)return"";for(e=String(t[n=0]);--r;)e+=""+t[++n];return e}},function(t,e,n){"use strict";t.exports=function(t){return t?function(e){for(var n=String(e[0]),r=0,i=t;--i;)n+=""+e[++r];return n}:function(){return""}}},function(t,e,n){"use strict";var r=n(100),i=Object.create;t.exports=function(){var t=0,e=[],n=i(null);return{get:function(t){var n,i=0,o=e,u=t.length;if(0===u)return o[u]||null;if(o=o[u]){for(;i<u-1;){if(-1===(n=r.call(o[0],t[i])))return null;o=o[1][n],++i}return-1===(n=r.call(o[0],t[i]))?null:o[1][n]||null}return null},set:function(i){var o,u=0,s=e,a=i.length;if(0===a)s[a]=++t;else{for(s[a]||(s[a]=[[],[]]),s=s[a];u<a-1;)-1===(o=r.call(s[0],i[u]))&&(o=s[0].push(i[u])-1,s[1].push([[],[]])),s=s[1][o],++u;-1===(o=r.call(s[0],i[u]))&&(o=s[0].push(i[u])-1),s[1][o]=++t}return n[t]=i,t},delete:function(t){var i,o=0,u=e,s=n[t],a=s.length,c=[];if(0===a)delete u[a];else if(u=u[a]){for(;o<a-1;){if(-1===(i=r.call(u[0],s[o])))return;c.push(u,i),u=u[1][i],++o}if(-1===(i=r.call(u[0],s[o])))return;for(t=u[1][i],u[0].splice(i,1),u[1].splice(i,1);!u[0].length&&c.length;)i=c.pop(),(u=c.pop())[0].splice(i,1),u[1].splice(i,1)}delete n[t]},clear:function(){e=[],n=i(null)}}}},function(t,e,n){"use strict";t.exports=n(406)()?Number.isNaN:n(407)},function(t,e,n){"use strict";t.exports=function(){var t=Number.isNaN;return"function"==typeof t&&(!t({})&&t(NaN)&&!t(34))}},function(t,e,n){"use strict";t.exports=function(t){return t!=t}},function(t,e,n){"use strict";var r=n(100);t.exports=function(){var t=0,e=[],n=[];return{get:function(t){var i=r.call(e,t[0]);return-1===i?null:n[i]},set:function(r){return e.push(r[0]),n.push(++t),t},delete:function(t){var i=r.call(n,t);-1!==i&&(e.splice(i,1),n.splice(i,1))},clear:function(){e=[],n=[]}}}},function(t,e,n){"use strict";var r=n(100),i=Object.create;t.exports=function(t){var e=0,n=[[],[]],o=i(null);return{get:function(e){for(var i,o=0,u=n;o<t-1;){if(-1===(i=r.call(u[0],e[o])))return null;u=u[1][i],++o}return-1===(i=r.call(u[0],e[o]))?null:u[1][i]||null},set:function(i){for(var u,s=0,a=n;s<t-1;)-1===(u=r.call(a[0],i[s]))&&(u=a[0].push(i[s])-1,a[1].push([[],[]])),a=a[1][u],++s;return-1===(u=r.call(a[0],i[s]))&&(u=a[0].push(i[s])-1),a[1][u]=++e,o[e]=i,e},delete:function(e){for(var i,u=0,s=n,a=[],c=o[e];u<t-1;){if(-1===(i=r.call(s[0],c[u])))return;a.push(s,i),s=s[1][i],++u}if(-1!==(i=r.call(s[0],c[u]))){for(e=s[1][i],s[0].splice(i,1),s[1].splice(i,1);!s[0].length&&a.length;)i=a.pop(),(s=a.pop())[0].splice(i,1),s[1].splice(i,1);delete o[e]}},clear:function(){n=[[],[]],o=i(null)}}}},function(t,e,n){"use strict";var r=n(99),i=n(164),o=n(163),u=n(162),s=n(101),a=Array.prototype.slice,c=Function.prototype.apply,f=Object.create;n(26).async=function(t,e){var n,l,h,p=f(null),d=f(null),y=e.memoized,w=e.original;e.memoized=u(function(t){var e=arguments,r=e[e.length-1];return"function"==typeof r&&(n=r,e=a.call(e,0,-1)),y.apply(l=this,h=e)},y);try{o(e.memoized,y)}catch(t){}e.on("get",function(t){var r,i,o;if(n){if(p[t])return"function"==typeof p[t]?p[t]=[p[t],n]:p[t].push(n),void(n=null);r=n,i=l,o=h,n=l=h=null,s(function(){var u;hasOwnProperty.call(d,t)?(u=d[t],e.emit("getasync",t,o,i),c.call(r,u.context,u.args)):(n=r,l=i,h=o,y.apply(i,o))})}}),e.original=function(){var t,i,o,u;return n?(t=r(arguments),i=function t(n){var i,o,a=t.id;if(null!=a){if(delete t.id,i=p[a],delete p[a],i)return o=r(arguments),e.has(a)&&(n?e.delete(a):(d[a]={context:this,args:o},e.emit("setasync",a,"function"==typeof i?1:i.length))),"function"==typeof i?u=c.call(i,this,o):i.forEach(function(t){u=c.call(t,this,o)},this),u}else s(c.bind(t,this,arguments))},o=n,n=l=h=null,t.push(i),u=c.call(w,this,t),i.cb=o,n=i,u):c.call(w,this,arguments)},e.on("set",function(t){n?(p[t]?"function"==typeof p[t]?p[t]=[p[t],n.cb]:p[t].push(n.cb):p[t]=n.cb,delete n.cb,n.id=t,n=null):e.delete(t)}),e.on("delete",function(t){var n;hasOwnProperty.call(p,t)||d[t]&&(n=d[t],delete d[t],e.emit("deleteasync",t,a.call(n.args,1)))}),e.on("clear",function(){var t=d;d=f(null),e.emit("clearasync",i(t,function(t){return a.call(t.args,1)}))})}},function(t,e,n){"use strict";var r=n(164),i=n(412),o=n(413),u=n(415),s=n(165),a=n(101),c=Object.create,f=i("then","then:finally","done","done:finally");n(26).promise=function(t,e){var n=c(null),i=c(null),l=c(null);if(!0===t)t=null;else if(t=o(t),!f[t])throw new TypeError("'"+u(t)+"' is not valid promise mode");e.on("set",function(r,o,u){var c=!1;if(!s(u))return i[r]=u,void e.emit("setasync",r,1);n[r]=1,l[r]=u;var f=function(t){var o=n[r];if(c)throw new Error("Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode)\nConsider to rely on 'then' or 'done' mode instead.");o&&(delete n[r],i[r]=t,e.emit("setasync",r,o))},h=function(){c=!0,n[r]&&(delete n[r],delete l[r],e.delete(r))},p=t;if(p||(p="then"),"then"===p){var d=function(){a(h)};"function"==typeof(u=u.then(function(t){a(f.bind(this,t))},d)).finally&&u.finally(d)}else if("done"===p){if("function"!=typeof u.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");u.done(f,h)}else if("done:finally"===p){if("function"!=typeof u.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if("function"!=typeof u.finally)throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");u.done(f),u.finally(h)}}),e.on("get",function(t,r,i){var o;if(n[t])++n[t];else{o=l[t];var u=function(){e.emit("getasync",t,r,i)};s(o)?"function"==typeof o.done?o.done(u):o.then(function(){a(u)}):u()}}),e.on("delete",function(t){if(delete l[t],n[t])delete n[t];else if(hasOwnProperty.call(i,t)){var r=i[t];delete i[t],e.emit("deleteasync",t,[r])}}),e.on("clear",function(){var t=i;i=c(null),n=c(null),l=c(null),e.emit("clearasync",r(t,function(t){return[t]}))})}},function(t,e,n){"use strict";var r=Array.prototype.forEach,i=Object.create;t.exports=function(t){var e=i(null);return r.call(arguments,function(t){e[t]=!0}),e}},function(t,e,n){"use strict";var r=n(34),i=n(414);t.exports=function(t){return i(r(t))}},function(t,e,n){"use strict";var r=n(98);t.exports=function(t){try{return t&&r(t.toString)?t.toString():String(t)}catch(t){throw new TypeError("Passed argument cannot be stringifed")}}},function(t,e,n){"use strict";var r=n(416),i=/[\n\r\u2028\u2029]/g;t.exports=function(t){var e=r(t);return e.length>100&&(e=e.slice(0,99)+"…"),e=e.replace(i,function(t){return JSON.stringify(t).slice(1,-1)})}},function(t,e,n){"use strict";var r=n(98);t.exports=function(t){try{return t&&r(t.toString)?t.toString():String(t)}catch(t){return"<Non-coercible to string value>"}}},function(t,e,n){"use strict";var r=n(18),i=n(68),o=n(26),u=Function.prototype.apply;o.dispose=function(t,e,n){var s;if(r(t),n.async&&o.async||n.promise&&o.promise)return e.on("deleteasync",s=function(e,n){u.call(t,null,n)}),void e.on("clearasync",function(t){i(t,function(t,e){s(e,t)})});e.on("delete",s=function(e,n){t(n)}),e.on("clear",function(t){i(t,function(t,e){s(e,t)})})}},function(t,e,n){"use strict";var r=n(99),i=n(68),o=n(101),u=n(165),s=n(419),a=n(26),c=Function.prototype,f=Math.max,l=Math.min,h=Object.create;a.maxAge=function(t,e,n){var p,d,y,w;(t=s(t))&&(p=h(null),d=n.async&&a.async||n.promise&&a.promise?"async":"",e.on("set"+d,function(n){p[n]=setTimeout(function(){e.delete(n)},t),"function"==typeof p[n].unref&&p[n].unref(),w&&(w[n]&&"nextTick"!==w[n]&&clearTimeout(w[n]),w[n]=setTimeout(function(){delete w[n]},y),"function"==typeof w[n].unref&&w[n].unref())}),e.on("delete"+d,function(t){clearTimeout(p[t]),delete p[t],w&&("nextTick"!==w[t]&&clearTimeout(w[t]),delete w[t])}),n.preFetch&&(y=!0===n.preFetch||isNaN(n.preFetch)?.333:f(l(Number(n.preFetch),1),0))&&(w={},y=(1-y)*t,e.on("get"+d,function(t,i,s){w[t]||(w[t]="nextTick",o(function(){var o;"nextTick"===w[t]&&(delete w[t],e.delete(t),n.async&&(i=r(i)).push(c),o=e.memoized.apply(s,i),n.promise&&u(o)&&("function"==typeof o.done?o.done(c,c):o.then(c,c)))}))})),e.on("clear"+d,function(){i(p,function(t){clearTimeout(t)}),p={},w&&(i(w,function(t){"nextTick"!==t&&clearTimeout(t)}),w={})}))}},function(t,e,n){"use strict";var r=n(25),i=n(420);t.exports=function(t){if((t=r(t))>i)throw new TypeError(t+" exceeds maximum possible timeout");return t}},function(t,e,n){"use strict";t.exports=2147483647},function(t,e,n){"use strict";var r=n(25),i=n(422),o=n(26);o.max=function(t,e,n){var u,s,a;(t=r(t))&&(s=i(t),u=n.async&&o.async||n.promise&&o.promise?"async":"",e.on("set"+u,a=function(t){void 0!==(t=s.hit(t))&&e.delete(t)}),e.on("get"+u,a),e.on("delete"+u,s.delete),e.on("clear"+u,s.clear))}},function(t,e,n){"use strict";var r=n(25),i=Object.create,o=Object.prototype.hasOwnProperty;t.exports=function(t){var e,n=0,u=1,s=i(null),a=i(null),c=0;return t=r(t),{hit:function(r){var i=a[r],f=++c;if(s[f]=r,a[r]=f,!i){if(++n<=t)return;return r=s[u],e(r),r}if(delete s[i],u===i)for(;!o.call(s,++u);)continue},delete:e=function(t){var e=a[t];if(e&&(delete s[e],delete a[t],--n,u===e)){if(!n)return c=0,void(u=1);for(;!o.call(s,++u);)continue}},clear:function(){n=0,u=1,s=i(null),a=i(null),c=0}}}},function(t,e,n){"use strict";var r=n(69),i=n(26),o=Object.create,u=Object.defineProperties;i.refCounter=function(t,e,n){var s,a;s=o(null),a=n.async&&i.async||n.promise&&i.promise?"async":"",e.on("set"+a,function(t,e){s[t]=e||1}),e.on("get"+a,function(t){++s[t]}),e.on("delete"+a,function(t){delete s[t]}),e.on("clear"+a,function(){s={}}),u(e.memoized,{deleteRef:r(function(){var t=e.get(arguments);return null===t?null:s[t]?!--s[t]&&(e.delete(t),!0):null}),getRefCount:r(function(){var t=e.get(arguments);return null===t?0:s[t]?s[t]:0})})}},function(t,e,n){var r=n(7),i=n(35),o=n(8).Buffer,u=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function a(){this.init(),this._w=s,i.call(this,64,56)}function c(t){return t<<30|t>>>2}function f(t,e,n,r){return 0===t?e&n|~e&r:2===t?e&n|e&r|n&r:e^n^r}r(a,i),a.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},a.prototype._update=function(t){for(var e,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,l=0;l<16;++l)n[l]=t.readInt32BE(4*l);for(;l<80;++l)n[l]=n[l-3]^n[l-8]^n[l-14]^n[l-16];for(var h=0;h<80;++h){var p=~~(h/20),d=0|((e=r)<<5|e>>>27)+f(p,i,o,s)+a+n[h]+u[p];a=s,s=o,o=c(i),i=r,r=d}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},a.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=a},function(t,e,n){var r=n(7),i=n(35),o=n(8).Buffer,u=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function a(){this.init(),this._w=s,i.call(this,64,56)}function c(t){return t<<5|t>>>27}function f(t){return t<<30|t>>>2}function l(t,e,n,r){return 0===t?e&n|~e&r:2===t?e&n|e&r|n&r:e^n^r}r(a,i),a.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},a.prototype._update=function(t){for(var e,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,h=0;h<16;++h)n[h]=t.readInt32BE(4*h);for(;h<80;++h)n[h]=(e=n[h-3]^n[h-8]^n[h-14]^n[h-16])<<1|e>>>31;for(var p=0;p<80;++p){var d=~~(p/20),y=c(r)+l(d,i,o,s)+a+n[p]+u[d]|0;a=s,s=o,o=f(i),i=r,r=y}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},a.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=a},function(t,e,n){var r=n(7),i=n(166),o=n(35),u=n(8).Buffer,s=new Array(64);function a(){this.init(),this._w=s,o.call(this,64,56)}r(a,i),a.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},a.prototype._hash=function(){var t=u.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=a},function(t,e,n){var r=n(7),i=n(167),o=n(35),u=n(8).Buffer,s=new Array(160);function a(){this.init(),this._w=s,o.call(this,128,112)}r(a,i),a.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},a.prototype._hash=function(){var t=u.allocUnsafe(48);function e(e,n,r){t.writeInt32BE(e,r),t.writeInt32BE(n,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=a},function(t,e,n){"use strict";var r=n(429),i=n(448);function o(t){return function(){throw new Error("Function "+t+" is deprecated and cannot be used.")}}t.exports.Type=n(3),t.exports.Schema=n(37),t.exports.FAILSAFE_SCHEMA=n(102),t.exports.JSON_SCHEMA=n(169),t.exports.CORE_SCHEMA=n(168),t.exports.DEFAULT_SAFE_SCHEMA=n(48),t.exports.DEFAULT_FULL_SCHEMA=n(70),t.exports.load=r.load,t.exports.loadAll=r.loadAll,t.exports.safeLoad=r.safeLoad,t.exports.safeLoadAll=r.safeLoadAll,t.exports.dump=i.dump,t.exports.safeDump=i.safeDump,t.exports.YAMLException=n(47),t.exports.MINIMAL_SCHEMA=n(102),t.exports.SAFE_SCHEMA=n(48),t.exports.DEFAULT_SCHEMA=n(70),t.exports.scan=o("scan"),t.exports.parse=o("parse"),t.exports.compose=o("compose"),t.exports.addConstructor=o("addConstructor")},function(t,e,n){"use strict";var r=n(36),i=n(47),o=n(430),u=n(48),s=n(70),a=Object.prototype.hasOwnProperty,c=1,f=2,l=3,h=4,p=1,d=2,y=3,w=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,v=/[\x85\u2028\u2029]/,g=/[,\[\]\{\}]/,M=/^(?:!|!!|![a-z\-]+!)$/i,_=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function m(t){return Object.prototype.toString.call(t)}function L(t){return 10===t||13===t}function b(t){return 9===t||32===t}function j(t){return 9===t||32===t||10===t||13===t}function x(t){return 44===t||91===t||93===t||123===t||125===t}function N(t){var e;return 48<=t&&t<=57?t-48:97<=(e=32|t)&&e<=102?e-97+10:-1}function S(t){return 48===t?"\0":97===t?"":98===t?"\b":116===t?"\t":9===t?"\t":110===t?"\n":118===t?"\v":102===t?"\f":114===t?"\r":101===t?"":32===t?" ":34===t?'"':47===t?"/":92===t?"\\":78===t?"…":95===t?" ":76===t?"\u2028":80===t?"\u2029":""}function D(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}for(var I=new Array(256),E=new Array(256),C=0;C<256;C++)I[C]=S(C)?1:0,E[C]=S(C);function T(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||s,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function A(t,e){return new i(e,new o(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function O(t,e){throw A(t,e)}function z(t,e){t.onWarning&&t.onWarning.call(null,A(t,e))}var k={YAML:function(t,e,n){var r,i,o;null!==t.version&&O(t,"duplication of %YAML directive"),1!==n.length&&O(t,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&O(t,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&O(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=o<2,1!==o&&2!==o&&z(t,"unsupported YAML version of the document")},TAG:function(t,e,n){var r,i;2!==n.length&&O(t,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],M.test(r)||O(t,"ill-formed tag handle (first argument) of the TAG directive"),a.call(t.tagMap,r)&&O(t,'there is a previously declared suffix for "'+r+'" tag handle'),_.test(i)||O(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[r]=i}};function Y(t,e,n,r){var i,o,u,s;if(e<n){if(s=t.input.slice(e,n),r)for(i=0,o=s.length;i<o;i+=1)9===(u=s.charCodeAt(i))||32<=u&&u<=1114111||O(t,"expected valid JSON character");else w.test(s)&&O(t,"the stream contains non-printable characters");t.result+=s}}function U(t,e,n,i){var o,u,s,c;for(r.isObject(n)||O(t,"cannot merge mappings; the provided source object is unacceptable"),s=0,c=(o=Object.keys(n)).length;s<c;s+=1)u=o[s],a.call(e,u)||(e[u]=n[u],i[u]=!0)}function P(t,e,n,r,i,o,u,s){var c,f;if(Array.isArray(i))for(c=0,f=(i=Array.prototype.slice.call(i)).length;c<f;c+=1)Array.isArray(i[c])&&O(t,"nested arrays are not supported inside keys"),"object"==typeof i&&"[object Object]"===m(i[c])&&(i[c]="[object Object]");if("object"==typeof i&&"[object Object]"===m(i)&&(i="[object Object]"),i=String(i),null===e&&(e={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(o))for(c=0,f=o.length;c<f;c+=1)U(t,e,o[c],n);else U(t,e,o,n);else t.json||a.call(n,i)||!a.call(e,i)||(t.line=u||t.line,t.position=s||t.position,O(t,"duplicated mapping key")),e[i]=o,delete n[i];return e}function R(t){var e;10===(e=t.input.charCodeAt(t.position))?t.position++:13===e?(t.position++,10===t.input.charCodeAt(t.position)&&t.position++):O(t,"a line break is expected"),t.line+=1,t.lineStart=t.position}function Q(t,e,n){for(var r=0,i=t.input.charCodeAt(t.position);0!==i;){for(;b(i);)i=t.input.charCodeAt(++t.position);if(e&&35===i)do{i=t.input.charCodeAt(++t.position)}while(10!==i&&13!==i&&0!==i);if(!L(i))break;for(R(t),i=t.input.charCodeAt(t.position),r++,t.lineIndent=0;32===i;)t.lineIndent++,i=t.input.charCodeAt(++t.position)}return-1!==n&&0!==r&&t.lineIndent<n&&z(t,"deficient indentation"),r}function F(t){var e,n=t.position;return!(45!==(e=t.input.charCodeAt(n))&&46!==e||e!==t.input.charCodeAt(n+1)||e!==t.input.charCodeAt(n+2)||(n+=3,0!==(e=t.input.charCodeAt(n))&&!j(e)))}function B(t,e){1===e?t.result+=" ":e>1&&(t.result+=r.repeat("\n",e-1))}function G(t,e){var n,r,i=t.tag,o=t.anchor,u=[],s=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=u),r=t.input.charCodeAt(t.position);0!==r&&45===r&&j(t.input.charCodeAt(t.position+1));)if(s=!0,t.position++,Q(t,!0,-1)&&t.lineIndent<=e)u.push(null),r=t.input.charCodeAt(t.position);else if(n=t.line,J(t,e,l,!1,!0),u.push(t.result),Q(t,!0,-1),r=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&0!==r)O(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break;return!!s&&(t.tag=i,t.anchor=o,t.kind="sequence",t.result=u,!0)}function W(t){var e,n,r,i,o=!1,u=!1;if(33!==(i=t.input.charCodeAt(t.position)))return!1;if(null!==t.tag&&O(t,"duplication of a tag property"),60===(i=t.input.charCodeAt(++t.position))?(o=!0,i=t.input.charCodeAt(++t.position)):33===i?(u=!0,n="!!",i=t.input.charCodeAt(++t.position)):n="!",e=t.position,o){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&62!==i);t.position<t.length?(r=t.input.slice(e,t.position),i=t.input.charCodeAt(++t.position)):O(t,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!j(i);)33===i&&(u?O(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(e-1,t.position+1),M.test(n)||O(t,"named tag handle cannot contain such characters"),u=!0,e=t.position+1)),i=t.input.charCodeAt(++t.position);r=t.input.slice(e,t.position),g.test(r)&&O(t,"tag suffix cannot contain flow indicator characters")}return r&&!_.test(r)&&O(t,"tag name cannot contain such characters: "+r),o?t.tag=r:a.call(t.tagMap,n)?t.tag=t.tagMap[n]+r:"!"===n?t.tag="!"+r:"!!"===n?t.tag="tag:yaml.org,2002:"+r:O(t,'undeclared tag handle "'+n+'"'),!0}function q(t){var e,n;if(38!==(n=t.input.charCodeAt(t.position)))return!1;for(null!==t.anchor&&O(t,"duplication of an anchor property"),n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!j(n)&&!x(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&O(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function J(t,e,n,i,o){var u,s,w,v,g,M,_,m,S=1,C=!1,T=!1;if(null!==t.listener&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,u=s=w=h===n||l===n,i&&Q(t,!0,-1)&&(C=!0,t.lineIndent>e?S=1:t.lineIndent===e?S=0:t.lineIndent<e&&(S=-1)),1===S)for(;W(t)||q(t);)Q(t,!0,-1)?(C=!0,w=u,t.lineIndent>e?S=1:t.lineIndent===e?S=0:t.lineIndent<e&&(S=-1)):w=!1;if(w&&(w=C||o),1!==S&&h!==n||(_=c===n||f===n?e:e+1,m=t.position-t.lineStart,1===S?w&&(G(t,m)||function(t,e,n){var r,i,o,u,s,a=t.tag,c=t.anchor,l={},p={},d=null,y=null,w=null,v=!1,g=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=l),s=t.input.charCodeAt(t.position);0!==s;){if(r=t.input.charCodeAt(t.position+1),o=t.line,u=t.position,63!==s&&58!==s||!j(r)){if(!J(t,n,f,!1,!0))break;if(t.line===o){for(s=t.input.charCodeAt(t.position);b(s);)s=t.input.charCodeAt(++t.position);if(58===s)j(s=t.input.charCodeAt(++t.position))||O(t,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(P(t,l,p,d,y,null),d=y=w=null),g=!0,v=!1,i=!1,d=t.tag,y=t.result;else{if(!g)return t.tag=a,t.anchor=c,!0;O(t,"can not read an implicit mapping pair; a colon is missed")}}else{if(!g)return t.tag=a,t.anchor=c,!0;O(t,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===s?(v&&(P(t,l,p,d,y,null),d=y=w=null),g=!0,v=!0,i=!0):v?(v=!1,i=!0):O(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,s=r;if((t.line===o||t.lineIndent>e)&&(J(t,e,h,!0,i)&&(v?y=t.result:w=t.result),v||(P(t,l,p,d,y,w,o,u),d=y=w=null),Q(t,!0,-1),s=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==s)O(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return v&&P(t,l,p,d,y,null),g&&(t.tag=a,t.anchor=c,t.kind="mapping",t.result=l),g}(t,m,_))||function(t,e){var n,r,i,o,u,s,a,f,l,h,p=!0,d=t.tag,y=t.anchor,w={};if(91===(h=t.input.charCodeAt(t.position)))i=93,s=!1,r=[];else{if(123!==h)return!1;i=125,s=!0,r={}}for(null!==t.anchor&&(t.anchorMap[t.anchor]=r),h=t.input.charCodeAt(++t.position);0!==h;){if(Q(t,!0,e),(h=t.input.charCodeAt(t.position))===i)return t.position++,t.tag=d,t.anchor=y,t.kind=s?"mapping":"sequence",t.result=r,!0;p||O(t,"missed comma between flow collection entries"),l=null,o=u=!1,63===h&&j(t.input.charCodeAt(t.position+1))&&(o=u=!0,t.position++,Q(t,!0,e)),n=t.line,J(t,e,c,!1,!0),f=t.tag,a=t.result,Q(t,!0,e),h=t.input.charCodeAt(t.position),!u&&t.line!==n||58!==h||(o=!0,h=t.input.charCodeAt(++t.position),Q(t,!0,e),J(t,e,c,!1,!0),l=t.result),s?P(t,r,w,f,a,l):o?r.push(P(t,null,w,f,a,l)):r.push(a),Q(t,!0,e),44===(h=t.input.charCodeAt(t.position))?(p=!0,h=t.input.charCodeAt(++t.position)):p=!1}O(t,"unexpected end of the stream within a flow collection")}(t,_)?T=!0:(s&&function(t,e){var n,i,o,u,s,a=p,c=!1,f=!1,l=e,h=0,w=!1;if(124===(u=t.input.charCodeAt(t.position)))i=!1;else{if(62!==u)return!1;i=!0}for(t.kind="scalar",t.result="";0!==u;)if(43===(u=t.input.charCodeAt(++t.position))||45===u)p===a?a=43===u?y:d:O(t,"repeat of a chomping mode identifier");else{if(!((o=48<=(s=u)&&s<=57?s-48:-1)>=0))break;0===o?O(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):f?O(t,"repeat of an indentation width identifier"):(l=e+o-1,f=!0)}if(b(u)){do{u=t.input.charCodeAt(++t.position)}while(b(u));if(35===u)do{u=t.input.charCodeAt(++t.position)}while(!L(u)&&0!==u)}for(;0!==u;){for(R(t),t.lineIndent=0,u=t.input.charCodeAt(t.position);(!f||t.lineIndent<l)&&32===u;)t.lineIndent++,u=t.input.charCodeAt(++t.position);if(!f&&t.lineIndent>l&&(l=t.lineIndent),L(u))h++;else{if(t.lineIndent<l){a===y?t.result+=r.repeat("\n",c?1+h:h):a===p&&c&&(t.result+="\n");break}for(i?b(u)?(w=!0,t.result+=r.repeat("\n",c?1+h:h)):w?(w=!1,t.result+=r.repeat("\n",h+1)):0===h?c&&(t.result+=" "):t.result+=r.repeat("\n",h):t.result+=r.repeat("\n",c?1+h:h),c=!0,f=!0,h=0,n=t.position;!L(u)&&0!==u;)u=t.input.charCodeAt(++t.position);Y(t,n,t.position,!1)}}return!0}(t,_)||function(t,e){var n,r,i;if(39!==(n=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,r=i=t.position;0!==(n=t.input.charCodeAt(t.position));)if(39===n){if(Y(t,r,t.position,!0),39!==(n=t.input.charCodeAt(++t.position)))return!0;r=t.position,t.position++,i=t.position}else L(n)?(Y(t,r,i,!0),B(t,Q(t,!1,e)),r=i=t.position):t.position===t.lineStart&&F(t)?O(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);O(t,"unexpected end of the stream within a single quoted scalar")}(t,_)||function(t,e){var n,r,i,o,u,s,a;if(34!==(s=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,n=r=t.position;0!==(s=t.input.charCodeAt(t.position));){if(34===s)return Y(t,n,t.position,!0),t.position++,!0;if(92===s){if(Y(t,n,t.position,!0),L(s=t.input.charCodeAt(++t.position)))Q(t,!1,e);else if(s<256&&I[s])t.result+=E[s],t.position++;else if((u=120===(a=s)?2:117===a?4:85===a?8:0)>0){for(i=u,o=0;i>0;i--)(u=N(s=t.input.charCodeAt(++t.position)))>=0?o=(o<<4)+u:O(t,"expected hexadecimal character");t.result+=D(o),t.position++}else O(t,"unknown escape sequence");n=r=t.position}else L(s)?(Y(t,n,r,!0),B(t,Q(t,!1,e)),n=r=t.position):t.position===t.lineStart&&F(t)?O(t,"unexpected end of the document within a double quoted scalar"):(t.position++,r=t.position)}O(t,"unexpected end of the stream within a double quoted scalar")}(t,_)?T=!0:!function(t){var e,n,r;if(42!==(r=t.input.charCodeAt(t.position)))return!1;for(r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!j(r)&&!x(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&O(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),t.anchorMap.hasOwnProperty(n)||O(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],Q(t,!0,-1),!0}(t)?function(t,e,n){var r,i,o,u,s,a,c,f,l=t.kind,h=t.result;if(j(f=t.input.charCodeAt(t.position))||x(f)||35===f||38===f||42===f||33===f||124===f||62===f||39===f||34===f||37===f||64===f||96===f)return!1;if((63===f||45===f)&&(j(r=t.input.charCodeAt(t.position+1))||n&&x(r)))return!1;for(t.kind="scalar",t.result="",i=o=t.position,u=!1;0!==f;){if(58===f){if(j(r=t.input.charCodeAt(t.position+1))||n&&x(r))break}else if(35===f){if(j(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&F(t)||n&&x(f))break;if(L(f)){if(s=t.line,a=t.lineStart,c=t.lineIndent,Q(t,!1,-1),t.lineIndent>=e){u=!0,f=t.input.charCodeAt(t.position);continue}t.position=o,t.line=s,t.lineStart=a,t.lineIndent=c;break}}u&&(Y(t,i,o,!1),B(t,t.line-s),i=o=t.position,u=!1),b(f)||(o=t.position+1),f=t.input.charCodeAt(++t.position)}return Y(t,i,o,!1),!!t.result||(t.kind=l,t.result=h,!1)}(t,_,c===n)&&(T=!0,null===t.tag&&(t.tag="?")):(T=!0,null===t.tag&&null===t.anchor||O(t,"alias node should not have any properties")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===S&&(T=w&&G(t,m))),null!==t.tag&&"!"!==t.tag)if("?"===t.tag){for(v=0,g=t.implicitTypes.length;v<g;v+=1)if((M=t.implicitTypes[v]).resolve(t.result)){t.result=M.construct(t.result),t.tag=M.tag,null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);break}}else a.call(t.typeMap[t.kind||"fallback"],t.tag)?(M=t.typeMap[t.kind||"fallback"][t.tag],null!==t.result&&M.kind!==t.kind&&O(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+M.kind+'", not "'+t.kind+'"'),M.resolve(t.result)?(t.result=M.construct(t.result),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):O(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")):O(t,"unknown tag !<"+t.tag+">");return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||T}function Z(t){var e,n,r,i,o=t.position,u=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap={},t.anchorMap={};0!==(i=t.input.charCodeAt(t.position))&&(Q(t,!0,-1),i=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==i));){for(u=!0,i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!j(i);)i=t.input.charCodeAt(++t.position);for(r=[],(n=t.input.slice(e,t.position)).length<1&&O(t,"directive name must not be less than one character in length");0!==i;){for(;b(i);)i=t.input.charCodeAt(++t.position);if(35===i){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&!L(i));break}if(L(i))break;for(e=t.position;0!==i&&!j(i);)i=t.input.charCodeAt(++t.position);r.push(t.input.slice(e,t.position))}0!==i&&R(t),a.call(k,n)?k[n](t,n,r):z(t,'unknown document directive "'+n+'"')}Q(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,Q(t,!0,-1)):u&&O(t,"directives end mark is expected"),J(t,t.lineIndent-1,h,!1,!0),Q(t,!0,-1),t.checkLineBreaks&&v.test(t.input.slice(o,t.position))&&z(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&F(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,Q(t,!0,-1)):t.position<t.length-1&&O(t,"end of the stream or a document separator is expected")}function V(t,e){e=e||{},0!==(t=String(t)).length&&(10!==t.charCodeAt(t.length-1)&&13!==t.charCodeAt(t.length-1)&&(t+="\n"),65279===t.charCodeAt(0)&&(t=t.slice(1)));var n=new T(t,e);for(n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Z(n);return n.documents}function X(t,e,n){var r,i,o=V(t,n);if("function"!=typeof e)return o;for(r=0,i=o.length;r<i;r+=1)e(o[r])}function H(t,e){var n=V(t,e);if(0!==n.length){if(1===n.length)return n[0];throw new i("expected a single document in the stream, but found more")}}t.exports.loadAll=X,t.exports.load=H,t.exports.safeLoadAll=function(t,e,n){if("function"!=typeof e)return X(t,r.extend({schema:u},n));X(t,e,r.extend({schema:u},n))},t.exports.safeLoad=function(t,e){return H(t,r.extend({schema:u},e))}},function(t,e,n){"use strict";var r=n(36);function i(t,e,n,r,i){this.name=t,this.buffer=e,this.position=n,this.line=r,this.column=i}i.prototype.getSnippet=function(t,e){var n,i,o,u,s;if(!this.buffer)return null;for(t=t||4,e=e||75,n="",i=this.position;i>0&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(i-1));)if(i-=1,this.position-i>e/2-1){n=" ... ",i+=5;break}for(o="",u=this.position;u<this.buffer.length&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(u));)if((u+=1)-this.position>e/2-1){o=" ... ",u-=5;break}return s=this.buffer.slice(i,u),r.repeat(" ",t)+n+s+o+"\n"+r.repeat(" ",t+this.position-i+n.length)+"^"},i.prototype.toString=function(t){var e,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),t||(e=this.getSnippet())&&(n+=":\n"+e),n},t.exports=i},function(t,e,n){"use strict";var r=n(3);t.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return null!==t?t:""}})},function(t,e,n){"use strict";var r=n(3);t.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return null!==t?t:[]}})},function(t,e,n){"use strict";var r=n(3);t.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return null!==t?t:{}}})},function(t,e,n){"use strict";var r=n(3);t.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(t){if(null===t)return!0;var e=t.length;return 1===e&&"~"===t||4===e&&("null"===t||"Null"===t||"NULL"===t)},construct:function(){return null},predicate:function(t){return null===t},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},function(t,e,n){"use strict";var r=n(3);t.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e=t.length;return 4===e&&("true"===t||"True"===t||"TRUE"===t)||5===e&&("false"===t||"False"===t||"FALSE"===t)},construct:function(t){return"true"===t||"True"===t||"TRUE"===t},predicate:function(t){return"[object Boolean]"===Object.prototype.toString.call(t)},represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"})},function(t,e,n){"use strict";var r=n(36),i=n(3);function o(t){return 48<=t&&t<=55}function u(t){return 48<=t&&t<=57}t.exports=new i("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,r=t.length,i=0,s=!1;if(!r)return!1;if("-"!==(e=t[i])&&"+"!==e||(e=t[++i]),"0"===e){if(i+1===r)return!0;if("b"===(e=t[++i])){for(i++;i<r;i++)if("_"!==(e=t[i])){if("0"!==e&&"1"!==e)return!1;s=!0}return s&&"_"!==e}if("x"===e){for(i++;i<r;i++)if("_"!==(e=t[i])){if(!(48<=(n=t.charCodeAt(i))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;s=!0}return s&&"_"!==e}for(;i<r;i++)if("_"!==(e=t[i])){if(!o(t.charCodeAt(i)))return!1;s=!0}return s&&"_"!==e}if("_"===e)return!1;for(;i<r;i++)if("_"!==(e=t[i])){if(":"===e)break;if(!u(t.charCodeAt(i)))return!1;s=!0}return!(!s||"_"===e)&&(":"!==e||/^(:[0-5]?[0-9])+$/.test(t.slice(i)))},construct:function(t){var e,n,r=t,i=1,o=[];return-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),"-"!==(e=r[0])&&"+"!==e||("-"===e&&(i=-1),e=(r=r.slice(1))[0]),"0"===r?0:"0"===e?"b"===r[1]?i*parseInt(r.slice(2),2):"x"===r[1]?i*parseInt(r,16):i*parseInt(r,8):-1!==r.indexOf(":")?(r.split(":").forEach(function(t){o.unshift(parseInt(t,10))}),r=0,n=1,o.forEach(function(t){r+=t*n,n*=60}),i*r):i*parseInt(r,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&t%1==0&&!r.isNegativeZero(t)},represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0"+t.toString(8):"-0"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},function(t,e,n){"use strict";var r=n(36),i=n(3),o=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var u=/^[-+]?[0-9]+e/;t.exports=new i("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!o.test(t)||"_"===t[t.length-1])},construct:function(t){var e,n,r,i;return n="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,i=[],"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:e.indexOf(":")>=0?(e.split(":").forEach(function(t){i.unshift(parseFloat(t,10))}),e=0,r=1,i.forEach(function(t){e+=t*r,r*=60}),n*e):n*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||r.isNegativeZero(t))},represent:function(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(t))return"-0.0";return n=t.toString(10),u.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},function(t,e,n){"use strict";var r=n(3),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");t.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(t){return null!==t&&(null!==i.exec(t)||null!==o.exec(t))},construct:function(t){var e,n,r,u,s,a,c,f,l=0,h=null;if(null===(e=i.exec(t))&&(e=o.exec(t)),null===e)throw new Error("Date resolve error");if(n=+e[1],r=+e[2]-1,u=+e[3],!e[4])return new Date(Date.UTC(n,r,u));if(s=+e[4],a=+e[5],c=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(h=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(h=-h)),f=new Date(Date.UTC(n,r,u,s,a,c,l)),h&&f.setTime(f.getTime()-h),f},instanceOf:Date,represent:function(t){return t.toISOString()}})},function(t,e,n){"use strict";var r=n(3);t.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}})},function(t,e,n){"use strict";var r;try{r=n(57).Buffer}catch(t){}var i=n(3),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new i("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,r=0,i=t.length,u=o;for(n=0;n<i;n++)if(!((e=u.indexOf(t.charAt(n)))>64)){if(e<0)return!1;r+=6}return r%8==0},construct:function(t){var e,n,i=t.replace(/[\r\n=]/g,""),u=i.length,s=o,a=0,c=[];for(e=0;e<u;e++)e%4==0&&e&&(c.push(a>>16&255),c.push(a>>8&255),c.push(255&a)),a=a<<6|s.indexOf(i.charAt(e));return 0===(n=u%4*6)?(c.push(a>>16&255),c.push(a>>8&255),c.push(255&a)):18===n?(c.push(a>>10&255),c.push(a>>2&255)):12===n&&c.push(a>>4&255),r?r.from?r.from(c):new r(c):c},predicate:function(t){return r&&r.isBuffer(t)},represent:function(t){var e,n,r="",i=0,u=t.length,s=o;for(e=0;e<u;e++)e%3==0&&e&&(r+=s[i>>18&63],r+=s[i>>12&63],r+=s[i>>6&63],r+=s[63&i]),i=(i<<8)+t[e];return 0===(n=u%3)?(r+=s[i>>18&63],r+=s[i>>12&63],r+=s[i>>6&63],r+=s[63&i]):2===n?(r+=s[i>>10&63],r+=s[i>>4&63],r+=s[i<<2&63],r+=s[64]):1===n&&(r+=s[i>>2&63],r+=s[i<<4&63],r+=s[64],r+=s[64]),r}})},function(t,e,n){"use strict";var r=n(3),i=Object.prototype.hasOwnProperty,o=Object.prototype.toString;t.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,n,r,u,s,a=[],c=t;for(e=0,n=c.length;e<n;e+=1){if(r=c[e],s=!1,"[object Object]"!==o.call(r))return!1;for(u in r)if(i.call(r,u)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==a.indexOf(u))return!1;a.push(u)}return!0},construct:function(t){return null!==t?t:[]}})},function(t,e,n){"use strict";var r=n(3),i=Object.prototype.toString;t.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,n,r,o,u,s=t;for(u=new Array(s.length),e=0,n=s.length;e<n;e+=1){if(r=s[e],"[object Object]"!==i.call(r))return!1;if(1!==(o=Object.keys(r)).length)return!1;u[e]=[o[0],r[o[0]]]}return!0},construct:function(t){if(null===t)return[];var e,n,r,i,o,u=t;for(o=new Array(u.length),e=0,n=u.length;e<n;e+=1)r=u[e],i=Object.keys(r),o[e]=[i[0],r[i[0]]];return o}})},function(t,e,n){"use strict";var r=n(3),i=Object.prototype.hasOwnProperty;t.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(t){if(null===t)return!0;var e,n=t;for(e in n)if(i.call(n,e)&&null!==n[e])return!1;return!0},construct:function(t){return null!==t?t:{}}})},function(t,e,n){"use strict";var r=n(3);t.exports=new r("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(t){return void 0===t},represent:function(){return""}})},function(t,e,n){"use strict";var r=n(3);t.exports=new r("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(t){if(null===t)return!1;if(0===t.length)return!1;var e=t,n=/\/([gim]*)$/.exec(t),r="";if("/"===e[0]){if(n&&(r=n[1]),r.length>3)return!1;if("/"!==e[e.length-r.length-1])return!1}return!0},construct:function(t){var e=t,n=/\/([gim]*)$/.exec(t),r="";return"/"===e[0]&&(n&&(r=n[1]),e=e.slice(1,e.length-r.length-1)),new RegExp(e,r)},predicate:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},represent:function(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}})},function(t,e,n){"use strict";var r;try{r=n(447)}catch(t){"undefined"!=typeof window&&(r=window.esprima)}var i=n(3);t.exports=new i("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(t){if(null===t)return!1;try{var e="("+t+")",n=r.parse(e,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&("ArrowFunctionExpression"===n.body[0].expression.type||"FunctionExpression"===n.body[0].expression.type)}catch(t){return!1}},construct:function(t){var e,n="("+t+")",i=r.parse(n,{range:!0}),o=[];if("Program"!==i.type||1!==i.body.length||"ExpressionStatement"!==i.body[0].type||"ArrowFunctionExpression"!==i.body[0].expression.type&&"FunctionExpression"!==i.body[0].expression.type)throw new Error("Failed to resolve function");return i.body[0].expression.params.forEach(function(t){o.push(t.name)}),e=i.body[0].expression.body.range,"BlockStatement"===i.body[0].expression.body.type?new Function(o,n.slice(e[0]+1,e[1]-1)):new Function(o,"return "+n.slice(e[0],e[1]))},predicate:function(t){return"[object Function]"===Object.prototype.toString.call(t)},represent:function(t){return t.toString()}})},function(e,n){if(void 0===t){var r=new Error("Cannot find module 'esprima'");throw r.code="MODULE_NOT_FOUND",r}e.exports=t},function(t,e,n){"use strict";var r=n(36),i=n(47),o=n(70),u=n(48),s=Object.prototype.toString,a=Object.prototype.hasOwnProperty,c=9,f=10,l=32,h=33,p=34,d=35,y=37,w=38,v=39,g=42,M=44,_=45,m=58,L=62,b=63,j=64,x=91,N=93,S=96,D=123,I=124,E=125,C={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},T=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function A(t){var e,n,o;if(e=t.toString(16).toUpperCase(),t<=255)n="x",o=2;else if(t<=65535)n="u",o=4;else{if(!(t<=4294967295))throw new i("code point within a string may not be greater than 0xFFFFFFFF");n="U",o=8}return"\\"+n+r.repeat("0",o-e.length)+e}function O(t){this.schema=t.schema||o,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=r.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=function(t,e){var n,r,i,o,u,s,c;if(null===e)return{};for(n={},i=0,o=(r=Object.keys(e)).length;i<o;i+=1)u=r[i],s=String(e[u]),"!!"===u.slice(0,2)&&(u="tag:yaml.org,2002:"+u.slice(2)),(c=t.compiledTypeMap.fallback[u])&&a.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[u]=s;return n}(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function z(t,e){for(var n,i=r.repeat(" ",e),o=0,u=-1,s="",a=t.length;o<a;)-1===(u=t.indexOf("\n",o))?(n=t.slice(o),o=a):(n=t.slice(o,u+1),o=u+1),n.length&&"\n"!==n&&(s+=i),s+=n;return s}function k(t,e){return"\n"+r.repeat(" ",t.indent*e)}function Y(t){return t===l||t===c}function U(t){return 32<=t&&t<=126||161<=t&&t<=55295&&8232!==t&&8233!==t||57344<=t&&t<=65533&&65279!==t||65536<=t&&t<=1114111}function P(t){return U(t)&&65279!==t&&t!==M&&t!==x&&t!==N&&t!==D&&t!==E&&t!==m&&t!==d}function R(t){return/^\n* /.test(t)}var Q=1,F=2,B=3,G=4,W=5;function q(t,e,n,r,i){var o,u,s,a=!1,c=!1,l=-1!==r,C=-1,T=U(s=t.charCodeAt(0))&&65279!==s&&!Y(s)&&s!==_&&s!==b&&s!==m&&s!==M&&s!==x&&s!==N&&s!==D&&s!==E&&s!==d&&s!==w&&s!==g&&s!==h&&s!==I&&s!==L&&s!==v&&s!==p&&s!==y&&s!==j&&s!==S&&!Y(t.charCodeAt(t.length-1));if(e)for(o=0;o<t.length;o++){if(!U(u=t.charCodeAt(o)))return W;T=T&&P(u)}else{for(o=0;o<t.length;o++){if((u=t.charCodeAt(o))===f)a=!0,l&&(c=c||o-C-1>r&&" "!==t[C+1],C=o);else if(!U(u))return W;T=T&&P(u)}c=c||l&&o-C-1>r&&" "!==t[C+1]}return a||c?n>9&&R(t)?W:c?G:B:T&&!i(t)?Q:F}function J(t,e,n,r){t.dump=function(){if(0===e.length)return"''";if(!t.noCompatMode&&-1!==T.indexOf(e))return"'"+e+"'";var o=t.indent*Math.max(1,n),u=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),s=r||t.flowLevel>-1&&n>=t.flowLevel;switch(q(e,s,t.indent,u,function(e){return function(t,e){var n,r;for(n=0,r=t.implicitTypes.length;n<r;n+=1)if(t.implicitTypes[n].resolve(e))return!0;return!1}(t,e)})){case Q:return e;case F:return"'"+e.replace(/'/g,"''")+"'";case B:return"|"+Z(e,t.indent)+V(z(e,o));case G:return">"+Z(e,t.indent)+V(z(function(t,e){var n,r,i=/(\n+)([^\n]*)/g,o=(s=t.indexOf("\n"),s=-1!==s?s:t.length,i.lastIndex=s,X(t.slice(0,s),e)),u="\n"===t[0]||" "===t[0];var s;for(;r=i.exec(t);){var a=r[1],c=r[2];n=" "===c[0],o+=a+(u||n||""===c?"":"\n")+X(c,e),u=n}return o}(e,u),o));case W:return'"'+function(t){for(var e,n,r,i="",o=0;o<t.length;o++)(e=t.charCodeAt(o))>=55296&&e<=56319&&(n=t.charCodeAt(o+1))>=56320&&n<=57343?(i+=A(1024*(e-55296)+n-56320+65536),o++):(r=C[e],i+=!r&&U(e)?t[o]:r||A(e));return i}(e)+'"';default:throw new i("impossible error: invalid scalar style")}}()}function Z(t,e){var n=R(t)?String(e):"",r="\n"===t[t.length-1];return n+(r&&("\n"===t[t.length-2]||"\n"===t)?"+":r?"":"-")+"\n"}function V(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function X(t,e){if(""===t||" "===t[0])return t;for(var n,r,i=/ [^ ]/g,o=0,u=0,s=0,a="";n=i.exec(t);)(s=n.index)-o>e&&(r=u>o?u:s,a+="\n"+t.slice(o,r),o=r+1),u=s;return a+="\n",t.length-o>e&&u>o?a+=t.slice(o,u)+"\n"+t.slice(u+1):a+=t.slice(o),a.slice(1)}function H(t,e,n){var r,o,u,c,f,l;for(u=0,c=(o=n?t.explicitTypes:t.implicitTypes).length;u<c;u+=1)if(((f=o[u]).instanceOf||f.predicate)&&(!f.instanceOf||"object"==typeof e&&e instanceof f.instanceOf)&&(!f.predicate||f.predicate(e))){if(t.tag=n?f.tag:"?",f.represent){if(l=t.styleMap[f.tag]||f.defaultStyle,"[object Function]"===s.call(f.represent))r=f.represent(e,l);else{if(!a.call(f.represent,l))throw new i("!<"+f.tag+'> tag resolver accepts not "'+l+'" style');r=f.represent[l](e,l)}t.dump=r}return!0}return!1}function K(t,e,n,r,o,u){t.tag=null,t.dump=n,H(t,n,!1)||H(t,n,!0);var a=s.call(t.dump);r&&(r=t.flowLevel<0||t.flowLevel>e);var c,l,h="[object Object]"===a||"[object Array]"===a;if(h&&(l=-1!==(c=t.duplicates.indexOf(n))),(null!==t.tag&&"?"!==t.tag||l||2!==t.indent&&e>0)&&(o=!1),l&&t.usedDuplicates[c])t.dump="*ref_"+c;else{if(h&&l&&!t.usedDuplicates[c]&&(t.usedDuplicates[c]=!0),"[object Object]"===a)r&&0!==Object.keys(t.dump).length?(!function(t,e,n,r){var o,u,s,a,c,l,h="",p=t.tag,d=Object.keys(n);if(!0===t.sortKeys)d.sort();else if("function"==typeof t.sortKeys)d.sort(t.sortKeys);else if(t.sortKeys)throw new i("sortKeys must be a boolean or a function");for(o=0,u=d.length;o<u;o+=1)l="",r&&0===o||(l+=k(t,e)),a=n[s=d[o]],K(t,e+1,s,!0,!0,!0)&&((c=null!==t.tag&&"?"!==t.tag||t.dump&&t.dump.length>1024)&&(t.dump&&f===t.dump.charCodeAt(0)?l+="?":l+="? "),l+=t.dump,c&&(l+=k(t,e)),K(t,e+1,a,!0,c)&&(t.dump&&f===t.dump.charCodeAt(0)?l+=":":l+=": ",h+=l+=t.dump));t.tag=p,t.dump=h||"{}"}(t,e,t.dump,o),l&&(t.dump="&ref_"+c+t.dump)):(!function(t,e,n){var r,i,o,u,s,a="",c=t.tag,f=Object.keys(n);for(r=0,i=f.length;r<i;r+=1)s=t.condenseFlow?'"':"",0!==r&&(s+=", "),u=n[o=f[r]],K(t,e,o,!1,!1)&&(t.dump.length>1024&&(s+="? "),s+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),K(t,e,u,!1,!1)&&(a+=s+=t.dump));t.tag=c,t.dump="{"+a+"}"}(t,e,t.dump),l&&(t.dump="&ref_"+c+" "+t.dump));else if("[object Array]"===a){var p=t.noArrayIndent&&e>0?e-1:e;r&&0!==t.dump.length?(!function(t,e,n,r){var i,o,u="",s=t.tag;for(i=0,o=n.length;i<o;i+=1)K(t,e+1,n[i],!0,!0)&&(r&&0===i||(u+=k(t,e)),t.dump&&f===t.dump.charCodeAt(0)?u+="-":u+="- ",u+=t.dump);t.tag=s,t.dump=u||"[]"}(t,p,t.dump,o),l&&(t.dump="&ref_"+c+t.dump)):(!function(t,e,n){var r,i,o="",u=t.tag;for(r=0,i=n.length;r<i;r+=1)K(t,e,n[r],!1,!1)&&(0!==r&&(o+=","+(t.condenseFlow?"":" ")),o+=t.dump);t.tag=u,t.dump="["+o+"]"}(t,p,t.dump),l&&(t.dump="&ref_"+c+" "+t.dump))}else{if("[object String]"!==a){if(t.skipInvalid)return!1;throw new i("unacceptable kind of an object to dump "+a)}"?"!==t.tag&&J(t,t.dump,e,u)}null!==t.tag&&"?"!==t.tag&&(t.dump="!<"+t.tag+"> "+t.dump)}return!0}function $(t,e){var n,r,i=[],o=[];for(function t(e,n,r){var i,o,u;if(null!==e&&"object"==typeof e)if(-1!==(o=n.indexOf(e)))-1===r.indexOf(o)&&r.push(o);else if(n.push(e),Array.isArray(e))for(o=0,u=e.length;o<u;o+=1)t(e[o],n,r);else for(i=Object.keys(e),o=0,u=i.length;o<u;o+=1)t(e[i[o]],n,r)}(t,i,o),n=0,r=o.length;n<r;n+=1)e.duplicates.push(i[o[n]]);e.usedDuplicates=new Array(r)}function tt(t,e){var n=new O(e=e||{});return n.noRefs||$(t,n),K(n,0,t,!0,!0)?n.dump+"\n":""}t.exports.dump=tt,t.exports.safeDump=function(t,e){return tt(t,r.extend({schema:u},e))}},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"UPDATE_CONFIGS",function(){return E}),n.d(r,"TOGGLE_CONFIGS",function(){return C}),n.d(r,"update",function(){return T}),n.d(r,"toggle",function(){return A}),n.d(r,"loaded",function(){return z});var i={};n.r(i),n.d(i,"downloadConfig",function(){return k}),n.d(i,"getConfigByUrl",function(){return Y});var o={};n.r(o),n.d(o,"get",function(){return R});var u=n(71),s=n.n(u),a=n(72),c=n.n(a),f=n(73),l=n.n(f),h=n(74),p=n.n(h),d=n(75),y=n.n(d),w=n(1),v=n.n(w),g=(n(134),function(t){function e(){return s()(this,e),l()(this,p()(e).apply(this,arguments))}return y()(e,t),c()(e,[{key:"render",value:function(){var t=this.props.getComponent,e=t("Container"),n=t("Row"),r=t("Col"),i=t("Topbar",!0),o=t("BaseLayout",!0),u=t("onlineValidatorBadge",!0);return v.a.createElement(e,{className:"swagger-ui"},i?v.a.createElement(i,null):null,v.a.createElement(o,null),v.a.createElement(n,null,v.a.createElement(r,null,v.a.createElement(u,null))))}}]),e}(v.a.Component)),M=n(13),_=n.n(M),m=n(5),L=n.n(m),b=n(170),j=n.n(b),x=n(6),N=function(t){function e(t,n){var r;return s()(this,e),r=l()(this,p()(e).call(this,t,n)),L()(_()(r),"onUrlChange",function(t){var e=t.target.value;r.setState({url:e})}),L()(_()(r),"loadSpec",function(t){r.props.specActions.updateUrl(t),r.props.specActions.download(t)}),L()(_()(r),"onUrlSelect",function(t){var e=t.target.value||t.target.href;r.loadSpec(e),r.setSelectedUrl(e),t.preventDefault()}),L()(_()(r),"downloadUrl",function(t){r.loadSpec(r.state.url),t.preventDefault()}),L()(_()(r),"setSearch",function(t){var e=Object(x.e)();e["urls.primaryName"]=t.name;var n="".concat(window.location.protocol,"//").concat(window.location.host).concat(window.location.pathname);window&&window.history&&window.history.pushState&&window.history.replaceState(null,"","".concat(n,"?").concat(Object(x.f)(e)))}),L()(_()(r),"setSelectedUrl",function(t){var e=r.props.getConfigs().urls||[];e&&e.length&&t&&e.forEach(function(e,n){e.url===t&&(r.setState({selectedIndex:n}),r.setSearch(e))})}),L()(_()(r),"onFilterChange",function(t){var e=t.target.value;r.props.layoutActions.updateFilter(e)}),r.state={url:t.specSelectors.url(),selectedIndex:0},r}return y()(e,t),c()(e,[{key:"componentWillReceiveProps",value:function(t){this.setState({url:t.specSelectors.url()})}},{key:"componentDidMount",value:function(){var t=this,e=this.props.getConfigs(),n=e.urls||[];if(n&&n.length){var r=this.state.selectedIndex,i=e["urls.primaryName"];i&&n.forEach(function(e,n){e.name===i&&(t.setState({selectedIndex:n}),r=n)}),this.loadSpec(n[r].url)}}},{key:"render",value:function(){var t=this.props,e=t.getComponent,n=t.specSelectors,r=t.getConfigs,i=e("Button"),o=e("Link"),u="loading"===n.loadingStatus(),s={};"failed"===n.loadingStatus()&&(s.color="red"),u&&(s.color="#aaa");var a=r().urls,c=[],f=null;if(a){var l=[];a.forEach(function(t,e){l.push(v.a.createElement("option",{key:e,value:t.url},t.name))}),c.push(v.a.createElement("label",{className:"select-label",htmlFor:"select"},v.a.createElement("span",null,"Select a definition"),v.a.createElement("select",{id:"select",disabled:u,onChange:this.onUrlSelect,value:a[this.state.selectedIndex].url},l)))}else f=this.downloadUrl,c.push(v.a.createElement("input",{className:"download-url-input",type:"text",onChange:this.onUrlChange,value:this.state.url,disabled:u,style:s})),c.push(v.a.createElement(i,{className:"download-url-button",onClick:this.downloadUrl},"Explore"));return v.a.createElement("div",{className:"topbar"},v.a.createElement("div",{className:"wrapper"},v.a.createElement("div",{className:"topbar-wrapper"},v.a.createElement(o,null,v.a.createElement("img",{height:"40",src:j.a,alt:"Swagger UI"})),v.a.createElement("form",{className:"download-url-wrapper",onSubmit:f},c.map(function(t,e){return Object(w.cloneElement)(t,{key:e})})))))}}]),e}(v.a.Component),S=n(182),D=n.n(S),I=function(t,e){try{return D.a.safeLoad(t)}catch(t){return e&&e.errActions.newThrownErr(new Error(t)),{}}},E="configs_update",C="configs_toggle";function T(t,e){return{type:E,payload:L()({},t,e)}}function A(t){return{type:C,payload:t}}var O,z=function(){return function(){}},k=function(t){return function(e){return(0,e.fn.fetch)(t)}},Y=function(t,e){return function(n){var r=n.specActions;if(t)return r.downloadConfig(t).then(i,i);function i(n){n instanceof Error||n.status>=400?(r.updateLoadingStatus("failedConfig"),r.updateLoadingStatus("failedConfig"),r.updateUrl(""),console.error(n.statusText+" "+t.url),e(null)):e(I(n.text))}}},U=n(2),P=n.n(U),R=function(t,e){return t.getIn(P()(e)?e:[e])},Q=n(0),F=(O={},L()(O,E,function(t,e){return t.merge(Object(Q.fromJS)(e.payload))}),L()(O,C,function(t,e){var n=e.payload,r=t.get(n);return t.set(n,!r)}),O),B={getLocalConfig:function(){return I('---\nurl: "https://petstore.swagger.io/v2/swagger.json"\ndom_id: "#swagger-ui"\nvalidatorUrl: "https://validator.swagger.io/validator"\n')}};e.default=[function(){return{components:{Topbar:N}}},function(){return{statePlugins:{spec:{actions:i,selectors:B},configs:{reducers:F,actions:r,selectors:o}}}},function(){return{components:{StandaloneLayout:g}}}]}]).default}); +//# sourceMappingURL=swagger-ui-standalone-preset.js.map \ No newline at end of file diff --git a/app/code/Magento/Swatches/Controller/Ajax/Media.php b/app/code/Magento/Swatches/Controller/Ajax/Media.php index 2d20b9a9a4b7..93ee106139dc 100644 --- a/app/code/Magento/Swatches/Controller/Ajax/Media.php +++ b/app/code/Magento/Swatches/Controller/Ajax/Media.php @@ -6,13 +6,19 @@ */ namespace Magento\Swatches\Controller\Ajax; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\ProductFactory; +use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; +use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Framework\Controller\ResultFactory; +use Magento\PageCache\Model\Config; +use Magento\Swatches\Helper\Data; /** - * Class Media + * Provide product media data. */ -class Media extends \Magento\Framework\App\Action\Action implements \Magento\Framework\App\Action\HttpGetActionInterface +class Media extends Action implements HttpGetActionInterface { /** * @var \Magento\Catalog\Model\Product Factory @@ -37,9 +43,9 @@ class Media extends \Magento\Framework\App\Action\Action implements \Magento\Fra */ public function __construct( Context $context, - \Magento\Catalog\Model\ProductFactory $productModelFactory, - \Magento\Swatches\Helper\Data $swatchHelper, - \Magento\PageCache\Model\Config $config + ProductFactory $productModelFactory, + Data $swatchHelper, + Config $config ) { $this->productModelFactory = $productModelFactory; $this->swatchHelper = $swatchHelper; @@ -65,16 +71,18 @@ public function execute() $response = $this->getResponse(); if ($productId = (int)$this->getRequest()->getParam('product_id')) { + /** @var \Magento\Catalog\Api\Data\ProductInterface $product */ $product = $this->productModelFactory->create()->load($productId); - $productMedia = $this->swatchHelper->getProductMediaGallery( - $product - ); + $productMedia = []; + if ($product->getId() && $product->getStatus() == Status::STATUS_ENABLED) { + $productMedia = $this->swatchHelper->getProductMediaGallery($product); + } $resultJson->setHeader('X-Magento-Tags', implode(',', $product->getIdentities())); $response->setPublicHeaders($this->config->getTtl()); } - $resultJson->setData($productMedia); + return $resultJson; } } diff --git a/app/code/Magento/Swatches/Helper/Media.php b/app/code/Magento/Swatches/Helper/Media.php index 6787fba53489..2ea81f29e3a9 100644 --- a/app/code/Magento/Swatches/Helper/Media.php +++ b/app/code/Magento/Swatches/Helper/Media.php @@ -176,7 +176,9 @@ public function moveImageFromTmp($file) } else { $this->mediaDirectory->renameFile( $this->mediaConfig->getTmpMediaPath($file), - $this->getAttributeSwatchPath($destinationFile) + $this->mediaDirectory->getDriver()->getRealPathSafety( + $this->getAttributeSwatchPath($destinationFile) + ) ); } @@ -197,7 +199,7 @@ protected function getUniqueFileName($file) $file ); } else { - $destFile = rtrim(dirname($file), '/.') . '/' . \Magento\MediaStorage\Model\File\Uploader::getNewFileName( + $destFile = dirname($file) . '/' . \Magento\MediaStorage\Model\File\Uploader::getNewFileName( $this->getOriginalFilePath($file) ); } diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml index 7647d3ec87a0..5b8691e55b3a 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml @@ -43,9 +43,7 @@ <!-- Enable swatch tooltips --> <magentoCLI command="config:set catalog/frontend/show_swatch_tooltip 1" stepKey="disableTooltips"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterEnabling"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterEnabling"/> </after> <!-- Go to the edit page for the "color" attribute --> @@ -150,7 +148,7 @@ <!-- Disable swatch tooltips --> <magentoCLI command="config:set catalog/frontend/show_swatch_tooltip 0" stepKey="disableTooltips"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterDisabling"> - <argument name="tags" value=""/> + <argument name="tags" value="config full_page"/> </actionGroup> <!-- Verify swatch tooltips are not visible --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest/StorefrontConfigurableProductSwatchMinimumPriceCategoryPageTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest/StorefrontConfigurableProductSwatchMinimumPriceCategoryPageTest.xml index 576faed573fa..e5f9b70f1af6 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest/StorefrontConfigurableProductSwatchMinimumPriceCategoryPageTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest/StorefrontConfigurableProductSwatchMinimumPriceCategoryPageTest.xml @@ -19,7 +19,7 @@ </annotations> <!--Go to category page--> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="amOnConfigurableProductPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="amOnConfigurableProductPage"/> <waitForPageLoad stepKey="waitForConfigurableProductPage"/> <!--Verify that the minimum price is 10--> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontDisplayAllCharactersOnTextSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontDisplayAllCharactersOnTextSwatchTest.xml index b661ecb338bd..baa2bcb14759 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontDisplayAllCharactersOnTextSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontDisplayAllCharactersOnTextSwatchTest.xml @@ -29,16 +29,13 @@ <fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('3')}}" userInput="123456789012345678901" stepKey="fillSwatch3" after="clickAddSwatch3"/> <fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('3')}}" userInput="123456789012345678901BrownD" stepKey="fillDescription3" after="fillSwatch3"/> - <!--Run re-index task--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <see selector="{{StorefrontCategorySidebarSection.attributeNthOption(ProductAttributeFrontendLabel.label, '3')}}" userInput="123456789012345678901" stepKey="seeGreen" after="seeBlue"/> <see selector="{{StorefrontCategorySidebarSection.attributeNthOption(ProductAttributeFrontendLabel.label, '4')}}" userInput="123456789012345678901" stepKey="seeBrown" after="seeGreen"/> <!-- Go to the category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage2"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage2"/> <waitForPageLoad stepKey="waitForCategoryPage2"/> <!-- Verify swatch2 is present and shown in full display text characters on storefront in the layered navigation --> @@ -47,7 +44,7 @@ <click selector="{{StorefrontCategorySidebarSection.attributeNthOption(ProductAttributeFrontendLabel.label, '2')}}" stepKey="filterBySwatch2"/> <!-- Go to the category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage3"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage3"/> <waitForPageLoad stepKey="waitForCategoryPage3"/> <!-- Verify swatch3 is present and shown in full display text characters on storefront in the layered navigation --> @@ -56,7 +53,7 @@ <click selector="{{StorefrontCategorySidebarSection.attributeNthOption(ProductAttributeFrontendLabel.label, '3')}}" stepKey="filterBySwatch3"/> <!-- Go to the category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage4"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage4"/> <waitForPageLoad stepKey="waitForCategoryPage4"/> <!-- Verify swatch4 is present and shown in full display text characters on storefront in the layered navigation --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml index 4ed8824d9e39..201cd7d59104 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml @@ -103,13 +103,10 @@ <argument name="image" value="TestImageAdobe"/> </actionGroup> - <!-- Run re-index task--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!-- Go to the category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPage"/> <!-- Verify swatches are present in the layered navigation --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml index 4a78b4380fb6..0d28be1b9463 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml @@ -80,13 +80,10 @@ <argument name="attributeCode" value="{{ProductAttributeFrontendLabel.label}}"/> </actionGroup> - <!--Run re-index task--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!-- Go to the category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPage"/> <!-- Verify swatches are present in the layered navigation --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml index 2a986463a3d1..262d9fd7c4c4 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml @@ -92,13 +92,10 @@ <argument name="attributeCode" value="{{ProductAttributeFrontendLabel.label}}"/> </actionGroup> - <!-- Run re-index task--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!-- Go to the category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPage"/> <!-- Verify swatches are present in the layered navigation --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml index 734294ba977b..66b98a266033 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml @@ -70,16 +70,11 @@ <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnGenerateProductsButton"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Select any option in the Layered navigation and verify product image--> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage"/> <actionGroup ref="SelectStorefrontSideBarAttributeOption" stepKey="selectStorefrontProductAttributeOption"> <argument name="categoryName" value="$$createCategory.name$$"/> <argument name="attributeDefaultLabel" value="{{visualSwatchAttribute.default_label}}"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributeDisplayedInWidgetCMSTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributeDisplayedInWidgetCMSTest.xml new file mode 100644 index 000000000000..897f7352a504 --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributeDisplayedInWidgetCMSTest.xml @@ -0,0 +1,118 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontSwatchAttributeDisplayedInWidgetCMSTest"> + <annotations> + <features value="Swatches"/> + <stories value="Swatches in CMS Widget"/> + <title value="Swatch Attribute is displayed in the Widget CMS"/> + <description value="Swatch Attribute is displayed in the Widget CMS"/> + <severity value="MAJOR"/> + <testCaseId value="MC-28607"/> + <group value="configurableProduct"/> + <group value="cms"/> + <group value="widget"/> + <group value="swatch"/> + <group value="WYSIWYGDisabled"/> + </annotations> + <before> + <!-- Create Configurable product --> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="ApiConfigurableProduct" stepKey="createConfigurableProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <!-- Create product swatch attribute with 1 variations --> + <createData entity="VisualSwatchProductAttributeForm" stepKey="createVisualSwatchAttribute"/> + <createData entity="SwatchProductAttributeOption1" stepKey="swatchAttributeOption"> + <requiredEntity createDataKey="createVisualSwatchAttribute"/> + </createData> + + <!-- Create CMS Page --> + <createData entity="_defaultCmsPage" stepKey="createCmsPage"/> + + <!-- Login to Admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + + <!-- Open configurable product edit page --> + <amOnPage url="{{AdminProductEditPage.url($createConfigurableProduct.id$)}}" stepKey="goToConfigurableProduct"/> + + <!-- Add attributes to configurable product--> + <conditionalClick selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" dependentSelector="{{AdminProductFormConfigurationsSection.createConfigurations}}" visible="false" stepKey="openConfigurationSection"/> + <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="openConfigurationPanel"/> + + <!-- Find Swatch attribute in grid and select it --> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearAttributeGridFiltersToFindSwatchAttribute"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openFiltersPaneForSwatchAttribute"/> + <fillField selector="{{AdminDataGridHeaderSection.attributeCodeFilterInput}}" userInput="$createVisualSwatchAttribute.attribute_code$" stepKey="fillAttributeCodeFilterFieldForSwatchAttribute"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFiltersButtonForSwatchAttribute"/> + <click selector="{{AdminDataGridTableSection.rowCheckbox('1')}}" stepKey="selectSwatchAttribute"/> + + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextToSelectOptions"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute($createVisualSwatchAttribute.frontend_label[0]$)}}" stepKey="selectAllSwatchAttributeOptions"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextToApplyQuantity"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="100" stepKey="enterAttributeQuantity"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextToProceedToSummary"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickGenerateProductsButton"/> + + <!-- Save Product --> + <actionGroup ref="SaveConfigurableProductAddToCurrentAttributeSetActionGroup" stepKey="saveConfigurableProduct"/> + + <!-- Reindex invalidated indices after product attribute has been created/deleted --> + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> + + <!-- Open edit CMS Page --> + <actionGroup ref="AdminOpenCmsPageActionGroup" stepKey="openEditCmsPage"> + <argument name="page_id" value="$createCmsPage.id$"/> + </actionGroup> + + <conditionalClick selector="{{CmsNewPagePageActionsSection.contentSectionName}}" dependentSelector="{{CmsNewPagePageActionsSection.showHideEditor}}" visible="false" stepKey="expandContentSectionIfNotVisible"/> + <waitForPageLoad stepKey="waitForPageLoadContentSection"/> + <conditionalClick selector="{{CmsNewPagePageActionsSection.showHideEditor}}" dependentSelector="{{CatalogWidgetSection.insertWidgetButton}}" visible="false" stepKey="clickNextShowHideEditorIfVisible"/> + + <!-- Insert Widget --> + <actionGroup ref="AdminInsertWidgetToCmsPageContentActionGroup" stepKey="insertWidgetToCmsPageContent"> + <argument name="widgetType" value="Catalog Products List"/> + </actionGroup> + <actionGroup ref="AdminFillCatalogProductsListWidgetCategoryActionGroup" stepKey="fillCatalogProductsListWidgetOptions"> + <argument name="categoryName" value="$createCategory.name$"/> + </actionGroup> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidgetButton"/> + + <!-- Save CMS Page --> + <actionGroup ref="AdminSaveAndContinueEditCmsPageActionGroup" stepKey="saveCmsPage"/> + </before> + + <after> + <!-- Delete Category --> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <!-- Delete Configurable Product --> + <deleteData createDataKey="createConfigurableProduct" stepKey="deleteConfigurableProduct"/> + <!-- Delete Attribute --> + <deleteData createDataKey="createVisualSwatchAttribute" stepKey="deleteVisualSwatchAttribute"/> + <!-- Delete CMS Page --> + <deleteData createDataKey="createCmsPage" stepKey="deleteCmsPage"/> + <!-- Reindex invalidated indices after product attribute has been created/deleted --> + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> + <!-- Logout from Admin --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <conditionalClick selector="{{CmsNewPagePageSeoSection.header}}" dependentSelector="{{CmsNewPagePageSeoSection.urlKey}}" visible="false" stepKey="clickToExpandSeoSection"/> + <scrollTo selector="{{CmsNewPagePageSeoSection.urlKey}}" stepKey="scrollToUrlKey"/> + <grabValueFrom selector="{{CmsNewPagePageSeoSection.urlKey}}" stepKey="grabTextFromUrlKey"/> + + <!-- Open Storefront CMS page --> + <amOnPage url="{{StorefrontHomePage.url}}$grabTextFromUrlKey" stepKey="gotToCreatedCmsPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productSwatch($swatchAttributeOption.option[store_labels][0][label]$)}}" stepKey="seeAddedWidget"/> + </test> +</tests> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml index 77a16e639c8a..05120d30f2db 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml @@ -8,18 +8,18 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="StorefrontSwatchAttributesDisplayInWidgetCMSTest"> + <test name="StorefrontSwatchAttributesDisplayInWidgetCMSTest" deprecated="Use StorefrontSwatchAttributeDisplayedInWidgetCMSTest instead"> <annotations> <features value="ConfigurableProduct"/> <stories value="Swatches"/> - <title value="Swatch Attribute is not displayed in the Widget CMS"/> - <description value="Swatch Attribute is not displayed in the Widget CMS"/> + <title value="Deprecated. Swatch Attribute is not displayed in the Widget CMS"/> + <description value="Deprecated. Swatch Attribute is not displayed in the Widget CMS"/> <severity value="MAJOR"/> <testCaseId value="MAGETWO-96469"/> <useCaseId value="MAGETWO-96406"/> <group value="ConfigurableProduct"/> <skip> - <issueId value="MQE-1424" /> + <issueId value="DEPRECATED">Use StorefrontSwatchAttributeDisplayedInWidgetCMSTest instead</issueId> </skip> </annotations> diff --git a/app/code/Magento/Swatches/Test/Unit/Controller/Ajax/MediaTest.php b/app/code/Magento/Swatches/Test/Unit/Controller/Ajax/MediaTest.php index 6808b584b2a8..1dde78130d9b 100644 --- a/app/code/Magento/Swatches/Test/Unit/Controller/Ajax/MediaTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Controller/Ajax/MediaTest.php @@ -9,6 +9,7 @@ namespace Magento\Swatches\Test\Unit\Controller\Ajax; use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Attribute\Source\Status; use Magento\Catalog\Model\ProductFactory; use Magento\Framework\App\Action\Context; use Magento\Framework\App\RequestInterface; @@ -60,6 +61,12 @@ class MediaTest extends TestCase /** @var ObjectManager|Media */ private $controller; + /** @var int */ + private $productId = 23; + + /** + * @inheridoc + */ protected function setUp(): void { $this->mediaGallery = [ @@ -107,23 +114,49 @@ protected function setUp(): void ); } - public function testExecute() + /** + * Prepare product mock for test execution. + * + * @return void + */ + private function prepareProductMock(): void { - $this->requestMock->expects($this->any())->method('getParam')->with('product_id')->willReturn(59); + $this->requestMock + ->expects($this->once()) + ->method('getParam') + ->with('product_id') + ->willReturn($this->productId); + $this->productModelFactoryMock + ->expects($this->once()) + ->method('create') + ->willReturn($this->productMock); $this->productMock ->expects($this->once()) ->method('load') - ->with(59) + ->with($this->productId) ->willReturn($this->productMock); $this->productMock ->expects($this->once()) ->method('getIdentities') ->willReturn(['tags']); + } - $this->productModelFactoryMock + /** + * Check that controller return media gallery for the product. + * + * @return void + */ + public function testExecute() + { + $this->prepareProductMock(); + $this->productMock ->expects($this->once()) - ->method('create') - ->willReturn($this->productMock); + ->method('getId') + ->willReturn($this->productId); + $this->productMock + ->expects($this->once()) + ->method('getStatus') + ->willReturn(Status::STATUS_ENABLED); $this->swatchHelperMock ->expects($this->once()) @@ -140,4 +173,55 @@ public function testExecute() $this->assertInstanceOf(Json::class, $result); } + + /** + * Check that controller does not crash while taking the non-existing product. + * + * @return void + */ + public function testExecuteNonExistingProduct() + { + $this->prepareProductMock(); + $this->productMock + ->expects($this->once()) + ->method('getId') + ->willReturn(null); + + $this->jsonMock + ->expects($this->once()) + ->method('setData') + ->with([])->willReturnSelf(); + + $result = $this->controller->execute(); + + $this->assertInstanceOf(Json::class, $result); + } + + /** + * Check that controller does not return media gallery for disabled product. + * + * @return void + */ + public function testExecuteDisabledProduct() + { + $this->prepareProductMock(); + $this->productMock + ->expects($this->once()) + ->method('getId') + ->willReturn($this->productId); + + $this->productMock + ->expects($this->once()) + ->method('getStatus') + ->willReturn(Status::STATUS_DISABLED); + + $this->jsonMock + ->expects($this->once()) + ->method('setData') + ->with([])->willReturnSelf(); + + $result = $this->controller->execute(); + + $this->assertInstanceOf(Json::class, $result); + } } diff --git a/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php b/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php index 9e9978b49915..da2454f35ff1 100644 --- a/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php @@ -14,6 +14,7 @@ use Magento\Framework\Filesystem\Directory\ReadInterface; use Magento\Framework\Filesystem\Directory\Write; use Magento\Framework\Filesystem\Directory\WriteInterface; +use Magento\Framework\Filesystem\DriverInterface; use Magento\Framework\Image; use Magento\Framework\Image\Factory; use Magento\Framework\ObjectManagerInterface; @@ -174,11 +175,20 @@ public function testMoveImageFromTmp() public function testMoveImageFromTmpNoDb() { $this->fileStorageDbMock->method('checkDbUsage')->willReturn(false); - $this->fileStorageDbMock->method('renameFile')->willReturnSelf(); $this->mediaDirectoryMock ->expects($this->atLeastOnce()) ->method('getAbsolutePath') ->willReturn('attribute/swatch/f/i/file.tmp'); + $this->mediaDirectoryMock + ->expects($this->atLeastOnce()) + ->method('renameFile') + ->willReturnSelf(); + $driver = $this->getMockBuilder(DriverInterface::class) + ->getMockForAbstractClass(); + $driver->method('getAbsolutePath')->willReturn('file'); + $this->mediaDirectoryMock + ->method('getDriver') + ->willReturn($driver); $result = $this->mediaHelperObject->moveImageFromTmp('file.tmp'); $this->assertNotNull($result); } diff --git a/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/text.phtml b/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/text.phtml index d436dc8d1ef3..2841b1861f84 100644 --- a/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/text.phtml +++ b/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/text.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Swatches\Block\Adminhtml\Attribute\Edit\Options\Text */ $stores = $block->getStoresSortedBySortOrder(); diff --git a/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/visual.phtml b/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/visual.phtml index b7b1ab5fc532..ef9659de7ff6 100644 --- a/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/visual.phtml +++ b/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/visual.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Swatches\Block\Adminhtml\Attribute\Edit\Options\Visual */ $stores = $block->getStoresSortedBySortOrder(); diff --git a/app/code/Magento/Swatches/view/adminhtml/web/js/form/element/swatch-visual.js b/app/code/Magento/Swatches/view/adminhtml/web/js/form/element/swatch-visual.js index 2fbce5aefbde..8841d56b64d9 100644 --- a/app/code/Magento/Swatches/view/adminhtml/web/js/form/element/swatch-visual.js +++ b/app/code/Magento/Swatches/view/adminhtml/web/js/form/element/swatch-visual.js @@ -250,7 +250,7 @@ define([ */ $(container).on('click', '.btn_choose_file_upload', function () { swatchComponents.inputFile.attr('data-called-by', $(this).data('class')); - swatchComponents.inputFile.click(); + swatchComponents.inputFile.trigger('click'); }); /** diff --git a/app/code/Magento/Swatches/view/adminhtml/web/js/product-attributes.js b/app/code/Magento/Swatches/view/adminhtml/web/js/product-attributes.js index 9e48af20ee94..fc041c39f29e 100644 --- a/app/code/Magento/Swatches/view/adminhtml/web/js/product-attributes.js +++ b/app/code/Magento/Swatches/view/adminhtml/web/js/product-attributes.js @@ -332,12 +332,12 @@ define([ }, /** - * @param {Object} el + * @param {jQuery} el * @this {swatchProductAttributes} */ _enable: function (el) { if (!el.attr('readonly')) { - el.removeAttr('disabled'); + el.prop('disabled', false); } }, @@ -431,10 +431,10 @@ define([ tableBody = $(), activePanel = $(); - $('#frontend_input').bind('change', function () { + $('#frontend_input').on('change', function () { swatchProductAttributes.bindAttributeInputType(); }); - $('#is_filterable').bind('change', function () { + $('#is_filterable').on('change', function () { swatchProductAttributes.switchIsFilterable(); }); diff --git a/app/code/Magento/Swatches/view/adminhtml/web/js/visual.js b/app/code/Magento/Swatches/view/adminhtml/web/js/visual.js index c27d2e60b289..b7d50aa36016 100644 --- a/app/code/Magento/Swatches/view/adminhtml/web/js/visual.js +++ b/app/code/Magento/Swatches/view/adminhtml/web/js/visual.js @@ -384,7 +384,7 @@ define([ */ $(document).on('click', '.btn_choose_file_upload', function () { swatchComponents.inputFile.attr('data-called-by', $(this).attr('id')); - swatchComponents.inputFile.click(); + swatchComponents.inputFile.trigger('click'); }); /** diff --git a/app/code/Magento/Swatches/view/base/web/js/swatch-renderer.js b/app/code/Magento/Swatches/view/base/web/js/swatch-renderer.js index 84389083447a..6782a87b02a9 100644 --- a/app/code/Magento/Swatches/view/base/web/js/swatch-renderer.js +++ b/app/code/Magento/Swatches/view/base/web/js/swatch-renderer.js @@ -55,7 +55,7 @@ define([ }); if (firstSwatch.length) { - $(firstSwatch).focus(); + $(firstSwatch).trigger('focus'); } } }); @@ -106,7 +106,7 @@ define([ $title = $element.find('.title'); $corner = $element.find('.corner'); - $this.hover(function () { + $this.on('mouseenter', function () { if (!$this.hasClass('disabled')) { timer = setTimeout( function () { @@ -168,7 +168,9 @@ define([ $widget.options.delay ); } - }, function () { + }); + + $this.on('mouseleave', function () { $element.hide(); clearTimeout(timer); }); @@ -868,7 +870,7 @@ define([ */ _OnMoreClick: function ($this) { $this.nextAll().show(); - $this.blur().remove(); + $this.trigger('blur').remove(); }, /** @@ -877,7 +879,9 @@ define([ * @private */ _Rewind: function (controls) { - controls.find('div[data-option-id], option[data-option-id]').removeClass('disabled').removeAttr('disabled'); + controls.find('div[data-option-id], option[data-option-id]') + .removeClass('disabled') + .prop('disabled', false); controls.find('div[data-option-empty], option[data-option-empty]') .attr('disabled', true) .addClass('disabled') diff --git a/app/code/Magento/Swatches/view/frontend/layout/wishlist_index_configure_type_configurable.xml b/app/code/Magento/Swatches/view/frontend/layout/wishlist_index_configure_type_configurable.xml index c8159f1a43fe..5e70641e7687 100644 --- a/app/code/Magento/Swatches/view/frontend/layout/wishlist_index_configure_type_configurable.xml +++ b/app/code/Magento/Swatches/view/frontend/layout/wishlist_index_configure_type_configurable.xml @@ -15,6 +15,7 @@ <arguments> <argument name="configurable_view_model" xsi:type="object">Magento\Swatches\ViewModel\Product\Renderer\Configurable</argument> + <argument name="cache_lifetime" xsi:type="boolean">false</argument> </arguments> </block> </referenceBlock> diff --git a/app/code/Magento/SwatchesGraphQl/composer.json b/app/code/Magento/SwatchesGraphQl/composer.json index 1b98b4044a2f..959f0f201d2b 100644 --- a/app/code/Magento/SwatchesGraphQl/composer.json +++ b/app/code/Magento/SwatchesGraphQl/composer.json @@ -9,6 +9,9 @@ "magento/module-catalog": "*", "magento/module-catalog-graph-ql": "*" }, + "suggest": { + "magento/module-configurable-product-graph-ql": "*" + }, "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/SwatchesGraphQl/etc/module.xml b/app/code/Magento/SwatchesGraphQl/etc/module.xml index 6689f13db754..71c336a8cd25 100644 --- a/app/code/Magento/SwatchesGraphQl/etc/module.xml +++ b/app/code/Magento/SwatchesGraphQl/etc/module.xml @@ -10,6 +10,7 @@ <sequence> <module name="Magento_Catalog"/> <module name="Magento_Swatches"/> + <module name="Magento_ConfigurableProductGraphQl"/> </sequence> </module> </config> diff --git a/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls b/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls index c51468ccd285..3491568108da 100644 --- a/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls +++ b/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls @@ -47,3 +47,7 @@ type TextSwatchData implements SwatchDataInterface { type ColorSwatchData implements SwatchDataInterface { } + +type ConfigurableProductOptionValue { + swatch: SwatchDataInterface @resolver(class: "Magento\\SwatchesGraphQl\\Model\\Resolver\\Product\\Options\\SwatchData") +} diff --git a/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php b/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php index a9acef7c178d..d8645a86d2e2 100644 --- a/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php +++ b/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php @@ -563,21 +563,24 @@ protected function processProductItems( /** @var TaxDetailsItemInterface $baseTaxDetail */ $baseTaxDetail = $itemTaxDetail[self::KEY_BASE_ITEM]; $quoteItem = $keyedAddressItems[$code]; - $this->updateItemTaxInfo($quoteItem, $taxDetail, $baseTaxDetail, $store); - //Update aggregated values - if ($quoteItem->getHasChildren() && $quoteItem->isChildrenCalculated()) { - //avoid double counting - continue; + if (!$quoteItem->isDeleted()) { + $this->updateItemTaxInfo($quoteItem, $taxDetail, $baseTaxDetail, $store); + + //Update aggregated values + if ($quoteItem->getHasChildren() && $quoteItem->isChildrenCalculated()) { + //avoid double counting + continue; + } + $subtotal += $taxDetail->getRowTotal(); + $baseSubtotal += $baseTaxDetail->getRowTotal(); + $discountTaxCompensation += $taxDetail->getDiscountTaxCompensationAmount(); + $baseDiscountTaxCompensation += $baseTaxDetail->getDiscountTaxCompensationAmount(); + $tax += $taxDetail->getRowTax(); + $baseTax += $baseTaxDetail->getRowTax(); + $subtotalInclTax += $taxDetail->getRowTotalInclTax(); + $baseSubtotalInclTax += $baseTaxDetail->getRowTotalInclTax(); } - $subtotal += $taxDetail->getRowTotal(); - $baseSubtotal += $baseTaxDetail->getRowTotal(); - $discountTaxCompensation += $taxDetail->getDiscountTaxCompensationAmount(); - $baseDiscountTaxCompensation += $baseTaxDetail->getDiscountTaxCompensationAmount(); - $tax += $taxDetail->getRowTax(); - $baseTax += $baseTaxDetail->getRowTax(); - $subtotalInclTax += $taxDetail->getRowTotalInclTax(); - $baseSubtotalInclTax += $baseTaxDetail->getRowTotalInclTax(); } //Set aggregated values diff --git a/app/code/Magento/Tax/Model/TaxClass/Source/Product.php b/app/code/Magento/Tax/Model/TaxClass/Source/Product.php index 9cd08d1ee69d..8dc6929a7b08 100644 --- a/app/code/Magento/Tax/Model/TaxClass/Source/Product.php +++ b/app/code/Magento/Tax/Model/TaxClass/Source/Product.php @@ -36,8 +36,11 @@ class Product extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource protected $_optionFactory; /** - * Initialize dependencies. - * + * @var \Magento\Tax\Model\ResourceModel\TaxClass\CollectionFactory + */ + private $_classesFactory; + + /** * @param \Magento\Tax\Model\ResourceModel\TaxClass\CollectionFactory $classesFactory * @param \Magento\Eav\Model\ResourceModel\Entity\Attribute\OptionFactory $optionFactory * @param \Magento\Tax\Api\TaxClassRepositoryInterface $taxClassRepository diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminAssertTaxRateInGridActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminAssertTaxRateInGridActionGroup.xml new file mode 100644 index 000000000000..a8f11a7b5f64 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminAssertTaxRateInGridActionGroup.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertTaxRateInGridActionGroup"> + <annotations> + <description>Verifies the specified data is in the specified row on the the admin Tax Zones and Rates page.</description> + </annotations> + <arguments> + <argument name="taxIdentifier" defaultValue="{{US_CA_Rate_1.code}}" type="string"/> + <argument name="country" defaultValue="{{US_CA_Rate_1.tax_country}}" type="string"/> + <argument name="region" defaultValue="{{US_CA_Rate_1.tax_region}}" type="string"/> + <argument name="zip" defaultValue="{{US_CA_Rate_1.tax_postcode}}" type="string"/> + <argument name="rate" defaultValue="{{US_CA_Rate_1.rate}}" type="string"/> + <argument name="rowIndex" defaultValue="1" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminTaxRateGridSection.nthRow(rowIndex)}}" stepKey="waitForRow"/> + <see userInput="{{taxIdentifier}}" selector="{{AdminTaxRateGridSection.taxIdentifierByRow(rowIndex)}}" stepKey="seeTaxIdentifier"/> + <see userInput="{{country}}" selector="{{AdminTaxRateGridSection.countryByRow(rowIndex)}}" stepKey="seeCountry"/> + <see userInput="{{region}}" selector="{{AdminTaxRateGridSection.regionByRow(rowIndex)}}" stepKey="seeRegion"/> + <see userInput="{{zip}}" selector="{{AdminTaxRateGridSection.zipByRow(rowIndex)}}" stepKey="seeZip"/> + <see userInput="{{rate}}" selector="{{AdminTaxRateGridSection.rateByRow(rowIndex)}}" stepKey="seeRate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminDeleteMultipleTaxRatesActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminDeleteMultipleTaxRatesActionGroup.xml new file mode 100644 index 000000000000..f472b5c1b940 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminDeleteMultipleTaxRatesActionGroup.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminDeleteMultipleTaxRatesActionGroup"> + <annotations> + <description>Navigates to the 'Tax Zones and Rates' page and deletes all specified rows one by one. Defaults + to delete all rows except the defaults of 'US-CA-*-Rate 1' and 'US-NY-*-Rate 1'.</description> + </annotations> + <arguments> + <argument name="rowsToDelete" defaultValue="{{AdminTaxRateGridSection.allNonDefaultTaxRates}}" type="string"/> + <argument name="expectedRemainingRows" defaultValue="2" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminLegacyDataGridFilterSection.clear}}" stepKey="waitForResetFilter"/> + <click selector="{{AdminLegacyDataGridFilterSection.clear}}" stepKey="clickResetFilter"/> + <waitForPageLoad stepKey="waitForGridReset"/> + <helper class="Magento\Tax\Test\Mftf\Helper\TaxHelpers" method="deleteAllSpecifiedTaxRuleRows" stepKey="deleteAllSpecifiedTaxRules"> + <argument name="rowsToDelete">{{rowsToDelete}}</argument> + <argument name="deleteButton">{{AdminMainActionsSection.delete}}</argument> + <argument name="modalAcceptButton">{{AdminConfirmationModalSection.ok}}</argument> + <argument name="successMessage">You deleted the tax rate.</argument> + <argument name="successMessageContainer">{{AdminMessagesSection.success}}</argument> + </helper> + <waitForPageLoad stepKey="waitForGridLoad"/> + <seeNumberOfElements userInput="{{expectedRemainingRows}}" selector="{{AdminTaxRateGridSection.allRows}}" stepKey="seeExpectedFinalTotalRows"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup.xml new file mode 100644 index 000000000000..1c2c72a661ce --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup"> + <annotations> + <description>Fill the Filter By Tax Identifier field with taxRateCode.</description> + </annotations> + <arguments> + <argument name="taxRateCode" type="string"/> + </arguments> + + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{taxRateCode}}" stepKey="fillNameFilter"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml index cd416adbe3ff..bc6099790431 100644 --- a/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml +++ b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml @@ -7,30 +7,39 @@ --> <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> - <entity name="SimpleTaxRate" type="taxRate"> - <data key="code" unique="suffix">TaxRate</data> - </entity> - <entity name="defaultTaxRate" type="taxRate"> - <data key="code" unique="suffix">Tax Rate </data> - <data key="tax_country_id">US</data> - <data key="tax_region_id">12</data> - <data key="tax_postcode">*</data> - <data key="zip_is_range">0</data> - <data key="rate">10</data> - </entity> + <!-- These Tax Rates Are Installed by Default with Magento --> <entity name="US_CA_Rate_1" type="taxRate"> <data key="id">1</data> <data key="code">US-CA-*-Rate 1</data> <data key="tax_country_id">US</data> + <data key="tax_country">United States</data> + <data key="tax_region_id">12</data> + <data key="tax_region">CA</data> <data key="tax_postcode">*</data> <data key="rate">8.2500</data> </entity> <entity name="US_NY_Rate_1" type="taxRate"> + <data key="id">2</data> <data key="code">US-NY-*-Rate 1</data> <data key="tax_country_id">US</data> + <data key="tax_country">United States</data> + <data key="tax_region_id">43</data> + <data key="tax_region">NY</data> <data key="tax_postcode">*</data> <data key="rate">8.3750</data> - <data key="id">2</data> + </entity> + + <!-- Test Tax Rates --> + <entity name="SimpleTaxRate" type="taxRate"> + <data key="code" unique="suffix">TaxRate</data> + </entity> + <entity name="defaultTaxRate" type="taxRate"> + <data key="code" unique="suffix">Tax Rate </data> + <data key="tax_country_id">US</data> + <data key="tax_region_id">12</data> + <data key="tax_postcode">*</data> + <data key="zip_is_range">0</data> + <data key="rate">10</data> </entity> <entity name="taxRate_US_NY_8_1" type="taxRate"> <data key="code" unique="suffix">US-NY-*-</data> diff --git a/app/code/Magento/Tax/Test/Mftf/Helper/TaxHelpers.php b/app/code/Magento/Tax/Test/Mftf/Helper/TaxHelpers.php new file mode 100644 index 000000000000..266da220da39 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Helper/TaxHelpers.php @@ -0,0 +1,62 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Tax\Test\Mftf\Helper; + +use Facebook\WebDriver\Remote\RemoteWebDriver as FacebookWebDriver; +use Facebook\WebDriver\WebDriverBy; +use Magento\FunctionalTestingFramework\Helper\Helper; +use Magento\FunctionalTestingFramework\Module\MagentoWebDriver; + +/** + * Class for MFTF helpers for Tax module. + */ +class TaxHelpers extends Helper +{ + /** + * Delete all specified Tax Rules one by one from the Tax Zones and Rates page. + * + * @param string $rowsToDelete + * @param string $deleteButton + * @param string $modalAcceptButton + * @param string $successMessage + * @param string $successMessageContainer + * + * @return void + */ + public function deleteAllSpecifiedTaxRuleRows( + string $rowsToDelete, + string $deleteButton, + string $modalAcceptButton, + string $successMessage, + string $successMessageContainer + ): void { + try { + /** @var MagentoWebDriver $webDriver */ + $magentoWebDriver = $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver'); + /** @var FacebookWebDriver $webDriver */ + $webDriver = $magentoWebDriver->webDriver; + + $magentoWebDriver->waitForPageLoad(30); + $rows = $webDriver->findElements(WebDriverBy::xpath($rowsToDelete)); + while (!empty($rows)) { + $rows[0]->click(); + $magentoWebDriver->waitForPageLoad(30); + $magentoWebDriver->waitForElementVisible($deleteButton, 10); + $magentoWebDriver->click($deleteButton); + $magentoWebDriver->waitForPageLoad(30); + $magentoWebDriver->waitForElementVisible($modalAcceptButton, 10); + $magentoWebDriver->click($modalAcceptButton); + $magentoWebDriver->waitForPageLoad(60); + $magentoWebDriver->waitForText($successMessage, 10, $successMessageContainer); + $rows = $webDriver->findElements(WebDriverBy::xpath($rowsToDelete)); + } + } catch (\Exception $exception) { + $this->fail($exception->getMessage()); + } + } +} diff --git a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml index ba9da182d735..31316d4cc1a1 100644 --- a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml +++ b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml @@ -15,7 +15,14 @@ <element name="filterByTaxIdentifier" type="input" selector="#tax_rate_grid_filter_code"/> <element name="filterByCountry" type="input" selector="#tax_rate_grid_filter_tax_country_id"/> <element name="filterByPostCode" type="input" selector="#tax_rate_grid_filter_tax_postcode"/> - <element name="nthRow" type="block" selector="tr[data-role='row']:nth-of-type({{var}})" parameterized="true" timeout="30"/> + <element name="allRows" type="block" selector="#tax_rate_grid_table tbody tr"/> + <element name="nthRow" type="block" parameterized="true" timeout="30" selector="#tax_rate_grid_table tbody tr:nth-of-type({{rowIndex}})"/> + <element name="taxIdentifierByRow" type="text" parameterized="true" selector="#tax_rate_grid_table tbody tr:nth-of-type({{rowIndex}}) [data-column=code]"/> + <element name="countryByRow" type="text" parameterized="true" selector="#tax_rate_grid_table tbody tr:nth-of-type({{rowIndex}}) [data-column=tax_country_id]"/> + <element name="regionByRow" type="text" parameterized="true" selector="#tax_rate_grid_table tbody tr:nth-of-type({{rowIndex}}) [data-column=region_name]"/> + <element name="zipByRow" type="text" parameterized="true" selector="#tax_rate_grid_table tbody tr:nth-of-type({{rowIndex}}) [data-column=tax_postcode]"/> + <element name="rateByRow" type="text" parameterized="true" selector="#tax_rate_grid_table tbody tr:nth-of-type({{rowIndex}}) [data-column=rate]"/> + <element name="allNonDefaultTaxRates" type="block" selector="//table[@id='tax_rate_grid_table']//tbody//tr//td[@data-column='code' and not(contains(.,'US-CA-*-Rate 1')) and not(contains(.,'US-NY-*-Rate 1'))]"/> <element name="emptyText" type="text" selector=".empty-text"/> </section> -</sections> \ No newline at end of file +</sections> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml index 7fa1daeb063c..0ede3caacd86 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml @@ -44,7 +44,9 @@ <!-- Verify the tax rate grid page shows the tax rate we just created --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex2"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters1"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillNameFilter"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillNameFilter"> + <argument name="taxRateCode" value="{{SimpleTaxRate.code}}"/> + </actionGroup> <selectOption selector="{{AdminTaxRateGridSection.filterByCountry}}" userInput="Australia" stepKey="fillCountryFilter"/> <fillField selector="{{AdminTaxRateGridSection.filterByPostCode}}" userInput="*" stepKey="fillPostCodeFilter"/> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch"/> @@ -55,7 +57,9 @@ <!-- Go to the tax rate edit page for our new tax rate --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex3"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillNameFilter2"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillNameFilter2"> + <argument name="taxRateCode" value="{{SimpleTaxRate.code}}"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml index e189e4548319..cb597273e36b 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml @@ -46,7 +46,9 @@ <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex2"/> <!-- Create a tax rate for large postcodes and verify we see expected values on the tax rate grid page --> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillTaxIdentifierField2"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField2"> + <argument name="taxRateCode" value="{{SimpleTaxRate.code}}"/> + </actionGroup> <selectOption selector="{{AdminTaxRateGridSection.filterByCountry}}" userInput="France" stepKey="selectCountry2" /> <fillField selector="{{AdminTaxRateGridSection.filterByPostCode}}" userInput="*" stepKey="seeTaxPostCode1"/> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml index 9a5566c2db88..46d3582681c5 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml @@ -46,7 +46,9 @@ <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex2"/> <!-- Verify the tax rate grid page shows the specific postcode we just created --> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters1"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillTaxIdentifierField2"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField2"> + <argument name="taxRateCode" value="{{SimpleTaxRate.code}}"/> + </actionGroup> <selectOption selector="{{AdminTaxRateGridSection.filterByCountry}}" userInput="Canada" stepKey="fillCountryFilter"/> <fillField selector="{{AdminTaxRateGridSection.filterByPostCode}}" userInput="180" stepKey="fillPostCodeFilter"/> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml index 48217628b927..f428aabddcf9 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml @@ -46,7 +46,9 @@ <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex2"/> <!-- Create a tax rate for zipCodeRange and verify we see expected values on the tax rate grid page --> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillTaxIdentifierField2"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField2"> + <argument name="taxRateCode" value="{{SimpleTaxRate.code}}"/> + </actionGroup> <selectOption selector="{{AdminTaxRateGridSection.filterByCountry}}" userInput="United Kingdom" stepKey="selectCountry2" /> <fillField selector="{{AdminTaxRateGridSection.filterByPostCode}}" userInput="1-7800935" stepKey="seeTaxPostCode1"/> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml index d237e52a6047..0e541b893905 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml @@ -47,7 +47,9 @@ <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex2"/> <!-- Create a tax rate for zipCodeRange and verify we see expected values on the tax rate grid page --> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillTaxIdentifierField2"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField2"> + <argument name="taxRateCode" value="{{SimpleTaxRate.code}}"/> + </actionGroup> <selectOption selector="{{AdminTaxRateGridSection.filterByCountry}}" userInput="United States" stepKey="selectCountry2" /> <fillField selector="{{AdminTaxRateGridSection.filterByPostCode}}" userInput="90001-96162" stepKey="seeTaxPostCode1"/> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/DeleteTaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/DeleteTaxRateEntityTest.xml index 3abdb45faf95..5f288d55b5d0 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/DeleteTaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/DeleteTaxRateEntityTest.xml @@ -37,7 +37,9 @@ <!-- Confirm Deleted TaxIdentifier(from the above step) on the tax rate grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex2"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{defaultTaxRate.code}}" stepKey="fillTaxIdentifierField3"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField3"> + <argument name="taxRateCode" value="{{defaultTaxRate.code}}"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> <see selector="{{AdminTaxRateGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeSuccess"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestSimpleTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestSimpleTest.xml index f7d23baa534f..5fc9b7c16294 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestSimpleTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestSimpleTest.xml @@ -72,7 +72,7 @@ </after> <!-- Go to the created product page and add it to the cart --> - <amOnPage url="$$simpleProduct1.sku$$.html" stepKey="goToSimpleProductPage"/> + <amOnPage url="$$simpleProduct1.custom_attributes[url_key]$$.html" stepKey="goToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPage"/> <click stepKey="addSimpleProductToCart" selector="{{StorefrontProductActionSection.addToCart}}"/> <waitForPageLoad stepKey="waitForProductAdded"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestVirtualTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestVirtualTest.xml index e08d366a37cd..73fd5c144d45 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestVirtualTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestVirtualTest.xml @@ -72,7 +72,7 @@ </after> <!-- Go to the created product page and add it to the cart --> - <amOnPage url="$$virtualProduct1.sku$$.html" stepKey="goToVirtualProductPage"/> + <amOnPage url="$$virtualProduct1.custom_attributes[url_key]$$.html" stepKey="goToVirtualProductPage"/> <waitForPageLoad stepKey="waitForVirtualProductPage"/> <click stepKey="addVirtualProductToCart" selector="{{StorefrontProductActionSection.addToCart}}"/> <waitForPageLoad stepKey="waitForProductAdded"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInSimpleTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInSimpleTest.xml index bab6b7c45ff6..20c7833c9601 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInSimpleTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInSimpleTest.xml @@ -86,7 +86,7 @@ </after> <!-- Go to the created product page and add it to the cart --> - <amOnPage url="$$simpleProduct1.sku$$.html" stepKey="goToSimpleProductPage"/> + <amOnPage url="$$simpleProduct1.custom_attributes[url_key]$$.html" stepKey="goToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPage"/> <click stepKey="addSimpleProductToCart" selector="{{StorefrontProductActionSection.addToCart}}"/> <waitForPageLoad stepKey="waitForProductAdded"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInVirtualTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInVirtualTest.xml index b29b1a127189..4ce4d3920b16 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInVirtualTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInVirtualTest.xml @@ -85,7 +85,7 @@ </after> <!-- Go to the created product page and add it to the cart --> - <amOnPage url="$$virtualProduct1.sku$$.html" stepKey="goToVirtualProductPage"/> + <amOnPage url="$$virtualProduct1.custom_attributes[url_key]$$.html" stepKey="goToVirtualProductPage"/> <waitForPageLoad stepKey="waitForVirtualProductPage"/> <click stepKey="addVirtualProductToCart" selector="{{StorefrontProductActionSection.addToCart}}"/> <waitForPageLoad stepKey="waitForProductAdded"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestSimpleTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestSimpleTest.xml index d2f1b1aa4439..8c28fb36eb34 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestSimpleTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestSimpleTest.xml @@ -72,7 +72,7 @@ </after> <!-- Go to the created product page and add it to the cart --> - <amOnPage url="$$simpleProduct1.sku$$.html" stepKey="goToSimpleProductPage"/> + <amOnPage url="$$simpleProduct1.custom_attributes[url_key]$$.html" stepKey="goToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPage"/> <click stepKey="addSimpleProductToCart" selector="{{StorefrontProductActionSection.addToCart}}"/> <waitForPageLoad stepKey="waitForProductAdded"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestVirtualTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestVirtualTest.xml index 5441664d7c53..ac012f36f74f 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestVirtualTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestVirtualTest.xml @@ -72,7 +72,7 @@ </after> <!-- Go to the created product page and add it to the cart --> - <amOnPage url="$$virtualProduct1.sku$$.html" stepKey="goToVirtualProductPage"/> + <amOnPage url="$$virtualProduct1.custom_attributes[url_key]$$.html" stepKey="goToVirtualProductPage"/> <waitForPageLoad stepKey="waitForVirtualProductPage"/> <click stepKey="addVirtualProductToCart" selector="{{StorefrontProductActionSection.addToCart}}"/> <waitForPageLoad stepKey="waitForProductAdded"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInSimpleTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInSimpleTest.xml index 03dafb07b6fd..de7c346fa2b1 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInSimpleTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInSimpleTest.xml @@ -87,7 +87,7 @@ </actionGroup> <!-- Go to the created product page and add it to the cart --> - <amOnPage url="$$simpleProduct1.sku$$.html" stepKey="goToSimpleProductPage"/> + <amOnPage url="$$simpleProduct1.custom_attributes[url_key]$$.html" stepKey="goToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPage"/> <click stepKey="addSimpleProductToCart" selector="{{StorefrontProductActionSection.addToCart}}"/> <waitForPageLoad stepKey="waitForProductAdded"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInVirtualTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInVirtualTest.xml index c98765976f36..a0a881f32a90 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInVirtualTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInVirtualTest.xml @@ -87,7 +87,7 @@ </actionGroup> <!-- Go to the created product page and add it to the cart --> - <amOnPage url="$$virtualProduct1.sku$$.html" stepKey="goToVirtualProductPage"/> + <amOnPage url="$$virtualProduct1.custom_attributes[url_key]$$.html" stepKey="goToVirtualProductPage"/> <waitForPageLoad stepKey="waitForVirtualProductPage"/> <click stepKey="addVirtualProductToCart" selector="{{StorefrontProductActionSection.addToCart}}"/> <waitForPageLoad stepKey="waitForProductAdded"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/Update01TaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/Update01TaxRateEntityTest.xml index b102b4d94501..6f7ef59788f6 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/Update01TaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/Update01TaxRateEntityTest.xml @@ -29,7 +29,9 @@ <!-- Search the tax rate on tax grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex1"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters1"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$initialTaxRate.code$$" stepKey="fillCode"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillCode"> + <argument name="taxRateCode" value="$$initialTaxRate.code$$"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> @@ -46,7 +48,9 @@ <!-- Verify we see updated 0.1 tax rate(from the above step) on the tax rate grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex4"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{taxRateCustomRateFrance.code}}" stepKey="fillTaxIdentifierField3"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField3"> + <argument name="taxRateCode" value="{{taxRateCustomRateFrance.code}}"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> <!-- Verify we see updated 0.1 tax rate on the tax rate form page --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml index 115a1df4631e..c7663acf97a1 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml @@ -29,7 +29,9 @@ <!-- Search the tax rate on tax grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex1"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters1"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$initialTaxRate.code$$" stepKey="fillCode"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillCode"> + <argument name="taxRateCode" value="$$initialTaxRate.code$$"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> @@ -45,7 +47,9 @@ <!-- Verify we see updated TaxIdentifier(from the above step) on the tax rate grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex4"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{taxRateCustomRateUS.code}}" stepKey="fillTaxIdentifierField3"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField3"> + <argument name="taxRateCode" value="{{taxRateCustomRateUS.code}}"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> <!-- Verify we see updated values on the tax rate form page --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/Update1299TaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/Update1299TaxRateEntityTest.xml index 5594cf58e7b2..5776925354e8 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/Update1299TaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/Update1299TaxRateEntityTest.xml @@ -29,7 +29,9 @@ <!-- Search the tax identifier on tax grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex1"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters1"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$initialTaxRate.code$$" stepKey="fillCode1"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillCode1"> + <argument name="taxRateCode" value="$$initialTaxRate.code$$"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> @@ -46,7 +48,9 @@ <!-- Verify we see updated tax rate(from the above step) on the tax rate grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex2"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{taxRateCustomRateUK.code}}" stepKey="fillTaxIdentifierField2"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField2"> + <argument name="taxRateCode" value="{{taxRateCustomRateUK.code}}"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> <!-- Verify we see updated tax rate on the tax rate form page --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/UpdateAnyRegionTaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/UpdateAnyRegionTaxRateEntityTest.xml index da531ea373aa..c4449e5d6e5a 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/UpdateAnyRegionTaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/UpdateAnyRegionTaxRateEntityTest.xml @@ -29,7 +29,10 @@ <!-- Search the tax rate on tax grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex1"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters1"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$initialTaxRate.code$$" stepKey="fillCode"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillCode"> + <argument name="taxRateCode" value="$$initialTaxRate.code$$"/> + </actionGroup> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> @@ -45,7 +48,9 @@ <!-- Verify we see updated any region tax rate(from the above step) on the tax rate grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex2"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{taxRateCustomRateCanada.code}}" stepKey="fillTaxIdentifierField3"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField3"> + <argument name="taxRateCode" value="{{taxRateCustomRateCanada.code}}"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> <!-- Verify we see updated any region tax rate on the tax rate form page --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/UpdateDecimalTaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/UpdateDecimalTaxRateEntityTest.xml index 717d9b942826..2bac4ca2115c 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/UpdateDecimalTaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/UpdateDecimalTaxRateEntityTest.xml @@ -29,7 +29,9 @@ <!-- Search the tax rate on tax grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex1"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters1"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$initialTaxRate.code$$" stepKey="fillCode"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillCode"> + <argument name="taxRateCode" value="$$initialTaxRate.code$$"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> @@ -47,7 +49,9 @@ <!-- Verify we see updated tax rate(from the above step) on the tax rate grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex2"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{defaultTaxRateWithZipRange.code}}" stepKey="fillTaxIdentifierField3"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField3"> + <argument name="taxRateCode" value="{{defaultTaxRateWithZipRange.code}}"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> <!-- Verify we see updated tax rate on the tax rate form page --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/UpdateLargeTaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/UpdateLargeTaxRateEntityTest.xml index b664d334162e..c808de2d7f10 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/UpdateLargeTaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/UpdateLargeTaxRateEntityTest.xml @@ -29,7 +29,10 @@ <!-- Search the tax rate on tax grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex1"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters1"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$initialTaxRate.code$$" stepKey="fillCode"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillCode"> + <argument name="taxRateCode" value="$$initialTaxRate.code$$"/> + </actionGroup> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> @@ -44,7 +47,9 @@ <!-- Verify we see updated large tax rate(from the above step) on the tax rate grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex4"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{defaultTaxRateWithLargeRate.code}}" stepKey="fillTaxIdentifierField3"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField3"> + <argument name="taxRateCode" value="{{defaultTaxRateWithLargeRate.code}}"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> <!-- Verify we see updated large tax rate on the tax rate form page --> diff --git a/app/code/Magento/Tax/etc/config.xml b/app/code/Magento/Tax/etc/config.xml index afe7bd786116..3c8206c63d50 100644 --- a/app/code/Magento/Tax/etc/config.xml +++ b/app/code/Magento/Tax/etc/config.xml @@ -49,7 +49,7 @@ <zero_tax>0</zero_tax> </sales_display> <notification> - <info_url>https://docs.magento.com/m2/ce/user_guide/tax/warning-messages.html</info_url> + <info_url>https://docs.magento.com/user-guide/tax/warning-messages.html</info_url> </notification> </tax> </default> diff --git a/app/code/Magento/Tax/view/base/web/js/price/adjustment.js b/app/code/Magento/Tax/view/base/web/js/price/adjustment.js index a17d130d9282..929d648e6e64 100644 --- a/app/code/Magento/Tax/view/base/web/js/price/adjustment.js +++ b/app/code/Magento/Tax/view/base/web/js/price/adjustment.js @@ -61,6 +61,16 @@ define([ return row['price_info']['extension_attributes']['tax_adjustments']['formatted_prices'][this.taxPriceType]; }, + /** + * UnsanitizedHtml version of getTax. + * + * @param {Object} row + * @return {HTMLElement} tax html + */ + getTaxUnsanitizedHtml: function (row) { + return this.getTax(row); + }, + /** * Set price tax type. * diff --git a/app/code/Magento/Tax/view/base/web/template/price/bundle/adjustment.html b/app/code/Magento/Tax/view/base/web/template/price/bundle/adjustment.html index 3a759585e782..4ce5c0d25ae7 100644 --- a/app/code/Magento/Tax/view/base/web/template/price/bundle/adjustment.html +++ b/app/code/Magento/Tax/view/base/web/template/price/bundle/adjustment.html @@ -9,7 +9,7 @@ attr="'data-label': $t('Incl. Tax')" data-price-amount="" data-price-type="basePrice" - html="getTax($row())"/> + html="getTaxUnsanitizedHtml($row())"></span> </if> <if args="displayPriceExclTax()"> @@ -17,7 +17,7 @@ attr="'data-label': $t('Excl. Tax')" data-price-amount="" data-price-type="basePrice" - html="getTax($row())"/> + html="getTaxUnsanitizedHtml($row())"></span> </if> <if args="displayBothPrices()"> @@ -25,5 +25,5 @@ attr="'data-label': $t('Excl. Tax')" data-price-amount="" data-price-type="basePrice" - html="getTax($row())"/> + html="getTaxUnsanitizedHtml($row())"></span> </if> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminExportTaxRatesActionGroup.xml b/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminExportTaxRatesActionGroup.xml new file mode 100644 index 000000000000..36d0313ee5c8 --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminExportTaxRatesActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickExportTaxRatesActionGroup"> + <annotations> + <description>Clicks the 'Export Tax Rates' button.</description> + </annotations> + <waitForElementVisible selector="{{AdminImportExportTaxRatesSection.exportTaxRatesButton}}" stepKey="waitForExportTaxRates"/> + <click selector="{{AdminImportExportTaxRatesSection.exportTaxRatesButton}}" stepKey="clickExportTaxRates"/> + <waitForPageLoad stepKey="waitForExport"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminExportTaxRatesFromGridActionGroup.xml b/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminExportTaxRatesFromGridActionGroup.xml new file mode 100644 index 000000000000..68548d2f8b32 --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminExportTaxRatesFromGridActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminExportTaxRatesFromGridActionGroup"> + <annotations> + <description>Selects the export file type and clicks the 'Export' button from the Tax Zones and Rates admin page.</description> + </annotations> + <arguments> + <argument name="fileType" defaultValue="CSV" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminTaxRateGridSection.exportFileType}}" stepKey="waitForExportFileTypeDropDown"/> + <selectOption userInput="{{fileType}}" selector="{{AdminTaxRateGridSection.exportFileType}}" stepKey="selectFileType"/> + <click selector="{{AdminTaxRateGridSection.exportButton}}" stepKey="clickExportButton"/> + <waitForPageLoad stepKey="waitForExport"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminImportTaxRatesActionGroup.xml b/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminImportTaxRatesActionGroup.xml new file mode 100644 index 000000000000..91cc0eea738e --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminImportTaxRatesActionGroup.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminImportTaxRatesActionGroup"> + <annotations> + <description>Uploads the specified file and clicks the 'Import Tax Rates' button on the Import and Export Tax Rates page.</description> + </annotations> + <arguments> + <argument name="file" defaultValue="" type="string"/> + <argument name="resultMessageType" defaultValue="success" type="string"/> + <argument name="resultMessage" defaultValue="The tax rate has been imported." type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminImportExportTaxRatesSection.uploadFile}}" stepKey="waitForUploadFile"/> + <attachFile userInput="{{file}}" selector="{{AdminImportExportTaxRatesSection.uploadFile}}" stepKey="uploadFile"/> + <click selector="{{AdminImportExportTaxRatesSection.importTaxRatesButton}}" stepKey="clickImportTaxRates"/> + <waitForPageLoad stepKey="waitForImport"/> + <waitForText userInput="{{resultMessage}}" selector="{{AdminMessagesSection.messageByType(resultMessageType)}}" stepKey="waitForMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminNavigateImportExportTaxRatesActionGroup.xml b/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminNavigateImportExportTaxRatesActionGroup.xml new file mode 100644 index 000000000000..a5461dde000b --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminNavigateImportExportTaxRatesActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminNavigateImportExportTaxRatesActionGroup"> + <annotations> + <description>Navigates to the admin System > Data Transfer > Import/Export Tax Rates page.</description> + </annotations> + <amOnPage url="{{AdminImportExportTaxRatesPage.url}}" stepKey="navigateToImportExportTaxRatesPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/Data/ImportData.xml b/app/code/Magento/TaxImportExport/Test/Mftf/Data/ImportData.xml new file mode 100644 index 000000000000..04647b373756 --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/Data/ImportData.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <!-- Tax Import Files --> + <entity name="import_tax_rates" type="taxImport"> + <data key="filename">import_tax_rates.csv</data> + </entity> + + <!-- Tax Rates --> + <entity name="import_rate_1" type="taxRate"> + <data key="code">import-rate-1</data> + <data key="tax_country_id">US</data> + <data key="tax_country">United States</data> + <data key="tax_region_id">57</data> + <data key="tax_region">TX</data> + <data key="tax_postcode">78758</data> + <data key="zip_is_range">0</data> + <data key="rate">5.25</data> + </entity> + <entity name="import_rate_2" type="taxRate"> + <data key="code">import-rate-2</data> + <data key="tax_country_id">US</data> + <data key="tax_country">United States</data> + <data key="tax_region_id">2</data> + <data key="tax_region">AK</data> + <data key="tax_postcode">12345-12346</data> + <data key="zip_is_range">1</data> + <data key="rate">7.75</data> + </entity> +</entities> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/Page/AdminImportExportTaxRatesPage.xml b/app/code/Magento/TaxImportExport/Test/Mftf/Page/AdminImportExportTaxRatesPage.xml new file mode 100644 index 000000000000..340d8477b06e --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/Page/AdminImportExportTaxRatesPage.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="AdminImportExportTaxRatesPage" url="tax/rate/importExport/" area="admin" module="Magento_TaxImportExport"> + <section name="AdminImportExportTaxRatesSection"/> + </page> +</pages> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/Section/AdminImportExportTaxRatesSection.xml b/app/code/Magento/TaxImportExport/Test/Mftf/Section/AdminImportExportTaxRatesSection.xml new file mode 100644 index 000000000000..148b8cec3903 --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/Section/AdminImportExportTaxRatesSection.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminImportExportTaxRatesSection"> + <element name="uploadFile" type="input" selector="#import_rates_file"/> + <element name="importTaxRatesButton" type="button" selector="[title='Import Tax Rates']"/> + <element name="exportTaxRatesButtonForm" type="block" selector="#export_form"/> + <element name="exportTaxRatesButton" type="button" selector="#export_form [title='Export Tax Rates']"/> + </section> +</sections> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/Section/AdminTaxRateGridSection.xml b/app/code/Magento/TaxImportExport/Test/Mftf/Section/AdminTaxRateGridSection.xml new file mode 100644 index 000000000000..174b610a00cd --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/Section/AdminTaxRateGridSection.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminTaxRateGridSection"> + <element name="exportFileType" type="select" selector="#tax_rate_grid_export"/> + <element name="exportFileTypeOption" type="select" parameterized="true" selector="//select[@id='tax_rate_grid_export']//option[.='{{option}}']"/> + <element name="exportButton" type="button" selector="#tax_rate_grid [title='Export']"/> + </section> +</sections> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/Test/AdminExportTaxRatesTest.xml b/app/code/Magento/TaxImportExport/Test/Mftf/Test/AdminExportTaxRatesTest.xml new file mode 100644 index 000000000000..b83fe02f897a --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/Test/AdminExportTaxRatesTest.xml @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminExportTaxRatesTest"> + <annotations> + <features value="TaxImportExport"/> + <stories value="Export"/> + <title value="Export Tax Rates"/> + <description value="Exports tax rates from the System > Data Transfer > Import/Export Tax Rates page, from + the Tax Rule page, from the Tax Rates grid page as a .csv, and from the Tax Rates grid page as an .xml. + Validates contents in downloaded file for each export area. Note that MFTF cannot simply click export and + have access to the file that is downloaded in the browser due to the test not having access to the server + that is running the test browser. Therefore, this test verifies that the Export button can be successfully + clicked, grabs the request URL from the Export button's form, executes the request on the magento machine + via a curl request, and verifies the contents of the exported file."/> + <severity value="MAJOR"/> + <testCaseId value="MC-38621"/> + <group value="importExport"/> + <group value="tax"/> + </annotations> + + <before> + <!-- Create/Revert Seed Data --> + <createData entity="US_CA_Rate_1" stepKey="revertInitialTaxRateCA"/> + <createData entity="US_NY_Rate_1" stepKey="revertInitialTaxRateNY"/> + + <!-- Login as Admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <after> + <!-- Logout --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Export Tax Rates & Validate Export from System > Data Transfer --> + <actionGroup ref="AdminNavigateImportExportTaxRatesActionGroup" stepKey="navigateToImportExportTaxRatesPage"/> + <actionGroup ref="AdminClickExportTaxRatesActionGroup" stepKey="exportTaxRates"/> + <grabAttributeFrom userInput="action" selector="{{AdminImportExportTaxRatesSection.exportTaxRatesButtonForm}}" stepKey="grabExportUrl"/> + <executeJS function="return window.FORM_KEY" stepKey="grabFormKey"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertExportedFileContainsCATaxRate"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="postBody">{"form_key": "{$grabFormKey}"}</argument> + <argument name="expectedString">{{US_CA_Rate_1.code}}</argument> + </helper> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertExportedFileContainsNYTaxRate"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="postBody">{"form_key": "{$grabFormKey}"}</argument> + <argument name="expectedString">{{US_NY_Rate_1.code}}</argument> + </helper> + + <!-- Export Tax Rates & Validate Export from Tax Rule Page --> + <actionGroup ref="AdminGoToNewTaxRulePageActionGroup" stepKey="navigateToTaxRulePage"/> + <actionGroup ref="AdminClickExportTaxRatesActionGroup" stepKey="exportTaxRates2"/> + <grabAttributeFrom userInput="action" selector="{{AdminImportExportTaxRatesSection.exportTaxRatesButtonForm}}" stepKey="grabExportUrl2"/> + <executeJS function="return window.FORM_KEY" stepKey="grabFormKey2"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertExportedFileContainsCATaxRate2"> + <argument name="url">{$grabExportUrl2}</argument> + <argument name="postBody">{"form_key": "{$grabFormKey2}"}</argument> + <argument name="expectedString">{{US_CA_Rate_1.code}}</argument> + </helper> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertExportedFileContainsNYTaxRate2"> + <argument name="url">{$grabExportUrl2}</argument> + <argument name="postBody">{"form_key": "{$grabFormKey2}"}</argument> + <argument name="expectedString">{{US_NY_Rate_1.code}}</argument> + </helper> + + <!-- Export Tax Rates & Validate Export from Tax Rates Grid Page as CSV --> + <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="navigateToTaxRatesGridPage"/> + <actionGroup ref="AdminExportTaxRatesFromGridActionGroup" stepKey="exportTaxRatesCSV"/> + <grabAttributeFrom userInput="value" selector="{{AdminTaxRateGridSection.exportFileTypeOption('CSV')}}" stepKey="grabExportUrl3"/> + <executeJS function="return window.FORM_KEY" stepKey="grabFormKey3"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertExportedFileContainsCATaxRate3"> + <argument name="url">{$grabExportUrl3}</argument> + <argument name="postBody">{"form_key": "{$grabFormKey3}"}</argument> + <argument name="expectedString">{{US_CA_Rate_1.code}}</argument> + </helper> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertExportedFileContainsNYTaxRate3"> + <argument name="url">{$grabExportUrl3}</argument> + <argument name="postBody">{"form_key": "{$grabFormKey3}"}</argument> + <argument name="expectedString">{{US_NY_Rate_1.code}}</argument> + </helper> + + <!-- Export Tax Rates & Validate Export from Tax Rates Grid Page as XML --> + <actionGroup ref="AdminExportTaxRatesFromGridActionGroup" stepKey="exportTaxRatesXML"> + <argument name="fileType" value="Excel XML"/> + </actionGroup> + <grabAttributeFrom userInput="value" selector="{{AdminTaxRateGridSection.exportFileTypeOption('Excel XML')}}" stepKey="grabExportUrl4"/> + <executeJS function="return window.FORM_KEY" stepKey="grabFormKey4"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertExportedFileContainsCATaxRate4"> + <argument name="url">{$grabExportUrl4}</argument> + <argument name="postBody">{"form_key": "{$grabFormKey4}"}</argument> + <argument name="expectedString">{{US_CA_Rate_1.code}}</argument> + </helper> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertExportedFileContainsNYTaxRate4"> + <argument name="url">{$grabExportUrl4}</argument> + <argument name="postBody">{"form_key": "{$grabFormKey4}"}</argument> + <argument name="expectedString">{{US_NY_Rate_1.code}}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/Test/AdminImportTaxRatesTest.xml b/app/code/Magento/TaxImportExport/Test/Mftf/Test/AdminImportTaxRatesTest.xml new file mode 100644 index 000000000000..075b7a5d0662 --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/Test/AdminImportTaxRatesTest.xml @@ -0,0 +1,133 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminImportTaxRatesTest"> + <annotations> + <features value="TaxImportExport"/> + <stories value="Import"/> + <title value="Import and Update Tax Rates"/> + <description value="Imports tax rates from the System > Data Transfer > Import/Export Tax Rates page and + from the Tax Rule page, to create new tax rates and update existing tax rates. Verifies results on the Tax + Rates grid page."/> + <severity value="MAJOR"/> + <testCaseId value="MC-38621"/> + <group value="importExport"/> + <group value="tax"/> + </annotations> + + <before> + <!-- Create/Revert Seed Data --> + <createData entity="US_CA_Rate_1" stepKey="revertInitialTaxRateCA"/> + <createData entity="US_NY_Rate_1" stepKey="revertInitialTaxRateNY"/> + + <!-- Login as Admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <after> + <!-- Delete/Revert Data --> + <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="navigateToTaxRatesPage"/> + <createData entity="US_CA_Rate_1" stepKey="revertInitialTaxRateCA"/> + <createData entity="US_NY_Rate_1" stepKey="revertInitialTaxRateNY"/> + <actionGroup ref="AdminDeleteMultipleTaxRatesActionGroup" stepKey="deleteAllNonDefaultTaxRates"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Import Tax Rates from System > Data Transfer --> + <actionGroup ref="AdminNavigateImportExportTaxRatesActionGroup" stepKey="navigateToImportExportTaxRatesPage"/> + <actionGroup ref="AdminImportTaxRatesActionGroup" stepKey="importTaxRates"> + <argument name="file" value="{{import_tax_rates.filename}}"/> + </actionGroup> + + <!-- Verify Imported Tax Rates --> + <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="navigateToTaxRatesPage"/> + <actionGroup ref="AdminFilterLegacyGridActionGroup" stepKey="filterGridCA"> + <argument name="field" value="{{AdminLegacyDataGridFilterSection.inputFieldByNameAttr('code')}}"/> + <argument name="value" value="{{US_CA_Rate_1.code}}"/> + </actionGroup> + <actionGroup ref="AdminAssertTaxRateInGridActionGroup" stepKey="verifyTaxRateRowCA"> + <argument name="taxIdentifier" value="{{US_CA_Rate_1.code}}"/> + <argument name="country" value="{{US_CA_Rate_1.tax_country}}"/> + <argument name="region" value="{{US_CA_Rate_1.tax_region}}"/> + <argument name="zip" value="{{US_CA_Rate_1.tax_postcode}}"/> + <argument name="rate" value="10.25"/> + </actionGroup> + <actionGroup ref="AdminFilterLegacyGridActionGroup" stepKey="filterGridImport1"> + <argument name="field" value="{{AdminLegacyDataGridFilterSection.inputFieldByNameAttr('code')}}"/> + <argument name="value" value="{{import_rate_1.code}}"/> + </actionGroup> + <actionGroup ref="AdminAssertTaxRateInGridActionGroup" stepKey="verifyTaxRateRowImport1"> + <argument name="taxIdentifier" value="{{import_rate_1.code}}"/> + <argument name="country" value="{{import_rate_1.tax_country}}"/> + <argument name="region" value="{{import_rate_1.tax_region}}"/> + <argument name="zip" value="{{import_rate_1.tax_postcode}}"/> + <argument name="rate" value="{{import_rate_1.rate}}"/> + </actionGroup> + <actionGroup ref="AdminFilterLegacyGridActionGroup" stepKey="filterGridImport2"> + <argument name="field" value="{{AdminLegacyDataGridFilterSection.inputFieldByNameAttr('code')}}"/> + <argument name="value" value="{{import_rate_2.code}}"/> + </actionGroup> + <actionGroup ref="AdminAssertTaxRateInGridActionGroup" stepKey="verifyTaxRateRowImport2"> + <argument name="taxIdentifier" value="{{import_rate_2.code}}"/> + <argument name="country" value="{{import_rate_2.tax_country}}"/> + <argument name="region" value="{{import_rate_2.tax_region}}"/> + <argument name="zip" value="{{import_rate_2.tax_postcode}}"/> + <argument name="rate" value="{{import_rate_2.rate}}"/> + </actionGroup> + + <!-- Delete/Revert Data --> + <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="navigateToTaxRatesPage2"/> + <createData entity="US_CA_Rate_1" stepKey="revertInitialTaxRateCA"/> + <createData entity="US_NY_Rate_1" stepKey="revertInitialTaxRateNY"/> + <actionGroup ref="AdminDeleteMultipleTaxRatesActionGroup" stepKey="deleteAllNonDefaultTaxRates"/> + + <!-- Import Tax Rates from Tax Rule Page --> + <actionGroup ref="AdminGoToNewTaxRulePageActionGroup" stepKey="navigateToTaxRulePage"/> + <actionGroup ref="AdminImportTaxRatesActionGroup" stepKey="importTaxRates2"> + <argument name="file" value="{{import_tax_rates.filename}}"/> + </actionGroup> + + <!-- Verify Imported Tax Rates --> + <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="navigateToTaxRatesPage3"/> + <actionGroup ref="AdminFilterLegacyGridActionGroup" stepKey="filterGridCA2"> + <argument name="field" value="{{AdminLegacyDataGridFilterSection.inputFieldByNameAttr('code')}}"/> + <argument name="value" value="{{US_CA_Rate_1.code}}"/> + </actionGroup> + <actionGroup ref="AdminAssertTaxRateInGridActionGroup" stepKey="verifyTaxRateRowCA2"> + <argument name="taxIdentifier" value="{{US_CA_Rate_1.code}}"/> + <argument name="country" value="{{US_CA_Rate_1.tax_country}}"/> + <argument name="region" value="{{US_CA_Rate_1.tax_region}}"/> + <argument name="zip" value="{{US_CA_Rate_1.tax_postcode}}"/> + <argument name="rate" value="10.25"/> + </actionGroup> + <actionGroup ref="AdminFilterLegacyGridActionGroup" stepKey="filterGridImport3"> + <argument name="field" value="{{AdminLegacyDataGridFilterSection.inputFieldByNameAttr('code')}}"/> + <argument name="value" value="{{import_rate_1.code}}"/> + </actionGroup> + <actionGroup ref="AdminAssertTaxRateInGridActionGroup" stepKey="verifyTaxRateRowImport3"> + <argument name="taxIdentifier" value="{{import_rate_1.code}}"/> + <argument name="country" value="{{import_rate_1.tax_country}}"/> + <argument name="region" value="{{import_rate_1.tax_region}}"/> + <argument name="zip" value="{{import_rate_1.tax_postcode}}"/> + <argument name="rate" value="{{import_rate_1.rate}}"/> + </actionGroup> + <actionGroup ref="AdminFilterLegacyGridActionGroup" stepKey="filterGridImport4"> + <argument name="field" value="{{AdminLegacyDataGridFilterSection.inputFieldByNameAttr('code')}}"/> + <argument name="value" value="{{import_rate_2.code}}"/> + </actionGroup> + <actionGroup ref="AdminAssertTaxRateInGridActionGroup" stepKey="verifyTaxRateRowImport4"> + <argument name="taxIdentifier" value="{{import_rate_2.code}}"/> + <argument name="country" value="{{import_rate_2.tax_country}}"/> + <argument name="region" value="{{import_rate_2.tax_region}}"/> + <argument name="zip" value="{{import_rate_2.tax_postcode}}"/> + <argument name="rate" value="{{import_rate_2.rate}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/TaxImportExport/view/adminhtml/templates/importExport.phtml b/app/code/Magento/TaxImportExport/view/adminhtml/templates/importExport.phtml index 35b2ce454d3c..be81f68ecab7 100644 --- a/app/code/Magento/TaxImportExport/view/adminhtml/templates/importExport.phtml +++ b/app/code/Magento/TaxImportExport/view/adminhtml/templates/importExport.phtml @@ -46,7 +46,7 @@ timeout: false }); - $(this.form).submit(); + $(this.form).trigger('submit'); } else { uiAlert({ content: $.mage.__('Please select a file to import!') diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCss.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCss.php index 40bbc8f51d20..fd8b2f91e164 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCss.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCss.php @@ -6,15 +6,54 @@ */ namespace Magento\Theme\Controller\Adminhtml\System\Design\Theme; +use Magento\Backend\App\Action\Context; +use Magento\Framework\App\Action\HttpGetActionInterface; +use Magento\Framework\App\Response\Http\FileFactory; use Magento\Framework\App\ResponseInterface; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Escaper; +use Magento\Framework\Filesystem; +use Magento\Framework\Registry; +use Magento\Framework\Url\DecoderInterface; +use Magento\Framework\View\Asset\Repository; +use Magento\Framework\View\Design\ThemeInterface; +use Magento\Theme\Controller\Adminhtml\System\Design\Theme; +use Psr\Log\LoggerInterface; /** - * Class DownloadCss + * Class for Download Css. * @deprecated 100.2.0 + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings(PHPMD.Superglobals) */ -class DownloadCss extends \Magento\Theme\Controller\Adminhtml\System\Design\Theme +class DownloadCss extends Theme implements HttpGetActionInterface { + /** + * @var Escaper + */ + private $escaper; + + /** + * DownloadCss constructor. + * @param Context $context + * @param Registry $coreRegistry + * @param FileFactory $fileFactory + * @param Repository $assetRepo + * @param Filesystem $appFileSystem + * @param Escaper|null $escaper + */ + public function __construct( + Context $context, + Registry $coreRegistry, + FileFactory $fileFactory, + Repository $assetRepo, + Filesystem $appFileSystem, + Escaper $escaper = null + ) { + $this->escaper = $escaper ?? $context->getObjectManager()->get(Escaper::class); + parent::__construct($context, $coreRegistry, $fileFactory, $assetRepo, $appFileSystem); + } + /** * Download css file * @@ -25,20 +64,19 @@ public function execute() $themeId = $this->getRequest()->getParam('theme_id'); $file = $this->getRequest()->getParam('file'); - /** @var $urlDecoder \Magento\Framework\Url\DecoderInterface */ - $urlDecoder = $this->_objectManager->get(\Magento\Framework\Url\DecoderInterface::class); + /** @var $urlDecoder DecoderInterface */ + $urlDecoder = $this->_objectManager->get(DecoderInterface::class); $fileId = $urlDecoder->decode($file); try { - /** @var $theme \Magento\Framework\View\Design\ThemeInterface */ - $theme = $this->_objectManager->create( - \Magento\Framework\View\Design\ThemeInterface::class - )->load($themeId); + /** @var $theme ThemeInterface */ + $theme = $this->_objectManager->create(ThemeInterface::class)->load($themeId); if (!$theme->getId()) { - throw new \InvalidArgumentException(sprintf('Theme not found: "%1".', $themeId)); + throw new \InvalidArgumentException(sprintf('Theme not found: "%d".', $themeId)); } $asset = $this->_assetRepo->createAsset($fileId, ['themeModel' => $theme]); $relPath = $this->_appFileSystem->getDirectoryRead(DirectoryList::ROOT) ->getRelativePath($asset->getSourceFile()); + return $this->_fileFactory->create( $relPath, [ @@ -47,10 +85,14 @@ public function execute() ], DirectoryList::ROOT ); + } catch (\InvalidArgumentException $e) { + $this->messageManager->addException($e, __('Theme not found: "%1".', $this->escaper->escapeHtml($themeId))); + $this->getResponse()->setRedirect($this->_redirect->getRefererUrl()); + $this->_objectManager->get(LoggerInterface::class)->critical($e); } catch (\Exception $e) { - $this->messageManager->addException($e, __('File not found: "%1".', $fileId)); + $this->messageManager->addException($e, __('File not found: "%1".', $this->escaper->escapeHtml($fileId))); $this->getResponse()->setRedirect($this->_redirect->getRefererUrl()); - $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); + $this->_objectManager->get(LoggerInterface::class)->critical($e); } } } diff --git a/app/code/Magento/Theme/Controller/Result/MessagePlugin.php b/app/code/Magento/Theme/Controller/Result/MessagePlugin.php index 10cba6e86903..20d0165e8474 100644 --- a/app/code/Magento/Theme/Controller/Result/MessagePlugin.php +++ b/app/code/Magento/Theme/Controller/Result/MessagePlugin.php @@ -5,12 +5,12 @@ */ namespace Magento\Theme\Controller\Result; -use Magento\Framework\App\ObjectManager; use Magento\Framework\Controller\Result\Json; use Magento\Framework\Controller\ResultInterface; use Magento\Framework\Message\MessageInterface; use Magento\Framework\Translate\Inline\ParserInterface; use Magento\Framework\Translate\InlineInterface; +use Magento\Framework\Session\Config\ConfigInterface; /** * Plugin for putting messages to cookies @@ -54,29 +54,36 @@ class MessagePlugin */ private $inlineTranslate; + /** + * @var ConfigInterface + */ + protected $sessionConfig; + /** * @param \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager * @param \Magento\Framework\Stdlib\Cookie\CookieMetadataFactory $cookieMetadataFactory * @param \Magento\Framework\Message\ManagerInterface $messageManager * @param \Magento\Framework\View\Element\Message\InterpretationStrategyInterface $interpretationStrategy - * @param \Magento\Framework\Serialize\Serializer\Json|null $serializer - * @param InlineInterface|null $inlineTranslate + * @param \Magento\Framework\Serialize\Serializer\Json $serializer + * @param InlineInterface $inlineTranslate + * @param ConfigInterface $sessionConfig */ public function __construct( \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager, \Magento\Framework\Stdlib\Cookie\CookieMetadataFactory $cookieMetadataFactory, \Magento\Framework\Message\ManagerInterface $messageManager, \Magento\Framework\View\Element\Message\InterpretationStrategyInterface $interpretationStrategy, - \Magento\Framework\Serialize\Serializer\Json $serializer = null, - InlineInterface $inlineTranslate = null + \Magento\Framework\Serialize\Serializer\Json $serializer, + InlineInterface $inlineTranslate, + ConfigInterface $sessionConfig ) { $this->cookieManager = $cookieManager; $this->cookieMetadataFactory = $cookieMetadataFactory; $this->messageManager = $messageManager; - $this->serializer = $serializer ?: ObjectManager::getInstance() - ->get(\Magento\Framework\Serialize\Serializer\Json::class); + $this->serializer = $serializer; $this->interpretationStrategy = $interpretationStrategy; - $this->inlineTranslate = $inlineTranslate ?: ObjectManager::getInstance()->get(InlineInterface::class); + $this->inlineTranslate = $inlineTranslate; + $this->sessionConfig = $sessionConfig; } /** @@ -132,8 +139,9 @@ private function setCookie(array $messages) $publicCookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata(); $publicCookieMetadata->setDurationOneYear(); - $publicCookieMetadata->setPath('/'); + $publicCookieMetadata->setPath($this->sessionConfig->getCookiePath()); $publicCookieMetadata->setHttpOnly(false); + $publicCookieMetadata->setSameSite('Strict'); $this->cookieManager->setPublicCookie( self::MESSAGES_COOKIES_NAME, diff --git a/app/code/Magento/Theme/Model/Design.php b/app/code/Magento/Theme/Model/Design.php index ddd4894f4e87..11cef8a3938e 100644 --- a/app/code/Magento/Theme/Model/Design.php +++ b/app/code/Magento/Theme/Model/Design.php @@ -111,6 +111,8 @@ public function loadChange($storeId, $date = null) $date = $this->_dateTime->formatDate($this->_localeDate->scopeTimeStamp($storeId), false); } + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $changeCacheId = 'design_change_' . md5($storeId . $date); $result = $this->_cacheManager->load($changeCacheId); if ($result === false) { diff --git a/app/code/Magento/Theme/Model/Indexer/Design/Config.php b/app/code/Magento/Theme/Model/Indexer/Design/Config.php index 43b58257b343..94aa948a9122 100644 --- a/app/code/Magento/Theme/Model/Indexer/Design/Config.php +++ b/app/code/Magento/Theme/Model/Indexer/Design/Config.php @@ -56,6 +56,11 @@ class Config implements ActionInterface */ protected $handlerPool; + /** + * @var array + */ + private $data = []; + /** * Config constructor * diff --git a/app/code/Magento/Theme/Model/View/Design.php b/app/code/Magento/Theme/Model/View/Design.php index 98f7665400dd..f45b6b233a6a 100644 --- a/app/code/Magento/Theme/Model/View/Design.php +++ b/app/code/Magento/Theme/Model/View/Design.php @@ -73,6 +73,11 @@ class Design implements \Magento\Framework\View\DesignInterface */ protected $_appState; + /** + * @var array + */ + private $_themes; + /** * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\View\Design\Theme\FlyweightFactory $flyweightFactory diff --git a/app/code/Magento/Theme/Test/Mftf/ActionGroup/AdminClickViewThemeActionGroup.xml b/app/code/Magento/Theme/Test/Mftf/ActionGroup/AdminClickViewThemeActionGroup.xml new file mode 100644 index 000000000000..2b6a2ed8aea6 --- /dev/null +++ b/app/code/Magento/Theme/Test/Mftf/ActionGroup/AdminClickViewThemeActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickViewThemeActionGroup"> + <annotations> + <description>Clicks on 'View' action of one theme on the themes grid.</description> + </annotations> + <click selector="{{AdminThemeSection.viewAction}}" stepKey="clickViewTheme"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Theme/Test/Mftf/Data/ThemeData.xml b/app/code/Magento/Theme/Test/Mftf/Data/ThemeData.xml new file mode 100644 index 000000000000..25ff37c787c6 --- /dev/null +++ b/app/code/Magento/Theme/Test/Mftf/Data/ThemeData.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="MagentoBlankTheme"> + <data key="pageTitle">Theme: Magento Blank</data> + <data key="themePath">Magento/blank</data> + <data key="themeTitle">Magento Blank</data> + </entity> +</entities> diff --git a/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSection.xml b/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSection.xml index 1a0bb738bc9c..a4ed84497558 100644 --- a/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSection.xml +++ b/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSection.xml @@ -18,5 +18,6 @@ <element name="gridCell" type="text" selector="//table//div[contains(text(), '{{gridCellText}}')]" parameterized="true"/> <element name="gridCellUpdated" type="text" selector="//tbody//tr//div[contains(text(), '{{gridCellText}}')]" parameterized="true"/> <element name="columnHeader" type="text" selector="//thead/tr/th[contains(@class, 'data-grid-th')]/span[text() = '{{label}}']" parameterized="true" timeout="30"/> + <element name="viewAction" type="button" selector="tr.data-row > td.data-grid-actions-cell > a.action-menu-item"/> </section> </sections> diff --git a/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSettingsSection.xml b/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSettingsSection.xml new file mode 100644 index 000000000000..e5dbdabc6f53 --- /dev/null +++ b/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSettingsSection.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminThemeSettingsSection"> + <element name="themePath" type="text" selector=".field-theme_path"/> + <element name="themeTitle" type="text" selector=".field-theme_title"/> + <element name="themePreviewImage" type="text" selector="//div[contains(@class, 'field-preview_image')]//label//span[contains(text(), 'Theme Preview Image')]"/> + </section> +</sections> diff --git a/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemesEditTest.xml b/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemesEditTest.xml new file mode 100644 index 000000000000..a6dba32d83ff --- /dev/null +++ b/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemesEditTest.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminContentThemesEditTest"> + <annotations> + <features value="Theme"/> + <stories value="Menu Navigation"/> + <title value="Admin content themes edit test"/> + <description value="Admin should be able to view a theme"/> + <severity value="CRITICAL"/> + <group value="menu"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToContentThemesPage"> + <argument name="menuUiId" value="{{AdminMenuContent.dataUiId}}"/> + <argument name="submenuUiId" value="{{AdminMenuContentDesignThemes.dataUiId}}"/> + </actionGroup> + <actionGroup ref="AdminAssertPageTitleActionGroup" stepKey="seePageTitle"> + <argument name="title" value="{{AdminMenuContentDesignThemes.pageTitle}}"/> + </actionGroup> + + <actionGroup ref="AdminClickViewThemeActionGroup" stepKey="editTheme"/> + + <actionGroup ref="AdminAssertPageTitleActionGroup" stepKey="seeEditPageTitle"> + <argument name="title" value="{{MagentoBlankTheme.pageTitle}}"/> + </actionGroup> + + <see selector="{{AdminThemeSettingsSection.themePath}}" userInput="{{MagentoBlankTheme.themePath}}" stepKey="assertThemePath"/> + <see selector="{{AdminThemeSettingsSection.themeTitle}}" userInput="{{MagentoBlankTheme.themeTitle}}" stepKey="assertThemeTitle"/> + <seeElementInDOM selector="{{AdminThemeSettingsSection.themePreviewImage}}" stepKey="seeThemePreviewImage"/> + </test> +</tests> diff --git a/app/code/Magento/Theme/Test/Mftf/Test/AdminWatermarkUploadTest.xml b/app/code/Magento/Theme/Test/Mftf/Test/AdminWatermarkUploadTest.xml index fbe1d5ac936d..6895e167e206 100644 --- a/app/code/Magento/Theme/Test/Mftf/Test/AdminWatermarkUploadTest.xml +++ b/app/code/Magento/Theme/Test/Mftf/Test/AdminWatermarkUploadTest.xml @@ -10,15 +10,12 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminWatermarkUploadTest"> <annotations> - <features value="Watermark"/> + <features value="Theme"/> <stories value="Watermark"/> - <title value="MAGETWO-95934: Can't upload Watermark Image"/> + <title value="Can't upload Watermark Image"/> <description value="Watermark images should be able to be uploaded in the admin"/> <severity value="MAJOR"/> - <testCaseId value="MC-5796"/> - <skip> - <issueId value="MC-18496"/> - </skip> + <testCaseId value="MC-25636"/> <group value="Watermark"/> </annotations> <before> diff --git a/app/code/Magento/Theme/Test/Unit/Block/Adminhtml/Design/Config/Edit/SaveButtonTest.php b/app/code/Magento/Theme/Test/Unit/Block/Adminhtml/Design/Config/Edit/SaveButtonTest.php index b7f2def1c0fb..2a92be231cbf 100644 --- a/app/code/Magento/Theme/Test/Unit/Block/Adminhtml/Design/Config/Edit/SaveButtonTest.php +++ b/app/code/Magento/Theme/Test/Unit/Block/Adminhtml/Design/Config/Edit/SaveButtonTest.php @@ -17,6 +17,9 @@ class SaveButtonTest extends TestCase */ protected $block; + /** + * @inheritDoc + */ protected function setUp(): void { $this->block = new SaveButton(); diff --git a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DownloadCssTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DownloadCssTest.php index b3dc485293e9..fadaa1a69278 100644 --- a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DownloadCssTest.php +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DownloadCssTest.php @@ -14,6 +14,7 @@ use Magento\Framework\App\Response\RedirectInterface; use Magento\Framework\App\ResponseInterface; use Magento\Framework\Controller\ResultFactory; +use Magento\Framework\Escaper; use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Directory\ReadInterface; use Magento\Framework\Message\ManagerInterface; @@ -88,6 +89,11 @@ class DownloadCssTest extends TestCase */ protected $controller; + /** + * @var Escaper|MockObject + */ + private $escaperMock; + protected function setUp(): void { $context = $this->getMockBuilder(Context::class) @@ -139,6 +145,9 @@ protected function setUp(): void $this->filesystem = $this->getMockBuilder(Filesystem::class) ->disableOriginalConstructor() ->getMock(); + $this->escaperMock = $this->getMockBuilder(Escaper::class) + ->disableOriginalConstructor() + ->getMock(); /** @var Context $context */ $this->controller = new DownloadCss( @@ -146,7 +155,8 @@ protected function setUp(): void $this->registry, $this->fileFactory, $this->repository, - $this->filesystem + $this->filesystem, + $this->escaperMock ); } @@ -274,6 +284,7 @@ public function testExecuteInvalidArgument() $this->response->expects($this->once()) ->method('setRedirect') ->with($refererUrl); + $this->escaperMock->expects($this->once())->method('escapeHtml')->with($themeId)->willReturn($themeId); $this->controller->execute(); } diff --git a/app/code/Magento/Theme/Test/Unit/Controller/Result/MessagePluginTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Result/MessagePluginTest.php index 2824d9a27174..5f365e6a82ea 100644 --- a/app/code/Magento/Theme/Test/Unit/Controller/Result/MessagePluginTest.php +++ b/app/code/Magento/Theme/Test/Unit/Controller/Result/MessagePluginTest.php @@ -16,6 +16,7 @@ use Magento\Framework\Stdlib\Cookie\PublicCookieMetadata; use Magento\Framework\Stdlib\CookieManagerInterface; use Magento\Framework\Translate\InlineInterface; +use Magento\Framework\Session\Config\ConfigInterface; use Magento\Framework\View\Element\Message\InterpretationStrategyInterface; use Magento\Theme\Controller\Result\MessagePlugin; use PHPUnit\Framework\MockObject\MockObject; @@ -47,6 +48,11 @@ class MessagePluginTest extends TestCase /** @var InlineInterface|MockObject */ private $inlineTranslateMock; + /** + * @var ConfigInterface|MockObject + */ + protected $sessionConfigMock; + protected function setUp(): void { $this->cookieManagerMock = $this->getMockBuilder(CookieManagerInterface::class) @@ -62,6 +68,8 @@ protected function setUp(): void ->getMock(); $this->inlineTranslateMock = $this->getMockBuilder(InlineInterface::class) ->getMockForAbstractClass(); + $this->sessionConfigMock = $this->getMockBuilder(ConfigInterface::class) + ->getMockForAbstractClass(); $this->model = new MessagePlugin( $this->cookieManagerMock, @@ -69,7 +77,8 @@ protected function setUp(): void $this->managerMock, $this->interpretationStrategyMock, $this->serializerMock, - $this->inlineTranslateMock + $this->inlineTranslateMock, + $this->sessionConfigMock ); } @@ -549,4 +558,49 @@ function ($data) { $this->assertEquals($resultMock, $this->model->afterRenderResult($resultMock, $resultMock)); } + + public function testSetCookieWithCookiePath() + { + /** @var Redirect|MockObject $resultMock */ + $resultMock = $this->getMockBuilder(Redirect::class) + ->disableOriginalConstructor() + ->getMock(); + + /** @var PublicCookieMetadata|MockObject $cookieMetadataMock */ + $cookieMetadataMock = $this->getMockBuilder(PublicCookieMetadata::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->cookieMetadataFactoryMock->expects($this->once()) + ->method('createPublicCookieMetadata') + ->willReturn($cookieMetadataMock); + + /** @var MessageInterface|MockObject $messageMock */ + $messageMock = $this->getMockBuilder(MessageInterface::class) + ->getMock(); + + /** @var Collection|MockObject $collectionMock */ + $collectionMock = $this->getMockBuilder(Collection::class) + ->disableOriginalConstructor() + ->getMock(); + $collectionMock->expects($this->once()) + ->method('getItems') + ->willReturn([$messageMock]); + + $this->managerMock->expects($this->once()) + ->method('getMessages') + ->with(true, null) + ->willReturn($collectionMock); + + /* Test that getCookiePath is called during cookie setup */ + $this->sessionConfigMock->expects($this->once()) + ->method('getCookiePath') + ->willReturn('/pub'); + $cookieMetadataMock->expects($this->once()) + ->method('setPath') + ->with('/pub') + ->willReturn($cookieMetadataMock); + + $this->model->afterRenderResult($resultMock, $resultMock); + } } diff --git a/app/code/Magento/Theme/Test/Unit/Model/ConfigTest.php b/app/code/Magento/Theme/Test/Unit/Model/ConfigTest.php index c3c3c5d77160..95032a40877a 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/ConfigTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/ConfigTest.php @@ -100,7 +100,6 @@ protected function tearDown(): void { $this->_themeMock = null; $this->_configData = null; - $this->_themeFactoryMock = null; $this->_configCacheMock = null; $this->_layoutCacheMock = null; $this->_model = null; diff --git a/app/code/Magento/Theme/Test/Unit/Model/Theme/DataTest.php b/app/code/Magento/Theme/Test/Unit/Model/Theme/DataTest.php index fa6e51ecdf27..9f20fb77d7b7 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Theme/DataTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Theme/DataTest.php @@ -17,6 +17,7 @@ use Magento\Theme\Model\Config\Customization; use Magento\Theme\Model\ResourceModel\Theme\Collection; use Magento\Theme\Model\Theme\Data; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; /** @@ -29,43 +30,46 @@ class DataTest extends TestCase */ protected $model; + /** + * @inheritDoc + */ protected function setUp(): void { $customizationConfig = $this->createMock(Customization::class); - $this->customizationFactory = $this->createPartialMock( + $customizationFactory = $this->createPartialMock( \Magento\Framework\View\Design\Theme\CustomizationFactory::class, ['create'] ); - $this->resourceCollection = $this->createMock(Collection::class); - $this->_imageFactory = $this->createPartialMock( + $resourceCollection = $this->createMock(Collection::class); + $imageFactory = $this->createPartialMock( ImageFactory::class, ['create'] ); - $this->themeFactory = $this->createPartialMock( + $themeFactory = $this->createPartialMock( FlyweightFactory::class, ['create'] ); - $this->domainFactory = $this->createPartialMock( + $domainFactory = $this->createPartialMock( Factory::class, ['create'] ); - $this->themeModelFactory = $this->createPartialMock(\Magento\Theme\Model\ThemeFactory::class, ['create']); - $this->validator = $this->createMock(Validator::class); - $this->appState = $this->createMock(State::class); + $themeModelFactory = $this->createPartialMock(\Magento\Theme\Model\ThemeFactory::class, ['create']); + $validator = $this->createMock(Validator::class); + $appState = $this->createMock(State::class); $objectManagerHelper = new ObjectManager($this); $arguments = $objectManagerHelper->getConstructArguments( Data::class, [ - 'customizationFactory' => $this->customizationFactory, + 'customizationFactory' => $customizationFactory, 'customizationConfig' => $customizationConfig, - 'imageFactory' => $this->_imageFactory, - 'resourceCollection' => $this->resourceCollection, - 'themeFactory' => $this->themeFactory, - 'domainFactory' => $this->domainFactory, - 'validator' => $this->validator, - 'appState' => $this->appState, - 'themeModelFactory' => $this->themeModelFactory + 'imageFactory' => $imageFactory, + 'resourceCollection' => $resourceCollection, + 'themeFactory' => $themeFactory, + 'domainFactory' => $domainFactory, + 'validator' => $validator, + 'appState' => $appState, + 'themeModelFactory' => $themeModelFactory ] ); diff --git a/app/code/Magento/Theme/Test/Unit/Model/Theme/Image/PathTest.php b/app/code/Magento/Theme/Test/Unit/Model/Theme/Image/PathTest.php index c06bb6a4f4a3..79e7a1139511 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Theme/Image/PathTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Theme/Image/PathTest.php @@ -50,6 +50,9 @@ class PathTest extends TestCase */ protected $mediaDirectory; + /** + * @inheritDoc + */ protected function setUp(): void { $this->filesystem = $this->createMock(Filesystem::class); @@ -71,8 +74,6 @@ protected function setUp(): void $this->_assetRepo, $this->_storeManager ); - - $this->_model = new Path($this->filesystem, $this->_assetRepo, $this->_storeManager); } public function testGetPreviewImageUrl() diff --git a/app/code/Magento/Theme/Test/Unit/ViewModel/Block/Html/Header/LogoSizeResolverTest.php b/app/code/Magento/Theme/Test/Unit/ViewModel/Block/Html/Header/LogoSizeResolverTest.php new file mode 100644 index 000000000000..9f6d5b08a7b9 --- /dev/null +++ b/app/code/Magento/Theme/Test/Unit/ViewModel/Block/Html/Header/LogoSizeResolverTest.php @@ -0,0 +1,81 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Theme\Test\Unit\ViewModel\Block\Html\Header; + +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Store\Model\ScopeInterface; +use Magento\Theme\ViewModel\Block\Html\Header\LogoSizeResolver; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test logo size resolver view model + */ +class LogoSizeResolverTest extends TestCase +{ + /** + * @var ScopeConfigInterface|MockObject + */ + private $scopeConfig; + + /** + * @var LogoSizeResolver + */ + private $model; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->scopeConfig = $this->createMock(ScopeConfigInterface::class); + $this->model = new LogoSizeResolver($this->scopeConfig); + } + + /** + * @param string|null $configValue + * @param int|null $expectedValue + * @dataProvider configValueDataProvider + */ + public function testGetWidth(?string $configValue, ?int $expectedValue): void + { + $storeId = 1; + $this->scopeConfig->method('getValue') + ->with('design/header/logo_width', ScopeInterface::SCOPE_STORE, $storeId) + ->willReturn($configValue); + $this->assertEquals($expectedValue, $this->model->getWidth($storeId)); + } + + /** + * @param string|null $configValue + * @param int|null $expectedValue + * @dataProvider configValueDataProvider + */ + public function testGetHeight(?string $configValue, ?int $expectedValue): void + { + $storeId = 1; + $this->scopeConfig->method('getValue') + ->with('design/header/logo_height', ScopeInterface::SCOPE_STORE, $storeId) + ->willReturn($configValue); + $this->assertEquals($expectedValue, $this->model->getHeight($storeId)); + } + + /** + * @return array + */ + public function configValueDataProvider(): array + { + return [ + [null, null], + ['', null], + ['0', 0], + ['180', 180], + ]; + } +} diff --git a/app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoSizeResolver.php b/app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoSizeResolver.php new file mode 100644 index 000000000000..24d7fa3f7ab9 --- /dev/null +++ b/app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoSizeResolver.php @@ -0,0 +1,75 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Theme\ViewModel\Block\Html\Header; + +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\View\Element\Block\ArgumentInterface; +use Magento\Store\Model\ScopeInterface; + +/** + * Logo size resolver view model + */ +class LogoSizeResolver implements LogoSizeResolverInterface, ArgumentInterface +{ + /** + * Logo width config path + */ + private const XML_PATH_DESIGN_HEADER_LOGO_WIDTH = 'design/header/logo_width'; + + /** + * Logo height config path + */ + private const XML_PATH_DESIGN_HEADER_LOGO_HEIGHT = 'design/header/logo_height'; + + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * @param ScopeConfigInterface $scopeConfig + */ + public function __construct( + ScopeConfigInterface $scopeConfig + ) { + $this->scopeConfig = $scopeConfig; + } + + /** + * @inheritdoc + */ + public function getWidth(?int $storeId = null): ?int + { + return $this->getConfig(self::XML_PATH_DESIGN_HEADER_LOGO_WIDTH, $storeId); + } + + /** + * @inheritdoc + */ + public function getHeight(?int $storeId = null): ?int + { + return $this->getConfig(self::XML_PATH_DESIGN_HEADER_LOGO_HEIGHT, $storeId); + } + + /** + * Get config value + * + * @param string $path + * @param int|null $storeId + * @return int|null + */ + private function getConfig(string $path, ?int $storeId = null): ?int + { + $value = $this->scopeConfig->getValue( + $path, + ScopeInterface::SCOPE_STORE, + $storeId + ); + return $value === null ? null : (int) $value; + } +} diff --git a/app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoSizeResolverInterface.php b/app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoSizeResolverInterface.php new file mode 100644 index 000000000000..4889aff74fd9 --- /dev/null +++ b/app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoSizeResolverInterface.php @@ -0,0 +1,30 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Theme\ViewModel\Block\Html\Header; + +/** + * Interface for resolving logo size + */ +interface LogoSizeResolverInterface +{ + /** + * Return configured logo width + * + * @param int|null $storeId + * @return null|int + */ + public function getWidth(?int $storeId = null): ?int; + + /** + * Return configured logo height + * + * @param int|null $storeId + * @return null|int + */ + public function getHeight(?int $storeId = null): ?int; +} diff --git a/app/code/Magento/Theme/etc/frontend/di.xml b/app/code/Magento/Theme/etc/frontend/di.xml index 35eb9d4f8b53..f0b7f19911e1 100644 --- a/app/code/Magento/Theme/etc/frontend/di.xml +++ b/app/code/Magento/Theme/etc/frontend/di.xml @@ -27,7 +27,7 @@ <plugin name="result-messages" type="Magento\Theme\Controller\Result\MessagePlugin"/> </type> <type name="Magento\Framework\View\Result\Layout"> - <plugin name="asyncCssLoad" type="Magento\Theme\Controller\Result\AsyncCssPlugin" /> + <plugin name="asyncCssLoad" type="Magento\Theme\Controller\Result\AsyncCssPlugin" sortOrder="-20" /> <plugin name="deferJsToFooter" type="Magento\Theme\Controller\Result\JsFooterPlugin" sortOrder="-10" /> </type> <type name="Magento\Theme\Block\Html\Header\CriticalCss"> diff --git a/app/code/Magento/Theme/view/adminhtml/templates/browser/content/uploader.phtml b/app/code/Magento/Theme/view/adminhtml/templates/browser/content/uploader.phtml index 66456ae40381..1e23c7aadc46 100644 --- a/app/code/Magento/Theme/view/adminhtml/templates/browser/content/uploader.phtml +++ b/app/code/Magento/Theme/view/adminhtml/templates/browser/content/uploader.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Theme\Block\Adminhtml\Wysiwyg\Files\Content\Uploader */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> diff --git a/app/code/Magento/Theme/view/adminhtml/templates/tabs/css.phtml b/app/code/Magento/Theme/view/adminhtml/templates/tabs/css.phtml index 53228243ffd1..827a00f9220c 100644 --- a/app/code/Magento/Theme/view/adminhtml/templates/tabs/css.phtml +++ b/app/code/Magento/Theme/view/adminhtml/templates/tabs/css.phtml @@ -34,10 +34,10 @@ require([ add: function (e, data) { var uploadButton = $('#css_uploader_button'); /** Unbind click event on file change */ - uploadButton.unbind('click'); - uploadButton.removeAttr('disabled'); + uploadButton.off('click'); + uploadButton.prop('disabled', false); - uploadButton.click(function () { + uploadButton.on('click', function () { $('#messages').html(''); $(this).attr('disabled', 'disabled'); data.submit(); diff --git a/app/code/Magento/Theme/view/adminhtml/templates/tabs/fieldset/js.phtml b/app/code/Magento/Theme/view/adminhtml/templates/tabs/fieldset/js.phtml index e15ac4a088e0..1d2948398e7c 100644 --- a/app/code/Magento/Theme/view/adminhtml/templates/tabs/fieldset/js.phtml +++ b/app/code/Magento/Theme/view/adminhtml/templates/tabs/fieldset/js.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** * @var $block \Magento\Backend\Block\Widget\Form\Renderer\Fieldset * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer diff --git a/app/code/Magento/Theme/view/adminhtml/templates/tabs/js.phtml b/app/code/Magento/Theme/view/adminhtml/templates/tabs/js.phtml index 4edc895c559e..a02f9e50cf23 100644 --- a/app/code/Magento/Theme/view/adminhtml/templates/tabs/js.phtml +++ b/app/code/Magento/Theme/view/adminhtml/templates/tabs/js.phtml @@ -57,9 +57,9 @@ require([ }); var uploadButton = $('#js_uploader_button'); - uploadButton.removeAttr('disabled'); + uploadButton.prop('disabled', false); - uploadButton.click(function () { + uploadButton.on('click', function () { $('#messages').html(''); $(this).attr('disabled', 'disabled'); @@ -121,10 +121,10 @@ require([ } }); - $('#js_files_uploader').click(function () { + $('#js_files_uploader').on('click', function () { /** Unbind click event on file change */ $('#js-file-uploader').html(''); - $('#js_uploader_button').unbind('click'); + $('#js_uploader_button').off('click'); }); diff --git a/app/code/Magento/Theme/view/adminhtml/web/template/form/button-field.html b/app/code/Magento/Theme/view/adminhtml/web/template/form/button-field.html index ebba9eb28a7d..11e20ac29a94 100644 --- a/app/code/Magento/Theme/view/adminhtml/web/template/form/button-field.html +++ b/app/code/Magento/Theme/view/adminhtml/web/template/form/button-field.html @@ -9,7 +9,7 @@ css="$data.additionalClasses" attr="'data-index': index"> <label class="admin__field-label"> - <span text="label"/> + <span text="label"></span> </label> <div class="admin__field-control" @@ -17,7 +17,7 @@ <render args="tooltipTpl" if="$data.tooltip"/> <render args="buttonTpl" /> <div class="admin__field-note" if="$data.notice"> - <span text="notice"/> + <span text="notice"></span> </div> </div> </div> diff --git a/app/code/Magento/Theme/view/frontend/layout/default.xml b/app/code/Magento/Theme/view/frontend/layout/default.xml index f3e57b12150c..933d4e588787 100644 --- a/app/code/Magento/Theme/view/frontend/layout/default.xml +++ b/app/code/Magento/Theme/view/frontend/layout/default.xml @@ -54,6 +54,7 @@ <block class="Magento\Theme\Block\Html\Header\Logo" name="logo"> <arguments> <argument name="logoPathResolver" xsi:type="object">Magento\Theme\ViewModel\Block\Html\Header\LogoPathResolver</argument> + <argument name="logo_size_resolver" xsi:type="object">Magento\Theme\ViewModel\Block\Html\Header\LogoSizeResolver</argument> </arguments> </block> </container> diff --git a/app/code/Magento/Theme/view/frontend/templates/html/header.phtml b/app/code/Magento/Theme/view/frontend/templates/html/header.phtml index cbefb82f23e3..c59ca42f5060 100644 --- a/app/code/Magento/Theme/view/frontend/templates/html/header.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/html/header.phtml @@ -6,6 +6,7 @@ /** * @var \Magento\Theme\Block\Html\Header $block + * @var \Magento\Framework\Escaper $escaper */ $welcomeMessage = $block->getWelcome(); ?> @@ -13,12 +14,12 @@ $welcomeMessage = $block->getWelcome(); <li class="greet welcome" data-bind="scope: 'customer'"> <!-- ko if: customer().fullname --> <span class="logged-in" - data-bind="text: new String('<?= $block->escapeHtml(__('Welcome, %1!', '%1')) ?>').replace('%1', customer().fullname)"> + data-bind="text: new String('<?= $escaper->escapeHtml(__('Welcome, %1!', '%1')) ?>').replace('%1', customer().fullname)"> </span> <!-- /ko --> <!-- ko ifnot: customer().fullname --> <span class="not-logged-in" - data-bind='html:"<?= $block->escapeHtml($welcomeMessage) ?>"'></span> + data-bind="html: '<?= $escaper->escapeHtmlAttr($welcomeMessage) ?>'"></span> <?= $block->getBlockHtml('header.additional') ?> <!-- /ko --> </li> diff --git a/app/code/Magento/Theme/view/frontend/templates/html/header/logo.phtml b/app/code/Magento/Theme/view/frontend/templates/html/header/logo.phtml index 99beea5681f2..165f12021bb0 100644 --- a/app/code/Magento/Theme/view/frontend/templates/html/header/logo.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/html/header/logo.phtml @@ -7,7 +7,17 @@ /** * @var \Magento\Theme\Block\Html\Header\Logo $block */ -$storeName = $block->getThemeName() ? $block->getThemeName() : $block->getLogoAlt() +$storeName = $block->getThemeName() ? $block->getThemeName() : $block->getLogoAlt(); +/** + * @var \Magento\Theme\ViewModel\Block\Html\Header\LogoSizeResolverInterface|null $logoSizeResolver + */ +$logoSizeResolver = $block->getLogoSizeResolver(); +$logoWidth = $logoSizeResolver !== null && $logoSizeResolver->getWidth() + ? $logoSizeResolver->getWidth() + : $block->getLogoWidth(); +$logoHeight = $logoSizeResolver !== null && $logoSizeResolver->getHeight() + ? $logoSizeResolver->getHeight() + : $block->getLogoHeight(); ?> <span data-action="toggle-nav" class="action nav-toggle"><span><?= $block->escapeHtml(__('Toggle Nav')) ?></span></span> <a @@ -18,7 +28,7 @@ $storeName = $block->getThemeName() ? $block->getThemeName() : $block->getLogoAl <img src="<?= $block->escapeUrl($block->getLogoSrc()) ?>" title="<?= $block->escapeHtmlAttr($block->getLogoAlt()) ?>" alt="<?= $block->escapeHtmlAttr($block->getLogoAlt()) ?>" - <?= $block->getLogoWidth() ? 'width="' . $block->escapeHtmlAttr($block->getLogoWidth()) . '"' : '' ?> - <?= $block->getLogoHeight() ? 'height="' . $block->escapeHtmlAttr($block->getLogoHeight()) . '"' : '' ?> + <?= $logoWidth ? 'width="' . $block->escapeHtmlAttr($logoWidth) . '"' : '' ?> + <?= $logoHeight ? 'height="' . $block->escapeHtmlAttr($logoHeight) . '"' : '' ?> /> </a> diff --git a/app/code/Magento/Theme/view/frontend/templates/js/cookie_status.phtml b/app/code/Magento/Theme/view/frontend/templates/js/cookie_status.phtml index 7d43ffcbb806..7e354ee52b4e 100644 --- a/app/code/Magento/Theme/view/frontend/templates/js/cookie_status.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/js/cookie_status.phtml @@ -3,18 +3,14 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - -/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ +/** + * @var Magento\Framework\View\Element\Template $block + */ ?> -<div id="cookie-status"> +<div class="cookie-status-message" id="cookie-status"> <?= $block->escapeHtml(__('The store will not work correctly in the case when cookies are disabled.')); ?> </div> -<?php -$script = 'document.querySelector("#cookie-status").style.display = "none";'; -?> -<?= /* @noEscape */ $secureRenderer->renderTag('script', ['type' => 'text/javascript'], $script, false); ?> - <script type="text/x-magento-init"> { "*": { diff --git a/app/code/Magento/Theme/view/frontend/web/js/view/messages.js b/app/code/Magento/Theme/view/frontend/web/js/view/messages.js index 8d2ffed2d3ba..388166b2b166 100644 --- a/app/code/Magento/Theme/view/frontend/web/js/view/messages.js +++ b/app/code/Magento/Theme/view/frontend/web/js/view/messages.js @@ -39,7 +39,10 @@ define([ customerData.set('messages', {}); } - $.cookieStorage.set('mage-messages', ''); + $.mage.cookies.set('mage-messages', '', { + samesite: 'strict', + domain: '' + }); }, /** diff --git a/app/code/Magento/ThemeGraphQl/etc/graphql/di.xml b/app/code/Magento/ThemeGraphQl/etc/graphql/di.xml index 9f55e522bf5a..6ce3b7ec6af2 100644 --- a/app/code/Magento/ThemeGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/ThemeGraphQl/etc/graphql/di.xml @@ -27,4 +27,7 @@ </argument> </arguments> </type> + <type name="Magento\Framework\Data\Collection"> + <plugin name="currentPageDetection" disabled="true"/> + </type> </config> diff --git a/app/code/Magento/Tinymce3/Model/Config/Gallery/Config.php b/app/code/Magento/Tinymce3/Model/Config/Gallery/Config.php deleted file mode 100644 index e525bf62cc3a..000000000000 --- a/app/code/Magento/Tinymce3/Model/Config/Gallery/Config.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\Tinymce3\Model\Config\Gallery; - -use Magento\Ui\Component\Form\Element\DataType\Media\OpenDialogUrl; - -/** - * Class Config adds information about required configurations to display media gallery of tinymce3 editor - * - * @deprecated 100.3.0 use \Magento\Cms\Model\Wysiwyg\DefaultConfigProvider instead - */ -class Config implements \Magento\Framework\Data\Wysiwyg\ConfigProviderInterface -{ - /** - * @var \Magento\Backend\Model\UrlInterface - */ - private $backendUrl; - - /** - * @var OpednDialogUrl - */ - private $openDialogUrl; - - /** - * @param \Magento\Backend\Model\UrlInterface $backendUrl - * @param OpenDialogUrl $openDialogUrl - */ - public function __construct( - \Magento\Backend\Model\UrlInterface $backendUrl, - OpenDialogUrl $openDialogUrl - ) { - $this->backendUrl = $backendUrl; - $this->openDialogUrl = $openDialogUrl; - } - - /** - * Returns media gallery config - * - * @param \Magento\Framework\DataObject $config - * @return \Magento\Framework\DataObject - */ - public function getConfig(\Magento\Framework\DataObject $config) : \Magento\Framework\DataObject - { - $config->addData( - [ - 'add_images' => true, - 'files_browser_window_url' => $this->backendUrl->getUrl($this->openDialogUrl->get()), - ] - ); - - return $config; - } -} diff --git a/app/code/Magento/Tinymce3/Model/Config/Source/Wysiwyg/Editor.php b/app/code/Magento/Tinymce3/Model/Config/Source/Wysiwyg/Editor.php deleted file mode 100644 index 96a3d42d15f3..000000000000 --- a/app/code/Magento/Tinymce3/Model/Config/Source/Wysiwyg/Editor.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\Tinymce3\Model\Config\Source\Wysiwyg; - -/** - * Class Editor provides configuration value for TinyMCE3 editor - * @deprecated 100.3.0 use as configuration value tinymce4 path: mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter - */ -class Editor -{ - /** - * Configuration value for TinyMCE3 editor - * @var string - */ - const WYSIWYG_EDITOR_CONFIG_VALUE = 'Magento_Tinymce3/tinymce3Adapter'; -} diff --git a/app/code/Magento/Tinymce3/Model/Config/Variable/Config.php b/app/code/Magento/Tinymce3/Model/Config/Variable/Config.php deleted file mode 100644 index 97aab0f38c4e..000000000000 --- a/app/code/Magento/Tinymce3/Model/Config/Variable/Config.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -/**le - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -declare(strict_types=1); -namespace Magento\Tinymce3\Model\Config\Variable; - -/** - * Class Config adds variable plugin information required for tinymce3 editor - * @deprecated 100.3.0 use \Magento\Variable\Model\Variable\ConfigProvider instead - */ -class Config implements \Magento\Framework\Data\Wysiwyg\ConfigProviderInterface -{ - /** - * @var \Magento\Framework\View\Asset\Repository - */ - private $assetRepo; - - /** - * @var \Magento\Variable\Model\Variable\Config - */ - private $defaultVariableConfig; - - /** - * @param \Magento\Variable\Model\Variable\Config $defaultVariableConfig - * @param \Magento\Framework\View\Asset\Repository $assetRepo - */ - public function __construct( - \Magento\Variable\Model\Variable\Config $defaultVariableConfig, - \Magento\Framework\View\Asset\Repository $assetRepo - ) { - $this->assetRepo = $assetRepo; - $this->defaultVariableConfig = $defaultVariableConfig; - } - - /** - * Update variable plugin url - * - * @param \Magento\Framework\DataObject $config - * @return \Magento\Framework\DataObject - */ - public function getConfig(\Magento\Framework\DataObject $config) : \Magento\Framework\DataObject - { - $settings = $this->defaultVariableConfig->getWysiwygPluginSettings($config); - $pluginConfig = isset($settings['plugins']) ? $settings['plugins'] : []; - $pluginData = []; - if (!empty($pluginConfig)) { - $pluginData = array_shift($pluginConfig); - $editorPluginJs = 'Magento_Tinymce3::wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js'; - $pluginData['src'] = $this->assetRepo->getUrl($editorPluginJs); - $settings['variable_placeholders'] = $pluginData['options']['placeholders']; - } - $settings['plugins'] = [$pluginData]; - return $config->addData($settings); - } -} diff --git a/app/code/Magento/Tinymce3/Model/Config/Widget/Config.php b/app/code/Magento/Tinymce3/Model/Config/Widget/Config.php deleted file mode 100644 index fcb8235495d4..000000000000 --- a/app/code/Magento/Tinymce3/Model/Config/Widget/Config.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\Tinymce3\Model\Config\Widget; - -/** - * Class Config adds widget plugin information required for tinymce3 editor - * @deprecated 100.3.0 use \Magento\Widget\Model\Widget\Config instead - */ -class Config implements \Magento\Framework\Data\Wysiwyg\ConfigProviderInterface -{ - /** - * @var \Magento\Framework\View\Asset\Repository - */ - private $assetRepo; - - /** - * @var \Magento\Widget\Model\Widget\Config - */ - private $widgetConfig; - - /** - * @param \Magento\Framework\View\Asset\Repository $assetRepo - * @param \Magento\Widget\Model\Widget\Config $widgetConfig - */ - public function __construct( - \Magento\Framework\View\Asset\Repository $assetRepo, - \Magento\Widget\Model\Widget\Config $widgetConfig - ) { - $this->assetRepo = $assetRepo; - $this->widgetConfig = $widgetConfig; - } - - /** - * {@inheritdoc} - */ - public function getConfig(\Magento\Framework\DataObject $config) : \Magento\Framework\DataObject - { - $settings = [ - 'widget_plugin_src' => $this->getWysiwygJsPluginSrc(), - 'widget_window_url' => $this->widgetConfig->getWidgetWindowUrl($config), - 'widget_types' => $this->widgetConfig->getAvailableWidgets($config), - 'widget_error_image_url' => $this->widgetConfig->getErrorImageUrl(), - 'widget_placeholders' => $this->widgetConfig->getWidgetPlaceholderImageUrls() - ]; - return $config->addData($settings); - } - - /** - * Return path to tinymce3 widget plugin - * - * @return string - */ - private function getWysiwygJsPluginSrc() : string - { - $editorPluginJs = 'Magento_Tinymce3::tiny_mce/plugins/magentowidget/editor_plugin.js'; - $result = $this->assetRepo->getUrl($editorPluginJs); - return $result; - } -} diff --git a/app/code/Magento/Tinymce3/Model/Config/Widget/PlaceholderImagesPool.php b/app/code/Magento/Tinymce3/Model/Config/Widget/PlaceholderImagesPool.php deleted file mode 100644 index 7004beea70f1..000000000000 --- a/app/code/Magento/Tinymce3/Model/Config/Widget/PlaceholderImagesPool.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); -namespace Magento\Tinymce3\Model\Config\Widget; - -/** - * Class PlaceholderImages provide ability to override placeholder images for Widgets - * @deprecated 100.3.0 - */ -class PlaceholderImagesPool -{ - /** - * @var array - */ - private $widgetPlaceholders; - - /** - * PlaceholderImages constructor. - * @param array $widgetPlaceholders - */ - public function __construct( - array $widgetPlaceholders = [] - ) { - $this->widgetPlaceholders = $widgetPlaceholders; - } - - /** - * @return array - */ - public function getWidgetPlaceholders() : array - { - return $this->widgetPlaceholders; - } -} diff --git a/app/code/Magento/Tinymce3/Model/Config/Wysiwyg/Config.php b/app/code/Magento/Tinymce3/Model/Config/Wysiwyg/Config.php deleted file mode 100644 index c70ad28a114d..000000000000 --- a/app/code/Magento/Tinymce3/Model/Config/Wysiwyg/Config.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\Tinymce3\Model\Config\Wysiwyg; - -/** - * Class Config adds information about required css files for tinymce3 editor - * @deprecated 100.3.0 use \Magento\Cms\Model\Wysiwyg\DefaultConfigProvider instead - */ -class Config implements \Magento\Framework\Data\Wysiwyg\ConfigProviderInterface -{ - /** - * @var \Magento\Framework\View\Asset\Repository - */ - private $assetRepo; - - /** - * @param \Magento\Framework\View\Asset\Repository $assetRepo - */ - public function __construct( - \Magento\Framework\View\Asset\Repository $assetRepo - ) { - $this->assetRepo = $assetRepo; - } - - /** - * {@inheritdoc} - */ - public function getConfig(\Magento\Framework\DataObject $config) : \Magento\Framework\DataObject - { - $config->addData([ - 'popup_css' => $this->assetRepo->getUrl( - 'mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css' - ), - 'content_css' => $this->assetRepo->getUrl( - 'mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css' - ) - ]); - - return $config; - } -} diff --git a/app/code/Magento/Tinymce3/Model/Plugin/Widget.php b/app/code/Magento/Tinymce3/Model/Plugin/Widget.php deleted file mode 100644 index 1cf8a67751b7..000000000000 --- a/app/code/Magento/Tinymce3/Model/Plugin/Widget.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -declare(strict_types=1); -namespace Magento\Tinymce3\Model\Plugin; - -use Magento\Tinymce3\Model\Config\Source\Wysiwyg\Editor; - -/** - * Plugin to override widget placeholder images in case if tinymce3 adapter is used - */ -class Widget -{ - /** - * @var \Magento\Ui\Block\Wysiwyg\ActiveEditor - */ - private $activeEditor; - - /** - * @var array - */ - private $placeholderImages; - - /** - * @var \Magento\Framework\View\Asset\Repository - */ - private $assetRepo; - - /** - * @param \Magento\Ui\Block\Wysiwyg\ActiveEditor $activeEditor - * @param \Magento\Framework\View\Asset\Repository $assetRepo - * @param \Magento\Tinymce3\Model\Config\Widget\PlaceholderImagesPool $placeholderImages - */ - public function __construct( - \Magento\Ui\Block\Wysiwyg\ActiveEditor $activeEditor, - \Magento\Framework\View\Asset\Repository $assetRepo, - \Magento\Tinymce3\Model\Config\Widget\PlaceholderImagesPool $placeholderImages - ) { - $this->activeEditor = $activeEditor; - $this->placeholderImages = $placeholderImages; - $this->assetRepo = $assetRepo; - } - - /** - * @param \Magento\Widget\Model\Widget $subject - * @param \Closure $proceed - * @param string $type - * @return string - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function aroundGetPlaceholderImageUrl( - \Magento\Widget\Model\Widget $subject, - \Closure $proceed, - string $type - ) : string { - if ($this->activeEditor->getWysiwygAdapterPath() !== Editor::WYSIWYG_EDITOR_CONFIG_VALUE) { - return $proceed($type); - } - $placeholders = $this->placeholderImages->getWidgetPlaceholders(); - $defaultImage = $this->assetRepo->getUrl('Magento_Tinymce3::images/widget/placeholder.png'); - - if (isset($placeholders[$type])) { - return $this->assetRepo->getUrl($placeholders[$type]); - } - return $defaultImage; - } -} diff --git a/app/code/Magento/Tinymce3/README.md b/app/code/Magento/Tinymce3/README.md deleted file mode 100644 index 8e24c218171b..000000000000 --- a/app/code/Magento/Tinymce3/README.md +++ /dev/null @@ -1 +0,0 @@ -We have updated the TinyMCE module to the latest available version, 4.6.4. TinyMCE v4.6.4 provides backwards-compatibility for modified editor modules to prevent the loss of functionality. The TinyMCE3 module is now deprecated and will be removed in a future release. \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/Test/Mftf/README.md b/app/code/Magento/Tinymce3/Test/Mftf/README.md deleted file mode 100644 index e65a4afe26d8..000000000000 --- a/app/code/Magento/Tinymce3/Test/Mftf/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Tinymce3 Functional Tests - -The Functional Test Module for **Magento Tinymce3** module. diff --git a/app/code/Magento/Tinymce3/Test/Mftf/Section/AdminTinymce3FileldsSection/NewsletterWYSIWYGSection.xml b/app/code/Magento/Tinymce3/Test/Mftf/Section/AdminTinymce3FileldsSection/NewsletterWYSIWYGSection.xml deleted file mode 100644 index 13917561629b..000000000000 --- a/app/code/Magento/Tinymce3/Test/Mftf/Section/AdminTinymce3FileldsSection/NewsletterWYSIWYGSection.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> - <section name="NewsletterWYSIWYGSection"> - <element name="TinyMCE3" type="text" selector="#cms_page_form_content_tbl" deprecated="This version of TinyMCE is no longer supported"/> - </section> -</sections> diff --git a/app/code/Magento/Tinymce3/Test/Mftf/Section/AdminTinymce3FileldsSection/ProductWYSIWYGSection.xml b/app/code/Magento/Tinymce3/Test/Mftf/Section/AdminTinymce3FileldsSection/ProductWYSIWYGSection.xml deleted file mode 100644 index bc666d3590a8..000000000000 --- a/app/code/Magento/Tinymce3/Test/Mftf/Section/AdminTinymce3FileldsSection/ProductWYSIWYGSection.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> - <section name="ProductWYSIWYGSection" deprecated="This version of TinyMCE is no longer supported"> - <element name="Tinymce3MSG" type="button" selector=".admin__field-error"/> - </section> -</sections> diff --git a/app/code/Magento/Tinymce3/Test/Mftf/Section/AdminTinymce3FileldsSection/TinyMCESection.xml b/app/code/Magento/Tinymce3/Test/Mftf/Section/AdminTinymce3FileldsSection/TinyMCESection.xml deleted file mode 100644 index 38b2d907ecf4..000000000000 --- a/app/code/Magento/Tinymce3/Test/Mftf/Section/AdminTinymce3FileldsSection/TinyMCESection.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> - <section name="TinyMCESection"> - <element name="TinyMCE3" type="text" selector="#cms_page_form_content_tbl" deprecated="Deprecated this version of TinyMCE is no longer supported"/> - <element name="InsertImageBtnTinyMCE3" type="button" selector="#cms_page_form_content_image" deprecated="Deprecated this version of TinyMCE is no longer supported"/> - </section> -</sections> diff --git a/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml b/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml deleted file mode 100644 index 0bfdc0eed289..000000000000 --- a/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml +++ /dev/null @@ -1,86 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminSwitchWYSIWYGOptionsTest" deprecated="TinyMCE3 is no longer supported"> - <annotations> - <features value="Cms"/> - <stories value="MAGETWO-51829-Extensible list of WYSIWYG editors available in Magento"/> - <group value="Cms"/> - <title value="Admin should able to switch between versions of TinyMCE"/> - <description value="Admin should able to switch between versions of TinyMCE"/> - <severity value="CRITICAL"/> - <testCaseId value="MC-6114"/> - <skip> - <issueId value="DEPRECATED">TinyMCE3 is no longer supported</issueId> - </skip> - </annotations> - <before> - <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> - </before> - <actionGroup ref="AdminOpenConfigurationStoresPageActionGroup" stepKey="navigateToWYSIWYGConfigPage1"/> - <conditionalClick stepKey="expandWYSIWYGOptions1" selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.CheckIfTabExpand}}" visible="true" /> - <waitForElementVisible selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="waitForCheckbox1" /> - <uncheckOption selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="uncheckUseSystemValue1"/> - <waitForElementVisible selector="{{ContentManagementSection.Switcher}}" stepKey="waitForSwitcherDropdown1" /> - <selectOption selector="{{ContentManagementSection.Switcher}}" userInput="TinyMCE 4" stepKey="switchToVersion4" /> - <click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions1" /> - <click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig1" /> - <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToPage1"/> - <fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_defaultCmsPage.title}}" stepKey="fillFieldTitle1"/> - <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickContentTab1" /> - <waitForElementVisible selector="{{TinyMCESection.TinyMCE4}}" stepKey="waitForTinyMCE4"/> - <seeElement selector="{{TinyMCESection.TinyMCE4}}" stepKey="seeTinyMCE4" /> - <executeJS function="tinyMCE.activeEditor.setContent('Hello TinyMCE4!');" stepKey="executeJSFillContent1"/> - <click selector="{{CmsWYSIWYGSection.ShowHideBtn}}" stepKey="clickShowHideBtn1" /> - <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab1" /> - <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation1"/> - <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey1"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveButtonVisible"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage1"/> - <!-- Go to storefront cms page, assert cms content --> - <amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage1"/> - <waitForPageLoad stepKey="wait3" /> - <!--see widget on Storefront--> - <see userInput="Hello TinyMCE4!" stepKey="seeContent1"/> - <actionGroup ref="AdminOpenConfigurationStoresPageActionGroup" stepKey="navigateToWYSIWYGConfigPage2"/> - <conditionalClick stepKey="expandWYSIWYGOptions" selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.CheckIfTabExpand}}" visible="true" /> - <waitForElementVisible selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="waitForCheckbox2" /> - <uncheckOption selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="uncheckUseSystemValue2"/> - <waitForElementVisible selector="{{ContentManagementSection.Switcher}}" stepKey="waitForSwitcherDropdown2" /> - <selectOption selector="{{ContentManagementSection.Switcher}}" userInput="TinyMCE 3" stepKey="switchToVersion3" /> - <click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions2" /> - <click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig2" /> - <actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToPage2"/> - <fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_defaultCmsPage.title}}" stepKey="fillFieldTitle2"/> - <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickContentTab2" /> - <comment userInput="removing deprecated element" stepKey="waitForTinyMCE3"/> - <comment userInput="removing deprecated element" stepKey="seeTinyMCE3" /> - <executeJS function="tinyMCE.activeEditor.setContent('Hello TinyMCE3!');" stepKey="executeJSFillContent2"/> - <click selector="{{CmsWYSIWYGSection.ShowHideBtn}}" stepKey="clickShowHideBtn2" /> - <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab2" /> - <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation2"/> - <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{simpleCmsPage.identifier}}" stepKey="fillFieldUrlKey2"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveButtonVisible2"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu2"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage2"/> - <!-- Go to storefront cms page, assert cms content --> - <amOnPage url="{{simpleCmsPage.identifier}}" stepKey="amOnPageTestPage2"/> - <waitForPageLoad stepKey="wait6" /> - <!--see widget on Storefront--> - <see userInput="Hello TinyMCE3!" stepKey="seeContent2"/> - <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> - <after> - <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - </after> - </test> -</tests> diff --git a/app/code/Magento/Tinymce3/composer.json b/app/code/Magento/Tinymce3/composer.json deleted file mode 100644 index 0b8cf6824295..000000000000 --- a/app/code/Magento/Tinymce3/composer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "magento/module-tinymce-3", - "description": "N/A", - "require": { - "php": "~7.3.0||~7.4.0", - "magento/framework": "*", - "magento/module-backend": "*", - "magento/module-ui": "*", - "magento/module-variable": "*", - "magento/module-widget": "*" - }, - "suggest": { - "magento/module-cms": "*" - }, - "type": "magento2-module", - "license": [ - "OSL-3.0", - "AFL-3.0" - ], - "autoload": { - "files": [ - "registration.php" - ], - "psr-4": { - "Magento\\Tinymce3\\": "" - } - } -} diff --git a/app/code/Magento/Tinymce3/etc/adminhtml/di.xml b/app/code/Magento/Tinymce3/etc/adminhtml/di.xml deleted file mode 100644 index bcccf4459410..000000000000 --- a/app/code/Magento/Tinymce3/etc/adminhtml/di.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> - <preference for="Magento\Ui\Component\Wysiwyg\ConfigInterface" type="Magento\Cms\Model\Wysiwyg\Config"/> - <type name="Magento\Widget\Model\Widget"> - <plugin name="change_widget_placeholder" type="Magento\Tinymce3\Model\Plugin\Widget" /> - </type> - <type name="Magento\Cms\Model\Wysiwyg\CompositeConfigProvider"> - <arguments> - <argument name="wysiwygConfigPostProcessor" xsi:type="array"> - <item name="Magento_Tinymce3/tinymce3Adapter" xsi:type="string">Magento\Tinymce3\Model\Config\Wysiwyg\Config</item> - </argument> - <argument name="variablePluginConfigProvider" xsi:type="array"> - <item name="Magento_Tinymce3/tinymce3Adapter" xsi:type="string">Magento\Tinymce3\Model\Config\Variable\Config</item> - </argument> - <argument name="widgetPluginConfigProvider" xsi:type="array"> - <item name="Magento_Tinymce3/tinymce3Adapter" xsi:type="string">Magento\Tinymce3\Model\Config\Widget\Config</item> - </argument> - <argument name="galleryConfigProvider" xsi:type="array"> - <item name="Magento_Tinymce3/tinymce3Adapter" xsi:type="string">Magento\Tinymce3\Model\Config\Gallery\Config</item> - </argument> - </arguments> - </type> - <type name="Magento\Tinymce3\Model\Config\Widget\PlaceholderImagesPool"> - <arguments> - <argument name="widgetPlaceholders" xsi:type="array"> - <item name="Magento\Catalog\Block\Product\Widget\NewWidget" xsi:type="string">Magento_Tinymce3::images/catalog/product_widget_new.png</item> - <item name="Magento\Catalog\Block\Product\Widget\Link" xsi:type="string">Magento_Tinymce3::images/catalog/product_widget_link.png</item> - <item name="Magento\Catalog\Block\Category\Widget\Link" xsi:type="string">Magento_Tinymce3::images/catalog/category_widget_link.png</item> - <item name="Magento\Catalog\Block\Widget\RecentlyCompared" xsi:type="string">Magento_Tinymce3::images/catalog/product_widget_compared.png</item> - <item name="Magento\Catalog\Block\Widget\RecentlyViewed" xsi:type="string">Magento_Tinymce3::images/catalog/product_widget_viewed.png</item> - <item name="Magento\Cms\Block\Widget\Page\Link" xsi:type="string">Magento_Tinymce3::images/cms/widget_page_link.png</item> - <item name="Magento\Cms\Block\Widget\Block" xsi:type="string">Magento_Tinymce3::images/cms/widget_block.png</item> - </argument> - </arguments> - </type> -</config> diff --git a/app/code/Magento/Tinymce3/etc/csp_whitelist.xml b/app/code/Magento/Tinymce3/etc/csp_whitelist.xml deleted file mode 100644 index e2b2364dc80e..000000000000 --- a/app/code/Magento/Tinymce3/etc/csp_whitelist.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp:etc/csp_whitelist.xsd"> - <policies> - <policy id="style-src"> - <values> - <value id="firebug" type="host">getfirebug.com</value> - </values> - </policy> - <policy id="script-src"> - <values> - <value id="www_youtube" type="host">www.youtube.com</value> - <value id="google_video" type="host">video.google.com</value> - </values> - </policy> - <policy id="img-src"> - <values> - <value id="youtube_cdn" type="host">s.ytimg.com</value> - </values> - </policy> - </policies> -</csp_whitelist> diff --git a/app/code/Magento/Tinymce3/etc/di.xml b/app/code/Magento/Tinymce3/etc/di.xml deleted file mode 100644 index 0b1175b0cd94..000000000000 --- a/app/code/Magento/Tinymce3/etc/di.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> -</config> diff --git a/app/code/Magento/Tinymce3/etc/module.xml b/app/code/Magento/Tinymce3/etc/module.xml deleted file mode 100644 index 5180aa2ed4cb..000000000000 --- a/app/code/Magento/Tinymce3/etc/module.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> - <module name="Magento_Tinymce3" /> -</config> diff --git a/app/code/Magento/Tinymce3/registration.php b/app/code/Magento/Tinymce3/registration.php deleted file mode 100644 index 1e561dd1ae36..000000000000 --- a/app/code/Magento/Tinymce3/registration.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -use Magento\Framework\Component\ComponentRegistrar; - -ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Tinymce3', __DIR__); diff --git a/app/code/Magento/Tinymce3/view/adminhtml/web/images/catalog/category_widget_link.png b/app/code/Magento/Tinymce3/view/adminhtml/web/images/catalog/category_widget_link.png deleted file mode 100644 index 2093479a0043..000000000000 Binary files a/app/code/Magento/Tinymce3/view/adminhtml/web/images/catalog/category_widget_link.png and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/adminhtml/web/images/catalog/product_widget_compared.png b/app/code/Magento/Tinymce3/view/adminhtml/web/images/catalog/product_widget_compared.png deleted file mode 100644 index 0964781a4e02..000000000000 Binary files a/app/code/Magento/Tinymce3/view/adminhtml/web/images/catalog/product_widget_compared.png and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/adminhtml/web/images/catalog/product_widget_link.png b/app/code/Magento/Tinymce3/view/adminhtml/web/images/catalog/product_widget_link.png deleted file mode 100644 index b75499272892..000000000000 Binary files a/app/code/Magento/Tinymce3/view/adminhtml/web/images/catalog/product_widget_link.png and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/adminhtml/web/images/catalog/product_widget_new.png b/app/code/Magento/Tinymce3/view/adminhtml/web/images/catalog/product_widget_new.png deleted file mode 100644 index 1367e88e1787..000000000000 Binary files a/app/code/Magento/Tinymce3/view/adminhtml/web/images/catalog/product_widget_new.png and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/adminhtml/web/images/catalog/product_widget_viewed.png b/app/code/Magento/Tinymce3/view/adminhtml/web/images/catalog/product_widget_viewed.png deleted file mode 100644 index 78d421e975d6..000000000000 Binary files a/app/code/Magento/Tinymce3/view/adminhtml/web/images/catalog/product_widget_viewed.png and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/adminhtml/web/images/cms/widget_block.png b/app/code/Magento/Tinymce3/view/adminhtml/web/images/cms/widget_block.png deleted file mode 100644 index 97c41cb9ff57..000000000000 Binary files a/app/code/Magento/Tinymce3/view/adminhtml/web/images/cms/widget_block.png and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/adminhtml/web/images/cms/widget_page_link.png b/app/code/Magento/Tinymce3/view/adminhtml/web/images/cms/widget_page_link.png deleted file mode 100644 index adafab804e6c..000000000000 Binary files a/app/code/Magento/Tinymce3/view/adminhtml/web/images/cms/widget_page_link.png and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/adminhtml/web/images/widget/placeholder.png b/app/code/Magento/Tinymce3/view/adminhtml/web/images/widget/placeholder.png deleted file mode 100644 index 0a32b0cb4835..000000000000 Binary files a/app/code/Magento/Tinymce3/view/adminhtml/web/images/widget/placeholder.png and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/adminhtml/web/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js b/app/code/Magento/Tinymce3/view/adminhtml/web/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js deleted file mode 100644 index f332d4c88c61..000000000000 --- a/app/code/Magento/Tinymce3/view/adminhtml/web/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -/** - * @deprecated use lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js instead - */ -/* global tinyMCE, tinymce, MagentovariablePlugin */ -/* eslint-disable strict */ -tinyMCE.addI18n({ - en: { - magentovariable: { - 'insert_variable': 'Insert Variable' - } - } -}); - -(function () { - tinymce.create('tinymce.plugins.MagentovariablePlugin', { - /** - * @param {tinymce.Editor} ed - Editor instance that the plugin is initialized in. - * @param {String} url - Absolute URL to where the plugin is located. - */ - init: function (ed, url) { - ed.addCommand('mceMagentovariable', function () { - var pluginSettings = ed.settings.magentoPluginsOptions.get('magentovariable'); - - MagentovariablePlugin.setEditor(ed); - MagentovariablePlugin.loadChooser(pluginSettings.url, ed.settings.elements); - }); - - // Register Widget plugin button - ed.addButton('magentovariable', { - title: 'magentovariable.insert_variable', - cmd: 'mceMagentovariable', - image: url + '/img/icon.gif' - }); - }, - - /** - * @return {Object} - */ - getInfo: function () { - return { - longname: 'Magento Variable Manager Plugin for TinyMCE 3.x', - author: 'Magento Core Team', - authorurl: 'http://magentocommerce.com', - infourl: 'http://magentocommerce.com', - version: '1.0' - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('magentovariable', tinymce.plugins.MagentovariablePlugin); -})(); diff --git a/app/code/Magento/Tinymce3/view/adminhtml/web/wysiwyg/tiny_mce/plugins/magentovariable/img/icon.gif b/app/code/Magento/Tinymce3/view/adminhtml/web/wysiwyg/tiny_mce/plugins/magentovariable/img/icon.gif deleted file mode 100644 index fbc50a329d05..000000000000 Binary files a/app/code/Magento/Tinymce3/view/adminhtml/web/wysiwyg/tiny_mce/plugins/magentovariable/img/icon.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/requirejs-config.js b/app/code/Magento/Tinymce3/view/base/requirejs-config.js deleted file mode 100644 index f96cf7d4f720..000000000000 --- a/app/code/Magento/Tinymce3/view/base/requirejs-config.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -var config = { - shim: { - 'Magento_Tinymce3/tiny_mce/tiny_mce_src': { - 'exports': 'tinymce' - } - }, - map: { - '*': { - 'tinymceDeprecated': 'Magento_Tinymce3/tiny_mce/tiny_mce_src' - } - } -}; diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/AddOnManager.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/AddOnManager.js deleted file mode 100644 index 18954e1af9dd..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/AddOnManager.js +++ /dev/null @@ -1,358 +0,0 @@ -/** - * AddOnManager.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each; - - /** - * This class handles the loading of themes/plugins or other add-ons and their language packs. - * - * @class tinymce.AddOnManager - */ - tinymce.create('tinymce.AddOnManager', { - AddOnManager : function() { - var self = this; - - self.items = []; - self.urls = {}; - self.lookup = {}; - self.onAdd = new Dispatcher(self); - }, - - /** - * Fires when a item is added. - * - * @event onAdd - */ - - /** - * Returns the specified add on by the short name. - * - * @method get - * @param {String} n Add-on to look for. - * @return {tinymce.Theme/tinymce.Plugin} Theme or plugin add-on instance or undefined. - */ - get : function(n) { - if (this.lookup[n]) { - return this.lookup[n].instance; - } else { - return undefined; - } - }, - - dependencies : function(n) { - var result; - if (this.lookup[n]) { - result = this.lookup[n].dependencies; - } - return result || []; - }, - - /** - * Loads a language pack for the specified add-on. - * - * @method requireLangPack - * @param {String} n Short name of the add-on. - */ - requireLangPack : function(n) { - var s = tinymce.settings; - - if (s && s.language && s.language_load !== false) - tinymce.ScriptLoader.add(this.urls[n] + '/langs/' + s.language + '.js'); - }, - - /** - * Adds a instance of the add-on by it's short name. - * - * @method add - * @param {String} id Short name/id for the add-on. - * @param {tinymce.Theme/tinymce.Plugin} o Theme or plugin to add. - * @return {tinymce.Theme/tinymce.Plugin} The same theme or plugin instance that got passed in. - * @example - * // Create a simple plugin - * tinymce.create('tinymce.plugins.TestPlugin', { - * TestPlugin : function(ed, url) { - * ed.onClick.add(function(ed, e) { - * ed.windowManager.alert('Hello World!'); - * }); - * } - * }); - * - * // Register plugin using the add method - * tinymce.PluginManager.add('test', tinymce.plugins.TestPlugin); - * - * // Initialize TinyMCE - * tinyMCE.init({ - * ... - * plugins : '-test' // Init the plugin but don't try to load it - * }); - */ - add : function(id, o, dependencies) { - this.items.push(o); - this.lookup[id] = {instance:o, dependencies:dependencies}; - this.onAdd.dispatch(this, id, o); - - return o; - }, - createUrl: function(baseUrl, dep) { - if (typeof dep === "object") { - return dep - } else { - return {prefix: baseUrl.prefix, resource: dep, suffix: baseUrl.suffix}; - } - }, - - /** - * Add a set of components that will make up the add-on. Using the url of the add-on name as the base url. - * This should be used in development mode. A new compressor/javascript munger process will ensure that the - * components are put together into the editor_plugin.js file and compressed correctly. - * @param pluginName {String} name of the plugin to load scripts from (will be used to get the base url for the plugins). - * @param scripts {Array} Array containing the names of the scripts to load. - */ - addComponents: function(pluginName, scripts) { - var pluginUrl = this.urls[pluginName]; - tinymce.each(scripts, function(script){ - tinymce.ScriptLoader.add(pluginUrl+"/"+script); - }); - }, - - /** - * Loads an add-on from a specific url. - * - * @method load - * @param {String} n Short name of the add-on that gets loaded. - * @param {String} u URL to the add-on that will get loaded. - * @param {function} cb Optional callback to execute ones the add-on is loaded. - * @param {Object} s Optional scope to execute the callback in. - * @example - * // Loads a plugin from an external URL - * tinymce.PluginManager.load('myplugin', '/some/dir/someplugin/editor_plugin.js'); - * - * // Initialize TinyMCE - * tinyMCE.init({ - * ... - * plugins : '-myplugin' // Don't try to load it again - * }); - */ - load : function(n, u, cb, s) { - var t = this, url = u; - - function loadDependencies() { - var dependencies = t.dependencies(n); - tinymce.each(dependencies, function(dep) { - var newUrl = t.createUrl(u, dep); - t.load(newUrl.resource, newUrl, undefined, undefined); - }); - if (cb) { - if (s) { - cb.call(s); - } else { - cb.call(tinymce.ScriptLoader); - } - } - } - - if (t.urls[n]) - return; - if (typeof u === "object") - url = u.prefix + u.resource + u.suffix; - - if (url.indexOf('/') != 0 && url.indexOf('://') == -1) - url = tinymce.baseURL + '/' + url; - - t.urls[n] = url.substring(0, url.lastIndexOf('/')); - - if (t.lookup[n]) { - loadDependencies(); - } else { - tinymce.ScriptLoader.add(url, loadDependencies, s); - } - } - }); - - // Create plugin and theme managers - tinymce.PluginManager = new tinymce.AddOnManager(); - tinymce.ThemeManager = new tinymce.AddOnManager(); -}(tinymce)); - -/** - * TinyMCE theme class. - * - * @class tinymce.Theme - */ - -/** - * Initializes the theme. - * - * @method init - * @param {tinymce.Editor} editor Editor instance that created the theme instance. - * @param {String} url Absolute URL where the theme is located. - */ - -/** - * Meta info method, this method gets executed when TinyMCE wants to present information about the theme for example in the about/help dialog. - * - * @method getInfo - * @return {Object} Returns an object with meta information about the theme the current items are longname, author, authorurl, infourl and version. - */ - -/** - * This method is responsible for rendering/generating the overall user interface with toolbars, buttons, iframe containers etc. - * - * @method renderUI - * @param {Object} obj Object parameter containing the targetNode DOM node that will be replaced visually with an editor instance. - * @return {Object} an object with items like iframeContainer, editorContainer, sizeContainer, deltaWidth, deltaHeight. - */ - -/** - * Plugin base class, this is a pseudo class that describes how a plugin is to be created for TinyMCE. The methods below are all optional. - * - * @class tinymce.Plugin - * @example - * // Create a new plugin class - * tinymce.create('tinymce.plugins.ExamplePlugin', { - * init : function(ed, url) { - * // Register an example button - * ed.addButton('example', { - * title : 'example.desc', - * onclick : function() { - * // Display an alert when the user clicks the button - * ed.windowManager.alert('Hello world!'); - * }, - * 'class' : 'bold' // Use the bold icon from the theme - * }); - * } - * }); - * - * // Register plugin with a short name - * tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); - * - * // Initialize TinyMCE with the new plugin and button - * tinyMCE.init({ - * ... - * plugins : '-example', // - means TinyMCE will not try to load it - * theme_advanced_buttons1 : 'example' // Add the new example button to the toolbar - * }); - */ - -/** - * Initialization function for the plugin. This will be called when the plugin is created. - * - * @method init - * @param {tinymce.Editor} editor Editor instance that created the plugin instance. - * @param {String} url Absolute URL where the plugin is located. - * @example - * // Creates a new plugin class - * tinymce.create('tinymce.plugins.ExamplePlugin', { - * init : function(ed, url) { - * // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); - * ed.addCommand('mceExample', function() { - * ed.windowManager.open({ - * file : url + '/dialog.htm', - * width : 320 + ed.getLang('example.delta_width', 0), - * height : 120 + ed.getLang('example.delta_height', 0), - * inline : 1 - * }, { - * plugin_url : url, // Plugin absolute URL - * some_custom_arg : 'custom arg' // Custom argument - * }); - * }); - * - * // Register example button - * ed.addButton('example', { - * title : 'example.desc', - * cmd : 'mceExample', - * image : url + '/img/example.gif' - * }); - * - * // Add a node change handler, selects the button in the UI when a image is selected - * ed.onNodeChange.add(function(ed, cm, n) { - * cm.setActive('example', n.nodeName == 'IMG'); - * }); - * } - * }); - * - * // Register plugin - * tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); - */ - -/** - * Meta info method, this method gets executed when TinyMCE wants to present information about the plugin for example in the about/help dialog. - * - * @method getInfo - * @return {Object} Returns an object with meta information about the plugin the current items are longname, author, authorurl, infourl and version. - * @example - * // Creates a new plugin class - * tinymce.create('tinymce.plugins.ExamplePlugin', { - * // Meta info method - * getInfo : function() { - * return { - * longname : 'Example plugin', - * author : 'Some author', - * authorurl : 'http://tinymce.moxiecode.com', - * infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example', - * version : "1.0" - * }; - * } - * }); - * - * // Register plugin - * tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); - * - * // Initialize TinyMCE with the new plugin - * tinyMCE.init({ - * ... - * plugins : '-example' // - means TinyMCE will not try to load it - * }); - */ - -/** - * Gets called when a new control instance is created. - * - * @method createControl - * @param {String} name Control name to create for example "mylistbox" - * @param {tinymce.ControlManager} controlman Control manager/factory to use to create the control. - * @return {tinymce.ui.Control} Returns a new control instance or null. - * @example - * // Creates a new plugin class - * tinymce.create('tinymce.plugins.ExamplePlugin', { - * createControl: function(n, cm) { - * switch (n) { - * case 'mylistbox': - * var mlb = cm.createListBox('mylistbox', { - * title : 'My list box', - * onselect : function(v) { - * tinyMCE.activeEditor.windowManager.alert('Value selected:' + v); - * } - * }); - * - * // Add some values to the list box - * mlb.add('Some item 1', 'val1'); - * mlb.add('some item 2', 'val2'); - * mlb.add('some item 3', 'val3'); - * - * // Return the new listbox instance - * return mlb; - * } - * - * return null; - * } - * }); - * - * // Register plugin - * tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); - * - * // Initialize TinyMCE with the new plugin and button - * tinyMCE.init({ - * ... - * plugins : '-example', // - means TinyMCE will not try to load it - * theme_advanced_buttons1 : 'mylistbox' // Add the new mylistbox control to the toolbar - * }); - */ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ControlManager.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ControlManager.js deleted file mode 100644 index 784042988c0e..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ControlManager.js +++ /dev/null @@ -1,524 +0,0 @@ -/** - * ControlManager.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - // Shorten names - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, extend = tinymce.extend; - - /** - * This class is responsible for managing UI control instances. It's both a factory and a collection for the controls. - * @class tinymce.ControlManager - */ - tinymce.create('tinymce.ControlManager', { - /** - * Constructs a new control manager instance. - * Consult the Wiki for more details on this class. - * - * @constructor - * @method ControlManager - * @param {tinymce.Editor} ed TinyMCE editor instance to add the control to. - * @param {Object} s Optional settings object for the control manager. - */ - ControlManager : function(ed, s) { - var t = this, i; - - s = s || {}; - t.editor = ed; - t.controls = {}; - t.onAdd = new tinymce.util.Dispatcher(t); - t.onPostRender = new tinymce.util.Dispatcher(t); - t.prefix = s.prefix || ed.id + '_'; - t._cls = {}; - - t.onPostRender.add(function() { - each(t.controls, function(c) { - c.postRender(); - }); - }); - }, - - /** - * Returns a control by id or undefined it wasn't found. - * - * @method get - * @param {String} id Control instance name. - * @return {tinymce.ui.Control} Control instance or undefined. - */ - get : function(id) { - return this.controls[this.prefix + id] || this.controls[id]; - }, - - /** - * Sets the active state of a control by id. - * - * @method setActive - * @param {String} id Control id to set state on. - * @param {Boolean} s Active state true/false. - * @return {tinymce.ui.Control} Control instance that got activated or null if it wasn't found. - */ - setActive : function(id, s) { - var c = null; - - if (c = this.get(id)) - c.setActive(s); - - return c; - }, - - /** - * Sets the dsiabled state of a control by id. - * - * @method setDisabled - * @param {String} id Control id to set state on. - * @param {Boolean} s Active state true/false. - * @return {tinymce.ui.Control} Control instance that got disabled or null if it wasn't found. - */ - setDisabled : function(id, s) { - var c = null; - - if (c = this.get(id)) - c.setDisabled(s); - - return c; - }, - - /** - * Adds a control to the control collection inside the manager. - * - * @method add - * @param {tinymce.ui.Control} Control instance to add to collection. - * @return {tinymce.ui.Control} Control instance that got passed in. - */ - add : function(c) { - var t = this; - - if (c) { - t.controls[c.id] = c; - t.onAdd.dispatch(c, t); - } - - return c; - }, - - /** - * Creates a control by name, when a control is created it will automatically add it to the control collection. - * It first ask all plugins for the specified control if the plugins didn't return a control then the default behavior - * will be used. - * - * @method createControl - * @param {String} n Control name to create for example "separator". - * @return {tinymce.ui.Control} Control instance that got created and added. - */ - createControl : function(n) { - var c, t = this, ed = t.editor; - - each(ed.plugins, function(p) { - if (p.createControl) { - c = p.createControl(n, t); - - if (c) - return false; - } - }); - - switch (n) { - case "|": - case "separator": - return t.createSeparator(); - } - - if (!c && ed.buttons && (c = ed.buttons[n])) - return t.createButton(n, c); - - return t.add(c); - }, - - /** - * Creates a drop menu control instance by id. - * - * @method createDropMenu - * @param {String} id Unique id for the new dropdown instance. For example "some menu". - * @param {Object} s Optional settings object for the control. - * @param {Object} cc Optional control class to use instead of the default one. - * @return {tinymce.ui.Control} Control instance that got created and added. - */ - createDropMenu : function(id, s, cc) { - var t = this, ed = t.editor, c, bm, v, cls; - - s = extend({ - 'class' : 'mceDropDown', - constrain : ed.settings.constrain_menus - }, s); - - s['class'] = s['class'] + ' ' + ed.getParam('skin') + 'Skin'; - if (v = ed.getParam('skin_variant')) - s['class'] += ' ' + ed.getParam('skin') + 'Skin' + v.substring(0, 1).toUpperCase() + v.substring(1); - - id = t.prefix + id; - cls = cc || t._cls.dropmenu || tinymce.ui.DropMenu; - c = t.controls[id] = new cls(id, s); - c.onAddItem.add(function(c, o) { - var s = o.settings; - - s.title = ed.getLang(s.title, s.title); - - if (!s.onclick) { - s.onclick = function(v) { - if (s.cmd) - ed.execCommand(s.cmd, s.ui || false, s.value); - }; - } - }); - - ed.onRemove.add(function() { - c.destroy(); - }); - - // Fix for bug #1897785, #1898007 - if (tinymce.isIE) { - c.onShowMenu.add(function() { - // IE 8 needs focus in order to store away a range with the current collapsed caret location - ed.focus(); - - bm = ed.selection.getBookmark(1); - }); - - c.onHideMenu.add(function() { - if (bm) { - ed.selection.moveToBookmark(bm); - bm = 0; - } - }); - } - - return t.add(c); - }, - - /** - * Creates a list box control instance by id. A list box is either a native select element or a DOM/JS based list box control. This - * depends on the use_native_selects settings state. - * - * @method createListBox - * @param {String} id Unique id for the new listbox instance. For example "styles". - * @param {Object} s Optional settings object for the control. - * @param {Object} cc Optional control class to use instead of the default one. - * @return {tinymce.ui.Control} Control instance that got created and added. - */ - createListBox : function(id, s, cc) { - var t = this, ed = t.editor, cmd, c, cls; - - if (t.get(id)) - return null; - - s.title = ed.translate(s.title); - s.scope = s.scope || ed; - - if (!s.onselect) { - s.onselect = function(v) { - ed.execCommand(s.cmd, s.ui || false, v || s.value); - }; - } - - s = extend({ - title : s.title, - 'class' : 'mce_' + id, - scope : s.scope, - control_manager : t - }, s); - - id = t.prefix + id; - - - function useNativeListForAccessibility(ed) { - return ed.settings.use_accessible_selects && !tinymce.isGecko - } - - if (ed.settings.use_native_selects || useNativeListForAccessibility(ed)) - c = new tinymce.ui.NativeListBox(id, s); - else { - cls = cc || t._cls.listbox || tinymce.ui.ListBox; - c = new cls(id, s, ed); - } - - t.controls[id] = c; - - // Fix focus problem in Safari - if (tinymce.isWebKit) { - c.onPostRender.add(function(c, n) { - // Store bookmark on mousedown - Event.add(n, 'mousedown', function() { - ed.bookmark = ed.selection.getBookmark(1); - }); - - // Restore on focus, since it might be lost - Event.add(n, 'focus', function() { - ed.selection.moveToBookmark(ed.bookmark); - ed.bookmark = null; - }); - }); - } - - if (c.hideMenu) - ed.onMouseDown.add(c.hideMenu, c); - - return t.add(c); - }, - - /** - * Creates a button control instance by id. - * - * @method createButton - * @param {String} id Unique id for the new button instance. For example "bold". - * @param {Object} s Optional settings object for the control. - * @param {Object} cc Optional control class to use instead of the default one. - * @return {tinymce.ui.Control} Control instance that got created and added. - */ - createButton : function(id, s, cc) { - var t = this, ed = t.editor, o, c, cls; - - if (t.get(id)) - return null; - - s.title = ed.translate(s.title); - s.label = ed.translate(s.label); - s.scope = s.scope || ed; - - if (!s.onclick && !s.menu_button) { - s.onclick = function() { - ed.execCommand(s.cmd, s.ui || false, s.value); - }; - } - - s = extend({ - title : s.title, - 'class' : 'mce_' + id, - unavailable_prefix : ed.getLang('unavailable', ''), - scope : s.scope, - control_manager : t - }, s); - - id = t.prefix + id; - - if (s.menu_button) { - cls = cc || t._cls.menubutton || tinymce.ui.MenuButton; - c = new cls(id, s, ed); - ed.onMouseDown.add(c.hideMenu, c); - } else { - cls = t._cls.button || tinymce.ui.Button; - c = new cls(id, s, ed); - } - - return t.add(c); - }, - - /** - * Creates a menu button control instance by id. - * - * @method createMenuButton - * @param {String} id Unique id for the new menu button instance. For example "menu1". - * @param {Object} s Optional settings object for the control. - * @param {Object} cc Optional control class to use instead of the default one. - * @return {tinymce.ui.Control} Control instance that got created and added. - */ - createMenuButton : function(id, s, cc) { - s = s || {}; - s.menu_button = 1; - - return this.createButton(id, s, cc); - }, - - /** - * Creates a split button control instance by id. - * - * @method createSplitButton - * @param {String} id Unique id for the new split button instance. For example "spellchecker". - * @param {Object} s Optional settings object for the control. - * @param {Object} cc Optional control class to use instead of the default one. - * @return {tinymce.ui.Control} Control instance that got created and added. - */ - createSplitButton : function(id, s, cc) { - var t = this, ed = t.editor, cmd, c, cls; - - if (t.get(id)) - return null; - - s.title = ed.translate(s.title); - s.scope = s.scope || ed; - - if (!s.onclick) { - s.onclick = function(v) { - ed.execCommand(s.cmd, s.ui || false, v || s.value); - }; - } - - if (!s.onselect) { - s.onselect = function(v) { - ed.execCommand(s.cmd, s.ui || false, v || s.value); - }; - } - - s = extend({ - title : s.title, - 'class' : 'mce_' + id, - scope : s.scope, - control_manager : t - }, s); - - id = t.prefix + id; - cls = cc || t._cls.splitbutton || tinymce.ui.SplitButton; - c = t.add(new cls(id, s, ed)); - ed.onMouseDown.add(c.hideMenu, c); - - return c; - }, - - /** - * Creates a color split button control instance by id. - * - * @method createColorSplitButton - * @param {String} id Unique id for the new color split button instance. For example "forecolor". - * @param {Object} s Optional settings object for the control. - * @param {Object} cc Optional control class to use instead of the default one. - * @return {tinymce.ui.Control} Control instance that got created and added. - */ - createColorSplitButton : function(id, s, cc) { - var t = this, ed = t.editor, cmd, c, cls, bm; - - if (t.get(id)) - return null; - - s.title = ed.translate(s.title); - s.scope = s.scope || ed; - - if (!s.onclick) { - s.onclick = function(v) { - if (tinymce.isIE) - bm = ed.selection.getBookmark(1); - - ed.execCommand(s.cmd, s.ui || false, v || s.value); - }; - } - - if (!s.onselect) { - s.onselect = function(v) { - ed.execCommand(s.cmd, s.ui || false, v || s.value); - }; - } - - s = extend({ - title : s.title, - 'class' : 'mce_' + id, - 'menu_class' : ed.getParam('skin') + 'Skin', - scope : s.scope, - more_colors_title : ed.getLang('more_colors') - }, s); - - id = t.prefix + id; - cls = cc || t._cls.colorsplitbutton || tinymce.ui.ColorSplitButton; - c = new cls(id, s, ed); - ed.onMouseDown.add(c.hideMenu, c); - - // Remove the menu element when the editor is removed - ed.onRemove.add(function() { - c.destroy(); - }); - - // Fix for bug #1897785, #1898007 - if (tinymce.isIE) { - c.onShowMenu.add(function() { - // IE 8 needs focus in order to store away a range with the current collapsed caret location - ed.focus(); - bm = ed.selection.getBookmark(1); - }); - - c.onHideMenu.add(function() { - if (bm) { - ed.selection.moveToBookmark(bm); - bm = 0; - } - }); - } - - return t.add(c); - }, - - /** - * Creates a toolbar container control instance by id. - * - * @method createToolbar - * @param {String} id Unique id for the new toolbar container control instance. For example "toolbar1". - * @param {Object} s Optional settings object for the control. - * @param {Object} cc Optional control class to use instead of the default one. - * @return {tinymce.ui.Control} Control instance that got created and added. - */ - createToolbar : function(id, s, cc) { - var c, t = this, cls; - - id = t.prefix + id; - cls = cc || t._cls.toolbar || tinymce.ui.Toolbar; - c = new cls(id, s, t.editor); - - if (t.get(id)) - return null; - - return t.add(c); - }, - - createToolbarGroup : function(id, s, cc) { - var c, t = this, cls; - id = t.prefix + id; - cls = cc || this._cls.toolbarGroup || tinymce.ui.ToolbarGroup; - c = new cls(id, s, t.editor); - - if (t.get(id)) - return null; - - return t.add(c); - }, - - /** - * Creates a separator control instance. - * - * @method createSeparator - * @param {Object} cc Optional control class to use instead of the default one. - * @return {tinymce.ui.Control} Control instance that got created and added. - */ - createSeparator : function(cc) { - var cls = cc || this._cls.separator || tinymce.ui.Separator; - - return new cls(); - }, - - /** - * Overrides a specific control type with a custom class. - * - * @method setControlType - * @param {string} n Name of the control to override for example button or dropmenu. - * @param {function} c Class reference to use instead of the default one. - * @return {function} Same as the class reference. - */ - setControlType : function(n, c) { - return this._cls[n.toLowerCase()] = c; - }, - - /** - * Destroy. - * - * @method destroy - */ - destroy : function() { - each(this.controls, function(c) { - c.destroy(); - }); - - this.controls = null; - } - }); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/Editor.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/Editor.js deleted file mode 100644 index 6ea9b2386e93..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/Editor.js +++ /dev/null @@ -1,3287 +0,0 @@ -/** - * Editor.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - // Shorten these names - var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, - Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isGecko = tinymce.isGecko, - isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, is = tinymce.is, - ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, - inArray = tinymce.inArray, grep = tinymce.grep, explode = tinymce.explode; - - /** - * This class contains the core logic for a TinyMCE editor. - * - * @class tinymce.Editor - * @example - * // Add a class to all paragraphs in the editor. - * tinyMCE.activeEditor.dom.addClass(tinyMCE.activeEditor.dom.select('p'), 'someclass'); - * - * // Gets the current editors selection as text - * tinyMCE.activeEditor.selection.getContent({format : 'text'}); - * - * // Creates a new editor instance - * var ed = new tinymce.Editor('textareaid', { - * some_setting : 1 - * }); - * - * // Select each item the user clicks on - * ed.onClick.add(function(ed, e) { - * ed.selection.select(e.target); - * }); - * - * ed.render(); - */ - tinymce.create('tinymce.Editor', { - /** - * Constructs a editor instance by id. - * - * @constructor - * @method Editor - * @param {String} id Unique id for the editor. - * @param {Object} s Optional settings string for the editor. - * @author Moxiecode - */ - Editor : function(id, s) { - var t = this; - - /** - * Editor instance id, normally the same as the div/textarea that was replaced. - * - * @property id - * @type String - */ - t.id = t.editorId = id; - - t.execCommands = {}; - t.queryStateCommands = {}; - t.queryValueCommands = {}; - - /** - * State to force the editor to return false on a isDirty call. - * - * @property isNotDirty - * @type Boolean - * @example - * function ajaxSave() { - * var ed = tinyMCE.get('elm1'); - * - * // Save contents using some XHR call - * alert(ed.getContent()); - * - * ed.isNotDirty = 1; // Force not dirty state - * } - */ - t.isNotDirty = false; - - /** - * Name/Value object containting plugin instances. - * - * @property plugins - * @type Object - * @example - * // Execute a method inside a plugin directly - * tinyMCE.activeEditor.plugins.someplugin.someMethod(); - */ - t.plugins = {}; - - // Add events to the editor - each([ - /** - * Fires before the initialization of the editor. - * - * @event onPreInit - * @param {tinymce.Editor} sender Editor instance. - * @see #onInit - * @example - * // Adds an observer to the onPreInit event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onPreInit.add(function(ed) { - * console.debug('PreInit: ' + ed.id); - * }); - * } - * }); - */ - 'onPreInit', - - /** - * Fires before the initialization of the editor. - * - * @event onBeforeRenderUI - * @param {tinymce.Editor} sender Editor instance. - * @example - * // Adds an observer to the onBeforeRenderUI event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onBeforeRenderUI.add(function(ed, cm) { - * console.debug('Before render: ' + ed.id); - * }); - * } - * }); - */ - 'onBeforeRenderUI', - - /** - * Fires after the rendering has completed. - * - * @event onPostRender - * @param {tinymce.Editor} sender Editor instance. - * @example - * // Adds an observer to the onPostRender event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onPostRender.add(function(ed, cm) { - * console.debug('After render: ' + ed.id); - * }); - * } - * }); - */ - 'onPostRender', - - /** - * Fires after the initialization of the editor is done. - * - * @event onInit - * @param {tinymce.Editor} sender Editor instance. - * @see #onPreInit - * @example - * // Adds an observer to the onInit event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onInit.add(function(ed) { - * console.debug('Editor is done: ' + ed.id); - * }); - * } - * }); - */ - 'onInit', - - /** - * Fires when the editor instance is removed from page. - * - * @event onRemove - * @param {tinymce.Editor} sender Editor instance. - * @example - * // Adds an observer to the onRemove event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onRemove.add(function(ed) { - * console.debug('Editor was removed: ' + ed.id); - * }); - * } - * }); - */ - 'onRemove', - - /** - * Fires when the editor is activated. - * - * @event onActivate - * @param {tinymce.Editor} sender Editor instance. - * @example - * // Adds an observer to the onActivate event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onActivate.add(function(ed) { - * console.debug('Editor was activated: ' + ed.id); - * }); - * } - * }); - */ - 'onActivate', - - /** - * Fires when the editor is deactivated. - * - * @event onDeactivate - * @param {tinymce.Editor} sender Editor instance. - * @example - * // Adds an observer to the onDeactivate event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onDeactivate.add(function(ed) { - * console.debug('Editor was deactivated: ' + ed.id); - * }); - * } - * }); - */ - 'onDeactivate', - - /** - * Fires when something in the body of the editor is clicked. - * - * @event onClick - * @param {tinymce.Editor} sender Editor instance. - * @param {Event} evt W3C DOM Event instance. - * @example - * // Adds an observer to the onClick event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onClick.add(function(ed, e) { - * console.debug('Editor was clicked: ' + e.target.nodeName); - * }); - * } - * }); - */ - 'onClick', - - /** - * Fires when a registered event is intercepted. - * - * @event onEvent - * @param {tinymce.Editor} sender Editor instance. - * @param {Event} evt W3C DOM Event instance. - * @example - * // Adds an observer to the onEvent event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onEvent.add(function(ed, e) { - * console.debug('Editor event occurred: ' + e.target.nodeName); - * }); - * } - * }); - */ - 'onEvent', - - /** - * Fires when a mouseup event is intercepted inside the editor. - * - * @event onMouseUp - * @param {tinymce.Editor} sender Editor instance. - * @param {Event} evt W3C DOM Event instance. - * @example - * // Adds an observer to the onMouseUp event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onMouseUp.add(function(ed, e) { - * console.debug('Mouse up event: ' + e.target.nodeName); - * }); - * } - * }); - */ - 'onMouseUp', - - /** - * Fires when a mousedown event is intercepted inside the editor. - * - * @event onMouseDown - * @param {tinymce.Editor} sender Editor instance. - * @param {Event} evt W3C DOM Event instance. - * @example - * // Adds an observer to the onMouseDown event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onMouseDown.add(function(ed, e) { - * console.debug('Mouse down event: ' + e.target.nodeName); - * }); - * } - * }); - */ - 'onMouseDown', - - /** - * Fires when a dblclick event is intercepted inside the editor. - * - * @event onDblClick - * @param {tinymce.Editor} sender Editor instance. - * @param {Event} evt W3C DOM Event instance. - * @example - * // Adds an observer to the onDblClick event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onDblClick.add(function(ed, e) { - * console.debug('Double click event: ' + e.target.nodeName); - * }); - * } - * }); - */ - 'onDblClick', - - /** - * Fires when a keydown event is intercepted inside the editor. - * - * @event onKeyDown - * @param {tinymce.Editor} sender Editor instance. - * @param {Event} evt W3C DOM Event instance. - * @example - * // Adds an observer to the onKeyDown event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onKeyDown.add(function(ed, e) { - * console.debug('Key down event: ' + e.keyCode); - * }); - * } - * }); - */ - 'onKeyDown', - - /** - * Fires when a keydown event is intercepted inside the editor. - * - * @event onKeyUp - * @param {tinymce.Editor} sender Editor instance. - * @param {Event} evt W3C DOM Event instance. - * @example - * // Adds an observer to the onKeyUp event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onKeyUp.add(function(ed, e) { - * console.debug('Key up event: ' + e.keyCode); - * }); - * } - * }); - */ - 'onKeyUp', - - /** - * Fires when a keypress event is intercepted inside the editor. - * - * @event onKeyPress - * @param {tinymce.Editor} sender Editor instance. - * @param {Event} evt W3C DOM Event instance. - * @example - * // Adds an observer to the onKeyPress event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onKeyPress.add(function(ed, e) { - * console.debug('Key press event: ' + e.keyCode); - * }); - * } - * }); - */ - 'onKeyPress', - - /** - * Fires when a contextmenu event is intercepted inside the editor. - * - * @event onContextMenu - * @param {tinymce.Editor} sender Editor instance. - * @param {Event} evt W3C DOM Event instance. - * @example - * // Adds an observer to the onContextMenu event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onContextMenu.add(function(ed, e) { - * console.debug('Context menu event:' + e.target); - * }); - * } - * }); - */ - 'onContextMenu', - - /** - * Fires when a form submit event is intercepted. - * - * @event onSubmit - * @param {tinymce.Editor} sender Editor instance. - * @param {Event} evt W3C DOM Event instance. - * @example - * // Adds an observer to the onSubmit event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onSubmit.add(function(ed, e) { - * console.debug('Form submit:' + e.target); - * }); - * } - * }); - */ - 'onSubmit', - - /** - * Fires when a form reset event is intercepted. - * - * @event onReset - * @param {tinymce.Editor} sender Editor instance. - * @param {Event} evt W3C DOM Event instance. - * @example - * // Adds an observer to the onReset event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onReset.add(function(ed, e) { - * console.debug('Form reset:' + e.target); - * }); - * } - * }); - */ - 'onReset', - - /** - * Fires when a paste event is intercepted inside the editor. - * - * @event onPaste - * @param {tinymce.Editor} sender Editor instance. - * @param {Event} evt W3C DOM Event instance. - * @example - * // Adds an observer to the onPaste event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onPaste.add(function(ed, e) { - * console.debug('Pasted plain text'); - * }); - * } - * }); - */ - 'onPaste', - - /** - * Fires when the Serializer does a preProcess on the contents. - * - * @event onPreProcess - * @param {tinymce.Editor} sender Editor instance. - * @param {Object} obj PreProcess object. - * @option {Node} node DOM node for the item being serialized. - * @option {String} format The specified output format normally "html". - * @option {Boolean} get Is true if the process is on a getContent operation. - * @option {Boolean} set Is true if the process is on a setContent operation. - * @option {Boolean} cleanup Is true if the process is on a cleanup operation. - * @example - * // Adds an observer to the onPreProcess event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onPreProcess.add(function(ed, o) { - * // Add a class to each paragraph in the editor - * ed.dom.addClass(ed.dom.select('p', o.node), 'myclass'); - * }); - * } - * }); - */ - 'onPreProcess', - - /** - * Fires when the Serializer does a postProcess on the contents. - * - * @event onPostProcess - * @param {tinymce.Editor} sender Editor instance. - * @param {Object} obj PreProcess object. - * @example - * // Adds an observer to the onPostProcess event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onPostProcess.add(function(ed, o) { - * // Remove all paragraphs and replace with BR - * o.content = o.content.replace(/<p[^>]+>|<p>/g, ''); - * o.content = o.content.replace(/<\/p>/g, '<br />'); - * }); - * } - * }); - */ - 'onPostProcess', - - /** - * Fires before new contents is added to the editor. Using for example setContent. - * - * @event onBeforeSetContent - * @param {tinymce.Editor} sender Editor instance. - * @example - * // Adds an observer to the onBeforeSetContent event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onBeforeSetContent.add(function(ed, o) { - * // Replaces all a characters with b characters - * o.content = o.content.replace(/a/g, 'b'); - * }); - * } - * }); - */ - 'onBeforeSetContent', - - /** - * Fires before contents is extracted from the editor using for example getContent. - * - * @event onBeforeGetContent - * @param {tinymce.Editor} sender Editor instance. - * @param {Event} evt W3C DOM Event instance. - * @example - * // Adds an observer to the onBeforeGetContent event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onBeforeGetContent.add(function(ed, o) { - * console.debug('Before get content.'); - * }); - * } - * }); - */ - 'onBeforeGetContent', - - /** - * Fires after the contents has been added to the editor using for example onSetContent. - * - * @event onSetContent - * @param {tinymce.Editor} sender Editor instance. - * @example - * // Adds an observer to the onSetContent event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onSetContent.add(function(ed, o) { - * // Replaces all a characters with b characters - * o.content = o.content.replace(/a/g, 'b'); - * }); - * } - * }); - */ - 'onSetContent', - - /** - * Fires after the contents has been extracted from the editor using for example getContent. - * - * @event onGetContent - * @param {tinymce.Editor} sender Editor instance. - * @example - * // Adds an observer to the onGetContent event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onGetContent.add(function(ed, o) { - * // Replace all a characters with b - * o.content = o.content.replace(/a/g, 'b'); - * }); - * } - * }); - */ - 'onGetContent', - - /** - * Fires when the editor gets loaded with contents for example when the load method is executed. - * - * @event onLoadContent - * @param {tinymce.Editor} sender Editor instance. - * @example - * // Adds an observer to the onLoadContent event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onLoadContent.add(function(ed, o) { - * // Output the element name - * console.debug(o.element.nodeName); - * }); - * } - * }); - */ - 'onLoadContent', - - /** - * Fires when the editor contents gets saved for example when the save method is executed. - * - * @event onSaveContent - * @param {tinymce.Editor} sender Editor instance. - * @example - * // Adds an observer to the onSaveContent event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onSaveContent.add(function(ed, o) { - * // Output the element name - * console.debug(o.element.nodeName); - * }); - * } - * }); - */ - 'onSaveContent', - - /** - * Fires when the user changes node location using the mouse or keyboard. - * - * @event onNodeChange - * @param {tinymce.Editor} sender Editor instance. - * @example - * // Adds an observer to the onNodeChange event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onNodeChange.add(function(ed, cm, e) { - * // Activates the link button when the caret is placed in a anchor element - * if (e.nodeName == 'A') - * cm.setActive('link', true); - * }); - * } - * }); - */ - 'onNodeChange', - - /** - * Fires when a new undo level is added to the editor. - * - * @event onChange - * @param {tinymce.Editor} sender Editor instance. - * @example - * // Adds an observer to the onChange event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onChange.add(function(ed, l) { - * console.debug('Editor contents was modified. Contents: ' + l.content); - * }); - * } - * }); - */ - 'onChange', - - /** - * Fires before a command gets executed for example "Bold". - * - * @event onBeforeExecCommand - * @param {tinymce.Editor} sender Editor instance. - * @example - * // Adds an observer to the onBeforeExecCommand event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) { - * console.debug('Command is to be executed: ' + cmd); - * }); - * } - * }); - */ - 'onBeforeExecCommand', - - /** - * Fires after a command is executed for example "Bold". - * - * @event onExecCommand - * @param {tinymce.Editor} sender Editor instance. - * @example - * // Adds an observer to the onExecCommand event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onExecCommand.add(function(ed, cmd, ui, val) { - * console.debug('Command was executed: ' + cmd); - * }); - * } - * }); - */ - 'onExecCommand', - - /** - * Fires when the contents is undo:ed. - * - * @event onUndo - * @param {tinymce.Editor} sender Editor instance. - * @param {Object} level Undo level object. - * @ example - * // Adds an observer to the onUndo event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onUndo.add(function(ed, level) { - * console.debug('Undo was performed: ' + level.content); - * }); - * } - * }); - */ - 'onUndo', - - /** - * Fires when the contents is redo:ed. - * - * @event onRedo - * @param {tinymce.Editor} sender Editor instance. - * @param {Object} level Undo level object. - * @example - * // Adds an observer to the onRedo event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onRedo.add(function(ed, level) { - * console.debug('Redo was performed: ' +level.content); - * }); - * } - * }); - */ - 'onRedo', - - /** - * Fires when visual aids is enabled/disabled. - * - * @event onVisualAid - * @param {tinymce.Editor} sender Editor instance. - * @example - * // Adds an observer to the onVisualAid event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onVisualAid.add(function(ed, e, s) { - * console.debug('onVisualAid event: ' + ed.id + ", State: " + s); - * }); - * } - * }); - */ - 'onVisualAid', - - /** - * Fires when the progress throbber is shown above the editor. - * - * @event onSetProgressState - * @param {tinymce.Editor} sender Editor instance. - * @example - * // Adds an observer to the onSetProgressState event using tinyMCE.init - * tinyMCE.init({ - * ... - * setup : function(ed) { - * ed.onSetProgressState.add(function(ed, b) { - * if (b) - * console.debug('SHOW!'); - * else - * console.debug('HIDE!'); - * }); - * } - * }); - */ - 'onSetProgressState' - ], function(e) { - t[e] = new Dispatcher(t); - }); - - /** - * Name/value collection with editor settings. - * - * @property settings - * @type Object - * @example - * // Get the value of the theme setting - * tinyMCE.activeEditor.windowManager.alert("You are using the " + tinyMCE.activeEditor.settings.theme + " theme"); - */ - t.settings = s = extend({ - id : id, - language : 'en', - docs_language : 'en', - theme : 'simple', - skin : 'default', - delta_width : 0, - delta_height : 0, - popup_css : '', - plugins : '', - document_base_url : tinymce.documentBaseURL, - add_form_submit_trigger : 1, - submit_patch : 1, - add_unload_trigger : 1, - convert_urls : 1, - relative_urls : 1, - remove_script_host : 1, - table_inline_editing : 0, - object_resizing : 1, - cleanup : 1, - accessibility_focus : 1, - custom_shortcuts : 1, - custom_undo_redo_keyboard_shortcuts : 1, - custom_undo_redo_restore_selection : 1, - custom_undo_redo : 1, - doctype : tinymce.isIE6 ? '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' : '<!DOCTYPE>', // Use old doctype on IE 6 to avoid horizontal scroll - visual_table_class : 'mceItemTable', - visual : 1, - font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large', - font_size_legacy_values : 'xx-small,small,medium,large,x-large,xx-large,300%', // See: http://www.w3.org/TR/CSS2/fonts.html#propdef-font-size - apply_source_formatting : 1, - directionality : 'ltr', - forced_root_block : 'p', - hidden_input : 1, - padd_empty_editor : 1, - render_ui : 1, - init_theme : 1, - force_p_newlines : 1, - indentation : '30px', - keep_styles : 1, - fix_table_elements : 1, - inline_styles : 1, - convert_fonts_to_spans : true, - indent : 'simple', - indent_before : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr', - indent_after : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr', - validate : true, - entity_encoding : 'named', - url_converter : t.convertURL, - url_converter_scope : t, - ie7_compat : true - }, s); - - /** - * URI object to document configured for the TinyMCE instance. - * - * @property documentBaseURI - * @type tinymce.util.URI - * @example - * // Get relative URL from the location of document_base_url - * tinyMCE.activeEditor.documentBaseURI.toRelative('/somedir/somefile.htm'); - * - * // Get absolute URL from the location of document_base_url - * tinyMCE.activeEditor.documentBaseURI.toAbsolute('somefile.htm'); - */ - t.documentBaseURI = new tinymce.util.URI(s.document_base_url || tinymce.documentBaseURL, { - base_uri : tinyMCE.baseURI - }); - - /** - * URI object to current document that holds the TinyMCE editor instance. - * - * @property baseURI - * @type tinymce.util.URI - * @example - * // Get relative URL from the location of the API - * tinyMCE.activeEditor.baseURI.toRelative('/somedir/somefile.htm'); - * - * // Get absolute URL from the location of the API - * tinyMCE.activeEditor.baseURI.toAbsolute('somefile.htm'); - */ - t.baseURI = tinymce.baseURI; - - /** - * Array with CSS files to load into the iframe. - * - * @property contentCSS - * @type Array - */ - t.contentCSS = []; - - // Call setup - t.execCallback('setup', t); - }, - - /** - * Renderes the editor/adds it to the page. - * - * @method render - */ - render : function(nst) { - var t = this, s = t.settings, id = t.id, sl = tinymce.ScriptLoader; - - // Page is not loaded yet, wait for it - if (!Event.domLoaded) { - Event.add(document, 'init', function() { - t.render(); - }); - return; - } - - tinyMCE.settings = s; - - // Element not found, then skip initialization - if (!t.getElement()) - return; - - // Is a iPad/iPhone and not on iOS5, then skip initialization. We need to sniff - // here since the browser says it has contentEditable support but there is no visible - // caret We will remove this check ones Apple implements full contentEditable support - if (tinymce.isIDevice && !tinymce.isIOS5) - return; - - // Add hidden input for non input elements inside form elements - if (!/TEXTAREA|INPUT/i.test(t.getElement().nodeName) && s.hidden_input && DOM.getParent(id, 'form')) - DOM.insertAfter(DOM.create('input', {type : 'hidden', name : id}), id); - - /** - * Window manager reference, use this to open new windows and dialogs. - * - * @property windowManager - * @type tinymce.WindowManager - * @example - * // Shows an alert message - * tinyMCE.activeEditor.windowManager.alert('Hello world!'); - * - * // Opens a new dialog with the file.htm file and the size 320x240 - * // It also adds a custom parameter this can be retrieved by using tinyMCEPopup.getWindowArg inside the dialog. - * tinyMCE.activeEditor.windowManager.open({ - * url : 'file.htm', - * width : 320, - * height : 240 - * }, { - * custom_param : 1 - * }); - */ - if (tinymce.WindowManager) - t.windowManager = new tinymce.WindowManager(t); - - if (s.encoding == 'xml') { - t.onGetContent.add(function(ed, o) { - if (o.save) - o.content = DOM.encode(o.content); - }); - } - - if (s.add_form_submit_trigger) { - t.onSubmit.addToTop(function() { - if (t.initialized) { - t.save(); - t.isNotDirty = 1; - } - }); - } - - if (s.add_unload_trigger) { - t._beforeUnload = tinyMCE.onBeforeUnload.add(function() { - if (t.initialized && !t.destroyed && !t.isHidden()) - t.save({format : 'raw', no_events : true}); - }); - } - - tinymce.addUnload(t.destroy, t); - - if (s.submit_patch) { - t.onBeforeRenderUI.add(function() { - var n = t.getElement().form; - - if (!n) - return; - - // Already patched - if (n._mceOldSubmit) - return; - - // Check page uses id="submit" or name="submit" for it's submit button - if (!n.submit.nodeType && !n.submit.length) { - t.formElement = n; - n._mceOldSubmit = n.submit; - n.submit = function() { - // Save all instances - tinymce.triggerSave(); - t.isNotDirty = 1; - - return t.formElement._mceOldSubmit(t.formElement); - }; - } - - n = null; - }); - } - - // Load scripts - function loadScripts() { - if (s.language && s.language_load !== false) - sl.add(tinymce.baseURL + '/langs/' + s.language + '.js'); - - if (s.theme && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme]) - ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js'); - - each(explode(s.plugins), function(p) { - if (p &&!PluginManager.urls[p]) { - if (p.charAt(0) == '-') { - p = p.substr(1, p.length); - var dependencies = PluginManager.dependencies(p); - each(dependencies, function(dep) { - var defaultSettings = {prefix:'plugins/', resource: dep, suffix:'/editor_plugin' + tinymce.suffix + '.js'}; - var dep = PluginManager.createUrl(defaultSettings, dep); - PluginManager.load(dep.resource, dep); - - }); - } else { - // Skip safari plugin, since it is removed as of 3.3b1 - if (p == 'safari') { - return; - } - PluginManager.load(p, {prefix:'plugins/', resource: p, suffix:'/editor_plugin' + tinymce.suffix + '.js'}); - } - } - }); - - // Init when que is loaded - sl.loadQueue(function() { - if (!t.removed) - t.init(); - }); - }; - - loadScripts(); - }, - - /** - * Initializes the editor this will be called automatically when - * all plugins/themes and language packs are loaded by the rendered method. - * This method will setup the iframe and create the theme and plugin instances. - * - * @method init - */ - init : function() { - var n, t = this, s = t.settings, w, h, e = t.getElement(), o, ti, u, bi, bc, re, i, initializedPlugins = []; - - tinymce.add(t); - - s.aria_label = s.aria_label || DOM.getAttrib(e, 'aria-label', t.getLang('aria.rich_text_area')); - - /** - * Reference to the theme instance that was used to generate the UI. - * - * @property theme - * @type tinymce.Theme - * @example - * // Executes a method on the theme directly - * tinyMCE.activeEditor.theme.someMethod(); - */ - if (s.theme) { - s.theme = s.theme.replace(/-/, ''); - o = ThemeManager.get(s.theme); - t.theme = new o(); - - if (t.theme.init && s.init_theme) - t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, '')); - } - function initPlugin(p) { - var c = PluginManager.get(p), u = PluginManager.urls[p] || tinymce.documentBaseURL.replace(/\/$/, ''), po; - if (c && tinymce.inArray(initializedPlugins,p) === -1) { - each(PluginManager.dependencies(p), function(dep){ - initPlugin(dep); - }); - po = new c(t, u); - - t.plugins[p] = po; - - if (po.init) { - po.init(t, u); - initializedPlugins.push(p); - } - } - } - - // Create all plugins - each(explode(s.plugins.replace(/\-/g, '')), initPlugin); - - // Setup popup CSS path(s) - if (s.popup_css !== false) { - if (s.popup_css) - s.popup_css = t.documentBaseURI.toAbsolute(s.popup_css); - else - s.popup_css = t.baseURI.toAbsolute("themes/" + s.theme + "/skins/" + s.skin + "/dialog.css"); - } - - if (s.popup_css_add) - s.popup_css += ',' + t.documentBaseURI.toAbsolute(s.popup_css_add); - - /** - * Control manager instance for the editor. Will enables you to create new UI elements and change their states etc. - * - * @property controlManager - * @type tinymce.ControlManager - * @example - * // Disables the bold button - * tinyMCE.activeEditor.controlManager.setDisabled('bold', true); - */ - t.controlManager = new tinymce.ControlManager(t); - - if (s.custom_undo_redo) { - t.onBeforeExecCommand.add(function(ed, cmd, ui, val, a) { - if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo)) - t.undoManager.beforeChange(); - }); - - t.onExecCommand.add(function(ed, cmd, ui, val, a) { - if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo)) - t.undoManager.add(); - }); - } - - t.onExecCommand.add(function(ed, c) { - // Don't refresh the select lists until caret move - if (!/^(FontName|FontSize)$/.test(c)) - t.nodeChanged(); - }); - - // Remove ghost selections on images and tables in Gecko - if (isGecko) { - function repaint(a, o) { - if (!o || !o.initial) - t.execCommand('mceRepaint'); - }; - - t.onUndo.add(repaint); - t.onRedo.add(repaint); - t.onSetContent.add(repaint); - } - - // Enables users to override the control factory - t.onBeforeRenderUI.dispatch(t, t.controlManager); - - // Measure box - if (s.render_ui) { - w = s.width || e.style.width || e.offsetWidth; - h = s.height || e.style.height || e.offsetHeight; - t.orgDisplay = e.style.display; - re = /^[0-9\.]+(|px)$/i; - - if (re.test('' + w)) - w = Math.max(parseInt(w) + (o.deltaWidth || 0), 100); - - if (re.test('' + h)) - h = Math.max(parseInt(h) + (o.deltaHeight || 0), 100); - - // Render UI - o = t.theme.renderUI({ - targetNode : e, - width : w, - height : h, - deltaWidth : s.delta_width, - deltaHeight : s.delta_height - }); - - t.editorContainer = o.editorContainer; - } - - // #ifdef contentEditable - - // Content editable mode ends here - if (s.content_editable) { - e = n = o = null; // Fix IE leak - return t.setupContentEditable(); - } - - // #endif - - // User specified a document.domain value - if (document.domain && location.hostname != document.domain) - tinymce.relaxedDomain = document.domain; - - // Resize editor - DOM.setStyles(o.sizeContainer || o.editorContainer, { - width : w, - height : h - }); - - // Load specified content CSS last - if (s.content_css) { - tinymce.each(explode(s.content_css), function(u) { - t.contentCSS.push(t.documentBaseURI.toAbsolute(u)); - }); - } - - h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : ''); - if (h < 100) - h = 100; - - t.iframeHTML = s.doctype + '<html><head xmlns="http://www.w3.org/1999/xhtml">'; - - // We only need to override paths if we have to - // IE has a bug where it remove site absolute urls to relative ones if this is specified - if (s.document_base_url != tinymce.documentBaseURL) - t.iframeHTML += '<base href="' + t.documentBaseURI.getURI() + '" />'; - - // IE8 doesn't support carets behind images setting ie7_compat would force IE8+ to run in IE7 compat mode. - if (s.ie7_compat) - t.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=7" />'; - else - t.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=edge" />'; - - t.iframeHTML += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'; - - // Load the CSS by injecting them into the HTML this will reduce "flicker" - for (i = 0; i < t.contentCSS.length; i++) { - t.iframeHTML += '<link type="text/css" rel="stylesheet" href="' + t.contentCSS[i] + '" />'; - } - - bi = s.body_id || 'tinymce'; - if (bi.indexOf('=') != -1) { - bi = t.getParam('body_id', '', 'hash'); - bi = bi[t.id] || bi; - } - - bc = s.body_class || ''; - if (bc.indexOf('=') != -1) { - bc = t.getParam('body_class', '', 'hash'); - bc = bc[t.id] || ''; - } - - t.iframeHTML += '</head><body id="' + bi + '" class="mceContentBody ' + bc + '"><br></body></html>'; - - // Domain relaxing enabled, then set document domain - if (tinymce.relaxedDomain && (isIE || (tinymce.isOpera && parseFloat(opera.version()) < 11))) { - // We need to write the contents here in IE since multiple writes messes up refresh button and back button - u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'; - } - - // Create iframe - // TODO: ACC add the appropriate description on this. - n = DOM.add(o.iframeContainer, 'iframe', { - id : t.id + "_ifr", - src : u || 'javascript:""', // Workaround for HTTPS warning in IE6/7 - frameBorder : '0', - allowTransparency : "true", - title : s.aria_label, - style : { - width : '100%', - height : h, - display : 'block' // Important for Gecko to render the iframe correctly - } - }); - - t.contentAreaContainer = o.iframeContainer; - DOM.get(o.editorContainer).style.display = t.orgDisplay; - DOM.get(t.id).style.display = 'none'; - DOM.setAttrib(t.id, 'aria-hidden', true); - - if (!tinymce.relaxedDomain || !u) - t.setupIframe(); - - e = n = o = null; // Cleanup - }, - - /** - * This method get called by the init method ones the iframe is loaded. - * It will fill the iframe with contents, setups DOM and selection objects for the iframe. - * This method should not be called directly. - * - * @method setupIframe - */ - setupIframe : function() { - var t = this, s = t.settings, e = DOM.get(t.id), d = t.getDoc(), h, b; - - // Setup iframe body - if (!isIE || !tinymce.relaxedDomain) { - d.open(); - d.write(t.iframeHTML); - d.close(); - - if (tinymce.relaxedDomain) - d.domain = tinymce.relaxedDomain; - } - - // It will not steal focus while setting contentEditable - b = t.getBody(); - b.disabled = true; - - if (!s.readonly) - b.contentEditable = true; - - b.disabled = false; - - /** - * Schema instance, enables you to validate elements and it's children. - * - * @property schema - * @type tinymce.html.Schema - */ - t.schema = new tinymce.html.Schema(s); - - /** - * DOM instance for the editor. - * - * @property dom - * @type tinymce.dom.DOMUtils - * @example - * // Adds a class to all paragraphs within the editor - * tinyMCE.activeEditor.dom.addClass(tinyMCE.activeEditor.dom.select('p'), 'someclass'); - */ - t.dom = new tinymce.dom.DOMUtils(t.getDoc(), { - keep_values : true, - url_converter : t.convertURL, - url_converter_scope : t, - hex_colors : s.force_hex_style_colors, - class_filter : s.class_filter, - update_styles : 1, - fix_ie_paragraphs : 1, - schema : t.schema - }); - - /** - * HTML parser will be used when contents is inserted into the editor. - * - * @property parser - * @type tinymce.html.DomParser - */ - t.parser = new tinymce.html.DomParser(s, t.schema); - - // Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included. - if (!t.settings.allow_html_in_named_anchor) { - t.parser.addAttributeFilter('name', function(nodes, name) { - var i = nodes.length, sibling, prevSibling, parent, node; - - while (i--) { - node = nodes[i]; - if (node.name === 'a' && node.firstChild) { - parent = node.parent; - - // Move children after current node - sibling = node.lastChild; - do { - prevSibling = sibling.prev; - parent.insert(sibling, node); - sibling = prevSibling; - } while (sibling); - } - } - }); - } - - // Convert src and href into data-mce-src, data-mce-href and data-mce-style - t.parser.addAttributeFilter('src,href,style', function(nodes, name) { - var i = nodes.length, node, dom = t.dom, value, internalName; - - while (i--) { - node = nodes[i]; - value = node.attr(name); - internalName = 'data-mce-' + name; - - // Add internal attribute if we need to we don't on a refresh of the document - if (!node.attributes.map[internalName]) { - if (name === "style") - node.attr(internalName, dom.serializeStyle(dom.parseStyle(value), node.name)); - else - node.attr(internalName, t.convertURL(value, name, node.name)); - } - } - }); - - // Keep scripts from executing - t.parser.addNodeFilter('script', function(nodes, name) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - node.attr('type', 'mce-' + (node.attr('type') || 'text/javascript')); - } - }); - - t.parser.addNodeFilter('#cdata', function(nodes, name) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - node.type = 8; - node.name = '#comment'; - node.value = '[CDATA[' + node.value + ']]'; - } - }); - - t.parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function(nodes, name) { - var i = nodes.length, node, nonEmptyElements = t.schema.getNonEmptyElements(); - - while (i--) { - node = nodes[i]; - - if (node.isEmpty(nonEmptyElements)) - node.empty().append(new tinymce.html.Node('br', 1)).shortEnded = true; - } - }); - - /** - * DOM serializer for the editor. Will be used when contents is extracted from the editor. - * - * @property serializer - * @type tinymce.dom.Serializer - * @example - * // Serializes the first paragraph in the editor into a string - * tinyMCE.activeEditor.serializer.serialize(tinyMCE.activeEditor.dom.select('p')[0]); - */ - t.serializer = new tinymce.dom.Serializer(s, t.dom, t.schema); - - /** - * Selection instance for the editor. - * - * @property selection - * @type tinymce.dom.Selection - * @example - * // Sets some contents to the current selection in the editor - * tinyMCE.activeEditor.selection.setContent('Some contents'); - * - * // Gets the current selection - * alert(tinyMCE.activeEditor.selection.getContent()); - * - * // Selects the first paragraph found - * tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.dom.select('p')[0]); - */ - t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer); - - /** - * Formatter instance. - * - * @property formatter - * @type tinymce.Formatter - */ - t.formatter = new tinymce.Formatter(this); - - // Register default formats - t.formatter.register({ - alignleft : [ - {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}}, - {selector : 'img,table', collapsed : false, styles : {'float' : 'left'}} - ], - - aligncenter : [ - {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}}, - {selector : 'img', collapsed : false, styles : {display : 'block', marginLeft : 'auto', marginRight : 'auto'}}, - {selector : 'table', collapsed : false, styles : {marginLeft : 'auto', marginRight : 'auto'}} - ], - - alignright : [ - {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}}, - {selector : 'img,table', collapsed : false, styles : {'float' : 'right'}} - ], - - alignfull : [ - {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'justify'}} - ], - - bold : [ - {inline : 'strong', remove : 'all'}, - {inline : 'span', styles : {fontWeight : 'bold'}}, - {inline : 'b', remove : 'all'} - ], - - italic : [ - {inline : 'em', remove : 'all'}, - {inline : 'span', styles : {fontStyle : 'italic'}}, - {inline : 'i', remove : 'all'} - ], - - underline : [ - {inline : 'span', styles : {textDecoration : 'underline'}, exact : true}, - {inline : 'u', remove : 'all'} - ], - - strikethrough : [ - {inline : 'span', styles : {textDecoration : 'line-through'}, exact : true}, - {inline : 'strike', remove : 'all'} - ], - - forecolor : {inline : 'span', styles : {color : '%value'}, wrap_links : false}, - hilitecolor : {inline : 'span', styles : {backgroundColor : '%value'}, wrap_links : false}, - fontname : {inline : 'span', styles : {fontFamily : '%value'}}, - fontsize : {inline : 'span', styles : {fontSize : '%value'}}, - fontsize_class : {inline : 'span', attributes : {'class' : '%value'}}, - blockquote : {block : 'blockquote', wrapper : 1, remove : 'all'}, - subscript : {inline : 'sub'}, - superscript : {inline : 'sup'}, - - link : {inline : 'a', selector : 'a', remove : 'all', split : true, deep : true, - onmatch : function(node) { - return true; - }, - - onformat : function(elm, fmt, vars) { - each(vars, function(value, key) { - t.dom.setAttrib(elm, key, value); - }); - } - }, - - removeformat : [ - {selector : 'b,strong,em,i,font,u,strike', remove : 'all', split : true, expand : false, block_expand : true, deep : true}, - {selector : 'span', attributes : ['style', 'class'], remove : 'empty', split : true, expand : false, deep : true}, - {selector : '*', attributes : ['style', 'class'], split : false, expand : false, deep : true} - ] - }); - - // Register default block formats - each('p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp'.split(/\s/), function(name) { - t.formatter.register(name, {block : name, remove : 'all'}); - }); - - // Register user defined formats - t.formatter.register(t.settings.formats); - - /** - * Undo manager instance, responsible for handling undo levels. - * - * @property undoManager - * @type tinymce.UndoManager - * @example - * // Undoes the last modification to the editor - * tinyMCE.activeEditor.undoManager.undo(); - */ - t.undoManager = new tinymce.UndoManager(t); - - // Pass through - t.undoManager.onAdd.add(function(um, l) { - if (um.hasUndo()) - return t.onChange.dispatch(t, l, um); - }); - - t.undoManager.onUndo.add(function(um, l) { - return t.onUndo.dispatch(t, l, um); - }); - - t.undoManager.onRedo.add(function(um, l) { - return t.onRedo.dispatch(t, l, um); - }); - - t.forceBlocks = new tinymce.ForceBlocks(t, { - forced_root_block : s.forced_root_block - }); - - t.editorCommands = new tinymce.EditorCommands(t); - - // Pass through - t.serializer.onPreProcess.add(function(se, o) { - return t.onPreProcess.dispatch(t, o, se); - }); - - t.serializer.onPostProcess.add(function(se, o) { - return t.onPostProcess.dispatch(t, o, se); - }); - - t.onPreInit.dispatch(t); - - if (!s.gecko_spellcheck) - t.getBody().spellcheck = 0; - - if (!s.readonly) - t._addEvents(); - - t.controlManager.onPostRender.dispatch(t, t.controlManager); - t.onPostRender.dispatch(t); - - t.quirks = new tinymce.util.Quirks(this); - - if (s.directionality) - t.getBody().dir = s.directionality; - - if (s.nowrap) - t.getBody().style.whiteSpace = "nowrap"; - - if (s.handle_node_change_callback) { - t.onNodeChange.add(function(ed, cm, n) { - t.execCallback('handle_node_change_callback', t.id, n, -1, -1, true, t.selection.isCollapsed()); - }); - } - - if (s.save_callback) { - t.onSaveContent.add(function(ed, o) { - var h = t.execCallback('save_callback', t.id, o.content, t.getBody()); - - if (h) - o.content = h; - }); - } - - if (s.onchange_callback) { - t.onChange.add(function(ed, l) { - t.execCallback('onchange_callback', t, l); - }); - } - - if (s.protect) { - t.onBeforeSetContent.add(function(ed, o) { - if (s.protect) { - each(s.protect, function(pattern) { - o.content = o.content.replace(pattern, function(str) { - return '<!--mce:protected ' + escape(str) + '-->'; - }); - }); - } - }); - } - - if (s.convert_newlines_to_brs) { - t.onBeforeSetContent.add(function(ed, o) { - if (o.initial) - o.content = o.content.replace(/\r?\n/g, '<br />'); - }); - } - - if (s.preformatted) { - t.onPostProcess.add(function(ed, o) { - o.content = o.content.replace(/^\s*<pre.*?>/, ''); - o.content = o.content.replace(/<\/pre>\s*$/, ''); - - if (o.set) - o.content = '<pre class="mceItemHidden">' + o.content + '</pre>'; - }); - } - - if (s.verify_css_classes) { - t.serializer.attribValueFilter = function(n, v) { - var s, cl; - - if (n == 'class') { - // Build regexp for classes - if (!t.classesRE) { - cl = t.dom.getClasses(); - - if (cl.length > 0) { - s = ''; - - each (cl, function(o) { - s += (s ? '|' : '') + o['class']; - }); - - t.classesRE = new RegExp('(' + s + ')', 'gi'); - } - } - - return !t.classesRE || /(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v) || t.classesRE.test(v) ? v : ''; - } - - return v; - }; - } - - if (s.cleanup_callback) { - t.onBeforeSetContent.add(function(ed, o) { - o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o); - }); - - t.onPreProcess.add(function(ed, o) { - if (o.set) - t.execCallback('cleanup_callback', 'insert_to_editor_dom', o.node, o); - - if (o.get) - t.execCallback('cleanup_callback', 'get_from_editor_dom', o.node, o); - }); - - t.onPostProcess.add(function(ed, o) { - if (o.set) - o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o); - - if (o.get) - o.content = t.execCallback('cleanup_callback', 'get_from_editor', o.content, o); - }); - } - - if (s.save_callback) { - t.onGetContent.add(function(ed, o) { - if (o.save) - o.content = t.execCallback('save_callback', t.id, o.content, t.getBody()); - }); - } - - if (s.handle_event_callback) { - t.onEvent.add(function(ed, e, o) { - if (t.execCallback('handle_event_callback', e, ed, o) === false) - Event.cancel(e); - }); - } - - // Add visual aids when new contents is added - t.onSetContent.add(function() { - t.addVisual(t.getBody()); - }); - - // Remove empty contents - if (s.padd_empty_editor) { - t.onPostProcess.add(function(ed, o) { - o.content = o.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/, ''); - }); - } - - if (isGecko) { - // Fix gecko link bug, when a link is placed at the end of block elements there is - // no way to move the caret behind the link. This fix adds a bogus br element after the link - function fixLinks(ed, o) { - each(ed.dom.select('a'), function(n) { - var pn = n.parentNode; - - if (ed.dom.isBlock(pn) && pn.lastChild === n) - ed.dom.add(pn, 'br', {'data-mce-bogus' : 1}); - }); - }; - - t.onExecCommand.add(function(ed, cmd) { - if (cmd === 'CreateLink') - fixLinks(ed); - }); - - t.onSetContent.add(t.selection.onSetContent.add(fixLinks)); - } - - t.load({initial : true, format : 'html'}); - t.startContent = t.getContent({format : 'raw'}); - t.undoManager.add(); - t.initialized = true; - - t.onInit.dispatch(t); - t.execCallback('setupcontent_callback', t.id, t.getBody(), t.getDoc()); - t.execCallback('init_instance_callback', t); - t.focus(true); - t.nodeChanged({initial : 1}); - - // Load specified content CSS last - each(t.contentCSS, function(u) { - t.dom.loadCSS(u); - }); - - // Handle auto focus - if (s.auto_focus) { - setTimeout(function () { - var ed = tinymce.get(s.auto_focus); - - ed.selection.select(ed.getBody(), 1); - ed.selection.collapse(1); - ed.getBody().focus(); - ed.getWin().focus(); - }, 100); - } - - e = null; - }, - - // #ifdef contentEditable - - /** - * Sets up the contentEditable mode. - * - * @method setupContentEditable - */ - setupContentEditable : function() { - var t = this, s = t.settings, e = t.getElement(); - - t.contentDocument = s.content_document || document; - t.contentWindow = s.content_window || window; - t.bodyElement = e; - - // Prevent leak in IE - s.content_document = s.content_window = null; - - DOM.hide(e); - e.contentEditable = t.getParam('content_editable_state', true); - DOM.show(e); - - if (!s.gecko_spellcheck) - t.getDoc().body.spellcheck = 0; - - // Setup objects - t.dom = new tinymce.dom.DOMUtils(t.getDoc(), { - keep_values : true, - url_converter : t.convertURL, - url_converter_scope : t, - hex_colors : s.force_hex_style_colors, - class_filter : s.class_filter, - root_element : t.id, - fix_ie_paragraphs : 1, - update_styles : 1 - }); - - t.serializer = new tinymce.dom.Serializer(s, t.dom, schema); - - t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer); - t.forceBlocks = new tinymce.ForceBlocks(t, { - forced_root_block : s.forced_root_block - }); - - t.editorCommands = new tinymce.EditorCommands(t); - - // Pass through - t.serializer.onPreProcess.add(function(se, o) { - return t.onPreProcess.dispatch(t, o, se); - }); - - t.serializer.onPostProcess.add(function(se, o) { - return t.onPostProcess.dispatch(t, o, se); - }); - - t.onPreInit.dispatch(t); - t._addEvents(); - - t.controlManager.onPostRender.dispatch(t, t.controlManager); - t.onPostRender.dispatch(t); - - t.onSetContent.add(function() { - t.addVisual(t.getBody()); - }); - - //t.load({initial : true, format : (s.cleanup_on_startup ? 'html' : 'raw')}); - t.startContent = t.getContent({format : 'raw'}); - t.undoManager.add({initial : true}); - t.initialized = true; - - t.onInit.dispatch(t); - t.focus(true); - t.nodeChanged({initial : 1}); - - // Load specified content CSS last - if (s.content_css) { - each(explode(s.content_css), function(u) { - t.dom.loadCSS(t.documentBaseURI.toAbsolute(u)); - }); - } - - if (isIE) { - // Store away selection - t.dom.bind(t.getElement(), 'beforedeactivate', function() { - t.lastSelectionBookmark = t.selection.getBookmark(1); - }); - - t.onBeforeExecCommand.add(function(ed, cmd, ui, val, o) { - if (!DOM.getParent(ed.selection.getStart(), function(n) {return n == ed.getBody();})) - o.terminate = 1; - - if (!DOM.getParent(ed.selection.getEnd(), function(n) {return n == ed.getBody();})) - o.terminate = 1; - }); - } - - e = null; // Cleanup - }, - - // #endif - - /** - * Focuses/activates the editor. This will set this editor as the activeEditor in the tinymce collection - * it will also place DOM focus inside the editor. - * - * @method focus - * @param {Boolean} sf Skip DOM focus. Just set is as the active editor. - */ - focus : function(sf) { - var oed, t = this, selection = t.selection, ce = t.settings.content_editable, ieRng, controlElm, doc = t.getDoc(); - - if (!sf) { - // Get selected control element - ieRng = selection.getRng(); - if (ieRng.item) { - controlElm = ieRng.item(0); - } - - t._refreshContentEditable(); - selection.normalize(); - - // Is not content editable - if (!ce) - t.getWin().focus(); - - // Focus the body as well since it's contentEditable - if (tinymce.isGecko) { - t.getBody().focus(); - } - - // Restore selected control element - // This is needed when for example an image is selected within a - // layer a call to focus will then remove the control selection - if (controlElm && controlElm.ownerDocument == doc) { - ieRng = doc.body.createControlRange(); - ieRng.addElement(controlElm); - ieRng.select(); - } - - // #ifdef contentEditable - - // Content editable mode ends here - if (ce) { - if (tinymce.isWebKit) - t.getWin().focus(); - else { - if (tinymce.isIE) - t.getElement().setActive(); - else - t.getElement().focus(); - } - } - - // #endif - } - - if (tinymce.activeEditor != t) { - if ((oed = tinymce.activeEditor) != null) - oed.onDeactivate.dispatch(oed, t); - - t.onActivate.dispatch(t, oed); - } - - tinymce._setActive(t); - }, - - /** - * Executes a legacy callback. This method is useful to call old 2.x option callbacks. - * There new event model is a better way to add callback so this method might be removed in the future. - * - * @method execCallback - * @param {String} n Name of the callback to execute. - * @return {Object} Return value passed from callback function. - */ - execCallback : function(n) { - var t = this, f = t.settings[n], s; - - if (!f) - return; - - // Look through lookup - if (t.callbackLookup && (s = t.callbackLookup[n])) { - f = s.func; - s = s.scope; - } - - if (is(f, 'string')) { - s = f.replace(/\.\w+$/, ''); - s = s ? tinymce.resolve(s) : 0; - f = tinymce.resolve(f); - t.callbackLookup = t.callbackLookup || {}; - t.callbackLookup[n] = {func : f, scope : s}; - } - - return f.apply(s || t, Array.prototype.slice.call(arguments, 1)); - }, - - /** - * Translates the specified string by replacing variables with language pack items it will also check if there is - * a key mathcin the input. - * - * @method translate - * @param {String} s String to translate by the language pack data. - * @return {String} Translated string. - */ - translate : function(s) { - var c = this.settings.language || 'en', i18n = tinymce.i18n; - - if (!s) - return ''; - - return i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) { - return i18n[c + '.' + b] || '{#' + b + '}'; - }); - }, - - /** - * Returns a language pack item by name/key. - * - * @method getLang - * @param {String} n Name/key to get from the language pack. - * @param {String} dv Optional default value to retrieve. - */ - getLang : function(n, dv) { - return tinymce.i18n[(this.settings.language || 'en') + '.' + n] || (is(dv) ? dv : '{#' + n + '}'); - }, - - /** - * Returns a configuration parameter by name. - * - * @method getParam - * @param {String} n Configruation parameter to retrieve. - * @param {String} dv Optional default value to return. - * @param {String} ty Optional type parameter. - * @return {String} Configuration parameter value or default value. - * @example - * // Returns a specific config value from the currently active editor - * var someval = tinyMCE.activeEditor.getParam('myvalue'); - * - * // Returns a specific config value from a specific editor instance by id - * var someval2 = tinyMCE.get('my_editor').getParam('myvalue'); - */ - getParam : function(n, dv, ty) { - var tr = tinymce.trim, v = is(this.settings[n]) ? this.settings[n] : dv, o; - - if (ty === 'hash') { - o = {}; - - if (is(v, 'string')) { - each(v.indexOf('=') > 0 ? v.split(/[;,](?![^=;,]*(?:[;,]|$))/) : v.split(','), function(v) { - v = v.split('='); - - if (v.length > 1) - o[tr(v[0])] = tr(v[1]); - else - o[tr(v[0])] = tr(v); - }); - } else - o = v; - - return o; - } - - return v; - }, - - /** - * Distpaches out a onNodeChange event to all observers. This method should be called when you - * need to update the UI states or element path etc. - * - * @method nodeChanged - * @param {Object} o Optional object to pass along for the node changed event. - */ - nodeChanged : function(o) { - var t = this, s = t.selection, n = s.getStart() || t.getBody(); - - // Fix for bug #1896577 it seems that this can not be fired while the editor is loading - if (t.initialized) { - o = o || {}; - n = isIE && n.ownerDocument != t.getDoc() ? t.getBody() : n; // Fix for IE initial state - - // Get parents and add them to object - o.parents = []; - t.dom.getParent(n, function(node) { - if (node.nodeName == 'BODY') - return true; - - o.parents.push(node); - }); - - t.onNodeChange.dispatch( - t, - o ? o.controlManager || t.controlManager : t.controlManager, - n, - s.isCollapsed(), - o - ); - } - }, - - /** - * Adds a button that later gets created by the ControlManager. This is a shorter and easier method - * of adding buttons without the need to deal with the ControlManager directly. But it's also less - * powerfull if you need more control use the ControlManagers factory methods instead. - * - * @method addButton - * @param {String} n Button name to add. - * @param {Object} s Settings object with title, cmd etc. - * @example - * // Adds a custom button to the editor and when a user clicks the button it will open - * // an alert box with the selected contents as plain text. - * tinyMCE.init({ - * ... - * - * theme_advanced_buttons1 : 'example,..' - * - * setup : function(ed) { - * // Register example button - * ed.addButton('example', { - * title : 'example.desc', - * image : '../jscripts/tiny_mce/plugins/example/img/example.gif', - * onclick : function() { - * ed.windowManager.alert('Hello world!! Selection: ' + ed.selection.getContent({format : 'text'})); - * } - * }); - * } - * }); - */ - addButton : function(n, s) { - var t = this; - - t.buttons = t.buttons || {}; - t.buttons[n] = s; - }, - - /** - * Adds a custom command to the editor, you can also override existing commands with this method. - * The command that you add can be executed with execCommand. - * - * @method addCommand - * @param {String} name Command name to add/override. - * @param {addCommandCallback} callback Function to execute when the command occurs. - * @param {Object} scope Optional scope to execute the function in. - * @example - * // Adds a custom command that later can be executed using execCommand - * tinyMCE.init({ - * ... - * - * setup : function(ed) { - * // Register example command - * ed.addCommand('mycommand', function(ui, v) { - * ed.windowManager.alert('Hello world!! Selection: ' + ed.selection.getContent({format : 'text'})); - * }); - * } - * }); - */ - addCommand : function(name, callback, scope) { - /** - * Callback function that gets called when a command is executed. - * - * @callback addCommandCallback - * @param {Boolean} ui Display UI state true/false. - * @param {Object} value Optional value for command. - * @return {Boolean} True/false state if the command was handled or not. - */ - this.execCommands[name] = {func : callback, scope : scope || this}; - }, - - /** - * Adds a custom query state command to the editor, you can also override existing commands with this method. - * The command that you add can be executed with queryCommandState function. - * - * @method addQueryStateHandler - * @param {String} name Command name to add/override. - * @param {addQueryStateHandlerCallback} callback Function to execute when the command state retrival occurs. - * @param {Object} scope Optional scope to execute the function in. - */ - addQueryStateHandler : function(name, callback, scope) { - /** - * Callback function that gets called when a queryCommandState is executed. - * - * @callback addQueryStateHandlerCallback - * @return {Boolean} True/false state if the command is enabled or not like is it bold. - */ - this.queryStateCommands[name] = {func : callback, scope : scope || this}; - }, - - /** - * Adds a custom query value command to the editor, you can also override existing commands with this method. - * The command that you add can be executed with queryCommandValue function. - * - * @method addQueryValueHandler - * @param {String} name Command name to add/override. - * @param {addQueryValueHandlerCallback} callback Function to execute when the command value retrival occurs. - * @param {Object} scope Optional scope to execute the function in. - */ - addQueryValueHandler : function(name, callback, scope) { - /** - * Callback function that gets called when a queryCommandValue is executed. - * - * @callback addQueryValueHandlerCallback - * @return {Object} Value of the command or undefined. - */ - this.queryValueCommands[name] = {func : callback, scope : scope || this}; - }, - - /** - * Adds a keyboard shortcut for some command or function. - * - * @method addShortcut - * @param {String} pa Shortcut pattern. Like for example: ctrl+alt+o. - * @param {String} desc Text description for the command. - * @param {String/Function} cmd_func Command name string or function to execute when the key is pressed. - * @param {Object} sc Optional scope to execute the function in. - * @return {Boolean} true/false state if the shortcut was added or not. - */ - addShortcut : function(pa, desc, cmd_func, sc) { - var t = this, c; - - if (!t.settings.custom_shortcuts) - return false; - - t.shortcuts = t.shortcuts || {}; - - if (is(cmd_func, 'string')) { - c = cmd_func; - - cmd_func = function() { - t.execCommand(c, false, null); - }; - } - - if (is(cmd_func, 'object')) { - c = cmd_func; - - cmd_func = function() { - t.execCommand(c[0], c[1], c[2]); - }; - } - - each(explode(pa), function(pa) { - var o = { - func : cmd_func, - scope : sc || this, - desc : desc, - alt : false, - ctrl : false, - shift : false - }; - - each(explode(pa, '+'), function(v) { - switch (v) { - case 'alt': - case 'ctrl': - case 'shift': - o[v] = true; - break; - - default: - o.charCode = v.charCodeAt(0); - o.keyCode = v.toUpperCase().charCodeAt(0); - } - }); - - t.shortcuts[(o.ctrl ? 'ctrl' : '') + ',' + (o.alt ? 'alt' : '') + ',' + (o.shift ? 'shift' : '') + ',' + o.keyCode] = o; - }); - - return true; - }, - - /** - * Executes a command on the current instance. These commands can be TinyMCE internal commands prefixed with "mce" or - * they can be build in browser commands such as "Bold". A compleate list of browser commands is available on MSDN or Mozilla.org. - * This function will dispatch the execCommand function on each plugin, theme or the execcommand_callback option if none of these - * return true it will handle the command as a internal browser command. - * - * @method execCommand - * @param {String} cmd Command name to execute, for example mceLink or Bold. - * @param {Boolean} ui True/false state if a UI (dialog) should be presented or not. - * @param {mixed} val Optional command value, this can be anything. - * @param {Object} a Optional arguments object. - * @return {Boolean} True/false if the command was executed or not. - */ - execCommand : function(cmd, ui, val, a) { - var t = this, s = 0, o, st; - - if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd) && (!a || !a.skip_focus)) - t.focus(); - - o = {}; - t.onBeforeExecCommand.dispatch(t, cmd, ui, val, o); - if (o.terminate) - return false; - - // Command callback - if (t.execCallback('execcommand_callback', t.id, t.selection.getNode(), cmd, ui, val)) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - return true; - } - - // Registred commands - if (o = t.execCommands[cmd]) { - st = o.func.call(o.scope, ui, val); - - // Fall through on true - if (st !== true) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - return st; - } - } - - // Plugin commands - each(t.plugins, function(p) { - if (p.execCommand && p.execCommand(cmd, ui, val)) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - s = 1; - return false; - } - }); - - if (s) - return true; - - // Theme commands - if (t.theme && t.theme.execCommand && t.theme.execCommand(cmd, ui, val)) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - return true; - } - - // Editor commands - if (t.editorCommands.execCommand(cmd, ui, val)) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - return true; - } - - // Browser commands - t.getDoc().execCommand(cmd, ui, val); - t.onExecCommand.dispatch(t, cmd, ui, val, a); - }, - - /** - * Returns a command specific state, for example if bold is enabled or not. - * - * @method queryCommandState - * @param {string} cmd Command to query state from. - * @return {Boolean} Command specific state, for example if bold is enabled or not. - */ - queryCommandState : function(cmd) { - var t = this, o, s; - - // Is hidden then return undefined - if (t._isHidden()) - return; - - // Registred commands - if (o = t.queryStateCommands[cmd]) { - s = o.func.call(o.scope); - - // Fall though on true - if (s !== true) - return s; - } - - // Registred commands - o = t.editorCommands.queryCommandState(cmd); - if (o !== -1) - return o; - - // Browser commands - try { - return this.getDoc().queryCommandState(cmd); - } catch (ex) { - // Fails sometimes see bug: 1896577 - } - }, - - /** - * Returns a command specific value, for example the current font size. - * - * @method queryCommandValue - * @param {string} c Command to query value from. - * @return {Object} Command specific value, for example the current font size. - */ - queryCommandValue : function(c) { - var t = this, o, s; - - // Is hidden then return undefined - if (t._isHidden()) - return; - - // Registred commands - if (o = t.queryValueCommands[c]) { - s = o.func.call(o.scope); - - // Fall though on true - if (s !== true) - return s; - } - - // Registred commands - o = t.editorCommands.queryCommandValue(c); - if (is(o)) - return o; - - // Browser commands - try { - return this.getDoc().queryCommandValue(c); - } catch (ex) { - // Fails sometimes see bug: 1896577 - } - }, - - /** - * Shows the editor and hides any textarea/div that the editor is supposed to replace. - * - * @method show - */ - show : function() { - var t = this; - - DOM.show(t.getContainer()); - DOM.hide(t.id); - t.load(); - }, - - /** - * Hides the editor and shows any textarea/div that the editor is supposed to replace. - * - * @method hide - */ - hide : function() { - var t = this, d = t.getDoc(); - - // Fixed bug where IE has a blinking cursor left from the editor - if (isIE && d) - d.execCommand('SelectAll'); - - // We must save before we hide so Safari doesn't crash - t.save(); - DOM.hide(t.getContainer()); - DOM.setStyle(t.id, 'display', t.orgDisplay); - }, - - /** - * Returns true/false if the editor is hidden or not. - * - * @method isHidden - * @return {Boolean} True/false if the editor is hidden or not. - */ - isHidden : function() { - return !DOM.isHidden(this.id); - }, - - /** - * Sets the progress state, this will display a throbber/progess for the editor. - * This is ideal for asycronous operations like an AJAX save call. - * - * @method setProgressState - * @param {Boolean} b Boolean state if the progress should be shown or hidden. - * @param {Number} ti Optional time to wait before the progress gets shown. - * @param {Object} o Optional object to pass to the progress observers. - * @return {Boolean} Same as the input state. - * @example - * // Show progress for the active editor - * tinyMCE.activeEditor.setProgressState(true); - * - * // Hide progress for the active editor - * tinyMCE.activeEditor.setProgressState(false); - * - * // Show progress after 3 seconds - * tinyMCE.activeEditor.setProgressState(true, 3000); - */ - setProgressState : function(b, ti, o) { - this.onSetProgressState.dispatch(this, b, ti, o); - - return b; - }, - - /** - * Loads contents from the textarea or div element that got converted into an editor instance. - * This method will move the contents from that textarea or div into the editor by using setContent - * so all events etc that method has will get dispatched as well. - * - * @method load - * @param {Object} o Optional content object, this gets passed around through the whole load process. - * @return {String} HTML string that got set into the editor. - */ - load : function(o) { - var t = this, e = t.getElement(), h; - - if (e) { - o = o || {}; - o.load = true; - - // Double encode existing entities in the value - h = t.setContent(is(e.value) ? e.value : e.innerHTML, o); - o.element = e; - - if (!o.no_events) - t.onLoadContent.dispatch(t, o); - - o.element = e = null; - - return h; - } - }, - - /** - * Saves the contents from a editor out to the textarea or div element that got converted into an editor instance. - * This method will move the HTML contents from the editor into that textarea or div by getContent - * so all events etc that method has will get dispatched as well. - * - * @method save - * @param {Object} o Optional content object, this gets passed around through the whole save process. - * @return {String} HTML string that got set into the textarea/div. - */ - save : function(o) { - var t = this, e = t.getElement(), h, f; - - if (!e || !t.initialized) - return; - - o = o || {}; - o.save = true; - - // Add undo level will trigger onchange event - if (!o.no_events) { - t.undoManager.typing = false; - t.undoManager.add(); - } - - o.element = e; - h = o.content = t.getContent(o); - - if (!o.no_events) - t.onSaveContent.dispatch(t, o); - - h = o.content; - - if (!/TEXTAREA|INPUT/i.test(e.nodeName)) { - e.innerHTML = h; - - // Update hidden form element - if (f = DOM.getParent(t.id, 'form')) { - each(f.elements, function(e) { - if (e.name == t.id) { - e.value = h; - return false; - } - }); - } - } else - e.value = h; - - o.element = e = null; - - return h; - }, - - /** - * Sets the specified content to the editor instance, this will cleanup the content before it gets set using - * the different cleanup rules options. - * - * @method setContent - * @param {String} content Content to set to editor, normally HTML contents but can be other formats as well. - * @param {Object} args Optional content object, this gets passed around through the whole set process. - * @return {String} HTML string that got set into the editor. - * @example - * // Sets the HTML contents of the activeEditor editor - * tinyMCE.activeEditor.setContent('<span>some</span> html'); - * - * // Sets the raw contents of the activeEditor editor - * tinyMCE.activeEditor.setContent('<span>some</span> html', {format : 'raw'}); - * - * // Sets the content of a specific editor (my_editor in this example) - * tinyMCE.get('my_editor').setContent(data); - * - * // Sets the bbcode contents of the activeEditor editor if the bbcode plugin was added - * tinyMCE.activeEditor.setContent('[b]some[/b] html', {format : 'bbcode'}); - */ - setContent : function(content, args) { - var self = this, rootNode, body = self.getBody(), forcedRootBlockName; - - // Setup args object - args = args || {}; - args.format = args.format || 'html'; - args.set = true; - args.content = content; - - // Do preprocessing - if (!args.no_events) - self.onBeforeSetContent.dispatch(self, args); - - content = args.content; - - // Padd empty content in Gecko and Safari. Commands will otherwise fail on the content - // It will also be impossible to place the caret in the editor unless there is a BR element present - if (!tinymce.isIE && (content.length === 0 || /^\s+$/.test(content))) { - forcedRootBlockName = self.settings.forced_root_block; - if (forcedRootBlockName) - content = '<' + forcedRootBlockName + '><br data-mce-bogus="1"></' + forcedRootBlockName + '>'; - else - content = '<br data-mce-bogus="1">'; - - body.innerHTML = content; - self.selection.select(body, true); - self.selection.collapse(true); - return; - } - - // Parse and serialize the html - if (args.format !== 'raw') { - content = new tinymce.html.Serializer({}, self.schema).serialize( - self.parser.parse(content) - ); - } - - // Set the new cleaned contents to the editor - args.content = tinymce.trim(content); - self.dom.setHTML(body, args.content); - - // Do post processing - if (!args.no_events) - self.onSetContent.dispatch(self, args); - - self.selection.normalize(); - - return args.content; - }, - - /** - * Gets the content from the editor instance, this will cleanup the content before it gets returned using - * the different cleanup rules options. - * - * @method getContent - * @param {Object} args Optional content object, this gets passed around through the whole get process. - * @return {String} Cleaned content string, normally HTML contents. - * @example - * // Get the HTML contents of the currently active editor - * console.debug(tinyMCE.activeEditor.getContent()); - * - * // Get the raw contents of the currently active editor - * tinyMCE.activeEditor.getContent({format : 'raw'}); - * - * // Get content of a specific editor: - * tinyMCE.get('content id').getContent() - */ - getContent : function(args) { - var self = this, content; - - // Setup args object - args = args || {}; - args.format = args.format || 'html'; - args.get = true; - - // Do preprocessing - if (!args.no_events) - self.onBeforeGetContent.dispatch(self, args); - - // Get raw contents or by default the cleaned contents - if (args.format == 'raw') - content = self.getBody().innerHTML; - else - content = self.serializer.serialize(self.getBody(), args); - - args.content = tinymce.trim(content); - - // Do post processing - if (!args.no_events) - self.onGetContent.dispatch(self, args); - - return args.content; - }, - - /** - * Returns true/false if the editor is dirty or not. It will get dirty if the user has made modifications to the contents. - * - * @method isDirty - * @return {Boolean} True/false if the editor is dirty or not. It will get dirty if the user has made modifications to the contents. - * @example - * if (tinyMCE.activeEditor.isDirty()) - * alert("You must save your contents."); - */ - isDirty : function() { - var self = this; - - return tinymce.trim(self.startContent) != tinymce.trim(self.getContent({format : 'raw', no_events : 1})) && !self.isNotDirty; - }, - - /** - * Returns the editors container element. The container element wrappes in - * all the elements added to the page for the editor. Such as UI, iframe etc. - * - * @method getContainer - * @return {Element} HTML DOM element for the editor container. - */ - getContainer : function() { - var t = this; - - if (!t.container) - t.container = DOM.get(t.editorContainer || t.id + '_parent'); - - return t.container; - }, - - /** - * Returns the editors content area container element. The this element is the one who - * holds the iframe or the editable element. - * - * @method getContentAreaContainer - * @return {Element} HTML DOM element for the editor area container. - */ - getContentAreaContainer : function() { - return this.contentAreaContainer; - }, - - /** - * Returns the target element/textarea that got replaced with a TinyMCE editor instance. - * - * @method getElement - * @return {Element} HTML DOM element for the replaced element. - */ - getElement : function() { - return DOM.get(this.settings.content_element || this.id); - }, - - /** - * Returns the iframes window object. - * - * @method getWin - * @return {Window} Iframe DOM window object. - */ - getWin : function() { - var t = this, e; - - if (!t.contentWindow) { - e = DOM.get(t.id + "_ifr"); - - if (e) - t.contentWindow = e.contentWindow; - } - - return t.contentWindow; - }, - - /** - * Returns the iframes document object. - * - * @method getDoc - * @return {Document} Iframe DOM document object. - */ - getDoc : function() { - var t = this, w; - - if (!t.contentDocument) { - w = t.getWin(); - - if (w) - t.contentDocument = w.document; - } - - return t.contentDocument; - }, - - /** - * Returns the iframes body element. - * - * @method getBody - * @return {Element} Iframe body element. - */ - getBody : function() { - return this.bodyElement || this.getDoc().body; - }, - - /** - * URL converter function this gets executed each time a user adds an img, a or - * any other element that has a URL in it. This will be called both by the DOM and HTML - * manipulation functions. - * - * @method convertURL - * @param {string} u URL to convert. - * @param {string} n Attribute name src, href etc. - * @param {string/HTMLElement} Tag name or HTML DOM element depending on HTML or DOM insert. - * @return {string} Converted URL string. - */ - convertURL : function(u, n, e) { - var t = this, s = t.settings; - - // Use callback instead - if (s.urlconverter_callback) - return t.execCallback('urlconverter_callback', u, e, true, n); - - // Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs - if (!s.convert_urls || (e && e.nodeName == 'LINK') || u.indexOf('file:') === 0) - return u; - - // Convert to relative - if (s.relative_urls) - return t.documentBaseURI.toRelative(u); - - // Convert to absolute - u = t.documentBaseURI.toAbsolute(u, s.remove_script_host); - - return u; - }, - - /** - * Adds visual aid for tables, anchors etc so they can be more easily edited inside the editor. - * - * @method addVisual - * @param {Element} e Optional root element to loop though to find tables etc that needs the visual aid. - */ - addVisual : function(e) { - var t = this, s = t.settings; - - e = e || t.getBody(); - - if (!is(t.hasVisual)) - t.hasVisual = s.visual; - - each(t.dom.select('table,a', e), function(e) { - var v; - - switch (e.nodeName) { - case 'TABLE': - v = t.dom.getAttrib(e, 'border'); - - if (!v || v == '0') { - if (t.hasVisual) - t.dom.addClass(e, s.visual_table_class); - else - t.dom.removeClass(e, s.visual_table_class); - } - - return; - - case 'A': - v = t.dom.getAttrib(e, 'name'); - - if (v) { - if (t.hasVisual) - t.dom.addClass(e, 'mceItemAnchor'); - else - t.dom.removeClass(e, 'mceItemAnchor'); - } - - return; - } - }); - - t.onVisualAid.dispatch(t, e, t.hasVisual); - }, - - /** - * Removes the editor from the dom and tinymce collection. - * - * @method remove - */ - remove : function() { - var t = this, e = t.getContainer(); - - t.removed = 1; // Cancels post remove event execution - t.hide(); - - t.execCallback('remove_instance_callback', t); - t.onRemove.dispatch(t); - - // Clear all execCommand listeners this is required to avoid errors if the editor was removed inside another command - t.onExecCommand.listeners = []; - - tinymce.remove(t); - DOM.remove(e); - }, - - /** - * Destroys the editor instance by removing all events, element references or other resources - * that could leak memory. This method will be called automatically when the page is unloaded - * but you can also call it directly if you know what you are doing. - * - * @method destroy - * @param {Boolean} s Optional state if the destroy is an automatic destroy or user called one. - */ - destroy : function(s) { - var t = this; - - // One time is enough - if (t.destroyed) - return; - - if (!s) { - tinymce.removeUnload(t.destroy); - tinyMCE.onBeforeUnload.remove(t._beforeUnload); - - // Manual destroy - if (t.theme && t.theme.destroy) - t.theme.destroy(); - - // Destroy controls, selection and dom - t.controlManager.destroy(); - t.selection.destroy(); - t.dom.destroy(); - - // Remove all events - - // Don't clear the window or document if content editable - // is enabled since other instances might still be present - if (!t.settings.content_editable) { - Event.clear(t.getWin()); - Event.clear(t.getDoc()); - } - - Event.clear(t.getBody()); - Event.clear(t.formElement); - } - - if (t.formElement) { - t.formElement.submit = t.formElement._mceOldSubmit; - t.formElement._mceOldSubmit = null; - } - - t.contentAreaContainer = t.formElement = t.container = t.settings.content_element = t.bodyElement = t.contentDocument = t.contentWindow = null; - - if (t.selection) - t.selection = t.selection.win = t.selection.dom = t.selection.dom.doc = null; - - t.destroyed = 1; - }, - - // Internal functions - - _addEvents : function() { - // 'focus', 'blur', 'dblclick', 'beforedeactivate', submit, reset - var t = this, i, s = t.settings, dom = t.dom, lo = { - mouseup : 'onMouseUp', - mousedown : 'onMouseDown', - click : 'onClick', - keyup : 'onKeyUp', - keydown : 'onKeyDown', - keypress : 'onKeyPress', - submit : 'onSubmit', - reset : 'onReset', - contextmenu : 'onContextMenu', - dblclick : 'onDblClick', - paste : 'onPaste' // Doesn't work in all browsers yet - }; - - function eventHandler(e, o) { - var ty = e.type; - - // Don't fire events when it's removed - if (t.removed) - return; - - // Generic event handler - if (t.onEvent.dispatch(t, e, o) !== false) { - // Specific event handler - t[lo[e.fakeType || e.type]].dispatch(t, e, o); - } - }; - - // Add DOM events - each(lo, function(v, k) { - switch (k) { - case 'contextmenu': - dom.bind(t.getDoc(), k, eventHandler); - break; - - case 'paste': - dom.bind(t.getBody(), k, function(e) { - eventHandler(e); - }); - break; - - case 'submit': - case 'reset': - dom.bind(t.getElement().form || DOM.getParent(t.id, 'form'), k, eventHandler); - break; - - default: - dom.bind(s.content_editable ? t.getBody() : t.getDoc(), k, eventHandler); - } - }); - - dom.bind(s.content_editable ? t.getBody() : (isGecko ? t.getDoc() : t.getWin()), 'focus', function(e) { - t.focus(true); - }); - - // #ifdef contentEditable - - if (s.content_editable && tinymce.isOpera) { - // Opera doesn't support focus event for contentEditable elements so we need to fake it - function doFocus(e) { - t.focus(true); - }; - - dom.bind(t.getBody(), 'click', doFocus); - dom.bind(t.getBody(), 'keydown', doFocus); - } - - // #endif - - // Fixes bug where a specified document_base_uri could result in broken images - // This will also fix drag drop of images in Gecko - if (tinymce.isGecko) { - dom.bind(t.getDoc(), 'DOMNodeInserted', function(e) { - var v; - - e = e.target; - - if (e.nodeType === 1 && e.nodeName === 'IMG' && (v = e.getAttribute('data-mce-src'))) - e.src = t.documentBaseURI.toAbsolute(v); - }); - } - - // Set various midas options in Gecko - if (isGecko) { - function setOpts() { - var t = this, d = t.getDoc(), s = t.settings; - - if (isGecko && !s.readonly) { - t._refreshContentEditable(); - - try { - // Try new Gecko method - d.execCommand("styleWithCSS", 0, false); - } catch (ex) { - // Use old method - if (!t._isHidden()) - try {d.execCommand("useCSS", 0, true);} catch (ex) {} - } - - if (!s.table_inline_editing) - try {d.execCommand('enableInlineTableEditing', false, false);} catch (ex) {} - - if (!s.object_resizing) - try {d.execCommand('enableObjectResizing', false, false);} catch (ex) {} - } - }; - - t.onBeforeExecCommand.add(setOpts); - t.onMouseDown.add(setOpts); - } - - // Add node change handlers - t.onMouseUp.add(t.nodeChanged); - //t.onClick.add(t.nodeChanged); - t.onKeyUp.add(function(ed, e) { - var c = e.keyCode; - - if ((c >= 33 && c <= 36) || (c >= 37 && c <= 40) || c == 13 || c == 45 || c == 46 || c == 8 || (tinymce.isMac && (c == 91 || c == 93)) || e.ctrlKey) - t.nodeChanged(); - }); - - - // Add block quote deletion handler - t.onKeyDown.add(function(ed, e) { - // Was the BACKSPACE key pressed? - if (e.keyCode != 8) - return; - - var n = ed.selection.getRng().startContainer; - var offset = ed.selection.getRng().startOffset; - - while (n && n.nodeType && n.nodeType != 1 && n.parentNode) - n = n.parentNode; - - // Is the cursor at the beginning of a blockquote? - if (n && n.parentNode && n.parentNode.tagName === 'BLOCKQUOTE' && n.parentNode.firstChild == n && offset == 0) { - // Remove the blockquote - ed.formatter.toggle('blockquote', null, n.parentNode); - - // Move the caret to the beginning of n - var rng = ed.selection.getRng(); - rng.setStart(n, 0); - rng.setEnd(n, 0); - ed.selection.setRng(rng); - ed.selection.collapse(false); - } - }); - - - - // Add reset handler - t.onReset.add(function() { - t.setContent(t.startContent, {format : 'raw'}); - }); - - // Add shortcuts - if (s.custom_shortcuts) { - if (s.custom_undo_redo_keyboard_shortcuts) { - t.addShortcut('ctrl+z', t.getLang('undo_desc'), 'Undo'); - t.addShortcut('ctrl+y', t.getLang('redo_desc'), 'Redo'); - } - - // Add default shortcuts for gecko - t.addShortcut('ctrl+b', t.getLang('bold_desc'), 'Bold'); - t.addShortcut('ctrl+i', t.getLang('italic_desc'), 'Italic'); - t.addShortcut('ctrl+u', t.getLang('underline_desc'), 'Underline'); - - // BlockFormat shortcuts keys - for (i=1; i<=6; i++) - t.addShortcut('ctrl+' + i, '', ['FormatBlock', false, 'h' + i]); - - t.addShortcut('ctrl+7', '', ['FormatBlock', false, 'p']); - t.addShortcut('ctrl+8', '', ['FormatBlock', false, 'div']); - t.addShortcut('ctrl+9', '', ['FormatBlock', false, 'address']); - - function find(e) { - var v = null; - - if (!e.altKey && !e.ctrlKey && !e.metaKey) - return v; - - each(t.shortcuts, function(o) { - if (tinymce.isMac && o.ctrl != e.metaKey) - return; - else if (!tinymce.isMac && o.ctrl != e.ctrlKey) - return; - - if (o.alt != e.altKey) - return; - - if (o.shift != e.shiftKey) - return; - - if (e.keyCode == o.keyCode || (e.charCode && e.charCode == o.charCode)) { - v = o; - return false; - } - }); - - return v; - }; - - t.onKeyUp.add(function(ed, e) { - var o = find(e); - - if (o) - return Event.cancel(e); - }); - - t.onKeyPress.add(function(ed, e) { - var o = find(e); - - if (o) - return Event.cancel(e); - }); - - t.onKeyDown.add(function(ed, e) { - var o = find(e); - - if (o) { - o.func.call(o.scope); - return Event.cancel(e); - } - }); - } - - if (tinymce.isIE) { - // Fix so resize will only update the width and height attributes not the styles of an image - // It will also block mceItemNoResize items - dom.bind(t.getDoc(), 'controlselect', function(e) { - var re = t.resizeInfo, cb; - - e = e.target; - - // Don't do this action for non image elements - if (e.nodeName !== 'IMG') - return; - - if (re) - dom.unbind(re.node, re.ev, re.cb); - - if (!dom.hasClass(e, 'mceItemNoResize')) { - ev = 'resizeend'; - cb = dom.bind(e, ev, function(e) { - var v; - - e = e.target; - - if (v = dom.getStyle(e, 'width')) { - dom.setAttrib(e, 'width', v.replace(/[^0-9%]+/g, '')); - dom.setStyle(e, 'width', ''); - } - - if (v = dom.getStyle(e, 'height')) { - dom.setAttrib(e, 'height', v.replace(/[^0-9%]+/g, '')); - dom.setStyle(e, 'height', ''); - } - }); - } else { - ev = 'resizestart'; - cb = dom.bind(e, 'resizestart', Event.cancel, Event); - } - - re = t.resizeInfo = { - node : e, - ev : ev, - cb : cb - }; - }); - } - - if (tinymce.isOpera) { - t.onClick.add(function(ed, e) { - Event.prevent(e); - }); - } - - // Add custom undo/redo handlers - if (s.custom_undo_redo) { - function addUndo() { - t.undoManager.typing = false; - t.undoManager.add(); - }; - - dom.bind(t.getDoc(), 'focusout', function(e) { - if (!t.removed && t.undoManager.typing) - addUndo(); - }); - - // Add undo level when contents is drag/dropped within the editor - t.dom.bind(t.dom.getRoot(), 'dragend', function(e) { - addUndo(); - }); - - t.onKeyUp.add(function(ed, e) { - var keyCode = e.keyCode; - - if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45 || e.ctrlKey) - addUndo(); - }); - - t.onKeyDown.add(function(ed, e) { - var keyCode = e.keyCode, sel; - - if (keyCode == 8) { - sel = t.getDoc().selection; - - // Fix IE control + backspace browser bug - if (sel && sel.createRange && sel.createRange().item) { - t.undoManager.beforeChange(); - ed.dom.remove(sel.createRange().item(0)); - addUndo(); - - return Event.cancel(e); - } - } - - // Is caracter positon keys left,right,up,down,home,end,pgdown,pgup,enter - if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45) { - // Add position before enter key is pressed, used by IE since it still uses the default browser behavior - // Todo: Remove this once we normalize enter behavior on IE - if (tinymce.isIE && keyCode == 13) - t.undoManager.beforeChange(); - - if (t.undoManager.typing) - addUndo(); - - return; - } - - // If key isn't shift,ctrl,alt,capslock,metakey - if ((keyCode < 16 || keyCode > 20) && keyCode != 224 && keyCode != 91 && !t.undoManager.typing) { - t.undoManager.beforeChange(); - t.undoManager.typing = true; - t.undoManager.add(); - } - }); - - t.onMouseDown.add(function() { - if (t.undoManager.typing) - addUndo(); - }); - } - - // Bug fix for FireFox keeping styles from end of selection instead of start. - if (tinymce.isGecko) { - function getAttributeApplyFunction() { - var template = t.dom.getAttribs(t.selection.getStart().cloneNode(false)); - - return function() { - var target = t.selection.getStart(); - - if (target !== t.getBody()) { - t.dom.setAttrib(target, "style", null); - - each(template, function(attr) { - target.setAttributeNode(attr.cloneNode(true)); - }); - } - }; - } - - function isSelectionAcrossElements() { - var s = t.selection; - - return !s.isCollapsed() && s.getStart() != s.getEnd(); - } - - t.onKeyPress.add(function(ed, e) { - var applyAttributes; - - if ((e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) { - applyAttributes = getAttributeApplyFunction(); - t.getDoc().execCommand('delete', false, null); - applyAttributes(); - - return Event.cancel(e); - } - }); - - t.dom.bind(t.getDoc(), 'cut', function(e) { - var applyAttributes; - - if (isSelectionAcrossElements()) { - applyAttributes = getAttributeApplyFunction(); - t.onKeyUp.addToTop(Event.cancel, Event); - - setTimeout(function() { - applyAttributes(); - t.onKeyUp.remove(Event.cancel, Event); - }, 0); - } - }); - } - }, - - _refreshContentEditable : function() { - var self = this, body, parent; - - // Check if the editor was hidden and the re-initalize contentEditable mode by removing and adding the body again - if (self._isHidden()) { - body = self.getBody(); - parent = body.parentNode; - - parent.removeChild(body); - parent.appendChild(body); - - body.focus(); - } - }, - - _isHidden : function() { - var s; - - if (!isGecko) - return 0; - - // Weird, wheres that cursor selection? - s = this.selection.getSel(); - return (!s || !s.rangeCount || s.rangeCount == 0); - } - }); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/EditorCommands.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/EditorCommands.js deleted file mode 100644 index 6f6f3431a0c3..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/EditorCommands.js +++ /dev/null @@ -1,577 +0,0 @@ -/** - * EditorCommands.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - // Added for compression purposes - var each = tinymce.each, undefined, TRUE = true, FALSE = false; - - /** - * This class enables you to add custom editor commands and it contains - * overrides for native browser commands to address various bugs and issues. - * - * @class tinymce.EditorCommands - */ - tinymce.EditorCommands = function(editor) { - var dom = editor.dom, - selection = editor.selection, - commands = {state: {}, exec : {}, value : {}}, - settings = editor.settings, - formatter = editor.formatter, - bookmark; - - /** - * Executes the specified command. - * - * @method execCommand - * @param {String} command Command to execute. - * @param {Boolean} ui Optional user interface state. - * @param {Object} value Optional value for command. - * @return {Boolean} true/false if the command was found or not. - */ - function execCommand(command, ui, value) { - var func; - - command = command.toLowerCase(); - if (func = commands.exec[command]) { - func(command, ui, value); - return TRUE; - } - - return FALSE; - }; - - /** - * Queries the current state for a command for example if the current selection is "bold". - * - * @method queryCommandState - * @param {String} command Command to check the state of. - * @return {Boolean/Number} true/false if the selected contents is bold or not, -1 if it's not found. - */ - function queryCommandState(command) { - var func; - - command = command.toLowerCase(); - if (func = commands.state[command]) - return func(command); - - return -1; - }; - - /** - * Queries the command value for example the current fontsize. - * - * @method queryCommandValue - * @param {String} command Command to check the value of. - * @return {Object} Command value of false if it's not found. - */ - function queryCommandValue(command) { - var func; - - command = command.toLowerCase(); - if (func = commands.value[command]) - return func(command); - - return FALSE; - }; - - /** - * Adds commands to the command collection. - * - * @method addCommands - * @param {Object} command_list Name/value collection with commands to add, the names can also be comma separated. - * @param {String} type Optional type to add, defaults to exec. Can be value or state as well. - */ - function addCommands(command_list, type) { - type = type || 'exec'; - - each(command_list, function(callback, command) { - each(command.toLowerCase().split(','), function(command) { - commands[type][command] = callback; - }); - }); - }; - - // Expose public methods - tinymce.extend(this, { - execCommand : execCommand, - queryCommandState : queryCommandState, - queryCommandValue : queryCommandValue, - addCommands : addCommands - }); - - // Private methods - - function execNativeCommand(command, ui, value) { - if (ui === undefined) - ui = FALSE; - - if (value === undefined) - value = null; - - return editor.getDoc().execCommand(command, ui, value); - }; - - function isFormatMatch(name) { - return formatter.match(name); - }; - - function toggleFormat(name, value) { - formatter.toggle(name, value ? {value : value} : undefined); - }; - - function storeSelection(type) { - bookmark = selection.getBookmark(type); - }; - - function restoreSelection() { - selection.moveToBookmark(bookmark); - }; - - // Add execCommand overrides - addCommands({ - // Ignore these, added for compatibility - 'mceResetDesignMode,mceBeginUndoLevel' : function() {}, - - // Add undo manager logic - 'mceEndUndoLevel,mceAddUndoLevel' : function() { - editor.undoManager.add(); - }, - - 'Cut,Copy,Paste' : function(command) { - var doc = editor.getDoc(), failed; - - // Try executing the native command - try { - execNativeCommand(command); - } catch (ex) { - // Command failed - failed = TRUE; - } - - // Present alert message about clipboard access not being available - if (failed || !doc.queryCommandSupported(command)) { - if (tinymce.isGecko) { - editor.windowManager.confirm(editor.getLang('clipboard_msg'), function(state) { - if (state) - open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', '_blank'); - }); - } else - editor.windowManager.alert(editor.getLang('clipboard_no_support')); - } - }, - - // Override unlink command - unlink : function(command) { - if (selection.isCollapsed()) - selection.select(selection.getNode()); - - execNativeCommand(command); - selection.collapse(FALSE); - }, - - // Override justify commands to use the text formatter engine - 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) { - var align = command.substring(7); - - // Remove all other alignments first - each('left,center,right,full'.split(','), function(name) { - if (align != name) - formatter.remove('align' + name); - }); - - toggleFormat('align' + align); - execCommand('mceRepaint'); - }, - - // Override list commands to fix WebKit bug - 'InsertUnorderedList,InsertOrderedList' : function(command) { - var listElm, listParent; - - execNativeCommand(command); - - // WebKit produces lists within block elements so we need to split them - // we will replace the native list creation logic to custom logic later on - // TODO: Remove this when the list creation logic is removed - listElm = dom.getParent(selection.getNode(), 'ol,ul'); - if (listElm) { - listParent = listElm.parentNode; - - // If list is within a text block then split that block - if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) { - storeSelection(); - dom.split(listParent, listElm); - restoreSelection(); - } - } - }, - - // Override commands to use the text formatter engine - 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript' : function(command) { - toggleFormat(command); - }, - - // Override commands to use the text formatter engine - 'ForeColor,HiliteColor,FontName' : function(command, ui, value) { - toggleFormat(command, value); - }, - - FontSize : function(command, ui, value) { - var fontClasses, fontSizes; - - // Convert font size 1-7 to styles - if (value >= 1 && value <= 7) { - fontSizes = tinymce.explode(settings.font_size_style_values); - fontClasses = tinymce.explode(settings.font_size_classes); - - if (fontClasses) - value = fontClasses[value - 1] || value; - else - value = fontSizes[value - 1] || value; - } - - toggleFormat(command, value); - }, - - RemoveFormat : function(command) { - formatter.remove(command); - }, - - mceBlockQuote : function(command) { - toggleFormat('blockquote'); - }, - - FormatBlock : function(command, ui, value) { - return toggleFormat(value || 'p'); - }, - - mceCleanup : function() { - var bookmark = selection.getBookmark(); - - editor.setContent(editor.getContent({cleanup : TRUE}), {cleanup : TRUE}); - - selection.moveToBookmark(bookmark); - }, - - mceRemoveNode : function(command, ui, value) { - var node = value || selection.getNode(); - - // Make sure that the body node isn't removed - if (node != editor.getBody()) { - storeSelection(); - editor.dom.remove(node, TRUE); - restoreSelection(); - } - }, - - mceSelectNodeDepth : function(command, ui, value) { - var counter = 0; - - dom.getParent(selection.getNode(), function(node) { - if (node.nodeType == 1 && counter++ == value) { - selection.select(node); - return FALSE; - } - }, editor.getBody()); - }, - - mceSelectNode : function(command, ui, value) { - selection.select(value); - }, - - mceInsertContent : function(command, ui, value) { - var parser, serializer, parentNode, rootNode, fragment, args, - marker, nodeRect, viewPortRect, rng, node, node2, bookmarkHtml, viewportBodyElement; - - // Setup parser and serializer - parser = editor.parser; - serializer = new tinymce.html.Serializer({}, editor.schema); - bookmarkHtml = '<span id="mce_marker" data-mce-type="bookmark">\uFEFF</span>'; - - // Run beforeSetContent handlers on the HTML to be inserted - args = {content: value, format: 'html'}; - selection.onBeforeSetContent.dispatch(selection, args); - value = args.content; - - // Add caret at end of contents if it's missing - if (value.indexOf('{$caret}') == -1) - value += '{$caret}'; - - // Replace the caret marker with a span bookmark element - value = value.replace(/\{\$caret\}/, bookmarkHtml); - - // Insert node maker where we will insert the new HTML and get it's parent - if (!selection.isCollapsed()) - editor.getDoc().execCommand('Delete', false, null); - - parentNode = selection.getNode(); - - // Parse the fragment within the context of the parent node - args = {context : parentNode.nodeName.toLowerCase()}; - fragment = parser.parse(value, args); - - // Move the caret to a more suitable location - node = fragment.lastChild; - if (node.attr('id') == 'mce_marker') { - marker = node; - - for (node = node.prev; node; node = node.walk(true)) { - if (node.type == 3 || !dom.isBlock(node.name)) { - node.parent.insert(marker, node, node.name === 'br'); - break; - } - } - } - - // If parser says valid we can insert the contents into that parent - if (!args.invalid) { - value = serializer.serialize(fragment); - - // Check if parent is empty or only has one BR element then set the innerHTML of that parent - node = parentNode.firstChild; - node2 = parentNode.lastChild; - if (!node || (node === node2 && node.nodeName === 'BR')) - dom.setHTML(parentNode, value); - else - selection.setContent(value); - } else { - // If the fragment was invalid within that context then we need - // to parse and process the parent it's inserted into - - // Insert bookmark node and get the parent - selection.setContent(bookmarkHtml); - parentNode = editor.selection.getNode(); - rootNode = editor.getBody(); - - // Opera will return the document node when selection is in root - if (parentNode.nodeType == 9) - parentNode = node = rootNode; - else - node = parentNode; - - // Find the ancestor just before the root element - while (node !== rootNode) { - parentNode = node; - node = node.parentNode; - } - - // Get the outer/inner HTML depending on if we are in the root and parser and serialize that - value = parentNode == rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode); - value = serializer.serialize( - parser.parse( - // Need to replace by using a function since $ in the contents would otherwise be a problem - value.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i, function() { - return serializer.serialize(fragment); - }) - ) - ); - - // Set the inner/outer HTML depending on if we are in the root or not - if (parentNode == rootNode) - dom.setHTML(rootNode, value); - else - dom.setOuterHTML(parentNode, value); - } - - marker = dom.get('mce_marker'); - - // Scroll range into view scrollIntoView on element can't be used since it will scroll the main view port as well - nodeRect = dom.getRect(marker); - viewPortRect = dom.getViewPort(editor.getWin()); - - // Check if node is out side the viewport if it is then scroll to it - if ((nodeRect.y + nodeRect.h > viewPortRect.y + viewPortRect.h || nodeRect.y < viewPortRect.y) || - (nodeRect.x > viewPortRect.x + viewPortRect.w || nodeRect.x < viewPortRect.x)) { - viewportBodyElement = tinymce.isIE ? editor.getDoc().documentElement : editor.getBody(); - viewportBodyElement.scrollLeft = nodeRect.x; - viewportBodyElement.scrollTop = nodeRect.y - viewPortRect.h + 25; - } - - // Move selection before marker and remove it - rng = dom.createRng(); - - // If previous sibling is a text node set the selection to the end of that node - node = marker.previousSibling; - if (node && node.nodeType == 3) { - rng.setStart(node, node.nodeValue.length); - } else { - // If the previous sibling isn't a text node or doesn't exist set the selection before the marker node - rng.setStartBefore(marker); - rng.setEndBefore(marker); - } - - // Remove the marker node and set the new range - dom.remove(marker); - selection.setRng(rng); - - // Dispatch after event and add any visual elements needed - selection.onSetContent.dispatch(selection, args); - editor.addVisual(); - }, - - mceInsertRawHTML : function(command, ui, value) { - selection.setContent('tiny_mce_marker'); - editor.setContent(editor.getContent().replace(/tiny_mce_marker/g, function() { return value })); - }, - - mceSetContent : function(command, ui, value) { - editor.setContent(value); - }, - - 'Indent,Outdent' : function(command) { - var intentValue, indentUnit, value; - - // Setup indent level - intentValue = settings.indentation; - indentUnit = /[a-z%]+$/i.exec(intentValue); - intentValue = parseInt(intentValue); - - if (!queryCommandState('InsertUnorderedList') && !queryCommandState('InsertOrderedList')) { - each(selection.getSelectedBlocks(), function(element) { - if (command == 'outdent') { - value = Math.max(0, parseInt(element.style.paddingLeft || 0) - intentValue); - dom.setStyle(element, 'paddingLeft', value ? value + indentUnit : ''); - } else - dom.setStyle(element, 'paddingLeft', (parseInt(element.style.paddingLeft || 0) + intentValue) + indentUnit); - }); - } else - execNativeCommand(command); - }, - - mceRepaint : function() { - var bookmark; - - if (tinymce.isGecko) { - try { - storeSelection(TRUE); - - if (selection.getSel()) - selection.getSel().selectAllChildren(editor.getBody()); - - selection.collapse(TRUE); - restoreSelection(); - } catch (ex) { - // Ignore - } - } - }, - - mceToggleFormat : function(command, ui, value) { - formatter.toggle(value); - }, - - InsertHorizontalRule : function() { - editor.execCommand('mceInsertContent', false, '<hr />'); - }, - - mceToggleVisualAid : function() { - editor.hasVisual = !editor.hasVisual; - editor.addVisual(); - }, - - mceReplaceContent : function(command, ui, value) { - editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, selection.getContent({format : 'text'}))); - }, - - mceInsertLink : function(command, ui, value) { - var anchor; - - if (typeof(value) == 'string') - value = {href : value}; - - anchor = dom.getParent(selection.getNode(), 'a'); - - // Spaces are never valid in URLs and it's a very common mistake for people to make so we fix it here. - value.href = value.href.replace(' ', '%20'); - - // Remove existing links if there could be child links or that the href isn't specified - if (!anchor || !value.href) { - formatter.remove('link'); - } - - // Apply new link to selection - if (value.href) { - formatter.apply('link', value, anchor); - } - }, - - selectAll : function() { - var root = dom.getRoot(), rng = dom.createRng(); - - rng.setStart(root, 0); - rng.setEnd(root, root.childNodes.length); - - editor.selection.setRng(rng); - } - }); - - // Add queryCommandState overrides - addCommands({ - // Override justify commands - 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) { - return isFormatMatch('align' + command.substring(7)); - }, - - 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript' : function(command) { - return isFormatMatch(command); - }, - - mceBlockQuote : function() { - return isFormatMatch('blockquote'); - }, - - Outdent : function() { - var node; - - if (settings.inline_styles) { - if ((node = dom.getParent(selection.getStart(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0) - return TRUE; - - if ((node = dom.getParent(selection.getEnd(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0) - return TRUE; - } - - return queryCommandState('InsertUnorderedList') || queryCommandState('InsertOrderedList') || (!settings.inline_styles && !!dom.getParent(selection.getNode(), 'BLOCKQUOTE')); - }, - - 'InsertUnorderedList,InsertOrderedList' : function(command) { - return dom.getParent(selection.getNode(), command == 'insertunorderedlist' ? 'UL' : 'OL'); - } - }, 'state'); - - // Add queryCommandValue overrides - addCommands({ - 'FontSize,FontName' : function(command) { - var value = 0, parent; - - if (parent = dom.getParent(selection.getNode(), 'span')) { - if (command == 'fontsize') - value = parent.style.fontSize; - else - value = parent.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase(); - } - - return value; - } - }, 'value'); - - // Add undo manager logic - if (settings.custom_undo_redo) { - addCommands({ - Undo : function() { - editor.undoManager.undo(); - }, - - Redo : function() { - editor.undoManager.redo(); - } - }); - } - }; -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/EditorManager.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/EditorManager.js deleted file mode 100644 index 3574502beab1..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/EditorManager.js +++ /dev/null @@ -1,503 +0,0 @@ -/** - * EditorManager.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - /** - * @class tinymce - */ - - // Shorten names - var each = tinymce.each, extend = tinymce.extend, - DOM = tinymce.DOM, Event = tinymce.dom.Event, - ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, - explode = tinymce.explode, - Dispatcher = tinymce.util.Dispatcher, undefined, instanceCounter = 0; - - // Setup some URLs where the editor API is located and where the document is - tinymce.documentBaseURL = window.location.href.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, ''); - if (!/[\/\\]$/.test(tinymce.documentBaseURL)) - tinymce.documentBaseURL += '/'; - - tinymce.baseURL = new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL); - - /** - * Absolute baseURI for the installation path of TinyMCE. - * - * @property baseURI - * @type tinymce.util.URI - */ - tinymce.baseURI = new tinymce.util.URI(tinymce.baseURL); - - // Add before unload listener - // This was required since IE was leaking memory if you added and removed beforeunload listeners - // with attachEvent/detatchEvent so this only adds one listener and instances can the attach to the onBeforeUnload event - tinymce.onBeforeUnload = new Dispatcher(tinymce); - - // Must be on window or IE will leak if the editor is placed in frame or iframe - Event.add(window, 'beforeunload', function(e) { - tinymce.onBeforeUnload.dispatch(tinymce, e); - }); - - /** - * Fires when a new editor instance is added to the tinymce collection. - * - * @event onAddEditor - * @param {tinymce} sender TinyMCE root class/namespace. - * @param {tinymce.Editor} editor Editor instance. - * @example - * tinyMCE.execCommand("mceAddControl", false, "some_textarea"); - * tinyMCE.onAddEditor.add(function(mgr,ed) { - * console.debug('A new editor is available' + ed.id); - * }); - */ - tinymce.onAddEditor = new Dispatcher(tinymce); - - /** - * Fires when an editor instance is removed from the tinymce collection. - * - * @event onRemoveEditor - * @param {tinymce} sender TinyMCE root class/namespace. - * @param {tinymce.Editor} editor Editor instance. - */ - tinymce.onRemoveEditor = new Dispatcher(tinymce); - - tinymce.EditorManager = extend(tinymce, { - /** - * Collection of editor instances. - * - * @property editors - * @type Object - * @example - * for (edId in tinyMCE.editors) - * tinyMCE.editors[edId].save(); - */ - editors : [], - - /** - * Collection of language pack data. - * - * @property i18n - * @type Object - */ - i18n : {}, - - /** - * Currently active editor instance. - * - * @property activeEditor - * @type tinymce.Editor - * @example - * tinyMCE.activeEditor.selection.getContent(); - * tinymce.EditorManager.activeEditor.selection.getContent(); - */ - activeEditor : null, - - /** - * Initializes a set of editors. This method will create a bunch of editors based in the input. - * - * @method init - * @param {Object} s Settings object to be passed to each editor instance. - * @example - * // Initializes a editor using the longer method - * tinymce.EditorManager.init({ - * some_settings : 'some value' - * }); - * - * // Initializes a editor instance using the shorter version - * tinyMCE.init({ - * some_settings : 'some value' - * }); - */ - init : function(s) { - var t = this, pl, sl = tinymce.ScriptLoader, e, el = [], ed; - - function execCallback(se, n, s) { - var f = se[n]; - - if (!f) - return; - - if (tinymce.is(f, 'string')) { - s = f.replace(/\.\w+$/, ''); - s = s ? tinymce.resolve(s) : 0; - f = tinymce.resolve(f); - } - - return f.apply(s || this, Array.prototype.slice.call(arguments, 2)); - }; - - s = extend({ - theme : "simple", - language : "en" - }, s); - - t.settings = s; - - // Legacy call - Event.add(document, 'init', function() { - var l, co; - - execCallback(s, 'onpageload'); - - switch (s.mode) { - case "exact": - l = s.elements || ''; - - if(l.length > 0) { - each(explode(l), function(v) { - if (DOM.get(v)) { - ed = new tinymce.Editor(v, s); - el.push(ed); - ed.render(1); - } else { - each(document.forms, function(f) { - each(f.elements, function(e) { - if (e.name === v) { - v = 'mce_editor_' + instanceCounter++; - DOM.setAttrib(e, 'id', v); - - ed = new tinymce.Editor(v, s); - el.push(ed); - ed.render(1); - } - }); - }); - } - }); - } - break; - - case "textareas": - case "specific_textareas": - function hasClass(n, c) { - return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c); - }; - - each(DOM.select('textarea'), function(v) { - if (s.editor_deselector && hasClass(v, s.editor_deselector)) - return; - - if (!s.editor_selector || hasClass(v, s.editor_selector)) { - // Can we use the name - e = DOM.get(v.name); - if (!v.id && !e) - v.id = v.name; - - // Generate unique name if missing or already exists - if (!v.id || t.get(v.id)) - v.id = DOM.uniqueId(); - - ed = new tinymce.Editor(v.id, s); - el.push(ed); - ed.render(1); - } - }); - break; - } - - // Call onInit when all editors are initialized - if (s.oninit) { - l = co = 0; - - each(el, function(ed) { - co++; - - if (!ed.initialized) { - // Wait for it - ed.onInit.add(function() { - l++; - - // All done - if (l == co) - execCallback(s, 'oninit'); - }); - } else - l++; - - // All done - if (l == co) - execCallback(s, 'oninit'); - }); - } - }); - }, - - /** - * Returns a editor instance by id. - * - * @method get - * @param {String/Number} id Editor instance id or index to return. - * @return {tinymce.Editor} Editor instance to return. - * @example - * // Adds an onclick event to an editor by id (shorter version) - * tinyMCE.get('mytextbox').onClick.add(function(ed, e) { - * ed.windowManager.alert('Hello world!'); - * }); - * - * // Adds an onclick event to an editor by id (longer version) - * tinymce.EditorManager.get('mytextbox').onClick.add(function(ed, e) { - * ed.windowManager.alert('Hello world!'); - * }); - */ - get : function(id) { - if (id === undefined) - return this.editors; - - return this.editors[id]; - }, - - /** - * Returns a editor instance by id. This method was added for compatibility with the 2.x branch. - * - * @method getInstanceById - * @param {String} id Editor instance id to return. - * @return {tinymce.Editor} Editor instance to return. - * @deprecated Use get method instead. - * @see #get - */ - getInstanceById : function(id) { - return this.get(id); - }, - - /** - * Adds an editor instance to the editor collection. This will also set it as the active editor. - * - * @method add - * @param {tinymce.Editor} editor Editor instance to add to the collection. - * @return {tinymce.Editor} The same instance that got passed in. - */ - add : function(editor) { - var self = this, editors = self.editors; - - // Add named and index editor instance - editors[editor.id] = editor; - editors.push(editor); - - self._setActive(editor); - self.onAddEditor.dispatch(self, editor); - - // #ifdef jquery - - // Patch the tinymce.Editor instance with jQuery adapter logic - if (tinymce.adapter) - tinymce.adapter.patchEditor(editor); - - // #endif - - return editor; - }, - - /** - * Removes a editor instance from the collection. - * - * @method remove - * @param {tinymce.Editor} e Editor instance to remove. - * @return {tinymce.Editor} The editor that got passed in will be return if it was found otherwise null. - */ - remove : function(editor) { - var t = this, i, editors = t.editors; - - // Not in the collection - if (!editors[editor.id]) - return null; - - delete editors[editor.id]; - - for (i = 0; i < editors.length; i++) { - if (editors[i] == editor) { - editors.splice(i, 1); - break; - } - } - - // Select another editor since the active one was removed - if (t.activeEditor == editor) - t._setActive(editors[0]); - - editor.destroy(); - t.onRemoveEditor.dispatch(t, editor); - - return editor; - }, - - /** - * Executes a specific command on the currently active editor. - * - * @method execCommand - * @param {String} c Command to perform for example Bold. - * @param {Boolean} u Optional boolean state if a UI should be presented for the command or not. - * @param {String} v Optional value parameter like for example an URL to a link. - * @return {Boolean} true/false if the command was executed or not. - */ - execCommand : function(c, u, v) { - var t = this, ed = t.get(v), w; - - // Manager commands - switch (c) { - case "mceFocus": - ed.focus(); - return true; - - case "mceAddEditor": - case "mceAddControl": - if (!t.get(v)) - new tinymce.Editor(v, t.settings).render(); - - return true; - - case "mceAddFrameControl": - w = v.window; - - // Add tinyMCE global instance and tinymce namespace to specified window - w.tinyMCE = tinyMCE; - w.tinymce = tinymce; - - tinymce.DOM.doc = w.document; - tinymce.DOM.win = w; - - ed = new tinymce.Editor(v.element_id, v); - ed.render(); - - // Fix IE memory leaks - if (tinymce.isIE) { - function clr() { - ed.destroy(); - w.detachEvent('onunload', clr); - w = w.tinyMCE = w.tinymce = null; // IE leak - }; - - w.attachEvent('onunload', clr); - } - - v.page_window = null; - - return true; - - case "mceRemoveEditor": - case "mceRemoveControl": - if (ed) - ed.remove(); - - return true; - - case 'mceToggleEditor': - if (!ed) { - t.execCommand('mceAddControl', 0, v); - return true; - } - - if (ed.isHidden()) - ed.show(); - else - ed.hide(); - - return true; - } - - // Run command on active editor - if (t.activeEditor) - return t.activeEditor.execCommand(c, u, v); - - return false; - }, - - /** - * Executes a command on a specific editor by id. This method was added for compatibility with the 2.x branch. - * - * @deprecated Use the execCommand method of a editor instance instead. - * @method execInstanceCommand - * @param {String} id Editor id to perform the command on. - * @param {String} c Command to perform for example Bold. - * @param {Boolean} u Optional boolean state if a UI should be presented for the command or not. - * @param {String} v Optional value parameter like for example an URL to a link. - * @return {Boolean} true/false if the command was executed or not. - */ - execInstanceCommand : function(id, c, u, v) { - var ed = this.get(id); - - if (ed) - return ed.execCommand(c, u, v); - - return false; - }, - - /** - * Calls the save method on all editor instances in the collection. This can be useful when a form is to be submitted. - * - * @method triggerSave - * @example - * // Saves all contents - * tinyMCE.triggerSave(); - */ - triggerSave : function() { - each(this.editors, function(e) { - e.save(); - }); - }, - - /** - * Adds a language pack, this gets called by the loaded language files like en.js. - * - * @method addI18n - * @param {String} p Prefix for the language items. For example en.myplugin - * @param {Object} o Name/Value collection with items to add to the language group. - */ - addI18n : function(p, o) { - var lo, i18n = this.i18n; - - if (!tinymce.is(p, 'string')) { - each(p, function(o, lc) { - each(o, function(o, g) { - each(o, function(o, k) { - if (g === 'common') - i18n[lc + '.' + k] = o; - else - i18n[lc + '.' + g + '.' + k] = o; - }); - }); - }); - } else { - each(o, function(o, k) { - i18n[p + '.' + k] = o; - }); - } - }, - - // Private methods - - _setActive : function(editor) { - this.selectedInstance = this.activeEditor = editor; - } - }); -})(tinymce); - -/** - * Alternative name for tinymce added for 2.x compatibility. - * - * @member - * @property tinyMCE - * @type tinymce - * @example - * // To initialize editor instances - * tinyMCE.init({ - * ... - * }); - */ - -/** - * Alternative name for tinymce added for compatibility. - * - * @member tinymce - * @property EditorManager - * @type tinymce - * @example - * // To initialize editor instances - * tinymce.EditorManager.get('editor'); - */ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ForceBlocks.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ForceBlocks.js deleted file mode 100644 index 818a2a85a456..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ForceBlocks.js +++ /dev/null @@ -1,635 +0,0 @@ -/** - * ForceBlocks.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - // Shorten names - var Event = tinymce.dom.Event, - isIE = tinymce.isIE, - isGecko = tinymce.isGecko, - isOpera = tinymce.isOpera, - each = tinymce.each, - extend = tinymce.extend, - TRUE = true, - FALSE = false; - - function cloneFormats(node) { - var clone, temp, inner; - - do { - if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(node.nodeName)) { - if (clone) { - temp = node.cloneNode(false); - temp.appendChild(clone); - clone = temp; - } else { - clone = inner = node.cloneNode(false); - } - - clone.removeAttribute('id'); - } - } while (node = node.parentNode); - - if (clone) - return {wrapper : clone, inner : inner}; - }; - - // Checks if the selection/caret is at the end of the specified block element - function isAtEnd(rng, par) { - var rng2 = par.ownerDocument.createRange(); - - rng2.setStart(rng.endContainer, rng.endOffset); - rng2.setEndAfter(par); - - // Get number of characters to the right of the cursor if it's zero then we are at the end and need to merge the next block element - return rng2.cloneContents().textContent.length == 0; - }; - - function splitList(selection, dom, li) { - var listBlock, block; - - if (dom.isEmpty(li)) { - listBlock = dom.getParent(li, 'ul,ol'); - - if (!dom.getParent(listBlock.parentNode, 'ul,ol')) { - dom.split(listBlock, li); - block = dom.create('p', 0, '<br data-mce-bogus="1" />'); - dom.replace(block, li); - selection.select(block, 1); - } - - return FALSE; - } - - return TRUE; - }; - - /** - * This is a internal class and no method in this class should be called directly form the out side. - */ - tinymce.create('tinymce.ForceBlocks', { - ForceBlocks : function(ed) { - var t = this, s = ed.settings, elm; - - t.editor = ed; - t.dom = ed.dom; - elm = (s.forced_root_block || 'p').toLowerCase(); - s.element = elm.toUpperCase(); - - ed.onPreInit.add(t.setup, t); - }, - - setup : function() { - var t = this, ed = t.editor, s = ed.settings, dom = ed.dom, selection = ed.selection, blockElements = ed.schema.getBlockElements(); - - // Force root blocks - if (s.forced_root_block) { - function addRootBlocks() { - var node = selection.getStart(), rootNode = ed.getBody(), rng, startContainer, startOffset, endContainer, endOffset, rootBlockNode, tempNode, offset = -0xFFFFFF; - - if (!node || node.nodeType !== 1) - return; - - // Check if node is wrapped in block - while (node != rootNode) { - if (blockElements[node.nodeName]) - return; - - node = node.parentNode; - } - - // Get current selection - rng = selection.getRng(); - if (rng.setStart) { - startContainer = rng.startContainer; - startOffset = rng.startOffset; - endContainer = rng.endContainer; - endOffset = rng.endOffset; - } else { - // Force control range into text range - if (rng.item) { - rng = ed.getDoc().body.createTextRange(); - rng.moveToElementText(rng.item(0)); - } - - tmpRng = rng.duplicate(); - tmpRng.collapse(true); - startOffset = tmpRng.move('character', offset) * -1; - - if (!tmpRng.collapsed) { - tmpRng = rng.duplicate(); - tmpRng.collapse(false); - endOffset = (tmpRng.move('character', offset) * -1) - startOffset; - } - } - - // Wrap non block elements and text nodes - for (node = rootNode.firstChild; node; node) { - if (node.nodeType === 3 || (node.nodeType == 1 && !blockElements[node.nodeName])) { - if (!rootBlockNode) { - rootBlockNode = dom.create(s.forced_root_block); - node.parentNode.insertBefore(rootBlockNode, node); - } - - tempNode = node; - node = node.nextSibling; - rootBlockNode.appendChild(tempNode); - } else { - rootBlockNode = null; - node = node.nextSibling; - } - } - - if (rng.setStart) { - rng.setStart(startContainer, startOffset); - rng.setEnd(endContainer, endOffset); - selection.setRng(rng); - } else { - try { - rng = ed.getDoc().body.createTextRange(); - rng.moveToElementText(rootNode); - rng.collapse(true); - rng.moveStart('character', startOffset); - - if (endOffset > 0) - rng.moveEnd('character', endOffset); - - rng.select(); - } catch (ex) { - // Ignore - } - } - - ed.nodeChanged(); - }; - - ed.onKeyUp.add(addRootBlocks); - ed.onClick.add(addRootBlocks); - } - - if (s.force_br_newlines) { - // Force IE to produce BRs on enter - if (isIE) { - ed.onKeyPress.add(function(ed, e) { - var n; - - if (e.keyCode == 13 && selection.getNode().nodeName != 'LI') { - selection.setContent('<br id="__" /> ', {format : 'raw'}); - n = dom.get('__'); - n.removeAttribute('id'); - selection.select(n); - selection.collapse(); - return Event.cancel(e); - } - }); - } - } - - if (s.force_p_newlines) { - if (!isIE) { - ed.onKeyPress.add(function(ed, e) { - if (e.keyCode == 13 && !e.shiftKey && !t.insertPara(e)) - Event.cancel(e); - }); - } else { - // Ungly hack to for IE to preserve the formatting when you press - // enter at the end of a block element with formatted contents - // This logic overrides the browsers default logic with - // custom logic that enables us to control the output - tinymce.addUnload(function() { - t._previousFormats = 0; // Fix IE leak - }); - - ed.onKeyPress.add(function(ed, e) { - t._previousFormats = 0; - - // Clone the current formats, this will later be applied to the new block contents - if (e.keyCode == 13 && !e.shiftKey && ed.selection.isCollapsed() && s.keep_styles) - t._previousFormats = cloneFormats(ed.selection.getStart()); - }); - - ed.onKeyUp.add(function(ed, e) { - // Let IE break the element and the wrap the new caret location in the previous formats - if (e.keyCode == 13 && !e.shiftKey) { - var parent = ed.selection.getStart(), fmt = t._previousFormats; - - // Parent is an empty block - if (!parent.hasChildNodes() && fmt) { - parent = dom.getParent(parent, dom.isBlock); - - if (parent && parent.nodeName != 'LI') { - parent.innerHTML = ''; - - if (t._previousFormats) { - parent.appendChild(fmt.wrapper); - fmt.inner.innerHTML = '\uFEFF'; - } else - parent.innerHTML = '\uFEFF'; - - selection.select(parent, 1); - selection.collapse(true); - ed.getDoc().execCommand('Delete', false, null); - t._previousFormats = 0; - } - } - } - }); - } - - if (isGecko) { - ed.onKeyDown.add(function(ed, e) { - if ((e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) - t.backspaceDelete(e, e.keyCode == 8); - }); - } - } - - // Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973 - if (tinymce.isWebKit) { - function insertBr(ed) { - var rng = selection.getRng(), br, div = dom.create('div', null, ' '), divYPos, vpHeight = dom.getViewPort(ed.getWin()).h; - - // Insert BR element - rng.insertNode(br = dom.create('br')); - - // Place caret after BR - rng.setStartAfter(br); - rng.setEndAfter(br); - selection.setRng(rng); - - // Could not place caret after BR then insert an nbsp entity and move the caret - if (selection.getSel().focusNode == br.previousSibling) { - selection.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'), br)); - selection.collapse(TRUE); - } - - // Create a temporary DIV after the BR and get the position as it - // seems like getPos() returns 0 for text nodes and BR elements. - dom.insertAfter(div, br); - divYPos = dom.getPos(div).y; - dom.remove(div); - - // Scroll to new position, scrollIntoView can't be used due to bug: http://bugs.webkit.org/show_bug.cgi?id=16117 - if (divYPos > vpHeight) // It is not necessary to scroll if the DIV is inside the view port. - ed.getWin().scrollTo(0, divYPos); - }; - - ed.onKeyPress.add(function(ed, e) { - if (e.keyCode == 13 && (e.shiftKey || (s.force_br_newlines && !dom.getParent(selection.getNode(), 'h1,h2,h3,h4,h5,h6,ol,ul')))) { - insertBr(ed); - Event.cancel(e); - } - }); - } - - // IE specific fixes - if (isIE) { - // Replaces IE:s auto generated paragraphs with the specified element name - if (s.element != 'P') { - ed.onKeyPress.add(function(ed, e) { - t.lastElm = selection.getNode().nodeName; - }); - - ed.onKeyUp.add(function(ed, e) { - var bl, n = selection.getNode(), b = ed.getBody(); - - if (b.childNodes.length === 1 && n.nodeName == 'P') { - n = dom.rename(n, s.element); - selection.select(n); - selection.collapse(); - ed.nodeChanged(); - } else if (e.keyCode == 13 && !e.shiftKey && t.lastElm != 'P') { - bl = dom.getParent(n, 'p'); - - if (bl) { - dom.rename(bl, s.element); - ed.nodeChanged(); - } - } - }); - } - } - }, - - getParentBlock : function(n) { - var d = this.dom; - - return d.getParent(n, d.isBlock); - }, - - insertPara : function(e) { - var t = this, ed = t.editor, dom = ed.dom, d = ed.getDoc(), se = ed.settings, s = ed.selection.getSel(), r = s.getRangeAt(0), b = d.body; - var rb, ra, dir, sn, so, en, eo, sb, eb, bn, bef, aft, sc, ec, n, vp = dom.getViewPort(ed.getWin()), y, ch, car; - - ed.undoManager.beforeChange(); - - // If root blocks are forced then use Operas default behavior since it's really good -// Removed due to bug: #1853816 -// if (se.forced_root_block && isOpera) -// return TRUE; - - // Setup before range - rb = d.createRange(); - - // If is before the first block element and in body, then move it into first block element - rb.setStart(s.anchorNode, s.anchorOffset); - rb.collapse(TRUE); - - // Setup after range - ra = d.createRange(); - - // If is before the first block element and in body, then move it into first block element - ra.setStart(s.focusNode, s.focusOffset); - ra.collapse(TRUE); - - // Setup start/end points - dir = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0; - sn = dir ? s.anchorNode : s.focusNode; - so = dir ? s.anchorOffset : s.focusOffset; - en = dir ? s.focusNode : s.anchorNode; - eo = dir ? s.focusOffset : s.anchorOffset; - - // If selection is in empty table cell - if (sn === en && /^(TD|TH)$/.test(sn.nodeName)) { - if (sn.firstChild.nodeName == 'BR') - dom.remove(sn.firstChild); // Remove BR - - // Create two new block elements - if (sn.childNodes.length == 0) { - ed.dom.add(sn, se.element, null, '<br />'); - aft = ed.dom.add(sn, se.element, null, '<br />'); - } else { - n = sn.innerHTML; - sn.innerHTML = ''; - ed.dom.add(sn, se.element, null, n); - aft = ed.dom.add(sn, se.element, null, '<br />'); - } - - // Move caret into the last one - r = d.createRange(); - r.selectNodeContents(aft); - r.collapse(1); - ed.selection.setRng(r); - - return FALSE; - } - - // If the caret is in an invalid location in FF we need to move it into the first block - if (sn == b && en == b && b.firstChild && ed.dom.isBlock(b.firstChild)) { - sn = en = sn.firstChild; - so = eo = 0; - rb = d.createRange(); - rb.setStart(sn, 0); - ra = d.createRange(); - ra.setStart(en, 0); - } - - // If the body is totally empty add a BR element this might happen on webkit - if (!d.body.hasChildNodes()) { - d.body.appendChild(dom.create('br')); - } - - // Never use body as start or end node - sn = sn.nodeName == "HTML" ? d.body : sn; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes - sn = sn.nodeName == "BODY" ? sn.firstChild : sn; - en = en.nodeName == "HTML" ? d.body : en; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes - en = en.nodeName == "BODY" ? en.firstChild : en; - - // Get start and end blocks - sb = t.getParentBlock(sn); - eb = t.getParentBlock(en); - bn = sb ? sb.nodeName : se.element; // Get block name to create - - // Return inside list use default browser behavior - if (n = t.dom.getParent(sb, 'li,pre')) { - if (n.nodeName == 'LI') - return splitList(ed.selection, t.dom, n); - - return TRUE; - } - - // If caption or absolute layers then always generate new blocks within - if (sb && (sb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) { - bn = se.element; - sb = null; - } - - // If caption or absolute layers then always generate new blocks within - if (eb && (eb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) { - bn = se.element; - eb = null; - } - - // Use P instead - if (/(TD|TABLE|TH|CAPTION)/.test(bn) || (sb && bn == "DIV" && /left|right/gi.test(dom.getStyle(sb, 'float', 1)))) { - bn = se.element; - sb = eb = null; - } - - // Setup new before and after blocks - bef = (sb && sb.nodeName == bn) ? sb.cloneNode(0) : ed.dom.create(bn); - aft = (eb && eb.nodeName == bn) ? eb.cloneNode(0) : ed.dom.create(bn); - - // Remove id from after clone - aft.removeAttribute('id'); - - // Is header and cursor is at the end, then force paragraph under - if (/^(H[1-6])$/.test(bn) && isAtEnd(r, sb)) - aft = ed.dom.create(se.element); - - // Find start chop node - n = sc = sn; - do { - if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName)) - break; - - sc = n; - } while ((n = n.previousSibling ? n.previousSibling : n.parentNode)); - - // Find end chop node - n = ec = en; - do { - if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName)) - break; - - ec = n; - } while ((n = n.nextSibling ? n.nextSibling : n.parentNode)); - - // Place first chop part into before block element - if (sc.nodeName == bn) - rb.setStart(sc, 0); - else - rb.setStartBefore(sc); - - rb.setEnd(sn, so); - bef.appendChild(rb.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari - - // Place secnd chop part within new block element - try { - ra.setEndAfter(ec); - } catch(ex) { - //console.debug(s.focusNode, s.focusOffset); - } - - ra.setStart(en, eo); - aft.appendChild(ra.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari - - // Create range around everything - r = d.createRange(); - if (!sc.previousSibling && sc.parentNode.nodeName == bn) { - r.setStartBefore(sc.parentNode); - } else { - if (rb.startContainer.nodeName == bn && rb.startOffset == 0) - r.setStartBefore(rb.startContainer); - else - r.setStart(rb.startContainer, rb.startOffset); - } - - if (!ec.nextSibling && ec.parentNode.nodeName == bn) - r.setEndAfter(ec.parentNode); - else - r.setEnd(ra.endContainer, ra.endOffset); - - // Delete and replace it with new block elements - r.deleteContents(); - - if (isOpera) - ed.getWin().scrollTo(0, vp.y); - - // Never wrap blocks in blocks - if (bef.firstChild && bef.firstChild.nodeName == bn) - bef.innerHTML = bef.firstChild.innerHTML; - - if (aft.firstChild && aft.firstChild.nodeName == bn) - aft.innerHTML = aft.firstChild.innerHTML; - - function appendStyles(e, en) { - var nl = [], nn, n, i; - - e.innerHTML = ''; - - // Make clones of style elements - if (se.keep_styles) { - n = en; - do { - // We only want style specific elements - if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(n.nodeName)) { - nn = n.cloneNode(FALSE); - dom.setAttrib(nn, 'id', ''); // Remove ID since it needs to be unique - nl.push(nn); - } - } while (n = n.parentNode); - } - - // Append style elements to aft - if (nl.length > 0) { - for (i = nl.length - 1, nn = e; i >= 0; i--) - nn = nn.appendChild(nl[i]); - - // Padd most inner style element - nl[0].innerHTML = isOpera ? '\u00a0' : '<br />'; // Extra space for Opera so that the caret can move there - return nl[0]; // Move caret to most inner element - } else - e.innerHTML = isOpera ? '\u00a0' : '<br />'; // Extra space for Opera so that the caret can move there - }; - - // Padd empty blocks - if (dom.isEmpty(bef)) - appendStyles(bef, sn); - - // Fill empty afterblook with current style - if (dom.isEmpty(aft)) - car = appendStyles(aft, en); - - // Opera needs this one backwards for older versions - if (isOpera && parseFloat(opera.version()) < 9.5) { - r.insertNode(bef); - r.insertNode(aft); - } else { - r.insertNode(aft); - r.insertNode(bef); - } - - // Normalize - aft.normalize(); - bef.normalize(); - - // Move cursor and scroll into view - ed.selection.select(aft, true); - ed.selection.collapse(true); - - // scrollIntoView seems to scroll the parent window in most browsers now including FF 3.0b4 so it's time to stop using it and do it our selfs - y = ed.dom.getPos(aft).y; - //ch = aft.clientHeight; - - // Is element within viewport - if (y < vp.y || y + 25 > vp.y + vp.h) { - ed.getWin().scrollTo(0, y < vp.y ? y : y - vp.h + 25); // Needs to be hardcoded to roughly one line of text if a huge text block is broken into two blocks - - /*console.debug( - 'Element: y=' + y + ', h=' + ch + ', ' + - 'Viewport: y=' + vp.y + ", h=" + vp.h + ', bottom=' + (vp.y + vp.h) - );*/ - } - - ed.undoManager.add(); - - return FALSE; - }, - - backspaceDelete : function(e, bs) { - var t = this, ed = t.editor, b = ed.getBody(), dom = ed.dom, n, se = ed.selection, r = se.getRng(), sc = r.startContainer, n, w, tn, walker; - - // Delete when caret is behind a element doesn't work correctly on Gecko see #3011651 - if (!bs && r.collapsed && sc.nodeType == 1 && r.startOffset == sc.childNodes.length) { - walker = new tinymce.dom.TreeWalker(sc.lastChild, sc); - - // Walk the dom backwards until we find a text node - for (n = sc.lastChild; n; n = walker.prev()) { - if (n.nodeType == 3) { - r.setStart(n, n.nodeValue.length); - r.collapse(true); - se.setRng(r); - return; - } - } - } - - // The caret sometimes gets stuck in Gecko if you delete empty paragraphs - // This workaround removes the element by hand and moves the caret to the previous element - if (sc && ed.dom.isBlock(sc) && !/^(TD|TH)$/.test(sc.nodeName) && bs) { - if (sc.childNodes.length == 0 || (sc.childNodes.length == 1 && sc.firstChild.nodeName == 'BR')) { - // Find previous block element - n = sc; - while ((n = n.previousSibling) && !ed.dom.isBlock(n)) ; - - if (n) { - if (sc != b.firstChild) { - // Find last text node - w = ed.dom.doc.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, FALSE); - while (tn = w.nextNode()) - n = tn; - - // Place caret at the end of last text node - r = ed.getDoc().createRange(); - r.setStart(n, n.nodeValue ? n.nodeValue.length : 0); - r.setEnd(n, n.nodeValue ? n.nodeValue.length : 0); - se.setRng(r); - - // Remove the target container - ed.dom.remove(sc); - } - - return Event.cancel(e); - } - } - } - } - }); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/Formatter.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/Formatter.js deleted file mode 100644 index b7266779d3a3..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/Formatter.js +++ /dev/null @@ -1,2018 +0,0 @@ -/** - * Formatter.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - /** - * Text formatter engine class. This class is used to apply formats like bold, italic, font size - * etc to the current selection or specific nodes. This engine was build to replace the browsers - * default formatting logic for execCommand due to it's inconsistant and buggy behavior. - * - * @class tinymce.Formatter - * @example - * tinymce.activeEditor.formatter.register('mycustomformat', { - * inline : 'span', - * styles : {color : '#ff0000'} - * }); - * - * tinymce.activeEditor.formatter.apply('mycustomformat'); - */ - - /** - * Constructs a new formatter instance. - * - * @constructor Formatter - * @param {tinymce.Editor} ed Editor instance to construct the formatter engine to. - */ - tinymce.Formatter = function(ed) { - var formats = {}, - each = tinymce.each, - dom = ed.dom, - selection = ed.selection, - TreeWalker = tinymce.dom.TreeWalker, - rangeUtils = new tinymce.dom.RangeUtils(dom), - isValid = ed.schema.isValidChild, - isBlock = dom.isBlock, - forcedRootBlock = ed.settings.forced_root_block, - nodeIndex = dom.nodeIndex, - INVISIBLE_CHAR = '\uFEFF', - MCE_ATTR_RE = /^(src|href|style)$/, - FALSE = false, - TRUE = true, - undefined; - - function isArray(obj) { - return obj instanceof Array; - }; - - function getParents(node, selector) { - return dom.getParents(node, selector, dom.getRoot()); - }; - - function isCaretNode(node) { - return node.nodeType === 1 && (node.face === 'mceinline' || node.style.fontFamily === 'mceinline'); - }; - - // Public functions - - /** - * Returns the format by name or all formats if no name is specified. - * - * @method get - * @param {String} name Optional name to retrieve by. - * @return {Array/Object} Array/Object with all registered formats or a specific format. - */ - function get(name) { - return name ? formats[name] : formats; - }; - - /** - * Registers a specific format by name. - * - * @method register - * @param {Object/String} name Name of the format for example "bold". - * @param {Object/Array} format Optional format object or array of format variants can only be omitted if the first arg is an object. - */ - function register(name, format) { - if (name) { - if (typeof(name) !== 'string') { - each(name, function(format, name) { - register(name, format); - }); - } else { - // Force format into array and add it to internal collection - format = format.length ? format : [format]; - - each(format, function(format) { - // Set deep to false by default on selector formats this to avoid removing - // alignment on images inside paragraphs when alignment is changed on paragraphs - if (format.deep === undefined) - format.deep = !format.selector; - - // Default to true - if (format.split === undefined) - format.split = !format.selector || format.inline; - - // Default to true - if (format.remove === undefined && format.selector && !format.inline) - format.remove = 'none'; - - // Mark format as a mixed format inline + block level - if (format.selector && format.inline) { - format.mixed = true; - format.block_expand = true; - } - - // Split classes if needed - if (typeof(format.classes) === 'string') - format.classes = format.classes.split(/\s+/); - }); - - formats[name] = format; - } - } - }; - - var getTextDecoration = function(node) { - var decoration; - - ed.dom.getParent(node, function(n) { - decoration = ed.dom.getStyle(n, 'text-decoration'); - return decoration && decoration !== 'none'; - }); - - return decoration; - }; - - var processUnderlineAndColor = function(node) { - var textDecoration; - if (node.nodeType === 1 && node.parentNode && node.parentNode.nodeType === 1) { - textDecoration = getTextDecoration(node.parentNode); - if (ed.dom.getStyle(node, 'color') && textDecoration) { - ed.dom.setStyle(node, 'text-decoration', textDecoration); - } else if (ed.dom.getStyle(node, 'textdecoration') === textDecoration) { - ed.dom.setStyle(node, 'text-decoration', null); - } - } - }; - - /** - * Applies the specified format to the current selection or specified node. - * - * @method apply - * @param {String} name Name of format to apply. - * @param {Object} vars Optional list of variables to replace within format before applying it. - * @param {Node} node Optional node to apply the format to defaults to current selection. - */ - function apply(name, vars, node) { - var formatList = get(name), format = formatList[0], bookmark, rng, i, isCollapsed = selection.isCollapsed(); - - /** - * Moves the start to the first suitable text node. - */ - function moveStart(rng) { - var container = rng.startContainer, - offset = rng.startOffset, - walker, node; - - // Move startContainer/startOffset in to a suitable node - if (container.nodeType == 1 || container.nodeValue === "") { - container = container.nodeType == 1 ? container.childNodes[offset] : container; - - // Might fail if the offset is behind the last element in it's container - if (container) { - walker = new TreeWalker(container, container.parentNode); - for (node = walker.current(); node; node = walker.next()) { - if (node.nodeType == 3 && !isWhiteSpaceNode(node)) { - rng.setStart(node, 0); - break; - } - } - } - } - - return rng; - }; - - function setElementFormat(elm, fmt) { - fmt = fmt || format; - - if (elm) { - if (fmt.onformat) { - fmt.onformat(elm, fmt, vars, node); - } - - each(fmt.styles, function(value, name) { - dom.setStyle(elm, name, replaceVars(value, vars)); - }); - - each(fmt.attributes, function(value, name) { - dom.setAttrib(elm, name, replaceVars(value, vars)); - }); - - each(fmt.classes, function(value) { - value = replaceVars(value, vars); - - if (!dom.hasClass(elm, value)) - dom.addClass(elm, value); - }); - } - }; - function adjustSelectionToVisibleSelection() { - function findSelectionEnd(start, end) { - var walker = new TreeWalker(end); - for (node = walker.current(); node; node = walker.prev()) { - if (node.childNodes.length > 1 || node == start) { - return node; - } - } - }; - - // Adjust selection so that a end container with a end offset of zero is not included in the selection - // as this isn't visible to the user. - var rng = ed.selection.getRng(); - var start = rng.startContainer; - var end = rng.endContainer; - - if (start != end && rng.endOffset == 0) { - var newEnd = findSelectionEnd(start, end); - var endOffset = newEnd.nodeType == 3 ? newEnd.length : newEnd.childNodes.length; - - rng.setEnd(newEnd, endOffset); - } - - return rng; - } - - function applyStyleToList(node, bookmark, wrapElm, newWrappers, process){ - var nodes = [], listIndex = -1, list, startIndex = -1, endIndex = -1, currentWrapElm; - - // find the index of the first child list. - each(node.childNodes, function(n, index) { - if (n.nodeName === "UL" || n.nodeName === "OL") { - listIndex = index; - list = n; - return false; - } - }); - - // get the index of the bookmarks - each(node.childNodes, function(n, index) { - if (n.nodeName === "SPAN" && dom.getAttrib(n, "data-mce-type") == "bookmark") { - if (n.id == bookmark.id + "_start") { - startIndex = index; - } else if (n.id == bookmark.id + "_end") { - endIndex = index; - } - } - }); - - // if the selection spans across an embedded list, or there isn't an embedded list - handle processing normally - if (listIndex <= 0 || (startIndex < listIndex && endIndex > listIndex)) { - each(tinymce.grep(node.childNodes), process); - return 0; - } else { - currentWrapElm = wrapElm.cloneNode(FALSE); - - // create a list of the nodes on the same side of the list as the selection - each(tinymce.grep(node.childNodes), function(n, index) { - if ((startIndex < listIndex && index < listIndex) || (startIndex > listIndex && index > listIndex)) { - nodes.push(n); - n.parentNode.removeChild(n); - } - }); - - // insert the wrapping element either before or after the list. - if (startIndex < listIndex) { - node.insertBefore(currentWrapElm, list); - } else if (startIndex > listIndex) { - node.insertBefore(currentWrapElm, list.nextSibling); - } - - // add the new nodes to the list. - newWrappers.push(currentWrapElm); - - each(nodes, function(node) { - currentWrapElm.appendChild(node); - }); - - return currentWrapElm; - } - }; - - function applyRngStyle(rng, bookmark, node_specific) { - var newWrappers = [], wrapName, wrapElm; - - // Setup wrapper element - wrapName = format.inline || format.block; - wrapElm = dom.create(wrapName); - setElementFormat(wrapElm); - - rangeUtils.walk(rng, function(nodes) { - var currentWrapElm; - - /** - * Process a list of nodes wrap them. - */ - function process(node) { - var nodeName = node.nodeName.toLowerCase(), parentName = node.parentNode.nodeName.toLowerCase(), found; - - // Stop wrapping on br elements - if (isEq(nodeName, 'br')) { - currentWrapElm = 0; - - // Remove any br elements when we wrap things - if (format.block) - dom.remove(node); - - return; - } - - // If node is wrapper type - if (format.wrapper && matchNode(node, name, vars)) { - currentWrapElm = 0; - return; - } - - // Can we rename the block - if (format.block && !format.wrapper && isTextBlock(nodeName)) { - node = dom.rename(node, wrapName); - setElementFormat(node); - newWrappers.push(node); - currentWrapElm = 0; - return; - } - - // Handle selector patterns - if (format.selector) { - // Look for matching formats - each(formatList, function(format) { - // Check collapsed state if it exists - if ('collapsed' in format && format.collapsed !== isCollapsed) { - return; - } - - if (dom.is(node, format.selector) && !isCaretNode(node)) { - setElementFormat(node, format); - found = true; - } - }); - - // Continue processing if a selector match wasn't found and a inline element is defined - if (!format.inline || found) { - currentWrapElm = 0; - return; - } - } - - // Is it valid to wrap this item - if (isValid(wrapName, nodeName) && isValid(parentName, wrapName) && - !(!node_specific && node.nodeType === 3 && node.nodeValue.length === 1 && node.nodeValue.charCodeAt(0) === 65279) && node.id !== '_mce_caret') { - // Start wrapping - if (!currentWrapElm) { - // Wrap the node - currentWrapElm = wrapElm.cloneNode(FALSE); - node.parentNode.insertBefore(currentWrapElm, node); - newWrappers.push(currentWrapElm); - } - - currentWrapElm.appendChild(node); - } else if (nodeName == 'li' && bookmark) { - // Start wrapping - if we are in a list node and have a bookmark, then we will always begin by wrapping in a new element. - currentWrapElm = applyStyleToList(node, bookmark, wrapElm, newWrappers, process); - } else { - // Start a new wrapper for possible children - currentWrapElm = 0; - - each(tinymce.grep(node.childNodes), process); - - // End the last wrapper - currentWrapElm = 0; - } - }; - - // Process siblings from range - each(nodes, process); - }); - - // Wrap links inside as well, for example color inside a link when the wrapper is around the link - if (format.wrap_links === false) { - each(newWrappers, function(node) { - function process(node) { - var i, currentWrapElm, children; - - if (node.nodeName === 'A') { - currentWrapElm = wrapElm.cloneNode(FALSE); - newWrappers.push(currentWrapElm); - - children = tinymce.grep(node.childNodes); - for (i = 0; i < children.length; i++) - currentWrapElm.appendChild(children[i]); - - node.appendChild(currentWrapElm); - } - - each(tinymce.grep(node.childNodes), process); - }; - - process(node); - }); - } - - // Cleanup - each(newWrappers, function(node) { - var childCount; - - function getChildCount(node) { - var count = 0; - - each(node.childNodes, function(node) { - if (!isWhiteSpaceNode(node) && !isBookmarkNode(node)) - count++; - }); - - return count; - }; - - function mergeStyles(node) { - var child, clone; - - each(node.childNodes, function(node) { - if (node.nodeType == 1 && !isBookmarkNode(node) && !isCaretNode(node)) { - child = node; - return FALSE; // break loop - } - }); - - // If child was found and of the same type as the current node - if (child && matchName(child, format)) { - clone = child.cloneNode(FALSE); - setElementFormat(clone); - - dom.replace(clone, node, TRUE); - dom.remove(child, 1); - } - - return clone || node; - }; - - childCount = getChildCount(node); - - // Remove empty nodes but only if there is multiple wrappers and they are not block - // elements so never remove single <h1></h1> since that would remove the current empty block element where the caret is at - if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) { - dom.remove(node, 1); - return; - } - - if (format.inline || format.wrapper) { - // Merges the current node with it's children of similar type to reduce the number of elements - if (!format.exact && childCount === 1) - node = mergeStyles(node); - - // Remove/merge children - each(formatList, function(format) { - // Merge all children of similar type will move styles from child to parent - // this: <span style="color:red"><b><span style="color:red; font-size:10px">text</span></b></span> - // will become: <span style="color:red"><b><span style="font-size:10px">text</span></b></span> - each(dom.select(format.inline, node), function(child) { - var parent; - - // When wrap_links is set to false we don't want - // to remove the format on children within links - if (format.wrap_links === false) { - parent = child.parentNode; - - do { - if (parent.nodeName === 'A') - return; - } while (parent = parent.parentNode); - } - - removeFormat(format, vars, child, format.exact ? child : null); - }); - }); - - // Remove child if direct parent is of same type - if (matchNode(node.parentNode, name, vars)) { - dom.remove(node, 1); - node = 0; - return TRUE; - } - - // Look for parent with similar style format - if (format.merge_with_parents) { - dom.getParent(node.parentNode, function(parent) { - if (matchNode(parent, name, vars)) { - dom.remove(node, 1); - node = 0; - return TRUE; - } - }); - } - - // Merge next and previous siblings if they are similar <b>text</b><b>text</b> becomes <b>texttext</b> - if (node && format.merge_siblings !== false) { - node = mergeSiblings(getNonWhiteSpaceSibling(node), node); - node = mergeSiblings(node, getNonWhiteSpaceSibling(node, TRUE)); - } - } - }); - }; - - if (format) { - if (node) { - if (node.nodeType) { - rng = dom.createRng(); - rng.setStartBefore(node); - rng.setEndAfter(node); - applyRngStyle(expandRng(rng, formatList), null, true); - } else { - applyRngStyle(node, null, true); - } - } else { - if (!isCollapsed || !format.inline || dom.select('td.mceSelected,th.mceSelected').length) { - // Obtain selection node before selection is unselected by applyRngStyle() - var curSelNode = ed.selection.getNode(); - - // Apply formatting to selection - ed.selection.setRng(adjustSelectionToVisibleSelection()); - bookmark = selection.getBookmark(); - applyRngStyle(expandRng(selection.getRng(TRUE), formatList), bookmark); - - // Colored nodes should be underlined so that the color of the underline matches the text color. - if (format.styles && (format.styles.color || format.styles.textDecoration)) { - tinymce.walk(curSelNode, processUnderlineAndColor, 'childNodes'); - processUnderlineAndColor(curSelNode); - } - - selection.moveToBookmark(bookmark); - selection.setRng(moveStart(selection.getRng(TRUE))); - ed.nodeChanged(); - } else - performCaretAction('apply', name, vars); - } - } - }; - - /** - * Removes the specified format from the current selection or specified node. - * - * @method remove - * @param {String} name Name of format to remove. - * @param {Object} vars Optional list of variables to replace within format before removing it. - * @param {Node/Range} node Optional node or DOM range to remove the format from defaults to current selection. - */ - function remove(name, vars, node) { - var formatList = get(name), format = formatList[0], bookmark, i, rng; - /** - * Moves the start to the first suitable text node. - */ - function moveStart(rng) { - var container = rng.startContainer, - offset = rng.startOffset, - walker, node, nodes, tmpNode; - - // Convert text node into index if possible - if (container.nodeType == 3 && offset >= container.nodeValue.length - 1) { - container = container.parentNode; - offset = nodeIndex(container) + 1; - } - - // Move startContainer/startOffset in to a suitable node - if (container.nodeType == 1) { - nodes = container.childNodes; - container = nodes[Math.min(offset, nodes.length - 1)]; - walker = new TreeWalker(container); - - // If offset is at end of the parent node walk to the next one - if (offset > nodes.length - 1) - walker.next(); - - for (node = walker.current(); node; node = walker.next()) { - if (node.nodeType == 3 && !isWhiteSpaceNode(node)) { - // IE has a "neat" feature where it moves the start node into the closest element - // we can avoid this by inserting an element before it and then remove it after we set the selection - tmpNode = dom.create('a', null, INVISIBLE_CHAR); - node.parentNode.insertBefore(tmpNode, node); - - // Set selection and remove tmpNode - rng.setStart(node, 0); - selection.setRng(rng); - dom.remove(tmpNode); - - return; - } - } - } - }; - - // Merges the styles for each node - function process(node) { - var children, i, l; - - // Grab the children first since the nodelist might be changed - children = tinymce.grep(node.childNodes); - - // Process current node - for (i = 0, l = formatList.length; i < l; i++) { - if (removeFormat(formatList[i], vars, node, node)) - break; - } - - // Process the children - if (format.deep) { - for (i = 0, l = children.length; i < l; i++) - process(children[i]); - } - }; - - function findFormatRoot(container) { - var formatRoot; - - // Find format root - each(getParents(container.parentNode).reverse(), function(parent) { - var format; - - // Find format root element - if (!formatRoot && parent.id != '_start' && parent.id != '_end') { - // Is the node matching the format we are looking for - format = matchNode(parent, name, vars); - if (format && format.split !== false) - formatRoot = parent; - } - }); - - return formatRoot; - }; - - function wrapAndSplit(format_root, container, target, split) { - var parent, clone, lastClone, firstClone, i, formatRootParent; - - // Format root found then clone formats and split it - if (format_root) { - formatRootParent = format_root.parentNode; - - for (parent = container.parentNode; parent && parent != formatRootParent; parent = parent.parentNode) { - clone = parent.cloneNode(FALSE); - - for (i = 0; i < formatList.length; i++) { - if (removeFormat(formatList[i], vars, clone, clone)) { - clone = 0; - break; - } - } - - // Build wrapper node - if (clone) { - if (lastClone) - clone.appendChild(lastClone); - - if (!firstClone) - firstClone = clone; - - lastClone = clone; - } - } - - // Never split block elements if the format is mixed - if (split && (!format.mixed || !isBlock(format_root))) - container = dom.split(format_root, container); - - // Wrap container in cloned formats - if (lastClone) { - target.parentNode.insertBefore(lastClone, target); - firstClone.appendChild(target); - } - } - - return container; - }; - - function splitToFormatRoot(container) { - return wrapAndSplit(findFormatRoot(container), container, container, true); - }; - - function unwrap(start) { - var node = dom.get(start ? '_start' : '_end'), - out = node[start ? 'firstChild' : 'lastChild']; - - // If the end is placed within the start the result will be removed - // So this checks if the out node is a bookmark node if it is it - // checks for another more suitable node - if (isBookmarkNode(out)) - out = out[start ? 'firstChild' : 'lastChild']; - - dom.remove(node, true); - - return out; - }; - - function removeRngStyle(rng) { - var startContainer, endContainer; - - rng = expandRng(rng, formatList, TRUE); - - if (format.split) { - startContainer = getContainer(rng, TRUE); - endContainer = getContainer(rng); - - if (startContainer != endContainer) { - // Wrap start/end nodes in span element since these might be cloned/moved - startContainer = wrap(startContainer, 'span', {id : '_start', 'data-mce-type' : 'bookmark'}); - endContainer = wrap(endContainer, 'span', {id : '_end', 'data-mce-type' : 'bookmark'}); - - // Split start/end - splitToFormatRoot(startContainer); - splitToFormatRoot(endContainer); - - // Unwrap start/end to get real elements again - startContainer = unwrap(TRUE); - endContainer = unwrap(); - } else - startContainer = endContainer = splitToFormatRoot(startContainer); - - // Update range positions since they might have changed after the split operations - rng.startContainer = startContainer.parentNode; - rng.startOffset = nodeIndex(startContainer); - rng.endContainer = endContainer.parentNode; - rng.endOffset = nodeIndex(endContainer) + 1; - } - - // Remove items between start/end - rangeUtils.walk(rng, function(nodes) { - each(nodes, function(node) { - process(node); - - // Remove parent span if it only contains text-decoration: underline, yet a parent node is also underlined. - if (node.nodeType === 1 && ed.dom.getStyle(node, 'text-decoration') === 'underline' && node.parentNode && getTextDecoration(node.parentNode) === 'underline') { - removeFormat({'deep': false, 'exact': true, 'inline': 'span', 'styles': {'textDecoration' : 'underline'}}, null, node); - } - }); - }); - }; - - // Handle node - if (node) { - if (node.nodeType) { - rng = dom.createRng(); - rng.setStartBefore(node); - rng.setEndAfter(node); - removeRngStyle(rng); - } else { - removeRngStyle(node); - } - - return; - } - - if (!selection.isCollapsed() || !format.inline || dom.select('td.mceSelected,th.mceSelected').length) { - bookmark = selection.getBookmark(); - removeRngStyle(selection.getRng(TRUE)); - selection.moveToBookmark(bookmark); - - // Check if start element still has formatting then we are at: "<b>text|</b>text" and need to move the start into the next text node - if (format.inline && match(name, vars, selection.getStart())) { - moveStart(selection.getRng(true)); - } - - ed.nodeChanged(); - } else - performCaretAction('remove', name, vars); - - // When you remove formatting from a table cell in WebKit (cell, not the contents of a cell) there is a rendering issue with column width - if (tinymce.isWebKit) { - ed.execCommand('mceCleanup'); - } - }; - - /** - * Toggles the specified format on/off. - * - * @method toggle - * @param {String} name Name of format to apply/remove. - * @param {Object} vars Optional list of variables to replace within format before applying/removing it. - * @param {Node} node Optional node to apply the format to or remove from. Defaults to current selection. - */ - function toggle(name, vars, node) { - var fmt = get(name); - - if (match(name, vars, node) && (!('toggle' in fmt[0]) || fmt[0]['toggle'])) - remove(name, vars, node); - else - apply(name, vars, node); - }; - - /** - * Return true/false if the specified node has the specified format. - * - * @method matchNode - * @param {Node} node Node to check the format on. - * @param {String} name Format name to check. - * @param {Object} vars Optional list of variables to replace before checking it. - * @param {Boolean} similar Match format that has similar properties. - * @return {Object} Returns the format object it matches or undefined if it doesn't match. - */ - function matchNode(node, name, vars, similar) { - var formatList = get(name), format, i, classes; - - function matchItems(node, format, item_name) { - var key, value, items = format[item_name], i; - - // Custom match - if (format.onmatch) { - return format.onmatch(node, format, item_name); - } - - // Check all items - if (items) { - // Non indexed object - if (items.length === undefined) { - for (key in items) { - if (items.hasOwnProperty(key)) { - if (item_name === 'attributes') - value = dom.getAttrib(node, key); - else - value = getStyle(node, key); - - if (similar && !value && !format.exact) - return; - - if ((!similar || format.exact) && !isEq(value, replaceVars(items[key], vars))) - return; - } - } - } else { - // Only one match needed for indexed arrays - for (i = 0; i < items.length; i++) { - if (item_name === 'attributes' ? dom.getAttrib(node, items[i]) : getStyle(node, items[i])) - return format; - } - } - } - - return format; - }; - - if (formatList && node) { - // Check each format in list - for (i = 0; i < formatList.length; i++) { - format = formatList[i]; - - // Name name, attributes, styles and classes - if (matchName(node, format) && matchItems(node, format, 'attributes') && matchItems(node, format, 'styles')) { - // Match classes - if (classes = format.classes) { - for (i = 0; i < classes.length; i++) { - if (!dom.hasClass(node, classes[i])) - return; - } - } - - return format; - } - } - } - }; - - /** - * Matches the current selection or specified node against the specified format name. - * - * @method match - * @param {String} name Name of format to match. - * @param {Object} vars Optional list of variables to replace before checking it. - * @param {Node} node Optional node to check. - * @return {boolean} true/false if the specified selection/node matches the format. - */ - function match(name, vars, node) { - var startNode; - - function matchParents(node) { - // Find first node with similar format settings - node = dom.getParent(node, function(node) { - return !!matchNode(node, name, vars, true); - }); - - // Do an exact check on the similar format element - return matchNode(node, name, vars); - }; - - // Check specified node - if (node) - return matchParents(node); - - // Check selected node - node = selection.getNode(); - if (matchParents(node)) - return TRUE; - - // Check start node if it's different - startNode = selection.getStart(); - if (startNode != node) { - if (matchParents(startNode)) - return TRUE; - } - - return FALSE; - }; - - /** - * Matches the current selection against the array of formats and returns a new array with matching formats. - * - * @method matchAll - * @param {Array} names Name of format to match. - * @param {Object} vars Optional list of variables to replace before checking it. - * @return {Array} Array with matched formats. - */ - function matchAll(names, vars) { - var startElement, matchedFormatNames = [], checkedMap = {}, i, ni, name; - - // Check start of selection for formats - startElement = selection.getStart(); - dom.getParent(startElement, function(node) { - var i, name; - - for (i = 0; i < names.length; i++) { - name = names[i]; - - if (!checkedMap[name] && matchNode(node, name, vars)) { - checkedMap[name] = true; - matchedFormatNames.push(name); - } - } - }); - - return matchedFormatNames; - }; - - /** - * Returns true/false if the specified format can be applied to the current selection or not. It will currently only check the state for selector formats, it returns true on all other format types. - * - * @method canApply - * @param {String} name Name of format to check. - * @return {boolean} true/false if the specified format can be applied to the current selection/node. - */ - function canApply(name) { - var formatList = get(name), startNode, parents, i, x, selector; - - if (formatList) { - startNode = selection.getStart(); - parents = getParents(startNode); - - for (x = formatList.length - 1; x >= 0; x--) { - selector = formatList[x].selector; - - // Format is not selector based, then always return TRUE - if (!selector) - return TRUE; - - for (i = parents.length - 1; i >= 0; i--) { - if (dom.is(parents[i], selector)) - return TRUE; - } - } - } - - return FALSE; - }; - - // Expose to public - tinymce.extend(this, { - get : get, - register : register, - apply : apply, - remove : remove, - toggle : toggle, - match : match, - matchAll : matchAll, - matchNode : matchNode, - canApply : canApply - }); - - // Private functions - - /** - * Checks if the specified nodes name matches the format inline/block or selector. - * - * @private - * @param {Node} node Node to match against the specified format. - * @param {Object} format Format object o match with. - * @return {boolean} true/false if the format matches. - */ - function matchName(node, format) { - // Check for inline match - if (isEq(node, format.inline)) - return TRUE; - - // Check for block match - if (isEq(node, format.block)) - return TRUE; - - // Check for selector match - if (format.selector) - return dom.is(node, format.selector); - }; - - /** - * Compares two string/nodes regardless of their case. - * - * @private - * @param {String/Node} Node or string to compare. - * @param {String/Node} Node or string to compare. - * @return {boolean} True/false if they match. - */ - function isEq(str1, str2) { - str1 = str1 || ''; - str2 = str2 || ''; - - str1 = '' + (str1.nodeName || str1); - str2 = '' + (str2.nodeName || str2); - - return str1.toLowerCase() == str2.toLowerCase(); - }; - - /** - * Returns the style by name on the specified node. This method modifies the style - * contents to make it more easy to match. This will resolve a few browser issues. - * - * @private - * @param {Node} node to get style from. - * @param {String} name Style name to get. - * @return {String} Style item value. - */ - function getStyle(node, name) { - var styleVal = dom.getStyle(node, name); - - // Force the format to hex - if (name == 'color' || name == 'backgroundColor') - styleVal = dom.toHex(styleVal); - - // Opera will return bold as 700 - if (name == 'fontWeight' && styleVal == 700) - styleVal = 'bold'; - - return '' + styleVal; - }; - - /** - * Replaces variables in the value. The variable format is %var. - * - * @private - * @param {String} value Value to replace variables in. - * @param {Object} vars Name/value array with variables to replace. - * @return {String} New value with replaced variables. - */ - function replaceVars(value, vars) { - if (typeof(value) != "string") - value = value(vars); - else if (vars) { - value = value.replace(/%(\w+)/g, function(str, name) { - return vars[name] || str; - }); - } - - return value; - }; - - function isWhiteSpaceNode(node) { - return node && node.nodeType === 3 && /^([\t \r\n]+|)$/.test(node.nodeValue); - }; - - function wrap(node, name, attrs) { - var wrapper = dom.create(name, attrs); - - node.parentNode.insertBefore(wrapper, node); - wrapper.appendChild(node); - - return wrapper; - }; - - /** - * Expands the specified range like object to depending on format. - * - * For example on block formats it will move the start/end position - * to the beginning of the current block. - * - * @private - * @param {Object} rng Range like object. - * @param {Array} formats Array with formats to expand by. - * @return {Object} Expanded range like object. - */ - function expandRng(rng, format, remove) { - var startContainer = rng.startContainer, - startOffset = rng.startOffset, - endContainer = rng.endContainer, - endOffset = rng.endOffset, sibling, lastIdx, leaf, endPoint; - - // This function walks up the tree if there is no siblings before/after the node - function findParentContainer(start) { - var container, parent, child, sibling, siblingName; - - container = parent = start ? startContainer : endContainer; - siblingName = start ? 'previousSibling' : 'nextSibling'; - root = dom.getRoot(); - - // If it's a text node and the offset is inside the text - if (container.nodeType == 3 && !isWhiteSpaceNode(container)) { - if (start ? startOffset > 0 : endOffset < container.nodeValue.length) { - return container; - } - } - - for (;;) { - // Stop expanding on block elements or root depending on format - if (parent == root || (!format[0].block_expand && isBlock(parent))) - return parent; - - // Walk left/right - for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) { - if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling)) { - return parent; - } - } - - // Check if we can move up are we at root level or body level - parent = parent.parentNode; - } - - return container; - }; - - // This function walks down the tree to find the leaf at the selection. - // The offset is also returned as if node initially a leaf, the offset may be in the middle of the text node. - function findLeaf(node, offset) { - if (offset === undefined) - offset = node.nodeType === 3 ? node.length : node.childNodes.length; - while (node && node.hasChildNodes()) { - node = node.childNodes[offset]; - if (node) - offset = node.nodeType === 3 ? node.length : node.childNodes.length; - } - return { node: node, offset: offset }; - } - - // If index based start position then resolve it - if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) { - lastIdx = startContainer.childNodes.length - 1; - startContainer = startContainer.childNodes[startOffset > lastIdx ? lastIdx : startOffset]; - - if (startContainer.nodeType == 3) - startOffset = 0; - } - - // If index based end position then resolve it - if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) { - lastIdx = endContainer.childNodes.length - 1; - endContainer = endContainer.childNodes[endOffset > lastIdx ? lastIdx : endOffset - 1]; - - if (endContainer.nodeType == 3) - endOffset = endContainer.nodeValue.length; - } - - // Exclude bookmark nodes if possible - if (isBookmarkNode(startContainer.parentNode) || isBookmarkNode(startContainer)) { - startContainer = isBookmarkNode(startContainer) ? startContainer : startContainer.parentNode; - startContainer = startContainer.nextSibling || startContainer; - - if (startContainer.nodeType == 3) - startOffset = 0; - } - - if (isBookmarkNode(endContainer.parentNode) || isBookmarkNode(endContainer)) { - endContainer = isBookmarkNode(endContainer) ? endContainer : endContainer.parentNode; - endContainer = endContainer.previousSibling || endContainer; - - if (endContainer.nodeType == 3) - endOffset = endContainer.length; - } - - if (format[0].inline) { - if (rng.collapsed) { - function findWordEndPoint(container, offset, start) { - var walker, node, pos, lastTextNode; - - function findSpace(node, offset) { - var pos, pos2, str = node.nodeValue; - - if (typeof(offset) == "undefined") { - offset = start ? str.length : 0; - } - - if (start) { - pos = str.lastIndexOf(' ', offset); - pos2 = str.lastIndexOf('\u00a0', offset); - pos = pos > pos2 ? pos : pos2; - - // Include the space on remove to avoid tag soup - if (pos !== -1 && !remove) { - pos++; - } - } else { - pos = str.indexOf(' ', offset); - pos2 = str.indexOf('\u00a0', offset); - pos = pos !== -1 && (pos2 === -1 || pos < pos2) ? pos : pos2; - } - - return pos; - }; - - if (container.nodeType === 3) { - pos = findSpace(container, offset); - - if (pos !== -1) { - return {container : container, offset : pos}; - } - - lastTextNode = container; - } - - // Walk the nodes inside the block - walker = new TreeWalker(container, dom.getParent(container, isBlock) || ed.getBody()); - while (node = walker[start ? 'prev' : 'next']()) { - if (node.nodeType === 3) { - lastTextNode = node; - pos = findSpace(node); - - if (pos !== -1) { - return {container : node, offset : pos}; - } - } else if (isBlock(node)) { - break; - } - } - - if (lastTextNode) { - if (start) { - offset = 0; - } else { - offset = lastTextNode.length; - } - - return {container: lastTextNode, offset: offset}; - } - } - - // Expand left to closest word boundery - endPoint = findWordEndPoint(startContainer, startOffset, true); - if (endPoint) { - startContainer = endPoint.container; - startOffset = endPoint.offset; - } - - // Expand right to closest word boundery - endPoint = findWordEndPoint(endContainer, endOffset); - if (endPoint) { - endContainer = endPoint.container; - endOffset = endPoint.offset; - } - } - - // Avoid applying formatting to a trailing space. - leaf = findLeaf(endContainer, endOffset); - if (leaf.node) { - while (leaf.node && leaf.offset === 0 && leaf.node.previousSibling) - leaf = findLeaf(leaf.node.previousSibling); - - if (leaf.node && leaf.offset > 0 && leaf.node.nodeType === 3 && - leaf.node.nodeValue.charAt(leaf.offset - 1) === ' ') { - - if (leaf.offset > 1) { - endContainer = leaf.node; - endContainer.splitText(leaf.offset - 1); - } else if (leaf.node.previousSibling) { - // TODO: Figure out why this is in here - //endContainer = leaf.node.previousSibling; - } - } - } - } - - // Move start/end point up the tree if the leaves are sharp and if we are in different containers - // Example * becomes !: !<p><b><i>*text</i><i>text*</i></b></p>! - // This will reduce the number of wrapper elements that needs to be created - // Move start point up the tree - if (format[0].inline || format[0].block_expand) { - if (!format[0].inline || (startContainer.nodeType != 3 || startOffset === 0)) { - startContainer = findParentContainer(true); - } - - if (!format[0].inline || (endContainer.nodeType != 3 || endOffset === endContainer.nodeValue.length)) { - endContainer = findParentContainer(); - } - } - - // Expand start/end container to matching selector - if (format[0].selector && format[0].expand !== FALSE && !format[0].inline) { - function findSelectorEndPoint(container, sibling_name) { - var parents, i, y, curFormat; - - if (container.nodeType == 3 && container.nodeValue.length == 0 && container[sibling_name]) - container = container[sibling_name]; - - parents = getParents(container); - for (i = 0; i < parents.length; i++) { - for (y = 0; y < format.length; y++) { - curFormat = format[y]; - - // If collapsed state is set then skip formats that doesn't match that - if ("collapsed" in curFormat && curFormat.collapsed !== rng.collapsed) - continue; - - if (dom.is(parents[i], curFormat.selector)) - return parents[i]; - } - } - - return container; - }; - - // Find new startContainer/endContainer if there is better one - startContainer = findSelectorEndPoint(startContainer, 'previousSibling'); - endContainer = findSelectorEndPoint(endContainer, 'nextSibling'); - } - - // Expand start/end container to matching block element or text node - if (format[0].block || format[0].selector) { - function findBlockEndPoint(container, sibling_name, sibling_name2) { - var node; - - // Expand to block of similar type - if (!format[0].wrapper) - node = dom.getParent(container, format[0].block); - - // Expand to first wrappable block element or any block element - if (!node) - node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, isBlock); - - // Exclude inner lists from wrapping - if (node && format[0].wrapper) - node = getParents(node, 'ul,ol').reverse()[0] || node; - - // Didn't find a block element look for first/last wrappable element - if (!node) { - node = container; - - while (node[sibling_name] && !isBlock(node[sibling_name])) { - node = node[sibling_name]; - - // Break on BR but include it will be removed later on - // we can't remove it now since we need to check if it can be wrapped - if (isEq(node, 'br')) - break; - } - } - - return node || container; - }; - - // Find new startContainer/endContainer if there is better one - startContainer = findBlockEndPoint(startContainer, 'previousSibling'); - endContainer = findBlockEndPoint(endContainer, 'nextSibling'); - - // Non block element then try to expand up the leaf - if (format[0].block) { - if (!isBlock(startContainer)) - startContainer = findParentContainer(true); - - if (!isBlock(endContainer)) - endContainer = findParentContainer(); - } - } - - // Setup index for startContainer - if (startContainer.nodeType == 1) { - startOffset = nodeIndex(startContainer); - startContainer = startContainer.parentNode; - } - - // Setup index for endContainer - if (endContainer.nodeType == 1) { - endOffset = nodeIndex(endContainer) + 1; - endContainer = endContainer.parentNode; - } - - // Return new range like object - return { - startContainer : startContainer, - startOffset : startOffset, - endContainer : endContainer, - endOffset : endOffset - }; - } - - /** - * Removes the specified format for the specified node. It will also remove the node if it doesn't have - * any attributes if the format specifies it to do so. - * - * @private - * @param {Object} format Format object with items to remove from node. - * @param {Object} vars Name/value object with variables to apply to format. - * @param {Node} node Node to remove the format styles on. - * @param {Node} compare_node Optional compare node, if specified the styles will be compared to that node. - * @return {Boolean} True/false if the node was removed or not. - */ - function removeFormat(format, vars, node, compare_node) { - var i, attrs, stylesModified; - - // Check if node matches format - if (!matchName(node, format)) - return FALSE; - - // Should we compare with format attribs and styles - if (format.remove != 'all') { - // Remove styles - each(format.styles, function(value, name) { - value = replaceVars(value, vars); - - // Indexed array - if (typeof(name) === 'number') { - name = value; - compare_node = 0; - } - - if (!compare_node || isEq(getStyle(compare_node, name), value)) - dom.setStyle(node, name, ''); - - stylesModified = 1; - }); - - // Remove style attribute if it's empty - if (stylesModified && dom.getAttrib(node, 'style') == '') { - node.removeAttribute('style'); - node.removeAttribute('data-mce-style'); - } - - // Remove attributes - each(format.attributes, function(value, name) { - var valueOut; - - value = replaceVars(value, vars); - - // Indexed array - if (typeof(name) === 'number') { - name = value; - compare_node = 0; - } - - if (!compare_node || isEq(dom.getAttrib(compare_node, name), value)) { - // Keep internal classes - if (name == 'class') { - value = dom.getAttrib(node, name); - if (value) { - // Build new class value where everything is removed except the internal prefixed classes - valueOut = ''; - each(value.split(/\s+/), function(cls) { - if (/mce\w+/.test(cls)) - valueOut += (valueOut ? ' ' : '') + cls; - }); - - // We got some internal classes left - if (valueOut) { - dom.setAttrib(node, name, valueOut); - return; - } - } - } - - // IE6 has a bug where the attribute doesn't get removed correctly - if (name == "class") - node.removeAttribute('className'); - - // Remove mce prefixed attributes - if (MCE_ATTR_RE.test(name)) - node.removeAttribute('data-mce-' + name); - - node.removeAttribute(name); - } - }); - - // Remove classes - each(format.classes, function(value) { - value = replaceVars(value, vars); - - if (!compare_node || dom.hasClass(compare_node, value)) - dom.removeClass(node, value); - }); - - // Check for non internal attributes - attrs = dom.getAttribs(node); - for (i = 0; i < attrs.length; i++) { - if (attrs[i].nodeName.indexOf('_') !== 0) - return FALSE; - } - } - - // Remove the inline child if it's empty for example <b> or <span> - if (format.remove != 'none') { - removeNode(node, format); - return TRUE; - } - }; - - /** - * Removes the node and wrap it's children in paragraphs before doing so or - * appends BR elements to the beginning/end of the block element if forcedRootBlocks is disabled. - * - * If the div in the node below gets removed: - * text<div>text</div>text - * - * Output becomes: - * text<div><br />text<br /></div>text - * - * So when the div is removed the result is: - * text<br />text<br />text - * - * @private - * @param {Node} node Node to remove + apply BR/P elements to. - * @param {Object} format Format rule. - * @return {Node} Input node. - */ - function removeNode(node, format) { - var parentNode = node.parentNode, rootBlockElm; - - if (format.block) { - if (!forcedRootBlock) { - function find(node, next, inc) { - node = getNonWhiteSpaceSibling(node, next, inc); - - return !node || (node.nodeName == 'BR' || isBlock(node)); - }; - - // Append BR elements if needed before we remove the block - if (isBlock(node) && !isBlock(parentNode)) { - if (!find(node, FALSE) && !find(node.firstChild, TRUE, 1)) - node.insertBefore(dom.create('br'), node.firstChild); - - if (!find(node, TRUE) && !find(node.lastChild, FALSE, 1)) - node.appendChild(dom.create('br')); - } - } else { - // Wrap the block in a forcedRootBlock if we are at the root of document - if (parentNode == dom.getRoot()) { - if (!format.list_block || !isEq(node, format.list_block)) { - each(tinymce.grep(node.childNodes), function(node) { - if (isValid(forcedRootBlock, node.nodeName.toLowerCase())) { - if (!rootBlockElm) - rootBlockElm = wrap(node, forcedRootBlock); - else - rootBlockElm.appendChild(node); - } else - rootBlockElm = 0; - }); - } - } - } - } - - // Never remove nodes that isn't the specified inline element if a selector is specified too - if (format.selector && format.inline && !isEq(format.inline, node)) - return; - - dom.remove(node, 1); - }; - - /** - * Returns the next/previous non whitespace node. - * - * @private - * @param {Node} node Node to start at. - * @param {boolean} next (Optional) Include next or previous node defaults to previous. - * @param {boolean} inc (Optional) Include the current node in checking. Defaults to false. - * @return {Node} Next or previous node or undefined if it wasn't found. - */ - function getNonWhiteSpaceSibling(node, next, inc) { - if (node) { - next = next ? 'nextSibling' : 'previousSibling'; - - for (node = inc ? node : node[next]; node; node = node[next]) { - if (node.nodeType == 1 || !isWhiteSpaceNode(node)) - return node; - } - } - }; - - /** - * Checks if the specified node is a bookmark node or not. - * - * @param {Node} node Node to check if it's a bookmark node or not. - * @return {Boolean} true/false if the node is a bookmark node. - */ - function isBookmarkNode(node) { - return node && node.nodeType == 1 && node.getAttribute('data-mce-type') == 'bookmark'; - }; - - /** - * Merges the next/previous sibling element if they match. - * - * @private - * @param {Node} prev Previous node to compare/merge. - * @param {Node} next Next node to compare/merge. - * @return {Node} Next node if we didn't merge and prev node if we did. - */ - function mergeSiblings(prev, next) { - var marker, sibling, tmpSibling; - - /** - * Compares two nodes and checks if it's attributes and styles matches. - * This doesn't compare classes as items since their order is significant. - * - * @private - * @param {Node} node1 First node to compare with. - * @param {Node} node2 Second node to compare with. - * @return {boolean} True/false if the nodes are the same or not. - */ - function compareElements(node1, node2) { - // Not the same name - if (node1.nodeName != node2.nodeName) - return FALSE; - - /** - * Returns all the nodes attributes excluding internal ones, styles and classes. - * - * @private - * @param {Node} node Node to get attributes from. - * @return {Object} Name/value object with attributes and attribute values. - */ - function getAttribs(node) { - var attribs = {}; - - each(dom.getAttribs(node), function(attr) { - var name = attr.nodeName.toLowerCase(); - - // Don't compare internal attributes or style - if (name.indexOf('_') !== 0 && name !== 'style') - attribs[name] = dom.getAttrib(node, name); - }); - - return attribs; - }; - - /** - * Compares two objects checks if it's key + value exists in the other one. - * - * @private - * @param {Object} obj1 First object to compare. - * @param {Object} obj2 Second object to compare. - * @return {boolean} True/false if the objects matches or not. - */ - function compareObjects(obj1, obj2) { - var value, name; - - for (name in obj1) { - // Obj1 has item obj2 doesn't have - if (obj1.hasOwnProperty(name)) { - value = obj2[name]; - - // Obj2 doesn't have obj1 item - if (value === undefined) - return FALSE; - - // Obj2 item has a different value - if (obj1[name] != value) - return FALSE; - - // Delete similar value - delete obj2[name]; - } - } - - // Check if obj 2 has something obj 1 doesn't have - for (name in obj2) { - // Obj2 has item obj1 doesn't have - if (obj2.hasOwnProperty(name)) - return FALSE; - } - - return TRUE; - }; - - // Attribs are not the same - if (!compareObjects(getAttribs(node1), getAttribs(node2))) - return FALSE; - - // Styles are not the same - if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style')))) - return FALSE; - - return TRUE; - }; - - // Check if next/prev exists and that they are elements - if (prev && next) { - function findElementSibling(node, sibling_name) { - for (sibling = node; sibling; sibling = sibling[sibling_name]) { - if (sibling.nodeType == 3 && sibling.nodeValue.length !== 0) - return node; - - if (sibling.nodeType == 1 && !isBookmarkNode(sibling)) - return sibling; - } - - return node; - }; - - // If previous sibling is empty then jump over it - prev = findElementSibling(prev, 'previousSibling'); - next = findElementSibling(next, 'nextSibling'); - - // Compare next and previous nodes - if (compareElements(prev, next)) { - // Append nodes between - for (sibling = prev.nextSibling; sibling && sibling != next;) { - tmpSibling = sibling; - sibling = sibling.nextSibling; - prev.appendChild(tmpSibling); - } - - // Remove next node - dom.remove(next); - - // Move children into prev node - each(tinymce.grep(next.childNodes), function(node) { - prev.appendChild(node); - }); - - return prev; - } - } - - return next; - }; - - /** - * Returns true/false if the specified node is a text block or not. - * - * @private - * @param {Node} node Node to check. - * @return {boolean} True/false if the node is a text block. - */ - function isTextBlock(name) { - return /^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(name); - }; - - function getContainer(rng, start) { - var container, offset, lastIdx, walker; - - container = rng[start ? 'startContainer' : 'endContainer']; - offset = rng[start ? 'startOffset' : 'endOffset']; - - if (container.nodeType == 1) { - lastIdx = container.childNodes.length - 1; - - if (!start && offset) - offset--; - - container = container.childNodes[offset > lastIdx ? lastIdx : offset]; - } - - // If start text node is excluded then walk to the next node - if (container.nodeType === 3 && start && offset >= container.nodeValue.length) { - container = new TreeWalker(container, ed.getBody()).next() || container; - } - - // If end text node is excluded then walk to the previous node - if (container.nodeType === 3 && !start && offset == 0) { - container = new TreeWalker(container, ed.getBody()).prev() || container; - } - - return container; - }; - - function performCaretAction(type, name, vars) { - var invisibleChar, caretContainerId = '_mce_caret', debug = ed.settings.caret_debug; - - // Setup invisible character use zero width space on Gecko since it doesn't change the heigt of the container - invisibleChar = tinymce.isGecko ? '\u200B' : INVISIBLE_CHAR; - - // Creates a caret container bogus element - function createCaretContainer(fill) { - var caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''}); - - if (fill) { - caretContainer.appendChild(ed.getDoc().createTextNode(invisibleChar)); - } - - return caretContainer; - }; - - function isCaretContainerEmpty(node, nodes) { - while (node) { - if ((node.nodeType === 3 && node.nodeValue !== invisibleChar) || node.childNodes.length > 1) { - return false; - } - - // Collect nodes - if (nodes && node.nodeType === 1) { - nodes.push(node); - } - - node = node.firstChild; - } - - return true; - }; - - // Returns any parent caret container element - function getParentCaretContainer(node) { - while (node) { - if (node.id === caretContainerId) { - return node; - } - - node = node.parentNode; - } - }; - - // Finds the first text node in the specified node - function findFirstTextNode(node) { - var walker; - - if (node) { - walker = new TreeWalker(node, node); - - for (node = walker.current(); node; node = walker.next()) { - if (node.nodeType === 3) { - return node; - } - } - } - }; - - // Removes the caret container for the specified node or all on the current document - function removeCaretContainer(node, move_caret) { - var child, rng; - - if (!node) { - node = getParentCaretContainer(selection.getStart()); - - if (!node) { - while (node = dom.get(caretContainerId)) { - removeCaretContainer(node, false); - } - } - } else { - rng = selection.getRng(true); - - if (isCaretContainerEmpty(node)) { - if (move_caret !== false) { - rng.setStartBefore(node); - rng.setEndBefore(node); - } - - dom.remove(node); - } else { - child = findFirstTextNode(node); - child = child.deleteData(0, 1); - dom.remove(node, 1); - } - - selection.setRng(rng); - } - }; - - // Applies formatting to the caret position - function applyCaretFormat() { - var rng, caretContainer, textNode, offset, bookmark, container, text; - - rng = selection.getRng(true); - offset = rng.startOffset; - container = rng.startContainer; - text = container.nodeValue; - - caretContainer = getParentCaretContainer(selection.getStart()); - if (caretContainer) { - textNode = findFirstTextNode(caretContainer); - } - - // Expand to word is caret is in the middle of a text node and the char before/after is a alpha numeric character - if (text && offset > 0 && offset < text.length && /\w/.test(text.charAt(offset)) && /\w/.test(text.charAt(offset - 1))) { - // Get bookmark of caret position - bookmark = selection.getBookmark(); - - // Collapse bookmark range (WebKit) - rng.collapse(true); - - // Expand the range to the closest word and split it at those points - rng = expandRng(rng, get(name)); - rng = rangeUtils.split(rng); - - // Apply the format to the range - apply(name, vars, rng); - - // Move selection back to caret position - selection.moveToBookmark(bookmark); - } else { - if (!caretContainer || textNode.nodeValue !== invisibleChar) { - caretContainer = createCaretContainer(true); - textNode = caretContainer.firstChild; - - rng.insertNode(caretContainer); - offset = 1; - - apply(name, vars, caretContainer); - } else { - apply(name, vars, caretContainer); - } - - // Move selection to text node - selection.setCursorLocation(textNode, offset); - } - }; - - function removeCaretFormat() { - var rng = selection.getRng(true), container, offset, bookmark, - hasContentAfter, node, formatNode, parents = [], i, caretContainer; - - container = rng.startContainer; - offset = rng.startOffset; - node = container; - - if (container.nodeType == 3) { - if (offset != container.nodeValue.length || container.nodeValue === invisibleChar) { - hasContentAfter = true; - } - - node = node.parentNode; - } - - while (node) { - if (matchNode(node, name, vars)) { - formatNode = node; - break; - } - - if (node.nextSibling) { - hasContentAfter = true; - } - - parents.push(node); - node = node.parentNode; - } - - // Node doesn't have the specified format - if (!formatNode) { - return; - } - - // Is there contents after the caret then remove the format on the element - if (hasContentAfter) { - // Get bookmark of caret position - bookmark = selection.getBookmark(); - - // Collapse bookmark range (WebKit) - rng.collapse(true); - - // Expand the range to the closest word and split it at those points - rng = expandRng(rng, get(name), true); - rng = rangeUtils.split(rng); - - // Remove the format from the range - remove(name, vars, rng); - - // Move selection back to caret position - selection.moveToBookmark(bookmark); - } else { - caretContainer = createCaretContainer(); - - node = caretContainer; - for (i = parents.length - 1; i >= 0; i--) { - node.appendChild(parents[i].cloneNode(false)); - node = node.firstChild; - } - - // Insert invisible character into inner most format element - node.appendChild(dom.doc.createTextNode(invisibleChar)); - node = node.firstChild; - - // Insert caret container after the formatted node - dom.insertAfter(caretContainer, formatNode); - - // Move selection to text node - selection.setCursorLocation(node, 1); - } - }; - - // Mark current caret container elements as bogus when getting the contents so we don't end up with empty elements - ed.onBeforeGetContent.addToTop(function() { - var nodes = [], i; - - if (isCaretContainerEmpty(getParentCaretContainer(selection.getStart()), nodes)) { - // Mark children - i = nodes.length; - while (i--) { - dom.setAttrib(nodes[i], 'data-mce-bogus', '1'); - } - } - }); - - // Remove caret container on mouse up and on key up - tinymce.each('onMouseUp onKeyUp'.split(' '), function(name) { - ed[name].addToTop(function() { - removeCaretContainer(); - }); - }); - - // Remove caret container on keydown and it's a backspace, enter or left/right arrow keys - ed.onKeyDown.addToTop(function(ed, e) { - var keyCode = e.keyCode; - - if (keyCode == 8 || keyCode == 37 || keyCode == 39) { - removeCaretContainer(getParentCaretContainer(selection.getStart())); - } - }); - - // Do apply or remove caret format - if (type == "apply") { - applyCaretFormat(); - } else { - removeCaretFormat(); - } - }; - }; -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/LegacyInput.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/LegacyInput.js deleted file mode 100644 index f3c5021ae15d..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/LegacyInput.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * LegacyInput.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -tinymce.onAddEditor.add(function(tinymce, ed) { - var filters, fontSizes, dom, settings = ed.settings; - - if (settings.inline_styles) { - fontSizes = tinymce.explode(settings.font_size_legacy_values); - - function replaceWithSpan(node, styles) { - tinymce.each(styles, function(value, name) { - if (value) - dom.setStyle(node, name, value); - }); - - dom.rename(node, 'span'); - }; - - filters = { - font : function(dom, node) { - replaceWithSpan(node, { - backgroundColor : node.style.backgroundColor, - color : node.color, - fontFamily : node.face, - fontSize : fontSizes[parseInt(node.size) - 1] - }); - }, - - u : function(dom, node) { - replaceWithSpan(node, { - textDecoration : 'underline' - }); - }, - - strike : function(dom, node) { - replaceWithSpan(node, { - textDecoration : 'line-through' - }); - } - }; - - function convert(editor, params) { - dom = editor.dom; - - if (settings.convert_fonts_to_spans) { - tinymce.each(dom.select('font,u,strike', params.node), function(node) { - filters[node.nodeName.toLowerCase()](ed.dom, node); - }); - } - }; - - ed.onPreProcess.add(convert); - ed.onSetContent.add(convert); - - ed.onInit.add(function() { - ed.selection.onSetContent.add(convert); - }); - } -}); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/Popup.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/Popup.js deleted file mode 100644 index 5667fc248cec..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/Popup.js +++ /dev/null @@ -1,456 +0,0 @@ -/** - * Popup.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -// Some global instances -var tinymce = null, tinyMCEPopup, tinyMCE; - -/** - * TinyMCE popup/dialog helper class. This gives you easy access to the - * parent editor instance and a bunch of other things. It's higly recommended - * that you load this script into your dialogs. - * - * @static - * @class tinyMCEPopup - */ -tinyMCEPopup = { - /** - * Initializes the popup this will be called automatically. - * - * @method init - */ - init : function() { - var t = this, w, ti; - - // Find window & API - w = t.getWin(); - tinymce = w.tinymce; - tinyMCE = w.tinyMCE; - t.editor = tinymce.EditorManager.activeEditor; - t.params = t.editor.windowManager.params; - t.features = t.editor.windowManager.features; - - // Setup local DOM - t.dom = t.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document); - - // Enables you to skip loading the default css - if (t.features.popup_css !== false) - t.dom.loadCSS(t.features.popup_css || t.editor.settings.popup_css); - - // Setup on init listeners - t.listeners = []; - - /** - * Fires when the popup is initialized. - * - * @event onInit - * @param {tinymce.Editor} editor Editor instance. - * @example - * // Alerts the selected contents when the dialog is loaded - * tinyMCEPopup.onInit.add(function(ed) { - * alert(ed.selection.getContent()); - * }); - * - * // Executes the init method on page load in some object using the SomeObject scope - * tinyMCEPopup.onInit.add(SomeObject.init, SomeObject); - */ - t.onInit = { - add : function(f, s) { - t.listeners.push({func : f, scope : s}); - } - }; - - t.isWindow = !t.getWindowArg('mce_inline'); - t.id = t.getWindowArg('mce_window_id'); - t.editor.windowManager.onOpen.dispatch(t.editor.windowManager, window); - }, - - /** - * Returns the reference to the parent window that opened the dialog. - * - * @method getWin - * @return {Window} Reference to the parent window that opened the dialog. - */ - getWin : function() { - // Added frameElement check to fix bug: #2817583 - return (!window.frameElement && window.dialogArguments) || opener || parent || top; - }, - - /** - * Returns a window argument/parameter by name. - * - * @method getWindowArg - * @param {String} n Name of the window argument to retrieve. - * @param {String} dv Optional default value to return. - * @return {String} Argument value or default value if it wasn't found. - */ - getWindowArg : function(n, dv) { - var v = this.params[n]; - - return tinymce.is(v) ? v : dv; - }, - - /** - * Returns a editor parameter/config option value. - * - * @method getParam - * @param {String} n Name of the editor config option to retrieve. - * @param {String} dv Optional default value to return. - * @return {String} Parameter value or default value if it wasn't found. - */ - getParam : function(n, dv) { - return this.editor.getParam(n, dv); - }, - - /** - * Returns a language item by key. - * - * @method getLang - * @param {String} n Language item like mydialog.something. - * @param {String} dv Optional default value to return. - * @return {String} Language value for the item like "my string" or the default value if it wasn't found. - */ - getLang : function(n, dv) { - return this.editor.getLang(n, dv); - }, - - /** - * Executed a command on editor that opened the dialog/popup. - * - * @method execCommand - * @param {String} cmd Command to execute. - * @param {Boolean} ui Optional boolean value if the UI for the command should be presented or not. - * @param {Object} val Optional value to pass with the comman like an URL. - * @param {Object} a Optional arguments object. - */ - execCommand : function(cmd, ui, val, a) { - a = a || {}; - a.skip_focus = 1; - - this.restoreSelection(); - return this.editor.execCommand(cmd, ui, val, a); - }, - - /** - * Resizes the dialog to the inner size of the window. This is needed since various browsers - * have different border sizes on windows. - * - * @method resizeToInnerSize - */ - resizeToInnerSize : function() { - var t = this; - - // Detach it to workaround a Chrome specific bug - // https://sourceforge.net/tracker/?func=detail&atid=635682&aid=2926339&group_id=103281 - setTimeout(function() { - var vp = t.dom.getViewPort(window); - - t.editor.windowManager.resizeBy( - t.getWindowArg('mce_width') - vp.w, - t.getWindowArg('mce_height') - vp.h, - t.id || window - ); - }, 10); - }, - - /** - * Will executed the specified string when the page has been loaded. This function - * was added for compatibility with the 2.x branch. - * - * @method executeOnLoad - * @param {String} s String to evalutate on init. - */ - executeOnLoad : function(s) { - this.onInit.add(function() { - eval(s); - }); - }, - - /** - * Stores the current editor selection for later restoration. This can be useful since some browsers - * looses it's selection if a control element is selected/focused inside the dialogs. - * - * @method storeSelection - */ - storeSelection : function() { - this.editor.windowManager.bookmark = tinyMCEPopup.editor.selection.getBookmark(1); - }, - - /** - * Restores any stored selection. This can be useful since some browsers - * looses it's selection if a control element is selected/focused inside the dialogs. - * - * @method restoreSelection - */ - restoreSelection : function() { - var t = tinyMCEPopup; - - if (!t.isWindow && tinymce.isIE) - t.editor.selection.moveToBookmark(t.editor.windowManager.bookmark); - }, - - /** - * Loads a specific dialog language pack. If you pass in plugin_url as a arugment - * when you open the window it will load the <plugin url>/langs/<code>_dlg.js lang pack file. - * - * @method requireLangPack - */ - requireLangPack : function() { - var t = this, u = t.getWindowArg('plugin_url') || t.getWindowArg('theme_url'); - - if (u && t.editor.settings.language && t.features.translate_i18n !== false && t.editor.settings.language_load !== false) { - u += '/langs/' + t.editor.settings.language + '_dlg.js'; - - if (!tinymce.ScriptLoader.isDone(u)) { - document.write('<script type="text/javascript" src="' + tinymce._addVer(u) + '"></script>'); - tinymce.ScriptLoader.markDone(u); - } - } - }, - - /** - * Executes a color picker on the specified element id. When the user - * then selects a color it will be set as the value of the specified element. - * - * @method pickColor - * @param {DOMEvent} e DOM event object. - * @param {string} element_id Element id to be filled with the color value from the picker. - */ - pickColor : function(e, element_id) { - this.execCommand('mceColorPicker', true, { - color : document.getElementById(element_id).value, - func : function(c) { - document.getElementById(element_id).value = c; - - try { - document.getElementById(element_id).onchange(); - } catch (ex) { - // Try fire event, ignore errors - } - } - }); - }, - - /** - * Opens a filebrowser/imagebrowser this will set the output value from - * the browser as a value on the specified element. - * - * @method openBrowser - * @param {string} element_id Id of the element to set value in. - * @param {string} type Type of browser to open image/file/flash. - * @param {string} option Option name to get the file_broswer_callback function name from. - */ - openBrowser : function(element_id, type, option) { - tinyMCEPopup.restoreSelection(); - this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window); - }, - - /** - * Creates a confirm dialog. Please don't use the blocking behavior of this - * native version use the callback method instead then it can be extended. - * - * @method confirm - * @param {String} t Title for the new confirm dialog. - * @param {function} cb Callback function to be executed after the user has selected ok or cancel. - * @param {Object} s Optional scope to execute the callback in. - */ - confirm : function(t, cb, s) { - this.editor.windowManager.confirm(t, cb, s, window); - }, - - /** - * Creates a alert dialog. Please don't use the blocking behavior of this - * native version use the callback method instead then it can be extended. - * - * @method alert - * @param {String} t Title for the new alert dialog. - * @param {function} cb Callback function to be executed after the user has selected ok. - * @param {Object} s Optional scope to execute the callback in. - */ - alert : function(tx, cb, s) { - this.editor.windowManager.alert(tx, cb, s, window); - }, - - /** - * Closes the current window. - * - * @method close - */ - close : function() { - var t = this; - - // To avoid domain relaxing issue in Opera - function close() { - t.editor.windowManager.close(window); - tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup - }; - - if (tinymce.isOpera) - t.getWin().setTimeout(close, 0); - else - close(); - }, - - // Internal functions - - _restoreSelection : function() { - var e = window.event.srcElement; - - if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button')) - tinyMCEPopup.restoreSelection(); - }, - -/* _restoreSelection : function() { - var e = window.event.srcElement; - - // If user focus a non text input or textarea - if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text') - tinyMCEPopup.restoreSelection(); - },*/ - - _onDOMLoaded : function() { - var t = tinyMCEPopup, ti = document.title, bm, h, nv; - - if (t.domLoaded) - return; - - t.domLoaded = 1; - - // Translate page - if (t.features.translate_i18n !== false) { - h = document.body.innerHTML; - - // Replace a=x with a="x" in IE - if (tinymce.isIE) - h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"') - - document.dir = t.editor.getParam('directionality',''); - - if ((nv = t.editor.translate(h)) && nv != h) - document.body.innerHTML = nv; - - if ((nv = t.editor.translate(ti)) && nv != ti) - document.title = ti = nv; - } - - if (!t.editor.getParam('browser_preferred_colors', false) || !t.isWindow) - t.dom.addClass(document.body, 'forceColors'); - - document.body.style.display = ''; - - // Restore selection in IE when focus is placed on a non textarea or input element of the type text - if (tinymce.isIE) { - document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection); - - // Add base target element for it since it would fail with modal dialogs - t.dom.add(t.dom.select('head')[0], 'base', {target : '_self'}); - } - - t.restoreSelection(); - t.resizeToInnerSize(); - - // Set inline title - if (!t.isWindow) - t.editor.windowManager.setTitle(window, ti); - else - window.focus(); - - if (!tinymce.isIE && !t.isWindow) { - tinymce.dom.Event._add(document, 'focus', function() { - t.editor.windowManager.focus(t.id); - }); - } - - // Patch for accessibility - tinymce.each(t.dom.select('select'), function(e) { - e.onkeydown = tinyMCEPopup._accessHandler; - }); - - // Call onInit - // Init must be called before focus so the selection won't get lost by the focus call - tinymce.each(t.listeners, function(o) { - o.func.call(o.scope, t.editor); - }); - - // Move focus to window - if (t.getWindowArg('mce_auto_focus', true)) { - window.focus(); - - // Focus element with mceFocus class - tinymce.each(document.forms, function(f) { - tinymce.each(f.elements, function(e) { - if (t.dom.hasClass(e, 'mceFocus') && !e.disabled) { - e.focus(); - return false; // Break loop - } - }); - }); - } - - document.onkeyup = tinyMCEPopup._closeWinKeyHandler; - }, - - _accessHandler : function(e) { - e = e || window.event; - - if (e.keyCode == 13 || e.keyCode == 32) { - e = e.target || e.srcElement; - - if (e.onchange) - e.onchange(); - - return tinymce.dom.Event.cancel(e); - } - }, - - _closeWinKeyHandler : function(e) { - e = e || window.event; - - if (e.keyCode == 27) - tinyMCEPopup.close(); - }, - - _wait : function() { - // Use IE method - if (document.attachEvent) { - document.attachEvent("onreadystatechange", function() { - if (document.readyState === "complete") { - document.detachEvent("onreadystatechange", arguments.callee); - tinyMCEPopup._onDOMLoaded(); - } - }); - - if (document.documentElement.doScroll && window == window.top) { - (function() { - if (tinyMCEPopup.domLoaded) - return; - - try { - // If IE is used, use the trick by Diego Perini licensed under MIT by request to the author. - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch (ex) { - setTimeout(arguments.callee, 0); - return; - } - - tinyMCEPopup._onDOMLoaded(); - })(); - } - - document.attachEvent('onload', tinyMCEPopup._onDOMLoaded); - } else if (document.addEventListener) { - window.addEventListener('DOMContentLoaded', tinyMCEPopup._onDOMLoaded, false); - window.addEventListener('load', tinyMCEPopup._onDOMLoaded, false); - } - } -}; - -tinyMCEPopup.init(); -tinyMCEPopup._wait(); // Wait for DOM Content Loaded diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/UndoManager.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/UndoManager.js deleted file mode 100644 index 045aa839bd8e..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/UndoManager.js +++ /dev/null @@ -1,200 +0,0 @@ -/** - * UndoManager.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var Dispatcher = tinymce.util.Dispatcher; - - /** - * This class handles the undo/redo history levels for the editor. Since the build in undo/redo has major drawbacks a custom one was needed. - * - * @class tinymce.UndoManager - */ - tinymce.UndoManager = function(editor) { - var self, index = 0, data = [], beforeBookmark; - - function getContent() { - return tinymce.trim(editor.getContent({format : 'raw', no_events : 1})); - }; - - return self = { - /** - * State if the user is currently typing or not. This will add a typing operation into one undo - * level instead of one new level for each keystroke. - * - * @field {Boolean} typing - */ - typing : false, - - /** - * This event will fire each time a new undo level is added to the undo manager. - * - * @event onAdd - * @param {tinymce.UndoManager} sender UndoManager instance that got the new level. - * @param {Object} level The new level object containing a bookmark and contents. - */ - onAdd : new Dispatcher(self), - - /** - * This event will fire when the user make an undo of a change. - * - * @event onUndo - * @param {tinymce.UndoManager} sender UndoManager instance that got the new level. - * @param {Object} level The old level object containing a bookmark and contents. - */ - onUndo : new Dispatcher(self), - - /** - * This event will fire when the user make an redo of a change. - * - * @event onRedo - * @param {tinymce.UndoManager} sender UndoManager instance that got the new level. - * @param {Object} level The old level object containing a bookmark and contents. - */ - onRedo : new Dispatcher(self), - - /** - * Stores away a bookmark to be used when performing an undo action so that the selection is before - * the change has been made. - * - * @method beforeChange - */ - beforeChange : function() { - beforeBookmark = editor.selection.getBookmark(2, true); - }, - - /** - * Adds a new undo level/snapshot to the undo list. - * - * @method add - * @param {Object} l Optional undo level object to add. - * @return {Object} Undo level that got added or null it a level wasn't needed. - */ - add : function(level) { - var i, settings = editor.settings, lastLevel; - - level = level || {}; - level.content = getContent(); - - // Add undo level if needed - lastLevel = data[index]; - if (lastLevel && lastLevel.content == level.content) - return null; - - // Set before bookmark on previous level - if (data[index]) - data[index].beforeBookmark = beforeBookmark; - - // Time to compress - if (settings.custom_undo_redo_levels) { - if (data.length > settings.custom_undo_redo_levels) { - for (i = 0; i < data.length - 1; i++) - data[i] = data[i + 1]; - - data.length--; - index = data.length; - } - } - - // Get a non intrusive normalized bookmark - level.bookmark = editor.selection.getBookmark(2, true); - - // Crop array if needed - if (index < data.length - 1) - data.length = index + 1; - - data.push(level); - index = data.length - 1; - - self.onAdd.dispatch(self, level); - editor.isNotDirty = 0; - - return level; - }, - - /** - * Undoes the last action. - * - * @method undo - * @return {Object} Undo level or null if no undo was performed. - */ - undo : function() { - var level, i; - - if (self.typing) { - self.add(); - self.typing = false; - } - - if (index > 0) { - level = data[--index]; - - editor.setContent(level.content, {format : 'raw'}); - editor.selection.moveToBookmark(level.beforeBookmark); - - self.onUndo.dispatch(self, level); - } - - return level; - }, - - /** - * Redoes the last action. - * - * @method redo - * @return {Object} Redo level or null if no redo was performed. - */ - redo : function() { - var level; - - if (index < data.length - 1) { - level = data[++index]; - - editor.setContent(level.content, {format : 'raw'}); - editor.selection.moveToBookmark(level.bookmark); - - self.onRedo.dispatch(self, level); - } - - return level; - }, - - /** - * Removes all undo levels. - * - * @method clear - */ - clear : function() { - data = []; - index = 0; - self.typing = false; - }, - - /** - * Returns true/false if the undo manager has any undo levels. - * - * @method hasUndo - * @return {Boolean} true/false if the undo manager has any undo levels. - */ - hasUndo : function() { - return index > 0 || this.typing; - }, - - /** - * Returns true/false if the undo manager has any redo levels. - * - * @method hasRedo - * @return {Boolean} true/false if the undo manager has any redo levels. - */ - hasRedo : function() { - return index < data.length - 1 && !this.typing; - } - }; - }; -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/WindowManager.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/WindowManager.js deleted file mode 100644 index e80de4e80dac..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/WindowManager.js +++ /dev/null @@ -1,231 +0,0 @@ -/** - * WindowManager.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isIE = tinymce.isIE, isOpera = tinymce.isOpera; - - /** - * This class handles the creation of native windows and dialogs. This class can be extended to provide for example inline dialogs. - * - * @class tinymce.WindowManager - * @example - * // Opens a new dialog with the file.htm file and the size 320x240 - * // It also adds a custom parameter this can be retrieved by using tinyMCEPopup.getWindowArg inside the dialog. - * tinyMCE.activeEditor.windowManager.open({ - * url : 'file.htm', - * width : 320, - * height : 240 - * }, { - * custom_param : 1 - * }); - * - * // Displays an alert box using the active editors window manager instance - * tinyMCE.activeEditor.windowManager.alert('Hello world!'); - * - * // Displays an confirm box and an alert message will be displayed depending on what you choose in the confirm - * tinyMCE.activeEditor.windowManager.confirm("Do you want to do something", function(s) { - * if (s) - * tinyMCE.activeEditor.windowManager.alert("Ok"); - * else - * tinyMCE.activeEditor.windowManager.alert("Cancel"); - * }); - */ - tinymce.create('tinymce.WindowManager', { - /** - * Constructs a new window manager instance. - * - * @constructor - * @method WindowManager - * @param {tinymce.Editor} ed Editor instance that the windows are bound to. - */ - WindowManager : function(ed) { - var t = this; - - t.editor = ed; - t.onOpen = new Dispatcher(t); - t.onClose = new Dispatcher(t); - t.params = {}; - t.features = {}; - }, - - /** - * Opens a new window. - * - * @method open - * @param {Object} s Optional name/value settings collection contains things like width/height/url etc. - * @option {String} title Window title. - * @option {String} file URL of the file to open in the window. - * @option {Number} width Width in pixels. - * @option {Number} height Height in pixels. - * @option {Boolean} resizable Specifies whether the popup window is resizable or not. - * @option {Boolean} maximizable Specifies whether the popup window has a "maximize" button and can get maximized or not. - * @option {Boolean} inline Specifies whether to display in-line (set to 1 or true for in-line display; requires inlinepopups plugin). - * @option {String/Boolean} popup_css Optional CSS to use in the popup. Set to false to remove the default one. - * @option {Boolean} translate_i18n Specifies whether translation should occur or not of i18 key strings. Default is true. - * @option {String/bool} close_previous Specifies whether a previously opened popup window is to be closed or not (like when calling the file browser window over the advlink popup). - * @option {String/bool} scrollbars Specifies whether the popup window can have scrollbars if required (i.e. content larger than the popup size specified). - * @param {Object} p Optional parameters/arguments collection can be used by the dialogs to retrieve custom parameters. - * @option {String} plugin_url url to plugin if opening plugin window that calls tinyMCEPopup.requireLangPack() and needs access to the plugin language js files - */ - open : function(s, p) { - var t = this, f = '', x, y, mo = t.editor.settings.dialog_type == 'modal', w, sw, sh, vp = tinymce.DOM.getViewPort(), u; - - // Default some options - s = s || {}; - p = p || {}; - sw = isOpera ? vp.w : screen.width; // Opera uses windows inside the Opera window - sh = isOpera ? vp.h : screen.height; - s.name = s.name || 'mc_' + new Date().getTime(); - s.width = parseInt(s.width || 320); - s.height = parseInt(s.height || 240); - s.resizable = true; - s.left = s.left || parseInt(sw / 2.0) - (s.width / 2.0); - s.top = s.top || parseInt(sh / 2.0) - (s.height / 2.0); - p.inline = false; - p.mce_width = s.width; - p.mce_height = s.height; - p.mce_auto_focus = s.auto_focus; - - if (mo) { - if (isIE) { - s.center = true; - s.help = false; - s.dialogWidth = s.width + 'px'; - s.dialogHeight = s.height + 'px'; - s.scroll = s.scrollbars || false; - } - } - - // Build features string - each(s, function(v, k) { - if (tinymce.is(v, 'boolean')) - v = v ? 'yes' : 'no'; - - if (!/^(name|url)$/.test(k)) { - if (isIE && mo) - f += (f ? ';' : '') + k + ':' + v; - else - f += (f ? ',' : '') + k + '=' + v; - } - }); - - t.features = s; - t.params = p; - t.onOpen.dispatch(t, s, p); - - u = s.url || s.file; - u = tinymce._addVer(u); - - try { - if (isIE && mo) { - w = 1; - window.showModalDialog(u, window, f); - } else - w = window.open(u, s.name, f); - } catch (ex) { - // Ignore - } - - if (!w) - alert(t.editor.getLang('popup_blocked')); - }, - - /** - * Closes the specified window. This will also dispatch out a onClose event. - * - * @method close - * @param {Window} w Native window object to close. - */ - close : function(w) { - w.close(); - this.onClose.dispatch(this); - }, - - /** - * Creates a instance of a class. This method was needed since IE can't create instances - * of classes from a parent window due to some reference problem. Any arguments passed after the class name - * will be passed as arguments to the constructor. - * - * @method createInstance - * @param {String} cl Class name to create an instance of. - * @return {Object} Instance of the specified class. - * @example - * var uri = tinyMCEPopup.editor.windowManager.createInstance('tinymce.util.URI', 'http://www.somesite.com'); - * alert(uri.getURI()); - */ - createInstance : function(cl, a, b, c, d, e) { - var f = tinymce.resolve(cl); - - return new f(a, b, c, d, e); - }, - - /** - * Creates a confirm dialog. Please don't use the blocking behavior of this - * native version use the callback method instead then it can be extended. - * - * @method confirm - * @param {String} t Title for the new confirm dialog. - * @param {function} cb Callback function to be executed after the user has selected ok or cancel. - * @param {Object} s Optional scope to execute the callback in. - * @example - * // Displays an confirm box and an alert message will be displayed depending on what you choose in the confirm - * tinyMCE.activeEditor.windowManager.confirm("Do you want to do something", function(s) { - * if (s) - * tinyMCE.activeEditor.windowManager.alert("Ok"); - * else - * tinyMCE.activeEditor.windowManager.alert("Cancel"); - * }); - */ - confirm : function(t, cb, s, w) { - w = w || window; - - cb.call(s || this, w.confirm(this._decode(this.editor.getLang(t, t)))); - }, - - /** - * Creates a alert dialog. Please don't use the blocking behavior of this - * native version use the callback method instead then it can be extended. - * - * @method alert - * @param {String} t Title for the new alert dialog. - * @param {function} cb Callback function to be executed after the user has selected ok. - * @param {Object} s Optional scope to execute the callback in. - * @example - * // Displays an alert box using the active editors window manager instance - * tinyMCE.activeEditor.windowManager.alert('Hello world!'); - */ - alert : function(tx, cb, s, w) { - var t = this; - - w = w || window; - w.alert(t._decode(t.editor.getLang(tx, tx))); - - if (cb) - cb.call(s || t); - }, - - /** - * Resizes the specified window or id. - * - * @param {Number} dw Delta width. - * @param {Number} dh Delta height. - * @param {window/id} win Window if the dialog isn't inline. Id if the dialog is inline. - */ - resizeBy : function(dw, dh, win) { - win.resizeBy(dw, dh); - }, - - // Internal functions - - _decode : function(s) { - return tinymce.DOM.decode(s).replace(/\\n/g, '\n'); - } - }); -}(tinymce)); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/adapter/jquery/adapter.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/adapter/jquery/adapter.js deleted file mode 100644 index 1fceed4f3e86..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/adapter/jquery/adapter.js +++ /dev/null @@ -1,337 +0,0 @@ -/** - * adapter.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -// #ifdef jquery_adapter - -(function($, tinymce) { - var is = tinymce.is, attrRegExp = /^(href|src|style)$/i, undefined; - - // jQuery is undefined - if (!$ && window.console) { - return console.log("Load jQuery first!"); - } - - // Stick jQuery into the tinymce namespace - tinymce.$ = $; - - // Setup adapter - tinymce.adapter = { - patchEditor : function(editor) { - var fn = $.fn; - - // Adapt the css function to make sure that the data-mce-style - // attribute gets updated with the new style information - function css(name, value) { - var self = this; - - // Remove data-mce-style when set operation occurs - if (value) - self.removeAttr('data-mce-style'); - - return fn.css.apply(self, arguments); - }; - - // Apapt the attr function to make sure that it uses the data-mce- prefixed variants - function attr(name, value) { - var self = this; - - // Update/retrieve data-mce- attribute variants - if (attrRegExp.test(name)) { - if (value !== undefined) { - // Use TinyMCE behavior when setting the specifc attributes - self.each(function(i, node) { - editor.dom.setAttrib(node, name, value); - }); - - return self; - } else - return self.attr('data-mce-' + name); - } - - // Default behavior - return fn.attr.apply(self, arguments); - }; - - function htmlPatchFunc(func) { - // Returns a modified function that processes - // the HTML before executing the action this makes sure - // that href/src etc gets moved into the data-mce- variants - return function(content) { - if (content) - content = editor.dom.processHTML(content); - - return func.call(this, content); - }; - }; - - // Patch various jQuery functions to handle tinymce specific attribute and content behavior - // we don't patch the jQuery.fn directly since it will most likely break compatibility - // with other jQuery logic on the page. Only instances created by TinyMCE should be patched. - function patch(jq) { - // Patch some functions, only patch the object once - if (jq.css !== css) { - // Patch css/attr to use the data-mce- prefixed attribute variants - jq.css = css; - jq.attr = attr; - - // Patch HTML functions to use the DOMUtils.processHTML filter logic - jq.html = htmlPatchFunc(fn.html); - jq.append = htmlPatchFunc(fn.append); - jq.prepend = htmlPatchFunc(fn.prepend); - jq.after = htmlPatchFunc(fn.after); - jq.before = htmlPatchFunc(fn.before); - jq.replaceWith = htmlPatchFunc(fn.replaceWith); - jq.tinymce = editor; - - // Each pushed jQuery instance needs to be patched - // as well for example when traversing the DOM - jq.pushStack = function() { - return patch(fn.pushStack.apply(this, arguments)); - }; - } - - return jq; - }; - - // Add a $ function on each editor instance this one is scoped for the editor document object - // this way you can do chaining like this tinymce.get(0).$('p').append('text').css('color', 'red'); - editor.$ = function(selector, scope) { - var doc = editor.getDoc(); - - return patch($(selector || doc, doc || scope)); - }; - } - }; - - // Patch in core NS functions - tinymce.extend = $.extend; - tinymce.extend(tinymce, { - map : $.map, - grep : function(a, f) {return $.grep(a, f || function(){return 1;});}, - inArray : function(a, v) {return $.inArray(v, a || []);} - - /* Didn't iterate stylesheets - each : function(o, cb, s) { - if (!o) - return 0; - - var r = 1; - - $.each(o, function(nr, el){ - if (cb.call(s, el, nr, o) === false) { - r = 0; - return false; - } - }); - - return r; - }*/ - }); - - // Patch in functions in various clases - // Add a "#ifndefjquery" statement around each core API function you add below - var patches = { - 'tinymce.dom.DOMUtils' : { - /* - addClass : function(e, c) { - if (is(e, 'array') && is(e[0], 'string')) - e = e.join(',#'); - return (e && $(is(e, 'string') ? '#' + e : e) - .addClass(c) - .attr('class')) || false; - }, - - hasClass : function(n, c) { - return $(is(n, 'string') ? '#' + n : n).hasClass(c); - }, - - removeClass : function(e, c) { - if (!e) - return false; - - var r = []; - - $(is(e, 'string') ? '#' + e : e) - .removeClass(c) - .each(function(){ - r.push(this.className); - }); - - return r.length == 1 ? r[0] : r; - }, - */ - - select : function(pattern, scope) { - var t = this; - - return $.find(pattern, t.get(scope) || t.get(t.settings.root_element) || t.doc, []); - }, - - is : function(n, patt) { - return $(this.get(n)).is(patt); - } - - /* - show : function(e) { - if (is(e, 'array') && is(e[0], 'string')) - e = e.join(',#'); - - $(is(e, 'string') ? '#' + e : e).css('display', 'block'); - }, - - hide : function(e) { - if (is(e, 'array') && is(e[0], 'string')) - e = e.join(',#'); - - $(is(e, 'string') ? '#' + e : e).css('display', 'none'); - }, - - isHidden : function(e) { - return $(is(e, 'string') ? '#' + e : e).is(':hidden'); - }, - - insertAfter : function(n, e) { - return $(is(e, 'string') ? '#' + e : e).after(n); - }, - - replace : function(o, n, k) { - n = $(is(n, 'string') ? '#' + n : n); - - if (k) - n.children().appendTo(o); - - n.replaceWith(o); - }, - - setStyle : function(n, na, v) { - if (is(n, 'array') && is(n[0], 'string')) - n = n.join(',#'); - - $(is(n, 'string') ? '#' + n : n).css(na, v); - }, - - getStyle : function(n, na, c) { - return $(is(n, 'string') ? '#' + n : n).css(na); - }, - - setStyles : function(e, o) { - if (is(e, 'array') && is(e[0], 'string')) - e = e.join(',#'); - $(is(e, 'string') ? '#' + e : e).css(o); - }, - - setAttrib : function(e, n, v) { - var t = this, s = t.settings; - - if (is(e, 'array') && is(e[0], 'string')) - e = e.join(',#'); - - e = $(is(e, 'string') ? '#' + e : e); - - switch (n) { - case "style": - e.each(function(i, v){ - if (s.keep_values) - $(v).attr('data-mce-style', v); - - v.style.cssText = v; - }); - break; - - case "class": - e.each(function(){ - this.className = v; - }); - break; - - case "src": - case "href": - e.each(function(i, v){ - if (s.keep_values) { - if (s.url_converter) - v = s.url_converter.call(s.url_converter_scope || t, v, n, v); - - t.setAttrib(v, 'data-mce-' + n, v); - } - }); - - break; - } - - if (v !== null && v.length !== 0) - e.attr(n, '' + v); - else - e.removeAttr(n); - }, - - setAttribs : function(e, o) { - var t = this; - - $.each(o, function(n, v){ - t.setAttrib(e,n,v); - }); - } - */ - } - -/* - 'tinymce.dom.Event' : { - add : function (o, n, f, s) { - var lo, cb; - - cb = function(e) { - e.target = e.target || this; - f.call(s || this, e); - }; - - if (is(o, 'array') && is(o[0], 'string')) - o = o.join(',#'); - o = $(is(o, 'string') ? '#' + o : o); - if (n == 'init') { - o.ready(cb, s); - } else { - if (s) { - o.bind(n, s, cb); - } else { - o.bind(n, cb); - } - } - - lo = this._jqLookup || (this._jqLookup = []); - lo.push({func : f, cfunc : cb}); - - return cb; - }, - - remove : function(o, n, f) { - // Find cfunc - $(this._jqLookup).each(function() { - if (this.func === f) - f = this.cfunc; - }); - - if (is(o, 'array') && is(o[0], 'string')) - o = o.join(',#'); - - $(is(o, 'string') ? '#' + o : o).unbind(n,f); - - return true; - } - } -*/ - }; - - // Patch functions after a class is created - tinymce.onCreate = function(ty, c, p) { - tinymce.extend(p, patches[c]); - }; -})(window.jQuery, tinymce); - -// #endif diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/adapter/jquery/jquery.tinymce.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/adapter/jquery/jquery.tinymce.js deleted file mode 100644 index 4187dc28f991..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/adapter/jquery/jquery.tinymce.js +++ /dev/null @@ -1,336 +0,0 @@ -/** - * jquery.tinymce.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function($) { - var undefined, - lazyLoading, - delayedInits = [], - win = window; - - $.fn.tinymce = function(settings) { - var self = this, url, ed, base, pos, lang, query = "", suffix = ""; - - // No match then just ignore the call - if (!self.length) - return self; - - // Get editor instance - if (!settings) - return tinyMCE.get(self[0].id); - - self.css('visibility', 'hidden'); // Hide textarea to avoid flicker - - function init() { - var editors = [], initCount = 0; - - // Apply patches to the jQuery object, only once - if (applyPatch) { - applyPatch(); - applyPatch = null; - } - - // Create an editor instance for each matched node - self.each(function(i, node) { - var ed, id = node.id, oninit = settings.oninit; - - // Generate unique id for target element if needed - if (!id) - node.id = id = tinymce.DOM.uniqueId(); - - // Create editor instance and render it - ed = new tinymce.Editor(id, settings); - editors.push(ed); - - ed.onInit.add(function() { - var scope, func = oninit; - - self.css('visibility', ''); - - // Run this if the oninit setting is defined - // this logic will fire the oninit callback ones each - // matched editor instance is initialized - if (oninit) { - // Fire the oninit event ones each editor instance is initialized - if (++initCount == editors.length) { - if (tinymce.is(func, "string")) { - scope = (func.indexOf(".") === -1) ? null : tinymce.resolve(func.replace(/\.\w+$/, "")); - func = tinymce.resolve(func); - } - - // Call the oninit function with the object - func.apply(scope || tinymce, editors); - } - } - }); - }); - - // Render the editor instances in a separate loop since we - // need to have the full editors array used in the onInit calls - $.each(editors, function(i, ed) { - ed.render(); - }); - } - - // Load TinyMCE on demand, if we need to - if (!win["tinymce"] && !lazyLoading && (url = settings.script_url)) { - lazyLoading = 1; - base = url.substring(0, url.lastIndexOf("/")); - - // Check if it's a dev/src version they want to load then - // make sure that all plugins, themes etc are loaded in source mode aswell - if (/_(src|dev)\.js/g.test(url)) - suffix = "_src"; - - // Parse out query part, this will be appended to all scripts, css etc to clear browser cache - pos = url.lastIndexOf("?"); - if (pos != -1) - query = url.substring(pos + 1); - - // Setup tinyMCEPreInit object this will later be used by the TinyMCE - // core script to locate other resources like CSS files, dialogs etc - // You can also predefined a tinyMCEPreInit object and then it will use that instead - win.tinyMCEPreInit = win.tinyMCEPreInit || { - base : base, - suffix : suffix, - query : query - }; - - // url contains gzip then we assume it's a compressor - if (url.indexOf('gzip') != -1) { - lang = settings.language || "en"; - url = url + (/\?/.test(url) ? '&' : '?') + "js=true&core=true&suffix=" + escape(suffix) + "&themes=" + escape(settings.theme) + "&plugins=" + escape(settings.plugins) + "&languages=" + lang; - - // Check if compressor script is already loaded otherwise setup a basic one - if (!win["tinyMCE_GZ"]) { - tinyMCE_GZ = { - start : function() { - tinymce.suffix = suffix; - - function load(url) { - tinymce.ScriptLoader.markDone(tinyMCE.baseURI.toAbsolute(url)); - } - - // Add core languages - load("langs/" + lang + ".js"); - - // Add themes with languages - load("themes/" + settings.theme + "/editor_template" + suffix + ".js"); - load("themes/" + settings.theme + "/langs/" + lang + ".js"); - - // Add plugins with languages - $.each(settings.plugins.split(","), function(i, name) { - if (name) { - load("plugins/" + name + "/editor_plugin" + suffix + ".js"); - load("plugins/" + name + "/langs/" + lang + ".js"); - } - }); - }, - - end : function() { - } - } - } - } - - // Load the script cached and execute the inits once it's done - $.ajax({ - type : "GET", - url : url, - dataType : "script", - cache : true, - success : function() { - tinymce.dom.Event.domLoaded = 1; - lazyLoading = 2; - - // Execute callback after mainscript has been loaded and before the initialization occurs - if (settings.script_loaded) - settings.script_loaded(); - - init(); - - $.each(delayedInits, function(i, init) { - init(); - }); - } - }); - } else { - // Delay the init call until tinymce is loaded - if (lazyLoading === 1) - delayedInits.push(init); - else - init(); - } - - return self; - }; - - // Add :tinymce psuedo selector this will select elements that has been converted into editor instances - // it's now possible to use things like $('*:tinymce') to get all TinyMCE bound elements. - $.extend($.expr[":"], { - tinymce : function(e) { - return e.id && !!tinyMCE.get(e.id); - } - }); - - // This function patches internal jQuery functions so that if - // you for example remove an div element containing an editor it's - // automatically destroyed by the TinyMCE API - function applyPatch() { - // Removes any child editor instances by looking for editor wrapper elements - function removeEditors(name) { - // If the function is remove - if (name === "remove") { - this.each(function(i, node) { - var ed = tinyMCEInstance(node); - - if (ed) - ed.remove(); - }); - } - - this.find("span.mceEditor,div.mceEditor").each(function(i, node) { - var ed = tinyMCE.get(node.id.replace(/_parent$/, "")); - - if (ed) - ed.remove(); - }); - } - - // Loads or saves contents from/to textarea if the value - // argument is defined it will set the TinyMCE internal contents - function loadOrSave(value) { - var self = this, ed; - - // Handle set value - if (value !== undefined) { - removeEditors.call(self); - - // Saves the contents before get/set value of textarea/div - self.each(function(i, node) { - var ed; - - if (ed = tinyMCE.get(node.id)) - ed.setContent(value); - }); - } else if (self.length > 0) { - // Handle get value - if (ed = tinyMCE.get(self[0].id)) - return ed.getContent(); - } - } - - // Returns tinymce instance for the specified element or null if it wasn't found - function tinyMCEInstance(element) { - var ed = null; - - (element) && (element.id) && (win["tinymce"]) && (ed = tinyMCE.get(element.id)); - - return ed; - } - - // Checks if the specified set contains tinymce instances - function containsTinyMCE(matchedSet) { - return !!((matchedSet) && (matchedSet.length) && (win["tinymce"]) && (matchedSet.is(":tinymce"))); - } - - // Patch various jQuery functions - var jQueryFn = {}; - - // Patch some setter/getter functions these will - // now be able to set/get the contents of editor instances for - // example $('#editorid').html('Content'); will update the TinyMCE iframe instance - $.each(["text", "html", "val"], function(i, name) { - var origFn = jQueryFn[name] = $.fn[name], - textProc = (name === "text"); - - $.fn[name] = function(value) { - var self = this; - - if (!containsTinyMCE(self)) - return origFn.apply(self, arguments); - - if (value !== undefined) { - loadOrSave.call(self.filter(":tinymce"), value); - origFn.apply(self.not(":tinymce"), arguments); - - return self; // return original set for chaining - } else { - var ret = ""; - var args = arguments; - - (textProc ? self : self.eq(0)).each(function(i, node) { - var ed = tinyMCEInstance(node); - - ret += ed ? (textProc ? ed.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g, "") : ed.getContent()) : origFn.apply($(node), args); - }); - - return ret; - } - }; - }); - - // Makes it possible to use $('#id').append("content"); to append contents to the TinyMCE editor iframe - $.each(["append", "prepend"], function(i, name) { - var origFn = jQueryFn[name] = $.fn[name], - prepend = (name === "prepend"); - - $.fn[name] = function(value) { - var self = this; - - if (!containsTinyMCE(self)) - return origFn.apply(self, arguments); - - if (value !== undefined) { - self.filter(":tinymce").each(function(i, node) { - var ed = tinyMCEInstance(node); - - ed && ed.setContent(prepend ? value + ed.getContent() : ed.getContent() + value); - }); - - origFn.apply(self.not(":tinymce"), arguments); - - return self; // return original set for chaining - } - }; - }); - - // Makes sure that the editor instance gets properly destroyed when the parent element is removed - $.each(["remove", "replaceWith", "replaceAll", "empty"], function(i, name) { - var origFn = jQueryFn[name] = $.fn[name]; - - $.fn[name] = function() { - removeEditors.call(this, name); - - return origFn.apply(this, arguments); - }; - }); - - jQueryFn.attr = $.fn.attr; - - // Makes sure that $('#tinymce_id').attr('value') gets the editors current HTML contents - $.fn.attr = function(name, value, type) { - var self = this; - - if ((!name) || (name !== "value") || (!containsTinyMCE(self))) - return jQueryFn.attr.call(self, name, value, type); - - if (value !== undefined) { - loadOrSave.call(self.filter(":tinymce"), value); - jQueryFn.attr.call(self.not(":tinymce"), name, value, type); - - return self; // return original set for chaining - } else { - var node = self[0], ed = tinyMCEInstance(node); - - return ed ? ed.getContent() : jQueryFn.attr.call($(node), name, value, type); - } - }; - } -})(jQuery); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/adapter/prototype/adapter.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/adapter/prototype/adapter.js deleted file mode 100644 index d7c08ab387dd..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/adapter/prototype/adapter.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * adapter.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -// #ifdef prototype_adapter - -(function() { - if (!window.Prototype) - return alert("Load prototype first!"); - - // Patch in core NS functions - tinymce.extend(tinymce, { - trim : function(s) {return s ? s.strip() : '';}, - inArray : function(a, v) {return a && a.indexOf ? a.indexOf(v) : -1;} - }); - - // Patch in functions in various clases - // Add a "#ifndefjquery" statement around each core API function you add below - var patches = { - 'tinymce.util.JSON' : { - /*serialize : function(o) { - return o.toJSON(); - }*/ - }, - }; - - // Patch functions after a class is created - tinymce.onCreate = function(ty, c, p) { - tinymce.extend(p, patches[c]); - }; -})(); - -// #endif diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/DOMUtils.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/DOMUtils.js deleted file mode 100644 index eb8b4b7ab5d7..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/DOMUtils.js +++ /dev/null @@ -1,1876 +0,0 @@ -/** - * DOMUtils.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - // Shorten names - var each = tinymce.each, - is = tinymce.is, - isWebKit = tinymce.isWebKit, - isIE = tinymce.isIE, - Entities = tinymce.html.Entities, - simpleSelectorRe = /^([a-z0-9],?)+$/i, - blockElementsMap = tinymce.html.Schema.blockElementsMap, - whiteSpaceRegExp = /^[ \t\r\n]*$/; - - /** - * Utility class for various DOM manipulation and retrival functions. - * - * @class tinymce.dom.DOMUtils - * @example - * // Add a class to an element by id in the page - * tinymce.DOM.addClass('someid', 'someclass'); - * - * // Add a class to an element by id inside the editor - * tinyMCE.activeEditor.dom.addClass('someid', 'someclass'); - */ - tinymce.create('tinymce.dom.DOMUtils', { - doc : null, - root : null, - files : null, - pixelStyles : /^(top|left|bottom|right|width|height|borderWidth)$/, - props : { - "for" : "htmlFor", - "class" : "className", - className : "className", - checked : "checked", - disabled : "disabled", - maxlength : "maxLength", - readonly : "readOnly", - selected : "selected", - value : "value", - id : "id", - name : "name", - type : "type" - }, - - /** - * Constructs a new DOMUtils instance. Consult the Wiki for more details on settings etc for this class. - * - * @constructor - * @method DOMUtils - * @param {Document} d Document reference to bind the utility class to. - * @param {settings} s Optional settings collection. - */ - DOMUtils : function(d, s) { - var t = this, globalStyle, name; - - t.doc = d; - t.win = window; - t.files = {}; - t.cssFlicker = false; - t.counter = 0; - t.stdMode = !tinymce.isIE || d.documentMode >= 8; - t.boxModel = !tinymce.isIE || d.compatMode == "CSS1Compat" || t.stdMode; - t.hasOuterHTML = "outerHTML" in d.createElement("a"); - - t.settings = s = tinymce.extend({ - keep_values : false, - hex_colors : 1 - }, s); - - t.schema = s.schema; - t.styles = new tinymce.html.Styles({ - url_converter : s.url_converter, - url_converter_scope : s.url_converter_scope - }, s.schema); - - // Fix IE6SP2 flicker and check it failed for pre SP2 - if (tinymce.isIE6) { - try { - d.execCommand('BackgroundImageCache', false, true); - } catch (e) { - t.cssFlicker = true; - } - } - - if (isIE && s.schema) { - // Add missing HTML 4/5 elements to IE - ('abbr article aside audio canvas ' + - 'details figcaption figure footer ' + - 'header hgroup mark menu meter nav ' + - 'output progress section summary ' + - 'time video').replace(/\w+/g, function(name) { - d.createElement(name); - }); - - // Create all custom elements - for (name in s.schema.getCustomElements()) { - d.createElement(name); - } - } - - tinymce.addUnload(t.destroy, t); - }, - - /** - * Returns the root node of the document this is normally the body but might be a DIV. Parents like getParent will not - * go above the point of this root node. - * - * @method getRoot - * @return {Element} Root element for the utility class. - */ - getRoot : function() { - var t = this, s = t.settings; - - return (s && t.get(s.root_element)) || t.doc.body; - }, - - /** - * Returns the viewport of the window. - * - * @method getViewPort - * @param {Window} w Optional window to get viewport of. - * @return {Object} Viewport object with fields x, y, w and h. - */ - getViewPort : function(w) { - var d, b; - - w = !w ? this.win : w; - d = w.document; - b = this.boxModel ? d.documentElement : d.body; - - // Returns viewport size excluding scrollbars - return { - x : w.pageXOffset || b.scrollLeft, - y : w.pageYOffset || b.scrollTop, - w : w.innerWidth || b.clientWidth, - h : w.innerHeight || b.clientHeight - }; - }, - - /** - * Returns the rectangle for a specific element. - * - * @method getRect - * @param {Element/String} e Element object or element ID to get rectange from. - * @return {object} Rectange for specified element object with x, y, w, h fields. - */ - getRect : function(e) { - var p, t = this, sr; - - e = t.get(e); - p = t.getPos(e); - sr = t.getSize(e); - - return { - x : p.x, - y : p.y, - w : sr.w, - h : sr.h - }; - }, - - /** - * Returns the size dimensions of the specified element. - * - * @method getSize - * @param {Element/String} e Element object or element ID to get rectange from. - * @return {object} Rectange for specified element object with w, h fields. - */ - getSize : function(e) { - var t = this, w, h; - - e = t.get(e); - w = t.getStyle(e, 'width'); - h = t.getStyle(e, 'height'); - - // Non pixel value, then force offset/clientWidth - if (w.indexOf('px') === -1) - w = 0; - - // Non pixel value, then force offset/clientWidth - if (h.indexOf('px') === -1) - h = 0; - - return { - w : parseInt(w) || e.offsetWidth || e.clientWidth, - h : parseInt(h) || e.offsetHeight || e.clientHeight - }; - }, - - /** - * Returns a node by the specified selector function. This function will - * loop through all parent nodes and call the specified function for each node. - * If the function then returns true indicating that it has found what it was looking for, the loop execution will then end - * and the node it found will be returned. - * - * @method getParent - * @param {Node/String} n DOM node to search parents on or ID string. - * @param {function} f Selection function to execute on each node or CSS pattern. - * @param {Node} r Optional root element, never go below this point. - * @return {Node} DOM Node or null if it wasn't found. - */ - getParent : function(n, f, r) { - return this.getParents(n, f, r, false); - }, - - /** - * Returns a node list of all parents matching the specified selector function or pattern. - * If the function then returns true indicating that it has found what it was looking for and that node will be collected. - * - * @method getParents - * @param {Node/String} n DOM node to search parents on or ID string. - * @param {function} f Selection function to execute on each node or CSS pattern. - * @param {Node} r Optional root element, never go below this point. - * @return {Array} Array of nodes or null if it wasn't found. - */ - getParents : function(n, f, r, c) { - var t = this, na, se = t.settings, o = []; - - n = t.get(n); - c = c === undefined; - - if (se.strict_root) - r = r || t.getRoot(); - - // Wrap node name as func - if (is(f, 'string')) { - na = f; - - if (f === '*') { - f = function(n) {return n.nodeType == 1;}; - } else { - f = function(n) { - return t.is(n, na); - }; - } - } - - while (n) { - if (n == r || !n.nodeType || n.nodeType === 9) - break; - - if (!f || f(n)) { - if (c) - o.push(n); - else - return n; - } - - n = n.parentNode; - } - - return c ? o : null; - }, - - /** - * Returns the specified element by ID or the input element if it isn't a string. - * - * @method get - * @param {String/Element} n Element id to look for or element to just pass though. - * @return {Element} Element matching the specified id or null if it wasn't found. - */ - get : function(e) { - var n; - - if (e && this.doc && typeof(e) == 'string') { - n = e; - e = this.doc.getElementById(e); - - // IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick - if (e && e.id !== n) - return this.doc.getElementsByName(n)[1]; - } - - return e; - }, - - /** - * Returns the next node that matches selector or function - * - * @method getNext - * @param {Node} node Node to find siblings from. - * @param {String/function} selector Selector CSS expression or function. - * @return {Node} Next node item matching the selector or null if it wasn't found. - */ - getNext : function(node, selector) { - return this._findSib(node, selector, 'nextSibling'); - }, - - /** - * Returns the previous node that matches selector or function - * - * @method getPrev - * @param {Node} node Node to find siblings from. - * @param {String/function} selector Selector CSS expression or function. - * @return {Node} Previous node item matching the selector or null if it wasn't found. - */ - getPrev : function(node, selector) { - return this._findSib(node, selector, 'previousSibling'); - }, - - // #ifndef jquery - - /** - * Selects specific elements by a CSS level 3 pattern. For example "div#a1 p.test". - * This function is optimized for the most common patterns needed in TinyMCE but it also performes good enough - * on more complex patterns. - * - * @method select - * @param {String} p CSS level 1 pattern to select/find elements by. - * @param {Object} s Optional root element/scope element to search in. - * @return {Array} Array with all matched elements. - * @example - * // Adds a class to all paragraphs in the currently active editor - * tinyMCE.activeEditor.dom.addClass(tinyMCE.activeEditor.dom.select('p'), 'someclass'); - * - * // Adds a class to all spans that has the test class in the currently active editor - * tinyMCE.activeEditor.dom.addClass(tinyMCE.activeEditor.dom.select('span.test'), 'someclass') - */ - select : function(pa, s) { - var t = this; - - return tinymce.dom.Sizzle(pa, t.get(s) || t.get(t.settings.root_element) || t.doc, []); - }, - - /** - * Returns true/false if the specified element matches the specified css pattern. - * - * @method is - * @param {Node/NodeList} n DOM node to match or an array of nodes to match. - * @param {String} selector CSS pattern to match the element agains. - */ - is : function(n, selector) { - var i; - - // If it isn't an array then try to do some simple selectors instead of Sizzle for to boost performance - if (n.length === undefined) { - // Simple all selector - if (selector === '*') - return n.nodeType == 1; - - // Simple selector just elements - if (simpleSelectorRe.test(selector)) { - selector = selector.toLowerCase().split(/,/); - n = n.nodeName.toLowerCase(); - - for (i = selector.length - 1; i >= 0; i--) { - if (selector[i] == n) - return true; - } - - return false; - } - } - - return tinymce.dom.Sizzle.matches(selector, n.nodeType ? [n] : n).length > 0; - }, - - // #endif - - /** - * Adds the specified element to another element or elements. - * - * @method add - * @param {String/Element/Array} Element id string, DOM node element or array of id's or elements to add to. - * @param {String/Element} n Name of new element to add or existing element to add. - * @param {Object} a Optional object collection with arguments to add to the new element(s). - * @param {String} h Optional inner HTML contents to add for each element. - * @param {Boolean} c Optional internal state to indicate if it should create or add. - * @return {Element/Array} Element that got created or array with elements if multiple elements where passed. - * @example - * // Adds a new paragraph to the end of the active editor - * tinyMCE.activeEditor.dom.add(tinyMCE.activeEditor.getBody(), 'p', {title : 'my title'}, 'Some content'); - */ - add : function(p, n, a, h, c) { - var t = this; - - return this.run(p, function(p) { - var e, k; - - e = is(n, 'string') ? t.doc.createElement(n) : n; - t.setAttribs(e, a); - - if (h) { - if (h.nodeType) - e.appendChild(h); - else - t.setHTML(e, h); - } - - return !c ? p.appendChild(e) : e; - }); - }, - - /** - * Creates a new element. - * - * @method create - * @param {String} n Name of new element. - * @param {Object} a Optional object name/value collection with element attributes. - * @param {String} h Optional HTML string to set as inner HTML of the element. - * @return {Element} HTML DOM node element that got created. - * @example - * // Adds an element where the caret/selection is in the active editor - * var el = tinyMCE.activeEditor.dom.create('div', {id : 'test', 'class' : 'myclass'}, 'some content'); - * tinyMCE.activeEditor.selection.setNode(el); - */ - create : function(n, a, h) { - return this.add(this.doc.createElement(n), n, a, h, 1); - }, - - /** - * Create HTML string for element. The element will be closed unless an empty inner HTML string is passed. - * - * @method createHTML - * @param {String} n Name of new element. - * @param {Object} a Optional object name/value collection with element attributes. - * @param {String} h Optional HTML string to set as inner HTML of the element. - * @return {String} String with new HTML element like for example: <a href="#">test</a>. - * @example - * // Creates a html chunk and inserts it at the current selection/caret location - * tinyMCE.activeEditor.selection.setContent(tinyMCE.activeEditor.dom.createHTML('a', {href : 'test.html'}, 'some line')); - */ - createHTML : function(n, a, h) { - var o = '', t = this, k; - - o += '<' + n; - - for (k in a) { - if (a.hasOwnProperty(k)) - o += ' ' + k + '="' + t.encode(a[k]) + '"'; - } - - // A call to tinymce.is doesn't work for some odd reason on IE9 possible bug inside their JS runtime - if (typeof(h) != "undefined") - return o + '>' + h + '</' + n + '>'; - - return o + ' />'; - }, - - /** - * Removes/deletes the specified element(s) from the DOM. - * - * @method remove - * @param {String/Element/Array} node ID of element or DOM element object or array containing multiple elements/ids. - * @param {Boolean} keep_children Optional state to keep children or not. If set to true all children will be placed at the location of the removed element. - * @return {Element/Array} HTML DOM element that got removed or array of elements depending on input. - * @example - * // Removes all paragraphs in the active editor - * tinyMCE.activeEditor.dom.remove(tinyMCE.activeEditor.dom.select('p')); - * - * // Removes a element by id in the document - * tinyMCE.DOM.remove('mydiv'); - */ - remove : function(node, keep_children) { - return this.run(node, function(node) { - var child, parent = node.parentNode; - - if (!parent) - return null; - - if (keep_children) { - while (child = node.firstChild) { - // IE 8 will crash if you don't remove completely empty text nodes - if (!tinymce.isIE || child.nodeType !== 3 || child.nodeValue) - parent.insertBefore(child, node); - else - node.removeChild(child); - } - } - - return parent.removeChild(node); - }); - }, - - /** - * Sets the CSS style value on a HTML element. The name can be a camelcase string - * or the CSS style name like background-color. - * - * @method setStyle - * @param {String/Element/Array} n HTML element/Element ID or Array of elements/ids to set CSS style value on. - * @param {String} na Name of the style value to set. - * @param {String} v Value to set on the style. - * @example - * // Sets a style value on all paragraphs in the currently active editor - * tinyMCE.activeEditor.dom.setStyle(tinyMCE.activeEditor.dom.select('p'), 'background-color', 'red'); - * - * // Sets a style value to an element by id in the current document - * tinyMCE.DOM.setStyle('mydiv', 'background-color', 'red'); - */ - setStyle : function(n, na, v) { - var t = this; - - return t.run(n, function(e) { - var s, i; - - s = e.style; - - // Camelcase it, if needed - na = na.replace(/-(\D)/g, function(a, b){ - return b.toUpperCase(); - }); - - // Default px suffix on these - if (t.pixelStyles.test(na) && (tinymce.is(v, 'number') || /^[\-0-9\.]+$/.test(v))) - v += 'px'; - - switch (na) { - case 'opacity': - // IE specific opacity - if (isIE) { - s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")"; - - if (!n.currentStyle || !n.currentStyle.hasLayout) - s.display = 'inline-block'; - } - - // Fix for older browsers - s[na] = s['-moz-opacity'] = s['-khtml-opacity'] = v || ''; - break; - - case 'float': - isIE ? s.styleFloat = v : s.cssFloat = v; - break; - - default: - s[na] = v || ''; - } - - // Force update of the style data - if (t.settings.update_styles) - t.setAttrib(e, 'data-mce-style'); - }); - }, - - /** - * Returns the current style or runtime/computed value of a element. - * - * @method getStyle - * @param {String/Element} n HTML element or element id string to get style from. - * @param {String} na Style name to return. - * @param {Boolean} c Computed style. - * @return {String} Current style or computed style value of a element. - */ - getStyle : function(n, na, c) { - n = this.get(n); - - if (!n) - return; - - // Gecko - if (this.doc.defaultView && c) { - // Remove camelcase - na = na.replace(/[A-Z]/g, function(a){ - return '-' + a; - }); - - try { - return this.doc.defaultView.getComputedStyle(n, null).getPropertyValue(na); - } catch (ex) { - // Old safari might fail - return null; - } - } - - // Camelcase it, if needed - na = na.replace(/-(\D)/g, function(a, b){ - return b.toUpperCase(); - }); - - if (na == 'float') - na = isIE ? 'styleFloat' : 'cssFloat'; - - // IE & Opera - if (n.currentStyle && c) - return n.currentStyle[na]; - - return n.style ? n.style[na] : undefined; - }, - - /** - * Sets multiple styles on the specified element(s). - * - * @method setStyles - * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set styles on. - * @param {Object} o Name/Value collection of style items to add to the element(s). - * @example - * // Sets styles on all paragraphs in the currently active editor - * tinyMCE.activeEditor.dom.setStyles(tinyMCE.activeEditor.dom.select('p'), {'background-color' : 'red', 'color' : 'green'}); - * - * // Sets styles to an element by id in the current document - * tinyMCE.DOM.setStyles('mydiv', {'background-color' : 'red', 'color' : 'green'}); - */ - setStyles : function(e, o) { - var t = this, s = t.settings, ol; - - ol = s.update_styles; - s.update_styles = 0; - - each(o, function(v, n) { - t.setStyle(e, n, v); - }); - - // Update style info - s.update_styles = ol; - if (s.update_styles) - t.setAttrib(e, s.cssText); - }, - - /** - * Removes all attributes from an element or elements. - * - * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to remove attributes from. - */ - removeAllAttribs: function(e) { - return this.run(e, function(e) { - var i, attrs = e.attributes; - for (i = attrs.length - 1; i >= 0; i--) { - e.removeAttributeNode(attrs.item(i)); - } - }); - }, - - /** - * Sets the specified attributes value of a element or elements. - * - * @method setAttrib - * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set attribute on. - * @param {String} n Name of attribute to set. - * @param {String} v Value to set on the attribute of this value is falsy like null 0 or '' it will remove the attribute instead. - * @example - * // Sets an attribute to all paragraphs in the active editor - * tinyMCE.activeEditor.dom.setAttrib(tinyMCE.activeEditor.dom.select('p'), 'class', 'myclass'); - * - * // Sets an attribute to a specific element in the current page - * tinyMCE.dom.setAttrib('mydiv', 'class', 'myclass'); - */ - setAttrib : function(e, n, v) { - var t = this; - - // Whats the point - if (!e || !n) - return; - - // Strict XML mode - if (t.settings.strict) - n = n.toLowerCase(); - - return this.run(e, function(e) { - var s = t.settings; - if (v !== null) { - switch (n) { - case "style": - if (!is(v, 'string')) { - each(v, function(v, n) { - t.setStyle(e, n, v); - }); - - return; - } - - // No mce_style for elements with these since they might get resized by the user - if (s.keep_values) { - if (v && !t._isRes(v)) - e.setAttribute('data-mce-style', v, 2); - else - e.removeAttribute('data-mce-style', 2); - } - - e.style.cssText = v; - break; - - case "class": - e.className = v || ''; // Fix IE null bug - break; - - case "src": - case "href": - if (s.keep_values) { - if (s.url_converter) - v = s.url_converter.call(s.url_converter_scope || t, v, n, e); - - t.setAttrib(e, 'data-mce-' + n, v, 2); - } - - break; - - case "shape": - e.setAttribute('data-mce-style', v); - break; - } - } - if (is(v) && v !== null && v.length !== 0) - e.setAttribute(n, '' + v, 2); - else - e.removeAttribute(n, 2); - }); - }, - - /** - * Sets the specified attributes of a element or elements. - * - * @method setAttribs - * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set attributes on. - * @param {Object} o Name/Value collection of attribute items to add to the element(s). - * @example - * // Sets some attributes to all paragraphs in the active editor - * tinyMCE.activeEditor.dom.setAttribs(tinyMCE.activeEditor.dom.select('p'), {'class' : 'myclass', title : 'some title'}); - * - * // Sets some attributes to a specific element in the current page - * tinyMCE.DOM.setAttribs('mydiv', {'class' : 'myclass', title : 'some title'}); - */ - setAttribs : function(e, o) { - var t = this; - - return this.run(e, function(e) { - each(o, function(v, n) { - t.setAttrib(e, n, v); - }); - }); - }, - - /** - * Returns the specified attribute by name. - * - * @method getAttrib - * @param {String/Element} e Element string id or DOM element to get attribute from. - * @param {String} n Name of attribute to get. - * @param {String} dv Optional default value to return if the attribute didn't exist. - * @return {String} Attribute value string, default value or null if the attribute wasn't found. - */ - getAttrib : function(e, n, dv) { - var v, t = this, undef; - - e = t.get(e); - - if (!e || e.nodeType !== 1) - return dv === undef ? false : dv; - - if (!is(dv)) - dv = ''; - - // Try the mce variant for these - if (/^(src|href|style|coords|shape)$/.test(n)) { - v = e.getAttribute("data-mce-" + n); - - if (v) - return v; - } - - if (isIE && t.props[n]) { - v = e[t.props[n]]; - v = v && v.nodeValue ? v.nodeValue : v; - } - - if (!v) - v = e.getAttribute(n, 2); - - // Check boolean attribs - if (/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(n)) { - if (e[t.props[n]] === true && v === '') - return n; - - return v ? n : ''; - } - - // Inner input elements will override attributes on form elements - if (e.nodeName === "FORM" && e.getAttributeNode(n)) - return e.getAttributeNode(n).nodeValue; - - if (n === 'style') { - v = v || e.style.cssText; - - if (v) { - v = t.serializeStyle(t.parseStyle(v), e.nodeName); - - if (t.settings.keep_values && !t._isRes(v)) - e.setAttribute('data-mce-style', v); - } - } - - // Remove Apple and WebKit stuff - if (isWebKit && n === "class" && v) - v = v.replace(/(apple|webkit)\-[a-z\-]+/gi, ''); - - // Handle IE issues - if (isIE) { - switch (n) { - case 'rowspan': - case 'colspan': - // IE returns 1 as default value - if (v === 1) - v = ''; - - break; - - case 'size': - // IE returns +0 as default value for size - if (v === '+0' || v === 20 || v === 0) - v = ''; - - break; - - case 'width': - case 'height': - case 'vspace': - case 'checked': - case 'disabled': - case 'readonly': - if (v === 0) - v = ''; - - break; - - case 'hspace': - // IE returns -1 as default value - if (v === -1) - v = ''; - - break; - - case 'maxlength': - case 'tabindex': - // IE returns default value - if (v === 32768 || v === 2147483647 || v === '32768') - v = ''; - - break; - - case 'multiple': - case 'compact': - case 'noshade': - case 'nowrap': - if (v === 65535) - return n; - - return dv; - - case 'shape': - v = v.toLowerCase(); - break; - - default: - // IE has odd anonymous function for event attributes - if (n.indexOf('on') === 0 && v) - v = tinymce._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/, '$1', '' + v); - } - } - - return (v !== undef && v !== null && v !== '') ? '' + v : dv; - }, - - /** - * Returns the absolute x, y position of a node. The position will be returned in a object with x, y fields. - * - * @method getPos - * @param {Element/String} n HTML element or element id to get x, y position from. - * @param {Element} ro Optional root element to stop calculations at. - * @return {object} Absolute position of the specified element object with x, y fields. - */ - getPos : function(n, ro) { - var t = this, x = 0, y = 0, e, d = t.doc, r; - - n = t.get(n); - ro = ro || d.body; - - if (n) { - // Use getBoundingClientRect if it exists since it's faster than looping offset nodes - if (n.getBoundingClientRect) { - n = n.getBoundingClientRect(); - e = t.boxModel ? d.documentElement : d.body; - - // Add scroll offsets from documentElement or body since IE with the wrong box model will use d.body and so do WebKit - // Also remove the body/documentelement clientTop/clientLeft on IE 6, 7 since they offset the position - x = n.left + (d.documentElement.scrollLeft || d.body.scrollLeft) - e.clientTop; - y = n.top + (d.documentElement.scrollTop || d.body.scrollTop) - e.clientLeft; - - return {x : x, y : y}; - } - - r = n; - while (r && r != ro && r.nodeType) { - x += r.offsetLeft || 0; - y += r.offsetTop || 0; - r = r.offsetParent; - } - - r = n.parentNode; - while (r && r != ro && r.nodeType) { - x -= r.scrollLeft || 0; - y -= r.scrollTop || 0; - r = r.parentNode; - } - } - - return {x : x, y : y}; - }, - - /** - * Parses the specified style value into an object collection. This parser will also - * merge and remove any redundant items that browsers might have added. It will also convert non hex - * colors to hex values. Urls inside the styles will also be converted to absolute/relative based on settings. - * - * @method parseStyle - * @param {String} st Style value to parse for example: border:1px solid red;. - * @return {Object} Object representation of that style like {border : '1px solid red'} - */ - parseStyle : function(st) { - return this.styles.parse(st); - }, - - /** - * Serializes the specified style object into a string. - * - * @method serializeStyle - * @param {Object} o Object to serialize as string for example: {border : '1px solid red'} - * @param {String} name Optional element name. - * @return {String} String representation of the style object for example: border: 1px solid red. - */ - serializeStyle : function(o, name) { - return this.styles.serialize(o, name); - }, - - /** - * Imports/loads the specified CSS file into the document bound to the class. - * - * @method loadCSS - * @param {String} u URL to CSS file to load. - * @example - * // Loads a CSS file dynamically into the current document - * tinymce.DOM.loadCSS('somepath/some.css'); - * - * // Loads a CSS file into the currently active editor instance - * tinyMCE.activeEditor.dom.loadCSS('somepath/some.css'); - * - * // Loads a CSS file into an editor instance by id - * tinyMCE.get('someid').dom.loadCSS('somepath/some.css'); - * - * // Loads multiple CSS files into the current document - * tinymce.DOM.loadCSS('somepath/some.css,somepath/someother.css'); - */ - loadCSS : function(u) { - var t = this, d = t.doc, head; - - if (!u) - u = ''; - - head = t.select('head')[0]; - - each(u.split(','), function(u) { - var link; - - if (t.files[u]) - return; - - t.files[u] = true; - link = t.create('link', {rel : 'stylesheet', href : tinymce._addVer(u)}); - - // IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug - // This fix seems to resolve that issue by realcing the document ones a stylesheet finishes loading - // It's ugly but it seems to work fine. - if (isIE && d.documentMode && d.recalc) { - link.onload = function() { - if (d.recalc) - d.recalc(); - - link.onload = null; - }; - } - - head.appendChild(link); - }); - }, - - /** - * Adds a class to the specified element or elements. - * - * @method addClass - * @param {String/Element/Array} Element ID string or DOM element or array with elements or IDs. - * @param {String} c Class name to add to each element. - * @return {String/Array} String with new class value or array with new class values for all elements. - * @example - * // Adds a class to all paragraphs in the active editor - * tinyMCE.activeEditor.dom.addClass(tinyMCE.activeEditor.dom.select('p'), 'myclass'); - * - * // Adds a class to a specific element in the current page - * tinyMCE.DOM.addClass('mydiv', 'myclass'); - */ - addClass : function(e, c) { - return this.run(e, function(e) { - var o; - - if (!c) - return 0; - - if (this.hasClass(e, c)) - return e.className; - - o = this.removeClass(e, c); - - return e.className = (o != '' ? (o + ' ') : '') + c; - }); - }, - - /** - * Removes a class from the specified element or elements. - * - * @method removeClass - * @param {String/Element/Array} Element ID string or DOM element or array with elements or IDs. - * @param {String} c Class name to remove to each element. - * @return {String/Array} String with new class value or array with new class values for all elements. - * @example - * // Removes a class from all paragraphs in the active editor - * tinyMCE.activeEditor.dom.removeClass(tinyMCE.activeEditor.dom.select('p'), 'myclass'); - * - * // Removes a class from a specific element in the current page - * tinyMCE.DOM.removeClass('mydiv', 'myclass'); - */ - removeClass : function(e, c) { - var t = this, re; - - return t.run(e, function(e) { - var v; - - if (t.hasClass(e, c)) { - if (!re) - re = new RegExp("(^|\\s+)" + c + "(\\s+|$)", "g"); - - v = e.className.replace(re, ' '); - v = tinymce.trim(v != ' ' ? v : ''); - - e.className = v; - - // Empty class attr - if (!v) { - e.removeAttribute('class'); - e.removeAttribute('className'); - } - - return v; - } - - return e.className; - }); - }, - - /** - * Returns true if the specified element has the specified class. - * - * @method hasClass - * @param {String/Element} n HTML element or element id string to check CSS class on. - * @param {String} c CSS class to check for. - * @return {Boolean} true/false if the specified element has the specified class. - */ - hasClass : function(n, c) { - n = this.get(n); - - if (!n || !c) - return false; - - return (' ' + n.className + ' ').indexOf(' ' + c + ' ') !== -1; - }, - - /** - * Shows the specified element(s) by ID by setting the "display" style. - * - * @method show - * @param {String/Element/Array} e ID of DOM element or DOM element or array with elements or IDs to show. - */ - show : function(e) { - return this.setStyle(e, 'display', 'block'); - }, - - /** - * Hides the specified element(s) by ID by setting the "display" style. - * - * @method hide - * @param {String/Element/Array} e ID of DOM element or DOM element or array with elements or IDs to hide. - * @example - * // Hides a element by id in the document - * tinymce.DOM.hide('myid'); - */ - hide : function(e) { - return this.setStyle(e, 'display', 'none'); - }, - - /** - * Returns true/false if the element is hidden or not by checking the "display" style. - * - * @method isHidden - * @param {String/Element} e Id or element to check display state on. - * @return {Boolean} true/false if the element is hidden or not. - */ - isHidden : function(e) { - e = this.get(e); - - return !e || e.style.display == 'none' || this.getStyle(e, 'display') == 'none'; - }, - - /** - * Returns a unique id. This can be useful when generating elements on the fly. - * This method will not check if the element already exists. - * - * @method uniqueId - * @param {String} p Optional prefix to add infront of all ids defaults to "mce_". - * @return {String} Unique id. - */ - uniqueId : function(p) { - return (!p ? 'mce_' : p) + (this.counter++); - }, - - /** - * Sets the specified HTML content inside the element or elements. The HTML will first be processed this means - * URLs will get converted, hex color values fixed etc. Check processHTML for details. - * - * @method setHTML - * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set HTML inside. - * @param {String} h HTML content to set as inner HTML of the element. - * @example - * // Sets the inner HTML of all paragraphs in the active editor - * tinyMCE.activeEditor.dom.setHTML(tinyMCE.activeEditor.dom.select('p'), 'some inner html'); - * - * // Sets the inner HTML of a element by id in the document - * tinyMCE.DOM.setHTML('mydiv', 'some inner html'); - */ - setHTML : function(element, html) { - var self = this; - - return self.run(element, function(element) { - if (isIE) { - // Remove all child nodes, IE keeps empty text nodes in DOM - while (element.firstChild) - element.removeChild(element.firstChild); - - try { - // IE will remove comments from the beginning - // unless you padd the contents with something - element.innerHTML = '<br />' + html; - element.removeChild(element.firstChild); - } catch (ex) { - // IE sometimes produces an unknown runtime error on innerHTML if it's an block element within a block element for example a div inside a p - // This seems to fix this problem - - // Create new div with HTML contents and a BR infront to keep comments - element = self.create('div'); - element.innerHTML = '<br />' + html; - - // Add all children from div to target - each (element.childNodes, function(node, i) { - // Skip br element - if (i) - element.appendChild(node); - }); - } - } else - element.innerHTML = html; - - return html; - }); - }, - - /** - * Returns the outer HTML of an element. - * - * @method getOuterHTML - * @param {String/Element} elm Element ID or element object to get outer HTML from. - * @return {String} Outer HTML string. - * @example - * tinymce.DOM.getOuterHTML(editorElement); - * tinyMCE.activeEditor.getOuterHTML(tinyMCE.activeEditor.getBody()); - */ - getOuterHTML : function(elm) { - var doc, self = this; - - elm = self.get(elm); - - if (!elm) - return null; - - if (elm.nodeType === 1 && self.hasOuterHTML) - return elm.outerHTML; - - doc = (elm.ownerDocument || self.doc).createElement("body"); - doc.appendChild(elm.cloneNode(true)); - - return doc.innerHTML; - }, - - /** - * Sets the specified outer HTML on a element or elements. - * - * @method setOuterHTML - * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set outer HTML on. - * @param {Object} h HTML code to set as outer value for the element. - * @param {Document} d Optional document scope to use in this process defaults to the document of the DOM class. - * @example - * // Sets the outer HTML of all paragraphs in the active editor - * tinyMCE.activeEditor.dom.setOuterHTML(tinyMCE.activeEditor.dom.select('p'), '<div>some html</div>'); - * - * // Sets the outer HTML of a element by id in the document - * tinyMCE.DOM.setOuterHTML('mydiv', '<div>some html</div>'); - */ - setOuterHTML : function(e, h, d) { - var t = this; - - function setHTML(e, h, d) { - var n, tp; - - tp = d.createElement("body"); - tp.innerHTML = h; - - n = tp.lastChild; - while (n) { - t.insertAfter(n.cloneNode(true), e); - n = n.previousSibling; - } - - t.remove(e); - }; - - return this.run(e, function(e) { - e = t.get(e); - - // Only set HTML on elements - if (e.nodeType == 1) { - d = d || e.ownerDocument || t.doc; - - if (isIE) { - try { - // Try outerHTML for IE it sometimes produces an unknown runtime error - if (isIE && e.nodeType == 1) - e.outerHTML = h; - else - setHTML(e, h, d); - } catch (ex) { - // Fix for unknown runtime error - setHTML(e, h, d); - } - } else - setHTML(e, h, d); - } - }); - }, - - /** - * Entity decode a string, resolves any HTML entities like å. - * - * @method decode - * @param {String} s String to decode entities on. - * @return {String} Entity decoded string. - */ - decode : Entities.decode, - - /** - * Entity encodes a string, encodes the most common entities <>"& into entities. - * - * @method encode - * @param {String} text String to encode with entities. - * @return {String} Entity encoded string. - */ - encode : Entities.encodeAllRaw, - - /** - * Inserts a element after the reference element. - * - * @method insertAfter - * @param {Element} node Element to insert after the reference. - * @param {Element/String/Array} reference_node Reference element, element id or array of elements to insert after. - * @return {Element/Array} Element that got added or an array with elements. - */ - insertAfter : function(node, reference_node) { - reference_node = this.get(reference_node); - - return this.run(node, function(node) { - var parent, nextSibling; - - parent = reference_node.parentNode; - nextSibling = reference_node.nextSibling; - - if (nextSibling) - parent.insertBefore(node, nextSibling); - else - parent.appendChild(node); - - return node; - }); - }, - - /** - * Returns true/false if the specified element is a block element or not. - * - * @method isBlock - * @param {Node/String} node Element/Node to check. - * @return {Boolean} True/False state if the node is a block element or not. - */ - isBlock : function(node) { - var type = node.nodeType; - - // If it's a node then check the type and use the nodeName - if (type) - return !!(type === 1 && blockElementsMap[node.nodeName]); - - return !!blockElementsMap[node]; - }, - - /** - * Replaces the specified element or elements with the specified element, the new element will - * be cloned if multiple inputs elements are passed. - * - * @method replace - * @param {Element} n New element to replace old ones with. - * @param {Element/String/Array} o Element DOM node, element id or array of elements or ids to replace. - * @param {Boolean} k Optional keep children state, if set to true child nodes from the old object will be added to new ones. - */ - replace : function(n, o, k) { - var t = this; - - if (is(o, 'array')) - n = n.cloneNode(true); - - return t.run(o, function(o) { - if (k) { - each(tinymce.grep(o.childNodes), function(c) { - n.appendChild(c); - }); - } - - return o.parentNode.replaceChild(n, o); - }); - }, - - /** - * Renames the specified element to a new name and keep it's attributes and children. - * - * @method rename - * @param {Element} elm Element to rename. - * @param {String} name Name of the new element. - * @return New element or the old element if it needed renaming. - */ - rename : function(elm, name) { - var t = this, newElm; - - if (elm.nodeName != name.toUpperCase()) { - // Rename block element - newElm = t.create(name); - - // Copy attribs to new block - each(t.getAttribs(elm), function(attr_node) { - t.setAttrib(newElm, attr_node.nodeName, t.getAttrib(elm, attr_node.nodeName)); - }); - - // Replace block - t.replace(newElm, elm, 1); - } - - return newElm || elm; - }, - - /** - * Find the common ancestor of two elements. This is a shorter method than using the DOM Range logic. - * - * @method findCommonAncestor - * @param {Element} a Element to find common ancestor of. - * @param {Element} b Element to find common ancestor of. - * @return {Element} Common ancestor element of the two input elements. - */ - findCommonAncestor : function(a, b) { - var ps = a, pe; - - while (ps) { - pe = b; - - while (pe && ps != pe) - pe = pe.parentNode; - - if (ps == pe) - break; - - ps = ps.parentNode; - } - - if (!ps && a.ownerDocument) - return a.ownerDocument.documentElement; - - return ps; - }, - - /** - * Parses the specified RGB color value and returns a hex version of that color. - * - * @method toHex - * @param {String} s RGB string value like rgb(1,2,3) - * @return {String} Hex version of that RGB value like #FF00FF. - */ - toHex : function(s) { - var c = /^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s); - - function hex(s) { - s = parseInt(s).toString(16); - - return s.length > 1 ? s : '0' + s; // 0 -> 00 - }; - - if (c) { - s = '#' + hex(c[1]) + hex(c[2]) + hex(c[3]); - - return s; - } - - return s; - }, - - /** - * Returns a array of all single CSS classes in the document. A single CSS class is a simple - * rule like ".class" complex ones like "div td.class" will not be added to output. - * - * @method getClasses - * @return {Array} Array with class objects each object has a class field might be other fields in the future. - */ - getClasses : function() { - var t = this, cl = [], i, lo = {}, f = t.settings.class_filter, ov; - - if (t.classes) - return t.classes; - - function addClasses(s) { - // IE style imports - each(s.imports, function(r) { - addClasses(r); - }); - - each(s.cssRules || s.rules, function(r) { - // Real type or fake it on IE - switch (r.type || 1) { - // Rule - case 1: - if (r.selectorText) { - each(r.selectorText.split(','), function(v) { - v = v.replace(/^\s*|\s*$|^\s\./g, ""); - - // Is internal or it doesn't contain a class - if (/\.mce/.test(v) || !/\.[\w\-]+$/.test(v)) - return; - - // Remove everything but class name - ov = v; - v = tinymce._replace(/.*\.([a-z0-9_\-]+).*/i, '$1', v); - - // Filter classes - if (f && !(v = f(v, ov))) - return; - - if (!lo[v]) { - cl.push({'class' : v}); - lo[v] = 1; - } - }); - } - break; - - // Import - case 3: - addClasses(r.styleSheet); - break; - } - }); - }; - - try { - each(t.doc.styleSheets, addClasses); - } catch (ex) { - // Ignore - } - - if (cl.length > 0) - t.classes = cl; - - return cl; - }, - - /** - * Executes the specified function on the element by id or dom element node or array of elements/id. - * - * @method run - * @param {String/Element/Array} Element ID or DOM element object or array with ids or elements. - * @param {function} f Function to execute for each item. - * @param {Object} s Optional scope to execute the function in. - * @return {Object/Array} Single object or array with objects depending on multiple input or not. - */ - run : function(e, f, s) { - var t = this, o; - - if (t.doc && typeof(e) === 'string') - e = t.get(e); - - if (!e) - return false; - - s = s || this; - if (!e.nodeType && (e.length || e.length === 0)) { - o = []; - - each(e, function(e, i) { - if (e) { - if (typeof(e) == 'string') - e = t.doc.getElementById(e); - - o.push(f.call(s, e, i)); - } - }); - - return o; - } - - return f.call(s, e); - }, - - /** - * Returns an NodeList with attributes for the element. - * - * @method getAttribs - * @param {HTMLElement/string} n Element node or string id to get attributes from. - * @return {NodeList} NodeList with attributes. - */ - getAttribs : function(n) { - var o; - - n = this.get(n); - - if (!n) - return []; - - if (isIE) { - o = []; - - // Object will throw exception in IE - if (n.nodeName == 'OBJECT') - return n.attributes; - - // IE doesn't keep the selected attribute if you clone option elements - if (n.nodeName === 'OPTION' && this.getAttrib(n, 'selected')) - o.push({specified : 1, nodeName : 'selected'}); - - // It's crazy that this is faster in IE but it's because it returns all attributes all the time - n.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi, '').replace(/[\w:\-]+/gi, function(a) { - o.push({specified : 1, nodeName : a}); - }); - - return o; - } - - return n.attributes; - }, - - /** - * Returns true/false if the specified node is to be considered empty or not. - * - * @example - * tinymce.DOM.isEmpty(node, {img : true}); - * @method isEmpty - * @param {Object} elements Optional name/value object with elements that are automatically treated as non empty elements. - * @return {Boolean} true/false if the node is empty or not. - */ - isEmpty : function(node, elements) { - var self = this, i, attributes, type, walker, name, parentNode; - - node = node.firstChild; - if (node) { - walker = new tinymce.dom.TreeWalker(node); - elements = elements || self.schema ? self.schema.getNonEmptyElements() : null; - - do { - type = node.nodeType; - - if (type === 1) { - // Ignore bogus elements - if (node.getAttribute('data-mce-bogus')) - continue; - - // Keep empty elements like <img /> - name = node.nodeName.toLowerCase(); - if (elements && elements[name]) { - // Ignore single BR elements in blocks like <p><br /></p> - parentNode = node.parentNode; - if (name === 'br' && self.isBlock(parentNode) && parentNode.firstChild === node && parentNode.lastChild === node) { - continue; - } - - return false; - } - - // Keep elements with data-bookmark attributes or name attribute like <a name="1"></a> - attributes = self.getAttribs(node); - i = node.attributes.length; - while (i--) { - name = node.attributes[i].nodeName; - if (name === "name" || name === 'data-mce-bookmark') - return false; - } - } - - // Keep non whitespace text nodes - if ((type === 3 && !whiteSpaceRegExp.test(node.nodeValue))) - return false; - } while (node = walker.next()); - } - - return true; - }, - - /** - * Destroys all internal references to the DOM to solve IE leak issues. - * - * @method destroy - */ - destroy : function(s) { - var t = this; - - if (t.events) - t.events.destroy(); - - t.win = t.doc = t.root = t.events = null; - - // Manual destroy then remove unload handler - if (!s) - tinymce.removeUnload(t.destroy); - }, - - /** - * Created a new DOM Range object. This will use the native DOM Range API if it's - * available if it's not it will fallback to the custom TinyMCE implementation. - * - * @method createRng - * @return {DOMRange} DOM Range object. - * @example - * var rng = tinymce.DOM.createRng(); - * alert(rng.startContainer + "," + rng.startOffset); - */ - createRng : function() { - var d = this.doc; - - return d.createRange ? d.createRange() : new tinymce.dom.Range(this); - }, - - /** - * Returns the index of the specified node within it's parent. - * - * @param {Node} node Node to look for. - * @param {boolean} normalized Optional true/false state if the index is what it would be after a normalization. - * @return {Number} Index of the specified node. - */ - nodeIndex : function(node, normalized) { - var idx = 0, lastNodeType, lastNode, nodeType; - - if (node) { - for (lastNodeType = node.nodeType, node = node.previousSibling, lastNode = node; node; node = node.previousSibling) { - nodeType = node.nodeType; - - // Normalize text nodes - if (normalized && nodeType == 3) { - if (nodeType == lastNodeType || !node.nodeValue.length) - continue; - } - idx++; - lastNodeType = nodeType; - } - } - - return idx; - }, - - /** - * Splits an element into two new elements and places the specified split - * element or element between the new ones. For example splitting the paragraph at the bold element in - * this example <p>abc<b>abc</b>123</p> would produce <p>abc</p><b>abc</b><p>123</p>. - * - * @method split - * @param {Element} pe Parent element to split. - * @param {Element} e Element to split at. - * @param {Element} re Optional replacement element to replace the split element by. - * @return {Element} Returns the split element or the replacement element if that is specified. - */ - split : function(pe, e, re) { - var t = this, r = t.createRng(), bef, aft, pa; - - // W3C valid browsers tend to leave empty nodes to the left/right side of the contents, this makes sense - // but we don't want that in our code since it serves no purpose for the end user - // For example if this is chopped: - // <p>text 1<span><b>CHOP</b></span>text 2</p> - // would produce: - // <p>text 1<span></span></p><b>CHOP</b><p><span></span>text 2</p> - // this function will then trim of empty edges and produce: - // <p>text 1</p><b>CHOP</b><p>text 2</p> - function trim(node) { - var i, children = node.childNodes, type = node.nodeType; - - if (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') - return; - - for (i = children.length - 1; i >= 0; i--) - trim(children[i]); - - if (type != 9) { - // Keep non whitespace text nodes - if (type == 3 && node.nodeValue.length > 0) { - // If parent element isn't a block or there isn't any useful contents for example "<p> </p>" - if (!t.isBlock(node.parentNode) || tinymce.trim(node.nodeValue).length > 0) - return; - } else if (type == 1) { - // If the only child is a bookmark then move it up - children = node.childNodes; - if (children.length == 1 && children[0] && children[0].nodeType == 1 && children[0].getAttribute('data-mce-type') == 'bookmark') - node.parentNode.insertBefore(children[0], node); - - // Keep non empty elements or img, hr etc - if (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) - return; - } - - t.remove(node); - } - - return node; - }; - - if (pe && e) { - // Get before chunk - r.setStart(pe.parentNode, t.nodeIndex(pe)); - r.setEnd(e.parentNode, t.nodeIndex(e)); - bef = r.extractContents(); - - // Get after chunk - r = t.createRng(); - r.setStart(e.parentNode, t.nodeIndex(e) + 1); - r.setEnd(pe.parentNode, t.nodeIndex(pe) + 1); - aft = r.extractContents(); - - // Insert before chunk - pa = pe.parentNode; - pa.insertBefore(trim(bef), pe); - - // Insert middle chunk - if (re) - pa.replaceChild(re, e); - else - pa.insertBefore(e, pe); - - // Insert after chunk - pa.insertBefore(trim(aft), pe); - t.remove(pe); - - return re || e; - } - }, - - /** - * Adds an event handler to the specified object. - * - * @method bind - * @param {Element/Document/Window/Array/String} o Object or element id string to add event handler to or an array of elements/ids/documents. - * @param {String} n Name of event handler to add for example: click. - * @param {function} f Function to execute when the event occurs. - * @param {Object} s Optional scope to execute the function in. - * @return {function} Function callback handler the same as the one passed in. - */ - bind : function(target, name, func, scope) { - var t = this; - - if (!t.events) - t.events = new tinymce.dom.EventUtils(); - - return t.events.add(target, name, func, scope || this); - }, - - /** - * Removes the specified event handler by name and function from a element or collection of elements. - * - * @method unbind - * @param {String/Element/Array} o Element ID string or HTML element or an array of elements or ids to remove handler from. - * @param {String} n Event handler name like for example: "click" - * @param {function} f Function to remove. - * @return {bool/Array} Bool state if true if the handler was removed or an array with states if multiple elements where passed in. - */ - unbind : function(target, name, func) { - var t = this; - - if (!t.events) - t.events = new tinymce.dom.EventUtils(); - - return t.events.remove(target, name, func); - }, - - // #ifdef debug - - dumpRng : function(r) { - return 'startContainer: ' + r.startContainer.nodeName + ', startOffset: ' + r.startOffset + ', endContainer: ' + r.endContainer.nodeName + ', endOffset: ' + r.endOffset; - }, - - // #endif - - _findSib : function(node, selector, name) { - var t = this, f = selector; - - if (node) { - // If expression make a function of it using is - if (is(f, 'string')) { - f = function(node) { - return t.is(node, selector); - }; - } - - // Loop all siblings - for (node = node[name]; node; node = node[name]) { - if (f(node)) - return node; - } - } - - return null; - }, - - _isRes : function(c) { - // Is live resizble element - return /^(top|left|bottom|right|width|height)/i.test(c) || /;\s*(top|left|bottom|right|width|height)/i.test(c); - } - - /* - walk : function(n, f, s) { - var d = this.doc, w; - - if (d.createTreeWalker) { - w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); - - while ((n = w.nextNode()) != null) - f.call(s || this, n); - } else - tinymce.walk(n, f, 'childNodes', s); - } - */ - - /* - toRGB : function(s) { - var c = /^\s*?#([0-9A-F]{2})([0-9A-F]{1,2})([0-9A-F]{2})?\s*?$/.exec(s); - - if (c) { - // #FFF -> #FFFFFF - if (!is(c[3])) - c[3] = c[2] = c[1]; - - return "rgb(" + parseInt(c[1], 16) + "," + parseInt(c[2], 16) + "," + parseInt(c[3], 16) + ")"; - } - - return s; - } - */ - }); - - /** - * Instance of DOMUtils for the current document. - * - * @property DOM - * @member tinymce - * @type tinymce.dom.DOMUtils - * @example - * // Example of how to add a class to some element by id - * tinymce.DOM.addClass('someid', 'someclass'); - */ - tinymce.DOM = new tinymce.dom.DOMUtils(document, {process_html : 0}); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/Element.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/Element.js deleted file mode 100644 index bf71a1dc7b99..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/Element.js +++ /dev/null @@ -1,195 +0,0 @@ -/** - * Element.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - /** - * Element class, this enables element blocking in IE. Element blocking is a method to block out select blockes that - * gets visible though DIVs on IE 6 it uses a iframe for this blocking. This class also shortens the length of some DOM API calls - * since it's bound to an element. - * - * @class tinymce.dom.Element - * @example - * // Creates an basic element for an existing element - * var elm = new tinymce.dom.Element('someid'); - * - * elm.setStyle('background-color', 'red'); - * elm.moveTo(10, 10); - */ - - /** - * Constructs a new Element instance. Consult the Wiki for more details on this class. - * - * @constructor - * @method Element - * @param {String} id Element ID to bind/execute methods on. - * @param {Object} settings Optional settings name/value collection. - */ - tinymce.dom.Element = function(id, settings) { - var t = this, dom, el; - - t.settings = settings = settings || {}; - t.id = id; - t.dom = dom = settings.dom || tinymce.DOM; - - // Only IE leaks DOM references, this is a lot faster - if (!tinymce.isIE) - el = dom.get(t.id); - - tinymce.each( - ('getPos,getRect,getParent,add,setStyle,getStyle,setStyles,' + - 'setAttrib,setAttribs,getAttrib,addClass,removeClass,' + - 'hasClass,getOuterHTML,setOuterHTML,remove,show,hide,' + - 'isHidden,setHTML,get').split(/,/) - , function(k) { - t[k] = function() { - var a = [id], i; - - for (i = 0; i < arguments.length; i++) - a.push(arguments[i]); - - a = dom[k].apply(dom, a); - t.update(k); - - return a; - }; - }); - - tinymce.extend(t, { - /** - * Adds a event handler to the element. - * - * @method on - * @param {String} n Event name like for example "click". - * @param {function} f Function to execute on the specified event. - * @param {Object} s Optional scope to execute function on. - * @return {function} Event handler function the same as the input function. - */ - on : function(n, f, s) { - return tinymce.dom.Event.add(t.id, n, f, s); - }, - - /** - * Returns the absolute X, Y cordinate of the element. - * - * @method getXY - * @return {Object} Objext with x, y cordinate fields. - */ - getXY : function() { - return { - x : parseInt(t.getStyle('left')), - y : parseInt(t.getStyle('top')) - }; - }, - - /** - * Returns the size of the element by a object with w and h fields. - * - * @method getSize - * @return {Object} Object with element size with a w and h field. - */ - getSize : function() { - var n = dom.get(t.id); - - return { - w : parseInt(t.getStyle('width') || n.clientWidth), - h : parseInt(t.getStyle('height') || n.clientHeight) - }; - }, - - /** - * Moves the element to a specific absolute position. - * - * @method moveTo - * @param {Number} x X cordinate of element position. - * @param {Number} y Y cordinate of element position. - */ - moveTo : function(x, y) { - t.setStyles({left : x, top : y}); - }, - - /** - * Moves the element relative to the current position. - * - * @method moveBy - * @param {Number} x Relative X cordinate of element position. - * @param {Number} y Relative Y cordinate of element position. - */ - moveBy : function(x, y) { - var p = t.getXY(); - - t.moveTo(p.x + x, p.y + y); - }, - - /** - * Resizes the element to a specific size. - * - * @method resizeTo - * @param {Number} w New width of element. - * @param {Numner} h New height of element. - */ - resizeTo : function(w, h) { - t.setStyles({width : w, height : h}); - }, - - /** - * Resizes the element relative to the current sizeto a specific size. - * - * @method resizeBy - * @param {Number} w Relative width of element. - * @param {Numner} h Relative height of element. - */ - resizeBy : function(w, h) { - var s = t.getSize(); - - t.resizeTo(s.w + w, s.h + h); - }, - - /** - * Updates the element blocker in IE6 based on the style information of the element. - * - * @method update - * @param {String} k Optional function key. Used internally. - */ - update : function(k) { - var b; - - if (tinymce.isIE6 && settings.blocker) { - k = k || ''; - - // Ignore getters - if (k.indexOf('get') === 0 || k.indexOf('has') === 0 || k.indexOf('is') === 0) - return; - - // Remove blocker on remove - if (k == 'remove') { - dom.remove(t.blocker); - return; - } - - if (!t.blocker) { - t.blocker = dom.uniqueId(); - b = dom.add(settings.container || dom.getRoot(), 'iframe', {id : t.blocker, style : 'position:absolute;', frameBorder : 0, src : 'javascript:""'}); - dom.setStyle(b, 'opacity', 0); - } else - b = dom.get(t.blocker); - - dom.setStyles(b, { - left : t.getStyle('left', 1), - top : t.getStyle('top', 1), - width : t.getStyle('width', 1), - height : t.getStyle('height', 1), - display : t.getStyle('display', 1), - zIndex : parseInt(t.getStyle('zIndex', 1) || 0) - 1 - }); - } - } - }); - }; -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/EventUtils.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/EventUtils.js deleted file mode 100644 index f1a183c94bdc..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/EventUtils.js +++ /dev/null @@ -1,381 +0,0 @@ -/** - * EventUtils.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - // Shorten names - var each = tinymce.each, DOM = tinymce.DOM, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, Event; - - /** - * This class handles DOM events in a cross platform fasion it also keeps track of element - * and handler references to be able to clean elements to reduce IE memory leaks. - * - * @class tinymce.dom.EventUtils - */ - tinymce.create('tinymce.dom.EventUtils', { - /** - * Constructs a new EventUtils instance. - * - * @constructor - * @method EventUtils - */ - EventUtils : function() { - this.inits = []; - this.events = []; - }, - - /** - * Adds an event handler to the specified object. - * - * @method add - * @param {Element/Document/Window/Array/String} o Object or element id string to add event handler to or an array of elements/ids/documents. - * @param {String/Array} n Name of event handler to add for example: click. - * @param {function} f Function to execute when the event occurs. - * @param {Object} s Optional scope to execute the function in. - * @return {function} Function callback handler the same as the one passed in. - * @example - * // Adds a click handler to the current document - * tinymce.dom.Event.add(document, 'click', function(e) { - * console.debug(e.target); - * }); - */ - add : function(o, n, f, s) { - var cb, t = this, el = t.events, r; - - if (n instanceof Array) { - r = []; - - each(n, function(n) { - r.push(t.add(o, n, f, s)); - }); - - return r; - } - - // Handle array - if (o && o.hasOwnProperty && o instanceof Array) { - r = []; - - each(o, function(o) { - o = DOM.get(o); - r.push(t.add(o, n, f, s)); - }); - - return r; - } - - o = DOM.get(o); - - if (!o) - return; - - // Setup event callback - cb = function(e) { - // Is all events disabled - if (t.disabled) - return; - - e = e || window.event; - - // Patch in target, preventDefault and stopPropagation in IE it's W3C valid - if (e && isIE) { - if (!e.target) - e.target = e.srcElement; - - // Patch in preventDefault, stopPropagation methods for W3C compatibility - tinymce.extend(e, t._stoppers); - } - - if (!s) - return f(e); - - return f.call(s, e); - }; - - if (n == 'unload') { - tinymce.unloads.unshift({func : cb}); - return cb; - } - - if (n == 'init') { - if (t.domLoaded) - cb(); - else - t.inits.push(cb); - - return cb; - } - - // Store away listener reference - el.push({ - obj : o, - name : n, - func : f, - cfunc : cb, - scope : s - }); - - t._add(o, n, cb); - - return f; - }, - - /** - * Removes the specified event handler by name and function from a element or collection of elements. - * - * @method remove - * @param {String/Element/Array} o Element ID string or HTML element or an array of elements or ids to remove handler from. - * @param {String} n Event handler name like for example: "click" - * @param {function} f Function to remove. - * @return {bool/Array} Bool state if true if the handler was removed or an array with states if multiple elements where passed in. - * @example - * // Adds a click handler to the current document - * var func = tinymce.dom.Event.add(document, 'click', function(e) { - * console.debug(e.target); - * }); - * - * // Removes the click handler from the document - * tinymce.dom.Event.remove(document, 'click', func); - */ - remove : function(o, n, f) { - var t = this, a = t.events, s = false, r; - - // Handle array - if (o && o.hasOwnProperty && o instanceof Array) { - r = []; - - each(o, function(o) { - o = DOM.get(o); - r.push(t.remove(o, n, f)); - }); - - return r; - } - - o = DOM.get(o); - - each(a, function(e, i) { - if (e.obj == o && e.name == n && (!f || (e.func == f || e.cfunc == f))) { - a.splice(i, 1); - t._remove(o, n, e.cfunc); - s = true; - return false; - } - }); - - return s; - }, - - /** - * Clears all events of a specific object. - * - * @method clear - * @param {Object} o DOM element or object to remove all events from. - * @example - * // Cancels all mousedown events in the active editor - * tinyMCE.activeEditor.onMouseDown.add(function(ed, e) { - * return tinymce.dom.Event.cancel(e); - * }); - */ - clear : function(o) { - var t = this, a = t.events, i, e; - - if (o) { - o = DOM.get(o); - - for (i = a.length - 1; i >= 0; i--) { - e = a[i]; - - if (e.obj === o) { - t._remove(e.obj, e.name, e.cfunc); - e.obj = e.cfunc = null; - a.splice(i, 1); - } - } - } - }, - - /** - * Cancels an event for both bubbeling and the default browser behavior. - * - * @method cancel - * @param {Event} e Event object to cancel. - * @return {Boolean} Always false. - */ - cancel : function(e) { - if (!e) - return false; - - this.stop(e); - - return this.prevent(e); - }, - - /** - * Stops propogation/bubbeling of an event. - * - * @method stop - * @param {Event} e Event to cancel bubbeling on. - * @return {Boolean} Always false. - */ - stop : function(e) { - if (e.stopPropagation) - e.stopPropagation(); - else - e.cancelBubble = true; - - return false; - }, - - /** - * Prevent default browser behvaior of an event. - * - * @method prevent - * @param {Event} e Event to prevent default browser behvaior of an event. - * @return {Boolean} Always false. - */ - prevent : function(e) { - if (e.preventDefault) - e.preventDefault(); - else - e.returnValue = false; - - return false; - }, - - /** - * Destroys the instance. - * - * @method destroy - */ - destroy : function() { - var t = this; - - each(t.events, function(e, i) { - t._remove(e.obj, e.name, e.cfunc); - e.obj = e.cfunc = null; - }); - - t.events = []; - t = null; - }, - - _add : function(o, n, f) { - if (o.attachEvent) - o.attachEvent('on' + n, f); - else if (o.addEventListener) - o.addEventListener(n, f, false); - else - o['on' + n] = f; - }, - - _remove : function(o, n, f) { - if (o) { - try { - if (o.detachEvent) - o.detachEvent('on' + n, f); - else if (o.removeEventListener) - o.removeEventListener(n, f, false); - else - o['on' + n] = null; - } catch (ex) { - // Might fail with permission denined on IE so we just ignore that - } - } - }, - - _pageInit : function(win) { - var t = this; - - // Keep it from running more than once - if (t.domLoaded) - return; - - t.domLoaded = true; - - each(t.inits, function(c) { - c(); - }); - - t.inits = []; - }, - - _wait : function(win) { - var t = this, doc = win.document; - - // No need since the document is already loaded - if (win.tinyMCE_GZ && tinyMCE_GZ.loaded) { - t.domLoaded = 1; - return; - } - - // Use IE method - if (doc.attachEvent) { - doc.attachEvent("onreadystatechange", function() { - if (doc.readyState === "complete") { - doc.detachEvent("onreadystatechange", arguments.callee); - t._pageInit(win); - } - }); - - if (doc.documentElement.doScroll && win == win.top) { - (function() { - if (t.domLoaded) - return; - - try { - // If IE is used, use the trick by Diego Perini licensed under MIT by request to the author. - // http://javascript.nwbox.com/IEContentLoaded/ - doc.documentElement.doScroll("left"); - } catch (ex) { - setTimeout(arguments.callee, 0); - return; - } - - t._pageInit(win); - })(); - } - } else if (doc.addEventListener) { - t._add(win, 'DOMContentLoaded', function() { - t._pageInit(win); - }); - } - - t._add(win, 'load', function() { - t._pageInit(win); - }); - }, - - _stoppers : { - preventDefault : function() { - this.returnValue = false; - }, - - stopPropagation : function() { - this.cancelBubble = true; - } - } - }); - - /** - * Instance of EventUtils for the current document. - * - * @property Event - * @member tinymce.dom - * @type tinymce.dom.EventUtils - */ - Event = tinymce.dom.Event = new tinymce.dom.EventUtils(); - - // Dispatch DOM content loaded event for IE and Safari - Event._wait(window); - - tinymce.addUnload(function() { - Event.destroy(); - }); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/Range.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/Range.js deleted file mode 100644 index baf43bbafc10..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/Range.js +++ /dev/null @@ -1,687 +0,0 @@ -/** - * Range.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(ns) { - // Range constructor - function Range(dom) { - var t = this, - doc = dom.doc, - EXTRACT = 0, - CLONE = 1, - DELETE = 2, - TRUE = true, - FALSE = false, - START_OFFSET = 'startOffset', - START_CONTAINER = 'startContainer', - END_CONTAINER = 'endContainer', - END_OFFSET = 'endOffset', - extend = tinymce.extend, - nodeIndex = dom.nodeIndex; - - extend(t, { - // Inital states - startContainer : doc, - startOffset : 0, - endContainer : doc, - endOffset : 0, - collapsed : TRUE, - commonAncestorContainer : doc, - - // Range constants - START_TO_START : 0, - START_TO_END : 1, - END_TO_END : 2, - END_TO_START : 3, - - // Public methods - setStart : setStart, - setEnd : setEnd, - setStartBefore : setStartBefore, - setStartAfter : setStartAfter, - setEndBefore : setEndBefore, - setEndAfter : setEndAfter, - collapse : collapse, - selectNode : selectNode, - selectNodeContents : selectNodeContents, - compareBoundaryPoints : compareBoundaryPoints, - deleteContents : deleteContents, - extractContents : extractContents, - cloneContents : cloneContents, - insertNode : insertNode, - surroundContents : surroundContents, - cloneRange : cloneRange - }); - - function setStart(n, o) { - _setEndPoint(TRUE, n, o); - }; - - function setEnd(n, o) { - _setEndPoint(FALSE, n, o); - }; - - function setStartBefore(n) { - setStart(n.parentNode, nodeIndex(n)); - }; - - function setStartAfter(n) { - setStart(n.parentNode, nodeIndex(n) + 1); - }; - - function setEndBefore(n) { - setEnd(n.parentNode, nodeIndex(n)); - }; - - function setEndAfter(n) { - setEnd(n.parentNode, nodeIndex(n) + 1); - }; - - function collapse(ts) { - if (ts) { - t[END_CONTAINER] = t[START_CONTAINER]; - t[END_OFFSET] = t[START_OFFSET]; - } else { - t[START_CONTAINER] = t[END_CONTAINER]; - t[START_OFFSET] = t[END_OFFSET]; - } - - t.collapsed = TRUE; - }; - - function selectNode(n) { - setStartBefore(n); - setEndAfter(n); - }; - - function selectNodeContents(n) { - setStart(n, 0); - setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length); - }; - - function compareBoundaryPoints(h, r) { - var sc = t[START_CONTAINER], so = t[START_OFFSET], ec = t[END_CONTAINER], eo = t[END_OFFSET], - rsc = r.startContainer, rso = r.startOffset, rec = r.endContainer, reo = r.endOffset; - - // Check START_TO_START - if (h === 0) - return _compareBoundaryPoints(sc, so, rsc, rso); - - // Check START_TO_END - if (h === 1) - return _compareBoundaryPoints(ec, eo, rsc, rso); - - // Check END_TO_END - if (h === 2) - return _compareBoundaryPoints(ec, eo, rec, reo); - - // Check END_TO_START - if (h === 3) - return _compareBoundaryPoints(sc, so, rec, reo); - }; - - function deleteContents() { - _traverse(DELETE); - }; - - function extractContents() { - return _traverse(EXTRACT); - }; - - function cloneContents() { - return _traverse(CLONE); - }; - - function insertNode(n) { - var startContainer = this[START_CONTAINER], - startOffset = this[START_OFFSET], nn, o; - - // Node is TEXT_NODE or CDATA - if ((startContainer.nodeType === 3 || startContainer.nodeType === 4) && startContainer.nodeValue) { - if (!startOffset) { - // At the start of text - startContainer.parentNode.insertBefore(n, startContainer); - } else if (startOffset >= startContainer.nodeValue.length) { - // At the end of text - dom.insertAfter(n, startContainer); - } else { - // Middle, need to split - nn = startContainer.splitText(startOffset); - startContainer.parentNode.insertBefore(n, nn); - } - } else { - // Insert element node - if (startContainer.childNodes.length > 0) - o = startContainer.childNodes[startOffset]; - - if (o) - startContainer.insertBefore(n, o); - else - startContainer.appendChild(n); - } - }; - - function surroundContents(n) { - var f = t.extractContents(); - - t.insertNode(n); - n.appendChild(f); - t.selectNode(n); - }; - - function cloneRange() { - return extend(new Range(dom), { - startContainer : t[START_CONTAINER], - startOffset : t[START_OFFSET], - endContainer : t[END_CONTAINER], - endOffset : t[END_OFFSET], - collapsed : t.collapsed, - commonAncestorContainer : t.commonAncestorContainer - }); - }; - - // Private methods - - function _getSelectedNode(container, offset) { - var child; - - if (container.nodeType == 3 /* TEXT_NODE */) - return container; - - if (offset < 0) - return container; - - child = container.firstChild; - while (child && offset > 0) { - --offset; - child = child.nextSibling; - } - - if (child) - return child; - - return container; - }; - - function _isCollapsed() { - return (t[START_CONTAINER] == t[END_CONTAINER] && t[START_OFFSET] == t[END_OFFSET]); - }; - - function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) { - var c, offsetC, n, cmnRoot, childA, childB; - - // In the first case the boundary-points have the same container. A is before B - // if its offset is less than the offset of B, A is equal to B if its offset is - // equal to the offset of B, and A is after B if its offset is greater than the - // offset of B. - if (containerA == containerB) { - if (offsetA == offsetB) - return 0; // equal - - if (offsetA < offsetB) - return -1; // before - - return 1; // after - } - - // In the second case a child node C of the container of A is an ancestor - // container of B. In this case, A is before B if the offset of A is less than or - // equal to the index of the child node C and A is after B otherwise. - c = containerB; - while (c && c.parentNode != containerA) - c = c.parentNode; - - if (c) { - offsetC = 0; - n = containerA.firstChild; - - while (n != c && offsetC < offsetA) { - offsetC++; - n = n.nextSibling; - } - - if (offsetA <= offsetC) - return -1; // before - - return 1; // after - } - - // In the third case a child node C of the container of B is an ancestor container - // of A. In this case, A is before B if the index of the child node C is less than - // the offset of B and A is after B otherwise. - c = containerA; - while (c && c.parentNode != containerB) { - c = c.parentNode; - } - - if (c) { - offsetC = 0; - n = containerB.firstChild; - - while (n != c && offsetC < offsetB) { - offsetC++; - n = n.nextSibling; - } - - if (offsetC < offsetB) - return -1; // before - - return 1; // after - } - - // In the fourth case, none of three other cases hold: the containers of A and B - // are siblings or descendants of sibling nodes. In this case, A is before B if - // the container of A is before the container of B in a pre-order traversal of the - // Ranges' context tree and A is after B otherwise. - cmnRoot = dom.findCommonAncestor(containerA, containerB); - childA = containerA; - - while (childA && childA.parentNode != cmnRoot) - childA = childA.parentNode; - - if (!childA) - childA = cmnRoot; - - childB = containerB; - while (childB && childB.parentNode != cmnRoot) - childB = childB.parentNode; - - if (!childB) - childB = cmnRoot; - - if (childA == childB) - return 0; // equal - - n = cmnRoot.firstChild; - while (n) { - if (n == childA) - return -1; // before - - if (n == childB) - return 1; // after - - n = n.nextSibling; - } - }; - - function _setEndPoint(st, n, o) { - var ec, sc; - - if (st) { - t[START_CONTAINER] = n; - t[START_OFFSET] = o; - } else { - t[END_CONTAINER] = n; - t[END_OFFSET] = o; - } - - // If one boundary-point of a Range is set to have a root container - // other than the current one for the Range, the Range is collapsed to - // the new position. This enforces the restriction that both boundary- - // points of a Range must have the same root container. - ec = t[END_CONTAINER]; - while (ec.parentNode) - ec = ec.parentNode; - - sc = t[START_CONTAINER]; - while (sc.parentNode) - sc = sc.parentNode; - - if (sc == ec) { - // The start position of a Range is guaranteed to never be after the - // end position. To enforce this restriction, if the start is set to - // be at a position after the end, the Range is collapsed to that - // position. - if (_compareBoundaryPoints(t[START_CONTAINER], t[START_OFFSET], t[END_CONTAINER], t[END_OFFSET]) > 0) - t.collapse(st); - } else - t.collapse(st); - - t.collapsed = _isCollapsed(); - t.commonAncestorContainer = dom.findCommonAncestor(t[START_CONTAINER], t[END_CONTAINER]); - }; - - function _traverse(how) { - var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep; - - if (t[START_CONTAINER] == t[END_CONTAINER]) - return _traverseSameContainer(how); - - for (c = t[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { - if (p == t[START_CONTAINER]) - return _traverseCommonStartContainer(c, how); - - ++endContainerDepth; - } - - for (c = t[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { - if (p == t[END_CONTAINER]) - return _traverseCommonEndContainer(c, how); - - ++startContainerDepth; - } - - depthDiff = startContainerDepth - endContainerDepth; - - startNode = t[START_CONTAINER]; - while (depthDiff > 0) { - startNode = startNode.parentNode; - depthDiff--; - } - - endNode = t[END_CONTAINER]; - while (depthDiff < 0) { - endNode = endNode.parentNode; - depthDiff++; - } - - // ascend the ancestor hierarchy until we have a common parent. - for (sp = startNode.parentNode, ep = endNode.parentNode; sp != ep; sp = sp.parentNode, ep = ep.parentNode) { - startNode = sp; - endNode = ep; - } - - return _traverseCommonAncestors(startNode, endNode, how); - }; - - function _traverseSameContainer(how) { - var frag, s, sub, n, cnt, sibling, xferNode; - - if (how != DELETE) - frag = doc.createDocumentFragment(); - - // If selection is empty, just return the fragment - if (t[START_OFFSET] == t[END_OFFSET]) - return frag; - - // Text node needs special case handling - if (t[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) { - // get the substring - s = t[START_CONTAINER].nodeValue; - sub = s.substring(t[START_OFFSET], t[END_OFFSET]); - - // set the original text node to its new value - if (how != CLONE) { - t[START_CONTAINER].deleteData(t[START_OFFSET], t[END_OFFSET] - t[START_OFFSET]); - - // Nothing is partially selected, so collapse to start point - t.collapse(TRUE); - } - - if (how == DELETE) - return; - - frag.appendChild(doc.createTextNode(sub)); - return frag; - } - - // Copy nodes between the start/end offsets. - n = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]); - cnt = t[END_OFFSET] - t[START_OFFSET]; - - while (cnt > 0) { - sibling = n.nextSibling; - xferNode = _traverseFullySelected(n, how); - - if (frag) - frag.appendChild( xferNode ); - - --cnt; - n = sibling; - } - - // Nothing is partially selected, so collapse to start point - if (how != CLONE) - t.collapse(TRUE); - - return frag; - }; - - function _traverseCommonStartContainer(endAncestor, how) { - var frag, n, endIdx, cnt, sibling, xferNode; - - if (how != DELETE) - frag = doc.createDocumentFragment(); - - n = _traverseRightBoundary(endAncestor, how); - - if (frag) - frag.appendChild(n); - - endIdx = nodeIndex(endAncestor); - cnt = endIdx - t[START_OFFSET]; - - if (cnt <= 0) { - // Collapse to just before the endAncestor, which - // is partially selected. - if (how != CLONE) { - t.setEndBefore(endAncestor); - t.collapse(FALSE); - } - - return frag; - } - - n = endAncestor.previousSibling; - while (cnt > 0) { - sibling = n.previousSibling; - xferNode = _traverseFullySelected(n, how); - - if (frag) - frag.insertBefore(xferNode, frag.firstChild); - - --cnt; - n = sibling; - } - - // Collapse to just before the endAncestor, which - // is partially selected. - if (how != CLONE) { - t.setEndBefore(endAncestor); - t.collapse(FALSE); - } - - return frag; - }; - - function _traverseCommonEndContainer(startAncestor, how) { - var frag, startIdx, n, cnt, sibling, xferNode; - - if (how != DELETE) - frag = doc.createDocumentFragment(); - - n = _traverseLeftBoundary(startAncestor, how); - if (frag) - frag.appendChild(n); - - startIdx = nodeIndex(startAncestor); - ++startIdx; // Because we already traversed it - - cnt = t[END_OFFSET] - startIdx; - n = startAncestor.nextSibling; - while (cnt > 0) { - sibling = n.nextSibling; - xferNode = _traverseFullySelected(n, how); - - if (frag) - frag.appendChild(xferNode); - - --cnt; - n = sibling; - } - - if (how != CLONE) { - t.setStartAfter(startAncestor); - t.collapse(TRUE); - } - - return frag; - }; - - function _traverseCommonAncestors(startAncestor, endAncestor, how) { - var n, frag, commonParent, startOffset, endOffset, cnt, sibling, nextSibling; - - if (how != DELETE) - frag = doc.createDocumentFragment(); - - n = _traverseLeftBoundary(startAncestor, how); - if (frag) - frag.appendChild(n); - - commonParent = startAncestor.parentNode; - startOffset = nodeIndex(startAncestor); - endOffset = nodeIndex(endAncestor); - ++startOffset; - - cnt = endOffset - startOffset; - sibling = startAncestor.nextSibling; - - while (cnt > 0) { - nextSibling = sibling.nextSibling; - n = _traverseFullySelected(sibling, how); - - if (frag) - frag.appendChild(n); - - sibling = nextSibling; - --cnt; - } - - n = _traverseRightBoundary(endAncestor, how); - - if (frag) - frag.appendChild(n); - - if (how != CLONE) { - t.setStartAfter(startAncestor); - t.collapse(TRUE); - } - - return frag; - }; - - function _traverseRightBoundary(root, how) { - var next = _getSelectedNode(t[END_CONTAINER], t[END_OFFSET] - 1), parent, clonedParent, prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != t[END_CONTAINER]; - - if (next == root) - return _traverseNode(next, isFullySelected, FALSE, how); - - parent = next.parentNode; - clonedParent = _traverseNode(parent, FALSE, FALSE, how); - - while (parent) { - while (next) { - prevSibling = next.previousSibling; - clonedChild = _traverseNode(next, isFullySelected, FALSE, how); - - if (how != DELETE) - clonedParent.insertBefore(clonedChild, clonedParent.firstChild); - - isFullySelected = TRUE; - next = prevSibling; - } - - if (parent == root) - return clonedParent; - - next = parent.previousSibling; - parent = parent.parentNode; - - clonedGrandParent = _traverseNode(parent, FALSE, FALSE, how); - - if (how != DELETE) - clonedGrandParent.appendChild(clonedParent); - - clonedParent = clonedGrandParent; - } - }; - - function _traverseLeftBoundary(root, how) { - var next = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]), isFullySelected = next != t[START_CONTAINER], parent, clonedParent, nextSibling, clonedChild, clonedGrandParent; - - if (next == root) - return _traverseNode(next, isFullySelected, TRUE, how); - - parent = next.parentNode; - clonedParent = _traverseNode(parent, FALSE, TRUE, how); - - while (parent) { - while (next) { - nextSibling = next.nextSibling; - clonedChild = _traverseNode(next, isFullySelected, TRUE, how); - - if (how != DELETE) - clonedParent.appendChild(clonedChild); - - isFullySelected = TRUE; - next = nextSibling; - } - - if (parent == root) - return clonedParent; - - next = parent.nextSibling; - parent = parent.parentNode; - - clonedGrandParent = _traverseNode(parent, FALSE, TRUE, how); - - if (how != DELETE) - clonedGrandParent.appendChild(clonedParent); - - clonedParent = clonedGrandParent; - } - }; - - function _traverseNode(n, isFullySelected, isLeft, how) { - var txtValue, newNodeValue, oldNodeValue, offset, newNode; - - if (isFullySelected) - return _traverseFullySelected(n, how); - - if (n.nodeType == 3 /* TEXT_NODE */) { - txtValue = n.nodeValue; - - if (isLeft) { - offset = t[START_OFFSET]; - newNodeValue = txtValue.substring(offset); - oldNodeValue = txtValue.substring(0, offset); - } else { - offset = t[END_OFFSET]; - newNodeValue = txtValue.substring(0, offset); - oldNodeValue = txtValue.substring(offset); - } - - if (how != CLONE) - n.nodeValue = oldNodeValue; - - if (how == DELETE) - return; - - newNode = n.cloneNode(FALSE); - newNode.nodeValue = newNodeValue; - - return newNode; - } - - if (how == DELETE) - return; - - return n.cloneNode(FALSE); - }; - - function _traverseFullySelected(n, how) { - if (how != DELETE) - return how == CLONE ? n.cloneNode(TRUE) : n; - - n.parentNode.removeChild(n); - }; - }; - - ns.Range = Range; -})(tinymce.dom); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/RangeUtils.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/RangeUtils.js deleted file mode 100644 index 6d48b8cdc2dd..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/RangeUtils.js +++ /dev/null @@ -1,251 +0,0 @@ -/** - * Range.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - tinymce.dom.RangeUtils = function(dom) { - var INVISIBLE_CHAR = '\uFEFF'; - - /** - * Walks the specified range like object and executes the callback for each sibling collection it finds. - * - * @param {Object} rng Range like object. - * @param {function} callback Callback function to execute for each sibling collection. - */ - this.walk = function(rng, callback) { - var startContainer = rng.startContainer, - startOffset = rng.startOffset, - endContainer = rng.endContainer, - endOffset = rng.endOffset, - ancestor, startPoint, - endPoint, node, parent, siblings, nodes; - - // Handle table cell selection the table plugin enables - // you to fake select table cells and perform formatting actions on them - nodes = dom.select('td.mceSelected,th.mceSelected'); - if (nodes.length > 0) { - tinymce.each(nodes, function(node) { - callback([node]); - }); - - return; - } - - /** - * Excludes start/end text node if they are out side the range - * - * @private - * @param {Array} nodes Nodes to exclude items from. - * @return {Array} Array with nodes excluding the start/end container if needed. - */ - function exclude(nodes) { - var node; - - // First node is excluded - node = nodes[0]; - if (node.nodeType === 3 && node === startContainer && startOffset >= node.nodeValue.length) { - nodes.splice(0, 1); - } - - // Last node is excluded - node = nodes[nodes.length - 1]; - if (endOffset === 0 && nodes.length > 0 && node === endContainer && node.nodeType === 3) { - nodes.splice(nodes.length - 1, 1); - } - - return nodes; - }; - - /** - * Collects siblings - * - * @private - * @param {Node} node Node to collect siblings from. - * @param {String} name Name of the sibling to check for. - * @return {Array} Array of collected siblings. - */ - function collectSiblings(node, name, end_node) { - var siblings = []; - - for (; node && node != end_node; node = node[name]) - siblings.push(node); - - return siblings; - }; - - /** - * Find an end point this is the node just before the common ancestor root. - * - * @private - * @param {Node} node Node to start at. - * @param {Node} root Root/ancestor element to stop just before. - * @return {Node} Node just before the root element. - */ - function findEndPoint(node, root) { - do { - if (node.parentNode == root) - return node; - - node = node.parentNode; - } while(node); - }; - - function walkBoundary(start_node, end_node, next) { - var siblingName = next ? 'nextSibling' : 'previousSibling'; - - for (node = start_node, parent = node.parentNode; node && node != end_node; node = parent) { - parent = node.parentNode; - siblings = collectSiblings(node == start_node ? node : node[siblingName], siblingName); - - if (siblings.length) { - if (!next) - siblings.reverse(); - - callback(exclude(siblings)); - } - } - }; - - // If index based start position then resolve it - if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) - startContainer = startContainer.childNodes[startOffset]; - - // If index based end position then resolve it - if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) - endContainer = endContainer.childNodes[Math.min(endOffset - 1, endContainer.childNodes.length - 1)]; - - // Same container - if (startContainer == endContainer) - return callback(exclude([startContainer])); - - // Find common ancestor and end points - ancestor = dom.findCommonAncestor(startContainer, endContainer); - - // Process left side - for (node = startContainer; node; node = node.parentNode) { - if (node === endContainer) - return walkBoundary(startContainer, ancestor, true); - - if (node === ancestor) - break; - } - - // Process right side - for (node = endContainer; node; node = node.parentNode) { - if (node === startContainer) - return walkBoundary(endContainer, ancestor); - - if (node === ancestor) - break; - } - - // Find start/end point - startPoint = findEndPoint(startContainer, ancestor) || startContainer; - endPoint = findEndPoint(endContainer, ancestor) || endContainer; - - // Walk left leaf - walkBoundary(startContainer, startPoint, true); - - // Walk the middle from start to end point - siblings = collectSiblings( - startPoint == startContainer ? startPoint : startPoint.nextSibling, - 'nextSibling', - endPoint == endContainer ? endPoint.nextSibling : endPoint - ); - - if (siblings.length) - callback(exclude(siblings)); - - // Walk right leaf - walkBoundary(endContainer, endPoint); - }; - - /** - * Splits the specified range at it's start/end points. - * - * @param {Range/RangeObject} rng Range to split. - * @return {Object} Range position object. - */ - this.split = function(rng) { - var startContainer = rng.startContainer, - startOffset = rng.startOffset, - endContainer = rng.endContainer, - endOffset = rng.endOffset; - - function splitText(node, offset) { - return node.splitText(offset); - }; - - // Handle single text node - if (startContainer == endContainer && startContainer.nodeType == 3) { - if (startOffset > 0 && startOffset < startContainer.nodeValue.length) { - endContainer = splitText(startContainer, startOffset); - startContainer = endContainer.previousSibling; - - if (endOffset > startOffset) { - endOffset = endOffset - startOffset; - startContainer = endContainer = splitText(endContainer, endOffset).previousSibling; - endOffset = endContainer.nodeValue.length; - startOffset = 0; - } else { - endOffset = 0; - } - } - } else { - // Split startContainer text node if needed - if (startContainer.nodeType == 3 && startOffset > 0 && startOffset < startContainer.nodeValue.length) { - startContainer = splitText(startContainer, startOffset); - startOffset = 0; - } - - // Split endContainer text node if needed - if (endContainer.nodeType == 3 && endOffset > 0 && endOffset < endContainer.nodeValue.length) { - endContainer = splitText(endContainer, endOffset).previousSibling; - endOffset = endContainer.nodeValue.length; - } - } - - return { - startContainer : startContainer, - startOffset : startOffset, - endContainer : endContainer, - endOffset : endOffset - }; - }; - - }; - - /** - * Compares two ranges and checks if they are equal. - * - * @static - * @param {DOMRange} rng1 First range to compare. - * @param {DOMRange} rng2 First range to compare. - * @return {Boolean} true/false if the ranges are equal. - */ - tinymce.dom.RangeUtils.compareRanges = function(rng1, rng2) { - if (rng1 && rng2) { - // Compare native IE ranges - if (rng1.item || rng1.duplicate) { - // Both are control ranges and the selected element matches - if (rng1.item && rng2.item && rng1.item(0) === rng2.item(0)) - return true; - - // Both are text ranges and the range matches - if (rng1.isEqual && rng2.isEqual && rng2.isEqual(rng1)) - return true; - } else { - // Compare w3c ranges - return rng1.startContainer == rng2.startContainer && rng1.startOffset == rng2.startOffset; - } - } - - return false; - }; -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/ScriptLoader.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/ScriptLoader.js deleted file mode 100644 index a322759e1730..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/ScriptLoader.js +++ /dev/null @@ -1,285 +0,0 @@ -/** - * ScriptLoader.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - /** - * This class handles asynchronous/synchronous loading of JavaScript files it will execute callbacks when various items gets loaded. This class is useful to load external JavaScript files. - * - * @class tinymce.dom.ScriptLoader - * @example - * // Load a script from a specific URL using the global script loader - * tinymce.ScriptLoader.load('somescript.js'); - * - * // Load a script using a unique instance of the script loader - * var scriptLoader = new tinymce.dom.ScriptLoader(); - * - * scriptLoader.load('somescript.js'); - * - * // Load multiple scripts - * var scriptLoader = new tinymce.dom.ScriptLoader(); - * - * scriptLoader.add('somescript1.js'); - * scriptLoader.add('somescript2.js'); - * scriptLoader.add('somescript3.js'); - * - * scriptLoader.loadQueue(function() { - * alert('All scripts are now loaded.'); - * }); - */ - tinymce.dom.ScriptLoader = function(settings) { - var QUEUED = 0, - LOADING = 1, - LOADED = 2, - states = {}, - queue = [], - scriptLoadedCallbacks = {}, - queueLoadedCallbacks = [], - loading = 0, - undefined; - - /** - * Loads a specific script directly without adding it to the load queue. - * - * @method load - * @param {String} url Absolute URL to script to add. - * @param {function} callback Optional callback function to execute ones this script gets loaded. - * @param {Object} scope Optional scope to execute callback in. - */ - function loadScript(url, callback) { - var t = this, dom = tinymce.DOM, elm, uri, loc, id; - - // Execute callback when script is loaded - function done() { - dom.remove(id); - - if (elm) - elm.onreadystatechange = elm.onload = elm = null; - - callback(); - }; - - function error() { - // Report the error so it's easier for people to spot loading errors - if (typeof(console) !== "undefined" && console.log) - console.log("Failed to load: " + url); - - // We can't mark it as done if there is a load error since - // A) We don't want to produce 404 errors on the server and - // B) the onerror event won't fire on all browsers. - // done(); - }; - - id = dom.uniqueId(); - - if (tinymce.isIE6) { - uri = new tinymce.util.URI(url); - loc = location; - - // If script is from same domain and we - // use IE 6 then use XHR since it's more reliable - if (uri.host == loc.hostname && uri.port == loc.port && (uri.protocol + ':') == loc.protocol && uri.protocol.toLowerCase() != 'file') { - tinymce.util.XHR.send({ - url : tinymce._addVer(uri.getURI()), - success : function(content) { - // Create new temp script element - var script = dom.create('script', { - type : 'text/javascript' - }); - - // Evaluate script in global scope - script.text = content; - document.getElementsByTagName('head')[0].appendChild(script); - dom.remove(script); - - done(); - }, - - error : error - }); - - return; - } - } - - // Create new script element - elm = dom.create('script', { - id : id, - type : 'text/javascript', - src : tinymce._addVer(url) - }); - - // Add onload listener for non IE browsers since IE9 - // fires onload event before the script is parsed and executed - if (!tinymce.isIE) - elm.onload = done; - - // Add onerror event will get fired on some browsers but not all of them - elm.onerror = error; - - // Opera 9.60 doesn't seem to fire the onreadystate event at correctly - if (!tinymce.isOpera) { - elm.onreadystatechange = function() { - var state = elm.readyState; - - // Loaded state is passed on IE 6 however there - // are known issues with this method but we can't use - // XHR in a cross domain loading - if (state == 'complete' || state == 'loaded') - done(); - }; - } - - // Most browsers support this feature so we report errors - // for those at least to help users track their missing plugins etc - // todo: Removed since it produced error if the document is unloaded by navigating away, re-add it as an option - /*elm.onerror = function() { - alert('Failed to load: ' + url); - };*/ - - // Add script to document - (document.getElementsByTagName('head')[0] || document.body).appendChild(elm); - }; - - /** - * Returns true/false if a script has been loaded or not. - * - * @method isDone - * @param {String} url URL to check for. - * @return [Boolean} true/false if the URL is loaded. - */ - this.isDone = function(url) { - return states[url] == LOADED; - }; - - /** - * Marks a specific script to be loaded. This can be useful if a script got loaded outside - * the script loader or to skip it from loading some script. - * - * @method markDone - * @param {string} u Absolute URL to the script to mark as loaded. - */ - this.markDone = function(url) { - states[url] = LOADED; - }; - - /** - * Adds a specific script to the load queue of the script loader. - * - * @method add - * @param {String} url Absolute URL to script to add. - * @param {function} callback Optional callback function to execute ones this script gets loaded. - * @param {Object} scope Optional scope to execute callback in. - */ - this.add = this.load = function(url, callback, scope) { - var item, state = states[url]; - - // Add url to load queue - if (state == undefined) { - queue.push(url); - states[url] = QUEUED; - } - - if (callback) { - // Store away callback for later execution - if (!scriptLoadedCallbacks[url]) - scriptLoadedCallbacks[url] = []; - - scriptLoadedCallbacks[url].push({ - func : callback, - scope : scope || this - }); - } - }; - - /** - * Starts the loading of the queue. - * - * @method loadQueue - * @param {function} callback Optional callback to execute when all queued items are loaded. - * @param {Object} scope Optional scope to execute the callback in. - */ - this.loadQueue = function(callback, scope) { - this.loadScripts(queue, callback, scope); - }; - - /** - * Loads the specified queue of files and executes the callback ones they are loaded. - * This method is generally not used outside this class but it might be useful in some scenarios. - * - * @method loadScripts - * @param {Array} scripts Array of queue items to load. - * @param {function} callback Optional callback to execute ones all items are loaded. - * @param {Object} scope Optional scope to execute callback in. - */ - this.loadScripts = function(scripts, callback, scope) { - var loadScripts; - - function execScriptLoadedCallbacks(url) { - // Execute URL callback functions - tinymce.each(scriptLoadedCallbacks[url], function(callback) { - callback.func.call(callback.scope); - }); - - scriptLoadedCallbacks[url] = undefined; - }; - - queueLoadedCallbacks.push({ - func : callback, - scope : scope || this - }); - - loadScripts = function() { - var loadingScripts = tinymce.grep(scripts); - - // Current scripts has been handled - scripts.length = 0; - - // Load scripts that needs to be loaded - tinymce.each(loadingScripts, function(url) { - // Script is already loaded then execute script callbacks directly - if (states[url] == LOADED) { - execScriptLoadedCallbacks(url); - return; - } - - // Is script not loading then start loading it - if (states[url] != LOADING) { - states[url] = LOADING; - loading++; - - loadScript(url, function() { - states[url] = LOADED; - loading--; - - execScriptLoadedCallbacks(url); - - // Load more scripts if they where added by the recently loaded script - loadScripts(); - }); - } - }); - - // No scripts are currently loading then execute all pending queue loaded callbacks - if (!loading) { - tinymce.each(queueLoadedCallbacks, function(callback) { - callback.func.call(callback.scope); - }); - - queueLoadedCallbacks.length = 0; - } - }; - - loadScripts(); - }; - }; - - // Global script loader - tinymce.ScriptLoader = new tinymce.dom.ScriptLoader(); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/Selection.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/Selection.js deleted file mode 100644 index 3041e6672a19..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/Selection.js +++ /dev/null @@ -1,1103 +0,0 @@ -/** - * Selection.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - function trimNl(s) { - return s.replace(/[\n\r]+/g, ''); - }; - - // Shorten names - var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each; - - /** - * This class handles text and control selection it's an crossbrowser utility class. - * Consult the TinyMCE Wiki API for more details and examples on how to use this class. - * - * @class tinymce.dom.Selection - * @example - * // Getting the currently selected node for the active editor - * alert(tinymce.activeEditor.selection.getNode().nodeName); - */ - tinymce.create('tinymce.dom.Selection', { - /** - * Constructs a new selection instance. - * - * @constructor - * @method Selection - * @param {tinymce.dom.DOMUtils} dom DOMUtils object reference. - * @param {Window} win Window to bind the selection object to. - * @param {tinymce.dom.Serializer} serializer DOM serialization class to use for getContent. - */ - Selection : function(dom, win, serializer) { - var t = this; - - t.dom = dom; - t.win = win; - t.serializer = serializer; - - // Add events - each([ - /** - * This event gets executed before contents is extracted from the selection. - * - * @event onBeforeSetContent - * @param {tinymce.dom.Selection} selection Selection object that fired the event. - * @param {Object} args Contains things like the contents that will be returned. - */ - 'onBeforeSetContent', - - /** - * This event gets executed before contents is inserted into selection. - * - * @event onBeforeGetContent - * @param {tinymce.dom.Selection} selection Selection object that fired the event. - * @param {Object} args Contains things like the contents that will be inserted. - */ - 'onBeforeGetContent', - - /** - * This event gets executed when contents is inserted into selection. - * - * @event onSetContent - * @param {tinymce.dom.Selection} selection Selection object that fired the event. - * @param {Object} args Contains things like the contents that will be inserted. - */ - 'onSetContent', - - /** - * This event gets executed when contents is extracted from the selection. - * - * @event onGetContent - * @param {tinymce.dom.Selection} selection Selection object that fired the event. - * @param {Object} args Contains things like the contents that will be returned. - */ - 'onGetContent' - ], function(e) { - t[e] = new tinymce.util.Dispatcher(t); - }); - - // No W3C Range support - if (!t.win.getSelection) - t.tridentSel = new tinymce.dom.TridentSelection(t); - - if (tinymce.isIE && dom.boxModel) - this._fixIESelection(); - - // Prevent leaks - tinymce.addUnload(t.destroy, t); - }, - - /** - * Move the selection cursor range to the specified node and offset. - * @param node Node to put the cursor in. - * @param offset Offset from the start of the node to put the cursor at. - */ - setCursorLocation: function(node, offset) { - var t = this; var r = t.dom.createRng(); - r.setStart(node, offset); - r.setEnd(node, offset); - t.setRng(r); - t.collapse(false); - }, - /** - * Returns the selected contents using the DOM serializer passed in to this class. - * - * @method getContent - * @param {Object} s Optional settings class with for example output format text or html. - * @return {String} Selected contents in for example HTML format. - * @example - * // Alerts the currently selected contents - * alert(tinyMCE.activeEditor.selection.getContent()); - * - * // Alerts the currently selected contents as plain text - * alert(tinyMCE.activeEditor.selection.getContent({format : 'text'})); - */ - getContent : function(s) { - var t = this, r = t.getRng(), e = t.dom.create("body"), se = t.getSel(), wb, wa, n; - - s = s || {}; - wb = wa = ''; - s.get = true; - s.format = s.format || 'html'; - s.forced_root_block = ''; - t.onBeforeGetContent.dispatch(t, s); - - if (s.format == 'text') - return t.isCollapsed() ? '' : (r.text || (se.toString ? se.toString() : '')); - - if (r.cloneContents) { - n = r.cloneContents(); - - if (n) - e.appendChild(n); - } else if (is(r.item) || is(r.htmlText)) { - // IE will produce invalid markup if elements are present that - // it doesn't understand like custom elements or HTML5 elements. - // Adding a BR in front of the contents and then remoiving it seems to fix it though. - e.innerHTML = '<br>' + (r.item ? r.item(0).outerHTML : r.htmlText); - e.removeChild(e.firstChild); - } else - e.innerHTML = r.toString(); - - // Keep whitespace before and after - if (/^\s/.test(e.innerHTML)) - wb = ' '; - - if (/\s+$/.test(e.innerHTML)) - wa = ' '; - - s.getInner = true; - - s.content = t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa; - t.onGetContent.dispatch(t, s); - - return s.content; - }, - - /** - * Sets the current selection to the specified content. If any contents is selected it will be replaced - * with the contents passed in to this function. If there is no selection the contents will be inserted - * where the caret is placed in the editor/page. - * - * @method setContent - * @param {String} content HTML contents to set could also be other formats depending on settings. - * @param {Object} args Optional settings object with for example data format. - * @example - * // Inserts some HTML contents at the current selection - * tinyMCE.activeEditor.selection.setContent('<strong>Some contents</strong>'); - */ - setContent : function(content, args) { - var self = this, rng = self.getRng(), caretNode, doc = self.win.document, frag, temp; - - args = args || {format : 'html'}; - args.set = true; - content = args.content = content; - - // Dispatch before set content event - if (!args.no_events) - self.onBeforeSetContent.dispatch(self, args); - - content = args.content; - - if (rng.insertNode) { - // Make caret marker since insertNode places the caret in the beginning of text after insert - content += '<span id="__caret">_</span>'; - - // Delete and insert new node - if (rng.startContainer == doc && rng.endContainer == doc) { - // WebKit will fail if the body is empty since the range is then invalid and it can't insert contents - doc.body.innerHTML = content; - } else { - rng.deleteContents(); - - if (doc.body.childNodes.length == 0) { - doc.body.innerHTML = content; - } else { - // createContextualFragment doesn't exists in IE 9 DOMRanges - if (rng.createContextualFragment) { - rng.insertNode(rng.createContextualFragment(content)); - } else { - // Fake createContextualFragment call in IE 9 - frag = doc.createDocumentFragment(); - temp = doc.createElement('div'); - - frag.appendChild(temp); - temp.outerHTML = content; - - rng.insertNode(frag); - } - } - } - - // Move to caret marker - caretNode = self.dom.get('__caret'); - - // Make sure we wrap it compleatly, Opera fails with a simple select call - rng = doc.createRange(); - rng.setStartBefore(caretNode); - rng.setEndBefore(caretNode); - self.setRng(rng); - - // Remove the caret position - self.dom.remove('__caret'); - - try { - self.setRng(rng); - } catch (ex) { - // Might fail on Opera for some odd reason - } - } else { - if (rng.item) { - // Delete content and get caret text selection - doc.execCommand('Delete', false, null); - rng = self.getRng(); - } - - // Explorer removes spaces from the beginning of pasted contents - if (/^\s+/.test(content)) { - rng.pasteHTML('<span id="__mce_tmp">_</span>' + content); - self.dom.remove('__mce_tmp'); - } else - rng.pasteHTML(content); - } - - // Dispatch set content event - if (!args.no_events) - self.onSetContent.dispatch(self, args); - }, - - /** - * Returns the start element of a selection range. If the start is in a text - * node the parent element will be returned. - * - * @method getStart - * @return {Element} Start element of selection range. - */ - getStart : function() { - var rng = this.getRng(), startElement, parentElement, checkRng, node; - - if (rng.duplicate || rng.item) { - // Control selection, return first item - if (rng.item) - return rng.item(0); - - // Get start element - checkRng = rng.duplicate(); - checkRng.collapse(1); - startElement = checkRng.parentElement(); - - // Check if range parent is inside the start element, then return the inner parent element - // This will fix issues when a single element is selected, IE would otherwise return the wrong start element - parentElement = node = rng.parentElement(); - while (node = node.parentNode) { - if (node == startElement) { - startElement = parentElement; - break; - } - } - - return startElement; - } else { - startElement = rng.startContainer; - - if (startElement.nodeType == 1 && startElement.hasChildNodes()) - startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)]; - - if (startElement && startElement.nodeType == 3) - return startElement.parentNode; - - return startElement; - } - }, - - /** - * Returns the end element of a selection range. If the end is in a text - * node the parent element will be returned. - * - * @method getEnd - * @return {Element} End element of selection range. - */ - getEnd : function() { - var t = this, r = t.getRng(), e, eo; - - if (r.duplicate || r.item) { - if (r.item) - return r.item(0); - - r = r.duplicate(); - r.collapse(0); - e = r.parentElement(); - - if (e && e.nodeName == 'BODY') - return e.lastChild || e; - - return e; - } else { - e = r.endContainer; - eo = r.endOffset; - - if (e.nodeType == 1 && e.hasChildNodes()) - e = e.childNodes[eo > 0 ? eo - 1 : eo]; - - if (e && e.nodeType == 3) - return e.parentNode; - - return e; - } - }, - - /** - * Returns a bookmark location for the current selection. This bookmark object - * can then be used to restore the selection after some content modification to the document. - * - * @method getBookmark - * @param {Number} type Optional state if the bookmark should be simple or not. Default is complex. - * @param {Boolean} normalized Optional state that enables you to get a position that it would be after normalization. - * @return {Object} Bookmark object, use moveToBookmark with this object to restore the selection. - * @example - * // Stores a bookmark of the current selection - * var bm = tinyMCE.activeEditor.selection.getBookmark(); - * - * tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent() + 'Some new content'); - * - * // Restore the selection bookmark - * tinyMCE.activeEditor.selection.moveToBookmark(bm); - */ - getBookmark : function(type, normalized) { - var t = this, dom = t.dom, rng, rng2, id, collapsed, name, element, index, chr = '\uFEFF', styles; - - function findIndex(name, element) { - var index = 0; - - each(dom.select(name), function(node, i) { - if (node == element) - index = i; - }); - - return index; - }; - - if (type == 2) { - function getLocation() { - var rng = t.getRng(true), root = dom.getRoot(), bookmark = {}; - - function getPoint(rng, start) { - var container = rng[start ? 'startContainer' : 'endContainer'], - offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0; - - if (container.nodeType == 3) { - if (normalized) { - for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling) - offset += node.nodeValue.length; - } - - point.push(offset); - } else { - childNodes = container.childNodes; - - if (offset >= childNodes.length && childNodes.length) { - after = 1; - offset = Math.max(0, childNodes.length - 1); - } - - point.push(t.dom.nodeIndex(childNodes[offset], normalized) + after); - } - - for (; container && container != root; container = container.parentNode) - point.push(t.dom.nodeIndex(container, normalized)); - - return point; - }; - - bookmark.start = getPoint(rng, true); - - if (!t.isCollapsed()) - bookmark.end = getPoint(rng); - - return bookmark; - }; - - if (t.tridentSel) - return t.tridentSel.getBookmark(type); - - return getLocation(); - } - - // Handle simple range - if (type) - return {rng : t.getRng()}; - - rng = t.getRng(); - id = dom.uniqueId(); - collapsed = tinyMCE.activeEditor.selection.isCollapsed(); - styles = 'overflow:hidden;line-height:0px'; - - // Explorer method - if (rng.duplicate || rng.item) { - // Text selection - if (!rng.item) { - rng2 = rng.duplicate(); - - try { - // Insert start marker - rng.collapse(); - rng.pasteHTML('<span data-mce-type="bookmark" id="' + id + '_start" style="' + styles + '">' + chr + '</span>'); - - // Insert end marker - if (!collapsed) { - rng2.collapse(false); - - // Detect the empty space after block elements in IE and move the end back one character <p></p>] becomes <p>]</p> - rng.moveToElementText(rng2.parentElement()); - if (rng.compareEndPoints('StartToEnd', rng2) == 0) - rng2.move('character', -1); - - rng2.pasteHTML('<span data-mce-type="bookmark" id="' + id + '_end" style="' + styles + '">' + chr + '</span>'); - } - } catch (ex) { - // IE might throw unspecified error so lets ignore it - return null; - } - } else { - // Control selection - element = rng.item(0); - name = element.nodeName; - - return {name : name, index : findIndex(name, element)}; - } - } else { - element = t.getNode(); - name = element.nodeName; - if (name == 'IMG') - return {name : name, index : findIndex(name, element)}; - - // W3C method - rng2 = rng.cloneRange(); - - // Insert end marker - if (!collapsed) { - rng2.collapse(false); - rng2.insertNode(dom.create('span', {'data-mce-type' : "bookmark", id : id + '_end', style : styles}, chr)); - } - - rng.collapse(true); - rng.insertNode(dom.create('span', {'data-mce-type' : "bookmark", id : id + '_start', style : styles}, chr)); - } - - t.moveToBookmark({id : id, keep : 1}); - - return {id : id}; - }, - - /** - * Restores the selection to the specified bookmark. - * - * @method moveToBookmark - * @param {Object} bookmark Bookmark to restore selection from. - * @return {Boolean} true/false if it was successful or not. - * @example - * // Stores a bookmark of the current selection - * var bm = tinyMCE.activeEditor.selection.getBookmark(); - * - * tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent() + 'Some new content'); - * - * // Restore the selection bookmark - * tinyMCE.activeEditor.selection.moveToBookmark(bm); - */ - moveToBookmark : function(bookmark) { - var t = this, dom = t.dom, marker1, marker2, rng, root, startContainer, endContainer, startOffset, endOffset; - - if (bookmark) { - if (bookmark.start) { - rng = dom.createRng(); - root = dom.getRoot(); - - function setEndPoint(start) { - var point = bookmark[start ? 'start' : 'end'], i, node, offset, children; - - if (point) { - offset = point[0]; - - // Find container node - for (node = root, i = point.length - 1; i >= 1; i--) { - children = node.childNodes; - - if (point[i] > children.length - 1) - return; - - node = children[point[i]]; - } - - // Move text offset to best suitable location - if (node.nodeType === 3) - offset = Math.min(point[0], node.nodeValue.length); - - // Move element offset to best suitable location - if (node.nodeType === 1) - offset = Math.min(point[0], node.childNodes.length); - - // Set offset within container node - if (start) - rng.setStart(node, offset); - else - rng.setEnd(node, offset); - } - - return true; - }; - - if (t.tridentSel) - return t.tridentSel.moveToBookmark(bookmark); - - if (setEndPoint(true) && setEndPoint()) { - t.setRng(rng); - } - } else if (bookmark.id) { - function restoreEndPoint(suffix) { - var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep; - - if (marker) { - node = marker.parentNode; - - if (suffix == 'start') { - if (!keep) { - idx = dom.nodeIndex(marker); - } else { - node = marker.firstChild; - idx = 1; - } - - startContainer = endContainer = node; - startOffset = endOffset = idx; - } else { - if (!keep) { - idx = dom.nodeIndex(marker); - } else { - node = marker.firstChild; - idx = 1; - } - - endContainer = node; - endOffset = idx; - } - - if (!keep) { - prev = marker.previousSibling; - next = marker.nextSibling; - - // Remove all marker text nodes - each(tinymce.grep(marker.childNodes), function(node) { - if (node.nodeType == 3) - node.nodeValue = node.nodeValue.replace(/\uFEFF/g, ''); - }); - - // Remove marker but keep children if for example contents where inserted into the marker - // Also remove duplicated instances of the marker for example by a split operation or by WebKit auto split on paste feature - while (marker = dom.get(bookmark.id + '_' + suffix)) - dom.remove(marker, 1); - - // If siblings are text nodes then merge them unless it's Opera since it some how removes the node - // and we are sniffing since adding a lot of detection code for a browser with 3% of the market isn't worth the effort. Sorry, Opera but it's just a fact - if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3 && !tinymce.isOpera) { - idx = prev.nodeValue.length; - prev.appendData(next.nodeValue); - dom.remove(next); - - if (suffix == 'start') { - startContainer = endContainer = prev; - startOffset = endOffset = idx; - } else { - endContainer = prev; - endOffset = idx; - } - } - } - } - }; - - function addBogus(node) { - // Adds a bogus BR element for empty block elements or just a space on IE since it renders BR elements incorrectly - if (dom.isBlock(node) && !node.innerHTML) - node.innerHTML = !isIE ? '<br data-mce-bogus="1" />' : ' '; - - return node; - }; - - // Restore start/end points - restoreEndPoint('start'); - restoreEndPoint('end'); - - if (startContainer) { - rng = dom.createRng(); - rng.setStart(addBogus(startContainer), startOffset); - rng.setEnd(addBogus(endContainer), endOffset); - t.setRng(rng); - } - } else if (bookmark.name) { - t.select(dom.select(bookmark.name)[bookmark.index]); - } else if (bookmark.rng) - t.setRng(bookmark.rng); - } - }, - - /** - * Selects the specified element. This will place the start and end of the selection range around the element. - * - * @method select - * @param {Element} node HMTL DOM element to select. - * @param {Boolean} content Optional bool state if the contents should be selected or not on non IE browser. - * @return {Element} Selected element the same element as the one that got passed in. - * @example - * // Select the first paragraph in the active editor - * tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.dom.select('p')[0]); - */ - select : function(node, content) { - var t = this, dom = t.dom, rng = dom.createRng(), idx; - - if (node) { - idx = dom.nodeIndex(node); - rng.setStart(node.parentNode, idx); - rng.setEnd(node.parentNode, idx + 1); - - // Find first/last text node or BR element - if (content) { - function setPoint(node, start) { - var walker = new tinymce.dom.TreeWalker(node, node); - - do { - // Text node - if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { - if (start) - rng.setStart(node, 0); - else - rng.setEnd(node, node.nodeValue.length); - - return; - } - - // BR element - if (node.nodeName == 'BR') { - if (start) - rng.setStartBefore(node); - else - rng.setEndBefore(node); - - return; - } - } while (node = (start ? walker.next() : walker.prev())); - }; - - setPoint(node, 1); - setPoint(node); - } - - t.setRng(rng); - } - - return node; - }, - - /** - * Returns true/false if the selection range is collapsed or not. Collapsed means if it's a caret or a larger selection. - * - * @method isCollapsed - * @return {Boolean} true/false state if the selection range is collapsed or not. Collapsed means if it's a caret or a larger selection. - */ - isCollapsed : function() { - var t = this, r = t.getRng(), s = t.getSel(); - - if (!r || r.item) - return false; - - if (r.compareEndPoints) - return r.compareEndPoints('StartToEnd', r) === 0; - - return !s || r.collapsed; - }, - - /** - * Collapse the selection to start or end of range. - * - * @method collapse - * @param {Boolean} to_start Optional boolean state if to collapse to end or not. Defaults to start. - */ - collapse : function(to_start) { - var self = this, rng = self.getRng(), node; - - // Control range on IE - if (rng.item) { - node = rng.item(0); - rng = self.win.document.body.createTextRange(); - rng.moveToElementText(node); - } - - rng.collapse(!!to_start); - self.setRng(rng); - }, - - /** - * Returns the browsers internal selection object. - * - * @method getSel - * @return {Selection} Internal browser selection object. - */ - getSel : function() { - var t = this, w = this.win; - - return w.getSelection ? w.getSelection() : w.document.selection; - }, - - /** - * Returns the browsers internal range object. - * - * @method getRng - * @param {Boolean} w3c Forces a compatible W3C range on IE. - * @return {Range} Internal browser range object. - * @see http://www.quirksmode.org/dom/range_intro.html - * @see http://www.dotvoid.com/2001/03/using-the-range-object-in-mozilla/ - */ - getRng : function(w3c) { - var t = this, s, r, elm, doc = t.win.document; - - // Found tridentSel object then we need to use that one - if (w3c && t.tridentSel) - return t.tridentSel.getRangeAt(0); - - try { - if (s = t.getSel()) - r = s.rangeCount > 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : doc.createRange()); - } catch (ex) { - // IE throws unspecified error here if TinyMCE is placed in a frame/iframe - } - - // We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet - if (tinymce.isIE && r && r.setStart && doc.selection.createRange().item) { - elm = doc.selection.createRange().item(0); - r = doc.createRange(); - r.setStartBefore(elm); - r.setEndAfter(elm); - } - - // No range found then create an empty one - // This can occur when the editor is placed in a hidden container element on Gecko - // Or on IE when there was an exception - if (!r) - r = doc.createRange ? doc.createRange() : doc.body.createTextRange(); - - if (t.selectedRange && t.explicitRange) { - if (r.compareBoundaryPoints(r.START_TO_START, t.selectedRange) === 0 && r.compareBoundaryPoints(r.END_TO_END, t.selectedRange) === 0) { - // Safari, Opera and Chrome only ever select text which causes the range to change. - // This lets us use the originally set range if the selection hasn't been changed by the user. - r = t.explicitRange; - } else { - t.selectedRange = null; - t.explicitRange = null; - } - } - - return r; - }, - - /** - * Changes the selection to the specified DOM range. - * - * @method setRng - * @param {Range} r Range to select. - */ - setRng : function(r) { - var s, t = this; - - if (!t.tridentSel) { - s = t.getSel(); - - if (s) { - t.explicitRange = r; - - try { - s.removeAllRanges(); - } catch (ex) { - // IE9 might throw errors here don't know why - } - - s.addRange(r); - t.selectedRange = s.getRangeAt(0); - } - } else { - // Is W3C Range - if (r.cloneRange) { - t.tridentSel.addRange(r); - return; - } - - // Is IE specific range - try { - r.select(); - } catch (ex) { - // Needed for some odd IE bug #1843306 - } - } - }, - - /** - * Sets the current selection to the specified DOM element. - * - * @method setNode - * @param {Element} n Element to set as the contents of the selection. - * @return {Element} Returns the element that got passed in. - * @example - * // Inserts a DOM node at current selection/caret location - * tinyMCE.activeEditor.selection.setNode(tinyMCE.activeEditor.dom.create('img', {src : 'some.gif', title : 'some title'})); - */ - setNode : function(n) { - var t = this; - - t.setContent(t.dom.getOuterHTML(n)); - - return n; - }, - - /** - * Returns the currently selected element or the common ancestor element for both start and end of the selection. - * - * @method getNode - * @return {Element} Currently selected element or common ancestor element. - * @example - * // Alerts the currently selected elements node name - * alert(tinyMCE.activeEditor.selection.getNode().nodeName); - */ - getNode : function() { - var t = this, rng = t.getRng(), sel = t.getSel(), elm, start = rng.startContainer, end = rng.endContainer; - - // Range maybe lost after the editor is made visible again - if (!rng) - return t.dom.getRoot(); - - if (rng.setStart) { - elm = rng.commonAncestorContainer; - - // Handle selection a image or other control like element such as anchors - if (!rng.collapsed) { - if (rng.startContainer == rng.endContainer) { - if (rng.endOffset - rng.startOffset < 2) { - if (rng.startContainer.hasChildNodes()) - elm = rng.startContainer.childNodes[rng.startOffset]; - } - } - - // If the anchor node is a element instead of a text node then return this element - //if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1) - // return sel.anchorNode.childNodes[sel.anchorOffset]; - - // Handle cases where the selection is immediately wrapped around a node and return that node instead of it's parent. - // This happens when you double click an underlined word in FireFox. - if (start.nodeType === 3 && end.nodeType === 3) { - function skipEmptyTextNodes(n, forwards) { - var orig = n; - while (n && n.nodeType === 3 && n.length === 0) { - n = forwards ? n.nextSibling : n.previousSibling; - } - return n || orig; - } - if (start.length === rng.startOffset) { - start = skipEmptyTextNodes(start.nextSibling, true); - } else { - start = start.parentNode; - } - if (rng.endOffset === 0) { - end = skipEmptyTextNodes(end.previousSibling, false); - } else { - end = end.parentNode; - } - - if (start && start === end) - return start; - } - } - - if (elm && elm.nodeType == 3) - return elm.parentNode; - - return elm; - } - - return rng.item ? rng.item(0) : rng.parentElement(); - }, - - getSelectedBlocks : function(st, en) { - var t = this, dom = t.dom, sb, eb, n, bl = []; - - sb = dom.getParent(st || t.getStart(), dom.isBlock); - eb = dom.getParent(en || t.getEnd(), dom.isBlock); - - if (sb) - bl.push(sb); - - if (sb && eb && sb != eb) { - n = sb; - - var walker = new tinymce.dom.TreeWalker(sb, dom.getRoot()); - while ((n = walker.next()) && n != eb) { - if (dom.isBlock(n)) - bl.push(n); - } - } - - if (eb && sb != eb) - bl.push(eb); - - return bl; - }, - - normalize : function() { - var self = this, rng, normalized; - - // Normalize only on non IE browsers for now - if (tinymce.isIE) - return; - - function normalizeEndPoint(start) { - var container, offset, walker, dom = self.dom, body = dom.getRoot(), node; - - container = rng[(start ? 'start' : 'end') + 'Container']; - offset = rng[(start ? 'start' : 'end') + 'Offset']; - - // If the container is a document move it to the body element - if (container.nodeType === 9) { - container = container.body; - offset = 0; - } - - // If the container is body try move it into the closest text node or position - // TODO: Add more logic here to handle element selection cases - if (container === body) { - // Resolve the index - if (container.hasChildNodes()) { - container = container.childNodes[Math.min(!start && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1)]; - offset = 0; - - // Don't walk into elements that doesn't have any child nodes like a IMG - if (container.hasChildNodes()) { - // Walk the DOM to find a text node to place the caret at or a BR - node = container; - walker = new tinymce.dom.TreeWalker(container, body); - do { - // Found a text node use that position - if (node.nodeType === 3) { - offset = start ? 0 : node.nodeValue.length - 1; - container = node; - break; - } - - // Found a BR element that we can place the caret before - if (node.nodeName === 'BR') { - offset = dom.nodeIndex(node); - container = node.parentNode; - break; - } - } while (node = (start ? walker.next() : walker.prev())); - - normalized = true; - } - } - } - - // Set endpoint if it was normalized - if (normalized) - rng['set' + (start ? 'Start' : 'End')](container, offset); - }; - - rng = self.getRng(); - - // Normalize the end points - normalizeEndPoint(true); - - if (rng.collapsed) - normalizeEndPoint(); - - // Set the selection if it was normalized - if (normalized) { - //console.log(self.dom.dumpRng(rng)); - self.setRng(rng); - } - }, - - destroy : function(s) { - var t = this; - - t.win = null; - - // Manual destroy then remove unload handler - if (!s) - tinymce.removeUnload(t.destroy); - }, - - // IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode - _fixIESelection : function() { - var dom = this.dom, doc = dom.doc, body = doc.body, started, startRng, htmlElm; - - // Make HTML element unselectable since we are going to handle selection by hand - doc.documentElement.unselectable = true; - - // Return range from point or null if it failed - function rngFromPoint(x, y) { - var rng = body.createTextRange(); - - try { - rng.moveToPoint(x, y); - } catch (ex) { - // IE sometimes throws and exception, so lets just ignore it - rng = null; - } - - return rng; - }; - - // Fires while the selection is changing - function selectionChange(e) { - var pointRng; - - // Check if the button is down or not - if (e.button) { - // Create range from mouse position - pointRng = rngFromPoint(e.x, e.y); - - if (pointRng) { - // Check if pointRange is before/after selection then change the endPoint - if (pointRng.compareEndPoints('StartToStart', startRng) > 0) - pointRng.setEndPoint('StartToStart', startRng); - else - pointRng.setEndPoint('EndToEnd', startRng); - - pointRng.select(); - } - } else - endSelection(); - } - - // Removes listeners - function endSelection() { - var rng = doc.selection.createRange(); - - // If the range is collapsed then use the last start range - if (startRng && !rng.item && rng.compareEndPoints('StartToEnd', rng) === 0) - startRng.select(); - - dom.unbind(doc, 'mouseup', endSelection); - dom.unbind(doc, 'mousemove', selectionChange); - startRng = started = 0; - }; - - // Detect when user selects outside BODY - dom.bind(doc, ['mousedown', 'contextmenu'], function(e) { - if (e.target.nodeName === 'HTML') { - if (started) - endSelection(); - - // Detect vertical scrollbar, since IE will fire a mousedown on the scrollbar and have target set as HTML - htmlElm = doc.documentElement; - if (htmlElm.scrollHeight > htmlElm.clientHeight) - return; - - started = 1; - // Setup start position - startRng = rngFromPoint(e.x, e.y); - if (startRng) { - // Listen for selection change events - dom.bind(doc, 'mouseup', endSelection); - dom.bind(doc, 'mousemove', selectionChange); - - dom.win.focus(); - startRng.select(); - } - } - }); - } - }); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/Serializer.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/Serializer.js deleted file mode 100644 index f3f087af2eff..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/Serializer.js +++ /dev/null @@ -1,379 +0,0 @@ -/** - * Serializer.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - /** - * This class is used to serialize DOM trees into a string. Consult the TinyMCE Wiki API for more details and examples on how to use this class. - * - * @class tinymce.dom.Serializer - */ - - /** - * Constucts a new DOM serializer class. - * - * @constructor - * @method Serializer - * @param {Object} settings Serializer settings object. - * @param {tinymce.dom.DOMUtils} dom DOMUtils instance reference. - * @param {tinymce.html.Schema} schema Optional schema reference. - */ - tinymce.dom.Serializer = function(settings, dom, schema) { - var onPreProcess, onPostProcess, isIE = tinymce.isIE, each = tinymce.each, htmlParser; - - // Support the old apply_source_formatting option - if (!settings.apply_source_formatting) - settings.indent = false; - - settings.remove_trailing_brs = true; - - // Default DOM and Schema if they are undefined - dom = dom || tinymce.DOM; - schema = schema || new tinymce.html.Schema(settings); - settings.entity_encoding = settings.entity_encoding || 'named'; - - /** - * This event gets executed before a HTML fragment gets serialized into a HTML string. This event enables you to do modifications to the DOM before the serialization occurs. It's important to know that the element that is getting serialized is cloned so it's not inside a document. - * - * @event onPreProcess - * @param {tinymce.dom.Serializer} sender object/Serializer instance that is serializing an element. - * @param {Object} args Object containing things like the current node. - * @example - * // Adds an observer to the onPreProcess event - * serializer.onPreProcess.add(function(se, o) { - * // Add a class to each paragraph - * se.dom.addClass(se.dom.select('p', o.node), 'myclass'); - * }); - */ - onPreProcess = new tinymce.util.Dispatcher(self); - - /** - * This event gets executed after a HTML fragment has been serialized into a HTML string. This event enables you to do modifications to the HTML string like regexp replaces etc. - * - * @event onPreProcess - * @param {tinymce.dom.Serializer} sender object/Serializer instance that is serializing an element. - * @param {Object} args Object containing things like the current contents. - * @example - * // Adds an observer to the onPostProcess event - * serializer.onPostProcess.add(function(se, o) { - * // Remove all paragraphs and replace with BR - * o.content = o.content.replace(/<p[^>]+>|<p>/g, ''); - * o.content = o.content.replace(/<\/p>/g, '<br />'); - * }); - */ - onPostProcess = new tinymce.util.Dispatcher(self); - - htmlParser = new tinymce.html.DomParser(settings, schema); - - // Convert move data-mce-src, data-mce-href and data-mce-style into nodes or process them if needed - htmlParser.addAttributeFilter('src,href,style', function(nodes, name) { - var i = nodes.length, node, value, internalName = 'data-mce-' + name, urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope, undef; - - while (i--) { - node = nodes[i]; - - value = node.attributes.map[internalName]; - if (value !== undef) { - // Set external name to internal value and remove internal - node.attr(name, value.length > 0 ? value : null); - node.attr(internalName, null); - } else { - // No internal attribute found then convert the value we have in the DOM - value = node.attributes.map[name]; - - if (name === "style") - value = dom.serializeStyle(dom.parseStyle(value), node.name); - else if (urlConverter) - value = urlConverter.call(urlConverterScope, value, name, node.name); - - node.attr(name, value.length > 0 ? value : null); - } - } - }); - - // Remove internal classes mceItem<..> - htmlParser.addAttributeFilter('class', function(nodes, name) { - var i = nodes.length, node, value; - - while (i--) { - node = nodes[i]; - value = node.attr('class').replace(/\s*mce(Item\w+|Selected)\s*/g, ''); - node.attr('class', value.length > 0 ? value : null); - } - }); - - // Remove bookmark elements - htmlParser.addAttributeFilter('data-mce-type', function(nodes, name, args) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - - if (node.attributes.map['data-mce-type'] === 'bookmark' && !args.cleanup) - node.remove(); - } - }); - - // Force script into CDATA sections and remove the mce- prefix also add comments around styles - htmlParser.addNodeFilter('script,style', function(nodes, name) { - var i = nodes.length, node, value; - - function trim(value) { - return value.replace(/(<!--\[CDATA\[|\]\]-->)/g, '\n') - .replace(/^[\r\n]*|[\r\n]*$/g, '') - .replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g, '') - .replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g, ''); - }; - - while (i--) { - node = nodes[i]; - value = node.firstChild ? node.firstChild.value : ''; - - if (name === "script") { - // Remove mce- prefix from script elements - node.attr('type', (node.attr('type') || 'text/javascript').replace(/^mce\-/, '')); - - if (value.length > 0) - node.firstChild.value = '// <![CDATA[\n' + trim(value) + '\n// ]]>'; - } else { - if (value.length > 0) - node.firstChild.value = '<!--\n' + trim(value) + '\n-->'; - } - } - }); - - // Convert comments to cdata and handle protected comments - htmlParser.addNodeFilter('#comment', function(nodes, name) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - - if (node.value.indexOf('[CDATA[') === 0) { - node.name = '#cdata'; - node.type = 4; - node.value = node.value.replace(/^\[CDATA\[|\]\]$/g, ''); - } else if (node.value.indexOf('mce:protected ') === 0) { - node.name = "#text"; - node.type = 3; - node.raw = true; - node.value = unescape(node.value).substr(14); - } - } - }); - - htmlParser.addNodeFilter('xml:namespace,input', function(nodes, name) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - if (node.type === 7) - node.remove(); - else if (node.type === 1) { - if (name === "input" && !("type" in node.attributes.map)) - node.attr('type', 'text'); - } - } - }); - - // Fix list elements, TODO: Replace this later - if (settings.fix_list_elements) { - htmlParser.addNodeFilter('ul,ol', function(nodes, name) { - var i = nodes.length, node, parentNode; - - while (i--) { - node = nodes[i]; - parentNode = node.parent; - - if (parentNode.name === 'ul' || parentNode.name === 'ol') { - if (node.prev && node.prev.name === 'li') { - node.prev.append(node); - } - } - } - }); - } - - // Remove internal data attributes - htmlParser.addAttributeFilter('data-mce-src,data-mce-href,data-mce-style', function(nodes, name) { - var i = nodes.length; - - while (i--) { - nodes[i].attr(name, null); - } - }); - - // Return public methods - return { - /** - * Schema instance that was used to when the Serializer was constructed. - * - * @field {tinymce.html.Schema} schema - */ - schema : schema, - - /** - * Adds a node filter function to the parser used by the serializer, the parser will collect the specified nodes by name - * and then execute the callback ones it has finished parsing the document. - * - * @example - * parser.addNodeFilter('p,h1', function(nodes, name) { - * for (var i = 0; i < nodes.length; i++) { - * console.log(nodes[i].name); - * } - * }); - * @method addNodeFilter - * @method {String} name Comma separated list of nodes to collect. - * @param {function} callback Callback function to execute once it has collected nodes. - */ - addNodeFilter : htmlParser.addNodeFilter, - - /** - * Adds a attribute filter function to the parser used by the serializer, the parser will collect nodes that has the specified attributes - * and then execute the callback ones it has finished parsing the document. - * - * @example - * parser.addAttributeFilter('src,href', function(nodes, name) { - * for (var i = 0; i < nodes.length; i++) { - * console.log(nodes[i].name); - * } - * }); - * @method addAttributeFilter - * @method {String} name Comma separated list of nodes to collect. - * @param {function} callback Callback function to execute once it has collected nodes. - */ - addAttributeFilter : htmlParser.addAttributeFilter, - - /** - * Fires when the Serializer does a preProcess on the contents. - * - * @event onPreProcess - * @param {tinymce.Editor} sender Editor instance. - * @param {Object} obj PreProcess object. - * @option {Node} node DOM node for the item being serialized. - * @option {String} format The specified output format normally "html". - * @option {Boolean} get Is true if the process is on a getContent operation. - * @option {Boolean} set Is true if the process is on a setContent operation. - * @option {Boolean} cleanup Is true if the process is on a cleanup operation. - */ - onPreProcess : onPreProcess, - - /** - * Fires when the Serializer does a postProcess on the contents. - * - * @event onPostProcess - * @param {tinymce.Editor} sender Editor instance. - * @param {Object} obj PreProcess object. - */ - onPostProcess : onPostProcess, - - /** - * Serializes the specified browser DOM node into a HTML string. - * - * @method serialize - * @param {DOMNode} node DOM node to serialize. - * @param {Object} args Arguments option that gets passed to event handlers. - */ - serialize : function(node, args) { - var impl, doc, oldDoc, htmlSerializer, content; - - // Explorer won't clone contents of script and style and the - // selected index of select elements are cleared on a clone operation. - if (isIE && dom.select('script,style,select,map').length > 0) { - content = node.innerHTML; - node = node.cloneNode(false); - dom.setHTML(node, content); - } else - node = node.cloneNode(true); - - // Nodes needs to be attached to something in WebKit/Opera - // Older builds of Opera crashes if you attach the node to an document created dynamically - // and since we can't feature detect a crash we need to sniff the acutal build number - // This fix will make DOM ranges and make Sizzle happy! - impl = node.ownerDocument.implementation; - if (impl.createHTMLDocument) { - // Create an empty HTML document - doc = impl.createHTMLDocument(""); - - // Add the element or it's children if it's a body element to the new document - each(node.nodeName == 'BODY' ? node.childNodes : [node], function(node) { - doc.body.appendChild(doc.importNode(node, true)); - }); - - // Grab first child or body element for serialization - if (node.nodeName != 'BODY') - node = doc.body.firstChild; - else - node = doc.body; - - // set the new document in DOMUtils so createElement etc works - oldDoc = dom.doc; - dom.doc = doc; - } - - args = args || {}; - args.format = args.format || 'html'; - - // Pre process - if (!args.no_events) { - args.node = node; - onPreProcess.dispatch(self, args); - } - - // Setup serializer - htmlSerializer = new tinymce.html.Serializer(settings, schema); - - // Parse and serialize HTML - args.content = htmlSerializer.serialize( - htmlParser.parse(args.getInner ? node.innerHTML : tinymce.trim(dom.getOuterHTML(node), args), args) - ); - - // Replace all BOM characters for now until we can find a better solution - if (!args.cleanup) - args.content = args.content.replace(/\uFEFF|\u200B/g, ''); - - // Post process - if (!args.no_events) - onPostProcess.dispatch(self, args); - - // Restore the old document if it was changed - if (oldDoc) - dom.doc = oldDoc; - - args.node = null; - - return args.content; - }, - - /** - * Adds valid elements rules to the serializers schema instance this enables you to specify things - * like what elements should be outputted and what attributes specific elements might have. - * Consult the Wiki for more details on this format. - * - * @method addRules - * @param {String} rules Valid elements rules string to add to schema. - */ - addRules : function(rules) { - schema.addValidElements(rules); - }, - - /** - * Sets the valid elements rules to the serializers schema instance this enables you to specify things - * like what elements should be outputted and what attributes specific elements might have. - * Consult the Wiki for more details on this format. - * - * @method setRules - * @param {String} rules Valid elements rules string. - */ - setRules : function(rules) { - schema.setValidElements(rules); - } - }; - }; -})(tinymce); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/Sizzle.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/Sizzle.js deleted file mode 100644 index 5312fa70373d..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/Sizzle.js +++ /dev/null @@ -1,1072 +0,0 @@ -// #ifndef jquery - -/* - * Sizzle CSS Selector Engine - v1.0 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){ - -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - done = 0, - toString = Object.prototype.toString, - hasDuplicate = false, - baseHasDuplicate = true; - -// Here we check if the JavaScript engine is using some sort of -// optimization where it does not always call our comparision -// function. If that is the case, discard the hasDuplicate value. -// Thus far that includes Google Chrome. -[0, 0].sort(function(){ - baseHasDuplicate = false; - return 0; -}); - -var Sizzle = function(selector, context, results, seed) { - results = results || []; - context = context || document; - - var origContext = context; - - if ( context.nodeType !== 1 && context.nodeType !== 9 ) { - return []; - } - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - var parts = [], m, set, checkSet, extra, prune = true, contextXML = Sizzle.isXML(context), - soFar = selector, ret, cur, pop, i; - - // Reset the position of the chunker regexp (start from head) - do { - chunker.exec(""); - m = chunker.exec(soFar); - - if ( m ) { - soFar = m[3]; - - parts.push( m[1] ); - - if ( m[2] ) { - extra = m[3]; - break; - } - } - } while ( m ); - - if ( parts.length > 1 && origPOS.exec( selector ) ) { - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { - set = posProcess( parts[0] + parts[1], context ); - } else { - set = Expr.relative[ parts[0] ] ? - [ context ] : - Sizzle( parts.shift(), context ); - - while ( parts.length ) { - selector = parts.shift(); - - if ( Expr.relative[ selector ] ) { - selector += parts.shift(); - } - - set = posProcess( selector, set ); - } - } - } else { - // Take a shortcut and set the context if the root selector is an ID - // (but not if it'll be faster if the inner selector is an ID) - if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && - Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { - ret = Sizzle.find( parts.shift(), context, contextXML ); - context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0]; - } - - if ( context ) { - ret = seed ? - { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); - set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; - - if ( parts.length > 0 ) { - checkSet = makeArray(set); - } else { - prune = false; - } - - while ( parts.length ) { - cur = parts.pop(); - pop = cur; - - if ( !Expr.relative[ cur ] ) { - cur = ""; - } else { - pop = parts.pop(); - } - - if ( pop == null ) { - pop = context; - } - - Expr.relative[ cur ]( checkSet, pop, contextXML ); - } - } else { - checkSet = parts = []; - } - } - - if ( !checkSet ) { - checkSet = set; - } - - if ( !checkSet ) { - Sizzle.error( cur || selector ); - } - - if ( toString.call(checkSet) === "[object Array]" ) { - if ( !prune ) { - results.push.apply( results, checkSet ); - } else if ( context && context.nodeType === 1 ) { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { - results.push( set[i] ); - } - } - } else { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && checkSet[i].nodeType === 1 ) { - results.push( set[i] ); - } - } - } - } else { - makeArray( checkSet, results ); - } - - if ( extra ) { - Sizzle( extra, origContext, results, seed ); - Sizzle.uniqueSort( results ); - } - - return results; -}; - -Sizzle.uniqueSort = function(results){ - if ( sortOrder ) { - hasDuplicate = baseHasDuplicate; - results.sort(sortOrder); - - if ( hasDuplicate ) { - for ( var i = 1; i < results.length; i++ ) { - if ( results[i] === results[i-1] ) { - results.splice(i--, 1); - } - } - } - } - - return results; -}; - -Sizzle.matches = function(expr, set){ - return Sizzle(expr, null, null, set); -}; - -Sizzle.find = function(expr, context, isXML){ - var set; - - if ( !expr ) { - return []; - } - - for ( var i = 0, l = Expr.order.length; i < l; i++ ) { - var type = Expr.order[i], match; - - if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { - var left = match[1]; - match.splice(1,1); - - if ( left.substr( left.length - 1 ) !== "\\" ) { - match[1] = (match[1] || "").replace(/\\/g, ""); - set = Expr.find[ type ]( match, context, isXML ); - if ( set != null ) { - expr = expr.replace( Expr.match[ type ], "" ); - break; - } - } - } - } - - if ( !set ) { - set = context.getElementsByTagName("*"); - } - - return {set: set, expr: expr}; -}; - -Sizzle.filter = function(expr, set, inplace, not){ - var old = expr, result = [], curLoop = set, match, anyFound, - isXMLFilter = set && set[0] && Sizzle.isXML(set[0]); - - while ( expr && set.length ) { - for ( var type in Expr.filter ) { - if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { - var filter = Expr.filter[ type ], found, item, left = match[1]; - anyFound = false; - - match.splice(1,1); - - if ( left.substr( left.length - 1 ) === "\\" ) { - continue; - } - - if ( curLoop === result ) { - result = []; - } - - if ( Expr.preFilter[ type ] ) { - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); - - if ( !match ) { - anyFound = found = true; - } else if ( match === true ) { - continue; - } - } - - if ( match ) { - for ( var i = 0; (item = curLoop[i]) != null; i++ ) { - if ( item ) { - found = filter( item, match, i, curLoop ); - var pass = not ^ !!found; - - if ( inplace && found != null ) { - if ( pass ) { - anyFound = true; - } else { - curLoop[i] = false; - } - } else if ( pass ) { - result.push( item ); - anyFound = true; - } - } - } - } - - if ( found !== undefined ) { - if ( !inplace ) { - curLoop = result; - } - - expr = expr.replace( Expr.match[ type ], "" ); - - if ( !anyFound ) { - return []; - } - - break; - } - } - } - - // Improper expression - if ( expr === old ) { - if ( anyFound == null ) { - Sizzle.error( expr ); - } else { - break; - } - } - - old = expr; - } - - return curLoop; -}; - -Sizzle.error = function( msg ) { - throw "Syntax error, unrecognized expression: " + msg; -}; - -var Expr = Sizzle.selectors = { - order: [ "ID", "NAME", "TAG" ], - match: { - ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ - }, - leftMatch: {}, - attrMap: { - "class": "className", - "for": "htmlFor" - }, - attrHandle: { - href: function(elem){ - return elem.getAttribute("href"); - } - }, - relative: { - "+": function(checkSet, part){ - var isPartStr = typeof part === "string", - isTag = isPartStr && !/\W/.test(part), - isPartStrNotTag = isPartStr && !isTag; - - if ( isTag ) { - part = part.toLowerCase(); - } - - for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { - if ( (elem = checkSet[i]) ) { - while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} - - checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? - elem || false : - elem === part; - } - } - - if ( isPartStrNotTag ) { - Sizzle.filter( part, checkSet, true ); - } - }, - ">": function(checkSet, part){ - var isPartStr = typeof part === "string", - elem, i = 0, l = checkSet.length; - - if ( isPartStr && !/\W/.test(part) ) { - part = part.toLowerCase(); - - for ( ; i < l; i++ ) { - elem = checkSet[i]; - if ( elem ) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; - } - } - } else { - for ( ; i < l; i++ ) { - elem = checkSet[i]; - if ( elem ) { - checkSet[i] = isPartStr ? - elem.parentNode : - elem.parentNode === part; - } - } - - if ( isPartStr ) { - Sizzle.filter( part, checkSet, true ); - } - } - }, - "": function(checkSet, part, isXML){ - var doneName = done++, checkFn = dirCheck, nodeCheck; - - if ( typeof part === "string" && !/\W/.test(part) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); - }, - "~": function(checkSet, part, isXML){ - var doneName = done++, checkFn = dirCheck, nodeCheck; - - if ( typeof part === "string" && !/\W/.test(part) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); - } - }, - find: { - ID: function(match, context, isXML){ - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - return m ? [m] : []; - } - }, - NAME: function(match, context){ - if ( typeof context.getElementsByName !== "undefined" ) { - var ret = [], results = context.getElementsByName(match[1]); - - for ( var i = 0, l = results.length; i < l; i++ ) { - if ( results[i].getAttribute("name") === match[1] ) { - ret.push( results[i] ); - } - } - - return ret.length === 0 ? null : ret; - } - }, - TAG: function(match, context){ - return context.getElementsByTagName(match[1]); - } - }, - preFilter: { - CLASS: function(match, curLoop, inplace, result, not, isXML){ - match = " " + match[1].replace(/\\/g, "") + " "; - - if ( isXML ) { - return match; - } - - for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { - if ( elem ) { - if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) { - if ( !inplace ) { - result.push( elem ); - } - } else if ( inplace ) { - curLoop[i] = false; - } - } - } - - return false; - }, - ID: function(match){ - return match[1].replace(/\\/g, ""); - }, - TAG: function(match, curLoop){ - return match[1].toLowerCase(); - }, - CHILD: function(match){ - if ( match[1] === "nth" ) { - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( - match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } - - // TODO: Move to normal caching system - match[0] = done++; - - return match; - }, - ATTR: function(match, curLoop, inplace, result, not, isXML){ - var name = match[1].replace(/\\/g, ""); - - if ( !isXML && Expr.attrMap[name] ) { - match[1] = Expr.attrMap[name]; - } - - if ( match[2] === "~=" ) { - match[4] = " " + match[4] + " "; - } - - return match; - }, - PSEUDO: function(match, curLoop, inplace, result, not){ - if ( match[1] === "not" ) { - // If we're dealing with a complex expression, or a simple one - if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { - match[3] = Sizzle(match[3], null, null, curLoop); - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - if ( !inplace ) { - result.push.apply( result, ret ); - } - return false; - } - } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { - return true; - } - - return match; - }, - POS: function(match){ - match.unshift( true ); - return match; - } - }, - filters: { - enabled: function(elem){ - return elem.disabled === false && elem.type !== "hidden"; - }, - disabled: function(elem){ - return elem.disabled === true; - }, - checked: function(elem){ - return elem.checked === true; - }, - selected: function(elem){ - // Accessing this property makes selected-by-default - // options in Safari work properly - elem.parentNode.selectedIndex; - return elem.selected === true; - }, - parent: function(elem){ - return !!elem.firstChild; - }, - empty: function(elem){ - return !elem.firstChild; - }, - has: function(elem, i, match){ - return !!Sizzle( match[3], elem ).length; - }, - header: function(elem){ - return (/h\d/i).test( elem.nodeName ); - }, - text: function(elem){ - return "text" === elem.type; - }, - radio: function(elem){ - return "radio" === elem.type; - }, - checkbox: function(elem){ - return "checkbox" === elem.type; - }, - file: function(elem){ - return "file" === elem.type; - }, - password: function(elem){ - return "password" === elem.type; - }, - submit: function(elem){ - return "submit" === elem.type; - }, - image: function(elem){ - return "image" === elem.type; - }, - reset: function(elem){ - return "reset" === elem.type; - }, - button: function(elem){ - return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; - }, - input: function(elem){ - return (/input|select|textarea|button/i).test(elem.nodeName); - } - }, - setFilters: { - first: function(elem, i){ - return i === 0; - }, - last: function(elem, i, match, array){ - return i === array.length - 1; - }, - even: function(elem, i){ - return i % 2 === 0; - }, - odd: function(elem, i){ - return i % 2 === 1; - }, - lt: function(elem, i, match){ - return i < match[3] - 0; - }, - gt: function(elem, i, match){ - return i > match[3] - 0; - }, - nth: function(elem, i, match){ - return match[3] - 0 === i; - }, - eq: function(elem, i, match){ - return match[3] - 0 === i; - } - }, - filter: { - PSEUDO: function(elem, match, i, array){ - var name = match[1], filter = Expr.filters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } else if ( name === "contains" ) { - return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; - } else if ( name === "not" ) { - var not = match[3]; - - for ( var j = 0, l = not.length; j < l; j++ ) { - if ( not[j] === elem ) { - return false; - } - } - - return true; - } else { - Sizzle.error( "Syntax error, unrecognized expression: " + name ); - } - }, - CHILD: function(elem, match){ - var type = match[1], node = elem; - switch (type) { - case 'only': - case 'first': - while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - if ( type === "first" ) { - return true; - } - node = elem; - case 'last': - while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - return true; - case 'nth': - var first = match[2], last = match[3]; - - if ( first === 1 && last === 0 ) { - return true; - } - - var doneName = match[0], - parent = elem.parentNode; - - if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { - var count = 0; - for ( node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType === 1 ) { - node.nodeIndex = ++count; - } - } - parent.sizcache = doneName; - } - - var diff = elem.nodeIndex - last; - if ( first === 0 ) { - return diff === 0; - } else { - return ( diff % first === 0 && diff / first >= 0 ); - } - } - }, - ID: function(elem, match){ - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - TAG: function(elem, match){ - return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; - }, - CLASS: function(elem, match){ - return (" " + (elem.className || elem.getAttribute("class")) + " ") - .indexOf( match ) > -1; - }, - ATTR: function(elem, match){ - var name = match[1], - result = Expr.attrHandle[ name ] ? - Expr.attrHandle[ name ]( elem ) : - elem[ name ] != null ? - elem[ name ] : - elem.getAttribute( name ), - value = result + "", - type = match[2], - check = match[4]; - - return result == null ? - type === "!=" : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !check ? - value && result !== false : - type === "!=" ? - value !== check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - POS: function(elem, match, i, array){ - var name = match[2], filter = Expr.setFilters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } - } - } -}; - -var origPOS = Expr.match.POS, - fescape = function(all, num){ - return "\\" + (num - 0 + 1); - }; - -for ( var type in Expr.match ) { - Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); - Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); -} - -var makeArray = function(array, results) { - array = Array.prototype.slice.call( array, 0 ); - - if ( results ) { - results.push.apply( results, array ); - return results; - } - - return array; -}; - -// Perform a simple check to determine if the browser is capable of -// converting a NodeList to an array using builtin methods. -// Also verifies that the returned array holds DOM nodes -// (which is not the case in the Blackberry browser) -try { - Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; - -// Provide a fallback method if it does not work -} catch(e){ - makeArray = function(array, results) { - var ret = results || [], i = 0; - - if ( toString.call(array) === "[object Array]" ) { - Array.prototype.push.apply( ret, array ); - } else { - if ( typeof array.length === "number" ) { - for ( var l = array.length; i < l; i++ ) { - ret.push( array[i] ); - } - } else { - for ( ; array[i]; i++ ) { - ret.push( array[i] ); - } - } - } - - return ret; - }; -} - -var sortOrder; - -if ( document.documentElement.compareDocumentPosition ) { - sortOrder = function( a, b ) { - if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { - if ( a == b ) { - hasDuplicate = true; - } - return a.compareDocumentPosition ? -1 : 1; - } - - var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} else if ( "sourceIndex" in document.documentElement ) { - sortOrder = function( a, b ) { - if ( !a.sourceIndex || !b.sourceIndex ) { - if ( a == b ) { - hasDuplicate = true; - } - return a.sourceIndex ? -1 : 1; - } - - var ret = a.sourceIndex - b.sourceIndex; - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} else if ( document.createRange ) { - sortOrder = function( a, b ) { - if ( !a.ownerDocument || !b.ownerDocument ) { - if ( a == b ) { - hasDuplicate = true; - } - return a.ownerDocument ? -1 : 1; - } - - var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); - aRange.setStart(a, 0); - aRange.setEnd(a, 0); - bRange.setStart(b, 0); - bRange.setEnd(b, 0); - var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} - -// Utility function for retreiving the text value of an array of DOM nodes -Sizzle.getText = function( elems ) { - var ret = "", elem; - - for ( var i = 0; elems[i]; i++ ) { - elem = elems[i]; - - // Get the text from text nodes and CDATA nodes - if ( elem.nodeType === 3 || elem.nodeType === 4 ) { - ret += elem.nodeValue; - - // Traverse everything else, except comment nodes - } else if ( elem.nodeType !== 8 ) { - ret += Sizzle.getText( elem.childNodes ); - } - } - - return ret; -}; - -// Check to see if the browser returns elements by name when -// querying by getElementById (and provide a workaround) -(function(){ - // We're going to inject a fake input element with a specified name - var form = document.createElement("div"), - id = "script" + (new Date()).getTime(); - form.innerHTML = "<a name='" + id + "'/>"; - - // Inject it into the root element, check its status, and remove it quickly - var root = document.documentElement; - root.insertBefore( form, root.firstChild ); - - // The workaround has to do additional checks after a getElementById - // Which slows things down for other browsers (hence the branching) - if ( document.getElementById( id ) ) { - Expr.find.ID = function(match, context, isXML){ - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; - } - }; - - Expr.filter.ID = function(elem, match){ - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); - return elem.nodeType === 1 && node && node.nodeValue === match; - }; - } - - root.removeChild( form ); - root = form = null; // release memory in IE -})(); - -(function(){ - // Check to see if the browser returns only elements - // when doing getElementsByTagName("*") - - // Create a fake element - var div = document.createElement("div"); - div.appendChild( document.createComment("") ); - - // Make sure no comments are found - if ( div.getElementsByTagName("*").length > 0 ) { - Expr.find.TAG = function(match, context){ - var results = context.getElementsByTagName(match[1]); - - // Filter out possible comments - if ( match[1] === "*" ) { - var tmp = []; - - for ( var i = 0; results[i]; i++ ) { - if ( results[i].nodeType === 1 ) { - tmp.push( results[i] ); - } - } - - results = tmp; - } - - return results; - }; - } - - // Check to see if an attribute returns normalized href attributes - div.innerHTML = "<a href='#'></a>"; - if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && - div.firstChild.getAttribute("href") !== "#" ) { - Expr.attrHandle.href = function(elem){ - return elem.getAttribute("href", 2); - }; - } - - div = null; // release memory in IE -})(); - -if ( document.querySelectorAll ) { - (function(){ - var oldSizzle = Sizzle, div = document.createElement("div"); - div.innerHTML = "<p class='TEST'></p>"; - - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { - return; - } - - Sizzle = function(query, context, extra, seed){ - context = context || document; - - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if ( !seed && context.nodeType === 9 && !Sizzle.isXML(context) ) { - try { - return makeArray( context.querySelectorAll(query), extra ); - } catch(e){} - } - - return oldSizzle(query, context, extra, seed); - }; - - for ( var prop in oldSizzle ) { - Sizzle[ prop ] = oldSizzle[ prop ]; - } - - div = null; // release memory in IE - })(); -} - -(function(){ - var div = document.createElement("div"); - - div.innerHTML = "<div class='test e'></div><div class='test'></div>"; - - // Opera can't find a second classname (in 9.6) - // Also, make sure that getElementsByClassName actually exists - if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { - return; - } - - // Safari caches class attributes, doesn't catch changes (in 3.2) - div.lastChild.className = "e"; - - if ( div.getElementsByClassName("e").length === 1 ) { - return; - } - - Expr.order.splice(1, 0, "CLASS"); - Expr.find.CLASS = function(match, context, isXML) { - if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { - return context.getElementsByClassName(match[1]); - } - }; - - div = null; // release memory in IE -})(); - -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - elem = elem[dir]; - var match = false; - - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 && !isXML ){ - elem.sizcache = doneName; - elem.sizset = i; - } - - if ( elem.nodeName.toLowerCase() === cur ) { - match = elem; - break; - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - elem = elem[dir]; - var match = false; - - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 ) { - if ( !isXML ) { - elem.sizcache = doneName; - elem.sizset = i; - } - if ( typeof cur !== "string" ) { - if ( elem === cur ) { - match = true; - break; - } - - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { - match = elem; - break; - } - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -Sizzle.contains = document.compareDocumentPosition ? function(a, b){ - return !!(a.compareDocumentPosition(b) & 16); -} : function(a, b){ - return a !== b && (a.contains ? a.contains(b) : true); -}; - -Sizzle.isXML = function(elem){ - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -var posProcess = function(selector, context){ - var tmpSet = [], later = "", match, - root = context.nodeType ? [context] : context; - - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ( (match = Expr.match.PSEUDO.exec( selector )) ) { - later += match[0]; - selector = selector.replace( Expr.match.PSEUDO, "" ); - } - - selector = Expr.relative[selector] ? selector + "*" : selector; - - for ( var i = 0, l = root.length; i < l; i++ ) { - Sizzle( selector, root[i], tmpSet ); - } - - return Sizzle.filter( later, tmpSet ); -}; - -// EXPOSE - -window.tinymce.dom.Sizzle = Sizzle; - -})(); - -// #endif diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/TreeWalker.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/TreeWalker.js deleted file mode 100644 index ca92df4ad6d9..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/TreeWalker.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * TreeWalker.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -tinymce.dom.TreeWalker = function(start_node, root_node) { - var node = start_node; - - function findSibling(node, start_name, sibling_name, shallow) { - var sibling, parent; - - if (node) { - // Walk into nodes if it has a start - if (!shallow && node[start_name]) - return node[start_name]; - - // Return the sibling if it has one - if (node != root_node) { - sibling = node[sibling_name]; - if (sibling) - return sibling; - - // Walk up the parents to look for siblings - for (parent = node.parentNode; parent && parent != root_node; parent = parent.parentNode) { - sibling = parent[sibling_name]; - if (sibling) - return sibling; - } - } - } - }; - - /** - * Returns the current node. - * - * @return {Node} Current node where the walker is. - */ - this.current = function() { - return node; - }; - - /** - * Walks to the next node in tree. - * - * @return {Node} Current node where the walker is after moving to the next node. - */ - this.next = function(shallow) { - return (node = findSibling(node, 'firstChild', 'nextSibling', shallow)); - }; - - /** - * Walks to the previous node in tree. - * - * @return {Node} Current node where the walker is after moving to the previous node. - */ - this.prev = function(shallow) { - return (node = findSibling(node, 'lastChild', 'previousSibling', shallow)); - }; -}; diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/TridentSelection.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/TridentSelection.js deleted file mode 100644 index 6fa231dc9c71..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/TridentSelection.js +++ /dev/null @@ -1,445 +0,0 @@ -/** - * TridentSelection.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - function Selection(selection) { - var self = this, dom = selection.dom, TRUE = true, FALSE = false; - - function getPosition(rng, start) { - var checkRng, startIndex = 0, endIndex, inside, - children, child, offset, index, position = -1, parent; - - // Setup test range, collapse it and get the parent - checkRng = rng.duplicate(); - checkRng.collapse(start); - parent = checkRng.parentElement(); - - // Check if the selection is within the right document - if (parent.ownerDocument !== selection.dom.doc) - return; - - // IE will report non editable elements as it's parent so look for an editable one - while (parent.contentEditable === "false") { - parent = parent.parentNode; - } - - // If parent doesn't have any children then return that we are inside the element - if (!parent.hasChildNodes()) { - return {node : parent, inside : 1}; - } - - // Setup node list and endIndex - children = parent.children; - endIndex = children.length - 1; - - // Perform a binary search for the position - while (startIndex <= endIndex) { - index = Math.floor((startIndex + endIndex) / 2); - - // Move selection to node and compare the ranges - child = children[index]; - checkRng.moveToElementText(child); - position = checkRng.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', rng); - - // Before/after or an exact match - if (position > 0) { - endIndex = index - 1; - } else if (position < 0) { - startIndex = index + 1; - } else { - return {node : child}; - } - } - - // Check if child position is before or we didn't find a position - if (position < 0) { - // No element child was found use the parent element and the offset inside that - if (!child) { - checkRng.moveToElementText(parent); - checkRng.collapse(true); - child = parent; - inside = true; - } else - checkRng.collapse(false); - - checkRng.setEndPoint(start ? 'EndToStart' : 'EndToEnd', rng); - - // Fix for edge case: <div style="width: 100px; height:100px;"><table>..</table>ab|c</div> - if (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) > 0) { - checkRng = rng.duplicate(); - checkRng.collapse(start); - - offset = -1; - while (parent == checkRng.parentElement()) { - if (checkRng.move('character', -1) == 0) - break; - - offset++; - } - } - - offset = offset || checkRng.text.replace('\r\n', ' ').length; - } else { - // Child position is after the selection endpoint - checkRng.collapse(true); - checkRng.setEndPoint(start ? 'StartToStart' : 'StartToEnd', rng); - - // Get the length of the text to find where the endpoint is relative to it's container - offset = checkRng.text.replace('\r\n', ' ').length; - } - - return {node : child, position : position, offset : offset, inside : inside}; - }; - - // Returns a W3C DOM compatible range object by using the IE Range API - function getRange() { - var ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark, fail; - - // If selection is outside the current document just return an empty range - element = ieRange.item ? ieRange.item(0) : ieRange.parentElement(); - if (element.ownerDocument != dom.doc) - return domRange; - - collapsed = selection.isCollapsed(); - - // Handle control selection - if (ieRange.item) { - domRange.setStart(element.parentNode, dom.nodeIndex(element)); - domRange.setEnd(domRange.startContainer, domRange.startOffset + 1); - - return domRange; - } - - function findEndPoint(start) { - var endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue; - - container = endPoint.node; - offset = endPoint.offset; - - if (endPoint.inside && !container.hasChildNodes()) { - domRange[start ? 'setStart' : 'setEnd'](container, 0); - return; - } - - if (offset === undef) { - domRange[start ? 'setStartBefore' : 'setEndAfter'](container); - return; - } - - if (endPoint.position < 0) { - sibling = endPoint.inside ? container.firstChild : container.nextSibling; - - if (!sibling) { - domRange[start ? 'setStartAfter' : 'setEndAfter'](container); - return; - } - - if (!offset) { - if (sibling.nodeType == 3) - domRange[start ? 'setStart' : 'setEnd'](sibling, 0); - else - domRange[start ? 'setStartBefore' : 'setEndBefore'](sibling); - - return; - } - - // Find the text node and offset - while (sibling) { - nodeValue = sibling.nodeValue; - textNodeOffset += nodeValue.length; - - // We are at or passed the position we where looking for - if (textNodeOffset >= offset) { - container = sibling; - textNodeOffset -= offset; - textNodeOffset = nodeValue.length - textNodeOffset; - break; - } - - sibling = sibling.nextSibling; - } - } else { - // Find the text node and offset - sibling = container.previousSibling; - - if (!sibling) - return domRange[start ? 'setStartBefore' : 'setEndBefore'](container); - - // If there isn't any text to loop then use the first position - if (!offset) { - if (container.nodeType == 3) - domRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length); - else - domRange[start ? 'setStartAfter' : 'setEndAfter'](sibling); - - return; - } - - while (sibling) { - textNodeOffset += sibling.nodeValue.length; - - // We are at or passed the position we where looking for - if (textNodeOffset >= offset) { - container = sibling; - textNodeOffset -= offset; - break; - } - - sibling = sibling.previousSibling; - } - } - - domRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset); - }; - - try { - // Find start point - findEndPoint(true); - - // Find end point if needed - if (!collapsed) - findEndPoint(); - } catch (ex) { - // IE has a nasty bug where text nodes might throw "invalid argument" when you - // access the nodeValue or other properties of text nodes. This seems to happend when - // text nodes are split into two nodes by a delete/backspace call. So lets detect it and try to fix it. - if (ex.number == -2147024809) { - // Get the current selection - bookmark = self.getBookmark(2); - - // Get start element - tmpRange = ieRange.duplicate(); - tmpRange.collapse(true); - element = tmpRange.parentElement(); - - // Get end element - if (!collapsed) { - tmpRange = ieRange.duplicate(); - tmpRange.collapse(false); - element2 = tmpRange.parentElement(); - element2.innerHTML = element2.innerHTML; - } - - // Remove the broken elements - element.innerHTML = element.innerHTML; - - // Restore the selection - self.moveToBookmark(bookmark); - - // Since the range has moved we need to re-get it - ieRange = selection.getRng(); - - // Find start point - findEndPoint(true); - - // Find end point if needed - if (!collapsed) - findEndPoint(); - } else - throw ex; // Throw other errors - } - - return domRange; - }; - - this.getBookmark = function(type) { - var rng = selection.getRng(), start, end, bookmark = {}; - - function getIndexes(node) { - var node, parent, root, children, i, indexes = []; - - parent = node.parentNode; - root = dom.getRoot().parentNode; - - while (parent != root && parent.nodeType !== 9) { - children = parent.children; - - i = children.length; - while (i--) { - if (node === children[i]) { - indexes.push(i); - break; - } - } - - node = parent; - parent = parent.parentNode; - } - - return indexes; - }; - - function getBookmarkEndPoint(start) { - var position; - - position = getPosition(rng, start); - if (position) { - return { - position : position.position, - offset : position.offset, - indexes : getIndexes(position.node), - inside : position.inside - }; - } - }; - - // Non ubstructive bookmark - if (type === 2) { - // Handle text selection - if (!rng.item) { - bookmark.start = getBookmarkEndPoint(true); - - if (!selection.isCollapsed()) - bookmark.end = getBookmarkEndPoint(); - } else - bookmark.start = {ctrl : true, indexes : getIndexes(rng.item(0))}; - } - - return bookmark; - }; - - this.moveToBookmark = function(bookmark) { - var rng, body = dom.doc.body; - - function resolveIndexes(indexes) { - var node, i, idx, children; - - node = dom.getRoot(); - for (i = indexes.length - 1; i >= 0; i--) { - children = node.children; - idx = indexes[i]; - - if (idx <= children.length - 1) { - node = children[idx]; - } - } - - return node; - }; - - function setBookmarkEndPoint(start) { - var endPoint = bookmark[start ? 'start' : 'end'], moveLeft, moveRng, undef; - - if (endPoint) { - moveLeft = endPoint.position > 0; - - moveRng = body.createTextRange(); - moveRng.moveToElementText(resolveIndexes(endPoint.indexes)); - - offset = endPoint.offset; - if (offset !== undef) { - moveRng.collapse(endPoint.inside || moveLeft); - moveRng.moveStart('character', moveLeft ? -offset : offset); - } else - moveRng.collapse(start); - - rng.setEndPoint(start ? 'StartToStart' : 'EndToStart', moveRng); - - if (start) - rng.collapse(true); - } - }; - - if (bookmark.start) { - if (bookmark.start.ctrl) { - rng = body.createControlRange(); - rng.addElement(resolveIndexes(bookmark.start.indexes)); - rng.select(); - } else { - rng = body.createTextRange(); - setBookmarkEndPoint(true); - setBookmarkEndPoint(); - rng.select(); - } - } - }; - - this.addRange = function(rng) { - var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, doc = selection.dom.doc, body = doc.body; - - function setEndPoint(start) { - var container, offset, marker, tmpRng, nodes; - - marker = dom.create('a'); - container = start ? startContainer : endContainer; - offset = start ? startOffset : endOffset; - tmpRng = ieRng.duplicate(); - - if (container == doc || container == doc.documentElement) { - container = body; - offset = 0; - } - - if (container.nodeType == 3) { - container.parentNode.insertBefore(marker, container); - tmpRng.moveToElementText(marker); - tmpRng.moveStart('character', offset); - dom.remove(marker); - ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng); - } else { - nodes = container.childNodes; - - if (nodes.length) { - if (offset >= nodes.length) { - dom.insertAfter(marker, nodes[nodes.length - 1]); - } else { - container.insertBefore(marker, nodes[offset]); - } - - tmpRng.moveToElementText(marker); - } else { - // Empty node selection for example <div>|</div> - marker = doc.createTextNode('\uFEFF'); - container.appendChild(marker); - tmpRng.moveToElementText(marker.parentNode); - tmpRng.collapse(TRUE); - } - - ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng); - dom.remove(marker); - } - } - - // Setup some shorter versions - startContainer = rng.startContainer; - startOffset = rng.startOffset; - endContainer = rng.endContainer; - endOffset = rng.endOffset; - ieRng = body.createTextRange(); - - // If single element selection then try making a control selection out of it - if (startContainer == endContainer && startContainer.nodeType == 1 && startOffset == endOffset - 1) { - if (startOffset == endOffset - 1) { - try { - ctrlRng = body.createControlRange(); - ctrlRng.addElement(startContainer.childNodes[startOffset]); - ctrlRng.select(); - return; - } catch (ex) { - // Ignore - } - } - } - - // Set start/end point of selection - setEndPoint(true); - setEndPoint(); - - // Select the new range and scroll it into view - ieRng.select(); - }; - - // Expose range method - this.getRangeAt = getRange; - }; - - // Expose the selection object - tinymce.dom.TridentSelection = Selection; -})(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/firebug/FIREBUG.LICENSE b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/firebug/FIREBUG.LICENSE deleted file mode 100644 index 8b9c44ab721d..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/firebug/FIREBUG.LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -Software License Agreement (BSD License) - -Copyright (c) 2007, Parakey Inc. -All rights reserved. - -Redistribution and use of this software in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* 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. - -* Neither the name of Parakey Inc. nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of Parakey Inc. - -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 OWNER 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. \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/firebug/firebug-lite.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/firebug/firebug-lite.js deleted file mode 100644 index fb73a83cd6fb..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/firebug/firebug-lite.js +++ /dev/null @@ -1,2518 +0,0 @@ -var firebug = { - version:[1.23,20090309], - el:{}, - env:{ - "cache":{}, - "extConsole":null, - "css":"http://getfirebug.com/releases/lite/1.2/firebug-lite.css", - "debug":true, - "detectFirebug":true, - "dIndex":"console", - "height":295, - "hideDOMFunctions":false, - "init":false, - "isPopup":false, - "liteFilename":"firebug-lite.js", - "minimized":false, - "openInPopup": false, - "override":true, - "ml":false, - "popupWin":null, - "showIconWhenHidden":true, - "targetWindow":undefined, - "popupTop":1, - "popupLeft":1, - "popupWidth":undefined, - "popupHeight":undefined - }, - initConsole:function(){ - /* - * initialize the console - user defined values are not available within this method because FBLite is not yet initialized - */ - var command; - try{ - if((!window.console || (window.console && !window.console.firebug)) || (firebug.env.override && !(/Firefox\/3/i.test(navigator.userAgent)))){ - window.console = { "provider":"Firebug Lite" }; - - for(command in firebug.d.console.cmd){ - window.console[command] = firebug.lib.util.Curry(firebug.d.console.run,window,command); - }; - } - /*window.onerror = function(_message,_file,_line){ - firebug.d.console.run('error',firebug.lib.util.String.format('{0} ({1},{2})',_message,firebug.getFileName(_file),_line)); - };*/ - } catch(e){} - }, - overrideConsole:function(){ - with (firebug){ - env.override=true; - try{ - env.extConsole=window.console; - } catch(e){} - initConsole(); - } - }, - restoreConsole:function(){ - with(firebug){ - if(env.extConsole){ - env.override=false; - try{ - window.console=env.extConsole; - } catch(e){} - env.extConsole=null; - } - } - }, - init:function(_css){ - var iconTitle = "Click here or press F12, (CTRL|CMD)+SHIFT+L or SHIFT+ENTER to show Firebug Lite. CTRL|CMD click this icon to hide it."; - - with(firebug){ - if(document.getElementsByTagName('html')[0].attributes.getNamedItem('debug')){ - env.debug = document.getElementsByTagName('html')[0].attributes.getNamedItem('debug').nodeValue !== "false"; - } - - if(env.isPopup) { - env.openInPopup = false; - env.targetWindow = window.opener; - env.popupWidth = window.opener.firebug.env.popupWidth || window.opener.firebug.lib.util.GetViewport().width; - env.popupHeight = window.opener.firebug.env.popupHeight || window.opener.firebug.lib.util.GetViewport().height; - } else { - env.targetWindow = window; - env.popupWidth = env.popupWidth || lib.util.GetViewport().width; - env.popupHeight = env.popupHeight || lib.util.GetViewport().height; - } - - settings.readCookie(); - - if(env.init || (env.detectFirebug && window.console && window.console.firebug)) { - return; - } - - document.getElementsByTagName("head")[0].appendChild( - new lib.element("link").attribute.set("rel","stylesheet").attribute.set("type","text/css").attribute.set("href",env.css).element - ); - - if(env.override){ - overrideConsole(); - } - - /* - * Firebug Icon - */ - el.firebugIcon = new lib.element("div").attribute.set("id","firebugIconDiv").attribute.set("title",iconTitle).attribute.set("alt",iconTitle).event.addListener("mousedown",win.iconClicked).insert(document.body); - - /* - * main interface - */ - el.content = {}; - el.mainiframe = new lib.element("IFRAME").attribute.set("id","FirebugIFrame").environment.addStyle({ "display":"none", "width":lib.util.GetViewport().width+"px" }).insert(document.body); - el.main = new lib.element("DIV").attribute.set("id","Firebug").environment.addStyle({ "display":"none", "width":lib.util.GetViewport().width+"px" }).insert(document.body); - if(!env.isPopup){ - el.resizer = new lib.element("DIV").attribute.addClass("Resizer").event.addListener("mousedown",win.resizer.start).insert(el.main); - } - el.header = new lib.element("DIV").attribute.addClass("Header").insert(el.main); - el.left = {}; - el.left.container = new lib.element("DIV").attribute.addClass("Left").insert(el.main); - el.right = {}; - el.right.container = new lib.element("DIV").attribute.addClass("Right").insert(el.main); - el.main.child.add(new lib.element("DIV").attribute.addClass('Clear')); - - /* - * buttons - */ - el.button = {}; - el.button.container = new lib.element("DIV").attribute.addClass("ButtonContainer").insert(el.header); - el.button.logo = new lib.element("A").attribute.set("title","Firebug Lite").attribute.set("target","_blank").attribute.set("href","http://getfirebug.com/lite.html").update(" ").attribute.addClass("Button Logo").insert(el.button.container); - el.button.inspect = new lib.element("A").attribute.addClass("Button").event.addListener("click",env.targetWindow.firebug.d.inspector.toggle).update("Inspect").insert(el.button.container); - el.button.dock = new lib.element("A").attribute.addClass("Button Dock").event.addListener("click", win.dock).insert(el.button.container); - el.button.newWindow = new lib.element("A").attribute.addClass("Button NewWindow").event.addListener("click", win.newWindow).insert(el.button.container); - - if(!env.isPopup){ - el.button.maximize = new lib.element("A").attribute.addClass("Button Maximize").event.addListener("click",win.maximize).insert(el.button.container); - el.button.minimize = new lib.element("A").attribute.addClass("Button Minimize").event.addListener("click",win.minimize).insert(el.button.container); - el.button.close = new lib.element("A").attribute.addClass("Button Close").event.addListener("click",win.hide).insert(el.button.container); - } - - if(lib.env.ie||lib.env.webkit){ - el.button.container.environment.addStyle({ "paddingTop":"12px" }); - } - - /* - * navigation - */ - el.nav = {}; - el.nav.container = new lib.element("DIV").attribute.addClass("Nav").insert(el.left.container); - el.nav.console = new lib.element("A").attribute.addClass("Tab Selected").event.addListener("click",lib.util.Curry(d.navigate,window,"console")).update("Console").insert(el.nav.container); - el.nav.html = new lib.element("A").attribute.addClass("Tab").update("HTML").event.addListener("click",lib.util.Curry(d.navigate,window,"html")).insert(el.nav.container); - el.nav.css = new lib.element("A").attribute.addClass("Tab").update("CSS").event.addListener("click",lib.util.Curry(d.navigate,window,"css")).insert(el.nav.container); - if(!env.isPopup){ - el.nav.scripts = new lib.element("A").attribute.addClass("Tab").update("Script").event.addListener("click",lib.util.Curry(d.navigate,window,"scripts")).insert(el.nav.container); - } - el.nav.dom = new lib.element("A").attribute.addClass("Tab").update("DOM").event.addListener("click",lib.util.Curry(d.navigate,env.targetWindow,"dom")).insert(el.nav.container); - el.nav.xhr = new lib.element("A").attribute.addClass("Tab").update("XHR").event.addListener("click",lib.util.Curry(d.navigate,window,"xhr")).insert(el.nav.container); - el.nav.optionsdiv = new lib.element("DIV").attribute.addClass("Settings").insert(el.nav.container); - el.nav.options = new lib.element("A").attribute.addClass("Tab").update("Options ∨").event.addListener("click", settings.toggle).insert(el.nav.optionsdiv); - - /* - * inspector - */ - el.borderInspector = new lib.element("DIV").attribute.set("id","FirebugBorderInspector").event.addListener("click",listen.inspector).insert(document.body); - el.bgInspector = new lib.element("DIV").attribute.set("id","FirebugBGInspector").insert(document.body); - - /* - * console - */ - el.left.console = {}; - el.left.console.container = new lib.element("DIV").attribute.addClass("Console").insert(el.left.container); - el.left.console.mlButton = new lib.element("A").attribute.addClass("MLButton").event.addListener("click",d.console.toggleML).insert(el.left.console.container); - el.left.console.monitor = new lib.element("DIV").insert( - new lib.element("DIV").attribute.addClass("Monitor").insert(el.left.console.container) - ); - el.left.console.container.child.add( - new lib.element("DIV").attribute.addClass("InputArrow").update(">>>") - ); - el.left.console.input = new lib.element("INPUT").attribute.set("type","text").attribute.addClass("Input").event.addListener("keydown",listen.consoleTextbox).insert( - new lib.element("DIV").attribute.addClass("InputContainer").insert(el.left.console.container) - ); - - el.right.console = {}; - el.right.console.container = new lib.element("DIV").attribute.addClass("Console Container").insert(el.right.container); - el.right.console.mlButton = new lib.element("A").attribute.addClass("MLButton CloseML").event.addListener("click",d.console.toggleML).insert(el.right.console.container); - el.right.console.input = new lib.element("TEXTAREA").attribute.addClass("Input").insert(el.right.console.container); - el.right.console.input.event.addListener("keydown",lib.util.Curry(tab,window,el.right.console.input.element)); - el.right.console.run = new lib.element("A").attribute.addClass("Button").event.addListener("click",listen.runMultiline).update("Run").insert(el.right.console.container); - el.right.console.clear = new lib.element("A").attribute.addClass("Button").event.addListener("click",lib.util.Curry(d.clean,window,el.right.console.input)).update("Clear").insert(el.right.console.container); - - el.button.console = {}; - el.button.console.container = new lib.element("DIV").attribute.addClass("ButtonSet").insert(el.button.container); - el.button.console.clear = new lib.element("A").attribute.addClass("Button").event.addListener("click",d.console.clear).update("Clear").insert(el.button.console.container); - - /* - * html - */ - - el.left.html = {}; - el.left.html.container = new lib.element("DIV").attribute.addClass("HTML").insert(el.left.container); - - el.right.html = {}; - el.right.html.container = new lib.element("DIV").attribute.addClass("HTML Container").insert(el.right.container); - - el.right.html.nav = {}; - el.right.html.nav.container = new lib.element("DIV").attribute.addClass("Nav").insert(el.right.html.container); - el.right.html.nav.computedStyle = new lib.element("A").attribute.addClass("Tab Selected").event.addListener("click",lib.util.Curry(d.html.navigate,firebug,"computedStyle")).update("Computed Style").insert(el.right.html.nav.container); - el.right.html.nav.dom = new lib.element("A").attribute.addClass("Tab").event.addListener("click",lib.util.Curry(d.html.navigate,firebug,"dom")).update("DOM").insert(el.right.html.nav.container); - - el.right.html.content = new lib.element("DIV").attribute.addClass("Content").insert(el.right.html.container); - - el.button.html = {}; - el.button.html.container = new lib.element("DIV").attribute.addClass("ButtonSet HTML").insert(el.button.container); - - /* - * css - */ - - el.left.css = {}; - el.left.css.container = new lib.element("DIV").attribute.addClass("CSS").insert(el.left.container); - - el.right.css = {}; - el.right.css.container = new lib.element("DIV").attribute.addClass("CSS Container").insert(el.right.container); - - el.right.css.nav = {}; - el.right.css.nav.container = new lib.element("DIV").attribute.addClass("Nav").insert(el.right.css.container); - el.right.css.nav.runCSS = new lib.element("A").attribute.addClass("Tab Selected").update("Run CSS").insert(el.right.css.nav.container); - - el.right.css.mlButton = new lib.element("A").attribute.addClass("MLButton CloseML").event.addListener("click",d.console.toggleML).insert(el.right.css.container); - el.right.css.input = new lib.element("TEXTAREA").attribute.addClass("Input").insert(el.right.css.container); - el.right.css.input.event.addListener("keydown",lib.util.Curry(firebug.tab,window,el.right.css.input.element)); - el.right.css.run = new lib.element("A").attribute.addClass("Button").event.addListener("click",listen.runCSS).update("Run").insert(el.right.css.container); - el.right.css.clear = new lib.element("A").attribute.addClass("Button").event.addListener("click",lib.util.Curry(d.clean,window,el.right.css.input)).update("Clear").insert(el.right.css.container); - - el.button.css = {}; - el.button.css.container = new lib.element("DIV").attribute.addClass("ButtonSet CSS").insert(el.button.container); - el.button.css.selectbox = new lib.element("SELECT").event.addListener("change",listen.cssSelectbox).insert(el.button.css.container); - - /* - * scripts - */ - - el.left.scripts = {}; - el.left.scripts.container = new lib.element("DIV").attribute.addClass("Scripts").insert(el.left.container); - - el.right.scripts = {}; - el.right.scripts.container = new lib.element("DIV").attribute.addClass("Scripts Container").insert(el.right.container); - - el.button.scripts = {}; - el.button.scripts.container = new lib.element("DIV").attribute.addClass("ButtonSet Scripts").insert(el.button.container); - el.button.scripts.selectbox = new lib.element("SELECT").event.addListener("change",listen.scriptsSelectbox).insert(el.button.scripts.container); - el.button.scripts.lineNumbers = new lib.element("A").attribute.addClass("Button").event.addListener("click",d.scripts.toggleLineNumbers).update("Show Line Numbers").insert(el.button.scripts.container); - - /* - * dom - */ - - el.left.dom = {}; - el.left.dom.container = new lib.element("DIV").attribute.addClass("DOM").insert(el.left.container); - - el.right.dom = {}; - el.right.dom.container = new lib.element("DIV").attribute.addClass("DOM Container").insert(el.right.container); - - el.button.dom = {}; - el.button.dom.container = new lib.element("DIV").attribute.addClass("ButtonSet DOM").insert(el.button.container); - el.button.dom.label = new lib.element("LABEL").update("Object Path:").insert(el.button.dom.container); - el.button.dom.textbox = new lib.element("INPUT").event.addListener("keydown",listen.domTextbox).update(env.isPopup?"window.opener":"window").insert(el.button.dom.container); - - /* - * str - */ - el.left.str = {}; - el.left.str.container = new lib.element("DIV").attribute.addClass("STR").insert(el.left.container); - - el.right.str = {}; - el.right.str.container = new lib.element("DIV").attribute.addClass("STR").insert(el.left.container); - - el.button.str = {}; - el.button.str.container = new lib.element("DIV").attribute.addClass("ButtonSet XHR").insert(el.button.container); - el.button.str.watch = new lib.element("A").attribute.addClass("Button").event.addListener("click",lib.util.Curry(d.navigate,window,"xhr")).update("Back").insert(el.button.str.container); - - /* - * xhr - */ - el.left.xhr = {}; - el.left.xhr.container = new lib.element("DIV").attribute.addClass("XHR").insert(el.left.container); - - el.right.xhr = {}; - el.right.xhr.container = new lib.element("DIV").attribute.addClass("XHR").insert(el.left.container); - - - el.button.xhr = {}; - el.button.xhr.container = new lib.element("DIV").attribute.addClass("ButtonSet XHR").insert(el.button.container); - el.button.xhr.label = new lib.element("LABEL").update("XHR Path:").insert(el.button.xhr.container); - el.button.xhr.textbox = new lib.element("INPUT").event.addListener("keydown",listen.xhrTextbox).insert(el.button.xhr.container); - el.button.xhr.watch = new lib.element("A").attribute.addClass("Button").event.addListener("click",listen.addXhrObject).update("Watch").insert(el.button.xhr.container); - - /* - * settings - */ - el.settings = {}; - el.settings.container = new lib.element("DIV").child.add( - new lib.element("DIV").attribute.addClass("Header").child.add( - new lib.element().attribute.addClass("Title").update('Firebug Lite Settings') - ) - ).attribute.addClass("SettingsDiv").insert(el.main); - el.settings.content = new lib.element("DIV").attribute.addClass("Content").insert(el.settings.container); - el.settings.progressDiv = new lib.element("DIV").attribute.addClass("ProgressDiv").insert(el.settings.content); - el.settings.progress = new lib.element("DIV").attribute.addClass("Progress").insert(el.settings.progressDiv); - el.settings.cbxDebug = new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content); - el.settings.content.child.add(document.createTextNode("Start visible")); - new lib.element("BR").insert(el.settings.content); - el.settings.cbxDetectFirebug = new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content); - el.settings.content.child.add(document.createTextNode("Hide when Firebug active")); - new lib.element("BR").insert(el.settings.content); - el.settings.cbxHideDOMFunctions = new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content); - el.settings.content.child.add(document.createTextNode("Hide DOM functions")); - new lib.element("BR").insert(el.settings.content); - el.settings.cbxOverride = new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content); - el.settings.content.child.add(document.createTextNode("Override window.console")); - new lib.element("BR").insert(el.settings.content); - el.settings.cbxShowIcon = new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content); - el.settings.content.child.add(document.createTextNode("Show icon when hidden")); - new lib.element("BR").insert(el.settings.content); - el.settings.cbxOpenInPopup = new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content); - el.settings.content.child.add(document.createTextNode("Open in popup")); - el.settings.buttonDiv = new lib.element("DIV").insert(el.settings.content); - el.settings.buttonLeftDiv = new lib.element("DIV").attribute.addClass("ButtonsLeft").insert(el.settings.buttonDiv); - el.settings.resetButton = new lib.element("INPUT").attribute.set("type","button").update("Reset").event.addListener("click",settings.reset).insert(el.settings.buttonLeftDiv); - el.settings.buttonRightDiv = new lib.element("DIV").attribute.addClass("ButtonsRight").insert(el.settings.buttonDiv); - el.settings.cancelButton = new lib.element("INPUT").attribute.set("type","button").update("Cancel").event.addListener("click",settings.hide).insert(el.settings.buttonRightDiv); - el.settings.buttonRightDiv.child.add(document.createTextNode(" ")); - el.settings.saveButton = new lib.element("INPUT").attribute.set("type","button").update("Save").event.addListener("click",settings.saveClicked).insert(el.settings.buttonRightDiv); - - lib.util.AddEvent(document,"mousemove",listen.mouse)("mousemove",win.resizer.resize)("mouseup",win.resizer.stop)("keydown",listen.keyboard); - - env.init = true; - - for(var i=0, len=d.console.cache.length; i<len; i++){ - var item = d.console.cache[i]; - d.console.cmd[item.command].apply(window,item.arg); - }; - - if(lib.env.ie6){ - window.onscroll = lib.util.Curry(win.setVerticalPosition,window,null); - var buttons = [ - el.button.inspect, - el.button.close, - el.button.inspect, - el.button.console.clear, - el.right.console.run, - el.right.console.clear, - el.right.css.run, - el.right.css.clear - ]; - for(var i=0, len=buttons.length; i<len; i++) - buttons[i].attribute.set("href","#"); - win.refreshSize(); - } - - if(env.showIconWhenHidden) { - if(!env.popupWin) { - el.firebugIcon.environment.addStyle({ "display": env.debug&&'none'||'block' }); - } - } - - lib.util.AddEvent(window, "unload", win.unload); - - if (env.isPopup) { - env.height=lib.util.GetViewport().height; - lib.util.AddEvent(window, "resize", win.fitToPopup); - win.fitToPopup(); - } else { - lib.util.AddEvent(window, "resize", win.refreshSize); - } - - win.setHeight(env.height); - - if(env.openInPopup&&!env.isPopup) { - win.newWindow(); - } else { - el.main.environment.addStyle({ "display":env.debug&&'block'||'none' }); - el.mainiframe.environment.addStyle({ "display":env.debug&&'block'||'none' }); - } - } - }, - inspect:function(){ - return firebug.d.html.inspect.apply(window,arguments); - }, - watchXHR:function(){ - with(firebug){ - d.xhr.addObject.apply(window,arguments); - if(env.dIndex!="xhr"){ - d.navigate("xhr"); - } - } - }, - settings:{ - isVisible:false, - show: function() { - with(firebug){ - var posXY=lib.util.Element.getPosition(firebug.el.nav.options.element); - settings.refreshForm(); - - el.settings.container.environment.addStyle({ - "display": "block", - "left": (posXY.offsetLeft-125)+"px" - }); - el.settings.progressDiv.environment.addStyle({ - "display": "none" - }); - firebug.settings.isVisible = true; - } - }, - hide: function() { - with(firebug){ - firebug.el.settings.container.environment.addStyle({ - "display": "none" - }); - firebug.settings.isVisible = false; - } - }, - toggle: function(){ - with(firebug){ - settings[!settings.isVisible && 'show' || 'hide'](); - } - }, - saveClicked: function() { - firebug.el.settings.progressDiv.environment.addStyle({ - "display": "block" - }); - setTimeout(firebug.settings.formToSettings,0); - }, - formToSettings: function() { - var fe=firebug.env, - ofe, - elSet=firebug.el.settings, - exdate; - - fe.debug=elSet.cbxDebug.element.checked; - fe.detectFirebug=elSet.cbxDetectFirebug.element.checked; - fe.hideDOMFunctions=elSet.cbxHideDOMFunctions.element.checked; - fe.override=elSet.cbxOverride.element.checked; - fe.showIconWhenHidden=elSet.cbxShowIcon.element.checked; - fe.openInPopup=elSet.cbxOpenInPopup.element.checked; - - if(fe.isPopup) { - ofe=window.opener.firebug.env; - ofe.debug=fe.debug; - ofe.detectFirebug=fe.detectFirebug; - ofe.hideDOMFunctions=fe.hideDOMFunctions; - ofe.override=fe.override; - ofe.showIconWhenHidden=fe.showIconWhenHidden; - ofe.openInPopup=fe.openInPopup; - ofe.popupTop=fe.popupTop; - ofe.popupLeft=fe.popupLeft; - ofe.popupWidth=fe.popupWidth; - ofe.popupHeight=fe.popupHeight; - } - - with(firebug) { - settings.writeCookie(); - settings.hide(); - win.refreshDOM(); - } - }, - reset: function() { - var exdate=new Date(); - - exdate.setTime(exdate.getTime()-1); - document.cookie='FBLiteSettings=;expires='+exdate.toUTCString(); - location.reload(true); - }, - readCookie: function() { - var i,cookieArr,valueArr,item,value; - - with(firebug.env){ - if(targetWindow.document.cookie.length>0) { - cookieArr=targetWindow.document.cookie.split('; '); - - for(i=0;i<cookieArr.length;i++) { - if(cookieArr[i].split('=')[0]=='FBLiteSettings') { - valueArr=cookieArr[i].split('=')[1].split(','); - } - } - - if(valueArr) { - for(i=0;i<valueArr.length;i++) { - item=valueArr[i].split(':')[0]; - value=valueArr[i].split(':')[1]; - - switch(item) { - case 'debug': - debug=value=="true"; - break; - case 'detectFirebug': - detectFirebug=value=="true"; - break; - case 'hideDOMFunctions': - hideDOMFunctions=value=="true"; - break; - case 'override': - override=value=="true"; - break; - case 'showIconWhenHidden': - showIconWhenHidden=value=="true"; - break; - case 'openInPopup': - openInPopup=value=="true"; - break; - case 'popupTop': - popupTop=parseInt(value,10); - break; - case 'popupLeft': - popupLeft=parseInt(value,10); - break; - case 'popupWidth': - popupWidth=parseInt(value,10); - break; - case 'popupHeight': - popupHeight=parseInt(value,10); - break; - case 'height': - height=parseInt(value,10); - break; - } - } - } - } - } - }, - writeCookie: function() { - var values; - - with(firebug.env){ - values='debug:'+debug+','; - values+='detectFirebug:'+detectFirebug+','; - values+='hideDOMFunctions:'+hideDOMFunctions+','; - values+='override:'+override+','; - values+='showIconWhenHidden:'+showIconWhenHidden+','; - values+='openInPopup:'+openInPopup+','; - - if(isPopup) { - if(window.outerWidth===undefined) { - values+='popupTop:'+(window.screenTop-56)+','; - values+='popupLeft:'+(window.screenLeft-8)+','; - values+='popupWidth:'+document.body.clientWidth+','; - values+='popupHeight:'+document.body.clientHeight+','; - } else { - values+='popupTop:'+window.screenY+','; - values+='popupLeft:'+window.screenX+','; - values+='popupWidth:'+window.outerWidth+','; - values+='popupHeight:'+window.outerHeight+','; - } - } else { - values+='popupTop:'+popupTop+','; - values+='popupLeft:'+popupLeft+','; - values+='popupWidth:'+popupWidth+','; - values+='popupHeight:'+popupHeight+','; - } - - values+='height:'+(parseInt(targetWindow.firebug.el.main.element.style.height.replace(/px/,''),10)-38); - - exdate=new Date(); - exdate.setDate(exdate.getDate()+365); - targetWindow.document.cookie='FBLiteSettings='+values+';expires='+exdate.toUTCString(); - } - }, - refreshForm: function() { - var fe=firebug.env, - elSet=firebug.el.settings; - - elSet.cbxDebug.element.checked=fe.debug; - elSet.cbxDetectFirebug.element.checked=fe.detectFirebug; - elSet.cbxHideDOMFunctions.element.checked=fe.hideDOMFunctions; - elSet.cbxOverride.element.checked=fe.override; - elSet.cbxShowIcon.element.checked=fe.showIconWhenHidden; - elSet.cbxOpenInPopup.element.checked=fe.openInPopup; - } - }, - win:{ - hide:function(){ - with(firebug){ - el.main.environment.addStyle({ - "display": "none" - }); - el.mainiframe.environment.addStyle({ - "display": "none" - }); - if(env.showIconWhenHidden) { - el.firebugIcon.environment.addStyle({ - "display": "block" - }); - } - } - }, - show:function(){ - with(firebug){ - el.main.environment.addStyle({ - "display": "block" - }); - el.mainiframe.environment.addStyle({ - "display": "block" - }); - if(env.showIconWhenHidden) { - el.firebugIcon.environment.addStyle({ - "display": "none" - }); - } - } - }, - iconClicked:function(_event) { - with(firebug) { - if(_event.ctrlKey==true||_event.metaKey==true) { - el.firebugIcon.environment.addStyle({ "display": "none" }); - env.showIconWhenHidden=false; - } else { - win.show(); - } - } - }, - minimize:function(){ - with(firebug){ - env.minimized=true; - el.main.environment.addStyle({ "height":"35px" }); - el.mainiframe.environment.addStyle({ "height":"35px" }); - el.button.maximize.environment.addStyle({ "display":"block" }); - el.button.minimize.environment.addStyle({ "display":"none" }); - win.refreshSize(); - } - }, - maximize:function(){ - with(firebug){ - env.minimized=false; - el.button.minimize.environment.addStyle({ "display":"block" }); - el.button.maximize.environment.addStyle({ "display":"none" }); - win.setHeight(env.height); - } - }, - newWindow: function() { - var interval,scripts,script,scriptPath, - fe=firebug.env; - - if (!fe.popupWin) { - scripts = document.getElementsByTagName('script'); - - fe.popupWin = window.open("", "_firebug", - "status=0,menubar=0,resizable=1,top="+fe.popupTop+",left="+fe.popupLeft+",width=" + fe.popupWidth + - ",height=" + fe.popupHeight + ",scrollbars=0,addressbar=0,outerWidth="+fe.popupWidth+",outerHeight="+fe.popupHeight+ - "toolbar=0,location=0,directories=0,dialog=0"); - - if(!fe.popupWin) { - alert("Firebug Lite could not open a pop-up window, most likely because of a popup blocker.\nPlease enable popups for this domain"); - } else { - firebug.settings.hide(); - - for (i=0,len=scripts.length; i<len; i++) { - if (scripts[i].src.indexOf(fe.liteFilename) > -1) { - scriptPath = scripts[i].src; - break; - } - } - - if (scriptPath) { - script = fe.popupWin.document.createElement('script'), done = false; - script.type = 'text/javascript'; - script.src = scriptPath; - - script[firebug.lib.env.ie?"onreadystatechange":"onload"] = function(){ - if(!done && (!firebug.lib.env.ie || this.readyState == "complete" || this.readyState=="loaded")){ - done = true; - if(fe.popupWin.firebug) { - with(fe.popupWin.firebug) { - env.isPopup = true; - env.css = fe.css; - init(); - el.button.dock.environment.addStyle({ "display": "block"}); - el.button.newWindow.environment.addStyle({ "display": "none"}); - } - } - } - }; - - if (!done && firebug.lib.env.webkit) { - fe.popupWin.document.write('<html><head></head><body></body></html>'); - interval = setInterval(function() { - if (fe.popupWin.firebug) { - clearInterval(interval); - done = true; - with(fe.popupWin.firebug) { - env.isPopup = true; - env.css = fe.css; - init(); - el.button.dock.environment.addStyle({ "display": "block"}); - el.button.newWindow.environment.addStyle({ "display": "none"}); - } - } - }, 10); - }; - - if (!done) { - fe.popupWin.document.getElementsByTagName('head')[0].appendChild(script); - firebug.el.main.environment.addStyle({"display": "none"}); - firebug.el.mainiframe.environment.addStyle({"display": "none"}); - } - } else { - alert("Unable to detect the following script \"" + fe.liteFilename + - "\" ... if the script has been renamed then please set the value of firebug.env.liteFilename to reflect this change"); - fe.popupWin.close(); - fe.popupWin=null; - } - } - } - }, - dock: function() { - with(opener.firebug) { - env.popupWin = null; - el.main.environment.addStyle({ - "display": "block" - }); - el.mainiframe.environment.addStyle({ - "display": "block" - }); - settings.readCookie(); - window.close(); - }; - }, - unload: function() { - with(firebug){ - if(env.isPopup) { - win.dock(); - } else if(env.popupWin) { - env.popupWin.close(); - } - } - }, - fitToPopup: function() { - with(firebug) { - var viewport = lib.util.GetViewport(window); - win.setHeight((window.innerHeight||viewport.height) - 38); - el.main.environment.addStyle({ - "width": (viewport.width) + "px" - }); - el.mainiframe.environment.addStyle({ - "width": (viewport.width) + "px" - }); - } - }, - resizer:{ - y:[], enabled:false, - start:function(_event){ - with(firebug){ - if(env.minimized)return; - win.resizer.y=[el.main.element.offsetHeight,_event.clientY]; - if(lib.env.ie6){ - win.resizer.y[3]=parseInt(el.main.environment.getPosition().top); - } - win.resizer.enabled=true; - } - }, - resize:function(_event){ - with(firebug){ - if(!win.resizer.enabled)return; - win.resizer.y[2]=(win.resizer.y[0]+(win.resizer.y[1]-_event.clientY)); - el.main.environment.addStyle({ "height":win.resizer.y[2]+"px" }); - el.mainiframe.environment.addStyle({ "height":win.resizer.y[2]+"px" }); - if(lib.env.ie6){ - el.main.environment.addStyle({ "top":win.resizer.y[3]-(win.resizer.y[1]-_event.clientY)+"px" }); - el.mainiframe.environment.addStyle({ "top":win.resizer.y[3]-(win.resizer.y[1]-_event.clientY)+"px" }); - } - } - }, - stop:function(_event){ - with(firebug){ - if(win.resizer.enabled){ - win.resizer.enabled=false; - win.setHeight(win.resizer.y[2]-35); - } - } - } - }, - setHeight:function(_height){ - with(firebug){ - env.height=_height; - - el.left.container.environment.addStyle({ "height":_height+"px" }); - el.right.container.environment.addStyle({ "height":_height+"px" }); - el.main.environment.addStyle({ "height":_height+38+"px" }); - el.mainiframe.environment.addStyle({ "height":_height+38+"px" }); - - win.refreshSize(); - - // console - el.left.console.monitor.element.parentNode.style.height=_height-47+"px"; - el.left.console.mlButton.environment.addStyle({ "top":_height+19+"px" }); - el.right.console.mlButton.environment.addStyle({ "top":_height+19+"px" }); - el.right.console.input.environment.addStyle({ "height":_height-29+"px" }); - - // html - el.left.html.container.environment.addStyle({"height":_height-23+"px"}); - el.right.html.content.environment.addStyle({"height":_height-23+"px"}); - - // css - el.left.css.container.environment.addStyle({"height":_height-33+"px"}); - el.right.css.input.environment.addStyle({ "height":_height-55+"px" }); - - // script - el.left.scripts.container.environment.addStyle({"height":_height-23+"px"}); - - // dom - el.left.dom.container.environment.addStyle({"height":_height-31+"px"}); - - // xhr - el.left.xhr.container.environment.addStyle({"height":_height-32+"px"}); - - // string - el.left.str.container.environment.addStyle({"height":_height-32+"px"}); - } - }, - refreshDOM:function(){ - with(firebug){ - d.dom.open(eval(el.button.dom.textbox.environment.getElement().value),el.left.dom.container); - if(d.html.nIndex=="dom"){ - firebug.d.html.navigate("dom") - } - } - }, - refreshSize:function(){ - with(firebug){ - if(!env.init) - return; - - var dim = lib.util.GetViewport(); - el.main.environment.addStyle({ "width":dim.width+"px"}); - el.mainiframe.environment.addStyle({ "width":dim.width+"px"}); - if(lib.env.ie6) - win.setVerticalPosition(dim); - } - }, - setVerticalPosition:function(_dim,_event){ - with(firebug){ - var dim = _dim||lib.util.GetViewport(); - el.main.environment.addStyle({ "top":dim.height-el.main.environment.getSize().offsetHeight+Math.max(document.documentElement.scrollTop,document.body.scrollTop)+"px" }); - el.mainiframe.environment.addStyle({ "top":dim.height-el.main.environment.getSize().offsetHeight+Math.max(document.documentElement.scrollTop,document.body.scrollTop)+"px" }); - } - } - }, - d: { - clean:function(_element){ - with(firebug){ - _element.update(""); - } - }, - console:{ - addLine:function(){ - with (firebug) { - return new lib.element("DIV").attribute.addClass("Row").insert(el.left.console.monitor); - } - }, - cache:[], - clear:function(){ - with(firebug){ - d.clean(el.left.console.monitor); - d.console.cache = []; - } - }, - formatArgs:function(){ - with(firebug){ - var content = []; - for(var i=0, len=arguments.length; i<len; i++){ - content.push( d.highlight(arguments[i],false,false,true) ); - } - return content.join(" "); - } - }, - history:[], historyIndex:0, - openObject:function(_index){ - with (firebug) { - d.dom.open(d.console.cache[_index], el.left.dom.container, lib.env.ie); - d.navigate("dom"); - } - }, - print: function(_cmd,_text){ - with (firebug){ - d.console.addLine().attribute.addClass("Arrow").update(">>> "+_cmd); - d.console.addLine().update(d.highlight(_text,false,false,true)); - d.console.scroll(); - } - }, - printException: function(_exception){ - with(firebug){ - var message = _exception.description||_exception.message||_exception; - if(_exception.fileName){ - message+=' ('+(_exception.name&&(_exception.name+', ')||'')+getFileName(_exception.fileName)+', '+_exception.lineNumber+')'; - } - d.console.addLine().attribute.addClass("Error").update("<strong>Error: </strong>"+message,true); - } - }, - eval:function(_cmd){ - var result; - with(firebug){ - if(_cmd.length==0) - return; - - el.left.console.input.environment.getElement().value = ""; - d.console.historyIndex = d.console.history.push(_cmd); - - try { - if(_cmd==='console.firebug') { - d.console.addLine().attribute.addClass("Arrow").update(firebug.version); - } else { - result = eval.call(window,_cmd); - d.console.print(_cmd,result); - } - } catch(e){ - d.console.addLine().attribute.addClass("Arrow").update(">>> "+_cmd); - d.console.printException(e); - } - d.console.scroll(); - } - }, - scroll:function(){ - with(firebug){ - el.left.console.monitor.environment.getElement().parentNode.scrollTop = Math.abs(el.left.console.monitor.environment.getSize().offsetHeight-(el.left.console.monitor.element.parentNode.offsetHeight-11)); - } - }, - run:function(_command){ - with(firebug){ - if(!env.init){ - d.console.cache.push({ "command":_command, "arg":Array.prototype.slice.call(arguments,1) }); - } else { - d.console.cmd[_command].apply(window,Array.prototype.slice.call(arguments,1)); - } - } - }, - toggleML:function(){ - with(firebug){ - var open = !env.ml; - env.ml = !env.ml; - d.navigateRightColumn("console",open); - el[open?"left":"right"].console.mlButton.environment.addStyle({ display:"none" }); - el[!open?"left":"right"].console.mlButton.environment.addStyle({ display:"block" }); - el.left.console.mlButton.attribute[(open?"add":"remove")+"Class"]("CloseML"); - } - }, - countMap:{}, timeMap: {}, - cmd:{ - log: function(_value){ - with(firebug){ - var args = d.console.formatArgs.apply(window,arguments); - d.console.addLine().attribute.addClass("Log").update(args); - d.console.scroll(); - } - }, - warn: function(_value){ - with(firebug){ - var args = d.console.formatArgs.apply(window,arguments); - d.console.addLine().attribute.addClass("Warn").update(args); - d.console.scroll(); - } - }, - info: function(_value){ - with(firebug){ - var args = d.console.formatArgs.apply(window,arguments); - d.console.addLine().attribute.addClass("Info").update(args); - d.console.scroll(); - } - }, - debug: function(_value){ - with(firebug){ - var args = d.console.formatArgs.apply(window,arguments); - d.console.addLine().attribute.addClass("Debug").update(args); - d.console.scroll(); - } - }, - error: function(_value){ - with(firebug){ - var args = d.console.formatArgs.apply(window,arguments); - d.console.addLine().attribute.addClass("Error").update(args); - d.console.scroll(); - } - }, - trace: function(_value){ - with(firebug){ - var stackAmt = 3, f = arguments.caller, isArray = lib.util.IsArray(f); //function that called trace - - if((!isArray&&f)||(isArray&&f.length>0)){ - d.console.addLine().attribute.addClass("Arrow").update(">>> console.trace(stack)"); - for(var i=0;i<stackAmt;i++){ - var func = f.toString(), args = f.arguments; - d.dom.open({"function":func, "arguments":args},d.console.addLine()); - f = f.caller; - } - } - } - }, - dir:function(_value){ - with(firebug){ - d.console.addLine().attribute.addClass("Arrow").update(">>> console.dir("+_value+")"); - d.dom.open(_value,d.console.addLine()); - } - }, - dirxml: function(){ - with(firebug){ - d.console.cmd.log.apply(this, arguments); - } - }, - time: function(_name){ - with(firebug){ - d.console.timeMap[_name] = new Date().getTime(); - } - }, - timeEnd: function(_name){ - with(firebug){ - if(_name in d.console.timeMap){ - var delta = new Date().getTime() - d.console.timeMap[_name], - args = d.console.formatArgs.apply(window,[_name+":", delta+"ms"]); - d.console.addLine().attribute.addClass("log").update(args); - delete d.console.timeMap[_name]; - } - } - }, - count: function(_name){ - with(firebug){ - if(!d.console.countMap[_name]) - d.console.countMap[_name] = 0; - d.console.countMap[_name]++; - d.console.cmd.log.apply(window, [_name, d.console.countMap[_name]]); - } - }, - group:function(){ - with(firebug){ - d.console.cmd.log.apply(this, ["console.group is not supported"]); - } - }, - groupEnd:function(){ - with(firebug){ - d.console.cmd.log.apply(this, ["console.groupEnd is not supported"]); - } - }, - profile:function(){ - with(firebug){ - d.console.cmd.log.apply(this, ["console.profile is not supported"]); - } - }, - profileEnd:function(){ - with(firebug){ - d.console.cmd.log.apply(this, ["console.profileEnd is not supported"]); - } - } - } - }, - css:{ - index:-1, - open:function(_index){ - with (firebug) { - var item = env.targetWindow.document.styleSheets[_index], - uri = item.href; - try { - var rules = item[lib.env.ie ? "rules" : "cssRules"], str = ""; - for (var i=0; i<rules.length; i++) { - var item = rules[i]; - var selector = item.selectorText; - var cssText = lib.env.ie?item.style.cssText:item.cssText.match(/\{(.*)\}/)[1]; - str+=d.css.printRule(selector, cssText.split(";"), el.left.css.container); - } - } catch(e) { - str="<em>Access to restricted URI denied</em>"; - } - el.left.css.container.update(str); - } - }, - printRule:function(_selector,_css,_layer){ - with(firebug){ - var str = "<div class='Selector'>"+_selector+" {</div>"; - for(var i=0,len=_css.length; i<len; i++){ - var item = _css[i]; - str += "<div class='CSSText'>"+item.replace(/(.+\:)(.+)/,"<span class='CSSProperty'>$1</span><span class='CSSValue'>$2;</span>")+"</div>"; - } - str+="<div class='Selector'>}</div>"; - return str; - } - }, - refresh:function(){ - with(firebug){ - el.button.css.selectbox.update(""); - var collection = env.targetWindow.document.styleSheets; - for(var i=0,len=collection.length; i<len; i++){ - var uri = getFileName(collection[i].href); - d.css.index=d.css.index<0?i:d.css.index; - el.button.css.selectbox.child.add( - new lib.element("OPTION").attribute.set("value",i).update(uri) - ) - }; - d.css.open(d.css.index); - } - } - }, - dom: { - open: function(_object,_layer){ - with (firebug) { - _layer.clean(); - var container = new lib.element("DIV").attribute.addClass("DOMContent").insert(_layer); - d.dom.print(_object, container); - } - }, - print:function(_object,_parent, _inTree){ - with (firebug) { - var obj = _object || window, parentElement = _parent; - parentElement.update(""); - - if(parentElement.opened&&parentElement!=el.left.dom.container){ - parentElement.environment.getParent().lib.child.get()[0].lib.child.get()[0].lib.attribute.removeClass("Opened"); - parentElement.opened = false; - parentElement.environment.addStyle({ "display":"none" }); - return; - } - if(_inTree) - parentElement.environment.getParent().lib.child.get()[0].lib.child.get()[0].lib.attribute.addClass("Opened"); - parentElement.opened = true; - - for (var key in obj) { - try { - if (env.hideDOMFunctions && typeof(obj[key]) == "function") continue; - var value = obj[key], property = key, container = new lib.element("DIV").attribute.addClass("DOMRow").insert(parentElement), - left = new lib.element("DIV").attribute.addClass("DOMRowLeft").insert(container), right = new lib.element("DIV").attribute.addClass("DOMRowRight").insert(container); - - container.child.add( - new lib.element("DIV").attribute.addClass('Clear') - ); - - var link = new lib.element("A").attribute.addClass( - typeof value=="object"&&Boolean(value)?"Property Object":"Property" - ).update(property).insert(left); - - right.update(d.highlight(value,false,true)); - - var subContainer = new lib.element("DIV").attribute.addClass("DOMRowSubContainer").insert(container); - - if(typeof value!="object"||Boolean(value)==false) - continue; - - link.event.addListener("click",lib.util.Curry(d.dom.print,window,value, subContainer, true)); - }catch(e){ - } - } - parentElement.environment.addStyle({ "display":"block" }); - } - } - }, - highlight:function(_value,_inObject,_inArray,_link){ - with(firebug){ - var isArray = false, isHash, isElement = false, vtype=typeof _value, result=[]; - - if(vtype=="object"){ - if(Object.prototype.toString.call(_value) === "[object Date]"){ - vtype = "date"; - } else if(Object.prototype.toString.call(_value) === "[object String]"){ - vtype = "string"; - } else if(Object.prototype.toString.call(_value) === "[object Boolean]"){ - vtype = "boolean"; - } else if(Object.prototype.toString.call(_value) === "[object RegExp]"){ - vtype = "regexp"; - } - } - - try { - isArray = lib.util.IsArray(_value); - isHash = lib.util.IsHash(_value); - isElement = _value!=undefined&&Boolean(_value.nodeName)&&Boolean(_value.nodeType); - - // number, string, boolean, null, function - if(_value==null||vtype=="number"||vtype=="string"||vtype=="boolean"||vtype=="function"||vtype=="regexp"||vtype=="date"){ - if(_value==null){ - result.push("<span class='Null'>null</span>"); - }else if (vtype=="regexp") { - result.push("<span class='Maroon'>" + _value + "</span>"); - }else if (vtype=="date") { - result.push("<span class='DarkBlue'>'" + _value + "'</span>"); - } else if (vtype=="boolean"||vtype=="number") { - result.push("<span class='DarkBlue'>" + _value + "</span>"); - } else if(vtype=="function"){ - result.push("<span class='"+(_inObject?"Italic Gray":"Green")+"'>function()</span>"); - } else { - result.push("<span class='Red'>\""+( !_inObject&&!_inArray?_value : _value.substring(0,35)+(_value.length>35?" ...":"") ).replace(/\n/g,"\\n").replace(/\s/g," ").replace(/>/g,">").replace(/</g,"<")+"\"</span>"); - } - } - // element - else if(isElement){ - - if(_value.nodeType==3) - result.push(d.highlight(_value.nodeValue)); - else if(_inObject){ - result.push("<span class='Gray Italic'>"+_value.nodeName.toLowerCase()+"</span>"); - } else { - result.push("<span class='Blue"+ ( !_link?"'":" ObjectLink' onmouseover='this.className=this.className.replace(\"ObjectLink\",\"ObjectLinkHover\")' onmouseout='this.className=this.className.replace(\"ObjectLinkHover\",\"ObjectLink\")' onclick='firebug.d.html.inspect(firebug.d.console.cache[" +( d.console.cache.push( _value ) -1 )+"])'" ) + "'>"); - - if(_inArray){ - result.push(_value.nodeName.toLowerCase()); - if(_value.getAttribute){ - if(_value.getAttribute&&_value.getAttribute("id")) - result.push("<span class='DarkBlue'>#"+_value.getAttribute("id")+"</span>"); - var elClass = _value.getAttribute(lib.env.ie&&!lib.env.ie8?"className":"class")||""; - result.push(!elClass?"":"<span class='Red'>."+elClass.split(" ")[0]+"</span>"); - } - result.push("</span>"); - } else { - result.push("<span class='DarkBlue'><<span class='Blue TagName'>"+ _value.nodeName.toLowerCase()); - - if(_value.attributes){ - for(var i=0,len=_value.attributes.length; i<len; i++){ - var item = _value.attributes[i]; - - if(!lib.env.ie||item.nodeValue) - result.push(" <span class='DarkBlue'>"+item.nodeName+"=\"<span class='Red'>"+item.nodeValue+"</span>\"</span>"); - } - } - - result.push("</span>></span>"); - } - } - } - // array, hash - else if(isArray||isHash){ - if(isArray){ - if(_inObject){ - result.push("<span class='Gray Italic'>["+_value.length+"]</span>"); - } else { - result.push("<span class='Strong'>[ "); - - for(var i=0,len=_value.length; i<len; i++){ - if((_inObject||_inArray)&&i>3){ - result.push(", <span class='Strong Gray'>"+(len-4)+" More...</span>"); - break; - } - result.push( (i > 0 ? ", " : "") + d.highlight(_value[i], false, true, true) ); - } - - result.push(" ]</span>"); - } - } else if(_inObject){ - result.push("<span class='Gray Italic'>Object</span>"); - } else { - result.push("<span class='Strong Green"+ ( !_link?"'":" ObjectLink' onmouseover='this.className=this.className.replace(\"ObjectLink\",\"ObjectLinkHover\")' onmouseout='this.className=this.className.replace(\"ObjectLinkHover\",\"ObjectLink\")' onclick='firebug.d.console.openObject(" +( d.console.cache.push( _value ) -1 )+")'" ) + ">Object"); - var i=0; - for(var key in _value){ - var value = _value[key]; - if((_inObject||_inArray)&&i>3){ - result.push(" <span class='Strong Gray'>More...</span>"); - break; - } - result.push(" "+key+"="+d.highlight(value,true)); - i++; - } - result.push("</span>"); - } - } else { - result.push(["<span class'Gray Italic'>"+_value+"</span>"]); - } - } catch(e){ - result.push(".."); - } - return result.join(""); - } - }, - html:{ - nIndex:"computedStyle", - current:null, - highlight:function(_element,_clear,_event){ - with(firebug){ - if(_element.firebugElement){ - return; - } - if(_clear){ - env.targetWindow.firebug.el.bgInspector.environment.addStyle({ "display":"none" }); - return; - } - d.inspector.inspect(_element,true); - } - }, - inspect:function(_element){ - var map = [], - parentLayer, - t, - tagName, - parent = _element; - while (parent) { - map.push(parent); - if (parent == firebug.env.targetWindow.document.body) break; - parent = parent.parentNode; - } - map = map.reverse(); - with(firebug) { - if (env.dIndex != "html") { - env.targetWindow.firebug.d.navigate("html"); - } - - env.targetWindow.firebug.d.inspector.toggle(false); - - for (t = 0; t < el.left.html.container.child.get().length; t++) { - if (el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0]) { - if (el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0].innerText) { - tagName = el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0].innerText; - } else { - tagName = el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0].textContent; - } - - if (/<body/i.test(tagName)) { - parentLayer = el.left.html.container.child.get()[t].childNodes[1].lib; - break; - } - } - } - - if (!parentLayer) { - parentLayer = el.left.html.container.child.get()[3].childNodes[1].lib; - } - - for (t = 0, len = map.length; map[t]; t++) { - if (t == len - 1) { - var link = parentLayer.environment.getElement().previousSibling.lib; - link.attribute.addClass("Selected"); - - if (d.html.current) { - d.html.current[1].attribute.removeClass("Selected"); - } - d.html.current = [_element, link]; - return; - } - parentLayer = d.html.openHtmlTree(map[t], parentLayer, map[t + 1]); - } - } - }, - navigate:function(_index,_element){ - with(firebug){ - el.right.html.nav[d.html.nIndex].attribute.removeClass("Selected"); - el.right.html.nav[_index].attribute.addClass("Selected"); - d.html.nIndex = _index; - d.html.openProperties(); - } - }, - openHtmlTree:function(_element,_parent,_returnParentElementByElement,_event){ - with(firebug){ - var element = _element || env.targetWindow.document.documentElement, - parent = _parent || el.left.html.container, - returnParentEl = _returnParentElementByElement || null, - returnParentVal = null, - len = element.childNodes.length, - nodeLink; - - if(parent!=el.left.html.container){ - nodeLink = parent.environment.getParent().lib.child.get()[0].lib; - if (d.html.current) { - d.html.current[1].attribute.removeClass("Selected"); - } - nodeLink.attribute.addClass("Selected"); - - d.html.current = [_element,nodeLink]; - d.html.openProperties(); - }; - - if(element.childNodes&&(len==0||(len==1&&element.childNodes[0].nodeType==3)))return; - parent.clean(); - - if(parent.opened&&Boolean(_returnParentElementByElement)==false){ - parent.opened = false; - parent.element.previousSibling.lib.attribute.removeClass("Open"); - parent.element.lib.attribute.removeClass("OpenSubContainer"); - return; - }; - - if (parent != el.left.html.container) { - parent.element.previousSibling.lib.attribute.addClass("Open"); - parent.element.lib.attribute.addClass("OpenSubContainer"); - parent.opened = true; - }; - - if(element==document.documentElement){ - new lib.element("A").attribute.addClass("Block").update("<span class='DarkBlue'><<span class='Blue'>html</span>>").insert(parent); - }; - - for(var i=0; i<=len; i++){ - if(i==len){ - new lib.element("A").attribute.addClass("Block").update("<span class='DarkBlue'></<span class='Blue'>"+element.nodeName.toLowerCase()+"</span>>").insert(container); - break; - } - var item = element.childNodes[i]; - - if (item.nodeType != 3){ - var container = new lib.element().attribute.addClass("Block").insert(parent), - link = new lib.element("A").attribute.addClass("Link").insert(container), - spacer = new lib.element("SPAN").attribute.addClass("Spacer").update(" ").insert(link), - html = new lib.element("SPAN").attribute.addClass("Content").update(d.highlight(item)).insert(link), - subContainer = new lib.element("DIV").attribute.addClass("SubContainer").insert(container), - view = lib.util.Element.getView(item); - - link.event.addListener("click", lib.util.Curry(d.html.openHtmlTree, window, item, subContainer, false)); - link.event.addListener("mouseover", lib.util.Curry(d.html.highlight, window, item, false)); - link.event.addListener("mouseout", lib.util.Curry(d.html.highlight, window, item, true)); - - returnParentVal = returnParentEl == item ? subContainer : returnParentVal; - - if(d.html.current==null&&item==document.body){ - link.attribute.addClass("Selected"); - d.html.current = [item,link]; - d.html.openHtmlTree(item,subContainer); - } - - if(element.nodeName!="HEAD"&&element!=document.documentElement&&(view.visibility=="hidden"||view.display=="none")){ - container.attribute.addClass("Unvisible"); - }; - - if (item.childNodes){ - var childLen = item.childNodes.length; - if (childLen == 1 && item.childNodes[0].nodeType == 3) { - html.child.add(document.createTextNode(item.childNodes[0].nodeValue.substring(0, 50))); - html.child.add(document.createTextNode("</")); - html.child.add(new lib.element("span").attribute.addClass("Blue").update(item.nodeName.toLowerCase()).environment.getElement()); - html.child.add(document.createTextNode(">")); - continue; - } - else - if (childLen > 0) { - link.attribute.addClass("Parent"); - } - } - } - }; - return returnParentVal; - } - }, - openProperties:function(){ - with(firebug){ - var index = d.html.nIndex; - var node = d.html.current[0]; - d.clean(el.right.html.content); - var str = ""; - switch(index){ - case "computedStyle": - var property = ["opacity","filter","azimuth","background","backgroundAttachment","backgroundColor","backgroundImage","backgroundPosition","backgroundRepeat","border","borderCollapse","borderColor","borderSpacing","borderStyle","borderTop","borderRight","borderBottom","borderLeft","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderWidth","bottom","captionSide","clear","clip","color","content","counterIncrement","counterReset","cue","cueAfter","cueBefore","cursor","direction","display","elevation","emptyCells","cssFloat","font","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","height","left","letterSpacing","lineHeight","listStyle","listStyleImage","listStylePosition","listStyleType","margin","marginTop","marginRight","marginBottom","marginLeft","markerOffset","marks","maxHeight","maxWidth","minHeight","minWidth","orphans","outline","outlineColor","outlineStyle","outlineWidth","overflow","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","page","pageBreakAfter","pageBreakBefore","pageBreakInside","pause","pauseAfter","pauseBefore","pitch","pitchRange","playDuring","position","quotes","richness","right","size","speak","speakHeader","speakNumeral","speakPunctuation","speechRate","stress","tableLayout","textAlign","textDecoration","textIndent","textShadow","textTransform","top","unicodeBidi","verticalAlign","visibility","voiceFamily","volume","whiteSpace","widows","width","wordSpacing","zIndex"].sort(); - var view = document.defaultView?document.defaultView.getComputedStyle(node,null):node.currentStyle; - for(var i=0,len=property.length; i<len; i++){ - var item = property[i]; - if(!view[item])continue; - str+="<div class='CSSItem'><div class='CSSProperty'>"+item+"</div><div class='CSSValue'>"+d.highlight(view[item])+"</div></div>"; - } - el.right.html.content.update(str); - break; - case "dom": - d.dom.open(node,el.right.html.content,lib.env.ie); - break; - } - } - } - }, - inspector:{ - enabled:false, - el:null, - inspect:function(_element,_bgInspector){ - with(firebug){ - var pos = env.targetWindow.firebug.lib.util.Element.getPosition(_element); - - env.targetWindow.firebug.el[_bgInspector&&"bgInspector"||"borderInspector"].environment.addStyle({ - "width":_element.offsetWidth+"px", "height":_element.offsetHeight+"px", - "top":pos.offsetTop-(_bgInspector?0:2)+"px", "left":pos.offsetLeft-(_bgInspector?0:2)+"px", - "display":"block" - }); -9 - if(!_bgInspector){ - d.inspector.el = _element; - } - }; - }, - toggle:function(_absoluteValue,_event){ - with (firebug) { - if(_absoluteValue==d.inspector.enabled) - return; - d.inspector.enabled = _absoluteValue!=undefined&&!_absoluteValue.clientX?_absoluteValue:!d.inspector.enabled; - el.button.inspect.attribute[(d.inspector.enabled ? "add" : "remove") + "Class"]("Enabled"); - if(d.inspector.enabled==false){ - el.borderInspector.environment.addStyle({ "display":"none" }); - d.inspector.el = null; - } else if(lib.env.dIndex!="html") { - if (env.popupWin) { - env.popupWin.firebug.d.navigate("html"); - } else { - d.navigate("html"); - } - } - } - } - }, - scripts:{ - index:-1, - lineNumbers:false, - open:function(_index){ - with(firebug){ - d.scripts.index = _index; - el.left.scripts.container.update(""); - var script = document.getElementsByTagName("script")[_index],uri = script.src||document.location.href,source; - try { - if(uri!=document.location.href){ - source = env.cache[uri]||lib.xhr.get(uri).responseText; - env.cache[uri] = source; - } else { - source = script.innerHTML; - } - source = source.replace(/<|>/g,function(_ch){ - return ({"<":"<",">":">"})[_ch]; - }); - - if(!d.scripts.lineNumbers) - el.left.scripts.container.child.add( - new lib.element("DIV").attribute.addClass("CodeContainer").update(source) - ); - else { - source = source.split("<br />"); - for (var i = 0; i < source.length; i++) { - el.left.scripts.container.child.add(new lib.element("DIV").child.add(new lib.element("DIV").attribute.addClass("LineNumber").update(i + 1), new lib.element("DIV").attribute.addClass("Code").update(" " + source[i]), new lib.element("DIV").attribute.addClass('Clear'))); - }; - }; - } catch(e){ - el.left.scripts.container.child.add( - new lib.element("DIV").attribute.addClass("CodeContainer").update("<em>Access to restricted URI denied</em>") - ); - } - } - }, - toggleLineNumbers:function(){ - with(firebug){ - d.scripts.lineNumbers = !d.scripts.lineNumbers; - el.button.scripts.lineNumbers.attribute[(d.scripts.lineNumbers ? "add" : "remove") + "Class"]("Enabled"); - d.scripts.open( d.scripts.index ); - } - }, - refresh:function(){ - with(firebug){ - el.button.scripts.selectbox.clean(); - var collection = env.targetWindow.document.getElementsByTagName("script"); - for(var i=0,len=collection.length; i<len; i++){ - var item = collection[i], - fileName = getFileName(item.src||item.baseURI||".."); - d.scripts.index=d.scripts.index<0?i:d.scripts.index; - el.button.scripts.selectbox.child.add( - new lib.element("OPTION").attribute.set("value",i).update(fileName) - ); - } - d.scripts.open( d.scripts.index ); - } - } - }, - str: { - open:function(_str){ - with(firebug){ - d.navigate("str"); - el.left.str.container.update(_str.replace(/\n/g,"<br />")) - } - } - }, - xhr:{ - objects:[], - addObject:function(){ - with(firebug){ - for(var i=0,len=arguments.length; i<len; i++){ - try { - var item = arguments[i], - val = env.targetWindow.eval(item); - d.xhr.objects.push([item, val]); - } catch(e){ - continue; - } - } - } - }, - open:function(){ - with(firebug){ - el.left.xhr.container.update(""); - el.left.xhr.name = new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").attribute.addClass("Block").environment.addStyle({ "width":"20%" }).insert(el.left.xhr.container)); - el.left.xhr.nameTitle = new lib.element("STRONG").update("Object Name:").insert(el.left.xhr.name); - el.left.xhr.nameContent = new lib.element("DIV").insert(el.left.xhr.name); - el.left.xhr.status = new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").attribute.addClass("Block").environment.addStyle({ "width":"10%" }).insert(el.left.xhr.container)); - el.left.xhr.statusTitle = new lib.element("STRONG").update("Status:").insert(el.left.xhr.status); - el.left.xhr.statusContent = new lib.element("DIV").insert(el.left.xhr.status); - el.left.xhr.readystate = new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").environment.addStyle({ "width":"15%" }).attribute.addClass("Block").insert(el.left.xhr.container)); - el.left.xhr.readystateTitle =el.left.xhr.nameTitle = new lib.element("STRONG").update("Ready State:").insert(el.left.xhr.readystate); - el.left.xhr.readystateContent = new lib.element("DIV").insert(el.left.xhr.readystate); - el.left.xhr.response = new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").environment.addStyle({ "width":(lib.env.ie?"50":"55")+"%" }).attribute.addClass("Block").insert(el.left.xhr.container)); - el.left.xhr.responseTitle = new lib.element("STRONG").update("Response:").insert(el.left.xhr.response); - el.left.xhr.responseContent = new lib.element("DIV").insert(el.left.xhr.response); - setTimeout(d.xhr.refresh,500); - } - }, - refresh:function(){ - with(firebug){ - el.left.xhr.nameContent.update(""); - el.left.xhr.statusContent.update(""); - el.left.xhr.readystateContent.update(""); - el.left.xhr.responseContent.update(""); - for(var i=0,len=d.xhr.objects.length; i<len; i++){ - var item = d.xhr.objects[i], - response = item[1].responseText; - if(Boolean(item[1])==false)continue; - el.left.xhr.nameContent.child.add(new lib.element("span").update(item[0])); - try { - el.left.xhr.statusContent.child.add(new lib.element("span").update(item[1].status)); - } catch(e){ el.left.xhr.statusContent.child.add(new lib.element("span").update(" ")); } - el.left.xhr.readystateContent.child.add(new lib.element("span").update(item[1].readyState)); - - el.left.xhr.responseContent.child.add(new lib.element("span").child.add( - new lib.element("A").event.addListener("click",lib.util.Curry(d.str.open,window,response)).update(" "+response.substring(0,50)) - )); - }; - if(env.dIndex=="xhr") - setTimeout(d.xhr.refresh,500); - } - } - }, - navigateRightColumn:function(_index,_open){ - with(firebug){ - el.left.container.environment.addStyle({ "width":_open?"70%":"100%" }); - el.right.container.environment.addStyle({ "display":_open?"block":"none" }); - } - }, - navigate:function(_index){ - with(firebug){ - var open = _index, close = env.dIndex; - env.dIndex = open; - - settings.hide(); - - el.button[close].container.environment.addStyle({ "display":"none" }); - el.left[close].container.environment.addStyle({ "display":"none" }); - el.right[close].container.environment.addStyle({ "display":"none" }); - - el.button[open].container.environment.addStyle({ "display":"inline" }); - el.left[open].container.environment.addStyle({ "display":"block" }); - el.right[open].container.environment.addStyle({ "display":"block" }); - - if(el.nav[close]) - el.nav[close].attribute.removeClass("Selected"); - if(el.nav[open]) - el.nav[open].attribute.addClass("Selected"); - - switch(open){ - case "console": - d.navigateRightColumn(_index); - break; - case "html": - d.navigateRightColumn(_index,true); - if(!d.html.current){ - var t=Number(new Date); - d.html.openHtmlTree(); - } - break; - case "css": - d.navigateRightColumn(_index,true); - d.css.refresh(); - break; - case "scripts": - d.navigateRightColumn(_index); - d.scripts.refresh(); - break; - case "dom": - d.navigateRightColumn(_index); - if(el.left.dom.container.environment.getElement().innerHTML==""){ - var t=Number(new Date); - d.dom.open(eval(el.button.dom.textbox.environment.getElement().value),el.left.dom.container); - } - break; - case "xhr": - d.navigateRightColumn(_index); - d.xhr.open(); - break; - } - } - } - }, - getFileName:function(_path){ - var match = _path&&_path.match(/[\w\-\.\?\=\&]+$/); - return match&&match[0]||_path; - }, - cancelEvent:function(_event){ - if(_event.stopPropagation) - _event.stopPropagation(); - if(_event.preventDefault) - _event.preventDefault(); - }, - getSelection:function(_el){ - with(firebug){ - if(lib.env.ie){ - var range = document.selection.createRange(),stored = range.duplicate(); - stored.moveToElementText(_el); - stored.setEndPoint('EndToEnd', range); - _el.selectionStart = stored.text.length - range.text.length; - _el.selectionEnd = _el.selectionStart + range.text.length; - } - return { - start:_el.selectionStart, - length:_el.selectionEnd-_el.selectionStart - } - } - }, - tab:function(_el,_event){ - with(firebug){ - if(_event.keyCode==9){ - if(_el.setSelectionRange){ - var position = firebug.getSelection(_el); - _el.value = _el.value.substring(0,position.start) + String.fromCharCode(9) + _el.value.substring(position.start+position.length,_el.value.length); - _el.setSelectionRange(position.start+1,position.start+1); - } else if(document.selection) { - var range = document.selection.createRange(), isCollapsed = range.text == ''; - range.text = String.fromCharCode(9); - range.moveStart('character', -1); - } - firebug.cancelEvent(_event); - if(lib.env.ie) - setTimeout(_el.focus,100); - }; - } - }, - listen: { - addXhrObject:function(){ - with(firebug){ - d.xhr.addObject.apply(env.targetWindow, el.button.xhr.textbox.environment.getElement().value.split(",")); - } - }, - consoleTextbox:function(_event){ - with(firebug){ - if(_event.keyCode==13&&(env.multilinemode==false||_event.shiftKey==false)){ - d.console.historyIndex = d.console.history.length; - d.console.eval(el.left.console.input.environment.getElement().value); - return false; - } - - switch(_event.keyCode){ - case 40: - if(d.console.history[d.console.historyIndex+1]){ - d.console.historyIndex+=1; - el.left.console.input.update( d.console.history[d.console.historyIndex] ); - } - break; - case 38: - if(d.console.history[d.console.historyIndex-1]){ - d.console.historyIndex-=1; - el.left.console.input.update( d.console.history[d.console.historyIndex] ); - } - break; - } - } - }, - cssSelectbox:function(){ - with(firebug){ - d.css.open(el.button.css.selectbox.environment.getElement().selectedIndex); - } - }, - domTextbox:function(_event){ - with(firebug){ - if(_event.keyCode==13){ - d.dom.open(eval(el.button.dom.textbox.environment.getElement().value),el.left.dom.container); - } - } - }, - inspector:function(){ - with(firebug){ - if (env.popupWin) { - env.popupWin.firebug.d.html.inspect(firebug.d.inspector.el); - } else { - firebug.d.html.inspect(firebug.d.inspector.el); - } - } - }, - keyboard:function(_event){ - with(firebug){ - if(_event.keyCode==27 && d.inspector.enabled){ - d.inspector.toggle(); - } else if(_event.keyCode === 123 && _event.ctrlKey || _event.metaKey) { - if(env.isPopup){ - win.dock(); - }else { - win.newWindow(); - } - } else if( - (_event.keyCode === 123 && !_event.ctrlKey && !_event.metaKey) || - (_event.keyCode === 76 && (_event.ctrlKey || _event.metaKey) && _event.shiftKey) || - (_event.keyCode === 13 && _event.shiftKey)) { - - if(env.isPopup){ - win.dock(); - } else if (el.main.environment.getStyle("display") === 'none') { - win.show(); - } else { - win.hide(); - } - } - } - }, - mouse:function(_event){ - with(firebug){ - var target; - - if(document.elementFromPoint) { - target = document.elementFromPoint(_event.clientX, _event.clientY); - } else { - if(lib.env.ie) { - target = _event.srcElement; - } else { - target = _event.explicitOriginalTarget || _event.target; - } - } - - if( d.inspector.enabled&& - target!=document.body&& - target!=document.firstChild&& - target!=document.childNodes[1]&& - target!=el.borderInspector.environment.getElement()&& - target!=el.main.environment.getElement()&& - target.offsetParent!=el.main.environment.getElement() ) { - d.inspector.inspect(target); - } - } - }, - runMultiline:function(){ - with(firebug){ - d.console.eval.call(window,el.right.console.input.environment.getElement().value); - } - }, - runCSS:function(){ - with(firebug){ - var source = el.right.css.input.environment.getElement().value.replace(/\n|\t/g,"").split("}"); - for(var i=0, len=source.length; i<len; i++){ - var item = source[i]+"}", rule = !lib.env.ie?item:item.split(/{|}/), - styleSheet = document.styleSheets[0]; - console.log(rule); - if(item.match(/.+\{.+\}/)){ - if(lib.env.ie) - styleSheet.addRule(rule[0],rule[1]); - else - styleSheet.insertRule( rule, styleSheet.cssRules.length ); - } - } - } - }, - scriptsSelectbox:function(){ - with(firebug){ - d.scripts.open(parseInt(el.button.scripts.selectbox.environment.getElement().value)); - } - }, - xhrTextbox:function(_event){ - with(firebug){ - if(_event.keyCode==13){ - d.xhr.addObject.apply(env.targetWindow, el.button.xhr.textbox.environment.getElement().value.split(",")); - } - } - } - } -}; - -(function(_scope){ - _scope.lib = {}; - var pi = _scope.lib; pi.version = [1.1,2008091000]; - - pi.env = { - ie: /MSIE/i.test(navigator.userAgent), - ie6: /MSIE 6/i.test(navigator.userAgent), - ie7: /MSIE 7/i.test(navigator.userAgent), - ie8: /MSIE 8/i.test(navigator.userAgent), - firefox: /Firefox/i.test(navigator.userAgent), - opera: /Opera/i.test(navigator.userAgent), - webkit: /Webkit/i.test(navigator.userAgent), - camino: /Camino/i.test(navigator.userAgent) - }; - - pi.get = function(){ - return document.getElementById(arguments[0]); - }; - pi.get.byTag = function(){ - return document.getElementsByTagName(arguments[0]); - }; - pi.get.byClass = function(){ return document.getElementsByClassName.apply(document,arguments); }; - - pi.util = { - Array:{ - clone:function(_array,_undeep){ - var tmp = []; - Array.prototype.push.apply(tmp,_array); - pi.util.Array.forEach(tmp,function(_item,_index,_source){ - if(_item instanceof Array&&!_undeep) - _source[_index] = pi.util.Array.clone(_source[_index]); - }); - return tmp; - }, - count:function(_array,_value){ - var count = 0; - pi.util.Array.forEach(_array,function(){ - count+=Number(arguments[0]==_value); - }); - return count; - }, - forEach:function(_array,_function){ - if(_array.forEach) - return _array.forEach(_function); - for(var i=0,len=_array.length; i<len; i++) - _function.apply(_array,[_array[i],i,_array]); - }, - getLatest:function(_array){ - return _array[_array.length-1]; - }, - indexOf:function(_array,_value){ - if(!pi.env.ie){ - return _array.indexOf(_value); - }; - - var index = -1; - for(var i=0, len=_array.length; i<len; i++){ - if(_array[i]==_value){ - index = i; - break; - } - } - return index; - }, - remove:function(_array,_index){ - var result = _array.slice(0,_index); - _array = Array.prototype.push.apply(result,_array.slice(_index+1)); - return result; - } - }, - Curry:function(_fn,_scope){ - var fn = _fn, scope = _scope||window, args = Array.prototype.slice.call(arguments,2); - return function(){ - return fn.apply(scope,args.concat( Array.prototype.slice.call(arguments,0) )); - }; - }, - Extend:function(_superClass,_prototype,_skipClonning){ - var object = new pi.base; - if(_prototype["$Init"]){ - object.init = _prototype["$Init"]; - delete _prototype["$Init"]; - }; - - object.body = _superClass==pi.base?_prototype:pi.util.Hash.merge(_prototype,_superClass.prototype); - object.init=object.init||function(){ - if(_superClass!=pi.base) - _superClass.apply(this,arguments); - }; - - return object.build(_skipClonning); - }, - IsArray:function(_object){ - if(_object===null){ - return false; - } - if(window.NodeList&&window.NamedNodeMap&&!pi.env.ie8){ - if(_object instanceof Array||_object instanceof NodeList||_object instanceof NamedNodeMap||(window.HTMLCollection&&_object instanceof HTMLCollection)) - return true; - }; - if(!_object||_object==window||typeof _object=="function"||typeof _object=="string"||typeof _object.length!="number"){ - return false - }; - var len = _object.length; - if(len>0&&_object[0]!=undefined&&_object[len-1]!=undefined){ - return true; - } else { - for(var key in _object){ - if(key!="item"&&key!="length"&&key!="setNamedItemNS"&&key!="setNamedItem"&&key!="getNamedItem"&&key!="removeNamedItem"&&key!="getNamedItemNS"&&key!="removeNamedItemNS"&&key!="tags"){ - return false; - } - } - return true - }; - }, - IsHash:function(_object){ - return _object && typeof _object=="object"&&(_object==window||_object instanceof Object)&&!_object.nodeName&&!pi.util.IsArray(_object) - }, - Init:[], - AddEvent: function(_element,_eventName,_fn,_useCapture){ - _element[pi.env.ie?"attachEvent":"addEventListener"]((pi.env.ie?"on":"")+_eventName,_fn,_useCapture||false); - return pi.util.Curry(pi.util.AddEvent,this,_element); - }, - RemoveEvent: function(_element,_eventName,_fn,_useCapture){ - _element[pi.env.ie?"detachEvent":"removeEventListener"]((pi.env.ie?"on":"")+_eventName,_fn,_useCapture||false); - return pi.util.Curry(pi.util.RemoveEvent,this,_element); - }, - Element:{ - addClass:function(_element,_class){ - if( !pi.util.Element.hasClass(_element,_class) ) - pi.util.Element.setClass(_element, pi.util.Element.getClass(_element) + " " + _class ); - }, - getClass:function(_element){ - return _element.getAttribute(pi.env.ie&&!pi.env.ie8?"className":"class")||""; - }, - hasClass:function(_element,_class){ - return pi.util.Array.indexOf(pi.util.Element.getClass(_element).split(" "),_class)>-1; - }, - removeClass:function(_element,_class){ - if( pi.util.Element.hasClass(_element,_class) ){ - var names = pi.util.Element.getClass(_element,_class).split(" "); - pi.util.Element.setClass( - _element, - pi.util.Array.remove(names,pi.util.Array.indexOf(names,_class)).join(" ") - ); - } - }, - setClass:function(_element,_value){ - if(pi.env.ie8){ - _element.setAttribute("className", _value ); - _element.setAttribute("class", _value ); - } else { - _element.setAttribute(pi.env.ie?"className":"class", _value ); - } - }, - toggleClass:function(){ - if(pi.util.Element.hasClass.apply(this,arguments)) - pi.util.Element.removeClass.apply(this,arguments); - else - pi.util.Element.addClass.apply(this,arguments); - }, - getOpacity:function(_styleObject){ - var styleObject = _styleObject; - if(!pi.env.ie) - return styleObject["opacity"]; - - var alpha = styleObject["filter"].match(/opacity\=(\d+)/i); - return alpha?alpha[1]/100:1; - }, - setOpacity:function(_element,_value){ - if(!pi.env.ie) - return pi.util.Element.addStyle(_element,{ "opacity":_value }); - _value*=100; - pi.util.Element.addStyle(_element,{ "filter":"alpha(opacity="+_value+")" }); - return this._parent_; - }, - getPosition:function(_element){ - var parent = _element,offsetLeft = document.body.offsetLeft, offsetTop = document.body.offsetTop, view = pi.util.Element.getView(_element); - while(parent&&parent!=document.body&&parent!=document.firstChild){ - offsetLeft +=parseInt(parent.offsetLeft); - offsetTop += parseInt(parent.offsetTop); - parent = parent.offsetParent; - }; - return { - "bottom":view["bottom"], - "clientLeft":_element.clientLeft, - "clientTop":_element.clientTop, - "left":view["left"], - "marginTop":view["marginTop"], - "marginLeft":view["marginLeft"], - "offsetLeft":offsetLeft, - "offsetTop":offsetTop, - "position":view["position"], - "right":view["right"], - "top":view["top"], - "zIndex":view["zIndex"] - }; - }, - getSize:function(_element){ - var view = pi.util.Element.getView(_element); - return { - "height":view["height"], - "clientHeight":_element.clientHeight, - "clientWidth":_element.clientWidth, - "offsetHeight":_element.offsetHeight, - "offsetWidth":_element.offsetWidth, - "width":view["width"] - } - }, - addStyle:function(_element,_style){ - for(var key in _style){ - key = key=="float"?pi.env.ie?"styleFloat":"cssFloat":key; - if (key == "opacity" && pi.env.ie) { - pi.util.Element.setOpacity(_element,_style[key]); - continue; - } - try { - _element.style[key] = _style[key]; - }catch(e){} - } - }, - getStyle:function(_element,_property){ - _property = _property=="float"?pi.env.ie?"styleFloat":"cssFloat":_property; - if(_property=="opacity"&&pi.env.ie) - return pi.util.Element.getOpacity(_element.style); - return typeof _property=="string"?_element.style[_property]:_element.style; - }, - getValue:function(_element){ - switch(_element.nodeName.toLowerCase()){ - case "input": - case "textarea": - return _element.value; - case "select": - return _element.options[_element.selectedIndex].value; - default: - return _element.innerHTML; - break; - } - }, - getView:function(_element,_property){ - var view = document.defaultView?document.defaultView.getComputedStyle(_element,null):_element.currentStyle; - _property = _property=="float"?pi.env.ie?"styleFloat":"cssFloat":_property; - if(_property=="opacity"&&pi.env.ie) - return pi.util.Element.getOpacity(_element,view); - return typeof _property=="string"?view[_property]:view; - } - }, - Hash: { - clone:function(_hash,_undeep){ - var tmp = {}; - for(var key in _hash){ - if( !_undeep&&pi.util.IsArray( _hash[key] ) ){ - tmp[key] = pi.util.Array.clone( _hash[key] ); - } else if( !_undeep&&pi.util.IsHash( _hash[key] ) ){ - tmp[ key ] = pi.util.Hash.clone(_hash[key]); - } else { - tmp[key] = _hash[key]; - } - } - return tmp; - }, - merge:function(_hash,_source,_undeep){ - for(var key in _source){ - var value = _source[key]; - if (!_undeep&&pi.util.IsArray(_source[key])) { - if(pi.util.IsArray( _hash[key] )){ - Array.prototype.push.apply( _source[key], _hash[key] ) - } - else - value = pi.util.Array.clone(_source[key]); - } - else if (!_undeep&&pi.util.IsHash(_source[key])) { - if (pi.util.IsHash(_hash[key])) { - value = pi.util.Hash.merge(_hash[key], _source[key]); - } else { - value = pi.util.Hash.clone( _source[key] ); - } - } else if( _hash[key] ) - value = _hash[ key ]; - _hash[key] = value; - }; - return _hash; - } - }, - String:{ - format:function(_str){ - var values = Array.prototype.slice.call(arguments,1); - return _str.replace(/\{(\d)\}/g,function(){ - return values[arguments[1]]; - }) - } - }, - GetViewport:function(){ - return { - height:document.documentElement.clientHeight||document.body.clientHeight, - width:document.documentElement.clientWidth||document.body.clientWidth - } - } - }; - - pi.base = function(){ - this.body = {}; - this.init = null; - - this.build = function(_skipClonning){ - var base = this, skipClonning = _skipClonning||false, _private = {}, - fn = function(){ - var _p = pi.util.Hash.clone(_private); - if(!skipClonning){ - for(var key in this){ - if(pi.util.IsArray( this[ key ] ) ){ - this[key] = pi.util.Array.clone( this[key] ); - } else - if( pi.util.IsHash(this[key]) ){ - this[key] = pi.util.Hash.clone( - this[ key ], - function(_key,_object){ - this[ _key ]._parent_ = this; - } - ); - //this[key]._parent_ = this; - } - } - }; - base.createAccessors( _p, this ); - if(base.init) - return base.init.apply(this,arguments); - return this; - }; - this.movePrivateMembers(this.body,_private); - if(this.init){ - fn["$Init"] = this.init; - }; - fn.prototype = this.body; - return fn; - }; - - this.createAccessors = function(_p, _branch){ - var getter = function(_property){ return this[_property]; }, - setter = function(_property,_value){ this[_property] = _value; return _branch._parent_||_branch; }; - - for (var name in _p) { - var isPrivate = name.substring(0, 1) == "_", title = name.substring(1, 2).toUpperCase() + name.substring(2); - - if (isPrivate) { - _branch[(_branch["get" + title]?"_":"")+"get" + title] = pi.util.Curry(getter,_p,name); - _branch[(_branch["set" + title]?"_":"")+"set" + title] = pi.util.Curry(setter,_p,name); - } - else - if (pi.util.IsHash(_p[name])){ - _branch[name]._parent_ = _branch; - if(!_branch[name]) - _branch[name] = {}; - this.createAccessors(_p[name], _branch[name]); - } - }; - }; - - this.movePrivateMembers = function(_object, _branch){ - for (var name in _object) { - var isPrivate = name.substring(0, 1) == "_"; - - if (isPrivate) { - _branch[name] = _object[name]; - delete _object[name]; - } - else - if (pi.util.IsHash(_object[name])){ - _branch[name] = {}; - this.movePrivateMembers(_object[name], _branch[name]); - } - }; - }; - }; - - pi.element = new pi.base; - pi.element.init = function(_val){ - this.environment.setElement( - typeof _val=="string"||!_val? - document.createElement(_val||"DIV"): - _val - ); - return this; - }; - - pi.element.body = { - "addStyle":function(){ - return this.environment.addStyle.apply(this.environment,arguments); - }, - "clean":function(){ - var childs = this.child.get(); - while(childs.length){ - childs[0].parentNode.removeChild(childs[0]); - } - }, - "clone":function(_deep){ - return this.environment.getElement().cloneNode(_deep); - }, - "insert":function(_element){ - _element = _element.environment?_element.environment.getElement():_element; - _element.appendChild(this.environment.getElement()); - return this; - }, - "insertAfter":function(_referenceElement){ - _referenceElement = _referenceElement.environment?_referenceElement.environment.getElement():_referenceElement; - _referenceElement.nextSibling?this.insertBefore(_referenceElement.nextSibling):this.insert(_referenceElement.parentNode); - return this; - }, - "insertBefore":function(_referenceElement){ - _referenceElement = _referenceElement.environment?_referenceElement.environment.getElement():_referenceElement; - _referenceElement.parentNode.insertBefore(this.environment.getElement(),_referenceElement); - return this; - }, - "query":function(_expression,_resultType,namespaceResolver,_result){ - return pi.xpath(_expression,_resultType||"ORDERED_NODE_SNAPSHOT_TYPE",this.environment.getElement(),_namespaceResolver,_result); - }, - "remove":function(){ - if (this.environment.getParent()) { - this.environment.getParent().removeChild(this.environment.getElement()); - } - }, - "update":function(_value){ - this.element[this.element.nodeName.toLowerCase()=="textarea"||this.element.nodeName.toLowerCase()=="input"?"value":"innerHTML"]=_value; - return this; - }, - "attribute":{ - "getAll":function(){ - return this._parent_.environment.getElement().attributes; - }, - "clear":function(_name){ - this.set(_name,""); - return this._parent_; - }, - "get":function(_name){ - return this._parent_.environment.getElement().getAttribute(_name); - }, - "has":function(_name){ - return pi.env.ie?(this.get(_name)!=null):this._parent_.environment.getElement().hasAttribute(_name); - }, - "remove":function(_name){ - this._parent_.environment.getElement().removeAttribute(_name); - return this._parent_; - }, - "set":function(_name,_value){ - this._parent_.environment.getElement().setAttribute(_name,_value); - return this._parent_; - }, - "addClass":function(_classes){ - for(var i=0,len=arguments.length; i<len; i++){ - pi.util.Element.addClass(this._parent_.environment.getElement(),arguments[i]); - }; - return this._parent_; - }, - "clearClass":function(){ - this.setClass(""); - this._parent_; - }, - "getClass":function(){ - return pi.util.Element.getClass( this._parent_.environment.getElement() ); - }, - "hasClass":function(_class){ - return pi.util.Element.hasClass( this._parent_.environment.getElement(), _class ); - }, - "setClass":function(_value){ - return pi.util.Element.setClass( this._parent_.environment.getElement(), _value ); - }, - "removeClass":function(_class){ - pi.util.Element.removeClass( this._parent_.environment.getElement(), _class ); - return this._parent_; - }, - "toggleClass":function(_class){ - pi.util.Element.toggleClass( this._parent_.environment.getElement(), _class ); - } - }, - "child":{ - "get":function(){ - return this._parent_.environment.getElement().childNodes; - }, - "add":function(_elements){ - for (var i = 0; i < arguments.length; i++) { - var el = arguments[i]; - this._parent_.environment.getElement().appendChild( - el.environment ? el.environment.getElement() : el - ); - } - return this._parent_; - }, - "addAfter":function(_element,_referenceElement){ - this.addBefore( - _element.environment?_element.environment.getElement():_element, - (_referenceElement.environment?_referenceElement.environment.getElement():_referenceElement).nextSibling - ); - return this._parent_; - }, - "addBefore":function(_element,_referenceElement){ - this._parent_.environment.getElement().insertBefore( - _element.environment?_element.environment.getElement():_element, - _referenceElement.environment?_referenceElement.environment.getElement():_referenceElement - ); - return this._parent_; - }, - "remove":function(_element){ - this._parent_.environment.getElement().removeChild(_element.environment?_element.environment.getElement():_element); - } - }, - "environment":{ - "_element":null, - "setElement":function(_value){ - this._parent_.element = _value; - this._parent_.element.lib = this._parent_; - this._parent_.element.firebugElement = true; - this._setElement(_value); - }, - "getParent":function(){ - return this.getElement().parentNode; - }, - "getPosition":function(){ - return pi.util.Element.getPosition(this.getElement()); - }, - "getSize":function(){ - return pi.util.Element.getSize( this.getElement() ); - }, - "addStyle":function(_styleObject){ - pi.util.Element.addStyle(this.getElement(),_styleObject); - return this._parent_; - }, - "getStyle":function(_property){ - return pi.util.Element.getStyle(this.getElement(),_property); - }, - "getName":function(){ - return this.getElement().nodeName; - }, - "getType":function(){ - return this.getElement().nodeType; - }, - "getValue":function(){ - return pi.util.Element.getValue(this.getElement()); - }, - "getView":function(_property){ - return pi.util.Element.getView(this.getElement(),_property); - } - }, - "event":{ - "addListener":function(_event,_fn,_useCapture){ - pi.util.AddEvent(this._parent_.environment.getElement(),_event,_fn,_useCapture); - return this._parent_; - }, - "removeListener":function(_event,_fn,_useCapture){ - pi.util.RemoveEvent(this._parent_.environment.getElement(),_event,_fn,_useCapture); - return this._parent_; - } - } - }; - pi.element = pi.element.build(); - - pi.xhr = new pi.base; - pi.xhr.init = function(_url){ - if(!window.XMLHttpRequest){ - var names = ["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"]; - for (var i = 0; i < names.length; i++) { - try { - this.environment.setApi(new ActiveXObject(names[i])); - break; - } catch (e) { continue; } - } - } - else { - this.environment.setApi(new XMLHttpRequest()); - } - this.environment.getApi().onreadystatechange=pi.util.Curry(this.event.readystatechange,this); - this.environment.setUrl(_url); - this.environment.setCallback([]); - - return this; - }; - pi.xhr.body = { - "addCallback": function(){ - return this.environment.addCallback.apply(this.environment,arguments); - }, - "addData": function(){ - return this.environment.addData.apply(this.environment,arguments); - }, - "abort":function(){ - this.environment.getApi().abort(); - return this; - }, - "send":function(){ - var url = this.environment.getUrl(), data = this.environment.getData(),dataUrl = ""; - - if(!this.environment.getCache()) - data["forceCache"] = Number(new Date); - - for (var key in data) - dataUrl += pi.util.String.format("{0}={1}&",key, data[key]); - - if (this.environment.getType()=="GET") - url += (url.search("\\?")==-1?"?":"&")+pi.util.String.format("{0}",dataUrl); - - this.api.open(this.environment.getType(),url,this.environment.getAsync()); - if(this.environment.getType()=="POST"){ - this.api.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); - }; - this.api.send(this.environment.getType()=="GET"?"":dataUrl); - return this; - } - }; - pi.xhr.body.environment = { - "_async":true, "_api":null, "_cache":true, "_callback":null, "_data":{}, "_type":"GET", "_url":"", - "setApi":function(_value){ - this._parent_.api = _value; - this._setApi(_value); - }, - "addCallback": function(_readyState,_fn){ - this.getCallback().push({ "fn":_fn, "readyState":_readyState }); - return this._parent_; - }, - "addData": function(_key,_value){ - this.getData()[_key] = _value; - return this._parent_; - }, - "setType": function(_value){ - this._setType(_value); - return this._parent_; - } - }; - pi.xhr.body.event = { - "readystatechange":function(){ - var readyState = this.environment.getApi().readyState, callback=this.environment.getCallback(); - for (var i = 0, len=callback.length; i < len; i++) { - if(pi.util.Array.indexOf(callback[i].readyState,readyState)>-1){ - callback[i].fn.apply(this); - } - } - } - }; - pi.xhr = pi.xhr.build(); - - /* - * xml.xhr.get - */ - - pi.xhr.get = function(_url,_returnPiObject){ - var request = new pi.xhr(); - request.environment.setAsync(false); - request.environment.setUrl(_url); - request.send(); - return _returnPiObject?request:request.environment.getApi(); - }; - - /* - * registering onload event for init functions - */ - pi.util.AddEvent( - pi.env.ie?window:document, - pi.env.ie?"load":"DOMContentLoaded", - function(){ - for(var i=0,len=pi.util.Init.length; i<len; i++){ - pi.util.Init[ i ](); - } - } - ); -})(firebug); - -with(firebug){ - initConsole(); - lib.util.Init.push(firebug.init); -} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/DomParser.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/DomParser.js deleted file mode 100644 index 7024d7cedeb3..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/DomParser.js +++ /dev/null @@ -1,577 +0,0 @@ -/** - * DomParser.js - * - * Copyright 2010, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var Node = tinymce.html.Node; - - /** - * This class parses HTML code into a DOM like structure of nodes it will remove redundant whitespace and make - * sure that the node tree is valid according to the specified schema. So for example: <p>a<p>b</p>c</p> will become <p>a</p><p>b</p><p>c</p> - * - * @example - * var parser = new tinymce.html.DomParser({validate: true}, schema); - * var rootNode = parser.parse('<h1>content</h1>'); - * - * @class tinymce.html.DomParser - * @version 3.4 - */ - - /** - * Constructs a new DomParser instance. - * - * @constructor - * @method DomParser - * @param {Object} settings Name/value collection of settings. comment, cdata, text, start and end are callbacks. - * @param {tinymce.html.Schema} schema HTML Schema class to use when parsing. - */ - tinymce.html.DomParser = function(settings, schema) { - var self = this, nodeFilters = {}, attributeFilters = [], matchedNodes = {}, matchedAttributes = {}; - - settings = settings || {}; - settings.validate = "validate" in settings ? settings.validate : true; - settings.root_name = settings.root_name || 'body'; - self.schema = schema = schema || new tinymce.html.Schema(); - - function fixInvalidChildren(nodes) { - var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i, - childClone, nonEmptyElements, nonSplitableElements, sibling, nextNode; - - nonSplitableElements = tinymce.makeMap('tr,td,th,tbody,thead,tfoot,table'); - nonEmptyElements = schema.getNonEmptyElements(); - - for (ni = 0; ni < nodes.length; ni++) { - node = nodes[ni]; - - // Already removed - if (!node.parent) - continue; - - // Get list of all parent nodes until we find a valid parent to stick the child into - parents = [node]; - for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) && !nonSplitableElements[parent.name]; parent = parent.parent) - parents.push(parent); - - // Found a suitable parent - if (parent && parents.length > 1) { - // Reverse the array since it makes looping easier - parents.reverse(); - - // Clone the related parent and insert that after the moved node - newParent = currentNode = self.filterNode(parents[0].clone()); - - // Start cloning and moving children on the left side of the target node - for (i = 0; i < parents.length - 1; i++) { - if (schema.isValidChild(currentNode.name, parents[i].name)) { - tempNode = self.filterNode(parents[i].clone()); - currentNode.append(tempNode); - } else - tempNode = currentNode; - - for (childNode = parents[i].firstChild; childNode && childNode != parents[i + 1]; ) { - nextNode = childNode.next; - tempNode.append(childNode); - childNode = nextNode; - } - - currentNode = tempNode; - } - - if (!newParent.isEmpty(nonEmptyElements)) { - parent.insert(newParent, parents[0], true); - parent.insert(node, newParent); - } else { - parent.insert(node, parents[0], true); - } - - // Check if the element is empty by looking through it's contents and special treatment for <p><br /></p> - parent = parents[0]; - if (parent.isEmpty(nonEmptyElements) || parent.firstChild === parent.lastChild && parent.firstChild.name === 'br') { - parent.empty().remove(); - } - } else if (node.parent) { - // If it's an LI try to find a UL/OL for it or wrap it - if (node.name === 'li') { - sibling = node.prev; - if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) { - sibling.append(node); - continue; - } - - sibling = node.next; - if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) { - sibling.insert(node, sibling.firstChild, true); - continue; - } - - node.wrap(self.filterNode(new Node('ul', 1))); - continue; - } - - // Try wrapping the element in a DIV - if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) { - node.wrap(self.filterNode(new Node('div', 1))); - } else { - // We failed wrapping it, then remove or unwrap it - if (node.name === 'style' || node.name === 'script') - node.empty().remove(); - else - node.unwrap(); - } - } - } - }; - - /** - * Runs the specified node though the element and attributes filters. - * - * @param {tinymce.html.Node} Node the node to run filters on. - * @return {tinymce.html.Node} The passed in node. - */ - self.filterNode = function(node) { - var i, name, list; - - // Run element filters - if (name in nodeFilters) { - list = matchedNodes[name]; - - if (list) - list.push(node); - else - matchedNodes[name] = [node]; - } - - // Run attribute filters - i = attributeFilters.length; - while (i--) { - name = attributeFilters[i].name; - - if (name in node.attributes.map) { - list = matchedAttributes[name]; - - if (list) - list.push(node); - else - matchedAttributes[name] = [node]; - } - } - - return node; - }; - - /** - * Adds a node filter function to the parser, the parser will collect the specified nodes by name - * and then execute the callback ones it has finished parsing the document. - * - * @example - * parser.addNodeFilter('p,h1', function(nodes, name) { - * for (var i = 0; i < nodes.length; i++) { - * console.log(nodes[i].name); - * } - * }); - * @method addNodeFilter - * @method {String} name Comma separated list of nodes to collect. - * @param {function} callback Callback function to execute once it has collected nodes. - */ - self.addNodeFilter = function(name, callback) { - tinymce.each(tinymce.explode(name), function(name) { - var list = nodeFilters[name]; - - if (!list) - nodeFilters[name] = list = []; - - list.push(callback); - }); - }; - - /** - * Adds a attribute filter function to the parser, the parser will collect nodes that has the specified attributes - * and then execute the callback ones it has finished parsing the document. - * - * @example - * parser.addAttributeFilter('src,href', function(nodes, name) { - * for (var i = 0; i < nodes.length; i++) { - * console.log(nodes[i].name); - * } - * }); - * @method addAttributeFilter - * @method {String} name Comma separated list of nodes to collect. - * @param {function} callback Callback function to execute once it has collected nodes. - */ - self.addAttributeFilter = function(name, callback) { - tinymce.each(tinymce.explode(name), function(name) { - var i; - - for (i = 0; i < attributeFilters.length; i++) { - if (attributeFilters[i].name === name) { - attributeFilters[i].callbacks.push(callback); - return; - } - } - - attributeFilters.push({name: name, callbacks: [callback]}); - }); - }; - - /** - * Parses the specified HTML string into a DOM like node tree and returns the result. - * - * @example - * var rootNode = new DomParser({...}).parse('<b>text</b>'); - * @method parse - * @param {String} html Html string to sax parse. - * @param {Object} args Optional args object that gets passed to all filter functions. - * @return {tinymce.html.Node} Root node containing the tree. - */ - self.parse = function(html, args) { - var parser, rootNode, node, nodes, i, l, fi, fl, list, name, validate, - blockElements, startWhiteSpaceRegExp, invalidChildren = [], - endWhiteSpaceRegExp, allWhiteSpaceRegExp, whiteSpaceElements, children, nonEmptyElements, rootBlockName; - - args = args || {}; - matchedNodes = {}; - matchedAttributes = {}; - blockElements = tinymce.extend(tinymce.makeMap('script,style,head,html,body,title,meta,param'), schema.getBlockElements()); - nonEmptyElements = schema.getNonEmptyElements(); - children = schema.children; - validate = settings.validate; - rootBlockName = "forced_root_block" in args ? args.forced_root_block : settings.forced_root_block; - - whiteSpaceElements = schema.getWhiteSpaceElements(); - startWhiteSpaceRegExp = /^[ \t\r\n]+/; - endWhiteSpaceRegExp = /[ \t\r\n]+$/; - allWhiteSpaceRegExp = /[ \t\r\n]+/g; - - function addRootBlocks() { - var node = rootNode.firstChild, next, rootBlockNode; - - while (node) { - next = node.next; - - if (node.type == 3 || (node.type == 1 && node.name !== 'p' && !blockElements[node.name] && !node.attr('data-mce-type'))) { - if (!rootBlockNode) { - // Create a new root block element - rootBlockNode = createNode(rootBlockName, 1); - rootNode.insert(rootBlockNode, node); - rootBlockNode.append(node); - } else - rootBlockNode.append(node); - } else { - rootBlockNode = null; - } - - node = next; - }; - }; - - function createNode(name, type) { - var node = new Node(name, type), list; - - if (name in nodeFilters) { - list = matchedNodes[name]; - - if (list) - list.push(node); - else - matchedNodes[name] = [node]; - } - - return node; - }; - - function removeWhitespaceBefore(node) { - var textNode, textVal, sibling; - - for (textNode = node.prev; textNode && textNode.type === 3; ) { - textVal = textNode.value.replace(endWhiteSpaceRegExp, ''); - - if (textVal.length > 0) { - textNode.value = textVal; - textNode = textNode.prev; - } else { - sibling = textNode.prev; - textNode.remove(); - textNode = sibling; - } - } - }; - - parser = new tinymce.html.SaxParser({ - validate : validate, - fix_self_closing : !validate, // Let the DOM parser handle <li> in <li> or <p> in <p> for better results - - cdata: function(text) { - node.append(createNode('#cdata', 4)).value = text; - }, - - text: function(text, raw) { - var textNode; - - // Trim all redundant whitespace on non white space elements - if (!whiteSpaceElements[node.name]) { - text = text.replace(allWhiteSpaceRegExp, ' '); - - if (node.lastChild && blockElements[node.lastChild.name]) - text = text.replace(startWhiteSpaceRegExp, ''); - } - - // Do we need to create the node - if (text.length !== 0) { - textNode = createNode('#text', 3); - textNode.raw = !!raw; - node.append(textNode).value = text; - } - }, - - comment: function(text) { - node.append(createNode('#comment', 8)).value = text; - }, - - pi: function(name, text) { - node.append(createNode(name, 7)).value = text; - removeWhitespaceBefore(node); - }, - - doctype: function(text) { - var newNode; - - newNode = node.append(createNode('#doctype', 10)); - newNode.value = text; - removeWhitespaceBefore(node); - }, - - start: function(name, attrs, empty) { - var newNode, attrFiltersLen, elementRule, textNode, attrName, text, sibling, parent; - - elementRule = validate ? schema.getElementRule(name) : {}; - if (elementRule) { - newNode = createNode(elementRule.outputName || name, 1); - newNode.attributes = attrs; - newNode.shortEnded = empty; - - node.append(newNode); - - // Check if node is valid child of the parent node is the child is - // unknown we don't collect it since it's probably a custom element - parent = children[node.name]; - if (parent && children[newNode.name] && !parent[newNode.name]) - invalidChildren.push(newNode); - - attrFiltersLen = attributeFilters.length; - while (attrFiltersLen--) { - attrName = attributeFilters[attrFiltersLen].name; - - if (attrName in attrs.map) { - list = matchedAttributes[attrName]; - - if (list) - list.push(newNode); - else - matchedAttributes[attrName] = [newNode]; - } - } - - // Trim whitespace before block - if (blockElements[name]) - removeWhitespaceBefore(newNode); - - // Change current node if the element wasn't empty i.e not <br /> or <img /> - if (!empty) - node = newNode; - } - }, - - end: function(name) { - var textNode, elementRule, text, sibling, tempNode; - - elementRule = validate ? schema.getElementRule(name) : {}; - if (elementRule) { - if (blockElements[name]) { - if (!whiteSpaceElements[node.name]) { - // Trim whitespace at beginning of block - for (textNode = node.firstChild; textNode && textNode.type === 3; ) { - text = textNode.value.replace(startWhiteSpaceRegExp, ''); - - if (text.length > 0) { - textNode.value = text; - textNode = textNode.next; - } else { - sibling = textNode.next; - textNode.remove(); - textNode = sibling; - } - } - - // Trim whitespace at end of block - for (textNode = node.lastChild; textNode && textNode.type === 3; ) { - text = textNode.value.replace(endWhiteSpaceRegExp, ''); - - if (text.length > 0) { - textNode.value = text; - textNode = textNode.prev; - } else { - sibling = textNode.prev; - textNode.remove(); - textNode = sibling; - } - } - } - - // Trim start white space - textNode = node.prev; - if (textNode && textNode.type === 3) { - text = textNode.value.replace(startWhiteSpaceRegExp, ''); - - if (text.length > 0) - textNode.value = text; - else - textNode.remove(); - } - } - - // Handle empty nodes - if (elementRule.removeEmpty || elementRule.paddEmpty) { - if (node.isEmpty(nonEmptyElements)) { - if (elementRule.paddEmpty) - node.empty().append(new Node('#text', '3')).value = '\u00a0'; - else { - // Leave nodes that have a name like <a name="name"> - if (!node.attributes.map.name) { - tempNode = node.parent; - node.empty().remove(); - node = tempNode; - return; - } - } - } - } - - node = node.parent; - } - } - }, schema); - - rootNode = node = new Node(args.context || settings.root_name, 11); - - parser.parse(html); - - // Fix invalid children or report invalid children in a contextual parsing - if (validate && invalidChildren.length) { - if (!args.context) - fixInvalidChildren(invalidChildren); - else - args.invalid = true; - } - - // Wrap nodes in the root into block elements if the root is body - if (rootBlockName && rootNode.name == 'body') - addRootBlocks(); - - // Run filters only when the contents is valid - if (!args.invalid) { - // Run node filters - for (name in matchedNodes) { - list = nodeFilters[name]; - nodes = matchedNodes[name]; - - // Remove already removed children - fi = nodes.length; - while (fi--) { - if (!nodes[fi].parent) - nodes.splice(fi, 1); - } - - for (i = 0, l = list.length; i < l; i++) - list[i](nodes, name, args); - } - - // Run attribute filters - for (i = 0, l = attributeFilters.length; i < l; i++) { - list = attributeFilters[i]; - - if (list.name in matchedAttributes) { - nodes = matchedAttributes[list.name]; - - // Remove already removed children - fi = nodes.length; - while (fi--) { - if (!nodes[fi].parent) - nodes.splice(fi, 1); - } - - for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) - list.callbacks[fi](nodes, list.name, args); - } - } - } - - return rootNode; - }; - - // Remove <br> at end of block elements Gecko and WebKit injects BR elements to - // make it possible to place the caret inside empty blocks. This logic tries to remove - // these elements and keep br elements that where intended to be there intact - if (settings.remove_trailing_brs) { - self.addNodeFilter('br', function(nodes, name) { - var i, l = nodes.length, node, blockElements = schema.getBlockElements(), - nonEmptyElements = schema.getNonEmptyElements(), parent, prev, prevName; - - // Remove brs from body element as well - blockElements.body = 1; - - // Must loop forwards since it will otherwise remove all brs in <p>a<br><br><br></p> - for (i = 0; i < l; i++) { - node = nodes[i]; - parent = node.parent; - - if (blockElements[node.parent.name] && node === parent.lastChild) { - // Loop all nodes to the right of the current node and check for other BR elements - // excluding bookmarks since they are invisible - prev = node.prev; - while (prev) { - prevName = prev.name; - - // Ignore bookmarks - if (prevName !== "span" || prev.attr('data-mce-type') !== 'bookmark') { - // Found a non BR element - if (prevName !== "br") - break; - - // Found another br it's a <br><br> structure then don't remove anything - if (prevName === 'br') { - node = null; - break; - } - } - - prev = prev.prev; - } - - if (node) { - node.remove(); - - // Is the parent to be considered empty after we removed the BR - if (parent.isEmpty(nonEmptyElements)) { - elementRule = schema.getElementRule(parent.name); - - // Remove or padd the element depending on schema rule - if (elementRule) { - if (elementRule.removeEmpty) - parent.remove(); - else if (elementRule.paddEmpty) - parent.empty().append(new tinymce.html.Node('#text', 3)).value = '\u00a0'; - } - } - } - } - } - }); - } - } -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/Entities.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/Entities.js deleted file mode 100644 index 071d6966d3b2..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/Entities.js +++ /dev/null @@ -1,253 +0,0 @@ -/** - * Entities.js - * - * Copyright 2010, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var namedEntities, baseEntities, reverseEntities, - attrsCharsRegExp = /[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, - textCharsRegExp = /[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, - rawCharsRegExp = /[<>&\"\']/g, - entityRegExp = /&(#x|#)?([\w]+);/g, - asciiMap = { - 128 : "\u20AC", 130 : "\u201A", 131 : "\u0192", 132 : "\u201E", 133 : "\u2026", 134 : "\u2020", - 135 : "\u2021", 136 : "\u02C6", 137 : "\u2030", 138 : "\u0160", 139 : "\u2039", 140 : "\u0152", - 142 : "\u017D", 145 : "\u2018", 146 : "\u2019", 147 : "\u201C", 148 : "\u201D", 149 : "\u2022", - 150 : "\u2013", 151 : "\u2014", 152 : "\u02DC", 153 : "\u2122", 154 : "\u0161", 155 : "\u203A", - 156 : "\u0153", 158 : "\u017E", 159 : "\u0178" - }; - - // Raw entities - baseEntities = { - '\"' : '"', // Needs to be escaped since the YUI compressor would otherwise break the code - "'" : ''', - '<' : '<', - '>' : '>', - '&' : '&' - }; - - // Reverse lookup table for raw entities - reverseEntities = { - '<' : '<', - '>' : '>', - '&' : '&', - '"' : '"', - ''' : "'" - }; - - // Decodes text by using the browser - function nativeDecode(text) { - var elm; - - elm = document.createElement("div"); - elm.innerHTML = text; - - return elm.textContent || elm.innerText || text; - }; - - // Build a two way lookup table for the entities - function buildEntitiesLookup(items, radix) { - var i, chr, entity, lookup = {}; - - if (items) { - items = items.split(','); - radix = radix || 10; - - // Build entities lookup table - for (i = 0; i < items.length; i += 2) { - chr = String.fromCharCode(parseInt(items[i], radix)); - - // Only add non base entities - if (!baseEntities[chr]) { - entity = '&' + items[i + 1] + ';'; - lookup[chr] = entity; - lookup[entity] = chr; - } - } - - return lookup; - } - }; - - // Unpack entities lookup where the numbers are in radix 32 to reduce the size - namedEntities = buildEntitiesLookup( - '50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,' + - '5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,' + - '5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,' + - '5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,' + - '68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,' + - '6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,' + - '6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,' + - '75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,' + - '7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,' + - '7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,' + - 'sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,' + - 'st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,' + - 't9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,' + - 'tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,' + - 'u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,' + - '81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,' + - '8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,' + - '8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,' + - '8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,' + - '8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,' + - 'nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,' + - 'rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,' + - 'Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,' + - '80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,' + - '811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro' - , 32); - - tinymce.html = tinymce.html || {}; - - /** - * Entity encoder class. - * - * @class tinymce.html.SaxParser - * @static - * @version 3.4 - */ - tinymce.html.Entities = { - /** - * Encodes the specified string using raw entities. This means only the required XML base entities will be endoded. - * - * @method encodeRaw - * @param {String} text Text to encode. - * @param {Boolean} attr Optional flag to specify if the text is attribute contents. - * @return {String} Entity encoded text. - */ - encodeRaw : function(text, attr) { - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - return baseEntities[chr] || chr; - }); - }, - - /** - * Encoded the specified text with both the attributes and text entities. This function will produce larger text contents - * since it doesn't know if the context is within a attribute or text node. This was added for compatibility - * and is exposed as the DOMUtils.encode function. - * - * @method encodeAllRaw - * @param {String} text Text to encode. - * @return {String} Entity encoded text. - */ - encodeAllRaw : function(text) { - return ('' + text).replace(rawCharsRegExp, function(chr) { - return baseEntities[chr] || chr; - }); - }, - - /** - * Encodes the specified string using numeric entities. The core entities will be encoded as named ones but all non lower ascii characters - * will be encoded into numeric entities. - * - * @method encodeNumeric - * @param {String} text Text to encode. - * @param {Boolean} attr Optional flag to specify if the text is attribute contents. - * @return {String} Entity encoded text. - */ - encodeNumeric : function(text, attr) { - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - // Multi byte sequence convert it to a single entity - if (chr.length > 1) - return '&#' + (((chr.charCodeAt(0) - 0xD800) * 0x400) + (chr.charCodeAt(1) - 0xDC00) + 0x10000) + ';'; - - return baseEntities[chr] || '&#' + chr.charCodeAt(0) + ';'; - }); - }, - - /** - * Encodes the specified string using named entities. The core entities will be encoded as named ones but all non lower ascii characters - * will be encoded into named entities. - * - * @method encodeNamed - * @param {String} text Text to encode. - * @param {Boolean} attr Optional flag to specify if the text is attribute contents. - * @param {Object} entities Optional parameter with entities to use. - * @return {String} Entity encoded text. - */ - encodeNamed : function(text, attr, entities) { - entities = entities || namedEntities; - - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - return baseEntities[chr] || entities[chr] || chr; - }); - }, - - /** - * Returns an encode function based on the name(s) and it's optional entities. - * - * @method getEncodeFunc - * @param {String} name Comma separated list of encoders for example named,numeric. - * @param {String} entities Optional parameter with entities to use instead of the built in set. - * @return {function} Encode function to be used. - */ - getEncodeFunc : function(name, entities) { - var Entities = tinymce.html.Entities; - - entities = buildEntitiesLookup(entities) || namedEntities; - - function encodeNamedAndNumeric(text, attr) { - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - return baseEntities[chr] || entities[chr] || '&#' + chr.charCodeAt(0) + ';' || chr; - }); - }; - - function encodeCustomNamed(text, attr) { - return Entities.encodeNamed(text, attr, entities); - }; - - // Replace + with , to be compatible with previous TinyMCE versions - name = tinymce.makeMap(name.replace(/\+/g, ',')); - - // Named and numeric encoder - if (name.named && name.numeric) - return encodeNamedAndNumeric; - - // Named encoder - if (name.named) { - // Custom names - if (entities) - return encodeCustomNamed; - - return Entities.encodeNamed; - } - - // Numeric - if (name.numeric) - return Entities.encodeNumeric; - - // Raw encoder - return Entities.encodeRaw; - }, - - /** - * Decodes the specified string, this will replace entities with raw UTF characters. - * - * @param {String} text Text to entity decode. - * @return {String} Entity decoded string. - */ - decode : function(text) { - return text.replace(entityRegExp, function(all, numeric, value) { - if (numeric) { - value = parseInt(value, numeric.length === 2 ? 16 : 10); - - // Support upper UTF - if (value > 0xFFFF) { - value -= 0x10000; - - return String.fromCharCode(0xD800 + (value >> 10), 0xDC00 + (value & 0x3FF)); - } else - return asciiMap[value] || String.fromCharCode(value); - } - - return reverseEntities[all] || namedEntities[all] || nativeDecode(all); - }); - } - }; -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/Node.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/Node.js deleted file mode 100644 index 58074216458e..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/Node.js +++ /dev/null @@ -1,474 +0,0 @@ -/** - * Node.js - * - * Copyright 2010, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var whiteSpaceRegExp = /^[ \t\r\n]*$/, typeLookup = { - '#text' : 3, - '#comment' : 8, - '#cdata' : 4, - '#pi' : 7, - '#doctype' : 10, - '#document-fragment' : 11 - }; - - // Walks the tree left/right - function walk(node, root_node, prev) { - var sibling, parent, startName = prev ? 'lastChild' : 'firstChild', siblingName = prev ? 'prev' : 'next'; - - // Walk into nodes if it has a start - if (node[startName]) - return node[startName]; - - // Return the sibling if it has one - if (node !== root_node) { - sibling = node[siblingName]; - - if (sibling) - return sibling; - - // Walk up the parents to look for siblings - for (parent = node.parent; parent && parent !== root_node; parent = parent.parent) { - sibling = parent[siblingName]; - - if (sibling) - return sibling; - } - } - }; - - /** - * This class is a minimalistic implementation of a DOM like node used by the DomParser class. - * - * @example - * var node = new tinymce.html.Node('strong', 1); - * someRoot.append(node); - * - * @class tinymce.html.Node - * @version 3.4 - */ - - /** - * Constructs a new Node instance. - * - * @constructor - * @method Node - * @param {String} name Name of the node type. - * @param {Number} type Numeric type representing the node. - */ - function Node(name, type) { - this.name = name; - this.type = type; - - if (type === 1) { - this.attributes = []; - this.attributes.map = {}; - } - } - - tinymce.extend(Node.prototype, { - /** - * Replaces the current node with the specified one. - * - * @example - * someNode.replace(someNewNode); - * - * @method replace - * @param {tinymce.html.Node} node Node to replace the current node with. - * @return {tinymce.html.Node} The old node that got replaced. - */ - replace : function(node) { - var self = this; - - if (node.parent) - node.remove(); - - self.insert(node, self); - self.remove(); - - return self; - }, - - /** - * Gets/sets or removes an attribute by name. - * - * @example - * someNode.attr("name", "value"); // Sets an attribute - * console.log(someNode.attr("name")); // Gets an attribute - * someNode.attr("name", null); // Removes an attribute - * - * @method attr - * @param {String} name Attribute name to set or get. - * @param {String} value Optional value to set. - * @return {String/tinymce.html.Node} String or undefined on a get operation or the current node on a set operation. - */ - attr : function(name, value) { - var self = this, attrs, i, undef; - - if (typeof name !== "string") { - for (i in name) - self.attr(i, name[i]); - - return self; - } - - if (attrs = self.attributes) { - if (value !== undef) { - // Remove attribute - if (value === null) { - if (name in attrs.map) { - delete attrs.map[name]; - - i = attrs.length; - while (i--) { - if (attrs[i].name === name) { - attrs = attrs.splice(i, 1); - return self; - } - } - } - - return self; - } - - // Set attribute - if (name in attrs.map) { - // Set attribute - i = attrs.length; - while (i--) { - if (attrs[i].name === name) { - attrs[i].value = value; - break; - } - } - } else - attrs.push({name: name, value: value}); - - attrs.map[name] = value; - - return self; - } else { - return attrs.map[name]; - } - } - }, - - /** - * Does a shallow clones the node into a new node. It will also exclude id attributes since - * there should only be one id per document. - * - * @example - * var clonedNode = node.clone(); - * - * @method clone - * @return {tinymce.html.Node} New copy of the original node. - */ - clone : function() { - var self = this, clone = new Node(self.name, self.type), i, l, selfAttrs, selfAttr, cloneAttrs; - - // Clone element attributes - if (selfAttrs = self.attributes) { - cloneAttrs = []; - cloneAttrs.map = {}; - - for (i = 0, l = selfAttrs.length; i < l; i++) { - selfAttr = selfAttrs[i]; - - // Clone everything except id - if (selfAttr.name !== 'id') { - cloneAttrs[cloneAttrs.length] = {name: selfAttr.name, value: selfAttr.value}; - cloneAttrs.map[selfAttr.name] = selfAttr.value; - } - } - - clone.attributes = cloneAttrs; - } - - clone.value = self.value; - clone.shortEnded = self.shortEnded; - - return clone; - }, - - /** - * Wraps the node in another node. - * - * @example - * node.wrap(wrapperNode); - * - * @method wrap - */ - wrap : function(wrapper) { - var self = this; - - self.parent.insert(wrapper, self); - wrapper.append(self); - - return self; - }, - - /** - * Unwraps the node in other words it removes the node but keeps the children. - * - * @example - * node.unwrap(); - * - * @method unwrap - */ - unwrap : function() { - var self = this, node, next; - - for (node = self.firstChild; node; ) { - next = node.next; - self.insert(node, self, true); - node = next; - } - - self.remove(); - }, - - /** - * Removes the node from it's parent. - * - * @example - * node.remove(); - * - * @method remove - * @return {tinymce.html.Node} Current node that got removed. - */ - remove : function() { - var self = this, parent = self.parent, next = self.next, prev = self.prev; - - if (parent) { - if (parent.firstChild === self) { - parent.firstChild = next; - - if (next) - next.prev = null; - } else { - prev.next = next; - } - - if (parent.lastChild === self) { - parent.lastChild = prev; - - if (prev) - prev.next = null; - } else { - next.prev = prev; - } - - self.parent = self.next = self.prev = null; - } - - return self; - }, - - /** - * Appends a new node as a child of the current node. - * - * @example - * node.append(someNode); - * - * @method append - * @param {tinymce.html.Node} node Node to append as a child of the current one. - * @return {tinymce.html.Node} The node that got appended. - */ - append : function(node) { - var self = this, last; - - if (node.parent) - node.remove(); - - last = self.lastChild; - if (last) { - last.next = node; - node.prev = last; - self.lastChild = node; - } else - self.lastChild = self.firstChild = node; - - node.parent = self; - - return node; - }, - - /** - * Inserts a node at a specific position as a child of the current node. - * - * @example - * parentNode.insert(newChildNode, oldChildNode); - * - * @method insert - * @param {tinymce.html.Node} node Node to insert as a child of the current node. - * @param {tinymce.html.Node} ref_node Reference node to set node before/after. - * @param {Boolean} before Optional state to insert the node before the reference node. - * @return {tinymce.html.Node} The node that got inserted. - */ - insert : function(node, ref_node, before) { - var parent; - - if (node.parent) - node.remove(); - - parent = ref_node.parent || this; - - if (before) { - if (ref_node === parent.firstChild) - parent.firstChild = node; - else - ref_node.prev.next = node; - - node.prev = ref_node.prev; - node.next = ref_node; - ref_node.prev = node; - } else { - if (ref_node === parent.lastChild) - parent.lastChild = node; - else - ref_node.next.prev = node; - - node.next = ref_node.next; - node.prev = ref_node; - ref_node.next = node; - } - - node.parent = parent; - - return node; - }, - - /** - * Get all children by name. - * - * @method getAll - * @param {String} name Name of the child nodes to collect. - * @return {Array} Array with child nodes matchin the specified name. - */ - getAll : function(name) { - var self = this, node, collection = []; - - for (node = self.firstChild; node; node = walk(node, self)) { - if (node.name === name) - collection.push(node); - } - - return collection; - }, - - /** - * Removes all children of the current node. - * - * @method empty - * @return {tinymce.html.Node} The current node that got cleared. - */ - empty : function() { - var self = this, nodes, i, node; - - // Remove all children - if (self.firstChild) { - nodes = []; - - // Collect the children - for (node = self.firstChild; node; node = walk(node, self)) - nodes.push(node); - - // Remove the children - i = nodes.length; - while (i--) { - node = nodes[i]; - node.parent = node.firstChild = node.lastChild = node.next = node.prev = null; - } - } - - self.firstChild = self.lastChild = null; - - return self; - }, - - /** - * Returns true/false if the node is to be considered empty or not. - * - * @example - * node.isEmpty({img : true}); - * @method isEmpty - * @param {Object} elements Name/value object with elements that are automatically treated as non empty elements. - * @return {Boolean} true/false if the node is empty or not. - */ - isEmpty : function(elements) { - var self = this, node = self.firstChild, i, name; - - if (node) { - do { - if (node.type === 1) { - // Ignore bogus elements - if (node.attributes.map['data-mce-bogus']) - continue; - - // Keep empty elements like <img /> - if (elements[node.name]) - return false; - - // Keep elements with data attributes or name attribute like <a name="1"></a> - i = node.attributes.length; - while (i--) { - name = node.attributes[i].name; - if (name === "name" || name.indexOf('data-') === 0) - return false; - } - } - - // Keep non whitespace text nodes - if ((node.type === 3 && !whiteSpaceRegExp.test(node.value))) - return false; - } while (node = walk(node, self)); - } - - return true; - }, - - /** - * Walks to the next or previous node and returns that node or null if it wasn't found. - * - * @method walk - * @param {Boolean} prev Optional previous node state defaults to false. - * @return {tinymce.html.Node} Node that is next to or previous of the current node. - */ - walk : function(prev) { - return walk(this, null, prev); - } - }); - - tinymce.extend(Node, { - /** - * Creates a node of a specific type. - * - * @static - * @method create - * @param {String} name Name of the node type to create for example "b" or "#text". - * @param {Object} attrs Name/value collection of attributes that will be applied to elements. - */ - create : function(name, attrs) { - var node, attrName; - - // Create node - node = new Node(name, typeLookup[name] || 1); - - // Add attributes if needed - if (attrs) { - for (attrName in attrs) - node.attr(attrName, attrs[attrName]); - } - - return node; - } - }); - - tinymce.html.Node = Node; -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/SaxParser.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/SaxParser.js deleted file mode 100644 index b5bb716c6603..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/SaxParser.js +++ /dev/null @@ -1,355 +0,0 @@ -/** - * SaxParser.js - * - * Copyright 2010, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - /** - * This class parses HTML code using pure JavaScript and executes various events for each item it finds. It will - * always execute the events in the right order for tag soup code like <b><p></b></p>. It will also remove elements - * and attributes that doesn't fit the schema if the validate setting is enabled. - * - * @example - * var parser = new tinymce.html.SaxParser({ - * validate: true, - * - * comment: function(text) { - * console.log('Comment:', text); - * }, - * - * cdata: function(text) { - * console.log('CDATA:', text); - * }, - * - * text: function(text, raw) { - * console.log('Text:', text, 'Raw:', raw); - * }, - * - * start: function(name, attrs, empty) { - * console.log('Start:', name, attrs, empty); - * }, - * - * end: function(name) { - * console.log('End:', name); - * }, - * - * pi: function(name, text) { - * console.log('PI:', name, text); - * }, - * - * doctype: function(text) { - * console.log('DocType:', text); - * } - * }, schema); - * @class tinymce.html.SaxParser - * @version 3.4 - */ - - /** - * Constructs a new SaxParser instance. - * - * @constructor - * @method SaxParser - * @param {Object} settings Name/value collection of settings. comment, cdata, text, start and end are callbacks. - * @param {tinymce.html.Schema} schema HTML Schema class to use when parsing. - */ - tinymce.html.SaxParser = function(settings, schema) { - var self = this, noop = function() {}; - - settings = settings || {}; - self.schema = schema = schema || new tinymce.html.Schema(); - - if (settings.fix_self_closing !== false) - settings.fix_self_closing = true; - - // Add handler functions from settings and setup default handlers - tinymce.each('comment cdata text start end pi doctype'.split(' '), function(name) { - if (name) - self[name] = settings[name] || noop; - }); - - /** - * Parses the specified HTML string and executes the callbacks for each item it finds. - * - * @example - * new SaxParser({...}).parse('<b>text</b>'); - * @method parse - * @param {String} html Html string to sax parse. - */ - self.parse = function(html) { - var self = this, matches, index = 0, value, endRegExp, stack = [], attrList, i, text, name, isInternalElement, removeInternalElements, - shortEndedElements, fillAttrsMap, isShortEnded, validate, elementRule, isValidElement, attr, attribsValue, invalidPrefixRegExp, - validAttributesMap, validAttributePatterns, attributesRequired, attributesDefault, attributesForced, selfClosing, - tokenRegExp, attrRegExp, specialElements, attrValue, idCount = 0, decode = tinymce.html.Entities.decode, fixSelfClosing, isIE; - - function processEndTag(name) { - var pos, i; - - // Find position of parent of the same type - pos = stack.length; - while (pos--) { - if (stack[pos].name === name) - break; - } - - // Found parent - if (pos >= 0) { - // Close all the open elements - for (i = stack.length - 1; i >= pos; i--) { - name = stack[i]; - - if (name.valid) - self.end(name.name); - } - - // Remove the open elements from the stack - stack.length = pos; - } - }; - - // Precompile RegExps and map objects - tokenRegExp = new RegExp('<(?:' + - '(?:!--([\\w\\W]*?)-->)|' + // Comment - '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + // CDATA - '(?:!DOCTYPE([\\w\\W]*?)>)|' + // DOCTYPE - '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + // PI - '(?:\\/([^>]+)>)|' + // End element - '(?:([^\\s\\/<>]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/)>)' + // Start element - ')', 'g'); - - attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g; - specialElements = { - 'script' : /<\/script[^>]*>/gi, - 'style' : /<\/style[^>]*>/gi, - 'noscript' : /<\/noscript[^>]*>/gi - }; - - // Setup lookup tables for empty elements and boolean attributes - shortEndedElements = schema.getShortEndedElements(); - selfClosing = schema.getSelfClosingElements(); - fillAttrsMap = schema.getBoolAttrs(); - validate = settings.validate; - removeInternalElements = settings.remove_internals; - fixSelfClosing = settings.fix_self_closing; - isIE = tinymce.isIE; - invalidPrefixRegExp = /^:/; - - while (matches = tokenRegExp.exec(html)) { - // Text - if (index < matches.index) - self.text(decode(html.substr(index, matches.index - index))); - - if (value = matches[6]) { // End element - value = value.toLowerCase(); - - // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements - if (isIE && invalidPrefixRegExp.test(value)) - value = value.substr(1); - - processEndTag(value); - } else if (value = matches[7]) { // Start element - value = value.toLowerCase(); - - // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements - if (isIE && invalidPrefixRegExp.test(value)) - value = value.substr(1); - - isShortEnded = value in shortEndedElements; - - // Is self closing tag for example an <li> after an open <li> - if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) - processEndTag(value); - - // Validate element - if (!validate || (elementRule = schema.getElementRule(value))) { - isValidElement = true; - - // Grab attributes map and patters when validation is enabled - if (validate) { - validAttributesMap = elementRule.attributes; - validAttributePatterns = elementRule.attributePatterns; - } - - // Parse attributes - if (attribsValue = matches[8]) { - isInternalElement = attribsValue.indexOf('data-mce-type') !== -1; // Check if the element is an internal element - - // If the element has internal attributes then remove it if we are told to do so - if (isInternalElement && removeInternalElements) - isValidElement = false; - - attrList = []; - attrList.map = {}; - - attribsValue.replace(attrRegExp, function(match, name, value, val2, val3) { - var attrRule, i; - - name = name.toLowerCase(); - value = name in fillAttrsMap ? name : decode(value || val2 || val3 || ''); // Handle boolean attribute than value attribute - - // Validate name and value - if (validate && !isInternalElement && name.indexOf('data-') !== 0) { - attrRule = validAttributesMap[name]; - - // Find rule by pattern matching - if (!attrRule && validAttributePatterns) { - i = validAttributePatterns.length; - while (i--) { - attrRule = validAttributePatterns[i]; - if (attrRule.pattern.test(name)) - break; - } - - // No rule matched - if (i === -1) - attrRule = null; - } - - // No attribute rule found - if (!attrRule) - return; - - // Validate value - if (attrRule.validValues && !(value in attrRule.validValues)) - return; - } - - // Add attribute to list and map - attrList.map[name] = value; - attrList.push({ - name: name, - value: value - }); - }); - } else { - attrList = []; - attrList.map = {}; - } - - // Process attributes if validation is enabled - if (validate && !isInternalElement) { - attributesRequired = elementRule.attributesRequired; - attributesDefault = elementRule.attributesDefault; - attributesForced = elementRule.attributesForced; - - // Handle forced attributes - if (attributesForced) { - i = attributesForced.length; - while (i--) { - attr = attributesForced[i]; - name = attr.name; - attrValue = attr.value; - - if (attrValue === '{$uid}') - attrValue = 'mce_' + idCount++; - - attrList.map[name] = attrValue; - attrList.push({name: name, value: attrValue}); - } - } - - // Handle default attributes - if (attributesDefault) { - i = attributesDefault.length; - while (i--) { - attr = attributesDefault[i]; - name = attr.name; - - if (!(name in attrList.map)) { - attrValue = attr.value; - - if (attrValue === '{$uid}') - attrValue = 'mce_' + idCount++; - - attrList.map[name] = attrValue; - attrList.push({name: name, value: attrValue}); - } - } - } - - // Handle required attributes - if (attributesRequired) { - i = attributesRequired.length; - while (i--) { - if (attributesRequired[i] in attrList.map) - break; - } - - // None of the required attributes where found - if (i === -1) - isValidElement = false; - } - - // Invalidate element if it's marked as bogus - if (attrList.map['data-mce-bogus']) - isValidElement = false; - } - - if (isValidElement) - self.start(value, attrList, isShortEnded); - } else - isValidElement = false; - - // Treat script, noscript and style a bit different since they may include code that looks like elements - if (endRegExp = specialElements[value]) { - endRegExp.lastIndex = index = matches.index + matches[0].length; - - if (matches = endRegExp.exec(html)) { - if (isValidElement) - text = html.substr(index, matches.index - index); - - index = matches.index + matches[0].length; - } else { - text = html.substr(index); - index = html.length; - } - - if (isValidElement && text.length > 0) - self.text(text, true); - - if (isValidElement) - self.end(value); - - tokenRegExp.lastIndex = index; - continue; - } - - // Push value on to stack - if (!isShortEnded) { - if (!attribsValue || attribsValue.indexOf('/') != attribsValue.length - 1) - stack.push({name: value, valid: isValidElement}); - else if (isValidElement) - self.end(value); - } - } else if (value = matches[1]) { // Comment - self.comment(value); - } else if (value = matches[2]) { // CDATA - self.cdata(value); - } else if (value = matches[3]) { // DOCTYPE - self.doctype(value); - } else if (value = matches[4]) { // PI - self.pi(value, matches[5]); - } - - index = matches.index + matches[0].length; - } - - // Text - if (index < html.length) - self.text(decode(html.substr(index))); - - // Close any open elements - for (i = stack.length - 1; i >= 0; i--) { - value = stack[i]; - - if (value.valid) - self.end(value.name); - } - }; - } -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/Schema.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/Schema.js deleted file mode 100644 index f430c0dd04e5..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/Schema.js +++ /dev/null @@ -1,663 +0,0 @@ -/** - * Schema.js - * - * Copyright 2010, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var transitional = {}, boolAttrMap, blockElementsMap, shortEndedElementsMap, nonEmptyElementsMap, customElementsMap = {}, - defaultWhiteSpaceElementsMap, selfClosingElementsMap, makeMap = tinymce.makeMap, each = tinymce.each; - - function split(str, delim) { - return str.split(delim || ','); - }; - - /** - * Unpacks the specified lookup and string data it will also parse it into an object - * map with sub object for it's children. This will later also include the attributes. - */ - function unpack(lookup, data) { - var key, elements = {}; - - function replace(value) { - return value.replace(/[A-Z]+/g, function(key) { - return replace(lookup[key]); - }); - }; - - // Unpack lookup - for (key in lookup) { - if (lookup.hasOwnProperty(key)) - lookup[key] = replace(lookup[key]); - } - - // Unpack and parse data into object map - replace(data).replace(/#/g, '#text').replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g, function(str, name, attributes, children) { - attributes = split(attributes, '|'); - - elements[name] = { - attributes : makeMap(attributes), - attributesOrder : attributes, - children : makeMap(children, '|', {'#comment' : {}}) - } - }); - - return elements; - }; - - // Build a lookup table for block elements both lowercase and uppercase - blockElementsMap = 'h1,h2,h3,h4,h5,h6,hr,p,div,address,pre,form,table,tbody,thead,tfoot,' + - 'th,tr,td,li,ol,ul,caption,blockquote,center,dl,dt,dd,dir,fieldset,' + - 'noscript,menu,isindex,samp,header,footer,article,section,hgroup'; - blockElementsMap = makeMap(blockElementsMap, ',', makeMap(blockElementsMap.toUpperCase())); - - // This is the XHTML 1.0 transitional elements with it's attributes and children packed to reduce it's size - transitional = unpack({ - Z : 'H|K|N|O|P', - Y : 'X|form|R|Q', - ZG : 'E|span|width|align|char|charoff|valign', - X : 'p|T|div|U|W|isindex|fieldset|table', - ZF : 'E|align|char|charoff|valign', - W : 'pre|hr|blockquote|address|center|noframes', - ZE : 'abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height', - ZD : '[E][S]', - U : 'ul|ol|dl|menu|dir', - ZC : 'p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q', - T : 'h1|h2|h3|h4|h5|h6', - ZB : 'X|S|Q', - S : 'R|P', - ZA : 'a|G|J|M|O|P', - R : 'a|H|K|N|O', - Q : 'noscript|P', - P : 'ins|del|script', - O : 'input|select|textarea|label|button', - N : 'M|L', - M : 'em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym', - L : 'sub|sup', - K : 'J|I', - J : 'tt|i|b|u|s|strike', - I : 'big|small|font|basefont', - H : 'G|F', - G : 'br|span|bdo', - F : 'object|applet|img|map|iframe', - E : 'A|B|C', - D : 'accesskey|tabindex|onfocus|onblur', - C : 'onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup', - B : 'lang|xml:lang|dir', - A : 'id|class|style|title' - }, 'script[id|charset|type|language|src|defer|xml:space][]' + - 'style[B|id|type|media|title|xml:space][]' + - 'object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]' + - 'param[id|name|value|valuetype|type][]' + - 'p[E|align][#|S]' + - 'a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]' + - 'br[A|clear][]' + - 'span[E][#|S]' + - 'bdo[A|C|B][#|S]' + - 'applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]' + - 'h1[E|align][#|S]' + - 'img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]' + - 'map[B|C|A|name][X|form|Q|area]' + - 'h2[E|align][#|S]' + - 'iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]' + - 'h3[E|align][#|S]' + - 'tt[E][#|S]' + - 'i[E][#|S]' + - 'b[E][#|S]' + - 'u[E][#|S]' + - 's[E][#|S]' + - 'strike[E][#|S]' + - 'big[E][#|S]' + - 'small[E][#|S]' + - 'font[A|B|size|color|face][#|S]' + - 'basefont[id|size|color|face][]' + - 'em[E][#|S]' + - 'strong[E][#|S]' + - 'dfn[E][#|S]' + - 'code[E][#|S]' + - 'q[E|cite][#|S]' + - 'samp[E][#|S]' + - 'kbd[E][#|S]' + - 'var[E][#|S]' + - 'cite[E][#|S]' + - 'abbr[E][#|S]' + - 'acronym[E][#|S]' + - 'sub[E][#|S]' + - 'sup[E][#|S]' + - 'input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]' + - 'select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]' + - 'optgroup[E|disabled|label][option]' + - 'option[E|selected|disabled|label|value][]' + - 'textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]' + - 'label[E|for|accesskey|onfocus|onblur][#|S]' + - 'button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]' + - 'h4[E|align][#|S]' + - 'ins[E|cite|datetime][#|Y]' + - 'h5[E|align][#|S]' + - 'del[E|cite|datetime][#|Y]' + - 'h6[E|align][#|S]' + - 'div[E|align][#|Y]' + - 'ul[E|type|compact][li]' + - 'li[E|type|value][#|Y]' + - 'ol[E|type|compact|start][li]' + - 'dl[E|compact][dt|dd]' + - 'dt[E][#|S]' + - 'dd[E][#|Y]' + - 'menu[E|compact][li]' + - 'dir[E|compact][li]' + - 'pre[E|width|xml:space][#|ZA]' + - 'hr[E|align|noshade|size|width][]' + - 'blockquote[E|cite][#|Y]' + - 'address[E][#|S|p]' + - 'center[E][#|Y]' + - 'noframes[E][#|Y]' + - 'isindex[A|B|prompt][]' + - 'fieldset[E][#|legend|Y]' + - 'legend[E|accesskey|align][#|S]' + - 'table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]' + - 'caption[E|align][#|S]' + - 'col[ZG][]' + - 'colgroup[ZG][col]' + - 'thead[ZF][tr]' + - 'tr[ZF|bgcolor][th|td]' + - 'th[E|ZE][#|Y]' + - 'form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]' + - 'noscript[E][#|Y]' + - 'td[E|ZE][#|Y]' + - 'tfoot[ZF][tr]' + - 'tbody[ZF][tr]' + - 'area[E|D|shape|coords|href|nohref|alt|target][]' + - 'base[id|href|target][]' + - 'body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]' - ); - - boolAttrMap = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected,autoplay,loop,controls'); - shortEndedElementsMap = makeMap('area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,source'); - nonEmptyElementsMap = tinymce.extend(makeMap('td,th,iframe,video,audio,object'), shortEndedElementsMap); - defaultWhiteSpaceElementsMap = makeMap('pre,script,style,textarea'); - selfClosingElementsMap = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr'); - - /** - * Schema validator class. - * - * @class tinymce.html.Schema - * @example - * if (tinymce.activeEditor.schema.isValidChild('p', 'span')) - * alert('span is valid child of p.'); - * - * if (tinymce.activeEditor.schema.getElementRule('p')) - * alert('P is a valid element.'); - * - * @class tinymce.html.Schema - * @version 3.4 - */ - - /** - * Constructs a new Schema instance. - * - * @constructor - * @method Schema - * @param {Object} settings Name/value settings object. - */ - tinymce.html.Schema = function(settings) { - var self = this, elements = {}, children = {}, patternElements = [], validStyles, whiteSpaceElementsMap; - - settings = settings || {}; - - // Allow all elements and attributes if verify_html is set to false - if (settings.verify_html === false) - settings.valid_elements = '*[*]'; - - // Build styles list - if (settings.valid_styles) { - validStyles = {}; - - // Convert styles into a rule list - each(settings.valid_styles, function(value, key) { - validStyles[key] = tinymce.explode(value); - }); - } - - whiteSpaceElementsMap = settings.whitespace_elements ? makeMap(settings.whitespace_elements) : defaultWhiteSpaceElementsMap; - - // Converts a wildcard expression string to a regexp for example *a will become /.*a/. - function patternToRegExp(str) { - return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$'); - }; - - // Parses the specified valid_elements string and adds to the current rules - // This function is a bit hard to read since it's heavily optimized for speed - function addValidElements(valid_elements) { - var ei, el, ai, al, yl, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder, - prefix, outputName, globalAttributes, globalAttributesOrder, transElement, key, childKey, value, - elementRuleRegExp = /^([#+-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/, - attrRuleRegExp = /^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/, - hasPatternsRegExp = /[*?+]/; - - if (valid_elements) { - // Split valid elements into an array with rules - valid_elements = split(valid_elements); - - if (elements['@']) { - globalAttributes = elements['@'].attributes; - globalAttributesOrder = elements['@'].attributesOrder; - } - - // Loop all rules - for (ei = 0, el = valid_elements.length; ei < el; ei++) { - // Parse element rule - matches = elementRuleRegExp.exec(valid_elements[ei]); - if (matches) { - // Setup local names for matches - prefix = matches[1]; - elementName = matches[2]; - outputName = matches[3]; - attrData = matches[4]; - - // Create new attributes and attributesOrder - attributes = {}; - attributesOrder = []; - - // Create the new element - element = { - attributes : attributes, - attributesOrder : attributesOrder - }; - - // Padd empty elements prefix - if (prefix === '#') - element.paddEmpty = true; - - // Remove empty elements prefix - if (prefix === '-') - element.removeEmpty = true; - - // Copy attributes from global rule into current rule - if (globalAttributes) { - for (key in globalAttributes) - attributes[key] = globalAttributes[key]; - - attributesOrder.push.apply(attributesOrder, globalAttributesOrder); - } - - // Attributes defined - if (attrData) { - attrData = split(attrData, '|'); - for (ai = 0, al = attrData.length; ai < al; ai++) { - matches = attrRuleRegExp.exec(attrData[ai]); - if (matches) { - attr = {}; - attrType = matches[1]; - attrName = matches[2].replace(/::/g, ':'); - prefix = matches[3]; - value = matches[4]; - - // Required - if (attrType === '!') { - element.attributesRequired = element.attributesRequired || []; - element.attributesRequired.push(attrName); - attr.required = true; - } - - // Denied from global - if (attrType === '-') { - delete attributes[attrName]; - attributesOrder.splice(tinymce.inArray(attributesOrder, attrName), 1); - continue; - } - - // Default value - if (prefix) { - // Default value - if (prefix === '=') { - element.attributesDefault = element.attributesDefault || []; - element.attributesDefault.push({name: attrName, value: value}); - attr.defaultValue = value; - } - - // Forced value - if (prefix === ':') { - element.attributesForced = element.attributesForced || []; - element.attributesForced.push({name: attrName, value: value}); - attr.forcedValue = value; - } - - // Required values - if (prefix === '<') - attr.validValues = makeMap(value, '?'); - } - - // Check for attribute patterns - if (hasPatternsRegExp.test(attrName)) { - element.attributePatterns = element.attributePatterns || []; - attr.pattern = patternToRegExp(attrName); - element.attributePatterns.push(attr); - } else { - // Add attribute to order list if it doesn't already exist - if (!attributes[attrName]) - attributesOrder.push(attrName); - - attributes[attrName] = attr; - } - } - } - } - - // Global rule, store away these for later usage - if (!globalAttributes && elementName == '@') { - globalAttributes = attributes; - globalAttributesOrder = attributesOrder; - } - - // Handle substitute elements such as b/strong - if (outputName) { - element.outputName = elementName; - elements[outputName] = element; - } - - // Add pattern or exact element - if (hasPatternsRegExp.test(elementName)) { - element.pattern = patternToRegExp(elementName); - patternElements.push(element); - } else - elements[elementName] = element; - } - } - } - }; - - function setValidElements(valid_elements) { - elements = {}; - patternElements = []; - - addValidElements(valid_elements); - - each(transitional, function(element, name) { - children[name] = element.children; - }); - }; - - // Adds custom non HTML elements to the schema - function addCustomElements(custom_elements) { - var customElementRegExp = /^(~)?(.+)$/; - - if (custom_elements) { - each(split(custom_elements), function(rule) { - var matches = customElementRegExp.exec(rule), - inline = matches[1] === '~', - cloneName = inline ? 'span' : 'div', - name = matches[2]; - - children[name] = children[cloneName]; - customElementsMap[name] = cloneName; - - // If it's not marked as inline then add it to valid block elements - if (!inline) - blockElementsMap[name] = {}; - - // Add custom elements at span/div positions - each(children, function(element, child) { - if (element[cloneName]) - element[name] = element[cloneName]; - }); - }); - } - }; - - // Adds valid children to the schema object - function addValidChildren(valid_children) { - var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/; - - if (valid_children) { - each(split(valid_children), function(rule) { - var matches = childRuleRegExp.exec(rule), parent, prefix; - - if (matches) { - prefix = matches[1]; - - // Add/remove items from default - if (prefix) - parent = children[matches[2]]; - else - parent = children[matches[2]] = {'#comment' : {}}; - - parent = children[matches[2]]; - - each(split(matches[3], '|'), function(child) { - if (prefix === '-') - delete parent[child]; - else - parent[child] = {}; - }); - } - }); - } - }; - - function getElementRule(name) { - var element = elements[name], i; - - // Exact match found - if (element) - return element; - - // No exact match then try the patterns - i = patternElements.length; - while (i--) { - element = patternElements[i]; - - if (element.pattern.test(name)) - return element; - } - }; - - if (!settings.valid_elements) { - // No valid elements defined then clone the elements from the transitional spec - each(transitional, function(element, name) { - elements[name] = { - attributes : element.attributes, - attributesOrder : element.attributesOrder - }; - - children[name] = element.children; - }); - - // Switch these - each(split('strong/b,em/i'), function(item) { - item = split(item, '/'); - elements[item[1]].outputName = item[0]; - }); - - // Add default alt attribute for images - elements.img.attributesDefault = [{name: 'alt', value: ''}]; - - // Remove these if they are empty by default - each(split('ol,ul,sub,sup,blockquote,span,font,a,table,tbody,tr'), function(name) { - elements[name].removeEmpty = true; - }); - - // Padd these by default - each(split('p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption'), function(name) { - elements[name].paddEmpty = true; - }); - } else - setValidElements(settings.valid_elements); - - addCustomElements(settings.custom_elements); - addValidChildren(settings.valid_children); - addValidElements(settings.extended_valid_elements); - - // Todo: Remove this when we fix list handling to be valid - addValidChildren('+ol[ul|ol],+ul[ul|ol]'); - - // If the user didn't allow span only allow internal spans - if (!getElementRule('span')) - addValidElements('span[!data-mce-type|*]'); - - // Delete invalid elements - if (settings.invalid_elements) { - tinymce.each(tinymce.explode(settings.invalid_elements), function(item) { - if (elements[item]) - delete elements[item]; - }); - } - - /** - * Name/value map object with valid parents and children to those parents. - * - * @example - * children = { - * div:{p:{}, h1:{}} - * }; - * @field children - * @type {Object} - */ - self.children = children; - - /** - * Name/value map object with valid styles for each element. - * - * @field styles - * @type {Object} - */ - self.styles = validStyles; - - /** - * Returns a map with boolean attributes. - * - * @method getBoolAttrs - * @return {Object} Name/value lookup map for boolean attributes. - */ - self.getBoolAttrs = function() { - return boolAttrMap; - }; - - /** - * Returns a map with block elements. - * - * @method getBoolAttrs - * @return {Object} Name/value lookup map for block elements. - */ - self.getBlockElements = function() { - return blockElementsMap; - }; - - /** - * Returns a map with short ended elements such as BR or IMG. - * - * @method getShortEndedElements - * @return {Object} Name/value lookup map for short ended elements. - */ - self.getShortEndedElements = function() { - return shortEndedElementsMap; - }; - - /** - * Returns a map with self closing tags such as <li>. - * - * @method getSelfClosingElements - * @return {Object} Name/value lookup map for self closing tags elements. - */ - self.getSelfClosingElements = function() { - return selfClosingElementsMap; - }; - - /** - * Returns a map with elements that should be treated as contents regardless if it has text - * content in them or not such as TD, VIDEO or IMG. - * - * @method getNonEmptyElements - * @return {Object} Name/value lookup map for non empty elements. - */ - self.getNonEmptyElements = function() { - return nonEmptyElementsMap; - }; - - /** - * Returns a map with elements where white space is to be preserved like PRE or SCRIPT. - * - * @method getWhiteSpaceElements - * @return {Object} Name/value lookup map for white space elements. - */ - self.getWhiteSpaceElements = function() { - return whiteSpaceElementsMap; - }; - - /** - * Returns true/false if the specified element and it's child is valid or not - * according to the schema. - * - * @method isValidChild - * @param {String} name Element name to check for. - * @param {String} child Element child to verify. - * @return {Boolean} True/false if the element is a valid child of the specified parent. - */ - self.isValidChild = function(name, child) { - var parent = children[name]; - - return !!(parent && parent[child]); - }; - - /** - * Returns true/false if the specified element is valid or not - * according to the schema. - * - * @method getElementRule - * @param {String} name Element name to check for. - * @return {Object} Element object or undefined if the element isn't valid. - */ - self.getElementRule = getElementRule; - - /** - * Returns an map object of all custom elements. - * - * @method getCustomElements - * @return {Object} Name/value map object of all custom elements. - */ - self.getCustomElements = function() { - return customElementsMap; - }; - - /** - * Parses a valid elements string and adds it to the schema. The valid elements format is for example "element[attr=default|otherattr]". - * Existing rules will be replaced with the ones specified, so this extends the schema. - * - * @method addValidElements - * @param {String} valid_elements String in the valid elements format to be parsed. - */ - self.addValidElements = addValidElements; - - /** - * Parses a valid elements string and sets it to the schema. The valid elements format is for example "element[attr=default|otherattr]". - * Existing rules will be replaced with the ones specified, so this extends the schema. - * - * @method setValidElements - * @param {String} valid_elements String in the valid elements format to be parsed. - */ - self.setValidElements = setValidElements; - - /** - * Adds custom non HTML elements to the schema. - * - * @method addCustomElements - * @param {String} custom_elements Comma separated list of custom elements to add. - */ - self.addCustomElements = addCustomElements; - - /** - * Parses a valid children string and adds them to the schema structure. The valid children format is for example: "element[child1|child2]". - * - * @method addValidChildren - * @param {String} valid_children Valid children elements string to parse - */ - self.addValidChildren = addValidChildren; - }; - - // Expose boolMap and blockElementMap as static properties for usage in DOMUtils - tinymce.html.Schema.boolAttrMap = boolAttrMap; - tinymce.html.Schema.blockElementsMap = blockElementsMap; -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/Serializer.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/Serializer.js deleted file mode 100644 index ac4fee74717d..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/Serializer.js +++ /dev/null @@ -1,152 +0,0 @@ -/** - * Serializer.js - * - * Copyright 2010, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - /** - * This class is used to serialize down the DOM tree into a string using a Writer instance. - * - * - * @example - * new tinymce.html.Serializer().serialize(new tinymce.html.DomParser().parse('<p>text</p>')); - * @class tinymce.html.Serializer - * @version 3.4 - */ - - /** - * Constructs a new Serializer instance. - * - * @constructor - * @method Serializer - * @param {Object} settings Name/value settings object. - * @param {tinymce.html.Schema} schema Schema instance to use. - */ - tinymce.html.Serializer = function(settings, schema) { - var self = this, writer = new tinymce.html.Writer(settings); - - settings = settings || {}; - settings.validate = "validate" in settings ? settings.validate : true; - - self.schema = schema = schema || new tinymce.html.Schema(); - self.writer = writer; - - /** - * Serializes the specified node into a string. - * - * @example - * new tinymce.html.Serializer().serialize(new tinymce.html.DomParser().parse('<p>text</p>')); - * @method serialize - * @param {tinymce.html.Node} node Node instance to serialize. - * @return {String} String with HTML based on DOM tree. - */ - self.serialize = function(node) { - var handlers, validate; - - validate = settings.validate; - - handlers = { - // #text - 3: function(node, raw) { - writer.text(node.value, node.raw); - }, - - // #comment - 8: function(node) { - writer.comment(node.value); - }, - - // Processing instruction - 7: function(node) { - writer.pi(node.name, node.value); - }, - - // Doctype - 10: function(node) { - writer.doctype(node.value); - }, - - // CDATA - 4: function(node) { - writer.cdata(node.value); - }, - - // Document fragment - 11: function(node) { - if ((node = node.firstChild)) { - do { - walk(node); - } while (node = node.next); - } - } - }; - - writer.reset(); - - function walk(node) { - var handler = handlers[node.type], name, isEmpty, attrs, attrName, attrValue, sortedAttrs, i, l, elementRule; - - if (!handler) { - name = node.name; - isEmpty = node.shortEnded; - attrs = node.attributes; - - // Sort attributes - if (validate && attrs && attrs.length > 1) { - sortedAttrs = []; - sortedAttrs.map = {}; - - elementRule = schema.getElementRule(node.name); - for (i = 0, l = elementRule.attributesOrder.length; i < l; i++) { - attrName = elementRule.attributesOrder[i]; - - if (attrName in attrs.map) { - attrValue = attrs.map[attrName]; - sortedAttrs.map[attrName] = attrValue; - sortedAttrs.push({name: attrName, value: attrValue}); - } - } - - for (i = 0, l = attrs.length; i < l; i++) { - attrName = attrs[i].name; - - if (!(attrName in sortedAttrs.map)) { - attrValue = attrs.map[attrName]; - sortedAttrs.map[attrName] = attrValue; - sortedAttrs.push({name: attrName, value: attrValue}); - } - } - - attrs = sortedAttrs; - } - - writer.start(node.name, attrs, isEmpty); - - if (!isEmpty) { - if ((node = node.firstChild)) { - do { - walk(node); - } while (node = node.next); - } - - writer.end(name); - } - } else - handler(node); - } - - // Serialize element and treat all non elements as fragments - if (node.type == 1 && !settings.inner) - walk(node); - else - handlers[11](node); - - return writer.getContent(); - }; - } -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/Styles.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/Styles.js deleted file mode 100644 index 60c5565d72a9..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/Styles.js +++ /dev/null @@ -1,279 +0,0 @@ -/** - * Styles.js - * - * Copyright 2010, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -/** - * This class is used to parse CSS styles it also compresses styles to reduce the output size. - * - * @example - * var Styles = new tinymce.html.Styles({ - * url_converter: function(url) { - * return url; - * } - * }); - * - * styles = Styles.parse('border: 1px solid red'); - * styles.color = 'red'; - * - * console.log(new tinymce.html.StyleSerializer().serialize(styles)); - * - * @class tinymce.html.Styles - * @version 3.4 - */ -tinymce.html.Styles = function(settings, schema) { - var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi, - urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi, - styleRegExp = /\s*([^:]+):\s*([^;]+);?/g, - trimRightRegExp = /\s+$/, - urlColorRegExp = /rgb/, - undef, i, encodingLookup = {}, encodingItems; - - settings = settings || {}; - - encodingItems = '\\" \\\' \\; \\: ; : \uFEFF'.split(' '); - for (i = 0; i < encodingItems.length; i++) { - encodingLookup[encodingItems[i]] = '\uFEFF' + i; - encodingLookup['\uFEFF' + i] = encodingItems[i]; - } - - function toHex(match, r, g, b) { - function hex(val) { - val = parseInt(val).toString(16); - - return val.length > 1 ? val : '0' + val; // 0 -> 00 - }; - - return '#' + hex(r) + hex(g) + hex(b); - }; - - return { - /** - * Parses the specified RGB color value and returns a hex version of that color. - * - * @method toHex - * @param {String} color RGB string value like rgb(1,2,3) - * @return {String} Hex version of that RGB value like #FF00FF. - */ - toHex : function(color) { - return color.replace(rgbRegExp, toHex); - }, - - /** - * Parses the specified style value into an object collection. This parser will also - * merge and remove any redundant items that browsers might have added. It will also convert non hex - * colors to hex values. Urls inside the styles will also be converted to absolute/relative based on settings. - * - * @method parse - * @param {String} css Style value to parse for example: border:1px solid red;. - * @return {Object} Object representation of that style like {border : '1px solid red'} - */ - parse : function(css) { - var styles = {}, matches, name, value, isEncoded, urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope || this; - - function compress(prefix, suffix) { - var top, right, bottom, left; - - // Get values and check it needs compressing - top = styles[prefix + '-top' + suffix]; - if (!top) - return; - - right = styles[prefix + '-right' + suffix]; - if (top != right) - return; - - bottom = styles[prefix + '-bottom' + suffix]; - if (right != bottom) - return; - - left = styles[prefix + '-left' + suffix]; - if (bottom != left) - return; - - // Compress - styles[prefix + suffix] = left; - delete styles[prefix + '-top' + suffix]; - delete styles[prefix + '-right' + suffix]; - delete styles[prefix + '-bottom' + suffix]; - delete styles[prefix + '-left' + suffix]; - }; - - /** - * Checks if the specific style can be compressed in other words if all border-width are equal. - */ - function canCompress(key) { - var value = styles[key], i; - - if (!value || value.indexOf(' ') < 0) - return; - - value = value.split(' '); - i = value.length; - while (i--) { - if (value[i] !== value[0]) - return false; - } - - styles[key] = value[0]; - - return true; - }; - - /** - * Compresses multiple styles into one style. - */ - function compress2(target, a, b, c) { - if (!canCompress(a)) - return; - - if (!canCompress(b)) - return; - - if (!canCompress(c)) - return; - - // Compress - styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c]; - delete styles[a]; - delete styles[b]; - delete styles[c]; - }; - - // Encodes the specified string by replacing all \" \' ; : with _<num> - function encode(str) { - isEncoded = true; - - return encodingLookup[str]; - }; - - // Decodes the specified string by replacing all _<num> with it's original value \" \' etc - // It will also decode the \" \' if keep_slashes is set to fale or omitted - function decode(str, keep_slashes) { - if (isEncoded) { - str = str.replace(/\uFEFF[0-9]/g, function(str) { - return encodingLookup[str]; - }); - } - - if (!keep_slashes) - str = str.replace(/\\([\'\";:])/g, "$1"); - - return str; - } - - if (css) { - // Encode \" \' % and ; and : inside strings so they don't interfere with the style parsing - css = css.replace(/\\[\"\';:\uFEFF]/g, encode).replace(/\"[^\"]+\"|\'[^\']+\'/g, function(str) { - return str.replace(/[;:]/g, encode); - }); - - // Parse styles - while (matches = styleRegExp.exec(css)) { - name = matches[1].replace(trimRightRegExp, '').toLowerCase(); - value = matches[2].replace(trimRightRegExp, ''); - - if (name && value.length > 0) { - // Opera will produce 700 instead of bold in their style values - if (name === 'font-weight' && value === '700') - value = 'bold'; - else if (name === 'color' || name === 'background-color') // Lowercase colors like RED - value = value.toLowerCase(); - - // Convert RGB colors to HEX - value = value.replace(rgbRegExp, toHex); - - // Convert URLs and force them into url('value') format - value = value.replace(urlOrStrRegExp, function(match, url, url2, url3, str, str2) { - str = str || str2; - - if (str) { - str = decode(str); - - // Force strings into single quote format - return "'" + str.replace(/\'/g, "\\'") + "'"; - } - - url = decode(url || url2 || url3); - - // Convert the URL to relative/absolute depending on config - if (urlConverter) - url = urlConverter.call(urlConverterScope, url, 'style'); - - // Output new URL format - return "url('" + url.replace(/\'/g, "\\'") + "')"; - }); - - styles[name] = isEncoded ? decode(value, true) : value; - } - - styleRegExp.lastIndex = matches.index + matches[0].length; - } - - // Compress the styles to reduce it's size for example IE will expand styles - compress("border", ""); - compress("border", "-width"); - compress("border", "-color"); - compress("border", "-style"); - compress("padding", ""); - compress("margin", ""); - compress2('border', 'border-width', 'border-style', 'border-color'); - - // Remove pointless border, IE produces these - if (styles.border === 'medium none') - delete styles.border; - } - - return styles; - }, - - /** - * Serializes the specified style object into a string. - * - * @method serialize - * @param {Object} styles Object to serialize as string for example: {border : '1px solid red'} - * @param {String} element_name Optional element name, if specified only the styles that matches the schema will be serialized. - * @return {String} String representation of the style object for example: border: 1px solid red. - */ - serialize : function(styles, element_name) { - var css = '', name, value; - - function serializeStyles(name) { - var styleList, i, l, value; - - styleList = schema.styles[name]; - if (styleList) { - for (i = 0, l = styleList.length; i < l; i++) { - name = styleList[i]; - value = styles[name]; - - if (value !== undef && value.length > 0) - css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';'; - } - } - }; - - // Serialize styles according to schema - if (element_name && schema && schema.styles) { - // Serialize global styles and element specific styles - serializeStyles('*'); - serializeStyles(element_name); - } else { - // Output the styles in the order they are inside the object - for (name in styles) { - value = styles[name]; - - if (value !== undef && value.length > 0) - css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';'; - } - } - - return css; - } - }; -}; diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/Writer.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/Writer.js deleted file mode 100644 index f37607f73270..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/html/Writer.js +++ /dev/null @@ -1,186 +0,0 @@ -/** - * Writer.js - * - * Copyright 2010, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -/** - * This class is used to write HTML tags out it can be used with the Serializer or the SaxParser. - * - * @class tinymce.html.Writer - * @example - * var writer = new tinymce.html.Writer({indent : true}); - * var parser = new tinymce.html.SaxParser(writer).parse('<p><br></p>'); - * console.log(writer.getContent()); - * - * @class tinymce.html.Writer - * @version 3.4 - */ - -/** - * Constructs a new Writer instance. - * - * @constructor - * @method Writer - * @param {Object} settings Name/value settings object. - */ -tinymce.html.Writer = function(settings) { - var html = [], indent, indentBefore, indentAfter, encode, htmlOutput; - - settings = settings || {}; - indent = settings.indent; - indentBefore = tinymce.makeMap(settings.indent_before || ''); - indentAfter = tinymce.makeMap(settings.indent_after || ''); - encode = tinymce.html.Entities.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities); - htmlOutput = settings.element_format == "html"; - - return { - /** - * Writes the a start element such as <p id="a">. - * - * @method start - * @param {String} name Name of the element. - * @param {Array} attrs Optional attribute array or undefined if it hasn't any. - * @param {Boolean} empty Optional empty state if the tag should end like <br />. - */ - start: function(name, attrs, empty) { - var i, l, attr, value; - - if (indent && indentBefore[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') - html.push('\n'); - } - - html.push('<', name); - - if (attrs) { - for (i = 0, l = attrs.length; i < l; i++) { - attr = attrs[i]; - html.push(' ', attr.name, '="', encode(attr.value, true), '"'); - } - } - - if (!empty || htmlOutput) - html[html.length] = '>'; - else - html[html.length] = ' />'; - - if (empty && indent && indentAfter[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') - html.push('\n'); - } - }, - - /** - * Writes the a end element such as </p>. - * - * @method end - * @param {String} name Name of the element. - */ - end: function(name) { - var value; - - /*if (indent && indentBefore[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') - html.push('\n'); - }*/ - - html.push('</', name, '>'); - - if (indent && indentAfter[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') - html.push('\n'); - } - }, - - /** - * Writes a text node. - * - * @method text - * @param {String} text String to write out. - * @param {Boolean} raw Optional raw state if true the contents won't get encoded. - */ - text: function(text, raw) { - if (text.length > 0) - html[html.length] = raw ? text : encode(text); - }, - - /** - * Writes a cdata node such as <![CDATA[data]]>. - * - * @method cdata - * @param {String} text String to write out inside the cdata. - */ - cdata: function(text) { - html.push('<![CDATA[', text, ']]>'); - }, - - /** - * Writes a comment node such as <!-- Comment -->. - * - * @method cdata - * @param {String} text String to write out inside the comment. - */ - comment: function(text) { - html.push('<!--', text, '-->'); - }, - - /** - * Writes a PI node such as <?xml attr="value" ?>. - * - * @method pi - * @param {String} name Name of the pi. - * @param {String} text String to write out inside the pi. - */ - pi: function(name, text) { - if (text) - html.push('<?', name, ' ', text, '?>'); - else - html.push('<?', name, '?>'); - - if (indent) - html.push('\n'); - }, - - /** - * Writes a doctype node such as <!DOCTYPE data>. - * - * @method doctype - * @param {String} text String to write out inside the doctype. - */ - doctype: function(text) { - html.push('<!DOCTYPE', text, '>', indent ? '\n' : ''); - }, - - /** - * Resets the internal buffer if one wants to reuse the writer. - * - * @method reset - */ - reset: function() { - html.length = 0; - }, - - /** - * Returns the contents that got serialized. - * - * @method getContent - * @return {String} HTML contents that got written down. - */ - getContent: function() { - return html.join('').replace(/\n$/, ''); - } - }; -}; diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/tinymce.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/tinymce.js deleted file mode 100644 index 6afea2fe2dc8..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/tinymce.js +++ /dev/null @@ -1,869 +0,0 @@ -/** - * tinymce.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(win) { - var whiteSpaceRe = /^\s*|\s*$/g, - undefined, isRegExpBroken = 'B'.replace(/A(.)|B/, '$1') === '$1'; - - /** - * Core namespace with core functionality for the TinyMCE API all sub classes will be added to this namespace/object. - * - * @static - * @class tinymce - * @example - * // Using each method - * tinymce.each([1, 2, 3], function(v, i) { - * console.log(i + '=' + v); - * }); - * - * // Checking for a specific browser - * if (tinymce.isIE) - * console.log("IE"); - */ - var tinymce = { - /** - * Major version of TinyMCE build. - * - * @property majorVersion - * @type String - */ - majorVersion : '@@tinymce_major_version@@', - - /** - * Major version of TinyMCE build. - * - * @property minorVersion - * @type String - */ - minorVersion : '@@tinymce_minor_version@@', - - /** - * Release date of TinyMCE build. - * - * @property releaseDate - * @type String - */ - releaseDate : '@@tinymce_release_date@@', - - /** - * Initializes the TinyMCE global namespace this will setup browser detection and figure out where TinyMCE is running from. - */ - _init : function() { - var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v; - - /** - * Constant that is true if the browser is Opera. - * - * @property isOpera - * @type Boolean - * @final - */ - t.isOpera = win.opera && opera.buildNumber; - - /** - * Constant that is true if the browser is WebKit (Safari/Chrome). - * - * @property isWebKit - * @type Boolean - * @final - */ - t.isWebKit = /WebKit/.test(ua); - - /** - * Constant that is true if the browser is IE. - * - * @property isIE - * @type Boolean - * @final - */ - t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName); - - /** - * Constant that is true if the browser is IE 6 or older. - * - * @property isIE6 - * @type Boolean - * @final - */ - t.isIE6 = t.isIE && /MSIE [56]/.test(ua); - - /** - * Constant that is true if the browser is IE 7. - * - * @property isIE7 - * @type Boolean - * @final - */ - t.isIE7 = t.isIE && /MSIE [7]/.test(ua); - - /** - * Constant that is true if the browser is IE 8. - * - * @property isIE8 - * @type Boolean - * @final - */ - t.isIE8 = t.isIE && /MSIE [8]/.test(ua); - - /** - * Constant that is true if the browser is IE 9. - * - * @property isIE9 - * @type Boolean - * @final - */ - t.isIE9 = t.isIE && /MSIE [9]/.test(ua); - - /** - * Constant that is true if the browser is Gecko. - * - * @property isGecko - * @type Boolean - * @final - */ - t.isGecko = !t.isWebKit && /Gecko/.test(ua); - - /** - * Constant that is true if the os is Mac OS. - * - * @property isMac - * @type Boolean - * @final - */ - t.isMac = ua.indexOf('Mac') != -1; - - /** - * Constant that is true if the runtime is Adobe Air. - * - * @property isAir - * @type Boolean - * @final - */ - t.isAir = /adobeair/i.test(ua); - - /** - * Constant that tells if the current browser is an iPhone or iPad. - * - * @property isIDevice - * @type Boolean - * @final - */ - t.isIDevice = /(iPad|iPhone)/.test(ua); - - /** - * Constant that is true if the current browser is running on iOS 5 or greater. - * - * @property isIOS5 - * @type Boolean - * @final - */ - t.isIOS5 = t.isIDevice && ua.match(/AppleWebKit\/(\d*)/)[1]>=534; - - // TinyMCE .NET webcontrol might be setting the values for TinyMCE - if (win.tinyMCEPreInit) { - t.suffix = tinyMCEPreInit.suffix; - t.baseURL = tinyMCEPreInit.base; - t.query = tinyMCEPreInit.query; - return; - } - - // Get suffix and base - t.suffix = ''; - - // If base element found, add that infront of baseURL - nl = d.getElementsByTagName('base'); - for (i=0; i<nl.length; i++) { - if (v = nl[i].href) { - // Host only value like http://site.com or http://site.com:8008 - if (/^https?:\/\/[^\/]+$/.test(v)) - v += '/'; - - base = v ? v.match(/.*\//)[0] : ''; // Get only directory - } - } - - function getBase(n) { - if (n.src && /tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(n.src)) { - if (/_(src|dev)\.js/g.test(n.src)) - t.suffix = '_src'; - - if ((p = n.src.indexOf('?')) != -1) - t.query = n.src.substring(p + 1); - - t.baseURL = n.src.substring(0, n.src.lastIndexOf('/')); - - // If path to script is relative and a base href was found add that one infront - // the src property will always be an absolute one on non IE browsers and IE 8 - // so this logic will basically only be executed on older IE versions - if (base && t.baseURL.indexOf('://') == -1 && t.baseURL.indexOf('/') !== 0) - t.baseURL = base + t.baseURL; - - return t.baseURL; - } - - return null; - }; - - // Check document - nl = d.getElementsByTagName('script'); - for (i=0; i<nl.length; i++) { - if (getBase(nl[i])) - return; - } - - // Check head - n = d.getElementsByTagName('head')[0]; - if (n) { - nl = n.getElementsByTagName('script'); - for (i=0; i<nl.length; i++) { - if (getBase(nl[i])) - return; - } - } - - return; - }, - - /** - * Checks if a object is of a specific type for example an array. - * - * @method is - * @param {Object} o Object to check type of. - * @param {string} t Optional type to check for. - * @return {Boolean} true/false if the object is of the specified type. - */ - is : function(o, t) { - if (!t) - return o !== undefined; - - if (t == 'array' && (o.hasOwnProperty && o instanceof Array)) - return true; - - return typeof(o) == t; - }, - - /** - * Makes a name/object map out of an array with names. - * - * @method makeMap - * @param {Array/String} items Items to make map out of. - * @param {String} delim Optional delimiter to split string by. - * @param {Object} map Optional map to add items to. - * @return {Object} Name/value map of items. - */ - makeMap : function(items, delim, map) { - var i; - - items = items || []; - delim = delim || ','; - - if (typeof(items) == "string") - items = items.split(delim); - - map = map || {}; - - i = items.length; - while (i--) - map[items[i]] = {}; - - return map; - }, - - /** - * Performs an iteration of all items in a collection such as an object or array. This method will execure the - * callback function for each item in the collection, if the callback returns false the iteration will terminate. - * The callback has the following format: cb(value, key_or_index). - * - * @method each - * @param {Object} o Collection to iterate. - * @param {function} cb Callback function to execute for each item. - * @param {Object} s Optional scope to execute the callback in. - * @example - * // Iterate an array - * tinymce.each([1,2,3], function(v, i) { - * console.debug("Value: " + v + ", Index: " + i); - * }); - * - * // Iterate an object - * tinymce.each({a : 1, b : 2, c: 3], function(v, k) { - * console.debug("Value: " + v + ", Key: " + k); - * }); - */ - each : function(o, cb, s) { - var n, l; - - if (!o) - return 0; - - s = s || o; - - if (o.length !== undefined) { - // Indexed arrays, needed for Safari - for (n=0, l = o.length; n < l; n++) { - if (cb.call(s, o[n], n, o) === false) - return 0; - } - } else { - // Hashtables - for (n in o) { - if (o.hasOwnProperty(n)) { - if (cb.call(s, o[n], n, o) === false) - return 0; - } - } - } - - return 1; - }, - - // #ifndef jquery - - /** - * Creates a new array by the return value of each iteration function call. This enables you to convert - * one array list into another. - * - * @method map - * @param {Array} a Array of items to iterate. - * @param {function} f Function to call for each item. It's return value will be the new value. - * @return {Array} Array with new values based on function return values. - */ - map : function(a, f) { - var o = []; - - tinymce.each(a, function(v) { - o.push(f(v)); - }); - - return o; - }, - - /** - * Filters out items from the input array by calling the specified function for each item. - * If the function returns false the item will be excluded if it returns true it will be included. - * - * @method grep - * @param {Array} a Array of items to loop though. - * @param {function} f Function to call for each item. Include/exclude depends on it's return value. - * @return {Array} New array with values imported and filtered based in input. - * @example - * // Filter out some items, this will return an array with 4 and 5 - * var items = tinymce.grep([1,2,3,4,5], function(v) {return v > 3;}); - */ - grep : function(a, f) { - var o = []; - - tinymce.each(a, function(v) { - if (!f || f(v)) - o.push(v); - }); - - return o; - }, - - /** - * Returns the index of a value in an array, this method will return -1 if the item wasn't found. - * - * @method inArray - * @param {Array} a Array/Object to search for value in. - * @param {Object} v Value to check for inside the array. - * @return {Number/String} Index of item inside the array inside an object. Or -1 if it wasn't found. - * @example - * // Get index of value in array this will alert 1 since 2 is at that index - * alert(tinymce.inArray([1,2,3], 2)); - */ - inArray : function(a, v) { - var i, l; - - if (a) { - for (i = 0, l = a.length; i < l; i++) { - if (a[i] === v) - return i; - } - } - - return -1; - }, - - /** - * Extends an object with the specified other object(s). - * - * @method extend - * @param {Object} o Object to extend with new items. - * @param {Object} e..n Object(s) to extend the specified object with. - * @return {Object} o New extended object, same reference as the input object. - * @example - * // Extends obj1 with two new fields - * var obj = tinymce.extend(obj1, { - * somefield1 : 'a', - * somefield2 : 'a' - * }); - * - * // Extends obj with obj2 and obj3 - * tinymce.extend(obj, obj2, obj3); - */ - extend : function(o, e) { - var i, l, a = arguments; - - for (i = 1, l = a.length; i < l; i++) { - e = a[i]; - - tinymce.each(e, function(v, n) { - if (v !== undefined) - o[n] = v; - }); - } - - return o; - }, - - // #endif - - /** - * Removes whitespace from the beginning and end of a string. - * - * @method trim - * @param {String} s String to remove whitespace from. - * @return {String} New string with removed whitespace. - */ - trim : function(s) { - return (s ? '' + s : '').replace(whiteSpaceRe, ''); - }, - - /** - * Creates a class, subclass or static singleton. - * More details on this method can be found in the Wiki. - * - * @method create - * @param {String} s Class name, inheritage and prefix. - * @param {Object} p Collection of methods to add to the class. - * @param {Object} root Optional root object defaults to the global window object. - * @example - * // Creates a basic class - * tinymce.create('tinymce.somepackage.SomeClass', { - * SomeClass : function() { - * // Class constructor - * }, - * - * method : function() { - * // Some method - * } - * }); - * - * // Creates a basic subclass class - * tinymce.create('tinymce.somepackage.SomeSubClass:tinymce.somepackage.SomeClass', { - * SomeSubClass: function() { - * // Class constructor - * this.parent(); // Call parent constructor - * }, - * - * method : function() { - * // Some method - * this.parent(); // Call parent method - * }, - * - * 'static' : { - * staticMethod : function() { - * // Static method - * } - * } - * }); - * - * // Creates a singleton/static class - * tinymce.create('static tinymce.somepackage.SomeSingletonClass', { - * method : function() { - * // Some method - * } - * }); - */ - create : function(s, p, root) { - var t = this, sp, ns, cn, scn, c, de = 0; - - // Parse : <prefix> <class>:<super class> - s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s); - cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name - - // Create namespace for new class - ns = t.createNS(s[3].replace(/\.\w+$/, ''), root); - - // Class already exists - if (ns[cn]) - return; - - // Make pure static class - if (s[2] == 'static') { - ns[cn] = p; - - if (this.onCreate) - this.onCreate(s[2], s[3], ns[cn]); - - return; - } - - // Create default constructor - if (!p[cn]) { - p[cn] = function() {}; - de = 1; - } - - // Add constructor and methods - ns[cn] = p[cn]; - t.extend(ns[cn].prototype, p); - - // Extend - if (s[5]) { - sp = t.resolve(s[5]).prototype; - scn = s[5].match(/\.(\w+)$/i)[1]; // Class name - - // Extend constructor - c = ns[cn]; - if (de) { - // Add passthrough constructor - ns[cn] = function() { - return sp[scn].apply(this, arguments); - }; - } else { - // Add inherit constructor - ns[cn] = function() { - this.parent = sp[scn]; - return c.apply(this, arguments); - }; - } - ns[cn].prototype[cn] = ns[cn]; - - // Add super methods - t.each(sp, function(f, n) { - ns[cn].prototype[n] = sp[n]; - }); - - // Add overridden methods - t.each(p, function(f, n) { - // Extend methods if needed - if (sp[n]) { - ns[cn].prototype[n] = function() { - this.parent = sp[n]; - return f.apply(this, arguments); - }; - } else { - if (n != cn) - ns[cn].prototype[n] = f; - } - }); - } - - // Add static methods - t.each(p['static'], function(f, n) { - ns[cn][n] = f; - }); - - if (this.onCreate) - this.onCreate(s[2], s[3], ns[cn].prototype); - }, - - /** - * Executed the specified function for each item in a object tree. - * - * @method walk - * @param {Object} o Object tree to walk though. - * @param {function} f Function to call for each item. - * @param {String} n Optional name of collection inside the objects to walk for example childNodes. - * @param {String} s Optional scope to execute the function in. - */ - walk : function(o, f, n, s) { - s = s || this; - - if (o) { - if (n) - o = o[n]; - - tinymce.each(o, function(o, i) { - if (f.call(s, o, i, n) === false) - return false; - - tinymce.walk(o, f, n, s); - }); - } - }, - - /** - * Creates a namespace on a specific object. - * - * @method createNS - * @param {String} n Namespace to create for example a.b.c.d. - * @param {Object} o Optional object to add namespace to, defaults to window. - * @return {Object} New namespace object the last item in path. - * @example - * // Create some namespace - * tinymce.createNS('tinymce.somepackage.subpackage'); - * - * // Add a singleton - * var tinymce.somepackage.subpackage.SomeSingleton = { - * method : function() { - * // Some method - * } - * }; - */ - createNS : function(n, o) { - var i, v; - - o = o || win; - - n = n.split('.'); - for (i=0; i<n.length; i++) { - v = n[i]; - - if (!o[v]) - o[v] = {}; - - o = o[v]; - } - - return o; - }, - - /** - * Resolves a string and returns the object from a specific structure. - * - * @method resolve - * @param {String} n Path to resolve for example a.b.c.d. - * @param {Object} o Optional object to search though, defaults to window. - * @return {Object} Last object in path or null if it couldn't be resolved. - * @example - * // Resolve a path into an object reference - * var obj = tinymce.resolve('a.b.c.d'); - */ - resolve : function(n, o) { - var i, l; - - o = o || win; - - n = n.split('.'); - for (i = 0, l = n.length; i < l; i++) { - o = o[n[i]]; - - if (!o) - break; - } - - return o; - }, - - /** - * Adds an unload handler to the document. This handler will be executed when the document gets unloaded. - * This method is useful for dealing with browser memory leaks where it might be vital to remove DOM references etc. - * - * @method addUnload - * @param {function} f Function to execute before the document gets unloaded. - * @param {Object} s Optional scope to execute the function in. - * @return {function} Returns the specified unload handler function. - * @example - * // Fixes a leak with a DOM element that was palces in the someObject - * tinymce.addUnload(function() { - * // Null DOM element to reduce IE memory leak - * someObject.someElement = null; - * }); - */ - addUnload : function(f, s) { - var t = this; - - f = {func : f, scope : s || this}; - - if (!t.unloads) { - function unload() { - var li = t.unloads, o, n; - - if (li) { - // Call unload handlers - for (n in li) { - o = li[n]; - - if (o && o.func) - o.func.call(o.scope, 1); // Send in one arg to distinct unload and user destroy - } - - // Detach unload function - if (win.detachEvent) { - win.detachEvent('onbeforeunload', fakeUnload); - win.detachEvent('onunload', unload); - } else if (win.removeEventListener) - win.removeEventListener('unload', unload, false); - - // Destroy references - t.unloads = o = li = w = unload = 0; - - // Run garbarge collector on IE - if (win.CollectGarbage) - CollectGarbage(); - } - }; - - function fakeUnload() { - var d = document; - - // Is there things still loading, then do some magic - if (d.readyState == 'interactive') { - function stop() { - // Prevent memory leak - d.detachEvent('onstop', stop); - - // Call unload handler - if (unload) - unload(); - - d = 0; - }; - - // Fire unload when the currently loading page is stopped - if (d) - d.attachEvent('onstop', stop); - - // Remove onstop listener after a while to prevent the unload function - // to execute if the user presses cancel in an onbeforeunload - // confirm dialog and then presses the browser stop button - win.setTimeout(function() { - if (d) - d.detachEvent('onstop', stop); - }, 0); - } - }; - - // Attach unload handler - if (win.attachEvent) { - win.attachEvent('onunload', unload); - win.attachEvent('onbeforeunload', fakeUnload); - } else if (win.addEventListener) - win.addEventListener('unload', unload, false); - - // Setup initial unload handler array - t.unloads = [f]; - } else - t.unloads.push(f); - - return f; - }, - - /** - * Removes the specified function form the unload handler list. - * - * @method removeUnload - * @param {function} f Function to remove from unload handler list. - * @return {function} Removed function name or null if it wasn't found. - */ - removeUnload : function(f) { - var u = this.unloads, r = null; - - tinymce.each(u, function(o, i) { - if (o && o.func == f) { - u.splice(i, 1); - r = f; - return false; - } - }); - - return r; - }, - - /** - * Splits a string but removes the whitespace before and after each value. - * - * @method explode - * @param {string} s String to split. - * @param {string} d Delimiter to split by. - * @example - * // Split a string into an array with a,b,c - * var arr = tinymce.explode('a, b, c'); - */ - explode : function(s, d) { - return s ? tinymce.map(s.split(d || ','), tinymce.trim) : s; - }, - - _addVer : function(u) { - var v; - - if (!this.query) - return u; - - v = (u.indexOf('?') == -1 ? '?' : '&') + this.query; - - if (u.indexOf('#') == -1) - return u + v; - - return u.replace('#', v + '#'); - }, - - // Fix function for IE 9 where regexps isn't working correctly - // Todo: remove me once MS fixes the bug - _replace : function(find, replace, str) { - // On IE9 we have to fake $x replacement - if (isRegExpBroken) { - return str.replace(find, function() { - var val = replace, args = arguments, i; - - for (i = 0; i < args.length - 2; i++) { - if (args[i] === undefined) { - val = val.replace(new RegExp('\\$' + i, 'g'), ''); - } else { - val = val.replace(new RegExp('\\$' + i, 'g'), args[i]); - } - } - - return val; - }); - } - - return str.replace(find, replace); - } - - /**#@-*/ - }; - - // Initialize the API - tinymce._init(); - - // Expose tinymce namespace to the global namespace (window) - win.tinymce = win.tinyMCE = tinymce; - - // Describe the different namespaces - - /** - * Root level namespace this contains classes directly releated to the TinyMCE editor. - * - * @namespace tinymce - */ - - /** - * Contains classes for handling the browsers DOM. - * - * @namespace tinymce.dom - */ - - /** - * Contains html parser and serializer logic. - * - * @namespace tinymce.html - */ - - /** - * Contains the different UI types such as buttons, listboxes etc. - * - * @namespace tinymce.ui - */ - - /** - * Contains various utility classes such as json parser, cookies etc. - * - * @namespace tinymce.util - */ - - /** - * Contains plugin classes. - * - * @namespace tinymce.plugins - */ -})(window); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/Button.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/Button.js deleted file mode 100644 index 433b9f2f56ac..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/Button.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Button.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var DOM = tinymce.DOM; - - /** - * This class is used to create a UI button. A button is basically a link - * that is styled to look like a button or icon. - * - * @class tinymce.ui.Button - * @extends tinymce.ui.Control - */ - tinymce.create('tinymce.ui.Button:tinymce.ui.Control', { - /** - * Constructs a new button control instance. - * - * @constructor - * @method Button - * @param {String} id Control id for the button. - * @param {Object} s Optional name/value settings object. - * @param {Editor} ed Optional the editor instance this button is for. - */ - Button : function(id, s, ed) { - this.parent(id, s, ed); - this.classPrefix = 'mceButton'; - }, - - /** - * Renders the button as a HTML string. This method is much faster than using the DOM and when - * creating a whole toolbar with buttons it does make a lot of difference. - * - * @method renderHTML - * @return {String} HTML for the button control element. - */ - renderHTML : function() { - var cp = this.classPrefix, s = this.settings, h, l; - - l = DOM.encode(s.label || ''); - h = '<a role="button" id="' + this.id + '" href="javascript:;" class="' + cp + ' ' + cp + 'Enabled ' + s['class'] + (l ? ' ' + cp + 'Labeled' : '') +'" onmousedown="return false;" onclick="return false;" aria-labelledby="' + this.id + '_voice" title="' + DOM.encode(s.title) + '">'; - if (s.image && !(this.editor &&this.editor.forcedHighContrastMode) ) - h += '<img class="mceIcon" src="' + s.image + '" alt="' + DOM.encode(s.title) + '" />' + l; - else - h += '<span class="mceIcon ' + s['class'] + '"></span>' + (l ? '<span class="' + cp + 'Label">' + l + '</span>' : ''); - - h += '<span class="mceVoiceLabel mceIconOnly" style="display: none;" id="' + this.id + '_voice">' + s.title + '</span>'; - h += '</a>'; - return h; - }, - - /** - * Post render handler. This function will be called after the UI has been - * rendered so that events can be added. - * - * @method postRender - */ - postRender : function() { - var t = this, s = t.settings; - - tinymce.dom.Event.add(t.id, 'click', function(e) { - if (!t.isDisabled()) - return s.onclick.call(s.scope, e); - }); - } - }); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/ColorSplitButton.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/ColorSplitButton.js deleted file mode 100644 index 46a73d0c2c3b..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/ColorSplitButton.js +++ /dev/null @@ -1,285 +0,0 @@ -/** - * ColorSplitButton.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, is = tinymce.is, each = tinymce.each; - - /** - * This class is used to create UI color split button. A color split button will present show a small color picker - * when you press the open menu. - * - * @class tinymce.ui.ColorSplitButton - * @extends tinymce.ui.SplitButton - */ - tinymce.create('tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton', { - /** - * Constructs a new color split button control instance. - * - * @constructor - * @method ColorSplitButton - * @param {String} id Control id for the color split button. - * @param {Object} s Optional name/value settings object. - * @param {Editor} ed The editor instance this button is for. - */ - ColorSplitButton : function(id, s, ed) { - var t = this; - - t.parent(id, s, ed); - - /** - * Settings object. - * - * @property settings - * @type Object - */ - t.settings = s = tinymce.extend({ - colors : '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF', - grid_width : 8, - default_color : '#888888' - }, t.settings); - - /** - * Fires when the menu is shown. - * - * @event onShowMenu - */ - t.onShowMenu = new tinymce.util.Dispatcher(t); - - /** - * Fires when the menu is hidden. - * - * @event onHideMenu - */ - t.onHideMenu = new tinymce.util.Dispatcher(t); - - /** - * Current color value. - * - * @property value - * @type String - */ - t.value = s.default_color; - }, - - /** - * Shows the color menu. The color menu is a layer places under the button - * and displays a table of colors for the user to pick from. - * - * @method showMenu - */ - showMenu : function() { - var t = this, r, p, e, p2; - - if (t.isDisabled()) - return; - - if (!t.isMenuRendered) { - t.renderMenu(); - t.isMenuRendered = true; - } - - if (t.isMenuVisible) - return t.hideMenu(); - - e = DOM.get(t.id); - DOM.show(t.id + '_menu'); - DOM.addClass(e, 'mceSplitButtonSelected'); - p2 = DOM.getPos(e); - DOM.setStyles(t.id + '_menu', { - left : p2.x, - top : p2.y + e.clientHeight, - zIndex : 200000 - }); - e = 0; - - Event.add(DOM.doc, 'mousedown', t.hideMenu, t); - t.onShowMenu.dispatch(t); - - if (t._focused) { - t._keyHandler = Event.add(t.id + '_menu', 'keydown', function(e) { - if (e.keyCode == 27) - t.hideMenu(); - }); - - DOM.select('a', t.id + '_menu')[0].focus(); // Select first link - } - - t.isMenuVisible = 1; - }, - - /** - * Hides the color menu. The optional event parameter is used to check where the event occurred so it - * doesn't close them menu if it was a event inside the menu. - * - * @method hideMenu - * @param {Event} e Optional event object. - */ - hideMenu : function(e) { - var t = this; - - if (t.isMenuVisible) { - // Prevent double toogles by canceling the mouse click event to the button - if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id + '_open';})) - return; - - if (!e || !DOM.getParent(e.target, '.mceSplitButtonMenu')) { - DOM.removeClass(t.id, 'mceSplitButtonSelected'); - Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); - Event.remove(t.id + '_menu', 'keydown', t._keyHandler); - DOM.hide(t.id + '_menu'); - } - - t.isMenuVisible = 0; - t.onHideMenu.dispatch(); - } - }, - - /** - * Renders the menu to the DOM. - * - * @method renderMenu - */ - renderMenu : function() { - var t = this, m, i = 0, s = t.settings, n, tb, tr, w, context; - - w = DOM.add(s.menu_container, 'div', {role: 'listbox', id : t.id + '_menu', 'class' : s['menu_class'] + ' ' + s['class'], style : 'position:absolute;left:0;top:-1000px;'}); - m = DOM.add(w, 'div', {'class' : s['class'] + ' mceSplitButtonMenu'}); - DOM.add(m, 'span', {'class' : 'mceMenuLine'}); - - n = DOM.add(m, 'table', {role: 'presentation', 'class' : 'mceColorSplitMenu'}); - tb = DOM.add(n, 'tbody'); - - // Generate color grid - i = 0; - each(is(s.colors, 'array') ? s.colors : s.colors.split(','), function(c) { - c = c.replace(/^#/, ''); - - if (!i--) { - tr = DOM.add(tb, 'tr'); - i = s.grid_width - 1; - } - - n = DOM.add(tr, 'td'); - n = DOM.add(n, 'a', { - role : 'option', - href : 'javascript:;', - style : { - backgroundColor : '#' + c - }, - 'title': t.editor.getLang('colors.' + c, c), - 'data-mce-color' : '#' + c - }); - - if (t.editor.forcedHighContrastMode) { - n = DOM.add(n, 'canvas', { width: 16, height: 16, 'aria-hidden': 'true' }); - if (n.getContext && (context = n.getContext("2d"))) { - context.fillStyle = '#' + c; - context.fillRect(0, 0, 16, 16); - } else { - // No point leaving a canvas element around if it's not supported for drawing on anyway. - DOM.remove(n); - } - } - }); - - if (s.more_colors_func) { - n = DOM.add(tb, 'tr'); - n = DOM.add(n, 'td', {colspan : s.grid_width, 'class' : 'mceMoreColors'}); - n = DOM.add(n, 'a', {role: 'option', id : t.id + '_more', href : 'javascript:;', onclick : 'return false;', 'class' : 'mceMoreColors'}, s.more_colors_title); - - Event.add(n, 'click', function(e) { - s.more_colors_func.call(s.more_colors_scope || this); - return Event.cancel(e); // Cancel to fix onbeforeunload problem - }); - } - - DOM.addClass(m, 'mceColorSplitMenu'); - - new tinymce.ui.KeyboardNavigation({ - root: t.id + '_menu', - items: DOM.select('a', t.id + '_menu'), - onCancel: function() { - t.hideMenu(); - t.focus(); - } - }); - - // Prevent IE from scrolling and hindering click to occur #4019 - Event.add(t.id + '_menu', 'mousedown', function(e) {return Event.cancel(e);}); - - Event.add(t.id + '_menu', 'click', function(e) { - var c; - - e = DOM.getParent(e.target, 'a', tb); - - if (e && e.nodeName.toLowerCase() == 'a' && (c = e.getAttribute('data-mce-color'))) - t.setColor(c); - - return Event.cancel(e); // Prevent IE auto save warning - }); - - return w; - }, - - /** - * Sets the current color for the control and hides the menu if it should be visible. - * - * @method setColor - * @param {String} c Color code value in hex for example: #FF00FF - */ - setColor : function(c) { - this.displayColor(c); - this.hideMenu(); - this.settings.onselect(c); - }, - - /** - * Change the currently selected color for the control. - * - * @method displayColor - * @param {String} c Color code value in hex for example: #FF00FF - */ - displayColor : function(c) { - var t = this; - - DOM.setStyle(t.id + '_preview', 'backgroundColor', c); - - t.value = c; - }, - - /** - * Post render event. This will be executed after the control has been rendered and can be used to - * set states, add events to the control etc. It's recommended for subclasses of the control to call this method by using this.parent(). - * - * @method postRender - */ - postRender : function() { - var t = this, id = t.id; - - t.parent(); - DOM.add(id + '_action', 'div', {id : id + '_preview', 'class' : 'mceColorPreview'}); - DOM.setStyle(t.id + '_preview', 'backgroundColor', t.value); - }, - - /** - * Destroys the control. This means it will be removed from the DOM and any - * events tied to it will also be removed. - * - * @method destroy - */ - destroy : function() { - this.parent(); - - Event.clear(this.id + '_menu'); - Event.clear(this.id + '_more'); - DOM.remove(this.id + '_menu'); - } - }); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/Container.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/Container.js deleted file mode 100644 index de47b4018c3a..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/Container.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Container.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -/** - * This class is the base class for all container controls like toolbars. This class should not - * be instantiated directly other container controls should inherit from this one. - * - * @class tinymce.ui.Container - * @extends tinymce.ui.Control - */ -tinymce.create('tinymce.ui.Container:tinymce.ui.Control', { - /** - * Base contrustor a new container control instance. - * - * @constructor - * @method Container - * @param {String} id Control id to use for the container. - * @param {Object} s Optional name/value settings object. - */ - Container : function(id, s, editor) { - this.parent(id, s, editor); - - /** - * Array of controls added to the container. - * - * @property controls - * @type Array - */ - this.controls = []; - - this.lookup = {}; - }, - - /** - * Adds a control to the collection of controls for the container. - * - * @method add - * @param {tinymce.ui.Control} c Control instance to add to the container. - * @return {tinymce.ui.Control} Same control instance that got passed in. - */ - add : function(c) { - this.lookup[c.id] = c; - this.controls.push(c); - - return c; - }, - - /** - * Returns a control by id from the containers collection. - * - * @method get - * @param {String} n Id for the control to retrieve. - * @return {tinymce.ui.Control} Control instance by the specified name or undefined if it wasn't found. - */ - get : function(n) { - return this.lookup[n]; - } -}); - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/Control.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/Control.js deleted file mode 100644 index 3550cf188b12..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/Control.js +++ /dev/null @@ -1,198 +0,0 @@ -/** - * Control.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - // Shorten class names - var DOM = tinymce.DOM, is = tinymce.is; - - /** - * This class is the base class for all controls like buttons, toolbars, containers. This class should not - * be instantiated directly other controls should inherit from this one. - * - * @class tinymce.ui.Control - */ - tinymce.create('tinymce.ui.Control', { - /** - * Constructs a new control instance. - * - * @constructor - * @method Control - * @param {String} id Control id. - * @param {Object} s Optional name/value settings object. - */ - Control : function(id, s, editor) { - this.id = id; - this.settings = s = s || {}; - this.rendered = false; - this.onRender = new tinymce.util.Dispatcher(this); - this.classPrefix = ''; - this.scope = s.scope || this; - this.disabled = 0; - this.active = 0; - this.editor = editor; - }, - - setAriaProperty : function(property, value) { - var element = DOM.get(this.id + '_aria') || DOM.get(this.id); - if (element) { - DOM.setAttrib(element, 'aria-' + property, !!value); - } - }, - - focus : function() { - DOM.get(this.id).focus(); - }, - - /** - * Sets the disabled state for the control. This will add CSS classes to the - * element that contains the control. So that it can be disabled visually. - * - * @method setDisabled - * @param {Boolean} s Boolean state if the control should be disabled or not. - */ - setDisabled : function(s) { - if (s != this.disabled) { - this.setAriaProperty('disabled', s); - - this.setState('Disabled', s); - this.setState('Enabled', !s); - this.disabled = s; - } - }, - - /** - * Returns true/false if the control is disabled or not. This is a method since you can then - * choose to check some class or some internal bool state in subclasses. - * - * @method isDisabled - * @return {Boolean} true/false if the control is disabled or not. - */ - isDisabled : function() { - return this.disabled; - }, - - /** - * Sets the activated state for the control. This will add CSS classes to the - * element that contains the control. So that it can be activated visually. - * - * @method setActive - * @param {Boolean} s Boolean state if the control should be activated or not. - */ - setActive : function(s) { - if (s != this.active) { - this.setState('Active', s); - this.active = s; - this.setAriaProperty('pressed', s); - } - }, - - /** - * Returns true/false if the control is disabled or not. This is a method since you can then - * choose to check some class or some internal bool state in subclasses. - * - * @method isActive - * @return {Boolean} true/false if the control is disabled or not. - */ - isActive : function() { - return this.active; - }, - - /** - * Sets the specified class state for the control. - * - * @method setState - * @param {String} c Class name to add/remove depending on state. - * @param {Boolean} s True/false state if the class should be removed or added. - */ - setState : function(c, s) { - var n = DOM.get(this.id); - - c = this.classPrefix + c; - - if (s) - DOM.addClass(n, c); - else - DOM.removeClass(n, c); - }, - - /** - * Returns true/false if the control has been rendered or not. - * - * @method isRendered - * @return {Boolean} State if the control has been rendered or not. - */ - isRendered : function() { - return this.rendered; - }, - - /** - * Renders the control as a HTML string. This method is much faster than using the DOM and when - * creating a whole toolbar with buttons it does make a lot of difference. - * - * @method renderHTML - * @return {String} HTML for the button control element. - */ - renderHTML : function() { - }, - - /** - * Renders the control to the specified container element. - * - * @method renderTo - * @param {Element} n HTML DOM element to add control to. - */ - renderTo : function(n) { - DOM.setHTML(n, this.renderHTML()); - }, - - /** - * Post render event. This will be executed after the control has been rendered and can be used to - * set states, add events to the control etc. It's recommended for subclasses of the control to call this method by using this.parent(). - * - * @method postRender - */ - postRender : function() { - var t = this, b; - - // Set pending states - if (is(t.disabled)) { - b = t.disabled; - t.disabled = -1; - t.setDisabled(b); - } - - if (is(t.active)) { - b = t.active; - t.active = -1; - t.setActive(b); - } - }, - - /** - * Removes the control. This means it will be removed from the DOM and any - * events tied to it will also be removed. - * - * @method remove - */ - remove : function() { - DOM.remove(this.id); - this.destroy(); - }, - - /** - * Destroys the control will free any memory by removing event listeners etc. - * - * @method destroy - */ - destroy : function() { - tinymce.dom.Event.clear(this.id); - } - }); -})(tinymce); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/DropMenu.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/DropMenu.js deleted file mode 100644 index d3e766a6e878..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/DropMenu.js +++ /dev/null @@ -1,476 +0,0 @@ -/** - * DropMenu.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event, Element = tinymce.dom.Element; - - /** - * This class is used to create drop menus, a drop menu can be a - * context menu, or a menu for a list box or a menu bar. - * - * @class tinymce.ui.DropMenu - * @extends tinymce.ui.Menu - * @example - * // Adds a menu to the currently active editor instance - * var dm = tinyMCE.activeEditor.controlManager.createDropMenu('somemenu'); - * - * // Add some menu items - * dm.add({title : 'Menu 1', onclick : function() { - * alert('Item 1 was clicked.'); - * }}); - * - * dm.add({title : 'Menu 2', onclick : function() { - * alert('Item 2 was clicked.'); - * }}); - * - * // Adds a submenu - * var sub1 = dm.addMenu({title : 'Menu 3'}); - * sub1.add({title : 'Menu 1.1', onclick : function() { - * alert('Item 1.1 was clicked.'); - * }}); - * - * // Adds a horizontal separator - * sub1.addSeparator(); - * - * sub1.add({title : 'Menu 1.2', onclick : function() { - * alert('Item 1.2 was clicked.'); - * }}); - * - * // Adds a submenu to the submenu - * var sub2 = sub1.addMenu({title : 'Menu 1.3'}); - * - * // Adds items to the sub sub menu - * sub2.add({title : 'Menu 1.3.1', onclick : function() { - * alert('Item 1.3.1 was clicked.'); - * }}); - * - * sub2.add({title : 'Menu 1.3.2', onclick : function() { - * alert('Item 1.3.2 was clicked.'); - * }}); - * - * dm.add({title : 'Menu 4', onclick : function() { - * alert('Item 3 was clicked.'); - * }}); - * - * // Display the menu at position 100, 100 - * dm.showMenu(100, 100); - */ - tinymce.create('tinymce.ui.DropMenu:tinymce.ui.Menu', { - /** - * Constructs a new drop menu control instance. - * - * @constructor - * @method DropMenu - * @param {String} id Button control id for the button. - * @param {Object} s Optional name/value settings object. - */ - DropMenu : function(id, s) { - s = s || {}; - s.container = s.container || DOM.doc.body; - s.offset_x = s.offset_x || 0; - s.offset_y = s.offset_y || 0; - s.vp_offset_x = s.vp_offset_x || 0; - s.vp_offset_y = s.vp_offset_y || 0; - - if (is(s.icons) && !s.icons) - s['class'] += ' mceNoIcons'; - - this.parent(id, s); - this.onShowMenu = new tinymce.util.Dispatcher(this); - this.onHideMenu = new tinymce.util.Dispatcher(this); - this.classPrefix = 'mceMenu'; - }, - - /** - * Created a new sub menu for the drop menu control. - * - * @method createMenu - * @param {Object} s Optional name/value settings object. - * @return {tinymce.ui.DropMenu} New drop menu instance. - */ - createMenu : function(s) { - var t = this, cs = t.settings, m; - - s.container = s.container || cs.container; - s.parent = t; - s.constrain = s.constrain || cs.constrain; - s['class'] = s['class'] || cs['class']; - s.vp_offset_x = s.vp_offset_x || cs.vp_offset_x; - s.vp_offset_y = s.vp_offset_y || cs.vp_offset_y; - s.keyboard_focus = cs.keyboard_focus; - m = new tinymce.ui.DropMenu(s.id || DOM.uniqueId(), s); - - m.onAddItem.add(t.onAddItem.dispatch, t.onAddItem); - - return m; - }, - - focus : function() { - var t = this; - if (t.keyboardNav) { - t.keyboardNav.focus(); - } - }, - - /** - * Repaints the menu after new items have been added dynamically. - * - * @method update - */ - update : function() { - var t = this, s = t.settings, tb = DOM.get('menu_' + t.id + '_tbl'), co = DOM.get('menu_' + t.id + '_co'), tw, th; - - tw = s.max_width ? Math.min(tb.clientWidth, s.max_width) : tb.clientWidth; - th = s.max_height ? Math.min(tb.clientHeight, s.max_height) : tb.clientHeight; - - if (!DOM.boxModel) - t.element.setStyles({width : tw + 2, height : th + 2}); - else - t.element.setStyles({width : tw, height : th}); - - if (s.max_width) - DOM.setStyle(co, 'width', tw); - - if (s.max_height) { - DOM.setStyle(co, 'height', th); - - if (tb.clientHeight < s.max_height) - DOM.setStyle(co, 'overflow', 'hidden'); - } - }, - - /** - * Displays the menu at the specified cordinate. - * - * @method showMenu - * @param {Number} x Horizontal position of the menu. - * @param {Number} y Vertical position of the menu. - * @param {Numner} px Optional parent X position used when menus are cascading. - */ - showMenu : function(x, y, px) { - var t = this, s = t.settings, co, vp = DOM.getViewPort(), w, h, mx, my, ot = 2, dm, tb, cp = t.classPrefix; - - t.collapse(1); - - if (t.isMenuVisible) - return; - - if (!t.rendered) { - co = DOM.add(t.settings.container, t.renderNode()); - - each(t.items, function(o) { - o.postRender(); - }); - - t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container}); - } else - co = DOM.get('menu_' + t.id); - - // Move layer out of sight unless it's Opera since it scrolls to top of page due to an bug - if (!tinymce.isOpera) - DOM.setStyles(co, {left : -0xFFFF , top : -0xFFFF}); - - DOM.show(co); - t.update(); - - x += s.offset_x || 0; - y += s.offset_y || 0; - vp.w -= 4; - vp.h -= 4; - - // Move inside viewport if not submenu - if (s.constrain) { - w = co.clientWidth - ot; - h = co.clientHeight - ot; - mx = vp.x + vp.w; - my = vp.y + vp.h; - - if ((x + s.vp_offset_x + w) > mx) - x = px ? px - w : Math.max(0, (mx - s.vp_offset_x) - w); - - if ((y + s.vp_offset_y + h) > my) - y = Math.max(0, (my - s.vp_offset_y) - h); - } - - DOM.setStyles(co, {left : x , top : y}); - t.element.update(); - - t.isMenuVisible = 1; - t.mouseClickFunc = Event.add(co, 'click', function(e) { - var m; - - e = e.target; - - if (e && (e = DOM.getParent(e, 'tr')) && !DOM.hasClass(e, cp + 'ItemSub')) { - m = t.items[e.id]; - - if (m.isDisabled()) - return; - - dm = t; - - while (dm) { - if (dm.hideMenu) - dm.hideMenu(); - - dm = dm.settings.parent; - } - - if (m.settings.onclick) - m.settings.onclick(e); - - return Event.cancel(e); // Cancel to fix onbeforeunload problem - } - }); - - if (t.hasMenus()) { - t.mouseOverFunc = Event.add(co, 'mouseover', function(e) { - var m, r, mi; - - e = e.target; - if (e && (e = DOM.getParent(e, 'tr'))) { - m = t.items[e.id]; - - if (t.lastMenu) - t.lastMenu.collapse(1); - - if (m.isDisabled()) - return; - - if (e && DOM.hasClass(e, cp + 'ItemSub')) { - //p = DOM.getPos(s.container); - r = DOM.getRect(e); - m.showMenu((r.x + r.w - ot), r.y - ot, r.x); - t.lastMenu = m; - DOM.addClass(DOM.get(m.id).firstChild, cp + 'ItemActive'); - } - } - }); - } - - Event.add(co, 'keydown', t._keyHandler, t); - - t.onShowMenu.dispatch(t); - - if (s.keyboard_focus) { - t._setupKeyboardNav(); - } - }, - - /** - * Hides the displayed menu. - * - * @method hideMenu - */ - hideMenu : function(c) { - var t = this, co = DOM.get('menu_' + t.id), e; - - if (!t.isMenuVisible) - return; - - if (t.keyboardNav) t.keyboardNav.destroy(); - Event.remove(co, 'mouseover', t.mouseOverFunc); - Event.remove(co, 'click', t.mouseClickFunc); - Event.remove(co, 'keydown', t._keyHandler); - DOM.hide(co); - t.isMenuVisible = 0; - - if (!c) - t.collapse(1); - - if (t.element) - t.element.hide(); - - if (e = DOM.get(t.id)) - DOM.removeClass(e.firstChild, t.classPrefix + 'ItemActive'); - - t.onHideMenu.dispatch(t); - }, - - /** - * Adds a new menu, menu item or sub classes of them to the drop menu. - * - * @method add - * @param {tinymce.ui.Control} o Menu or menu item to add to the drop menu. - * @return {tinymce.ui.Control} Same as the input control, the menu or menu item. - */ - add : function(o) { - var t = this, co; - - o = t.parent(o); - - if (t.isRendered && (co = DOM.get('menu_' + t.id))) - t._add(DOM.select('tbody', co)[0], o); - - return o; - }, - - /** - * Collapses the menu, this will hide the menu and all menu items. - * - * @method collapse - * @param {Boolean} d Optional deep state. If this is set to true all children will be collapsed as well. - */ - collapse : function(d) { - this.parent(d); - this.hideMenu(1); - }, - - /** - * Removes a specific sub menu or menu item from the drop menu. - * - * @method remove - * @param {tinymce.ui.Control} o Menu item or menu to remove from drop menu. - * @return {tinymce.ui.Control} Control instance or null if it wasn't found. - */ - remove : function(o) { - DOM.remove(o.id); - this.destroy(); - - return this.parent(o); - }, - - /** - * Destroys the menu. This will remove the menu from the DOM and any events added to it etc. - * - * @method destroy - */ - destroy : function() { - var t = this, co = DOM.get('menu_' + t.id); - - if (t.keyboardNav) t.keyboardNav.destroy(); - Event.remove(co, 'mouseover', t.mouseOverFunc); - Event.remove(DOM.select('a', co), 'focus', t.mouseOverFunc); - Event.remove(co, 'click', t.mouseClickFunc); - Event.remove(co, 'keydown', t._keyHandler); - - if (t.element) - t.element.remove(); - - DOM.remove(co); - }, - - /** - * Renders the specified menu node to the dom. - * - * @method renderNode - * @return {Element} Container element for the drop menu. - */ - renderNode : function() { - var t = this, s = t.settings, n, tb, co, w; - - w = DOM.create('div', {role: 'listbox', id : 'menu_' + t.id, 'class' : s['class'], 'style' : 'position:absolute;left:0;top:0;z-index:200000;outline:0'}); - if (t.settings.parent) { - DOM.setAttrib(w, 'aria-parent', 'menu_' + t.settings.parent.id); - } - co = DOM.add(w, 'div', {role: 'presentation', id : 'menu_' + t.id + '_co', 'class' : t.classPrefix + (s['class'] ? ' ' + s['class'] : '')}); - t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container}); - - if (s.menu_line) - DOM.add(co, 'span', {'class' : t.classPrefix + 'Line'}); - -// n = DOM.add(co, 'div', {id : 'menu_' + t.id + '_co', 'class' : 'mceMenuContainer'}); - n = DOM.add(co, 'table', {role: 'presentation', id : 'menu_' + t.id + '_tbl', border : 0, cellPadding : 0, cellSpacing : 0}); - tb = DOM.add(n, 'tbody'); - - each(t.items, function(o) { - t._add(tb, o); - }); - - t.rendered = true; - - return w; - }, - - // Internal functions - _setupKeyboardNav : function(){ - var contextMenu, menuItems, t=this; - contextMenu = DOM.select('#menu_' + t.id)[0]; - menuItems = DOM.select('a[role=option]', 'menu_' + t.id); - menuItems.splice(0,0,contextMenu); - t.keyboardNav = new tinymce.ui.KeyboardNavigation({ - root: 'menu_' + t.id, - items: menuItems, - onCancel: function() { - t.hideMenu(); - }, - enableUpDown: true - }); - contextMenu.focus(); - }, - - _keyHandler : function(evt) { - var t = this, e; - switch (evt.keyCode) { - case 37: // Left - if (t.settings.parent) { - t.hideMenu(); - t.settings.parent.focus(); - Event.cancel(evt); - } - break; - case 39: // Right - if (t.mouseOverFunc) - t.mouseOverFunc(evt); - break; - } - }, - - _add : function(tb, o) { - var n, s = o.settings, a, ro, it, cp = this.classPrefix, ic; - - if (s.separator) { - ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'ItemSeparator'}); - DOM.add(ro, 'td', {'class' : cp + 'ItemSeparator'}); - - if (n = ro.previousSibling) - DOM.addClass(n, 'mceLast'); - - return; - } - - n = ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'Item ' + cp + 'ItemEnabled'}); - n = it = DOM.add(n, s.titleItem ? 'th' : 'td'); - n = a = DOM.add(n, 'a', {id: o.id + '_aria', role: s.titleItem ? 'presentation' : 'option', href : 'javascript:;', onclick : "return false;", onmousedown : 'return false;'}); - - if (s.parent) { - DOM.setAttrib(a, 'aria-haspopup', 'true'); - DOM.setAttrib(a, 'aria-owns', 'menu_' + o.id); - } - - DOM.addClass(it, s['class']); -// n = DOM.add(n, 'span', {'class' : 'item'}); - - ic = DOM.add(n, 'span', {'class' : 'mceIcon' + (s.icon ? ' mce_' + s.icon : '')}); - - if (s.icon_src) - DOM.add(ic, 'img', {src : s.icon_src}); - - n = DOM.add(n, s.element || 'span', {'class' : 'mceText', title : o.settings.title}, o.settings.title); - - if (o.settings.style) - DOM.setAttrib(n, 'style', o.settings.style); - - if (tb.childNodes.length == 1) - DOM.addClass(ro, 'mceFirst'); - - if ((n = ro.previousSibling) && DOM.hasClass(n, cp + 'ItemSeparator')) - DOM.addClass(ro, 'mceFirst'); - - if (o.collapse) - DOM.addClass(ro, cp + 'ItemSub'); - - if (n = ro.previousSibling) - DOM.removeClass(n, 'mceLast'); - - DOM.addClass(ro, 'mceLast'); - } - }); -})(tinymce); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/KeyboardNavigation.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/KeyboardNavigation.js deleted file mode 100644 index 04efbbc3edf7..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/KeyboardNavigation.js +++ /dev/null @@ -1,183 +0,0 @@ -/** - * KeyboardNavigation.js - * - * Copyright 2011, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var Event = tinymce.dom.Event, each = tinymce.each; - - /** - * This class provides basic keyboard navigation using the arrow keys to children of a component. - * For example, this class handles moving between the buttons on the toolbars. - * - * @class tinymce.ui.KeyboardNavigation - */ - tinymce.create('tinymce.ui.KeyboardNavigation', { - /** - * Create a new KeyboardNavigation instance to handle the focus for a specific element. - * - * @constructor - * @method KeyboardNavigation - * @param {Object} settings the settings object to define how keyboard navigation works. - * @param {DOMUtils} dom the DOMUtils instance to use. - * - * @setting {Element/String} root the root element or ID of the root element for the control. - * @setting {Array} items an array containing the items to move focus between. Every object in this array must have an id attribute which maps to the actual DOM element. If the actual elements are passed without an ID then one is automatically assigned. - * @setting {Function} onCancel the callback for when the user presses escape or otherwise indicates cancelling. - * @setting {Function} onAction (optional) the action handler to call when the user activates an item. - * @setting {Boolean} enableLeftRight (optional, default) when true, the up/down arrows move through items. - * @setting {Boolean} enableUpDown (optional) when true, the up/down arrows move through items. - * Note for both up/down and left/right explicitly set both enableLeftRight and enableUpDown to true. - */ - KeyboardNavigation: function(settings, dom) { - var t = this, root = settings.root, items = settings.items, - enableUpDown = settings.enableUpDown, enableLeftRight = settings.enableLeftRight || !settings.enableUpDown, - excludeFromTabOrder = settings.excludeFromTabOrder, - itemFocussed, itemBlurred, rootKeydown, rootFocussed, focussedId; - - dom = dom || tinymce.DOM; - - itemFocussed = function(evt) { - focussedId = evt.target.id; - }; - - itemBlurred = function(evt) { - dom.setAttrib(evt.target.id, 'tabindex', '-1'); - }; - - rootFocussed = function(evt) { - var item = dom.get(focussedId); - dom.setAttrib(item, 'tabindex', '0'); - item.focus(); - }; - - t.focus = function() { - dom.get(focussedId).focus(); - }; - - /** - * Destroys the KeyboardNavigation and unbinds any focus/blur event handles it might have added. - * - * @method destroy - */ - t.destroy = function() { - each(items, function(item) { - dom.unbind(dom.get(item.id), 'focus', itemFocussed); - dom.unbind(dom.get(item.id), 'blur', itemBlurred); - }); - - dom.unbind(dom.get(root), 'focus', rootFocussed); - dom.unbind(dom.get(root), 'keydown', rootKeydown); - - items = dom = root = t.focus = itemFocussed = itemBlurred = rootKeydown = rootFocussed = null; - t.destroy = function() {}; - }; - - t.moveFocus = function(dir, evt) { - var idx = -1, controls = t.controls, newFocus; - - if (!focussedId) - return; - - each(items, function(item, index) { - if (item.id === focussedId) { - idx = index; - return false; - } - }); - - idx += dir; - if (idx < 0) { - idx = items.length - 1; - } else if (idx >= items.length) { - idx = 0; - } - - newFocus = items[idx]; - dom.setAttrib(focussedId, 'tabindex', '-1'); - dom.setAttrib(newFocus.id, 'tabindex', '0'); - dom.get(newFocus.id).focus(); - - if (settings.actOnFocus) { - settings.onAction(newFocus.id); - } - - if (evt) - Event.cancel(evt); - }; - - rootKeydown = function(evt) { - var DOM_VK_LEFT = 37, DOM_VK_RIGHT = 39, DOM_VK_UP = 38, DOM_VK_DOWN = 40, DOM_VK_ESCAPE = 27, DOM_VK_ENTER = 14, DOM_VK_RETURN = 13, DOM_VK_SPACE = 32; - - switch (evt.keyCode) { - case DOM_VK_LEFT: - if (enableLeftRight) t.moveFocus(-1); - break; - - case DOM_VK_RIGHT: - if (enableLeftRight) t.moveFocus(1); - break; - - case DOM_VK_UP: - if (enableUpDown) t.moveFocus(-1); - break; - - case DOM_VK_DOWN: - if (enableUpDown) t.moveFocus(1); - break; - - case DOM_VK_ESCAPE: - if (settings.onCancel) { - settings.onCancel(); - Event.cancel(evt); - } - break; - - case DOM_VK_ENTER: - case DOM_VK_RETURN: - case DOM_VK_SPACE: - if (settings.onAction) { - settings.onAction(focussedId); - Event.cancel(evt); - } - break; - } - }; - - // Set up state and listeners for each item. - each(items, function(item, idx) { - var tabindex; - - if (!item.id) { - item.id = dom.uniqueId('_mce_item_'); - } - - if (excludeFromTabOrder) { - dom.bind(item.id, 'blur', itemBlurred); - tabindex = '-1'; - } else { - tabindex = (idx === 0 ? '0' : '-1'); - } - - dom.setAttrib(item.id, 'tabindex', tabindex); - dom.bind(dom.get(item.id), 'focus', itemFocussed); - }); - - // Setup initial state for root element. - if (items[0]){ - focussedId = items[0].id; - } - - dom.setAttrib(root, 'tabindex', '-1'); - - // Setup listeners for root element. - dom.bind(dom.get(root), 'focus', rootFocussed); - dom.bind(dom.get(root), 'keydown', rootKeydown); - } - }); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/ListBox.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/ListBox.js deleted file mode 100644 index 5acbd76f43b4..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/ListBox.js +++ /dev/null @@ -1,428 +0,0 @@ -/** - * ListBox.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher; - - /** - * This class is used to create list boxes/select list. This one will generate - * a non native control. This one has the benefits of having visual items added. - * - * @class tinymce.ui.ListBox - * @extends tinymce.ui.Control - * @example - * // Creates a new plugin class and a custom listbox - * tinymce.create('tinymce.plugins.ExamplePlugin', { - * createControl: function(n, cm) { - * switch (n) { - * case 'mylistbox': - * var mlb = cm.createListBox('mylistbox', { - * title : 'My list box', - * onselect : function(v) { - * tinyMCE.activeEditor.windowManager.alert('Value selected:' + v); - * } - * }); - * - * // Add some values to the list box - * mlb.add('Some item 1', 'val1'); - * mlb.add('some item 2', 'val2'); - * mlb.add('some item 3', 'val3'); - * - * // Return the new listbox instance - * return mlb; - * } - * - * return null; - * } - * }); - * - * // Register plugin with a short name - * tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); - * - * // Initialize TinyMCE with the new plugin and button - * tinyMCE.init({ - * ... - * plugins : '-example', // - means TinyMCE will not try to load it - * theme_advanced_buttons1 : 'mylistbox' // Add the new example listbox to the toolbar - * }); - */ - tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control', { - /** - * Constructs a new listbox control instance. - * - * @constructor - * @method ListBox - * @param {String} id Control id for the list box. - * @param {Object} s Optional name/value settings object. - * @param {Editor} ed Optional the editor instance this button is for. - */ - ListBox : function(id, s, ed) { - var t = this; - - t.parent(id, s, ed); - - /** - * Array of ListBox items. - * - * @property items - * @type Array - */ - t.items = []; - - /** - * Fires when the selection has been changed. - * - * @event onChange - */ - t.onChange = new Dispatcher(t); - - /** - * Fires after the element has been rendered to DOM. - * - * @event onPostRender - */ - t.onPostRender = new Dispatcher(t); - - /** - * Fires when a new item is added. - * - * @event onAdd - */ - t.onAdd = new Dispatcher(t); - - /** - * Fires when the menu gets rendered. - * - * @event onRenderMenu - */ - t.onRenderMenu = new tinymce.util.Dispatcher(this); - - t.classPrefix = 'mceListBox'; - }, - - /** - * Selects a item/option by value. This will both add a visual selection to the - * item and change the title of the control to the title of the option. - * - * @method select - * @param {String/function} va Value to look for inside the list box or a function selector. - */ - select : function(va) { - var t = this, fv, f; - - if (va == undefined) - return t.selectByIndex(-1); - - // Is string or number make function selector - if (va && va.call) - f = va; - else { - f = function(v) { - return v == va; - }; - } - - // Do we need to do something? - if (va != t.selectedValue) { - // Find item - each(t.items, function(o, i) { - if (f(o.value)) { - fv = 1; - t.selectByIndex(i); - return false; - } - }); - - if (!fv) - t.selectByIndex(-1); - } - }, - - /** - * Selects a item/option by index. This will both add a visual selection to the - * item and change the title of the control to the title of the option. - * - * @method selectByIndex - * @param {String} idx Index to select, pass -1 to select menu/title of select box. - */ - selectByIndex : function(idx) { - var t = this, e, o, label; - - if (idx != t.selectedIndex) { - e = DOM.get(t.id + '_text'); - label = DOM.get(t.id + '_voiceDesc'); - o = t.items[idx]; - - if (o) { - t.selectedValue = o.value; - t.selectedIndex = idx; - DOM.setHTML(e, DOM.encode(o.title)); - DOM.setHTML(label, t.settings.title + " - " + o.title); - DOM.removeClass(e, 'mceTitle'); - DOM.setAttrib(t.id, 'aria-valuenow', o.title); - } else { - DOM.setHTML(e, DOM.encode(t.settings.title)); - DOM.setHTML(label, DOM.encode(t.settings.title)); - DOM.addClass(e, 'mceTitle'); - t.selectedValue = t.selectedIndex = null; - DOM.setAttrib(t.id, 'aria-valuenow', t.settings.title); - } - e = 0; - } - }, - - /** - * Adds a option item to the list box. - * - * @method add - * @param {String} n Title for the new option. - * @param {String} v Value for the new option. - * @param {Object} o Optional object with settings like for example class. - */ - add : function(n, v, o) { - var t = this; - - o = o || {}; - o = tinymce.extend(o, { - title : n, - value : v - }); - - t.items.push(o); - t.onAdd.dispatch(t, o); - }, - - /** - * Returns the number of items inside the list box. - * - * @method getLength - * @param {Number} Number of items inside the list box. - */ - getLength : function() { - return this.items.length; - }, - - /** - * Renders the list box as a HTML string. This method is much faster than using the DOM and when - * creating a whole toolbar with buttons it does make a lot of difference. - * - * @method renderHTML - * @return {String} HTML for the list box control element. - */ - renderHTML : function() { - var h = '', t = this, s = t.settings, cp = t.classPrefix; - - h = '<span role="listbox" aria-haspopup="true" aria-labelledby="' + t.id +'_voiceDesc" aria-describedby="' + t.id + '_voiceDesc"><table role="presentation" tabindex="0" id="' + t.id + '" cellpadding="0" cellspacing="0" class="' + cp + ' ' + cp + 'Enabled' + (s['class'] ? (' ' + s['class']) : '') + '"><tbody><tr>'; - h += '<td>' + DOM.createHTML('span', {id: t.id + '_voiceDesc', 'class': 'voiceLabel', style:'display:none;'}, t.settings.title); - h += DOM.createHTML('a', {id : t.id + '_text', tabindex : -1, href : 'javascript:;', 'class' : 'mceText', onclick : "return false;", onmousedown : 'return false;'}, DOM.encode(t.settings.title)) + '</td>'; - h += '<td>' + DOM.createHTML('a', {id : t.id + '_open', tabindex : -1, href : 'javascript:;', 'class' : 'mceOpen', onclick : "return false;", onmousedown : 'return false;'}, '<span><span style="display:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span></span>') + '</td>'; - h += '</tr></tbody></table></span>'; - - return h; - }, - - /** - * Displays the drop menu with all items. - * - * @method showMenu - */ - showMenu : function() { - var t = this, p2, e = DOM.get(this.id), m; - - if (t.isDisabled() || t.items.length == 0) - return; - - if (t.menu && t.menu.isMenuVisible) - return t.hideMenu(); - - if (!t.isMenuRendered) { - t.renderMenu(); - t.isMenuRendered = true; - } - - p2 = DOM.getPos(e); - - m = t.menu; - m.settings.offset_x = p2.x; - m.settings.offset_y = p2.y; - m.settings.keyboard_focus = !tinymce.isOpera; // Opera is buggy when it comes to auto focus - - // Select in menu - if (t.oldID) - m.items[t.oldID].setSelected(0); - - each(t.items, function(o) { - if (o.value === t.selectedValue) { - m.items[o.id].setSelected(1); - t.oldID = o.id; - } - }); - - m.showMenu(0, e.clientHeight); - - Event.add(DOM.doc, 'mousedown', t.hideMenu, t); - DOM.addClass(t.id, t.classPrefix + 'Selected'); - - //DOM.get(t.id + '_text').focus(); - }, - - /** - * Hides the drop menu. - * - * @method hideMenu - */ - hideMenu : function(e) { - var t = this; - - if (t.menu && t.menu.isMenuVisible) { - DOM.removeClass(t.id, t.classPrefix + 'Selected'); - - // Prevent double toogles by canceling the mouse click event to the button - if (e && e.type == "mousedown" && (e.target.id == t.id + '_text' || e.target.id == t.id + '_open')) - return; - - if (!e || !DOM.getParent(e.target, '.mceMenu')) { - DOM.removeClass(t.id, t.classPrefix + 'Selected'); - Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); - t.menu.hideMenu(); - } - } - }, - - /** - * Renders the menu to the DOM. - * - * @method renderMenu - */ - renderMenu : function() { - var t = this, m; - - m = t.settings.control_manager.createDropMenu(t.id + '_menu', { - menu_line : 1, - 'class' : t.classPrefix + 'Menu mceNoIcons', - max_width : 150, - max_height : 150 - }); - - m.onHideMenu.add(function() { - t.hideMenu(); - t.focus(); - }); - - m.add({ - title : t.settings.title, - 'class' : 'mceMenuItemTitle', - onclick : function() { - if (t.settings.onselect('') !== false) - t.select(''); // Must be runned after - } - }); - - each(t.items, function(o) { - // No value then treat it as a title - if (o.value === undefined) { - m.add({ - title : o.title, - role : "option", - 'class' : 'mceMenuItemTitle', - onclick : function() { - if (t.settings.onselect('') !== false) - t.select(''); // Must be runned after - } - }); - } else { - o.id = DOM.uniqueId(); - o.role= "option"; - o.onclick = function() { - if (t.settings.onselect(o.value) !== false) - t.select(o.value); // Must be runned after - }; - - m.add(o); - } - }); - - t.onRenderMenu.dispatch(t, m); - t.menu = m; - }, - - /** - * Post render event. This will be executed after the control has been rendered and can be used to - * set states, add events to the control etc. It's recommended for subclasses of the control to call this method by using this.parent(). - * - * @method postRender - */ - postRender : function() { - var t = this, cp = t.classPrefix; - - Event.add(t.id, 'click', t.showMenu, t); - Event.add(t.id, 'keydown', function(evt) { - if (evt.keyCode == 32) { // Space - t.showMenu(evt); - Event.cancel(evt); - } - }); - Event.add(t.id, 'focus', function() { - if (!t._focused) { - t.keyDownHandler = Event.add(t.id, 'keydown', function(e) { - if (e.keyCode == 40) { - t.showMenu(); - Event.cancel(e); - } - }); - t.keyPressHandler = Event.add(t.id, 'keypress', function(e) { - var v; - if (e.keyCode == 13) { - // Fake select on enter - v = t.selectedValue; - t.selectedValue = null; // Needs to be null to fake change - Event.cancel(e); - t.settings.onselect(v); - } - }); - } - - t._focused = 1; - }); - Event.add(t.id, 'blur', function() { - Event.remove(t.id, 'keydown', t.keyDownHandler); - Event.remove(t.id, 'keypress', t.keyPressHandler); - t._focused = 0; - }); - - // Old IE doesn't have hover on all elements - if (tinymce.isIE6 || !DOM.boxModel) { - Event.add(t.id, 'mouseover', function() { - if (!DOM.hasClass(t.id, cp + 'Disabled')) - DOM.addClass(t.id, cp + 'Hover'); - }); - - Event.add(t.id, 'mouseout', function() { - if (!DOM.hasClass(t.id, cp + 'Disabled')) - DOM.removeClass(t.id, cp + 'Hover'); - }); - } - - t.onPostRender.dispatch(t, DOM.get(t.id)); - }, - - /** - * Destroys the ListBox i.e. clear memory and events. - * - * @method destroy - */ - destroy : function() { - this.parent(); - - Event.clear(this.id + '_text'); - Event.clear(this.id + '_open'); - } - }); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/Menu.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/Menu.js deleted file mode 100644 index b2ae220cb273..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/Menu.js +++ /dev/null @@ -1,186 +0,0 @@ -/** - * Menu.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk; - - /** - * This class is base class for all menu types like DropMenus etc. This class should not - * be instantiated directly other menu controls should inherit from this one. - * - * @class tinymce.ui.Menu - * @extends tinymce.ui.MenuItem - */ - tinymce.create('tinymce.ui.Menu:tinymce.ui.MenuItem', { - /** - * Constructs a new button control instance. - * - * @constructor - * @method Menu - * @param {String} id Button control id for the button. - * @param {Object} s Optional name/value settings object. - */ - Menu : function(id, s) { - var t = this; - - t.parent(id, s); - t.items = {}; - t.collapsed = false; - t.menuCount = 0; - t.onAddItem = new tinymce.util.Dispatcher(this); - }, - - /** - * Expands the menu, this will show them menu and all menu items. - * - * @method expand - * @param {Boolean} d Optional deep state. If this is set to true all children will be expanded as well. - */ - expand : function(d) { - var t = this; - - if (d) { - walk(t, function(o) { - if (o.expand) - o.expand(); - }, 'items', t); - } - - t.collapsed = false; - }, - - /** - * Collapses the menu, this will hide the menu and all menu items. - * - * @method collapse - * @param {Boolean} d Optional deep state. If this is set to true all children will be collapsed as well. - */ - collapse : function(d) { - var t = this; - - if (d) { - walk(t, function(o) { - if (o.collapse) - o.collapse(); - }, 'items', t); - } - - t.collapsed = true; - }, - - /** - * Returns true/false if the menu has been collapsed or not. - * - * @method isCollapsed - * @return {Boolean} True/false state if the menu has been collapsed or not. - */ - isCollapsed : function() { - return this.collapsed; - }, - - /** - * Adds a new menu, menu item or sub classes of them to the drop menu. - * - * @method add - * @param {tinymce.ui.Control} o Menu or menu item to add to the drop menu. - * @return {tinymce.ui.Control} Same as the input control, the menu or menu item. - */ - add : function(o) { - if (!o.settings) - o = new tinymce.ui.MenuItem(o.id || DOM.uniqueId(), o); - - this.onAddItem.dispatch(this, o); - - return this.items[o.id] = o; - }, - - /** - * Adds a menu separator between the menu items. - * - * @method addSeparator - * @return {tinymce.ui.MenuItem} Menu item instance for the separator. - */ - addSeparator : function() { - return this.add({separator : true}); - }, - - /** - * Adds a sub menu to the menu. - * - * @method addMenu - * @param {Object} o Menu control or a object with settings to be created into an control. - * @return {tinymce.ui.Menu} Menu control instance passed in or created. - */ - addMenu : function(o) { - if (!o.collapse) - o = this.createMenu(o); - - this.menuCount++; - - return this.add(o); - }, - - /** - * Returns true/false if the menu has sub menus or not. - * - * @method hasMenus - * @return {Boolean} True/false state if the menu has sub menues or not. - */ - hasMenus : function() { - return this.menuCount !== 0; - }, - - /** - * Removes a specific sub menu or menu item from the menu. - * - * @method remove - * @param {tinymce.ui.Control} o Menu item or menu to remove from menu. - * @return {tinymce.ui.Control} Control instance or null if it wasn't found. - */ - remove : function(o) { - delete this.items[o.id]; - }, - - /** - * Removes all menu items and sub menu items from the menu. - * - * @method removeAll - */ - removeAll : function() { - var t = this; - - walk(t, function(o) { - if (o.removeAll) - o.removeAll(); - else - o.remove(); - - o.destroy(); - }, 'items', t); - - t.items = {}; - }, - - /** - * Created a new sub menu for the menu control. - * - * @method createMenu - * @param {Object} s Optional name/value settings object. - * @return {tinymce.ui.Menu} New drop menu instance. - */ - createMenu : function(o) { - var m = new tinymce.ui.Menu(o.id || DOM.uniqueId(), o); - - m.onAddItem.add(this.onAddItem.dispatch, this.onAddItem); - - return m; - } - }); -})(tinymce); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/MenuButton.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/MenuButton.js deleted file mode 100644 index 1944b8024ecd..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/MenuButton.js +++ /dev/null @@ -1,176 +0,0 @@ -/** - * MenuButton.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each; - - /** - * This class is used to create a UI button. A button is basically a link - * that is styled to look like a button or icon. - * - * @class tinymce.ui.MenuButton - * @extends tinymce.ui.Control - * @example - * // Creates a new plugin class and a custom menu button - * tinymce.create('tinymce.plugins.ExamplePlugin', { - * createControl: function(n, cm) { - * switch (n) { - * case 'mymenubutton': - * var c = cm.createSplitButton('mysplitbutton', { - * title : 'My menu button', - * image : 'some.gif' - * }); - * - * c.onRenderMenu.add(function(c, m) { - * m.add({title : 'Some title', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - * - * m.add({title : 'Some item 1', onclick : function() { - * alert('Some item 1 was clicked.'); - * }}); - * - * m.add({title : 'Some item 2', onclick : function() { - * alert('Some item 2 was clicked.'); - * }}); - * }); - * - * // Return the new menubutton instance - * return c; - * } - * - * return null; - * } - * }); - */ - tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button', { - /** - * Constructs a new split button control instance. - * - * @constructor - * @method MenuButton - * @param {String} id Control id for the split button. - * @param {Object} s Optional name/value settings object. - * @param {Editor} ed Optional the editor instance this button is for. - */ - MenuButton : function(id, s, ed) { - this.parent(id, s, ed); - - /** - * Fires when the menu is rendered. - * - * @event onRenderMenu - */ - this.onRenderMenu = new tinymce.util.Dispatcher(this); - - s.menu_container = s.menu_container || DOM.doc.body; - }, - - /** - * Shows the menu. - * - * @method showMenu - */ - showMenu : function() { - var t = this, p1, p2, e = DOM.get(t.id), m; - - if (t.isDisabled()) - return; - - if (!t.isMenuRendered) { - t.renderMenu(); - t.isMenuRendered = true; - } - - if (t.isMenuVisible) - return t.hideMenu(); - - p1 = DOM.getPos(t.settings.menu_container); - p2 = DOM.getPos(e); - - m = t.menu; - m.settings.offset_x = p2.x; - m.settings.offset_y = p2.y; - m.settings.vp_offset_x = p2.x; - m.settings.vp_offset_y = p2.y; - m.settings.keyboard_focus = t._focused; - m.showMenu(0, e.clientHeight); - - Event.add(DOM.doc, 'mousedown', t.hideMenu, t); - t.setState('Selected', 1); - - t.isMenuVisible = 1; - }, - - /** - * Renders the menu to the DOM. - * - * @method renderMenu - */ - renderMenu : function() { - var t = this, m; - - m = t.settings.control_manager.createDropMenu(t.id + '_menu', { - menu_line : 1, - 'class' : this.classPrefix + 'Menu', - icons : t.settings.icons - }); - - m.onHideMenu.add(function() { - t.hideMenu(); - t.focus(); - }); - - t.onRenderMenu.dispatch(t, m); - t.menu = m; - }, - - /** - * Hides the menu. The optional event parameter is used to check where the event occurred so it - * doesn't close them menu if it was a event inside the menu. - * - * @method hideMenu - * @param {Event} e Optional event object. - */ - hideMenu : function(e) { - var t = this; - - // Prevent double toogles by canceling the mouse click event to the button - if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id || e.id === t.id + '_open';})) - return; - - if (!e || !DOM.getParent(e.target, '.mceMenu')) { - t.setState('Selected', 0); - Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); - if (t.menu) - t.menu.hideMenu(); - } - - t.isMenuVisible = 0; - }, - - /** - * Post render handler. This function will be called after the UI has been - * rendered so that events can be added. - * - * @method postRender - */ - postRender : function() { - var t = this, s = t.settings; - - Event.add(t.id, 'click', function() { - if (!t.isDisabled()) { - if (s.onclick) - s.onclick(t.value); - - t.showMenu(); - } - }); - } - }); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/MenuItem.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/MenuItem.js deleted file mode 100644 index a6a145bcde3c..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/MenuItem.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * MenuItem.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk; - - /** - * This class is base class for all menu item types like DropMenus items etc. This class should not - * be instantiated directly other menu items should inherit from this one. - * - * @class tinymce.ui.MenuItem - * @extends tinymce.ui.Control - */ - tinymce.create('tinymce.ui.MenuItem:tinymce.ui.Control', { - /** - * Constructs a new button control instance. - * - * @constructor - * @method MenuItem - * @param {String} id Button control id for the button. - * @param {Object} s Optional name/value settings object. - */ - MenuItem : function(id, s) { - this.parent(id, s); - this.classPrefix = 'mceMenuItem'; - }, - - /** - * Sets the selected state for the control. This will add CSS classes to the - * element that contains the control. So that it can be selected visually. - * - * @method setSelected - * @param {Boolean} s Boolean state if the control should be selected or not. - */ - setSelected : function(s) { - this.setState('Selected', s); - this.setAriaProperty('checked', !!s); - this.selected = s; - }, - - /** - * Returns true/false if the control is selected or not. - * - * @method isSelected - * @return {Boolean} true/false if the control is selected or not. - */ - isSelected : function() { - return this.selected; - }, - - /** - * Post render handler. This function will be called after the UI has been - * rendered so that events can be added. - * - * @method postRender - */ - postRender : function() { - var t = this; - - t.parent(); - - // Set pending state - if (is(t.selected)) - t.setSelected(t.selected); - } - }); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/NativeListBox.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/NativeListBox.js deleted file mode 100644 index 32cfac01599e..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/NativeListBox.js +++ /dev/null @@ -1,217 +0,0 @@ -/** - * NativeListBox.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher; - - /** - * This class is used to create list boxes/select list. This one will generate - * a native control the way that the browser produces them by default. - * - * @class tinymce.ui.NativeListBox - * @extends tinymce.ui.ListBox - */ - tinymce.create('tinymce.ui.NativeListBox:tinymce.ui.ListBox', { - /** - * Constructs a new button control instance. - * - * @constructor - * @method NativeListBox - * @param {String} id Button control id for the button. - * @param {Object} s Optional name/value settings object. - */ - NativeListBox : function(id, s) { - this.parent(id, s); - this.classPrefix = 'mceNativeListBox'; - }, - - /** - * Sets the disabled state for the control. This will add CSS classes to the - * element that contains the control. So that it can be disabled visually. - * - * @method setDisabled - * @param {Boolean} s Boolean state if the control should be disabled or not. - */ - setDisabled : function(s) { - DOM.get(this.id).disabled = s; - this.setAriaProperty('disabled', s); - }, - - /** - * Returns true/false if the control is disabled or not. This is a method since you can then - * choose to check some class or some internal bool state in subclasses. - * - * @method isDisabled - * @return {Boolean} true/false if the control is disabled or not. - */ - isDisabled : function() { - return DOM.get(this.id).disabled; - }, - - /** - * Selects a item/option by value. This will both add a visual selection to the - * item and change the title of the control to the title of the option. - * - * @method select - * @param {String/function} va Value to look for inside the list box or a function selector. - */ - select : function(va) { - var t = this, fv, f; - - if (va == undefined) - return t.selectByIndex(-1); - - // Is string or number make function selector - if (va && va.call) - f = va; - else { - f = function(v) { - return v == va; - }; - } - - // Do we need to do something? - if (va != t.selectedValue) { - // Find item - each(t.items, function(o, i) { - if (f(o.value)) { - fv = 1; - t.selectByIndex(i); - return false; - } - }); - - if (!fv) - t.selectByIndex(-1); - } - }, - - /** - * Selects a item/option by index. This will both add a visual selection to the - * item and change the title of the control to the title of the option. - * - * @method selectByIndex - * @param {String} idx Index to select, pass -1 to select menu/title of select box. - */ - selectByIndex : function(idx) { - DOM.get(this.id).selectedIndex = idx + 1; - this.selectedValue = this.items[idx] ? this.items[idx].value : null; - }, - - /** - * Adds a option item to the list box. - * - * @method add - * @param {String} n Title for the new option. - * @param {String} v Value for the new option. - * @param {Object} o Optional object with settings like for example class. - */ - add : function(n, v, a) { - var o, t = this; - - a = a || {}; - a.value = v; - - if (t.isRendered()) - DOM.add(DOM.get(this.id), 'option', a, n); - - o = { - title : n, - value : v, - attribs : a - }; - - t.items.push(o); - t.onAdd.dispatch(t, o); - }, - - /** - * Executes the specified callback function for the menu item. In this case when the user clicks the menu item. - * - * @method getLength - */ - getLength : function() { - return this.items.length; - }, - - /** - * Renders the list box as a HTML string. This method is much faster than using the DOM and when - * creating a whole toolbar with buttons it does make a lot of difference. - * - * @method renderHTML - * @return {String} HTML for the list box control element. - */ - renderHTML : function() { - var h, t = this; - - h = DOM.createHTML('option', {value : ''}, '-- ' + t.settings.title + ' --'); - - each(t.items, function(it) { - h += DOM.createHTML('option', {value : it.value}, it.title); - }); - - h = DOM.createHTML('select', {id : t.id, 'class' : 'mceNativeListBox', 'aria-labelledby': t.id + '_aria'}, h); - h += DOM.createHTML('span', {id : t.id + '_aria', 'style': 'display: none'}, t.settings.title); - return h; - }, - - /** - * Post render handler. This function will be called after the UI has been - * rendered so that events can be added. - * - * @method postRender - */ - postRender : function() { - var t = this, ch, changeListenerAdded = true; - - t.rendered = true; - - function onChange(e) { - var v = t.items[e.target.selectedIndex - 1]; - - if (v && (v = v.value)) { - t.onChange.dispatch(t, v); - - if (t.settings.onselect) - t.settings.onselect(v); - } - }; - - Event.add(t.id, 'change', onChange); - - // Accessibility keyhandler - Event.add(t.id, 'keydown', function(e) { - var bf; - - Event.remove(t.id, 'change', ch); - changeListenerAdded = false; - - bf = Event.add(t.id, 'blur', function() { - if (changeListenerAdded) return; - changeListenerAdded = true; - Event.add(t.id, 'change', onChange); - Event.remove(t.id, 'blur', bf); - }); - - //prevent default left and right keys on chrome - so that the keyboard navigation is used. - if (tinymce.isWebKit && (e.keyCode==37 ||e.keyCode==39)) { - return Event.prevent(e); - } - - if (e.keyCode == 13 || e.keyCode == 32) { - onChange(e); - return Event.cancel(e); - } - }); - - t.onPostRender.dispatch(t, DOM.get(t.id)); - } - }); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/Separator.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/Separator.js deleted file mode 100644 index f254761d02ef..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/Separator.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Separator.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -/** - * This class is used to create vertical separator between other controls. - * - * @class tinymce.ui.Separator - * @extends tinymce.ui.Control - */ -tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { - /** - * Separator constructor. - * - * @constructor - * @method Separator - * @param {String} id Control id to use for the Separator. - * @param {Object} s Optional name/value settings object. - */ - Separator : function(id, s) { - this.parent(id, s); - this.classPrefix = 'mceSeparator'; - this.setDisabled(true); - }, - - /** - * Renders the separator as a HTML string. This method is much faster than using the DOM and when - * creating a whole toolbar with buttons it does make a lot of difference. - * - * @method renderHTML - * @return {String} HTML for the separator control element. - */ - renderHTML : function() { - return tinymce.DOM.createHTML('span', {'class' : this.classPrefix, role : 'separator', 'aria-orientation' : 'vertical', tabindex : '-1'}); - } -}); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/SplitButton.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/SplitButton.js deleted file mode 100644 index 5af3808d2bca..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/SplitButton.js +++ /dev/null @@ -1,154 +0,0 @@ -/** - * SplitButton.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each; - - /** - * This class is used to create a split button. A button with a menu attached to it. - * - * @class tinymce.ui.SplitButton - * @extends tinymce.ui.Button - * @example - * // Creates a new plugin class and a custom split button - * tinymce.create('tinymce.plugins.ExamplePlugin', { - * createControl: function(n, cm) { - * switch (n) { - * case 'mysplitbutton': - * var c = cm.createSplitButton('mysplitbutton', { - * title : 'My split button', - * image : 'some.gif', - * onclick : function() { - * alert('Button was clicked.'); - * } - * }); - * - * c.onRenderMenu.add(function(c, m) { - * m.add({title : 'Some title', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - * - * m.add({title : 'Some item 1', onclick : function() { - * alert('Some item 1 was clicked.'); - * }}); - * - * m.add({title : 'Some item 2', onclick : function() { - * alert('Some item 2 was clicked.'); - * }}); - * }); - * - * // Return the new splitbutton instance - * return c; - * } - * - * return null; - * } - * }); - */ - tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton', { - /** - * Constructs a new split button control instance. - * - * @constructor - * @method SplitButton - * @param {String} id Control id for the split button. - * @param {Object} s Optional name/value settings object. - * @param {Editor} ed Optional the editor instance this button is for. - */ - SplitButton : function(id, s, ed) { - this.parent(id, s, ed); - this.classPrefix = 'mceSplitButton'; - }, - - /** - * Renders the split button as a HTML string. This method is much faster than using the DOM and when - * creating a whole toolbar with buttons it does make a lot of difference. - * - * @method renderHTML - * @return {String} HTML for the split button control element. - */ - renderHTML : function() { - var h, t = this, s = t.settings, h1; - - h = '<tbody><tr>'; - - if (s.image) - h1 = DOM.createHTML('img ', {src : s.image, role: 'presentation', 'class' : 'mceAction ' + s['class']}); - else - h1 = DOM.createHTML('span', {'class' : 'mceAction ' + s['class']}, ''); - - h1 += DOM.createHTML('span', {'class': 'mceVoiceLabel mceIconOnly', id: t.id + '_voice', style: 'display:none;'}, s.title); - h += '<td >' + DOM.createHTML('a', {role: 'button', id : t.id + '_action', tabindex: '-1', href : 'javascript:;', 'class' : 'mceAction ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>'; - - h1 = DOM.createHTML('span', {'class' : 'mceOpen ' + s['class']}, '<span style="display:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span>'); - h += '<td >' + DOM.createHTML('a', {role: 'button', id : t.id + '_open', tabindex: '-1', href : 'javascript:;', 'class' : 'mceOpen ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>'; - - h += '</tr></tbody>'; - h = DOM.createHTML('table', { role: 'presentation', 'class' : 'mceSplitButton mceSplitButtonEnabled ' + s['class'], cellpadding : '0', cellspacing : '0', title : s.title}, h); - return DOM.createHTML('div', {id : t.id, role: 'button', tabindex: '0', 'aria-labelledby': t.id + '_voice', 'aria-haspopup': 'true'}, h); - }, - - /** - * Post render handler. This function will be called after the UI has been - * rendered so that events can be added. - * - * @method postRender - */ - postRender : function() { - var t = this, s = t.settings, activate; - - if (s.onclick) { - activate = function(evt) { - if (!t.isDisabled()) { - s.onclick(t.value); - Event.cancel(evt); - } - }; - Event.add(t.id + '_action', 'click', activate); - Event.add(t.id, ['click', 'keydown'], function(evt) { - var DOM_VK_SPACE = 32, DOM_VK_ENTER = 14, DOM_VK_RETURN = 13, DOM_VK_UP = 38, DOM_VK_DOWN = 40; - if ((evt.keyCode === 32 || evt.keyCode === 13 || evt.keyCode === 14) && !evt.altKey && !evt.ctrlKey && !evt.metaKey) { - activate(); - Event.cancel(evt); - } else if (evt.type === 'click' || evt.keyCode === DOM_VK_DOWN) { - t.showMenu(); - Event.cancel(evt); - } - }); - } - - Event.add(t.id + '_open', 'click', function (evt) { - t.showMenu(); - Event.cancel(evt); - }); - Event.add([t.id, t.id + '_open'], 'focus', function() {t._focused = 1;}); - Event.add([t.id, t.id + '_open'], 'blur', function() {t._focused = 0;}); - - // Old IE doesn't have hover on all elements - if (tinymce.isIE6 || !DOM.boxModel) { - Event.add(t.id, 'mouseover', function() { - if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled')) - DOM.addClass(t.id, 'mceSplitButtonHover'); - }); - - Event.add(t.id, 'mouseout', function() { - if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled')) - DOM.removeClass(t.id, 'mceSplitButtonHover'); - }); - } - }, - - destroy : function() { - this.parent(); - - Event.clear(this.id + '_action'); - Event.clear(this.id + '_open'); - Event.clear(this.id); - } - }); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/Toolbar.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/Toolbar.js deleted file mode 100644 index a78e589f3500..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/Toolbar.js +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Toolbar.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { -// Shorten class names -var dom = tinymce.DOM, each = tinymce.each; -/** - * This class is used to create toolbars a toolbar is a container for other controls like buttons etc. - * - * @class tinymce.ui.Toolbar - * @extends tinymce.ui.Container - */ -tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { - /** - * Renders the toolbar as a HTML string. This method is much faster than using the DOM and when - * creating a whole toolbar with buttons it does make a lot of difference. - * - * @method renderHTML - * @return {String} HTML for the toolbar control. - */ - renderHTML : function() { - var t = this, h = '', c, co, s = t.settings, i, pr, nx, cl; - - cl = t.controls; - for (i=0; i<cl.length; i++) { - // Get current control, prev control, next control and if the control is a list box or not - co = cl[i]; - pr = cl[i - 1]; - nx = cl[i + 1]; - - // Add toolbar start - if (i === 0) { - c = 'mceToolbarStart'; - - if (co.Button) - c += ' mceToolbarStartButton'; - else if (co.SplitButton) - c += ' mceToolbarStartSplitButton'; - else if (co.ListBox) - c += ' mceToolbarStartListBox'; - - h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '<!-- IE -->')); - } - - // Add toolbar end before list box and after the previous button - // This is to fix the o2k7 editor skins - if (pr && co.ListBox) { - if (pr.Button || pr.SplitButton) - h += dom.createHTML('td', {'class' : 'mceToolbarEnd'}, dom.createHTML('span', null, '<!-- IE -->')); - } - - // Render control HTML - - // IE 8 quick fix, needed to propertly generate a hit area for anchors - if (dom.stdMode) - h += '<td style="position: relative">' + co.renderHTML() + '</td>'; - else - h += '<td>' + co.renderHTML() + '</td>'; - - // Add toolbar start after list box and before the next button - // This is to fix the o2k7 editor skins - if (nx && co.ListBox) { - if (nx.Button || nx.SplitButton) - h += dom.createHTML('td', {'class' : 'mceToolbarStart'}, dom.createHTML('span', null, '<!-- IE -->')); - } - } - - c = 'mceToolbarEnd'; - - if (co.Button) - c += ' mceToolbarEndButton'; - else if (co.SplitButton) - c += ' mceToolbarEndSplitButton'; - else if (co.ListBox) - c += ' mceToolbarEndListBox'; - - h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '<!-- IE -->')); - - return dom.createHTML('table', {id : t.id, 'class' : 'mceToolbar' + (s['class'] ? ' ' + s['class'] : ''), cellpadding : '0', cellspacing : '0', align : t.settings.align || '', role: 'presentation', tabindex: '-1'}, '<tbody><tr>' + h + '</tr></tbody>'); - } -}); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/ToolbarGroup.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/ToolbarGroup.js deleted file mode 100644 index 3bc746583802..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ui/ToolbarGroup.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * ToolbarGroup.js - * - * Copyright 2010, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { -// Shorten class names -var dom = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event; -/** - * This class is used to group a set of toolbars together and control the keyboard navigation and focus. - * - * @class tinymce.ui.ToolbarGroup - * @extends tinymce.ui.Container - */ -tinymce.create('tinymce.ui.ToolbarGroup:tinymce.ui.Container', { - /** - * Renders the toolbar group as a HTML string. - * - * @method renderHTML - * @return {String} HTML for the toolbar control. - */ - renderHTML : function() { - var t = this, h = [], controls = t.controls, each = tinymce.each, settings = t.settings; - - h.push('<div id="' + t.id + '" role="group" aria-labelledby="' + t.id + '_voice">'); - //TODO: ACC test this out - adding a role = application for getting the landmarks working well. - h.push("<span role='application'>"); - h.push('<span id="' + t.id + '_voice" class="mceVoiceLabel" style="display:none;">' + dom.encode(settings.name) + '</span>'); - each(controls, function(toolbar) { - h.push(toolbar.renderHTML()); - }); - h.push("</span>"); - h.push('</div>'); - - return h.join(''); - }, - - focus : function() { - var t = this; - dom.get(t.id).focus(); - }, - - postRender : function() { - var t = this, items = []; - - each(t.controls, function(toolbar) { - each (toolbar.controls, function(control) { - if (control.id) { - items.push(control); - } - }); - }); - - t.keyNav = new tinymce.ui.KeyboardNavigation({ - root: t.id, - items: items, - onCancel: function() { - //Move focus if webkit so that navigation back will read the item. - if (tinymce.isWebKit) { - dom.get(t.editor.id+"_ifr").focus(); - } - t.editor.focus(); - }, - excludeFromTabOrder: !t.settings.tab_focus_toolbar - }); - }, - - destroy : function() { - var self = this; - - self.parent(); - self.keyNav.destroy(); - Event.clear(self.id); - } -}); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/Cookie.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/Cookie.js deleted file mode 100644 index 8829de9aa5f1..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/Cookie.js +++ /dev/null @@ -1,138 +0,0 @@ -/** - * Cookie.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var each = tinymce.each; - - /** - * This class contains simple cookie manangement functions. - * - * @class tinymce.util.Cookie - * @static - * @example - * // Gets a cookie from the browser - * console.debug(tinymce.util.Cookie.get('mycookie')); - * - * // Gets a hash table cookie from the browser and takes out the x parameter from it - * console.debug(tinymce.util.Cookie.getHash('mycookie').x); - * - * // Sets a hash table cookie to the browser - * tinymce.util.Cookie.setHash({x : '1', y : '2'}); - */ - tinymce.create('static tinymce.util.Cookie', { - /** - * Parses the specified query string into an name/value object. - * - * @method getHash - * @param {String} n String to parse into a n Hashtable object. - * @return {Object} Name/Value object with items parsed from querystring. - */ - getHash : function(n) { - var v = this.get(n), h; - - if (v) { - each(v.split('&'), function(v) { - v = v.split('='); - h = h || {}; - h[unescape(v[0])] = unescape(v[1]); - }); - } - - return h; - }, - - /** - * Sets a hashtable name/value object to a cookie. - * - * @method setHash - * @param {String} n Name of the cookie. - * @param {Object} v Hashtable object to set as cookie. - * @param {Date} e Optional date object for the expiration of the cookie. - * @param {String} p Optional path to restrict the cookie to. - * @param {String} d Optional domain to restrict the cookie to. - * @param {String} s Is the cookie secure or not. - */ - setHash : function(n, v, e, p, d, s) { - var o = ''; - - each(v, function(v, k) { - o += (!o ? '' : '&') + escape(k) + '=' + escape(v); - }); - - this.set(n, o, e, p, d, s); - }, - - /** - * Gets the raw data of a cookie by name. - * - * @method get - * @param {String} n Name of cookie to retrieve. - * @return {String} Cookie data string. - */ - get : function(n) { - var c = document.cookie, e, p = n + "=", b; - - // Strict mode - if (!c) - return; - - b = c.indexOf("; " + p); - - if (b == -1) { - b = c.indexOf(p); - - if (b != 0) - return null; - } else - b += 2; - - e = c.indexOf(";", b); - - if (e == -1) - e = c.length; - - return unescape(c.substring(b + p.length, e)); - }, - - /** - * Sets a raw cookie string. - * - * @method set - * @param {String} n Name of the cookie. - * @param {String} v Raw cookie data. - * @param {Date} e Optional date object for the expiration of the cookie. - * @param {String} p Optional path to restrict the cookie to. - * @param {String} d Optional domain to restrict the cookie to. - * @param {String} s Is the cookie secure or not. - */ - set : function(n, v, e, p, d, s) { - document.cookie = n + "=" + escape(v) + - ((e) ? "; expires=" + e.toUTCString() : "") + - ((p) ? "; path=" + escape(p) : "") + - ((d) ? "; domain=" + d : "") + - ((s) ? "; secure" : ""); - }, - - /** - * Removes/deletes a cookie by name. - * - * @method remove - * @param {String} n Cookie name to remove/delete. - * @param {Strong} p Optional path to remove the cookie from. - */ - remove : function(n, p) { - var d = new Date(); - - d.setTime(d.getTime() - 1000); - - this.set(n, '', d, p, d); - } - }); -})(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/Dispatcher.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/Dispatcher.js deleted file mode 100644 index 4ffdf5aaae7d..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/Dispatcher.js +++ /dev/null @@ -1,112 +0,0 @@ -/** - * Dispatcher.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -/** - * This class is used to dispatch event to observers/listeners. - * All internal events inside TinyMCE uses this class. - * - * @class tinymce.util.Dispatcher - * @example - * // Creates a custom event - * this.onSomething = new tinymce.util.Dispatcher(this); - * - * // Dispatch/fire the event - * this.onSomething.dispatch('some string'); - */ -tinymce.create('tinymce.util.Dispatcher', { - scope : null, - listeners : null, - - /** - * Constructs a new event dispatcher object. - * - * @constructor - * @method Dispatcher - * @param {Object} s Optional default execution scope for all observer functions. - */ - Dispatcher : function(s) { - this.scope = s || this; - this.listeners = []; - }, - - /** - * Add an observer function to be executed when a dispatch call is done. - * - * @method add - * @param {function} cb Callback function to execute when a dispatch event occurs. - * @param {Object} s Optional execution scope, defaults to the one specified in the class constructor. - * @return {function} Returns the same function as the one passed on. - */ - add : function(cb, s) { - this.listeners.push({cb : cb, scope : s || this.scope}); - - return cb; - }, - - /** - * Add an observer function to be executed to the top of the list of observers. - * - * @method addToTop - * @param {function} cb Callback function to execute when a dispatch event occurs. - * @param {Object} s Optional execution scope, defaults to the one specified in the class constructor. - * @return {function} Returns the same function as the one passed on. - */ - addToTop : function(cb, s) { - this.listeners.unshift({cb : cb, scope : s || this.scope}); - - return cb; - }, - - /** - * Removes an observer function. - * - * @method remove - * @param {function} cb Observer function to remove. - * @return {function} The same function that got passed in or null if it wasn't found. - */ - remove : function(cb) { - var l = this.listeners, o = null; - - tinymce.each(l, function(c, i) { - if (cb == c.cb) { - o = cb; - l.splice(i, 1); - return false; - } - }); - - return o; - }, - - /** - * Dispatches an event to all observers/listeners. - * - * @method dispatch - * @param {Object} .. Any number of arguments to dispatch. - * @return {Object} Last observer functions return value. - */ - dispatch : function() { - var s, a = arguments, i, li = this.listeners, c; - - // Needs to be a real loop since the listener count might change while looping - // And this is also more efficient - for (i = 0; i<li.length; i++) { - c = li[i]; - s = c.cb.apply(c.scope, a); - - if (s === false) - break; - } - - return s; - } - - /**#@-*/ -}); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/JSON.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/JSON.js deleted file mode 100644 index ccde4b8bc38e..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/JSON.js +++ /dev/null @@ -1,103 +0,0 @@ -/** - * JSON.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - function serialize(o, quote) { - var i, v, t; - - quote = quote || '"'; - - if (o == null) - return 'null'; - - t = typeof o; - - if (t == 'string') { - v = '\bb\tt\nn\ff\rr\""\'\'\\\\'; - - return quote + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g, function(a, b) { - // Make sure single quotes never get encoded inside double quotes for JSON compatibility - if (quote === '"' && a === "'") - return a; - - i = v.indexOf(b); - - if (i + 1) - return '\\' + v.charAt(i + 1); - - a = b.charCodeAt().toString(16); - - return '\\u' + '0000'.substring(a.length) + a; - }) + quote; - } - - if (t == 'object') { - if (o.hasOwnProperty && o instanceof Array) { - for (i=0, v = '['; i<o.length; i++) - v += (i > 0 ? ',' : '') + serialize(o[i], quote); - - return v + ']'; - } - - v = '{'; - - for (i in o) { - if (o.hasOwnProperty(i)) { - v += typeof o[i] != 'function' ? (v.length > 1 ? ',' + quote : quote) + i + quote +':' + serialize(o[i], quote) : ''; - } - } - - return v + '}'; - } - - return '' + o; - }; - - /** - * JSON parser and serializer class. - * - * @class tinymce.util.JSON - * @static - * @example - * // JSON parse a string into an object - * var obj = tinymce.util.JSON.parse(somestring); - * - * // JSON serialize a object into an string - * var str = tinymce.util.JSON.serialize(obj); - */ - tinymce.util.JSON = { - /** - * Serializes the specified object as a JSON string. - * - * @method serialize - * @param {Object} obj Object to serialize as a JSON string. - * @param {String} quote Optional quote string defaults to ". - * @return {string} JSON string serialized from input. - */ - serialize: serialize, - - /** - * Unserializes/parses the specified JSON string into a object. - * - * @method parse - * @param {string} s JSON String to parse into a JavaScript object. - * @return {Object} Object from input JSON string or undefined if it failed. - */ - parse: function(s) { - try { - return JSON.parse(s); - } catch (ex) { - // Ignore - } - } - - /**#@-*/ - }; -})(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/JSONP.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/JSONP.js deleted file mode 100644 index 8fa6d2d5208d..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/JSONP.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * JSONP.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -tinymce.create('static tinymce.util.JSONP', { - callbacks : {}, - count : 0, - - send : function(o) { - var t = this, dom = tinymce.DOM, count = o.count !== undefined ? o.count : t.count, id = 'tinymce_jsonp_' + count; - - t.callbacks[count] = function(json) { - dom.remove(id); - delete t.callbacks[count]; - - o.callback(json); - }; - - dom.add(dom.doc.body, 'script', {id : id , src : o.url, type : 'text/javascript'}); - t.count++; - } -}); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/JSONRequest.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/JSONRequest.js deleted file mode 100644 index 6af6e8246fa7..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/JSONRequest.js +++ /dev/null @@ -1,112 +0,0 @@ -/** - * JSONRequest.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var extend = tinymce.extend, JSON = tinymce.util.JSON, XHR = tinymce.util.XHR; - - /** - * This class enables you to use JSON-RPC to call backend methods. - * - * @class tinymce.util.JSONRequest - * @example - * var json = new tinymce.util.JSONRequest({ - * url : 'somebackend.php' - * }); - * - * // Send RPC call 1 - * json.send({ - * method : 'someMethod1', - * params : ['a', 'b'], - * success : function(result) { - * console.dir(result); - * } - * }); - * - * // Send RPC call 2 - * json.send({ - * method : 'someMethod2', - * params : ['a', 'b'], - * success : function(result) { - * console.dir(result); - * } - * }); - */ - tinymce.create('tinymce.util.JSONRequest', { - /** - * Constructs a new JSONRequest instance. - * - * @constructor - * @method JSONRequest - * @param {Object} s Optional settings object. - */ - JSONRequest : function(s) { - this.settings = extend({ - }, s); - this.count = 0; - }, - - /** - * Sends a JSON-RPC call. Consult the Wiki API documentation for more details on what you can pass to this function. - * - * @method send - * @param {Object} o Call object where there are three field id, method and params this object should also contain callbacks etc. - */ - send : function(o) { - var ecb = o.error, scb = o.success; - - o = extend(this.settings, o); - - o.success = function(c, x) { - c = JSON.parse(c); - - if (typeof(c) == 'undefined') { - c = { - error : 'JSON Parse error.' - }; - } - - if (c.error) - ecb.call(o.error_scope || o.scope, c.error, x); - else - scb.call(o.success_scope || o.scope, c.result); - }; - - o.error = function(ty, x) { - if (ecb) - ecb.call(o.error_scope || o.scope, ty, x); - }; - - o.data = JSON.serialize({ - id : o.id || 'c' + (this.count++), - method : o.method, - params : o.params - }); - - // JSON content type for Ruby on rails. Bug: #1883287 - o.content_type = 'application/json'; - - XHR.send(o); - }, - - 'static' : { - /** - * Simple helper function to send a JSON-RPC request without the need to initialize an object. - * Consult the Wiki API documentation for more details on what you can pass to this function. - * - * @method sendRPC - * @static - * @param {Object} o Call object where there are three field id, method and params this object should also contain callbacks etc. - */ - sendRPC : function(o) { - return new tinymce.util.JSONRequest().send(o); - } - } - }); -}()); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/Quirks.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/Quirks.js deleted file mode 100644 index f2e0d9c0b819..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/Quirks.js +++ /dev/null @@ -1,226 +0,0 @@ -(function(tinymce) { - var VK = tinymce.VK, BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE; - - /** - * Fixes a WebKit bug when deleting contents using backspace or delete key. - * WebKit will produce a span element if you delete across two block elements. - * - * Example: - * <h1>a</h1><p>|b</p> - * - * Will produce this on backspace: - * <h1>a<span class="Apple-style-span" style="<all runtime styles>">b</span></p> - * - * This fixes the backspace to produce: - * <h1>a|b</p> - * - * See bug: https://bugs.webkit.org/show_bug.cgi?id=45784 - * - * This code is a bit of a hack and hopefully it will be fixed soon in WebKit. - */ - function cleanupStylesWhenDeleting(ed) { - var dom = ed.dom, selection = ed.selection; - - ed.onKeyDown.add(function(ed, e) { - var rng, blockElm, node, clonedSpan, isDelete; - - isDelete = e.keyCode == DELETE; - if (isDelete || e.keyCode == BACKSPACE) { - e.preventDefault(); - rng = selection.getRng(); - - // Find root block - blockElm = dom.getParent(rng.startContainer, dom.isBlock); - - // On delete clone the root span of the next block element - if (isDelete) - blockElm = dom.getNext(blockElm, dom.isBlock); - - // Locate root span element and clone it since it would otherwise get merged by the "apple-style-span" on delete/backspace - if (blockElm) { - node = blockElm.firstChild; - - // Ignore empty text nodes - while (node && node.nodeType == 3 && node.nodeValue.length == 0) - node = node.nextSibling; - - if (node && node.nodeName === 'SPAN') { - clonedSpan = node.cloneNode(false); - } - } - - // Do the backspace/delete actiopn - ed.getDoc().execCommand(isDelete ? 'ForwardDelete' : 'Delete', false, null); - - // Find all odd apple-style-spans - blockElm = dom.getParent(rng.startContainer, dom.isBlock); - tinymce.each(dom.select('span.Apple-style-span,font.Apple-style-span', blockElm), function(span) { - var bm = selection.getBookmark(); - - if (clonedSpan) { - dom.replace(clonedSpan.cloneNode(false), span, true); - } else { - dom.remove(span, true); - } - - // Restore the selection - selection.moveToBookmark(bm); - }); - } - }); - }; - - /** - * WebKit and IE doesn't empty the editor if you select all contents and hit backspace or delete. This fix will check if the body is empty - * like a <h1></h1> or <p></p> and then forcefully remove all contents. - */ - function emptyEditorWhenDeleting(ed) { - ed.onKeyUp.add(function(ed, e) { - var keyCode = e.keyCode; - - if (keyCode == DELETE || keyCode == BACKSPACE) { - if (ed.dom.isEmpty(ed.getBody())) { - ed.setContent('', {format : 'raw'}); - ed.nodeChanged(); - return; - } - } - }); - }; - - /** - * WebKit on MacOS X has a weird issue where it some times fails to properly convert keypresses to input method keystrokes. - * So a fix where we just get the range and set the range back seems to do the trick. - */ - function inputMethodFocus(ed) { - ed.dom.bind(ed.getDoc(), 'focusin', function() { - ed.selection.setRng(ed.selection.getRng()); - }); - }; - - /** - * Backspacing in FireFox/IE from a paragraph into a horizontal rule results in a floating text node because the - * browser just deletes the paragraph - the browser fails to merge the text node with a horizontal rule so it is - * left there. TinyMCE sees a floating text node and wraps it in a paragraph on the key up event (ForceBlocks.js - * addRootBlocks), meaning the action does nothing. With this code, FireFox/IE matche the behaviour of other - * browsers - */ - function removeHrOnBackspace(ed) { - ed.onKeyDown.add(function(ed, e) { - if (e.keyCode === BACKSPACE) { - if (ed.selection.isCollapsed() && ed.selection.getRng(true).startOffset === 0) { - var node = ed.selection.getNode(); - var previousSibling = node.previousSibling; - if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "hr") { - ed.dom.remove(previousSibling); - tinymce.dom.Event.cancel(e); - } - } - } - }) - } - - /** - * Firefox 3.x has an issue where the body element won't get proper focus if you click out - * side it's rectangle. - */ - function focusBody(ed) { - // Fix for a focus bug in FF 3.x where the body element - // wouldn't get proper focus if the user clicked on the HTML element - if (!Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4 - ed.onMouseDown.add(function(ed, e) { - if (e.target.nodeName === "HTML") { - var body = ed.getBody(); - - // Blur the body it's focused but not correctly focused - body.blur(); - - // Refocus the body after a little while - setTimeout(function() { - body.focus(); - }, 0); - } - }); - } - }; - - /** - * WebKit has a bug where it isn't possible to select image, hr or anchor elements - * by clicking on them so we need to fake that. - */ - function selectControlElements(ed) { - ed.onClick.add(function(ed, e) { - e = e.target; - - if (/^(IMG|HR)$/.test(e.nodeName)) - ed.selection.select(e); - - if (e.nodeName == 'A' && ed.dom.hasClass(e, 'mceItemAnchor')) - ed.selection.select(e); - - ed.nodeChanged(); - }); - }; - - /** - * Fire a nodeChanged when the selection is changed on WebKit this fixes selection issues on iOS5. It only fires the nodeChange - * event every 50ms since it would other wise update the UI when you type and it hogs the CPU. - */ - function selectionChangeNodeChanged(ed) { - var lastRng, selectionTimer; - - ed.dom.bind(ed.getDoc(), 'selectionchange', function() { - if (selectionTimer) { - clearTimeout(selectionTimer); - selectionTimer = 0; - } - - selectionTimer = window.setTimeout(function() { - var rng = ed.selection.getRng(); - - // Compare the ranges to see if it was a real change or not - if (!lastRng || !tinymce.dom.RangeUtils.compareRanges(rng, lastRng)) { - ed.nodeChanged(); - lastRng = rng; - } - }, 50); - }); - } - - /** - * Screen readers on IE needs to have the role application set on the body. - */ - function ensureBodyHasRoleApplication(ed) { - document.body.setAttribute("role", "application"); - } - - tinymce.create('tinymce.util.Quirks', { - Quirks: function(ed) { - // WebKit - if (tinymce.isWebKit) { - cleanupStylesWhenDeleting(ed); - emptyEditorWhenDeleting(ed); - inputMethodFocus(ed); - selectControlElements(ed); - - // iOS - if (tinymce.isIDevice) { - selectionChangeNodeChanged(ed); - } - } - - // IE - if (tinymce.isIE) { - removeHrOnBackspace(ed); - emptyEditorWhenDeleting(ed); - ensureBodyHasRoleApplication(ed); - } - - // Gecko - if (tinymce.isGecko) { - removeHrOnBackspace(ed); - focusBody(ed); - } - } - }); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/URI.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/URI.js deleted file mode 100644 index e0486d9d97f2..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/URI.js +++ /dev/null @@ -1,312 +0,0 @@ -/** - * URI.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var each = tinymce.each; - - /** - * This class handles parsing, modification and serialization of URI/URL strings. - * @class tinymce.util.URI - */ - tinymce.create('tinymce.util.URI', { - /** - * Constucts a new URI instance. - * - * @constructor - * @method URI - * @param {String} u URI string to parse. - * @param {Object} s Optional settings object. - */ - URI : function(u, s) { - var t = this, o, a, b, base_url; - - // Trim whitespace - u = tinymce.trim(u); - - // Default settings - s = t.settings = s || {}; - - // Strange app protocol that isn't http/https or local anchor - // For example: mailto,skype,tel etc. - if (/^([\w\-]+):([^\/]{2})/i.test(u) || /^\s*#/.test(u)) { - t.source = u; - return; - } - - // Absolute path with no host, fake host and protocol - if (u.indexOf('/') === 0 && u.indexOf('//') !== 0) - u = (s.base_uri ? s.base_uri.protocol || 'http' : 'http') + '://mce_host' + u; - - // Relative path http:// or protocol relative //path - if (!/^[\w-]*:?\/\//.test(u)) { - base_url = s.base_uri ? s.base_uri.path : new tinymce.util.URI(location.href).directory; - u = ((s.base_uri && s.base_uri.protocol) || 'http') + '://mce_host' + t.toAbsPath(base_url, u); - } - - // Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri) - u = u.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something - u = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(u); - each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], function(v, i) { - var s = u[i]; - - // Zope 3 workaround, they use @@something - if (s) - s = s.replace(/\(mce_at\)/g, '@@'); - - t[v] = s; - }); - - if (b = s.base_uri) { - if (!t.protocol) - t.protocol = b.protocol; - - if (!t.userInfo) - t.userInfo = b.userInfo; - - if (!t.port && t.host == 'mce_host') - t.port = b.port; - - if (!t.host || t.host == 'mce_host') - t.host = b.host; - - t.source = ''; - } - - //t.path = t.path || '/'; - }, - - /** - * Sets the internal path part of the URI. - * - * @method setPath - * @param {string} p Path string to set. - */ - setPath : function(p) { - var t = this; - - p = /^(.*?)\/?(\w+)?$/.exec(p); - - // Update path parts - t.path = p[0]; - t.directory = p[1]; - t.file = p[2]; - - // Rebuild source - t.source = ''; - t.getURI(); - }, - - /** - * Converts the specified URI into a relative URI based on the current URI instance location. - * - * @method toRelative - * @param {String} u URI to convert into a relative path/URI. - * @return {String} Relative URI from the point specified in the current URI instance. - * @example - * // Converts an absolute URL to an relative URL url will be somedir/somefile.htm - * var url = new tinymce.util.URI('http://www.site.com/dir/').toRelative('http://www.site.com/dir/somedir/somefile.htm'); - */ - toRelative : function(u) { - var t = this, o; - - if (u === "./") - return u; - - u = new tinymce.util.URI(u, {base_uri : t}); - - // Not on same domain/port or protocol - if ((u.host != 'mce_host' && t.host != u.host && u.host) || t.port != u.port || t.protocol != u.protocol) - return u.getURI(); - - o = t.toRelPath(t.path, u.path); - - // Add query - if (u.query) - o += '?' + u.query; - - // Add anchor - if (u.anchor) - o += '#' + u.anchor; - - return o; - }, - - /** - * Converts the specified URI into a absolute URI based on the current URI instance location. - * - * @method toAbsolute - * @param {String} u URI to convert into a relative path/URI. - * @param {Boolean} nh No host and protocol prefix. - * @return {String} Absolute URI from the point specified in the current URI instance. - * @example - * // Converts an relative URL to an absolute URL url will be http://www.site.com/dir/somedir/somefile.htm - * var url = new tinymce.util.URI('http://www.site.com/dir/').toAbsolute('somedir/somefile.htm'); - */ - toAbsolute : function(u, nh) { - var u = new tinymce.util.URI(u, {base_uri : this}); - - return u.getURI(this.host == u.host && this.protocol == u.protocol ? nh : 0); - }, - - /** - * Converts a absolute path into a relative path. - * - * @method toRelPath - * @param {String} base Base point to convert the path from. - * @param {String} path Absolute path to convert into a relative path. - */ - toRelPath : function(base, path) { - var items, bp = 0, out = '', i, l; - - // Split the paths - base = base.substring(0, base.lastIndexOf('/')); - base = base.split('/'); - items = path.split('/'); - - if (base.length >= items.length) { - for (i = 0, l = base.length; i < l; i++) { - if (i >= items.length || base[i] != items[i]) { - bp = i + 1; - break; - } - } - } - - if (base.length < items.length) { - for (i = 0, l = items.length; i < l; i++) { - if (i >= base.length || base[i] != items[i]) { - bp = i + 1; - break; - } - } - } - - if (bp == 1) - return path; - - for (i = 0, l = base.length - (bp - 1); i < l; i++) - out += "../"; - - for (i = bp - 1, l = items.length; i < l; i++) { - if (i != bp - 1) - out += "/" + items[i]; - else - out += items[i]; - } - - return out; - }, - - /** - * Converts a relative path into a absolute path. - * - * @method toAbsPath - * @param {String} base Base point to convert the path from. - * @param {String} path Relative path to convert into an absolute path. - */ - toAbsPath : function(base, path) { - var i, nb = 0, o = [], tr, outPath; - - // Split paths - tr = /\/$/.test(path) ? '/' : ''; - base = base.split('/'); - path = path.split('/'); - - // Remove empty chunks - each(base, function(k) { - if (k) - o.push(k); - }); - - base = o; - - // Merge relURLParts chunks - for (i = path.length - 1, o = []; i >= 0; i--) { - // Ignore empty or . - if (path[i].length == 0 || path[i] == ".") - continue; - - // Is parent - if (path[i] == '..') { - nb++; - continue; - } - - // Move up - if (nb > 0) { - nb--; - continue; - } - - o.push(path[i]); - } - - i = base.length - nb; - - // If /a/b/c or / - if (i <= 0) - outPath = o.reverse().join('/'); - else - outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/'); - - // Add front / if it's needed - if (outPath.indexOf('/') !== 0) - outPath = '/' + outPath; - - // Add traling / if it's needed - if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) - outPath += tr; - - return outPath; - }, - - /** - * Returns the full URI of the internal structure. - * - * @method getURI - * @param {Boolean} nh Optional no host and protocol part. Defaults to false. - */ - getURI : function(nh) { - var s, t = this; - - // Rebuild source - if (!t.source || nh) { - s = ''; - - if (!nh) { - if (t.protocol) - s += t.protocol + '://'; - - if (t.userInfo) - s += t.userInfo + '@'; - - if (t.host) - s += t.host; - - if (t.port) - s += ':' + t.port; - } - - if (t.path) - s += t.path; - - if (t.query) - s += '?' + t.query; - - if (t.anchor) - s += '#' + t.anchor; - - t.source = s; - } - - return t.source; - } - }); -})(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/VK.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/VK.js deleted file mode 100644 index 08bc8fc29e50..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/VK.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This file exposes a set of the common KeyCodes for use. Please grow it as needed. - */ - -(function(tinymce){ - tinymce.VK = { - DELETE: 46, - BACKSPACE: 8, - ENTER: 13, - TAB: 9, - SPACEBAR: 32, - UP: 38, - DOWN: 40 - } -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/XHR.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/XHR.js deleted file mode 100644 index 779c3d06161b..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/util/XHR.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * XHR.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -/** - * This class enables you to send XMLHTTPRequests cross browser. - * @class tinymce.util.XHR - * @static - * @example - * // Sends a low level Ajax request - * tinymce.util.XHR.send({ - * url : 'someurl', - * success : function(text) { - * console.debug(text); - * } - * }); - */ -tinymce.create('static tinymce.util.XHR', { - /** - * Sends a XMLHTTPRequest. - * Consult the Wiki for details on what settings this method takes. - * - * @method send - * @param {Object} o Object will target URL, callbacks and other info needed to make the request. - */ - send : function(o) { - var x, t, w = window, c = 0; - - // Default settings - o.scope = o.scope || this; - o.success_scope = o.success_scope || o.scope; - o.error_scope = o.error_scope || o.scope; - o.async = o.async === false ? false : true; - o.data = o.data || ''; - - function get(s) { - x = 0; - - try { - x = new ActiveXObject(s); - } catch (ex) { - } - - return x; - }; - - x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Microsoft.XMLHTTP') || get('Msxml2.XMLHTTP'); - - if (x) { - if (x.overrideMimeType) - x.overrideMimeType(o.content_type); - - x.open(o.type || (o.data ? 'POST' : 'GET'), o.url, o.async); - - if (o.content_type) - x.setRequestHeader('Content-Type', o.content_type); - - x.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - - x.send(o.data); - - function ready() { - if (!o.async || x.readyState == 4 || c++ > 10000) { - if (o.success && c < 10000 && x.status == 200) - o.success.call(o.success_scope, '' + x.responseText, x, o); - else if (o.error) - o.error.call(o.error_scope, c > 10000 ? 'TIMED_OUT' : 'GENERAL', x, o); - - x = null; - } else - w.setTimeout(ready, 10); - }; - - // Syncronous request - if (!o.async) - return ready(); - - // Wait for response, onReadyStateChange can not be used since it leaks memory in IE - t = w.setTimeout(ready, 10); - } - } -}); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/xml/Parser.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/xml/Parser.js deleted file mode 100644 index e29965513aee..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/xml/Parser.js +++ /dev/null @@ -1,129 +0,0 @@ -/** - * Parser.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - /** - * XML Parser class. This class is only available for the dev version of TinyMCE. - */ - tinymce.create('tinymce.xml.Parser', { - /** - * Constucts a new XML parser instance. - * - * @param {Object} Optional settings object. - */ - Parser : function(s) { - this.settings = tinymce.extend({ - async : true - }, s); - }, - - /** - * Parses the specified document and executed the callback ones it's parsed. - * - * @param {String} u URL to XML file to parse. - * @param {function} cb Optional callback to execute ones the XML file is loaded. - * @param {Object} s Optional scope for the callback execution. - */ - load : function(u, cb, s) { - var doc, t, w = window, c = 0; - - s = s || this; - - // Explorer, use XMLDOM since it can be used on local fs - if (window.ActiveXObject) { - doc = new ActiveXObject("Microsoft.XMLDOM"); - doc.async = this.settings.async; - - // Wait for response - if (doc.async) { - function check() { - if (doc.readyState == 4 || c++ > 10000) - return cb.call(s, doc); - - w.setTimeout(check, 10); - }; - - t = w.setTimeout(check, 10); - } - - doc.load(u); - - if (!doc.async) - cb.call(s, doc); - - return; - } - - // W3C using XMLHttpRequest - if (window.XMLHttpRequest) { - try { - doc = new window.XMLHttpRequest(); - doc.open('GET', u, this.settings.async); - doc.async = this.settings.async; - - doc.onload = function() { - cb.call(s, doc.responseXML); - }; - - doc.send(''); - } catch (ex) { - cb.call(s, null, ex); - } - } - }, - - /** - * Parses the specified XML string. - * - * @param {String} xml XML String to parse. - * @return {Document} XML Document instance. - */ - loadXML : function(xml) { - var doc; - - // W3C - if (window.DOMParser) - return new DOMParser().parseFromString(xml, "text/xml"); - - // Explorer - if (window.ActiveXObject) { - doc = new ActiveXObject("Microsoft.XMLDOM"); - doc.async = "false"; - doc.loadXML(xml); - - return doc; - } - }, - - /** - * Returns all string contents of a element concated together. - * - * @param {XMLNode} el XML element to retrieve text from. - * @return {string} XML element text contents. - */ - getText : function(el) { - var o = ''; - - if (!el) - return ''; - - if (el.hasChildNodes()) { - el = el.firstChild; - - do { - if (el.nodeType == 3 || el.nodeType == 4) - o += el.nodeValue; - } while(el = el.nextSibling); - } - - return o; - } - }); -})(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/jquery.tinymce.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/jquery.tinymce.js deleted file mode 100644 index 8e61a3cddb89..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/jquery.tinymce.js +++ /dev/null @@ -1 +0,0 @@ -(function(b){var e,d,a=[],c=window;b.fn.tinymce=function(j){var p=this,g,k,h,m,i,l="",n="";if(!p.length){return p}if(!j){return tinyMCE.get(p[0].id)}p.css("visibility","hidden");function o(){var r=[],q=0;if(f){f();f=null}p.each(function(t,u){var s,w=u.id,v=j.oninit;if(!w){u.id=w=tinymce.DOM.uniqueId()}s=new tinymce.Editor(w,j);r.push(s);s.onInit.add(function(){var x,y=v;p.css("visibility","");if(v){if(++q==r.length){if(tinymce.is(y,"string")){x=(y.indexOf(".")===-1)?null:tinymce.resolve(y.replace(/\.\w+$/,""));y=tinymce.resolve(y)}y.apply(x||tinymce,r)}}})});b.each(r,function(t,s){s.render()})}if(!c.tinymce&&!d&&(g=j.script_url)){d=1;h=g.substring(0,g.lastIndexOf("/"));if(/_(src|dev)\.js/g.test(g)){n="_src"}m=g.lastIndexOf("?");if(m!=-1){l=g.substring(m+1)}c.tinyMCEPreInit=c.tinyMCEPreInit||{base:h,suffix:n,query:l};if(g.indexOf("gzip")!=-1){i=j.language||"en";g=g+(/\?/.test(g)?"&":"?")+"js=true&core=true&suffix="+escape(n)+"&themes="+escape(j.theme)+"&plugins="+escape(j.plugins)+"&languages="+i;if(!c.tinyMCE_GZ){tinyMCE_GZ={start:function(){tinymce.suffix=n;function q(r){tinymce.ScriptLoader.markDone(tinyMCE.baseURI.toAbsolute(r))}q("langs/"+i+".js");q("themes/"+j.theme+"/editor_template"+n+".js");q("themes/"+j.theme+"/langs/"+i+".js");b.each(j.plugins.split(","),function(s,r){if(r){q("plugins/"+r+"/editor_plugin"+n+".js");q("plugins/"+r+"/langs/"+i+".js")}})},end:function(){}}}}b.ajax({type:"GET",url:g,dataType:"script",cache:true,success:function(){tinymce.dom.Event.domLoaded=1;d=2;if(j.script_loaded){j.script_loaded()}o();b.each(a,function(q,r){r()})}})}else{if(d===1){a.push(o)}else{o()}}return p};b.extend(b.expr[":"],{tinymce:function(g){return g.id&&!!tinyMCE.get(g.id)}});function f(){function i(l){if(l==="remove"){this.each(function(n,o){var m=h(o);if(m){m.remove()}})}this.find("span.mceEditor,div.mceEditor").each(function(n,o){var m=tinyMCE.get(o.id.replace(/_parent$/,""));if(m){m.remove()}})}function k(n){var m=this,l;if(n!==e){i.call(m);m.each(function(p,q){var o;if(o=tinyMCE.get(q.id)){o.setContent(n)}})}else{if(m.length>0){if(l=tinyMCE.get(m[0].id)){return l.getContent()}}}}function h(m){var l=null;(m)&&(m.id)&&(c.tinymce)&&(l=tinyMCE.get(m.id));return l}function g(l){return !!((l)&&(l.length)&&(c.tinymce)&&(l.is(":tinymce")))}var j={};b.each(["text","html","val"],function(n,l){var o=j[l]=b.fn[l],m=(l==="text");b.fn[l]=function(s){var p=this;if(!g(p)){return o.apply(p,arguments)}if(s!==e){k.call(p.filter(":tinymce"),s);o.apply(p.not(":tinymce"),arguments);return p}else{var r="";var q=arguments;(m?p:p.eq(0)).each(function(u,v){var t=h(v);r+=t?(m?t.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):t.getContent()):o.apply(b(v),q)});return r}}});b.each(["append","prepend"],function(n,m){var o=j[m]=b.fn[m],l=(m==="prepend");b.fn[m]=function(q){var p=this;if(!g(p)){return o.apply(p,arguments)}if(q!==e){p.filter(":tinymce").each(function(s,t){var r=h(t);r&&r.setContent(l?q+r.getContent():r.getContent()+q)});o.apply(p.not(":tinymce"),arguments);return p}}});b.each(["remove","replaceWith","replaceAll","empty"],function(m,l){var n=j[l]=b.fn[l];b.fn[l]=function(){i.call(this,l);return n.apply(this,arguments)}});j.attr=b.fn.attr;b.fn.attr=function(n,q,o){var m=this;if((!n)||(n!=="value")||(!g(m))){return j.attr.call(m,n,q,o)}if(q!==e){k.call(m.filter(":tinymce"),q);j.attr.call(m.not(":tinymce"),n,q,o);return m}else{var p=m[0],l=h(p);return l?l.getContent():j.attr.call(b(p),n,q,o)}}}})(jQuery); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/langs/en.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/langs/en.js deleted file mode 100644 index 6379b0d9584d..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/langs/en.js +++ /dev/null @@ -1 +0,0 @@ -tinyMCE.addI18n({en:{common:{"more_colors":"More Colors...","invalid_data":"Error: Invalid values entered, these are marked in red.","popup_blocked":"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.","clipboard_no_support":"Currently not supported by your browser, use keyboard shortcuts instead.","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","not_set":"-- Not Set --","class_name":"Class",browse:"Browse",close:"Close",cancel:"Cancel",update:"Update",insert:"Insert",apply:"Apply","edit_confirm":"Do you want to use the WYSIWYG mode for this textarea?","invalid_data_number":"{#field} must be a number","invalid_data_min":"{#field} must be a number greater than {#min}","invalid_data_size":"{#field} must be a number or percentage",value:"(value)"},contextmenu:{full:"Full",right:"Right",center:"Center",left:"Left",align:"Alignment"},insertdatetime:{"day_short":"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun","day_long":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday","months_short":"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec","months_long":"January,February,March,April,May,June,July,August,September,October,November,December","inserttime_desc":"Insert Time","insertdate_desc":"Insert Date","time_fmt":"%H:%M:%S","date_fmt":"%Y-%m-%d"},print:{"print_desc":"Print"},preview:{"preview_desc":"Preview"},directionality:{"rtl_desc":"Direction Right to Left","ltr_desc":"Direction Left to Right"},layer:{content:"New layer...","absolute_desc":"Toggle Absolute Positioning","backward_desc":"Move Backward","forward_desc":"Move Forward","insertlayer_desc":"Insert New Layer"},save:{"save_desc":"Save","cancel_desc":"Cancel All Changes"},nonbreaking:{"nonbreaking_desc":"Insert Non-Breaking Space Character"},iespell:{download:"ieSpell not detected. Do you want to install it now?","iespell_desc":"Check Spelling"},advhr:{"delta_height":"","delta_width":"","advhr_desc":"Insert Horizontal Line"},emotions:{"delta_height":"","delta_width":"","emotions_desc":"Emotions"},searchreplace:{"replace_desc":"Find/Replace","delta_width":"","delta_height":"","search_desc":"Find"},advimage:{"delta_width":"","image_desc":"Insert/Edit Image","delta_height":""},advlink:{"delta_height":"","delta_width":"","link_desc":"Insert/Edit Link"},xhtmlxtras:{"attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":"","attribs_desc":"Insert/Edit Attributes","ins_desc":"Insertion","del_desc":"Deletion","acronym_desc":"Acronym","abbr_desc":"Abbreviation","cite_desc":"Citation"},style:{"delta_height":"","delta_width":"",desc:"Edit CSS Style"},paste:{"plaintext_mode_stick":"Paste is now in plain text mode. Click again to toggle back to regular paste mode.","plaintext_mode":"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.","selectall_desc":"Select All","paste_word_desc":"Paste from Word","paste_text_desc":"Paste as Plain Text"},"paste_dlg":{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."},table:{"merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","cellprops_delta_width":"","rowprops_delta_height":"","rowprops_delta_width":"",cell:"Cell",col:"Column",row:"Row",del:"Delete Table","copy_row_desc":"Copy Table Row","cut_row_desc":"Cut Table Row","paste_row_after_desc":"Paste Table Row After","paste_row_before_desc":"Paste Table Row Before","props_desc":"Table Properties","cell_desc":"Table Cell Properties","row_desc":"Table Row Properties","merge_cells_desc":"Merge Table Cells","split_cells_desc":"Split Merged Table Cells","delete_col_desc":"Delete Column","col_after_desc":"Insert Column After","col_before_desc":"Insert Column Before","delete_row_desc":"Delete Row","row_after_desc":"Insert Row After","row_before_desc":"Insert Row Before",desc:"Insert/Edit Table"},autosave:{"warning_message":"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?","restore_content":"Restore auto-saved content.","unload_msg":"The changes you made will be lost if you navigate away from this page."},fullscreen:{desc:"Toggle Full Screen Mode"},media:{"delta_height":"","delta_width":"",edit:"Edit Embedded Media",desc:"Insert/Edit Embedded Media"},fullpage:{desc:"Document Properties","delta_width":"","delta_height":""},template:{desc:"Insert Predefined Template Content"},visualchars:{desc:"Show/Hide Visual Control Characters"},spellchecker:{desc:"Toggle Spell Checker",menu:"Spell Checker Settings","ignore_word":"Ignore Word","ignore_words":"Ignore All",langs:"Languages",wait:"Please wait...",sug:"Suggestions","no_sug":"No Suggestions","no_mpell":"No misspellings found.","learn_word":"Learn word"},pagebreak:{desc:"Insert Page Break for Printing"},advlist:{types:"Types",def:"Default","lower_alpha":"Lower Alpha","lower_greek":"Lower Greek","lower_roman":"Lower Roman","upper_alpha":"Upper Alpha","upper_roman":"Upper Roman",circle:"Circle",disc:"Disc",square:"Square"},colors:{"333300":"Dark olive","993300":"Burnt orange","000000":"Black","003300":"Dark green","003366":"Dark azure","000080":"Navy Blue","333399":"Indigo","333333":"Very dark gray","800000":"Maroon",FF6600:"Orange","808000":"Olive","008000":"Green","008080":"Teal","0000FF":"Blue","666699":"Grayish blue","808080":"Gray",FF0000:"Red",FF9900:"Amber","99CC00":"Yellow green","339966":"Sea green","33CCCC":"Turquoise","3366FF":"Royal blue","800080":"Purple","999999":"Medium gray",FF00FF:"Magenta",FFCC00:"Gold",FFFF00:"Yellow","00FF00":"Lime","00FFFF":"Aqua","00CCFF":"Sky blue","993366":"Brown",C0C0C0:"Silver",FF99CC:"Pink",FFCC99:"Peach",FFFF99:"Light yellow",CCFFCC:"Pale green",CCFFFF:"Pale cyan","99CCFF":"Light sky blue",CC99FF:"Plum",FFFFFF:"White"},aria:{"rich_text_area":"Rich Text Area"},wordcount:{words:"Words:"}}}); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/license.txt b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/license.txt deleted file mode 100644 index 1837b0acbe16..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/license.txt +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - <one line to give the library's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - <signature of Ty Coon>, 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advhr/css/advhr.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advhr/css/advhr.css deleted file mode 100644 index 3fe369cb0d05..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advhr/css/advhr.css +++ /dev/null @@ -1,5 +0,0 @@ -input.radio {border:1px none #000; background:transparent; vertical-align:middle;} -.panel_wrapper div.current {height:80px;} -#width {width:50px; vertical-align:middle;} -#width2 {width:50px; vertical-align:middle;} -#size {width:100px;} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advhr/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advhr/editor_plugin.js deleted file mode 100644 index 4d3b062deeaa..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advhr/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.AdvancedHRPlugin",{init:function(a,b){a.addCommand("mceAdvancedHr",function(){a.windowManager.open({file:b+"/rule.htm",width:250+parseInt(a.getLang("advhr.delta_width",0)),height:160+parseInt(a.getLang("advhr.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advhr",{title:"advhr.advhr_desc",cmd:"mceAdvancedHr"});a.onNodeChange.add(function(d,c,e){c.setActive("advhr",e.nodeName=="HR")});a.onClick.add(function(c,d){d=d.target;if(d.nodeName==="HR"){c.selection.select(d)}})},getInfo:function(){return{longname:"Advanced HR",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advhr",tinymce.plugins.AdvancedHRPlugin)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advhr/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advhr/editor_plugin_src.js deleted file mode 100644 index 5a4b7250bcc5..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advhr/editor_plugin_src.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.AdvancedHRPlugin', { - init : function(ed, url) { - // Register commands - ed.addCommand('mceAdvancedHr', function() { - ed.windowManager.open({ - file : url + '/rule.htm', - width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)), - height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - // Register buttons - ed.addButton('advhr', { - title : 'advhr.advhr_desc', - cmd : 'mceAdvancedHr' - }); - - ed.onNodeChange.add(function(ed, cm, n) { - cm.setActive('advhr', n.nodeName == 'HR'); - }); - - ed.onClick.add(function(ed, e) { - e = e.target; - - if (e.nodeName === 'HR') - ed.selection.select(e); - }); - }, - - getInfo : function() { - return { - longname : 'Advanced HR', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advhr/js/rule.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advhr/js/rule.js deleted file mode 100644 index a60c35fc3ce0..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advhr/js/rule.js +++ /dev/null @@ -1,43 +0,0 @@ -var AdvHRDialog = { - init : function(ed) { - var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w; - - w = dom.getAttrib(n, 'width'); - f.width.value = w ? parseInt(w) : (dom.getStyle('width') || ''); - f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || ''; - f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width'); - selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px'); - }, - - update : function() { - var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = ''; - - h = '<hr'; - - if (f.size.value) { - h += ' size="' + f.size.value + '"'; - st += ' height:' + f.size.value + 'px;'; - } - - if (f.width.value) { - h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"'; - st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';'; - } - - if (f.noshade.checked) { - h += ' noshade="noshade"'; - st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;'; - } - - if (ed.settings.inline_styles) - h += ' style="' + tinymce.trim(st) + '"'; - - h += ' />'; - - ed.execCommand("mceInsertContent", false, h); - tinyMCEPopup.close(); - } -}; - -tinyMCEPopup.requireLangPack(); -tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advhr/langs/en_dlg.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advhr/langs/en_dlg.js deleted file mode 100644 index 0c3bf15e6f4a..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advhr/langs/en_dlg.js +++ /dev/null @@ -1 +0,0 @@ -tinyMCE.addI18n('en.advhr_dlg',{size:"Height",noshade:"No Shadow",width:"Width",normal:"Normal",widthunits:"Units"}); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advhr/rule.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advhr/rule.htm deleted file mode 100644 index 11d365133612..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advhr/rule.htm +++ /dev/null @@ -1,58 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <title>{#advhr.advhr_desc} - - - - - - - -
- - -
-
- - - - - - - - - - - - - -
- - - -
-
-
- -
- - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/css/advimage.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/css/advimage.css deleted file mode 100644 index 228530f9ee8a..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/css/advimage.css +++ /dev/null @@ -1,13 +0,0 @@ -#src_list, #over_list, #out_list {width:280px;} -.mceActionPanel {margin-top:7px;} -.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;} -.checkbox {border:0;} -.panel_wrapper div.current {height:305px;} -#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;} -#align, #classlist {width:150px;} -#width, #height {vertical-align:middle; width:50px; text-align:center;} -#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;} -#class_list {width:180px;} -input {width: 280px;} -#constrain, #onmousemovecheck {width:auto;} -#id, #dir, #lang, #usemap, #longdesc {width:200px;} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/editor_plugin.js deleted file mode 100644 index d613a6139387..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/editor_plugin_src.js deleted file mode 100644 index 76df89a3a9b7..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/editor_plugin_src.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.AdvancedImagePlugin', { - init : function(ed, url) { - // Register commands - ed.addCommand('mceAdvImage', function() { - // Internal image object like a flash placeholder - if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1) - return; - - ed.windowManager.open({ - file : url + '/image.htm', - width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)), - height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - // Register buttons - ed.addButton('image', { - title : 'advimage.image_desc', - cmd : 'mceAdvImage' - }); - }, - - getInfo : function() { - return { - longname : 'Advanced image', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/image.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/image.htm deleted file mode 100644 index 835d3882c63c..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/image.htm +++ /dev/null @@ -1,235 +0,0 @@ - - - - {#advimage_dlg.dialog_title} - - - - - - - - - - -
- - -
-
-
- {#advimage_dlg.general} - - - - - - - - - - - - - - - - - - - -
- -
- {#advimage_dlg.preview} - -
-
- -
-
- {#advimage_dlg.tab_appearance} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- {#advimage_dlg.example_img} - Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam - nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum - edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam - erat volutpat. -
-
- - x - - px -
  - - - - -
-
-
-
- -
-
- {#advimage_dlg.swap_image} - - - - - - - - - - - - - - - - - - - - - -
- - - - -
 
- - - - -
 
-
- -
- {#advimage_dlg.misc} - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- - - - -
 
-
-
-
- -
- - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/img/sample.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/img/sample.gif deleted file mode 100644 index 2c0eb2cb891a..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/img/sample.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/js/image.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/js/image.js deleted file mode 100644 index 821806409863..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/js/image.js +++ /dev/null @@ -1,463 +0,0 @@ -var ImageDialog = { - preInit : function() { - var url; - - tinyMCEPopup.requireLangPack(); - - if (url = tinyMCEPopup.getParam("external_image_list_url")) - document.write(''); - }, - - init : function(ed) { - var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList'); - - tinyMCEPopup.resizeToInnerSize(); - this.fillClassList('class_list'); - this.fillFileList('src_list', fl); - this.fillFileList('over_list', fl); - this.fillFileList('out_list', fl); - TinyMCE_EditableSelects.init(); - - if (n.nodeName == 'IMG') { - nl.src.value = dom.getAttrib(n, 'src'); - nl.width.value = dom.getAttrib(n, 'width'); - nl.height.value = dom.getAttrib(n, 'height'); - nl.alt.value = dom.getAttrib(n, 'alt'); - nl.title.value = dom.getAttrib(n, 'title'); - nl.vspace.value = this.getAttrib(n, 'vspace'); - nl.hspace.value = this.getAttrib(n, 'hspace'); - nl.border.value = this.getAttrib(n, 'border'); - selectByValue(f, 'align', this.getAttrib(n, 'align')); - selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true); - nl.style.value = dom.getAttrib(n, 'style'); - nl.id.value = dom.getAttrib(n, 'id'); - nl.dir.value = dom.getAttrib(n, 'dir'); - nl.lang.value = dom.getAttrib(n, 'lang'); - nl.usemap.value = dom.getAttrib(n, 'usemap'); - nl.longdesc.value = dom.getAttrib(n, 'longdesc'); - nl.insert.value = ed.getLang('update'); - - if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover'))) - nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); - - if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout'))) - nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); - - if (ed.settings.inline_styles) { - // Move attribs to styles - if (dom.getAttrib(n, 'align')) - this.updateStyle('align'); - - if (dom.getAttrib(n, 'hspace')) - this.updateStyle('hspace'); - - if (dom.getAttrib(n, 'border')) - this.updateStyle('border'); - - if (dom.getAttrib(n, 'vspace')) - this.updateStyle('vspace'); - } - } - - // Setup browse button - document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); - if (isVisible('srcbrowser')) - document.getElementById('src').style.width = '260px'; - - // Setup browse button - document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image'); - if (isVisible('overbrowser')) - document.getElementById('onmouseoversrc').style.width = '260px'; - - // Setup browse button - document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image'); - if (isVisible('outbrowser')) - document.getElementById('onmouseoutsrc').style.width = '260px'; - - // If option enabled default contrain proportions to checked - if (ed.getParam("advimage_constrain_proportions", true)) - f.constrain.checked = true; - - // Check swap image if valid data - if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value) - this.setSwapImage(true); - else - this.setSwapImage(false); - - this.changeAppearance(); - this.showPreviewImage(nl.src.value, 1); - }, - - insert : function(file, title) { - var ed = tinyMCEPopup.editor, t = this, f = document.forms[0]; - - if (f.src.value === '') { - if (ed.selection.getNode().nodeName == 'IMG') { - ed.dom.remove(ed.selection.getNode()); - ed.execCommand('mceRepaint'); - } - - tinyMCEPopup.close(); - return; - } - - if (tinyMCEPopup.getParam("accessibility_warnings", 1)) { - if (!f.alt.value) { - tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) { - if (s) - t.insertAndClose(); - }); - - return; - } - } - - t.insertAndClose(); - }, - - insertAndClose : function() { - var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el; - - tinyMCEPopup.restoreSelection(); - - // Fixes crash in Safari - if (tinymce.isWebKit) - ed.getWin().focus(); - - if (!ed.settings.inline_styles) { - args = { - vspace : nl.vspace.value, - hspace : nl.hspace.value, - border : nl.border.value, - align : getSelectValue(f, 'align') - }; - } else { - // Remove deprecated values - args = { - vspace : '', - hspace : '', - border : '', - align : '' - }; - } - - tinymce.extend(args, { - src : nl.src.value.replace(/ /g, '%20'), - width : nl.width.value, - height : nl.height.value, - alt : nl.alt.value, - title : nl.title.value, - 'class' : getSelectValue(f, 'class_list'), - style : nl.style.value, - id : nl.id.value, - dir : nl.dir.value, - lang : nl.lang.value, - usemap : nl.usemap.value, - longdesc : nl.longdesc.value - }); - - args.onmouseover = args.onmouseout = ''; - - if (f.onmousemovecheck.checked) { - if (nl.onmouseoversrc.value) - args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';"; - - if (nl.onmouseoutsrc.value) - args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';"; - } - - el = ed.selection.getNode(); - - if (el && el.nodeName == 'IMG') { - ed.dom.setAttribs(el, args); - } else { - tinymce.each(args, function(value, name) { - if (value === "") { - delete args[name]; - } - }); - - ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); - ed.undoManager.add(); - } - - tinyMCEPopup.editor.execCommand('mceRepaint'); - tinyMCEPopup.editor.focus(); - tinyMCEPopup.close(); - ed.onChange.dispatch(ed); - }, - - getAttrib : function(e, at) { - var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; - - if (ed.settings.inline_styles) { - switch (at) { - case 'align': - if (v = dom.getStyle(e, 'float')) - return v; - - if (v = dom.getStyle(e, 'vertical-align')) - return v; - - break; - - case 'hspace': - v = dom.getStyle(e, 'margin-left') - v2 = dom.getStyle(e, 'margin-right'); - - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'vspace': - v = dom.getStyle(e, 'margin-top') - v2 = dom.getStyle(e, 'margin-bottom'); - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'border': - v = 0; - - tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { - sv = dom.getStyle(e, 'border-' + sv + '-width'); - - // False or not the same as prev - if (!sv || (sv != v && v !== 0)) { - v = 0; - return false; - } - - if (sv) - v = sv; - }); - - if (v) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - } - } - - if (v = dom.getAttrib(e, at)) - return v; - - return ''; - }, - - setSwapImage : function(st) { - var f = document.forms[0]; - - f.onmousemovecheck.checked = st; - setBrowserDisabled('overbrowser', !st); - setBrowserDisabled('outbrowser', !st); - - if (f.over_list) - f.over_list.disabled = !st; - - if (f.out_list) - f.out_list.disabled = !st; - - f.onmouseoversrc.disabled = !st; - f.onmouseoutsrc.disabled = !st; - }, - - fillClassList : function(id) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { - cl = []; - - tinymce.each(v.split(';'), function(v) { - var p = v.split('='); - - cl.push({'title' : p[0], 'class' : p[1]}); - }); - } else - cl = tinyMCEPopup.editor.dom.getClasses(); - - if (cl.length > 0) { - lst.options.length = 0; - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); - - tinymce.each(cl, function(o) { - lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - fillFileList : function(id, l) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - l = typeof(l) === 'function' ? l() : window[l]; - lst.options.length = 0; - - if (l && l.length > 0) { - lst.options[lst.options.length] = new Option('', ''); - - tinymce.each(l, function(o) { - lst.options[lst.options.length] = new Option(o[0], o[1]); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - resetImageData : function() { - var f = document.forms[0]; - - f.elements.width.value = f.elements.height.value = ''; - }, - - updateImageData : function(img, st) { - var f = document.forms[0]; - - if (!st) { - f.elements.width.value = img.width; - f.elements.height.value = img.height; - } - - this.preloadImg = img; - }, - - changeAppearance : function() { - var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg'); - - if (img) { - if (ed.getParam('inline_styles')) { - ed.dom.setAttrib(img, 'style', f.style.value); - } else { - img.align = f.align.value; - img.border = f.border.value; - img.hspace = f.hspace.value; - img.vspace = f.vspace.value; - } - } - }, - - changeHeight : function() { - var f = document.forms[0], tp, t = this; - - if (!f.constrain.checked || !t.preloadImg) { - return; - } - - if (f.width.value == "" || f.height.value == "") - return; - - tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height; - f.height.value = tp.toFixed(0); - }, - - changeWidth : function() { - var f = document.forms[0], tp, t = this; - - if (!f.constrain.checked || !t.preloadImg) { - return; - } - - if (f.width.value == "" || f.height.value == "") - return; - - tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width; - f.width.value = tp.toFixed(0); - }, - - updateStyle : function(ty) { - var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); - - if (tinyMCEPopup.editor.settings.inline_styles) { - // Handle align - if (ty == 'align') { - dom.setStyle(img, 'float', ''); - dom.setStyle(img, 'vertical-align', ''); - - v = getSelectValue(f, 'align'); - if (v) { - if (v == 'left' || v == 'right') - dom.setStyle(img, 'float', v); - else - img.style.verticalAlign = v; - } - } - - // Handle border - if (ty == 'border') { - b = img.style.border ? img.style.border.split(' ') : []; - bStyle = dom.getStyle(img, 'border-style'); - bColor = dom.getStyle(img, 'border-color'); - - dom.setStyle(img, 'border', ''); - - v = f.border.value; - if (v || v == '0') { - if (v == '0') - img.style.border = isIE ? '0' : '0 none none'; - else { - if (b.length == 3 && b[isIE ? 2 : 1]) - bStyle = b[isIE ? 2 : 1]; - else if (!bStyle || bStyle == 'none') - bStyle = 'solid'; - if (b.length == 3 && b[isIE ? 0 : 2]) - bColor = b[isIE ? 0 : 2]; - else if (!bColor || bColor == 'none') - bColor = 'black'; - img.style.border = v + 'px ' + bStyle + ' ' + bColor; - } - } - } - - // Handle hspace - if (ty == 'hspace') { - dom.setStyle(img, 'marginLeft', ''); - dom.setStyle(img, 'marginRight', ''); - - v = f.hspace.value; - if (v) { - img.style.marginLeft = v + 'px'; - img.style.marginRight = v + 'px'; - } - } - - // Handle vspace - if (ty == 'vspace') { - dom.setStyle(img, 'marginTop', ''); - dom.setStyle(img, 'marginBottom', ''); - - v = f.vspace.value; - if (v) { - img.style.marginTop = v + 'px'; - img.style.marginBottom = v + 'px'; - } - } - - // Merge - dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img'); - } - }, - - changeMouseMove : function() { - }, - - showPreviewImage : function(u, st) { - if (!u) { - tinyMCEPopup.dom.setHTML('prev', ''); - return; - } - - if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true)) - this.resetImageData(); - - u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u); - - if (!st) - tinyMCEPopup.dom.setHTML('prev', ''); - else - tinyMCEPopup.dom.setHTML('prev', ''); - } -}; - -ImageDialog.preInit(); -tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/langs/en_dlg.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/langs/en_dlg.js deleted file mode 100644 index 5f122e2cd3bc..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/langs/en_dlg.js +++ /dev/null @@ -1 +0,0 @@ -tinyMCE.addI18n('en.advimage_dlg',{"image_list":"Image List","align_right":"Right","align_left":"Left","align_textbottom":"Text Bottom","align_texttop":"Text Top","align_bottom":"Bottom","align_middle":"Middle","align_top":"Top","align_baseline":"Baseline",align:"Alignment",hspace:"Horizontal Space",vspace:"Vertical Space",dimensions:"Dimensions",border:"Border",list:"Image List",alt:"Image Description",src:"Image URL","dialog_title":"Insert/Edit Image","missing_alt":"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.","example_img":"Appearance Preview Image",misc:"Miscellaneous",mouseout:"For Mouse Out",mouseover:"For Mouse Over","alt_image":"Alternative Image","swap_image":"Swap Image",map:"Image Map",id:"ID",rtl:"Right to Left",ltr:"Left to Right",classes:"Classes",style:"Style","long_desc":"Long Description Link",langcode:"Language Code",langdir:"Language Direction","constrain_proportions":"Constrain Proportions",preview:"Preview",title:"Title",general:"General","tab_advanced":"Advanced","tab_appearance":"Appearance","tab_general":"General",width:"Width",height:"Height"}); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlink/css/advlink.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlink/css/advlink.css deleted file mode 100644 index 66c65493541c..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlink/css/advlink.css +++ /dev/null @@ -1,8 +0,0 @@ -.mceLinkList, .mceAnchorList, #targetlist {width:280px;} -.mceActionPanel {margin-top:7px;} -.panel_wrapper div.current {height:320px;} -#classlist, #title, #href {width:280px;} -#popupurl, #popupname {width:200px;} -#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;} -#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;} -#events_panel input {width:200px;} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlink/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlink/editor_plugin.js deleted file mode 100644 index 983fe5a9ca49..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlink/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlink/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlink/editor_plugin_src.js deleted file mode 100644 index 32ea8f3db926..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlink/editor_plugin_src.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.AdvancedLinkPlugin', { - init : function(ed, url) { - this.editor = ed; - - // Register commands - ed.addCommand('mceAdvLink', function() { - var se = ed.selection; - - // No selection and not in link - if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A')) - return; - - ed.windowManager.open({ - file : url + '/link.htm', - width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)), - height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - // Register buttons - ed.addButton('link', { - title : 'advlink.link_desc', - cmd : 'mceAdvLink' - }); - - ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink'); - - ed.onNodeChange.add(function(ed, cm, n, co) { - cm.setDisabled('link', co && n.nodeName != 'A'); - cm.setActive('link', n.nodeName == 'A' && !n.name); - }); - }, - - getInfo : function() { - return { - longname : 'Advanced link', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlink/js/advlink.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlink/js/advlink.js deleted file mode 100644 index cd5cf414ffa0..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlink/js/advlink.js +++ /dev/null @@ -1,532 +0,0 @@ -/* Functions for the advlink plugin popup */ - -tinyMCEPopup.requireLangPack(); - -var templates = { - "window.open" : "window.open('${url}','${target}','${options}')" -}; - -function preinit() { - var url; - - if (url = tinyMCEPopup.getParam("external_link_list_url")) - document.write(''); -} - -function changeClass() { - var f = document.forms[0]; - - f.classes.value = getSelectValue(f, 'classlist'); -} - -function init() { - tinyMCEPopup.resizeToInnerSize(); - - var formObj = document.forms[0]; - var inst = tinyMCEPopup.editor; - var elm = inst.selection.getNode(); - var action = "insert"; - var html; - - document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink'); - document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink'); - document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target'); - - // Link list - html = getLinkListHTML('linklisthref','href'); - if (html == "") - document.getElementById("linklisthrefrow").style.display = 'none'; - else - document.getElementById("linklisthrefcontainer").innerHTML = html; - - // Anchor list - html = getAnchorListHTML('anchorlist','href'); - if (html == "") - document.getElementById("anchorlistrow").style.display = 'none'; - else - document.getElementById("anchorlistcontainer").innerHTML = html; - - // Resize some elements - if (isVisible('hrefbrowser')) - document.getElementById('href').style.width = '260px'; - - if (isVisible('popupurlbrowser')) - document.getElementById('popupurl').style.width = '180px'; - - elm = inst.dom.getParent(elm, "A"); - if (elm != null && elm.nodeName == "A") - action = "update"; - - formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); - - setPopupControlsDisabled(true); - - if (action == "update") { - var href = inst.dom.getAttrib(elm, 'href'); - var onclick = inst.dom.getAttrib(elm, 'onclick'); - - // Setup form data - setFormValue('href', href); - setFormValue('title', inst.dom.getAttrib(elm, 'title')); - setFormValue('id', inst.dom.getAttrib(elm, 'id')); - setFormValue('style', inst.dom.getAttrib(elm, "style")); - setFormValue('rel', inst.dom.getAttrib(elm, 'rel')); - setFormValue('rev', inst.dom.getAttrib(elm, 'rev')); - setFormValue('charset', inst.dom.getAttrib(elm, 'charset')); - setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang')); - setFormValue('dir', inst.dom.getAttrib(elm, 'dir')); - setFormValue('lang', inst.dom.getAttrib(elm, 'lang')); - setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); - setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); - setFormValue('type', inst.dom.getAttrib(elm, 'type')); - setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus')); - setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur')); - setFormValue('onclick', onclick); - setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick')); - setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown')); - setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup')); - setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover')); - setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove')); - setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout')); - setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress')); - setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown')); - setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup')); - setFormValue('target', inst.dom.getAttrib(elm, 'target')); - setFormValue('classes', inst.dom.getAttrib(elm, 'class')); - - // Parse onclick data - if (onclick != null && onclick.indexOf('window.open') != -1) - parseWindowOpen(onclick); - else - parseFunction(onclick); - - // Select by the values - selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir')); - selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel')); - selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev')); - selectByValue(formObj, 'linklisthref', href); - - if (href.charAt(0) == '#') - selectByValue(formObj, 'anchorlist', href); - - addClassesToList('classlist', 'advlink_styles'); - - selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true); - selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true); - } else - addClassesToList('classlist', 'advlink_styles'); -} - -function checkPrefix(n) { - if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email'))) - n.value = 'mailto:' + n.value; - - if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external'))) - n.value = 'http://' + n.value; -} - -function setFormValue(name, value) { - document.forms[0].elements[name].value = value; -} - -function parseWindowOpen(onclick) { - var formObj = document.forms[0]; - - // Preprocess center code - if (onclick.indexOf('return false;') != -1) { - formObj.popupreturn.checked = true; - onclick = onclick.replace('return false;', ''); - } else - formObj.popupreturn.checked = false; - - var onClickData = parseLink(onclick); - - if (onClickData != null) { - formObj.ispopup.checked = true; - setPopupControlsDisabled(false); - - var onClickWindowOptions = parseOptions(onClickData['options']); - var url = onClickData['url']; - - formObj.popupname.value = onClickData['target']; - formObj.popupurl.value = url; - formObj.popupwidth.value = getOption(onClickWindowOptions, 'width'); - formObj.popupheight.value = getOption(onClickWindowOptions, 'height'); - - formObj.popupleft.value = getOption(onClickWindowOptions, 'left'); - formObj.popuptop.value = getOption(onClickWindowOptions, 'top'); - - if (formObj.popupleft.value.indexOf('screen') != -1) - formObj.popupleft.value = "c"; - - if (formObj.popuptop.value.indexOf('screen') != -1) - formObj.popuptop.value = "c"; - - formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes"; - formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes"; - formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes"; - formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes"; - formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes"; - formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes"; - formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes"; - - buildOnClick(); - } -} - -function parseFunction(onclick) { - var formObj = document.forms[0]; - var onClickData = parseLink(onclick); - - // TODO: Add stuff here -} - -function getOption(opts, name) { - return typeof(opts[name]) == "undefined" ? "" : opts[name]; -} - -function setPopupControlsDisabled(state) { - var formObj = document.forms[0]; - - formObj.popupname.disabled = state; - formObj.popupurl.disabled = state; - formObj.popupwidth.disabled = state; - formObj.popupheight.disabled = state; - formObj.popupleft.disabled = state; - formObj.popuptop.disabled = state; - formObj.popuplocation.disabled = state; - formObj.popupscrollbars.disabled = state; - formObj.popupmenubar.disabled = state; - formObj.popupresizable.disabled = state; - formObj.popuptoolbar.disabled = state; - formObj.popupstatus.disabled = state; - formObj.popupreturn.disabled = state; - formObj.popupdependent.disabled = state; - - setBrowserDisabled('popupurlbrowser', state); -} - -function parseLink(link) { - link = link.replace(new RegExp(''', 'g'), "'"); - - var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1"); - - // Is function name a template function - var template = templates[fnName]; - if (template) { - // Build regexp - var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi")); - var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\("; - var replaceStr = ""; - for (var i=0; i'); - for (var i=0; i' + name + ''; - } - - if (html == "") - return ""; - - html = ''; - - return html; -} - -function insertAction() { - var inst = tinyMCEPopup.editor; - var elm, elementArray, i; - - elm = inst.selection.getNode(); - checkPrefix(document.forms[0].href); - - elm = inst.dom.getParent(elm, "A"); - - // Remove element if there is no href - if (!document.forms[0].href.value) { - i = inst.selection.getBookmark(); - inst.dom.remove(elm, 1); - inst.selection.moveToBookmark(i); - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); - return; - } - - // Create new anchor elements - if (elm == null) { - inst.getDoc().execCommand("unlink", false, null); - tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); - - elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); - for (i=0; i' + tinyMCELinkList[i][0] + ''; - - html += ''; - - return html; - - // tinyMCE.debug('-- image list start --', html, '-- image list end --'); -} - -function getTargetListHTML(elm_id, target_form_element) { - var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';'); - var html = ''; - - html += ''; - - return html; -} - -// While loading -preinit(); -tinyMCEPopup.onInit.add(init); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlink/langs/en_dlg.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlink/langs/en_dlg.js deleted file mode 100644 index 3169a5658067..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlink/langs/en_dlg.js +++ /dev/null @@ -1 +0,0 @@ -tinyMCE.addI18n('en.advlink_dlg',{"target_name":"Target Name",classes:"Classes",style:"Style",id:"ID","popup_position":"Position (X/Y)",langdir:"Language Direction","popup_size":"Size","popup_dependent":"Dependent (Mozilla/Firefox Only)","popup_resizable":"Make Window Resizable","popup_location":"Show Location Bar","popup_menubar":"Show Menu Bar","popup_toolbar":"Show Toolbars","popup_statusbar":"Show Status Bar","popup_scrollbars":"Show Scrollbars","popup_return":"Insert \'return false\'","popup_name":"Window Name","popup_url":"Popup URL",popup:"JavaScript Popup","target_blank":"Open in New Window","target_top":"Open in Top Frame (Replaces All Frames)","target_parent":"Open in Parent Window/Frame","target_same":"Open in This Window/Frame","anchor_names":"Anchors","popup_opts":"Options","advanced_props":"Advanced Properties","event_props":"Events","popup_props":"Popup Properties","general_props":"General Properties","advanced_tab":"Advanced","events_tab":"Events","popup_tab":"Popup","general_tab":"General",list:"Link List","is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/Edit Link","link_list":"Link List",rtl:"Right to Left",ltr:"Left to Right",accesskey:"AccessKey",tabindex:"TabIndex",rev:"Relationship Target to Page",rel:"Relationship Page to Target",mime:"Target MIME Type",encoding:"Target Character Encoding",langcode:"Language Code","target_langcode":"Target Language",width:"Width",height:"Height"}); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlink/link.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlink/link.htm deleted file mode 100644 index 52623ab5718a..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlink/link.htm +++ /dev/null @@ -1,338 +0,0 @@ - - - - {#advlink_dlg.title} - - - - - - - - - -
- - - - -
- - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlist/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlist/editor_plugin.js deleted file mode 100644 index 57ecce6e02cf..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlist/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.AdvListPlugin",{init:function(b,c){var d=this;d.editor=b;function e(g){var f=[];a(g.split(/,/),function(h){f.push({title:"advlist."+(h=="default"?"def":h.replace(/-/g,"_")),styles:{listStyleType:h=="default"?"":h}})});return f}d.numlist=b.getParam("advlist_number_styles")||e("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");d.bullist=b.getParam("advlist_bullet_styles")||e("default,circle,disc,square");if(tinymce.isIE&&/MSIE [2-7]/.test(navigator.userAgent)){d.isIE7=true}},createControl:function(d,b){var f=this,e,i,g=f.editor;if(d=="numlist"||d=="bullist"){if(f[d][0].title=="advlist.def"){i=f[d][0]}function c(j,l){var k=true;a(l.styles,function(n,m){if(g.dom.getStyle(j,m)!=n){k=false;return false}});return k}function h(){var k,l=g.dom,j=g.selection;k=l.getParent(j.getNode(),"ol,ul");if(!k||k.nodeName==(d=="bullist"?"OL":"UL")||c(k,i)){g.execCommand(d=="bullist"?"InsertUnorderedList":"InsertOrderedList")}if(i){k=l.getParent(j.getNode(),"ol,ul");if(k){l.setStyles(k,i.styles);k.removeAttribute("data-mce-style")}}g.focus()}e=b.createSplitButton(d,{title:"advanced."+d+"_desc","class":"mce_"+d,onclick:function(){h()}});e.onRenderMenu.add(function(j,k){k.onHideMenu.add(function(){if(f.bookmark){g.selection.moveToBookmark(f.bookmark);f.bookmark=0}});k.onShowMenu.add(function(){var n=g.dom,m=n.getParent(g.selection.getNode(),"ol,ul"),l;if(m||i){l=f[d];a(k.items,function(o){var p=true;o.setSelected(0);if(m&&!o.isDisabled()){a(l,function(q){if(q.id==o.id){if(!c(m,q)){p=false;return false}}});if(p){o.setSelected(1)}}});if(!m){k.items[i.id].setSelected(1)}}g.focus();if(tinymce.isIE){f.bookmark=g.selection.getBookmark(1)}});k.add({id:g.dom.uniqueId(),title:"advlist.types","class":"mceMenuItemTitle",titleItem:true}).setDisabled(1);a(f[d],function(l){if(f.isIE7&&l.styles.listStyleType=="lower-greek"){return}l.id=g.dom.uniqueId();k.add({id:l.id,title:l.title,onclick:function(){i=l;h()}})})});return e}},getInfo:function(){return{longname:"Advanced lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlist",tinymce.plugins.AdvListPlugin)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlist/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlist/editor_plugin_src.js deleted file mode 100644 index 4ee4d34c8795..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlist/editor_plugin_src.js +++ /dev/null @@ -1,176 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var each = tinymce.each; - - tinymce.create('tinymce.plugins.AdvListPlugin', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - function buildFormats(str) { - var formats = []; - - each(str.split(/,/), function(type) { - formats.push({ - title : 'advlist.' + (type == 'default' ? 'def' : type.replace(/-/g, '_')), - styles : { - listStyleType : type == 'default' ? '' : type - } - }); - }); - - return formats; - }; - - // Setup number formats from config or default - t.numlist = ed.getParam("advlist_number_styles") || buildFormats("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"); - t.bullist = ed.getParam("advlist_bullet_styles") || buildFormats("default,circle,disc,square"); - - if (tinymce.isIE && /MSIE [2-7]/.test(navigator.userAgent)) - t.isIE7 = true; - }, - - createControl: function(name, cm) { - var t = this, btn, format, editor = t.editor; - - if (name == 'numlist' || name == 'bullist') { - // Default to first item if it's a default item - if (t[name][0].title == 'advlist.def') - format = t[name][0]; - - function hasFormat(node, format) { - var state = true; - - each(format.styles, function(value, name) { - // Format doesn't match - if (editor.dom.getStyle(node, name) != value) { - state = false; - return false; - } - }); - - return state; - }; - - function applyListFormat() { - var list, dom = editor.dom, sel = editor.selection; - - // Check for existing list element - list = dom.getParent(sel.getNode(), 'ol,ul'); - - // Switch/add list type if needed - if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || hasFormat(list, format)) - editor.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList'); - - // Append styles to new list element - if (format) { - list = dom.getParent(sel.getNode(), 'ol,ul'); - if (list) { - dom.setStyles(list, format.styles); - list.removeAttribute('data-mce-style'); - } - } - - editor.focus(); - }; - - btn = cm.createSplitButton(name, { - title : 'advanced.' + name + '_desc', - 'class' : 'mce_' + name, - onclick : function() { - applyListFormat(); - } - }); - - btn.onRenderMenu.add(function(btn, menu) { - menu.onHideMenu.add(function() { - if (t.bookmark) { - editor.selection.moveToBookmark(t.bookmark); - t.bookmark = 0; - } - }); - - menu.onShowMenu.add(function() { - var dom = editor.dom, list = dom.getParent(editor.selection.getNode(), 'ol,ul'), fmtList; - - if (list || format) { - fmtList = t[name]; - - // Unselect existing items - each(menu.items, function(item) { - var state = true; - - item.setSelected(0); - - if (list && !item.isDisabled()) { - each(fmtList, function(fmt) { - if (fmt.id == item.id) { - if (!hasFormat(list, fmt)) { - state = false; - return false; - } - } - }); - - if (state) - item.setSelected(1); - } - }); - - // Select the current format - if (!list) - menu.items[format.id].setSelected(1); - } - - editor.focus(); - - // IE looses it's selection so store it away and restore it later - if (tinymce.isIE) { - t.bookmark = editor.selection.getBookmark(1); - } - }); - - menu.add({id : editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle', titleItem: true}).setDisabled(1); - - each(t[name], function(item) { - // IE<8 doesn't support lower-greek, skip it - if (t.isIE7 && item.styles.listStyleType == 'lower-greek') - return; - - item.id = editor.dom.uniqueId(); - - menu.add({id : item.id, title : item.title, onclick : function() { - format = item; - applyListFormat(); - }}); - }); - }); - - return btn; - } - }, - - getInfo : function() { - return { - longname : 'Advanced lists', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/autolink/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/autolink/editor_plugin.js deleted file mode 100644 index fd293dca4b0c..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/autolink/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;if(tinyMCE.isIE){return}a.onKeyDown.add(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}});a.onKeyPress.add(function(d,f){if(f.which==41){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng().cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f-2);a.setEnd(n,f-1);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("createlink",false,h[1]+h[2]);i.selection.moveToBookmark(k);if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/autolink/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/autolink/editor_plugin_src.js deleted file mode 100644 index 604da8b42d93..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/autolink/editor_plugin_src.js +++ /dev/null @@ -1,172 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2011, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.AutolinkPlugin', { - /** - * Initializes the plugin, this will be executed after the plugin has been created. - * This call is done before the editor instance has finished it's initialization so use the onInit event - * of the editor instance to intercept that event. - * - * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. - * @param {string} url Absolute URL to where the plugin is located. - */ - - init : function(ed, url) { - var t = this; - - // Internet Explorer has built-in automatic linking - if (tinyMCE.isIE) - return; - - // Add a key down handler - ed.onKeyDown.add(function(ed, e) { - if (e.keyCode == 13) - return t.handleEnter(ed); - }); - - ed.onKeyPress.add(function(ed, e) { - if (e.which == 41) - return t.handleEclipse(ed); - }); - - // Add a key up handler - ed.onKeyUp.add(function(ed, e) { - if (e.keyCode == 32) - return t.handleSpacebar(ed); - }); - }, - - handleEclipse : function(ed) { - this.parseCurrentLine(ed, -1, '(', true); - }, - - handleSpacebar : function(ed) { - this.parseCurrentLine(ed, 0, '', true); - }, - - handleEnter : function(ed) { - this.parseCurrentLine(ed, -1, '', false); - }, - - parseCurrentLine : function(ed, end_offset, delimiter, goback) { - var r, end, start, endContainer, bookmark, text, matches, prev, len; - - // We need at least five characters to form a URL, - // hence, at minimum, five characters from the beginning of the line. - r = ed.selection.getRng().cloneRange(); - if (r.startOffset < 5) { - // During testing, the caret is placed inbetween two text nodes. - // The previous text node contains the URL. - prev = r.endContainer.previousSibling; - if (prev == null) { - if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null) - return; - - prev = r.endContainer.firstChild.nextSibling; - } - len = prev.length; - r.setStart(prev, len); - r.setEnd(prev, len); - - if (r.endOffset < 5) - return; - - end = r.endOffset; - endContainer = prev; - } else { - endContainer = r.endContainer; - - // Get a text node - if (endContainer.nodeType != 3 && endContainer.firstChild) { - while (endContainer.nodeType != 3 && endContainer.firstChild) - endContainer = endContainer.firstChild; - - r.setStart(endContainer, 0); - r.setEnd(endContainer, endContainer.nodeValue.length); - } - - if (r.endOffset == 1) - end = 2; - else - end = r.endOffset - 1 - end_offset; - } - - start = end; - - do - { - // Move the selection one character backwards. - r.setStart(endContainer, end - 2); - r.setEnd(endContainer, end - 1); - end -= 1; - - // Loop until one of the following is found: a blank space,  , delimeter, (end-2) >= 0 - } while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter); - - if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) { - r.setStart(endContainer, end); - r.setEnd(endContainer, start); - end += 1; - } else if (r.startOffset == 0) { - r.setStart(endContainer, 0); - r.setEnd(endContainer, start); - } - else { - r.setStart(endContainer, end); - r.setEnd(endContainer, start); - } - - text = r.toString(); - matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)(.+)$/i); - - if (matches) { - if (matches[1] == 'www.') { - matches[1] = 'http://www.'; - } - - bookmark = ed.selection.getBookmark(); - - ed.selection.setRng(r); - tinyMCE.execCommand('createlink',false, matches[1] + matches[2]); - ed.selection.moveToBookmark(bookmark); - - // TODO: Determine if this is still needed. - if (tinyMCE.isWebKit) { - // move the caret to its original position - ed.selection.collapse(false); - var max = Math.min(endContainer.length, start + 1); - r.setStart(endContainer, max); - r.setEnd(endContainer, max); - ed.selection.setRng(r); - } - } - }, - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Autolink', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin); -})(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/autoresize/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/autoresize/editor_plugin.js deleted file mode 100644 index 6c4ff0d5dfc3..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/autoresize/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this,e=0;if(a.getParam("fullscreen_is_enabled")){return}function b(){var i=a.getDoc(),f=i.body,k=i.documentElement,h=tinymce.DOM,j=d.autoresize_min_height,g;g=tinymce.isIE?f.scrollHeight:i.body.offsetHeight;if(g>d.autoresize_min_height){j=g}if(d.autoresize_max_height&&g>d.autoresize_max_height){j=d.autoresize_max_height;a.getBody().style.overflowY="auto"}else{a.getBody().style.overflowY="hidden"}if(j!==e){h.setStyle(h.get(a.id+"_ifr"),"height",j+"px");e=j}if(d.throbbing){a.setProgressState(false);a.setProgressState(true)}}d.editor=a;d.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight));d.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0));a.onInit.add(function(f){f.dom.setStyle(f.getBody(),"paddingBottom",f.getParam("autoresize_bottom_margin",50)+"px")});a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);if(a.getParam("autoresize_on_init",true)){a.onInit.add(function(g,f){g.setProgressState(true);d.throbbing=true;g.getBody().style.overflowY="hidden"});a.onLoadContent.add(function(g,f){b();setTimeout(function(){b();g.setProgressState(false);d.throbbing=false},1250)})}a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/autoresize/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/autoresize/editor_plugin_src.js deleted file mode 100644 index 7d113419d98a..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/autoresize/editor_plugin_src.js +++ /dev/null @@ -1,137 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - /** - * Auto Resize - * - * This plugin automatically resizes the content area to fit its content height. - * It will retain a minimum height, which is the height of the content area when - * it's initialized. - */ - tinymce.create('tinymce.plugins.AutoResizePlugin', { - /** - * Initializes the plugin, this will be executed after the plugin has been created. - * This call is done before the editor instance has finished it's initialization so use the onInit event - * of the editor instance to intercept that event. - * - * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. - * @param {string} url Absolute URL to where the plugin is located. - */ - init : function(ed, url) { - var t = this, oldSize = 0; - - if (ed.getParam('fullscreen_is_enabled')) - return; - - /** - * This method gets executed each time the editor needs to resize. - */ - function resize() { - var d = ed.getDoc(), b = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight; - - // Get height differently depending on the browser used - myHeight = tinymce.isIE ? b.scrollHeight : d.body.offsetHeight; - - // Don't make it smaller than the minimum height - if (myHeight > t.autoresize_min_height) - resizeHeight = myHeight; - - // If a maximum height has been defined don't exceed this height - if (t.autoresize_max_height && myHeight > t.autoresize_max_height) { - resizeHeight = t.autoresize_max_height; - ed.getBody().style.overflowY = "auto"; - } else - ed.getBody().style.overflowY = "hidden"; - - // Resize content element - if (resizeHeight !== oldSize) { - DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px'); - oldSize = resizeHeight; - } - - // if we're throbbing, we'll re-throb to match the new size - if (t.throbbing) { - ed.setProgressState(false); - ed.setProgressState(true); - } - }; - - t.editor = ed; - - // Define minimum height - t.autoresize_min_height = parseInt( ed.getParam('autoresize_min_height', ed.getElement().offsetHeight) ); - - // Define maximum height - t.autoresize_max_height = parseInt( ed.getParam('autoresize_max_height', 0) ); - - // Add padding at the bottom for better UX - ed.onInit.add(function(ed){ - ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px'); - }); - - // Add appropriate listeners for resizing content area - ed.onChange.add(resize); - ed.onSetContent.add(resize); - ed.onPaste.add(resize); - ed.onKeyUp.add(resize); - ed.onPostRender.add(resize); - - if (ed.getParam('autoresize_on_init', true)) { - // Things to do when the editor is ready - ed.onInit.add(function(ed, l) { - // Show throbber until content area is resized properly - ed.setProgressState(true); - t.throbbing = true; - - // Hide scrollbars - ed.getBody().style.overflowY = "hidden"; - }); - - ed.onLoadContent.add(function(ed, l) { - resize(); - - // Because the content area resizes when its content CSS loads, - // and we can't easily add a listener to its onload event, - // we'll just trigger a resize after a short loading period - setTimeout(function() { - resize(); - - // Disable throbber - ed.setProgressState(false); - t.throbbing = false; - }, 1250); - }); - } - - // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); - ed.addCommand('mceAutoResize', resize); - }, - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Auto Resize', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin); -})(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/autosave/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/autosave/editor_plugin.js deleted file mode 100644 index f7d0576008df..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/autosave/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(e){var c="autosave",g="restoredraft",b=true,f,d,a=e.util.Dispatcher;e.create("tinymce.plugins.AutoSave",{init:function(i,j){var h=this,l=i.settings;h.editor=i;function k(n){var m={s:1000,m:60000};n=/^(\d+)([ms]?)$/.exec(""+n);return(n[2]?m[n[2]]:1)*parseInt(n)}e.each({ask_before_unload:b,interval:"30s",retention:"20m",minlength:50},function(n,m){m=c+"_"+m;if(l[m]===f){l[m]=n}});l.autosave_interval=k(l.autosave_interval);l.autosave_retention=k(l.autosave_retention);i.addButton(g,{title:c+".restore_content",onclick:function(){if(i.getContent({draft:true}).replace(/\s| |<\/?p[^>]*>|]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){h.storeDraft();i.nodeChanged()},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();try{m.save("TinyMCE")}catch(o){}},getItem:function(l){var m=i.getElement();try{m.load("TinyMCE");return m.getAttribute(l)}catch(n){return null}},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent({draft:true});if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,j=h.storage,i;if(j){i=j.getItem(h.key);if(i){h.editor.setContent(i);h.onRestoreDraft.dispatch(h,{content:i})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()]*>|]*>/gi, "").length > 0) { - // Show confirm dialog if the editor isn't empty - ed.windowManager.confirm( - PLUGIN_NAME + ".warning_message", - function(ok) { - if (ok) - self.restoreDraft(); - } - ); - } else - self.restoreDraft(); - } - }); - - // Enable/disable restoredraft button depending on if there is a draft stored or not - ed.onNodeChange.add(function() { - var controlManager = ed.controlManager; - - if (controlManager.get(RESTORE_DRAFT)) - controlManager.setDisabled(RESTORE_DRAFT, !self.hasDraft()); - }); - - ed.onInit.add(function() { - // Check if the user added the restore button, then setup auto storage logic - if (ed.controlManager.get(RESTORE_DRAFT)) { - // Setup storage engine - self.setupStorage(ed); - - // Auto save contents each interval time - setInterval(function() { - self.storeDraft(); - ed.nodeChanged(); - }, settings.autosave_interval); - } - }); - - /** - * This event gets fired when a draft is stored to local storage. - * - * @event onStoreDraft - * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. - * @param {Object} draft Draft object containing the HTML contents of the editor. - */ - self.onStoreDraft = new Dispatcher(self); - - /** - * This event gets fired when a draft is restored from local storage. - * - * @event onStoreDraft - * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. - * @param {Object} draft Draft object containing the HTML contents of the editor. - */ - self.onRestoreDraft = new Dispatcher(self); - - /** - * This event gets fired when a draft removed/expired. - * - * @event onRemoveDraft - * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. - * @param {Object} draft Draft object containing the HTML contents of the editor. - */ - self.onRemoveDraft = new Dispatcher(self); - - // Add ask before unload dialog only add one unload handler - if (!unloadHandlerAdded) { - window.onbeforeunload = tinymce.plugins.AutoSave._beforeUnloadHandler; - unloadHandlerAdded = TRUE; - } - }, - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @method getInfo - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Auto save', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - /** - * Returns an expiration date UTC string. - * - * @method getExpDate - * @return {String} Expiration date UTC string. - */ - getExpDate : function() { - return new Date( - new Date().getTime() + this.editor.settings.autosave_retention - ).toUTCString(); - }, - - /** - * This method will setup the storage engine. If the browser has support for it. - * - * @method setupStorage - */ - setupStorage : function(ed) { - var self = this, testKey = PLUGIN_NAME + '_test', testVal = "OK"; - - self.key = PLUGIN_NAME + ed.id; - - // Loop though each storage engine type until we find one that works - tinymce.each([ - function() { - // Try HTML5 Local Storage - if (localStorage) { - localStorage.setItem(testKey, testVal); - - if (localStorage.getItem(testKey) === testVal) { - localStorage.removeItem(testKey); - - return localStorage; - } - } - }, - - function() { - // Try HTML5 Session Storage - if (sessionStorage) { - sessionStorage.setItem(testKey, testVal); - - if (sessionStorage.getItem(testKey) === testVal) { - sessionStorage.removeItem(testKey); - - return sessionStorage; - } - } - }, - - function() { - // Try IE userData - if (tinymce.isIE) { - ed.getElement().style.behavior = "url('#default#userData')"; - - // Fake localStorage on old IE - return { - autoExpires : TRUE, - - setItem : function(key, value) { - var userDataElement = ed.getElement(); - - userDataElement.setAttribute(key, value); - userDataElement.expires = self.getExpDate(); - - try { - userDataElement.save("TinyMCE"); - } catch (e) { - // Ignore, saving might fail if "Userdata Persistence" is disabled in IE - } - }, - - getItem : function(key) { - var userDataElement = ed.getElement(); - - try { - userDataElement.load("TinyMCE"); - return userDataElement.getAttribute(key); - } catch (e) { - // Ignore, loading might fail if "Userdata Persistence" is disabled in IE - return null; - } - }, - - removeItem : function(key) { - ed.getElement().removeAttribute(key); - } - }; - } - }, - ], function(setup) { - // Try executing each function to find a suitable storage engine - try { - self.storage = setup(); - - if (self.storage) - return false; - } catch (e) { - // Ignore - } - }); - }, - - /** - * This method will store the current contents in the storage engine. - * - * @method storeDraft - */ - storeDraft : function() { - var self = this, storage = self.storage, editor = self.editor, expires, content; - - // Is the contents dirty - if (storage) { - // If there is no existing key and the contents hasn't been changed since - // it's original value then there is no point in saving a draft - if (!storage.getItem(self.key) && !editor.isDirty()) - return; - - // Store contents if the contents if longer than the minlength of characters - content = editor.getContent({draft: true}); - if (content.length > editor.settings.autosave_minlength) { - expires = self.getExpDate(); - - // Store expiration date if needed IE userData has auto expire built in - if (!self.storage.autoExpires) - self.storage.setItem(self.key + "_expires", expires); - - self.storage.setItem(self.key, content); - self.onStoreDraft.dispatch(self, { - expires : expires, - content : content - }); - } - } - }, - - /** - * This method will restore the contents from the storage engine back to the editor. - * - * @method restoreDraft - */ - restoreDraft : function() { - var self = this, storage = self.storage, content; - - if (storage) { - content = storage.getItem(self.key); - - if (content) { - self.editor.setContent(content); - self.onRestoreDraft.dispatch(self, { - content : content - }); - } - } - }, - - /** - * This method will return true/false if there is a local storage draft available. - * - * @method hasDraft - * @return {boolean} true/false state if there is a local draft. - */ - hasDraft : function() { - var self = this, storage = self.storage, expDate, exists; - - if (storage) { - // Does the item exist at all - exists = !!storage.getItem(self.key); - if (exists) { - // Storage needs autoexpire - if (!self.storage.autoExpires) { - expDate = new Date(storage.getItem(self.key + "_expires")); - - // Contents hasn't expired - if (new Date().getTime() < expDate.getTime()) - return TRUE; - - // Remove it if it has - self.removeDraft(); - } else - return TRUE; - } - } - - return false; - }, - - /** - * Removes the currently stored draft. - * - * @method removeDraft - */ - removeDraft : function() { - var self = this, storage = self.storage, key = self.key, content; - - if (storage) { - // Get current contents and remove the existing draft - content = storage.getItem(key); - storage.removeItem(key); - storage.removeItem(key + "_expires"); - - // Dispatch remove event if we had any contents - if (content) { - self.onRemoveDraft.dispatch(self, { - content : content - }); - } - } - }, - - "static" : { - // Internal unload handler will be called before the page is unloaded - _beforeUnloadHandler : function(e) { - var msg; - - tinymce.each(tinyMCE.editors, function(ed) { - // Store a draft for each editor instance - if (ed.plugins.autosave) - ed.plugins.autosave.storeDraft(); - - // Never ask in fullscreen mode - if (ed.getParam("fullscreen_is_enabled")) - return; - - // Setup a return message if the editor is dirty - if (!msg && ed.isDirty() && ed.getParam("autosave_ask_before_unload")) - msg = ed.getLang("autosave.unload_msg"); - }); - - return msg; - } - } - }); - - tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSave); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/autosave/langs/en.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/autosave/langs/en.js deleted file mode 100644 index 219f769ac4a7..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/autosave/langs/en.js +++ /dev/null @@ -1,4 +0,0 @@ -tinyMCE.addI18n('en.autosave',{ -restore_content: "Restore auto-saved content", -warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?" -}); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/bbcode/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/bbcode/editor_plugin.js deleted file mode 100644 index 8f8821fd64f7..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/bbcode/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a,b){var d=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.onBeforeSetContent.add(function(e,f){f.content=d["_"+c+"_bbcode2html"](f.content)});a.onPostProcess.add(function(e,f){if(f.set){f.content=d["_"+c+"_bbcode2html"](f.content)}if(f.get){f.content=d["_"+c+"_html2bbcode"](f.content)}})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_punbb_html2bbcode:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/(.*?)<\/font>/gi,"$1");b(//gi,"[img]$1[/img]");b(/(.*?)<\/span>/gi,"[code]$1[/code]");b(/(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/(.*?)<\/span>/gi,"[u]$1[/u]");b(//gi,"[u]");b(/]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/
/gi,"\n");b(//gi,"\n");b(/
/gi,"\n");b(/

/gi,"");b(/<\/p>/gi,"\n");b(/ |\u00a0/gi," ");b(/"/gi,'"');b(/</gi,"<");b(/>/gi,">");b(/&/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"
");b(/\[b\]/gi,"");b(/\[\/b\]/gi,"");b(/\[i\]/gi,"");b(/\[\/i\]/gi,"");b(/\[u\]/gi,"");b(/\[\/u\]/gi,"");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2');b(/\[url\](.*?)\[\/url\]/gi,'$1');b(/\[img\](.*?)\[\/img\]/gi,'');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2');b(/\[code\](.*?)\[\/code\]/gi,'$1 ');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 ');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/bbcode/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/bbcode/editor_plugin_src.js deleted file mode 100644 index 12cdacaa582b..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/bbcode/editor_plugin_src.js +++ /dev/null @@ -1,120 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.BBCodePlugin', { - init : function(ed, url) { - var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase(); - - ed.onBeforeSetContent.add(function(ed, o) { - o.content = t['_' + dialect + '_bbcode2html'](o.content); - }); - - ed.onPostProcess.add(function(ed, o) { - if (o.set) - o.content = t['_' + dialect + '_bbcode2html'](o.content); - - if (o.get) - o.content = t['_' + dialect + '_html2bbcode'](o.content); - }); - }, - - getInfo : function() { - return { - longname : 'BBCode Plugin', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - // HTML -> BBCode in PunBB dialect - _punbb_html2bbcode : function(s) { - s = tinymce.trim(s); - - function rep(re, str) { - s = s.replace(re, str); - }; - - // example: to [b] - rep(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"); - rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); - rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); - rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); - rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); - rep(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"); - rep(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"); - rep(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"); - rep(/(.*?)<\/font>/gi,"$1"); - rep(//gi,"[img]$1[/img]"); - rep(/(.*?)<\/span>/gi,"[code]$1[/code]"); - rep(/(.*?)<\/span>/gi,"[quote]$1[/quote]"); - rep(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"); - rep(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"); - rep(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"); - rep(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"); - rep(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"); - rep(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"); - rep(/<\/(strong|b)>/gi,"[/b]"); - rep(/<(strong|b)>/gi,"[b]"); - rep(/<\/(em|i)>/gi,"[/i]"); - rep(/<(em|i)>/gi,"[i]"); - rep(/<\/u>/gi,"[/u]"); - rep(/(.*?)<\/span>/gi,"[u]$1[/u]"); - rep(//gi,"[u]"); - rep(/]*>/gi,"[quote]"); - rep(/<\/blockquote>/gi,"[/quote]"); - rep(/
/gi,"\n"); - rep(//gi,"\n"); - rep(/
/gi,"\n"); - rep(/

/gi,""); - rep(/<\/p>/gi,"\n"); - rep(/ |\u00a0/gi," "); - rep(/"/gi,"\""); - rep(/</gi,"<"); - rep(/>/gi,">"); - rep(/&/gi,"&"); - - return s; - }, - - // BBCode -> HTML from PunBB dialect - _punbb_bbcode2html : function(s) { - s = tinymce.trim(s); - - function rep(re, str) { - s = s.replace(re, str); - }; - - // example: [b] to - rep(/\n/gi,"
"); - rep(/\[b\]/gi,""); - rep(/\[\/b\]/gi,""); - rep(/\[i\]/gi,""); - rep(/\[\/i\]/gi,""); - rep(/\[u\]/gi,""); - rep(/\[\/u\]/gi,""); - rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"$2"); - rep(/\[url\](.*?)\[\/url\]/gi,"$1"); - rep(/\[img\](.*?)\[\/img\]/gi,""); - rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"$2"); - rep(/\[code\](.*?)\[\/code\]/gi,"$1 "); - rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"$1 "); - - return s; - } - }); - - // Register plugin - tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/contextmenu/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/contextmenu/editor_plugin.js deleted file mode 100644 index af7ae54453bf..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/contextmenu/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(e){var h=this,f,d,i;h.editor=e;d=e.settings.contextmenu_never_use_native;h.onContextMenu=new tinymce.util.Dispatcher(this);f=e.onContextMenu.add(function(j,k){if((i!==0?i:k.ctrlKey)&&!d){return}a.cancel(k);if(k.target.nodeName=="IMG"){j.selection.select(k.target)}h._getMenu(j).showMenu(k.clientX||k.pageX,k.clientY||k.pageY);a.add(j.getDoc(),"click",function(l){g(j,l)});j.nodeChanged()});e.onRemove.add(function(){if(h._menu){h._menu.removeAll()}});function g(j,k){i=0;if(k&&k.button==2){i=k.ctrlKey;return}if(h._menu){h._menu.removeAll();h._menu.destroy();a.remove(j.getDoc(),"click",g)}}e.onMouseDown.add(g);e.onKeyDown.add(g);e.onKeyDown.add(function(j,k){if(k.shiftKey&&!k.ctrlKey&&!k.altKey&&k.keyCode===121){a.cancel(k);f(j,k)}})},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(e){var g=this,d=g._menu,j=e.selection,f=j.isCollapsed(),h=j.getNode()||e.getBody(),i,k;if(d){d.removeAll();d.destroy()}k=b.getPos(e.getContentAreaContainer());d=e.controlManager.createDropMenu("contextmenu",{offset_x:k.x+e.getParam("contextmenu_offset_x",0),offset_y:k.y+e.getParam("contextmenu_offset_y",0),constrain:1,keyboard_focus:true});g._menu=d;d.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(f);d.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(f);d.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((h.nodeName=="A"&&!e.dom.getAttrib(h,"name"))||!f){d.addSeparator();d.add({title:"advanced.link_desc",icon:"link",cmd:e.plugins.advlink?"mceAdvLink":"mceLink",ui:true});d.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}d.addSeparator();d.add({title:"advanced.image_desc",icon:"image",cmd:e.plugins.advimage?"mceAdvImage":"mceImage",ui:true});d.addSeparator();i=d.addMenu({title:"contextmenu.align"});i.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});i.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});i.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});i.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});g.onContextMenu.dispatch(g,d,h,f);return d}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/contextmenu/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/contextmenu/editor_plugin_src.js deleted file mode 100644 index 2a916a391428..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/contextmenu/editor_plugin_src.js +++ /dev/null @@ -1,160 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM; - - /** - * This plugin a context menu to TinyMCE editor instances. - * - * @class tinymce.plugins.ContextMenu - */ - tinymce.create('tinymce.plugins.ContextMenu', { - /** - * Initializes the plugin, this will be executed after the plugin has been created. - * This call is done before the editor instance has finished it's initialization so use the onInit event - * of the editor instance to intercept that event. - * - * @method init - * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. - * @param {string} url Absolute URL to where the plugin is located. - */ - init : function(ed) { - var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey; - - t.editor = ed; - - contextmenuNeverUseNative = ed.settings.contextmenu_never_use_native; - - /** - * This event gets fired when the context menu is shown. - * - * @event onContextMenu - * @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event. - * @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed. - */ - t.onContextMenu = new tinymce.util.Dispatcher(this); - - showMenu = ed.onContextMenu.add(function(ed, e) { - // Block TinyMCE menu on ctrlKey and work around Safari issue - if ((realCtrlKey !== 0 ? realCtrlKey : e.ctrlKey) && !contextmenuNeverUseNative) - return; - - Event.cancel(e); - - // Select the image if it's clicked. WebKit would other wise expand the selection - if (e.target.nodeName == 'IMG') - ed.selection.select(e.target); - - t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageY); - Event.add(ed.getDoc(), 'click', function(e) { - hide(ed, e); - }); - - ed.nodeChanged(); - }); - - ed.onRemove.add(function() { - if (t._menu) - t._menu.removeAll(); - }); - - function hide(ed, e) { - realCtrlKey = 0; - - // Since the contextmenu event moves - // the selection we need to store it away - if (e && e.button == 2) { - realCtrlKey = e.ctrlKey; - return; - } - - if (t._menu) { - t._menu.removeAll(); - t._menu.destroy(); - Event.remove(ed.getDoc(), 'click', hide); - } - }; - - ed.onMouseDown.add(hide); - ed.onKeyDown.add(hide); - ed.onKeyDown.add(function(ed, e) { - if (e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode === 121) { - Event.cancel(e); - showMenu(ed, e); - } - }); - }, - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @method getInfo - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Contextmenu', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - _getMenu : function(ed) { - var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p; - - if (m) { - m.removeAll(); - m.destroy(); - } - - p = DOM.getPos(ed.getContentAreaContainer()); - - m = ed.controlManager.createDropMenu('contextmenu', { - offset_x : p.x + ed.getParam('contextmenu_offset_x', 0), - offset_y : p.y + ed.getParam('contextmenu_offset_y', 0), - constrain : 1, - keyboard_focus: true - }); - - t._menu = m; - - m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col); - m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col); - m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'}); - - if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) { - m.addSeparator(); - m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); - m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); - } - - m.addSeparator(); - m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); - - m.addSeparator(); - am = m.addMenu({title : 'contextmenu.align'}); - am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'}); - am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'}); - am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'}); - am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'}); - - t.onContextMenu.dispatch(t, m, el, col); - - return m; - } - }); - - // Register plugin - tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu); -})(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/directionality/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/directionality/editor_plugin.js deleted file mode 100644 index bce8e73995d0..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/directionality/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceDirectionLTR",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="ltr"){a.dom.setAttrib(d,"dir","ltr")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addCommand("mceDirectionRTL",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="rtl"){a.dom.setAttrib(d,"dir","rtl")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});a.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});a.onNodeChange.add(c._nodeChange,c)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/directionality/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/directionality/editor_plugin_src.js deleted file mode 100644 index 205d02cd2fdc..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/directionality/editor_plugin_src.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.Directionality', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - ed.addCommand('mceDirectionLTR', function() { - var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); - - if (e) { - if (ed.dom.getAttrib(e, "dir") != "ltr") - ed.dom.setAttrib(e, "dir", "ltr"); - else - ed.dom.setAttrib(e, "dir", ""); - } - - ed.nodeChanged(); - }); - - ed.addCommand('mceDirectionRTL', function() { - var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); - - if (e) { - if (ed.dom.getAttrib(e, "dir") != "rtl") - ed.dom.setAttrib(e, "dir", "rtl"); - else - ed.dom.setAttrib(e, "dir", ""); - } - - ed.nodeChanged(); - }); - - ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'}); - ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'}); - - ed.onNodeChange.add(t._nodeChange, t); - }, - - getInfo : function() { - return { - longname : 'Directionality', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - _nodeChange : function(ed, cm, n) { - var dom = ed.dom, dir; - - n = dom.getParent(n, dom.isBlock); - if (!n) { - cm.setDisabled('ltr', 1); - cm.setDisabled('rtl', 1); - return; - } - - dir = dom.getAttrib(n, 'dir'); - cm.setActive('ltr', dir == "ltr"); - cm.setDisabled('ltr', 0); - cm.setActive('rtl', dir == "rtl"); - cm.setDisabled('rtl', 0); - } - }); - - // Register plugin - tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/editor_plugin.js deleted file mode 100644 index dbdd8ffb58e1..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(a){a.create("tinymce.plugins.EmotionsPlugin",{init:function(b,c){b.addCommand("mceEmotion",function(){b.windowManager.open({file:c+"/emotions.htm",width:250+parseInt(b.getLang("emotions.delta_width",0)),height:160+parseInt(b.getLang("emotions.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("emotions",{title:"emotions.emotions_desc",cmd:"mceEmotion"})},getInfo:function(){return{longname:"Emotions",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("emotions",a.plugins.EmotionsPlugin)})(tinymce); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/editor_plugin_src.js deleted file mode 100644 index aeee199d24cf..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/editor_plugin_src.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - tinymce.create('tinymce.plugins.EmotionsPlugin', { - init : function(ed, url) { - // Register commands - ed.addCommand('mceEmotion', function() { - ed.windowManager.open({ - file : url + '/emotions.htm', - width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)), - height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - // Register buttons - ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'}); - }, - - getInfo : function() { - return { - longname : 'Emotions', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin); -})(tinymce); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/emotions.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/emotions.htm deleted file mode 100644 index 7e73c3e0f806..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/emotions.htm +++ /dev/null @@ -1,42 +0,0 @@ - - - - {#emotions_dlg.title} - - - - - -

-
{#emotions_dlg.title}:

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
{#emotions_dlg.usage}
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-cool.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-cool.gif deleted file mode 100644 index 8f2fdaac6918..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-cool.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-cry.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-cry.gif deleted file mode 100644 index 7979f828fcd9..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-cry.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-embarassed.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-embarassed.gif deleted file mode 100644 index 3cdae082bf23..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-embarassed.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif deleted file mode 100644 index 0493e5b4a58d..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-frown.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-frown.gif deleted file mode 100644 index d3b5df9d89cd..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-frown.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-innocent.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-innocent.gif deleted file mode 100644 index 5316499d9917..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-innocent.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-kiss.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-kiss.gif deleted file mode 100644 index f8923c3f2bd6..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-kiss.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-laughing.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-laughing.gif deleted file mode 100644 index f516df99ce84..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-laughing.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif deleted file mode 100644 index 2fe81da13d80..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-sealed.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-sealed.gif deleted file mode 100644 index 0516b14c707f..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-sealed.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-smile.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-smile.gif deleted file mode 100644 index 3fad091823e7..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-smile.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-surprised.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-surprised.gif deleted file mode 100644 index eca99f04eda2..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-surprised.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif deleted file mode 100644 index 6c1d9356d9e1..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-undecided.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-undecided.gif deleted file mode 100644 index ca277e482b1b..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-undecided.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-wink.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-wink.gif deleted file mode 100644 index ac2302553ec9..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-wink.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-yell.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-yell.gif deleted file mode 100644 index 6a92d00a9629..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/img/smiley-yell.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/js/emotions.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/js/emotions.js deleted file mode 100644 index f73516c83339..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/js/emotions.js +++ /dev/null @@ -1,43 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var EmotionsDialog = { - addKeyboardNavigation: function(){ - var tableElm, cells, settings; - - cells = tinyMCEPopup.dom.select("a.emoticon_link", "emoticon_table"); - - settings ={ - root: "emoticon_table", - items: cells - }; - cells[0].tabindex=0; - tinyMCEPopup.dom.addClass(cells[0], "mceFocus"); - if (tinymce.isGecko) { - cells[0].focus(); - } else { - setTimeout(function(){ - cells[0].focus(); - }, 100); - } - tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); - }, - init : function(ed) { - tinyMCEPopup.resizeToInnerSize(); - this.addKeyboardNavigation(); - }, - - insert : function(file, title) { - var ed = tinyMCEPopup.editor, dom = ed.dom; - - tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', { - src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file, - alt : ed.getLang(title), - title : ed.getLang(title), - border : 0 - })); - - tinyMCEPopup.close(); - } -}; - -tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/langs/en_dlg.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/langs/en_dlg.js deleted file mode 100644 index 037c4b5883cf..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/emotions/langs/en_dlg.js +++ /dev/null @@ -1 +0,0 @@ -tinyMCE.addI18n('en.emotions_dlg',{cry:"Cry",cool:"Cool",desc:"Emotions",title:"Insert Emotion",usage:"Use left and right arrows to navigate.",yell:"Yell",wink:"Wink",undecided:"Undecided","tongue_out":"Tongue Out",surprised:"Surprised",smile:"Smile",sealed:"Sealed","money_mouth":"Money Mouth",laughing:"Laughing",kiss:"Kiss",innocent:"Innocent",frown:"Frown","foot_in_mouth":"Foot in Mouth",embarassed:"Embarassed"}); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/dialog.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/dialog.htm deleted file mode 100644 index d6f2856aa0db..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/dialog.htm +++ /dev/null @@ -1,22 +0,0 @@ - - - - {#example_dlg.title} - - - - - -
-

Here is a example dialog.

-

Selected text:

-

Custom arg:

- -
- - -
-
- - - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/editor_plugin.js deleted file mode 100644 index ec1f81ea4017..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.PluginManager.requireLangPack("example");tinymce.create("tinymce.plugins.ExamplePlugin",{init:function(a,b){a.addCommand("mceExample",function(){a.windowManager.open({file:b+"/dialog.htm",width:320+parseInt(a.getLang("example.delta_width",0)),height:120+parseInt(a.getLang("example.delta_height",0)),inline:1},{plugin_url:b,some_custom_arg:"custom arg"})});a.addButton("example",{title:"example.desc",cmd:"mceExample",image:b+"/img/example.gif"});a.onNodeChange.add(function(d,c,e){c.setActive("example",e.nodeName=="IMG")})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Example plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example",version:"1.0"}}});tinymce.PluginManager.add("example",tinymce.plugins.ExamplePlugin)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/editor_plugin_src.js deleted file mode 100644 index bd805e637027..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/editor_plugin_src.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - // Load plugin specific language pack - tinymce.PluginManager.requireLangPack('example'); - - tinymce.create('tinymce.plugins.ExamplePlugin', { - /** - * Initializes the plugin, this will be executed after the plugin has been created. - * This call is done before the editor instance has finished it's initialization so use the onInit event - * of the editor instance to intercept that event. - * - * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. - * @param {string} url Absolute URL to where the plugin is located. - */ - init : function(ed, url) { - // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); - ed.addCommand('mceExample', function() { - ed.windowManager.open({ - file : url + '/dialog.htm', - width : 320 + parseInt(ed.getLang('example.delta_width', 0)), - height : 120 + parseInt(ed.getLang('example.delta_height', 0)), - inline : 1 - }, { - plugin_url : url, // Plugin absolute URL - some_custom_arg : 'custom arg' // Custom argument - }); - }); - - // Register example button - ed.addButton('example', { - title : 'example.desc', - cmd : 'mceExample', - image : url + '/img/example.gif' - }); - - // Add a node change handler, selects the button in the UI when a image is selected - ed.onNodeChange.add(function(ed, cm, n) { - cm.setActive('example', n.nodeName == 'IMG'); - }); - }, - - /** - * Creates control instances based in the incoming name. This method is normally not - * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons - * but you sometimes need to create more complex controls like listboxes, split buttons etc then this - * method can be used to create those. - * - * @param {String} n Name of the control to create. - * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. - * @return {tinymce.ui.Control} New control instance or null if no control was created. - */ - createControl : function(n, cm) { - return null; - }, - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Example plugin', - author : 'Some author', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example', - version : "1.0" - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/img/example.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/img/example.gif deleted file mode 100644 index 250410866b38..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/img/example.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/js/dialog.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/js/dialog.js deleted file mode 100644 index a7ee507e0660..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/js/dialog.js +++ /dev/null @@ -1,19 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var ExampleDialog = { - init : function() { - var f = document.forms[0]; - - // Get the selected contents as text and place it in the input - f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'}); - f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg'); - }, - - insert : function() { - // Insert the contents from the input into the document - tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value); - tinyMCEPopup.close(); - } -}; - -tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/langs/en.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/langs/en.js deleted file mode 100644 index f3721d3a316f..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/langs/en.js +++ /dev/null @@ -1,3 +0,0 @@ -tinyMCE.addI18n('en.example',{ - desc : 'This is just a template button' -}); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/langs/en_dlg.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/langs/en_dlg.js deleted file mode 100644 index a9cd65f8c05d..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example/langs/en_dlg.js +++ /dev/null @@ -1,3 +0,0 @@ -tinyMCE.addI18n('en.example_dlg',{ - title : 'This is just a example title' -}); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example_dependency/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example_dependency/editor_plugin.js deleted file mode 100644 index 0a4551d3807e..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example_dependency/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.ExampleDependencyPlugin",{init:function(a,b){},getInfo:function(){return{longname:"Example Dependency plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency",version:"1.0"}}});tinymce.PluginManager.add("example_dependency",tinymce.plugins.ExampleDependencyPlugin,["example"])})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example_dependency/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example_dependency/editor_plugin_src.js deleted file mode 100644 index b6eaa48f9245..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/example_dependency/editor_plugin_src.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - - tinymce.create('tinymce.plugins.ExampleDependencyPlugin', { - /** - * Initializes the plugin, this will be executed after the plugin has been created. - * This call is done before the editor instance has finished it's initialization so use the onInit event - * of the editor instance to intercept that event. - * - * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. - * @param {string} url Absolute URL to where the plugin is located. - */ - init : function(ed, url) { - }, - - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Example Dependency plugin', - author : 'Some author', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency', - version : "1.0" - }; - } - }); - - /** - * Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, with the list loaded in order. - * plugins in this list will be initialised when this plugin is initialized. (before the init method is called). - * plugins in a depends list should typically be specified using the short name). If necessary this can be done - * with an object which has the url to the plugin and the shortname. - */ - tinymce.PluginManager.add('example_dependency', tinymce.plugins.ExampleDependencyPlugin, ['example']); -})(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/css/fullpage.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/css/fullpage.css deleted file mode 100644 index 28b721f9b30d..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/css/fullpage.css +++ /dev/null @@ -1,143 +0,0 @@ -/* Hide the advanced tab */ -#advanced_tab { - display: none; -} - -#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright { - width: 280px; -} - -#doctype, #docencoding { - width: 200px; -} - -#langcode { - width: 30px; -} - -#bgimage { - width: 220px; -} - -#fontface { - width: 240px; -} - -#leftmargin, #rightmargin, #topmargin, #bottommargin { - width: 50px; -} - -.panel_wrapper div.current { - height: 400px; -} - -#stylesheet, #style { - width: 240px; -} - -#doctypes { - width: 200px; -} - -/* Head list classes */ - -.headlistwrapper { - width: 100%; -} - -.selected { - border: 1px solid #0A246A; - background-color: #B6BDD2; -} - -.toolbar { - width: 100%; -} - -#headlist { - width: 100%; - margin-top: 3px; - font-size: 11px; -} - -#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element { - display: none; -} - -#addmenu { - position: absolute; - border: 1px solid gray; - display: none; - z-index: 100; - background-color: white; -} - -#addmenu a { - display: block; - width: 100%; - line-height: 20px; - text-decoration: none; - background-color: white; -} - -#addmenu a:hover { - background-color: #B6BDD2; - color: black; -} - -#addmenu span { - padding-left: 10px; - padding-right: 10px; -} - -#updateElementPanel { - display: none; -} - -#script_element .panel_wrapper div.current { - height: 108px; -} - -#style_element .panel_wrapper div.current { - height: 108px; -} - -#link_element .panel_wrapper div.current { - height: 140px; -} - -#element_script_value { - width: 100%; - height: 100px; -} - -#element_comment_value { - width: 100%; - height: 120px; -} - -#element_style_value { - width: 100%; - height: 100px; -} - -#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title { - width: 250px; -} - -.updateElementButton { - margin-top: 3px; -} - -/* MSIE specific styles */ - -* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton { - width: 22px; - height: 22px; -} - -textarea { - height: 55px; -} - -.panel_wrapper div.current {height:420px;} \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/editor_plugin.js deleted file mode 100644 index dcf76024dda9..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var b=tinymce.each,a=tinymce.html.Node;tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(c,d){var e=this;e.editor=c;c.addCommand("mceFullPageProperties",function(){c.windowManager.open({file:d+"/fullpage.htm",width:430+parseInt(c.getLang("fullpage.delta_width",0)),height:495+parseInt(c.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:d,data:e._htmlToData()})});c.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});c.onBeforeSetContent.add(e._setContent,e);c.onGetContent.add(e._getContent,e)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_htmlToData:function(){var f=this._parseHeader(),h={},c,i,g,e=this.editor;function d(l,j){var k=l.attr(j);return k||""}h.fontface=e.getParam("fullpage_default_fontface","");h.fontsize=e.getParam("fullpage_default_fontsize","");i=f.firstChild;if(i.type==7){h.xml_pi=true;g=/encoding="([^"]+)"/.exec(i.value);if(g){h.docencoding=g[1]}}i=f.getAll("#doctype")[0];if(i){h.doctype=""}i=f.getAll("title")[0];if(i&&i.firstChild){h.metatitle=i.firstChild.value}b(f.getAll("meta"),function(m){var k=m.attr("name"),j=m.attr("http-equiv"),l;if(k){h["meta"+k.toLowerCase()]=m.attr("content")}else{if(j=="Content-Type"){l=/charset\s*=\s*(.*)\s*/gi.exec(m.attr("content"));if(l){h.docencoding=l[1]}}}});i=f.getAll("html")[0];if(i){h.langcode=d(i,"lang")||d(i,"xml:lang")}i=f.getAll("link")[0];if(i&&i.attr("rel")=="stylesheet"){h.stylesheet=i.attr("href")}i=f.getAll("body")[0];if(i){h.langdir=d(i,"dir");h.style=d(i,"style");h.visited_color=d(i,"vlink");h.link_color=d(i,"link");h.active_color=d(i,"alink")}return h},_dataToHtml:function(g){var f,d,h,j,k,e=this.editor.dom;function c(n,l,m){n.attr(l,m?m:undefined)}function i(l){if(d.firstChild){d.insert(l,d.firstChild)}else{d.append(l)}}f=this._parseHeader();d=f.getAll("head")[0];if(!d){j=f.getAll("html")[0];d=new a("head",1);if(j.firstChild){j.insert(d,j.firstChild,true)}else{j.append(d)}}j=f.firstChild;if(g.xml_pi){k='version="1.0"';if(g.docencoding){k+=' encoding="'+g.docencoding+'"'}if(j.type!=7){j=new a("xml",7);f.insert(j,f.firstChild,true)}j.value=k}else{if(j&&j.type==7){j.remove()}}j=f.getAll("#doctype")[0];if(g.doctype){if(!j){j=new a("#doctype",10);if(g.xml_pi){f.insert(j,f.firstChild)}else{i(j)}}j.value=g.doctype.substring(9,g.doctype.length-1)}else{if(j){j.remove()}}j=f.getAll("title")[0];if(g.metatitle){if(!j){j=new a("title",1);j.append(new a("#text",3)).value=g.metatitle;i(j)}}if(g.docencoding){j=null;b(f.getAll("meta"),function(l){if(l.attr("http-equiv")=="Content-Type"){j=l}});if(!j){j=new a("meta",1);j.attr("http-equiv","Content-Type");j.shortEnded=true;i(j)}j.attr("content","text/html; charset="+g.docencoding)}b("keywords,description,author,copyright,robots".split(","),function(m){var l=f.getAll("meta"),n,p,o=g["meta"+m];for(n=0;n"))},_parseHeader:function(){return new tinymce.html.DomParser({validate:false,root_name:"#document"}).parse(this.head)},_setContent:function(g,d){var m=this,i,c,h=d.content,f,l="",e=m.editor.dom,j;function k(n){return n.replace(/<\/?[A-Z]+/g,function(o){return o.toLowerCase()})}if(d.format=="raw"&&m.head){return}if(d.source_view&&g.getParam("fullpage_hide_in_source_view")){return}h=h.replace(/<(\/?)BODY/gi,"<$1body");i=h.indexOf("",i);m.head=k(h.substring(0,i+1));c=h.indexOf("\n"}f=m._parseHeader();b(f.getAll("style"),function(n){if(n.firstChild){l+=n.firstChild.value}});j=f.getAll("body")[0];if(j){e.setAttribs(m.editor.getBody(),{style:j.attr("style")||"",dir:j.attr("dir")||"",vLink:j.attr("vlink")||"",link:j.attr("link")||"",aLink:j.attr("alink")||""})}e.remove("fullpage_styles");if(l){e.add(m.editor.getDoc().getElementsByTagName("head")[0],"style",{id:"fullpage_styles"},l);j=e.get("fullpage_styles");if(j.styleSheet){j.styleSheet.cssText=l}}},_getDefaultHeader:function(){var f="",c=this.editor,e,d="";if(c.getParam("fullpage_default_xml_pi")){f+='\n'}f+=c.getParam("fullpage_default_doctype",'');f+="\n\n\n";if(e=c.getParam("fullpage_default_title")){f+=""+e+"\n"}if(e=c.getParam("fullpage_default_encoding")){f+='\n'}if(e=c.getParam("fullpage_default_font_family")){d+="font-family: "+e+";"}if(e=c.getParam("fullpage_default_font_size")){d+="font-size: "+e+";"}if(e=c.getParam("fullpage_default_text_color")){d+="color: "+e+";"}f+="\n\n";return f},_getContent:function(d,e){var c=this;if(!e.source_view||!d.getParam("fullpage_hide_in_source_view")){e.content=tinymce.trim(c.head)+"\n"+tinymce.trim(e.content)+"\n"+tinymce.trim(c.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/editor_plugin_src.js deleted file mode 100644 index 8b49c44644a5..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/editor_plugin_src.js +++ /dev/null @@ -1,405 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var each = tinymce.each, Node = tinymce.html.Node; - - tinymce.create('tinymce.plugins.FullPagePlugin', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceFullPageProperties', function() { - ed.windowManager.open({ - file : url + '/fullpage.htm', - width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)), - height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)), - inline : 1 - }, { - plugin_url : url, - data : t._htmlToData() - }); - }); - - // Register buttons - ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'}); - - ed.onBeforeSetContent.add(t._setContent, t); - ed.onGetContent.add(t._getContent, t); - }, - - getInfo : function() { - return { - longname : 'Fullpage', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private plugin internal methods - - _htmlToData : function() { - var headerFragment = this._parseHeader(), data = {}, nodes, elm, matches, editor = this.editor; - - function getAttr(elm, name) { - var value = elm.attr(name); - - return value || ''; - }; - - // Default some values - data.fontface = editor.getParam("fullpage_default_fontface", ""); - data.fontsize = editor.getParam("fullpage_default_fontsize", ""); - - // Parse XML PI - elm = headerFragment.firstChild; - if (elm.type == 7) { - data.xml_pi = true; - matches = /encoding="([^"]+)"/.exec(elm.value); - if (matches) - data.docencoding = matches[1]; - } - - // Parse doctype - elm = headerFragment.getAll('#doctype')[0]; - if (elm) - data.doctype = '"; - - // Parse title element - elm = headerFragment.getAll('title')[0]; - if (elm && elm.firstChild) { - data.metatitle = elm.firstChild.value; - } - - // Parse meta elements - each(headerFragment.getAll('meta'), function(meta) { - var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches; - - if (name) - data['meta' + name.toLowerCase()] = meta.attr('content'); - else if (httpEquiv == "Content-Type") { - matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content')); - - if (matches) - data.docencoding = matches[1]; - } - }); - - // Parse html attribs - elm = headerFragment.getAll('html')[0]; - if (elm) - data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang'); - - // Parse stylesheet - elm = headerFragment.getAll('link')[0]; - if (elm && elm.attr('rel') == 'stylesheet') - data.stylesheet = elm.attr('href'); - - // Parse body parts - elm = headerFragment.getAll('body')[0]; - if (elm) { - data.langdir = getAttr(elm, 'dir'); - data.style = getAttr(elm, 'style'); - data.visited_color = getAttr(elm, 'vlink'); - data.link_color = getAttr(elm, 'link'); - data.active_color = getAttr(elm, 'alink'); - } - - return data; - }, - - _dataToHtml : function(data) { - var headerFragment, headElement, html, elm, value, dom = this.editor.dom; - - function setAttr(elm, name, value) { - elm.attr(name, value ? value : undefined); - }; - - function addHeadNode(node) { - if (headElement.firstChild) - headElement.insert(node, headElement.firstChild); - else - headElement.append(node); - }; - - headerFragment = this._parseHeader(); - headElement = headerFragment.getAll('head')[0]; - if (!headElement) { - elm = headerFragment.getAll('html')[0]; - headElement = new Node('head', 1); - - if (elm.firstChild) - elm.insert(headElement, elm.firstChild, true); - else - elm.append(headElement); - } - - // Add/update/remove XML-PI - elm = headerFragment.firstChild; - if (data.xml_pi) { - value = 'version="1.0"'; - - if (data.docencoding) - value += ' encoding="' + data.docencoding + '"'; - - if (elm.type != 7) { - elm = new Node('xml', 7); - headerFragment.insert(elm, headerFragment.firstChild, true); - } - - elm.value = value; - } else if (elm && elm.type == 7) - elm.remove(); - - // Add/update/remove doctype - elm = headerFragment.getAll('#doctype')[0]; - if (data.doctype) { - if (!elm) { - elm = new Node('#doctype', 10); - - if (data.xml_pi) - headerFragment.insert(elm, headerFragment.firstChild); - else - addHeadNode(elm); - } - - elm.value = data.doctype.substring(9, data.doctype.length - 1); - } else if (elm) - elm.remove(); - - // Add/update/remove title - elm = headerFragment.getAll('title')[0]; - if (data.metatitle) { - if (!elm) { - elm = new Node('title', 1); - elm.append(new Node('#text', 3)).value = data.metatitle; - addHeadNode(elm); - } - } - - // Add meta encoding - if (data.docencoding) { - elm = null; - each(headerFragment.getAll('meta'), function(meta) { - if (meta.attr('http-equiv') == 'Content-Type') - elm = meta; - }); - - if (!elm) { - elm = new Node('meta', 1); - elm.attr('http-equiv', 'Content-Type'); - elm.shortEnded = true; - addHeadNode(elm); - } - - elm.attr('content', 'text/html; charset=' + data.docencoding); - } - - // Add/update/remove meta - each('keywords,description,author,copyright,robots'.split(','), function(name) { - var nodes = headerFragment.getAll('meta'), i, meta, value = data['meta' + name]; - - for (i = 0; i < nodes.length; i++) { - meta = nodes[i]; - - if (meta.attr('name') == name) { - if (value) - meta.attr('content', value); - else - meta.remove(); - - return; - } - } - - if (value) { - elm = new Node('meta', 1); - elm.attr('name', name); - elm.attr('content', value); - elm.shortEnded = true; - - addHeadNode(elm); - } - }); - - // Add/update/delete link - elm = headerFragment.getAll('link')[0]; - if (elm && elm.attr('rel') == 'stylesheet') { - if (data.stylesheet) - elm.attr('href', data.stylesheet); - else - elm.remove(); - } else if (data.stylesheet) { - elm = new Node('link', 1); - elm.attr({ - rel : 'stylesheet', - text : 'text/css', - href : data.stylesheet - }); - elm.shortEnded = true; - - addHeadNode(elm); - } - - // Update body attributes - elm = headerFragment.getAll('body')[0]; - if (elm) { - setAttr(elm, 'dir', data.langdir); - setAttr(elm, 'style', data.style); - setAttr(elm, 'vlink', data.visited_color); - setAttr(elm, 'link', data.link_color); - setAttr(elm, 'alink', data.active_color); - - // Update iframe body as well - dom.setAttribs(this.editor.getBody(), { - style : data.style, - dir : data.dir, - vLink : data.visited_color, - link : data.link_color, - aLink : data.active_color - }); - } - - // Set html attributes - elm = headerFragment.getAll('html')[0]; - if (elm) { - setAttr(elm, 'lang', data.langcode); - setAttr(elm, 'xml:lang', data.langcode); - } - - // Serialize header fragment and crop away body part - html = new tinymce.html.Serializer({ - validate: false, - indent: true, - apply_source_formatting : true, - indent_before: 'head,html,body,meta,title,script,link,style', - indent_after: 'head,html,body,meta,title,script,link,style' - }).serialize(headerFragment); - - this.head = html.substring(0, html.indexOf('')); - }, - - _parseHeader : function() { - // Parse the contents with a DOM parser - return new tinymce.html.DomParser({ - validate: false, - root_name: '#document' - }).parse(this.head); - }, - - _setContent : function(ed, o) { - var self = this, startPos, endPos, content = o.content, headerFragment, styles = '', dom = self.editor.dom, elm; - - function low(s) { - return s.replace(/<\/?[A-Z]+/g, function(a) { - return a.toLowerCase(); - }) - }; - - // Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate - if (o.format == 'raw' && self.head) - return; - - if (o.source_view && ed.getParam('fullpage_hide_in_source_view')) - return; - - // Parse out head, body and footer - content = content.replace(/<(\/?)BODY/gi, '<$1body'); - startPos = content.indexOf('', startPos); - self.head = low(content.substring(0, startPos + 1)); - - endPos = content.indexOf('\n'; - - header += editor.getParam('fullpage_default_doctype', ''); - header += '\n\n\n'; - - if (value = editor.getParam('fullpage_default_title')) - header += '' + value + '\n'; - - if (value = editor.getParam('fullpage_default_encoding')) - header += '\n'; - - if (value = editor.getParam('fullpage_default_font_family')) - styles += 'font-family: ' + value + ';'; - - if (value = editor.getParam('fullpage_default_font_size')) - styles += 'font-size: ' + value + ';'; - - if (value = editor.getParam('fullpage_default_text_color')) - styles += 'color: ' + value + ';'; - - header += '\n\n'; - - return header; - }, - - _getContent : function(ed, o) { - var self = this; - - if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view')) - o.content = tinymce.trim(self.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(self.foot); - } - }); - - // Register plugin - tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin); -})(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/fullpage.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/fullpage.htm deleted file mode 100644 index 200f2b8e6cd2..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/fullpage.htm +++ /dev/null @@ -1,259 +0,0 @@ - - - - {#fullpage_dlg.title} - - - - - - - -
- - -
-
-
- {#fullpage_dlg.meta_props} - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
 
 
 
 
  - -
-
- -
- {#fullpage_dlg.langprops} - - - - - - - - - - - - - - - - - - - - - - -
- -
  - -
 
- -
 
-
-
- -
-
- {#fullpage_dlg.appearance_textprops} - - - - - - - - - - - - - - - - -
- -
- -
- - - - - -
 
-
-
- -
- {#fullpage_dlg.appearance_bgprops} - - - - - - - - - - -
- - - - - -
 
-
- - - - - -
 
-
-
- -
- {#fullpage_dlg.appearance_marginprops} - - - - - - - - - - - - - - -
-
- -
- {#fullpage_dlg.appearance_linkprops} - - - - - - - - - - - - - - - - - -
- - - - - -
-
- - - - - -
 
-
- - - - - -
 
-
  
-
- -
- {#fullpage_dlg.appearance_style} - - - - - - - - - - -
- - - - -
 
-
-
-
- -
- - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/js/fullpage.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/js/fullpage.js deleted file mode 100644 index 66eec2d7b404..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/js/fullpage.js +++ /dev/null @@ -1,232 +0,0 @@ -/** - * fullpage.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinyMCEPopup.requireLangPack(); - - var defaultDocTypes = - 'XHTML 1.0 Transitional=,' + - 'XHTML 1.0 Frameset=,' + - 'XHTML 1.0 Strict=,' + - 'XHTML 1.1=,' + - 'HTML 4.01 Transitional=,' + - 'HTML 4.01 Strict=,' + - 'HTML 4.01 Frameset='; - - var defaultEncodings = - 'Western european (iso-8859-1)=iso-8859-1,' + - 'Central European (iso-8859-2)=iso-8859-2,' + - 'Unicode (UTF-8)=utf-8,' + - 'Chinese traditional (Big5)=big5,' + - 'Cyrillic (iso-8859-5)=iso-8859-5,' + - 'Japanese (iso-2022-jp)=iso-2022-jp,' + - 'Greek (iso-8859-7)=iso-8859-7,' + - 'Korean (iso-2022-kr)=iso-2022-kr,' + - 'ASCII (us-ascii)=us-ascii'; - - var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings'; - var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px'; - - function setVal(id, value) { - var elm = document.getElementById(id); - - if (elm) { - value = value || ''; - - if (elm.nodeName == "SELECT") - selectByValue(document.forms[0], id, value); - else if (elm.type == "checkbox") - elm.checked = !!value; - else - elm.value = value; - } - }; - - function getVal(id) { - var elm = document.getElementById(id); - - if (elm.nodeName == "SELECT") - return elm.options[elm.selectedIndex].value; - - if (elm.type == "checkbox") - return elm.checked; - - return elm.value; - }; - - window.FullPageDialog = { - changedStyle : function() { - var val, styles = tinyMCEPopup.editor.dom.parseStyle(getVal('style')); - - setVal('fontface', styles['font-face']); - setVal('fontsize', styles['font-size']); - setVal('textcolor', styles['color']); - - if (val = styles['background-image']) - setVal('bgimage', val.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1")); - else - setVal('bgimage', ''); - - setVal('bgcolor', styles['background-color']); - - // Reset margin form elements - setVal('topmargin', ''); - setVal('rightmargin', ''); - setVal('bottommargin', ''); - setVal('leftmargin', ''); - - // Expand margin - if (val = styles['margin']) { - val = val.split(' '); - styles['margin-top'] = val[0] || ''; - styles['margin-right'] = val[1] || val[0] || ''; - styles['margin-bottom'] = val[2] || val[0] || ''; - styles['margin-left'] = val[3] || val[0] || ''; - } - - if (val = styles['margin-top']) - setVal('topmargin', val.replace(/px/, '')); - - if (val = styles['margin-right']) - setVal('rightmargin', val.replace(/px/, '')); - - if (val = styles['margin-bottom']) - setVal('bottommargin', val.replace(/px/, '')); - - if (val = styles['margin-left']) - setVal('leftmargin', val.replace(/px/, '')); - - updateColor('bgcolor_pick', 'bgcolor'); - updateColor('textcolor_pick', 'textcolor'); - }, - - changedStyleProp : function() { - var val, dom = tinyMCEPopup.editor.dom, styles = dom.parseStyle(getVal('style')); - - styles['font-face'] = getVal('fontface'); - styles['font-size'] = getVal('fontsize'); - styles['color'] = getVal('textcolor'); - styles['background-color'] = getVal('bgcolor'); - - if (val = getVal('bgimage')) - styles['background-image'] = "url('" + val + "')"; - else - styles['background-image'] = ''; - - delete styles['margin']; - - if (val = getVal('topmargin')) - styles['margin-top'] = val + "px"; - else - styles['margin-top'] = ''; - - if (val = getVal('rightmargin')) - styles['margin-right'] = val + "px"; - else - styles['margin-right'] = ''; - - if (val = getVal('bottommargin')) - styles['margin-bottom'] = val + "px"; - else - styles['margin-bottom'] = ''; - - if (val = getVal('leftmargin')) - styles['margin-left'] = val + "px"; - else - styles['margin-left'] = ''; - - // Serialize, parse and reserialize this will compress redundant styles - setVal('style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(styles)))); - this.changedStyle(); - }, - - update : function() { - var data = {}; - - tinymce.each(tinyMCEPopup.dom.select('select,input,textarea'), function(node) { - data[node.id] = getVal(node.id); - }); - - tinyMCEPopup.editor.plugins.fullpage._dataToHtml(data); - tinyMCEPopup.close(); - } - }; - - function init() { - var form = document.forms[0], i, item, list, editor = tinyMCEPopup.editor; - - // Setup doctype select box - list = editor.getParam("fullpage_doctypes", defaultDocTypes).split(','); - for (i = 0; i < list.length; i++) { - item = list[i].split('='); - - if (item.length > 1) - addSelectValue(form, 'doctype', item[0], item[1]); - } - - // Setup fonts select box - list = editor.getParam("fullpage_fonts", defaultFontNames).split(';'); - for (i = 0; i < list.length; i++) { - item = list[i].split('='); - - if (item.length > 1) - addSelectValue(form, 'fontface', item[0], item[1]); - } - - // Setup fontsize select box - list = editor.getParam("fullpage_fontsizes", defaultFontSizes).split(','); - for (i = 0; i < list.length; i++) - addSelectValue(form, 'fontsize', list[i], list[i]); - - // Setup encodings select box - list = editor.getParam("fullpage_encodings", defaultEncodings).split(','); - for (i = 0; i < list.length; i++) { - item = list[i].split('='); - - if (item.length > 1) - addSelectValue(form, 'docencoding', item[0], item[1]); - } - - // Setup color pickers - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color'); - document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color'); - document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color'); - document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor'); - document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage'); - document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage'); - - // Resize some elements - if (isVisible('stylesheetbrowser')) - document.getElementById('stylesheet').style.width = '220px'; - - if (isVisible('link_href_browser')) - document.getElementById('element_link_href').style.width = '230px'; - - if (isVisible('bgimage_browser')) - document.getElementById('bgimage').style.width = '210px'; - - // Update form - tinymce.each(tinyMCEPopup.getWindowArg('data'), function(value, key) { - setVal(key, value); - }); - - FullPageDialog.changedStyle(); - - // Update colors - updateColor('textcolor_pick', 'textcolor'); - updateColor('bgcolor_pick', 'bgcolor'); - updateColor('visited_color_pick', 'visited_color'); - updateColor('active_color_pick', 'active_color'); - updateColor('link_color_pick', 'link_color'); - }; - - tinyMCEPopup.onInit.add(init); -})(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/langs/en_dlg.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/langs/en_dlg.js deleted file mode 100644 index 516edc74fd43..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/langs/en_dlg.js +++ /dev/null @@ -1 +0,0 @@ -tinyMCE.addI18n('en.fullpage_dlg',{title:"Document Properties","meta_tab":"General","appearance_tab":"Appearance","advanced_tab":"Advanced","meta_props":"Meta Information",langprops:"Language and Encoding","meta_title":"Title","meta_keywords":"Keywords","meta_description":"Description","meta_robots":"Robots",doctypes:"Doctype",langcode:"Language Code",langdir:"Language Direction",ltr:"Left to Right",rtl:"Right to Left","xml_pi":"XML Declaration",encoding:"Character Encoding","appearance_bgprops":"Background Properties","appearance_marginprops":"Body Margins","appearance_linkprops":"Link Colors","appearance_textprops":"Text Properties",bgcolor:"Background Color",bgimage:"Background Image","left_margin":"Left Margin","right_margin":"Right Margin","top_margin":"Top Margin","bottom_margin":"Bottom Margin","text_color":"Text Color","font_size":"Font Size","font_face":"Font Face","link_color":"Link Color","hover_color":"Hover Color","visited_color":"Visited Color","active_color":"Active Color",textcolor:"Color",fontsize:"Font Size",fontface:"Font Family","meta_index_follow":"Index and Follow the Links","meta_index_nofollow":"Index and Don\'t Follow the Links","meta_noindex_follow":"Do Not Index but Follow the Links","meta_noindex_nofollow":"Do Not Index and Don\'t Follow the Links","appearance_style":"Stylesheet and Style Properties",stylesheet:"Stylesheet",style:"Style",author:"Author",copyright:"Copyright",add:"Add New Element",remove:"Remove Selected Element",moveup:"Move Selected Element Up",movedown:"Move Selected Element Down","head_elements":"Head Elements",info:"Information","add_title":"Title Element","add_meta":"Meta Element","add_script":"Script Element","add_style":"Style Element","add_link":"Link Element","add_base":"Base Element","add_comment":"Comment Node","title_element":"Title Element","script_element":"Script Element","style_element":"Style Element","base_element":"Base Element","link_element":"Link Element","meta_element":"Meta Element","comment_element":"Comment",src:"Source",language:"Language",href:"HREF",target:"Target",type:"Type",charset:"Charset",defer:"Defer",media:"Media",properties:"Properties",name:"Name",value:"Value",content:"Content",rel:"Rel",rev:"Rev",hreflang:"HREF Lang","general_props":"General","advanced_props":"Advanced"}); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullscreen/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullscreen/editor_plugin.js deleted file mode 100644 index a6456f89dd86..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullscreen/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent());tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent());d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().firstChild);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullscreen/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullscreen/editor_plugin_src.js deleted file mode 100644 index 42af070ae980..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullscreen/editor_plugin_src.js +++ /dev/null @@ -1,159 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var DOM = tinymce.DOM; - - tinymce.create('tinymce.plugins.FullScreenPlugin', { - init : function(ed, url) { - var t = this, s = {}, vp, posCss; - - t.editor = ed; - - // Register commands - ed.addCommand('mceFullScreen', function() { - var win, de = DOM.doc.documentElement; - - if (ed.getParam('fullscreen_is_enabled')) { - if (ed.getParam('fullscreen_new_window')) - closeFullscreen(); // Call to close in new window - else { - DOM.win.setTimeout(function() { - tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc); - tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent()); - tinyMCE.remove(ed); - DOM.remove('mce_fullscreen_container'); - de.style.overflow = ed.getParam('fullscreen_html_overflow'); - DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow')); - DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly')); - tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings - }, 10); - } - - return; - } - - if (ed.getParam('fullscreen_new_window')) { - win = DOM.win.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight); - try { - win.resizeTo(screen.availWidth, screen.availHeight); - } catch (e) { - // Ignore - } - } else { - tinyMCE.oldSettings = tinyMCE.settings; // Store old settings - s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto'; - s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1); - vp = DOM.getViewPort(); - s.fullscreen_scrollx = vp.x; - s.fullscreen_scrolly = vp.y; - - // Fixes an Opera bug where the scrollbars doesn't reappear - if (tinymce.isOpera && s.fullscreen_overflow == 'visible') - s.fullscreen_overflow = 'auto'; - - // Fixes an IE bug where horizontal scrollbars would appear - if (tinymce.isIE && s.fullscreen_overflow == 'scroll') - s.fullscreen_overflow = 'auto'; - - // Fixes an IE bug where the scrollbars doesn't reappear - if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll')) - s.fullscreen_html_overflow = 'auto'; - - if (s.fullscreen_overflow == '0px') - s.fullscreen_overflow = ''; - - DOM.setStyle(DOM.doc.body, 'overflow', 'hidden'); - de.style.overflow = 'hidden'; //Fix for IE6/7 - vp = DOM.getViewPort(); - DOM.win.scrollTo(0, 0); - - if (tinymce.isIE) - vp.h -= 1; - - // Use fixed position if it exists - if (tinymce.isIE6) - posCss = 'absolute;top:' + vp.y; - else - posCss = 'fixed;top:0'; - - n = DOM.add(DOM.doc.body, 'div', { - id : 'mce_fullscreen_container', - style : 'position:' + posCss + ';left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'}); - DOM.add(n, 'div', {id : 'mce_fullscreen'}); - - tinymce.each(ed.settings, function(v, n) { - s[n] = v; - }); - - s.id = 'mce_fullscreen'; - s.width = n.clientWidth; - s.height = n.clientHeight - 15; - s.fullscreen_is_enabled = true; - s.fullscreen_editor_id = ed.id; - s.theme_advanced_resizing = false; - s.save_onsavecallback = function() { - ed.setContent(tinyMCE.get(s.id).getContent()); - ed.execCommand('mceSave'); - }; - - tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) { - s[k] = v; - }); - - if (s.theme_advanced_toolbar_location === 'external') - s.theme_advanced_toolbar_location = 'top'; - - t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s); - t.fullscreenEditor.onInit.add(function() { - t.fullscreenEditor.setContent(ed.getContent()); - t.fullscreenEditor.focus(); - }); - - t.fullscreenEditor.render(); - - t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container'); - t.fullscreenElement.update(); - //document.body.overflow = 'hidden'; - - t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() { - var vp = tinymce.DOM.getViewPort(), fed = t.fullscreenEditor, outerSize, innerSize; - - // Get outer/inner size to get a delta size that can be used to calc the new iframe size - outerSize = fed.dom.getSize(fed.getContainer().firstChild); - innerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]); - - fed.theme.resizeTo(vp.w - outerSize.w + innerSize.w, vp.h - outerSize.h + innerSize.h); - }); - } - }); - - // Register buttons - ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'}); - - ed.onNodeChange.add(function(ed, cm) { - cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled')); - }); - }, - - getInfo : function() { - return { - longname : 'Fullscreen', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullscreen/fullscreen.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullscreen/fullscreen.htm deleted file mode 100644 index 496a2f62938f..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullscreen/fullscreen.htm +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - -
- -
- - - - - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/iespell/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/iespell/editor_plugin.js deleted file mode 100644 index e9cba106c609..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/iespell/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.IESpell",{init:function(a,b){var c=this,d;if(!tinymce.isIE){return}c.editor=a;a.addCommand("mceIESpell",function(){try{d=new ActiveXObject("ieSpell.ieSpellExtension");d.CheckDocumentNode(a.getDoc().documentElement)}catch(f){if(f.number==-2146827859){a.windowManager.confirm(a.getLang("iespell.download"),function(e){if(e){window.open("http://www.iespell.com/download.php","ieSpellDownload","")}})}else{a.windowManager.alert("Error Loading ieSpell: Exception "+f.number)}}});a.addButton("iespell",{title:"iespell.iespell_desc",cmd:"mceIESpell"})},getInfo:function(){return{longname:"IESpell (IE Only)",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("iespell",tinymce.plugins.IESpell)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/iespell/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/iespell/editor_plugin_src.js deleted file mode 100644 index 61edf1e23d4d..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/iespell/editor_plugin_src.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.IESpell', { - init : function(ed, url) { - var t = this, sp; - - if (!tinymce.isIE) - return; - - t.editor = ed; - - // Register commands - ed.addCommand('mceIESpell', function() { - try { - sp = new ActiveXObject("ieSpell.ieSpellExtension"); - sp.CheckDocumentNode(ed.getDoc().documentElement); - } catch (e) { - if (e.number == -2146827859) { - ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) { - if (s) - window.open('http://www.iespell.com/download.php', 'ieSpellDownload', ''); - }); - } else - ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number); - } - }); - - // Register buttons - ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'}); - }, - - getInfo : function() { - return { - longname : 'IESpell (IE Only)', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/editor_plugin.js deleted file mode 100644 index b2d8cdef8d6d..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=1000;g.count=0;g.windows={}},open:function(s,j){var z=this,i,k="",r=z.editor,g=0,v=0,h,m,o,q,l,x,y,n;s=s||{};j=j||{};if(!s.inline){return z.parent(s,j)}n=z._frontWindow();if(n&&d.get(n.id+"_ifr")){n.focussedElement=d.get(n.id+"_ifr").contentWindow.document.activeElement}if(!s.type){z.bookmark=r.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();s.width=parseInt(s.width||320);s.height=parseInt(s.height||240)+(tinymce.isIE?8:0);s.min_width=parseInt(s.min_width||150);s.min_height=parseInt(s.min_height||100);s.max_width=parseInt(s.max_width||2000);s.max_height=parseInt(s.max_height||2000);s.left=s.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(s.width/2)));s.top=s.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(s.height/2)));s.movable=s.resizable=true;j.mce_width=s.width;j.mce_height=s.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=s.auto_focus;z.features=s;z.params=j;z.onOpen.dispatch(z,s,j);if(s.type){k+=" mceModal";if(s.type){k+=" mce"+s.type.substring(0,1).toUpperCase()+s.type.substring(1)}s.resizable=false}if(s.statusbar){k+=" mceStatusbar"}if(s.resizable){k+=" mceResizable"}if(s.minimizable){k+=" mceMinimizable"}if(s.maximizable){k+=" mceMaximizable"}if(s.movable){k+=" mceMovable"}z._addAll(d.doc.body,["div",{id:i,role:"dialog","aria-labelledby":s.type?i+"_content":i+"_title","class":(r.settings.inlinepopups_skin||"clearlooks2")+(tinymce.isIE&&window.getSelection?" ie9":""),style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},s.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft",tabindex:"0"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight",tabindex:"0"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!s.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;v+=d.get(i+"_top").clientHeight;v+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:s.top,left:s.left,width:s.width+g,height:s.height+v});y=s.url||s.file;if(y){if(tinymce.relaxedDomain){y+=(y.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}y=tinymce._addVer(y)}if(!s.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:s.width,height:s.height});d.setAttrib(i+"_ifr","src",y)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(s.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",s.content.replace("\n","
"));a.add(i,"keyup",function(f){var p=27;if(f.keyCode===p){s.button_func(false);return a.cancel(f)}});a.add(i,"keydown",function(f){var t,p=9;if(f.keyCode===p){t=d.select("a.mceCancel",i+"_wrapper")[0];if(t&&t!==f.target){t.focus()}else{d.get(i+"_ok").focus()}return a.cancel(f)}})}o=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=z.windows[i];z.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceClose"){z.close(null,i);return a.cancel(t)}else{if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return z._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return z._startDrag(i,t,u.className.substring(13))}}}}}}});q=a.add(i,"click",function(f){var p=f.target;z.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":z.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":s.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});a.add([i+"_left",i+"_right"],"focus",function(p){var t=d.get(i+"_ifr");if(t){var f=t.contentWindow.document.body;var u=d.select(":input:enabled,*[tabindex=0]",f);if(p.target.id===(i+"_left")){u[u.length-1].focus()}else{u[0].focus()}}else{d.get(i+"_ok").focus()}});x=z.windows[i]={id:i,mousedown_func:o,click_func:q,element:new b(i,{blocker:1,container:r.getContainer()}),iframeElement:new b(i+"_ifr"),features:s,deltaWidth:g,deltaHeight:v};x.iframeElement.on("focus",function(){z.focus(i)});if(z.count==0&&z.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(z.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:z.zIndex-1}});d.show("mceModalBlocker");d.setAttrib(d.doc.body,"aria-hidden","true")}else{d.setStyle("mceModalBlocker","z-index",z.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}d.setAttrib(i,"aria-hidden","false");z.focus(i);z._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}z.count++;return x},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h;if(f.focussedElement){f.focussedElement.focus()}else{if(d.get(h+"_ok")){d.get(f.id+"_ok").focus()}else{if(d.get(f.id+"_ifr")){d.get(f.id+"_ifr").focus()}}}}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;gf){g=h;f=h.zIndex}});return g},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/editor_plugin_src.js deleted file mode 100644 index 770dd2bda672..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +++ /dev/null @@ -1,712 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is; - - tinymce.create('tinymce.plugins.InlinePopups', { - init : function(ed, url) { - // Replace window manager - ed.onBeforeRenderUI.add(function() { - ed.windowManager = new tinymce.InlineWindowManager(ed); - DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css"); - }); - }, - - getInfo : function() { - return { - longname : 'InlinePopups', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', { - InlineWindowManager : function(ed) { - var t = this; - - t.parent(ed); - t.zIndex = t.getMaxZIndex(); - t.count = 0; - t.windows = {}; - }, - - open : function(f, p) { - var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u, parentWindow; - - f = f || {}; - p = p || {}; - - // Run native windows - if (!f.inline) - return t.parent(f, p); - - parentWindow = t._frontWindow(); - if (parentWindow && DOM.get(parentWindow.id + '_ifr')) { - parentWindow.focussedElement = DOM.get(parentWindow.id + '_ifr').contentWindow.document.activeElement; - } - - // Only store selection if the type is a normal window - if (!f.type) - t.bookmark = ed.selection.getBookmark(1); - - id = DOM.uniqueId(); - vp = DOM.getViewPort(); - f.width = parseInt(f.width || 320); - f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0); - f.min_width = parseInt(f.min_width || 150); - f.min_height = parseInt(f.min_height || 100); - f.max_width = parseInt(f.max_width || 2000); - f.max_height = parseInt(f.max_height || 2000); - f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0))); - f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0))); - f.movable = f.resizable = true; - p.mce_width = f.width; - p.mce_height = f.height; - p.mce_inline = true; - p.mce_window_id = id; - p.mce_auto_focus = f.auto_focus; - - // Transpose -// po = DOM.getPos(ed.getContainer()); -// f.left -= po.x; -// f.top -= po.y; - - t.features = f; - t.params = p; - t.onOpen.dispatch(t, f, p); - - if (f.type) { - opt += ' mceModal'; - - if (f.type) - opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1); - - f.resizable = false; - } - - if (f.statusbar) - opt += ' mceStatusbar'; - - if (f.resizable) - opt += ' mceResizable'; - - if (f.minimizable) - opt += ' mceMinimizable'; - - if (f.maximizable) - opt += ' mceMaximizable'; - - if (f.movable) - opt += ' mceMovable'; - - // Create DOM objects - t._addAll(DOM.doc.body, - ['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'}, - ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt}, - ['div', {id : id + '_top', 'class' : 'mceTop'}, - ['div', {'class' : 'mceLeft'}], - ['div', {'class' : 'mceCenter'}], - ['div', {'class' : 'mceRight'}], - ['span', {id : id + '_title'}, f.title || ''] - ], - - ['div', {id : id + '_middle', 'class' : 'mceMiddle'}, - ['div', {id : id + '_left', 'class' : 'mceLeft', tabindex : '0'}], - ['span', {id : id + '_content'}], - ['div', {id : id + '_right', 'class' : 'mceRight', tabindex : '0'}] - ], - - ['div', {id : id + '_bottom', 'class' : 'mceBottom'}, - ['div', {'class' : 'mceLeft'}], - ['div', {'class' : 'mceCenter'}], - ['div', {'class' : 'mceRight'}], - ['span', {id : id + '_status'}, 'Content'] - ], - - ['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}], - ['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}] - ] - ] - ); - - DOM.setStyles(id, {top : -10000, left : -10000}); - - // Fix gecko rendering bug, where the editors iframe messed with window contents - if (tinymce.isGecko) - DOM.setStyle(id, 'overflow', 'auto'); - - // Measure borders - if (!f.type) { - dw += DOM.get(id + '_left').clientWidth; - dw += DOM.get(id + '_right').clientWidth; - dh += DOM.get(id + '_top').clientHeight; - dh += DOM.get(id + '_bottom').clientHeight; - } - - // Resize window - DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh}); - - u = f.url || f.file; - if (u) { - if (tinymce.relaxedDomain) - u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain; - - u = tinymce._addVer(u); - } - - if (!f.type) { - DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'}); - DOM.setStyles(id + '_ifr', {width : f.width, height : f.height}); - DOM.setAttrib(id + '_ifr', 'src', u); - } else { - DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok'); - - if (f.type == 'confirm') - DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel'); - - DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'}); - DOM.setHTML(id + '_content', f.content.replace('\n', '
')); - - Event.add(id, 'keyup', function(evt) { - var VK_ESCAPE = 27; - if (evt.keyCode === VK_ESCAPE) { - f.button_func(false); - return Event.cancel(evt); - } - }); - - Event.add(id, 'keydown', function(evt) { - var cancelButton, VK_TAB = 9; - if (evt.keyCode === VK_TAB) { - cancelButton = DOM.select('a.mceCancel', id + '_wrapper')[0]; - if (cancelButton && cancelButton !== evt.target) { - cancelButton.focus(); - } else { - DOM.get(id + '_ok').focus(); - } - return Event.cancel(evt); - } - }); - } - - // Register events - mdf = Event.add(id, 'mousedown', function(e) { - var n = e.target, w, vp; - - w = t.windows[id]; - t.focus(id); - - if (n.nodeName == 'A' || n.nodeName == 'a') { - if (n.className == 'mceClose') { - t.close(null, id); - return Event.cancel(e); - } else if (n.className == 'mceMax') { - w.oldPos = w.element.getXY(); - w.oldSize = w.element.getSize(); - - vp = DOM.getViewPort(); - - // Reduce viewport size to avoid scrollbars - vp.w -= 2; - vp.h -= 2; - - w.element.moveTo(vp.x, vp.y); - w.element.resizeTo(vp.w, vp.h); - DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight}); - DOM.addClass(id + '_wrapper', 'mceMaximized'); - } else if (n.className == 'mceMed') { - // Reset to old size - w.element.moveTo(w.oldPos.x, w.oldPos.y); - w.element.resizeTo(w.oldSize.w, w.oldSize.h); - w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight); - - DOM.removeClass(id + '_wrapper', 'mceMaximized'); - } else if (n.className == 'mceMove') - return t._startDrag(id, e, n.className); - else if (DOM.hasClass(n, 'mceResize')) - return t._startDrag(id, e, n.className.substring(13)); - } - }); - - clf = Event.add(id, 'click', function(e) { - var n = e.target; - - t.focus(id); - - if (n.nodeName == 'A' || n.nodeName == 'a') { - switch (n.className) { - case 'mceClose': - t.close(null, id); - return Event.cancel(e); - - case 'mceButton mceOk': - case 'mceButton mceCancel': - f.button_func(n.className == 'mceButton mceOk'); - return Event.cancel(e); - } - } - }); - - // Make sure the tab order loops within the dialog. - Event.add([id + '_left', id + '_right'], 'focus', function(evt) { - var iframe = DOM.get(id + '_ifr'); - if (iframe) { - var body = iframe.contentWindow.document.body; - var focusable = DOM.select(':input:enabled,*[tabindex=0]', body); - if (evt.target.id === (id + '_left')) { - focusable[focusable.length - 1].focus(); - } else { - focusable[0].focus(); - } - } else { - DOM.get(id + '_ok').focus(); - } - }); - - // Add window - w = t.windows[id] = { - id : id, - mousedown_func : mdf, - click_func : clf, - element : new Element(id, {blocker : 1, container : ed.getContainer()}), - iframeElement : new Element(id + '_ifr'), - features : f, - deltaWidth : dw, - deltaHeight : dh - }; - - w.iframeElement.on('focus', function() { - t.focus(id); - }); - - // Setup blocker - if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') { - DOM.add(DOM.doc.body, 'div', { - id : 'mceModalBlocker', - 'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker', - style : {zIndex : t.zIndex - 1} - }); - - DOM.show('mceModalBlocker'); // Reduces flicker in IE - DOM.setAttrib(DOM.doc.body, 'aria-hidden', 'true'); - } else - DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1); - - if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel)) - DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2}); - - DOM.setAttrib(id, 'aria-hidden', 'false'); - t.focus(id); - t._fixIELayout(id, 1); - - // Focus ok button - if (DOM.get(id + '_ok')) - DOM.get(id + '_ok').focus(); - t.count++; - - return w; - }, - - getMaxZIndex: function() { - var max = 0, i; - var cn = document.body.childNodes; - for (i = 0; i < cn.length; i++) { - var el = cn[i]; - var zIndex = el.nodeType == 1 ? parseInt(el.style.zIndex, 10) || 0 : 0; - if (zIndex < 10000) { - max = Math.max(max, zIndex); - } - } - return max + 10; - }, - - focus : function(id) { - var t = this, w; - - if (w = t.windows[id]) { - w.zIndex = t.getMaxZIndex(); - w.element.setStyle('zIndex', w.zIndex); - w.element.update(); - - id = id + '_wrapper'; - DOM.removeClass(t.lastId, 'mceFocus'); - DOM.addClass(id, 'mceFocus'); - t.lastId = id; - - if (w.focussedElement) { - w.focussedElement.focus(); - } else if (DOM.get(id + '_ok')) { - DOM.get(w.id + '_ok').focus(); - } else if (DOM.get(w.id + '_ifr')) { - DOM.get(w.id + '_ifr').focus(); - } - } - }, - - _addAll : function(te, ne) { - var i, n, t = this, dom = tinymce.DOM; - - if (is(ne, 'string')) - te.appendChild(dom.doc.createTextNode(ne)); - else if (ne.length) { - te = te.appendChild(dom.create(ne[0], ne[1])); - - for (i=2; i ix) { - fw = w; - ix = w.zIndex; - } - }); - return fw; - }, - - setTitle : function(w, ti) { - var e; - - w = this._findId(w); - - if (e = DOM.get(w + '_title')) - e.innerHTML = DOM.encode(ti); - }, - - alert : function(txt, cb, s) { - var t = this, w; - - w = t.open({ - title : t, - type : 'alert', - button_func : function(s) { - if (cb) - cb.call(s || t, s); - - t.close(null, w.id); - }, - content : DOM.encode(t.editor.getLang(txt, txt)), - inline : 1, - width : 400, - height : 130 - }); - }, - - confirm : function(txt, cb, s) { - var t = this, w; - - w = t.open({ - title : t, - type : 'confirm', - button_func : function(s) { - if (cb) - cb.call(s || t, s); - - t.close(null, w.id); - }, - content : DOM.encode(t.editor.getLang(txt, txt)), - inline : 1, - width : 400, - height : 130 - }); - }, - - // Internal functions - - _findId : function(w) { - var t = this; - - if (typeof(w) == 'string') - return w; - - each(t.windows, function(wo) { - var ifr = DOM.get(wo.id + '_ifr'); - - if (ifr && w == ifr.contentWindow) { - w = wo.id; - return false; - } - }); - - return w; - }, - - _fixIELayout : function(id, s) { - var w, img; - - if (!tinymce.isIE6) - return; - - // Fixes the bug where hover flickers and does odd things in IE6 - each(['n','s','w','e','nw','ne','sw','se'], function(v) { - var e = DOM.get(id + '_resize_' + v); - - DOM.setStyles(e, { - width : s ? e.clientWidth : '', - height : s ? e.clientHeight : '', - cursor : DOM.getStyle(e, 'cursor', 1) - }); - - DOM.setStyle(id + "_bottom", 'bottom', '-1px'); - - e = 0; - }); - - // Fixes graphics glitch - if (w = this.windows[id]) { - // Fixes rendering bug after resize - w.element.hide(); - w.element.show(); - - // Forced a repaint of the window - //DOM.get(id).style.filter = ''; - - // IE has a bug where images used in CSS won't get loaded - // sometimes when the cache in the browser is disabled - // This fix tries to solve it by loading the images using the image object - each(DOM.select('div,a', id), function(e, i) { - if (e.currentStyle.backgroundImage != 'none') { - img = new Image(); - img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1'); - } - }); - - DOM.get(id).style.filter = ''; - } - } - }); - - // Register plugin - tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups); -})(); - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif deleted file mode 100644 index 2d43dd0bbe03..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif deleted file mode 100644 index 74d3e5a2a2a7..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif deleted file mode 100644 index f3111bb388d8..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif deleted file mode 100644 index 3b708b9e4ec1..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif deleted file mode 100644 index 938c8638537d..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif deleted file mode 100644 index 2f13ab69c559..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif deleted file mode 100644 index 0b4cc3682a1c..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css deleted file mode 100644 index deecdd2f51b1..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +++ /dev/null @@ -1,90 +0,0 @@ -/* Clearlooks 2 */ - -/* Reset */ -.clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block} - -/* General */ -.clearlooks2 {position:absolute; direction:ltr; z-index:920 !important;} -.clearlooks2 .mceWrapper {position:static} -.mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%} -.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)} -.clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#000; opacity:0.35; -ms-filter:'alpha(opacity=35)'; filter:alpha(opacity=35); display:none; z-index:910 !important;} - -/* Top */ -.clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px} -.clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)} -.clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)} -.clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0} -.clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold} -.clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0} -.clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px} -.clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0} -.clearlooks2 .mceFocus .mceTop span {color:#FFF} - -/* Middle */ -.clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0} -.clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)} -.clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0} -.clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF} -.clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)} - -/* Bottom */ -.clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px} -.clearlooks2 .mceBottom {left:0; bottom:0; width:100%} -.clearlooks2 .mceBottom div {top:0} -.clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px} -.clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px} -.clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0} -.clearlooks2 .mceBottom span {display:none} -.clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px} -.clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0} -.clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px} -.clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0} -.clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px} - -/* Actions */ -.clearlooks2 a {width:29px; height:16px; top:3px;} -.clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0} -.clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0} -.clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0} -.clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0} -.clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px} -.clearlooks2 .mceMovable .mceMove {display:block} -.clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px} -.clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px} -.clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px} -.clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px} -.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} -.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} -.clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px} -.clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px} -.clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px} - -/* Resize */ -.clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px} -.clearlooks2 .mceResizable .mceResize {display:block} -.clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none} -.clearlooks2 .mceMinimizable .mceMin {display:block} -.clearlooks2 .mceMaximizable .mceMax {display:block} -.clearlooks2 .mceMaximized .mceMed {display:block} -.clearlooks2 .mceMaximized .mceMax {display:none} -.clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize} -.clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize} -.clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize} -.clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;} -.clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize} -.clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize} -.clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize} -.clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize} - -/* Alert/Confirm */ -.clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0} -.clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px} -.clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal} -.clearlooks2 a:hover {font-weight:bold;} -.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5} -.clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px} -.clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)} -.clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px} -.clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto} -.clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/template.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/template.htm deleted file mode 100644 index c98fe41a67d2..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/inlinepopups/template.htm +++ /dev/null @@ -1,387 +0,0 @@ - - - -Template for dialogs - - - - -
-
-
-
-
-
-
- Blured -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Focused -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Statusbar -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Statusbar, Resizable -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Resizable, Maximizable -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Blurred, Maximizable, Statusbar, Resizable -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Maximized, Maximizable, Minimizable -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Blured -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Alert -
- -
-
- - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - -
-
-
- -
-
-
-
-
- - - Ok - -
-
- -
-
-
-
-
-
- Confirm -
- -
-
- - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - -
-
-
- -
-
-
-
-
- - - Ok - Cancel - -
-
-
- - - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/insertdatetime/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/insertdatetime/editor_plugin.js deleted file mode 100644 index 938ce6b17d90..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/insertdatetime/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.InsertDateTime",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertDate",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_dateFormat",a.getLang("insertdatetime.date_fmt")));a.execCommand("mceInsertContent",false,d)});a.addCommand("mceInsertTime",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_timeFormat",a.getLang("insertdatetime.time_fmt")));a.execCommand("mceInsertContent",false,d)});a.addButton("insertdate",{title:"insertdatetime.insertdate_desc",cmd:"mceInsertDate"});a.addButton("inserttime",{title:"insertdatetime.inserttime_desc",cmd:"mceInsertTime"})},getInfo:function(){return{longname:"Insert date/time",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getDateTime:function(e,a){var c=this.editor;function b(g,d){g=""+g;if(g.length-1){b[e].style.zIndex=h[k];b[k].style.zIndex=h[e]}else{if(h[e]>0){b[e].style.zIndex=h[e]-1}}}else{for(g=0;gh[e]){k=g;break}}if(k>-1){b[e].style.zIndex=h[k];b[k].style.zIndex=h[e]}else{b[e].style.zIndex=h[e]+1}}c.execCommand("mceRepaint")},_getParentLayer:function(b){return this.editor.dom.getParent(b,function(c){return c.nodeType==1&&/^(absolute|relative|static)$/i.test(c.style.position)})},_insertLayer:function(){var c=this.editor,e=c.dom,d=e.getPos(e.getParent(c.selection.getNode(),"*")),b=c.getBody();c.dom.add(b,"div",{style:{position:"absolute",left:d.x,top:(d.y>20?d.y:20),width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},c.selection.getContent()||c.getLang("layer.content"));if(tinymce.isIE){e.setHTML(b,b.innerHTML)}},_toggleAbsolute:function(){var b=this.editor,c=this._getParentLayer(b.selection.getNode());if(!c){c=b.dom.getParent(b.selection.getNode(),"DIV,P,IMG")}if(c){if(c.style.position.toLowerCase()=="absolute"){b.dom.setStyles(c,{position:"",left:"",top:"",width:"",height:""});b.dom.removeClass(c,"mceItemVisualAid");b.dom.removeClass(c,"mceItemLayer")}else{if(c.style.left==""){c.style.left=20+"px"}if(c.style.top==""){c.style.top=20+"px"}if(c.style.width==""){c.style.width=c.width?(c.width+"px"):"100px"}if(c.style.height==""){c.style.height=c.height?(c.height+"px"):"100px"}c.style.position="absolute";b.dom.setAttrib(c,"data-mce-style","");b.addVisual(b.getBody())}b.execCommand("mceRepaint");b.nodeChanged()}}});tinymce.PluginManager.add("layer",tinymce.plugins.Layer)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/layer/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/layer/editor_plugin_src.js deleted file mode 100644 index d31978bf6089..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/layer/editor_plugin_src.js +++ /dev/null @@ -1,262 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - function findParentLayer(node) { - do { - if (node.className && node.className.indexOf('mceItemLayer') != -1) { - return node; - } - } while (node = node.parentNode); - }; - - tinymce.create('tinymce.plugins.Layer', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceInsertLayer', t._insertLayer, t); - - ed.addCommand('mceMoveForward', function() { - t._move(1); - }); - - ed.addCommand('mceMoveBackward', function() { - t._move(-1); - }); - - ed.addCommand('mceMakeAbsolute', function() { - t._toggleAbsolute(); - }); - - // Register buttons - ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'}); - ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'}); - ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'}); - ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'}); - - ed.onInit.add(function() { - var dom = ed.dom; - - if (tinymce.isIE) - ed.getDoc().execCommand('2D-Position', false, true); - }); - - // Remove serialized styles when selecting a layer since it might be changed by a drag operation - ed.onMouseUp.add(function(ed, e) { - var layer = findParentLayer(e.target); - - if (layer) { - ed.dom.setAttrib(layer, 'data-mce-style', ''); - } - }); - - // Fixes edit focus issues with layers on Gecko - // This will enable designMode while inside a layer and disable it when outside - ed.onMouseDown.add(function(ed, e) { - var node = e.target, doc = ed.getDoc(), parent; - - if (tinymce.isGecko) { - if (findParentLayer(node)) { - if (doc.designMode !== 'on') { - doc.designMode = 'on'; - - // Repaint caret - node = doc.body; - parent = node.parentNode; - parent.removeChild(node); - parent.appendChild(node); - } - } else if (doc.designMode == 'on') { - doc.designMode = 'off'; - } - } - }); - - ed.onNodeChange.add(t._nodeChange, t); - ed.onVisualAid.add(t._visualAid, t); - }, - - getInfo : function() { - return { - longname : 'Layer', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - _nodeChange : function(ed, cm, n) { - var le, p; - - le = this._getParentLayer(n); - p = ed.dom.getParent(n, 'DIV,P,IMG'); - - if (!p) { - cm.setDisabled('absolute', 1); - cm.setDisabled('moveforward', 1); - cm.setDisabled('movebackward', 1); - } else { - cm.setDisabled('absolute', 0); - cm.setDisabled('moveforward', !le); - cm.setDisabled('movebackward', !le); - cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute"); - } - }, - - // Private methods - - _visualAid : function(ed, e, s) { - var dom = ed.dom; - - tinymce.each(dom.select('div,p', e), function(e) { - if (/^(absolute|relative|fixed)$/i.test(e.style.position)) { - if (s) - dom.addClass(e, 'mceItemVisualAid'); - else - dom.removeClass(e, 'mceItemVisualAid'); - - dom.addClass(e, 'mceItemLayer'); - } - }); - }, - - _move : function(d) { - var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl; - - nl = []; - tinymce.walk(ed.getBody(), function(n) { - if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position)) - nl.push(n); - }, 'childNodes'); - - // Find z-indexes - for (i=0; i -1) { - nl[ci].style.zIndex = z[fi]; - nl[fi].style.zIndex = z[ci]; - } else { - if (z[ci] > 0) - nl[ci].style.zIndex = z[ci] - 1; - } - } else { - // Move forward - - // Try find a higher one - for (i=0; i z[ci]) { - fi = i; - break; - } - } - - if (fi > -1) { - nl[ci].style.zIndex = z[fi]; - nl[fi].style.zIndex = z[ci]; - } else - nl[ci].style.zIndex = z[ci] + 1; - } - - ed.execCommand('mceRepaint'); - }, - - _getParentLayer : function(n) { - return this.editor.dom.getParent(n, function(n) { - return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position); - }); - }, - - _insertLayer : function() { - var ed = this.editor, dom = ed.dom, p = dom.getPos(dom.getParent(ed.selection.getNode(), '*')), body = ed.getBody(); - - ed.dom.add(body, 'div', { - style : { - position : 'absolute', - left : p.x, - top : (p.y > 20 ? p.y : 20), - width : 100, - height : 100 - }, - 'class' : 'mceItemVisualAid mceItemLayer' - }, ed.selection.getContent() || ed.getLang('layer.content')); - - // Workaround for IE where it messes up the JS engine if you insert a layer on IE 6,7 - if (tinymce.isIE) - dom.setHTML(body, body.innerHTML); - }, - - _toggleAbsolute : function() { - var ed = this.editor, le = this._getParentLayer(ed.selection.getNode()); - - if (!le) - le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG'); - - if (le) { - if (le.style.position.toLowerCase() == "absolute") { - ed.dom.setStyles(le, { - position : '', - left : '', - top : '', - width : '', - height : '' - }); - - ed.dom.removeClass(le, 'mceItemVisualAid'); - ed.dom.removeClass(le, 'mceItemLayer'); - } else { - if (le.style.left == "") - le.style.left = 20 + 'px'; - - if (le.style.top == "") - le.style.top = 20 + 'px'; - - if (le.style.width == "") - le.style.width = le.width ? (le.width + 'px') : '100px'; - - if (le.style.height == "") - le.style.height = le.height ? (le.height + 'px') : '100px'; - - le.style.position = "absolute"; - - ed.dom.setAttrib(le, 'data-mce-style', ''); - ed.addVisual(ed.getBody()); - } - - ed.execCommand('mceRepaint'); - ed.nodeChanged(); - } - } - }); - - // Register plugin - tinymce.PluginManager.add('layer', tinymce.plugins.Layer); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/legacyoutput/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/legacyoutput/editor_plugin.js deleted file mode 100644 index b3a4ce31c5e7..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/legacyoutput/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(a){a.onAddEditor.addToTop(function(c,b){b.settings.inline_styles=false});a.create("tinymce.plugins.LegacyOutput",{init:function(b){b.onInit.add(function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",e=a.explode(b.settings.font_size_style_values),d=b.schema;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignfull:{selector:c,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:true}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:true}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(f){return a.inArray(e,f.value)+1}}},forecolor:{inline:"font",styles:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}});a.each("b,i,u,strike".split(","),function(f){d.addValidElements(f+"[*]")});if(!d.getElementRule("font")){d.addValidElements("font[face|size|color|style]")}a.each(c.split(","),function(f){var h=d.getElementRule(f),g;if(h){if(!h.attributes.align){h.attributes.align={};h.attributesOrder.push("align")}}});b.onNodeChange.add(function(g,k){var j,f,h,i;f=g.dom.getParent(g.selection.getNode(),"font");if(f){h=f.face;i=f.size}if(j=k.get("fontselect")){j.select(function(l){return l==h})}if(j=k.get("fontsizeselect")){j.select(function(m){var l=a.inArray(e,m.fontSize);return l+1==i})}})})},getInfo:function(){return{longname:"LegacyOutput",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("legacyoutput",a.plugins.LegacyOutput)})(tinymce); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/legacyoutput/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/legacyoutput/editor_plugin_src.js deleted file mode 100644 index 835a45c38078..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +++ /dev/null @@ -1,139 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - * - * This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align - * attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash - * - * However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are - * not apart of the newer specifications for HTML and XHTML. - */ - -(function(tinymce) { - // Override inline_styles setting to force TinyMCE to produce deprecated contents - tinymce.onAddEditor.addToTop(function(tinymce, editor) { - editor.settings.inline_styles = false; - }); - - // Create the legacy ouput plugin - tinymce.create('tinymce.plugins.LegacyOutput', { - init : function(editor) { - editor.onInit.add(function() { - var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', - fontSizes = tinymce.explode(editor.settings.font_size_style_values), - schema = editor.schema; - - // Override some internal formats to produce legacy elements and attributes - editor.formatter.register({ - // Change alignment formats to use the deprecated align attribute - alignleft : {selector : alignElements, attributes : {align : 'left'}}, - aligncenter : {selector : alignElements, attributes : {align : 'center'}}, - alignright : {selector : alignElements, attributes : {align : 'right'}}, - alignfull : {selector : alignElements, attributes : {align : 'justify'}}, - - // Change the basic formatting elements to use deprecated element types - bold : [ - {inline : 'b', remove : 'all'}, - {inline : 'strong', remove : 'all'}, - {inline : 'span', styles : {fontWeight : 'bold'}} - ], - italic : [ - {inline : 'i', remove : 'all'}, - {inline : 'em', remove : 'all'}, - {inline : 'span', styles : {fontStyle : 'italic'}} - ], - underline : [ - {inline : 'u', remove : 'all'}, - {inline : 'span', styles : {textDecoration : 'underline'}, exact : true} - ], - strikethrough : [ - {inline : 'strike', remove : 'all'}, - {inline : 'span', styles : {textDecoration: 'line-through'}, exact : true} - ], - - // Change font size and font family to use the deprecated font element - fontname : {inline : 'font', attributes : {face : '%value'}}, - fontsize : { - inline : 'font', - attributes : { - size : function(vars) { - return tinymce.inArray(fontSizes, vars.value) + 1; - } - } - }, - - // Setup font elements for colors as well - forecolor : {inline : 'font', styles : {color : '%value'}}, - hilitecolor : {inline : 'font', styles : {backgroundColor : '%value'}} - }); - - // Check that deprecated elements are allowed if not add them - tinymce.each('b,i,u,strike'.split(','), function(name) { - schema.addValidElements(name + '[*]'); - }); - - // Add font element if it's missing - if (!schema.getElementRule("font")) - schema.addValidElements("font[face|size|color|style]"); - - // Add the missing and depreacted align attribute for the serialization engine - tinymce.each(alignElements.split(','), function(name) { - var rule = schema.getElementRule(name), found; - - if (rule) { - if (!rule.attributes.align) { - rule.attributes.align = {}; - rule.attributesOrder.push('align'); - } - } - }); - - // Listen for the onNodeChange event so that we can do special logic for the font size and font name drop boxes - editor.onNodeChange.add(function(editor, control_manager) { - var control, fontElm, fontName, fontSize; - - // Find font element get it's name and size - fontElm = editor.dom.getParent(editor.selection.getNode(), 'font'); - if (fontElm) { - fontName = fontElm.face; - fontSize = fontElm.size; - } - - // Select/unselect the font name in droplist - if (control = control_manager.get('fontselect')) { - control.select(function(value) { - return value == fontName; - }); - } - - // Select/unselect the font size in droplist - if (control = control_manager.get('fontsizeselect')) { - control.select(function(value) { - var index = tinymce.inArray(fontSizes, value.fontSize); - - return index + 1 == fontSize; - }); - } - }); - }); - }, - - getInfo : function() { - return { - longname : 'LegacyOutput', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('legacyoutput', tinymce.plugins.LegacyOutput); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/lists/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/lists/editor_plugin.js deleted file mode 100644 index 86b8b1a40591..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/lists/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var e=tinymce.each,r=tinymce.dom.Event,g;function p(t,s){while(t&&(t.nodeType===8||(t.nodeType===3&&/^[ \t\n\r]*$/.test(t.nodeValue)))){t=s(t)}return t}function b(s){return p(s,function(t){return t.previousSibling})}function i(s){return p(s,function(t){return t.nextSibling})}function d(s,u,t){return s.dom.getParent(u,function(v){return tinymce.inArray(t,v)!==-1})}function n(s){return s&&(s.tagName==="OL"||s.tagName==="UL")}function c(u,v){var t,w,s;t=b(u.lastChild);while(n(t)){w=t;t=b(w.previousSibling)}if(w){s=v.create("li",{style:"list-style-type: none;"});v.split(u,w);v.insertAfter(s,w);s.appendChild(w);s.appendChild(w);u=s.previousSibling}return u}function m(t,s,u){t=a(t,s,u);return o(t,s,u)}function a(u,s,v){var t=b(u.previousSibling);if(t){return h(t,u,s?t:false,v)}else{return u}}function o(u,t,v){var s=i(u.nextSibling);if(s){return h(u,s,t?s:false,v)}else{return u}}function h(u,s,t,v){if(l(u,s,!!t,v)){return f(u,s,t)}else{if(u&&u.tagName==="LI"&&n(s)){u.appendChild(s)}}return s}function l(u,t,s,v){if(!u||!t){return false}else{if(u.tagName==="LI"&&t.tagName==="LI"){return t.style.listStyleType==="none"||j(t)}else{if(n(u)){return(u.tagName===t.tagName&&(s||u.style.listStyleType===t.style.listStyleType))||q(t)}else{return v&&u.tagName==="P"&&t.tagName==="P"}}}}function q(t){var s=i(t.firstChild),u=b(t.lastChild);return s&&u&&n(t)&&s===u&&(n(s)||s.style.listStyleType==="none"||j(s))}function j(u){var t=i(u.firstChild),s=b(u.lastChild);return t&&s&&t===s&&n(t)}function f(w,v,s){var u=b(w.lastChild),t=i(v.firstChild);if(w.tagName==="P"){w.appendChild(w.ownerDocument.createElement("br"))}while(v.firstChild){w.appendChild(v.firstChild)}if(s){w.style.listStyleType=s.style.listStyleType}v.parentNode.removeChild(v);h(u,t,false);return w}function k(t,u){var s;if(!u.is(t,"li,ol,ul")){s=u.getParent(t,"li");if(s){t=s}}return t}tinymce.create("tinymce.plugins.Lists",{init:function(y){var v="TABBING";var s="EMPTY";var I="ESCAPE";var z="PARAGRAPH";var M="UNKNOWN";var x=M;function E(T){return T.keyCode===tinymce.VK.TAB&&!(T.altKey||T.ctrlKey)&&(y.queryCommandState("InsertUnorderedList")||y.queryCommandState("InsertOrderedList"))}function D(){var T=y.selection.getRng();var U=T.startContainer;if(U.nodeType==3){return(T.endOffset==U.nodeValue.length)}else{if(U.nodeType==1){return T.endOffset==U.childNodes.length}}return false}function N(){var U=y.selection.getNode();var T=U.tagName==="P"&&U.parentNode.tagName==="LI"&&U.parentNode.lastChild===U;return y.selection.isCollapsed()&&T&&D()}function w(){var T=B();var V=T.parentNode.parentNode;var U=T.parentNode.lastChild===T;return U&&!t(V)&&O(T)}function t(T){if(n(T)){return T.parentNode&&T.parentNode.tagName==="LI"}else{return T.tagName==="LI"}}function F(){return y.selection.isCollapsed()&&O(B())}function B(){var T=y.selection.getStart();return((T.tagName=="BR"||T.tagName=="")&&T.parentNode.tagName=="LI")?T.parentNode:T}function O(T){var U=T.childNodes.length;if(T.tagName==="LI"){return U==0?true:U==1&&(T.firstChild.tagName==""||T.firstChild.tagName=="BR"||H(T))}return false}function H(T){var U=tinymce.grep(T.parentNode.childNodes,function(X){return X.tagName=="LI"});var V=T==U[U.length-1];var W=T.firstChild;return tinymce.isIE9&&V&&(W.nodeValue==String.fromCharCode(160)||W.nodeValue==String.fromCharCode(32))}function S(T){return T.keyCode===tinymce.VK.ENTER}function A(T){return S(T)&&!T.shiftKey}function L(T){if(E(T)){return v}else{if(A(T)&&w()){return I}else{if(A(T)&&F()){return s}else{if(A(T)&&N()){return z}else{return M}}}}}function C(T,U){if(x==v||x==s||tinymce.isGecko&&x==I){r.cancel(U)}}function J(V,X){if(x==z){var W=V.selection.getNode();var U=V.dom.create("li");var T=V.dom.getParent(W,"li");V.dom.insertAfter(U,T);if(tinyMCE.isIE8){U.appendChild(V.dom.create(" "));V.selection.setCursorLocation(U,1)}else{if(tinyMCE.isGecko){setTimeout(function(){var Y=V.getDoc().createTextNode("\uFEFF");U.appendChild(Y);V.selection.setCursorLocation(U,0)},0)}else{V.selection.setCursorLocation(U,0)}}r.cancel(X)}}function u(W,Y){var ab;if(!tinymce.isGecko){return}var U=W.selection.getStart();if(Y.keyCode!=tinymce.VK.BACKSPACE||U.tagName!=="IMG"){return}function V(af){var ag=af.firstChild;var ae=null;do{if(!ag){break}if(ag.tagName==="LI"){ae=ag}}while(ag=ag.nextSibling);return ae}function ad(af,ae){while(af.childNodes.length>0){ae.appendChild(af.childNodes[0])}}ab=U.parentNode.previousSibling;if(!ab){return}var Z;if(ab.tagName==="UL"||ab.tagName==="OL"){Z=ab}else{if(ab.previousSibling&&(ab.previousSibling.tagName==="UL"||ab.previousSibling.tagName==="OL")){Z=ab.previousSibling}else{return}}var ac=V(Z);var T=W.dom.createRng();T.setStart(ac,1);T.setEnd(ac,1);W.selection.setRng(T);W.selection.collapse(true);var X=W.selection.getBookmark();var aa=U.parentNode.cloneNode(true);if(aa.tagName==="P"||aa.tagName==="DIV"){ad(aa,ac)}else{ac.appendChild(aa)}U.parentNode.parentNode.removeChild(U.parentNode);W.selection.moveToBookmark(X)}function G(T){var U=y.dom.getParent(T,"ol,ul");if(U!=null){var V=U.lastChild;V.appendChild(y.getDoc().createElement(""));y.selection.setCursorLocation(V,0)}}this.ed=y;y.addCommand("Indent",this.indent,this);y.addCommand("Outdent",this.outdent,this);y.addCommand("InsertUnorderedList",function(){this.applyList("UL","OL")},this);y.addCommand("InsertOrderedList",function(){this.applyList("OL","UL")},this);y.onInit.add(function(){y.editorCommands.addCommands({outdent:function(){var U=y.selection,V=y.dom;function T(W){W=V.getParent(W,V.isBlock);return W&&(parseInt(y.dom.getStyle(W,"margin-left")||0,10)+parseInt(y.dom.getStyle(W,"padding-left")||0,10))>0}return T(U.getStart())||T(U.getEnd())||y.queryCommandState("InsertOrderedList")||y.queryCommandState("InsertUnorderedList")}},"state")});y.onKeyUp.add(function(U,V){if(x==v){U.execCommand(V.shiftKey?"Outdent":"Indent",true,null);x=M;return r.cancel(V)}else{if(x==s){var T=B();var X=U.settings.list_outdent_on_enter===true||V.shiftKey;U.execCommand(X?"Outdent":"Indent",true,null);if(tinymce.isIE){G(T)}return r.cancel(V)}else{if(x==I){if(tinymce.isIE8){var W=U.getDoc().createTextNode("\uFEFF");U.selection.getNode().appendChild(W)}else{if(tinymce.isIE9||tinymce.isGecko){U.execCommand("Outdent");return r.cancel(V)}}}}}});function K(U,T){var V=y.getDoc().createTextNode("\uFEFF");U.insertBefore(V,T);y.selection.setCursorLocation(V,0);y.execCommand("mceRepaint")}function Q(U,W){if(S(W)){var T=B();if(T){var V=T.parentNode;var X=V&&V.parentNode;if(X&&X.nodeName=="LI"&&X.firstChild==V&&T==V.firstChild){K(X,V)}}}}function R(U,W){if(S(W)){var T=B();if(U.dom.select("ul li",T).length===1){var V=T.firstChild;K(T,V)}}}function P(U,Y){function V(ac,Z){var ab=[];var ad=new tinymce.dom.TreeWalker(Z,ac);for(var aa=ad.current();aa;aa=ad.next()){if(U.dom.is(aa,"ol,ul,li")){ab.push(aa)}}return ab}if(Y.keyCode==tinymce.VK.BACKSPACE){var T=B();if(T){var X=U.dom.getParent(T,"ol,ul");if(X&&X.firstChild===T){var W=V(X,T);U.execCommand("Outdent",false,W);U.undoManager.add();return r.cancel(Y)}}}}y.onKeyDown.add(function(T,U){x=L(U)});y.onKeyDown.add(C);y.onKeyDown.add(u);y.onKeyDown.add(J);if(tinymce.isGecko){y.onKeyUp.add(Q)}if(tinymce.isIE8){y.onKeyUp.add(R)}if(tinymce.isGecko||tinymce.isWebKit){y.onKeyDown.add(P)}},applyList:function(y,v){var C=this,z=C.ed,I=z.dom,s=[],H=false,u=false,w=false,B,G=z.selection.getSelectedBlocks();function E(t){if(t&&t.tagName==="BR"){I.remove(t)}}function F(M){var N=I.create(y),t;function L(O){if(O.style.marginLeft||O.style.paddingLeft){C.adjustPaddingFunction(false)(O)}}if(M.tagName==="LI"){}else{if(M.tagName==="P"||M.tagName==="DIV"||M.tagName==="BODY"){K(M,function(P,O){J(P,O,M.tagName==="BODY"?null:P.parentNode);t=P.parentNode;L(t);E(O)});if(t){if(t.tagName==="LI"&&(M.tagName==="P"||G.length>1)){I.split(t.parentNode.parentNode,t.parentNode)}m(t.parentNode,true)}return}else{t=I.create("li");I.insertAfter(t,M);t.appendChild(M);L(M);M=t}}I.insertAfter(N,M);N.appendChild(M);m(N,true);s.push(M)}function J(P,L,N){var t,O=P,M;while(!I.isBlock(P.parentNode)&&P.parentNode!==I.getRoot()){P=I.split(P.parentNode,P.previousSibling);P=P.nextSibling;O=P}if(N){t=N.cloneNode(true);P.parentNode.insertBefore(t,P);while(t.firstChild){I.remove(t.firstChild)}t=I.rename(t,"li")}else{t=I.create("li");P.parentNode.insertBefore(t,P)}while(O&&O!=L){M=O.nextSibling;t.appendChild(O);O=M}if(t.childNodes.length===0){t.innerHTML='
'}F(t)}function K(Q,T){var N,R,O=3,L=1,t="br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl";function P(X,U){var V=I.createRng(),W;g.keep=true;z.selection.moveToBookmark(g);g.keep=false;W=z.selection.getRng(true);if(!U){U=X.parentNode.lastChild}V.setStartBefore(X);V.setEndAfter(U);return !(V.compareBoundaryPoints(O,W)>0||V.compareBoundaryPoints(L,W)<=0)}function S(U){if(U.nextSibling){return U.nextSibling}if(!I.isBlock(U.parentNode)&&U.parentNode!==I.getRoot()){return S(U.parentNode)}}N=Q.firstChild;var M=false;e(I.select(t,Q),function(U){if(U.hasAttribute&&U.hasAttribute("_mce_bogus")){return true}if(P(N,U)){I.addClass(U,"_mce_tagged_br");N=S(U)}});M=(N&&P(N,undefined));N=Q.firstChild;e(I.select(t,Q),function(V){var U=S(V);if(V.hasAttribute&&V.hasAttribute("_mce_bogus")){return true}if(I.hasClass(V,"_mce_tagged_br")){T(N,V,R);R=null}else{R=V}N=U});if(M){T(N,undefined,R)}}function D(t){K(t,function(M,L,N){J(M,L);E(L);E(N)})}function A(t){if(tinymce.inArray(s,t)!==-1){return}if(t.parentNode.tagName===v){I.split(t.parentNode,t);F(t);o(t.parentNode,false)}s.push(t)}function x(M){var O,N,L,t;if(tinymce.inArray(s,M)!==-1){return}M=c(M,I);while(I.is(M.parentNode,"ol,ul,li")){I.split(M.parentNode,M)}s.push(M);M=I.rename(M,"p");L=m(M,false,z.settings.force_br_newlines);if(L===M){O=M.firstChild;while(O){if(I.isBlock(O)){O=I.split(O.parentNode,O);t=true;N=O.nextSibling&&O.nextSibling.firstChild}else{N=O.nextSibling;if(t&&O.tagName==="BR"){I.remove(O)}t=false}O=N}}}e(G,function(t){t=k(t,I);if(t.tagName===v||(t.tagName==="LI"&&t.parentNode.tagName===v)){u=true}else{if(t.tagName===y||(t.tagName==="LI"&&t.parentNode.tagName===y)){H=true}else{w=true}}});if(w&&!H||u||G.length===0){B={LI:A,H1:F,H2:F,H3:F,H4:F,H5:F,H6:F,P:F,BODY:F,DIV:G.length>1?F:D,defaultAction:D,elements:this.selectedBlocks()}}else{B={defaultAction:x,elements:this.selectedBlocks()}}this.process(B)},indent:function(){var u=this.ed,w=u.dom,x=[];function s(z){var y=w.create("li",{style:"list-style-type: none;"});w.insertAfter(y,z);return y}function t(B){var y=s(B),D=w.getParent(B,"ol,ul"),C=D.tagName,E=w.getStyle(D,"list-style-type"),A={},z;if(E!==""){A.style="list-style-type: "+E+";"}z=w.create(C,A);y.appendChild(z);return z}function v(z){if(!d(u,z,x)){z=c(z,w);var y=t(z);y.appendChild(z);m(y.parentNode,false);m(y,false);x.push(z)}}this.process({LI:v,defaultAction:this.adjustPaddingFunction(true),elements:this.selectedBlocks()})},outdent:function(y,x){var w=this,u=w.ed,z=u.dom,s=[];function A(t){var C,B,D;if(!d(u,t,s)){if(z.getStyle(t,"margin-left")!==""||z.getStyle(t,"padding-left")!==""){return w.adjustPaddingFunction(false)(t)}D=z.getStyle(t,"text-align",true);if(D==="center"||D==="right"){z.setStyle(t,"text-align","left");return}t=c(t,z);C=t.parentNode;B=t.parentNode.parentNode;if(B.tagName==="P"){z.split(B,t.parentNode)}else{z.split(C,t);if(B.tagName==="LI"){z.split(B,t)}else{if(!z.is(B,"ol,ul")){z.rename(t,"p")}}}s.push(t)}}var v=x&&tinymce.is(x,"array")?x:this.selectedBlocks();this.process({LI:A,defaultAction:this.adjustPaddingFunction(false),elements:v});e(s,m)},process:function(y){var F=this,w=F.ed.selection,z=F.ed.dom,E,u;function B(t){var s=tinymce.grep(t.childNodes,function(H){return !(H.nodeName==="BR"||H.nodeName==="SPAN"&&z.getAttrib(H,"data-mce-type")=="bookmark"||H.nodeType==3&&(H.nodeValue==String.fromCharCode(160)||H.nodeValue==""))});return s.length===0}function x(s){z.removeClass(s,"_mce_act_on");if(!s||s.nodeType!==1||E.length>1&&B(s)){return}s=k(s,z);var t=y[s.tagName];if(!t){t=y.defaultAction}t(s)}function v(s){F.splitSafeEach(s.childNodes,x)}function C(s,t){return t>=0&&s.hasChildNodes()&&t0){t=s.shift();w.removeClass(t,"_mce_act_on");u(t);s=w.select("._mce_act_on")}},adjustPaddingFunction:function(u){var s,v,t=this.ed;s=t.settings.indentation;v=/[a-z%]+/i.exec(s);s=parseInt(s,10);return function(w){var y,x;y=parseInt(t.dom.getStyle(w,"margin-left")||0,10)+parseInt(t.dom.getStyle(w,"padding-left")||0,10);if(u){x=y+s}else{x=y-s}t.dom.setStyle(w,"padding-left","");t.dom.setStyle(w,"margin-left",x>0?x+v:"")}},selectedBlocks:function(){var s=this.ed;var t=s.selection.getSelectedBlocks();return t.length==0?[s.dom.getRoot()]:t},getInfo:function(){return{longname:"Lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("lists",tinymce.plugins.Lists)}()); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/lists/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/lists/editor_plugin_src.js deleted file mode 100644 index 2119426a5c15..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/lists/editor_plugin_src.js +++ /dev/null @@ -1,925 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2011, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var each = tinymce.each, Event = tinymce.dom.Event, bookmark; - - // Skips text nodes that only contain whitespace since they aren't semantically important. - function skipWhitespaceNodes(e, next) { - while (e && (e.nodeType === 8 || (e.nodeType === 3 && /^[ \t\n\r]*$/.test(e.nodeValue)))) { - e = next(e); - } - return e; - } - - function skipWhitespaceNodesBackwards(e) { - return skipWhitespaceNodes(e, function(e) { - return e.previousSibling; - }); - } - - function skipWhitespaceNodesForwards(e) { - return skipWhitespaceNodes(e, function(e) { - return e.nextSibling; - }); - } - - function hasParentInList(ed, e, list) { - return ed.dom.getParent(e, function(p) { - return tinymce.inArray(list, p) !== -1; - }); - } - - function isList(e) { - return e && (e.tagName === 'OL' || e.tagName === 'UL'); - } - - function splitNestedLists(element, dom) { - var tmp, nested, wrapItem; - tmp = skipWhitespaceNodesBackwards(element.lastChild); - while (isList(tmp)) { - nested = tmp; - tmp = skipWhitespaceNodesBackwards(nested.previousSibling); - } - if (nested) { - wrapItem = dom.create('li', { style: 'list-style-type: none;'}); - dom.split(element, nested); - dom.insertAfter(wrapItem, nested); - wrapItem.appendChild(nested); - wrapItem.appendChild(nested); - element = wrapItem.previousSibling; - } - return element; - } - - function attemptMergeWithAdjacent(e, allowDifferentListStyles, mergeParagraphs) { - e = attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs); - return attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs); - } - - function attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs) { - var prev = skipWhitespaceNodesBackwards(e.previousSibling); - if (prev) { - return attemptMerge(prev, e, allowDifferentListStyles ? prev : false, mergeParagraphs); - } else { - return e; - } - } - - function attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs) { - var next = skipWhitespaceNodesForwards(e.nextSibling); - if (next) { - return attemptMerge(e, next, allowDifferentListStyles ? next : false, mergeParagraphs); - } else { - return e; - } - } - - function attemptMerge(e1, e2, differentStylesMainElement, mergeParagraphs) { - if (canMerge(e1, e2, !!differentStylesMainElement, mergeParagraphs)) { - return merge(e1, e2, differentStylesMainElement); - } else if (e1 && e1.tagName === 'LI' && isList(e2)) { - // Fix invalidly nested lists. - e1.appendChild(e2); - } - return e2; - } - - function canMerge(e1, e2, allowDifferentListStyles, mergeParagraphs) { - if (!e1 || !e2) { - return false; - } else if (e1.tagName === 'LI' && e2.tagName === 'LI') { - return e2.style.listStyleType === 'none' || containsOnlyAList(e2); - } else if (isList(e1)) { - return (e1.tagName === e2.tagName && (allowDifferentListStyles || e1.style.listStyleType === e2.style.listStyleType)) || isListForIndent(e2); - } else return mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P'; - } - - function isListForIndent(e) { - var firstLI = skipWhitespaceNodesForwards(e.firstChild), lastLI = skipWhitespaceNodesBackwards(e.lastChild); - return firstLI && lastLI && isList(e) && firstLI === lastLI && (isList(firstLI) || firstLI.style.listStyleType === 'none' || containsOnlyAList(firstLI)); - } - - function containsOnlyAList(e) { - var firstChild = skipWhitespaceNodesForwards(e.firstChild), lastChild = skipWhitespaceNodesBackwards(e.lastChild); - return firstChild && lastChild && firstChild === lastChild && isList(firstChild); - } - - function merge(e1, e2, mainElement) { - var lastOriginal = skipWhitespaceNodesBackwards(e1.lastChild), firstNew = skipWhitespaceNodesForwards(e2.firstChild); - if (e1.tagName === 'P') { - e1.appendChild(e1.ownerDocument.createElement('br')); - } - while (e2.firstChild) { - e1.appendChild(e2.firstChild); - } - if (mainElement) { - e1.style.listStyleType = mainElement.style.listStyleType; - } - e2.parentNode.removeChild(e2); - attemptMerge(lastOriginal, firstNew, false); - return e1; - } - - function findItemToOperateOn(e, dom) { - var item; - if (!dom.is(e, 'li,ol,ul')) { - item = dom.getParent(e, 'li'); - if (item) { - e = item; - } - } - return e; - } - - tinymce.create('tinymce.plugins.Lists', { - init: function(ed) { - var LIST_TABBING = 'TABBING'; - var LIST_EMPTY_ITEM = 'EMPTY'; - var LIST_ESCAPE = 'ESCAPE'; - var LIST_PARAGRAPH = 'PARAGRAPH'; - var LIST_UNKNOWN = 'UNKNOWN'; - var state = LIST_UNKNOWN; - - function isTabInList(e) { - // Don't indent on Ctrl+Tab or Alt+Tab - return e.keyCode === tinymce.VK.TAB && !(e.altKey || e.ctrlKey) && - (ed.queryCommandState('InsertUnorderedList') || ed.queryCommandState('InsertOrderedList')); - } - - function isCursorAtEndOfContainer() { - var range = ed.selection.getRng(); - var startContainer = range.startContainer; - if (startContainer.nodeType == 3) { - return (range.endOffset == startContainer.nodeValue.length); - } else if (startContainer.nodeType == 1) { - return range.endOffset == startContainer.childNodes.length; - } - return false; - } - - // If we are at the end of a paragraph in a list item, pressing enter should create a new list item instead of a new paragraph. - function isEndOfParagraph() { - var node = ed.selection.getNode(); - var isLastParagraphOfLi = node.tagName === 'P' && node.parentNode.tagName === 'LI' && node.parentNode.lastChild === node; - return ed.selection.isCollapsed() && isLastParagraphOfLi && isCursorAtEndOfContainer(); - } - - function isOnLastListItem() { - var li = getLi(); - var grandParent = li.parentNode.parentNode; - var isLastItem = li.parentNode.lastChild === li; - return isLastItem && !isNestedList(grandParent) && isEmptyListItem(li); - } - - function isNestedList(grandParent) { - if (isList(grandParent)) { - return grandParent.parentNode && grandParent.parentNode.tagName === 'LI'; - } else { - return grandParent.tagName === 'LI'; - } - } - - function isInEmptyListItem() { - return ed.selection.isCollapsed() && isEmptyListItem(getLi()); - } - - function getLi() { - var n = ed.selection.getStart(); - // Get start will return BR if the LI only contains a BR or an empty element as we use these to fix caret position - return ((n.tagName == 'BR' || n.tagName == '') && n.parentNode.tagName == 'LI') ? n.parentNode : n; - } - - function isEmptyListItem(li) { - var numChildren = li.childNodes.length; - if (li.tagName === 'LI') { - return numChildren == 0 ? true : numChildren == 1 && (li.firstChild.tagName == '' || li.firstChild.tagName == 'BR' || isEmptyIE9Li(li)); - } - return false; - } - - function isEmptyIE9Li(li) { - // only consider this to be last item if there is no list item content or that content is nbsp or space since IE9 creates these - var lis = tinymce.grep(li.parentNode.childNodes, function(n) {return n.tagName == 'LI'}); - var isLastLi = li == lis[lis.length - 1]; - var child = li.firstChild; - return tinymce.isIE9 && isLastLi && (child.nodeValue == String.fromCharCode(160) || child.nodeValue == String.fromCharCode(32)); - } - - function isEnter(e) { - return e.keyCode === tinymce.VK.ENTER; - } - - function isEnterWithoutShift(e) { - return isEnter(e) && !e.shiftKey; - } - - function getListKeyState(e) { - if (isTabInList(e)) { - return LIST_TABBING; - } else if (isEnterWithoutShift(e) && isOnLastListItem()) { - return LIST_ESCAPE; - } else if (isEnterWithoutShift(e) && isInEmptyListItem()) { - return LIST_EMPTY_ITEM; - } else if (isEnterWithoutShift(e) && isEndOfParagraph()) { - return LIST_PARAGRAPH; - } else { - return LIST_UNKNOWN; - } - } - - function cancelDefaultEvents(ed, e) { - // list escape is done manually using outdent as it does not create paragraphs correctly in td's - if (state == LIST_TABBING || state == LIST_EMPTY_ITEM || tinymce.isGecko && state == LIST_ESCAPE) { - Event.cancel(e); - } - } - - // Creates a new list item after the current selection's list item parent - function createNewLi(ed, e) { - if (state == LIST_PARAGRAPH) { - var node = ed.selection.getNode(); - var li = ed.dom.create("li"); - var parentLi = ed.dom.getParent(node, 'li'); - ed.dom.insertAfter(li, parentLi); - - // Move caret to new list element. - if (tinyMCE.isIE8) { - li.appendChild(ed.dom.create(" ")); // IE needs an element within the bullet point - ed.selection.setCursorLocation(li, 1); - } else if (tinyMCE.isGecko) { - // This setTimeout is a hack as FF behaves badly if there is no content after the bullet point - setTimeout(function () { - var n = ed.getDoc().createTextNode('\uFEFF'); - li.appendChild(n); - ed.selection.setCursorLocation(li, 0); - }, 0); - } else { - ed.selection.setCursorLocation(li, 0); - } - Event.cancel(e); - } - } - - function imageJoiningListItem(ed, e) { - var prevSibling; - - if (!tinymce.isGecko) - return; - - var n = ed.selection.getStart(); - if (e.keyCode != tinymce.VK.BACKSPACE || n.tagName !== 'IMG') - return; - - function lastLI(node) { - var child = node.firstChild; - var li = null; - do { - if (!child) - break; - - if (child.tagName === 'LI') - li = child; - } while (child = child.nextSibling); - - return li; - } - - function addChildren(parentNode, destination) { - while (parentNode.childNodes.length > 0) - destination.appendChild(parentNode.childNodes[0]); - } - - // Check if there is a previous sibling - prevSibling = n.parentNode.previousSibling; - if (!prevSibling) - return; - - var ul; - if (prevSibling.tagName === 'UL' || prevSibling.tagName === 'OL') - ul = prevSibling; - else if (prevSibling.previousSibling && (prevSibling.previousSibling.tagName === 'UL' || prevSibling.previousSibling.tagName === 'OL')) - ul = prevSibling.previousSibling; - else - return; - - var li = lastLI(ul); - - // move the caret to the end of the list item - var rng = ed.dom.createRng(); - rng.setStart(li, 1); - rng.setEnd(li, 1); - ed.selection.setRng(rng); - ed.selection.collapse(true); - - // save a bookmark at the end of the list item - var bookmark = ed.selection.getBookmark(); - - // copy the image an its text to the list item - var clone = n.parentNode.cloneNode(true); - if (clone.tagName === 'P' || clone.tagName === 'DIV') - addChildren(clone, li); - else - li.appendChild(clone); - - // remove the old copy of the image - n.parentNode.parentNode.removeChild(n.parentNode); - - // move the caret where we saved the bookmark - ed.selection.moveToBookmark(bookmark); - } - - // fix the cursor position to ensure it is correct in IE - function setCursorPositionToOriginalLi(li) { - var list = ed.dom.getParent(li, 'ol,ul'); - if (list != null) { - var lastLi = list.lastChild; - lastLi.appendChild(ed.getDoc().createElement('')); - ed.selection.setCursorLocation(lastLi, 0); - } - } - - this.ed = ed; - ed.addCommand('Indent', this.indent, this); - ed.addCommand('Outdent', this.outdent, this); - ed.addCommand('InsertUnorderedList', function() { - this.applyList('UL', 'OL'); - }, this); - ed.addCommand('InsertOrderedList', function() { - this.applyList('OL', 'UL'); - }, this); - - ed.onInit.add(function() { - ed.editorCommands.addCommands({ - 'outdent': function() { - var sel = ed.selection, dom = ed.dom; - - function hasStyleIndent(n) { - n = dom.getParent(n, dom.isBlock); - return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0; - } - - return hasStyleIndent(sel.getStart()) || hasStyleIndent(sel.getEnd()) || ed.queryCommandState('InsertOrderedList') || ed.queryCommandState('InsertUnorderedList'); - } - }, 'state'); - }); - - ed.onKeyUp.add(function(ed, e) { - if (state == LIST_TABBING) { - ed.execCommand(e.shiftKey ? 'Outdent' : 'Indent', true, null); - state = LIST_UNKNOWN; - return Event.cancel(e); - } else if (state == LIST_EMPTY_ITEM) { - var li = getLi(); - var shouldOutdent = ed.settings.list_outdent_on_enter === true || e.shiftKey; - ed.execCommand(shouldOutdent ? 'Outdent' : 'Indent', true, null); - if (tinymce.isIE) { - setCursorPositionToOriginalLi(li); - } - - return Event.cancel(e); - } else if (state == LIST_ESCAPE) { - if (tinymce.isIE8) { - // append a zero sized nbsp so that caret is positioned correctly in IE8 after escaping and applying formatting. - // if there is no text then applying formatting for e.g a H1 to the P tag immediately following list after - // escaping from it will cause the caret to be positioned on the last li instead of staying the in P tag. - var n = ed.getDoc().createTextNode('\uFEFF'); - ed.selection.getNode().appendChild(n); - } else if (tinymce.isIE9 || tinymce.isGecko) { - // IE9 does not escape the list so we use outdent to do this and cancel the default behaviour - // Gecko does not create a paragraph outdenting inside a TD so default behaviour is cancelled and we outdent ourselves - ed.execCommand('Outdent'); - return Event.cancel(e); - } - } - }); - - function fixListItem(parent, reference) { - // a zero-sized non-breaking space is placed in the empty list item so that the nested list is - // displayed on the below line instead of next to it - var n = ed.getDoc().createTextNode('\uFEFF'); - parent.insertBefore(n, reference); - ed.selection.setCursorLocation(n, 0); - // repaint to remove rendering artifact. only visible when creating new list - ed.execCommand('mceRepaint'); - } - - function fixIndentedListItemForGecko(ed, e) { - if (isEnter(e)) { - var li = getLi(); - if (li) { - var parent = li.parentNode; - var grandParent = parent && parent.parentNode; - if (grandParent && grandParent.nodeName == 'LI' && grandParent.firstChild == parent && li == parent.firstChild) { - fixListItem(grandParent, parent); - } - } - } - } - - function fixIndentedListItemForIE8(ed, e) { - if (isEnter(e)) { - var li = getLi(); - if (ed.dom.select('ul li', li).length === 1) { - var list = li.firstChild; - fixListItem(li, list); - } - } - } - - function fixDeletingFirstCharOfList(ed, e) { - function listElements(list, li) { - var elements = []; - var walker = new tinymce.dom.TreeWalker(li, list); - for (var node = walker.current(); node; node = walker.next()) { - if (ed.dom.is(node, 'ol,ul,li')) { - elements.push(node); - } - } - return elements; - } - - if (e.keyCode == tinymce.VK.BACKSPACE) { - var li = getLi(); - if (li) { - var list = ed.dom.getParent(li, 'ol,ul'); - if (list && list.firstChild === li) { - var elements = listElements(list, li); - ed.execCommand("Outdent", false, elements); - ed.undoManager.add(); - return Event.cancel(e); - } - } - } - } - - ed.onKeyDown.add(function(_, e) { state = getListKeyState(e); }); - ed.onKeyDown.add(cancelDefaultEvents); - ed.onKeyDown.add(imageJoiningListItem); - ed.onKeyDown.add(createNewLi); - - if (tinymce.isGecko) { - ed.onKeyUp.add(fixIndentedListItemForGecko); - } - if (tinymce.isIE8) { - ed.onKeyUp.add(fixIndentedListItemForIE8); - } - if (tinymce.isGecko || tinymce.isWebKit) { - ed.onKeyDown.add(fixDeletingFirstCharOfList); - } - }, - - applyList: function(targetListType, oppositeListType) { - var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions, - selectedBlocks = ed.selection.getSelectedBlocks(); - - function cleanupBr(e) { - if (e && e.tagName === 'BR') { - dom.remove(e); - } - } - - function makeList(element) { - var list = dom.create(targetListType), li; - - function adjustIndentForNewList(element) { - // If there's a margin-left, outdent one level to account for the extra list margin. - if (element.style.marginLeft || element.style.paddingLeft) { - t.adjustPaddingFunction(false)(element); - } - } - - if (element.tagName === 'LI') { - // No change required. - } else if (element.tagName === 'P' || element.tagName === 'DIV' || element.tagName === 'BODY') { - processBrs(element, function(startSection, br) { - doWrapList(startSection, br, element.tagName === 'BODY' ? null : startSection.parentNode); - li = startSection.parentNode; - adjustIndentForNewList(li); - cleanupBr(br); - }); - if (li) { - if (li.tagName === 'LI' && (element.tagName === 'P' || selectedBlocks.length > 1)) { - dom.split(li.parentNode.parentNode, li.parentNode); - } - attemptMergeWithAdjacent(li.parentNode, true); - } - return; - } else { - // Put the list around the element. - li = dom.create('li'); - dom.insertAfter(li, element); - li.appendChild(element); - adjustIndentForNewList(element); - element = li; - } - dom.insertAfter(list, element); - list.appendChild(element); - attemptMergeWithAdjacent(list, true); - applied.push(element); - } - - function doWrapList(start, end, template) { - var li, n = start, tmp; - while (!dom.isBlock(start.parentNode) && start.parentNode !== dom.getRoot()) { - start = dom.split(start.parentNode, start.previousSibling); - start = start.nextSibling; - n = start; - } - if (template) { - li = template.cloneNode(true); - start.parentNode.insertBefore(li, start); - while (li.firstChild) dom.remove(li.firstChild); - li = dom.rename(li, 'li'); - } else { - li = dom.create('li'); - start.parentNode.insertBefore(li, start); - } - while (n && n != end) { - tmp = n.nextSibling; - li.appendChild(n); - n = tmp; - } - if (li.childNodes.length === 0) { - li.innerHTML = '
'; - } - makeList(li); - } - - function processBrs(element, callback) { - var startSection, previousBR, END_TO_START = 3, START_TO_END = 1, - breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl'; - - function isAnyPartSelected(start, end) { - var r = dom.createRng(), sel; - bookmark.keep = true; - ed.selection.moveToBookmark(bookmark); - bookmark.keep = false; - sel = ed.selection.getRng(true); - if (!end) { - end = start.parentNode.lastChild; - } - r.setStartBefore(start); - r.setEndAfter(end); - return !(r.compareBoundaryPoints(END_TO_START, sel) > 0 || r.compareBoundaryPoints(START_TO_END, sel) <= 0); - } - - function nextLeaf(br) { - if (br.nextSibling) - return br.nextSibling; - if (!dom.isBlock(br.parentNode) && br.parentNode !== dom.getRoot()) - return nextLeaf(br.parentNode); - } - - // Split on BRs within the range and process those. - startSection = element.firstChild; - // First mark the BRs that have any part of the previous section selected. - var trailingContentSelected = false; - each(dom.select(breakElements, element), function(br) { - if (br.hasAttribute && br.hasAttribute('_mce_bogus')) { - return true; // Skip the bogus Brs that are put in to appease Firefox and Safari. - } - if (isAnyPartSelected(startSection, br)) { - dom.addClass(br, '_mce_tagged_br'); - startSection = nextLeaf(br); - } - }); - trailingContentSelected = (startSection && isAnyPartSelected(startSection, undefined)); - startSection = element.firstChild; - each(dom.select(breakElements, element), function(br) { - // Got a section from start to br. - var tmp = nextLeaf(br); - if (br.hasAttribute && br.hasAttribute('_mce_bogus')) { - return true; // Skip the bogus Brs that are put in to appease Firefox and Safari. - } - if (dom.hasClass(br, '_mce_tagged_br')) { - callback(startSection, br, previousBR); - previousBR = null; - } else { - previousBR = br; - } - startSection = tmp; - }); - if (trailingContentSelected) { - callback(startSection, undefined, previousBR); - } - } - - function wrapList(element) { - processBrs(element, function(startSection, br, previousBR) { - // Need to indent this part - doWrapList(startSection, br); - cleanupBr(br); - cleanupBr(previousBR); - }); - } - - function changeList(element) { - if (tinymce.inArray(applied, element) !== -1) { - return; - } - if (element.parentNode.tagName === oppositeListType) { - dom.split(element.parentNode, element); - makeList(element); - attemptMergeWithNext(element.parentNode, false); - } - applied.push(element); - } - - function convertListItemToParagraph(element) { - var child, nextChild, mergedElement, splitLast; - if (tinymce.inArray(applied, element) !== -1) { - return; - } - element = splitNestedLists(element, dom); - while (dom.is(element.parentNode, 'ol,ul,li')) { - dom.split(element.parentNode, element); - } - // Push the original element we have from the selection, not the renamed one. - applied.push(element); - element = dom.rename(element, 'p'); - mergedElement = attemptMergeWithAdjacent(element, false, ed.settings.force_br_newlines); - if (mergedElement === element) { - // Now split out any block elements that can't be contained within a P. - // Manually iterate to ensure we handle modifications correctly (doesn't work with tinymce.each) - child = element.firstChild; - while (child) { - if (dom.isBlock(child)) { - child = dom.split(child.parentNode, child); - splitLast = true; - nextChild = child.nextSibling && child.nextSibling.firstChild; - } else { - nextChild = child.nextSibling; - if (splitLast && child.tagName === 'BR') { - dom.remove(child); - } - splitLast = false; - } - child = nextChild; - } - } - } - - each(selectedBlocks, function(e) { - e = findItemToOperateOn(e, dom); - if (e.tagName === oppositeListType || (e.tagName === 'LI' && e.parentNode.tagName === oppositeListType)) { - hasOppositeType = true; - } else if (e.tagName === targetListType || (e.tagName === 'LI' && e.parentNode.tagName === targetListType)) { - hasSameType = true; - } else { - hasNonList = true; - } - }); - - if (hasNonList &&!hasSameType || hasOppositeType || selectedBlocks.length === 0) { - actions = { - 'LI': changeList, - 'H1': makeList, - 'H2': makeList, - 'H3': makeList, - 'H4': makeList, - 'H5': makeList, - 'H6': makeList, - 'P': makeList, - 'BODY': makeList, - 'DIV': selectedBlocks.length > 1 ? makeList : wrapList, - defaultAction: wrapList, - elements: this.selectedBlocks() - }; - } else { - actions = { - defaultAction: convertListItemToParagraph, - elements: this.selectedBlocks() - }; - } - this.process(actions); - }, - - indent: function() { - var ed = this.ed, dom = ed.dom, indented = []; - - function createWrapItem(element) { - var wrapItem = dom.create('li', { style: 'list-style-type: none;'}); - dom.insertAfter(wrapItem, element); - return wrapItem; - } - - function createWrapList(element) { - var wrapItem = createWrapItem(element), - list = dom.getParent(element, 'ol,ul'), - listType = list.tagName, - listStyle = dom.getStyle(list, 'list-style-type'), - attrs = {}, - wrapList; - if (listStyle !== '') { - attrs.style = 'list-style-type: ' + listStyle + ';'; - } - wrapList = dom.create(listType, attrs); - wrapItem.appendChild(wrapList); - return wrapList; - } - - function indentLI(element) { - if (!hasParentInList(ed, element, indented)) { - element = splitNestedLists(element, dom); - var wrapList = createWrapList(element); - wrapList.appendChild(element); - attemptMergeWithAdjacent(wrapList.parentNode, false); - attemptMergeWithAdjacent(wrapList, false); - indented.push(element); - } - } - - this.process({ - 'LI': indentLI, - defaultAction: this.adjustPaddingFunction(true), - elements: this.selectedBlocks() - }); - - }, - - outdent: function(ui, elements) { - var t = this, ed = t.ed, dom = ed.dom, outdented = []; - - function outdentLI(element) { - var listElement, targetParent, align; - if (!hasParentInList(ed, element, outdented)) { - if (dom.getStyle(element, 'margin-left') !== '' || dom.getStyle(element, 'padding-left') !== '') { - return t.adjustPaddingFunction(false)(element); - } - align = dom.getStyle(element, 'text-align', true); - if (align === 'center' || align === 'right') { - dom.setStyle(element, 'text-align', 'left'); - return; - } - element = splitNestedLists(element, dom); - listElement = element.parentNode; - targetParent = element.parentNode.parentNode; - if (targetParent.tagName === 'P') { - dom.split(targetParent, element.parentNode); - } else { - dom.split(listElement, element); - if (targetParent.tagName === 'LI') { - // Nested list, need to split the LI and go back out to the OL/UL element. - dom.split(targetParent, element); - } else if (!dom.is(targetParent, 'ol,ul')) { - dom.rename(element, 'p'); - } - } - outdented.push(element); - } - } - - var listElements = elements && tinymce.is(elements, 'array') ? elements : this.selectedBlocks(); - this.process({ - 'LI': outdentLI, - defaultAction: this.adjustPaddingFunction(false), - elements: listElements - }); - - each(outdented, attemptMergeWithAdjacent); - }, - - process: function(actions) { - var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r; - - function isEmptyElement(element) { - var excludeBrsAndBookmarks = tinymce.grep(element.childNodes, function(n) { - return !(n.nodeName === 'BR' || n.nodeName === 'SPAN' && dom.getAttrib(n, 'data-mce-type') == 'bookmark' - || n.nodeType == 3 && (n.nodeValue == String.fromCharCode(160) || n.nodeValue == '')); - }); - return excludeBrsAndBookmarks.length === 0; - } - - function processElement(element) { - dom.removeClass(element, '_mce_act_on'); - if (!element || element.nodeType !== 1 || selectedBlocks.length > 1 && isEmptyElement(element)) { - return; - } - element = findItemToOperateOn(element, dom); - var action = actions[element.tagName]; - if (!action) { - action = actions.defaultAction; - } - action(element); - } - - function recurse(element) { - t.splitSafeEach(element.childNodes, processElement); - } - - function brAtEdgeOfSelection(container, offset) { - return offset >= 0 && container.hasChildNodes() && offset < container.childNodes.length && - container.childNodes[offset].tagName === 'BR'; - } - - function isInTable() { - var n = sel.getNode(); - var p = dom.getParent(n, 'td'); - return p !== null; - } - - selectedBlocks = actions.elements; - - r = sel.getRng(true); - if (!r.collapsed) { - if (brAtEdgeOfSelection(r.endContainer, r.endOffset - 1)) { - r.setEnd(r.endContainer, r.endOffset - 1); - sel.setRng(r); - } - if (brAtEdgeOfSelection(r.startContainer, r.startOffset)) { - r.setStart(r.startContainer, r.startOffset + 1); - sel.setRng(r); - } - } - - - if (tinymce.isIE8) { - // append a zero sized nbsp so that caret is restored correctly using bookmark - var s = t.ed.selection.getNode(); - if (s.tagName === 'LI' && !(s.parentNode.lastChild === s)) { - var i = t.ed.getDoc().createTextNode('\uFEFF'); - s.appendChild(i); - } - } - - bookmark = sel.getBookmark(); - actions.OL = actions.UL = recurse; - t.splitSafeEach(selectedBlocks, processElement); - sel.moveToBookmark(bookmark); - bookmark = null; - - // we avoid doing repaint in a table as this will move the caret out of the table in Firefox 3.6 - if (!isInTable()) { - // Avoids table or image handles being left behind in Firefox. - t.ed.execCommand('mceRepaint'); - } - }, - - splitSafeEach: function(elements, f) { - if (tinymce.isGecko && (/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) || - /Firefox\/3\.[0-4]/.test(navigator.userAgent))) { - this.classBasedEach(elements, f); - } else { - each(elements, f); - } - }, - - classBasedEach: function(elements, f) { - var dom = this.ed.dom, nodes, element; - // Mark nodes - each(elements, function(element) { - dom.addClass(element, '_mce_act_on'); - }); - nodes = dom.select('._mce_act_on'); - while (nodes.length > 0) { - element = nodes.shift(); - dom.removeClass(element, '_mce_act_on'); - f(element); - nodes = dom.select('._mce_act_on'); - } - }, - - adjustPaddingFunction: function(isIndent) { - var indentAmount, indentUnits, ed = this.ed; - indentAmount = ed.settings.indentation; - indentUnits = /[a-z%]+/i.exec(indentAmount); - indentAmount = parseInt(indentAmount, 10); - return function(element) { - var currentIndent, newIndentAmount; - currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10); - if (isIndent) { - newIndentAmount = currentIndent + indentAmount; - } else { - newIndentAmount = currentIndent - indentAmount; - } - ed.dom.setStyle(element, 'padding-left', ''); - ed.dom.setStyle(element, 'margin-left', newIndentAmount > 0 ? newIndentAmount + indentUnits : ''); - }; - }, - - selectedBlocks: function() { - var ed = this.ed - var selectedBlocks = ed.selection.getSelectedBlocks(); - return selectedBlocks.length == 0 ? [ ed.dom.getRoot() ] : selectedBlocks; - }, - - getInfo: function() { - return { - longname : 'Lists', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - tinymce.PluginManager.add("lists", tinymce.plugins.Lists); -}()); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/magentowidget/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/magentowidget/editor_plugin.js deleted file mode 100644 index 235c16b09a8c..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/magentowidget/editor_plugin.js +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -/* global tinyMCE, tinymceDeprecated, widgetTools, Base64 */ -/* eslint-disable strict */ -tinyMCE.addI18n({ - en: { - magentowidget: { - 'insert_widget': 'Insert Widget' - } - } -}); - -(function () { - - tinymce.create('tinymce.plugins.MagentowidgetPlugin', { - /** - * @param {tinymceDeprecated.Editor} ed - Editor instance that the plugin is initialized in. - * @param {String} url - Absolute URL to where the plugin is located. - */ - init: function (ed, url) { - ed.addCommand('mceMagentowidget', function () { - widgetTools.openDialog( - ed.settings['magentowidget_url'] + 'widget_target_id/' + ed.getElement().id + '/' - ); - }); - - // Register Widget plugin button - ed.addButton('magentowidget', { - title: 'magentowidget.insert_widget', - cmd: 'mceMagentowidget', - image: url + '/img/icon.gif' - }); - - // Add a node change handler, selects the button in the UI when a image is selected - ed.onNodeChange.add(function (edi, cm, n) { - var widgetCode; - - widgetTools.setEditMode(false); - cm.setActive('magentowidget', false); - - if (n.id && n.nodeName == 'IMG') { //eslint-disable-line eqeqeq - widgetCode = Base64.idDecode(n.id); - - if (widgetCode.indexOf('{{widget') !== -1) { - widgetTools.setEditMode(true); - cm.setActive('magentowidget', true); - } - } - }); - - // Add a widget placeholder image double click callback - ed.onDblClick.add(function (edi, e) { - var n = e.target, - widgetCode; - - if (n.id && n.nodeName == 'IMG') { //eslint-disable-line eqeqeq - widgetCode = Base64.idDecode(n.id); - - if (widgetCode.indexOf('{{widget') !== -1) { - widgetTools.setEditMode(true); - edi.execCommand('mceMagentowidget'); - } - } - }); - }, - - /** - * @return {Object} - */ - getInfo: function () { - return { - longname: 'Magento Widget Manager Plugin for TinyMCE 3.x', - author: 'Magento Core Team', - authorurl: 'http://magentocommerce.com', - infourl: 'http://magentocommerce.com', - version: '1.0' - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('magentowidget', tinymce.plugins.MagentowidgetPlugin); -})(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/magentowidget/img/icon.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/magentowidget/img/icon.gif deleted file mode 100644 index 6e53b80fe79e..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/magentowidget/img/icon.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/css/media.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/css/media.css deleted file mode 100644 index fd04898ca572..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/css/media.css +++ /dev/null @@ -1,17 +0,0 @@ -#id, #name, #hspace, #vspace, #class_name, #align { width: 100px } -#hspace, #vspace { width: 50px } -#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } -#flash_base, #flash_flashvars, #html5_altsource1, #html5_altsource2, #html5_poster { width: 240px } -#width, #height { width: 40px } -#src, #media_type { width: 250px } -#class { width: 120px } -#prev { margin: 0; border: 1px solid black; width: 380px; height: 260px; overflow: auto } -.panel_wrapper div.current { height: 420px; overflow: auto } -#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } -.mceAddSelectValue { background-color: #DDDDDD } -#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px } -#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } -#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } -#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } -#qt_qtsrc { width: 200px } -iframe {border: 1px solid gray} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/editor_plugin.js deleted file mode 100644 index 37b4320bd9fa..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var d=tinymce.explode("id,name,width,height,style,align,class,hspace,vspace,bgcolor,type"),h=tinymce.makeMap(d.join(",")),b=tinymce.html.Node,f,a,g=tinymce.util.JSON,e;f=[["Flash","d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["ShockWave","166b1bca-3f9c-11cf-8075-444553540000","application/x-director","http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],["WindowsMedia","6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a","application/x-mplayer2","http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"],["QuickTime","02bf25d5-8c17-4b23-bc80-d3488abddc6b","video/quicktime","http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],["RealMedia","cfcdaa03-8be4-11cf-b84b-0020afbbccfa","audio/x-pn-realaudio-plugin","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["Java","8ad9c840-044e-11d1-b3e9-00805f499d93","application/x-java-applet","http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],["Silverlight","dfeaf541-f3e1-4c24-acac-99c30715084a","application/x-silverlight-2"],["Iframe"],["Video"],["EmbeddedAudio"],["Audio"]];function c(m){var l,j,k;if(m&&!m.splice){j=[];for(k=0;true;k++){if(m[k]){j[k]=m[k]}else{break}}return j}return m}tinymce.create("tinymce.plugins.MediaPlugin",{init:function(n,j){var r=this,l={},m,p,q,k;function o(i){return i&&i.nodeName==="IMG"&&n.dom.hasClass(i,"mceItemMedia")}r.editor=n;r.url=j;a="";for(m=0;m0){N+=(N?"&":"")+O+"="+escape(P)}});if(N.length){G.params.flashvars=N}K=p.getParam("flash_video_player_params",{allowfullscreen:true,allowscriptaccess:true});tinymce.each(K,function(P,O){G.params[O]=""+P})}}G=z.attr("data-mce-json");if(!G){return}G=g.parse(G);q=this.getType(z.attr("class"));B=z.attr("data-mce-style");if(!B){B=z.attr("style");if(B){B=p.dom.serializeStyle(p.dom.parseStyle(B,"img"))}}if(q.name==="Iframe"){x=new b("iframe",1);tinymce.each(d,function(i){var n=z.attr(i);if(i=="class"&&n){n=n.replace(/mceItem.+ ?/g,"")}if(n&&n.length>0){x.attr(i,n)}});for(I in G.params){x.attr(I,G.params[I])}x.attr({style:B,src:G.params.src});z.replace(x);return}if(this.editor.settings.media_use_script){x=new b("script",1).attr("type","text/javascript");y=new b("#text",3);y.value="write"+q.name+"("+g.serialize(tinymce.extend(G.params,{width:z.attr("width"),height:z.attr("height")}))+");";x.append(y);z.replace(x);return}if(q.name==="Video"&&G.video.sources[0]){C=new b("video",1).attr(tinymce.extend({id:z.attr("id"),width:z.attr("width"),height:z.attr("height"),style:B},G.video.attrs));if(G.video.attrs){l=G.video.attrs.poster}k=G.video.sources=c(G.video.sources);for(A=0;A 0) - flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value); - }); - - if (flashVarsOutput.length) - data.params.flashvars = flashVarsOutput; - - params = editor.getParam('flash_video_player_params', { - allowfullscreen: true, - allowscriptaccess: true - }); - - tinymce.each(params, function(value, name) { - data.params[name] = "" + value; - }); - } - }; - - data = node.attr('data-mce-json'); - if (!data) - return; - - data = JSON.parse(data); - typeItem = this.getType(node.attr('class')); - - style = node.attr('data-mce-style') - if (!style) { - style = node.attr('style'); - - if (style) - style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img')); - } - - // Handle iframe - if (typeItem.name === 'Iframe') { - replacement = new Node('iframe', 1); - - tinymce.each(rootAttributes, function(name) { - var value = node.attr(name); - - if (name == 'class' && value) - value = value.replace(/mceItem.+ ?/g, ''); - - if (value && value.length > 0) - replacement.attr(name, value); - }); - - for (name in data.params) - replacement.attr(name, data.params[name]); - - replacement.attr({ - style: style, - src: data.params.src - }); - - node.replace(replacement); - - return; - } - - // Handle scripts - if (this.editor.settings.media_use_script) { - replacement = new Node('script', 1).attr('type', 'text/javascript'); - - value = new Node('#text', 3); - value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, { - width: node.attr('width'), - height: node.attr('height') - })) + ');'; - - replacement.append(value); - node.replace(replacement); - - return; - } - - // Add HTML5 video element - if (typeItem.name === 'Video' && data.video.sources[0]) { - // Create new object element - video = new Node('video', 1).attr(tinymce.extend({ - id : node.attr('id'), - width: node.attr('width'), - height: node.attr('height'), - style : style - }, data.video.attrs)); - - // Get poster source and use that for flash fallback - if (data.video.attrs) - posterSrc = data.video.attrs.poster; - - sources = data.video.sources = toArray(data.video.sources); - for (i = 0; i < sources.length; i++) { - if (/\.mp4$/.test(sources[i].src)) - mp4Source = sources[i].src; - } - - if (!sources[0].type) { - video.attr('src', sources[0].src); - sources.splice(0, 1); - } - - for (i = 0; i < sources.length; i++) { - source = new Node('source', 1).attr(sources[i]); - source.shortEnded = true; - video.append(source); - } - - // Create flash fallback for video if we have a mp4 source - if (mp4Source) { - addPlayer(mp4Source, posterSrc); - typeItem = self.getType('flash'); - } else - data.params.src = ''; - } - - // Add HTML5 audio element - if (typeItem.name === 'Audio' && data.video.sources[0]) { - // Create new object element - audio = new Node('audio', 1).attr(tinymce.extend({ - id : node.attr('id'), - width: node.attr('width'), - height: node.attr('height'), - style : style - }, data.video.attrs)); - - // Get poster source and use that for flash fallback - if (data.video.attrs) - posterSrc = data.video.attrs.poster; - - sources = data.video.sources = toArray(data.video.sources); - if (!sources[0].type) { - audio.attr('src', sources[0].src); - sources.splice(0, 1); - } - - for (i = 0; i < sources.length; i++) { - source = new Node('source', 1).attr(sources[i]); - source.shortEnded = true; - audio.append(source); - } - - data.params.src = ''; - } - - if (typeItem.name === 'EmbeddedAudio') { - embed = new Node('embed', 1); - embed.shortEnded = true; - embed.attr({ - id: node.attr('id'), - width: node.attr('width'), - height: node.attr('height'), - style : style, - type: node.attr('type') - }); - - for (name in data.params) - embed.attr(name, data.params[name]); - - tinymce.each(rootAttributes, function(name) { - if (data[name] && name != 'type') - embed.attr(name, data[name]); - }); - - data.params.src = ''; - } - - // Do we have a params src then we can generate object - if (data.params.src) { - // Is flv movie add player for it - if (/\.flv$/i.test(data.params.src)) - addPlayer(data.params.src, ''); - - if (args && args.force_absolute) - data.params.src = editor.documentBaseURI.toAbsolute(data.params.src); - - // Create new object element - object = new Node('object', 1).attr({ - id : node.attr('id'), - width: node.attr('width'), - height: node.attr('height'), - style : style - }); - - tinymce.each(rootAttributes, function(name) { - var value = data[name]; - - if (name == 'class' && value) - value = value.replace(/mceItem.+ ?/g, ''); - - if (value && name != 'type') - object.attr(name, value); - }); - - // Add params - for (name in data.params) { - param = new Node('param', 1); - param.shortEnded = true; - value = data.params[name]; - - // Windows media needs to use url instead of src for the media URL - if (name === 'src' && typeItem.name === 'WindowsMedia') - name = 'url'; - - param.attr({name: name, value: value}); - object.append(param); - } - - // Setup add type and classid if strict is disabled - if (this.editor.getParam('media_strict', true)) { - object.attr({ - data: data.params.src, - type: typeItem.mimes[0] - }); - } else { - object.attr({ - classid: "clsid:" + typeItem.clsids[0], - codebase: typeItem.codebase - }); - - embed = new Node('embed', 1); - embed.shortEnded = true; - embed.attr({ - id: node.attr('id'), - width: node.attr('width'), - height: node.attr('height'), - style : style, - type: typeItem.mimes[0] - }); - - for (name in data.params) - embed.attr(name, data.params[name]); - - tinymce.each(rootAttributes, function(name) { - if (data[name] && name != 'type') - embed.attr(name, data[name]); - }); - - object.append(embed); - } - - // Insert raw HTML - if (data.object_html) { - value = new Node('#text', 3); - value.raw = true; - value.value = data.object_html; - object.append(value); - } - - // Append object to video element if it exists - if (video) - video.append(object); - } - - if (video) { - // Insert raw HTML - if (data.video_html) { - value = new Node('#text', 3); - value.raw = true; - value.value = data.video_html; - video.append(value); - } - } - - if (audio) { - // Insert raw HTML - if (data.video_html) { - value = new Node('#text', 3); - value.raw = true; - value.value = data.video_html; - audio.append(value); - } - } - - var n = video || audio || object || embed; - if (n) - node.replace(n); - else - node.remove(); - }, - - /** - * Converts a tinymce.html.Node video/object/embed to an img element. - * - * The video/object/embed will be converted into an image placeholder with a JSON data attribute like this: - * - * - * The JSON structure will be like this: - * {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}} - */ - objectToImg : function(node) { - var object, embed, video, iframe, img, name, id, width, height, style, i, html, - param, params, source, sources, data, type, lookup = this.lookup, - matches, attrs, urlConverter = this.editor.settings.url_converter, - urlConverterScope = this.editor.settings.url_converter_scope, - hspace, vspace, align, bgcolor; - - function getInnerHTML(node) { - return new tinymce.html.Serializer({ - inner: true, - validate: false - }).serialize(node); - }; - - function lookupAttribute(o, attr) { - return lookup[(o.attr(attr) || '').toLowerCase()]; - } - - function lookupExtension(src) { - var ext = src.replace(/^.*\.([^.]+)$/, '$1'); - return lookup[ext.toLowerCase() || '']; - } - - // If node isn't in document - if (!node.parent) - return; - - // Handle media scripts - if (node.name === 'script') { - if (node.firstChild) - matches = scriptRegExp.exec(node.firstChild.value); - - if (!matches) - return; - - type = matches[1]; - data = {video : {}, params : JSON.parse(matches[2])}; - width = data.params.width; - height = data.params.height; - } - - // Setup data objects - data = data || { - video : {}, - params : {} - }; - - // Setup new image object - img = new Node('img', 1); - img.attr({ - src : this.editor.theme.url + '/img/trans.gif' - }); - - // Video element - name = node.name; - if (name === 'video' || name == 'audio') { - video = node; - object = node.getAll('object')[0]; - embed = node.getAll('embed')[0]; - width = video.attr('width'); - height = video.attr('height'); - id = video.attr('id'); - data.video = {attrs : {}, sources : []}; - - // Get all video attributes - attrs = data.video.attrs; - for (name in video.attributes.map) - attrs[name] = video.attributes.map[name]; - - source = node.attr('src'); - if (source) - data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)}); - - // Get all sources - sources = video.getAll("source"); - for (i = 0; i < sources.length; i++) { - source = sources[i].remove(); - - data.video.sources.push({ - src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'), - type: source.attr('type'), - media: source.attr('media') - }); - } - - // Convert the poster URL - if (attrs.poster) - attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name); - } - - // Object element - if (node.name === 'object') { - object = node; - embed = node.getAll('embed')[0]; - } - - // Embed element - if (node.name === 'embed') - embed = node; - - // Iframe element - if (node.name === 'iframe') { - iframe = node; - type = 'Iframe'; - } - - if (object) { - // Get width/height - width = width || object.attr('width'); - height = height || object.attr('height'); - style = style || object.attr('style'); - id = id || object.attr('id'); - hspace = hspace || object.attr('hspace'); - vspace = vspace || object.attr('vspace'); - align = align || object.attr('align'); - bgcolor = bgcolor || object.attr('bgcolor'); - data.name = object.attr('name'); - - // Get all object params - params = object.getAll("param"); - for (i = 0; i < params.length; i++) { - param = params[i]; - name = param.remove().attr('name'); - - if (!excludedAttrs[name]) - data.params[name] = param.attr('value'); - } - - data.params.src = data.params.src || object.attr('data'); - } - - if (embed) { - // Get width/height - width = width || embed.attr('width'); - height = height || embed.attr('height'); - style = style || embed.attr('style'); - id = id || embed.attr('id'); - hspace = hspace || embed.attr('hspace'); - vspace = vspace || embed.attr('vspace'); - align = align || embed.attr('align'); - bgcolor = bgcolor || embed.attr('bgcolor'); - - // Get all embed attributes - for (name in embed.attributes.map) { - if (!excludedAttrs[name] && !data.params[name]) - data.params[name] = embed.attributes.map[name]; - } - } - - if (iframe) { - // Get width/height - width = iframe.attr('width'); - height = iframe.attr('height'); - style = style || iframe.attr('style'); - id = iframe.attr('id'); - hspace = iframe.attr('hspace'); - vspace = iframe.attr('vspace'); - align = iframe.attr('align'); - bgcolor = iframe.attr('bgcolor'); - - tinymce.each(rootAttributes, function(name) { - img.attr(name, iframe.attr(name)); - }); - - // Get all iframe attributes - for (name in iframe.attributes.map) { - if (!excludedAttrs[name] && !data.params[name]) - data.params[name] = iframe.attributes.map[name]; - } - } - - // Use src not movie - if (data.params.movie) { - data.params.src = data.params.src || data.params.movie; - delete data.params.movie; - } - - // Convert the URL to relative/absolute depending on configuration - if (data.params.src) - data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object'); - - if (video) { - if (node.name === 'video') - type = lookup.video.name; - else if (node.name === 'audio') - type = lookup.audio.name; - } - - if (object && !type) - type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {}).name; - - if (embed && !type) - type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name; - - // for embedded audio we preserve the original specified type - if (embed && type == 'EmbeddedAudio') { - data.params.type = embed.attr('type'); - } - - // Replace the video/object/embed element with a placeholder image containing the data - node.replace(img); - - // Remove embed - if (embed) - embed.remove(); - - // Serialize the inner HTML of the object element - if (object) { - html = getInnerHTML(object.remove()); - - if (html) - data.object_html = html; - } - - // Serialize the inner HTML of the video element - if (video) { - html = getInnerHTML(video.remove()); - - if (html) - data.video_html = html; - } - - data.hspace = hspace; - data.vspace = vspace; - data.align = align; - data.bgcolor = bgcolor; - - // Set width/height of placeholder - img.attr({ - id : id, - 'class' : 'mceItemMedia mceItem' + (type || 'Flash'), - style : style, - width : width || (node.name == 'audio' ? "300" : "320"), - height : height || (node.name == 'audio' ? "32" : "240"), - hspace : hspace, - vspace : vspace, - align : align, - bgcolor : bgcolor, - "data-mce-json" : JSON.serialize(data) - }); - } - }); - - // Register plugin - tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin); -})(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/img/flash.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/img/flash.gif deleted file mode 100644 index 2c01d80cdb46..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/img/flash.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/img/quicktime.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/img/quicktime.gif deleted file mode 100644 index 282f0dbedc4c..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/img/quicktime.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/img/realmedia.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/img/realmedia.gif deleted file mode 100644 index 3815f2b5157a..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/img/realmedia.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/img/shockwave.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/img/shockwave.gif deleted file mode 100644 index edb364ed0923..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/img/shockwave.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/img/trans.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/img/trans.gif deleted file mode 100644 index 756354b05ca8..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/img/trans.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/img/windowsmedia.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/img/windowsmedia.gif deleted file mode 100644 index 7e29e7a22d31..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/img/windowsmedia.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/js/embed.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/js/embed.js deleted file mode 100644 index 6fe25de090fa..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/js/embed.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. - */ - -function writeFlash(p) { - writeEmbed( - 'D27CDB6E-AE6D-11cf-96B8-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'application/x-shockwave-flash', - p - ); -} - -function writeShockWave(p) { - writeEmbed( - '166B1BCA-3F9C-11CF-8075-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', - 'application/x-director', - p - ); -} - -function writeQuickTime(p) { - writeEmbed( - '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', - 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', - 'video/quicktime', - p - ); -} - -function writeRealMedia(p) { - writeEmbed( - 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'audio/x-pn-realaudio-plugin', - p - ); -} - -function writeWindowsMedia(p) { - p.url = p.src; - writeEmbed( - '6BF52A52-394A-11D3-B153-00C04F79FAA6', - 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', - 'application/x-mplayer2', - p - ); -} - -function writeEmbed(cls, cb, mt, p) { - var h = '', n; - - h += ''; - - h += ''); - - function get(id) { - return document.getElementById(id); - } - - function clone(obj) { - var i, len, copy, attr; - - if (null == obj || "object" != typeof obj) - return obj; - - // Handle Array - if ('length' in obj) { - copy = []; - - for (i = 0, len = obj.length; i < len; ++i) { - copy[i] = clone(obj[i]); - } - - return copy; - } - - // Handle Object - copy = {}; - for (attr in obj) { - if (obj.hasOwnProperty(attr)) - copy[attr] = clone(obj[attr]); - } - - return copy; - } - - function getVal(id) { - var elm = get(id); - - if (elm.nodeName == "SELECT") - return elm.options[elm.selectedIndex].value; - - if (elm.type == "checkbox") - return elm.checked; - - return elm.value; - } - - function setVal(id, value, name) { - if (typeof(value) != 'undefined') { - var elm = get(id); - - if (elm.nodeName == "SELECT") - selectByValue(document.forms[0], id, value); - else if (elm.type == "checkbox") { - if (typeof(value) == 'string') { - value = value.toLowerCase(); - value = (!name && value === 'true') || (name && value === name.toLowerCase()); - } - elm.checked = !!value; - } else - elm.value = value; - } - } - - window.Media = { - init : function() { - var html, editor, self = this; - - self.editor = editor = tinyMCEPopup.editor; - - // Setup file browsers and color pickers - get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); - get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media'); - get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource1','video_altsource1','media','media'); - get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media'); - get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media'); - get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media'); - get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','media','image'); - - html = self.getMediaListHTML('medialist', 'src', 'media', 'media'); - if (html == "") - get("linklistrow").style.display = 'none'; - else - get("linklistcontainer").innerHTML = html; - - if (isVisible('filebrowser')) - get('src').style.width = '230px'; - - if (isVisible('video_filebrowser_altsource1')) - get('video_altsource1').style.width = '220px'; - - if (isVisible('video_filebrowser_altsource2')) - get('video_altsource2').style.width = '220px'; - - if (isVisible('audio_filebrowser_altsource1')) - get('audio_altsource1').style.width = '220px'; - - if (isVisible('audio_filebrowser_altsource2')) - get('audio_altsource2').style.width = '220px'; - - if (isVisible('filebrowser_poster')) - get('video_poster').style.width = '220px'; - - editor.dom.setOuterHTML(get('media_type'), self.getMediaTypeHTML(editor)); - - self.setDefaultDialogSettings(editor); - self.data = clone(tinyMCEPopup.getWindowArg('data')); - self.dataToForm(); - self.preview(); - - updateColor('bgcolor_pick', 'bgcolor'); - }, - - insert : function() { - var editor = tinyMCEPopup.editor; - - this.formToData(); - editor.execCommand('mceRepaint'); - tinyMCEPopup.restoreSelection(); - editor.selection.setNode(editor.plugins.media.dataToImg(this.data)); - tinyMCEPopup.close(); - }, - - preview : function() { - get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true); - }, - - moveStates : function(to_form, field) { - var data = this.data, editor = this.editor, - mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src; - - defaultStates = { - // QuickTime - quicktime_autoplay : true, - quicktime_controller : true, - - // Flash - flash_play : true, - flash_loop : true, - flash_menu : true, - - // WindowsMedia - windowsmedia_autostart : true, - windowsmedia_enablecontextmenu : true, - windowsmedia_invokeurls : true, - - // RealMedia - realmedia_autogotourl : true, - realmedia_imagestatus : true - }; - - function parseQueryParams(str) { - var out = {}; - - if (str) { - tinymce.each(str.split('&'), function(item) { - var parts = item.split('='); - - out[unescape(parts[0])] = unescape(parts[1]); - }); - } - - return out; - }; - - function setOptions(type, names) { - var i, name, formItemName, value, list; - - if (type == data.type || type == 'global') { - names = tinymce.explode(names); - for (i = 0; i < names.length; i++) { - name = names[i]; - formItemName = type == 'global' ? name : type + '_' + name; - - if (type == 'global') - list = data; - else if (type == 'video' || type == 'audio') { - list = data.video.attrs; - - if (!list && !to_form) - data.video.attrs = list = {}; - } else - list = data.params; - - if (list) { - if (to_form) { - setVal(formItemName, list[name], type == 'video' || type == 'audio' ? name : ''); - } else { - delete list[name]; - - value = getVal(formItemName); - if ((type == 'video' || type == 'audio') && value === true) - value = name; - - if (defaultStates[formItemName]) { - if (value !== defaultStates[formItemName]) { - value = "" + value; - list[name] = value; - } - } else if (value) { - value = "" + value; - list[name] = value; - } - } - } - } - } - } - - if (!to_form) { - data.type = get('media_type').options[get('media_type').selectedIndex].value; - data.width = getVal('width'); - data.height = getVal('height'); - - // Switch type based on extension - src = getVal('src'); - if (field == 'src') { - ext = src.replace(/^.*\.([^.]+)$/, '$1'); - if (typeInfo = mediaPlugin.getType(ext)) - data.type = typeInfo.name.toLowerCase(); - - setVal('media_type', data.type); - } - - if (data.type == "video" || data.type == "audio") { - if (!data.video.sources) - data.video.sources = []; - - data.video.sources[0] = {src: getVal('src')}; - } - } - - // Hide all fieldsets and show the one active - get('video_options').style.display = 'none'; - get('audio_options').style.display = 'none'; - get('flash_options').style.display = 'none'; - get('quicktime_options').style.display = 'none'; - get('shockwave_options').style.display = 'none'; - get('windowsmedia_options').style.display = 'none'; - get('realmedia_options').style.display = 'none'; - get('embeddedaudio_options').style.display = 'none'; - - if (get(data.type + '_options')) - get(data.type + '_options').style.display = 'block'; - - setVal('media_type', data.type); - - setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars'); - setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc'); - setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign'); - setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume'); - setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks'); - setOptions('video', 'poster,autoplay,loop,muted,preload,controls'); - setOptions('audio', 'autoplay,loop,preload,controls'); - setOptions('embeddedaudio', 'autoplay,loop,controls'); - setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height'); - - if (to_form) { - if (data.type == 'video') { - if (data.video.sources[0]) - setVal('src', data.video.sources[0].src); - - src = data.video.sources[1]; - if (src) - setVal('video_altsource1', src.src); - - src = data.video.sources[2]; - if (src) - setVal('video_altsource2', src.src); - } else if (data.type == 'audio') { - if (data.video.sources[0]) - setVal('src', data.video.sources[0].src); - - src = data.video.sources[1]; - if (src) - setVal('audio_altsource1', src.src); - - src = data.video.sources[2]; - if (src) - setVal('audio_altsource2', src.src); - } else { - // Check flash vars - if (data.type == 'flash') { - tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) { - if (value == '$url') - data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src || ''; - }); - } - - setVal('src', data.params.src); - } - } else { - src = getVal("src"); - - // YouTube *NEW* - if (src.match(/youtu.be\/[a-z1-9.-_]+/)) { - data.width = 425; - data.height = 350; - data.params.frameborder = '0'; - data.type = 'iframe'; - src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1]; - setVal('src', src); - setVal('media_type', data.type); - } - - // YouTube - if (src.match(/youtube.com(.+)v=([^&]+)/)) { - data.width = 425; - data.height = 350; - data.params.frameborder = '0'; - data.type = 'iframe'; - src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1]; - setVal('src', src); - setVal('media_type', data.type); - } - - // Google video - if (src.match(/video.google.com(.+)docid=([^&]+)/)) { - data.width = 425; - data.height = 326; - data.type = 'flash'; - src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en'; - setVal('src', src); - setVal('media_type', data.type); - } - - if (data.type == 'video') { - if (!data.video.sources) - data.video.sources = []; - - data.video.sources[0] = {src : src}; - - src = getVal("video_altsource1"); - if (src) - data.video.sources[1] = {src : src}; - - src = getVal("video_altsource2"); - if (src) - data.video.sources[2] = {src : src}; - } else if (data.type == 'audio') { - if (!data.video.sources) - data.video.sources = []; - - data.video.sources[0] = {src : src}; - - src = getVal("audio_altsource1"); - if (src) - data.video.sources[1] = {src : src}; - - src = getVal("audio_altsource2"); - if (src) - data.video.sources[2] = {src : src}; - } else - data.params.src = src; - - // Set default size - setVal('width', data.width || (data.type == 'audio' ? 300 : 320)); - setVal('height', data.height || (data.type == 'audio' ? 32 : 240)); - } - }, - - dataToForm : function() { - this.moveStates(true); - }, - - formToData : function(field) { - if (field == "width" || field == "height") - this.changeSize(field); - - if (field == 'source') { - this.moveStates(false, field); - setVal('source', this.editor.plugins.media.dataToHtml(this.data)); - this.panel = 'source'; - } else { - if (this.panel == 'source') { - this.data = clone(this.editor.plugins.media.htmlToData(getVal('source'))); - this.dataToForm(); - this.panel = ''; - } - - this.moveStates(false, field); - this.preview(); - } - }, - - beforeResize : function() { - this.width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); - this.height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); - }, - - changeSize : function(type) { - var width, height, scale, size; - - if (get('constrain').checked) { - width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); - height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); - - if (type == 'width') { - this.height = Math.round((width / this.width) * height); - setVal('height', this.height); - } else { - this.width = Math.round((height / this.height) * width); - setVal('width', this.width); - } - } - }, - - getMediaListHTML : function() { - if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) { - var html = ""; - - html += ''; - - return html; - } - - return ""; - }, - - getMediaTypeHTML : function(editor) { - function option(media_type){ - return '' - } - var html = ""; - html += ''; - return html; - }, - - setDefaultDialogSettings : function(editor) { - var defaultDialogSettings = editor.getParam("media_dialog_defaults", {}); - tinymce.each(defaultDialogSettings, function(v, k) { - setVal(k, v); - }); - } - }; - - tinyMCEPopup.requireLangPack(); - tinyMCEPopup.onInit.add(function() { - Media.init(); - }); -})(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/langs/en_dlg.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/langs/en_dlg.js deleted file mode 100644 index ecef3a8013b3..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/langs/en_dlg.js +++ /dev/null @@ -1 +0,0 @@ -tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert/Edit Embedded Media","align_top_left":"Top Left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed RTSP resources should be added to the QT Source field under the Advanced tab.\nYou should also add a non-streamed version to the Source field.",qtsrc:"QT Source",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch Style",scriptcallbacks:"Script Callbacks","align_top_right":"Top Right",uimode:"UI Mode",rate:"Rate",playcount:"Play Count",defaultframe:"Default Frame",currentposition:"Current Position",currentmarker:"Current Marker",captioningid:"Captioning ID",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless Video",stretchtofit:"Stretch to Fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Full Screen",enabled:"Enabled",autostart:"Auto Start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"End Time",starttime:"Start Time",enablejavascript:"Enable JavaScript",correction:"No Correction",targetcache:"Target Cache",playeveryframe:"Play Every Frame",kioskmode:"Kiosk Mode",controller:"Controller",menu:"Show Menu",loop:"Loop",play:"Auto Play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"ID",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain Proportions",controls:"Controls",numloop:"Num Loops",console:"Console",cache:"Cache",autohref:"Auto HREF",liveconnect:"SWLiveConnect",flashvars:"Flash Vars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain Aspect",imagestatus:"Image Status",center:"Center",autogotourl:"Auto Goto URL","shockwave_options":"Shockwave Options","rmp_options":"Real Media Player Options","wmp_options":"Windows Media Player Options","qt_options":"QuickTime Options","flash_options":"Flash Options",hidden:"Hidden","align_bottom_left":"Bottom Left","align_bottom_right":"Bottom Right","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source","html5_audio_options":"Audio Options","preload_none":"Don\'t Preload","preload_metadata":"Preload video metadata","preload_auto":"Let user\'s browser decide", "embedded_audio_options":"Embedded Audio Options", video:"HTML5 Video", audio:"HTML5 Audio", flash:"Flash", quicktime:"QuickTime", shockwave:"Shockwave", windowsmedia:"Windows Media", realmedia:"Real Media", iframe:"Iframe", embeddedaudio:"Embedded Audio" }); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/media.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/media.htm deleted file mode 100644 index 50efe9182d00..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/media.htm +++ /dev/null @@ -1,922 +0,0 @@ - - - - {#media_dlg.title} - - - - - - - - - -
- - -
-
-
- {#media_dlg.general} - - - - - - - - - - - - - - - - - - -
- -
- - - - - -
 
-
- - - - - - -
x   
-
-
- -
- {#media_dlg.preview} - -
-
- -
-
- {#media_dlg.advanced} - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - -
 
-
-
- -
- {#media_dlg.html5_video_options} - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
 
-
- - - - - -
 
-
- - - - - -
 
-
- -
- - - - - - - - - - - -
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
-
- -
- {#media_dlg.embedded_audio_options} - - - - - - - - - -
- - - - - -
-
- - - - - -
-
- - - - - -
-
-
- -
- {#media_dlg.html5_audio_options} - - - - - - - - - - - - - - - - -
- - - - - -
 
-
- - - - - -
 
-
- -
- - - - - - - - - -
- - - - - -
-
- - - - - -
-
- - - - - -
-
-
- -
- {#media_dlg.flash_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - -
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - - - - - - - -
-
- -
- {#media_dlg.qt_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
-  
- - - - - -
 
-
-
- -
- {#media_dlg.wmp_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
-
- -
- {#media_dlg.rmp_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
-   -
-
- -
- {#media_dlg.shockwave_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
-
-
- -
-
- {#media_dlg.source} - -
-
-
- -
- - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/moxieplayer.swf b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/moxieplayer.swf deleted file mode 100644 index 585d772d6d3c..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/moxieplayer.swf and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/nonbreaking/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/nonbreaking/editor_plugin.js deleted file mode 100644 index 687f54866905..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/nonbreaking/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?' ':" ")});a.addButton("nonbreaking",{title:"nonbreaking.nonbreaking_desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(f.keyCode==9){f.preventDefault();d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking")}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/nonbreaking/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/nonbreaking/editor_plugin_src.js deleted file mode 100644 index 0a048b3796af..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.Nonbreaking', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceNonBreaking', function() { - ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? ' ' : ' '); - }); - - // Register buttons - ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'}); - - if (ed.getParam('nonbreaking_force_tab')) { - ed.onKeyDown.add(function(ed, e) { - if (e.keyCode == 9) { - e.preventDefault(); - - ed.execCommand('mceNonBreaking'); - ed.execCommand('mceNonBreaking'); - ed.execCommand('mceNonBreaking'); - } - }); - } - }, - - getInfo : function() { - return { - longname : 'Nonbreaking space', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - - // Private methods - }); - - // Register plugin - tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/noneditable/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/noneditable/editor_plugin.js deleted file mode 100644 index 2d60138eecde..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/noneditable/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=tinymce.dom.Event;tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(d,e){var f=this,c,b,g;f.editor=d;c=d.getParam("noneditable_editable_class","mceEditable");b=d.getParam("noneditable_noneditable_class","mceNonEditable");d.onNodeChange.addToTop(function(i,h,l){var k,j;k=i.dom.getParent(i.selection.getStart(),function(m){return i.dom.hasClass(m,b)});j=i.dom.getParent(i.selection.getEnd(),function(m){return i.dom.hasClass(m,b)});if(k||j){g=1;f._setDisabled(1);return false}else{if(g==1){f._setDisabled(0);g=0}}})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_block:function(c,d){var b=d.keyCode;if((b>32&&b<41)||(b>111&&b<124)){return}return a.cancel(d)},_setDisabled:function(d){var c=this,b=c.editor;tinymce.each(b.controlManager.controls,function(e){e.setDisabled(d)});if(d!==c.disabled){if(d){b.onKeyDown.addToTop(c._block);b.onKeyPress.addToTop(c._block);b.onKeyUp.addToTop(c._block);b.onPaste.addToTop(c._block);b.onContextMenu.addToTop(c._block)}else{b.onKeyDown.remove(c._block);b.onKeyPress.remove(c._block);b.onKeyUp.remove(c._block);b.onPaste.remove(c._block);b.onContextMenu.remove(c._block)}c.disabled=d}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/noneditable/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/noneditable/editor_plugin_src.js deleted file mode 100644 index 47b8a3be03e2..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/noneditable/editor_plugin_src.js +++ /dev/null @@ -1,95 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var Event = tinymce.dom.Event; - - tinymce.create('tinymce.plugins.NonEditablePlugin', { - init : function(ed, url) { - var t = this, editClass, nonEditClass, state; - - t.editor = ed; - editClass = ed.getParam("noneditable_editable_class", "mceEditable"); - nonEditClass = ed.getParam("noneditable_noneditable_class", "mceNonEditable"); - - ed.onNodeChange.addToTop(function(ed, cm, n) { - var sc, ec; - - // Block if start or end is inside a non editable element - sc = ed.dom.getParent(ed.selection.getStart(), function(n) { - return ed.dom.hasClass(n, nonEditClass); - }); - - ec = ed.dom.getParent(ed.selection.getEnd(), function(n) { - return ed.dom.hasClass(n, nonEditClass); - }); - - // Block or unblock - if (sc || ec) { - state = 1; - t._setDisabled(1); - return false; - } else if (state == 1) { - t._setDisabled(0); - state = 0; - } - }); - }, - - getInfo : function() { - return { - longname : 'Non editable elements', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - _block : function(ed, e) { - var k = e.keyCode; - - // Don't block arrow keys, pg up/down, and F1-F12 - if ((k > 32 && k < 41) || (k > 111 && k < 124)) - return; - - return Event.cancel(e); - }, - - _setDisabled : function(s) { - var t = this, ed = t.editor; - - tinymce.each(ed.controlManager.controls, function(c) { - c.setDisabled(s); - }); - - if (s !== t.disabled) { - if (s) { - ed.onKeyDown.addToTop(t._block); - ed.onKeyPress.addToTop(t._block); - ed.onKeyUp.addToTop(t._block); - ed.onPaste.addToTop(t._block); - ed.onContextMenu.addToTop(t._block); - } else { - ed.onKeyDown.remove(t._block); - ed.onKeyPress.remove(t._block); - ed.onKeyUp.remove(t._block); - ed.onPaste.remove(t._block); - ed.onContextMenu.remove(t._block); - } - - t.disabled = s; - } - } - }); - - // Register plugin - tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/pagebreak/css/content.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/pagebreak/css/content.css deleted file mode 100644 index c949d58cc479..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/pagebreak/css/content.css +++ /dev/null @@ -1 +0,0 @@ -.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../img/pagebreak.gif) no-repeat center top;} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/pagebreak/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/pagebreak/editor_plugin.js deleted file mode 100644 index 35085e8adca2..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/pagebreak/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='',a="mcePageBreak",c=b.getParam("pagebreak_separator",""),e;e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");b.addCommand("mcePageBreak",function(){b.execCommand("mceInsertContent",0,f)});b.addButton("pagebreak",{title:"pagebreak.desc",cmd:a});b.onInit.add(function(){if(b.theme.onResolveName){b.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&b.dom.hasClass(h.node,a)){h.name="pagebreak"}})}});b.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,a)){g.selection.select(h)}});b.onNodeChange.add(function(h,g,i){g.setActive("pagebreak",i.nodeName==="IMG"&&h.dom.hasClass(i,a))});b.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(e,f)});b.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=c}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/pagebreak/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/pagebreak/editor_plugin_src.js deleted file mode 100644 index fc3b3b4a1551..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/pagebreak/editor_plugin_src.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.PageBreakPlugin', { - init : function(ed, url) { - var pb = '', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', ''), pbRE; - - pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g'); - - // Register commands - ed.addCommand('mcePageBreak', function() { - ed.execCommand('mceInsertContent', 0, pb); - }); - - // Register buttons - ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls}); - - ed.onInit.add(function() { - if (ed.theme.onResolveName) { - ed.theme.onResolveName.add(function(th, o) { - if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls)) - o.name = 'pagebreak'; - }); - } - }); - - ed.onClick.add(function(ed, e) { - e = e.target; - - if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls)) - ed.selection.select(e); - }); - - ed.onNodeChange.add(function(ed, cm, n) { - cm.setActive('pagebreak', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls)); - }); - - ed.onBeforeSetContent.add(function(ed, o) { - o.content = o.content.replace(pbRE, pb); - }); - - ed.onPostProcess.add(function(ed, o) { - if (o.get) - o.content = o.content.replace(/]+>/g, function(im) { - if (im.indexOf('class="mcePageBreak') !== -1) - im = sep; - - return im; - }); - }); - }, - - getInfo : function() { - return { - longname : 'PageBreak', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('pagebreak', tinymce.plugins.PageBreakPlugin); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/pagebreak/img/pagebreak.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/pagebreak/img/pagebreak.gif deleted file mode 100644 index 134fec7200fc..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/pagebreak/img/pagebreak.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/pagebreak/img/trans.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/pagebreak/img/trans.gif deleted file mode 100644 index 756354b05ca8..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/pagebreak/img/trans.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/editor_plugin.js deleted file mode 100644 index e47a5c630afd..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_enable_default_filters:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_text_use_dialog:false,paste_text_sticky:false,paste_text_sticky_default:false,paste_text_notifyalways:false,paste_text_linebreaktype:"combined",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){return false}});d.pasteAsPlainText=b(d,"paste_text_sticky_default");function h(l,j){var k=d.dom,i;f.onPreProcess.dispatch(f,l);l.node=k.create("div",0,l.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){if(l.node.childNodes.length===1&&/^(p|h[1-6]|pre)$/i.test(l.node.firstChild.nodeName)&&l.content.indexOf("__MCE_ITEM__")===-1){k.remove(l.node.firstChild,true)}}}f.onPostProcess.dispatch(f,l);l.content=d.serializer.serialize(l.node,{getInner:1,forced_root_block:""});if((!j)&&(d.pasteAsPlainText)){f._insertPlainText(l.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(l.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,t,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:o.encode(r).replace(/\r?\n/g,"
")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort(d.getWin()).y}o.setStyles(l,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="

"+o.encode(r).replace(/\r?\n\r?\n/g,"

").replace(/\r?\n/g,"
")+"

"}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9){d([[/(?:
 [\s\r\n]+|
)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
 [\s\r\n]+|
)*/g,"$1"]]);d([[/

/g,"

"],[/
/g," "],[/

/g,"
"]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*( )+/gi,/( |]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/

]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"

$1

")}if(b(k,"paste_convert_middot_lists")){d([[//gi,"$&__MCE_ITEM__"],[/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/"/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/]*>/gi,"

"],[/<\/h[1-6][^>]*>/gi,"

"]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(g){var d=this.editor,e=b(d,"paste_text_linebreaktype"),i=b(d,"paste_text_replacements"),f=tinymce.is;function h(j){c(j,function(k){if(k.constructor==RegExp){g=g.replace(k,"")}else{g=g.replace(k[0],k[1])}})}if((typeof(g)==="string")&&(g.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(g)){h([/[\n\r]+/g])}else{h([/\r+/g])}h([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/ /gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"],[/\n{3,}/g,"\n\n"]]);g=d.dom.decode(tinymce.html.Entities.encodeRaw(g));if(f(i,"array")){h(i)}else{if(f(i,"string")){h(new RegExp(i,"gi"))}}if(e=="none"){h([[/\n+/g," "]])}else{if(e=="br"){h([[/\n/g,"
"]])}else{if(e=="p"){h([[/\n+/g,"

"],[/^(.*<\/p>)(

)$/,"

$1"]])}else{h([[/\n\n/g,"

"],[/^(.*<\/p>)(

)$/,"

$1"],[/\n/g,"
"]])}}}d.execCommand("mceInsertContent",false,g)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/editor_plugin_src.js deleted file mode 100644 index db89eccc4e7e..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/editor_plugin_src.js +++ /dev/null @@ -1,871 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var each = tinymce.each, - defs = { - paste_auto_cleanup_on_paste : true, - paste_enable_default_filters : true, - paste_block_drop : false, - paste_retain_style_properties : "none", - paste_strip_class_attributes : "mso", - paste_remove_spans : false, - paste_remove_styles : false, - paste_remove_styles_if_webkit : true, - paste_convert_middot_lists : true, - paste_convert_headers_to_strong : false, - paste_dialog_width : "450", - paste_dialog_height : "400", - paste_text_use_dialog : false, - paste_text_sticky : false, - paste_text_sticky_default : false, - paste_text_notifyalways : false, - paste_text_linebreaktype : "combined", - paste_text_replacements : [ - [/\u2026/g, "..."], - [/[\x93\x94\u201c\u201d]/g, '"'], - [/[\x60\x91\x92\u2018\u2019]/g, "'"] - ] - }; - - function getParam(ed, name) { - return ed.getParam(name, defs[name]); - } - - tinymce.create('tinymce.plugins.PastePlugin', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - t.url = url; - - // Setup plugin events - t.onPreProcess = new tinymce.util.Dispatcher(t); - t.onPostProcess = new tinymce.util.Dispatcher(t); - - // Register default handlers - t.onPreProcess.add(t._preProcess); - t.onPostProcess.add(t._postProcess); - - // Register optional preprocess handler - t.onPreProcess.add(function(pl, o) { - ed.execCallback('paste_preprocess', pl, o); - }); - - // Register optional postprocess - t.onPostProcess.add(function(pl, o) { - ed.execCallback('paste_postprocess', pl, o); - }); - - ed.onKeyDown.addToTop(function(ed, e) { - // Block ctrl+v from adding an undo level since the default logic in tinymce.Editor will add that - if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) - return false; // Stop other listeners - }); - - // Initialize plain text flag - ed.pasteAsPlainText = getParam(ed, 'paste_text_sticky_default'); - - // This function executes the process handlers and inserts the contents - // force_rich overrides plain text mode set by user, important for pasting with execCommand - function process(o, force_rich) { - var dom = ed.dom, rng; - - // Execute pre process handlers - t.onPreProcess.dispatch(t, o); - - // Create DOM structure - o.node = dom.create('div', 0, o.content); - - // If pasting inside the same element and the contents is only one block - // remove the block and keep the text since Firefox will copy parts of pre and h1-h6 as a pre element - if (tinymce.isGecko) { - rng = ed.selection.getRng(true); - if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) { - // Is only one block node and it doesn't contain word stuff - if (o.node.childNodes.length === 1 && /^(p|h[1-6]|pre)$/i.test(o.node.firstChild.nodeName) && o.content.indexOf('__MCE_ITEM__') === -1) - dom.remove(o.node.firstChild, true); - } - } - - // Execute post process handlers - t.onPostProcess.dispatch(t, o); - - // Serialize content - o.content = ed.serializer.serialize(o.node, {getInner : 1, forced_root_block : ''}); - - // Plain text option active? - if ((!force_rich) && (ed.pasteAsPlainText)) { - t._insertPlainText(o.content); - - if (!getParam(ed, "paste_text_sticky")) { - ed.pasteAsPlainText = false; - ed.controlManager.setActive("pastetext", false); - } - } else { - t._insert(o.content); - } - } - - // Add command for external usage - ed.addCommand('mceInsertClipboardContent', function(u, o) { - process(o, true); - }); - - if (!getParam(ed, "paste_text_use_dialog")) { - ed.addCommand('mcePasteText', function(u, v) { - var cookie = tinymce.util.Cookie; - - ed.pasteAsPlainText = !ed.pasteAsPlainText; - ed.controlManager.setActive('pastetext', ed.pasteAsPlainText); - - if ((ed.pasteAsPlainText) && (!cookie.get("tinymcePasteText"))) { - if (getParam(ed, "paste_text_sticky")) { - ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky')); - } else { - ed.windowManager.alert(ed.translate('paste.plaintext_mode')); - } - - if (!getParam(ed, "paste_text_notifyalways")) { - cookie.set("tinymcePasteText", "1", new Date(new Date().getFullYear() + 1, 12, 31)) - } - } - }); - } - - ed.addButton('pastetext', {title: 'paste.paste_text_desc', cmd: 'mcePasteText'}); - ed.addButton('selectall', {title: 'paste.selectall_desc', cmd: 'selectall'}); - - // This function grabs the contents from the clipboard by adding a - // hidden div and placing the caret inside it and after the browser paste - // is done it grabs that contents and processes that - function grabContent(e) { - var n, or, rng, oldRng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent; - - // Check if browser supports direct plaintext access - if (e.clipboardData || dom.doc.dataTransfer) { - textContent = (e.clipboardData || dom.doc.dataTransfer).getData('Text'); - - if (ed.pasteAsPlainText) { - e.preventDefault(); - process({content : dom.encode(textContent).replace(/\r?\n/g, '
')}); - return; - } - } - - if (dom.get('_mcePaste')) - return; - - // Create container to paste into - n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste', 'data-mce-bogus' : '1'}, '\uFEFF\uFEFF'); - - // If contentEditable mode we need to find out the position of the closest element - if (body != ed.getDoc().body) - posY = dom.getPos(ed.selection.getStart(), body).y; - else - posY = body.scrollTop + dom.getViewPort(ed.getWin()).y; - - // Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles - // If also needs to be in view on IE or the paste would fail - dom.setStyles(n, { - position : 'absolute', - left : tinymce.isGecko ? -40 : 0, // Need to move it out of site on Gecko since it will othewise display a ghost resize rect for the div - top : posY - 25, - width : 1, - height : 1, - overflow : 'hidden' - }); - - if (tinymce.isIE) { - // Store away the old range - oldRng = sel.getRng(); - - // Select the container - rng = dom.doc.body.createTextRange(); - rng.moveToElementText(n); - rng.execCommand('Paste'); - - // Remove container - dom.remove(n); - - // Check if the contents was changed, if it wasn't then clipboard extraction failed probably due - // to IE security settings so we pass the junk though better than nothing right - if (n.innerHTML === '\uFEFF\uFEFF') { - ed.execCommand('mcePasteWord'); - e.preventDefault(); - return; - } - - // Restore the old range and clear the contents before pasting - sel.setRng(oldRng); - sel.setContent(''); - - // For some odd reason we need to detach the mceInsertContent call from the paste event - // It's like IE has a reference to the parent element that you paste in and the selection gets messed up - // when it tries to restore the selection - setTimeout(function() { - // Process contents - process({content : n.innerHTML}); - }, 0); - - // Block the real paste event - return tinymce.dom.Event.cancel(e); - } else { - function block(e) { - e.preventDefault(); - }; - - // Block mousedown and click to prevent selection change - dom.bind(ed.getDoc(), 'mousedown', block); - dom.bind(ed.getDoc(), 'keydown', block); - - or = ed.selection.getRng(); - - // Move select contents inside DIV - n = n.firstChild; - rng = ed.getDoc().createRange(); - rng.setStart(n, 0); - rng.setEnd(n, 2); - sel.setRng(rng); - - // Wait a while and grab the pasted contents - window.setTimeout(function() { - var h = '', nl; - - // Paste divs duplicated in paste divs seems to happen when you paste plain text so lets first look for that broken behavior in WebKit - if (!dom.select('div.mcePaste > div.mcePaste').length) { - nl = dom.select('div.mcePaste'); - - // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string - each(nl, function(n) { - var child = n.firstChild; - - // WebKit inserts a DIV container with lots of odd styles - if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) { - dom.remove(child, 1); - } - - // Remove apply style spans - each(dom.select('span.Apple-style-span', n), function(n) { - dom.remove(n, 1); - }); - - // Remove bogus br elements - each(dom.select('br[data-mce-bogus]', n), function(n) { - dom.remove(n); - }); - - // WebKit will make a copy of the DIV for each line of plain text pasted and insert them into the DIV - if (n.parentNode.className != 'mcePaste') - h += n.innerHTML; - }); - } else { - // Found WebKit weirdness so force the content into paragraphs this seems to happen when you paste plain text from Nodepad etc - // So this logic will replace double enter with paragraphs and single enter with br so it kind of looks the same - h = '

' + dom.encode(textContent).replace(/\r?\n\r?\n/g, '

').replace(/\r?\n/g, '
') + '

'; - } - - // Remove the nodes - each(dom.select('div.mcePaste'), function(n) { - dom.remove(n); - }); - - // Restore the old selection - if (or) - sel.setRng(or); - - process({content : h}); - - // Unblock events ones we got the contents - dom.unbind(ed.getDoc(), 'mousedown', block); - dom.unbind(ed.getDoc(), 'keydown', block); - }, 0); - } - } - - // Check if we should use the new auto process method - if (getParam(ed, "paste_auto_cleanup_on_paste")) { - // Is it's Opera or older FF use key handler - if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) { - ed.onKeyDown.addToTop(function(ed, e) { - if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) - grabContent(e); - }); - } else { - // Grab contents on paste event on Gecko and WebKit - ed.onPaste.addToTop(function(ed, e) { - return grabContent(e); - }); - } - } - - ed.onInit.add(function() { - ed.controlManager.setActive("pastetext", ed.pasteAsPlainText); - - // Block all drag/drop events - if (getParam(ed, "paste_block_drop")) { - ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) { - e.preventDefault(); - e.stopPropagation(); - - return false; - }); - } - }); - - // Add legacy support - t._legacySupport(); - }, - - getInfo : function() { - return { - longname : 'Paste text/word', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - _preProcess : function(pl, o) { - var ed = this.editor, - h = o.content, - grep = tinymce.grep, - explode = tinymce.explode, - trim = tinymce.trim, - len, stripClass; - - //console.log('Before preprocess:' + o.content); - - function process(items) { - each(items, function(v) { - // Remove or replace - if (v.constructor == RegExp) - h = h.replace(v, ''); - else - h = h.replace(v[0], v[1]); - }); - } - - if (ed.settings.paste_enable_default_filters == false) { - return; - } - - // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser - if (tinymce.isIE && document.documentMode >= 9) { - // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser - process([[/(?:
 [\s\r\n]+|
)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
 [\s\r\n]+|
)*/g, '$1']]); - - // IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break - process([ - [/

/g, '

'], // Replace multiple BR elements with uppercase BR to keep them intact - [/
/g, ' '], // Replace single br elements with space since they are word wrap BR:s - [/

/g, '
'] // Replace back the double brs but into a single BR - ]); - } - - // Detect Word content and process it more aggressive - if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) { - o.wordContent = true; // Mark the pasted contents as word specific content - //console.log('Word contents detected.'); - - // Process away some basic content - process([ - /^\s*( )+/gi, //   entities at the start of contents - /( |]*>)+\s*$/gi //   entities at the end of contents - ]); - - if (getParam(ed, "paste_convert_headers_to_strong")) { - h = h.replace(/

]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "

$1

"); - } - - if (getParam(ed, "paste_convert_middot_lists")) { - process([ - [//gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker - [/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers - [/(]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF) - ]); - } - - process([ - // Word comments like conditional comments etc - //gi, - - // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags - /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi, - - // Convert into for line-though - [/<(\/?)s>/gi, "<$1strike>"], - - // Replace nsbp entites to char since it's easier to handle - [/ /gi, "\u00a0"] - ]); - - // Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag. - // If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot. - do { - len = h.length; - h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1"); - } while (len != h.length); - - // Remove all spans if no styles is to be retained - if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) { - h = h.replace(/<\/?span[^>]*>/gi, ""); - } else { - // We're keeping styles, so at least clean them up. - // CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx - - process([ - // Convert ___ to string of alternating breaking/non-breaking spaces of same length - [/([\s\u00a0]*)<\/span>/gi, - function(str, spaces) { - return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : ""; - } - ], - - // Examine all styles: delete junk, transform some, and keep the rest - [/(<[a-z][^>]*)\sstyle="([^"]*)"/gi, - function(str, tag, style) { - var n = [], - i = 0, - s = explode(trim(style).replace(/"/gi, "'"), ";"); - - // Examine each style definition within the tag's style attribute - each(s, function(v) { - var name, value, - parts = explode(v, ":"); - - function ensureUnits(v) { - return v + ((v !== "0") && (/\d$/.test(v)))? "px" : ""; - } - - if (parts.length == 2) { - name = parts[0].toLowerCase(); - value = parts[1].toLowerCase(); - - // Translate certain MS Office styles into their CSS equivalents - switch (name) { - case "mso-padding-alt": - case "mso-padding-top-alt": - case "mso-padding-right-alt": - case "mso-padding-bottom-alt": - case "mso-padding-left-alt": - case "mso-margin-alt": - case "mso-margin-top-alt": - case "mso-margin-right-alt": - case "mso-margin-bottom-alt": - case "mso-margin-left-alt": - case "mso-table-layout-alt": - case "mso-height": - case "mso-width": - case "mso-vertical-align-alt": - n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value); - return; - - case "horiz-align": - n[i++] = "text-align:" + value; - return; - - case "vert-align": - n[i++] = "vertical-align:" + value; - return; - - case "font-color": - case "mso-foreground": - n[i++] = "color:" + value; - return; - - case "mso-background": - case "mso-highlight": - n[i++] = "background:" + value; - return; - - case "mso-default-height": - n[i++] = "min-height:" + ensureUnits(value); - return; - - case "mso-default-width": - n[i++] = "min-width:" + ensureUnits(value); - return; - - case "mso-padding-between-alt": - n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value); - return; - - case "text-line-through": - if ((value == "single") || (value == "double")) { - n[i++] = "text-decoration:line-through"; - } - return; - - case "mso-zero-height": - if (value == "yes") { - n[i++] = "display:none"; - } - return; - } - - // Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name - if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)) { - return; - } - - // If it reached this point, it must be a valid CSS style - n[i++] = name + ":" + parts[1]; // Lower-case name, but keep value case - } - }); - - // If style attribute contained any valid styles the re-write it; otherwise delete style attribute. - if (i > 0) { - return tag + ' style="' + n.join(';') + '"'; - } else { - return tag; - } - } - ] - ]); - } - } - - // Replace headers with - if (getParam(ed, "paste_convert_headers_to_strong")) { - process([ - [/]*>/gi, "

"], - [/<\/h[1-6][^>]*>/gi, "

"] - ]); - } - - process([ - // Copy paste from Java like Open Office will produce this junk on FF - [/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, ''] - ]); - - // Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso"). - // Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation. - stripClass = getParam(ed, "paste_strip_class_attributes"); - - if (stripClass !== "none") { - function removeClasses(match, g1) { - if (stripClass === "all") - return ''; - - var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "), - function(v) { - return (/^(?!mso)/i.test(v)); - } - ); - - return cls.length ? ' class="' + cls.join(" ") + '"' : ''; - }; - - h = h.replace(/ class="([^"]+)"/gi, removeClasses); - h = h.replace(/ class=([\-\w]+)/gi, removeClasses); - } - - // Remove spans option - if (getParam(ed, "paste_remove_spans")) { - h = h.replace(/<\/?span[^>]*>/gi, ""); - } - - //console.log('After preprocess:' + h); - - o.content = h; - }, - - /** - * Various post process items. - */ - _postProcess : function(pl, o) { - var t = this, ed = t.editor, dom = ed.dom, styleProps; - - if (ed.settings.paste_enable_default_filters == false) { - return; - } - - if (o.wordContent) { - // Remove named anchors or TOC links - each(dom.select('a', o.node), function(a) { - if (!a.href || a.href.indexOf('#_Toc') != -1) - dom.remove(a, 1); - }); - - if (getParam(ed, "paste_convert_middot_lists")) { - t._convertLists(pl, o); - } - - // Process styles - styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties - - // Process only if a string was specified and not equal to "all" or "*" - if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) { - styleProps = tinymce.explode(styleProps.replace(/^none$/i, "")); - - // Retains some style properties - each(dom.select('*', o.node), function(el) { - var newStyle = {}, npc = 0, i, sp, sv; - - // Store a subset of the existing styles - if (styleProps) { - for (i = 0; i < styleProps.length; i++) { - sp = styleProps[i]; - sv = dom.getStyle(el, sp); - - if (sv) { - newStyle[sp] = sv; - npc++; - } - } - } - - // Remove all of the existing styles - dom.setAttrib(el, 'style', ''); - - if (styleProps && npc > 0) - dom.setStyles(el, newStyle); // Add back the stored subset of styles - else // Remove empty span tags that do not have class attributes - if (el.nodeName == 'SPAN' && !el.className) - dom.remove(el, true); - }); - } - } - - // Remove all style information or only specifically on WebKit to avoid the style bug on that browser - if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) { - each(dom.select('*[style]', o.node), function(el) { - el.removeAttribute('style'); - el.removeAttribute('data-mce-style'); - }); - } else { - if (tinymce.isWebKit) { - // We need to compress the styles on WebKit since if you paste it will become - // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles - each(dom.select('*', o.node), function(el) { - el.removeAttribute('data-mce-style'); - }); - } - } - }, - - /** - * Converts the most common bullet and number formats in Office into a real semantic UL/LI list. - */ - _convertLists : function(pl, o) { - var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html; - - // Convert middot lists into real semantic lists - each(dom.select('p', o.node), function(p) { - var sib, val = '', type, html, idx, parents; - - // Get text node value at beginning of paragraph - for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling) - val += sib.nodeValue; - - val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/ /g, '\u00a0'); - - // Detect unordered lists look for bullets - if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(val)) - type = 'ul'; - - // Detect ordered lists 1., a. or ixv. - if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val)) - type = 'ol'; - - // Check if node value matches the list pattern: o   - if (type) { - margin = parseFloat(p.style.marginLeft || 0); - - if (margin > lastMargin) - levels.push(margin); - - if (!listElm || type != lastType) { - listElm = dom.create(type); - dom.insertAfter(listElm, p); - } else { - // Nested list element - if (margin > lastMargin) { - listElm = li.appendChild(dom.create(type)); - } else if (margin < lastMargin) { - // Find parent level based on margin value - idx = tinymce.inArray(levels, margin); - parents = dom.getParents(listElm.parentNode, type); - listElm = parents[parents.length - 1 - idx] || listElm; - } - } - - // Remove middot or number spans if they exists - each(dom.select('span', p), function(span) { - var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, ''); - - // Remove span with the middot or the number - if (type == 'ul' && /^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(html)) - dom.remove(span); - else if (/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(html)) - dom.remove(span); - }); - - html = p.innerHTML; - - // Remove middot/list items - if (type == 'ul') - html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, ''); - else - html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, ''); - - // Create li and add paragraph data into the new li - li = listElm.appendChild(dom.create('li', 0, html)); - dom.remove(p); - - lastMargin = margin; - lastType = type; - } else - listElm = lastMargin = 0; // End list element - }); - - // Remove any left over makers - html = o.node.innerHTML; - if (html.indexOf('__MCE_ITEM__') != -1) - o.node.innerHTML = html.replace(/__MCE_ITEM__/g, ''); - }, - - /** - * Inserts the specified contents at the caret position. - */ - _insert : function(h, skip_undo) { - var ed = this.editor, r = ed.selection.getRng(); - - // First delete the contents seems to work better on WebKit when the selection spans multiple list items or multiple table cells. - if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer) - ed.getDoc().execCommand('Delete', false, null); - - ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo}); - }, - - /** - * Instead of the old plain text method which tried to re-create a paste operation, the - * new approach adds a plain text mode toggle switch that changes the behavior of paste. - * This function is passed the same input that the regular paste plugin produces. - * It performs additional scrubbing and produces (and inserts) the plain text. - * This approach leverages all of the great existing functionality in the paste - * plugin, and requires minimal changes to add the new functionality. - * Speednet - June 2009 - */ - _insertPlainText : function(content) { - var ed = this.editor, - linebr = getParam(ed, "paste_text_linebreaktype"), - rl = getParam(ed, "paste_text_replacements"), - is = tinymce.is; - - function process(items) { - each(items, function(v) { - if (v.constructor == RegExp) - content = content.replace(v, ""); - else - content = content.replace(v[0], v[1]); - }); - }; - - if ((typeof(content) === "string") && (content.length > 0)) { - // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line - if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(content)) { - process([ - /[\n\r]+/g - ]); - } else { - // Otherwise just get rid of carriage returns (only need linefeeds) - process([ - /\r+/g - ]); - } - - process([ - [/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi, "\n\n"], // Block tags get a blank line after them - [/]*>|<\/tr>/gi, "\n"], // Single linebreak for
tags and table rows - [/<\/t[dh]>\s*]*>/gi, "\t"], // Table cells get tabs betweem them - /<[a-z!\/?][^>]*>/gi, // Delete all remaining tags - [/ /gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*) - [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"],// Cool little RegExp deletes whitespace around linebreak chars. - [/\n{3,}/g, "\n\n"] // Max. 2 consecutive linebreaks - ]); - - content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content)); - - // Perform default or custom replacements - if (is(rl, "array")) { - process(rl); - } else if (is(rl, "string")) { - process(new RegExp(rl, "gi")); - } - - // Treat paragraphs as specified in the config - if (linebr == "none") { - // Convert all line breaks to space - process([ - [/\n+/g, " "] - ]); - } else if (linebr == "br") { - // Convert all line breaks to
- process([ - [/\n/g, "
"] - ]); - } else if (linebr == "p") { - // Convert all line breaks to

...

- process([ - [/\n+/g, "

"], - [/^(.*<\/p>)(

)$/, '

$1'] - ]); - } else { - // defaults to "combined" - // Convert single line breaks to
and double line breaks to

...

- process([ - [/\n\n/g, "

"], - [/^(.*<\/p>)(

)$/, '

$1'], - [/\n/g, "
"] - ]); - } - - ed.execCommand('mceInsertContent', false, content); - } - }, - - /** - * This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine. - */ - _legacySupport : function() { - var t = this, ed = t.editor; - - // Register command(s) for backwards compatibility - ed.addCommand("mcePasteWord", function() { - ed.windowManager.open({ - file: t.url + "/pasteword.htm", - width: parseInt(getParam(ed, "paste_dialog_width")), - height: parseInt(getParam(ed, "paste_dialog_height")), - inline: 1 - }); - }); - - if (getParam(ed, "paste_text_use_dialog")) { - ed.addCommand("mcePasteText", function() { - ed.windowManager.open({ - file : t.url + "/pastetext.htm", - width: parseInt(getParam(ed, "paste_dialog_width")), - height: parseInt(getParam(ed, "paste_dialog_height")), - inline : 1 - }); - }); - } - - // Register button for backwards compatibility - ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"}); - } - }); - - // Register plugin - tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin); -})(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/js/pastetext.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/js/pastetext.js deleted file mode 100644 index 81b1d6a01e13..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/js/pastetext.js +++ /dev/null @@ -1,36 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var PasteTextDialog = { - init : function() { - this.resize(); - }, - - insert : function() { - var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines; - - // Convert linebreaks into paragraphs - if (document.getElementById('linebreaks').checked) { - lines = h.split(/\r?\n/); - if (lines.length > 1) { - h = ''; - tinymce.each(lines, function(row) { - h += '

' + row + '

'; - }); - } - } - - tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h}); - tinyMCEPopup.close(); - }, - - resize : function() { - var vp = tinyMCEPopup.dom.getViewPort(window), el; - - el = document.getElementById('content'); - - el.style.width = (vp.w - 20) + 'px'; - el.style.height = (vp.h - 90) + 'px'; - } -}; - -tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/js/pasteword.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/js/pasteword.js deleted file mode 100644 index 959bf3992d23..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/js/pasteword.js +++ /dev/null @@ -1,51 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var PasteWordDialog = { - init : function() { - var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = ''; - - // Create iframe - el.innerHTML = ''; - ifr = document.getElementById('iframe'); - doc = ifr.contentWindow.document; - - // Force absolute CSS urls - css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")]; - css = css.concat(tinymce.explode(ed.settings.content_css) || []); - tinymce.each(css, function(u) { - cssHTML += ''; - }); - - // Write content into iframe - doc.open(); - doc.write('' + cssHTML + ''); - doc.close(); - - doc.designMode = 'on'; - this.resize(); - - window.setTimeout(function() { - ifr.contentWindow.focus(); - }, 10); - }, - - insert : function() { - var h = document.getElementById('iframe').contentWindow.document.body.innerHTML; - - tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true}); - tinyMCEPopup.close(); - }, - - resize : function() { - var vp = tinyMCEPopup.dom.getViewPort(window), el; - - el = document.getElementById('iframe'); - - if (el) { - el.style.width = (vp.w - 20) + 'px'; - el.style.height = (vp.h - 90) + 'px'; - } - } -}; - -tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/langs/en_dlg.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/langs/en_dlg.js deleted file mode 100644 index bc74daf85c89..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/langs/en_dlg.js +++ /dev/null @@ -1 +0,0 @@ -tinyMCE.addI18n('en.paste_dlg',{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/pastetext.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/pastetext.htm deleted file mode 100644 index 8ccfbb970f2f..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/pastetext.htm +++ /dev/null @@ -1,27 +0,0 @@ - - - {#paste.paste_text_desc} - - - - -
-
{#paste.paste_text_desc}
- -
- -
- -
- -
{#paste_dlg.text_title}
- - - -
- - -
-
- - \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/pasteword.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/pasteword.htm deleted file mode 100644 index 7731f39c480a..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/pasteword.htm +++ /dev/null @@ -1,21 +0,0 @@ - - - {#paste.paste_word_desc} - - - - -
-
{#paste.paste_word_desc}
- -
{#paste_dlg.word_title}
- -
- -
- - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/preview/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/preview/editor_plugin.js deleted file mode 100644 index 507909c5f006..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/preview/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.Preview",{init:function(a,b){var d=this,c=tinymce.explode(a.settings.content_css);d.editor=a;tinymce.each(c,function(f,e){c[e]=a.documentBaseURI.toAbsolute(f)});a.addCommand("mcePreview",function(){a.windowManager.open({file:a.getParam("plugin_preview_pageurl",b+"/preview.html"),width:parseInt(a.getParam("plugin_preview_width","550")),height:parseInt(a.getParam("plugin_preview_height","600")),resizable:"yes",scrollbars:"yes",popup_css:c?c.join(","):a.baseURI.toAbsolute("themes/"+a.settings.theme+"/skins/"+a.settings.skin+"/content.css"),inline:a.getParam("plugin_preview_inline",1)},{base:a.documentBaseURI.getURI()})});a.addButton("preview",{title:"preview.preview_desc",cmd:"mcePreview"})},getInfo:function(){return{longname:"Preview",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("preview",tinymce.plugins.Preview)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/preview/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/preview/editor_plugin_src.js deleted file mode 100644 index 80f00f0d9f67..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/preview/editor_plugin_src.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.Preview', { - init : function(ed, url) { - var t = this, css = tinymce.explode(ed.settings.content_css); - - t.editor = ed; - - // Force absolute CSS urls - tinymce.each(css, function(u, k) { - css[k] = ed.documentBaseURI.toAbsolute(u); - }); - - ed.addCommand('mcePreview', function() { - ed.windowManager.open({ - file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"), - width : parseInt(ed.getParam("plugin_preview_width", "550")), - height : parseInt(ed.getParam("plugin_preview_height", "600")), - resizable : "yes", - scrollbars : "yes", - popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"), - inline : ed.getParam("plugin_preview_inline", 1) - }, { - base : ed.documentBaseURI.getURI() - }); - }); - - ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'}); - }, - - getInfo : function() { - return { - longname : 'Preview', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('preview', tinymce.plugins.Preview); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/preview/example.html b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/preview/example.html deleted file mode 100644 index 48202224dd42..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/preview/example.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - -Example of a custom preview page - - - -Editor contents:
-
- -
- - - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/preview/jscripts/embed.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/preview/jscripts/embed.js deleted file mode 100644 index 6fe25de090fa..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/preview/jscripts/embed.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. - */ - -function writeFlash(p) { - writeEmbed( - 'D27CDB6E-AE6D-11cf-96B8-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'application/x-shockwave-flash', - p - ); -} - -function writeShockWave(p) { - writeEmbed( - '166B1BCA-3F9C-11CF-8075-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', - 'application/x-director', - p - ); -} - -function writeQuickTime(p) { - writeEmbed( - '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', - 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', - 'video/quicktime', - p - ); -} - -function writeRealMedia(p) { - writeEmbed( - 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'audio/x-pn-realaudio-plugin', - p - ); -} - -function writeWindowsMedia(p) { - p.url = p.src; - writeEmbed( - '6BF52A52-394A-11D3-B153-00C04F79FAA6', - 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', - 'application/x-mplayer2', - p - ); -} - -function writeEmbed(cls, cb, mt, p) { - var h = '', n; - - h += ''; - - h += ' - - - - - -{#preview.preview_desc} - - - - - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/print/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/print/editor_plugin.js deleted file mode 100644 index b5b3a55edf46..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/print/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.Print",{init:function(a,b){a.addCommand("mcePrint",function(){a.getWin().print()});a.addButton("print",{title:"print.print_desc",cmd:"mcePrint"})},getInfo:function(){return{longname:"Print",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("print",tinymce.plugins.Print)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/print/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/print/editor_plugin_src.js deleted file mode 100644 index 47e666a30061..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/print/editor_plugin_src.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.Print', { - init : function(ed, url) { - ed.addCommand('mcePrint', function() { - ed.getWin().print(); - }); - - ed.addButton('print', {title : 'print.print_desc', cmd : 'mcePrint'}); - }, - - getInfo : function() { - return { - longname : 'Print', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('print', tinymce.plugins.Print); -})(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/save/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/save/editor_plugin.js deleted file mode 100644 index 8e9399667103..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/save/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.Save",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceSave",c._save,c);a.addCommand("mceCancel",c._cancel,c);a.addButton("save",{title:"save.save_desc",cmd:"mceSave"});a.addButton("cancel",{title:"save.cancel_desc",cmd:"mceCancel"});a.onNodeChange.add(c._nodeChange,c);a.addShortcut("ctrl+s",a.getLang("save.save_desc"),"mceSave")},getInfo:function(){return{longname:"Save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,c){var b=this.editor;if(b.getParam("save_enablewhendirty")){a.setDisabled("save",!b.isDirty());a.setDisabled("cancel",!b.isDirty())}},_save:function(){var c=this.editor,a,e,d,b;a=tinymce.DOM.get(c.id).form||tinymce.DOM.getParent(c.id,"form");if(c.getParam("save_enablewhendirty")&&!c.isDirty()){return}tinyMCE.triggerSave();if(e=c.getParam("save_onsavecallback")){if(c.execCallback("save_onsavecallback",c)){c.startContent=tinymce.trim(c.getContent({format:"raw"}));c.nodeChanged()}return}if(a){c.isNotDirty=true;if(a.onsubmit==null||a.onsubmit()!=false){a.submit()}c.nodeChanged()}else{c.windowManager.alert("Error: No form element found.")}},_cancel:function(){var a=this.editor,c,b=tinymce.trim(a.startContent);if(c=a.getParam("save_oncancelcallback")){a.execCallback("save_oncancelcallback",a);return}a.setContent(b);a.undoManager.clear();a.nodeChanged()}});tinymce.PluginManager.add("save",tinymce.plugins.Save)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/save/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/save/editor_plugin_src.js deleted file mode 100644 index 5ab6491c83e9..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/save/editor_plugin_src.js +++ /dev/null @@ -1,101 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.Save', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceSave', t._save, t); - ed.addCommand('mceCancel', t._cancel, t); - - // Register buttons - ed.addButton('save', {title : 'save.save_desc', cmd : 'mceSave'}); - ed.addButton('cancel', {title : 'save.cancel_desc', cmd : 'mceCancel'}); - - ed.onNodeChange.add(t._nodeChange, t); - ed.addShortcut('ctrl+s', ed.getLang('save.save_desc'), 'mceSave'); - }, - - getInfo : function() { - return { - longname : 'Save', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - _nodeChange : function(ed, cm, n) { - var ed = this.editor; - - if (ed.getParam('save_enablewhendirty')) { - cm.setDisabled('save', !ed.isDirty()); - cm.setDisabled('cancel', !ed.isDirty()); - } - }, - - // Private methods - - _save : function() { - var ed = this.editor, formObj, os, i, elementId; - - formObj = tinymce.DOM.get(ed.id).form || tinymce.DOM.getParent(ed.id, 'form'); - - if (ed.getParam("save_enablewhendirty") && !ed.isDirty()) - return; - - tinyMCE.triggerSave(); - - // Use callback instead - if (os = ed.getParam("save_onsavecallback")) { - if (ed.execCallback('save_onsavecallback', ed)) { - ed.startContent = tinymce.trim(ed.getContent({format : 'raw'})); - ed.nodeChanged(); - } - - return; - } - - if (formObj) { - ed.isNotDirty = true; - - if (formObj.onsubmit == null || formObj.onsubmit() != false) - formObj.submit(); - - ed.nodeChanged(); - } else - ed.windowManager.alert("Error: No form element found."); - }, - - _cancel : function() { - var ed = this.editor, os, h = tinymce.trim(ed.startContent); - - // Use callback instead - if (os = ed.getParam("save_oncancelcallback")) { - ed.execCallback('save_oncancelcallback', ed); - return; - } - - ed.setContent(h); - ed.undoManager.clear(); - ed.nodeChanged(); - } - }); - - // Register plugin - tinymce.PluginManager.add('save', tinymce.plugins.Save); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/searchreplace/css/searchreplace.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/searchreplace/css/searchreplace.css deleted file mode 100644 index 3e2eaf34b3e3..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/searchreplace/css/searchreplace.css +++ /dev/null @@ -1,6 +0,0 @@ -.panel_wrapper {height:85px;} -.panel_wrapper div.current {height:85px;} - -/* IE */ -* html .panel_wrapper {height:100px;} -* html .panel_wrapper div.current {height:100px;} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/searchreplace/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/searchreplace/editor_plugin.js deleted file mode 100644 index 165bc12df599..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/searchreplace/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){window.focus();a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:170+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/searchreplace/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/searchreplace/editor_plugin_src.js deleted file mode 100644 index b0c013fdf8d3..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/searchreplace/editor_plugin_src.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.SearchReplacePlugin', { - init : function(ed, url) { - function open(m) { - // Keep IE from writing out the f/r character to the editor - // instance while initializing a new dialog. See: #3131190 - window.focus(); - - ed.windowManager.open({ - file : url + '/searchreplace.htm', - width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), - height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)), - inline : 1, - auto_focus : 0 - }, { - mode : m, - search_string : ed.selection.getContent({format : 'text'}), - plugin_url : url - }); - }; - - // Register commands - ed.addCommand('mceSearch', function() { - open('search'); - }); - - ed.addCommand('mceReplace', function() { - open('replace'); - }); - - // Register buttons - ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); - ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); - - ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch'); - }, - - getInfo : function() { - return { - longname : 'Search/Replace', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/searchreplace/js/searchreplace.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/searchreplace/js/searchreplace.js deleted file mode 100644 index b1630ca8927e..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/searchreplace/js/searchreplace.js +++ /dev/null @@ -1,142 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var SearchReplaceDialog = { - init : function(ed) { - var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); - - t.switchMode(m); - - f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); - - // Focus input field - f[m + '_panel_searchstring'].focus(); - - mcTabs.onChange.add(function(tab_id, panel_id) { - t.switchMode(tab_id.substring(0, tab_id.indexOf('_'))); - }); - }, - - switchMode : function(m) { - var f, lm = this.lastMode; - - if (lm != m) { - f = document.forms[0]; - - if (lm) { - f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; - f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; - f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; - f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; - } - - mcTabs.displayTab(m + '_tab', m + '_panel'); - document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; - document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; - this.lastMode = m; - } - }, - - searchNext : function(a) { - var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; - - // Get input - f = document.forms[0]; - s = f[m + '_panel_searchstring'].value; - b = f[m + '_panel_backwardsu'].checked; - ca = f[m + '_panel_casesensitivebox'].checked; - rs = f['replace_panel_replacestring'].value; - - if (tinymce.isIE) { - r = ed.getDoc().selection.createRange(); - } - - if (s == '') - return; - - function fix() { - // Correct Firefox graphics glitches - // TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? - r = se.getRng().cloneRange(); - ed.getDoc().execCommand('SelectAll', false, null); - se.setRng(r); - }; - - function replace() { - ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE - }; - - // IE flags - if (ca) - fl = fl | 4; - - switch (a) { - case 'all': - // Move caret to beginning of text - ed.execCommand('SelectAll'); - ed.selection.collapse(true); - - if (tinymce.isIE) { - ed.focus(); - r = ed.getDoc().selection.createRange(); - - while (r.findText(s, b ? -1 : 1, fl)) { - r.scrollIntoView(); - r.select(); - replace(); - fo = 1; - - if (b) { - r.moveEnd("character", -(rs.length)); // Otherwise will loop forever - } - } - - tinyMCEPopup.storeSelection(); - } else { - while (w.find(s, ca, b, false, false, false, false)) { - replace(); - fo = 1; - } - } - - if (fo) - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); - else - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); - - return; - - case 'current': - if (!ed.selection.isCollapsed()) - replace(); - - break; - } - - se.collapse(b); - r = se.getRng(); - - // Whats the point - if (!s) - return; - - if (tinymce.isIE) { - ed.focus(); - r = ed.getDoc().selection.createRange(); - - if (r.findText(s, b ? -1 : 1, fl)) { - r.scrollIntoView(); - r.select(); - } else - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); - - tinyMCEPopup.storeSelection(); - } else { - if (!w.find(s, ca, b, false, false, false, false)) - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); - else - fix(); - } - } -}; - -tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/searchreplace/langs/en_dlg.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/searchreplace/langs/en_dlg.js deleted file mode 100644 index 8a65900977a7..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/searchreplace/langs/en_dlg.js +++ /dev/null @@ -1 +0,0 @@ -tinyMCE.addI18n('en.searchreplace_dlg',{findwhat:"Find What",replacewith:"Replace with",direction:"Direction",up:"Up",down:"Down",mcase:"Match Case",findnext:"Find Next",allreplaced:"All occurrences of the search string were replaced.","searchnext_desc":"Find Again",notfound:"The search has been completed. The search string could not be found.","search_title":"Find","replace_title":"Find/Replace",replaceall:"Replace All",replace:"Replace"}); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/searchreplace/searchreplace.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/searchreplace/searchreplace.htm deleted file mode 100644 index bac5a184ff44..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/searchreplace/searchreplace.htm +++ /dev/null @@ -1,100 +0,0 @@ - - - - {#searchreplace_dlg.replace_title} - - - - - - - - -
- - -
-
- - - - - - - - - - - -
- - - - - - - - - -
- - - - - -
-
-
- -
- - - - - - - - - - - - - - - -
- - - - - - - - - -
- - - - - -
-
-
- -
- -
- - - - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/spellchecker/css/content.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/spellchecker/css/content.css deleted file mode 100644 index 656ce1eee606..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/spellchecker/css/content.css +++ /dev/null @@ -1 +0,0 @@ -.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/spellchecker/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/spellchecker/editor_plugin.js deleted file mode 100644 index 71fbb68a6441..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/spellchecker/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=tinymce.util.JSONRequest,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.SpellcheckerPlugin",{getInfo:function(){return{longname:"Spellchecker",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker",version:tinymce.majorVersion+"."+tinymce.minorVersion}},init:function(e,f){var g=this,d;g.url=f;g.editor=e;g.rpcUrl=e.getParam("spellchecker_rpc_url","{backend}");if(g.rpcUrl=="{backend}"){if(tinymce.isIE){return}g.hasSupport=true;e.onContextMenu.addToTop(function(h,i){if(g.active){return false}})}e.addCommand("mceSpellCheck",function(){if(g.rpcUrl=="{backend}"){g.editor.getBody().spellcheck=g.active=!g.active;return}if(!g.active){e.setProgressState(1);g._sendRPC("checkWords",[g.selectedLang,g._getWords()],function(h){if(h.length>0){g.active=1;g._markWords(h);e.setProgressState(0);e.nodeChanged()}else{e.setProgressState(0);if(e.getParam("spellchecker_report_no_misspellings",true)){e.windowManager.alert("spellchecker.no_mpell")}}})}else{g._done()}});if(e.settings.content_css!==false){e.contentCSS.push(f+"/css/content.css")}e.onClick.add(g._showMenu,g);e.onContextMenu.add(g._showMenu,g);e.onBeforeGetContent.add(function(){if(g.active){g._removeWords()}});e.onNodeChange.add(function(i,h){h.setActive("spellchecker",g.active)});e.onSetContent.add(function(){g._done()});e.onBeforeGetContent.add(function(){g._done()});e.onBeforeExecCommand.add(function(h,i){if(i=="mceFullScreen"){g._done()}});g.languages={};c(e.getParam("spellchecker_languages","+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv","hash"),function(i,h){if(h.indexOf("+")===0){h=h.substring(1);g.selectedLang=i}g.languages[h]=i})},createControl:function(h,d){var f=this,g,e=f.editor;if(h=="spellchecker"){if(f.rpcUrl=="{backend}"){if(f.hasSupport){g=d.createButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f})}return g}g=d.createSplitButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f});g.onRenderMenu.add(function(j,i){i.add({title:"spellchecker.langs","class":"mceMenuItemTitle"}).setDisabled(1);c(f.languages,function(n,m){var p={icon:1},l;p.onclick=function(){if(n==f.selectedLang){return}l.setSelected(1);f.selectedItem.setSelected(0);f.selectedItem=l;f.selectedLang=n};p.title=m;l=i.add(p);l.setSelected(n==f.selectedLang);if(n==f.selectedLang){f.selectedItem=l}})});return g}},_walk:function(i,g){var h=this.editor.getDoc(),e;if(h.createTreeWalker){e=h.createTreeWalker(i,NodeFilter.SHOW_TEXT,null,false);while((i=e.nextNode())!=null){g.call(this,i)}}else{tinymce.walk(i,g,"childNodes")}},_getSeparators:function(){var e="",d,f=this.editor.getParam("spellchecker_word_separator_chars",'\\s!"#$%&()*+,-./:;<=>?@[]^_{|}\u201d\u201c');for(d=0;d$2");while((s=p.indexOf(""))!=-1){o=p.substring(0,s);if(o.length){r=j.createTextNode(f.decode(o));q.appendChild(r)}p=p.substring(s+10);s=p.indexOf("");o=p.substring(0,s);p=p.substring(s+11);q.appendChild(f.create("span",{"class":"mceItemHiddenSpellWord"},o))}if(p.length){r=j.createTextNode(f.decode(p));q.appendChild(r)}}else{q.innerHTML=p.replace(e,'$1$2')}f.replace(q,t)}});h.moveToBookmark(i)},_showMenu:function(h,j){var i=this,h=i.editor,d=i._menu,l,k=h.dom,g=k.getViewPort(h.getWin()),f=j.target;j=0;if(!d){d=h.controlManager.createDropMenu("spellcheckermenu",{"class":"mceNoIcons"});i._menu=d}if(k.hasClass(f,"mceItemHiddenSpellWord")){d.removeAll();d.add({title:"spellchecker.wait","class":"mceMenuItemTitle"}).setDisabled(1);i._sendRPC("getSuggestions",[i.selectedLang,k.decode(f.innerHTML)],function(m){var e;d.removeAll();if(m.length>0){d.add({title:"spellchecker.sug","class":"mceMenuItemTitle"}).setDisabled(1);c(m,function(n){d.add({title:n,onclick:function(){k.replace(h.getDoc().createTextNode(n),f);i._checkDone()}})});d.addSeparator()}else{d.add({title:"spellchecker.no_sug","class":"mceMenuItemTitle"}).setDisabled(1)}if(h.getParam("show_ignore_words",true)){e=i.editor.getParam("spellchecker_enable_ignore_rpc","");d.add({title:"spellchecker.ignore_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}}});d.add({title:"spellchecker.ignore_words",onclick:function(){var n=f.innerHTML;i._removeWords(k.decode(n));i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWords",[i.selectedLang,n],function(o){h.setProgressState(0)})}}})}if(i.editor.getParam("spellchecker_enable_learn_rpc")){d.add({title:"spellchecker.learn_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();h.setProgressState(1);i._sendRPC("learnWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}})}d.update()});l=b.getPos(h.getContentAreaContainer());d.settings.offset_x=l.x;d.settings.offset_y=l.y;h.selection.select(f);l=k.getPos(f);d.showMenu(l.x,l.y+f.offsetHeight-g.y);return tinymce.dom.Event.cancel(j)}else{d.hideMenu()}},_checkDone:function(){var e=this,d=e.editor,g=d.dom,f;c(g.select("span"),function(h){if(h&&g.hasClass(h,"mceItemHiddenSpellWord")){f=true;return false}});if(!f){e._done()}},_done:function(){var d=this,e=d.active;if(d.active){d.active=0;d._removeWords();if(d._menu){d._menu.hideMenu()}if(e){d.editor.nodeChanged()}}},_sendRPC:function(e,g,d){var f=this;a.sendRPC({url:f.rpcUrl,method:e,params:g,success:d,error:function(i,h){f.editor.setProgressState(0);f.editor.windowManager.alert(i.errstr||("Error response: "+h.responseText))}})}});tinymce.PluginManager.add("spellchecker",tinymce.plugins.SpellcheckerPlugin)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/spellchecker/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/spellchecker/editor_plugin_src.js deleted file mode 100644 index 24eec5a0147e..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/spellchecker/editor_plugin_src.js +++ /dev/null @@ -1,436 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM; - - tinymce.create('tinymce.plugins.SpellcheckerPlugin', { - getInfo : function() { - return { - longname : 'Spellchecker', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - init : function(ed, url) { - var t = this, cm; - - t.url = url; - t.editor = ed; - t.rpcUrl = ed.getParam("spellchecker_rpc_url", "{backend}"); - - if (t.rpcUrl == '{backend}') { - // Sniff if the browser supports native spellchecking (Don't know of a better way) - if (tinymce.isIE) - return; - - t.hasSupport = true; - - // Disable the context menu when spellchecking is active - ed.onContextMenu.addToTop(function(ed, e) { - if (t.active) - return false; - }); - } - - // Register commands - ed.addCommand('mceSpellCheck', function() { - if (t.rpcUrl == '{backend}') { - // Enable/disable native spellchecker - t.editor.getBody().spellcheck = t.active = !t.active; - return; - } - - if (!t.active) { - ed.setProgressState(1); - t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) { - if (r.length > 0) { - t.active = 1; - t._markWords(r); - ed.setProgressState(0); - ed.nodeChanged(); - } else { - ed.setProgressState(0); - - if (ed.getParam('spellchecker_report_no_misspellings', true)) - ed.windowManager.alert('spellchecker.no_mpell'); - } - }); - } else - t._done(); - }); - - if (ed.settings.content_css !== false) - ed.contentCSS.push(url + '/css/content.css'); - - ed.onClick.add(t._showMenu, t); - ed.onContextMenu.add(t._showMenu, t); - ed.onBeforeGetContent.add(function() { - if (t.active) - t._removeWords(); - }); - - ed.onNodeChange.add(function(ed, cm) { - cm.setActive('spellchecker', t.active); - }); - - ed.onSetContent.add(function() { - t._done(); - }); - - ed.onBeforeGetContent.add(function() { - t._done(); - }); - - ed.onBeforeExecCommand.add(function(ed, cmd) { - if (cmd == 'mceFullScreen') - t._done(); - }); - - // Find selected language - t.languages = {}; - each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) { - if (k.indexOf('+') === 0) { - k = k.substring(1); - t.selectedLang = v; - } - - t.languages[k] = v; - }); - }, - - createControl : function(n, cm) { - var t = this, c, ed = t.editor; - - if (n == 'spellchecker') { - // Use basic button if we use the native spellchecker - if (t.rpcUrl == '{backend}') { - // Create simple toggle button if we have native support - if (t.hasSupport) - c = cm.createButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); - - return c; - } - - c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); - - c.onRenderMenu.add(function(c, m) { - m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - each(t.languages, function(v, k) { - var o = {icon : 1}, mi; - - o.onclick = function() { - if (v == t.selectedLang) { - return; - } - mi.setSelected(1); - t.selectedItem.setSelected(0); - t.selectedItem = mi; - t.selectedLang = v; - }; - - o.title = k; - mi = m.add(o); - mi.setSelected(v == t.selectedLang); - - if (v == t.selectedLang) - t.selectedItem = mi; - }) - }); - - return c; - } - }, - - // Internal functions - - _walk : function(n, f) { - var d = this.editor.getDoc(), w; - - if (d.createTreeWalker) { - w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); - - while ((n = w.nextNode()) != null) - f.call(this, n); - } else - tinymce.walk(n, f, 'childNodes'); - }, - - _getSeparators : function() { - var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}����������������\u201d\u201c'); - - // Build word separator regexp - for (i=0; i elements content is broken after spellchecking. - // Bug #1408: Preceding whitespace characters are removed - // @TODO: I'm not sure that both are still issues on IE9. - if (tinymce.isIE) { - // Enclose mispelled words with temporal tag - v = v.replace(rx, '$1$2'); - // Loop over the content finding mispelled words - while ((pos = v.indexOf('')) != -1) { - // Add text node for the content before the word - txt = v.substring(0, pos); - if (txt.length) { - node = doc.createTextNode(dom.decode(txt)); - elem.appendChild(node); - } - v = v.substring(pos+10); - pos = v.indexOf(''); - txt = v.substring(0, pos); - v = v.substring(pos+11); - // Add span element for the word - elem.appendChild(dom.create('span', {'class' : 'mceItemHiddenSpellWord'}, txt)); - } - // Add text node for the rest of the content - if (v.length) { - node = doc.createTextNode(dom.decode(v)); - elem.appendChild(node); - } - } else { - // Other browsers preserve whitespace characters on innerHTML usage - elem.innerHTML = v.replace(rx, '$1$2'); - } - - // Finally, replace the node with the container - dom.replace(elem, n); - } - }); - - se.moveToBookmark(b); - }, - - _showMenu : function(ed, e) { - var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()), wordSpan = e.target; - - e = 0; // Fixes IE memory leak - - if (!m) { - m = ed.controlManager.createDropMenu('spellcheckermenu', {'class' : 'mceNoIcons'}); - t._menu = m; - } - - if (dom.hasClass(wordSpan, 'mceItemHiddenSpellWord')) { - m.removeAll(); - m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - - t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(wordSpan.innerHTML)], function(r) { - var ignoreRpc; - - m.removeAll(); - - if (r.length > 0) { - m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - each(r, function(v) { - m.add({title : v, onclick : function() { - dom.replace(ed.getDoc().createTextNode(v), wordSpan); - t._checkDone(); - }}); - }); - - m.addSeparator(); - } else - m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - - if (ed.getParam('show_ignore_words', true)) { - ignoreRpc = t.editor.getParam("spellchecker_enable_ignore_rpc", ''); - m.add({ - title : 'spellchecker.ignore_word', - onclick : function() { - var word = wordSpan.innerHTML; - - dom.remove(wordSpan, 1); - t._checkDone(); - - // tell the server if we need to - if (ignoreRpc) { - ed.setProgressState(1); - t._sendRPC('ignoreWord', [t.selectedLang, word], function(r) { - ed.setProgressState(0); - }); - } - } - }); - - m.add({ - title : 'spellchecker.ignore_words', - onclick : function() { - var word = wordSpan.innerHTML; - - t._removeWords(dom.decode(word)); - t._checkDone(); - - // tell the server if we need to - if (ignoreRpc) { - ed.setProgressState(1); - t._sendRPC('ignoreWords', [t.selectedLang, word], function(r) { - ed.setProgressState(0); - }); - } - } - }); - } - - if (t.editor.getParam("spellchecker_enable_learn_rpc")) { - m.add({ - title : 'spellchecker.learn_word', - onclick : function() { - var word = wordSpan.innerHTML; - - dom.remove(wordSpan, 1); - t._checkDone(); - - ed.setProgressState(1); - t._sendRPC('learnWord', [t.selectedLang, word], function(r) { - ed.setProgressState(0); - }); - } - }); - } - - m.update(); - }); - - p1 = DOM.getPos(ed.getContentAreaContainer()); - m.settings.offset_x = p1.x; - m.settings.offset_y = p1.y; - - ed.selection.select(wordSpan); - p1 = dom.getPos(wordSpan); - m.showMenu(p1.x, p1.y + wordSpan.offsetHeight - vp.y); - - return tinymce.dom.Event.cancel(e); - } else - m.hideMenu(); - }, - - _checkDone : function() { - var t = this, ed = t.editor, dom = ed.dom, o; - - each(dom.select('span'), function(n) { - if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) { - o = true; - return false; - } - }); - - if (!o) - t._done(); - }, - - _done : function() { - var t = this, la = t.active; - - if (t.active) { - t.active = 0; - t._removeWords(); - - if (t._menu) - t._menu.hideMenu(); - - if (la) - t.editor.nodeChanged(); - } - }, - - _sendRPC : function(m, p, cb) { - var t = this; - - JSONRequest.sendRPC({ - url : t.rpcUrl, - method : m, - params : p, - success : cb, - error : function(e, x) { - t.editor.setProgressState(0); - t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText)); - } - }); - } - }); - - // Register plugin - tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin); -})(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/spellchecker/img/wline.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/spellchecker/img/wline.gif deleted file mode 100644 index 4dc4a13134e9..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/spellchecker/img/wline.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/style/css/props.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/style/css/props.css deleted file mode 100644 index 5550b093c691..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/style/css/props.css +++ /dev/null @@ -1,13 +0,0 @@ -#text_font {width:250px;} -#text_size {width:70px;} -.mceAddSelectValue {background:#DDD;} -select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;} -#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;} -#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;} -#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;} -.panel_wrapper div.current {padding-top:10px;height:230px;} -.delim {border-left:1px solid gray;} -.tdelim {border-bottom:1px solid gray;} -#block_display {width:145px;} -#list_type {width:115px;} -.disabled {background:#EEE;} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/style/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/style/editor_plugin.js deleted file mode 100644 index cab2153c40f1..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/style/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.StylePlugin",{init:function(a,b){a.addCommand("mceStyleProps",function(){a.windowManager.open({file:b+"/props.htm",width:480+parseInt(a.getLang("style.delta_width",0)),height:320+parseInt(a.getLang("style.delta_height",0)),inline:1},{plugin_url:b,style_text:a.selection.getNode().style.cssText})});a.addCommand("mceSetElementStyle",function(d,c){if(e=a.selection.getNode()){a.dom.setAttrib(e,"style",c);a.execCommand("mceRepaint")}});a.onNodeChange.add(function(d,c,f){c.setDisabled("styleprops",f.nodeName==="BODY")});a.addButton("styleprops",{title:"style.desc",cmd:"mceStyleProps"})},getInfo:function(){return{longname:"Style",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("style",tinymce.plugins.StylePlugin)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/style/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/style/editor_plugin_src.js deleted file mode 100644 index c09d5e81bda7..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/style/editor_plugin_src.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.StylePlugin', { - init : function(ed, url) { - // Register commands - ed.addCommand('mceStyleProps', function() { - ed.windowManager.open({ - file : url + '/props.htm', - width : 480 + parseInt(ed.getLang('style.delta_width', 0)), - height : 320 + parseInt(ed.getLang('style.delta_height', 0)), - inline : 1 - }, { - plugin_url : url, - style_text : ed.selection.getNode().style.cssText - }); - }); - - ed.addCommand('mceSetElementStyle', function(ui, v) { - if (e = ed.selection.getNode()) { - ed.dom.setAttrib(e, 'style', v); - ed.execCommand('mceRepaint'); - } - }); - - ed.onNodeChange.add(function(ed, cm, n) { - cm.setDisabled('styleprops', n.nodeName === 'BODY'); - }); - - // Register buttons - ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'}); - }, - - getInfo : function() { - return { - longname : 'Style', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/style/js/props.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/style/js/props.js deleted file mode 100644 index 999831635ea8..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/style/js/props.js +++ /dev/null @@ -1,635 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var defaultFonts = "" + - "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + - "Times New Roman, Times, serif=Times New Roman, Times, serif;" + - "Courier New, Courier, mono=Courier New, Courier, mono;" + - "Times New Roman, Times, serif=Times New Roman, Times, serif;" + - "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + - "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + - "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif"; - -var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"; -var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; -var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%"; -var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; -var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900"; -var defaultTextStyle = "normal;italic;oblique"; -var defaultVariant = "normal;small-caps"; -var defaultLineHeight = "normal"; -var defaultAttachment = "fixed;scroll"; -var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y"; -var defaultPosH = "left;center;right"; -var defaultPosV = "top;center;bottom"; -var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom"; -var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none"; -var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset"; -var defaultBorderWidth = "thin;medium;thick"; -var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none"; - -function init() { - var ce = document.getElementById('container'), h; - - ce.style.cssText = tinyMCEPopup.getWindowArg('style_text'); - - h = getBrowserHTML('background_image_browser','background_image','image','advimage'); - document.getElementById("background_image_browser").innerHTML = h; - - document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color'); - document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color'); - document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top'); - document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right'); - document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom'); - document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left'); - - fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true); - fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true); - fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true); - fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true); - fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true); - fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true); - fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true); - fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true); - fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true); - - fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true); - fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true); - - fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true); - fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true); - fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true); - fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true); - fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true); - fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true); - fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true); - fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true); - fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true); - - fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true); - fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true); - fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true); - fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true); - fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true); - fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true); - - fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true); - fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true); - fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true); - fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true); - - fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true); - fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true); - - fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true); - fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true); - - fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true); - - fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true); - - TinyMCE_EditableSelects.init(); - setupFormData(); - showDisabledControls(); -} - -function setupFormData() { - var ce = document.getElementById('container'), f = document.forms[0], s, b, i; - - // Setup text fields - - selectByValue(f, 'text_font', ce.style.fontFamily, true, true); - selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true); - selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize)); - selectByValue(f, 'text_weight', ce.style.fontWeight, true, true); - selectByValue(f, 'text_style', ce.style.fontStyle, true, true); - selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true); - selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight)); - selectByValue(f, 'text_case', ce.style.textTransform, true, true); - selectByValue(f, 'text_variant', ce.style.fontVariant, true, true); - f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color); - updateColor('text_color_pick', 'text_color'); - f.text_underline.checked = inStr(ce.style.textDecoration, 'underline'); - f.text_overline.checked = inStr(ce.style.textDecoration, 'overline'); - f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through'); - f.text_blink.checked = inStr(ce.style.textDecoration, 'blink'); - - // Setup background fields - - f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor); - updateColor('background_color_pick', 'background_color'); - f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); - selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true); - selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true); - selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true); - selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0))); - selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true); - selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1))); - - // Setup block fields - - selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true); - selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing)); - selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true); - selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing)); - selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true); - selectByValue(f, 'block_text_align', ce.style.textAlign, true, true); - f.block_text_indent.value = getNum(ce.style.textIndent); - selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent)); - selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true); - selectByValue(f, 'block_display', ce.style.display, true, true); - - // Setup box fields - - f.box_width.value = getNum(ce.style.width); - selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width)); - - f.box_height.value = getNum(ce.style.height); - selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height)); - selectByValue(f, 'box_float', ce.style.cssFloat || ce.style.styleFloat, true, true); - - selectByValue(f, 'box_clear', ce.style.clear, true, true); - - setupBox(f, ce, 'box_padding', 'padding', ''); - setupBox(f, ce, 'box_margin', 'margin', ''); - - // Setup border fields - - setupBox(f, ce, 'border_style', 'border', 'Style'); - setupBox(f, ce, 'border_width', 'border', 'Width'); - setupBox(f, ce, 'border_color', 'border', 'Color'); - - updateColor('border_color_top_pick', 'border_color_top'); - updateColor('border_color_right_pick', 'border_color_right'); - updateColor('border_color_bottom_pick', 'border_color_bottom'); - updateColor('border_color_left_pick', 'border_color_left'); - - f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value); - f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value); - f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value); - f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value); - - // Setup list fields - - selectByValue(f, 'list_type', ce.style.listStyleType, true, true); - selectByValue(f, 'list_position', ce.style.listStylePosition, true, true); - f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); - - // Setup box fields - - selectByValue(f, 'positioning_type', ce.style.position, true, true); - selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true); - selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true); - f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : ""; - - f.positioning_width.value = getNum(ce.style.width); - selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width)); - - f.positioning_height.value = getNum(ce.style.height); - selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height)); - - setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']); - - s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1"); - s = s.replace(/,/g, ' '); - - if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) { - f.positioning_clip_top.value = getNum(getVal(s, 0)); - selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); - f.positioning_clip_right.value = getNum(getVal(s, 1)); - selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1))); - f.positioning_clip_bottom.value = getNum(getVal(s, 2)); - selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2))); - f.positioning_clip_left.value = getNum(getVal(s, 3)); - selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3))); - } else { - f.positioning_clip_top.value = getNum(getVal(s, 0)); - selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); - f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value; - } - -// setupBox(f, ce, '', 'border', 'Color'); -} - -function getMeasurement(s) { - return s.replace(/^([0-9.]+)(.*)$/, "$2"); -} - -function getNum(s) { - if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s)) - return s.replace(/[^0-9.]/g, ''); - - return s; -} - -function inStr(s, n) { - return new RegExp(n, 'gi').test(s); -} - -function getVal(s, i) { - var a = s.split(' '); - - if (a.length > 1) - return a[i]; - - return ""; -} - -function setValue(f, n, v) { - if (f.elements[n].type == "text") - f.elements[n].value = v; - else - selectByValue(f, n, v, true, true); -} - -function setupBox(f, ce, fp, pr, sf, b) { - if (typeof(b) == "undefined") - b = ['Top', 'Right', 'Bottom', 'Left']; - - if (isSame(ce, pr, sf, b)) { - f.elements[fp + "_same"].checked = true; - - setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); - f.elements[fp + "_top"].disabled = false; - - f.elements[fp + "_right"].value = ""; - f.elements[fp + "_right"].disabled = true; - f.elements[fp + "_bottom"].value = ""; - f.elements[fp + "_bottom"].disabled = true; - f.elements[fp + "_left"].value = ""; - f.elements[fp + "_left"].disabled = true; - - if (f.elements[fp + "_top_measurement"]) { - selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); - f.elements[fp + "_left_measurement"].disabled = true; - f.elements[fp + "_bottom_measurement"].disabled = true; - f.elements[fp + "_right_measurement"].disabled = true; - } - } else { - f.elements[fp + "_same"].checked = false; - - setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); - f.elements[fp + "_top"].disabled = false; - - setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf])); - f.elements[fp + "_right"].disabled = false; - - setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf])); - f.elements[fp + "_bottom"].disabled = false; - - setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf])); - f.elements[fp + "_left"].disabled = false; - - if (f.elements[fp + "_top_measurement"]) { - selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); - selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf])); - selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf])); - selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf])); - f.elements[fp + "_left_measurement"].disabled = false; - f.elements[fp + "_bottom_measurement"].disabled = false; - f.elements[fp + "_right_measurement"].disabled = false; - } - } -} - -function isSame(e, pr, sf, b) { - var a = [], i, x; - - if (typeof(b) == "undefined") - b = ['Top', 'Right', 'Bottom', 'Left']; - - if (typeof(sf) == "undefined" || sf == null) - sf = ""; - - a[0] = e.style[pr + b[0] + sf]; - a[1] = e.style[pr + b[1] + sf]; - a[2] = e.style[pr + b[2] + sf]; - a[3] = e.style[pr + b[3] + sf]; - - for (i=0; i 0 ? s.substring(1) : s; - - if (f.text_none.checked) - s = "none"; - - ce.style.textDecoration = s; - - // Build background styles - - ce.style.backgroundColor = f.background_color.value; - ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : ""; - ce.style.backgroundRepeat = f.background_repeat.value; - ce.style.backgroundAttachment = f.background_attachment.value; - - if (f.background_hpos.value != "") { - s = ""; - s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " "; - s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : ""); - ce.style.backgroundPosition = s; - } - - // Build block styles - - ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : ""); - ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : ""); - ce.style.verticalAlign = f.block_vertical_alignment.value; - ce.style.textAlign = f.block_text_align.value; - ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : ""); - ce.style.whiteSpace = f.block_whitespace.value; - ce.style.display = f.block_display.value; - - // Build box styles - - ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : ""); - ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : ""); - ce.style.styleFloat = f.box_float.value; - ce.style.cssFloat = f.box_float.value; - - ce.style.clear = f.box_clear.value; - - if (!f.box_padding_same.checked) { - ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); - ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : ""); - ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : ""); - ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : ""); - } else - ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); - - if (!f.box_margin_same.checked) { - ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); - ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : ""); - ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : ""); - ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : ""); - } else - ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); - - // Build border styles - - if (!f.border_style_same.checked) { - ce.style.borderTopStyle = f.border_style_top.value; - ce.style.borderRightStyle = f.border_style_right.value; - ce.style.borderBottomStyle = f.border_style_bottom.value; - ce.style.borderLeftStyle = f.border_style_left.value; - } else - ce.style.borderStyle = f.border_style_top.value; - - if (!f.border_width_same.checked) { - ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); - ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : ""); - ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : ""); - ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : ""); - } else - ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); - - if (!f.border_color_same.checked) { - ce.style.borderTopColor = f.border_color_top.value; - ce.style.borderRightColor = f.border_color_right.value; - ce.style.borderBottomColor = f.border_color_bottom.value; - ce.style.borderLeftColor = f.border_color_left.value; - } else - ce.style.borderColor = f.border_color_top.value; - - // Build list styles - - ce.style.listStyleType = f.list_type.value; - ce.style.listStylePosition = f.list_position.value; - ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : ""; - - // Build positioning styles - - ce.style.position = f.positioning_type.value; - ce.style.visibility = f.positioning_visibility.value; - - if (ce.style.width == "") - ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : ""); - - if (ce.style.height == "") - ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : ""); - - ce.style.zIndex = f.positioning_zindex.value; - ce.style.overflow = f.positioning_overflow.value; - - if (!f.positioning_placement_same.checked) { - ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); - ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : ""); - ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : ""); - ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : ""); - } else { - s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); - ce.style.top = s; - ce.style.right = s; - ce.style.bottom = s; - ce.style.left = s; - } - - if (!f.positioning_clip_same.checked) { - s = "rect("; - s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " "; - s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " "; - s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " "; - s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto"); - s += ")"; - - if (s != "rect(auto auto auto auto)") - ce.style.clip = s; - } else { - s = "rect("; - t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto"; - s += t + " "; - s += t + " "; - s += t + " "; - s += t + ")"; - - if (s != "rect(auto auto auto auto)") - ce.style.clip = s; - } - - ce.style.cssText = ce.style.cssText; -} - -function isNum(s) { - return new RegExp('[0-9]+', 'g').test(s); -} - -function showDisabledControls() { - var f = document.forms, i, a; - - for (i=0; i 1) { - addSelectValue(f, s, p[0], p[1]); - - if (se) - selectByValue(f, s, p[1]); - } else { - addSelectValue(f, s, p[0], p[0]); - - if (se) - selectByValue(f, s, p[0]); - } - } -} - -function toggleSame(ce, pre) { - var el = document.forms[0].elements, i; - - if (ce.checked) { - el[pre + "_top"].disabled = false; - el[pre + "_right"].disabled = true; - el[pre + "_bottom"].disabled = true; - el[pre + "_left"].disabled = true; - - if (el[pre + "_top_measurement"]) { - el[pre + "_top_measurement"].disabled = false; - el[pre + "_right_measurement"].disabled = true; - el[pre + "_bottom_measurement"].disabled = true; - el[pre + "_left_measurement"].disabled = true; - } - } else { - el[pre + "_top"].disabled = false; - el[pre + "_right"].disabled = false; - el[pre + "_bottom"].disabled = false; - el[pre + "_left"].disabled = false; - - if (el[pre + "_top_measurement"]) { - el[pre + "_top_measurement"].disabled = false; - el[pre + "_right_measurement"].disabled = false; - el[pre + "_bottom_measurement"].disabled = false; - el[pre + "_left_measurement"].disabled = false; - } - } - - showDisabledControls(); -} - -function synch(fr, to) { - var f = document.forms[0]; - - f.elements[to].value = f.elements[fr].value; - - if (f.elements[fr + "_measurement"]) - selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value); -} - -tinyMCEPopup.onInit.add(init); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/style/langs/en_dlg.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/style/langs/en_dlg.js deleted file mode 100644 index 9a1d4a22303f..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/style/langs/en_dlg.js +++ /dev/null @@ -1 +0,0 @@ -tinyMCE.addI18n('en.style_dlg',{"text_lineheight":"Line Height","text_variant":"Variant","text_style":"Style","text_weight":"Weight","text_size":"Size","text_font":"Font","text_props":"Text","positioning_tab":"Positioning","list_tab":"List","border_tab":"Border","box_tab":"Box","block_tab":"Block","background_tab":"Background","text_tab":"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility","positioning_type":"Type",position:"Position","bullet_image":"Bullet Image","list_type":"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for All",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Height","box_width":"Width","block_display":"Display","block_whitespace":"Whitespace","block_text_indent":"Text Indent","block_text_align":"Text Align","block_vertical_alignment":"Vertical Alignment","block_letterspacing":"Letter Spacing","block_wordspacing":"Word Spacing","background_vpos":"Vertical Position","background_hpos":"Horizontal Position","background_attachment":"Attachment","background_repeat":"Repeat","background_image":"Background Image","background_color":"Background Color","text_none":"None","text_blink":"Blink","text_case":"Case","text_striketrough":"Strikethrough","text_underline":"Underline","text_overline":"Overline","text_decoration":"Decoration","text_color":"Color",text:"Text",background:"Background",block:"Block",box:"Box",border:"Border",list:"List"}); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/style/props.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/style/props.htm deleted file mode 100644 index 76ab68d896ff..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/style/props.htm +++ /dev/null @@ -1,840 +0,0 @@ - - - - {#style_dlg.title} - - - - - - - - - - -
- - -
-
-
- {#style_dlg.text} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
  - - -
-
- -
- - - -
- - - - - - -
- -   - - -
-
- -
- - - - - -
 
-
{#style_dlg.text_decoration} - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-
- {#style_dlg.background} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
 
-
- - - - -
 
-
- - - - - - -
  - - -
-
- - - - - - -
  - - -
-
-
-
- -
-
- {#style_dlg.block} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - -
  - - -
-
- - - - - - -
  - - -
-
- - - - - - -
  - - - -
-
-
-
- -
-
- {#style_dlg.box} - - - - - - - - - - - - - - -
- - - - - - -
  - - -
-
   
- - - - - - -
  - - -
-
   
-
- -
-
- {#style_dlg.padding} - - - - - - - - - - - - - - - - - - - - - - -
 
- - - - - - -
  - - -
-
- - - - - - -
  - - -
-
- - - - - - -
  - - -
-
- - - - - - -
  - - -
-
-
-
- -
-
- {#style_dlg.margin} - - - - - - - - - - - - - - - - - - - - - - -
 
- - - - - - -
  - - -
-
- - - - - - -
  - - -
-
- - - - - - -
  - - -
-
- - - - - - -
  - - -
-
-
-
-
-
- -
-
- {#style_dlg.border} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  {#style_dlg.style} {#style_dlg.width} {#style_dlg.color}
      
{#style_dlg.top}   - - - - - - -
  - - -
-
  - - - - - -
 
-
{#style_dlg.right}   - - - - - - -
  - - -
-
  - - - - - -
 
-
{#style_dlg.bottom}   - - - - - - -
  - - -
-
  - - - - - -
 
-
{#style_dlg.left}   - - - - - - -
  - - -
-
  - - - - - -
 
-
-
-
- -
-
- {#style_dlg.list} - - - - - - - - - - - - - - - -
-
-
- -
-
- {#style_dlg.position} - - - - - - - - - - - - - - - - - - - - - -
   
- - - - - - -
  - - -
-
   
- - - - - - -
  - - -
-
   
-
- -
-
- {#style_dlg.placement} - - - - - - - - - - - - - - - - - - - - - - -
 
{#style_dlg.top} - - - - - - -
  - - -
-
{#style_dlg.right} - - - - - - -
  - - -
-
{#style_dlg.bottom} - - - - - - -
  - - -
-
{#style_dlg.left} - - - - - - -
  - - -
-
-
-
- -
-
- {#style_dlg.clip} - - - - - - - - - - - - - - - - - - - - - - -
 
{#style_dlg.top} - - - - - - -
  - - -
-
{#style_dlg.right} - - - - - - -
  - - -
-
{#style_dlg.bottom} - - - - - - -
  - - -
-
{#style_dlg.left} - - - - - - -
  - - -
-
-
-
-
-
-
- -
- - - -
-
- -
-
-
- - - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/tabfocus/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/tabfocus/editor_plugin.js deleted file mode 100644 index 42a82d112c5d..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/tabfocus/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(t){n=c.select(":input:enabled,*[tabindex]");function s(v){return v.nodeName==="BODY"||(v.type!="hidden"&&!(v.style.display=="none")&&!(v.style.visibility=="hidden")&&s(v.parentNode))}function i(v){return v.attributes.tabIndex.specified||v.nodeName=="INPUT"||v.nodeName=="TEXTAREA"}function u(){return tinymce.isIE6||tinymce.isIE7}function r(v){return((!u()||i(v)))&&v.getAttribute("tabindex")!="-1"&&s(v)}d(n,function(w,v){if(w.id==l.id){j=v;return false}});if(t>0){for(m=j+1;m=0;m--){if(r(n[m])){return n[m]}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(n.id&&(l=tinymce.get(n.id||n.name))){l.focus()}else{window.setTimeout(function(){if(!tinymce.isWebKit){window.focus()}n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/tabfocus/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/tabfocus/editor_plugin_src.js deleted file mode 100644 index a1579c85f227..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/tabfocus/editor_plugin_src.js +++ /dev/null @@ -1,122 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode; - - tinymce.create('tinymce.plugins.TabFocusPlugin', { - init : function(ed, url) { - function tabCancel(ed, e) { - if (e.keyCode === 9) - return Event.cancel(e); - } - - function tabHandler(ed, e) { - var x, i, f, el, v; - - function find(d) { - el = DOM.select(':input:enabled,*[tabindex]'); - - function canSelectRecursive(e) { - return e.nodeName==="BODY" || (e.type != 'hidden' && - !(e.style.display == "none") && - !(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode)); - } - function canSelectInOldIe(el) { - return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA"; - } - function isOldIe() { - return tinymce.isIE6 || tinymce.isIE7; - } - function canSelect(el) { - return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el); - } - - each(el, function(e, i) { - if (e.id == ed.id) { - x = i; - return false; - } - }); - if (d > 0) { - for (i = x + 1; i < el.length; i++) { - if (canSelect(el[i])) - return el[i]; - } - } else { - for (i = x - 1; i >= 0; i--) { - if (canSelect(el[i])) - return el[i]; - } - } - - return null; - } - - if (e.keyCode === 9) { - v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next'))); - - if (v.length == 1) { - v[1] = v[0]; - v[0] = ':prev'; - } - - // Find element to focus - if (e.shiftKey) { - if (v[0] == ':prev') - el = find(-1); - else - el = DOM.get(v[0]); - } else { - if (v[1] == ':next') - el = find(1); - else - el = DOM.get(v[1]); - } - - if (el) { - if (el.id && (ed = tinymce.get(el.id || el.name))) - ed.focus(); - else - window.setTimeout(function() { - if (!tinymce.isWebKit) - window.focus(); - el.focus(); - }, 10); - - return Event.cancel(e); - } - } - } - - ed.onKeyUp.add(tabCancel); - - if (tinymce.isGecko) { - ed.onKeyPress.add(tabHandler); - ed.onKeyDown.add(tabCancel); - } else - ed.onKeyDown.add(tabHandler); - - }, - - getInfo : function() { - return { - longname : 'Tabfocus', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin); -})(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/cell.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/cell.htm deleted file mode 100644 index 2922f7a2ddb4..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/cell.htm +++ /dev/null @@ -1,180 +0,0 @@ - - - - {#table_dlg.cell_title} - - - - - - - - - -
- - -
-
-
- {#table_dlg.general_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - -
- -
-
-
- -
-
- {#table_dlg.advanced_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- - - - - -
 
-
- - - - - -
 
-
- - - - - -
 
-
-
-
-
- -
-
- -
- - - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/css/cell.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/css/cell.css deleted file mode 100644 index a47cc1a1efef..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/css/cell.css +++ /dev/null @@ -1,17 +0,0 @@ -/* CSS file for cell dialog in the table plugin */ - -.panel_wrapper div.current { - height: 200px; -} - -.advfield { - width: 200px; -} - -#action { - margin-bottom: 3px; -} - -#class { - width: 150px; -} \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/css/row.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/css/row.css deleted file mode 100644 index 0e397db3e25f..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/css/row.css +++ /dev/null @@ -1,25 +0,0 @@ -/* CSS file for row dialog in the table plugin */ - -.panel_wrapper div.current { - height: 200px; -} - -.advfield { - width: 200px; -} - -#action { - margin-bottom: 3px; -} - -#rowtype,#align,#valign,#class,#height { - width: 150px; -} - -#height { - width: 50px; -} - -.col2 { - padding-left: 20px; -} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/css/table.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/css/table.css deleted file mode 100644 index 8f107831efa4..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/css/table.css +++ /dev/null @@ -1,13 +0,0 @@ -/* CSS file for table dialog in the table plugin */ - -.panel_wrapper div.current { - height: 245px; -} - -.advfield { - width: 200px; -} - -#class { - width: 150px; -} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/editor_plugin.js deleted file mode 100644 index 2f3b0e2d7a8b..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(d){var e=d.each;function c(g,h){var j=h.ownerDocument,f=j.createRange(),k;f.setStartBefore(h);f.setEnd(g.endContainer,g.endOffset);k=j.createElement("body");k.appendChild(f.cloneContents());return k.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function a(g,f){return parseInt(g.getAttribute(f)||1)}function b(H,G,K){var g,L,D,o;t();o=G.getParent(K.getStart(),"th,td");if(o){L=F(o);D=I();o=z(L.x,L.y)}function A(N,M){N=N.cloneNode(M);N.removeAttribute("id");return N}function t(){var M=0;g=[];e(["thead","tbody","tfoot"],function(N){var O=G.select("> "+N+" tr",H);e(O,function(P,Q){Q+=M;e(G.select("> td, > th",P),function(W,R){var S,T,U,V;if(g[Q]){while(g[Q][R]){R++}}U=a(W,"rowspan");V=a(W,"colspan");for(T=Q;T'}return false}},"childNodes");M=A(M,false);s(M,"rowSpan",1);s(M,"colSpan",1);if(N){M.appendChild(N)}else{if(!d.isIE){M.innerHTML='
'}}return M}function q(){var M=G.createRng();e(G.select("tr",H),function(N){if(N.cells.length==0){G.remove(N)}});if(G.select("tr",H).length==0){M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H);return}e(G.select("thead,tbody,tfoot",H),function(N){if(N.rows.length==0){G.remove(N)}});t();row=g[Math.min(g.length-1,L.y)];if(row){K.select(row[Math.min(row.length-1,L.x)].elm,true);K.collapse(true)}}function u(S,Q,U,R){var P,N,M,O,T;P=g[Q][S].elm.parentNode;for(M=1;M<=U;M++){P=G.getNext(P,"tr");if(P){for(N=S;N>=0;N--){T=g[Q+M][N].elm;if(T.parentNode==P){for(O=1;O<=R;O++){G.insertAfter(f(T),T)}break}}if(N==-1){for(O=1;O<=R;O++){P.insertBefore(f(P.cells[0]),P.cells[0])}}}}}function C(){e(g,function(M,N){e(M,function(P,O){var S,R,T,Q;if(j(P)){P=P.elm;S=a(P,"colspan");R=a(P,"rowspan");if(S>1||R>1){s(P,"rowSpan",1);s(P,"colSpan",1);for(Q=0;Q1){s(S,"rowSpan",O+1);continue}}else{if(M>0&&g[M-1][R]){V=g[M-1][R].elm;O=a(V,"rowSpan");if(O>1){s(V,"rowSpan",O+1);continue}}}N=f(S);s(N,"colSpan",S.colSpan);U.appendChild(N);P=S}}if(U.hasChildNodes()){if(!Q){G.insertAfter(U,T)}else{T.parentNode.insertBefore(U,T)}}}function h(N){var O,M;e(g,function(P,Q){e(P,function(S,R){if(j(S)){O=R;if(N){return false}}});if(N){return !O}});e(g,function(S,T){var P,Q,R;if(!S[O]){return}P=S[O].elm;if(P!=M){R=a(P,"colspan");Q=a(P,"rowspan");if(R==1){if(!N){G.insertAfter(f(P),P);u(O,T,Q-1,R)}else{P.parentNode.insertBefore(f(P),P);u(O,T,Q-1,R)}}else{s(P,"colSpan",P.colSpan+1)}M=P}})}function n(){var M=[];e(g,function(N,O){e(N,function(Q,P){if(j(Q)&&d.inArray(M,P)===-1){e(g,function(T){var R=T[P].elm,S;S=a(R,"colSpan");if(S>1){s(R,"colSpan",S-1)}else{G.remove(R)}});M.push(P)}})});q()}function m(){var N;function M(Q){var P,R,O;P=G.getNext(Q,"tr");e(Q.cells,function(S){var T=a(S,"rowSpan");if(T>1){s(S,"rowSpan",T-1);R=F(S);u(R.x,R.y,1,1)}});R=F(Q.cells[0]);e(g[R.y],function(S){var T;S=S.elm;if(S!=O){T=a(S,"rowSpan");if(T<=1){G.remove(S)}else{s(S,"rowSpan",T-1)}O=S}})}N=k();e(N.reverse(),function(O){M(O)});q()}function E(){var M=k();G.remove(M);q();return M}function J(){var M=k();e(M,function(O,N){M[N]=A(O,true)});return M}function B(O,N){var P=k(),M=P[N?0:P.length-1],Q=M.cells.length;e(g,function(S){var R;Q=0;e(S,function(U,T){if(U.real){Q+=U.colspan}if(U.elm.parentNode==M){R=1}});if(R){return false}});if(!N){O.reverse()}e(O,function(T){var S=T.cells.length,R;for(i=0;iN){N=R}if(Q>M){M=Q}if(S.real){U=S.colspan-1;T=S.rowspan-1;if(U){if(R+U>N){N=R+U}}if(T){if(Q+T>M){M=Q+T}}}}})});return{x:N,y:M}}function v(S){var P,O,U,T,N,M,Q,R;D=F(S);if(L&&D){P=Math.min(L.x,D.x);O=Math.min(L.y,D.y);U=Math.max(L.x,D.x);T=Math.max(L.y,D.y);N=U;M=T;for(y=O;y<=M;y++){S=g[y][P];if(!S.real){if(P-(S.colspan-1)N){N=x+Q}}if(R){if(y+R>M){M=y+R}}}}}G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=O;y<=M;y++){for(x=P;x<=N;x++){if(g[y][x]){G.addClass(g[y][x].elm,"mceSelected")}}}}}d.extend(this,{deleteTable:r,split:C,merge:p,insertRow:l,insertCol:h,deleteCols:n,deleteRows:m,cutRows:E,copyRows:J,pasteRows:B,getPos:F,setStartCell:w,setEndCell:v})}d.create("tinymce.plugins.TablePlugin",{init:function(g,h){var f,m,j=true;function l(p){var o=g.selection,n=g.dom.getParent(p||o.getNode(),"table");if(n){return new b(n,g.dom,o)}}function k(){g.getBody().style.webkitUserSelect="";if(j){g.dom.removeClass(g.dom.select("td.mceSelected,th.mceSelected"),"mceSelected");j=false}}e([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(n){g.addButton(n[0],{title:n[1],cmd:n[2],ui:n[3]})});if(!d.isIE){g.onClick.add(function(n,o){o=o.target;if(o.nodeName==="TABLE"){n.selection.select(o);n.nodeChanged()}})}g.onPreProcess.add(function(o,p){var n,q,r,t=o.dom,s;n=t.select("table",p.node);q=n.length;while(q--){r=n[q];t.setAttrib(r,"data-mce-style","");if((s=t.getAttrib(r,"width"))){t.setStyle(r,"width",s);t.setAttrib(r,"width","")}if((s=t.getAttrib(r,"height"))){t.setStyle(r,"height",s);t.setAttrib(r,"height","")}}});g.onNodeChange.add(function(q,o,s){var r;s=q.selection.getStart();r=q.dom.getParent(s,"td,th,caption");o.setActive("table",s.nodeName==="TABLE"||!!r);if(r&&r.nodeName==="CAPTION"){r=0}o.setDisabled("delete_table",!r);o.setDisabled("delete_col",!r);o.setDisabled("delete_table",!r);o.setDisabled("delete_row",!r);o.setDisabled("col_after",!r);o.setDisabled("col_before",!r);o.setDisabled("row_after",!r);o.setDisabled("row_before",!r);o.setDisabled("row_props",!r);o.setDisabled("cell_props",!r);o.setDisabled("split_cells",!r);o.setDisabled("merge_cells",!r)});g.onInit.add(function(r){var p,t,q=r.dom,u;f=r.windowManager;r.onMouseDown.add(function(w,z){if(z.button!=2){k();t=q.getParent(z.target,"td,th");p=q.getParent(t,"table")}});q.bind(r.getDoc(),"mouseover",function(C){var A,z,B=C.target;if(t&&(u||B!=t)&&(B.nodeName=="TD"||B.nodeName=="TH")){z=q.getParent(B,"table");if(z==p){if(!u){u=l(z);u.setStartCell(t);r.getBody().style.webkitUserSelect="none"}u.setEndCell(B);j=true}A=r.selection.getSel();try{if(A.removeAllRanges){A.removeAllRanges()}else{A.empty()}}catch(w){}C.preventDefault()}});r.onMouseUp.add(function(F,G){var z,B=F.selection,H,I=B.getSel(),w,C,A,E;if(t){if(u){F.getBody().style.webkitUserSelect=""}function D(J,L){var K=new d.dom.TreeWalker(J,J);do{if(J.nodeType==3&&d.trim(J.nodeValue).length!=0){if(L){z.setStart(J,0)}else{z.setEnd(J,J.nodeValue.length)}return}if(J.nodeName=="BR"){if(L){z.setStartBefore(J)}else{z.setEndBefore(J)}return}}while(J=(L?K.next():K.prev()))}H=q.select("td.mceSelected,th.mceSelected");if(H.length>0){z=q.createRng();C=H[0];E=H[H.length-1];z.setStartBefore(C);z.setEndAfter(C);D(C,1);w=new d.dom.TreeWalker(C,q.getParent(H[0],"table"));do{if(C.nodeName=="TD"||C.nodeName=="TH"){if(!q.hasClass(C,"mceSelected")){break}A=C}}while(C=w.next());D(A);B.setRng(z)}F.nodeChanged();t=u=p=null}});r.onKeyUp.add(function(w,z){k()});r.onKeyDown.add(function(w,z){n(w)});r.onMouseDown.add(function(w,z){if(z.button!=2){n(w)}});function o(D,z,A,F){var B=3,G=D.dom.getParent(z.startContainer,"TABLE"),C,w,E;if(G){C=G.parentNode}w=z.startContainer.nodeType==B&&z.startOffset==0&&z.endOffset==0&&F&&(A.nodeName=="TR"||A==C);E=(A.nodeName=="TD"||A.nodeName=="TH")&&!F;return w||E}function n(A){if(!d.isWebKit){return}var z=A.selection.getRng();var C=A.selection.getNode();var B=A.dom.getParent(z.startContainer,"TD,TH");if(!o(A,z,C,B)){return}if(!B){B=C}var w=B.lastChild;while(w.lastChild){w=w.lastChild}z.setEnd(w,w.nodeValue.length);A.selection.setRng(z)}r.plugins.table.fixTableCellSelection=n;if(r&&r.plugins.contextmenu){r.plugins.contextmenu.onContextMenu.add(function(A,w,C){var D,B=r.selection,z=B.getNode()||r.getBody();if(r.dom.getParent(C,"td")||r.dom.getParent(C,"th")||r.dom.select("td.mceSelected,th.mceSelected").length){w.removeAll();if(z.nodeName=="A"&&!r.dom.getAttrib(z,"name")){w.add({title:"advanced.link_desc",icon:"link",cmd:r.plugins.advlink?"mceAdvLink":"mceLink",ui:true});w.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});w.addSeparator()}if(z.nodeName=="IMG"&&z.className.indexOf("mceItem")==-1){w.add({title:"advanced.image_desc",icon:"image",cmd:r.plugins.advimage?"mceAdvImage":"mceImage",ui:true});w.addSeparator()}w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});w.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});w.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});w.addSeparator();D=w.addMenu({title:"table.cell"});D.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});D.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});D.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});D=w.addMenu({title:"table.row"});D.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});D.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});D.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});D.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});D.addSeparator();D.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});D.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});D.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!m);D.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!m);D=w.addMenu({title:"table.col"});D.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});D.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});D.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(d.isWebKit){function v(C,N){var L=d.VK;var Q=N.keyCode;function O(Y,U,S){var T=Y?"previousSibling":"nextSibling";var Z=C.dom.getParent(U,"tr");var X=Z[T];if(X){z(C,U,X,Y);d.dom.Event.cancel(S);return true}else{var aa=C.dom.getParent(Z,"table");var W=Z.parentNode;var R=W.nodeName.toLowerCase();if(R==="tbody"||R===(Y?"tfoot":"thead")){var V=w(Y,aa,W,"tbody");if(V!==null){return K(Y,V,U,S)}}return M(Y,Z,T,aa,S)}}function w(V,T,U,X){var S=C.dom.select(">"+X,T);var R=S.indexOf(U);if(V&&R===0||!V&&R===S.length-1){return B(V,T)}else{if(R===-1){var W=U.tagName.toLowerCase()==="thead"?0:S.length-1;return S[W]}else{return S[R+(V?-1:1)]}}}function B(U,T){var S=U?"thead":"tfoot";var R=C.dom.select(">"+S,T);return R.length!==0?R[0]:null}function K(V,T,S,U){var R=J(T,V);R&&z(C,S,R,V);d.dom.Event.cancel(U);return true}function M(Y,U,R,X,W){var S=X[R];if(S){F(S);return true}else{var V=C.dom.getParent(X,"td,th");if(V){return O(Y,V,W)}else{var T=J(U,!Y);F(T);return d.dom.Event.cancel(W)}}}function J(S,R){return S&&S[R?"lastChild":"firstChild"]}function F(R){C.selection.setCursorLocation(R,0)}function A(){return Q==L.UP||Q==L.DOWN}function D(R){var T=R.selection.getNode();var S=R.dom.getParent(T,"tr");return S!==null}function P(S){var R=0;var T=S;while(T.previousSibling){T=T.previousSibling;R=R+a(T,"colspan")}return R}function E(T,R){var U=0;var S=0;e(T.children,function(V,W){U=U+a(V,"colspan");S=W;if(U>R){return false}});return S}function z(T,W,Y,V){var X=P(T.dom.getParent(W,"td,th"));var S=E(Y,X);var R=Y.childNodes[S];var U=J(R,V);F(U||R)}function H(R){var T=C.selection.getNode();var U=C.dom.getParent(T,"td,th");var S=C.dom.getParent(R,"td,th");return U&&U!==S&&I(U,S)}function I(S,R){return C.dom.getParent(S,"TABLE")===C.dom.getParent(R,"TABLE")}if(A()&&D(C)){var G=C.selection.getNode();setTimeout(function(){if(H(G)){O(!N.shiftKey&&Q===L.UP,G,N)}},0)}}r.onKeyDown.add(v)}if(!d.isIE){function s(){var w;for(w=r.getBody().lastChild;w&&w.nodeType==3&&!w.nodeValue.length;w=w.previousSibling){}if(w&&w.nodeName=="TABLE"){r.dom.add(r.getBody(),"p",null,'
')}}if(d.isGecko){r.onKeyDown.add(function(z,B){var w,A,C=z.dom;if(B.keyCode==37||B.keyCode==38){w=z.selection.getRng();A=C.getParent(w.startContainer,"table");if(A&&z.getBody().firstChild==A){if(c(w,A)){w=C.createRng();w.setStartBefore(A);w.setEndBefore(A);z.selection.setRng(w);B.preventDefault()}}}})}r.onKeyUp.add(s);r.onSetContent.add(s);r.onVisualAid.add(s);r.onPreProcess.add(function(w,A){var z=A.node.lastChild;if(z&&z.childNodes.length==1&&z.firstChild.nodeName=="BR"){w.dom.remove(z)}});s();r.startContent=r.getContent({format:"raw"})}});e({mceTableSplitCells:function(n){n.split()},mceTableMergeCells:function(o){var p,q,n;n=g.dom.getParent(g.selection.getNode(),"th,td");if(n){p=n.rowSpan;q=n.colSpan}if(!g.dom.select("td.mceSelected,th.mceSelected").length){f.open({url:h+"/merge_cells.htm",width:240+parseInt(g.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(g.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:p,cols:q,onaction:function(r){o.merge(n,r.cols,r.rows)},plugin_url:h})}else{o.merge()}},mceTableInsertRowBefore:function(n){n.insertRow(true)},mceTableInsertRowAfter:function(n){n.insertRow()},mceTableInsertColBefore:function(n){n.insertCol(true)},mceTableInsertColAfter:function(n){n.insertCol()},mceTableDeleteCol:function(n){n.deleteCols()},mceTableDeleteRow:function(n){n.deleteRows()},mceTableCutRow:function(n){m=n.cutRows()},mceTableCopyRow:function(n){m=n.copyRows()},mceTablePasteRowBefore:function(n){n.pasteRows(m,true)},mceTablePasteRowAfter:function(n){n.pasteRows(m)},mceTableDelete:function(n){n.deleteTable()}},function(o,n){g.addCommand(n,function(){var p=l();if(p){o(p);g.execCommand("mceRepaint");k()}})});e({mceInsertTable:function(n){f.open({url:h+"/table.htm",width:400+parseInt(g.getLang("table.table_delta_width",0)),height:320+parseInt(g.getLang("table.table_delta_height",0)),inline:1},{plugin_url:h,action:n?n.action:0})},mceTableRowProps:function(){f.open({url:h+"/row.htm",width:400+parseInt(g.getLang("table.rowprops_delta_width",0)),height:295+parseInt(g.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:h})},mceTableCellProps:function(){f.open({url:h+"/cell.htm",width:400+parseInt(g.getLang("table.cellprops_delta_width",0)),height:295+parseInt(g.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:h})}},function(o,n){g.addCommand(n,function(p,q){o(q)})})}});d.PluginManager.add("table",d.plugins.TablePlugin)})(tinymce); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/editor_plugin_src.js deleted file mode 100644 index 512f3520f2ef..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/editor_plugin_src.js +++ /dev/null @@ -1,1408 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var each = tinymce.each; - - // Checks if the selection/caret is at the start of the specified block element - function isAtStart(rng, par) { - var doc = par.ownerDocument, rng2 = doc.createRange(), elm; - - rng2.setStartBefore(par); - rng2.setEnd(rng.endContainer, rng.endOffset); - - elm = doc.createElement('body'); - elm.appendChild(rng2.cloneContents()); - - // Check for text characters of other elements that should be treated as content - return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0; - }; - - function getSpanVal(td, name) { - return parseInt(td.getAttribute(name) || 1); - } - - /** - * Table Grid class. - */ - function TableGrid(table, dom, selection) { - var grid, startPos, endPos, selectedCell; - - buildGrid(); - selectedCell = dom.getParent(selection.getStart(), 'th,td'); - if (selectedCell) { - startPos = getPos(selectedCell); - endPos = findEndPos(); - selectedCell = getCell(startPos.x, startPos.y); - } - - function cloneNode(node, children) { - node = node.cloneNode(children); - node.removeAttribute('id'); - - return node; - } - - function buildGrid() { - var startY = 0; - - grid = []; - - each(['thead', 'tbody', 'tfoot'], function(part) { - var rows = dom.select('> ' + part + ' tr', table); - - each(rows, function(tr, y) { - y += startY; - - each(dom.select('> td, > th', tr), function(td, x) { - var x2, y2, rowspan, colspan; - - // Skip over existing cells produced by rowspan - if (grid[y]) { - while (grid[y][x]) - x++; - } - - // Get col/rowspan from cell - rowspan = getSpanVal(td, 'rowspan'); - colspan = getSpanVal(td, 'colspan'); - - // Fill out rowspan/colspan right and down - for (y2 = y; y2 < y + rowspan; y2++) { - if (!grid[y2]) - grid[y2] = []; - - for (x2 = x; x2 < x + colspan; x2++) { - grid[y2][x2] = { - part : part, - real : y2 == y && x2 == x, - elm : td, - rowspan : rowspan, - colspan : colspan - }; - } - } - }); - }); - - startY += rows.length; - }); - }; - - function getCell(x, y) { - var row; - - row = grid[y]; - if (row) - return row[x]; - }; - - function setSpanVal(td, name, val) { - if (td) { - val = parseInt(val); - - if (val === 1) - td.removeAttribute(name, 1); - else - td.setAttribute(name, val, 1); - } - } - - function isCellSelected(cell) { - return cell && (dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell); - }; - - function getSelectedRows() { - var rows = []; - - each(table.rows, function(row) { - each(row.cells, function(cell) { - if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) { - rows.push(row); - return false; - } - }); - }); - - return rows; - }; - - function deleteTable() { - var rng = dom.createRng(); - - rng.setStartAfter(table); - rng.setEndAfter(table); - - selection.setRng(rng); - - dom.remove(table); - }; - - function cloneCell(cell) { - var formatNode; - - // Clone formats - tinymce.walk(cell, function(node) { - var curNode; - - if (node.nodeType == 3) { - each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { - node = cloneNode(node, false); - - if (!formatNode) - formatNode = curNode = node; - else if (curNode) - curNode.appendChild(node); - - curNode = node; - }); - - // Add something to the inner node - if (curNode) - curNode.innerHTML = tinymce.isIE ? ' ' : '
'; - - return false; - } - }, 'childNodes'); - - cell = cloneNode(cell, false); - setSpanVal(cell, 'rowSpan', 1); - setSpanVal(cell, 'colSpan', 1); - - if (formatNode) { - cell.appendChild(formatNode); - } else { - if (!tinymce.isIE) - cell.innerHTML = '
'; - } - - return cell; - }; - - function cleanup() { - var rng = dom.createRng(); - - // Empty rows - each(dom.select('tr', table), function(tr) { - if (tr.cells.length == 0) - dom.remove(tr); - }); - - // Empty table - if (dom.select('tr', table).length == 0) { - rng.setStartAfter(table); - rng.setEndAfter(table); - selection.setRng(rng); - dom.remove(table); - return; - } - - // Empty header/body/footer - each(dom.select('thead,tbody,tfoot', table), function(part) { - if (part.rows.length == 0) - dom.remove(part); - }); - - // Restore selection to start position if it still exists - buildGrid(); - - // Restore the selection to the closest table position - row = grid[Math.min(grid.length - 1, startPos.y)]; - if (row) { - selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true); - selection.collapse(true); - } - }; - - function fillLeftDown(x, y, rows, cols) { - var tr, x2, r, c, cell; - - tr = grid[y][x].elm.parentNode; - for (r = 1; r <= rows; r++) { - tr = dom.getNext(tr, 'tr'); - - if (tr) { - // Loop left to find real cell - for (x2 = x; x2 >= 0; x2--) { - cell = grid[y + r][x2].elm; - - if (cell.parentNode == tr) { - // Append clones after - for (c = 1; c <= cols; c++) - dom.insertAfter(cloneCell(cell), cell); - - break; - } - } - - if (x2 == -1) { - // Insert nodes before first cell - for (c = 1; c <= cols; c++) - tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]); - } - } - } - }; - - function split() { - each(grid, function(row, y) { - each(row, function(cell, x) { - var colSpan, rowSpan, newCell, i; - - if (isCellSelected(cell)) { - cell = cell.elm; - colSpan = getSpanVal(cell, 'colspan'); - rowSpan = getSpanVal(cell, 'rowspan'); - - if (colSpan > 1 || rowSpan > 1) { - setSpanVal(cell, 'rowSpan', 1); - setSpanVal(cell, 'colSpan', 1); - - // Insert cells right - for (i = 0; i < colSpan - 1; i++) - dom.insertAfter(cloneCell(cell), cell); - - fillLeftDown(x, y, rowSpan - 1, colSpan); - } - } - }); - }); - }; - - function merge(cell, cols, rows) { - var startX, startY, endX, endY, x, y, startCell, endCell, cell, children, count; - - // Use specified cell and cols/rows - if (cell) { - pos = getPos(cell); - startX = pos.x; - startY = pos.y; - endX = startX + (cols - 1); - endY = startY + (rows - 1); - } else { - // Use selection - startX = startPos.x; - startY = startPos.y; - endX = endPos.x; - endY = endPos.y; - } - - // Find start/end cells - startCell = getCell(startX, startY); - endCell = getCell(endX, endY); - - // Check if the cells exists and if they are of the same part for example tbody = tbody - if (startCell && endCell && startCell.part == endCell.part) { - // Split and rebuild grid - split(); - buildGrid(); - - // Set row/col span to start cell - startCell = getCell(startX, startY).elm; - setSpanVal(startCell, 'colSpan', (endX - startX) + 1); - setSpanVal(startCell, 'rowSpan', (endY - startY) + 1); - - // Remove other cells and add it's contents to the start cell - for (y = startY; y <= endY; y++) { - for (x = startX; x <= endX; x++) { - if (!grid[y] || !grid[y][x]) - continue; - - cell = grid[y][x].elm; - - if (cell != startCell) { - // Move children to startCell - children = tinymce.grep(cell.childNodes); - each(children, function(node) { - startCell.appendChild(node); - }); - - // Remove bogus nodes if there is children in the target cell - if (children.length) { - children = tinymce.grep(startCell.childNodes); - count = 0; - each(children, function(node) { - if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) - startCell.removeChild(node); - }); - } - - // Remove cell - dom.remove(cell); - } - } - } - - // Remove empty rows etc and restore caret location - cleanup(); - } - }; - - function insertRow(before) { - var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan; - - // Find first/last row - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell)) { - cell = cell.elm; - rowElm = cell.parentNode; - newRow = cloneNode(rowElm, false); - posY = y; - - if (before) - return false; - } - }); - - if (before) - return !posY; - }); - - for (x = 0; x < grid[0].length; x++) { - // Cell not found could be because of an invalid table structure - if (!grid[posY][x]) - continue; - - cell = grid[posY][x].elm; - - if (cell != lastCell) { - if (!before) { - rowSpan = getSpanVal(cell, 'rowspan'); - if (rowSpan > 1) { - setSpanVal(cell, 'rowSpan', rowSpan + 1); - continue; - } - } else { - // Check if cell above can be expanded - if (posY > 0 && grid[posY - 1][x]) { - otherCell = grid[posY - 1][x].elm; - rowSpan = getSpanVal(otherCell, 'rowSpan'); - if (rowSpan > 1) { - setSpanVal(otherCell, 'rowSpan', rowSpan + 1); - continue; - } - } - } - - // Insert new cell into new row - newCell = cloneCell(cell); - setSpanVal(newCell, 'colSpan', cell.colSpan); - - newRow.appendChild(newCell); - - lastCell = cell; - } - } - - if (newRow.hasChildNodes()) { - if (!before) - dom.insertAfter(newRow, rowElm); - else - rowElm.parentNode.insertBefore(newRow, rowElm); - } - }; - - function insertCol(before) { - var posX, lastCell; - - // Find first/last column - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell)) { - posX = x; - - if (before) - return false; - } - }); - - if (before) - return !posX; - }); - - each(grid, function(row, y) { - var cell, rowSpan, colSpan; - - if (!row[posX]) - return; - - cell = row[posX].elm; - if (cell != lastCell) { - colSpan = getSpanVal(cell, 'colspan'); - rowSpan = getSpanVal(cell, 'rowspan'); - - if (colSpan == 1) { - if (!before) { - dom.insertAfter(cloneCell(cell), cell); - fillLeftDown(posX, y, rowSpan - 1, colSpan); - } else { - cell.parentNode.insertBefore(cloneCell(cell), cell); - fillLeftDown(posX, y, rowSpan - 1, colSpan); - } - } else - setSpanVal(cell, 'colSpan', cell.colSpan + 1); - - lastCell = cell; - } - }); - }; - - function deleteCols() { - var cols = []; - - // Get selected column indexes - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) { - each(grid, function(row) { - var cell = row[x].elm, colSpan; - - colSpan = getSpanVal(cell, 'colSpan'); - - if (colSpan > 1) - setSpanVal(cell, 'colSpan', colSpan - 1); - else - dom.remove(cell); - }); - - cols.push(x); - } - }); - }); - - cleanup(); - }; - - function deleteRows() { - var rows; - - function deleteRow(tr) { - var nextTr, pos, lastCell; - - nextTr = dom.getNext(tr, 'tr'); - - // Move down row spanned cells - each(tr.cells, function(cell) { - var rowSpan = getSpanVal(cell, 'rowSpan'); - - if (rowSpan > 1) { - setSpanVal(cell, 'rowSpan', rowSpan - 1); - pos = getPos(cell); - fillLeftDown(pos.x, pos.y, 1, 1); - } - }); - - // Delete cells - pos = getPos(tr.cells[0]); - each(grid[pos.y], function(cell) { - var rowSpan; - - cell = cell.elm; - - if (cell != lastCell) { - rowSpan = getSpanVal(cell, 'rowSpan'); - - if (rowSpan <= 1) - dom.remove(cell); - else - setSpanVal(cell, 'rowSpan', rowSpan - 1); - - lastCell = cell; - } - }); - }; - - // Get selected rows and move selection out of scope - rows = getSelectedRows(); - - // Delete all selected rows - each(rows.reverse(), function(tr) { - deleteRow(tr); - }); - - cleanup(); - }; - - function cutRows() { - var rows = getSelectedRows(); - - dom.remove(rows); - cleanup(); - - return rows; - }; - - function copyRows() { - var rows = getSelectedRows(); - - each(rows, function(row, i) { - rows[i] = cloneNode(row, true); - }); - - return rows; - }; - - function pasteRows(rows, before) { - var selectedRows = getSelectedRows(), - targetRow = selectedRows[before ? 0 : selectedRows.length - 1], - targetCellCount = targetRow.cells.length; - - // Calc target cell count - each(grid, function(row) { - var match; - - targetCellCount = 0; - each(row, function(cell, x) { - if (cell.real) - targetCellCount += cell.colspan; - - if (cell.elm.parentNode == targetRow) - match = 1; - }); - - if (match) - return false; - }); - - if (!before) - rows.reverse(); - - each(rows, function(row) { - var cellCount = row.cells.length, cell; - - // Remove col/rowspans - for (i = 0; i < cellCount; i++) { - cell = row.cells[i]; - setSpanVal(cell, 'colSpan', 1); - setSpanVal(cell, 'rowSpan', 1); - } - - // Needs more cells - for (i = cellCount; i < targetCellCount; i++) - row.appendChild(cloneCell(row.cells[cellCount - 1])); - - // Needs less cells - for (i = targetCellCount; i < cellCount; i++) - dom.remove(row.cells[i]); - - // Add before/after - if (before) - targetRow.parentNode.insertBefore(row, targetRow); - else - dom.insertAfter(row, targetRow); - }); - }; - - function getPos(target) { - var pos; - - each(grid, function(row, y) { - each(row, function(cell, x) { - if (cell.elm == target) { - pos = {x : x, y : y}; - return false; - } - }); - - return !pos; - }); - - return pos; - }; - - function setStartCell(cell) { - startPos = getPos(cell); - }; - - function findEndPos() { - var pos, maxX, maxY; - - maxX = maxY = 0; - - each(grid, function(row, y) { - each(row, function(cell, x) { - var colSpan, rowSpan; - - if (isCellSelected(cell)) { - cell = grid[y][x]; - - if (x > maxX) - maxX = x; - - if (y > maxY) - maxY = y; - - if (cell.real) { - colSpan = cell.colspan - 1; - rowSpan = cell.rowspan - 1; - - if (colSpan) { - if (x + colSpan > maxX) - maxX = x + colSpan; - } - - if (rowSpan) { - if (y + rowSpan > maxY) - maxY = y + rowSpan; - } - } - } - }); - }); - - return {x : maxX, y : maxY}; - }; - - function setEndCell(cell) { - var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan; - - endPos = getPos(cell); - - if (startPos && endPos) { - // Get start/end positions - startX = Math.min(startPos.x, endPos.x); - startY = Math.min(startPos.y, endPos.y); - endX = Math.max(startPos.x, endPos.x); - endY = Math.max(startPos.y, endPos.y); - - // Expand end positon to include spans - maxX = endX; - maxY = endY; - - // Expand startX - for (y = startY; y <= maxY; y++) { - cell = grid[y][startX]; - - if (!cell.real) { - if (startX - (cell.colspan - 1) < startX) - startX -= cell.colspan - 1; - } - } - - // Expand startY - for (x = startX; x <= maxX; x++) { - cell = grid[startY][x]; - - if (!cell.real) { - if (startY - (cell.rowspan - 1) < startY) - startY -= cell.rowspan - 1; - } - } - - // Find max X, Y - for (y = startY; y <= endY; y++) { - for (x = startX; x <= endX; x++) { - cell = grid[y][x]; - - if (cell.real) { - colSpan = cell.colspan - 1; - rowSpan = cell.rowspan - 1; - - if (colSpan) { - if (x + colSpan > maxX) - maxX = x + colSpan; - } - - if (rowSpan) { - if (y + rowSpan > maxY) - maxY = y + rowSpan; - } - } - } - } - - // Remove current selection - dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); - - // Add new selection - for (y = startY; y <= maxY; y++) { - for (x = startX; x <= maxX; x++) { - if (grid[y][x]) - dom.addClass(grid[y][x].elm, 'mceSelected'); - } - } - } - }; - - // Expose to public - tinymce.extend(this, { - deleteTable : deleteTable, - split : split, - merge : merge, - insertRow : insertRow, - insertCol : insertCol, - deleteCols : deleteCols, - deleteRows : deleteRows, - cutRows : cutRows, - copyRows : copyRows, - pasteRows : pasteRows, - getPos : getPos, - setStartCell : setStartCell, - setEndCell : setEndCell - }); - }; - - tinymce.create('tinymce.plugins.TablePlugin', { - init : function(ed, url) { - var winMan, clipboardRows, hasCellSelection = true; // Might be selected cells on reload - - function createTableGrid(node) { - var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table'); - - if (tblElm) - return new TableGrid(tblElm, ed.dom, selection); - }; - - function cleanup() { - // Restore selection possibilities - ed.getBody().style.webkitUserSelect = ''; - - if (hasCellSelection) { - ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); - hasCellSelection = false; - } - }; - - // Register buttons - each([ - ['table', 'table.desc', 'mceInsertTable', true], - ['delete_table', 'table.del', 'mceTableDelete'], - ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'], - ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'], - ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'], - ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'], - ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'], - ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'], - ['row_props', 'table.row_desc', 'mceTableRowProps', true], - ['cell_props', 'table.cell_desc', 'mceTableCellProps', true], - ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true], - ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true] - ], function(c) { - ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]}); - }); - - // Select whole table is a table border is clicked - if (!tinymce.isIE) { - ed.onClick.add(function(ed, e) { - e = e.target; - - if (e.nodeName === 'TABLE') { - ed.selection.select(e); - ed.nodeChanged(); - } - }); - } - - ed.onPreProcess.add(function(ed, args) { - var nodes, i, node, dom = ed.dom, value; - - nodes = dom.select('table', args.node); - i = nodes.length; - while (i--) { - node = nodes[i]; - dom.setAttrib(node, 'data-mce-style', ''); - - if ((value = dom.getAttrib(node, 'width'))) { - dom.setStyle(node, 'width', value); - dom.setAttrib(node, 'width', ''); - } - - if ((value = dom.getAttrib(node, 'height'))) { - dom.setStyle(node, 'height', value); - dom.setAttrib(node, 'height', ''); - } - } - }); - - // Handle node change updates - ed.onNodeChange.add(function(ed, cm, n) { - var p; - - n = ed.selection.getStart(); - p = ed.dom.getParent(n, 'td,th,caption'); - cm.setActive('table', n.nodeName === 'TABLE' || !!p); - - // Disable table tools if we are in caption - if (p && p.nodeName === 'CAPTION') - p = 0; - - cm.setDisabled('delete_table', !p); - cm.setDisabled('delete_col', !p); - cm.setDisabled('delete_table', !p); - cm.setDisabled('delete_row', !p); - cm.setDisabled('col_after', !p); - cm.setDisabled('col_before', !p); - cm.setDisabled('row_after', !p); - cm.setDisabled('row_before', !p); - cm.setDisabled('row_props', !p); - cm.setDisabled('cell_props', !p); - cm.setDisabled('split_cells', !p); - cm.setDisabled('merge_cells', !p); - }); - - ed.onInit.add(function(ed) { - var startTable, startCell, dom = ed.dom, tableGrid; - - winMan = ed.windowManager; - - // Add cell selection logic - ed.onMouseDown.add(function(ed, e) { - if (e.button != 2) { - cleanup(); - - startCell = dom.getParent(e.target, 'td,th'); - startTable = dom.getParent(startCell, 'table'); - } - }); - - dom.bind(ed.getDoc(), 'mouseover', function(e) { - var sel, table, target = e.target; - - if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) { - table = dom.getParent(target, 'table'); - if (table == startTable) { - if (!tableGrid) { - tableGrid = createTableGrid(table); - tableGrid.setStartCell(startCell); - - ed.getBody().style.webkitUserSelect = 'none'; - } - - tableGrid.setEndCell(target); - hasCellSelection = true; - } - - // Remove current selection - sel = ed.selection.getSel(); - - try { - if (sel.removeAllRanges) - sel.removeAllRanges(); - else - sel.empty(); - } catch (ex) { - // IE9 might throw errors here - } - - e.preventDefault(); - } - }); - - ed.onMouseUp.add(function(ed, e) { - var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode; - - // Move selection to startCell - if (startCell) { - if (tableGrid) - ed.getBody().style.webkitUserSelect = ''; - - function setPoint(node, start) { - var walker = new tinymce.dom.TreeWalker(node, node); - - do { - // Text node - if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { - if (start) - rng.setStart(node, 0); - else - rng.setEnd(node, node.nodeValue.length); - - return; - } - - // BR element - if (node.nodeName == 'BR') { - if (start) - rng.setStartBefore(node); - else - rng.setEndBefore(node); - - return; - } - } while (node = (start ? walker.next() : walker.prev())); - } - - // Try to expand text selection as much as we can only Gecko supports cell selection - selectedCells = dom.select('td.mceSelected,th.mceSelected'); - if (selectedCells.length > 0) { - rng = dom.createRng(); - node = selectedCells[0]; - endNode = selectedCells[selectedCells.length - 1]; - rng.setStartBefore(node); - rng.setEndAfter(node); - - setPoint(node, 1); - walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table')); - - do { - if (node.nodeName == 'TD' || node.nodeName == 'TH') { - if (!dom.hasClass(node, 'mceSelected')) - break; - - lastNode = node; - } - } while (node = walker.next()); - - setPoint(lastNode); - - sel.setRng(rng); - } - - ed.nodeChanged(); - startCell = tableGrid = startTable = null; - } - }); - - ed.onKeyUp.add(function(ed, e) { - cleanup(); - }); - - ed.onKeyDown.add(function (ed, e) { - fixTableCellSelection(ed); - }); - - ed.onMouseDown.add(function (ed, e) { - if (e.button != 2) { - fixTableCellSelection(ed); - } - }); - function tableCellSelected(ed, rng, n, currentCell) { - // The decision of when a table cell is selected is somewhat involved. The fact that this code is - // required is actually a pointer to the root cause of this bug. A cell is selected when the start - // and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases) - // or the parent of the table (in the case of the selection containing the last cell of a table). - var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'), - tableParent, allOfCellSelected, tableCellSelection; - if (table) - tableParent = table.parentNode; - allOfCellSelected =rng.startContainer.nodeType == TEXT_NODE && - rng.startOffset == 0 && - rng.endOffset == 0 && - currentCell && - (n.nodeName=="TR" || n==tableParent); - tableCellSelection = (n.nodeName=="TD"||n.nodeName=="TH")&& !currentCell; - return allOfCellSelected || tableCellSelection; - // return false; - } - - // this nasty hack is here to work around some WebKit selection bugs. - function fixTableCellSelection(ed) { - if (!tinymce.isWebKit) - return; - - var rng = ed.selection.getRng(); - var n = ed.selection.getNode(); - var currentCell = ed.dom.getParent(rng.startContainer, 'TD,TH'); - - if (!tableCellSelected(ed, rng, n, currentCell)) - return; - if (!currentCell) { - currentCell=n; - } - - // Get the very last node inside the table cell - var end = currentCell.lastChild; - while (end.lastChild) - end = end.lastChild; - - // Select the entire table cell. Nothing outside of the table cell should be selected. - rng.setEnd(end, end.nodeValue.length); - ed.selection.setRng(rng); - } - ed.plugins.table.fixTableCellSelection=fixTableCellSelection; - - // Add context menu - if (ed && ed.plugins.contextmenu) { - ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { - var sm, se = ed.selection, el = se.getNode() || ed.getBody(); - - if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) { - m.removeAll(); - - if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) { - m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); - m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); - m.addSeparator(); - } - - if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) { - m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); - m.addSeparator(); - } - - m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}}); - m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'}); - m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'}); - m.addSeparator(); - - // Cell menu - sm = m.addMenu({title : 'table.cell'}); - sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'}); - sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'}); - sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'}); - - // Row menu - sm = m.addMenu({title : 'table.row'}); - sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'}); - sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'}); - sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'}); - sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'}); - sm.addSeparator(); - sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'}); - sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'}); - sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows); - sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows); - - // Column menu - sm = m.addMenu({title : 'table.col'}); - sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'}); - sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'}); - sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'}); - } else - m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'}); - }); - } - - // Fix to allow navigating up and down in a table in WebKit browsers. - if (tinymce.isWebKit) { - function moveSelection(ed, e) { - var VK = tinymce.VK; - var key = e.keyCode; - - function handle(upBool, sourceNode, event) { - var siblingDirection = upBool ? 'previousSibling' : 'nextSibling'; - var currentRow = ed.dom.getParent(sourceNode, 'tr'); - var siblingRow = currentRow[siblingDirection]; - - if (siblingRow) { - moveCursorToRow(ed, sourceNode, siblingRow, upBool); - tinymce.dom.Event.cancel(event); - return true; - } else { - var tableNode = ed.dom.getParent(currentRow, 'table'); - var middleNode = currentRow.parentNode; - var parentNodeName = middleNode.nodeName.toLowerCase(); - if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) { - var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody'); - if (targetParent !== null) { - return moveToRowInTarget(upBool, targetParent, sourceNode, event); - } - } - return escapeTable(upBool, currentRow, siblingDirection, tableNode, event); - } - } - - function getTargetParent(upBool, topNode, secondNode, nodeName) { - var tbodies = ed.dom.select('>' + nodeName, topNode); - var position = tbodies.indexOf(secondNode); - if (upBool && position === 0 || !upBool && position === tbodies.length - 1) { - return getFirstHeadOrFoot(upBool, topNode); - } else if (position === -1) { - var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1; - return tbodies[topOrBottom]; - } else { - return tbodies[position + (upBool ? -1 : 1)]; - } - } - - function getFirstHeadOrFoot(upBool, parent) { - var tagName = upBool ? 'thead' : 'tfoot'; - var headOrFoot = ed.dom.select('>' + tagName, parent); - return headOrFoot.length !== 0 ? headOrFoot[0] : null; - } - - function moveToRowInTarget(upBool, targetParent, sourceNode, event) { - var targetRow = getChildForDirection(targetParent, upBool); - targetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool); - tinymce.dom.Event.cancel(event); - return true; - } - - function escapeTable(upBool, currentRow, siblingDirection, table, event) { - var tableSibling = table[siblingDirection]; - if (tableSibling) { - moveCursorToStartOfElement(tableSibling); - return true; - } else { - var parentCell = ed.dom.getParent(table, 'td,th'); - if (parentCell) { - return handle(upBool, parentCell, event); - } else { - var backUpSibling = getChildForDirection(currentRow, !upBool); - moveCursorToStartOfElement(backUpSibling); - return tinymce.dom.Event.cancel(event); - } - } - } - - function getChildForDirection(parent, up) { - return parent && parent[up ? 'lastChild' : 'firstChild']; - } - - function moveCursorToStartOfElement(n) { - ed.selection.setCursorLocation(n, 0); - } - - function isVerticalMovement() { - return key == VK.UP || key == VK.DOWN; - } - - function isInTable(ed) { - var node = ed.selection.getNode(); - var currentRow = ed.dom.getParent(node, 'tr'); - return currentRow !== null; - } - - function columnIndex(column) { - var colIndex = 0; - var c = column; - while (c.previousSibling) { - c = c.previousSibling; - colIndex = colIndex + getSpanVal(c, "colspan"); - } - return colIndex; - } - - function findColumn(rowElement, columnIndex) { - var c = 0; - var r = 0; - each(rowElement.children, function(cell, i) { - c = c + getSpanVal(cell, "colspan"); - r = i; - if (c > columnIndex) - return false; - }); - return r; - } - - function moveCursorToRow(ed, node, row, upBool) { - var srcColumnIndex = columnIndex(ed.dom.getParent(node, 'td,th')); - var tgtColumnIndex = findColumn(row, srcColumnIndex); - var tgtNode = row.childNodes[tgtColumnIndex]; - var rowCellTarget = getChildForDirection(tgtNode, upBool); - moveCursorToStartOfElement(rowCellTarget || tgtNode); - } - - function shouldFixCaret(preBrowserNode) { - var newNode = ed.selection.getNode(); - var newParent = ed.dom.getParent(newNode, 'td,th'); - var oldParent = ed.dom.getParent(preBrowserNode, 'td,th'); - return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent) - } - - function checkSameParentTable(nodeOne, NodeTwo) { - return ed.dom.getParent(nodeOne, 'TABLE') === ed.dom.getParent(NodeTwo, 'TABLE'); - } - - if (isVerticalMovement() && isInTable(ed)) { - var preBrowserNode = ed.selection.getNode(); - setTimeout(function() { - if (shouldFixCaret(preBrowserNode)) { - handle(!e.shiftKey && key === VK.UP, preBrowserNode, e); - } - }, 0); - } - } - - ed.onKeyDown.add(moveSelection); - } - - // Fixes an issue on Gecko where it's impossible to place the caret behind a table - // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled - if (!tinymce.isIE) { - function fixTableCaretPos() { - var last; - - // Skip empty text nodes form the end - for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling); - - if (last && last.nodeName == 'TABLE') - ed.dom.add(ed.getBody(), 'p', null, '
'); - }; - - // Fixes an bug where it's impossible to place the caret before a table in Gecko - // this fix solves it by detecting when the caret is at the beginning of such a table - // and then manually moves the caret infront of the table - if (tinymce.isGecko) { - ed.onKeyDown.add(function(ed, e) { - var rng, table, dom = ed.dom; - - // On gecko it's not possible to place the caret before a table - if (e.keyCode == 37 || e.keyCode == 38) { - rng = ed.selection.getRng(); - table = dom.getParent(rng.startContainer, 'table'); - - if (table && ed.getBody().firstChild == table) { - if (isAtStart(rng, table)) { - rng = dom.createRng(); - - rng.setStartBefore(table); - rng.setEndBefore(table); - - ed.selection.setRng(rng); - - e.preventDefault(); - } - } - } - }); - } - - ed.onKeyUp.add(fixTableCaretPos); - ed.onSetContent.add(fixTableCaretPos); - ed.onVisualAid.add(fixTableCaretPos); - - ed.onPreProcess.add(function(ed, o) { - var last = o.node.lastChild; - - if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR') - ed.dom.remove(last); - }); - - fixTableCaretPos(); - ed.startContent = ed.getContent({format : 'raw'}); - } - }); - - // Register action commands - each({ - mceTableSplitCells : function(grid) { - grid.split(); - }, - - mceTableMergeCells : function(grid) { - var rowSpan, colSpan, cell; - - cell = ed.dom.getParent(ed.selection.getNode(), 'th,td'); - if (cell) { - rowSpan = cell.rowSpan; - colSpan = cell.colSpan; - } - - if (!ed.dom.select('td.mceSelected,th.mceSelected').length) { - winMan.open({ - url : url + '/merge_cells.htm', - width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)), - height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)), - inline : 1 - }, { - rows : rowSpan, - cols : colSpan, - onaction : function(data) { - grid.merge(cell, data.cols, data.rows); - }, - plugin_url : url - }); - } else - grid.merge(); - }, - - mceTableInsertRowBefore : function(grid) { - grid.insertRow(true); - }, - - mceTableInsertRowAfter : function(grid) { - grid.insertRow(); - }, - - mceTableInsertColBefore : function(grid) { - grid.insertCol(true); - }, - - mceTableInsertColAfter : function(grid) { - grid.insertCol(); - }, - - mceTableDeleteCol : function(grid) { - grid.deleteCols(); - }, - - mceTableDeleteRow : function(grid) { - grid.deleteRows(); - }, - - mceTableCutRow : function(grid) { - clipboardRows = grid.cutRows(); - }, - - mceTableCopyRow : function(grid) { - clipboardRows = grid.copyRows(); - }, - - mceTablePasteRowBefore : function(grid) { - grid.pasteRows(clipboardRows, true); - }, - - mceTablePasteRowAfter : function(grid) { - grid.pasteRows(clipboardRows); - }, - - mceTableDelete : function(grid) { - grid.deleteTable(); - } - }, function(func, name) { - ed.addCommand(name, function() { - var grid = createTableGrid(); - - if (grid) { - func(grid); - ed.execCommand('mceRepaint'); - cleanup(); - } - }); - }); - - // Register dialog commands - each({ - mceInsertTable : function(val) { - winMan.open({ - url : url + '/table.htm', - width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)), - height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)), - inline : 1 - }, { - plugin_url : url, - action : val ? val.action : 0 - }); - }, - - mceTableRowProps : function() { - winMan.open({ - url : url + '/row.htm', - width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)), - height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }, - - mceTableCellProps : function() { - winMan.open({ - url : url + '/cell.htm', - width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)), - height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - } - }, function(func, name) { - ed.addCommand(name, function(ui, val) { - func(val); - }); - }); - } - }); - - // Register plugin - tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin); -})(tinymce); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/js/cell.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/js/cell.js deleted file mode 100644 index 53bdb54b0c94..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/js/cell.js +++ /dev/null @@ -1,319 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var ed; - -function init() { - ed = tinyMCEPopup.editor; - tinyMCEPopup.resizeToInnerSize(); - - document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); - document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor') - - var inst = ed; - var tdElm = ed.dom.getParent(ed.selection.getStart(), "td,th"); - var formObj = document.forms[0]; - var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style")); - - // Get table cell data - var celltype = tdElm.nodeName.toLowerCase(); - var align = ed.dom.getAttrib(tdElm, 'align'); - var valign = ed.dom.getAttrib(tdElm, 'valign'); - var width = trimSize(getStyle(tdElm, 'width', 'width')); - var height = trimSize(getStyle(tdElm, 'height', 'height')); - var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor')); - var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor')); - var className = ed.dom.getAttrib(tdElm, 'class'); - var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); - var id = ed.dom.getAttrib(tdElm, 'id'); - var lang = ed.dom.getAttrib(tdElm, 'lang'); - var dir = ed.dom.getAttrib(tdElm, 'dir'); - var scope = ed.dom.getAttrib(tdElm, 'scope'); - - // Setup form - addClassesToList('class', 'table_cell_styles'); - TinyMCE_EditableSelects.init(); - - if (!ed.dom.hasClass(tdElm, 'mceSelected')) { - formObj.bordercolor.value = bordercolor; - formObj.bgcolor.value = bgcolor; - formObj.backgroundimage.value = backgroundimage; - formObj.width.value = width; - formObj.height.value = height; - formObj.id.value = id; - formObj.lang.value = lang; - formObj.style.value = ed.dom.serializeStyle(st); - selectByValue(formObj, 'align', align); - selectByValue(formObj, 'valign', valign); - selectByValue(formObj, 'class', className, true, true); - selectByValue(formObj, 'celltype', celltype); - selectByValue(formObj, 'dir', dir); - selectByValue(formObj, 'scope', scope); - - // Resize some elements - if (isVisible('backgroundimagebrowser')) - document.getElementById('backgroundimage').style.width = '180px'; - - updateColor('bordercolor_pick', 'bordercolor'); - updateColor('bgcolor_pick', 'bgcolor'); - } else - tinyMCEPopup.dom.hide('action'); -} - -function updateAction() { - var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0]; - - if (!AutoValidator.validate(formObj)) { - tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.'); - return false; - } - - tinyMCEPopup.restoreSelection(); - el = ed.selection.getStart(); - tdElm = ed.dom.getParent(el, "td,th"); - trElm = ed.dom.getParent(el, "tr"); - tableElm = ed.dom.getParent(el, "table"); - - // Cell is selected - if (ed.dom.hasClass(tdElm, 'mceSelected')) { - // Update all selected sells - tinymce.each(ed.dom.select('td.mceSelected,th.mceSelected'), function(td) { - updateCell(td); - }); - - ed.addVisual(); - ed.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - tinyMCEPopup.close(); - return; - } - - switch (getSelectValue(formObj, 'action')) { - case "cell": - var celltype = getSelectValue(formObj, 'celltype'); - var scope = getSelectValue(formObj, 'scope'); - - function doUpdate(s) { - if (s) { - updateCell(tdElm); - - ed.addVisual(); - ed.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - tinyMCEPopup.close(); - } - }; - - if (ed.getParam("accessibility_warnings", 1)) { - if (celltype == "th" && scope == "") - tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate); - else - doUpdate(1); - - return; - } - - updateCell(tdElm); - break; - - case "row": - var cell = trElm.firstChild; - - if (cell.nodeName != "TD" && cell.nodeName != "TH") - cell = nextCell(cell); - - do { - cell = updateCell(cell, true); - } while ((cell = nextCell(cell)) != null); - - break; - - case "col": - var curr, col = 0, cell = trElm.firstChild, rows = tableElm.getElementsByTagName("tr"); - - if (cell.nodeName != "TD" && cell.nodeName != "TH") - cell = nextCell(cell); - - do { - if (cell == tdElm) - break; - col += cell.getAttribute("colspan"); - } while ((cell = nextCell(cell)) != null); - - for (var i=0; i 0) { - tinymce.each(tableElm.rows, function(tr) { - var i; - - for (i = 0; i < tr.cells.length; i++) { - if (dom.hasClass(tr.cells[i], 'mceSelected')) { - updateRow(tr, true); - return; - } - } - }); - - inst.addVisual(); - inst.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - tinyMCEPopup.close(); - return; - } - - switch (action) { - case "row": - updateRow(trElm); - break; - - case "all": - var rows = tableElm.getElementsByTagName("tr"); - - for (var i=0; i colLimit) { - tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); - return false; - } else if (rowLimit && rows > rowLimit) { - tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); - return false; - } else if (cellLimit && cols * rows > cellLimit) { - tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); - return false; - } - - // Update table - if (action == "update") { - dom.setAttrib(elm, 'cellPadding', cellpadding, true); - dom.setAttrib(elm, 'cellSpacing', cellspacing, true); - - if (!isCssSize(border)) { - dom.setAttrib(elm, 'border', border); - } else { - dom.setAttrib(elm, 'border', ''); - } - - if (border == '') { - dom.setStyle(elm, 'border-width', ''); - dom.setStyle(elm, 'border', ''); - dom.setAttrib(elm, 'border', ''); - } - - dom.setAttrib(elm, 'align', align); - dom.setAttrib(elm, 'frame', frame); - dom.setAttrib(elm, 'rules', rules); - dom.setAttrib(elm, 'class', className); - dom.setAttrib(elm, 'style', style); - dom.setAttrib(elm, 'id', id); - dom.setAttrib(elm, 'summary', summary); - dom.setAttrib(elm, 'dir', dir); - dom.setAttrib(elm, 'lang', lang); - - capEl = inst.dom.select('caption', elm)[0]; - - if (capEl && !caption) - capEl.parentNode.removeChild(capEl); - - if (!capEl && caption) { - capEl = elm.ownerDocument.createElement('caption'); - - if (!tinymce.isIE) - capEl.innerHTML = '
'; - - elm.insertBefore(capEl, elm.firstChild); - } - - if (width && inst.settings.inline_styles) { - dom.setStyle(elm, 'width', width); - dom.setAttrib(elm, 'width', ''); - } else { - dom.setAttrib(elm, 'width', width, true); - dom.setStyle(elm, 'width', ''); - } - - // Remove these since they are not valid XHTML - dom.setAttrib(elm, 'borderColor', ''); - dom.setAttrib(elm, 'bgColor', ''); - dom.setAttrib(elm, 'background', ''); - - if (height && inst.settings.inline_styles) { - dom.setStyle(elm, 'height', height); - dom.setAttrib(elm, 'height', ''); - } else { - dom.setAttrib(elm, 'height', height, true); - dom.setStyle(elm, 'height', ''); - } - - if (background != '') - elm.style.backgroundImage = "url('" + background + "')"; - else - elm.style.backgroundImage = ''; - -/* if (tinyMCEPopup.getParam("inline_styles")) { - if (width != '') - elm.style.width = getCSSSize(width); - }*/ - - if (bordercolor != "") { - elm.style.borderColor = bordercolor; - elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; - elm.style.borderWidth = cssSize(border); - } else - elm.style.borderColor = ''; - - elm.style.backgroundColor = bgcolor; - elm.style.height = getCSSSize(height); - - inst.addVisual(); - - // Fix for stange MSIE align bug - //elm.outerHTML = elm.outerHTML; - - inst.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - - // Repaint if dimensions changed - if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) - inst.execCommand('mceRepaint'); - - tinyMCEPopup.close(); - return true; - } - - // Create new table - html += ''); - - tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) { - if (patt) - patt += ','; - - patt += n + ' ._mce_marker'; - }); - - tinymce.each(inst.dom.select(patt), function(n) { - inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n); - }); - - dom.setOuterHTML(dom.select('br._mce_marker')[0], html); - } else - inst.execCommand('mceInsertContent', false, html); - - tinymce.each(dom.select('table[data-mce-new]'), function(node) { - var tdorth = dom.select('td,th', node); - - try { - // IE9 might fail to do this selection - inst.selection.setCursorLocation(tdorth[0], 0); - } catch (ex) { - // Ignore - } - - dom.setAttrib(node, 'data-mce-new', ''); - }); - - inst.addVisual(); - inst.execCommand('mceEndUndoLevel'); - - tinyMCEPopup.close(); -} - -function makeAttrib(attrib, value) { - var formObj = document.forms[0]; - var valueElm = formObj.elements[attrib]; - - if (typeof(value) == "undefined" || value == null) { - value = ""; - - if (valueElm) - value = valueElm.value; - } - - if (value == "") - return ""; - - // XML encode it - value = value.replace(/&/g, '&'); - value = value.replace(/\"/g, '"'); - value = value.replace(//g, '>'); - - return ' ' + attrib + '="' + value + '"'; -} - -function init() { - tinyMCEPopup.resizeToInnerSize(); - - document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); - document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); - document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - - var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); - var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; - var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules = "", frame = ""; - var inst = tinyMCEPopup.editor, dom = inst.dom; - var formObj = document.forms[0]; - var elm = dom.getParent(inst.selection.getNode(), "table"); - - action = tinyMCEPopup.getWindowArg('action'); - - if (!action) - action = elm ? "update" : "insert"; - - if (elm && action != "insert") { - var rowsAr = elm.rows; - var cols = 0; - for (var i=0; i cols) - cols = rowsAr[i].cells.length; - - cols = cols; - rows = rowsAr.length; - - st = dom.parseStyle(dom.getAttrib(elm, "style")); - border = trimSize(getStyle(elm, 'border', 'borderWidth')); - cellpadding = dom.getAttrib(elm, 'cellpadding', ""); - cellspacing = dom.getAttrib(elm, 'cellspacing', ""); - width = trimSize(getStyle(elm, 'width', 'width')); - height = trimSize(getStyle(elm, 'height', 'height')); - bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); - bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); - align = dom.getAttrib(elm, 'align', align); - frame = dom.getAttrib(elm, 'frame'); - rules = dom.getAttrib(elm, 'rules'); - className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); - id = dom.getAttrib(elm, 'id'); - summary = dom.getAttrib(elm, 'summary'); - style = dom.serializeStyle(st); - dir = dom.getAttrib(elm, 'dir'); - lang = dom.getAttrib(elm, 'lang'); - background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); - formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; - - orgTableWidth = width; - orgTableHeight = height; - - action = "update"; - formObj.insert.value = inst.getLang('update'); - } - - addClassesToList('class', "table_styles"); - TinyMCE_EditableSelects.init(); - - // Update form - selectByValue(formObj, 'align', align); - selectByValue(formObj, 'tframe', frame); - selectByValue(formObj, 'rules', rules); - selectByValue(formObj, 'class', className, true, true); - formObj.cols.value = cols; - formObj.rows.value = rows; - formObj.border.value = border; - formObj.cellpadding.value = cellpadding; - formObj.cellspacing.value = cellspacing; - formObj.width.value = width; - formObj.height.value = height; - formObj.bordercolor.value = bordercolor; - formObj.bgcolor.value = bgcolor; - formObj.id.value = id; - formObj.summary.value = summary; - formObj.style.value = style; - formObj.dir.value = dir; - formObj.lang.value = lang; - formObj.backgroundimage.value = background; - - updateColor('bordercolor_pick', 'bordercolor'); - updateColor('bgcolor_pick', 'bgcolor'); - - // Resize some elements - if (isVisible('backgroundimagebrowser')) - document.getElementById('backgroundimage').style.width = '180px'; - - // Disable some fields in update mode - if (action == "update") { - formObj.cols.disabled = true; - formObj.rows.disabled = true; - } -} - -function changedSize() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - -/* var width = formObj.width.value; - if (width != "") - st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; - else - st['width'] = "";*/ - - var height = formObj.height.value; - if (height != "") - st['height'] = getCSSSize(height); - else - st['height'] = ""; - - formObj.style.value = dom.serializeStyle(st); -} - -function isCssSize(value) { - return /^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)$/.test(value); -} - -function cssSize(value, def) { - value = tinymce.trim(value || def); - - if (!isCssSize(value)) { - return parseInt(value, 10) + 'px'; - } - - return value; -} - -function changedBackgroundImage() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; - - formObj.style.value = dom.serializeStyle(st); -} - -function changedBorder() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - // Update border width if the element has a color - if (formObj.border.value != "" && (isCssSize(formObj.border.value) || formObj.bordercolor.value != "")) - st['border-width'] = cssSize(formObj.border.value); - else { - if (!formObj.border.value) { - st['border'] = ''; - st['border-width'] = ''; - } - } - - formObj.style.value = dom.serializeStyle(st); -} - -function changedColor() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - st['background-color'] = formObj.bgcolor.value; - - if (formObj.bordercolor.value != "") { - st['border-color'] = formObj.bordercolor.value; - - // Add border-width if it's missing - if (!st['border-width']) - st['border-width'] = cssSize(formObj.border.value, 1); - } - - formObj.style.value = dom.serializeStyle(st); -} - -function changedStyle() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - if (st['background-image']) - formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); - else - formObj.backgroundimage.value = ''; - - if (st['width']) - formObj.width.value = trimSize(st['width']); - - if (st['height']) - formObj.height.value = trimSize(st['height']); - - if (st['background-color']) { - formObj.bgcolor.value = st['background-color']; - updateColor('bgcolor_pick','bgcolor'); - } - - if (st['border-color']) { - formObj.bordercolor.value = st['border-color']; - updateColor('bordercolor_pick','bordercolor'); - } -} - -tinyMCEPopup.onInit.add(init); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/langs/en_dlg.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/langs/en_dlg.js deleted file mode 100644 index 463e09ee1b62..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/langs/en_dlg.js +++ /dev/null @@ -1 +0,0 @@ -tinyMCE.addI18n('en.table_dlg',{"rules_border":"border","rules_box":"box","rules_vsides":"vsides","rules_rhs":"rhs","rules_lhs":"lhs","rules_hsides":"hsides","rules_below":"below","rules_above":"above","rules_void":"void",rules:"Rules","frame_all":"all","frame_cols":"cols","frame_rows":"rows","frame_groups":"groups","frame_none":"none",frame:"Frame",caption:"Table Caption","missing_scope":"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.","cell_limit":"You\'ve exceeded the maximum number of cells of {$cells}.","row_limit":"You\'ve exceeded the maximum number of rows of {$rows}.","col_limit":"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Footer",tbody:"Body",thead:"Header","row_all":"Update All Rows in Table","row_even":"Update Even Rows in Table","row_odd":"Update Odd Rows in Table","row_row":"Update Current Row","cell_all":"Update All Cells in Table","cell_row":"Update All Cells in Row","cell_cell":"Update Current Cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background Image",rtl:"Right to Left",ltr:"Left to Right",mime:"Target MIME Type",langcode:"Language Code",langdir:"Language Direction",style:"Style",id:"ID","merge_cells_title":"Merge Table Cells",bgcolor:"Background Color",bordercolor:"Border Color","align_bottom":"Bottom","align_top":"Top",valign:"Vertical Alignment","cell_type":"Cell Type","cell_title":"Table Cell Properties","row_title":"Table Row Properties","align_middle":"Center","align_right":"Right","align_left":"Left","align_default":"Default",align:"Alignment",border:"Border",cellpadding:"Cell Padding",cellspacing:"Cell Spacing",rows:"Rows",cols:"Columns",height:"Height",width:"Width",title:"Insert/Edit Table",rowtype:"Row Type","advanced_props":"Advanced Properties","general_props":"General Properties","advanced_tab":"Advanced","general_tab":"General","cell_col":"Update all cells in column"}); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/merge_cells.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/merge_cells.htm deleted file mode 100644 index 788acf68edef..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/merge_cells.htm +++ /dev/null @@ -1,32 +0,0 @@ - - - - {#table_dlg.merge_cells_title} - - - - - - -
-
- {#table_dlg.merge_cells_title} - - - - - - - - - -
:
:
-
- -
- - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/row.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/row.htm deleted file mode 100644 index e0b182b8d54e..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/row.htm +++ /dev/null @@ -1,158 +0,0 @@ - - - - {#table_dlg.row_title} - - - - - - - - - -
- - -
-
-
- {#table_dlg.general_props} - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
-
-
- -
-
- {#table_dlg.advanced_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- - - - - -
 
-
- - - - - - -
 
-
-
-
-
-
- -
-
- -
- - - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/table.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/table.htm deleted file mode 100644 index 52e6bf28f94a..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/table.htm +++ /dev/null @@ -1,188 +0,0 @@ - - - - {#table_dlg.title} - - - - - - - - - - -
- - -
-
-
- {#table_dlg.general_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-
- {#table_dlg.advanced_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - -
 
-
- -
- -
- -
- - - - - -
 
-
- - - - - -
 
-
-
-
-
- -
- - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/template/blank.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/template/blank.htm deleted file mode 100644 index 538a3b12c953..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/template/blank.htm +++ /dev/null @@ -1,12 +0,0 @@ - - - blank_page - - - - - - - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/template/css/template.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/template/css/template.css deleted file mode 100644 index 0a03f2e5c0ef..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/template/css/template.css +++ /dev/null @@ -1,23 +0,0 @@ -#frmbody { - padding: 10px; - background-color: #FFF; - border: 1px solid #CCC; -} - -.frmRow { - margin-bottom: 10px; -} - -#templatesrc { - border: none; - width: 320px; - height: 240px; -} - -.title { - padding-bottom: 5px; -} - -.mceActionPanel { - padding-top: 5px; -} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/template/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/template/editor_plugin.js deleted file mode 100644 index ebe3c27d78be..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/template/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TemplatePlugin",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceTemplate",function(e){b.windowManager.open({file:c+"/template.htm",width:b.getParam("template_popup_width",750),height:b.getParam("template_popup_height",600),inline:1},{plugin_url:c})});b.addCommand("mceInsertTemplate",d._insertTemplate,d);b.addButton("template",{title:"template.desc",cmd:"mceTemplate"});b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select("div",g.node),function(h){if(f.hasClass(h,"mceTmpl")){a(f.select("*",h),function(i){if(f.hasClass(i,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){i.innerHTML=d._getDateTime(new Date(),e.getParam("template_mdate_format",e.getLang("template.mdate_format")))}});d._replaceVals(h)}})})},getInfo:function(){return{longname:"Template plugin",author:"Moxiecode Systems AB",authorurl:"http://www.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_insertTemplate:function(i,j){var k=this,g=k.editor,f,c,d=g.dom,b=g.selection.getContent();f=j.content;a(k.editor.getParam("template_replace_values"),function(l,h){if(typeof(l)!="function"){f=f.replace(new RegExp("\\{\\$"+h+"\\}","g"),l)}});c=d.create("div",null,f);n=d.select(".mceTmpl",c);if(n&&n.length>0){c=d.create("div",null);c.appendChild(n[0].cloneNode(true))}function e(l,h){return new RegExp("\\b"+h+"\\b","g").test(l.className)}a(d.select("*",c),function(h){if(e(h,g.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_cdate_format",g.getLang("template.cdate_format")))}if(e(h,g.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_mdate_format",g.getLang("template.mdate_format")))}if(e(h,g.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))){h.innerHTML=b}});k._replaceVals(c);g.execCommand("mceInsertContent",false,c.innerHTML);g.addVisual()},_replaceVals:function(c){var d=this.editor.dom,b=this.editor.getParam("template_replace_values");a(d.select("*",c),function(f){a(b,function(g,e){if(d.hasClass(f,e)){if(typeof(b[e])=="function"){b[e](f)}}})})},_getDateTime:function(e,b){if(!b){return""}function c(g,d){var f;g=""+g;if(g.length 0) { - el = dom.create('div', null); - el.appendChild(n[0].cloneNode(true)); - } - - function hasClass(n, c) { - return new RegExp('\\b' + c + '\\b', 'g').test(n.className); - }; - - each(dom.select('*', el), function(n) { - // Replace cdate - if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) - n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format"))); - - // Replace mdate - if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) - n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); - - // Replace selection - if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) - n.innerHTML = sel; - }); - - t._replaceVals(el); - - ed.execCommand('mceInsertContent', false, el.innerHTML); - ed.addVisual(); - }, - - _replaceVals : function(e) { - var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values'); - - each(dom.select('*', e), function(e) { - each(vl, function(v, k) { - if (dom.hasClass(e, k)) { - if (typeof(vl[k]) == 'function') - vl[k](e); - } - }); - }); - }, - - _getDateTime : function(d, fmt) { - if (!fmt) - return ""; - - function addZeros(value, len) { - var i; - - value = "" + value; - - if (value.length < len) { - for (i=0; i<(len-value.length); i++) - value = "0" + value; - } - - return value; - } - - fmt = fmt.replace("%D", "%m/%d/%y"); - fmt = fmt.replace("%r", "%I:%M:%S %p"); - fmt = fmt.replace("%Y", "" + d.getFullYear()); - fmt = fmt.replace("%y", "" + d.getYear()); - fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); - fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); - fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); - fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); - fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); - fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); - fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); - fmt = fmt.replace("%B", "" + this.editor.getLang("template_months_long").split(',')[d.getMonth()]); - fmt = fmt.replace("%b", "" + this.editor.getLang("template_months_short").split(',')[d.getMonth()]); - fmt = fmt.replace("%A", "" + this.editor.getLang("template_day_long").split(',')[d.getDay()]); - fmt = fmt.replace("%a", "" + this.editor.getLang("template_day_short").split(',')[d.getDay()]); - fmt = fmt.replace("%%", "%"); - - return fmt; - } - }); - - // Register plugin - tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/template/js/template.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/template/js/template.js deleted file mode 100644 index 673395a9c7df..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/template/js/template.js +++ /dev/null @@ -1,106 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var TemplateDialog = { - preInit : function() { - var url = tinyMCEPopup.getParam("template_external_list_url"); - - if (url != null) - document.write(''); - }, - - init : function() { - var ed = tinyMCEPopup.editor, tsrc, sel, x, u; - - tsrc = ed.getParam("template_templates", false); - sel = document.getElementById('tpath'); - - // Setup external template list - if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') { - for (x=0, tsrc = []; x'); - }); - }, - - selectTemplate : function(u, ti) { - var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc; - - if (!u) - return; - - d.body.innerHTML = this.templateHTML = this.getFileContents(u); - - for (x=0; x - - {#template_dlg.title} - - - - - -
-
-
{#template_dlg.desc}
-
- -
-
-
-
- {#template_dlg.preview} - -
-
- -
- - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/visualchars/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/visualchars/editor_plugin.js deleted file mode 100644 index 1a148e8b4fc5..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/visualchars/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.VisualChars",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceVisualChars",c._toggleVisualChars,c);a.addButton("visualchars",{title:"visualchars.desc",cmd:"mceVisualChars"});a.onBeforeGetContent.add(function(d,e){if(c.state&&e.format!="raw"&&!e.draft){c.state=true;c._toggleVisualChars(false)}})},getInfo:function(){return{longname:"Visual characters",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_toggleVisualChars:function(m){var p=this,k=p.editor,a,g,j,n=k.getDoc(),o=k.getBody(),l,q=k.selection,e,c,f;p.state=!p.state;k.controlManager.setActive("visualchars",p.state);if(m){f=q.getBookmark()}if(p.state){a=[];tinymce.walk(o,function(b){if(b.nodeType==3&&b.nodeValue&&b.nodeValue.indexOf("\u00a0")!=-1){a.push(b)}},"childNodes");for(g=0;g$1');c=k.dom.create("div",null,l);while(node=c.lastChild){k.dom.insertAfter(node,a[g])}k.dom.remove(a[g])}}else{a=k.dom.select("span.mceItemNbsp",o);for(g=a.length-1;g>=0;g--){k.dom.remove(a[g],1)}}q.moveToBookmark(f)}});tinymce.PluginManager.add("visualchars",tinymce.plugins.VisualChars)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/visualchars/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/visualchars/editor_plugin_src.js deleted file mode 100644 index 0e3572e6ebc4..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/visualchars/editor_plugin_src.js +++ /dev/null @@ -1,83 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.VisualChars', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceVisualChars', t._toggleVisualChars, t); - - // Register buttons - ed.addButton('visualchars', {title : 'visualchars.desc', cmd : 'mceVisualChars'}); - - ed.onBeforeGetContent.add(function(ed, o) { - if (t.state && o.format != 'raw' && !o.draft) { - t.state = true; - t._toggleVisualChars(false); - } - }); - }, - - getInfo : function() { - return { - longname : 'Visual characters', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - _toggleVisualChars : function(bookmark) { - var t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo, div, bm; - - t.state = !t.state; - ed.controlManager.setActive('visualchars', t.state); - - if (bookmark) - bm = s.getBookmark(); - - if (t.state) { - nl = []; - tinymce.walk(b, function(n) { - if (n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\u00a0') != -1) - nl.push(n); - }, 'childNodes'); - - for (i = 0; i < nl.length; i++) { - nv = nl[i].nodeValue; - nv = nv.replace(/(\u00a0)/g, '$1'); - - div = ed.dom.create('div', null, nv); - while (node = div.lastChild) - ed.dom.insertAfter(node, nl[i]); - - ed.dom.remove(nl[i]); - } - } else { - nl = ed.dom.select('span.mceItemNbsp', b); - - for (i = nl.length - 1; i >= 0; i--) - ed.dom.remove(nl[i], 1); - } - - s.moveToBookmark(bm); - } - }); - - // Register plugin - tinymce.PluginManager.add('visualchars', tinymce.plugins.VisualChars); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/wordcount/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/wordcount/editor_plugin.js deleted file mode 100644 index a752ad32aef0..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/wordcount/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(a,b){var c=this,d=0;c.countre=a.getParam("wordcount_countregex",/[\w\u2019\'-]+/g);c.cleanre=a.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);c.id=a.id+"-word-count";a.onPostRender.add(function(f,e){var g,h;h=f.getParam("wordcount_target_id");if(!h){g=tinymce.DOM.get(f.id+"_path_row");if(g){tinymce.DOM.add(g.parentNode,"div",{style:"float: right"},f.getLang("wordcount.words","Words: ")+'0')}}else{tinymce.DOM.add(h,"span",{},'0')}});a.onInit.add(function(e){e.selection.onSetContent.add(function(){c._count(e)});c._count(e)});a.onSetContent.add(function(e){c._count(e)});a.onKeyUp.add(function(f,g){if(g.keyCode==d){return}if(13==g.keyCode||8==d||46==d){c._count(f)}d=g.keyCode})},_getCount:function(c){var a=0;var b=c.getContent({format:"raw"});if(b){b=b.replace(/\.\.\./g," ");b=b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ");b=b.replace(/(\w+)(&.+?;)+(\w+)/,"$1$3").replace(/&.+?;/g," ");b=b.replace(this.cleanre,"");var d=b.match(this.countre);if(d){a=d.length}}return a},_count:function(a){var b=this;if(b.block){return}b.block=1;setTimeout(function(){if(!a.destroyed){var c=b._getCount(a);tinymce.DOM.setHTML(b.id,c.toString());setTimeout(function(){b.block=0},2000)}},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/wordcount/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/wordcount/editor_plugin_src.js deleted file mode 100644 index 032a3f677476..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/wordcount/editor_plugin_src.js +++ /dev/null @@ -1,114 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.WordCount', { - block : 0, - id : null, - countre : null, - cleanre : null, - - init : function(ed, url) { - var t = this, last = 0; - - t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\'-]+/g); // u2019 == ’ - t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g); - t.id = ed.id + '-word-count'; - - ed.onPostRender.add(function(ed, cm) { - var row, id; - - // Add it to the specified id or the theme advanced path - id = ed.getParam('wordcount_target_id'); - if (!id) { - row = tinymce.DOM.get(ed.id + '_path_row'); - - if (row) - tinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '0'); - } else { - tinymce.DOM.add(id, 'span', {}, '0'); - } - }); - - ed.onInit.add(function(ed) { - ed.selection.onSetContent.add(function() { - t._count(ed); - }); - - t._count(ed); - }); - - ed.onSetContent.add(function(ed) { - t._count(ed); - }); - - ed.onKeyUp.add(function(ed, e) { - if (e.keyCode == last) - return; - - if (13 == e.keyCode || 8 == last || 46 == last) - t._count(ed); - - last = e.keyCode; - }); - }, - - _getCount : function(ed) { - var tc = 0; - var tx = ed.getContent({ format: 'raw' }); - - if (tx) { - tx = tx.replace(/\.\.\./g, ' '); // convert ellipses to spaces - tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars - - // deal with html entities - tx = tx.replace(/(\w+)(&.+?;)+(\w+)/, "$1$3").replace(/&.+?;/g, ' '); - tx = tx.replace(this.cleanre, ''); // remove numbers and punctuation - - var wordArray = tx.match(this.countre); - if (wordArray) { - tc = wordArray.length; - } - } - - return tc; - }, - - _count : function(ed) { - var t = this; - - // Keep multiple calls from happening at the same time - if (t.block) - return; - - t.block = 1; - - setTimeout(function() { - if (!ed.destroyed) { - var tc = t._getCount(ed); - tinymce.DOM.setHTML(t.id, tc.toString()); - setTimeout(function() {t.block = 0;}, 2000); - } - }, 1); - }, - - getInfo: function() { - return { - longname : 'Word Count plugin', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount); -})(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/abbr.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/abbr.htm deleted file mode 100644 index d41021802b1b..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/abbr.htm +++ /dev/null @@ -1,142 +0,0 @@ - - - - {#xhtmlxtras_dlg.title_abbr_element} - - - - - - - - - - -
- - -
-
-
- {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
: - -
:
: - -
: - -
-
-
-
-
- {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
:
:
:
:
:
:
:
:
:
:
-
-
-
-
- - - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/acronym.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/acronym.htm deleted file mode 100644 index 12b189b43581..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/acronym.htm +++ /dev/null @@ -1,142 +0,0 @@ - - - - {#xhtmlxtras_dlg.title_acronym_element} - - - - - - - - - - -
- - -
-
-
- {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
: - -
:
: - -
: - -
-
-
-
-
- {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
:
:
:
:
:
:
:
:
:
:
-
-
-
-
- - - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/attributes.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/attributes.htm deleted file mode 100644 index d84f378bf30d..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/attributes.htm +++ /dev/null @@ -1,149 +0,0 @@ - - - - {#xhtmlxtras_dlg.attribs_title} - - - - - - - - - -
- - -
-
-
- {#xhtmlxtras_dlg.attribute_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
- -
:
: - -
: - -
-
-
-
-
- {#xhtmlxtras_dlg.attribute_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
:
:
:
:
:
:
:
:
:
:
-
-
-
-
- - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/cite.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/cite.htm deleted file mode 100644 index ab61b330c674..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/cite.htm +++ /dev/null @@ -1,142 +0,0 @@ - - - - {#xhtmlxtras_dlg.title_cite_element} - - - - - - - - - - -
- - -
-
-
- {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
: - -
:
: - -
: - -
-
-
-
-
- {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
:
:
:
:
:
:
:
:
:
:
-
-
-
-
- - - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/css/attributes.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/css/attributes.css deleted file mode 100644 index 85b1b376deb2..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/css/attributes.css +++ /dev/null @@ -1,11 +0,0 @@ -.panel_wrapper div.current { - height: 290px; -} - -#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey { - width: 200px; -} - -#events_panel input { - width: 200px; -} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/css/popup.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/css/popup.css deleted file mode 100644 index 94d7b37af527..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/css/popup.css +++ /dev/null @@ -1,9 +0,0 @@ -input.field, select.field {width:200px;} -input.picker {width:179px; margin-left: 5px;} -input.disabled {border-color:#F2F2F2;} -img.picker {vertical-align:text-bottom; cursor:pointer;} -h1 {padding: 0 0 5px 0;} -.panel_wrapper div.current {height:160px;} -#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;} -a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.png') -140px -20px;} -#datetime {width:180px;} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/del.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/del.htm deleted file mode 100644 index e3f34c7df9da..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/del.htm +++ /dev/null @@ -1,162 +0,0 @@ - - - - {#xhtmlxtras_dlg.title_del_element} - - - - - - - - - - -
- - -
-
-
- {#xhtmlxtras_dlg.fieldset_general_tab} - - - - - - - - - -
: - - - - - -
-
:
-
-
- {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
: - -
:
: - -
: - -
-
-
-
-
- {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
:
:
:
:
:
:
:
:
:
:
-
-
-
-
- - - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/editor_plugin.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/editor_plugin.js deleted file mode 100644 index 9b98a5154b04..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.XHTMLXtrasPlugin",{init:function(a,b){a.addCommand("mceCite",function(){a.windowManager.open({file:b+"/cite.htm",width:350+parseInt(a.getLang("xhtmlxtras.cite_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.cite_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAcronym",function(){a.windowManager.open({file:b+"/acronym.htm",width:350+parseInt(a.getLang("xhtmlxtras.acronym_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.acronym_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAbbr",function(){a.windowManager.open({file:b+"/abbr.htm",width:350+parseInt(a.getLang("xhtmlxtras.abbr_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.abbr_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceDel",function(){a.windowManager.open({file:b+"/del.htm",width:340+parseInt(a.getLang("xhtmlxtras.del_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.del_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceIns",function(){a.windowManager.open({file:b+"/ins.htm",width:340+parseInt(a.getLang("xhtmlxtras.ins_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.ins_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAttributes",function(){a.windowManager.open({file:b+"/attributes.htm",width:380+parseInt(a.getLang("xhtmlxtras.attr_delta_width",0)),height:370+parseInt(a.getLang("xhtmlxtras.attr_delta_height",0)),inline:1},{plugin_url:b})});a.addButton("cite",{title:"xhtmlxtras.cite_desc",cmd:"mceCite"});a.addButton("acronym",{title:"xhtmlxtras.acronym_desc",cmd:"mceAcronym"});a.addButton("abbr",{title:"xhtmlxtras.abbr_desc",cmd:"mceAbbr"});a.addButton("del",{title:"xhtmlxtras.del_desc",cmd:"mceDel"});a.addButton("ins",{title:"xhtmlxtras.ins_desc",cmd:"mceIns"});a.addButton("attribs",{title:"xhtmlxtras.attribs_desc",cmd:"mceAttributes"});a.onNodeChange.add(function(d,c,f,e){f=d.dom.getParent(f,"CITE,ACRONYM,ABBR,DEL,INS");c.setDisabled("cite",e);c.setDisabled("acronym",e);c.setDisabled("abbr",e);c.setDisabled("del",e);c.setDisabled("ins",e);c.setDisabled("attribs",f&&f.nodeName=="BODY");c.setActive("cite",0);c.setActive("acronym",0);c.setActive("abbr",0);c.setActive("del",0);c.setActive("ins",0);if(f){do{c.setDisabled(f.nodeName.toLowerCase(),0);c.setActive(f.nodeName.toLowerCase(),1)}while(f=f.parentNode)}});a.onPreInit.add(function(){a.dom.create("abbr")})},getInfo:function(){return{longname:"XHTML Xtras Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("xhtmlxtras",tinymce.plugins.XHTMLXtrasPlugin)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js deleted file mode 100644 index a9c12ef3ac75..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +++ /dev/null @@ -1,132 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', { - init : function(ed, url) { - // Register commands - ed.addCommand('mceCite', function() { - ed.windowManager.open({ - file : url + '/cite.htm', - width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)), - height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceAcronym', function() { - ed.windowManager.open({ - file : url + '/acronym.htm', - width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), - height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceAbbr', function() { - ed.windowManager.open({ - file : url + '/abbr.htm', - width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), - height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceDel', function() { - ed.windowManager.open({ - file : url + '/del.htm', - width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), - height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceIns', function() { - ed.windowManager.open({ - file : url + '/ins.htm', - width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), - height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceAttributes', function() { - ed.windowManager.open({ - file : url + '/attributes.htm', - width : 380 + parseInt(ed.getLang('xhtmlxtras.attr_delta_width', 0)), - height : 370 + parseInt(ed.getLang('xhtmlxtras.attr_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - // Register buttons - ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'}); - ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'}); - ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'}); - ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'}); - ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'}); - ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'}); - - ed.onNodeChange.add(function(ed, cm, n, co) { - n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS'); - - cm.setDisabled('cite', co); - cm.setDisabled('acronym', co); - cm.setDisabled('abbr', co); - cm.setDisabled('del', co); - cm.setDisabled('ins', co); - cm.setDisabled('attribs', n && n.nodeName == 'BODY'); - cm.setActive('cite', 0); - cm.setActive('acronym', 0); - cm.setActive('abbr', 0); - cm.setActive('del', 0); - cm.setActive('ins', 0); - - // Activate all - if (n) { - do { - cm.setDisabled(n.nodeName.toLowerCase(), 0); - cm.setActive(n.nodeName.toLowerCase(), 1); - } while (n = n.parentNode); - } - }); - - ed.onPreInit.add(function() { - // Fixed IE issue where it can't handle these elements correctly - ed.dom.create('abbr'); - }); - }, - - getInfo : function() { - return { - longname : 'XHTML Xtras Plugin', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/ins.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/ins.htm deleted file mode 100644 index 226e6053208f..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/ins.htm +++ /dev/null @@ -1,162 +0,0 @@ - - - - {#xhtmlxtras_dlg.title_ins_element} - - - - - - - - - - -
- - -
-
-
- {#xhtmlxtras_dlg.fieldset_general_tab} - - - - - - - - - -
: - - - - - -
-
:
-
-
- {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
: - -
:
: - -
: - -
-
-
-
-
- {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
:
:
:
:
:
:
:
:
:
:
-
-
-
-
- - - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/js/abbr.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/js/abbr.js deleted file mode 100644 index 1790e83d354e..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/js/abbr.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * abbr.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('abbr'); - if (SXE.currentAction == "update") { - SXE.showRemoveButton(); - } -} - -function insertAbbr() { - SXE.insertElement('abbr'); - tinyMCEPopup.close(); -} - -function removeAbbr() { - SXE.removeElement('abbr'); - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/js/acronym.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/js/acronym.js deleted file mode 100644 index 93b8d259a8e0..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/js/acronym.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * acronym.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('acronym'); - if (SXE.currentAction == "update") { - SXE.showRemoveButton(); - } -} - -function insertAcronym() { - SXE.insertElement('acronym'); - tinyMCEPopup.close(); -} - -function removeAcronym() { - SXE.removeElement('acronym'); - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/js/attributes.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/js/attributes.js deleted file mode 100644 index 9e9b07e6dad1..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/js/attributes.js +++ /dev/null @@ -1,111 +0,0 @@ -/** - * attributes.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - tinyMCEPopup.resizeToInnerSize(); - var inst = tinyMCEPopup.editor; - var dom = inst.dom; - var elm = inst.selection.getNode(); - var f = document.forms[0]; - var onclick = dom.getAttrib(elm, 'onclick'); - - setFormValue('title', dom.getAttrib(elm, 'title')); - setFormValue('id', dom.getAttrib(elm, 'id')); - setFormValue('style', dom.getAttrib(elm, "style")); - setFormValue('dir', dom.getAttrib(elm, 'dir')); - setFormValue('lang', dom.getAttrib(elm, 'lang')); - setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); - setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); - setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); - setFormValue('onblur', dom.getAttrib(elm, 'onblur')); - setFormValue('onclick', onclick); - setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); - setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); - setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); - setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); - setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); - setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); - setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); - setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); - setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); - className = dom.getAttrib(elm, 'class'); - - addClassesToList('classlist', 'advlink_styles'); - selectByValue(f, 'classlist', className, true); - - TinyMCE_EditableSelects.init(); -} - -function setFormValue(name, value) { - if(value && document.forms[0].elements[name]){ - document.forms[0].elements[name].value = value; - } -} - -function insertAction() { - var inst = tinyMCEPopup.editor; - var elm = inst.selection.getNode(); - - setAllAttribs(elm); - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); -} - -function setAttrib(elm, attrib, value) { - var formObj = document.forms[0]; - var valueElm = formObj.elements[attrib.toLowerCase()]; - var inst = tinyMCEPopup.editor; - var dom = inst.dom; - - if (typeof(value) == "undefined" || value == null) { - value = ""; - - if (valueElm) - value = valueElm.value; - } - - dom.setAttrib(elm, attrib.toLowerCase(), value); -} - -function setAllAttribs(elm) { - var f = document.forms[0]; - - setAttrib(elm, 'title'); - setAttrib(elm, 'id'); - setAttrib(elm, 'style'); - setAttrib(elm, 'class', getSelectValue(f, 'classlist')); - setAttrib(elm, 'dir'); - setAttrib(elm, 'lang'); - setAttrib(elm, 'tabindex'); - setAttrib(elm, 'accesskey'); - setAttrib(elm, 'onfocus'); - setAttrib(elm, 'onblur'); - setAttrib(elm, 'onclick'); - setAttrib(elm, 'ondblclick'); - setAttrib(elm, 'onmousedown'); - setAttrib(elm, 'onmouseup'); - setAttrib(elm, 'onmouseover'); - setAttrib(elm, 'onmousemove'); - setAttrib(elm, 'onmouseout'); - setAttrib(elm, 'onkeypress'); - setAttrib(elm, 'onkeydown'); - setAttrib(elm, 'onkeyup'); - - // Refresh in old MSIE -// if (tinyMCE.isMSIE5) -// elm.outerHTML = elm.outerHTML; -} - -function insertAttribute() { - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); -tinyMCEPopup.requireLangPack(); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/js/cite.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/js/cite.js deleted file mode 100644 index b73ef4735582..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/js/cite.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * cite.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('cite'); - if (SXE.currentAction == "update") { - SXE.showRemoveButton(); - } -} - -function insertCite() { - SXE.insertElement('cite'); - tinyMCEPopup.close(); -} - -function removeCite() { - SXE.removeElement('cite'); - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/js/del.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/js/del.js deleted file mode 100644 index a5397f7e6f3d..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/js/del.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * del.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('del'); - if (SXE.currentAction == "update") { - setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); - setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); - SXE.showRemoveButton(); - } -} - -function setElementAttribs(elm) { - setAllCommonAttribs(elm); - setAttrib(elm, 'datetime'); - setAttrib(elm, 'cite'); - elm.removeAttribute('data-mce-new'); -} - -function insertDel() { - var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL'); - - if (elm == null) { - var s = SXE.inst.selection.getContent(); - if(s.length > 0) { - insertInlineElement('del'); - var elementArray = SXE.inst.dom.select('del[data-mce-new]'); - for (var i=0; i 0) { - tagName = element_name; - - insertInlineElement(element_name); - var elementArray = tinymce.grep(SXE.inst.dom.select(element_name)); - for (var i=0; i -1) ? true : false; -} - -SXE.removeClass = function(elm,cl) { - if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) { - return true; - } - var classNames = elm.className.split(" "); - var newClassNames = ""; - for (var x = 0, cnl = classNames.length; x < cnl; x++) { - if (classNames[x] != cl) { - newClassNames += (classNames[x] + " "); - } - } - elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end -} - -SXE.addClass = function(elm,cl) { - if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl; - return true; -} - -function insertInlineElement(en) { - var ed = tinyMCEPopup.editor, dom = ed.dom; - - ed.getDoc().execCommand('FontName', false, 'mceinline'); - tinymce.each(dom.select('span,font'), function(n) { - if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') - dom.replace(dom.create(en, {'data-mce-new' : 1}), n, 1); - }); -} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/js/ins.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/js/ins.js deleted file mode 100644 index 71a8a261ff0a..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/xhtmlxtras/js/ins.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * ins.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('ins'); - if (SXE.currentAction == "update") { - setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); - setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); - SXE.showRemoveButton(); - } -} - -function setElementAttribs(elm) { - setAllCommonAttribs(elm); - setAttrib(elm, 'datetime'); - setAttrib(elm, 'cite'); - elm.removeAttribute('data-mce-new'); -} - -function insertIns() { - var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS'); - - if (elm == null) { - var s = SXE.inst.selection.getContent(); - if(s.length > 0) { - insertInlineElement('ins'); - var elementArray = SXE.inst.dom.select('ins[data-mce-new]'); - for (var i=0; i - - - {#advanced_dlg.about_title} - - - - - - - -
-
-

{#advanced_dlg.about_title}

-

Version: ()

-

TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL - by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

-

Copyright © 2003-2008, Moxiecode Systems AB, All rights reserved.

-

For more information about this software visit the TinyMCE website.

- -
- Got Moxie? -
-
- -
-
-

{#advanced_dlg.about_loaded}

- -
-
- -

 

-
-
- -
-
-
-
- -
- -
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/anchor.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/anchor.htm deleted file mode 100644 index dc53312d9589..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/anchor.htm +++ /dev/null @@ -1,26 +0,0 @@ - - - - {#advanced_dlg.anchor_title} - - - - -
- - - - - - - - -
{#advanced_dlg.anchor_title}
- -
- - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/charmap.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/charmap.htm deleted file mode 100644 index 12acfe18a957..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/charmap.htm +++ /dev/null @@ -1,55 +0,0 @@ - - - - {#advanced_dlg.charmap_title} - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - -
 
 
-
- - - - - - - - - - - - - - - - -
 
 
 
-
{#advanced_dlg.charmap_usage}
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/color_picker.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/color_picker.htm deleted file mode 100644 index e7f19abaabaa..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/color_picker.htm +++ /dev/null @@ -1,74 +0,0 @@ - - - - {#advanced_dlg.colorpicker_title} - - - - - - -
- - -
-
-
- {#advanced_dlg.colorpicker_picker_title} -
- - -
- -
- -
-
-
-
- -
-
- {#advanced_dlg.colorpicker_palette_title} -
- -
- -
-
-
- -
-
- {#advanced_dlg.colorpicker_named_title} -
- -
- -
- -
- {#advanced_dlg.colorpicker_name} -
-
-
-
- -
- - -
- -
- -
-
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/editor_template.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/editor_template.js deleted file mode 100644 index 812578d0bca7..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/editor_template.js +++ /dev/null @@ -1 +0,0 @@ -(function(e){var d=e.DOM,b=e.dom.Event,h=e.extend,f=e.each,a=e.util.Cookie,g,c=e.explode;e.ThemeManager.requireLangPack("advanced");e.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(j,k){var l=this,m,i,n;l.editor=j;l.url=k;l.onResolveName=new e.util.Dispatcher(this);j.forcedHighContrastMode=j.settings.detect_highcontrast&&l._isHighContrast();j.settings.skin=j.forcedHighContrastMode?"highcontrast":j.settings.skin;l.settings=m=h({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_font_selector:"span",theme_advanced_show_current_color:0,readonly:j.settings.readonly},j.settings);if(!m.font_size_style_values){m.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(e.is(m.theme_advanced_font_sizes,"string")){m.font_size_style_values=e.explode(m.font_size_style_values);m.font_size_classes=e.explode(m.font_size_classes||"");n={};j.settings.theme_advanced_font_sizes=m.theme_advanced_font_sizes;f(j.getParam("theme_advanced_font_sizes","","hash"),function(q,p){var o;if(p==q&&q>=1&&q<=7){p=q+" ("+l.sizes[q-1]+"pt)";o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+"pt")}if(/^\s*\./.test(q)){o=q.replace(/\./g,"")}n[p]=o?{"class":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!="none"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location=="none"){m.theme_advanced_statusbar_location=0}if(j.settings.content_css!==false){j.contentCSS.push(j.baseURI.toAbsolute(k+"/skins/"+j.settings.skin+"/content.css"))}j.onInit.add(function(){if(!j.settings.readonly){j.onNodeChange.add(l._nodeChanged,l);j.onKeyUp.add(l._updateUndoStatus,l);j.onMouseUp.add(l._updateUndoStatus,l);j.dom.bind(j.dom.getRoot(),"dragend",function(){l._updateUndoStatus(j)})}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create("DIV",{style:"position:relative"}),s.firstChild);p=d.get(q.id+"_tbl");d.add(s,"div",{id:t+"_blocker","class":"mceBlocker",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,"div",{id:t+"_progress","class":"mceProgress",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+"_blocker");d.remove(t+"_progress");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+"/skins/"+j.settings.skin+"/ui.css");if(m.skin_variant){d.loadCSS(k+"/skins/"+j.settings.skin+"/ui_"+m.skin_variant+".css")}},_isHighContrast:function(){var i,j=d.add(d.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});i=(d.getStyle(j,"background-color",true)+"").toLowerCase().replace(/ /g,"");d.remove(j);return i!="rgb(171,239,86)"&&i!="#abef56"},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((j=this.controls[l])){return i.createButton(l,{title:"advanced."+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this["_"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(k){var i=this.editor,j=i.controlManager.get("styleselect");if(j.getLength()==0){f(i.dom.getClasses(),function(n,l){var m="style_"+l;i.formatter.register(m,{inline:"span",attributes:{"class":n["class"]},selector:"*"});j.add(n["class"],m)})}},_createStyleSelect:function(m){var k=this,i=k.editor,j=i.controlManager,l;l=j.createListBox("styleselect",{title:"advanced.style_select",onselect:function(o){var p,n=[];f(l.items,function(q){n.push(q.value)});i.focus();i.undoManager.add();p=i.formatter.matchAll(n);if(!o||p[0]==o){if(p[0]){i.formatter.remove(p[0])}}else{i.formatter.apply(o)}i.undoManager.add();i.nodeChanged();return false}});i.onInit.add(function(){var o=0,n=i.getParam("style_formats");if(n){f(n,function(p){var q,r=0;f(p,function(){r++});if(r>1){q=p.name=p.name||"style_"+(o++);i.formatter.register(q,p);l.add(p.title,q)}else{l.add(p.title)}})}else{f(i.getParam("theme_advanced_styles","","hash"),function(r,q){var p;if(r){p="style_"+(o++);i.formatter.register(p,{inline:"span",classes:r,selector:"*"});l.add(k.editor.translate(q),p)}})}});if(l.getLength()==0){l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+"_text","focus",k._importClasses,k);b.add(p.id+"_text","mousedown",k._importClasses,k);b.add(p.id+"_open","focus",k._importClasses,k);b.add(p.id+"_open","mousedown",k._importClasses,k)}else{b.add(p.id,"focus",k._importClasses,k)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(l){var m=k.items[k.selectedIndex];if(!l&&m){i.execCommand("FontName",false,m.value);return}i.execCommand("FontName",false,l);k.select(function(n){return l==n});if(m&&m.value==l){k.select(null)}return false}});if(k){f(i.getParam("theme_advanced_fonts",j.settings.theme_advanced_fonts,"hash"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(i){var o=n.items[n.selectedIndex];if(!i&&o){o=o.value;if(o["class"]){k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}return}if(i["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:i["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,i.fontSize)}n.select(function(p){return i==p});if(o&&(o.value.fontSize==i.fontSize||o.value["class"]==i["class"])){n.select(null)}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+"pt"}n.add(i,o,{style:"font-size:"+p,"class":"mceFontSize"+(l++)+(" "+(o["class"]||""))})})}return n},_createBlockFormats:function(){var k,i={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},j=this;k=j.editor.controlManager.createListBox("formatselect",{title:"advanced.block",onselect:function(l){j.editor.execCommand("FormatBlock",false,l);return false}});if(k){f(j.editor.getParam("theme_advanced_blockformats",j.settings.theme_advanced_blockformats,"hash"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{"class":"mce_formatPreview mce_"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title="advanced.forecolor_desc";l.cmd="ForeColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("forecolor",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title="advanced.backcolor_desc";l.cmd="HiliteColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("backcolor",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j,i;if(r.settings){r.settings.aria_label=w.aria_label+r.getLang("advanced.help_shortcut")}m=j=d.create("span",{role:"application","aria-labelledby":r.id+"_voice",id:r.id+"_parent","class":"mceEditor "+r.settings.skin+"Skin"+(w.skin_variant?" "+r.settings.skin+"Skin"+v._ufirst(w.skin_variant):"")});d.add(m,"span",{"class":"mceVoiceLabel",style:"display:none;",id:r.id+"_voice"},w.aria_label);if(!d.boxModel){m=d.add(m,"div",{"class":"mceOldBoxModel"})}m=u=d.add(m,"table",{role:"presentation",id:r.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});m=q=d.add(m,"tbody");switch((w.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":l=v._rowLayout(w,q,k);break;case"customlayout":l=r.execCallback("theme_advanced_custom_layout",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=u.rows;d.addClass(i[0],"mceFirst");d.addClass(i[i.length-1],"mceLast");f(d.select("tr",q),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!r.getParam("accessibility_focus")){b.add(d.add(j,"a",{href:"#"},""),"focus",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location=="external"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;k.targetNode=null;r.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){if(e.isWebKit){window.focus()}v.toolbarGroup.focus();return b.cancel(n)}else{if(n.keyCode===o){d.get(p.id+"_path_row").focus();return b.cancel(n)}}}});r.addShortcut("alt+0","","mceShortcuts",v);return{iframeContainer:l,editorContainer:r.id+"_parent",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:e.majorVersion+"."+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+"_ifr");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,m,k){var j=this.editor,l=this.settings,n=d.get(j.id+"_tbl"),o=d.get(j.id+"_ifr");i=Math.max(l.theme_advanced_resizing_min_width||100,i);m=Math.max(l.theme_advanced_resizing_min_height||100,m);i=Math.min(l.theme_advanced_resizing_max_width||65535,i);m=Math.min(l.theme_advanced_resizing_max_height||65535,m);d.setStyle(n,"height","");d.setStyle(o,"height",m);if(l.theme_advanced_resize_horizontal){d.setStyle(n,"width","");d.setStyle(o,"width",i);if(i"));d.setHTML(l,q.join(""))},_addStatusBar:function(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,"tr");k=l=d.add(k,"td",{"class":"mceStatusbar"});k=d.add(k,"div",{id:p.id+"_path_row",role:"group","aria-labelledby":p.id+"_path_voice"});if(w.theme_advanced_path){d.add(k,"span",{id:p.id+"_path_voice"},p.translate("advanced.path"));d.add(k,"span",{},": ")}else{d.add(k,"span",{}," ")}if(w.theme_advanced_resizing){d.add(l,"a",{id:p.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize",tabIndex:"-1"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+p.id+"_size"),r=d.get(p.id+"_tbl");if(!n){return}v.resizeTo(n.cw,n.ch)})}p.onPostRender.add(function(){b.add(p.id+"_resize","click",function(n){n.preventDefault()});b.add(p.id+"_resize","mousedown",function(D){var t,r,s,o,C,z,A,F,n,E,x;function y(G){G.preventDefault();n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E)}function B(G){b.remove(d.doc,"mousemove",t);b.remove(p.getDoc(),"mousemove",r);b.remove(d.doc,"mouseup",s);b.remove(p.getDoc(),"mouseup",o);n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E,true)}D.preventDefault();C=D.screenX;z=D.screenY;x=d.get(v.editor.id+"_ifr");A=n=x.clientWidth;F=E=x.clientHeight;t=b.add(d.doc,"mousemove",y);r=b.add(p.getDoc(),"mousemove",y);s=b.add(d.doc,"mouseup",B);o=b.add(p.getDoc(),"mouseup",B)})})}j.deltaHeight-=21;k=m=null},_updateUndoStatus:function(j){var i=j.controlManager,k=j.undoManager;i.setDisabled("undo",!k.hasUndo()&&!k.typing);i.setDisabled("redo",!k.hasRedo())},_nodeChanged:function(m,r,D,q,E){var y=this,C,F=0,x,G,z=y.settings,w,k,u,B,l,j,i;e.each(y.stateControls,function(n){r.setActive(n,m.queryCommandState(y.controls[n][1]))});function o(p){var s,n=E.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s0){y.statusKeyboardNavigation=new e.ui.KeyboardNavigation({root:m.id+"_path_row",items:d.select("a",C),excludeFromTabOrder:true,onCancel:function(){m.focus()}},d)}}},_sel:function(i){this.editor.execCommand("mceSelectNodeDepth",false,i)},_mceInsertAnchor:function(k,j){var i=this.editor;i.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(i.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(i.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var i=this.editor;i.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(i.getLang("advanced.charmap_delta_width",0)),height:260+parseInt(i.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var i=this.editor;i.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var i=this.editor;i.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(k,j){var i=this.editor;j=j||{};i.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(i.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(i.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:j.color,func:j.func,theme_url:this.url})},_mceCodeEditor:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(i.getParam("theme_advanced_source_editor_width",720)),height:parseInt(i.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(j,k){var i=this.editor;if(i.dom.getAttrib(i.selection.getNode(),"class").indexOf("mceItem")!=-1){return}i.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(i.getLang("advanced.image_delta_width",0)),height:275+parseInt(i.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(i.getLang("advanced.link_delta_width",0)),height:200+parseInt(i.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var i=this.editor;i.windowManager.confirm("advanced.newdocument",function(j){if(j){i.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var i=this;this._mceColorPicker(0,{color:i.fgColor,func:function(j){i.fgColor=j;i.editor.execCommand("ForeColor",false,j)}})},_mceBackColor:function(){var i=this;this._mceColorPicker(0,{color:i.bgColor,func:function(j){i.bgColor=j;i.editor.execCommand("HiliteColor",false,j)}})},_ufirst:function(i){return i.substring(0,1).toUpperCase()+i.substring(1)}});e.ThemeManager.add("advanced",e.themes.AdvancedTheme)}(tinymce)); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/editor_template_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/editor_template_src.js deleted file mode 100644 index 5f50bd509fb7..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/editor_template_src.js +++ /dev/null @@ -1,1362 +0,0 @@ -/** - * editor_template_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode; - - // Tell it to load theme specific language pack(s) - tinymce.ThemeManager.requireLangPack('advanced'); - - tinymce.create('tinymce.themes.AdvancedTheme', { - sizes : [8, 10, 12, 14, 18, 24, 36], - - // Control name lookup, format: title, command - controls : { - bold : ['bold_desc', 'Bold'], - italic : ['italic_desc', 'Italic'], - underline : ['underline_desc', 'Underline'], - strikethrough : ['striketrough_desc', 'Strikethrough'], - justifyleft : ['justifyleft_desc', 'JustifyLeft'], - justifycenter : ['justifycenter_desc', 'JustifyCenter'], - justifyright : ['justifyright_desc', 'JustifyRight'], - justifyfull : ['justifyfull_desc', 'JustifyFull'], - bullist : ['bullist_desc', 'InsertUnorderedList'], - numlist : ['numlist_desc', 'InsertOrderedList'], - outdent : ['outdent_desc', 'Outdent'], - indent : ['indent_desc', 'Indent'], - cut : ['cut_desc', 'Cut'], - copy : ['copy_desc', 'Copy'], - paste : ['paste_desc', 'Paste'], - undo : ['undo_desc', 'Undo'], - redo : ['redo_desc', 'Redo'], - link : ['link_desc', 'mceLink'], - unlink : ['unlink_desc', 'unlink'], - image : ['image_desc', 'mceImage'], - cleanup : ['cleanup_desc', 'mceCleanup'], - help : ['help_desc', 'mceHelp'], - code : ['code_desc', 'mceCodeEditor'], - hr : ['hr_desc', 'InsertHorizontalRule'], - removeformat : ['removeformat_desc', 'RemoveFormat'], - sub : ['sub_desc', 'subscript'], - sup : ['sup_desc', 'superscript'], - forecolor : ['forecolor_desc', 'ForeColor'], - forecolorpicker : ['forecolor_desc', 'mceForeColor'], - backcolor : ['backcolor_desc', 'HiliteColor'], - backcolorpicker : ['backcolor_desc', 'mceBackColor'], - charmap : ['charmap_desc', 'mceCharMap'], - visualaid : ['visualaid_desc', 'mceToggleVisualAid'], - anchor : ['anchor_desc', 'mceInsertAnchor'], - newdocument : ['newdocument_desc', 'mceNewDocument'], - blockquote : ['blockquote_desc', 'mceBlockQuote'] - }, - - stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'], - - init : function(ed, url) { - var t = this, s, v, o; - - t.editor = ed; - t.url = url; - t.onResolveName = new tinymce.util.Dispatcher(this); - - ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast(); - ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin; - - // Default settings - t.settings = s = extend({ - theme_advanced_path : true, - theme_advanced_toolbar_location : 'bottom', - theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect", - theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code", - theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap", - theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6", - theme_advanced_toolbar_align : "center", - theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats", - theme_advanced_more_colors : 1, - theme_advanced_row_height : 23, - theme_advanced_resize_horizontal : 1, - theme_advanced_resizing_use_cookie : 1, - theme_advanced_font_sizes : "1,2,3,4,5,6,7", - theme_advanced_font_selector : "span", - theme_advanced_show_current_color: 0, - readonly : ed.settings.readonly - }, ed.settings); - - // Setup default font_size_style_values - if (!s.font_size_style_values) - s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt"; - - if (tinymce.is(s.theme_advanced_font_sizes, 'string')) { - s.font_size_style_values = tinymce.explode(s.font_size_style_values); - s.font_size_classes = tinymce.explode(s.font_size_classes || ''); - - // Parse string value - o = {}; - ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes; - each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) { - var cl; - - if (k == v && v >= 1 && v <= 7) { - k = v + ' (' + t.sizes[v - 1] + 'pt)'; - cl = s.font_size_classes[v - 1]; - v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt'); - } - - if (/^\s*\./.test(v)) - cl = v.replace(/\./g, ''); - - o[k] = cl ? {'class' : cl} : {fontSize : v}; - }); - - s.theme_advanced_font_sizes = o; - } - - if ((v = s.theme_advanced_path_location) && v != 'none') - s.theme_advanced_statusbar_location = s.theme_advanced_path_location; - - if (s.theme_advanced_statusbar_location == 'none') - s.theme_advanced_statusbar_location = 0; - - if (ed.settings.content_css !== false) - ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css")); - - // Init editor - ed.onInit.add(function() { - if (!ed.settings.readonly) { - ed.onNodeChange.add(t._nodeChanged, t); - ed.onKeyUp.add(t._updateUndoStatus, t); - ed.onMouseUp.add(t._updateUndoStatus, t); - ed.dom.bind(ed.dom.getRoot(), 'dragend', function() { - t._updateUndoStatus(ed); - }); - } - }); - - ed.onSetProgressState.add(function(ed, b, ti) { - var co, id = ed.id, tb; - - if (b) { - t.progressTimer = setTimeout(function() { - co = ed.getContainer(); - co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild); - tb = DOM.get(ed.id + '_tbl'); - - DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}}); - DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}}); - }, ti || 0); - } else { - DOM.remove(id + '_blocker'); - DOM.remove(id + '_progress'); - clearTimeout(t.progressTimer); - } - }); - - DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css"); - - if (s.skin_variant) - DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"); - }, - - _isHighContrast : function() { - var actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'}); - - actualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, ''); - DOM.remove(div); - - return actualColor != 'rgb(171,239,86)' && actualColor != '#abef56'; - }, - - createControl : function(n, cf) { - var cd, c; - - if (c = cf.createControl(n)) - return c; - - switch (n) { - case "styleselect": - return this._createStyleSelect(); - - case "formatselect": - return this._createBlockFormats(); - - case "fontselect": - return this._createFontSelect(); - - case "fontsizeselect": - return this._createFontSizeSelect(); - - case "forecolor": - return this._createForeColorMenu(); - - case "backcolor": - return this._createBackColorMenu(); - } - - if ((cd = this.controls[n])) - return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]}); - }, - - execCommand : function(cmd, ui, val) { - var f = this['_' + cmd]; - - if (f) { - f.call(this, ui, val); - return true; - } - - return false; - }, - - _importClasses : function(e) { - var ed = this.editor, ctrl = ed.controlManager.get('styleselect'); - - if (ctrl.getLength() == 0) { - each(ed.dom.getClasses(), function(o, idx) { - var name = 'style_' + idx; - - ed.formatter.register(name, { - inline : 'span', - attributes : {'class' : o['class']}, - selector : '*' - }); - - ctrl.add(o['class'], name); - }); - } - }, - - _createStyleSelect : function(n) { - var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl; - - // Setup style select box - ctrl = ctrlMan.createListBox('styleselect', { - title : 'advanced.style_select', - onselect : function(name) { - var matches, formatNames = []; - - each(ctrl.items, function(item) { - formatNames.push(item.value); - }); - - ed.focus(); - ed.undoManager.add(); - - // Toggle off the current format - matches = ed.formatter.matchAll(formatNames); - if (!name || matches[0] == name) { - if (matches[0]) - ed.formatter.remove(matches[0]); - } else - ed.formatter.apply(name); - - ed.undoManager.add(); - ed.nodeChanged(); - - return false; // No auto select - } - }); - - // Handle specified format - ed.onInit.add(function() { - var counter = 0, formats = ed.getParam('style_formats'); - - if (formats) { - each(formats, function(fmt) { - var name, keys = 0; - - each(fmt, function() {keys++;}); - - if (keys > 1) { - name = fmt.name = fmt.name || 'style_' + (counter++); - ed.formatter.register(name, fmt); - ctrl.add(fmt.title, name); - } else - ctrl.add(fmt.title); - }); - } else { - each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) { - var name; - - if (val) { - name = 'style_' + (counter++); - - ed.formatter.register(name, { - inline : 'span', - classes : val, - selector : '*' - }); - - ctrl.add(t.editor.translate(key), name); - } - }); - } - }); - - // Auto import classes if the ctrl box is empty - if (ctrl.getLength() == 0) { - ctrl.onPostRender.add(function(ed, n) { - if (!ctrl.NativeListBox) { - Event.add(n.id + '_text', 'focus', t._importClasses, t); - Event.add(n.id + '_text', 'mousedown', t._importClasses, t); - Event.add(n.id + '_open', 'focus', t._importClasses, t); - Event.add(n.id + '_open', 'mousedown', t._importClasses, t); - } else - Event.add(n.id, 'focus', t._importClasses, t); - }); - } - - return ctrl; - }, - - _createFontSelect : function() { - var c, t = this, ed = t.editor; - - c = ed.controlManager.createListBox('fontselect', { - title : 'advanced.fontdefault', - onselect : function(v) { - var cur = c.items[c.selectedIndex]; - - if (!v && cur) { - ed.execCommand('FontName', false, cur.value); - return; - } - - ed.execCommand('FontName', false, v); - - // Fake selection, execCommand will fire a nodeChange and update the selection - c.select(function(sv) { - return v == sv; - }); - - if (cur && cur.value == v) { - c.select(null); - } - - return false; // No auto select - } - }); - - if (c) { - each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) { - c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''}); - }); - } - - return c; - }, - - _createFontSizeSelect : function() { - var t = this, ed = t.editor, c, i = 0, cl = []; - - c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) { - var cur = c.items[c.selectedIndex]; - - if (!v && cur) { - cur = cur.value; - - if (cur['class']) { - ed.formatter.toggle('fontsize_class', {value : cur['class']}); - ed.undoManager.add(); - ed.nodeChanged(); - } else { - ed.execCommand('FontSize', false, cur.fontSize); - } - - return; - } - - if (v['class']) { - ed.focus(); - ed.undoManager.add(); - ed.formatter.toggle('fontsize_class', {value : v['class']}); - ed.undoManager.add(); - ed.nodeChanged(); - } else - ed.execCommand('FontSize', false, v.fontSize); - - // Fake selection, execCommand will fire a nodeChange and update the selection - c.select(function(sv) { - return v == sv; - }); - - if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] == v['class'])) { - c.select(null); - } - - return false; // No auto select - }}); - - if (c) { - each(t.settings.theme_advanced_font_sizes, function(v, k) { - var fz = v.fontSize; - - if (fz >= 1 && fz <= 7) - fz = t.sizes[parseInt(fz) - 1] + 'pt'; - - c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))}); - }); - } - - return c; - }, - - _createBlockFormats : function() { - var c, fmts = { - p : 'advanced.paragraph', - address : 'advanced.address', - pre : 'advanced.pre', - h1 : 'advanced.h1', - h2 : 'advanced.h2', - h3 : 'advanced.h3', - h4 : 'advanced.h4', - h5 : 'advanced.h5', - h6 : 'advanced.h6', - div : 'advanced.div', - blockquote : 'advanced.blockquote', - code : 'advanced.code', - dt : 'advanced.dt', - dd : 'advanced.dd', - samp : 'advanced.samp' - }, t = this; - - c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', onselect : function(v) { - t.editor.execCommand('FormatBlock', false, v); - return false; - }}); - - if (c) { - each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) { - c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v}); - }); - } - - return c; - }, - - _createForeColorMenu : function() { - var c, t = this, s = t.settings, o = {}, v; - - if (s.theme_advanced_more_colors) { - o.more_colors_func = function() { - t._mceColorPicker(0, { - color : c.value, - func : function(co) { - c.setColor(co); - } - }); - }; - } - - if (v = s.theme_advanced_text_colors) - o.colors = v; - - if (s.theme_advanced_default_foreground_color) - o.default_color = s.theme_advanced_default_foreground_color; - - o.title = 'advanced.forecolor_desc'; - o.cmd = 'ForeColor'; - o.scope = this; - - c = t.editor.controlManager.createColorSplitButton('forecolor', o); - - return c; - }, - - _createBackColorMenu : function() { - var c, t = this, s = t.settings, o = {}, v; - - if (s.theme_advanced_more_colors) { - o.more_colors_func = function() { - t._mceColorPicker(0, { - color : c.value, - func : function(co) { - c.setColor(co); - } - }); - }; - } - - if (v = s.theme_advanced_background_colors) - o.colors = v; - - if (s.theme_advanced_default_background_color) - o.default_color = s.theme_advanced_default_background_color; - - o.title = 'advanced.backcolor_desc'; - o.cmd = 'HiliteColor'; - o.scope = this; - - c = t.editor.controlManager.createColorSplitButton('backcolor', o); - - return c; - }, - - renderUI : function(o) { - var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; - - if (ed.settings) { - ed.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut'); - } - - // TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for. - // Maybe actually inherit it from the original textara? - n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')}); - DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label); - - if (!DOM.boxModel) - n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); - - n = sc = DOM.add(n, 'table', {role : "presentation", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); - n = tb = DOM.add(n, 'tbody'); - - switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { - case "rowlayout": - ic = t._rowLayout(s, tb, o); - break; - - case "customlayout": - ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p); - break; - - default: - ic = t._simpleLayout(s, tb, o, p); - } - - n = o.targetNode; - - // Add classes to first and last TRs - nl = sc.rows; - DOM.addClass(nl[0], 'mceFirst'); - DOM.addClass(nl[nl.length - 1], 'mceLast'); - - // Add classes to first and last TDs - each(DOM.select('tr', tb), function(n) { - DOM.addClass(n.firstChild, 'mceFirst'); - DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast'); - }); - - if (DOM.get(s.theme_advanced_toolbar_container)) - DOM.get(s.theme_advanced_toolbar_container).appendChild(p); - else - DOM.insertAfter(p, n); - - Event.add(ed.id + '_path_row', 'click', function(e) { - e = e.target; - - if (e.nodeName == 'A') { - t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1')); - - return Event.cancel(e); - } - }); -/* - if (DOM.get(ed.id + '_path_row')) { - Event.add(ed.id + '_tbl', 'mouseover', function(e) { - var re; - - e = e.target; - - if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) { - re = DOM.get(ed.id + '_path_row'); - t.lastPath = re.innerHTML; - DOM.setHTML(re, e.parentNode.title); - } - }); - - Event.add(ed.id + '_tbl', 'mouseout', function(e) { - if (t.lastPath) { - DOM.setHTML(ed.id + '_path_row', t.lastPath); - t.lastPath = 0; - } - }); - } -*/ - - if (!ed.getParam('accessibility_focus')) - Event.add(DOM.add(p, 'a', {href : '#'}, ''), 'focus', function() {tinyMCE.get(ed.id).focus();}); - - if (s.theme_advanced_toolbar_location == 'external') - o.deltaHeight = 0; - - t.deltaHeight = o.deltaHeight; - o.targetNode = null; - - ed.onKeyDown.add(function(ed, evt) { - var DOM_VK_F10 = 121, DOM_VK_F11 = 122; - - if (evt.altKey) { - if (evt.keyCode === DOM_VK_F10) { - // Make sure focus is given to toolbar in Safari. - // We can't do this in IE as it prevents giving focus to toolbar when editor is in a frame - if (tinymce.isWebKit) { - window.focus(); - } - t.toolbarGroup.focus(); - return Event.cancel(evt); - } else if (evt.keyCode === DOM_VK_F11) { - DOM.get(ed.id + '_path_row').focus(); - return Event.cancel(evt); - } - } - }); - - // alt+0 is the UK recommended shortcut for accessing the list of access controls. - ed.addShortcut('alt+0', '', 'mceShortcuts', t); - - return { - iframeContainer : ic, - editorContainer : ed.id + '_parent', - sizeContainer : sc, - deltaHeight : o.deltaHeight - }; - }, - - getInfo : function() { - return { - longname : 'Advanced theme', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - version : tinymce.majorVersion + "." + tinymce.minorVersion - } - }, - - resizeBy : function(dw, dh) { - var e = DOM.get(this.editor.id + '_ifr'); - - this.resizeTo(e.clientWidth + dw, e.clientHeight + dh); - }, - - resizeTo : function(w, h, store) { - var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'); - - // Boundery fix box - w = Math.max(s.theme_advanced_resizing_min_width || 100, w); - h = Math.max(s.theme_advanced_resizing_min_height || 100, h); - w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w); - h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h); - - // Resize iframe and container - DOM.setStyle(e, 'height', ''); - DOM.setStyle(ifr, 'height', h); - - if (s.theme_advanced_resize_horizontal) { - DOM.setStyle(e, 'width', ''); - DOM.setStyle(ifr, 'width', w); - - // Make sure that the size is never smaller than the over all ui - if (w < e.clientWidth) { - w = e.clientWidth; - DOM.setStyle(ifr, 'width', e.clientWidth); - } - } - - // Store away the size - if (store && s.theme_advanced_resizing_use_cookie) { - Cookie.setHash("TinyMCE_" + ed.id + "_size", { - cw : w, - ch : h - }); - } - }, - - destroy : function() { - var id = this.editor.id; - - Event.clear(id + '_resize'); - Event.clear(id + '_path_row'); - Event.clear(id + '_external_close'); - }, - - // Internal functions - - _simpleLayout : function(s, tb, o, p) { - var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c; - - if (s.readonly) { - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); - return ic; - } - - // Create toolbar container at top - if (lo == 'top') - t._addToolbars(tb, o); - - // Create external toolbar - if (lo == 'external') { - n = c = DOM.create('div', {style : 'position:relative'}); - n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'}); - DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'}); - n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0}); - etb = DOM.add(n, 'tbody'); - - if (p.firstChild.className == 'mceOldBoxModel') - p.firstChild.appendChild(c); - else - p.insertBefore(c, p.firstChild); - - t._addToolbars(etb, o); - - ed.onMouseUp.add(function() { - var e = DOM.get(ed.id + '_external'); - DOM.show(e); - - DOM.hide(lastExtID); - - var f = Event.add(ed.id + '_external_close', 'click', function() { - DOM.hide(ed.id + '_external'); - Event.remove(ed.id + '_external_close', 'click', f); - }); - - DOM.show(e); - DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1); - - // Fixes IE rendering bug - DOM.hide(e); - DOM.show(e); - e.style.filter = ''; - - lastExtID = ed.id + '_external'; - - e = null; - }); - } - - if (sl == 'top') - t._addStatusBar(tb, o); - - // Create iframe container - if (!s.theme_advanced_toolbar_container) { - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); - } - - // Create toolbar container at bottom - if (lo == 'bottom') - t._addToolbars(tb, o); - - if (sl == 'bottom') - t._addStatusBar(tb, o); - - return ic; - }, - - _rowLayout : function(s, tb, o) { - var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a; - - dc = s.theme_advanced_containers_default_class || ''; - da = s.theme_advanced_containers_default_align || 'center'; - - each(explode(s.theme_advanced_containers || ''), function(c, i) { - var v = s['theme_advanced_container_' + c] || ''; - - switch (c.toLowerCase()) { - case 'mceeditor': - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); - break; - - case 'mceelementpath': - t._addStatusBar(tb, o); - break; - - default: - a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase(); - a = 'mce' + t._ufirst(a); - - n = DOM.add(DOM.add(tb, 'tr'), 'td', { - 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da - }); - - to = cf.createToolbar("toolbar" + i); - t._addControls(v, to); - DOM.setHTML(n, to.renderHTML()); - o.deltaHeight -= s.theme_advanced_row_height; - } - }); - - return ic; - }, - - _addControls : function(v, tb) { - var t = this, s = t.settings, di, cf = t.editor.controlManager; - - if (s.theme_advanced_disable && !t._disabled) { - di = {}; - - each(explode(s.theme_advanced_disable), function(v) { - di[v] = 1; - }); - - t._disabled = di; - } else - di = t._disabled; - - each(explode(v), function(n) { - var c; - - if (di && di[n]) - return; - - // Compatiblity with 2.x - if (n == 'tablecontrols') { - each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) { - n = t.createControl(n, cf); - - if (n) - tb.add(n); - }); - - return; - } - - c = t.createControl(n, cf); - - if (c) - tb.add(c); - }); - }, - - _addToolbars : function(c, o) { - var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup; - - toolbarGroup = cf.createToolbarGroup('toolbargroup', { - 'name': ed.getLang('advanced.toolbar'), - 'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar') - }); - - t.toolbarGroup = toolbarGroup; - - a = s.theme_advanced_toolbar_align.toLowerCase(); - a = 'mce' + t._ufirst(a); - - n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"presentation"}); - - // Create toolbar and add the controls - for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { - tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i}); - - if (s['theme_advanced_buttons' + i + '_add']) - v += ',' + s['theme_advanced_buttons' + i + '_add']; - - if (s['theme_advanced_buttons' + i + '_add_before']) - v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; - - t._addControls(v, tb); - toolbarGroup.add(tb); - - o.deltaHeight -= s.theme_advanced_row_height; - } - h.push(toolbarGroup.renderHTML()); - h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '')); - DOM.setHTML(n, h.join('')); - }, - - _addStatusBar : function(tb, o) { - var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; - - n = DOM.add(tb, 'tr'); - n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); - n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'}); - if (s.theme_advanced_path) { - DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path')); - DOM.add(n, 'span', {}, ': '); - } else { - DOM.add(n, 'span', {}, ' '); - } - - - if (s.theme_advanced_resizing) { - DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize', tabIndex:"-1"}); - - if (s.theme_advanced_resizing_use_cookie) { - ed.onPostRender.add(function() { - var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl'); - - if (!o) - return; - - t.resizeTo(o.cw, o.ch); - }); - } - - ed.onPostRender.add(function() { - Event.add(ed.id + '_resize', 'click', function(e) { - e.preventDefault(); - }); - - Event.add(ed.id + '_resize', 'mousedown', function(e) { - var mouseMoveHandler1, mouseMoveHandler2, - mouseUpHandler1, mouseUpHandler2, - startX, startY, startWidth, startHeight, width, height, ifrElm; - - function resizeOnMove(e) { - e.preventDefault(); - - width = startWidth + (e.screenX - startX); - height = startHeight + (e.screenY - startY); - - t.resizeTo(width, height); - }; - - function endResize(e) { - // Stop listening - Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1); - Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2); - Event.remove(DOM.doc, 'mouseup', mouseUpHandler1); - Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2); - - width = startWidth + (e.screenX - startX); - height = startHeight + (e.screenY - startY); - t.resizeTo(width, height, true); - }; - - e.preventDefault(); - - // Get the current rect size - startX = e.screenX; - startY = e.screenY; - ifrElm = DOM.get(t.editor.id + '_ifr'); - startWidth = width = ifrElm.clientWidth; - startHeight = height = ifrElm.clientHeight; - - // Register envent handlers - mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove); - mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove); - mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize); - mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize); - }); - }); - } - - o.deltaHeight -= 21; - n = tb = null; - }, - - _updateUndoStatus : function(ed) { - var cm = ed.controlManager, um = ed.undoManager; - - cm.setDisabled('undo', !um.hasUndo() && !um.typing); - cm.setDisabled('redo', !um.hasRedo()); - }, - - _nodeChanged : function(ed, cm, n, co, ob) { - var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches; - - tinymce.each(t.stateControls, function(c) { - cm.setActive(c, ed.queryCommandState(t.controls[c][1])); - }); - - function getParent(name) { - var i, parents = ob.parents, func = name; - - if (typeof(name) == 'string') { - func = function(node) { - return node.nodeName == name; - }; - } - - for (i = 0; i < parents.length; i++) { - if (func(parents[i])) - return parents[i]; - } - }; - - cm.setActive('visualaid', ed.hasVisual); - t._updateUndoStatus(ed); - cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); - - p = getParent('A'); - if (c = cm.get('link')) { - if (!p || !p.name) { - c.setDisabled(!p && co); - c.setActive(!!p); - } - } - - if (c = cm.get('unlink')) { - c.setDisabled(!p && co); - c.setActive(!!p && !p.name); - } - - if (c = cm.get('anchor')) { - c.setActive(!co && !!p && p.name); - } - - p = getParent('IMG'); - if (c = cm.get('image')) - c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1); - - if (c = cm.get('styleselect')) { - t._importClasses(); - - formatNames = []; - each(c.items, function(item) { - formatNames.push(item.value); - }); - - matches = ed.formatter.matchAll(formatNames); - c.select(matches[0]); - } - - if (c = cm.get('formatselect')) { - p = getParent(DOM.isBlock); - - if (p) - c.select(p.nodeName.toLowerCase()); - } - - // Find out current fontSize, fontFamily and fontClass - getParent(function(n) { - if (n.nodeName === 'SPAN') { - if (!cl && n.className) - cl = n.className; - } - - if (ed.dom.is(n, s.theme_advanced_font_selector)) { - if (!fz && n.style.fontSize) - fz = n.style.fontSize; - - if (!fn && n.style.fontFamily) - fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); - - if (!fc && n.style.color) - fc = n.style.color; - - if (!bc && n.style.backgroundColor) - bc = n.style.backgroundColor; - } - - return false; - }); - - if (c = cm.get('fontselect')) { - c.select(function(v) { - return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn; - }); - } - - // Select font size - if (c = cm.get('fontsizeselect')) { - // Use computed style - if (s.theme_advanced_runtime_fontsize && !fz && !cl) - fz = ed.dom.getStyle(n, 'fontSize', true); - - c.select(function(v) { - if (v.fontSize && v.fontSize === fz) - return true; - - if (v['class'] && v['class'] === cl) - return true; - }); - } - - if (s.theme_advanced_show_current_color) { - function updateColor(controlId, color) { - if (c = cm.get(controlId)) { - if (!color) - color = c.settings.default_color; - if (color !== c.value) { - c.displayColor(color); - } - } - } - updateColor('forecolor', fc); - updateColor('backcolor', bc); - } - - if (s.theme_advanced_show_current_color) { - function updateColor(controlId, color) { - if (c = cm.get(controlId)) { - if (!color) - color = c.settings.default_color; - if (color !== c.value) { - c.displayColor(color); - } - } - }; - - updateColor('forecolor', fc); - updateColor('backcolor', bc); - } - - if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { - p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); - - if (t.statusKeyboardNavigation) { - t.statusKeyboardNavigation.destroy(); - t.statusKeyboardNavigation = null; - } - - DOM.setHTML(p, ''); - - getParent(function(n) { - var na = n.nodeName.toLowerCase(), u, pi, ti = ''; - - // Ignore non element and bogus/hidden elements - if (n.nodeType != 1 || na === 'br' || n.getAttribute('data-mce-bogus') || DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')) - return; - - // Handle prefix - if (tinymce.isIE && n.scopeName !== 'HTML') - na = n.scopeName + ':' + na; - - // Remove internal prefix - na = na.replace(/mce\:/g, ''); - - // Handle node name - switch (na) { - case 'b': - na = 'strong'; - break; - - case 'i': - na = 'em'; - break; - - case 'img': - if (v = DOM.getAttrib(n, 'src')) - ti += 'src: ' + v + ' '; - - break; - - case 'a': - if (v = DOM.getAttrib(n, 'name')) { - ti += 'name: ' + v + ' '; - na += '#' + v; - } - - if (v = DOM.getAttrib(n, 'href')) - ti += 'href: ' + v + ' '; - - break; - - case 'font': - if (v = DOM.getAttrib(n, 'face')) - ti += 'font: ' + v + ' '; - - if (v = DOM.getAttrib(n, 'size')) - ti += 'size: ' + v + ' '; - - if (v = DOM.getAttrib(n, 'color')) - ti += 'color: ' + v + ' '; - - break; - - case 'span': - if (v = DOM.getAttrib(n, 'style')) - ti += 'style: ' + v + ' '; - - break; - } - - if (v = DOM.getAttrib(n, 'id')) - ti += 'id: ' + v + ' '; - - if (v = n.className) { - v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '') - - if (v) { - ti += 'class: ' + v + ' '; - - if (DOM.isBlock(n) || na == 'img' || na == 'span') - na += '.' + v; - } - } - - na = na.replace(/(html:)/g, ''); - na = {name : na, node : n, title : ti}; - t.onResolveName.dispatch(t, na); - ti = na.title; - na = na.name; - - //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; - pi = DOM.create('a', {'href' : "javascript:;", role: 'button', onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); - - if (p.hasChildNodes()) { - p.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\u00a0\u00bb '), p.firstChild); - p.insertBefore(pi, p.firstChild); - } else - p.appendChild(pi); - }, ed.getBody()); - - if (DOM.select('a', p).length > 0) { - t.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({ - root: ed.id + "_path_row", - items: DOM.select('a', p), - excludeFromTabOrder: true, - onCancel: function() { - ed.focus(); - } - }, DOM); - } - } - }, - - // Commands gets called by execCommand - - _sel : function(v) { - this.editor.execCommand('mceSelectNodeDepth', false, v); - }, - - _mceInsertAnchor : function(ui, v) { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/anchor.htm', - width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), - height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceCharMap : function() { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/charmap.htm', - width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), - height : 260 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceHelp : function() { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/about.htm', - width : 480, - height : 380, - inline : true - }, { - theme_url : this.url - }); - }, - - _mceShortcuts : function() { - var ed = this.editor; - ed.windowManager.open({ - url: this.url + '/shortcuts.htm', - width: 480, - height: 380, - inline: true - }, { - theme_url: this.url - }); - }, - - _mceColorPicker : function(u, v) { - var ed = this.editor; - - v = v || {}; - - ed.windowManager.open({ - url : this.url + '/color_picker.htm', - width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), - height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), - close_previous : false, - inline : true - }, { - input_color : v.color, - func : v.func, - theme_url : this.url - }); - }, - - _mceCodeEditor : function(ui, val) { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/source_editor.htm', - width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), - height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), - inline : true, - resizable : true, - maximizable : true - }, { - theme_url : this.url - }); - }, - - _mceImage : function(ui, val) { - var ed = this.editor; - - // Internal image object like a flash placeholder - if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) - return; - - ed.windowManager.open({ - url : this.url + '/image.htm', - width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), - height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceLink : function(ui, val) { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/link.htm', - width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), - height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceNewDocument : function() { - var ed = this.editor; - - ed.windowManager.confirm('advanced.newdocument', function(s) { - if (s) - ed.execCommand('mceSetContent', false, ''); - }); - }, - - _mceForeColor : function() { - var t = this; - - this._mceColorPicker(0, { - color: t.fgColor, - func : function(co) { - t.fgColor = co; - t.editor.execCommand('ForeColor', false, co); - } - }); - }, - - _mceBackColor : function() { - var t = this; - - this._mceColorPicker(0, { - color: t.bgColor, - func : function(co) { - t.bgColor = co; - t.editor.execCommand('HiliteColor', false, co); - } - }); - }, - - _ufirst : function(s) { - return s.substring(0, 1).toUpperCase() + s.substring(1); - } - }); - - tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); -}(tinymce)); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/image.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/image.htm deleted file mode 100644 index 884890fbb464..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/image.htm +++ /dev/null @@ -1,80 +0,0 @@ - - - - {#advanced_dlg.image_title} - - - - - - -
- - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
 
- x -
-
-
- -
- - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/colorpicker.jpg b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/colorpicker.jpg deleted file mode 100644 index fa6beabde2c2..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/colorpicker.jpg and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/flash.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/flash.gif deleted file mode 100644 index ba1708bb3360..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/flash.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/icons.png b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/icons.png deleted file mode 100644 index 65e1ac67fdb0..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/icons.png and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/iframe.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/iframe.gif deleted file mode 100644 index 6ae7d7b7b766..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/iframe.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/pagebreak.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/pagebreak.gif deleted file mode 100644 index 134fec7200fc..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/pagebreak.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/quicktime.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/quicktime.gif deleted file mode 100644 index c0bb5ac4c147..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/quicktime.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/realmedia.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/realmedia.gif deleted file mode 100644 index 3815f2b5157a..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/realmedia.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/shockwave.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/shockwave.gif deleted file mode 100644 index 0eda90e447da..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/shockwave.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/trans.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/trans.gif deleted file mode 100644 index 756354b05ca8..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/trans.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/video.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/video.gif deleted file mode 100644 index 0171c1707b19..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/video.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/windowsmedia.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/windowsmedia.gif deleted file mode 100644 index 7e29e7a22d31..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/img/windowsmedia.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/about.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/about.js deleted file mode 100644 index daf4909ad227..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/about.js +++ /dev/null @@ -1,73 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -function init() { - var ed, tcont; - - tinyMCEPopup.resizeToInnerSize(); - ed = tinyMCEPopup.editor; - - // Give FF some time - window.setTimeout(insertHelpIFrame, 10); - - tcont = document.getElementById('plugintablecontainer'); - document.getElementById('plugins_tab').style.display = 'none'; - - var html = ""; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - - tinymce.each(ed.plugins, function(p, n) { - var info; - - if (!p.getInfo) - return; - - html += ''; - - info = p.getInfo(); - - if (info.infourl != null && info.infourl != '') - html += ''; - else - html += ''; - - if (info.authorurl != null && info.authorurl != '') - html += ''; - else - html += ''; - - html += ''; - html += ''; - - document.getElementById('plugins_tab').style.display = ''; - - }); - - html += ''; - html += '
' + ed.getLang('advanced_dlg.about_plugin') + '' + ed.getLang('advanced_dlg.about_author') + '' + ed.getLang('advanced_dlg.about_version') + '
' + info.longname + '' + info.longname + '' + info.author + '' + info.author + '' + info.version + '
'; - - tcont.innerHTML = html; - - tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; - tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; -} - -function insertHelpIFrame() { - var html; - - if (tinyMCEPopup.getParam('docs_url')) { - html = ''; - document.getElementById('iframecontainer').innerHTML = html; - document.getElementById('help_tab').style.display = 'block'; - document.getElementById('help_tab').setAttribute("aria-hidden", "false"); - } -} - -tinyMCEPopup.onInit.add(init); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/anchor.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/anchor.js deleted file mode 100644 index b6c5b695c5a1..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/anchor.js +++ /dev/null @@ -1,43 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var AnchorDialog = { - init : function(ed) { - var action, elm, f = document.forms[0]; - - this.editor = ed; - elm = ed.dom.getParent(ed.selection.getNode(), 'A'); - v = ed.dom.getAttrib(elm, 'name'); - - if (v) { - this.action = 'update'; - f.anchorName.value = v; - } - - f.insert.value = ed.getLang(elm ? 'update' : 'insert'); - }, - - update : function() { - var ed = this.editor, elm, name = document.forms[0].anchorName.value; - - if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) { - tinyMCEPopup.alert('advanced_dlg.anchor_invalid'); - return; - } - - tinyMCEPopup.restoreSelection(); - - if (this.action != 'update') - ed.selection.collapse(1); - - elm = ed.dom.getParent(ed.selection.getNode(), 'A'); - if (elm) { - elm.setAttribute('name', name); - elm.name = name; - } else - ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, '')); - - tinyMCEPopup.close(); - } -}; - -tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/charmap.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/charmap.js deleted file mode 100644 index cbb4172bacbb..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/charmap.js +++ /dev/null @@ -1,363 +0,0 @@ -/** - * charmap.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -tinyMCEPopup.requireLangPack(); - -var charmap = [ - [' ', ' ', true, 'no-break space'], - ['&', '&', true, 'ampersand'], - ['"', '"', true, 'quotation mark'], -// finance - ['¢', '¢', true, 'cent sign'], - ['€', '€', true, 'euro sign'], - ['£', '£', true, 'pound sign'], - ['¥', '¥', true, 'yen sign'], -// signs - ['©', '©', true, 'copyright sign'], - ['®', '®', true, 'registered sign'], - ['™', '™', true, 'trade mark sign'], - ['‰', '‰', true, 'per mille sign'], - ['µ', 'µ', true, 'micro sign'], - ['·', '·', true, 'middle dot'], - ['•', '•', true, 'bullet'], - ['…', '…', true, 'three dot leader'], - ['′', '′', true, 'minutes / feet'], - ['″', '″', true, 'seconds / inches'], - ['§', '§', true, 'section sign'], - ['¶', '¶', true, 'paragraph sign'], - ['ß', 'ß', true, 'sharp s / ess-zed'], -// quotations - ['‹', '‹', true, 'single left-pointing angle quotation mark'], - ['›', '›', true, 'single right-pointing angle quotation mark'], - ['«', '«', true, 'left pointing guillemet'], - ['»', '»', true, 'right pointing guillemet'], - ['‘', '‘', true, 'left single quotation mark'], - ['’', '’', true, 'right single quotation mark'], - ['“', '“', true, 'left double quotation mark'], - ['”', '”', true, 'right double quotation mark'], - ['‚', '‚', true, 'single low-9 quotation mark'], - ['„', '„', true, 'double low-9 quotation mark'], - ['<', '<', true, 'less-than sign'], - ['>', '>', true, 'greater-than sign'], - ['≤', '≤', true, 'less-than or equal to'], - ['≥', '≥', true, 'greater-than or equal to'], - ['–', '–', true, 'en dash'], - ['—', '—', true, 'em dash'], - ['¯', '¯', true, 'macron'], - ['‾', '‾', true, 'overline'], - ['¤', '¤', true, 'currency sign'], - ['¦', '¦', true, 'broken bar'], - ['¨', '¨', true, 'diaeresis'], - ['¡', '¡', true, 'inverted exclamation mark'], - ['¿', '¿', true, 'turned question mark'], - ['ˆ', 'ˆ', true, 'circumflex accent'], - ['˜', '˜', true, 'small tilde'], - ['°', '°', true, 'degree sign'], - ['−', '−', true, 'minus sign'], - ['±', '±', true, 'plus-minus sign'], - ['÷', '÷', true, 'division sign'], - ['⁄', '⁄', true, 'fraction slash'], - ['×', '×', true, 'multiplication sign'], - ['¹', '¹', true, 'superscript one'], - ['²', '²', true, 'superscript two'], - ['³', '³', true, 'superscript three'], - ['¼', '¼', true, 'fraction one quarter'], - ['½', '½', true, 'fraction one half'], - ['¾', '¾', true, 'fraction three quarters'], -// math / logical - ['ƒ', 'ƒ', true, 'function / florin'], - ['∫', '∫', true, 'integral'], - ['∑', '∑', true, 'n-ary sumation'], - ['∞', '∞', true, 'infinity'], - ['√', '√', true, 'square root'], - ['∼', '∼', false,'similar to'], - ['≅', '≅', false,'approximately equal to'], - ['≈', '≈', true, 'almost equal to'], - ['≠', '≠', true, 'not equal to'], - ['≡', '≡', true, 'identical to'], - ['∈', '∈', false,'element of'], - ['∉', '∉', false,'not an element of'], - ['∋', '∋', false,'contains as member'], - ['∏', '∏', true, 'n-ary product'], - ['∧', '∧', false,'logical and'], - ['∨', '∨', false,'logical or'], - ['¬', '¬', true, 'not sign'], - ['∩', '∩', true, 'intersection'], - ['∪', '∪', false,'union'], - ['∂', '∂', true, 'partial differential'], - ['∀', '∀', false,'for all'], - ['∃', '∃', false,'there exists'], - ['∅', '∅', false,'diameter'], - ['∇', '∇', false,'backward difference'], - ['∗', '∗', false,'asterisk operator'], - ['∝', '∝', false,'proportional to'], - ['∠', '∠', false,'angle'], -// undefined - ['´', '´', true, 'acute accent'], - ['¸', '¸', true, 'cedilla'], - ['ª', 'ª', true, 'feminine ordinal indicator'], - ['º', 'º', true, 'masculine ordinal indicator'], - ['†', '†', true, 'dagger'], - ['‡', '‡', true, 'double dagger'], -// alphabetical special chars - ['À', 'À', true, 'A - grave'], - ['Á', 'Á', true, 'A - acute'], - ['Â', 'Â', true, 'A - circumflex'], - ['Ã', 'Ã', true, 'A - tilde'], - ['Ä', 'Ä', true, 'A - diaeresis'], - ['Å', 'Å', true, 'A - ring above'], - ['Æ', 'Æ', true, 'ligature AE'], - ['Ç', 'Ç', true, 'C - cedilla'], - ['È', 'È', true, 'E - grave'], - ['É', 'É', true, 'E - acute'], - ['Ê', 'Ê', true, 'E - circumflex'], - ['Ë', 'Ë', true, 'E - diaeresis'], - ['Ì', 'Ì', true, 'I - grave'], - ['Í', 'Í', true, 'I - acute'], - ['Î', 'Î', true, 'I - circumflex'], - ['Ï', 'Ï', true, 'I - diaeresis'], - ['Ð', 'Ð', true, 'ETH'], - ['Ñ', 'Ñ', true, 'N - tilde'], - ['Ò', 'Ò', true, 'O - grave'], - ['Ó', 'Ó', true, 'O - acute'], - ['Ô', 'Ô', true, 'O - circumflex'], - ['Õ', 'Õ', true, 'O - tilde'], - ['Ö', 'Ö', true, 'O - diaeresis'], - ['Ø', 'Ø', true, 'O - slash'], - ['Œ', 'Œ', true, 'ligature OE'], - ['Š', 'Š', true, 'S - caron'], - ['Ù', 'Ù', true, 'U - grave'], - ['Ú', 'Ú', true, 'U - acute'], - ['Û', 'Û', true, 'U - circumflex'], - ['Ü', 'Ü', true, 'U - diaeresis'], - ['Ý', 'Ý', true, 'Y - acute'], - ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], - ['Þ', 'Þ', true, 'THORN'], - ['à', 'à', true, 'a - grave'], - ['á', 'á', true, 'a - acute'], - ['â', 'â', true, 'a - circumflex'], - ['ã', 'ã', true, 'a - tilde'], - ['ä', 'ä', true, 'a - diaeresis'], - ['å', 'å', true, 'a - ring above'], - ['æ', 'æ', true, 'ligature ae'], - ['ç', 'ç', true, 'c - cedilla'], - ['è', 'è', true, 'e - grave'], - ['é', 'é', true, 'e - acute'], - ['ê', 'ê', true, 'e - circumflex'], - ['ë', 'ë', true, 'e - diaeresis'], - ['ì', 'ì', true, 'i - grave'], - ['í', 'í', true, 'i - acute'], - ['î', 'î', true, 'i - circumflex'], - ['ï', 'ï', true, 'i - diaeresis'], - ['ð', 'ð', true, 'eth'], - ['ñ', 'ñ', true, 'n - tilde'], - ['ò', 'ò', true, 'o - grave'], - ['ó', 'ó', true, 'o - acute'], - ['ô', 'ô', true, 'o - circumflex'], - ['õ', 'õ', true, 'o - tilde'], - ['ö', 'ö', true, 'o - diaeresis'], - ['ø', 'ø', true, 'o slash'], - ['œ', 'œ', true, 'ligature oe'], - ['š', 'š', true, 's - caron'], - ['ù', 'ù', true, 'u - grave'], - ['ú', 'ú', true, 'u - acute'], - ['û', 'û', true, 'u - circumflex'], - ['ü', 'ü', true, 'u - diaeresis'], - ['ý', 'ý', true, 'y - acute'], - ['þ', 'þ', true, 'thorn'], - ['ÿ', 'ÿ', true, 'y - diaeresis'], - ['Α', 'Α', true, 'Alpha'], - ['Β', 'Β', true, 'Beta'], - ['Γ', 'Γ', true, 'Gamma'], - ['Δ', 'Δ', true, 'Delta'], - ['Ε', 'Ε', true, 'Epsilon'], - ['Ζ', 'Ζ', true, 'Zeta'], - ['Η', 'Η', true, 'Eta'], - ['Θ', 'Θ', true, 'Theta'], - ['Ι', 'Ι', true, 'Iota'], - ['Κ', 'Κ', true, 'Kappa'], - ['Λ', 'Λ', true, 'Lambda'], - ['Μ', 'Μ', true, 'Mu'], - ['Ν', 'Ν', true, 'Nu'], - ['Ξ', 'Ξ', true, 'Xi'], - ['Ο', 'Ο', true, 'Omicron'], - ['Π', 'Π', true, 'Pi'], - ['Ρ', 'Ρ', true, 'Rho'], - ['Σ', 'Σ', true, 'Sigma'], - ['Τ', 'Τ', true, 'Tau'], - ['Υ', 'Υ', true, 'Upsilon'], - ['Φ', 'Φ', true, 'Phi'], - ['Χ', 'Χ', true, 'Chi'], - ['Ψ', 'Ψ', true, 'Psi'], - ['Ω', 'Ω', true, 'Omega'], - ['α', 'α', true, 'alpha'], - ['β', 'β', true, 'beta'], - ['γ', 'γ', true, 'gamma'], - ['δ', 'δ', true, 'delta'], - ['ε', 'ε', true, 'epsilon'], - ['ζ', 'ζ', true, 'zeta'], - ['η', 'η', true, 'eta'], - ['θ', 'θ', true, 'theta'], - ['ι', 'ι', true, 'iota'], - ['κ', 'κ', true, 'kappa'], - ['λ', 'λ', true, 'lambda'], - ['μ', 'μ', true, 'mu'], - ['ν', 'ν', true, 'nu'], - ['ξ', 'ξ', true, 'xi'], - ['ο', 'ο', true, 'omicron'], - ['π', 'π', true, 'pi'], - ['ρ', 'ρ', true, 'rho'], - ['ς', 'ς', true, 'final sigma'], - ['σ', 'σ', true, 'sigma'], - ['τ', 'τ', true, 'tau'], - ['υ', 'υ', true, 'upsilon'], - ['φ', 'φ', true, 'phi'], - ['χ', 'χ', true, 'chi'], - ['ψ', 'ψ', true, 'psi'], - ['ω', 'ω', true, 'omega'], -// symbols - ['ℵ', 'ℵ', false,'alef symbol'], - ['ϖ', 'ϖ', false,'pi symbol'], - ['ℜ', 'ℜ', false,'real part symbol'], - ['ϑ','ϑ', false,'theta symbol'], - ['ϒ', 'ϒ', false,'upsilon - hook symbol'], - ['℘', '℘', false,'Weierstrass p'], - ['ℑ', 'ℑ', false,'imaginary part'], -// arrows - ['←', '←', true, 'leftwards arrow'], - ['↑', '↑', true, 'upwards arrow'], - ['→', '→', true, 'rightwards arrow'], - ['↓', '↓', true, 'downwards arrow'], - ['↔', '↔', true, 'left right arrow'], - ['↵', '↵', false,'carriage return'], - ['⇐', '⇐', false,'leftwards double arrow'], - ['⇑', '⇑', false,'upwards double arrow'], - ['⇒', '⇒', false,'rightwards double arrow'], - ['⇓', '⇓', false,'downwards double arrow'], - ['⇔', '⇔', false,'left right double arrow'], - ['∴', '∴', false,'therefore'], - ['⊂', '⊂', false,'subset of'], - ['⊃', '⊃', false,'superset of'], - ['⊄', '⊄', false,'not a subset of'], - ['⊆', '⊆', false,'subset of or equal to'], - ['⊇', '⊇', false,'superset of or equal to'], - ['⊕', '⊕', false,'circled plus'], - ['⊗', '⊗', false,'circled times'], - ['⊥', '⊥', false,'perpendicular'], - ['⋅', '⋅', false,'dot operator'], - ['⌈', '⌈', false,'left ceiling'], - ['⌉', '⌉', false,'right ceiling'], - ['⌊', '⌊', false,'left floor'], - ['⌋', '⌋', false,'right floor'], - ['⟨', '〈', false,'left-pointing angle bracket'], - ['⟩', '〉', false,'right-pointing angle bracket'], - ['◊', '◊', true, 'lozenge'], - ['♠', '♠', true, 'black spade suit'], - ['♣', '♣', true, 'black club suit'], - ['♥', '♥', true, 'black heart suit'], - ['♦', '♦', true, 'black diamond suit'], - [' ', ' ', false,'en space'], - [' ', ' ', false,'em space'], - [' ', ' ', false,'thin space'], - ['‌', '‌', false,'zero width non-joiner'], - ['‍', '‍', false,'zero width joiner'], - ['‎', '‎', false,'left-to-right mark'], - ['‏', '‏', false,'right-to-left mark'], - ['­', '­', false,'soft hyphen'] -]; - -tinyMCEPopup.onInit.add(function() { - tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); - addKeyboardNavigation(); -}); - -function addKeyboardNavigation(){ - var tableElm, cells, settings; - - cells = tinyMCEPopup.dom.select("a.charmaplink", "charmapgroup"); - - settings ={ - root: "charmapgroup", - items: cells - }; - cells[0].tabindex=0; - tinyMCEPopup.dom.addClass(cells[0], "mceFocus"); - if (tinymce.isGecko) { - cells[0].focus(); - } else { - setTimeout(function(){ - cells[0].focus(); - }, 100); - } - tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); -} - -function renderCharMapHTML() { - var charsPerRow = 20, tdWidth=20, tdHeight=20, i; - var html = '
'+ - ''; - var cols=-1; - - for (i=0; i' - + '' - + charmap[i][1] - + ''; - if ((cols+1) % charsPerRow == 0) - html += ''; - } - } - - if (cols % charsPerRow > 0) { - var padd = charsPerRow - (cols % charsPerRow); - for (var i=0; i '; - } - - html += '
'; - html = html.replace(/<\/tr>/g, ''); - - return html; -} - -function insertChar(chr) { - tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); - - // Refocus in window - if (tinyMCEPopup.isWindow) - window.focus(); - - tinyMCEPopup.editor.focus(); - tinyMCEPopup.close(); -} - -function previewChar(codeA, codeB, codeN) { - var elmA = document.getElementById('codeA'); - var elmB = document.getElementById('codeB'); - var elmV = document.getElementById('codeV'); - var elmN = document.getElementById('codeN'); - - if (codeA=='#160;') { - elmV.innerHTML = '__'; - } else { - elmV.innerHTML = '&' + codeA; - } - - elmB.innerHTML = '&' + codeA; - elmA.innerHTML = '&' + codeB; - elmN.innerHTML = codeN; -} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/color_picker.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/color_picker.js deleted file mode 100644 index 3cbf32c4f2fc..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/color_picker.js +++ /dev/null @@ -1,329 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false; - -var colors = [ - "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033", - "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099", - "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff", - "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033", - "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399", - "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff", - "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333", - "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399", - "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff", - "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633", - "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699", - "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff", - "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633", - "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999", - "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff", - "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933", - "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999", - "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff", - "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33", - "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99", - "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff", - "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33", - "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99", - "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff", - "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33", - "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99", - "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff" -]; - -var named = { - '#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', - '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown', - '#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue', - '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod', - '#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green', - '#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue', - '#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue', - '#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green', - '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey', - '#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory', - '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue', - '#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green', - '#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey', - '#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', - '#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue', - '#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin', - '#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid', - '#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff', - '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue', - '#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver', - '#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green', - '#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', - '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green' -}; - -var namedLookup = {}; - -function init() { - var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value; - - tinyMCEPopup.resizeToInnerSize(); - - generatePicker(); - generateWebColors(); - generateNamedColors(); - - if (inputColor) { - changeFinalColor(inputColor); - - col = convertHexToRGB(inputColor); - - if (col) - updateLight(col.r, col.g, col.b); - } - - for (key in named) { - value = named[key]; - namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase(); - } -} - -function toHexColor(color) { - var matches, red, green, blue, toInt = parseInt; - - function hex(value) { - value = parseInt(value).toString(16); - - return value.length > 1 ? value : '0' + value; // Padd with leading zero - }; - - color = color.replace(/[\s#]+/g, '').toLowerCase(); - color = namedLookup[color] || color; - matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)|([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})|([a-f0-9])([a-f0-9])([a-f0-9])$/.exec(color); - - if (matches) { - if (matches[1]) { - red = toInt(matches[1]); - green = toInt(matches[2]); - blue = toInt(matches[3]); - } else if (matches[4]) { - red = toInt(matches[4], 16); - green = toInt(matches[5], 16); - blue = toInt(matches[6], 16); - } else if (matches[7]) { - red = toInt(matches[7] + matches[7], 16); - green = toInt(matches[8] + matches[8], 16); - blue = toInt(matches[9] + matches[9], 16); - } - - return '#' + hex(red) + hex(green) + hex(blue); - } - - return ''; -} - -function insertAction() { - var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); - - tinyMCEPopup.restoreSelection(); - - if (f) - f(toHexColor(color)); - - tinyMCEPopup.close(); -} - -function showColor(color, name) { - if (name) - document.getElementById("colorname").innerHTML = name; - - document.getElementById("preview").style.backgroundColor = color; - document.getElementById("color").value = color.toUpperCase(); -} - -function convertRGBToHex(col) { - var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); - - if (!col) - return col; - - var rgb = col.replace(re, "$1,$2,$3").split(','); - if (rgb.length == 3) { - r = parseInt(rgb[0]).toString(16); - g = parseInt(rgb[1]).toString(16); - b = parseInt(rgb[2]).toString(16); - - r = r.length == 1 ? '0' + r : r; - g = g.length == 1 ? '0' + g : g; - b = b.length == 1 ? '0' + b : b; - - return "#" + r + g + b; - } - - return col; -} - -function convertHexToRGB(col) { - if (col.indexOf('#') != -1) { - col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); - - r = parseInt(col.substring(0, 2), 16); - g = parseInt(col.substring(2, 4), 16); - b = parseInt(col.substring(4, 6), 16); - - return {r : r, g : g, b : b}; - } - - return null; -} - -function generatePicker() { - var el = document.getElementById('light'), h = '', i; - - for (i = 0; i < detail; i++){ - h += '
'; - } - - el.innerHTML = h; -} - -function generateWebColors() { - var el = document.getElementById('webcolors'), h = '', i; - - if (el.className == 'generated') - return; - - // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby. - h += '
' - + ''; - - for (i=0; i' - + ''; - if (tinyMCEPopup.editor.forcedHighContrastMode) { - h += ''; - } - h += ''; - h += ''; - if ((i+1) % 18 == 0) - h += ''; - } - - h += '
'; - - el.innerHTML = h; - el.className = 'generated'; - - paintCanvas(el); - enableKeyboardNavigation(el.firstChild); -} - -function paintCanvas(el) { - tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) { - var context; - if (canvas.getContext && (context = canvas.getContext("2d"))) { - context.fillStyle = canvas.getAttribute('data-color'); - context.fillRect(0, 0, 10, 10); - } - }); -} -function generateNamedColors() { - var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; - - if (el.className == 'generated') - return; - - for (n in named) { - v = named[n]; - h += ''; - if (tinyMCEPopup.editor.forcedHighContrastMode) { - h += ''; - } - h += ''; - h += ''; - i++; - } - - el.innerHTML = h; - el.className = 'generated'; - - paintCanvas(el); - enableKeyboardNavigation(el); -} - -function enableKeyboardNavigation(el) { - tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', { - root: el, - items: tinyMCEPopup.dom.select('a', el) - }, tinyMCEPopup.dom); -} - -function dechex(n) { - return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); -} - -function computeColor(e) { - var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target); - - x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0); - y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0); - - partWidth = document.getElementById('colors').width / 6; - partDetail = detail / 2; - imHeight = document.getElementById('colors').height; - - r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; - g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); - b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); - - coef = (imHeight - y) / imHeight; - r = 128 + (r - 128) * coef; - g = 128 + (g - 128) * coef; - b = 128 + (b - 128) * coef; - - changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); - updateLight(r, g, b); -} - -function updateLight(r, g, b) { - var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; - - for (i=0; i=0) && (i'); - }, - - init : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor; - - // Setup browse button - document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); - if (isVisible('srcbrowser')) - document.getElementById('src').style.width = '180px'; - - e = ed.selection.getNode(); - - this.fillFileList('image_list', tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList')); - - if (e.nodeName == 'IMG') { - f.src.value = ed.dom.getAttrib(e, 'src'); - f.alt.value = ed.dom.getAttrib(e, 'alt'); - f.border.value = this.getAttrib(e, 'border'); - f.vspace.value = this.getAttrib(e, 'vspace'); - f.hspace.value = this.getAttrib(e, 'hspace'); - f.width.value = ed.dom.getAttrib(e, 'width'); - f.height.value = ed.dom.getAttrib(e, 'height'); - f.insert.value = ed.getLang('update'); - this.styleVal = ed.dom.getAttrib(e, 'style'); - selectByValue(f, 'image_list', f.src.value); - selectByValue(f, 'align', this.getAttrib(e, 'align')); - this.updateStyle(); - } - }, - - fillFileList : function(id, l) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - l = typeof(l) === 'function' ? l() : window[l]; - - if (l && l.length > 0) { - lst.options[lst.options.length] = new Option('', ''); - - tinymce.each(l, function(o) { - lst.options[lst.options.length] = new Option(o[0], o[1]); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - update : function() { - var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; - - tinyMCEPopup.restoreSelection(); - - if (f.src.value === '') { - if (ed.selection.getNode().nodeName == 'IMG') { - ed.dom.remove(ed.selection.getNode()); - ed.execCommand('mceRepaint'); - } - - tinyMCEPopup.close(); - return; - } - - if (!ed.settings.inline_styles) { - args = tinymce.extend(args, { - vspace : nl.vspace.value, - hspace : nl.hspace.value, - border : nl.border.value, - align : getSelectValue(f, 'align') - }); - } else - args.style = this.styleVal; - - tinymce.extend(args, { - src : f.src.value.replace(/ /g, '%20'), - alt : f.alt.value, - width : f.width.value, - height : f.height.value - }); - - el = ed.selection.getNode(); - - if (el && el.nodeName == 'IMG') { - ed.dom.setAttribs(el, args); - tinyMCEPopup.editor.execCommand('mceRepaint'); - tinyMCEPopup.editor.focus(); - } else { - tinymce.each(args, function(value, name) { - if (value === "") { - delete args[name]; - } - }); - - ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); - ed.undoManager.add(); - } - - tinyMCEPopup.close(); - }, - - updateStyle : function() { - var dom = tinyMCEPopup.dom, st, v, f = document.forms[0]; - - if (tinyMCEPopup.editor.settings.inline_styles) { - st = tinyMCEPopup.dom.parseStyle(this.styleVal); - - // Handle align - v = getSelectValue(f, 'align'); - if (v) { - if (v == 'left' || v == 'right') { - st['float'] = v; - delete st['vertical-align']; - } else { - st['vertical-align'] = v; - delete st['float']; - } - } else { - delete st['float']; - delete st['vertical-align']; - } - - // Handle border - v = f.border.value; - if (v || v == '0') { - if (v == '0') - st['border'] = '0'; - else - st['border'] = v + 'px solid black'; - } else - delete st['border']; - - // Handle hspace - v = f.hspace.value; - if (v) { - delete st['margin']; - st['margin-left'] = v + 'px'; - st['margin-right'] = v + 'px'; - } else { - delete st['margin-left']; - delete st['margin-right']; - } - - // Handle vspace - v = f.vspace.value; - if (v) { - delete st['margin']; - st['margin-top'] = v + 'px'; - st['margin-bottom'] = v + 'px'; - } else { - delete st['margin-top']; - delete st['margin-bottom']; - } - - // Merge - st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img'); - this.styleVal = dom.serializeStyle(st, 'img'); - } - }, - - getAttrib : function(e, at) { - var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; - - if (ed.settings.inline_styles) { - switch (at) { - case 'align': - if (v = dom.getStyle(e, 'float')) - return v; - - if (v = dom.getStyle(e, 'vertical-align')) - return v; - - break; - - case 'hspace': - v = dom.getStyle(e, 'margin-left') - v2 = dom.getStyle(e, 'margin-right'); - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'vspace': - v = dom.getStyle(e, 'margin-top') - v2 = dom.getStyle(e, 'margin-bottom'); - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'border': - v = 0; - - tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { - sv = dom.getStyle(e, 'border-' + sv + '-width'); - - // False or not the same as prev - if (!sv || (sv != v && v !== 0)) { - v = 0; - return false; - } - - if (sv) - v = sv; - }); - - if (v) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - } - } - - if (v = dom.getAttrib(e, at)) - return v; - - return ''; - }, - - resetImageData : function() { - var f = document.forms[0]; - - f.width.value = f.height.value = ""; - }, - - updateImageData : function() { - var f = document.forms[0], t = ImageDialog; - - if (f.width.value == "") - f.width.value = t.preloadImg.width; - - if (f.height.value == "") - f.height.value = t.preloadImg.height; - }, - - getImageData : function() { - var f = document.forms[0]; - - this.preloadImg = new Image(); - this.preloadImg.onload = this.updateImageData; - this.preloadImg.onerror = this.resetImageData; - this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); - } -}; - -ImageDialog.preInit(); -tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/link.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/link.js deleted file mode 100644 index e67d868a2b4b..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/link.js +++ /dev/null @@ -1,153 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var LinkDialog = { - preInit : function() { - var url; - - if (url = tinyMCEPopup.getParam("external_link_list_url")) - document.write(''); - }, - - init : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor; - - // Setup browse button - document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); - if (isVisible('hrefbrowser')) - document.getElementById('href').style.width = '180px'; - - this.fillClassList('class_list'); - this.fillFileList('link_list', 'tinyMCELinkList'); - this.fillTargetList('target_list'); - - if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { - f.href.value = ed.dom.getAttrib(e, 'href'); - f.linktitle.value = ed.dom.getAttrib(e, 'title'); - f.insert.value = ed.getLang('update'); - selectByValue(f, 'link_list', f.href.value); - selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); - selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); - } - }, - - update : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20'); - - tinyMCEPopup.restoreSelection(); - e = ed.dom.getParent(ed.selection.getNode(), 'A'); - - // Remove element if there is no href - if (!f.href.value) { - if (e) { - b = ed.selection.getBookmark(); - ed.dom.remove(e, 1); - ed.selection.moveToBookmark(b); - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); - return; - } - } - - // Create new anchor elements - if (e == null) { - ed.getDoc().execCommand("unlink", false, null); - tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); - - tinymce.each(ed.dom.select("a"), function(n) { - if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { - e = n; - - ed.dom.setAttribs(e, { - href : href, - title : f.linktitle.value, - target : f.target_list ? getSelectValue(f, "target_list") : null, - 'class' : f.class_list ? getSelectValue(f, "class_list") : null - }); - } - }); - } else { - ed.dom.setAttribs(e, { - href : href, - title : f.linktitle.value, - target : f.target_list ? getSelectValue(f, "target_list") : null, - 'class' : f.class_list ? getSelectValue(f, "class_list") : null - }); - } - - // Don't move caret if selection was image - if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { - ed.focus(); - ed.selection.select(e); - ed.selection.collapse(0); - tinyMCEPopup.storeSelection(); - } - - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); - }, - - checkPrefix : function(n) { - if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) - n.value = 'mailto:' + n.value; - - if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) - n.value = 'http://' + n.value; - }, - - fillFileList : function(id, l) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - l = window[l]; - - if (l && l.length > 0) { - lst.options[lst.options.length] = new Option('', ''); - - tinymce.each(l, function(o) { - lst.options[lst.options.length] = new Option(o[0], o[1]); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - fillClassList : function(id) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { - cl = []; - - tinymce.each(v.split(';'), function(v) { - var p = v.split('='); - - cl.push({'title' : p[0], 'class' : p[1]}); - }); - } else - cl = tinyMCEPopup.editor.dom.getClasses(); - - if (cl.length > 0) { - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); - - tinymce.each(cl, function(o) { - lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - fillTargetList : function(id) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v; - - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); - - if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { - tinymce.each(v.split(','), function(v) { - v = v.split('='); - lst.options[lst.options.length] = new Option(v[0], v[1]); - }); - } - } -}; - -LinkDialog.preInit(); -tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/source_editor.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/source_editor.js deleted file mode 100644 index e90ee4d99628..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/source_editor.js +++ /dev/null @@ -1,57 +0,0 @@ -tinyMCEPopup.requireLangPack(); -tinyMCEPopup.onInit.add(onLoadInit); - -function saveContent() { - tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true}); - tinyMCEPopup.close(); -} - -function onLoadInit() { - tinyMCEPopup.resizeToInnerSize(); - - // Remove Gecko spellchecking - if (tinymce.isGecko) { - document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck", false); - } - - document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true}); - - if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { - setWrap('soft'); - document.getElementById('wraped').checked = true; - } - - resizeInputs(); -} - -function setWrap(val) { - var v, n, s = document.getElementById('htmlSource'); - - s.wrap = val; - - if (!tinymce.isIE) { - v = s.value; - n = s.cloneNode(false); - n.setAttribute("wrap", val); - s.parentNode.replaceChild(n, s); - n.value = v; - } -} - -function toggleWordWrap(elm) { - if (elm.checked) - setWrap('soft'); - else - setWrap('off'); -} - -function resizeInputs() { - var vp = tinyMCEPopup.dom.getViewPort(window), el; - - el = document.getElementById('htmlSource'); - - if (el) { - el.style.width = (vp.w - 20) + 'px'; - el.style.height = (vp.h - 65) + 'px'; - } -} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/langs/en.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/langs/en.js deleted file mode 100644 index 6e5848187436..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/langs/en.js +++ /dev/null @@ -1 +0,0 @@ -tinyMCE.addI18n('en.advanced',{"underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)",dd:"Definition Description",dt:"Definition Term ",samp:"Code Sample",code:"Code",blockquote:"Block Quote",h6:"Heading 6",h5:"Heading 5",h4:"Heading 4",h3:"Heading 3",h2:"Heading 2",h1:"Heading 1",pre:"Preformatted",address:"Address",div:"DIV",paragraph:"Paragraph",block:"Format",fontdefault:"Font Family","font_size":"Font Size","style_select":"Styles","anchor_delta_height":"","anchor_delta_width":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":"","more_colors":"More Colors...","toolbar_focus":"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",newdocument:"Are you sure you want clear all contents?",path:"Path","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","blockquote_desc":"Block Quote","help_desc":"Help","newdocument_desc":"New Document","image_props_desc":"Image Properties","paste_desc":"Paste (Ctrl+V)","copy_desc":"Copy (Ctrl+C)","cut_desc":"Cut (Ctrl+X)","anchor_desc":"Insert/Edit Anchor","visualaid_desc":"show/Hide Guidelines/Invisible Elements","charmap_desc":"Insert Special Character","backcolor_desc":"Select Background Color","forecolor_desc":"Select Text Color","custom1_desc":"Your Custom Description Here","removeformat_desc":"Remove Formatting","hr_desc":"Insert Horizontal Line","sup_desc":"Superscript","sub_desc":"Subscript","code_desc":"Edit HTML Source","cleanup_desc":"Cleanup Messy Code","image_desc":"Insert/Edit Image","unlink_desc":"Unlink","link_desc":"Insert/Edit Link","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","indent_desc":"Increase Indent","outdent_desc":"Decrease Indent","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","justifyfull_desc":"Align Full","justifyright_desc":"Align Right","justifycenter_desc":"Align Center","justifyleft_desc":"Align Left","striketrough_desc":"Strikethrough","help_shortcut":"Press ALT-F10 for toolbar. Press ALT-0 for help","rich_text_area":"Rich Text Area","shortcuts_desc":"Accessability Help",toolbar:"Toolbar"}); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/langs/en_dlg.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/langs/en_dlg.js deleted file mode 100644 index 42c9a13c8524..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/langs/en_dlg.js +++ /dev/null @@ -1 +0,0 @@ -tinyMCE.addI18n('en.advanced_dlg', {"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character", "charmap_usage":"Use left and right arrows to navigate.","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","":""}); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/link.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/link.htm deleted file mode 100644 index 4a2459f8a55d..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/link.htm +++ /dev/null @@ -1,57 +0,0 @@ - - - - {#advanced_dlg.link_title} - - - - - - - -
- - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - - -
 
-
-
- -
- - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/shortcuts.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/shortcuts.htm deleted file mode 100644 index 436091f14536..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/shortcuts.htm +++ /dev/null @@ -1,47 +0,0 @@ - - - - {#advanced_dlg.accessibility_help} - - - - -

{#advanced_dlg.accessibility_usage_title}

-

Toolbars

-

Press ALT-F10 to move focus to the toolbars. Navigate through the buttons using the arrow keys. - Press enter to activate a button and return focus to the editor. - Press escape to return focus to the editor without performing any actions.

- -

Status Bar

-

To access the editor status bar, press ALT-F11. Use the left and right arrow keys to navigate between elements in the path. - Press enter or space to select an element. Press escape to return focus to the editor without changing the selection.

- -

Context Menu

-

Press shift-F10 to activate the context menu. Use the up and down arrow keys to move between menu items. To open sub-menus press the right arrow key. - To close submenus press the left arrow key. Press escape to close the context menu.

- -

Keyboard Shortcuts

- - - - - - - - - - - - - - - - - - - - - -
KeystrokeFunction
Control-BBold
Control-IItalic
Control-ZUndo
Control-YRedo
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/content.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/content.css deleted file mode 100644 index 284e54205f1d..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/content.css +++ /dev/null @@ -1,78 +0,0 @@ -body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} -body {background:#FFF;} -body.mceForceColors {background:#FFF; color:#000;} -body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;} -h1 {font-size: 2em} -h2 {font-size: 1.5em} -h3 {font-size: 1.17em} -h4 {font-size: 1em} -h5 {font-size: .83em} -h6 {font-size: .75em} -.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {display:inline-block; -webkit-user-select:all; -webkit-user-modify:read-only; -moz-user-select:all; -moz-user-modify:read-only; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat center center} -span.mceItemNbsp {background: #DDD} -td.mceSelected, th.mceSelected {background-color:#3399ff !important} -img {border:0;} -table, img, hr, .mceItemAnchor {cursor:default} -table td, table th {cursor:text} -ins {border-bottom:1px solid green; text-decoration: none; color:green} -del {color:red; text-decoration:line-through} -cite {border-bottom:1px dashed blue} -acronym {border-bottom:1px dotted #CCC; cursor:help} -abbr {border-bottom:1px dashed #CCC; cursor:help} - -/* IE */ -* html body { -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -} - -img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} -font[face=mceinline] {font-family:inherit !important} -*[contentEditable]:focus {outline:0} - -.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} -.mceItemShockWave {background-image:url(../../img/shockwave.gif)} -.mceItemFlash {background-image:url(../../img/flash.gif)} -.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} -.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} -.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} -.mceItemVideo {background-image:url(../../img/video.gif)} -.mceItemAudio {background-image:url(../../img/video.gif)} -.mceItemEmbeddedAudio {background-image:url(../../img/video.gif)} -.mceItemIframe {background-image:url(../../img/iframe.gif)} -.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} - -.magento-placeholder { - display: inline-block; - margin: 0 5px; - background: #dff7ff; - outline: 2px solid #c0dffa; - padding: 2px 4px; - vertical-align: bottom; - height: 20px; -} - -.magento-placeholder-error { - display: inline-block; - margin: 0 5px; - background: #ffc0cb; - outline: 2px solid #FF0000; - padding: 2px 4px; - vertical-align: bottom; - height: 20px; -} - -.magento-placeholder-error img, -.magento-placeholder img { - vertical-align: middle; - max-height: 20px; - margin-right: 5px; -} - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/dialog.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/dialog.css deleted file mode 100644 index d5daec7e64ce..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/dialog.css +++ /dev/null @@ -1,117 +0,0 @@ -/* Generic */ -body { -font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDDDDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -background:#F0F0EE; -padding:0; -margin:8px 8px 0 8px; -} - -html {background:#F0F0EE;} -td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -textarea {resize:none;outline:none;} -a:link, a:visited {color:black;} -a:hover {color:#2B6FB6;} -.nowrap {white-space: nowrap} - -/* Forms */ -fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} -legend {color:#2B6FB6; font-weight:bold;} -label.msg {display:none;} -label.invalid {color:#EE0000; display:inline;} -input.invalid {border:1px solid #EE0000;} -input {background:#FFF; border:1px solid #CCC;} -input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -input, select, textarea {border:1px solid #808080;} -input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} -input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} -.input_noborder {border:0;} - -/* Buttons */ -#insert, #cancel, input.button, .updateButton { -border:0; margin:0; padding:0; -font-weight:bold; -width:94px; height:26px; -background:url(img/buttons.png) 0 -26px; -cursor:pointer; -padding-bottom:2px; -float:left; -} - -#insert {background:url(img/buttons.png) 0 -52px} -#cancel {background:url(img/buttons.png) 0 0; float:right} - -/* Browse */ -a.pickcolor, a.browse {text-decoration:none} -a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.png) -860px 0; border:1px solid #FFF; margin-left:1px;} -.mceOldBoxModel a.browse span {width:22px; height:20px;} -a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} -a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} -a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.png) -840px 0; margin-left:2px;} -.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} -a.pickcolor:hover span {background-color:#B2BBD0;} -a.pickcolor:hover span.disabled {} - -/* Charmap */ -table.charmap {border:1px solid #AAA; text-align:center} -td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} -#charmap a {display:block; color:#000; text-decoration:none; border:0} -#charmap a:hover {background:#CCC;color:#2B6FB6} -#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} -#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} - -/* Source */ -.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} -.mceActionPanel {margin-top:5px;} - -/* Tabs classes */ -.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} -.tabs ul {margin:0; padding:0; list-style:none;} -.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} -.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} -.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} -.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} -.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} -.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} - -/* Panels */ -.panel_wrapper div.panel {display:none;} -.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} -.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} - -/* Columns */ -.column {float:left;} -.properties {width:100%;} -.properties .column1 {} -.properties .column2 {text-align:left;} - -/* Titles */ -h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} -h3 {font-size:14px;} -.title {font-size:12px; font-weight:bold; color:#2B6FB6;} - -/* Dialog specific */ -#link .panel_wrapper, #link div.current {height:125px;} -#image .panel_wrapper, #image div.current {height:200px;} -#plugintable thead {font-weight:bold; background:#DDD;} -#plugintable, #about #plugintable td {border:1px solid #919B9C;} -#plugintable {width:96%; margin-top:10px;} -#pluginscontainer {height:290px; overflow:auto;} -#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} -#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} -#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} -#colorpicker #light div {overflow:hidden;} -#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} -#colorpicker .panel_wrapper div.current {height:175px;} -#colorpicker #namedcolors {width:150px;} -#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} -#colorpicker #colornamecontainer {margin-top:5px;} -#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/img/buttons.png b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/img/buttons.png deleted file mode 100644 index 6e385e152444..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/img/buttons.png and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/img/items.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/img/items.gif deleted file mode 100644 index 2c550ddcd022..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/img/items.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif deleted file mode 100644 index 404d90b9d072..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/img/menu_check.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/img/menu_check.gif deleted file mode 100644 index 78b4f9a8f436..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/img/menu_check.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/img/progress.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/img/progress.gif deleted file mode 100644 index 4b524cdc41b5..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/img/progress.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/img/tabs.gif b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/img/tabs.gif deleted file mode 100644 index d80df1391722..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/img/tabs.gif and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/ui.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/ui.css deleted file mode 100644 index bf33446ff9aa..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/default/ui.css +++ /dev/null @@ -1,218 +0,0 @@ -/* Reset */ -.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} -.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} -.defaultSkin table td {vertical-align:middle} - -/* Containers */ -.defaultSkin table {direction:ltr;background:transparent} -.defaultSkin iframe {display:block;} -.defaultSkin .mceToolbar {height:26px} -.defaultSkin .mceLeft {text-align:left} -.defaultSkin .mceRight {text-align:right} - -/* External */ -.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;} -.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} -.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.png) -820px 0} - -/* Layout */ -.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC} -.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC} -.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC} -.defaultSkin table.mceToolbar, -.defaultSkin tr.mceFirst .mceToolbar tr td, -.defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0; background: #fff} -.defaultSkin table.mceLayout td, -.defaultSkin table.mceLayout td:hover {background:#fff;} -.defaultSkin td.mceToolbar { padding-top:1px; vertical-align:top} -.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC} -.defaultSkin .mceStatusbar { font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px} -.defaultSkin .mceStatusbar div {float:left; margin:2px} -.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.png) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} -.defaultSkin .mceStatusbar a:hover {text-decoration:underline} -.defaultSkin table.mceToolbar {margin-left:3px} -.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} -.defaultSkin .mceIcon {background:url(../../img/icons.png) no-repeat 20px 20px} -.defaultSkin td.mceCenter {text-align:center;} -.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;} -.defaultSkin td.mceRight table {margin:0 0 0 auto;} - -/* Button */ -.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px} -.defaultSkin a.mceButtonEnabled:hover {border:1px solid #c0bbaf; background-color:#c0bbaf; } -.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #c0bbaf; background-color:#dbd6ce} -.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.defaultSkin .mceButtonLabeled {width:auto} -.defaultSkin .mceButtonLabeled span.mceIcon {float:left} -.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} -.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888} - -/* Separator */ -.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.png) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px} - -/* ListBox */ -.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} -.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} -.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.png) -741px 0; margin-right:2px; border:1px solid #CCC;} -.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} -.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} -.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} -.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} -.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} -.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} -.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; /*background:#F0F0EE;*/ border:1px solid gray; margin-right:2px;} - -/* SplitButton */ -.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr} -.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block} -.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;} -.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.png);} -.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.png) -741px 0; border:1px solid #F0F0EE;} -.defaultSkin .mceSplitButton span.mceOpen {display:none} -.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #c0bbaf; border-right:0; background-color:#dbd6ce} -.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#c0bbaf; border:1px solid #c0bbaf;} -.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #c0bbaf; background-color:#dbd6ce} -.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;} - -/* ColorSplitButton */ -.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} -.defaultSkin .mceColorSplitMenu td {padding:2px} -.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} -.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} -.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} -.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} -.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} -.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a} -.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px} - -/* Menu */ -.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8} -.defaultSkin .mceNoIcons span.mceIcon {width:0;} -.defaultSkin .mceNoIcons a .mceText {padding-left:10px} -.defaultSkin .mceMenu table {background:#FFF} -.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} -.defaultSkin .mceMenu td {height:20px} -.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} -.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} -.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} -.defaultSkin .mceMenu pre.mceText {font-family:Monospace} -.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} -.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} -.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} -.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} -.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} -.defaultSkin .mceMenuItemDisabled .mceText {color:#888} -.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} -.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} -.defaultSkin .mceMenu span.mceMenuLine {display:none} -.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} -.defaultSkin .mceMenuItem td, .defaultSkin .mceMenuItem th {line-height: normal} - -/* Progress,Resize */ -.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF} -.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} - -/* Formats */ -.defaultSkin .mce_formatPreview a {font-size:10px} -.defaultSkin .mce_p span.mceText {} -.defaultSkin .mce_address span.mceText {font-style:italic} -.defaultSkin .mce_pre span.mceText {font-family:monospace} -.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} -.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} -.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} -.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} -.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} -.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} - -/* Theme */ -.defaultSkin span.mce_bold {background-position:0 0} -.defaultSkin span.mce_italic {background-position:-60px 0} -.defaultSkin span.mce_underline {background-position:-140px 0} -.defaultSkin span.mce_strikethrough {background-position:-120px 0} -.defaultSkin span.mce_undo {background-position:-160px 0} -.defaultSkin span.mce_redo {background-position:-100px 0} -.defaultSkin span.mce_cleanup {background-position:-40px 0} -.defaultSkin span.mce_bullist {background-position:-20px 0} -.defaultSkin span.mce_numlist {background-position:-80px 0} -.defaultSkin span.mce_justifyleft {background-position:-460px 0} -.defaultSkin span.mce_justifyright {background-position:-480px 0} -.defaultSkin span.mce_justifycenter {background-position:-420px 0} -.defaultSkin span.mce_justifyfull {background-position:-440px 0} -.defaultSkin span.mce_anchor {background-position:-200px 0} -.defaultSkin span.mce_indent {background-position:-400px 0} -.defaultSkin span.mce_outdent {background-position:-540px 0} -.defaultSkin span.mce_link {background-position:-500px 0} -.defaultSkin span.mce_unlink {background-position:-640px 0} -.defaultSkin span.mce_sub {background-position:-600px 0} -.defaultSkin span.mce_sup {background-position:-620px 0} -.defaultSkin span.mce_removeformat {background-position:-580px 0} -.defaultSkin span.mce_newdocument {background-position:-520px 0} -.defaultSkin span.mce_image {background-position:-380px 0} -.defaultSkin span.mce_help {background-position:-340px 0} -.defaultSkin span.mce_code {background-position:-260px 0} -.defaultSkin span.mce_hr {background-position:-360px 0} -.defaultSkin span.mce_visualaid {background-position:-660px 0} -.defaultSkin span.mce_charmap {background-position:-240px 0} -.defaultSkin span.mce_paste {background-position:-560px 0} -.defaultSkin span.mce_copy {background-position:-700px 0} -.defaultSkin span.mce_cut {background-position:-680px 0} -.defaultSkin span.mce_blockquote {background-position:-220px 0} -.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0} -.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0} -.defaultSkin span.mce_forecolorpicker {background-position:-720px 0} -.defaultSkin span.mce_backcolorpicker {background-position:-760px 0} - -/* Plugins */ -.defaultSkin span.mce_advhr {background-position:-0px -20px} -.defaultSkin span.mce_ltr {background-position:-20px -20px} -.defaultSkin span.mce_rtl {background-position:-40px -20px} -.defaultSkin span.mce_emotions {background-position:-60px -20px} -.defaultSkin span.mce_fullpage {background-position:-80px -20px} -.defaultSkin span.mce_fullscreen {background-position:-100px -20px} -.defaultSkin span.mce_iespell {background-position:-120px -20px} -.defaultSkin span.mce_insertdate {background-position:-140px -20px} -.defaultSkin span.mce_inserttime {background-position:-160px -20px} -.defaultSkin span.mce_absolute {background-position:-180px -20px} -.defaultSkin span.mce_backward {background-position:-200px -20px} -.defaultSkin span.mce_forward {background-position:-220px -20px} -.defaultSkin span.mce_insert_layer {background-position:-240px -20px} -.defaultSkin span.mce_insertlayer {background-position:-260px -20px} -.defaultSkin span.mce_movebackward {background-position:-280px -20px} -.defaultSkin span.mce_moveforward {background-position:-300px -20px} -.defaultSkin span.mce_media {background-position:-320px -20px} -.defaultSkin span.mce_nonbreaking {background-position:-340px -20px} -.defaultSkin span.mce_pastetext {background-position:-360px -20px} -.defaultSkin span.mce_pasteword {background-position:-380px -20px} -.defaultSkin span.mce_selectall {background-position:-400px -20px} -.defaultSkin span.mce_preview {background-position:-420px -20px} -.defaultSkin span.mce_print {background-position:-440px -20px} -.defaultSkin span.mce_cancel {background-position:-460px -20px} -.defaultSkin span.mce_save {background-position:-480px -20px} -.defaultSkin span.mce_replace {background-position:-500px -20px} -.defaultSkin span.mce_search {background-position:-520px -20px} -.defaultSkin span.mce_styleprops {background-position:-560px -20px} -.defaultSkin span.mce_table {background-position:-580px -20px} -.defaultSkin span.mce_cell_props {background-position:-600px -20px} -.defaultSkin span.mce_delete_table {background-position:-620px -20px} -.defaultSkin span.mce_delete_col {background-position:-640px -20px} -.defaultSkin span.mce_delete_row {background-position:-660px -20px} -.defaultSkin span.mce_col_after {background-position:-680px -20px} -.defaultSkin span.mce_col_before {background-position:-700px -20px} -.defaultSkin span.mce_row_after {background-position:-720px -20px} -.defaultSkin span.mce_row_before {background-position:-740px -20px} -.defaultSkin span.mce_merge_cells {background-position:-760px -20px} -.defaultSkin span.mce_table_props {background-position:-980px -20px} -.defaultSkin span.mce_row_props {background-position:-780px -20px} -.defaultSkin span.mce_split_cells {background-position:-800px -20px} -.defaultSkin span.mce_template {background-position:-820px -20px} -.defaultSkin span.mce_visualchars {background-position:-840px -20px} -.defaultSkin span.mce_abbr {background-position:-860px -20px} -.defaultSkin span.mce_acronym {background-position:-880px -20px} -.defaultSkin span.mce_attribs {background-position:-900px -20px} -.defaultSkin span.mce_cite {background-position:-920px -20px} -.defaultSkin span.mce_del {background-position:-940px -20px} -.defaultSkin span.mce_ins {background-position:-960px -20px} -.defaultSkin span.mce_pagebreak {background-position:0 -40px} -.defaultSkin span.mce_restoredraft {background-position:-20px -40px} -.defaultSkin span.mce_spellchecker {background-position:-540px -20px} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/highcontrast/content.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/highcontrast/content.css deleted file mode 100644 index ee3d369d0223..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/highcontrast/content.css +++ /dev/null @@ -1,24 +0,0 @@ -body, td, pre { margin:8px;} -body.mceForceColors {background:#FFF; color:#000;} -h1 {font-size: 2em} -h2 {font-size: 1.5em} -h3 {font-size: 1.17em} -h4 {font-size: 1em} -h5 {font-size: .83em} -h6 {font-size: .75em} -.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} -span.mceItemNbsp {background: #DDD} -td.mceSelected, th.mceSelected {background-color:#3399ff !important} -img {border:0;} -table, img, hr, .mceItemAnchor {cursor:default} -table td, table th {cursor:text} -ins {border-bottom:1px solid green; text-decoration: none; color:green} -del {color:red; text-decoration:line-through} -cite {border-bottom:1px dashed blue} -acronym {border-bottom:1px dotted #CCC; cursor:help} -abbr {border-bottom:1px dashed #CCC; cursor:help} - -img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} -font[face=mceinline] {font-family:inherit !important} -*[contentEditable]:focus {outline:0} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/highcontrast/dialog.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/highcontrast/dialog.css deleted file mode 100644 index 0deab02ec487..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +++ /dev/null @@ -1,105 +0,0 @@ -/* Generic */ -body { -font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; -background:#F0F0EE; -color: black; -padding:0; -margin:8px 8px 0 8px; -} - -html {background:#F0F0EE; color:#000;} -td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -textarea {resize:none;outline:none;} -a:link, a:visited {color:black;background-color:transparent;} -a:hover {color:#2B6FB6;background-color:transparent;} -.nowrap {white-space: nowrap} - -/* Forms */ -fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} -legend {color:#2B6FB6; font-weight:bold;} -label.msg {display:none;} -label.invalid {color:#EE0000; display:inline;background-color:transparent;} -input.invalid {border:1px solid #EE0000;background-color:transparent;} -input {background:#FFF; border:1px solid #CCC;color:black;} -input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -input, select, textarea {border:1px solid #808080;} -input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} -input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} -.input_noborder {border:0;} - -/* Buttons */ -#insert, #cancel, input.button, .updateButton { -font-weight:bold; -width:94px; height:23px; -cursor:pointer; -padding-bottom:2px; -float:left; -} - -#cancel {float:right} - -/* Browse */ -a.pickcolor, a.browse {text-decoration:none} -a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.png) -860px 0; border:1px solid #FFF; margin-left:1px;} -.mceOldBoxModel a.browse span {width:22px; height:20px;} -a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} -a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} -a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.png) -840px 0; margin-left:2px;} -.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} -a.pickcolor:hover span {background-color:#B2BBD0;} -a.pickcolor:hover span.disabled {} - -/* Charmap */ -table.charmap {border:1px solid #AAA; text-align:center} -td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} -#charmap a {display:block; color:#000; text-decoration:none; border:0} -#charmap a:hover {background:#CCC;color:#2B6FB6} -#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} -#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} - -/* Source */ -.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} -.mceActionPanel {margin-top:5px;} - -/* Tabs classes */ -.tabs {width:100%; height:18px; line-height:normal;} -.tabs ul {margin:0; padding:0; list-style:none;} -.tabs li {float:left; border: 1px solid black; border-bottom:0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block; cursor:pointer;} -.tabs li.current {font-weight: bold; margin-right:2px;} -.tabs span {float:left; display:block; padding:0px 10px 0 0;} -.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} -.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} - -/* Panels */ -.panel_wrapper div.panel {display:none;} -.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} -.panel_wrapper {border:1px solid #919B9C; padding:10px; padding-top:5px; clear:both; background:white;} - -/* Columns */ -.column {float:left;} -.properties {width:100%;} -.properties .column1 {} -.properties .column2 {text-align:left;} - -/* Titles */ -h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} -h3 {font-size:14px;} -.title {font-size:12px; font-weight:bold; color:#2B6FB6;} - -/* Dialog specific */ -#link .panel_wrapper, #link div.current {height:125px;} -#image .panel_wrapper, #image div.current {height:200px;} -#plugintable thead {font-weight:bold; background:#DDD;} -#plugintable, #about #plugintable td {border:1px solid #919B9C;} -#plugintable {width:96%; margin-top:10px;} -#pluginscontainer {height:290px; overflow:auto;} -#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} -#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} -#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} -#colorpicker #light div {overflow:hidden;} -#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} -#colorpicker .panel_wrapper div.current {height:175px;} -#colorpicker #namedcolors {width:150px;} -#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} -#colorpicker #colornamecontainer {margin-top:5px;} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/highcontrast/ui.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/highcontrast/ui.css deleted file mode 100644 index 81da151f6ef1..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/highcontrast/ui.css +++ /dev/null @@ -1,102 +0,0 @@ -/* Reset */ -.highcontrastSkin table, .highcontrastSkin tbody, .highcontrastSkin a, .highcontrastSkin img, .highcontrastSkin tr, .highcontrastSkin div, .highcontrastSkin td, .highcontrastSkin iframe, .highcontrastSkin span, .highcontrastSkin *, .highcontrastSkin .mceText {border:0; margin:0; padding:0; vertical-align:baseline; border-collapse:separate;} -.highcontrastSkin a:hover, .highcontrastSkin a:link, .highcontrastSkin a:visited, .highcontrastSkin a:active {text-decoration:none; font-weight:normal; cursor:default;} -.highcontrastSkin table td {vertical-align:middle} - -.highcontrastSkin .mceIconOnly {display: block !important;} - -/* External */ -.highcontrastSkin .mceExternalToolbar {position:absolute; border:1px solid; border-bottom:0; display:none; background-color: white;} -.highcontrastSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} -.highcontrastSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px;} - -/* Layout */ -.highcontrastSkin table.mceLayout {border: 1px solid;} -.highcontrastSkin .mceIframeContainer {border-top:1px solid; border-bottom:1px solid} -.highcontrastSkin .mceStatusbar a:hover {text-decoration:underline} -.highcontrastSkin .mceStatusbar {display:block; line-height:1.5em; overflow:visible;} -.highcontrastSkin .mceStatusbar div {float:left} -.highcontrastSkin .mceStatusbar a.mceResize {display:block; float:right; width:20px; height:20px; cursor:se-resize; outline:0} - -.highcontrastSkin .mceToolbar td { display: inline-block; float: left;} -.highcontrastSkin .mceToolbar tr { display: block;} -.highcontrastSkin .mceToolbar table { display: block; } - -/* Button */ - -.highcontrastSkin .mceButton { display:block; margin: 2px; padding: 5px 10px;border: 1px solid; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -ms-border-radius: 3px; height: 2em;} -.highcontrastSkin .mceButton .mceVoiceLabel { height: 100%; vertical-align: center; line-height: 2em} -.highcontrastSkin .mceButtonDisabled .mceVoiceLabel { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} -.highcontrastSkin .mceButtonActive, .highcontrastSkin .mceButton:focus, .highcontrastSkin .mceButton:active { border: 5px solid; padding: 1px 6px;-webkit-focus-ring-color:none;outline:none;} - -/* Separator */ -.highcontrastSkin .mceSeparator {display:block; width:16px; height:26px;} - -/* ListBox */ -.highcontrastSkin .mceListBox { display: block; margin:2px;-webkit-focus-ring-color:none;outline:none;} -.highcontrastSkin .mceListBox .mceText {padding: 5px 6px; line-height: 2em; width: 15ex; overflow: hidden;} -.highcontrastSkin .mceListBoxDisabled .mceText { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} -.highcontrastSkin .mceListBox a.mceText { padding: 5px 10px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} -.highcontrastSkin .mceListBox a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-left: 0; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} -.highcontrastSkin .mceListBox:focus a.mceText, .highcontrastSkin .mceListBox:active a.mceText { border-width: 5px; padding: 1px 10px 1px 6px;} -.highcontrastSkin .mceListBox:focus a.mceOpen, .highcontrastSkin .mceListBox:active a.mceOpen { border-width: 5px; padding: 1px 0px 1px 4px;} - -.highcontrastSkin .mceListBoxMenu {overflow-y:auto} - -/* SplitButton */ -.highcontrastSkin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} - -.highcontrastSkin .mceSplitButton { border-collapse: collapse; margin: 2px; height: 2em; line-height: 2em;-webkit-focus-ring-color:none;outline:none;} -.highcontrastSkin .mceSplitButton td { display: table-cell; float: none; margin: 0; padding: 0; height: 2em;} -.highcontrastSkin .mceSplitButton tr { display: table-row; } -.highcontrastSkin table.mceSplitButton { display: table; } -.highcontrastSkin .mceSplitButton a.mceAction { padding: 5px 10px; display: block; height: 2em; line-height: 2em; overflow: hidden; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} -.highcontrastSkin .mceSplitButton a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} -.highcontrastSkin .mceSplitButton .mceVoiceLabel { height: 2em; vertical-align: center; line-height: 2em; } -.highcontrastSkin .mceSplitButton:focus a.mceAction, .highcontrastSkin .mceSplitButton:active a.mceAction { border-width: 5px; border-right-width: 1px; padding: 1px 10px 1px 6px;-webkit-focus-ring-color:none;outline:none;} -.highcontrastSkin .mceSplitButton:focus a.mceOpen, .highcontrastSkin .mceSplitButton:active a.mceOpen { border-width: 5px; border-left-width: 1px; padding: 1px 0px 1px 4px;-webkit-focus-ring-color:none;outline:none;} - -/* Menu */ -.highcontrastSkin .mceNoIcons span.mceIcon {width:0;} -.highcontrastSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid; } -.highcontrastSkin .mceMenu table {background:white; color: black} -.highcontrastSkin .mceNoIcons a .mceText {padding-left:10px} -.highcontrastSkin .mceMenu a, .highcontrastSkin .mceMenu span, .highcontrastSkin .mceMenu {display:block;background:white; color: black} -.highcontrastSkin .mceMenu td {height:2em} -.highcontrastSkin .mceMenu a {position:relative;padding:3px 0 4px 0; display: block;} -.highcontrastSkin .mceMenu .mceText {position:relative; display:block; cursor:default; margin:0; padding:0 25px 0 25px;} -.highcontrastSkin .mceMenu pre.mceText {font-family:Monospace} -.highcontrastSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:26px;} -.highcontrastSkin td.mceMenuItemSeparator {border-top:1px solid; height:1px} -.highcontrastSkin .mceMenuItemTitle a {border:0; border-bottom:1px solid} -.highcontrastSkin .mceMenuItemTitle span.mceText {font-weight:bold; padding-left:4px} -.highcontrastSkin .mceNoIcons .mceMenuItemSelected span.mceText:before {content: "\2713\A0";} -.highcontrastSkin .mceMenu span.mceMenuLine {display:none} -.highcontrastSkin .mceMenuItemSub a .mceText:after {content: "\A0\25B8"} -.highcontrastSkin .mceMenuItem td, .highcontrastSkin .mceMenuItem th {line-height: normal} - -/* ColorSplitButton */ -.highcontrastSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid; color: #000} -.highcontrastSkin .mceColorSplitMenu td {padding:2px} -.highcontrastSkin .mceColorSplitMenu a {display:block; width:16px; height:16px; overflow:hidden; color:#000; margin: 0; padding: 0;} -.highcontrastSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} -.highcontrastSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} -.highcontrastSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid; background-color:#B6BDD2} -.highcontrastSkin a.mceMoreColors:hover {border:1px solid #0A246A; color: #000;} -.highcontrastSkin .mceColorPreview {display:none;} -.highcontrastSkin .mce_forecolor span.mceAction, .highcontrastSkin .mce_backcolor span.mceAction {height:17px;overflow:hidden} - -/* Progress,Resize */ -.highcontrastSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} -.highcontrastSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} - -/* Formats */ -.highcontrastSkin .mce_p span.mceText {} -.highcontrastSkin .mce_address span.mceText {font-style:italic} -.highcontrastSkin .mce_pre span.mceText {font-family:monospace} -.highcontrastSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} -.highcontrastSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} -.highcontrastSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} -.highcontrastSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} -.highcontrastSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} -.highcontrastSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/content.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/content.css deleted file mode 100644 index 631fa0ec8740..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/content.css +++ /dev/null @@ -1,48 +0,0 @@ -body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} -body {background:#FFF;} -body.mceForceColors {background:#FFF; color:#000;} -h1 {font-size: 2em} -h2 {font-size: 1.5em} -h3 {font-size: 1.17em} -h4 {font-size: 1em} -h5 {font-size: .83em} -h6 {font-size: .75em} -.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} -span.mceItemNbsp {background: #DDD} -td.mceSelected, th.mceSelected {background-color:#3399ff !important} -img {border:0;} -table, img, hr, .mceItemAnchor {cursor:default} -table td, table th {cursor:text} -ins {border-bottom:1px solid green; text-decoration: none; color:green} -del {color:red; text-decoration:line-through} -cite {border-bottom:1px dashed blue} -acronym {border-bottom:1px dotted #CCC; cursor:help} -abbr {border-bottom:1px dashed #CCC; cursor:help} - -/* IE */ -* html body { -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -} - -img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} -font[face=mceinline] {font-family:inherit !important} -*[contentEditable]:focus {outline:0} - -.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} -.mceItemShockWave {background-image:url(../../img/shockwave.gif)} -.mceItemFlash {background-image:url(../../img/flash.gif)} -.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} -.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} -.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} -.mceItemVideo {background-image:url(../../img/video.gif)} -.mceItemAudio {background-image:url(../../img/video.gif)} -.mceItemIframe {background-image:url(../../img/iframe.gif)} -.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/dialog.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/dialog.css deleted file mode 100644 index f2bae812e699..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/dialog.css +++ /dev/null @@ -1,117 +0,0 @@ -/* Generic */ -body { -font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDDDDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -background:#F0F0EE; -padding:0; -margin:8px 8px 0 8px; -} - -html {background:#F0F0EE;} -td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -textarea {resize:none;outline:none;} -a:link, a:visited {color:black;} -a:hover {color:#2B6FB6;} -.nowrap {white-space: nowrap} - -/* Forms */ -fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} -legend {color:#2B6FB6; font-weight:bold;} -label.msg {display:none;} -label.invalid {color:#EE0000; display:inline;} -input.invalid {border:1px solid #EE0000;} -input {background:#FFF; border:1px solid #CCC;} -input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -input, select, textarea {border:1px solid #808080;} -input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} -input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} -.input_noborder {border:0;} - -/* Buttons */ -#insert, #cancel, input.button, .updateButton { -border:0; margin:0; padding:0; -font-weight:bold; -width:94px; height:26px; -background:url(../default/img/buttons.png) 0 -26px; -cursor:pointer; -padding-bottom:2px; -float:left; -} - -#insert {background:url(../default/img/buttons.png) 0 -52px} -#cancel {background:url(../default/img/buttons.png) 0 0; float:right} - -/* Browse */ -a.pickcolor, a.browse {text-decoration:none} -a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.png) -860px 0; border:1px solid #FFF; margin-left:1px;} -.mceOldBoxModel a.browse span {width:22px; height:20px;} -a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} -a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} -a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.png) -840px 0; margin-left:2px;} -.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} -a.pickcolor:hover span {background-color:#B2BBD0;} -a.pickcolor:hover span.disabled {} - -/* Charmap */ -table.charmap {border:1px solid #AAA; text-align:center} -td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} -#charmap a {display:block; color:#000; text-decoration:none; border:0} -#charmap a:hover {background:#CCC;color:#2B6FB6} -#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} -#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} - -/* Source */ -.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} -.mceActionPanel {margin-top:5px;} - -/* Tabs classes */ -.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} -.tabs ul {margin:0; padding:0; list-style:none;} -.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} -.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} -.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} -.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} -.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} -.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} - -/* Panels */ -.panel_wrapper div.panel {display:none;} -.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} -.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} - -/* Columns */ -.column {float:left;} -.properties {width:100%;} -.properties .column1 {} -.properties .column2 {text-align:left;} - -/* Titles */ -h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} -h3 {font-size:14px;} -.title {font-size:12px; font-weight:bold; color:#2B6FB6;} - -/* Dialog specific */ -#link .panel_wrapper, #link div.current {height:125px;} -#image .panel_wrapper, #image div.current {height:200px;} -#plugintable thead {font-weight:bold; background:#DDD;} -#plugintable, #about #plugintable td {border:1px solid #919B9C;} -#plugintable {width:96%; margin-top:10px;} -#pluginscontainer {height:290px; overflow:auto;} -#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} -#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} -#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} -#colorpicker #light div {overflow:hidden;} -#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} -#colorpicker .panel_wrapper div.current {height:175px;} -#colorpicker #namedcolors {width:150px;} -#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} -#colorpicker #colornamecontainer {margin-top:5px;} -#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png deleted file mode 100644 index c32aa10f7385..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png deleted file mode 100644 index 7aaad49b18f0..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png deleted file mode 100644 index 9218de5b0275..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/ui.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/ui.css deleted file mode 100644 index dcdf69c00c9f..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/ui.css +++ /dev/null @@ -1,217 +0,0 @@ -/* Reset */ -.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} -.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} -.o2k7Skin table td {vertical-align:middle} - -/* Containers */ -.o2k7Skin table {background:transparent} -.o2k7Skin iframe {display:block;} -.o2k7Skin .mceToolbar {height:26px} - -/* External */ -.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none} -.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;} -.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.png) -820px 0} - -/* Layout */ -.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD} -.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD} -.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} -.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} -.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} -.o2k7Skin td.mceToolbar{background:#E5EFFD} -.o2k7Skin .mceStatusbar {background:#E5EFFD; display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} -.o2k7Skin .mceStatusbar div {float:left; padding:2px} -.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.png) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} -.o2k7Skin .mceStatusbar a:hover {text-decoration:underline} -.o2k7Skin table.mceToolbar {margin-left:3px} -.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;} -.o2k7Skin .mceToolbar td.mceFirst span {margin:0} -.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} -.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none} -.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} -.o2k7Skin .mceIcon {background:url(../../img/icons.png) no-repeat 20px 20px} -.o2k7Skin td.mceCenter {text-align:center;} -.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;} -.o2k7Skin td.mceRight table {margin:0 0 0 auto;} - -/* Button */ -.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} -.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px} -.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} -.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} -.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px} -.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.o2k7Skin .mceButtonLabeled {width:auto} -.o2k7Skin .mceButtonLabeled span.mceIcon {float:left} -.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} -.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888} - -/* Separator */ -.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} - -/* ListBox */ -.o2k7Skin .mceListBox {padding-left: 3px} -.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} -.o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} -.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} -.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} -.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} -.o2k7Skin .mceListBoxDisabled .mceText {color:gray} -.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden; margin-left:3px} -.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} -.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} - -/* SplitButton */ -.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px; direction:ltr} -.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} -.o2k7Skin .mceSplitButton a.mceAction {width:22px} -.o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.png)} -.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0} -.o2k7Skin .mceSplitButton span.mceOpen {display:none} -.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px} -.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px} -.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.o2k7Skin .mceSplitButtonActive {background-position:0 -44px} - -/* ColorSplitButton */ -.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} -.o2k7Skin .mceColorSplitMenu td {padding:2px} -.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} -.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} -.o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} -.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} -.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} -.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden} -.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden} - -/* Menu */ -.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD} -.o2k7Skin .mceNoIcons span.mceIcon {width:0;} -.o2k7Skin .mceNoIcons a .mceText {padding-left:10px} -.o2k7Skin .mceMenu table {background:#FFF} -.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block} -.o2k7Skin .mceMenu td {height:20px} -.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0} -.o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} -.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px} -.o2k7Skin .mceMenu pre.mceText {font-family:Monospace} -.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} -.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3} -.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px} -.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD} -.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} -.o2k7Skin .mceMenuItemDisabled .mceText {color:#888} -.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)} -.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} -.o2k7Skin .mceMenu span.mceMenuLine {display:none} -.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} -.o2k7Skin .mceMenuItem td, .o2k7Skin .mceMenuItem th {line-height: normal} - -/* Progress,Resize */ -.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} -.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} - -/* Formats */ -.o2k7Skin .mce_formatPreview a {font-size:10px} -.o2k7Skin .mce_p span.mceText {} -.o2k7Skin .mce_address span.mceText {font-style:italic} -.o2k7Skin .mce_pre span.mceText {font-family:monospace} -.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} -.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} -.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} -.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} -.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} -.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} - -/* Theme */ -.o2k7Skin span.mce_bold {background-position:0 0} -.o2k7Skin span.mce_italic {background-position:-60px 0} -.o2k7Skin span.mce_underline {background-position:-140px 0} -.o2k7Skin span.mce_strikethrough {background-position:-120px 0} -.o2k7Skin span.mce_undo {background-position:-160px 0} -.o2k7Skin span.mce_redo {background-position:-100px 0} -.o2k7Skin span.mce_cleanup {background-position:-40px 0} -.o2k7Skin span.mce_bullist {background-position:-20px 0} -.o2k7Skin span.mce_numlist {background-position:-80px 0} -.o2k7Skin span.mce_justifyleft {background-position:-460px 0} -.o2k7Skin span.mce_justifyright {background-position:-480px 0} -.o2k7Skin span.mce_justifycenter {background-position:-420px 0} -.o2k7Skin span.mce_justifyfull {background-position:-440px 0} -.o2k7Skin span.mce_anchor {background-position:-200px 0} -.o2k7Skin span.mce_indent {background-position:-400px 0} -.o2k7Skin span.mce_outdent {background-position:-540px 0} -.o2k7Skin span.mce_link {background-position:-500px 0} -.o2k7Skin span.mce_unlink {background-position:-640px 0} -.o2k7Skin span.mce_sub {background-position:-600px 0} -.o2k7Skin span.mce_sup {background-position:-620px 0} -.o2k7Skin span.mce_removeformat {background-position:-580px 0} -.o2k7Skin span.mce_newdocument {background-position:-520px 0} -.o2k7Skin span.mce_image {background-position:-380px 0} -.o2k7Skin span.mce_help {background-position:-340px 0} -.o2k7Skin span.mce_code {background-position:-260px 0} -.o2k7Skin span.mce_hr {background-position:-360px 0} -.o2k7Skin span.mce_visualaid {background-position:-660px 0} -.o2k7Skin span.mce_charmap {background-position:-240px 0} -.o2k7Skin span.mce_paste {background-position:-560px 0} -.o2k7Skin span.mce_copy {background-position:-700px 0} -.o2k7Skin span.mce_cut {background-position:-680px 0} -.o2k7Skin span.mce_blockquote {background-position:-220px 0} -.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0} -.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0} -.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0} -.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0} - -/* Plugins */ -.o2k7Skin span.mce_advhr {background-position:-0px -20px} -.o2k7Skin span.mce_ltr {background-position:-20px -20px} -.o2k7Skin span.mce_rtl {background-position:-40px -20px} -.o2k7Skin span.mce_emotions {background-position:-60px -20px} -.o2k7Skin span.mce_fullpage {background-position:-80px -20px} -.o2k7Skin span.mce_fullscreen {background-position:-100px -20px} -.o2k7Skin span.mce_iespell {background-position:-120px -20px} -.o2k7Skin span.mce_insertdate {background-position:-140px -20px} -.o2k7Skin span.mce_inserttime {background-position:-160px -20px} -.o2k7Skin span.mce_absolute {background-position:-180px -20px} -.o2k7Skin span.mce_backward {background-position:-200px -20px} -.o2k7Skin span.mce_forward {background-position:-220px -20px} -.o2k7Skin span.mce_insert_layer {background-position:-240px -20px} -.o2k7Skin span.mce_insertlayer {background-position:-260px -20px} -.o2k7Skin span.mce_movebackward {background-position:-280px -20px} -.o2k7Skin span.mce_moveforward {background-position:-300px -20px} -.o2k7Skin span.mce_media {background-position:-320px -20px} -.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px} -.o2k7Skin span.mce_pastetext {background-position:-360px -20px} -.o2k7Skin span.mce_pasteword {background-position:-380px -20px} -.o2k7Skin span.mce_selectall {background-position:-400px -20px} -.o2k7Skin span.mce_preview {background-position:-420px -20px} -.o2k7Skin span.mce_print {background-position:-440px -20px} -.o2k7Skin span.mce_cancel {background-position:-460px -20px} -.o2k7Skin span.mce_save {background-position:-480px -20px} -.o2k7Skin span.mce_replace {background-position:-500px -20px} -.o2k7Skin span.mce_search {background-position:-520px -20px} -.o2k7Skin span.mce_styleprops {background-position:-560px -20px} -.o2k7Skin span.mce_table {background-position:-580px -20px} -.o2k7Skin span.mce_cell_props {background-position:-600px -20px} -.o2k7Skin span.mce_delete_table {background-position:-620px -20px} -.o2k7Skin span.mce_delete_col {background-position:-640px -20px} -.o2k7Skin span.mce_delete_row {background-position:-660px -20px} -.o2k7Skin span.mce_col_after {background-position:-680px -20px} -.o2k7Skin span.mce_col_before {background-position:-700px -20px} -.o2k7Skin span.mce_row_after {background-position:-720px -20px} -.o2k7Skin span.mce_row_before {background-position:-740px -20px} -.o2k7Skin span.mce_merge_cells {background-position:-760px -20px} -.o2k7Skin span.mce_table_props {background-position:-980px -20px} -.o2k7Skin span.mce_row_props {background-position:-780px -20px} -.o2k7Skin span.mce_split_cells {background-position:-800px -20px} -.o2k7Skin span.mce_template {background-position:-820px -20px} -.o2k7Skin span.mce_visualchars {background-position:-840px -20px} -.o2k7Skin span.mce_abbr {background-position:-860px -20px} -.o2k7Skin span.mce_acronym {background-position:-880px -20px} -.o2k7Skin span.mce_attribs {background-position:-900px -20px} -.o2k7Skin span.mce_cite {background-position:-920px -20px} -.o2k7Skin span.mce_del {background-position:-940px -20px} -.o2k7Skin span.mce_ins {background-position:-960px -20px} -.o2k7Skin span.mce_pagebreak {background-position:0 -40px} -.o2k7Skin span.mce_restoredraft {background-position:-20px -40px} -.o2k7Skin span.mce_spellchecker {background-position:-540px -20px} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/ui_black.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/ui_black.css deleted file mode 100644 index 85812cde3fd6..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +++ /dev/null @@ -1,8 +0,0 @@ -/* Black */ -.o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)} -.o2k7SkinBlack td.mceToolbar, .o2k7SkinBlack td.mceStatusbar, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} -.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} -.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} -.o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} -.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} -.o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1} \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css deleted file mode 100644 index d64c361693f6..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +++ /dev/null @@ -1,5 +0,0 @@ -/* Silver */ -.o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} -.o2k7SkinSilver td.mceToolbar, .o2k7SkinSilver td.mceStatusbar, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} -.o2k7SkinSilver .mceListBox .mceText {background:#FFF} -.o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/source_editor.htm b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/source_editor.htm deleted file mode 100644 index d3f75d664279..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/source_editor.htm +++ /dev/null @@ -1,25 +0,0 @@ - - - {#advanced_dlg.code_title} - - - - -
-
- -
- -
- -
- - - -
- - -
-
- - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/editor_template.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/editor_template.js deleted file mode 100644 index 4b3209cc921b..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/editor_template.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack("simple");tinymce.create("tinymce.themes.SimpleTheme",{init:function(c,d){var e=this,b=["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList"],f=c.settings;e.editor=c;c.contentCSS.push(d+"/skins/"+f.skin+"/content.css");c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})})});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):"")||d+"/skins/"+f.skin+"/ui.css")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create("span",{id:d.id+"_container","class":"mceEditor "+d.settings.skin+"SimpleSkin"}),i);i=g=a.add(i,"table",{cellPadding:0,cellSpacing:0,"class":"mceLayout"});i=c=a.add(i,"tbody");i=a.add(c,"tr");i=b=a.add(a.add(i,"td"),"div",{"class":"mceIframeContainer"});i=a.add(a.add(c,"tr",{"class":"last"}),"td",{"class":"mceToolbar mceLast",align:"center"});c=e.toolbar=f.createToolbar("tools1");c.add(f.createButton("bold",{title:"simple.bold_desc",cmd:"Bold"}));c.add(f.createButton("italic",{title:"simple.italic_desc",cmd:"Italic"}));c.add(f.createButton("underline",{title:"simple.underline_desc",cmd:"Underline"}));c.add(f.createButton("strikethrough",{title:"simple.striketrough_desc",cmd:"Strikethrough"}));c.add(f.createSeparator());c.add(f.createButton("undo",{title:"simple.undo_desc",cmd:"Undo"}));c.add(f.createButton("redo",{title:"simple.redo_desc",cmd:"Redo"}));c.add(f.createSeparator());c.add(f.createButton("cleanup",{title:"simple.cleanup_desc",cmd:"mceCleanup"}));c.add(f.createSeparator());c.add(f.createButton("insertunorderedlist",{title:"simple.bullist_desc",cmd:"InsertUnorderedList"}));c.add(f.createButton("insertorderedlist",{title:"simple.numlist_desc",cmd:"InsertOrderedList"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+"_container",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:"Simple theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add("simple",tinymce.themes.SimpleTheme)})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/editor_template_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/editor_template_src.js deleted file mode 100644 index 35c19a6bc5db..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/editor_template_src.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * editor_template_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var DOM = tinymce.DOM; - - // Tell it to load theme specific language pack(s) - tinymce.ThemeManager.requireLangPack('simple'); - - tinymce.create('tinymce.themes.SimpleTheme', { - init : function(ed, url) { - var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings; - - t.editor = ed; - ed.contentCSS.push(url + "/skins/" + s.skin + "/content.css"); - - ed.onInit.add(function() { - ed.onNodeChange.add(function(ed, cm) { - tinymce.each(states, function(c) { - cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c)); - }); - }); - }); - - DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css"); - }, - - renderUI : function(o) { - var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc; - - n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n); - n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'}); - n = tb = DOM.add(n, 'tbody'); - - // Create iframe container - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'}); - - // Create toolbar container - n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'}); - - // Create toolbar - tb = t.toolbar = cf.createToolbar("tools1"); - tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'})); - tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'})); - tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'})); - tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'})); - tb.add(cf.createSeparator()); - tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'})); - tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'})); - tb.add(cf.createSeparator()); - tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'})); - tb.add(cf.createSeparator()); - tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'})); - tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'})); - tb.renderTo(n); - - return { - iframeContainer : ic, - editorContainer : ed.id + '_container', - sizeContainer : sc, - deltaHeight : -20 - }; - }, - - getInfo : function() { - return { - longname : 'Simple theme', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - version : tinymce.majorVersion + "." + tinymce.minorVersion - } - } - }); - - tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme); -})(); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/img/icons.png b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/img/icons.png deleted file mode 100644 index 5d505dbe38ee..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/img/icons.png and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/langs/en.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/langs/en.js deleted file mode 100644 index 088ed0fcbed5..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/langs/en.js +++ /dev/null @@ -1 +0,0 @@ -tinyMCE.addI18n('en.simple',{"cleanup_desc":"Cleanup Messy Code","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","striketrough_desc":"Strikethrough","underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)"}); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/skins/default/content.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/skins/default/content.css deleted file mode 100644 index 783b170f70ba..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/skins/default/content.css +++ /dev/null @@ -1,25 +0,0 @@ -body, td, pre { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 10px; -} - -body { - background-color: #FFFFFF; -} - -.mceVisualAid { - border: 1px dashed #BBBBBB; -} - -/* MSIE specific */ - -* html body { - scrollbar-3dlight-color: #F0F0EE; - scrollbar-arrow-color: #676662; - scrollbar-base-color: #F0F0EE; - scrollbar-darkshadow-color: #DDDDDD; - scrollbar-face-color: #E0E0DD; - scrollbar-highlight-color: #F0F0EE; - scrollbar-shadow-color: #F0F0EE; - scrollbar-track-color: #F5F5F5; -} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/skins/default/ui.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/skins/default/ui.css deleted file mode 100644 index ecf030d6e956..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/skins/default/ui.css +++ /dev/null @@ -1,32 +0,0 @@ -/* Reset */ -.defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} - -/* Containers */ -.defaultSimpleSkin {position:relative} -.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;} -.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;} -.defaultSimpleSkin .mceToolbar {height:24px;} - -/* Layout */ -.defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px} -.defaultSimpleSkin .mceIcon {background:url(../../img/icons.png) no-repeat 20px 20px} - -/* Button */ -.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px} -.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} -.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0} -.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} - -/* Separator */ -.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.png) -180px 0; width:2px; height:20px; margin:0 2px 0 4px} - -/* Theme */ -.defaultSimpleSkin span.mce_bold {background-position:0 0} -.defaultSimpleSkin span.mce_italic {background-position:-60px 0} -.defaultSimpleSkin span.mce_underline {background-position:-140px 0} -.defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0} -.defaultSimpleSkin span.mce_undo {background-position:-160px 0} -.defaultSimpleSkin span.mce_redo {background-position:-100px 0} -.defaultSimpleSkin span.mce_cleanup {background-position:-40px 0} -.defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} -.defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/skins/o2k7/content.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/skins/o2k7/content.css deleted file mode 100644 index e10558f9d4e1..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/skins/o2k7/content.css +++ /dev/null @@ -1,17 +0,0 @@ -body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} - -body {background: #FFF;} -.mceVisualAid {border: 1px dashed #BBB;} - -/* IE */ - -* html body { -scrollbar-3dlight-color: #F0F0EE; -scrollbar-arrow-color: #676662; -scrollbar-base-color: #F0F0EE; -scrollbar-darkshadow-color: #DDDDDD; -scrollbar-face-color: #E0E0DD; -scrollbar-highlight-color: #F0F0EE; -scrollbar-shadow-color: #F0F0EE; -scrollbar-track-color: #F5F5F5; -} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png deleted file mode 100644 index ba3cc34ebaaa..000000000000 Binary files a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png and /dev/null differ diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/skins/o2k7/ui.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/skins/o2k7/ui.css deleted file mode 100644 index 3ac07e2459c7..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/simple/skins/o2k7/ui.css +++ /dev/null @@ -1,35 +0,0 @@ -/* Reset */ -.o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} - -/* Containers */ -.o2k7SimpleSkin {position:relative} -.o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;} -.o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;} -.o2k7SimpleSkin .mceToolbar {height:26px;} - -/* Layout */ -.o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; } -.o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} -.o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px} -.o2k7SimpleSkin .mceIcon {background:url(../../img/icons.png) no-repeat 20px 20px} - -/* Button */ -.o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} -.o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px} -.o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} -.o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px} -.o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} - -/* Separator */ -.o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} - -/* Theme */ -.o2k7SimpleSkin span.mce_bold {background-position:0 0} -.o2k7SimpleSkin span.mce_italic {background-position:-60px 0} -.o2k7SimpleSkin span.mce_underline {background-position:-140px 0} -.o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0} -.o2k7SimpleSkin span.mce_undo {background-position:-160px 0} -.o2k7SimpleSkin span.mce_redo {background-position:-100px 0} -.o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0} -.o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} -.o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/ui.css b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/ui.css deleted file mode 100644 index 8d199aa8e91b..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/ui.css +++ /dev/null @@ -1,26 +0,0 @@ -.magento-placeholder { - display: inline-block; - margin: 0 5px; - background: #dff7ff; - outline: 2px solid #c0dffa; - padding: 2px 4px; - vertical-align: bottom; - height: 20px; -} - -.magento-placeholder-error { - display: inline-block; - margin: 0 5px; - background: #ffc0cb; - outline: 2px solid #FF0000; - padding: 2px 4px; - vertical-align: bottom; - height: 20px; -} - -.magento-placeholder-error img, -.magento-placeholder img { - vertical-align: middle; - max-height: 20px; - margin-right: 5px; -} diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce.js deleted file mode 100644 index 326fd67f7675..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce.js +++ /dev/null @@ -1 +0,0 @@ -(function(d){var a=/^\s*|\s*$/g,e,c="B".replace(/A(.)|B/,"$1")==="$1";var b={majorVersion:"3",minorVersion:"4.7",releaseDate:"2011-11-03",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=d.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isIE7=s.isIE&&/MSIE [7]/.test(g);s.isIE8=s.isIE&&/MSIE [8]/.test(g);s.isIE9=s.isIE&&/MSIE [9]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWebKit\/(\d*)/)[1]>=534;if(d.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m=c.length){for(e=0,b=g.length;e=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toUTCString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();(function(){function serialize(o,quote){var i,v,t;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){if(quote==='"'&&a==="'"){return a}i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&o instanceof Array){for(i=0,v="[";i0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(i in o){if(o.hasOwnProperty(i)){v+=typeof o[i]!="function"?(v.length>1?","+quote:quote)+i+quote+":"+serialize(o[i],quote):""}}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(a){a.VK={DELETE:46,BACKSPACE:8,ENTER:13,TAB:9,SPACEBAR:32,UP:38,DOWN:40}})(tinymce);(function(k){var i=k.VK,j=i.BACKSPACE,h=i.DELETE;function c(m){var o=m.dom,n=m.selection;m.onKeyDown.add(function(q,u){var p,v,s,t,r;r=u.keyCode==h;if(r||u.keyCode==j){u.preventDefault();p=n.getRng();v=o.getParent(p.startContainer,o.isBlock);if(r){v=o.getNext(v,o.isBlock)}if(v){s=v.firstChild;while(s&&s.nodeType==3&&s.nodeValue.length==0){s=s.nextSibling}if(s&&s.nodeName==="SPAN"){t=s.cloneNode(false)}}q.getDoc().execCommand(r?"ForwardDelete":"Delete",false,null);v=o.getParent(p.startContainer,o.isBlock);k.each(o.select("span.Apple-style-span,font.Apple-style-span",v),function(x){var y=n.getBookmark();if(t){o.replace(t.cloneNode(false),x,true)}else{o.remove(x,true)}n.moveToBookmark(y)})}})}function d(m){m.onKeyUp.add(function(n,p){var o=p.keyCode;if(o==h||o==j){if(n.dom.isEmpty(n.getBody())){n.setContent("",{format:"raw"});n.nodeChanged();return}}})}function b(m){m.dom.bind(m.getDoc(),"focusin",function(){m.selection.setRng(m.selection.getRng())})}function e(m){m.onKeyDown.add(function(n,q){if(q.keyCode===j){if(n.selection.isCollapsed()&&n.selection.getRng(true).startOffset===0){var p=n.selection.getNode();var o=p.previousSibling;if(o&&o.nodeName&&o.nodeName.toLowerCase()==="hr"){n.dom.remove(o);k.dom.Event.cancel(q)}}}})}function g(m){if(!Range.prototype.getClientRects){m.onMouseDown.add(function(o,p){if(p.target.nodeName==="HTML"){var n=o.getBody();n.blur();setTimeout(function(){n.focus()},0)}})}}function f(m){m.onClick.add(function(n,o){o=o.target;if(/^(IMG|HR)$/.test(o.nodeName)){n.selection.select(o)}if(o.nodeName=="A"&&n.dom.hasClass(o,"mceItemAnchor")){n.selection.select(o)}n.nodeChanged()})}function l(m){var o,n;m.dom.bind(m.getDoc(),"selectionchange",function(){if(n){clearTimeout(n);n=0}n=window.setTimeout(function(){var p=m.selection.getRng();if(!o||!k.dom.RangeUtils.compareRanges(p,o)){m.nodeChanged();o=p}},50)})}function a(m){document.body.setAttribute("role","application")}k.create("tinymce.util.Quirks",{Quirks:function(m){if(k.isWebKit){c(m);d(m);b(m);f(m);if(k.isIDevice){l(m)}}if(k.isIE){e(m);d(m);a(m)}if(k.isGecko){e(m);g(m)}}})})(tinymce);(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};g={'"':""","'":"'","<":"<",">":">","&":"&"};d={"<":"<",">":">","&":"&",""":'"',"'":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(r){var y={},p,n,v,q,u=d.url_converter,x=d.url_converter_scope||this;function o(C,F){var E,B,A,D;E=y[C+"-top"+F];if(!E){return}B=y[C+"-right"+F];if(E!=B){return}A=y[C+"-bottom"+F];if(B!=A){return}D=y[C+"-left"+F];if(A!=D){return}y[C+F]=D;delete y[C+"-top"+F];delete y[C+"-right"+F];delete y[C+"-bottom"+F];delete y[C+"-left"+F]}function t(B){var C=y[B],A;if(!C||C.indexOf(" ")<0){return}C=C.split(" ");A=C.length;while(A--){if(C[A]!==C[0]){return false}}y[B]=C[0];return true}function z(C,B,A,D){if(!t(B)){return}if(!t(A)){return}if(!t(D)){return}y[C]=y[B]+" "+y[A]+" "+y[D];delete y[B];delete y[A];delete y[D]}function s(A){q=true;return a[A]}function i(B,A){if(q){B=B.replace(/\uFEFF[0-9]/g,function(C){return a[C]})}if(!A){B=B.replace(/\\([\'\";:])/g,"$1")}return B}if(r){r=r.replace(/\\[\"\';:\uFEFF]/g,s).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(A){return A.replace(/[;:]/g,s)});while(p=b.exec(r)){n=p[1].replace(l,"").toLowerCase();v=p[2].replace(l,"");if(n&&v.length>0){if(n==="font-weight"&&v==="700"){v="bold"}else{if(n==="color"||n==="background-color"){v=v.toLowerCase()}}v=v.replace(k,c);v=v.replace(h,function(B,A,E,D,F,C){F=F||C;if(F){F=i(F);return"'"+F.replace(/\'/g,"\\'")+"'"}A=i(A||E||D);if(u){A=u.call(x,A,"style")}return"url('"+A.replace(/\'/g,"\\'")+"')"});y[n]=q?i(v,true):v}b.lastIndex=p.index+p[0].length}o("border","");o("border","-width");o("border","-color");o("border","-style");o("padding","");o("margin","");z("border","border-width","border-style","border-color");if(y.border==="medium none"){delete y.border}}return y},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(m){var h={},j,l,g,f,c={},b,e,d=m.makeMap,k=m.each;function i(o,n){return o.split(n||",")}function a(r,q){var o,p={};function n(s){return s.replace(/[A-Z]+/g,function(t){return n(r[t])})}for(o in r){if(r.hasOwnProperty(o)){r[o]=n(r[o])}}n(q).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(v,t,s,u){s=i(s,"|");p[t]={attributes:d(s),attributesOrder:s,children:d(u,"|",{"#comment":{}})}});return p}l="h1,h2,h3,h4,h5,h6,hr,p,div,address,pre,form,table,tbody,thead,tfoot,th,tr,td,li,ol,ul,caption,blockquote,center,dl,dt,dd,dir,fieldset,noscript,menu,isindex,samp,header,footer,article,section,hgroup";l=d(l,",",d(l.toUpperCase()));h=a({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]");j=d("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected,autoplay,loop,controls");g=d("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,source");f=m.extend(d("td,th,iframe,video,audio,object"),g);b=d("pre,script,style,textarea");e=d("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");m.html.Schema=function(r){var A=this,n={},o={},y=[],q,p;r=r||{};if(r.verify_html===false){r.valid_elements="*[*]"}if(r.valid_styles){q={};k(r.valid_styles,function(C,B){q[B]=m.explode(C)})}p=r.whitespace_elements?d(r.whitespace_elements):b;function z(B){return new RegExp("^"+B.replace(/([?+*])/g,".$1")+"$")}function t(I){var H,D,W,S,X,C,F,R,U,N,V,Z,L,G,T,B,P,E,Y,aa,M,Q,K=/^([#+-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,O=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,J=/[*?+]/;if(I){I=i(I);if(n["@"]){P=n["@"].attributes;E=n["@"].attributesOrder}for(H=0,D=I.length;H=0){for(T=z.length-1;T>=U;T--){S=z[T];if(S.valid){n.end(S.name)}}z.length=U}}l=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([^\\s\\/<>]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/)>))","g");C=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;J={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};L=e.getShortEndedElements();I=e.getSelfClosingElements();G=e.getBoolAttrs();u=c.validate;r=c.remove_internals;x=c.fix_self_closing;p=a.isIE;o=/^:/;while(g=l.exec(D)){if(F0&&z[z.length-1].name===H){t(H)}if(!u||(m=e.getElementRule(H))){k=true;if(u){O=m.attributes;E=m.attributePatterns}if(Q=g[8]){y=Q.indexOf("data-mce-type")!==-1;if(y&&r){k=false}M=[];M.map={};Q.replace(C,function(T,S,X,W,V){var Y,U;S=S.toLowerCase();X=S in G?S:j(X||W||V||"");if(u&&!y&&S.indexOf("data-")!==0){Y=O[S];if(!Y&&E){U=E.length;while(U--){Y=E[U];if(Y.pattern.test(S)){break}}if(U===-1){Y=null}}if(!Y){return}if(Y.validValues&&!(X in Y.validValues)){return}}M.map[S]=X;M.push({name:S,value:X})})}else{M=[];M.map={}}if(u&&!y){R=m.attributesRequired;K=m.attributesDefault;f=m.attributesForced;if(f){P=f.length;while(P--){s=f[P];q=s.name;h=s.value;if(h==="{$uid}"){h="mce_"+v++}M.map[q]=h;M.push({name:q,value:h})}}if(K){P=K.length;while(P--){s=K[P];q=s.name;if(!(q in M.map)){h=s.value;if(h==="{$uid}"){h="mce_"+v++}M.map[q]=h;M.push({name:q,value:h})}}}if(R){P=R.length;while(P--){if(R[P] in M.map){break}}if(P===-1){k=false}}if(M.map["data-mce-bogus"]){k=false}}if(k){n.start(H,M,N)}}else{k=false}if(A=J[H]){A.lastIndex=F=g.index+g[0].length;if(g=A.exec(D)){if(k){B=D.substr(F,g.index-F)}F=g.index+g[0].length}else{B=D.substr(F);F=D.length}if(k&&B.length>0){n.text(B,true)}if(k){n.end(H)}l.lastIndex=F;continue}if(!N){if(!Q||Q.indexOf("/")!=Q.length-1){z.push({name:H,valid:k})}else{if(k){n.end(H)}}}}else{if(H=g[1]){n.comment(H)}else{if(H=g[2]){n.cdata(H)}else{if(H=g[3]){n.doctype(H)}else{if(H=g[4]){n.pi(H,g[5])}}}}}}F=g.index+g[0].length}if(F=0;P--){H=z[P];if(H.valid){n.end(H.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h1){v.reverse();z=n=f.filterNode(v[0].clone());for(t=0;t0){N.value=l;N=N.prev}else{L=N.prev;N.remove();N=L}}}n=new b.html.SaxParser({validate:y,fix_self_closing:!y,cdata:function(l){A.append(I("#cdata",4)).value=l},text:function(M,l){var L;if(!s[A.name]){M=M.replace(k," ");if(A.lastChild&&o[A.lastChild.name]){M=M.replace(D,"")}}if(M.length!==0){L=I("#text",3);L.raw=!!l;A.append(L).value=M}},comment:function(l){A.append(I("#comment",8)).value=l},pi:function(l,L){A.append(I(l,7)).value=L;G(A)},doctype:function(L){var l;l=A.append(I("#doctype",10));l.value=L;G(A)},start:function(l,T,M){var R,O,N,L,P,U,S,Q;N=y?h.getElementRule(l):{};if(N){R=I(N.outputName||l,1);R.attributes=T;R.shortEnded=M;A.append(R);Q=p[A.name];if(Q&&p[R.name]&&!Q[R.name]){J.push(R)}O=d.length;while(O--){P=d[O].name;if(P in T.map){E=c[P];if(E){E.push(R)}else{c[P]=[R]}}}if(o[l]){G(R)}if(!M){A=R}}},end:function(l){var P,M,O,L,N;M=y?h.getElementRule(l):{};if(M){if(o[l]){if(!s[A.name]){for(P=A.firstChild;P&&P.type===3;){O=P.value.replace(D,"");if(O.length>0){P.value=O;P=P.next}else{L=P.next;P.remove();P=L}}for(P=A.lastChild;P&&P.type===3;){O=P.value.replace(t,"");if(O.length>0){P.value=O;P=P.prev}else{L=P.prev;P.remove();P=L}}}P=A.prev;if(P&&P.type===3){O=P.value.replace(D,"");if(O.length>0){P.value=O}else{P.remove()}}}if(M.removeEmpty||M.paddEmpty){if(A.isEmpty(u)){if(M.paddEmpty){A.empty().append(new a("#text","3")).value="\u00a0"}else{if(!A.attributes.map.name){N=A.parent;A.empty().remove();A=N;return}}}}A=A.parent}}},h);H=A=new a(m.context||g.root_name,11);n.parse(v);if(y&&J.length){if(!m.context){j(J)}else{m.invalid=true}}if(q&&H.name=="body"){F()}if(!m.invalid){for(K in i){E=e[K];z=i[K];x=z.length;while(x--){if(!z[x].parent){z.splice(x,1)}}for(C=0,B=E.length;C0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("")},comment:function(h){c.push("")},pi:function(h,i){if(i){c.push("")}else{c.push("")}if(a){c.push("\n")}},doctype:function(h){c.push("",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n=8;l.boxModel=!h.isIE||o.compatMode=="CSS1Compat"||l.stdMode;l.hasOuterHTML="outerHTML" in o.createElement("a");l.settings=m=h.extend({keep_values:false,hex_colors:1},m);l.schema=m.schema;l.styles=new h.html.Styles({url_converter:m.url_converter,url_converter_scope:m.url_converter_scope},m.schema);if(h.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(n){l.cssFlicker=true}}if(b&&m.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(p){o.createElement(p)});for(k in m.schema.getCustomElements()){o.createElement(k)}}h.addUnload(l.destroy,l)},getRoot:function(){var j=this,k=j.settings;return(k&&j.get(k.root_element))||j.doc.body},getViewPort:function(k){var l,j;k=!k?this.win:k;l=k.document;j=this.boxModel?l.documentElement:l.body;return{x:k.pageXOffset||j.scrollLeft,y:k.pageYOffset||j.scrollTop,w:k.innerWidth||j.clientWidth,h:k.innerHeight||j.clientHeight}},getRect:function(m){var l,j=this,k;m=j.get(m);l=j.getPos(m);k=j.getSize(m);return{x:l.x,y:l.y,w:k.w,h:k.h}},getSize:function(m){var k=this,j,l;m=k.get(m);j=k.getStyle(m,"width");l=k.getStyle(m,"height");if(j.indexOf("px")===-1){j=0}if(l.indexOf("px")===-1){l=0}return{w:parseInt(j)||m.offsetWidth||m.clientWidth,h:parseInt(l)||m.offsetHeight||m.clientHeight}},getParent:function(l,k,j){return this.getParents(l,k,j,false)},getParents:function(u,p,l,s){var k=this,j,m=k.settings,q=[];u=k.get(u);s=s===undefined;if(m.strict_root){l=l||k.getRoot()}if(e(p,"string")){j=p;if(p==="*"){p=function(o){return o.nodeType==1}}else{p=function(o){return k.is(o,j)}}}while(u){if(u==l||!u.nodeType||u.nodeType===9){break}if(!p||p(u)){if(s){q.push(u)}else{return u}}u=u.parentNode}return s?q:null},get:function(j){var k;if(j&&this.doc&&typeof(j)=="string"){k=j;j=this.doc.getElementById(j);if(j&&j.id!==k){return this.doc.getElementsByName(k)[1]}}return j},getNext:function(k,j){return this._findSib(k,j,"nextSibling")},getPrev:function(k,j){return this._findSib(k,j,"previousSibling")},select:function(l,k){var j=this;return h.dom.Sizzle(l,j.get(k)||j.get(j.settings.root_element)||j.doc,[])},is:function(l,j){var k;if(l.length===undefined){if(j==="*"){return l.nodeType==1}if(a.test(j)){j=j.toLowerCase().split(/,/);l=l.nodeName.toLowerCase();for(k=j.length-1;k>=0;k--){if(j[k]==l){return true}}return false}}return h.dom.Sizzle.matches(j,l.nodeType?[l]:l).length>0},add:function(m,q,j,l,o){var k=this;return this.run(m,function(s){var r,n;r=e(q,"string")?k.doc.createElement(q):q;k.setAttribs(r,j);if(l){if(l.nodeType){r.appendChild(l)}else{k.setHTML(r,l)}}return !o?s.appendChild(r):r})},create:function(l,j,k){return this.add(this.doc.createElement(l),l,j,k,1)},createHTML:function(r,j,p){var q="",m=this,l;q+="<"+r;for(l in j){if(j.hasOwnProperty(l)){q+=" "+l+'="'+m.encode(j[l])+'"'}}if(typeof(p)!="undefined"){return q+">"+p+""}return q+" />"},remove:function(j,k){return this.run(j,function(m){var n,l=m.parentNode;if(!l){return null}if(k){while(n=m.firstChild){if(!h.isIE||n.nodeType!==3||n.nodeValue){l.insertBefore(n,m)}else{m.removeChild(n)}}}return l.removeChild(m)})},setStyle:function(m,j,k){var l=this;return l.run(m,function(p){var o,n;o=p.style;j=j.replace(/-(\D)/g,function(r,q){return q.toUpperCase()});if(l.pixelStyles.test(j)&&(h.is(k,"number")||/^[\-0-9\.]+$/.test(k))){k+="px"}switch(j){case"opacity":if(b){o.filter=k===""?"":"alpha(opacity="+(k*100)+")";if(!m.currentStyle||!m.currentStyle.hasLayout){o.display="inline-block"}}o[j]=o["-moz-opacity"]=o["-khtml-opacity"]=k||"";break;case"float":b?o.styleFloat=k:o.cssFloat=k;break;default:o[j]=k||""}if(l.settings.update_styles){l.setAttrib(p,"data-mce-style")}})},getStyle:function(m,j,l){m=this.get(m);if(!m){return}if(this.doc.defaultView&&l){j=j.replace(/[A-Z]/g,function(n){return"-"+n});try{return this.doc.defaultView.getComputedStyle(m,null).getPropertyValue(j)}catch(k){return null}}j=j.replace(/-(\D)/g,function(o,n){return n.toUpperCase()});if(j=="float"){j=b?"styleFloat":"cssFloat"}if(m.currentStyle&&l){return m.currentStyle[j]}return m.style?m.style[j]:undefined},setStyles:function(m,n){var k=this,l=k.settings,j;j=l.update_styles;l.update_styles=0;f(n,function(o,p){k.setStyle(m,p,o)});l.update_styles=j;if(l.update_styles){k.setAttrib(m,l.cssText)}},removeAllAttribs:function(j){return this.run(j,function(m){var l,k=m.attributes;for(l=k.length-1;l>=0;l--){m.removeAttributeNode(k.item(l))}})},setAttrib:function(l,m,j){var k=this;if(!l||!m){return}if(k.settings.strict){m=m.toLowerCase()}return this.run(l,function(o){var n=k.settings;if(j!==null){switch(m){case"style":if(!e(j,"string")){f(j,function(p,q){k.setStyle(o,q,p)});return}if(n.keep_values){if(j&&!k._isRes(j)){o.setAttribute("data-mce-style",j,2)}else{o.removeAttribute("data-mce-style",2)}}o.style.cssText=j;break;case"class":o.className=j||"";break;case"src":case"href":if(n.keep_values){if(n.url_converter){j=n.url_converter.call(n.url_converter_scope||k,j,m,o)}k.setAttrib(o,"data-mce-"+m,j,2)}break;case"shape":o.setAttribute("data-mce-style",j);break}}if(e(j)&&j!==null&&j.length!==0){o.setAttribute(m,""+j,2)}else{o.removeAttribute(m,2)}})},setAttribs:function(k,l){var j=this;return this.run(k,function(m){f(l,function(o,p){j.setAttrib(m,p,o)})})},getAttrib:function(o,p,l){var j,k=this,m;o=k.get(o);if(!o||o.nodeType!==1){return l===m?false:l}if(!e(l)){l=""}if(/^(src|href|style|coords|shape)$/.test(p)){j=o.getAttribute("data-mce-"+p);if(j){return j}}if(b&&k.props[p]){j=o[k.props[p]];j=j&&j.nodeValue?j.nodeValue:j}if(!j){j=o.getAttribute(p,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(p)){if(o[k.props[p]]===true&&j===""){return p}return j?p:""}if(o.nodeName==="FORM"&&o.getAttributeNode(p)){return o.getAttributeNode(p).nodeValue}if(p==="style"){j=j||o.style.cssText;if(j){j=k.serializeStyle(k.parseStyle(j),o.nodeName);if(k.settings.keep_values&&!k._isRes(j)){o.setAttribute("data-mce-style",j)}}}if(d&&p==="class"&&j){j=j.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(p){case"rowspan":case"colspan":if(j===1){j=""}break;case"size":if(j==="+0"||j===20||j===0){j=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(j===0){j=""}break;case"hspace":if(j===-1){j=""}break;case"maxlength":case"tabindex":if(j===32768||j===2147483647||j==="32768"){j=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(j===65535){return p}return l;case"shape":j=j.toLowerCase();break;default:if(p.indexOf("on")===0&&j){j=h._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+j)}}}return(j!==m&&j!==null&&j!=="")?""+j:l},getPos:function(s,m){var k=this,j=0,q=0,o,p=k.doc,l;s=k.get(s);m=m||p.body;if(s){if(s.getBoundingClientRect){s=s.getBoundingClientRect();o=k.boxModel?p.documentElement:p.body;j=s.left+(p.documentElement.scrollLeft||p.body.scrollLeft)-o.clientTop;q=s.top+(p.documentElement.scrollTop||p.body.scrollTop)-o.clientLeft;return{x:j,y:q}}l=s;while(l&&l!=m&&l.nodeType){j+=l.offsetLeft||0;q+=l.offsetTop||0;l=l.offsetParent}l=s.parentNode;while(l&&l!=m&&l.nodeType){j-=l.scrollLeft||0;q-=l.scrollTop||0;l=l.parentNode}}return{x:j,y:q}},parseStyle:function(j){return this.styles.parse(j)},serializeStyle:function(k,j){return this.styles.serialize(k,j)},loadCSS:function(j){var l=this,m=l.doc,k;if(!j){j=""}k=l.select("head")[0];f(j.split(","),function(n){var o;if(l.files[n]){return}l.files[n]=true;o=l.create("link",{rel:"stylesheet",href:h._addVer(n)});if(b&&m.documentMode&&m.recalc){o.onload=function(){if(m.recalc){m.recalc()}o.onload=null}}k.appendChild(o)})},addClass:function(j,k){return this.run(j,function(l){var m;if(!k){return 0}if(this.hasClass(l,k)){return l.className}m=this.removeClass(l,k);return l.className=(m!=""?(m+" "):"")+k})},removeClass:function(l,m){var j=this,k;return j.run(l,function(o){var n;if(j.hasClass(o,m)){if(!k){k=new RegExp("(^|\\s+)"+m+"(\\s+|$)","g")}n=o.className.replace(k," ");n=h.trim(n!=" "?n:"");o.className=n;if(!n){o.removeAttribute("class");o.removeAttribute("className")}return n}return o.className})},hasClass:function(k,j){k=this.get(k);if(!k||!j){return false}return(" "+k.className+" ").indexOf(" "+j+" ")!==-1},show:function(j){return this.setStyle(j,"display","block")},hide:function(j){return this.setStyle(j,"display","none")},isHidden:function(j){j=this.get(j);return !j||j.style.display=="none"||this.getStyle(j,"display")=="none"},uniqueId:function(j){return(!j?"mce_":j)+(this.counter++)},setHTML:function(l,k){var j=this;return j.run(l,function(n){if(b){while(n.firstChild){n.removeChild(n.firstChild)}try{n.innerHTML="
"+k;n.removeChild(n.firstChild)}catch(m){n=j.create("div");n.innerHTML="
"+k;f(n.childNodes,function(p,o){if(o){n.appendChild(p)}})}}else{n.innerHTML=k}return k})},getOuterHTML:function(l){var k,j=this;l=j.get(l);if(!l){return null}if(l.nodeType===1&&j.hasOuterHTML){return l.outerHTML}k=(l.ownerDocument||j.doc).createElement("body");k.appendChild(l.cloneNode(true));return k.innerHTML},setOuterHTML:function(m,k,n){var j=this;function l(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){j.insertAfter(s.cloneNode(true),p);s=s.previousSibling}j.remove(p)}return this.run(m,function(p){p=j.get(p);if(p.nodeType==1){n=n||p.ownerDocument||j.doc;if(b){try{if(b&&p.nodeType==1){p.outerHTML=k}else{l(p,k,n)}}catch(o){l(p,k,n)}}else{l(p,k,n)}}})},decode:c.decode,encode:c.encodeAllRaw,insertAfter:function(j,k){k=this.get(k);return this.run(j,function(m){var l,n;l=k.parentNode;n=k.nextSibling;if(n){l.insertBefore(m,n)}else{l.appendChild(m)}return m})},isBlock:function(k){var j=k.nodeType;if(j){return !!(j===1&&g[k.nodeName])}return !!g[k]},replace:function(p,m,j){var l=this;if(e(m,"array")){p=p.cloneNode(true)}return l.run(m,function(k){if(j){f(h.grep(k.childNodes),function(n){p.appendChild(n)})}return k.parentNode.replaceChild(p,k)})},rename:function(m,j){var l=this,k;if(m.nodeName!=j.toUpperCase()){k=l.create(j);f(l.getAttribs(m),function(n){l.setAttrib(k,n.nodeName,l.getAttrib(m,n.nodeName))});l.replace(k,m,1)}return k||m},findCommonAncestor:function(l,j){var m=l,k;while(m){k=j;while(k&&m!=k){k=k.parentNode}if(m==k){break}m=m.parentNode}if(!m&&l.ownerDocument){return l.ownerDocument.documentElement}return m},toHex:function(j){var l=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(j);function k(m){m=parseInt(m).toString(16);return m.length>1?m:"0"+m}if(l){j="#"+k(l[1])+k(l[2])+k(l[3]);return j}return j},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(r){f(r.imports,function(s){q(s)});f(r.cssRules||r.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){f(s.selectorText.split(","),function(t){t=t.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(t)||!/\.[\w\-]+$/.test(t)){return}l=t;t=h._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",t);if(p&&!(t=p(t,l))){return}if(!o[t]){j.push({"class":t});o[t]=1}})}break;case 3:q(s.styleSheet);break}})}try{f(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(m,l,k){var j=this,n;if(j.doc&&typeof(m)==="string"){m=j.get(m)}if(!m){return false}k=k||this;if(!m.nodeType&&(m.length||m.length===0)){n=[];f(m,function(p,o){if(p){if(typeof(p)=="string"){p=j.doc.getElementById(p)}n.push(l.call(k,p,o))}});return n}return l.call(k,m)},getAttribs:function(k){var j;k=this.get(k);if(!k){return[]}if(b){j=[];if(k.nodeName=="OBJECT"){return k.attributes}if(k.nodeName==="OPTION"&&this.getAttrib(k,"selected")){j.push({specified:1,nodeName:"selected"})}k.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(l){j.push({specified:1,nodeName:l})});return j}return k.attributes},isEmpty:function(m,k){var r=this,o,n,q,j,l,p;m=m.firstChild;if(m){j=new h.dom.TreeWalker(m);k=k||r.schema?r.schema.getNonEmptyElements():null;do{q=m.nodeType;if(q===1){if(m.getAttribute("data-mce-bogus")){continue}l=m.nodeName.toLowerCase();if(k&&k[l]){p=m.parentNode;if(l==="br"&&r.isBlock(p)&&p.firstChild===m&&p.lastChild===m){continue}return false}n=r.getAttribs(m);o=m.attributes.length;while(o--){l=m.attributes[o].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if((q===3&&!i.test(m.nodeValue))){return false}}while(m=j.next())}return true},destroy:function(k){var j=this;if(j.events){j.events.destroy()}j.win=j.doc=j.root=j.events=null;if(!k){h.removeUnload(j.destroy)}},createRng:function(){var j=this.doc;return j.createRange?j.createRange():new h.dom.Range(this)},nodeIndex:function(n,o){var j=0,l,m,k;if(n){for(l=n.nodeType,n=n.previousSibling,m=n;n;n=n.previousSibling){k=n.nodeType;if(o&&k==3){if(k==l||!n.nodeValue.length){continue}}j++;l=k}}return j},split:function(n,m,q){var s=this,j=s.createRng(),o,l,p;function k(v){var t,r=v.childNodes,u=v.nodeType;if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=r.length-1;t>=0;t--){k(r[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){if(!s.isBlock(v.parentNode)||h.trim(v.nodeValue).length>0){return}}else{if(u==1){r=v.childNodes;if(r.length==1&&r[0]&&r[0].nodeType==1&&r[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(r[0],v)}if(r.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}s.remove(v)}return v}if(n&&m){j.setStart(n.parentNode,s.nodeIndex(n));j.setEnd(m.parentNode,s.nodeIndex(m));o=j.extractContents();j=s.createRng();j.setStart(m.parentNode,s.nodeIndex(m)+1);j.setEnd(n.parentNode,s.nodeIndex(n)+1);l=j.extractContents();p=n.parentNode;p.insertBefore(k(o),n);if(q){p.replaceChild(q,m)}else{p.insertBefore(m,n)}p.insertBefore(k(l),n);s.remove(n);return q||m}},bind:function(n,j,m,l){var k=this;if(!k.events){k.events=new h.dom.EventUtils()}return k.events.add(n,j,m,l||this)},unbind:function(m,j,l){var k=this;if(!k.events){k.events=new h.dom.EventUtils()}return k.events.remove(m,j,l)},_findSib:function(m,j,k){var l=this,n=j;if(m){if(e(n,"string")){n=function(o){return l.is(o,j)}}for(m=m[k];m;m=m[k]){if(n(m)){return m}}}return null},_isRes:function(j){return/^(top|left|bottom|right|width|height)/i.test(j)||/;\s*(top|left|bottom|right|width|height)/i.test(j)}});h.DOM=new h.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var N=this,e=c.doc,S=0,E=1,j=2,D=true,R=false,U="startOffset",h="startContainer",P="endContainer",z="endOffset",k=tinymce.extend,n=c.nodeIndex;k(N,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:D,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:I,setEndBefore:J,setEndAfter:u,collapse:A,selectNode:x,selectNodeContents:F,compareBoundaryPoints:v,deleteContents:p,extractContents:H,cloneContents:d,insertNode:C,surroundContents:M,cloneRange:K});function q(V,t){B(D,V,t)}function s(V,t){B(R,V,t)}function g(t){q(t.parentNode,n(t))}function I(t){q(t.parentNode,n(t)+1)}function J(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function A(t){if(t){N[P]=N[h];N[z]=N[U]}else{N[h]=N[P];N[U]=N[z]}N.collapsed=D}function x(t){g(t);u(t)}function F(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(Y,t){var ab=N[h],W=N[U],aa=N[P],V=N[z],Z=t.startContainer,ad=t.startOffset,X=t.endContainer,ac=t.endOffset;if(Y===0){return G(ab,W,Z,ad)}if(Y===1){return G(aa,V,Z,ad)}if(Y===2){return G(aa,V,X,ac)}if(Y===3){return G(ab,W,X,ac)}}function p(){m(j)}function H(){return m(S)}function d(){return m(E)}function C(Y){var V=this[h],t=this[U],X,W;if((V.nodeType===3||V.nodeType===4)&&V.nodeValue){if(!t){V.parentNode.insertBefore(Y,V)}else{if(t>=V.nodeValue.length){c.insertAfter(Y,V)}else{X=V.splitText(t);V.parentNode.insertBefore(Y,X)}}}else{if(V.childNodes.length>0){W=V.childNodes[t]}if(W){V.insertBefore(Y,W)}else{V.appendChild(Y)}}}function M(V){var t=N.extractContents();N.insertNode(V);V.appendChild(t);N.selectNode(V)}function K(){return k(new b(c),{startContainer:N[h],startOffset:N[U],endContainer:N[P],endOffset:N[z],collapsed:N.collapsed,commonAncestorContainer:N.commonAncestorContainer})}function O(t,V){var W;if(t.nodeType==3){return t}if(V<0){return t}W=t.firstChild;while(W&&V>0){--V;W=W.nextSibling}if(W){return W}return t}function l(){return(N[h]==N[P]&&N[U]==N[z])}function G(X,Z,V,Y){var aa,W,t,ab,ad,ac;if(X==V){if(Z==Y){return 0}if(Z0){N.collapse(V)}}else{N.collapse(V)}N.collapsed=l();N.commonAncestorContainer=c.findCommonAncestor(N[h],N[P])}function m(ab){var aa,X=0,ad=0,V,Z,W,Y,t,ac;if(N[h]==N[P]){return f(ab)}for(aa=N[P],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[h]){return r(aa,ab)}++X}for(aa=N[h],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[P]){return T(aa,ab)}++ad}Z=ad-X;W=N[h];while(Z>0){W=W.parentNode;Z--}Y=N[P];while(Z<0){Y=Y.parentNode;Z++}for(t=W.parentNode,ac=Y.parentNode;t!=ac;t=t.parentNode,ac=ac.parentNode){W=t;Y=ac}return o(W,Y,ab)}function f(Z){var ab,Y,X,aa,t,W,V;if(Z!=j){ab=e.createDocumentFragment()}if(N[U]==N[z]){return ab}if(N[h].nodeType==3){Y=N[h].nodeValue;X=Y.substring(N[U],N[z]);if(Z!=E){N[h].deleteData(N[U],N[z]-N[U]);N.collapse(D)}if(Z==j){return}ab.appendChild(e.createTextNode(X));return ab}aa=O(N[h],N[U]);t=N[z]-N[U];while(t>0){W=aa.nextSibling;V=y(aa,Z);if(ab){ab.appendChild(V)}--t;aa=W}if(Z!=E){N.collapse(D)}return ab}function r(ab,Y){var aa,Z,V,t,X,W;if(Y!=j){aa=e.createDocumentFragment()}Z=i(ab,Y);if(aa){aa.appendChild(Z)}V=n(ab);t=V-N[U];if(t<=0){if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}Z=ab.previousSibling;while(t>0){X=Z.previousSibling;W=y(Z,Y);if(aa){aa.insertBefore(W,aa.firstChild)}--t;Z=X}if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}function T(Z,Y){var ab,V,aa,t,X,W;if(Y!=j){ab=e.createDocumentFragment()}aa=Q(Z,Y);if(ab){ab.appendChild(aa)}V=n(Z);++V;t=N[z]-V;aa=Z.nextSibling;while(t>0){X=aa.nextSibling;W=y(aa,Y);if(ab){ab.appendChild(W)}--t;aa=X}if(Y!=E){N.setStartAfter(Z);N.collapse(D)}return ab}function o(Z,t,ac){var W,ae,Y,aa,ab,V,ad,X;if(ac!=j){ae=e.createDocumentFragment()}W=Q(Z,ac);if(ae){ae.appendChild(W)}Y=Z.parentNode;aa=n(Z);ab=n(t);++aa;V=ab-aa;ad=Z.nextSibling;while(V>0){X=ad.nextSibling;W=y(ad,ac);if(ae){ae.appendChild(W)}ad=X;--V}W=i(t,ac);if(ae){ae.appendChild(W)}if(ac!=E){N.setStartAfter(Z);N.collapse(D)}return ae}function i(aa,ab){var W=O(N[P],N[z]-1),ac,Z,Y,t,V,X=W!=N[P];if(W==aa){return L(W,X,R,ab)}ac=W.parentNode;Z=L(ac,R,R,ab);while(ac){while(W){Y=W.previousSibling;t=L(W,X,R,ab);if(ab!=j){Z.insertBefore(t,Z.firstChild)}X=D;W=Y}if(ac==aa){return Z}W=ac.previousSibling;ac=ac.parentNode;V=L(ac,R,R,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function Q(aa,ab){var X=O(N[h],N[U]),Y=X!=N[h],ac,Z,W,t,V;if(X==aa){return L(X,Y,D,ab)}ac=X.parentNode;Z=L(ac,R,D,ab);while(ac){while(X){W=X.nextSibling;t=L(X,Y,D,ab);if(ab!=j){Z.appendChild(t)}Y=D;X=W}if(ac==aa){return Z}X=ac.nextSibling;ac=ac.parentNode;V=L(ac,R,D,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function L(t,Y,ab,ac){var X,W,Z,V,aa;if(Y){return y(t,ac)}if(t.nodeType==3){X=t.nodeValue;if(ab){V=N[U];W=X.substring(V);Z=X.substring(0,V)}else{V=N[z];W=X.substring(0,V);Z=X.substring(V)}if(ac!=E){t.nodeValue=Z}if(ac==j){return}aa=t.cloneNode(R);aa.nodeValue=W;return aa}if(ac==j){return}return t.cloneNode(R)}function y(V,t){if(t!=j){return t==E?V.cloneNode(D):V}V.parentNode.removeChild(V)}}a.Range=b})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p<0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}k.setEndPoint(j?"EndToStart":"EndToEnd",i);if(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)>0){k=i.duplicate();k.collapse(j);o=-1;while(s==k.parentElement()){if(k.move("character",-1)==0){break}o++}}o=o||k.text.replace("\r\n"," ").length}else{k.collapse(true);k.setEndPoint(j?"StartToStart":"StartToEnd",i);o=k.text.replace("\r\n"," ").length}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.firstChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var u,t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p&&t.nodeType!==9){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndPoint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,s,q,r=d.dom.doc,m=r.body;function j(z){var u,y,t,x,v;t=h.create("a");u=z?k:s;y=z?p:q;x=n.duplicate();if(u==r||u==r.documentElement){u=m;y=0}if(u.nodeType==3){u.parentNode.insertBefore(t,u);x.moveToElementText(t);x.moveStart("character",y);h.remove(t);n.setEndPoint(z?"StartToStart":"EndToEnd",x)}else{v=u.childNodes;if(v.length){if(y>=v.length){h.insertAfter(t,v[v.length-1])}else{u.insertBefore(t,v[y])}x.moveToElementText(t)}else{t=r.createTextNode("\uFEFF");u.appendChild(t);x.moveToElementText(t.parentNode);x.collapse(c)}n.setEndPoint(z?"StartToStart":"EndToEnd",x);h.remove(t)}}k=i.startContainer;p=i.startOffset;s=i.endContainer;q=i.endOffset;n=m.createTextRange();if(k==s&&k.nodeType==1&&p==q-1){if(p==q-1){try{l=m.createControlRange();l.addElement(k.childNodes[p]);l.select();return}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,j=0,d=Object.prototype.toString,o=false,i=true;[0,0].sort(function(){i=false;return 0});var b=function(v,e,z,A){z=z||[];e=e||document;var C=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!v||typeof v!=="string"){return z}var x=[],s,E,H,r,u=true,t=b.isXML(e),B=v,D,G,F,y;do{p.exec("");s=p.exec(B);if(s){B=s[3];x.push(s[1]);if(s[2]){r=s[3];break}}}while(s);if(x.length>1&&k.exec(v)){if(x.length===2&&f.relative[x[0]]){E=h(x[0]+x[1],e)}else{E=f.relative[x[0]]?[e]:b(x.shift(),e);while(x.length){v=x.shift();if(f.relative[v]){v+=x.shift()}E=h(v,E)}}}else{if(!A&&x.length>1&&e.nodeType===9&&!t&&f.match.ID.test(x[0])&&!f.match.ID.test(x[x.length-1])){D=b.find(x.shift(),e,t);e=D.expr?b.filter(D.expr,D.set)[0]:D.set[0]}if(e){D=A?{expr:x.pop(),set:a(A)}:b.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&e.parentNode?e.parentNode:e,t);E=D.expr?b.filter(D.expr,D.set):D.set;if(x.length>0){H=a(E)}else{u=false}while(x.length){G=x.pop();F=G;if(!f.relative[G]){G=""}else{F=x.pop()}if(F==null){F=e}f.relative[G](H,F,t)}}else{H=x=[]}}if(!H){H=E}if(!H){b.error(G||v)}if(d.call(H)==="[object Array]"){if(!u){z.push.apply(z,H)}else{if(e&&e.nodeType===1){for(y=0;H[y]!=null;y++){if(H[y]&&(H[y]===true||H[y].nodeType===1&&b.contains(e,H[y]))){z.push(E[y])}}}else{for(y=0;H[y]!=null;y++){if(H[y]&&H[y].nodeType===1){z.push(E[y])}}}}}else{a(H,z)}if(r){b(r,C,z,A);b.uniqueSort(z)}return z};b.uniqueSort=function(r){if(c){o=i;r.sort(c);if(o){for(var e=1;e":function(x,r){var u=typeof r==="string",v,s=0,e=x.length;if(u&&!/\W/.test(r)){r=r.toLowerCase();for(;s=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){return r[1].toLowerCase()},CHILD:function(e){if(e[1]==="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=j++;return e},ATTR:function(u,r,s,e,v,x){var t=u[1].replace(/\\/g,"");if(!x&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if((p.exec(u[3])||"").length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toLowerCase()==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return re[3]-0},nth:function(s,r,e){return e[3]-0===r},eq:function(s,r,e){return e[3]-0===r}},filter:{PSEUDO:function(s,y,x,z){var e=y[1],r=f.filters[e];if(r){return r(s,x,y,z)}else{if(e==="contains"){return(s.textContent||s.innerText||b.getText([s])||"").indexOf(y[3])>=0}else{if(e==="not"){var t=y[3];for(var v=0,u=t.length;v=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName.toLowerCase()===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),x=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?x===r:u==="*="?x.indexOf(r)>=0:u==="~="?(" "+x+" ").indexOf(r)>=0:!r?x&&e!==false:u==="!="?x!==r:u==="^="?x.indexOf(r)===0:u==="$="?x.substr(x.length-r.length)===r:u==="|="?x===r||x.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var k=f.match.POS,g=function(r,e){return"\\"+(e-0+1)};for(var m in f.match){f.match[m]=new RegExp(f.match[m].source+(/(?![^\[]*\])(?![^\(]*\))/.source));f.leftMatch[m]=new RegExp(/(^(?:.|\r|\n)*?)/.source+f.match[m].source.replace(/\\(\d+)/g,g))}var a=function(r,e){r=Array.prototype.slice.call(r,0);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(l){a=function(u,t){var r=t||[],s=0;if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var e=u.length;s";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(document.getElementById(s)){f.find.ID=function(u,v,x){if(typeof v.getElementById!=="undefined"&&!x){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r);e=r=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="

";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(x,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!b.isXML(v)){try{return a(v.querySelectorAll(x),t)}catch(y){}}return e(x,v,t,u)};for(var r in e){b[r]=e[r]}s=null})()}(function(){var e=document.createElement("div");e.innerHTML="
";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}};e=null})();function n(r,x,v,A,y,z){for(var t=0,s=A.length;t0){u=e;break}}}e=e[r]}A[t]=u}}}b.contains=document.compareDocumentPosition?function(r,e){return !!(r.compareDocumentPosition(e)&16)}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};b.isXML=function(e){var r=(e?e.ownerDocument||e:0).documentElement;return r?r.nodeName!=="HTML":false};var h=function(e,y){var t=[],u="",v,s=y.nodeType?[y]:y;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var x=0,r=s.length;x=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j"+(h.item?h.item(0).outerHTML:h.htmlText);l.removeChild(l.firstChild)}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(g,i){var n=this,f=n.getRng(),j,k=n.win.document,m,l;i=i||{format:"html"};i.set=true;g=i.content=g;if(!i.no_events){n.onBeforeSetContent.dispatch(n,i)}g=i.content;if(f.insertNode){g+='_';if(f.startContainer==k&&f.endContainer==k){k.body.innerHTML=g}else{f.deleteContents();if(k.body.childNodes.length==0){k.body.innerHTML=g}else{if(f.createContextualFragment){f.insertNode(f.createContextualFragment(g))}else{m=k.createDocumentFragment();l=k.createElement("div");m.appendChild(l);l.outerHTML=g;f.insertNode(m)}}}j=n.dom.get("__caret");f=k.createRange();f.setStartBefore(j);f.setEndBefore(j);n.setRng(f);n.dom.remove("__caret");try{n.setRng(f)}catch(h){}}else{if(f.item){k.execCommand("Delete",false,null);f=n.getRng()}if(/^\s+/.test(g)){f.pasteHTML('_'+g);n.dom.remove("__mce_tmp")}else{f.pasteHTML(g)}}if(!i.no_events){n.onSetContent.dispatch(n,i)}},getStart:function(){var g=this.getRng(),h,f,j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}j=g.duplicate();j.collapse(1);h=j.parentElement();f=i=g.parentElement();while(i=i.parentNode){if(i==h){h=f;break}}return h}else{h=g.startContainer;if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[Math.min(h.childNodes.length-1,g.startOffset)]}if(h&&h.nodeType==3){return h.parentNode}return h}},getEnd:function(){var g=this,h=g.getRng(),i,f;if(h.duplicate||h.item){if(h.item){return h.item(0)}h=h.duplicate();h.collapse(0);i=h.parentElement();if(i&&i.nodeName=="BODY"){return i.lastChild||i}return i}else{i=h.endContainer;f=h.endOffset;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[f>0?f-1:f]}if(i&&i.nodeType==3){return i.parentNode}return i}},getBookmark:function(r,s){var v=this,m=v.dom,g,j,i,n,h,o,p,l="\uFEFF",u;function f(x,y){var t=0;d(m.select(x),function(A,z){if(A==y){t=z}});return t}if(r==2){function k(){var x=v.getRng(true),t=m.getRoot(),y={};function z(C,H){var B=C[H?"startContainer":"endContainer"],G=C[H?"startOffset":"endOffset"],A=[],D,F,E=0;if(B.nodeType==3){if(s){for(D=B.previousSibling;D&&D.nodeType==3;D=D.previousSibling){G+=D.nodeValue.length}}A.push(G)}else{F=B.childNodes;if(G>=F.length&&F.length){E=1;G=Math.max(0,F.length-1)}A.push(v.dom.nodeIndex(F[G],s)+E)}for(;B&&B!=t;B=B.parentNode){A.push(v.dom.nodeIndex(B,s))}return A}y.start=z(x,true);if(!v.isCollapsed()){y.end=z(x)}return y}if(v.tridentSel){return v.tridentSel.getBookmark(r)}return k()}if(r){return{rng:v.getRng()}}g=v.getRng();i=m.uniqueId();n=tinyMCE.activeEditor.selection.isCollapsed();u="overflow:hidden;line-height:0px";if(g.duplicate||g.item){if(!g.item){j=g.duplicate();try{g.collapse();g.pasteHTML(''+l+"");if(!n){j.collapse(false);g.moveToElementText(j.parentElement());if(g.compareEndPoints("StartToEnd",j)==0){j.move("character",-1)}j.pasteHTML(''+l+"")}}catch(q){return null}}else{o=g.item(0);h=o.nodeName;return{name:h,index:f(h,o)}}}else{o=v.getNode();h=o.nodeName;if(h=="IMG"){return{name:h,index:f(h,o)}}j=g.cloneRange();if(!n){j.collapse(false);j.insertNode(m.create("span",{"data-mce-type":"bookmark",id:i+"_end",style:u},l))}g.collapse(true);g.insertNode(m.create("span",{"data-mce-type":"bookmark",id:i+"_start",style:u},l))}v.moveToBookmark({id:i,keep:1});return{id:i}},moveToBookmark:function(n){var r=this,l=r.dom,i,h,f,q,j,s,o,p;if(n){if(n.start){f=l.createRng();q=l.getRoot();function g(z){var t=n[z?"start":"end"],v,x,y,u;if(t){y=t[0];for(x=q,v=t.length-1;v>=1;v--){u=x.childNodes;if(t[v]>u.length-1){return}x=u[t[v]]}if(x.nodeType===3){y=Math.min(t[0],x.nodeValue.length)}if(x.nodeType===1){y=Math.min(t[0],x.childNodes.length)}if(z){f.setStart(x,y)}else{f.setEnd(x,y)}}return true}if(r.tridentSel){return r.tridentSel.moveToBookmark(n)}if(g(true)&&g()){r.setRng(f)}}else{if(n.id){function k(A){var u=l.get(n.id+"_"+A),z,t,x,y,v=n.keep;if(u){z=u.parentNode;if(A=="start"){if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}j=s=z;o=p=t}else{if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}s=z;p=t}if(!v){y=u.previousSibling;x=u.nextSibling;d(c.grep(u.childNodes),function(B){if(B.nodeType==3){B.nodeValue=B.nodeValue.replace(/\uFEFF/g,"")}});while(u=l.get(n.id+"_"+A)){l.remove(u,1)}if(y&&x&&y.nodeType==x.nodeType&&y.nodeType==3&&!c.isOpera){t=y.nodeValue.length;y.appendData(x.nodeValue);l.remove(x);if(A=="start"){j=s=y;o=p=t}else{s=y;p=t}}}}}function m(t){if(l.isBlock(t)&&!t.innerHTML){t.innerHTML=!a?'
':" "}return t}k("start");k("end");if(j){f=l.createRng();f.setStart(m(j),o);f.setEnd(m(s),p);r.setRng(f)}}else{if(n.name){r.select(l.select(n.name)[n.index])}else{if(n.rng){r.setRng(n.rng)}}}}}},select:function(k,j){var i=this,l=i.dom,g=l.createRng(),f;if(k){f=l.nodeIndex(k);g.setStart(k.parentNode,f);g.setEnd(k.parentNode,f+1);if(j){function h(m,o){var n=new c.dom.TreeWalker(m,m);do{if(m.nodeType==3&&c.trim(m.nodeValue).length!=0){if(o){g.setStart(m,0)}else{g.setEnd(m,m.nodeValue.length)}return}if(m.nodeName=="BR"){if(o){g.setStartBefore(m)}else{g.setEndBefore(m)}return}}while(m=(o?n.next():n.prev()))}h(k,1);h(k)}i.setRng(g)}return k},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}if(h.compareEndPoints){return h.compareEndPoints("StartToEnd",h)===0}return !g||h.collapsed},collapse:function(f){var h=this,g=h.getRng(),i;if(g.item){i=g.item(0);g=h.win.document.body.createTextRange();g.moveToElementText(i)}g.collapse(!!f);h.setRng(g)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(l){var g=this,h,i,k,j=g.win.document;if(l&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():j.createRange())}}catch(f){}if(c.isIE&&i&&i.setStart&&j.selection.createRange().item){k=j.selection.createRange().item(0);i=j.createRange();i.setStartBefore(k);i.setEndAfter(k)}if(!i){i=j.createRange?j.createRange():j.body.createTextRange()}if(g.selectedRange&&g.explicitRange){if(i.compareBoundaryPoints(i.START_TO_START,g.selectedRange)===0&&i.compareBoundaryPoints(i.END_TO_END,g.selectedRange)===0){i=g.explicitRange}else{g.selectedRange=null;g.explicitRange=null}}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){g.explicitRange=i;try{h.removeAllRanges()}catch(f){}h.addRange(i);g.selectedRange=h.getRangeAt(0)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var h=this,g=h.getRng(),i=h.getSel(),l,k=g.startContainer,f=g.endContainer;if(!g){return h.dom.getRoot()}if(g.setStart){l=g.commonAncestorContainer;if(!g.collapsed){if(g.startContainer==g.endContainer){if(g.endOffset-g.startOffset<2){if(g.startContainer.hasChildNodes()){l=g.startContainer.childNodes[g.startOffset]}}}if(k.nodeType===3&&f.nodeType===3){function j(p,m){var o=p;while(p&&p.nodeType===3&&p.length===0){p=m?p.nextSibling:p.previousSibling}return p||o}if(k.length===g.startOffset){k=j(k.nextSibling,true)}else{k=k.parentNode}if(g.endOffset===0){f=j(f.previousSibling,false)}else{f=f.parentNode}if(k&&k===f){return k}}}if(l&&l.nodeType==3){return l.parentNode}return l}return g.item?g.item(0):g.parentElement()},getSelectedBlocks:function(o,g){var m=this,j=m.dom,l,k,h,i=[];l=j.getParent(o||m.getStart(),j.isBlock);k=j.getParent(g||m.getEnd(),j.isBlock);if(l){i.push(l)}if(l&&k&&l!=k){h=l;var f=new c.dom.TreeWalker(l,j.getRoot());while((h=f.next())&&h!=k){if(j.isBlock(h)){i.push(h)}}}if(k&&l!=k){i.push(k)}return i},normalize:function(){var g=this,f,i;if(c.isIE){return}function h(p){var k,o,n,m=g.dom,j=m.getRoot(),l;k=f[(p?"start":"end")+"Container"];o=f[(p?"start":"end")+"Offset"];if(k.nodeType===9){k=k.body;o=0}if(k===j){if(k.hasChildNodes()){k=k.childNodes[Math.min(!p&&o>0?o-1:o,k.childNodes.length-1)];o=0;if(k.hasChildNodes()){l=k;n=new c.dom.TreeWalker(k,j);do{if(l.nodeType===3){o=p?0:l.nodeValue.length-1;k=l;break}if(l.nodeName==="BR"){o=m.nodeIndex(l);k=l.parentNode;break}}while(l=(p?n.next():n.prev()));i=true}}}if(i){f["set"+(p?"Start":"End")](k,o)}}f=g.getRng();h(true);if(f.collapsed){h()}if(i){g.setRng(f)}},destroy:function(g){var f=this;f.win=null;if(!g){c.removeUnload(f.destroy)}},_fixIESelection:function(){var g=this.dom,m=g.doc,h=m.body,j,n,f;m.documentElement.unselectable=true;function i(o,r){var p=h.createTextRange();try{p.moveToPoint(o,r)}catch(q){p=null}return p}function l(p){var o;if(p.button){o=i(p.x,p.y);if(o){if(o.compareEndPoints("StartToStart",n)>0){o.setEndPoint("StartToStart",n)}else{o.setEndPoint("EndToEnd",n)}o.select()}}else{k()}}function k(){var o=m.selection.createRange();if(n&&!o.item&&o.compareEndPoints("StartToEnd",o)===0){n.select()}g.unbind(m,"mouseup",k);g.unbind(m,"mousemove",l);n=j=0}g.bind(m,["mousedown","contextmenu"],function(o){if(o.target.nodeName==="HTML"){if(j){k()}f=m.documentElement;if(f.scrollHeight>f.clientHeight){return}j=1;n=i(o.x,o.y);if(n){g.bind(m,"mouseup",k);g.bind(m,"mousemove",l);g.win.focus();n.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}e.remove_trailing_brs=true;i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/\s*mce(Item\w+|Selected)\s*/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(\/\/\s*|\]\]>|-->|\]\]-->)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// "}}else{if(o.length>0){n.firstChild.value=""}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(m.getInner?o.innerHTML:a.trim(i.getOuterHTML(o),m),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF|\u200B/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],f={},d=[],g=0,e;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=q.create("script",{id:n,type:"text/javascript",src:a._addVer(m)});if(!a.isIE){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==e){j.push(m);l[m]=c}if(q){if(!f[m]){f[m]=[]}f[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(f[r],function(s){s.func.call(s.scope)});f[r]=e}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);tinymce.dom.TreeWalker=function(a,c){var b=a;function d(i,f,e,j){var h,g;if(i){if(!j&&i[f]){return i[f]}if(i!=c){h=i[e];if(h){return h}for(g=i.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","previousSibling",e))}};(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var i=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,g,o,h,r,q,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function f(u){var v;v=u[0];if(v.nodeType===3&&v===i&&l>=v.nodeValue.length){u.splice(0,1)}v=u[u.length-1];if(m===0&&u.length>0&&v===t&&v.nodeType===3){u.splice(u.length-1,1)}return u}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(h=x,r=h.parentNode;h&&h!=v;h=r){r=h.parentNode;q=p(h==x?h:h[u],u);if(q.length){if(!y){q.reverse()}s(f(q))}}}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}if(i==t){return s(f([i]))}j=c.findCommonAncestor(i,t);for(h=i;h;h=h.parentNode){if(h===t){return k(i,j,true)}if(h===j){break}}for(h=t;h;h=h.parentNode){if(h===i){return k(t,j)}if(h===j){break}}g=n(i,j)||i;o=n(t,j)||t;k(i,g,true);q=p(g==i?g:g.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(f(q))}k(t,o)};this.split=function(e){var h=e.startContainer,d=e.startOffset,i=e.endContainer,g=e.endOffset;function f(j,k){return j.splitText(k)}if(h==i&&h.nodeType==3){if(d>0&&dd){g=g-d;h=i=f(i,g).previousSibling;g=i.nodeValue.length;d=0}else{g=0}}}else{if(h.nodeType==3&&d>0&&d0&&g=l.length){q=0}}s=l[q];f.setAttrib(g,"tabindex","-1");f.setAttrib(s.id,"tabindex","0");f.get(s.id).focus();if(e.actOnFocus){e.onAction(s.id)}if(r){a.cancel(r)}};o=function(y){var u=37,t=39,x=38,z=40,q=27,s=14,r=13,v=32;switch(y.keyCode){case u:if(i){p.moveFocus(-1)}break;case t:if(i){p.moveFocus(1)}break;case x:if(n){p.moveFocus(-1)}break;case z:if(n){p.moveFocus(1)}break;case q:if(e.onCancel){e.onCancel();a.cancel(y)}break;case s:case r:case v:if(e.onAction){e.onAction(g);a.cancel(y)}break}};c(l,function(s,q){var r;if(!s.id){s.id=f.uniqueId("_mce_item_")}if(k){f.bind(s.id,"blur",h);r="-1"}else{r=(q===0?"0":"-1")}f.setAttrib(s.id,"tabindex",r);f.bind(f.get(s.id),"focus",j)});if(l[0]){g=l[0].id}f.setAttrib(m,"tabindex","-1");f.bind(f.get(m),"focus",d);f.bind(f.get(m),"keydown",o)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeightv){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.select("#menu_"+g.id)[0];h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+=''+a.encode(e.title)+''+c}else{d+=''+(c?''+c+"":"")}d+='";d+="";return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(i,h,f){var g=this;g.parent(i,h,f);g.items=[];g.onChange=new a(g);g.onPostRender=new a(g);g.onAdd=new a(g);g.onRenderMenu=new d.util.Dispatcher(this);g.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var h=this,i,j,g;if(f!=h.selectedIndex){i=c.get(h.id+"_text");g=c.get(h.id+"_voiceDesc");j=h.items[f];if(j){h.selectedValue=j.value;h.selectedIndex=f;c.setHTML(i,c.encode(j.title));c.setHTML(g,h.settings.title+" - "+j.title);c.removeClass(i,"mceTitle");c.setAttrib(h.id,"aria-valuenow",j.title)}else{c.setHTML(i,c.encode(h.settings.title));c.setHTML(g,c.encode(h.settings.title));c.addClass(i,"mceTitle");h.selectedValue=h.selectedIndex=null;c.setAttrib(h.id,"aria-valuenow",h.settings.title)}i=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='';i+="";i+="";i+="";return i},showMenu:function(){var g=this,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(j){if(j.value===g.selectedValue){f.items[j.id].setSelected(1);g.oldID=j.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(f.menu&&f.menu.isMenuVisible){c.removeClass(f.id,f.classPrefix+"Selected");if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(function(){g.hideMenu();g.focus()});f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){if(h.value===undefined){f.add({title:h.title,role:"option","class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}})}else{h.id=c.uniqueId();h.role="option";h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)}});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id,"keydown",function(h){if(h.keyCode==32){f.showMenu(h);b.cancel(h)}});b.add(f.id,"focus",function(){if(!f._focused){f.keyDownHandler=b.add(f.id,"keydown",function(h){if(h.keyCode==40){f.showMenu();b.cancel(h)}});f.keyPressHandler=b.add(f.id,"keypress",function(i){var h;if(i.keyCode==13){h=f.selectedValue;f.selectedValue=null;b.cancel(i);f.settings.onselect(h)}})}f._focused=1});b.add(f.id,"blur",function(){b.remove(f.id,"keydown",f.keyDownHandler);b.remove(f.id,"keypress",f.keyPressHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f;this.setAriaProperty("disabled",f)},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox","aria-labelledby":f.id+"_aria"},g);g+=c.createHTML("span",{id:f.id+"_aria",style:"display: none"},f.settings.title);return g},postRender:function(){var g=this,h,i=true;g.rendered=true;function f(k){var j=g.items[k.target.selectedIndex-1];if(j&&(j=j.value)){g.onChange.dispatch(g,j);if(g.settings.onselect){g.settings.onselect(j)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(k){var j;b.remove(g.id,"change",h);i=false;j=b.add(g.id,"blur",function(){if(i){return}i=true;b.add(g.id,"change",f);b.remove(g.id,"blur",j)});if(d.isWebKit&&(k.keyCode==37||k.keyCode==39)){return b.prevent(k)}if(k.keyCode==13||k.keyCode==32){f(k);return b.cancel(k)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+=""+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'');i+=""+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";i+="";i=b.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("div",{id:f.id,role:"button",tabindex:"0","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0;f.onHideMenu.dispatch()}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(i){i=i.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");g=c.add(g,"a",{role:"option",href:"javascript:;",style:{backgroundColor:"#"+i},title:p.editor.getLang("colors."+i,i),"data-mce-color":"#"+i});if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+i;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");new d.ui.KeyboardNavigation({root:p.id+"_menu",items:c.select("a",p.id+"_menu"),onCancel:function(){p.hideMenu();p.focus()}});a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return a.cancel(i)});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('
');i.push("");i.push('");j(e,function(h){i.push(h.renderHTML())});i.push("");i.push("
");return i.join("")},focus:function(){var e=this;d.get(e.id).focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){if(b.isWebKit){d.get(f.editor.id+"_ifr").focus()}f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,""))}}if(c.stdMode){f+=''+k.renderHTML()+""}else{f+=""+k.renderHTML()+""}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,""))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,""));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},""+f+"")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}if(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(q){var n=this,p,l=j.ScriptLoader,u,o=[],m;function r(x,y,t){var v=x[y];if(!v){return}if(j.is(v,"string")){t=v.replace(/\.\w+$/,"");t=t?j.resolve(t):0;v=j.resolve(v)}return v.apply(t||this,Array.prototype.slice.call(arguments,2))}q=d({theme:"simple",language:"en"},q);n.settings=q;i.add(document,"init",function(){var s,v;r(q,"onpageload");switch(q.mode){case"exact":s=q.elements||"";if(s.length>0){g(e(s),function(x){if(k.get(x)){m=new j.Editor(x,q);o.push(m);m.render(1)}else{g(document.forms,function(y){g(y.elements,function(z){if(z.name===x){x="mce_editor_"+c++;k.setAttrib(z,"id",x);m=new j.Editor(x,q);o.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function t(y,x){return x.constructor===RegExp?x.test(y.className):k.hasClass(y,x)}g(k.select("textarea"),function(x){if(q.editor_deselector&&t(x,q.editor_deselector)){return}if(!q.editor_selector||t(x,q.editor_selector)){u=k.get(x.name);if(!x.id&&!u){x.id=x.name}if(!x.id||n.get(x.id)){x.id=k.uniqueId()}m=new j.Editor(x.id,q);o.push(m);m.render(1)}});break}if(q.oninit){s=v=0;g(o,function(x){v++;if(!x.initialized){x.onInit.add(function(){s++;if(s==v){r(q,"oninit")}})}else{s++}if(s==v){r(q,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l':"",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,inline_styles:1,convert_fonts_to_spans:true,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr",validate:true,entity_encoding:"named",url_converter:p.convertURL,url_converter_scope:p,ie7_compat:true},q);p.documentBaseURI=new m.util.URI(q.document_base_url||m.documentBaseURL,{base_uri:tinyMCE.baseURI});p.baseURI=m.baseURI;p.contentCSS=[];p.execCallback("setup",p)},render:function(r){var u=this,v=u.settings,x=u.id,p=m.ScriptLoader;if(!j.domLoaded){j.add(document,"init",function(){u.render()});return}tinyMCE.settings=v;if(!u.getElement()){return}if(m.isIDevice&&!m.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(u.getElement().nodeName)&&v.hidden_input&&n.getParent(x,"form")){n.insertAfter(n.create("input",{type:"hidden",name:x}),x)}if(m.WindowManager){u.windowManager=new m.WindowManager(u)}if(v.encoding=="xml"){u.onGetContent.add(function(s,t){if(t.save){t.content=n.encode(t.content)}})}if(v.add_form_submit_trigger){u.onSubmit.addToTop(function(){if(u.initialized){u.save();u.isNotDirty=1}})}if(v.add_unload_trigger){u._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(u.initialized&&!u.destroyed&&!u.isHidden()){u.save({format:"raw",no_events:true})}})}m.addUnload(u.destroy,u);if(v.submit_patch){u.onBeforeRenderUI.add(function(){var s=u.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){u.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){m.triggerSave();u.isNotDirty=1;return u.formElement._mceOldSubmit(u.formElement)}}s=null})}function q(){if(v.language&&v.language_load!==false){p.add(m.baseURL+"/langs/"+v.language+".js")}if(v.theme&&v.theme.charAt(0)!="-"&&!h.urls[v.theme]){h.load(v.theme,"themes/"+v.theme+"/editor_template"+m.suffix+".js")}i(g(v.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(z){var y={prefix:"plugins/",resource:z,suffix:"/editor_plugin"+m.suffix+".js"};var z=c.createUrl(y,z);c.load(z.resource,z)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+m.suffix+".js"})}}});p.loadQueue(function(){if(!u.removed){u.init()}})}q()},init:function(){var r,H=this,I=H.settings,E,A,D=H.getElement(),q,p,F,y,C,G,z,v=[];m.add(H);I.aria_label=I.aria_label||n.getAttrib(D,"aria-label",H.getLang("aria.rich_text_area"));if(I.theme){I.theme=I.theme.replace(/-/,"");q=h.get(I.theme);H.theme=new q();if(H.theme.init&&I.init_theme){H.theme.init(H,h.urls[I.theme]||m.documentBaseURL.replace(/\/$/,""))}}function B(J){var K=c.get(J),t=c.urls[J]||m.documentBaseURL.replace(/\/$/,""),s;if(K&&m.inArray(v,J)===-1){i(c.dependencies(J),function(u){B(u)});s=new K(H,t);H.plugins[J]=s;if(s.init){s.init(H,t);v.push(J)}}}i(g(I.plugins.replace(/\-/g,"")),B);if(I.popup_css!==false){if(I.popup_css){I.popup_css=H.documentBaseURI.toAbsolute(I.popup_css)}else{I.popup_css=H.baseURI.toAbsolute("themes/"+I.theme+"/skins/"+I.skin+"/dialog.css")}}if(I.popup_css_add){I.popup_css+=","+H.documentBaseURI.toAbsolute(I.popup_css_add)}H.controlManager=new m.ControlManager(H);if(I.custom_undo_redo){H.onBeforeExecCommand.add(function(t,J,u,K,s){if(J!="Undo"&&J!="Redo"&&J!="mceRepaint"&&(!s||!s.skip_undo)){H.undoManager.beforeChange()}});H.onExecCommand.add(function(t,J,u,K,s){if(J!="Undo"&&J!="Redo"&&J!="mceRepaint"&&(!s||!s.skip_undo)){H.undoManager.add()}})}H.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){H.nodeChanged()}});if(a){function x(s,t){if(!t||!t.initial){H.execCommand("mceRepaint")}}H.onUndo.add(x);H.onRedo.add(x);H.onSetContent.add(x)}H.onBeforeRenderUI.dispatch(H,H.controlManager);if(I.render_ui){E=I.width||D.style.width||D.offsetWidth;A=I.height||D.style.height||D.offsetHeight;H.orgDisplay=D.style.display;G=/^[0-9\.]+(|px)$/i;if(G.test(""+E)){E=Math.max(parseInt(E)+(q.deltaWidth||0),100)}if(G.test(""+A)){A=Math.max(parseInt(A)+(q.deltaHeight||0),100)}q=H.theme.renderUI({targetNode:D,width:E,height:A,deltaWidth:I.delta_width,deltaHeight:I.delta_height});H.editorContainer=q.editorContainer}if(document.domain&&location.hostname!=document.domain){m.relaxedDomain=document.domain}n.setStyles(q.sizeContainer||q.editorContainer,{width:E,height:A});if(I.content_css){m.each(g(I.content_css),function(s){H.contentCSS.push(H.documentBaseURI.toAbsolute(s))})}A=(q.iframeHeight||A)+(typeof(A)=="number"?(q.deltaHeight||0):"");if(A<100){A=100}H.iframeHTML=I.doctype+'';if(I.document_base_url!=m.documentBaseURL){H.iframeHTML+=''}if(I.ie7_compat){H.iframeHTML+=''}else{H.iframeHTML+=''}H.iframeHTML+='';for(z=0;z'}y=I.body_id||"tinymce";if(y.indexOf("=")!=-1){y=H.getParam("body_id","","hash");y=y[H.id]||y}C=I.body_class||"";if(C.indexOf("=")!=-1){C=H.getParam("body_class","","hash");C=C[H.id]||""}H.iframeHTML+='
';if(m.relaxedDomain&&(b||(m.isOpera&&parseFloat(opera.version())<11))){F='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+H.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}r=n.add(q.iframeContainer,"iframe",{id:H.id+"_ifr",src:F||'javascript:""',frameBorder:"0",allowTransparency:"true",title:I.aria_label,style:{width:"100%",height:A,display:"block"}});H.contentAreaContainer=q.iframeContainer;n.get(q.editorContainer).style.display=H.orgDisplay;n.get(H.id).style.display="none";n.setAttrib(H.id,"aria-hidden",true);if(!m.relaxedDomain||!F){H.setupIframe()}D=r=q=null},setupIframe:function(){var q=this,v=q.settings,x=n.get(q.id),y=q.getDoc(),u,p;if(!b||!m.relaxedDomain){y.open();y.write(q.iframeHTML);y.close();if(m.relaxedDomain){y.domain=m.relaxedDomain}}p=q.getBody();p.disabled=true;if(!v.readonly){p.contentEditable=true}p.disabled=false;q.schema=new m.html.Schema(v);q.dom=new m.dom.DOMUtils(q.getDoc(),{keep_values:true,url_converter:q.convertURL,url_converter_scope:q,hex_colors:v.force_hex_style_colors,class_filter:v.class_filter,update_styles:1,fix_ie_paragraphs:1,schema:q.schema});q.parser=new m.html.DomParser(v,q.schema);if(!q.settings.allow_html_in_named_anchor){q.parser.addAttributeFilter("name",function(s,t){var A=s.length,C,z,B,D;while(A--){D=s[A];if(D.name==="a"&&D.firstChild){B=D.parent;C=D.lastChild;do{z=C.prev;B.insert(C,D);C=z}while(C)}}})}q.parser.addAttributeFilter("src,href,style",function(s,t){var z=s.length,B,D=q.dom,C,A;while(z--){B=s[z];C=B.attr(t);A="data-mce-"+t;if(!B.attributes.map[A]){if(t==="style"){B.attr(A,D.serializeStyle(D.parseStyle(C),B.name))}else{B.attr(A,q.convertURL(C,t,B.name))}}}});q.parser.addNodeFilter("script",function(s,t){var z=s.length,A;while(z--){A=s[z];A.attr("type","mce-"+(A.attr("type")||"text/javascript"))}});q.parser.addNodeFilter("#cdata",function(s,t){var z=s.length,A;while(z--){A=s[z];A.type=8;A.name="#comment";A.value="[CDATA["+A.value+"]]"}});q.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(t,z){var A=t.length,B,s=q.schema.getNonEmptyElements();while(A--){B=t[A];if(B.isEmpty(s)){B.empty().append(new m.html.Node("br",1)).shortEnded=true}}});q.serializer=new m.dom.Serializer(v,q.dom,q.schema);q.selection=new m.dom.Selection(q.dom,q.getWin(),q.serializer);q.formatter=new m.Formatter(this);q.formatter.register({alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"}},{selector:"img,table",collapsed:false,styles:{"float":"left"}}],aligncenter:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"}},{selector:"img",collapsed:false,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:false,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"}},{selector:"img,table",collapsed:false,styles:{"float":"right"}}],alignfull:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"}}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:false},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:false},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},link:{inline:"a",selector:"a",remove:"all",split:true,deep:true,onmatch:function(s){return true},onformat:function(z,s,t){i(t,function(B,A){q.dom.setAttrib(z,A,B)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]});i("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(s){q.formatter.register(s,{block:s,remove:"all"})});q.formatter.register(q.settings.formats);q.undoManager=new m.UndoManager(q);q.undoManager.onAdd.add(function(t,s){if(t.hasUndo()){return q.onChange.dispatch(q,s,t)}});q.undoManager.onUndo.add(function(t,s){return q.onUndo.dispatch(q,s,t)});q.undoManager.onRedo.add(function(t,s){return q.onRedo.dispatch(q,s,t)});q.forceBlocks=new m.ForceBlocks(q,{forced_root_block:v.forced_root_block});q.editorCommands=new m.EditorCommands(q);q.serializer.onPreProcess.add(function(s,t){return q.onPreProcess.dispatch(q,t,s)});q.serializer.onPostProcess.add(function(s,t){return q.onPostProcess.dispatch(q,t,s)});q.onPreInit.dispatch(q);if(!v.gecko_spellcheck){q.getBody().spellcheck=0}if(!v.readonly){q._addEvents()}q.controlManager.onPostRender.dispatch(q,q.controlManager);q.onPostRender.dispatch(q);q.quirks=new m.util.Quirks(this);if(v.directionality){q.getBody().dir=v.directionality}if(v.nowrap){q.getBody().style.whiteSpace="nowrap"}if(v.handle_node_change_callback){q.onNodeChange.add(function(t,s,z){q.execCallback("handle_node_change_callback",q.id,z,-1,-1,true,q.selection.isCollapsed())})}if(v.save_callback){q.onSaveContent.add(function(s,z){var t=q.execCallback("save_callback",q.id,z.content,q.getBody());if(t){z.content=t}})}if(v.onchange_callback){q.onChange.add(function(t,s){q.execCallback("onchange_callback",q,s)})}if(v.protect){q.onBeforeSetContent.add(function(s,t){if(v.protect){i(v.protect,function(z){t.content=t.content.replace(z,function(A){return""})})}})}if(v.convert_newlines_to_brs){q.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"
")}})}if(v.preformatted){q.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='
'+t.content+"
"}})}if(v.verify_css_classes){q.serializer.attribValueFilter=function(B,z){var A,t;if(B=="class"){if(!q.classesRE){t=q.dom.getClasses();if(t.length>0){A="";i(t,function(s){A+=(A?"|":"")+s["class"]});q.classesRE=new RegExp("("+A+")","gi")}}return !q.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(z)||q.classesRE.test(z)?z:""}return z}}if(v.cleanup_callback){q.onBeforeSetContent.add(function(s,t){t.content=q.execCallback("cleanup_callback","insert_to_editor",t.content,t)});q.onPreProcess.add(function(s,t){if(t.set){q.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){q.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});q.onPostProcess.add(function(s,t){if(t.set){t.content=q.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=q.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(v.save_callback){q.onGetContent.add(function(s,t){if(t.save){t.content=q.execCallback("save_callback",q.id,t.content,q.getBody())}})}if(v.handle_event_callback){q.onEvent.add(function(s,t,z){if(q.execCallback("handle_event_callback",t,s,z)===false){j.cancel(t)}})}q.onSetContent.add(function(){q.addVisual(q.getBody())});if(v.padd_empty_editor){q.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
[\r\n]*)$/,"")})}if(a){function r(s,t){i(s.dom.select("a"),function(A){var z=A.parentNode;if(s.dom.isBlock(z)&&z.lastChild===A){s.dom.add(z,"br",{"data-mce-bogus":1})}})}q.onExecCommand.add(function(s,t){if(t==="CreateLink"){r(s)}});q.onSetContent.add(q.selection.onSetContent.add(r))}q.load({initial:true,format:"html"});q.startContent=q.getContent({format:"raw"});q.undoManager.add();q.initialized=true;q.onInit.dispatch(q);q.execCallback("setupcontent_callback",q.id,q.getBody(),q.getDoc());q.execCallback("init_instance_callback",q);q.focus(true);q.nodeChanged({initial:1});i(q.contentCSS,function(s){q.dom.loadCSS(s)});if(v.auto_focus){setTimeout(function(){var s=m.get(v.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getBody().focus();s.getWin().focus()},100)}x=null},focus:function(u){var y,q=this,s=q.selection,x=q.settings.content_editable,r,p,v=q.getDoc();if(!u){r=s.getRng();if(r.item){p=r.item(0)}q._refreshContentEditable();s.normalize();if(!x){q.getWin().focus()}if(m.isGecko){q.getBody().focus()}if(p&&p.ownerDocument==v){r=v.body.createControlRange();r.addElement(p);r.select()}}if(m.activeEditor!=q){if((y=m.activeEditor)!=null){y.onDeactivate.dispatch(y,q)}q.onActivate.dispatch(q,y)}m._setActive(q)},execCallback:function(u){var p=this,r=p.settings[u],q;if(!r){return}if(p.callbackLookup&&(q=p.callbackLookup[u])){r=q.func;q=q.scope}if(d(r,"string")){q=r.replace(/\.\w+$/,"");q=q?m.resolve(q):0;r=m.resolve(r);p.callbackLookup=p.callbackLookup||{};p.callbackLookup[u]={func:r,scope:q}}return r.apply(q||p,Array.prototype.slice.call(arguments,1))},translate:function(p){var r=this.settings.language||"en",q=m.i18n;if(!p){return""}return q[r+"."+p]||p.replace(/{\#([^}]+)\}/g,function(t,s){return q[r+"."+s]||"{#"+s+"}"})},getLang:function(q,p){return m.i18n[(this.settings.language||"en")+"."+q]||(d(p)?p:"{#"+q+"}")},getParam:function(u,r,p){var s=m.trim,q=d(this.settings[u])?this.settings[u]:r,t;if(p==="hash"){t={};if(d(q,"string")){i(q.indexOf("=")>0?q.split(/[;,](?![^=;,]*(?:[;,]|$))/):q.split(","),function(x){x=x.split("=");if(x.length>1){t[s(x[0])]=s(x[1])}else{t[s(x[0])]=s(x)}})}else{t=q}return t}return q},nodeChanged:function(r){var p=this,q=p.selection,u=q.getStart()||p.getBody();if(p.initialized){r=r||{};u=b&&u.ownerDocument!=p.getDoc()?p.getBody():u;r.parents=[];p.dom.getParent(u,function(s){if(s.nodeName=="BODY"){return true}r.parents.push(s)});p.onNodeChange.dispatch(p,r?r.controlManager||p.controlManager:p.controlManager,u,q.isCollapsed(),r)}},addButton:function(r,q){var p=this;p.buttons=p.buttons||{};p.buttons[r]=q},addCommand:function(p,r,q){this.execCommands[p]={func:r,scope:q||this}},addQueryStateHandler:function(p,r,q){this.queryStateCommands[p]={func:r,scope:q||this}},addQueryValueHandler:function(p,r,q){this.queryValueCommands[p]={func:r,scope:q||this}},addShortcut:function(r,u,p,s){var q=this,v;if(!q.settings.custom_shortcuts){return false}q.shortcuts=q.shortcuts||{};if(d(p,"string")){v=p;p=function(){q.execCommand(v,false,null)}}if(d(p,"object")){v=p;p=function(){q.execCommand(v[0],v[1],v[2])}}i(g(r),function(t){var x={func:p,scope:s||this,desc:u,alt:false,ctrl:false,shift:false};i(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});q.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=x});return true},execCommand:function(x,v,z,p){var r=this,u=0,y,q;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!p||!p.skip_focus)){r.focus()}y={};r.onBeforeExecCommand.dispatch(r,x,v,z,y);if(y.terminate){return false}if(r.execCallback("execcommand_callback",r.id,r.selection.getNode(),x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(y=r.execCommands[x]){q=y.func.call(y.scope,v,z);if(q!==true){r.onExecCommand.dispatch(r,x,v,z,p);return q}}i(r.plugins,function(s){if(s.execCommand&&s.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);u=1;return false}});if(u){return true}if(r.theme&&r.theme.execCommand&&r.theme.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(r.editorCommands.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}r.getDoc().execCommand(x,v,z);r.onExecCommand.dispatch(r,x,v,z,p)},queryCommandState:function(u){var q=this,v,r;if(q._isHidden()){return}if(v=q.queryStateCommands[u]){r=v.func.call(v.scope);if(r!==true){return r}}v=q.editorCommands.queryCommandState(u);if(v!==-1){return v}try{return this.getDoc().queryCommandState(u)}catch(p){}},queryCommandValue:function(v){var q=this,u,r;if(q._isHidden()){return}if(u=q.queryValueCommands[v]){r=u.func.call(u.scope);if(r!==true){return r}}u=q.editorCommands.queryCommandValue(v);if(d(u)){return u}try{return this.getDoc().queryCommandValue(v)}catch(p){}},show:function(){var p=this;n.show(p.getContainer());n.hide(p.id);p.load()},hide:function(){var p=this,q=p.getDoc();if(b&&q){q.execCommand("SelectAll")}p.save();n.hide(p.getContainer());n.setStyle(p.id,"display",p.orgDisplay)},isHidden:function(){return !n.isHidden(this.id)},setProgressState:function(p,q,r){this.onSetProgressState.dispatch(this,p,q,r);return p},load:function(s){var p=this,r=p.getElement(),q;if(r){s=s||{};s.load=true;q=p.setContent(d(r.value)?r.value:r.innerHTML,s);s.element=r;if(!s.no_events){p.onLoadContent.dispatch(p,s)}s.element=r=null;return q}},save:function(u){var p=this,s=p.getElement(),q,r;if(!s||!p.initialized){return}u=u||{};u.save=true;if(!u.no_events){p.undoManager.typing=false;p.undoManager.add()}u.element=s;q=u.content=p.getContent(u);if(!u.no_events){p.onSaveContent.dispatch(p,u)}q=u.content;if(!/TEXTAREA|INPUT/i.test(s.nodeName)){s.innerHTML=q;if(r=n.getParent(p.id,"form")){i(r.elements,function(t){if(t.name==p.id){t.value=q;return false}})}}else{s.value=q}u.element=s=null;return q},setContent:function(u,s){var r=this,q,p=r.getBody(),t;s=s||{};s.format=s.format||"html";s.set=true;s.content=u;if(!s.no_events){r.onBeforeSetContent.dispatch(r,s)}u=s.content;if(!m.isIE&&(u.length===0||/^\s+$/.test(u))){t=r.settings.forced_root_block;if(t){u="<"+t+'>
"}else{u='
'}p.innerHTML=u;r.selection.select(p,true);r.selection.collapse(true);return}if(s.format!=="raw"){u=new m.html.Serializer({},r.schema).serialize(r.parser.parse(u))}s.content=m.trim(u);r.dom.setHTML(p,s.content);if(!s.no_events){r.onSetContent.dispatch(r,s)}r.selection.normalize();return s.content},getContent:function(q){var p=this,r;q=q||{};q.format=q.format||"html";q.get=true;if(!q.no_events){p.onBeforeGetContent.dispatch(p,q)}if(q.format=="raw"){r=p.getBody().innerHTML}else{r=p.serializer.serialize(p.getBody(),q)}q.content=m.trim(r);if(!q.no_events){p.onGetContent.dispatch(p,q)}return q.content},isDirty:function(){var p=this;return m.trim(p.startContent)!=m.trim(p.getContent({format:"raw",no_events:1}))&&!p.isNotDirty},getContainer:function(){var p=this;if(!p.container){p.container=n.get(p.editorContainer||p.id+"_parent")}return p.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return n.get(this.settings.content_element||this.id)},getWin:function(){var p=this,q;if(!p.contentWindow){q=n.get(p.id+"_ifr");if(q){p.contentWindow=q.contentWindow}}return p.contentWindow},getDoc:function(){var q=this,p;if(!q.contentDocument){p=q.getWin();if(p){q.contentDocument=p.document}}return q.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(p,x,v){var q=this,r=q.settings;if(r.urlconverter_callback){return q.execCallback("urlconverter_callback",p,v,true,x)}if(!r.convert_urls||(v&&v.nodeName=="LINK")||p.indexOf("file:")===0){return p}if(r.relative_urls){return q.documentBaseURI.toRelative(p)}p=q.documentBaseURI.toAbsolute(p,r.remove_script_host);return p},addVisual:function(r){var p=this,q=p.settings;r=r||p.getBody();if(!d(p.hasVisual)){p.hasVisual=q.visual}i(p.dom.select("table,a",r),function(t){var s;switch(t.nodeName){case"TABLE":s=p.dom.getAttrib(t,"border");if(!s||s=="0"){if(p.hasVisual){p.dom.addClass(t,q.visual_table_class)}else{p.dom.removeClass(t,q.visual_table_class)}}return;case"A":s=p.dom.getAttrib(t,"name");if(s){if(p.hasVisual){p.dom.addClass(t,"mceItemAnchor")}else{p.dom.removeClass(t,"mceItemAnchor")}}return}});p.onVisualAid.dispatch(p,r,p.hasVisual)},remove:function(){var p=this,q=p.getContainer();p.removed=1;p.hide();p.execCallback("remove_instance_callback",p);p.onRemove.dispatch(p);p.onExecCommand.listeners=[];m.remove(p);n.remove(q)},destroy:function(q){var p=this;if(p.destroyed){return}if(!q){m.removeUnload(p.destroy);tinyMCE.onBeforeUnload.remove(p._beforeUnload);if(p.theme&&p.theme.destroy){p.theme.destroy()}p.controlManager.destroy();p.selection.destroy();p.dom.destroy();if(!p.settings.content_editable){j.clear(p.getWin());j.clear(p.getDoc())}j.clear(p.getBody());j.clear(p.formElement)}if(p.formElement){p.formElement.submit=p.formElement._mceOldSubmit;p.formElement._mceOldSubmit=null}p.contentAreaContainer=p.formElement=p.container=p.settings.content_element=p.bodyElement=p.contentDocument=p.contentWindow=null;if(p.selection){p.selection=p.selection.win=p.selection.dom=p.selection.dom.doc=null}p.destroyed=1},_addEvents:function(){var B=this,r,C=B.settings,q=B.dom,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function p(t,D){var s=t.type;if(B.removed){return}if(B.onEvent.dispatch(B,t,D)!==false){B[x[t.fakeType||t.type]].dispatch(B,t,D)}}i(x,function(t,s){switch(s){case"contextmenu":q.bind(B.getDoc(),s,p);break;case"paste":q.bind(B.getBody(),s,function(D){p(D)});break;case"submit":case"reset":q.bind(B.getElement().form||n.getParent(B.id,"form"),s,p);break;default:q.bind(C.content_editable?B.getBody():B.getDoc(),s,p)}});q.bind(C.content_editable?B.getBody():(a?B.getDoc():B.getWin()),"focus",function(s){B.focus(true)});if(m.isGecko){q.bind(B.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("data-mce-src"))){t.src=B.documentBaseURI.toAbsolute(s)}})}if(a){function u(){var E=this,G=E.getDoc(),F=E.settings;if(a&&!F.readonly){E._refreshContentEditable();try{G.execCommand("styleWithCSS",0,false)}catch(D){if(!E._isHidden()){try{G.execCommand("useCSS",0,true)}catch(D){}}}if(!F.table_inline_editing){try{G.execCommand("enableInlineTableEditing",false,false)}catch(D){}}if(!F.object_resizing){try{G.execCommand("enableObjectResizing",false,false)}catch(D){}}}}B.onBeforeExecCommand.add(u);B.onMouseDown.add(u)}B.onMouseUp.add(B.nodeChanged);B.onKeyUp.add(function(s,t){var D=t.keyCode;if((D>=33&&D<=36)||(D>=37&&D<=40)||D==13||D==45||D==46||D==8||(m.isMac&&(D==91||D==93))||t.ctrlKey){B.nodeChanged()}});B.onKeyDown.add(function(t,D){if(D.keyCode!=8){return}var F=t.selection.getRng().startContainer;var E=t.selection.getRng().startOffset;while(F&&F.nodeType&&F.nodeType!=1&&F.parentNode){F=F.parentNode}if(F&&F.parentNode&&F.parentNode.tagName==="BLOCKQUOTE"&&F.parentNode.firstChild==F&&E==0){t.formatter.toggle("blockquote",null,F.parentNode);var s=t.selection.getRng();s.setStart(F,0);s.setEnd(F,0);t.selection.setRng(s);t.selection.collapse(false)}});B.onReset.add(function(){B.setContent(B.startContent,{format:"raw"})});if(C.custom_shortcuts){if(C.custom_undo_redo_keyboard_shortcuts){B.addShortcut("ctrl+z",B.getLang("undo_desc"),"Undo");B.addShortcut("ctrl+y",B.getLang("redo_desc"),"Redo")}B.addShortcut("ctrl+b",B.getLang("bold_desc"),"Bold");B.addShortcut("ctrl+i",B.getLang("italic_desc"),"Italic");B.addShortcut("ctrl+u",B.getLang("underline_desc"),"Underline");for(r=1;r<=6;r++){B.addShortcut("ctrl+"+r,"",["FormatBlock",false,"h"+r])}B.addShortcut("ctrl+7","",["FormatBlock",false,"p"]);B.addShortcut("ctrl+8","",["FormatBlock",false,"div"]);B.addShortcut("ctrl+9","",["FormatBlock",false,"address"]);function v(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}i(B.shortcuts,function(D){if(m.isMac&&D.ctrl!=t.metaKey){return}else{if(!m.isMac&&D.ctrl!=t.ctrlKey){return}}if(D.alt!=t.altKey){return}if(D.shift!=t.shiftKey){return}if(t.keyCode==D.keyCode||(t.charCode&&t.charCode==D.charCode)){s=D;return false}});return s}B.onKeyUp.add(function(s,t){var D=v(t);if(D){return j.cancel(t)}});B.onKeyPress.add(function(s,t){var D=v(t);if(D){return j.cancel(t)}});B.onKeyDown.add(function(s,t){var D=v(t);if(D){D.func.call(D.scope);return j.cancel(t)}})}if(m.isIE){q.bind(B.getDoc(),"controlselect",function(D){var t=B.resizeInfo,s;D=D.target;if(D.nodeName!=="IMG"){return}if(t){q.unbind(t.node,t.ev,t.cb)}if(!q.hasClass(D,"mceItemNoResize")){ev="resizeend";s=q.bind(D,ev,function(F){var E;F=F.target;if(E=q.getStyle(F,"width")){q.setAttrib(F,"width",E.replace(/[^0-9%]+/g,""));q.setStyle(F,"width","")}if(E=q.getStyle(F,"height")){q.setAttrib(F,"height",E.replace(/[^0-9%]+/g,""));q.setStyle(F,"height","")}})}else{ev="resizestart";s=q.bind(D,"resizestart",j.cancel,j)}t=B.resizeInfo={node:D,ev:ev,cb:s}})}if(m.isOpera){B.onClick.add(function(s,t){j.prevent(t)})}if(C.custom_undo_redo){function y(){B.undoManager.typing=false;B.undoManager.add()}q.bind(B.getDoc(),"focusout",function(s){if(!B.removed&&B.undoManager.typing){y()}});B.dom.bind(B.dom.getRoot(),"dragend",function(s){y()});B.onKeyUp.add(function(s,D){var t=D.keyCode;if((t>=33&&t<=36)||(t>=37&&t<=40)||t==13||t==45||D.ctrlKey){y()}});B.onKeyDown.add(function(s,E){var D=E.keyCode,t;if(D==8){t=B.getDoc().selection;if(t&&t.createRange&&t.createRange().item){B.undoManager.beforeChange();s.dom.remove(t.createRange().item(0));y();return j.cancel(E)}}if((D>=33&&D<=36)||(D>=37&&D<=40)||D==13||D==45){if(m.isIE&&D==13){B.undoManager.beforeChange()}if(B.undoManager.typing){y()}return}if((D<16||D>20)&&D!=224&&D!=91&&!B.undoManager.typing){B.undoManager.beforeChange();B.undoManager.typing=true;B.undoManager.add()}});B.onMouseDown.add(function(){if(B.undoManager.typing){y()}})}if(m.isGecko){function A(){var s=B.dom.getAttribs(B.selection.getStart().cloneNode(false));return function(){var t=B.selection.getStart();if(t!==B.getBody()){B.dom.setAttrib(t,"style",null);i(s,function(D){t.setAttributeNode(D.cloneNode(true))})}}}function z(){var t=B.selection;return !t.isCollapsed()&&t.getStart()!=t.getEnd()}B.onKeyPress.add(function(s,D){var t;if((D.keyCode==8||D.keyCode==46)&&z()){t=A();B.getDoc().execCommand("delete",false,null);t();return j.cancel(D)}});B.dom.bind(B.getDoc(),"cut",function(t){var s;if(z()){s=A();B.onKeyUp.addToTop(j.cancel,j);setTimeout(function(){s();B.onKeyUp.remove(j.cancel,j)},0)}})}},_refreshContentEditable:function(){var q=this,p,r;if(q._isHidden()){p=q.getBody();r=p.parentNode;r.removeChild(p);r.appendChild(p);p.focus()}},_isHidden:function(){var p;if(!a){return 0}p=this.selection.getSel();return(!p||!p.rangeCount||p.rangeCount==0)}})})(tinymce);(function(c){var d=c.each,e,a=true,b=false;c.EditorCommands=function(n){var m=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,q=n.formatter,o;function r(z,y,x){var v;z=z.toLowerCase();if(v=j.exec[z]){v(z,y,x);return a}return b}function l(x){var v;x=x.toLowerCase();if(v=j.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=j.value[x]){return v(x)}return b}function u(v,x){x=x||"exec";d(v,function(z,y){d(y.toLowerCase().split(","),function(A){j[x][A]=z})})}c.extend(this,{execCommand:r,queryCommandState:l,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===e){x=b}if(v===e){v=null}return n.getDoc().execCommand(y,x,v)}function t(v){return q.match(v)}function s(v,x){q.toggle(v,x?{value:x}:e)}function i(v){o=p.getBookmark(v)}function g(){p.moveToBookmark(o)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(z){var y=n.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(c.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(A){if(A){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(v){if(p.isCollapsed()){p.select(p.getNode())}f(v);p.collapse(b)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);d("left,center,right,full".split(","),function(y){if(x!=y){q.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(p.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){i();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=c.explode(k.font_size_style_values);v=c.explode(k.font_size_classes);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){q.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||p.getNode();if(v!=n.getBody()){i();n.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(p.getNode(),function(A){if(A.nodeType==1&&v++==x){p.select(A);return b}},n.getBody())},mceSelectNode:function(y,x,v){p.select(v)},mceInsertContent:function(B,I,K){var y,J,E,z,F,G,D,C,L,x,A,M,v,H;y=n.parser;J=new c.html.Serializer({},n.schema);v='\uFEFF';G={content:K,format:"html"};p.onBeforeSetContent.dispatch(p,G);K=G.content;if(K.indexOf("{$caret}")==-1){K+="{$caret}"}K=K.replace(/\{\$caret\}/,v);if(!p.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}E=p.getNode();G={context:E.nodeName.toLowerCase()};F=y.parse(K,G);A=F.lastChild;if(A.attr("id")=="mce_marker"){D=A;for(A=A.prev;A;A=A.walk(true)){if(A.type==3||!m.isBlock(A.name)){A.parent.insert(D,A,A.name==="br");break}}}if(!G.invalid){K=J.serialize(F);A=E.firstChild;M=E.lastChild;if(!A||(A===M&&A.nodeName==="BR")){m.setHTML(E,K)}else{p.setContent(K)}}else{p.setContent(v);E=n.selection.getNode();z=n.getBody();if(E.nodeType==9){E=A=z}else{A=E}while(A!==z){E=A;A=A.parentNode}K=E==z?z.innerHTML:m.getOuterHTML(E);K=J.serialize(y.parse(K.replace(//i,function(){return J.serialize(F)})));if(E==z){m.setHTML(z,K)}else{m.setOuterHTML(E,K)}}D=m.get("mce_marker");C=m.getRect(D);L=m.getViewPort(n.getWin());if((C.y+C.h>L.y+L.h||C.yL.x+L.w||C.x")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(y,x,v){n.execCommand("mceInsertContent",false,v.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(z,y,x){var v;if(typeof(x)=="string"){x={href:x}}v=m.getParent(p.getNode(),"a");x.href=x.href.replace(" ","%20");if(!v||!x.href){q.remove("link")}if(x.href){q.apply("link",x,v)}},selectAll:function(){var x=m.getRoot(),v=m.createRng();v.setStart(x,0);v.setEnd(x,x.childNodes.length);n.selection.setRng(v)}});u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){return t("align"+v.substring(7))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(k.inline_styles){if((v=m.getParent(p.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(p.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return l("InsertUnorderedList")||l("InsertOrderedList")||(!k.inline_styles&&!!m.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(v){return m.getParent(p.getNode(),v=="insertunorderedlist"?"UL":"OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(p.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");if(k.custom_undo_redo){u({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(f){var d,e=0,h=[],c;function g(){return b.trim(f.getContent({format:"raw",no_events:1}))}return d={typing:false,onAdd:new a(d),onUndo:new a(d),onRedo:new a(d),beforeChange:function(){c=f.selection.getBookmark(2,true)},add:function(m){var j,k=f.settings,l;m=m||{};m.content=g();l=h[e];if(l&&l.content==m.content){return null}if(h[e]){h[e].beforeBookmark=c}if(k.custom_undo_redo_levels){if(h.length>k.custom_undo_redo_levels){for(j=0;j0){k=h[--e];f.setContent(k.content,{format:"raw"});f.selection.moveToBookmark(k.beforeBookmark);d.onUndo.dispatch(d,k)}return k},redo:function(){var i;if(e0||this.typing},hasRedo:function(){return e');q.replace(p,m);o.select(p,1)}return g}return d}l.create("tinymce.ForceBlocks",{ForceBlocks:function(m){var n=this,o=m.settings,p;n.editor=m;n.dom=m.dom;p=(o.forced_root_block||"p").toLowerCase();o.element=p.toUpperCase();m.onPreInit.add(n.setup,n)},setup:function(){var n=this,m=n.editor,p=m.settings,u=m.dom,o=m.selection,q=m.schema.getBlockElements();if(p.forced_root_block){function v(){var y=o.getStart(),t=m.getBody(),s,z,D,F,E,x,A,B=-16777215;if(!y||y.nodeType!==1){return}while(y!=t){if(q[y.nodeName]){return}y=y.parentNode}s=o.getRng();if(s.setStart){z=s.startContainer;D=s.startOffset;F=s.endContainer;E=s.endOffset}else{if(s.item){s=m.getDoc().body.createTextRange();s.moveToElementText(s.item(0))}tmpRng=s.duplicate();tmpRng.collapse(true);D=tmpRng.move("character",B)*-1;if(!tmpRng.collapsed){tmpRng=s.duplicate();tmpRng.collapse(false);E=(tmpRng.move("character",B)*-1)-D}}for(y=t.firstChild;y;y){if(y.nodeType===3||(y.nodeType==1&&!q[y.nodeName])){if(!x){x=u.create(p.forced_root_block);y.parentNode.insertBefore(x,y)}A=y;y=y.nextSibling;x.appendChild(A)}else{x=null;y=y.nextSibling}}if(s.setStart){s.setStart(z,D);s.setEnd(F,E);o.setRng(s)}else{try{s=m.getDoc().body.createTextRange();s.moveToElementText(t);s.collapse(true);s.moveStart("character",D);if(E>0){s.moveEnd("character",E)}s.select()}catch(C){}}m.nodeChanged()}m.onKeyUp.add(v);m.onClick.add(v)}if(p.force_br_newlines){if(c){m.onKeyPress.add(function(s,t){var x;if(t.keyCode==13&&o.getNode().nodeName!="LI"){o.setContent('
',{format:"raw"});x=u.get("__");x.removeAttribute("id");o.select(x);o.collapse();return j.cancel(t)}})}}if(p.force_p_newlines){if(!c){m.onKeyPress.add(function(s,t){if(t.keyCode==13&&!t.shiftKey&&!n.insertPara(t)){j.cancel(t)}})}else{l.addUnload(function(){n._previousFormats=0});m.onKeyPress.add(function(s,t){n._previousFormats=0;if(t.keyCode==13&&!t.shiftKey&&s.selection.isCollapsed()&&p.keep_styles){n._previousFormats=k(s.selection.getStart())}});m.onKeyUp.add(function(t,y){if(y.keyCode==13&&!y.shiftKey){var x=t.selection.getStart(),s=n._previousFormats;if(!x.hasChildNodes()&&s){x=u.getParent(x,u.isBlock);if(x&&x.nodeName!="LI"){x.innerHTML="";if(n._previousFormats){x.appendChild(s.wrapper);s.inner.innerHTML="\uFEFF"}else{x.innerHTML="\uFEFF"}o.select(x,1);o.collapse(true);t.getDoc().execCommand("Delete",false,null);n._previousFormats=0}}}})}if(a){m.onKeyDown.add(function(s,t){if((t.keyCode==8||t.keyCode==46)&&!t.shiftKey){n.backspaceDelete(t,t.keyCode==8)}})}}if(l.isWebKit){function r(t){var s=o.getRng(),x,A=u.create("div",null," "),z,y=u.getViewPort(t.getWin()).h;s.insertNode(x=u.create("br"));s.setStartAfter(x);s.setEndAfter(x);o.setRng(s);if(o.getSel().focusNode==x.previousSibling){o.select(u.insertAfter(u.doc.createTextNode("\u00a0"),x));o.collapse(d)}u.insertAfter(A,x);z=u.getPos(A).y;u.remove(A);if(z>y){t.getWin().scrollTo(0,z)}}m.onKeyPress.add(function(s,t){if(t.keyCode==13&&(t.shiftKey||(p.force_br_newlines&&!u.getParent(o.getNode(),"h1,h2,h3,h4,h5,h6,ol,ul")))){r(s);j.cancel(t)}})}if(c){if(p.element!="P"){m.onKeyPress.add(function(s,t){n.lastElm=o.getNode().nodeName});m.onKeyUp.add(function(t,x){var z,y=o.getNode(),s=t.getBody();if(s.childNodes.length===1&&y.nodeName=="P"){y=u.rename(y,p.element);o.select(y);o.collapse();t.nodeChanged()}else{if(x.keyCode==13&&!x.shiftKey&&n.lastElm!="P"){z=u.getParent(y,"p");if(z){u.rename(z,p.element);t.nodeChanged()}}}})}}},getParentBlock:function(o){var m=this.dom;return m.getParent(o,m.isBlock)},insertPara:function(Q){var E=this,v=E.editor,M=v.dom,R=v.getDoc(),V=v.settings,F=v.selection.getSel(),G=F.getRangeAt(0),U=R.body;var J,K,H,O,N,q,o,u,z,m,C,T,p,x,I,L=M.getViewPort(v.getWin()),B,D,A;v.undoManager.beforeChange();J=R.createRange();J.setStart(F.anchorNode,F.anchorOffset);J.collapse(d);K=R.createRange();K.setStart(F.focusNode,F.focusOffset);K.collapse(d);H=J.compareBoundaryPoints(J.START_TO_END,K)<0;O=H?F.anchorNode:F.focusNode;N=H?F.anchorOffset:F.focusOffset;q=H?F.focusNode:F.anchorNode;o=H?F.focusOffset:F.anchorOffset;if(O===q&&/^(TD|TH)$/.test(O.nodeName)){if(O.firstChild.nodeName=="BR"){M.remove(O.firstChild)}if(O.childNodes.length==0){v.dom.add(O,V.element,null,"
");T=v.dom.add(O,V.element,null,"
")}else{I=O.innerHTML;O.innerHTML="";v.dom.add(O,V.element,null,I);T=v.dom.add(O,V.element,null,"
")}G=R.createRange();G.selectNodeContents(T);G.collapse(1);v.selection.setRng(G);return g}if(O==U&&q==U&&U.firstChild&&v.dom.isBlock(U.firstChild)){O=q=O.firstChild;N=o=0;J=R.createRange();J.setStart(O,0);K=R.createRange();K.setStart(q,0)}if(!R.body.hasChildNodes()){R.body.appendChild(M.create("br"))}O=O.nodeName=="HTML"?R.body:O;O=O.nodeName=="BODY"?O.firstChild:O;q=q.nodeName=="HTML"?R.body:q;q=q.nodeName=="BODY"?q.firstChild:q;u=E.getParentBlock(O);z=E.getParentBlock(q);m=u?u.nodeName:V.element;if(I=E.dom.getParent(u,"li,pre")){if(I.nodeName=="LI"){return e(v.selection,E.dom,I)}return d}if(u&&(u.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(M.getStyle(u,"position",1)))){m=V.element;u=null}if(z&&(z.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(M.getStyle(u,"position",1)))){m=V.element;z=null}if(/(TD|TABLE|TH|CAPTION)/.test(m)||(u&&m=="DIV"&&/left|right/gi.test(M.getStyle(u,"float",1)))){m=V.element;u=z=null}C=(u&&u.nodeName==m)?u.cloneNode(0):v.dom.create(m);T=(z&&z.nodeName==m)?z.cloneNode(0):v.dom.create(m);T.removeAttribute("id");if(/^(H[1-6])$/.test(m)&&f(G,u)){T=v.dom.create(V.element)}I=p=O;do{if(I==U||I.nodeType==9||E.dom.isBlock(I)||/(TD|TABLE|TH|CAPTION)/.test(I.nodeName)){break}p=I}while((I=I.previousSibling?I.previousSibling:I.parentNode));I=x=q;do{if(I==U||I.nodeType==9||E.dom.isBlock(I)||/(TD|TABLE|TH|CAPTION)/.test(I.nodeName)){break}x=I}while((I=I.nextSibling?I.nextSibling:I.parentNode));if(p.nodeName==m){J.setStart(p,0)}else{J.setStartBefore(p)}J.setEnd(O,N);C.appendChild(J.cloneContents()||R.createTextNode(""));try{K.setEndAfter(x)}catch(P){}K.setStart(q,o);T.appendChild(K.cloneContents()||R.createTextNode(""));G=R.createRange();if(!p.previousSibling&&p.parentNode.nodeName==m){G.setStartBefore(p.parentNode)}else{if(J.startContainer.nodeName==m&&J.startOffset==0){G.setStartBefore(J.startContainer)}else{G.setStart(J.startContainer,J.startOffset)}}if(!x.nextSibling&&x.parentNode.nodeName==m){G.setEndAfter(x.parentNode)}else{G.setEnd(K.endContainer,K.endOffset)}G.deleteContents();if(b){v.getWin().scrollTo(0,L.y)}if(C.firstChild&&C.firstChild.nodeName==m){C.innerHTML=C.firstChild.innerHTML}if(T.firstChild&&T.firstChild.nodeName==m){T.innerHTML=T.firstChild.innerHTML}function S(y,s){var r=[],X,W,t;y.innerHTML="";if(V.keep_styles){W=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(W.nodeName)){X=W.cloneNode(g);M.setAttrib(X,"id","");r.push(X)}}while(W=W.parentNode)}if(r.length>0){for(t=r.length-1,X=y;t>=0;t--){X=X.appendChild(r[t])}r[0].innerHTML=b?"\u00a0":"
";return r[0]}else{y.innerHTML=b?"\u00a0":"
"}}if(M.isEmpty(C)){S(C,O)}if(M.isEmpty(T)){A=S(T,q)}if(b&&parseFloat(opera.version())<9.5){G.insertNode(C);G.insertNode(T)}else{G.insertNode(T);G.insertNode(C)}T.normalize();C.normalize();v.selection.select(T,true);v.selection.collapse(true);B=v.dom.getPos(T).y;if(BL.y+L.h){v.getWin().scrollTo(0,B1||ab==at){return ab}}}var al=U.selection.getRng();var ap=al.startContainer;var ak=al.endContainer;if(ap!=ak&&al.endOffset==0){var ao=am(ap,ak);var an=ao.nodeType==3?ao.length:ao.childNodes.length;al.setEnd(ao,an)}return al}function X(an,at,aq,ap,al){var ak=[],am=-1,ar,av=-1,ao=-1,au;O(an.childNodes,function(ax,aw){if(ax.nodeName==="UL"||ax.nodeName==="OL"){am=aw;ar=ax;return false}});O(an.childNodes,function(ax,aw){if(ax.nodeName==="SPAN"&&c.getAttrib(ax,"data-mce-type")=="bookmark"){if(ax.id==at.id+"_start"){av=aw}else{if(ax.id==at.id+"_end"){ao=aw}}}});if(am<=0||(avam)){O(a.grep(an.childNodes),al);return 0}else{au=aq.cloneNode(R);O(a.grep(an.childNodes),function(ax,aw){if((avam&&aw>am)){ak.push(ax);ax.parentNode.removeChild(ax)}});if(avam){an.insertBefore(au,ar.nextSibling)}}ap.push(au);O(ak,function(aw){au.appendChild(aw)});return au}}function ai(al,an,ap){var ak=[],ao,am;ao=ah.inline||ah.block;am=c.create(ao);V(am);K.walk(al,function(aq){var ar;function at(au){var ax=au.nodeName.toLowerCase(),aw=au.parentNode.nodeName.toLowerCase(),av;if(g(ax,"br")){ar=0;if(ah.block){c.remove(au)}return}if(ah.wrapper&&x(au,Y,ag)){ar=0;return}if(ah.block&&!ah.wrapper&&G(ax)){au=c.rename(au,ao);V(au);ak.push(au);ar=0;return}if(ah.selector){O(ac,function(ay){if("collapsed" in ay&&ay.collapsed!==ad){return}if(c.is(au,ay.selector)&&!b(au)){V(au,ay);av=true}});if(!ah.inline||av){ar=0;return}}if(d(ao,ax)&&d(aw,ao)&&!(!ap&&au.nodeType===3&&au.nodeValue.length===1&&au.nodeValue.charCodeAt(0)===65279)&&au.id!=="_mce_caret"){if(!ar){ar=am.cloneNode(R);au.parentNode.insertBefore(ar,au);ak.push(ar)}ar.appendChild(au)}else{if(ax=="li"&&an){ar=X(au,an,am,ak,at)}else{ar=0;O(a.grep(au.childNodes),at);ar=0}}}O(aq,at)});if(ah.wrap_links===false){O(ak,function(aq){function ar(aw){var av,au,at;if(aw.nodeName==="A"){au=am.cloneNode(R);ak.push(au);at=a.grep(aw.childNodes);for(av=0;av1||!F(at))&&aq===0){c.remove(at,1);return}if(ah.inline||ah.wrapper){if(!ah.exact&&aq===1){at=ar(at)}O(ac,function(av){O(c.select(av.inline,at),function(ax){var aw;if(av.wrap_links===false){aw=ax.parentNode;do{if(aw.nodeName==="A"){return}}while(aw=aw.parentNode)}T(av,ag,ax,av.exact?ax:null)})});if(x(at.parentNode,Y,ag)){c.remove(at,1);at=0;return B}if(ah.merge_with_parents){c.getParent(at.parentNode,function(av){if(x(av,Y,ag)){c.remove(at,1);at=0;return B}})}if(at&&ah.merge_siblings!==false){at=u(C(at),at);at=u(at,C(at,B))}}})}if(ah){if(ab){if(ab.nodeType){W=c.createRng();W.setStartBefore(ab);W.setEndAfter(ab);ai(o(W,ac),null,true)}else{ai(ab,null,true)}}else{if(!ad||!ah.inline||c.select("td.mceSelected,th.mceSelected").length){var aj=U.selection.getNode();U.selection.setRng(aa());af=q.getBookmark();ai(o(q.getRng(B),ac),af);if(ah.styles&&(ah.styles.color||ah.styles.textDecoration)){a.walk(aj,I,"childNodes");I(aj)}q.moveToBookmark(af);q.setRng(Z(q.getRng(B)));U.nodeChanged()}else{P("apply",Y,ag)}}}}function A(X,ag,aa){var ab=Q(X),ai=ab[0],af,ae,W;function Z(al){var ak=al.startContainer,aq=al.startOffset,ap,ao,am,an;if(ak.nodeType==3&&aq>=ak.nodeValue.length-1){ak=ak.parentNode;aq=s(ak)+1}if(ak.nodeType==1){am=ak.childNodes;ak=am[Math.min(aq,am.length-1)];ap=new t(ak);if(aq>am.length-1){ap.next()}for(ao=ap.current();ao;ao=ap.next()){if(ao.nodeType==3&&!f(ao)){an=c.create("a",null,E);ao.parentNode.insertBefore(an,ao);al.setStart(ao,0);q.setRng(al);c.remove(an);return}}}}function Y(an){var am,al,ak;am=a.grep(an.childNodes);for(al=0,ak=ab.length;al=0;W--){V=ab[W].selector;if(!V){return B}for(aa=X.length-1;aa>=0;aa--){if(c.is(X[aa],V)){return B}}}}return R}a.extend(this,{get:Q,register:k,apply:S,remove:A,toggle:D,match:j,matchAll:v,matchNode:x,canApply:y});function h(V,W){if(g(V,W.inline)){return B}if(g(V,W.block)){return B}if(W.selector){return c.is(V,W.selector)}}function g(W,V){W=W||"";V=V||"";W=""+(W.nodeName||W);V=""+(V.nodeName||V);return W.toLowerCase()==V.toLowerCase()}function L(W,V){var X=c.getStyle(W,V);if(V=="color"||V=="backgroundColor"){X=c.toHex(X)}if(V=="fontWeight"&&X==700){X="bold"}return""+X}function r(V,W){if(typeof(V)!="string"){V=V(W)}else{if(W){V=V.replace(/%(\w+)/g,function(Y,X){return W[X]||Y})}}return V}function f(V){return V&&V.nodeType===3&&/^([\t \r\n]+|)$/.test(V.nodeValue)}function N(X,W,V){var Y=c.create(W,V);X.parentNode.insertBefore(Y,X);Y.appendChild(X);return Y}function o(V,ah,Y){var X=V.startContainer,ac=V.startOffset,ak=V.endContainer,ae=V.endOffset,aj,ag,ab,af;function ai(aq){var al,ao,ap,an,am;al=ao=aq?X:ak;am=aq?"previousSibling":"nextSibling";root=c.getRoot();if(al.nodeType==3&&!f(al)){if(aq?ac>0:aeag?ag:ac];if(X.nodeType==3){ac=0}}if(ak.nodeType==1&&ak.hasChildNodes()){ag=ak.childNodes.length-1;ak=ak.childNodes[ae>ag?ag:ae-1];if(ak.nodeType==3){ae=ak.nodeValue.length}}if(H(X.parentNode)||H(X)){X=H(X)?X:X.parentNode;X=X.nextSibling||X;if(X.nodeType==3){ac=0}}if(H(ak.parentNode)||H(ak)){ak=H(ak)?ak:ak.parentNode;ak=ak.previousSibling||ak;if(ak.nodeType==3){ae=ak.length}}if(ah[0].inline){if(V.collapsed){function ad(am,aq,at){var ap,an,ar,al;function ao(av,ax){var ay,au,aw=av.nodeValue;if(typeof(ax)=="undefined"){ax=at?aw.length:0}if(at){ay=aw.lastIndexOf(" ",ax);au=aw.lastIndexOf("\u00a0",ax);ay=ay>au?ay:au;if(ay!==-1&&!Y){ay++}}else{ay=aw.indexOf(" ",ax);au=aw.indexOf("\u00a0",ax);ay=ay!==-1&&(au===-1||ay0&&ab.node.nodeType===3&&ab.node.nodeValue.charAt(ab.offset-1)===" "){if(ab.offset>1){ak=ab.node;ak.splitText(ab.offset-1)}else{if(ab.node.previousSibling){}}}}}if(ah[0].inline||ah[0].block_expand){if(!ah[0].inline||(X.nodeType!=3||ac===0)){X=ai(true)}if(!ah[0].inline||(ak.nodeType!=3||ae===ak.nodeValue.length)){ak=ai()}}if(ah[0].selector&&ah[0].expand!==R&&!ah[0].inline){function Z(am,al){var an,ao,aq,ap;if(am.nodeType==3&&am.nodeValue.length==0&&am[al]){am=am[al]}an=m(am);for(ao=0;aoX?X:Z]}if(V.nodeType===3&&aa&&Z>=V.nodeValue.length){V=new t(V,U.getBody()).next()||V}if(V.nodeType===3&&!aa&&Z==0){V=new t(V,U.getBody()).prev()||V}return V}function P(ae,V,ac){var ah,af="_mce_caret",W=U.settings.caret_debug;ah=a.isGecko?"\u200B":E;function X(aj){var ai=c.create("span",{id:af,"data-mce-bogus":true,style:W?"color:red":""});if(aj){ai.appendChild(U.getDoc().createTextNode(ah))}return ai}function ad(aj,ai){while(aj){if((aj.nodeType===3&&aj.nodeValue!==ah)||aj.childNodes.length>1){return false}if(ai&&aj.nodeType===1){ai.push(aj)}aj=aj.firstChild}return true}function aa(ai){while(ai){if(ai.id===af){return ai}ai=ai.parentNode}}function Z(ai){var aj;if(ai){aj=new t(ai,ai);for(ai=aj.current();ai;ai=aj.next()){if(ai.nodeType===3){return ai}}}}function Y(ak,aj){var al,ai;if(!ak){ak=aa(q.getStart());if(!ak){while(ak=c.get(af)){Y(ak,false)}}}else{ai=q.getRng(true);if(ad(ak)){if(aj!==false){ai.setStartBefore(ak);ai.setEndBefore(ak)}c.remove(ak)}else{al=Z(ak);al=al.deleteData(0,1);c.remove(ak,1)}q.setRng(ai)}}function ab(){var ak,ai,ao,an,al,aj,am;ak=q.getRng(true);an=ak.startOffset;aj=ak.startContainer;am=aj.nodeValue;ai=aa(q.getStart());if(ai){ao=Z(ai)}if(am&&an>0&&an=0;am--){ak.appendChild(aq[am].cloneNode(false));ak=ak.firstChild}ak.appendChild(c.doc.createTextNode(ah));ak=ak.firstChild;c.insertAfter(ap,ar);q.setCursorLocation(ak,1)}}U.onBeforeGetContent.addToTop(function(){var ai=[],aj;if(ad(aa(q.getStart()),ai)){aj=ai.length;while(aj--){c.setAttrib(ai[aj],"data-mce-bogus","1")}}});a.each("onMouseUp onKeyUp".split(" "),function(ai){U[ai].addToTop(function(){Y()})});U.onKeyDown.addToTop(function(ai,ak){var aj=ak.keyCode;if(aj==8||aj==37||aj==39){Y(aa(q.getStart()))}});if(ae=="apply"){ab()}else{ag()}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;if(c.inline_styles){h=e.explode(c.font_size_legacy_values);function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}}); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_dev.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_dev.js deleted file mode 100644 index 730c7aea3d76..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_dev.js +++ /dev/null @@ -1,133 +0,0 @@ -/** - * tiny_mce_dev.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - * - * This file should only be used while developing TinyMCE - * tiny_mce.js or tiny_mce_src.js should be used in a production environment. - * This file loads the js files from classes instead of a merged copy. - */ - -(function() { - var i, nl = document.getElementsByTagName('script'), base, src, p, li, query = '', it, scripts = []; - - if (window.tinyMCEPreInit) { - base = tinyMCEPreInit.base; - query = tinyMCEPreInit.query || ''; - } else { - for (i=0; i\n'; - - document.write(html); - }; - - // Firebug - if (query.debug && !("console" in window)) { - include('firebug/firebug-lite.js'); - } - - // Core ns - include('tinymce.js'); - - // Load framework adapter - if (query.api) - include('adapter/' + query.api + '/adapter.js'); - - // tinymce.util.* - include('util/Dispatcher.js'); - include('util/URI.js'); - include('util/Cookie.js'); - include('util/JSON.js'); - include('util/JSONP.js'); - include('util/XHR.js'); - include('util/JSONRequest.js'); - include('util/VK.js'); - include('util/Quirks.js'); - - // tinymce.html.* - include('html/Entities.js'); - include('html/Styles.js'); - include('html/Schema.js'); - include('html/SaxParser.js'); - include('html/Node.js'); - include('html/DomParser.js'); - include('html/Serializer.js'); - include('html/Writer.js'); - - // tinymce.dom.* - include('dom/DOMUtils.js'); - include('dom/Range.js'); - include('dom/TridentSelection.js'); - include('dom/Sizzle.js'); - include('dom/EventUtils.js'); - include('dom/Element.js'); - include('dom/Selection.js'); - include('dom/Serializer.js'); - include('dom/ScriptLoader.js'); - include('dom/TreeWalker.js'); - include('dom/RangeUtils.js'); - - // tinymce.ui.* - include('ui/KeyboardNavigation.js'); - include('ui/Control.js'); - include('ui/Container.js'); - include('ui/Separator.js'); - include('ui/MenuItem.js'); - include('ui/Menu.js'); - include('ui/DropMenu.js'); - include('ui/Button.js'); - include('ui/ListBox.js'); - include('ui/NativeListBox.js'); - include('ui/MenuButton.js'); - include('ui/SplitButton.js'); - include('ui/ColorSplitButton.js'); - include('ui/ToolbarGroup.js'); - include('ui/Toolbar.js'); - - // tinymce.* - include('AddOnManager.js'); - include('EditorManager.js'); - include('Editor.js'); - include('EditorCommands.js'); - include('UndoManager.js'); - include('ForceBlocks.js'); - include('ControlManager.js'); - include('WindowManager.js'); - include('Formatter.js'); - include('LegacyInput.js'); - - load(); -}()); diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_jquery.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_jquery.js deleted file mode 100644 index 7a149a6c0761..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_jquery.js +++ /dev/null @@ -1 +0,0 @@ -(function(d){var a=/^\s*|\s*$/g,e,c="B".replace(/A(.)|B/,"$1")==="$1";var b={majorVersion:"3",minorVersion:"4.7",releaseDate:"2011-11-03",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=d.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isIE7=s.isIE&&/MSIE [7]/.test(g);s.isIE8=s.isIE&&/MSIE [8]/.test(g);s.isIE9=s.isIE&&/MSIE [9]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWebKit\/(\d*)/)[1]>=534;if(d.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m=c.length){for(e=0,b=g.length;e=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toUTCString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();(function(){function serialize(o,quote){var i,v,t;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){if(quote==='"'&&a==="'"){return a}i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&o instanceof Array){for(i=0,v="[";i0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(i in o){if(o.hasOwnProperty(i)){v+=typeof o[i]!="function"?(v.length>1?","+quote:quote)+i+quote+":"+serialize(o[i],quote):""}}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(a){a.VK={DELETE:46,BACKSPACE:8,ENTER:13,TAB:9,SPACEBAR:32,UP:38,DOWN:40}})(tinymce);(function(k){var i=k.VK,j=i.BACKSPACE,h=i.DELETE;function c(m){var o=m.dom,n=m.selection;m.onKeyDown.add(function(q,u){var p,v,s,t,r;r=u.keyCode==h;if(r||u.keyCode==j){u.preventDefault();p=n.getRng();v=o.getParent(p.startContainer,o.isBlock);if(r){v=o.getNext(v,o.isBlock)}if(v){s=v.firstChild;while(s&&s.nodeType==3&&s.nodeValue.length==0){s=s.nextSibling}if(s&&s.nodeName==="SPAN"){t=s.cloneNode(false)}}q.getDoc().execCommand(r?"ForwardDelete":"Delete",false,null);v=o.getParent(p.startContainer,o.isBlock);k.each(o.select("span.Apple-style-span,font.Apple-style-span",v),function(x){var y=n.getBookmark();if(t){o.replace(t.cloneNode(false),x,true)}else{o.remove(x,true)}n.moveToBookmark(y)})}})}function d(m){m.onKeyUp.add(function(n,p){var o=p.keyCode;if(o==h||o==j){if(n.dom.isEmpty(n.getBody())){n.setContent("",{format:"raw"});n.nodeChanged();return}}})}function b(m){m.dom.bind(m.getDoc(),"focusin",function(){m.selection.setRng(m.selection.getRng())})}function e(m){m.onKeyDown.add(function(n,q){if(q.keyCode===j){if(n.selection.isCollapsed()&&n.selection.getRng(true).startOffset===0){var p=n.selection.getNode();var o=p.previousSibling;if(o&&o.nodeName&&o.nodeName.toLowerCase()==="hr"){n.dom.remove(o);k.dom.Event.cancel(q)}}}})}function g(m){if(!Range.prototype.getClientRects){m.onMouseDown.add(function(o,p){if(p.target.nodeName==="HTML"){var n=o.getBody();n.blur();setTimeout(function(){n.focus()},0)}})}}function f(m){m.onClick.add(function(n,o){o=o.target;if(/^(IMG|HR)$/.test(o.nodeName)){n.selection.select(o)}if(o.nodeName=="A"&&n.dom.hasClass(o,"mceItemAnchor")){n.selection.select(o)}n.nodeChanged()})}function l(m){var o,n;m.dom.bind(m.getDoc(),"selectionchange",function(){if(n){clearTimeout(n);n=0}n=window.setTimeout(function(){var p=m.selection.getRng();if(!o||!k.dom.RangeUtils.compareRanges(p,o)){m.nodeChanged();o=p}},50)})}function a(m){document.body.setAttribute("role","application")}k.create("tinymce.util.Quirks",{Quirks:function(m){if(k.isWebKit){c(m);d(m);b(m);f(m);if(k.isIDevice){l(m)}}if(k.isIE){e(m);d(m);a(m)}if(k.isGecko){e(m);g(m)}}})})(tinymce);(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};g={'"':""","'":"'","<":"<",">":">","&":"&"};d={"<":"<",">":">","&":"&",""":'"',"'":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(r){var y={},p,n,v,q,u=d.url_converter,x=d.url_converter_scope||this;function o(C,F){var E,B,A,D;E=y[C+"-top"+F];if(!E){return}B=y[C+"-right"+F];if(E!=B){return}A=y[C+"-bottom"+F];if(B!=A){return}D=y[C+"-left"+F];if(A!=D){return}y[C+F]=D;delete y[C+"-top"+F];delete y[C+"-right"+F];delete y[C+"-bottom"+F];delete y[C+"-left"+F]}function t(B){var C=y[B],A;if(!C||C.indexOf(" ")<0){return}C=C.split(" ");A=C.length;while(A--){if(C[A]!==C[0]){return false}}y[B]=C[0];return true}function z(C,B,A,D){if(!t(B)){return}if(!t(A)){return}if(!t(D)){return}y[C]=y[B]+" "+y[A]+" "+y[D];delete y[B];delete y[A];delete y[D]}function s(A){q=true;return a[A]}function i(B,A){if(q){B=B.replace(/\uFEFF[0-9]/g,function(C){return a[C]})}if(!A){B=B.replace(/\\([\'\";:])/g,"$1")}return B}if(r){r=r.replace(/\\[\"\';:\uFEFF]/g,s).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(A){return A.replace(/[;:]/g,s)});while(p=b.exec(r)){n=p[1].replace(l,"").toLowerCase();v=p[2].replace(l,"");if(n&&v.length>0){if(n==="font-weight"&&v==="700"){v="bold"}else{if(n==="color"||n==="background-color"){v=v.toLowerCase()}}v=v.replace(k,c);v=v.replace(h,function(B,A,E,D,F,C){F=F||C;if(F){F=i(F);return"'"+F.replace(/\'/g,"\\'")+"'"}A=i(A||E||D);if(u){A=u.call(x,A,"style")}return"url('"+A.replace(/\'/g,"\\'")+"')"});y[n]=q?i(v,true):v}b.lastIndex=p.index+p[0].length}o("border","");o("border","-width");o("border","-color");o("border","-style");o("padding","");o("margin","");z("border","border-width","border-style","border-color");if(y.border==="medium none"){delete y.border}}return y},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(m){var h={},j,l,g,f,c={},b,e,d=m.makeMap,k=m.each;function i(o,n){return o.split(n||",")}function a(r,q){var o,p={};function n(s){return s.replace(/[A-Z]+/g,function(t){return n(r[t])})}for(o in r){if(r.hasOwnProperty(o)){r[o]=n(r[o])}}n(q).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(v,t,s,u){s=i(s,"|");p[t]={attributes:d(s),attributesOrder:s,children:d(u,"|",{"#comment":{}})}});return p}l="h1,h2,h3,h4,h5,h6,hr,p,div,address,pre,form,table,tbody,thead,tfoot,th,tr,td,li,ol,ul,caption,blockquote,center,dl,dt,dd,dir,fieldset,noscript,menu,isindex,samp,header,footer,article,section,hgroup";l=d(l,",",d(l.toUpperCase()));h=a({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]");j=d("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected,autoplay,loop,controls");g=d("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,source");f=m.extend(d("td,th,iframe,video,audio,object"),g);b=d("pre,script,style,textarea");e=d("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");m.html.Schema=function(r){var A=this,n={},o={},y=[],q,p;r=r||{};if(r.verify_html===false){r.valid_elements="*[*]"}if(r.valid_styles){q={};k(r.valid_styles,function(C,B){q[B]=m.explode(C)})}p=r.whitespace_elements?d(r.whitespace_elements):b;function z(B){return new RegExp("^"+B.replace(/([?+*])/g,".$1")+"$")}function t(I){var H,D,W,S,X,C,F,R,U,N,V,Z,L,G,T,B,P,E,Y,aa,M,Q,K=/^([#+-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,O=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,J=/[*?+]/;if(I){I=i(I);if(n["@"]){P=n["@"].attributes;E=n["@"].attributesOrder}for(H=0,D=I.length;H=0){for(T=z.length-1;T>=U;T--){S=z[T];if(S.valid){n.end(S.name)}}z.length=U}}l=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([^\\s\\/<>]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/)>))","g");C=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;J={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};L=e.getShortEndedElements();I=e.getSelfClosingElements();G=e.getBoolAttrs();u=c.validate;r=c.remove_internals;x=c.fix_self_closing;p=a.isIE;o=/^:/;while(g=l.exec(D)){if(F0&&z[z.length-1].name===H){t(H)}if(!u||(m=e.getElementRule(H))){k=true;if(u){O=m.attributes;E=m.attributePatterns}if(Q=g[8]){y=Q.indexOf("data-mce-type")!==-1;if(y&&r){k=false}M=[];M.map={};Q.replace(C,function(T,S,X,W,V){var Y,U;S=S.toLowerCase();X=S in G?S:j(X||W||V||"");if(u&&!y&&S.indexOf("data-")!==0){Y=O[S];if(!Y&&E){U=E.length;while(U--){Y=E[U];if(Y.pattern.test(S)){break}}if(U===-1){Y=null}}if(!Y){return}if(Y.validValues&&!(X in Y.validValues)){return}}M.map[S]=X;M.push({name:S,value:X})})}else{M=[];M.map={}}if(u&&!y){R=m.attributesRequired;K=m.attributesDefault;f=m.attributesForced;if(f){P=f.length;while(P--){s=f[P];q=s.name;h=s.value;if(h==="{$uid}"){h="mce_"+v++}M.map[q]=h;M.push({name:q,value:h})}}if(K){P=K.length;while(P--){s=K[P];q=s.name;if(!(q in M.map)){h=s.value;if(h==="{$uid}"){h="mce_"+v++}M.map[q]=h;M.push({name:q,value:h})}}}if(R){P=R.length;while(P--){if(R[P] in M.map){break}}if(P===-1){k=false}}if(M.map["data-mce-bogus"]){k=false}}if(k){n.start(H,M,N)}}else{k=false}if(A=J[H]){A.lastIndex=F=g.index+g[0].length;if(g=A.exec(D)){if(k){B=D.substr(F,g.index-F)}F=g.index+g[0].length}else{B=D.substr(F);F=D.length}if(k&&B.length>0){n.text(B,true)}if(k){n.end(H)}l.lastIndex=F;continue}if(!N){if(!Q||Q.indexOf("/")!=Q.length-1){z.push({name:H,valid:k})}else{if(k){n.end(H)}}}}else{if(H=g[1]){n.comment(H)}else{if(H=g[2]){n.cdata(H)}else{if(H=g[3]){n.doctype(H)}else{if(H=g[4]){n.pi(H,g[5])}}}}}}F=g.index+g[0].length}if(F=0;P--){H=z[P];if(H.valid){n.end(H.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h1){v.reverse();z=n=f.filterNode(v[0].clone());for(t=0;t0){N.value=l;N=N.prev}else{L=N.prev;N.remove();N=L}}}n=new b.html.SaxParser({validate:y,fix_self_closing:!y,cdata:function(l){A.append(I("#cdata",4)).value=l},text:function(M,l){var L;if(!s[A.name]){M=M.replace(k," ");if(A.lastChild&&o[A.lastChild.name]){M=M.replace(D,"")}}if(M.length!==0){L=I("#text",3);L.raw=!!l;A.append(L).value=M}},comment:function(l){A.append(I("#comment",8)).value=l},pi:function(l,L){A.append(I(l,7)).value=L;G(A)},doctype:function(L){var l;l=A.append(I("#doctype",10));l.value=L;G(A)},start:function(l,T,M){var R,O,N,L,P,U,S,Q;N=y?h.getElementRule(l):{};if(N){R=I(N.outputName||l,1);R.attributes=T;R.shortEnded=M;A.append(R);Q=p[A.name];if(Q&&p[R.name]&&!Q[R.name]){J.push(R)}O=d.length;while(O--){P=d[O].name;if(P in T.map){E=c[P];if(E){E.push(R)}else{c[P]=[R]}}}if(o[l]){G(R)}if(!M){A=R}}},end:function(l){var P,M,O,L,N;M=y?h.getElementRule(l):{};if(M){if(o[l]){if(!s[A.name]){for(P=A.firstChild;P&&P.type===3;){O=P.value.replace(D,"");if(O.length>0){P.value=O;P=P.next}else{L=P.next;P.remove();P=L}}for(P=A.lastChild;P&&P.type===3;){O=P.value.replace(t,"");if(O.length>0){P.value=O;P=P.prev}else{L=P.prev;P.remove();P=L}}}P=A.prev;if(P&&P.type===3){O=P.value.replace(D,"");if(O.length>0){P.value=O}else{P.remove()}}}if(M.removeEmpty||M.paddEmpty){if(A.isEmpty(u)){if(M.paddEmpty){A.empty().append(new a("#text","3")).value="\u00a0"}else{if(!A.attributes.map.name){N=A.parent;A.empty().remove();A=N;return}}}}A=A.parent}}},h);H=A=new a(m.context||g.root_name,11);n.parse(v);if(y&&J.length){if(!m.context){j(J)}else{m.invalid=true}}if(q&&H.name=="body"){F()}if(!m.invalid){for(K in i){E=e[K];z=i[K];x=z.length;while(x--){if(!z[x].parent){z.splice(x,1)}}for(C=0,B=E.length;C0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("")},comment:function(h){c.push("")},pi:function(h,i){if(i){c.push("")}else{c.push("")}if(a){c.push("\n")}},doctype:function(h){c.push("",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n=8;l.boxModel=!h.isIE||o.compatMode=="CSS1Compat"||l.stdMode;l.hasOuterHTML="outerHTML" in o.createElement("a");l.settings=m=h.extend({keep_values:false,hex_colors:1},m);l.schema=m.schema;l.styles=new h.html.Styles({url_converter:m.url_converter,url_converter_scope:m.url_converter_scope},m.schema);if(h.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(n){l.cssFlicker=true}}if(b&&m.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(p){o.createElement(p)});for(k in m.schema.getCustomElements()){o.createElement(k)}}h.addUnload(l.destroy,l)},getRoot:function(){var j=this,k=j.settings;return(k&&j.get(k.root_element))||j.doc.body},getViewPort:function(k){var l,j;k=!k?this.win:k;l=k.document;j=this.boxModel?l.documentElement:l.body;return{x:k.pageXOffset||j.scrollLeft,y:k.pageYOffset||j.scrollTop,w:k.innerWidth||j.clientWidth,h:k.innerHeight||j.clientHeight}},getRect:function(m){var l,j=this,k;m=j.get(m);l=j.getPos(m);k=j.getSize(m);return{x:l.x,y:l.y,w:k.w,h:k.h}},getSize:function(m){var k=this,j,l;m=k.get(m);j=k.getStyle(m,"width");l=k.getStyle(m,"height");if(j.indexOf("px")===-1){j=0}if(l.indexOf("px")===-1){l=0}return{w:parseInt(j)||m.offsetWidth||m.clientWidth,h:parseInt(l)||m.offsetHeight||m.clientHeight}},getParent:function(l,k,j){return this.getParents(l,k,j,false)},getParents:function(u,p,l,s){var k=this,j,m=k.settings,q=[];u=k.get(u);s=s===undefined;if(m.strict_root){l=l||k.getRoot()}if(e(p,"string")){j=p;if(p==="*"){p=function(o){return o.nodeType==1}}else{p=function(o){return k.is(o,j)}}}while(u){if(u==l||!u.nodeType||u.nodeType===9){break}if(!p||p(u)){if(s){q.push(u)}else{return u}}u=u.parentNode}return s?q:null},get:function(j){var k;if(j&&this.doc&&typeof(j)=="string"){k=j;j=this.doc.getElementById(j);if(j&&j.id!==k){return this.doc.getElementsByName(k)[1]}}return j},getNext:function(k,j){return this._findSib(k,j,"nextSibling")},getPrev:function(k,j){return this._findSib(k,j,"previousSibling")},add:function(m,q,j,l,o){var k=this;return this.run(m,function(s){var r,n;r=e(q,"string")?k.doc.createElement(q):q;k.setAttribs(r,j);if(l){if(l.nodeType){r.appendChild(l)}else{k.setHTML(r,l)}}return !o?s.appendChild(r):r})},create:function(l,j,k){return this.add(this.doc.createElement(l),l,j,k,1)},createHTML:function(r,j,p){var q="",m=this,l;q+="<"+r;for(l in j){if(j.hasOwnProperty(l)){q+=" "+l+'="'+m.encode(j[l])+'"'}}if(typeof(p)!="undefined"){return q+">"+p+""}return q+" />"},remove:function(j,k){return this.run(j,function(m){var n,l=m.parentNode;if(!l){return null}if(k){while(n=m.firstChild){if(!h.isIE||n.nodeType!==3||n.nodeValue){l.insertBefore(n,m)}else{m.removeChild(n)}}}return l.removeChild(m)})},setStyle:function(m,j,k){var l=this;return l.run(m,function(p){var o,n;o=p.style;j=j.replace(/-(\D)/g,function(r,q){return q.toUpperCase()});if(l.pixelStyles.test(j)&&(h.is(k,"number")||/^[\-0-9\.]+$/.test(k))){k+="px"}switch(j){case"opacity":if(b){o.filter=k===""?"":"alpha(opacity="+(k*100)+")";if(!m.currentStyle||!m.currentStyle.hasLayout){o.display="inline-block"}}o[j]=o["-moz-opacity"]=o["-khtml-opacity"]=k||"";break;case"float":b?o.styleFloat=k:o.cssFloat=k;break;default:o[j]=k||""}if(l.settings.update_styles){l.setAttrib(p,"data-mce-style")}})},getStyle:function(m,j,l){m=this.get(m);if(!m){return}if(this.doc.defaultView&&l){j=j.replace(/[A-Z]/g,function(n){return"-"+n});try{return this.doc.defaultView.getComputedStyle(m,null).getPropertyValue(j)}catch(k){return null}}j=j.replace(/-(\D)/g,function(o,n){return n.toUpperCase()});if(j=="float"){j=b?"styleFloat":"cssFloat"}if(m.currentStyle&&l){return m.currentStyle[j]}return m.style?m.style[j]:undefined},setStyles:function(m,n){var k=this,l=k.settings,j;j=l.update_styles;l.update_styles=0;f(n,function(o,p){k.setStyle(m,p,o)});l.update_styles=j;if(l.update_styles){k.setAttrib(m,l.cssText)}},removeAllAttribs:function(j){return this.run(j,function(m){var l,k=m.attributes;for(l=k.length-1;l>=0;l--){m.removeAttributeNode(k.item(l))}})},setAttrib:function(l,m,j){var k=this;if(!l||!m){return}if(k.settings.strict){m=m.toLowerCase()}return this.run(l,function(o){var n=k.settings;if(j!==null){switch(m){case"style":if(!e(j,"string")){f(j,function(p,q){k.setStyle(o,q,p)});return}if(n.keep_values){if(j&&!k._isRes(j)){o.setAttribute("data-mce-style",j,2)}else{o.removeAttribute("data-mce-style",2)}}o.style.cssText=j;break;case"class":o.className=j||"";break;case"src":case"href":if(n.keep_values){if(n.url_converter){j=n.url_converter.call(n.url_converter_scope||k,j,m,o)}k.setAttrib(o,"data-mce-"+m,j,2)}break;case"shape":o.setAttribute("data-mce-style",j);break}}if(e(j)&&j!==null&&j.length!==0){o.setAttribute(m,""+j,2)}else{o.removeAttribute(m,2)}})},setAttribs:function(k,l){var j=this;return this.run(k,function(m){f(l,function(o,p){j.setAttrib(m,p,o)})})},getAttrib:function(o,p,l){var j,k=this,m;o=k.get(o);if(!o||o.nodeType!==1){return l===m?false:l}if(!e(l)){l=""}if(/^(src|href|style|coords|shape)$/.test(p)){j=o.getAttribute("data-mce-"+p);if(j){return j}}if(b&&k.props[p]){j=o[k.props[p]];j=j&&j.nodeValue?j.nodeValue:j}if(!j){j=o.getAttribute(p,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(p)){if(o[k.props[p]]===true&&j===""){return p}return j?p:""}if(o.nodeName==="FORM"&&o.getAttributeNode(p)){return o.getAttributeNode(p).nodeValue}if(p==="style"){j=j||o.style.cssText;if(j){j=k.serializeStyle(k.parseStyle(j),o.nodeName);if(k.settings.keep_values&&!k._isRes(j)){o.setAttribute("data-mce-style",j)}}}if(d&&p==="class"&&j){j=j.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(p){case"rowspan":case"colspan":if(j===1){j=""}break;case"size":if(j==="+0"||j===20||j===0){j=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(j===0){j=""}break;case"hspace":if(j===-1){j=""}break;case"maxlength":case"tabindex":if(j===32768||j===2147483647||j==="32768"){j=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(j===65535){return p}return l;case"shape":j=j.toLowerCase();break;default:if(p.indexOf("on")===0&&j){j=h._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+j)}}}return(j!==m&&j!==null&&j!=="")?""+j:l},getPos:function(s,m){var k=this,j=0,q=0,o,p=k.doc,l;s=k.get(s);m=m||p.body;if(s){if(s.getBoundingClientRect){s=s.getBoundingClientRect();o=k.boxModel?p.documentElement:p.body;j=s.left+(p.documentElement.scrollLeft||p.body.scrollLeft)-o.clientTop;q=s.top+(p.documentElement.scrollTop||p.body.scrollTop)-o.clientLeft;return{x:j,y:q}}l=s;while(l&&l!=m&&l.nodeType){j+=l.offsetLeft||0;q+=l.offsetTop||0;l=l.offsetParent}l=s.parentNode;while(l&&l!=m&&l.nodeType){j-=l.scrollLeft||0;q-=l.scrollTop||0;l=l.parentNode}}return{x:j,y:q}},parseStyle:function(j){return this.styles.parse(j)},serializeStyle:function(k,j){return this.styles.serialize(k,j)},loadCSS:function(j){var l=this,m=l.doc,k;if(!j){j=""}k=l.select("head")[0];f(j.split(","),function(n){var o;if(l.files[n]){return}l.files[n]=true;o=l.create("link",{rel:"stylesheet",href:h._addVer(n)});if(b&&m.documentMode&&m.recalc){o.onload=function(){if(m.recalc){m.recalc()}o.onload=null}}k.appendChild(o)})},addClass:function(j,k){return this.run(j,function(l){var m;if(!k){return 0}if(this.hasClass(l,k)){return l.className}m=this.removeClass(l,k);return l.className=(m!=""?(m+" "):"")+k})},removeClass:function(l,m){var j=this,k;return j.run(l,function(o){var n;if(j.hasClass(o,m)){if(!k){k=new RegExp("(^|\\s+)"+m+"(\\s+|$)","g")}n=o.className.replace(k," ");n=h.trim(n!=" "?n:"");o.className=n;if(!n){o.removeAttribute("class");o.removeAttribute("className")}return n}return o.className})},hasClass:function(k,j){k=this.get(k);if(!k||!j){return false}return(" "+k.className+" ").indexOf(" "+j+" ")!==-1},show:function(j){return this.setStyle(j,"display","block")},hide:function(j){return this.setStyle(j,"display","none")},isHidden:function(j){j=this.get(j);return !j||j.style.display=="none"||this.getStyle(j,"display")=="none"},uniqueId:function(j){return(!j?"mce_":j)+(this.counter++)},setHTML:function(l,k){var j=this;return j.run(l,function(n){if(b){while(n.firstChild){n.removeChild(n.firstChild)}try{n.innerHTML="
"+k;n.removeChild(n.firstChild)}catch(m){n=j.create("div");n.innerHTML="
"+k;f(n.childNodes,function(p,o){if(o){n.appendChild(p)}})}}else{n.innerHTML=k}return k})},getOuterHTML:function(l){var k,j=this;l=j.get(l);if(!l){return null}if(l.nodeType===1&&j.hasOuterHTML){return l.outerHTML}k=(l.ownerDocument||j.doc).createElement("body");k.appendChild(l.cloneNode(true));return k.innerHTML},setOuterHTML:function(m,k,n){var j=this;function l(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){j.insertAfter(s.cloneNode(true),p);s=s.previousSibling}j.remove(p)}return this.run(m,function(p){p=j.get(p);if(p.nodeType==1){n=n||p.ownerDocument||j.doc;if(b){try{if(b&&p.nodeType==1){p.outerHTML=k}else{l(p,k,n)}}catch(o){l(p,k,n)}}else{l(p,k,n)}}})},decode:c.decode,encode:c.encodeAllRaw,insertAfter:function(j,k){k=this.get(k);return this.run(j,function(m){var l,n;l=k.parentNode;n=k.nextSibling;if(n){l.insertBefore(m,n)}else{l.appendChild(m)}return m})},isBlock:function(k){var j=k.nodeType;if(j){return !!(j===1&&g[k.nodeName])}return !!g[k]},replace:function(p,m,j){var l=this;if(e(m,"array")){p=p.cloneNode(true)}return l.run(m,function(k){if(j){f(h.grep(k.childNodes),function(n){p.appendChild(n)})}return k.parentNode.replaceChild(p,k)})},rename:function(m,j){var l=this,k;if(m.nodeName!=j.toUpperCase()){k=l.create(j);f(l.getAttribs(m),function(n){l.setAttrib(k,n.nodeName,l.getAttrib(m,n.nodeName))});l.replace(k,m,1)}return k||m},findCommonAncestor:function(l,j){var m=l,k;while(m){k=j;while(k&&m!=k){k=k.parentNode}if(m==k){break}m=m.parentNode}if(!m&&l.ownerDocument){return l.ownerDocument.documentElement}return m},toHex:function(j){var l=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(j);function k(m){m=parseInt(m).toString(16);return m.length>1?m:"0"+m}if(l){j="#"+k(l[1])+k(l[2])+k(l[3]);return j}return j},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(r){f(r.imports,function(s){q(s)});f(r.cssRules||r.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){f(s.selectorText.split(","),function(t){t=t.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(t)||!/\.[\w\-]+$/.test(t)){return}l=t;t=h._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",t);if(p&&!(t=p(t,l))){return}if(!o[t]){j.push({"class":t});o[t]=1}})}break;case 3:q(s.styleSheet);break}})}try{f(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(m,l,k){var j=this,n;if(j.doc&&typeof(m)==="string"){m=j.get(m)}if(!m){return false}k=k||this;if(!m.nodeType&&(m.length||m.length===0)){n=[];f(m,function(p,o){if(p){if(typeof(p)=="string"){p=j.doc.getElementById(p)}n.push(l.call(k,p,o))}});return n}return l.call(k,m)},getAttribs:function(k){var j;k=this.get(k);if(!k){return[]}if(b){j=[];if(k.nodeName=="OBJECT"){return k.attributes}if(k.nodeName==="OPTION"&&this.getAttrib(k,"selected")){j.push({specified:1,nodeName:"selected"})}k.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(l){j.push({specified:1,nodeName:l})});return j}return k.attributes},isEmpty:function(m,k){var r=this,o,n,q,j,l,p;m=m.firstChild;if(m){j=new h.dom.TreeWalker(m);k=k||r.schema?r.schema.getNonEmptyElements():null;do{q=m.nodeType;if(q===1){if(m.getAttribute("data-mce-bogus")){continue}l=m.nodeName.toLowerCase();if(k&&k[l]){p=m.parentNode;if(l==="br"&&r.isBlock(p)&&p.firstChild===m&&p.lastChild===m){continue}return false}n=r.getAttribs(m);o=m.attributes.length;while(o--){l=m.attributes[o].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if((q===3&&!i.test(m.nodeValue))){return false}}while(m=j.next())}return true},destroy:function(k){var j=this;if(j.events){j.events.destroy()}j.win=j.doc=j.root=j.events=null;if(!k){h.removeUnload(j.destroy)}},createRng:function(){var j=this.doc;return j.createRange?j.createRange():new h.dom.Range(this)},nodeIndex:function(n,o){var j=0,l,m,k;if(n){for(l=n.nodeType,n=n.previousSibling,m=n;n;n=n.previousSibling){k=n.nodeType;if(o&&k==3){if(k==l||!n.nodeValue.length){continue}}j++;l=k}}return j},split:function(n,m,q){var s=this,j=s.createRng(),o,l,p;function k(v){var t,r=v.childNodes,u=v.nodeType;if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=r.length-1;t>=0;t--){k(r[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){if(!s.isBlock(v.parentNode)||h.trim(v.nodeValue).length>0){return}}else{if(u==1){r=v.childNodes;if(r.length==1&&r[0]&&r[0].nodeType==1&&r[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(r[0],v)}if(r.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}s.remove(v)}return v}if(n&&m){j.setStart(n.parentNode,s.nodeIndex(n));j.setEnd(m.parentNode,s.nodeIndex(m));o=j.extractContents();j=s.createRng();j.setStart(m.parentNode,s.nodeIndex(m)+1);j.setEnd(n.parentNode,s.nodeIndex(n)+1);l=j.extractContents();p=n.parentNode;p.insertBefore(k(o),n);if(q){p.replaceChild(q,m)}else{p.insertBefore(m,n)}p.insertBefore(k(l),n);s.remove(n);return q||m}},bind:function(n,j,m,l){var k=this;if(!k.events){k.events=new h.dom.EventUtils()}return k.events.add(n,j,m,l||this)},unbind:function(m,j,l){var k=this;if(!k.events){k.events=new h.dom.EventUtils()}return k.events.remove(m,j,l)},_findSib:function(m,j,k){var l=this,n=j;if(m){if(e(n,"string")){n=function(o){return l.is(o,j)}}for(m=m[k];m;m=m[k]){if(n(m)){return m}}}return null},_isRes:function(j){return/^(top|left|bottom|right|width|height)/i.test(j)||/;\s*(top|left|bottom|right|width|height)/i.test(j)}});h.DOM=new h.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var N=this,e=c.doc,S=0,E=1,j=2,D=true,R=false,U="startOffset",h="startContainer",P="endContainer",z="endOffset",k=tinymce.extend,n=c.nodeIndex;k(N,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:D,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:I,setEndBefore:J,setEndAfter:u,collapse:A,selectNode:x,selectNodeContents:F,compareBoundaryPoints:v,deleteContents:p,extractContents:H,cloneContents:d,insertNode:C,surroundContents:M,cloneRange:K});function q(V,t){B(D,V,t)}function s(V,t){B(R,V,t)}function g(t){q(t.parentNode,n(t))}function I(t){q(t.parentNode,n(t)+1)}function J(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function A(t){if(t){N[P]=N[h];N[z]=N[U]}else{N[h]=N[P];N[U]=N[z]}N.collapsed=D}function x(t){g(t);u(t)}function F(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(Y,t){var ab=N[h],W=N[U],aa=N[P],V=N[z],Z=t.startContainer,ad=t.startOffset,X=t.endContainer,ac=t.endOffset;if(Y===0){return G(ab,W,Z,ad)}if(Y===1){return G(aa,V,Z,ad)}if(Y===2){return G(aa,V,X,ac)}if(Y===3){return G(ab,W,X,ac)}}function p(){m(j)}function H(){return m(S)}function d(){return m(E)}function C(Y){var V=this[h],t=this[U],X,W;if((V.nodeType===3||V.nodeType===4)&&V.nodeValue){if(!t){V.parentNode.insertBefore(Y,V)}else{if(t>=V.nodeValue.length){c.insertAfter(Y,V)}else{X=V.splitText(t);V.parentNode.insertBefore(Y,X)}}}else{if(V.childNodes.length>0){W=V.childNodes[t]}if(W){V.insertBefore(Y,W)}else{V.appendChild(Y)}}}function M(V){var t=N.extractContents();N.insertNode(V);V.appendChild(t);N.selectNode(V)}function K(){return k(new b(c),{startContainer:N[h],startOffset:N[U],endContainer:N[P],endOffset:N[z],collapsed:N.collapsed,commonAncestorContainer:N.commonAncestorContainer})}function O(t,V){var W;if(t.nodeType==3){return t}if(V<0){return t}W=t.firstChild;while(W&&V>0){--V;W=W.nextSibling}if(W){return W}return t}function l(){return(N[h]==N[P]&&N[U]==N[z])}function G(X,Z,V,Y){var aa,W,t,ab,ad,ac;if(X==V){if(Z==Y){return 0}if(Z0){N.collapse(V)}}else{N.collapse(V)}N.collapsed=l();N.commonAncestorContainer=c.findCommonAncestor(N[h],N[P])}function m(ab){var aa,X=0,ad=0,V,Z,W,Y,t,ac;if(N[h]==N[P]){return f(ab)}for(aa=N[P],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[h]){return r(aa,ab)}++X}for(aa=N[h],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[P]){return T(aa,ab)}++ad}Z=ad-X;W=N[h];while(Z>0){W=W.parentNode;Z--}Y=N[P];while(Z<0){Y=Y.parentNode;Z++}for(t=W.parentNode,ac=Y.parentNode;t!=ac;t=t.parentNode,ac=ac.parentNode){W=t;Y=ac}return o(W,Y,ab)}function f(Z){var ab,Y,X,aa,t,W,V;if(Z!=j){ab=e.createDocumentFragment()}if(N[U]==N[z]){return ab}if(N[h].nodeType==3){Y=N[h].nodeValue;X=Y.substring(N[U],N[z]);if(Z!=E){N[h].deleteData(N[U],N[z]-N[U]);N.collapse(D)}if(Z==j){return}ab.appendChild(e.createTextNode(X));return ab}aa=O(N[h],N[U]);t=N[z]-N[U];while(t>0){W=aa.nextSibling;V=y(aa,Z);if(ab){ab.appendChild(V)}--t;aa=W}if(Z!=E){N.collapse(D)}return ab}function r(ab,Y){var aa,Z,V,t,X,W;if(Y!=j){aa=e.createDocumentFragment()}Z=i(ab,Y);if(aa){aa.appendChild(Z)}V=n(ab);t=V-N[U];if(t<=0){if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}Z=ab.previousSibling;while(t>0){X=Z.previousSibling;W=y(Z,Y);if(aa){aa.insertBefore(W,aa.firstChild)}--t;Z=X}if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}function T(Z,Y){var ab,V,aa,t,X,W;if(Y!=j){ab=e.createDocumentFragment()}aa=Q(Z,Y);if(ab){ab.appendChild(aa)}V=n(Z);++V;t=N[z]-V;aa=Z.nextSibling;while(t>0){X=aa.nextSibling;W=y(aa,Y);if(ab){ab.appendChild(W)}--t;aa=X}if(Y!=E){N.setStartAfter(Z);N.collapse(D)}return ab}function o(Z,t,ac){var W,ae,Y,aa,ab,V,ad,X;if(ac!=j){ae=e.createDocumentFragment()}W=Q(Z,ac);if(ae){ae.appendChild(W)}Y=Z.parentNode;aa=n(Z);ab=n(t);++aa;V=ab-aa;ad=Z.nextSibling;while(V>0){X=ad.nextSibling;W=y(ad,ac);if(ae){ae.appendChild(W)}ad=X;--V}W=i(t,ac);if(ae){ae.appendChild(W)}if(ac!=E){N.setStartAfter(Z);N.collapse(D)}return ae}function i(aa,ab){var W=O(N[P],N[z]-1),ac,Z,Y,t,V,X=W!=N[P];if(W==aa){return L(W,X,R,ab)}ac=W.parentNode;Z=L(ac,R,R,ab);while(ac){while(W){Y=W.previousSibling;t=L(W,X,R,ab);if(ab!=j){Z.insertBefore(t,Z.firstChild)}X=D;W=Y}if(ac==aa){return Z}W=ac.previousSibling;ac=ac.parentNode;V=L(ac,R,R,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function Q(aa,ab){var X=O(N[h],N[U]),Y=X!=N[h],ac,Z,W,t,V;if(X==aa){return L(X,Y,D,ab)}ac=X.parentNode;Z=L(ac,R,D,ab);while(ac){while(X){W=X.nextSibling;t=L(X,Y,D,ab);if(ab!=j){Z.appendChild(t)}Y=D;X=W}if(ac==aa){return Z}X=ac.nextSibling;ac=ac.parentNode;V=L(ac,R,D,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function L(t,Y,ab,ac){var X,W,Z,V,aa;if(Y){return y(t,ac)}if(t.nodeType==3){X=t.nodeValue;if(ab){V=N[U];W=X.substring(V);Z=X.substring(0,V)}else{V=N[z];W=X.substring(0,V);Z=X.substring(V)}if(ac!=E){t.nodeValue=Z}if(ac==j){return}aa=t.cloneNode(R);aa.nodeValue=W;return aa}if(ac==j){return}return t.cloneNode(R)}function y(V,t){if(t!=j){return t==E?V.cloneNode(D):V}V.parentNode.removeChild(V)}}a.Range=b})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p<0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}k.setEndPoint(j?"EndToStart":"EndToEnd",i);if(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)>0){k=i.duplicate();k.collapse(j);o=-1;while(s==k.parentElement()){if(k.move("character",-1)==0){break}o++}}o=o||k.text.replace("\r\n"," ").length}else{k.collapse(true);k.setEndPoint(j?"StartToStart":"StartToEnd",i);o=k.text.replace("\r\n"," ").length}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.firstChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var u,t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p&&t.nodeType!==9){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndPoint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,s,q,r=d.dom.doc,m=r.body;function j(z){var u,y,t,x,v;t=h.create("a");u=z?k:s;y=z?p:q;x=n.duplicate();if(u==r||u==r.documentElement){u=m;y=0}if(u.nodeType==3){u.parentNode.insertBefore(t,u);x.moveToElementText(t);x.moveStart("character",y);h.remove(t);n.setEndPoint(z?"StartToStart":"EndToEnd",x)}else{v=u.childNodes;if(v.length){if(y>=v.length){h.insertAfter(t,v[v.length-1])}else{u.insertBefore(t,v[y])}x.moveToElementText(t)}else{t=r.createTextNode("\uFEFF");u.appendChild(t);x.moveToElementText(t.parentNode);x.collapse(c)}n.setEndPoint(z?"StartToStart":"EndToEnd",x);h.remove(t)}}k=i.startContainer;p=i.startOffset;s=i.endContainer;q=i.endOffset;n=m.createTextRange();if(k==s&&k.nodeType==1&&p==q-1){if(p==q-1){try{l=m.createControlRange();l.addElement(k.childNodes[p]);l.select();return}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(m,p,l,j){var g,h=this,i=h.events,k;if(p instanceof Array){k=[];f(p,function(o){k.push(h.add(m,o,l,j))});return k}if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.add(n,p,l,j))});return k}m=c.get(m);if(!m){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}d.extend(n,h._stoppers)}if(!j){return l(n)}return l.call(j,n)};if(p=="unload"){d.unloads.unshift({func:g});return g}if(p=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}i.push({obj:m,name:p,func:l,cfunc:g,scope:j});h._add(m,p,g);return l},remove:function(l,m,k){var h=this,g=h.events,i=false,j;if(l&&l.hasOwnProperty&&l instanceof Array){j=[];f(l,function(n){n=c.get(n);j.push(h.remove(n,m,k))});return j}l=c.get(l);f(g,function(o,n){if(o.obj==l&&o.name==m&&(!k||(o.func==k||o.cfunc==k))){g.splice(n,1);h._remove(l,m,o.cfunc);i=true;return false}});return i},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j"+(h.item?h.item(0).outerHTML:h.htmlText);l.removeChild(l.firstChild)}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(g,i){var n=this,f=n.getRng(),j,k=n.win.document,m,l;i=i||{format:"html"};i.set=true;g=i.content=g;if(!i.no_events){n.onBeforeSetContent.dispatch(n,i)}g=i.content;if(f.insertNode){g+='_';if(f.startContainer==k&&f.endContainer==k){k.body.innerHTML=g}else{f.deleteContents();if(k.body.childNodes.length==0){k.body.innerHTML=g}else{if(f.createContextualFragment){f.insertNode(f.createContextualFragment(g))}else{m=k.createDocumentFragment();l=k.createElement("div");m.appendChild(l);l.outerHTML=g;f.insertNode(m)}}}j=n.dom.get("__caret");f=k.createRange();f.setStartBefore(j);f.setEndBefore(j);n.setRng(f);n.dom.remove("__caret");try{n.setRng(f)}catch(h){}}else{if(f.item){k.execCommand("Delete",false,null);f=n.getRng()}if(/^\s+/.test(g)){f.pasteHTML('_'+g);n.dom.remove("__mce_tmp")}else{f.pasteHTML(g)}}if(!i.no_events){n.onSetContent.dispatch(n,i)}},getStart:function(){var g=this.getRng(),h,f,j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}j=g.duplicate();j.collapse(1);h=j.parentElement();f=i=g.parentElement();while(i=i.parentNode){if(i==h){h=f;break}}return h}else{h=g.startContainer;if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[Math.min(h.childNodes.length-1,g.startOffset)]}if(h&&h.nodeType==3){return h.parentNode}return h}},getEnd:function(){var g=this,h=g.getRng(),i,f;if(h.duplicate||h.item){if(h.item){return h.item(0)}h=h.duplicate();h.collapse(0);i=h.parentElement();if(i&&i.nodeName=="BODY"){return i.lastChild||i}return i}else{i=h.endContainer;f=h.endOffset;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[f>0?f-1:f]}if(i&&i.nodeType==3){return i.parentNode}return i}},getBookmark:function(r,s){var v=this,m=v.dom,g,j,i,n,h,o,p,l="\uFEFF",u;function f(x,y){var t=0;d(m.select(x),function(A,z){if(A==y){t=z}});return t}if(r==2){function k(){var x=v.getRng(true),t=m.getRoot(),y={};function z(C,H){var B=C[H?"startContainer":"endContainer"],G=C[H?"startOffset":"endOffset"],A=[],D,F,E=0;if(B.nodeType==3){if(s){for(D=B.previousSibling;D&&D.nodeType==3;D=D.previousSibling){G+=D.nodeValue.length}}A.push(G)}else{F=B.childNodes;if(G>=F.length&&F.length){E=1;G=Math.max(0,F.length-1)}A.push(v.dom.nodeIndex(F[G],s)+E)}for(;B&&B!=t;B=B.parentNode){A.push(v.dom.nodeIndex(B,s))}return A}y.start=z(x,true);if(!v.isCollapsed()){y.end=z(x)}return y}if(v.tridentSel){return v.tridentSel.getBookmark(r)}return k()}if(r){return{rng:v.getRng()}}g=v.getRng();i=m.uniqueId();n=tinyMCE.activeEditor.selection.isCollapsed();u="overflow:hidden;line-height:0px";if(g.duplicate||g.item){if(!g.item){j=g.duplicate();try{g.collapse();g.pasteHTML(''+l+"");if(!n){j.collapse(false);g.moveToElementText(j.parentElement());if(g.compareEndPoints("StartToEnd",j)==0){j.move("character",-1)}j.pasteHTML(''+l+"")}}catch(q){return null}}else{o=g.item(0);h=o.nodeName;return{name:h,index:f(h,o)}}}else{o=v.getNode();h=o.nodeName;if(h=="IMG"){return{name:h,index:f(h,o)}}j=g.cloneRange();if(!n){j.collapse(false);j.insertNode(m.create("span",{"data-mce-type":"bookmark",id:i+"_end",style:u},l))}g.collapse(true);g.insertNode(m.create("span",{"data-mce-type":"bookmark",id:i+"_start",style:u},l))}v.moveToBookmark({id:i,keep:1});return{id:i}},moveToBookmark:function(n){var r=this,l=r.dom,i,h,f,q,j,s,o,p;if(n){if(n.start){f=l.createRng();q=l.getRoot();function g(z){var t=n[z?"start":"end"],v,x,y,u;if(t){y=t[0];for(x=q,v=t.length-1;v>=1;v--){u=x.childNodes;if(t[v]>u.length-1){return}x=u[t[v]]}if(x.nodeType===3){y=Math.min(t[0],x.nodeValue.length)}if(x.nodeType===1){y=Math.min(t[0],x.childNodes.length)}if(z){f.setStart(x,y)}else{f.setEnd(x,y)}}return true}if(r.tridentSel){return r.tridentSel.moveToBookmark(n)}if(g(true)&&g()){r.setRng(f)}}else{if(n.id){function k(A){var u=l.get(n.id+"_"+A),z,t,x,y,v=n.keep;if(u){z=u.parentNode;if(A=="start"){if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}j=s=z;o=p=t}else{if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}s=z;p=t}if(!v){y=u.previousSibling;x=u.nextSibling;d(c.grep(u.childNodes),function(B){if(B.nodeType==3){B.nodeValue=B.nodeValue.replace(/\uFEFF/g,"")}});while(u=l.get(n.id+"_"+A)){l.remove(u,1)}if(y&&x&&y.nodeType==x.nodeType&&y.nodeType==3&&!c.isOpera){t=y.nodeValue.length;y.appendData(x.nodeValue);l.remove(x);if(A=="start"){j=s=y;o=p=t}else{s=y;p=t}}}}}function m(t){if(l.isBlock(t)&&!t.innerHTML){t.innerHTML=!a?'
':" "}return t}k("start");k("end");if(j){f=l.createRng();f.setStart(m(j),o);f.setEnd(m(s),p);r.setRng(f)}}else{if(n.name){r.select(l.select(n.name)[n.index])}else{if(n.rng){r.setRng(n.rng)}}}}}},select:function(k,j){var i=this,l=i.dom,g=l.createRng(),f;if(k){f=l.nodeIndex(k);g.setStart(k.parentNode,f);g.setEnd(k.parentNode,f+1);if(j){function h(m,o){var n=new c.dom.TreeWalker(m,m);do{if(m.nodeType==3&&c.trim(m.nodeValue).length!=0){if(o){g.setStart(m,0)}else{g.setEnd(m,m.nodeValue.length)}return}if(m.nodeName=="BR"){if(o){g.setStartBefore(m)}else{g.setEndBefore(m)}return}}while(m=(o?n.next():n.prev()))}h(k,1);h(k)}i.setRng(g)}return k},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}if(h.compareEndPoints){return h.compareEndPoints("StartToEnd",h)===0}return !g||h.collapsed},collapse:function(f){var h=this,g=h.getRng(),i;if(g.item){i=g.item(0);g=h.win.document.body.createTextRange();g.moveToElementText(i)}g.collapse(!!f);h.setRng(g)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(l){var g=this,h,i,k,j=g.win.document;if(l&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():j.createRange())}}catch(f){}if(c.isIE&&i&&i.setStart&&j.selection.createRange().item){k=j.selection.createRange().item(0);i=j.createRange();i.setStartBefore(k);i.setEndAfter(k)}if(!i){i=j.createRange?j.createRange():j.body.createTextRange()}if(g.selectedRange&&g.explicitRange){if(i.compareBoundaryPoints(i.START_TO_START,g.selectedRange)===0&&i.compareBoundaryPoints(i.END_TO_END,g.selectedRange)===0){i=g.explicitRange}else{g.selectedRange=null;g.explicitRange=null}}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){g.explicitRange=i;try{h.removeAllRanges()}catch(f){}h.addRange(i);g.selectedRange=h.getRangeAt(0)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var h=this,g=h.getRng(),i=h.getSel(),l,k=g.startContainer,f=g.endContainer;if(!g){return h.dom.getRoot()}if(g.setStart){l=g.commonAncestorContainer;if(!g.collapsed){if(g.startContainer==g.endContainer){if(g.endOffset-g.startOffset<2){if(g.startContainer.hasChildNodes()){l=g.startContainer.childNodes[g.startOffset]}}}if(k.nodeType===3&&f.nodeType===3){function j(p,m){var o=p;while(p&&p.nodeType===3&&p.length===0){p=m?p.nextSibling:p.previousSibling}return p||o}if(k.length===g.startOffset){k=j(k.nextSibling,true)}else{k=k.parentNode}if(g.endOffset===0){f=j(f.previousSibling,false)}else{f=f.parentNode}if(k&&k===f){return k}}}if(l&&l.nodeType==3){return l.parentNode}return l}return g.item?g.item(0):g.parentElement()},getSelectedBlocks:function(o,g){var m=this,j=m.dom,l,k,h,i=[];l=j.getParent(o||m.getStart(),j.isBlock);k=j.getParent(g||m.getEnd(),j.isBlock);if(l){i.push(l)}if(l&&k&&l!=k){h=l;var f=new c.dom.TreeWalker(l,j.getRoot());while((h=f.next())&&h!=k){if(j.isBlock(h)){i.push(h)}}}if(k&&l!=k){i.push(k)}return i},normalize:function(){var g=this,f,i;if(c.isIE){return}function h(p){var k,o,n,m=g.dom,j=m.getRoot(),l;k=f[(p?"start":"end")+"Container"];o=f[(p?"start":"end")+"Offset"];if(k.nodeType===9){k=k.body;o=0}if(k===j){if(k.hasChildNodes()){k=k.childNodes[Math.min(!p&&o>0?o-1:o,k.childNodes.length-1)];o=0;if(k.hasChildNodes()){l=k;n=new c.dom.TreeWalker(k,j);do{if(l.nodeType===3){o=p?0:l.nodeValue.length-1;k=l;break}if(l.nodeName==="BR"){o=m.nodeIndex(l);k=l.parentNode;break}}while(l=(p?n.next():n.prev()));i=true}}}if(i){f["set"+(p?"Start":"End")](k,o)}}f=g.getRng();h(true);if(f.collapsed){h()}if(i){g.setRng(f)}},destroy:function(g){var f=this;f.win=null;if(!g){c.removeUnload(f.destroy)}},_fixIESelection:function(){var g=this.dom,m=g.doc,h=m.body,j,n,f;m.documentElement.unselectable=true;function i(o,r){var p=h.createTextRange();try{p.moveToPoint(o,r)}catch(q){p=null}return p}function l(p){var o;if(p.button){o=i(p.x,p.y);if(o){if(o.compareEndPoints("StartToStart",n)>0){o.setEndPoint("StartToStart",n)}else{o.setEndPoint("EndToEnd",n)}o.select()}}else{k()}}function k(){var o=m.selection.createRange();if(n&&!o.item&&o.compareEndPoints("StartToEnd",o)===0){n.select()}g.unbind(m,"mouseup",k);g.unbind(m,"mousemove",l);n=j=0}g.bind(m,["mousedown","contextmenu"],function(o){if(o.target.nodeName==="HTML"){if(j){k()}f=m.documentElement;if(f.scrollHeight>f.clientHeight){return}j=1;n=i(o.x,o.y);if(n){g.bind(m,"mouseup",k);g.bind(m,"mousemove",l);g.win.focus();n.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}e.remove_trailing_brs=true;i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/\s*mce(Item\w+|Selected)\s*/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(\/\/\s*|\]\]>|-->|\]\]-->)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// "}}else{if(o.length>0){n.firstChild.value=""}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(m.getInner?o.innerHTML:a.trim(i.getOuterHTML(o),m),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF|\u200B/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],f={},d=[],g=0,e;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=q.create("script",{id:n,type:"text/javascript",src:a._addVer(m)});if(!a.isIE){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==e){j.push(m);l[m]=c}if(q){if(!f[m]){f[m]=[]}f[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(f[r],function(s){s.func.call(s.scope)});f[r]=e}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);tinymce.dom.TreeWalker=function(a,c){var b=a;function d(i,f,e,j){var h,g;if(i){if(!j&&i[f]){return i[f]}if(i!=c){h=i[e];if(h){return h}for(g=i.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","previousSibling",e))}};(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var i=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,g,o,h,r,q,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function f(u){var v;v=u[0];if(v.nodeType===3&&v===i&&l>=v.nodeValue.length){u.splice(0,1)}v=u[u.length-1];if(m===0&&u.length>0&&v===t&&v.nodeType===3){u.splice(u.length-1,1)}return u}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(h=x,r=h.parentNode;h&&h!=v;h=r){r=h.parentNode;q=p(h==x?h:h[u],u);if(q.length){if(!y){q.reverse()}s(f(q))}}}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}if(i==t){return s(f([i]))}j=c.findCommonAncestor(i,t);for(h=i;h;h=h.parentNode){if(h===t){return k(i,j,true)}if(h===j){break}}for(h=t;h;h=h.parentNode){if(h===i){return k(t,j)}if(h===j){break}}g=n(i,j)||i;o=n(t,j)||t;k(i,g,true);q=p(g==i?g:g.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(f(q))}k(t,o)};this.split=function(e){var h=e.startContainer,d=e.startOffset,i=e.endContainer,g=e.endOffset;function f(j,k){return j.splitText(k)}if(h==i&&h.nodeType==3){if(d>0&&dd){g=g-d;h=i=f(i,g).previousSibling;g=i.nodeValue.length;d=0}else{g=0}}}else{if(h.nodeType==3&&d>0&&d0&&g=l.length){q=0}}s=l[q];f.setAttrib(g,"tabindex","-1");f.setAttrib(s.id,"tabindex","0");f.get(s.id).focus();if(e.actOnFocus){e.onAction(s.id)}if(r){a.cancel(r)}};o=function(y){var u=37,t=39,x=38,z=40,q=27,s=14,r=13,v=32;switch(y.keyCode){case u:if(i){p.moveFocus(-1)}break;case t:if(i){p.moveFocus(1)}break;case x:if(n){p.moveFocus(-1)}break;case z:if(n){p.moveFocus(1)}break;case q:if(e.onCancel){e.onCancel();a.cancel(y)}break;case s:case r:case v:if(e.onAction){e.onAction(g);a.cancel(y)}break}};c(l,function(s,q){var r;if(!s.id){s.id=f.uniqueId("_mce_item_")}if(k){f.bind(s.id,"blur",h);r="-1"}else{r=(q===0?"0":"-1")}f.setAttrib(s.id,"tabindex",r);f.bind(f.get(s.id),"focus",j)});if(l[0]){g=l[0].id}f.setAttrib(m,"tabindex","-1");f.bind(f.get(m),"focus",d);f.bind(f.get(m),"keydown",o)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeightv){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.select("#menu_"+g.id)[0];h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+=''+a.encode(e.title)+''+c}else{d+=''+(c?''+c+"":"")}d+='";d+="";return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(i,h,f){var g=this;g.parent(i,h,f);g.items=[];g.onChange=new a(g);g.onPostRender=new a(g);g.onAdd=new a(g);g.onRenderMenu=new d.util.Dispatcher(this);g.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var h=this,i,j,g;if(f!=h.selectedIndex){i=c.get(h.id+"_text");g=c.get(h.id+"_voiceDesc");j=h.items[f];if(j){h.selectedValue=j.value;h.selectedIndex=f;c.setHTML(i,c.encode(j.title));c.setHTML(g,h.settings.title+" - "+j.title);c.removeClass(i,"mceTitle");c.setAttrib(h.id,"aria-valuenow",j.title)}else{c.setHTML(i,c.encode(h.settings.title));c.setHTML(g,c.encode(h.settings.title));c.addClass(i,"mceTitle");h.selectedValue=h.selectedIndex=null;c.setAttrib(h.id,"aria-valuenow",h.settings.title)}i=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='';i+="";i+="";i+="";return i},showMenu:function(){var g=this,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(j){if(j.value===g.selectedValue){f.items[j.id].setSelected(1);g.oldID=j.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(f.menu&&f.menu.isMenuVisible){c.removeClass(f.id,f.classPrefix+"Selected");if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(function(){g.hideMenu();g.focus()});f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){if(h.value===undefined){f.add({title:h.title,role:"option","class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}})}else{h.id=c.uniqueId();h.role="option";h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)}});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id,"keydown",function(h){if(h.keyCode==32){f.showMenu(h);b.cancel(h)}});b.add(f.id,"focus",function(){if(!f._focused){f.keyDownHandler=b.add(f.id,"keydown",function(h){if(h.keyCode==40){f.showMenu();b.cancel(h)}});f.keyPressHandler=b.add(f.id,"keypress",function(i){var h;if(i.keyCode==13){h=f.selectedValue;f.selectedValue=null;b.cancel(i);f.settings.onselect(h)}})}f._focused=1});b.add(f.id,"blur",function(){b.remove(f.id,"keydown",f.keyDownHandler);b.remove(f.id,"keypress",f.keyPressHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f;this.setAriaProperty("disabled",f)},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox","aria-labelledby":f.id+"_aria"},g);g+=c.createHTML("span",{id:f.id+"_aria",style:"display: none"},f.settings.title);return g},postRender:function(){var g=this,h,i=true;g.rendered=true;function f(k){var j=g.items[k.target.selectedIndex-1];if(j&&(j=j.value)){g.onChange.dispatch(g,j);if(g.settings.onselect){g.settings.onselect(j)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(k){var j;b.remove(g.id,"change",h);i=false;j=b.add(g.id,"blur",function(){if(i){return}i=true;b.add(g.id,"change",f);b.remove(g.id,"blur",j)});if(d.isWebKit&&(k.keyCode==37||k.keyCode==39)){return b.prevent(k)}if(k.keyCode==13||k.keyCode==32){f(k);return b.cancel(k)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+=""+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'');i+=""+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";i+="";i=b.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("div",{id:f.id,role:"button",tabindex:"0","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0;f.onHideMenu.dispatch()}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(i){i=i.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");g=c.add(g,"a",{role:"option",href:"javascript:;",style:{backgroundColor:"#"+i},title:p.editor.getLang("colors."+i,i),"data-mce-color":"#"+i});if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+i;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");new d.ui.KeyboardNavigation({root:p.id+"_menu",items:c.select("a",p.id+"_menu"),onCancel:function(){p.hideMenu();p.focus()}});a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return a.cancel(i)});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('
');i.push("");i.push('");j(e,function(h){i.push(h.renderHTML())});i.push("");i.push("
");return i.join("")},focus:function(){var e=this;d.get(e.id).focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){if(b.isWebKit){d.get(f.editor.id+"_ifr").focus()}f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,""))}}if(c.stdMode){f+=''+k.renderHTML()+""}else{f+=""+k.renderHTML()+""}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,""))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,""));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},""+f+"")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}if(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(q){var n=this,p,l=j.ScriptLoader,u,o=[],m;function r(x,y,t){var v=x[y];if(!v){return}if(j.is(v,"string")){t=v.replace(/\.\w+$/,"");t=t?j.resolve(t):0;v=j.resolve(v)}return v.apply(t||this,Array.prototype.slice.call(arguments,2))}q=d({theme:"simple",language:"en"},q);n.settings=q;i.add(document,"init",function(){var s,v;r(q,"onpageload");switch(q.mode){case"exact":s=q.elements||"";if(s.length>0){g(e(s),function(x){if(k.get(x)){m=new j.Editor(x,q);o.push(m);m.render(1)}else{g(document.forms,function(y){g(y.elements,function(z){if(z.name===x){x="mce_editor_"+c++;k.setAttrib(z,"id",x);m=new j.Editor(x,q);o.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function t(y,x){return x.constructor===RegExp?x.test(y.className):k.hasClass(y,x)}g(k.select("textarea"),function(x){if(q.editor_deselector&&t(x,q.editor_deselector)){return}if(!q.editor_selector||t(x,q.editor_selector)){u=k.get(x.name);if(!x.id&&!u){x.id=x.name}if(!x.id||n.get(x.id)){x.id=k.uniqueId()}m=new j.Editor(x.id,q);o.push(m);m.render(1)}});break}if(q.oninit){s=v=0;g(o,function(x){v++;if(!x.initialized){x.onInit.add(function(){s++;if(s==v){r(q,"oninit")}})}else{s++}if(s==v){r(q,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);if(j.adapter){j.adapter.patchEditor(m)}return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l':"",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,inline_styles:1,convert_fonts_to_spans:true,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr",validate:true,entity_encoding:"named",url_converter:p.convertURL,url_converter_scope:p,ie7_compat:true},q);p.documentBaseURI=new m.util.URI(q.document_base_url||m.documentBaseURL,{base_uri:tinyMCE.baseURI});p.baseURI=m.baseURI;p.contentCSS=[];p.execCallback("setup",p)},render:function(r){var u=this,v=u.settings,x=u.id,p=m.ScriptLoader;if(!j.domLoaded){j.add(document,"init",function(){u.render()});return}tinyMCE.settings=v;if(!u.getElement()){return}if(m.isIDevice&&!m.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(u.getElement().nodeName)&&v.hidden_input&&n.getParent(x,"form")){n.insertAfter(n.create("input",{type:"hidden",name:x}),x)}if(m.WindowManager){u.windowManager=new m.WindowManager(u)}if(v.encoding=="xml"){u.onGetContent.add(function(s,t){if(t.save){t.content=n.encode(t.content)}})}if(v.add_form_submit_trigger){u.onSubmit.addToTop(function(){if(u.initialized){u.save();u.isNotDirty=1}})}if(v.add_unload_trigger){u._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(u.initialized&&!u.destroyed&&!u.isHidden()){u.save({format:"raw",no_events:true})}})}m.addUnload(u.destroy,u);if(v.submit_patch){u.onBeforeRenderUI.add(function(){var s=u.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){u.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){m.triggerSave();u.isNotDirty=1;return u.formElement._mceOldSubmit(u.formElement)}}s=null})}function q(){if(v.language&&v.language_load!==false){p.add(m.baseURL+"/langs/"+v.language+".js")}if(v.theme&&v.theme.charAt(0)!="-"&&!h.urls[v.theme]){h.load(v.theme,"themes/"+v.theme+"/editor_template"+m.suffix+".js")}i(g(v.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(z){var y={prefix:"plugins/",resource:z,suffix:"/editor_plugin"+m.suffix+".js"};var z=c.createUrl(y,z);c.load(z.resource,z)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+m.suffix+".js"})}}});p.loadQueue(function(){if(!u.removed){u.init()}})}q()},init:function(){var r,H=this,I=H.settings,E,A,D=H.getElement(),q,p,F,y,C,G,z,v=[];m.add(H);I.aria_label=I.aria_label||n.getAttrib(D,"aria-label",H.getLang("aria.rich_text_area"));if(I.theme){I.theme=I.theme.replace(/-/,"");q=h.get(I.theme);H.theme=new q();if(H.theme.init&&I.init_theme){H.theme.init(H,h.urls[I.theme]||m.documentBaseURL.replace(/\/$/,""))}}function B(J){var K=c.get(J),t=c.urls[J]||m.documentBaseURL.replace(/\/$/,""),s;if(K&&m.inArray(v,J)===-1){i(c.dependencies(J),function(u){B(u)});s=new K(H,t);H.plugins[J]=s;if(s.init){s.init(H,t);v.push(J)}}}i(g(I.plugins.replace(/\-/g,"")),B);if(I.popup_css!==false){if(I.popup_css){I.popup_css=H.documentBaseURI.toAbsolute(I.popup_css)}else{I.popup_css=H.baseURI.toAbsolute("themes/"+I.theme+"/skins/"+I.skin+"/dialog.css")}}if(I.popup_css_add){I.popup_css+=","+H.documentBaseURI.toAbsolute(I.popup_css_add)}H.controlManager=new m.ControlManager(H);if(I.custom_undo_redo){H.onBeforeExecCommand.add(function(t,J,u,K,s){if(J!="Undo"&&J!="Redo"&&J!="mceRepaint"&&(!s||!s.skip_undo)){H.undoManager.beforeChange()}});H.onExecCommand.add(function(t,J,u,K,s){if(J!="Undo"&&J!="Redo"&&J!="mceRepaint"&&(!s||!s.skip_undo)){H.undoManager.add()}})}H.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){H.nodeChanged()}});if(a){function x(s,t){if(!t||!t.initial){H.execCommand("mceRepaint")}}H.onUndo.add(x);H.onRedo.add(x);H.onSetContent.add(x)}H.onBeforeRenderUI.dispatch(H,H.controlManager);if(I.render_ui){E=I.width||D.style.width||D.offsetWidth;A=I.height||D.style.height||D.offsetHeight;H.orgDisplay=D.style.display;G=/^[0-9\.]+(|px)$/i;if(G.test(""+E)){E=Math.max(parseInt(E)+(q.deltaWidth||0),100)}if(G.test(""+A)){A=Math.max(parseInt(A)+(q.deltaHeight||0),100)}q=H.theme.renderUI({targetNode:D,width:E,height:A,deltaWidth:I.delta_width,deltaHeight:I.delta_height});H.editorContainer=q.editorContainer}if(document.domain&&location.hostname!=document.domain){m.relaxedDomain=document.domain}n.setStyles(q.sizeContainer||q.editorContainer,{width:E,height:A});if(I.content_css){m.each(g(I.content_css),function(s){H.contentCSS.push(H.documentBaseURI.toAbsolute(s))})}A=(q.iframeHeight||A)+(typeof(A)=="number"?(q.deltaHeight||0):"");if(A<100){A=100}H.iframeHTML=I.doctype+'';if(I.document_base_url!=m.documentBaseURL){H.iframeHTML+=''}if(I.ie7_compat){H.iframeHTML+=''}else{H.iframeHTML+=''}H.iframeHTML+='';for(z=0;z'}y=I.body_id||"tinymce";if(y.indexOf("=")!=-1){y=H.getParam("body_id","","hash");y=y[H.id]||y}C=I.body_class||"";if(C.indexOf("=")!=-1){C=H.getParam("body_class","","hash");C=C[H.id]||""}H.iframeHTML+='
';if(m.relaxedDomain&&(b||(m.isOpera&&parseFloat(opera.version())<11))){F='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+H.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}r=n.add(q.iframeContainer,"iframe",{id:H.id+"_ifr",src:F||'javascript:""',frameBorder:"0",allowTransparency:"true",title:I.aria_label,style:{width:"100%",height:A,display:"block"}});H.contentAreaContainer=q.iframeContainer;n.get(q.editorContainer).style.display=H.orgDisplay;n.get(H.id).style.display="none";n.setAttrib(H.id,"aria-hidden",true);if(!m.relaxedDomain||!F){H.setupIframe()}D=r=q=null},setupIframe:function(){var q=this,v=q.settings,x=n.get(q.id),y=q.getDoc(),u,p;if(!b||!m.relaxedDomain){y.open();y.write(q.iframeHTML);y.close();if(m.relaxedDomain){y.domain=m.relaxedDomain}}p=q.getBody();p.disabled=true;if(!v.readonly){p.contentEditable=true}p.disabled=false;q.schema=new m.html.Schema(v);q.dom=new m.dom.DOMUtils(q.getDoc(),{keep_values:true,url_converter:q.convertURL,url_converter_scope:q,hex_colors:v.force_hex_style_colors,class_filter:v.class_filter,update_styles:1,fix_ie_paragraphs:1,schema:q.schema});q.parser=new m.html.DomParser(v,q.schema);if(!q.settings.allow_html_in_named_anchor){q.parser.addAttributeFilter("name",function(s,t){var A=s.length,C,z,B,D;while(A--){D=s[A];if(D.name==="a"&&D.firstChild){B=D.parent;C=D.lastChild;do{z=C.prev;B.insert(C,D);C=z}while(C)}}})}q.parser.addAttributeFilter("src,href,style",function(s,t){var z=s.length,B,D=q.dom,C,A;while(z--){B=s[z];C=B.attr(t);A="data-mce-"+t;if(!B.attributes.map[A]){if(t==="style"){B.attr(A,D.serializeStyle(D.parseStyle(C),B.name))}else{B.attr(A,q.convertURL(C,t,B.name))}}}});q.parser.addNodeFilter("script",function(s,t){var z=s.length,A;while(z--){A=s[z];A.attr("type","mce-"+(A.attr("type")||"text/javascript"))}});q.parser.addNodeFilter("#cdata",function(s,t){var z=s.length,A;while(z--){A=s[z];A.type=8;A.name="#comment";A.value="[CDATA["+A.value+"]]"}});q.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(t,z){var A=t.length,B,s=q.schema.getNonEmptyElements();while(A--){B=t[A];if(B.isEmpty(s)){B.empty().append(new m.html.Node("br",1)).shortEnded=true}}});q.serializer=new m.dom.Serializer(v,q.dom,q.schema);q.selection=new m.dom.Selection(q.dom,q.getWin(),q.serializer);q.formatter=new m.Formatter(this);q.formatter.register({alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"}},{selector:"img,table",collapsed:false,styles:{"float":"left"}}],aligncenter:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"}},{selector:"img",collapsed:false,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:false,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"}},{selector:"img,table",collapsed:false,styles:{"float":"right"}}],alignfull:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"}}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:false},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:false},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},link:{inline:"a",selector:"a",remove:"all",split:true,deep:true,onmatch:function(s){return true},onformat:function(z,s,t){i(t,function(B,A){q.dom.setAttrib(z,A,B)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]});i("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(s){q.formatter.register(s,{block:s,remove:"all"})});q.formatter.register(q.settings.formats);q.undoManager=new m.UndoManager(q);q.undoManager.onAdd.add(function(t,s){if(t.hasUndo()){return q.onChange.dispatch(q,s,t)}});q.undoManager.onUndo.add(function(t,s){return q.onUndo.dispatch(q,s,t)});q.undoManager.onRedo.add(function(t,s){return q.onRedo.dispatch(q,s,t)});q.forceBlocks=new m.ForceBlocks(q,{forced_root_block:v.forced_root_block});q.editorCommands=new m.EditorCommands(q);q.serializer.onPreProcess.add(function(s,t){return q.onPreProcess.dispatch(q,t,s)});q.serializer.onPostProcess.add(function(s,t){return q.onPostProcess.dispatch(q,t,s)});q.onPreInit.dispatch(q);if(!v.gecko_spellcheck){q.getBody().spellcheck=0}if(!v.readonly){q._addEvents()}q.controlManager.onPostRender.dispatch(q,q.controlManager);q.onPostRender.dispatch(q);q.quirks=new m.util.Quirks(this);if(v.directionality){q.getBody().dir=v.directionality}if(v.nowrap){q.getBody().style.whiteSpace="nowrap"}if(v.handle_node_change_callback){q.onNodeChange.add(function(t,s,z){q.execCallback("handle_node_change_callback",q.id,z,-1,-1,true,q.selection.isCollapsed())})}if(v.save_callback){q.onSaveContent.add(function(s,z){var t=q.execCallback("save_callback",q.id,z.content,q.getBody());if(t){z.content=t}})}if(v.onchange_callback){q.onChange.add(function(t,s){q.execCallback("onchange_callback",q,s)})}if(v.protect){q.onBeforeSetContent.add(function(s,t){if(v.protect){i(v.protect,function(z){t.content=t.content.replace(z,function(A){return""})})}})}if(v.convert_newlines_to_brs){q.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"
")}})}if(v.preformatted){q.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='
'+t.content+"
"}})}if(v.verify_css_classes){q.serializer.attribValueFilter=function(B,z){var A,t;if(B=="class"){if(!q.classesRE){t=q.dom.getClasses();if(t.length>0){A="";i(t,function(s){A+=(A?"|":"")+s["class"]});q.classesRE=new RegExp("("+A+")","gi")}}return !q.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(z)||q.classesRE.test(z)?z:""}return z}}if(v.cleanup_callback){q.onBeforeSetContent.add(function(s,t){t.content=q.execCallback("cleanup_callback","insert_to_editor",t.content,t)});q.onPreProcess.add(function(s,t){if(t.set){q.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){q.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});q.onPostProcess.add(function(s,t){if(t.set){t.content=q.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=q.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(v.save_callback){q.onGetContent.add(function(s,t){if(t.save){t.content=q.execCallback("save_callback",q.id,t.content,q.getBody())}})}if(v.handle_event_callback){q.onEvent.add(function(s,t,z){if(q.execCallback("handle_event_callback",t,s,z)===false){j.cancel(t)}})}q.onSetContent.add(function(){q.addVisual(q.getBody())});if(v.padd_empty_editor){q.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
[\r\n]*)$/,"")})}if(a){function r(s,t){i(s.dom.select("a"),function(A){var z=A.parentNode;if(s.dom.isBlock(z)&&z.lastChild===A){s.dom.add(z,"br",{"data-mce-bogus":1})}})}q.onExecCommand.add(function(s,t){if(t==="CreateLink"){r(s)}});q.onSetContent.add(q.selection.onSetContent.add(r))}q.load({initial:true,format:"html"});q.startContent=q.getContent({format:"raw"});q.undoManager.add();q.initialized=true;q.onInit.dispatch(q);q.execCallback("setupcontent_callback",q.id,q.getBody(),q.getDoc());q.execCallback("init_instance_callback",q);q.focus(true);q.nodeChanged({initial:1});i(q.contentCSS,function(s){q.dom.loadCSS(s)});if(v.auto_focus){setTimeout(function(){var s=m.get(v.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getBody().focus();s.getWin().focus()},100)}x=null},focus:function(u){var y,q=this,s=q.selection,x=q.settings.content_editable,r,p,v=q.getDoc();if(!u){r=s.getRng();if(r.item){p=r.item(0)}q._refreshContentEditable();s.normalize();if(!x){q.getWin().focus()}if(m.isGecko){q.getBody().focus()}if(p&&p.ownerDocument==v){r=v.body.createControlRange();r.addElement(p);r.select()}}if(m.activeEditor!=q){if((y=m.activeEditor)!=null){y.onDeactivate.dispatch(y,q)}q.onActivate.dispatch(q,y)}m._setActive(q)},execCallback:function(u){var p=this,r=p.settings[u],q;if(!r){return}if(p.callbackLookup&&(q=p.callbackLookup[u])){r=q.func;q=q.scope}if(d(r,"string")){q=r.replace(/\.\w+$/,"");q=q?m.resolve(q):0;r=m.resolve(r);p.callbackLookup=p.callbackLookup||{};p.callbackLookup[u]={func:r,scope:q}}return r.apply(q||p,Array.prototype.slice.call(arguments,1))},translate:function(p){var r=this.settings.language||"en",q=m.i18n;if(!p){return""}return q[r+"."+p]||p.replace(/{\#([^}]+)\}/g,function(t,s){return q[r+"."+s]||"{#"+s+"}"})},getLang:function(q,p){return m.i18n[(this.settings.language||"en")+"."+q]||(d(p)?p:"{#"+q+"}")},getParam:function(u,r,p){var s=m.trim,q=d(this.settings[u])?this.settings[u]:r,t;if(p==="hash"){t={};if(d(q,"string")){i(q.indexOf("=")>0?q.split(/[;,](?![^=;,]*(?:[;,]|$))/):q.split(","),function(x){x=x.split("=");if(x.length>1){t[s(x[0])]=s(x[1])}else{t[s(x[0])]=s(x)}})}else{t=q}return t}return q},nodeChanged:function(r){var p=this,q=p.selection,u=q.getStart()||p.getBody();if(p.initialized){r=r||{};u=b&&u.ownerDocument!=p.getDoc()?p.getBody():u;r.parents=[];p.dom.getParent(u,function(s){if(s.nodeName=="BODY"){return true}r.parents.push(s)});p.onNodeChange.dispatch(p,r?r.controlManager||p.controlManager:p.controlManager,u,q.isCollapsed(),r)}},addButton:function(r,q){var p=this;p.buttons=p.buttons||{};p.buttons[r]=q},addCommand:function(p,r,q){this.execCommands[p]={func:r,scope:q||this}},addQueryStateHandler:function(p,r,q){this.queryStateCommands[p]={func:r,scope:q||this}},addQueryValueHandler:function(p,r,q){this.queryValueCommands[p]={func:r,scope:q||this}},addShortcut:function(r,u,p,s){var q=this,v;if(!q.settings.custom_shortcuts){return false}q.shortcuts=q.shortcuts||{};if(d(p,"string")){v=p;p=function(){q.execCommand(v,false,null)}}if(d(p,"object")){v=p;p=function(){q.execCommand(v[0],v[1],v[2])}}i(g(r),function(t){var x={func:p,scope:s||this,desc:u,alt:false,ctrl:false,shift:false};i(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});q.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=x});return true},execCommand:function(x,v,z,p){var r=this,u=0,y,q;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!p||!p.skip_focus)){r.focus()}y={};r.onBeforeExecCommand.dispatch(r,x,v,z,y);if(y.terminate){return false}if(r.execCallback("execcommand_callback",r.id,r.selection.getNode(),x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(y=r.execCommands[x]){q=y.func.call(y.scope,v,z);if(q!==true){r.onExecCommand.dispatch(r,x,v,z,p);return q}}i(r.plugins,function(s){if(s.execCommand&&s.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);u=1;return false}});if(u){return true}if(r.theme&&r.theme.execCommand&&r.theme.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(r.editorCommands.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}r.getDoc().execCommand(x,v,z);r.onExecCommand.dispatch(r,x,v,z,p)},queryCommandState:function(u){var q=this,v,r;if(q._isHidden()){return}if(v=q.queryStateCommands[u]){r=v.func.call(v.scope);if(r!==true){return r}}v=q.editorCommands.queryCommandState(u);if(v!==-1){return v}try{return this.getDoc().queryCommandState(u)}catch(p){}},queryCommandValue:function(v){var q=this,u,r;if(q._isHidden()){return}if(u=q.queryValueCommands[v]){r=u.func.call(u.scope);if(r!==true){return r}}u=q.editorCommands.queryCommandValue(v);if(d(u)){return u}try{return this.getDoc().queryCommandValue(v)}catch(p){}},show:function(){var p=this;n.show(p.getContainer());n.hide(p.id);p.load()},hide:function(){var p=this,q=p.getDoc();if(b&&q){q.execCommand("SelectAll")}p.save();n.hide(p.getContainer());n.setStyle(p.id,"display",p.orgDisplay)},isHidden:function(){return !n.isHidden(this.id)},setProgressState:function(p,q,r){this.onSetProgressState.dispatch(this,p,q,r);return p},load:function(s){var p=this,r=p.getElement(),q;if(r){s=s||{};s.load=true;q=p.setContent(d(r.value)?r.value:r.innerHTML,s);s.element=r;if(!s.no_events){p.onLoadContent.dispatch(p,s)}s.element=r=null;return q}},save:function(u){var p=this,s=p.getElement(),q,r;if(!s||!p.initialized){return}u=u||{};u.save=true;if(!u.no_events){p.undoManager.typing=false;p.undoManager.add()}u.element=s;q=u.content=p.getContent(u);if(!u.no_events){p.onSaveContent.dispatch(p,u)}q=u.content;if(!/TEXTAREA|INPUT/i.test(s.nodeName)){s.innerHTML=q;if(r=n.getParent(p.id,"form")){i(r.elements,function(t){if(t.name==p.id){t.value=q;return false}})}}else{s.value=q}u.element=s=null;return q},setContent:function(u,s){var r=this,q,p=r.getBody(),t;s=s||{};s.format=s.format||"html";s.set=true;s.content=u;if(!s.no_events){r.onBeforeSetContent.dispatch(r,s)}u=s.content;if(!m.isIE&&(u.length===0||/^\s+$/.test(u))){t=r.settings.forced_root_block;if(t){u="<"+t+'>
"}else{u='
'}p.innerHTML=u;r.selection.select(p,true);r.selection.collapse(true);return}if(s.format!=="raw"){u=new m.html.Serializer({},r.schema).serialize(r.parser.parse(u))}s.content=m.trim(u);r.dom.setHTML(p,s.content);if(!s.no_events){r.onSetContent.dispatch(r,s)}r.selection.normalize();return s.content},getContent:function(q){var p=this,r;q=q||{};q.format=q.format||"html";q.get=true;if(!q.no_events){p.onBeforeGetContent.dispatch(p,q)}if(q.format=="raw"){r=p.getBody().innerHTML}else{r=p.serializer.serialize(p.getBody(),q)}q.content=m.trim(r);if(!q.no_events){p.onGetContent.dispatch(p,q)}return q.content},isDirty:function(){var p=this;return m.trim(p.startContent)!=m.trim(p.getContent({format:"raw",no_events:1}))&&!p.isNotDirty},getContainer:function(){var p=this;if(!p.container){p.container=n.get(p.editorContainer||p.id+"_parent")}return p.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return n.get(this.settings.content_element||this.id)},getWin:function(){var p=this,q;if(!p.contentWindow){q=n.get(p.id+"_ifr");if(q){p.contentWindow=q.contentWindow}}return p.contentWindow},getDoc:function(){var q=this,p;if(!q.contentDocument){p=q.getWin();if(p){q.contentDocument=p.document}}return q.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(p,x,v){var q=this,r=q.settings;if(r.urlconverter_callback){return q.execCallback("urlconverter_callback",p,v,true,x)}if(!r.convert_urls||(v&&v.nodeName=="LINK")||p.indexOf("file:")===0){return p}if(r.relative_urls){return q.documentBaseURI.toRelative(p)}p=q.documentBaseURI.toAbsolute(p,r.remove_script_host);return p},addVisual:function(r){var p=this,q=p.settings;r=r||p.getBody();if(!d(p.hasVisual)){p.hasVisual=q.visual}i(p.dom.select("table,a",r),function(t){var s;switch(t.nodeName){case"TABLE":s=p.dom.getAttrib(t,"border");if(!s||s=="0"){if(p.hasVisual){p.dom.addClass(t,q.visual_table_class)}else{p.dom.removeClass(t,q.visual_table_class)}}return;case"A":s=p.dom.getAttrib(t,"name");if(s){if(p.hasVisual){p.dom.addClass(t,"mceItemAnchor")}else{p.dom.removeClass(t,"mceItemAnchor")}}return}});p.onVisualAid.dispatch(p,r,p.hasVisual)},remove:function(){var p=this,q=p.getContainer();p.removed=1;p.hide();p.execCallback("remove_instance_callback",p);p.onRemove.dispatch(p);p.onExecCommand.listeners=[];m.remove(p);n.remove(q)},destroy:function(q){var p=this;if(p.destroyed){return}if(!q){m.removeUnload(p.destroy);tinyMCE.onBeforeUnload.remove(p._beforeUnload);if(p.theme&&p.theme.destroy){p.theme.destroy()}p.controlManager.destroy();p.selection.destroy();p.dom.destroy();if(!p.settings.content_editable){j.clear(p.getWin());j.clear(p.getDoc())}j.clear(p.getBody());j.clear(p.formElement)}if(p.formElement){p.formElement.submit=p.formElement._mceOldSubmit;p.formElement._mceOldSubmit=null}p.contentAreaContainer=p.formElement=p.container=p.settings.content_element=p.bodyElement=p.contentDocument=p.contentWindow=null;if(p.selection){p.selection=p.selection.win=p.selection.dom=p.selection.dom.doc=null}p.destroyed=1},_addEvents:function(){var B=this,r,C=B.settings,q=B.dom,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function p(t,D){var s=t.type;if(B.removed){return}if(B.onEvent.dispatch(B,t,D)!==false){B[x[t.fakeType||t.type]].dispatch(B,t,D)}}i(x,function(t,s){switch(s){case"contextmenu":q.bind(B.getDoc(),s,p);break;case"paste":q.bind(B.getBody(),s,function(D){p(D)});break;case"submit":case"reset":q.bind(B.getElement().form||n.getParent(B.id,"form"),s,p);break;default:q.bind(C.content_editable?B.getBody():B.getDoc(),s,p)}});q.bind(C.content_editable?B.getBody():(a?B.getDoc():B.getWin()),"focus",function(s){B.focus(true)});if(m.isGecko){q.bind(B.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("data-mce-src"))){t.src=B.documentBaseURI.toAbsolute(s)}})}if(a){function u(){var E=this,G=E.getDoc(),F=E.settings;if(a&&!F.readonly){E._refreshContentEditable();try{G.execCommand("styleWithCSS",0,false)}catch(D){if(!E._isHidden()){try{G.execCommand("useCSS",0,true)}catch(D){}}}if(!F.table_inline_editing){try{G.execCommand("enableInlineTableEditing",false,false)}catch(D){}}if(!F.object_resizing){try{G.execCommand("enableObjectResizing",false,false)}catch(D){}}}}B.onBeforeExecCommand.add(u);B.onMouseDown.add(u)}B.onMouseUp.add(B.nodeChanged);B.onKeyUp.add(function(s,t){var D=t.keyCode;if((D>=33&&D<=36)||(D>=37&&D<=40)||D==13||D==45||D==46||D==8||(m.isMac&&(D==91||D==93))||t.ctrlKey){B.nodeChanged()}});B.onKeyDown.add(function(t,D){if(D.keyCode!=8){return}var F=t.selection.getRng().startContainer;var E=t.selection.getRng().startOffset;while(F&&F.nodeType&&F.nodeType!=1&&F.parentNode){F=F.parentNode}if(F&&F.parentNode&&F.parentNode.tagName==="BLOCKQUOTE"&&F.parentNode.firstChild==F&&E==0){t.formatter.toggle("blockquote",null,F.parentNode);var s=t.selection.getRng();s.setStart(F,0);s.setEnd(F,0);t.selection.setRng(s);t.selection.collapse(false)}});B.onReset.add(function(){B.setContent(B.startContent,{format:"raw"})});if(C.custom_shortcuts){if(C.custom_undo_redo_keyboard_shortcuts){B.addShortcut("ctrl+z",B.getLang("undo_desc"),"Undo");B.addShortcut("ctrl+y",B.getLang("redo_desc"),"Redo")}B.addShortcut("ctrl+b",B.getLang("bold_desc"),"Bold");B.addShortcut("ctrl+i",B.getLang("italic_desc"),"Italic");B.addShortcut("ctrl+u",B.getLang("underline_desc"),"Underline");for(r=1;r<=6;r++){B.addShortcut("ctrl+"+r,"",["FormatBlock",false,"h"+r])}B.addShortcut("ctrl+7","",["FormatBlock",false,"p"]);B.addShortcut("ctrl+8","",["FormatBlock",false,"div"]);B.addShortcut("ctrl+9","",["FormatBlock",false,"address"]);function v(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}i(B.shortcuts,function(D){if(m.isMac&&D.ctrl!=t.metaKey){return}else{if(!m.isMac&&D.ctrl!=t.ctrlKey){return}}if(D.alt!=t.altKey){return}if(D.shift!=t.shiftKey){return}if(t.keyCode==D.keyCode||(t.charCode&&t.charCode==D.charCode)){s=D;return false}});return s}B.onKeyUp.add(function(s,t){var D=v(t);if(D){return j.cancel(t)}});B.onKeyPress.add(function(s,t){var D=v(t);if(D){return j.cancel(t)}});B.onKeyDown.add(function(s,t){var D=v(t);if(D){D.func.call(D.scope);return j.cancel(t)}})}if(m.isIE){q.bind(B.getDoc(),"controlselect",function(D){var t=B.resizeInfo,s;D=D.target;if(D.nodeName!=="IMG"){return}if(t){q.unbind(t.node,t.ev,t.cb)}if(!q.hasClass(D,"mceItemNoResize")){ev="resizeend";s=q.bind(D,ev,function(F){var E;F=F.target;if(E=q.getStyle(F,"width")){q.setAttrib(F,"width",E.replace(/[^0-9%]+/g,""));q.setStyle(F,"width","")}if(E=q.getStyle(F,"height")){q.setAttrib(F,"height",E.replace(/[^0-9%]+/g,""));q.setStyle(F,"height","")}})}else{ev="resizestart";s=q.bind(D,"resizestart",j.cancel,j)}t=B.resizeInfo={node:D,ev:ev,cb:s}})}if(m.isOpera){B.onClick.add(function(s,t){j.prevent(t)})}if(C.custom_undo_redo){function y(){B.undoManager.typing=false;B.undoManager.add()}q.bind(B.getDoc(),"focusout",function(s){if(!B.removed&&B.undoManager.typing){y()}});B.dom.bind(B.dom.getRoot(),"dragend",function(s){y()});B.onKeyUp.add(function(s,D){var t=D.keyCode;if((t>=33&&t<=36)||(t>=37&&t<=40)||t==13||t==45||D.ctrlKey){y()}});B.onKeyDown.add(function(s,E){var D=E.keyCode,t;if(D==8){t=B.getDoc().selection;if(t&&t.createRange&&t.createRange().item){B.undoManager.beforeChange();s.dom.remove(t.createRange().item(0));y();return j.cancel(E)}}if((D>=33&&D<=36)||(D>=37&&D<=40)||D==13||D==45){if(m.isIE&&D==13){B.undoManager.beforeChange()}if(B.undoManager.typing){y()}return}if((D<16||D>20)&&D!=224&&D!=91&&!B.undoManager.typing){B.undoManager.beforeChange();B.undoManager.typing=true;B.undoManager.add()}});B.onMouseDown.add(function(){if(B.undoManager.typing){y()}})}if(m.isGecko){function A(){var s=B.dom.getAttribs(B.selection.getStart().cloneNode(false));return function(){var t=B.selection.getStart();if(t!==B.getBody()){B.dom.setAttrib(t,"style",null);i(s,function(D){t.setAttributeNode(D.cloneNode(true))})}}}function z(){var t=B.selection;return !t.isCollapsed()&&t.getStart()!=t.getEnd()}B.onKeyPress.add(function(s,D){var t;if((D.keyCode==8||D.keyCode==46)&&z()){t=A();B.getDoc().execCommand("delete",false,null);t();return j.cancel(D)}});B.dom.bind(B.getDoc(),"cut",function(t){var s;if(z()){s=A();B.onKeyUp.addToTop(j.cancel,j);setTimeout(function(){s();B.onKeyUp.remove(j.cancel,j)},0)}})}},_refreshContentEditable:function(){var q=this,p,r;if(q._isHidden()){p=q.getBody();r=p.parentNode;r.removeChild(p);r.appendChild(p);p.focus()}},_isHidden:function(){var p;if(!a){return 0}p=this.selection.getSel();return(!p||!p.rangeCount||p.rangeCount==0)}})})(tinymce);(function(c){var d=c.each,e,a=true,b=false;c.EditorCommands=function(n){var m=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,q=n.formatter,o;function r(z,y,x){var v;z=z.toLowerCase();if(v=j.exec[z]){v(z,y,x);return a}return b}function l(x){var v;x=x.toLowerCase();if(v=j.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=j.value[x]){return v(x)}return b}function u(v,x){x=x||"exec";d(v,function(z,y){d(y.toLowerCase().split(","),function(A){j[x][A]=z})})}c.extend(this,{execCommand:r,queryCommandState:l,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===e){x=b}if(v===e){v=null}return n.getDoc().execCommand(y,x,v)}function t(v){return q.match(v)}function s(v,x){q.toggle(v,x?{value:x}:e)}function i(v){o=p.getBookmark(v)}function g(){p.moveToBookmark(o)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(z){var y=n.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(c.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(A){if(A){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(v){if(p.isCollapsed()){p.select(p.getNode())}f(v);p.collapse(b)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);d("left,center,right,full".split(","),function(y){if(x!=y){q.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(p.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){i();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=c.explode(k.font_size_style_values);v=c.explode(k.font_size_classes);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){q.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||p.getNode();if(v!=n.getBody()){i();n.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(p.getNode(),function(A){if(A.nodeType==1&&v++==x){p.select(A);return b}},n.getBody())},mceSelectNode:function(y,x,v){p.select(v)},mceInsertContent:function(B,I,K){var y,J,E,z,F,G,D,C,L,x,A,M,v,H;y=n.parser;J=new c.html.Serializer({},n.schema);v='\uFEFF';G={content:K,format:"html"};p.onBeforeSetContent.dispatch(p,G);K=G.content;if(K.indexOf("{$caret}")==-1){K+="{$caret}"}K=K.replace(/\{\$caret\}/,v);if(!p.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}E=p.getNode();G={context:E.nodeName.toLowerCase()};F=y.parse(K,G);A=F.lastChild;if(A.attr("id")=="mce_marker"){D=A;for(A=A.prev;A;A=A.walk(true)){if(A.type==3||!m.isBlock(A.name)){A.parent.insert(D,A,A.name==="br");break}}}if(!G.invalid){K=J.serialize(F);A=E.firstChild;M=E.lastChild;if(!A||(A===M&&A.nodeName==="BR")){m.setHTML(E,K)}else{p.setContent(K)}}else{p.setContent(v);E=n.selection.getNode();z=n.getBody();if(E.nodeType==9){E=A=z}else{A=E}while(A!==z){E=A;A=A.parentNode}K=E==z?z.innerHTML:m.getOuterHTML(E);K=J.serialize(y.parse(K.replace(//i,function(){return J.serialize(F)})));if(E==z){m.setHTML(z,K)}else{m.setOuterHTML(E,K)}}D=m.get("mce_marker");C=m.getRect(D);L=m.getViewPort(n.getWin());if((C.y+C.h>L.y+L.h||C.yL.x+L.w||C.x")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(y,x,v){n.execCommand("mceInsertContent",false,v.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(z,y,x){var v;if(typeof(x)=="string"){x={href:x}}v=m.getParent(p.getNode(),"a");x.href=x.href.replace(" ","%20");if(!v||!x.href){q.remove("link")}if(x.href){q.apply("link",x,v)}},selectAll:function(){var x=m.getRoot(),v=m.createRng();v.setStart(x,0);v.setEnd(x,x.childNodes.length);n.selection.setRng(v)}});u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){return t("align"+v.substring(7))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(k.inline_styles){if((v=m.getParent(p.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(p.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return l("InsertUnorderedList")||l("InsertOrderedList")||(!k.inline_styles&&!!m.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(v){return m.getParent(p.getNode(),v=="insertunorderedlist"?"UL":"OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(p.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");if(k.custom_undo_redo){u({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(f){var d,e=0,h=[],c;function g(){return b.trim(f.getContent({format:"raw",no_events:1}))}return d={typing:false,onAdd:new a(d),onUndo:new a(d),onRedo:new a(d),beforeChange:function(){c=f.selection.getBookmark(2,true)},add:function(m){var j,k=f.settings,l;m=m||{};m.content=g();l=h[e];if(l&&l.content==m.content){return null}if(h[e]){h[e].beforeBookmark=c}if(k.custom_undo_redo_levels){if(h.length>k.custom_undo_redo_levels){for(j=0;j0){k=h[--e];f.setContent(k.content,{format:"raw"});f.selection.moveToBookmark(k.beforeBookmark);d.onUndo.dispatch(d,k)}return k},redo:function(){var i;if(e0||this.typing},hasRedo:function(){return e');q.replace(p,m);o.select(p,1)}return g}return d}l.create("tinymce.ForceBlocks",{ForceBlocks:function(m){var n=this,o=m.settings,p;n.editor=m;n.dom=m.dom;p=(o.forced_root_block||"p").toLowerCase();o.element=p.toUpperCase();m.onPreInit.add(n.setup,n)},setup:function(){var n=this,m=n.editor,p=m.settings,u=m.dom,o=m.selection,q=m.schema.getBlockElements();if(p.forced_root_block){function v(){var y=o.getStart(),t=m.getBody(),s,z,D,F,E,x,A,B=-16777215;if(!y||y.nodeType!==1){return}while(y!=t){if(q[y.nodeName]){return}y=y.parentNode}s=o.getRng();if(s.setStart){z=s.startContainer;D=s.startOffset;F=s.endContainer;E=s.endOffset}else{if(s.item){s=m.getDoc().body.createTextRange();s.moveToElementText(s.item(0))}tmpRng=s.duplicate();tmpRng.collapse(true);D=tmpRng.move("character",B)*-1;if(!tmpRng.collapsed){tmpRng=s.duplicate();tmpRng.collapse(false);E=(tmpRng.move("character",B)*-1)-D}}for(y=t.firstChild;y;y){if(y.nodeType===3||(y.nodeType==1&&!q[y.nodeName])){if(!x){x=u.create(p.forced_root_block);y.parentNode.insertBefore(x,y)}A=y;y=y.nextSibling;x.appendChild(A)}else{x=null;y=y.nextSibling}}if(s.setStart){s.setStart(z,D);s.setEnd(F,E);o.setRng(s)}else{try{s=m.getDoc().body.createTextRange();s.moveToElementText(t);s.collapse(true);s.moveStart("character",D);if(E>0){s.moveEnd("character",E)}s.select()}catch(C){}}m.nodeChanged()}m.onKeyUp.add(v);m.onClick.add(v)}if(p.force_br_newlines){if(c){m.onKeyPress.add(function(s,t){var x;if(t.keyCode==13&&o.getNode().nodeName!="LI"){o.setContent('
',{format:"raw"});x=u.get("__");x.removeAttribute("id");o.select(x);o.collapse();return j.cancel(t)}})}}if(p.force_p_newlines){if(!c){m.onKeyPress.add(function(s,t){if(t.keyCode==13&&!t.shiftKey&&!n.insertPara(t)){j.cancel(t)}})}else{l.addUnload(function(){n._previousFormats=0});m.onKeyPress.add(function(s,t){n._previousFormats=0;if(t.keyCode==13&&!t.shiftKey&&s.selection.isCollapsed()&&p.keep_styles){n._previousFormats=k(s.selection.getStart())}});m.onKeyUp.add(function(t,y){if(y.keyCode==13&&!y.shiftKey){var x=t.selection.getStart(),s=n._previousFormats;if(!x.hasChildNodes()&&s){x=u.getParent(x,u.isBlock);if(x&&x.nodeName!="LI"){x.innerHTML="";if(n._previousFormats){x.appendChild(s.wrapper);s.inner.innerHTML="\uFEFF"}else{x.innerHTML="\uFEFF"}o.select(x,1);o.collapse(true);t.getDoc().execCommand("Delete",false,null);n._previousFormats=0}}}})}if(a){m.onKeyDown.add(function(s,t){if((t.keyCode==8||t.keyCode==46)&&!t.shiftKey){n.backspaceDelete(t,t.keyCode==8)}})}}if(l.isWebKit){function r(t){var s=o.getRng(),x,A=u.create("div",null," "),z,y=u.getViewPort(t.getWin()).h;s.insertNode(x=u.create("br"));s.setStartAfter(x);s.setEndAfter(x);o.setRng(s);if(o.getSel().focusNode==x.previousSibling){o.select(u.insertAfter(u.doc.createTextNode("\u00a0"),x));o.collapse(d)}u.insertAfter(A,x);z=u.getPos(A).y;u.remove(A);if(z>y){t.getWin().scrollTo(0,z)}}m.onKeyPress.add(function(s,t){if(t.keyCode==13&&(t.shiftKey||(p.force_br_newlines&&!u.getParent(o.getNode(),"h1,h2,h3,h4,h5,h6,ol,ul")))){r(s);j.cancel(t)}})}if(c){if(p.element!="P"){m.onKeyPress.add(function(s,t){n.lastElm=o.getNode().nodeName});m.onKeyUp.add(function(t,x){var z,y=o.getNode(),s=t.getBody();if(s.childNodes.length===1&&y.nodeName=="P"){y=u.rename(y,p.element);o.select(y);o.collapse();t.nodeChanged()}else{if(x.keyCode==13&&!x.shiftKey&&n.lastElm!="P"){z=u.getParent(y,"p");if(z){u.rename(z,p.element);t.nodeChanged()}}}})}}},getParentBlock:function(o){var m=this.dom;return m.getParent(o,m.isBlock)},insertPara:function(Q){var E=this,v=E.editor,M=v.dom,R=v.getDoc(),V=v.settings,F=v.selection.getSel(),G=F.getRangeAt(0),U=R.body;var J,K,H,O,N,q,o,u,z,m,C,T,p,x,I,L=M.getViewPort(v.getWin()),B,D,A;v.undoManager.beforeChange();J=R.createRange();J.setStart(F.anchorNode,F.anchorOffset);J.collapse(d);K=R.createRange();K.setStart(F.focusNode,F.focusOffset);K.collapse(d);H=J.compareBoundaryPoints(J.START_TO_END,K)<0;O=H?F.anchorNode:F.focusNode;N=H?F.anchorOffset:F.focusOffset;q=H?F.focusNode:F.anchorNode;o=H?F.focusOffset:F.anchorOffset;if(O===q&&/^(TD|TH)$/.test(O.nodeName)){if(O.firstChild.nodeName=="BR"){M.remove(O.firstChild)}if(O.childNodes.length==0){v.dom.add(O,V.element,null,"
");T=v.dom.add(O,V.element,null,"
")}else{I=O.innerHTML;O.innerHTML="";v.dom.add(O,V.element,null,I);T=v.dom.add(O,V.element,null,"
")}G=R.createRange();G.selectNodeContents(T);G.collapse(1);v.selection.setRng(G);return g}if(O==U&&q==U&&U.firstChild&&v.dom.isBlock(U.firstChild)){O=q=O.firstChild;N=o=0;J=R.createRange();J.setStart(O,0);K=R.createRange();K.setStart(q,0)}if(!R.body.hasChildNodes()){R.body.appendChild(M.create("br"))}O=O.nodeName=="HTML"?R.body:O;O=O.nodeName=="BODY"?O.firstChild:O;q=q.nodeName=="HTML"?R.body:q;q=q.nodeName=="BODY"?q.firstChild:q;u=E.getParentBlock(O);z=E.getParentBlock(q);m=u?u.nodeName:V.element;if(I=E.dom.getParent(u,"li,pre")){if(I.nodeName=="LI"){return e(v.selection,E.dom,I)}return d}if(u&&(u.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(M.getStyle(u,"position",1)))){m=V.element;u=null}if(z&&(z.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(M.getStyle(u,"position",1)))){m=V.element;z=null}if(/(TD|TABLE|TH|CAPTION)/.test(m)||(u&&m=="DIV"&&/left|right/gi.test(M.getStyle(u,"float",1)))){m=V.element;u=z=null}C=(u&&u.nodeName==m)?u.cloneNode(0):v.dom.create(m);T=(z&&z.nodeName==m)?z.cloneNode(0):v.dom.create(m);T.removeAttribute("id");if(/^(H[1-6])$/.test(m)&&f(G,u)){T=v.dom.create(V.element)}I=p=O;do{if(I==U||I.nodeType==9||E.dom.isBlock(I)||/(TD|TABLE|TH|CAPTION)/.test(I.nodeName)){break}p=I}while((I=I.previousSibling?I.previousSibling:I.parentNode));I=x=q;do{if(I==U||I.nodeType==9||E.dom.isBlock(I)||/(TD|TABLE|TH|CAPTION)/.test(I.nodeName)){break}x=I}while((I=I.nextSibling?I.nextSibling:I.parentNode));if(p.nodeName==m){J.setStart(p,0)}else{J.setStartBefore(p)}J.setEnd(O,N);C.appendChild(J.cloneContents()||R.createTextNode(""));try{K.setEndAfter(x)}catch(P){}K.setStart(q,o);T.appendChild(K.cloneContents()||R.createTextNode(""));G=R.createRange();if(!p.previousSibling&&p.parentNode.nodeName==m){G.setStartBefore(p.parentNode)}else{if(J.startContainer.nodeName==m&&J.startOffset==0){G.setStartBefore(J.startContainer)}else{G.setStart(J.startContainer,J.startOffset)}}if(!x.nextSibling&&x.parentNode.nodeName==m){G.setEndAfter(x.parentNode)}else{G.setEnd(K.endContainer,K.endOffset)}G.deleteContents();if(b){v.getWin().scrollTo(0,L.y)}if(C.firstChild&&C.firstChild.nodeName==m){C.innerHTML=C.firstChild.innerHTML}if(T.firstChild&&T.firstChild.nodeName==m){T.innerHTML=T.firstChild.innerHTML}function S(y,s){var r=[],X,W,t;y.innerHTML="";if(V.keep_styles){W=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(W.nodeName)){X=W.cloneNode(g);M.setAttrib(X,"id","");r.push(X)}}while(W=W.parentNode)}if(r.length>0){for(t=r.length-1,X=y;t>=0;t--){X=X.appendChild(r[t])}r[0].innerHTML=b?"\u00a0":"
";return r[0]}else{y.innerHTML=b?"\u00a0":"
"}}if(M.isEmpty(C)){S(C,O)}if(M.isEmpty(T)){A=S(T,q)}if(b&&parseFloat(opera.version())<9.5){G.insertNode(C);G.insertNode(T)}else{G.insertNode(T);G.insertNode(C)}T.normalize();C.normalize();v.selection.select(T,true);v.selection.collapse(true);B=v.dom.getPos(T).y;if(BL.y+L.h){v.getWin().scrollTo(0,B1||ab==at){return ab}}}var al=U.selection.getRng();var ap=al.startContainer;var ak=al.endContainer;if(ap!=ak&&al.endOffset==0){var ao=am(ap,ak);var an=ao.nodeType==3?ao.length:ao.childNodes.length;al.setEnd(ao,an)}return al}function X(an,at,aq,ap,al){var ak=[],am=-1,ar,av=-1,ao=-1,au;O(an.childNodes,function(ax,aw){if(ax.nodeName==="UL"||ax.nodeName==="OL"){am=aw;ar=ax;return false}});O(an.childNodes,function(ax,aw){if(ax.nodeName==="SPAN"&&c.getAttrib(ax,"data-mce-type")=="bookmark"){if(ax.id==at.id+"_start"){av=aw}else{if(ax.id==at.id+"_end"){ao=aw}}}});if(am<=0||(avam)){O(a.grep(an.childNodes),al);return 0}else{au=aq.cloneNode(R);O(a.grep(an.childNodes),function(ax,aw){if((avam&&aw>am)){ak.push(ax);ax.parentNode.removeChild(ax)}});if(avam){an.insertBefore(au,ar.nextSibling)}}ap.push(au);O(ak,function(aw){au.appendChild(aw)});return au}}function ai(al,an,ap){var ak=[],ao,am;ao=ah.inline||ah.block;am=c.create(ao);V(am);K.walk(al,function(aq){var ar;function at(au){var ax=au.nodeName.toLowerCase(),aw=au.parentNode.nodeName.toLowerCase(),av;if(g(ax,"br")){ar=0;if(ah.block){c.remove(au)}return}if(ah.wrapper&&x(au,Y,ag)){ar=0;return}if(ah.block&&!ah.wrapper&&G(ax)){au=c.rename(au,ao);V(au);ak.push(au);ar=0;return}if(ah.selector){O(ac,function(ay){if("collapsed" in ay&&ay.collapsed!==ad){return}if(c.is(au,ay.selector)&&!b(au)){V(au,ay);av=true}});if(!ah.inline||av){ar=0;return}}if(d(ao,ax)&&d(aw,ao)&&!(!ap&&au.nodeType===3&&au.nodeValue.length===1&&au.nodeValue.charCodeAt(0)===65279)&&au.id!=="_mce_caret"){if(!ar){ar=am.cloneNode(R);au.parentNode.insertBefore(ar,au);ak.push(ar)}ar.appendChild(au)}else{if(ax=="li"&&an){ar=X(au,an,am,ak,at)}else{ar=0;O(a.grep(au.childNodes),at);ar=0}}}O(aq,at)});if(ah.wrap_links===false){O(ak,function(aq){function ar(aw){var av,au,at;if(aw.nodeName==="A"){au=am.cloneNode(R);ak.push(au);at=a.grep(aw.childNodes);for(av=0;av1||!F(at))&&aq===0){c.remove(at,1);return}if(ah.inline||ah.wrapper){if(!ah.exact&&aq===1){at=ar(at)}O(ac,function(av){O(c.select(av.inline,at),function(ax){var aw;if(av.wrap_links===false){aw=ax.parentNode;do{if(aw.nodeName==="A"){return}}while(aw=aw.parentNode)}T(av,ag,ax,av.exact?ax:null)})});if(x(at.parentNode,Y,ag)){c.remove(at,1);at=0;return B}if(ah.merge_with_parents){c.getParent(at.parentNode,function(av){if(x(av,Y,ag)){c.remove(at,1);at=0;return B}})}if(at&&ah.merge_siblings!==false){at=u(C(at),at);at=u(at,C(at,B))}}})}if(ah){if(ab){if(ab.nodeType){W=c.createRng();W.setStartBefore(ab);W.setEndAfter(ab);ai(o(W,ac),null,true)}else{ai(ab,null,true)}}else{if(!ad||!ah.inline||c.select("td.mceSelected,th.mceSelected").length){var aj=U.selection.getNode();U.selection.setRng(aa());af=q.getBookmark();ai(o(q.getRng(B),ac),af);if(ah.styles&&(ah.styles.color||ah.styles.textDecoration)){a.walk(aj,I,"childNodes");I(aj)}q.moveToBookmark(af);q.setRng(Z(q.getRng(B)));U.nodeChanged()}else{P("apply",Y,ag)}}}}function A(X,ag,aa){var ab=Q(X),ai=ab[0],af,ae,W;function Z(al){var ak=al.startContainer,aq=al.startOffset,ap,ao,am,an;if(ak.nodeType==3&&aq>=ak.nodeValue.length-1){ak=ak.parentNode;aq=s(ak)+1}if(ak.nodeType==1){am=ak.childNodes;ak=am[Math.min(aq,am.length-1)];ap=new t(ak);if(aq>am.length-1){ap.next()}for(ao=ap.current();ao;ao=ap.next()){if(ao.nodeType==3&&!f(ao)){an=c.create("a",null,E);ao.parentNode.insertBefore(an,ao);al.setStart(ao,0);q.setRng(al);c.remove(an);return}}}}function Y(an){var am,al,ak;am=a.grep(an.childNodes);for(al=0,ak=ab.length;al=0;W--){V=ab[W].selector;if(!V){return B}for(aa=X.length-1;aa>=0;aa--){if(c.is(X[aa],V)){return B}}}}return R}a.extend(this,{get:Q,register:k,apply:S,remove:A,toggle:D,match:j,matchAll:v,matchNode:x,canApply:y});function h(V,W){if(g(V,W.inline)){return B}if(g(V,W.block)){return B}if(W.selector){return c.is(V,W.selector)}}function g(W,V){W=W||"";V=V||"";W=""+(W.nodeName||W);V=""+(V.nodeName||V);return W.toLowerCase()==V.toLowerCase()}function L(W,V){var X=c.getStyle(W,V);if(V=="color"||V=="backgroundColor"){X=c.toHex(X)}if(V=="fontWeight"&&X==700){X="bold"}return""+X}function r(V,W){if(typeof(V)!="string"){V=V(W)}else{if(W){V=V.replace(/%(\w+)/g,function(Y,X){return W[X]||Y})}}return V}function f(V){return V&&V.nodeType===3&&/^([\t \r\n]+|)$/.test(V.nodeValue)}function N(X,W,V){var Y=c.create(W,V);X.parentNode.insertBefore(Y,X);Y.appendChild(X);return Y}function o(V,ah,Y){var X=V.startContainer,ac=V.startOffset,ak=V.endContainer,ae=V.endOffset,aj,ag,ab,af;function ai(aq){var al,ao,ap,an,am;al=ao=aq?X:ak;am=aq?"previousSibling":"nextSibling";root=c.getRoot();if(al.nodeType==3&&!f(al)){if(aq?ac>0:aeag?ag:ac];if(X.nodeType==3){ac=0}}if(ak.nodeType==1&&ak.hasChildNodes()){ag=ak.childNodes.length-1;ak=ak.childNodes[ae>ag?ag:ae-1];if(ak.nodeType==3){ae=ak.nodeValue.length}}if(H(X.parentNode)||H(X)){X=H(X)?X:X.parentNode;X=X.nextSibling||X;if(X.nodeType==3){ac=0}}if(H(ak.parentNode)||H(ak)){ak=H(ak)?ak:ak.parentNode;ak=ak.previousSibling||ak;if(ak.nodeType==3){ae=ak.length}}if(ah[0].inline){if(V.collapsed){function ad(am,aq,at){var ap,an,ar,al;function ao(av,ax){var ay,au,aw=av.nodeValue;if(typeof(ax)=="undefined"){ax=at?aw.length:0}if(at){ay=aw.lastIndexOf(" ",ax);au=aw.lastIndexOf("\u00a0",ax);ay=ay>au?ay:au;if(ay!==-1&&!Y){ay++}}else{ay=aw.indexOf(" ",ax);au=aw.indexOf("\u00a0",ax);ay=ay!==-1&&(au===-1||ay0&&ab.node.nodeType===3&&ab.node.nodeValue.charAt(ab.offset-1)===" "){if(ab.offset>1){ak=ab.node;ak.splitText(ab.offset-1)}else{if(ab.node.previousSibling){}}}}}if(ah[0].inline||ah[0].block_expand){if(!ah[0].inline||(X.nodeType!=3||ac===0)){X=ai(true)}if(!ah[0].inline||(ak.nodeType!=3||ae===ak.nodeValue.length)){ak=ai()}}if(ah[0].selector&&ah[0].expand!==R&&!ah[0].inline){function Z(am,al){var an,ao,aq,ap;if(am.nodeType==3&&am.nodeValue.length==0&&am[al]){am=am[al]}an=m(am);for(ao=0;aoX?X:Z]}if(V.nodeType===3&&aa&&Z>=V.nodeValue.length){V=new t(V,U.getBody()).next()||V}if(V.nodeType===3&&!aa&&Z==0){V=new t(V,U.getBody()).prev()||V}return V}function P(ae,V,ac){var ah,af="_mce_caret",W=U.settings.caret_debug;ah=a.isGecko?"\u200B":E;function X(aj){var ai=c.create("span",{id:af,"data-mce-bogus":true,style:W?"color:red":""});if(aj){ai.appendChild(U.getDoc().createTextNode(ah))}return ai}function ad(aj,ai){while(aj){if((aj.nodeType===3&&aj.nodeValue!==ah)||aj.childNodes.length>1){return false}if(ai&&aj.nodeType===1){ai.push(aj)}aj=aj.firstChild}return true}function aa(ai){while(ai){if(ai.id===af){return ai}ai=ai.parentNode}}function Z(ai){var aj;if(ai){aj=new t(ai,ai);for(ai=aj.current();ai;ai=aj.next()){if(ai.nodeType===3){return ai}}}}function Y(ak,aj){var al,ai;if(!ak){ak=aa(q.getStart());if(!ak){while(ak=c.get(af)){Y(ak,false)}}}else{ai=q.getRng(true);if(ad(ak)){if(aj!==false){ai.setStartBefore(ak);ai.setEndBefore(ak)}c.remove(ak)}else{al=Z(ak);al=al.deleteData(0,1);c.remove(ak,1)}q.setRng(ai)}}function ab(){var ak,ai,ao,an,al,aj,am;ak=q.getRng(true);an=ak.startOffset;aj=ak.startContainer;am=aj.nodeValue;ai=aa(q.getStart());if(ai){ao=Z(ai)}if(am&&an>0&&an=0;am--){ak.appendChild(aq[am].cloneNode(false));ak=ak.firstChild}ak.appendChild(c.doc.createTextNode(ah));ak=ak.firstChild;c.insertAfter(ap,ar);q.setCursorLocation(ak,1)}}U.onBeforeGetContent.addToTop(function(){var ai=[],aj;if(ad(aa(q.getStart()),ai)){aj=ai.length;while(aj--){c.setAttrib(ai[aj],"data-mce-bogus","1")}}});a.each("onMouseUp onKeyUp".split(" "),function(ai){U[ai].addToTop(function(){Y()})});U.onKeyDown.addToTop(function(ai,ak){var aj=ak.keyCode;if(aj==8||aj==37||aj==39){Y(aa(q.getStart()))}});if(ae=="apply"){ab()}else{ag()}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;if(c.inline_styles){h=e.explode(c.font_size_legacy_values);function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}}); \ No newline at end of file diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_jquery_src.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_jquery_src.js deleted file mode 100644 index 9eddd0f0c3e6..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_jquery_src.js +++ /dev/null @@ -1,15902 +0,0 @@ -(function(win) { - var whiteSpaceRe = /^\s*|\s*$/g, - undefined, isRegExpBroken = 'B'.replace(/A(.)|B/, '$1') === '$1'; - - var tinymce = { - majorVersion : '3', - - minorVersion : '4.7', - - releaseDate : '2011-11-03', - - _init : function() { - var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v; - - t.isOpera = win.opera && opera.buildNumber; - - t.isWebKit = /WebKit/.test(ua); - - t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName); - - t.isIE6 = t.isIE && /MSIE [56]/.test(ua); - - t.isIE7 = t.isIE && /MSIE [7]/.test(ua); - - t.isIE8 = t.isIE && /MSIE [8]/.test(ua); - - t.isIE9 = t.isIE && /MSIE [9]/.test(ua); - - t.isGecko = !t.isWebKit && /Gecko/.test(ua); - - t.isMac = ua.indexOf('Mac') != -1; - - t.isAir = /adobeair/i.test(ua); - - t.isIDevice = /(iPad|iPhone)/.test(ua); - - t.isIOS5 = t.isIDevice && ua.match(/AppleWebKit\/(\d*)/)[1]>=534; - - // TinyMCE .NET webcontrol might be setting the values for TinyMCE - if (win.tinyMCEPreInit) { - t.suffix = tinyMCEPreInit.suffix; - t.baseURL = tinyMCEPreInit.base; - t.query = tinyMCEPreInit.query; - return; - } - - // Get suffix and base - t.suffix = ''; - - // If base element found, add that infront of baseURL - nl = d.getElementsByTagName('base'); - for (i=0; i : - s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s); - cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name - - // Create namespace for new class - ns = t.createNS(s[3].replace(/\.\w+$/, ''), root); - - // Class already exists - if (ns[cn]) - return; - - // Make pure static class - if (s[2] == 'static') { - ns[cn] = p; - - if (this.onCreate) - this.onCreate(s[2], s[3], ns[cn]); - - return; - } - - // Create default constructor - if (!p[cn]) { - p[cn] = function() {}; - de = 1; - } - - // Add constructor and methods - ns[cn] = p[cn]; - t.extend(ns[cn].prototype, p); - - // Extend - if (s[5]) { - sp = t.resolve(s[5]).prototype; - scn = s[5].match(/\.(\w+)$/i)[1]; // Class name - - // Extend constructor - c = ns[cn]; - if (de) { - // Add passthrough constructor - ns[cn] = function() { - return sp[scn].apply(this, arguments); - }; - } else { - // Add inherit constructor - ns[cn] = function() { - this.parent = sp[scn]; - return c.apply(this, arguments); - }; - } - ns[cn].prototype[cn] = ns[cn]; - - // Add super methods - t.each(sp, function(f, n) { - ns[cn].prototype[n] = sp[n]; - }); - - // Add overridden methods - t.each(p, function(f, n) { - // Extend methods if needed - if (sp[n]) { - ns[cn].prototype[n] = function() { - this.parent = sp[n]; - return f.apply(this, arguments); - }; - } else { - if (n != cn) - ns[cn].prototype[n] = f; - } - }); - } - - // Add static methods - t.each(p['static'], function(f, n) { - ns[cn][n] = f; - }); - - if (this.onCreate) - this.onCreate(s[2], s[3], ns[cn].prototype); - }, - - walk : function(o, f, n, s) { - s = s || this; - - if (o) { - if (n) - o = o[n]; - - tinymce.each(o, function(o, i) { - if (f.call(s, o, i, n) === false) - return false; - - tinymce.walk(o, f, n, s); - }); - } - }, - - createNS : function(n, o) { - var i, v; - - o = o || win; - - n = n.split('.'); - for (i=0; i= items.length) { - for (i = 0, l = base.length; i < l; i++) { - if (i >= items.length || base[i] != items[i]) { - bp = i + 1; - break; - } - } - } - - if (base.length < items.length) { - for (i = 0, l = items.length; i < l; i++) { - if (i >= base.length || base[i] != items[i]) { - bp = i + 1; - break; - } - } - } - - if (bp == 1) - return path; - - for (i = 0, l = base.length - (bp - 1); i < l; i++) - out += "../"; - - for (i = bp - 1, l = items.length; i < l; i++) { - if (i != bp - 1) - out += "/" + items[i]; - else - out += items[i]; - } - - return out; - }, - - toAbsPath : function(base, path) { - var i, nb = 0, o = [], tr, outPath; - - // Split paths - tr = /\/$/.test(path) ? '/' : ''; - base = base.split('/'); - path = path.split('/'); - - // Remove empty chunks - each(base, function(k) { - if (k) - o.push(k); - }); - - base = o; - - // Merge relURLParts chunks - for (i = path.length - 1, o = []; i >= 0; i--) { - // Ignore empty or . - if (path[i].length == 0 || path[i] == ".") - continue; - - // Is parent - if (path[i] == '..') { - nb++; - continue; - } - - // Move up - if (nb > 0) { - nb--; - continue; - } - - o.push(path[i]); - } - - i = base.length - nb; - - // If /a/b/c or / - if (i <= 0) - outPath = o.reverse().join('/'); - else - outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/'); - - // Add front / if it's needed - if (outPath.indexOf('/') !== 0) - outPath = '/' + outPath; - - // Add traling / if it's needed - if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) - outPath += tr; - - return outPath; - }, - - getURI : function(nh) { - var s, t = this; - - // Rebuild source - if (!t.source || nh) { - s = ''; - - if (!nh) { - if (t.protocol) - s += t.protocol + '://'; - - if (t.userInfo) - s += t.userInfo + '@'; - - if (t.host) - s += t.host; - - if (t.port) - s += ':' + t.port; - } - - if (t.path) - s += t.path; - - if (t.query) - s += '?' + t.query; - - if (t.anchor) - s += '#' + t.anchor; - - t.source = s; - } - - return t.source; - } - }); -})(); - -(function() { - var each = tinymce.each; - - tinymce.create('static tinymce.util.Cookie', { - getHash : function(n) { - var v = this.get(n), h; - - if (v) { - each(v.split('&'), function(v) { - v = v.split('='); - h = h || {}; - h[unescape(v[0])] = unescape(v[1]); - }); - } - - return h; - }, - - setHash : function(n, v, e, p, d, s) { - var o = ''; - - each(v, function(v, k) { - o += (!o ? '' : '&') + escape(k) + '=' + escape(v); - }); - - this.set(n, o, e, p, d, s); - }, - - get : function(n) { - var c = document.cookie, e, p = n + "=", b; - - // Strict mode - if (!c) - return; - - b = c.indexOf("; " + p); - - if (b == -1) { - b = c.indexOf(p); - - if (b != 0) - return null; - } else - b += 2; - - e = c.indexOf(";", b); - - if (e == -1) - e = c.length; - - return unescape(c.substring(b + p.length, e)); - }, - - set : function(n, v, e, p, d, s) { - document.cookie = n + "=" + escape(v) + - ((e) ? "; expires=" + e.toUTCString() : "") + - ((p) ? "; path=" + escape(p) : "") + - ((d) ? "; domain=" + d : "") + - ((s) ? "; secure" : ""); - }, - - remove : function(n, p) { - var d = new Date(); - - d.setTime(d.getTime() - 1000); - - this.set(n, '', d, p, d); - } - }); -})(); - -(function() { - function serialize(o, quote) { - var i, v, t; - - quote = quote || '"'; - - if (o == null) - return 'null'; - - t = typeof o; - - if (t == 'string') { - v = '\bb\tt\nn\ff\rr\""\'\'\\\\'; - - return quote + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g, function(a, b) { - // Make sure single quotes never get encoded inside double quotes for JSON compatibility - if (quote === '"' && a === "'") - return a; - - i = v.indexOf(b); - - if (i + 1) - return '\\' + v.charAt(i + 1); - - a = b.charCodeAt().toString(16); - - return '\\u' + '0000'.substring(a.length) + a; - }) + quote; - } - - if (t == 'object') { - if (o.hasOwnProperty && o instanceof Array) { - for (i=0, v = '['; i 0 ? ',' : '') + serialize(o[i], quote); - - return v + ']'; - } - - v = '{'; - - for (i in o) { - if (o.hasOwnProperty(i)) { - v += typeof o[i] != 'function' ? (v.length > 1 ? ',' + quote : quote) + i + quote +':' + serialize(o[i], quote) : ''; - } - } - - return v + '}'; - } - - return '' + o; - }; - - tinymce.util.JSON = { - serialize: serialize, - - parse: function(s) { - try { - return JSON.parse(s); - } catch (ex) { - // Ignore - } - } - - }; -})(); - -tinymce.create('static tinymce.util.XHR', { - send : function(o) { - var x, t, w = window, c = 0; - - // Default settings - o.scope = o.scope || this; - o.success_scope = o.success_scope || o.scope; - o.error_scope = o.error_scope || o.scope; - o.async = o.async === false ? false : true; - o.data = o.data || ''; - - function get(s) { - x = 0; - - try { - x = new ActiveXObject(s); - } catch (ex) { - } - - return x; - }; - - x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Microsoft.XMLHTTP') || get('Msxml2.XMLHTTP'); - - if (x) { - if (x.overrideMimeType) - x.overrideMimeType(o.content_type); - - x.open(o.type || (o.data ? 'POST' : 'GET'), o.url, o.async); - - if (o.content_type) - x.setRequestHeader('Content-Type', o.content_type); - - x.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - - x.send(o.data); - - function ready() { - if (!o.async || x.readyState == 4 || c++ > 10000) { - if (o.success && c < 10000 && x.status == 200) - o.success.call(o.success_scope, '' + x.responseText, x, o); - else if (o.error) - o.error.call(o.error_scope, c > 10000 ? 'TIMED_OUT' : 'GENERAL', x, o); - - x = null; - } else - w.setTimeout(ready, 10); - }; - - // Syncronous request - if (!o.async) - return ready(); - - // Wait for response, onReadyStateChange can not be used since it leaks memory in IE - t = w.setTimeout(ready, 10); - } - } -}); - -(function() { - var extend = tinymce.extend, JSON = tinymce.util.JSON, XHR = tinymce.util.XHR; - - tinymce.create('tinymce.util.JSONRequest', { - JSONRequest : function(s) { - this.settings = extend({ - }, s); - this.count = 0; - }, - - send : function(o) { - var ecb = o.error, scb = o.success; - - o = extend(this.settings, o); - - o.success = function(c, x) { - c = JSON.parse(c); - - if (typeof(c) == 'undefined') { - c = { - error : 'JSON Parse error.' - }; - } - - if (c.error) - ecb.call(o.error_scope || o.scope, c.error, x); - else - scb.call(o.success_scope || o.scope, c.result); - }; - - o.error = function(ty, x) { - if (ecb) - ecb.call(o.error_scope || o.scope, ty, x); - }; - - o.data = JSON.serialize({ - id : o.id || 'c' + (this.count++), - method : o.method, - params : o.params - }); - - // JSON content type for Ruby on rails. Bug: #1883287 - o.content_type = 'application/json'; - - XHR.send(o); - }, - - 'static' : { - sendRPC : function(o) { - return new tinymce.util.JSONRequest().send(o); - } - } - }); -}()); -(function(tinymce){ - tinymce.VK = { - DELETE: 46, - BACKSPACE: 8, - ENTER: 13, - TAB: 9, - SPACEBAR: 32, - UP: 38, - DOWN: 40 - } -})(tinymce); - -(function(tinymce) { - var VK = tinymce.VK, BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE; - - function cleanupStylesWhenDeleting(ed) { - var dom = ed.dom, selection = ed.selection; - - ed.onKeyDown.add(function(ed, e) { - var rng, blockElm, node, clonedSpan, isDelete; - - isDelete = e.keyCode == DELETE; - if (isDelete || e.keyCode == BACKSPACE) { - e.preventDefault(); - rng = selection.getRng(); - - // Find root block - blockElm = dom.getParent(rng.startContainer, dom.isBlock); - - // On delete clone the root span of the next block element - if (isDelete) - blockElm = dom.getNext(blockElm, dom.isBlock); - - // Locate root span element and clone it since it would otherwise get merged by the "apple-style-span" on delete/backspace - if (blockElm) { - node = blockElm.firstChild; - - // Ignore empty text nodes - while (node && node.nodeType == 3 && node.nodeValue.length == 0) - node = node.nextSibling; - - if (node && node.nodeName === 'SPAN') { - clonedSpan = node.cloneNode(false); - } - } - - // Do the backspace/delete actiopn - ed.getDoc().execCommand(isDelete ? 'ForwardDelete' : 'Delete', false, null); - - // Find all odd apple-style-spans - blockElm = dom.getParent(rng.startContainer, dom.isBlock); - tinymce.each(dom.select('span.Apple-style-span,font.Apple-style-span', blockElm), function(span) { - var bm = selection.getBookmark(); - - if (clonedSpan) { - dom.replace(clonedSpan.cloneNode(false), span, true); - } else { - dom.remove(span, true); - } - - // Restore the selection - selection.moveToBookmark(bm); - }); - } - }); - }; - - function emptyEditorWhenDeleting(ed) { - ed.onKeyUp.add(function(ed, e) { - var keyCode = e.keyCode; - - if (keyCode == DELETE || keyCode == BACKSPACE) { - if (ed.dom.isEmpty(ed.getBody())) { - ed.setContent('', {format : 'raw'}); - ed.nodeChanged(); - return; - } - } - }); - }; - - function inputMethodFocus(ed) { - ed.dom.bind(ed.getDoc(), 'focusin', function() { - ed.selection.setRng(ed.selection.getRng()); - }); - }; - - function removeHrOnBackspace(ed) { - ed.onKeyDown.add(function(ed, e) { - if (e.keyCode === BACKSPACE) { - if (ed.selection.isCollapsed() && ed.selection.getRng(true).startOffset === 0) { - var node = ed.selection.getNode(); - var previousSibling = node.previousSibling; - if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "hr") { - ed.dom.remove(previousSibling); - tinymce.dom.Event.cancel(e); - } - } - } - }) - } - - function focusBody(ed) { - // Fix for a focus bug in FF 3.x where the body element - // wouldn't get proper focus if the user clicked on the HTML element - if (!Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4 - ed.onMouseDown.add(function(ed, e) { - if (e.target.nodeName === "HTML") { - var body = ed.getBody(); - - // Blur the body it's focused but not correctly focused - body.blur(); - - // Refocus the body after a little while - setTimeout(function() { - body.focus(); - }, 0); - } - }); - } - }; - - function selectControlElements(ed) { - ed.onClick.add(function(ed, e) { - e = e.target; - - if (/^(IMG|HR)$/.test(e.nodeName)) - ed.selection.select(e); - - if (e.nodeName == 'A' && ed.dom.hasClass(e, 'mceItemAnchor')) - ed.selection.select(e); - - ed.nodeChanged(); - }); - }; - - function selectionChangeNodeChanged(ed) { - var lastRng, selectionTimer; - - ed.dom.bind(ed.getDoc(), 'selectionchange', function() { - if (selectionTimer) { - clearTimeout(selectionTimer); - selectionTimer = 0; - } - - selectionTimer = window.setTimeout(function() { - var rng = ed.selection.getRng(); - - // Compare the ranges to see if it was a real change or not - if (!lastRng || !tinymce.dom.RangeUtils.compareRanges(rng, lastRng)) { - ed.nodeChanged(); - lastRng = rng; - } - }, 50); - }); - } - - function ensureBodyHasRoleApplication(ed) { - document.body.setAttribute("role", "application"); - } - - tinymce.create('tinymce.util.Quirks', { - Quirks: function(ed) { - // WebKit - if (tinymce.isWebKit) { - cleanupStylesWhenDeleting(ed); - emptyEditorWhenDeleting(ed); - inputMethodFocus(ed); - selectControlElements(ed); - - // iOS - if (tinymce.isIDevice) { - selectionChangeNodeChanged(ed); - } - } - - // IE - if (tinymce.isIE) { - removeHrOnBackspace(ed); - emptyEditorWhenDeleting(ed); - ensureBodyHasRoleApplication(ed); - } - - // Gecko - if (tinymce.isGecko) { - removeHrOnBackspace(ed); - focusBody(ed); - } - } - }); -})(tinymce); - -(function(tinymce) { - var namedEntities, baseEntities, reverseEntities, - attrsCharsRegExp = /[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, - textCharsRegExp = /[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, - rawCharsRegExp = /[<>&\"\']/g, - entityRegExp = /&(#x|#)?([\w]+);/g, - asciiMap = { - 128 : "\u20AC", 130 : "\u201A", 131 : "\u0192", 132 : "\u201E", 133 : "\u2026", 134 : "\u2020", - 135 : "\u2021", 136 : "\u02C6", 137 : "\u2030", 138 : "\u0160", 139 : "\u2039", 140 : "\u0152", - 142 : "\u017D", 145 : "\u2018", 146 : "\u2019", 147 : "\u201C", 148 : "\u201D", 149 : "\u2022", - 150 : "\u2013", 151 : "\u2014", 152 : "\u02DC", 153 : "\u2122", 154 : "\u0161", 155 : "\u203A", - 156 : "\u0153", 158 : "\u017E", 159 : "\u0178" - }; - - // Raw entities - baseEntities = { - '\"' : '"', // Needs to be escaped since the YUI compressor would otherwise break the code - "'" : ''', - '<' : '<', - '>' : '>', - '&' : '&' - }; - - // Reverse lookup table for raw entities - reverseEntities = { - '<' : '<', - '>' : '>', - '&' : '&', - '"' : '"', - ''' : "'" - }; - - // Decodes text by using the browser - function nativeDecode(text) { - var elm; - - elm = document.createElement("div"); - elm.innerHTML = text; - - return elm.textContent || elm.innerText || text; - }; - - // Build a two way lookup table for the entities - function buildEntitiesLookup(items, radix) { - var i, chr, entity, lookup = {}; - - if (items) { - items = items.split(','); - radix = radix || 10; - - // Build entities lookup table - for (i = 0; i < items.length; i += 2) { - chr = String.fromCharCode(parseInt(items[i], radix)); - - // Only add non base entities - if (!baseEntities[chr]) { - entity = '&' + items[i + 1] + ';'; - lookup[chr] = entity; - lookup[entity] = chr; - } - } - - return lookup; - } - }; - - // Unpack entities lookup where the numbers are in radix 32 to reduce the size - namedEntities = buildEntitiesLookup( - '50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,' + - '5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,' + - '5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,' + - '5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,' + - '68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,' + - '6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,' + - '6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,' + - '75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,' + - '7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,' + - '7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,' + - 'sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,' + - 'st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,' + - 't9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,' + - 'tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,' + - 'u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,' + - '81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,' + - '8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,' + - '8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,' + - '8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,' + - '8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,' + - 'nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,' + - 'rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,' + - 'Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,' + - '80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,' + - '811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro' - , 32); - - tinymce.html = tinymce.html || {}; - - tinymce.html.Entities = { - encodeRaw : function(text, attr) { - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - return baseEntities[chr] || chr; - }); - }, - - encodeAllRaw : function(text) { - return ('' + text).replace(rawCharsRegExp, function(chr) { - return baseEntities[chr] || chr; - }); - }, - - encodeNumeric : function(text, attr) { - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - // Multi byte sequence convert it to a single entity - if (chr.length > 1) - return '&#' + (((chr.charCodeAt(0) - 0xD800) * 0x400) + (chr.charCodeAt(1) - 0xDC00) + 0x10000) + ';'; - - return baseEntities[chr] || '&#' + chr.charCodeAt(0) + ';'; - }); - }, - - encodeNamed : function(text, attr, entities) { - entities = entities || namedEntities; - - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - return baseEntities[chr] || entities[chr] || chr; - }); - }, - - getEncodeFunc : function(name, entities) { - var Entities = tinymce.html.Entities; - - entities = buildEntitiesLookup(entities) || namedEntities; - - function encodeNamedAndNumeric(text, attr) { - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - return baseEntities[chr] || entities[chr] || '&#' + chr.charCodeAt(0) + ';' || chr; - }); - }; - - function encodeCustomNamed(text, attr) { - return Entities.encodeNamed(text, attr, entities); - }; - - // Replace + with , to be compatible with previous TinyMCE versions - name = tinymce.makeMap(name.replace(/\+/g, ',')); - - // Named and numeric encoder - if (name.named && name.numeric) - return encodeNamedAndNumeric; - - // Named encoder - if (name.named) { - // Custom names - if (entities) - return encodeCustomNamed; - - return Entities.encodeNamed; - } - - // Numeric - if (name.numeric) - return Entities.encodeNumeric; - - // Raw encoder - return Entities.encodeRaw; - }, - - decode : function(text) { - return text.replace(entityRegExp, function(all, numeric, value) { - if (numeric) { - value = parseInt(value, numeric.length === 2 ? 16 : 10); - - // Support upper UTF - if (value > 0xFFFF) { - value -= 0x10000; - - return String.fromCharCode(0xD800 + (value >> 10), 0xDC00 + (value & 0x3FF)); - } else - return asciiMap[value] || String.fromCharCode(value); - } - - return reverseEntities[all] || namedEntities[all] || nativeDecode(all); - }); - } - }; -})(tinymce); - -tinymce.html.Styles = function(settings, schema) { - var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi, - urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi, - styleRegExp = /\s*([^:]+):\s*([^;]+);?/g, - trimRightRegExp = /\s+$/, - urlColorRegExp = /rgb/, - undef, i, encodingLookup = {}, encodingItems; - - settings = settings || {}; - - encodingItems = '\\" \\\' \\; \\: ; : \uFEFF'.split(' '); - for (i = 0; i < encodingItems.length; i++) { - encodingLookup[encodingItems[i]] = '\uFEFF' + i; - encodingLookup['\uFEFF' + i] = encodingItems[i]; - } - - function toHex(match, r, g, b) { - function hex(val) { - val = parseInt(val).toString(16); - - return val.length > 1 ? val : '0' + val; // 0 -> 00 - }; - - return '#' + hex(r) + hex(g) + hex(b); - }; - - return { - toHex : function(color) { - return color.replace(rgbRegExp, toHex); - }, - - parse : function(css) { - var styles = {}, matches, name, value, isEncoded, urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope || this; - - function compress(prefix, suffix) { - var top, right, bottom, left; - - // Get values and check it needs compressing - top = styles[prefix + '-top' + suffix]; - if (!top) - return; - - right = styles[prefix + '-right' + suffix]; - if (top != right) - return; - - bottom = styles[prefix + '-bottom' + suffix]; - if (right != bottom) - return; - - left = styles[prefix + '-left' + suffix]; - if (bottom != left) - return; - - // Compress - styles[prefix + suffix] = left; - delete styles[prefix + '-top' + suffix]; - delete styles[prefix + '-right' + suffix]; - delete styles[prefix + '-bottom' + suffix]; - delete styles[prefix + '-left' + suffix]; - }; - - function canCompress(key) { - var value = styles[key], i; - - if (!value || value.indexOf(' ') < 0) - return; - - value = value.split(' '); - i = value.length; - while (i--) { - if (value[i] !== value[0]) - return false; - } - - styles[key] = value[0]; - - return true; - }; - - function compress2(target, a, b, c) { - if (!canCompress(a)) - return; - - if (!canCompress(b)) - return; - - if (!canCompress(c)) - return; - - // Compress - styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c]; - delete styles[a]; - delete styles[b]; - delete styles[c]; - }; - - // Encodes the specified string by replacing all \" \' ; : with _ - function encode(str) { - isEncoded = true; - - return encodingLookup[str]; - }; - - // Decodes the specified string by replacing all _ with it's original value \" \' etc - // It will also decode the \" \' if keep_slashes is set to fale or omitted - function decode(str, keep_slashes) { - if (isEncoded) { - str = str.replace(/\uFEFF[0-9]/g, function(str) { - return encodingLookup[str]; - }); - } - - if (!keep_slashes) - str = str.replace(/\\([\'\";:])/g, "$1"); - - return str; - } - - if (css) { - // Encode \" \' % and ; and : inside strings so they don't interfere with the style parsing - css = css.replace(/\\[\"\';:\uFEFF]/g, encode).replace(/\"[^\"]+\"|\'[^\']+\'/g, function(str) { - return str.replace(/[;:]/g, encode); - }); - - // Parse styles - while (matches = styleRegExp.exec(css)) { - name = matches[1].replace(trimRightRegExp, '').toLowerCase(); - value = matches[2].replace(trimRightRegExp, ''); - - if (name && value.length > 0) { - // Opera will produce 700 instead of bold in their style values - if (name === 'font-weight' && value === '700') - value = 'bold'; - else if (name === 'color' || name === 'background-color') // Lowercase colors like RED - value = value.toLowerCase(); - - // Convert RGB colors to HEX - value = value.replace(rgbRegExp, toHex); - - // Convert URLs and force them into url('value') format - value = value.replace(urlOrStrRegExp, function(match, url, url2, url3, str, str2) { - str = str || str2; - - if (str) { - str = decode(str); - - // Force strings into single quote format - return "'" + str.replace(/\'/g, "\\'") + "'"; - } - - url = decode(url || url2 || url3); - - // Convert the URL to relative/absolute depending on config - if (urlConverter) - url = urlConverter.call(urlConverterScope, url, 'style'); - - // Output new URL format - return "url('" + url.replace(/\'/g, "\\'") + "')"; - }); - - styles[name] = isEncoded ? decode(value, true) : value; - } - - styleRegExp.lastIndex = matches.index + matches[0].length; - } - - // Compress the styles to reduce it's size for example IE will expand styles - compress("border", ""); - compress("border", "-width"); - compress("border", "-color"); - compress("border", "-style"); - compress("padding", ""); - compress("margin", ""); - compress2('border', 'border-width', 'border-style', 'border-color'); - - // Remove pointless border, IE produces these - if (styles.border === 'medium none') - delete styles.border; - } - - return styles; - }, - - serialize : function(styles, element_name) { - var css = '', name, value; - - function serializeStyles(name) { - var styleList, i, l, value; - - styleList = schema.styles[name]; - if (styleList) { - for (i = 0, l = styleList.length; i < l; i++) { - name = styleList[i]; - value = styles[name]; - - if (value !== undef && value.length > 0) - css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';'; - } - } - }; - - // Serialize styles according to schema - if (element_name && schema && schema.styles) { - // Serialize global styles and element specific styles - serializeStyles('*'); - serializeStyles(element_name); - } else { - // Output the styles in the order they are inside the object - for (name in styles) { - value = styles[name]; - - if (value !== undef && value.length > 0) - css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';'; - } - } - - return css; - } - }; -}; - -(function(tinymce) { - var transitional = {}, boolAttrMap, blockElementsMap, shortEndedElementsMap, nonEmptyElementsMap, customElementsMap = {}, - defaultWhiteSpaceElementsMap, selfClosingElementsMap, makeMap = tinymce.makeMap, each = tinymce.each; - - function split(str, delim) { - return str.split(delim || ','); - }; - - function unpack(lookup, data) { - var key, elements = {}; - - function replace(value) { - return value.replace(/[A-Z]+/g, function(key) { - return replace(lookup[key]); - }); - }; - - // Unpack lookup - for (key in lookup) { - if (lookup.hasOwnProperty(key)) - lookup[key] = replace(lookup[key]); - } - - // Unpack and parse data into object map - replace(data).replace(/#/g, '#text').replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g, function(str, name, attributes, children) { - attributes = split(attributes, '|'); - - elements[name] = { - attributes : makeMap(attributes), - attributesOrder : attributes, - children : makeMap(children, '|', {'#comment' : {}}) - } - }); - - return elements; - }; - - // Build a lookup table for block elements both lowercase and uppercase - blockElementsMap = 'h1,h2,h3,h4,h5,h6,hr,p,div,address,pre,form,table,tbody,thead,tfoot,' + - 'th,tr,td,li,ol,ul,caption,blockquote,center,dl,dt,dd,dir,fieldset,' + - 'noscript,menu,isindex,samp,header,footer,article,section,hgroup'; - blockElementsMap = makeMap(blockElementsMap, ',', makeMap(blockElementsMap.toUpperCase())); - - // This is the XHTML 1.0 transitional elements with it's attributes and children packed to reduce it's size - transitional = unpack({ - Z : 'H|K|N|O|P', - Y : 'X|form|R|Q', - ZG : 'E|span|width|align|char|charoff|valign', - X : 'p|T|div|U|W|isindex|fieldset|table', - ZF : 'E|align|char|charoff|valign', - W : 'pre|hr|blockquote|address|center|noframes', - ZE : 'abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height', - ZD : '[E][S]', - U : 'ul|ol|dl|menu|dir', - ZC : 'p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q', - T : 'h1|h2|h3|h4|h5|h6', - ZB : 'X|S|Q', - S : 'R|P', - ZA : 'a|G|J|M|O|P', - R : 'a|H|K|N|O', - Q : 'noscript|P', - P : 'ins|del|script', - O : 'input|select|textarea|label|button', - N : 'M|L', - M : 'em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym', - L : 'sub|sup', - K : 'J|I', - J : 'tt|i|b|u|s|strike', - I : 'big|small|font|basefont', - H : 'G|F', - G : 'br|span|bdo', - F : 'object|applet|img|map|iframe', - E : 'A|B|C', - D : 'accesskey|tabindex|onfocus|onblur', - C : 'onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup', - B : 'lang|xml:lang|dir', - A : 'id|class|style|title' - }, 'script[id|charset|type|language|src|defer|xml:space][]' + - 'style[B|id|type|media|title|xml:space][]' + - 'object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]' + - 'param[id|name|value|valuetype|type][]' + - 'p[E|align][#|S]' + - 'a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]' + - 'br[A|clear][]' + - 'span[E][#|S]' + - 'bdo[A|C|B][#|S]' + - 'applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]' + - 'h1[E|align][#|S]' + - 'img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]' + - 'map[B|C|A|name][X|form|Q|area]' + - 'h2[E|align][#|S]' + - 'iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]' + - 'h3[E|align][#|S]' + - 'tt[E][#|S]' + - 'i[E][#|S]' + - 'b[E][#|S]' + - 'u[E][#|S]' + - 's[E][#|S]' + - 'strike[E][#|S]' + - 'big[E][#|S]' + - 'small[E][#|S]' + - 'font[A|B|size|color|face][#|S]' + - 'basefont[id|size|color|face][]' + - 'em[E][#|S]' + - 'strong[E][#|S]' + - 'dfn[E][#|S]' + - 'code[E][#|S]' + - 'q[E|cite][#|S]' + - 'samp[E][#|S]' + - 'kbd[E][#|S]' + - 'var[E][#|S]' + - 'cite[E][#|S]' + - 'abbr[E][#|S]' + - 'acronym[E][#|S]' + - 'sub[E][#|S]' + - 'sup[E][#|S]' + - 'input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]' + - 'select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]' + - 'optgroup[E|disabled|label][option]' + - 'option[E|selected|disabled|label|value][]' + - 'textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]' + - 'label[E|for|accesskey|onfocus|onblur][#|S]' + - 'button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]' + - 'h4[E|align][#|S]' + - 'ins[E|cite|datetime][#|Y]' + - 'h5[E|align][#|S]' + - 'del[E|cite|datetime][#|Y]' + - 'h6[E|align][#|S]' + - 'div[E|align][#|Y]' + - 'ul[E|type|compact][li]' + - 'li[E|type|value][#|Y]' + - 'ol[E|type|compact|start][li]' + - 'dl[E|compact][dt|dd]' + - 'dt[E][#|S]' + - 'dd[E][#|Y]' + - 'menu[E|compact][li]' + - 'dir[E|compact][li]' + - 'pre[E|width|xml:space][#|ZA]' + - 'hr[E|align|noshade|size|width][]' + - 'blockquote[E|cite][#|Y]' + - 'address[E][#|S|p]' + - 'center[E][#|Y]' + - 'noframes[E][#|Y]' + - 'isindex[A|B|prompt][]' + - 'fieldset[E][#|legend|Y]' + - 'legend[E|accesskey|align][#|S]' + - 'table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]' + - 'caption[E|align][#|S]' + - 'col[ZG][]' + - 'colgroup[ZG][col]' + - 'thead[ZF][tr]' + - 'tr[ZF|bgcolor][th|td]' + - 'th[E|ZE][#|Y]' + - 'form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]' + - 'noscript[E][#|Y]' + - 'td[E|ZE][#|Y]' + - 'tfoot[ZF][tr]' + - 'tbody[ZF][tr]' + - 'area[E|D|shape|coords|href|nohref|alt|target][]' + - 'base[id|href|target][]' + - 'body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]' - ); - - boolAttrMap = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected,autoplay,loop,controls'); - shortEndedElementsMap = makeMap('area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,source'); - nonEmptyElementsMap = tinymce.extend(makeMap('td,th,iframe,video,audio,object'), shortEndedElementsMap); - defaultWhiteSpaceElementsMap = makeMap('pre,script,style,textarea'); - selfClosingElementsMap = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr'); - - tinymce.html.Schema = function(settings) { - var self = this, elements = {}, children = {}, patternElements = [], validStyles, whiteSpaceElementsMap; - - settings = settings || {}; - - // Allow all elements and attributes if verify_html is set to false - if (settings.verify_html === false) - settings.valid_elements = '*[*]'; - - // Build styles list - if (settings.valid_styles) { - validStyles = {}; - - // Convert styles into a rule list - each(settings.valid_styles, function(value, key) { - validStyles[key] = tinymce.explode(value); - }); - } - - whiteSpaceElementsMap = settings.whitespace_elements ? makeMap(settings.whitespace_elements) : defaultWhiteSpaceElementsMap; - - // Converts a wildcard expression string to a regexp for example *a will become /.*a/. - function patternToRegExp(str) { - return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$'); - }; - - // Parses the specified valid_elements string and adds to the current rules - // This function is a bit hard to read since it's heavily optimized for speed - function addValidElements(valid_elements) { - var ei, el, ai, al, yl, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder, - prefix, outputName, globalAttributes, globalAttributesOrder, transElement, key, childKey, value, - elementRuleRegExp = /^([#+-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/, - attrRuleRegExp = /^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/, - hasPatternsRegExp = /[*?+]/; - - if (valid_elements) { - // Split valid elements into an array with rules - valid_elements = split(valid_elements); - - if (elements['@']) { - globalAttributes = elements['@'].attributes; - globalAttributesOrder = elements['@'].attributesOrder; - } - - // Loop all rules - for (ei = 0, el = valid_elements.length; ei < el; ei++) { - // Parse element rule - matches = elementRuleRegExp.exec(valid_elements[ei]); - if (matches) { - // Setup local names for matches - prefix = matches[1]; - elementName = matches[2]; - outputName = matches[3]; - attrData = matches[4]; - - // Create new attributes and attributesOrder - attributes = {}; - attributesOrder = []; - - // Create the new element - element = { - attributes : attributes, - attributesOrder : attributesOrder - }; - - // Padd empty elements prefix - if (prefix === '#') - element.paddEmpty = true; - - // Remove empty elements prefix - if (prefix === '-') - element.removeEmpty = true; - - // Copy attributes from global rule into current rule - if (globalAttributes) { - for (key in globalAttributes) - attributes[key] = globalAttributes[key]; - - attributesOrder.push.apply(attributesOrder, globalAttributesOrder); - } - - // Attributes defined - if (attrData) { - attrData = split(attrData, '|'); - for (ai = 0, al = attrData.length; ai < al; ai++) { - matches = attrRuleRegExp.exec(attrData[ai]); - if (matches) { - attr = {}; - attrType = matches[1]; - attrName = matches[2].replace(/::/g, ':'); - prefix = matches[3]; - value = matches[4]; - - // Required - if (attrType === '!') { - element.attributesRequired = element.attributesRequired || []; - element.attributesRequired.push(attrName); - attr.required = true; - } - - // Denied from global - if (attrType === '-') { - delete attributes[attrName]; - attributesOrder.splice(tinymce.inArray(attributesOrder, attrName), 1); - continue; - } - - // Default value - if (prefix) { - // Default value - if (prefix === '=') { - element.attributesDefault = element.attributesDefault || []; - element.attributesDefault.push({name: attrName, value: value}); - attr.defaultValue = value; - } - - // Forced value - if (prefix === ':') { - element.attributesForced = element.attributesForced || []; - element.attributesForced.push({name: attrName, value: value}); - attr.forcedValue = value; - } - - // Required values - if (prefix === '<') - attr.validValues = makeMap(value, '?'); - } - - // Check for attribute patterns - if (hasPatternsRegExp.test(attrName)) { - element.attributePatterns = element.attributePatterns || []; - attr.pattern = patternToRegExp(attrName); - element.attributePatterns.push(attr); - } else { - // Add attribute to order list if it doesn't already exist - if (!attributes[attrName]) - attributesOrder.push(attrName); - - attributes[attrName] = attr; - } - } - } - } - - // Global rule, store away these for later usage - if (!globalAttributes && elementName == '@') { - globalAttributes = attributes; - globalAttributesOrder = attributesOrder; - } - - // Handle substitute elements such as b/strong - if (outputName) { - element.outputName = elementName; - elements[outputName] = element; - } - - // Add pattern or exact element - if (hasPatternsRegExp.test(elementName)) { - element.pattern = patternToRegExp(elementName); - patternElements.push(element); - } else - elements[elementName] = element; - } - } - } - }; - - function setValidElements(valid_elements) { - elements = {}; - patternElements = []; - - addValidElements(valid_elements); - - each(transitional, function(element, name) { - children[name] = element.children; - }); - }; - - // Adds custom non HTML elements to the schema - function addCustomElements(custom_elements) { - var customElementRegExp = /^(~)?(.+)$/; - - if (custom_elements) { - each(split(custom_elements), function(rule) { - var matches = customElementRegExp.exec(rule), - inline = matches[1] === '~', - cloneName = inline ? 'span' : 'div', - name = matches[2]; - - children[name] = children[cloneName]; - customElementsMap[name] = cloneName; - - // If it's not marked as inline then add it to valid block elements - if (!inline) - blockElementsMap[name] = {}; - - // Add custom elements at span/div positions - each(children, function(element, child) { - if (element[cloneName]) - element[name] = element[cloneName]; - }); - }); - } - }; - - // Adds valid children to the schema object - function addValidChildren(valid_children) { - var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/; - - if (valid_children) { - each(split(valid_children), function(rule) { - var matches = childRuleRegExp.exec(rule), parent, prefix; - - if (matches) { - prefix = matches[1]; - - // Add/remove items from default - if (prefix) - parent = children[matches[2]]; - else - parent = children[matches[2]] = {'#comment' : {}}; - - parent = children[matches[2]]; - - each(split(matches[3], '|'), function(child) { - if (prefix === '-') - delete parent[child]; - else - parent[child] = {}; - }); - } - }); - } - }; - - function getElementRule(name) { - var element = elements[name], i; - - // Exact match found - if (element) - return element; - - // No exact match then try the patterns - i = patternElements.length; - while (i--) { - element = patternElements[i]; - - if (element.pattern.test(name)) - return element; - } - }; - - if (!settings.valid_elements) { - // No valid elements defined then clone the elements from the transitional spec - each(transitional, function(element, name) { - elements[name] = { - attributes : element.attributes, - attributesOrder : element.attributesOrder - }; - - children[name] = element.children; - }); - - // Switch these - each(split('strong/b,em/i'), function(item) { - item = split(item, '/'); - elements[item[1]].outputName = item[0]; - }); - - // Add default alt attribute for images - elements.img.attributesDefault = [{name: 'alt', value: ''}]; - - // Remove these if they are empty by default - each(split('ol,ul,sub,sup,blockquote,span,font,a,table,tbody,tr'), function(name) { - elements[name].removeEmpty = true; - }); - - // Padd these by default - each(split('p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption'), function(name) { - elements[name].paddEmpty = true; - }); - } else - setValidElements(settings.valid_elements); - - addCustomElements(settings.custom_elements); - addValidChildren(settings.valid_children); - addValidElements(settings.extended_valid_elements); - - // Todo: Remove this when we fix list handling to be valid - addValidChildren('+ol[ul|ol],+ul[ul|ol]'); - - // If the user didn't allow span only allow internal spans - if (!getElementRule('span')) - addValidElements('span[!data-mce-type|*]'); - - // Delete invalid elements - if (settings.invalid_elements) { - tinymce.each(tinymce.explode(settings.invalid_elements), function(item) { - if (elements[item]) - delete elements[item]; - }); - } - - self.children = children; - - self.styles = validStyles; - - self.getBoolAttrs = function() { - return boolAttrMap; - }; - - self.getBlockElements = function() { - return blockElementsMap; - }; - - self.getShortEndedElements = function() { - return shortEndedElementsMap; - }; - - self.getSelfClosingElements = function() { - return selfClosingElementsMap; - }; - - self.getNonEmptyElements = function() { - return nonEmptyElementsMap; - }; - - self.getWhiteSpaceElements = function() { - return whiteSpaceElementsMap; - }; - - self.isValidChild = function(name, child) { - var parent = children[name]; - - return !!(parent && parent[child]); - }; - - self.getElementRule = getElementRule; - - self.getCustomElements = function() { - return customElementsMap; - }; - - self.addValidElements = addValidElements; - - self.setValidElements = setValidElements; - - self.addCustomElements = addCustomElements; - - self.addValidChildren = addValidChildren; - }; - - // Expose boolMap and blockElementMap as static properties for usage in DOMUtils - tinymce.html.Schema.boolAttrMap = boolAttrMap; - tinymce.html.Schema.blockElementsMap = blockElementsMap; -})(tinymce); - -(function(tinymce) { - tinymce.html.SaxParser = function(settings, schema) { - var self = this, noop = function() {}; - - settings = settings || {}; - self.schema = schema = schema || new tinymce.html.Schema(); - - if (settings.fix_self_closing !== false) - settings.fix_self_closing = true; - - // Add handler functions from settings and setup default handlers - tinymce.each('comment cdata text start end pi doctype'.split(' '), function(name) { - if (name) - self[name] = settings[name] || noop; - }); - - self.parse = function(html) { - var self = this, matches, index = 0, value, endRegExp, stack = [], attrList, i, text, name, isInternalElement, removeInternalElements, - shortEndedElements, fillAttrsMap, isShortEnded, validate, elementRule, isValidElement, attr, attribsValue, invalidPrefixRegExp, - validAttributesMap, validAttributePatterns, attributesRequired, attributesDefault, attributesForced, selfClosing, - tokenRegExp, attrRegExp, specialElements, attrValue, idCount = 0, decode = tinymce.html.Entities.decode, fixSelfClosing, isIE; - - function processEndTag(name) { - var pos, i; - - // Find position of parent of the same type - pos = stack.length; - while (pos--) { - if (stack[pos].name === name) - break; - } - - // Found parent - if (pos >= 0) { - // Close all the open elements - for (i = stack.length - 1; i >= pos; i--) { - name = stack[i]; - - if (name.valid) - self.end(name.name); - } - - // Remove the open elements from the stack - stack.length = pos; - } - }; - - // Precompile RegExps and map objects - tokenRegExp = new RegExp('<(?:' + - '(?:!--([\\w\\W]*?)-->)|' + // Comment - '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + // CDATA - '(?:!DOCTYPE([\\w\\W]*?)>)|' + // DOCTYPE - '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + // PI - '(?:\\/([^>]+)>)|' + // End element - '(?:([^\\s\\/<>]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/)>)' + // Start element - ')', 'g'); - - attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g; - specialElements = { - 'script' : /<\/script[^>]*>/gi, - 'style' : /<\/style[^>]*>/gi, - 'noscript' : /<\/noscript[^>]*>/gi - }; - - // Setup lookup tables for empty elements and boolean attributes - shortEndedElements = schema.getShortEndedElements(); - selfClosing = schema.getSelfClosingElements(); - fillAttrsMap = schema.getBoolAttrs(); - validate = settings.validate; - removeInternalElements = settings.remove_internals; - fixSelfClosing = settings.fix_self_closing; - isIE = tinymce.isIE; - invalidPrefixRegExp = /^:/; - - while (matches = tokenRegExp.exec(html)) { - // Text - if (index < matches.index) - self.text(decode(html.substr(index, matches.index - index))); - - if (value = matches[6]) { // End element - value = value.toLowerCase(); - - // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements - if (isIE && invalidPrefixRegExp.test(value)) - value = value.substr(1); - - processEndTag(value); - } else if (value = matches[7]) { // Start element - value = value.toLowerCase(); - - // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements - if (isIE && invalidPrefixRegExp.test(value)) - value = value.substr(1); - - isShortEnded = value in shortEndedElements; - - // Is self closing tag for example an
  • after an open
  • - if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) - processEndTag(value); - - // Validate element - if (!validate || (elementRule = schema.getElementRule(value))) { - isValidElement = true; - - // Grab attributes map and patters when validation is enabled - if (validate) { - validAttributesMap = elementRule.attributes; - validAttributePatterns = elementRule.attributePatterns; - } - - // Parse attributes - if (attribsValue = matches[8]) { - isInternalElement = attribsValue.indexOf('data-mce-type') !== -1; // Check if the element is an internal element - - // If the element has internal attributes then remove it if we are told to do so - if (isInternalElement && removeInternalElements) - isValidElement = false; - - attrList = []; - attrList.map = {}; - - attribsValue.replace(attrRegExp, function(match, name, value, val2, val3) { - var attrRule, i; - - name = name.toLowerCase(); - value = name in fillAttrsMap ? name : decode(value || val2 || val3 || ''); // Handle boolean attribute than value attribute - - // Validate name and value - if (validate && !isInternalElement && name.indexOf('data-') !== 0) { - attrRule = validAttributesMap[name]; - - // Find rule by pattern matching - if (!attrRule && validAttributePatterns) { - i = validAttributePatterns.length; - while (i--) { - attrRule = validAttributePatterns[i]; - if (attrRule.pattern.test(name)) - break; - } - - // No rule matched - if (i === -1) - attrRule = null; - } - - // No attribute rule found - if (!attrRule) - return; - - // Validate value - if (attrRule.validValues && !(value in attrRule.validValues)) - return; - } - - // Add attribute to list and map - attrList.map[name] = value; - attrList.push({ - name: name, - value: value - }); - }); - } else { - attrList = []; - attrList.map = {}; - } - - // Process attributes if validation is enabled - if (validate && !isInternalElement) { - attributesRequired = elementRule.attributesRequired; - attributesDefault = elementRule.attributesDefault; - attributesForced = elementRule.attributesForced; - - // Handle forced attributes - if (attributesForced) { - i = attributesForced.length; - while (i--) { - attr = attributesForced[i]; - name = attr.name; - attrValue = attr.value; - - if (attrValue === '{$uid}') - attrValue = 'mce_' + idCount++; - - attrList.map[name] = attrValue; - attrList.push({name: name, value: attrValue}); - } - } - - // Handle default attributes - if (attributesDefault) { - i = attributesDefault.length; - while (i--) { - attr = attributesDefault[i]; - name = attr.name; - - if (!(name in attrList.map)) { - attrValue = attr.value; - - if (attrValue === '{$uid}') - attrValue = 'mce_' + idCount++; - - attrList.map[name] = attrValue; - attrList.push({name: name, value: attrValue}); - } - } - } - - // Handle required attributes - if (attributesRequired) { - i = attributesRequired.length; - while (i--) { - if (attributesRequired[i] in attrList.map) - break; - } - - // None of the required attributes where found - if (i === -1) - isValidElement = false; - } - - // Invalidate element if it's marked as bogus - if (attrList.map['data-mce-bogus']) - isValidElement = false; - } - - if (isValidElement) - self.start(value, attrList, isShortEnded); - } else - isValidElement = false; - - // Treat script, noscript and style a bit different since they may include code that looks like elements - if (endRegExp = specialElements[value]) { - endRegExp.lastIndex = index = matches.index + matches[0].length; - - if (matches = endRegExp.exec(html)) { - if (isValidElement) - text = html.substr(index, matches.index - index); - - index = matches.index + matches[0].length; - } else { - text = html.substr(index); - index = html.length; - } - - if (isValidElement && text.length > 0) - self.text(text, true); - - if (isValidElement) - self.end(value); - - tokenRegExp.lastIndex = index; - continue; - } - - // Push value on to stack - if (!isShortEnded) { - if (!attribsValue || attribsValue.indexOf('/') != attribsValue.length - 1) - stack.push({name: value, valid: isValidElement}); - else if (isValidElement) - self.end(value); - } - } else if (value = matches[1]) { // Comment - self.comment(value); - } else if (value = matches[2]) { // CDATA - self.cdata(value); - } else if (value = matches[3]) { // DOCTYPE - self.doctype(value); - } else if (value = matches[4]) { // PI - self.pi(value, matches[5]); - } - - index = matches.index + matches[0].length; - } - - // Text - if (index < html.length) - self.text(decode(html.substr(index))); - - // Close any open elements - for (i = stack.length - 1; i >= 0; i--) { - value = stack[i]; - - if (value.valid) - self.end(value.name); - } - }; - } -})(tinymce); - -(function(tinymce) { - var whiteSpaceRegExp = /^[ \t\r\n]*$/, typeLookup = { - '#text' : 3, - '#comment' : 8, - '#cdata' : 4, - '#pi' : 7, - '#doctype' : 10, - '#document-fragment' : 11 - }; - - // Walks the tree left/right - function walk(node, root_node, prev) { - var sibling, parent, startName = prev ? 'lastChild' : 'firstChild', siblingName = prev ? 'prev' : 'next'; - - // Walk into nodes if it has a start - if (node[startName]) - return node[startName]; - - // Return the sibling if it has one - if (node !== root_node) { - sibling = node[siblingName]; - - if (sibling) - return sibling; - - // Walk up the parents to look for siblings - for (parent = node.parent; parent && parent !== root_node; parent = parent.parent) { - sibling = parent[siblingName]; - - if (sibling) - return sibling; - } - } - }; - - function Node(name, type) { - this.name = name; - this.type = type; - - if (type === 1) { - this.attributes = []; - this.attributes.map = {}; - } - } - - tinymce.extend(Node.prototype, { - replace : function(node) { - var self = this; - - if (node.parent) - node.remove(); - - self.insert(node, self); - self.remove(); - - return self; - }, - - attr : function(name, value) { - var self = this, attrs, i, undef; - - if (typeof name !== "string") { - for (i in name) - self.attr(i, name[i]); - - return self; - } - - if (attrs = self.attributes) { - if (value !== undef) { - // Remove attribute - if (value === null) { - if (name in attrs.map) { - delete attrs.map[name]; - - i = attrs.length; - while (i--) { - if (attrs[i].name === name) { - attrs = attrs.splice(i, 1); - return self; - } - } - } - - return self; - } - - // Set attribute - if (name in attrs.map) { - // Set attribute - i = attrs.length; - while (i--) { - if (attrs[i].name === name) { - attrs[i].value = value; - break; - } - } - } else - attrs.push({name: name, value: value}); - - attrs.map[name] = value; - - return self; - } else { - return attrs.map[name]; - } - } - }, - - clone : function() { - var self = this, clone = new Node(self.name, self.type), i, l, selfAttrs, selfAttr, cloneAttrs; - - // Clone element attributes - if (selfAttrs = self.attributes) { - cloneAttrs = []; - cloneAttrs.map = {}; - - for (i = 0, l = selfAttrs.length; i < l; i++) { - selfAttr = selfAttrs[i]; - - // Clone everything except id - if (selfAttr.name !== 'id') { - cloneAttrs[cloneAttrs.length] = {name: selfAttr.name, value: selfAttr.value}; - cloneAttrs.map[selfAttr.name] = selfAttr.value; - } - } - - clone.attributes = cloneAttrs; - } - - clone.value = self.value; - clone.shortEnded = self.shortEnded; - - return clone; - }, - - wrap : function(wrapper) { - var self = this; - - self.parent.insert(wrapper, self); - wrapper.append(self); - - return self; - }, - - unwrap : function() { - var self = this, node, next; - - for (node = self.firstChild; node; ) { - next = node.next; - self.insert(node, self, true); - node = next; - } - - self.remove(); - }, - - remove : function() { - var self = this, parent = self.parent, next = self.next, prev = self.prev; - - if (parent) { - if (parent.firstChild === self) { - parent.firstChild = next; - - if (next) - next.prev = null; - } else { - prev.next = next; - } - - if (parent.lastChild === self) { - parent.lastChild = prev; - - if (prev) - prev.next = null; - } else { - next.prev = prev; - } - - self.parent = self.next = self.prev = null; - } - - return self; - }, - - append : function(node) { - var self = this, last; - - if (node.parent) - node.remove(); - - last = self.lastChild; - if (last) { - last.next = node; - node.prev = last; - self.lastChild = node; - } else - self.lastChild = self.firstChild = node; - - node.parent = self; - - return node; - }, - - insert : function(node, ref_node, before) { - var parent; - - if (node.parent) - node.remove(); - - parent = ref_node.parent || this; - - if (before) { - if (ref_node === parent.firstChild) - parent.firstChild = node; - else - ref_node.prev.next = node; - - node.prev = ref_node.prev; - node.next = ref_node; - ref_node.prev = node; - } else { - if (ref_node === parent.lastChild) - parent.lastChild = node; - else - ref_node.next.prev = node; - - node.next = ref_node.next; - node.prev = ref_node; - ref_node.next = node; - } - - node.parent = parent; - - return node; - }, - - getAll : function(name) { - var self = this, node, collection = []; - - for (node = self.firstChild; node; node = walk(node, self)) { - if (node.name === name) - collection.push(node); - } - - return collection; - }, - - empty : function() { - var self = this, nodes, i, node; - - // Remove all children - if (self.firstChild) { - nodes = []; - - // Collect the children - for (node = self.firstChild; node; node = walk(node, self)) - nodes.push(node); - - // Remove the children - i = nodes.length; - while (i--) { - node = nodes[i]; - node.parent = node.firstChild = node.lastChild = node.next = node.prev = null; - } - } - - self.firstChild = self.lastChild = null; - - return self; - }, - - isEmpty : function(elements) { - var self = this, node = self.firstChild, i, name; - - if (node) { - do { - if (node.type === 1) { - // Ignore bogus elements - if (node.attributes.map['data-mce-bogus']) - continue; - - // Keep empty elements like - if (elements[node.name]) - return false; - - // Keep elements with data attributes or name attribute like - i = node.attributes.length; - while (i--) { - name = node.attributes[i].name; - if (name === "name" || name.indexOf('data-') === 0) - return false; - } - } - - // Keep non whitespace text nodes - if ((node.type === 3 && !whiteSpaceRegExp.test(node.value))) - return false; - } while (node = walk(node, self)); - } - - return true; - }, - - walk : function(prev) { - return walk(this, null, prev); - } - }); - - tinymce.extend(Node, { - create : function(name, attrs) { - var node, attrName; - - // Create node - node = new Node(name, typeLookup[name] || 1); - - // Add attributes if needed - if (attrs) { - for (attrName in attrs) - node.attr(attrName, attrs[attrName]); - } - - return node; - } - }); - - tinymce.html.Node = Node; -})(tinymce); - -(function(tinymce) { - var Node = tinymce.html.Node; - - tinymce.html.DomParser = function(settings, schema) { - var self = this, nodeFilters = {}, attributeFilters = [], matchedNodes = {}, matchedAttributes = {}; - - settings = settings || {}; - settings.validate = "validate" in settings ? settings.validate : true; - settings.root_name = settings.root_name || 'body'; - self.schema = schema = schema || new tinymce.html.Schema(); - - function fixInvalidChildren(nodes) { - var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i, - childClone, nonEmptyElements, nonSplitableElements, sibling, nextNode; - - nonSplitableElements = tinymce.makeMap('tr,td,th,tbody,thead,tfoot,table'); - nonEmptyElements = schema.getNonEmptyElements(); - - for (ni = 0; ni < nodes.length; ni++) { - node = nodes[ni]; - - // Already removed - if (!node.parent) - continue; - - // Get list of all parent nodes until we find a valid parent to stick the child into - parents = [node]; - for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) && !nonSplitableElements[parent.name]; parent = parent.parent) - parents.push(parent); - - // Found a suitable parent - if (parent && parents.length > 1) { - // Reverse the array since it makes looping easier - parents.reverse(); - - // Clone the related parent and insert that after the moved node - newParent = currentNode = self.filterNode(parents[0].clone()); - - // Start cloning and moving children on the left side of the target node - for (i = 0; i < parents.length - 1; i++) { - if (schema.isValidChild(currentNode.name, parents[i].name)) { - tempNode = self.filterNode(parents[i].clone()); - currentNode.append(tempNode); - } else - tempNode = currentNode; - - for (childNode = parents[i].firstChild; childNode && childNode != parents[i + 1]; ) { - nextNode = childNode.next; - tempNode.append(childNode); - childNode = nextNode; - } - - currentNode = tempNode; - } - - if (!newParent.isEmpty(nonEmptyElements)) { - parent.insert(newParent, parents[0], true); - parent.insert(node, newParent); - } else { - parent.insert(node, parents[0], true); - } - - // Check if the element is empty by looking through it's contents and special treatment for


    - parent = parents[0]; - if (parent.isEmpty(nonEmptyElements) || parent.firstChild === parent.lastChild && parent.firstChild.name === 'br') { - parent.empty().remove(); - } - } else if (node.parent) { - // If it's an LI try to find a UL/OL for it or wrap it - if (node.name === 'li') { - sibling = node.prev; - if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) { - sibling.append(node); - continue; - } - - sibling = node.next; - if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) { - sibling.insert(node, sibling.firstChild, true); - continue; - } - - node.wrap(self.filterNode(new Node('ul', 1))); - continue; - } - - // Try wrapping the element in a DIV - if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) { - node.wrap(self.filterNode(new Node('div', 1))); - } else { - // We failed wrapping it, then remove or unwrap it - if (node.name === 'style' || node.name === 'script') - node.empty().remove(); - else - node.unwrap(); - } - } - } - }; - - self.filterNode = function(node) { - var i, name, list; - - // Run element filters - if (name in nodeFilters) { - list = matchedNodes[name]; - - if (list) - list.push(node); - else - matchedNodes[name] = [node]; - } - - // Run attribute filters - i = attributeFilters.length; - while (i--) { - name = attributeFilters[i].name; - - if (name in node.attributes.map) { - list = matchedAttributes[name]; - - if (list) - list.push(node); - else - matchedAttributes[name] = [node]; - } - } - - return node; - }; - - self.addNodeFilter = function(name, callback) { - tinymce.each(tinymce.explode(name), function(name) { - var list = nodeFilters[name]; - - if (!list) - nodeFilters[name] = list = []; - - list.push(callback); - }); - }; - - self.addAttributeFilter = function(name, callback) { - tinymce.each(tinymce.explode(name), function(name) { - var i; - - for (i = 0; i < attributeFilters.length; i++) { - if (attributeFilters[i].name === name) { - attributeFilters[i].callbacks.push(callback); - return; - } - } - - attributeFilters.push({name: name, callbacks: [callback]}); - }); - }; - - self.parse = function(html, args) { - var parser, rootNode, node, nodes, i, l, fi, fl, list, name, validate, - blockElements, startWhiteSpaceRegExp, invalidChildren = [], - endWhiteSpaceRegExp, allWhiteSpaceRegExp, whiteSpaceElements, children, nonEmptyElements, rootBlockName; - - args = args || {}; - matchedNodes = {}; - matchedAttributes = {}; - blockElements = tinymce.extend(tinymce.makeMap('script,style,head,html,body,title,meta,param'), schema.getBlockElements()); - nonEmptyElements = schema.getNonEmptyElements(); - children = schema.children; - validate = settings.validate; - rootBlockName = "forced_root_block" in args ? args.forced_root_block : settings.forced_root_block; - - whiteSpaceElements = schema.getWhiteSpaceElements(); - startWhiteSpaceRegExp = /^[ \t\r\n]+/; - endWhiteSpaceRegExp = /[ \t\r\n]+$/; - allWhiteSpaceRegExp = /[ \t\r\n]+/g; - - function addRootBlocks() { - var node = rootNode.firstChild, next, rootBlockNode; - - while (node) { - next = node.next; - - if (node.type == 3 || (node.type == 1 && node.name !== 'p' && !blockElements[node.name] && !node.attr('data-mce-type'))) { - if (!rootBlockNode) { - // Create a new root block element - rootBlockNode = createNode(rootBlockName, 1); - rootNode.insert(rootBlockNode, node); - rootBlockNode.append(node); - } else - rootBlockNode.append(node); - } else { - rootBlockNode = null; - } - - node = next; - }; - }; - - function createNode(name, type) { - var node = new Node(name, type), list; - - if (name in nodeFilters) { - list = matchedNodes[name]; - - if (list) - list.push(node); - else - matchedNodes[name] = [node]; - } - - return node; - }; - - function removeWhitespaceBefore(node) { - var textNode, textVal, sibling; - - for (textNode = node.prev; textNode && textNode.type === 3; ) { - textVal = textNode.value.replace(endWhiteSpaceRegExp, ''); - - if (textVal.length > 0) { - textNode.value = textVal; - textNode = textNode.prev; - } else { - sibling = textNode.prev; - textNode.remove(); - textNode = sibling; - } - } - }; - - parser = new tinymce.html.SaxParser({ - validate : validate, - fix_self_closing : !validate, // Let the DOM parser handle
  • in
  • or

    in

    for better results - - cdata: function(text) { - node.append(createNode('#cdata', 4)).value = text; - }, - - text: function(text, raw) { - var textNode; - - // Trim all redundant whitespace on non white space elements - if (!whiteSpaceElements[node.name]) { - text = text.replace(allWhiteSpaceRegExp, ' '); - - if (node.lastChild && blockElements[node.lastChild.name]) - text = text.replace(startWhiteSpaceRegExp, ''); - } - - // Do we need to create the node - if (text.length !== 0) { - textNode = createNode('#text', 3); - textNode.raw = !!raw; - node.append(textNode).value = text; - } - }, - - comment: function(text) { - node.append(createNode('#comment', 8)).value = text; - }, - - pi: function(name, text) { - node.append(createNode(name, 7)).value = text; - removeWhitespaceBefore(node); - }, - - doctype: function(text) { - var newNode; - - newNode = node.append(createNode('#doctype', 10)); - newNode.value = text; - removeWhitespaceBefore(node); - }, - - start: function(name, attrs, empty) { - var newNode, attrFiltersLen, elementRule, textNode, attrName, text, sibling, parent; - - elementRule = validate ? schema.getElementRule(name) : {}; - if (elementRule) { - newNode = createNode(elementRule.outputName || name, 1); - newNode.attributes = attrs; - newNode.shortEnded = empty; - - node.append(newNode); - - // Check if node is valid child of the parent node is the child is - // unknown we don't collect it since it's probably a custom element - parent = children[node.name]; - if (parent && children[newNode.name] && !parent[newNode.name]) - invalidChildren.push(newNode); - - attrFiltersLen = attributeFilters.length; - while (attrFiltersLen--) { - attrName = attributeFilters[attrFiltersLen].name; - - if (attrName in attrs.map) { - list = matchedAttributes[attrName]; - - if (list) - list.push(newNode); - else - matchedAttributes[attrName] = [newNode]; - } - } - - // Trim whitespace before block - if (blockElements[name]) - removeWhitespaceBefore(newNode); - - // Change current node if the element wasn't empty i.e not
    or - if (!empty) - node = newNode; - } - }, - - end: function(name) { - var textNode, elementRule, text, sibling, tempNode; - - elementRule = validate ? schema.getElementRule(name) : {}; - if (elementRule) { - if (blockElements[name]) { - if (!whiteSpaceElements[node.name]) { - // Trim whitespace at beginning of block - for (textNode = node.firstChild; textNode && textNode.type === 3; ) { - text = textNode.value.replace(startWhiteSpaceRegExp, ''); - - if (text.length > 0) { - textNode.value = text; - textNode = textNode.next; - } else { - sibling = textNode.next; - textNode.remove(); - textNode = sibling; - } - } - - // Trim whitespace at end of block - for (textNode = node.lastChild; textNode && textNode.type === 3; ) { - text = textNode.value.replace(endWhiteSpaceRegExp, ''); - - if (text.length > 0) { - textNode.value = text; - textNode = textNode.prev; - } else { - sibling = textNode.prev; - textNode.remove(); - textNode = sibling; - } - } - } - - // Trim start white space - textNode = node.prev; - if (textNode && textNode.type === 3) { - text = textNode.value.replace(startWhiteSpaceRegExp, ''); - - if (text.length > 0) - textNode.value = text; - else - textNode.remove(); - } - } - - // Handle empty nodes - if (elementRule.removeEmpty || elementRule.paddEmpty) { - if (node.isEmpty(nonEmptyElements)) { - if (elementRule.paddEmpty) - node.empty().append(new Node('#text', '3')).value = '\u00a0'; - else { - // Leave nodes that have a name like - if (!node.attributes.map.name) { - tempNode = node.parent; - node.empty().remove(); - node = tempNode; - return; - } - } - } - } - - node = node.parent; - } - } - }, schema); - - rootNode = node = new Node(args.context || settings.root_name, 11); - - parser.parse(html); - - // Fix invalid children or report invalid children in a contextual parsing - if (validate && invalidChildren.length) { - if (!args.context) - fixInvalidChildren(invalidChildren); - else - args.invalid = true; - } - - // Wrap nodes in the root into block elements if the root is body - if (rootBlockName && rootNode.name == 'body') - addRootBlocks(); - - // Run filters only when the contents is valid - if (!args.invalid) { - // Run node filters - for (name in matchedNodes) { - list = nodeFilters[name]; - nodes = matchedNodes[name]; - - // Remove already removed children - fi = nodes.length; - while (fi--) { - if (!nodes[fi].parent) - nodes.splice(fi, 1); - } - - for (i = 0, l = list.length; i < l; i++) - list[i](nodes, name, args); - } - - // Run attribute filters - for (i = 0, l = attributeFilters.length; i < l; i++) { - list = attributeFilters[i]; - - if (list.name in matchedAttributes) { - nodes = matchedAttributes[list.name]; - - // Remove already removed children - fi = nodes.length; - while (fi--) { - if (!nodes[fi].parent) - nodes.splice(fi, 1); - } - - for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) - list.callbacks[fi](nodes, list.name, args); - } - } - } - - return rootNode; - }; - - // Remove
    at end of block elements Gecko and WebKit injects BR elements to - // make it possible to place the caret inside empty blocks. This logic tries to remove - // these elements and keep br elements that where intended to be there intact - if (settings.remove_trailing_brs) { - self.addNodeFilter('br', function(nodes, name) { - var i, l = nodes.length, node, blockElements = schema.getBlockElements(), - nonEmptyElements = schema.getNonEmptyElements(), parent, prev, prevName; - - // Remove brs from body element as well - blockElements.body = 1; - - // Must loop forwards since it will otherwise remove all brs in

    a


    - for (i = 0; i < l; i++) { - node = nodes[i]; - parent = node.parent; - - if (blockElements[node.parent.name] && node === parent.lastChild) { - // Loop all nodes to the right of the current node and check for other BR elements - // excluding bookmarks since they are invisible - prev = node.prev; - while (prev) { - prevName = prev.name; - - // Ignore bookmarks - if (prevName !== "span" || prev.attr('data-mce-type') !== 'bookmark') { - // Found a non BR element - if (prevName !== "br") - break; - - // Found another br it's a

    structure then don't remove anything - if (prevName === 'br') { - node = null; - break; - } - } - - prev = prev.prev; - } - - if (node) { - node.remove(); - - // Is the parent to be considered empty after we removed the BR - if (parent.isEmpty(nonEmptyElements)) { - elementRule = schema.getElementRule(parent.name); - - // Remove or padd the element depending on schema rule - if (elementRule) { - if (elementRule.removeEmpty) - parent.remove(); - else if (elementRule.paddEmpty) - parent.empty().append(new tinymce.html.Node('#text', 3)).value = '\u00a0'; - } - } - } - } - } - }); - } - } -})(tinymce); - -tinymce.html.Writer = function(settings) { - var html = [], indent, indentBefore, indentAfter, encode, htmlOutput; - - settings = settings || {}; - indent = settings.indent; - indentBefore = tinymce.makeMap(settings.indent_before || ''); - indentAfter = tinymce.makeMap(settings.indent_after || ''); - encode = tinymce.html.Entities.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities); - htmlOutput = settings.element_format == "html"; - - return { - start: function(name, attrs, empty) { - var i, l, attr, value; - - if (indent && indentBefore[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') - html.push('\n'); - } - - html.push('<', name); - - if (attrs) { - for (i = 0, l = attrs.length; i < l; i++) { - attr = attrs[i]; - html.push(' ', attr.name, '="', encode(attr.value, true), '"'); - } - } - - if (!empty || htmlOutput) - html[html.length] = '>'; - else - html[html.length] = ' />'; - - if (empty && indent && indentAfter[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') - html.push('\n'); - } - }, - - end: function(name) { - var value; - - /*if (indent && indentBefore[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') - html.push('\n'); - }*/ - - html.push(''); - - if (indent && indentAfter[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') - html.push('\n'); - } - }, - - text: function(text, raw) { - if (text.length > 0) - html[html.length] = raw ? text : encode(text); - }, - - cdata: function(text) { - html.push(''); - }, - - comment: function(text) { - html.push(''); - }, - - pi: function(name, text) { - if (text) - html.push(''); - else - html.push(''); - - if (indent) - html.push('\n'); - }, - - doctype: function(text) { - html.push('', indent ? '\n' : ''); - }, - - reset: function() { - html.length = 0; - }, - - getContent: function() { - return html.join('').replace(/\n$/, ''); - } - }; -}; - -(function(tinymce) { - tinymce.html.Serializer = function(settings, schema) { - var self = this, writer = new tinymce.html.Writer(settings); - - settings = settings || {}; - settings.validate = "validate" in settings ? settings.validate : true; - - self.schema = schema = schema || new tinymce.html.Schema(); - self.writer = writer; - - self.serialize = function(node) { - var handlers, validate; - - validate = settings.validate; - - handlers = { - // #text - 3: function(node, raw) { - writer.text(node.value, node.raw); - }, - - // #comment - 8: function(node) { - writer.comment(node.value); - }, - - // Processing instruction - 7: function(node) { - writer.pi(node.name, node.value); - }, - - // Doctype - 10: function(node) { - writer.doctype(node.value); - }, - - // CDATA - 4: function(node) { - writer.cdata(node.value); - }, - - // Document fragment - 11: function(node) { - if ((node = node.firstChild)) { - do { - walk(node); - } while (node = node.next); - } - } - }; - - writer.reset(); - - function walk(node) { - var handler = handlers[node.type], name, isEmpty, attrs, attrName, attrValue, sortedAttrs, i, l, elementRule; - - if (!handler) { - name = node.name; - isEmpty = node.shortEnded; - attrs = node.attributes; - - // Sort attributes - if (validate && attrs && attrs.length > 1) { - sortedAttrs = []; - sortedAttrs.map = {}; - - elementRule = schema.getElementRule(node.name); - for (i = 0, l = elementRule.attributesOrder.length; i < l; i++) { - attrName = elementRule.attributesOrder[i]; - - if (attrName in attrs.map) { - attrValue = attrs.map[attrName]; - sortedAttrs.map[attrName] = attrValue; - sortedAttrs.push({name: attrName, value: attrValue}); - } - } - - for (i = 0, l = attrs.length; i < l; i++) { - attrName = attrs[i].name; - - if (!(attrName in sortedAttrs.map)) { - attrValue = attrs.map[attrName]; - sortedAttrs.map[attrName] = attrValue; - sortedAttrs.push({name: attrName, value: attrValue}); - } - } - - attrs = sortedAttrs; - } - - writer.start(node.name, attrs, isEmpty); - - if (!isEmpty) { - if ((node = node.firstChild)) { - do { - walk(node); - } while (node = node.next); - } - - writer.end(name); - } - } else - handler(node); - } - - // Serialize element and treat all non elements as fragments - if (node.type == 1 && !settings.inner) - walk(node); - else - handlers[11](node); - - return writer.getContent(); - }; - } -})(tinymce); - -(function(tinymce) { - // Shorten names - var each = tinymce.each, - is = tinymce.is, - isWebKit = tinymce.isWebKit, - isIE = tinymce.isIE, - Entities = tinymce.html.Entities, - simpleSelectorRe = /^([a-z0-9],?)+$/i, - blockElementsMap = tinymce.html.Schema.blockElementsMap, - whiteSpaceRegExp = /^[ \t\r\n]*$/; - - tinymce.create('tinymce.dom.DOMUtils', { - doc : null, - root : null, - files : null, - pixelStyles : /^(top|left|bottom|right|width|height|borderWidth)$/, - props : { - "for" : "htmlFor", - "class" : "className", - className : "className", - checked : "checked", - disabled : "disabled", - maxlength : "maxLength", - readonly : "readOnly", - selected : "selected", - value : "value", - id : "id", - name : "name", - type : "type" - }, - - DOMUtils : function(d, s) { - var t = this, globalStyle, name; - - t.doc = d; - t.win = window; - t.files = {}; - t.cssFlicker = false; - t.counter = 0; - t.stdMode = !tinymce.isIE || d.documentMode >= 8; - t.boxModel = !tinymce.isIE || d.compatMode == "CSS1Compat" || t.stdMode; - t.hasOuterHTML = "outerHTML" in d.createElement("a"); - - t.settings = s = tinymce.extend({ - keep_values : false, - hex_colors : 1 - }, s); - - t.schema = s.schema; - t.styles = new tinymce.html.Styles({ - url_converter : s.url_converter, - url_converter_scope : s.url_converter_scope - }, s.schema); - - // Fix IE6SP2 flicker and check it failed for pre SP2 - if (tinymce.isIE6) { - try { - d.execCommand('BackgroundImageCache', false, true); - } catch (e) { - t.cssFlicker = true; - } - } - - if (isIE && s.schema) { - // Add missing HTML 4/5 elements to IE - ('abbr article aside audio canvas ' + - 'details figcaption figure footer ' + - 'header hgroup mark menu meter nav ' + - 'output progress section summary ' + - 'time video').replace(/\w+/g, function(name) { - d.createElement(name); - }); - - // Create all custom elements - for (name in s.schema.getCustomElements()) { - d.createElement(name); - } - } - - tinymce.addUnload(t.destroy, t); - }, - - getRoot : function() { - var t = this, s = t.settings; - - return (s && t.get(s.root_element)) || t.doc.body; - }, - - getViewPort : function(w) { - var d, b; - - w = !w ? this.win : w; - d = w.document; - b = this.boxModel ? d.documentElement : d.body; - - // Returns viewport size excluding scrollbars - return { - x : w.pageXOffset || b.scrollLeft, - y : w.pageYOffset || b.scrollTop, - w : w.innerWidth || b.clientWidth, - h : w.innerHeight || b.clientHeight - }; - }, - - getRect : function(e) { - var p, t = this, sr; - - e = t.get(e); - p = t.getPos(e); - sr = t.getSize(e); - - return { - x : p.x, - y : p.y, - w : sr.w, - h : sr.h - }; - }, - - getSize : function(e) { - var t = this, w, h; - - e = t.get(e); - w = t.getStyle(e, 'width'); - h = t.getStyle(e, 'height'); - - // Non pixel value, then force offset/clientWidth - if (w.indexOf('px') === -1) - w = 0; - - // Non pixel value, then force offset/clientWidth - if (h.indexOf('px') === -1) - h = 0; - - return { - w : parseInt(w) || e.offsetWidth || e.clientWidth, - h : parseInt(h) || e.offsetHeight || e.clientHeight - }; - }, - - getParent : function(n, f, r) { - return this.getParents(n, f, r, false); - }, - - getParents : function(n, f, r, c) { - var t = this, na, se = t.settings, o = []; - - n = t.get(n); - c = c === undefined; - - if (se.strict_root) - r = r || t.getRoot(); - - // Wrap node name as func - if (is(f, 'string')) { - na = f; - - if (f === '*') { - f = function(n) {return n.nodeType == 1;}; - } else { - f = function(n) { - return t.is(n, na); - }; - } - } - - while (n) { - if (n == r || !n.nodeType || n.nodeType === 9) - break; - - if (!f || f(n)) { - if (c) - o.push(n); - else - return n; - } - - n = n.parentNode; - } - - return c ? o : null; - }, - - get : function(e) { - var n; - - if (e && this.doc && typeof(e) == 'string') { - n = e; - e = this.doc.getElementById(e); - - // IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick - if (e && e.id !== n) - return this.doc.getElementsByName(n)[1]; - } - - return e; - }, - - getNext : function(node, selector) { - return this._findSib(node, selector, 'nextSibling'); - }, - - getPrev : function(node, selector) { - return this._findSib(node, selector, 'previousSibling'); - }, - - - add : function(p, n, a, h, c) { - var t = this; - - return this.run(p, function(p) { - var e, k; - - e = is(n, 'string') ? t.doc.createElement(n) : n; - t.setAttribs(e, a); - - if (h) { - if (h.nodeType) - e.appendChild(h); - else - t.setHTML(e, h); - } - - return !c ? p.appendChild(e) : e; - }); - }, - - create : function(n, a, h) { - return this.add(this.doc.createElement(n), n, a, h, 1); - }, - - createHTML : function(n, a, h) { - var o = '', t = this, k; - - o += '<' + n; - - for (k in a) { - if (a.hasOwnProperty(k)) - o += ' ' + k + '="' + t.encode(a[k]) + '"'; - } - - // A call to tinymce.is doesn't work for some odd reason on IE9 possible bug inside their JS runtime - if (typeof(h) != "undefined") - return o + '>' + h + ''; - - return o + ' />'; - }, - - remove : function(node, keep_children) { - return this.run(node, function(node) { - var child, parent = node.parentNode; - - if (!parent) - return null; - - if (keep_children) { - while (child = node.firstChild) { - // IE 8 will crash if you don't remove completely empty text nodes - if (!tinymce.isIE || child.nodeType !== 3 || child.nodeValue) - parent.insertBefore(child, node); - else - node.removeChild(child); - } - } - - return parent.removeChild(node); - }); - }, - - setStyle : function(n, na, v) { - var t = this; - - return t.run(n, function(e) { - var s, i; - - s = e.style; - - // Camelcase it, if needed - na = na.replace(/-(\D)/g, function(a, b){ - return b.toUpperCase(); - }); - - // Default px suffix on these - if (t.pixelStyles.test(na) && (tinymce.is(v, 'number') || /^[\-0-9\.]+$/.test(v))) - v += 'px'; - - switch (na) { - case 'opacity': - // IE specific opacity - if (isIE) { - s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")"; - - if (!n.currentStyle || !n.currentStyle.hasLayout) - s.display = 'inline-block'; - } - - // Fix for older browsers - s[na] = s['-moz-opacity'] = s['-khtml-opacity'] = v || ''; - break; - - case 'float': - isIE ? s.styleFloat = v : s.cssFloat = v; - break; - - default: - s[na] = v || ''; - } - - // Force update of the style data - if (t.settings.update_styles) - t.setAttrib(e, 'data-mce-style'); - }); - }, - - getStyle : function(n, na, c) { - n = this.get(n); - - if (!n) - return; - - // Gecko - if (this.doc.defaultView && c) { - // Remove camelcase - na = na.replace(/[A-Z]/g, function(a){ - return '-' + a; - }); - - try { - return this.doc.defaultView.getComputedStyle(n, null).getPropertyValue(na); - } catch (ex) { - // Old safari might fail - return null; - } - } - - // Camelcase it, if needed - na = na.replace(/-(\D)/g, function(a, b){ - return b.toUpperCase(); - }); - - if (na == 'float') - na = isIE ? 'styleFloat' : 'cssFloat'; - - // IE & Opera - if (n.currentStyle && c) - return n.currentStyle[na]; - - return n.style ? n.style[na] : undefined; - }, - - setStyles : function(e, o) { - var t = this, s = t.settings, ol; - - ol = s.update_styles; - s.update_styles = 0; - - each(o, function(v, n) { - t.setStyle(e, n, v); - }); - - // Update style info - s.update_styles = ol; - if (s.update_styles) - t.setAttrib(e, s.cssText); - }, - - removeAllAttribs: function(e) { - return this.run(e, function(e) { - var i, attrs = e.attributes; - for (i = attrs.length - 1; i >= 0; i--) { - e.removeAttributeNode(attrs.item(i)); - } - }); - }, - - setAttrib : function(e, n, v) { - var t = this; - - // Whats the point - if (!e || !n) - return; - - // Strict XML mode - if (t.settings.strict) - n = n.toLowerCase(); - - return this.run(e, function(e) { - var s = t.settings; - if (v !== null) { - switch (n) { - case "style": - if (!is(v, 'string')) { - each(v, function(v, n) { - t.setStyle(e, n, v); - }); - - return; - } - - // No mce_style for elements with these since they might get resized by the user - if (s.keep_values) { - if (v && !t._isRes(v)) - e.setAttribute('data-mce-style', v, 2); - else - e.removeAttribute('data-mce-style', 2); - } - - e.style.cssText = v; - break; - - case "class": - e.className = v || ''; // Fix IE null bug - break; - - case "src": - case "href": - if (s.keep_values) { - if (s.url_converter) - v = s.url_converter.call(s.url_converter_scope || t, v, n, e); - - t.setAttrib(e, 'data-mce-' + n, v, 2); - } - - break; - - case "shape": - e.setAttribute('data-mce-style', v); - break; - } - } - if (is(v) && v !== null && v.length !== 0) - e.setAttribute(n, '' + v, 2); - else - e.removeAttribute(n, 2); - }); - }, - - setAttribs : function(e, o) { - var t = this; - - return this.run(e, function(e) { - each(o, function(v, n) { - t.setAttrib(e, n, v); - }); - }); - }, - - getAttrib : function(e, n, dv) { - var v, t = this, undef; - - e = t.get(e); - - if (!e || e.nodeType !== 1) - return dv === undef ? false : dv; - - if (!is(dv)) - dv = ''; - - // Try the mce variant for these - if (/^(src|href|style|coords|shape)$/.test(n)) { - v = e.getAttribute("data-mce-" + n); - - if (v) - return v; - } - - if (isIE && t.props[n]) { - v = e[t.props[n]]; - v = v && v.nodeValue ? v.nodeValue : v; - } - - if (!v) - v = e.getAttribute(n, 2); - - // Check boolean attribs - if (/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(n)) { - if (e[t.props[n]] === true && v === '') - return n; - - return v ? n : ''; - } - - // Inner input elements will override attributes on form elements - if (e.nodeName === "FORM" && e.getAttributeNode(n)) - return e.getAttributeNode(n).nodeValue; - - if (n === 'style') { - v = v || e.style.cssText; - - if (v) { - v = t.serializeStyle(t.parseStyle(v), e.nodeName); - - if (t.settings.keep_values && !t._isRes(v)) - e.setAttribute('data-mce-style', v); - } - } - - // Remove Apple and WebKit stuff - if (isWebKit && n === "class" && v) - v = v.replace(/(apple|webkit)\-[a-z\-]+/gi, ''); - - // Handle IE issues - if (isIE) { - switch (n) { - case 'rowspan': - case 'colspan': - // IE returns 1 as default value - if (v === 1) - v = ''; - - break; - - case 'size': - // IE returns +0 as default value for size - if (v === '+0' || v === 20 || v === 0) - v = ''; - - break; - - case 'width': - case 'height': - case 'vspace': - case 'checked': - case 'disabled': - case 'readonly': - if (v === 0) - v = ''; - - break; - - case 'hspace': - // IE returns -1 as default value - if (v === -1) - v = ''; - - break; - - case 'maxlength': - case 'tabindex': - // IE returns default value - if (v === 32768 || v === 2147483647 || v === '32768') - v = ''; - - break; - - case 'multiple': - case 'compact': - case 'noshade': - case 'nowrap': - if (v === 65535) - return n; - - return dv; - - case 'shape': - v = v.toLowerCase(); - break; - - default: - // IE has odd anonymous function for event attributes - if (n.indexOf('on') === 0 && v) - v = tinymce._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/, '$1', '' + v); - } - } - - return (v !== undef && v !== null && v !== '') ? '' + v : dv; - }, - - getPos : function(n, ro) { - var t = this, x = 0, y = 0, e, d = t.doc, r; - - n = t.get(n); - ro = ro || d.body; - - if (n) { - // Use getBoundingClientRect if it exists since it's faster than looping offset nodes - if (n.getBoundingClientRect) { - n = n.getBoundingClientRect(); - e = t.boxModel ? d.documentElement : d.body; - - // Add scroll offsets from documentElement or body since IE with the wrong box model will use d.body and so do WebKit - // Also remove the body/documentelement clientTop/clientLeft on IE 6, 7 since they offset the position - x = n.left + (d.documentElement.scrollLeft || d.body.scrollLeft) - e.clientTop; - y = n.top + (d.documentElement.scrollTop || d.body.scrollTop) - e.clientLeft; - - return {x : x, y : y}; - } - - r = n; - while (r && r != ro && r.nodeType) { - x += r.offsetLeft || 0; - y += r.offsetTop || 0; - r = r.offsetParent; - } - - r = n.parentNode; - while (r && r != ro && r.nodeType) { - x -= r.scrollLeft || 0; - y -= r.scrollTop || 0; - r = r.parentNode; - } - } - - return {x : x, y : y}; - }, - - parseStyle : function(st) { - return this.styles.parse(st); - }, - - serializeStyle : function(o, name) { - return this.styles.serialize(o, name); - }, - - loadCSS : function(u) { - var t = this, d = t.doc, head; - - if (!u) - u = ''; - - head = t.select('head')[0]; - - each(u.split(','), function(u) { - var link; - - if (t.files[u]) - return; - - t.files[u] = true; - link = t.create('link', {rel : 'stylesheet', href : tinymce._addVer(u)}); - - // IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug - // This fix seems to resolve that issue by realcing the document ones a stylesheet finishes loading - // It's ugly but it seems to work fine. - if (isIE && d.documentMode && d.recalc) { - link.onload = function() { - if (d.recalc) - d.recalc(); - - link.onload = null; - }; - } - - head.appendChild(link); - }); - }, - - addClass : function(e, c) { - return this.run(e, function(e) { - var o; - - if (!c) - return 0; - - if (this.hasClass(e, c)) - return e.className; - - o = this.removeClass(e, c); - - return e.className = (o != '' ? (o + ' ') : '') + c; - }); - }, - - removeClass : function(e, c) { - var t = this, re; - - return t.run(e, function(e) { - var v; - - if (t.hasClass(e, c)) { - if (!re) - re = new RegExp("(^|\\s+)" + c + "(\\s+|$)", "g"); - - v = e.className.replace(re, ' '); - v = tinymce.trim(v != ' ' ? v : ''); - - e.className = v; - - // Empty class attr - if (!v) { - e.removeAttribute('class'); - e.removeAttribute('className'); - } - - return v; - } - - return e.className; - }); - }, - - hasClass : function(n, c) { - n = this.get(n); - - if (!n || !c) - return false; - - return (' ' + n.className + ' ').indexOf(' ' + c + ' ') !== -1; - }, - - show : function(e) { - return this.setStyle(e, 'display', 'block'); - }, - - hide : function(e) { - return this.setStyle(e, 'display', 'none'); - }, - - isHidden : function(e) { - e = this.get(e); - - return !e || e.style.display == 'none' || this.getStyle(e, 'display') == 'none'; - }, - - uniqueId : function(p) { - return (!p ? 'mce_' : p) + (this.counter++); - }, - - setHTML : function(element, html) { - var self = this; - - return self.run(element, function(element) { - if (isIE) { - // Remove all child nodes, IE keeps empty text nodes in DOM - while (element.firstChild) - element.removeChild(element.firstChild); - - try { - // IE will remove comments from the beginning - // unless you padd the contents with something - element.innerHTML = '
    ' + html; - element.removeChild(element.firstChild); - } catch (ex) { - // IE sometimes produces an unknown runtime error on innerHTML if it's an block element within a block element for example a div inside a p - // This seems to fix this problem - - // Create new div with HTML contents and a BR infront to keep comments - element = self.create('div'); - element.innerHTML = '
    ' + html; - - // Add all children from div to target - each (element.childNodes, function(node, i) { - // Skip br element - if (i) - element.appendChild(node); - }); - } - } else - element.innerHTML = html; - - return html; - }); - }, - - getOuterHTML : function(elm) { - var doc, self = this; - - elm = self.get(elm); - - if (!elm) - return null; - - if (elm.nodeType === 1 && self.hasOuterHTML) - return elm.outerHTML; - - doc = (elm.ownerDocument || self.doc).createElement("body"); - doc.appendChild(elm.cloneNode(true)); - - return doc.innerHTML; - }, - - setOuterHTML : function(e, h, d) { - var t = this; - - function setHTML(e, h, d) { - var n, tp; - - tp = d.createElement("body"); - tp.innerHTML = h; - - n = tp.lastChild; - while (n) { - t.insertAfter(n.cloneNode(true), e); - n = n.previousSibling; - } - - t.remove(e); - }; - - return this.run(e, function(e) { - e = t.get(e); - - // Only set HTML on elements - if (e.nodeType == 1) { - d = d || e.ownerDocument || t.doc; - - if (isIE) { - try { - // Try outerHTML for IE it sometimes produces an unknown runtime error - if (isIE && e.nodeType == 1) - e.outerHTML = h; - else - setHTML(e, h, d); - } catch (ex) { - // Fix for unknown runtime error - setHTML(e, h, d); - } - } else - setHTML(e, h, d); - } - }); - }, - - decode : Entities.decode, - - encode : Entities.encodeAllRaw, - - insertAfter : function(node, reference_node) { - reference_node = this.get(reference_node); - - return this.run(node, function(node) { - var parent, nextSibling; - - parent = reference_node.parentNode; - nextSibling = reference_node.nextSibling; - - if (nextSibling) - parent.insertBefore(node, nextSibling); - else - parent.appendChild(node); - - return node; - }); - }, - - isBlock : function(node) { - var type = node.nodeType; - - // If it's a node then check the type and use the nodeName - if (type) - return !!(type === 1 && blockElementsMap[node.nodeName]); - - return !!blockElementsMap[node]; - }, - - replace : function(n, o, k) { - var t = this; - - if (is(o, 'array')) - n = n.cloneNode(true); - - return t.run(o, function(o) { - if (k) { - each(tinymce.grep(o.childNodes), function(c) { - n.appendChild(c); - }); - } - - return o.parentNode.replaceChild(n, o); - }); - }, - - rename : function(elm, name) { - var t = this, newElm; - - if (elm.nodeName != name.toUpperCase()) { - // Rename block element - newElm = t.create(name); - - // Copy attribs to new block - each(t.getAttribs(elm), function(attr_node) { - t.setAttrib(newElm, attr_node.nodeName, t.getAttrib(elm, attr_node.nodeName)); - }); - - // Replace block - t.replace(newElm, elm, 1); - } - - return newElm || elm; - }, - - findCommonAncestor : function(a, b) { - var ps = a, pe; - - while (ps) { - pe = b; - - while (pe && ps != pe) - pe = pe.parentNode; - - if (ps == pe) - break; - - ps = ps.parentNode; - } - - if (!ps && a.ownerDocument) - return a.ownerDocument.documentElement; - - return ps; - }, - - toHex : function(s) { - var c = /^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s); - - function hex(s) { - s = parseInt(s).toString(16); - - return s.length > 1 ? s : '0' + s; // 0 -> 00 - }; - - if (c) { - s = '#' + hex(c[1]) + hex(c[2]) + hex(c[3]); - - return s; - } - - return s; - }, - - getClasses : function() { - var t = this, cl = [], i, lo = {}, f = t.settings.class_filter, ov; - - if (t.classes) - return t.classes; - - function addClasses(s) { - // IE style imports - each(s.imports, function(r) { - addClasses(r); - }); - - each(s.cssRules || s.rules, function(r) { - // Real type or fake it on IE - switch (r.type || 1) { - // Rule - case 1: - if (r.selectorText) { - each(r.selectorText.split(','), function(v) { - v = v.replace(/^\s*|\s*$|^\s\./g, ""); - - // Is internal or it doesn't contain a class - if (/\.mce/.test(v) || !/\.[\w\-]+$/.test(v)) - return; - - // Remove everything but class name - ov = v; - v = tinymce._replace(/.*\.([a-z0-9_\-]+).*/i, '$1', v); - - // Filter classes - if (f && !(v = f(v, ov))) - return; - - if (!lo[v]) { - cl.push({'class' : v}); - lo[v] = 1; - } - }); - } - break; - - // Import - case 3: - addClasses(r.styleSheet); - break; - } - }); - }; - - try { - each(t.doc.styleSheets, addClasses); - } catch (ex) { - // Ignore - } - - if (cl.length > 0) - t.classes = cl; - - return cl; - }, - - run : function(e, f, s) { - var t = this, o; - - if (t.doc && typeof(e) === 'string') - e = t.get(e); - - if (!e) - return false; - - s = s || this; - if (!e.nodeType && (e.length || e.length === 0)) { - o = []; - - each(e, function(e, i) { - if (e) { - if (typeof(e) == 'string') - e = t.doc.getElementById(e); - - o.push(f.call(s, e, i)); - } - }); - - return o; - } - - return f.call(s, e); - }, - - getAttribs : function(n) { - var o; - - n = this.get(n); - - if (!n) - return []; - - if (isIE) { - o = []; - - // Object will throw exception in IE - if (n.nodeName == 'OBJECT') - return n.attributes; - - // IE doesn't keep the selected attribute if you clone option elements - if (n.nodeName === 'OPTION' && this.getAttrib(n, 'selected')) - o.push({specified : 1, nodeName : 'selected'}); - - // It's crazy that this is faster in IE but it's because it returns all attributes all the time - n.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi, '').replace(/[\w:\-]+/gi, function(a) { - o.push({specified : 1, nodeName : a}); - }); - - return o; - } - - return n.attributes; - }, - - isEmpty : function(node, elements) { - var self = this, i, attributes, type, walker, name, parentNode; - - node = node.firstChild; - if (node) { - walker = new tinymce.dom.TreeWalker(node); - elements = elements || self.schema ? self.schema.getNonEmptyElements() : null; - - do { - type = node.nodeType; - - if (type === 1) { - // Ignore bogus elements - if (node.getAttribute('data-mce-bogus')) - continue; - - // Keep empty elements like - name = node.nodeName.toLowerCase(); - if (elements && elements[name]) { - // Ignore single BR elements in blocks like


    - parentNode = node.parentNode; - if (name === 'br' && self.isBlock(parentNode) && parentNode.firstChild === node && parentNode.lastChild === node) { - continue; - } - - return false; - } - - // Keep elements with data-bookmark attributes or name attribute like
    - attributes = self.getAttribs(node); - i = node.attributes.length; - while (i--) { - name = node.attributes[i].nodeName; - if (name === "name" || name === 'data-mce-bookmark') - return false; - } - } - - // Keep non whitespace text nodes - if ((type === 3 && !whiteSpaceRegExp.test(node.nodeValue))) - return false; - } while (node = walker.next()); - } - - return true; - }, - - destroy : function(s) { - var t = this; - - if (t.events) - t.events.destroy(); - - t.win = t.doc = t.root = t.events = null; - - // Manual destroy then remove unload handler - if (!s) - tinymce.removeUnload(t.destroy); - }, - - createRng : function() { - var d = this.doc; - - return d.createRange ? d.createRange() : new tinymce.dom.Range(this); - }, - - nodeIndex : function(node, normalized) { - var idx = 0, lastNodeType, lastNode, nodeType; - - if (node) { - for (lastNodeType = node.nodeType, node = node.previousSibling, lastNode = node; node; node = node.previousSibling) { - nodeType = node.nodeType; - - // Normalize text nodes - if (normalized && nodeType == 3) { - if (nodeType == lastNodeType || !node.nodeValue.length) - continue; - } - idx++; - lastNodeType = nodeType; - } - } - - return idx; - }, - - split : function(pe, e, re) { - var t = this, r = t.createRng(), bef, aft, pa; - - // W3C valid browsers tend to leave empty nodes to the left/right side of the contents, this makes sense - // but we don't want that in our code since it serves no purpose for the end user - // For example if this is chopped: - //

    text 1CHOPtext 2

    - // would produce: - //

    text 1

    CHOP

    text 2

    - // this function will then trim of empty edges and produce: - //

    text 1

    CHOP

    text 2

    - function trim(node) { - var i, children = node.childNodes, type = node.nodeType; - - if (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') - return; - - for (i = children.length - 1; i >= 0; i--) - trim(children[i]); - - if (type != 9) { - // Keep non whitespace text nodes - if (type == 3 && node.nodeValue.length > 0) { - // If parent element isn't a block or there isn't any useful contents for example "

    " - if (!t.isBlock(node.parentNode) || tinymce.trim(node.nodeValue).length > 0) - return; - } else if (type == 1) { - // If the only child is a bookmark then move it up - children = node.childNodes; - if (children.length == 1 && children[0] && children[0].nodeType == 1 && children[0].getAttribute('data-mce-type') == 'bookmark') - node.parentNode.insertBefore(children[0], node); - - // Keep non empty elements or img, hr etc - if (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) - return; - } - - t.remove(node); - } - - return node; - }; - - if (pe && e) { - // Get before chunk - r.setStart(pe.parentNode, t.nodeIndex(pe)); - r.setEnd(e.parentNode, t.nodeIndex(e)); - bef = r.extractContents(); - - // Get after chunk - r = t.createRng(); - r.setStart(e.parentNode, t.nodeIndex(e) + 1); - r.setEnd(pe.parentNode, t.nodeIndex(pe) + 1); - aft = r.extractContents(); - - // Insert before chunk - pa = pe.parentNode; - pa.insertBefore(trim(bef), pe); - - // Insert middle chunk - if (re) - pa.replaceChild(re, e); - else - pa.insertBefore(e, pe); - - // Insert after chunk - pa.insertBefore(trim(aft), pe); - t.remove(pe); - - return re || e; - } - }, - - bind : function(target, name, func, scope) { - var t = this; - - if (!t.events) - t.events = new tinymce.dom.EventUtils(); - - return t.events.add(target, name, func, scope || this); - }, - - unbind : function(target, name, func) { - var t = this; - - if (!t.events) - t.events = new tinymce.dom.EventUtils(); - - return t.events.remove(target, name, func); - }, - - - _findSib : function(node, selector, name) { - var t = this, f = selector; - - if (node) { - // If expression make a function of it using is - if (is(f, 'string')) { - f = function(node) { - return t.is(node, selector); - }; - } - - // Loop all siblings - for (node = node[name]; node; node = node[name]) { - if (f(node)) - return node; - } - } - - return null; - }, - - _isRes : function(c) { - // Is live resizble element - return /^(top|left|bottom|right|width|height)/i.test(c) || /;\s*(top|left|bottom|right|width|height)/i.test(c); - } - - /* - walk : function(n, f, s) { - var d = this.doc, w; - - if (d.createTreeWalker) { - w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); - - while ((n = w.nextNode()) != null) - f.call(s || this, n); - } else - tinymce.walk(n, f, 'childNodes', s); - } - */ - - /* - toRGB : function(s) { - var c = /^\s*?#([0-9A-F]{2})([0-9A-F]{1,2})([0-9A-F]{2})?\s*?$/.exec(s); - - if (c) { - // #FFF -> #FFFFFF - if (!is(c[3])) - c[3] = c[2] = c[1]; - - return "rgb(" + parseInt(c[1], 16) + "," + parseInt(c[2], 16) + "," + parseInt(c[3], 16) + ")"; - } - - return s; - } - */ - }); - - tinymce.DOM = new tinymce.dom.DOMUtils(document, {process_html : 0}); -})(tinymce); - -(function(ns) { - // Range constructor - function Range(dom) { - var t = this, - doc = dom.doc, - EXTRACT = 0, - CLONE = 1, - DELETE = 2, - TRUE = true, - FALSE = false, - START_OFFSET = 'startOffset', - START_CONTAINER = 'startContainer', - END_CONTAINER = 'endContainer', - END_OFFSET = 'endOffset', - extend = tinymce.extend, - nodeIndex = dom.nodeIndex; - - extend(t, { - // Inital states - startContainer : doc, - startOffset : 0, - endContainer : doc, - endOffset : 0, - collapsed : TRUE, - commonAncestorContainer : doc, - - // Range constants - START_TO_START : 0, - START_TO_END : 1, - END_TO_END : 2, - END_TO_START : 3, - - // Public methods - setStart : setStart, - setEnd : setEnd, - setStartBefore : setStartBefore, - setStartAfter : setStartAfter, - setEndBefore : setEndBefore, - setEndAfter : setEndAfter, - collapse : collapse, - selectNode : selectNode, - selectNodeContents : selectNodeContents, - compareBoundaryPoints : compareBoundaryPoints, - deleteContents : deleteContents, - extractContents : extractContents, - cloneContents : cloneContents, - insertNode : insertNode, - surroundContents : surroundContents, - cloneRange : cloneRange - }); - - function setStart(n, o) { - _setEndPoint(TRUE, n, o); - }; - - function setEnd(n, o) { - _setEndPoint(FALSE, n, o); - }; - - function setStartBefore(n) { - setStart(n.parentNode, nodeIndex(n)); - }; - - function setStartAfter(n) { - setStart(n.parentNode, nodeIndex(n) + 1); - }; - - function setEndBefore(n) { - setEnd(n.parentNode, nodeIndex(n)); - }; - - function setEndAfter(n) { - setEnd(n.parentNode, nodeIndex(n) + 1); - }; - - function collapse(ts) { - if (ts) { - t[END_CONTAINER] = t[START_CONTAINER]; - t[END_OFFSET] = t[START_OFFSET]; - } else { - t[START_CONTAINER] = t[END_CONTAINER]; - t[START_OFFSET] = t[END_OFFSET]; - } - - t.collapsed = TRUE; - }; - - function selectNode(n) { - setStartBefore(n); - setEndAfter(n); - }; - - function selectNodeContents(n) { - setStart(n, 0); - setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length); - }; - - function compareBoundaryPoints(h, r) { - var sc = t[START_CONTAINER], so = t[START_OFFSET], ec = t[END_CONTAINER], eo = t[END_OFFSET], - rsc = r.startContainer, rso = r.startOffset, rec = r.endContainer, reo = r.endOffset; - - // Check START_TO_START - if (h === 0) - return _compareBoundaryPoints(sc, so, rsc, rso); - - // Check START_TO_END - if (h === 1) - return _compareBoundaryPoints(ec, eo, rsc, rso); - - // Check END_TO_END - if (h === 2) - return _compareBoundaryPoints(ec, eo, rec, reo); - - // Check END_TO_START - if (h === 3) - return _compareBoundaryPoints(sc, so, rec, reo); - }; - - function deleteContents() { - _traverse(DELETE); - }; - - function extractContents() { - return _traverse(EXTRACT); - }; - - function cloneContents() { - return _traverse(CLONE); - }; - - function insertNode(n) { - var startContainer = this[START_CONTAINER], - startOffset = this[START_OFFSET], nn, o; - - // Node is TEXT_NODE or CDATA - if ((startContainer.nodeType === 3 || startContainer.nodeType === 4) && startContainer.nodeValue) { - if (!startOffset) { - // At the start of text - startContainer.parentNode.insertBefore(n, startContainer); - } else if (startOffset >= startContainer.nodeValue.length) { - // At the end of text - dom.insertAfter(n, startContainer); - } else { - // Middle, need to split - nn = startContainer.splitText(startOffset); - startContainer.parentNode.insertBefore(n, nn); - } - } else { - // Insert element node - if (startContainer.childNodes.length > 0) - o = startContainer.childNodes[startOffset]; - - if (o) - startContainer.insertBefore(n, o); - else - startContainer.appendChild(n); - } - }; - - function surroundContents(n) { - var f = t.extractContents(); - - t.insertNode(n); - n.appendChild(f); - t.selectNode(n); - }; - - function cloneRange() { - return extend(new Range(dom), { - startContainer : t[START_CONTAINER], - startOffset : t[START_OFFSET], - endContainer : t[END_CONTAINER], - endOffset : t[END_OFFSET], - collapsed : t.collapsed, - commonAncestorContainer : t.commonAncestorContainer - }); - }; - - // Private methods - - function _getSelectedNode(container, offset) { - var child; - - if (container.nodeType == 3 /* TEXT_NODE */) - return container; - - if (offset < 0) - return container; - - child = container.firstChild; - while (child && offset > 0) { - --offset; - child = child.nextSibling; - } - - if (child) - return child; - - return container; - }; - - function _isCollapsed() { - return (t[START_CONTAINER] == t[END_CONTAINER] && t[START_OFFSET] == t[END_OFFSET]); - }; - - function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) { - var c, offsetC, n, cmnRoot, childA, childB; - - // In the first case the boundary-points have the same container. A is before B - // if its offset is less than the offset of B, A is equal to B if its offset is - // equal to the offset of B, and A is after B if its offset is greater than the - // offset of B. - if (containerA == containerB) { - if (offsetA == offsetB) - return 0; // equal - - if (offsetA < offsetB) - return -1; // before - - return 1; // after - } - - // In the second case a child node C of the container of A is an ancestor - // container of B. In this case, A is before B if the offset of A is less than or - // equal to the index of the child node C and A is after B otherwise. - c = containerB; - while (c && c.parentNode != containerA) - c = c.parentNode; - - if (c) { - offsetC = 0; - n = containerA.firstChild; - - while (n != c && offsetC < offsetA) { - offsetC++; - n = n.nextSibling; - } - - if (offsetA <= offsetC) - return -1; // before - - return 1; // after - } - - // In the third case a child node C of the container of B is an ancestor container - // of A. In this case, A is before B if the index of the child node C is less than - // the offset of B and A is after B otherwise. - c = containerA; - while (c && c.parentNode != containerB) { - c = c.parentNode; - } - - if (c) { - offsetC = 0; - n = containerB.firstChild; - - while (n != c && offsetC < offsetB) { - offsetC++; - n = n.nextSibling; - } - - if (offsetC < offsetB) - return -1; // before - - return 1; // after - } - - // In the fourth case, none of three other cases hold: the containers of A and B - // are siblings or descendants of sibling nodes. In this case, A is before B if - // the container of A is before the container of B in a pre-order traversal of the - // Ranges' context tree and A is after B otherwise. - cmnRoot = dom.findCommonAncestor(containerA, containerB); - childA = containerA; - - while (childA && childA.parentNode != cmnRoot) - childA = childA.parentNode; - - if (!childA) - childA = cmnRoot; - - childB = containerB; - while (childB && childB.parentNode != cmnRoot) - childB = childB.parentNode; - - if (!childB) - childB = cmnRoot; - - if (childA == childB) - return 0; // equal - - n = cmnRoot.firstChild; - while (n) { - if (n == childA) - return -1; // before - - if (n == childB) - return 1; // after - - n = n.nextSibling; - } - }; - - function _setEndPoint(st, n, o) { - var ec, sc; - - if (st) { - t[START_CONTAINER] = n; - t[START_OFFSET] = o; - } else { - t[END_CONTAINER] = n; - t[END_OFFSET] = o; - } - - // If one boundary-point of a Range is set to have a root container - // other than the current one for the Range, the Range is collapsed to - // the new position. This enforces the restriction that both boundary- - // points of a Range must have the same root container. - ec = t[END_CONTAINER]; - while (ec.parentNode) - ec = ec.parentNode; - - sc = t[START_CONTAINER]; - while (sc.parentNode) - sc = sc.parentNode; - - if (sc == ec) { - // The start position of a Range is guaranteed to never be after the - // end position. To enforce this restriction, if the start is set to - // be at a position after the end, the Range is collapsed to that - // position. - if (_compareBoundaryPoints(t[START_CONTAINER], t[START_OFFSET], t[END_CONTAINER], t[END_OFFSET]) > 0) - t.collapse(st); - } else - t.collapse(st); - - t.collapsed = _isCollapsed(); - t.commonAncestorContainer = dom.findCommonAncestor(t[START_CONTAINER], t[END_CONTAINER]); - }; - - function _traverse(how) { - var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep; - - if (t[START_CONTAINER] == t[END_CONTAINER]) - return _traverseSameContainer(how); - - for (c = t[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { - if (p == t[START_CONTAINER]) - return _traverseCommonStartContainer(c, how); - - ++endContainerDepth; - } - - for (c = t[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { - if (p == t[END_CONTAINER]) - return _traverseCommonEndContainer(c, how); - - ++startContainerDepth; - } - - depthDiff = startContainerDepth - endContainerDepth; - - startNode = t[START_CONTAINER]; - while (depthDiff > 0) { - startNode = startNode.parentNode; - depthDiff--; - } - - endNode = t[END_CONTAINER]; - while (depthDiff < 0) { - endNode = endNode.parentNode; - depthDiff++; - } - - // ascend the ancestor hierarchy until we have a common parent. - for (sp = startNode.parentNode, ep = endNode.parentNode; sp != ep; sp = sp.parentNode, ep = ep.parentNode) { - startNode = sp; - endNode = ep; - } - - return _traverseCommonAncestors(startNode, endNode, how); - }; - - function _traverseSameContainer(how) { - var frag, s, sub, n, cnt, sibling, xferNode; - - if (how != DELETE) - frag = doc.createDocumentFragment(); - - // If selection is empty, just return the fragment - if (t[START_OFFSET] == t[END_OFFSET]) - return frag; - - // Text node needs special case handling - if (t[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) { - // get the substring - s = t[START_CONTAINER].nodeValue; - sub = s.substring(t[START_OFFSET], t[END_OFFSET]); - - // set the original text node to its new value - if (how != CLONE) { - t[START_CONTAINER].deleteData(t[START_OFFSET], t[END_OFFSET] - t[START_OFFSET]); - - // Nothing is partially selected, so collapse to start point - t.collapse(TRUE); - } - - if (how == DELETE) - return; - - frag.appendChild(doc.createTextNode(sub)); - return frag; - } - - // Copy nodes between the start/end offsets. - n = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]); - cnt = t[END_OFFSET] - t[START_OFFSET]; - - while (cnt > 0) { - sibling = n.nextSibling; - xferNode = _traverseFullySelected(n, how); - - if (frag) - frag.appendChild( xferNode ); - - --cnt; - n = sibling; - } - - // Nothing is partially selected, so collapse to start point - if (how != CLONE) - t.collapse(TRUE); - - return frag; - }; - - function _traverseCommonStartContainer(endAncestor, how) { - var frag, n, endIdx, cnt, sibling, xferNode; - - if (how != DELETE) - frag = doc.createDocumentFragment(); - - n = _traverseRightBoundary(endAncestor, how); - - if (frag) - frag.appendChild(n); - - endIdx = nodeIndex(endAncestor); - cnt = endIdx - t[START_OFFSET]; - - if (cnt <= 0) { - // Collapse to just before the endAncestor, which - // is partially selected. - if (how != CLONE) { - t.setEndBefore(endAncestor); - t.collapse(FALSE); - } - - return frag; - } - - n = endAncestor.previousSibling; - while (cnt > 0) { - sibling = n.previousSibling; - xferNode = _traverseFullySelected(n, how); - - if (frag) - frag.insertBefore(xferNode, frag.firstChild); - - --cnt; - n = sibling; - } - - // Collapse to just before the endAncestor, which - // is partially selected. - if (how != CLONE) { - t.setEndBefore(endAncestor); - t.collapse(FALSE); - } - - return frag; - }; - - function _traverseCommonEndContainer(startAncestor, how) { - var frag, startIdx, n, cnt, sibling, xferNode; - - if (how != DELETE) - frag = doc.createDocumentFragment(); - - n = _traverseLeftBoundary(startAncestor, how); - if (frag) - frag.appendChild(n); - - startIdx = nodeIndex(startAncestor); - ++startIdx; // Because we already traversed it - - cnt = t[END_OFFSET] - startIdx; - n = startAncestor.nextSibling; - while (cnt > 0) { - sibling = n.nextSibling; - xferNode = _traverseFullySelected(n, how); - - if (frag) - frag.appendChild(xferNode); - - --cnt; - n = sibling; - } - - if (how != CLONE) { - t.setStartAfter(startAncestor); - t.collapse(TRUE); - } - - return frag; - }; - - function _traverseCommonAncestors(startAncestor, endAncestor, how) { - var n, frag, commonParent, startOffset, endOffset, cnt, sibling, nextSibling; - - if (how != DELETE) - frag = doc.createDocumentFragment(); - - n = _traverseLeftBoundary(startAncestor, how); - if (frag) - frag.appendChild(n); - - commonParent = startAncestor.parentNode; - startOffset = nodeIndex(startAncestor); - endOffset = nodeIndex(endAncestor); - ++startOffset; - - cnt = endOffset - startOffset; - sibling = startAncestor.nextSibling; - - while (cnt > 0) { - nextSibling = sibling.nextSibling; - n = _traverseFullySelected(sibling, how); - - if (frag) - frag.appendChild(n); - - sibling = nextSibling; - --cnt; - } - - n = _traverseRightBoundary(endAncestor, how); - - if (frag) - frag.appendChild(n); - - if (how != CLONE) { - t.setStartAfter(startAncestor); - t.collapse(TRUE); - } - - return frag; - }; - - function _traverseRightBoundary(root, how) { - var next = _getSelectedNode(t[END_CONTAINER], t[END_OFFSET] - 1), parent, clonedParent, prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != t[END_CONTAINER]; - - if (next == root) - return _traverseNode(next, isFullySelected, FALSE, how); - - parent = next.parentNode; - clonedParent = _traverseNode(parent, FALSE, FALSE, how); - - while (parent) { - while (next) { - prevSibling = next.previousSibling; - clonedChild = _traverseNode(next, isFullySelected, FALSE, how); - - if (how != DELETE) - clonedParent.insertBefore(clonedChild, clonedParent.firstChild); - - isFullySelected = TRUE; - next = prevSibling; - } - - if (parent == root) - return clonedParent; - - next = parent.previousSibling; - parent = parent.parentNode; - - clonedGrandParent = _traverseNode(parent, FALSE, FALSE, how); - - if (how != DELETE) - clonedGrandParent.appendChild(clonedParent); - - clonedParent = clonedGrandParent; - } - }; - - function _traverseLeftBoundary(root, how) { - var next = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]), isFullySelected = next != t[START_CONTAINER], parent, clonedParent, nextSibling, clonedChild, clonedGrandParent; - - if (next == root) - return _traverseNode(next, isFullySelected, TRUE, how); - - parent = next.parentNode; - clonedParent = _traverseNode(parent, FALSE, TRUE, how); - - while (parent) { - while (next) { - nextSibling = next.nextSibling; - clonedChild = _traverseNode(next, isFullySelected, TRUE, how); - - if (how != DELETE) - clonedParent.appendChild(clonedChild); - - isFullySelected = TRUE; - next = nextSibling; - } - - if (parent == root) - return clonedParent; - - next = parent.nextSibling; - parent = parent.parentNode; - - clonedGrandParent = _traverseNode(parent, FALSE, TRUE, how); - - if (how != DELETE) - clonedGrandParent.appendChild(clonedParent); - - clonedParent = clonedGrandParent; - } - }; - - function _traverseNode(n, isFullySelected, isLeft, how) { - var txtValue, newNodeValue, oldNodeValue, offset, newNode; - - if (isFullySelected) - return _traverseFullySelected(n, how); - - if (n.nodeType == 3 /* TEXT_NODE */) { - txtValue = n.nodeValue; - - if (isLeft) { - offset = t[START_OFFSET]; - newNodeValue = txtValue.substring(offset); - oldNodeValue = txtValue.substring(0, offset); - } else { - offset = t[END_OFFSET]; - newNodeValue = txtValue.substring(0, offset); - oldNodeValue = txtValue.substring(offset); - } - - if (how != CLONE) - n.nodeValue = oldNodeValue; - - if (how == DELETE) - return; - - newNode = n.cloneNode(FALSE); - newNode.nodeValue = newNodeValue; - - return newNode; - } - - if (how == DELETE) - return; - - return n.cloneNode(FALSE); - }; - - function _traverseFullySelected(n, how) { - if (how != DELETE) - return how == CLONE ? n.cloneNode(TRUE) : n; - - n.parentNode.removeChild(n); - }; - }; - - ns.Range = Range; -})(tinymce.dom); - -(function() { - function Selection(selection) { - var self = this, dom = selection.dom, TRUE = true, FALSE = false; - - function getPosition(rng, start) { - var checkRng, startIndex = 0, endIndex, inside, - children, child, offset, index, position = -1, parent; - - // Setup test range, collapse it and get the parent - checkRng = rng.duplicate(); - checkRng.collapse(start); - parent = checkRng.parentElement(); - - // Check if the selection is within the right document - if (parent.ownerDocument !== selection.dom.doc) - return; - - // IE will report non editable elements as it's parent so look for an editable one - while (parent.contentEditable === "false") { - parent = parent.parentNode; - } - - // If parent doesn't have any children then return that we are inside the element - if (!parent.hasChildNodes()) { - return {node : parent, inside : 1}; - } - - // Setup node list and endIndex - children = parent.children; - endIndex = children.length - 1; - - // Perform a binary search for the position - while (startIndex <= endIndex) { - index = Math.floor((startIndex + endIndex) / 2); - - // Move selection to node and compare the ranges - child = children[index]; - checkRng.moveToElementText(child); - position = checkRng.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', rng); - - // Before/after or an exact match - if (position > 0) { - endIndex = index - 1; - } else if (position < 0) { - startIndex = index + 1; - } else { - return {node : child}; - } - } - - // Check if child position is before or we didn't find a position - if (position < 0) { - // No element child was found use the parent element and the offset inside that - if (!child) { - checkRng.moveToElementText(parent); - checkRng.collapse(true); - child = parent; - inside = true; - } else - checkRng.collapse(false); - - checkRng.setEndPoint(start ? 'EndToStart' : 'EndToEnd', rng); - - // Fix for edge case:
    ..
    ab|c
    - if (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) > 0) { - checkRng = rng.duplicate(); - checkRng.collapse(start); - - offset = -1; - while (parent == checkRng.parentElement()) { - if (checkRng.move('character', -1) == 0) - break; - - offset++; - } - } - - offset = offset || checkRng.text.replace('\r\n', ' ').length; - } else { - // Child position is after the selection endpoint - checkRng.collapse(true); - checkRng.setEndPoint(start ? 'StartToStart' : 'StartToEnd', rng); - - // Get the length of the text to find where the endpoint is relative to it's container - offset = checkRng.text.replace('\r\n', ' ').length; - } - - return {node : child, position : position, offset : offset, inside : inside}; - }; - - // Returns a W3C DOM compatible range object by using the IE Range API - function getRange() { - var ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark, fail; - - // If selection is outside the current document just return an empty range - element = ieRange.item ? ieRange.item(0) : ieRange.parentElement(); - if (element.ownerDocument != dom.doc) - return domRange; - - collapsed = selection.isCollapsed(); - - // Handle control selection - if (ieRange.item) { - domRange.setStart(element.parentNode, dom.nodeIndex(element)); - domRange.setEnd(domRange.startContainer, domRange.startOffset + 1); - - return domRange; - } - - function findEndPoint(start) { - var endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue; - - container = endPoint.node; - offset = endPoint.offset; - - if (endPoint.inside && !container.hasChildNodes()) { - domRange[start ? 'setStart' : 'setEnd'](container, 0); - return; - } - - if (offset === undef) { - domRange[start ? 'setStartBefore' : 'setEndAfter'](container); - return; - } - - if (endPoint.position < 0) { - sibling = endPoint.inside ? container.firstChild : container.nextSibling; - - if (!sibling) { - domRange[start ? 'setStartAfter' : 'setEndAfter'](container); - return; - } - - if (!offset) { - if (sibling.nodeType == 3) - domRange[start ? 'setStart' : 'setEnd'](sibling, 0); - else - domRange[start ? 'setStartBefore' : 'setEndBefore'](sibling); - - return; - } - - // Find the text node and offset - while (sibling) { - nodeValue = sibling.nodeValue; - textNodeOffset += nodeValue.length; - - // We are at or passed the position we where looking for - if (textNodeOffset >= offset) { - container = sibling; - textNodeOffset -= offset; - textNodeOffset = nodeValue.length - textNodeOffset; - break; - } - - sibling = sibling.nextSibling; - } - } else { - // Find the text node and offset - sibling = container.previousSibling; - - if (!sibling) - return domRange[start ? 'setStartBefore' : 'setEndBefore'](container); - - // If there isn't any text to loop then use the first position - if (!offset) { - if (container.nodeType == 3) - domRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length); - else - domRange[start ? 'setStartAfter' : 'setEndAfter'](sibling); - - return; - } - - while (sibling) { - textNodeOffset += sibling.nodeValue.length; - - // We are at or passed the position we where looking for - if (textNodeOffset >= offset) { - container = sibling; - textNodeOffset -= offset; - break; - } - - sibling = sibling.previousSibling; - } - } - - domRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset); - }; - - try { - // Find start point - findEndPoint(true); - - // Find end point if needed - if (!collapsed) - findEndPoint(); - } catch (ex) { - // IE has a nasty bug where text nodes might throw "invalid argument" when you - // access the nodeValue or other properties of text nodes. This seems to happend when - // text nodes are split into two nodes by a delete/backspace call. So lets detect it and try to fix it. - if (ex.number == -2147024809) { - // Get the current selection - bookmark = self.getBookmark(2); - - // Get start element - tmpRange = ieRange.duplicate(); - tmpRange.collapse(true); - element = tmpRange.parentElement(); - - // Get end element - if (!collapsed) { - tmpRange = ieRange.duplicate(); - tmpRange.collapse(false); - element2 = tmpRange.parentElement(); - element2.innerHTML = element2.innerHTML; - } - - // Remove the broken elements - element.innerHTML = element.innerHTML; - - // Restore the selection - self.moveToBookmark(bookmark); - - // Since the range has moved we need to re-get it - ieRange = selection.getRng(); - - // Find start point - findEndPoint(true); - - // Find end point if needed - if (!collapsed) - findEndPoint(); - } else - throw ex; // Throw other errors - } - - return domRange; - }; - - this.getBookmark = function(type) { - var rng = selection.getRng(), start, end, bookmark = {}; - - function getIndexes(node) { - var node, parent, root, children, i, indexes = []; - - parent = node.parentNode; - root = dom.getRoot().parentNode; - - while (parent != root && parent.nodeType !== 9) { - children = parent.children; - - i = children.length; - while (i--) { - if (node === children[i]) { - indexes.push(i); - break; - } - } - - node = parent; - parent = parent.parentNode; - } - - return indexes; - }; - - function getBookmarkEndPoint(start) { - var position; - - position = getPosition(rng, start); - if (position) { - return { - position : position.position, - offset : position.offset, - indexes : getIndexes(position.node), - inside : position.inside - }; - } - }; - - // Non ubstructive bookmark - if (type === 2) { - // Handle text selection - if (!rng.item) { - bookmark.start = getBookmarkEndPoint(true); - - if (!selection.isCollapsed()) - bookmark.end = getBookmarkEndPoint(); - } else - bookmark.start = {ctrl : true, indexes : getIndexes(rng.item(0))}; - } - - return bookmark; - }; - - this.moveToBookmark = function(bookmark) { - var rng, body = dom.doc.body; - - function resolveIndexes(indexes) { - var node, i, idx, children; - - node = dom.getRoot(); - for (i = indexes.length - 1; i >= 0; i--) { - children = node.children; - idx = indexes[i]; - - if (idx <= children.length - 1) { - node = children[idx]; - } - } - - return node; - }; - - function setBookmarkEndPoint(start) { - var endPoint = bookmark[start ? 'start' : 'end'], moveLeft, moveRng, undef; - - if (endPoint) { - moveLeft = endPoint.position > 0; - - moveRng = body.createTextRange(); - moveRng.moveToElementText(resolveIndexes(endPoint.indexes)); - - offset = endPoint.offset; - if (offset !== undef) { - moveRng.collapse(endPoint.inside || moveLeft); - moveRng.moveStart('character', moveLeft ? -offset : offset); - } else - moveRng.collapse(start); - - rng.setEndPoint(start ? 'StartToStart' : 'EndToStart', moveRng); - - if (start) - rng.collapse(true); - } - }; - - if (bookmark.start) { - if (bookmark.start.ctrl) { - rng = body.createControlRange(); - rng.addElement(resolveIndexes(bookmark.start.indexes)); - rng.select(); - } else { - rng = body.createTextRange(); - setBookmarkEndPoint(true); - setBookmarkEndPoint(); - rng.select(); - } - } - }; - - this.addRange = function(rng) { - var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, doc = selection.dom.doc, body = doc.body; - - function setEndPoint(start) { - var container, offset, marker, tmpRng, nodes; - - marker = dom.create('a'); - container = start ? startContainer : endContainer; - offset = start ? startOffset : endOffset; - tmpRng = ieRng.duplicate(); - - if (container == doc || container == doc.documentElement) { - container = body; - offset = 0; - } - - if (container.nodeType == 3) { - container.parentNode.insertBefore(marker, container); - tmpRng.moveToElementText(marker); - tmpRng.moveStart('character', offset); - dom.remove(marker); - ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng); - } else { - nodes = container.childNodes; - - if (nodes.length) { - if (offset >= nodes.length) { - dom.insertAfter(marker, nodes[nodes.length - 1]); - } else { - container.insertBefore(marker, nodes[offset]); - } - - tmpRng.moveToElementText(marker); - } else { - // Empty node selection for example
    |
    - marker = doc.createTextNode('\uFEFF'); - container.appendChild(marker); - tmpRng.moveToElementText(marker.parentNode); - tmpRng.collapse(TRUE); - } - - ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng); - dom.remove(marker); - } - } - - // Setup some shorter versions - startContainer = rng.startContainer; - startOffset = rng.startOffset; - endContainer = rng.endContainer; - endOffset = rng.endOffset; - ieRng = body.createTextRange(); - - // If single element selection then try making a control selection out of it - if (startContainer == endContainer && startContainer.nodeType == 1 && startOffset == endOffset - 1) { - if (startOffset == endOffset - 1) { - try { - ctrlRng = body.createControlRange(); - ctrlRng.addElement(startContainer.childNodes[startOffset]); - ctrlRng.select(); - return; - } catch (ex) { - // Ignore - } - } - } - - // Set start/end point of selection - setEndPoint(true); - setEndPoint(); - - // Select the new range and scroll it into view - ieRng.select(); - }; - - // Expose range method - this.getRangeAt = getRange; - }; - - // Expose the selection object - tinymce.dom.TridentSelection = Selection; -})(); - - -(function(tinymce) { - // Shorten names - var each = tinymce.each, DOM = tinymce.DOM, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, Event; - - tinymce.create('tinymce.dom.EventUtils', { - EventUtils : function() { - this.inits = []; - this.events = []; - }, - - add : function(o, n, f, s) { - var cb, t = this, el = t.events, r; - - if (n instanceof Array) { - r = []; - - each(n, function(n) { - r.push(t.add(o, n, f, s)); - }); - - return r; - } - - // Handle array - if (o && o.hasOwnProperty && o instanceof Array) { - r = []; - - each(o, function(o) { - o = DOM.get(o); - r.push(t.add(o, n, f, s)); - }); - - return r; - } - - o = DOM.get(o); - - if (!o) - return; - - // Setup event callback - cb = function(e) { - // Is all events disabled - if (t.disabled) - return; - - e = e || window.event; - - // Patch in target, preventDefault and stopPropagation in IE it's W3C valid - if (e && isIE) { - if (!e.target) - e.target = e.srcElement; - - // Patch in preventDefault, stopPropagation methods for W3C compatibility - tinymce.extend(e, t._stoppers); - } - - if (!s) - return f(e); - - return f.call(s, e); - }; - - if (n == 'unload') { - tinymce.unloads.unshift({func : cb}); - return cb; - } - - if (n == 'init') { - if (t.domLoaded) - cb(); - else - t.inits.push(cb); - - return cb; - } - - // Store away listener reference - el.push({ - obj : o, - name : n, - func : f, - cfunc : cb, - scope : s - }); - - t._add(o, n, cb); - - return f; - }, - - remove : function(o, n, f) { - var t = this, a = t.events, s = false, r; - - // Handle array - if (o && o.hasOwnProperty && o instanceof Array) { - r = []; - - each(o, function(o) { - o = DOM.get(o); - r.push(t.remove(o, n, f)); - }); - - return r; - } - - o = DOM.get(o); - - each(a, function(e, i) { - if (e.obj == o && e.name == n && (!f || (e.func == f || e.cfunc == f))) { - a.splice(i, 1); - t._remove(o, n, e.cfunc); - s = true; - return false; - } - }); - - return s; - }, - - clear : function(o) { - var t = this, a = t.events, i, e; - - if (o) { - o = DOM.get(o); - - for (i = a.length - 1; i >= 0; i--) { - e = a[i]; - - if (e.obj === o) { - t._remove(e.obj, e.name, e.cfunc); - e.obj = e.cfunc = null; - a.splice(i, 1); - } - } - } - }, - - cancel : function(e) { - if (!e) - return false; - - this.stop(e); - - return this.prevent(e); - }, - - stop : function(e) { - if (e.stopPropagation) - e.stopPropagation(); - else - e.cancelBubble = true; - - return false; - }, - - prevent : function(e) { - if (e.preventDefault) - e.preventDefault(); - else - e.returnValue = false; - - return false; - }, - - destroy : function() { - var t = this; - - each(t.events, function(e, i) { - t._remove(e.obj, e.name, e.cfunc); - e.obj = e.cfunc = null; - }); - - t.events = []; - t = null; - }, - - _add : function(o, n, f) { - if (o.attachEvent) - o.attachEvent('on' + n, f); - else if (o.addEventListener) - o.addEventListener(n, f, false); - else - o['on' + n] = f; - }, - - _remove : function(o, n, f) { - if (o) { - try { - if (o.detachEvent) - o.detachEvent('on' + n, f); - else if (o.removeEventListener) - o.removeEventListener(n, f, false); - else - o['on' + n] = null; - } catch (ex) { - // Might fail with permission denined on IE so we just ignore that - } - } - }, - - _pageInit : function(win) { - var t = this; - - // Keep it from running more than once - if (t.domLoaded) - return; - - t.domLoaded = true; - - each(t.inits, function(c) { - c(); - }); - - t.inits = []; - }, - - _wait : function(win) { - var t = this, doc = win.document; - - // No need since the document is already loaded - if (win.tinyMCE_GZ && tinyMCE_GZ.loaded) { - t.domLoaded = 1; - return; - } - - // Use IE method - if (doc.attachEvent) { - doc.attachEvent("onreadystatechange", function() { - if (doc.readyState === "complete") { - doc.detachEvent("onreadystatechange", arguments.callee); - t._pageInit(win); - } - }); - - if (doc.documentElement.doScroll && win == win.top) { - (function() { - if (t.domLoaded) - return; - - try { - // If IE is used, use the trick by Diego Perini licensed under MIT by request to the author. - // http://javascript.nwbox.com/IEContentLoaded/ - doc.documentElement.doScroll("left"); - } catch (ex) { - setTimeout(arguments.callee, 0); - return; - } - - t._pageInit(win); - })(); - } - } else if (doc.addEventListener) { - t._add(win, 'DOMContentLoaded', function() { - t._pageInit(win); - }); - } - - t._add(win, 'load', function() { - t._pageInit(win); - }); - }, - - _stoppers : { - preventDefault : function() { - this.returnValue = false; - }, - - stopPropagation : function() { - this.cancelBubble = true; - } - } - }); - - Event = tinymce.dom.Event = new tinymce.dom.EventUtils(); - - // Dispatch DOM content loaded event for IE and Safari - Event._wait(window); - - tinymce.addUnload(function() { - Event.destroy(); - }); -})(tinymce); - -(function(tinymce) { - tinymce.dom.Element = function(id, settings) { - var t = this, dom, el; - - t.settings = settings = settings || {}; - t.id = id; - t.dom = dom = settings.dom || tinymce.DOM; - - // Only IE leaks DOM references, this is a lot faster - if (!tinymce.isIE) - el = dom.get(t.id); - - tinymce.each( - ('getPos,getRect,getParent,add,setStyle,getStyle,setStyles,' + - 'setAttrib,setAttribs,getAttrib,addClass,removeClass,' + - 'hasClass,getOuterHTML,setOuterHTML,remove,show,hide,' + - 'isHidden,setHTML,get').split(/,/) - , function(k) { - t[k] = function() { - var a = [id], i; - - for (i = 0; i < arguments.length; i++) - a.push(arguments[i]); - - a = dom[k].apply(dom, a); - t.update(k); - - return a; - }; - }); - - tinymce.extend(t, { - on : function(n, f, s) { - return tinymce.dom.Event.add(t.id, n, f, s); - }, - - getXY : function() { - return { - x : parseInt(t.getStyle('left')), - y : parseInt(t.getStyle('top')) - }; - }, - - getSize : function() { - var n = dom.get(t.id); - - return { - w : parseInt(t.getStyle('width') || n.clientWidth), - h : parseInt(t.getStyle('height') || n.clientHeight) - }; - }, - - moveTo : function(x, y) { - t.setStyles({left : x, top : y}); - }, - - moveBy : function(x, y) { - var p = t.getXY(); - - t.moveTo(p.x + x, p.y + y); - }, - - resizeTo : function(w, h) { - t.setStyles({width : w, height : h}); - }, - - resizeBy : function(w, h) { - var s = t.getSize(); - - t.resizeTo(s.w + w, s.h + h); - }, - - update : function(k) { - var b; - - if (tinymce.isIE6 && settings.blocker) { - k = k || ''; - - // Ignore getters - if (k.indexOf('get') === 0 || k.indexOf('has') === 0 || k.indexOf('is') === 0) - return; - - // Remove blocker on remove - if (k == 'remove') { - dom.remove(t.blocker); - return; - } - - if (!t.blocker) { - t.blocker = dom.uniqueId(); - b = dom.add(settings.container || dom.getRoot(), 'iframe', {id : t.blocker, style : 'position:absolute;', frameBorder : 0, src : 'javascript:""'}); - dom.setStyle(b, 'opacity', 0); - } else - b = dom.get(t.blocker); - - dom.setStyles(b, { - left : t.getStyle('left', 1), - top : t.getStyle('top', 1), - width : t.getStyle('width', 1), - height : t.getStyle('height', 1), - display : t.getStyle('display', 1), - zIndex : parseInt(t.getStyle('zIndex', 1) || 0) - 1 - }); - } - } - }); - }; -})(tinymce); - -(function(tinymce) { - function trimNl(s) { - return s.replace(/[\n\r]+/g, ''); - }; - - // Shorten names - var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each; - - tinymce.create('tinymce.dom.Selection', { - Selection : function(dom, win, serializer) { - var t = this; - - t.dom = dom; - t.win = win; - t.serializer = serializer; - - // Add events - each([ - 'onBeforeSetContent', - - 'onBeforeGetContent', - - 'onSetContent', - - 'onGetContent' - ], function(e) { - t[e] = new tinymce.util.Dispatcher(t); - }); - - // No W3C Range support - if (!t.win.getSelection) - t.tridentSel = new tinymce.dom.TridentSelection(t); - - if (tinymce.isIE && dom.boxModel) - this._fixIESelection(); - - // Prevent leaks - tinymce.addUnload(t.destroy, t); - }, - - setCursorLocation: function(node, offset) { - var t = this; var r = t.dom.createRng(); - r.setStart(node, offset); - r.setEnd(node, offset); - t.setRng(r); - t.collapse(false); - }, - getContent : function(s) { - var t = this, r = t.getRng(), e = t.dom.create("body"), se = t.getSel(), wb, wa, n; - - s = s || {}; - wb = wa = ''; - s.get = true; - s.format = s.format || 'html'; - s.forced_root_block = ''; - t.onBeforeGetContent.dispatch(t, s); - - if (s.format == 'text') - return t.isCollapsed() ? '' : (r.text || (se.toString ? se.toString() : '')); - - if (r.cloneContents) { - n = r.cloneContents(); - - if (n) - e.appendChild(n); - } else if (is(r.item) || is(r.htmlText)) { - // IE will produce invalid markup if elements are present that - // it doesn't understand like custom elements or HTML5 elements. - // Adding a BR in front of the contents and then remoiving it seems to fix it though. - e.innerHTML = '
    ' + (r.item ? r.item(0).outerHTML : r.htmlText); - e.removeChild(e.firstChild); - } else - e.innerHTML = r.toString(); - - // Keep whitespace before and after - if (/^\s/.test(e.innerHTML)) - wb = ' '; - - if (/\s+$/.test(e.innerHTML)) - wa = ' '; - - s.getInner = true; - - s.content = t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa; - t.onGetContent.dispatch(t, s); - - return s.content; - }, - - setContent : function(content, args) { - var self = this, rng = self.getRng(), caretNode, doc = self.win.document, frag, temp; - - args = args || {format : 'html'}; - args.set = true; - content = args.content = content; - - // Dispatch before set content event - if (!args.no_events) - self.onBeforeSetContent.dispatch(self, args); - - content = args.content; - - if (rng.insertNode) { - // Make caret marker since insertNode places the caret in the beginning of text after insert - content += '_'; - - // Delete and insert new node - if (rng.startContainer == doc && rng.endContainer == doc) { - // WebKit will fail if the body is empty since the range is then invalid and it can't insert contents - doc.body.innerHTML = content; - } else { - rng.deleteContents(); - - if (doc.body.childNodes.length == 0) { - doc.body.innerHTML = content; - } else { - // createContextualFragment doesn't exists in IE 9 DOMRanges - if (rng.createContextualFragment) { - rng.insertNode(rng.createContextualFragment(content)); - } else { - // Fake createContextualFragment call in IE 9 - frag = doc.createDocumentFragment(); - temp = doc.createElement('div'); - - frag.appendChild(temp); - temp.outerHTML = content; - - rng.insertNode(frag); - } - } - } - - // Move to caret marker - caretNode = self.dom.get('__caret'); - - // Make sure we wrap it compleatly, Opera fails with a simple select call - rng = doc.createRange(); - rng.setStartBefore(caretNode); - rng.setEndBefore(caretNode); - self.setRng(rng); - - // Remove the caret position - self.dom.remove('__caret'); - - try { - self.setRng(rng); - } catch (ex) { - // Might fail on Opera for some odd reason - } - } else { - if (rng.item) { - // Delete content and get caret text selection - doc.execCommand('Delete', false, null); - rng = self.getRng(); - } - - // Explorer removes spaces from the beginning of pasted contents - if (/^\s+/.test(content)) { - rng.pasteHTML('_' + content); - self.dom.remove('__mce_tmp'); - } else - rng.pasteHTML(content); - } - - // Dispatch set content event - if (!args.no_events) - self.onSetContent.dispatch(self, args); - }, - - getStart : function() { - var rng = this.getRng(), startElement, parentElement, checkRng, node; - - if (rng.duplicate || rng.item) { - // Control selection, return first item - if (rng.item) - return rng.item(0); - - // Get start element - checkRng = rng.duplicate(); - checkRng.collapse(1); - startElement = checkRng.parentElement(); - - // Check if range parent is inside the start element, then return the inner parent element - // This will fix issues when a single element is selected, IE would otherwise return the wrong start element - parentElement = node = rng.parentElement(); - while (node = node.parentNode) { - if (node == startElement) { - startElement = parentElement; - break; - } - } - - return startElement; - } else { - startElement = rng.startContainer; - - if (startElement.nodeType == 1 && startElement.hasChildNodes()) - startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)]; - - if (startElement && startElement.nodeType == 3) - return startElement.parentNode; - - return startElement; - } - }, - - getEnd : function() { - var t = this, r = t.getRng(), e, eo; - - if (r.duplicate || r.item) { - if (r.item) - return r.item(0); - - r = r.duplicate(); - r.collapse(0); - e = r.parentElement(); - - if (e && e.nodeName == 'BODY') - return e.lastChild || e; - - return e; - } else { - e = r.endContainer; - eo = r.endOffset; - - if (e.nodeType == 1 && e.hasChildNodes()) - e = e.childNodes[eo > 0 ? eo - 1 : eo]; - - if (e && e.nodeType == 3) - return e.parentNode; - - return e; - } - }, - - getBookmark : function(type, normalized) { - var t = this, dom = t.dom, rng, rng2, id, collapsed, name, element, index, chr = '\uFEFF', styles; - - function findIndex(name, element) { - var index = 0; - - each(dom.select(name), function(node, i) { - if (node == element) - index = i; - }); - - return index; - }; - - if (type == 2) { - function getLocation() { - var rng = t.getRng(true), root = dom.getRoot(), bookmark = {}; - - function getPoint(rng, start) { - var container = rng[start ? 'startContainer' : 'endContainer'], - offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0; - - if (container.nodeType == 3) { - if (normalized) { - for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling) - offset += node.nodeValue.length; - } - - point.push(offset); - } else { - childNodes = container.childNodes; - - if (offset >= childNodes.length && childNodes.length) { - after = 1; - offset = Math.max(0, childNodes.length - 1); - } - - point.push(t.dom.nodeIndex(childNodes[offset], normalized) + after); - } - - for (; container && container != root; container = container.parentNode) - point.push(t.dom.nodeIndex(container, normalized)); - - return point; - }; - - bookmark.start = getPoint(rng, true); - - if (!t.isCollapsed()) - bookmark.end = getPoint(rng); - - return bookmark; - }; - - if (t.tridentSel) - return t.tridentSel.getBookmark(type); - - return getLocation(); - } - - // Handle simple range - if (type) - return {rng : t.getRng()}; - - rng = t.getRng(); - id = dom.uniqueId(); - collapsed = tinyMCE.activeEditor.selection.isCollapsed(); - styles = 'overflow:hidden;line-height:0px'; - - // Explorer method - if (rng.duplicate || rng.item) { - // Text selection - if (!rng.item) { - rng2 = rng.duplicate(); - - try { - // Insert start marker - rng.collapse(); - rng.pasteHTML('' + chr + ''); - - // Insert end marker - if (!collapsed) { - rng2.collapse(false); - - // Detect the empty space after block elements in IE and move the end back one character

    ] becomes

    ]

    - rng.moveToElementText(rng2.parentElement()); - if (rng.compareEndPoints('StartToEnd', rng2) == 0) - rng2.move('character', -1); - - rng2.pasteHTML('' + chr + ''); - } - } catch (ex) { - // IE might throw unspecified error so lets ignore it - return null; - } - } else { - // Control selection - element = rng.item(0); - name = element.nodeName; - - return {name : name, index : findIndex(name, element)}; - } - } else { - element = t.getNode(); - name = element.nodeName; - if (name == 'IMG') - return {name : name, index : findIndex(name, element)}; - - // W3C method - rng2 = rng.cloneRange(); - - // Insert end marker - if (!collapsed) { - rng2.collapse(false); - rng2.insertNode(dom.create('span', {'data-mce-type' : "bookmark", id : id + '_end', style : styles}, chr)); - } - - rng.collapse(true); - rng.insertNode(dom.create('span', {'data-mce-type' : "bookmark", id : id + '_start', style : styles}, chr)); - } - - t.moveToBookmark({id : id, keep : 1}); - - return {id : id}; - }, - - moveToBookmark : function(bookmark) { - var t = this, dom = t.dom, marker1, marker2, rng, root, startContainer, endContainer, startOffset, endOffset; - - if (bookmark) { - if (bookmark.start) { - rng = dom.createRng(); - root = dom.getRoot(); - - function setEndPoint(start) { - var point = bookmark[start ? 'start' : 'end'], i, node, offset, children; - - if (point) { - offset = point[0]; - - // Find container node - for (node = root, i = point.length - 1; i >= 1; i--) { - children = node.childNodes; - - if (point[i] > children.length - 1) - return; - - node = children[point[i]]; - } - - // Move text offset to best suitable location - if (node.nodeType === 3) - offset = Math.min(point[0], node.nodeValue.length); - - // Move element offset to best suitable location - if (node.nodeType === 1) - offset = Math.min(point[0], node.childNodes.length); - - // Set offset within container node - if (start) - rng.setStart(node, offset); - else - rng.setEnd(node, offset); - } - - return true; - }; - - if (t.tridentSel) - return t.tridentSel.moveToBookmark(bookmark); - - if (setEndPoint(true) && setEndPoint()) { - t.setRng(rng); - } - } else if (bookmark.id) { - function restoreEndPoint(suffix) { - var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep; - - if (marker) { - node = marker.parentNode; - - if (suffix == 'start') { - if (!keep) { - idx = dom.nodeIndex(marker); - } else { - node = marker.firstChild; - idx = 1; - } - - startContainer = endContainer = node; - startOffset = endOffset = idx; - } else { - if (!keep) { - idx = dom.nodeIndex(marker); - } else { - node = marker.firstChild; - idx = 1; - } - - endContainer = node; - endOffset = idx; - } - - if (!keep) { - prev = marker.previousSibling; - next = marker.nextSibling; - - // Remove all marker text nodes - each(tinymce.grep(marker.childNodes), function(node) { - if (node.nodeType == 3) - node.nodeValue = node.nodeValue.replace(/\uFEFF/g, ''); - }); - - // Remove marker but keep children if for example contents where inserted into the marker - // Also remove duplicated instances of the marker for example by a split operation or by WebKit auto split on paste feature - while (marker = dom.get(bookmark.id + '_' + suffix)) - dom.remove(marker, 1); - - // If siblings are text nodes then merge them unless it's Opera since it some how removes the node - // and we are sniffing since adding a lot of detection code for a browser with 3% of the market isn't worth the effort. Sorry, Opera but it's just a fact - if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3 && !tinymce.isOpera) { - idx = prev.nodeValue.length; - prev.appendData(next.nodeValue); - dom.remove(next); - - if (suffix == 'start') { - startContainer = endContainer = prev; - startOffset = endOffset = idx; - } else { - endContainer = prev; - endOffset = idx; - } - } - } - } - }; - - function addBogus(node) { - // Adds a bogus BR element for empty block elements or just a space on IE since it renders BR elements incorrectly - if (dom.isBlock(node) && !node.innerHTML) - node.innerHTML = !isIE ? '
    ' : ' '; - - return node; - }; - - // Restore start/end points - restoreEndPoint('start'); - restoreEndPoint('end'); - - if (startContainer) { - rng = dom.createRng(); - rng.setStart(addBogus(startContainer), startOffset); - rng.setEnd(addBogus(endContainer), endOffset); - t.setRng(rng); - } - } else if (bookmark.name) { - t.select(dom.select(bookmark.name)[bookmark.index]); - } else if (bookmark.rng) - t.setRng(bookmark.rng); - } - }, - - select : function(node, content) { - var t = this, dom = t.dom, rng = dom.createRng(), idx; - - if (node) { - idx = dom.nodeIndex(node); - rng.setStart(node.parentNode, idx); - rng.setEnd(node.parentNode, idx + 1); - - // Find first/last text node or BR element - if (content) { - function setPoint(node, start) { - var walker = new tinymce.dom.TreeWalker(node, node); - - do { - // Text node - if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { - if (start) - rng.setStart(node, 0); - else - rng.setEnd(node, node.nodeValue.length); - - return; - } - - // BR element - if (node.nodeName == 'BR') { - if (start) - rng.setStartBefore(node); - else - rng.setEndBefore(node); - - return; - } - } while (node = (start ? walker.next() : walker.prev())); - }; - - setPoint(node, 1); - setPoint(node); - } - - t.setRng(rng); - } - - return node; - }, - - isCollapsed : function() { - var t = this, r = t.getRng(), s = t.getSel(); - - if (!r || r.item) - return false; - - if (r.compareEndPoints) - return r.compareEndPoints('StartToEnd', r) === 0; - - return !s || r.collapsed; - }, - - collapse : function(to_start) { - var self = this, rng = self.getRng(), node; - - // Control range on IE - if (rng.item) { - node = rng.item(0); - rng = self.win.document.body.createTextRange(); - rng.moveToElementText(node); - } - - rng.collapse(!!to_start); - self.setRng(rng); - }, - - getSel : function() { - var t = this, w = this.win; - - return w.getSelection ? w.getSelection() : w.document.selection; - }, - - getRng : function(w3c) { - var t = this, s, r, elm, doc = t.win.document; - - // Found tridentSel object then we need to use that one - if (w3c && t.tridentSel) - return t.tridentSel.getRangeAt(0); - - try { - if (s = t.getSel()) - r = s.rangeCount > 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : doc.createRange()); - } catch (ex) { - // IE throws unspecified error here if TinyMCE is placed in a frame/iframe - } - - // We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet - if (tinymce.isIE && r && r.setStart && doc.selection.createRange().item) { - elm = doc.selection.createRange().item(0); - r = doc.createRange(); - r.setStartBefore(elm); - r.setEndAfter(elm); - } - - // No range found then create an empty one - // This can occur when the editor is placed in a hidden container element on Gecko - // Or on IE when there was an exception - if (!r) - r = doc.createRange ? doc.createRange() : doc.body.createTextRange(); - - if (t.selectedRange && t.explicitRange) { - if (r.compareBoundaryPoints(r.START_TO_START, t.selectedRange) === 0 && r.compareBoundaryPoints(r.END_TO_END, t.selectedRange) === 0) { - // Safari, Opera and Chrome only ever select text which causes the range to change. - // This lets us use the originally set range if the selection hasn't been changed by the user. - r = t.explicitRange; - } else { - t.selectedRange = null; - t.explicitRange = null; - } - } - - return r; - }, - - setRng : function(r) { - var s, t = this; - - if (!t.tridentSel) { - s = t.getSel(); - - if (s) { - t.explicitRange = r; - - try { - s.removeAllRanges(); - } catch (ex) { - // IE9 might throw errors here don't know why - } - - s.addRange(r); - t.selectedRange = s.getRangeAt(0); - } - } else { - // Is W3C Range - if (r.cloneRange) { - t.tridentSel.addRange(r); - return; - } - - // Is IE specific range - try { - r.select(); - } catch (ex) { - // Needed for some odd IE bug #1843306 - } - } - }, - - setNode : function(n) { - var t = this; - - t.setContent(t.dom.getOuterHTML(n)); - - return n; - }, - - getNode : function() { - var t = this, rng = t.getRng(), sel = t.getSel(), elm, start = rng.startContainer, end = rng.endContainer; - - // Range maybe lost after the editor is made visible again - if (!rng) - return t.dom.getRoot(); - - if (rng.setStart) { - elm = rng.commonAncestorContainer; - - // Handle selection a image or other control like element such as anchors - if (!rng.collapsed) { - if (rng.startContainer == rng.endContainer) { - if (rng.endOffset - rng.startOffset < 2) { - if (rng.startContainer.hasChildNodes()) - elm = rng.startContainer.childNodes[rng.startOffset]; - } - } - - // If the anchor node is a element instead of a text node then return this element - //if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1) - // return sel.anchorNode.childNodes[sel.anchorOffset]; - - // Handle cases where the selection is immediately wrapped around a node and return that node instead of it's parent. - // This happens when you double click an underlined word in FireFox. - if (start.nodeType === 3 && end.nodeType === 3) { - function skipEmptyTextNodes(n, forwards) { - var orig = n; - while (n && n.nodeType === 3 && n.length === 0) { - n = forwards ? n.nextSibling : n.previousSibling; - } - return n || orig; - } - if (start.length === rng.startOffset) { - start = skipEmptyTextNodes(start.nextSibling, true); - } else { - start = start.parentNode; - } - if (rng.endOffset === 0) { - end = skipEmptyTextNodes(end.previousSibling, false); - } else { - end = end.parentNode; - } - - if (start && start === end) - return start; - } - } - - if (elm && elm.nodeType == 3) - return elm.parentNode; - - return elm; - } - - return rng.item ? rng.item(0) : rng.parentElement(); - }, - - getSelectedBlocks : function(st, en) { - var t = this, dom = t.dom, sb, eb, n, bl = []; - - sb = dom.getParent(st || t.getStart(), dom.isBlock); - eb = dom.getParent(en || t.getEnd(), dom.isBlock); - - if (sb) - bl.push(sb); - - if (sb && eb && sb != eb) { - n = sb; - - var walker = new tinymce.dom.TreeWalker(sb, dom.getRoot()); - while ((n = walker.next()) && n != eb) { - if (dom.isBlock(n)) - bl.push(n); - } - } - - if (eb && sb != eb) - bl.push(eb); - - return bl; - }, - - normalize : function() { - var self = this, rng, normalized; - - // Normalize only on non IE browsers for now - if (tinymce.isIE) - return; - - function normalizeEndPoint(start) { - var container, offset, walker, dom = self.dom, body = dom.getRoot(), node; - - container = rng[(start ? 'start' : 'end') + 'Container']; - offset = rng[(start ? 'start' : 'end') + 'Offset']; - - // If the container is a document move it to the body element - if (container.nodeType === 9) { - container = container.body; - offset = 0; - } - - // If the container is body try move it into the closest text node or position - // TODO: Add more logic here to handle element selection cases - if (container === body) { - // Resolve the index - if (container.hasChildNodes()) { - container = container.childNodes[Math.min(!start && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1)]; - offset = 0; - - // Don't walk into elements that doesn't have any child nodes like a IMG - if (container.hasChildNodes()) { - // Walk the DOM to find a text node to place the caret at or a BR - node = container; - walker = new tinymce.dom.TreeWalker(container, body); - do { - // Found a text node use that position - if (node.nodeType === 3) { - offset = start ? 0 : node.nodeValue.length - 1; - container = node; - break; - } - - // Found a BR element that we can place the caret before - if (node.nodeName === 'BR') { - offset = dom.nodeIndex(node); - container = node.parentNode; - break; - } - } while (node = (start ? walker.next() : walker.prev())); - - normalized = true; - } - } - } - - // Set endpoint if it was normalized - if (normalized) - rng['set' + (start ? 'Start' : 'End')](container, offset); - }; - - rng = self.getRng(); - - // Normalize the end points - normalizeEndPoint(true); - - if (rng.collapsed) - normalizeEndPoint(); - - // Set the selection if it was normalized - if (normalized) { - //console.log(self.dom.dumpRng(rng)); - self.setRng(rng); - } - }, - - destroy : function(s) { - var t = this; - - t.win = null; - - // Manual destroy then remove unload handler - if (!s) - tinymce.removeUnload(t.destroy); - }, - - // IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode - _fixIESelection : function() { - var dom = this.dom, doc = dom.doc, body = doc.body, started, startRng, htmlElm; - - // Make HTML element unselectable since we are going to handle selection by hand - doc.documentElement.unselectable = true; - - // Return range from point or null if it failed - function rngFromPoint(x, y) { - var rng = body.createTextRange(); - - try { - rng.moveToPoint(x, y); - } catch (ex) { - // IE sometimes throws and exception, so lets just ignore it - rng = null; - } - - return rng; - }; - - // Fires while the selection is changing - function selectionChange(e) { - var pointRng; - - // Check if the button is down or not - if (e.button) { - // Create range from mouse position - pointRng = rngFromPoint(e.x, e.y); - - if (pointRng) { - // Check if pointRange is before/after selection then change the endPoint - if (pointRng.compareEndPoints('StartToStart', startRng) > 0) - pointRng.setEndPoint('StartToStart', startRng); - else - pointRng.setEndPoint('EndToEnd', startRng); - - pointRng.select(); - } - } else - endSelection(); - } - - // Removes listeners - function endSelection() { - var rng = doc.selection.createRange(); - - // If the range is collapsed then use the last start range - if (startRng && !rng.item && rng.compareEndPoints('StartToEnd', rng) === 0) - startRng.select(); - - dom.unbind(doc, 'mouseup', endSelection); - dom.unbind(doc, 'mousemove', selectionChange); - startRng = started = 0; - }; - - // Detect when user selects outside BODY - dom.bind(doc, ['mousedown', 'contextmenu'], function(e) { - if (e.target.nodeName === 'HTML') { - if (started) - endSelection(); - - // Detect vertical scrollbar, since IE will fire a mousedown on the scrollbar and have target set as HTML - htmlElm = doc.documentElement; - if (htmlElm.scrollHeight > htmlElm.clientHeight) - return; - - started = 1; - // Setup start position - startRng = rngFromPoint(e.x, e.y); - if (startRng) { - // Listen for selection change events - dom.bind(doc, 'mouseup', endSelection); - dom.bind(doc, 'mousemove', selectionChange); - - dom.win.focus(); - startRng.select(); - } - } - }); - } - }); -})(tinymce); - -(function(tinymce) { - tinymce.dom.Serializer = function(settings, dom, schema) { - var onPreProcess, onPostProcess, isIE = tinymce.isIE, each = tinymce.each, htmlParser; - - // Support the old apply_source_formatting option - if (!settings.apply_source_formatting) - settings.indent = false; - - settings.remove_trailing_brs = true; - - // Default DOM and Schema if they are undefined - dom = dom || tinymce.DOM; - schema = schema || new tinymce.html.Schema(settings); - settings.entity_encoding = settings.entity_encoding || 'named'; - - onPreProcess = new tinymce.util.Dispatcher(self); - - onPostProcess = new tinymce.util.Dispatcher(self); - - htmlParser = new tinymce.html.DomParser(settings, schema); - - // Convert move data-mce-src, data-mce-href and data-mce-style into nodes or process them if needed - htmlParser.addAttributeFilter('src,href,style', function(nodes, name) { - var i = nodes.length, node, value, internalName = 'data-mce-' + name, urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope, undef; - - while (i--) { - node = nodes[i]; - - value = node.attributes.map[internalName]; - if (value !== undef) { - // Set external name to internal value and remove internal - node.attr(name, value.length > 0 ? value : null); - node.attr(internalName, null); - } else { - // No internal attribute found then convert the value we have in the DOM - value = node.attributes.map[name]; - - if (name === "style") - value = dom.serializeStyle(dom.parseStyle(value), node.name); - else if (urlConverter) - value = urlConverter.call(urlConverterScope, value, name, node.name); - - node.attr(name, value.length > 0 ? value : null); - } - } - }); - - // Remove internal classes mceItem<..> - htmlParser.addAttributeFilter('class', function(nodes, name) { - var i = nodes.length, node, value; - - while (i--) { - node = nodes[i]; - value = node.attr('class').replace(/\s*mce(Item\w+|Selected)\s*/g, ''); - node.attr('class', value.length > 0 ? value : null); - } - }); - - // Remove bookmark elements - htmlParser.addAttributeFilter('data-mce-type', function(nodes, name, args) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - - if (node.attributes.map['data-mce-type'] === 'bookmark' && !args.cleanup) - node.remove(); - } - }); - - // Force script into CDATA sections and remove the mce- prefix also add comments around styles - htmlParser.addNodeFilter('script,style', function(nodes, name) { - var i = nodes.length, node, value; - - function trim(value) { - return value.replace(/()/g, '\n') - .replace(/^[\r\n]*|[\r\n]*$/g, '') - .replace(/^\s*(\/\/\s*|\]\]>|-->|\]\]-->)\s*$/g, ''); - }; - - while (i--) { - node = nodes[i]; - value = node.firstChild ? node.firstChild.value : ''; - - if (name === "script") { - // Remove mce- prefix from script elements - node.attr('type', (node.attr('type') || 'text/javascript').replace(/^mce\-/, '')); - - if (value.length > 0) - node.firstChild.value = '// '; - } else { - if (value.length > 0) - node.firstChild.value = ''; - } - } - }); - - // Convert comments to cdata and handle protected comments - htmlParser.addNodeFilter('#comment', function(nodes, name) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - - if (node.value.indexOf('[CDATA[') === 0) { - node.name = '#cdata'; - node.type = 4; - node.value = node.value.replace(/^\[CDATA\[|\]\]$/g, ''); - } else if (node.value.indexOf('mce:protected ') === 0) { - node.name = "#text"; - node.type = 3; - node.raw = true; - node.value = unescape(node.value).substr(14); - } - } - }); - - htmlParser.addNodeFilter('xml:namespace,input', function(nodes, name) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - if (node.type === 7) - node.remove(); - else if (node.type === 1) { - if (name === "input" && !("type" in node.attributes.map)) - node.attr('type', 'text'); - } - } - }); - - // Fix list elements, TODO: Replace this later - if (settings.fix_list_elements) { - htmlParser.addNodeFilter('ul,ol', function(nodes, name) { - var i = nodes.length, node, parentNode; - - while (i--) { - node = nodes[i]; - parentNode = node.parent; - - if (parentNode.name === 'ul' || parentNode.name === 'ol') { - if (node.prev && node.prev.name === 'li') { - node.prev.append(node); - } - } - } - }); - } - - // Remove internal data attributes - htmlParser.addAttributeFilter('data-mce-src,data-mce-href,data-mce-style', function(nodes, name) { - var i = nodes.length; - - while (i--) { - nodes[i].attr(name, null); - } - }); - - // Return public methods - return { - schema : schema, - - addNodeFilter : htmlParser.addNodeFilter, - - addAttributeFilter : htmlParser.addAttributeFilter, - - onPreProcess : onPreProcess, - - onPostProcess : onPostProcess, - - serialize : function(node, args) { - var impl, doc, oldDoc, htmlSerializer, content; - - // Explorer won't clone contents of script and style and the - // selected index of select elements are cleared on a clone operation. - if (isIE && dom.select('script,style,select,map').length > 0) { - content = node.innerHTML; - node = node.cloneNode(false); - dom.setHTML(node, content); - } else - node = node.cloneNode(true); - - // Nodes needs to be attached to something in WebKit/Opera - // Older builds of Opera crashes if you attach the node to an document created dynamically - // and since we can't feature detect a crash we need to sniff the acutal build number - // This fix will make DOM ranges and make Sizzle happy! - impl = node.ownerDocument.implementation; - if (impl.createHTMLDocument) { - // Create an empty HTML document - doc = impl.createHTMLDocument(""); - - // Add the element or it's children if it's a body element to the new document - each(node.nodeName == 'BODY' ? node.childNodes : [node], function(node) { - doc.body.appendChild(doc.importNode(node, true)); - }); - - // Grab first child or body element for serialization - if (node.nodeName != 'BODY') - node = doc.body.firstChild; - else - node = doc.body; - - // set the new document in DOMUtils so createElement etc works - oldDoc = dom.doc; - dom.doc = doc; - } - - args = args || {}; - args.format = args.format || 'html'; - - // Pre process - if (!args.no_events) { - args.node = node; - onPreProcess.dispatch(self, args); - } - - // Setup serializer - htmlSerializer = new tinymce.html.Serializer(settings, schema); - - // Parse and serialize HTML - args.content = htmlSerializer.serialize( - htmlParser.parse(args.getInner ? node.innerHTML : tinymce.trim(dom.getOuterHTML(node), args), args) - ); - - // Replace all BOM characters for now until we can find a better solution - if (!args.cleanup) - args.content = args.content.replace(/\uFEFF|\u200B/g, ''); - - // Post process - if (!args.no_events) - onPostProcess.dispatch(self, args); - - // Restore the old document if it was changed - if (oldDoc) - dom.doc = oldDoc; - - args.node = null; - - return args.content; - }, - - addRules : function(rules) { - schema.addValidElements(rules); - }, - - setRules : function(rules) { - schema.setValidElements(rules); - } - }; - }; -})(tinymce); -(function(tinymce) { - tinymce.dom.ScriptLoader = function(settings) { - var QUEUED = 0, - LOADING = 1, - LOADED = 2, - states = {}, - queue = [], - scriptLoadedCallbacks = {}, - queueLoadedCallbacks = [], - loading = 0, - undefined; - - function loadScript(url, callback) { - var t = this, dom = tinymce.DOM, elm, uri, loc, id; - - // Execute callback when script is loaded - function done() { - dom.remove(id); - - if (elm) - elm.onreadystatechange = elm.onload = elm = null; - - callback(); - }; - - function error() { - // Report the error so it's easier for people to spot loading errors - if (typeof(console) !== "undefined" && console.log) - console.log("Failed to load: " + url); - - // We can't mark it as done if there is a load error since - // A) We don't want to produce 404 errors on the server and - // B) the onerror event won't fire on all browsers. - // done(); - }; - - id = dom.uniqueId(); - - if (tinymce.isIE6) { - uri = new tinymce.util.URI(url); - loc = location; - - // If script is from same domain and we - // use IE 6 then use XHR since it's more reliable - if (uri.host == loc.hostname && uri.port == loc.port && (uri.protocol + ':') == loc.protocol && uri.protocol.toLowerCase() != 'file') { - tinymce.util.XHR.send({ - url : tinymce._addVer(uri.getURI()), - success : function(content) { - // Create new temp script element - var script = dom.create('script', { - type : 'text/javascript' - }); - - // Evaluate script in global scope - script.text = content; - document.getElementsByTagName('head')[0].appendChild(script); - dom.remove(script); - - done(); - }, - - error : error - }); - - return; - } - } - - // Create new script element - elm = dom.create('script', { - id : id, - type : 'text/javascript', - src : tinymce._addVer(url) - }); - - // Add onload listener for non IE browsers since IE9 - // fires onload event before the script is parsed and executed - if (!tinymce.isIE) - elm.onload = done; - - // Add onerror event will get fired on some browsers but not all of them - elm.onerror = error; - - // Opera 9.60 doesn't seem to fire the onreadystate event at correctly - if (!tinymce.isOpera) { - elm.onreadystatechange = function() { - var state = elm.readyState; - - // Loaded state is passed on IE 6 however there - // are known issues with this method but we can't use - // XHR in a cross domain loading - if (state == 'complete' || state == 'loaded') - done(); - }; - } - - // Most browsers support this feature so we report errors - // for those at least to help users track their missing plugins etc - // todo: Removed since it produced error if the document is unloaded by navigating away, re-add it as an option - /*elm.onerror = function() { - alert('Failed to load: ' + url); - };*/ - - // Add script to document - (document.getElementsByTagName('head')[0] || document.body).appendChild(elm); - }; - - this.isDone = function(url) { - return states[url] == LOADED; - }; - - this.markDone = function(url) { - states[url] = LOADED; - }; - - this.add = this.load = function(url, callback, scope) { - var item, state = states[url]; - - // Add url to load queue - if (state == undefined) { - queue.push(url); - states[url] = QUEUED; - } - - if (callback) { - // Store away callback for later execution - if (!scriptLoadedCallbacks[url]) - scriptLoadedCallbacks[url] = []; - - scriptLoadedCallbacks[url].push({ - func : callback, - scope : scope || this - }); - } - }; - - this.loadQueue = function(callback, scope) { - this.loadScripts(queue, callback, scope); - }; - - this.loadScripts = function(scripts, callback, scope) { - var loadScripts; - - function execScriptLoadedCallbacks(url) { - // Execute URL callback functions - tinymce.each(scriptLoadedCallbacks[url], function(callback) { - callback.func.call(callback.scope); - }); - - scriptLoadedCallbacks[url] = undefined; - }; - - queueLoadedCallbacks.push({ - func : callback, - scope : scope || this - }); - - loadScripts = function() { - var loadingScripts = tinymce.grep(scripts); - - // Current scripts has been handled - scripts.length = 0; - - // Load scripts that needs to be loaded - tinymce.each(loadingScripts, function(url) { - // Script is already loaded then execute script callbacks directly - if (states[url] == LOADED) { - execScriptLoadedCallbacks(url); - return; - } - - // Is script not loading then start loading it - if (states[url] != LOADING) { - states[url] = LOADING; - loading++; - - loadScript(url, function() { - states[url] = LOADED; - loading--; - - execScriptLoadedCallbacks(url); - - // Load more scripts if they where added by the recently loaded script - loadScripts(); - }); - } - }); - - // No scripts are currently loading then execute all pending queue loaded callbacks - if (!loading) { - tinymce.each(queueLoadedCallbacks, function(callback) { - callback.func.call(callback.scope); - }); - - queueLoadedCallbacks.length = 0; - } - }; - - loadScripts(); - }; - }; - - // Global script loader - tinymce.ScriptLoader = new tinymce.dom.ScriptLoader(); -})(tinymce); - -tinymce.dom.TreeWalker = function(start_node, root_node) { - var node = start_node; - - function findSibling(node, start_name, sibling_name, shallow) { - var sibling, parent; - - if (node) { - // Walk into nodes if it has a start - if (!shallow && node[start_name]) - return node[start_name]; - - // Return the sibling if it has one - if (node != root_node) { - sibling = node[sibling_name]; - if (sibling) - return sibling; - - // Walk up the parents to look for siblings - for (parent = node.parentNode; parent && parent != root_node; parent = parent.parentNode) { - sibling = parent[sibling_name]; - if (sibling) - return sibling; - } - } - } - }; - - this.current = function() { - return node; - }; - - this.next = function(shallow) { - return (node = findSibling(node, 'firstChild', 'nextSibling', shallow)); - }; - - this.prev = function(shallow) { - return (node = findSibling(node, 'lastChild', 'previousSibling', shallow)); - }; -}; - -(function(tinymce) { - tinymce.dom.RangeUtils = function(dom) { - var INVISIBLE_CHAR = '\uFEFF'; - - this.walk = function(rng, callback) { - var startContainer = rng.startContainer, - startOffset = rng.startOffset, - endContainer = rng.endContainer, - endOffset = rng.endOffset, - ancestor, startPoint, - endPoint, node, parent, siblings, nodes; - - // Handle table cell selection the table plugin enables - // you to fake select table cells and perform formatting actions on them - nodes = dom.select('td.mceSelected,th.mceSelected'); - if (nodes.length > 0) { - tinymce.each(nodes, function(node) { - callback([node]); - }); - - return; - } - - function exclude(nodes) { - var node; - - // First node is excluded - node = nodes[0]; - if (node.nodeType === 3 && node === startContainer && startOffset >= node.nodeValue.length) { - nodes.splice(0, 1); - } - - // Last node is excluded - node = nodes[nodes.length - 1]; - if (endOffset === 0 && nodes.length > 0 && node === endContainer && node.nodeType === 3) { - nodes.splice(nodes.length - 1, 1); - } - - return nodes; - }; - - function collectSiblings(node, name, end_node) { - var siblings = []; - - for (; node && node != end_node; node = node[name]) - siblings.push(node); - - return siblings; - }; - - function findEndPoint(node, root) { - do { - if (node.parentNode == root) - return node; - - node = node.parentNode; - } while(node); - }; - - function walkBoundary(start_node, end_node, next) { - var siblingName = next ? 'nextSibling' : 'previousSibling'; - - for (node = start_node, parent = node.parentNode; node && node != end_node; node = parent) { - parent = node.parentNode; - siblings = collectSiblings(node == start_node ? node : node[siblingName], siblingName); - - if (siblings.length) { - if (!next) - siblings.reverse(); - - callback(exclude(siblings)); - } - } - }; - - // If index based start position then resolve it - if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) - startContainer = startContainer.childNodes[startOffset]; - - // If index based end position then resolve it - if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) - endContainer = endContainer.childNodes[Math.min(endOffset - 1, endContainer.childNodes.length - 1)]; - - // Same container - if (startContainer == endContainer) - return callback(exclude([startContainer])); - - // Find common ancestor and end points - ancestor = dom.findCommonAncestor(startContainer, endContainer); - - // Process left side - for (node = startContainer; node; node = node.parentNode) { - if (node === endContainer) - return walkBoundary(startContainer, ancestor, true); - - if (node === ancestor) - break; - } - - // Process right side - for (node = endContainer; node; node = node.parentNode) { - if (node === startContainer) - return walkBoundary(endContainer, ancestor); - - if (node === ancestor) - break; - } - - // Find start/end point - startPoint = findEndPoint(startContainer, ancestor) || startContainer; - endPoint = findEndPoint(endContainer, ancestor) || endContainer; - - // Walk left leaf - walkBoundary(startContainer, startPoint, true); - - // Walk the middle from start to end point - siblings = collectSiblings( - startPoint == startContainer ? startPoint : startPoint.nextSibling, - 'nextSibling', - endPoint == endContainer ? endPoint.nextSibling : endPoint - ); - - if (siblings.length) - callback(exclude(siblings)); - - // Walk right leaf - walkBoundary(endContainer, endPoint); - }; - - this.split = function(rng) { - var startContainer = rng.startContainer, - startOffset = rng.startOffset, - endContainer = rng.endContainer, - endOffset = rng.endOffset; - - function splitText(node, offset) { - return node.splitText(offset); - }; - - // Handle single text node - if (startContainer == endContainer && startContainer.nodeType == 3) { - if (startOffset > 0 && startOffset < startContainer.nodeValue.length) { - endContainer = splitText(startContainer, startOffset); - startContainer = endContainer.previousSibling; - - if (endOffset > startOffset) { - endOffset = endOffset - startOffset; - startContainer = endContainer = splitText(endContainer, endOffset).previousSibling; - endOffset = endContainer.nodeValue.length; - startOffset = 0; - } else { - endOffset = 0; - } - } - } else { - // Split startContainer text node if needed - if (startContainer.nodeType == 3 && startOffset > 0 && startOffset < startContainer.nodeValue.length) { - startContainer = splitText(startContainer, startOffset); - startOffset = 0; - } - - // Split endContainer text node if needed - if (endContainer.nodeType == 3 && endOffset > 0 && endOffset < endContainer.nodeValue.length) { - endContainer = splitText(endContainer, endOffset).previousSibling; - endOffset = endContainer.nodeValue.length; - } - } - - return { - startContainer : startContainer, - startOffset : startOffset, - endContainer : endContainer, - endOffset : endOffset - }; - }; - - }; - - tinymce.dom.RangeUtils.compareRanges = function(rng1, rng2) { - if (rng1 && rng2) { - // Compare native IE ranges - if (rng1.item || rng1.duplicate) { - // Both are control ranges and the selected element matches - if (rng1.item && rng2.item && rng1.item(0) === rng2.item(0)) - return true; - - // Both are text ranges and the range matches - if (rng1.isEqual && rng2.isEqual && rng2.isEqual(rng1)) - return true; - } else { - // Compare w3c ranges - return rng1.startContainer == rng2.startContainer && rng1.startOffset == rng2.startOffset; - } - } - - return false; - }; -})(tinymce); - -(function(tinymce) { - var Event = tinymce.dom.Event, each = tinymce.each; - - tinymce.create('tinymce.ui.KeyboardNavigation', { - KeyboardNavigation: function(settings, dom) { - var t = this, root = settings.root, items = settings.items, - enableUpDown = settings.enableUpDown, enableLeftRight = settings.enableLeftRight || !settings.enableUpDown, - excludeFromTabOrder = settings.excludeFromTabOrder, - itemFocussed, itemBlurred, rootKeydown, rootFocussed, focussedId; - - dom = dom || tinymce.DOM; - - itemFocussed = function(evt) { - focussedId = evt.target.id; - }; - - itemBlurred = function(evt) { - dom.setAttrib(evt.target.id, 'tabindex', '-1'); - }; - - rootFocussed = function(evt) { - var item = dom.get(focussedId); - dom.setAttrib(item, 'tabindex', '0'); - item.focus(); - }; - - t.focus = function() { - dom.get(focussedId).focus(); - }; - - t.destroy = function() { - each(items, function(item) { - dom.unbind(dom.get(item.id), 'focus', itemFocussed); - dom.unbind(dom.get(item.id), 'blur', itemBlurred); - }); - - dom.unbind(dom.get(root), 'focus', rootFocussed); - dom.unbind(dom.get(root), 'keydown', rootKeydown); - - items = dom = root = t.focus = itemFocussed = itemBlurred = rootKeydown = rootFocussed = null; - t.destroy = function() {}; - }; - - t.moveFocus = function(dir, evt) { - var idx = -1, controls = t.controls, newFocus; - - if (!focussedId) - return; - - each(items, function(item, index) { - if (item.id === focussedId) { - idx = index; - return false; - } - }); - - idx += dir; - if (idx < 0) { - idx = items.length - 1; - } else if (idx >= items.length) { - idx = 0; - } - - newFocus = items[idx]; - dom.setAttrib(focussedId, 'tabindex', '-1'); - dom.setAttrib(newFocus.id, 'tabindex', '0'); - dom.get(newFocus.id).focus(); - - if (settings.actOnFocus) { - settings.onAction(newFocus.id); - } - - if (evt) - Event.cancel(evt); - }; - - rootKeydown = function(evt) { - var DOM_VK_LEFT = 37, DOM_VK_RIGHT = 39, DOM_VK_UP = 38, DOM_VK_DOWN = 40, DOM_VK_ESCAPE = 27, DOM_VK_ENTER = 14, DOM_VK_RETURN = 13, DOM_VK_SPACE = 32; - - switch (evt.keyCode) { - case DOM_VK_LEFT: - if (enableLeftRight) t.moveFocus(-1); - break; - - case DOM_VK_RIGHT: - if (enableLeftRight) t.moveFocus(1); - break; - - case DOM_VK_UP: - if (enableUpDown) t.moveFocus(-1); - break; - - case DOM_VK_DOWN: - if (enableUpDown) t.moveFocus(1); - break; - - case DOM_VK_ESCAPE: - if (settings.onCancel) { - settings.onCancel(); - Event.cancel(evt); - } - break; - - case DOM_VK_ENTER: - case DOM_VK_RETURN: - case DOM_VK_SPACE: - if (settings.onAction) { - settings.onAction(focussedId); - Event.cancel(evt); - } - break; - } - }; - - // Set up state and listeners for each item. - each(items, function(item, idx) { - var tabindex; - - if (!item.id) { - item.id = dom.uniqueId('_mce_item_'); - } - - if (excludeFromTabOrder) { - dom.bind(item.id, 'blur', itemBlurred); - tabindex = '-1'; - } else { - tabindex = (idx === 0 ? '0' : '-1'); - } - - dom.setAttrib(item.id, 'tabindex', tabindex); - dom.bind(dom.get(item.id), 'focus', itemFocussed); - }); - - // Setup initial state for root element. - if (items[0]){ - focussedId = items[0].id; - } - - dom.setAttrib(root, 'tabindex', '-1'); - - // Setup listeners for root element. - dom.bind(dom.get(root), 'focus', rootFocussed); - dom.bind(dom.get(root), 'keydown', rootKeydown); - } - }); -})(tinymce); - -(function(tinymce) { - // Shorten class names - var DOM = tinymce.DOM, is = tinymce.is; - - tinymce.create('tinymce.ui.Control', { - Control : function(id, s, editor) { - this.id = id; - this.settings = s = s || {}; - this.rendered = false; - this.onRender = new tinymce.util.Dispatcher(this); - this.classPrefix = ''; - this.scope = s.scope || this; - this.disabled = 0; - this.active = 0; - this.editor = editor; - }, - - setAriaProperty : function(property, value) { - var element = DOM.get(this.id + '_aria') || DOM.get(this.id); - if (element) { - DOM.setAttrib(element, 'aria-' + property, !!value); - } - }, - - focus : function() { - DOM.get(this.id).focus(); - }, - - setDisabled : function(s) { - if (s != this.disabled) { - this.setAriaProperty('disabled', s); - - this.setState('Disabled', s); - this.setState('Enabled', !s); - this.disabled = s; - } - }, - - isDisabled : function() { - return this.disabled; - }, - - setActive : function(s) { - if (s != this.active) { - this.setState('Active', s); - this.active = s; - this.setAriaProperty('pressed', s); - } - }, - - isActive : function() { - return this.active; - }, - - setState : function(c, s) { - var n = DOM.get(this.id); - - c = this.classPrefix + c; - - if (s) - DOM.addClass(n, c); - else - DOM.removeClass(n, c); - }, - - isRendered : function() { - return this.rendered; - }, - - renderHTML : function() { - }, - - renderTo : function(n) { - DOM.setHTML(n, this.renderHTML()); - }, - - postRender : function() { - var t = this, b; - - // Set pending states - if (is(t.disabled)) { - b = t.disabled; - t.disabled = -1; - t.setDisabled(b); - } - - if (is(t.active)) { - b = t.active; - t.active = -1; - t.setActive(b); - } - }, - - remove : function() { - DOM.remove(this.id); - this.destroy(); - }, - - destroy : function() { - tinymce.dom.Event.clear(this.id); - } - }); -})(tinymce); -tinymce.create('tinymce.ui.Container:tinymce.ui.Control', { - Container : function(id, s, editor) { - this.parent(id, s, editor); - - this.controls = []; - - this.lookup = {}; - }, - - add : function(c) { - this.lookup[c.id] = c; - this.controls.push(c); - - return c; - }, - - get : function(n) { - return this.lookup[n]; - } -}); - - -tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { - Separator : function(id, s) { - this.parent(id, s); - this.classPrefix = 'mceSeparator'; - this.setDisabled(true); - }, - - renderHTML : function() { - return tinymce.DOM.createHTML('span', {'class' : this.classPrefix, role : 'separator', 'aria-orientation' : 'vertical', tabindex : '-1'}); - } -}); - -(function(tinymce) { - var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk; - - tinymce.create('tinymce.ui.MenuItem:tinymce.ui.Control', { - MenuItem : function(id, s) { - this.parent(id, s); - this.classPrefix = 'mceMenuItem'; - }, - - setSelected : function(s) { - this.setState('Selected', s); - this.setAriaProperty('checked', !!s); - this.selected = s; - }, - - isSelected : function() { - return this.selected; - }, - - postRender : function() { - var t = this; - - t.parent(); - - // Set pending state - if (is(t.selected)) - t.setSelected(t.selected); - } - }); -})(tinymce); - -(function(tinymce) { - var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk; - - tinymce.create('tinymce.ui.Menu:tinymce.ui.MenuItem', { - Menu : function(id, s) { - var t = this; - - t.parent(id, s); - t.items = {}; - t.collapsed = false; - t.menuCount = 0; - t.onAddItem = new tinymce.util.Dispatcher(this); - }, - - expand : function(d) { - var t = this; - - if (d) { - walk(t, function(o) { - if (o.expand) - o.expand(); - }, 'items', t); - } - - t.collapsed = false; - }, - - collapse : function(d) { - var t = this; - - if (d) { - walk(t, function(o) { - if (o.collapse) - o.collapse(); - }, 'items', t); - } - - t.collapsed = true; - }, - - isCollapsed : function() { - return this.collapsed; - }, - - add : function(o) { - if (!o.settings) - o = new tinymce.ui.MenuItem(o.id || DOM.uniqueId(), o); - - this.onAddItem.dispatch(this, o); - - return this.items[o.id] = o; - }, - - addSeparator : function() { - return this.add({separator : true}); - }, - - addMenu : function(o) { - if (!o.collapse) - o = this.createMenu(o); - - this.menuCount++; - - return this.add(o); - }, - - hasMenus : function() { - return this.menuCount !== 0; - }, - - remove : function(o) { - delete this.items[o.id]; - }, - - removeAll : function() { - var t = this; - - walk(t, function(o) { - if (o.removeAll) - o.removeAll(); - else - o.remove(); - - o.destroy(); - }, 'items', t); - - t.items = {}; - }, - - createMenu : function(o) { - var m = new tinymce.ui.Menu(o.id || DOM.uniqueId(), o); - - m.onAddItem.add(this.onAddItem.dispatch, this.onAddItem); - - return m; - } - }); -})(tinymce); -(function(tinymce) { - var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event, Element = tinymce.dom.Element; - - tinymce.create('tinymce.ui.DropMenu:tinymce.ui.Menu', { - DropMenu : function(id, s) { - s = s || {}; - s.container = s.container || DOM.doc.body; - s.offset_x = s.offset_x || 0; - s.offset_y = s.offset_y || 0; - s.vp_offset_x = s.vp_offset_x || 0; - s.vp_offset_y = s.vp_offset_y || 0; - - if (is(s.icons) && !s.icons) - s['class'] += ' mceNoIcons'; - - this.parent(id, s); - this.onShowMenu = new tinymce.util.Dispatcher(this); - this.onHideMenu = new tinymce.util.Dispatcher(this); - this.classPrefix = 'mceMenu'; - }, - - createMenu : function(s) { - var t = this, cs = t.settings, m; - - s.container = s.container || cs.container; - s.parent = t; - s.constrain = s.constrain || cs.constrain; - s['class'] = s['class'] || cs['class']; - s.vp_offset_x = s.vp_offset_x || cs.vp_offset_x; - s.vp_offset_y = s.vp_offset_y || cs.vp_offset_y; - s.keyboard_focus = cs.keyboard_focus; - m = new tinymce.ui.DropMenu(s.id || DOM.uniqueId(), s); - - m.onAddItem.add(t.onAddItem.dispatch, t.onAddItem); - - return m; - }, - - focus : function() { - var t = this; - if (t.keyboardNav) { - t.keyboardNav.focus(); - } - }, - - update : function() { - var t = this, s = t.settings, tb = DOM.get('menu_' + t.id + '_tbl'), co = DOM.get('menu_' + t.id + '_co'), tw, th; - - tw = s.max_width ? Math.min(tb.clientWidth, s.max_width) : tb.clientWidth; - th = s.max_height ? Math.min(tb.clientHeight, s.max_height) : tb.clientHeight; - - if (!DOM.boxModel) - t.element.setStyles({width : tw + 2, height : th + 2}); - else - t.element.setStyles({width : tw, height : th}); - - if (s.max_width) - DOM.setStyle(co, 'width', tw); - - if (s.max_height) { - DOM.setStyle(co, 'height', th); - - if (tb.clientHeight < s.max_height) - DOM.setStyle(co, 'overflow', 'hidden'); - } - }, - - showMenu : function(x, y, px) { - var t = this, s = t.settings, co, vp = DOM.getViewPort(), w, h, mx, my, ot = 2, dm, tb, cp = t.classPrefix; - - t.collapse(1); - - if (t.isMenuVisible) - return; - - if (!t.rendered) { - co = DOM.add(t.settings.container, t.renderNode()); - - each(t.items, function(o) { - o.postRender(); - }); - - t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container}); - } else - co = DOM.get('menu_' + t.id); - - // Move layer out of sight unless it's Opera since it scrolls to top of page due to an bug - if (!tinymce.isOpera) - DOM.setStyles(co, {left : -0xFFFF , top : -0xFFFF}); - - DOM.show(co); - t.update(); - - x += s.offset_x || 0; - y += s.offset_y || 0; - vp.w -= 4; - vp.h -= 4; - - // Move inside viewport if not submenu - if (s.constrain) { - w = co.clientWidth - ot; - h = co.clientHeight - ot; - mx = vp.x + vp.w; - my = vp.y + vp.h; - - if ((x + s.vp_offset_x + w) > mx) - x = px ? px - w : Math.max(0, (mx - s.vp_offset_x) - w); - - if ((y + s.vp_offset_y + h) > my) - y = Math.max(0, (my - s.vp_offset_y) - h); - } - - DOM.setStyles(co, {left : x , top : y}); - t.element.update(); - - t.isMenuVisible = 1; - t.mouseClickFunc = Event.add(co, 'click', function(e) { - var m; - - e = e.target; - - if (e && (e = DOM.getParent(e, 'tr')) && !DOM.hasClass(e, cp + 'ItemSub')) { - m = t.items[e.id]; - - if (m.isDisabled()) - return; - - dm = t; - - while (dm) { - if (dm.hideMenu) - dm.hideMenu(); - - dm = dm.settings.parent; - } - - if (m.settings.onclick) - m.settings.onclick(e); - - return Event.cancel(e); // Cancel to fix onbeforeunload problem - } - }); - - if (t.hasMenus()) { - t.mouseOverFunc = Event.add(co, 'mouseover', function(e) { - var m, r, mi; - - e = e.target; - if (e && (e = DOM.getParent(e, 'tr'))) { - m = t.items[e.id]; - - if (t.lastMenu) - t.lastMenu.collapse(1); - - if (m.isDisabled()) - return; - - if (e && DOM.hasClass(e, cp + 'ItemSub')) { - //p = DOM.getPos(s.container); - r = DOM.getRect(e); - m.showMenu((r.x + r.w - ot), r.y - ot, r.x); - t.lastMenu = m; - DOM.addClass(DOM.get(m.id).firstChild, cp + 'ItemActive'); - } - } - }); - } - - Event.add(co, 'keydown', t._keyHandler, t); - - t.onShowMenu.dispatch(t); - - if (s.keyboard_focus) { - t._setupKeyboardNav(); - } - }, - - hideMenu : function(c) { - var t = this, co = DOM.get('menu_' + t.id), e; - - if (!t.isMenuVisible) - return; - - if (t.keyboardNav) t.keyboardNav.destroy(); - Event.remove(co, 'mouseover', t.mouseOverFunc); - Event.remove(co, 'click', t.mouseClickFunc); - Event.remove(co, 'keydown', t._keyHandler); - DOM.hide(co); - t.isMenuVisible = 0; - - if (!c) - t.collapse(1); - - if (t.element) - t.element.hide(); - - if (e = DOM.get(t.id)) - DOM.removeClass(e.firstChild, t.classPrefix + 'ItemActive'); - - t.onHideMenu.dispatch(t); - }, - - add : function(o) { - var t = this, co; - - o = t.parent(o); - - if (t.isRendered && (co = DOM.get('menu_' + t.id))) - t._add(DOM.select('tbody', co)[0], o); - - return o; - }, - - collapse : function(d) { - this.parent(d); - this.hideMenu(1); - }, - - remove : function(o) { - DOM.remove(o.id); - this.destroy(); - - return this.parent(o); - }, - - destroy : function() { - var t = this, co = DOM.get('menu_' + t.id); - - if (t.keyboardNav) t.keyboardNav.destroy(); - Event.remove(co, 'mouseover', t.mouseOverFunc); - Event.remove(DOM.select('a', co), 'focus', t.mouseOverFunc); - Event.remove(co, 'click', t.mouseClickFunc); - Event.remove(co, 'keydown', t._keyHandler); - - if (t.element) - t.element.remove(); - - DOM.remove(co); - }, - - renderNode : function() { - var t = this, s = t.settings, n, tb, co, w; - - w = DOM.create('div', {role: 'listbox', id : 'menu_' + t.id, 'class' : s['class'], 'style' : 'position:absolute;left:0;top:0;z-index:200000;outline:0'}); - if (t.settings.parent) { - DOM.setAttrib(w, 'aria-parent', 'menu_' + t.settings.parent.id); - } - co = DOM.add(w, 'div', {role: 'presentation', id : 'menu_' + t.id + '_co', 'class' : t.classPrefix + (s['class'] ? ' ' + s['class'] : '')}); - t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container}); - - if (s.menu_line) - DOM.add(co, 'span', {'class' : t.classPrefix + 'Line'}); - -// n = DOM.add(co, 'div', {id : 'menu_' + t.id + '_co', 'class' : 'mceMenuContainer'}); - n = DOM.add(co, 'table', {role: 'presentation', id : 'menu_' + t.id + '_tbl', border : 0, cellPadding : 0, cellSpacing : 0}); - tb = DOM.add(n, 'tbody'); - - each(t.items, function(o) { - t._add(tb, o); - }); - - t.rendered = true; - - return w; - }, - - // Internal functions - _setupKeyboardNav : function(){ - var contextMenu, menuItems, t=this; - contextMenu = DOM.select('#menu_' + t.id)[0]; - menuItems = DOM.select('a[role=option]', 'menu_' + t.id); - menuItems.splice(0,0,contextMenu); - t.keyboardNav = new tinymce.ui.KeyboardNavigation({ - root: 'menu_' + t.id, - items: menuItems, - onCancel: function() { - t.hideMenu(); - }, - enableUpDown: true - }); - contextMenu.focus(); - }, - - _keyHandler : function(evt) { - var t = this, e; - switch (evt.keyCode) { - case 37: // Left - if (t.settings.parent) { - t.hideMenu(); - t.settings.parent.focus(); - Event.cancel(evt); - } - break; - case 39: // Right - if (t.mouseOverFunc) - t.mouseOverFunc(evt); - break; - } - }, - - _add : function(tb, o) { - var n, s = o.settings, a, ro, it, cp = this.classPrefix, ic; - - if (s.separator) { - ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'ItemSeparator'}); - DOM.add(ro, 'td', {'class' : cp + 'ItemSeparator'}); - - if (n = ro.previousSibling) - DOM.addClass(n, 'mceLast'); - - return; - } - - n = ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'Item ' + cp + 'ItemEnabled'}); - n = it = DOM.add(n, s.titleItem ? 'th' : 'td'); - n = a = DOM.add(n, 'a', {id: o.id + '_aria', role: s.titleItem ? 'presentation' : 'option', href : 'javascript:;', onclick : "return false;", onmousedown : 'return false;'}); - - if (s.parent) { - DOM.setAttrib(a, 'aria-haspopup', 'true'); - DOM.setAttrib(a, 'aria-owns', 'menu_' + o.id); - } - - DOM.addClass(it, s['class']); -// n = DOM.add(n, 'span', {'class' : 'item'}); - - ic = DOM.add(n, 'span', {'class' : 'mceIcon' + (s.icon ? ' mce_' + s.icon : '')}); - - if (s.icon_src) - DOM.add(ic, 'img', {src : s.icon_src}); - - n = DOM.add(n, s.element || 'span', {'class' : 'mceText', title : o.settings.title}, o.settings.title); - - if (o.settings.style) - DOM.setAttrib(n, 'style', o.settings.style); - - if (tb.childNodes.length == 1) - DOM.addClass(ro, 'mceFirst'); - - if ((n = ro.previousSibling) && DOM.hasClass(n, cp + 'ItemSeparator')) - DOM.addClass(ro, 'mceFirst'); - - if (o.collapse) - DOM.addClass(ro, cp + 'ItemSub'); - - if (n = ro.previousSibling) - DOM.removeClass(n, 'mceLast'); - - DOM.addClass(ro, 'mceLast'); - } - }); -})(tinymce); -(function(tinymce) { - var DOM = tinymce.DOM; - - tinymce.create('tinymce.ui.Button:tinymce.ui.Control', { - Button : function(id, s, ed) { - this.parent(id, s, ed); - this.classPrefix = 'mceButton'; - }, - - renderHTML : function() { - var cp = this.classPrefix, s = this.settings, h, l; - - l = DOM.encode(s.label || ''); - h = ''; - if (s.image && !(this.editor &&this.editor.forcedHighContrastMode) ) - h += '' + DOM.encode(s.title) + '' + l; - else - h += '' + (l ? '' + l + '' : ''); - - h += ''; - h += ''; - return h; - }, - - postRender : function() { - var t = this, s = t.settings; - - tinymce.dom.Event.add(t.id, 'click', function(e) { - if (!t.isDisabled()) - return s.onclick.call(s.scope, e); - }); - } - }); -})(tinymce); - -(function(tinymce) { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher; - - tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control', { - ListBox : function(id, s, ed) { - var t = this; - - t.parent(id, s, ed); - - t.items = []; - - t.onChange = new Dispatcher(t); - - t.onPostRender = new Dispatcher(t); - - t.onAdd = new Dispatcher(t); - - t.onRenderMenu = new tinymce.util.Dispatcher(this); - - t.classPrefix = 'mceListBox'; - }, - - select : function(va) { - var t = this, fv, f; - - if (va == undefined) - return t.selectByIndex(-1); - - // Is string or number make function selector - if (va && va.call) - f = va; - else { - f = function(v) { - return v == va; - }; - } - - // Do we need to do something? - if (va != t.selectedValue) { - // Find item - each(t.items, function(o, i) { - if (f(o.value)) { - fv = 1; - t.selectByIndex(i); - return false; - } - }); - - if (!fv) - t.selectByIndex(-1); - } - }, - - selectByIndex : function(idx) { - var t = this, e, o, label; - - if (idx != t.selectedIndex) { - e = DOM.get(t.id + '_text'); - label = DOM.get(t.id + '_voiceDesc'); - o = t.items[idx]; - - if (o) { - t.selectedValue = o.value; - t.selectedIndex = idx; - DOM.setHTML(e, DOM.encode(o.title)); - DOM.setHTML(label, t.settings.title + " - " + o.title); - DOM.removeClass(e, 'mceTitle'); - DOM.setAttrib(t.id, 'aria-valuenow', o.title); - } else { - DOM.setHTML(e, DOM.encode(t.settings.title)); - DOM.setHTML(label, DOM.encode(t.settings.title)); - DOM.addClass(e, 'mceTitle'); - t.selectedValue = t.selectedIndex = null; - DOM.setAttrib(t.id, 'aria-valuenow', t.settings.title); - } - e = 0; - } - }, - - add : function(n, v, o) { - var t = this; - - o = o || {}; - o = tinymce.extend(o, { - title : n, - value : v - }); - - t.items.push(o); - t.onAdd.dispatch(t, o); - }, - - getLength : function() { - return this.items.length; - }, - - renderHTML : function() { - var h = '', t = this, s = t.settings, cp = t.classPrefix; - - h = ''; - h += ''; - h += ''; - h += ''; - - return h; - }, - - showMenu : function() { - var t = this, p2, e = DOM.get(this.id), m; - - if (t.isDisabled() || t.items.length == 0) - return; - - if (t.menu && t.menu.isMenuVisible) - return t.hideMenu(); - - if (!t.isMenuRendered) { - t.renderMenu(); - t.isMenuRendered = true; - } - - p2 = DOM.getPos(e); - - m = t.menu; - m.settings.offset_x = p2.x; - m.settings.offset_y = p2.y; - m.settings.keyboard_focus = !tinymce.isOpera; // Opera is buggy when it comes to auto focus - - // Select in menu - if (t.oldID) - m.items[t.oldID].setSelected(0); - - each(t.items, function(o) { - if (o.value === t.selectedValue) { - m.items[o.id].setSelected(1); - t.oldID = o.id; - } - }); - - m.showMenu(0, e.clientHeight); - - Event.add(DOM.doc, 'mousedown', t.hideMenu, t); - DOM.addClass(t.id, t.classPrefix + 'Selected'); - - //DOM.get(t.id + '_text').focus(); - }, - - hideMenu : function(e) { - var t = this; - - if (t.menu && t.menu.isMenuVisible) { - DOM.removeClass(t.id, t.classPrefix + 'Selected'); - - // Prevent double toogles by canceling the mouse click event to the button - if (e && e.type == "mousedown" && (e.target.id == t.id + '_text' || e.target.id == t.id + '_open')) - return; - - if (!e || !DOM.getParent(e.target, '.mceMenu')) { - DOM.removeClass(t.id, t.classPrefix + 'Selected'); - Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); - t.menu.hideMenu(); - } - } - }, - - renderMenu : function() { - var t = this, m; - - m = t.settings.control_manager.createDropMenu(t.id + '_menu', { - menu_line : 1, - 'class' : t.classPrefix + 'Menu mceNoIcons', - max_width : 150, - max_height : 150 - }); - - m.onHideMenu.add(function() { - t.hideMenu(); - t.focus(); - }); - - m.add({ - title : t.settings.title, - 'class' : 'mceMenuItemTitle', - onclick : function() { - if (t.settings.onselect('') !== false) - t.select(''); // Must be runned after - } - }); - - each(t.items, function(o) { - // No value then treat it as a title - if (o.value === undefined) { - m.add({ - title : o.title, - role : "option", - 'class' : 'mceMenuItemTitle', - onclick : function() { - if (t.settings.onselect('') !== false) - t.select(''); // Must be runned after - } - }); - } else { - o.id = DOM.uniqueId(); - o.role= "option"; - o.onclick = function() { - if (t.settings.onselect(o.value) !== false) - t.select(o.value); // Must be runned after - }; - - m.add(o); - } - }); - - t.onRenderMenu.dispatch(t, m); - t.menu = m; - }, - - postRender : function() { - var t = this, cp = t.classPrefix; - - Event.add(t.id, 'click', t.showMenu, t); - Event.add(t.id, 'keydown', function(evt) { - if (evt.keyCode == 32) { // Space - t.showMenu(evt); - Event.cancel(evt); - } - }); - Event.add(t.id, 'focus', function() { - if (!t._focused) { - t.keyDownHandler = Event.add(t.id, 'keydown', function(e) { - if (e.keyCode == 40) { - t.showMenu(); - Event.cancel(e); - } - }); - t.keyPressHandler = Event.add(t.id, 'keypress', function(e) { - var v; - if (e.keyCode == 13) { - // Fake select on enter - v = t.selectedValue; - t.selectedValue = null; // Needs to be null to fake change - Event.cancel(e); - t.settings.onselect(v); - } - }); - } - - t._focused = 1; - }); - Event.add(t.id, 'blur', function() { - Event.remove(t.id, 'keydown', t.keyDownHandler); - Event.remove(t.id, 'keypress', t.keyPressHandler); - t._focused = 0; - }); - - // Old IE doesn't have hover on all elements - if (tinymce.isIE6 || !DOM.boxModel) { - Event.add(t.id, 'mouseover', function() { - if (!DOM.hasClass(t.id, cp + 'Disabled')) - DOM.addClass(t.id, cp + 'Hover'); - }); - - Event.add(t.id, 'mouseout', function() { - if (!DOM.hasClass(t.id, cp + 'Disabled')) - DOM.removeClass(t.id, cp + 'Hover'); - }); - } - - t.onPostRender.dispatch(t, DOM.get(t.id)); - }, - - destroy : function() { - this.parent(); - - Event.clear(this.id + '_text'); - Event.clear(this.id + '_open'); - } - }); -})(tinymce); - -(function(tinymce) { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher; - - tinymce.create('tinymce.ui.NativeListBox:tinymce.ui.ListBox', { - NativeListBox : function(id, s) { - this.parent(id, s); - this.classPrefix = 'mceNativeListBox'; - }, - - setDisabled : function(s) { - DOM.get(this.id).disabled = s; - this.setAriaProperty('disabled', s); - }, - - isDisabled : function() { - return DOM.get(this.id).disabled; - }, - - select : function(va) { - var t = this, fv, f; - - if (va == undefined) - return t.selectByIndex(-1); - - // Is string or number make function selector - if (va && va.call) - f = va; - else { - f = function(v) { - return v == va; - }; - } - - // Do we need to do something? - if (va != t.selectedValue) { - // Find item - each(t.items, function(o, i) { - if (f(o.value)) { - fv = 1; - t.selectByIndex(i); - return false; - } - }); - - if (!fv) - t.selectByIndex(-1); - } - }, - - selectByIndex : function(idx) { - DOM.get(this.id).selectedIndex = idx + 1; - this.selectedValue = this.items[idx] ? this.items[idx].value : null; - }, - - add : function(n, v, a) { - var o, t = this; - - a = a || {}; - a.value = v; - - if (t.isRendered()) - DOM.add(DOM.get(this.id), 'option', a, n); - - o = { - title : n, - value : v, - attribs : a - }; - - t.items.push(o); - t.onAdd.dispatch(t, o); - }, - - getLength : function() { - return this.items.length; - }, - - renderHTML : function() { - var h, t = this; - - h = DOM.createHTML('option', {value : ''}, '-- ' + t.settings.title + ' --'); - - each(t.items, function(it) { - h += DOM.createHTML('option', {value : it.value}, it.title); - }); - - h = DOM.createHTML('select', {id : t.id, 'class' : 'mceNativeListBox', 'aria-labelledby': t.id + '_aria'}, h); - h += DOM.createHTML('span', {id : t.id + '_aria', 'style': 'display: none'}, t.settings.title); - return h; - }, - - postRender : function() { - var t = this, ch, changeListenerAdded = true; - - t.rendered = true; - - function onChange(e) { - var v = t.items[e.target.selectedIndex - 1]; - - if (v && (v = v.value)) { - t.onChange.dispatch(t, v); - - if (t.settings.onselect) - t.settings.onselect(v); - } - }; - - Event.add(t.id, 'change', onChange); - - // Accessibility keyhandler - Event.add(t.id, 'keydown', function(e) { - var bf; - - Event.remove(t.id, 'change', ch); - changeListenerAdded = false; - - bf = Event.add(t.id, 'blur', function() { - if (changeListenerAdded) return; - changeListenerAdded = true; - Event.add(t.id, 'change', onChange); - Event.remove(t.id, 'blur', bf); - }); - - //prevent default left and right keys on chrome - so that the keyboard navigation is used. - if (tinymce.isWebKit && (e.keyCode==37 ||e.keyCode==39)) { - return Event.prevent(e); - } - - if (e.keyCode == 13 || e.keyCode == 32) { - onChange(e); - return Event.cancel(e); - } - }); - - t.onPostRender.dispatch(t, DOM.get(t.id)); - } - }); -})(tinymce); - -(function(tinymce) { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each; - - tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button', { - MenuButton : function(id, s, ed) { - this.parent(id, s, ed); - - this.onRenderMenu = new tinymce.util.Dispatcher(this); - - s.menu_container = s.menu_container || DOM.doc.body; - }, - - showMenu : function() { - var t = this, p1, p2, e = DOM.get(t.id), m; - - if (t.isDisabled()) - return; - - if (!t.isMenuRendered) { - t.renderMenu(); - t.isMenuRendered = true; - } - - if (t.isMenuVisible) - return t.hideMenu(); - - p1 = DOM.getPos(t.settings.menu_container); - p2 = DOM.getPos(e); - - m = t.menu; - m.settings.offset_x = p2.x; - m.settings.offset_y = p2.y; - m.settings.vp_offset_x = p2.x; - m.settings.vp_offset_y = p2.y; - m.settings.keyboard_focus = t._focused; - m.showMenu(0, e.clientHeight); - - Event.add(DOM.doc, 'mousedown', t.hideMenu, t); - t.setState('Selected', 1); - - t.isMenuVisible = 1; - }, - - renderMenu : function() { - var t = this, m; - - m = t.settings.control_manager.createDropMenu(t.id + '_menu', { - menu_line : 1, - 'class' : this.classPrefix + 'Menu', - icons : t.settings.icons - }); - - m.onHideMenu.add(function() { - t.hideMenu(); - t.focus(); - }); - - t.onRenderMenu.dispatch(t, m); - t.menu = m; - }, - - hideMenu : function(e) { - var t = this; - - // Prevent double toogles by canceling the mouse click event to the button - if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id || e.id === t.id + '_open';})) - return; - - if (!e || !DOM.getParent(e.target, '.mceMenu')) { - t.setState('Selected', 0); - Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); - if (t.menu) - t.menu.hideMenu(); - } - - t.isMenuVisible = 0; - }, - - postRender : function() { - var t = this, s = t.settings; - - Event.add(t.id, 'click', function() { - if (!t.isDisabled()) { - if (s.onclick) - s.onclick(t.value); - - t.showMenu(); - } - }); - } - }); -})(tinymce); - -(function(tinymce) { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each; - - tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton', { - SplitButton : function(id, s, ed) { - this.parent(id, s, ed); - this.classPrefix = 'mceSplitButton'; - }, - - renderHTML : function() { - var h, t = this, s = t.settings, h1; - - h = ''; - - if (s.image) - h1 = DOM.createHTML('img ', {src : s.image, role: 'presentation', 'class' : 'mceAction ' + s['class']}); - else - h1 = DOM.createHTML('span', {'class' : 'mceAction ' + s['class']}, ''); - - h1 += DOM.createHTML('span', {'class': 'mceVoiceLabel mceIconOnly', id: t.id + '_voice', style: 'display:none;'}, s.title); - h += '' + DOM.createHTML('a', {role: 'button', id : t.id + '_action', tabindex: '-1', href : 'javascript:;', 'class' : 'mceAction ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + ''; - - h1 = DOM.createHTML('span', {'class' : 'mceOpen ' + s['class']}, ''); - h += '' + DOM.createHTML('a', {role: 'button', id : t.id + '_open', tabindex: '-1', href : 'javascript:;', 'class' : 'mceOpen ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + ''; - - h += ''; - h = DOM.createHTML('table', { role: 'presentation', 'class' : 'mceSplitButton mceSplitButtonEnabled ' + s['class'], cellpadding : '0', cellspacing : '0', title : s.title}, h); - return DOM.createHTML('div', {id : t.id, role: 'button', tabindex: '0', 'aria-labelledby': t.id + '_voice', 'aria-haspopup': 'true'}, h); - }, - - postRender : function() { - var t = this, s = t.settings, activate; - - if (s.onclick) { - activate = function(evt) { - if (!t.isDisabled()) { - s.onclick(t.value); - Event.cancel(evt); - } - }; - Event.add(t.id + '_action', 'click', activate); - Event.add(t.id, ['click', 'keydown'], function(evt) { - var DOM_VK_SPACE = 32, DOM_VK_ENTER = 14, DOM_VK_RETURN = 13, DOM_VK_UP = 38, DOM_VK_DOWN = 40; - if ((evt.keyCode === 32 || evt.keyCode === 13 || evt.keyCode === 14) && !evt.altKey && !evt.ctrlKey && !evt.metaKey) { - activate(); - Event.cancel(evt); - } else if (evt.type === 'click' || evt.keyCode === DOM_VK_DOWN) { - t.showMenu(); - Event.cancel(evt); - } - }); - } - - Event.add(t.id + '_open', 'click', function (evt) { - t.showMenu(); - Event.cancel(evt); - }); - Event.add([t.id, t.id + '_open'], 'focus', function() {t._focused = 1;}); - Event.add([t.id, t.id + '_open'], 'blur', function() {t._focused = 0;}); - - // Old IE doesn't have hover on all elements - if (tinymce.isIE6 || !DOM.boxModel) { - Event.add(t.id, 'mouseover', function() { - if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled')) - DOM.addClass(t.id, 'mceSplitButtonHover'); - }); - - Event.add(t.id, 'mouseout', function() { - if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled')) - DOM.removeClass(t.id, 'mceSplitButtonHover'); - }); - } - }, - - destroy : function() { - this.parent(); - - Event.clear(this.id + '_action'); - Event.clear(this.id + '_open'); - Event.clear(this.id); - } - }); -})(tinymce); - -(function(tinymce) { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, is = tinymce.is, each = tinymce.each; - - tinymce.create('tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton', { - ColorSplitButton : function(id, s, ed) { - var t = this; - - t.parent(id, s, ed); - - t.settings = s = tinymce.extend({ - colors : '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF', - grid_width : 8, - default_color : '#888888' - }, t.settings); - - t.onShowMenu = new tinymce.util.Dispatcher(t); - - t.onHideMenu = new tinymce.util.Dispatcher(t); - - t.value = s.default_color; - }, - - showMenu : function() { - var t = this, r, p, e, p2; - - if (t.isDisabled()) - return; - - if (!t.isMenuRendered) { - t.renderMenu(); - t.isMenuRendered = true; - } - - if (t.isMenuVisible) - return t.hideMenu(); - - e = DOM.get(t.id); - DOM.show(t.id + '_menu'); - DOM.addClass(e, 'mceSplitButtonSelected'); - p2 = DOM.getPos(e); - DOM.setStyles(t.id + '_menu', { - left : p2.x, - top : p2.y + e.clientHeight, - zIndex : 200000 - }); - e = 0; - - Event.add(DOM.doc, 'mousedown', t.hideMenu, t); - t.onShowMenu.dispatch(t); - - if (t._focused) { - t._keyHandler = Event.add(t.id + '_menu', 'keydown', function(e) { - if (e.keyCode == 27) - t.hideMenu(); - }); - - DOM.select('a', t.id + '_menu')[0].focus(); // Select first link - } - - t.isMenuVisible = 1; - }, - - hideMenu : function(e) { - var t = this; - - if (t.isMenuVisible) { - // Prevent double toogles by canceling the mouse click event to the button - if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id + '_open';})) - return; - - if (!e || !DOM.getParent(e.target, '.mceSplitButtonMenu')) { - DOM.removeClass(t.id, 'mceSplitButtonSelected'); - Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); - Event.remove(t.id + '_menu', 'keydown', t._keyHandler); - DOM.hide(t.id + '_menu'); - } - - t.isMenuVisible = 0; - t.onHideMenu.dispatch(); - } - }, - - renderMenu : function() { - var t = this, m, i = 0, s = t.settings, n, tb, tr, w, context; - - w = DOM.add(s.menu_container, 'div', {role: 'listbox', id : t.id + '_menu', 'class' : s['menu_class'] + ' ' + s['class'], style : 'position:absolute;left:0;top:-1000px;'}); - m = DOM.add(w, 'div', {'class' : s['class'] + ' mceSplitButtonMenu'}); - DOM.add(m, 'span', {'class' : 'mceMenuLine'}); - - n = DOM.add(m, 'table', {role: 'presentation', 'class' : 'mceColorSplitMenu'}); - tb = DOM.add(n, 'tbody'); - - // Generate color grid - i = 0; - each(is(s.colors, 'array') ? s.colors : s.colors.split(','), function(c) { - c = c.replace(/^#/, ''); - - if (!i--) { - tr = DOM.add(tb, 'tr'); - i = s.grid_width - 1; - } - - n = DOM.add(tr, 'td'); - n = DOM.add(n, 'a', { - role : 'option', - href : 'javascript:;', - style : { - backgroundColor : '#' + c - }, - 'title': t.editor.getLang('colors.' + c, c), - 'data-mce-color' : '#' + c - }); - - if (t.editor.forcedHighContrastMode) { - n = DOM.add(n, 'canvas', { width: 16, height: 16, 'aria-hidden': 'true' }); - if (n.getContext && (context = n.getContext("2d"))) { - context.fillStyle = '#' + c; - context.fillRect(0, 0, 16, 16); - } else { - // No point leaving a canvas element around if it's not supported for drawing on anyway. - DOM.remove(n); - } - } - }); - - if (s.more_colors_func) { - n = DOM.add(tb, 'tr'); - n = DOM.add(n, 'td', {colspan : s.grid_width, 'class' : 'mceMoreColors'}); - n = DOM.add(n, 'a', {role: 'option', id : t.id + '_more', href : 'javascript:;', onclick : 'return false;', 'class' : 'mceMoreColors'}, s.more_colors_title); - - Event.add(n, 'click', function(e) { - s.more_colors_func.call(s.more_colors_scope || this); - return Event.cancel(e); // Cancel to fix onbeforeunload problem - }); - } - - DOM.addClass(m, 'mceColorSplitMenu'); - - new tinymce.ui.KeyboardNavigation({ - root: t.id + '_menu', - items: DOM.select('a', t.id + '_menu'), - onCancel: function() { - t.hideMenu(); - t.focus(); - } - }); - - // Prevent IE from scrolling and hindering click to occur #4019 - Event.add(t.id + '_menu', 'mousedown', function(e) {return Event.cancel(e);}); - - Event.add(t.id + '_menu', 'click', function(e) { - var c; - - e = DOM.getParent(e.target, 'a', tb); - - if (e && e.nodeName.toLowerCase() == 'a' && (c = e.getAttribute('data-mce-color'))) - t.setColor(c); - - return Event.cancel(e); // Prevent IE auto save warning - }); - - return w; - }, - - setColor : function(c) { - this.displayColor(c); - this.hideMenu(); - this.settings.onselect(c); - }, - - displayColor : function(c) { - var t = this; - - DOM.setStyle(t.id + '_preview', 'backgroundColor', c); - - t.value = c; - }, - - postRender : function() { - var t = this, id = t.id; - - t.parent(); - DOM.add(id + '_action', 'div', {id : id + '_preview', 'class' : 'mceColorPreview'}); - DOM.setStyle(t.id + '_preview', 'backgroundColor', t.value); - }, - - destroy : function() { - this.parent(); - - Event.clear(this.id + '_menu'); - Event.clear(this.id + '_more'); - DOM.remove(this.id + '_menu'); - } - }); -})(tinymce); - -(function(tinymce) { -// Shorten class names -var dom = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event; -tinymce.create('tinymce.ui.ToolbarGroup:tinymce.ui.Container', { - renderHTML : function() { - var t = this, h = [], controls = t.controls, each = tinymce.each, settings = t.settings; - - h.push('
    '); - //TODO: ACC test this out - adding a role = application for getting the landmarks working well. - h.push(""); - h.push(''); - each(controls, function(toolbar) { - h.push(toolbar.renderHTML()); - }); - h.push(""); - h.push('
    '); - - return h.join(''); - }, - - focus : function() { - var t = this; - dom.get(t.id).focus(); - }, - - postRender : function() { - var t = this, items = []; - - each(t.controls, function(toolbar) { - each (toolbar.controls, function(control) { - if (control.id) { - items.push(control); - } - }); - }); - - t.keyNav = new tinymce.ui.KeyboardNavigation({ - root: t.id, - items: items, - onCancel: function() { - //Move focus if webkit so that navigation back will read the item. - if (tinymce.isWebKit) { - dom.get(t.editor.id+"_ifr").focus(); - } - t.editor.focus(); - }, - excludeFromTabOrder: !t.settings.tab_focus_toolbar - }); - }, - - destroy : function() { - var self = this; - - self.parent(); - self.keyNav.destroy(); - Event.clear(self.id); - } -}); -})(tinymce); - -(function(tinymce) { -// Shorten class names -var dom = tinymce.DOM, each = tinymce.each; -tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { - renderHTML : function() { - var t = this, h = '', c, co, s = t.settings, i, pr, nx, cl; - - cl = t.controls; - for (i=0; i')); - } - - // Add toolbar end before list box and after the previous button - // This is to fix the o2k7 editor skins - if (pr && co.ListBox) { - if (pr.Button || pr.SplitButton) - h += dom.createHTML('td', {'class' : 'mceToolbarEnd'}, dom.createHTML('span', null, '')); - } - - // Render control HTML - - // IE 8 quick fix, needed to propertly generate a hit area for anchors - if (dom.stdMode) - h += '' + co.renderHTML() + ''; - else - h += '' + co.renderHTML() + ''; - - // Add toolbar start after list box and before the next button - // This is to fix the o2k7 editor skins - if (nx && co.ListBox) { - if (nx.Button || nx.SplitButton) - h += dom.createHTML('td', {'class' : 'mceToolbarStart'}, dom.createHTML('span', null, '')); - } - } - - c = 'mceToolbarEnd'; - - if (co.Button) - c += ' mceToolbarEndButton'; - else if (co.SplitButton) - c += ' mceToolbarEndSplitButton'; - else if (co.ListBox) - c += ' mceToolbarEndListBox'; - - h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '')); - - return dom.createHTML('table', {id : t.id, 'class' : 'mceToolbar' + (s['class'] ? ' ' + s['class'] : ''), cellpadding : '0', cellspacing : '0', align : t.settings.align || '', role: 'presentation', tabindex: '-1'}, '' + h + ''); - } -}); -})(tinymce); - -(function(tinymce) { - var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each; - - tinymce.create('tinymce.AddOnManager', { - AddOnManager : function() { - var self = this; - - self.items = []; - self.urls = {}; - self.lookup = {}; - self.onAdd = new Dispatcher(self); - }, - - get : function(n) { - if (this.lookup[n]) { - return this.lookup[n].instance; - } else { - return undefined; - } - }, - - dependencies : function(n) { - var result; - if (this.lookup[n]) { - result = this.lookup[n].dependencies; - } - return result || []; - }, - - requireLangPack : function(n) { - var s = tinymce.settings; - - if (s && s.language && s.language_load !== false) - tinymce.ScriptLoader.add(this.urls[n] + '/langs/' + s.language + '.js'); - }, - - add : function(id, o, dependencies) { - this.items.push(o); - this.lookup[id] = {instance:o, dependencies:dependencies}; - this.onAdd.dispatch(this, id, o); - - return o; - }, - createUrl: function(baseUrl, dep) { - if (typeof dep === "object") { - return dep - } else { - return {prefix: baseUrl.prefix, resource: dep, suffix: baseUrl.suffix}; - } - }, - - addComponents: function(pluginName, scripts) { - var pluginUrl = this.urls[pluginName]; - tinymce.each(scripts, function(script){ - tinymce.ScriptLoader.add(pluginUrl+"/"+script); - }); - }, - - load : function(n, u, cb, s) { - var t = this, url = u; - - function loadDependencies() { - var dependencies = t.dependencies(n); - tinymce.each(dependencies, function(dep) { - var newUrl = t.createUrl(u, dep); - t.load(newUrl.resource, newUrl, undefined, undefined); - }); - if (cb) { - if (s) { - cb.call(s); - } else { - cb.call(tinymce.ScriptLoader); - } - } - } - - if (t.urls[n]) - return; - if (typeof u === "object") - url = u.prefix + u.resource + u.suffix; - - if (url.indexOf('/') != 0 && url.indexOf('://') == -1) - url = tinymce.baseURL + '/' + url; - - t.urls[n] = url.substring(0, url.lastIndexOf('/')); - - if (t.lookup[n]) { - loadDependencies(); - } else { - tinymce.ScriptLoader.add(url, loadDependencies, s); - } - } - }); - - // Create plugin and theme managers - tinymce.PluginManager = new tinymce.AddOnManager(); - tinymce.ThemeManager = new tinymce.AddOnManager(); -}(tinymce)); - -(function(tinymce) { - // Shorten names - var each = tinymce.each, extend = tinymce.extend, - DOM = tinymce.DOM, Event = tinymce.dom.Event, - ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, - explode = tinymce.explode, - Dispatcher = tinymce.util.Dispatcher, undefined, instanceCounter = 0; - - // Setup some URLs where the editor API is located and where the document is - tinymce.documentBaseURL = window.location.href.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, ''); - if (!/[\/\\]$/.test(tinymce.documentBaseURL)) - tinymce.documentBaseURL += '/'; - - tinymce.baseURL = new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL); - - tinymce.baseURI = new tinymce.util.URI(tinymce.baseURL); - - // Add before unload listener - // This was required since IE was leaking memory if you added and removed beforeunload listeners - // with attachEvent/detatchEvent so this only adds one listener and instances can the attach to the onBeforeUnload event - tinymce.onBeforeUnload = new Dispatcher(tinymce); - - // Must be on window or IE will leak if the editor is placed in frame or iframe - Event.add(window, 'beforeunload', function(e) { - tinymce.onBeforeUnload.dispatch(tinymce, e); - }); - - tinymce.onAddEditor = new Dispatcher(tinymce); - - tinymce.onRemoveEditor = new Dispatcher(tinymce); - - tinymce.EditorManager = extend(tinymce, { - editors : [], - - i18n : {}, - - activeEditor : null, - - init : function(s) { - var t = this, pl, sl = tinymce.ScriptLoader, e, el = [], ed; - - function execCallback(se, n, s) { - var f = se[n]; - - if (!f) - return; - - if (tinymce.is(f, 'string')) { - s = f.replace(/\.\w+$/, ''); - s = s ? tinymce.resolve(s) : 0; - f = tinymce.resolve(f); - } - - return f.apply(s || this, Array.prototype.slice.call(arguments, 2)); - }; - - s = extend({ - theme : "simple", - language : "en" - }, s); - - t.settings = s; - - // Legacy call - Event.add(document, 'init', function() { - var l, co; - - execCallback(s, 'onpageload'); - - switch (s.mode) { - case "exact": - l = s.elements || ''; - - if(l.length > 0) { - each(explode(l), function(v) { - if (DOM.get(v)) { - ed = new tinymce.Editor(v, s); - el.push(ed); - ed.render(1); - } else { - each(document.forms, function(f) { - each(f.elements, function(e) { - if (e.name === v) { - v = 'mce_editor_' + instanceCounter++; - DOM.setAttrib(e, 'id', v); - - ed = new tinymce.Editor(v, s); - el.push(ed); - ed.render(1); - } - }); - }); - } - }); - } - break; - - case "textareas": - case "specific_textareas": - function hasClass(n, c) { - return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c); - }; - - each(DOM.select('textarea'), function(v) { - if (s.editor_deselector && hasClass(v, s.editor_deselector)) - return; - - if (!s.editor_selector || hasClass(v, s.editor_selector)) { - // Can we use the name - e = DOM.get(v.name); - if (!v.id && !e) - v.id = v.name; - - // Generate unique name if missing or already exists - if (!v.id || t.get(v.id)) - v.id = DOM.uniqueId(); - - ed = new tinymce.Editor(v.id, s); - el.push(ed); - ed.render(1); - } - }); - break; - } - - // Call onInit when all editors are initialized - if (s.oninit) { - l = co = 0; - - each(el, function(ed) { - co++; - - if (!ed.initialized) { - // Wait for it - ed.onInit.add(function() { - l++; - - // All done - if (l == co) - execCallback(s, 'oninit'); - }); - } else - l++; - - // All done - if (l == co) - execCallback(s, 'oninit'); - }); - } - }); - }, - - get : function(id) { - if (id === undefined) - return this.editors; - - return this.editors[id]; - }, - - getInstanceById : function(id) { - return this.get(id); - }, - - add : function(editor) { - var self = this, editors = self.editors; - - // Add named and index editor instance - editors[editor.id] = editor; - editors.push(editor); - - self._setActive(editor); - self.onAddEditor.dispatch(self, editor); - - - // Patch the tinymce.Editor instance with jQuery adapter logic - if (tinymce.adapter) - tinymce.adapter.patchEditor(editor); - - - return editor; - }, - - remove : function(editor) { - var t = this, i, editors = t.editors; - - // Not in the collection - if (!editors[editor.id]) - return null; - - delete editors[editor.id]; - - for (i = 0; i < editors.length; i++) { - if (editors[i] == editor) { - editors.splice(i, 1); - break; - } - } - - // Select another editor since the active one was removed - if (t.activeEditor == editor) - t._setActive(editors[0]); - - editor.destroy(); - t.onRemoveEditor.dispatch(t, editor); - - return editor; - }, - - execCommand : function(c, u, v) { - var t = this, ed = t.get(v), w; - - // Manager commands - switch (c) { - case "mceFocus": - ed.focus(); - return true; - - case "mceAddEditor": - case "mceAddControl": - if (!t.get(v)) - new tinymce.Editor(v, t.settings).render(); - - return true; - - case "mceAddFrameControl": - w = v.window; - - // Add tinyMCE global instance and tinymce namespace to specified window - w.tinyMCE = tinyMCE; - w.tinymce = tinymce; - - tinymce.DOM.doc = w.document; - tinymce.DOM.win = w; - - ed = new tinymce.Editor(v.element_id, v); - ed.render(); - - // Fix IE memory leaks - if (tinymce.isIE) { - function clr() { - ed.destroy(); - w.detachEvent('onunload', clr); - w = w.tinyMCE = w.tinymce = null; // IE leak - }; - - w.attachEvent('onunload', clr); - } - - v.page_window = null; - - return true; - - case "mceRemoveEditor": - case "mceRemoveControl": - if (ed) - ed.remove(); - - return true; - - case 'mceToggleEditor': - if (!ed) { - t.execCommand('mceAddControl', 0, v); - return true; - } - - if (ed.isHidden()) - ed.show(); - else - ed.hide(); - - return true; - } - - // Run command on active editor - if (t.activeEditor) - return t.activeEditor.execCommand(c, u, v); - - return false; - }, - - execInstanceCommand : function(id, c, u, v) { - var ed = this.get(id); - - if (ed) - return ed.execCommand(c, u, v); - - return false; - }, - - triggerSave : function() { - each(this.editors, function(e) { - e.save(); - }); - }, - - addI18n : function(p, o) { - var lo, i18n = this.i18n; - - if (!tinymce.is(p, 'string')) { - each(p, function(o, lc) { - each(o, function(o, g) { - each(o, function(o, k) { - if (g === 'common') - i18n[lc + '.' + k] = o; - else - i18n[lc + '.' + g + '.' + k] = o; - }); - }); - }); - } else { - each(o, function(o, k) { - i18n[p + '.' + k] = o; - }); - } - }, - - // Private methods - - _setActive : function(editor) { - this.selectedInstance = this.activeEditor = editor; - } - }); -})(tinymce); - -(function(tinymce) { - // Shorten these names - var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, - Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isGecko = tinymce.isGecko, - isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, is = tinymce.is, - ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, - inArray = tinymce.inArray, grep = tinymce.grep, explode = tinymce.explode; - - tinymce.create('tinymce.Editor', { - Editor : function(id, s) { - var t = this; - - t.id = t.editorId = id; - - t.execCommands = {}; - t.queryStateCommands = {}; - t.queryValueCommands = {}; - - t.isNotDirty = false; - - t.plugins = {}; - - // Add events to the editor - each([ - 'onPreInit', - - 'onBeforeRenderUI', - - 'onPostRender', - - 'onInit', - - 'onRemove', - - 'onActivate', - - 'onDeactivate', - - 'onClick', - - 'onEvent', - - 'onMouseUp', - - 'onMouseDown', - - 'onDblClick', - - 'onKeyDown', - - 'onKeyUp', - - 'onKeyPress', - - 'onContextMenu', - - 'onSubmit', - - 'onReset', - - 'onPaste', - - 'onPreProcess', - - 'onPostProcess', - - 'onBeforeSetContent', - - 'onBeforeGetContent', - - 'onSetContent', - - 'onGetContent', - - 'onLoadContent', - - 'onSaveContent', - - 'onNodeChange', - - 'onChange', - - 'onBeforeExecCommand', - - 'onExecCommand', - - 'onUndo', - - 'onRedo', - - 'onVisualAid', - - 'onSetProgressState' - ], function(e) { - t[e] = new Dispatcher(t); - }); - - t.settings = s = extend({ - id : id, - language : 'en', - docs_language : 'en', - theme : 'simple', - skin : 'default', - delta_width : 0, - delta_height : 0, - popup_css : '', - plugins : '', - document_base_url : tinymce.documentBaseURL, - add_form_submit_trigger : 1, - submit_patch : 1, - add_unload_trigger : 1, - convert_urls : 1, - relative_urls : 1, - remove_script_host : 1, - table_inline_editing : 0, - object_resizing : 1, - cleanup : 1, - accessibility_focus : 1, - custom_shortcuts : 1, - custom_undo_redo_keyboard_shortcuts : 1, - custom_undo_redo_restore_selection : 1, - custom_undo_redo : 1, - doctype : tinymce.isIE6 ? '' : '', // Use old doctype on IE 6 to avoid horizontal scroll - visual_table_class : 'mceItemTable', - visual : 1, - font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large', - font_size_legacy_values : 'xx-small,small,medium,large,x-large,xx-large,300%', // See: http://www.w3.org/TR/CSS2/fonts.html#propdef-font-size - apply_source_formatting : 1, - directionality : 'ltr', - forced_root_block : 'p', - hidden_input : 1, - padd_empty_editor : 1, - render_ui : 1, - init_theme : 1, - force_p_newlines : 1, - indentation : '30px', - keep_styles : 1, - fix_table_elements : 1, - inline_styles : 1, - convert_fonts_to_spans : true, - indent : 'simple', - indent_before : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr', - indent_after : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr', - validate : true, - entity_encoding : 'named', - url_converter : t.convertURL, - url_converter_scope : t, - ie7_compat : true - }, s); - - t.documentBaseURI = new tinymce.util.URI(s.document_base_url || tinymce.documentBaseURL, { - base_uri : tinyMCE.baseURI - }); - - t.baseURI = tinymce.baseURI; - - t.contentCSS = []; - - // Call setup - t.execCallback('setup', t); - }, - - render : function(nst) { - var t = this, s = t.settings, id = t.id, sl = tinymce.ScriptLoader; - - // Page is not loaded yet, wait for it - if (!Event.domLoaded) { - Event.add(document, 'init', function() { - t.render(); - }); - return; - } - - tinyMCE.settings = s; - - // Element not found, then skip initialization - if (!t.getElement()) - return; - - // Is a iPad/iPhone and not on iOS5, then skip initialization. We need to sniff - // here since the browser says it has contentEditable support but there is no visible - // caret We will remove this check ones Apple implements full contentEditable support - if (tinymce.isIDevice && !tinymce.isIOS5) - return; - - // Add hidden input for non input elements inside form elements - if (!/TEXTAREA|INPUT/i.test(t.getElement().nodeName) && s.hidden_input && DOM.getParent(id, 'form')) - DOM.insertAfter(DOM.create('input', {type : 'hidden', name : id}), id); - - if (tinymce.WindowManager) - t.windowManager = new tinymce.WindowManager(t); - - if (s.encoding == 'xml') { - t.onGetContent.add(function(ed, o) { - if (o.save) - o.content = DOM.encode(o.content); - }); - } - - if (s.add_form_submit_trigger) { - t.onSubmit.addToTop(function() { - if (t.initialized) { - t.save(); - t.isNotDirty = 1; - } - }); - } - - if (s.add_unload_trigger) { - t._beforeUnload = tinyMCE.onBeforeUnload.add(function() { - if (t.initialized && !t.destroyed && !t.isHidden()) - t.save({format : 'raw', no_events : true}); - }); - } - - tinymce.addUnload(t.destroy, t); - - if (s.submit_patch) { - t.onBeforeRenderUI.add(function() { - var n = t.getElement().form; - - if (!n) - return; - - // Already patched - if (n._mceOldSubmit) - return; - - // Check page uses id="submit" or name="submit" for it's submit button - if (!n.submit.nodeType && !n.submit.length) { - t.formElement = n; - n._mceOldSubmit = n.submit; - n.submit = function() { - // Save all instances - tinymce.triggerSave(); - t.isNotDirty = 1; - - return t.formElement._mceOldSubmit(t.formElement); - }; - } - - n = null; - }); - } - - // Load scripts - function loadScripts() { - if (s.language && s.language_load !== false) - sl.add(tinymce.baseURL + '/langs/' + s.language + '.js'); - - if (s.theme && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme]) - ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js'); - - each(explode(s.plugins), function(p) { - if (p &&!PluginManager.urls[p]) { - if (p.charAt(0) == '-') { - p = p.substr(1, p.length); - var dependencies = PluginManager.dependencies(p); - each(dependencies, function(dep) { - var defaultSettings = {prefix:'plugins/', resource: dep, suffix:'/editor_plugin' + tinymce.suffix + '.js'}; - var dep = PluginManager.createUrl(defaultSettings, dep); - PluginManager.load(dep.resource, dep); - - }); - } else { - // Skip safari plugin, since it is removed as of 3.3b1 - if (p == 'safari') { - return; - } - PluginManager.load(p, {prefix:'plugins/', resource: p, suffix:'/editor_plugin' + tinymce.suffix + '.js'}); - } - } - }); - - // Init when que is loaded - sl.loadQueue(function() { - if (!t.removed) - t.init(); - }); - }; - - loadScripts(); - }, - - init : function() { - var n, t = this, s = t.settings, w, h, e = t.getElement(), o, ti, u, bi, bc, re, i, initializedPlugins = []; - - tinymce.add(t); - - s.aria_label = s.aria_label || DOM.getAttrib(e, 'aria-label', t.getLang('aria.rich_text_area')); - - if (s.theme) { - s.theme = s.theme.replace(/-/, ''); - o = ThemeManager.get(s.theme); - t.theme = new o(); - - if (t.theme.init && s.init_theme) - t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, '')); - } - function initPlugin(p) { - var c = PluginManager.get(p), u = PluginManager.urls[p] || tinymce.documentBaseURL.replace(/\/$/, ''), po; - if (c && tinymce.inArray(initializedPlugins,p) === -1) { - each(PluginManager.dependencies(p), function(dep){ - initPlugin(dep); - }); - po = new c(t, u); - - t.plugins[p] = po; - - if (po.init) { - po.init(t, u); - initializedPlugins.push(p); - } - } - } - - // Create all plugins - each(explode(s.plugins.replace(/\-/g, '')), initPlugin); - - // Setup popup CSS path(s) - if (s.popup_css !== false) { - if (s.popup_css) - s.popup_css = t.documentBaseURI.toAbsolute(s.popup_css); - else - s.popup_css = t.baseURI.toAbsolute("themes/" + s.theme + "/skins/" + s.skin + "/dialog.css"); - } - - if (s.popup_css_add) - s.popup_css += ',' + t.documentBaseURI.toAbsolute(s.popup_css_add); - - t.controlManager = new tinymce.ControlManager(t); - - if (s.custom_undo_redo) { - t.onBeforeExecCommand.add(function(ed, cmd, ui, val, a) { - if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo)) - t.undoManager.beforeChange(); - }); - - t.onExecCommand.add(function(ed, cmd, ui, val, a) { - if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo)) - t.undoManager.add(); - }); - } - - t.onExecCommand.add(function(ed, c) { - // Don't refresh the select lists until caret move - if (!/^(FontName|FontSize)$/.test(c)) - t.nodeChanged(); - }); - - // Remove ghost selections on images and tables in Gecko - if (isGecko) { - function repaint(a, o) { - if (!o || !o.initial) - t.execCommand('mceRepaint'); - }; - - t.onUndo.add(repaint); - t.onRedo.add(repaint); - t.onSetContent.add(repaint); - } - - // Enables users to override the control factory - t.onBeforeRenderUI.dispatch(t, t.controlManager); - - // Measure box - if (s.render_ui) { - w = s.width || e.style.width || e.offsetWidth; - h = s.height || e.style.height || e.offsetHeight; - t.orgDisplay = e.style.display; - re = /^[0-9\.]+(|px)$/i; - - if (re.test('' + w)) - w = Math.max(parseInt(w) + (o.deltaWidth || 0), 100); - - if (re.test('' + h)) - h = Math.max(parseInt(h) + (o.deltaHeight || 0), 100); - - // Render UI - o = t.theme.renderUI({ - targetNode : e, - width : w, - height : h, - deltaWidth : s.delta_width, - deltaHeight : s.delta_height - }); - - t.editorContainer = o.editorContainer; - } - - - // User specified a document.domain value - if (document.domain && location.hostname != document.domain) - tinymce.relaxedDomain = document.domain; - - // Resize editor - DOM.setStyles(o.sizeContainer || o.editorContainer, { - width : w, - height : h - }); - - // Load specified content CSS last - if (s.content_css) { - tinymce.each(explode(s.content_css), function(u) { - t.contentCSS.push(t.documentBaseURI.toAbsolute(u)); - }); - } - - h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : ''); - if (h < 100) - h = 100; - - t.iframeHTML = s.doctype + ''; - - // We only need to override paths if we have to - // IE has a bug where it remove site absolute urls to relative ones if this is specified - if (s.document_base_url != tinymce.documentBaseURL) - t.iframeHTML += ''; - - // IE8 doesn't support carets behind images setting ie7_compat would force IE8+ to run in IE7 compat mode. - if (s.ie7_compat) - t.iframeHTML += ''; - else - t.iframeHTML += ''; - - t.iframeHTML += ''; - - // Load the CSS by injecting them into the HTML this will reduce "flicker" - for (i = 0; i < t.contentCSS.length; i++) { - t.iframeHTML += ''; - } - - bi = s.body_id || 'tinymce'; - if (bi.indexOf('=') != -1) { - bi = t.getParam('body_id', '', 'hash'); - bi = bi[t.id] || bi; - } - - bc = s.body_class || ''; - if (bc.indexOf('=') != -1) { - bc = t.getParam('body_class', '', 'hash'); - bc = bc[t.id] || ''; - } - - t.iframeHTML += '
    '; - - // Domain relaxing enabled, then set document domain - if (tinymce.relaxedDomain && (isIE || (tinymce.isOpera && parseFloat(opera.version()) < 11))) { - // We need to write the contents here in IE since multiple writes messes up refresh button and back button - u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'; - } - - // Create iframe - // TODO: ACC add the appropriate description on this. - n = DOM.add(o.iframeContainer, 'iframe', { - id : t.id + "_ifr", - src : u || 'javascript:""', // Workaround for HTTPS warning in IE6/7 - frameBorder : '0', - allowTransparency : "true", - title : s.aria_label, - style : { - width : '100%', - height : h, - display : 'block' // Important for Gecko to render the iframe correctly - } - }); - - t.contentAreaContainer = o.iframeContainer; - DOM.get(o.editorContainer).style.display = t.orgDisplay; - DOM.get(t.id).style.display = 'none'; - DOM.setAttrib(t.id, 'aria-hidden', true); - - if (!tinymce.relaxedDomain || !u) - t.setupIframe(); - - e = n = o = null; // Cleanup - }, - - setupIframe : function() { - var t = this, s = t.settings, e = DOM.get(t.id), d = t.getDoc(), h, b; - - // Setup iframe body - if (!isIE || !tinymce.relaxedDomain) { - d.open(); - d.write(t.iframeHTML); - d.close(); - - if (tinymce.relaxedDomain) - d.domain = tinymce.relaxedDomain; - } - - // It will not steal focus while setting contentEditable - b = t.getBody(); - b.disabled = true; - - if (!s.readonly) - b.contentEditable = true; - - b.disabled = false; - - t.schema = new tinymce.html.Schema(s); - - t.dom = new tinymce.dom.DOMUtils(t.getDoc(), { - keep_values : true, - url_converter : t.convertURL, - url_converter_scope : t, - hex_colors : s.force_hex_style_colors, - class_filter : s.class_filter, - update_styles : 1, - fix_ie_paragraphs : 1, - schema : t.schema - }); - - t.parser = new tinymce.html.DomParser(s, t.schema); - - // Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included. - if (!t.settings.allow_html_in_named_anchor) { - t.parser.addAttributeFilter('name', function(nodes, name) { - var i = nodes.length, sibling, prevSibling, parent, node; - - while (i--) { - node = nodes[i]; - if (node.name === 'a' && node.firstChild) { - parent = node.parent; - - // Move children after current node - sibling = node.lastChild; - do { - prevSibling = sibling.prev; - parent.insert(sibling, node); - sibling = prevSibling; - } while (sibling); - } - } - }); - } - - // Convert src and href into data-mce-src, data-mce-href and data-mce-style - t.parser.addAttributeFilter('src,href,style', function(nodes, name) { - var i = nodes.length, node, dom = t.dom, value, internalName; - - while (i--) { - node = nodes[i]; - value = node.attr(name); - internalName = 'data-mce-' + name; - - // Add internal attribute if we need to we don't on a refresh of the document - if (!node.attributes.map[internalName]) { - if (name === "style") - node.attr(internalName, dom.serializeStyle(dom.parseStyle(value), node.name)); - else - node.attr(internalName, t.convertURL(value, name, node.name)); - } - } - }); - - // Keep scripts from executing - t.parser.addNodeFilter('script', function(nodes, name) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - node.attr('type', 'mce-' + (node.attr('type') || 'text/javascript')); - } - }); - - t.parser.addNodeFilter('#cdata', function(nodes, name) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - node.type = 8; - node.name = '#comment'; - node.value = '[CDATA[' + node.value + ']]'; - } - }); - - t.parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function(nodes, name) { - var i = nodes.length, node, nonEmptyElements = t.schema.getNonEmptyElements(); - - while (i--) { - node = nodes[i]; - - if (node.isEmpty(nonEmptyElements)) - node.empty().append(new tinymce.html.Node('br', 1)).shortEnded = true; - } - }); - - t.serializer = new tinymce.dom.Serializer(s, t.dom, t.schema); - - t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer); - - t.formatter = new tinymce.Formatter(this); - - // Register default formats - t.formatter.register({ - alignleft : [ - {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}}, - {selector : 'img,table', collapsed : false, styles : {'float' : 'left'}} - ], - - aligncenter : [ - {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}}, - {selector : 'img', collapsed : false, styles : {display : 'block', marginLeft : 'auto', marginRight : 'auto'}}, - {selector : 'table', collapsed : false, styles : {marginLeft : 'auto', marginRight : 'auto'}} - ], - - alignright : [ - {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}}, - {selector : 'img,table', collapsed : false, styles : {'float' : 'right'}} - ], - - alignfull : [ - {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'justify'}} - ], - - bold : [ - {inline : 'strong', remove : 'all'}, - {inline : 'span', styles : {fontWeight : 'bold'}}, - {inline : 'b', remove : 'all'} - ], - - italic : [ - {inline : 'em', remove : 'all'}, - {inline : 'span', styles : {fontStyle : 'italic'}}, - {inline : 'i', remove : 'all'} - ], - - underline : [ - {inline : 'span', styles : {textDecoration : 'underline'}, exact : true}, - {inline : 'u', remove : 'all'} - ], - - strikethrough : [ - {inline : 'span', styles : {textDecoration : 'line-through'}, exact : true}, - {inline : 'strike', remove : 'all'} - ], - - forecolor : {inline : 'span', styles : {color : '%value'}, wrap_links : false}, - hilitecolor : {inline : 'span', styles : {backgroundColor : '%value'}, wrap_links : false}, - fontname : {inline : 'span', styles : {fontFamily : '%value'}}, - fontsize : {inline : 'span', styles : {fontSize : '%value'}}, - fontsize_class : {inline : 'span', attributes : {'class' : '%value'}}, - blockquote : {block : 'blockquote', wrapper : 1, remove : 'all'}, - subscript : {inline : 'sub'}, - superscript : {inline : 'sup'}, - - link : {inline : 'a', selector : 'a', remove : 'all', split : true, deep : true, - onmatch : function(node) { - return true; - }, - - onformat : function(elm, fmt, vars) { - each(vars, function(value, key) { - t.dom.setAttrib(elm, key, value); - }); - } - }, - - removeformat : [ - {selector : 'b,strong,em,i,font,u,strike', remove : 'all', split : true, expand : false, block_expand : true, deep : true}, - {selector : 'span', attributes : ['style', 'class'], remove : 'empty', split : true, expand : false, deep : true}, - {selector : '*', attributes : ['style', 'class'], split : false, expand : false, deep : true} - ] - }); - - // Register default block formats - each('p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp'.split(/\s/), function(name) { - t.formatter.register(name, {block : name, remove : 'all'}); - }); - - // Register user defined formats - t.formatter.register(t.settings.formats); - - t.undoManager = new tinymce.UndoManager(t); - - // Pass through - t.undoManager.onAdd.add(function(um, l) { - if (um.hasUndo()) - return t.onChange.dispatch(t, l, um); - }); - - t.undoManager.onUndo.add(function(um, l) { - return t.onUndo.dispatch(t, l, um); - }); - - t.undoManager.onRedo.add(function(um, l) { - return t.onRedo.dispatch(t, l, um); - }); - - t.forceBlocks = new tinymce.ForceBlocks(t, { - forced_root_block : s.forced_root_block - }); - - t.editorCommands = new tinymce.EditorCommands(t); - - // Pass through - t.serializer.onPreProcess.add(function(se, o) { - return t.onPreProcess.dispatch(t, o, se); - }); - - t.serializer.onPostProcess.add(function(se, o) { - return t.onPostProcess.dispatch(t, o, se); - }); - - t.onPreInit.dispatch(t); - - if (!s.gecko_spellcheck) - t.getBody().spellcheck = 0; - - if (!s.readonly) - t._addEvents(); - - t.controlManager.onPostRender.dispatch(t, t.controlManager); - t.onPostRender.dispatch(t); - - t.quirks = new tinymce.util.Quirks(this); - - if (s.directionality) - t.getBody().dir = s.directionality; - - if (s.nowrap) - t.getBody().style.whiteSpace = "nowrap"; - - if (s.handle_node_change_callback) { - t.onNodeChange.add(function(ed, cm, n) { - t.execCallback('handle_node_change_callback', t.id, n, -1, -1, true, t.selection.isCollapsed()); - }); - } - - if (s.save_callback) { - t.onSaveContent.add(function(ed, o) { - var h = t.execCallback('save_callback', t.id, o.content, t.getBody()); - - if (h) - o.content = h; - }); - } - - if (s.onchange_callback) { - t.onChange.add(function(ed, l) { - t.execCallback('onchange_callback', t, l); - }); - } - - if (s.protect) { - t.onBeforeSetContent.add(function(ed, o) { - if (s.protect) { - each(s.protect, function(pattern) { - o.content = o.content.replace(pattern, function(str) { - return ''; - }); - }); - } - }); - } - - if (s.convert_newlines_to_brs) { - t.onBeforeSetContent.add(function(ed, o) { - if (o.initial) - o.content = o.content.replace(/\r?\n/g, '
    '); - }); - } - - if (s.preformatted) { - t.onPostProcess.add(function(ed, o) { - o.content = o.content.replace(/^\s*/, ''); - o.content = o.content.replace(/<\/pre>\s*$/, ''); - - if (o.set) - o.content = '
    ' + o.content + '
    '; - }); - } - - if (s.verify_css_classes) { - t.serializer.attribValueFilter = function(n, v) { - var s, cl; - - if (n == 'class') { - // Build regexp for classes - if (!t.classesRE) { - cl = t.dom.getClasses(); - - if (cl.length > 0) { - s = ''; - - each (cl, function(o) { - s += (s ? '|' : '') + o['class']; - }); - - t.classesRE = new RegExp('(' + s + ')', 'gi'); - } - } - - return !t.classesRE || /(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v) || t.classesRE.test(v) ? v : ''; - } - - return v; - }; - } - - if (s.cleanup_callback) { - t.onBeforeSetContent.add(function(ed, o) { - o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o); - }); - - t.onPreProcess.add(function(ed, o) { - if (o.set) - t.execCallback('cleanup_callback', 'insert_to_editor_dom', o.node, o); - - if (o.get) - t.execCallback('cleanup_callback', 'get_from_editor_dom', o.node, o); - }); - - t.onPostProcess.add(function(ed, o) { - if (o.set) - o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o); - - if (o.get) - o.content = t.execCallback('cleanup_callback', 'get_from_editor', o.content, o); - }); - } - - if (s.save_callback) { - t.onGetContent.add(function(ed, o) { - if (o.save) - o.content = t.execCallback('save_callback', t.id, o.content, t.getBody()); - }); - } - - if (s.handle_event_callback) { - t.onEvent.add(function(ed, e, o) { - if (t.execCallback('handle_event_callback', e, ed, o) === false) - Event.cancel(e); - }); - } - - // Add visual aids when new contents is added - t.onSetContent.add(function() { - t.addVisual(t.getBody()); - }); - - // Remove empty contents - if (s.padd_empty_editor) { - t.onPostProcess.add(function(ed, o) { - o.content = o.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
    [\r\n]*)$/, ''); - }); - } - - if (isGecko) { - // Fix gecko link bug, when a link is placed at the end of block elements there is - // no way to move the caret behind the link. This fix adds a bogus br element after the link - function fixLinks(ed, o) { - each(ed.dom.select('a'), function(n) { - var pn = n.parentNode; - - if (ed.dom.isBlock(pn) && pn.lastChild === n) - ed.dom.add(pn, 'br', {'data-mce-bogus' : 1}); - }); - }; - - t.onExecCommand.add(function(ed, cmd) { - if (cmd === 'CreateLink') - fixLinks(ed); - }); - - t.onSetContent.add(t.selection.onSetContent.add(fixLinks)); - } - - t.load({initial : true, format : 'html'}); - t.startContent = t.getContent({format : 'raw'}); - t.undoManager.add(); - t.initialized = true; - - t.onInit.dispatch(t); - t.execCallback('setupcontent_callback', t.id, t.getBody(), t.getDoc()); - t.execCallback('init_instance_callback', t); - t.focus(true); - t.nodeChanged({initial : 1}); - - // Load specified content CSS last - each(t.contentCSS, function(u) { - t.dom.loadCSS(u); - }); - - // Handle auto focus - if (s.auto_focus) { - setTimeout(function () { - var ed = tinymce.get(s.auto_focus); - - ed.selection.select(ed.getBody(), 1); - ed.selection.collapse(1); - ed.getBody().focus(); - ed.getWin().focus(); - }, 100); - } - - e = null; - }, - - - focus : function(sf) { - var oed, t = this, selection = t.selection, ce = t.settings.content_editable, ieRng, controlElm, doc = t.getDoc(); - - if (!sf) { - // Get selected control element - ieRng = selection.getRng(); - if (ieRng.item) { - controlElm = ieRng.item(0); - } - - t._refreshContentEditable(); - selection.normalize(); - - // Is not content editable - if (!ce) - t.getWin().focus(); - - // Focus the body as well since it's contentEditable - if (tinymce.isGecko) { - t.getBody().focus(); - } - - // Restore selected control element - // This is needed when for example an image is selected within a - // layer a call to focus will then remove the control selection - if (controlElm && controlElm.ownerDocument == doc) { - ieRng = doc.body.createControlRange(); - ieRng.addElement(controlElm); - ieRng.select(); - } - - } - - if (tinymce.activeEditor != t) { - if ((oed = tinymce.activeEditor) != null) - oed.onDeactivate.dispatch(oed, t); - - t.onActivate.dispatch(t, oed); - } - - tinymce._setActive(t); - }, - - execCallback : function(n) { - var t = this, f = t.settings[n], s; - - if (!f) - return; - - // Look through lookup - if (t.callbackLookup && (s = t.callbackLookup[n])) { - f = s.func; - s = s.scope; - } - - if (is(f, 'string')) { - s = f.replace(/\.\w+$/, ''); - s = s ? tinymce.resolve(s) : 0; - f = tinymce.resolve(f); - t.callbackLookup = t.callbackLookup || {}; - t.callbackLookup[n] = {func : f, scope : s}; - } - - return f.apply(s || t, Array.prototype.slice.call(arguments, 1)); - }, - - translate : function(s) { - var c = this.settings.language || 'en', i18n = tinymce.i18n; - - if (!s) - return ''; - - return i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) { - return i18n[c + '.' + b] || '{#' + b + '}'; - }); - }, - - getLang : function(n, dv) { - return tinymce.i18n[(this.settings.language || 'en') + '.' + n] || (is(dv) ? dv : '{#' + n + '}'); - }, - - getParam : function(n, dv, ty) { - var tr = tinymce.trim, v = is(this.settings[n]) ? this.settings[n] : dv, o; - - if (ty === 'hash') { - o = {}; - - if (is(v, 'string')) { - each(v.indexOf('=') > 0 ? v.split(/[;,](?![^=;,]*(?:[;,]|$))/) : v.split(','), function(v) { - v = v.split('='); - - if (v.length > 1) - o[tr(v[0])] = tr(v[1]); - else - o[tr(v[0])] = tr(v); - }); - } else - o = v; - - return o; - } - - return v; - }, - - nodeChanged : function(o) { - var t = this, s = t.selection, n = s.getStart() || t.getBody(); - - // Fix for bug #1896577 it seems that this can not be fired while the editor is loading - if (t.initialized) { - o = o || {}; - n = isIE && n.ownerDocument != t.getDoc() ? t.getBody() : n; // Fix for IE initial state - - // Get parents and add them to object - o.parents = []; - t.dom.getParent(n, function(node) { - if (node.nodeName == 'BODY') - return true; - - o.parents.push(node); - }); - - t.onNodeChange.dispatch( - t, - o ? o.controlManager || t.controlManager : t.controlManager, - n, - s.isCollapsed(), - o - ); - } - }, - - addButton : function(n, s) { - var t = this; - - t.buttons = t.buttons || {}; - t.buttons[n] = s; - }, - - addCommand : function(name, callback, scope) { - this.execCommands[name] = {func : callback, scope : scope || this}; - }, - - addQueryStateHandler : function(name, callback, scope) { - this.queryStateCommands[name] = {func : callback, scope : scope || this}; - }, - - addQueryValueHandler : function(name, callback, scope) { - this.queryValueCommands[name] = {func : callback, scope : scope || this}; - }, - - addShortcut : function(pa, desc, cmd_func, sc) { - var t = this, c; - - if (!t.settings.custom_shortcuts) - return false; - - t.shortcuts = t.shortcuts || {}; - - if (is(cmd_func, 'string')) { - c = cmd_func; - - cmd_func = function() { - t.execCommand(c, false, null); - }; - } - - if (is(cmd_func, 'object')) { - c = cmd_func; - - cmd_func = function() { - t.execCommand(c[0], c[1], c[2]); - }; - } - - each(explode(pa), function(pa) { - var o = { - func : cmd_func, - scope : sc || this, - desc : desc, - alt : false, - ctrl : false, - shift : false - }; - - each(explode(pa, '+'), function(v) { - switch (v) { - case 'alt': - case 'ctrl': - case 'shift': - o[v] = true; - break; - - default: - o.charCode = v.charCodeAt(0); - o.keyCode = v.toUpperCase().charCodeAt(0); - } - }); - - t.shortcuts[(o.ctrl ? 'ctrl' : '') + ',' + (o.alt ? 'alt' : '') + ',' + (o.shift ? 'shift' : '') + ',' + o.keyCode] = o; - }); - - return true; - }, - - execCommand : function(cmd, ui, val, a) { - var t = this, s = 0, o, st; - - if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd) && (!a || !a.skip_focus)) - t.focus(); - - o = {}; - t.onBeforeExecCommand.dispatch(t, cmd, ui, val, o); - if (o.terminate) - return false; - - // Command callback - if (t.execCallback('execcommand_callback', t.id, t.selection.getNode(), cmd, ui, val)) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - return true; - } - - // Registred commands - if (o = t.execCommands[cmd]) { - st = o.func.call(o.scope, ui, val); - - // Fall through on true - if (st !== true) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - return st; - } - } - - // Plugin commands - each(t.plugins, function(p) { - if (p.execCommand && p.execCommand(cmd, ui, val)) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - s = 1; - return false; - } - }); - - if (s) - return true; - - // Theme commands - if (t.theme && t.theme.execCommand && t.theme.execCommand(cmd, ui, val)) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - return true; - } - - // Editor commands - if (t.editorCommands.execCommand(cmd, ui, val)) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - return true; - } - - // Browser commands - t.getDoc().execCommand(cmd, ui, val); - t.onExecCommand.dispatch(t, cmd, ui, val, a); - }, - - queryCommandState : function(cmd) { - var t = this, o, s; - - // Is hidden then return undefined - if (t._isHidden()) - return; - - // Registred commands - if (o = t.queryStateCommands[cmd]) { - s = o.func.call(o.scope); - - // Fall though on true - if (s !== true) - return s; - } - - // Registred commands - o = t.editorCommands.queryCommandState(cmd); - if (o !== -1) - return o; - - // Browser commands - try { - return this.getDoc().queryCommandState(cmd); - } catch (ex) { - // Fails sometimes see bug: 1896577 - } - }, - - queryCommandValue : function(c) { - var t = this, o, s; - - // Is hidden then return undefined - if (t._isHidden()) - return; - - // Registred commands - if (o = t.queryValueCommands[c]) { - s = o.func.call(o.scope); - - // Fall though on true - if (s !== true) - return s; - } - - // Registred commands - o = t.editorCommands.queryCommandValue(c); - if (is(o)) - return o; - - // Browser commands - try { - return this.getDoc().queryCommandValue(c); - } catch (ex) { - // Fails sometimes see bug: 1896577 - } - }, - - show : function() { - var t = this; - - DOM.show(t.getContainer()); - DOM.hide(t.id); - t.load(); - }, - - hide : function() { - var t = this, d = t.getDoc(); - - // Fixed bug where IE has a blinking cursor left from the editor - if (isIE && d) - d.execCommand('SelectAll'); - - // We must save before we hide so Safari doesn't crash - t.save(); - DOM.hide(t.getContainer()); - DOM.setStyle(t.id, 'display', t.orgDisplay); - }, - - isHidden : function() { - return !DOM.isHidden(this.id); - }, - - setProgressState : function(b, ti, o) { - this.onSetProgressState.dispatch(this, b, ti, o); - - return b; - }, - - load : function(o) { - var t = this, e = t.getElement(), h; - - if (e) { - o = o || {}; - o.load = true; - - // Double encode existing entities in the value - h = t.setContent(is(e.value) ? e.value : e.innerHTML, o); - o.element = e; - - if (!o.no_events) - t.onLoadContent.dispatch(t, o); - - o.element = e = null; - - return h; - } - }, - - save : function(o) { - var t = this, e = t.getElement(), h, f; - - if (!e || !t.initialized) - return; - - o = o || {}; - o.save = true; - - // Add undo level will trigger onchange event - if (!o.no_events) { - t.undoManager.typing = false; - t.undoManager.add(); - } - - o.element = e; - h = o.content = t.getContent(o); - - if (!o.no_events) - t.onSaveContent.dispatch(t, o); - - h = o.content; - - if (!/TEXTAREA|INPUT/i.test(e.nodeName)) { - e.innerHTML = h; - - // Update hidden form element - if (f = DOM.getParent(t.id, 'form')) { - each(f.elements, function(e) { - if (e.name == t.id) { - e.value = h; - return false; - } - }); - } - } else - e.value = h; - - o.element = e = null; - - return h; - }, - - setContent : function(content, args) { - var self = this, rootNode, body = self.getBody(), forcedRootBlockName; - - // Setup args object - args = args || {}; - args.format = args.format || 'html'; - args.set = true; - args.content = content; - - // Do preprocessing - if (!args.no_events) - self.onBeforeSetContent.dispatch(self, args); - - content = args.content; - - // Padd empty content in Gecko and Safari. Commands will otherwise fail on the content - // It will also be impossible to place the caret in the editor unless there is a BR element present - if (!tinymce.isIE && (content.length === 0 || /^\s+$/.test(content))) { - forcedRootBlockName = self.settings.forced_root_block; - if (forcedRootBlockName) - content = '<' + forcedRootBlockName + '>
    '; - else - content = '
    '; - - body.innerHTML = content; - self.selection.select(body, true); - self.selection.collapse(true); - return; - } - - // Parse and serialize the html - if (args.format !== 'raw') { - content = new tinymce.html.Serializer({}, self.schema).serialize( - self.parser.parse(content) - ); - } - - // Set the new cleaned contents to the editor - args.content = tinymce.trim(content); - self.dom.setHTML(body, args.content); - - // Do post processing - if (!args.no_events) - self.onSetContent.dispatch(self, args); - - self.selection.normalize(); - - return args.content; - }, - - getContent : function(args) { - var self = this, content; - - // Setup args object - args = args || {}; - args.format = args.format || 'html'; - args.get = true; - - // Do preprocessing - if (!args.no_events) - self.onBeforeGetContent.dispatch(self, args); - - // Get raw contents or by default the cleaned contents - if (args.format == 'raw') - content = self.getBody().innerHTML; - else - content = self.serializer.serialize(self.getBody(), args); - - args.content = tinymce.trim(content); - - // Do post processing - if (!args.no_events) - self.onGetContent.dispatch(self, args); - - return args.content; - }, - - isDirty : function() { - var self = this; - - return tinymce.trim(self.startContent) != tinymce.trim(self.getContent({format : 'raw', no_events : 1})) && !self.isNotDirty; - }, - - getContainer : function() { - var t = this; - - if (!t.container) - t.container = DOM.get(t.editorContainer || t.id + '_parent'); - - return t.container; - }, - - getContentAreaContainer : function() { - return this.contentAreaContainer; - }, - - getElement : function() { - return DOM.get(this.settings.content_element || this.id); - }, - - getWin : function() { - var t = this, e; - - if (!t.contentWindow) { - e = DOM.get(t.id + "_ifr"); - - if (e) - t.contentWindow = e.contentWindow; - } - - return t.contentWindow; - }, - - getDoc : function() { - var t = this, w; - - if (!t.contentDocument) { - w = t.getWin(); - - if (w) - t.contentDocument = w.document; - } - - return t.contentDocument; - }, - - getBody : function() { - return this.bodyElement || this.getDoc().body; - }, - - convertURL : function(u, n, e) { - var t = this, s = t.settings; - - // Use callback instead - if (s.urlconverter_callback) - return t.execCallback('urlconverter_callback', u, e, true, n); - - // Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs - if (!s.convert_urls || (e && e.nodeName == 'LINK') || u.indexOf('file:') === 0) - return u; - - // Convert to relative - if (s.relative_urls) - return t.documentBaseURI.toRelative(u); - - // Convert to absolute - u = t.documentBaseURI.toAbsolute(u, s.remove_script_host); - - return u; - }, - - addVisual : function(e) { - var t = this, s = t.settings; - - e = e || t.getBody(); - - if (!is(t.hasVisual)) - t.hasVisual = s.visual; - - each(t.dom.select('table,a', e), function(e) { - var v; - - switch (e.nodeName) { - case 'TABLE': - v = t.dom.getAttrib(e, 'border'); - - if (!v || v == '0') { - if (t.hasVisual) - t.dom.addClass(e, s.visual_table_class); - else - t.dom.removeClass(e, s.visual_table_class); - } - - return; - - case 'A': - v = t.dom.getAttrib(e, 'name'); - - if (v) { - if (t.hasVisual) - t.dom.addClass(e, 'mceItemAnchor'); - else - t.dom.removeClass(e, 'mceItemAnchor'); - } - - return; - } - }); - - t.onVisualAid.dispatch(t, e, t.hasVisual); - }, - - remove : function() { - var t = this, e = t.getContainer(); - - t.removed = 1; // Cancels post remove event execution - t.hide(); - - t.execCallback('remove_instance_callback', t); - t.onRemove.dispatch(t); - - // Clear all execCommand listeners this is required to avoid errors if the editor was removed inside another command - t.onExecCommand.listeners = []; - - tinymce.remove(t); - DOM.remove(e); - }, - - destroy : function(s) { - var t = this; - - // One time is enough - if (t.destroyed) - return; - - if (!s) { - tinymce.removeUnload(t.destroy); - tinyMCE.onBeforeUnload.remove(t._beforeUnload); - - // Manual destroy - if (t.theme && t.theme.destroy) - t.theme.destroy(); - - // Destroy controls, selection and dom - t.controlManager.destroy(); - t.selection.destroy(); - t.dom.destroy(); - - // Remove all events - - // Don't clear the window or document if content editable - // is enabled since other instances might still be present - if (!t.settings.content_editable) { - Event.clear(t.getWin()); - Event.clear(t.getDoc()); - } - - Event.clear(t.getBody()); - Event.clear(t.formElement); - } - - if (t.formElement) { - t.formElement.submit = t.formElement._mceOldSubmit; - t.formElement._mceOldSubmit = null; - } - - t.contentAreaContainer = t.formElement = t.container = t.settings.content_element = t.bodyElement = t.contentDocument = t.contentWindow = null; - - if (t.selection) - t.selection = t.selection.win = t.selection.dom = t.selection.dom.doc = null; - - t.destroyed = 1; - }, - - // Internal functions - - _addEvents : function() { - // 'focus', 'blur', 'dblclick', 'beforedeactivate', submit, reset - var t = this, i, s = t.settings, dom = t.dom, lo = { - mouseup : 'onMouseUp', - mousedown : 'onMouseDown', - click : 'onClick', - keyup : 'onKeyUp', - keydown : 'onKeyDown', - keypress : 'onKeyPress', - submit : 'onSubmit', - reset : 'onReset', - contextmenu : 'onContextMenu', - dblclick : 'onDblClick', - paste : 'onPaste' // Doesn't work in all browsers yet - }; - - function eventHandler(e, o) { - var ty = e.type; - - // Don't fire events when it's removed - if (t.removed) - return; - - // Generic event handler - if (t.onEvent.dispatch(t, e, o) !== false) { - // Specific event handler - t[lo[e.fakeType || e.type]].dispatch(t, e, o); - } - }; - - // Add DOM events - each(lo, function(v, k) { - switch (k) { - case 'contextmenu': - dom.bind(t.getDoc(), k, eventHandler); - break; - - case 'paste': - dom.bind(t.getBody(), k, function(e) { - eventHandler(e); - }); - break; - - case 'submit': - case 'reset': - dom.bind(t.getElement().form || DOM.getParent(t.id, 'form'), k, eventHandler); - break; - - default: - dom.bind(s.content_editable ? t.getBody() : t.getDoc(), k, eventHandler); - } - }); - - dom.bind(s.content_editable ? t.getBody() : (isGecko ? t.getDoc() : t.getWin()), 'focus', function(e) { - t.focus(true); - }); - - - // Fixes bug where a specified document_base_uri could result in broken images - // This will also fix drag drop of images in Gecko - if (tinymce.isGecko) { - dom.bind(t.getDoc(), 'DOMNodeInserted', function(e) { - var v; - - e = e.target; - - if (e.nodeType === 1 && e.nodeName === 'IMG' && (v = e.getAttribute('data-mce-src'))) - e.src = t.documentBaseURI.toAbsolute(v); - }); - } - - // Set various midas options in Gecko - if (isGecko) { - function setOpts() { - var t = this, d = t.getDoc(), s = t.settings; - - if (isGecko && !s.readonly) { - t._refreshContentEditable(); - - try { - // Try new Gecko method - d.execCommand("styleWithCSS", 0, false); - } catch (ex) { - // Use old method - if (!t._isHidden()) - try {d.execCommand("useCSS", 0, true);} catch (ex) {} - } - - if (!s.table_inline_editing) - try {d.execCommand('enableInlineTableEditing', false, false);} catch (ex) {} - - if (!s.object_resizing) - try {d.execCommand('enableObjectResizing', false, false);} catch (ex) {} - } - }; - - t.onBeforeExecCommand.add(setOpts); - t.onMouseDown.add(setOpts); - } - - // Add node change handlers - t.onMouseUp.add(t.nodeChanged); - //t.onClick.add(t.nodeChanged); - t.onKeyUp.add(function(ed, e) { - var c = e.keyCode; - - if ((c >= 33 && c <= 36) || (c >= 37 && c <= 40) || c == 13 || c == 45 || c == 46 || c == 8 || (tinymce.isMac && (c == 91 || c == 93)) || e.ctrlKey) - t.nodeChanged(); - }); - - - // Add block quote deletion handler - t.onKeyDown.add(function(ed, e) { - // Was the BACKSPACE key pressed? - if (e.keyCode != 8) - return; - - var n = ed.selection.getRng().startContainer; - var offset = ed.selection.getRng().startOffset; - - while (n && n.nodeType && n.nodeType != 1 && n.parentNode) - n = n.parentNode; - - // Is the cursor at the beginning of a blockquote? - if (n && n.parentNode && n.parentNode.tagName === 'BLOCKQUOTE' && n.parentNode.firstChild == n && offset == 0) { - // Remove the blockquote - ed.formatter.toggle('blockquote', null, n.parentNode); - - // Move the caret to the beginning of n - var rng = ed.selection.getRng(); - rng.setStart(n, 0); - rng.setEnd(n, 0); - ed.selection.setRng(rng); - ed.selection.collapse(false); - } - }); - - - - // Add reset handler - t.onReset.add(function() { - t.setContent(t.startContent, {format : 'raw'}); - }); - - // Add shortcuts - if (s.custom_shortcuts) { - if (s.custom_undo_redo_keyboard_shortcuts) { - t.addShortcut('ctrl+z', t.getLang('undo_desc'), 'Undo'); - t.addShortcut('ctrl+y', t.getLang('redo_desc'), 'Redo'); - } - - // Add default shortcuts for gecko - t.addShortcut('ctrl+b', t.getLang('bold_desc'), 'Bold'); - t.addShortcut('ctrl+i', t.getLang('italic_desc'), 'Italic'); - t.addShortcut('ctrl+u', t.getLang('underline_desc'), 'Underline'); - - // BlockFormat shortcuts keys - for (i=1; i<=6; i++) - t.addShortcut('ctrl+' + i, '', ['FormatBlock', false, 'h' + i]); - - t.addShortcut('ctrl+7', '', ['FormatBlock', false, 'p']); - t.addShortcut('ctrl+8', '', ['FormatBlock', false, 'div']); - t.addShortcut('ctrl+9', '', ['FormatBlock', false, 'address']); - - function find(e) { - var v = null; - - if (!e.altKey && !e.ctrlKey && !e.metaKey) - return v; - - each(t.shortcuts, function(o) { - if (tinymce.isMac && o.ctrl != e.metaKey) - return; - else if (!tinymce.isMac && o.ctrl != e.ctrlKey) - return; - - if (o.alt != e.altKey) - return; - - if (o.shift != e.shiftKey) - return; - - if (e.keyCode == o.keyCode || (e.charCode && e.charCode == o.charCode)) { - v = o; - return false; - } - }); - - return v; - }; - - t.onKeyUp.add(function(ed, e) { - var o = find(e); - - if (o) - return Event.cancel(e); - }); - - t.onKeyPress.add(function(ed, e) { - var o = find(e); - - if (o) - return Event.cancel(e); - }); - - t.onKeyDown.add(function(ed, e) { - var o = find(e); - - if (o) { - o.func.call(o.scope); - return Event.cancel(e); - } - }); - } - - if (tinymce.isIE) { - // Fix so resize will only update the width and height attributes not the styles of an image - // It will also block mceItemNoResize items - dom.bind(t.getDoc(), 'controlselect', function(e) { - var re = t.resizeInfo, cb; - - e = e.target; - - // Don't do this action for non image elements - if (e.nodeName !== 'IMG') - return; - - if (re) - dom.unbind(re.node, re.ev, re.cb); - - if (!dom.hasClass(e, 'mceItemNoResize')) { - ev = 'resizeend'; - cb = dom.bind(e, ev, function(e) { - var v; - - e = e.target; - - if (v = dom.getStyle(e, 'width')) { - dom.setAttrib(e, 'width', v.replace(/[^0-9%]+/g, '')); - dom.setStyle(e, 'width', ''); - } - - if (v = dom.getStyle(e, 'height')) { - dom.setAttrib(e, 'height', v.replace(/[^0-9%]+/g, '')); - dom.setStyle(e, 'height', ''); - } - }); - } else { - ev = 'resizestart'; - cb = dom.bind(e, 'resizestart', Event.cancel, Event); - } - - re = t.resizeInfo = { - node : e, - ev : ev, - cb : cb - }; - }); - } - - if (tinymce.isOpera) { - t.onClick.add(function(ed, e) { - Event.prevent(e); - }); - } - - // Add custom undo/redo handlers - if (s.custom_undo_redo) { - function addUndo() { - t.undoManager.typing = false; - t.undoManager.add(); - }; - - dom.bind(t.getDoc(), 'focusout', function(e) { - if (!t.removed && t.undoManager.typing) - addUndo(); - }); - - // Add undo level when contents is drag/dropped within the editor - t.dom.bind(t.dom.getRoot(), 'dragend', function(e) { - addUndo(); - }); - - t.onKeyUp.add(function(ed, e) { - var keyCode = e.keyCode; - - if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45 || e.ctrlKey) - addUndo(); - }); - - t.onKeyDown.add(function(ed, e) { - var keyCode = e.keyCode, sel; - - if (keyCode == 8) { - sel = t.getDoc().selection; - - // Fix IE control + backspace browser bug - if (sel && sel.createRange && sel.createRange().item) { - t.undoManager.beforeChange(); - ed.dom.remove(sel.createRange().item(0)); - addUndo(); - - return Event.cancel(e); - } - } - - // Is caracter positon keys left,right,up,down,home,end,pgdown,pgup,enter - if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45) { - // Add position before enter key is pressed, used by IE since it still uses the default browser behavior - // Todo: Remove this once we normalize enter behavior on IE - if (tinymce.isIE && keyCode == 13) - t.undoManager.beforeChange(); - - if (t.undoManager.typing) - addUndo(); - - return; - } - - // If key isn't shift,ctrl,alt,capslock,metakey - if ((keyCode < 16 || keyCode > 20) && keyCode != 224 && keyCode != 91 && !t.undoManager.typing) { - t.undoManager.beforeChange(); - t.undoManager.typing = true; - t.undoManager.add(); - } - }); - - t.onMouseDown.add(function() { - if (t.undoManager.typing) - addUndo(); - }); - } - - // Bug fix for FireFox keeping styles from end of selection instead of start. - if (tinymce.isGecko) { - function getAttributeApplyFunction() { - var template = t.dom.getAttribs(t.selection.getStart().cloneNode(false)); - - return function() { - var target = t.selection.getStart(); - - if (target !== t.getBody()) { - t.dom.setAttrib(target, "style", null); - - each(template, function(attr) { - target.setAttributeNode(attr.cloneNode(true)); - }); - } - }; - } - - function isSelectionAcrossElements() { - var s = t.selection; - - return !s.isCollapsed() && s.getStart() != s.getEnd(); - } - - t.onKeyPress.add(function(ed, e) { - var applyAttributes; - - if ((e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) { - applyAttributes = getAttributeApplyFunction(); - t.getDoc().execCommand('delete', false, null); - applyAttributes(); - - return Event.cancel(e); - } - }); - - t.dom.bind(t.getDoc(), 'cut', function(e) { - var applyAttributes; - - if (isSelectionAcrossElements()) { - applyAttributes = getAttributeApplyFunction(); - t.onKeyUp.addToTop(Event.cancel, Event); - - setTimeout(function() { - applyAttributes(); - t.onKeyUp.remove(Event.cancel, Event); - }, 0); - } - }); - } - }, - - _refreshContentEditable : function() { - var self = this, body, parent; - - // Check if the editor was hidden and the re-initalize contentEditable mode by removing and adding the body again - if (self._isHidden()) { - body = self.getBody(); - parent = body.parentNode; - - parent.removeChild(body); - parent.appendChild(body); - - body.focus(); - } - }, - - _isHidden : function() { - var s; - - if (!isGecko) - return 0; - - // Weird, wheres that cursor selection? - s = this.selection.getSel(); - return (!s || !s.rangeCount || s.rangeCount == 0); - } - }); -})(tinymce); - -(function(tinymce) { - // Added for compression purposes - var each = tinymce.each, undefined, TRUE = true, FALSE = false; - - tinymce.EditorCommands = function(editor) { - var dom = editor.dom, - selection = editor.selection, - commands = {state: {}, exec : {}, value : {}}, - settings = editor.settings, - formatter = editor.formatter, - bookmark; - - function execCommand(command, ui, value) { - var func; - - command = command.toLowerCase(); - if (func = commands.exec[command]) { - func(command, ui, value); - return TRUE; - } - - return FALSE; - }; - - function queryCommandState(command) { - var func; - - command = command.toLowerCase(); - if (func = commands.state[command]) - return func(command); - - return -1; - }; - - function queryCommandValue(command) { - var func; - - command = command.toLowerCase(); - if (func = commands.value[command]) - return func(command); - - return FALSE; - }; - - function addCommands(command_list, type) { - type = type || 'exec'; - - each(command_list, function(callback, command) { - each(command.toLowerCase().split(','), function(command) { - commands[type][command] = callback; - }); - }); - }; - - // Expose public methods - tinymce.extend(this, { - execCommand : execCommand, - queryCommandState : queryCommandState, - queryCommandValue : queryCommandValue, - addCommands : addCommands - }); - - // Private methods - - function execNativeCommand(command, ui, value) { - if (ui === undefined) - ui = FALSE; - - if (value === undefined) - value = null; - - return editor.getDoc().execCommand(command, ui, value); - }; - - function isFormatMatch(name) { - return formatter.match(name); - }; - - function toggleFormat(name, value) { - formatter.toggle(name, value ? {value : value} : undefined); - }; - - function storeSelection(type) { - bookmark = selection.getBookmark(type); - }; - - function restoreSelection() { - selection.moveToBookmark(bookmark); - }; - - // Add execCommand overrides - addCommands({ - // Ignore these, added for compatibility - 'mceResetDesignMode,mceBeginUndoLevel' : function() {}, - - // Add undo manager logic - 'mceEndUndoLevel,mceAddUndoLevel' : function() { - editor.undoManager.add(); - }, - - 'Cut,Copy,Paste' : function(command) { - var doc = editor.getDoc(), failed; - - // Try executing the native command - try { - execNativeCommand(command); - } catch (ex) { - // Command failed - failed = TRUE; - } - - // Present alert message about clipboard access not being available - if (failed || !doc.queryCommandSupported(command)) { - if (tinymce.isGecko) { - editor.windowManager.confirm(editor.getLang('clipboard_msg'), function(state) { - if (state) - open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', '_blank'); - }); - } else - editor.windowManager.alert(editor.getLang('clipboard_no_support')); - } - }, - - // Override unlink command - unlink : function(command) { - if (selection.isCollapsed()) - selection.select(selection.getNode()); - - execNativeCommand(command); - selection.collapse(FALSE); - }, - - // Override justify commands to use the text formatter engine - 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) { - var align = command.substring(7); - - // Remove all other alignments first - each('left,center,right,full'.split(','), function(name) { - if (align != name) - formatter.remove('align' + name); - }); - - toggleFormat('align' + align); - execCommand('mceRepaint'); - }, - - // Override list commands to fix WebKit bug - 'InsertUnorderedList,InsertOrderedList' : function(command) { - var listElm, listParent; - - execNativeCommand(command); - - // WebKit produces lists within block elements so we need to split them - // we will replace the native list creation logic to custom logic later on - // TODO: Remove this when the list creation logic is removed - listElm = dom.getParent(selection.getNode(), 'ol,ul'); - if (listElm) { - listParent = listElm.parentNode; - - // If list is within a text block then split that block - if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) { - storeSelection(); - dom.split(listParent, listElm); - restoreSelection(); - } - } - }, - - // Override commands to use the text formatter engine - 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript' : function(command) { - toggleFormat(command); - }, - - // Override commands to use the text formatter engine - 'ForeColor,HiliteColor,FontName' : function(command, ui, value) { - toggleFormat(command, value); - }, - - FontSize : function(command, ui, value) { - var fontClasses, fontSizes; - - // Convert font size 1-7 to styles - if (value >= 1 && value <= 7) { - fontSizes = tinymce.explode(settings.font_size_style_values); - fontClasses = tinymce.explode(settings.font_size_classes); - - if (fontClasses) - value = fontClasses[value - 1] || value; - else - value = fontSizes[value - 1] || value; - } - - toggleFormat(command, value); - }, - - RemoveFormat : function(command) { - formatter.remove(command); - }, - - mceBlockQuote : function(command) { - toggleFormat('blockquote'); - }, - - FormatBlock : function(command, ui, value) { - return toggleFormat(value || 'p'); - }, - - mceCleanup : function() { - var bookmark = selection.getBookmark(); - - editor.setContent(editor.getContent({cleanup : TRUE}), {cleanup : TRUE}); - - selection.moveToBookmark(bookmark); - }, - - mceRemoveNode : function(command, ui, value) { - var node = value || selection.getNode(); - - // Make sure that the body node isn't removed - if (node != editor.getBody()) { - storeSelection(); - editor.dom.remove(node, TRUE); - restoreSelection(); - } - }, - - mceSelectNodeDepth : function(command, ui, value) { - var counter = 0; - - dom.getParent(selection.getNode(), function(node) { - if (node.nodeType == 1 && counter++ == value) { - selection.select(node); - return FALSE; - } - }, editor.getBody()); - }, - - mceSelectNode : function(command, ui, value) { - selection.select(value); - }, - - mceInsertContent : function(command, ui, value) { - var parser, serializer, parentNode, rootNode, fragment, args, - marker, nodeRect, viewPortRect, rng, node, node2, bookmarkHtml, viewportBodyElement; - - // Setup parser and serializer - parser = editor.parser; - serializer = new tinymce.html.Serializer({}, editor.schema); - bookmarkHtml = '\uFEFF'; - - // Run beforeSetContent handlers on the HTML to be inserted - args = {content: value, format: 'html'}; - selection.onBeforeSetContent.dispatch(selection, args); - value = args.content; - - // Add caret at end of contents if it's missing - if (value.indexOf('{$caret}') == -1) - value += '{$caret}'; - - // Replace the caret marker with a span bookmark element - value = value.replace(/\{\$caret\}/, bookmarkHtml); - - // Insert node maker where we will insert the new HTML and get it's parent - if (!selection.isCollapsed()) - editor.getDoc().execCommand('Delete', false, null); - - parentNode = selection.getNode(); - - // Parse the fragment within the context of the parent node - args = {context : parentNode.nodeName.toLowerCase()}; - fragment = parser.parse(value, args); - - // Move the caret to a more suitable location - node = fragment.lastChild; - if (node.attr('id') == 'mce_marker') { - marker = node; - - for (node = node.prev; node; node = node.walk(true)) { - if (node.type == 3 || !dom.isBlock(node.name)) { - node.parent.insert(marker, node, node.name === 'br'); - break; - } - } - } - - // If parser says valid we can insert the contents into that parent - if (!args.invalid) { - value = serializer.serialize(fragment); - - // Check if parent is empty or only has one BR element then set the innerHTML of that parent - node = parentNode.firstChild; - node2 = parentNode.lastChild; - if (!node || (node === node2 && node.nodeName === 'BR')) - dom.setHTML(parentNode, value); - else - selection.setContent(value); - } else { - // If the fragment was invalid within that context then we need - // to parse and process the parent it's inserted into - - // Insert bookmark node and get the parent - selection.setContent(bookmarkHtml); - parentNode = editor.selection.getNode(); - rootNode = editor.getBody(); - - // Opera will return the document node when selection is in root - if (parentNode.nodeType == 9) - parentNode = node = rootNode; - else - node = parentNode; - - // Find the ancestor just before the root element - while (node !== rootNode) { - parentNode = node; - node = node.parentNode; - } - - // Get the outer/inner HTML depending on if we are in the root and parser and serialize that - value = parentNode == rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode); - value = serializer.serialize( - parser.parse( - // Need to replace by using a function since $ in the contents would otherwise be a problem - value.replace(//i, function() { - return serializer.serialize(fragment); - }) - ) - ); - - // Set the inner/outer HTML depending on if we are in the root or not - if (parentNode == rootNode) - dom.setHTML(rootNode, value); - else - dom.setOuterHTML(parentNode, value); - } - - marker = dom.get('mce_marker'); - - // Scroll range into view scrollIntoView on element can't be used since it will scroll the main view port as well - nodeRect = dom.getRect(marker); - viewPortRect = dom.getViewPort(editor.getWin()); - - // Check if node is out side the viewport if it is then scroll to it - if ((nodeRect.y + nodeRect.h > viewPortRect.y + viewPortRect.h || nodeRect.y < viewPortRect.y) || - (nodeRect.x > viewPortRect.x + viewPortRect.w || nodeRect.x < viewPortRect.x)) { - viewportBodyElement = tinymce.isIE ? editor.getDoc().documentElement : editor.getBody(); - viewportBodyElement.scrollLeft = nodeRect.x; - viewportBodyElement.scrollTop = nodeRect.y - viewPortRect.h + 25; - } - - // Move selection before marker and remove it - rng = dom.createRng(); - - // If previous sibling is a text node set the selection to the end of that node - node = marker.previousSibling; - if (node && node.nodeType == 3) { - rng.setStart(node, node.nodeValue.length); - } else { - // If the previous sibling isn't a text node or doesn't exist set the selection before the marker node - rng.setStartBefore(marker); - rng.setEndBefore(marker); - } - - // Remove the marker node and set the new range - dom.remove(marker); - selection.setRng(rng); - - // Dispatch after event and add any visual elements needed - selection.onSetContent.dispatch(selection, args); - editor.addVisual(); - }, - - mceInsertRawHTML : function(command, ui, value) { - selection.setContent('tiny_mce_marker'); - editor.setContent(editor.getContent().replace(/tiny_mce_marker/g, function() { return value })); - }, - - mceSetContent : function(command, ui, value) { - editor.setContent(value); - }, - - 'Indent,Outdent' : function(command) { - var intentValue, indentUnit, value; - - // Setup indent level - intentValue = settings.indentation; - indentUnit = /[a-z%]+$/i.exec(intentValue); - intentValue = parseInt(intentValue); - - if (!queryCommandState('InsertUnorderedList') && !queryCommandState('InsertOrderedList')) { - each(selection.getSelectedBlocks(), function(element) { - if (command == 'outdent') { - value = Math.max(0, parseInt(element.style.paddingLeft || 0) - intentValue); - dom.setStyle(element, 'paddingLeft', value ? value + indentUnit : ''); - } else - dom.setStyle(element, 'paddingLeft', (parseInt(element.style.paddingLeft || 0) + intentValue) + indentUnit); - }); - } else - execNativeCommand(command); - }, - - mceRepaint : function() { - var bookmark; - - if (tinymce.isGecko) { - try { - storeSelection(TRUE); - - if (selection.getSel()) - selection.getSel().selectAllChildren(editor.getBody()); - - selection.collapse(TRUE); - restoreSelection(); - } catch (ex) { - // Ignore - } - } - }, - - mceToggleFormat : function(command, ui, value) { - formatter.toggle(value); - }, - - InsertHorizontalRule : function() { - editor.execCommand('mceInsertContent', false, '
    '); - }, - - mceToggleVisualAid : function() { - editor.hasVisual = !editor.hasVisual; - editor.addVisual(); - }, - - mceReplaceContent : function(command, ui, value) { - editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, selection.getContent({format : 'text'}))); - }, - - mceInsertLink : function(command, ui, value) { - var anchor; - - if (typeof(value) == 'string') - value = {href : value}; - - anchor = dom.getParent(selection.getNode(), 'a'); - - // Spaces are never valid in URLs and it's a very common mistake for people to make so we fix it here. - value.href = value.href.replace(' ', '%20'); - - // Remove existing links if there could be child links or that the href isn't specified - if (!anchor || !value.href) { - formatter.remove('link'); - } - - // Apply new link to selection - if (value.href) { - formatter.apply('link', value, anchor); - } - }, - - selectAll : function() { - var root = dom.getRoot(), rng = dom.createRng(); - - rng.setStart(root, 0); - rng.setEnd(root, root.childNodes.length); - - editor.selection.setRng(rng); - } - }); - - // Add queryCommandState overrides - addCommands({ - // Override justify commands - 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) { - return isFormatMatch('align' + command.substring(7)); - }, - - 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript' : function(command) { - return isFormatMatch(command); - }, - - mceBlockQuote : function() { - return isFormatMatch('blockquote'); - }, - - Outdent : function() { - var node; - - if (settings.inline_styles) { - if ((node = dom.getParent(selection.getStart(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0) - return TRUE; - - if ((node = dom.getParent(selection.getEnd(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0) - return TRUE; - } - - return queryCommandState('InsertUnorderedList') || queryCommandState('InsertOrderedList') || (!settings.inline_styles && !!dom.getParent(selection.getNode(), 'BLOCKQUOTE')); - }, - - 'InsertUnorderedList,InsertOrderedList' : function(command) { - return dom.getParent(selection.getNode(), command == 'insertunorderedlist' ? 'UL' : 'OL'); - } - }, 'state'); - - // Add queryCommandValue overrides - addCommands({ - 'FontSize,FontName' : function(command) { - var value = 0, parent; - - if (parent = dom.getParent(selection.getNode(), 'span')) { - if (command == 'fontsize') - value = parent.style.fontSize; - else - value = parent.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase(); - } - - return value; - } - }, 'value'); - - // Add undo manager logic - if (settings.custom_undo_redo) { - addCommands({ - Undo : function() { - editor.undoManager.undo(); - }, - - Redo : function() { - editor.undoManager.redo(); - } - }); - } - }; -})(tinymce); - -(function(tinymce) { - var Dispatcher = tinymce.util.Dispatcher; - - tinymce.UndoManager = function(editor) { - var self, index = 0, data = [], beforeBookmark; - - function getContent() { - return tinymce.trim(editor.getContent({format : 'raw', no_events : 1})); - }; - - return self = { - typing : false, - - onAdd : new Dispatcher(self), - - onUndo : new Dispatcher(self), - - onRedo : new Dispatcher(self), - - beforeChange : function() { - beforeBookmark = editor.selection.getBookmark(2, true); - }, - - add : function(level) { - var i, settings = editor.settings, lastLevel; - - level = level || {}; - level.content = getContent(); - - // Add undo level if needed - lastLevel = data[index]; - if (lastLevel && lastLevel.content == level.content) - return null; - - // Set before bookmark on previous level - if (data[index]) - data[index].beforeBookmark = beforeBookmark; - - // Time to compress - if (settings.custom_undo_redo_levels) { - if (data.length > settings.custom_undo_redo_levels) { - for (i = 0; i < data.length - 1; i++) - data[i] = data[i + 1]; - - data.length--; - index = data.length; - } - } - - // Get a non intrusive normalized bookmark - level.bookmark = editor.selection.getBookmark(2, true); - - // Crop array if needed - if (index < data.length - 1) - data.length = index + 1; - - data.push(level); - index = data.length - 1; - - self.onAdd.dispatch(self, level); - editor.isNotDirty = 0; - - return level; - }, - - undo : function() { - var level, i; - - if (self.typing) { - self.add(); - self.typing = false; - } - - if (index > 0) { - level = data[--index]; - - editor.setContent(level.content, {format : 'raw'}); - editor.selection.moveToBookmark(level.beforeBookmark); - - self.onUndo.dispatch(self, level); - } - - return level; - }, - - redo : function() { - var level; - - if (index < data.length - 1) { - level = data[++index]; - - editor.setContent(level.content, {format : 'raw'}); - editor.selection.moveToBookmark(level.bookmark); - - self.onRedo.dispatch(self, level); - } - - return level; - }, - - clear : function() { - data = []; - index = 0; - self.typing = false; - }, - - hasUndo : function() { - return index > 0 || this.typing; - }, - - hasRedo : function() { - return index < data.length - 1 && !this.typing; - } - }; - }; -})(tinymce); - -(function(tinymce) { - // Shorten names - var Event = tinymce.dom.Event, - isIE = tinymce.isIE, - isGecko = tinymce.isGecko, - isOpera = tinymce.isOpera, - each = tinymce.each, - extend = tinymce.extend, - TRUE = true, - FALSE = false; - - function cloneFormats(node) { - var clone, temp, inner; - - do { - if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(node.nodeName)) { - if (clone) { - temp = node.cloneNode(false); - temp.appendChild(clone); - clone = temp; - } else { - clone = inner = node.cloneNode(false); - } - - clone.removeAttribute('id'); - } - } while (node = node.parentNode); - - if (clone) - return {wrapper : clone, inner : inner}; - }; - - // Checks if the selection/caret is at the end of the specified block element - function isAtEnd(rng, par) { - var rng2 = par.ownerDocument.createRange(); - - rng2.setStart(rng.endContainer, rng.endOffset); - rng2.setEndAfter(par); - - // Get number of characters to the right of the cursor if it's zero then we are at the end and need to merge the next block element - return rng2.cloneContents().textContent.length == 0; - }; - - function splitList(selection, dom, li) { - var listBlock, block; - - if (dom.isEmpty(li)) { - listBlock = dom.getParent(li, 'ul,ol'); - - if (!dom.getParent(listBlock.parentNode, 'ul,ol')) { - dom.split(listBlock, li); - block = dom.create('p', 0, '
    '); - dom.replace(block, li); - selection.select(block, 1); - } - - return FALSE; - } - - return TRUE; - }; - - tinymce.create('tinymce.ForceBlocks', { - ForceBlocks : function(ed) { - var t = this, s = ed.settings, elm; - - t.editor = ed; - t.dom = ed.dom; - elm = (s.forced_root_block || 'p').toLowerCase(); - s.element = elm.toUpperCase(); - - ed.onPreInit.add(t.setup, t); - }, - - setup : function() { - var t = this, ed = t.editor, s = ed.settings, dom = ed.dom, selection = ed.selection, blockElements = ed.schema.getBlockElements(); - - // Force root blocks - if (s.forced_root_block) { - function addRootBlocks() { - var node = selection.getStart(), rootNode = ed.getBody(), rng, startContainer, startOffset, endContainer, endOffset, rootBlockNode, tempNode, offset = -0xFFFFFF; - - if (!node || node.nodeType !== 1) - return; - - // Check if node is wrapped in block - while (node != rootNode) { - if (blockElements[node.nodeName]) - return; - - node = node.parentNode; - } - - // Get current selection - rng = selection.getRng(); - if (rng.setStart) { - startContainer = rng.startContainer; - startOffset = rng.startOffset; - endContainer = rng.endContainer; - endOffset = rng.endOffset; - } else { - // Force control range into text range - if (rng.item) { - rng = ed.getDoc().body.createTextRange(); - rng.moveToElementText(rng.item(0)); - } - - tmpRng = rng.duplicate(); - tmpRng.collapse(true); - startOffset = tmpRng.move('character', offset) * -1; - - if (!tmpRng.collapsed) { - tmpRng = rng.duplicate(); - tmpRng.collapse(false); - endOffset = (tmpRng.move('character', offset) * -1) - startOffset; - } - } - - // Wrap non block elements and text nodes - for (node = rootNode.firstChild; node; node) { - if (node.nodeType === 3 || (node.nodeType == 1 && !blockElements[node.nodeName])) { - if (!rootBlockNode) { - rootBlockNode = dom.create(s.forced_root_block); - node.parentNode.insertBefore(rootBlockNode, node); - } - - tempNode = node; - node = node.nextSibling; - rootBlockNode.appendChild(tempNode); - } else { - rootBlockNode = null; - node = node.nextSibling; - } - } - - if (rng.setStart) { - rng.setStart(startContainer, startOffset); - rng.setEnd(endContainer, endOffset); - selection.setRng(rng); - } else { - try { - rng = ed.getDoc().body.createTextRange(); - rng.moveToElementText(rootNode); - rng.collapse(true); - rng.moveStart('character', startOffset); - - if (endOffset > 0) - rng.moveEnd('character', endOffset); - - rng.select(); - } catch (ex) { - // Ignore - } - } - - ed.nodeChanged(); - }; - - ed.onKeyUp.add(addRootBlocks); - ed.onClick.add(addRootBlocks); - } - - if (s.force_br_newlines) { - // Force IE to produce BRs on enter - if (isIE) { - ed.onKeyPress.add(function(ed, e) { - var n; - - if (e.keyCode == 13 && selection.getNode().nodeName != 'LI') { - selection.setContent('
    ', {format : 'raw'}); - n = dom.get('__'); - n.removeAttribute('id'); - selection.select(n); - selection.collapse(); - return Event.cancel(e); - } - }); - } - } - - if (s.force_p_newlines) { - if (!isIE) { - ed.onKeyPress.add(function(ed, e) { - if (e.keyCode == 13 && !e.shiftKey && !t.insertPara(e)) - Event.cancel(e); - }); - } else { - // Ungly hack to for IE to preserve the formatting when you press - // enter at the end of a block element with formatted contents - // This logic overrides the browsers default logic with - // custom logic that enables us to control the output - tinymce.addUnload(function() { - t._previousFormats = 0; // Fix IE leak - }); - - ed.onKeyPress.add(function(ed, e) { - t._previousFormats = 0; - - // Clone the current formats, this will later be applied to the new block contents - if (e.keyCode == 13 && !e.shiftKey && ed.selection.isCollapsed() && s.keep_styles) - t._previousFormats = cloneFormats(ed.selection.getStart()); - }); - - ed.onKeyUp.add(function(ed, e) { - // Let IE break the element and the wrap the new caret location in the previous formats - if (e.keyCode == 13 && !e.shiftKey) { - var parent = ed.selection.getStart(), fmt = t._previousFormats; - - // Parent is an empty block - if (!parent.hasChildNodes() && fmt) { - parent = dom.getParent(parent, dom.isBlock); - - if (parent && parent.nodeName != 'LI') { - parent.innerHTML = ''; - - if (t._previousFormats) { - parent.appendChild(fmt.wrapper); - fmt.inner.innerHTML = '\uFEFF'; - } else - parent.innerHTML = '\uFEFF'; - - selection.select(parent, 1); - selection.collapse(true); - ed.getDoc().execCommand('Delete', false, null); - t._previousFormats = 0; - } - } - } - }); - } - - if (isGecko) { - ed.onKeyDown.add(function(ed, e) { - if ((e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) - t.backspaceDelete(e, e.keyCode == 8); - }); - } - } - - // Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973 - if (tinymce.isWebKit) { - function insertBr(ed) { - var rng = selection.getRng(), br, div = dom.create('div', null, ' '), divYPos, vpHeight = dom.getViewPort(ed.getWin()).h; - - // Insert BR element - rng.insertNode(br = dom.create('br')); - - // Place caret after BR - rng.setStartAfter(br); - rng.setEndAfter(br); - selection.setRng(rng); - - // Could not place caret after BR then insert an nbsp entity and move the caret - if (selection.getSel().focusNode == br.previousSibling) { - selection.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'), br)); - selection.collapse(TRUE); - } - - // Create a temporary DIV after the BR and get the position as it - // seems like getPos() returns 0 for text nodes and BR elements. - dom.insertAfter(div, br); - divYPos = dom.getPos(div).y; - dom.remove(div); - - // Scroll to new position, scrollIntoView can't be used due to bug: http://bugs.webkit.org/show_bug.cgi?id=16117 - if (divYPos > vpHeight) // It is not necessary to scroll if the DIV is inside the view port. - ed.getWin().scrollTo(0, divYPos); - }; - - ed.onKeyPress.add(function(ed, e) { - if (e.keyCode == 13 && (e.shiftKey || (s.force_br_newlines && !dom.getParent(selection.getNode(), 'h1,h2,h3,h4,h5,h6,ol,ul')))) { - insertBr(ed); - Event.cancel(e); - } - }); - } - - // IE specific fixes - if (isIE) { - // Replaces IE:s auto generated paragraphs with the specified element name - if (s.element != 'P') { - ed.onKeyPress.add(function(ed, e) { - t.lastElm = selection.getNode().nodeName; - }); - - ed.onKeyUp.add(function(ed, e) { - var bl, n = selection.getNode(), b = ed.getBody(); - - if (b.childNodes.length === 1 && n.nodeName == 'P') { - n = dom.rename(n, s.element); - selection.select(n); - selection.collapse(); - ed.nodeChanged(); - } else if (e.keyCode == 13 && !e.shiftKey && t.lastElm != 'P') { - bl = dom.getParent(n, 'p'); - - if (bl) { - dom.rename(bl, s.element); - ed.nodeChanged(); - } - } - }); - } - } - }, - - getParentBlock : function(n) { - var d = this.dom; - - return d.getParent(n, d.isBlock); - }, - - insertPara : function(e) { - var t = this, ed = t.editor, dom = ed.dom, d = ed.getDoc(), se = ed.settings, s = ed.selection.getSel(), r = s.getRangeAt(0), b = d.body; - var rb, ra, dir, sn, so, en, eo, sb, eb, bn, bef, aft, sc, ec, n, vp = dom.getViewPort(ed.getWin()), y, ch, car; - - ed.undoManager.beforeChange(); - - // If root blocks are forced then use Operas default behavior since it's really good -// Removed due to bug: #1853816 -// if (se.forced_root_block && isOpera) -// return TRUE; - - // Setup before range - rb = d.createRange(); - - // If is before the first block element and in body, then move it into first block element - rb.setStart(s.anchorNode, s.anchorOffset); - rb.collapse(TRUE); - - // Setup after range - ra = d.createRange(); - - // If is before the first block element and in body, then move it into first block element - ra.setStart(s.focusNode, s.focusOffset); - ra.collapse(TRUE); - - // Setup start/end points - dir = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0; - sn = dir ? s.anchorNode : s.focusNode; - so = dir ? s.anchorOffset : s.focusOffset; - en = dir ? s.focusNode : s.anchorNode; - eo = dir ? s.focusOffset : s.anchorOffset; - - // If selection is in empty table cell - if (sn === en && /^(TD|TH)$/.test(sn.nodeName)) { - if (sn.firstChild.nodeName == 'BR') - dom.remove(sn.firstChild); // Remove BR - - // Create two new block elements - if (sn.childNodes.length == 0) { - ed.dom.add(sn, se.element, null, '
    '); - aft = ed.dom.add(sn, se.element, null, '
    '); - } else { - n = sn.innerHTML; - sn.innerHTML = ''; - ed.dom.add(sn, se.element, null, n); - aft = ed.dom.add(sn, se.element, null, '
    '); - } - - // Move caret into the last one - r = d.createRange(); - r.selectNodeContents(aft); - r.collapse(1); - ed.selection.setRng(r); - - return FALSE; - } - - // If the caret is in an invalid location in FF we need to move it into the first block - if (sn == b && en == b && b.firstChild && ed.dom.isBlock(b.firstChild)) { - sn = en = sn.firstChild; - so = eo = 0; - rb = d.createRange(); - rb.setStart(sn, 0); - ra = d.createRange(); - ra.setStart(en, 0); - } - - // If the body is totally empty add a BR element this might happen on webkit - if (!d.body.hasChildNodes()) { - d.body.appendChild(dom.create('br')); - } - - // Never use body as start or end node - sn = sn.nodeName == "HTML" ? d.body : sn; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes - sn = sn.nodeName == "BODY" ? sn.firstChild : sn; - en = en.nodeName == "HTML" ? d.body : en; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes - en = en.nodeName == "BODY" ? en.firstChild : en; - - // Get start and end blocks - sb = t.getParentBlock(sn); - eb = t.getParentBlock(en); - bn = sb ? sb.nodeName : se.element; // Get block name to create - - // Return inside list use default browser behavior - if (n = t.dom.getParent(sb, 'li,pre')) { - if (n.nodeName == 'LI') - return splitList(ed.selection, t.dom, n); - - return TRUE; - } - - // If caption or absolute layers then always generate new blocks within - if (sb && (sb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) { - bn = se.element; - sb = null; - } - - // If caption or absolute layers then always generate new blocks within - if (eb && (eb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) { - bn = se.element; - eb = null; - } - - // Use P instead - if (/(TD|TABLE|TH|CAPTION)/.test(bn) || (sb && bn == "DIV" && /left|right/gi.test(dom.getStyle(sb, 'float', 1)))) { - bn = se.element; - sb = eb = null; - } - - // Setup new before and after blocks - bef = (sb && sb.nodeName == bn) ? sb.cloneNode(0) : ed.dom.create(bn); - aft = (eb && eb.nodeName == bn) ? eb.cloneNode(0) : ed.dom.create(bn); - - // Remove id from after clone - aft.removeAttribute('id'); - - // Is header and cursor is at the end, then force paragraph under - if (/^(H[1-6])$/.test(bn) && isAtEnd(r, sb)) - aft = ed.dom.create(se.element); - - // Find start chop node - n = sc = sn; - do { - if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName)) - break; - - sc = n; - } while ((n = n.previousSibling ? n.previousSibling : n.parentNode)); - - // Find end chop node - n = ec = en; - do { - if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName)) - break; - - ec = n; - } while ((n = n.nextSibling ? n.nextSibling : n.parentNode)); - - // Place first chop part into before block element - if (sc.nodeName == bn) - rb.setStart(sc, 0); - else - rb.setStartBefore(sc); - - rb.setEnd(sn, so); - bef.appendChild(rb.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari - - // Place secnd chop part within new block element - try { - ra.setEndAfter(ec); - } catch(ex) { - //console.debug(s.focusNode, s.focusOffset); - } - - ra.setStart(en, eo); - aft.appendChild(ra.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari - - // Create range around everything - r = d.createRange(); - if (!sc.previousSibling && sc.parentNode.nodeName == bn) { - r.setStartBefore(sc.parentNode); - } else { - if (rb.startContainer.nodeName == bn && rb.startOffset == 0) - r.setStartBefore(rb.startContainer); - else - r.setStart(rb.startContainer, rb.startOffset); - } - - if (!ec.nextSibling && ec.parentNode.nodeName == bn) - r.setEndAfter(ec.parentNode); - else - r.setEnd(ra.endContainer, ra.endOffset); - - // Delete and replace it with new block elements - r.deleteContents(); - - if (isOpera) - ed.getWin().scrollTo(0, vp.y); - - // Never wrap blocks in blocks - if (bef.firstChild && bef.firstChild.nodeName == bn) - bef.innerHTML = bef.firstChild.innerHTML; - - if (aft.firstChild && aft.firstChild.nodeName == bn) - aft.innerHTML = aft.firstChild.innerHTML; - - function appendStyles(e, en) { - var nl = [], nn, n, i; - - e.innerHTML = ''; - - // Make clones of style elements - if (se.keep_styles) { - n = en; - do { - // We only want style specific elements - if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(n.nodeName)) { - nn = n.cloneNode(FALSE); - dom.setAttrib(nn, 'id', ''); // Remove ID since it needs to be unique - nl.push(nn); - } - } while (n = n.parentNode); - } - - // Append style elements to aft - if (nl.length > 0) { - for (i = nl.length - 1, nn = e; i >= 0; i--) - nn = nn.appendChild(nl[i]); - - // Padd most inner style element - nl[0].innerHTML = isOpera ? '\u00a0' : '
    '; // Extra space for Opera so that the caret can move there - return nl[0]; // Move caret to most inner element - } else - e.innerHTML = isOpera ? '\u00a0' : '
    '; // Extra space for Opera so that the caret can move there - }; - - // Padd empty blocks - if (dom.isEmpty(bef)) - appendStyles(bef, sn); - - // Fill empty afterblook with current style - if (dom.isEmpty(aft)) - car = appendStyles(aft, en); - - // Opera needs this one backwards for older versions - if (isOpera && parseFloat(opera.version()) < 9.5) { - r.insertNode(bef); - r.insertNode(aft); - } else { - r.insertNode(aft); - r.insertNode(bef); - } - - // Normalize - aft.normalize(); - bef.normalize(); - - // Move cursor and scroll into view - ed.selection.select(aft, true); - ed.selection.collapse(true); - - // scrollIntoView seems to scroll the parent window in most browsers now including FF 3.0b4 so it's time to stop using it and do it our selfs - y = ed.dom.getPos(aft).y; - //ch = aft.clientHeight; - - // Is element within viewport - if (y < vp.y || y + 25 > vp.y + vp.h) { - ed.getWin().scrollTo(0, y < vp.y ? y : y - vp.h + 25); // Needs to be hardcoded to roughly one line of text if a huge text block is broken into two blocks - - /*console.debug( - 'Element: y=' + y + ', h=' + ch + ', ' + - 'Viewport: y=' + vp.y + ", h=" + vp.h + ', bottom=' + (vp.y + vp.h) - );*/ - } - - ed.undoManager.add(); - - return FALSE; - }, - - backspaceDelete : function(e, bs) { - var t = this, ed = t.editor, b = ed.getBody(), dom = ed.dom, n, se = ed.selection, r = se.getRng(), sc = r.startContainer, n, w, tn, walker; - - // Delete when caret is behind a element doesn't work correctly on Gecko see #3011651 - if (!bs && r.collapsed && sc.nodeType == 1 && r.startOffset == sc.childNodes.length) { - walker = new tinymce.dom.TreeWalker(sc.lastChild, sc); - - // Walk the dom backwards until we find a text node - for (n = sc.lastChild; n; n = walker.prev()) { - if (n.nodeType == 3) { - r.setStart(n, n.nodeValue.length); - r.collapse(true); - se.setRng(r); - return; - } - } - } - - // The caret sometimes gets stuck in Gecko if you delete empty paragraphs - // This workaround removes the element by hand and moves the caret to the previous element - if (sc && ed.dom.isBlock(sc) && !/^(TD|TH)$/.test(sc.nodeName) && bs) { - if (sc.childNodes.length == 0 || (sc.childNodes.length == 1 && sc.firstChild.nodeName == 'BR')) { - // Find previous block element - n = sc; - while ((n = n.previousSibling) && !ed.dom.isBlock(n)) ; - - if (n) { - if (sc != b.firstChild) { - // Find last text node - w = ed.dom.doc.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, FALSE); - while (tn = w.nextNode()) - n = tn; - - // Place caret at the end of last text node - r = ed.getDoc().createRange(); - r.setStart(n, n.nodeValue ? n.nodeValue.length : 0); - r.setEnd(n, n.nodeValue ? n.nodeValue.length : 0); - se.setRng(r); - - // Remove the target container - ed.dom.remove(sc); - } - - return Event.cancel(e); - } - } - } - } - }); -})(tinymce); - -(function(tinymce) { - // Shorten names - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, extend = tinymce.extend; - - tinymce.create('tinymce.ControlManager', { - ControlManager : function(ed, s) { - var t = this, i; - - s = s || {}; - t.editor = ed; - t.controls = {}; - t.onAdd = new tinymce.util.Dispatcher(t); - t.onPostRender = new tinymce.util.Dispatcher(t); - t.prefix = s.prefix || ed.id + '_'; - t._cls = {}; - - t.onPostRender.add(function() { - each(t.controls, function(c) { - c.postRender(); - }); - }); - }, - - get : function(id) { - return this.controls[this.prefix + id] || this.controls[id]; - }, - - setActive : function(id, s) { - var c = null; - - if (c = this.get(id)) - c.setActive(s); - - return c; - }, - - setDisabled : function(id, s) { - var c = null; - - if (c = this.get(id)) - c.setDisabled(s); - - return c; - }, - - add : function(c) { - var t = this; - - if (c) { - t.controls[c.id] = c; - t.onAdd.dispatch(c, t); - } - - return c; - }, - - createControl : function(n) { - var c, t = this, ed = t.editor; - - each(ed.plugins, function(p) { - if (p.createControl) { - c = p.createControl(n, t); - - if (c) - return false; - } - }); - - switch (n) { - case "|": - case "separator": - return t.createSeparator(); - } - - if (!c && ed.buttons && (c = ed.buttons[n])) - return t.createButton(n, c); - - return t.add(c); - }, - - createDropMenu : function(id, s, cc) { - var t = this, ed = t.editor, c, bm, v, cls; - - s = extend({ - 'class' : 'mceDropDown', - constrain : ed.settings.constrain_menus - }, s); - - s['class'] = s['class'] + ' ' + ed.getParam('skin') + 'Skin'; - if (v = ed.getParam('skin_variant')) - s['class'] += ' ' + ed.getParam('skin') + 'Skin' + v.substring(0, 1).toUpperCase() + v.substring(1); - - id = t.prefix + id; - cls = cc || t._cls.dropmenu || tinymce.ui.DropMenu; - c = t.controls[id] = new cls(id, s); - c.onAddItem.add(function(c, o) { - var s = o.settings; - - s.title = ed.getLang(s.title, s.title); - - if (!s.onclick) { - s.onclick = function(v) { - if (s.cmd) - ed.execCommand(s.cmd, s.ui || false, s.value); - }; - } - }); - - ed.onRemove.add(function() { - c.destroy(); - }); - - // Fix for bug #1897785, #1898007 - if (tinymce.isIE) { - c.onShowMenu.add(function() { - // IE 8 needs focus in order to store away a range with the current collapsed caret location - ed.focus(); - - bm = ed.selection.getBookmark(1); - }); - - c.onHideMenu.add(function() { - if (bm) { - ed.selection.moveToBookmark(bm); - bm = 0; - } - }); - } - - return t.add(c); - }, - - createListBox : function(id, s, cc) { - var t = this, ed = t.editor, cmd, c, cls; - - if (t.get(id)) - return null; - - s.title = ed.translate(s.title); - s.scope = s.scope || ed; - - if (!s.onselect) { - s.onselect = function(v) { - ed.execCommand(s.cmd, s.ui || false, v || s.value); - }; - } - - s = extend({ - title : s.title, - 'class' : 'mce_' + id, - scope : s.scope, - control_manager : t - }, s); - - id = t.prefix + id; - - - function useNativeListForAccessibility(ed) { - return ed.settings.use_accessible_selects && !tinymce.isGecko - } - - if (ed.settings.use_native_selects || useNativeListForAccessibility(ed)) - c = new tinymce.ui.NativeListBox(id, s); - else { - cls = cc || t._cls.listbox || tinymce.ui.ListBox; - c = new cls(id, s, ed); - } - - t.controls[id] = c; - - // Fix focus problem in Safari - if (tinymce.isWebKit) { - c.onPostRender.add(function(c, n) { - // Store bookmark on mousedown - Event.add(n, 'mousedown', function() { - ed.bookmark = ed.selection.getBookmark(1); - }); - - // Restore on focus, since it might be lost - Event.add(n, 'focus', function() { - ed.selection.moveToBookmark(ed.bookmark); - ed.bookmark = null; - }); - }); - } - - if (c.hideMenu) - ed.onMouseDown.add(c.hideMenu, c); - - return t.add(c); - }, - - createButton : function(id, s, cc) { - var t = this, ed = t.editor, o, c, cls; - - if (t.get(id)) - return null; - - s.title = ed.translate(s.title); - s.label = ed.translate(s.label); - s.scope = s.scope || ed; - - if (!s.onclick && !s.menu_button) { - s.onclick = function() { - ed.execCommand(s.cmd, s.ui || false, s.value); - }; - } - - s = extend({ - title : s.title, - 'class' : 'mce_' + id, - unavailable_prefix : ed.getLang('unavailable', ''), - scope : s.scope, - control_manager : t - }, s); - - id = t.prefix + id; - - if (s.menu_button) { - cls = cc || t._cls.menubutton || tinymce.ui.MenuButton; - c = new cls(id, s, ed); - ed.onMouseDown.add(c.hideMenu, c); - } else { - cls = t._cls.button || tinymce.ui.Button; - c = new cls(id, s, ed); - } - - return t.add(c); - }, - - createMenuButton : function(id, s, cc) { - s = s || {}; - s.menu_button = 1; - - return this.createButton(id, s, cc); - }, - - createSplitButton : function(id, s, cc) { - var t = this, ed = t.editor, cmd, c, cls; - - if (t.get(id)) - return null; - - s.title = ed.translate(s.title); - s.scope = s.scope || ed; - - if (!s.onclick) { - s.onclick = function(v) { - ed.execCommand(s.cmd, s.ui || false, v || s.value); - }; - } - - if (!s.onselect) { - s.onselect = function(v) { - ed.execCommand(s.cmd, s.ui || false, v || s.value); - }; - } - - s = extend({ - title : s.title, - 'class' : 'mce_' + id, - scope : s.scope, - control_manager : t - }, s); - - id = t.prefix + id; - cls = cc || t._cls.splitbutton || tinymce.ui.SplitButton; - c = t.add(new cls(id, s, ed)); - ed.onMouseDown.add(c.hideMenu, c); - - return c; - }, - - createColorSplitButton : function(id, s, cc) { - var t = this, ed = t.editor, cmd, c, cls, bm; - - if (t.get(id)) - return null; - - s.title = ed.translate(s.title); - s.scope = s.scope || ed; - - if (!s.onclick) { - s.onclick = function(v) { - if (tinymce.isIE) - bm = ed.selection.getBookmark(1); - - ed.execCommand(s.cmd, s.ui || false, v || s.value); - }; - } - - if (!s.onselect) { - s.onselect = function(v) { - ed.execCommand(s.cmd, s.ui || false, v || s.value); - }; - } - - s = extend({ - title : s.title, - 'class' : 'mce_' + id, - 'menu_class' : ed.getParam('skin') + 'Skin', - scope : s.scope, - more_colors_title : ed.getLang('more_colors') - }, s); - - id = t.prefix + id; - cls = cc || t._cls.colorsplitbutton || tinymce.ui.ColorSplitButton; - c = new cls(id, s, ed); - ed.onMouseDown.add(c.hideMenu, c); - - // Remove the menu element when the editor is removed - ed.onRemove.add(function() { - c.destroy(); - }); - - // Fix for bug #1897785, #1898007 - if (tinymce.isIE) { - c.onShowMenu.add(function() { - // IE 8 needs focus in order to store away a range with the current collapsed caret location - ed.focus(); - bm = ed.selection.getBookmark(1); - }); - - c.onHideMenu.add(function() { - if (bm) { - ed.selection.moveToBookmark(bm); - bm = 0; - } - }); - } - - return t.add(c); - }, - - createToolbar : function(id, s, cc) { - var c, t = this, cls; - - id = t.prefix + id; - cls = cc || t._cls.toolbar || tinymce.ui.Toolbar; - c = new cls(id, s, t.editor); - - if (t.get(id)) - return null; - - return t.add(c); - }, - - createToolbarGroup : function(id, s, cc) { - var c, t = this, cls; - id = t.prefix + id; - cls = cc || this._cls.toolbarGroup || tinymce.ui.ToolbarGroup; - c = new cls(id, s, t.editor); - - if (t.get(id)) - return null; - - return t.add(c); - }, - - createSeparator : function(cc) { - var cls = cc || this._cls.separator || tinymce.ui.Separator; - - return new cls(); - }, - - setControlType : function(n, c) { - return this._cls[n.toLowerCase()] = c; - }, - - destroy : function() { - each(this.controls, function(c) { - c.destroy(); - }); - - this.controls = null; - } - }); -})(tinymce); - -(function(tinymce) { - var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isIE = tinymce.isIE, isOpera = tinymce.isOpera; - - tinymce.create('tinymce.WindowManager', { - WindowManager : function(ed) { - var t = this; - - t.editor = ed; - t.onOpen = new Dispatcher(t); - t.onClose = new Dispatcher(t); - t.params = {}; - t.features = {}; - }, - - open : function(s, p) { - var t = this, f = '', x, y, mo = t.editor.settings.dialog_type == 'modal', w, sw, sh, vp = tinymce.DOM.getViewPort(), u; - - // Default some options - s = s || {}; - p = p || {}; - sw = isOpera ? vp.w : screen.width; // Opera uses windows inside the Opera window - sh = isOpera ? vp.h : screen.height; - s.name = s.name || 'mc_' + new Date().getTime(); - s.width = parseInt(s.width || 320); - s.height = parseInt(s.height || 240); - s.resizable = true; - s.left = s.left || parseInt(sw / 2.0) - (s.width / 2.0); - s.top = s.top || parseInt(sh / 2.0) - (s.height / 2.0); - p.inline = false; - p.mce_width = s.width; - p.mce_height = s.height; - p.mce_auto_focus = s.auto_focus; - - if (mo) { - if (isIE) { - s.center = true; - s.help = false; - s.dialogWidth = s.width + 'px'; - s.dialogHeight = s.height + 'px'; - s.scroll = s.scrollbars || false; - } - } - - // Build features string - each(s, function(v, k) { - if (tinymce.is(v, 'boolean')) - v = v ? 'yes' : 'no'; - - if (!/^(name|url)$/.test(k)) { - if (isIE && mo) - f += (f ? ';' : '') + k + ':' + v; - else - f += (f ? ',' : '') + k + '=' + v; - } - }); - - t.features = s; - t.params = p; - t.onOpen.dispatch(t, s, p); - - u = s.url || s.file; - u = tinymce._addVer(u); - - try { - if (isIE && mo) { - w = 1; - window.showModalDialog(u, window, f); - } else - w = window.open(u, s.name, f); - } catch (ex) { - // Ignore - } - - if (!w) - alert(t.editor.getLang('popup_blocked')); - }, - - close : function(w) { - w.close(); - this.onClose.dispatch(this); - }, - - createInstance : function(cl, a, b, c, d, e) { - var f = tinymce.resolve(cl); - - return new f(a, b, c, d, e); - }, - - confirm : function(t, cb, s, w) { - w = w || window; - - cb.call(s || this, w.confirm(this._decode(this.editor.getLang(t, t)))); - }, - - alert : function(tx, cb, s, w) { - var t = this; - - w = w || window; - w.alert(t._decode(t.editor.getLang(tx, tx))); - - if (cb) - cb.call(s || t); - }, - - resizeBy : function(dw, dh, win) { - win.resizeBy(dw, dh); - }, - - // Internal functions - - _decode : function(s) { - return tinymce.DOM.decode(s).replace(/\\n/g, '\n'); - } - }); -}(tinymce)); -(function(tinymce) { - tinymce.Formatter = function(ed) { - var formats = {}, - each = tinymce.each, - dom = ed.dom, - selection = ed.selection, - TreeWalker = tinymce.dom.TreeWalker, - rangeUtils = new tinymce.dom.RangeUtils(dom), - isValid = ed.schema.isValidChild, - isBlock = dom.isBlock, - forcedRootBlock = ed.settings.forced_root_block, - nodeIndex = dom.nodeIndex, - INVISIBLE_CHAR = '\uFEFF', - MCE_ATTR_RE = /^(src|href|style)$/, - FALSE = false, - TRUE = true, - undefined; - - function isArray(obj) { - return obj instanceof Array; - }; - - function getParents(node, selector) { - return dom.getParents(node, selector, dom.getRoot()); - }; - - function isCaretNode(node) { - return node.nodeType === 1 && (node.face === 'mceinline' || node.style.fontFamily === 'mceinline'); - }; - - // Public functions - - function get(name) { - return name ? formats[name] : formats; - }; - - function register(name, format) { - if (name) { - if (typeof(name) !== 'string') { - each(name, function(format, name) { - register(name, format); - }); - } else { - // Force format into array and add it to internal collection - format = format.length ? format : [format]; - - each(format, function(format) { - // Set deep to false by default on selector formats this to avoid removing - // alignment on images inside paragraphs when alignment is changed on paragraphs - if (format.deep === undefined) - format.deep = !format.selector; - - // Default to true - if (format.split === undefined) - format.split = !format.selector || format.inline; - - // Default to true - if (format.remove === undefined && format.selector && !format.inline) - format.remove = 'none'; - - // Mark format as a mixed format inline + block level - if (format.selector && format.inline) { - format.mixed = true; - format.block_expand = true; - } - - // Split classes if needed - if (typeof(format.classes) === 'string') - format.classes = format.classes.split(/\s+/); - }); - - formats[name] = format; - } - } - }; - - var getTextDecoration = function(node) { - var decoration; - - ed.dom.getParent(node, function(n) { - decoration = ed.dom.getStyle(n, 'text-decoration'); - return decoration && decoration !== 'none'; - }); - - return decoration; - }; - - var processUnderlineAndColor = function(node) { - var textDecoration; - if (node.nodeType === 1 && node.parentNode && node.parentNode.nodeType === 1) { - textDecoration = getTextDecoration(node.parentNode); - if (ed.dom.getStyle(node, 'color') && textDecoration) { - ed.dom.setStyle(node, 'text-decoration', textDecoration); - } else if (ed.dom.getStyle(node, 'textdecoration') === textDecoration) { - ed.dom.setStyle(node, 'text-decoration', null); - } - } - }; - - function apply(name, vars, node) { - var formatList = get(name), format = formatList[0], bookmark, rng, i, isCollapsed = selection.isCollapsed(); - - function moveStart(rng) { - var container = rng.startContainer, - offset = rng.startOffset, - walker, node; - - // Move startContainer/startOffset in to a suitable node - if (container.nodeType == 1 || container.nodeValue === "") { - container = container.nodeType == 1 ? container.childNodes[offset] : container; - - // Might fail if the offset is behind the last element in it's container - if (container) { - walker = new TreeWalker(container, container.parentNode); - for (node = walker.current(); node; node = walker.next()) { - if (node.nodeType == 3 && !isWhiteSpaceNode(node)) { - rng.setStart(node, 0); - break; - } - } - } - } - - return rng; - }; - - function setElementFormat(elm, fmt) { - fmt = fmt || format; - - if (elm) { - if (fmt.onformat) { - fmt.onformat(elm, fmt, vars, node); - } - - each(fmt.styles, function(value, name) { - dom.setStyle(elm, name, replaceVars(value, vars)); - }); - - each(fmt.attributes, function(value, name) { - dom.setAttrib(elm, name, replaceVars(value, vars)); - }); - - each(fmt.classes, function(value) { - value = replaceVars(value, vars); - - if (!dom.hasClass(elm, value)) - dom.addClass(elm, value); - }); - } - }; - function adjustSelectionToVisibleSelection() { - function findSelectionEnd(start, end) { - var walker = new TreeWalker(end); - for (node = walker.current(); node; node = walker.prev()) { - if (node.childNodes.length > 1 || node == start) { - return node; - } - } - }; - - // Adjust selection so that a end container with a end offset of zero is not included in the selection - // as this isn't visible to the user. - var rng = ed.selection.getRng(); - var start = rng.startContainer; - var end = rng.endContainer; - - if (start != end && rng.endOffset == 0) { - var newEnd = findSelectionEnd(start, end); - var endOffset = newEnd.nodeType == 3 ? newEnd.length : newEnd.childNodes.length; - - rng.setEnd(newEnd, endOffset); - } - - return rng; - } - - function applyStyleToList(node, bookmark, wrapElm, newWrappers, process){ - var nodes = [], listIndex = -1, list, startIndex = -1, endIndex = -1, currentWrapElm; - - // find the index of the first child list. - each(node.childNodes, function(n, index) { - if (n.nodeName === "UL" || n.nodeName === "OL") { - listIndex = index; - list = n; - return false; - } - }); - - // get the index of the bookmarks - each(node.childNodes, function(n, index) { - if (n.nodeName === "SPAN" && dom.getAttrib(n, "data-mce-type") == "bookmark") { - if (n.id == bookmark.id + "_start") { - startIndex = index; - } else if (n.id == bookmark.id + "_end") { - endIndex = index; - } - } - }); - - // if the selection spans across an embedded list, or there isn't an embedded list - handle processing normally - if (listIndex <= 0 || (startIndex < listIndex && endIndex > listIndex)) { - each(tinymce.grep(node.childNodes), process); - return 0; - } else { - currentWrapElm = wrapElm.cloneNode(FALSE); - - // create a list of the nodes on the same side of the list as the selection - each(tinymce.grep(node.childNodes), function(n, index) { - if ((startIndex < listIndex && index < listIndex) || (startIndex > listIndex && index > listIndex)) { - nodes.push(n); - n.parentNode.removeChild(n); - } - }); - - // insert the wrapping element either before or after the list. - if (startIndex < listIndex) { - node.insertBefore(currentWrapElm, list); - } else if (startIndex > listIndex) { - node.insertBefore(currentWrapElm, list.nextSibling); - } - - // add the new nodes to the list. - newWrappers.push(currentWrapElm); - - each(nodes, function(node) { - currentWrapElm.appendChild(node); - }); - - return currentWrapElm; - } - }; - - function applyRngStyle(rng, bookmark, node_specific) { - var newWrappers = [], wrapName, wrapElm; - - // Setup wrapper element - wrapName = format.inline || format.block; - wrapElm = dom.create(wrapName); - setElementFormat(wrapElm); - - rangeUtils.walk(rng, function(nodes) { - var currentWrapElm; - - function process(node) { - var nodeName = node.nodeName.toLowerCase(), parentName = node.parentNode.nodeName.toLowerCase(), found; - - // Stop wrapping on br elements - if (isEq(nodeName, 'br')) { - currentWrapElm = 0; - - // Remove any br elements when we wrap things - if (format.block) - dom.remove(node); - - return; - } - - // If node is wrapper type - if (format.wrapper && matchNode(node, name, vars)) { - currentWrapElm = 0; - return; - } - - // Can we rename the block - if (format.block && !format.wrapper && isTextBlock(nodeName)) { - node = dom.rename(node, wrapName); - setElementFormat(node); - newWrappers.push(node); - currentWrapElm = 0; - return; - } - - // Handle selector patterns - if (format.selector) { - // Look for matching formats - each(formatList, function(format) { - // Check collapsed state if it exists - if ('collapsed' in format && format.collapsed !== isCollapsed) { - return; - } - - if (dom.is(node, format.selector) && !isCaretNode(node)) { - setElementFormat(node, format); - found = true; - } - }); - - // Continue processing if a selector match wasn't found and a inline element is defined - if (!format.inline || found) { - currentWrapElm = 0; - return; - } - } - - // Is it valid to wrap this item - if (isValid(wrapName, nodeName) && isValid(parentName, wrapName) && - !(!node_specific && node.nodeType === 3 && node.nodeValue.length === 1 && node.nodeValue.charCodeAt(0) === 65279) && node.id !== '_mce_caret') { - // Start wrapping - if (!currentWrapElm) { - // Wrap the node - currentWrapElm = wrapElm.cloneNode(FALSE); - node.parentNode.insertBefore(currentWrapElm, node); - newWrappers.push(currentWrapElm); - } - - currentWrapElm.appendChild(node); - } else if (nodeName == 'li' && bookmark) { - // Start wrapping - if we are in a list node and have a bookmark, then we will always begin by wrapping in a new element. - currentWrapElm = applyStyleToList(node, bookmark, wrapElm, newWrappers, process); - } else { - // Start a new wrapper for possible children - currentWrapElm = 0; - - each(tinymce.grep(node.childNodes), process); - - // End the last wrapper - currentWrapElm = 0; - } - }; - - // Process siblings from range - each(nodes, process); - }); - - // Wrap links inside as well, for example color inside a link when the wrapper is around the link - if (format.wrap_links === false) { - each(newWrappers, function(node) { - function process(node) { - var i, currentWrapElm, children; - - if (node.nodeName === 'A') { - currentWrapElm = wrapElm.cloneNode(FALSE); - newWrappers.push(currentWrapElm); - - children = tinymce.grep(node.childNodes); - for (i = 0; i < children.length; i++) - currentWrapElm.appendChild(children[i]); - - node.appendChild(currentWrapElm); - } - - each(tinymce.grep(node.childNodes), process); - }; - - process(node); - }); - } - - // Cleanup - each(newWrappers, function(node) { - var childCount; - - function getChildCount(node) { - var count = 0; - - each(node.childNodes, function(node) { - if (!isWhiteSpaceNode(node) && !isBookmarkNode(node)) - count++; - }); - - return count; - }; - - function mergeStyles(node) { - var child, clone; - - each(node.childNodes, function(node) { - if (node.nodeType == 1 && !isBookmarkNode(node) && !isCaretNode(node)) { - child = node; - return FALSE; // break loop - } - }); - - // If child was found and of the same type as the current node - if (child && matchName(child, format)) { - clone = child.cloneNode(FALSE); - setElementFormat(clone); - - dom.replace(clone, node, TRUE); - dom.remove(child, 1); - } - - return clone || node; - }; - - childCount = getChildCount(node); - - // Remove empty nodes but only if there is multiple wrappers and they are not block - // elements so never remove single

    since that would remove the current empty block element where the caret is at - if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) { - dom.remove(node, 1); - return; - } - - if (format.inline || format.wrapper) { - // Merges the current node with it's children of similar type to reduce the number of elements - if (!format.exact && childCount === 1) - node = mergeStyles(node); - - // Remove/merge children - each(formatList, function(format) { - // Merge all children of similar type will move styles from child to parent - // this: text - // will become: text - each(dom.select(format.inline, node), function(child) { - var parent; - - // When wrap_links is set to false we don't want - // to remove the format on children within links - if (format.wrap_links === false) { - parent = child.parentNode; - - do { - if (parent.nodeName === 'A') - return; - } while (parent = parent.parentNode); - } - - removeFormat(format, vars, child, format.exact ? child : null); - }); - }); - - // Remove child if direct parent is of same type - if (matchNode(node.parentNode, name, vars)) { - dom.remove(node, 1); - node = 0; - return TRUE; - } - - // Look for parent with similar style format - if (format.merge_with_parents) { - dom.getParent(node.parentNode, function(parent) { - if (matchNode(parent, name, vars)) { - dom.remove(node, 1); - node = 0; - return TRUE; - } - }); - } - - // Merge next and previous siblings if they are similar texttext becomes texttext - if (node && format.merge_siblings !== false) { - node = mergeSiblings(getNonWhiteSpaceSibling(node), node); - node = mergeSiblings(node, getNonWhiteSpaceSibling(node, TRUE)); - } - } - }); - }; - - if (format) { - if (node) { - if (node.nodeType) { - rng = dom.createRng(); - rng.setStartBefore(node); - rng.setEndAfter(node); - applyRngStyle(expandRng(rng, formatList), null, true); - } else { - applyRngStyle(node, null, true); - } - } else { - if (!isCollapsed || !format.inline || dom.select('td.mceSelected,th.mceSelected').length) { - // Obtain selection node before selection is unselected by applyRngStyle() - var curSelNode = ed.selection.getNode(); - - // Apply formatting to selection - ed.selection.setRng(adjustSelectionToVisibleSelection()); - bookmark = selection.getBookmark(); - applyRngStyle(expandRng(selection.getRng(TRUE), formatList), bookmark); - - // Colored nodes should be underlined so that the color of the underline matches the text color. - if (format.styles && (format.styles.color || format.styles.textDecoration)) { - tinymce.walk(curSelNode, processUnderlineAndColor, 'childNodes'); - processUnderlineAndColor(curSelNode); - } - - selection.moveToBookmark(bookmark); - selection.setRng(moveStart(selection.getRng(TRUE))); - ed.nodeChanged(); - } else - performCaretAction('apply', name, vars); - } - } - }; - - function remove(name, vars, node) { - var formatList = get(name), format = formatList[0], bookmark, i, rng; - function moveStart(rng) { - var container = rng.startContainer, - offset = rng.startOffset, - walker, node, nodes, tmpNode; - - // Convert text node into index if possible - if (container.nodeType == 3 && offset >= container.nodeValue.length - 1) { - container = container.parentNode; - offset = nodeIndex(container) + 1; - } - - // Move startContainer/startOffset in to a suitable node - if (container.nodeType == 1) { - nodes = container.childNodes; - container = nodes[Math.min(offset, nodes.length - 1)]; - walker = new TreeWalker(container); - - // If offset is at end of the parent node walk to the next one - if (offset > nodes.length - 1) - walker.next(); - - for (node = walker.current(); node; node = walker.next()) { - if (node.nodeType == 3 && !isWhiteSpaceNode(node)) { - // IE has a "neat" feature where it moves the start node into the closest element - // we can avoid this by inserting an element before it and then remove it after we set the selection - tmpNode = dom.create('a', null, INVISIBLE_CHAR); - node.parentNode.insertBefore(tmpNode, node); - - // Set selection and remove tmpNode - rng.setStart(node, 0); - selection.setRng(rng); - dom.remove(tmpNode); - - return; - } - } - } - }; - - // Merges the styles for each node - function process(node) { - var children, i, l; - - // Grab the children first since the nodelist might be changed - children = tinymce.grep(node.childNodes); - - // Process current node - for (i = 0, l = formatList.length; i < l; i++) { - if (removeFormat(formatList[i], vars, node, node)) - break; - } - - // Process the children - if (format.deep) { - for (i = 0, l = children.length; i < l; i++) - process(children[i]); - } - }; - - function findFormatRoot(container) { - var formatRoot; - - // Find format root - each(getParents(container.parentNode).reverse(), function(parent) { - var format; - - // Find format root element - if (!formatRoot && parent.id != '_start' && parent.id != '_end') { - // Is the node matching the format we are looking for - format = matchNode(parent, name, vars); - if (format && format.split !== false) - formatRoot = parent; - } - }); - - return formatRoot; - }; - - function wrapAndSplit(format_root, container, target, split) { - var parent, clone, lastClone, firstClone, i, formatRootParent; - - // Format root found then clone formats and split it - if (format_root) { - formatRootParent = format_root.parentNode; - - for (parent = container.parentNode; parent && parent != formatRootParent; parent = parent.parentNode) { - clone = parent.cloneNode(FALSE); - - for (i = 0; i < formatList.length; i++) { - if (removeFormat(formatList[i], vars, clone, clone)) { - clone = 0; - break; - } - } - - // Build wrapper node - if (clone) { - if (lastClone) - clone.appendChild(lastClone); - - if (!firstClone) - firstClone = clone; - - lastClone = clone; - } - } - - // Never split block elements if the format is mixed - if (split && (!format.mixed || !isBlock(format_root))) - container = dom.split(format_root, container); - - // Wrap container in cloned formats - if (lastClone) { - target.parentNode.insertBefore(lastClone, target); - firstClone.appendChild(target); - } - } - - return container; - }; - - function splitToFormatRoot(container) { - return wrapAndSplit(findFormatRoot(container), container, container, true); - }; - - function unwrap(start) { - var node = dom.get(start ? '_start' : '_end'), - out = node[start ? 'firstChild' : 'lastChild']; - - // If the end is placed within the start the result will be removed - // So this checks if the out node is a bookmark node if it is it - // checks for another more suitable node - if (isBookmarkNode(out)) - out = out[start ? 'firstChild' : 'lastChild']; - - dom.remove(node, true); - - return out; - }; - - function removeRngStyle(rng) { - var startContainer, endContainer; - - rng = expandRng(rng, formatList, TRUE); - - if (format.split) { - startContainer = getContainer(rng, TRUE); - endContainer = getContainer(rng); - - if (startContainer != endContainer) { - // Wrap start/end nodes in span element since these might be cloned/moved - startContainer = wrap(startContainer, 'span', {id : '_start', 'data-mce-type' : 'bookmark'}); - endContainer = wrap(endContainer, 'span', {id : '_end', 'data-mce-type' : 'bookmark'}); - - // Split start/end - splitToFormatRoot(startContainer); - splitToFormatRoot(endContainer); - - // Unwrap start/end to get real elements again - startContainer = unwrap(TRUE); - endContainer = unwrap(); - } else - startContainer = endContainer = splitToFormatRoot(startContainer); - - // Update range positions since they might have changed after the split operations - rng.startContainer = startContainer.parentNode; - rng.startOffset = nodeIndex(startContainer); - rng.endContainer = endContainer.parentNode; - rng.endOffset = nodeIndex(endContainer) + 1; - } - - // Remove items between start/end - rangeUtils.walk(rng, function(nodes) { - each(nodes, function(node) { - process(node); - - // Remove parent span if it only contains text-decoration: underline, yet a parent node is also underlined. - if (node.nodeType === 1 && ed.dom.getStyle(node, 'text-decoration') === 'underline' && node.parentNode && getTextDecoration(node.parentNode) === 'underline') { - removeFormat({'deep': false, 'exact': true, 'inline': 'span', 'styles': {'textDecoration' : 'underline'}}, null, node); - } - }); - }); - }; - - // Handle node - if (node) { - if (node.nodeType) { - rng = dom.createRng(); - rng.setStartBefore(node); - rng.setEndAfter(node); - removeRngStyle(rng); - } else { - removeRngStyle(node); - } - - return; - } - - if (!selection.isCollapsed() || !format.inline || dom.select('td.mceSelected,th.mceSelected').length) { - bookmark = selection.getBookmark(); - removeRngStyle(selection.getRng(TRUE)); - selection.moveToBookmark(bookmark); - - // Check if start element still has formatting then we are at: "text|text" and need to move the start into the next text node - if (format.inline && match(name, vars, selection.getStart())) { - moveStart(selection.getRng(true)); - } - - ed.nodeChanged(); - } else - performCaretAction('remove', name, vars); - - // When you remove formatting from a table cell in WebKit (cell, not the contents of a cell) there is a rendering issue with column width - if (tinymce.isWebKit) { - ed.execCommand('mceCleanup'); - } - }; - - function toggle(name, vars, node) { - var fmt = get(name); - - if (match(name, vars, node) && (!('toggle' in fmt[0]) || fmt[0]['toggle'])) - remove(name, vars, node); - else - apply(name, vars, node); - }; - - function matchNode(node, name, vars, similar) { - var formatList = get(name), format, i, classes; - - function matchItems(node, format, item_name) { - var key, value, items = format[item_name], i; - - // Custom match - if (format.onmatch) { - return format.onmatch(node, format, item_name); - } - - // Check all items - if (items) { - // Non indexed object - if (items.length === undefined) { - for (key in items) { - if (items.hasOwnProperty(key)) { - if (item_name === 'attributes') - value = dom.getAttrib(node, key); - else - value = getStyle(node, key); - - if (similar && !value && !format.exact) - return; - - if ((!similar || format.exact) && !isEq(value, replaceVars(items[key], vars))) - return; - } - } - } else { - // Only one match needed for indexed arrays - for (i = 0; i < items.length; i++) { - if (item_name === 'attributes' ? dom.getAttrib(node, items[i]) : getStyle(node, items[i])) - return format; - } - } - } - - return format; - }; - - if (formatList && node) { - // Check each format in list - for (i = 0; i < formatList.length; i++) { - format = formatList[i]; - - // Name name, attributes, styles and classes - if (matchName(node, format) && matchItems(node, format, 'attributes') && matchItems(node, format, 'styles')) { - // Match classes - if (classes = format.classes) { - for (i = 0; i < classes.length; i++) { - if (!dom.hasClass(node, classes[i])) - return; - } - } - - return format; - } - } - } - }; - - function match(name, vars, node) { - var startNode; - - function matchParents(node) { - // Find first node with similar format settings - node = dom.getParent(node, function(node) { - return !!matchNode(node, name, vars, true); - }); - - // Do an exact check on the similar format element - return matchNode(node, name, vars); - }; - - // Check specified node - if (node) - return matchParents(node); - - // Check selected node - node = selection.getNode(); - if (matchParents(node)) - return TRUE; - - // Check start node if it's different - startNode = selection.getStart(); - if (startNode != node) { - if (matchParents(startNode)) - return TRUE; - } - - return FALSE; - }; - - function matchAll(names, vars) { - var startElement, matchedFormatNames = [], checkedMap = {}, i, ni, name; - - // Check start of selection for formats - startElement = selection.getStart(); - dom.getParent(startElement, function(node) { - var i, name; - - for (i = 0; i < names.length; i++) { - name = names[i]; - - if (!checkedMap[name] && matchNode(node, name, vars)) { - checkedMap[name] = true; - matchedFormatNames.push(name); - } - } - }); - - return matchedFormatNames; - }; - - function canApply(name) { - var formatList = get(name), startNode, parents, i, x, selector; - - if (formatList) { - startNode = selection.getStart(); - parents = getParents(startNode); - - for (x = formatList.length - 1; x >= 0; x--) { - selector = formatList[x].selector; - - // Format is not selector based, then always return TRUE - if (!selector) - return TRUE; - - for (i = parents.length - 1; i >= 0; i--) { - if (dom.is(parents[i], selector)) - return TRUE; - } - } - } - - return FALSE; - }; - - // Expose to public - tinymce.extend(this, { - get : get, - register : register, - apply : apply, - remove : remove, - toggle : toggle, - match : match, - matchAll : matchAll, - matchNode : matchNode, - canApply : canApply - }); - - // Private functions - - function matchName(node, format) { - // Check for inline match - if (isEq(node, format.inline)) - return TRUE; - - // Check for block match - if (isEq(node, format.block)) - return TRUE; - - // Check for selector match - if (format.selector) - return dom.is(node, format.selector); - }; - - function isEq(str1, str2) { - str1 = str1 || ''; - str2 = str2 || ''; - - str1 = '' + (str1.nodeName || str1); - str2 = '' + (str2.nodeName || str2); - - return str1.toLowerCase() == str2.toLowerCase(); - }; - - function getStyle(node, name) { - var styleVal = dom.getStyle(node, name); - - // Force the format to hex - if (name == 'color' || name == 'backgroundColor') - styleVal = dom.toHex(styleVal); - - // Opera will return bold as 700 - if (name == 'fontWeight' && styleVal == 700) - styleVal = 'bold'; - - return '' + styleVal; - }; - - function replaceVars(value, vars) { - if (typeof(value) != "string") - value = value(vars); - else if (vars) { - value = value.replace(/%(\w+)/g, function(str, name) { - return vars[name] || str; - }); - } - - return value; - }; - - function isWhiteSpaceNode(node) { - return node && node.nodeType === 3 && /^([\t \r\n]+|)$/.test(node.nodeValue); - }; - - function wrap(node, name, attrs) { - var wrapper = dom.create(name, attrs); - - node.parentNode.insertBefore(wrapper, node); - wrapper.appendChild(node); - - return wrapper; - }; - - function expandRng(rng, format, remove) { - var startContainer = rng.startContainer, - startOffset = rng.startOffset, - endContainer = rng.endContainer, - endOffset = rng.endOffset, sibling, lastIdx, leaf, endPoint; - - // This function walks up the tree if there is no siblings before/after the node - function findParentContainer(start) { - var container, parent, child, sibling, siblingName; - - container = parent = start ? startContainer : endContainer; - siblingName = start ? 'previousSibling' : 'nextSibling'; - root = dom.getRoot(); - - // If it's a text node and the offset is inside the text - if (container.nodeType == 3 && !isWhiteSpaceNode(container)) { - if (start ? startOffset > 0 : endOffset < container.nodeValue.length) { - return container; - } - } - - for (;;) { - // Stop expanding on block elements or root depending on format - if (parent == root || (!format[0].block_expand && isBlock(parent))) - return parent; - - // Walk left/right - for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) { - if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling)) { - return parent; - } - } - - // Check if we can move up are we at root level or body level - parent = parent.parentNode; - } - - return container; - }; - - // This function walks down the tree to find the leaf at the selection. - // The offset is also returned as if node initially a leaf, the offset may be in the middle of the text node. - function findLeaf(node, offset) { - if (offset === undefined) - offset = node.nodeType === 3 ? node.length : node.childNodes.length; - while (node && node.hasChildNodes()) { - node = node.childNodes[offset]; - if (node) - offset = node.nodeType === 3 ? node.length : node.childNodes.length; - } - return { node: node, offset: offset }; - } - - // If index based start position then resolve it - if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) { - lastIdx = startContainer.childNodes.length - 1; - startContainer = startContainer.childNodes[startOffset > lastIdx ? lastIdx : startOffset]; - - if (startContainer.nodeType == 3) - startOffset = 0; - } - - // If index based end position then resolve it - if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) { - lastIdx = endContainer.childNodes.length - 1; - endContainer = endContainer.childNodes[endOffset > lastIdx ? lastIdx : endOffset - 1]; - - if (endContainer.nodeType == 3) - endOffset = endContainer.nodeValue.length; - } - - // Exclude bookmark nodes if possible - if (isBookmarkNode(startContainer.parentNode) || isBookmarkNode(startContainer)) { - startContainer = isBookmarkNode(startContainer) ? startContainer : startContainer.parentNode; - startContainer = startContainer.nextSibling || startContainer; - - if (startContainer.nodeType == 3) - startOffset = 0; - } - - if (isBookmarkNode(endContainer.parentNode) || isBookmarkNode(endContainer)) { - endContainer = isBookmarkNode(endContainer) ? endContainer : endContainer.parentNode; - endContainer = endContainer.previousSibling || endContainer; - - if (endContainer.nodeType == 3) - endOffset = endContainer.length; - } - - if (format[0].inline) { - if (rng.collapsed) { - function findWordEndPoint(container, offset, start) { - var walker, node, pos, lastTextNode; - - function findSpace(node, offset) { - var pos, pos2, str = node.nodeValue; - - if (typeof(offset) == "undefined") { - offset = start ? str.length : 0; - } - - if (start) { - pos = str.lastIndexOf(' ', offset); - pos2 = str.lastIndexOf('\u00a0', offset); - pos = pos > pos2 ? pos : pos2; - - // Include the space on remove to avoid tag soup - if (pos !== -1 && !remove) { - pos++; - } - } else { - pos = str.indexOf(' ', offset); - pos2 = str.indexOf('\u00a0', offset); - pos = pos !== -1 && (pos2 === -1 || pos < pos2) ? pos : pos2; - } - - return pos; - }; - - if (container.nodeType === 3) { - pos = findSpace(container, offset); - - if (pos !== -1) { - return {container : container, offset : pos}; - } - - lastTextNode = container; - } - - // Walk the nodes inside the block - walker = new TreeWalker(container, dom.getParent(container, isBlock) || ed.getBody()); - while (node = walker[start ? 'prev' : 'next']()) { - if (node.nodeType === 3) { - lastTextNode = node; - pos = findSpace(node); - - if (pos !== -1) { - return {container : node, offset : pos}; - } - } else if (isBlock(node)) { - break; - } - } - - if (lastTextNode) { - if (start) { - offset = 0; - } else { - offset = lastTextNode.length; - } - - return {container: lastTextNode, offset: offset}; - } - } - - // Expand left to closest word boundery - endPoint = findWordEndPoint(startContainer, startOffset, true); - if (endPoint) { - startContainer = endPoint.container; - startOffset = endPoint.offset; - } - - // Expand right to closest word boundery - endPoint = findWordEndPoint(endContainer, endOffset); - if (endPoint) { - endContainer = endPoint.container; - endOffset = endPoint.offset; - } - } - - // Avoid applying formatting to a trailing space. - leaf = findLeaf(endContainer, endOffset); - if (leaf.node) { - while (leaf.node && leaf.offset === 0 && leaf.node.previousSibling) - leaf = findLeaf(leaf.node.previousSibling); - - if (leaf.node && leaf.offset > 0 && leaf.node.nodeType === 3 && - leaf.node.nodeValue.charAt(leaf.offset - 1) === ' ') { - - if (leaf.offset > 1) { - endContainer = leaf.node; - endContainer.splitText(leaf.offset - 1); - } else if (leaf.node.previousSibling) { - // TODO: Figure out why this is in here - //endContainer = leaf.node.previousSibling; - } - } - } - } - - // Move start/end point up the tree if the leaves are sharp and if we are in different containers - // Example * becomes !: !

    *texttext*

    ! - // This will reduce the number of wrapper elements that needs to be created - // Move start point up the tree - if (format[0].inline || format[0].block_expand) { - if (!format[0].inline || (startContainer.nodeType != 3 || startOffset === 0)) { - startContainer = findParentContainer(true); - } - - if (!format[0].inline || (endContainer.nodeType != 3 || endOffset === endContainer.nodeValue.length)) { - endContainer = findParentContainer(); - } - } - - // Expand start/end container to matching selector - if (format[0].selector && format[0].expand !== FALSE && !format[0].inline) { - function findSelectorEndPoint(container, sibling_name) { - var parents, i, y, curFormat; - - if (container.nodeType == 3 && container.nodeValue.length == 0 && container[sibling_name]) - container = container[sibling_name]; - - parents = getParents(container); - for (i = 0; i < parents.length; i++) { - for (y = 0; y < format.length; y++) { - curFormat = format[y]; - - // If collapsed state is set then skip formats that doesn't match that - if ("collapsed" in curFormat && curFormat.collapsed !== rng.collapsed) - continue; - - if (dom.is(parents[i], curFormat.selector)) - return parents[i]; - } - } - - return container; - }; - - // Find new startContainer/endContainer if there is better one - startContainer = findSelectorEndPoint(startContainer, 'previousSibling'); - endContainer = findSelectorEndPoint(endContainer, 'nextSibling'); - } - - // Expand start/end container to matching block element or text node - if (format[0].block || format[0].selector) { - function findBlockEndPoint(container, sibling_name, sibling_name2) { - var node; - - // Expand to block of similar type - if (!format[0].wrapper) - node = dom.getParent(container, format[0].block); - - // Expand to first wrappable block element or any block element - if (!node) - node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, isBlock); - - // Exclude inner lists from wrapping - if (node && format[0].wrapper) - node = getParents(node, 'ul,ol').reverse()[0] || node; - - // Didn't find a block element look for first/last wrappable element - if (!node) { - node = container; - - while (node[sibling_name] && !isBlock(node[sibling_name])) { - node = node[sibling_name]; - - // Break on BR but include it will be removed later on - // we can't remove it now since we need to check if it can be wrapped - if (isEq(node, 'br')) - break; - } - } - - return node || container; - }; - - // Find new startContainer/endContainer if there is better one - startContainer = findBlockEndPoint(startContainer, 'previousSibling'); - endContainer = findBlockEndPoint(endContainer, 'nextSibling'); - - // Non block element then try to expand up the leaf - if (format[0].block) { - if (!isBlock(startContainer)) - startContainer = findParentContainer(true); - - if (!isBlock(endContainer)) - endContainer = findParentContainer(); - } - } - - // Setup index for startContainer - if (startContainer.nodeType == 1) { - startOffset = nodeIndex(startContainer); - startContainer = startContainer.parentNode; - } - - // Setup index for endContainer - if (endContainer.nodeType == 1) { - endOffset = nodeIndex(endContainer) + 1; - endContainer = endContainer.parentNode; - } - - // Return new range like object - return { - startContainer : startContainer, - startOffset : startOffset, - endContainer : endContainer, - endOffset : endOffset - }; - } - - function removeFormat(format, vars, node, compare_node) { - var i, attrs, stylesModified; - - // Check if node matches format - if (!matchName(node, format)) - return FALSE; - - // Should we compare with format attribs and styles - if (format.remove != 'all') { - // Remove styles - each(format.styles, function(value, name) { - value = replaceVars(value, vars); - - // Indexed array - if (typeof(name) === 'number') { - name = value; - compare_node = 0; - } - - if (!compare_node || isEq(getStyle(compare_node, name), value)) - dom.setStyle(node, name, ''); - - stylesModified = 1; - }); - - // Remove style attribute if it's empty - if (stylesModified && dom.getAttrib(node, 'style') == '') { - node.removeAttribute('style'); - node.removeAttribute('data-mce-style'); - } - - // Remove attributes - each(format.attributes, function(value, name) { - var valueOut; - - value = replaceVars(value, vars); - - // Indexed array - if (typeof(name) === 'number') { - name = value; - compare_node = 0; - } - - if (!compare_node || isEq(dom.getAttrib(compare_node, name), value)) { - // Keep internal classes - if (name == 'class') { - value = dom.getAttrib(node, name); - if (value) { - // Build new class value where everything is removed except the internal prefixed classes - valueOut = ''; - each(value.split(/\s+/), function(cls) { - if (/mce\w+/.test(cls)) - valueOut += (valueOut ? ' ' : '') + cls; - }); - - // We got some internal classes left - if (valueOut) { - dom.setAttrib(node, name, valueOut); - return; - } - } - } - - // IE6 has a bug where the attribute doesn't get removed correctly - if (name == "class") - node.removeAttribute('className'); - - // Remove mce prefixed attributes - if (MCE_ATTR_RE.test(name)) - node.removeAttribute('data-mce-' + name); - - node.removeAttribute(name); - } - }); - - // Remove classes - each(format.classes, function(value) { - value = replaceVars(value, vars); - - if (!compare_node || dom.hasClass(compare_node, value)) - dom.removeClass(node, value); - }); - - // Check for non internal attributes - attrs = dom.getAttribs(node); - for (i = 0; i < attrs.length; i++) { - if (attrs[i].nodeName.indexOf('_') !== 0) - return FALSE; - } - } - - // Remove the inline child if it's empty for example or - if (format.remove != 'none') { - removeNode(node, format); - return TRUE; - } - }; - - function removeNode(node, format) { - var parentNode = node.parentNode, rootBlockElm; - - if (format.block) { - if (!forcedRootBlock) { - function find(node, next, inc) { - node = getNonWhiteSpaceSibling(node, next, inc); - - return !node || (node.nodeName == 'BR' || isBlock(node)); - }; - - // Append BR elements if needed before we remove the block - if (isBlock(node) && !isBlock(parentNode)) { - if (!find(node, FALSE) && !find(node.firstChild, TRUE, 1)) - node.insertBefore(dom.create('br'), node.firstChild); - - if (!find(node, TRUE) && !find(node.lastChild, FALSE, 1)) - node.appendChild(dom.create('br')); - } - } else { - // Wrap the block in a forcedRootBlock if we are at the root of document - if (parentNode == dom.getRoot()) { - if (!format.list_block || !isEq(node, format.list_block)) { - each(tinymce.grep(node.childNodes), function(node) { - if (isValid(forcedRootBlock, node.nodeName.toLowerCase())) { - if (!rootBlockElm) - rootBlockElm = wrap(node, forcedRootBlock); - else - rootBlockElm.appendChild(node); - } else - rootBlockElm = 0; - }); - } - } - } - } - - // Never remove nodes that isn't the specified inline element if a selector is specified too - if (format.selector && format.inline && !isEq(format.inline, node)) - return; - - dom.remove(node, 1); - }; - - function getNonWhiteSpaceSibling(node, next, inc) { - if (node) { - next = next ? 'nextSibling' : 'previousSibling'; - - for (node = inc ? node : node[next]; node; node = node[next]) { - if (node.nodeType == 1 || !isWhiteSpaceNode(node)) - return node; - } - } - }; - - function isBookmarkNode(node) { - return node && node.nodeType == 1 && node.getAttribute('data-mce-type') == 'bookmark'; - }; - - function mergeSiblings(prev, next) { - var marker, sibling, tmpSibling; - - function compareElements(node1, node2) { - // Not the same name - if (node1.nodeName != node2.nodeName) - return FALSE; - - function getAttribs(node) { - var attribs = {}; - - each(dom.getAttribs(node), function(attr) { - var name = attr.nodeName.toLowerCase(); - - // Don't compare internal attributes or style - if (name.indexOf('_') !== 0 && name !== 'style') - attribs[name] = dom.getAttrib(node, name); - }); - - return attribs; - }; - - function compareObjects(obj1, obj2) { - var value, name; - - for (name in obj1) { - // Obj1 has item obj2 doesn't have - if (obj1.hasOwnProperty(name)) { - value = obj2[name]; - - // Obj2 doesn't have obj1 item - if (value === undefined) - return FALSE; - - // Obj2 item has a different value - if (obj1[name] != value) - return FALSE; - - // Delete similar value - delete obj2[name]; - } - } - - // Check if obj 2 has something obj 1 doesn't have - for (name in obj2) { - // Obj2 has item obj1 doesn't have - if (obj2.hasOwnProperty(name)) - return FALSE; - } - - return TRUE; - }; - - // Attribs are not the same - if (!compareObjects(getAttribs(node1), getAttribs(node2))) - return FALSE; - - // Styles are not the same - if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style')))) - return FALSE; - - return TRUE; - }; - - // Check if next/prev exists and that they are elements - if (prev && next) { - function findElementSibling(node, sibling_name) { - for (sibling = node; sibling; sibling = sibling[sibling_name]) { - if (sibling.nodeType == 3 && sibling.nodeValue.length !== 0) - return node; - - if (sibling.nodeType == 1 && !isBookmarkNode(sibling)) - return sibling; - } - - return node; - }; - - // If previous sibling is empty then jump over it - prev = findElementSibling(prev, 'previousSibling'); - next = findElementSibling(next, 'nextSibling'); - - // Compare next and previous nodes - if (compareElements(prev, next)) { - // Append nodes between - for (sibling = prev.nextSibling; sibling && sibling != next;) { - tmpSibling = sibling; - sibling = sibling.nextSibling; - prev.appendChild(tmpSibling); - } - - // Remove next node - dom.remove(next); - - // Move children into prev node - each(tinymce.grep(next.childNodes), function(node) { - prev.appendChild(node); - }); - - return prev; - } - } - - return next; - }; - - function isTextBlock(name) { - return /^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(name); - }; - - function getContainer(rng, start) { - var container, offset, lastIdx, walker; - - container = rng[start ? 'startContainer' : 'endContainer']; - offset = rng[start ? 'startOffset' : 'endOffset']; - - if (container.nodeType == 1) { - lastIdx = container.childNodes.length - 1; - - if (!start && offset) - offset--; - - container = container.childNodes[offset > lastIdx ? lastIdx : offset]; - } - - // If start text node is excluded then walk to the next node - if (container.nodeType === 3 && start && offset >= container.nodeValue.length) { - container = new TreeWalker(container, ed.getBody()).next() || container; - } - - // If end text node is excluded then walk to the previous node - if (container.nodeType === 3 && !start && offset == 0) { - container = new TreeWalker(container, ed.getBody()).prev() || container; - } - - return container; - }; - - function performCaretAction(type, name, vars) { - var invisibleChar, caretContainerId = '_mce_caret', debug = ed.settings.caret_debug; - - // Setup invisible character use zero width space on Gecko since it doesn't change the heigt of the container - invisibleChar = tinymce.isGecko ? '\u200B' : INVISIBLE_CHAR; - - // Creates a caret container bogus element - function createCaretContainer(fill) { - var caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''}); - - if (fill) { - caretContainer.appendChild(ed.getDoc().createTextNode(invisibleChar)); - } - - return caretContainer; - }; - - function isCaretContainerEmpty(node, nodes) { - while (node) { - if ((node.nodeType === 3 && node.nodeValue !== invisibleChar) || node.childNodes.length > 1) { - return false; - } - - // Collect nodes - if (nodes && node.nodeType === 1) { - nodes.push(node); - } - - node = node.firstChild; - } - - return true; - }; - - // Returns any parent caret container element - function getParentCaretContainer(node) { - while (node) { - if (node.id === caretContainerId) { - return node; - } - - node = node.parentNode; - } - }; - - // Finds the first text node in the specified node - function findFirstTextNode(node) { - var walker; - - if (node) { - walker = new TreeWalker(node, node); - - for (node = walker.current(); node; node = walker.next()) { - if (node.nodeType === 3) { - return node; - } - } - } - }; - - // Removes the caret container for the specified node or all on the current document - function removeCaretContainer(node, move_caret) { - var child, rng; - - if (!node) { - node = getParentCaretContainer(selection.getStart()); - - if (!node) { - while (node = dom.get(caretContainerId)) { - removeCaretContainer(node, false); - } - } - } else { - rng = selection.getRng(true); - - if (isCaretContainerEmpty(node)) { - if (move_caret !== false) { - rng.setStartBefore(node); - rng.setEndBefore(node); - } - - dom.remove(node); - } else { - child = findFirstTextNode(node); - child = child.deleteData(0, 1); - dom.remove(node, 1); - } - - selection.setRng(rng); - } - }; - - // Applies formatting to the caret position - function applyCaretFormat() { - var rng, caretContainer, textNode, offset, bookmark, container, text; - - rng = selection.getRng(true); - offset = rng.startOffset; - container = rng.startContainer; - text = container.nodeValue; - - caretContainer = getParentCaretContainer(selection.getStart()); - if (caretContainer) { - textNode = findFirstTextNode(caretContainer); - } - - // Expand to word is caret is in the middle of a text node and the char before/after is a alpha numeric character - if (text && offset > 0 && offset < text.length && /\w/.test(text.charAt(offset)) && /\w/.test(text.charAt(offset - 1))) { - // Get bookmark of caret position - bookmark = selection.getBookmark(); - - // Collapse bookmark range (WebKit) - rng.collapse(true); - - // Expand the range to the closest word and split it at those points - rng = expandRng(rng, get(name)); - rng = rangeUtils.split(rng); - - // Apply the format to the range - apply(name, vars, rng); - - // Move selection back to caret position - selection.moveToBookmark(bookmark); - } else { - if (!caretContainer || textNode.nodeValue !== invisibleChar) { - caretContainer = createCaretContainer(true); - textNode = caretContainer.firstChild; - - rng.insertNode(caretContainer); - offset = 1; - - apply(name, vars, caretContainer); - } else { - apply(name, vars, caretContainer); - } - - // Move selection to text node - selection.setCursorLocation(textNode, offset); - } - }; - - function removeCaretFormat() { - var rng = selection.getRng(true), container, offset, bookmark, - hasContentAfter, node, formatNode, parents = [], i, caretContainer; - - container = rng.startContainer; - offset = rng.startOffset; - node = container; - - if (container.nodeType == 3) { - if (offset != container.nodeValue.length || container.nodeValue === invisibleChar) { - hasContentAfter = true; - } - - node = node.parentNode; - } - - while (node) { - if (matchNode(node, name, vars)) { - formatNode = node; - break; - } - - if (node.nextSibling) { - hasContentAfter = true; - } - - parents.push(node); - node = node.parentNode; - } - - // Node doesn't have the specified format - if (!formatNode) { - return; - } - - // Is there contents after the caret then remove the format on the element - if (hasContentAfter) { - // Get bookmark of caret position - bookmark = selection.getBookmark(); - - // Collapse bookmark range (WebKit) - rng.collapse(true); - - // Expand the range to the closest word and split it at those points - rng = expandRng(rng, get(name), true); - rng = rangeUtils.split(rng); - - // Remove the format from the range - remove(name, vars, rng); - - // Move selection back to caret position - selection.moveToBookmark(bookmark); - } else { - caretContainer = createCaretContainer(); - - node = caretContainer; - for (i = parents.length - 1; i >= 0; i--) { - node.appendChild(parents[i].cloneNode(false)); - node = node.firstChild; - } - - // Insert invisible character into inner most format element - node.appendChild(dom.doc.createTextNode(invisibleChar)); - node = node.firstChild; - - // Insert caret container after the formatted node - dom.insertAfter(caretContainer, formatNode); - - // Move selection to text node - selection.setCursorLocation(node, 1); - } - }; - - // Mark current caret container elements as bogus when getting the contents so we don't end up with empty elements - ed.onBeforeGetContent.addToTop(function() { - var nodes = [], i; - - if (isCaretContainerEmpty(getParentCaretContainer(selection.getStart()), nodes)) { - // Mark children - i = nodes.length; - while (i--) { - dom.setAttrib(nodes[i], 'data-mce-bogus', '1'); - } - } - }); - - // Remove caret container on mouse up and on key up - tinymce.each('onMouseUp onKeyUp'.split(' '), function(name) { - ed[name].addToTop(function() { - removeCaretContainer(); - }); - }); - - // Remove caret container on keydown and it's a backspace, enter or left/right arrow keys - ed.onKeyDown.addToTop(function(ed, e) { - var keyCode = e.keyCode; - - if (keyCode == 8 || keyCode == 37 || keyCode == 39) { - removeCaretContainer(getParentCaretContainer(selection.getStart())); - } - }); - - // Do apply or remove caret format - if (type == "apply") { - applyCaretFormat(); - } else { - removeCaretFormat(); - } - }; - }; -})(tinymce); - -tinymce.onAddEditor.add(function(tinymce, ed) { - var filters, fontSizes, dom, settings = ed.settings; - - if (settings.inline_styles) { - fontSizes = tinymce.explode(settings.font_size_legacy_values); - - function replaceWithSpan(node, styles) { - tinymce.each(styles, function(value, name) { - if (value) - dom.setStyle(node, name, value); - }); - - dom.rename(node, 'span'); - }; - - filters = { - font : function(dom, node) { - replaceWithSpan(node, { - backgroundColor : node.style.backgroundColor, - color : node.color, - fontFamily : node.face, - fontSize : fontSizes[parseInt(node.size) - 1] - }); - }, - - u : function(dom, node) { - replaceWithSpan(node, { - textDecoration : 'underline' - }); - }, - - strike : function(dom, node) { - replaceWithSpan(node, { - textDecoration : 'line-through' - }); - } - }; - - function convert(editor, params) { - dom = editor.dom; - - if (settings.convert_fonts_to_spans) { - tinymce.each(dom.select('font,u,strike', params.node), function(node) { - filters[node.nodeName.toLowerCase()](ed.dom, node); - }); - } - }; - - ed.onPreProcess.add(convert); - ed.onSetContent.add(convert); - - ed.onInit.add(function() { - ed.selection.onSetContent.add(convert); - }); - } -}); - diff --git a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_popup.js b/app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_popup.js deleted file mode 100644 index f859d24e6a67..000000000000 --- a/app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_popup.js +++ /dev/null @@ -1,5 +0,0 @@ - -// Uncomment and change this document.domain value if you are loading the script cross subdomains -// document.domain = 'moxiecode.com'; - -var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write(' -
    - Snippet: - - - - - - - - - - - - - - - - - - - - - - - - - -
    DirectiveHowSourceRendered
    ng-bind-htmlAutomatically uses $sanitize
    <div ng-bind-html="snippet">
    </div>
    ng-bind-htmlBypass $sanitize by explicitly trusting the dangerous value -
    <div ng-bind-html="deliberatelyTrustDangerousSnippet()">
    -     </div>
    -
    ng-bindAutomatically escapes
    <div ng-bind="snippet">
    </div>
    -
    - - - it('should sanitize the html snippet by default', function() { - expect(element(by.css('#bind-html-with-sanitize div')).getAttribute('innerHTML')). - toBe('

    an html\nclick here\nsnippet

    '); - }); - - it('should inline raw snippet if bound to a trusted value', function() { - expect(element(by.css('#bind-html-with-trust div')).getAttribute('innerHTML')). - toBe("

    an html\n" + - "click here\n" + - "snippet

    "); - }); - - it('should escape snippet without any filter', function() { - expect(element(by.css('#bind-default div')).getAttribute('innerHTML')). - toBe("<p style=\"color:blue\">an html\n" + - "<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" + - "snippet</p>"); - }); - - it('should update', function() { - element(by.model('snippet')).clear(); - element(by.model('snippet')).sendKeys('new text'); - expect(element(by.css('#bind-html-with-sanitize div')).getAttribute('innerHTML')). - toBe('new text'); - expect(element(by.css('#bind-html-with-trust div')).getAttribute('innerHTML')).toBe( - 'new text'); - expect(element(by.css('#bind-default div')).getAttribute('innerHTML')).toBe( - "new <b onclick=\"alert(1)\">text</b>"); - }); -
    - - */ - - - /** - * @ngdoc provider - * @name $sanitizeProvider - * @this - * - * @description - * Creates and configures {@link $sanitize} instance. - */ - function $SanitizeProvider() { - var svgEnabled = false; - - this.$get = ['$$sanitizeUri', function($$sanitizeUri) { - if (svgEnabled) { - extend(validElements, svgElements); - } - return function(html) { - var buf = []; - htmlParser(html, htmlSanitizeWriter(buf, function(uri, isImage) { - return !/^unsafe:/.test($$sanitizeUri(uri, isImage)); - })); - return buf.join(''); - }; - }]; - - - /** - * @ngdoc method - * @name $sanitizeProvider#enableSvg - * @kind function - * - * @description - * Enables a subset of svg to be supported by the sanitizer. - * - *
    - *

    By enabling this setting without taking other precautions, you might expose your - * application to click-hijacking attacks. In these attacks, sanitized svg elements could be positioned - * outside of the containing element and be rendered over other elements on the page (e.g. a login - * link). Such behavior can then result in phishing incidents.

    - * - *

    To protect against these, explicitly setup `overflow: hidden` css rule for all potential svg - * tags within the sanitized content:

    - * - *
    - * - *
    
    -         *   .rootOfTheIncludedContent svg {
    -         *     overflow: hidden !important;
    -         *   }
    -         *   
    - *
    - * - * @param {boolean=} flag Enable or disable SVG support in the sanitizer. - * @returns {boolean|ng.$sanitizeProvider} Returns the currently configured value if called - * without an argument or self for chaining otherwise. - */ - this.enableSvg = function(enableSvg) { - if (isDefined(enableSvg)) { - svgEnabled = enableSvg; - return this; - } else { - return svgEnabled; - } - }; - - ////////////////////////////////////////////////////////////////////////////////////////////////// - // Private stuff - ////////////////////////////////////////////////////////////////////////////////////////////////// - - bind = angular.bind; - extend = angular.extend; - forEach = angular.forEach; - isDefined = angular.isDefined; - lowercase = angular.lowercase; - noop = angular.noop; - - htmlParser = htmlParserImpl; - htmlSanitizeWriter = htmlSanitizeWriterImpl; - - nodeContains = window.Node.prototype.contains || /** @this */ function(arg) { - // eslint-disable-next-line no-bitwise - return !!(this.compareDocumentPosition(arg) & 16); - }; - - // Regular Expressions for parsing tags and attributes - var SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, - // Match everything outside of normal chars and " (quote character) - NON_ALPHANUMERIC_REGEXP = /([^#-~ |!])/g; - - - // Good source of info about elements and attributes - // http://dev.w3.org/html5/spec/Overview.html#semantics - // http://simon.html5.org/html-elements - - // Safe Void Elements - HTML5 - // http://dev.w3.org/html5/spec/Overview.html#void-elements - var voidElements = toMap('area,br,col,hr,img,wbr'); - - // Elements that you can, intentionally, leave open (and which close themselves) - // http://dev.w3.org/html5/spec/Overview.html#optional-tags - var optionalEndTagBlockElements = toMap('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr'), - optionalEndTagInlineElements = toMap('rp,rt'), - optionalEndTagElements = extend({}, - optionalEndTagInlineElements, - optionalEndTagBlockElements); - - // Safe Block Elements - HTML5 - var blockElements = extend({}, optionalEndTagBlockElements, toMap('address,article,' + - 'aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' + - 'h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul')); - - // Inline Elements - HTML5 - var inlineElements = extend({}, optionalEndTagInlineElements, toMap('a,abbr,acronym,b,' + - 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,' + - 'samp,small,span,strike,strong,sub,sup,time,tt,u,var')); - - // SVG Elements - // https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Elements - // Note: the elements animate,animateColor,animateMotion,animateTransform,set are intentionally omitted. - // They can potentially allow for arbitrary javascript to be executed. See #11290 - var svgElements = toMap('circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,' + - 'hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,' + - 'radialGradient,rect,stop,svg,switch,text,title,tspan'); - - // Blocked Elements (will be stripped) - var blockedElements = toMap('script,style'); - - var validElements = extend({}, - voidElements, - blockElements, - inlineElements, - optionalEndTagElements); - - //Attributes that have href and hence need to be sanitized - var uriAttrs = toMap('background,cite,href,longdesc,src,xlink:href,xml:base'); - - var htmlAttrs = toMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' + - 'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' + - 'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' + - 'scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,' + - 'valign,value,vspace,width'); - - // SVG attributes (without "id" and "name" attributes) - // https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Attributes - var svgAttrs = toMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' + - 'baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,' + - 'cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,' + - 'font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,' + - 'height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,' + - 'marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,' + - 'max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,' + - 'path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,' + - 'requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,' + - 'stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,' + - 'stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,' + - 'stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,' + - 'underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,' + - 'width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,' + - 'xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan', true); - - var validAttrs = extend({}, - uriAttrs, - svgAttrs, - htmlAttrs); - - function toMap(str, lowercaseKeys) { - var obj = {}, items = str.split(','), i; - for (i = 0; i < items.length; i++) { - obj[lowercaseKeys ? lowercase(items[i]) : items[i]] = true; - } - return obj; - } - - /** - * Create an inert document that contains the dirty HTML that needs sanitizing - * Depending upon browser support we use one of three strategies for doing this. - * Support: Safari 10.x -> XHR strategy - * Support: Firefox -> DomParser strategy - */ - var getInertBodyElement /* function(html: string): HTMLBodyElement */ = (function(window, document) { - var inertDocument; - if (document && document.implementation) { - inertDocument = document.implementation.createHTMLDocument('inert'); - } else { - throw $sanitizeMinErr('noinert', 'Can\'t create an inert html document'); - } - var inertBodyElement = (inertDocument.documentElement || inertDocument.getDocumentElement()).querySelector('body'); - - // Check for the Safari 10.1 bug - which allows JS to run inside the SVG G element - inertBodyElement.innerHTML = ''; - if (!inertBodyElement.querySelector('svg')) { - return getInertBodyElement_XHR; - } else { - // Check for the Firefox bug - which prevents the inner img JS from being sanitized - inertBodyElement.innerHTML = '

    '; - if (inertBodyElement.querySelector('svg img')) { - return getInertBodyElement_DOMParser; - } else { - return getInertBodyElement_InertDocument; - } - } - - function getInertBodyElement_XHR(html) { - // We add this dummy element to ensure that the rest of the content is parsed as expected - // e.g. leading whitespace is maintained and tags like `` do not get hoisted to the `` tag. - html = '' + html; - try { - html = encodeURI(html); - } catch (e) { - return undefined; - } - var xhr = new window.XMLHttpRequest(); - xhr.responseType = 'document'; - xhr.open('GET', 'data:text/html;charset=utf-8,' + html, false); - xhr.send(null); - var body = xhr.response.body; - body.firstChild.remove(); - return body; - } - - function getInertBodyElement_DOMParser(html) { - // We add this dummy element to ensure that the rest of the content is parsed as expected - // e.g. leading whitespace is maintained and tags like `` do not get hoisted to the `` tag. - html = '' + html; - try { - var body = new window.DOMParser().parseFromString(html, 'text/html').body; - body.firstChild.remove(); - return body; - } catch (e) { - return undefined; - } - } - - function getInertBodyElement_InertDocument(html) { - inertBodyElement.innerHTML = html; - - // Support: IE 9-11 only - // strip custom-namespaced attributes on IE<=11 - if (document.documentMode) { - stripCustomNsAttrs(inertBodyElement); - } - - return inertBodyElement; - } - })(window, window.document); - - /** - * @example - * htmlParser(htmlString, { - * start: function(tag, attrs) {}, - * end: function(tag) {}, - * chars: function(text) {}, - * comment: function(text) {} - * }); - * - * @param {string} html string - * @param {object} handler - */ - function htmlParserImpl(html, handler) { - if (html === null || html === undefined) { - html = ''; - } else if (typeof html !== 'string') { - html = '' + html; - } - - var inertBodyElement = getInertBodyElement(html); - if (!inertBodyElement) return ''; - - //mXSS protection - var mXSSAttempts = 5; - do { - if (mXSSAttempts === 0) { - throw $sanitizeMinErr('uinput', 'Failed to sanitize html because the input is unstable'); - } - mXSSAttempts--; - - // trigger mXSS if it is going to happen by reading and writing the innerHTML - html = inertBodyElement.innerHTML; - inertBodyElement = getInertBodyElement(html); - } while (html !== inertBodyElement.innerHTML); - - var node = inertBodyElement.firstChild; - while (node) { - switch (node.nodeType) { - case 1: // ELEMENT_NODE - handler.start(node.nodeName.toLowerCase(), attrToMap(node.attributes)); - break; - case 3: // TEXT NODE - handler.chars(node.textContent); - break; - } - - var nextNode; - if (!(nextNode = node.firstChild)) { - if (node.nodeType === 1) { - handler.end(node.nodeName.toLowerCase()); - } - nextNode = getNonDescendant('nextSibling', node); - if (!nextNode) { - while (nextNode == null) { - node = getNonDescendant('parentNode', node); - if (node === inertBodyElement) break; - nextNode = getNonDescendant('nextSibling', node); - if (node.nodeType === 1) { - handler.end(node.nodeName.toLowerCase()); - } - } - } - } - node = nextNode; - } - - while ((node = inertBodyElement.firstChild)) { - inertBodyElement.removeChild(node); - } - } - - function attrToMap(attrs) { - var map = {}; - for (var i = 0, ii = attrs.length; i < ii; i++) { - var attr = attrs[i]; - map[attr.name] = attr.value; - } - return map; - } - - - /** - * Escapes all potentially dangerous characters, so that the - * resulting string can be safely inserted into attribute or - * element text. - * @param value - * @returns {string} escaped text - */ - function encodeEntities(value) { - return value. - replace(/&/g, '&'). - replace(SURROGATE_PAIR_REGEXP, function(value) { - var hi = value.charCodeAt(0); - var low = value.charCodeAt(1); - return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';'; - }). - replace(NON_ALPHANUMERIC_REGEXP, function(value) { - return '&#' + value.charCodeAt(0) + ';'; - }). - replace(//g, '>'); - } - - /** - * create an HTML/XML writer which writes to buffer - * @param {Array} buf use buf.join('') to get out sanitized html string - * @returns {object} in the form of { - * start: function(tag, attrs) {}, - * end: function(tag) {}, - * chars: function(text) {}, - * comment: function(text) {} - * } - */ - function htmlSanitizeWriterImpl(buf, uriValidator) { - var ignoreCurrentElement = false; - var out = bind(buf, buf.push); - return { - start: function(tag, attrs) { - tag = lowercase(tag); - if (!ignoreCurrentElement && blockedElements[tag]) { - ignoreCurrentElement = tag; - } - if (!ignoreCurrentElement && validElements[tag] === true) { - out('<'); - out(tag); - forEach(attrs, function(value, key) { - var lkey = lowercase(key); - var isImage = (tag === 'img' && lkey === 'src') || (lkey === 'background'); - if (validAttrs[lkey] === true && - (uriAttrs[lkey] !== true || uriValidator(value, isImage))) { - out(' '); - out(key); - out('="'); - out(encodeEntities(value)); - out('"'); - } - }); - out('>'); - } - }, - end: function(tag) { - tag = lowercase(tag); - if (!ignoreCurrentElement && validElements[tag] === true && voidElements[tag] !== true) { - out(''); - } - // eslint-disable-next-line eqeqeq - if (tag == ignoreCurrentElement) { - ignoreCurrentElement = false; - } - }, - chars: function(chars) { - if (!ignoreCurrentElement) { - out(encodeEntities(chars)); - } - } - }; - } - - - /** - * When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1' attribute to declare - * ns1 namespace and prefixes the attribute with 'ns1' (e.g. 'ns1:xlink:foo'). This is undesirable since we don't want - * to allow any of these custom attributes. This method strips them all. - * - * @param node Root element to process - */ - function stripCustomNsAttrs(node) { - while (node) { - if (node.nodeType === window.Node.ELEMENT_NODE) { - var attrs = node.attributes; - for (var i = 0, l = attrs.length; i < l; i++) { - var attrNode = attrs[i]; - var attrName = attrNode.name.toLowerCase(); - if (attrName === 'xmlns:ns1' || attrName.lastIndexOf('ns1:', 0) === 0) { - node.removeAttributeNode(attrNode); - i--; - l--; - } - } - } - - var nextNode = node.firstChild; - if (nextNode) { - stripCustomNsAttrs(nextNode); - } - - node = getNonDescendant('nextSibling', node); - } - } - - function getNonDescendant(propName, node) { - // An element is clobbered if its `propName` property points to one of its descendants - var nextNode = node[propName]; - if (nextNode && nodeContains.call(node, nextNode)) { - throw $sanitizeMinErr('elclob', 'Failed to sanitize html because the element is clobbered: {0}', node.outerHTML || node.outerText); - } - return nextNode; - } - } - - function sanitizeText(chars) { - var buf = []; - var writer = htmlSanitizeWriter(buf, noop); - writer.chars(chars); - return buf.join(''); - } - - -// define ngSanitize module and register $sanitize service - angular.module('ngSanitize', []) - .provider('$sanitize', $SanitizeProvider) - .info({ angularVersion: '1.6.9' }); - - /** - * @ngdoc filter - * @name linky - * @kind function - * - * @description - * Finds links in text input and turns them into html links. Supports `http/https/ftp/sftp/mailto` and - * plain email address links. - * - * Requires the {@link ngSanitize `ngSanitize`} module to be installed. - * - * @param {string} text Input text. - * @param {string} [target] Window (`_blank|_self|_parent|_top`) or named frame to open links in. - * @param {object|function(url)} [attributes] Add custom attributes to the link element. - * - * Can be one of: - * - * - `object`: A map of attributes - * - `function`: Takes the url as a parameter and returns a map of attributes - * - * If the map of attributes contains a value for `target`, it overrides the value of - * the target parameter. - * - * - * @returns {string} Html-linkified and {@link $sanitize sanitized} text. - * - * @usage - - * - * @example - - -

    - Snippet: - - - - - - - - - - - - - - - - - - - - - - - - - - -
    FilterSourceRendered
    linky filter -
    <div ng-bind-html="snippet | linky">
    </div>
    -
    -
    -
    linky target -
    <div ng-bind-html="snippetWithSingleURL | linky:'_blank'">
    </div>
    -
    -
    -
    linky custom attributes -
    <div ng-bind-html="snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}">
    </div>
    -
    -
    -
    no filter
    <div ng-bind="snippet">
    </div>
    - - - angular.module('linkyExample', ['ngSanitize']) - .controller('ExampleController', ['$scope', function($scope) { - $scope.snippet = - 'Pretty text with some links:\n' + - 'http://angularjs.org/,\n' + - 'mailto:us@somewhere.org,\n' + - 'another@somewhere.org,\n' + - 'and one more: ftp://127.0.0.1/.'; - $scope.snippetWithSingleURL = 'http://angularjs.org/'; - }]); - - - it('should linkify the snippet with urls', function() { - expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()). - toBe('Pretty text with some links: http://angularjs.org/, us@somewhere.org, ' + - 'another@somewhere.org, and one more: ftp://127.0.0.1/.'); - expect(element.all(by.css('#linky-filter a')).count()).toEqual(4); - }); - - it('should not linkify snippet without the linky filter', function() { - expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()). - toBe('Pretty text with some links: http://angularjs.org/, mailto:us@somewhere.org, ' + - 'another@somewhere.org, and one more: ftp://127.0.0.1/.'); - expect(element.all(by.css('#escaped-html a')).count()).toEqual(0); - }); - - it('should update', function() { - element(by.model('snippet')).clear(); - element(by.model('snippet')).sendKeys('new http://link.'); - expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()). - toBe('new http://link.'); - expect(element.all(by.css('#linky-filter a')).count()).toEqual(1); - expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()) - .toBe('new http://link.'); - }); - - it('should work with the target property', function() { - expect(element(by.id('linky-target')). - element(by.binding("snippetWithSingleURL | linky:'_blank'")).getText()). - toBe('http://angularjs.org/'); - expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank'); - }); - - it('should optionally add custom attributes', function() { - expect(element(by.id('linky-custom-attributes')). - element(by.binding("snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}")).getText()). - toBe('http://angularjs.org/'); - expect(element(by.css('#linky-custom-attributes a')).getAttribute('rel')).toEqual('nofollow'); - }); - - - */ - angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) { - var LINKY_URL_REGEXP = - /((s?ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i, - MAILTO_REGEXP = /^mailto:/i; - - var linkyMinErr = angular.$$minErr('linky'); - var isDefined = angular.isDefined; - var isFunction = angular.isFunction; - var isObject = angular.isObject; - var isString = angular.isString; - - return function(text, target, attributes) { - if (text == null || text === '') return text; - if (!isString(text)) throw linkyMinErr('notstring', 'Expected string but received: {0}', text); - - var attributesFn = - isFunction(attributes) ? attributes : - isObject(attributes) ? function getAttributesObject() {return attributes;} : - function getEmptyAttributesObject() {return {};}; - - var match; - var raw = text; - var html = []; - var url; - var i; - while ((match = raw.match(LINKY_URL_REGEXP))) { - // We can not end in these as they are sometimes found at the end of the sentence - url = match[0]; - // if we did not match ftp/http/www/mailto then assume mailto - if (!match[2] && !match[4]) { - url = (match[3] ? 'http://' : 'mailto:') + url; - } - i = match.index; - addText(raw.substr(0, i)); - addLink(url, match[0].replace(MAILTO_REGEXP, '')); - raw = raw.substring(i + match[0].length); - } - addText(raw); - return $sanitize(html.join('')); - - function addText(text) { - if (!text) { - return; - } - html.push(sanitizeText(text)); - } - - function addLink(url, text) { - var key, linkAttributes = attributesFn(url); - html.push(''); - addText(text); - html.push(''); - } - }; - }]); - - -})(window, window.angular); \ No newline at end of file diff --git a/setup/pub/angular-sanitize/angular-sanitize.min.js b/setup/pub/angular-sanitize/angular-sanitize.min.js deleted file mode 100644 index 991dd00987a8..000000000000 --- a/setup/pub/angular-sanitize/angular-sanitize.min.js +++ /dev/null @@ -1,17 +0,0 @@ -/* - AngularJS v1.6.9 - (c) 2010-2018 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(s,d){'use strict';function J(d){var k=[];w(k,B).chars(d);return k.join("")}var x=d.$$minErr("$sanitize"),C,k,D,E,p,B,F,G,w;d.module("ngSanitize",[]).provider("$sanitize",function(){function g(a,e){var c={},b=a.split(","),f;for(f=0;f/g,">")}function I(a){for(;a;){if(a.nodeType===s.Node.ELEMENT_NODE)for(var e=a.attributes,c=0,b=e.length;c"))},end:function(a){a=p(a);c||!0!==n[a]||!0===h[a]||(b(""));a==c&&(c=!1)},chars:function(a){c||b(H(a))}}};F=s.Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)&16)};var L=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,M=/([^#-~ |!])/g,h=g("area,br,col,hr,img,wbr"),q=g("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),l=g("rp,rt"),r=k({},l,q),q=k({},q,g("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")), - l=k({},l,g("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),z=g("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),A=g("script,style"),n=k({},h,q,l,r),m=g("background,cite,href,longdesc,src,xlink:href,xml:base"),r=g("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"), - l=g("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan", - !0),v=k({},m,l,r),u=function(a,e){function c(b){b=""+b;try{var c=(new a.DOMParser).parseFromString(b,"text/html").body;c.firstChild.remove();return c}catch(e){}}function b(a){d.innerHTML=a;e.documentMode&&I(d);return d}var h;if(e&&e.implementation)h=e.implementation.createHTMLDocument("inert");else throw x("noinert");var d=(h.documentElement||h.getDocumentElement()).querySelector("body");d.innerHTML='';return d.querySelector("svg")? - (d.innerHTML='

    ',d.querySelector("svg img")?c:b):function(b){b=""+b;try{b=encodeURI(b)}catch(c){return}var e=new a.XMLHttpRequest;e.responseType="document";e.open("GET","data:text/html;charset=utf-8,"+b,!1);e.send(null);b=e.response.body;b.firstChild.remove();return b}}(s,s.document)}).info({angularVersion:"1.6.9"});d.module("ngSanitize").filter("linky",["$sanitize",function(g){var k=/((s?ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i, - p=/^mailto:/i,s=d.$$minErr("linky"),t=d.isDefined,y=d.isFunction,w=d.isObject,x=d.isString;return function(d,q,l){function r(a){a&&m.push(J(a))}function z(a,d){var c,b=A(a);m.push("');r(d);m.push("")}if(null==d||""===d)return d;if(!x(d))throw s("notstring",d);for(var A=y(l)?l:w(l)?function(){return l}:function(){return{}},n=d,m=[],v,u;d=n.match(k);)v=d[0],d[2]|| -d[4]||(v=(d[3]?"http://":"mailto:")+v),u=d.index,r(n.substr(0,u)),z(v,d[0].replace(p,"")),n=n.substring(u+d[0].length);r(n);return g(m.join(""))}}])})(window,window.angular); -//# sourceMappingURL=angular-sanitize.min.js.map \ No newline at end of file diff --git a/setup/pub/angular-sanitize/angular-sanitize.min.js.map b/setup/pub/angular-sanitize/angular-sanitize.min.js.map deleted file mode 100644 index 8ce8290b2b38..000000000000 --- a/setup/pub/angular-sanitize/angular-sanitize.min.js.map +++ /dev/null @@ -1,8 +0,0 @@ -{ - "version":3, - "file":"angular-sanitize.min.js", - "lineCount":16, - "mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkB,CAykB3BC,QAASA,EAAY,CAACC,CAAD,CAAQ,CAC3B,IAAIC,EAAM,EACGC,EAAAC,CAAmBF,CAAnBE,CAAwBC,CAAxBD,CACbH,MAAA,CAAaA,CAAb,CACA,OAAOC,EAAAI,KAAA,CAAS,EAAT,CAJoB,CA5jB7B,IAAIC,EAAkBR,CAAAS,SAAA,CAAiB,WAAjB,CAAtB,CACIC,CADJ,CAEIC,CAFJ,CAGIC,CAHJ,CAIIC,CAJJ,CAKIC,CALJ,CAMIR,CANJ,CAOIS,CAPJ,CAQIC,CARJ,CASIZ,CA4jBJJ,EAAAiB,OAAA,CAAe,YAAf,CAA6B,EAA7B,CAAAC,SAAA,CACY,WADZ,CAhcAC,QAA0B,EAAG,CA4J3BC,QAASA,EAAK,CAACC,CAAD,CAAMC,CAAN,CAAqB,CAAA,IAC7BC,EAAM,EADuB,CACnBC,EAAQH,CAAAI,MAAA,CAAU,GAAV,CADW,CACKC,CACtC,KAAKA,CAAL,CAAS,CAAT,CAAYA,CAAZ,CAAgBF,CAAAG,OAAhB,CAA8BD,CAAA,EAA9B,CACEH,CAAA,CAAID,CAAA,CAAgBR,CAAA,CAAUU,CAAA,CAAME,CAAN,CAAV,CAAhB,CAAsCF,CAAA,CAAME,CAAN,CAA1C,CAAA,CAAsD,CAAA,CAExD,OAAOH,EAL0B,CAwJnCK,QAASA,EAAS,CAACC,CAAD,CAAQ,CAExB,IADA,IAAIC,EAAM,EAAV,CACSJ,EAAI,CADb,CACgBK,EAAKF,CAAAF,OAArB,CAAmCD,CAAnC,CAAuCK,CAAvC,CAA2CL,CAAA,EAA3C,CAAgD,CAC9C,IAAIM,EAAOH,CAAA,CAAMH,CAAN,CACXI,EAAA,CAAIE,CAAAC,KAAJ,CAAA,CAAiBD,CAAAE,MAF6B,CAIhD,MAAOJ,EANiB,CAiB1BK,QAASA,EAAc,CAACD,CAAD,CAAQ,CAC7B,MAAOA,EAAAE,QAAA,CACG,IADH,CACS,OADT,CAAAA,QAAA,CAEGC,CAFH,CAE0B,QAAQ,CAACH,CAAD,CAAQ,CAC7C,IAAII,EAAKJ,CAAAK,WAAA,CAAiB,CAAjB,CACLC,EAAAA,CAAMN,CAAAK,WAAA,CAAiB,CAAjB,CACV,OAAO,IAAP,EAAgC,IAAhC,EAAiBD,CAAjB;AAAsB,KAAtB,GAA0CE,CAA1C,CAAgD,KAAhD,EAA0D,KAA1D,EAAqE,GAHxB,CAF1C,CAAAJ,QAAA,CAOGK,CAPH,CAO4B,QAAQ,CAACP,CAAD,CAAQ,CAC/C,MAAO,IAAP,CAAcA,CAAAK,WAAA,CAAiB,CAAjB,CAAd,CAAoC,GADW,CAP5C,CAAAH,QAAA,CAUG,IAVH,CAUS,MAVT,CAAAA,QAAA,CAWG,IAXH,CAWS,MAXT,CADsB,CAgF/BM,QAASA,EAAkB,CAACC,CAAD,CAAO,CAChC,IAAA,CAAOA,CAAP,CAAA,CAAa,CACX,GAAIA,CAAAC,SAAJ,GAAsB7C,CAAA8C,KAAAC,aAAtB,CAEE,IADA,IAAIjB,EAAQc,CAAAI,WAAZ,CACSrB,EAAI,CADb,CACgBsB,EAAInB,CAAAF,OAApB,CAAkCD,CAAlC,CAAsCsB,CAAtC,CAAyCtB,CAAA,EAAzC,CAA8C,CAC5C,IAAIuB,EAAWpB,CAAA,CAAMH,CAAN,CAAf,CACIwB,EAAWD,CAAAhB,KAAAkB,YAAA,EACf,IAAiB,WAAjB,GAAID,CAAJ,EAAoE,CAApE,GAAgCA,CAAAE,YAAA,CAAqB,MAArB,CAA6B,CAA7B,CAAhC,CACET,CAAAU,oBAAA,CAAyBJ,CAAzB,CAEA,CADAvB,CAAA,EACA,CAAAsB,CAAA,EAN0C,CAYhD,CADIM,CACJ,CADeX,CAAAY,WACf,GACEb,CAAA,CAAmBY,CAAnB,CAGFX,EAAA,CAAOa,CAAA,CAAiB,aAAjB,CAAgCb,CAAhC,CAnBI,CADmB,CAwBlCa,QAASA,EAAgB,CAACC,CAAD,CAAWd,CAAX,CAAiB,CAExC,IAAIW,EAAWX,CAAA,CAAKc,CAAL,CACf,IAAIH,CAAJ,EAAgBvC,CAAA2C,KAAA,CAAkBf,CAAlB,CAAwBW,CAAxB,CAAhB,CACE,KAAM9C,EAAA,CAAgB,QAAhB,CAA2FmC,CAAAgB,UAA3F,EAA6GhB,CAAAiB,UAA7G,CAAN,CAEF,MAAON,EANiC,CA5a1C,IAAIO,EAAa,CAAA,CAEjB,KAAAC,KAAA;AAAY,CAAC,eAAD,CAAkB,QAAQ,CAACC,CAAD,CAAgB,CAChDF,CAAJ,EACElD,CAAA,CAAOqD,CAAP,CAAsBC,CAAtB,CAEF,OAAO,SAAQ,CAACC,CAAD,CAAO,CACpB,IAAI/D,EAAM,EACVa,EAAA,CAAWkD,CAAX,CAAiB9D,CAAA,CAAmBD,CAAnB,CAAwB,QAAQ,CAACgE,CAAD,CAAMC,CAAN,CAAe,CAC9D,MAAO,CAAC,UAAAC,KAAA,CAAgBN,CAAA,CAAcI,CAAd,CAAmBC,CAAnB,CAAhB,CADsD,CAA/C,CAAjB,CAGA,OAAOjE,EAAAI,KAAA,CAAS,EAAT,CALa,CAJ8B,CAA1C,CA4CZ,KAAA+D,UAAA,CAAiBC,QAAQ,CAACD,CAAD,CAAY,CACnC,MAAIzD,EAAA,CAAUyD,CAAV,CAAJ,EACET,CACO,CADMS,CACN,CAAA,IAFT,EAIST,CAL0B,CAarCnD,EAAA,CAAOV,CAAAU,KACPC,EAAA,CAASX,CAAAW,OACTC,EAAA,CAAUZ,CAAAY,QACVC,EAAA,CAAYb,CAAAa,UACZC,EAAA,CAAYd,CAAAc,UACZR,EAAA,CAAON,CAAAM,KAEPU,EAAA,CAsLAwD,QAAuB,CAACN,CAAD,CAAOO,CAAP,CAAgB,CACxB,IAAb,GAAIP,CAAJ,EAA8BQ,IAAAA,EAA9B,GAAqBR,CAArB,CACEA,CADF,CACS,EADT,CAE2B,QAF3B,GAEW,MAAOA,EAFlB,GAGEA,CAHF,CAGS,EAHT,CAGcA,CAHd,CAMA,KAAIS,EAAmBC,CAAA,CAAoBV,CAApB,CACvB,IAAKS,CAAAA,CAAL,CAAuB,MAAO,EAG9B,KAAIE,EAAe,CACnB,GAAG,CACD,GAAqB,CAArB,GAAIA,CAAJ,CACE,KAAMrE,EAAA,CAAgB,QAAhB,CAAN,CAEFqE,CAAA,EAGAX,EAAA,CAAOS,CAAAG,UACPH,EAAA,CAAmBC,CAAA,CAAoBV,CAApB,CARlB,CAAH,MASSA,CATT,GASkBS,CAAAG,UATlB,CAYA,KADInC,CACJ,CADWgC,CAAApB,WACX,CAAOZ,CAAP,CAAA,CAAa,CACX,OAAQA,CAAAC,SAAR,EACE,KAAK,CAAL,CACE6B,CAAAM,MAAA,CAAcpC,CAAAqC,SAAA7B,YAAA,EAAd;AAA2CvB,CAAA,CAAUe,CAAAI,WAAV,CAA3C,CACA,MACF,MAAK,CAAL,CACE0B,CAAAvE,MAAA,CAAcyC,CAAAsC,YAAd,CALJ,CASA,IAAI3B,CACJ,IAAM,EAAAA,CAAA,CAAWX,CAAAY,WAAX,CAAN,GACwB,CAIjBD,GAJDX,CAAAC,SAICU,EAHHmB,CAAAS,IAAA,CAAYvC,CAAAqC,SAAA7B,YAAA,EAAZ,CAGGG,CADLA,CACKA,CADME,CAAA,CAAiB,aAAjB,CAAgCb,CAAhC,CACNW,CAAAA,CAAAA,CALP,EAMI,IAAA,CAAmB,IAAnB,EAAOA,CAAP,CAAA,CAAyB,CACvBX,CAAA,CAAOa,CAAA,CAAiB,YAAjB,CAA+Bb,CAA/B,CACP,IAAIA,CAAJ,GAAagC,CAAb,CAA+B,KAC/BrB,EAAA,CAAWE,CAAA,CAAiB,aAAjB,CAAgCb,CAAhC,CACW,EAAtB,GAAIA,CAAAC,SAAJ,EACE6B,CAAAS,IAAA,CAAYvC,CAAAqC,SAAA7B,YAAA,EAAZ,CALqB,CAU7BR,CAAA,CAAOW,CA3BI,CA8Bb,IAAA,CAAQX,CAAR,CAAegC,CAAApB,WAAf,CAAA,CACEoB,CAAAQ,YAAA,CAA6BxC,CAA7B,CAvDmC,CArLvCvC,EAAA,CA0RAgF,QAA+B,CAACjF,CAAD,CAAMkF,CAAN,CAAoB,CACjD,IAAIC,EAAuB,CAAA,CAA3B,CACIC,EAAM7E,CAAA,CAAKP,CAAL,CAAUA,CAAAqF,KAAV,CACV,OAAO,CACLT,MAAOA,QAAQ,CAACU,CAAD,CAAM5D,CAAN,CAAa,CAC1B4D,CAAA,CAAM3E,CAAA,CAAU2E,CAAV,CACDH,EAAAA,CAAL,EAA6BI,CAAA,CAAgBD,CAAhB,CAA7B,GACEH,CADF,CACyBG,CADzB,CAGKH,EAAL,EAAoD,CAAA,CAApD,GAA6BtB,CAAA,CAAcyB,CAAd,CAA7B,GACEF,CAAA,CAAI,GAAJ,CAcA,CAbAA,CAAA,CAAIE,CAAJ,CAaA,CAZA7E,CAAA,CAAQiB,CAAR,CAAe,QAAQ,CAACK,CAAD,CAAQyD,CAAR,CAAa,CAClC,IAAIC,EAAO9E,CAAA,CAAU6E,CAAV,CAAX,CACIvB,EAAmB,KAAnBA,GAAWqB,CAAXrB,EAAqC,KAArCA,GAA4BwB,CAA5BxB,EAAyD,YAAzDA;AAAgDwB,CAC3B,EAAA,CAAzB,GAAIC,CAAA,CAAWD,CAAX,CAAJ,EACsB,CAAA,CADtB,GACGE,CAAA,CAASF,CAAT,CADH,EAC8B,CAAAP,CAAA,CAAanD,CAAb,CAAoBkC,CAApB,CAD9B,GAEEmB,CAAA,CAAI,GAAJ,CAIA,CAHAA,CAAA,CAAII,CAAJ,CAGA,CAFAJ,CAAA,CAAI,IAAJ,CAEA,CADAA,CAAA,CAAIpD,CAAA,CAAeD,CAAf,CAAJ,CACA,CAAAqD,CAAA,CAAI,GAAJ,CANF,CAHkC,CAApC,CAYA,CAAAA,CAAA,CAAI,GAAJ,CAfF,CAL0B,CADvB,CAwBLL,IAAKA,QAAQ,CAACO,CAAD,CAAM,CACjBA,CAAA,CAAM3E,CAAA,CAAU2E,CAAV,CACDH,EAAL,EAAoD,CAAA,CAApD,GAA6BtB,CAAA,CAAcyB,CAAd,CAA7B,EAAkF,CAAA,CAAlF,GAA4DM,CAAA,CAAaN,CAAb,CAA5D,GACEF,CAAA,CAAI,IAAJ,CAEA,CADAA,CAAA,CAAIE,CAAJ,CACA,CAAAF,CAAA,CAAI,GAAJ,CAHF,CAMIE,EAAJ,EAAWH,CAAX,GACEA,CADF,CACyB,CAAA,CADzB,CARiB,CAxBd,CAoCLpF,MAAOA,QAAQ,CAACA,CAAD,CAAQ,CAChBoF,CAAL,EACEC,CAAA,CAAIpD,CAAA,CAAejC,CAAf,CAAJ,CAFmB,CApClB,CAH0C,CAxRnDa,EAAA,CAAehB,CAAA8C,KAAAmD,UAAAC,SAAf,EAA8D,QAAQ,CAACC,CAAD,CAAM,CAE1E,MAAO,CAAG,EAAA,IAAAC,wBAAA,CAA6BD,CAA7B,CAAA,CAAoC,EAApC,CAFgE,CAtEjD,KA4EvB7D,EAAwB,iCA5ED,CA8EzBI,EAA0B,cA9ED,CAuFvBsD,EAAe3E,CAAA,CAAM,wBAAN,CAvFQ,CA2FvBgF,EAA8BhF,CAAA,CAAM,gDAAN,CA3FP,CA4FvBiF,EAA+BjF,CAAA,CAAM,OAAN,CA5FR,CA6FvBkF,EAAyB3F,CAAA,CAAO,EAAP,CACe0F,CADf,CAEeD,CAFf,CA7FF,CAkGvBG,EAAgB5F,CAAA,CAAO,EAAP,CAAWyF,CAAX,CAAwChF,CAAA,CAAM,qKAAN,CAAxC,CAlGO;AAuGvBoF,EAAiB7F,CAAA,CAAO,EAAP,CAAW0F,CAAX,CAAyCjF,CAAA,CAAM,2JAAN,CAAzC,CAvGM,CA+GvB6C,EAAc7C,CAAA,CAAM,wNAAN,CA/GS,CAoHvBsE,EAAkBtE,CAAA,CAAM,cAAN,CApHK,CAsHvB4C,EAAgBrD,CAAA,CAAO,EAAP,CACeoF,CADf,CAEeQ,CAFf,CAGeC,CAHf,CAIeF,CAJf,CAtHO,CA6HvBR,EAAW1E,CAAA,CAAM,uDAAN,CA7HY,CA+HvBqF,EAAYrF,CAAA,CAAM,kTAAN,CA/HW;AAuIvBsF,EAAWtF,CAAA,CAAM,guCAAN;AAcoE,CAAA,CAdpE,CAvIY,CAuJvByE,EAAalF,CAAA,CAAO,EAAP,CACemF,CADf,CAEeY,CAFf,CAGeD,CAHf,CAvJU,CA0KvB7B,EAAqE,QAAQ,CAAC7E,CAAD,CAAS4G,CAAT,CAAmB,CAyClGC,QAASA,EAA6B,CAAC1C,CAAD,CAAO,CAG3CA,CAAA,CAAO,mBAAP,CAA6BA,CAC7B,IAAI,CACF,IAAI2C,EAAOC,CAAA,IAAI/G,CAAAgH,UAAJD,iBAAA,CAAuC5C,CAAvC,CAA6C,WAA7C,CAAA2C,KACXA,EAAAtD,WAAAyD,OAAA,EACA,OAAOH,EAHL,CAIF,MAAOI,CAAP,CAAU,EAR+B,CAa7CC,QAASA,EAAiC,CAAChD,CAAD,CAAO,CAC/CS,CAAAG,UAAA,CAA6BZ,CAIzByC,EAAAQ,aAAJ,EACEzE,CAAA,CAAmBiC,CAAnB,CAGF,OAAOA,EATwC,CArDjD,IAAIyC,CACJ,IAAIT,CAAJ,EAAgBA,CAAAU,eAAhB,CACED,CAAA,CAAgBT,CAAAU,eAAAC,mBAAA,CAA2C,OAA3C,CADlB,KAGE,MAAM9G,EAAA,CAAgB,SAAhB,CAAN,CAEF,IAAImE,EAAmB4C,CAACH,CAAAI,gBAADD,EAAkCH,CAAAK,mBAAA,EAAlCF,eAAA,CAAoF,MAApF,CAGvB5C,EAAAG,UAAA,CAA6B,sDAC7B,OAAKH,EAAA4C,cAAA,CAA+B,KAA/B,CAAL;CAIE5C,CAAAG,UACA,CAD6B,kEAC7B,CAAIH,CAAA4C,cAAA,CAA+B,SAA/B,CAAJ,CACSX,CADT,CAGSM,CARX,EAYAQ,QAAgC,CAACxD,CAAD,CAAO,CAGrCA,CAAA,CAAO,mBAAP,CAA6BA,CAC7B,IAAI,CACFA,CAAA,CAAOyD,SAAA,CAAUzD,CAAV,CADL,CAEF,MAAO+C,CAAP,CAAU,CACV,MADU,CAGZ,IAAIW,EAAM,IAAI7H,CAAA8H,eACdD,EAAAE,aAAA,CAAmB,UACnBF,EAAAG,KAAA,CAAS,KAAT,CAAgB,+BAAhB,CAAkD7D,CAAlD,CAAwD,CAAA,CAAxD,CACA0D,EAAAI,KAAA,CAAS,IAAT,CACInB,EAAAA,CAAOe,CAAAK,SAAApB,KACXA,EAAAtD,WAAAyD,OAAA,EACA,OAAOH,EAf8B,CAvB2D,CAA5B,CAiErE9G,CAjEqE,CAiE7DA,CAAA4G,SAjE6D,CA1K7C,CAgc7B,CAAAuB,KAAA,CAEQ,CAAEC,eAAgB,OAAlB,CAFR,CAmIAnI,EAAAiB,OAAA,CAAe,YAAf,CAAAmH,OAAA,CAAoC,OAApC,CAA6C,CAAC,WAAD,CAAc,QAAQ,CAACC,CAAD,CAAY,CAAA,IACzEC,EACE,2FAFuE;AAGzEC,EAAgB,WAHyD,CAKzEC,EAAcxI,CAAAS,SAAA,CAAiB,OAAjB,CAL2D,CAMzEI,EAAYb,CAAAa,UAN6D,CAOzE4H,EAAazI,CAAAyI,WAP4D,CAQzEC,EAAW1I,CAAA0I,SAR8D,CASzEC,EAAW3I,CAAA2I,SAEf,OAAO,SAAQ,CAACC,CAAD,CAAOC,CAAP,CAAe9F,CAAf,CAA2B,CA6BxC+F,QAASA,EAAO,CAACF,CAAD,CAAO,CAChBA,CAAL,EAGA1E,CAAAsB,KAAA,CAAUvF,CAAA,CAAa2I,CAAb,CAAV,CAJqB,CAOvBG,QAASA,EAAO,CAACC,CAAD,CAAMJ,CAAN,CAAY,CAAA,IACtBjD,CADsB,CACjBsD,EAAiBC,CAAA,CAAaF,CAAb,CAC1B9E,EAAAsB,KAAA,CAAU,KAAV,CAEA,KAAKG,CAAL,GAAYsD,EAAZ,CACE/E,CAAAsB,KAAA,CAAUG,CAAV,CAAgB,IAAhB,CAAuBsD,CAAA,CAAetD,CAAf,CAAvB,CAA6C,IAA7C,CAGE,EAAA9E,CAAA,CAAUgI,CAAV,CAAJ,EAA2B,QAA3B,EAAuCI,EAAvC,EACE/E,CAAAsB,KAAA,CAAU,UAAV,CACUqD,CADV,CAEU,IAFV,CAIF3E,EAAAsB,KAAA,CAAU,QAAV,CACUwD,CAAA5G,QAAA,CAAY,IAAZ,CAAkB,QAAlB,CADV,CAEU,IAFV,CAGA0G,EAAA,CAAQF,CAAR,CACA1E,EAAAsB,KAAA,CAAU,MAAV,CAjB0B,CAnC5B,GAAY,IAAZ,EAAIoD,CAAJ,EAA6B,EAA7B,GAAoBA,CAApB,CAAiC,MAAOA,EACxC,IAAK,CAAAD,CAAA,CAASC,CAAT,CAAL,CAAqB,KAAMJ,EAAA,CAAY,WAAZ,CAA8DI,CAA9D,CAAN,CAYrB,IAVA,IAAIM,EACFT,CAAA,CAAW1F,CAAX,CAAA,CAAyBA,CAAzB,CACA2F,CAAA,CAAS3F,CAAT,CAAA,CAAuBoG,QAA4B,EAAG,CAAC,MAAOpG,EAAR,CAAtD,CACAqG,QAAiC,EAAG,CAAC,MAAO,EAAR,CAHtC,CAMIC,EAAMT,CANV,CAOI1E,EAAO,EAPX,CAQI8E,CARJ,CASItH,CACJ,CAAQ4H,CAAR,CAAgBD,CAAAC,MAAA,CAAUhB,CAAV,CAAhB,CAAA,CAEEU,CAQA,CARMM,CAAA,CAAM,CAAN,CAQN,CANKA,CAAA,CAAM,CAAN,CAML;AANkBA,CAAA,CAAM,CAAN,CAMlB,GALEN,CAKF,EALSM,CAAA,CAAM,CAAN,CAAA,CAAW,SAAX,CAAuB,SAKhC,EAL6CN,CAK7C,EAHAtH,CAGA,CAHI4H,CAAAC,MAGJ,CAFAT,CAAA,CAAQO,CAAAG,OAAA,CAAW,CAAX,CAAc9H,CAAd,CAAR,CAEA,CADAqH,CAAA,CAAQC,CAAR,CAAaM,CAAA,CAAM,CAAN,CAAAlH,QAAA,CAAiBmG,CAAjB,CAAgC,EAAhC,CAAb,CACA,CAAAc,CAAA,CAAMA,CAAAI,UAAA,CAAc/H,CAAd,CAAkB4H,CAAA,CAAM,CAAN,CAAA3H,OAAlB,CAERmH,EAAA,CAAQO,CAAR,CACA,OAAOhB,EAAA,CAAUnE,CAAA3D,KAAA,CAAU,EAAV,CAAV,CA3BiC,CAXmC,CAAlC,CAA7C,CArtB2B,CAA1B,CAAD,CA2xBGR,MA3xBH,CA2xBWA,MAAAC,QA3xBX;", - "sources":["angular-sanitize.js"], - "names":["window","angular","sanitizeText","chars","buf","htmlSanitizeWriter","writer","noop","join","$sanitizeMinErr","$$minErr","bind","extend","forEach","isDefined","lowercase","nodeContains","htmlParser","module","provider","$SanitizeProvider","toMap","str","lowercaseKeys","obj","items","split","i","length","attrToMap","attrs","map","ii","attr","name","value","encodeEntities","replace","SURROGATE_PAIR_REGEXP","hi","charCodeAt","low","NON_ALPHANUMERIC_REGEXP","stripCustomNsAttrs","node","nodeType","Node","ELEMENT_NODE","attributes","l","attrNode","attrName","toLowerCase","lastIndexOf","removeAttributeNode","nextNode","firstChild","getNonDescendant","propName","call","outerHTML","outerText","svgEnabled","$get","$$sanitizeUri","validElements","svgElements","html","uri","isImage","test","enableSvg","this.enableSvg","htmlParserImpl","handler","undefined","inertBodyElement","getInertBodyElement","mXSSAttempts","innerHTML","start","nodeName","textContent","end","removeChild","htmlSanitizeWriterImpl","uriValidator","ignoreCurrentElement","out","push","tag","blockedElements","key","lkey","validAttrs","uriAttrs","voidElements","prototype","contains","arg","compareDocumentPosition","optionalEndTagBlockElements","optionalEndTagInlineElements","optionalEndTagElements","blockElements","inlineElements","htmlAttrs","svgAttrs","document","getInertBodyElement_DOMParser","body","parseFromString","DOMParser","remove","e","getInertBodyElement_InertDocument","documentMode","inertDocument","implementation","createHTMLDocument","querySelector","documentElement","getDocumentElement","getInertBodyElement_XHR","encodeURI","xhr","XMLHttpRequest","responseType","open","send","response","info","angularVersion","filter","$sanitize","LINKY_URL_REGEXP","MAILTO_REGEXP","linkyMinErr","isFunction","isObject","isString","text","target","addText","addLink","url","linkAttributes","attributesFn","getAttributesObject","getEmptyAttributesObject","raw","match","index","substr","substring"] -} \ No newline at end of file diff --git a/setup/pub/angular-ui-bootstrap/angular-ui-bootstrap.min.js b/setup/pub/angular-ui-bootstrap/angular-ui-bootstrap.min.js deleted file mode 100644 index 2676e0ae9dd1..000000000000 --- a/setup/pub/angular-ui-bootstrap/angular-ui-bootstrap.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/* - * angular-ui-bootstrap - * http://angular-ui.github.io/bootstrap/ - - * Version: 0.11.0 - 2014-05-01 - * License: MIT - */ -angular.module("ui.bootstrap",["ui.bootstrap.tpls","ui.bootstrap.transition","ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.bindHtml","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.dropdown","ui.bootstrap.modal","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.tpls",["template/accordion/accordion-group.html","template/accordion/accordion.html","template/alert/alert.html","template/carousel/carousel.html","template/carousel/slide.html","template/datepicker/datepicker.html","template/datepicker/day.html","template/datepicker/month.html","template/datepicker/popup.html","template/datepicker/year.html","template/modal/backdrop.html","template/modal/window.html","template/pagination/pager.html","template/pagination/pagination.html","template/tooltip/tooltip-html-unsafe-popup.html","template/tooltip/tooltip-popup.html","template/popover/popover.html","template/progressbar/bar.html","template/progressbar/progress.html","template/progressbar/progressbar.html","template/rating/rating.html","template/tabs/tab.html","template/tabs/tabset.html","template/timepicker/timepicker.html","template/typeahead/typeahead-match.html","template/typeahead/typeahead-popup.html"]),angular.module("ui.bootstrap.transition",[]).factory("$transition",["$q","$timeout","$rootScope",function(a,b,c){function d(a){for(var b in a)if(void 0!==f.style[b])return a[b]}var e=function(d,f,g){g=g||{};var h=a.defer(),i=e[g.animation?"animationEndEventName":"transitionEndEventName"],j=function(){c.$apply(function(){d.unbind(i,j),h.resolve(d)})};return i&&d.bind(i,j),b(function(){angular.isString(f)?d.addClass(f):angular.isFunction(f)?f(d):angular.isObject(f)&&d.css(f),i||h.resolve(d)}),h.promise.cancel=function(){i&&d.unbind(i,j),h.reject("Transition cancelled")},h.promise},f=document.createElement("trans"),g={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"},h={WebkitTransition:"webkitAnimationEnd",MozTransition:"animationend",OTransition:"oAnimationEnd",transition:"animationend"};return e.transitionEndEventName=d(g),e.animationEndEventName=d(h),e}]),angular.module("ui.bootstrap.collapse",["ui.bootstrap.transition"]).directive("collapse",["$transition",function(a){return{link:function(b,c,d){function e(b){function d(){j===e&&(j=void 0)}var e=a(c,b);return j&&j.cancel(),j=e,e.then(d,d),e}function f(){k?(k=!1,g()):(c.removeClass("collapse").addClass("collapsing"),e({height:c[0].scrollHeight+"px"}).then(g))}function g(){c.removeClass("collapsing"),c.addClass("collapse in"),c.css({height:"auto"})}function h(){if(k)k=!1,i(),c.css({height:0});else{c.css({height:c[0].scrollHeight+"px"});{c[0].offsetWidth}c.removeClass("collapse in").addClass("collapsing"),e({height:0}).then(i)}}function i(){c.removeClass("collapsing"),c.addClass("collapse")}var j,k=!0;b.$watch(d.collapse,function(a){a?h():f()})}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("accordionConfig",{closeOthers:!0}).controller("AccordionController",["$scope","$attrs","accordionConfig",function(a,b,c){this.groups=[],this.closeOthers=function(d){var e=angular.isDefined(b.closeOthers)?a.$eval(b.closeOthers):c.closeOthers;e&&angular.forEach(this.groups,function(a){a!==d&&(a.isOpen=!1)})},this.addGroup=function(a){var b=this;this.groups.push(a),a.$on("$destroy",function(){b.removeGroup(a)})},this.removeGroup=function(a){var b=this.groups.indexOf(a);-1!==b&&this.groups.splice(b,1)}}]).directive("accordion",function(){return{restrict:"EA",controller:"AccordionController",transclude:!0,replace:!1,templateUrl:"template/accordion/accordion.html"}}).directive("accordionGroup",function(){return{require:"^accordion",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/accordion/accordion-group.html",scope:{heading:"@",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(a){this.heading=a}},link:function(a,b,c,d){d.addGroup(a),a.$watch("isOpen",function(b){b&&d.closeOthers(a)}),a.toggleOpen=function(){a.isDisabled||(a.isOpen=!a.isOpen)}}}}).directive("accordionHeading",function(){return{restrict:"EA",transclude:!0,template:"",replace:!0,require:"^accordionGroup",link:function(a,b,c,d,e){d.setHeading(e(a,function(){}))}}}).directive("accordionTransclude",function(){return{require:"^accordionGroup",link:function(a,b,c,d){a.$watch(function(){return d[c.accordionTransclude]},function(a){a&&(b.html(""),b.append(a))})}}}),angular.module("ui.bootstrap.alert",[]).controller("AlertController",["$scope","$attrs",function(a,b){a.closeable="close"in b}]).directive("alert",function(){return{restrict:"EA",controller:"AlertController",templateUrl:"template/alert/alert.html",transclude:!0,replace:!0,scope:{type:"@",close:"&"}}}),angular.module("ui.bootstrap.bindHtml",[]).directive("bindHtmlUnsafe",function(){return function(a,b,c){b.addClass("ng-binding").data("$binding",c.bindHtmlUnsafe),a.$watch(c.bindHtmlUnsafe,function(a){b.html(a||"")})}}),angular.module("ui.bootstrap.buttons",[]).constant("buttonConfig",{activeClass:"active",toggleEvent:"click"}).controller("ButtonsController",["buttonConfig",function(a){this.activeClass=a.activeClass||"active",this.toggleEvent=a.toggleEvent||"click"}]).directive("btnRadio",function(){return{require:["btnRadio","ngModel"],controller:"ButtonsController",link:function(a,b,c,d){var e=d[0],f=d[1];f.$render=function(){b.toggleClass(e.activeClass,angular.equals(f.$modelValue,a.$eval(c.btnRadio)))},b.bind(e.toggleEvent,function(){var d=b.hasClass(e.activeClass);(!d||angular.isDefined(c.uncheckable))&&a.$apply(function(){f.$setViewValue(d?null:a.$eval(c.btnRadio)),f.$render()})})}}}).directive("btnCheckbox",function(){return{require:["btnCheckbox","ngModel"],controller:"ButtonsController",link:function(a,b,c,d){function e(){return g(c.btnCheckboxTrue,!0)}function f(){return g(c.btnCheckboxFalse,!1)}function g(b,c){var d=a.$eval(b);return angular.isDefined(d)?d:c}var h=d[0],i=d[1];i.$render=function(){b.toggleClass(h.activeClass,angular.equals(i.$modelValue,e()))},b.bind(h.toggleEvent,function(){a.$apply(function(){i.$setViewValue(b.hasClass(h.activeClass)?f():e()),i.$render()})})}}}),angular.module("ui.bootstrap.carousel",["ui.bootstrap.transition"]).controller("CarouselController",["$scope","$timeout","$transition",function(a,b,c){function d(){e();var c=+a.interval;!isNaN(c)&&c>=0&&(g=b(f,c))}function e(){g&&(b.cancel(g),g=null)}function f(){h?(a.next(),d()):a.pause()}var g,h,i=this,j=i.slides=a.slides=[],k=-1;i.currentSlide=null;var l=!1;i.select=a.select=function(e,f){function g(){if(!l){if(i.currentSlide&&angular.isString(f)&&!a.noTransition&&e.$element){e.$element.addClass(f);{e.$element[0].offsetWidth}angular.forEach(j,function(a){angular.extend(a,{direction:"",entering:!1,leaving:!1,active:!1})}),angular.extend(e,{direction:f,active:!0,entering:!0}),angular.extend(i.currentSlide||{},{direction:f,leaving:!0}),a.$currentTransition=c(e.$element,{}),function(b,c){a.$currentTransition.then(function(){h(b,c)},function(){h(b,c)})}(e,i.currentSlide)}else h(e,i.currentSlide);i.currentSlide=e,k=m,d()}}function h(b,c){angular.extend(b,{direction:"",active:!0,leaving:!1,entering:!1}),angular.extend(c||{},{direction:"",active:!1,leaving:!1,entering:!1}),a.$currentTransition=null}var m=j.indexOf(e);void 0===f&&(f=m>k?"next":"prev"),e&&e!==i.currentSlide&&(a.$currentTransition?(a.$currentTransition.cancel(),b(g)):g())},a.$on("$destroy",function(){l=!0}),i.indexOfSlide=function(a){return j.indexOf(a)},a.next=function(){var b=(k+1)%j.length;return a.$currentTransition?void 0:i.select(j[b],"next")},a.prev=function(){var b=0>k-1?j.length-1:k-1;return a.$currentTransition?void 0:i.select(j[b],"prev")},a.isActive=function(a){return i.currentSlide===a},a.$watch("interval",d),a.$on("$destroy",e),a.play=function(){h||(h=!0,d())},a.pause=function(){a.noPause||(h=!1,e())},i.addSlide=function(b,c){b.$element=c,j.push(b),1===j.length||b.active?(i.select(j[j.length-1]),1==j.length&&a.play()):b.active=!1},i.removeSlide=function(a){var b=j.indexOf(a);j.splice(b,1),j.length>0&&a.active?i.select(b>=j.length?j[b-1]:j[b]):k>b&&k--}}]).directive("carousel",[function(){return{restrict:"EA",transclude:!0,replace:!0,controller:"CarouselController",require:"carousel",templateUrl:"template/carousel/carousel.html",scope:{interval:"=",noTransition:"=",noPause:"="}}}]).directive("slide",function(){return{require:"^carousel",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/carousel/slide.html",scope:{active:"=?"},link:function(a,b,c,d){d.addSlide(a,b),a.$on("$destroy",function(){d.removeSlide(a)}),a.$watch("active",function(b){b&&d.select(a)})}}}),angular.module("ui.bootstrap.dateparser",[]).service("dateParser",["$locale","orderByFilter",function(a,b){function c(a,b,c){return 1===b&&c>28?29===c&&(a%4===0&&a%100!==0||a%400===0):3===b||5===b||8===b||10===b?31>c:!0}this.parsers={};var d={yyyy:{regex:"\\d{4}",apply:function(a){this.year=+a}},yy:{regex:"\\d{2}",apply:function(a){this.year=+a+2e3}},y:{regex:"\\d{1,4}",apply:function(a){this.year=+a}},MMMM:{regex:a.DATETIME_FORMATS.MONTH.join("|"),apply:function(b){this.month=a.DATETIME_FORMATS.MONTH.indexOf(b)}},MMM:{regex:a.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(b){this.month=a.DATETIME_FORMATS.SHORTMONTH.indexOf(b)}},MM:{regex:"0[1-9]|1[0-2]",apply:function(a){this.month=a-1}},M:{regex:"[1-9]|1[0-2]",apply:function(a){this.month=a-1}},dd:{regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},d:{regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},EEEE:{regex:a.DATETIME_FORMATS.DAY.join("|")},EEE:{regex:a.DATETIME_FORMATS.SHORTDAY.join("|")}};this.createParser=function(a){var c=[],e=a.split("");return angular.forEach(d,function(b,d){var f=a.indexOf(d);if(f>-1){a=a.split(""),e[f]="("+b.regex+")",a[f]="$";for(var g=f+1,h=f+d.length;h>g;g++)e[g]="",a[g]="$";a=a.join(""),c.push({index:f,apply:b.apply})}}),{regex:new RegExp("^"+e.join("")+"$"),map:b(c,"index")}},this.parse=function(b,d){if(!angular.isString(b))return b;d=a.DATETIME_FORMATS[d]||d,this.parsers[d]||(this.parsers[d]=this.createParser(d));var e=this.parsers[d],f=e.regex,g=e.map,h=b.match(f);if(h&&h.length){for(var i,j={year:1900,month:0,date:1,hours:0},k=1,l=h.length;l>k;k++){var m=g[k-1];m.apply&&m.apply.call(j,h[k])}return c(j.year,j.month,j.date)&&(i=new Date(j.year,j.month,j.date,j.hours)),i}}}]),angular.module("ui.bootstrap.position",[]).factory("$position",["$document","$window",function(a,b){function c(a,c){return a.currentStyle?a.currentStyle[c]:b.getComputedStyle?b.getComputedStyle(a)[c]:a.style[c]}function d(a){return"static"===(c(a,"position")||"static")}var e=function(b){for(var c=a[0],e=b.offsetParent||c;e&&e!==c&&d(e);)e=e.offsetParent;return e||c};return{position:function(b){var c=this.offset(b),d={top:0,left:0},f=e(b[0]);f!=a[0]&&(d=this.offset(angular.element(f)),d.top+=f.clientTop-f.scrollTop,d.left+=f.clientLeft-f.scrollLeft);var g=b[0].getBoundingClientRect();return{width:g.width||b.prop("offsetWidth"),height:g.height||b.prop("offsetHeight"),top:c.top-d.top,left:c.left-d.left}},offset:function(c){var d=c[0].getBoundingClientRect();return{width:d.width||c.prop("offsetWidth"),height:d.height||c.prop("offsetHeight"),top:d.top+(b.pageYOffset||a[0].documentElement.scrollTop),left:d.left+(b.pageXOffset||a[0].documentElement.scrollLeft)}},positionElements:function(a,b,c,d){var e,f,g,h,i=c.split("-"),j=i[0],k=i[1]||"center";e=d?this.offset(a):this.position(a),f=b.prop("offsetWidth"),g=b.prop("offsetHeight");var l={center:function(){return e.left+e.width/2-f/2},left:function(){return e.left},right:function(){return e.left+e.width}},m={center:function(){return e.top+e.height/2-g/2},top:function(){return e.top},bottom:function(){return e.top+e.height}};switch(j){case"right":h={top:m[k](),left:l[j]()};break;case"left":h={top:m[k](),left:e.left-f};break;case"bottom":h={top:m[j](),left:l[k]()};break;default:h={top:e.top-g,left:l[k]()}}return h}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.position"]).constant("datepickerConfig",{formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",datepickerMode:"day",minMode:"day",maxMode:"year",showWeeks:!0,startingDay:0,yearRange:20,minDate:null,maxDate:null}).controller("DatepickerController",["$scope","$attrs","$parse","$interpolate","$timeout","$log","dateFilter","datepickerConfig",function(a,b,c,d,e,f,g,h){var i=this,j={$setViewValue:angular.noop};this.modes=["day","month","year"],angular.forEach(["formatDay","formatMonth","formatYear","formatDayHeader","formatDayTitle","formatMonthTitle","minMode","maxMode","showWeeks","startingDay","yearRange"],function(c,e){i[c]=angular.isDefined(b[c])?8>e?d(b[c])(a.$parent):a.$parent.$eval(b[c]):h[c]}),angular.forEach(["minDate","maxDate"],function(d){b[d]?a.$parent.$watch(c(b[d]),function(a){i[d]=a?new Date(a):null,i.refreshView()}):i[d]=h[d]?new Date(h[d]):null}),a.datepickerMode=a.datepickerMode||h.datepickerMode,a.uniqueId="datepicker-"+a.$id+"-"+Math.floor(1e4*Math.random()),this.activeDate=angular.isDefined(b.initDate)?a.$parent.$eval(b.initDate):new Date,a.isActive=function(b){return 0===i.compare(b.date,i.activeDate)?(a.activeDateId=b.uid,!0):!1},this.init=function(a){j=a,j.$render=function(){i.render()}},this.render=function(){if(j.$modelValue){var a=new Date(j.$modelValue),b=!isNaN(a);b?this.activeDate=a:f.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.'),j.$setValidity("date",b)}this.refreshView()},this.refreshView=function(){if(this.element){this._refreshView();var a=j.$modelValue?new Date(j.$modelValue):null;j.$setValidity("date-disabled",!a||this.element&&!this.isDisabled(a))}},this.createDateObject=function(a,b){var c=j.$modelValue?new Date(j.$modelValue):null;return{date:a,label:g(a,b),selected:c&&0===this.compare(a,c),disabled:this.isDisabled(a),current:0===this.compare(a,new Date)}},this.isDisabled=function(c){return this.minDate&&this.compare(c,this.minDate)<0||this.maxDate&&this.compare(c,this.maxDate)>0||b.dateDisabled&&a.dateDisabled({date:c,mode:a.datepickerMode})},this.split=function(a,b){for(var c=[];a.length>0;)c.push(a.splice(0,b));return c},a.select=function(b){if(a.datepickerMode===i.minMode){var c=j.$modelValue?new Date(j.$modelValue):new Date(0,0,0,0,0,0,0);c.setFullYear(b.getFullYear(),b.getMonth(),b.getDate()),j.$setViewValue(c),j.$render()}else i.activeDate=b,a.datepickerMode=i.modes[i.modes.indexOf(a.datepickerMode)-1]},a.move=function(a){var b=i.activeDate.getFullYear()+a*(i.step.years||0),c=i.activeDate.getMonth()+a*(i.step.months||0);i.activeDate.setFullYear(b,c,1),i.refreshView()},a.toggleMode=function(b){b=b||1,a.datepickerMode===i.maxMode&&1===b||a.datepickerMode===i.minMode&&-1===b||(a.datepickerMode=i.modes[i.modes.indexOf(a.datepickerMode)+b])},a.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var k=function(){e(function(){i.element[0].focus()},0,!1)};a.$on("datepicker.focus",k),a.keydown=function(b){var c=a.keys[b.which];if(c&&!b.shiftKey&&!b.altKey)if(b.preventDefault(),b.stopPropagation(),"enter"===c||"space"===c){if(i.isDisabled(i.activeDate))return;a.select(i.activeDate),k()}else!b.ctrlKey||"up"!==c&&"down"!==c?(i.handleKeyDown(c,b),i.refreshView()):(a.toggleMode("up"===c?1:-1),k())}}]).directive("datepicker",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/datepicker.html",scope:{datepickerMode:"=?",dateDisabled:"&"},require:["datepicker","?^ngModel"],controller:"DatepickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f)}}}).directive("daypicker",["dateFilter",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/day.html",require:"^datepicker",link:function(b,c,d,e){function f(a,b){return 1!==b||a%4!==0||a%100===0&&a%400!==0?i[b]:29}function g(a,b){var c=new Array(b),d=new Date(a),e=0;for(d.setHours(12);b>e;)c[e++]=new Date(d),d.setDate(d.getDate()+1);return c}function h(a){var b=new Date(a);b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1}b.showWeeks=e.showWeeks,e.step={months:1},e.element=c;var i=[31,28,31,30,31,30,31,31,30,31,30,31];e._refreshView=function(){var c=e.activeDate.getFullYear(),d=e.activeDate.getMonth(),f=new Date(c,d,1),i=e.startingDay-f.getDay(),j=i>0?7-i:-i,k=new Date(f);j>0&&k.setDate(-j+1);for(var l=g(k,42),m=0;42>m;m++)l[m]=angular.extend(e.createDateObject(l[m],e.formatDay),{secondary:l[m].getMonth()!==d,uid:b.uniqueId+"-"+m});b.labels=new Array(7);for(var n=0;7>n;n++)b.labels[n]={abbr:a(l[n].date,e.formatDayHeader),full:a(l[n].date,"EEEE")};if(b.title=a(e.activeDate,e.formatDayTitle),b.rows=e.split(l,7),b.showWeeks){b.weekNumbers=[];for(var o=h(b.rows[0][0].date),p=b.rows.length;b.weekNumbers.push(o++)f;f++)c[f]=angular.extend(e.createDateObject(new Date(d,f,1),e.formatMonth),{uid:b.uniqueId+"-"+f});b.title=a(e.activeDate,e.formatMonthTitle),b.rows=e.split(c,3)},e.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth())-new Date(b.getFullYear(),b.getMonth())},e.handleKeyDown=function(a){var b=e.activeDate.getMonth();if("left"===a)b-=1;else if("up"===a)b-=3;else if("right"===a)b+=1;else if("down"===a)b+=3;else if("pageup"===a||"pagedown"===a){var c=e.activeDate.getFullYear()+("pageup"===a?-1:1);e.activeDate.setFullYear(c)}else"home"===a?b=0:"end"===a&&(b=11);e.activeDate.setMonth(b)},e.refreshView()}}}]).directive("yearpicker",["dateFilter",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/year.html",require:"^datepicker",link:function(a,b,c,d){function e(a){return parseInt((a-1)/f,10)*f+1}var f=d.yearRange;d.step={years:f},d.element=b,d._refreshView=function(){for(var b=new Array(f),c=0,g=e(d.activeDate.getFullYear());f>c;c++)b[c]=angular.extend(d.createDateObject(new Date(g+c,0,1),d.formatYear),{uid:a.uniqueId+"-"+c});a.title=[b[0].label,b[f-1].label].join(" - "),a.rows=d.split(b,5)},d.compare=function(a,b){return a.getFullYear()-b.getFullYear()},d.handleKeyDown=function(a){var b=d.activeDate.getFullYear();"left"===a?b-=1:"up"===a?b-=5:"right"===a?b+=1:"down"===a?b+=5:"pageup"===a||"pagedown"===a?b+=("pageup"===a?-1:1)*d.step.years:"home"===a?b=e(d.activeDate.getFullYear()):"end"===a&&(b=e(d.activeDate.getFullYear())+f-1),d.activeDate.setFullYear(b)},d.refreshView()}}}]).constant("datepickerPopupConfig",{datepickerPopup:"yyyy-MM-dd",currentText:"Today",clearText:"Clear",closeText:"Done",closeOnDateSelection:!0,appendToBody:!1,showButtonBar:!0}).directive("datepickerPopup",["$compile","$parse","$document","$position","dateFilter","dateParser","datepickerPopupConfig",function(a,b,c,d,e,f,g){return{restrict:"EA",require:"ngModel",scope:{isOpen:"=?",currentText:"@",clearText:"@",closeText:"@",dateDisabled:"&"},link:function(h,i,j,k){function l(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}function m(a){if(a){if(angular.isDate(a)&&!isNaN(a))return k.$setValidity("date",!0),a;if(angular.isString(a)){var b=f.parse(a,n)||new Date(a);return isNaN(b)?void k.$setValidity("date",!1):(k.$setValidity("date",!0),b)}return void k.$setValidity("date",!1)}return k.$setValidity("date",!0),null}var n,o=angular.isDefined(j.closeOnDateSelection)?h.$parent.$eval(j.closeOnDateSelection):g.closeOnDateSelection,p=angular.isDefined(j.datepickerAppendToBody)?h.$parent.$eval(j.datepickerAppendToBody):g.appendToBody;h.showButtonBar=angular.isDefined(j.showButtonBar)?h.$parent.$eval(j.showButtonBar):g.showButtonBar,h.getText=function(a){return h[a+"Text"]||g[a+"Text"]},j.$observe("datepickerPopup",function(a){n=a||g.datepickerPopup,k.$render()});var q=angular.element("

    ");q.attr({"ng-model":"date","ng-change":"dateSelection()"});var r=angular.element(q.children()[0]);j.datepickerOptions&&angular.forEach(h.$parent.$eval(j.datepickerOptions),function(a,b){r.attr(l(b),a)}),angular.forEach(["minDate","maxDate"],function(a){j[a]&&(h.$parent.$watch(b(j[a]),function(b){h[a]=b}),r.attr(l(a),a))}),j.dateDisabled&&r.attr("date-disabled","dateDisabled({ date: date, mode: mode })"),k.$parsers.unshift(m),h.dateSelection=function(a){angular.isDefined(a)&&(h.date=a),k.$setViewValue(h.date),k.$render(),o&&(h.isOpen=!1,i[0].focus())},i.bind("input change keyup",function(){h.$apply(function(){h.date=k.$modelValue})}),k.$render=function(){var a=k.$viewValue?e(k.$viewValue,n):"";i.val(a),h.date=m(k.$modelValue)};var s=function(a){h.isOpen&&a.target!==i[0]&&h.$apply(function(){h.isOpen=!1})},t=function(a){h.keydown(a)};i.bind("keydown",t),h.keydown=function(a){27===a.which?(a.preventDefault(),a.stopPropagation(),h.close()):40!==a.which||h.isOpen||(h.isOpen=!0)},h.$watch("isOpen",function(a){a?(h.$broadcast("datepicker.focus"),h.position=p?d.offset(i):d.position(i),h.position.top=h.position.top+i.prop("offsetHeight"),c.bind("click",s)):c.unbind("click",s)}),h.select=function(a){if("today"===a){var b=new Date;angular.isDate(k.$modelValue)?(a=new Date(k.$modelValue),a.setFullYear(b.getFullYear(),b.getMonth(),b.getDate())):a=new Date(b.setHours(0,0,0,0))}h.dateSelection(a)},h.close=function(){h.isOpen=!1,i[0].focus()};var u=a(q)(h);p?c.find("body").append(u):i.after(u),h.$on("$destroy",function(){u.remove(),i.unbind("keydown",t),c.unbind("click",s)})}}}]).directive("datepickerPopupWrap",function(){return{restrict:"EA",replace:!0,transclude:!0,templateUrl:"template/datepicker/popup.html",link:function(a,b){b.bind("click",function(a){a.preventDefault(),a.stopPropagation()})}}}),angular.module("ui.bootstrap.dropdown",[]).constant("dropdownConfig",{openClass:"open"}).service("dropdownService",["$document",function(a){var b=null;this.open=function(e){b||(a.bind("click",c),a.bind("keydown",d)),b&&b!==e&&(b.isOpen=!1),b=e},this.close=function(e){b===e&&(b=null,a.unbind("click",c),a.unbind("keydown",d))};var c=function(a){a&&a.isDefaultPrevented()||b.$apply(function(){b.isOpen=!1})},d=function(a){27===a.which&&(b.focusToggleElement(),c())}}]).controller("DropdownController",["$scope","$attrs","$parse","dropdownConfig","dropdownService","$animate",function(a,b,c,d,e,f){var g,h=this,i=a.$new(),j=d.openClass,k=angular.noop,l=b.onToggle?c(b.onToggle):angular.noop;this.init=function(d){h.$element=d,b.isOpen&&(g=c(b.isOpen),k=g.assign,a.$watch(g,function(a){i.isOpen=!!a}))},this.toggle=function(a){return i.isOpen=arguments.length?!!a:!i.isOpen},this.isOpen=function(){return i.isOpen},i.focusToggleElement=function(){h.toggleElement&&h.toggleElement[0].focus()},i.$watch("isOpen",function(b,c){f[b?"addClass":"removeClass"](h.$element,j),b?(i.focusToggleElement(),e.open(i)):e.close(i),k(a,b),angular.isDefined(b)&&b!==c&&l(a,{open:!!b})}),a.$on("$locationChangeSuccess",function(){i.isOpen=!1}),a.$on("$destroy",function(){i.$destroy()})}]).directive("dropdown",function(){return{restrict:"CA",controller:"DropdownController",link:function(a,b,c,d){d.init(b)}}}).directive("dropdownToggle",function(){return{restrict:"CA",require:"?^dropdown",link:function(a,b,c,d){if(d){d.toggleElement=b;var e=function(e){e.preventDefault(),b.hasClass("disabled")||c.disabled||a.$apply(function(){d.toggle()})};b.bind("click",e),b.attr({"aria-haspopup":!0,"aria-expanded":!1}),a.$watch(d.isOpen,function(a){b.attr("aria-expanded",!!a)}),a.$on("$destroy",function(){b.unbind("click",e)})}}}}),angular.module("ui.bootstrap.modal",["ui.bootstrap.transition"]).factory("$$stackedMap",function(){return{createNew:function(){var a=[];return{add:function(b,c){a.push({key:b,value:c})},get:function(b){for(var c=0;c0),i()})}function i(){if(k&&-1==g()){var a=l;j(k,l,150,function(){a.$destroy(),a=null}),k=void 0,l=void 0}}function j(c,d,e,f){function g(){g.done||(g.done=!0,c.remove(),f&&f())}d.animate=!1;var h=a.transitionEndEventName;if(h){var i=b(g,e);c.bind(h,function(){b.cancel(i),g(),d.$apply()})}else b(g,0)}var k,l,m="modal-open",n=f.createNew(),o={};return e.$watch(g,function(a){l&&(l.index=a)}),c.bind("keydown",function(a){var b;27===a.which&&(b=n.top(),b&&b.value.keyboard&&(a.preventDefault(),e.$apply(function(){o.dismiss(b.key,"escape key press")})))}),o.open=function(a,b){n.add(a,{deferred:b.deferred,modalScope:b.scope,backdrop:b.backdrop,keyboard:b.keyboard});var f=c.find("body").eq(0),h=g();h>=0&&!k&&(l=e.$new(!0),l.index=h,k=d("
    ")(l),f.append(k));var i=angular.element("
    ");i.attr({"template-url":b.windowTemplateUrl,"window-class":b.windowClass,size:b.size,index:n.length()-1,animate:"animate"}).html(b.content);var j=d(i)(b.scope);n.top().value.modalDomEl=j,f.append(j),f.addClass(m)},o.close=function(a,b){var c=n.get(a).value;c&&(c.deferred.resolve(b),h(a))},o.dismiss=function(a,b){var c=n.get(a).value;c&&(c.deferred.reject(b),h(a))},o.dismissAll=function(a){for(var b=this.getTop();b;)this.dismiss(b.key,a),b=this.getTop()},o.getTop=function(){return n.top()},o}]).provider("$modal",function(){var a={options:{backdrop:!0,keyboard:!0},$get:["$injector","$rootScope","$q","$http","$templateCache","$controller","$modalStack",function(b,c,d,e,f,g,h){function i(a){return a.template?d.when(a.template):e.get(a.templateUrl,{cache:f}).then(function(a){return a.data})}function j(a){var c=[];return angular.forEach(a,function(a){(angular.isFunction(a)||angular.isArray(a))&&c.push(d.when(b.invoke(a)))}),c}var k={};return k.open=function(b){var e=d.defer(),f=d.defer(),k={result:e.promise,opened:f.promise,close:function(a){h.close(k,a)},dismiss:function(a){h.dismiss(k,a)}};if(b=angular.extend({},a.options,b),b.resolve=b.resolve||{},!b.template&&!b.templateUrl)throw new Error("One of template or templateUrl options is required.");var l=d.all([i(b)].concat(j(b.resolve)));return l.then(function(a){var d=(b.scope||c).$new();d.$close=k.close,d.$dismiss=k.dismiss;var f,i={},j=1;b.controller&&(i.$scope=d,i.$modalInstance=k,angular.forEach(b.resolve,function(b,c){i[c]=a[j++]}),f=g(b.controller,i)),h.open(k,{scope:d,deferred:e,content:a[0],backdrop:b.backdrop,keyboard:b.keyboard,windowClass:b.windowClass,windowTemplateUrl:b.windowTemplateUrl,size:b.size})},function(a){e.reject(a)}),l.then(function(){f.resolve(!0)},function(){f.reject(!1)}),k},k}]};return a}),angular.module("ui.bootstrap.pagination",[]).controller("PaginationController",["$scope","$attrs","$parse",function(a,b,c){var d=this,e={$setViewValue:angular.noop},f=b.numPages?c(b.numPages).assign:angular.noop;this.init=function(f,g){e=f,this.config=g,e.$render=function(){d.render()},b.itemsPerPage?a.$parent.$watch(c(b.itemsPerPage),function(b){d.itemsPerPage=parseInt(b,10),a.totalPages=d.calculateTotalPages()}):this.itemsPerPage=g.itemsPerPage},this.calculateTotalPages=function(){var b=this.itemsPerPage<1?1:Math.ceil(a.totalItems/this.itemsPerPage);return Math.max(b||0,1)},this.render=function(){a.page=parseInt(e.$viewValue,10)||1},a.selectPage=function(b){a.page!==b&&b>0&&b<=a.totalPages&&(e.$setViewValue(b),e.$render())},a.getText=function(b){return a[b+"Text"]||d.config[b+"Text"]},a.noPrevious=function(){return 1===a.page},a.noNext=function(){return a.page===a.totalPages},a.$watch("totalItems",function(){a.totalPages=d.calculateTotalPages()}),a.$watch("totalPages",function(b){f(a.$parent,b),a.page>b?a.selectPage(b):e.$render()})}]).constant("paginationConfig",{itemsPerPage:10,boundaryLinks:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0}).directive("pagination",["$parse","paginationConfig",function(a,b){return{restrict:"EA",scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@"},require:["pagination","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pagination.html",replace:!0,link:function(c,d,e,f){function g(a,b,c){return{number:a,text:b,active:c}}function h(a,b){var c=[],d=1,e=b,f=angular.isDefined(k)&&b>k;f&&(l?(d=Math.max(a-Math.floor(k/2),1),e=d+k-1,e>b&&(e=b,d=e-k+1)):(d=(Math.ceil(a/k)-1)*k+1,e=Math.min(d+k-1,b)));for(var h=d;e>=h;h++){var i=g(h,h,h===a);c.push(i)}if(f&&!l){if(d>1){var j=g(d-1,"...",!1);c.unshift(j)}if(b>e){var m=g(e+1,"...",!1);c.push(m)}}return c}var i=f[0],j=f[1];if(j){var k=angular.isDefined(e.maxSize)?c.$parent.$eval(e.maxSize):b.maxSize,l=angular.isDefined(e.rotate)?c.$parent.$eval(e.rotate):b.rotate;c.boundaryLinks=angular.isDefined(e.boundaryLinks)?c.$parent.$eval(e.boundaryLinks):b.boundaryLinks,c.directionLinks=angular.isDefined(e.directionLinks)?c.$parent.$eval(e.directionLinks):b.directionLinks,i.init(j,b),e.maxSize&&c.$parent.$watch(a(e.maxSize),function(a){k=parseInt(a,10),i.render()});var m=i.render;i.render=function(){m(),c.page>0&&c.page<=c.totalPages&&(c.pages=h(c.page,c.totalPages))}}}}}]).constant("pagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("pager",["pagerConfig",function(a){return{restrict:"EA",scope:{totalItems:"=",previousText:"@",nextText:"@"},require:["pager","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pager.html",replace:!0,link:function(b,c,d,e){var f=e[0],g=e[1];g&&(b.align=angular.isDefined(d.align)?b.$parent.$eval(d.align):a.align,f.init(g,a))}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).provider("$tooltip",function(){function a(a){var b=/[A-Z]/g,c="-"; - return a.replace(b,function(a,b){return(b?c:"")+a.toLowerCase()})}var b={placement:"top",animation:!0,popupDelay:0},c={mouseenter:"mouseleave",click:"click",focus:"blur"},d={};this.options=function(a){angular.extend(d,a)},this.setTriggers=function(a){angular.extend(c,a)},this.$get=["$window","$compile","$timeout","$parse","$document","$position","$interpolate",function(e,f,g,h,i,j,k){return function(e,l,m){function n(a){var b=a||o.trigger||m,d=c[b]||b;return{show:b,hide:d}}var o=angular.extend({},b,d),p=a(e),q=k.startSymbol(),r=k.endSymbol(),s="
    ';return{restrict:"EA",scope:!0,compile:function(){var a=f(s);return function(b,c,d){function f(){b.tt_isOpen?m():k()}function k(){(!y||b.$eval(d[l+"Enable"]))&&(b.tt_popupDelay?v||(v=g(p,b.tt_popupDelay,!1),v.then(function(a){a()})):p()())}function m(){b.$apply(function(){q()})}function p(){return v=null,u&&(g.cancel(u),u=null),b.tt_content?(r(),t.css({top:0,left:0,display:"block"}),w?i.find("body").append(t):c.after(t),z(),b.tt_isOpen=!0,b.$digest(),z):angular.noop}function q(){b.tt_isOpen=!1,g.cancel(v),v=null,b.tt_animation?u||(u=g(s,500)):s()}function r(){t&&s(),t=a(b,function(){}),b.$digest()}function s(){u=null,t&&(t.remove(),t=null)}var t,u,v,w=angular.isDefined(o.appendToBody)?o.appendToBody:!1,x=n(void 0),y=angular.isDefined(d[l+"Enable"]),z=function(){var a=j.positionElements(c,t,b.tt_placement,w);a.top+="px",a.left+="px",t.css(a)};b.tt_isOpen=!1,d.$observe(e,function(a){b.tt_content=a,!a&&b.tt_isOpen&&q()}),d.$observe(l+"Title",function(a){b.tt_title=a}),d.$observe(l+"Placement",function(a){b.tt_placement=angular.isDefined(a)?a:o.placement}),d.$observe(l+"PopupDelay",function(a){var c=parseInt(a,10);b.tt_popupDelay=isNaN(c)?o.popupDelay:c});var A=function(){c.unbind(x.show,k),c.unbind(x.hide,m)};d.$observe(l+"Trigger",function(a){A(),x=n(a),x.show===x.hide?c.bind(x.show,f):(c.bind(x.show,k),c.bind(x.hide,m))});var B=b.$eval(d[l+"Animation"]);b.tt_animation=angular.isDefined(B)?!!B:o.animation,d.$observe(l+"AppendToBody",function(a){w=angular.isDefined(a)?h(a)(b):w}),w&&b.$on("$locationChangeSuccess",function(){b.tt_isOpen&&q()}),b.$on("$destroy",function(){g.cancel(u),g.cancel(v),A(),s()})}}}}}]}).directive("tooltipPopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-popup.html"}}).directive("tooltip",["$tooltip",function(a){return a("tooltip","tooltip","mouseenter")}]).directive("tooltipHtmlUnsafePopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-unsafe-popup.html"}}).directive("tooltipHtmlUnsafe",["$tooltip",function(a){return a("tooltipHtmlUnsafe","tooltip","mouseenter")}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("popoverPopup",function(){return{restrict:"EA",replace:!0,scope:{title:"@",content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/popover/popover.html"}}).directive("popover",["$tooltip",function(a){return a("popover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("progressConfig",{animate:!0,max:100}).controller("ProgressController",["$scope","$attrs","progressConfig",function(a,b,c){var d=this,e=angular.isDefined(b.animate)?a.$parent.$eval(b.animate):c.animate;this.bars=[],a.max=angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max,this.addBar=function(b,c){e||c.css({transition:"none"}),this.bars.push(b),b.$watch("value",function(c){b.percent=+(100*c/a.max).toFixed(2)}),b.$on("$destroy",function(){c=null,d.removeBar(b)})},this.removeBar=function(a){this.bars.splice(this.bars.indexOf(a),1)}}]).directive("progress",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",require:"progress",scope:{},templateUrl:"template/progressbar/progress.html"}}).directive("bar",function(){return{restrict:"EA",replace:!0,transclude:!0,require:"^progress",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/bar.html",link:function(a,b,c,d){d.addBar(a,b)}}}).directive("progressbar",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/progressbar.html",link:function(a,b,c,d){d.addBar(a,angular.element(b.children()[0]))}}}),angular.module("ui.bootstrap.rating",[]).constant("ratingConfig",{max:5,stateOn:null,stateOff:null}).controller("RatingController",["$scope","$attrs","ratingConfig",function(a,b,c){var d={$setViewValue:angular.noop};this.init=function(e){d=e,d.$render=this.render,this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):c.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):c.stateOff;var f=angular.isDefined(b.ratingStates)?a.$parent.$eval(b.ratingStates):new Array(angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max);a.range=this.buildTemplateObjects(f)},this.buildTemplateObjects=function(a){for(var b=0,c=a.length;c>b;b++)a[b]=angular.extend({index:b},{stateOn:this.stateOn,stateOff:this.stateOff},a[b]);return a},a.rate=function(b){!a.readonly&&b>=0&&b<=a.range.length&&(d.$setViewValue(b),d.$render())},a.enter=function(b){a.readonly||(a.value=b),a.onHover({value:b})},a.reset=function(){a.value=d.$viewValue,a.onLeave()},a.onKeydown=function(b){/(37|38|39|40)/.test(b.which)&&(b.preventDefault(),b.stopPropagation(),a.rate(a.value+(38===b.which||39===b.which?1:-1)))},this.render=function(){a.value=d.$viewValue}}]).directive("rating",function(){return{restrict:"EA",require:["rating","ngModel"],scope:{readonly:"=?",onHover:"&",onLeave:"&"},controller:"RatingController",templateUrl:"template/rating/rating.html",replace:!0,link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f)}}}),angular.module("ui.bootstrap.tabs",[]).controller("TabsetController",["$scope",function(a){var b=this,c=b.tabs=a.tabs=[];b.select=function(a){angular.forEach(c,function(b){b.active&&b!==a&&(b.active=!1,b.onDeselect())}),a.active=!0,a.onSelect()},b.addTab=function(a){c.push(a),1===c.length?a.active=!0:a.active&&b.select(a)},b.removeTab=function(a){var d=c.indexOf(a);if(a.active&&c.length>1){var e=d==c.length-1?d-1:d+1;b.select(c[e])}c.splice(d,1)}}]).directive("tabset",function(){return{restrict:"EA",transclude:!0,replace:!0,scope:{type:"@"},controller:"TabsetController",templateUrl:"template/tabs/tabset.html",link:function(a,b,c){a.vertical=angular.isDefined(c.vertical)?a.$parent.$eval(c.vertical):!1,a.justified=angular.isDefined(c.justified)?a.$parent.$eval(c.justified):!1}}}).directive("tab",["$parse",function(a){return{require:"^tabset",restrict:"EA",replace:!0,templateUrl:"template/tabs/tab.html",transclude:!0,scope:{active:"=?",heading:"@",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},compile:function(b,c,d){return function(b,c,e,f){b.$watch("active",function(a){a&&f.select(b)}),b.disabled=!1,e.disabled&&b.$parent.$watch(a(e.disabled),function(a){b.disabled=!!a}),b.select=function(){b.disabled||(b.active=!0)},f.addTab(b),b.$on("$destroy",function(){f.removeTab(b)}),b.$transcludeFn=d}}}}]).directive("tabHeadingTransclude",[function(){return{restrict:"A",require:"^tab",link:function(a,b){a.$watch("headingElement",function(a){a&&(b.html(""),b.append(a))})}}}]).directive("tabContentTransclude",function(){function a(a){return a.tagName&&(a.hasAttribute("tab-heading")||a.hasAttribute("data-tab-heading")||"tab-heading"===a.tagName.toLowerCase()||"data-tab-heading"===a.tagName.toLowerCase())}return{restrict:"A",require:"^tabset",link:function(b,c,d){var e=b.$eval(d.tabContentTransclude);e.$transcludeFn(e.$parent,function(b){angular.forEach(b,function(b){a(b)?e.headingElement=b:c.append(b)})})}}}),angular.module("ui.bootstrap.timepicker",[]).constant("timepickerConfig",{hourStep:1,minuteStep:1,showMeridian:!0,meridians:null,readonlyInput:!1,mousewheel:!0}).controller("TimepickerController",["$scope","$attrs","$parse","$log","$locale","timepickerConfig",function(a,b,c,d,e,f){function g(){var b=parseInt(a.hours,10),c=a.showMeridian?b>0&&13>b:b>=0&&24>b;return c?(a.showMeridian&&(12===b&&(b=0),a.meridian===p[1]&&(b+=12)),b):void 0}function h(){var b=parseInt(a.minutes,10);return b>=0&&60>b?b:void 0}function i(a){return angular.isDefined(a)&&a.toString().length<2?"0"+a:a}function j(a){k(),o.$setViewValue(new Date(n)),l(a)}function k(){o.$setValidity("time",!0),a.invalidHours=!1,a.invalidMinutes=!1}function l(b){var c=n.getHours(),d=n.getMinutes();a.showMeridian&&(c=0===c||12===c?12:c%12),a.hours="h"===b?c:i(c),a.minutes="m"===b?d:i(d),a.meridian=n.getHours()<12?p[0]:p[1]}function m(a){var b=new Date(n.getTime()+6e4*a);n.setHours(b.getHours(),b.getMinutes()),j()}var n=new Date,o={$setViewValue:angular.noop},p=angular.isDefined(b.meridians)?a.$parent.$eval(b.meridians):f.meridians||e.DATETIME_FORMATS.AMPMS;this.init=function(c,d){o=c,o.$render=this.render;var e=d.eq(0),g=d.eq(1),h=angular.isDefined(b.mousewheel)?a.$parent.$eval(b.mousewheel):f.mousewheel;h&&this.setupMousewheelEvents(e,g),a.readonlyInput=angular.isDefined(b.readonlyInput)?a.$parent.$eval(b.readonlyInput):f.readonlyInput,this.setupInputEvents(e,g)};var q=f.hourStep;b.hourStep&&a.$parent.$watch(c(b.hourStep),function(a){q=parseInt(a,10)});var r=f.minuteStep;b.minuteStep&&a.$parent.$watch(c(b.minuteStep),function(a){r=parseInt(a,10)}),a.showMeridian=f.showMeridian,b.showMeridian&&a.$parent.$watch(c(b.showMeridian),function(b){if(a.showMeridian=!!b,o.$error.time){var c=g(),d=h();angular.isDefined(c)&&angular.isDefined(d)&&(n.setHours(c),j())}else l()}),this.setupMousewheelEvents=function(b,c){var d=function(a){a.originalEvent&&(a=a.originalEvent);var b=a.wheelDelta?a.wheelDelta:-a.deltaY;return a.detail||b>0};b.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementHours():a.decrementHours()),b.preventDefault()}),c.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementMinutes():a.decrementMinutes()),b.preventDefault()})},this.setupInputEvents=function(b,c){if(a.readonlyInput)return a.updateHours=angular.noop,void(a.updateMinutes=angular.noop);var d=function(b,c){o.$setViewValue(null),o.$setValidity("time",!1),angular.isDefined(b)&&(a.invalidHours=b),angular.isDefined(c)&&(a.invalidMinutes=c)};a.updateHours=function(){var a=g();angular.isDefined(a)?(n.setHours(a),j("h")):d(!0)},b.bind("blur",function(){!a.invalidHours&&a.hours<10&&a.$apply(function(){a.hours=i(a.hours)})}),a.updateMinutes=function(){var a=h();angular.isDefined(a)?(n.setMinutes(a),j("m")):d(void 0,!0)},c.bind("blur",function(){!a.invalidMinutes&&a.minutes<10&&a.$apply(function(){a.minutes=i(a.minutes)})})},this.render=function(){var a=o.$modelValue?new Date(o.$modelValue):null;isNaN(a)?(o.$setValidity("time",!1),d.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(a&&(n=a),k(),l())},a.incrementHours=function(){m(60*q)},a.decrementHours=function(){m(60*-q)},a.incrementMinutes=function(){m(r)},a.decrementMinutes=function(){m(-r)},a.toggleMeridian=function(){m(720*(n.getHours()<12?1:-1))}}]).directive("timepicker",function(){return{restrict:"EA",require:["timepicker","?^ngModel"],controller:"TimepickerController",replace:!0,scope:{},templateUrl:"template/timepicker/timepicker.html",link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f,b.find("input"))}}}),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).factory("typeaheadParser",["$parse",function(a){var b=/^\s*(.*?)(?:\s+as\s+(.*?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+(.*)$/;return{parse:function(c){var d=c.match(b);if(!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+c+'".');return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).directive("typeahead",["$compile","$parse","$q","$timeout","$document","$position","typeaheadParser",function(a,b,c,d,e,f,g){var h=[9,13,27,38,40];return{require:"ngModel",link:function(i,j,k,l){var m,n=i.$eval(k.typeaheadMinLength)||1,o=i.$eval(k.typeaheadWaitMs)||0,p=i.$eval(k.typeaheadEditable)!==!1,q=b(k.typeaheadLoading).assign||angular.noop,r=b(k.typeaheadOnSelect),s=k.typeaheadInputFormatter?b(k.typeaheadInputFormatter):void 0,t=k.typeaheadAppendToBody?i.$eval(k.typeaheadAppendToBody):!1,u=b(k.ngModel).assign,v=g.parse(k.typeahead),w=i.$new();i.$on("$destroy",function(){w.$destroy()});var x="typeahead-"+w.$id+"-"+Math.floor(1e4*Math.random());j.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":x});var y=angular.element("
    ");y.attr({id:x,matches:"matches",active:"activeIdx",select:"select(activeIdx)",query:"query",position:"position"}),angular.isDefined(k.typeaheadTemplateUrl)&&y.attr("template-url",k.typeaheadTemplateUrl);var z=function(){w.matches=[],w.activeIdx=-1,j.attr("aria-expanded",!1)},A=function(a){return x+"-option-"+a};w.$watch("activeIdx",function(a){0>a?j.removeAttr("aria-activedescendant"):j.attr("aria-activedescendant",A(a))});var B=function(a){var b={$viewValue:a};q(i,!0),c.when(v.source(i,b)).then(function(c){var d=a===l.$viewValue;if(d&&m)if(c.length>0){w.activeIdx=0,w.matches.length=0;for(var e=0;e=n?o>0?(C&&d.cancel(C),C=d(function(){B(a)},o)):B(a):(q(i,!1),z()),p?a:a?void l.$setValidity("editable",!1):(l.$setValidity("editable",!0),a)}),l.$formatters.push(function(a){var b,c,d={};return s?(d.$model=a,s(i,d)):(d[v.itemName]=a,b=v.viewMapper(i,d),d[v.itemName]=void 0,c=v.viewMapper(i,d),b!==c?b:a)}),w.select=function(a){var b,c,e={};e[v.itemName]=c=w.matches[a].model,b=v.modelMapper(i,e),u(i,b),l.$setValidity("editable",!0),r(i,{$item:c,$model:b,$label:v.viewMapper(i,e)}),z(),d(function(){j[0].focus()},0,!1)},j.bind("keydown",function(a){0!==w.matches.length&&-1!==h.indexOf(a.which)&&(a.preventDefault(),40===a.which?(w.activeIdx=(w.activeIdx+1)%w.matches.length,w.$digest()):38===a.which?(w.activeIdx=(w.activeIdx?w.activeIdx:w.matches.length)-1,w.$digest()):13===a.which||9===a.which?w.$apply(function(){w.select(w.activeIdx)}):27===a.which&&(a.stopPropagation(),z(),w.$digest()))}),j.bind("blur",function(){m=!1});var D=function(a){j[0]!==a.target&&(z(),w.$digest())};e.bind("click",D),i.$on("$destroy",function(){e.unbind("click",D)});var E=a(y)(w);t?e.find("body").append(E):j.after(E)}}}]).directive("typeaheadPopup",function(){return{restrict:"EA",scope:{matches:"=",query:"=",active:"=",position:"=",select:"&"},replace:!0,templateUrl:"template/typeahead/typeahead-popup.html",link:function(a,b,c){a.templateUrl=c.templateUrl,a.isOpen=function(){return a.matches.length>0},a.isActive=function(b){return a.active==b},a.selectActive=function(b){a.active=b},a.selectMatch=function(b){a.select({activeIdx:b})}}}}).directive("typeaheadMatch",["$http","$templateCache","$compile","$parse",function(a,b,c,d){return{restrict:"EA",scope:{index:"=",match:"=",query:"="},link:function(e,f,g){var h=d(g.templateUrl)(e.$parent)||"template/typeahead/typeahead-match.html";a.get(h,{cache:b}).success(function(a){f.replaceWith(c(a.trim())(e))})}}}]).filter("typeaheadHighlight",function(){function a(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}return function(b,c){return c?(""+b).replace(new RegExp(a(c),"gi"),"$&"):b}}),angular.module("template/accordion/accordion-group.html",[]).run(["$templateCache",function(a){a.put("template/accordion/accordion-group.html",'
    \n
    \n

    \n {{heading}}\n

    \n
    \n
    \n
    \n
    \n
    ')}]),angular.module("template/accordion/accordion.html",[]).run(["$templateCache",function(a){a.put("template/accordion/accordion.html",'
    ')}]),angular.module("template/alert/alert.html",[]).run(["$templateCache",function(a){a.put("template/alert/alert.html",'\n')}]),angular.module("template/carousel/carousel.html",[]).run(["$templateCache",function(a){a.put("template/carousel/carousel.html",'\n')}]),angular.module("template/carousel/slide.html",[]).run(["$templateCache",function(a){a.put("template/carousel/slide.html","
    \n")}]),angular.module("template/datepicker/datepicker.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/datepicker.html",'
    \n \n \n \n
    ')}]),angular.module("template/datepicker/day.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/day.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {{label.abbr}}
    {{ weekNumbers[$index] }}\n \n
    \n')}]),angular.module("template/datepicker/month.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/month.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n
    \n \n
    \n')}]),angular.module("template/datepicker/popup.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/popup.html",'\n')}]),angular.module("template/datepicker/year.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/year.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n
    \n \n
    \n')}]),angular.module("template/modal/backdrop.html",[]).run(["$templateCache",function(a){a.put("template/modal/backdrop.html",'\n')}]),angular.module("template/modal/window.html",[]).run(["$templateCache",function(a){a.put("template/modal/window.html",'')}]),angular.module("template/pagination/pager.html",[]).run(["$templateCache",function(a){a.put("template/pagination/pager.html",'')}]),angular.module("template/pagination/pagination.html",[]).run(["$templateCache",function(a){a.put("template/pagination/pagination.html",'')}]),angular.module("template/tooltip/tooltip-html-unsafe-popup.html",[]).run(["$templateCache",function(a){a.put("template/tooltip/tooltip-html-unsafe-popup.html",'
    \n
    \n
    \n
    \n')}]),angular.module("template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function(a){a.put("template/tooltip/tooltip-popup.html",'
    \n
    \n
    \n
    \n')}]),angular.module("template/popover/popover.html",[]).run(["$templateCache",function(a){a.put("template/popover/popover.html",'
    \n
    \n\n
    \n

    \n
    \n
    \n
    \n')}]),angular.module("template/progressbar/bar.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/bar.html",'
    ')}]),angular.module("template/progressbar/progress.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/progress.html",'
    ')}]),angular.module("template/progressbar/progressbar.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/progressbar.html",'
    \n
    \n
    ')}]),angular.module("template/rating/rating.html",[]).run(["$templateCache",function(a){a.put("template/rating/rating.html",'\n \n ({{ $index < value ? \'*\' : \' \' }})\n \n')}]),angular.module("template/tabs/tab.html",[]).run(["$templateCache",function(a){a.put("template/tabs/tab.html",'
  • \n {{heading}}\n
  • \n')}]),angular.module("template/tabs/tabset-titles.html",[]).run(["$templateCache",function(a){a.put("template/tabs/tabset-titles.html","
      \n
    \n")}]),angular.module("template/tabs/tabset.html",[]).run(["$templateCache",function(a){a.put("template/tabs/tabset.html",'\n
    \n \n
    \n
    \n
    \n
    \n
    \n')}]),angular.module("template/timepicker/timepicker.html",[]).run(["$templateCache",function(a){a.put("template/timepicker/timepicker.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
     
    \n \n :\n \n
     
    \n')}]),angular.module("template/typeahead/typeahead-match.html",[]).run(["$templateCache",function(a){a.put("template/typeahead/typeahead-match.html",'')}]),angular.module("template/typeahead/typeahead-popup.html",[]).run(["$templateCache",function(a){a.put("template/typeahead/typeahead-popup.html",'') -}]); \ No newline at end of file diff --git a/setup/pub/angular-ui-router/angular-ui-router.min.js b/setup/pub/angular-ui-router/angular-ui-router.min.js deleted file mode 100644 index 66568f91192e..000000000000 --- a/setup/pub/angular-ui-router/angular-ui-router.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * State-based routing for AngularJS - * @version v0.4.3 - * @link http://angular-ui.github.com/ - * @license MIT License, http://www.opensource.org/licenses/MIT - */ -"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return T(new(T(function(){},{prototype:a})),b)}function e(a){return S(arguments,function(b){b!==a&&S(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a){if(Object.keys)return Object.keys(a);var b=[];return S(a,function(a,c){b.push(c)}),b}function h(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=d<0?Math.ceil(d):Math.floor(d),d<0&&(d+=c);d=0||(k.push(e[m]),j[e[m]]=a[e[m]]);return T({},j,b)}function j(a,b,c){if(!c){c=[];for(var d in a)c.push(d)}for(var e=0;e "));if(t[c]=d,P(a))r.push(c,[function(){return b.get(a)}],j);else{var e=b.annotate(a);S(e,function(a){a!==c&&i.hasOwnProperty(a)&&n(i[a],a)}),r.push(c,a,e)}s.pop(),t[c]=f}}function o(a){return Q(a)&&a.then&&a.$$promises}if(!Q(i))throw new Error("'invocables' must be an object");var q=g(i||{}),r=[],s=[],t={};return S(i,n),i=s=t=null,function(d,f,g){function h(){--v||(w||e(u,f.$$values),s.$$values=u,s.$$promises=s.$$promises||!0,delete s.$$inheritedValues,n.resolve(u))}function i(a){s.$$failure=a,n.reject(a)}function j(c,e,f){function j(a){l.reject(a),i(a)}function k(){if(!N(s.$$failure))try{l.resolve(b.invoke(e,g,u)),l.promise.then(function(a){u[c]=a,h()},j)}catch(a){j(a)}}var l=a.defer(),m=0;S(f,function(a){t.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,t[a].then(function(b){u[a]=b,--m||k()},j))}),m||k(),t[c]=p(l.promise)}if(o(d)&&g===c&&(g=f,f=d,d=null),d){if(!Q(d))throw new Error("'locals' must be an object")}else d=k;if(f){if(!o(f))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else f=l;var n=a.defer(),s=p(n.promise),t=s.$$promises={},u=T({},d),v=1+r.length/3,w=!1;if(p(s),N(f.$$failure))return i(f.$$failure),s;f.$$inheritedValues&&e(u,m(f.$$inheritedValues,q)),T(t,f.$$promises),f.$$values?(w=e(u,m(f.$$values,q)),s.$$inheritedValues=m(f.$$values,q),h()):(f.$$inheritedValues&&(s.$$inheritedValues=m(f.$$inheritedValues,q)),f.then(h,i));for(var x=0,y=r.length;x=0));)s=f(r.id,r.type,r.cfg,"path"),l+=g(r.segment,s.type.pattern.source,s.squash,s.isOptional),n.push(r.segment),m=j.lastIndex;t=a.substring(m);var u=t.indexOf("?");if(u>=0){var v=this.sourceSearch=t.substring(u);if(t=t.substring(0,u),this.sourcePath=a.substring(0,m+u),v.length>0)for(m=0;i=k.exec(v);)r=h(i,!0),s=f(r.id,r.type,r.cfg,"search"),m=j.lastIndex}else this.sourcePath=a,this.sourceSearch="";l+=g(t)+(!1===b.strict?"/?":"")+"$",n.push(t),this.regexp=new RegExp(l,b.caseInsensitive?"i":c),this.prefix=n[0],this.$$paramNames=q}function u(a){T(this,a)}function v(){function a(a){return null!=a?a.toString().replace(/(~|\/)/g,function(a){return{"~":"~~","/":"~2F"}[a]}):a}function e(a){return null!=a?a.toString().replace(/(~~|~2F)/g,function(a){return{"~~":"~","~2F":"/"}[a]}):a}function f(){return{strict:p,caseInsensitive:m}}function i(a){return O(a)||R(a)&&O(a[a.length-1])}function j(){for(;w.length;){var a=w.shift();if(a.pattern)throw new Error("You cannot override a type's .pattern at runtime.");b.extend(r[a.name],l.invoke(a.def))}}function k(a){T(this,a||{})}W=this;var l,m=!1,p=!0,q=!1,r={},s=!0,w=[],x={string:{encode:a,decode:e,is:function(a){return null==a||!N(a)||"string"==typeof a},pattern:/[^\/]*/},int:{encode:a,decode:function(a){return parseInt(a,10)},is:function(a){return a!==c&&null!==a&&this.decode(a.toString())===a},pattern:/-?\d+/},bool:{encode:function(a){return a?1:0},decode:function(a){return 0!==parseInt(a,10)},is:function(a){return!0===a||!1===a},pattern:/0|1/},date:{encode:function(a){return this.is(a)?[a.getFullYear(),("0"+(a.getMonth()+1)).slice(-2),("0"+a.getDate()).slice(-2)].join("-"):c},decode:function(a){if(this.is(a))return a;var b=this.capture.exec(a);return b?new Date(b[1],b[2]-1,b[3]):c},is:function(a){return a instanceof Date&&!isNaN(a.valueOf())},equals:function(a,b){return this.is(a)&&this.is(b)&&a.toISOString()===b.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:b.toJson,decode:b.fromJson,is:b.isObject,equals:b.equals,pattern:/[^\/]*/},any:{encode:b.identity,decode:b.identity,equals:b.equals,pattern:/.*/}};v.$$getDefaultValue=function(a){if(!i(a.value))return a.value;if(!l)throw new Error("Injectable functions cannot be called at configuration time");return l.invoke(a.value)},this.caseInsensitive=function(a){return N(a)&&(m=a),m},this.strictMode=function(a){return N(a)&&(p=a),p},this.defaultSquashPolicy=function(a){if(!N(a))return q;if(!0!==a&&!1!==a&&!P(a))throw new Error("Invalid squash policy: "+a+". Valid policies: false, true, arbitrary-string");return q=a,a},this.compile=function(a,b){return new t(a,T(f(),b))},this.isMatcher=function(a){if(!Q(a))return!1;var b=!0;return S(t.prototype,function(c,d){O(c)&&(b=b&&N(a[d])&&O(a[d]))}),b},this.type=function(a,b,c){if(!N(b))return r[a];if(r.hasOwnProperty(a))throw new Error("A type named '"+a+"' has already been defined.");return r[a]=new u(T({name:a},b)),c&&(w.push({name:a,def:c}),s||j()),this},S(x,function(a,b){r[b]=new u(T({name:b},a))}),r=d(r,{}),this.$get=["$injector",function(a){return l=a,s=!1,j(),S(x,function(a,b){r[b]||(r[b]=new u(a))}),this}],this.Param=function(a,d,e,f){function j(a){var b=Q(a)?g(a):[];return-1===h(b,"value")&&-1===h(b,"type")&&-1===h(b,"squash")&&-1===h(b,"array")&&(a={value:a}),a.$$fn=i(a.value)?a.value:function(){return a.value},a}function k(c,d,e){if(c.type&&d)throw new Error("Param '"+a+"' has two type configurations.");return d||(c.type?b.isString(c.type)?r[c.type]:c.type instanceof u?c.type:new u(c.type):"config"===e?r.any:r.string)}function m(){var b={array:"search"===f&&"auto"},c=a.match(/\[\]$/)?{array:!0}:{};return T(b,c,e).array}function p(a,b){var c=a.squash;if(!b||!1===c)return!1;if(!N(c)||null==c)return q;if(!0===c||P(c))return c;throw new Error("Invalid squash policy: '"+c+"'. Valid policies: false, true, or arbitrary string")}function s(a,b,d,e){var f,g,i=[{from:"",to:d||b?c:""},{from:null,to:d||b?c:""}];return f=R(a.replace)?a.replace:[],P(e)&&f.push({from:e,to:c}),g=o(f,function(a){return a.from}),n(i,function(a){return-1===h(g,a.from)}).concat(f)}function t(){if(!l)throw new Error("Injectable functions cannot be called at configuration time");var a=l.invoke(e.$$fn);if(null!==a&&a!==c&&!x.type.is(a))throw new Error("Default value ("+a+") for parameter '"+x.id+"' is not an instance of Type ("+x.type.name+")");return a}function v(a){function b(a){return function(b){return b.from===a}}function c(a){var c=o(n(x.replace,b(a)),function(a){return a.to});return c.length?c[0]:a}return a=c(a),N(a)?x.type.$normalize(a):t()}function w(){return"{Param:"+a+" "+d+" squash: '"+A+"' optional: "+z+"}"}var x=this;e=j(e),d=k(e,d,f);var y=m();d=y?d.$asArray(y,"search"===f):d,"string"!==d.name||y||"path"!==f||e.value!==c||(e.value="");var z=e.value!==c,A=p(e,z),B=s(e,y,z,A);T(this,{id:a,type:d,location:f,array:y,squash:A,replace:B,isOptional:z,value:v,dynamic:c,config:e,toString:w})},k.prototype={$$new:function(){return d(this,T(new k,{$$parent:this}))},$$keys:function(){for(var a=[],b=[],c=this,d=g(k.prototype);c;)b.push(c),c=c.$$parent;return b.reverse(),S(b,function(b){S(g(b),function(b){-1===h(a,b)&&-1===h(d,b)&&a.push(b)})}),a},$$values:function(a){var b={},c=this;return S(c.$$keys(),function(d){b[d]=c[d].value(a&&a[d])}),b},$$equals:function(a,b){var c=!0,d=this;return S(d.$$keys(),function(e){var f=a&&a[e],g=b&&b[e];d[e].type.equals(f,g)||(c=!1)}),c},$$validates:function(a){var d,e,f,g,h,i=this.$$keys();for(d=0;d=0)throw new Error("State must have a valid name");if(A.hasOwnProperty(c))throw new Error("State '"+c+"' is already defined");var e=-1!==c.indexOf(".")?c.substring(0,c.lastIndexOf(".")):P(b.parent)?b.parent:Q(b.parent)&&P(b.parent.name)?b.parent.name:"";if(e&&!A[e])return n(e,b.self);for(var f in D)O(D[f])&&(b[f]=D[f](b,D.$delegates[f]));return A[c]=b,!b[C]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){z.$current.navigable==b&&j(a,c)||z.transitionTo(b,a,{inherit:!0,location:!1})}]),q(c),b}function s(a){return a.indexOf("*")>-1}function t(a){for(var b=a.split("."),c=z.$current.name.split("."),d=0,e=b.length;d=G;d--)g=q[d],g.self.onExit&&h.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=G;d2?k.enter(a,null,c).then(d):k.enter(a,null,c,d)},leave:function(a,c){b.version.minor>2?k.leave(a).then(c):k.leave(a,c)}};if(j){var e=j&&j(c,a);return{enter:function(a,b,c){e.enter(a,null,b),c()},leave:function(a,b){e.leave(a),b()}}}return d()}var i=g(),j=i("$animator"),k=i("$animate");return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(c,g,i){return function(c,g,j){function k(){if(m&&(m.remove(),m=null),o&&(o.$destroy(),o=null),n){var a=n.data("$uiViewAnim");s.leave(n,function(){a.$$animLeave.resolve(),m=null}),m=n,n=null}}function l(h){var l,m=C(c,j,g,e),t=m&&a.$current&&a.$current.locals[m];if(h||t!==p){l=c.$new(),p=a.$current.locals[m],l.$emit("$viewContentLoading",m);var u=i(l,function(a){var e=f.defer(),h=f.defer(),i={$animEnter:e.promise,$animLeave:h.promise,$$animLeave:h};a.data("$uiViewAnim",i),s.enter(a,g,function(){e.resolve(),o&&o.$emit("$viewContentAnimationEnded"),(b.isDefined(r)&&!r||c.$eval(r))&&d(a)}),k()});n=u,o=l,o.$emit("$viewContentLoaded",m),o.$eval(q)}}var m,n,o,p,q=j.onload||"",r=j.autoscroll,s=h(j,c);g.inheritedData("$uiView");c.$on("$stateChangeSuccess",function(){l(!1)}),l(!0)}}}}function B(a,c,d,e){return{restrict:"ECA",priority:-400,compile:function(f){var g=f.html();return f.empty?f.empty():f[0].innerHTML=null,function(f,h,i){var j=d.$current,k=C(f,i,h,e),l=j&&j.locals[k];if(!l)return h.html(g),void a(h.contents())(f);h.data("$uiView",{name:k,state:l.$$state}),h.html(l.$template?l.$template:g);var m=b.extend({},l);f[l.$$resolveAs]=m;var n=a(h.contents());if(l.$$controller){l.$scope=f,l.$element=h;var o=c(l.$$controller,l);l.$$controllerAs&&(f[l.$$controllerAs]=o,f[l.$$controllerAs][l.$$resolveAs]=m),O(o.$onInit)&&o.$onInit(),h.data("$ngControllerController",o),h.children().data("$ngControllerController",o)}n(f)}}}}function C(a,b,c,d){var e=d(b.uiView||b.name||"")(a),f=c.inheritedData("$uiView");return e.indexOf("@")>=0?e:e+"@"+(f?f.state.name:"")}function D(a,b){var c,d=a.match(/^\s*({[^}]*})\s*$/);if(d&&(a=b+"("+d[1]+")"),!(c=a.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/))||4!==c.length)throw new Error("Invalid state ref '"+a+"'");return{state:c[1],paramExpr:c[3]||null}}function E(a){var b=a.parent().inheritedData("$uiView");if(b&&b.state&&b.state.name)return b.state}function F(a){var b="[object SVGAnimatedString]"===Object.prototype.toString.call(a.prop("href")),c="FORM"===a[0].nodeName;return{attr:c?"action":b?"xlink:href":"href",isAnchor:"A"===a.prop("tagName").toUpperCase(),clickable:!c}}function G(a,b,c,d,e){return function(f){var g=f.which||f.button,h=e();if(!(g>1||f.ctrlKey||f.metaKey||f.shiftKey||a.attr("target"))){var i=c(function(){b.go(h.state,h.params,h.options)});f.preventDefault();var j=d.isAnchor&&!h.href?1:0;f.preventDefault=function(){j--<=0&&c.cancel(i)}}}}function H(a,b){return{relative:E(a)||b.$current,inherit:!0}}function I(a,c){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(d,e,f,g){var h,i=D(f.uiSref,a.current.name),j={state:i.state,href:null,params:null},k=F(e),l=g[1]||g[0],m=null;j.options=T(H(e,a),f.uiSrefOpts?d.$eval(f.uiSrefOpts):{});var n=function(c){c&&(j.params=b.copy(c)),j.href=a.href(i.state,j.params,j.options),m&&m(),l&&(m=l.$$addStateInfo(i.state,j.params)),null!==j.href&&f.$set(k.attr,j.href)};i.paramExpr&&(d.$watch(i.paramExpr,function(a){a!==j.params&&n(a)},!0),j.params=b.copy(d.$eval(i.paramExpr))),n(),k.clickable&&(h=G(e,a,c,k,function(){return j}),e[e.on?"on":"bind"]("click",h),d.$on("$destroy",function(){e[e.off?"off":"unbind"]("click",h)}))}}}function J(a,b){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(c,d,e,f){function g(b){m.state=b[0],m.params=b[1],m.options=b[2],m.href=a.href(m.state,m.params,m.options),n&&n(),j&&(n=j.$$addStateInfo(m.state,m.params)),m.href&&e.$set(i.attr,m.href)}var h,i=F(d),j=f[1]||f[0],k=[e.uiState,e.uiStateParams||null,e.uiStateOpts||null],l="["+k.map(function(a){return a||"null"}).join(", ")+"]",m={state:null,params:null,options:null,href:null},n=null;c.$watch(l,g,!0),g(c.$eval(l)),i.clickable&&(h=G(d,a,b,i,function(){return m}),d[d.on?"on":"bind"]("click",h),c.$on("$destroy",function(){d[d.off?"off":"unbind"]("click",h)}))}}}function K(a,b,c){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(b,d,e,f){function g(b,c,e){var f=a.get(b,E(d)),g=h(b,c),i={state:f||{name:b},params:c,hash:g};return p.push(i),q[g]=e,function(){var a=p.indexOf(i);-1!==a&&p.splice(a,1)}}function h(a,c){if(!P(a))throw new Error("state should be a string");return Q(c)?a+V(c):(c=b.$eval(c),Q(c)?a+V(c):a)}function i(){for(var a=0;a0)){var c=g(a,b,o);return i(),c}},b.$on("$stateChangeSuccess",i),i()}]}}function L(a){var b=function(b,c){return a.is(b,c)};return b.$stateful=!0,b}function M(a){var b=function(b,c,d){return a.includes(b,c,d)};return b.$stateful=!0,b}var N=b.isDefined,O=b.isFunction,P=b.isString,Q=b.isObject,R=b.isArray,S=b.forEach,T=b.extend,U=b.copy,V=b.toJson;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),q.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",q),b.module("ui.router.util").provider("$templateFactory",r);var W;t.prototype.concat=function(a,b){var c={caseInsensitive:W.caseInsensitive(),strict:W.strictMode(),squash:W.defaultSquashPolicy()};return new t(this.sourcePath+a+this.sourceSearch,T(c,b),this)},t.prototype.toString=function(){return this.source},t.prototype.exec=function(a,b){function c(a){function b(a){return a.split("").reverse().join("")}function c(a){return a.replace(/\\-/g,"-")}return o(o(b(a).split(/-(?!\\)/),b),c).reverse()}var d=this.regexp.exec(a);if(!d)return null;b=b||{};var e,f,g,h=this.parameters(),i=h.length,j=this.segments.length-1,k={};if(j!==d.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");var l,m;for(e=0;e 0; - } - - /** - * @description - * - * This object provides a utility for producing rich Error messages within - * AngularJS. It can be called as follows: - * - * var exampleMinErr = minErr('example'); - * throw exampleMinErr('one', 'This {0} is {1}', foo, bar); - * - * The above creates an instance of minErr in the example namespace. The - * resulting error will have a namespaced error code of example.one. The - * resulting error will replace {0} with the value of foo, and {1} with the - * value of bar. The object is not restricted in the number of arguments it can - * take. - * - * If fewer arguments are specified than necessary for interpolation, the extra - * interpolation markers will be preserved in the final string. - * - * Since data will be parsed statically during a build step, some restrictions - * are applied with respect to how minErr instances are created and called. - * Instances should have names of the form namespaceMinErr for a minErr created - * using minErr('namespace') . Error codes, namespaces and template strings - * should all be static strings, not variables or general expressions. - * - * @param {string} module The namespace to use for the new minErr instance. - * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning - * error from returned function, for cases when a particular type of error is useful. - * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance - */ - - function minErr(module, ErrorConstructor) { - ErrorConstructor = ErrorConstructor || Error; - return function() { - var code = arguments[0], - template = arguments[1], - message = '[' + (module ? module + ':' : '') + code + '] ', - templateArgs = sliceArgs(arguments, 2).map(function(arg) { - return toDebugString(arg, minErrConfig.objectMaxDepth); - }), - paramPrefix, i; - - message += template.replace(/\{\d+\}/g, function(match) { - var index = +match.slice(1, -1); - - if (index < templateArgs.length) { - return templateArgs[index]; - } - - return match; - }); - - message += '\nhttp://errors.angularjs.org/1.6.9/' + - (module ? module + '/' : '') + code; - - for (i = 0, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') { - message += paramPrefix + 'p' + i + '=' + encodeURIComponent(templateArgs[i]); - } - - return new ErrorConstructor(message); - }; - } - - /* We need to tell ESLint what variables are being exported */ - /* exported - angular, - msie, - jqLite, - jQuery, - slice, - splice, - push, - toString, - minErrConfig, - errorHandlingConfig, - isValidObjectMaxDepth, - ngMinErr, - angularModule, - uid, - REGEX_STRING_REGEXP, - VALIDITY_STATE_PROPERTY, - - lowercase, - uppercase, - manualLowercase, - manualUppercase, - nodeName_, - isArrayLike, - forEach, - forEachSorted, - reverseParams, - nextUid, - setHashKey, - extend, - toInt, - inherit, - merge, - noop, - identity, - valueFn, - isUndefined, - isDefined, - isObject, - isBlankObject, - isString, - isNumber, - isNumberNaN, - isDate, - isError, - isArray, - isFunction, - isRegExp, - isWindow, - isScope, - isFile, - isFormData, - isBlob, - isBoolean, - isPromiseLike, - trim, - escapeForRegexp, - isElement, - makeMap, - includes, - arrayRemove, - copy, - simpleCompare, - equals, - csp, - jq, - concat, - sliceArgs, - bind, - toJsonReplacer, - toJson, - fromJson, - convertTimezoneToLocal, - timezoneToOffset, - startingTag, - tryDecodeURIComponent, - parseKeyValue, - toKeyValue, - encodeUriSegment, - encodeUriQuery, - angularInit, - bootstrap, - getTestability, - snake_case, - bindJQuery, - assertArg, - assertArgFn, - assertNotHasOwnProperty, - getter, - getBlockNodes, - hasOwnProperty, - createMap, - stringify, - - NODE_TYPE_ELEMENT, - NODE_TYPE_ATTRIBUTE, - NODE_TYPE_TEXT, - NODE_TYPE_COMMENT, - NODE_TYPE_DOCUMENT, - NODE_TYPE_DOCUMENT_FRAGMENT -*/ - -//////////////////////////////////// - - /** - * @ngdoc module - * @name ng - * @module ng - * @installation - * @description - * - * The ng module is loaded by default when an AngularJS application is started. The module itself - * contains the essential components for an AngularJS application to function. The table below - * lists a high level breakdown of each of the services/factories, filters, directives and testing - * components available within this core module. - * - */ - - var REGEX_STRING_REGEXP = /^\/(.+)\/([a-z]*)$/; - -// The name of a form control's ValidityState property. -// This is used so that it's possible for internal tests to create mock ValidityStates. - var VALIDITY_STATE_PROPERTY = 'validity'; - - - var hasOwnProperty = Object.prototype.hasOwnProperty; - - /** - * @ngdoc function - * @name angular.lowercase - * @module ng - * @kind function - * - * @deprecated - * sinceVersion="1.5.0" - * removeVersion="1.7.0" - * Use [String.prototype.toLowerCase](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase) instead. - * - * @description Converts the specified string to lowercase. - * @param {string} string String to be converted to lowercase. - * @returns {string} Lowercased string. - */ - var lowercase = function(string) {return isString(string) ? string.toLowerCase() : string;}; - - /** - * @ngdoc function - * @name angular.uppercase - * @module ng - * @kind function - * - * @deprecated - * sinceVersion="1.5.0" - * removeVersion="1.7.0" - * Use [String.prototype.toUpperCase](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) instead. - * - * @description Converts the specified string to uppercase. - * @param {string} string String to be converted to uppercase. - * @returns {string} Uppercased string. - */ - var uppercase = function(string) {return isString(string) ? string.toUpperCase() : string;}; - - - var manualLowercase = function(s) { - /* eslint-disable no-bitwise */ - return isString(s) - ? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);}) - : s; - /* eslint-enable */ - }; - var manualUppercase = function(s) { - /* eslint-disable no-bitwise */ - return isString(s) - ? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);}) - : s; - /* eslint-enable */ - }; - - -// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish -// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods -// with correct but slower alternatives. See https://github.com/angular/angular.js/issues/11387 - if ('i' !== 'I'.toLowerCase()) { - lowercase = manualLowercase; - uppercase = manualUppercase; - } - - - var - msie, // holds major version number for IE, or NaN if UA is not IE. - jqLite, // delay binding since jQuery could be loaded after us. - jQuery, // delay binding - slice = [].slice, - splice = [].splice, - push = [].push, - toString = Object.prototype.toString, - getPrototypeOf = Object.getPrototypeOf, - ngMinErr = minErr('ng'), - - /** @name angular */ - angular = window.angular || (window.angular = {}), - angularModule, - uid = 0; - -// Support: IE 9-11 only - /** - * documentMode is an IE-only property - * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx - */ - msie = window.document.documentMode; - - - /** - * @private - * @param {*} obj - * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, - * String ...) - */ - function isArrayLike(obj) { - - // `null`, `undefined` and `window` are not array-like - if (obj == null || isWindow(obj)) return false; - - // arrays, strings and jQuery/jqLite objects are array like - // * jqLite is either the jQuery or jqLite constructor function - // * we have to check the existence of jqLite first as this method is called - // via the forEach method when constructing the jqLite object in the first place - if (isArray(obj) || isString(obj) || (jqLite && obj instanceof jqLite)) return true; - - // Support: iOS 8.2 (not reproducible in simulator) - // "length" in obj used to prevent JIT error (gh-11508) - var length = 'length' in Object(obj) && obj.length; - - // NodeList objects (with `item` method) and - // other objects with suitable length characteristics are array-like - return isNumber(length) && - (length >= 0 && ((length - 1) in obj || obj instanceof Array) || typeof obj.item === 'function'); - - } - - /** - * @ngdoc function - * @name angular.forEach - * @module ng - * @kind function - * - * @description - * Invokes the `iterator` function once for each item in `obj` collection, which can be either an - * object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value` - * is the value of an object property or an array element, `key` is the object property key or - * array element index and obj is the `obj` itself. Specifying a `context` for the function is optional. - * - * It is worth noting that `.forEach` does not iterate over inherited properties because it filters - * using the `hasOwnProperty` method. - * - * Unlike ES262's - * [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18), - * providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just - * return the value provided. - * - ```js - var values = {name: 'misko', gender: 'male'}; - var log = []; - angular.forEach(values, function(value, key) { - this.push(key + ': ' + value); - }, log); - expect(log).toEqual(['name: misko', 'gender: male']); - ``` - * - * @param {Object|Array} obj Object to iterate over. - * @param {Function} iterator Iterator function. - * @param {Object=} context Object to become context (`this`) for the iterator function. - * @returns {Object|Array} Reference to `obj`. - */ - - function forEach(obj, iterator, context) { - var key, length; - if (obj) { - if (isFunction(obj)) { - for (key in obj) { - if (key !== 'prototype' && key !== 'length' && key !== 'name' && obj.hasOwnProperty(key)) { - iterator.call(context, obj[key], key, obj); - } - } - } else if (isArray(obj) || isArrayLike(obj)) { - var isPrimitive = typeof obj !== 'object'; - for (key = 0, length = obj.length; key < length; key++) { - if (isPrimitive || key in obj) { - iterator.call(context, obj[key], key, obj); - } - } - } else if (obj.forEach && obj.forEach !== forEach) { - obj.forEach(iterator, context, obj); - } else if (isBlankObject(obj)) { - // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty - for (key in obj) { - iterator.call(context, obj[key], key, obj); - } - } else if (typeof obj.hasOwnProperty === 'function') { - // Slow path for objects inheriting Object.prototype, hasOwnProperty check needed - for (key in obj) { - if (obj.hasOwnProperty(key)) { - iterator.call(context, obj[key], key, obj); - } - } - } else { - // Slow path for objects which do not have a method `hasOwnProperty` - for (key in obj) { - if (hasOwnProperty.call(obj, key)) { - iterator.call(context, obj[key], key, obj); - } - } - } - } - return obj; - } - - function forEachSorted(obj, iterator, context) { - var keys = Object.keys(obj).sort(); - for (var i = 0; i < keys.length; i++) { - iterator.call(context, obj[keys[i]], keys[i]); - } - return keys; - } - - - /** - * when using forEach the params are value, key, but it is often useful to have key, value. - * @param {function(string, *)} iteratorFn - * @returns {function(*, string)} - */ - function reverseParams(iteratorFn) { - return function(value, key) {iteratorFn(key, value);}; - } - - /** - * A consistent way of creating unique IDs in angular. - * - * Using simple numbers allows us to generate 28.6 million unique ids per second for 10 years before - * we hit number precision issues in JavaScript. - * - * Math.pow(2,53) / 60 / 60 / 24 / 365 / 10 = 28.6M - * - * @returns {number} an unique alpha-numeric string - */ - function nextUid() { - return ++uid; - } - - - /** - * Set or clear the hashkey for an object. - * @param obj object - * @param h the hashkey (!truthy to delete the hashkey) - */ - function setHashKey(obj, h) { - if (h) { - obj.$$hashKey = h; - } else { - delete obj.$$hashKey; - } - } - - - function baseExtend(dst, objs, deep) { - var h = dst.$$hashKey; - - for (var i = 0, ii = objs.length; i < ii; ++i) { - var obj = objs[i]; - if (!isObject(obj) && !isFunction(obj)) continue; - var keys = Object.keys(obj); - for (var j = 0, jj = keys.length; j < jj; j++) { - var key = keys[j]; - var src = obj[key]; - - if (deep && isObject(src)) { - if (isDate(src)) { - dst[key] = new Date(src.valueOf()); - } else if (isRegExp(src)) { - dst[key] = new RegExp(src); - } else if (src.nodeName) { - dst[key] = src.cloneNode(true); - } else if (isElement(src)) { - dst[key] = src.clone(); - } else { - if (!isObject(dst[key])) dst[key] = isArray(src) ? [] : {}; - baseExtend(dst[key], [src], true); - } - } else { - dst[key] = src; - } - } - } - - setHashKey(dst, h); - return dst; - } - - /** - * @ngdoc function - * @name angular.extend - * @module ng - * @kind function - * - * @description - * Extends the destination object `dst` by copying own enumerable properties from the `src` object(s) - * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so - * by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`. - * - * **Note:** Keep in mind that `angular.extend` does not support recursive merge (deep copy). Use - * {@link angular.merge} for this. - * - * @param {Object} dst Destination object. - * @param {...Object} src Source object(s). - * @returns {Object} Reference to `dst`. - */ - function extend(dst) { - return baseExtend(dst, slice.call(arguments, 1), false); - } - - - /** - * @ngdoc function - * @name angular.merge - * @module ng - * @kind function - * - * @description - * Deeply extends the destination object `dst` by copying own enumerable properties from the `src` object(s) - * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so - * by passing an empty object as the target: `var object = angular.merge({}, object1, object2)`. - * - * Unlike {@link angular.extend extend()}, `merge()` recursively descends into object properties of source - * objects, performing a deep copy. - * - * @deprecated - * sinceVersion="1.6.5" - * This function is deprecated, but will not be removed in the 1.x lifecycle. - * There are edge cases (see {@link angular.merge#known-issues known issues}) that are not - * supported by this function. We suggest - * using [lodash's merge()](https://lodash.com/docs/4.17.4#merge) instead. - * - * @knownIssue - * This is a list of (known) object types that are not handled correctly by this function: - * - [`Blob`](https://developer.mozilla.org/docs/Web/API/Blob) - * - [`MediaStream`](https://developer.mozilla.org/docs/Web/API/MediaStream) - * - [`CanvasGradient`](https://developer.mozilla.org/docs/Web/API/CanvasGradient) - * - AngularJS {@link $rootScope.Scope scopes}; - * - * @param {Object} dst Destination object. - * @param {...Object} src Source object(s). - * @returns {Object} Reference to `dst`. - */ - function merge(dst) { - return baseExtend(dst, slice.call(arguments, 1), true); - } - - - - function toInt(str) { - return parseInt(str, 10); - } - - var isNumberNaN = Number.isNaN || function isNumberNaN(num) { - // eslint-disable-next-line no-self-compare - return num !== num; - }; - - - function inherit(parent, extra) { - return extend(Object.create(parent), extra); - } - - /** - * @ngdoc function - * @name angular.noop - * @module ng - * @kind function - * - * @description - * A function that performs no operations. This function can be useful when writing code in the - * functional style. - ```js - function foo(callback) { - var result = calculateResult(); - (callback || angular.noop)(result); - } - ``` - */ - function noop() {} - noop.$inject = []; - - - /** - * @ngdoc function - * @name angular.identity - * @module ng - * @kind function - * - * @description - * A function that returns its first argument. This function is useful when writing code in the - * functional style. - * - ```js - function transformer(transformationFn, value) { - return (transformationFn || angular.identity)(value); - }; - - // E.g. - function getResult(fn, input) { - return (fn || angular.identity)(input); - }; - - getResult(function(n) { return n * 2; }, 21); // returns 42 - getResult(null, 21); // returns 21 - getResult(undefined, 21); // returns 21 - ``` - * - * @param {*} value to be returned. - * @returns {*} the value passed in. - */ - function identity($) {return $;} - identity.$inject = []; - - - function valueFn(value) {return function valueRef() {return value;};} - - function hasCustomToString(obj) { - return isFunction(obj.toString) && obj.toString !== toString; - } - - - /** - * @ngdoc function - * @name angular.isUndefined - * @module ng - * @kind function - * - * @description - * Determines if a reference is undefined. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is undefined. - */ - function isUndefined(value) {return typeof value === 'undefined';} - - - /** - * @ngdoc function - * @name angular.isDefined - * @module ng - * @kind function - * - * @description - * Determines if a reference is defined. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is defined. - */ - function isDefined(value) {return typeof value !== 'undefined';} - - - /** - * @ngdoc function - * @name angular.isObject - * @module ng - * @kind function - * - * @description - * Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not - * considered to be objects. Note that JavaScript arrays are objects. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is an `Object` but not `null`. - */ - function isObject(value) { - // http://jsperf.com/isobject4 - return value !== null && typeof value === 'object'; - } - - - /** - * Determine if a value is an object with a null prototype - * - * @returns {boolean} True if `value` is an `Object` with a null prototype - */ - function isBlankObject(value) { - return value !== null && typeof value === 'object' && !getPrototypeOf(value); - } - - - /** - * @ngdoc function - * @name angular.isString - * @module ng - * @kind function - * - * @description - * Determines if a reference is a `String`. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is a `String`. - */ - function isString(value) {return typeof value === 'string';} - - - /** - * @ngdoc function - * @name angular.isNumber - * @module ng - * @kind function - * - * @description - * Determines if a reference is a `Number`. - * - * This includes the "special" numbers `NaN`, `+Infinity` and `-Infinity`. - * - * If you wish to exclude these then you can use the native - * [`isFinite'](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite) - * method. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is a `Number`. - */ - function isNumber(value) {return typeof value === 'number';} - - - /** - * @ngdoc function - * @name angular.isDate - * @module ng - * @kind function - * - * @description - * Determines if a value is a date. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is a `Date`. - */ - function isDate(value) { - return toString.call(value) === '[object Date]'; - } - - - /** - * @ngdoc function - * @name angular.isArray - * @module ng - * @kind function - * - * @description - * Determines if a reference is an `Array`. Alias of Array.isArray. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is an `Array`. - */ - var isArray = Array.isArray; - - /** - * @description - * Determines if a reference is an `Error`. - * Loosely based on https://www.npmjs.com/package/iserror - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is an `Error`. - */ - function isError(value) { - var tag = toString.call(value); - switch (tag) { - case '[object Error]': return true; - case '[object Exception]': return true; - case '[object DOMException]': return true; - default: return value instanceof Error; - } - } - - /** - * @ngdoc function - * @name angular.isFunction - * @module ng - * @kind function - * - * @description - * Determines if a reference is a `Function`. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is a `Function`. - */ - function isFunction(value) {return typeof value === 'function';} - - - /** - * Determines if a value is a regular expression object. - * - * @private - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is a `RegExp`. - */ - function isRegExp(value) { - return toString.call(value) === '[object RegExp]'; - } - - - /** - * Checks if `obj` is a window object. - * - * @private - * @param {*} obj Object to check - * @returns {boolean} True if `obj` is a window obj. - */ - function isWindow(obj) { - return obj && obj.window === obj; - } - - - function isScope(obj) { - return obj && obj.$evalAsync && obj.$watch; - } - - - function isFile(obj) { - return toString.call(obj) === '[object File]'; - } - - - function isFormData(obj) { - return toString.call(obj) === '[object FormData]'; - } - - - function isBlob(obj) { - return toString.call(obj) === '[object Blob]'; - } - - - function isBoolean(value) { - return typeof value === 'boolean'; - } - - - function isPromiseLike(obj) { - return obj && isFunction(obj.then); - } - - - var TYPED_ARRAY_REGEXP = /^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/; - function isTypedArray(value) { - return value && isNumber(value.length) && TYPED_ARRAY_REGEXP.test(toString.call(value)); - } - - function isArrayBuffer(obj) { - return toString.call(obj) === '[object ArrayBuffer]'; - } - - - var trim = function(value) { - return isString(value) ? value.trim() : value; - }; - -// Copied from: -// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021 -// Prereq: s is a string. - var escapeForRegexp = function(s) { - return s - .replace(/([-()[\]{}+?*.$^|,:#= 0) { - array.splice(index, 1); - } - return index; - } - - /** - * @ngdoc function - * @name angular.copy - * @module ng - * @kind function - * - * @description - * Creates a deep copy of `source`, which should be an object or an array. - * - * * If no destination is supplied, a copy of the object or array is created. - * * If a destination is provided, all of its elements (for arrays) or properties (for objects) - * are deleted and then all elements/properties from the source are copied to it. - * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned. - * * If `source` is identical to `destination` an exception will be thrown. - * - *
    - *
    - * Only enumerable properties are taken into account. Non-enumerable properties (both on `source` - * and on `destination`) will be ignored. - *
    - * - * @param {*} source The source that will be used to make a copy. - * Can be any type, including primitives, `null`, and `undefined`. - * @param {(Object|Array)=} destination Destination into which the source is copied. If - * provided, must be of the same type as `source`. - * @returns {*} The copy or updated `destination`, if `destination` was specified. - * - * @example - - -
    -
    -
    -
    - Gender: -
    - - -
    -
    form = {{user | json}}
    -
    leader = {{leader | json}}
    -
    -
    - - // Module: copyExample - angular. - module('copyExample', []). - controller('ExampleController', ['$scope', function($scope) { - $scope.leader = {}; - - $scope.reset = function() { - // Example with 1 argument - $scope.user = angular.copy($scope.leader); - }; - - $scope.update = function(user) { - // Example with 2 arguments - angular.copy(user, $scope.leader); - }; - - $scope.reset(); - }]); - -
    - */ - function copy(source, destination, maxDepth) { - var stackSource = []; - var stackDest = []; - maxDepth = isValidObjectMaxDepth(maxDepth) ? maxDepth : NaN; - - if (destination) { - if (isTypedArray(destination) || isArrayBuffer(destination)) { - throw ngMinErr('cpta', 'Can\'t copy! TypedArray destination cannot be mutated.'); - } - if (source === destination) { - throw ngMinErr('cpi', 'Can\'t copy! Source and destination are identical.'); - } - - // Empty the destination object - if (isArray(destination)) { - destination.length = 0; - } else { - forEach(destination, function(value, key) { - if (key !== '$$hashKey') { - delete destination[key]; - } - }); - } - - stackSource.push(source); - stackDest.push(destination); - return copyRecurse(source, destination, maxDepth); - } - - return copyElement(source, maxDepth); - - function copyRecurse(source, destination, maxDepth) { - maxDepth--; - if (maxDepth < 0) { - return '...'; - } - var h = destination.$$hashKey; - var key; - if (isArray(source)) { - for (var i = 0, ii = source.length; i < ii; i++) { - destination.push(copyElement(source[i], maxDepth)); - } - } else if (isBlankObject(source)) { - // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty - for (key in source) { - destination[key] = copyElement(source[key], maxDepth); - } - } else if (source && typeof source.hasOwnProperty === 'function') { - // Slow path, which must rely on hasOwnProperty - for (key in source) { - if (source.hasOwnProperty(key)) { - destination[key] = copyElement(source[key], maxDepth); - } - } - } else { - // Slowest path --- hasOwnProperty can't be called as a method - for (key in source) { - if (hasOwnProperty.call(source, key)) { - destination[key] = copyElement(source[key], maxDepth); - } - } - } - setHashKey(destination, h); - return destination; - } - - function copyElement(source, maxDepth) { - // Simple values - if (!isObject(source)) { - return source; - } - - // Already copied values - var index = stackSource.indexOf(source); - if (index !== -1) { - return stackDest[index]; - } - - if (isWindow(source) || isScope(source)) { - throw ngMinErr('cpws', - 'Can\'t copy! Making copies of Window or Scope instances is not supported.'); - } - - var needsRecurse = false; - var destination = copyType(source); - - if (destination === undefined) { - destination = isArray(source) ? [] : Object.create(getPrototypeOf(source)); - needsRecurse = true; - } - - stackSource.push(source); - stackDest.push(destination); - - return needsRecurse - ? copyRecurse(source, destination, maxDepth) - : destination; - } - - function copyType(source) { - switch (toString.call(source)) { - case '[object Int8Array]': - case '[object Int16Array]': - case '[object Int32Array]': - case '[object Float32Array]': - case '[object Float64Array]': - case '[object Uint8Array]': - case '[object Uint8ClampedArray]': - case '[object Uint16Array]': - case '[object Uint32Array]': - return new source.constructor(copyElement(source.buffer), source.byteOffset, source.length); - - case '[object ArrayBuffer]': - // Support: IE10 - if (!source.slice) { - // If we're in this case we know the environment supports ArrayBuffer - /* eslint-disable no-undef */ - var copied = new ArrayBuffer(source.byteLength); - new Uint8Array(copied).set(new Uint8Array(source)); - /* eslint-enable */ - return copied; - } - return source.slice(0); - - case '[object Boolean]': - case '[object Number]': - case '[object String]': - case '[object Date]': - return new source.constructor(source.valueOf()); - - case '[object RegExp]': - var re = new RegExp(source.source, source.toString().match(/[^/]*$/)[0]); - re.lastIndex = source.lastIndex; - return re; - - case '[object Blob]': - return new source.constructor([source], {type: source.type}); - } - - if (isFunction(source.cloneNode)) { - return source.cloneNode(true); - } - } - } - - -// eslint-disable-next-line no-self-compare - function simpleCompare(a, b) { return a === b || (a !== a && b !== b); } - - - /** - * @ngdoc function - * @name angular.equals - * @module ng - * @kind function - * - * @description - * Determines if two objects or two values are equivalent. Supports value types, regular - * expressions, arrays and objects. - * - * Two objects or values are considered equivalent if at least one of the following is true: - * - * * Both objects or values pass `===` comparison. - * * Both objects or values are of the same type and all of their properties are equal by - * comparing them with `angular.equals`. - * * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal) - * * Both values represent the same regular expression (In JavaScript, - * /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual - * representation matches). - * - * During a property comparison, properties of `function` type and properties with names - * that begin with `$` are ignored. - * - * Scope and DOMWindow objects are being compared only by identify (`===`). - * - * @param {*} o1 Object or value to compare. - * @param {*} o2 Object or value to compare. - * @returns {boolean} True if arguments are equal. - * - * @example - - -
    -
    -

    User 1

    - Name: - Age: - -

    User 2

    - Name: - Age: - -
    -
    - -
    - User 1:
    {{user1 | json}}
    - User 2:
    {{user2 | json}}
    - Equal:
    {{result}}
    -
    -
    -
    - - angular.module('equalsExample', []).controller('ExampleController', ['$scope', function($scope) { - $scope.user1 = {}; - $scope.user2 = {}; - $scope.compare = function() { - $scope.result = angular.equals($scope.user1, $scope.user2); - }; - }]); - -
    - */ - function equals(o1, o2) { - if (o1 === o2) return true; - if (o1 === null || o2 === null) return false; - // eslint-disable-next-line no-self-compare - if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN - var t1 = typeof o1, t2 = typeof o2, length, key, keySet; - if (t1 === t2 && t1 === 'object') { - if (isArray(o1)) { - if (!isArray(o2)) return false; - if ((length = o1.length) === o2.length) { - for (key = 0; key < length; key++) { - if (!equals(o1[key], o2[key])) return false; - } - return true; - } - } else if (isDate(o1)) { - if (!isDate(o2)) return false; - return simpleCompare(o1.getTime(), o2.getTime()); - } else if (isRegExp(o1)) { - if (!isRegExp(o2)) return false; - return o1.toString() === o2.toString(); - } else { - if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) || - isArray(o2) || isDate(o2) || isRegExp(o2)) return false; - keySet = createMap(); - for (key in o1) { - if (key.charAt(0) === '$' || isFunction(o1[key])) continue; - if (!equals(o1[key], o2[key])) return false; - keySet[key] = true; - } - for (key in o2) { - if (!(key in keySet) && - key.charAt(0) !== '$' && - isDefined(o2[key]) && - !isFunction(o2[key])) return false; - } - return true; - } - } - return false; - } - - var csp = function() { - if (!isDefined(csp.rules)) { - - - var ngCspElement = (window.document.querySelector('[ng-csp]') || - window.document.querySelector('[data-ng-csp]')); - - if (ngCspElement) { - var ngCspAttribute = ngCspElement.getAttribute('ng-csp') || - ngCspElement.getAttribute('data-ng-csp'); - csp.rules = { - noUnsafeEval: !ngCspAttribute || (ngCspAttribute.indexOf('no-unsafe-eval') !== -1), - noInlineStyle: !ngCspAttribute || (ngCspAttribute.indexOf('no-inline-style') !== -1) - }; - } else { - csp.rules = { - noUnsafeEval: noUnsafeEval(), - noInlineStyle: false - }; - } - } - - return csp.rules; - - function noUnsafeEval() { - try { - // eslint-disable-next-line no-new, no-new-func - new Function(''); - return false; - } catch (e) { - return true; - } - } - }; - - /** - * @ngdoc directive - * @module ng - * @name ngJq - * - * @element ANY - * @param {string=} ngJq the name of the library available under `window` - * to be used for angular.element - * @description - * Use this directive to force the angular.element library. This should be - * used to force either jqLite by leaving ng-jq blank or setting the name of - * the jquery variable under window (eg. jQuery). - * - * Since AngularJS looks for this directive when it is loaded (doesn't wait for the - * DOMContentLoaded event), it must be placed on an element that comes before the script - * which loads angular. Also, only the first instance of `ng-jq` will be used and all - * others ignored. - * - * @example - * This example shows how to force jqLite using the `ngJq` directive to the `html` tag. - ```html - - - ... - ... - - ``` - * @example - * This example shows how to use a jQuery based library of a different name. - * The library name must be available at the top most 'window'. - ```html - - - ... - ... - - ``` - */ - var jq = function() { - if (isDefined(jq.name_)) return jq.name_; - var el; - var i, ii = ngAttrPrefixes.length, prefix, name; - for (i = 0; i < ii; ++i) { - prefix = ngAttrPrefixes[i]; - el = window.document.querySelector('[' + prefix.replace(':', '\\:') + 'jq]'); - if (el) { - name = el.getAttribute(prefix + 'jq'); - break; - } - } - - return (jq.name_ = name); - }; - - function concat(array1, array2, index) { - return array1.concat(slice.call(array2, index)); - } - - function sliceArgs(args, startIndex) { - return slice.call(args, startIndex || 0); - } - - - /** - * @ngdoc function - * @name angular.bind - * @module ng - * @kind function - * - * @description - * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for - * `fn`). You can supply optional `args` that are prebound to the function. This feature is also - * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as - * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application). - * - * @param {Object} self Context which `fn` should be evaluated in. - * @param {function()} fn Function to be bound. - * @param {...*} args Optional arguments to be prebound to the `fn` function call. - * @returns {function()} Function that wraps the `fn` with all the specified bindings. - */ - function bind(self, fn) { - var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : []; - if (isFunction(fn) && !(fn instanceof RegExp)) { - return curryArgs.length - ? function() { - return arguments.length - ? fn.apply(self, concat(curryArgs, arguments, 0)) - : fn.apply(self, curryArgs); - } - : function() { - return arguments.length - ? fn.apply(self, arguments) - : fn.call(self); - }; - } else { - // In IE, native methods are not functions so they cannot be bound (note: they don't need to be). - return fn; - } - } - - - function toJsonReplacer(key, value) { - var val = value; - - if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') { - val = undefined; - } else if (isWindow(value)) { - val = '$WINDOW'; - } else if (value && window.document === value) { - val = '$DOCUMENT'; - } else if (isScope(value)) { - val = '$SCOPE'; - } - - return val; - } - - - /** - * @ngdoc function - * @name angular.toJson - * @module ng - * @kind function - * - * @description - * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be - * stripped since AngularJS uses this notation internally. - * - * @param {Object|Array|Date|string|number|boolean} obj Input to be serialized into JSON. - * @param {boolean|number} [pretty=2] If set to true, the JSON output will contain newlines and whitespace. - * If set to an integer, the JSON output will contain that many spaces per indentation. - * @returns {string|undefined} JSON-ified string representing `obj`. - * @knownIssue - * - * The Safari browser throws a `RangeError` instead of returning `null` when it tries to stringify a `Date` - * object with an invalid date value. The only reliable way to prevent this is to monkeypatch the - * `Date.prototype.toJSON` method as follows: - * - * ``` - * var _DatetoJSON = Date.prototype.toJSON; - * Date.prototype.toJSON = function() { - * try { - * return _DatetoJSON.call(this); - * } catch(e) { - * if (e instanceof RangeError) { - * return null; - * } - * throw e; - * } - * }; - * ``` - * - * See https://github.com/angular/angular.js/pull/14221 for more information. - */ - function toJson(obj, pretty) { - if (isUndefined(obj)) return undefined; - if (!isNumber(pretty)) { - pretty = pretty ? 2 : null; - } - return JSON.stringify(obj, toJsonReplacer, pretty); - } - - - /** - * @ngdoc function - * @name angular.fromJson - * @module ng - * @kind function - * - * @description - * Deserializes a JSON string. - * - * @param {string} json JSON string to deserialize. - * @returns {Object|Array|string|number} Deserialized JSON string. - */ - function fromJson(json) { - return isString(json) - ? JSON.parse(json) - : json; - } - - - var ALL_COLONS = /:/g; - function timezoneToOffset(timezone, fallback) { - // Support: IE 9-11 only, Edge 13-15+ - // IE/Edge do not "understand" colon (`:`) in timezone - timezone = timezone.replace(ALL_COLONS, ''); - var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000; - return isNumberNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset; - } - - - function addDateMinutes(date, minutes) { - date = new Date(date.getTime()); - date.setMinutes(date.getMinutes() + minutes); - return date; - } - - - function convertTimezoneToLocal(date, timezone, reverse) { - reverse = reverse ? -1 : 1; - var dateTimezoneOffset = date.getTimezoneOffset(); - var timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset); - return addDateMinutes(date, reverse * (timezoneOffset - dateTimezoneOffset)); - } - - - /** - * @returns {string} Returns the string representation of the element. - */ - function startingTag(element) { - element = jqLite(element).clone().empty(); - var elemHtml = jqLite('
    ').append(element).html(); - try { - return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) : - elemHtml. - match(/^(<[^>]+>)/)[1]. - replace(/^<([\w-]+)/, function(match, nodeName) {return '<' + lowercase(nodeName);}); - } catch (e) { - return lowercase(elemHtml); - } - - } - - -///////////////////////////////////////////////// - - /** - * Tries to decode the URI component without throwing an exception. - * - * @private - * @param str value potential URI component to check. - * @returns {boolean} True if `value` can be decoded - * with the decodeURIComponent function. - */ - function tryDecodeURIComponent(value) { - try { - return decodeURIComponent(value); - } catch (e) { - // Ignore any invalid uri component. - } - } - - - /** - * Parses an escaped url query string into key-value pairs. - * @returns {Object.} - */ - function parseKeyValue(/**string*/keyValue) { - var obj = {}; - forEach((keyValue || '').split('&'), function(keyValue) { - var splitPoint, key, val; - if (keyValue) { - key = keyValue = keyValue.replace(/\+/g,'%20'); - splitPoint = keyValue.indexOf('='); - if (splitPoint !== -1) { - key = keyValue.substring(0, splitPoint); - val = keyValue.substring(splitPoint + 1); - } - key = tryDecodeURIComponent(key); - if (isDefined(key)) { - val = isDefined(val) ? tryDecodeURIComponent(val) : true; - if (!hasOwnProperty.call(obj, key)) { - obj[key] = val; - } else if (isArray(obj[key])) { - obj[key].push(val); - } else { - obj[key] = [obj[key],val]; - } - } - } - }); - return obj; - } - - function toKeyValue(obj) { - var parts = []; - forEach(obj, function(value, key) { - if (isArray(value)) { - forEach(value, function(arrayValue) { - parts.push(encodeUriQuery(key, true) + - (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true))); - }); - } else { - parts.push(encodeUriQuery(key, true) + - (value === true ? '' : '=' + encodeUriQuery(value, true))); - } - }); - return parts.length ? parts.join('&') : ''; - } - - - /** - * We need our custom method because encodeURIComponent is too aggressive and doesn't follow - * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path - * segments: - * segment = *pchar - * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" - * pct-encoded = "%" HEXDIG HEXDIG - * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" - * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" - * / "*" / "+" / "," / ";" / "=" - */ - function encodeUriSegment(val) { - return encodeUriQuery(val, true). - replace(/%26/gi, '&'). - replace(/%3D/gi, '='). - replace(/%2B/gi, '+'); - } - - - /** - * This method is intended for encoding *key* or *value* parts of query component. We need a custom - * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be - * encoded per http://tools.ietf.org/html/rfc3986: - * query = *( pchar / "/" / "?" ) - * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" - * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" - * pct-encoded = "%" HEXDIG HEXDIG - * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" - * / "*" / "+" / "," / ";" / "=" - */ - function encodeUriQuery(val, pctEncodeSpaces) { - return encodeURIComponent(val). - replace(/%40/gi, '@'). - replace(/%3A/gi, ':'). - replace(/%24/g, '$'). - replace(/%2C/gi, ','). - replace(/%3B/gi, ';'). - replace(/%20/g, (pctEncodeSpaces ? '%20' : '+')); - } - - var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-']; - - function getNgAttribute(element, ngAttr) { - var attr, i, ii = ngAttrPrefixes.length; - for (i = 0; i < ii; ++i) { - attr = ngAttrPrefixes[i] + ngAttr; - if (isString(attr = element.getAttribute(attr))) { - return attr; - } - } - return null; - } - - function allowAutoBootstrap(document) { - var script = document.currentScript; - - if (!script) { - // Support: IE 9-11 only - // IE does not have `document.currentScript` - return true; - } - - // If the `currentScript` property has been clobbered just return false, since this indicates a probable attack - if (!(script instanceof window.HTMLScriptElement || script instanceof window.SVGScriptElement)) { - return false; - } - - var attributes = script.attributes; - var srcs = [attributes.getNamedItem('src'), attributes.getNamedItem('href'), attributes.getNamedItem('xlink:href')]; - - return srcs.every(function(src) { - if (!src) { - return true; - } - if (!src.value) { - return false; - } - - var link = document.createElement('a'); - link.href = src.value; - - if (document.location.origin === link.origin) { - // Same-origin resources are always allowed, even for non-whitelisted schemes. - return true; - } - // Disabled bootstrapping unless angular.js was loaded from a known scheme used on the web. - // This is to prevent angular.js bundled with browser extensions from being used to bypass the - // content security policy in web pages and other browser extensions. - switch (link.protocol) { - case 'http:': - case 'https:': - case 'ftp:': - case 'blob:': - case 'file:': - case 'data:': - return true; - default: - return false; - } - }); - } - -// Cached as it has to run during loading so that document.currentScript is available. - var isAutoBootstrapAllowed = allowAutoBootstrap(window.document); - - /** - * @ngdoc directive - * @name ngApp - * @module ng - * - * @element ANY - * @param {angular.Module} ngApp an optional application - * {@link angular.module module} name to load. - * @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be - * created in "strict-di" mode. This means that the application will fail to invoke functions which - * do not use explicit function annotation (and are thus unsuitable for minification), as described - * in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in - * tracking down the root of these bugs. - * - * @description - * - * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive - * designates the **root element** of the application and is typically placed near the root element - * of the page - e.g. on the `` or `` tags. - * - * There are a few things to keep in mind when using `ngApp`: - * - only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp` - * found in the document will be used to define the root element to auto-bootstrap as an - * application. To run multiple applications in an HTML document you must manually bootstrap them using - * {@link angular.bootstrap} instead. - * - AngularJS applications cannot be nested within each other. - * - Do not use a directive that uses {@link ng.$compile#transclusion transclusion} on the same element as `ngApp`. - * This includes directives such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and - * {@link ngRoute.ngView `ngView`}. - * Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector}, - * causing animations to stop working and making the injector inaccessible from outside the app. - * - * You can specify an **AngularJS module** to be used as the root module for the application. This - * module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It - * should contain the application code needed or have dependencies on other modules that will - * contain the code. See {@link angular.module} for more information. - * - * In the example below if the `ngApp` directive were not placed on the `html` element then the - * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}` - * would not be resolved to `3`. - * - * @example - * - * ### Simple Usage - * - * `ngApp` is the easiest, and most common way to bootstrap an application. - * - - -
    - I can add: {{a}} + {{b}} = {{ a+b }} -
    -
    - - angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) { - $scope.a = 1; - $scope.b = 2; - }); - -
    - * - * @example - * - * ### With `ngStrictDi` - * - * Using `ngStrictDi`, you would see something like this: - * - - -
    -
    - I can add: {{a}} + {{b}} = {{ a+b }} - -

    This renders because the controller does not fail to - instantiate, by using explicit annotation style (see - script.js for details) -

    -
    - -
    - Name:
    - Hello, {{name}}! - -

    This renders because the controller does not fail to - instantiate, by using explicit annotation style - (see script.js for details) -

    -
    - -
    - I can add: {{a}} + {{b}} = {{ a+b }} - -

    The controller could not be instantiated, due to relying - on automatic function annotations (which are disabled in - strict mode). As such, the content of this section is not - interpolated, and there should be an error in your web console. -

    -
    -
    -
    - - angular.module('ngAppStrictDemo', []) - // BadController will fail to instantiate, due to relying on automatic function annotation, - // rather than an explicit annotation - .controller('BadController', function($scope) { - $scope.a = 1; - $scope.b = 2; - }) - // Unlike BadController, GoodController1 and GoodController2 will not fail to be instantiated, - // due to using explicit annotations using the array style and $inject property, respectively. - .controller('GoodController1', ['$scope', function($scope) { - $scope.a = 1; - $scope.b = 2; - }]) - .controller('GoodController2', GoodController2); - function GoodController2($scope) { - $scope.name = 'World'; - } - GoodController2.$inject = ['$scope']; - - - div[ng-controller] { - margin-bottom: 1em; - -webkit-border-radius: 4px; - border-radius: 4px; - border: 1px solid; - padding: .5em; - } - div[ng-controller^=Good] { - border-color: #d6e9c6; - background-color: #dff0d8; - color: #3c763d; - } - div[ng-controller^=Bad] { - border-color: #ebccd1; - background-color: #f2dede; - color: #a94442; - margin-bottom: 0; - } - -
    - */ - function angularInit(element, bootstrap) { - var appElement, - module, - config = {}; - - // The element `element` has priority over any other element. - forEach(ngAttrPrefixes, function(prefix) { - var name = prefix + 'app'; - - if (!appElement && element.hasAttribute && element.hasAttribute(name)) { - appElement = element; - module = element.getAttribute(name); - } - }); - forEach(ngAttrPrefixes, function(prefix) { - var name = prefix + 'app'; - var candidate; - - if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) { - appElement = candidate; - module = candidate.getAttribute(name); - } - }); - if (appElement) { - if (!isAutoBootstrapAllowed) { - window.console.error('AngularJS: disabling automatic bootstrap. - * - * - * - * ``` - * - * @param {DOMElement} element DOM element which is the root of AngularJS application. - * @param {Array=} modules an array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a `config` block. - * See: {@link angular.module modules} - * @param {Object=} config an object for defining configuration options for the application. The - * following keys are supported: - * - * * `strictDi` - disable automatic function annotation for the application. This is meant to - * assist in finding bugs which break minified code. Defaults to `false`. - * - * @returns {auto.$injector} Returns the newly created injector for this app. - */ - function bootstrap(element, modules, config) { - if (!isObject(config)) config = {}; - var defaultConfig = { - strictDi: false - }; - config = extend(defaultConfig, config); - var doBootstrap = function() { - element = jqLite(element); - - if (element.injector()) { - var tag = (element[0] === window.document) ? 'document' : startingTag(element); - // Encode angle brackets to prevent input from being sanitized to empty string #8683. - throw ngMinErr( - 'btstrpd', - 'App already bootstrapped with this element \'{0}\'', - tag.replace(//,'>')); - } - - modules = modules || []; - modules.unshift(['$provide', function($provide) { - $provide.value('$rootElement', element); - }]); - - if (config.debugInfoEnabled) { - // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`. - modules.push(['$compileProvider', function($compileProvider) { - $compileProvider.debugInfoEnabled(true); - }]); - } - - modules.unshift('ng'); - var injector = createInjector(modules, config.strictDi); - injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector', - function bootstrapApply(scope, element, compile, injector) { - scope.$apply(function() { - element.data('$injector', injector); - compile(element)(scope); - }); - }] - ); - return injector; - }; - - var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/; - var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/; - - if (window && NG_ENABLE_DEBUG_INFO.test(window.name)) { - config.debugInfoEnabled = true; - window.name = window.name.replace(NG_ENABLE_DEBUG_INFO, ''); - } - - if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) { - return doBootstrap(); - } - - window.name = window.name.replace(NG_DEFER_BOOTSTRAP, ''); - angular.resumeBootstrap = function(extraModules) { - forEach(extraModules, function(module) { - modules.push(module); - }); - return doBootstrap(); - }; - - if (isFunction(angular.resumeDeferredBootstrap)) { - angular.resumeDeferredBootstrap(); - } - } - - /** - * @ngdoc function - * @name angular.reloadWithDebugInfo - * @module ng - * @description - * Use this function to reload the current application with debug information turned on. - * This takes precedence over a call to `$compileProvider.debugInfoEnabled(false)`. - * - * See {@link ng.$compileProvider#debugInfoEnabled} for more. - */ - function reloadWithDebugInfo() { - window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name; - window.location.reload(); - } - - /** - * @name angular.getTestability - * @module ng - * @description - * Get the testability service for the instance of AngularJS on the given - * element. - * @param {DOMElement} element DOM element which is the root of AngularJS application. - */ - function getTestability(rootElement) { - var injector = angular.element(rootElement).injector(); - if (!injector) { - throw ngMinErr('test', - 'no injector found for element argument to getTestability'); - } - return injector.get('$$testability'); - } - - var SNAKE_CASE_REGEXP = /[A-Z]/g; - function snake_case(name, separator) { - separator = separator || '_'; - return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) { - return (pos ? separator : '') + letter.toLowerCase(); - }); - } - - var bindJQueryFired = false; - function bindJQuery() { - var originalCleanData; - - if (bindJQueryFired) { - return; - } - - // bind to jQuery if present; - var jqName = jq(); - jQuery = isUndefined(jqName) ? window.jQuery : // use jQuery (if present) - !jqName ? undefined : // use jqLite - window[jqName]; // use jQuery specified by `ngJq` - - // Use jQuery if it exists with proper functionality, otherwise default to us. - // AngularJS 1.2+ requires jQuery 1.7+ for on()/off() support. - // AngularJS 1.3+ technically requires at least jQuery 2.1+ but it may work with older - // versions. It will not work for sure with jQuery <1.7, though. - if (jQuery && jQuery.fn.on) { - jqLite = jQuery; - extend(jQuery.fn, { - scope: JQLitePrototype.scope, - isolateScope: JQLitePrototype.isolateScope, - controller: /** @type {?} */ (JQLitePrototype).controller, - injector: JQLitePrototype.injector, - inheritedData: JQLitePrototype.inheritedData - }); - - // All nodes removed from the DOM via various jQuery APIs like .remove() - // are passed through jQuery.cleanData. Monkey-patch this method to fire - // the $destroy event on all removed nodes. - originalCleanData = jQuery.cleanData; - jQuery.cleanData = function(elems) { - var events; - for (var i = 0, elem; (elem = elems[i]) != null; i++) { - events = jQuery._data(elem, 'events'); - if (events && events.$destroy) { - jQuery(elem).triggerHandler('$destroy'); - } - } - originalCleanData(elems); - }; - } else { - jqLite = JQLite; - } - - angular.element = jqLite; - - // Prevent double-proxying. - bindJQueryFired = true; - } - - /** - * throw error if the argument is falsy. - */ - function assertArg(arg, name, reason) { - if (!arg) { - throw ngMinErr('areq', 'Argument \'{0}\' is {1}', (name || '?'), (reason || 'required')); - } - return arg; - } - - function assertArgFn(arg, name, acceptArrayAnnotation) { - if (acceptArrayAnnotation && isArray(arg)) { - arg = arg[arg.length - 1]; - } - - assertArg(isFunction(arg), name, 'not a function, got ' + - (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg)); - return arg; - } - - /** - * throw error if the name given is hasOwnProperty - * @param {String} name the name to test - * @param {String} context the context in which the name is used, such as module or directive - */ - function assertNotHasOwnProperty(name, context) { - if (name === 'hasOwnProperty') { - throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context); - } - } - - /** - * Return the value accessible from the object by path. Any undefined traversals are ignored - * @param {Object} obj starting object - * @param {String} path path to traverse - * @param {boolean} [bindFnToScope=true] - * @returns {Object} value as accessible by path - */ -//TODO(misko): this function needs to be removed - function getter(obj, path, bindFnToScope) { - if (!path) return obj; - var keys = path.split('.'); - var key; - var lastInstance = obj; - var len = keys.length; - - for (var i = 0; i < len; i++) { - key = keys[i]; - if (obj) { - obj = (lastInstance = obj)[key]; - } - } - if (!bindFnToScope && isFunction(obj)) { - return bind(lastInstance, obj); - } - return obj; - } - - /** - * Return the DOM siblings between the first and last node in the given array. - * @param {Array} array like object - * @returns {Array} the inputted object or a jqLite collection containing the nodes - */ - function getBlockNodes(nodes) { - // TODO(perf): update `nodes` instead of creating a new object? - var node = nodes[0]; - var endNode = nodes[nodes.length - 1]; - var blockNodes; - - for (var i = 1; node !== endNode && (node = node.nextSibling); i++) { - if (blockNodes || nodes[i] !== node) { - if (!blockNodes) { - blockNodes = jqLite(slice.call(nodes, 0, i)); - } - blockNodes.push(node); - } - } - - return blockNodes || nodes; - } - - - /** - * Creates a new object without a prototype. This object is useful for lookup without having to - * guard against prototypically inherited properties via hasOwnProperty. - * - * Related micro-benchmarks: - * - http://jsperf.com/object-create2 - * - http://jsperf.com/proto-map-lookup/2 - * - http://jsperf.com/for-in-vs-object-keys2 - * - * @returns {Object} - */ - function createMap() { - return Object.create(null); - } - - function stringify(value) { - if (value == null) { // null || undefined - return ''; - } - switch (typeof value) { - case 'string': - break; - case 'number': - value = '' + value; - break; - default: - if (hasCustomToString(value) && !isArray(value) && !isDate(value)) { - value = value.toString(); - } else { - value = toJson(value); - } - } - - return value; - } - - var NODE_TYPE_ELEMENT = 1; - var NODE_TYPE_ATTRIBUTE = 2; - var NODE_TYPE_TEXT = 3; - var NODE_TYPE_COMMENT = 8; - var NODE_TYPE_DOCUMENT = 9; - var NODE_TYPE_DOCUMENT_FRAGMENT = 11; - - /** - * @ngdoc type - * @name angular.Module - * @module ng - * @description - * - * Interface for configuring AngularJS {@link angular.module modules}. - */ - - function setupModuleLoader(window) { - - var $injectorMinErr = minErr('$injector'); - var ngMinErr = minErr('ng'); - - function ensure(obj, name, factory) { - return obj[name] || (obj[name] = factory()); - } - - var angular = ensure(window, 'angular', Object); - - // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap - angular.$$minErr = angular.$$minErr || minErr; - - return ensure(angular, 'module', function() { - /** @type {Object.} */ - var modules = {}; - - /** - * @ngdoc function - * @name angular.module - * @module ng - * @description - * - * The `angular.module` is a global place for creating, registering and retrieving AngularJS - * modules. - * All modules (AngularJS core or 3rd party) that should be available to an application must be - * registered using this mechanism. - * - * Passing one argument retrieves an existing {@link angular.Module}, - * whereas passing more than one argument creates a new {@link angular.Module} - * - * - * # Module - * - * A module is a collection of services, directives, controllers, filters, and configuration information. - * `angular.module` is used to configure the {@link auto.$injector $injector}. - * - * ```js - * // Create a new module - * var myModule = angular.module('myModule', []); - * - * // register a new service - * myModule.value('appName', 'MyCoolApp'); - * - * // configure existing services inside initialization blocks. - * myModule.config(['$locationProvider', function($locationProvider) { - * // Configure existing providers - * $locationProvider.hashPrefix('!'); - * }]); - * ``` - * - * Then you can create an injector and load your modules like this: - * - * ```js - * var injector = angular.injector(['ng', 'myModule']) - * ``` - * - * However it's more likely that you'll just use - * {@link ng.directive:ngApp ngApp} or - * {@link angular.bootstrap} to simplify this process for you. - * - * @param {!string} name The name of the module to create or retrieve. - * @param {!Array.=} requires If specified then new module is being created. If - * unspecified then the module is being retrieved for further configuration. - * @param {Function=} configFn Optional configuration function for the module. Same as - * {@link angular.Module#config Module#config()}. - * @returns {angular.Module} new module with the {@link angular.Module} api. - */ - return function module(name, requires, configFn) { - - var info = {}; - - var assertNotHasOwnProperty = function(name, context) { - if (name === 'hasOwnProperty') { - throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context); - } - }; - - assertNotHasOwnProperty(name, 'module'); - if (requires && modules.hasOwnProperty(name)) { - modules[name] = null; - } - return ensure(modules, name, function() { - if (!requires) { - throw $injectorMinErr('nomod', 'Module \'{0}\' is not available! You either misspelled ' + - 'the module name or forgot to load it. If registering a module ensure that you ' + - 'specify the dependencies as the second argument.', name); - } - - /** @type {!Array.>} */ - var invokeQueue = []; - - /** @type {!Array.} */ - var configBlocks = []; - - /** @type {!Array.} */ - var runBlocks = []; - - var config = invokeLater('$injector', 'invoke', 'push', configBlocks); - - /** @type {angular.Module} */ - var moduleInstance = { - // Private state - _invokeQueue: invokeQueue, - _configBlocks: configBlocks, - _runBlocks: runBlocks, - - /** - * @ngdoc method - * @name angular.Module#info - * @module ng - * - * @param {Object=} info Information about the module - * @returns {Object|Module} The current info object for this module if called as a getter, - * or `this` if called as a setter. - * - * @description - * Read and write custom information about this module. - * For example you could put the version of the module in here. - * - * ```js - * angular.module('myModule', []).info({ version: '1.0.0' }); - * ``` - * - * The version could then be read back out by accessing the module elsewhere: - * - * ``` - * var version = angular.module('myModule').info().version; - * ``` - * - * You can also retrieve this information during runtime via the - * {@link $injector#modules `$injector.modules`} property: - * - * ```js - * var version = $injector.modules['myModule'].info().version; - * ``` - */ - info: function(value) { - if (isDefined(value)) { - if (!isObject(value)) throw ngMinErr('aobj', 'Argument \'{0}\' must be an object', 'value'); - info = value; - return this; - } - return info; - }, - - /** - * @ngdoc property - * @name angular.Module#requires - * @module ng - * - * @description - * Holds the list of modules which the injector will load before the current module is - * loaded. - */ - requires: requires, - - /** - * @ngdoc property - * @name angular.Module#name - * @module ng - * - * @description - * Name of the module. - */ - name: name, - - - /** - * @ngdoc method - * @name angular.Module#provider - * @module ng - * @param {string} name service name - * @param {Function} providerType Construction function for creating new instance of the - * service. - * @description - * See {@link auto.$provide#provider $provide.provider()}. - */ - provider: invokeLaterAndSetModuleName('$provide', 'provider'), - - /** - * @ngdoc method - * @name angular.Module#factory - * @module ng - * @param {string} name service name - * @param {Function} providerFunction Function for creating new instance of the service. - * @description - * See {@link auto.$provide#factory $provide.factory()}. - */ - factory: invokeLaterAndSetModuleName('$provide', 'factory'), - - /** - * @ngdoc method - * @name angular.Module#service - * @module ng - * @param {string} name service name - * @param {Function} constructor A constructor function that will be instantiated. - * @description - * See {@link auto.$provide#service $provide.service()}. - */ - service: invokeLaterAndSetModuleName('$provide', 'service'), - - /** - * @ngdoc method - * @name angular.Module#value - * @module ng - * @param {string} name service name - * @param {*} object Service instance object. - * @description - * See {@link auto.$provide#value $provide.value()}. - */ - value: invokeLater('$provide', 'value'), - - /** - * @ngdoc method - * @name angular.Module#constant - * @module ng - * @param {string} name constant name - * @param {*} object Constant value. - * @description - * Because the constants are fixed, they get applied before other provide methods. - * See {@link auto.$provide#constant $provide.constant()}. - */ - constant: invokeLater('$provide', 'constant', 'unshift'), - - /** - * @ngdoc method - * @name angular.Module#decorator - * @module ng - * @param {string} name The name of the service to decorate. - * @param {Function} decorFn This function will be invoked when the service needs to be - * instantiated and should return the decorated service instance. - * @description - * See {@link auto.$provide#decorator $provide.decorator()}. - */ - decorator: invokeLaterAndSetModuleName('$provide', 'decorator', configBlocks), - - /** - * @ngdoc method - * @name angular.Module#animation - * @module ng - * @param {string} name animation name - * @param {Function} animationFactory Factory function for creating new instance of an - * animation. - * @description - * - * **NOTE**: animations take effect only if the **ngAnimate** module is loaded. - * - * - * Defines an animation hook that can be later used with - * {@link $animate $animate} service and directives that use this service. - * - * ```js - * module.animation('.animation-name', function($inject1, $inject2) { - * return { - * eventName : function(element, done) { - * //code to run the animation - * //once complete, then run done() - * return function cancellationFunction(element) { - * //code to cancel the animation - * } - * } - * } - * }) - * ``` - * - * See {@link ng.$animateProvider#register $animateProvider.register()} and - * {@link ngAnimate ngAnimate module} for more information. - */ - animation: invokeLaterAndSetModuleName('$animateProvider', 'register'), - - /** - * @ngdoc method - * @name angular.Module#filter - * @module ng - * @param {string} name Filter name - this must be a valid AngularJS expression identifier - * @param {Function} filterFactory Factory function for creating new instance of filter. - * @description - * See {@link ng.$filterProvider#register $filterProvider.register()}. - * - *
    - * **Note:** Filter names must be valid AngularJS {@link expression} identifiers, such as `uppercase` or `orderBy`. - * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace - * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores - * (`myapp_subsection_filterx`). - *
    - */ - filter: invokeLaterAndSetModuleName('$filterProvider', 'register'), - - /** - * @ngdoc method - * @name angular.Module#controller - * @module ng - * @param {string|Object} name Controller name, or an object map of controllers where the - * keys are the names and the values are the constructors. - * @param {Function} constructor Controller constructor function. - * @description - * See {@link ng.$controllerProvider#register $controllerProvider.register()}. - */ - controller: invokeLaterAndSetModuleName('$controllerProvider', 'register'), - - /** - * @ngdoc method - * @name angular.Module#directive - * @module ng - * @param {string|Object} name Directive name, or an object map of directives where the - * keys are the names and the values are the factories. - * @param {Function} directiveFactory Factory function for creating new instance of - * directives. - * @description - * See {@link ng.$compileProvider#directive $compileProvider.directive()}. - */ - directive: invokeLaterAndSetModuleName('$compileProvider', 'directive'), - - /** - * @ngdoc method - * @name angular.Module#component - * @module ng - * @param {string} name Name of the component in camel-case (i.e. myComp which will match as my-comp) - * @param {Object} options Component definition object (a simplified - * {@link ng.$compile#directive-definition-object directive definition object}) - * - * @description - * See {@link ng.$compileProvider#component $compileProvider.component()}. - */ - component: invokeLaterAndSetModuleName('$compileProvider', 'component'), - - /** - * @ngdoc method - * @name angular.Module#config - * @module ng - * @param {Function} configFn Execute this function on module load. Useful for service - * configuration. - * @description - * Use this method to configure services by injecting their - * {@link angular.Module#provider `providers`}, e.g. for adding routes to the - * {@link ngRoute.$routeProvider $routeProvider}. - * - * Note that you can only inject {@link angular.Module#provider `providers`} and - * {@link angular.Module#constant `constants`} into this function. - * - * For more about how to configure services, see - * {@link providers#provider-recipe Provider Recipe}. - */ - config: config, - - /** - * @ngdoc method - * @name angular.Module#run - * @module ng - * @param {Function} initializationFn Execute this function after injector creation. - * Useful for application initialization. - * @description - * Use this method to register work which should be performed when the injector is done - * loading all modules. - */ - run: function(block) { - runBlocks.push(block); - return this; - } - }; - - if (configFn) { - config(configFn); - } - - return moduleInstance; - - /** - * @param {string} provider - * @param {string} method - * @param {String=} insertMethod - * @returns {angular.Module} - */ - function invokeLater(provider, method, insertMethod, queue) { - if (!queue) queue = invokeQueue; - return function() { - queue[insertMethod || 'push']([provider, method, arguments]); - return moduleInstance; - }; - } - - /** - * @param {string} provider - * @param {string} method - * @returns {angular.Module} - */ - function invokeLaterAndSetModuleName(provider, method, queue) { - if (!queue) queue = invokeQueue; - return function(recipeName, factoryFunction) { - if (factoryFunction && isFunction(factoryFunction)) factoryFunction.$$moduleName = name; - queue.push([provider, method, arguments]); - return moduleInstance; - }; - } - }); - }; - }); - - } - - /* global shallowCopy: true */ - - /** - * Creates a shallow copy of an object, an array or a primitive. - * - * Assumes that there are no proto properties for objects. - */ - function shallowCopy(src, dst) { - if (isArray(src)) { - dst = dst || []; - - for (var i = 0, ii = src.length; i < ii; i++) { - dst[i] = src[i]; - } - } else if (isObject(src)) { - dst = dst || {}; - - for (var key in src) { - if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) { - dst[key] = src[key]; - } - } - } - - return dst || src; - } - - /* exported toDebugString */ - - function serializeObject(obj, maxDepth) { - var seen = []; - - // There is no direct way to stringify object until reaching a specific depth - // and a very deep object can cause a performance issue, so we copy the object - // based on this specific depth and then stringify it. - if (isValidObjectMaxDepth(maxDepth)) { - // This file is also included in `angular-loader`, so `copy()` might not always be available in - // the closure. Therefore, it is lazily retrieved as `angular.copy()` when needed. - obj = angular.copy(obj, null, maxDepth); - } - return JSON.stringify(obj, function(key, val) { - val = toJsonReplacer(key, val); - if (isObject(val)) { - - if (seen.indexOf(val) >= 0) return '...'; - - seen.push(val); - } - return val; - }); - } - - function toDebugString(obj, maxDepth) { - if (typeof obj === 'function') { - return obj.toString().replace(/ \{[\s\S]*$/, ''); - } else if (isUndefined(obj)) { - return 'undefined'; - } else if (typeof obj !== 'string') { - return serializeObject(obj, maxDepth); - } - return obj; - } - - /* global angularModule: true, - version: true, - - $CompileProvider, - - htmlAnchorDirective, - inputDirective, - inputDirective, - formDirective, - scriptDirective, - selectDirective, - optionDirective, - ngBindDirective, - ngBindHtmlDirective, - ngBindTemplateDirective, - ngClassDirective, - ngClassEvenDirective, - ngClassOddDirective, - ngCloakDirective, - ngControllerDirective, - ngFormDirective, - ngHideDirective, - ngIfDirective, - ngIncludeDirective, - ngIncludeFillContentDirective, - ngInitDirective, - ngNonBindableDirective, - ngPluralizeDirective, - ngRepeatDirective, - ngShowDirective, - ngStyleDirective, - ngSwitchDirective, - ngSwitchWhenDirective, - ngSwitchDefaultDirective, - ngOptionsDirective, - ngTranscludeDirective, - ngModelDirective, - ngListDirective, - ngChangeDirective, - patternDirective, - patternDirective, - requiredDirective, - requiredDirective, - minlengthDirective, - minlengthDirective, - maxlengthDirective, - maxlengthDirective, - ngValueDirective, - ngModelOptionsDirective, - ngAttributeAliasDirectives, - ngEventDirectives, - - $AnchorScrollProvider, - $AnimateProvider, - $CoreAnimateCssProvider, - $$CoreAnimateJsProvider, - $$CoreAnimateQueueProvider, - $$AnimateRunnerFactoryProvider, - $$AnimateAsyncRunFactoryProvider, - $BrowserProvider, - $CacheFactoryProvider, - $ControllerProvider, - $DateProvider, - $DocumentProvider, - $$IsDocumentHiddenProvider, - $ExceptionHandlerProvider, - $FilterProvider, - $$ForceReflowProvider, - $InterpolateProvider, - $IntervalProvider, - $HttpProvider, - $HttpParamSerializerProvider, - $HttpParamSerializerJQLikeProvider, - $HttpBackendProvider, - $xhrFactoryProvider, - $jsonpCallbacksProvider, - $LocationProvider, - $LogProvider, - $$MapProvider, - $ParseProvider, - $RootScopeProvider, - $QProvider, - $$QProvider, - $$SanitizeUriProvider, - $SceProvider, - $SceDelegateProvider, - $SnifferProvider, - $TemplateCacheProvider, - $TemplateRequestProvider, - $$TestabilityProvider, - $TimeoutProvider, - $$RAFProvider, - $WindowProvider, - $$jqLiteProvider, - $$CookieReaderProvider -*/ - - - /** - * @ngdoc object - * @name angular.version - * @module ng - * @description - * An object that contains information about the current AngularJS version. - * - * This object has the following properties: - * - * - `full` – `{string}` – Full version string, such as "0.9.18". - * - `major` – `{number}` – Major version number, such as "0". - * - `minor` – `{number}` – Minor version number, such as "9". - * - `dot` – `{number}` – Dot version number, such as "18". - * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat". - */ - var version = { - // These placeholder strings will be replaced by grunt's `build` task. - // They need to be double- or single-quoted. - full: '1.6.9', - major: 1, - minor: 6, - dot: 9, - codeName: 'fiery-basilisk' - }; - - - function publishExternalAPI(angular) { - extend(angular, { - 'errorHandlingConfig': errorHandlingConfig, - 'bootstrap': bootstrap, - 'copy': copy, - 'extend': extend, - 'merge': merge, - 'equals': equals, - 'element': jqLite, - 'forEach': forEach, - 'injector': createInjector, - 'noop': noop, - 'bind': bind, - 'toJson': toJson, - 'fromJson': fromJson, - 'identity': identity, - 'isUndefined': isUndefined, - 'isDefined': isDefined, - 'isString': isString, - 'isFunction': isFunction, - 'isObject': isObject, - 'isNumber': isNumber, - 'isElement': isElement, - 'isArray': isArray, - 'version': version, - 'isDate': isDate, - 'lowercase': lowercase, - 'uppercase': uppercase, - 'callbacks': {$$counter: 0}, - 'getTestability': getTestability, - 'reloadWithDebugInfo': reloadWithDebugInfo, - '$$minErr': minErr, - '$$csp': csp, - '$$encodeUriSegment': encodeUriSegment, - '$$encodeUriQuery': encodeUriQuery, - '$$stringify': stringify - }); - - angularModule = setupModuleLoader(window); - - angularModule('ng', ['ngLocale'], ['$provide', - function ngModule($provide) { - // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it. - $provide.provider({ - $$sanitizeUri: $$SanitizeUriProvider - }); - $provide.provider('$compile', $CompileProvider). - directive({ - a: htmlAnchorDirective, - input: inputDirective, - textarea: inputDirective, - form: formDirective, - script: scriptDirective, - select: selectDirective, - option: optionDirective, - ngBind: ngBindDirective, - ngBindHtml: ngBindHtmlDirective, - ngBindTemplate: ngBindTemplateDirective, - ngClass: ngClassDirective, - ngClassEven: ngClassEvenDirective, - ngClassOdd: ngClassOddDirective, - ngCloak: ngCloakDirective, - ngController: ngControllerDirective, - ngForm: ngFormDirective, - ngHide: ngHideDirective, - ngIf: ngIfDirective, - ngInclude: ngIncludeDirective, - ngInit: ngInitDirective, - ngNonBindable: ngNonBindableDirective, - ngPluralize: ngPluralizeDirective, - ngRepeat: ngRepeatDirective, - ngShow: ngShowDirective, - ngStyle: ngStyleDirective, - ngSwitch: ngSwitchDirective, - ngSwitchWhen: ngSwitchWhenDirective, - ngSwitchDefault: ngSwitchDefaultDirective, - ngOptions: ngOptionsDirective, - ngTransclude: ngTranscludeDirective, - ngModel: ngModelDirective, - ngList: ngListDirective, - ngChange: ngChangeDirective, - pattern: patternDirective, - ngPattern: patternDirective, - required: requiredDirective, - ngRequired: requiredDirective, - minlength: minlengthDirective, - ngMinlength: minlengthDirective, - maxlength: maxlengthDirective, - ngMaxlength: maxlengthDirective, - ngValue: ngValueDirective, - ngModelOptions: ngModelOptionsDirective - }). - directive({ - ngInclude: ngIncludeFillContentDirective - }). - directive(ngAttributeAliasDirectives). - directive(ngEventDirectives); - $provide.provider({ - $anchorScroll: $AnchorScrollProvider, - $animate: $AnimateProvider, - $animateCss: $CoreAnimateCssProvider, - $$animateJs: $$CoreAnimateJsProvider, - $$animateQueue: $$CoreAnimateQueueProvider, - $$AnimateRunner: $$AnimateRunnerFactoryProvider, - $$animateAsyncRun: $$AnimateAsyncRunFactoryProvider, - $browser: $BrowserProvider, - $cacheFactory: $CacheFactoryProvider, - $controller: $ControllerProvider, - $document: $DocumentProvider, - $$isDocumentHidden: $$IsDocumentHiddenProvider, - $exceptionHandler: $ExceptionHandlerProvider, - $filter: $FilterProvider, - $$forceReflow: $$ForceReflowProvider, - $interpolate: $InterpolateProvider, - $interval: $IntervalProvider, - $http: $HttpProvider, - $httpParamSerializer: $HttpParamSerializerProvider, - $httpParamSerializerJQLike: $HttpParamSerializerJQLikeProvider, - $httpBackend: $HttpBackendProvider, - $xhrFactory: $xhrFactoryProvider, - $jsonpCallbacks: $jsonpCallbacksProvider, - $location: $LocationProvider, - $log: $LogProvider, - $parse: $ParseProvider, - $rootScope: $RootScopeProvider, - $q: $QProvider, - $$q: $$QProvider, - $sce: $SceProvider, - $sceDelegate: $SceDelegateProvider, - $sniffer: $SnifferProvider, - $templateCache: $TemplateCacheProvider, - $templateRequest: $TemplateRequestProvider, - $$testability: $$TestabilityProvider, - $timeout: $TimeoutProvider, - $window: $WindowProvider, - $$rAF: $$RAFProvider, - $$jqLite: $$jqLiteProvider, - $$Map: $$MapProvider, - $$cookieReader: $$CookieReaderProvider - }); - } - ]) - .info({ angularVersion: '1.6.9' }); - } - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Any commits to this file should be reviewed with security in mind. * - * Changes to this file can potentially create security vulnerabilities. * - * An approval from 2 Core members with history of modifying * - * this file is required. * - * * - * Does the change somehow allow for arbitrary javascript to be executed? * - * Or allows for someone to change the prototype of built-in objects? * - * Or gives undesired access to variables likes document or window? * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - /* global - JQLitePrototype: true, - BOOLEAN_ATTR: true, - ALIASED_ATTR: true -*/ - -////////////////////////////////// -//JQLite -////////////////////////////////// - - /** - * @ngdoc function - * @name angular.element - * @module ng - * @kind function - * - * @description - * Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element. - * - * If jQuery is available, `angular.element` is an alias for the - * [jQuery](http://api.jquery.com/jQuery/) function. If jQuery is not available, `angular.element` - * delegates to AngularJS's built-in subset of jQuery, called "jQuery lite" or **jqLite**. - * - * jqLite is a tiny, API-compatible subset of jQuery that allows - * AngularJS to manipulate the DOM in a cross-browser compatible way. jqLite implements only the most - * commonly needed functionality with the goal of having a very small footprint. - * - * To use `jQuery`, simply ensure it is loaded before the `angular.js` file. You can also use the - * {@link ngJq `ngJq`} directive to specify that jqlite should be used over jQuery, or to use a - * specific version of jQuery if multiple versions exist on the page. - * - *
    **Note:** All element references in AngularJS are always wrapped with jQuery or - * jqLite (such as the element argument in a directive's compile / link function). They are never raw DOM references.
    - * - *
    **Note:** Keep in mind that this function will not find elements - * by tag name / CSS selector. For lookups by tag name, try instead `angular.element(document).find(...)` - * or `$document.find()`, or use the standard DOM APIs, e.g. `document.querySelectorAll()`.
    - * - * ## AngularJS's jqLite - * jqLite provides only the following jQuery methods: - * - * - [`addClass()`](http://api.jquery.com/addClass/) - Does not support a function as first argument - * - [`after()`](http://api.jquery.com/after/) - * - [`append()`](http://api.jquery.com/append/) - * - [`attr()`](http://api.jquery.com/attr/) - Does not support functions as parameters - * - [`bind()`](http://api.jquery.com/bind/) (_deprecated_, use [`on()`](http://api.jquery.com/on/)) - Does not support namespaces, selectors or eventData - * - [`children()`](http://api.jquery.com/children/) - Does not support selectors - * - [`clone()`](http://api.jquery.com/clone/) - * - [`contents()`](http://api.jquery.com/contents/) - * - [`css()`](http://api.jquery.com/css/) - Only retrieves inline-styles, does not call `getComputedStyle()`. - * As a setter, does not convert numbers to strings or append 'px', and also does not have automatic property prefixing. - * - [`data()`](http://api.jquery.com/data/) - * - [`detach()`](http://api.jquery.com/detach/) - * - [`empty()`](http://api.jquery.com/empty/) - * - [`eq()`](http://api.jquery.com/eq/) - * - [`find()`](http://api.jquery.com/find/) - Limited to lookups by tag name - * - [`hasClass()`](http://api.jquery.com/hasClass/) - * - [`html()`](http://api.jquery.com/html/) - * - [`next()`](http://api.jquery.com/next/) - Does not support selectors - * - [`on()`](http://api.jquery.com/on/) - Does not support namespaces, selectors or eventData - * - [`off()`](http://api.jquery.com/off/) - Does not support namespaces, selectors or event object as parameter - * - [`one()`](http://api.jquery.com/one/) - Does not support namespaces or selectors - * - [`parent()`](http://api.jquery.com/parent/) - Does not support selectors - * - [`prepend()`](http://api.jquery.com/prepend/) - * - [`prop()`](http://api.jquery.com/prop/) - * - [`ready()`](http://api.jquery.com/ready/) (_deprecated_, use `angular.element(callback)` instead of `angular.element(document).ready(callback)`) - * - [`remove()`](http://api.jquery.com/remove/) - * - [`removeAttr()`](http://api.jquery.com/removeAttr/) - Does not support multiple attributes - * - [`removeClass()`](http://api.jquery.com/removeClass/) - Does not support a function as first argument - * - [`removeData()`](http://api.jquery.com/removeData/) - * - [`replaceWith()`](http://api.jquery.com/replaceWith/) - * - [`text()`](http://api.jquery.com/text/) - * - [`toggleClass()`](http://api.jquery.com/toggleClass/) - Does not support a function as first argument - * - [`triggerHandler()`](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers - * - [`unbind()`](http://api.jquery.com/unbind/) (_deprecated_, use [`off()`](http://api.jquery.com/off/)) - Does not support namespaces or event object as parameter - * - [`val()`](http://api.jquery.com/val/) - * - [`wrap()`](http://api.jquery.com/wrap/) - * - * ## jQuery/jqLite Extras - * AngularJS also provides the following additional methods and events to both jQuery and jqLite: - * - * ### Events - * - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event - * on all DOM nodes being removed. This can be used to clean up any 3rd party bindings to the DOM - * element before it is removed. - * - * ### Methods - * - `controller(name)` - retrieves the controller of the current element or its parent. By default - * retrieves controller associated with the `ngController` directive. If `name` is provided as - * camelCase directive name, then the controller for this directive will be retrieved (e.g. - * `'ngModel'`). - * - `injector()` - retrieves the injector of the current element or its parent. - * - `scope()` - retrieves the {@link ng.$rootScope.Scope scope} of the current - * element or its parent. Requires {@link guide/production#disabling-debug-data Debug Data} to - * be enabled. - * - `isolateScope()` - retrieves an isolate {@link ng.$rootScope.Scope scope} if one is attached directly to the - * current element. This getter should be used only on elements that contain a directive which starts a new isolate - * scope. Calling `scope()` on this element always returns the original non-isolate scope. - * Requires {@link guide/production#disabling-debug-data Debug Data} to be enabled. - * - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top - * parent element is reached. - * - * @knownIssue You cannot spy on `angular.element` if you are using Jasmine version 1.x. See - * https://github.com/angular/angular.js/issues/14251 for more information. - * - * @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery. - * @returns {Object} jQuery object. - */ - - JQLite.expando = 'ng339'; - - var jqCache = JQLite.cache = {}, - jqId = 1; - - /* - * !!! This is an undocumented "private" function !!! - */ - JQLite._data = function(node) { - //jQuery always returns an object on cache miss - return this.cache[node[this.expando]] || {}; - }; - - function jqNextId() { return ++jqId; } - - - var DASH_LOWERCASE_REGEXP = /-([a-z])/g; - var MS_HACK_REGEXP = /^-ms-/; - var MOUSE_EVENT_MAP = { mouseleave: 'mouseout', mouseenter: 'mouseover' }; - var jqLiteMinErr = minErr('jqLite'); - - /** - * Converts kebab-case to camelCase. - * There is also a special case for the ms prefix starting with a lowercase letter. - * @param name Name to normalize - */ - function cssKebabToCamel(name) { - return kebabToCamel(name.replace(MS_HACK_REGEXP, 'ms-')); - } - - function fnCamelCaseReplace(all, letter) { - return letter.toUpperCase(); - } - - /** - * Converts kebab-case to camelCase. - * @param name Name to normalize - */ - function kebabToCamel(name) { - return name - .replace(DASH_LOWERCASE_REGEXP, fnCamelCaseReplace); - } - - var SINGLE_TAG_REGEXP = /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/; - var HTML_REGEXP = /<|&#?\w+;/; - var TAG_NAME_REGEXP = /<([\w:-]+)/; - var XHTML_TAG_REGEXP = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi; - - var wrapMap = { - 'option': [1, ''], - - 'thead': [1, '', '
    '], - 'col': [2, '', '
    '], - 'tr': [2, '', '
    '], - 'td': [3, '', '
    '], - '_default': [0, '', ''] - }; - - wrapMap.optgroup = wrapMap.option; - wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; - wrapMap.th = wrapMap.td; - - - function jqLiteIsTextNode(html) { - return !HTML_REGEXP.test(html); - } - - function jqLiteAcceptsData(node) { - // The window object can accept data but has no nodeType - // Otherwise we are only interested in elements (1) and documents (9) - var nodeType = node.nodeType; - return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT; - } - - function jqLiteHasData(node) { - for (var key in jqCache[node.ng339]) { - return true; - } - return false; - } - - function jqLiteBuildFragment(html, context) { - var tmp, tag, wrap, - fragment = context.createDocumentFragment(), - nodes = [], i; - - if (jqLiteIsTextNode(html)) { - // Convert non-html into a text node - nodes.push(context.createTextNode(html)); - } else { - // Convert html into DOM nodes - tmp = fragment.appendChild(context.createElement('div')); - tag = (TAG_NAME_REGEXP.exec(html) || ['', ''])[1].toLowerCase(); - wrap = wrapMap[tag] || wrapMap._default; - tmp.innerHTML = wrap[1] + html.replace(XHTML_TAG_REGEXP, '<$1>') + wrap[2]; - - // Descend through wrappers to the right content - i = wrap[0]; - while (i--) { - tmp = tmp.lastChild; - } - - nodes = concat(nodes, tmp.childNodes); - - tmp = fragment.firstChild; - tmp.textContent = ''; - } - - // Remove wrapper from fragment - fragment.textContent = ''; - fragment.innerHTML = ''; // Clear inner HTML - forEach(nodes, function(node) { - fragment.appendChild(node); - }); - - return fragment; - } - - function jqLiteParseHTML(html, context) { - context = context || window.document; - var parsed; - - if ((parsed = SINGLE_TAG_REGEXP.exec(html))) { - return [context.createElement(parsed[1])]; - } - - if ((parsed = jqLiteBuildFragment(html, context))) { - return parsed.childNodes; - } - - return []; - } - - function jqLiteWrapNode(node, wrapper) { - var parent = node.parentNode; - - if (parent) { - parent.replaceChild(wrapper, node); - } - - wrapper.appendChild(node); - } - - -// IE9-11 has no method "contains" in SVG element and in Node.prototype. Bug #10259. - var jqLiteContains = window.Node.prototype.contains || /** @this */ function(arg) { - // eslint-disable-next-line no-bitwise - return !!(this.compareDocumentPosition(arg) & 16); - }; - -///////////////////////////////////////////// - function JQLite(element) { - if (element instanceof JQLite) { - return element; - } - - var argIsString; - - if (isString(element)) { - element = trim(element); - argIsString = true; - } - if (!(this instanceof JQLite)) { - if (argIsString && element.charAt(0) !== '<') { - throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element'); - } - return new JQLite(element); - } - - if (argIsString) { - jqLiteAddNodes(this, jqLiteParseHTML(element)); - } else if (isFunction(element)) { - jqLiteReady(element); - } else { - jqLiteAddNodes(this, element); - } - } - - function jqLiteClone(element) { - return element.cloneNode(true); - } - - function jqLiteDealoc(element, onlyDescendants) { - if (!onlyDescendants && jqLiteAcceptsData(element)) jqLite.cleanData([element]); - - if (element.querySelectorAll) { - jqLite.cleanData(element.querySelectorAll('*')); - } - } - - function jqLiteOff(element, type, fn, unsupported) { - if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument'); - - var expandoStore = jqLiteExpandoStore(element); - var events = expandoStore && expandoStore.events; - var handle = expandoStore && expandoStore.handle; - - if (!handle) return; //no listeners registered - - if (!type) { - for (type in events) { - if (type !== '$destroy') { - element.removeEventListener(type, handle); - } - delete events[type]; - } - } else { - - var removeHandler = function(type) { - var listenerFns = events[type]; - if (isDefined(fn)) { - arrayRemove(listenerFns || [], fn); - } - if (!(isDefined(fn) && listenerFns && listenerFns.length > 0)) { - element.removeEventListener(type, handle); - delete events[type]; - } - }; - - forEach(type.split(' '), function(type) { - removeHandler(type); - if (MOUSE_EVENT_MAP[type]) { - removeHandler(MOUSE_EVENT_MAP[type]); - } - }); - } - } - - function jqLiteRemoveData(element, name) { - var expandoId = element.ng339; - var expandoStore = expandoId && jqCache[expandoId]; - - if (expandoStore) { - if (name) { - delete expandoStore.data[name]; - return; - } - - if (expandoStore.handle) { - if (expandoStore.events.$destroy) { - expandoStore.handle({}, '$destroy'); - } - jqLiteOff(element); - } - delete jqCache[expandoId]; - element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it - } - } - - - function jqLiteExpandoStore(element, createIfNecessary) { - var expandoId = element.ng339, - expandoStore = expandoId && jqCache[expandoId]; - - if (createIfNecessary && !expandoStore) { - element.ng339 = expandoId = jqNextId(); - expandoStore = jqCache[expandoId] = {events: {}, data: {}, handle: undefined}; - } - - return expandoStore; - } - - - function jqLiteData(element, key, value) { - if (jqLiteAcceptsData(element)) { - var prop; - - var isSimpleSetter = isDefined(value); - var isSimpleGetter = !isSimpleSetter && key && !isObject(key); - var massGetter = !key; - var expandoStore = jqLiteExpandoStore(element, !isSimpleGetter); - var data = expandoStore && expandoStore.data; - - if (isSimpleSetter) { // data('key', value) - data[kebabToCamel(key)] = value; - } else { - if (massGetter) { // data() - return data; - } else { - if (isSimpleGetter) { // data('key') - // don't force creation of expandoStore if it doesn't exist yet - return data && data[kebabToCamel(key)]; - } else { // mass-setter: data({key1: val1, key2: val2}) - for (prop in key) { - data[kebabToCamel(prop)] = key[prop]; - } - } - } - } - } - } - - function jqLiteHasClass(element, selector) { - if (!element.getAttribute) return false; - return ((' ' + (element.getAttribute('class') || '') + ' ').replace(/[\n\t]/g, ' '). - indexOf(' ' + selector + ' ') > -1); - } - - function jqLiteRemoveClass(element, cssClasses) { - if (cssClasses && element.setAttribute) { - var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ') - .replace(/[\n\t]/g, ' '); - var newClasses = existingClasses; - - forEach(cssClasses.split(' '), function(cssClass) { - cssClass = trim(cssClass); - newClasses = newClasses.replace(' ' + cssClass + ' ', ' '); - }); - - if (newClasses !== existingClasses) { - element.setAttribute('class', trim(newClasses)); - } - } - } - - function jqLiteAddClass(element, cssClasses) { - if (cssClasses && element.setAttribute) { - var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ') - .replace(/[\n\t]/g, ' '); - var newClasses = existingClasses; - - forEach(cssClasses.split(' '), function(cssClass) { - cssClass = trim(cssClass); - if (newClasses.indexOf(' ' + cssClass + ' ') === -1) { - newClasses += cssClass + ' '; - } - }); - - if (newClasses !== existingClasses) { - element.setAttribute('class', trim(newClasses)); - } - } - } - - - function jqLiteAddNodes(root, elements) { - // THIS CODE IS VERY HOT. Don't make changes without benchmarking. - - if (elements) { - - // if a Node (the most common case) - if (elements.nodeType) { - root[root.length++] = elements; - } else { - var length = elements.length; - - // if an Array or NodeList and not a Window - if (typeof length === 'number' && elements.window !== elements) { - if (length) { - for (var i = 0; i < length; i++) { - root[root.length++] = elements[i]; - } - } - } else { - root[root.length++] = elements; - } - } - } - } - - - function jqLiteController(element, name) { - return jqLiteInheritedData(element, '$' + (name || 'ngController') + 'Controller'); - } - - function jqLiteInheritedData(element, name, value) { - // if element is the document object work with the html element instead - // this makes $(document).scope() possible - if (element.nodeType === NODE_TYPE_DOCUMENT) { - element = element.documentElement; - } - var names = isArray(name) ? name : [name]; - - while (element) { - for (var i = 0, ii = names.length; i < ii; i++) { - if (isDefined(value = jqLite.data(element, names[i]))) return value; - } - - // If dealing with a document fragment node with a host element, and no parent, use the host - // element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM - // to lookup parent controllers. - element = element.parentNode || (element.nodeType === NODE_TYPE_DOCUMENT_FRAGMENT && element.host); - } - } - - function jqLiteEmpty(element) { - jqLiteDealoc(element, true); - while (element.firstChild) { - element.removeChild(element.firstChild); - } - } - - function jqLiteRemove(element, keepData) { - if (!keepData) jqLiteDealoc(element); - var parent = element.parentNode; - if (parent) parent.removeChild(element); - } - - - function jqLiteDocumentLoaded(action, win) { - win = win || window; - if (win.document.readyState === 'complete') { - // Force the action to be run async for consistent behavior - // from the action's point of view - // i.e. it will definitely not be in a $apply - win.setTimeout(action); - } else { - // No need to unbind this handler as load is only ever called once - jqLite(win).on('load', action); - } - } - - function jqLiteReady(fn) { - function trigger() { - window.document.removeEventListener('DOMContentLoaded', trigger); - window.removeEventListener('load', trigger); - fn(); - } - - // check if document is already loaded - if (window.document.readyState === 'complete') { - window.setTimeout(fn); - } else { - // We can not use jqLite since we are not done loading and jQuery could be loaded later. - - // Works for modern browsers and IE9 - window.document.addEventListener('DOMContentLoaded', trigger); - - // Fallback to window.onload for others - window.addEventListener('load', trigger); - } - } - -////////////////////////////////////////// -// Functions which are declared directly. -////////////////////////////////////////// - var JQLitePrototype = JQLite.prototype = { - ready: jqLiteReady, - toString: function() { - var value = []; - forEach(this, function(e) { value.push('' + e);}); - return '[' + value.join(', ') + ']'; - }, - - eq: function(index) { - return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]); - }, - - length: 0, - push: push, - sort: [].sort, - splice: [].splice - }; - -////////////////////////////////////////// -// Functions iterating getter/setters. -// these functions return self on setter and -// value on get. -////////////////////////////////////////// - var BOOLEAN_ATTR = {}; - forEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','), function(value) { - BOOLEAN_ATTR[lowercase(value)] = value; - }); - var BOOLEAN_ELEMENTS = {}; - forEach('input,select,option,textarea,button,form,details'.split(','), function(value) { - BOOLEAN_ELEMENTS[value] = true; - }); - var ALIASED_ATTR = { - 'ngMinlength': 'minlength', - 'ngMaxlength': 'maxlength', - 'ngMin': 'min', - 'ngMax': 'max', - 'ngPattern': 'pattern', - 'ngStep': 'step' - }; - - function getBooleanAttrName(element, name) { - // check dom last since we will most likely fail on name - var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()]; - - // booleanAttr is here twice to minimize DOM access - return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr; - } - - function getAliasedAttrName(name) { - return ALIASED_ATTR[name]; - } - - forEach({ - data: jqLiteData, - removeData: jqLiteRemoveData, - hasData: jqLiteHasData, - cleanData: function jqLiteCleanData(nodes) { - for (var i = 0, ii = nodes.length; i < ii; i++) { - jqLiteRemoveData(nodes[i]); - } - } - }, function(fn, name) { - JQLite[name] = fn; - }); - - forEach({ - data: jqLiteData, - inheritedData: jqLiteInheritedData, - - scope: function(element) { - // Can't use jqLiteData here directly so we stay compatible with jQuery! - return jqLite.data(element, '$scope') || jqLiteInheritedData(element.parentNode || element, ['$isolateScope', '$scope']); - }, - - isolateScope: function(element) { - // Can't use jqLiteData here directly so we stay compatible with jQuery! - return jqLite.data(element, '$isolateScope') || jqLite.data(element, '$isolateScopeNoTemplate'); - }, - - controller: jqLiteController, - - injector: function(element) { - return jqLiteInheritedData(element, '$injector'); - }, - - removeAttr: function(element, name) { - element.removeAttribute(name); - }, - - hasClass: jqLiteHasClass, - - css: function(element, name, value) { - name = cssKebabToCamel(name); - - if (isDefined(value)) { - element.style[name] = value; - } else { - return element.style[name]; - } - }, - - attr: function(element, name, value) { - var ret; - var nodeType = element.nodeType; - if (nodeType === NODE_TYPE_TEXT || nodeType === NODE_TYPE_ATTRIBUTE || nodeType === NODE_TYPE_COMMENT || - !element.getAttribute) { - return; - } - - var lowercasedName = lowercase(name); - var isBooleanAttr = BOOLEAN_ATTR[lowercasedName]; - - if (isDefined(value)) { - // setter - - if (value === null || (value === false && isBooleanAttr)) { - element.removeAttribute(name); - } else { - element.setAttribute(name, isBooleanAttr ? lowercasedName : value); - } - } else { - // getter - - ret = element.getAttribute(name); - - if (isBooleanAttr && ret !== null) { - ret = lowercasedName; - } - // Normalize non-existing attributes to undefined (as jQuery). - return ret === null ? undefined : ret; - } - }, - - prop: function(element, name, value) { - if (isDefined(value)) { - element[name] = value; - } else { - return element[name]; - } - }, - - text: (function() { - getText.$dv = ''; - return getText; - - function getText(element, value) { - if (isUndefined(value)) { - var nodeType = element.nodeType; - return (nodeType === NODE_TYPE_ELEMENT || nodeType === NODE_TYPE_TEXT) ? element.textContent : ''; - } - element.textContent = value; - } - })(), - - val: function(element, value) { - if (isUndefined(value)) { - if (element.multiple && nodeName_(element) === 'select') { - var result = []; - forEach(element.options, function(option) { - if (option.selected) { - result.push(option.value || option.text); - } - }); - return result; - } - return element.value; - } - element.value = value; - }, - - html: function(element, value) { - if (isUndefined(value)) { - return element.innerHTML; - } - jqLiteDealoc(element, true); - element.innerHTML = value; - }, - - empty: jqLiteEmpty - }, function(fn, name) { - /** - * Properties: writes return selection, reads return first value - */ - JQLite.prototype[name] = function(arg1, arg2) { - var i, key; - var nodeCount = this.length; - - // jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it - // in a way that survives minification. - // jqLiteEmpty takes no arguments but is a setter. - if (fn !== jqLiteEmpty && - (isUndefined((fn.length === 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2))) { - if (isObject(arg1)) { - - // we are a write, but the object properties are the key/values - for (i = 0; i < nodeCount; i++) { - if (fn === jqLiteData) { - // data() takes the whole object in jQuery - fn(this[i], arg1); - } else { - for (key in arg1) { - fn(this[i], key, arg1[key]); - } - } - } - // return self for chaining - return this; - } else { - // we are a read, so read the first child. - // TODO: do we still need this? - var value = fn.$dv; - // Only if we have $dv do we iterate over all, otherwise it is just the first element. - var jj = (isUndefined(value)) ? Math.min(nodeCount, 1) : nodeCount; - for (var j = 0; j < jj; j++) { - var nodeValue = fn(this[j], arg1, arg2); - value = value ? value + nodeValue : nodeValue; - } - return value; - } - } else { - // we are a write, so apply to all children - for (i = 0; i < nodeCount; i++) { - fn(this[i], arg1, arg2); - } - // return self for chaining - return this; - } - }; - }); - - function createEventHandler(element, events) { - var eventHandler = function(event, type) { - // jQuery specific api - event.isDefaultPrevented = function() { - return event.defaultPrevented; - }; - - var eventFns = events[type || event.type]; - var eventFnsLength = eventFns ? eventFns.length : 0; - - if (!eventFnsLength) return; - - if (isUndefined(event.immediatePropagationStopped)) { - var originalStopImmediatePropagation = event.stopImmediatePropagation; - event.stopImmediatePropagation = function() { - event.immediatePropagationStopped = true; - - if (event.stopPropagation) { - event.stopPropagation(); - } - - if (originalStopImmediatePropagation) { - originalStopImmediatePropagation.call(event); - } - }; - } - - event.isImmediatePropagationStopped = function() { - return event.immediatePropagationStopped === true; - }; - - // Some events have special handlers that wrap the real handler - var handlerWrapper = eventFns.specialHandlerWrapper || defaultHandlerWrapper; - - // Copy event handlers in case event handlers array is modified during execution. - if ((eventFnsLength > 1)) { - eventFns = shallowCopy(eventFns); - } - - for (var i = 0; i < eventFnsLength; i++) { - if (!event.isImmediatePropagationStopped()) { - handlerWrapper(element, event, eventFns[i]); - } - } - }; - - // TODO: this is a hack for angularMocks/clearDataCache that makes it possible to deregister all - // events on `element` - eventHandler.elem = element; - return eventHandler; - } - - function defaultHandlerWrapper(element, event, handler) { - handler.call(element, event); - } - - function specialMouseHandlerWrapper(target, event, handler) { - // Refer to jQuery's implementation of mouseenter & mouseleave - // Read about mouseenter and mouseleave: - // http://www.quirksmode.org/js/events_mouse.html#link8 - var related = event.relatedTarget; - // For mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if (!related || (related !== target && !jqLiteContains.call(target, related))) { - handler.call(target, event); - } - } - -////////////////////////////////////////// -// Functions iterating traversal. -// These functions chain results into a single -// selector. -////////////////////////////////////////// - forEach({ - removeData: jqLiteRemoveData, - - on: function jqLiteOn(element, type, fn, unsupported) { - if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters'); - - // Do not add event handlers to non-elements because they will not be cleaned up. - if (!jqLiteAcceptsData(element)) { - return; - } - - var expandoStore = jqLiteExpandoStore(element, true); - var events = expandoStore.events; - var handle = expandoStore.handle; - - if (!handle) { - handle = expandoStore.handle = createEventHandler(element, events); - } - - // http://jsperf.com/string-indexof-vs-split - var types = type.indexOf(' ') >= 0 ? type.split(' ') : [type]; - var i = types.length; - - var addHandler = function(type, specialHandlerWrapper, noEventListener) { - var eventFns = events[type]; - - if (!eventFns) { - eventFns = events[type] = []; - eventFns.specialHandlerWrapper = specialHandlerWrapper; - if (type !== '$destroy' && !noEventListener) { - element.addEventListener(type, handle); - } - } - - eventFns.push(fn); - }; - - while (i--) { - type = types[i]; - if (MOUSE_EVENT_MAP[type]) { - addHandler(MOUSE_EVENT_MAP[type], specialMouseHandlerWrapper); - addHandler(type, undefined, true); - } else { - addHandler(type); - } - } - }, - - off: jqLiteOff, - - one: function(element, type, fn) { - element = jqLite(element); - - //add the listener twice so that when it is called - //you can remove the original function and still be - //able to call element.off(ev, fn) normally - element.on(type, function onFn() { - element.off(type, fn); - element.off(type, onFn); - }); - element.on(type, fn); - }, - - replaceWith: function(element, replaceNode) { - var index, parent = element.parentNode; - jqLiteDealoc(element); - forEach(new JQLite(replaceNode), function(node) { - if (index) { - parent.insertBefore(node, index.nextSibling); - } else { - parent.replaceChild(node, element); - } - index = node; - }); - }, - - children: function(element) { - var children = []; - forEach(element.childNodes, function(element) { - if (element.nodeType === NODE_TYPE_ELEMENT) { - children.push(element); - } - }); - return children; - }, - - contents: function(element) { - return element.contentDocument || element.childNodes || []; - }, - - append: function(element, node) { - var nodeType = element.nodeType; - if (nodeType !== NODE_TYPE_ELEMENT && nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT) return; - - node = new JQLite(node); - - for (var i = 0, ii = node.length; i < ii; i++) { - var child = node[i]; - element.appendChild(child); - } - }, - - prepend: function(element, node) { - if (element.nodeType === NODE_TYPE_ELEMENT) { - var index = element.firstChild; - forEach(new JQLite(node), function(child) { - element.insertBefore(child, index); - }); - } - }, - - wrap: function(element, wrapNode) { - jqLiteWrapNode(element, jqLite(wrapNode).eq(0).clone()[0]); - }, - - remove: jqLiteRemove, - - detach: function(element) { - jqLiteRemove(element, true); - }, - - after: function(element, newElement) { - var index = element, parent = element.parentNode; - - if (parent) { - newElement = new JQLite(newElement); - - for (var i = 0, ii = newElement.length; i < ii; i++) { - var node = newElement[i]; - parent.insertBefore(node, index.nextSibling); - index = node; - } - } - }, - - addClass: jqLiteAddClass, - removeClass: jqLiteRemoveClass, - - toggleClass: function(element, selector, condition) { - if (selector) { - forEach(selector.split(' '), function(className) { - var classCondition = condition; - if (isUndefined(classCondition)) { - classCondition = !jqLiteHasClass(element, className); - } - (classCondition ? jqLiteAddClass : jqLiteRemoveClass)(element, className); - }); - } - }, - - parent: function(element) { - var parent = element.parentNode; - return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT ? parent : null; - }, - - next: function(element) { - return element.nextElementSibling; - }, - - find: function(element, selector) { - if (element.getElementsByTagName) { - return element.getElementsByTagName(selector); - } else { - return []; - } - }, - - clone: jqLiteClone, - - triggerHandler: function(element, event, extraParameters) { - - var dummyEvent, eventFnsCopy, handlerArgs; - var eventName = event.type || event; - var expandoStore = jqLiteExpandoStore(element); - var events = expandoStore && expandoStore.events; - var eventFns = events && events[eventName]; - - if (eventFns) { - // Create a dummy event to pass to the handlers - dummyEvent = { - preventDefault: function() { this.defaultPrevented = true; }, - isDefaultPrevented: function() { return this.defaultPrevented === true; }, - stopImmediatePropagation: function() { this.immediatePropagationStopped = true; }, - isImmediatePropagationStopped: function() { return this.immediatePropagationStopped === true; }, - stopPropagation: noop, - type: eventName, - target: element - }; - - // If a custom event was provided then extend our dummy event with it - if (event.type) { - dummyEvent = extend(dummyEvent, event); - } - - // Copy event handlers in case event handlers array is modified during execution. - eventFnsCopy = shallowCopy(eventFns); - handlerArgs = extraParameters ? [dummyEvent].concat(extraParameters) : [dummyEvent]; - - forEach(eventFnsCopy, function(fn) { - if (!dummyEvent.isImmediatePropagationStopped()) { - fn.apply(element, handlerArgs); - } - }); - } - } - }, function(fn, name) { - /** - * chaining functions - */ - JQLite.prototype[name] = function(arg1, arg2, arg3) { - var value; - - for (var i = 0, ii = this.length; i < ii; i++) { - if (isUndefined(value)) { - value = fn(this[i], arg1, arg2, arg3); - if (isDefined(value)) { - // any function which returns a value needs to be wrapped - value = jqLite(value); - } - } else { - jqLiteAddNodes(value, fn(this[i], arg1, arg2, arg3)); - } - } - return isDefined(value) ? value : this; - }; - }); - -// bind legacy bind/unbind to on/off - JQLite.prototype.bind = JQLite.prototype.on; - JQLite.prototype.unbind = JQLite.prototype.off; - - -// Provider for private $$jqLite service - /** @this */ - function $$jqLiteProvider() { - this.$get = function $$jqLite() { - return extend(JQLite, { - hasClass: function(node, classes) { - if (node.attr) node = node[0]; - return jqLiteHasClass(node, classes); - }, - addClass: function(node, classes) { - if (node.attr) node = node[0]; - return jqLiteAddClass(node, classes); - }, - removeClass: function(node, classes) { - if (node.attr) node = node[0]; - return jqLiteRemoveClass(node, classes); - } - }); - }; - } - - /** - * Computes a hash of an 'obj'. - * Hash of a: - * string is string - * number is number as string - * object is either result of calling $$hashKey function on the object or uniquely generated id, - * that is also assigned to the $$hashKey property of the object. - * - * @param obj - * @returns {string} hash string such that the same input will have the same hash string. - * The resulting string key is in 'type:hashKey' format. - */ - function hashKey(obj, nextUidFn) { - var key = obj && obj.$$hashKey; - - if (key) { - if (typeof key === 'function') { - key = obj.$$hashKey(); - } - return key; - } - - var objType = typeof obj; - if (objType === 'function' || (objType === 'object' && obj !== null)) { - key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)(); - } else { - key = objType + ':' + obj; - } - - return key; - } - -// A minimal ES2015 Map implementation. -// Should be bug/feature equivalent to the native implementations of supported browsers -// (for the features required in Angular). -// See https://kangax.github.io/compat-table/es6/#test-Map - var nanKey = Object.create(null); - function NgMapShim() { - this._keys = []; - this._values = []; - this._lastKey = NaN; - this._lastIndex = -1; - } - NgMapShim.prototype = { - _idx: function(key) { - if (key === this._lastKey) { - return this._lastIndex; - } - this._lastKey = key; - this._lastIndex = this._keys.indexOf(key); - return this._lastIndex; - }, - _transformKey: function(key) { - return isNumberNaN(key) ? nanKey : key; - }, - get: function(key) { - key = this._transformKey(key); - var idx = this._idx(key); - if (idx !== -1) { - return this._values[idx]; - } - }, - set: function(key, value) { - key = this._transformKey(key); - var idx = this._idx(key); - if (idx === -1) { - idx = this._lastIndex = this._keys.length; - } - this._keys[idx] = key; - this._values[idx] = value; - - // Support: IE11 - // Do not `return this` to simulate the partial IE11 implementation - }, - delete: function(key) { - key = this._transformKey(key); - var idx = this._idx(key); - if (idx === -1) { - return false; - } - this._keys.splice(idx, 1); - this._values.splice(idx, 1); - this._lastKey = NaN; - this._lastIndex = -1; - return true; - } - }; - -// For now, always use `NgMapShim`, even if `window.Map` is available. Some native implementations -// are still buggy (often in subtle ways) and can cause hard-to-debug failures. When native `Map` -// implementations get more stable, we can reconsider switching to `window.Map` (when available). - var NgMap = NgMapShim; - - var $$MapProvider = [/** @this */function() { - this.$get = [function() { - return NgMap; - }]; - }]; - - /** - * @ngdoc function - * @module ng - * @name angular.injector - * @kind function - * - * @description - * Creates an injector object that can be used for retrieving services as well as for - * dependency injection (see {@link guide/di dependency injection}). - * - * @param {Array.} modules A list of module functions or their aliases. See - * {@link angular.module}. The `ng` module must be explicitly added. - * @param {boolean=} [strictDi=false] Whether the injector should be in strict mode, which - * disallows argument name annotation inference. - * @returns {injector} Injector object. See {@link auto.$injector $injector}. - * - * @example - * Typical usage - * ```js - * // create an injector - * var $injector = angular.injector(['ng']); - * - * // use the injector to kick off your application - * // use the type inference to auto inject arguments, or use implicit injection - * $injector.invoke(function($rootScope, $compile, $document) { - * $compile($document)($rootScope); - * $rootScope.$digest(); - * }); - * ``` - * - * Sometimes you want to get access to the injector of a currently running AngularJS app - * from outside AngularJS. Perhaps, you want to inject and compile some markup after the - * application has been bootstrapped. You can do this using the extra `injector()` added - * to JQuery/jqLite elements. See {@link angular.element}. - * - * *This is fairly rare but could be the case if a third party library is injecting the - * markup.* - * - * In the following example a new block of HTML containing a `ng-controller` - * directive is added to the end of the document body by JQuery. We then compile and link - * it into the current AngularJS scope. - * - * ```js - * var $div = $('
    {{content.label}}
    '); - * $(document.body).append($div); - * - * angular.element(document).injector().invoke(function($compile) { - * var scope = angular.element($div).scope(); - * $compile($div)(scope); - * }); - * ``` - */ - - - /** - * @ngdoc module - * @name auto - * @installation - * @description - * - * Implicit module which gets automatically added to each {@link auto.$injector $injector}. - */ - - var ARROW_ARG = /^([^(]+?)=>/; - var FN_ARGS = /^[^(]*\(\s*([^)]*)\)/m; - var FN_ARG_SPLIT = /,/; - var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/; - var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; - var $injectorMinErr = minErr('$injector'); - - function stringifyFn(fn) { - return Function.prototype.toString.call(fn); - } - - function extractArgs(fn) { - var fnText = stringifyFn(fn).replace(STRIP_COMMENTS, ''), - args = fnText.match(ARROW_ARG) || fnText.match(FN_ARGS); - return args; - } - - function anonFn(fn) { - // For anonymous functions, showing at the very least the function signature can help in - // debugging. - var args = extractArgs(fn); - if (args) { - return 'function(' + (args[1] || '').replace(/[\s\r\n]+/, ' ') + ')'; - } - return 'fn'; - } - - function annotate(fn, strictDi, name) { - var $inject, - argDecl, - last; - - if (typeof fn === 'function') { - if (!($inject = fn.$inject)) { - $inject = []; - if (fn.length) { - if (strictDi) { - if (!isString(name) || !name) { - name = fn.name || anonFn(fn); - } - throw $injectorMinErr('strictdi', - '{0} is not using explicit annotation and cannot be invoked in strict mode', name); - } - argDecl = extractArgs(fn); - forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) { - arg.replace(FN_ARG, function(all, underscore, name) { - $inject.push(name); - }); - }); - } - fn.$inject = $inject; - } - } else if (isArray(fn)) { - last = fn.length - 1; - assertArgFn(fn[last], 'fn'); - $inject = fn.slice(0, last); - } else { - assertArgFn(fn, 'fn', true); - } - return $inject; - } - -/////////////////////////////////////// - - /** - * @ngdoc service - * @name $injector - * - * @description - * - * `$injector` is used to retrieve object instances as defined by - * {@link auto.$provide provider}, instantiate types, invoke methods, - * and load modules. - * - * The following always holds true: - * - * ```js - * var $injector = angular.injector(); - * expect($injector.get('$injector')).toBe($injector); - * expect($injector.invoke(function($injector) { - * return $injector; - * })).toBe($injector); - * ``` - * - * ## Injection Function Annotation - * - * JavaScript does not have annotations, and annotations are needed for dependency injection. The - * following are all valid ways of annotating function with injection arguments and are equivalent. - * - * ```js - * // inferred (only works if code not minified/obfuscated) - * $injector.invoke(function(serviceA){}); - * - * // annotated - * function explicit(serviceA) {}; - * explicit.$inject = ['serviceA']; - * $injector.invoke(explicit); - * - * // inline - * $injector.invoke(['serviceA', function(serviceA){}]); - * ``` - * - * ### Inference - * - * In JavaScript calling `toString()` on a function returns the function definition. The definition - * can then be parsed and the function arguments can be extracted. This method of discovering - * annotations is disallowed when the injector is in strict mode. - * *NOTE:* This does not work with minification, and obfuscation tools since these tools change the - * argument names. - * - * ### `$inject` Annotation - * By adding an `$inject` property onto a function the injection parameters can be specified. - * - * ### Inline - * As an array of injection names, where the last item in the array is the function to call. - */ - - /** - * @ngdoc property - * @name $injector#modules - * @type {Object} - * @description - * A hash containing all the modules that have been loaded into the - * $injector. - * - * You can use this property to find out information about a module via the - * {@link angular.Module#info `myModule.info(...)`} method. - * - * For example: - * - * ``` - * var info = $injector.modules['ngAnimate'].info(); - * ``` - * - * **Do not use this property to attempt to modify the modules after the application - * has been bootstrapped.** - */ - - - /** - * @ngdoc method - * @name $injector#get - * - * @description - * Return an instance of the service. - * - * @param {string} name The name of the instance to retrieve. - * @param {string=} caller An optional string to provide the origin of the function call for error messages. - * @return {*} The instance. - */ - - /** - * @ngdoc method - * @name $injector#invoke - * - * @description - * Invoke the method and supply the method arguments from the `$injector`. - * - * @param {Function|Array.} fn The injectable function to invoke. Function parameters are - * injected according to the {@link guide/di $inject Annotation} rules. - * @param {Object=} self The `this` for the invoked method. - * @param {Object=} locals Optional object. If preset then any argument names are read from this - * object first, before the `$injector` is consulted. - * @returns {*} the value returned by the invoked `fn` function. - */ - - /** - * @ngdoc method - * @name $injector#has - * - * @description - * Allows the user to query if the particular service exists. - * - * @param {string} name Name of the service to query. - * @returns {boolean} `true` if injector has given service. - */ - - /** - * @ngdoc method - * @name $injector#instantiate - * @description - * Create a new instance of JS type. The method takes a constructor function, invokes the new - * operator, and supplies all of the arguments to the constructor function as specified by the - * constructor annotation. - * - * @param {Function} Type Annotated constructor function. - * @param {Object=} locals Optional object. If preset then any argument names are read from this - * object first, before the `$injector` is consulted. - * @returns {Object} new instance of `Type`. - */ - - /** - * @ngdoc method - * @name $injector#annotate - * - * @description - * Returns an array of service names which the function is requesting for injection. This API is - * used by the injector to determine which services need to be injected into the function when the - * function is invoked. There are three ways in which the function can be annotated with the needed - * dependencies. - * - * #### Argument names - * - * The simplest form is to extract the dependencies from the arguments of the function. This is done - * by converting the function into a string using `toString()` method and extracting the argument - * names. - * ```js - * // Given - * function MyController($scope, $route) { - * // ... - * } - * - * // Then - * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']); - * ``` - * - * You can disallow this method by using strict injection mode. - * - * This method does not work with code minification / obfuscation. For this reason the following - * annotation strategies are supported. - * - * #### The `$inject` property - * - * If a function has an `$inject` property and its value is an array of strings, then the strings - * represent names of services to be injected into the function. - * ```js - * // Given - * var MyController = function(obfuscatedScope, obfuscatedRoute) { - * // ... - * } - * // Define function dependencies - * MyController['$inject'] = ['$scope', '$route']; - * - * // Then - * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']); - * ``` - * - * #### The array notation - * - * It is often desirable to inline Injected functions and that's when setting the `$inject` property - * is very inconvenient. In these situations using the array notation to specify the dependencies in - * a way that survives minification is a better choice: - * - * ```js - * // We wish to write this (not minification / obfuscation safe) - * injector.invoke(function($compile, $rootScope) { - * // ... - * }); - * - * // We are forced to write break inlining - * var tmpFn = function(obfuscatedCompile, obfuscatedRootScope) { - * // ... - * }; - * tmpFn.$inject = ['$compile', '$rootScope']; - * injector.invoke(tmpFn); - * - * // To better support inline function the inline annotation is supported - * injector.invoke(['$compile', '$rootScope', function(obfCompile, obfRootScope) { - * // ... - * }]); - * - * // Therefore - * expect(injector.annotate( - * ['$compile', '$rootScope', function(obfus_$compile, obfus_$rootScope) {}]) - * ).toEqual(['$compile', '$rootScope']); - * ``` - * - * @param {Function|Array.} fn Function for which dependent service names need to - * be retrieved as described above. - * - * @param {boolean=} [strictDi=false] Disallow argument name annotation inference. - * - * @returns {Array.} The names of the services which the function requires. - */ - /** - * @ngdoc method - * @name $injector#loadNewModules - * - * @description - * - * **This is a dangerous API, which you use at your own risk!** - * - * Add the specified modules to the current injector. - * - * This method will add each of the injectables to the injector and execute all of the config and run - * blocks for each module passed to the method. - * - * If a module has already been loaded into the injector then it will not be loaded again. - * - * * The application developer is responsible for loading the code containing the modules; and for - * ensuring that lazy scripts are not downloaded and executed more often that desired. - * * Previously compiled HTML will not be affected by newly loaded directives, filters and components. - * * Modules cannot be unloaded. - * - * You can use {@link $injector#modules `$injector.modules`} to check whether a module has been loaded - * into the injector, which may indicate whether the script has been executed already. - * - * @example - * Here is an example of loading a bundle of modules, with a utility method called `getScript`: - * - * ```javascript - * app.factory('loadModule', function($injector) { - * return function loadModule(moduleName, bundleUrl) { - * return getScript(bundleUrl).then(function() { $injector.loadNewModules([moduleName]); }); - * }; - * }) - * ``` - * - * @param {Array=} mods an array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a `config` block. - * See: {@link angular.module modules} - */ - - - /** - * @ngdoc service - * @name $provide - * - * @description - * - * The {@link auto.$provide $provide} service has a number of methods for registering components - * with the {@link auto.$injector $injector}. Many of these functions are also exposed on - * {@link angular.Module}. - * - * An AngularJS **service** is a singleton object created by a **service factory**. These **service - * factories** are functions which, in turn, are created by a **service provider**. - * The **service providers** are constructor functions. When instantiated they must contain a - * property called `$get`, which holds the **service factory** function. - * - * When you request a service, the {@link auto.$injector $injector} is responsible for finding the - * correct **service provider**, instantiating it and then calling its `$get` **service factory** - * function to get the instance of the **service**. - * - * Often services have no configuration options and there is no need to add methods to the service - * provider. The provider will be no more than a constructor function with a `$get` property. For - * these cases the {@link auto.$provide $provide} service has additional helper methods to register - * services without specifying a provider. - * - * * {@link auto.$provide#provider provider(name, provider)} - registers a **service provider** with the - * {@link auto.$injector $injector} - * * {@link auto.$provide#constant constant(name, obj)} - registers a value/object that can be accessed by - * providers and services. - * * {@link auto.$provide#value value(name, obj)} - registers a value/object that can only be accessed by - * services, not providers. - * * {@link auto.$provide#factory factory(name, fn)} - registers a service **factory function** - * that will be wrapped in a **service provider** object, whose `$get` property will contain the - * given factory function. - * * {@link auto.$provide#service service(name, Fn)} - registers a **constructor function** - * that will be wrapped in a **service provider** object, whose `$get` property will instantiate - * a new object using the given constructor function. - * * {@link auto.$provide#decorator decorator(name, decorFn)} - registers a **decorator function** that - * will be able to modify or replace the implementation of another service. - * - * See the individual methods for more information and examples. - */ - - /** - * @ngdoc method - * @name $provide#provider - * @description - * - * Register a **provider function** with the {@link auto.$injector $injector}. Provider functions - * are constructor functions, whose instances are responsible for "providing" a factory for a - * service. - * - * Service provider names start with the name of the service they provide followed by `Provider`. - * For example, the {@link ng.$log $log} service has a provider called - * {@link ng.$logProvider $logProvider}. - * - * Service provider objects can have additional methods which allow configuration of the provider - * and its service. Importantly, you can configure what kind of service is created by the `$get` - * method, or how that service will act. For example, the {@link ng.$logProvider $logProvider} has a - * method {@link ng.$logProvider#debugEnabled debugEnabled} - * which lets you specify whether the {@link ng.$log $log} service will log debug messages to the - * console or not. - * - * It is possible to inject other providers into the provider function, - * but the injected provider must have been defined before the one that requires it. - * - * @param {string} name The name of the instance. NOTE: the provider will be available under `name + - 'Provider'` key. - * @param {(Object|function())} provider If the provider is: - * - * - `Object`: then it should have a `$get` method. The `$get` method will be invoked using - * {@link auto.$injector#invoke $injector.invoke()} when an instance needs to be created. - * - `Constructor`: a new instance of the provider will be created using - * {@link auto.$injector#instantiate $injector.instantiate()}, then treated as `object`. - * - * @returns {Object} registered provider instance - - * @example - * - * The following example shows how to create a simple event tracking service and register it using - * {@link auto.$provide#provider $provide.provider()}. - * - * ```js - * // Define the eventTracker provider - * function EventTrackerProvider() { - * var trackingUrl = '/track'; - * - * // A provider method for configuring where the tracked events should been saved - * this.setTrackingUrl = function(url) { - * trackingUrl = url; - * }; - * - * // The service factory function - * this.$get = ['$http', function($http) { - * var trackedEvents = {}; - * return { - * // Call this to track an event - * event: function(event) { - * var count = trackedEvents[event] || 0; - * count += 1; - * trackedEvents[event] = count; - * return count; - * }, - * // Call this to save the tracked events to the trackingUrl - * save: function() { - * $http.post(trackingUrl, trackedEvents); - * } - * }; - * }]; - * } - * - * describe('eventTracker', function() { - * var postSpy; - * - * beforeEach(module(function($provide) { - * // Register the eventTracker provider - * $provide.provider('eventTracker', EventTrackerProvider); - * })); - * - * beforeEach(module(function(eventTrackerProvider) { - * // Configure eventTracker provider - * eventTrackerProvider.setTrackingUrl('/custom-track'); - * })); - * - * it('tracks events', inject(function(eventTracker) { - * expect(eventTracker.event('login')).toEqual(1); - * expect(eventTracker.event('login')).toEqual(2); - * })); - * - * it('saves to the tracking url', inject(function(eventTracker, $http) { - * postSpy = spyOn($http, 'post'); - * eventTracker.event('login'); - * eventTracker.save(); - * expect(postSpy).toHaveBeenCalled(); - * expect(postSpy.mostRecentCall.args[0]).not.toEqual('/track'); - * expect(postSpy.mostRecentCall.args[0]).toEqual('/custom-track'); - * expect(postSpy.mostRecentCall.args[1]).toEqual({ 'login': 1 }); - * })); - * }); - * ``` - */ - - /** - * @ngdoc method - * @name $provide#factory - * @description - * - * Register a **service factory**, which will be called to return the service instance. - * This is short for registering a service where its provider consists of only a `$get` property, - * which is the given service factory function. - * You should use {@link auto.$provide#factory $provide.factory(getFn)} if you do not need to - * configure your service in a provider. - * - * @param {string} name The name of the instance. - * @param {Function|Array.} $getFn The injectable $getFn for the instance creation. - * Internally this is a short hand for `$provide.provider(name, {$get: $getFn})`. - * @returns {Object} registered provider instance - * - * @example - * Here is an example of registering a service - * ```js - * $provide.factory('ping', ['$http', function($http) { - * return function ping() { - * return $http.send('/ping'); - * }; - * }]); - * ``` - * You would then inject and use this service like this: - * ```js - * someModule.controller('Ctrl', ['ping', function(ping) { - * ping(); - * }]); - * ``` - */ - - - /** - * @ngdoc method - * @name $provide#service - * @description - * - * Register a **service constructor**, which will be invoked with `new` to create the service - * instance. - * This is short for registering a service where its provider's `$get` property is a factory - * function that returns an instance instantiated by the injector from the service constructor - * function. - * - * Internally it looks a bit like this: - * - * ``` - * { - * $get: function() { - * return $injector.instantiate(constructor); - * } - * } - * ``` - * - * - * You should use {@link auto.$provide#service $provide.service(class)} if you define your service - * as a type/class. - * - * @param {string} name The name of the instance. - * @param {Function|Array.} constructor An injectable class (constructor function) - * that will be instantiated. - * @returns {Object} registered provider instance - * - * @example - * Here is an example of registering a service using - * {@link auto.$provide#service $provide.service(class)}. - * ```js - * var Ping = function($http) { - * this.$http = $http; - * }; - * - * Ping.$inject = ['$http']; - * - * Ping.prototype.send = function() { - * return this.$http.get('/ping'); - * }; - * $provide.service('ping', Ping); - * ``` - * You would then inject and use this service like this: - * ```js - * someModule.controller('Ctrl', ['ping', function(ping) { - * ping.send(); - * }]); - * ``` - */ - - - /** - * @ngdoc method - * @name $provide#value - * @description - * - * Register a **value service** with the {@link auto.$injector $injector}, such as a string, a - * number, an array, an object or a function. This is short for registering a service where its - * provider's `$get` property is a factory function that takes no arguments and returns the **value - * service**. That also means it is not possible to inject other services into a value service. - * - * Value services are similar to constant services, except that they cannot be injected into a - * module configuration function (see {@link angular.Module#config}) but they can be overridden by - * an AngularJS {@link auto.$provide#decorator decorator}. - * - * @param {string} name The name of the instance. - * @param {*} value The value. - * @returns {Object} registered provider instance - * - * @example - * Here are some examples of creating value services. - * ```js - * $provide.value('ADMIN_USER', 'admin'); - * - * $provide.value('RoleLookup', { admin: 0, writer: 1, reader: 2 }); - * - * $provide.value('halfOf', function(value) { - * return value / 2; - * }); - * ``` - */ - - - /** - * @ngdoc method - * @name $provide#constant - * @description - * - * Register a **constant service** with the {@link auto.$injector $injector}, such as a string, - * a number, an array, an object or a function. Like the {@link auto.$provide#value value}, it is not - * possible to inject other services into a constant. - * - * But unlike {@link auto.$provide#value value}, a constant can be - * injected into a module configuration function (see {@link angular.Module#config}) and it cannot - * be overridden by an AngularJS {@link auto.$provide#decorator decorator}. - * - * @param {string} name The name of the constant. - * @param {*} value The constant value. - * @returns {Object} registered instance - * - * @example - * Here a some examples of creating constants: - * ```js - * $provide.constant('SHARD_HEIGHT', 306); - * - * $provide.constant('MY_COLOURS', ['red', 'blue', 'grey']); - * - * $provide.constant('double', function(value) { - * return value * 2; - * }); - * ``` - */ - - - /** - * @ngdoc method - * @name $provide#decorator - * @description - * - * Register a **decorator function** with the {@link auto.$injector $injector}. A decorator function - * intercepts the creation of a service, allowing it to override or modify the behavior of the - * service. The return value of the decorator function may be the original service, or a new service - * that replaces (or wraps and delegates to) the original service. - * - * You can find out more about using decorators in the {@link guide/decorators} guide. - * - * @param {string} name The name of the service to decorate. - * @param {Function|Array.} decorator This function will be invoked when the service needs to be - * provided and should return the decorated service instance. The function is called using - * the {@link auto.$injector#invoke injector.invoke} method and is therefore fully injectable. - * Local injection arguments: - * - * * `$delegate` - The original service instance, which can be replaced, monkey patched, configured, - * decorated or delegated to. - * - * @example - * Here we decorate the {@link ng.$log $log} service to convert warnings to errors by intercepting - * calls to {@link ng.$log#error $log.warn()}. - * ```js - * $provide.decorator('$log', ['$delegate', function($delegate) { - * $delegate.warn = $delegate.error; - * return $delegate; - * }]); - * ``` - */ - - - function createInjector(modulesToLoad, strictDi) { - strictDi = (strictDi === true); - var INSTANTIATING = {}, - providerSuffix = 'Provider', - path = [], - loadedModules = new NgMap(), - providerCache = { - $provide: { - provider: supportObject(provider), - factory: supportObject(factory), - service: supportObject(service), - value: supportObject(value), - constant: supportObject(constant), - decorator: decorator - } - }, - providerInjector = (providerCache.$injector = - createInternalInjector(providerCache, function(serviceName, caller) { - if (angular.isString(caller)) { - path.push(caller); - } - throw $injectorMinErr('unpr', 'Unknown provider: {0}', path.join(' <- ')); - })), - instanceCache = {}, - protoInstanceInjector = - createInternalInjector(instanceCache, function(serviceName, caller) { - var provider = providerInjector.get(serviceName + providerSuffix, caller); - return instanceInjector.invoke( - provider.$get, provider, undefined, serviceName); - }), - instanceInjector = protoInstanceInjector; - - providerCache['$injector' + providerSuffix] = { $get: valueFn(protoInstanceInjector) }; - instanceInjector.modules = providerInjector.modules = createMap(); - var runBlocks = loadModules(modulesToLoad); - instanceInjector = protoInstanceInjector.get('$injector'); - instanceInjector.strictDi = strictDi; - forEach(runBlocks, function(fn) { if (fn) instanceInjector.invoke(fn); }); - - instanceInjector.loadNewModules = function(mods) { - forEach(loadModules(mods), function(fn) { if (fn) instanceInjector.invoke(fn); }); - }; - - - return instanceInjector; - - //////////////////////////////////// - // $provider - //////////////////////////////////// - - function supportObject(delegate) { - return function(key, value) { - if (isObject(key)) { - forEach(key, reverseParams(delegate)); - } else { - return delegate(key, value); - } - }; - } - - function provider(name, provider_) { - assertNotHasOwnProperty(name, 'service'); - if (isFunction(provider_) || isArray(provider_)) { - provider_ = providerInjector.instantiate(provider_); - } - if (!provider_.$get) { - throw $injectorMinErr('pget', 'Provider \'{0}\' must define $get factory method.', name); - } - return (providerCache[name + providerSuffix] = provider_); - } - - function enforceReturnValue(name, factory) { - return /** @this */ function enforcedReturnValue() { - var result = instanceInjector.invoke(factory, this); - if (isUndefined(result)) { - throw $injectorMinErr('undef', 'Provider \'{0}\' must return a value from $get factory method.', name); - } - return result; - }; - } - - function factory(name, factoryFn, enforce) { - return provider(name, { - $get: enforce !== false ? enforceReturnValue(name, factoryFn) : factoryFn - }); - } - - function service(name, constructor) { - return factory(name, ['$injector', function($injector) { - return $injector.instantiate(constructor); - }]); - } - - function value(name, val) { return factory(name, valueFn(val), false); } - - function constant(name, value) { - assertNotHasOwnProperty(name, 'constant'); - providerCache[name] = value; - instanceCache[name] = value; - } - - function decorator(serviceName, decorFn) { - var origProvider = providerInjector.get(serviceName + providerSuffix), - orig$get = origProvider.$get; - - origProvider.$get = function() { - var origInstance = instanceInjector.invoke(orig$get, origProvider); - return instanceInjector.invoke(decorFn, null, {$delegate: origInstance}); - }; - } - - //////////////////////////////////// - // Module Loading - //////////////////////////////////// - function loadModules(modulesToLoad) { - assertArg(isUndefined(modulesToLoad) || isArray(modulesToLoad), 'modulesToLoad', 'not an array'); - var runBlocks = [], moduleFn; - forEach(modulesToLoad, function(module) { - if (loadedModules.get(module)) return; - loadedModules.set(module, true); - - function runInvokeQueue(queue) { - var i, ii; - for (i = 0, ii = queue.length; i < ii; i++) { - var invokeArgs = queue[i], - provider = providerInjector.get(invokeArgs[0]); - - provider[invokeArgs[1]].apply(provider, invokeArgs[2]); - } - } - - try { - if (isString(module)) { - moduleFn = angularModule(module); - instanceInjector.modules[module] = moduleFn; - runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks); - runInvokeQueue(moduleFn._invokeQueue); - runInvokeQueue(moduleFn._configBlocks); - } else if (isFunction(module)) { - runBlocks.push(providerInjector.invoke(module)); - } else if (isArray(module)) { - runBlocks.push(providerInjector.invoke(module)); - } else { - assertArgFn(module, 'module'); - } - } catch (e) { - if (isArray(module)) { - module = module[module.length - 1]; - } - if (e.message && e.stack && e.stack.indexOf(e.message) === -1) { - // Safari & FF's stack traces don't contain error.message content - // unlike those of Chrome and IE - // So if stack doesn't contain message, we create a new string that contains both. - // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here. - // eslint-disable-next-line no-ex-assign - e = e.message + '\n' + e.stack; - } - throw $injectorMinErr('modulerr', 'Failed to instantiate module {0} due to:\n{1}', - module, e.stack || e.message || e); - } - }); - return runBlocks; - } - - //////////////////////////////////// - // internal Injector - //////////////////////////////////// - - function createInternalInjector(cache, factory) { - - function getService(serviceName, caller) { - if (cache.hasOwnProperty(serviceName)) { - if (cache[serviceName] === INSTANTIATING) { - throw $injectorMinErr('cdep', 'Circular dependency found: {0}', - serviceName + ' <- ' + path.join(' <- ')); - } - return cache[serviceName]; - } else { - try { - path.unshift(serviceName); - cache[serviceName] = INSTANTIATING; - cache[serviceName] = factory(serviceName, caller); - return cache[serviceName]; - } catch (err) { - if (cache[serviceName] === INSTANTIATING) { - delete cache[serviceName]; - } - throw err; - } finally { - path.shift(); - } - } - } - - - function injectionArgs(fn, locals, serviceName) { - var args = [], - $inject = createInjector.$$annotate(fn, strictDi, serviceName); - - for (var i = 0, length = $inject.length; i < length; i++) { - var key = $inject[i]; - if (typeof key !== 'string') { - throw $injectorMinErr('itkn', - 'Incorrect injection token! Expected service name as string, got {0}', key); - } - args.push(locals && locals.hasOwnProperty(key) ? locals[key] : - getService(key, serviceName)); - } - return args; - } - - function isClass(func) { - // Support: IE 9-11 only - // IE 9-11 do not support classes and IE9 leaks with the code below. - if (msie || typeof func !== 'function') { - return false; - } - var result = func.$$ngIsClass; - if (!isBoolean(result)) { - // Support: Edge 12-13 only - // See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/6156135/ - result = func.$$ngIsClass = /^(?:class\b|constructor\()/.test(stringifyFn(func)); - } - return result; - } - - function invoke(fn, self, locals, serviceName) { - if (typeof locals === 'string') { - serviceName = locals; - locals = null; - } - - var args = injectionArgs(fn, locals, serviceName); - if (isArray(fn)) { - fn = fn[fn.length - 1]; - } - - if (!isClass(fn)) { - // http://jsperf.com/angularjs-invoke-apply-vs-switch - // #5388 - return fn.apply(self, args); - } else { - args.unshift(null); - return new (Function.prototype.bind.apply(fn, args))(); - } - } - - - function instantiate(Type, locals, serviceName) { - // Check if Type is annotated and use just the given function at n-1 as parameter - // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]); - var ctor = (isArray(Type) ? Type[Type.length - 1] : Type); - var args = injectionArgs(Type, locals, serviceName); - // Empty object at position 0 is ignored for invocation with `new`, but required. - args.unshift(null); - return new (Function.prototype.bind.apply(ctor, args))(); - } - - - return { - invoke: invoke, - instantiate: instantiate, - get: getService, - annotate: createInjector.$$annotate, - has: function(name) { - return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name); - } - }; - } - } - - createInjector.$$annotate = annotate; - - /** - * @ngdoc provider - * @name $anchorScrollProvider - * @this - * - * @description - * Use `$anchorScrollProvider` to disable automatic scrolling whenever - * {@link ng.$location#hash $location.hash()} changes. - */ - function $AnchorScrollProvider() { - - var autoScrollingEnabled = true; - - /** - * @ngdoc method - * @name $anchorScrollProvider#disableAutoScrolling - * - * @description - * By default, {@link ng.$anchorScroll $anchorScroll()} will automatically detect changes to - * {@link ng.$location#hash $location.hash()} and scroll to the element matching the new hash.
    - * Use this method to disable automatic scrolling. - * - * If automatic scrolling is disabled, one must explicitly call - * {@link ng.$anchorScroll $anchorScroll()} in order to scroll to the element related to the - * current hash. - */ - this.disableAutoScrolling = function() { - autoScrollingEnabled = false; - }; - - /** - * @ngdoc service - * @name $anchorScroll - * @kind function - * @requires $window - * @requires $location - * @requires $rootScope - * - * @description - * When called, it scrolls to the element related to the specified `hash` or (if omitted) to the - * current value of {@link ng.$location#hash $location.hash()}, according to the rules specified - * in the - * [HTML5 spec](http://www.w3.org/html/wg/drafts/html/master/browsers.html#an-indicated-part-of-the-document). - * - * It also watches the {@link ng.$location#hash $location.hash()} and automatically scrolls to - * match any anchor whenever it changes. This can be disabled by calling - * {@link ng.$anchorScrollProvider#disableAutoScrolling $anchorScrollProvider.disableAutoScrolling()}. - * - * Additionally, you can use its {@link ng.$anchorScroll#yOffset yOffset} property to specify a - * vertical scroll-offset (either fixed or dynamic). - * - * @param {string=} hash The hash specifying the element to scroll to. If omitted, the value of - * {@link ng.$location#hash $location.hash()} will be used. - * - * @property {(number|function|jqLite)} yOffset - * If set, specifies a vertical scroll-offset. This is often useful when there are fixed - * positioned elements at the top of the page, such as navbars, headers etc. - * - * `yOffset` can be specified in various ways: - * - **number**: A fixed number of pixels to be used as offset.

    - * - **function**: A getter function called everytime `$anchorScroll()` is executed. Must return - * a number representing the offset (in pixels).

    - * - **jqLite**: A jqLite/jQuery element to be used for specifying the offset. The distance from - * the top of the page to the element's bottom will be used as offset.
    - * **Note**: The element will be taken into account only as long as its `position` is set to - * `fixed`. This option is useful, when dealing with responsive navbars/headers that adjust - * their height and/or positioning according to the viewport's size. - * - *
    - *
    - * In order for `yOffset` to work properly, scrolling should take place on the document's root and - * not some child element. - *
    - * - * @example - - -
    - Go to bottom - You're at the bottom! -
    -
    - - angular.module('anchorScrollExample', []) - .controller('ScrollController', ['$scope', '$location', '$anchorScroll', - function($scope, $location, $anchorScroll) { - $scope.gotoBottom = function() { - // set the location.hash to the id of - // the element you wish to scroll to. - $location.hash('bottom'); - - // call $anchorScroll() - $anchorScroll(); - }; - }]); - - - #scrollArea { - height: 280px; - overflow: auto; - } - - #bottom { - display: block; - margin-top: 2000px; - } - -
    - * - *
    - * The example below illustrates the use of a vertical scroll-offset (specified as a fixed value). - * See {@link ng.$anchorScroll#yOffset $anchorScroll.yOffset} for more details. - * - * @example - - - -
    - Anchor {{x}} of 5 -
    -
    - - angular.module('anchorScrollOffsetExample', []) - .run(['$anchorScroll', function($anchorScroll) { - $anchorScroll.yOffset = 50; // always scroll by 50 extra pixels - }]) - .controller('headerCtrl', ['$anchorScroll', '$location', '$scope', - function($anchorScroll, $location, $scope) { - $scope.gotoAnchor = function(x) { - var newHash = 'anchor' + x; - if ($location.hash() !== newHash) { - // set the $location.hash to `newHash` and - // $anchorScroll will automatically scroll to it - $location.hash('anchor' + x); - } else { - // call $anchorScroll() explicitly, - // since $location.hash hasn't changed - $anchorScroll(); - } - }; - } - ]); - - - body { - padding-top: 50px; - } - - .anchor { - border: 2px dashed DarkOrchid; - padding: 10px 10px 200px 10px; - } - - .fixed-header { - background-color: rgba(0, 0, 0, 0.2); - height: 50px; - position: fixed; - top: 0; left: 0; right: 0; - } - - .fixed-header > a { - display: inline-block; - margin: 5px 15px; - } - -
    - */ - this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) { - var document = $window.document; - - // Helper function to get first anchor from a NodeList - // (using `Array#some()` instead of `angular#forEach()` since it's more performant - // and working in all supported browsers.) - function getFirstAnchor(list) { - var result = null; - Array.prototype.some.call(list, function(element) { - if (nodeName_(element) === 'a') { - result = element; - return true; - } - }); - return result; - } - - function getYOffset() { - - var offset = scroll.yOffset; - - if (isFunction(offset)) { - offset = offset(); - } else if (isElement(offset)) { - var elem = offset[0]; - var style = $window.getComputedStyle(elem); - if (style.position !== 'fixed') { - offset = 0; - } else { - offset = elem.getBoundingClientRect().bottom; - } - } else if (!isNumber(offset)) { - offset = 0; - } - - return offset; - } - - function scrollTo(elem) { - if (elem) { - elem.scrollIntoView(); - - var offset = getYOffset(); - - if (offset) { - // `offset` is the number of pixels we should scroll UP in order to align `elem` properly. - // This is true ONLY if the call to `elem.scrollIntoView()` initially aligns `elem` at the - // top of the viewport. - // - // IF the number of pixels from the top of `elem` to the end of the page's content is less - // than the height of the viewport, then `elem.scrollIntoView()` will align the `elem` some - // way down the page. - // - // This is often the case for elements near the bottom of the page. - // - // In such cases we do not need to scroll the whole `offset` up, just the difference between - // the top of the element and the offset, which is enough to align the top of `elem` at the - // desired position. - var elemTop = elem.getBoundingClientRect().top; - $window.scrollBy(0, elemTop - offset); - } - } else { - $window.scrollTo(0, 0); - } - } - - function scroll(hash) { - // Allow numeric hashes - hash = isString(hash) ? hash : isNumber(hash) ? hash.toString() : $location.hash(); - var elm; - - // empty hash, scroll to the top of the page - if (!hash) scrollTo(null); - - // element with given id - else if ((elm = document.getElementById(hash))) scrollTo(elm); - - // first anchor with given name :-D - else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) scrollTo(elm); - - // no element and hash === 'top', scroll to the top of the page - else if (hash === 'top') scrollTo(null); - } - - // does not scroll when user clicks on anchor link that is currently on - // (no url change, no $location.hash() change), browser native does scroll - if (autoScrollingEnabled) { - $rootScope.$watch(function autoScrollWatch() {return $location.hash();}, - function autoScrollWatchAction(newVal, oldVal) { - // skip the initial scroll if $location.hash is empty - if (newVal === oldVal && newVal === '') return; - - jqLiteDocumentLoaded(function() { - $rootScope.$evalAsync(scroll); - }); - }); - } - - return scroll; - }]; - } - - var $animateMinErr = minErr('$animate'); - var ELEMENT_NODE = 1; - var NG_ANIMATE_CLASSNAME = 'ng-animate'; - - function mergeClasses(a,b) { - if (!a && !b) return ''; - if (!a) return b; - if (!b) return a; - if (isArray(a)) a = a.join(' '); - if (isArray(b)) b = b.join(' '); - return a + ' ' + b; - } - - function extractElementNode(element) { - for (var i = 0; i < element.length; i++) { - var elm = element[i]; - if (elm.nodeType === ELEMENT_NODE) { - return elm; - } - } - } - - function splitClasses(classes) { - if (isString(classes)) { - classes = classes.split(' '); - } - - // Use createMap() to prevent class assumptions involving property names in - // Object.prototype - var obj = createMap(); - forEach(classes, function(klass) { - // sometimes the split leaves empty string values - // incase extra spaces were applied to the options - if (klass.length) { - obj[klass] = true; - } - }); - return obj; - } - -// if any other type of options value besides an Object value is -// passed into the $animate.method() animation then this helper code -// will be run which will ignore it. While this patch is not the -// greatest solution to this, a lot of existing plugins depend on -// $animate to either call the callback (< 1.2) or return a promise -// that can be changed. This helper function ensures that the options -// are wiped clean incase a callback function is provided. - function prepareAnimateOptions(options) { - return isObject(options) - ? options - : {}; - } - - var $$CoreAnimateJsProvider = /** @this */ function() { - this.$get = noop; - }; - -// this is prefixed with Core since it conflicts with -// the animateQueueProvider defined in ngAnimate/animateQueue.js - var $$CoreAnimateQueueProvider = /** @this */ function() { - var postDigestQueue = new NgMap(); - var postDigestElements = []; - - this.$get = ['$$AnimateRunner', '$rootScope', - function($$AnimateRunner, $rootScope) { - return { - enabled: noop, - on: noop, - off: noop, - pin: noop, - - push: function(element, event, options, domOperation) { - if (domOperation) { - domOperation(); - } - - options = options || {}; - if (options.from) { - element.css(options.from); - } - if (options.to) { - element.css(options.to); - } - - if (options.addClass || options.removeClass) { - addRemoveClassesPostDigest(element, options.addClass, options.removeClass); - } - - var runner = new $$AnimateRunner(); - - // since there are no animations to run the runner needs to be - // notified that the animation call is complete. - runner.complete(); - return runner; - } - }; - - - function updateData(data, classes, value) { - var changed = false; - if (classes) { - classes = isString(classes) ? classes.split(' ') : - isArray(classes) ? classes : []; - forEach(classes, function(className) { - if (className) { - changed = true; - data[className] = value; - } - }); - } - return changed; - } - - function handleCSSClassChanges() { - forEach(postDigestElements, function(element) { - var data = postDigestQueue.get(element); - if (data) { - var existing = splitClasses(element.attr('class')); - var toAdd = ''; - var toRemove = ''; - forEach(data, function(status, className) { - var hasClass = !!existing[className]; - if (status !== hasClass) { - if (status) { - toAdd += (toAdd.length ? ' ' : '') + className; - } else { - toRemove += (toRemove.length ? ' ' : '') + className; - } - } - }); - - forEach(element, function(elm) { - if (toAdd) { - jqLiteAddClass(elm, toAdd); - } - if (toRemove) { - jqLiteRemoveClass(elm, toRemove); - } - }); - postDigestQueue.delete(element); - } - }); - postDigestElements.length = 0; - } - - - function addRemoveClassesPostDigest(element, add, remove) { - var data = postDigestQueue.get(element) || {}; - - var classesAdded = updateData(data, add, true); - var classesRemoved = updateData(data, remove, false); - - if (classesAdded || classesRemoved) { - - postDigestQueue.set(element, data); - postDigestElements.push(element); - - if (postDigestElements.length === 1) { - $rootScope.$$postDigest(handleCSSClassChanges); - } - } - } - }]; - }; - - /** - * @ngdoc provider - * @name $animateProvider - * - * @description - * Default implementation of $animate that doesn't perform any animations, instead just - * synchronously performs DOM updates and resolves the returned runner promise. - * - * In order to enable animations the `ngAnimate` module has to be loaded. - * - * To see the functional implementation check out `src/ngAnimate/animate.js`. - */ - var $AnimateProvider = ['$provide', /** @this */ function($provide) { - var provider = this; - var classNameFilter = null; - var customFilter = null; - - this.$$registeredAnimations = Object.create(null); - - /** - * @ngdoc method - * @name $animateProvider#register - * - * @description - * Registers a new injectable animation factory function. The factory function produces the - * animation object which contains callback functions for each event that is expected to be - * animated. - * - * * `eventFn`: `function(element, ... , doneFunction, options)` - * The element to animate, the `doneFunction` and the options fed into the animation. Depending - * on the type of animation additional arguments will be injected into the animation function. The - * list below explains the function signatures for the different animation methods: - * - * - setClass: function(element, addedClasses, removedClasses, doneFunction, options) - * - addClass: function(element, addedClasses, doneFunction, options) - * - removeClass: function(element, removedClasses, doneFunction, options) - * - enter, leave, move: function(element, doneFunction, options) - * - animate: function(element, fromStyles, toStyles, doneFunction, options) - * - * Make sure to trigger the `doneFunction` once the animation is fully complete. - * - * ```js - * return { - * //enter, leave, move signature - * eventFn : function(element, done, options) { - * //code to run the animation - * //once complete, then run done() - * return function endFunction(wasCancelled) { - * //code to cancel the animation - * } - * } - * } - * ``` - * - * @param {string} name The name of the animation (this is what the class-based CSS value will be compared to). - * @param {Function} factory The factory function that will be executed to return the animation - * object. - */ - this.register = function(name, factory) { - if (name && name.charAt(0) !== '.') { - throw $animateMinErr('notcsel', 'Expecting class selector starting with \'.\' got \'{0}\'.', name); - } - - var key = name + '-animation'; - provider.$$registeredAnimations[name.substr(1)] = key; - $provide.factory(key, factory); - }; - - /** - * @ngdoc method - * @name $animateProvider#customFilter - * - * @description - * Sets and/or returns the custom filter function that is used to "filter" animations, i.e. - * determine if an animation is allowed or not. When no filter is specified (the default), no - * animation will be blocked. Setting the `customFilter` value will only allow animations for - * which the filter function's return value is truthy. - * - * This allows to easily create arbitrarily complex rules for filtering animations, such as - * allowing specific events only, or enabling animations on specific subtrees of the DOM, etc. - * Filtering animations can also boost performance for low-powered devices, as well as - * applications containing a lot of structural operations. - * - *
    - * **Best Practice:** - * Keep the filtering function as lean as possible, because it will be called for each DOM - * action (e.g. insertion, removal, class change) performed by "animation-aware" directives. - * See {@link guide/animations#which-directives-support-animations- here} for a list of built-in - * directives that support animations. - * Performing computationally expensive or time-consuming operations on each call of the - * filtering function can make your animations sluggish. - *
    - * - * **Note:** If present, `customFilter` will be checked before - * {@link $animateProvider#classNameFilter classNameFilter}. - * - * @param {Function=} filterFn - The filter function which will be used to filter all animations. - * If a falsy value is returned, no animation will be performed. The function will be called - * with the following arguments: - * - **node** `{DOMElement}` - The DOM element to be animated. - * - **event** `{String}` - The name of the animation event (e.g. `enter`, `leave`, `addClass` - * etc). - * - **options** `{Object}` - A collection of options/styles used for the animation. - * @return {Function} The current filter function or `null` if there is none set. - */ - this.customFilter = function(filterFn) { - if (arguments.length === 1) { - customFilter = isFunction(filterFn) ? filterFn : null; - } - - return customFilter; - }; - - /** - * @ngdoc method - * @name $animateProvider#classNameFilter - * - * @description - * Sets and/or returns the CSS class regular expression that is checked when performing - * an animation. Upon bootstrap the classNameFilter value is not set at all and will - * therefore enable $animate to attempt to perform an animation on any element that is triggered. - * When setting the `classNameFilter` value, animations will only be performed on elements - * that successfully match the filter expression. This in turn can boost performance - * for low-powered devices as well as applications containing a lot of structural operations. - * - * **Note:** If present, `classNameFilter` will be checked after - * {@link $animateProvider#customFilter customFilter}. If `customFilter` is present and returns - * false, `classNameFilter` will not be checked. - * - * @param {RegExp=} expression The className expression which will be checked against all animations - * @return {RegExp} The current CSS className expression value. If null then there is no expression value - */ - this.classNameFilter = function(expression) { - if (arguments.length === 1) { - classNameFilter = (expression instanceof RegExp) ? expression : null; - if (classNameFilter) { - var reservedRegex = new RegExp('[(\\s|\\/)]' + NG_ANIMATE_CLASSNAME + '[(\\s|\\/)]'); - if (reservedRegex.test(classNameFilter.toString())) { - classNameFilter = null; - throw $animateMinErr('nongcls', '$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the "{0}" CSS class.', NG_ANIMATE_CLASSNAME); - } - } - } - return classNameFilter; - }; - - this.$get = ['$$animateQueue', function($$animateQueue) { - function domInsert(element, parentElement, afterElement) { - // if for some reason the previous element was removed - // from the dom sometime before this code runs then let's - // just stick to using the parent element as the anchor - if (afterElement) { - var afterNode = extractElementNode(afterElement); - if (afterNode && !afterNode.parentNode && !afterNode.previousElementSibling) { - afterElement = null; - } - } - if (afterElement) { - afterElement.after(element); - } else { - parentElement.prepend(element); - } - } - - /** - * @ngdoc service - * @name $animate - * @description The $animate service exposes a series of DOM utility methods that provide support - * for animation hooks. The default behavior is the application of DOM operations, however, - * when an animation is detected (and animations are enabled), $animate will do the heavy lifting - * to ensure that animation runs with the triggered DOM operation. - * - * By default $animate doesn't trigger any animations. This is because the `ngAnimate` module isn't - * included and only when it is active then the animation hooks that `$animate` triggers will be - * functional. Once active then all structural `ng-` directives will trigger animations as they perform - * their DOM-related operations (enter, leave and move). Other directives such as `ngClass`, - * `ngShow`, `ngHide` and `ngMessages` also provide support for animations. - * - * It is recommended that the`$animate` service is always used when executing DOM-related procedures within directives. - * - * To learn more about enabling animation support, click here to visit the - * {@link ngAnimate ngAnimate module page}. - */ - return { - // we don't call it directly since non-existant arguments may - // be interpreted as null within the sub enabled function - - /** - * - * @ngdoc method - * @name $animate#on - * @kind function - * @description Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...) - * has fired on the given element or among any of its children. Once the listener is fired, the provided callback - * is fired with the following params: - * - * ```js - * $animate.on('enter', container, - * function callback(element, phase) { - * // cool we detected an enter animation within the container - * } - * ); - * ``` - * - * @param {string} event the animation event that will be captured (e.g. enter, leave, move, addClass, removeClass, etc...) - * @param {DOMElement} container the container element that will capture each of the animation events that are fired on itself - * as well as among its children - * @param {Function} callback the callback function that will be fired when the listener is triggered - * - * The arguments present in the callback function are: - * * `element` - The captured DOM element that the animation was fired on. - * * `phase` - The phase of the animation. The two possible phases are **start** (when the animation starts) and **close** (when it ends). - */ - on: $$animateQueue.on, - - /** - * - * @ngdoc method - * @name $animate#off - * @kind function - * @description Deregisters an event listener based on the event which has been associated with the provided element. This method - * can be used in three different ways depending on the arguments: - * - * ```js - * // remove all the animation event listeners listening for `enter` - * $animate.off('enter'); - * - * // remove listeners for all animation events from the container element - * $animate.off(container); - * - * // remove all the animation event listeners listening for `enter` on the given element and its children - * $animate.off('enter', container); - * - * // remove the event listener function provided by `callback` that is set - * // to listen for `enter` on the given `container` as well as its children - * $animate.off('enter', container, callback); - * ``` - * - * @param {string|DOMElement} event|container the animation event (e.g. enter, leave, move, - * addClass, removeClass, etc...), or the container element. If it is the element, all other - * arguments are ignored. - * @param {DOMElement=} container the container element the event listener was placed on - * @param {Function=} callback the callback function that was registered as the listener - */ - off: $$animateQueue.off, - - /** - * @ngdoc method - * @name $animate#pin - * @kind function - * @description Associates the provided element with a host parent element to allow the element to be animated even if it exists - * outside of the DOM structure of the AngularJS application. By doing so, any animation triggered via `$animate` can be issued on the - * element despite being outside the realm of the application or within another application. Say for example if the application - * was bootstrapped on an element that is somewhere inside of the `` tag, but we wanted to allow for an element to be situated - * as a direct child of `document.body`, then this can be achieved by pinning the element via `$animate.pin(element)`. Keep in mind - * that calling `$animate.pin(element, parentElement)` will not actually insert into the DOM anywhere; it will just create the association. - * - * Note that this feature is only active when the `ngAnimate` module is used. - * - * @param {DOMElement} element the external element that will be pinned - * @param {DOMElement} parentElement the host parent element that will be associated with the external element - */ - pin: $$animateQueue.pin, - - /** - * - * @ngdoc method - * @name $animate#enabled - * @kind function - * @description Used to get and set whether animations are enabled or not on the entire application or on an element and its children. This - * function can be called in four ways: - * - * ```js - * // returns true or false - * $animate.enabled(); - * - * // changes the enabled state for all animations - * $animate.enabled(false); - * $animate.enabled(true); - * - * // returns true or false if animations are enabled for an element - * $animate.enabled(element); - * - * // changes the enabled state for an element and its children - * $animate.enabled(element, true); - * $animate.enabled(element, false); - * ``` - * - * @param {DOMElement=} element the element that will be considered for checking/setting the enabled state - * @param {boolean=} enabled whether or not the animations will be enabled for the element - * - * @return {boolean} whether or not animations are enabled - */ - enabled: $$animateQueue.enabled, - - /** - * @ngdoc method - * @name $animate#cancel - * @kind function - * @description Cancels the provided animation. - * - * @param {Promise} animationPromise The animation promise that is returned when an animation is started. - */ - cancel: function(runner) { - if (runner.end) { - runner.end(); - } - }, - - /** - * - * @ngdoc method - * @name $animate#enter - * @kind function - * @description Inserts the element into the DOM either after the `after` element (if provided) or - * as the first child within the `parent` element and then triggers an animation. - * A promise is returned that will be resolved during the next digest once the animation - * has completed. - * - * @param {DOMElement} element the element which will be inserted into the DOM - * @param {DOMElement} parent the parent element which will append the element as - * a child (so long as the after element is not present) - * @param {DOMElement=} after the sibling element after which the element will be appended - * @param {object=} options an optional collection of options/styles that will be applied to the element. - * The object can have the following properties: - * - * - **addClass** - `{string}` - space-separated CSS classes to add to element - * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to` - * - **removeClass** - `{string}` - space-separated CSS classes to remove from element - * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` - * - * @return {Promise} the animation callback promise - */ - enter: function(element, parent, after, options) { - parent = parent && jqLite(parent); - after = after && jqLite(after); - parent = parent || after.parent(); - domInsert(element, parent, after); - return $$animateQueue.push(element, 'enter', prepareAnimateOptions(options)); - }, - - /** - * - * @ngdoc method - * @name $animate#move - * @kind function - * @description Inserts (moves) the element into its new position in the DOM either after - * the `after` element (if provided) or as the first child within the `parent` element - * and then triggers an animation. A promise is returned that will be resolved - * during the next digest once the animation has completed. - * - * @param {DOMElement} element the element which will be moved into the new DOM position - * @param {DOMElement} parent the parent element which will append the element as - * a child (so long as the after element is not present) - * @param {DOMElement=} after the sibling element after which the element will be appended - * @param {object=} options an optional collection of options/styles that will be applied to the element. - * The object can have the following properties: - * - * - **addClass** - `{string}` - space-separated CSS classes to add to element - * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to` - * - **removeClass** - `{string}` - space-separated CSS classes to remove from element - * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` - * - * @return {Promise} the animation callback promise - */ - move: function(element, parent, after, options) { - parent = parent && jqLite(parent); - after = after && jqLite(after); - parent = parent || after.parent(); - domInsert(element, parent, after); - return $$animateQueue.push(element, 'move', prepareAnimateOptions(options)); - }, - - /** - * @ngdoc method - * @name $animate#leave - * @kind function - * @description Triggers an animation and then removes the element from the DOM. - * When the function is called a promise is returned that will be resolved during the next - * digest once the animation has completed. - * - * @param {DOMElement} element the element which will be removed from the DOM - * @param {object=} options an optional collection of options/styles that will be applied to the element. - * The object can have the following properties: - * - * - **addClass** - `{string}` - space-separated CSS classes to add to element - * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to` - * - **removeClass** - `{string}` - space-separated CSS classes to remove from element - * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` - * - * @return {Promise} the animation callback promise - */ - leave: function(element, options) { - return $$animateQueue.push(element, 'leave', prepareAnimateOptions(options), function() { - element.remove(); - }); - }, - - /** - * @ngdoc method - * @name $animate#addClass - * @kind function - * - * @description Triggers an addClass animation surrounding the addition of the provided CSS class(es). Upon - * execution, the addClass operation will only be handled after the next digest and it will not trigger an - * animation if element already contains the CSS class or if the class is removed at a later step. - * Note that class-based animations are treated differently compared to structural animations - * (like enter, move and leave) since the CSS classes may be added/removed at different points - * depending if CSS or JavaScript animations are used. - * - * @param {DOMElement} element the element which the CSS classes will be applied to - * @param {string} className the CSS class(es) that will be added (multiple classes are separated via spaces) - * @param {object=} options an optional collection of options/styles that will be applied to the element. - * The object can have the following properties: - * - * - **addClass** - `{string}` - space-separated CSS classes to add to element - * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to` - * - **removeClass** - `{string}` - space-separated CSS classes to remove from element - * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` - * - * @return {Promise} the animation callback promise - */ - addClass: function(element, className, options) { - options = prepareAnimateOptions(options); - options.addClass = mergeClasses(options.addclass, className); - return $$animateQueue.push(element, 'addClass', options); - }, - - /** - * @ngdoc method - * @name $animate#removeClass - * @kind function - * - * @description Triggers a removeClass animation surrounding the removal of the provided CSS class(es). Upon - * execution, the removeClass operation will only be handled after the next digest and it will not trigger an - * animation if element does not contain the CSS class or if the class is added at a later step. - * Note that class-based animations are treated differently compared to structural animations - * (like enter, move and leave) since the CSS classes may be added/removed at different points - * depending if CSS or JavaScript animations are used. - * - * @param {DOMElement} element the element which the CSS classes will be applied to - * @param {string} className the CSS class(es) that will be removed (multiple classes are separated via spaces) - * @param {object=} options an optional collection of options/styles that will be applied to the element. - * The object can have the following properties: - * - * - **addClass** - `{string}` - space-separated CSS classes to add to element - * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to` - * - **removeClass** - `{string}` - space-separated CSS classes to remove from element - * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` - * - * @return {Promise} the animation callback promise - */ - removeClass: function(element, className, options) { - options = prepareAnimateOptions(options); - options.removeClass = mergeClasses(options.removeClass, className); - return $$animateQueue.push(element, 'removeClass', options); - }, - - /** - * @ngdoc method - * @name $animate#setClass - * @kind function - * - * @description Performs both the addition and removal of a CSS classes on an element and (during the process) - * triggers an animation surrounding the class addition/removal. Much like `$animate.addClass` and - * `$animate.removeClass`, `setClass` will only evaluate the classes being added/removed once a digest has - * passed. Note that class-based animations are treated differently compared to structural animations - * (like enter, move and leave) since the CSS classes may be added/removed at different points - * depending if CSS or JavaScript animations are used. - * - * @param {DOMElement} element the element which the CSS classes will be applied to - * @param {string} add the CSS class(es) that will be added (multiple classes are separated via spaces) - * @param {string} remove the CSS class(es) that will be removed (multiple classes are separated via spaces) - * @param {object=} options an optional collection of options/styles that will be applied to the element. - * The object can have the following properties: - * - * - **addClass** - `{string}` - space-separated CSS classes to add to element - * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to` - * - **removeClass** - `{string}` - space-separated CSS classes to remove from element - * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` - * - * @return {Promise} the animation callback promise - */ - setClass: function(element, add, remove, options) { - options = prepareAnimateOptions(options); - options.addClass = mergeClasses(options.addClass, add); - options.removeClass = mergeClasses(options.removeClass, remove); - return $$animateQueue.push(element, 'setClass', options); - }, - - /** - * @ngdoc method - * @name $animate#animate - * @kind function - * - * @description Performs an inline animation on the element which applies the provided to and from CSS styles to the element. - * If any detected CSS transition, keyframe or JavaScript matches the provided className value, then the animation will take - * on the provided styles. For example, if a transition animation is set for the given className, then the provided `from` and - * `to` styles will be applied alongside the given transition. If the CSS style provided in `from` does not have a corresponding - * style in `to`, the style in `from` is applied immediately, and no animation is run. - * If a JavaScript animation is detected then the provided styles will be given in as function parameters into the `animate` - * method (or as part of the `options` parameter): - * - * ```js - * ngModule.animation('.my-inline-animation', function() { - * return { - * animate : function(element, from, to, done, options) { - * //animation - * done(); - * } - * } - * }); - * ``` - * - * @param {DOMElement} element the element which the CSS styles will be applied to - * @param {object} from the from (starting) CSS styles that will be applied to the element and across the animation. - * @param {object} to the to (destination) CSS styles that will be applied to the element and across the animation. - * @param {string=} className an optional CSS class that will be applied to the element for the duration of the animation. If - * this value is left as empty then a CSS class of `ng-inline-animate` will be applied to the element. - * (Note that if no animation is detected then this value will not be applied to the element.) - * @param {object=} options an optional collection of options/styles that will be applied to the element. - * The object can have the following properties: - * - * - **addClass** - `{string}` - space-separated CSS classes to add to element - * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to` - * - **removeClass** - `{string}` - space-separated CSS classes to remove from element - * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` - * - * @return {Promise} the animation callback promise - */ - animate: function(element, from, to, className, options) { - options = prepareAnimateOptions(options); - options.from = options.from ? extend(options.from, from) : from; - options.to = options.to ? extend(options.to, to) : to; - - className = className || 'ng-inline-animate'; - options.tempClasses = mergeClasses(options.tempClasses, className); - return $$animateQueue.push(element, 'animate', options); - } - }; - }]; - }]; - - var $$AnimateAsyncRunFactoryProvider = /** @this */ function() { - this.$get = ['$$rAF', function($$rAF) { - var waitQueue = []; - - function waitForTick(fn) { - waitQueue.push(fn); - if (waitQueue.length > 1) return; - $$rAF(function() { - for (var i = 0; i < waitQueue.length; i++) { - waitQueue[i](); - } - waitQueue = []; - }); - } - - return function() { - var passed = false; - waitForTick(function() { - passed = true; - }); - return function(callback) { - if (passed) { - callback(); - } else { - waitForTick(callback); - } - }; - }; - }]; - }; - - var $$AnimateRunnerFactoryProvider = /** @this */ function() { - this.$get = ['$q', '$sniffer', '$$animateAsyncRun', '$$isDocumentHidden', '$timeout', - function($q, $sniffer, $$animateAsyncRun, $$isDocumentHidden, $timeout) { - - var INITIAL_STATE = 0; - var DONE_PENDING_STATE = 1; - var DONE_COMPLETE_STATE = 2; - - AnimateRunner.chain = function(chain, callback) { - var index = 0; - - next(); - function next() { - if (index === chain.length) { - callback(true); - return; - } - - chain[index](function(response) { - if (response === false) { - callback(false); - return; - } - index++; - next(); - }); - } - }; - - AnimateRunner.all = function(runners, callback) { - var count = 0; - var status = true; - forEach(runners, function(runner) { - runner.done(onProgress); - }); - - function onProgress(response) { - status = status && response; - if (++count === runners.length) { - callback(status); - } - } - }; - - function AnimateRunner(host) { - this.setHost(host); - - var rafTick = $$animateAsyncRun(); - var timeoutTick = function(fn) { - $timeout(fn, 0, false); - }; - - this._doneCallbacks = []; - this._tick = function(fn) { - if ($$isDocumentHidden()) { - timeoutTick(fn); - } else { - rafTick(fn); - } - }; - this._state = 0; - } - - AnimateRunner.prototype = { - setHost: function(host) { - this.host = host || {}; - }, - - done: function(fn) { - if (this._state === DONE_COMPLETE_STATE) { - fn(); - } else { - this._doneCallbacks.push(fn); - } - }, - - progress: noop, - - getPromise: function() { - if (!this.promise) { - var self = this; - this.promise = $q(function(resolve, reject) { - self.done(function(status) { - if (status === false) { - reject(); - } else { - resolve(); - } - }); - }); - } - return this.promise; - }, - - then: function(resolveHandler, rejectHandler) { - return this.getPromise().then(resolveHandler, rejectHandler); - }, - - 'catch': function(handler) { - return this.getPromise()['catch'](handler); - }, - - 'finally': function(handler) { - return this.getPromise()['finally'](handler); - }, - - pause: function() { - if (this.host.pause) { - this.host.pause(); - } - }, - - resume: function() { - if (this.host.resume) { - this.host.resume(); - } - }, - - end: function() { - if (this.host.end) { - this.host.end(); - } - this._resolve(true); - }, - - cancel: function() { - if (this.host.cancel) { - this.host.cancel(); - } - this._resolve(false); - }, - - complete: function(response) { - var self = this; - if (self._state === INITIAL_STATE) { - self._state = DONE_PENDING_STATE; - self._tick(function() { - self._resolve(response); - }); - } - }, - - _resolve: function(response) { - if (this._state !== DONE_COMPLETE_STATE) { - forEach(this._doneCallbacks, function(fn) { - fn(response); - }); - this._doneCallbacks.length = 0; - this._state = DONE_COMPLETE_STATE; - } - } - }; - - return AnimateRunner; - }]; - }; - - /* exported $CoreAnimateCssProvider */ - - /** - * @ngdoc service - * @name $animateCss - * @kind object - * @this - * - * @description - * This is the core version of `$animateCss`. By default, only when the `ngAnimate` is included, - * then the `$animateCss` service will actually perform animations. - * - * Click here {@link ngAnimate.$animateCss to read the documentation for $animateCss}. - */ - var $CoreAnimateCssProvider = function() { - this.$get = ['$$rAF', '$q', '$$AnimateRunner', function($$rAF, $q, $$AnimateRunner) { - - return function(element, initialOptions) { - // all of the animation functions should create - // a copy of the options data, however, if a - // parent service has already created a copy then - // we should stick to using that - var options = initialOptions || {}; - if (!options.$$prepared) { - options = copy(options); - } - - // there is no point in applying the styles since - // there is no animation that goes on at all in - // this version of $animateCss. - if (options.cleanupStyles) { - options.from = options.to = null; - } - - if (options.from) { - element.css(options.from); - options.from = null; - } - - var closed, runner = new $$AnimateRunner(); - return { - start: run, - end: run - }; - - function run() { - $$rAF(function() { - applyAnimationContents(); - if (!closed) { - runner.complete(); - } - closed = true; - }); - return runner; - } - - function applyAnimationContents() { - if (options.addClass) { - element.addClass(options.addClass); - options.addClass = null; - } - if (options.removeClass) { - element.removeClass(options.removeClass); - options.removeClass = null; - } - if (options.to) { - element.css(options.to); - options.to = null; - } - } - }; - }]; - }; - - /* global stripHash: true */ - - /** - * ! This is a private undocumented service ! - * - * @name $browser - * @requires $log - * @description - * This object has two goals: - * - * - hide all the global state in the browser caused by the window object - * - abstract away all the browser specific features and inconsistencies - * - * For tests we provide {@link ngMock.$browser mock implementation} of the `$browser` - * service, which can be used for convenient testing of the application without the interaction with - * the real browser apis. - */ - /** - * @param {object} window The global window object. - * @param {object} document jQuery wrapped document. - * @param {object} $log window.console or an object with the same interface. - * @param {object} $sniffer $sniffer service - */ - function Browser(window, document, $log, $sniffer) { - var self = this, - location = window.location, - history = window.history, - setTimeout = window.setTimeout, - clearTimeout = window.clearTimeout, - pendingDeferIds = {}; - - self.isMock = false; - - var outstandingRequestCount = 0; - var outstandingRequestCallbacks = []; - - // TODO(vojta): remove this temporary api - self.$$completeOutstandingRequest = completeOutstandingRequest; - self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; }; - - /** - * Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` - * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed. - */ - function completeOutstandingRequest(fn) { - try { - fn.apply(null, sliceArgs(arguments, 1)); - } finally { - outstandingRequestCount--; - if (outstandingRequestCount === 0) { - while (outstandingRequestCallbacks.length) { - try { - outstandingRequestCallbacks.pop()(); - } catch (e) { - $log.error(e); - } - } - } - } - } - - function getHash(url) { - var index = url.indexOf('#'); - return index === -1 ? '' : url.substr(index); - } - - /** - * @private - * TODO(vojta): prefix this method with $$ ? - * @param {function()} callback Function that will be called when no outstanding request - */ - self.notifyWhenNoOutstandingRequests = function(callback) { - if (outstandingRequestCount === 0) { - callback(); - } else { - outstandingRequestCallbacks.push(callback); - } - }; - - ////////////////////////////////////////////////////////////// - // URL API - ////////////////////////////////////////////////////////////// - - var cachedState, lastHistoryState, - lastBrowserUrl = location.href, - baseElement = document.find('base'), - pendingLocation = null, - getCurrentState = !$sniffer.history ? noop : function getCurrentState() { - try { - return history.state; - } catch (e) { - // MSIE can reportedly throw when there is no state (UNCONFIRMED). - } - }; - - cacheState(); - - /** - * @name $browser#url - * - * @description - * GETTER: - * Without any argument, this method just returns current value of location.href. - * - * SETTER: - * With at least one argument, this method sets url to new value. - * If html5 history api supported, pushState/replaceState is used, otherwise - * location.href/location.replace is used. - * Returns its own instance to allow chaining - * - * NOTE: this api is intended for use only by the $location service. Please use the - * {@link ng.$location $location service} to change url. - * - * @param {string} url New url (when used as setter) - * @param {boolean=} replace Should new url replace current history record? - * @param {object=} state object to use with pushState/replaceState - */ - self.url = function(url, replace, state) { - // In modern browsers `history.state` is `null` by default; treating it separately - // from `undefined` would cause `$browser.url('/foo')` to change `history.state` - // to undefined via `pushState`. Instead, let's change `undefined` to `null` here. - if (isUndefined(state)) { - state = null; - } - - // Android Browser BFCache causes location, history reference to become stale. - if (location !== window.location) location = window.location; - if (history !== window.history) history = window.history; - - // setter - if (url) { - var sameState = lastHistoryState === state; - - // Don't change anything if previous and current URLs and states match. This also prevents - // IE<10 from getting into redirect loop when in LocationHashbangInHtml5Url mode. - // See https://github.com/angular/angular.js/commit/ffb2701 - if (lastBrowserUrl === url && (!$sniffer.history || sameState)) { - return self; - } - var sameBase = lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url); - lastBrowserUrl = url; - lastHistoryState = state; - // Don't use history API if only the hash changed - // due to a bug in IE10/IE11 which leads - // to not firing a `hashchange` nor `popstate` event - // in some cases (see #9143). - if ($sniffer.history && (!sameBase || !sameState)) { - history[replace ? 'replaceState' : 'pushState'](state, '', url); - cacheState(); - } else { - if (!sameBase) { - pendingLocation = url; - } - if (replace) { - location.replace(url); - } else if (!sameBase) { - location.href = url; - } else { - location.hash = getHash(url); - } - if (location.href !== url) { - pendingLocation = url; - } - } - if (pendingLocation) { - pendingLocation = url; - } - return self; - // getter - } else { - // - pendingLocation is needed as browsers don't allow to read out - // the new location.href if a reload happened or if there is a bug like in iOS 9 (see - // https://openradar.appspot.com/22186109). - // - the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172 - return pendingLocation || location.href.replace(/%27/g,'\''); - } - }; - - /** - * @name $browser#state - * - * @description - * This method is a getter. - * - * Return history.state or null if history.state is undefined. - * - * @returns {object} state - */ - self.state = function() { - return cachedState; - }; - - var urlChangeListeners = [], - urlChangeInit = false; - - function cacheStateAndFireUrlChange() { - pendingLocation = null; - fireStateOrUrlChange(); - } - - // This variable should be used *only* inside the cacheState function. - var lastCachedState = null; - function cacheState() { - // This should be the only place in $browser where `history.state` is read. - cachedState = getCurrentState(); - cachedState = isUndefined(cachedState) ? null : cachedState; - - // Prevent callbacks fo fire twice if both hashchange & popstate were fired. - if (equals(cachedState, lastCachedState)) { - cachedState = lastCachedState; - } - - lastCachedState = cachedState; - lastHistoryState = cachedState; - } - - function fireStateOrUrlChange() { - var prevLastHistoryState = lastHistoryState; - cacheState(); - - if (lastBrowserUrl === self.url() && prevLastHistoryState === cachedState) { - return; - } - - lastBrowserUrl = self.url(); - lastHistoryState = cachedState; - forEach(urlChangeListeners, function(listener) { - listener(self.url(), cachedState); - }); - } - - /** - * @name $browser#onUrlChange - * - * @description - * Register callback function that will be called, when url changes. - * - * It's only called when the url is changed from outside of AngularJS: - * - user types different url into address bar - * - user clicks on history (forward/back) button - * - user clicks on a link - * - * It's not called when url is changed by $browser.url() method - * - * The listener gets called with new url as parameter. - * - * NOTE: this api is intended for use only by the $location service. Please use the - * {@link ng.$location $location service} to monitor url changes in AngularJS apps. - * - * @param {function(string)} listener Listener function to be called when url changes. - * @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous. - */ - self.onUrlChange = function(callback) { - // TODO(vojta): refactor to use node's syntax for events - if (!urlChangeInit) { - // We listen on both (hashchange/popstate) when available, as some browsers don't - // fire popstate when user changes the address bar and don't fire hashchange when url - // changed by push/replaceState - - // html5 history api - popstate event - if ($sniffer.history) jqLite(window).on('popstate', cacheStateAndFireUrlChange); - // hashchange event - jqLite(window).on('hashchange', cacheStateAndFireUrlChange); - - urlChangeInit = true; - } - - urlChangeListeners.push(callback); - return callback; - }; - - /** - * @private - * Remove popstate and hashchange handler from window. - * - * NOTE: this api is intended for use only by $rootScope. - */ - self.$$applicationDestroyed = function() { - jqLite(window).off('hashchange popstate', cacheStateAndFireUrlChange); - }; - - /** - * Checks whether the url has changed outside of AngularJS. - * Needs to be exported to be able to check for changes that have been done in sync, - * as hashchange/popstate events fire in async. - */ - self.$$checkUrlChange = fireStateOrUrlChange; - - ////////////////////////////////////////////////////////////// - // Misc API - ////////////////////////////////////////////////////////////// - - /** - * @name $browser#baseHref - * - * @description - * Returns current - * (always relative - without domain) - * - * @returns {string} The current base href - */ - self.baseHref = function() { - var href = baseElement.attr('href'); - return href ? href.replace(/^(https?:)?\/\/[^/]*/, '') : ''; - }; - - /** - * @name $browser#defer - * @param {function()} fn A function, who's execution should be deferred. - * @param {number=} [delay=0] of milliseconds to defer the function execution. - * @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`. - * - * @description - * Executes a fn asynchronously via `setTimeout(fn, delay)`. - * - * Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using - * `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed - * via `$browser.defer.flush()`. - * - */ - self.defer = function(fn, delay) { - var timeoutId; - outstandingRequestCount++; - timeoutId = setTimeout(function() { - delete pendingDeferIds[timeoutId]; - completeOutstandingRequest(fn); - }, delay || 0); - pendingDeferIds[timeoutId] = true; - return timeoutId; - }; - - - /** - * @name $browser#defer.cancel - * - * @description - * Cancels a deferred task identified with `deferId`. - * - * @param {*} deferId Token returned by the `$browser.defer` function. - * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully - * canceled. - */ - self.defer.cancel = function(deferId) { - if (pendingDeferIds[deferId]) { - delete pendingDeferIds[deferId]; - clearTimeout(deferId); - completeOutstandingRequest(noop); - return true; - } - return false; - }; - - } - - /** @this */ - function $BrowserProvider() { - this.$get = ['$window', '$log', '$sniffer', '$document', - function($window, $log, $sniffer, $document) { - return new Browser($window, $document, $log, $sniffer); - }]; - } - - /** - * @ngdoc service - * @name $cacheFactory - * @this - * - * @description - * Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to - * them. - * - * ```js - * - * var cache = $cacheFactory('cacheId'); - * expect($cacheFactory.get('cacheId')).toBe(cache); - * expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined(); - * - * cache.put("key", "value"); - * cache.put("another key", "another value"); - * - * // We've specified no options on creation - * expect(cache.info()).toEqual({id: 'cacheId', size: 2}); - * - * ``` - * - * - * @param {string} cacheId Name or id of the newly created cache. - * @param {object=} options Options object that specifies the cache behavior. Properties: - * - * - `{number=}` `capacity` — turns the cache into LRU cache. - * - * @returns {object} Newly created cache object with the following set of methods: - * - * - `{object}` `info()` — Returns id, size, and options of cache. - * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns - * it. - * - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss. - * - `{void}` `remove({string} key)` — Removes a key-value pair from the cache. - * - `{void}` `removeAll()` — Removes all cached values. - * - `{void}` `destroy()` — Removes references to this cache from $cacheFactory. - * - * @example - - -
    - - - - -

    Cached Values

    -
    - - : - -
    - -

    Cache Info

    -
    - - : - -
    -
    -
    - - angular.module('cacheExampleApp', []). - controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) { - $scope.keys = []; - $scope.cache = $cacheFactory('cacheId'); - $scope.put = function(key, value) { - if (angular.isUndefined($scope.cache.get(key))) { - $scope.keys.push(key); - } - $scope.cache.put(key, angular.isUndefined(value) ? null : value); - }; - }]); - - - p { - margin: 10px 0 3px; - } - -
    - */ - function $CacheFactoryProvider() { - - this.$get = function() { - var caches = {}; - - function cacheFactory(cacheId, options) { - if (cacheId in caches) { - throw minErr('$cacheFactory')('iid', 'CacheId \'{0}\' is already taken!', cacheId); - } - - var size = 0, - stats = extend({}, options, {id: cacheId}), - data = createMap(), - capacity = (options && options.capacity) || Number.MAX_VALUE, - lruHash = createMap(), - freshEnd = null, - staleEnd = null; - - /** - * @ngdoc type - * @name $cacheFactory.Cache - * - * @description - * A cache object used to store and retrieve data, primarily used by - * {@link $templateRequest $templateRequest} and the {@link ng.directive:script script} - * directive to cache templates and other data. - * - * ```js - * angular.module('superCache') - * .factory('superCache', ['$cacheFactory', function($cacheFactory) { - * return $cacheFactory('super-cache'); - * }]); - * ``` - * - * Example test: - * - * ```js - * it('should behave like a cache', inject(function(superCache) { - * superCache.put('key', 'value'); - * superCache.put('another key', 'another value'); - * - * expect(superCache.info()).toEqual({ - * id: 'super-cache', - * size: 2 - * }); - * - * superCache.remove('another key'); - * expect(superCache.get('another key')).toBeUndefined(); - * - * superCache.removeAll(); - * expect(superCache.info()).toEqual({ - * id: 'super-cache', - * size: 0 - * }); - * })); - * ``` - */ - return (caches[cacheId] = { - - /** - * @ngdoc method - * @name $cacheFactory.Cache#put - * @kind function - * - * @description - * Inserts a named entry into the {@link $cacheFactory.Cache Cache} object to be - * retrieved later, and incrementing the size of the cache if the key was not already - * present in the cache. If behaving like an LRU cache, it will also remove stale - * entries from the set. - * - * It will not insert undefined values into the cache. - * - * @param {string} key the key under which the cached data is stored. - * @param {*} value the value to store alongside the key. If it is undefined, the key - * will not be stored. - * @returns {*} the value stored. - */ - put: function(key, value) { - if (isUndefined(value)) return; - if (capacity < Number.MAX_VALUE) { - var lruEntry = lruHash[key] || (lruHash[key] = {key: key}); - - refresh(lruEntry); - } - - if (!(key in data)) size++; - data[key] = value; - - if (size > capacity) { - this.remove(staleEnd.key); - } - - return value; - }, - - /** - * @ngdoc method - * @name $cacheFactory.Cache#get - * @kind function - * - * @description - * Retrieves named data stored in the {@link $cacheFactory.Cache Cache} object. - * - * @param {string} key the key of the data to be retrieved - * @returns {*} the value stored. - */ - get: function(key) { - if (capacity < Number.MAX_VALUE) { - var lruEntry = lruHash[key]; - - if (!lruEntry) return; - - refresh(lruEntry); - } - - return data[key]; - }, - - - /** - * @ngdoc method - * @name $cacheFactory.Cache#remove - * @kind function - * - * @description - * Removes an entry from the {@link $cacheFactory.Cache Cache} object. - * - * @param {string} key the key of the entry to be removed - */ - remove: function(key) { - if (capacity < Number.MAX_VALUE) { - var lruEntry = lruHash[key]; - - if (!lruEntry) return; - - if (lruEntry === freshEnd) freshEnd = lruEntry.p; - if (lruEntry === staleEnd) staleEnd = lruEntry.n; - link(lruEntry.n,lruEntry.p); - - delete lruHash[key]; - } - - if (!(key in data)) return; - - delete data[key]; - size--; - }, - - - /** - * @ngdoc method - * @name $cacheFactory.Cache#removeAll - * @kind function - * - * @description - * Clears the cache object of any entries. - */ - removeAll: function() { - data = createMap(); - size = 0; - lruHash = createMap(); - freshEnd = staleEnd = null; - }, - - - /** - * @ngdoc method - * @name $cacheFactory.Cache#destroy - * @kind function - * - * @description - * Destroys the {@link $cacheFactory.Cache Cache} object entirely, - * removing it from the {@link $cacheFactory $cacheFactory} set. - */ - destroy: function() { - data = null; - stats = null; - lruHash = null; - delete caches[cacheId]; - }, - - - /** - * @ngdoc method - * @name $cacheFactory.Cache#info - * @kind function - * - * @description - * Retrieve information regarding a particular {@link $cacheFactory.Cache Cache}. - * - * @returns {object} an object with the following properties: - *
      - *
    • **id**: the id of the cache instance
    • - *
    • **size**: the number of entries kept in the cache instance
    • - *
    • **...**: any additional properties from the options object when creating the - * cache.
    • - *
    - */ - info: function() { - return extend({}, stats, {size: size}); - } - }); - - - /** - * makes the `entry` the freshEnd of the LRU linked list - */ - function refresh(entry) { - if (entry !== freshEnd) { - if (!staleEnd) { - staleEnd = entry; - } else if (staleEnd === entry) { - staleEnd = entry.n; - } - - link(entry.n, entry.p); - link(entry, freshEnd); - freshEnd = entry; - freshEnd.n = null; - } - } - - - /** - * bidirectionally links two entries of the LRU linked list - */ - function link(nextEntry, prevEntry) { - if (nextEntry !== prevEntry) { - if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify - if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify - } - } - } - - - /** - * @ngdoc method - * @name $cacheFactory#info - * - * @description - * Get information about all the caches that have been created - * - * @returns {Object} - key-value map of `cacheId` to the result of calling `cache#info` - */ - cacheFactory.info = function() { - var info = {}; - forEach(caches, function(cache, cacheId) { - info[cacheId] = cache.info(); - }); - return info; - }; - - - /** - * @ngdoc method - * @name $cacheFactory#get - * - * @description - * Get access to a cache object by the `cacheId` used when it was created. - * - * @param {string} cacheId Name or id of a cache to access. - * @returns {object} Cache object identified by the cacheId or undefined if no such cache. - */ - cacheFactory.get = function(cacheId) { - return caches[cacheId]; - }; - - - return cacheFactory; - }; - } - - /** - * @ngdoc service - * @name $templateCache - * @this - * - * @description - * `$templateCache` is a {@link $cacheFactory.Cache Cache object} created by the - * {@link ng.$cacheFactory $cacheFactory}. - * - * The first time a template is used, it is loaded in the template cache for quick retrieval. You - * can load templates directly into the cache in a `script` tag, by using {@link $templateRequest}, - * or by consuming the `$templateCache` service directly. - * - * Adding via the `script` tag: - * - * ```html - * - * ``` - * - * **Note:** the `script` tag containing the template does not need to be included in the `head` of - * the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (e.g. - * element with {@link ngApp} attribute), otherwise the template will be ignored. - * - * Adding via the `$templateCache` service: - * - * ```js - * var myApp = angular.module('myApp', []); - * myApp.run(function($templateCache) { - * $templateCache.put('templateId.html', 'This is the content of the template'); - * }); - * ``` - * - * To retrieve the template later, simply use it in your component: - * ```js - * myApp.component('myComponent', { - * templateUrl: 'templateId.html' - * }); - * ``` - * - * or get it via the `$templateCache` service: - * ```js - * $templateCache.get('templateId.html') - * ``` - * - */ - function $TemplateCacheProvider() { - this.$get = ['$cacheFactory', function($cacheFactory) { - return $cacheFactory('templates'); - }]; - } - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Any commits to this file should be reviewed with security in mind. * - * Changes to this file can potentially create security vulnerabilities. * - * An approval from 2 Core members with history of modifying * - * this file is required. * - * * - * Does the change somehow allow for arbitrary javascript to be executed? * - * Or allows for someone to change the prototype of built-in objects? * - * Or gives undesired access to variables like document or window? * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - /* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE! - * - * DOM-related variables: - * - * - "node" - DOM Node - * - "element" - DOM Element or Node - * - "$node" or "$element" - jqLite-wrapped node or element - * - * - * Compiler related stuff: - * - * - "linkFn" - linking fn of a single directive - * - "nodeLinkFn" - function that aggregates all linking fns for a particular node - * - "childLinkFn" - function that aggregates all linking fns for child nodes of a particular node - * - "compositeLinkFn" - function that aggregates all linking fns for a compilation root (nodeList) - */ - - - /** - * @ngdoc service - * @name $compile - * @kind function - * - * @description - * Compiles an HTML string or DOM into a template and produces a template function, which - * can then be used to link {@link ng.$rootScope.Scope `scope`} and the template together. - * - * The compilation is a process of walking the DOM tree and matching DOM elements to - * {@link ng.$compileProvider#directive directives}. - * - *
    - * **Note:** This document is an in-depth reference of all directive options. - * For a gentle introduction to directives with examples of common use cases, - * see the {@link guide/directive directive guide}. - *
    - * - * ## Comprehensive Directive API - * - * There are many different options for a directive. - * - * The difference resides in the return value of the factory function. - * You can either return a {@link $compile#directive-definition-object Directive Definition Object (see below)} - * that defines the directive properties, or just the `postLink` function (all other properties will have - * the default values). - * - *
    - * **Best Practice:** It's recommended to use the "directive definition object" form. - *
    - * - * Here's an example directive declared with a Directive Definition Object: - * - * ```js - * var myModule = angular.module(...); - * - * myModule.directive('directiveName', function factory(injectables) { - * var directiveDefinitionObject = { - * {@link $compile#-priority- priority}: 0, - * {@link $compile#-template- template}: '
    ', // or // function(tElement, tAttrs) { ... }, - * // or - * // {@link $compile#-templateurl- templateUrl}: 'directive.html', // or // function(tElement, tAttrs) { ... }, - * {@link $compile#-transclude- transclude}: false, - * {@link $compile#-restrict- restrict}: 'A', - * {@link $compile#-templatenamespace- templateNamespace}: 'html', - * {@link $compile#-scope- scope}: false, - * {@link $compile#-controller- controller}: function($scope, $element, $attrs, $transclude, otherInjectables) { ... }, - * {@link $compile#-controlleras- controllerAs}: 'stringIdentifier', - * {@link $compile#-bindtocontroller- bindToController}: false, - * {@link $compile#-require- require}: 'siblingDirectiveName', // or // ['^parentDirectiveName', '?optionalDirectiveName', '?^optionalParent'], - * {@link $compile#-multielement- multiElement}: false, - * {@link $compile#-compile- compile}: function compile(tElement, tAttrs, transclude) { - * return { - * {@link $compile#pre-linking-function pre}: function preLink(scope, iElement, iAttrs, controller) { ... }, - * {@link $compile#post-linking-function post}: function postLink(scope, iElement, iAttrs, controller) { ... } - * } - * // or - * // return function postLink( ... ) { ... } - * }, - * // or - * // {@link $compile#-link- link}: { - * // {@link $compile#pre-linking-function pre}: function preLink(scope, iElement, iAttrs, controller) { ... }, - * // {@link $compile#post-linking-function post}: function postLink(scope, iElement, iAttrs, controller) { ... } - * // } - * // or - * // {@link $compile#-link- link}: function postLink( ... ) { ... } - * }; - * return directiveDefinitionObject; - * }); - * ``` - * - *
    - * **Note:** Any unspecified options will use the default value. You can see the default values below. - *
    - * - * Therefore the above can be simplified as: - * - * ```js - * var myModule = angular.module(...); - * - * myModule.directive('directiveName', function factory(injectables) { - * var directiveDefinitionObject = { - * link: function postLink(scope, iElement, iAttrs) { ... } - * }; - * return directiveDefinitionObject; - * // or - * // return function postLink(scope, iElement, iAttrs) { ... } - * }); - * ``` - * - * ### Life-cycle hooks - * Directive controllers can provide the following methods that are called by AngularJS at points in the life-cycle of the - * directive: - * * `$onInit()` - Called on each controller after all the controllers on an element have been constructed and - * had their bindings initialized (and before the pre & post linking functions for the directives on - * this element). This is a good place to put initialization code for your controller. - * * `$onChanges(changesObj)` - Called whenever one-way (`<`) or interpolation (`@`) bindings are updated. The - * `changesObj` is a hash whose keys are the names of the bound properties that have changed, and the values are an - * object of the form `{ currentValue, previousValue, isFirstChange() }`. Use this hook to trigger updates within a - * component such as cloning the bound value to prevent accidental mutation of the outer value. Note that this will - * also be called when your bindings are initialized. - * * `$doCheck()` - Called on each turn of the digest cycle. Provides an opportunity to detect and act on - * changes. Any actions that you wish to take in response to the changes that you detect must be - * invoked from this hook; implementing this has no effect on when `$onChanges` is called. For example, this hook - * could be useful if you wish to perform a deep equality check, or to check a Date object, changes to which would not - * be detected by AngularJS's change detector and thus not trigger `$onChanges`. This hook is invoked with no arguments; - * if detecting changes, you must store the previous value(s) for comparison to the current values. - * * `$onDestroy()` - Called on a controller when its containing scope is destroyed. Use this hook for releasing - * external resources, watches and event handlers. Note that components have their `$onDestroy()` hooks called in - * the same order as the `$scope.$broadcast` events are triggered, which is top down. This means that parent - * components will have their `$onDestroy()` hook called before child components. - * * `$postLink()` - Called after this controller's element and its children have been linked. Similar to the post-link - * function this hook can be used to set up DOM event handlers and do direct DOM manipulation. - * Note that child elements that contain `templateUrl` directives will not have been compiled and linked since - * they are waiting for their template to load asynchronously and their own compilation and linking has been - * suspended until that occurs. - * - * #### Comparison with life-cycle hooks in the new Angular - * The new Angular also uses life-cycle hooks for its components. While the AngularJS life-cycle hooks are similar there are - * some differences that you should be aware of, especially when it comes to moving your code from AngularJS to Angular: - * - * * AngularJS hooks are prefixed with `$`, such as `$onInit`. Angular hooks are prefixed with `ng`, such as `ngOnInit`. - * * AngularJS hooks can be defined on the controller prototype or added to the controller inside its constructor. - * In Angular you can only define hooks on the prototype of the Component class. - * * Due to the differences in change-detection, you may get many more calls to `$doCheck` in AngularJS than you would to - * `ngDoCheck` in Angular. - * * Changes to the model inside `$doCheck` will trigger new turns of the digest loop, which will cause the changes to be - * propagated throughout the application. - * Angular does not allow the `ngDoCheck` hook to trigger a change outside of the component. It will either throw an - * error or do nothing depending upon the state of `enableProdMode()`. - * - * #### Life-cycle hook examples - * - * This example shows how you can check for mutations to a Date object even though the identity of the object - * has not changed. - * - * - * - * angular.module('do-check-module', []) - * .component('app', { - * template: - * 'Month: ' + - * 'Date: {{ $ctrl.date }}' + - * '', - * controller: function() { - * this.date = new Date(); - * this.month = this.date.getMonth(); - * this.updateDate = function() { - * this.date.setMonth(this.month); - * }; - * } - * }) - * .component('test', { - * bindings: { date: '<' }, - * template: - * '
    {{ $ctrl.log | json }}
    ', - * controller: function() { - * var previousValue; - * this.log = []; - * this.$doCheck = function() { - * var currentValue = this.date && this.date.valueOf(); - * if (previousValue !== currentValue) { - * this.log.push('doCheck: date mutated: ' + this.date); - * previousValue = currentValue; - * } - * }; - * } - * }); - *
    - * - * - * - *
    - * - * This example show how you might use `$doCheck` to trigger changes in your component's inputs even if the - * actual identity of the component doesn't change. (Be aware that cloning and deep equality checks on large - * arrays or objects can have a negative impact on your application performance) - * - * - * - *
    - * - * - *
    {{ items }}
    - * - *
    - *
    - * - * angular.module('do-check-module', []) - * .component('test', { - * bindings: { items: '<' }, - * template: - * '
    {{ $ctrl.log | json }}
    ', - * controller: function() { - * this.log = []; - * - * this.$doCheck = function() { - * if (this.items_ref !== this.items) { - * this.log.push('doCheck: items changed'); - * this.items_ref = this.items; - * } - * if (!angular.equals(this.items_clone, this.items)) { - * this.log.push('doCheck: items mutated'); - * this.items_clone = angular.copy(this.items); - * } - * }; - * } - * }); - *
    - *
    - * - * - * ### Directive Definition Object - * - * The directive definition object provides instructions to the {@link ng.$compile - * compiler}. The attributes are: - * - * #### `multiElement` - * When this property is set to true (default is `false`), the HTML compiler will collect DOM nodes between - * nodes with the attributes `directive-name-start` and `directive-name-end`, and group them - * together as the directive elements. It is recommended that this feature be used on directives - * which are not strictly behavioral (such as {@link ngClick}), and which - * do not manipulate or replace child nodes (such as {@link ngInclude}). - * - * #### `priority` - * When there are multiple directives defined on a single DOM element, sometimes it - * is necessary to specify the order in which the directives are applied. The `priority` is used - * to sort the directives before their `compile` functions get called. Priority is defined as a - * number. Directives with greater numerical `priority` are compiled first. Pre-link functions - * are also run in priority order, but post-link functions are run in reverse order. The order - * of directives with the same priority is undefined. The default priority is `0`. - * - * #### `terminal` - * If set to true then the current `priority` will be the last set of directives - * which will execute (any directives at the current priority will still execute - * as the order of execution on same `priority` is undefined). Note that expressions - * and other directives used in the directive's template will also be excluded from execution. - * - * #### `scope` - * The scope property can be `false`, `true`, or an object: - * - * * **`false` (default):** No scope will be created for the directive. The directive will use its - * parent's scope. - * - * * **`true`:** A new child scope that prototypically inherits from its parent will be created for - * the directive's element. If multiple directives on the same element request a new scope, - * only one new scope is created. - * - * * **`{...}` (an object hash):** A new "isolate" scope is created for the directive's template. - * The 'isolate' scope differs from normal scope in that it does not prototypically - * inherit from its parent scope. This is useful when creating reusable components, which should not - * accidentally read or modify data in the parent scope. Note that an isolate scope - * directive without a `template` or `templateUrl` will not apply the isolate scope - * to its children elements. - * - * The 'isolate' scope object hash defines a set of local scope properties derived from attributes on the - * directive's element. These local properties are useful for aliasing values for templates. The keys in - * the object hash map to the name of the property on the isolate scope; the values define how the property - * is bound to the parent scope, via matching attributes on the directive's element: - * - * * `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is - * always a string since DOM attributes are strings. If no `attr` name is specified then the - * attribute name is assumed to be the same as the local name. Given `` and the isolate scope definition `scope: { localName:'@myAttr' }`, - * the directive's scope property `localName` will reflect the interpolated value of `hello - * {{name}}`. As the `name` attribute changes so will the `localName` property on the directive's - * scope. The `name` is read from the parent scope (not the directive's scope). - * - * * `=` or `=attr` - set up a bidirectional binding between a local scope property and an expression - * passed via the attribute `attr`. The expression is evaluated in the context of the parent scope. - * If no `attr` name is specified then the attribute name is assumed to be the same as the local - * name. Given `` and the isolate scope definition `scope: { - * localModel: '=myAttr' }`, the property `localModel` on the directive's scope will reflect the - * value of `parentModel` on the parent scope. Changes to `parentModel` will be reflected in - * `localModel` and vice versa. Optional attributes should be marked as such with a question mark: - * `=?` or `=?attr`. If the binding expression is non-assignable, or if the attribute isn't - * optional and doesn't exist, an exception ({@link error/$compile/nonassign `$compile:nonassign`}) - * will be thrown upon discovering changes to the local value, since it will be impossible to sync - * them back to the parent scope. By default, the {@link ng.$rootScope.Scope#$watch `$watch`} - * method is used for tracking changes, and the equality check is based on object identity. - * However, if an object literal or an array literal is passed as the binding expression, the - * equality check is done by value (using the {@link angular.equals} function). It's also possible - * to watch the evaluated value shallowly with {@link ng.$rootScope.Scope#$watchCollection - * `$watchCollection`}: use `=*` or `=*attr` (`=*?` or `=*?attr` if the attribute is optional). - * - * * `<` or `` and directive definition of - * `scope: { localModel:'` and the isolate scope definition `scope: { - * localFn:'&myAttr' }`, the isolate scope property `localFn` will point to a function wrapper for - * the `count = count + value` expression. Often it's desirable to pass data from the isolated scope - * via an expression to the parent scope. This can be done by passing a map of local variable names - * and values into the expression wrapper fn. For example, if the expression is `increment(amount)` - * then we can specify the amount value by calling the `localFn` as `localFn({amount: 22})`. - * - * In general it's possible to apply more than one directive to one element, but there might be limitations - * depending on the type of scope required by the directives. The following points will help explain these limitations. - * For simplicity only two directives are taken into account, but it is also applicable for several directives: - * - * * **no scope** + **no scope** => Two directives which don't require their own scope will use their parent's scope - * * **child scope** + **no scope** => Both directives will share one single child scope - * * **child scope** + **child scope** => Both directives will share one single child scope - * * **isolated scope** + **no scope** => The isolated directive will use it's own created isolated scope. The other directive will use - * its parent's scope - * * **isolated scope** + **child scope** => **Won't work!** Only one scope can be related to one element. Therefore these directives cannot - * be applied to the same element. - * * **isolated scope** + **isolated scope** => **Won't work!** Only one scope can be related to one element. Therefore these directives - * cannot be applied to the same element. - * - * - * #### `bindToController` - * This property is used to bind scope properties directly to the controller. It can be either - * `true` or an object hash with the same format as the `scope` property. - * - * When an isolate scope is used for a directive (see above), `bindToController: true` will - * allow a component to have its properties bound to the controller, rather than to scope. - * - * After the controller is instantiated, the initial values of the isolate scope bindings will be bound to the controller - * properties. You can access these bindings once they have been initialized by providing a controller method called - * `$onInit`, which is called after all the controllers on an element have been constructed and had their bindings - * initialized. - * - *
    - * **Deprecation warning:** if `$compileProcvider.preAssignBindingsEnabled(true)` was called, bindings for non-ES6 class - * controllers are bound to `this` before the controller constructor is called but this use is now deprecated. Please - * place initialization code that relies upon bindings inside a `$onInit` method on the controller, instead. - *
    - * - * It is also possible to set `bindToController` to an object hash with the same format as the `scope` property. - * This will set up the scope bindings to the controller directly. Note that `scope` can still be used - * to define which kind of scope is created. By default, no scope is created. Use `scope: {}` to create an isolate - * scope (useful for component directives). - * - * If both `bindToController` and `scope` are defined and have object hashes, `bindToController` overrides `scope`. - * - * - * #### `controller` - * Controller constructor function. The controller is instantiated before the - * pre-linking phase and can be accessed by other directives (see - * `require` attribute). This allows the directives to communicate with each other and augment - * each other's behavior. The controller is injectable (and supports bracket notation) with the following locals: - * - * * `$scope` - Current scope associated with the element - * * `$element` - Current element - * * `$attrs` - Current attributes object for the element - * * `$transclude` - A transclude linking function pre-bound to the correct transclusion scope: - * `function([scope], cloneLinkingFn, futureParentElement, slotName)`: - * * `scope`: (optional) override the scope. - * * `cloneLinkingFn`: (optional) argument to create clones of the original transcluded content. - * * `futureParentElement` (optional): - * * defines the parent to which the `cloneLinkingFn` will add the cloned elements. - * * default: `$element.parent()` resp. `$element` for `transclude:'element'` resp. `transclude:true`. - * * only needed for transcludes that are allowed to contain non html elements (e.g. SVG elements) - * and when the `cloneLinkingFn` is passed, - * as those elements need to created and cloned in a special way when they are defined outside their - * usual containers (e.g. like ``). - * * See also the `directive.templateNamespace` property. - * * `slotName`: (optional) the name of the slot to transclude. If falsy (e.g. `null`, `undefined` or `''`) - * then the default transclusion is provided. - * The `$transclude` function also has a method on it, `$transclude.isSlotFilled(slotName)`, which returns - * `true` if the specified slot contains content (i.e. one or more DOM nodes). - * - * #### `require` - * Require another directive and inject its controller as the fourth argument to the linking function. The - * `require` property can be a string, an array or an object: - * * a **string** containing the name of the directive to pass to the linking function - * * an **array** containing the names of directives to pass to the linking function. The argument passed to the - * linking function will be an array of controllers in the same order as the names in the `require` property - * * an **object** whose property values are the names of the directives to pass to the linking function. The argument - * passed to the linking function will also be an object with matching keys, whose values will hold the corresponding - * controllers. - * - * If the `require` property is an object and `bindToController` is truthy, then the required controllers are - * bound to the controller using the keys of the `require` property. This binding occurs after all the controllers - * have been constructed but before `$onInit` is called. - * If the name of the required controller is the same as the local name (the key), the name can be - * omitted. For example, `{parentDir: '^^'}` is equivalent to `{parentDir: '^^parentDir'}`. - * See the {@link $compileProvider#component} helper for an example of how this can be used. - * If no such required directive(s) can be found, or if the directive does not have a controller, then an error is - * raised (unless no link function is specified and the required controllers are not being bound to the directive - * controller, in which case error checking is skipped). The name can be prefixed with: - * - * * (no prefix) - Locate the required controller on the current element. Throw an error if not found. - * * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found. - * * `^` - Locate the required controller by searching the element and its parents. Throw an error if not found. - * * `^^` - Locate the required controller by searching the element's parents. Throw an error if not found. - * * `?^` - Attempt to locate the required controller by searching the element and its parents or pass - * `null` to the `link` fn if not found. - * * `?^^` - Attempt to locate the required controller by searching the element's parents, or pass - * `null` to the `link` fn if not found. - * - * - * #### `controllerAs` - * Identifier name for a reference to the controller in the directive's scope. - * This allows the controller to be referenced from the directive template. This is especially - * useful when a directive is used as component, i.e. with an `isolate` scope. It's also possible - * to use it in a directive without an `isolate` / `new` scope, but you need to be aware that the - * `controllerAs` reference might overwrite a property that already exists on the parent scope. - * - * - * #### `restrict` - * String of subset of `EACM` which restricts the directive to a specific directive - * declaration style. If omitted, the defaults (elements and attributes) are used. - * - * * `E` - Element name (default): `` - * * `A` - Attribute (default): `
    ` - * * `C` - Class: `
    ` - * * `M` - Comment: `` - * - * - * #### `templateNamespace` - * String representing the document type used by the markup in the template. - * AngularJS needs this information as those elements need to be created and cloned - * in a special way when they are defined outside their usual containers like `` and ``. - * - * * `html` - All root nodes in the template are HTML. Root nodes may also be - * top-level elements such as `` or ``. - * * `svg` - The root nodes in the template are SVG elements (excluding ``). - * * `math` - The root nodes in the template are MathML elements (excluding ``). - * - * If no `templateNamespace` is specified, then the namespace is considered to be `html`. - * - * #### `template` - * HTML markup that may: - * * Replace the contents of the directive's element (default). - * * Replace the directive's element itself (if `replace` is true - DEPRECATED). - * * Wrap the contents of the directive's element (if `transclude` is true). - * - * Value may be: - * - * * A string. For example `
    {{delete_str}}
    `. - * * A function which takes two arguments `tElement` and `tAttrs` (described in the `compile` - * function api below) and returns a string value. - * - * - * #### `templateUrl` - * This is similar to `template` but the template is loaded from the specified URL, asynchronously. - * - * Because template loading is asynchronous the compiler will suspend compilation of directives on that element - * for later when the template has been resolved. In the meantime it will continue to compile and link - * sibling and parent elements as though this element had not contained any directives. - * - * The compiler does not suspend the entire compilation to wait for templates to be loaded because this - * would result in the whole app "stalling" until all templates are loaded asynchronously - even in the - * case when only one deeply nested directive has `templateUrl`. - * - * Template loading is asynchronous even if the template has been preloaded into the {@link $templateCache} - * - * You can specify `templateUrl` as a string representing the URL or as a function which takes two - * arguments `tElement` and `tAttrs` (described in the `compile` function api below) and returns - * a string value representing the url. In either case, the template URL is passed through {@link - * $sce#getTrustedResourceUrl $sce.getTrustedResourceUrl}. - * - * - * #### `replace` (*DEPRECATED*) - * - * `replace` will be removed in next major release - i.e. v2.0). - * - * Specifies what the template should replace. Defaults to `false`. - * - * * `true` - the template will replace the directive's element. - * * `false` - the template will replace the contents of the directive's element. - * - * The replacement process migrates all of the attributes / classes from the old element to the new - * one. See the {@link guide/directive#template-expanding-directive - * Directives Guide} for an example. - * - * There are very few scenarios where element replacement is required for the application function, - * the main one being reusable custom components that are used within SVG contexts - * (because SVG doesn't work with custom elements in the DOM tree). - * - * #### `transclude` - * Extract the contents of the element where the directive appears and make it available to the directive. - * The contents are compiled and provided to the directive as a **transclusion function**. See the - * {@link $compile#transclusion Transclusion} section below. - * - * - * #### `compile` - * - * ```js - * function compile(tElement, tAttrs, transclude) { ... } - * ``` - * - * The compile function deals with transforming the template DOM. Since most directives do not do - * template transformation, it is not used often. The compile function takes the following arguments: - * - * * `tElement` - template element - The element where the directive has been declared. It is - * safe to do template transformation on the element and child elements only. - * - * * `tAttrs` - template attributes - Normalized list of attributes declared on this element shared - * between all directive compile functions. - * - * * `transclude` - [*DEPRECATED*!] A transclude linking function: `function(scope, cloneLinkingFn)` - * - *
    - * **Note:** The template instance and the link instance may be different objects if the template has - * been cloned. For this reason it is **not** safe to do anything other than DOM transformations that - * apply to all cloned DOM nodes within the compile function. Specifically, DOM listener registration - * should be done in a linking function rather than in a compile function. - *
    - - *
    - * **Note:** The compile function cannot handle directives that recursively use themselves in their - * own templates or compile functions. Compiling these directives results in an infinite loop and - * stack overflow errors. - * - * This can be avoided by manually using $compile in the postLink function to imperatively compile - * a directive's template instead of relying on automatic template compilation via `template` or - * `templateUrl` declaration or manual compilation inside the compile function. - *
    - * - *
    - * **Note:** The `transclude` function that is passed to the compile function is deprecated, as it - * e.g. does not know about the right outer scope. Please use the transclude function that is passed - * to the link function instead. - *
    - - * A compile function can have a return value which can be either a function or an object. - * - * * returning a (post-link) function - is equivalent to registering the linking function via the - * `link` property of the config object when the compile function is empty. - * - * * returning an object with function(s) registered via `pre` and `post` properties - allows you to - * control when a linking function should be called during the linking phase. See info about - * pre-linking and post-linking functions below. - * - * - * #### `link` - * This property is used only if the `compile` property is not defined. - * - * ```js - * function link(scope, iElement, iAttrs, controller, transcludeFn) { ... } - * ``` - * - * The link function is responsible for registering DOM listeners as well as updating the DOM. It is - * executed after the template has been cloned. This is where most of the directive logic will be - * put. - * - * * `scope` - {@link ng.$rootScope.Scope Scope} - The scope to be used by the - * directive for registering {@link ng.$rootScope.Scope#$watch watches}. - * - * * `iElement` - instance element - The element where the directive is to be used. It is safe to - * manipulate the children of the element only in `postLink` function since the children have - * already been linked. - * - * * `iAttrs` - instance attributes - Normalized list of attributes declared on this element shared - * between all directive linking functions. - * - * * `controller` - the directive's required controller instance(s) - Instances are shared - * among all directives, which allows the directives to use the controllers as a communication - * channel. The exact value depends on the directive's `require` property: - * * no controller(s) required: the directive's own controller, or `undefined` if it doesn't have one - * * `string`: the controller instance - * * `array`: array of controller instances - * - * If a required controller cannot be found, and it is optional, the instance is `null`, - * otherwise the {@link error:$compile:ctreq Missing Required Controller} error is thrown. - * - * Note that you can also require the directive's own controller - it will be made available like - * any other controller. - * - * * `transcludeFn` - A transclude linking function pre-bound to the correct transclusion scope. - * This is the same as the `$transclude` parameter of directive controllers, - * see {@link ng.$compile#-controller- the controller section for details}. - * `function([scope], cloneLinkingFn, futureParentElement)`. - * - * #### Pre-linking function - * - * Executed before the child elements are linked. Not safe to do DOM transformation since the - * compiler linking function will fail to locate the correct elements for linking. - * - * #### Post-linking function - * - * Executed after the child elements are linked. - * - * Note that child elements that contain `templateUrl` directives will not have been compiled - * and linked since they are waiting for their template to load asynchronously and their own - * compilation and linking has been suspended until that occurs. - * - * It is safe to do DOM transformation in the post-linking function on elements that are not waiting - * for their async templates to be resolved. - * - * - * ### Transclusion - * - * Transclusion is the process of extracting a collection of DOM elements from one part of the DOM and - * copying them to another part of the DOM, while maintaining their connection to the original AngularJS - * scope from where they were taken. - * - * Transclusion is used (often with {@link ngTransclude}) to insert the - * original contents of a directive's element into a specified place in the template of the directive. - * The benefit of transclusion, over simply moving the DOM elements manually, is that the transcluded - * content has access to the properties on the scope from which it was taken, even if the directive - * has isolated scope. - * See the {@link guide/directive#creating-a-directive-that-wraps-other-elements Directives Guide}. - * - * This makes it possible for the widget to have private state for its template, while the transcluded - * content has access to its originating scope. - * - *
    - * **Note:** When testing an element transclude directive you must not place the directive at the root of the - * DOM fragment that is being compiled. See {@link guide/unit-testing#testing-transclusion-directives - * Testing Transclusion Directives}. - *
    - * - * There are three kinds of transclusion depending upon whether you want to transclude just the contents of the - * directive's element, the entire element or multiple parts of the element contents: - * - * * `true` - transclude the content (i.e. the child nodes) of the directive's element. - * * `'element'` - transclude the whole of the directive's element including any directives on this - * element that defined at a lower priority than this directive. When used, the `template` - * property is ignored. - * * **`{...}` (an object hash):** - map elements of the content onto transclusion "slots" in the template. - * - * **Mult-slot transclusion** is declared by providing an object for the `transclude` property. - * - * This object is a map where the keys are the name of the slot to fill and the value is an element selector - * used to match the HTML to the slot. The element selector should be in normalized form (e.g. `myElement`) - * and will match the standard element variants (e.g. `my-element`, `my:element`, `data-my-element`, etc). - * - * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives} - * - * If the element selector is prefixed with a `?` then that slot is optional. - * - * For example, the transclude object `{ slotA: '?myCustomElement' }` maps `` elements to - * the `slotA` slot, which can be accessed via the `$transclude` function or via the {@link ngTransclude} directive. - * - * Slots that are not marked as optional (`?`) will trigger a compile time error if there are no matching elements - * in the transclude content. If you wish to know if an optional slot was filled with content, then you can call - * `$transclude.isSlotFilled(slotName)` on the transclude function passed to the directive's link function and - * injectable into the directive's controller. - * - * - * #### Transclusion Functions - * - * When a directive requests transclusion, the compiler extracts its contents and provides a **transclusion - * function** to the directive's `link` function and `controller`. This transclusion function is a special - * **linking function** that will return the compiled contents linked to a new transclusion scope. - * - *
    - * If you are just using {@link ngTransclude} then you don't need to worry about this function, since - * ngTransclude will deal with it for us. - *
    - * - * If you want to manually control the insertion and removal of the transcluded content in your directive - * then you must use this transclude function. When you call a transclude function it returns a a jqLite/JQuery - * object that contains the compiled DOM, which is linked to the correct transclusion scope. - * - * When you call a transclusion function you can pass in a **clone attach function**. This function accepts - * two parameters, `function(clone, scope) { ... }`, where the `clone` is a fresh compiled copy of your transcluded - * content and the `scope` is the newly created transclusion scope, which the clone will be linked to. - * - *
    - * **Best Practice**: Always provide a `cloneFn` (clone attach function) when you call a transclude function - * since you then get a fresh clone of the original DOM and also have access to the new transclusion scope. - *
    - * - * It is normal practice to attach your transcluded content (`clone`) to the DOM inside your **clone - * attach function**: - * - * ```js - * var transcludedContent, transclusionScope; - * - * $transclude(function(clone, scope) { - * element.append(clone); - * transcludedContent = clone; - * transclusionScope = scope; - * }); - * ``` - * - * Later, if you want to remove the transcluded content from your DOM then you should also destroy the - * associated transclusion scope: - * - * ```js - * transcludedContent.remove(); - * transclusionScope.$destroy(); - * ``` - * - *
    - * **Best Practice**: if you intend to add and remove transcluded content manually in your directive - * (by calling the transclude function to get the DOM and calling `element.remove()` to remove it), - * then you are also responsible for calling `$destroy` on the transclusion scope. - *
    - * - * The built-in DOM manipulation directives, such as {@link ngIf}, {@link ngSwitch} and {@link ngRepeat} - * automatically destroy their transcluded clones as necessary so you do not need to worry about this if - * you are simply using {@link ngTransclude} to inject the transclusion into your directive. - * - * - * #### Transclusion Scopes - * - * When you call a transclude function it returns a DOM fragment that is pre-bound to a **transclusion - * scope**. This scope is special, in that it is a child of the directive's scope (and so gets destroyed - * when the directive's scope gets destroyed) but it inherits the properties of the scope from which it - * was taken. - * - * For example consider a directive that uses transclusion and isolated scope. The DOM hierarchy might look - * like this: - * - * ```html - *
    - *
    - *
    - *
    - *
    - *
    - * ``` - * - * The `$parent` scope hierarchy will look like this: - * - ``` - - $rootScope - - isolate - - transclusion - ``` - * - * but the scopes will inherit prototypically from different scopes to their `$parent`. - * - ``` - - $rootScope - - transclusion - - isolate - ``` - * - * - * ### Attributes - * - * The {@link ng.$compile.directive.Attributes Attributes} object - passed as a parameter in the - * `link()` or `compile()` functions. It has a variety of uses. - * - * * *Accessing normalized attribute names:* Directives like 'ngBind' can be expressed in many ways: - * 'ng:bind', `data-ng-bind`, or 'x-ng-bind'. The attributes object allows for normalized access - * to the attributes. - * - * * *Directive inter-communication:* All directives share the same instance of the attributes - * object which allows the directives to use the attributes object as inter directive - * communication. - * - * * *Supports interpolation:* Interpolation attributes are assigned to the attribute object - * allowing other directives to read the interpolated value. - * - * * *Observing interpolated attributes:* Use `$observe` to observe the value changes of attributes - * that contain interpolation (e.g. `src="{{bar}}"`). Not only is this very efficient but it's also - * the only way to easily get the actual value because during the linking phase the interpolation - * hasn't been evaluated yet and so the value is at this time set to `undefined`. - * - * ```js - * function linkingFn(scope, elm, attrs, ctrl) { - * // get the attribute value - * console.log(attrs.ngModel); - * - * // change the attribute - * attrs.$set('ngModel', 'new value'); - * - * // observe changes to interpolated attribute - * attrs.$observe('ngModel', function(value) { - * console.log('ngModel has changed value to ' + value); - * }); - * } - * ``` - * - * ## Example - * - *
    - * **Note**: Typically directives are registered with `module.directive`. The example below is - * to illustrate how `$compile` works. - *
    - * - - - -
    -
    -
    -
    -
    -
    - - it('should auto compile', function() { - var textarea = $('textarea'); - var output = $('div[compile]'); - // The initial state reads 'Hello AngularJS'. - expect(output.getText()).toBe('Hello AngularJS'); - textarea.clear(); - textarea.sendKeys('{{name}}!'); - expect(output.getText()).toBe('AngularJS!'); - }); - -
    - - * - * - * @param {string|DOMElement} element Element or HTML string to compile into a template function. - * @param {function(angular.Scope, cloneAttachFn=)} transclude function available to directives - DEPRECATED. - * - *
    - * **Note:** Passing a `transclude` function to the $compile function is deprecated, as it - * e.g. will not use the right outer scope. Please pass the transclude function as a - * `parentBoundTranscludeFn` to the link function instead. - *
    - * - * @param {number} maxPriority only apply directives lower than given priority (Only effects the - * root element(s), not their children) - * @returns {function(scope, cloneAttachFn=, options=)} a link function which is used to bind template - * (a DOM element/tree) to a scope. Where: - * - * * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to. - * * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the - * `template` and call the `cloneAttachFn` function allowing the caller to attach the - * cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is - * called as:
    `cloneAttachFn(clonedElement, scope)` where: - * - * * `clonedElement` - is a clone of the original `element` passed into the compiler. - * * `scope` - is the current scope with which the linking function is working with. - * - * * `options` - An optional object hash with linking options. If `options` is provided, then the following - * keys may be used to control linking behavior: - * - * * `parentBoundTranscludeFn` - the transclude function made available to - * directives; if given, it will be passed through to the link functions of - * directives found in `element` during compilation. - * * `transcludeControllers` - an object hash with keys that map controller names - * to a hash with the key `instance`, which maps to the controller instance; - * if given, it will make the controllers available to directives on the compileNode: - * ``` - * { - * parent: { - * instance: parentControllerInstance - * } - * } - * ``` - * * `futureParentElement` - defines the parent to which the `cloneAttachFn` will add - * the cloned elements; only needed for transcludes that are allowed to contain non html - * elements (e.g. SVG elements). See also the directive.controller property. - * - * Calling the linking function returns the element of the template. It is either the original - * element passed in, or the clone of the element if the `cloneAttachFn` is provided. - * - * After linking the view is not updated until after a call to $digest which typically is done by - * AngularJS automatically. - * - * If you need access to the bound view, there are two ways to do it: - * - * - If you are not asking the linking function to clone the template, create the DOM element(s) - * before you send them to the compiler and keep this reference around. - * ```js - * var element = $compile('

    {{total}}

    ')(scope); - * ``` - * - * - if on the other hand, you need the element to be cloned, the view reference from the original - * example would not point to the clone, but rather to the original template that was cloned. In - * this case, you can access the clone via the cloneAttachFn: - * ```js - * var templateElement = angular.element('

    {{total}}

    '), - * scope = ....; - * - * var clonedElement = $compile(templateElement)(scope, function(clonedElement, scope) { - * //attach the clone to DOM document at the right place - * }); - * - * //now we have reference to the cloned DOM via `clonedElement` - * ``` - * - * - * For information on how the compiler works, see the - * {@link guide/compiler AngularJS HTML Compiler} section of the Developer Guide. - * - * @knownIssue - * - * ### Double Compilation - * - Double compilation occurs when an already compiled part of the DOM gets - compiled again. This is an undesired effect and can lead to misbehaving directives, performance issues, - and memory leaks. Refer to the Compiler Guide {@link guide/compiler#double-compilation-and-how-to-avoid-it - section on double compilation} for an in-depth explanation and ways to avoid it. - * - */ - - var $compileMinErr = minErr('$compile'); - - function UNINITIALIZED_VALUE() {} - var _UNINITIALIZED_VALUE = new UNINITIALIZED_VALUE(); - - /** - * @ngdoc provider - * @name $compileProvider - * - * @description - */ - $CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider']; - /** @this */ - function $CompileProvider($provide, $$sanitizeUriProvider) { - var hasDirectives = {}, - Suffix = 'Directive', - COMMENT_DIRECTIVE_REGEXP = /^\s*directive:\s*([\w-]+)\s+(.*)$/, - CLASS_DIRECTIVE_REGEXP = /(([\w-]+)(?::([^;]+))?;?)/, - ALL_OR_NOTHING_ATTRS = makeMap('ngSrc,ngSrcset,src,srcset'), - REQUIRE_PREFIX_REGEXP = /^(?:(\^\^?)?(\?)?(\^\^?)?)?/; - - // Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes - // The assumption is that future DOM event attribute names will begin with - // 'on' and be composed of only English letters. - var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/; - var bindingCache = createMap(); - - function parseIsolateBindings(scope, directiveName, isController) { - var LOCAL_REGEXP = /^\s*([@&<]|=(\*?))(\??)\s*([\w$]*)\s*$/; - - var bindings = createMap(); - - forEach(scope, function(definition, scopeName) { - if (definition in bindingCache) { - bindings[scopeName] = bindingCache[definition]; - return; - } - var match = definition.match(LOCAL_REGEXP); - - if (!match) { - throw $compileMinErr('iscp', - 'Invalid {3} for directive \'{0}\'.' + - ' Definition: {... {1}: \'{2}\' ...}', - directiveName, scopeName, definition, - (isController ? 'controller bindings definition' : - 'isolate scope definition')); - } - - bindings[scopeName] = { - mode: match[1][0], - collection: match[2] === '*', - optional: match[3] === '?', - attrName: match[4] || scopeName - }; - if (match[4]) { - bindingCache[definition] = bindings[scopeName]; - } - }); - - return bindings; - } - - function parseDirectiveBindings(directive, directiveName) { - var bindings = { - isolateScope: null, - bindToController: null - }; - if (isObject(directive.scope)) { - if (directive.bindToController === true) { - bindings.bindToController = parseIsolateBindings(directive.scope, - directiveName, true); - bindings.isolateScope = {}; - } else { - bindings.isolateScope = parseIsolateBindings(directive.scope, - directiveName, false); - } - } - if (isObject(directive.bindToController)) { - bindings.bindToController = - parseIsolateBindings(directive.bindToController, directiveName, true); - } - if (bindings.bindToController && !directive.controller) { - // There is no controller - throw $compileMinErr('noctrl', - 'Cannot bind to controller without directive \'{0}\'s controller.', - directiveName); - } - return bindings; - } - - function assertValidDirectiveName(name) { - var letter = name.charAt(0); - if (!letter || letter !== lowercase(letter)) { - throw $compileMinErr('baddir', 'Directive/Component name \'{0}\' is invalid. The first character must be a lowercase letter', name); - } - if (name !== name.trim()) { - throw $compileMinErr('baddir', - 'Directive/Component name \'{0}\' is invalid. The name should not contain leading or trailing whitespaces', - name); - } - } - - function getDirectiveRequire(directive) { - var require = directive.require || (directive.controller && directive.name); - - if (!isArray(require) && isObject(require)) { - forEach(require, function(value, key) { - var match = value.match(REQUIRE_PREFIX_REGEXP); - var name = value.substring(match[0].length); - if (!name) require[key] = match[0] + key; - }); - } - - return require; - } - - function getDirectiveRestrict(restrict, name) { - if (restrict && !(isString(restrict) && /[EACM]/.test(restrict))) { - throw $compileMinErr('badrestrict', - 'Restrict property \'{0}\' of directive \'{1}\' is invalid', - restrict, - name); - } - - return restrict || 'EA'; - } - - /** - * @ngdoc method - * @name $compileProvider#directive - * @kind function - * - * @description - * Register a new directive with the compiler. - * - * @param {string|Object} name Name of the directive in camel-case (i.e. ngBind which - * will match as ng-bind), or an object map of directives where the keys are the - * names and the values are the factories. - * @param {Function|Array} directiveFactory An injectable directive factory function. See the - * {@link guide/directive directive guide} and the {@link $compile compile API} for more info. - * @returns {ng.$compileProvider} Self for chaining. - */ - this.directive = function registerDirective(name, directiveFactory) { - assertArg(name, 'name'); - assertNotHasOwnProperty(name, 'directive'); - if (isString(name)) { - assertValidDirectiveName(name); - assertArg(directiveFactory, 'directiveFactory'); - if (!hasDirectives.hasOwnProperty(name)) { - hasDirectives[name] = []; - $provide.factory(name + Suffix, ['$injector', '$exceptionHandler', - function($injector, $exceptionHandler) { - var directives = []; - forEach(hasDirectives[name], function(directiveFactory, index) { - try { - var directive = $injector.invoke(directiveFactory); - if (isFunction(directive)) { - directive = { compile: valueFn(directive) }; - } else if (!directive.compile && directive.link) { - directive.compile = valueFn(directive.link); - } - directive.priority = directive.priority || 0; - directive.index = index; - directive.name = directive.name || name; - directive.require = getDirectiveRequire(directive); - directive.restrict = getDirectiveRestrict(directive.restrict, name); - directive.$$moduleName = directiveFactory.$$moduleName; - directives.push(directive); - } catch (e) { - $exceptionHandler(e); - } - }); - return directives; - }]); - } - hasDirectives[name].push(directiveFactory); - } else { - forEach(name, reverseParams(registerDirective)); - } - return this; - }; - - /** - * @ngdoc method - * @name $compileProvider#component - * @module ng - * @param {string|Object} name Name of the component in camelCase (i.e. `myComp` which will match ``), - * or an object map of components where the keys are the names and the values are the component definition objects. - * @param {Object} options Component definition object (a simplified - * {@link ng.$compile#directive-definition-object directive definition object}), - * with the following properties (all optional): - * - * - `controller` – `{(string|function()=}` – controller constructor function that should be - * associated with newly created scope or the name of a {@link ng.$compile#-controller- - * registered controller} if passed as a string. An empty `noop` function by default. - * - `controllerAs` – `{string=}` – identifier name for to reference the controller in the component's scope. - * If present, the controller will be published to scope under the `controllerAs` name. - * If not present, this will default to be `$ctrl`. - * - `template` – `{string=|function()=}` – html template as a string or a function that - * returns an html template as a string which should be used as the contents of this component. - * Empty string by default. - * - * If `template` is a function, then it is {@link auto.$injector#invoke injected} with - * the following locals: - * - * - `$element` - Current element - * - `$attrs` - Current attributes object for the element - * - * - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html - * template that should be used as the contents of this component. - * - * If `templateUrl` is a function, then it is {@link auto.$injector#invoke injected} with - * the following locals: - * - * - `$element` - Current element - * - `$attrs` - Current attributes object for the element - * - * - `bindings` – `{object=}` – defines bindings between DOM attributes and component properties. - * Component properties are always bound to the component controller and not to the scope. - * See {@link ng.$compile#-bindtocontroller- `bindToController`}. - * - `transclude` – `{boolean=}` – whether {@link $compile#transclusion content transclusion} is enabled. - * Disabled by default. - * - `require` - `{Object=}` - requires the controllers of other directives and binds them to - * this component's controller. The object keys specify the property names under which the required - * controllers (object values) will be bound. See {@link ng.$compile#-require- `require`}. - * - `$...` – additional properties to attach to the directive factory function and the controller - * constructor function. (This is used by the component router to annotate) - * - * @returns {ng.$compileProvider} the compile provider itself, for chaining of function calls. - * @description - * Register a **component definition** with the compiler. This is a shorthand for registering a special - * type of directive, which represents a self-contained UI component in your application. Such components - * are always isolated (i.e. `scope: {}`) and are always restricted to elements (i.e. `restrict: 'E'`). - * - * Component definitions are very simple and do not require as much configuration as defining general - * directives. Component definitions usually consist only of a template and a controller backing it. - * - * In order to make the definition easier, components enforce best practices like use of `controllerAs`, - * `bindToController`. They always have **isolate scope** and are restricted to elements. - * - * Here are a few examples of how you would usually define components: - * - * ```js - * var myMod = angular.module(...); - * myMod.component('myComp', { - * template: '
    My name is {{$ctrl.name}}
    ', - * controller: function() { - * this.name = 'shahar'; - * } - * }); - * - * myMod.component('myComp', { - * template: '
    My name is {{$ctrl.name}}
    ', - * bindings: {name: '@'} - * }); - * - * myMod.component('myComp', { - * templateUrl: 'views/my-comp.html', - * controller: 'MyCtrl', - * controllerAs: 'ctrl', - * bindings: {name: '@'} - * }); - * - * ``` - * For more examples, and an in-depth guide, see the {@link guide/component component guide}. - * - *
    - * See also {@link ng.$compileProvider#directive $compileProvider.directive()}. - */ - this.component = function registerComponent(name, options) { - if (!isString(name)) { - forEach(name, reverseParams(bind(this, registerComponent))); - return this; - } - - var controller = options.controller || function() {}; - - function factory($injector) { - function makeInjectable(fn) { - if (isFunction(fn) || isArray(fn)) { - return /** @this */ function(tElement, tAttrs) { - return $injector.invoke(fn, this, {$element: tElement, $attrs: tAttrs}); - }; - } else { - return fn; - } - } - - var template = (!options.template && !options.templateUrl ? '' : options.template); - var ddo = { - controller: controller, - controllerAs: identifierForController(options.controller) || options.controllerAs || '$ctrl', - template: makeInjectable(template), - templateUrl: makeInjectable(options.templateUrl), - transclude: options.transclude, - scope: {}, - bindToController: options.bindings || {}, - restrict: 'E', - require: options.require - }; - - // Copy annotations (starting with $) over to the DDO - forEach(options, function(val, key) { - if (key.charAt(0) === '$') ddo[key] = val; - }); - - return ddo; - } - - // TODO(pete) remove the following `forEach` before we release 1.6.0 - // The component-router@0.2.0 looks for the annotations on the controller constructor - // Nothing in AngularJS looks for annotations on the factory function but we can't remove - // it from 1.5.x yet. - - // Copy any annotation properties (starting with $) over to the factory and controller constructor functions - // These could be used by libraries such as the new component router - forEach(options, function(val, key) { - if (key.charAt(0) === '$') { - factory[key] = val; - // Don't try to copy over annotations to named controller - if (isFunction(controller)) controller[key] = val; - } - }); - - factory.$inject = ['$injector']; - - return this.directive(name, factory); - }; - - - /** - * @ngdoc method - * @name $compileProvider#aHrefSanitizationWhitelist - * @kind function - * - * @description - * Retrieves or overrides the default regular expression that is used for whitelisting of safe - * urls during a[href] sanitization. - * - * The sanitization is a security measure aimed at preventing XSS attacks via html links. - * - * Any url about to be assigned to a[href] via data-binding is first normalized and turned into - * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist` - * regular expression. If a match is found, the original url is written into the dom. Otherwise, - * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. - * - * @param {RegExp=} regexp New regexp to whitelist urls with. - * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for - * chaining otherwise. - */ - this.aHrefSanitizationWhitelist = function(regexp) { - if (isDefined(regexp)) { - $$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp); - return this; - } else { - return $$sanitizeUriProvider.aHrefSanitizationWhitelist(); - } - }; - - - /** - * @ngdoc method - * @name $compileProvider#imgSrcSanitizationWhitelist - * @kind function - * - * @description - * Retrieves or overrides the default regular expression that is used for whitelisting of safe - * urls during img[src] sanitization. - * - * The sanitization is a security measure aimed at prevent XSS attacks via html links. - * - * Any url about to be assigned to img[src] via data-binding is first normalized and turned into - * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist` - * regular expression. If a match is found, the original url is written into the dom. Otherwise, - * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. - * - * @param {RegExp=} regexp New regexp to whitelist urls with. - * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for - * chaining otherwise. - */ - this.imgSrcSanitizationWhitelist = function(regexp) { - if (isDefined(regexp)) { - $$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp); - return this; - } else { - return $$sanitizeUriProvider.imgSrcSanitizationWhitelist(); - } - }; - - /** - * @ngdoc method - * @name $compileProvider#debugInfoEnabled - * - * @param {boolean=} enabled update the debugInfoEnabled state if provided, otherwise just return the - * current debugInfoEnabled state - * @returns {*} current value if used as getter or itself (chaining) if used as setter - * - * @kind function - * - * @description - * Call this method to enable/disable various debug runtime information in the compiler such as adding - * binding information and a reference to the current scope on to DOM elements. - * If enabled, the compiler will add the following to DOM elements that have been bound to the scope - * * `ng-binding` CSS class - * * `ng-scope` and `ng-isolated-scope` CSS classes - * * `$binding` data property containing an array of the binding expressions - * * Data properties used by the {@link angular.element#methods `scope()`/`isolateScope()` methods} to return - * the element's scope. - * * Placeholder comments will contain information about what directive and binding caused the placeholder. - * E.g. ``. - * - * You may want to disable this in production for a significant performance boost. See - * {@link guide/production#disabling-debug-data Disabling Debug Data} for more. - * - * The default value is true. - */ - var debugInfoEnabled = true; - this.debugInfoEnabled = function(enabled) { - if (isDefined(enabled)) { - debugInfoEnabled = enabled; - return this; - } - return debugInfoEnabled; - }; - - /** - * @ngdoc method - * @name $compileProvider#preAssignBindingsEnabled - * - * @param {boolean=} enabled update the preAssignBindingsEnabled state if provided, otherwise just return the - * current preAssignBindingsEnabled state - * @returns {*} current value if used as getter or itself (chaining) if used as setter - * - * @kind function - * - * @description - * Call this method to enable/disable whether directive controllers are assigned bindings before - * calling the controller's constructor. - * If enabled (true), the compiler assigns the value of each of the bindings to the - * properties of the controller object before the constructor of this object is called. - * - * If disabled (false), the compiler calls the constructor first before assigning bindings. - * - * The default value is false. - * - * @deprecated - * sinceVersion="1.6.0" - * removeVersion="1.7.0" - * - * This method and the option to assign the bindings before calling the controller's constructor - * will be removed in v1.7.0. - */ - var preAssignBindingsEnabled = false; - this.preAssignBindingsEnabled = function(enabled) { - if (isDefined(enabled)) { - preAssignBindingsEnabled = enabled; - return this; - } - return preAssignBindingsEnabled; - }; - - /** - * @ngdoc method - * @name $compileProvider#strictComponentBindingsEnabled - * - * @param {boolean=} enabled update the strictComponentBindingsEnabled state if provided, otherwise just return the - * current strictComponentBindingsEnabled state - * @returns {*} current value if used as getter or itself (chaining) if used as setter - * - * @kind function - * - * @description - * Call this method to enable/disable strict component bindings check. If enabled, the compiler will enforce that - * for all bindings of a component that are not set as optional with `?`, an attribute needs to be provided - * on the component's HTML tag. - * - * The default value is false. - */ - var strictComponentBindingsEnabled = false; - this.strictComponentBindingsEnabled = function(enabled) { - if (isDefined(enabled)) { - strictComponentBindingsEnabled = enabled; - return this; - } - return strictComponentBindingsEnabled; - }; - - var TTL = 10; - /** - * @ngdoc method - * @name $compileProvider#onChangesTtl - * @description - * - * Sets the number of times `$onChanges` hooks can trigger new changes before giving up and - * assuming that the model is unstable. - * - * The current default is 10 iterations. - * - * In complex applications it's possible that dependencies between `$onChanges` hooks and bindings will result - * in several iterations of calls to these hooks. However if an application needs more than the default 10 - * iterations to stabilize then you should investigate what is causing the model to continuously change during - * the `$onChanges` hook execution. - * - * Increasing the TTL could have performance implications, so you should not change it without proper justification. - * - * @param {number} limit The number of `$onChanges` hook iterations. - * @returns {number|object} the current limit (or `this` if called as a setter for chaining) - */ - this.onChangesTtl = function(value) { - if (arguments.length) { - TTL = value; - return this; - } - return TTL; - }; - - var commentDirectivesEnabledConfig = true; - /** - * @ngdoc method - * @name $compileProvider#commentDirectivesEnabled - * @description - * - * It indicates to the compiler - * whether or not directives on comments should be compiled. - * Defaults to `true`. - * - * Calling this function with false disables the compilation of directives - * on comments for the whole application. - * This results in a compilation performance gain, - * as the compiler doesn't have to check comments when looking for directives. - * This should however only be used if you are sure that no comment directives are used in - * the application (including any 3rd party directives). - * - * @param {boolean} enabled `false` if the compiler may ignore directives on comments - * @returns {boolean|object} the current value (or `this` if called as a setter for chaining) - */ - this.commentDirectivesEnabled = function(value) { - if (arguments.length) { - commentDirectivesEnabledConfig = value; - return this; - } - return commentDirectivesEnabledConfig; - }; - - - var cssClassDirectivesEnabledConfig = true; - /** - * @ngdoc method - * @name $compileProvider#cssClassDirectivesEnabled - * @description - * - * It indicates to the compiler - * whether or not directives on element classes should be compiled. - * Defaults to `true`. - * - * Calling this function with false disables the compilation of directives - * on element classes for the whole application. - * This results in a compilation performance gain, - * as the compiler doesn't have to check element classes when looking for directives. - * This should however only be used if you are sure that no class directives are used in - * the application (including any 3rd party directives). - * - * @param {boolean} enabled `false` if the compiler may ignore directives on element classes - * @returns {boolean|object} the current value (or `this` if called as a setter for chaining) - */ - this.cssClassDirectivesEnabled = function(value) { - if (arguments.length) { - cssClassDirectivesEnabledConfig = value; - return this; - } - return cssClassDirectivesEnabledConfig; - }; - - this.$get = [ - '$injector', '$interpolate', '$exceptionHandler', '$templateRequest', '$parse', - '$controller', '$rootScope', '$sce', '$animate', '$$sanitizeUri', - function($injector, $interpolate, $exceptionHandler, $templateRequest, $parse, - $controller, $rootScope, $sce, $animate, $$sanitizeUri) { - - var SIMPLE_ATTR_NAME = /^\w/; - var specialAttrHolder = window.document.createElement('div'); - - - var commentDirectivesEnabled = commentDirectivesEnabledConfig; - var cssClassDirectivesEnabled = cssClassDirectivesEnabledConfig; - - - var onChangesTtl = TTL; - // The onChanges hooks should all be run together in a single digest - // When changes occur, the call to trigger their hooks will be added to this queue - var onChangesQueue; - - // This function is called in a $$postDigest to trigger all the onChanges hooks in a single digest - function flushOnChangesQueue() { - try { - if (!(--onChangesTtl)) { - // We have hit the TTL limit so reset everything - onChangesQueue = undefined; - throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\n', TTL); - } - // We must run this hook in an apply since the $$postDigest runs outside apply - $rootScope.$apply(function() { - var errors = []; - for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) { - try { - onChangesQueue[i](); - } catch (e) { - errors.push(e); - } - } - // Reset the queue to trigger a new schedule next time there is a change - onChangesQueue = undefined; - if (errors.length) { - throw errors; - } - }); - } finally { - onChangesTtl++; - } - } - - - function Attributes(element, attributesToCopy) { - if (attributesToCopy) { - var keys = Object.keys(attributesToCopy); - var i, l, key; - - for (i = 0, l = keys.length; i < l; i++) { - key = keys[i]; - this[key] = attributesToCopy[key]; - } - } else { - this.$attr = {}; - } - - this.$$element = element; - } - - Attributes.prototype = { - /** - * @ngdoc method - * @name $compile.directive.Attributes#$normalize - * @kind function - * - * @description - * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with `x-` or - * `data-`) to its normalized, camelCase form. - * - * Also there is special case for Moz prefix starting with upper case letter. - * - * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives} - * - * @param {string} name Name to normalize - */ - $normalize: directiveNormalize, - - - /** - * @ngdoc method - * @name $compile.directive.Attributes#$addClass - * @kind function - * - * @description - * Adds the CSS class value specified by the classVal parameter to the element. If animations - * are enabled then an animation will be triggered for the class addition. - * - * @param {string} classVal The className value that will be added to the element - */ - $addClass: function(classVal) { - if (classVal && classVal.length > 0) { - $animate.addClass(this.$$element, classVal); - } - }, - - /** - * @ngdoc method - * @name $compile.directive.Attributes#$removeClass - * @kind function - * - * @description - * Removes the CSS class value specified by the classVal parameter from the element. If - * animations are enabled then an animation will be triggered for the class removal. - * - * @param {string} classVal The className value that will be removed from the element - */ - $removeClass: function(classVal) { - if (classVal && classVal.length > 0) { - $animate.removeClass(this.$$element, classVal); - } - }, - - /** - * @ngdoc method - * @name $compile.directive.Attributes#$updateClass - * @kind function - * - * @description - * Adds and removes the appropriate CSS class values to the element based on the difference - * between the new and old CSS class values (specified as newClasses and oldClasses). - * - * @param {string} newClasses The current CSS className value - * @param {string} oldClasses The former CSS className value - */ - $updateClass: function(newClasses, oldClasses) { - var toAdd = tokenDifference(newClasses, oldClasses); - if (toAdd && toAdd.length) { - $animate.addClass(this.$$element, toAdd); - } - - var toRemove = tokenDifference(oldClasses, newClasses); - if (toRemove && toRemove.length) { - $animate.removeClass(this.$$element, toRemove); - } - }, - - /** - * Set a normalized attribute on the element in a way such that all directives - * can share the attribute. This function properly handles boolean attributes. - * @param {string} key Normalized key. (ie ngAttribute) - * @param {string|boolean} value The value to set. If `null` attribute will be deleted. - * @param {boolean=} writeAttr If false, does not write the value to DOM element attribute. - * Defaults to true. - * @param {string=} attrName Optional none normalized name. Defaults to key. - */ - $set: function(key, value, writeAttr, attrName) { - // TODO: decide whether or not to throw an error if "class" - //is set through this function since it may cause $updateClass to - //become unstable. - - var node = this.$$element[0], - booleanKey = getBooleanAttrName(node, key), - aliasedKey = getAliasedAttrName(key), - observer = key, - nodeName; - - if (booleanKey) { - this.$$element.prop(key, value); - attrName = booleanKey; - } else if (aliasedKey) { - this[aliasedKey] = value; - observer = aliasedKey; - } - - this[key] = value; - - // translate normalized key to actual key - if (attrName) { - this.$attr[key] = attrName; - } else { - attrName = this.$attr[key]; - if (!attrName) { - this.$attr[key] = attrName = snake_case(key, '-'); - } - } - - nodeName = nodeName_(this.$$element); - - if ((nodeName === 'a' && (key === 'href' || key === 'xlinkHref')) || - (nodeName === 'img' && key === 'src')) { - // sanitize a[href] and img[src] values - this[key] = value = $$sanitizeUri(value, key === 'src'); - } else if (nodeName === 'img' && key === 'srcset' && isDefined(value)) { - // sanitize img[srcset] values - var result = ''; - - // first check if there are spaces because it's not the same pattern - var trimmedSrcset = trim(value); - // ( 999x ,| 999w ,| ,|, ) - var srcPattern = /(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/; - var pattern = /\s/.test(trimmedSrcset) ? srcPattern : /(,)/; - - // split srcset into tuple of uri and descriptor except for the last item - var rawUris = trimmedSrcset.split(pattern); - - // for each tuples - var nbrUrisWith2parts = Math.floor(rawUris.length / 2); - for (var i = 0; i < nbrUrisWith2parts; i++) { - var innerIdx = i * 2; - // sanitize the uri - result += $$sanitizeUri(trim(rawUris[innerIdx]), true); - // add the descriptor - result += (' ' + trim(rawUris[innerIdx + 1])); - } - - // split the last item into uri and descriptor - var lastTuple = trim(rawUris[i * 2]).split(/\s/); - - // sanitize the last uri - result += $$sanitizeUri(trim(lastTuple[0]), true); - - // and add the last descriptor if any - if (lastTuple.length === 2) { - result += (' ' + trim(lastTuple[1])); - } - this[key] = value = result; - } - - if (writeAttr !== false) { - if (value === null || isUndefined(value)) { - this.$$element.removeAttr(attrName); - } else { - if (SIMPLE_ATTR_NAME.test(attrName)) { - this.$$element.attr(attrName, value); - } else { - setSpecialAttr(this.$$element[0], attrName, value); - } - } - } - - // fire observers - var $$observers = this.$$observers; - if ($$observers) { - forEach($$observers[observer], function(fn) { - try { - fn(value); - } catch (e) { - $exceptionHandler(e); - } - }); - } - }, - - - /** - * @ngdoc method - * @name $compile.directive.Attributes#$observe - * @kind function - * - * @description - * Observes an interpolated attribute. - * - * The observer function will be invoked once during the next `$digest` following - * compilation. The observer is then invoked whenever the interpolated value - * changes. - * - * @param {string} key Normalized key. (ie ngAttribute) . - * @param {function(interpolatedValue)} fn Function that will be called whenever - the interpolated value of the attribute changes. - * See the {@link guide/interpolation#how-text-and-attribute-bindings-work Interpolation - * guide} for more info. - * @returns {function()} Returns a deregistration function for this observer. - */ - $observe: function(key, fn) { - var attrs = this, - $$observers = (attrs.$$observers || (attrs.$$observers = createMap())), - listeners = ($$observers[key] || ($$observers[key] = [])); - - listeners.push(fn); - $rootScope.$evalAsync(function() { - if (!listeners.$$inter && attrs.hasOwnProperty(key) && !isUndefined(attrs[key])) { - // no one registered attribute interpolation function, so lets call it manually - fn(attrs[key]); - } - }); - - return function() { - arrayRemove(listeners, fn); - }; - } - }; - - function setSpecialAttr(element, attrName, value) { - // Attributes names that do not start with letters (such as `(click)`) cannot be set using `setAttribute` - // so we have to jump through some hoops to get such an attribute - // https://github.com/angular/angular.js/pull/13318 - specialAttrHolder.innerHTML = ''; - var attributes = specialAttrHolder.firstChild.attributes; - var attribute = attributes[0]; - // We have to remove the attribute from its container element before we can add it to the destination element - attributes.removeNamedItem(attribute.name); - attribute.value = value; - element.attributes.setNamedItem(attribute); - } - - function safeAddClass($element, className) { - try { - $element.addClass(className); - } catch (e) { - // ignore, since it means that we are trying to set class on - // SVG element, where class name is read-only. - } - } - - - var startSymbol = $interpolate.startSymbol(), - endSymbol = $interpolate.endSymbol(), - denormalizeTemplate = (startSymbol === '{{' && endSymbol === '}}') - ? identity - : function denormalizeTemplate(template) { - return template.replace(/\{\{/g, startSymbol).replace(/}}/g, endSymbol); - }, - NG_ATTR_BINDING = /^ngAttr[A-Z]/; - var MULTI_ELEMENT_DIR_RE = /^(.+)Start$/; - - compile.$$addBindingInfo = debugInfoEnabled ? function $$addBindingInfo($element, binding) { - var bindings = $element.data('$binding') || []; - - if (isArray(binding)) { - bindings = bindings.concat(binding); - } else { - bindings.push(binding); - } - - $element.data('$binding', bindings); - } : noop; - - compile.$$addBindingClass = debugInfoEnabled ? function $$addBindingClass($element) { - safeAddClass($element, 'ng-binding'); - } : noop; - - compile.$$addScopeInfo = debugInfoEnabled ? function $$addScopeInfo($element, scope, isolated, noTemplate) { - var dataName = isolated ? (noTemplate ? '$isolateScopeNoTemplate' : '$isolateScope') : '$scope'; - $element.data(dataName, scope); - } : noop; - - compile.$$addScopeClass = debugInfoEnabled ? function $$addScopeClass($element, isolated) { - safeAddClass($element, isolated ? 'ng-isolate-scope' : 'ng-scope'); - } : noop; - - compile.$$createComment = function(directiveName, comment) { - var content = ''; - if (debugInfoEnabled) { - content = ' ' + (directiveName || '') + ': '; - if (comment) content += comment + ' '; - } - return window.document.createComment(content); - }; - - return compile; - - //================================ - - function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, - previousCompileContext) { - if (!($compileNodes instanceof jqLite)) { - // jquery always rewraps, whereas we need to preserve the original selector so that we can - // modify it. - $compileNodes = jqLite($compileNodes); - } - var compositeLinkFn = - compileNodes($compileNodes, transcludeFn, $compileNodes, - maxPriority, ignoreDirective, previousCompileContext); - compile.$$addScopeClass($compileNodes); - var namespace = null; - return function publicLinkFn(scope, cloneConnectFn, options) { - if (!$compileNodes) { - throw $compileMinErr('multilink', 'This element has already been linked.'); - } - assertArg(scope, 'scope'); - - if (previousCompileContext && previousCompileContext.needsNewScope) { - // A parent directive did a replace and a directive on this element asked - // for transclusion, which caused us to lose a layer of element on which - // we could hold the new transclusion scope, so we will create it manually - // here. - scope = scope.$parent.$new(); - } - - options = options || {}; - var parentBoundTranscludeFn = options.parentBoundTranscludeFn, - transcludeControllers = options.transcludeControllers, - futureParentElement = options.futureParentElement; - - // When `parentBoundTranscludeFn` is passed, it is a - // `controllersBoundTransclude` function (it was previously passed - // as `transclude` to directive.link) so we must unwrap it to get - // its `boundTranscludeFn` - if (parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude) { - parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude; - } - - if (!namespace) { - namespace = detectNamespaceForChildElements(futureParentElement); - } - var $linkNode; - if (namespace !== 'html') { - // When using a directive with replace:true and templateUrl the $compileNodes - // (or a child element inside of them) - // might change, so we need to recreate the namespace adapted compileNodes - // for call to the link function. - // Note: This will already clone the nodes... - $linkNode = jqLite( - wrapTemplate(namespace, jqLite('
    ').append($compileNodes).html()) - ); - } else if (cloneConnectFn) { - // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart - // and sometimes changes the structure of the DOM. - $linkNode = JQLitePrototype.clone.call($compileNodes); - } else { - $linkNode = $compileNodes; - } - - if (transcludeControllers) { - for (var controllerName in transcludeControllers) { - $linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance); - } - } - - compile.$$addScopeInfo($linkNode, scope); - - if (cloneConnectFn) cloneConnectFn($linkNode, scope); - if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn); - - if (!cloneConnectFn) { - $compileNodes = compositeLinkFn = null; - } - return $linkNode; - }; - } - - function detectNamespaceForChildElements(parentElement) { - // TODO: Make this detect MathML as well... - var node = parentElement && parentElement[0]; - if (!node) { - return 'html'; - } else { - return nodeName_(node) !== 'foreignobject' && toString.call(node).match(/SVG/) ? 'svg' : 'html'; - } - } - - /** - * Compile function matches each node in nodeList against the directives. Once all directives - * for a particular node are collected their compile functions are executed. The compile - * functions return values - the linking functions - are combined into a composite linking - * function, which is the a linking function for the node. - * - * @param {NodeList} nodeList an array of nodes or NodeList to compile - * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the - * scope argument is auto-generated to the new child of the transcluded parent scope. - * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then - * the rootElement must be set the jqLite collection of the compile root. This is - * needed so that the jqLite collection items can be replaced with widgets. - * @param {number=} maxPriority Max directive priority. - * @returns {Function} A composite linking function of all of the matched directives or null. - */ - function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective, - previousCompileContext) { - var linkFns = [], - // `nodeList` can be either an element's `.childNodes` (live NodeList) - // or a jqLite/jQuery collection or an array - notLiveList = isArray(nodeList) || (nodeList instanceof jqLite), - attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound; - - - for (var i = 0; i < nodeList.length; i++) { - attrs = new Attributes(); - - // Support: IE 11 only - // Workaround for #11781 and #14924 - if (msie === 11) { - mergeConsecutiveTextNodes(nodeList, i, notLiveList); - } - - // We must always refer to `nodeList[i]` hereafter, - // since the nodes can be replaced underneath us. - directives = collectDirectives(nodeList[i], [], attrs, i === 0 ? maxPriority : undefined, - ignoreDirective); - - nodeLinkFn = (directives.length) - ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement, - null, [], [], previousCompileContext) - : null; - - if (nodeLinkFn && nodeLinkFn.scope) { - compile.$$addScopeClass(attrs.$$element); - } - - childLinkFn = (nodeLinkFn && nodeLinkFn.terminal || - !(childNodes = nodeList[i].childNodes) || - !childNodes.length) - ? null - : compileNodes(childNodes, - nodeLinkFn ? ( - (nodeLinkFn.transcludeOnThisElement || !nodeLinkFn.templateOnThisElement) - && nodeLinkFn.transclude) : transcludeFn); - - if (nodeLinkFn || childLinkFn) { - linkFns.push(i, nodeLinkFn, childLinkFn); - linkFnFound = true; - nodeLinkFnFound = nodeLinkFnFound || nodeLinkFn; - } - - //use the previous context only for the first element in the virtual group - previousCompileContext = null; - } - - // return a linking function if we have found anything, null otherwise - return linkFnFound ? compositeLinkFn : null; - - function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) { - var nodeLinkFn, childLinkFn, node, childScope, i, ii, idx, childBoundTranscludeFn; - var stableNodeList; - - - if (nodeLinkFnFound) { - // copy nodeList so that if a nodeLinkFn removes or adds an element at this DOM level our - // offsets don't get screwed up - var nodeListLength = nodeList.length; - stableNodeList = new Array(nodeListLength); - - // create a sparse array by only copying the elements which have a linkFn - for (i = 0; i < linkFns.length; i += 3) { - idx = linkFns[i]; - stableNodeList[idx] = nodeList[idx]; - } - } else { - stableNodeList = nodeList; - } - - for (i = 0, ii = linkFns.length; i < ii;) { - node = stableNodeList[linkFns[i++]]; - nodeLinkFn = linkFns[i++]; - childLinkFn = linkFns[i++]; - - if (nodeLinkFn) { - if (nodeLinkFn.scope) { - childScope = scope.$new(); - compile.$$addScopeInfo(jqLite(node), childScope); - } else { - childScope = scope; - } - - if (nodeLinkFn.transcludeOnThisElement) { - childBoundTranscludeFn = createBoundTranscludeFn( - scope, nodeLinkFn.transclude, parentBoundTranscludeFn); - - } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) { - childBoundTranscludeFn = parentBoundTranscludeFn; - - } else if (!parentBoundTranscludeFn && transcludeFn) { - childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn); - - } else { - childBoundTranscludeFn = null; - } - - nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn); - - } else if (childLinkFn) { - childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn); - } - } - } - } - - function mergeConsecutiveTextNodes(nodeList, idx, notLiveList) { - var node = nodeList[idx]; - var parent = node.parentNode; - var sibling; - - if (node.nodeType !== NODE_TYPE_TEXT) { - return; - } - - while (true) { - sibling = parent ? node.nextSibling : nodeList[idx + 1]; - if (!sibling || sibling.nodeType !== NODE_TYPE_TEXT) { - break; - } - - node.nodeValue = node.nodeValue + sibling.nodeValue; - - if (sibling.parentNode) { - sibling.parentNode.removeChild(sibling); - } - if (notLiveList && sibling === nodeList[idx + 1]) { - nodeList.splice(idx + 1, 1); - } - } - } - - function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn) { - function boundTranscludeFn(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) { - - if (!transcludedScope) { - transcludedScope = scope.$new(false, containingScope); - transcludedScope.$$transcluded = true; - } - - return transcludeFn(transcludedScope, cloneFn, { - parentBoundTranscludeFn: previousBoundTranscludeFn, - transcludeControllers: controllers, - futureParentElement: futureParentElement - }); - } - - // We need to attach the transclusion slots onto the `boundTranscludeFn` - // so that they are available inside the `controllersBoundTransclude` function - var boundSlots = boundTranscludeFn.$$slots = createMap(); - for (var slotName in transcludeFn.$$slots) { - if (transcludeFn.$$slots[slotName]) { - boundSlots[slotName] = createBoundTranscludeFn(scope, transcludeFn.$$slots[slotName], previousBoundTranscludeFn); - } else { - boundSlots[slotName] = null; - } - } - - return boundTranscludeFn; - } - - /** - * Looks for directives on the given node and adds them to the directive collection which is - * sorted. - * - * @param node Node to search. - * @param directives An array to which the directives are added to. This array is sorted before - * the function returns. - * @param attrs The shared attrs object which is used to populate the normalized attributes. - * @param {number=} maxPriority Max directive priority. - */ - function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) { - var nodeType = node.nodeType, - attrsMap = attrs.$attr, - match, - nodeName, - className; - - switch (nodeType) { - case NODE_TYPE_ELEMENT: /* Element */ - - nodeName = nodeName_(node); - - // use the node name: - addDirective(directives, - directiveNormalize(nodeName), 'E', maxPriority, ignoreDirective); - - // iterate over the attributes - for (var attr, name, nName, ngAttrName, value, isNgAttr, nAttrs = node.attributes, - j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) { - var attrStartName = false; - var attrEndName = false; - - attr = nAttrs[j]; - name = attr.name; - value = attr.value; - - // support ngAttr attribute binding - ngAttrName = directiveNormalize(name); - isNgAttr = NG_ATTR_BINDING.test(ngAttrName); - if (isNgAttr) { - name = name.replace(PREFIX_REGEXP, '') - .substr(8).replace(/_(.)/g, function(match, letter) { - return letter.toUpperCase(); - }); - } - - var multiElementMatch = ngAttrName.match(MULTI_ELEMENT_DIR_RE); - if (multiElementMatch && directiveIsMultiElement(multiElementMatch[1])) { - attrStartName = name; - attrEndName = name.substr(0, name.length - 5) + 'end'; - name = name.substr(0, name.length - 6); - } - - nName = directiveNormalize(name.toLowerCase()); - attrsMap[nName] = name; - if (isNgAttr || !attrs.hasOwnProperty(nName)) { - attrs[nName] = value; - if (getBooleanAttrName(node, nName)) { - attrs[nName] = true; // presence means true - } - } - addAttrInterpolateDirective(node, directives, value, nName, isNgAttr); - addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName, - attrEndName); - } - - if (nodeName === 'input' && node.getAttribute('type') === 'hidden') { - // Hidden input elements can have strange behaviour when navigating back to the page - // This tells the browser not to try to cache and reinstate previous values - node.setAttribute('autocomplete', 'off'); - } - - // use class as directive - if (!cssClassDirectivesEnabled) break; - className = node.className; - if (isObject(className)) { - // Maybe SVGAnimatedString - className = className.animVal; - } - if (isString(className) && className !== '') { - while ((match = CLASS_DIRECTIVE_REGEXP.exec(className))) { - nName = directiveNormalize(match[2]); - if (addDirective(directives, nName, 'C', maxPriority, ignoreDirective)) { - attrs[nName] = trim(match[3]); - } - className = className.substr(match.index + match[0].length); - } - } - break; - case NODE_TYPE_TEXT: /* Text Node */ - addTextInterpolateDirective(directives, node.nodeValue); - break; - case NODE_TYPE_COMMENT: /* Comment */ - if (!commentDirectivesEnabled) break; - collectCommentDirectives(node, directives, attrs, maxPriority, ignoreDirective); - break; - } - - directives.sort(byPriority); - return directives; - } - - function collectCommentDirectives(node, directives, attrs, maxPriority, ignoreDirective) { - // function created because of performance, try/catch disables - // the optimization of the whole function #14848 - try { - var match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue); - if (match) { - var nName = directiveNormalize(match[1]); - if (addDirective(directives, nName, 'M', maxPriority, ignoreDirective)) { - attrs[nName] = trim(match[2]); - } - } - } catch (e) { - // turns out that under some circumstances IE9 throws errors when one attempts to read - // comment's node value. - // Just ignore it and continue. (Can't seem to reproduce in test case.) - } - } - - /** - * Given a node with a directive-start it collects all of the siblings until it finds - * directive-end. - * @param node - * @param attrStart - * @param attrEnd - * @returns {*} - */ - function groupScan(node, attrStart, attrEnd) { - var nodes = []; - var depth = 0; - if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) { - do { - if (!node) { - throw $compileMinErr('uterdir', - 'Unterminated attribute, found \'{0}\' but no matching \'{1}\' found.', - attrStart, attrEnd); - } - if (node.nodeType === NODE_TYPE_ELEMENT) { - if (node.hasAttribute(attrStart)) depth++; - if (node.hasAttribute(attrEnd)) depth--; - } - nodes.push(node); - node = node.nextSibling; - } while (depth > 0); - } else { - nodes.push(node); - } - - return jqLite(nodes); - } - - /** - * Wrapper for linking function which converts normal linking function into a grouped - * linking function. - * @param linkFn - * @param attrStart - * @param attrEnd - * @returns {Function} - */ - function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) { - return function groupedElementsLink(scope, element, attrs, controllers, transcludeFn) { - element = groupScan(element[0], attrStart, attrEnd); - return linkFn(scope, element, attrs, controllers, transcludeFn); - }; - } - - /** - * A function generator that is used to support both eager and lazy compilation - * linking function. - * @param eager - * @param $compileNodes - * @param transcludeFn - * @param maxPriority - * @param ignoreDirective - * @param previousCompileContext - * @returns {Function} - */ - function compilationGenerator(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) { - var compiled; - - if (eager) { - return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext); - } - return /** @this */ function lazyCompilation() { - if (!compiled) { - compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext); - - // Null out all of these references in order to make them eligible for garbage collection - // since this is a potentially long lived closure - $compileNodes = transcludeFn = previousCompileContext = null; - } - return compiled.apply(this, arguments); - }; - } - - /** - * Once the directives have been collected, their compile functions are executed. This method - * is responsible for inlining directive templates as well as terminating the application - * of the directives if the terminal directive has been reached. - * - * @param {Array} directives Array of collected directives to execute their compile function. - * this needs to be pre-sorted by priority order. - * @param {Node} compileNode The raw DOM node to apply the compile functions to - * @param {Object} templateAttrs The shared attribute function - * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the - * scope argument is auto-generated to the new - * child of the transcluded parent scope. - * @param {JQLite} jqCollection If we are working on the root of the compile tree then this - * argument has the root jqLite array so that we can replace nodes - * on it. - * @param {Object=} originalReplaceDirective An optional directive that will be ignored when - * compiling the transclusion. - * @param {Array.} preLinkFns - * @param {Array.} postLinkFns - * @param {Object} previousCompileContext Context used for previous compilation of the current - * node - * @returns {Function} linkFn - */ - function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn, - jqCollection, originalReplaceDirective, preLinkFns, postLinkFns, - previousCompileContext) { - previousCompileContext = previousCompileContext || {}; - - var terminalPriority = -Number.MAX_VALUE, - newScopeDirective = previousCompileContext.newScopeDirective, - controllerDirectives = previousCompileContext.controllerDirectives, - newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective, - templateDirective = previousCompileContext.templateDirective, - nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective, - hasTranscludeDirective = false, - hasTemplate = false, - hasElementTranscludeDirective = previousCompileContext.hasElementTranscludeDirective, - $compileNode = templateAttrs.$$element = jqLite(compileNode), - directive, - directiveName, - $template, - replaceDirective = originalReplaceDirective, - childTranscludeFn = transcludeFn, - linkFn, - didScanForMultipleTransclusion = false, - mightHaveMultipleTransclusionError = false, - directiveValue; - - // executes all directives on the current element - for (var i = 0, ii = directives.length; i < ii; i++) { - directive = directives[i]; - var attrStart = directive.$$start; - var attrEnd = directive.$$end; - - // collect multiblock sections - if (attrStart) { - $compileNode = groupScan(compileNode, attrStart, attrEnd); - } - $template = undefined; - - if (terminalPriority > directive.priority) { - break; // prevent further processing of directives - } - - directiveValue = directive.scope; - - if (directiveValue) { - - // skip the check for directives with async templates, we'll check the derived sync - // directive when the template arrives - if (!directive.templateUrl) { - if (isObject(directiveValue)) { - // This directive is trying to add an isolated scope. - // Check that there is no scope of any kind already - assertNoDuplicate('new/isolated scope', newIsolateScopeDirective || newScopeDirective, - directive, $compileNode); - newIsolateScopeDirective = directive; - } else { - // This directive is trying to add a child scope. - // Check that there is no isolated scope already - assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive, - $compileNode); - } - } - - newScopeDirective = newScopeDirective || directive; - } - - directiveName = directive.name; - - // If we encounter a condition that can result in transclusion on the directive, - // then scan ahead in the remaining directives for others that may cause a multiple - // transclusion error to be thrown during the compilation process. If a matching directive - // is found, then we know that when we encounter a transcluded directive, we need to eagerly - // compile the `transclude` function rather than doing it lazily in order to throw - // exceptions at the correct time - if (!didScanForMultipleTransclusion && ((directive.replace && (directive.templateUrl || directive.template)) - || (directive.transclude && !directive.$$tlb))) { - var candidateDirective; - - for (var scanningIndex = i + 1; (candidateDirective = directives[scanningIndex++]);) { - if ((candidateDirective.transclude && !candidateDirective.$$tlb) - || (candidateDirective.replace && (candidateDirective.templateUrl || candidateDirective.template))) { - mightHaveMultipleTransclusionError = true; - break; - } - } - - didScanForMultipleTransclusion = true; - } - - if (!directive.templateUrl && directive.controller) { - controllerDirectives = controllerDirectives || createMap(); - assertNoDuplicate('\'' + directiveName + '\' controller', - controllerDirectives[directiveName], directive, $compileNode); - controllerDirectives[directiveName] = directive; - } - - directiveValue = directive.transclude; - - if (directiveValue) { - hasTranscludeDirective = true; - - // Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion. - // This option should only be used by directives that know how to safely handle element transclusion, - // where the transcluded nodes are added or replaced after linking. - if (!directive.$$tlb) { - assertNoDuplicate('transclusion', nonTlbTranscludeDirective, directive, $compileNode); - nonTlbTranscludeDirective = directive; - } - - if (directiveValue === 'element') { - hasElementTranscludeDirective = true; - terminalPriority = directive.priority; - $template = $compileNode; - $compileNode = templateAttrs.$$element = - jqLite(compile.$$createComment(directiveName, templateAttrs[directiveName])); - compileNode = $compileNode[0]; - replaceWith(jqCollection, sliceArgs($template), compileNode); - - // Support: Chrome < 50 - // https://github.com/angular/angular.js/issues/14041 - - // In the versions of V8 prior to Chrome 50, the document fragment that is created - // in the `replaceWith` function is improperly garbage collected despite still - // being referenced by the `parentNode` property of all of the child nodes. By adding - // a reference to the fragment via a different property, we can avoid that incorrect - // behavior. - // TODO: remove this line after Chrome 50 has been released - $template[0].$$parentNode = $template[0].parentNode; - - childTranscludeFn = compilationGenerator(mightHaveMultipleTransclusionError, $template, transcludeFn, terminalPriority, - replaceDirective && replaceDirective.name, { - // Don't pass in: - // - controllerDirectives - otherwise we'll create duplicates controllers - // - newIsolateScopeDirective or templateDirective - combining templates with - // element transclusion doesn't make sense. - // - // We need only nonTlbTranscludeDirective so that we prevent putting transclusion - // on the same element more than once. - nonTlbTranscludeDirective: nonTlbTranscludeDirective - }); - } else { - - var slots = createMap(); - - if (!isObject(directiveValue)) { - $template = jqLite(jqLiteClone(compileNode)).contents(); - } else { - - // We have transclusion slots, - // collect them up, compile them and store their transclusion functions - $template = []; - - var slotMap = createMap(); - var filledSlots = createMap(); - - // Parse the element selectors - forEach(directiveValue, function(elementSelector, slotName) { - // If an element selector starts with a ? then it is optional - var optional = (elementSelector.charAt(0) === '?'); - elementSelector = optional ? elementSelector.substring(1) : elementSelector; - - slotMap[elementSelector] = slotName; - - // We explicitly assign `null` since this implies that a slot was defined but not filled. - // Later when calling boundTransclusion functions with a slot name we only error if the - // slot is `undefined` - slots[slotName] = null; - - // filledSlots contains `true` for all slots that are either optional or have been - // filled. This is used to check that we have not missed any required slots - filledSlots[slotName] = optional; - }); - - // Add the matching elements into their slot - forEach($compileNode.contents(), function(node) { - var slotName = slotMap[directiveNormalize(nodeName_(node))]; - if (slotName) { - filledSlots[slotName] = true; - slots[slotName] = slots[slotName] || []; - slots[slotName].push(node); - } else { - $template.push(node); - } - }); - - // Check for required slots that were not filled - forEach(filledSlots, function(filled, slotName) { - if (!filled) { - throw $compileMinErr('reqslot', 'Required transclusion slot `{0}` was not filled.', slotName); - } - }); - - for (var slotName in slots) { - if (slots[slotName]) { - // Only define a transclusion function if the slot was filled - slots[slotName] = compilationGenerator(mightHaveMultipleTransclusionError, slots[slotName], transcludeFn); - } - } - } - - $compileNode.empty(); // clear contents - childTranscludeFn = compilationGenerator(mightHaveMultipleTransclusionError, $template, transcludeFn, undefined, - undefined, { needsNewScope: directive.$$isolateScope || directive.$$newScope}); - childTranscludeFn.$$slots = slots; - } - } - - if (directive.template) { - hasTemplate = true; - assertNoDuplicate('template', templateDirective, directive, $compileNode); - templateDirective = directive; - - directiveValue = (isFunction(directive.template)) - ? directive.template($compileNode, templateAttrs) - : directive.template; - - directiveValue = denormalizeTemplate(directiveValue); - - if (directive.replace) { - replaceDirective = directive; - if (jqLiteIsTextNode(directiveValue)) { - $template = []; - } else { - $template = removeComments(wrapTemplate(directive.templateNamespace, trim(directiveValue))); - } - compileNode = $template[0]; - - if ($template.length !== 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) { - throw $compileMinErr('tplrt', - 'Template for directive \'{0}\' must have exactly one root element. {1}', - directiveName, ''); - } - - replaceWith(jqCollection, $compileNode, compileNode); - - var newTemplateAttrs = {$attr: {}}; - - // combine directives from the original node and from the template: - // - take the array of directives for this element - // - split it into two parts, those that already applied (processed) and those that weren't (unprocessed) - // - collect directives from the template and sort them by priority - // - combine directives as: processed + template + unprocessed - var templateDirectives = collectDirectives(compileNode, [], newTemplateAttrs); - var unprocessedDirectives = directives.splice(i + 1, directives.length - (i + 1)); - - if (newIsolateScopeDirective || newScopeDirective) { - // The original directive caused the current element to be replaced but this element - // also needs to have a new scope, so we need to tell the template directives - // that they would need to get their scope from further up, if they require transclusion - markDirectiveScope(templateDirectives, newIsolateScopeDirective, newScopeDirective); - } - directives = directives.concat(templateDirectives).concat(unprocessedDirectives); - mergeTemplateAttributes(templateAttrs, newTemplateAttrs); - - ii = directives.length; - } else { - $compileNode.html(directiveValue); - } - } - - if (directive.templateUrl) { - hasTemplate = true; - assertNoDuplicate('template', templateDirective, directive, $compileNode); - templateDirective = directive; - - if (directive.replace) { - replaceDirective = directive; - } - - // eslint-disable-next-line no-func-assign - nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i), $compileNode, - templateAttrs, jqCollection, hasTranscludeDirective && childTranscludeFn, preLinkFns, postLinkFns, { - controllerDirectives: controllerDirectives, - newScopeDirective: (newScopeDirective !== directive) && newScopeDirective, - newIsolateScopeDirective: newIsolateScopeDirective, - templateDirective: templateDirective, - nonTlbTranscludeDirective: nonTlbTranscludeDirective - }); - ii = directives.length; - } else if (directive.compile) { - try { - linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn); - var context = directive.$$originalDirective || directive; - if (isFunction(linkFn)) { - addLinkFns(null, bind(context, linkFn), attrStart, attrEnd); - } else if (linkFn) { - addLinkFns(bind(context, linkFn.pre), bind(context, linkFn.post), attrStart, attrEnd); - } - } catch (e) { - $exceptionHandler(e, startingTag($compileNode)); - } - } - - if (directive.terminal) { - nodeLinkFn.terminal = true; - terminalPriority = Math.max(terminalPriority, directive.priority); - } - - } - - nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope === true; - nodeLinkFn.transcludeOnThisElement = hasTranscludeDirective; - nodeLinkFn.templateOnThisElement = hasTemplate; - nodeLinkFn.transclude = childTranscludeFn; - - previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective; - - // might be normal or delayed nodeLinkFn depending on if templateUrl is present - return nodeLinkFn; - - //////////////////// - - function addLinkFns(pre, post, attrStart, attrEnd) { - if (pre) { - if (attrStart) pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd); - pre.require = directive.require; - pre.directiveName = directiveName; - if (newIsolateScopeDirective === directive || directive.$$isolateScope) { - pre = cloneAndAnnotateFn(pre, {isolateScope: true}); - } - preLinkFns.push(pre); - } - if (post) { - if (attrStart) post = groupElementsLinkFnWrapper(post, attrStart, attrEnd); - post.require = directive.require; - post.directiveName = directiveName; - if (newIsolateScopeDirective === directive || directive.$$isolateScope) { - post = cloneAndAnnotateFn(post, {isolateScope: true}); - } - postLinkFns.push(post); - } - } - - function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) { - var i, ii, linkFn, isolateScope, controllerScope, elementControllers, transcludeFn, $element, - attrs, scopeBindingInfo; - - if (compileNode === linkNode) { - attrs = templateAttrs; - $element = templateAttrs.$$element; - } else { - $element = jqLite(linkNode); - attrs = new Attributes($element, templateAttrs); - } - - controllerScope = scope; - if (newIsolateScopeDirective) { - isolateScope = scope.$new(true); - } else if (newScopeDirective) { - controllerScope = scope.$parent; - } - - if (boundTranscludeFn) { - // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn` - // is later passed as `parentBoundTranscludeFn` to `publicLinkFn` - transcludeFn = controllersBoundTransclude; - transcludeFn.$$boundTransclude = boundTranscludeFn; - // expose the slots on the `$transclude` function - transcludeFn.isSlotFilled = function(slotName) { - return !!boundTranscludeFn.$$slots[slotName]; - }; - } - - if (controllerDirectives) { - elementControllers = setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective); - } - - if (newIsolateScopeDirective) { - // Initialize isolate scope bindings for new isolate scope directive. - compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective || - templateDirective === newIsolateScopeDirective.$$originalDirective))); - compile.$$addScopeClass($element, true); - isolateScope.$$isolateBindings = - newIsolateScopeDirective.$$isolateBindings; - scopeBindingInfo = initializeDirectiveBindings(scope, attrs, isolateScope, - isolateScope.$$isolateBindings, - newIsolateScopeDirective); - if (scopeBindingInfo.removeWatches) { - isolateScope.$on('$destroy', scopeBindingInfo.removeWatches); - } - } - - // Initialize bindToController bindings - for (var name in elementControllers) { - var controllerDirective = controllerDirectives[name]; - var controller = elementControllers[name]; - var bindings = controllerDirective.$$bindings.bindToController; - - if (preAssignBindingsEnabled) { - if (bindings) { - controller.bindingInfo = - initializeDirectiveBindings(controllerScope, attrs, controller.instance, bindings, controllerDirective); - } else { - controller.bindingInfo = {}; - } - - var controllerResult = controller(); - if (controllerResult !== controller.instance) { - // If the controller constructor has a return value, overwrite the instance - // from setupControllers - controller.instance = controllerResult; - $element.data('$' + controllerDirective.name + 'Controller', controllerResult); - if (controller.bindingInfo.removeWatches) { - controller.bindingInfo.removeWatches(); - } - controller.bindingInfo = - initializeDirectiveBindings(controllerScope, attrs, controller.instance, bindings, controllerDirective); - } - } else { - controller.instance = controller(); - $element.data('$' + controllerDirective.name + 'Controller', controller.instance); - controller.bindingInfo = - initializeDirectiveBindings(controllerScope, attrs, controller.instance, bindings, controllerDirective); - } - } - - // Bind the required controllers to the controller, if `require` is an object and `bindToController` is truthy - forEach(controllerDirectives, function(controllerDirective, name) { - var require = controllerDirective.require; - if (controllerDirective.bindToController && !isArray(require) && isObject(require)) { - extend(elementControllers[name].instance, getControllers(name, require, $element, elementControllers)); - } - }); - - // Handle the init and destroy lifecycle hooks on all controllers that have them - forEach(elementControllers, function(controller) { - var controllerInstance = controller.instance; - if (isFunction(controllerInstance.$onChanges)) { - try { - controllerInstance.$onChanges(controller.bindingInfo.initialChanges); - } catch (e) { - $exceptionHandler(e); - } - } - if (isFunction(controllerInstance.$onInit)) { - try { - controllerInstance.$onInit(); - } catch (e) { - $exceptionHandler(e); - } - } - if (isFunction(controllerInstance.$doCheck)) { - controllerScope.$watch(function() { controllerInstance.$doCheck(); }); - controllerInstance.$doCheck(); - } - if (isFunction(controllerInstance.$onDestroy)) { - controllerScope.$on('$destroy', function callOnDestroyHook() { - controllerInstance.$onDestroy(); - }); - } - }); - - // PRELINKING - for (i = 0, ii = preLinkFns.length; i < ii; i++) { - linkFn = preLinkFns[i]; - invokeLinkFn(linkFn, - linkFn.isolateScope ? isolateScope : scope, - $element, - attrs, - linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers), - transcludeFn - ); - } - - // RECURSION - // We only pass the isolate scope, if the isolate directive has a template, - // otherwise the child elements do not belong to the isolate directive. - var scopeToChild = scope; - if (newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)) { - scopeToChild = isolateScope; - } - if (childLinkFn) { - childLinkFn(scopeToChild, linkNode.childNodes, undefined, boundTranscludeFn); - } - - // POSTLINKING - for (i = postLinkFns.length - 1; i >= 0; i--) { - linkFn = postLinkFns[i]; - invokeLinkFn(linkFn, - linkFn.isolateScope ? isolateScope : scope, - $element, - attrs, - linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers), - transcludeFn - ); - } - - // Trigger $postLink lifecycle hooks - forEach(elementControllers, function(controller) { - var controllerInstance = controller.instance; - if (isFunction(controllerInstance.$postLink)) { - controllerInstance.$postLink(); - } - }); - - // This is the function that is injected as `$transclude`. - // Note: all arguments are optional! - function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement, slotName) { - var transcludeControllers; - // No scope passed in: - if (!isScope(scope)) { - slotName = futureParentElement; - futureParentElement = cloneAttachFn; - cloneAttachFn = scope; - scope = undefined; - } - - if (hasElementTranscludeDirective) { - transcludeControllers = elementControllers; - } - if (!futureParentElement) { - futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element; - } - if (slotName) { - // slotTranscludeFn can be one of three things: - // * a transclude function - a filled slot - // * `null` - an optional slot that was not filled - // * `undefined` - a slot that was not declared (i.e. invalid) - var slotTranscludeFn = boundTranscludeFn.$$slots[slotName]; - if (slotTranscludeFn) { - return slotTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild); - } else if (isUndefined(slotTranscludeFn)) { - throw $compileMinErr('noslot', - 'No parent directive that requires a transclusion with slot name "{0}". ' + - 'Element: {1}', - slotName, startingTag($element)); - } - } else { - return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild); - } - } - } - } - - function getControllers(directiveName, require, $element, elementControllers) { - var value; - - if (isString(require)) { - var match = require.match(REQUIRE_PREFIX_REGEXP); - var name = require.substring(match[0].length); - var inheritType = match[1] || match[3]; - var optional = match[2] === '?'; - - //If only parents then start at the parent element - if (inheritType === '^^') { - $element = $element.parent(); - //Otherwise attempt getting the controller from elementControllers in case - //the element is transcluded (and has no data) and to avoid .data if possible - } else { - value = elementControllers && elementControllers[name]; - value = value && value.instance; - } - - if (!value) { - var dataName = '$' + name + 'Controller'; - value = inheritType ? $element.inheritedData(dataName) : $element.data(dataName); - } - - if (!value && !optional) { - throw $compileMinErr('ctreq', - 'Controller \'{0}\', required by directive \'{1}\', can\'t be found!', - name, directiveName); - } - } else if (isArray(require)) { - value = []; - for (var i = 0, ii = require.length; i < ii; i++) { - value[i] = getControllers(directiveName, require[i], $element, elementControllers); - } - } else if (isObject(require)) { - value = {}; - forEach(require, function(controller, property) { - value[property] = getControllers(directiveName, controller, $element, elementControllers); - }); - } - - return value || null; - } - - function setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective) { - var elementControllers = createMap(); - for (var controllerKey in controllerDirectives) { - var directive = controllerDirectives[controllerKey]; - var locals = { - $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope, - $element: $element, - $attrs: attrs, - $transclude: transcludeFn - }; - - var controller = directive.controller; - if (controller === '@') { - controller = attrs[directive.name]; - } - - var controllerInstance = $controller(controller, locals, true, directive.controllerAs); - - // For directives with element transclusion the element is a comment. - // In this case .data will not attach any data. - // Instead, we save the controllers for the element in a local hash and attach to .data - // later, once we have the actual element. - elementControllers[directive.name] = controllerInstance; - $element.data('$' + directive.name + 'Controller', controllerInstance.instance); - } - return elementControllers; - } - - // Depending upon the context in which a directive finds itself it might need to have a new isolated - // or child scope created. For instance: - // * if the directive has been pulled into a template because another directive with a higher priority - // asked for element transclusion - // * if the directive itself asks for transclusion but it is at the root of a template and the original - // element was replaced. See https://github.com/angular/angular.js/issues/12936 - function markDirectiveScope(directives, isolateScope, newScope) { - for (var j = 0, jj = directives.length; j < jj; j++) { - directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope}); - } - } - - /** - * looks up the directive and decorates it with exception handling and proper parameters. We - * call this the boundDirective. - * - * @param {string} name name of the directive to look up. - * @param {string} location The directive must be found in specific format. - * String containing any of theses characters: - * - * * `E`: element name - * * `A': attribute - * * `C`: class - * * `M`: comment - * @returns {boolean} true if directive was added. - */ - function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName, - endAttrName) { - if (name === ignoreDirective) return null; - var match = null; - if (hasDirectives.hasOwnProperty(name)) { - for (var directive, directives = $injector.get(name + Suffix), - i = 0, ii = directives.length; i < ii; i++) { - directive = directives[i]; - if ((isUndefined(maxPriority) || maxPriority > directive.priority) && - directive.restrict.indexOf(location) !== -1) { - if (startAttrName) { - directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName}); - } - if (!directive.$$bindings) { - var bindings = directive.$$bindings = - parseDirectiveBindings(directive, directive.name); - if (isObject(bindings.isolateScope)) { - directive.$$isolateBindings = bindings.isolateScope; - } - } - tDirectives.push(directive); - match = directive; - } - } - } - return match; - } - - - /** - * looks up the directive and returns true if it is a multi-element directive, - * and therefore requires DOM nodes between -start and -end markers to be grouped - * together. - * - * @param {string} name name of the directive to look up. - * @returns true if directive was registered as multi-element. - */ - function directiveIsMultiElement(name) { - if (hasDirectives.hasOwnProperty(name)) { - for (var directive, directives = $injector.get(name + Suffix), - i = 0, ii = directives.length; i < ii; i++) { - directive = directives[i]; - if (directive.multiElement) { - return true; - } - } - } - return false; - } - - /** - * When the element is replaced with HTML template then the new attributes - * on the template need to be merged with the existing attributes in the DOM. - * The desired effect is to have both of the attributes present. - * - * @param {object} dst destination attributes (original DOM) - * @param {object} src source attributes (from the directive template) - */ - function mergeTemplateAttributes(dst, src) { - var srcAttr = src.$attr, - dstAttr = dst.$attr; - - // reapply the old attributes to the new element - forEach(dst, function(value, key) { - if (key.charAt(0) !== '$') { - if (src[key] && src[key] !== value) { - if (value.length) { - value += (key === 'style' ? ';' : ' ') + src[key]; - } else { - value = src[key]; - } - } - dst.$set(key, value, true, srcAttr[key]); - } - }); - - // copy the new attributes on the old attrs object - forEach(src, function(value, key) { - // Check if we already set this attribute in the loop above. - // `dst` will never contain hasOwnProperty as DOM parser won't let it. - // You will get an "InvalidCharacterError: DOM Exception 5" error if you - // have an attribute like "has-own-property" or "data-has-own-property", etc. - if (!dst.hasOwnProperty(key) && key.charAt(0) !== '$') { - dst[key] = value; - - if (key !== 'class' && key !== 'style') { - dstAttr[key] = srcAttr[key]; - } - } - }); - } - - - function compileTemplateUrl(directives, $compileNode, tAttrs, - $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) { - var linkQueue = [], - afterTemplateNodeLinkFn, - afterTemplateChildLinkFn, - beforeTemplateCompileNode = $compileNode[0], - origAsyncDirective = directives.shift(), - derivedSyncDirective = inherit(origAsyncDirective, { - templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective - }), - templateUrl = (isFunction(origAsyncDirective.templateUrl)) - ? origAsyncDirective.templateUrl($compileNode, tAttrs) - : origAsyncDirective.templateUrl, - templateNamespace = origAsyncDirective.templateNamespace; - - $compileNode.empty(); - - $templateRequest(templateUrl) - .then(function(content) { - var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn; - - content = denormalizeTemplate(content); - - if (origAsyncDirective.replace) { - if (jqLiteIsTextNode(content)) { - $template = []; - } else { - $template = removeComments(wrapTemplate(templateNamespace, trim(content))); - } - compileNode = $template[0]; - - if ($template.length !== 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) { - throw $compileMinErr('tplrt', - 'Template for directive \'{0}\' must have exactly one root element. {1}', - origAsyncDirective.name, templateUrl); - } - - tempTemplateAttrs = {$attr: {}}; - replaceWith($rootElement, $compileNode, compileNode); - var templateDirectives = collectDirectives(compileNode, [], tempTemplateAttrs); - - if (isObject(origAsyncDirective.scope)) { - // the original directive that caused the template to be loaded async required - // an isolate scope - markDirectiveScope(templateDirectives, true); - } - directives = templateDirectives.concat(directives); - mergeTemplateAttributes(tAttrs, tempTemplateAttrs); - } else { - compileNode = beforeTemplateCompileNode; - $compileNode.html(content); - } - - directives.unshift(derivedSyncDirective); - - afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs, - childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns, - previousCompileContext); - forEach($rootElement, function(node, i) { - if (node === compileNode) { - $rootElement[i] = $compileNode[0]; - } - }); - afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn); - - while (linkQueue.length) { - var scope = linkQueue.shift(), - beforeTemplateLinkNode = linkQueue.shift(), - linkRootElement = linkQueue.shift(), - boundTranscludeFn = linkQueue.shift(), - linkNode = $compileNode[0]; - - if (scope.$$destroyed) continue; - - if (beforeTemplateLinkNode !== beforeTemplateCompileNode) { - var oldClasses = beforeTemplateLinkNode.className; - - if (!(previousCompileContext.hasElementTranscludeDirective && - origAsyncDirective.replace)) { - // it was cloned therefore we have to clone as well. - linkNode = jqLiteClone(compileNode); - } - replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode); - - // Copy in CSS classes from original node - safeAddClass(jqLite(linkNode), oldClasses); - } - if (afterTemplateNodeLinkFn.transcludeOnThisElement) { - childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn); - } else { - childBoundTranscludeFn = boundTranscludeFn; - } - afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement, - childBoundTranscludeFn); - } - linkQueue = null; - }).catch(function(error) { - if (isError(error)) { - $exceptionHandler(error); - } - }); - - return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) { - var childBoundTranscludeFn = boundTranscludeFn; - if (scope.$$destroyed) return; - if (linkQueue) { - linkQueue.push(scope, - node, - rootElement, - childBoundTranscludeFn); - } else { - if (afterTemplateNodeLinkFn.transcludeOnThisElement) { - childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn); - } - afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, childBoundTranscludeFn); - } - }; - } - - - /** - * Sorting function for bound directives. - */ - function byPriority(a, b) { - var diff = b.priority - a.priority; - if (diff !== 0) return diff; - if (a.name !== b.name) return (a.name < b.name) ? -1 : 1; - return a.index - b.index; - } - - function assertNoDuplicate(what, previousDirective, directive, element) { - - function wrapModuleNameIfDefined(moduleName) { - return moduleName ? - (' (module: ' + moduleName + ')') : - ''; - } - - if (previousDirective) { - throw $compileMinErr('multidir', 'Multiple directives [{0}{1}, {2}{3}] asking for {4} on: {5}', - previousDirective.name, wrapModuleNameIfDefined(previousDirective.$$moduleName), - directive.name, wrapModuleNameIfDefined(directive.$$moduleName), what, startingTag(element)); - } - } - - - function addTextInterpolateDirective(directives, text) { - var interpolateFn = $interpolate(text, true); - if (interpolateFn) { - directives.push({ - priority: 0, - compile: function textInterpolateCompileFn(templateNode) { - var templateNodeParent = templateNode.parent(), - hasCompileParent = !!templateNodeParent.length; - - // When transcluding a template that has bindings in the root - // we don't have a parent and thus need to add the class during linking fn. - if (hasCompileParent) compile.$$addBindingClass(templateNodeParent); - - return function textInterpolateLinkFn(scope, node) { - var parent = node.parent(); - if (!hasCompileParent) compile.$$addBindingClass(parent); - compile.$$addBindingInfo(parent, interpolateFn.expressions); - scope.$watch(interpolateFn, function interpolateFnWatchAction(value) { - node[0].nodeValue = value; - }); - }; - } - }); - } - } - - - function wrapTemplate(type, template) { - type = lowercase(type || 'html'); - switch (type) { - case 'svg': - case 'math': - var wrapper = window.document.createElement('div'); - wrapper.innerHTML = '<' + type + '>' + template + ''; - return wrapper.childNodes[0].childNodes; - default: - return template; - } - } - - - function getTrustedContext(node, attrNormalizedName) { - if (attrNormalizedName === 'srcdoc') { - return $sce.HTML; - } - var tag = nodeName_(node); - // All tags with src attributes require a RESOURCE_URL value, except for - // img and various html5 media tags. - if (attrNormalizedName === 'src' || attrNormalizedName === 'ngSrc') { - if (['img', 'video', 'audio', 'source', 'track'].indexOf(tag) === -1) { - return $sce.RESOURCE_URL; - } - // maction[xlink:href] can source SVG. It's not limited to . - } else if (attrNormalizedName === 'xlinkHref' || - (tag === 'form' && attrNormalizedName === 'action') || - // links can be stylesheets or imports, which can run script in the current origin - (tag === 'link' && attrNormalizedName === 'href') - ) { - return $sce.RESOURCE_URL; - } - } - - - function addAttrInterpolateDirective(node, directives, value, name, isNgAttr) { - var trustedContext = getTrustedContext(node, name); - var mustHaveExpression = !isNgAttr; - var allOrNothing = ALL_OR_NOTHING_ATTRS[name] || isNgAttr; - - var interpolateFn = $interpolate(value, mustHaveExpression, trustedContext, allOrNothing); - - // no interpolation found -> ignore - if (!interpolateFn) return; - - if (name === 'multiple' && nodeName_(node) === 'select') { - throw $compileMinErr('selmulti', - 'Binding to the \'multiple\' attribute is not supported. Element: {0}', - startingTag(node)); - } - - if (EVENT_HANDLER_ATTR_REGEXP.test(name)) { - throw $compileMinErr('nodomevents', - 'Interpolations for HTML DOM event attributes are disallowed. Please use the ' + - 'ng- versions (such as ng-click instead of onclick) instead.'); - } - - directives.push({ - priority: 100, - compile: function() { - return { - pre: function attrInterpolatePreLinkFn(scope, element, attr) { - var $$observers = (attr.$$observers || (attr.$$observers = createMap())); - - // If the attribute has changed since last $interpolate()ed - var newValue = attr[name]; - if (newValue !== value) { - // we need to interpolate again since the attribute value has been updated - // (e.g. by another directive's compile function) - // ensure unset/empty values make interpolateFn falsy - interpolateFn = newValue && $interpolate(newValue, true, trustedContext, allOrNothing); - value = newValue; - } - - // if attribute was updated so that there is no interpolation going on we don't want to - // register any observers - if (!interpolateFn) return; - - // initialize attr object so that it's ready in case we need the value for isolate - // scope initialization, otherwise the value would not be available from isolate - // directive's linking fn during linking phase - attr[name] = interpolateFn(scope); - - ($$observers[name] || ($$observers[name] = [])).$$inter = true; - (attr.$$observers && attr.$$observers[name].$$scope || scope). - $watch(interpolateFn, function interpolateFnWatchAction(newValue, oldValue) { - //special case for class attribute addition + removal - //so that class changes can tap into the animation - //hooks provided by the $animate service. Be sure to - //skip animations when the first digest occurs (when - //both the new and the old values are the same) since - //the CSS classes are the non-interpolated values - if (name === 'class' && newValue !== oldValue) { - attr.$updateClass(newValue, oldValue); - } else { - attr.$set(name, newValue); - } - }); - } - }; - } - }); - } - - - /** - * This is a special jqLite.replaceWith, which can replace items which - * have no parents, provided that the containing jqLite collection is provided. - * - * @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes - * in the root of the tree. - * @param {JqLite} elementsToRemove The jqLite element which we are going to replace. We keep - * the shell, but replace its DOM node reference. - * @param {Node} newNode The new DOM node. - */ - function replaceWith($rootElement, elementsToRemove, newNode) { - var firstElementToRemove = elementsToRemove[0], - removeCount = elementsToRemove.length, - parent = firstElementToRemove.parentNode, - i, ii; - - if ($rootElement) { - for (i = 0, ii = $rootElement.length; i < ii; i++) { - if ($rootElement[i] === firstElementToRemove) { - $rootElement[i++] = newNode; - for (var j = i, j2 = j + removeCount - 1, - jj = $rootElement.length; - j < jj; j++, j2++) { - if (j2 < jj) { - $rootElement[j] = $rootElement[j2]; - } else { - delete $rootElement[j]; - } - } - $rootElement.length -= removeCount - 1; - - // If the replaced element is also the jQuery .context then replace it - // .context is a deprecated jQuery api, so we should set it only when jQuery set it - // http://api.jquery.com/context/ - if ($rootElement.context === firstElementToRemove) { - $rootElement.context = newNode; - } - break; - } - } - } - - if (parent) { - parent.replaceChild(newNode, firstElementToRemove); - } - - // Append all the `elementsToRemove` to a fragment. This will... - // - remove them from the DOM - // - allow them to still be traversed with .nextSibling - // - allow a single fragment.qSA to fetch all elements being removed - var fragment = window.document.createDocumentFragment(); - for (i = 0; i < removeCount; i++) { - fragment.appendChild(elementsToRemove[i]); - } - - if (jqLite.hasData(firstElementToRemove)) { - // Copy over user data (that includes AngularJS's $scope etc.). Don't copy private - // data here because there's no public interface in jQuery to do that and copying over - // event listeners (which is the main use of private data) wouldn't work anyway. - jqLite.data(newNode, jqLite.data(firstElementToRemove)); - - // Remove $destroy event listeners from `firstElementToRemove` - jqLite(firstElementToRemove).off('$destroy'); - } - - // Cleanup any data/listeners on the elements and children. - // This includes invoking the $destroy event on any elements with listeners. - jqLite.cleanData(fragment.querySelectorAll('*')); - - // Update the jqLite collection to only contain the `newNode` - for (i = 1; i < removeCount; i++) { - delete elementsToRemove[i]; - } - elementsToRemove[0] = newNode; - elementsToRemove.length = 1; - } - - - function cloneAndAnnotateFn(fn, annotation) { - return extend(function() { return fn.apply(null, arguments); }, fn, annotation); - } - - - function invokeLinkFn(linkFn, scope, $element, attrs, controllers, transcludeFn) { - try { - linkFn(scope, $element, attrs, controllers, transcludeFn); - } catch (e) { - $exceptionHandler(e, startingTag($element)); - } - } - - function strictBindingsCheck(attrName, directiveName) { - if (strictComponentBindingsEnabled) { - throw $compileMinErr('missingattr', - 'Attribute \'{0}\' of \'{1}\' is non-optional and must be set!', - attrName, directiveName); - } - } - - // Set up $watches for isolate scope and controller bindings. - function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) { - var removeWatchCollection = []; - var initialChanges = {}; - var changes; - - forEach(bindings, function initializeBinding(definition, scopeName) { - var attrName = definition.attrName, - optional = definition.optional, - mode = definition.mode, // @, =, <, or & - lastValue, - parentGet, parentSet, compare, removeWatch; - - switch (mode) { - - case '@': - if (!optional && !hasOwnProperty.call(attrs, attrName)) { - strictBindingsCheck(attrName, directive.name); - destination[scopeName] = attrs[attrName] = undefined; - - } - removeWatch = attrs.$observe(attrName, function(value) { - if (isString(value) || isBoolean(value)) { - var oldValue = destination[scopeName]; - recordChanges(scopeName, value, oldValue); - destination[scopeName] = value; - } - }); - attrs.$$observers[attrName].$$scope = scope; - lastValue = attrs[attrName]; - if (isString(lastValue)) { - // If the attribute has been provided then we trigger an interpolation to ensure - // the value is there for use in the link fn - destination[scopeName] = $interpolate(lastValue)(scope); - } else if (isBoolean(lastValue)) { - // If the attributes is one of the BOOLEAN_ATTR then AngularJS will have converted - // the value to boolean rather than a string, so we special case this situation - destination[scopeName] = lastValue; - } - initialChanges[scopeName] = new SimpleChange(_UNINITIALIZED_VALUE, destination[scopeName]); - removeWatchCollection.push(removeWatch); - break; - - case '=': - if (!hasOwnProperty.call(attrs, attrName)) { - if (optional) break; - strictBindingsCheck(attrName, directive.name); - attrs[attrName] = undefined; - } - if (optional && !attrs[attrName]) break; - - parentGet = $parse(attrs[attrName]); - if (parentGet.literal) { - compare = equals; - } else { - compare = simpleCompare; - } - parentSet = parentGet.assign || function() { - // reset the change, or we will throw this exception on every $digest - lastValue = destination[scopeName] = parentGet(scope); - throw $compileMinErr('nonassign', - 'Expression \'{0}\' in attribute \'{1}\' used with directive \'{2}\' is non-assignable!', - attrs[attrName], attrName, directive.name); - }; - lastValue = destination[scopeName] = parentGet(scope); - var parentValueWatch = function parentValueWatch(parentValue) { - if (!compare(parentValue, destination[scopeName])) { - // we are out of sync and need to copy - if (!compare(parentValue, lastValue)) { - // parent changed and it has precedence - destination[scopeName] = parentValue; - } else { - // if the parent can be assigned then do so - parentSet(scope, parentValue = destination[scopeName]); - } - } - lastValue = parentValue; - return lastValue; - }; - parentValueWatch.$stateful = true; - if (definition.collection) { - removeWatch = scope.$watchCollection(attrs[attrName], parentValueWatch); - } else { - removeWatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal); - } - removeWatchCollection.push(removeWatch); - break; - - case '<': - if (!hasOwnProperty.call(attrs, attrName)) { - if (optional) break; - strictBindingsCheck(attrName, directive.name); - attrs[attrName] = undefined; - } - if (optional && !attrs[attrName]) break; - - parentGet = $parse(attrs[attrName]); - var deepWatch = parentGet.literal; - - var initialValue = destination[scopeName] = parentGet(scope); - initialChanges[scopeName] = new SimpleChange(_UNINITIALIZED_VALUE, destination[scopeName]); - - removeWatch = scope.$watch(parentGet, function parentValueWatchAction(newValue, oldValue) { - if (oldValue === newValue) { - if (oldValue === initialValue || (deepWatch && equals(oldValue, initialValue))) { - return; - } - oldValue = initialValue; - } - recordChanges(scopeName, newValue, oldValue); - destination[scopeName] = newValue; - }, deepWatch); - - removeWatchCollection.push(removeWatch); - break; - - case '&': - if (!optional && !hasOwnProperty.call(attrs, attrName)) { - strictBindingsCheck(attrName, directive.name); - } - // Don't assign Object.prototype method to scope - parentGet = attrs.hasOwnProperty(attrName) ? $parse(attrs[attrName]) : noop; - - // Don't assign noop to destination if expression is not valid - if (parentGet === noop && optional) break; - - destination[scopeName] = function(locals) { - return parentGet(scope, locals); - }; - break; - } - }); - - function recordChanges(key, currentValue, previousValue) { - if (isFunction(destination.$onChanges) && !simpleCompare(currentValue, previousValue)) { - // If we have not already scheduled the top level onChangesQueue handler then do so now - if (!onChangesQueue) { - scope.$$postDigest(flushOnChangesQueue); - onChangesQueue = []; - } - // If we have not already queued a trigger of onChanges for this controller then do so now - if (!changes) { - changes = {}; - onChangesQueue.push(triggerOnChangesHook); - } - // If the has been a change on this property already then we need to reuse the previous value - if (changes[key]) { - previousValue = changes[key].previousValue; - } - // Store this change - changes[key] = new SimpleChange(previousValue, currentValue); - } - } - - function triggerOnChangesHook() { - destination.$onChanges(changes); - // Now clear the changes so that we schedule onChanges when more changes arrive - changes = undefined; - } - - return { - initialChanges: initialChanges, - removeWatches: removeWatchCollection.length && function removeWatches() { - for (var i = 0, ii = removeWatchCollection.length; i < ii; ++i) { - removeWatchCollection[i](); - } - } - }; - } - }]; - } - - function SimpleChange(previous, current) { - this.previousValue = previous; - this.currentValue = current; - } - SimpleChange.prototype.isFirstChange = function() { return this.previousValue === _UNINITIALIZED_VALUE; }; - - - var PREFIX_REGEXP = /^((?:x|data)[:\-_])/i; - var SPECIAL_CHARS_REGEXP = /[:\-_]+(.)/g; - - /** - * Converts all accepted directives format into proper directive name. - * @param name Name to normalize - */ - function directiveNormalize(name) { - return name - .replace(PREFIX_REGEXP, '') - .replace(SPECIAL_CHARS_REGEXP, function(_, letter, offset) { - return offset ? letter.toUpperCase() : letter; - }); - } - - /** - * @ngdoc type - * @name $compile.directive.Attributes - * - * @description - * A shared object between directive compile / linking functions which contains normalized DOM - * element attributes. The values reflect current binding state `{{ }}`. The normalization is - * needed since all of these are treated as equivalent in AngularJS: - * - * ``` - * - * ``` - */ - - /** - * @ngdoc property - * @name $compile.directive.Attributes#$attr - * - * @description - * A map of DOM element attribute names to the normalized name. This is - * needed to do reverse lookup from normalized name back to actual name. - */ - - - /** - * @ngdoc method - * @name $compile.directive.Attributes#$set - * @kind function - * - * @description - * Set DOM element attribute value. - * - * - * @param {string} name Normalized element attribute name of the property to modify. The name is - * reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr} - * property to the original name. - * @param {string} value Value to set the attribute to. The value can be an interpolated string. - */ - - - - /** - * Closure compiler type information - */ - - function nodesetLinkingFn( - /* angular.Scope */ scope, - /* NodeList */ nodeList, - /* Element */ rootElement, - /* function(Function) */ boundTranscludeFn - ) {} - - function directiveLinkingFn( - /* nodesetLinkingFn */ nodesetLinkingFn, - /* angular.Scope */ scope, - /* Node */ node, - /* Element */ rootElement, - /* function(Function) */ boundTranscludeFn - ) {} - - function tokenDifference(str1, str2) { - var values = '', - tokens1 = str1.split(/\s+/), - tokens2 = str2.split(/\s+/); - - outer: - for (var i = 0; i < tokens1.length; i++) { - var token = tokens1[i]; - for (var j = 0; j < tokens2.length; j++) { - if (token === tokens2[j]) continue outer; - } - values += (values.length > 0 ? ' ' : '') + token; - } - return values; - } - - function removeComments(jqNodes) { - jqNodes = jqLite(jqNodes); - var i = jqNodes.length; - - if (i <= 1) { - return jqNodes; - } - - while (i--) { - var node = jqNodes[i]; - if (node.nodeType === NODE_TYPE_COMMENT || - (node.nodeType === NODE_TYPE_TEXT && node.nodeValue.trim() === '')) { - splice.call(jqNodes, i, 1); - } - } - return jqNodes; - } - - var $controllerMinErr = minErr('$controller'); - - - var CNTRL_REG = /^(\S+)(\s+as\s+([\w$]+))?$/; - function identifierForController(controller, ident) { - if (ident && isString(ident)) return ident; - if (isString(controller)) { - var match = CNTRL_REG.exec(controller); - if (match) return match[3]; - } - } - - - /** - * @ngdoc provider - * @name $controllerProvider - * @this - * - * @description - * The {@link ng.$controller $controller service} is used by AngularJS to create new - * controllers. - * - * This provider allows controller registration via the - * {@link ng.$controllerProvider#register register} method. - */ - function $ControllerProvider() { - var controllers = {}, - globals = false; - - /** - * @ngdoc method - * @name $controllerProvider#has - * @param {string} name Controller name to check. - */ - this.has = function(name) { - return controllers.hasOwnProperty(name); - }; - - /** - * @ngdoc method - * @name $controllerProvider#register - * @param {string|Object} name Controller name, or an object map of controllers where the keys are - * the names and the values are the constructors. - * @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI - * annotations in the array notation). - */ - this.register = function(name, constructor) { - assertNotHasOwnProperty(name, 'controller'); - if (isObject(name)) { - extend(controllers, name); - } else { - controllers[name] = constructor; - } - }; - - /** - * @ngdoc method - * @name $controllerProvider#allowGlobals - * @description If called, allows `$controller` to find controller constructors on `window` - * - * @deprecated - * sinceVersion="v1.3.0" - * removeVersion="v1.7.0" - * This method of finding controllers has been deprecated. - */ - this.allowGlobals = function() { - globals = true; - }; - - - this.$get = ['$injector', '$window', function($injector, $window) { - - /** - * @ngdoc service - * @name $controller - * @requires $injector - * - * @param {Function|string} constructor If called with a function then it's considered to be the - * controller constructor function. Otherwise it's considered to be a string which is used - * to retrieve the controller constructor using the following steps: - * - * * check if a controller with given name is registered via `$controllerProvider` - * * check if evaluating the string on the current scope returns a constructor - * * if $controllerProvider#allowGlobals, check `window[constructor]` on the global - * `window` object (deprecated, not recommended) - * - * The string can use the `controller as property` syntax, where the controller instance is published - * as the specified property on the `scope`; the `scope` must be injected into `locals` param for this - * to work correctly. - * - * @param {Object} locals Injection locals for Controller. - * @return {Object} Instance of given controller. - * - * @description - * `$controller` service is responsible for instantiating controllers. - * - * It's just a simple call to {@link auto.$injector $injector}, but extracted into - * a service, so that one can override this service with [BC version](https://gist.github.com/1649788). - */ - return function $controller(expression, locals, later, ident) { - // PRIVATE API: - // param `later` --- indicates that the controller's constructor is invoked at a later time. - // If true, $controller will allocate the object with the correct - // prototype chain, but will not invoke the controller until a returned - // callback is invoked. - // param `ident` --- An optional label which overrides the label parsed from the controller - // expression, if any. - var instance, match, constructor, identifier; - later = later === true; - if (ident && isString(ident)) { - identifier = ident; - } - - if (isString(expression)) { - match = expression.match(CNTRL_REG); - if (!match) { - throw $controllerMinErr('ctrlfmt', - 'Badly formed controller string \'{0}\'. ' + - 'Must match `__name__ as __id__` or `__name__`.', expression); - } - constructor = match[1]; - identifier = identifier || match[3]; - expression = controllers.hasOwnProperty(constructor) - ? controllers[constructor] - : getter(locals.$scope, constructor, true) || - (globals ? getter($window, constructor, true) : undefined); - - if (!expression) { - throw $controllerMinErr('ctrlreg', - 'The controller with the name \'{0}\' is not registered.', constructor); - } - - assertArgFn(expression, constructor, true); - } - - if (later) { - // Instantiate controller later: - // This machinery is used to create an instance of the object before calling the - // controller's constructor itself. - // - // This allows properties to be added to the controller before the constructor is - // invoked. Primarily, this is used for isolate scope bindings in $compile. - // - // This feature is not intended for use by applications, and is thus not documented - // publicly. - // Object creation: http://jsperf.com/create-constructor/2 - var controllerPrototype = (isArray(expression) ? - expression[expression.length - 1] : expression).prototype; - instance = Object.create(controllerPrototype || null); - - if (identifier) { - addIdentifier(locals, identifier, instance, constructor || expression.name); - } - - return extend(function $controllerInit() { - var result = $injector.invoke(expression, instance, locals, constructor); - if (result !== instance && (isObject(result) || isFunction(result))) { - instance = result; - if (identifier) { - // If result changed, re-assign controllerAs value to scope. - addIdentifier(locals, identifier, instance, constructor || expression.name); - } - } - return instance; - }, { - instance: instance, - identifier: identifier - }); - } - - instance = $injector.instantiate(expression, locals, constructor); - - if (identifier) { - addIdentifier(locals, identifier, instance, constructor || expression.name); - } - - return instance; - }; - - function addIdentifier(locals, identifier, instance, name) { - if (!(locals && isObject(locals.$scope))) { - throw minErr('$controller')('noscp', - 'Cannot export controller \'{0}\' as \'{1}\'! No $scope object provided via `locals`.', - name, identifier); - } - - locals.$scope[identifier] = instance; - } - }]; - } - - /** - * @ngdoc service - * @name $document - * @requires $window - * @this - * - * @description - * A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object. - * - * @example - - -
    -

    $document title:

    -

    window.document title:

    -
    -
    - - angular.module('documentExample', []) - .controller('ExampleController', ['$scope', '$document', function($scope, $document) { - $scope.title = $document[0].title; - $scope.windowTitle = angular.element(window.document)[0].title; - }]); - -
    - */ - function $DocumentProvider() { - this.$get = ['$window', function(window) { - return jqLite(window.document); - }]; - } - - - /** - * @private - * @this - * Listens for document visibility change and makes the current status accessible. - */ - function $$IsDocumentHiddenProvider() { - this.$get = ['$document', '$rootScope', function($document, $rootScope) { - var doc = $document[0]; - var hidden = doc && doc.hidden; - - $document.on('visibilitychange', changeListener); - - $rootScope.$on('$destroy', function() { - $document.off('visibilitychange', changeListener); - }); - - function changeListener() { - hidden = doc.hidden; - } - - return function() { - return hidden; - }; - }]; - } - - /** - * @ngdoc service - * @name $exceptionHandler - * @requires ng.$log - * @this - * - * @description - * Any uncaught exception in AngularJS expressions is delegated to this service. - * The default implementation simply delegates to `$log.error` which logs it into - * the browser console. - * - * In unit tests, if `angular-mocks.js` is loaded, this service is overridden by - * {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing. - * - * ## Example: - * - * The example below will overwrite the default `$exceptionHandler` in order to (a) log uncaught - * errors to the backend for later inspection by the developers and (b) to use `$log.warn()` instead - * of `$log.error()`. - * - * ```js - * angular. - * module('exceptionOverwrite', []). - * factory('$exceptionHandler', ['$log', 'logErrorsToBackend', function($log, logErrorsToBackend) { - * return function myExceptionHandler(exception, cause) { - * logErrorsToBackend(exception, cause); - * $log.warn(exception, cause); - * }; - * }]); - * ``` - * - *
    - * Note, that code executed in event-listeners (even those registered using jqLite's `on`/`bind` - * methods) does not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler} - * (unless executed during a digest). - * - * If you wish, you can manually delegate exceptions, e.g. - * `try { ... } catch(e) { $exceptionHandler(e); }` - * - * @param {Error} exception Exception associated with the error. - * @param {string=} cause Optional information about the context in which - * the error was thrown. - * - */ - function $ExceptionHandlerProvider() { - this.$get = ['$log', function($log) { - return function(exception, cause) { - $log.error.apply($log, arguments); - }; - }]; - } - - var $$ForceReflowProvider = /** @this */ function() { - this.$get = ['$document', function($document) { - return function(domNode) { - //the line below will force the browser to perform a repaint so - //that all the animated elements within the animation frame will - //be properly updated and drawn on screen. This is required to - //ensure that the preparation animation is properly flushed so that - //the active state picks up from there. DO NOT REMOVE THIS LINE. - //DO NOT OPTIMIZE THIS LINE. THE MINIFIER WILL REMOVE IT OTHERWISE WHICH - //WILL RESULT IN AN UNPREDICTABLE BUG THAT IS VERY HARD TO TRACK DOWN AND - //WILL TAKE YEARS AWAY FROM YOUR LIFE. - if (domNode) { - if (!domNode.nodeType && domNode instanceof jqLite) { - domNode = domNode[0]; - } - } else { - domNode = $document[0].body; - } - return domNode.offsetWidth + 1; - }; - }]; - }; - - var APPLICATION_JSON = 'application/json'; - var CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': APPLICATION_JSON + ';charset=utf-8'}; - var JSON_START = /^\[|^\{(?!\{)/; - var JSON_ENDS = { - '[': /]$/, - '{': /}$/ - }; - var JSON_PROTECTION_PREFIX = /^\)]\}',?\n/; - var $httpMinErr = minErr('$http'); - - function serializeValue(v) { - if (isObject(v)) { - return isDate(v) ? v.toISOString() : toJson(v); - } - return v; - } - - - /** @this */ - function $HttpParamSerializerProvider() { - /** - * @ngdoc service - * @name $httpParamSerializer - * @description - * - * Default {@link $http `$http`} params serializer that converts objects to strings - * according to the following rules: - * - * * `{'foo': 'bar'}` results in `foo=bar` - * * `{'foo': Date.now()}` results in `foo=2015-04-01T09%3A50%3A49.262Z` (`toISOString()` and encoded representation of a Date object) - * * `{'foo': ['bar', 'baz']}` results in `foo=bar&foo=baz` (repeated key for each array element) - * * `{'foo': {'bar':'baz'}}` results in `foo=%7B%22bar%22%3A%22baz%22%7D` (stringified and encoded representation of an object) - * - * Note that serializer will sort the request parameters alphabetically. - * */ - - this.$get = function() { - return function ngParamSerializer(params) { - if (!params) return ''; - var parts = []; - forEachSorted(params, function(value, key) { - if (value === null || isUndefined(value) || isFunction(value)) return; - if (isArray(value)) { - forEach(value, function(v) { - parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(v))); - }); - } else { - parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(value))); - } - }); - - return parts.join('&'); - }; - }; - } - - /** @this */ - function $HttpParamSerializerJQLikeProvider() { - /** - * @ngdoc service - * @name $httpParamSerializerJQLike - * - * @description - * - * Alternative {@link $http `$http`} params serializer that follows - * jQuery's [`param()`](http://api.jquery.com/jquery.param/) method logic. - * The serializer will also sort the params alphabetically. - * - * To use it for serializing `$http` request parameters, set it as the `paramSerializer` property: - * - * ```js - * $http({ - * url: myUrl, - * method: 'GET', - * params: myParams, - * paramSerializer: '$httpParamSerializerJQLike' - * }); - * ``` - * - * It is also possible to set it as the default `paramSerializer` in the - * {@link $httpProvider#defaults `$httpProvider`}. - * - * Additionally, you can inject the serializer and use it explicitly, for example to serialize - * form data for submission: - * - * ```js - * .controller(function($http, $httpParamSerializerJQLike) { - * //... - * - * $http({ - * url: myUrl, - * method: 'POST', - * data: $httpParamSerializerJQLike(myData), - * headers: { - * 'Content-Type': 'application/x-www-form-urlencoded' - * } - * }); - * - * }); - * ``` - * - * */ - this.$get = function() { - return function jQueryLikeParamSerializer(params) { - if (!params) return ''; - var parts = []; - serialize(params, '', true); - return parts.join('&'); - - function serialize(toSerialize, prefix, topLevel) { - if (toSerialize === null || isUndefined(toSerialize)) return; - if (isArray(toSerialize)) { - forEach(toSerialize, function(value, index) { - serialize(value, prefix + '[' + (isObject(value) ? index : '') + ']'); - }); - } else if (isObject(toSerialize) && !isDate(toSerialize)) { - forEachSorted(toSerialize, function(value, key) { - serialize(value, prefix + - (topLevel ? '' : '[') + - key + - (topLevel ? '' : ']')); - }); - } else { - parts.push(encodeUriQuery(prefix) + '=' + encodeUriQuery(serializeValue(toSerialize))); - } - } - }; - }; - } - - function defaultHttpResponseTransform(data, headers) { - if (isString(data)) { - // Strip json vulnerability protection prefix and trim whitespace - var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim(); - - if (tempData) { - var contentType = headers('Content-Type'); - var hasJsonContentType = contentType && (contentType.indexOf(APPLICATION_JSON) === 0); - - if (hasJsonContentType || isJsonLike(tempData)) { - try { - data = fromJson(tempData); - } catch (e) { - if (!hasJsonContentType) { - return data; - } - throw $httpMinErr('baddata', 'Data must be a valid JSON object. Received: "{0}". ' + - 'Parse error: "{1}"', data, e); - } - } - } - } - - return data; - } - - function isJsonLike(str) { - var jsonStart = str.match(JSON_START); - return jsonStart && JSON_ENDS[jsonStart[0]].test(str); - } - - /** - * Parse headers into key value object - * - * @param {string} headers Raw headers as a string - * @returns {Object} Parsed headers as key value object - */ - function parseHeaders(headers) { - var parsed = createMap(), i; - - function fillInParsed(key, val) { - if (key) { - parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; - } - } - - if (isString(headers)) { - forEach(headers.split('\n'), function(line) { - i = line.indexOf(':'); - fillInParsed(lowercase(trim(line.substr(0, i))), trim(line.substr(i + 1))); - }); - } else if (isObject(headers)) { - forEach(headers, function(headerVal, headerKey) { - fillInParsed(lowercase(headerKey), trim(headerVal)); - }); - } - - return parsed; - } - - - /** - * Returns a function that provides access to parsed headers. - * - * Headers are lazy parsed when first requested. - * @see parseHeaders - * - * @param {(string|Object)} headers Headers to provide access to. - * @returns {function(string=)} Returns a getter function which if called with: - * - * - if called with an argument returns a single header value or null - * - if called with no arguments returns an object containing all headers. - */ - function headersGetter(headers) { - var headersObj; - - return function(name) { - if (!headersObj) headersObj = parseHeaders(headers); - - if (name) { - var value = headersObj[lowercase(name)]; - if (value === undefined) { - value = null; - } - return value; - } - - return headersObj; - }; - } - - - /** - * Chain all given functions - * - * This function is used for both request and response transforming - * - * @param {*} data Data to transform. - * @param {function(string=)} headers HTTP headers getter fn. - * @param {number} status HTTP status code of the response. - * @param {(Function|Array.)} fns Function or an array of functions. - * @returns {*} Transformed data. - */ - function transformData(data, headers, status, fns) { - if (isFunction(fns)) { - return fns(data, headers, status); - } - - forEach(fns, function(fn) { - data = fn(data, headers, status); - }); - - return data; - } - - - function isSuccess(status) { - return 200 <= status && status < 300; - } - - - /** - * @ngdoc provider - * @name $httpProvider - * @this - * - * @description - * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service. - * */ - function $HttpProvider() { - /** - * @ngdoc property - * @name $httpProvider#defaults - * @description - * - * Object containing default values for all {@link ng.$http $http} requests. - * - * - **`defaults.cache`** - {boolean|Object} - A boolean value or object created with - * {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of HTTP responses - * by default. See {@link $http#caching $http Caching} for more information. - * - * - **`defaults.headers`** - {Object} - Default headers for all $http requests. - * Refer to {@link ng.$http#setting-http-headers $http} for documentation on - * setting default headers. - * - **`defaults.headers.common`** - * - **`defaults.headers.post`** - * - **`defaults.headers.put`** - * - **`defaults.headers.patch`** - * - * - **`defaults.jsonpCallbackParam`** - `{string}` - the name of the query parameter that passes the name of the - * callback in a JSONP request. The value of this parameter will be replaced with the expression generated by the - * {@link $jsonpCallbacks} service. Defaults to `'callback'`. - * - * - **`defaults.paramSerializer`** - `{string|function(Object):string}` - A function - * used to the prepare string representation of request parameters (specified as an object). - * If specified as string, it is interpreted as a function registered with the {@link auto.$injector $injector}. - * Defaults to {@link ng.$httpParamSerializer $httpParamSerializer}. - * - * - **`defaults.transformRequest`** - - * `{Array|function(data, headersGetter)}` - - * An array of functions (or a single function) which are applied to the request data. - * By default, this is an array with one request transformation function: - * - * - If the `data` property of the request configuration object contains an object, serialize it - * into JSON format. - * - * - **`defaults.transformResponse`** - - * `{Array|function(data, headersGetter, status)}` - - * An array of functions (or a single function) which are applied to the response data. By default, - * this is an array which applies one response transformation function that does two things: - * - * - If XSRF prefix is detected, strip it - * (see {@link ng.$http#security-considerations Security Considerations in the $http docs}). - * - If the `Content-Type` is `application/json` or the response looks like JSON, - * deserialize it using a JSON parser. - * - * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token. - * Defaults value is `'XSRF-TOKEN'`. - * - * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the - * XSRF token. Defaults value is `'X-XSRF-TOKEN'`. - * - **/ - var defaults = this.defaults = { - // transform incoming response data - transformResponse: [defaultHttpResponseTransform], - - // transform outgoing request data - transformRequest: [function(d) { - return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d) ? toJson(d) : d; - }], - - // default headers - headers: { - common: { - 'Accept': 'application/json, text/plain, */*' - }, - post: shallowCopy(CONTENT_TYPE_APPLICATION_JSON), - put: shallowCopy(CONTENT_TYPE_APPLICATION_JSON), - patch: shallowCopy(CONTENT_TYPE_APPLICATION_JSON) - }, - - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', - - paramSerializer: '$httpParamSerializer', - - jsonpCallbackParam: 'callback' - }; - - var useApplyAsync = false; - /** - * @ngdoc method - * @name $httpProvider#useApplyAsync - * @description - * - * Configure $http service to combine processing of multiple http responses received at around - * the same time via {@link ng.$rootScope.Scope#$applyAsync $rootScope.$applyAsync}. This can result in - * significant performance improvement for bigger applications that make many HTTP requests - * concurrently (common during application bootstrap). - * - * Defaults to false. If no value is specified, returns the current configured value. - * - * @param {boolean=} value If true, when requests are loaded, they will schedule a deferred - * "apply" on the next tick, giving time for subsequent requests in a roughly ~10ms window - * to load and share the same digest cycle. - * - * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining. - * otherwise, returns the current configured value. - **/ - this.useApplyAsync = function(value) { - if (isDefined(value)) { - useApplyAsync = !!value; - return this; - } - return useApplyAsync; - }; - - /** - * @ngdoc property - * @name $httpProvider#interceptors - * @description - * - * Array containing service factories for all synchronous or asynchronous {@link ng.$http $http} - * pre-processing of request or postprocessing of responses. - * - * These service factories are ordered by request, i.e. they are applied in the same order as the - * array, on request, but reverse order, on response. - * - * {@link ng.$http#interceptors Interceptors detailed info} - **/ - var interceptorFactories = this.interceptors = []; - - this.$get = ['$browser', '$httpBackend', '$$cookieReader', '$cacheFactory', '$rootScope', '$q', '$injector', '$sce', - function($browser, $httpBackend, $$cookieReader, $cacheFactory, $rootScope, $q, $injector, $sce) { - - var defaultCache = $cacheFactory('$http'); - - /** - * Make sure that default param serializer is exposed as a function - */ - defaults.paramSerializer = isString(defaults.paramSerializer) ? - $injector.get(defaults.paramSerializer) : defaults.paramSerializer; - - /** - * Interceptors stored in reverse order. Inner interceptors before outer interceptors. - * The reversal is needed so that we can build up the interception chain around the - * server request. - */ - var reversedInterceptors = []; - - forEach(interceptorFactories, function(interceptorFactory) { - reversedInterceptors.unshift(isString(interceptorFactory) - ? $injector.get(interceptorFactory) : $injector.invoke(interceptorFactory)); - }); - - /** - * @ngdoc service - * @kind function - * @name $http - * @requires ng.$httpBackend - * @requires $cacheFactory - * @requires $rootScope - * @requires $q - * @requires $injector - * - * @description - * The `$http` service is a core AngularJS service that facilitates communication with the remote - * HTTP servers via the browser's [XMLHttpRequest](https://developer.mozilla.org/en/xmlhttprequest) - * object or via [JSONP](http://en.wikipedia.org/wiki/JSONP). - * - * For unit testing applications that use `$http` service, see - * {@link ngMock.$httpBackend $httpBackend mock}. - * - * For a higher level of abstraction, please check out the {@link ngResource.$resource - * $resource} service. - * - * The $http API is based on the {@link ng.$q deferred/promise APIs} exposed by - * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage - * it is important to familiarize yourself with these APIs and the guarantees they provide. - * - * - * ## General usage - * The `$http` service is a function which takes a single argument — a {@link $http#usage configuration object} — - * that is used to generate an HTTP request and returns a {@link ng.$q promise}. - * - * ```js - * // Simple GET request example: - * $http({ - * method: 'GET', - * url: '/someUrl' - * }).then(function successCallback(response) { - * // this callback will be called asynchronously - * // when the response is available - * }, function errorCallback(response) { - * // called asynchronously if an error occurs - * // or server returns response with an error status. - * }); - * ``` - * - * The response object has these properties: - * - * - **data** – `{string|Object}` – The response body transformed with the transform - * functions. - * - **status** – `{number}` – HTTP status code of the response. - * - **headers** – `{function([headerName])}` – Header getter function. - * - **config** – `{Object}` – The configuration object that was used to generate the request. - * - **statusText** – `{string}` – HTTP status text of the response. - * - **xhrStatus** – `{string}` – Status of the XMLHttpRequest (`complete`, `error`, `timeout` or `abort`). - * - * A response status code between 200 and 299 is considered a success status and will result in - * the success callback being called. Any response status code outside of that range is - * considered an error status and will result in the error callback being called. - * Also, status codes less than -1 are normalized to zero. -1 usually means the request was - * aborted, e.g. using a `config.timeout`. - * Note that if the response is a redirect, XMLHttpRequest will transparently follow it, meaning - * that the outcome (success or error) will be determined by the final response status code. - * - * - * ## Shortcut methods - * - * Shortcut methods are also available. All shortcut methods require passing in the URL, and - * request data must be passed in for POST/PUT requests. An optional config can be passed as the - * last argument. - * - * ```js - * $http.get('/someUrl', config).then(successCallback, errorCallback); - * $http.post('/someUrl', data, config).then(successCallback, errorCallback); - * ``` - * - * Complete list of shortcut methods: - * - * - {@link ng.$http#get $http.get} - * - {@link ng.$http#head $http.head} - * - {@link ng.$http#post $http.post} - * - {@link ng.$http#put $http.put} - * - {@link ng.$http#delete $http.delete} - * - {@link ng.$http#jsonp $http.jsonp} - * - {@link ng.$http#patch $http.patch} - * - * - * ## Writing Unit Tests that use $http - * When unit testing (using {@link ngMock ngMock}), it is necessary to call - * {@link ngMock.$httpBackend#flush $httpBackend.flush()} to flush each pending - * request using trained responses. - * - * ``` - * $httpBackend.expectGET(...); - * $http.get(...); - * $httpBackend.flush(); - * ``` - * - * ## Setting HTTP Headers - * - * The $http service will automatically add certain HTTP headers to all requests. These defaults - * can be fully configured by accessing the `$httpProvider.defaults.headers` configuration - * object, which currently contains this default configuration: - * - * - `$httpProvider.defaults.headers.common` (headers that are common for all requests): - * - Accept: application/json, text/plain, \*/\* - * - `$httpProvider.defaults.headers.post`: (header defaults for POST requests) - * - `Content-Type: application/json` - * - `$httpProvider.defaults.headers.put` (header defaults for PUT requests) - * - `Content-Type: application/json` - * - * To add or overwrite these defaults, simply add or remove a property from these configuration - * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object - * with the lowercased HTTP method name as the key, e.g. - * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }`. - * - * The defaults can also be set at runtime via the `$http.defaults` object in the same - * fashion. For example: - * - * ``` - * module.run(function($http) { - * $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w'; - * }); - * ``` - * - * In addition, you can supply a `headers` property in the config object passed when - * calling `$http(config)`, which overrides the defaults without changing them globally. - * - * To explicitly remove a header automatically added via $httpProvider.defaults.headers on a per request basis, - * Use the `headers` property, setting the desired header to `undefined`. For example: - * - * ```js - * var req = { - * method: 'POST', - * url: 'http://example.com', - * headers: { - * 'Content-Type': undefined - * }, - * data: { test: 'test' } - * } - * - * $http(req).then(function(){...}, function(){...}); - * ``` - * - * ## Transforming Requests and Responses - * - * Both requests and responses can be transformed using transformation functions: `transformRequest` - * and `transformResponse`. These properties can be a single function that returns - * the transformed value (`function(data, headersGetter, status)`) or an array of such transformation functions, - * which allows you to `push` or `unshift` a new transformation function into the transformation chain. - * - *
    - * **Note:** AngularJS does not make a copy of the `data` parameter before it is passed into the `transformRequest` pipeline. - * That means changes to the properties of `data` are not local to the transform function (since Javascript passes objects by reference). - * For example, when calling `$http.get(url, $scope.myObject)`, modifications to the object's properties in a transformRequest - * function will be reflected on the scope and in any templates where the object is data-bound. - * To prevent this, transform functions should have no side-effects. - * If you need to modify properties, it is recommended to make a copy of the data, or create new object to return. - *
    - * - * ### Default Transformations - * - * The `$httpProvider` provider and `$http` service expose `defaults.transformRequest` and - * `defaults.transformResponse` properties. If a request does not provide its own transformations - * then these will be applied. - * - * You can augment or replace the default transformations by modifying these properties by adding to or - * replacing the array. - * - * AngularJS provides the following default transformations: - * - * Request transformations (`$httpProvider.defaults.transformRequest` and `$http.defaults.transformRequest`) is - * an array with one function that does the following: - * - * - If the `data` property of the request configuration object contains an object, serialize it - * into JSON format. - * - * Response transformations (`$httpProvider.defaults.transformResponse` and `$http.defaults.transformResponse`) is - * an array with one function that does the following: - * - * - If XSRF prefix is detected, strip it (see Security Considerations section below). - * - If the `Content-Type` is `application/json` or the response looks like JSON, - * deserialize it using a JSON parser. - * - * - * ### Overriding the Default Transformations Per Request - * - * If you wish to override the request/response transformations only for a single request then provide - * `transformRequest` and/or `transformResponse` properties on the configuration object passed - * into `$http`. - * - * Note that if you provide these properties on the config object the default transformations will be - * overwritten. If you wish to augment the default transformations then you must include them in your - * local transformation array. - * - * The following code demonstrates adding a new response transformation to be run after the default response - * transformations have been run. - * - * ```js - * function appendTransform(defaults, transform) { - * - * // We can't guarantee that the default transformation is an array - * defaults = angular.isArray(defaults) ? defaults : [defaults]; - * - * // Append the new transformation to the defaults - * return defaults.concat(transform); - * } - * - * $http({ - * url: '...', - * method: 'GET', - * transformResponse: appendTransform($http.defaults.transformResponse, function(value) { - * return doTransform(value); - * }) - * }); - * ``` - * - * - * ## Caching - * - * {@link ng.$http `$http`} responses are not cached by default. To enable caching, you must - * set the config.cache value or the default cache value to TRUE or to a cache object (created - * with {@link ng.$cacheFactory `$cacheFactory`}). If defined, the value of config.cache takes - * precedence over the default cache value. - * - * In order to: - * * cache all responses - set the default cache value to TRUE or to a cache object - * * cache a specific response - set config.cache value to TRUE or to a cache object - * - * If caching is enabled, but neither the default cache nor config.cache are set to a cache object, - * then the default `$cacheFactory("$http")` object is used. - * - * The default cache value can be set by updating the - * {@link ng.$http#defaults `$http.defaults.cache`} property or the - * {@link $httpProvider#defaults `$httpProvider.defaults.cache`} property. - * - * When caching is enabled, {@link ng.$http `$http`} stores the response from the server using - * the relevant cache object. The next time the same request is made, the response is returned - * from the cache without sending a request to the server. - * - * Take note that: - * - * * Only GET and JSONP requests are cached. - * * The cache key is the request URL including search parameters; headers are not considered. - * * Cached responses are returned asynchronously, in the same way as responses from the server. - * * If multiple identical requests are made using the same cache, which is not yet populated, - * one request will be made to the server and remaining requests will return the same response. - * * A cache-control header on the response does not affect if or how responses are cached. - * - * - * ## Interceptors - * - * Before you start creating interceptors, be sure to understand the - * {@link ng.$q $q and deferred/promise APIs}. - * - * For purposes of global error handling, authentication, or any kind of synchronous or - * asynchronous pre-processing of request or postprocessing of responses, it is desirable to be - * able to intercept requests before they are handed to the server and - * responses before they are handed over to the application code that - * initiated these requests. The interceptors leverage the {@link ng.$q - * promise APIs} to fulfill this need for both synchronous and asynchronous pre-processing. - * - * The interceptors are service factories that are registered with the `$httpProvider` by - * adding them to the `$httpProvider.interceptors` array. The factory is called and - * injected with dependencies (if specified) and returns the interceptor. - * - * There are two kinds of interceptors (and two kinds of rejection interceptors): - * - * * `request`: interceptors get called with a http {@link $http#usage config} object. The function is free to - * modify the `config` object or create a new one. The function needs to return the `config` - * object directly, or a promise containing the `config` or a new `config` object. - * * `requestError`: interceptor gets called when a previous interceptor threw an error or - * resolved with a rejection. - * * `response`: interceptors get called with http `response` object. The function is free to - * modify the `response` object or create a new one. The function needs to return the `response` - * object directly, or as a promise containing the `response` or a new `response` object. - * * `responseError`: interceptor gets called when a previous interceptor threw an error or - * resolved with a rejection. - * - * - * ```js - * // register the interceptor as a service - * $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) { - * return { - * // optional method - * 'request': function(config) { - * // do something on success - * return config; - * }, - * - * // optional method - * 'requestError': function(rejection) { - * // do something on error - * if (canRecover(rejection)) { - * return responseOrNewPromise - * } - * return $q.reject(rejection); - * }, - * - * - * - * // optional method - * 'response': function(response) { - * // do something on success - * return response; - * }, - * - * // optional method - * 'responseError': function(rejection) { - * // do something on error - * if (canRecover(rejection)) { - * return responseOrNewPromise - * } - * return $q.reject(rejection); - * } - * }; - * }); - * - * $httpProvider.interceptors.push('myHttpInterceptor'); - * - * - * // alternatively, register the interceptor via an anonymous factory - * $httpProvider.interceptors.push(function($q, dependency1, dependency2) { - * return { - * 'request': function(config) { - * // same as above - * }, - * - * 'response': function(response) { - * // same as above - * } - * }; - * }); - * ``` - * - * ## Security Considerations - * - * When designing web applications, consider security threats from: - * - * - [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx) - * - [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) - * - * Both server and the client must cooperate in order to eliminate these threats. AngularJS comes - * pre-configured with strategies that address these issues, but for this to work backend server - * cooperation is required. - * - * ### JSON Vulnerability Protection - * - * A [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx) - * allows third party website to turn your JSON resource URL into - * [JSONP](http://en.wikipedia.org/wiki/JSONP) request under some conditions. To - * counter this your server can prefix all JSON requests with following string `")]}',\n"`. - * AngularJS will automatically strip the prefix before processing it as JSON. - * - * For example if your server needs to return: - * ```js - * ['one','two'] - * ``` - * - * which is vulnerable to attack, your server can return: - * ```js - * )]}', - * ['one','two'] - * ``` - * - * AngularJS will strip the prefix, before processing the JSON. - * - * - * ### Cross Site Request Forgery (XSRF) Protection - * - * [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) is an attack technique by - * which the attacker can trick an authenticated user into unknowingly executing actions on your - * website. AngularJS provides a mechanism to counter XSRF. When performing XHR requests, the - * $http service reads a token from a cookie (by default, `XSRF-TOKEN`) and sets it as an HTTP - * header (`X-XSRF-TOKEN`). Since only JavaScript that runs on your domain could read the - * cookie, your server can be assured that the XHR came from JavaScript running on your domain. - * The header will not be set for cross-domain requests. - * - * To take advantage of this, your server needs to set a token in a JavaScript readable session - * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the - * server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure - * that only JavaScript running on your domain could have sent the request. The token must be - * unique for each user and must be verifiable by the server (to prevent the JavaScript from - * making up its own tokens). We recommend that the token is a digest of your site's - * authentication cookie with a [salt](https://en.wikipedia.org/wiki/Salt_(cryptography)) - * for added security. - * - * The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName - * properties of either $httpProvider.defaults at config-time, $http.defaults at run-time, - * or the per-request config object. - * - * In order to prevent collisions in environments where multiple AngularJS apps share the - * same domain or subdomain, we recommend that each application uses unique cookie name. - * - * @param {object} config Object describing the request to be made and how it should be - * processed. The object has following properties: - * - * - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc) - * - **url** – `{string|TrustedObject}` – Absolute or relative URL of the resource that is being requested; - * or an object created by a call to `$sce.trustAsResourceUrl(url)`. - * - **params** – `{Object.}` – Map of strings or objects which will be serialized - * with the `paramSerializer` and appended as GET parameters. - * - **data** – `{string|Object}` – Data to be sent as the request message data. - * - **headers** – `{Object}` – Map of strings or functions which return strings representing - * HTTP headers to send to the server. If the return value of a function is null, the - * header will not be sent. Functions accept a config object as an argument. - * - **eventHandlers** - `{Object}` - Event listeners to be bound to the XMLHttpRequest object. - * To bind events to the XMLHttpRequest upload object, use `uploadEventHandlers`. - * The handler will be called in the context of a `$apply` block. - * - **uploadEventHandlers** - `{Object}` - Event listeners to be bound to the XMLHttpRequest upload - * object. To bind events to the XMLHttpRequest object, use `eventHandlers`. - * The handler will be called in the context of a `$apply` block. - * - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token. - * - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token. - * - **transformRequest** – - * `{function(data, headersGetter)|Array.}` – - * transform function or an array of such functions. The transform function takes the http - * request body and headers and returns its transformed (typically serialized) version. - * See {@link ng.$http#overriding-the-default-transformations-per-request - * Overriding the Default Transformations} - * - **transformResponse** – - * `{function(data, headersGetter, status)|Array.}` – - * transform function or an array of such functions. The transform function takes the http - * response body, headers and status and returns its transformed (typically deserialized) version. - * See {@link ng.$http#overriding-the-default-transformations-per-request - * Overriding the Default Transformations} - * - **paramSerializer** - `{string|function(Object):string}` - A function used to - * prepare the string representation of request parameters (specified as an object). - * If specified as string, it is interpreted as function registered with the - * {@link $injector $injector}, which means you can create your own serializer - * by registering it as a {@link auto.$provide#service service}. - * The default serializer is the {@link $httpParamSerializer $httpParamSerializer}; - * alternatively, you can use the {@link $httpParamSerializerJQLike $httpParamSerializerJQLike} - * - **cache** – `{boolean|Object}` – A boolean value or object created with - * {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of the HTTP response. - * See {@link $http#caching $http Caching} for more information. - * - **timeout** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise} - * that should abort the request when resolved. - * - **withCredentials** - `{boolean}` - whether to set the `withCredentials` flag on the - * XHR object. See [requests with credentials](https://developer.mozilla.org/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials) - * for more information. - * - **responseType** - `{string}` - see - * [XMLHttpRequest.responseType](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#xmlhttprequest-responsetype). - * - * @returns {HttpPromise} Returns a {@link ng.$q `Promise}` that will be resolved to a response object - * when the request succeeds or fails. - * - * - * @property {Array.} pendingRequests Array of config objects for currently pending - * requests. This is primarily meant to be used for debugging purposes. - * - * - * @example - - -
    - - -
    - - - -
    http status code: {{status}}
    -
    http response data: {{data}}
    -
    -
    - - angular.module('httpExample', []) - .config(['$sceDelegateProvider', function($sceDelegateProvider) { - // We must whitelist the JSONP endpoint that we are using to show that we trust it - $sceDelegateProvider.resourceUrlWhitelist([ - 'self', - 'https://angularjs.org/**' - ]); - }]) - .controller('FetchController', ['$scope', '$http', '$templateCache', - function($scope, $http, $templateCache) { - $scope.method = 'GET'; - $scope.url = 'http-hello.html'; - - $scope.fetch = function() { - $scope.code = null; - $scope.response = null; - - $http({method: $scope.method, url: $scope.url, cache: $templateCache}). - then(function(response) { - $scope.status = response.status; - $scope.data = response.data; - }, function(response) { - $scope.data = response.data || 'Request failed'; - $scope.status = response.status; - }); - }; - - $scope.updateModel = function(method, url) { - $scope.method = method; - $scope.url = url; - }; - }]); - - - Hello, $http! - - - var status = element(by.binding('status')); - var data = element(by.binding('data')); - var fetchBtn = element(by.id('fetchbtn')); - var sampleGetBtn = element(by.id('samplegetbtn')); - var invalidJsonpBtn = element(by.id('invalidjsonpbtn')); - - it('should make an xhr GET request', function() { - sampleGetBtn.click(); - fetchBtn.click(); - expect(status.getText()).toMatch('200'); - expect(data.getText()).toMatch(/Hello, \$http!/); - }); - - // Commented out due to flakes. See https://github.com/angular/angular.js/issues/9185 - // it('should make a JSONP request to angularjs.org', function() { -// var sampleJsonpBtn = element(by.id('samplejsonpbtn')); -// sampleJsonpBtn.click(); -// fetchBtn.click(); -// expect(status.getText()).toMatch('200'); -// expect(data.getText()).toMatch(/Super Hero!/); -// }); - - it('should make JSONP request to invalid URL and invoke the error handler', - function() { - invalidJsonpBtn.click(); - fetchBtn.click(); - expect(status.getText()).toMatch('0'); - expect(data.getText()).toMatch('Request failed'); - }); - -
    - */ - function $http(requestConfig) { - - if (!isObject(requestConfig)) { - throw minErr('$http')('badreq', 'Http request configuration must be an object. Received: {0}', requestConfig); - } - - if (!isString($sce.valueOf(requestConfig.url))) { - throw minErr('$http')('badreq', 'Http request configuration url must be a string or a $sce trusted object. Received: {0}', requestConfig.url); - } - - var config = extend({ - method: 'get', - transformRequest: defaults.transformRequest, - transformResponse: defaults.transformResponse, - paramSerializer: defaults.paramSerializer, - jsonpCallbackParam: defaults.jsonpCallbackParam - }, requestConfig); - - config.headers = mergeHeaders(requestConfig); - config.method = uppercase(config.method); - config.paramSerializer = isString(config.paramSerializer) ? - $injector.get(config.paramSerializer) : config.paramSerializer; - - $browser.$$incOutstandingRequestCount(); - - var requestInterceptors = []; - var responseInterceptors = []; - var promise = $q.resolve(config); - - // apply interceptors - forEach(reversedInterceptors, function(interceptor) { - if (interceptor.request || interceptor.requestError) { - requestInterceptors.unshift(interceptor.request, interceptor.requestError); - } - if (interceptor.response || interceptor.responseError) { - responseInterceptors.push(interceptor.response, interceptor.responseError); - } - }); - - promise = chainInterceptors(promise, requestInterceptors); - promise = promise.then(serverRequest); - promise = chainInterceptors(promise, responseInterceptors); - promise = promise.finally(completeOutstandingRequest); - - return promise; - - - function chainInterceptors(promise, interceptors) { - for (var i = 0, ii = interceptors.length; i < ii;) { - var thenFn = interceptors[i++]; - var rejectFn = interceptors[i++]; - - promise = promise.then(thenFn, rejectFn); - } - - interceptors.length = 0; - - return promise; - } - - function completeOutstandingRequest() { - $browser.$$completeOutstandingRequest(noop); - } - - function executeHeaderFns(headers, config) { - var headerContent, processedHeaders = {}; - - forEach(headers, function(headerFn, header) { - if (isFunction(headerFn)) { - headerContent = headerFn(config); - if (headerContent != null) { - processedHeaders[header] = headerContent; - } - } else { - processedHeaders[header] = headerFn; - } - }); - - return processedHeaders; - } - - function mergeHeaders(config) { - var defHeaders = defaults.headers, - reqHeaders = extend({}, config.headers), - defHeaderName, lowercaseDefHeaderName, reqHeaderName; - - defHeaders = extend({}, defHeaders.common, defHeaders[lowercase(config.method)]); - - // using for-in instead of forEach to avoid unnecessary iteration after header has been found - defaultHeadersIteration: - for (defHeaderName in defHeaders) { - lowercaseDefHeaderName = lowercase(defHeaderName); - - for (reqHeaderName in reqHeaders) { - if (lowercase(reqHeaderName) === lowercaseDefHeaderName) { - continue defaultHeadersIteration; - } - } - - reqHeaders[defHeaderName] = defHeaders[defHeaderName]; - } - - // execute if header value is a function for merged headers - return executeHeaderFns(reqHeaders, shallowCopy(config)); - } - - function serverRequest(config) { - var headers = config.headers; - var reqData = transformData(config.data, headersGetter(headers), undefined, config.transformRequest); - - // strip content-type if data is undefined - if (isUndefined(reqData)) { - forEach(headers, function(value, header) { - if (lowercase(header) === 'content-type') { - delete headers[header]; - } - }); - } - - if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) { - config.withCredentials = defaults.withCredentials; - } - - // send request - return sendReq(config, reqData).then(transformResponse, transformResponse); - } - - function transformResponse(response) { - // make a copy since the response must be cacheable - var resp = extend({}, response); - resp.data = transformData(response.data, response.headers, response.status, - config.transformResponse); - return (isSuccess(response.status)) - ? resp - : $q.reject(resp); - } - } - - $http.pendingRequests = []; - - /** - * @ngdoc method - * @name $http#get - * - * @description - * Shortcut method to perform `GET` request. - * - * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested; - * or an object created by a call to `$sce.trustAsResourceUrl(url)`. - * @param {Object=} config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage - * @returns {HttpPromise} Future object - */ - - /** - * @ngdoc method - * @name $http#delete - * - * @description - * Shortcut method to perform `DELETE` request. - * - * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested; - * or an object created by a call to `$sce.trustAsResourceUrl(url)`. - * @param {Object=} config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage - * @returns {HttpPromise} Future object - */ - - /** - * @ngdoc method - * @name $http#head - * - * @description - * Shortcut method to perform `HEAD` request. - * - * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested; - * or an object created by a call to `$sce.trustAsResourceUrl(url)`. - * @param {Object=} config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage - * @returns {HttpPromise} Future object - */ - - /** - * @ngdoc method - * @name $http#jsonp - * - * @description - * Shortcut method to perform `JSONP` request. - * - * Note that, since JSONP requests are sensitive because the response is given full access to the browser, - * the url must be declared, via {@link $sce} as a trusted resource URL. - * You can trust a URL by adding it to the whitelist via - * {@link $sceDelegateProvider#resourceUrlWhitelist `$sceDelegateProvider.resourceUrlWhitelist`} or - * by explicitly trusting the URL via {@link $sce#trustAsResourceUrl `$sce.trustAsResourceUrl(url)`}. - * - * You should avoid generating the URL for the JSONP request from user provided data. - * Provide additional query parameters via `params` property of the `config` parameter, rather than - * modifying the URL itself. - * - * JSONP requests must specify a callback to be used in the response from the server. This callback - * is passed as a query parameter in the request. You must specify the name of this parameter by - * setting the `jsonpCallbackParam` property on the request config object. - * - * ``` - * $http.jsonp('some/trusted/url', {jsonpCallbackParam: 'callback'}) - * ``` - * - * You can also specify a default callback parameter name in `$http.defaults.jsonpCallbackParam`. - * Initially this is set to `'callback'`. - * - *
    - * You can no longer use the `JSON_CALLBACK` string as a placeholder for specifying where the callback - * parameter value should go. - *
    - * - * If you would like to customise where and how the callbacks are stored then try overriding - * or decorating the {@link $jsonpCallbacks} service. - * - * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested; - * or an object created by a call to `$sce.trustAsResourceUrl(url)`. - * @param {Object=} config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage - * @returns {HttpPromise} Future object - */ - createShortMethods('get', 'delete', 'head', 'jsonp'); - - /** - * @ngdoc method - * @name $http#post - * - * @description - * Shortcut method to perform `POST` request. - * - * @param {string} url Relative or absolute URL specifying the destination of the request - * @param {*} data Request content - * @param {Object=} config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage - * @returns {HttpPromise} Future object - */ - - /** - * @ngdoc method - * @name $http#put - * - * @description - * Shortcut method to perform `PUT` request. - * - * @param {string} url Relative or absolute URL specifying the destination of the request - * @param {*} data Request content - * @param {Object=} config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage - * @returns {HttpPromise} Future object - */ - - /** - * @ngdoc method - * @name $http#patch - * - * @description - * Shortcut method to perform `PATCH` request. - * - * @param {string} url Relative or absolute URL specifying the destination of the request - * @param {*} data Request content - * @param {Object=} config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage - * @returns {HttpPromise} Future object - */ - createShortMethodsWithData('post', 'put', 'patch'); - - /** - * @ngdoc property - * @name $http#defaults - * - * @description - * Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of - * default headers, withCredentials as well as request and response transformations. - * - * See "Setting HTTP Headers" and "Transforming Requests and Responses" sections above. - */ - $http.defaults = defaults; - - - return $http; - - - function createShortMethods(names) { - forEach(arguments, function(name) { - $http[name] = function(url, config) { - return $http(extend({}, config || {}, { - method: name, - url: url - })); - }; - }); - } - - - function createShortMethodsWithData(name) { - forEach(arguments, function(name) { - $http[name] = function(url, data, config) { - return $http(extend({}, config || {}, { - method: name, - url: url, - data: data - })); - }; - }); - } - - - /** - * Makes the request. - * - * !!! ACCESSES CLOSURE VARS: - * $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests - */ - function sendReq(config, reqData) { - var deferred = $q.defer(), - promise = deferred.promise, - cache, - cachedResp, - reqHeaders = config.headers, - isJsonp = lowercase(config.method) === 'jsonp', - url = config.url; - - if (isJsonp) { - // JSONP is a pretty sensitive operation where we're allowing a script to have full access to - // our DOM and JS space. So we require that the URL satisfies SCE.RESOURCE_URL. - url = $sce.getTrustedResourceUrl(url); - } else if (!isString(url)) { - // If it is not a string then the URL must be a $sce trusted object - url = $sce.valueOf(url); - } - - url = buildUrl(url, config.paramSerializer(config.params)); - - if (isJsonp) { - // Check the url and add the JSONP callback placeholder - url = sanitizeJsonpCallbackParam(url, config.jsonpCallbackParam); - } - - $http.pendingRequests.push(config); - promise.then(removePendingReq, removePendingReq); - - if ((config.cache || defaults.cache) && config.cache !== false && - (config.method === 'GET' || config.method === 'JSONP')) { - cache = isObject(config.cache) ? config.cache - : isObject(/** @type {?} */ (defaults).cache) - ? /** @type {?} */ (defaults).cache - : defaultCache; - } - - if (cache) { - cachedResp = cache.get(url); - if (isDefined(cachedResp)) { - if (isPromiseLike(cachedResp)) { - // cached request has already been sent, but there is no response yet - cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult); - } else { - // serving from cache - if (isArray(cachedResp)) { - resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3], cachedResp[4]); - } else { - resolvePromise(cachedResp, 200, {}, 'OK', 'complete'); - } - } - } else { - // put the promise for the non-transformed response into cache as a placeholder - cache.put(url, promise); - } - } - - - // if we won't have the response in cache, set the xsrf headers and - // send the request to the backend - if (isUndefined(cachedResp)) { - var xsrfValue = urlIsSameOrigin(config.url) - ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName] - : undefined; - if (xsrfValue) { - reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue; - } - - $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout, - config.withCredentials, config.responseType, - createApplyHandlers(config.eventHandlers), - createApplyHandlers(config.uploadEventHandlers)); - } - - return promise; - - function createApplyHandlers(eventHandlers) { - if (eventHandlers) { - var applyHandlers = {}; - forEach(eventHandlers, function(eventHandler, key) { - applyHandlers[key] = function(event) { - if (useApplyAsync) { - $rootScope.$applyAsync(callEventHandler); - } else if ($rootScope.$$phase) { - callEventHandler(); - } else { - $rootScope.$apply(callEventHandler); - } - - function callEventHandler() { - eventHandler(event); - } - }; - }); - return applyHandlers; - } - } - - - /** - * Callback registered to $httpBackend(): - * - caches the response if desired - * - resolves the raw $http promise - * - calls $apply - */ - function done(status, response, headersString, statusText, xhrStatus) { - if (cache) { - if (isSuccess(status)) { - cache.put(url, [status, response, parseHeaders(headersString), statusText, xhrStatus]); - } else { - // remove promise from the cache - cache.remove(url); - } - } - - function resolveHttpPromise() { - resolvePromise(response, status, headersString, statusText, xhrStatus); - } - - if (useApplyAsync) { - $rootScope.$applyAsync(resolveHttpPromise); - } else { - resolveHttpPromise(); - if (!$rootScope.$$phase) $rootScope.$apply(); - } - } - - - /** - * Resolves the raw $http promise. - */ - function resolvePromise(response, status, headers, statusText, xhrStatus) { - //status: HTTP response status code, 0, -1 (aborted by timeout / promise) - status = status >= -1 ? status : 0; - - (isSuccess(status) ? deferred.resolve : deferred.reject)({ - data: response, - status: status, - headers: headersGetter(headers), - config: config, - statusText: statusText, - xhrStatus: xhrStatus - }); - } - - function resolvePromiseWithResult(result) { - resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText, result.xhrStatus); - } - - function removePendingReq() { - var idx = $http.pendingRequests.indexOf(config); - if (idx !== -1) $http.pendingRequests.splice(idx, 1); - } - } - - - function buildUrl(url, serializedParams) { - if (serializedParams.length > 0) { - url += ((url.indexOf('?') === -1) ? '?' : '&') + serializedParams; - } - return url; - } - - function sanitizeJsonpCallbackParam(url, cbKey) { - var parts = url.split('?'); - if (parts.length > 2) { - // Throw if the url contains more than one `?` query indicator - throw $httpMinErr('badjsonp', 'Illegal use more than one "?", in url, "{1}"', url); - } - var params = parseKeyValue(parts[1]); - forEach(params, function(value, key) { - if (value === 'JSON_CALLBACK') { - // Throw if the url already contains a reference to JSON_CALLBACK - throw $httpMinErr('badjsonp', 'Illegal use of JSON_CALLBACK in url, "{0}"', url); - } - if (key === cbKey) { - // Throw if the callback param was already provided - throw $httpMinErr('badjsonp', 'Illegal use of callback param, "{0}", in url, "{1}"', cbKey, url); - } - }); - - // Add in the JSON_CALLBACK callback param value - url += ((url.indexOf('?') === -1) ? '?' : '&') + cbKey + '=JSON_CALLBACK'; - - return url; - } - }]; - } - - /** - * @ngdoc service - * @name $xhrFactory - * @this - * - * @description - * Factory function used to create XMLHttpRequest objects. - * - * Replace or decorate this service to create your own custom XMLHttpRequest objects. - * - * ``` - * angular.module('myApp', []) - * .factory('$xhrFactory', function() { - * return function createXhr(method, url) { - * return new window.XMLHttpRequest({mozSystem: true}); - * }; - * }); - * ``` - * - * @param {string} method HTTP method of the request (GET, POST, PUT, ..) - * @param {string} url URL of the request. - */ - function $xhrFactoryProvider() { - this.$get = function() { - return function createXhr() { - return new window.XMLHttpRequest(); - }; - }; - } - - /** - * @ngdoc service - * @name $httpBackend - * @requires $jsonpCallbacks - * @requires $document - * @requires $xhrFactory - * @this - * - * @description - * HTTP backend used by the {@link ng.$http service} that delegates to - * XMLHttpRequest object or JSONP and deals with browser incompatibilities. - * - * You should never need to use this service directly, instead use the higher-level abstractions: - * {@link ng.$http $http} or {@link ngResource.$resource $resource}. - * - * During testing this implementation is swapped with {@link ngMock.$httpBackend mock - * $httpBackend} which can be trained with responses. - */ - function $HttpBackendProvider() { - this.$get = ['$browser', '$jsonpCallbacks', '$document', '$xhrFactory', function($browser, $jsonpCallbacks, $document, $xhrFactory) { - return createHttpBackend($browser, $xhrFactory, $browser.defer, $jsonpCallbacks, $document[0]); - }]; - } - - function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) { - // TODO(vojta): fix the signature - return function(method, url, post, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers) { - url = url || $browser.url(); - - if (lowercase(method) === 'jsonp') { - var callbackPath = callbacks.createCallback(url); - var jsonpDone = jsonpReq(url, callbackPath, function(status, text) { - // jsonpReq only ever sets status to 200 (OK), 404 (ERROR) or -1 (WAITING) - var response = (status === 200) && callbacks.getResponse(callbackPath); - completeRequest(callback, status, response, '', text, 'complete'); - callbacks.removeCallback(callbackPath); - }); - } else { - - var xhr = createXhr(method, url); - - xhr.open(method, url, true); - forEach(headers, function(value, key) { - if (isDefined(value)) { - xhr.setRequestHeader(key, value); - } - }); - - xhr.onload = function requestLoaded() { - var statusText = xhr.statusText || ''; - - // responseText is the old-school way of retrieving response (supported by IE9) - // response/responseType properties were introduced in XHR Level2 spec (supported by IE10) - var response = ('response' in xhr) ? xhr.response : xhr.responseText; - - // normalize IE9 bug (http://bugs.jquery.com/ticket/1450) - var status = xhr.status === 1223 ? 204 : xhr.status; - - // fix status code when it is 0 (0 status is undocumented). - // Occurs when accessing file resources or on Android 4.1 stock browser - // while retrieving files from application cache. - if (status === 0) { - status = response ? 200 : urlResolve(url).protocol === 'file' ? 404 : 0; - } - - completeRequest(callback, - status, - response, - xhr.getAllResponseHeaders(), - statusText, - 'complete'); - }; - - var requestError = function() { - // The response is always empty - // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error - completeRequest(callback, -1, null, null, '', 'error'); - }; - - var requestAborted = function() { - completeRequest(callback, -1, null, null, '', 'abort'); - }; - - var requestTimeout = function() { - // The response is always empty - // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error - completeRequest(callback, -1, null, null, '', 'timeout'); - }; - - xhr.onerror = requestError; - xhr.onabort = requestAborted; - xhr.ontimeout = requestTimeout; - - forEach(eventHandlers, function(value, key) { - xhr.addEventListener(key, value); - }); - - forEach(uploadEventHandlers, function(value, key) { - xhr.upload.addEventListener(key, value); - }); - - if (withCredentials) { - xhr.withCredentials = true; - } - - if (responseType) { - try { - xhr.responseType = responseType; - } catch (e) { - // WebKit added support for the json responseType value on 09/03/2013 - // https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are - // known to throw when setting the value "json" as the response type. Other older - // browsers implementing the responseType - // - // The json response type can be ignored if not supported, because JSON payloads are - // parsed on the client-side regardless. - if (responseType !== 'json') { - throw e; - } - } - } - - xhr.send(isUndefined(post) ? null : post); - } - - if (timeout > 0) { - var timeoutId = $browserDefer(timeoutRequest, timeout); - } else if (isPromiseLike(timeout)) { - timeout.then(timeoutRequest); - } - - - function timeoutRequest() { - if (jsonpDone) { - jsonpDone(); - } - if (xhr) { - xhr.abort(); - } - } - - function completeRequest(callback, status, response, headersString, statusText, xhrStatus) { - // cancel timeout and subsequent timeout promise resolution - if (isDefined(timeoutId)) { - $browserDefer.cancel(timeoutId); - } - jsonpDone = xhr = null; - - callback(status, response, headersString, statusText, xhrStatus); - } - }; - - function jsonpReq(url, callbackPath, done) { - url = url.replace('JSON_CALLBACK', callbackPath); - // we can't use jQuery/jqLite here because jQuery does crazy stuff with script elements, e.g.: - // - fetches local scripts via XHR and evals them - // - adds and immediately removes script elements from the document - var script = rawDocument.createElement('script'), callback = null; - script.type = 'text/javascript'; - script.src = url; - script.async = true; - - callback = function(event) { - script.removeEventListener('load', callback); - script.removeEventListener('error', callback); - rawDocument.body.removeChild(script); - script = null; - var status = -1; - var text = 'unknown'; - - if (event) { - if (event.type === 'load' && !callbacks.wasCalled(callbackPath)) { - event = { type: 'error' }; - } - text = event.type; - status = event.type === 'error' ? 404 : 200; - } - - if (done) { - done(status, text); - } - }; - - script.addEventListener('load', callback); - script.addEventListener('error', callback); - rawDocument.body.appendChild(script); - return callback; - } - } - - var $interpolateMinErr = angular.$interpolateMinErr = minErr('$interpolate'); - $interpolateMinErr.throwNoconcat = function(text) { - throw $interpolateMinErr('noconcat', - 'Error while interpolating: {0}\nStrict Contextual Escaping disallows ' + - 'interpolations that concatenate multiple expressions when a trusted value is ' + - 'required. See http://docs.angularjs.org/api/ng.$sce', text); - }; - - $interpolateMinErr.interr = function(text, err) { - return $interpolateMinErr('interr', 'Can\'t interpolate: {0}\n{1}', text, err.toString()); - }; - - /** - * @ngdoc provider - * @name $interpolateProvider - * @this - * - * @description - * - * Used for configuring the interpolation markup. Defaults to `{{` and `}}`. - * - *
    - * This feature is sometimes used to mix different markup languages, e.g. to wrap an AngularJS - * template within a Python Jinja template (or any other template language). Mixing templating - * languages is **very dangerous**. The embedding template language will not safely escape AngularJS - * expressions, so any user-controlled values in the template will cause Cross Site Scripting (XSS) - * security bugs! - *
    - * - * @example - - - -
    - //demo.label// -
    -
    - - it('should interpolate binding with custom symbols', function() { - expect(element(by.binding('demo.label')).getText()).toBe('This binding is brought you by // interpolation symbols.'); - }); - -
    - */ - function $InterpolateProvider() { - var startSymbol = '{{'; - var endSymbol = '}}'; - - /** - * @ngdoc method - * @name $interpolateProvider#startSymbol - * @description - * Symbol to denote start of expression in the interpolated string. Defaults to `{{`. - * - * @param {string=} value new value to set the starting symbol to. - * @returns {string|self} Returns the symbol when used as getter and self if used as setter. - */ - this.startSymbol = function(value) { - if (value) { - startSymbol = value; - return this; - } else { - return startSymbol; - } - }; - - /** - * @ngdoc method - * @name $interpolateProvider#endSymbol - * @description - * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`. - * - * @param {string=} value new value to set the ending symbol to. - * @returns {string|self} Returns the symbol when used as getter and self if used as setter. - */ - this.endSymbol = function(value) { - if (value) { - endSymbol = value; - return this; - } else { - return endSymbol; - } - }; - - - this.$get = ['$parse', '$exceptionHandler', '$sce', function($parse, $exceptionHandler, $sce) { - var startSymbolLength = startSymbol.length, - endSymbolLength = endSymbol.length, - escapedStartRegexp = new RegExp(startSymbol.replace(/./g, escape), 'g'), - escapedEndRegexp = new RegExp(endSymbol.replace(/./g, escape), 'g'); - - function escape(ch) { - return '\\\\\\' + ch; - } - - function unescapeText(text) { - return text.replace(escapedStartRegexp, startSymbol). - replace(escapedEndRegexp, endSymbol); - } - - // TODO: this is the same as the constantWatchDelegate in parse.js - function constantWatchDelegate(scope, listener, objectEquality, constantInterp) { - var unwatch = scope.$watch(function constantInterpolateWatch(scope) { - unwatch(); - return constantInterp(scope); - }, listener, objectEquality); - return unwatch; - } - - /** - * @ngdoc service - * @name $interpolate - * @kind function - * - * @requires $parse - * @requires $sce - * - * @description - * - * Compiles a string with markup into an interpolation function. This service is used by the - * HTML {@link ng.$compile $compile} service for data binding. See - * {@link ng.$interpolateProvider $interpolateProvider} for configuring the - * interpolation markup. - * - * - * ```js - * var $interpolate = ...; // injected - * var exp = $interpolate('Hello {{name | uppercase}}!'); - * expect(exp({name:'AngularJS'})).toEqual('Hello ANGULAR!'); - * ``` - * - * `$interpolate` takes an optional fourth argument, `allOrNothing`. If `allOrNothing` is - * `true`, the interpolation function will return `undefined` unless all embedded expressions - * evaluate to a value other than `undefined`. - * - * ```js - * var $interpolate = ...; // injected - * var context = {greeting: 'Hello', name: undefined }; - * - * // default "forgiving" mode - * var exp = $interpolate('{{greeting}} {{name}}!'); - * expect(exp(context)).toEqual('Hello !'); - * - * // "allOrNothing" mode - * exp = $interpolate('{{greeting}} {{name}}!', false, null, true); - * expect(exp(context)).toBeUndefined(); - * context.name = 'AngularJS'; - * expect(exp(context)).toEqual('Hello AngularJS!'); - * ``` - * - * `allOrNothing` is useful for interpolating URLs. `ngSrc` and `ngSrcset` use this behavior. - * - * #### Escaped Interpolation - * $interpolate provides a mechanism for escaping interpolation markers. Start and end markers - * can be escaped by preceding each of their characters with a REVERSE SOLIDUS U+005C (backslash). - * It will be rendered as a regular start/end marker, and will not be interpreted as an expression - * or binding. - * - * This enables web-servers to prevent script injection attacks and defacing attacks, to some - * degree, while also enabling code examples to work without relying on the - * {@link ng.directive:ngNonBindable ngNonBindable} directive. - * - * **For security purposes, it is strongly encouraged that web servers escape user-supplied data, - * replacing angle brackets (<, >) with &lt; and &gt; respectively, and replacing all - * interpolation start/end markers with their escaped counterparts.** - * - * Escaped interpolation markers are only replaced with the actual interpolation markers in rendered - * output when the $interpolate service processes the text. So, for HTML elements interpolated - * by {@link ng.$compile $compile}, or otherwise interpolated with the `mustHaveExpression` parameter - * set to `true`, the interpolated text must contain an unescaped interpolation expression. As such, - * this is typically useful only when user-data is used in rendering a template from the server, or - * when otherwise untrusted data is used by a directive. - * - * - * - *
    - *

    {{apptitle}}: \{\{ username = "defaced value"; \}\} - *

    - *

    {{username}} attempts to inject code which will deface the - * application, but fails to accomplish their task, because the server has correctly - * escaped the interpolation start/end markers with REVERSE SOLIDUS U+005C (backslash) - * characters.

    - *

    Instead, the result of the attempted script injection is visible, and can be removed - * from the database by an administrator.

    - *
    - *
    - *
    - * - * @knownIssue - * It is currently not possible for an interpolated expression to contain the interpolation end - * symbol. For example, `{{ '}}' }}` will be incorrectly interpreted as `{{ ' }}` + `' }}`, i.e. - * an interpolated expression consisting of a single-quote (`'`) and the `' }}` string. - * - * @knownIssue - * All directives and components must use the standard `{{` `}}` interpolation symbols - * in their templates. If you change the application interpolation symbols the {@link $compile} - * service will attempt to denormalize the standard symbols to the custom symbols. - * The denormalization process is not clever enough to know not to replace instances of the standard - * symbols where they would not normally be treated as interpolation symbols. For example in the following - * code snippet the closing braces of the literal object will get incorrectly denormalized: - * - * ``` - *
    - * ``` - * - * See https://github.com/angular/angular.js/pull/14610#issuecomment-219401099 for more information. - * - * @param {string} text The text with markup to interpolate. - * @param {boolean=} mustHaveExpression if set to true then the interpolation string must have - * embedded expression in order to return an interpolation function. Strings with no - * embedded expression will return null for the interpolation function. - * @param {string=} trustedContext when provided, the returned function passes the interpolated - * result through {@link ng.$sce#getTrusted $sce.getTrusted(interpolatedResult, - * trustedContext)} before returning it. Refer to the {@link ng.$sce $sce} service that - * provides Strict Contextual Escaping for details. - * @param {boolean=} allOrNothing if `true`, then the returned function returns undefined - * unless all embedded expressions evaluate to a value other than `undefined`. - * @returns {function(context)} an interpolation function which is used to compute the - * interpolated string. The function has these parameters: - * - * - `context`: evaluation context for all expressions embedded in the interpolated text - */ - function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) { - // Provide a quick exit and simplified result function for text with no interpolation - if (!text.length || text.indexOf(startSymbol) === -1) { - var constantInterp; - if (!mustHaveExpression) { - var unescapedText = unescapeText(text); - constantInterp = valueFn(unescapedText); - constantInterp.exp = text; - constantInterp.expressions = []; - constantInterp.$$watchDelegate = constantWatchDelegate; - } - return constantInterp; - } - - allOrNothing = !!allOrNothing; - var startIndex, - endIndex, - index = 0, - expressions = [], - parseFns = [], - textLength = text.length, - exp, - concat = [], - expressionPositions = []; - - while (index < textLength) { - if (((startIndex = text.indexOf(startSymbol, index)) !== -1) && - ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) !== -1)) { - if (index !== startIndex) { - concat.push(unescapeText(text.substring(index, startIndex))); - } - exp = text.substring(startIndex + startSymbolLength, endIndex); - expressions.push(exp); - parseFns.push($parse(exp, parseStringifyInterceptor)); - index = endIndex + endSymbolLength; - expressionPositions.push(concat.length); - concat.push(''); - } else { - // we did not find an interpolation, so we have to add the remainder to the separators array - if (index !== textLength) { - concat.push(unescapeText(text.substring(index))); - } - break; - } - } - - // Concatenating expressions makes it hard to reason about whether some combination of - // concatenated values are unsafe to use and could easily lead to XSS. By requiring that a - // single expression be used for iframe[src], object[src], etc., we ensure that the value - // that's used is assigned or constructed by some JS code somewhere that is more testable or - // make it obvious that you bound the value to some user controlled value. This helps reduce - // the load when auditing for XSS issues. - if (trustedContext && concat.length > 1) { - $interpolateMinErr.throwNoconcat(text); - } - - if (!mustHaveExpression || expressions.length) { - var compute = function(values) { - for (var i = 0, ii = expressions.length; i < ii; i++) { - if (allOrNothing && isUndefined(values[i])) return; - concat[expressionPositions[i]] = values[i]; - } - return concat.join(''); - }; - - var getValue = function(value) { - return trustedContext ? - $sce.getTrusted(trustedContext, value) : - $sce.valueOf(value); - }; - - return extend(function interpolationFn(context) { - var i = 0; - var ii = expressions.length; - var values = new Array(ii); - - try { - for (; i < ii; i++) { - values[i] = parseFns[i](context); - } - - return compute(values); - } catch (err) { - $exceptionHandler($interpolateMinErr.interr(text, err)); - } - - }, { - // all of these properties are undocumented for now - exp: text, //just for compatibility with regular watchers created via $watch - expressions: expressions, - $$watchDelegate: function(scope, listener) { - var lastValue; - return scope.$watchGroup(parseFns, /** @this */ function interpolateFnWatcher(values, oldValues) { - var currValue = compute(values); - listener.call(this, currValue, values !== oldValues ? lastValue : currValue, scope); - lastValue = currValue; - }); - } - }); - } - - function parseStringifyInterceptor(value) { - try { - value = getValue(value); - return allOrNothing && !isDefined(value) ? value : stringify(value); - } catch (err) { - $exceptionHandler($interpolateMinErr.interr(text, err)); - } - } - } - - - /** - * @ngdoc method - * @name $interpolate#startSymbol - * @description - * Symbol to denote the start of expression in the interpolated string. Defaults to `{{`. - * - * Use {@link ng.$interpolateProvider#startSymbol `$interpolateProvider.startSymbol`} to change - * the symbol. - * - * @returns {string} start symbol. - */ - $interpolate.startSymbol = function() { - return startSymbol; - }; - - - /** - * @ngdoc method - * @name $interpolate#endSymbol - * @description - * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`. - * - * Use {@link ng.$interpolateProvider#endSymbol `$interpolateProvider.endSymbol`} to change - * the symbol. - * - * @returns {string} end symbol. - */ - $interpolate.endSymbol = function() { - return endSymbol; - }; - - return $interpolate; - }]; - } - - /** @this */ - function $IntervalProvider() { - this.$get = ['$rootScope', '$window', '$q', '$$q', '$browser', - function($rootScope, $window, $q, $$q, $browser) { - var intervals = {}; - - - /** - * @ngdoc service - * @name $interval - * - * @description - * AngularJS's wrapper for `window.setInterval`. The `fn` function is executed every `delay` - * milliseconds. - * - * The return value of registering an interval function is a promise. This promise will be - * notified upon each tick of the interval, and will be resolved after `count` iterations, or - * run indefinitely if `count` is not defined. The value of the notification will be the - * number of iterations that have run. - * To cancel an interval, call `$interval.cancel(promise)`. - * - * In tests you can use {@link ngMock.$interval#flush `$interval.flush(millis)`} to - * move forward by `millis` milliseconds and trigger any functions scheduled to run in that - * time. - * - *
    - * **Note**: Intervals created by this service must be explicitly destroyed when you are finished - * with them. In particular they are not automatically destroyed when a controller's scope or a - * directive's element are destroyed. - * You should take this into consideration and make sure to always cancel the interval at the - * appropriate moment. See the example below for more details on how and when to do this. - *
    - * - * @param {function()} fn A function that should be called repeatedly. If no additional arguments - * are passed (see below), the function is called with the current iteration count. - * @param {number} delay Number of milliseconds between each function call. - * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat - * indefinitely. - * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise - * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block. - * @param {...*=} Pass additional parameters to the executed function. - * @returns {promise} A promise which will be notified on each iteration. It will resolve once all iterations of the interval complete. - * - * @example - * - * - * - * - *
    - *
    - *
    - * Current time is: - *
    - * Blood 1 : {{blood_1}} - * Blood 2 : {{blood_2}} - * - * - * - *
    - *
    - * - *
    - *
    - */ - function interval(fn, delay, count, invokeApply) { - var hasParams = arguments.length > 4, - args = hasParams ? sliceArgs(arguments, 4) : [], - setInterval = $window.setInterval, - clearInterval = $window.clearInterval, - iteration = 0, - skipApply = (isDefined(invokeApply) && !invokeApply), - deferred = (skipApply ? $$q : $q).defer(), - promise = deferred.promise; - - count = isDefined(count) ? count : 0; - - promise.$$intervalId = setInterval(function tick() { - if (skipApply) { - $browser.defer(callback); - } else { - $rootScope.$evalAsync(callback); - } - deferred.notify(iteration++); - - if (count > 0 && iteration >= count) { - deferred.resolve(iteration); - clearInterval(promise.$$intervalId); - delete intervals[promise.$$intervalId]; - } - - if (!skipApply) $rootScope.$apply(); - - }, delay); - - intervals[promise.$$intervalId] = deferred; - - return promise; - - function callback() { - if (!hasParams) { - fn(iteration); - } else { - fn.apply(null, args); - } - } - } - - - /** - * @ngdoc method - * @name $interval#cancel - * - * @description - * Cancels a task associated with the `promise`. - * - * @param {Promise=} promise returned by the `$interval` function. - * @returns {boolean} Returns `true` if the task was successfully canceled. - */ - interval.cancel = function(promise) { - if (promise && promise.$$intervalId in intervals) { - // Interval cancels should not report as unhandled promise. - markQExceptionHandled(intervals[promise.$$intervalId].promise); - intervals[promise.$$intervalId].reject('canceled'); - $window.clearInterval(promise.$$intervalId); - delete intervals[promise.$$intervalId]; - return true; - } - return false; - }; - - return interval; - }]; - } - - /** - * @ngdoc service - * @name $jsonpCallbacks - * @requires $window - * @description - * This service handles the lifecycle of callbacks to handle JSONP requests. - * Override this service if you wish to customise where the callbacks are stored and - * how they vary compared to the requested url. - */ - var $jsonpCallbacksProvider = /** @this */ function() { - this.$get = function() { - var callbacks = angular.callbacks; - var callbackMap = {}; - - function createCallback(callbackId) { - var callback = function(data) { - callback.data = data; - callback.called = true; - }; - callback.id = callbackId; - return callback; - } - - return { - /** - * @ngdoc method - * @name $jsonpCallbacks#createCallback - * @param {string} url the url of the JSONP request - * @returns {string} the callback path to send to the server as part of the JSONP request - * @description - * {@link $httpBackend} calls this method to create a callback and get hold of the path to the callback - * to pass to the server, which will be used to call the callback with its payload in the JSONP response. - */ - createCallback: function(url) { - var callbackId = '_' + (callbacks.$$counter++).toString(36); - var callbackPath = 'angular.callbacks.' + callbackId; - var callback = createCallback(callbackId); - callbackMap[callbackPath] = callbacks[callbackId] = callback; - return callbackPath; - }, - /** - * @ngdoc method - * @name $jsonpCallbacks#wasCalled - * @param {string} callbackPath the path to the callback that was sent in the JSONP request - * @returns {boolean} whether the callback has been called, as a result of the JSONP response - * @description - * {@link $httpBackend} calls this method to find out whether the JSONP response actually called the - * callback that was passed in the request. - */ - wasCalled: function(callbackPath) { - return callbackMap[callbackPath].called; - }, - /** - * @ngdoc method - * @name $jsonpCallbacks#getResponse - * @param {string} callbackPath the path to the callback that was sent in the JSONP request - * @returns {*} the data received from the response via the registered callback - * @description - * {@link $httpBackend} calls this method to get hold of the data that was provided to the callback - * in the JSONP response. - */ - getResponse: function(callbackPath) { - return callbackMap[callbackPath].data; - }, - /** - * @ngdoc method - * @name $jsonpCallbacks#removeCallback - * @param {string} callbackPath the path to the callback that was sent in the JSONP request - * @description - * {@link $httpBackend} calls this method to remove the callback after the JSONP request has - * completed or timed-out. - */ - removeCallback: function(callbackPath) { - var callback = callbackMap[callbackPath]; - delete callbacks[callback.id]; - delete callbackMap[callbackPath]; - } - }; - }; - }; - - /** - * @ngdoc service - * @name $locale - * - * @description - * $locale service provides localization rules for various AngularJS components. As of right now the - * only public api is: - * - * * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`) - */ - - var PATH_MATCH = /^([^?#]*)(\?([^#]*))?(#(.*))?$/, - DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21}; - var $locationMinErr = minErr('$location'); - - - /** - * Encode path using encodeUriSegment, ignoring forward slashes - * - * @param {string} path Path to encode - * @returns {string} - */ - function encodePath(path) { - var segments = path.split('/'), - i = segments.length; - - while (i--) { - // decode forward slashes to prevent them from being double encoded - segments[i] = encodeUriSegment(segments[i].replace(/%2F/g, '/')); - } - - return segments.join('/'); - } - - function decodePath(path, html5Mode) { - var segments = path.split('/'), - i = segments.length; - - while (i--) { - segments[i] = decodeURIComponent(segments[i]); - if (html5Mode) { - // encode forward slashes to prevent them from being mistaken for path separators - segments[i] = segments[i].replace(/\//g, '%2F'); - } - } - - return segments.join('/'); - } - - function parseAbsoluteUrl(absoluteUrl, locationObj) { - var parsedUrl = urlResolve(absoluteUrl); - - locationObj.$$protocol = parsedUrl.protocol; - locationObj.$$host = parsedUrl.hostname; - locationObj.$$port = toInt(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null; - } - - var DOUBLE_SLASH_REGEX = /^\s*[\\/]{2,}/; - function parseAppUrl(url, locationObj, html5Mode) { - - if (DOUBLE_SLASH_REGEX.test(url)) { - throw $locationMinErr('badpath', 'Invalid url "{0}".', url); - } - - var prefixed = (url.charAt(0) !== '/'); - if (prefixed) { - url = '/' + url; - } - var match = urlResolve(url); - var path = prefixed && match.pathname.charAt(0) === '/' ? match.pathname.substring(1) : match.pathname; - locationObj.$$path = decodePath(path, html5Mode); - locationObj.$$search = parseKeyValue(match.search); - locationObj.$$hash = decodeURIComponent(match.hash); - - // make sure path starts with '/'; - if (locationObj.$$path && locationObj.$$path.charAt(0) !== '/') { - locationObj.$$path = '/' + locationObj.$$path; - } - } - - function startsWith(str, search) { - return str.slice(0, search.length) === search; - } - - /** - * - * @param {string} base - * @param {string} url - * @returns {string} returns text from `url` after `base` or `undefined` if it does not begin with - * the expected string. - */ - function stripBaseUrl(base, url) { - if (startsWith(url, base)) { - return url.substr(base.length); - } - } - - - function stripHash(url) { - var index = url.indexOf('#'); - return index === -1 ? url : url.substr(0, index); - } - - function trimEmptyHash(url) { - return url.replace(/(#.+)|#$/, '$1'); - } - - - function stripFile(url) { - return url.substr(0, stripHash(url).lastIndexOf('/') + 1); - } - - /* return the server only (scheme://host:port) */ - function serverBase(url) { - return url.substring(0, url.indexOf('/', url.indexOf('//') + 2)); - } - - - /** - * LocationHtml5Url represents a URL - * This object is exposed as $location service when HTML5 mode is enabled and supported - * - * @constructor - * @param {string} appBase application base URL - * @param {string} appBaseNoFile application base URL stripped of any filename - * @param {string} basePrefix URL path prefix - */ - function LocationHtml5Url(appBase, appBaseNoFile, basePrefix) { - this.$$html5 = true; - basePrefix = basePrefix || ''; - parseAbsoluteUrl(appBase, this); - - - /** - * Parse given HTML5 (regular) URL string into properties - * @param {string} url HTML5 URL - * @private - */ - this.$$parse = function(url) { - var pathUrl = stripBaseUrl(appBaseNoFile, url); - if (!isString(pathUrl)) { - throw $locationMinErr('ipthprfx', 'Invalid url "{0}", missing path prefix "{1}".', url, - appBaseNoFile); - } - - parseAppUrl(pathUrl, this, true); - - if (!this.$$path) { - this.$$path = '/'; - } - - this.$$compose(); - }; - - /** - * Compose url and update `absUrl` property - * @private - */ - this.$$compose = function() { - var search = toKeyValue(this.$$search), - hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : ''; - - this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash; - this.$$absUrl = appBaseNoFile + this.$$url.substr(1); // first char is always '/' - - this.$$urlUpdatedByLocation = true; - }; - - this.$$parseLinkUrl = function(url, relHref) { - if (relHref && relHref[0] === '#') { - // special case for links to hash fragments: - // keep the old url and only replace the hash fragment - this.hash(relHref.slice(1)); - return true; - } - var appUrl, prevAppUrl; - var rewrittenUrl; - - - if (isDefined(appUrl = stripBaseUrl(appBase, url))) { - prevAppUrl = appUrl; - if (basePrefix && isDefined(appUrl = stripBaseUrl(basePrefix, appUrl))) { - rewrittenUrl = appBaseNoFile + (stripBaseUrl('/', appUrl) || appUrl); - } else { - rewrittenUrl = appBase + prevAppUrl; - } - } else if (isDefined(appUrl = stripBaseUrl(appBaseNoFile, url))) { - rewrittenUrl = appBaseNoFile + appUrl; - } else if (appBaseNoFile === url + '/') { - rewrittenUrl = appBaseNoFile; - } - if (rewrittenUrl) { - this.$$parse(rewrittenUrl); - } - return !!rewrittenUrl; - }; - } - - - /** - * LocationHashbangUrl represents URL - * This object is exposed as $location service when developer doesn't opt into html5 mode. - * It also serves as the base class for html5 mode fallback on legacy browsers. - * - * @constructor - * @param {string} appBase application base URL - * @param {string} appBaseNoFile application base URL stripped of any filename - * @param {string} hashPrefix hashbang prefix - */ - function LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) { - - parseAbsoluteUrl(appBase, this); - - - /** - * Parse given hashbang URL into properties - * @param {string} url Hashbang URL - * @private - */ - this.$$parse = function(url) { - var withoutBaseUrl = stripBaseUrl(appBase, url) || stripBaseUrl(appBaseNoFile, url); - var withoutHashUrl; - - if (!isUndefined(withoutBaseUrl) && withoutBaseUrl.charAt(0) === '#') { - - // The rest of the URL starts with a hash so we have - // got either a hashbang path or a plain hash fragment - withoutHashUrl = stripBaseUrl(hashPrefix, withoutBaseUrl); - if (isUndefined(withoutHashUrl)) { - // There was no hashbang prefix so we just have a hash fragment - withoutHashUrl = withoutBaseUrl; - } - - } else { - // There was no hashbang path nor hash fragment: - // If we are in HTML5 mode we use what is left as the path; - // Otherwise we ignore what is left - if (this.$$html5) { - withoutHashUrl = withoutBaseUrl; - } else { - withoutHashUrl = ''; - if (isUndefined(withoutBaseUrl)) { - appBase = url; - /** @type {?} */ (this).replace(); - } - } - } - - parseAppUrl(withoutHashUrl, this, false); - - this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase); - - this.$$compose(); - - /* - * In Windows, on an anchor node on documents loaded from - * the filesystem, the browser will return a pathname - * prefixed with the drive name ('/C:/path') when a - * pathname without a drive is set: - * * a.setAttribute('href', '/foo') - * * a.pathname === '/C:/foo' //true - * - * Inside of AngularJS, we're always using pathnames that - * do not include drive names for routing. - */ - function removeWindowsDriveName(path, url, base) { - /* - Matches paths for file protocol on windows, - such as /C:/foo/bar, and captures only /foo/bar. - */ - var windowsFilePathExp = /^\/[A-Z]:(\/.*)/; - - var firstPathSegmentMatch; - - //Get the relative path from the input URL. - if (startsWith(url, base)) { - url = url.replace(base, ''); - } - - // The input URL intentionally contains a first path segment that ends with a colon. - if (windowsFilePathExp.exec(url)) { - return path; - } - - firstPathSegmentMatch = windowsFilePathExp.exec(path); - return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path; - } - }; - - /** - * Compose hashbang URL and update `absUrl` property - * @private - */ - this.$$compose = function() { - var search = toKeyValue(this.$$search), - hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : ''; - - this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash; - this.$$absUrl = appBase + (this.$$url ? hashPrefix + this.$$url : ''); - - this.$$urlUpdatedByLocation = true; - }; - - this.$$parseLinkUrl = function(url, relHref) { - if (stripHash(appBase) === stripHash(url)) { - this.$$parse(url); - return true; - } - return false; - }; - } - - - /** - * LocationHashbangUrl represents URL - * This object is exposed as $location service when html5 history api is enabled but the browser - * does not support it. - * - * @constructor - * @param {string} appBase application base URL - * @param {string} appBaseNoFile application base URL stripped of any filename - * @param {string} hashPrefix hashbang prefix - */ - function LocationHashbangInHtml5Url(appBase, appBaseNoFile, hashPrefix) { - this.$$html5 = true; - LocationHashbangUrl.apply(this, arguments); - - this.$$parseLinkUrl = function(url, relHref) { - if (relHref && relHref[0] === '#') { - // special case for links to hash fragments: - // keep the old url and only replace the hash fragment - this.hash(relHref.slice(1)); - return true; - } - - var rewrittenUrl; - var appUrl; - - if (appBase === stripHash(url)) { - rewrittenUrl = url; - } else if ((appUrl = stripBaseUrl(appBaseNoFile, url))) { - rewrittenUrl = appBase + hashPrefix + appUrl; - } else if (appBaseNoFile === url + '/') { - rewrittenUrl = appBaseNoFile; - } - if (rewrittenUrl) { - this.$$parse(rewrittenUrl); - } - return !!rewrittenUrl; - }; - - this.$$compose = function() { - var search = toKeyValue(this.$$search), - hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : ''; - - this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash; - // include hashPrefix in $$absUrl when $$url is empty so IE9 does not reload page because of removal of '#' - this.$$absUrl = appBase + hashPrefix + this.$$url; - - this.$$urlUpdatedByLocation = true; - }; - - } - - - var locationPrototype = { - - /** - * Ensure absolute URL is initialized. - * @private - */ - $$absUrl:'', - - /** - * Are we in html5 mode? - * @private - */ - $$html5: false, - - /** - * Has any change been replacing? - * @private - */ - $$replace: false, - - /** - * @ngdoc method - * @name $location#absUrl - * - * @description - * This method is getter only. - * - * Return full URL representation with all segments encoded according to rules specified in - * [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt). - * - * - * ```js - * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo - * var absUrl = $location.absUrl(); - * // => "http://example.com/#/some/path?foo=bar&baz=xoxo" - * ``` - * - * @return {string} full URL - */ - absUrl: locationGetter('$$absUrl'), - - /** - * @ngdoc method - * @name $location#url - * - * @description - * This method is getter / setter. - * - * Return URL (e.g. `/path?a=b#hash`) when called without any parameter. - * - * Change path, search and hash, when called with parameter and return `$location`. - * - * - * ```js - * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo - * var url = $location.url(); - * // => "/some/path?foo=bar&baz=xoxo" - * ``` - * - * @param {string=} url New URL without base prefix (e.g. `/path?a=b#hash`) - * @return {string} url - */ - url: function(url) { - if (isUndefined(url)) { - return this.$$url; - } - - var match = PATH_MATCH.exec(url); - if (match[1] || url === '') this.path(decodeURIComponent(match[1])); - if (match[2] || match[1] || url === '') this.search(match[3] || ''); - this.hash(match[5] || ''); - - return this; - }, - - /** - * @ngdoc method - * @name $location#protocol - * - * @description - * This method is getter only. - * - * Return protocol of current URL. - * - * - * ```js - * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo - * var protocol = $location.protocol(); - * // => "http" - * ``` - * - * @return {string} protocol of current URL - */ - protocol: locationGetter('$$protocol'), - - /** - * @ngdoc method - * @name $location#host - * - * @description - * This method is getter only. - * - * Return host of current URL. - * - * Note: compared to the non-AngularJS version `location.host` which returns `hostname:port`, this returns the `hostname` portion only. - * - * - * ```js - * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo - * var host = $location.host(); - * // => "example.com" - * - * // given URL http://user:password@example.com:8080/#/some/path?foo=bar&baz=xoxo - * host = $location.host(); - * // => "example.com" - * host = location.host; - * // => "example.com:8080" - * ``` - * - * @return {string} host of current URL. - */ - host: locationGetter('$$host'), - - /** - * @ngdoc method - * @name $location#port - * - * @description - * This method is getter only. - * - * Return port of current URL. - * - * - * ```js - * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo - * var port = $location.port(); - * // => 80 - * ``` - * - * @return {Number} port - */ - port: locationGetter('$$port'), - - /** - * @ngdoc method - * @name $location#path - * - * @description - * This method is getter / setter. - * - * Return path of current URL when called without any parameter. - * - * Change path when called with parameter and return `$location`. - * - * Note: Path should always begin with forward slash (/), this method will add the forward slash - * if it is missing. - * - * - * ```js - * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo - * var path = $location.path(); - * // => "/some/path" - * ``` - * - * @param {(string|number)=} path New path - * @return {(string|object)} path if called with no parameters, or `$location` if called with a parameter - */ - path: locationGetterSetter('$$path', function(path) { - path = path !== null ? path.toString() : ''; - return path.charAt(0) === '/' ? path : '/' + path; - }), - - /** - * @ngdoc method - * @name $location#search - * - * @description - * This method is getter / setter. - * - * Return search part (as object) of current URL when called without any parameter. - * - * Change search part when called with parameter and return `$location`. - * - * - * ```js - * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo - * var searchObject = $location.search(); - * // => {foo: 'bar', baz: 'xoxo'} - * - * // set foo to 'yipee' - * $location.search('foo', 'yipee'); - * // $location.search() => {foo: 'yipee', baz: 'xoxo'} - * ``` - * - * @param {string|Object.|Object.>} search New search params - string or - * hash object. - * - * When called with a single argument the method acts as a setter, setting the `search` component - * of `$location` to the specified value. - * - * If the argument is a hash object containing an array of values, these values will be encoded - * as duplicate search parameters in the URL. - * - * @param {(string|Number|Array|boolean)=} paramValue If `search` is a string or number, then `paramValue` - * will override only a single search property. - * - * If `paramValue` is an array, it will override the property of the `search` component of - * `$location` specified via the first argument. - * - * If `paramValue` is `null`, the property specified via the first argument will be deleted. - * - * If `paramValue` is `true`, the property specified via the first argument will be added with no - * value nor trailing equal sign. - * - * @return {Object} If called with no arguments returns the parsed `search` object. If called with - * one or more arguments returns `$location` object itself. - */ - search: function(search, paramValue) { - switch (arguments.length) { - case 0: - return this.$$search; - case 1: - if (isString(search) || isNumber(search)) { - search = search.toString(); - this.$$search = parseKeyValue(search); - } else if (isObject(search)) { - search = copy(search, {}); - // remove object undefined or null properties - forEach(search, function(value, key) { - if (value == null) delete search[key]; - }); - - this.$$search = search; - } else { - throw $locationMinErr('isrcharg', - 'The first argument of the `$location#search()` call must be a string or an object.'); - } - break; - default: - if (isUndefined(paramValue) || paramValue === null) { - delete this.$$search[search]; - } else { - this.$$search[search] = paramValue; - } - } - - this.$$compose(); - return this; - }, - - /** - * @ngdoc method - * @name $location#hash - * - * @description - * This method is getter / setter. - * - * Returns the hash fragment when called without any parameters. - * - * Changes the hash fragment when called with a parameter and returns `$location`. - * - * - * ```js - * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo#hashValue - * var hash = $location.hash(); - * // => "hashValue" - * ``` - * - * @param {(string|number)=} hash New hash fragment - * @return {string} hash - */ - hash: locationGetterSetter('$$hash', function(hash) { - return hash !== null ? hash.toString() : ''; - }), - - /** - * @ngdoc method - * @name $location#replace - * - * @description - * If called, all changes to $location during the current `$digest` will replace the current history - * record, instead of adding a new one. - */ - replace: function() { - this.$$replace = true; - return this; - } - }; - - forEach([LocationHashbangInHtml5Url, LocationHashbangUrl, LocationHtml5Url], function(Location) { - Location.prototype = Object.create(locationPrototype); - - /** - * @ngdoc method - * @name $location#state - * - * @description - * This method is getter / setter. - * - * Return the history state object when called without any parameter. - * - * Change the history state object when called with one parameter and return `$location`. - * The state object is later passed to `pushState` or `replaceState`. - * - * NOTE: This method is supported only in HTML5 mode and only in browsers supporting - * the HTML5 History API (i.e. methods `pushState` and `replaceState`). If you need to support - * older browsers (like IE9 or Android < 4.0), don't use this method. - * - * @param {object=} state State object for pushState or replaceState - * @return {object} state - */ - Location.prototype.state = function(state) { - if (!arguments.length) { - return this.$$state; - } - - if (Location !== LocationHtml5Url || !this.$$html5) { - throw $locationMinErr('nostate', 'History API state support is available only ' + - 'in HTML5 mode and only in browsers supporting HTML5 History API'); - } - // The user might modify `stateObject` after invoking `$location.state(stateObject)` - // but we're changing the $$state reference to $browser.state() during the $digest - // so the modification window is narrow. - this.$$state = isUndefined(state) ? null : state; - this.$$urlUpdatedByLocation = true; - - return this; - }; - }); - - - function locationGetter(property) { - return /** @this */ function() { - return this[property]; - }; - } - - - function locationGetterSetter(property, preprocess) { - return /** @this */ function(value) { - if (isUndefined(value)) { - return this[property]; - } - - this[property] = preprocess(value); - this.$$compose(); - - return this; - }; - } - - - /** - * @ngdoc service - * @name $location - * - * @requires $rootElement - * - * @description - * The $location service parses the URL in the browser address bar (based on the - * [window.location](https://developer.mozilla.org/en/window.location)) and makes the URL - * available to your application. Changes to the URL in the address bar are reflected into - * $location service and changes to $location are reflected into the browser address bar. - * - * **The $location service:** - * - * - Exposes the current URL in the browser address bar, so you can - * - Watch and observe the URL. - * - Change the URL. - * - Synchronizes the URL with the browser when the user - * - Changes the address bar. - * - Clicks the back or forward button (or clicks a History link). - * - Clicks on a link. - * - Represents the URL object as a set of methods (protocol, host, port, path, search, hash). - * - * For more information see {@link guide/$location Developer Guide: Using $location} - */ - - /** - * @ngdoc provider - * @name $locationProvider - * @this - * - * @description - * Use the `$locationProvider` to configure how the application deep linking paths are stored. - */ - function $LocationProvider() { - var hashPrefix = '!', - html5Mode = { - enabled: false, - requireBase: true, - rewriteLinks: true - }; - - /** - * @ngdoc method - * @name $locationProvider#hashPrefix - * @description - * The default value for the prefix is `'!'`. - * @param {string=} prefix Prefix for hash part (containing path and search) - * @returns {*} current value if used as getter or itself (chaining) if used as setter - */ - this.hashPrefix = function(prefix) { - if (isDefined(prefix)) { - hashPrefix = prefix; - return this; - } else { - return hashPrefix; - } - }; - - /** - * @ngdoc method - * @name $locationProvider#html5Mode - * @description - * @param {(boolean|Object)=} mode If boolean, sets `html5Mode.enabled` to value. - * If object, sets `enabled`, `requireBase` and `rewriteLinks` to respective values. Supported - * properties: - * - **enabled** – `{boolean}` – (default: false) If true, will rely on `history.pushState` to - * change urls where supported. Will fall back to hash-prefixed paths in browsers that do not - * support `pushState`. - * - **requireBase** - `{boolean}` - (default: `true`) When html5Mode is enabled, specifies - * whether or not a tag is required to be present. If `enabled` and `requireBase` are - * true, and a base tag is not present, an error will be thrown when `$location` is injected. - * See the {@link guide/$location $location guide for more information} - * - **rewriteLinks** - `{boolean|string}` - (default: `true`) When html5Mode is enabled, - * enables/disables URL rewriting for relative links. If set to a string, URL rewriting will - * only happen on links with an attribute that matches the given string. For example, if set - * to `'internal-link'`, then the URL will only be rewritten for `` links. - * Note that [attribute name normalization](guide/directive#normalization) does not apply - * here, so `'internalLink'` will **not** match `'internal-link'`. - * - * @returns {Object} html5Mode object if used as getter or itself (chaining) if used as setter - */ - this.html5Mode = function(mode) { - if (isBoolean(mode)) { - html5Mode.enabled = mode; - return this; - } else if (isObject(mode)) { - - if (isBoolean(mode.enabled)) { - html5Mode.enabled = mode.enabled; - } - - if (isBoolean(mode.requireBase)) { - html5Mode.requireBase = mode.requireBase; - } - - if (isBoolean(mode.rewriteLinks) || isString(mode.rewriteLinks)) { - html5Mode.rewriteLinks = mode.rewriteLinks; - } - - return this; - } else { - return html5Mode; - } - }; - - /** - * @ngdoc event - * @name $location#$locationChangeStart - * @eventType broadcast on root scope - * @description - * Broadcasted before a URL will change. - * - * This change can be prevented by calling - * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more - * details about event object. Upon successful change - * {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired. - * - * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when - * the browser supports the HTML5 History API. - * - * @param {Object} angularEvent Synthetic event object. - * @param {string} newUrl New URL - * @param {string=} oldUrl URL that was before it was changed. - * @param {string=} newState New history state object - * @param {string=} oldState History state object that was before it was changed. - */ - - /** - * @ngdoc event - * @name $location#$locationChangeSuccess - * @eventType broadcast on root scope - * @description - * Broadcasted after a URL was changed. - * - * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when - * the browser supports the HTML5 History API. - * - * @param {Object} angularEvent Synthetic event object. - * @param {string} newUrl New URL - * @param {string=} oldUrl URL that was before it was changed. - * @param {string=} newState New history state object - * @param {string=} oldState History state object that was before it was changed. - */ - - this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', '$window', - function($rootScope, $browser, $sniffer, $rootElement, $window) { - var $location, - LocationMode, - baseHref = $browser.baseHref(), // if base[href] is undefined, it defaults to '' - initialUrl = $browser.url(), - appBase; - - if (html5Mode.enabled) { - if (!baseHref && html5Mode.requireBase) { - throw $locationMinErr('nobase', - '$location in HTML5 mode requires a tag to be present!'); - } - appBase = serverBase(initialUrl) + (baseHref || '/'); - LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url; - } else { - appBase = stripHash(initialUrl); - LocationMode = LocationHashbangUrl; - } - var appBaseNoFile = stripFile(appBase); - - $location = new LocationMode(appBase, appBaseNoFile, '#' + hashPrefix); - $location.$$parseLinkUrl(initialUrl, initialUrl); - - $location.$$state = $browser.state(); - - var IGNORE_URI_REGEXP = /^\s*(javascript|mailto):/i; - - function setBrowserUrlWithFallback(url, replace, state) { - var oldUrl = $location.url(); - var oldState = $location.$$state; - try { - $browser.url(url, replace, state); - - // Make sure $location.state() returns referentially identical (not just deeply equal) - // state object; this makes possible quick checking if the state changed in the digest - // loop. Checking deep equality would be too expensive. - $location.$$state = $browser.state(); - } catch (e) { - // Restore old values if pushState fails - $location.url(oldUrl); - $location.$$state = oldState; - - throw e; - } - } - - $rootElement.on('click', function(event) { - var rewriteLinks = html5Mode.rewriteLinks; - // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser) - // currently we open nice url link and redirect then - - if (!rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which === 2 || event.button === 2) return; - - var elm = jqLite(event.target); - - // traverse the DOM up to find first A tag - while (nodeName_(elm[0]) !== 'a') { - // ignore rewriting if no A tag (reached root element, or no parent - removed from document) - if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return; - } - - if (isString(rewriteLinks) && isUndefined(elm.attr(rewriteLinks))) return; - - var absHref = elm.prop('href'); - // get the actual href attribute - see - // http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx - var relHref = elm.attr('href') || elm.attr('xlink:href'); - - if (isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]') { - // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during - // an animation. - absHref = urlResolve(absHref.animVal).href; - } - - // Ignore when url is started with javascript: or mailto: - if (IGNORE_URI_REGEXP.test(absHref)) return; - - if (absHref && !elm.attr('target') && !event.isDefaultPrevented()) { - if ($location.$$parseLinkUrl(absHref, relHref)) { - // We do a preventDefault for all urls that are part of the AngularJS application, - // in html5mode and also without, so that we are able to abort navigation without - // getting double entries in the location history. - event.preventDefault(); - // update location manually - if ($location.absUrl() !== $browser.url()) { - $rootScope.$apply(); - // hack to work around FF6 bug 684208 when scenario runner clicks on links - $window.angular['ff-684208-preventDefault'] = true; - } - } - } - }); - - - // rewrite hashbang url <> html5 url - if (trimEmptyHash($location.absUrl()) !== trimEmptyHash(initialUrl)) { - $browser.url($location.absUrl(), true); - } - - var initializing = true; - - // update $location when $browser url changes - $browser.onUrlChange(function(newUrl, newState) { - - if (!startsWith(newUrl, appBaseNoFile)) { - // If we are navigating outside of the app then force a reload - $window.location.href = newUrl; - return; - } - - $rootScope.$evalAsync(function() { - var oldUrl = $location.absUrl(); - var oldState = $location.$$state; - var defaultPrevented; - newUrl = trimEmptyHash(newUrl); - $location.$$parse(newUrl); - $location.$$state = newState; - - defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, - newState, oldState).defaultPrevented; - - // if the location was changed by a `$locationChangeStart` handler then stop - // processing this location change - if ($location.absUrl() !== newUrl) return; - - if (defaultPrevented) { - $location.$$parse(oldUrl); - $location.$$state = oldState; - setBrowserUrlWithFallback(oldUrl, false, oldState); - } else { - initializing = false; - afterLocationChange(oldUrl, oldState); - } - }); - if (!$rootScope.$$phase) $rootScope.$digest(); - }); - - // update browser - $rootScope.$watch(function $locationWatch() { - if (initializing || $location.$$urlUpdatedByLocation) { - $location.$$urlUpdatedByLocation = false; - - var oldUrl = trimEmptyHash($browser.url()); - var newUrl = trimEmptyHash($location.absUrl()); - var oldState = $browser.state(); - var currentReplace = $location.$$replace; - var urlOrStateChanged = oldUrl !== newUrl || - ($location.$$html5 && $sniffer.history && oldState !== $location.$$state); - - if (initializing || urlOrStateChanged) { - initializing = false; - - $rootScope.$evalAsync(function() { - var newUrl = $location.absUrl(); - var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, - $location.$$state, oldState).defaultPrevented; - - // if the location was changed by a `$locationChangeStart` handler then stop - // processing this location change - if ($location.absUrl() !== newUrl) return; - - if (defaultPrevented) { - $location.$$parse(oldUrl); - $location.$$state = oldState; - } else { - if (urlOrStateChanged) { - setBrowserUrlWithFallback(newUrl, currentReplace, - oldState === $location.$$state ? null : $location.$$state); - } - afterLocationChange(oldUrl, oldState); - } - }); - } - } - - $location.$$replace = false; - - // we don't need to return anything because $evalAsync will make the digest loop dirty when - // there is a change - }); - - return $location; - - function afterLocationChange(oldUrl, oldState) { - $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl, - $location.$$state, oldState); - } - }]; - } - - /** - * @ngdoc service - * @name $log - * @requires $window - * - * @description - * Simple service for logging. Default implementation safely writes the message - * into the browser's console (if present). - * - * The main purpose of this service is to simplify debugging and troubleshooting. - * - * To reveal the location of the calls to `$log` in the JavaScript console, - * you can "blackbox" the AngularJS source in your browser: - * - * [Mozilla description of blackboxing](https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Black_box_a_source). - * [Chrome description of blackboxing](https://developer.chrome.com/devtools/docs/blackboxing). - * - * Note: Not all browsers support blackboxing. - * - * The default is to log `debug` messages. You can use - * {@link ng.$logProvider ng.$logProvider#debugEnabled} to change this. - * - * @example - - - angular.module('logExample', []) - .controller('LogController', ['$scope', '$log', function($scope, $log) { - $scope.$log = $log; - $scope.message = 'Hello World!'; - }]); - - -
    -

    Reload this page with open console, enter text and hit the log button...

    - - - - - - -
    -
    -
    - */ - - /** - * @ngdoc provider - * @name $logProvider - * @this - * - * @description - * Use the `$logProvider` to configure how the application logs messages - */ - function $LogProvider() { - var debug = true, - self = this; - - /** - * @ngdoc method - * @name $logProvider#debugEnabled - * @description - * @param {boolean=} flag enable or disable debug level messages - * @returns {*} current value if used as getter or itself (chaining) if used as setter - */ - this.debugEnabled = function(flag) { - if (isDefined(flag)) { - debug = flag; - return this; - } else { - return debug; - } - }; - - this.$get = ['$window', function($window) { - // Support: IE 9-11, Edge 12-14+ - // IE/Edge display errors in such a way that it requires the user to click in 4 places - // to see the stack trace. There is no way to feature-detect it so there's a chance - // of the user agent sniffing to go wrong but since it's only about logging, this shouldn't - // break apps. Other browsers display errors in a sensible way and some of them map stack - // traces along source maps if available so it makes sense to let browsers display it - // as they want. - var formatStackTrace = msie || /\bEdge\//.test($window.navigator && $window.navigator.userAgent); - - return { - /** - * @ngdoc method - * @name $log#log - * - * @description - * Write a log message - */ - log: consoleLog('log'), - - /** - * @ngdoc method - * @name $log#info - * - * @description - * Write an information message - */ - info: consoleLog('info'), - - /** - * @ngdoc method - * @name $log#warn - * - * @description - * Write a warning message - */ - warn: consoleLog('warn'), - - /** - * @ngdoc method - * @name $log#error - * - * @description - * Write an error message - */ - error: consoleLog('error'), - - /** - * @ngdoc method - * @name $log#debug - * - * @description - * Write a debug message - */ - debug: (function() { - var fn = consoleLog('debug'); - - return function() { - if (debug) { - fn.apply(self, arguments); - } - }; - })() - }; - - function formatError(arg) { - if (isError(arg)) { - if (arg.stack && formatStackTrace) { - arg = (arg.message && arg.stack.indexOf(arg.message) === -1) - ? 'Error: ' + arg.message + '\n' + arg.stack - : arg.stack; - } else if (arg.sourceURL) { - arg = arg.message + '\n' + arg.sourceURL + ':' + arg.line; - } - } - return arg; - } - - function consoleLog(type) { - var console = $window.console || {}, - logFn = console[type] || console.log || noop; - - return function() { - var args = []; - forEach(arguments, function(arg) { - args.push(formatError(arg)); - }); - // Support: IE 9 only - // console methods don't inherit from Function.prototype in IE 9 so we can't - // call `logFn.apply(console, args)` directly. - return Function.prototype.apply.call(logFn, console, args); - }; - } - }]; - } - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Any commits to this file should be reviewed with security in mind. * - * Changes to this file can potentially create security vulnerabilities. * - * An approval from 2 Core members with history of modifying * - * this file is required. * - * * - * Does the change somehow allow for arbitrary javascript to be executed? * - * Or allows for someone to change the prototype of built-in objects? * - * Or gives undesired access to variables likes document or window? * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - var $parseMinErr = minErr('$parse'); - - var objectValueOf = {}.constructor.prototype.valueOf; - -// Sandboxing AngularJS Expressions -// ------------------------------ -// AngularJS expressions are no longer sandboxed. So it is now even easier to access arbitrary JS code by -// various means such as obtaining a reference to native JS functions like the Function constructor. -// -// As an example, consider the following AngularJS expression: -// -// {}.toString.constructor('alert("evil JS code")') -// -// It is important to realize that if you create an expression from a string that contains user provided -// content then it is possible that your application contains a security vulnerability to an XSS style attack. -// -// See https://docs.angularjs.org/guide/security - - - function getStringValue(name) { - // Property names must be strings. This means that non-string objects cannot be used - // as keys in an object. Any non-string object, including a number, is typecasted - // into a string via the toString method. - // -- MDN, https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Property_accessors#Property_names - // - // So, to ensure that we are checking the same `name` that JavaScript would use, we cast it - // to a string. It's not always possible. If `name` is an object and its `toString` method is - // 'broken' (doesn't return a string, isn't a function, etc.), an error will be thrown: - // - // TypeError: Cannot convert object to primitive value - // - // For performance reasons, we don't catch this error here and allow it to propagate up the call - // stack. Note that you'll get the same error in JavaScript if you try to access a property using - // such a 'broken' object as a key. - return name + ''; - } - - - var OPERATORS = createMap(); - forEach('+ - * / % === !== == != < > <= >= && || ! = |'.split(' '), function(operator) { OPERATORS[operator] = true; }); - var ESCAPE = {'n':'\n', 'f':'\f', 'r':'\r', 't':'\t', 'v':'\v', '\'':'\'', '"':'"'}; - - -///////////////////////////////////////// - - - /** - * @constructor - */ - var Lexer = function Lexer(options) { - this.options = options; - }; - - Lexer.prototype = { - constructor: Lexer, - - lex: function(text) { - this.text = text; - this.index = 0; - this.tokens = []; - - while (this.index < this.text.length) { - var ch = this.text.charAt(this.index); - if (ch === '"' || ch === '\'') { - this.readString(ch); - } else if (this.isNumber(ch) || ch === '.' && this.isNumber(this.peek())) { - this.readNumber(); - } else if (this.isIdentifierStart(this.peekMultichar())) { - this.readIdent(); - } else if (this.is(ch, '(){}[].,;:?')) { - this.tokens.push({index: this.index, text: ch}); - this.index++; - } else if (this.isWhitespace(ch)) { - this.index++; - } else { - var ch2 = ch + this.peek(); - var ch3 = ch2 + this.peek(2); - var op1 = OPERATORS[ch]; - var op2 = OPERATORS[ch2]; - var op3 = OPERATORS[ch3]; - if (op1 || op2 || op3) { - var token = op3 ? ch3 : (op2 ? ch2 : ch); - this.tokens.push({index: this.index, text: token, operator: true}); - this.index += token.length; - } else { - this.throwError('Unexpected next character ', this.index, this.index + 1); - } - } - } - return this.tokens; - }, - - is: function(ch, chars) { - return chars.indexOf(ch) !== -1; - }, - - peek: function(i) { - var num = i || 1; - return (this.index + num < this.text.length) ? this.text.charAt(this.index + num) : false; - }, - - isNumber: function(ch) { - return ('0' <= ch && ch <= '9') && typeof ch === 'string'; - }, - - isWhitespace: function(ch) { - // IE treats non-breaking space as \u00A0 - return (ch === ' ' || ch === '\r' || ch === '\t' || - ch === '\n' || ch === '\v' || ch === '\u00A0'); - }, - - isIdentifierStart: function(ch) { - return this.options.isIdentifierStart ? - this.options.isIdentifierStart(ch, this.codePointAt(ch)) : - this.isValidIdentifierStart(ch); - }, - - isValidIdentifierStart: function(ch) { - return ('a' <= ch && ch <= 'z' || - 'A' <= ch && ch <= 'Z' || - '_' === ch || ch === '$'); - }, - - isIdentifierContinue: function(ch) { - return this.options.isIdentifierContinue ? - this.options.isIdentifierContinue(ch, this.codePointAt(ch)) : - this.isValidIdentifierContinue(ch); - }, - - isValidIdentifierContinue: function(ch, cp) { - return this.isValidIdentifierStart(ch, cp) || this.isNumber(ch); - }, - - codePointAt: function(ch) { - if (ch.length === 1) return ch.charCodeAt(0); - // eslint-disable-next-line no-bitwise - return (ch.charCodeAt(0) << 10) + ch.charCodeAt(1) - 0x35FDC00; - }, - - peekMultichar: function() { - var ch = this.text.charAt(this.index); - var peek = this.peek(); - if (!peek) { - return ch; - } - var cp1 = ch.charCodeAt(0); - var cp2 = peek.charCodeAt(0); - if (cp1 >= 0xD800 && cp1 <= 0xDBFF && cp2 >= 0xDC00 && cp2 <= 0xDFFF) { - return ch + peek; - } - return ch; - }, - - isExpOperator: function(ch) { - return (ch === '-' || ch === '+' || this.isNumber(ch)); - }, - - throwError: function(error, start, end) { - end = end || this.index; - var colStr = (isDefined(start) - ? 's ' + start + '-' + this.index + ' [' + this.text.substring(start, end) + ']' - : ' ' + end); - throw $parseMinErr('lexerr', 'Lexer Error: {0} at column{1} in expression [{2}].', - error, colStr, this.text); - }, - - readNumber: function() { - var number = ''; - var start = this.index; - while (this.index < this.text.length) { - var ch = lowercase(this.text.charAt(this.index)); - if (ch === '.' || this.isNumber(ch)) { - number += ch; - } else { - var peekCh = this.peek(); - if (ch === 'e' && this.isExpOperator(peekCh)) { - number += ch; - } else if (this.isExpOperator(ch) && - peekCh && this.isNumber(peekCh) && - number.charAt(number.length - 1) === 'e') { - number += ch; - } else if (this.isExpOperator(ch) && - (!peekCh || !this.isNumber(peekCh)) && - number.charAt(number.length - 1) === 'e') { - this.throwError('Invalid exponent'); - } else { - break; - } - } - this.index++; - } - this.tokens.push({ - index: start, - text: number, - constant: true, - value: Number(number) - }); - }, - - readIdent: function() { - var start = this.index; - this.index += this.peekMultichar().length; - while (this.index < this.text.length) { - var ch = this.peekMultichar(); - if (!this.isIdentifierContinue(ch)) { - break; - } - this.index += ch.length; - } - this.tokens.push({ - index: start, - text: this.text.slice(start, this.index), - identifier: true - }); - }, - - readString: function(quote) { - var start = this.index; - this.index++; - var string = ''; - var rawString = quote; - var escape = false; - while (this.index < this.text.length) { - var ch = this.text.charAt(this.index); - rawString += ch; - if (escape) { - if (ch === 'u') { - var hex = this.text.substring(this.index + 1, this.index + 5); - if (!hex.match(/[\da-f]{4}/i)) { - this.throwError('Invalid unicode escape [\\u' + hex + ']'); - } - this.index += 4; - string += String.fromCharCode(parseInt(hex, 16)); - } else { - var rep = ESCAPE[ch]; - string = string + (rep || ch); - } - escape = false; - } else if (ch === '\\') { - escape = true; - } else if (ch === quote) { - this.index++; - this.tokens.push({ - index: start, - text: rawString, - constant: true, - value: string - }); - return; - } else { - string += ch; - } - this.index++; - } - this.throwError('Unterminated quote', start); - } - }; - - var AST = function AST(lexer, options) { - this.lexer = lexer; - this.options = options; - }; - - AST.Program = 'Program'; - AST.ExpressionStatement = 'ExpressionStatement'; - AST.AssignmentExpression = 'AssignmentExpression'; - AST.ConditionalExpression = 'ConditionalExpression'; - AST.LogicalExpression = 'LogicalExpression'; - AST.BinaryExpression = 'BinaryExpression'; - AST.UnaryExpression = 'UnaryExpression'; - AST.CallExpression = 'CallExpression'; - AST.MemberExpression = 'MemberExpression'; - AST.Identifier = 'Identifier'; - AST.Literal = 'Literal'; - AST.ArrayExpression = 'ArrayExpression'; - AST.Property = 'Property'; - AST.ObjectExpression = 'ObjectExpression'; - AST.ThisExpression = 'ThisExpression'; - AST.LocalsExpression = 'LocalsExpression'; - -// Internal use only - AST.NGValueParameter = 'NGValueParameter'; - - AST.prototype = { - ast: function(text) { - this.text = text; - this.tokens = this.lexer.lex(text); - - var value = this.program(); - - if (this.tokens.length !== 0) { - this.throwError('is an unexpected token', this.tokens[0]); - } - - return value; - }, - - program: function() { - var body = []; - while (true) { - if (this.tokens.length > 0 && !this.peek('}', ')', ';', ']')) - body.push(this.expressionStatement()); - if (!this.expect(';')) { - return { type: AST.Program, body: body}; - } - } - }, - - expressionStatement: function() { - return { type: AST.ExpressionStatement, expression: this.filterChain() }; - }, - - filterChain: function() { - var left = this.expression(); - while (this.expect('|')) { - left = this.filter(left); - } - return left; - }, - - expression: function() { - return this.assignment(); - }, - - assignment: function() { - var result = this.ternary(); - if (this.expect('=')) { - if (!isAssignable(result)) { - throw $parseMinErr('lval', 'Trying to assign a value to a non l-value'); - } - - result = { type: AST.AssignmentExpression, left: result, right: this.assignment(), operator: '='}; - } - return result; - }, - - ternary: function() { - var test = this.logicalOR(); - var alternate; - var consequent; - if (this.expect('?')) { - alternate = this.expression(); - if (this.consume(':')) { - consequent = this.expression(); - return { type: AST.ConditionalExpression, test: test, alternate: alternate, consequent: consequent}; - } - } - return test; - }, - - logicalOR: function() { - var left = this.logicalAND(); - while (this.expect('||')) { - left = { type: AST.LogicalExpression, operator: '||', left: left, right: this.logicalAND() }; - } - return left; - }, - - logicalAND: function() { - var left = this.equality(); - while (this.expect('&&')) { - left = { type: AST.LogicalExpression, operator: '&&', left: left, right: this.equality()}; - } - return left; - }, - - equality: function() { - var left = this.relational(); - var token; - while ((token = this.expect('==','!=','===','!=='))) { - left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.relational() }; - } - return left; - }, - - relational: function() { - var left = this.additive(); - var token; - while ((token = this.expect('<', '>', '<=', '>='))) { - left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.additive() }; - } - return left; - }, - - additive: function() { - var left = this.multiplicative(); - var token; - while ((token = this.expect('+','-'))) { - left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.multiplicative() }; - } - return left; - }, - - multiplicative: function() { - var left = this.unary(); - var token; - while ((token = this.expect('*','/','%'))) { - left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.unary() }; - } - return left; - }, - - unary: function() { - var token; - if ((token = this.expect('+', '-', '!'))) { - return { type: AST.UnaryExpression, operator: token.text, prefix: true, argument: this.unary() }; - } else { - return this.primary(); - } - }, - - primary: function() { - var primary; - if (this.expect('(')) { - primary = this.filterChain(); - this.consume(')'); - } else if (this.expect('[')) { - primary = this.arrayDeclaration(); - } else if (this.expect('{')) { - primary = this.object(); - } else if (this.selfReferential.hasOwnProperty(this.peek().text)) { - primary = copy(this.selfReferential[this.consume().text]); - } else if (this.options.literals.hasOwnProperty(this.peek().text)) { - primary = { type: AST.Literal, value: this.options.literals[this.consume().text]}; - } else if (this.peek().identifier) { - primary = this.identifier(); - } else if (this.peek().constant) { - primary = this.constant(); - } else { - this.throwError('not a primary expression', this.peek()); - } - - var next; - while ((next = this.expect('(', '[', '.'))) { - if (next.text === '(') { - primary = {type: AST.CallExpression, callee: primary, arguments: this.parseArguments() }; - this.consume(')'); - } else if (next.text === '[') { - primary = { type: AST.MemberExpression, object: primary, property: this.expression(), computed: true }; - this.consume(']'); - } else if (next.text === '.') { - primary = { type: AST.MemberExpression, object: primary, property: this.identifier(), computed: false }; - } else { - this.throwError('IMPOSSIBLE'); - } - } - return primary; - }, - - filter: function(baseExpression) { - var args = [baseExpression]; - var result = {type: AST.CallExpression, callee: this.identifier(), arguments: args, filter: true}; - - while (this.expect(':')) { - args.push(this.expression()); - } - - return result; - }, - - parseArguments: function() { - var args = []; - if (this.peekToken().text !== ')') { - do { - args.push(this.filterChain()); - } while (this.expect(',')); - } - return args; - }, - - identifier: function() { - var token = this.consume(); - if (!token.identifier) { - this.throwError('is not a valid identifier', token); - } - return { type: AST.Identifier, name: token.text }; - }, - - constant: function() { - // TODO check that it is a constant - return { type: AST.Literal, value: this.consume().value }; - }, - - arrayDeclaration: function() { - var elements = []; - if (this.peekToken().text !== ']') { - do { - if (this.peek(']')) { - // Support trailing commas per ES5.1. - break; - } - elements.push(this.expression()); - } while (this.expect(',')); - } - this.consume(']'); - - return { type: AST.ArrayExpression, elements: elements }; - }, - - object: function() { - var properties = [], property; - if (this.peekToken().text !== '}') { - do { - if (this.peek('}')) { - // Support trailing commas per ES5.1. - break; - } - property = {type: AST.Property, kind: 'init'}; - if (this.peek().constant) { - property.key = this.constant(); - property.computed = false; - this.consume(':'); - property.value = this.expression(); - } else if (this.peek().identifier) { - property.key = this.identifier(); - property.computed = false; - if (this.peek(':')) { - this.consume(':'); - property.value = this.expression(); - } else { - property.value = property.key; - } - } else if (this.peek('[')) { - this.consume('['); - property.key = this.expression(); - this.consume(']'); - property.computed = true; - this.consume(':'); - property.value = this.expression(); - } else { - this.throwError('invalid key', this.peek()); - } - properties.push(property); - } while (this.expect(',')); - } - this.consume('}'); - - return {type: AST.ObjectExpression, properties: properties }; - }, - - throwError: function(msg, token) { - throw $parseMinErr('syntax', - 'Syntax Error: Token \'{0}\' {1} at column {2} of the expression [{3}] starting at [{4}].', - token.text, msg, (token.index + 1), this.text, this.text.substring(token.index)); - }, - - consume: function(e1) { - if (this.tokens.length === 0) { - throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text); - } - - var token = this.expect(e1); - if (!token) { - this.throwError('is unexpected, expecting [' + e1 + ']', this.peek()); - } - return token; - }, - - peekToken: function() { - if (this.tokens.length === 0) { - throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text); - } - return this.tokens[0]; - }, - - peek: function(e1, e2, e3, e4) { - return this.peekAhead(0, e1, e2, e3, e4); - }, - - peekAhead: function(i, e1, e2, e3, e4) { - if (this.tokens.length > i) { - var token = this.tokens[i]; - var t = token.text; - if (t === e1 || t === e2 || t === e3 || t === e4 || - (!e1 && !e2 && !e3 && !e4)) { - return token; - } - } - return false; - }, - - expect: function(e1, e2, e3, e4) { - var token = this.peek(e1, e2, e3, e4); - if (token) { - this.tokens.shift(); - return token; - } - return false; - }, - - selfReferential: { - 'this': {type: AST.ThisExpression }, - '$locals': {type: AST.LocalsExpression } - } - }; - - function ifDefined(v, d) { - return typeof v !== 'undefined' ? v : d; - } - - function plusFn(l, r) { - if (typeof l === 'undefined') return r; - if (typeof r === 'undefined') return l; - return l + r; - } - - function isStateless($filter, filterName) { - var fn = $filter(filterName); - return !fn.$stateful; - } - - var PURITY_ABSOLUTE = 1; - var PURITY_RELATIVE = 2; - -// Detect nodes which could depend on non-shallow state of objects - function isPure(node, parentIsPure) { - switch (node.type) { - // Computed members might invoke a stateful toString() - case AST.MemberExpression: - if (node.computed) { - return false; - } - break; - - // Unary always convert to primative - case AST.UnaryExpression: - return PURITY_ABSOLUTE; - - // The binary + operator can invoke a stateful toString(). - case AST.BinaryExpression: - return node.operator !== '+' ? PURITY_ABSOLUTE : false; - - // Functions / filters probably read state from within objects - case AST.CallExpression: - return false; - } - - return (undefined === parentIsPure) ? PURITY_RELATIVE : parentIsPure; - } - - function findConstantAndWatchExpressions(ast, $filter, parentIsPure) { - var allConstants; - var argsToWatch; - var isStatelessFilter; - - var astIsPure = ast.isPure = isPure(ast, parentIsPure); - - switch (ast.type) { - case AST.Program: - allConstants = true; - forEach(ast.body, function(expr) { - findConstantAndWatchExpressions(expr.expression, $filter, astIsPure); - allConstants = allConstants && expr.expression.constant; - }); - ast.constant = allConstants; - break; - case AST.Literal: - ast.constant = true; - ast.toWatch = []; - break; - case AST.UnaryExpression: - findConstantAndWatchExpressions(ast.argument, $filter, astIsPure); - ast.constant = ast.argument.constant; - ast.toWatch = ast.argument.toWatch; - break; - case AST.BinaryExpression: - findConstantAndWatchExpressions(ast.left, $filter, astIsPure); - findConstantAndWatchExpressions(ast.right, $filter, astIsPure); - ast.constant = ast.left.constant && ast.right.constant; - ast.toWatch = ast.left.toWatch.concat(ast.right.toWatch); - break; - case AST.LogicalExpression: - findConstantAndWatchExpressions(ast.left, $filter, astIsPure); - findConstantAndWatchExpressions(ast.right, $filter, astIsPure); - ast.constant = ast.left.constant && ast.right.constant; - ast.toWatch = ast.constant ? [] : [ast]; - break; - case AST.ConditionalExpression: - findConstantAndWatchExpressions(ast.test, $filter, astIsPure); - findConstantAndWatchExpressions(ast.alternate, $filter, astIsPure); - findConstantAndWatchExpressions(ast.consequent, $filter, astIsPure); - ast.constant = ast.test.constant && ast.alternate.constant && ast.consequent.constant; - ast.toWatch = ast.constant ? [] : [ast]; - break; - case AST.Identifier: - ast.constant = false; - ast.toWatch = [ast]; - break; - case AST.MemberExpression: - findConstantAndWatchExpressions(ast.object, $filter, astIsPure); - if (ast.computed) { - findConstantAndWatchExpressions(ast.property, $filter, astIsPure); - } - ast.constant = ast.object.constant && (!ast.computed || ast.property.constant); - ast.toWatch = ast.constant ? [] : [ast]; - break; - case AST.CallExpression: - isStatelessFilter = ast.filter ? isStateless($filter, ast.callee.name) : false; - allConstants = isStatelessFilter; - argsToWatch = []; - forEach(ast.arguments, function(expr) { - findConstantAndWatchExpressions(expr, $filter, astIsPure); - allConstants = allConstants && expr.constant; - argsToWatch.push.apply(argsToWatch, expr.toWatch); - }); - ast.constant = allConstants; - ast.toWatch = isStatelessFilter ? argsToWatch : [ast]; - break; - case AST.AssignmentExpression: - findConstantAndWatchExpressions(ast.left, $filter, astIsPure); - findConstantAndWatchExpressions(ast.right, $filter, astIsPure); - ast.constant = ast.left.constant && ast.right.constant; - ast.toWatch = [ast]; - break; - case AST.ArrayExpression: - allConstants = true; - argsToWatch = []; - forEach(ast.elements, function(expr) { - findConstantAndWatchExpressions(expr, $filter, astIsPure); - allConstants = allConstants && expr.constant; - argsToWatch.push.apply(argsToWatch, expr.toWatch); - }); - ast.constant = allConstants; - ast.toWatch = argsToWatch; - break; - case AST.ObjectExpression: - allConstants = true; - argsToWatch = []; - forEach(ast.properties, function(property) { - findConstantAndWatchExpressions(property.value, $filter, astIsPure); - allConstants = allConstants && property.value.constant; - argsToWatch.push.apply(argsToWatch, property.value.toWatch); - if (property.computed) { - //`{[key]: value}` implicitly does `key.toString()` which may be non-pure - findConstantAndWatchExpressions(property.key, $filter, /*parentIsPure=*/false); - allConstants = allConstants && property.key.constant; - argsToWatch.push.apply(argsToWatch, property.key.toWatch); - } - }); - ast.constant = allConstants; - ast.toWatch = argsToWatch; - break; - case AST.ThisExpression: - ast.constant = false; - ast.toWatch = []; - break; - case AST.LocalsExpression: - ast.constant = false; - ast.toWatch = []; - break; - } - } - - function getInputs(body) { - if (body.length !== 1) return; - var lastExpression = body[0].expression; - var candidate = lastExpression.toWatch; - if (candidate.length !== 1) return candidate; - return candidate[0] !== lastExpression ? candidate : undefined; - } - - function isAssignable(ast) { - return ast.type === AST.Identifier || ast.type === AST.MemberExpression; - } - - function assignableAST(ast) { - if (ast.body.length === 1 && isAssignable(ast.body[0].expression)) { - return {type: AST.AssignmentExpression, left: ast.body[0].expression, right: {type: AST.NGValueParameter}, operator: '='}; - } - } - - function isLiteral(ast) { - return ast.body.length === 0 || - ast.body.length === 1 && ( - ast.body[0].expression.type === AST.Literal || - ast.body[0].expression.type === AST.ArrayExpression || - ast.body[0].expression.type === AST.ObjectExpression); - } - - function isConstant(ast) { - return ast.constant; - } - - function ASTCompiler($filter) { - this.$filter = $filter; - } - - ASTCompiler.prototype = { - compile: function(ast) { - var self = this; - this.state = { - nextId: 0, - filters: {}, - fn: {vars: [], body: [], own: {}}, - assign: {vars: [], body: [], own: {}}, - inputs: [] - }; - findConstantAndWatchExpressions(ast, self.$filter); - var extra = ''; - var assignable; - this.stage = 'assign'; - if ((assignable = assignableAST(ast))) { - this.state.computing = 'assign'; - var result = this.nextId(); - this.recurse(assignable, result); - this.return_(result); - extra = 'fn.assign=' + this.generateFunction('assign', 's,v,l'); - } - var toWatch = getInputs(ast.body); - self.stage = 'inputs'; - forEach(toWatch, function(watch, key) { - var fnKey = 'fn' + key; - self.state[fnKey] = {vars: [], body: [], own: {}}; - self.state.computing = fnKey; - var intoId = self.nextId(); - self.recurse(watch, intoId); - self.return_(intoId); - self.state.inputs.push({name: fnKey, isPure: watch.isPure}); - watch.watchId = key; - }); - this.state.computing = 'fn'; - this.stage = 'main'; - this.recurse(ast); - var fnString = - // The build and minification steps remove the string "use strict" from the code, but this is done using a regex. - // This is a workaround for this until we do a better job at only removing the prefix only when we should. - '"' + this.USE + ' ' + this.STRICT + '";\n' + - this.filterPrefix() + - 'var fn=' + this.generateFunction('fn', 's,l,a,i') + - extra + - this.watchFns() + - 'return fn;'; - - // eslint-disable-next-line no-new-func - var fn = (new Function('$filter', - 'getStringValue', - 'ifDefined', - 'plus', - fnString))( - this.$filter, - getStringValue, - ifDefined, - plusFn); - this.state = this.stage = undefined; - return fn; - }, - - USE: 'use', - - STRICT: 'strict', - - watchFns: function() { - var result = []; - var inputs = this.state.inputs; - var self = this; - forEach(inputs, function(input) { - result.push('var ' + input.name + '=' + self.generateFunction(input.name, 's')); - if (input.isPure) { - result.push(input.name, '.isPure=' + JSON.stringify(input.isPure) + ';'); - } - }); - if (inputs.length) { - result.push('fn.inputs=[' + inputs.map(function(i) { return i.name; }).join(',') + '];'); - } - return result.join(''); - }, - - generateFunction: function(name, params) { - return 'function(' + params + '){' + - this.varsPrefix(name) + - this.body(name) + - '};'; - }, - - filterPrefix: function() { - var parts = []; - var self = this; - forEach(this.state.filters, function(id, filter) { - parts.push(id + '=$filter(' + self.escape(filter) + ')'); - }); - if (parts.length) return 'var ' + parts.join(',') + ';'; - return ''; - }, - - varsPrefix: function(section) { - return this.state[section].vars.length ? 'var ' + this.state[section].vars.join(',') + ';' : ''; - }, - - body: function(section) { - return this.state[section].body.join(''); - }, - - recurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) { - var left, right, self = this, args, expression, computed; - recursionFn = recursionFn || noop; - if (!skipWatchIdCheck && isDefined(ast.watchId)) { - intoId = intoId || this.nextId(); - this.if_('i', - this.lazyAssign(intoId, this.computedMember('i', ast.watchId)), - this.lazyRecurse(ast, intoId, nameId, recursionFn, create, true) - ); - return; - } - switch (ast.type) { - case AST.Program: - forEach(ast.body, function(expression, pos) { - self.recurse(expression.expression, undefined, undefined, function(expr) { right = expr; }); - if (pos !== ast.body.length - 1) { - self.current().body.push(right, ';'); - } else { - self.return_(right); - } - }); - break; - case AST.Literal: - expression = this.escape(ast.value); - this.assign(intoId, expression); - recursionFn(intoId || expression); - break; - case AST.UnaryExpression: - this.recurse(ast.argument, undefined, undefined, function(expr) { right = expr; }); - expression = ast.operator + '(' + this.ifDefined(right, 0) + ')'; - this.assign(intoId, expression); - recursionFn(expression); - break; - case AST.BinaryExpression: - this.recurse(ast.left, undefined, undefined, function(expr) { left = expr; }); - this.recurse(ast.right, undefined, undefined, function(expr) { right = expr; }); - if (ast.operator === '+') { - expression = this.plus(left, right); - } else if (ast.operator === '-') { - expression = this.ifDefined(left, 0) + ast.operator + this.ifDefined(right, 0); - } else { - expression = '(' + left + ')' + ast.operator + '(' + right + ')'; - } - this.assign(intoId, expression); - recursionFn(expression); - break; - case AST.LogicalExpression: - intoId = intoId || this.nextId(); - self.recurse(ast.left, intoId); - self.if_(ast.operator === '&&' ? intoId : self.not(intoId), self.lazyRecurse(ast.right, intoId)); - recursionFn(intoId); - break; - case AST.ConditionalExpression: - intoId = intoId || this.nextId(); - self.recurse(ast.test, intoId); - self.if_(intoId, self.lazyRecurse(ast.alternate, intoId), self.lazyRecurse(ast.consequent, intoId)); - recursionFn(intoId); - break; - case AST.Identifier: - intoId = intoId || this.nextId(); - if (nameId) { - nameId.context = self.stage === 'inputs' ? 's' : this.assign(this.nextId(), this.getHasOwnProperty('l', ast.name) + '?l:s'); - nameId.computed = false; - nameId.name = ast.name; - } - self.if_(self.stage === 'inputs' || self.not(self.getHasOwnProperty('l', ast.name)), - function() { - self.if_(self.stage === 'inputs' || 's', function() { - if (create && create !== 1) { - self.if_( - self.isNull(self.nonComputedMember('s', ast.name)), - self.lazyAssign(self.nonComputedMember('s', ast.name), '{}')); - } - self.assign(intoId, self.nonComputedMember('s', ast.name)); - }); - }, intoId && self.lazyAssign(intoId, self.nonComputedMember('l', ast.name)) - ); - recursionFn(intoId); - break; - case AST.MemberExpression: - left = nameId && (nameId.context = this.nextId()) || this.nextId(); - intoId = intoId || this.nextId(); - self.recurse(ast.object, left, undefined, function() { - self.if_(self.notNull(left), function() { - if (ast.computed) { - right = self.nextId(); - self.recurse(ast.property, right); - self.getStringValue(right); - if (create && create !== 1) { - self.if_(self.not(self.computedMember(left, right)), self.lazyAssign(self.computedMember(left, right), '{}')); - } - expression = self.computedMember(left, right); - self.assign(intoId, expression); - if (nameId) { - nameId.computed = true; - nameId.name = right; - } - } else { - if (create && create !== 1) { - self.if_(self.isNull(self.nonComputedMember(left, ast.property.name)), self.lazyAssign(self.nonComputedMember(left, ast.property.name), '{}')); - } - expression = self.nonComputedMember(left, ast.property.name); - self.assign(intoId, expression); - if (nameId) { - nameId.computed = false; - nameId.name = ast.property.name; - } - } - }, function() { - self.assign(intoId, 'undefined'); - }); - recursionFn(intoId); - }, !!create); - break; - case AST.CallExpression: - intoId = intoId || this.nextId(); - if (ast.filter) { - right = self.filter(ast.callee.name); - args = []; - forEach(ast.arguments, function(expr) { - var argument = self.nextId(); - self.recurse(expr, argument); - args.push(argument); - }); - expression = right + '(' + args.join(',') + ')'; - self.assign(intoId, expression); - recursionFn(intoId); - } else { - right = self.nextId(); - left = {}; - args = []; - self.recurse(ast.callee, right, left, function() { - self.if_(self.notNull(right), function() { - forEach(ast.arguments, function(expr) { - self.recurse(expr, ast.constant ? undefined : self.nextId(), undefined, function(argument) { - args.push(argument); - }); - }); - if (left.name) { - expression = self.member(left.context, left.name, left.computed) + '(' + args.join(',') + ')'; - } else { - expression = right + '(' + args.join(',') + ')'; - } - self.assign(intoId, expression); - }, function() { - self.assign(intoId, 'undefined'); - }); - recursionFn(intoId); - }); - } - break; - case AST.AssignmentExpression: - right = this.nextId(); - left = {}; - this.recurse(ast.left, undefined, left, function() { - self.if_(self.notNull(left.context), function() { - self.recurse(ast.right, right); - expression = self.member(left.context, left.name, left.computed) + ast.operator + right; - self.assign(intoId, expression); - recursionFn(intoId || expression); - }); - }, 1); - break; - case AST.ArrayExpression: - args = []; - forEach(ast.elements, function(expr) { - self.recurse(expr, ast.constant ? undefined : self.nextId(), undefined, function(argument) { - args.push(argument); - }); - }); - expression = '[' + args.join(',') + ']'; - this.assign(intoId, expression); - recursionFn(intoId || expression); - break; - case AST.ObjectExpression: - args = []; - computed = false; - forEach(ast.properties, function(property) { - if (property.computed) { - computed = true; - } - }); - if (computed) { - intoId = intoId || this.nextId(); - this.assign(intoId, '{}'); - forEach(ast.properties, function(property) { - if (property.computed) { - left = self.nextId(); - self.recurse(property.key, left); - } else { - left = property.key.type === AST.Identifier ? - property.key.name : - ('' + property.key.value); - } - right = self.nextId(); - self.recurse(property.value, right); - self.assign(self.member(intoId, left, property.computed), right); - }); - } else { - forEach(ast.properties, function(property) { - self.recurse(property.value, ast.constant ? undefined : self.nextId(), undefined, function(expr) { - args.push(self.escape( - property.key.type === AST.Identifier ? property.key.name : - ('' + property.key.value)) + - ':' + expr); - }); - }); - expression = '{' + args.join(',') + '}'; - this.assign(intoId, expression); - } - recursionFn(intoId || expression); - break; - case AST.ThisExpression: - this.assign(intoId, 's'); - recursionFn(intoId || 's'); - break; - case AST.LocalsExpression: - this.assign(intoId, 'l'); - recursionFn(intoId || 'l'); - break; - case AST.NGValueParameter: - this.assign(intoId, 'v'); - recursionFn(intoId || 'v'); - break; - } - }, - - getHasOwnProperty: function(element, property) { - var key = element + '.' + property; - var own = this.current().own; - if (!own.hasOwnProperty(key)) { - own[key] = this.nextId(false, element + '&&(' + this.escape(property) + ' in ' + element + ')'); - } - return own[key]; - }, - - assign: function(id, value) { - if (!id) return; - this.current().body.push(id, '=', value, ';'); - return id; - }, - - filter: function(filterName) { - if (!this.state.filters.hasOwnProperty(filterName)) { - this.state.filters[filterName] = this.nextId(true); - } - return this.state.filters[filterName]; - }, - - ifDefined: function(id, defaultValue) { - return 'ifDefined(' + id + ',' + this.escape(defaultValue) + ')'; - }, - - plus: function(left, right) { - return 'plus(' + left + ',' + right + ')'; - }, - - return_: function(id) { - this.current().body.push('return ', id, ';'); - }, - - if_: function(test, alternate, consequent) { - if (test === true) { - alternate(); - } else { - var body = this.current().body; - body.push('if(', test, '){'); - alternate(); - body.push('}'); - if (consequent) { - body.push('else{'); - consequent(); - body.push('}'); - } - } - }, - - not: function(expression) { - return '!(' + expression + ')'; - }, - - isNull: function(expression) { - return expression + '==null'; - }, - - notNull: function(expression) { - return expression + '!=null'; - }, - - nonComputedMember: function(left, right) { - var SAFE_IDENTIFIER = /^[$_a-zA-Z][$_a-zA-Z0-9]*$/; - var UNSAFE_CHARACTERS = /[^$_a-zA-Z0-9]/g; - if (SAFE_IDENTIFIER.test(right)) { - return left + '.' + right; - } else { - return left + '["' + right.replace(UNSAFE_CHARACTERS, this.stringEscapeFn) + '"]'; - } - }, - - computedMember: function(left, right) { - return left + '[' + right + ']'; - }, - - member: function(left, right, computed) { - if (computed) return this.computedMember(left, right); - return this.nonComputedMember(left, right); - }, - - getStringValue: function(item) { - this.assign(item, 'getStringValue(' + item + ')'); - }, - - lazyRecurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) { - var self = this; - return function() { - self.recurse(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck); - }; - }, - - lazyAssign: function(id, value) { - var self = this; - return function() { - self.assign(id, value); - }; - }, - - stringEscapeRegex: /[^ a-zA-Z0-9]/g, - - stringEscapeFn: function(c) { - return '\\u' + ('0000' + c.charCodeAt(0).toString(16)).slice(-4); - }, - - escape: function(value) { - if (isString(value)) return '\'' + value.replace(this.stringEscapeRegex, this.stringEscapeFn) + '\''; - if (isNumber(value)) return value.toString(); - if (value === true) return 'true'; - if (value === false) return 'false'; - if (value === null) return 'null'; - if (typeof value === 'undefined') return 'undefined'; - - throw $parseMinErr('esc', 'IMPOSSIBLE'); - }, - - nextId: function(skip, init) { - var id = 'v' + (this.state.nextId++); - if (!skip) { - this.current().vars.push(id + (init ? '=' + init : '')); - } - return id; - }, - - current: function() { - return this.state[this.state.computing]; - } - }; - - - function ASTInterpreter($filter) { - this.$filter = $filter; - } - - ASTInterpreter.prototype = { - compile: function(ast) { - var self = this; - findConstantAndWatchExpressions(ast, self.$filter); - var assignable; - var assign; - if ((assignable = assignableAST(ast))) { - assign = this.recurse(assignable); - } - var toWatch = getInputs(ast.body); - var inputs; - if (toWatch) { - inputs = []; - forEach(toWatch, function(watch, key) { - var input = self.recurse(watch); - input.isPure = watch.isPure; - watch.input = input; - inputs.push(input); - watch.watchId = key; - }); - } - var expressions = []; - forEach(ast.body, function(expression) { - expressions.push(self.recurse(expression.expression)); - }); - var fn = ast.body.length === 0 ? noop : - ast.body.length === 1 ? expressions[0] : - function(scope, locals) { - var lastValue; - forEach(expressions, function(exp) { - lastValue = exp(scope, locals); - }); - return lastValue; - }; - if (assign) { - fn.assign = function(scope, value, locals) { - return assign(scope, locals, value); - }; - } - if (inputs) { - fn.inputs = inputs; - } - return fn; - }, - - recurse: function(ast, context, create) { - var left, right, self = this, args; - if (ast.input) { - return this.inputs(ast.input, ast.watchId); - } - switch (ast.type) { - case AST.Literal: - return this.value(ast.value, context); - case AST.UnaryExpression: - right = this.recurse(ast.argument); - return this['unary' + ast.operator](right, context); - case AST.BinaryExpression: - left = this.recurse(ast.left); - right = this.recurse(ast.right); - return this['binary' + ast.operator](left, right, context); - case AST.LogicalExpression: - left = this.recurse(ast.left); - right = this.recurse(ast.right); - return this['binary' + ast.operator](left, right, context); - case AST.ConditionalExpression: - return this['ternary?:']( - this.recurse(ast.test), - this.recurse(ast.alternate), - this.recurse(ast.consequent), - context - ); - case AST.Identifier: - return self.identifier(ast.name, context, create); - case AST.MemberExpression: - left = this.recurse(ast.object, false, !!create); - if (!ast.computed) { - right = ast.property.name; - } - if (ast.computed) right = this.recurse(ast.property); - return ast.computed ? - this.computedMember(left, right, context, create) : - this.nonComputedMember(left, right, context, create); - case AST.CallExpression: - args = []; - forEach(ast.arguments, function(expr) { - args.push(self.recurse(expr)); - }); - if (ast.filter) right = this.$filter(ast.callee.name); - if (!ast.filter) right = this.recurse(ast.callee, true); - return ast.filter ? - function(scope, locals, assign, inputs) { - var values = []; - for (var i = 0; i < args.length; ++i) { - values.push(args[i](scope, locals, assign, inputs)); - } - var value = right.apply(undefined, values, inputs); - return context ? {context: undefined, name: undefined, value: value} : value; - } : - function(scope, locals, assign, inputs) { - var rhs = right(scope, locals, assign, inputs); - var value; - if (rhs.value != null) { - var values = []; - for (var i = 0; i < args.length; ++i) { - values.push(args[i](scope, locals, assign, inputs)); - } - value = rhs.value.apply(rhs.context, values); - } - return context ? {value: value} : value; - }; - case AST.AssignmentExpression: - left = this.recurse(ast.left, true, 1); - right = this.recurse(ast.right); - return function(scope, locals, assign, inputs) { - var lhs = left(scope, locals, assign, inputs); - var rhs = right(scope, locals, assign, inputs); - lhs.context[lhs.name] = rhs; - return context ? {value: rhs} : rhs; - }; - case AST.ArrayExpression: - args = []; - forEach(ast.elements, function(expr) { - args.push(self.recurse(expr)); - }); - return function(scope, locals, assign, inputs) { - var value = []; - for (var i = 0; i < args.length; ++i) { - value.push(args[i](scope, locals, assign, inputs)); - } - return context ? {value: value} : value; - }; - case AST.ObjectExpression: - args = []; - forEach(ast.properties, function(property) { - if (property.computed) { - args.push({key: self.recurse(property.key), - computed: true, - value: self.recurse(property.value) - }); - } else { - args.push({key: property.key.type === AST.Identifier ? - property.key.name : - ('' + property.key.value), - computed: false, - value: self.recurse(property.value) - }); - } - }); - return function(scope, locals, assign, inputs) { - var value = {}; - for (var i = 0; i < args.length; ++i) { - if (args[i].computed) { - value[args[i].key(scope, locals, assign, inputs)] = args[i].value(scope, locals, assign, inputs); - } else { - value[args[i].key] = args[i].value(scope, locals, assign, inputs); - } - } - return context ? {value: value} : value; - }; - case AST.ThisExpression: - return function(scope) { - return context ? {value: scope} : scope; - }; - case AST.LocalsExpression: - return function(scope, locals) { - return context ? {value: locals} : locals; - }; - case AST.NGValueParameter: - return function(scope, locals, assign) { - return context ? {value: assign} : assign; - }; - } - }, - - 'unary+': function(argument, context) { - return function(scope, locals, assign, inputs) { - var arg = argument(scope, locals, assign, inputs); - if (isDefined(arg)) { - arg = +arg; - } else { - arg = 0; - } - return context ? {value: arg} : arg; - }; - }, - 'unary-': function(argument, context) { - return function(scope, locals, assign, inputs) { - var arg = argument(scope, locals, assign, inputs); - if (isDefined(arg)) { - arg = -arg; - } else { - arg = -0; - } - return context ? {value: arg} : arg; - }; - }, - 'unary!': function(argument, context) { - return function(scope, locals, assign, inputs) { - var arg = !argument(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary+': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var lhs = left(scope, locals, assign, inputs); - var rhs = right(scope, locals, assign, inputs); - var arg = plusFn(lhs, rhs); - return context ? {value: arg} : arg; - }; - }, - 'binary-': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var lhs = left(scope, locals, assign, inputs); - var rhs = right(scope, locals, assign, inputs); - var arg = (isDefined(lhs) ? lhs : 0) - (isDefined(rhs) ? rhs : 0); - return context ? {value: arg} : arg; - }; - }, - 'binary*': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) * right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary/': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) / right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary%': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) % right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary===': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) === right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary!==': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) !== right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary==': function(left, right, context) { - return function(scope, locals, assign, inputs) { - // eslint-disable-next-line eqeqeq - var arg = left(scope, locals, assign, inputs) == right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary!=': function(left, right, context) { - return function(scope, locals, assign, inputs) { - // eslint-disable-next-line eqeqeq - var arg = left(scope, locals, assign, inputs) != right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary<': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) < right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary>': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) > right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary<=': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) <= right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary>=': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) >= right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary&&': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) && right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary||': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) || right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'ternary?:': function(test, alternate, consequent, context) { - return function(scope, locals, assign, inputs) { - var arg = test(scope, locals, assign, inputs) ? alternate(scope, locals, assign, inputs) : consequent(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - value: function(value, context) { - return function() { return context ? {context: undefined, name: undefined, value: value} : value; }; - }, - identifier: function(name, context, create) { - return function(scope, locals, assign, inputs) { - var base = locals && (name in locals) ? locals : scope; - if (create && create !== 1 && base && base[name] == null) { - base[name] = {}; - } - var value = base ? base[name] : undefined; - if (context) { - return {context: base, name: name, value: value}; - } else { - return value; - } - }; - }, - computedMember: function(left, right, context, create) { - return function(scope, locals, assign, inputs) { - var lhs = left(scope, locals, assign, inputs); - var rhs; - var value; - if (lhs != null) { - rhs = right(scope, locals, assign, inputs); - rhs = getStringValue(rhs); - if (create && create !== 1) { - if (lhs && !(lhs[rhs])) { - lhs[rhs] = {}; - } - } - value = lhs[rhs]; - } - if (context) { - return {context: lhs, name: rhs, value: value}; - } else { - return value; - } - }; - }, - nonComputedMember: function(left, right, context, create) { - return function(scope, locals, assign, inputs) { - var lhs = left(scope, locals, assign, inputs); - if (create && create !== 1) { - if (lhs && lhs[right] == null) { - lhs[right] = {}; - } - } - var value = lhs != null ? lhs[right] : undefined; - if (context) { - return {context: lhs, name: right, value: value}; - } else { - return value; - } - }; - }, - inputs: function(input, watchId) { - return function(scope, value, locals, inputs) { - if (inputs) return inputs[watchId]; - return input(scope, value, locals); - }; - } - }; - - /** - * @constructor - */ - function Parser(lexer, $filter, options) { - this.ast = new AST(lexer, options); - this.astCompiler = options.csp ? new ASTInterpreter($filter) : - new ASTCompiler($filter); - } - - Parser.prototype = { - constructor: Parser, - - parse: function(text) { - var ast = this.getAst(text); - var fn = this.astCompiler.compile(ast.ast); - fn.literal = isLiteral(ast.ast); - fn.constant = isConstant(ast.ast); - fn.oneTime = ast.oneTime; - return fn; - }, - - getAst: function(exp) { - var oneTime = false; - exp = exp.trim(); - - if (exp.charAt(0) === ':' && exp.charAt(1) === ':') { - oneTime = true; - exp = exp.substring(2); - } - return { - ast: this.ast.ast(exp), - oneTime: oneTime - }; - } - }; - - function getValueOf(value) { - return isFunction(value.valueOf) ? value.valueOf() : objectValueOf.call(value); - } - -/////////////////////////////////// - - /** - * @ngdoc service - * @name $parse - * @kind function - * - * @description - * - * Converts AngularJS {@link guide/expression expression} into a function. - * - * ```js - * var getter = $parse('user.name'); - * var setter = getter.assign; - * var context = {user:{name:'AngularJS'}}; - * var locals = {user:{name:'local'}}; - * - * expect(getter(context)).toEqual('AngularJS'); - * setter(context, 'newValue'); - * expect(context.user.name).toEqual('newValue'); - * expect(getter(context, locals)).toEqual('local'); - * ``` - * - * - * @param {string} expression String expression to compile. - * @returns {function(context, locals)} a function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the strings - * are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values in - * `context`. - * - * The returned function also has the following properties: - * * `literal` – `{boolean}` – whether the expression's top-level node is a JavaScript - * literal. - * * `constant` – `{boolean}` – whether the expression is made entirely of JavaScript - * constant literals. - * * `assign` – `{?function(context, value)}` – if the expression is assignable, this will be - * set to a function to change its value on the given context. - * - */ - - - /** - * @ngdoc provider - * @name $parseProvider - * @this - * - * @description - * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse} - * service. - */ - function $ParseProvider() { - var cache = createMap(); - var literals = { - 'true': true, - 'false': false, - 'null': null, - 'undefined': undefined - }; - var identStart, identContinue; - - /** - * @ngdoc method - * @name $parseProvider#addLiteral - * @description - * - * Configure $parse service to add literal values that will be present as literal at expressions. - * - * @param {string} literalName Token for the literal value. The literal name value must be a valid literal name. - * @param {*} literalValue Value for this literal. All literal values must be primitives or `undefined`. - * - **/ - this.addLiteral = function(literalName, literalValue) { - literals[literalName] = literalValue; - }; - - /** - * @ngdoc method - * @name $parseProvider#setIdentifierFns - * - * @description - * - * Allows defining the set of characters that are allowed in AngularJS expressions. The function - * `identifierStart` will get called to know if a given character is a valid character to be the - * first character for an identifier. The function `identifierContinue` will get called to know if - * a given character is a valid character to be a follow-up identifier character. The functions - * `identifierStart` and `identifierContinue` will receive as arguments the single character to be - * identifier and the character code point. These arguments will be `string` and `numeric`. Keep in - * mind that the `string` parameter can be two characters long depending on the character - * representation. It is expected for the function to return `true` or `false`, whether that - * character is allowed or not. - * - * Since this function will be called extensively, keep the implementation of these functions fast, - * as the performance of these functions have a direct impact on the expressions parsing speed. - * - * @param {function=} identifierStart The function that will decide whether the given character is - * a valid identifier start character. - * @param {function=} identifierContinue The function that will decide whether the given character is - * a valid identifier continue character. - */ - this.setIdentifierFns = function(identifierStart, identifierContinue) { - identStart = identifierStart; - identContinue = identifierContinue; - return this; - }; - - this.$get = ['$filter', function($filter) { - var noUnsafeEval = csp().noUnsafeEval; - var $parseOptions = { - csp: noUnsafeEval, - literals: copy(literals), - isIdentifierStart: isFunction(identStart) && identStart, - isIdentifierContinue: isFunction(identContinue) && identContinue - }; - $parse.$$getAst = $$getAst; - return $parse; - - function $parse(exp, interceptorFn) { - var parsedExpression, cacheKey; - - switch (typeof exp) { - case 'string': - exp = exp.trim(); - cacheKey = exp; - - parsedExpression = cache[cacheKey]; - - if (!parsedExpression) { - var lexer = new Lexer($parseOptions); - var parser = new Parser(lexer, $filter, $parseOptions); - parsedExpression = parser.parse(exp); - if (parsedExpression.constant) { - parsedExpression.$$watchDelegate = constantWatchDelegate; - } else if (parsedExpression.oneTime) { - parsedExpression.$$watchDelegate = parsedExpression.literal ? - oneTimeLiteralWatchDelegate : oneTimeWatchDelegate; - } else if (parsedExpression.inputs) { - parsedExpression.$$watchDelegate = inputsWatchDelegate; - } - cache[cacheKey] = parsedExpression; - } - return addInterceptor(parsedExpression, interceptorFn); - - case 'function': - return addInterceptor(exp, interceptorFn); - - default: - return addInterceptor(noop, interceptorFn); - } - } - - function $$getAst(exp) { - var lexer = new Lexer($parseOptions); - var parser = new Parser(lexer, $filter, $parseOptions); - return parser.getAst(exp).ast; - } - - function expressionInputDirtyCheck(newValue, oldValueOfValue, compareObjectIdentity) { - - if (newValue == null || oldValueOfValue == null) { // null/undefined - return newValue === oldValueOfValue; - } - - if (typeof newValue === 'object') { - - // attempt to convert the value to a primitive type - // TODO(docs): add a note to docs that by implementing valueOf even objects and arrays can - // be cheaply dirty-checked - newValue = getValueOf(newValue); - - if (typeof newValue === 'object' && !compareObjectIdentity) { - // objects/arrays are not supported - deep-watching them would be too expensive - return false; - } - - // fall-through to the primitive equality check - } - - //Primitive or NaN - // eslint-disable-next-line no-self-compare - return newValue === oldValueOfValue || (newValue !== newValue && oldValueOfValue !== oldValueOfValue); - } - - function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) { - var inputExpressions = parsedExpression.inputs; - var lastResult; - - if (inputExpressions.length === 1) { - var oldInputValueOf = expressionInputDirtyCheck; // init to something unique so that equals check fails - inputExpressions = inputExpressions[0]; - return scope.$watch(function expressionInputWatch(scope) { - var newInputValue = inputExpressions(scope); - if (!expressionInputDirtyCheck(newInputValue, oldInputValueOf, inputExpressions.isPure)) { - lastResult = parsedExpression(scope, undefined, undefined, [newInputValue]); - oldInputValueOf = newInputValue && getValueOf(newInputValue); - } - return lastResult; - }, listener, objectEquality, prettyPrintExpression); - } - - var oldInputValueOfValues = []; - var oldInputValues = []; - for (var i = 0, ii = inputExpressions.length; i < ii; i++) { - oldInputValueOfValues[i] = expressionInputDirtyCheck; // init to something unique so that equals check fails - oldInputValues[i] = null; - } - - return scope.$watch(function expressionInputsWatch(scope) { - var changed = false; - - for (var i = 0, ii = inputExpressions.length; i < ii; i++) { - var newInputValue = inputExpressions[i](scope); - if (changed || (changed = !expressionInputDirtyCheck(newInputValue, oldInputValueOfValues[i], inputExpressions[i].isPure))) { - oldInputValues[i] = newInputValue; - oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue); - } - } - - if (changed) { - lastResult = parsedExpression(scope, undefined, undefined, oldInputValues); - } - - return lastResult; - }, listener, objectEquality, prettyPrintExpression); - } - - function oneTimeWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) { - var unwatch, lastValue; - if (parsedExpression.inputs) { - unwatch = inputsWatchDelegate(scope, oneTimeListener, objectEquality, parsedExpression, prettyPrintExpression); - } else { - unwatch = scope.$watch(oneTimeWatch, oneTimeListener, objectEquality); - } - return unwatch; - - function oneTimeWatch(scope) { - return parsedExpression(scope); - } - function oneTimeListener(value, old, scope) { - lastValue = value; - if (isFunction(listener)) { - listener(value, old, scope); - } - if (isDefined(value)) { - scope.$$postDigest(function() { - if (isDefined(lastValue)) { - unwatch(); - } - }); - } - } - } - - function oneTimeLiteralWatchDelegate(scope, listener, objectEquality, parsedExpression) { - var unwatch, lastValue; - unwatch = scope.$watch(function oneTimeWatch(scope) { - return parsedExpression(scope); - }, function oneTimeListener(value, old, scope) { - lastValue = value; - if (isFunction(listener)) { - listener(value, old, scope); - } - if (isAllDefined(value)) { - scope.$$postDigest(function() { - if (isAllDefined(lastValue)) unwatch(); - }); - } - }, objectEquality); - - return unwatch; - - function isAllDefined(value) { - var allDefined = true; - forEach(value, function(val) { - if (!isDefined(val)) allDefined = false; - }); - return allDefined; - } - } - - function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) { - var unwatch = scope.$watch(function constantWatch(scope) { - unwatch(); - return parsedExpression(scope); - }, listener, objectEquality); - return unwatch; - } - - function addInterceptor(parsedExpression, interceptorFn) { - if (!interceptorFn) return parsedExpression; - var watchDelegate = parsedExpression.$$watchDelegate; - var useInputs = false; - - var regularWatch = - watchDelegate !== oneTimeLiteralWatchDelegate && - watchDelegate !== oneTimeWatchDelegate; - - var fn = regularWatch ? function regularInterceptedExpression(scope, locals, assign, inputs) { - var value = useInputs && inputs ? inputs[0] : parsedExpression(scope, locals, assign, inputs); - return interceptorFn(value, scope, locals); - } : function oneTimeInterceptedExpression(scope, locals, assign, inputs) { - var value = parsedExpression(scope, locals, assign, inputs); - var result = interceptorFn(value, scope, locals); - // we only return the interceptor's result if the - // initial value is defined (for bind-once) - return isDefined(value) ? result : value; - }; - - // Propagate $$watchDelegates other then inputsWatchDelegate - useInputs = !parsedExpression.inputs; - if (watchDelegate && watchDelegate !== inputsWatchDelegate) { - fn.$$watchDelegate = watchDelegate; - fn.inputs = parsedExpression.inputs; - } else if (!interceptorFn.$stateful) { - // Treat interceptor like filters - assume non-stateful by default and use the inputsWatchDelegate - fn.$$watchDelegate = inputsWatchDelegate; - fn.inputs = parsedExpression.inputs ? parsedExpression.inputs : [parsedExpression]; - } - - if (fn.inputs) { - fn.inputs = fn.inputs.map(function(e) { - // Remove the isPure flag of inputs when it is not absolute because they are now wrapped in a - // potentially non-pure interceptor function. - if (e.isPure === PURITY_RELATIVE) { - return function depurifier(s) { return e(s); }; - } - return e; - }); - } - - return fn; - } - }]; - } - - /** - * @ngdoc service - * @name $q - * @requires $rootScope - * - * @description - * A service that helps you run functions asynchronously, and use their return values (or exceptions) - * when they are done processing. - * - * This is a [Promises/A+](https://promisesaplus.com/)-compliant implementation of promises/deferred - * objects inspired by [Kris Kowal's Q](https://github.com/kriskowal/q). - * - * $q can be used in two fashions --- one which is more similar to Kris Kowal's Q or jQuery's Deferred - * implementations, and the other which resembles ES6 (ES2015) promises to some degree. - * - * ## $q constructor - * - * The streamlined ES6 style promise is essentially just using $q as a constructor which takes a `resolver` - * function as the first argument. This is similar to the native Promise implementation from ES6, - * see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). - * - * While the constructor-style use is supported, not all of the supporting methods from ES6 promises are - * available yet. - * - * It can be used like so: - * - * ```js - * // for the purpose of this example let's assume that variables `$q` and `okToGreet` - * // are available in the current lexical scope (they could have been injected or passed in). - * - * function asyncGreet(name) { - * // perform some asynchronous operation, resolve or reject the promise when appropriate. - * return $q(function(resolve, reject) { - * setTimeout(function() { - * if (okToGreet(name)) { - * resolve('Hello, ' + name + '!'); - * } else { - * reject('Greeting ' + name + ' is not allowed.'); - * } - * }, 1000); - * }); - * } - * - * var promise = asyncGreet('Robin Hood'); - * promise.then(function(greeting) { - * alert('Success: ' + greeting); - * }, function(reason) { - * alert('Failed: ' + reason); - * }); - * ``` - * - * Note: progress/notify callbacks are not currently supported via the ES6-style interface. - * - * Note: unlike ES6 behavior, an exception thrown in the constructor function will NOT implicitly reject the promise. - * - * However, the more traditional CommonJS-style usage is still available, and documented below. - * - * [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an - * interface for interacting with an object that represents the result of an action that is - * performed asynchronously, and may or may not be finished at any given point in time. - * - * From the perspective of dealing with error handling, deferred and promise APIs are to - * asynchronous programming what `try`, `catch` and `throw` keywords are to synchronous programming. - * - * ```js - * // for the purpose of this example let's assume that variables `$q` and `okToGreet` - * // are available in the current lexical scope (they could have been injected or passed in). - * - * function asyncGreet(name) { - * var deferred = $q.defer(); - * - * setTimeout(function() { - * deferred.notify('About to greet ' + name + '.'); - * - * if (okToGreet(name)) { - * deferred.resolve('Hello, ' + name + '!'); - * } else { - * deferred.reject('Greeting ' + name + ' is not allowed.'); - * } - * }, 1000); - * - * return deferred.promise; - * } - * - * var promise = asyncGreet('Robin Hood'); - * promise.then(function(greeting) { - * alert('Success: ' + greeting); - * }, function(reason) { - * alert('Failed: ' + reason); - * }, function(update) { - * alert('Got notification: ' + update); - * }); - * ``` - * - * At first it might not be obvious why this extra complexity is worth the trouble. The payoff - * comes in the way of guarantees that promise and deferred APIs make, see - * https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md. - * - * Additionally the promise api allows for composition that is very hard to do with the - * traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach. - * For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the - * section on serial or parallel joining of promises. - * - * ## The Deferred API - * - * A new instance of deferred is constructed by calling `$q.defer()`. - * - * The purpose of the deferred object is to expose the associated Promise instance as well as APIs - * that can be used for signaling the successful or unsuccessful completion, as well as the status - * of the task. - * - * **Methods** - * - * - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection - * constructed via `$q.reject`, the promise will be rejected instead. - * - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to - * resolving it with a rejection constructed via `$q.reject`. - * - `notify(value)` - provides updates on the status of the promise's execution. This may be called - * multiple times before the promise is either resolved or rejected. - * - * **Properties** - * - * - promise – `{Promise}` – promise object associated with this deferred. - * - * - * ## The Promise API - * - * A new promise instance is created when a deferred instance is created and can be retrieved by - * calling `deferred.promise`. - * - * The purpose of the promise object is to allow for interested parties to get access to the result - * of the deferred task when it completes. - * - * **Methods** - * - * - `then(successCallback, [errorCallback], [notifyCallback])` – regardless of when the promise was or - * will be resolved or rejected, `then` calls one of the success or error callbacks asynchronously - * as soon as the result is available. The callbacks are called with a single argument: the result - * or rejection reason. Additionally, the notify callback may be called zero or more times to - * provide a progress indication, before the promise is resolved or rejected. - * - * This method *returns a new promise* which is resolved or rejected via the return value of the - * `successCallback`, `errorCallback` (unless that value is a promise, in which case it is resolved - * with the value which is resolved in that promise using - * [promise chaining](http://www.html5rocks.com/en/tutorials/es6/promises/#toc-promises-queues)). - * It also notifies via the return value of the `notifyCallback` method. The promise cannot be - * resolved or rejected from the notifyCallback method. The errorCallback and notifyCallback - * arguments are optional. - * - * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)` - * - * - `finally(callback, notifyCallback)` – allows you to observe either the fulfillment or rejection of a promise, - * but to do so without modifying the final value. This is useful to release resources or do some - * clean-up that needs to be done whether the promise was rejected or resolved. See the [full - * specification](https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback) for - * more information. - * - * ## Chaining promises - * - * Because calling the `then` method of a promise returns a new derived promise, it is easily - * possible to create a chain of promises: - * - * ```js - * promiseB = promiseA.then(function(result) { - * return result + 1; - * }); - * - * // promiseB will be resolved immediately after promiseA is resolved and its value - * // will be the result of promiseA incremented by 1 - * ``` - * - * It is possible to create chains of any length and since a promise can be resolved with another - * promise (which will defer its resolution further), it is possible to pause/defer resolution of - * the promises at any point in the chain. This makes it possible to implement powerful APIs like - * $http's response interceptors. - * - * - * ## Differences between Kris Kowal's Q and $q - * - * There are two main differences: - * - * - $q is integrated with the {@link ng.$rootScope.Scope} Scope model observation - * mechanism in AngularJS, which means faster propagation of resolution or rejection into your - * models and avoiding unnecessary browser repaints, which would result in flickering UI. - * - Q has many more features than $q, but that comes at a cost of bytes. $q is tiny, but contains - * all the important functionality needed for common async tasks. - * - * ## Testing - * - * ```js - * it('should simulate promise', inject(function($q, $rootScope) { - * var deferred = $q.defer(); - * var promise = deferred.promise; - * var resolvedValue; - * - * promise.then(function(value) { resolvedValue = value; }); - * expect(resolvedValue).toBeUndefined(); - * - * // Simulate resolving of promise - * deferred.resolve(123); - * // Note that the 'then' function does not get called synchronously. - * // This is because we want the promise API to always be async, whether or not - * // it got called synchronously or asynchronously. - * expect(resolvedValue).toBeUndefined(); - * - * // Propagate promise resolution to 'then' functions using $apply(). - * $rootScope.$apply(); - * expect(resolvedValue).toEqual(123); - * })); - * ``` - * - * @param {function(function, function)} resolver Function which is responsible for resolving or - * rejecting the newly created promise. The first parameter is a function which resolves the - * promise, the second parameter is a function which rejects the promise. - * - * @returns {Promise} The newly created promise. - */ - /** - * @ngdoc provider - * @name $qProvider - * @this - * - * @description - */ - function $QProvider() { - var errorOnUnhandledRejections = true; - this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) { - return qFactory(function(callback) { - $rootScope.$evalAsync(callback); - }, $exceptionHandler, errorOnUnhandledRejections); - }]; - - /** - * @ngdoc method - * @name $qProvider#errorOnUnhandledRejections - * @kind function - * - * @description - * Retrieves or overrides whether to generate an error when a rejected promise is not handled. - * This feature is enabled by default. - * - * @param {boolean=} value Whether to generate an error when a rejected promise is not handled. - * @returns {boolean|ng.$qProvider} Current value when called without a new value or self for - * chaining otherwise. - */ - this.errorOnUnhandledRejections = function(value) { - if (isDefined(value)) { - errorOnUnhandledRejections = value; - return this; - } else { - return errorOnUnhandledRejections; - } - }; - } - - /** @this */ - function $$QProvider() { - var errorOnUnhandledRejections = true; - this.$get = ['$browser', '$exceptionHandler', function($browser, $exceptionHandler) { - return qFactory(function(callback) { - $browser.defer(callback); - }, $exceptionHandler, errorOnUnhandledRejections); - }]; - - this.errorOnUnhandledRejections = function(value) { - if (isDefined(value)) { - errorOnUnhandledRejections = value; - return this; - } else { - return errorOnUnhandledRejections; - } - }; - } - - /** - * Constructs a promise manager. - * - * @param {function(function)} nextTick Function for executing functions in the next turn. - * @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for - * debugging purposes. - * @param {boolean=} errorOnUnhandledRejections Whether an error should be generated on unhandled - * promises rejections. - * @returns {object} Promise manager. - */ - function qFactory(nextTick, exceptionHandler, errorOnUnhandledRejections) { - var $qMinErr = minErr('$q', TypeError); - var queueSize = 0; - var checkQueue = []; - - /** - * @ngdoc method - * @name ng.$q#defer - * @kind function - * - * @description - * Creates a `Deferred` object which represents a task which will finish in the future. - * - * @returns {Deferred} Returns a new instance of deferred. - */ - function defer() { - return new Deferred(); - } - - function Deferred() { - var promise = this.promise = new Promise(); - //Non prototype methods necessary to support unbound execution :/ - this.resolve = function(val) { resolvePromise(promise, val); }; - this.reject = function(reason) { rejectPromise(promise, reason); }; - this.notify = function(progress) { notifyPromise(promise, progress); }; - } - - - function Promise() { - this.$$state = { status: 0 }; - } - - extend(Promise.prototype, { - then: function(onFulfilled, onRejected, progressBack) { - if (isUndefined(onFulfilled) && isUndefined(onRejected) && isUndefined(progressBack)) { - return this; - } - var result = new Promise(); - - this.$$state.pending = this.$$state.pending || []; - this.$$state.pending.push([result, onFulfilled, onRejected, progressBack]); - if (this.$$state.status > 0) scheduleProcessQueue(this.$$state); - - return result; - }, - - 'catch': function(callback) { - return this.then(null, callback); - }, - - 'finally': function(callback, progressBack) { - return this.then(function(value) { - return handleCallback(value, resolve, callback); - }, function(error) { - return handleCallback(error, reject, callback); - }, progressBack); - } - }); - - function processQueue(state) { - var fn, promise, pending; - - pending = state.pending; - state.processScheduled = false; - state.pending = undefined; - try { - for (var i = 0, ii = pending.length; i < ii; ++i) { - markQStateExceptionHandled(state); - promise = pending[i][0]; - fn = pending[i][state.status]; - try { - if (isFunction(fn)) { - resolvePromise(promise, fn(state.value)); - } else if (state.status === 1) { - resolvePromise(promise, state.value); - } else { - rejectPromise(promise, state.value); - } - } catch (e) { - rejectPromise(promise, e); - // This error is explicitly marked for being passed to the $exceptionHandler - if (e && e.$$passToExceptionHandler === true) { - exceptionHandler(e); - } - } - } - } finally { - --queueSize; - if (errorOnUnhandledRejections && queueSize === 0) { - nextTick(processChecks); - } - } - } - - function processChecks() { - // eslint-disable-next-line no-unmodified-loop-condition - while (!queueSize && checkQueue.length) { - var toCheck = checkQueue.shift(); - if (!isStateExceptionHandled(toCheck)) { - markQStateExceptionHandled(toCheck); - var errorMessage = 'Possibly unhandled rejection: ' + toDebugString(toCheck.value); - if (isError(toCheck.value)) { - exceptionHandler(toCheck.value, errorMessage); - } else { - exceptionHandler(errorMessage); - } - } - } - } - - function scheduleProcessQueue(state) { - if (errorOnUnhandledRejections && !state.pending && state.status === 2 && !isStateExceptionHandled(state)) { - if (queueSize === 0 && checkQueue.length === 0) { - nextTick(processChecks); - } - checkQueue.push(state); - } - if (state.processScheduled || !state.pending) return; - state.processScheduled = true; - ++queueSize; - nextTick(function() { processQueue(state); }); - } - - function resolvePromise(promise, val) { - if (promise.$$state.status) return; - if (val === promise) { - $$reject(promise, $qMinErr( - 'qcycle', - 'Expected promise to be resolved with value other than itself \'{0}\'', - val)); - } else { - $$resolve(promise, val); - } - - } - - function $$resolve(promise, val) { - var then; - var done = false; - try { - if (isObject(val) || isFunction(val)) then = val.then; - if (isFunction(then)) { - promise.$$state.status = -1; - then.call(val, doResolve, doReject, doNotify); - } else { - promise.$$state.value = val; - promise.$$state.status = 1; - scheduleProcessQueue(promise.$$state); - } - } catch (e) { - doReject(e); - } - - function doResolve(val) { - if (done) return; - done = true; - $$resolve(promise, val); - } - function doReject(val) { - if (done) return; - done = true; - $$reject(promise, val); - } - function doNotify(progress) { - notifyPromise(promise, progress); - } - } - - function rejectPromise(promise, reason) { - if (promise.$$state.status) return; - $$reject(promise, reason); - } - - function $$reject(promise, reason) { - promise.$$state.value = reason; - promise.$$state.status = 2; - scheduleProcessQueue(promise.$$state); - } - - function notifyPromise(promise, progress) { - var callbacks = promise.$$state.pending; - - if ((promise.$$state.status <= 0) && callbacks && callbacks.length) { - nextTick(function() { - var callback, result; - for (var i = 0, ii = callbacks.length; i < ii; i++) { - result = callbacks[i][0]; - callback = callbacks[i][3]; - try { - notifyPromise(result, isFunction(callback) ? callback(progress) : progress); - } catch (e) { - exceptionHandler(e); - } - } - }); - } - } - - /** - * @ngdoc method - * @name $q#reject - * @kind function - * - * @description - * Creates a promise that is resolved as rejected with the specified `reason`. This api should be - * used to forward rejection in a chain of promises. If you are dealing with the last promise in - * a promise chain, you don't need to worry about it. - * - * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of - * `reject` as the `throw` keyword in JavaScript. This also means that if you "catch" an error via - * a promise error callback and you want to forward the error to the promise derived from the - * current promise, you have to "rethrow" the error by returning a rejection constructed via - * `reject`. - * - * ```js - * promiseB = promiseA.then(function(result) { - * // success: do something and resolve promiseB - * // with the old or a new result - * return result; - * }, function(reason) { - * // error: handle the error if possible and - * // resolve promiseB with newPromiseOrValue, - * // otherwise forward the rejection to promiseB - * if (canHandle(reason)) { - * // handle the error and recover - * return newPromiseOrValue; - * } - * return $q.reject(reason); - * }); - * ``` - * - * @param {*} reason Constant, message, exception or an object representing the rejection reason. - * @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`. - */ - function reject(reason) { - var result = new Promise(); - rejectPromise(result, reason); - return result; - } - - function handleCallback(value, resolver, callback) { - var callbackOutput = null; - try { - if (isFunction(callback)) callbackOutput = callback(); - } catch (e) { - return reject(e); - } - if (isPromiseLike(callbackOutput)) { - return callbackOutput.then(function() { - return resolver(value); - }, reject); - } else { - return resolver(value); - } - } - - /** - * @ngdoc method - * @name $q#when - * @kind function - * - * @description - * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. - * This is useful when you are dealing with an object that might or might not be a promise, or if - * the promise comes from a source that can't be trusted. - * - * @param {*} value Value or a promise - * @param {Function=} successCallback - * @param {Function=} errorCallback - * @param {Function=} progressCallback - * @returns {Promise} Returns a promise of the passed value or promise - */ - - - function when(value, callback, errback, progressBack) { - var result = new Promise(); - resolvePromise(result, value); - return result.then(callback, errback, progressBack); - } - - /** - * @ngdoc method - * @name $q#resolve - * @kind function - * - * @description - * Alias of {@link ng.$q#when when} to maintain naming consistency with ES6. - * - * @param {*} value Value or a promise - * @param {Function=} successCallback - * @param {Function=} errorCallback - * @param {Function=} progressCallback - * @returns {Promise} Returns a promise of the passed value or promise - */ - var resolve = when; - - /** - * @ngdoc method - * @name $q#all - * @kind function - * - * @description - * Combines multiple promises into a single promise that is resolved when all of the input - * promises are resolved. - * - * @param {Array.|Object.} promises An array or hash of promises. - * @returns {Promise} Returns a single promise that will be resolved with an array/hash of values, - * each value corresponding to the promise at the same index/key in the `promises` array/hash. - * If any of the promises is resolved with a rejection, this resulting promise will be rejected - * with the same rejection value. - */ - - function all(promises) { - var result = new Promise(), - counter = 0, - results = isArray(promises) ? [] : {}; - - forEach(promises, function(promise, key) { - counter++; - when(promise).then(function(value) { - results[key] = value; - if (!(--counter)) resolvePromise(result, results); - }, function(reason) { - rejectPromise(result, reason); - }); - }); - - if (counter === 0) { - resolvePromise(result, results); - } - - return result; - } - - /** - * @ngdoc method - * @name $q#race - * @kind function - * - * @description - * Returns a promise that resolves or rejects as soon as one of those promises - * resolves or rejects, with the value or reason from that promise. - * - * @param {Array.|Object.} promises An array or hash of promises. - * @returns {Promise} a promise that resolves or rejects as soon as one of the `promises` - * resolves or rejects, with the value or reason from that promise. - */ - - function race(promises) { - var deferred = defer(); - - forEach(promises, function(promise) { - when(promise).then(deferred.resolve, deferred.reject); - }); - - return deferred.promise; - } - - function $Q(resolver) { - if (!isFunction(resolver)) { - throw $qMinErr('norslvr', 'Expected resolverFn, got \'{0}\'', resolver); - } - - var promise = new Promise(); - - function resolveFn(value) { - resolvePromise(promise, value); - } - - function rejectFn(reason) { - rejectPromise(promise, reason); - } - - resolver(resolveFn, rejectFn); - - return promise; - } - - // Let's make the instanceof operator work for promises, so that - // `new $q(fn) instanceof $q` would evaluate to true. - $Q.prototype = Promise.prototype; - - $Q.defer = defer; - $Q.reject = reject; - $Q.when = when; - $Q.resolve = resolve; - $Q.all = all; - $Q.race = race; - - return $Q; - } - - function isStateExceptionHandled(state) { - return !!state.pur; - } - function markQStateExceptionHandled(state) { - state.pur = true; - } - function markQExceptionHandled(q) { - markQStateExceptionHandled(q.$$state); - } - - /** @this */ - function $$RAFProvider() { //rAF - this.$get = ['$window', '$timeout', function($window, $timeout) { - var requestAnimationFrame = $window.requestAnimationFrame || - $window.webkitRequestAnimationFrame; - - var cancelAnimationFrame = $window.cancelAnimationFrame || - $window.webkitCancelAnimationFrame || - $window.webkitCancelRequestAnimationFrame; - - var rafSupported = !!requestAnimationFrame; - var raf = rafSupported - ? function(fn) { - var id = requestAnimationFrame(fn); - return function() { - cancelAnimationFrame(id); - }; - } - : function(fn) { - var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666 - return function() { - $timeout.cancel(timer); - }; - }; - - raf.supported = rafSupported; - - return raf; - }]; - } - - /** - * DESIGN NOTES - * - * The design decisions behind the scope are heavily favored for speed and memory consumption. - * - * The typical use of scope is to watch the expressions, which most of the time return the same - * value as last time so we optimize the operation. - * - * Closures construction is expensive in terms of speed as well as memory: - * - No closures, instead use prototypical inheritance for API - * - Internal state needs to be stored on scope directly, which means that private state is - * exposed as $$____ properties - * - * Loop operations are optimized by using while(count--) { ... } - * - This means that in order to keep the same order of execution as addition we have to add - * items to the array at the beginning (unshift) instead of at the end (push) - * - * Child scopes are created and removed often - * - Using an array would be slow since inserts in the middle are expensive; so we use linked lists - * - * There are fewer watches than observers. This is why you don't want the observer to be implemented - * in the same way as watch. Watch requires return of the initialization function which is expensive - * to construct. - */ - - - /** - * @ngdoc provider - * @name $rootScopeProvider - * @description - * - * Provider for the $rootScope service. - */ - - /** - * @ngdoc method - * @name $rootScopeProvider#digestTtl - * @description - * - * Sets the number of `$digest` iterations the scope should attempt to execute before giving up and - * assuming that the model is unstable. - * - * The current default is 10 iterations. - * - * In complex applications it's possible that the dependencies between `$watch`s will result in - * several digest iterations. However if an application needs more than the default 10 digest - * iterations for its model to stabilize then you should investigate what is causing the model to - * continuously change during the digest. - * - * Increasing the TTL could have performance implications, so you should not change it without - * proper justification. - * - * @param {number} limit The number of digest iterations. - */ - - - /** - * @ngdoc service - * @name $rootScope - * @this - * - * @description - * - * Every application has a single root {@link ng.$rootScope.Scope scope}. - * All other scopes are descendant scopes of the root scope. Scopes provide separation - * between the model and the view, via a mechanism for watching the model for changes. - * They also provide event emission/broadcast and subscription facility. See the - * {@link guide/scope developer guide on scopes}. - */ - function $RootScopeProvider() { - var TTL = 10; - var $rootScopeMinErr = minErr('$rootScope'); - var lastDirtyWatch = null; - var applyAsyncId = null; - - this.digestTtl = function(value) { - if (arguments.length) { - TTL = value; - } - return TTL; - }; - - function createChildScopeClass(parent) { - function ChildScope() { - this.$$watchers = this.$$nextSibling = - this.$$childHead = this.$$childTail = null; - this.$$listeners = {}; - this.$$listenerCount = {}; - this.$$watchersCount = 0; - this.$id = nextUid(); - this.$$ChildScope = null; - } - ChildScope.prototype = parent; - return ChildScope; - } - - this.$get = ['$exceptionHandler', '$parse', '$browser', - function($exceptionHandler, $parse, $browser) { - - function destroyChildScope($event) { - $event.currentScope.$$destroyed = true; - } - - function cleanUpScope($scope) { - - // Support: IE 9 only - if (msie === 9) { - // There is a memory leak in IE9 if all child scopes are not disconnected - // completely when a scope is destroyed. So this code will recurse up through - // all this scopes children - // - // See issue https://github.com/angular/angular.js/issues/10706 - if ($scope.$$childHead) { - cleanUpScope($scope.$$childHead); - } - if ($scope.$$nextSibling) { - cleanUpScope($scope.$$nextSibling); - } - } - - // The code below works around IE9 and V8's memory leaks - // - // See: - // - https://code.google.com/p/v8/issues/detail?id=2073#c26 - // - https://github.com/angular/angular.js/issues/6794#issuecomment-38648909 - // - https://github.com/angular/angular.js/issues/1313#issuecomment-10378451 - - $scope.$parent = $scope.$$nextSibling = $scope.$$prevSibling = $scope.$$childHead = - $scope.$$childTail = $scope.$root = $scope.$$watchers = null; - } - - /** - * @ngdoc type - * @name $rootScope.Scope - * - * @description - * A root scope can be retrieved using the {@link ng.$rootScope $rootScope} key from the - * {@link auto.$injector $injector}. Child scopes are created using the - * {@link ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when - * compiled HTML template is executed.) See also the {@link guide/scope Scopes guide} for - * an in-depth introduction and usage examples. - * - * - * ## Inheritance - * A scope can inherit from a parent scope, as in this example: - * ```js - var parent = $rootScope; - var child = parent.$new(); - - parent.salutation = "Hello"; - expect(child.salutation).toEqual('Hello'); - - child.salutation = "Welcome"; - expect(child.salutation).toEqual('Welcome'); - expect(parent.salutation).toEqual('Hello'); - * ``` - * - * When interacting with `Scope` in tests, additional helper methods are available on the - * instances of `Scope` type. See {@link ngMock.$rootScope.Scope ngMock Scope} for additional - * details. - * - * - * @param {Object.=} providers Map of service factory which need to be - * provided for the current scope. Defaults to {@link ng}. - * @param {Object.=} instanceCache Provides pre-instantiated services which should - * append/override services provided by `providers`. This is handy - * when unit-testing and having the need to override a default - * service. - * @returns {Object} Newly created scope. - * - */ - function Scope() { - this.$id = nextUid(); - this.$$phase = this.$parent = this.$$watchers = - this.$$nextSibling = this.$$prevSibling = - this.$$childHead = this.$$childTail = null; - this.$root = this; - this.$$destroyed = false; - this.$$listeners = {}; - this.$$listenerCount = {}; - this.$$watchersCount = 0; - this.$$isolateBindings = null; - } - - /** - * @ngdoc property - * @name $rootScope.Scope#$id - * - * @description - * Unique scope ID (monotonically increasing) useful for debugging. - */ - - /** - * @ngdoc property - * @name $rootScope.Scope#$parent - * - * @description - * Reference to the parent scope. - */ - - /** - * @ngdoc property - * @name $rootScope.Scope#$root - * - * @description - * Reference to the root scope. - */ - - Scope.prototype = { - constructor: Scope, - /** - * @ngdoc method - * @name $rootScope.Scope#$new - * @kind function - * - * @description - * Creates a new child {@link ng.$rootScope.Scope scope}. - * - * The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} event. - * The scope can be removed from the scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}. - * - * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is - * desired for the scope and its child scopes to be permanently detached from the parent and - * thus stop participating in model change detection and listener notification by invoking. - * - * @param {boolean} isolate If true, then the scope does not prototypically inherit from the - * parent scope. The scope is isolated, as it can not see parent scope properties. - * When creating widgets, it is useful for the widget to not accidentally read parent - * state. - * - * @param {Scope} [parent=this] The {@link ng.$rootScope.Scope `Scope`} that will be the `$parent` - * of the newly created scope. Defaults to `this` scope if not provided. - * This is used when creating a transclude scope to correctly place it - * in the scope hierarchy while maintaining the correct prototypical - * inheritance. - * - * @returns {Object} The newly created child scope. - * - */ - $new: function(isolate, parent) { - var child; - - parent = parent || this; - - if (isolate) { - child = new Scope(); - child.$root = this.$root; - } else { - // Only create a child scope class if somebody asks for one, - // but cache it to allow the VM to optimize lookups. - if (!this.$$ChildScope) { - this.$$ChildScope = createChildScopeClass(this); - } - child = new this.$$ChildScope(); - } - child.$parent = parent; - child.$$prevSibling = parent.$$childTail; - if (parent.$$childHead) { - parent.$$childTail.$$nextSibling = child; - parent.$$childTail = child; - } else { - parent.$$childHead = parent.$$childTail = child; - } - - // When the new scope is not isolated or we inherit from `this`, and - // the parent scope is destroyed, the property `$$destroyed` is inherited - // prototypically. In all other cases, this property needs to be set - // when the parent scope is destroyed. - // The listener needs to be added after the parent is set - if (isolate || parent !== this) child.$on('$destroy', destroyChildScope); - - return child; - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$watch - * @kind function - * - * @description - * Registers a `listener` callback to be executed whenever the `watchExpression` changes. - * - * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest - * $digest()} and should return the value that will be watched. (`watchExpression` should not change - * its value when executed multiple times with the same input because it may be executed multiple - * times by {@link ng.$rootScope.Scope#$digest $digest()}. That is, `watchExpression` should be - * [idempotent](http://en.wikipedia.org/wiki/Idempotence).) - * - The `listener` is called only when the value from the current `watchExpression` and the - * previous call to `watchExpression` are not equal (with the exception of the initial run, - * see below). Inequality is determined according to reference inequality, - * [strict comparison](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators) - * via the `!==` Javascript operator, unless `objectEquality == true` - * (see next point) - * - When `objectEquality == true`, inequality of the `watchExpression` is determined - * according to the {@link angular.equals} function. To save the value of the object for - * later comparison, the {@link angular.copy} function is used. This therefore means that - * watching complex objects will have adverse memory and performance implications. - * - This should not be used to watch for changes in objects that are - * or contain [File](https://developer.mozilla.org/docs/Web/API/File) objects due to limitations with {@link angular.copy `angular.copy`}. - * - The watch `listener` may change the model, which may trigger other `listener`s to fire. - * This is achieved by rerunning the watchers until no changes are detected. The rerun - * iteration limit is 10 to prevent an infinite loop deadlock. - * - * - * If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called, - * you can register a `watchExpression` function with no `listener`. (Be prepared for - * multiple calls to your `watchExpression` because it will execute multiple times in a - * single {@link ng.$rootScope.Scope#$digest $digest} cycle if a change is detected.) - * - * After a watcher is registered with the scope, the `listener` fn is called asynchronously - * (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the - * watcher. In rare cases, this is undesirable because the listener is called when the result - * of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you - * can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the - * listener was called due to initialization. - * - * - * - * @example - * ```js - // let's assume that scope was dependency injected as the $rootScope - var scope = $rootScope; - scope.name = 'misko'; - scope.counter = 0; - - expect(scope.counter).toEqual(0); - scope.$watch('name', function(newValue, oldValue) { - scope.counter = scope.counter + 1; - }); - expect(scope.counter).toEqual(0); - - scope.$digest(); - // the listener is always called during the first $digest loop after it was registered - expect(scope.counter).toEqual(1); - - scope.$digest(); - // but now it will not be called unless the value changes - expect(scope.counter).toEqual(1); - - scope.name = 'adam'; - scope.$digest(); - expect(scope.counter).toEqual(2); - - - - // Using a function as a watchExpression - var food; - scope.foodCounter = 0; - expect(scope.foodCounter).toEqual(0); - scope.$watch( - // This function returns the value being watched. It is called for each turn of the $digest loop - function() { return food; }, - // This is the change listener, called when the value returned from the above function changes - function(newValue, oldValue) { - if ( newValue !== oldValue ) { - // Only increment the counter if the value changed - scope.foodCounter = scope.foodCounter + 1; - } - } - ); - // No digest has been run so the counter will be zero - expect(scope.foodCounter).toEqual(0); - - // Run the digest but since food has not changed count will still be zero - scope.$digest(); - expect(scope.foodCounter).toEqual(0); - - // Update food and run digest. Now the counter will increment - food = 'cheeseburger'; - scope.$digest(); - expect(scope.foodCounter).toEqual(1); - - * ``` - * - * - * - * @param {(function()|string)} watchExpression Expression that is evaluated on each - * {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers - * a call to the `listener`. - * - * - `string`: Evaluated as {@link guide/expression expression} - * - `function(scope)`: called with current `scope` as a parameter. - * @param {function(newVal, oldVal, scope)} listener Callback called whenever the value - * of `watchExpression` changes. - * - * - `newVal` contains the current value of the `watchExpression` - * - `oldVal` contains the previous value of the `watchExpression` - * - `scope` refers to the current scope - * @param {boolean=} [objectEquality=false] Compare for object equality using {@link angular.equals} instead of - * comparing for reference equality. - * @returns {function()} Returns a deregistration function for this listener. - */ - $watch: function(watchExp, listener, objectEquality, prettyPrintExpression) { - var get = $parse(watchExp); - var fn = isFunction(listener) ? listener : noop; - - if (get.$$watchDelegate) { - return get.$$watchDelegate(this, fn, objectEquality, get, watchExp); - } - var scope = this, - array = scope.$$watchers, - watcher = { - fn: fn, - last: initWatchVal, - get: get, - exp: prettyPrintExpression || watchExp, - eq: !!objectEquality - }; - - lastDirtyWatch = null; - - if (!array) { - array = scope.$$watchers = []; - array.$$digestWatchIndex = -1; - } - // we use unshift since we use a while loop in $digest for speed. - // the while loop reads in reverse order. - array.unshift(watcher); - array.$$digestWatchIndex++; - incrementWatchersCount(this, 1); - - return function deregisterWatch() { - var index = arrayRemove(array, watcher); - if (index >= 0) { - incrementWatchersCount(scope, -1); - if (index < array.$$digestWatchIndex) { - array.$$digestWatchIndex--; - } - } - lastDirtyWatch = null; - }; - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$watchGroup - * @kind function - * - * @description - * A variant of {@link ng.$rootScope.Scope#$watch $watch()} where it watches an array of `watchExpressions`. - * If any one expression in the collection changes the `listener` is executed. - * - * - The items in the `watchExpressions` array are observed via the standard `$watch` operation. Their return - * values are examined for changes on every call to `$digest`. - * - The `listener` is called whenever any expression in the `watchExpressions` array changes. - * - * `$watchGroup` is more performant than watching each expression individually, and should be - * used when the listener does not need to know which expression has changed. - * If the listener needs to know which expression has changed, - * {@link ng.$rootScope.Scope#$watch $watch()} or - * {@link ng.$rootScope.Scope#$watchCollection $watchCollection()} should be used. - * - * @param {Array.} watchExpressions Array of expressions that will be individually - * watched using {@link ng.$rootScope.Scope#$watch $watch()} - * - * @param {function(newValues, oldValues, scope)} listener Callback called whenever the return value of any - * expression in `watchExpressions` changes - * The `newValues` array contains the current values of the `watchExpressions`, with the indexes matching - * those of `watchExpression` - * and the `oldValues` array contains the previous values of the `watchExpressions`, with the indexes matching - * those of `watchExpression`. - * - * Note that `newValues` and `oldValues` reflect the differences in each **individual** - * expression, and not the difference of the values between each call of the listener. - * That means the difference between `newValues` and `oldValues` cannot be used to determine - * which expression has changed / remained stable: - * - * ```js - * - * $scope.$watchGroup(['v1', 'v2'], function(newValues, oldValues) { - * console.log(newValues, oldValues); - * }); - * - * // newValues, oldValues initially - * // [undefined, undefined], [undefined, undefined] - * - * $scope.v1 = 'a'; - * $scope.v2 = 'a'; - * - * // ['a', 'a'], [undefined, undefined] - * - * $scope.v2 = 'b' - * - * // v1 hasn't changed since it became `'a'`, therefore its oldValue is still `undefined` - * // ['a', 'b'], [undefined, 'a'] - * - * ``` - * - * The `scope` refers to the current scope. - * @returns {function()} Returns a de-registration function for all listeners. - */ - $watchGroup: function(watchExpressions, listener) { - var oldValues = new Array(watchExpressions.length); - var newValues = new Array(watchExpressions.length); - var deregisterFns = []; - var self = this; - var changeReactionScheduled = false; - var firstRun = true; - - if (!watchExpressions.length) { - // No expressions means we call the listener ASAP - var shouldCall = true; - self.$evalAsync(function() { - if (shouldCall) listener(newValues, newValues, self); - }); - return function deregisterWatchGroup() { - shouldCall = false; - }; - } - - if (watchExpressions.length === 1) { - // Special case size of one - return this.$watch(watchExpressions[0], function watchGroupAction(value, oldValue, scope) { - newValues[0] = value; - oldValues[0] = oldValue; - listener(newValues, (value === oldValue) ? newValues : oldValues, scope); - }); - } - - forEach(watchExpressions, function(expr, i) { - var unwatchFn = self.$watch(expr, function watchGroupSubAction(value, oldValue) { - newValues[i] = value; - oldValues[i] = oldValue; - if (!changeReactionScheduled) { - changeReactionScheduled = true; - self.$evalAsync(watchGroupAction); - } - }); - deregisterFns.push(unwatchFn); - }); - - function watchGroupAction() { - changeReactionScheduled = false; - - if (firstRun) { - firstRun = false; - listener(newValues, newValues, self); - } else { - listener(newValues, oldValues, self); - } - } - - return function deregisterWatchGroup() { - while (deregisterFns.length) { - deregisterFns.shift()(); - } - }; - }, - - - /** - * @ngdoc method - * @name $rootScope.Scope#$watchCollection - * @kind function - * - * @description - * Shallow watches the properties of an object and fires whenever any of the properties change - * (for arrays, this implies watching the array items; for object maps, this implies watching - * the properties). If a change is detected, the `listener` callback is fired. - * - * - The `obj` collection is observed via standard $watch operation and is examined on every - * call to $digest() to see if any items have been added, removed, or moved. - * - The `listener` is called whenever anything within the `obj` has changed. Examples include - * adding, removing, and moving items belonging to an object or array. - * - * - * @example - * ```js - $scope.names = ['igor', 'matias', 'misko', 'james']; - $scope.dataCount = 4; - - $scope.$watchCollection('names', function(newNames, oldNames) { - $scope.dataCount = newNames.length; - }); - - expect($scope.dataCount).toEqual(4); - $scope.$digest(); - - //still at 4 ... no changes - expect($scope.dataCount).toEqual(4); - - $scope.names.pop(); - $scope.$digest(); - - //now there's been a change - expect($scope.dataCount).toEqual(3); - * ``` - * - * - * @param {string|function(scope)} obj Evaluated as {@link guide/expression expression}. The - * expression value should evaluate to an object or an array which is observed on each - * {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the - * collection will trigger a call to the `listener`. - * - * @param {function(newCollection, oldCollection, scope)} listener a callback function called - * when a change is detected. - * - The `newCollection` object is the newly modified data obtained from the `obj` expression - * - The `oldCollection` object is a copy of the former collection data. - * Due to performance considerations, the`oldCollection` value is computed only if the - * `listener` function declares two or more arguments. - * - The `scope` argument refers to the current scope. - * - * @returns {function()} Returns a de-registration function for this listener. When the - * de-registration function is executed, the internal watch operation is terminated. - */ - $watchCollection: function(obj, listener) { - $watchCollectionInterceptor.$stateful = true; - - var self = this; - // the current value, updated on each dirty-check run - var newValue; - // a shallow copy of the newValue from the last dirty-check run, - // updated to match newValue during dirty-check run - var oldValue; - // a shallow copy of the newValue from when the last change happened - var veryOldValue; - // only track veryOldValue if the listener is asking for it - var trackVeryOldValue = (listener.length > 1); - var changeDetected = 0; - var changeDetector = $parse(obj, $watchCollectionInterceptor); - var internalArray = []; - var internalObject = {}; - var initRun = true; - var oldLength = 0; - - function $watchCollectionInterceptor(_value) { - newValue = _value; - var newLength, key, bothNaN, newItem, oldItem; - - // If the new value is undefined, then return undefined as the watch may be a one-time watch - if (isUndefined(newValue)) return; - - if (!isObject(newValue)) { // if primitive - if (oldValue !== newValue) { - oldValue = newValue; - changeDetected++; - } - } else if (isArrayLike(newValue)) { - if (oldValue !== internalArray) { - // we are transitioning from something which was not an array into array. - oldValue = internalArray; - oldLength = oldValue.length = 0; - changeDetected++; - } - - newLength = newValue.length; - - if (oldLength !== newLength) { - // if lengths do not match we need to trigger change notification - changeDetected++; - oldValue.length = oldLength = newLength; - } - // copy the items to oldValue and look for changes. - for (var i = 0; i < newLength; i++) { - oldItem = oldValue[i]; - newItem = newValue[i]; - - // eslint-disable-next-line no-self-compare - bothNaN = (oldItem !== oldItem) && (newItem !== newItem); - if (!bothNaN && (oldItem !== newItem)) { - changeDetected++; - oldValue[i] = newItem; - } - } - } else { - if (oldValue !== internalObject) { - // we are transitioning from something which was not an object into object. - oldValue = internalObject = {}; - oldLength = 0; - changeDetected++; - } - // copy the items to oldValue and look for changes. - newLength = 0; - for (key in newValue) { - if (hasOwnProperty.call(newValue, key)) { - newLength++; - newItem = newValue[key]; - oldItem = oldValue[key]; - - if (key in oldValue) { - // eslint-disable-next-line no-self-compare - bothNaN = (oldItem !== oldItem) && (newItem !== newItem); - if (!bothNaN && (oldItem !== newItem)) { - changeDetected++; - oldValue[key] = newItem; - } - } else { - oldLength++; - oldValue[key] = newItem; - changeDetected++; - } - } - } - if (oldLength > newLength) { - // we used to have more keys, need to find them and destroy them. - changeDetected++; - for (key in oldValue) { - if (!hasOwnProperty.call(newValue, key)) { - oldLength--; - delete oldValue[key]; - } - } - } - } - return changeDetected; - } - - function $watchCollectionAction() { - if (initRun) { - initRun = false; - listener(newValue, newValue, self); - } else { - listener(newValue, veryOldValue, self); - } - - // make a copy for the next time a collection is changed - if (trackVeryOldValue) { - if (!isObject(newValue)) { - //primitive - veryOldValue = newValue; - } else if (isArrayLike(newValue)) { - veryOldValue = new Array(newValue.length); - for (var i = 0; i < newValue.length; i++) { - veryOldValue[i] = newValue[i]; - } - } else { // if object - veryOldValue = {}; - for (var key in newValue) { - if (hasOwnProperty.call(newValue, key)) { - veryOldValue[key] = newValue[key]; - } - } - } - } - } - - return this.$watch(changeDetector, $watchCollectionAction); - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$digest - * @kind function - * - * @description - * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and - * its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change - * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers} - * until no more listeners are firing. This means that it is possible to get into an infinite - * loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of - * iterations exceeds 10. - * - * Usually, you don't call `$digest()` directly in - * {@link ng.directive:ngController controllers} or in - * {@link ng.$compileProvider#directive directives}. - * Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within - * a {@link ng.$compileProvider#directive directive}), which will force a `$digest()`. - * - * If you want to be notified whenever `$digest()` is called, - * you can register a `watchExpression` function with - * {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`. - * - * In unit tests, you may need to call `$digest()` to simulate the scope life cycle. - * - * @example - * ```js - var scope = ...; - scope.name = 'misko'; - scope.counter = 0; - - expect(scope.counter).toEqual(0); - scope.$watch('name', function(newValue, oldValue) { - scope.counter = scope.counter + 1; - }); - expect(scope.counter).toEqual(0); - - scope.$digest(); - // the listener is always called during the first $digest loop after it was registered - expect(scope.counter).toEqual(1); - - scope.$digest(); - // but now it will not be called unless the value changes - expect(scope.counter).toEqual(1); - - scope.name = 'adam'; - scope.$digest(); - expect(scope.counter).toEqual(2); - * ``` - * - */ - $digest: function() { - var watch, value, last, fn, get, - watchers, - dirty, ttl = TTL, - next, current, target = this, - watchLog = [], - logIdx, asyncTask; - - beginPhase('$digest'); - // Check for changes to browser url that happened in sync before the call to $digest - $browser.$$checkUrlChange(); - - if (this === $rootScope && applyAsyncId !== null) { - // If this is the root scope, and $applyAsync has scheduled a deferred $apply(), then - // cancel the scheduled $apply and flush the queue of expressions to be evaluated. - $browser.defer.cancel(applyAsyncId); - flushApplyAsync(); - } - - lastDirtyWatch = null; - - do { // "while dirty" loop - dirty = false; - current = target; - - // It's safe for asyncQueuePosition to be a local variable here because this loop can't - // be reentered recursively. Calling $digest from a function passed to $evalAsync would - // lead to a '$digest already in progress' error. - for (var asyncQueuePosition = 0; asyncQueuePosition < asyncQueue.length; asyncQueuePosition++) { - try { - asyncTask = asyncQueue[asyncQueuePosition]; - fn = asyncTask.fn; - fn(asyncTask.scope, asyncTask.locals); - } catch (e) { - $exceptionHandler(e); - } - lastDirtyWatch = null; - } - asyncQueue.length = 0; - - traverseScopesLoop: - do { // "traverse the scopes" loop - if ((watchers = current.$$watchers)) { - // process our watches - watchers.$$digestWatchIndex = watchers.length; - while (watchers.$$digestWatchIndex--) { - try { - watch = watchers[watchers.$$digestWatchIndex]; - // Most common watches are on primitives, in which case we can short - // circuit it with === operator, only when === fails do we use .equals - if (watch) { - get = watch.get; - if ((value = get(current)) !== (last = watch.last) && - !(watch.eq - ? equals(value, last) - : (isNumberNaN(value) && isNumberNaN(last)))) { - dirty = true; - lastDirtyWatch = watch; - watch.last = watch.eq ? copy(value, null) : value; - fn = watch.fn; - fn(value, ((last === initWatchVal) ? value : last), current); - if (ttl < 5) { - logIdx = 4 - ttl; - if (!watchLog[logIdx]) watchLog[logIdx] = []; - watchLog[logIdx].push({ - msg: isFunction(watch.exp) ? 'fn: ' + (watch.exp.name || watch.exp.toString()) : watch.exp, - newVal: value, - oldVal: last - }); - } - } else if (watch === lastDirtyWatch) { - // If the most recently dirty watcher is now clean, short circuit since the remaining watchers - // have already been tested. - dirty = false; - break traverseScopesLoop; - } - } - } catch (e) { - $exceptionHandler(e); - } - } - } - - // Insanity Warning: scope depth-first traversal - // yes, this code is a bit crazy, but it works and we have tests to prove it! - // this piece should be kept in sync with the traversal in $broadcast - if (!(next = ((current.$$watchersCount && current.$$childHead) || - (current !== target && current.$$nextSibling)))) { - while (current !== target && !(next = current.$$nextSibling)) { - current = current.$parent; - } - } - } while ((current = next)); - - // `break traverseScopesLoop;` takes us to here - - if ((dirty || asyncQueue.length) && !(ttl--)) { - clearPhase(); - throw $rootScopeMinErr('infdig', - '{0} $digest() iterations reached. Aborting!\n' + - 'Watchers fired in the last 5 iterations: {1}', - TTL, watchLog); - } - - } while (dirty || asyncQueue.length); - - clearPhase(); - - // postDigestQueuePosition isn't local here because this loop can be reentered recursively. - while (postDigestQueuePosition < postDigestQueue.length) { - try { - postDigestQueue[postDigestQueuePosition++](); - } catch (e) { - $exceptionHandler(e); - } - } - postDigestQueue.length = postDigestQueuePosition = 0; - - // Check for changes to browser url that happened during the $digest - // (for which no event is fired; e.g. via `history.pushState()`) - $browser.$$checkUrlChange(); - }, - - - /** - * @ngdoc event - * @name $rootScope.Scope#$destroy - * @eventType broadcast on scope being destroyed - * - * @description - * Broadcasted when a scope and its children are being destroyed. - * - * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to - * clean up DOM bindings before an element is removed from the DOM. - */ - - /** - * @ngdoc method - * @name $rootScope.Scope#$destroy - * @kind function - * - * @description - * Removes the current scope (and all of its children) from the parent scope. Removal implies - * that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer - * propagate to the current scope and its children. Removal also implies that the current - * scope is eligible for garbage collection. - * - * The `$destroy()` is usually used by directives such as - * {@link ng.directive:ngRepeat ngRepeat} for managing the - * unrolling of the loop. - * - * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope. - * Application code can register a `$destroy` event handler that will give it a chance to - * perform any necessary cleanup. - * - * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to - * clean up DOM bindings before an element is removed from the DOM. - */ - $destroy: function() { - // We can't destroy a scope that has been already destroyed. - if (this.$$destroyed) return; - var parent = this.$parent; - - this.$broadcast('$destroy'); - this.$$destroyed = true; - - if (this === $rootScope) { - //Remove handlers attached to window when $rootScope is removed - $browser.$$applicationDestroyed(); - } - - incrementWatchersCount(this, -this.$$watchersCount); - for (var eventName in this.$$listenerCount) { - decrementListenerCount(this, this.$$listenerCount[eventName], eventName); - } - - // sever all the references to parent scopes (after this cleanup, the current scope should - // not be retained by any of our references and should be eligible for garbage collection) - if (parent && parent.$$childHead === this) parent.$$childHead = this.$$nextSibling; - if (parent && parent.$$childTail === this) parent.$$childTail = this.$$prevSibling; - if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling; - if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling; - - // Disable listeners, watchers and apply/digest methods - this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop; - this.$on = this.$watch = this.$watchGroup = function() { return noop; }; - this.$$listeners = {}; - - // Disconnect the next sibling to prevent `cleanUpScope` destroying those too - this.$$nextSibling = null; - cleanUpScope(this); - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$eval - * @kind function - * - * @description - * Executes the `expression` on the current scope and returns the result. Any exceptions in - * the expression are propagated (uncaught). This is useful when evaluating AngularJS - * expressions. - * - * @example - * ```js - var scope = ng.$rootScope.Scope(); - scope.a = 1; - scope.b = 2; - - expect(scope.$eval('a+b')).toEqual(3); - expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3); - * ``` - * - * @param {(string|function())=} expression An AngularJS expression to be executed. - * - * - `string`: execute using the rules as defined in {@link guide/expression expression}. - * - `function(scope)`: execute the function with the current `scope` parameter. - * - * @param {(object)=} locals Local variables object, useful for overriding values in scope. - * @returns {*} The result of evaluating the expression. - */ - $eval: function(expr, locals) { - return $parse(expr)(this, locals); - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$evalAsync - * @kind function - * - * @description - * Executes the expression on the current scope at a later point in time. - * - * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only - * that: - * - * - it will execute after the function that scheduled the evaluation (preferably before DOM - * rendering). - * - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after - * `expression` execution. - * - * Any exceptions from the execution of the expression are forwarded to the - * {@link ng.$exceptionHandler $exceptionHandler} service. - * - * __Note:__ if this function is called outside of a `$digest` cycle, a new `$digest` cycle - * will be scheduled. However, it is encouraged to always call code that changes the model - * from within an `$apply` call. That includes code evaluated via `$evalAsync`. - * - * @param {(string|function())=} expression An AngularJS expression to be executed. - * - * - `string`: execute using the rules as defined in {@link guide/expression expression}. - * - `function(scope)`: execute the function with the current `scope` parameter. - * - * @param {(object)=} locals Local variables object, useful for overriding values in scope. - */ - $evalAsync: function(expr, locals) { - // if we are outside of an $digest loop and this is the first time we are scheduling async - // task also schedule async auto-flush - if (!$rootScope.$$phase && !asyncQueue.length) { - $browser.defer(function() { - if (asyncQueue.length) { - $rootScope.$digest(); - } - }); - } - - asyncQueue.push({scope: this, fn: $parse(expr), locals: locals}); - }, - - $$postDigest: function(fn) { - postDigestQueue.push(fn); - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$apply - * @kind function - * - * @description - * `$apply()` is used to execute an expression in AngularJS from outside of the AngularJS - * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries). - * Because we are calling into the AngularJS framework we need to perform proper scope life - * cycle of {@link ng.$exceptionHandler exception handling}, - * {@link ng.$rootScope.Scope#$digest executing watches}. - * - * **Life cycle: Pseudo-Code of `$apply()`** - * - * ```js - function $apply(expr) { - try { - return $eval(expr); - } catch (e) { - $exceptionHandler(e); - } finally { - $root.$digest(); - } - } - * ``` - * - * - * Scope's `$apply()` method transitions through the following stages: - * - * 1. The {@link guide/expression expression} is executed using the - * {@link ng.$rootScope.Scope#$eval $eval()} method. - * 2. Any exceptions from the execution of the expression are forwarded to the - * {@link ng.$exceptionHandler $exceptionHandler} service. - * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the - * expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method. - * - * - * @param {(string|function())=} exp An AngularJS expression to be executed. - * - * - `string`: execute using the rules as defined in {@link guide/expression expression}. - * - `function(scope)`: execute the function with current `scope` parameter. - * - * @returns {*} The result of evaluating the expression. - */ - $apply: function(expr) { - try { - beginPhase('$apply'); - try { - return this.$eval(expr); - } finally { - clearPhase(); - } - } catch (e) { - $exceptionHandler(e); - } finally { - try { - $rootScope.$digest(); - } catch (e) { - $exceptionHandler(e); - // eslint-disable-next-line no-unsafe-finally - throw e; - } - } - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$applyAsync - * @kind function - * - * @description - * Schedule the invocation of $apply to occur at a later time. The actual time difference - * varies across browsers, but is typically around ~10 milliseconds. - * - * This can be used to queue up multiple expressions which need to be evaluated in the same - * digest. - * - * @param {(string|function())=} exp An AngularJS expression to be executed. - * - * - `string`: execute using the rules as defined in {@link guide/expression expression}. - * - `function(scope)`: execute the function with current `scope` parameter. - */ - $applyAsync: function(expr) { - var scope = this; - if (expr) { - applyAsyncQueue.push($applyAsyncExpression); - } - expr = $parse(expr); - scheduleApplyAsync(); - - function $applyAsyncExpression() { - scope.$eval(expr); - } - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$on - * @kind function - * - * @description - * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for - * discussion of event life cycle. - * - * The event listener function format is: `function(event, args...)`. The `event` object - * passed into the listener has the following attributes: - * - * - `targetScope` - `{Scope}`: the scope on which the event was `$emit`-ed or - * `$broadcast`-ed. - * - `currentScope` - `{Scope}`: the scope that is currently handling the event. Once the - * event propagates through the scope hierarchy, this property is set to null. - * - `name` - `{string}`: name of the event. - * - `stopPropagation` - `{function=}`: calling `stopPropagation` function will cancel - * further event propagation (available only for events that were `$emit`-ed). - * - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag - * to true. - * - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called. - * - * @param {string} name Event name to listen on. - * @param {function(event, ...args)} listener Function to call when the event is emitted. - * @returns {function()} Returns a deregistration function for this listener. - */ - $on: function(name, listener) { - var namedListeners = this.$$listeners[name]; - if (!namedListeners) { - this.$$listeners[name] = namedListeners = []; - } - namedListeners.push(listener); - - var current = this; - do { - if (!current.$$listenerCount[name]) { - current.$$listenerCount[name] = 0; - } - current.$$listenerCount[name]++; - } while ((current = current.$parent)); - - var self = this; - return function() { - var indexOfListener = namedListeners.indexOf(listener); - if (indexOfListener !== -1) { - // Use delete in the hope of the browser deallocating the memory for the array entry, - // while not shifting the array indexes of other listeners. - // See issue https://github.com/angular/angular.js/issues/16135 - delete namedListeners[indexOfListener]; - decrementListenerCount(self, 1, name); - } - }; - }, - - - /** - * @ngdoc method - * @name $rootScope.Scope#$emit - * @kind function - * - * @description - * Dispatches an event `name` upwards through the scope hierarchy notifying the - * registered {@link ng.$rootScope.Scope#$on} listeners. - * - * The event life cycle starts at the scope on which `$emit` was called. All - * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get - * notified. Afterwards, the event traverses upwards toward the root scope and calls all - * registered listeners along the way. The event will stop propagating if one of the listeners - * cancels it. - * - * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed - * onto the {@link ng.$exceptionHandler $exceptionHandler} service. - * - * @param {string} name Event name to emit. - * @param {...*} args Optional one or more arguments which will be passed onto the event listeners. - * @return {Object} Event object (see {@link ng.$rootScope.Scope#$on}). - */ - $emit: function(name, args) { - var empty = [], - namedListeners, - scope = this, - stopPropagation = false, - event = { - name: name, - targetScope: scope, - stopPropagation: function() {stopPropagation = true;}, - preventDefault: function() { - event.defaultPrevented = true; - }, - defaultPrevented: false - }, - listenerArgs = concat([event], arguments, 1), - i, length; - - do { - namedListeners = scope.$$listeners[name] || empty; - event.currentScope = scope; - for (i = 0, length = namedListeners.length; i < length; i++) { - - // if listeners were deregistered, defragment the array - if (!namedListeners[i]) { - namedListeners.splice(i, 1); - i--; - length--; - continue; - } - try { - //allow all listeners attached to the current scope to run - namedListeners[i].apply(null, listenerArgs); - } catch (e) { - $exceptionHandler(e); - } - } - //if any listener on the current scope stops propagation, prevent bubbling - if (stopPropagation) { - break; - } - //traverse upwards - scope = scope.$parent; - } while (scope); - - event.currentScope = null; - - return event; - }, - - - /** - * @ngdoc method - * @name $rootScope.Scope#$broadcast - * @kind function - * - * @description - * Dispatches an event `name` downwards to all child scopes (and their children) notifying the - * registered {@link ng.$rootScope.Scope#$on} listeners. - * - * The event life cycle starts at the scope on which `$broadcast` was called. All - * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get - * notified. Afterwards, the event propagates to all direct and indirect scopes of the current - * scope and calls all registered listeners along the way. The event cannot be canceled. - * - * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed - * onto the {@link ng.$exceptionHandler $exceptionHandler} service. - * - * @param {string} name Event name to broadcast. - * @param {...*} args Optional one or more arguments which will be passed onto the event listeners. - * @return {Object} Event object, see {@link ng.$rootScope.Scope#$on} - */ - $broadcast: function(name, args) { - var target = this, - current = target, - next = target, - event = { - name: name, - targetScope: target, - preventDefault: function() { - event.defaultPrevented = true; - }, - defaultPrevented: false - }; - - if (!target.$$listenerCount[name]) return event; - - var listenerArgs = concat([event], arguments, 1), - listeners, i, length; - - //down while you can, then up and next sibling or up and next sibling until back at root - while ((current = next)) { - event.currentScope = current; - listeners = current.$$listeners[name] || []; - for (i = 0, length = listeners.length; i < length; i++) { - // if listeners were deregistered, defragment the array - if (!listeners[i]) { - listeners.splice(i, 1); - i--; - length--; - continue; - } - - try { - listeners[i].apply(null, listenerArgs); - } catch (e) { - $exceptionHandler(e); - } - } - - // Insanity Warning: scope depth-first traversal - // yes, this code is a bit crazy, but it works and we have tests to prove it! - // this piece should be kept in sync with the traversal in $digest - // (though it differs due to having the extra check for $$listenerCount) - if (!(next = ((current.$$listenerCount[name] && current.$$childHead) || - (current !== target && current.$$nextSibling)))) { - while (current !== target && !(next = current.$$nextSibling)) { - current = current.$parent; - } - } - } - - event.currentScope = null; - return event; - } - }; - - var $rootScope = new Scope(); - - //The internal queues. Expose them on the $rootScope for debugging/testing purposes. - var asyncQueue = $rootScope.$$asyncQueue = []; - var postDigestQueue = $rootScope.$$postDigestQueue = []; - var applyAsyncQueue = $rootScope.$$applyAsyncQueue = []; - - var postDigestQueuePosition = 0; - - return $rootScope; - - - function beginPhase(phase) { - if ($rootScope.$$phase) { - throw $rootScopeMinErr('inprog', '{0} already in progress', $rootScope.$$phase); - } - - $rootScope.$$phase = phase; - } - - function clearPhase() { - $rootScope.$$phase = null; - } - - function incrementWatchersCount(current, count) { - do { - current.$$watchersCount += count; - } while ((current = current.$parent)); - } - - function decrementListenerCount(current, count, name) { - do { - current.$$listenerCount[name] -= count; - - if (current.$$listenerCount[name] === 0) { - delete current.$$listenerCount[name]; - } - } while ((current = current.$parent)); - } - - /** - * function used as an initial value for watchers. - * because it's unique we can easily tell it apart from other values - */ - function initWatchVal() {} - - function flushApplyAsync() { - while (applyAsyncQueue.length) { - try { - applyAsyncQueue.shift()(); - } catch (e) { - $exceptionHandler(e); - } - } - applyAsyncId = null; - } - - function scheduleApplyAsync() { - if (applyAsyncId === null) { - applyAsyncId = $browser.defer(function() { - $rootScope.$apply(flushApplyAsync); - }); - } - } - }]; - } - - /** - * @ngdoc service - * @name $rootElement - * - * @description - * The root element of AngularJS application. This is either the element where {@link - * ng.directive:ngApp ngApp} was declared or the element passed into - * {@link angular.bootstrap}. The element represents the root element of application. It is also the - * location where the application's {@link auto.$injector $injector} service gets - * published, and can be retrieved using `$rootElement.injector()`. - */ - - -// the implementation is in angular.bootstrap - - /** - * @this - * @description - * Private service to sanitize uris for links and images. Used by $compile and $sanitize. - */ - function $$SanitizeUriProvider() { - var aHrefSanitizationWhitelist = /^\s*(https?|s?ftp|mailto|tel|file):/, - imgSrcSanitizationWhitelist = /^\s*((https?|ftp|file|blob):|data:image\/)/; - - /** - * @description - * Retrieves or overrides the default regular expression that is used for whitelisting of safe - * urls during a[href] sanitization. - * - * The sanitization is a security measure aimed at prevent XSS attacks via html links. - * - * Any url about to be assigned to a[href] via data-binding is first normalized and turned into - * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist` - * regular expression. If a match is found, the original url is written into the dom. Otherwise, - * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. - * - * @param {RegExp=} regexp New regexp to whitelist urls with. - * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for - * chaining otherwise. - */ - this.aHrefSanitizationWhitelist = function(regexp) { - if (isDefined(regexp)) { - aHrefSanitizationWhitelist = regexp; - return this; - } - return aHrefSanitizationWhitelist; - }; - - - /** - * @description - * Retrieves or overrides the default regular expression that is used for whitelisting of safe - * urls during img[src] sanitization. - * - * The sanitization is a security measure aimed at prevent XSS attacks via html links. - * - * Any url about to be assigned to img[src] via data-binding is first normalized and turned into - * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist` - * regular expression. If a match is found, the original url is written into the dom. Otherwise, - * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. - * - * @param {RegExp=} regexp New regexp to whitelist urls with. - * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for - * chaining otherwise. - */ - this.imgSrcSanitizationWhitelist = function(regexp) { - if (isDefined(regexp)) { - imgSrcSanitizationWhitelist = regexp; - return this; - } - return imgSrcSanitizationWhitelist; - }; - - this.$get = function() { - return function sanitizeUri(uri, isImage) { - var regex = isImage ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist; - var normalizedVal; - normalizedVal = urlResolve(uri && uri.trim()).href; - if (normalizedVal !== '' && !normalizedVal.match(regex)) { - return 'unsafe:' + normalizedVal; - } - return uri; - }; - }; - } - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Any commits to this file should be reviewed with security in mind. * - * Changes to this file can potentially create security vulnerabilities. * - * An approval from 2 Core members with history of modifying * - * this file is required. * - * * - * Does the change somehow allow for arbitrary javascript to be executed? * - * Or allows for someone to change the prototype of built-in objects? * - * Or gives undesired access to variables likes document or window? * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - /* exported $SceProvider, $SceDelegateProvider */ - - var $sceMinErr = minErr('$sce'); - - var SCE_CONTEXTS = { - // HTML is used when there's HTML rendered (e.g. ng-bind-html, iframe srcdoc binding). - HTML: 'html', - - // Style statements or stylesheets. Currently unused in AngularJS. - CSS: 'css', - - // An URL used in a context where it does not refer to a resource that loads code. Currently - // unused in AngularJS. - URL: 'url', - - // RESOURCE_URL is a subtype of URL used where the referred-to resource could be interpreted as - // code. (e.g. ng-include, script src binding, templateUrl) - RESOURCE_URL: 'resourceUrl', - - // Script. Currently unused in AngularJS. - JS: 'js' - }; - -// Helper functions follow. - - var UNDERSCORE_LOWERCASE_REGEXP = /_([a-z])/g; - - function snakeToCamel(name) { - return name - .replace(UNDERSCORE_LOWERCASE_REGEXP, fnCamelCaseReplace); - } - - function adjustMatcher(matcher) { - if (matcher === 'self') { - return matcher; - } else if (isString(matcher)) { - // Strings match exactly except for 2 wildcards - '*' and '**'. - // '*' matches any character except those from the set ':/.?&'. - // '**' matches any character (like .* in a RegExp). - // More than 2 *'s raises an error as it's ill defined. - if (matcher.indexOf('***') > -1) { - throw $sceMinErr('iwcard', - 'Illegal sequence *** in string matcher. String: {0}', matcher); - } - matcher = escapeForRegexp(matcher). - replace(/\\\*\\\*/g, '.*'). - replace(/\\\*/g, '[^:/.?&;]*'); - return new RegExp('^' + matcher + '$'); - } else if (isRegExp(matcher)) { - // The only other type of matcher allowed is a Regexp. - // Match entire URL / disallow partial matches. - // Flags are reset (i.e. no global, ignoreCase or multiline) - return new RegExp('^' + matcher.source + '$'); - } else { - throw $sceMinErr('imatcher', - 'Matchers may only be "self", string patterns or RegExp objects'); - } - } - - - function adjustMatchers(matchers) { - var adjustedMatchers = []; - if (isDefined(matchers)) { - forEach(matchers, function(matcher) { - adjustedMatchers.push(adjustMatcher(matcher)); - }); - } - return adjustedMatchers; - } - - - /** - * @ngdoc service - * @name $sceDelegate - * @kind function - * - * @description - * - * `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict - * Contextual Escaping (SCE)} services to AngularJS. - * - * For an overview of this service and the functionnality it provides in AngularJS, see the main - * page for {@link ng.$sce SCE}. The current page is targeted for developers who need to alter how - * SCE works in their application, which shouldn't be needed in most cases. - * - *
    - * AngularJS strongly relies on contextual escaping for the security of bindings: disabling or - * modifying this might cause cross site scripting (XSS) vulnerabilities. For libraries owners, - * changes to this service will also influence users, so be extra careful and document your changes. - *
    - * - * Typically, you would configure or override the {@link ng.$sceDelegate $sceDelegate} instead of - * the `$sce` service to customize the way Strict Contextual Escaping works in AngularJS. This is - * because, while the `$sce` provides numerous shorthand methods, etc., you really only need to - * override 3 core functions (`trustAs`, `getTrusted` and `valueOf`) to replace the way things - * work because `$sce` delegates to `$sceDelegate` for these operations. - * - * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} to configure this service. - * - * The default instance of `$sceDelegate` should work out of the box with little pain. While you - * can override it completely to change the behavior of `$sce`, the common case would - * involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting - * your own whitelists and blacklists for trusting URLs used for loading AngularJS resources such as - * templates. Refer {@link ng.$sceDelegateProvider#resourceUrlWhitelist - * $sceDelegateProvider.resourceUrlWhitelist} and {@link - * ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist} - */ - - /** - * @ngdoc provider - * @name $sceDelegateProvider - * @this - * - * @description - * - * The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate - * $sceDelegate service}, used as a delegate for {@link ng.$sce Strict Contextual Escaping (SCE)}. - * - * The `$sceDelegateProvider` allows one to get/set the whitelists and blacklists used to ensure - * that the URLs used for sourcing AngularJS templates and other script-running URLs are safe (all - * places that use the `$sce.RESOURCE_URL` context). See - * {@link ng.$sceDelegateProvider#resourceUrlWhitelist $sceDelegateProvider.resourceUrlWhitelist} - * and - * {@link ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}, - * - * For the general details about this service in AngularJS, read the main page for {@link ng.$sce - * Strict Contextual Escaping (SCE)}. - * - * **Example**: Consider the following case.
    - * - * - your app is hosted at url `http://myapp.example.com/` - * - but some of your templates are hosted on other domains you control such as - * `http://srv01.assets.example.com/`, `http://srv02.assets.example.com/`, etc. - * - and you have an open redirect at `http://myapp.example.com/clickThru?...`. - * - * Here is what a secure configuration for this scenario might look like: - * - * ``` - * angular.module('myApp', []).config(function($sceDelegateProvider) { - * $sceDelegateProvider.resourceUrlWhitelist([ - * // Allow same origin resource loads. - * 'self', - * // Allow loading from our assets domain. Notice the difference between * and **. - * 'http://srv*.assets.example.com/**' - * ]); - * - * // The blacklist overrides the whitelist so the open redirect here is blocked. - * $sceDelegateProvider.resourceUrlBlacklist([ - * 'http://myapp.example.com/clickThru**' - * ]); - * }); - * ``` - * Note that an empty whitelist will block every resource URL from being loaded, and will require - * you to manually mark each one as trusted with `$sce.trustAsResourceUrl`. However, templates - * requested by {@link ng.$templateRequest $templateRequest} that are present in - * {@link ng.$templateCache $templateCache} will not go through this check. If you have a mechanism - * to populate your templates in that cache at config time, then it is a good idea to remove 'self' - * from that whitelist. This helps to mitigate the security impact of certain types of issues, like - * for instance attacker-controlled `ng-includes`. - */ - - function $SceDelegateProvider() { - this.SCE_CONTEXTS = SCE_CONTEXTS; - - // Resource URLs can also be trusted by policy. - var resourceUrlWhitelist = ['self'], - resourceUrlBlacklist = []; - - /** - * @ngdoc method - * @name $sceDelegateProvider#resourceUrlWhitelist - * @kind function - * - * @param {Array=} whitelist When provided, replaces the resourceUrlWhitelist with the value - * provided. This must be an array or null. A snapshot of this array is used so further - * changes to the array are ignored. - * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items - * allowed in this array. - * - * @return {Array} The currently set whitelist array. - * - * @description - * Sets/Gets the whitelist of trusted resource URLs. - * - * The **default value** when no whitelist has been explicitly set is `['self']` allowing only - * same origin resource requests. - * - *
    - * **Note:** the default whitelist of 'self' is not recommended if your app shares its origin - * with other apps! It is a good idea to limit it to only your application's directory. - *
    - */ - this.resourceUrlWhitelist = function(value) { - if (arguments.length) { - resourceUrlWhitelist = adjustMatchers(value); - } - return resourceUrlWhitelist; - }; - - /** - * @ngdoc method - * @name $sceDelegateProvider#resourceUrlBlacklist - * @kind function - * - * @param {Array=} blacklist When provided, replaces the resourceUrlBlacklist with the value - * provided. This must be an array or null. A snapshot of this array is used so further - * changes to the array are ignored.

    - * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items - * allowed in this array.

    - * The typical usage for the blacklist is to **block - * [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as - * these would otherwise be trusted but actually return content from the redirected domain. - *

    - * Finally, **the blacklist overrides the whitelist** and has the final say. - * - * @return {Array} The currently set blacklist array. - * - * @description - * Sets/Gets the blacklist of trusted resource URLs. - * - * The **default value** when no whitelist has been explicitly set is the empty array (i.e. there - * is no blacklist.) - */ - - this.resourceUrlBlacklist = function(value) { - if (arguments.length) { - resourceUrlBlacklist = adjustMatchers(value); - } - return resourceUrlBlacklist; - }; - - this.$get = ['$injector', function($injector) { - - var htmlSanitizer = function htmlSanitizer(html) { - throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.'); - }; - - if ($injector.has('$sanitize')) { - htmlSanitizer = $injector.get('$sanitize'); - } - - - function matchUrl(matcher, parsedUrl) { - if (matcher === 'self') { - return urlIsSameOrigin(parsedUrl); - } else { - // definitely a regex. See adjustMatchers() - return !!matcher.exec(parsedUrl.href); - } - } - - function isResourceUrlAllowedByPolicy(url) { - var parsedUrl = urlResolve(url.toString()); - var i, n, allowed = false; - // Ensure that at least one item from the whitelist allows this url. - for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) { - if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) { - allowed = true; - break; - } - } - if (allowed) { - // Ensure that no item from the blacklist blocked this url. - for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) { - if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) { - allowed = false; - break; - } - } - } - return allowed; - } - - function generateHolderType(Base) { - var holderType = function TrustedValueHolderType(trustedValue) { - this.$$unwrapTrustedValue = function() { - return trustedValue; - }; - }; - if (Base) { - holderType.prototype = new Base(); - } - holderType.prototype.valueOf = function sceValueOf() { - return this.$$unwrapTrustedValue(); - }; - holderType.prototype.toString = function sceToString() { - return this.$$unwrapTrustedValue().toString(); - }; - return holderType; - } - - var trustedValueHolderBase = generateHolderType(), - byType = {}; - - byType[SCE_CONTEXTS.HTML] = generateHolderType(trustedValueHolderBase); - byType[SCE_CONTEXTS.CSS] = generateHolderType(trustedValueHolderBase); - byType[SCE_CONTEXTS.URL] = generateHolderType(trustedValueHolderBase); - byType[SCE_CONTEXTS.JS] = generateHolderType(trustedValueHolderBase); - byType[SCE_CONTEXTS.RESOURCE_URL] = generateHolderType(byType[SCE_CONTEXTS.URL]); - - /** - * @ngdoc method - * @name $sceDelegate#trustAs - * - * @description - * Returns a trusted representation of the parameter for the specified context. This trusted - * object will later on be used as-is, without any security check, by bindings or directives - * that require this security context. - * For instance, marking a string as trusted for the `$sce.HTML` context will entirely bypass - * the potential `$sanitize` call in corresponding `$sce.HTML` bindings or directives, such as - * `ng-bind-html`. Note that in most cases you won't need to call this function: if you have the - * sanitizer loaded, passing the value itself will render all the HTML that does not pose a - * security risk. - * - * See {@link ng.$sceDelegate#getTrusted getTrusted} for the function that will consume those - * trusted values, and {@link ng.$sce $sce} for general documentation about strict contextual - * escaping. - * - * @param {string} type The context in which this value is safe for use, e.g. `$sce.URL`, - * `$sce.RESOURCE_URL`, `$sce.HTML`, `$sce.JS` or `$sce.CSS`. - * - * @param {*} value The value that should be considered trusted. - * @return {*} A trusted representation of value, that can be used in the given context. - */ - function trustAs(type, trustedValue) { - var Constructor = (byType.hasOwnProperty(type) ? byType[type] : null); - if (!Constructor) { - throw $sceMinErr('icontext', - 'Attempted to trust a value in invalid context. Context: {0}; Value: {1}', - type, trustedValue); - } - if (trustedValue === null || isUndefined(trustedValue) || trustedValue === '') { - return trustedValue; - } - // All the current contexts in SCE_CONTEXTS happen to be strings. In order to avoid trusting - // mutable objects, we ensure here that the value passed in is actually a string. - if (typeof trustedValue !== 'string') { - throw $sceMinErr('itype', - 'Attempted to trust a non-string value in a content requiring a string: Context: {0}', - type); - } - return new Constructor(trustedValue); - } - - /** - * @ngdoc method - * @name $sceDelegate#valueOf - * - * @description - * If the passed parameter had been returned by a prior call to {@link ng.$sceDelegate#trustAs - * `$sceDelegate.trustAs`}, returns the value that had been passed to {@link - * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}. - * - * If the passed parameter is not a value that had been returned by {@link - * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}, it must be returned as-is. - * - * @param {*} value The result of a prior {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} - * call or anything else. - * @return {*} The `value` that was originally provided to {@link ng.$sceDelegate#trustAs - * `$sceDelegate.trustAs`} if `value` is the result of such a call. Otherwise, returns - * `value` unchanged. - */ - function valueOf(maybeTrusted) { - if (maybeTrusted instanceof trustedValueHolderBase) { - return maybeTrusted.$$unwrapTrustedValue(); - } else { - return maybeTrusted; - } - } - - /** - * @ngdoc method - * @name $sceDelegate#getTrusted - * - * @description - * Takes any input, and either returns a value that's safe to use in the specified context, or - * throws an exception. - * - * In practice, there are several cases. When given a string, this function runs checks - * and sanitization to make it safe without prior assumptions. When given the result of a {@link - * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} call, it returns the originally supplied - * value if that value's context is valid for this call's context. Finally, this function can - * also throw when there is no way to turn `maybeTrusted` in a safe value (e.g., no sanitization - * is available or possible.) - * - * @param {string} type The context in which this value is to be used (such as `$sce.HTML`). - * @param {*} maybeTrusted The result of a prior {@link ng.$sceDelegate#trustAs - * `$sceDelegate.trustAs`} call, or anything else (which will not be considered trusted.) - * @return {*} A version of the value that's safe to use in the given context, or throws an - * exception if this is impossible. - */ - function getTrusted(type, maybeTrusted) { - if (maybeTrusted === null || isUndefined(maybeTrusted) || maybeTrusted === '') { - return maybeTrusted; - } - var constructor = (byType.hasOwnProperty(type) ? byType[type] : null); - // If maybeTrusted is a trusted class instance or subclass instance, then unwrap and return - // as-is. - if (constructor && maybeTrusted instanceof constructor) { - return maybeTrusted.$$unwrapTrustedValue(); - } - // Otherwise, if we get here, then we may either make it safe, or throw an exception. This - // depends on the context: some are sanitizatible (HTML), some use whitelists (RESOURCE_URL), - // some are impossible to do (JS). This step isn't implemented for CSS and URL, as AngularJS - // has no corresponding sinks. - if (type === SCE_CONTEXTS.RESOURCE_URL) { - // RESOURCE_URL uses a whitelist. - if (isResourceUrlAllowedByPolicy(maybeTrusted)) { - return maybeTrusted; - } else { - throw $sceMinErr('insecurl', - 'Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}', - maybeTrusted.toString()); - } - } else if (type === SCE_CONTEXTS.HTML) { - // htmlSanitizer throws its own error when no sanitizer is available. - return htmlSanitizer(maybeTrusted); - } - // Default error when the $sce service has no way to make the input safe. - throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.'); - } - - return { trustAs: trustAs, - getTrusted: getTrusted, - valueOf: valueOf }; - }]; - } - - - /** - * @ngdoc provider - * @name $sceProvider - * @this - * - * @description - * - * The $sceProvider provider allows developers to configure the {@link ng.$sce $sce} service. - * - enable/disable Strict Contextual Escaping (SCE) in a module - * - override the default implementation with a custom delegate - * - * Read more about {@link ng.$sce Strict Contextual Escaping (SCE)}. - */ - - /** - * @ngdoc service - * @name $sce - * @kind function - * - * @description - * - * `$sce` is a service that provides Strict Contextual Escaping services to AngularJS. - * - * ## Strict Contextual Escaping - * - * Strict Contextual Escaping (SCE) is a mode in which AngularJS constrains bindings to only render - * trusted values. Its goal is to assist in writing code in a way that (a) is secure by default, and - * (b) makes auditing for security vulnerabilities such as XSS, clickjacking, etc. a lot easier. - * - * ### Overview - * - * To systematically block XSS security bugs, AngularJS treats all values as untrusted by default in - * HTML or sensitive URL bindings. When binding untrusted values, AngularJS will automatically - * run security checks on them (sanitizations, whitelists, depending on context), or throw when it - * cannot guarantee the security of the result. That behavior depends strongly on contexts: HTML - * can be sanitized, but template URLs cannot, for instance. - * - * To illustrate this, consider the `ng-bind-html` directive. It renders its value directly as HTML: - * we call that the *context*. When given an untrusted input, AngularJS will attempt to sanitize it - * before rendering if a sanitizer is available, and throw otherwise. To bypass sanitization and - * render the input as-is, you will need to mark it as trusted for that context before attempting - * to bind it. - * - * As of version 1.2, AngularJS ships with SCE enabled by default. - * - * ### In practice - * - * Here's an example of a binding in a privileged context: - * - * ``` - * - *

    - * ``` - * - * Notice that `ng-bind-html` is bound to `userHtml` controlled by the user. With SCE - * disabled, this application allows the user to render arbitrary HTML into the DIV, which would - * be an XSS security bug. In a more realistic example, one may be rendering user comments, blog - * articles, etc. via bindings. (HTML is just one example of a context where rendering user - * controlled input creates security vulnerabilities.) - * - * For the case of HTML, you might use a library, either on the client side, or on the server side, - * to sanitize unsafe HTML before binding to the value and rendering it in the document. - * - * How would you ensure that every place that used these types of bindings was bound to a value that - * was sanitized by your library (or returned as safe for rendering by your server?) How can you - * ensure that you didn't accidentally delete the line that sanitized the value, or renamed some - * properties/fields and forgot to update the binding to the sanitized value? - * - * To be secure by default, AngularJS makes sure bindings go through that sanitization, or - * any similar validation process, unless there's a good reason to trust the given value in this - * context. That trust is formalized with a function call. This means that as a developer, you - * can assume all untrusted bindings are safe. Then, to audit your code for binding security issues, - * you just need to ensure the values you mark as trusted indeed are safe - because they were - * received from your server, sanitized by your library, etc. You can organize your codebase to - * help with this - perhaps allowing only the files in a specific directory to do this. - * Ensuring that the internal API exposed by that code doesn't markup arbitrary values as safe then - * becomes a more manageable task. - * - * In the case of AngularJS' SCE service, one uses {@link ng.$sce#trustAs $sce.trustAs} - * (and shorthand methods such as {@link ng.$sce#trustAsHtml $sce.trustAsHtml}, etc.) to - * build the trusted versions of your values. - * - * ### How does it work? - * - * In privileged contexts, directives and code will bind to the result of {@link ng.$sce#getTrusted - * $sce.getTrusted(context, value)} rather than to the value directly. Think of this function as - * a way to enforce the required security context in your data sink. Directives use {@link - * ng.$sce#parseAs $sce.parseAs} rather than `$parse` to watch attribute bindings, which performs - * the {@link ng.$sce#getTrusted $sce.getTrusted} behind the scenes on non-constant literals. Also, - * when binding without directives, AngularJS will understand the context of your bindings - * automatically. - * - * As an example, {@link ng.directive:ngBindHtml ngBindHtml} uses {@link - * ng.$sce#parseAsHtml $sce.parseAsHtml(binding expression)}. Here's the actual code (slightly - * simplified): - * - * ``` - * var ngBindHtmlDirective = ['$sce', function($sce) { - * return function(scope, element, attr) { - * scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function(value) { - * element.html(value || ''); - * }); - * }; - * }]; - * ``` - * - * ### Impact on loading templates - * - * This applies both to the {@link ng.directive:ngInclude `ng-include`} directive as well as - * `templateUrl`'s specified by {@link guide/directive directives}. - * - * By default, AngularJS only loads templates from the same domain and protocol as the application - * document. This is done by calling {@link ng.$sce#getTrustedResourceUrl - * $sce.getTrustedResourceUrl} on the template URL. To load templates from other domains and/or - * protocols, you may either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist - * them} or {@link ng.$sce#trustAsResourceUrl wrap it} into a trusted value. - * - * *Please note*: - * The browser's - * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest) - * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/) - * policy apply in addition to this and may further restrict whether the template is successfully - * loaded. This means that without the right CORS policy, loading templates from a different domain - * won't work on all browsers. Also, loading templates from `file://` URL does not work on some - * browsers. - * - * ### This feels like too much overhead - * - * It's important to remember that SCE only applies to interpolation expressions. - * - * If your expressions are constant literals, they're automatically trusted and you don't need to - * call `$sce.trustAs` on them (e.g. - * `
    `) just works. The `$sceDelegate` will - * also use the `$sanitize` service if it is available when binding untrusted values to - * `$sce.HTML` context. AngularJS provides an implementation in `angular-sanitize.js`, and if you - * wish to use it, you will also need to depend on the {@link ngSanitize `ngSanitize`} module in - * your application. - * - * The included {@link ng.$sceDelegate $sceDelegate} comes with sane defaults to allow you to load - * templates in `ng-include` from your application's domain without having to even know about SCE. - * It blocks loading templates from other domains or loading templates over http from an https - * served document. You can change these by setting your own custom {@link - * ng.$sceDelegateProvider#resourceUrlWhitelist whitelists} and {@link - * ng.$sceDelegateProvider#resourceUrlBlacklist blacklists} for matching such URLs. - * - * This significantly reduces the overhead. It is far easier to pay the small overhead and have an - * application that's secure and can be audited to verify that with much more ease than bolting - * security onto an application later. - * - * - * ### What trusted context types are supported? - * - * | Context | Notes | - * |---------------------|----------------| - * | `$sce.HTML` | For HTML that's safe to source into the application. The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. If an unsafe value is encountered, and the {@link ngSanitize.$sanitize $sanitize} service is available (implemented by the {@link ngSanitize ngSanitize} module) this will sanitize the value instead of throwing an error. | - * | `$sce.CSS` | For CSS that's safe to source into the application. Currently, no bindings require this context. Feel free to use it in your own directives. | - * | `$sce.URL` | For URLs that are safe to follow as links. Currently unused (`
    Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` does (it's not just the URL that matters, but also what is at the end of it), and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` are required. | - * | `$sce.JS` | For JavaScript that is safe to execute in your application's context. Currently, no bindings require this context. Feel free to use it in your own directives. | - * - * - * Be aware that `a[href]` and `img[src]` automatically sanitize their URLs and do not pass them - * through {@link ng.$sce#getTrusted $sce.getTrusted}. There's no CSS-, URL-, or JS-context bindings - * in AngularJS currently, so their corresponding `$sce.trustAs` functions aren't useful yet. This - * might evolve. - * - * ### Format of items in {@link ng.$sceDelegateProvider#resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#resourceUrlBlacklist Blacklist}
    - * - * Each element in these arrays must be one of the following: - * - * - **'self'** - * - The special **string**, `'self'`, can be used to match against all URLs of the **same - * domain** as the application document using the **same protocol**. - * - **String** (except the special value `'self'`) - * - The string is matched against the full *normalized / absolute URL* of the resource - * being tested (substring matches are not good enough.) - * - There are exactly **two wildcard sequences** - `*` and `**`. All other characters - * match themselves. - * - `*`: matches zero or more occurrences of any character other than one of the following 6 - * characters: '`:`', '`/`', '`.`', '`?`', '`&`' and '`;`'. It's a useful wildcard for use - * in a whitelist. - * - `**`: matches zero or more occurrences of *any* character. As such, it's not - * appropriate for use in a scheme, domain, etc. as it would match too much. (e.g. - * http://**.example.com/ would match http://evil.com/?ignore=.example.com/ and that might - * not have been the intention.) Its usage at the very end of the path is ok. (e.g. - * http://foo.example.com/templates/**). - * - **RegExp** (*see caveat below*) - * - *Caveat*: While regular expressions are powerful and offer great flexibility, their syntax - * (and all the inevitable escaping) makes them *harder to maintain*. It's easy to - * accidentally introduce a bug when one updates a complex expression (imho, all regexes should - * have good test coverage). For instance, the use of `.` in the regex is correct only in a - * small number of cases. A `.` character in the regex used when matching the scheme or a - * subdomain could be matched against a `:` or literal `.` that was likely not intended. It - * is highly recommended to use the string patterns and only fall back to regular expressions - * as a last resort. - * - The regular expression must be an instance of RegExp (i.e. not a string.) It is - * matched against the **entire** *normalized / absolute URL* of the resource being tested - * (even when the RegExp did not have the `^` and `$` codes.) In addition, any flags - * present on the RegExp (such as multiline, global, ignoreCase) are ignored. - * - If you are generating your JavaScript from some other templating engine (not - * recommended, e.g. in issue [#4006](https://github.com/angular/angular.js/issues/4006)), - * remember to escape your regular expression (and be aware that you might need more than - * one level of escaping depending on your templating engine and the way you interpolated - * the value.) Do make use of your platform's escaping mechanism as it might be good - * enough before coding your own. E.g. Ruby has - * [Regexp.escape(str)](http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-c-escape) - * and Python has [re.escape](http://docs.python.org/library/re.html#re.escape). - * Javascript lacks a similar built in function for escaping. Take a look at Google - * Closure library's [goog.string.regExpEscape(s)]( - * http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962). - * - * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} for an example. - * - * ### Show me an example using SCE. - * - * - * - *
    - *

    - * User comments
    - * By default, HTML that isn't explicitly trusted (e.g. Alice's comment) is sanitized when - * $sanitize is available. If $sanitize isn't available, this results in an error instead of an - * exploit. - *
    - *
    - * {{userComment.name}}: - * - *
    - *
    - *
    - *
    - *
    - * - * - * angular.module('mySceApp', ['ngSanitize']) - * .controller('AppController', ['$http', '$templateCache', '$sce', - * function AppController($http, $templateCache, $sce) { - * var self = this; - * $http.get('test_data.json', {cache: $templateCache}).then(function(response) { - * self.userComments = response.data; - * }); - * self.explicitlyTrustedHtml = $sce.trustAsHtml( - * 'Hover over this text.'); - * }]); - * - * - * - * [ - * { "name": "Alice", - * "htmlComment": - * "Is anyone reading this?" - * }, - * { "name": "Bob", - * "htmlComment": "Yes! Am I the only other one?" - * } - * ] - * - * - * - * describe('SCE doc demo', function() { - * it('should sanitize untrusted values', function() { - * expect(element.all(by.css('.htmlComment')).first().getAttribute('innerHTML')) - * .toBe('Is anyone reading this?'); - * }); - * - * it('should NOT sanitize explicitly trusted values', function() { - * expect(element(by.id('explicitlyTrustedHtml')).getAttribute('innerHTML')).toBe( - * 'Hover over this text.'); - * }); - * }); - * - *
    - * - * - * - * ## Can I disable SCE completely? - * - * Yes, you can. However, this is strongly discouraged. SCE gives you a lot of security benefits - * for little coding overhead. It will be much harder to take an SCE disabled application and - * either secure it on your own or enable SCE at a later stage. It might make sense to disable SCE - * for cases where you have a lot of existing code that was written before SCE was introduced and - * you're migrating them a module at a time. Also do note that this is an app-wide setting, so if - * you are writing a library, you will cause security bugs applications using it. - * - * That said, here's how you can completely disable SCE: - * - * ``` - * angular.module('myAppWithSceDisabledmyApp', []).config(function($sceProvider) { - * // Completely disable SCE. For demonstration purposes only! - * // Do not use in new projects or libraries. - * $sceProvider.enabled(false); - * }); - * ``` - * - */ - - function $SceProvider() { - var enabled = true; - - /** - * @ngdoc method - * @name $sceProvider#enabled - * @kind function - * - * @param {boolean=} value If provided, then enables/disables SCE application-wide. - * @return {boolean} True if SCE is enabled, false otherwise. - * - * @description - * Enables/disables SCE and returns the current value. - */ - this.enabled = function(value) { - if (arguments.length) { - enabled = !!value; - } - return enabled; - }; - - - /* Design notes on the default implementation for SCE. - * - * The API contract for the SCE delegate - * ------------------------------------- - * The SCE delegate object must provide the following 3 methods: - * - * - trustAs(contextEnum, value) - * This method is used to tell the SCE service that the provided value is OK to use in the - * contexts specified by contextEnum. It must return an object that will be accepted by - * getTrusted() for a compatible contextEnum and return this value. - * - * - valueOf(value) - * For values that were not produced by trustAs(), return them as is. For values that were - * produced by trustAs(), return the corresponding input value to trustAs. Basically, if - * trustAs is wrapping the given values into some type, this operation unwraps it when given - * such a value. - * - * - getTrusted(contextEnum, value) - * This function should return the a value that is safe to use in the context specified by - * contextEnum or throw and exception otherwise. - * - * NOTE: This contract deliberately does NOT state that values returned by trustAs() must be - * opaque or wrapped in some holder object. That happens to be an implementation detail. For - * instance, an implementation could maintain a registry of all trusted objects by context. In - * such a case, trustAs() would return the same object that was passed in. getTrusted() would - * return the same object passed in if it was found in the registry under a compatible context or - * throw an exception otherwise. An implementation might only wrap values some of the time based - * on some criteria. getTrusted() might return a value and not throw an exception for special - * constants or objects even if not wrapped. All such implementations fulfill this contract. - * - * - * A note on the inheritance model for SCE contexts - * ------------------------------------------------ - * I've used inheritance and made RESOURCE_URL wrapped types a subtype of URL wrapped types. This - * is purely an implementation details. - * - * The contract is simply this: - * - * getTrusted($sce.RESOURCE_URL, value) succeeding implies that getTrusted($sce.URL, value) - * will also succeed. - * - * Inheritance happens to capture this in a natural way. In some future, we may not use - * inheritance anymore. That is OK because no code outside of sce.js and sceSpecs.js would need to - * be aware of this detail. - */ - - this.$get = ['$parse', '$sceDelegate', function( - $parse, $sceDelegate) { - // Support: IE 9-11 only - // Prereq: Ensure that we're not running in IE<11 quirks mode. In that mode, IE < 11 allow - // the "expression(javascript expression)" syntax which is insecure. - if (enabled && msie < 8) { - throw $sceMinErr('iequirks', - 'Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks ' + - 'mode. You can fix this by adding the text to the top of your HTML ' + - 'document. See http://docs.angularjs.org/api/ng.$sce for more information.'); - } - - var sce = shallowCopy(SCE_CONTEXTS); - - /** - * @ngdoc method - * @name $sce#isEnabled - * @kind function - * - * @return {Boolean} True if SCE is enabled, false otherwise. If you want to set the value, you - * have to do it at module config time on {@link ng.$sceProvider $sceProvider}. - * - * @description - * Returns a boolean indicating if SCE is enabled. - */ - sce.isEnabled = function() { - return enabled; - }; - sce.trustAs = $sceDelegate.trustAs; - sce.getTrusted = $sceDelegate.getTrusted; - sce.valueOf = $sceDelegate.valueOf; - - if (!enabled) { - sce.trustAs = sce.getTrusted = function(type, value) { return value; }; - sce.valueOf = identity; - } - - /** - * @ngdoc method - * @name $sce#parseAs - * - * @description - * Converts AngularJS {@link guide/expression expression} into a function. This is like {@link - * ng.$parse $parse} and is identical when the expression is a literal constant. Otherwise, it - * wraps the expression in a call to {@link ng.$sce#getTrusted $sce.getTrusted(*type*, - * *result*)} - * - * @param {string} type The SCE context in which this result will be used. - * @param {string} expression String expression to compile. - * @return {function(context, locals)} A function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the - * strings are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values - * in `context`. - */ - sce.parseAs = function sceParseAs(type, expr) { - var parsed = $parse(expr); - if (parsed.literal && parsed.constant) { - return parsed; - } else { - return $parse(expr, function(value) { - return sce.getTrusted(type, value); - }); - } - }; - - /** - * @ngdoc method - * @name $sce#trustAs - * - * @description - * Delegates to {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}. As such, returns a - * wrapped object that represents your value, and the trust you have in its safety for the given - * context. AngularJS can then use that value as-is in bindings of the specified secure context. - * This is used in bindings for `ng-bind-html`, `ng-include`, and most `src` attribute - * interpolations. See {@link ng.$sce $sce} for strict contextual escaping. - * - * @param {string} type The context in which this value is safe for use, e.g. `$sce.URL`, - * `$sce.RESOURCE_URL`, `$sce.HTML`, `$sce.JS` or `$sce.CSS`. - * - * @param {*} value The value that that should be considered trusted. - * @return {*} A wrapped version of value that can be used as a trusted variant of your `value` - * in the context you specified. - */ - - /** - * @ngdoc method - * @name $sce#trustAsHtml - * - * @description - * Shorthand method. `$sce.trustAsHtml(value)` → - * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.HTML, value)`} - * - * @param {*} value The value to mark as trusted for `$sce.HTML` context. - * @return {*} A wrapped version of value that can be used as a trusted variant of your `value` - * in `$sce.HTML` context (like `ng-bind-html`). - */ - - /** - * @ngdoc method - * @name $sce#trustAsCss - * - * @description - * Shorthand method. `$sce.trustAsCss(value)` → - * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.CSS, value)`} - * - * @param {*} value The value to mark as trusted for `$sce.CSS` context. - * @return {*} A wrapped version of value that can be used as a trusted variant - * of your `value` in `$sce.CSS` context. This context is currently unused, so there are - * almost no reasons to use this function so far. - */ - - /** - * @ngdoc method - * @name $sce#trustAsUrl - * - * @description - * Shorthand method. `$sce.trustAsUrl(value)` → - * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.URL, value)`} - * - * @param {*} value The value to mark as trusted for `$sce.URL` context. - * @return {*} A wrapped version of value that can be used as a trusted variant of your `value` - * in `$sce.URL` context. That context is currently unused, so there are almost no reasons - * to use this function so far. - */ - - /** - * @ngdoc method - * @name $sce#trustAsResourceUrl - * - * @description - * Shorthand method. `$sce.trustAsResourceUrl(value)` → - * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.RESOURCE_URL, value)`} - * - * @param {*} value The value to mark as trusted for `$sce.RESOURCE_URL` context. - * @return {*} A wrapped version of value that can be used as a trusted variant of your `value` - * in `$sce.RESOURCE_URL` context (template URLs in `ng-include`, most `src` attribute - * bindings, ...) - */ - - /** - * @ngdoc method - * @name $sce#trustAsJs - * - * @description - * Shorthand method. `$sce.trustAsJs(value)` → - * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.JS, value)`} - * - * @param {*} value The value to mark as trusted for `$sce.JS` context. - * @return {*} A wrapped version of value that can be used as a trusted variant of your `value` - * in `$sce.JS` context. That context is currently unused, so there are almost no reasons to - * use this function so far. - */ - - /** - * @ngdoc method - * @name $sce#getTrusted - * - * @description - * Delegates to {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted`}. As such, - * takes any input, and either returns a value that's safe to use in the specified context, - * or throws an exception. This function is aware of trusted values created by the `trustAs` - * function and its shorthands, and when contexts are appropriate, returns the unwrapped value - * as-is. Finally, this function can also throw when there is no way to turn `maybeTrusted` in a - * safe value (e.g., no sanitization is available or possible.) - * - * @param {string} type The context in which this value is to be used. - * @param {*} maybeTrusted The result of a prior {@link ng.$sce#trustAs - * `$sce.trustAs`} call, or anything else (which will not be considered trusted.) - * @return {*} A version of the value that's safe to use in the given context, or throws an - * exception if this is impossible. - */ - - /** - * @ngdoc method - * @name $sce#getTrustedHtml - * - * @description - * Shorthand method. `$sce.getTrustedHtml(value)` → - * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.HTML, value)`} - * - * @param {*} value The value to pass to `$sce.getTrusted`. - * @return {*} The return value of `$sce.getTrusted($sce.HTML, value)` - */ - - /** - * @ngdoc method - * @name $sce#getTrustedCss - * - * @description - * Shorthand method. `$sce.getTrustedCss(value)` → - * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.CSS, value)`} - * - * @param {*} value The value to pass to `$sce.getTrusted`. - * @return {*} The return value of `$sce.getTrusted($sce.CSS, value)` - */ - - /** - * @ngdoc method - * @name $sce#getTrustedUrl - * - * @description - * Shorthand method. `$sce.getTrustedUrl(value)` → - * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.URL, value)`} - * - * @param {*} value The value to pass to `$sce.getTrusted`. - * @return {*} The return value of `$sce.getTrusted($sce.URL, value)` - */ - - /** - * @ngdoc method - * @name $sce#getTrustedResourceUrl - * - * @description - * Shorthand method. `$sce.getTrustedResourceUrl(value)` → - * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.RESOURCE_URL, value)`} - * - * @param {*} value The value to pass to `$sceDelegate.getTrusted`. - * @return {*} The return value of `$sce.getTrusted($sce.RESOURCE_URL, value)` - */ - - /** - * @ngdoc method - * @name $sce#getTrustedJs - * - * @description - * Shorthand method. `$sce.getTrustedJs(value)` → - * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.JS, value)`} - * - * @param {*} value The value to pass to `$sce.getTrusted`. - * @return {*} The return value of `$sce.getTrusted($sce.JS, value)` - */ - - /** - * @ngdoc method - * @name $sce#parseAsHtml - * - * @description - * Shorthand method. `$sce.parseAsHtml(expression string)` → - * {@link ng.$sce#parseAs `$sce.parseAs($sce.HTML, value)`} - * - * @param {string} expression String expression to compile. - * @return {function(context, locals)} A function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the - * strings are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values - * in `context`. - */ - - /** - * @ngdoc method - * @name $sce#parseAsCss - * - * @description - * Shorthand method. `$sce.parseAsCss(value)` → - * {@link ng.$sce#parseAs `$sce.parseAs($sce.CSS, value)`} - * - * @param {string} expression String expression to compile. - * @return {function(context, locals)} A function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the - * strings are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values - * in `context`. - */ - - /** - * @ngdoc method - * @name $sce#parseAsUrl - * - * @description - * Shorthand method. `$sce.parseAsUrl(value)` → - * {@link ng.$sce#parseAs `$sce.parseAs($sce.URL, value)`} - * - * @param {string} expression String expression to compile. - * @return {function(context, locals)} A function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the - * strings are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values - * in `context`. - */ - - /** - * @ngdoc method - * @name $sce#parseAsResourceUrl - * - * @description - * Shorthand method. `$sce.parseAsResourceUrl(value)` → - * {@link ng.$sce#parseAs `$sce.parseAs($sce.RESOURCE_URL, value)`} - * - * @param {string} expression String expression to compile. - * @return {function(context, locals)} A function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the - * strings are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values - * in `context`. - */ - - /** - * @ngdoc method - * @name $sce#parseAsJs - * - * @description - * Shorthand method. `$sce.parseAsJs(value)` → - * {@link ng.$sce#parseAs `$sce.parseAs($sce.JS, value)`} - * - * @param {string} expression String expression to compile. - * @return {function(context, locals)} A function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the - * strings are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values - * in `context`. - */ - - // Shorthand delegations. - var parse = sce.parseAs, - getTrusted = sce.getTrusted, - trustAs = sce.trustAs; - - forEach(SCE_CONTEXTS, function(enumValue, name) { - var lName = lowercase(name); - sce[snakeToCamel('parse_as_' + lName)] = function(expr) { - return parse(enumValue, expr); - }; - sce[snakeToCamel('get_trusted_' + lName)] = function(value) { - return getTrusted(enumValue, value); - }; - sce[snakeToCamel('trust_as_' + lName)] = function(value) { - return trustAs(enumValue, value); - }; - }); - - return sce; - }]; - } - - /* exported $SnifferProvider */ - - /** - * !!! This is an undocumented "private" service !!! - * - * @name $sniffer - * @requires $window - * @requires $document - * @this - * - * @property {boolean} history Does the browser support html5 history api ? - * @property {boolean} transitions Does the browser support CSS transition events ? - * @property {boolean} animations Does the browser support CSS animation events ? - * - * @description - * This is very simple implementation of testing browser's features. - */ - function $SnifferProvider() { - this.$get = ['$window', '$document', function($window, $document) { - var eventSupport = {}, - // Chrome Packaged Apps are not allowed to access `history.pushState`. - // If not sandboxed, they can be detected by the presence of `chrome.app.runtime` - // (see https://developer.chrome.com/apps/api_index). If sandboxed, they can be detected by - // the presence of an extension runtime ID and the absence of other Chrome runtime APIs - // (see https://developer.chrome.com/apps/manifest/sandbox). - // (NW.js apps have access to Chrome APIs, but do support `history`.) - isNw = $window.nw && $window.nw.process, - isChromePackagedApp = - !isNw && - $window.chrome && - ($window.chrome.app && $window.chrome.app.runtime || - !$window.chrome.app && $window.chrome.runtime && $window.chrome.runtime.id), - hasHistoryPushState = !isChromePackagedApp && $window.history && $window.history.pushState, - android = - toInt((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]), - boxee = /Boxee/i.test(($window.navigator || {}).userAgent), - document = $document[0] || {}, - bodyStyle = document.body && document.body.style, - transitions = false, - animations = false; - - if (bodyStyle) { - // Support: Android <5, Blackberry Browser 10, default Chrome in Android 4.4.x - // Mentioned browsers need a -webkit- prefix for transitions & animations. - transitions = !!('transition' in bodyStyle || 'webkitTransition' in bodyStyle); - animations = !!('animation' in bodyStyle || 'webkitAnimation' in bodyStyle); - } - - - return { - // Android has history.pushState, but it does not update location correctly - // so let's not use the history API at all. - // http://code.google.com/p/android/issues/detail?id=17471 - // https://github.com/angular/angular.js/issues/904 - - // older webkit browser (533.9) on Boxee box has exactly the same problem as Android has - // so let's not use the history API also - // We are purposefully using `!(android < 4)` to cover the case when `android` is undefined - history: !!(hasHistoryPushState && !(android < 4) && !boxee), - hasEvent: function(event) { - // Support: IE 9-11 only - // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have - // it. In particular the event is not fired when backspace or delete key are pressed or - // when cut operation is performed. - // IE10+ implements 'input' event but it erroneously fires under various situations, - // e.g. when placeholder changes, or a form is focused. - if (event === 'input' && msie) return false; - - if (isUndefined(eventSupport[event])) { - var divElm = document.createElement('div'); - eventSupport[event] = 'on' + event in divElm; - } - - return eventSupport[event]; - }, - csp: csp(), - transitions: transitions, - animations: animations, - android: android - }; - }]; - } - - var $templateRequestMinErr = minErr('$compile'); - - /** - * @ngdoc provider - * @name $templateRequestProvider - * @this - * - * @description - * Used to configure the options passed to the {@link $http} service when making a template request. - * - * For example, it can be used for specifying the "Accept" header that is sent to the server, when - * requesting a template. - */ - function $TemplateRequestProvider() { - - var httpOptions; - - /** - * @ngdoc method - * @name $templateRequestProvider#httpOptions - * @description - * The options to be passed to the {@link $http} service when making the request. - * You can use this to override options such as the "Accept" header for template requests. - * - * The {@link $templateRequest} will set the `cache` and the `transformResponse` properties of the - * options if not overridden here. - * - * @param {string=} value new value for the {@link $http} options. - * @returns {string|self} Returns the {@link $http} options when used as getter and self if used as setter. - */ - this.httpOptions = function(val) { - if (val) { - httpOptions = val; - return this; - } - return httpOptions; - }; - - /** - * @ngdoc service - * @name $templateRequest - * - * @description - * The `$templateRequest` service runs security checks then downloads the provided template using - * `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request - * fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the - * exception can be thwarted by setting the 2nd parameter of the function to true). Note that the - * contents of `$templateCache` are trusted, so the call to `$sce.getTrustedUrl(tpl)` is omitted - * when `tpl` is of type string and `$templateCache` has the matching entry. - * - * If you want to pass custom options to the `$http` service, such as setting the Accept header you - * can configure this via {@link $templateRequestProvider#httpOptions}. - * - * `$templateRequest` is used internally by {@link $compile}, {@link ngRoute.$route}, and directives such - * as {@link ngInclude} to download and cache templates. - * - * 3rd party modules should use `$templateRequest` if their services or directives are loading - * templates. - * - * @param {string|TrustedResourceUrl} tpl The HTTP request template URL - * @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty - * - * @return {Promise} a promise for the HTTP response data of the given URL. - * - * @property {number} totalPendingRequests total amount of pending template requests being downloaded. - */ - this.$get = ['$exceptionHandler', '$templateCache', '$http', '$q', '$sce', - function($exceptionHandler, $templateCache, $http, $q, $sce) { - - function handleRequestFn(tpl, ignoreRequestError) { - handleRequestFn.totalPendingRequests++; - - // We consider the template cache holds only trusted templates, so - // there's no need to go through whitelisting again for keys that already - // are included in there. This also makes AngularJS accept any script - // directive, no matter its name. However, we still need to unwrap trusted - // types. - if (!isString(tpl) || isUndefined($templateCache.get(tpl))) { - tpl = $sce.getTrustedResourceUrl(tpl); - } - - var transformResponse = $http.defaults && $http.defaults.transformResponse; - - if (isArray(transformResponse)) { - transformResponse = transformResponse.filter(function(transformer) { - return transformer !== defaultHttpResponseTransform; - }); - } else if (transformResponse === defaultHttpResponseTransform) { - transformResponse = null; - } - - return $http.get(tpl, extend({ - cache: $templateCache, - transformResponse: transformResponse - }, httpOptions)) - .finally(function() { - handleRequestFn.totalPendingRequests--; - }) - .then(function(response) { - $templateCache.put(tpl, response.data); - return response.data; - }, handleError); - - function handleError(resp) { - if (!ignoreRequestError) { - resp = $templateRequestMinErr('tpload', - 'Failed to load template: {0} (HTTP status: {1} {2})', - tpl, resp.status, resp.statusText); - - $exceptionHandler(resp); - } - - return $q.reject(resp); - } - } - - handleRequestFn.totalPendingRequests = 0; - - return handleRequestFn; - } - ]; - } - - /** @this */ - function $$TestabilityProvider() { - this.$get = ['$rootScope', '$browser', '$location', - function($rootScope, $browser, $location) { - - /** - * @name $testability - * - * @description - * The private $$testability service provides a collection of methods for use when debugging - * or by automated test and debugging tools. - */ - var testability = {}; - - /** - * @name $$testability#findBindings - * - * @description - * Returns an array of elements that are bound (via ng-bind or {{}}) - * to expressions matching the input. - * - * @param {Element} element The element root to search from. - * @param {string} expression The binding expression to match. - * @param {boolean} opt_exactMatch If true, only returns exact matches - * for the expression. Filters and whitespace are ignored. - */ - testability.findBindings = function(element, expression, opt_exactMatch) { - var bindings = element.getElementsByClassName('ng-binding'); - var matches = []; - forEach(bindings, function(binding) { - var dataBinding = angular.element(binding).data('$binding'); - if (dataBinding) { - forEach(dataBinding, function(bindingName) { - if (opt_exactMatch) { - var matcher = new RegExp('(^|\\s)' + escapeForRegexp(expression) + '(\\s|\\||$)'); - if (matcher.test(bindingName)) { - matches.push(binding); - } - } else { - if (bindingName.indexOf(expression) !== -1) { - matches.push(binding); - } - } - }); - } - }); - return matches; - }; - - /** - * @name $$testability#findModels - * - * @description - * Returns an array of elements that are two-way found via ng-model to - * expressions matching the input. - * - * @param {Element} element The element root to search from. - * @param {string} expression The model expression to match. - * @param {boolean} opt_exactMatch If true, only returns exact matches - * for the expression. - */ - testability.findModels = function(element, expression, opt_exactMatch) { - var prefixes = ['ng-', 'data-ng-', 'ng\\:']; - for (var p = 0; p < prefixes.length; ++p) { - var attributeEquals = opt_exactMatch ? '=' : '*='; - var selector = '[' + prefixes[p] + 'model' + attributeEquals + '"' + expression + '"]'; - var elements = element.querySelectorAll(selector); - if (elements.length) { - return elements; - } - } - }; - - /** - * @name $$testability#getLocation - * - * @description - * Shortcut for getting the location in a browser agnostic way. Returns - * the path, search, and hash. (e.g. /path?a=b#hash) - */ - testability.getLocation = function() { - return $location.url(); - }; - - /** - * @name $$testability#setLocation - * - * @description - * Shortcut for navigating to a location without doing a full page reload. - * - * @param {string} url The location url (path, search and hash, - * e.g. /path?a=b#hash) to go to. - */ - testability.setLocation = function(url) { - if (url !== $location.url()) { - $location.url(url); - $rootScope.$digest(); - } - }; - - /** - * @name $$testability#whenStable - * - * @description - * Calls the callback when $timeout and $http requests are completed. - * - * @param {function} callback - */ - testability.whenStable = function(callback) { - $browser.notifyWhenNoOutstandingRequests(callback); - }; - - return testability; - }]; - } - - /** @this */ - function $TimeoutProvider() { - this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler', - function($rootScope, $browser, $q, $$q, $exceptionHandler) { - - var deferreds = {}; - - - /** - * @ngdoc service - * @name $timeout - * - * @description - * AngularJS's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch - * block and delegates any exceptions to - * {@link ng.$exceptionHandler $exceptionHandler} service. - * - * The return value of calling `$timeout` is a promise, which will be resolved when - * the delay has passed and the timeout function, if provided, is executed. - * - * To cancel a timeout request, call `$timeout.cancel(promise)`. - * - * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to - * synchronously flush the queue of deferred functions. - * - * If you only want a promise that will be resolved after some specified delay - * then you can call `$timeout` without the `fn` function. - * - * @param {function()=} fn A function, whose execution should be delayed. - * @param {number=} [delay=0] Delay in milliseconds. - * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise - * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block. - * @param {...*=} Pass additional parameters to the executed function. - * @returns {Promise} Promise that will be resolved when the timeout is reached. The promise - * will be resolved with the return value of the `fn` function. - * - */ - function timeout(fn, delay, invokeApply) { - if (!isFunction(fn)) { - invokeApply = delay; - delay = fn; - fn = noop; - } - - var args = sliceArgs(arguments, 3), - skipApply = (isDefined(invokeApply) && !invokeApply), - deferred = (skipApply ? $$q : $q).defer(), - promise = deferred.promise, - timeoutId; - - timeoutId = $browser.defer(function() { - try { - deferred.resolve(fn.apply(null, args)); - } catch (e) { - deferred.reject(e); - $exceptionHandler(e); - } finally { - delete deferreds[promise.$$timeoutId]; - } - - if (!skipApply) $rootScope.$apply(); - }, delay); - - promise.$$timeoutId = timeoutId; - deferreds[timeoutId] = deferred; - - return promise; - } - - - /** - * @ngdoc method - * @name $timeout#cancel - * - * @description - * Cancels a task associated with the `promise`. As a result of this, the promise will be - * resolved with a rejection. - * - * @param {Promise=} promise Promise returned by the `$timeout` function. - * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully - * canceled. - */ - timeout.cancel = function(promise) { - if (promise && promise.$$timeoutId in deferreds) { - // Timeout cancels should not report an unhandled promise. - markQExceptionHandled(deferreds[promise.$$timeoutId].promise); - deferreds[promise.$$timeoutId].reject('canceled'); - delete deferreds[promise.$$timeoutId]; - return $browser.defer.cancel(promise.$$timeoutId); - } - return false; - }; - - return timeout; - }]; - } - -// NOTE: The usage of window and document instead of $window and $document here is -// deliberate. This service depends on the specific behavior of anchor nodes created by the -// browser (resolving and parsing URLs) that is unlikely to be provided by mock objects and -// cause us to break tests. In addition, when the browser resolves a URL for XHR, it -// doesn't know about mocked locations and resolves URLs to the real document - which is -// exactly the behavior needed here. There is little value is mocking these out for this -// service. - var urlParsingNode = window.document.createElement('a'); - var originUrl = urlResolve(window.location.href); - - - /** - * - * Implementation Notes for non-IE browsers - * ---------------------------------------- - * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM, - * results both in the normalizing and parsing of the URL. Normalizing means that a relative - * URL will be resolved into an absolute URL in the context of the application document. - * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related - * properties are all populated to reflect the normalized URL. This approach has wide - * compatibility - Safari 1+, Mozilla 1+ etc. See - * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html - * - * Implementation Notes for IE - * --------------------------- - * IE <= 10 normalizes the URL when assigned to the anchor node similar to the other - * browsers. However, the parsed components will not be set if the URL assigned did not specify - * them. (e.g. if you assign a.href = "foo", then a.protocol, a.host, etc. will be empty.) We - * work around that by performing the parsing in a 2nd step by taking a previously normalized - * URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the - * properties such as protocol, hostname, port, etc. - * - * References: - * http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement - * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html - * http://url.spec.whatwg.org/#urlutils - * https://github.com/angular/angular.js/pull/2902 - * http://james.padolsey.com/javascript/parsing-urls-with-the-dom/ - * - * @kind function - * @param {string} url The URL to be parsed. - * @description Normalizes and parses a URL. - * @returns {object} Returns the normalized URL as a dictionary. - * - * | member name | Description | - * |---------------|----------------| - * | href | A normalized version of the provided URL if it was not an absolute URL | - * | protocol | The protocol including the trailing colon | - * | host | The host and port (if the port is non-default) of the normalizedUrl | - * | search | The search params, minus the question mark | - * | hash | The hash string, minus the hash symbol - * | hostname | The hostname - * | port | The port, without ":" - * | pathname | The pathname, beginning with "/" - * - */ - function urlResolve(url) { - var href = url; - - // Support: IE 9-11 only - if (msie) { - // Normalize before parse. Refer Implementation Notes on why this is - // done in two steps on IE. - urlParsingNode.setAttribute('href', href); - href = urlParsingNode.href; - } - - urlParsingNode.setAttribute('href', href); - - // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils - return { - href: urlParsingNode.href, - protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', - host: urlParsingNode.host, - search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', - hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', - hostname: urlParsingNode.hostname, - port: urlParsingNode.port, - pathname: (urlParsingNode.pathname.charAt(0) === '/') - ? urlParsingNode.pathname - : '/' + urlParsingNode.pathname - }; - } - - /** - * Parse a request URL and determine whether this is a same-origin request as the application document. - * - * @param {string|object} requestUrl The url of the request as a string that will be resolved - * or a parsed URL object. - * @returns {boolean} Whether the request is for the same origin as the application document. - */ - function urlIsSameOrigin(requestUrl) { - var parsed = (isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl; - return (parsed.protocol === originUrl.protocol && - parsed.host === originUrl.host); - } - - /** - * @ngdoc service - * @name $window - * @this - * - * @description - * A reference to the browser's `window` object. While `window` - * is globally available in JavaScript, it causes testability problems, because - * it is a global variable. In AngularJS we always refer to it through the - * `$window` service, so it may be overridden, removed or mocked for testing. - * - * Expressions, like the one defined for the `ngClick` directive in the example - * below, are evaluated with respect to the current scope. Therefore, there is - * no risk of inadvertently coding in a dependency on a global value in such an - * expression. - * - * @example - - - -
    - - -
    -
    - - it('should display the greeting in the input box', function() { - element(by.model('greeting')).sendKeys('Hello, E2E Tests'); - // If we click the button it will block the test runner - // element(':button').click(); - }); - -
    - */ - function $WindowProvider() { - this.$get = valueFn(window); - } - - /** - * @name $$cookieReader - * @requires $document - * - * @description - * This is a private service for reading cookies used by $http and ngCookies - * - * @return {Object} a key/value map of the current cookies - */ - function $$CookieReader($document) { - var rawDocument = $document[0] || {}; - var lastCookies = {}; - var lastCookieString = ''; - - function safeGetCookie(rawDocument) { - try { - return rawDocument.cookie || ''; - } catch (e) { - return ''; - } - } - - function safeDecodeURIComponent(str) { - try { - return decodeURIComponent(str); - } catch (e) { - return str; - } - } - - return function() { - var cookieArray, cookie, i, index, name; - var currentCookieString = safeGetCookie(rawDocument); - - if (currentCookieString !== lastCookieString) { - lastCookieString = currentCookieString; - cookieArray = lastCookieString.split('; '); - lastCookies = {}; - - for (i = 0; i < cookieArray.length; i++) { - cookie = cookieArray[i]; - index = cookie.indexOf('='); - if (index > 0) { //ignore nameless cookies - name = safeDecodeURIComponent(cookie.substring(0, index)); - // the first value that is seen for a cookie is the most - // specific one. values for the same cookie name that - // follow are for less specific paths. - if (isUndefined(lastCookies[name])) { - lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1)); - } - } - } - } - return lastCookies; - }; - } - - $$CookieReader.$inject = ['$document']; - - /** @this */ - function $$CookieReaderProvider() { - this.$get = $$CookieReader; - } - - /* global currencyFilter: true, - dateFilter: true, - filterFilter: true, - jsonFilter: true, - limitToFilter: true, - lowercaseFilter: true, - numberFilter: true, - orderByFilter: true, - uppercaseFilter: true, - */ - - /** - * @ngdoc provider - * @name $filterProvider - * @description - * - * Filters are just functions which transform input to an output. However filters need to be - * Dependency Injected. To achieve this a filter definition consists of a factory function which is - * annotated with dependencies and is responsible for creating a filter function. - * - *
    - * **Note:** Filter names must be valid AngularJS {@link expression} identifiers, such as `uppercase` or `orderBy`. - * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace - * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores - * (`myapp_subsection_filterx`). - *
    - * - * ```js - * // Filter registration - * function MyModule($provide, $filterProvider) { - * // create a service to demonstrate injection (not always needed) - * $provide.value('greet', function(name){ - * return 'Hello ' + name + '!'; - * }); - * - * // register a filter factory which uses the - * // greet service to demonstrate DI. - * $filterProvider.register('greet', function(greet){ - * // return the filter function which uses the greet service - * // to generate salutation - * return function(text) { - * // filters need to be forgiving so check input validity - * return text && greet(text) || text; - * }; - * }); - * } - * ``` - * - * The filter function is registered with the `$injector` under the filter name suffix with - * `Filter`. - * - * ```js - * it('should be the same instance', inject( - * function($filterProvider) { - * $filterProvider.register('reverse', function(){ - * return ...; - * }); - * }, - * function($filter, reverseFilter) { - * expect($filter('reverse')).toBe(reverseFilter); - * }); - * ``` - * - * - * For more information about how AngularJS filters work, and how to create your own filters, see - * {@link guide/filter Filters} in the AngularJS Developer Guide. - */ - - /** - * @ngdoc service - * @name $filter - * @kind function - * @description - * Filters are used for formatting data displayed to the user. - * - * They can be used in view templates, controllers or services. AngularJS comes - * with a collection of [built-in filters](api/ng/filter), but it is easy to - * define your own as well. - * - * The general syntax in templates is as follows: - * - * ```html - * {{ expression [| filter_name[:parameter_value] ... ] }} - * ``` - * - * @param {String} name Name of the filter function to retrieve - * @return {Function} the filter function - * @example - - -
    -

    {{ originalText }}

    -

    {{ filteredText }}

    -
    -
    - - - angular.module('filterExample', []) - .controller('MainCtrl', function($scope, $filter) { - $scope.originalText = 'hello'; - $scope.filteredText = $filter('uppercase')($scope.originalText); - }); - -
    - */ - $FilterProvider.$inject = ['$provide']; - /** @this */ - function $FilterProvider($provide) { - var suffix = 'Filter'; - - /** - * @ngdoc method - * @name $filterProvider#register - * @param {string|Object} name Name of the filter function, or an object map of filters where - * the keys are the filter names and the values are the filter factories. - * - *
    - * **Note:** Filter names must be valid AngularJS {@link expression} identifiers, such as `uppercase` or `orderBy`. - * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace - * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores - * (`myapp_subsection_filterx`). - *
    - * @param {Function} factory If the first argument was a string, a factory function for the filter to be registered. - * @returns {Object} Registered filter instance, or if a map of filters was provided then a map - * of the registered filter instances. - */ - function register(name, factory) { - if (isObject(name)) { - var filters = {}; - forEach(name, function(filter, key) { - filters[key] = register(key, filter); - }); - return filters; - } else { - return $provide.factory(name + suffix, factory); - } - } - this.register = register; - - this.$get = ['$injector', function($injector) { - return function(name) { - return $injector.get(name + suffix); - }; - }]; - - //////////////////////////////////////// - - /* global - currencyFilter: false, - dateFilter: false, - filterFilter: false, - jsonFilter: false, - limitToFilter: false, - lowercaseFilter: false, - numberFilter: false, - orderByFilter: false, - uppercaseFilter: false - */ - - register('currency', currencyFilter); - register('date', dateFilter); - register('filter', filterFilter); - register('json', jsonFilter); - register('limitTo', limitToFilter); - register('lowercase', lowercaseFilter); - register('number', numberFilter); - register('orderBy', orderByFilter); - register('uppercase', uppercaseFilter); - } - - /** - * @ngdoc filter - * @name filter - * @kind function - * - * @description - * Selects a subset of items from `array` and returns it as a new array. - * - * @param {Array} array The source array. - *
    - * **Note**: If the array contains objects that reference themselves, filtering is not possible. - *
    - * @param {string|Object|function()} expression The predicate to be used for selecting items from - * `array`. - * - * Can be one of: - * - * - `string`: The string is used for matching against the contents of the `array`. All strings or - * objects with string properties in `array` that match this string will be returned. This also - * applies to nested object properties. - * The predicate can be negated by prefixing the string with `!`. - * - * - `Object`: A pattern object can be used to filter specific properties on objects contained - * by `array`. For example `{name:"M", phone:"1"}` predicate will return an array of items - * which have property `name` containing "M" and property `phone` containing "1". A special - * property name (`$` by default) can be used (e.g. as in `{$: "text"}`) to accept a match - * against any property of the object or its nested object properties. That's equivalent to the - * simple substring match with a `string` as described above. The special property name can be - * overwritten, using the `anyPropertyKey` parameter. - * The predicate can be negated by prefixing the string with `!`. - * For example `{name: "!M"}` predicate will return an array of items which have property `name` - * not containing "M". - * - * Note that a named property will match properties on the same level only, while the special - * `$` property will match properties on the same level or deeper. E.g. an array item like - * `{name: {first: 'John', last: 'Doe'}}` will **not** be matched by `{name: 'John'}`, but - * **will** be matched by `{$: 'John'}`. - * - * - `function(value, index, array)`: A predicate function can be used to write arbitrary filters. - * The function is called for each element of the array, with the element, its index, and - * the entire array itself as arguments. - * - * The final result is an array of those elements that the predicate returned true for. - * - * @param {function(actual, expected)|true|false} [comparator] Comparator which is used in - * determining if values retrieved using `expression` (when it is not a function) should be - * considered a match based on the expected value (from the filter expression) and actual - * value (from the object in the array). - * - * Can be one of: - * - * - `function(actual, expected)`: - * The function will be given the object value and the predicate value to compare and - * should return true if both values should be considered equal. - * - * - `true`: A shorthand for `function(actual, expected) { return angular.equals(actual, expected)}`. - * This is essentially strict comparison of expected and actual. - * - * - `false`: A short hand for a function which will look for a substring match in a case - * insensitive way. Primitive values are converted to strings. Objects are not compared against - * primitives, unless they have a custom `toString` method (e.g. `Date` objects). - * - * - * Defaults to `false`. - * - * @param {string} [anyPropertyKey] The special property name that matches against any property. - * By default `$`. - * - * @example - - -
    - - - - - - - - -
    NamePhone
    {{friend.name}}{{friend.phone}}
    -
    -
    -
    -
    -
    - - - - - - -
    NamePhone
    {{friendObj.name}}{{friendObj.phone}}
    -
    - - var expectFriendNames = function(expectedNames, key) { - element.all(by.repeater(key + ' in friends').column(key + '.name')).then(function(arr) { - arr.forEach(function(wd, i) { - expect(wd.getText()).toMatch(expectedNames[i]); - }); - }); - }; - - it('should search across all fields when filtering with a string', function() { - var searchText = element(by.model('searchText')); - searchText.clear(); - searchText.sendKeys('m'); - expectFriendNames(['Mary', 'Mike', 'Adam'], 'friend'); - - searchText.clear(); - searchText.sendKeys('76'); - expectFriendNames(['John', 'Julie'], 'friend'); - }); - - it('should search in specific fields when filtering with a predicate object', function() { - var searchAny = element(by.model('search.$')); - searchAny.clear(); - searchAny.sendKeys('i'); - expectFriendNames(['Mary', 'Mike', 'Julie', 'Juliette'], 'friendObj'); - }); - it('should use a equal comparison when comparator is true', function() { - var searchName = element(by.model('search.name')); - var strict = element(by.model('strict')); - searchName.clear(); - searchName.sendKeys('Julie'); - strict.click(); - expectFriendNames(['Julie'], 'friendObj'); - }); - -
    - */ - - function filterFilter() { - return function(array, expression, comparator, anyPropertyKey) { - if (!isArrayLike(array)) { - if (array == null) { - return array; - } else { - throw minErr('filter')('notarray', 'Expected array but received: {0}', array); - } - } - - anyPropertyKey = anyPropertyKey || '$'; - var expressionType = getTypeForFilter(expression); - var predicateFn; - var matchAgainstAnyProp; - - switch (expressionType) { - case 'function': - predicateFn = expression; - break; - case 'boolean': - case 'null': - case 'number': - case 'string': - matchAgainstAnyProp = true; - // falls through - case 'object': - predicateFn = createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp); - break; - default: - return array; - } - - return Array.prototype.filter.call(array, predicateFn); - }; - } - -// Helper functions for `filterFilter` - function createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) { - var shouldMatchPrimitives = isObject(expression) && (anyPropertyKey in expression); - var predicateFn; - - if (comparator === true) { - comparator = equals; - } else if (!isFunction(comparator)) { - comparator = function(actual, expected) { - if (isUndefined(actual)) { - // No substring matching against `undefined` - return false; - } - if ((actual === null) || (expected === null)) { - // No substring matching against `null`; only match against `null` - return actual === expected; - } - if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) { - // Should not compare primitives against objects, unless they have custom `toString` method - return false; - } - - actual = lowercase('' + actual); - expected = lowercase('' + expected); - return actual.indexOf(expected) !== -1; - }; - } - - predicateFn = function(item) { - if (shouldMatchPrimitives && !isObject(item)) { - return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false); - } - return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp); - }; - - return predicateFn; - } - - function deepCompare(actual, expected, comparator, anyPropertyKey, matchAgainstAnyProp, dontMatchWholeObject) { - var actualType = getTypeForFilter(actual); - var expectedType = getTypeForFilter(expected); - - if ((expectedType === 'string') && (expected.charAt(0) === '!')) { - return !deepCompare(actual, expected.substring(1), comparator, anyPropertyKey, matchAgainstAnyProp); - } else if (isArray(actual)) { - // In case `actual` is an array, consider it a match - // if ANY of it's items matches `expected` - return actual.some(function(item) { - return deepCompare(item, expected, comparator, anyPropertyKey, matchAgainstAnyProp); - }); - } - - switch (actualType) { - case 'object': - var key; - if (matchAgainstAnyProp) { - for (key in actual) { - // Under certain, rare, circumstances, key may not be a string and `charAt` will be undefined - // See: https://github.com/angular/angular.js/issues/15644 - if (key.charAt && (key.charAt(0) !== '$') && - deepCompare(actual[key], expected, comparator, anyPropertyKey, true)) { - return true; - } - } - return dontMatchWholeObject ? false : deepCompare(actual, expected, comparator, anyPropertyKey, false); - } else if (expectedType === 'object') { - for (key in expected) { - var expectedVal = expected[key]; - if (isFunction(expectedVal) || isUndefined(expectedVal)) { - continue; - } - - var matchAnyProperty = key === anyPropertyKey; - var actualVal = matchAnyProperty ? actual : actual[key]; - if (!deepCompare(actualVal, expectedVal, comparator, anyPropertyKey, matchAnyProperty, matchAnyProperty)) { - return false; - } - } - return true; - } else { - return comparator(actual, expected); - } - case 'function': - return false; - default: - return comparator(actual, expected); - } - } - -// Used for easily differentiating between `null` and actual `object` - function getTypeForFilter(val) { - return (val === null) ? 'null' : typeof val; - } - - var MAX_DIGITS = 22; - var DECIMAL_SEP = '.'; - var ZERO_CHAR = '0'; - - /** - * @ngdoc filter - * @name currency - * @kind function - * - * @description - * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default - * symbol for current locale is used. - * - * @param {number} amount Input to filter. - * @param {string=} symbol Currency symbol or identifier to be displayed. - * @param {number=} fractionSize Number of decimal places to round the amount to, defaults to default max fraction size for current locale - * @returns {string} Formatted number. - * - * - * @example - - - -
    -
    - default currency symbol ($): {{amount | currency}}
    - custom currency identifier (USD$): {{amount | currency:"USD$"}}
    - no fractions (0): {{amount | currency:"USD$":0}} -
    -
    - - it('should init with 1234.56', function() { - expect(element(by.id('currency-default')).getText()).toBe('$1,234.56'); - expect(element(by.id('currency-custom')).getText()).toBe('USD$1,234.56'); - expect(element(by.id('currency-no-fractions')).getText()).toBe('USD$1,235'); - }); - it('should update', function() { - if (browser.params.browser === 'safari') { - // Safari does not understand the minus key. See - // https://github.com/angular/protractor/issues/481 - return; - } - element(by.model('amount')).clear(); - element(by.model('amount')).sendKeys('-1234'); - expect(element(by.id('currency-default')).getText()).toBe('-$1,234.00'); - expect(element(by.id('currency-custom')).getText()).toBe('-USD$1,234.00'); - expect(element(by.id('currency-no-fractions')).getText()).toBe('-USD$1,234'); - }); - -
    - */ - currencyFilter.$inject = ['$locale']; - function currencyFilter($locale) { - var formats = $locale.NUMBER_FORMATS; - return function(amount, currencySymbol, fractionSize) { - if (isUndefined(currencySymbol)) { - currencySymbol = formats.CURRENCY_SYM; - } - - if (isUndefined(fractionSize)) { - fractionSize = formats.PATTERNS[1].maxFrac; - } - - // If the currency symbol is empty, trim whitespace around the symbol - var currencySymbolRe = !currencySymbol ? /\s*\u00A4\s*/g : /\u00A4/g; - - // if null or undefined pass it through - return (amount == null) - ? amount - : formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize). - replace(currencySymbolRe, currencySymbol); - }; - } - - /** - * @ngdoc filter - * @name number - * @kind function - * - * @description - * Formats a number as text. - * - * If the input is null or undefined, it will just be returned. - * If the input is infinite (Infinity or -Infinity), the Infinity symbol '∞' or '-∞' is returned, respectively. - * If the input is not a number an empty string is returned. - * - * - * @param {number|string} number Number to format. - * @param {(number|string)=} fractionSize Number of decimal places to round the number to. - * If this is not provided then the fraction size is computed from the current locale's number - * formatting pattern. In the case of the default locale, it will be 3. - * @returns {string} Number rounded to `fractionSize` appropriately formatted based on the current - * locale (e.g., in the en_US locale it will have "." as the decimal separator and - * include "," group separators after each third digit). - * - * @example - - - -
    -
    - Default formatting: {{val | number}}
    - No fractions: {{val | number:0}}
    - Negative number: {{-val | number:4}} -
    -
    - - it('should format numbers', function() { - expect(element(by.id('number-default')).getText()).toBe('1,234.568'); - expect(element(by.binding('val | number:0')).getText()).toBe('1,235'); - expect(element(by.binding('-val | number:4')).getText()).toBe('-1,234.5679'); - }); - - it('should update', function() { - element(by.model('val')).clear(); - element(by.model('val')).sendKeys('3374.333'); - expect(element(by.id('number-default')).getText()).toBe('3,374.333'); - expect(element(by.binding('val | number:0')).getText()).toBe('3,374'); - expect(element(by.binding('-val | number:4')).getText()).toBe('-3,374.3330'); - }); - -
    - */ - numberFilter.$inject = ['$locale']; - function numberFilter($locale) { - var formats = $locale.NUMBER_FORMATS; - return function(number, fractionSize) { - - // if null or undefined pass it through - return (number == null) - ? number - : formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP, - fractionSize); - }; - } - - /** - * Parse a number (as a string) into three components that can be used - * for formatting the number. - * - * (Significant bits of this parse algorithm came from https://github.com/MikeMcl/big.js/) - * - * @param {string} numStr The number to parse - * @return {object} An object describing this number, containing the following keys: - * - d : an array of digits containing leading zeros as necessary - * - i : the number of the digits in `d` that are to the left of the decimal point - * - e : the exponent for numbers that would need more than `MAX_DIGITS` digits in `d` - * - */ - function parse(numStr) { - var exponent = 0, digits, numberOfIntegerDigits; - var i, j, zeros; - - // Decimal point? - if ((numberOfIntegerDigits = numStr.indexOf(DECIMAL_SEP)) > -1) { - numStr = numStr.replace(DECIMAL_SEP, ''); - } - - // Exponential form? - if ((i = numStr.search(/e/i)) > 0) { - // Work out the exponent. - if (numberOfIntegerDigits < 0) numberOfIntegerDigits = i; - numberOfIntegerDigits += +numStr.slice(i + 1); - numStr = numStr.substring(0, i); - } else if (numberOfIntegerDigits < 0) { - // There was no decimal point or exponent so it is an integer. - numberOfIntegerDigits = numStr.length; - } - - // Count the number of leading zeros. - for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) { /* empty */ } - - if (i === (zeros = numStr.length)) { - // The digits are all zero. - digits = [0]; - numberOfIntegerDigits = 1; - } else { - // Count the number of trailing zeros - zeros--; - while (numStr.charAt(zeros) === ZERO_CHAR) zeros--; - - // Trailing zeros are insignificant so ignore them - numberOfIntegerDigits -= i; - digits = []; - // Convert string to array of digits without leading/trailing zeros. - for (j = 0; i <= zeros; i++, j++) { - digits[j] = +numStr.charAt(i); - } - } - - // If the number overflows the maximum allowed digits then use an exponent. - if (numberOfIntegerDigits > MAX_DIGITS) { - digits = digits.splice(0, MAX_DIGITS - 1); - exponent = numberOfIntegerDigits - 1; - numberOfIntegerDigits = 1; - } - - return { d: digits, e: exponent, i: numberOfIntegerDigits }; - } - - /** - * Round the parsed number to the specified number of decimal places - * This function changed the parsedNumber in-place - */ - function roundNumber(parsedNumber, fractionSize, minFrac, maxFrac) { - var digits = parsedNumber.d; - var fractionLen = digits.length - parsedNumber.i; - - // determine fractionSize if it is not specified; `+fractionSize` converts it to a number - fractionSize = (isUndefined(fractionSize)) ? Math.min(Math.max(minFrac, fractionLen), maxFrac) : +fractionSize; - - // The index of the digit to where rounding is to occur - var roundAt = fractionSize + parsedNumber.i; - var digit = digits[roundAt]; - - if (roundAt > 0) { - // Drop fractional digits beyond `roundAt` - digits.splice(Math.max(parsedNumber.i, roundAt)); - - // Set non-fractional digits beyond `roundAt` to 0 - for (var j = roundAt; j < digits.length; j++) { - digits[j] = 0; - } - } else { - // We rounded to zero so reset the parsedNumber - fractionLen = Math.max(0, fractionLen); - parsedNumber.i = 1; - digits.length = Math.max(1, roundAt = fractionSize + 1); - digits[0] = 0; - for (var i = 1; i < roundAt; i++) digits[i] = 0; - } - - if (digit >= 5) { - if (roundAt - 1 < 0) { - for (var k = 0; k > roundAt; k--) { - digits.unshift(0); - parsedNumber.i++; - } - digits.unshift(1); - parsedNumber.i++; - } else { - digits[roundAt - 1]++; - } - } - - // Pad out with zeros to get the required fraction length - for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0); - - - // Do any carrying, e.g. a digit was rounded up to 10 - var carry = digits.reduceRight(function(carry, d, i, digits) { - d = d + carry; - digits[i] = d % 10; - return Math.floor(d / 10); - }, 0); - if (carry) { - digits.unshift(carry); - parsedNumber.i++; - } - } - - /** - * Format a number into a string - * @param {number} number The number to format - * @param {{ - * minFrac, // the minimum number of digits required in the fraction part of the number - * maxFrac, // the maximum number of digits required in the fraction part of the number - * gSize, // number of digits in each group of separated digits - * lgSize, // number of digits in the last group of digits before the decimal separator - * negPre, // the string to go in front of a negative number (e.g. `-` or `(`)) - * posPre, // the string to go in front of a positive number - * negSuf, // the string to go after a negative number (e.g. `)`) - * posSuf // the string to go after a positive number - * }} pattern - * @param {string} groupSep The string to separate groups of number (e.g. `,`) - * @param {string} decimalSep The string to act as the decimal separator (e.g. `.`) - * @param {[type]} fractionSize The size of the fractional part of the number - * @return {string} The number formatted as a string - */ - function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) { - - if (!(isString(number) || isNumber(number)) || isNaN(number)) return ''; - - var isInfinity = !isFinite(number); - var isZero = false; - var numStr = Math.abs(number) + '', - formattedText = '', - parsedNumber; - - if (isInfinity) { - formattedText = '\u221e'; - } else { - parsedNumber = parse(numStr); - - roundNumber(parsedNumber, fractionSize, pattern.minFrac, pattern.maxFrac); - - var digits = parsedNumber.d; - var integerLen = parsedNumber.i; - var exponent = parsedNumber.e; - var decimals = []; - isZero = digits.reduce(function(isZero, d) { return isZero && !d; }, true); - - // pad zeros for small numbers - while (integerLen < 0) { - digits.unshift(0); - integerLen++; - } - - // extract decimals digits - if (integerLen > 0) { - decimals = digits.splice(integerLen, digits.length); - } else { - decimals = digits; - digits = [0]; - } - - // format the integer digits with grouping separators - var groups = []; - if (digits.length >= pattern.lgSize) { - groups.unshift(digits.splice(-pattern.lgSize, digits.length).join('')); - } - while (digits.length > pattern.gSize) { - groups.unshift(digits.splice(-pattern.gSize, digits.length).join('')); - } - if (digits.length) { - groups.unshift(digits.join('')); - } - formattedText = groups.join(groupSep); - - // append the decimal digits - if (decimals.length) { - formattedText += decimalSep + decimals.join(''); - } - - if (exponent) { - formattedText += 'e+' + exponent; - } - } - if (number < 0 && !isZero) { - return pattern.negPre + formattedText + pattern.negSuf; - } else { - return pattern.posPre + formattedText + pattern.posSuf; - } - } - - function padNumber(num, digits, trim, negWrap) { - var neg = ''; - if (num < 0 || (negWrap && num <= 0)) { - if (negWrap) { - num = -num + 1; - } else { - num = -num; - neg = '-'; - } - } - num = '' + num; - while (num.length < digits) num = ZERO_CHAR + num; - if (trim) { - num = num.substr(num.length - digits); - } - return neg + num; - } - - - function dateGetter(name, size, offset, trim, negWrap) { - offset = offset || 0; - return function(date) { - var value = date['get' + name](); - if (offset > 0 || value > -offset) { - value += offset; - } - if (value === 0 && offset === -12) value = 12; - return padNumber(value, size, trim, negWrap); - }; - } - - function dateStrGetter(name, shortForm, standAlone) { - return function(date, formats) { - var value = date['get' + name](); - var propPrefix = (standAlone ? 'STANDALONE' : '') + (shortForm ? 'SHORT' : ''); - var get = uppercase(propPrefix + name); - - return formats[get][value]; - }; - } - - function timeZoneGetter(date, formats, offset) { - var zone = -1 * offset; - var paddedZone = (zone >= 0) ? '+' : ''; - - paddedZone += padNumber(Math[zone > 0 ? 'floor' : 'ceil'](zone / 60), 2) + - padNumber(Math.abs(zone % 60), 2); - - return paddedZone; - } - - function getFirstThursdayOfYear(year) { - // 0 = index of January - var dayOfWeekOnFirst = (new Date(year, 0, 1)).getDay(); - // 4 = index of Thursday (+1 to account for 1st = 5) - // 11 = index of *next* Thursday (+1 account for 1st = 12) - return new Date(year, 0, ((dayOfWeekOnFirst <= 4) ? 5 : 12) - dayOfWeekOnFirst); - } - - function getThursdayThisWeek(datetime) { - return new Date(datetime.getFullYear(), datetime.getMonth(), - // 4 = index of Thursday - datetime.getDate() + (4 - datetime.getDay())); - } - - function weekGetter(size) { - return function(date) { - var firstThurs = getFirstThursdayOfYear(date.getFullYear()), - thisThurs = getThursdayThisWeek(date); - - var diff = +thisThurs - +firstThurs, - result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week - - return padNumber(result, size); - }; - } - - function ampmGetter(date, formats) { - return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1]; - } - - function eraGetter(date, formats) { - return date.getFullYear() <= 0 ? formats.ERAS[0] : formats.ERAS[1]; - } - - function longEraGetter(date, formats) { - return date.getFullYear() <= 0 ? formats.ERANAMES[0] : formats.ERANAMES[1]; - } - - var DATE_FORMATS = { - yyyy: dateGetter('FullYear', 4, 0, false, true), - yy: dateGetter('FullYear', 2, 0, true, true), - y: dateGetter('FullYear', 1, 0, false, true), - MMMM: dateStrGetter('Month'), - MMM: dateStrGetter('Month', true), - MM: dateGetter('Month', 2, 1), - M: dateGetter('Month', 1, 1), - LLLL: dateStrGetter('Month', false, true), - dd: dateGetter('Date', 2), - d: dateGetter('Date', 1), - HH: dateGetter('Hours', 2), - H: dateGetter('Hours', 1), - hh: dateGetter('Hours', 2, -12), - h: dateGetter('Hours', 1, -12), - mm: dateGetter('Minutes', 2), - m: dateGetter('Minutes', 1), - ss: dateGetter('Seconds', 2), - s: dateGetter('Seconds', 1), - // while ISO 8601 requires fractions to be prefixed with `.` or `,` - // we can be just safely rely on using `sss` since we currently don't support single or two digit fractions - sss: dateGetter('Milliseconds', 3), - EEEE: dateStrGetter('Day'), - EEE: dateStrGetter('Day', true), - a: ampmGetter, - Z: timeZoneGetter, - ww: weekGetter(2), - w: weekGetter(1), - G: eraGetter, - GG: eraGetter, - GGG: eraGetter, - GGGG: longEraGetter - }; - - var DATE_FORMATS_SPLIT = /((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\s\S]*)/, - NUMBER_STRING = /^-?\d+$/; - - /** - * @ngdoc filter - * @name date - * @kind function - * - * @description - * Formats `date` to a string based on the requested `format`. - * - * `format` string can be composed of the following elements: - * - * * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010) - * * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10) - * * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199) - * * `'MMMM'`: Month in year (January-December) - * * `'MMM'`: Month in year (Jan-Dec) - * * `'MM'`: Month in year, padded (01-12) - * * `'M'`: Month in year (1-12) - * * `'LLLL'`: Stand-alone month in year (January-December) - * * `'dd'`: Day in month, padded (01-31) - * * `'d'`: Day in month (1-31) - * * `'EEEE'`: Day in Week,(Sunday-Saturday) - * * `'EEE'`: Day in Week, (Sun-Sat) - * * `'HH'`: Hour in day, padded (00-23) - * * `'H'`: Hour in day (0-23) - * * `'hh'`: Hour in AM/PM, padded (01-12) - * * `'h'`: Hour in AM/PM, (1-12) - * * `'mm'`: Minute in hour, padded (00-59) - * * `'m'`: Minute in hour (0-59) - * * `'ss'`: Second in minute, padded (00-59) - * * `'s'`: Second in minute (0-59) - * * `'sss'`: Millisecond in second, padded (000-999) - * * `'a'`: AM/PM marker - * * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-+1200) - * * `'ww'`: Week of year, padded (00-53). Week 01 is the week with the first Thursday of the year - * * `'w'`: Week of year (0-53). Week 1 is the week with the first Thursday of the year - * * `'G'`, `'GG'`, `'GGG'`: The abbreviated form of the era string (e.g. 'AD') - * * `'GGGG'`: The long form of the era string (e.g. 'Anno Domini') - * - * `format` string can also be one of the following predefined - * {@link guide/i18n localizable formats}: - * - * * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale - * (e.g. Sep 3, 2010 12:05:08 PM) - * * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US locale (e.g. 9/3/10 12:05 PM) - * * `'fullDate'`: equivalent to `'EEEE, MMMM d, y'` for en_US locale - * (e.g. Friday, September 3, 2010) - * * `'longDate'`: equivalent to `'MMMM d, y'` for en_US locale (e.g. September 3, 2010) - * * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US locale (e.g. Sep 3, 2010) - * * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10) - * * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 PM) - * * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 PM) - * - * `format` string can contain literal values. These need to be escaped by surrounding with single quotes (e.g. - * `"h 'in the morning'"`). In order to output a single quote, escape it - i.e., two single quotes in a sequence - * (e.g. `"h 'o''clock'"`). - * - * Any other characters in the `format` string will be output as-is. - * - * @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or - * number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its - * shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is - * specified in the string input, the time is considered to be in the local timezone. - * @param {string=} format Formatting rules (see Description). If not specified, - * `mediumDate` is used. - * @param {string=} timezone Timezone to be used for formatting. It understands UTC/GMT and the - * continental US time zone abbreviations, but for general use, use a time zone offset, for - * example, `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian) - * If not specified, the timezone of the browser will be used. - * @returns {string} Formatted string or the input if input is not recognized as date/millis. - * - * @example - - - {{1288323623006 | date:'medium'}}: - {{1288323623006 | date:'medium'}}
    - {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}: - {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}
    - {{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}: - {{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}
    - {{1288323623006 | date:"MM/dd/yyyy 'at' h:mma"}}: - {{'1288323623006' | date:"MM/dd/yyyy 'at' h:mma"}}
    -
    - - it('should format date', function() { - expect(element(by.binding("1288323623006 | date:'medium'")).getText()). - toMatch(/Oct 2\d, 2010 \d{1,2}:\d{2}:\d{2} (AM|PM)/); - expect(element(by.binding("1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'")).getText()). - toMatch(/2010-10-2\d \d{2}:\d{2}:\d{2} (-|\+)?\d{4}/); - expect(element(by.binding("'1288323623006' | date:'MM/dd/yyyy @ h:mma'")).getText()). - toMatch(/10\/2\d\/2010 @ \d{1,2}:\d{2}(AM|PM)/); - expect(element(by.binding("'1288323623006' | date:\"MM/dd/yyyy 'at' h:mma\"")).getText()). - toMatch(/10\/2\d\/2010 at \d{1,2}:\d{2}(AM|PM)/); - }); - -
    - */ - dateFilter.$inject = ['$locale']; - function dateFilter($locale) { - - - var R_ISO8601_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/; - // 1 2 3 4 5 6 7 8 9 10 11 - function jsonStringToDate(string) { - var match; - if ((match = string.match(R_ISO8601_STR))) { - var date = new Date(0), - tzHour = 0, - tzMin = 0, - dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear, - timeSetter = match[8] ? date.setUTCHours : date.setHours; - - if (match[9]) { - tzHour = toInt(match[9] + match[10]); - tzMin = toInt(match[9] + match[11]); - } - dateSetter.call(date, toInt(match[1]), toInt(match[2]) - 1, toInt(match[3])); - var h = toInt(match[4] || 0) - tzHour; - var m = toInt(match[5] || 0) - tzMin; - var s = toInt(match[6] || 0); - var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000); - timeSetter.call(date, h, m, s, ms); - return date; - } - return string; - } - - - return function(date, format, timezone) { - var text = '', - parts = [], - fn, match; - - format = format || 'mediumDate'; - format = $locale.DATETIME_FORMATS[format] || format; - if (isString(date)) { - date = NUMBER_STRING.test(date) ? toInt(date) : jsonStringToDate(date); - } - - if (isNumber(date)) { - date = new Date(date); - } - - if (!isDate(date) || !isFinite(date.getTime())) { - return date; - } - - while (format) { - match = DATE_FORMATS_SPLIT.exec(format); - if (match) { - parts = concat(parts, match, 1); - format = parts.pop(); - } else { - parts.push(format); - format = null; - } - } - - var dateTimezoneOffset = date.getTimezoneOffset(); - if (timezone) { - dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset); - date = convertTimezoneToLocal(date, timezone, true); - } - forEach(parts, function(value) { - fn = DATE_FORMATS[value]; - text += fn ? fn(date, $locale.DATETIME_FORMATS, dateTimezoneOffset) - : value === '\'\'' ? '\'' : value.replace(/(^'|'$)/g, '').replace(/''/g, '\''); - }); - - return text; - }; - } - - - /** - * @ngdoc filter - * @name json - * @kind function - * - * @description - * Allows you to convert a JavaScript object into JSON string. - * - * This filter is mostly useful for debugging. When using the double curly {{value}} notation - * the binding is automatically converted to JSON. - * - * @param {*} object Any JavaScript object (including arrays and primitive types) to filter. - * @param {number=} spacing The number of spaces to use per indentation, defaults to 2. - * @returns {string} JSON string. - * - * - * @example - - -
    {{ {'name':'value'} | json }}
    -
    {{ {'name':'value'} | json:4 }}
    -
    - - it('should jsonify filtered objects', function() { - expect(element(by.id('default-spacing')).getText()).toMatch(/\{\n {2}"name": ?"value"\n}/); - expect(element(by.id('custom-spacing')).getText()).toMatch(/\{\n {4}"name": ?"value"\n}/); - }); - -
    - * - */ - function jsonFilter() { - return function(object, spacing) { - if (isUndefined(spacing)) { - spacing = 2; - } - return toJson(object, spacing); - }; - } - - - /** - * @ngdoc filter - * @name lowercase - * @kind function - * @description - * Converts string to lowercase. - * - * See the {@link ng.uppercase uppercase filter documentation} for a functionally identical example. - * - * @see angular.lowercase - */ - var lowercaseFilter = valueFn(lowercase); - - - /** - * @ngdoc filter - * @name uppercase - * @kind function - * @description - * Converts string to uppercase. - * @example - - - -
    - -

    {{title}}

    - -

    {{title | uppercase}}

    -
    -
    -
    - */ - var uppercaseFilter = valueFn(uppercase); - - /** - * @ngdoc filter - * @name limitTo - * @kind function - * - * @description - * Creates a new array or string containing only a specified number of elements. The elements are - * taken from either the beginning or the end of the source array, string or number, as specified by - * the value and sign (positive or negative) of `limit`. Other array-like objects are also supported - * (e.g. array subclasses, NodeLists, jqLite/jQuery collections etc). If a number is used as input, - * it is converted to a string. - * - * @param {Array|ArrayLike|string|number} input - Array/array-like, string or number to be limited. - * @param {string|number} limit - The length of the returned array or string. If the `limit` number - * is positive, `limit` number of items from the beginning of the source array/string are copied. - * If the number is negative, `limit` number of items from the end of the source array/string - * are copied. The `limit` will be trimmed if it exceeds `array.length`. If `limit` is undefined, - * the input will be returned unchanged. - * @param {(string|number)=} begin - Index at which to begin limitation. As a negative index, - * `begin` indicates an offset from the end of `input`. Defaults to `0`. - * @returns {Array|string} A new sub-array or substring of length `limit` or less if the input had - * less than `limit` elements. - * - * @example - - - -
    - -

    Output numbers: {{ numbers | limitTo:numLimit }}

    - -

    Output letters: {{ letters | limitTo:letterLimit }}

    - -

    Output long number: {{ longNumber | limitTo:longNumberLimit }}

    -
    -
    - - var numLimitInput = element(by.model('numLimit')); - var letterLimitInput = element(by.model('letterLimit')); - var longNumberLimitInput = element(by.model('longNumberLimit')); - var limitedNumbers = element(by.binding('numbers | limitTo:numLimit')); - var limitedLetters = element(by.binding('letters | limitTo:letterLimit')); - var limitedLongNumber = element(by.binding('longNumber | limitTo:longNumberLimit')); - - it('should limit the number array to first three items', function() { - expect(numLimitInput.getAttribute('value')).toBe('3'); - expect(letterLimitInput.getAttribute('value')).toBe('3'); - expect(longNumberLimitInput.getAttribute('value')).toBe('3'); - expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3]'); - expect(limitedLetters.getText()).toEqual('Output letters: abc'); - expect(limitedLongNumber.getText()).toEqual('Output long number: 234'); - }); - - // There is a bug in safari and protractor that doesn't like the minus key - // it('should update the output when -3 is entered', function() { - // numLimitInput.clear(); - // numLimitInput.sendKeys('-3'); - // letterLimitInput.clear(); - // letterLimitInput.sendKeys('-3'); - // longNumberLimitInput.clear(); - // longNumberLimitInput.sendKeys('-3'); - // expect(limitedNumbers.getText()).toEqual('Output numbers: [7,8,9]'); - // expect(limitedLetters.getText()).toEqual('Output letters: ghi'); - // expect(limitedLongNumber.getText()).toEqual('Output long number: 342'); - // }); - - it('should not exceed the maximum size of input array', function() { - numLimitInput.clear(); - numLimitInput.sendKeys('100'); - letterLimitInput.clear(); - letterLimitInput.sendKeys('100'); - longNumberLimitInput.clear(); - longNumberLimitInput.sendKeys('100'); - expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3,4,5,6,7,8,9]'); - expect(limitedLetters.getText()).toEqual('Output letters: abcdefghi'); - expect(limitedLongNumber.getText()).toEqual('Output long number: 2345432342'); - }); - -
    - */ - function limitToFilter() { - return function(input, limit, begin) { - if (Math.abs(Number(limit)) === Infinity) { - limit = Number(limit); - } else { - limit = toInt(limit); - } - if (isNumberNaN(limit)) return input; - - if (isNumber(input)) input = input.toString(); - if (!isArrayLike(input)) return input; - - begin = (!begin || isNaN(begin)) ? 0 : toInt(begin); - begin = (begin < 0) ? Math.max(0, input.length + begin) : begin; - - if (limit >= 0) { - return sliceFn(input, begin, begin + limit); - } else { - if (begin === 0) { - return sliceFn(input, limit, input.length); - } else { - return sliceFn(input, Math.max(0, begin + limit), begin); - } - } - }; - } - - function sliceFn(input, begin, end) { - if (isString(input)) return input.slice(begin, end); - - return slice.call(input, begin, end); - } - - /** - * @ngdoc filter - * @name orderBy - * @kind function - * - * @description - * Returns an array containing the items from the specified `collection`, ordered by a `comparator` - * function based on the values computed using the `expression` predicate. - * - * For example, `[{id: 'foo'}, {id: 'bar'}] | orderBy:'id'` would result in - * `[{id: 'bar'}, {id: 'foo'}]`. - * - * The `collection` can be an Array or array-like object (e.g. NodeList, jQuery object, TypedArray, - * String, etc). - * - * The `expression` can be a single predicate, or a list of predicates each serving as a tie-breaker - * for the preceding one. The `expression` is evaluated against each item and the output is used - * for comparing with other items. - * - * You can change the sorting order by setting `reverse` to `true`. By default, items are sorted in - * ascending order. - * - * The comparison is done using the `comparator` function. If none is specified, a default, built-in - * comparator is used (see below for details - in a nutshell, it compares numbers numerically and - * strings alphabetically). - * - * ### Under the hood - * - * Ordering the specified `collection` happens in two phases: - * - * 1. All items are passed through the predicate (or predicates), and the returned values are saved - * along with their type (`string`, `number` etc). For example, an item `{label: 'foo'}`, passed - * through a predicate that extracts the value of the `label` property, would be transformed to: - * ``` - * { - * value: 'foo', - * type: 'string', - * index: ... - * } - * ``` - * 2. The comparator function is used to sort the items, based on the derived values, types and - * indices. - * - * If you use a custom comparator, it will be called with pairs of objects of the form - * `{value: ..., type: '...', index: ...}` and is expected to return `0` if the objects are equal - * (as far as the comparator is concerned), `-1` if the 1st one should be ranked higher than the - * second, or `1` otherwise. - * - * In order to ensure that the sorting will be deterministic across platforms, if none of the - * specified predicates can distinguish between two items, `orderBy` will automatically introduce a - * dummy predicate that returns the item's index as `value`. - * (If you are using a custom comparator, make sure it can handle this predicate as well.) - * - * If a custom comparator still can't distinguish between two items, then they will be sorted based - * on their index using the built-in comparator. - * - * Finally, in an attempt to simplify things, if a predicate returns an object as the extracted - * value for an item, `orderBy` will try to convert that object to a primitive value, before passing - * it to the comparator. The following rules govern the conversion: - * - * 1. If the object has a `valueOf()` method that returns a primitive, its return value will be - * used instead.
    - * (If the object has a `valueOf()` method that returns another object, then the returned object - * will be used in subsequent steps.) - * 2. If the object has a custom `toString()` method (i.e. not the one inherited from `Object`) that - * returns a primitive, its return value will be used instead.
    - * (If the object has a `toString()` method that returns another object, then the returned object - * will be used in subsequent steps.) - * 3. No conversion; the object itself is used. - * - * ### The default comparator - * - * The default, built-in comparator should be sufficient for most usecases. In short, it compares - * numbers numerically, strings alphabetically (and case-insensitively), for objects falls back to - * using their index in the original collection, and sorts values of different types by type. - * - * More specifically, it follows these steps to determine the relative order of items: - * - * 1. If the compared values are of different types, compare the types themselves alphabetically. - * 2. If both values are of type `string`, compare them alphabetically in a case- and - * locale-insensitive way. - * 3. If both values are objects, compare their indices instead. - * 4. Otherwise, return: - * - `0`, if the values are equal (by strict equality comparison, i.e. using `===`). - * - `-1`, if the 1st value is "less than" the 2nd value (compared using the `<` operator). - * - `1`, otherwise. - * - * **Note:** If you notice numbers not being sorted as expected, make sure they are actually being - * saved as numbers and not strings. - * **Note:** For the purpose of sorting, `null` values are treated as the string `'null'` (i.e. - * `type: 'string'`, `value: 'null'`). This may cause unexpected sort order relative to - * other values. - * - * @param {Array|ArrayLike} collection - The collection (array or array-like object) to sort. - * @param {(Function|string|Array.)=} expression - A predicate (or list of - * predicates) to be used by the comparator to determine the order of elements. - * - * Can be one of: - * - * - `Function`: A getter function. This function will be called with each item as argument and - * the return value will be used for sorting. - * - `string`: An AngularJS expression. This expression will be evaluated against each item and the - * result will be used for sorting. For example, use `'label'` to sort by a property called - * `label` or `'label.substring(0, 3)'` to sort by the first 3 characters of the `label` - * property.
    - * (The result of a constant expression is interpreted as a property name to be used for - * comparison. For example, use `'"special name"'` (note the extra pair of quotes) to sort by a - * property called `special name`.)
    - * An expression can be optionally prefixed with `+` or `-` to control the sorting direction, - * ascending or descending. For example, `'+label'` or `'-label'`. If no property is provided, - * (e.g. `'+'` or `'-'`), the collection element itself is used in comparisons. - * - `Array`: An array of function and/or string predicates. If a predicate cannot determine the - * relative order of two items, the next predicate is used as a tie-breaker. - * - * **Note:** If the predicate is missing or empty then it defaults to `'+'`. - * - * @param {boolean=} reverse - If `true`, reverse the sorting order. - * @param {(Function)=} comparator - The comparator function used to determine the relative order of - * value pairs. If omitted, the built-in comparator will be used. - * - * @returns {Array} - The sorted array. - * - * - * @example - * ### Ordering a table with `ngRepeat` - * - * The example below demonstrates a simple {@link ngRepeat ngRepeat}, where the data is sorted by - * age in descending order (expression is set to `'-age'`). The `comparator` is not set, which means - * it defaults to the built-in comparator. - * - - -
    - - - - - - - - - - - -
    NamePhone NumberAge
    {{friend.name}}{{friend.phone}}{{friend.age}}
    -
    -
    - - angular.module('orderByExample1', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.friends = [ - {name: 'John', phone: '555-1212', age: 10}, - {name: 'Mary', phone: '555-9876', age: 19}, - {name: 'Mike', phone: '555-4321', age: 21}, - {name: 'Adam', phone: '555-5678', age: 35}, - {name: 'Julie', phone: '555-8765', age: 29} - ]; - }]); - - - .friends { - border-collapse: collapse; - } - - .friends th { - border-bottom: 1px solid; - } - .friends td, .friends th { - border-left: 1px solid; - padding: 5px 10px; - } - .friends td:first-child, .friends th:first-child { - border-left: none; - } - - - // Element locators - var names = element.all(by.repeater('friends').column('friend.name')); - - it('should sort friends by age in reverse order', function() { - expect(names.get(0).getText()).toBe('Adam'); - expect(names.get(1).getText()).toBe('Julie'); - expect(names.get(2).getText()).toBe('Mike'); - expect(names.get(3).getText()).toBe('Mary'); - expect(names.get(4).getText()).toBe('John'); - }); - -
    - *
    - * - * @example - * ### Changing parameters dynamically - * - * All parameters can be changed dynamically. The next example shows how you can make the columns of - * a table sortable, by binding the `expression` and `reverse` parameters to scope properties. - * - - -
    -
    Sort by = {{propertyName}}; reverse = {{reverse}}
    -
    - -
    - - - - - - - - - - - -
    - - - - - - - - -
    {{friend.name}}{{friend.phone}}{{friend.age}}
    -
    -
    - - angular.module('orderByExample2', []) - .controller('ExampleController', ['$scope', function($scope) { - var friends = [ - {name: 'John', phone: '555-1212', age: 10}, - {name: 'Mary', phone: '555-9876', age: 19}, - {name: 'Mike', phone: '555-4321', age: 21}, - {name: 'Adam', phone: '555-5678', age: 35}, - {name: 'Julie', phone: '555-8765', age: 29} - ]; - - $scope.propertyName = 'age'; - $scope.reverse = true; - $scope.friends = friends; - - $scope.sortBy = function(propertyName) { - $scope.reverse = ($scope.propertyName === propertyName) ? !$scope.reverse : false; - $scope.propertyName = propertyName; - }; - }]); - - - .friends { - border-collapse: collapse; - } - - .friends th { - border-bottom: 1px solid; - } - .friends td, .friends th { - border-left: 1px solid; - padding: 5px 10px; - } - .friends td:first-child, .friends th:first-child { - border-left: none; - } - - .sortorder:after { - content: '\25b2'; // BLACK UP-POINTING TRIANGLE - } - .sortorder.reverse:after { - content: '\25bc'; // BLACK DOWN-POINTING TRIANGLE - } - - - // Element locators - var unsortButton = element(by.partialButtonText('unsorted')); - var nameHeader = element(by.partialButtonText('Name')); - var phoneHeader = element(by.partialButtonText('Phone')); - var ageHeader = element(by.partialButtonText('Age')); - var firstName = element(by.repeater('friends').column('friend.name').row(0)); - var lastName = element(by.repeater('friends').column('friend.name').row(4)); - - it('should sort friends by some property, when clicking on the column header', function() { - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('John'); - - phoneHeader.click(); - expect(firstName.getText()).toBe('John'); - expect(lastName.getText()).toBe('Mary'); - - nameHeader.click(); - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('Mike'); - - ageHeader.click(); - expect(firstName.getText()).toBe('John'); - expect(lastName.getText()).toBe('Adam'); - }); - - it('should sort friends in reverse order, when clicking on the same column', function() { - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('John'); - - ageHeader.click(); - expect(firstName.getText()).toBe('John'); - expect(lastName.getText()).toBe('Adam'); - - ageHeader.click(); - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('John'); - }); - - it('should restore the original order, when clicking "Set to unsorted"', function() { - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('John'); - - unsortButton.click(); - expect(firstName.getText()).toBe('John'); - expect(lastName.getText()).toBe('Julie'); - }); - -
    - *
    - * - * @example - * ### Using `orderBy` inside a controller - * - * It is also possible to call the `orderBy` filter manually, by injecting `orderByFilter`, and - * calling it with the desired parameters. (Alternatively, you could inject the `$filter` factory - * and retrieve the `orderBy` filter with `$filter('orderBy')`.) - * - - -
    -
    Sort by = {{propertyName}}; reverse = {{reverse}}
    -
    - -
    - - - - - - - - - - - -
    - - - - - - - - -
    {{friend.name}}{{friend.phone}}{{friend.age}}
    -
    -
    - - angular.module('orderByExample3', []) - .controller('ExampleController', ['$scope', 'orderByFilter', function($scope, orderBy) { - var friends = [ - {name: 'John', phone: '555-1212', age: 10}, - {name: 'Mary', phone: '555-9876', age: 19}, - {name: 'Mike', phone: '555-4321', age: 21}, - {name: 'Adam', phone: '555-5678', age: 35}, - {name: 'Julie', phone: '555-8765', age: 29} - ]; - - $scope.propertyName = 'age'; - $scope.reverse = true; - $scope.friends = orderBy(friends, $scope.propertyName, $scope.reverse); - - $scope.sortBy = function(propertyName) { - $scope.reverse = (propertyName !== null && $scope.propertyName === propertyName) - ? !$scope.reverse : false; - $scope.propertyName = propertyName; - $scope.friends = orderBy(friends, $scope.propertyName, $scope.reverse); - }; - }]); - - - .friends { - border-collapse: collapse; - } - - .friends th { - border-bottom: 1px solid; - } - .friends td, .friends th { - border-left: 1px solid; - padding: 5px 10px; - } - .friends td:first-child, .friends th:first-child { - border-left: none; - } - - .sortorder:after { - content: '\25b2'; // BLACK UP-POINTING TRIANGLE - } - .sortorder.reverse:after { - content: '\25bc'; // BLACK DOWN-POINTING TRIANGLE - } - - - // Element locators - var unsortButton = element(by.partialButtonText('unsorted')); - var nameHeader = element(by.partialButtonText('Name')); - var phoneHeader = element(by.partialButtonText('Phone')); - var ageHeader = element(by.partialButtonText('Age')); - var firstName = element(by.repeater('friends').column('friend.name').row(0)); - var lastName = element(by.repeater('friends').column('friend.name').row(4)); - - it('should sort friends by some property, when clicking on the column header', function() { - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('John'); - - phoneHeader.click(); - expect(firstName.getText()).toBe('John'); - expect(lastName.getText()).toBe('Mary'); - - nameHeader.click(); - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('Mike'); - - ageHeader.click(); - expect(firstName.getText()).toBe('John'); - expect(lastName.getText()).toBe('Adam'); - }); - - it('should sort friends in reverse order, when clicking on the same column', function() { - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('John'); - - ageHeader.click(); - expect(firstName.getText()).toBe('John'); - expect(lastName.getText()).toBe('Adam'); - - ageHeader.click(); - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('John'); - }); - - it('should restore the original order, when clicking "Set to unsorted"', function() { - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('John'); - - unsortButton.click(); - expect(firstName.getText()).toBe('John'); - expect(lastName.getText()).toBe('Julie'); - }); - -
    - *
    - * - * @example - * ### Using a custom comparator - * - * If you have very specific requirements about the way items are sorted, you can pass your own - * comparator function. For example, you might need to compare some strings in a locale-sensitive - * way. (When specifying a custom comparator, you also need to pass a value for the `reverse` - * argument - passing `false` retains the default sorting order, i.e. ascending.) - * - - -
    -
    -

    Locale-sensitive Comparator

    - - - - - - - - - -
    NameFavorite Letter
    {{friend.name}}{{friend.favoriteLetter}}
    -
    -
    -

    Default Comparator

    - - - - - - - - - -
    NameFavorite Letter
    {{friend.name}}{{friend.favoriteLetter}}
    -
    -
    -
    - - angular.module('orderByExample4', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.friends = [ - {name: 'John', favoriteLetter: 'Ä'}, - {name: 'Mary', favoriteLetter: 'Ü'}, - {name: 'Mike', favoriteLetter: 'Ö'}, - {name: 'Adam', favoriteLetter: 'H'}, - {name: 'Julie', favoriteLetter: 'Z'} - ]; - - $scope.localeSensitiveComparator = function(v1, v2) { - // If we don't get strings, just compare by index - if (v1.type !== 'string' || v2.type !== 'string') { - return (v1.index < v2.index) ? -1 : 1; - } - - // Compare strings alphabetically, taking locale into account - return v1.value.localeCompare(v2.value); - }; - }]); - - - .friends-container { - display: inline-block; - margin: 0 30px; - } - - .friends { - border-collapse: collapse; - } - - .friends th { - border-bottom: 1px solid; - } - .friends td, .friends th { - border-left: 1px solid; - padding: 5px 10px; - } - .friends td:first-child, .friends th:first-child { - border-left: none; - } - - - // Element locators - var container = element(by.css('.custom-comparator')); - var names = container.all(by.repeater('friends').column('friend.name')); - - it('should sort friends by favorite letter (in correct alphabetical order)', function() { - expect(names.get(0).getText()).toBe('John'); - expect(names.get(1).getText()).toBe('Adam'); - expect(names.get(2).getText()).toBe('Mike'); - expect(names.get(3).getText()).toBe('Mary'); - expect(names.get(4).getText()).toBe('Julie'); - }); - -
    - * - */ - orderByFilter.$inject = ['$parse']; - function orderByFilter($parse) { - return function(array, sortPredicate, reverseOrder, compareFn) { - - if (array == null) return array; - if (!isArrayLike(array)) { - throw minErr('orderBy')('notarray', 'Expected array but received: {0}', array); - } - - if (!isArray(sortPredicate)) { sortPredicate = [sortPredicate]; } - if (sortPredicate.length === 0) { sortPredicate = ['+']; } - - var predicates = processPredicates(sortPredicate); - - var descending = reverseOrder ? -1 : 1; - - // Define the `compare()` function. Use a default comparator if none is specified. - var compare = isFunction(compareFn) ? compareFn : defaultCompare; - - // The next three lines are a version of a Swartzian Transform idiom from Perl - // (sometimes called the Decorate-Sort-Undecorate idiom) - // See https://en.wikipedia.org/wiki/Schwartzian_transform - var compareValues = Array.prototype.map.call(array, getComparisonObject); - compareValues.sort(doComparison); - array = compareValues.map(function(item) { return item.value; }); - - return array; - - function getComparisonObject(value, index) { - // NOTE: We are adding an extra `tieBreaker` value based on the element's index. - // This will be used to keep the sort stable when none of the input predicates can - // distinguish between two elements. - return { - value: value, - tieBreaker: {value: index, type: 'number', index: index}, - predicateValues: predicates.map(function(predicate) { - return getPredicateValue(predicate.get(value), index); - }) - }; - } - - function doComparison(v1, v2) { - for (var i = 0, ii = predicates.length; i < ii; i++) { - var result = compare(v1.predicateValues[i], v2.predicateValues[i]); - if (result) { - return result * predicates[i].descending * descending; - } - } - - return (compare(v1.tieBreaker, v2.tieBreaker) || defaultCompare(v1.tieBreaker, v2.tieBreaker)) * descending; - } - }; - - function processPredicates(sortPredicates) { - return sortPredicates.map(function(predicate) { - var descending = 1, get = identity; - - if (isFunction(predicate)) { - get = predicate; - } else if (isString(predicate)) { - if ((predicate.charAt(0) === '+' || predicate.charAt(0) === '-')) { - descending = predicate.charAt(0) === '-' ? -1 : 1; - predicate = predicate.substring(1); - } - if (predicate !== '') { - get = $parse(predicate); - if (get.constant) { - var key = get(); - get = function(value) { return value[key]; }; - } - } - } - return {get: get, descending: descending}; - }); - } - - function isPrimitive(value) { - switch (typeof value) { - case 'number': /* falls through */ - case 'boolean': /* falls through */ - case 'string': - return true; - default: - return false; - } - } - - function objectValue(value) { - // If `valueOf` is a valid function use that - if (isFunction(value.valueOf)) { - value = value.valueOf(); - if (isPrimitive(value)) return value; - } - // If `toString` is a valid function and not the one from `Object.prototype` use that - if (hasCustomToString(value)) { - value = value.toString(); - if (isPrimitive(value)) return value; - } - - return value; - } - - function getPredicateValue(value, index) { - var type = typeof value; - if (value === null) { - type = 'string'; - value = 'null'; - } else if (type === 'object') { - value = objectValue(value); - } - return {value: value, type: type, index: index}; - } - - function defaultCompare(v1, v2) { - var result = 0; - var type1 = v1.type; - var type2 = v2.type; - - if (type1 === type2) { - var value1 = v1.value; - var value2 = v2.value; - - if (type1 === 'string') { - // Compare strings case-insensitively - value1 = value1.toLowerCase(); - value2 = value2.toLowerCase(); - } else if (type1 === 'object') { - // For basic objects, use the position of the object - // in the collection instead of the value - if (isObject(value1)) value1 = v1.index; - if (isObject(value2)) value2 = v2.index; - } - - if (value1 !== value2) { - result = value1 < value2 ? -1 : 1; - } - } else { - result = type1 < type2 ? -1 : 1; - } - - return result; - } - } - - function ngDirective(directive) { - if (isFunction(directive)) { - directive = { - link: directive - }; - } - directive.restrict = directive.restrict || 'AC'; - return valueFn(directive); - } - - /** - * @ngdoc directive - * @name a - * @restrict E - * - * @description - * Modifies the default behavior of the html a tag so that the default action is prevented when - * the href attribute is empty. - * - * For dynamically creating `href` attributes for a tags, see the {@link ng.ngHref `ngHref`} directive. - */ - var htmlAnchorDirective = valueFn({ - restrict: 'E', - compile: function(element, attr) { - if (!attr.href && !attr.xlinkHref) { - return function(scope, element) { - // If the linked element is not an anchor tag anymore, do nothing - if (element[0].nodeName.toLowerCase() !== 'a') return; - - // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute. - var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ? - 'xlink:href' : 'href'; - element.on('click', function(event) { - // if we have no href url, then don't navigate anywhere. - if (!element.attr(href)) { - event.preventDefault(); - } - }); - }; - } - } - }); - - /** - * @ngdoc directive - * @name ngHref - * @restrict A - * @priority 99 - * - * @description - * Using AngularJS markup like `{{hash}}` in an href attribute will - * make the link go to the wrong URL if the user clicks it before - * AngularJS has a chance to replace the `{{hash}}` markup with its - * value. Until AngularJS replaces the markup the link will be broken - * and will most likely return a 404 error. The `ngHref` directive - * solves this problem. - * - * The wrong way to write it: - * ```html - * link1 - * ``` - * - * The correct way to write it: - * ```html - * link1 - * ``` - * - * @element A - * @param {template} ngHref any string which can contain `{{}}` markup. - * - * @example - * This example shows various combinations of `href`, `ng-href` and `ng-click` attributes - * in links and their different behaviors: - - -
    - link 1 (link, don't reload)
    - link 2 (link, don't reload)
    - link 3 (link, reload!)
    - anchor (link, don't reload)
    - anchor (no link)
    - link (link, change location) -
    - - it('should execute ng-click but not reload when href without value', function() { - element(by.id('link-1')).click(); - expect(element(by.model('value')).getAttribute('value')).toEqual('1'); - expect(element(by.id('link-1')).getAttribute('href')).toBe(''); - }); - - it('should execute ng-click but not reload when href empty string', function() { - element(by.id('link-2')).click(); - expect(element(by.model('value')).getAttribute('value')).toEqual('2'); - expect(element(by.id('link-2')).getAttribute('href')).toBe(''); - }); - - it('should execute ng-click and change url when ng-href specified', function() { - expect(element(by.id('link-3')).getAttribute('href')).toMatch(/\/123$/); - - element(by.id('link-3')).click(); - - // At this point, we navigate away from an AngularJS page, so we need - // to use browser.driver to get the base webdriver. - - browser.wait(function() { - return browser.driver.getCurrentUrl().then(function(url) { - return url.match(/\/123$/); - }); - }, 5000, 'page should navigate to /123'); - }); - - it('should execute ng-click but not reload when href empty string and name specified', function() { - element(by.id('link-4')).click(); - expect(element(by.model('value')).getAttribute('value')).toEqual('4'); - expect(element(by.id('link-4')).getAttribute('href')).toBe(''); - }); - - it('should execute ng-click but not reload when no href but name specified', function() { - element(by.id('link-5')).click(); - expect(element(by.model('value')).getAttribute('value')).toEqual('5'); - expect(element(by.id('link-5')).getAttribute('href')).toBe(null); - }); - - it('should only change url when only ng-href', function() { - element(by.model('value')).clear(); - element(by.model('value')).sendKeys('6'); - expect(element(by.id('link-6')).getAttribute('href')).toMatch(/\/6$/); - - element(by.id('link-6')).click(); - - // At this point, we navigate away from an AngularJS page, so we need - // to use browser.driver to get the base webdriver. - browser.wait(function() { - return browser.driver.getCurrentUrl().then(function(url) { - return url.match(/\/6$/); - }); - }, 5000, 'page should navigate to /6'); - }); - -
    - */ - - /** - * @ngdoc directive - * @name ngSrc - * @restrict A - * @priority 99 - * - * @description - * Using AngularJS markup like `{{hash}}` in a `src` attribute doesn't - * work right: The browser will fetch from the URL with the literal - * text `{{hash}}` until AngularJS replaces the expression inside - * `{{hash}}`. The `ngSrc` directive solves this problem. - * - * The buggy way to write it: - * ```html - * Description - * ``` - * - * The correct way to write it: - * ```html - * Description - * ``` - * - * @element IMG - * @param {template} ngSrc any string which can contain `{{}}` markup. - */ - - /** - * @ngdoc directive - * @name ngSrcset - * @restrict A - * @priority 99 - * - * @description - * Using AngularJS markup like `{{hash}}` in a `srcset` attribute doesn't - * work right: The browser will fetch from the URL with the literal - * text `{{hash}}` until AngularJS replaces the expression inside - * `{{hash}}`. The `ngSrcset` directive solves this problem. - * - * The buggy way to write it: - * ```html - * Description - * ``` - * - * The correct way to write it: - * ```html - * Description - * ``` - * - * @element IMG - * @param {template} ngSrcset any string which can contain `{{}}` markup. - */ - - /** - * @ngdoc directive - * @name ngDisabled - * @restrict A - * @priority 100 - * - * @description - * - * This directive sets the `disabled` attribute on the element (typically a form control, - * e.g. `input`, `button`, `select` etc.) if the - * {@link guide/expression expression} inside `ngDisabled` evaluates to truthy. - * - * A special directive is necessary because we cannot use interpolation inside the `disabled` - * attribute. See the {@link guide/interpolation interpolation guide} for more info. - * - * @example - - -
    - -
    - - it('should toggle button', function() { - expect(element(by.css('button')).getAttribute('disabled')).toBeFalsy(); - element(by.model('checked')).click(); - expect(element(by.css('button')).getAttribute('disabled')).toBeTruthy(); - }); - -
    - * - * @element INPUT - * @param {expression} ngDisabled If the {@link guide/expression expression} is truthy, - * then the `disabled` attribute will be set on the element - */ - - - /** - * @ngdoc directive - * @name ngChecked - * @restrict A - * @priority 100 - * - * @description - * Sets the `checked` attribute on the element, if the expression inside `ngChecked` is truthy. - * - * Note that this directive should not be used together with {@link ngModel `ngModel`}, - * as this can lead to unexpected behavior. - * - * A special directive is necessary because we cannot use interpolation inside the `checked` - * attribute. See the {@link guide/interpolation interpolation guide} for more info. - * - * @example - - -
    - -
    - - it('should check both checkBoxes', function() { - expect(element(by.id('checkFollower')).getAttribute('checked')).toBeFalsy(); - element(by.model('leader')).click(); - expect(element(by.id('checkFollower')).getAttribute('checked')).toBeTruthy(); - }); - -
    - * - * @element INPUT - * @param {expression} ngChecked If the {@link guide/expression expression} is truthy, - * then the `checked` attribute will be set on the element - */ - - - /** - * @ngdoc directive - * @name ngReadonly - * @restrict A - * @priority 100 - * - * @description - * - * Sets the `readonly` attribute on the element, if the expression inside `ngReadonly` is truthy. - * Note that `readonly` applies only to `input` elements with specific types. [See the input docs on - * MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-readonly) for more information. - * - * A special directive is necessary because we cannot use interpolation inside the `readonly` - * attribute. See the {@link guide/interpolation interpolation guide} for more info. - * - * @example - - -
    - -
    - - it('should toggle readonly attr', function() { - expect(element(by.css('[type="text"]')).getAttribute('readonly')).toBeFalsy(); - element(by.model('checked')).click(); - expect(element(by.css('[type="text"]')).getAttribute('readonly')).toBeTruthy(); - }); - -
    - * - * @element INPUT - * @param {expression} ngReadonly If the {@link guide/expression expression} is truthy, - * then special attribute "readonly" will be set on the element - */ - - - /** - * @ngdoc directive - * @name ngSelected - * @restrict A - * @priority 100 - * - * @description - * - * Sets the `selected` attribute on the element, if the expression inside `ngSelected` is truthy. - * - * A special directive is necessary because we cannot use interpolation inside the `selected` - * attribute. See the {@link guide/interpolation interpolation guide} for more info. - * - *
    - * **Note:** `ngSelected` does not interact with the `select` and `ngModel` directives, it only - * sets the `selected` attribute on the element. If you are using `ngModel` on the select, you - * should not use `ngSelected` on the options, as `ngModel` will set the select value and - * selected options. - *
    - * - * @example - - -
    - -
    - - it('should select Greetings!', function() { - expect(element(by.id('greet')).getAttribute('selected')).toBeFalsy(); - element(by.model('selected')).click(); - expect(element(by.id('greet')).getAttribute('selected')).toBeTruthy(); - }); - -
    - * - * @element OPTION - * @param {expression} ngSelected If the {@link guide/expression expression} is truthy, - * then special attribute "selected" will be set on the element - */ - - /** - * @ngdoc directive - * @name ngOpen - * @restrict A - * @priority 100 - * - * @description - * - * Sets the `open` attribute on the element, if the expression inside `ngOpen` is truthy. - * - * A special directive is necessary because we cannot use interpolation inside the `open` - * attribute. See the {@link guide/interpolation interpolation guide} for more info. - * - * ## A note about browser compatibility - * - * Internet Explorer and Edge do not support the `details` element, it is - * recommended to use {@link ng.ngShow} and {@link ng.ngHide} instead. - * - * @example - - -
    -
    - List -
      -
    • Apple
    • -
    • Orange
    • -
    • Durian
    • -
    -
    -
    - - it('should toggle open', function() { - expect(element(by.id('details')).getAttribute('open')).toBeFalsy(); - element(by.model('open')).click(); - expect(element(by.id('details')).getAttribute('open')).toBeTruthy(); - }); - -
    - * - * @element DETAILS - * @param {expression} ngOpen If the {@link guide/expression expression} is truthy, - * then special attribute "open" will be set on the element - */ - - var ngAttributeAliasDirectives = {}; - -// boolean attrs are evaluated - forEach(BOOLEAN_ATTR, function(propName, attrName) { - // binding to multiple is not supported - if (propName === 'multiple') return; - - function defaultLinkFn(scope, element, attr) { - scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) { - attr.$set(attrName, !!value); - }); - } - - var normalized = directiveNormalize('ng-' + attrName); - var linkFn = defaultLinkFn; - - if (propName === 'checked') { - linkFn = function(scope, element, attr) { - // ensuring ngChecked doesn't interfere with ngModel when both are set on the same input - if (attr.ngModel !== attr[normalized]) { - defaultLinkFn(scope, element, attr); - } - }; - } - - ngAttributeAliasDirectives[normalized] = function() { - return { - restrict: 'A', - priority: 100, - link: linkFn - }; - }; - }); - -// aliased input attrs are evaluated - forEach(ALIASED_ATTR, function(htmlAttr, ngAttr) { - ngAttributeAliasDirectives[ngAttr] = function() { - return { - priority: 100, - link: function(scope, element, attr) { - //special case ngPattern when a literal regular expression value - //is used as the expression (this way we don't have to watch anything). - if (ngAttr === 'ngPattern' && attr.ngPattern.charAt(0) === '/') { - var match = attr.ngPattern.match(REGEX_STRING_REGEXP); - if (match) { - attr.$set('ngPattern', new RegExp(match[1], match[2])); - return; - } - } - - scope.$watch(attr[ngAttr], function ngAttrAliasWatchAction(value) { - attr.$set(ngAttr, value); - }); - } - }; - }; - }); - -// ng-src, ng-srcset, ng-href are interpolated - forEach(['src', 'srcset', 'href'], function(attrName) { - var normalized = directiveNormalize('ng-' + attrName); - ngAttributeAliasDirectives[normalized] = function() { - return { - priority: 99, // it needs to run after the attributes are interpolated - link: function(scope, element, attr) { - var propName = attrName, - name = attrName; - - if (attrName === 'href' && - toString.call(element.prop('href')) === '[object SVGAnimatedString]') { - name = 'xlinkHref'; - attr.$attr[name] = 'xlink:href'; - propName = null; - } - - attr.$observe(normalized, function(value) { - if (!value) { - if (attrName === 'href') { - attr.$set(name, null); - } - return; - } - - attr.$set(name, value); - - // Support: IE 9-11 only - // On IE, if "ng:src" directive declaration is used and "src" attribute doesn't exist - // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need - // to set the property as well to achieve the desired effect. - // We use attr[attrName] value since $set can sanitize the url. - if (msie && propName) element.prop(propName, attr[name]); - }); - } - }; - }; - }); - - /* global -nullFormCtrl, -PENDING_CLASS, -SUBMITTED_CLASS - */ - var nullFormCtrl = { - $addControl: noop, - $$renameControl: nullFormRenameControl, - $removeControl: noop, - $setValidity: noop, - $setDirty: noop, - $setPristine: noop, - $setSubmitted: noop - }, - PENDING_CLASS = 'ng-pending', - SUBMITTED_CLASS = 'ng-submitted'; - - function nullFormRenameControl(control, name) { - control.$name = name; - } - - /** - * @ngdoc type - * @name form.FormController - * - * @property {boolean} $pristine True if user has not interacted with the form yet. - * @property {boolean} $dirty True if user has already interacted with the form. - * @property {boolean} $valid True if all of the containing forms and controls are valid. - * @property {boolean} $invalid True if at least one containing control or form is invalid. - * @property {boolean} $submitted True if user has submitted the form even if its invalid. - * - * @property {Object} $pending An object hash, containing references to controls or forms with - * pending validators, where: - * - * - keys are validations tokens (error names). - * - values are arrays of controls or forms that have a pending validator for the given error name. - * - * See {@link form.FormController#$error $error} for a list of built-in validation tokens. - * - * @property {Object} $error An object hash, containing references to controls or forms with failing - * validators, where: - * - * - keys are validation tokens (error names), - * - values are arrays of controls or forms that have a failing validator for the given error name. - * - * Built-in validation tokens: - * - `email` - * - `max` - * - `maxlength` - * - `min` - * - `minlength` - * - `number` - * - `pattern` - * - `required` - * - `url` - * - `date` - * - `datetimelocal` - * - `time` - * - `week` - * - `month` - * - * @description - * `FormController` keeps track of all its controls and nested forms as well as the state of them, - * such as being valid/invalid or dirty/pristine. - * - * Each {@link ng.directive:form form} directive creates an instance - * of `FormController`. - * - */ -//asks for $scope to fool the BC controller module - FormController.$inject = ['$element', '$attrs', '$scope', '$animate', '$interpolate']; - function FormController($element, $attrs, $scope, $animate, $interpolate) { - this.$$controls = []; - - // init state - this.$error = {}; - this.$$success = {}; - this.$pending = undefined; - this.$name = $interpolate($attrs.name || $attrs.ngForm || '')($scope); - this.$dirty = false; - this.$pristine = true; - this.$valid = true; - this.$invalid = false; - this.$submitted = false; - this.$$parentForm = nullFormCtrl; - - this.$$element = $element; - this.$$animate = $animate; - - setupValidity(this); - } - - FormController.prototype = { - /** - * @ngdoc method - * @name form.FormController#$rollbackViewValue - * - * @description - * Rollback all form controls pending updates to the `$modelValue`. - * - * Updates may be pending by a debounced event or because the input is waiting for a some future - * event defined in `ng-model-options`. This method is typically needed by the reset button of - * a form that uses `ng-model-options` to pend updates. - */ - $rollbackViewValue: function() { - forEach(this.$$controls, function(control) { - control.$rollbackViewValue(); - }); - }, - - /** - * @ngdoc method - * @name form.FormController#$commitViewValue - * - * @description - * Commit all form controls pending updates to the `$modelValue`. - * - * Updates may be pending by a debounced event or because the input is waiting for a some future - * event defined in `ng-model-options`. This method is rarely needed as `NgModelController` - * usually handles calling this in response to input events. - */ - $commitViewValue: function() { - forEach(this.$$controls, function(control) { - control.$commitViewValue(); - }); - }, - - /** - * @ngdoc method - * @name form.FormController#$addControl - * @param {object} control control object, either a {@link form.FormController} or an - * {@link ngModel.NgModelController} - * - * @description - * Register a control with the form. Input elements using ngModelController do this automatically - * when they are linked. - * - * Note that the current state of the control will not be reflected on the new parent form. This - * is not an issue with normal use, as freshly compiled and linked controls are in a `$pristine` - * state. - * - * However, if the method is used programmatically, for example by adding dynamically created controls, - * or controls that have been previously removed without destroying their corresponding DOM element, - * it's the developers responsibility to make sure the current state propagates to the parent form. - * - * For example, if an input control is added that is already `$dirty` and has `$error` properties, - * calling `$setDirty()` and `$validate()` afterwards will propagate the state to the parent form. - */ - $addControl: function(control) { - // Breaking change - before, inputs whose name was "hasOwnProperty" were quietly ignored - // and not added to the scope. Now we throw an error. - assertNotHasOwnProperty(control.$name, 'input'); - this.$$controls.push(control); - - if (control.$name) { - this[control.$name] = control; - } - - control.$$parentForm = this; - }, - - // Private API: rename a form control - $$renameControl: function(control, newName) { - var oldName = control.$name; - - if (this[oldName] === control) { - delete this[oldName]; - } - this[newName] = control; - control.$name = newName; - }, - - /** - * @ngdoc method - * @name form.FormController#$removeControl - * @param {object} control control object, either a {@link form.FormController} or an - * {@link ngModel.NgModelController} - * - * @description - * Deregister a control from the form. - * - * Input elements using ngModelController do this automatically when they are destroyed. - * - * Note that only the removed control's validation state (`$errors`etc.) will be removed from the - * form. `$dirty`, `$submitted` states will not be changed, because the expected behavior can be - * different from case to case. For example, removing the only `$dirty` control from a form may or - * may not mean that the form is still `$dirty`. - */ - $removeControl: function(control) { - if (control.$name && this[control.$name] === control) { - delete this[control.$name]; - } - forEach(this.$pending, function(value, name) { - // eslint-disable-next-line no-invalid-this - this.$setValidity(name, null, control); - }, this); - forEach(this.$error, function(value, name) { - // eslint-disable-next-line no-invalid-this - this.$setValidity(name, null, control); - }, this); - forEach(this.$$success, function(value, name) { - // eslint-disable-next-line no-invalid-this - this.$setValidity(name, null, control); - }, this); - - arrayRemove(this.$$controls, control); - control.$$parentForm = nullFormCtrl; - }, - - /** - * @ngdoc method - * @name form.FormController#$setDirty - * - * @description - * Sets the form to a dirty state. - * - * This method can be called to add the 'ng-dirty' class and set the form to a dirty - * state (ng-dirty class). This method will also propagate to parent forms. - */ - $setDirty: function() { - this.$$animate.removeClass(this.$$element, PRISTINE_CLASS); - this.$$animate.addClass(this.$$element, DIRTY_CLASS); - this.$dirty = true; - this.$pristine = false; - this.$$parentForm.$setDirty(); - }, - - /** - * @ngdoc method - * @name form.FormController#$setPristine - * - * @description - * Sets the form to its pristine state. - * - * This method sets the form's `$pristine` state to true, the `$dirty` state to false, removes - * the `ng-dirty` class and adds the `ng-pristine` class. Additionally, it sets the `$submitted` - * state to false. - * - * This method will also propagate to all the controls contained in this form. - * - * Setting a form back to a pristine state is often useful when we want to 'reuse' a form after - * saving or resetting it. - */ - $setPristine: function() { - this.$$animate.setClass(this.$$element, PRISTINE_CLASS, DIRTY_CLASS + ' ' + SUBMITTED_CLASS); - this.$dirty = false; - this.$pristine = true; - this.$submitted = false; - forEach(this.$$controls, function(control) { - control.$setPristine(); - }); - }, - - /** - * @ngdoc method - * @name form.FormController#$setUntouched - * - * @description - * Sets the form to its untouched state. - * - * This method can be called to remove the 'ng-touched' class and set the form controls to their - * untouched state (ng-untouched class). - * - * Setting a form controls back to their untouched state is often useful when setting the form - * back to its pristine state. - */ - $setUntouched: function() { - forEach(this.$$controls, function(control) { - control.$setUntouched(); - }); - }, - - /** - * @ngdoc method - * @name form.FormController#$setSubmitted - * - * @description - * Sets the form to its submitted state. - */ - $setSubmitted: function() { - this.$$animate.addClass(this.$$element, SUBMITTED_CLASS); - this.$submitted = true; - this.$$parentForm.$setSubmitted(); - } - }; - - /** - * @ngdoc method - * @name form.FormController#$setValidity - * - * @description - * Change the validity state of the form, and notify the parent form (if any). - * - * Application developers will rarely need to call this method directly. It is used internally, by - * {@link ngModel.NgModelController#$setValidity NgModelController.$setValidity()}, to propagate a - * control's validity state to the parent `FormController`. - * - * @param {string} validationErrorKey Name of the validator. The `validationErrorKey` will be - * assigned to either `$error[validationErrorKey]` or `$pending[validationErrorKey]` (for - * unfulfilled `$asyncValidators`), so that it is available for data-binding. The - * `validationErrorKey` should be in camelCase and will get converted into dash-case for - * class name. Example: `myError` will result in `ng-valid-my-error` and - * `ng-invalid-my-error` classes and can be bound to as `{{ someForm.$error.myError }}`. - * @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending - * (undefined), or skipped (null). Pending is used for unfulfilled `$asyncValidators`. - * Skipped is used by AngularJS when validators do not run because of parse errors and when - * `$asyncValidators` do not run because any of the `$validators` failed. - * @param {NgModelController | FormController} controller - The controller whose validity state is - * triggering the change. - */ - addSetValidityMethod({ - clazz: FormController, - set: function(object, property, controller) { - var list = object[property]; - if (!list) { - object[property] = [controller]; - } else { - var index = list.indexOf(controller); - if (index === -1) { - list.push(controller); - } - } - }, - unset: function(object, property, controller) { - var list = object[property]; - if (!list) { - return; - } - arrayRemove(list, controller); - if (list.length === 0) { - delete object[property]; - } - } - }); - - /** - * @ngdoc directive - * @name ngForm - * @restrict EAC - * - * @description - * Nestable alias of {@link ng.directive:form `form`} directive. HTML - * does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a - * sub-group of controls needs to be determined. - * - * Note: the purpose of `ngForm` is to group controls, - * but not to be a replacement for the `
    ` tag with all of its capabilities - * (e.g. posting to the server, ...). - * - * @param {string=} ngForm|name Name of the form. If specified, the form controller will be published into - * related scope, under this name. - * - */ - - /** - * @ngdoc directive - * @name form - * @restrict E - * - * @description - * Directive that instantiates - * {@link form.FormController FormController}. - * - * If the `name` attribute is specified, the form controller is published onto the current scope under - * this name. - * - * ## Alias: {@link ng.directive:ngForm `ngForm`} - * - * In AngularJS, forms can be nested. This means that the outer form is valid when all of the child - * forms are valid as well. However, browsers do not allow nesting of `` elements, so - * AngularJS provides the {@link ng.directive:ngForm `ngForm`} directive, which behaves identically to - * `form` but can be nested. Nested forms can be useful, for example, if the validity of a sub-group - * of controls needs to be determined. - * - * ## CSS classes - * - `ng-valid` is set if the form is valid. - * - `ng-invalid` is set if the form is invalid. - * - `ng-pending` is set if the form is pending. - * - `ng-pristine` is set if the form is pristine. - * - `ng-dirty` is set if the form is dirty. - * - `ng-submitted` is set if the form was submitted. - * - * Keep in mind that ngAnimate can detect each of these classes when added and removed. - * - * - * ## Submitting a form and preventing the default action - * - * Since the role of forms in client-side AngularJS applications is different than in classical - * roundtrip apps, it is desirable for the browser not to translate the form submission into a full - * page reload that sends the data to the server. Instead some javascript logic should be triggered - * to handle the form submission in an application-specific way. - * - * For this reason, AngularJS prevents the default action (form submission to the server) unless the - * `` element has an `action` attribute specified. - * - * You can use one of the following two ways to specify what javascript method should be called when - * a form is submitted: - * - * - {@link ng.directive:ngSubmit ngSubmit} directive on the form element - * - {@link ng.directive:ngClick ngClick} directive on the first - * button or input field of type submit (input[type=submit]) - * - * To prevent double execution of the handler, use only one of the {@link ng.directive:ngSubmit ngSubmit} - * or {@link ng.directive:ngClick ngClick} directives. - * This is because of the following form submission rules in the HTML specification: - * - * - If a form has only one input field then hitting enter in this field triggers form submit - * (`ngSubmit`) - * - if a form has 2+ input fields and no buttons or input[type=submit] then hitting enter - * doesn't trigger submit - * - if a form has one or more input fields and one or more buttons or input[type=submit] then - * hitting enter in any of the input fields will trigger the click handler on the *first* button or - * input[type=submit] (`ngClick`) *and* a submit handler on the enclosing form (`ngSubmit`) - * - * Any pending `ngModelOptions` changes will take place immediately when an enclosing form is - * submitted. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit` - * to have access to the updated model. - * - * @animations - * Animations in ngForm are triggered when any of the associated CSS classes are added and removed. - * These classes are: `.ng-pristine`, `.ng-dirty`, `.ng-invalid` and `.ng-valid` as well as any - * other validations that are performed within the form. Animations in ngForm are similar to how - * they work in ngClass and animations can be hooked into using CSS transitions, keyframes as well - * as JS animations. - * - * The following example shows a simple way to utilize CSS transitions to style a form element - * that has been rendered as invalid after it has been validated: - * - *
    -     * //be sure to include ngAnimate as a module to hook into more
    -     * //advanced animations
    -     * .my-form {
    -     *   transition:0.5s linear all;
    -     *   background: white;
    -     * }
    -     * .my-form.ng-invalid {
    -     *   background: red;
    -     *   color:white;
    -     * }
    -     * 
    - * - * @example - - - - - - userType: - Required!
    - userType = {{userType}}
    - myForm.input.$valid = {{myForm.input.$valid}}
    - myForm.input.$error = {{myForm.input.$error}}
    - myForm.$valid = {{myForm.$valid}}
    - myForm.$error.required = {{!!myForm.$error.required}}
    - -
    - - it('should initialize to model', function() { - var userType = element(by.binding('userType')); - var valid = element(by.binding('myForm.input.$valid')); - - expect(userType.getText()).toContain('guest'); - expect(valid.getText()).toContain('true'); - }); - - it('should be invalid if empty', function() { - var userType = element(by.binding('userType')); - var valid = element(by.binding('myForm.input.$valid')); - var userInput = element(by.model('userType')); - - userInput.clear(); - userInput.sendKeys(''); - - expect(userType.getText()).toEqual('userType ='); - expect(valid.getText()).toContain('false'); - }); - -
    - * - * @param {string=} name Name of the form. If specified, the form controller will be published into - * related scope, under this name. - */ - var formDirectiveFactory = function(isNgForm) { - return ['$timeout', '$parse', function($timeout, $parse) { - var formDirective = { - name: 'form', - restrict: isNgForm ? 'EAC' : 'E', - require: ['form', '^^?form'], //first is the form's own ctrl, second is an optional parent form - controller: FormController, - compile: function ngFormCompile(formElement, attr) { - // Setup initial state of the control - formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS); - - var nameAttr = attr.name ? 'name' : (isNgForm && attr.ngForm ? 'ngForm' : false); - - return { - pre: function ngFormPreLink(scope, formElement, attr, ctrls) { - var controller = ctrls[0]; - - // if `action` attr is not present on the form, prevent the default action (submission) - if (!('action' in attr)) { - // we can't use jq events because if a form is destroyed during submission the default - // action is not prevented. see #1238 - // - // IE 9 is not affected because it doesn't fire a submit event and try to do a full - // page reload if the form was destroyed by submission of the form via a click handler - // on a button in the form. Looks like an IE9 specific bug. - var handleFormSubmission = function(event) { - scope.$apply(function() { - controller.$commitViewValue(); - controller.$setSubmitted(); - }); - - event.preventDefault(); - }; - - formElement[0].addEventListener('submit', handleFormSubmission); - - // unregister the preventDefault listener so that we don't not leak memory but in a - // way that will achieve the prevention of the default action. - formElement.on('$destroy', function() { - $timeout(function() { - formElement[0].removeEventListener('submit', handleFormSubmission); - }, 0, false); - }); - } - - var parentFormCtrl = ctrls[1] || controller.$$parentForm; - parentFormCtrl.$addControl(controller); - - var setter = nameAttr ? getSetter(controller.$name) : noop; - - if (nameAttr) { - setter(scope, controller); - attr.$observe(nameAttr, function(newValue) { - if (controller.$name === newValue) return; - setter(scope, undefined); - controller.$$parentForm.$$renameControl(controller, newValue); - setter = getSetter(controller.$name); - setter(scope, controller); - }); - } - formElement.on('$destroy', function() { - controller.$$parentForm.$removeControl(controller); - setter(scope, undefined); - extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards - }); - } - }; - } - }; - - return formDirective; - - function getSetter(expression) { - if (expression === '') { - //create an assignable expression, so forms with an empty name can be renamed later - return $parse('this[""]').assign; - } - return $parse(expression).assign || noop; - } - }]; - }; - - var formDirective = formDirectiveFactory(); - var ngFormDirective = formDirectiveFactory(true); - - - -// helper methods - function setupValidity(instance) { - instance.$$classCache = {}; - instance.$$classCache[INVALID_CLASS] = !(instance.$$classCache[VALID_CLASS] = instance.$$element.hasClass(VALID_CLASS)); - } - function addSetValidityMethod(context) { - var clazz = context.clazz, - set = context.set, - unset = context.unset; - - clazz.prototype.$setValidity = function(validationErrorKey, state, controller) { - if (isUndefined(state)) { - createAndSet(this, '$pending', validationErrorKey, controller); - } else { - unsetAndCleanup(this, '$pending', validationErrorKey, controller); - } - if (!isBoolean(state)) { - unset(this.$error, validationErrorKey, controller); - unset(this.$$success, validationErrorKey, controller); - } else { - if (state) { - unset(this.$error, validationErrorKey, controller); - set(this.$$success, validationErrorKey, controller); - } else { - set(this.$error, validationErrorKey, controller); - unset(this.$$success, validationErrorKey, controller); - } - } - if (this.$pending) { - cachedToggleClass(this, PENDING_CLASS, true); - this.$valid = this.$invalid = undefined; - toggleValidationCss(this, '', null); - } else { - cachedToggleClass(this, PENDING_CLASS, false); - this.$valid = isObjectEmpty(this.$error); - this.$invalid = !this.$valid; - toggleValidationCss(this, '', this.$valid); - } - - // re-read the state as the set/unset methods could have - // combined state in this.$error[validationError] (used for forms), - // where setting/unsetting only increments/decrements the value, - // and does not replace it. - var combinedState; - if (this.$pending && this.$pending[validationErrorKey]) { - combinedState = undefined; - } else if (this.$error[validationErrorKey]) { - combinedState = false; - } else if (this.$$success[validationErrorKey]) { - combinedState = true; - } else { - combinedState = null; - } - - toggleValidationCss(this, validationErrorKey, combinedState); - this.$$parentForm.$setValidity(validationErrorKey, combinedState, this); - }; - - function createAndSet(ctrl, name, value, controller) { - if (!ctrl[name]) { - ctrl[name] = {}; - } - set(ctrl[name], value, controller); - } - - function unsetAndCleanup(ctrl, name, value, controller) { - if (ctrl[name]) { - unset(ctrl[name], value, controller); - } - if (isObjectEmpty(ctrl[name])) { - ctrl[name] = undefined; - } - } - - function cachedToggleClass(ctrl, className, switchValue) { - if (switchValue && !ctrl.$$classCache[className]) { - ctrl.$$animate.addClass(ctrl.$$element, className); - ctrl.$$classCache[className] = true; - } else if (!switchValue && ctrl.$$classCache[className]) { - ctrl.$$animate.removeClass(ctrl.$$element, className); - ctrl.$$classCache[className] = false; - } - } - - function toggleValidationCss(ctrl, validationErrorKey, isValid) { - validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : ''; - - cachedToggleClass(ctrl, VALID_CLASS + validationErrorKey, isValid === true); - cachedToggleClass(ctrl, INVALID_CLASS + validationErrorKey, isValid === false); - } - } - - function isObjectEmpty(obj) { - if (obj) { - for (var prop in obj) { - if (obj.hasOwnProperty(prop)) { - return false; - } - } - } - return true; - } - - /* global - VALID_CLASS: false, - INVALID_CLASS: false, - PRISTINE_CLASS: false, - DIRTY_CLASS: false, - ngModelMinErr: false -*/ - -// Regex code was initially obtained from SO prior to modification: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime#answer-3143231 - var ISO_DATE_REGEXP = /^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/; -// See valid URLs in RFC3987 (http://tools.ietf.org/html/rfc3987) -// Note: We are being more lenient, because browsers are too. -// 1. Scheme -// 2. Slashes -// 3. Username -// 4. Password -// 5. Hostname -// 6. Port -// 7. Path -// 8. Query -// 9. Fragment -// 1111111111111111 222 333333 44444 55555555555555555555555 666 77777777 8888888 999 - var URL_REGEXP = /^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i; -// eslint-disable-next-line max-len - var EMAIL_REGEXP = /^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/; - var NUMBER_REGEXP = /^\s*(-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/; - var DATE_REGEXP = /^(\d{4,})-(\d{2})-(\d{2})$/; - var DATETIMELOCAL_REGEXP = /^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/; - var WEEK_REGEXP = /^(\d{4,})-W(\d\d)$/; - var MONTH_REGEXP = /^(\d{4,})-(\d\d)$/; - var TIME_REGEXP = /^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/; - - var PARTIAL_VALIDATION_EVENTS = 'keydown wheel mousedown'; - var PARTIAL_VALIDATION_TYPES = createMap(); - forEach('date,datetime-local,month,time,week'.split(','), function(type) { - PARTIAL_VALIDATION_TYPES[type] = true; - }); - - var inputType = { - - /** - * @ngdoc input - * @name input[text] - * - * @description - * Standard HTML text input with AngularJS data binding, inherited by most of the `input` elements. - * - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} required Adds `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than - * minlength. - * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than - * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of - * any length. - * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string - * that contains the regular expression body that will be converted to a regular expression - * as in the ngPattern directive. - * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue} - * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value. - * If the expression evaluates to a RegExp object, then this is used directly. - * If the expression evaluates to a string, then it will be converted to a RegExp - * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to - * `new RegExp('^abc$')`.
    - * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to - * start at the index of the last search's match, thus not taking the whole input value into - * account. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * @param {boolean=} [ngTrim=true] If set to false AngularJS will not automatically trim the input. - * This parameter is ignored for input[type=password] controls, which will never trim the - * input. - * - * @example - - - -
    - -
    - - Required! - - Single word only! -
    - text = {{example.text}}
    - myForm.input.$valid = {{myForm.input.$valid}}
    - myForm.input.$error = {{myForm.input.$error}}
    - myForm.$valid = {{myForm.$valid}}
    - myForm.$error.required = {{!!myForm.$error.required}}
    -
    -
    - - var text = element(by.binding('example.text')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('example.text')); - - it('should initialize to model', function() { - expect(text.getText()).toContain('guest'); - expect(valid.getText()).toContain('true'); - }); - - it('should be invalid if empty', function() { - input.clear(); - input.sendKeys(''); - - expect(text.getText()).toEqual('text ='); - expect(valid.getText()).toContain('false'); - }); - - it('should be invalid if multi word', function() { - input.clear(); - input.sendKeys('hello world'); - - expect(valid.getText()).toContain('false'); - }); - -
    - */ - 'text': textInputType, - - /** - * @ngdoc input - * @name input[date] - * - * @description - * Input with date validation and transformation. In browsers that do not yet support - * the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601 - * date format (yyyy-MM-dd), for example: `2009-01-06`. Since many - * modern browsers do not yet support this input type, it is important to provide cues to users on the - * expected input format via a placeholder or label. - * - * The model must always be a Date object, otherwise AngularJS will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a - * valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute - * (e.g. `min="{{minDate | date:'yyyy-MM-dd'}}"`). Note that `min` will also add native HTML5 - * constraint validation. - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be - * a valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute - * (e.g. `max="{{maxDate | date:'yyyy-MM-dd'}}"`). Note that `max` will also add native HTML5 - * constraint validation. - * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO date string - * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute. - * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO date string - * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
    - - -
    - - Required! - - Not a valid date! -
    - value = {{example.value | date: "yyyy-MM-dd"}}
    - myForm.input.$valid = {{myForm.input.$valid}}
    - myForm.input.$error = {{myForm.input.$error}}
    - myForm.$valid = {{myForm.$valid}}
    - myForm.$error.required = {{!!myForm.$error.required}}
    -
    -
    - - var value = element(by.binding('example.value | date: "yyyy-MM-dd"')); - var valid = element(by.binding('myForm.input.$valid')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (see https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('2013-10-22'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('2015-01-01'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - -
    - */ - 'date': createDateInputType('date', DATE_REGEXP, - createDateParser(DATE_REGEXP, ['yyyy', 'MM', 'dd']), - 'yyyy-MM-dd'), - - /** - * @ngdoc input - * @name input[datetime-local] - * - * @description - * Input with datetime validation and transformation. In browsers that do not yet support - * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 - * local datetime format (yyyy-MM-ddTHH:mm:ss), for example: `2010-12-28T14:57:00`. - * - * The model must always be a Date object, otherwise AngularJS will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. - * This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation - * inside this attribute (e.g. `min="{{minDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}"`). - * Note that `min` will also add native HTML5 constraint validation. - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. - * This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation - * inside this attribute (e.g. `max="{{maxDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}"`). - * Note that `max` will also add native HTML5 constraint validation. - * @param {(date|string)=} ngMin Sets the `min` validation error key to the Date / ISO datetime string - * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute. - * @param {(date|string)=} ngMax Sets the `max` validation error key to the Date / ISO datetime string - * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
    - - -
    - - Required! - - Not a valid date! -
    - value = {{example.value | date: "yyyy-MM-ddTHH:mm:ss"}}
    - myForm.input.$valid = {{myForm.input.$valid}}
    - myForm.input.$error = {{myForm.input.$error}}
    - myForm.$valid = {{myForm.$valid}}
    - myForm.$error.required = {{!!myForm.$error.required}}
    -
    -
    - - var value = element(by.binding('example.value | date: "yyyy-MM-ddTHH:mm:ss"')); - var valid = element(by.binding('myForm.input.$valid')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('2010-12-28T14:57:00'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('2015-01-01T23:59:00'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - -
    - */ - 'datetime-local': createDateInputType('datetimelocal', DATETIMELOCAL_REGEXP, - createDateParser(DATETIMELOCAL_REGEXP, ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss', 'sss']), - 'yyyy-MM-ddTHH:mm:ss.sss'), - - /** - * @ngdoc input - * @name input[time] - * - * @description - * Input with time validation and transformation. In browsers that do not yet support - * the HTML5 time input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 - * local time format (HH:mm:ss), for example: `14:57:00`. Model must be a Date object. This binding will always output a - * Date object to the model of January 1, 1970, or local date `new Date(1970, 0, 1, HH, mm, ss)`. - * - * The model must always be a Date object, otherwise AngularJS will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. - * This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this - * attribute (e.g. `min="{{minTime | date:'HH:mm:ss'}}"`). Note that `min` will also add - * native HTML5 constraint validation. - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. - * This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this - * attribute (e.g. `max="{{maxTime | date:'HH:mm:ss'}}"`). Note that `max` will also add - * native HTML5 constraint validation. - * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO time string the - * `ngMin` expression evaluates to. Note that it does not set the `min` attribute. - * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO time string the - * `ngMax` expression evaluates to. Note that it does not set the `max` attribute. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
    - - -
    - - Required! - - Not a valid date! -
    - value = {{example.value | date: "HH:mm:ss"}}
    - myForm.input.$valid = {{myForm.input.$valid}}
    - myForm.input.$error = {{myForm.input.$error}}
    - myForm.$valid = {{myForm.$valid}}
    - myForm.$error.required = {{!!myForm.$error.required}}
    -
    -
    - - var value = element(by.binding('example.value | date: "HH:mm:ss"')); - var valid = element(by.binding('myForm.input.$valid')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('14:57:00'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('23:59:00'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - -
    - */ - 'time': createDateInputType('time', TIME_REGEXP, - createDateParser(TIME_REGEXP, ['HH', 'mm', 'ss', 'sss']), - 'HH:mm:ss.sss'), - - /** - * @ngdoc input - * @name input[week] - * - * @description - * Input with week-of-the-year validation and transformation to Date. In browsers that do not yet support - * the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 - * week format (yyyy-W##), for example: `2013-W02`. - * - * The model must always be a Date object, otherwise AngularJS will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. - * This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this - * attribute (e.g. `min="{{minWeek | date:'yyyy-Www'}}"`). Note that `min` will also add - * native HTML5 constraint validation. - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. - * This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this - * attribute (e.g. `max="{{maxWeek | date:'yyyy-Www'}}"`). Note that `max` will also add - * native HTML5 constraint validation. - * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string - * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute. - * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string - * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
    - -
    - - Required! - - Not a valid date! -
    - value = {{example.value | date: "yyyy-Www"}}
    - myForm.input.$valid = {{myForm.input.$valid}}
    - myForm.input.$error = {{myForm.input.$error}}
    - myForm.$valid = {{myForm.$valid}}
    - myForm.$error.required = {{!!myForm.$error.required}}
    -
    -
    - - var value = element(by.binding('example.value | date: "yyyy-Www"')); - var valid = element(by.binding('myForm.input.$valid')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('2013-W01'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('2015-W01'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - -
    - */ - 'week': createDateInputType('week', WEEK_REGEXP, weekParser, 'yyyy-Www'), - - /** - * @ngdoc input - * @name input[month] - * - * @description - * Input with month validation and transformation. In browsers that do not yet support - * the HTML5 month input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 - * month format (yyyy-MM), for example: `2009-01`. - * - * The model must always be a Date object, otherwise AngularJS will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * If the model is not set to the first of the month, the next view to model update will set it - * to the first of the month. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. - * This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this - * attribute (e.g. `min="{{minMonth | date:'yyyy-MM'}}"`). Note that `min` will also add - * native HTML5 constraint validation. - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. - * This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this - * attribute (e.g. `max="{{maxMonth | date:'yyyy-MM'}}"`). Note that `max` will also add - * native HTML5 constraint validation. - * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string - * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute. - * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string - * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute. - - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
    - - -
    - - Required! - - Not a valid month! -
    - value = {{example.value | date: "yyyy-MM"}}
    - myForm.input.$valid = {{myForm.input.$valid}}
    - myForm.input.$error = {{myForm.input.$error}}
    - myForm.$valid = {{myForm.$valid}}
    - myForm.$error.required = {{!!myForm.$error.required}}
    -
    -
    - - var value = element(by.binding('example.value | date: "yyyy-MM"')); - var valid = element(by.binding('myForm.input.$valid')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('2013-10'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('2015-01'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - -
    - */ - 'month': createDateInputType('month', MONTH_REGEXP, - createDateParser(MONTH_REGEXP, ['yyyy', 'MM']), - 'yyyy-MM'), - - /** - * @ngdoc input - * @name input[number] - * - * @description - * Text input with number validation and transformation. Sets the `number` validation - * error if not a valid number. - * - *
    - * The model must always be of type `number` otherwise AngularJS will throw an error. - * Be aware that a string containing a number is not enough. See the {@link ngModel:numfmt} - * error docs for more information and an example of how to convert your model if necessary. - *
    - * - * ## Issues with HTML5 constraint validation - * - * In browsers that follow the - * [HTML5 specification](https://html.spec.whatwg.org/multipage/forms.html#number-state-%28type=number%29), - * `input[number]` does not work as expected with {@link ngModelOptions `ngModelOptions.allowInvalid`}. - * If a non-number is entered in the input, the browser will report the value as an empty string, - * which means the view / model values in `ngModel` and subsequently the scope value - * will also be an empty string. - * - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. - * Can be interpolated. - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. - * Can be interpolated. - * @param {string=} ngMin Like `min`, sets the `min` validation error key if the value entered is less than `ngMin`, - * but does not trigger HTML5 native validation. Takes an expression. - * @param {string=} ngMax Like `max`, sets the `max` validation error key if the value entered is greater than `ngMax`, - * but does not trigger HTML5 native validation. Takes an expression. - * @param {string=} step Sets the `step` validation error key if the value entered does not fit the `step` constraint. - * Can be interpolated. - * @param {string=} ngStep Like `step`, sets the `step` validation error key if the value entered does not fit the `ngStep` constraint, - * but does not trigger HTML5 native validation. Takes an expression. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than - * minlength. - * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than - * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of - * any length. - * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string - * that contains the regular expression body that will be converted to a regular expression - * as in the ngPattern directive. - * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue} - * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value. - * If the expression evaluates to a RegExp object, then this is used directly. - * If the expression evaluates to a string, then it will be converted to a RegExp - * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to - * `new RegExp('^abc$')`.
    - * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to - * start at the index of the last search's match, thus not taking the whole input value into - * account. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
    - -
    - - Required! - - Not valid number! -
    - value = {{example.value}}
    - myForm.input.$valid = {{myForm.input.$valid}}
    - myForm.input.$error = {{myForm.input.$error}}
    - myForm.$valid = {{myForm.$valid}}
    - myForm.$error.required = {{!!myForm.$error.required}}
    -
    -
    - - var value = element(by.binding('example.value')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('example.value')); - - it('should initialize to model', function() { - expect(value.getText()).toContain('12'); - expect(valid.getText()).toContain('true'); - }); - - it('should be invalid if empty', function() { - input.clear(); - input.sendKeys(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('false'); - }); - - it('should be invalid if over max', function() { - input.clear(); - input.sendKeys('123'); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('false'); - }); - -
    - */ - 'number': numberInputType, - - - /** - * @ngdoc input - * @name input[url] - * - * @description - * Text input with URL validation. Sets the `url` validation error key if the content is not a - * valid URL. - * - *
    - * **Note:** `input[url]` uses a regex to validate urls that is derived from the regex - * used in Chromium. If you need stricter validation, you can use `ng-pattern` or modify - * the built-in validators (see the {@link guide/forms Forms guide}) - *
    - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than - * minlength. - * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than - * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of - * any length. - * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string - * that contains the regular expression body that will be converted to a regular expression - * as in the ngPattern directive. - * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue} - * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value. - * If the expression evaluates to a RegExp object, then this is used directly. - * If the expression evaluates to a string, then it will be converted to a RegExp - * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to - * `new RegExp('^abc$')`.
    - * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to - * start at the index of the last search's match, thus not taking the whole input value into - * account. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
    -
    - - var text = element(by.binding('url.text')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('url.text')); - - it('should initialize to model', function() { - expect(text.getText()).toContain('http://google.com'); - expect(valid.getText()).toContain('true'); - }); - - it('should be invalid if empty', function() { - input.clear(); - input.sendKeys(''); - - expect(text.getText()).toEqual('text ='); - expect(valid.getText()).toContain('false'); - }); - - it('should be invalid if not url', function() { - input.clear(); - input.sendKeys('box'); - - expect(valid.getText()).toContain('false'); - }); - -
    - */ - 'url': urlInputType, - - - /** - * @ngdoc input - * @name input[email] - * - * @description - * Text input with email validation. Sets the `email` validation error key if not a valid email - * address. - * - *
    - * **Note:** `input[email]` uses a regex to validate email addresses that is derived from the regex - * used in Chromium. If you need stricter validation (e.g. requiring a top-level domain), you can - * use `ng-pattern` or modify the built-in validators (see the {@link guide/forms Forms guide}) - *
    - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than - * minlength. - * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than - * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of - * any length. - * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string - * that contains the regular expression body that will be converted to a regular expression - * as in the ngPattern directive. - * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue} - * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value. - * If the expression evaluates to a RegExp object, then this is used directly. - * If the expression evaluates to a string, then it will be converted to a RegExp - * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to - * `new RegExp('^abc$')`.
    - * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to - * start at the index of the last search's match, thus not taking the whole input value into - * account. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
    - -
    - - Required! - - Not valid email! -
    - text = {{email.text}}
    - myForm.input.$valid = {{myForm.input.$valid}}
    - myForm.input.$error = {{myForm.input.$error}}
    - myForm.$valid = {{myForm.$valid}}
    - myForm.$error.required = {{!!myForm.$error.required}}
    - myForm.$error.email = {{!!myForm.$error.email}}
    -
    -
    - - var text = element(by.binding('email.text')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('email.text')); - - it('should initialize to model', function() { - expect(text.getText()).toContain('me@example.com'); - expect(valid.getText()).toContain('true'); - }); - - it('should be invalid if empty', function() { - input.clear(); - input.sendKeys(''); - expect(text.getText()).toEqual('text ='); - expect(valid.getText()).toContain('false'); - }); - - it('should be invalid if not email', function() { - input.clear(); - input.sendKeys('xxx'); - - expect(valid.getText()).toContain('false'); - }); - -
    - */ - 'email': emailInputType, - - - /** - * @ngdoc input - * @name input[radio] - * - * @description - * HTML radio button. - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string} value The value to which the `ngModel` expression should be set when selected. - * Note that `value` only supports `string` values, i.e. the scope model needs to be a string, - * too. Use `ngValue` if you need complex models (`number`, `object`, ...). - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * @param {string} ngValue AngularJS expression to which `ngModel` will be be set when the radio - * is selected. Should be used instead of the `value` attribute if you need - * a non-string `ngModel` (`boolean`, `array`, ...). - * - * @example - - - -
    -
    -
    -
    - color = {{color.name | json}}
    -
    - Note that `ng-value="specialValue"` sets radio item's value to be the value of `$scope.specialValue`. -
    - - it('should change state', function() { - var inputs = element.all(by.model('color.name')); - var color = element(by.binding('color.name')); - - expect(color.getText()).toContain('blue'); - - inputs.get(0).click(); - expect(color.getText()).toContain('red'); - - inputs.get(1).click(); - expect(color.getText()).toContain('green'); - }); - -
    - */ - 'radio': radioInputType, - - /** - * @ngdoc input - * @name input[range] - * - * @description - * Native range input with validation and transformation. - * - * The model for the range input must always be a `Number`. - * - * IE9 and other browsers that do not support the `range` type fall back - * to a text input without any default values for `min`, `max` and `step`. Model binding, - * validation and number parsing are nevertheless supported. - * - * Browsers that support range (latest Chrome, Safari, Firefox, Edge) treat `input[range]` - * in a way that never allows the input to hold an invalid value. That means: - * - any non-numerical value is set to `(max + min) / 2`. - * - any numerical value that is less than the current min val, or greater than the current max val - * is set to the min / max val respectively. - * - additionally, the current `step` is respected, so the nearest value that satisfies a step - * is used. - * - * See the [HTML Spec on input[type=range]](https://www.w3.org/TR/html5/forms.html#range-state-(type=range)) - * for more info. - * - * This has the following consequences for AngularJS: - * - * Since the element value should always reflect the current model value, a range input - * will set the bound ngModel expression to the value that the browser has set for the - * input element. For example, in the following input ``, - * if the application sets `model.value = null`, the browser will set the input to `'50'`. - * AngularJS will then set the model to `50`, to prevent input and model value being out of sync. - * - * That means the model for range will immediately be set to `50` after `ngModel` has been - * initialized. It also means a range input can never have the required error. - * - * This does not only affect changes to the model value, but also to the values of the `min`, - * `max`, and `step` attributes. When these change in a way that will cause the browser to modify - * the input value, AngularJS will also update the model value. - * - * Automatic value adjustment also means that a range input element can never have the `required`, - * `min`, or `max` errors. - * - * However, `step` is currently only fully implemented by Firefox. Other browsers have problems - * when the step value changes dynamically - they do not adjust the element value correctly, but - * instead may set the `stepMismatch` error. If that's the case, the AngularJS will set the `step` - * error on the input, and set the model to `undefined`. - * - * Note that `input[range]` is not compatible with`ngMax`, `ngMin`, and `ngStep`, because they do - * not set the `min` and `max` attributes, which means that the browser won't automatically adjust - * the input value based on their values, and will always assume min = 0, max = 100, and step = 1. - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation to ensure that the value entered is greater - * than `min`. Can be interpolated. - * @param {string=} max Sets the `max` validation to ensure that the value entered is less than `max`. - * Can be interpolated. - * @param {string=} step Sets the `step` validation to ensure that the value entered matches the `step` - * Can be interpolated. - * @param {string=} ngChange AngularJS expression to be executed when the ngModel value changes due - * to user interaction with the input element. - * @param {expression=} ngChecked If the expression is truthy, then the `checked` attribute will be set on the - * element. **Note** : `ngChecked` should not be used alongside `ngModel`. - * Checkout {@link ng.directive:ngChecked ngChecked} for usage. - * - * @example - - - -
    - - Model as range: -
    - Model as number:
    - Min:
    - Max:
    - value = {{value}}
    - myForm.range.$valid = {{myForm.range.$valid}}
    - myForm.range.$error = {{myForm.range.$error}} -
    -
    -
    - - * ## Range Input with ngMin & ngMax attributes - - * @example - - - -
    - Model as range: -
    - Model as number:
    - Min:
    - Max:
    - value = {{value}}
    - myForm.range.$valid = {{myForm.range.$valid}}
    - myForm.range.$error = {{myForm.range.$error}} -
    -
    -
    - - */ - 'range': rangeInputType, - - /** - * @ngdoc input - * @name input[checkbox] - * - * @description - * HTML checkbox. - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {expression=} ngTrueValue The value to which the expression should be set when selected. - * @param {expression=} ngFalseValue The value to which the expression should be set when not selected. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
    -
    -
    - value1 = {{checkboxModel.value1}}
    - value2 = {{checkboxModel.value2}}
    -
    -
    - - it('should change state', function() { - var value1 = element(by.binding('checkboxModel.value1')); - var value2 = element(by.binding('checkboxModel.value2')); - - expect(value1.getText()).toContain('true'); - expect(value2.getText()).toContain('YES'); - - element(by.model('checkboxModel.value1')).click(); - element(by.model('checkboxModel.value2')).click(); - - expect(value1.getText()).toContain('false'); - expect(value2.getText()).toContain('NO'); - }); - -
    - */ - 'checkbox': checkboxInputType, - - 'hidden': noop, - 'button': noop, - 'submit': noop, - 'reset': noop, - 'file': noop - }; - - function stringBasedInputType(ctrl) { - ctrl.$formatters.push(function(value) { - return ctrl.$isEmpty(value) ? value : value.toString(); - }); - } - - function textInputType(scope, element, attr, ctrl, $sniffer, $browser) { - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - stringBasedInputType(ctrl); - } - - function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) { - var type = lowercase(element[0].type); - - // In composition mode, users are still inputting intermediate text buffer, - // hold the listener until composition is done. - // More about composition events: https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent - if (!$sniffer.android) { - var composing = false; - - element.on('compositionstart', function() { - composing = true; - }); - - element.on('compositionend', function() { - composing = false; - listener(); - }); - } - - var timeout; - - var listener = function(ev) { - if (timeout) { - $browser.defer.cancel(timeout); - timeout = null; - } - if (composing) return; - var value = element.val(), - event = ev && ev.type; - - // By default we will trim the value - // If the attribute ng-trim exists we will avoid trimming - // If input type is 'password', the value is never trimmed - if (type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')) { - value = trim(value); - } - - // If a control is suffering from bad input (due to native validators), browsers discard its - // value, so it may be necessary to revalidate (by calling $setViewValue again) even if the - // control's value is the same empty value twice in a row. - if (ctrl.$viewValue !== value || (value === '' && ctrl.$$hasNativeValidators)) { - ctrl.$setViewValue(value, event); - } - }; - - // if the browser does support "input" event, we are fine - except on IE9 which doesn't fire the - // input event on backspace, delete or cut - if ($sniffer.hasEvent('input')) { - element.on('input', listener); - } else { - var deferListener = function(ev, input, origValue) { - if (!timeout) { - timeout = $browser.defer(function() { - timeout = null; - if (!input || input.value !== origValue) { - listener(ev); - } - }); - } - }; - - element.on('keydown', /** @this */ function(event) { - var key = event.keyCode; - - // ignore - // command modifiers arrows - if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return; - - deferListener(event, this, this.value); - }); - - // if user modifies input value using context menu in IE, we need "paste", "cut" and "drop" events to catch it - if ($sniffer.hasEvent('paste')) { - element.on('paste cut drop', deferListener); - } - } - - // if user paste into input using mouse on older browser - // or form autocomplete on newer browser, we need "change" event to catch it - element.on('change', listener); - - // Some native input types (date-family) have the ability to change validity without - // firing any input/change events. - // For these event types, when native validators are present and the browser supports the type, - // check for validity changes on various DOM events. - if (PARTIAL_VALIDATION_TYPES[type] && ctrl.$$hasNativeValidators && type === attr.type) { - element.on(PARTIAL_VALIDATION_EVENTS, /** @this */ function(ev) { - if (!timeout) { - var validity = this[VALIDITY_STATE_PROPERTY]; - var origBadInput = validity.badInput; - var origTypeMismatch = validity.typeMismatch; - timeout = $browser.defer(function() { - timeout = null; - if (validity.badInput !== origBadInput || validity.typeMismatch !== origTypeMismatch) { - listener(ev); - } - }); - } - }); - } - - ctrl.$render = function() { - // Workaround for Firefox validation #12102. - var value = ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue; - if (element.val() !== value) { - element.val(value); - } - }; - } - - function weekParser(isoWeek, existingDate) { - if (isDate(isoWeek)) { - return isoWeek; - } - - if (isString(isoWeek)) { - WEEK_REGEXP.lastIndex = 0; - var parts = WEEK_REGEXP.exec(isoWeek); - if (parts) { - var year = +parts[1], - week = +parts[2], - hours = 0, - minutes = 0, - seconds = 0, - milliseconds = 0, - firstThurs = getFirstThursdayOfYear(year), - addDays = (week - 1) * 7; - - if (existingDate) { - hours = existingDate.getHours(); - minutes = existingDate.getMinutes(); - seconds = existingDate.getSeconds(); - milliseconds = existingDate.getMilliseconds(); - } - - return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds); - } - } - - return NaN; - } - - function createDateParser(regexp, mapping) { - return function(iso, date) { - var parts, map; - - if (isDate(iso)) { - return iso; - } - - if (isString(iso)) { - // When a date is JSON'ified to wraps itself inside of an extra - // set of double quotes. This makes the date parsing code unable - // to match the date string and parse it as a date. - if (iso.charAt(0) === '"' && iso.charAt(iso.length - 1) === '"') { - iso = iso.substring(1, iso.length - 1); - } - if (ISO_DATE_REGEXP.test(iso)) { - return new Date(iso); - } - regexp.lastIndex = 0; - parts = regexp.exec(iso); - - if (parts) { - parts.shift(); - if (date) { - map = { - yyyy: date.getFullYear(), - MM: date.getMonth() + 1, - dd: date.getDate(), - HH: date.getHours(), - mm: date.getMinutes(), - ss: date.getSeconds(), - sss: date.getMilliseconds() / 1000 - }; - } else { - map = { yyyy: 1970, MM: 1, dd: 1, HH: 0, mm: 0, ss: 0, sss: 0 }; - } - - forEach(parts, function(part, index) { - if (index < mapping.length) { - map[mapping[index]] = +part; - } - }); - return new Date(map.yyyy, map.MM - 1, map.dd, map.HH, map.mm, map.ss || 0, map.sss * 1000 || 0); - } - } - - return NaN; - }; - } - - function createDateInputType(type, regexp, parseDate, format) { - return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter) { - badInputChecker(scope, element, attr, ctrl); - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - var timezone = ctrl && ctrl.$options.getOption('timezone'); - var previousDate; - - ctrl.$$parserName = type; - ctrl.$parsers.push(function(value) { - if (ctrl.$isEmpty(value)) return null; - if (regexp.test(value)) { - // Note: We cannot read ctrl.$modelValue, as there might be a different - // parser/formatter in the processing chain so that the model - // contains some different data format! - var parsedDate = parseDate(value, previousDate); - if (timezone) { - parsedDate = convertTimezoneToLocal(parsedDate, timezone); - } - return parsedDate; - } - return undefined; - }); - - ctrl.$formatters.push(function(value) { - if (value && !isDate(value)) { - throw ngModelMinErr('datefmt', 'Expected `{0}` to be a date', value); - } - if (isValidDate(value)) { - previousDate = value; - if (previousDate && timezone) { - previousDate = convertTimezoneToLocal(previousDate, timezone, true); - } - return $filter('date')(value, format, timezone); - } else { - previousDate = null; - return ''; - } - }); - - if (isDefined(attr.min) || attr.ngMin) { - var minVal; - ctrl.$validators.min = function(value) { - return !isValidDate(value) || isUndefined(minVal) || parseDate(value) >= minVal; - }; - attr.$observe('min', function(val) { - minVal = parseObservedDateValue(val); - ctrl.$validate(); - }); - } - - if (isDefined(attr.max) || attr.ngMax) { - var maxVal; - ctrl.$validators.max = function(value) { - return !isValidDate(value) || isUndefined(maxVal) || parseDate(value) <= maxVal; - }; - attr.$observe('max', function(val) { - maxVal = parseObservedDateValue(val); - ctrl.$validate(); - }); - } - - function isValidDate(value) { - // Invalid Date: getTime() returns NaN - return value && !(value.getTime && value.getTime() !== value.getTime()); - } - - function parseObservedDateValue(val) { - return isDefined(val) && !isDate(val) ? parseDate(val) || undefined : val; - } - }; - } - - function badInputChecker(scope, element, attr, ctrl) { - var node = element[0]; - var nativeValidation = ctrl.$$hasNativeValidators = isObject(node.validity); - if (nativeValidation) { - ctrl.$parsers.push(function(value) { - var validity = element.prop(VALIDITY_STATE_PROPERTY) || {}; - return validity.badInput || validity.typeMismatch ? undefined : value; - }); - } - } - - function numberFormatterParser(ctrl) { - ctrl.$$parserName = 'number'; - ctrl.$parsers.push(function(value) { - if (ctrl.$isEmpty(value)) return null; - if (NUMBER_REGEXP.test(value)) return parseFloat(value); - return undefined; - }); - - ctrl.$formatters.push(function(value) { - if (!ctrl.$isEmpty(value)) { - if (!isNumber(value)) { - throw ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value); - } - value = value.toString(); - } - return value; - }); - } - - function parseNumberAttrVal(val) { - if (isDefined(val) && !isNumber(val)) { - val = parseFloat(val); - } - return !isNumberNaN(val) ? val : undefined; - } - - function isNumberInteger(num) { - // See http://stackoverflow.com/questions/14636536/how-to-check-if-a-variable-is-an-integer-in-javascript#14794066 - // (minus the assumption that `num` is a number) - - // eslint-disable-next-line no-bitwise - return (num | 0) === num; - } - - function countDecimals(num) { - var numString = num.toString(); - var decimalSymbolIndex = numString.indexOf('.'); - - if (decimalSymbolIndex === -1) { - if (-1 < num && num < 1) { - // It may be in the exponential notation format (`1e-X`) - var match = /e-(\d+)$/.exec(numString); - - if (match) { - return Number(match[1]); - } - } - - return 0; - } - - return numString.length - decimalSymbolIndex - 1; - } - - function isValidForStep(viewValue, stepBase, step) { - // At this point `stepBase` and `step` are expected to be non-NaN values - // and `viewValue` is expected to be a valid stringified number. - var value = Number(viewValue); - - var isNonIntegerValue = !isNumberInteger(value); - var isNonIntegerStepBase = !isNumberInteger(stepBase); - var isNonIntegerStep = !isNumberInteger(step); - - // Due to limitations in Floating Point Arithmetic (e.g. `0.3 - 0.2 !== 0.1` or - // `0.5 % 0.1 !== 0`), we need to convert all numbers to integers. - if (isNonIntegerValue || isNonIntegerStepBase || isNonIntegerStep) { - var valueDecimals = isNonIntegerValue ? countDecimals(value) : 0; - var stepBaseDecimals = isNonIntegerStepBase ? countDecimals(stepBase) : 0; - var stepDecimals = isNonIntegerStep ? countDecimals(step) : 0; - - var decimalCount = Math.max(valueDecimals, stepBaseDecimals, stepDecimals); - var multiplier = Math.pow(10, decimalCount); - - value = value * multiplier; - stepBase = stepBase * multiplier; - step = step * multiplier; - - if (isNonIntegerValue) value = Math.round(value); - if (isNonIntegerStepBase) stepBase = Math.round(stepBase); - if (isNonIntegerStep) step = Math.round(step); - } - - return (value - stepBase) % step === 0; - } - - function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) { - badInputChecker(scope, element, attr, ctrl); - numberFormatterParser(ctrl); - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - - var minVal; - var maxVal; - - if (isDefined(attr.min) || attr.ngMin) { - ctrl.$validators.min = function(value) { - return ctrl.$isEmpty(value) || isUndefined(minVal) || value >= minVal; - }; - - attr.$observe('min', function(val) { - minVal = parseNumberAttrVal(val); - // TODO(matsko): implement validateLater to reduce number of validations - ctrl.$validate(); - }); - } - - if (isDefined(attr.max) || attr.ngMax) { - ctrl.$validators.max = function(value) { - return ctrl.$isEmpty(value) || isUndefined(maxVal) || value <= maxVal; - }; - - attr.$observe('max', function(val) { - maxVal = parseNumberAttrVal(val); - // TODO(matsko): implement validateLater to reduce number of validations - ctrl.$validate(); - }); - } - - if (isDefined(attr.step) || attr.ngStep) { - var stepVal; - ctrl.$validators.step = function(modelValue, viewValue) { - return ctrl.$isEmpty(viewValue) || isUndefined(stepVal) || - isValidForStep(viewValue, minVal || 0, stepVal); - }; - - attr.$observe('step', function(val) { - stepVal = parseNumberAttrVal(val); - // TODO(matsko): implement validateLater to reduce number of validations - ctrl.$validate(); - }); - } - } - - function rangeInputType(scope, element, attr, ctrl, $sniffer, $browser) { - badInputChecker(scope, element, attr, ctrl); - numberFormatterParser(ctrl); - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - - var supportsRange = ctrl.$$hasNativeValidators && element[0].type === 'range', - minVal = supportsRange ? 0 : undefined, - maxVal = supportsRange ? 100 : undefined, - stepVal = supportsRange ? 1 : undefined, - validity = element[0].validity, - hasMinAttr = isDefined(attr.min), - hasMaxAttr = isDefined(attr.max), - hasStepAttr = isDefined(attr.step); - - var originalRender = ctrl.$render; - - ctrl.$render = supportsRange && isDefined(validity.rangeUnderflow) && isDefined(validity.rangeOverflow) ? - //Browsers that implement range will set these values automatically, but reading the adjusted values after - //$render would cause the min / max validators to be applied with the wrong value - function rangeRender() { - originalRender(); - ctrl.$setViewValue(element.val()); - } : - originalRender; - - if (hasMinAttr) { - ctrl.$validators.min = supportsRange ? - // Since all browsers set the input to a valid value, we don't need to check validity - function noopMinValidator() { return true; } : - // non-support browsers validate the min val - function minValidator(modelValue, viewValue) { - return ctrl.$isEmpty(viewValue) || isUndefined(minVal) || viewValue >= minVal; - }; - - setInitialValueAndObserver('min', minChange); - } - - if (hasMaxAttr) { - ctrl.$validators.max = supportsRange ? - // Since all browsers set the input to a valid value, we don't need to check validity - function noopMaxValidator() { return true; } : - // non-support browsers validate the max val - function maxValidator(modelValue, viewValue) { - return ctrl.$isEmpty(viewValue) || isUndefined(maxVal) || viewValue <= maxVal; - }; - - setInitialValueAndObserver('max', maxChange); - } - - if (hasStepAttr) { - ctrl.$validators.step = supportsRange ? - function nativeStepValidator() { - // Currently, only FF implements the spec on step change correctly (i.e. adjusting the - // input element value to a valid value). It's possible that other browsers set the stepMismatch - // validity error instead, so we can at least report an error in that case. - return !validity.stepMismatch; - } : - // ngStep doesn't set the setp attr, so the browser doesn't adjust the input value as setting step would - function stepValidator(modelValue, viewValue) { - return ctrl.$isEmpty(viewValue) || isUndefined(stepVal) || - isValidForStep(viewValue, minVal || 0, stepVal); - }; - - setInitialValueAndObserver('step', stepChange); - } - - function setInitialValueAndObserver(htmlAttrName, changeFn) { - // interpolated attributes set the attribute value only after a digest, but we need the - // attribute value when the input is first rendered, so that the browser can adjust the - // input value based on the min/max value - element.attr(htmlAttrName, attr[htmlAttrName]); - attr.$observe(htmlAttrName, changeFn); - } - - function minChange(val) { - minVal = parseNumberAttrVal(val); - // ignore changes before model is initialized - if (isNumberNaN(ctrl.$modelValue)) { - return; - } - - if (supportsRange) { - var elVal = element.val(); - // IE11 doesn't set the el val correctly if the minVal is greater than the element value - if (minVal > elVal) { - elVal = minVal; - element.val(elVal); - } - ctrl.$setViewValue(elVal); - } else { - // TODO(matsko): implement validateLater to reduce number of validations - ctrl.$validate(); - } - } - - function maxChange(val) { - maxVal = parseNumberAttrVal(val); - // ignore changes before model is initialized - if (isNumberNaN(ctrl.$modelValue)) { - return; - } - - if (supportsRange) { - var elVal = element.val(); - // IE11 doesn't set the el val correctly if the maxVal is less than the element value - if (maxVal < elVal) { - element.val(maxVal); - // IE11 and Chrome don't set the value to the minVal when max < min - elVal = maxVal < minVal ? minVal : maxVal; - } - ctrl.$setViewValue(elVal); - } else { - // TODO(matsko): implement validateLater to reduce number of validations - ctrl.$validate(); - } - } - - function stepChange(val) { - stepVal = parseNumberAttrVal(val); - // ignore changes before model is initialized - if (isNumberNaN(ctrl.$modelValue)) { - return; - } - - // Some browsers don't adjust the input value correctly, but set the stepMismatch error - if (supportsRange && ctrl.$viewValue !== element.val()) { - ctrl.$setViewValue(element.val()); - } else { - // TODO(matsko): implement validateLater to reduce number of validations - ctrl.$validate(); - } - } - } - - function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) { - // Note: no badInputChecker here by purpose as `url` is only a validation - // in browsers, i.e. we can always read out input.value even if it is not valid! - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - stringBasedInputType(ctrl); - - ctrl.$$parserName = 'url'; - ctrl.$validators.url = function(modelValue, viewValue) { - var value = modelValue || viewValue; - return ctrl.$isEmpty(value) || URL_REGEXP.test(value); - }; - } - - function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) { - // Note: no badInputChecker here by purpose as `url` is only a validation - // in browsers, i.e. we can always read out input.value even if it is not valid! - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - stringBasedInputType(ctrl); - - ctrl.$$parserName = 'email'; - ctrl.$validators.email = function(modelValue, viewValue) { - var value = modelValue || viewValue; - return ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value); - }; - } - - function radioInputType(scope, element, attr, ctrl) { - var doTrim = !attr.ngTrim || trim(attr.ngTrim) !== 'false'; - // make the name unique, if not defined - if (isUndefined(attr.name)) { - element.attr('name', nextUid()); - } - - var listener = function(ev) { - var value; - if (element[0].checked) { - value = attr.value; - if (doTrim) { - value = trim(value); - } - ctrl.$setViewValue(value, ev && ev.type); - } - }; - - element.on('click', listener); - - ctrl.$render = function() { - var value = attr.value; - if (doTrim) { - value = trim(value); - } - element[0].checked = (value === ctrl.$viewValue); - }; - - attr.$observe('value', ctrl.$render); - } - - function parseConstantExpr($parse, context, name, expression, fallback) { - var parseFn; - if (isDefined(expression)) { - parseFn = $parse(expression); - if (!parseFn.constant) { - throw ngModelMinErr('constexpr', 'Expected constant expression for `{0}`, but saw ' + - '`{1}`.', name, expression); - } - return parseFn(context); - } - return fallback; - } - - function checkboxInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) { - var trueValue = parseConstantExpr($parse, scope, 'ngTrueValue', attr.ngTrueValue, true); - var falseValue = parseConstantExpr($parse, scope, 'ngFalseValue', attr.ngFalseValue, false); - - var listener = function(ev) { - ctrl.$setViewValue(element[0].checked, ev && ev.type); - }; - - element.on('click', listener); - - ctrl.$render = function() { - element[0].checked = ctrl.$viewValue; - }; - - // Override the standard `$isEmpty` because the $viewValue of an empty checkbox is always set to `false` - // This is because of the parser below, which compares the `$modelValue` with `trueValue` to convert - // it to a boolean. - ctrl.$isEmpty = function(value) { - return value === false; - }; - - ctrl.$formatters.push(function(value) { - return equals(value, trueValue); - }); - - ctrl.$parsers.push(function(value) { - return value ? trueValue : falseValue; - }); - } - - - /** - * @ngdoc directive - * @name textarea - * @restrict E - * - * @description - * HTML textarea element control with AngularJS data-binding. The data-binding and validation - * properties of this element are exactly the same as those of the - * {@link ng.directive:input input element}. - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than - * minlength. - * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than - * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any - * length. - * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue} - * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value. - * If the expression evaluates to a RegExp object, then this is used directly. - * If the expression evaluates to a string, then it will be converted to a RegExp - * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to - * `new RegExp('^abc$')`.
    - * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to - * start at the index of the last search's match, thus not taking the whole input value into - * account. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * @param {boolean=} [ngTrim=true] If set to false AngularJS will not automatically trim the input. - * - * @knownIssue - * - * When specifying the `placeholder` attribute of ` - *
    {{ list | json }}
    - * - * - * it("should split the text by newlines", function() { - * var listInput = element(by.model('list')); - * var output = element(by.binding('list | json')); - * listInput.sendKeys('abc\ndef\nghi'); - * expect(output.getText()).toContain('[\n "abc",\n "def",\n "ghi"\n]'); - * }); - * - * - * - */ - var ngListDirective = function() { - return { - restrict: 'A', - priority: 100, - require: 'ngModel', - link: function(scope, element, attr, ctrl) { - var ngList = attr.ngList || ', '; - var trimValues = attr.ngTrim !== 'false'; - var separator = trimValues ? trim(ngList) : ngList; - - var parse = function(viewValue) { - // If the viewValue is invalid (say required but empty) it will be `undefined` - if (isUndefined(viewValue)) return; - - var list = []; - - if (viewValue) { - forEach(viewValue.split(separator), function(value) { - if (value) list.push(trimValues ? trim(value) : value); - }); - } - - return list; - }; - - ctrl.$parsers.push(parse); - ctrl.$formatters.push(function(value) { - if (isArray(value)) { - return value.join(ngList); - } - - return undefined; - }); - - // Override the standard $isEmpty because an empty array means the input is empty. - ctrl.$isEmpty = function(value) { - return !value || !value.length; - }; - } - }; - }; - - /* global VALID_CLASS: true, - INVALID_CLASS: true, - PRISTINE_CLASS: true, - DIRTY_CLASS: true, - UNTOUCHED_CLASS: true, - TOUCHED_CLASS: true, - PENDING_CLASS: true, - addSetValidityMethod: true, - setupValidity: true, - defaultModelOptions: false -*/ - - - var VALID_CLASS = 'ng-valid', - INVALID_CLASS = 'ng-invalid', - PRISTINE_CLASS = 'ng-pristine', - DIRTY_CLASS = 'ng-dirty', - UNTOUCHED_CLASS = 'ng-untouched', - TOUCHED_CLASS = 'ng-touched', - EMPTY_CLASS = 'ng-empty', - NOT_EMPTY_CLASS = 'ng-not-empty'; - - var ngModelMinErr = minErr('ngModel'); - - /** - * @ngdoc type - * @name ngModel.NgModelController - * @property {*} $viewValue The actual value from the control's view. For `input` elements, this is a - * String. See {@link ngModel.NgModelController#$setViewValue} for information about when the $viewValue - * is set. - * - * @property {*} $modelValue The value in the model that the control is bound to. - * - * @property {Array.} $parsers Array of functions to execute, as a pipeline, whenever - * the control updates the ngModelController with a new {@link ngModel.NgModelController#$viewValue - `$viewValue`} from the DOM, usually via user input. - See {@link ngModel.NgModelController#$setViewValue `$setViewValue()`} for a detailed lifecycle explanation. - Note that the `$parsers` are not called when the bound ngModel expression changes programmatically. - - The functions are called in array order, each passing - its return value through to the next. The last return value is forwarded to the - {@link ngModel.NgModelController#$validators `$validators`} collection. - - Parsers are used to sanitize / convert the {@link ngModel.NgModelController#$viewValue - `$viewValue`}. - - Returning `undefined` from a parser means a parse error occurred. In that case, - no {@link ngModel.NgModelController#$validators `$validators`} will run and the `ngModel` - will be set to `undefined` unless {@link ngModelOptions `ngModelOptions.allowInvalid`} - is set to `true`. The parse error is stored in `ngModel.$error.parse`. - - This simple example shows a parser that would convert text input value to lowercase: - * ```js - * function parse(value) { - * if (value) { - * return value.toLowerCase(); - * } - * } - * ngModelController.$parsers.push(parse); - * ``` - - * - * @property {Array.} $formatters Array of functions to execute, as a pipeline, whenever - the bound ngModel expression changes programmatically. The `$formatters` are not called when the - value of the control is changed by user interaction. - - Formatters are used to format / convert the {@link ngModel.NgModelController#$modelValue - `$modelValue`} for display in the control. - - The functions are called in reverse array order, each passing the value through to the - next. The last return value is used as the actual DOM value. - - This simple example shows a formatter that would convert the model value to uppercase: - - * ```js - * function format(value) { - * if (value) { - * return value.toUpperCase(); - * } - * } - * ngModel.$formatters.push(format); - * ``` - * - * @property {Object.} $validators A collection of validators that are applied - * whenever the model value changes. The key value within the object refers to the name of the - * validator while the function refers to the validation operation. The validation operation is - * provided with the model value as an argument and must return a true or false value depending - * on the response of that validation. - * - * ```js - * ngModel.$validators.validCharacters = function(modelValue, viewValue) { - * var value = modelValue || viewValue; - * return /[0-9]+/.test(value) && - * /[a-z]+/.test(value) && - * /[A-Z]+/.test(value) && - * /\W+/.test(value); - * }; - * ``` - * - * @property {Object.} $asyncValidators A collection of validations that are expected to - * perform an asynchronous validation (e.g. a HTTP request). The validation function that is provided - * is expected to return a promise when it is run during the model validation process. Once the promise - * is delivered then the validation status will be set to true when fulfilled and false when rejected. - * When the asynchronous validators are triggered, each of the validators will run in parallel and the model - * value will only be updated once all validators have been fulfilled. As long as an asynchronous validator - * is unfulfilled, its key will be added to the controllers `$pending` property. Also, all asynchronous validators - * will only run once all synchronous validators have passed. - * - * Please note that if $http is used then it is important that the server returns a success HTTP response code - * in order to fulfill the validation and a status level of `4xx` in order to reject the validation. - * - * ```js - * ngModel.$asyncValidators.uniqueUsername = function(modelValue, viewValue) { - * var value = modelValue || viewValue; - * - * // Lookup user by username - * return $http.get('/api/users/' + value). - * then(function resolved() { - * //username exists, this means validation fails - * return $q.reject('exists'); - * }, function rejected() { - * //username does not exist, therefore this validation passes - * return true; - * }); - * }; - * ``` - * - * @property {Array.} $viewChangeListeners Array of functions to execute whenever - * a change to {@link ngModel.NgModelController#$viewValue `$viewValue`} has caused a change - * to {@link ngModel.NgModelController#$modelValue `$modelValue`}. - * It is called with no arguments, and its return value is ignored. - * This can be used in place of additional $watches against the model value. - * - * @property {Object} $error An object hash with all failing validator ids as keys. - * @property {Object} $pending An object hash with all pending validator ids as keys. - * - * @property {boolean} $untouched True if control has not lost focus yet. - * @property {boolean} $touched True if control has lost focus. - * @property {boolean} $pristine True if user has not interacted with the control yet. - * @property {boolean} $dirty True if user has already interacted with the control. - * @property {boolean} $valid True if there is no error. - * @property {boolean} $invalid True if at least one error on the control. - * @property {string} $name The name attribute of the control. - * - * @description - * - * `NgModelController` provides API for the {@link ngModel `ngModel`} directive. - * The controller contains services for data-binding, validation, CSS updates, and value formatting - * and parsing. It purposefully does not contain any logic which deals with DOM rendering or - * listening to DOM events. - * Such DOM related logic should be provided by other directives which make use of - * `NgModelController` for data-binding to control elements. - * AngularJS provides this DOM logic for most {@link input `input`} elements. - * At the end of this page you can find a {@link ngModel.NgModelController#custom-control-example - * custom control example} that uses `ngModelController` to bind to `contenteditable` elements. - * - * @example - * ### Custom Control Example - * This example shows how to use `NgModelController` with a custom control to achieve - * data-binding. Notice how different directives (`contenteditable`, `ng-model`, and `required`) - * collaborate together to achieve the desired result. - * - * `contenteditable` is an HTML5 attribute, which tells the browser to let the element - * contents be edited in place by the user. - * - * We are using the {@link ng.service:$sce $sce} service here and include the {@link ngSanitize $sanitize} - * module to automatically remove "bad" content like inline event listener (e.g. ``). - * However, as we are using `$sce` the model can still decide to provide unsafe content if it marks - * that content using the `$sce` service. - * - * - - [contenteditable] { - border: 1px solid black; - background-color: white; - min-height: 20px; - } - - .ng-invalid { - border: 1px solid red; - } - - - - angular.module('customControl', ['ngSanitize']). - directive('contenteditable', ['$sce', function($sce) { - return { - restrict: 'A', // only activate on element attribute - require: '?ngModel', // get a hold of NgModelController - link: function(scope, element, attrs, ngModel) { - if (!ngModel) return; // do nothing if no ng-model - - // Specify how UI should be updated - ngModel.$render = function() { - element.html($sce.getTrustedHtml(ngModel.$viewValue || '')); - }; - - // Listen for change events to enable binding - element.on('blur keyup change', function() { - scope.$evalAsync(read); - }); - read(); // initialize - - // Write data to the model - function read() { - var html = element.html(); - // When we clear the content editable the browser leaves a
    behind - // If strip-br attribute is provided then we strip this out - if (attrs.stripBr && html === '
    ') { - html = ''; - } - ngModel.$setViewValue(html); - } - } - }; - }]); -
    - -
    -
    Change me!
    - Required! -
    - -
    -
    - - it('should data-bind and become invalid', function() { - if (browser.params.browser === 'safari' || browser.params.browser === 'firefox') { - // SafariDriver can't handle contenteditable - // and Firefox driver can't clear contenteditables very well - return; - } - var contentEditable = element(by.css('[contenteditable]')); - var content = 'Change me!'; - - expect(contentEditable.getText()).toEqual(content); - - contentEditable.clear(); - contentEditable.sendKeys(protractor.Key.BACK_SPACE); - expect(contentEditable.getText()).toEqual(''); - expect(contentEditable.getAttribute('class')).toMatch(/ng-invalid-required/); - }); - - *
    - * - * - */ - NgModelController.$inject = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', '$animate', '$timeout', '$q', '$interpolate']; - function NgModelController($scope, $exceptionHandler, $attr, $element, $parse, $animate, $timeout, $q, $interpolate) { - this.$viewValue = Number.NaN; - this.$modelValue = Number.NaN; - this.$$rawModelValue = undefined; // stores the parsed modelValue / model set from scope regardless of validity. - this.$validators = {}; - this.$asyncValidators = {}; - this.$parsers = []; - this.$formatters = []; - this.$viewChangeListeners = []; - this.$untouched = true; - this.$touched = false; - this.$pristine = true; - this.$dirty = false; - this.$valid = true; - this.$invalid = false; - this.$error = {}; // keep invalid keys here - this.$$success = {}; // keep valid keys here - this.$pending = undefined; // keep pending keys here - this.$name = $interpolate($attr.name || '', false)($scope); - this.$$parentForm = nullFormCtrl; - this.$options = defaultModelOptions; - this.$$updateEvents = ''; - // Attach the correct context to the event handler function for updateOn - this.$$updateEventHandler = this.$$updateEventHandler.bind(this); - - this.$$parsedNgModel = $parse($attr.ngModel); - this.$$parsedNgModelAssign = this.$$parsedNgModel.assign; - this.$$ngModelGet = this.$$parsedNgModel; - this.$$ngModelSet = this.$$parsedNgModelAssign; - this.$$pendingDebounce = null; - this.$$parserValid = undefined; - - this.$$currentValidationRunId = 0; - - // https://github.com/angular/angular.js/issues/15833 - // Prevent `$$scope` from being iterated over by `copy` when NgModelController is deep watched - Object.defineProperty(this, '$$scope', {value: $scope}); - this.$$attr = $attr; - this.$$element = $element; - this.$$animate = $animate; - this.$$timeout = $timeout; - this.$$parse = $parse; - this.$$q = $q; - this.$$exceptionHandler = $exceptionHandler; - - setupValidity(this); - setupModelWatcher(this); - } - - NgModelController.prototype = { - $$initGetterSetters: function() { - if (this.$options.getOption('getterSetter')) { - var invokeModelGetter = this.$$parse(this.$$attr.ngModel + '()'), - invokeModelSetter = this.$$parse(this.$$attr.ngModel + '($$$p)'); - - this.$$ngModelGet = function($scope) { - var modelValue = this.$$parsedNgModel($scope); - if (isFunction(modelValue)) { - modelValue = invokeModelGetter($scope); - } - return modelValue; - }; - this.$$ngModelSet = function($scope, newValue) { - if (isFunction(this.$$parsedNgModel($scope))) { - invokeModelSetter($scope, {$$$p: newValue}); - } else { - this.$$parsedNgModelAssign($scope, newValue); - } - }; - } else if (!this.$$parsedNgModel.assign) { - throw ngModelMinErr('nonassign', 'Expression \'{0}\' is non-assignable. Element: {1}', - this.$$attr.ngModel, startingTag(this.$$element)); - } - }, - - - /** - * @ngdoc method - * @name ngModel.NgModelController#$render - * - * @description - * Called when the view needs to be updated. It is expected that the user of the ng-model - * directive will implement this method. - * - * The `$render()` method is invoked in the following situations: - * - * * `$rollbackViewValue()` is called. If we are rolling back the view value to the last - * committed value then `$render()` is called to update the input control. - * * The value referenced by `ng-model` is changed programmatically and both the `$modelValue` and - * the `$viewValue` are different from last time. - * - * Since `ng-model` does not do a deep watch, `$render()` is only invoked if the values of - * `$modelValue` and `$viewValue` are actually different from their previous values. If `$modelValue` - * or `$viewValue` are objects (rather than a string or number) then `$render()` will not be - * invoked if you only change a property on the objects. - */ - $render: noop, - - /** - * @ngdoc method - * @name ngModel.NgModelController#$isEmpty - * - * @description - * This is called when we need to determine if the value of an input is empty. - * - * For instance, the required directive does this to work out if the input has data or not. - * - * The default `$isEmpty` function checks whether the value is `undefined`, `''`, `null` or `NaN`. - * - * You can override this for input directives whose concept of being empty is different from the - * default. The `checkboxInputType` directive does this because in its case a value of `false` - * implies empty. - * - * @param {*} value The value of the input to check for emptiness. - * @returns {boolean} True if `value` is "empty". - */ - $isEmpty: function(value) { - // eslint-disable-next-line no-self-compare - return isUndefined(value) || value === '' || value === null || value !== value; - }, - - $$updateEmptyClasses: function(value) { - if (this.$isEmpty(value)) { - this.$$animate.removeClass(this.$$element, NOT_EMPTY_CLASS); - this.$$animate.addClass(this.$$element, EMPTY_CLASS); - } else { - this.$$animate.removeClass(this.$$element, EMPTY_CLASS); - this.$$animate.addClass(this.$$element, NOT_EMPTY_CLASS); - } - }, - - /** - * @ngdoc method - * @name ngModel.NgModelController#$setPristine - * - * @description - * Sets the control to its pristine state. - * - * This method can be called to remove the `ng-dirty` class and set the control to its pristine - * state (`ng-pristine` class). A model is considered to be pristine when the control - * has not been changed from when first compiled. - */ - $setPristine: function() { - this.$dirty = false; - this.$pristine = true; - this.$$animate.removeClass(this.$$element, DIRTY_CLASS); - this.$$animate.addClass(this.$$element, PRISTINE_CLASS); - }, - - /** - * @ngdoc method - * @name ngModel.NgModelController#$setDirty - * - * @description - * Sets the control to its dirty state. - * - * This method can be called to remove the `ng-pristine` class and set the control to its dirty - * state (`ng-dirty` class). A model is considered to be dirty when the control has been changed - * from when first compiled. - */ - $setDirty: function() { - this.$dirty = true; - this.$pristine = false; - this.$$animate.removeClass(this.$$element, PRISTINE_CLASS); - this.$$animate.addClass(this.$$element, DIRTY_CLASS); - this.$$parentForm.$setDirty(); - }, - - /** - * @ngdoc method - * @name ngModel.NgModelController#$setUntouched - * - * @description - * Sets the control to its untouched state. - * - * This method can be called to remove the `ng-touched` class and set the control to its - * untouched state (`ng-untouched` class). Upon compilation, a model is set as untouched - * by default, however this function can be used to restore that state if the model has - * already been touched by the user. - */ - $setUntouched: function() { - this.$touched = false; - this.$untouched = true; - this.$$animate.setClass(this.$$element, UNTOUCHED_CLASS, TOUCHED_CLASS); - }, - - /** - * @ngdoc method - * @name ngModel.NgModelController#$setTouched - * - * @description - * Sets the control to its touched state. - * - * This method can be called to remove the `ng-untouched` class and set the control to its - * touched state (`ng-touched` class). A model is considered to be touched when the user has - * first focused the control element and then shifted focus away from the control (blur event). - */ - $setTouched: function() { - this.$touched = true; - this.$untouched = false; - this.$$animate.setClass(this.$$element, TOUCHED_CLASS, UNTOUCHED_CLASS); - }, - - /** - * @ngdoc method - * @name ngModel.NgModelController#$rollbackViewValue - * - * @description - * Cancel an update and reset the input element's value to prevent an update to the `$modelValue`, - * which may be caused by a pending debounced event or because the input is waiting for some - * future event. - * - * If you have an input that uses `ng-model-options` to set up debounced updates or updates that - * depend on special events such as `blur`, there can be a period when the `$viewValue` is out of - * sync with the ngModel's `$modelValue`. - * - * In this case, you can use `$rollbackViewValue()` to manually cancel the debounced / future update - * and reset the input to the last committed view value. - * - * It is also possible that you run into difficulties if you try to update the ngModel's `$modelValue` - * programmatically before these debounced/future events have resolved/occurred, because AngularJS's - * dirty checking mechanism is not able to tell whether the model has actually changed or not. - * - * The `$rollbackViewValue()` method should be called before programmatically changing the model of an - * input which may have such events pending. This is important in order to make sure that the - * input field will be updated with the new model value and any pending operations are cancelled. - * - * @example - * - * - * angular.module('cancel-update-example', []) - * - * .controller('CancelUpdateController', ['$scope', function($scope) { - * $scope.model = {value1: '', value2: ''}; - * - * $scope.setEmpty = function(e, value, rollback) { - * if (e.keyCode === 27) { - * e.preventDefault(); - * if (rollback) { - * $scope.myForm[value].$rollbackViewValue(); - * } - * $scope.model[value] = ''; - * } - * }; - * }]); - * - * - *
    - *

    Both of these inputs are only updated if they are blurred. Hitting escape should - * empty them. Follow these steps and observe the difference:

    - *
      - *
    1. Type something in the input. You will see that the model is not yet updated
    2. - *
    3. Press the Escape key. - *
        - *
      1. In the first example, nothing happens, because the model is already '', and no - * update is detected. If you blur the input, the model will be set to the current view. - *
      2. - *
      3. In the second example, the pending update is cancelled, and the input is set back - * to the last committed view value (''). Blurring the input does nothing. - *
      4. - *
      - *
    4. - *
    - * - *
    - *
    - *

    Without $rollbackViewValue():

    - * - * value1: "{{ model.value1 }}" - *
    - * - *
    - *

    With $rollbackViewValue():

    - * - * value2: "{{ model.value2 }}" - *
    - *
    - *
    - *
    - - div { - display: table-cell; - } - div:nth-child(1) { - padding-right: 30px; - } - - - *
    - */ - $rollbackViewValue: function() { - this.$$timeout.cancel(this.$$pendingDebounce); - this.$viewValue = this.$$lastCommittedViewValue; - this.$render(); - }, - - /** - * @ngdoc method - * @name ngModel.NgModelController#$validate - * - * @description - * Runs each of the registered validators (first synchronous validators and then - * asynchronous validators). - * If the validity changes to invalid, the model will be set to `undefined`, - * unless {@link ngModelOptions `ngModelOptions.allowInvalid`} is `true`. - * If the validity changes to valid, it will set the model to the last available valid - * `$modelValue`, i.e. either the last parsed value or the last value set from the scope. - */ - $validate: function() { - // ignore $validate before model is initialized - if (isNumberNaN(this.$modelValue)) { - return; - } - - var viewValue = this.$$lastCommittedViewValue; - // Note: we use the $$rawModelValue as $modelValue might have been - // set to undefined during a view -> model update that found validation - // errors. We can't parse the view here, since that could change - // the model although neither viewValue nor the model on the scope changed - var modelValue = this.$$rawModelValue; - - var prevValid = this.$valid; - var prevModelValue = this.$modelValue; - - var allowInvalid = this.$options.getOption('allowInvalid'); - - var that = this; - this.$$runValidators(modelValue, viewValue, function(allValid) { - // If there was no change in validity, don't update the model - // This prevents changing an invalid modelValue to undefined - if (!allowInvalid && prevValid !== allValid) { - // Note: Don't check this.$valid here, as we could have - // external validators (e.g. calculated on the server), - // that just call $setValidity and need the model value - // to calculate their validity. - that.$modelValue = allValid ? modelValue : undefined; - - if (that.$modelValue !== prevModelValue) { - that.$$writeModelToScope(); - } - } - }); - }, - - $$runValidators: function(modelValue, viewValue, doneCallback) { - this.$$currentValidationRunId++; - var localValidationRunId = this.$$currentValidationRunId; - var that = this; - - // check parser error - if (!processParseErrors()) { - validationDone(false); - return; - } - if (!processSyncValidators()) { - validationDone(false); - return; - } - processAsyncValidators(); - - function processParseErrors() { - var errorKey = that.$$parserName || 'parse'; - if (isUndefined(that.$$parserValid)) { - setValidity(errorKey, null); - } else { - if (!that.$$parserValid) { - forEach(that.$validators, function(v, name) { - setValidity(name, null); - }); - forEach(that.$asyncValidators, function(v, name) { - setValidity(name, null); - }); - } - // Set the parse error last, to prevent unsetting it, should a $validators key == parserName - setValidity(errorKey, that.$$parserValid); - return that.$$parserValid; - } - return true; - } - - function processSyncValidators() { - var syncValidatorsValid = true; - forEach(that.$validators, function(validator, name) { - var result = Boolean(validator(modelValue, viewValue)); - syncValidatorsValid = syncValidatorsValid && result; - setValidity(name, result); - }); - if (!syncValidatorsValid) { - forEach(that.$asyncValidators, function(v, name) { - setValidity(name, null); - }); - return false; - } - return true; - } - - function processAsyncValidators() { - var validatorPromises = []; - var allValid = true; - forEach(that.$asyncValidators, function(validator, name) { - var promise = validator(modelValue, viewValue); - if (!isPromiseLike(promise)) { - throw ngModelMinErr('nopromise', - 'Expected asynchronous validator to return a promise but got \'{0}\' instead.', promise); - } - setValidity(name, undefined); - validatorPromises.push(promise.then(function() { - setValidity(name, true); - }, function() { - allValid = false; - setValidity(name, false); - })); - }); - if (!validatorPromises.length) { - validationDone(true); - } else { - that.$$q.all(validatorPromises).then(function() { - validationDone(allValid); - }, noop); - } - } - - function setValidity(name, isValid) { - if (localValidationRunId === that.$$currentValidationRunId) { - that.$setValidity(name, isValid); - } - } - - function validationDone(allValid) { - if (localValidationRunId === that.$$currentValidationRunId) { - - doneCallback(allValid); - } - } - }, - - /** - * @ngdoc method - * @name ngModel.NgModelController#$commitViewValue - * - * @description - * Commit a pending update to the `$modelValue`. - * - * Updates may be pending by a debounced event or because the input is waiting for a some future - * event defined in `ng-model-options`. this method is rarely needed as `NgModelController` - * usually handles calling this in response to input events. - */ - $commitViewValue: function() { - var viewValue = this.$viewValue; - - this.$$timeout.cancel(this.$$pendingDebounce); - - // If the view value has not changed then we should just exit, except in the case where there is - // a native validator on the element. In this case the validation state may have changed even though - // the viewValue has stayed empty. - if (this.$$lastCommittedViewValue === viewValue && (viewValue !== '' || !this.$$hasNativeValidators)) { - return; - } - this.$$updateEmptyClasses(viewValue); - this.$$lastCommittedViewValue = viewValue; - - // change to dirty - if (this.$pristine) { - this.$setDirty(); - } - this.$$parseAndValidate(); - }, - - $$parseAndValidate: function() { - var viewValue = this.$$lastCommittedViewValue; - var modelValue = viewValue; - var that = this; - - this.$$parserValid = isUndefined(modelValue) ? undefined : true; - - if (this.$$parserValid) { - for (var i = 0; i < this.$parsers.length; i++) { - modelValue = this.$parsers[i](modelValue); - if (isUndefined(modelValue)) { - this.$$parserValid = false; - break; - } - } - } - if (isNumberNaN(this.$modelValue)) { - // this.$modelValue has not been touched yet... - this.$modelValue = this.$$ngModelGet(this.$$scope); - } - var prevModelValue = this.$modelValue; - var allowInvalid = this.$options.getOption('allowInvalid'); - this.$$rawModelValue = modelValue; - - if (allowInvalid) { - this.$modelValue = modelValue; - writeToModelIfNeeded(); - } - - // Pass the $$lastCommittedViewValue here, because the cached viewValue might be out of date. - // This can happen if e.g. $setViewValue is called from inside a parser - this.$$runValidators(modelValue, this.$$lastCommittedViewValue, function(allValid) { - if (!allowInvalid) { - // Note: Don't check this.$valid here, as we could have - // external validators (e.g. calculated on the server), - // that just call $setValidity and need the model value - // to calculate their validity. - that.$modelValue = allValid ? modelValue : undefined; - writeToModelIfNeeded(); - } - }); - - function writeToModelIfNeeded() { - if (that.$modelValue !== prevModelValue) { - that.$$writeModelToScope(); - } - } - }, - - $$writeModelToScope: function() { - this.$$ngModelSet(this.$$scope, this.$modelValue); - forEach(this.$viewChangeListeners, function(listener) { - try { - listener(); - } catch (e) { - // eslint-disable-next-line no-invalid-this - this.$$exceptionHandler(e); - } - }, this); - }, - - /** - * @ngdoc method - * @name ngModel.NgModelController#$setViewValue - * - * @description - * Update the view value. - * - * This method should be called when a control wants to change the view value; typically, - * this is done from within a DOM event handler. For example, the {@link ng.directive:input input} - * directive calls it when the value of the input changes and {@link ng.directive:select select} - * calls it when an option is selected. - * - * When `$setViewValue` is called, the new `value` will be staged for committing through the `$parsers` - * and `$validators` pipelines. If there are no special {@link ngModelOptions} specified then the staged - * value is sent directly for processing through the `$parsers` pipeline. After this, the `$validators` and - * `$asyncValidators` are called and the value is applied to `$modelValue`. - * Finally, the value is set to the **expression** specified in the `ng-model` attribute and - * all the registered change listeners, in the `$viewChangeListeners` list are called. - * - * In case the {@link ng.directive:ngModelOptions ngModelOptions} directive is used with `updateOn` - * and the `default` trigger is not listed, all those actions will remain pending until one of the - * `updateOn` events is triggered on the DOM element. - * All these actions will be debounced if the {@link ng.directive:ngModelOptions ngModelOptions} - * directive is used with a custom debounce for this particular event. - * Note that a `$digest` is only triggered once the `updateOn` events are fired, or if `debounce` - * is specified, once the timer runs out. - * - * When used with standard inputs, the view value will always be a string (which is in some cases - * parsed into another type, such as a `Date` object for `input[date]`.) - * However, custom controls might also pass objects to this method. In this case, we should make - * a copy of the object before passing it to `$setViewValue`. This is because `ngModel` does not - * perform a deep watch of objects, it only looks for a change of identity. If you only change - * the property of the object then ngModel will not realize that the object has changed and - * will not invoke the `$parsers` and `$validators` pipelines. For this reason, you should - * not change properties of the copy once it has been passed to `$setViewValue`. - * Otherwise you may cause the model value on the scope to change incorrectly. - * - *
    - * In any case, the value passed to the method should always reflect the current value - * of the control. For example, if you are calling `$setViewValue` for an input element, - * you should pass the input DOM value. Otherwise, the control and the scope model become - * out of sync. It's also important to note that `$setViewValue` does not call `$render` or change - * the control's DOM value in any way. If we want to change the control's DOM value - * programmatically, we should update the `ngModel` scope expression. Its new value will be - * picked up by the model controller, which will run it through the `$formatters`, `$render` it - * to update the DOM, and finally call `$validate` on it. - *
    - * - * @param {*} value value from the view. - * @param {string} trigger Event that triggered the update. - */ - $setViewValue: function(value, trigger) { - this.$viewValue = value; - if (this.$options.getOption('updateOnDefault')) { - this.$$debounceViewValueCommit(trigger); - } - }, - - $$debounceViewValueCommit: function(trigger) { - var debounceDelay = this.$options.getOption('debounce'); - - if (isNumber(debounceDelay[trigger])) { - debounceDelay = debounceDelay[trigger]; - } else if (isNumber(debounceDelay['default'])) { - debounceDelay = debounceDelay['default']; - } - - this.$$timeout.cancel(this.$$pendingDebounce); - var that = this; - if (debounceDelay > 0) { // this fails if debounceDelay is an object - this.$$pendingDebounce = this.$$timeout(function() { - that.$commitViewValue(); - }, debounceDelay); - } else if (this.$$scope.$root.$$phase) { - this.$commitViewValue(); - } else { - this.$$scope.$apply(function() { - that.$commitViewValue(); - }); - } - }, - - /** - * @ngdoc method - * - * @name ngModel.NgModelController#$overrideModelOptions - * - * @description - * - * Override the current model options settings programmatically. - * - * The previous `ModelOptions` value will not be modified. Instead, a - * new `ModelOptions` object will inherit from the previous one overriding - * or inheriting settings that are defined in the given parameter. - * - * See {@link ngModelOptions} for information about what options can be specified - * and how model option inheritance works. - * - *
    - * **Note:** this function only affects the options set on the `ngModelController`, - * and not the options on the {@link ngModelOptions} directive from which they might have been - * obtained initially. - *
    - * - *
    - * **Note:** it is not possible to override the `getterSetter` option. - *
    - * - * @param {Object} options a hash of settings to override the previous options - * - */ - $overrideModelOptions: function(options) { - this.$options = this.$options.createChild(options); - this.$$setUpdateOnEvents(); - }, - - /** - * @ngdoc method - * - * @name ngModel.NgModelController#$processModelValue - - * @description - * - * Runs the model -> view pipeline on the current - * {@link ngModel.NgModelController#$modelValue $modelValue}. - * - * The following actions are performed by this method: - * - * - the `$modelValue` is run through the {@link ngModel.NgModelController#$formatters $formatters} - * and the result is set to the {@link ngModel.NgModelController#$viewValue $viewValue} - * - the `ng-empty` or `ng-not-empty` class is set on the element - * - if the `$viewValue` has changed: - * - {@link ngModel.NgModelController#$render $render} is called on the control - * - the {@link ngModel.NgModelController#$validators $validators} are run and - * the validation status is set. - * - * This method is called by ngModel internally when the bound scope value changes. - * Application developers usually do not have to call this function themselves. - * - * This function can be used when the `$viewValue` or the rendered DOM value are not correctly - * formatted and the `$modelValue` must be run through the `$formatters` again. - * - * @example - * Consider a text input with an autocomplete list (for fruit), where the items are - * objects with a name and an id. - * A user enters `ap` and then selects `Apricot` from the list. - * Based on this, the autocomplete widget will call `$setViewValue({name: 'Apricot', id: 443})`, - * but the rendered value will still be `ap`. - * The widget can then call `ctrl.$processModelValue()` to run the model -> view - * pipeline again, which formats the object to the string `Apricot`, - * then updates the `$viewValue`, and finally renders it in the DOM. - * - * - -
    -
    - Search Fruit: - -
    -
    - Model:
    -
    {{selectedFruit | json}}
    -
    -
    -
    - - angular.module('inputExample', []) - .controller('inputController', function($scope) { - $scope.items = [ - {name: 'Apricot', id: 443}, - {name: 'Clementine', id: 972}, - {name: 'Durian', id: 169}, - {name: 'Jackfruit', id: 982}, - {name: 'Strawberry', id: 863} - ]; - }) - .component('basicAutocomplete', { - bindings: { - items: '<', - onSelect: '&' - }, - templateUrl: 'autocomplete.html', - controller: function($element, $scope) { - var that = this; - var ngModel; - - that.$postLink = function() { - ngModel = $element.find('input').controller('ngModel'); - - ngModel.$formatters.push(function(value) { - return (value && value.name) || value; - }); - - ngModel.$parsers.push(function(value) { - var match = value; - for (var i = 0; i < that.items.length; i++) { - if (that.items[i].name === value) { - match = that.items[i]; - break; - } - } - - return match; - }); - }; - - that.selectItem = function(item) { - ngModel.$setViewValue(item); - ngModel.$processModelValue(); - that.onSelect({item: item}); - }; - } - }); - - -
    - -
      -
    • - -
    • -
    -
    -
    - *
    - * - */ - $processModelValue: function() { - var viewValue = this.$$format(); - - if (this.$viewValue !== viewValue) { - this.$$updateEmptyClasses(viewValue); - this.$viewValue = this.$$lastCommittedViewValue = viewValue; - this.$render(); - // It is possible that model and view value have been updated during render - this.$$runValidators(this.$modelValue, this.$viewValue, noop); - } - }, - - /** - * This method is called internally to run the $formatters on the $modelValue - */ - $$format: function() { - var formatters = this.$formatters, - idx = formatters.length; - - var viewValue = this.$modelValue; - while (idx--) { - viewValue = formatters[idx](viewValue); - } - - return viewValue; - }, - - /** - * This method is called internally when the bound scope value changes. - */ - $$setModelValue: function(modelValue) { - this.$modelValue = this.$$rawModelValue = modelValue; - this.$$parserValid = undefined; - this.$processModelValue(); - }, - - $$setUpdateOnEvents: function() { - if (this.$$updateEvents) { - this.$$element.off(this.$$updateEvents, this.$$updateEventHandler); - } - - this.$$updateEvents = this.$options.getOption('updateOn'); - if (this.$$updateEvents) { - this.$$element.on(this.$$updateEvents, this.$$updateEventHandler); - } - }, - - $$updateEventHandler: function(ev) { - this.$$debounceViewValueCommit(ev && ev.type); - } - }; - - function setupModelWatcher(ctrl) { - // model -> value - // Note: we cannot use a normal scope.$watch as we want to detect the following: - // 1. scope value is 'a' - // 2. user enters 'b' - // 3. ng-change kicks in and reverts scope value to 'a' - // -> scope value did not change since the last digest as - // ng-change executes in apply phase - // 4. view should be changed back to 'a' - ctrl.$$scope.$watch(function ngModelWatch(scope) { - var modelValue = ctrl.$$ngModelGet(scope); - - // if scope model value and ngModel value are out of sync - // This cannot be moved to the action function, because it would not catch the - // case where the model is changed in the ngChange function or the model setter - if (modelValue !== ctrl.$modelValue && - // checks for NaN is needed to allow setting the model to NaN when there's an asyncValidator - // eslint-disable-next-line no-self-compare - (ctrl.$modelValue === ctrl.$modelValue || modelValue === modelValue) - ) { - ctrl.$$setModelValue(modelValue); - } - - return modelValue; - }); - } - - /** - * @ngdoc method - * @name ngModel.NgModelController#$setValidity - * - * @description - * Change the validity state, and notify the form. - * - * This method can be called within $parsers/$formatters or a custom validation implementation. - * However, in most cases it should be sufficient to use the `ngModel.$validators` and - * `ngModel.$asyncValidators` collections which will call `$setValidity` automatically. - * - * @param {string} validationErrorKey Name of the validator. The `validationErrorKey` will be assigned - * to either `$error[validationErrorKey]` or `$pending[validationErrorKey]` - * (for unfulfilled `$asyncValidators`), so that it is available for data-binding. - * The `validationErrorKey` should be in camelCase and will get converted into dash-case - * for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error` - * classes and can be bound to as `{{ someForm.someControl.$error.myError }}`. - * @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending (undefined), - * or skipped (null). Pending is used for unfulfilled `$asyncValidators`. - * Skipped is used by AngularJS when validators do not run because of parse errors and - * when `$asyncValidators` do not run because any of the `$validators` failed. - */ - addSetValidityMethod({ - clazz: NgModelController, - set: function(object, property) { - object[property] = true; - }, - unset: function(object, property) { - delete object[property]; - } - }); - - - /** - * @ngdoc directive - * @name ngModel - * @restrict A - * @priority 1 - * @param {expression} ngModel assignable {@link guide/expression Expression} to bind to. - * - * @description - * The `ngModel` directive binds an `input`,`select`, `textarea` (or custom form control) to a - * property on the scope using {@link ngModel.NgModelController NgModelController}, - * which is created and exposed by this directive. - * - * `ngModel` is responsible for: - * - * - Binding the view into the model, which other directives such as `input`, `textarea` or `select` - * require. - * - Providing validation behavior (i.e. required, number, email, url). - * - Keeping the state of the control (valid/invalid, dirty/pristine, touched/untouched, validation errors). - * - Setting related css classes on the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`, `ng-touched`, - * `ng-untouched`, `ng-empty`, `ng-not-empty`) including animations. - * - Registering the control with its parent {@link ng.directive:form form}. - * - * Note: `ngModel` will try to bind to the property given by evaluating the expression on the - * current scope. If the property doesn't already exist on this scope, it will be created - * implicitly and added to the scope. - * - * For best practices on using `ngModel`, see: - * - * - [Understanding Scopes](https://github.com/angular/angular.js/wiki/Understanding-Scopes) - * - * For basic examples, how to use `ngModel`, see: - * - * - {@link ng.directive:input input} - * - {@link input[text] text} - * - {@link input[checkbox] checkbox} - * - {@link input[radio] radio} - * - {@link input[number] number} - * - {@link input[email] email} - * - {@link input[url] url} - * - {@link input[date] date} - * - {@link input[datetime-local] datetime-local} - * - {@link input[time] time} - * - {@link input[month] month} - * - {@link input[week] week} - * - {@link ng.directive:select select} - * - {@link ng.directive:textarea textarea} - * - * ## Complex Models (objects or collections) - * - * By default, `ngModel` watches the model by reference, not value. This is important to know when - * binding inputs to models that are objects (e.g. `Date`) or collections (e.g. arrays). If only properties of the - * object or collection change, `ngModel` will not be notified and so the input will not be re-rendered. - * - * The model must be assigned an entirely new object or collection before a re-rendering will occur. - * - * Some directives have options that will cause them to use a custom `$watchCollection` on the model expression - * - for example, `ngOptions` will do so when a `track by` clause is included in the comprehension expression or - * if the select is given the `multiple` attribute. - * - * The `$watchCollection()` method only does a shallow comparison, meaning that changing properties deeper than the - * first level of the object (or only changing the properties of an item in the collection if it's an array) will still - * not trigger a re-rendering of the model. - * - * ## CSS classes - * The following CSS classes are added and removed on the associated input/select/textarea element - * depending on the validity of the model. - * - * - `ng-valid`: the model is valid - * - `ng-invalid`: the model is invalid - * - `ng-valid-[key]`: for each valid key added by `$setValidity` - * - `ng-invalid-[key]`: for each invalid key added by `$setValidity` - * - `ng-pristine`: the control hasn't been interacted with yet - * - `ng-dirty`: the control has been interacted with - * - `ng-touched`: the control has been blurred - * - `ng-untouched`: the control hasn't been blurred - * - `ng-pending`: any `$asyncValidators` are unfulfilled - * - `ng-empty`: the view does not contain a value or the value is deemed "empty", as defined - * by the {@link ngModel.NgModelController#$isEmpty} method - * - `ng-not-empty`: the view contains a non-empty value - * - * Keep in mind that ngAnimate can detect each of these classes when added and removed. - * - * @animations - * Animations within models are triggered when any of the associated CSS classes are added and removed - * on the input element which is attached to the model. These classes include: `.ng-pristine`, `.ng-dirty`, - * `.ng-invalid` and `.ng-valid` as well as any other validations that are performed on the model itself. - * The animations that are triggered within ngModel are similar to how they work in ngClass and - * animations can be hooked into using CSS transitions, keyframes as well as JS animations. - * - * The following example shows a simple way to utilize CSS transitions to style an input element - * that has been rendered as invalid after it has been validated: - * - *
    -     * //be sure to include ngAnimate as a module to hook into more
    -     * //advanced animations
    -     * .my-input {
    -     *   transition:0.5s linear all;
    -     *   background: white;
    -     * }
    -     * .my-input.ng-invalid {
    -     *   background: red;
    -     *   color:white;
    -     * }
    -     * 
    - * - * @example - * ### Basic Usage - * - - - -

    - Update input to see transitions when valid/invalid. - Integer is a valid value. -

    -
    - -
    -
    - *
    - * - * @example - * ### Binding to a getter/setter - * - * Sometimes it's helpful to bind `ngModel` to a getter/setter function. A getter/setter is a - * function that returns a representation of the model when called with zero arguments, and sets - * the internal state of a model when called with an argument. It's sometimes useful to use this - * for models that have an internal representation that's different from what the model exposes - * to the view. - * - *
    - * **Best Practice:** It's best to keep getters fast because AngularJS is likely to call them more - * frequently than other parts of your code. - *
    - * - * You use this behavior by adding `ng-model-options="{ getterSetter: true }"` to an element that - * has `ng-model` attached to it. You can also add `ng-model-options="{ getterSetter: true }"` to - * a `
    `, which will enable this behavior for all ``s within it. See - * {@link ng.directive:ngModelOptions `ngModelOptions`} for more. - * - * The following example shows how to use `ngModel` with a getter/setter: - * - * @example - * - -
    - - - -
    user.name = 
    -
    -
    - - angular.module('getterSetterExample', []) - .controller('ExampleController', ['$scope', function($scope) { - var _name = 'Brian'; - $scope.user = { - name: function(newName) { - // Note that newName can be undefined for two reasons: - // 1. Because it is called as a getter and thus called with no arguments - // 2. Because the property should actually be set to undefined. This happens e.g. if the - // input is invalid - return arguments.length ? (_name = newName) : _name; - } - }; - }]); - - *
    - */ - var ngModelDirective = ['$rootScope', function($rootScope) { - return { - restrict: 'A', - require: ['ngModel', '^?form', '^?ngModelOptions'], - controller: NgModelController, - // Prelink needs to run before any input directive - // so that we can set the NgModelOptions in NgModelController - // before anyone else uses it. - priority: 1, - compile: function ngModelCompile(element) { - // Setup initial state of the control - element.addClass(PRISTINE_CLASS).addClass(UNTOUCHED_CLASS).addClass(VALID_CLASS); - - return { - pre: function ngModelPreLink(scope, element, attr, ctrls) { - var modelCtrl = ctrls[0], - formCtrl = ctrls[1] || modelCtrl.$$parentForm, - optionsCtrl = ctrls[2]; - - if (optionsCtrl) { - modelCtrl.$options = optionsCtrl.$options; - } - - modelCtrl.$$initGetterSetters(); - - // notify others, especially parent forms - formCtrl.$addControl(modelCtrl); - - attr.$observe('name', function(newValue) { - if (modelCtrl.$name !== newValue) { - modelCtrl.$$parentForm.$$renameControl(modelCtrl, newValue); - } - }); - - scope.$on('$destroy', function() { - modelCtrl.$$parentForm.$removeControl(modelCtrl); - }); - }, - post: function ngModelPostLink(scope, element, attr, ctrls) { - var modelCtrl = ctrls[0]; - modelCtrl.$$setUpdateOnEvents(); - - function setTouched() { - modelCtrl.$setTouched(); - } - - element.on('blur', function() { - if (modelCtrl.$touched) return; - - if ($rootScope.$$phase) { - scope.$evalAsync(setTouched); - } else { - scope.$apply(setTouched); - } - }); - } - }; - } - }; - }]; - - /* exported defaultModelOptions */ - var defaultModelOptions; - var DEFAULT_REGEXP = /(\s+|^)default(\s+|$)/; - - /** - * @ngdoc type - * @name ModelOptions - * @description - * A container for the options set by the {@link ngModelOptions} directive - */ - function ModelOptions(options) { - this.$$options = options; - } - - ModelOptions.prototype = { - - /** - * @ngdoc method - * @name ModelOptions#getOption - * @param {string} name the name of the option to retrieve - * @returns {*} the value of the option - * @description - * Returns the value of the given option - */ - getOption: function(name) { - return this.$$options[name]; - }, - - /** - * @ngdoc method - * @name ModelOptions#createChild - * @param {Object} options a hash of options for the new child that will override the parent's options - * @return {ModelOptions} a new `ModelOptions` object initialized with the given options. - */ - createChild: function(options) { - var inheritAll = false; - - // make a shallow copy - options = extend({}, options); - - // Inherit options from the parent if specified by the value `"$inherit"` - forEach(options, /* @this */ function(option, key) { - if (option === '$inherit') { - if (key === '*') { - inheritAll = true; - } else { - options[key] = this.$$options[key]; - // `updateOn` is special so we must also inherit the `updateOnDefault` option - if (key === 'updateOn') { - options.updateOnDefault = this.$$options.updateOnDefault; - } - } - } else { - if (key === 'updateOn') { - // If the `updateOn` property contains the `default` event then we have to remove - // it from the event list and set the `updateOnDefault` flag. - options.updateOnDefault = false; - options[key] = trim(option.replace(DEFAULT_REGEXP, function() { - options.updateOnDefault = true; - return ' '; - })); - } - } - }, this); - - if (inheritAll) { - // We have a property of the form: `"*": "$inherit"` - delete options['*']; - defaults(options, this.$$options); - } - - // Finally add in any missing defaults - defaults(options, defaultModelOptions.$$options); - - return new ModelOptions(options); - } - }; - - - defaultModelOptions = new ModelOptions({ - updateOn: '', - updateOnDefault: true, - debounce: 0, - getterSetter: false, - allowInvalid: false, - timezone: null - }); - - - /** - * @ngdoc directive - * @name ngModelOptions - * @restrict A - * @priority 10 - * - * @description - * This directive allows you to modify the behaviour of {@link ngModel} directives within your - * application. You can specify an `ngModelOptions` directive on any element. All {@link ngModel} - * directives will use the options of their nearest `ngModelOptions` ancestor. - * - * The `ngModelOptions` settings are found by evaluating the value of the attribute directive as - * an AngularJS expression. This expression should evaluate to an object, whose properties contain - * the settings. For example: `
    - *
    - * - *
    - *
    - * ``` - * - * the `input` element will have the following settings - * - * ```js - * { allowInvalid: true, updateOn: 'default', debounce: 0 } - * ``` - * - * Notice that the `debounce` setting was not inherited and used the default value instead. - * - * You can specify that all undefined settings are automatically inherited from an ancestor by - * including a property with key of `"*"` and value of `"$inherit"`. - * - * For example given the following fragment of HTML - * - * - * ```html - *
    - *
    - * - *
    - *
    - * ``` - * - * the `input` element will have the following settings - * - * ```js - * { allowInvalid: true, updateOn: 'default', debounce: 200 } - * ``` - * - * Notice that the `debounce` setting now inherits the value from the outer `
    ` element. - * - * If you are creating a reusable component then you should be careful when using `"*": "$inherit"` - * since you may inadvertently inherit a setting in the future that changes the behavior of your component. - * - * - * ## Triggering and debouncing model updates - * - * The `updateOn` and `debounce` properties allow you to specify a custom list of events that will - * trigger a model update and/or a debouncing delay so that the actual update only takes place when - * a timer expires; this timer will be reset after another change takes place. - * - * Given the nature of `ngModelOptions`, the value displayed inside input fields in the view might - * be different from the value in the actual model. This means that if you update the model you - * should also invoke {@link ngModel.NgModelController#$rollbackViewValue} on the relevant input field in - * order to make sure it is synchronized with the model and that any debounced action is canceled. - * - * The easiest way to reference the control's {@link ngModel.NgModelController#$rollbackViewValue} - * method is by making sure the input is placed inside a form that has a `name` attribute. This is - * important because `form` controllers are published to the related scope under the name in their - * `name` attribute. - * - * Any pending changes will take place immediately when an enclosing form is submitted via the - * `submit` event. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit` - * to have access to the updated model. - * - * ### Overriding immediate updates - * - * The following example shows how to override immediate updates. Changes on the inputs within the - * form will update the model only when the control loses focus (blur event). If `escape` key is - * pressed while the input field is focused, the value is reset to the value in the current model. - * - * - * - *
    - *
    - *
    - *
    - *
    - *
    user.name = 
    - *
    - *
    - * - * angular.module('optionsExample', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.user = { name: 'say', data: '' }; - * - * $scope.cancel = function(e) { - * if (e.keyCode === 27) { - * $scope.userForm.userName.$rollbackViewValue(); - * } - * }; - * }]); - * - * - * var model = element(by.binding('user.name')); - * var input = element(by.model('user.name')); - * var other = element(by.model('user.data')); - * - * it('should allow custom events', function() { - * input.sendKeys(' hello'); - * input.click(); - * expect(model.getText()).toEqual('say'); - * other.click(); - * expect(model.getText()).toEqual('say hello'); - * }); - * - * it('should $rollbackViewValue when model changes', function() { - * input.sendKeys(' hello'); - * expect(input.getAttribute('value')).toEqual('say hello'); - * input.sendKeys(protractor.Key.ESCAPE); - * expect(input.getAttribute('value')).toEqual('say'); - * other.click(); - * expect(model.getText()).toEqual('say'); - * }); - * - *
    - * - * ### Debouncing updates - * - * The next example shows how to debounce model changes. Model will be updated only 1 sec after last change. - * If the `Clear` button is pressed, any debounced action is canceled and the value becomes empty. - * - * - * - *
    - *
    - * Name: - * - *
    - *
    - *
    user.name = 
    - *
    - *
    - * - * angular.module('optionsExample', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.user = { name: 'say' }; - * }]); - * - *
    - * - * - * ## Model updates and validation - * - * The default behaviour in `ngModel` is that the model value is set to `undefined` when the - * validation determines that the value is invalid. By setting the `allowInvalid` property to true, - * the model will still be updated even if the value is invalid. - * - * - * ## Connecting to the scope - * - * By setting the `getterSetter` property to true you are telling ngModel that the `ngModel` expression - * on the scope refers to a "getter/setter" function rather than the value itself. - * - * The following example shows how to bind to getter/setters: - * - * - * - *
    - *
    - * - *
    - *
    user.name = 
    - *
    - *
    - * - * angular.module('getterSetterExample', []) - * .controller('ExampleController', ['$scope', function($scope) { - * var _name = 'Brian'; - * $scope.user = { - * name: function(newName) { - * return angular.isDefined(newName) ? (_name = newName) : _name; - * } - * }; - * }]); - * - *
    - * - * - * ## Specifying timezones - * - * You can specify the timezone that date/time input directives expect by providing its name in the - * `timezone` property. - * - * - * ## Programmatically changing options - * - * The `ngModelOptions` expression is only evaluated once when the directive is linked; it is not - * watched for changes. However, it is possible to override the options on a single - * {@link ngModel.NgModelController} instance with - * {@link ngModel.NgModelController#$overrideModelOptions `NgModelController#$overrideModelOptions()`}. - * - * - * @param {Object} ngModelOptions options to apply to {@link ngModel} directives on this element and - * and its descendents. Valid keys are: - * - `updateOn`: string specifying which event should the input be bound to. You can set several - * events using an space delimited list. There is a special event called `default` that - * matches the default events belonging to the control. These are the events that are bound to - * the control, and when fired, update the `$viewValue` via `$setViewValue`. - * - * `ngModelOptions` considers every event that is not listed in `updateOn` a "default" event, - * since different control types use different default events. - * - * See also the section {@link ngModelOptions#triggering-and-debouncing-model-updates - * Triggering and debouncing model updates}. - * - * - `debounce`: integer value which contains the debounce model update value in milliseconds. A - * value of 0 triggers an immediate update. If an object is supplied instead, you can specify a - * custom value for each event. For example: - * ``` - * ng-model-options="{ - * updateOn: 'default blur click', - * debounce: { 'default': 500, 'blur': 0 } - * }" - * ``` - * - * "default" also applies to all events that are listed in `updateOn` but are not - * listed in `debounce`, i.e. "click" would also be debounced by 500 milliseconds. - * - * - `allowInvalid`: boolean value which indicates that the model can be set with values that did - * not validate correctly instead of the default behavior of setting the model to undefined. - * - `getterSetter`: boolean value which determines whether or not to treat functions bound to - * `ngModel` as getters/setters. - * - `timezone`: Defines the timezone to be used to read/write the `Date` instance in the model for - * ``, ``, ... . It understands UTC/GMT and the - * continental US time zone abbreviations, but for general use, use a time zone offset, for - * example, `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian) - * If not specified, the timezone of the browser will be used. - * - */ - var ngModelOptionsDirective = function() { - NgModelOptionsController.$inject = ['$attrs', '$scope']; - function NgModelOptionsController($attrs, $scope) { - this.$$attrs = $attrs; - this.$$scope = $scope; - } - NgModelOptionsController.prototype = { - $onInit: function() { - var parentOptions = this.parentCtrl ? this.parentCtrl.$options : defaultModelOptions; - var modelOptionsDefinition = this.$$scope.$eval(this.$$attrs.ngModelOptions); - - this.$options = parentOptions.createChild(modelOptionsDefinition); - } - }; - - return { - restrict: 'A', - // ngModelOptions needs to run before ngModel and input directives - priority: 10, - require: {parentCtrl: '?^^ngModelOptions'}, - bindToController: true, - controller: NgModelOptionsController - }; - }; - - -// shallow copy over values from `src` that are not already specified on `dst` - function defaults(dst, src) { - forEach(src, function(value, key) { - if (!isDefined(dst[key])) { - dst[key] = value; - } - }); - } - - /** - * @ngdoc directive - * @name ngNonBindable - * @restrict AC - * @priority 1000 - * @element ANY - * - * @description - * The `ngNonBindable` directive tells AngularJS not to compile or bind the contents of the current - * DOM element, including directives on the element itself that have a lower priority than - * `ngNonBindable`. This is useful if the element contains what appears to be AngularJS directives - * and bindings but which should be ignored by AngularJS. This could be the case if you have a site - * that displays snippets of code, for instance. - * - * @example - * In this example there are two locations where a simple interpolation binding (`{{}}`) is present, - * but the one wrapped in `ngNonBindable` is left alone. - * - - -
    Normal: {{1 + 2}}
    -
    Ignored: {{1 + 2}}
    -
    - - it('should check ng-non-bindable', function() { - expect(element(by.binding('1 + 2')).getText()).toContain('3'); - expect(element.all(by.css('div')).last().getText()).toMatch(/1 \+ 2/); - }); - -
    - */ - var ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 }); - - /* exported ngOptionsDirective */ - - /* global jqLiteRemove */ - - var ngOptionsMinErr = minErr('ngOptions'); - - /** - * @ngdoc directive - * @name ngOptions - * @restrict A - * - * @description - * - * The `ngOptions` attribute can be used to dynamically generate a list of `` - * DOM element. - * * `disable`: The result of this expression will be used to disable the rendered ` - * - *
    - * - *
    - *
    - *
    - * singleSelect = {{data.singleSelect}} - * - *
    - *
    - *
    - * multipleSelect = {{data.multipleSelect}}
    - * - *
    - * - * - * angular.module('staticSelect', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.data = { - * singleSelect: null, - * multipleSelect: [], - * option1: 'option-1' - * }; - * - * $scope.forceUnknownOption = function() { - * $scope.data.singleSelect = 'nonsense'; - * }; - * }]); - * - * - * - * @example - * ### Using `ngRepeat` to generate `select` options - * - * - *
    - *
    - * - * - *
    - *
    - * model = {{data.model}}
    - *
    - *
    - * - * angular.module('ngrepeatSelect', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.data = { - * model: null, - * availableOptions: [ - * {id: '1', name: 'Option A'}, - * {id: '2', name: 'Option B'}, - * {id: '3', name: 'Option C'} - * ] - * }; - * }]); - * - *
    - * - * @example - * ### Using `ngValue` to bind the model to an array of objects - * - * - *
    - *
    - * - * - *
    - *
    - *
    model = {{data.model | json}}

    - *
    - *
    - * - * angular.module('ngvalueSelect', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.data = { - * model: null, - * availableOptions: [ - {value: 'myString', name: 'string'}, - {value: 1, name: 'integer'}, - {value: true, name: 'boolean'}, - {value: null, name: 'null'}, - {value: {prop: 'value'}, name: 'object'}, - {value: ['a'], name: 'array'} - * ] - * }; - * }]); - * - *
    - * - * @example - * ### Using `select` with `ngOptions` and setting a default value - * See the {@link ngOptions ngOptions documentation} for more `ngOptions` usage examples. - * - * - * - *
    - *
    - * - * - *
    - *
    - * option = {{data.selectedOption}}
    - *
    - *
    - * - * angular.module('defaultValueSelect', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.data = { - * availableOptions: [ - * {id: '1', name: 'Option A'}, - * {id: '2', name: 'Option B'}, - * {id: '3', name: 'Option C'} - * ], - * selectedOption: {id: '3', name: 'Option C'} //This sets the default value of the select in the ui - * }; - * }]); - * - *
    - * - * @example - * ### Binding `select` to a non-string value via `ngModel` parsing / formatting - * - * - * - * - * {{ model }} - * - * - * angular.module('nonStringSelect', []) - * .run(function($rootScope) { - * $rootScope.model = { id: 2 }; - * }) - * .directive('convertToNumber', function() { - * return { - * require: 'ngModel', - * link: function(scope, element, attrs, ngModel) { - * ngModel.$parsers.push(function(val) { - * return parseInt(val, 10); - * }); - * ngModel.$formatters.push(function(val) { - * return '' + val; - * }); - * } - * }; - * }); - * - * - * it('should initialize to model', function() { - * expect(element(by.model('model.id')).$('option:checked').getText()).toEqual('Two'); - * }); - * - * - * - */ - var selectDirective = function() { - - return { - restrict: 'E', - require: ['select', '?ngModel'], - controller: SelectController, - priority: 1, - link: { - pre: selectPreLink, - post: selectPostLink - } - }; - - function selectPreLink(scope, element, attr, ctrls) { - - var selectCtrl = ctrls[0]; - var ngModelCtrl = ctrls[1]; - - // if ngModel is not defined, we don't need to do anything but set the registerOption - // function to noop, so options don't get added internally - if (!ngModelCtrl) { - selectCtrl.registerOption = noop; - return; - } - - - selectCtrl.ngModelCtrl = ngModelCtrl; - - // When the selected item(s) changes we delegate getting the value of the select control - // to the `readValue` method, which can be changed if the select can have multiple - // selected values or if the options are being generated by `ngOptions` - element.on('change', function() { - selectCtrl.removeUnknownOption(); - scope.$apply(function() { - ngModelCtrl.$setViewValue(selectCtrl.readValue()); - }); - }); - - // If the select allows multiple values then we need to modify how we read and write - // values from and to the control; also what it means for the value to be empty and - // we have to add an extra watch since ngModel doesn't work well with arrays - it - // doesn't trigger rendering if only an item in the array changes. - if (attr.multiple) { - selectCtrl.multiple = true; - - // Read value now needs to check each option to see if it is selected - selectCtrl.readValue = function readMultipleValue() { - var array = []; - forEach(element.find('option'), function(option) { - if (option.selected && !option.disabled) { - var val = option.value; - array.push(val in selectCtrl.selectValueMap ? selectCtrl.selectValueMap[val] : val); - } - }); - return array; - }; - - // Write value now needs to set the selected property of each matching option - selectCtrl.writeValue = function writeMultipleValue(value) { - forEach(element.find('option'), function(option) { - var shouldBeSelected = !!value && (includes(value, option.value) || - includes(value, selectCtrl.selectValueMap[option.value])); - var currentlySelected = option.selected; - - // Support: IE 9-11 only, Edge 12-15+ - // In IE and Edge adding options to the selection via shift+click/UP/DOWN - // will de-select already selected options if "selected" on those options was set - // more than once (i.e. when the options were already selected) - // So we only modify the selected property if necessary. - // Note: this behavior cannot be replicated via unit tests because it only shows in the - // actual user interface. - if (shouldBeSelected !== currentlySelected) { - setOptionSelectedStatus(jqLite(option), shouldBeSelected); - } - - }); - }; - - // we have to do it on each watch since ngModel watches reference, but - // we need to work of an array, so we need to see if anything was inserted/removed - var lastView, lastViewRef = NaN; - scope.$watch(function selectMultipleWatch() { - if (lastViewRef === ngModelCtrl.$viewValue && !equals(lastView, ngModelCtrl.$viewValue)) { - lastView = shallowCopy(ngModelCtrl.$viewValue); - ngModelCtrl.$render(); - } - lastViewRef = ngModelCtrl.$viewValue; - }); - - // If we are a multiple select then value is now a collection - // so the meaning of $isEmpty changes - ngModelCtrl.$isEmpty = function(value) { - return !value || value.length === 0; - }; - - } - } - - function selectPostLink(scope, element, attrs, ctrls) { - // if ngModel is not defined, we don't need to do anything - var ngModelCtrl = ctrls[1]; - if (!ngModelCtrl) return; - - var selectCtrl = ctrls[0]; - - // We delegate rendering to the `writeValue` method, which can be changed - // if the select can have multiple selected values or if the options are being - // generated by `ngOptions`. - // This must be done in the postLink fn to prevent $render to be called before - // all nodes have been linked correctly. - ngModelCtrl.$render = function() { - selectCtrl.writeValue(ngModelCtrl.$viewValue); - }; - } - }; - - -// The option directive is purely designed to communicate the existence (or lack of) -// of dynamically created (and destroyed) option elements to their containing select -// directive via its controller. - var optionDirective = ['$interpolate', function($interpolate) { - return { - restrict: 'E', - priority: 100, - compile: function(element, attr) { - var interpolateValueFn, interpolateTextFn; - - if (isDefined(attr.ngValue)) { - // Will be handled by registerOption - } else if (isDefined(attr.value)) { - // If the value attribute is defined, check if it contains an interpolation - interpolateValueFn = $interpolate(attr.value, true); - } else { - // If the value attribute is not defined then we fall back to the - // text content of the option element, which may be interpolated - interpolateTextFn = $interpolate(element.text(), true); - if (!interpolateTextFn) { - attr.$set('value', element.text()); - } - } - - return function(scope, element, attr) { - // This is an optimization over using ^^ since we don't want to have to search - // all the way to the root of the DOM for every single option element - var selectCtrlName = '$selectController', - parent = element.parent(), - selectCtrl = parent.data(selectCtrlName) || - parent.parent().data(selectCtrlName); // in case we are in optgroup - - if (selectCtrl) { - selectCtrl.registerOption(scope, element, attr, interpolateValueFn, interpolateTextFn); - } - }; - } - }; - }]; - - /** - * @ngdoc directive - * @name ngRequired - * @restrict A - * - * @param {expression} ngRequired AngularJS expression. If it evaluates to `true`, it sets the - * `required` attribute to the element and adds the `required` - * {@link ngModel.NgModelController#$validators `validator`}. - * - * @description - * - * ngRequired adds the required {@link ngModel.NgModelController#$validators `validator`} to {@link ngModel `ngModel`}. - * It is most often used for {@link input `input`} and {@link select `select`} controls, but can also be - * applied to custom controls. - * - * The directive sets the `required` attribute on the element if the AngularJS expression inside - * `ngRequired` evaluates to true. A special directive for setting `required` is necessary because we - * cannot use interpolation inside `required`. See the {@link guide/interpolation interpolation guide} - * for more info. - * - * The validator will set the `required` error key to true if the `required` attribute is set and - * calling {@link ngModel.NgModelController#$isEmpty `NgModelController.$isEmpty`} with the - * {@link ngModel.NgModelController#$viewValue `ngModel.$viewValue`} returns `true`. For example, the - * `$isEmpty()` implementation for `input[text]` checks the length of the `$viewValue`. When developing - * custom controls, `$isEmpty()` can be overwritten to account for a $viewValue that is not string-based. - * - * @example - * - * - * - *
    - *
    - * - * - *
    - * - *
    - *
    - * required error set? = {{form.input.$error.required}}
    - * model = {{model}} - *
    - *
    - *
    - * - var required = element(by.binding('form.input.$error.required')); - var model = element(by.binding('model')); - var input = element(by.id('input')); - - it('should set the required error', function() { - expect(required.getText()).toContain('true'); - - input.sendKeys('123'); - expect(required.getText()).not.toContain('true'); - expect(model.getText()).toContain('123'); - }); - * - *
    - */ - var requiredDirective = function() { - return { - restrict: 'A', - require: '?ngModel', - link: function(scope, elm, attr, ctrl) { - if (!ctrl) return; - attr.required = true; // force truthy in case we are on non input element - - ctrl.$validators.required = function(modelValue, viewValue) { - return !attr.required || !ctrl.$isEmpty(viewValue); - }; - - attr.$observe('required', function() { - ctrl.$validate(); - }); - } - }; - }; - - /** - * @ngdoc directive - * @name ngPattern - * @restrict A - * - * @param {expression|RegExp} ngPattern AngularJS expression that must evaluate to a `RegExp` or a `String` - * parsable into a `RegExp`, or a `RegExp` literal. See above for - * more details. - * - * @description - * - * ngPattern adds the pattern {@link ngModel.NgModelController#$validators `validator`} to {@link ngModel `ngModel`}. - * It is most often used for text-based {@link input `input`} controls, but can also be applied to custom text-based controls. - * - * The validator sets the `pattern` error key if the {@link ngModel.NgModelController#$viewValue `ngModel.$viewValue`} - * does not match a RegExp which is obtained from the `ngPattern` attribute value: - * - the value is an AngularJS expression: - * - If the expression evaluates to a RegExp object, then this is used directly. - * - If the expression evaluates to a string, then it will be converted to a RegExp after wrapping it - * in `^` and `$` characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`. - * - If the value is a RegExp literal, e.g. `ngPattern="/^\d+$/"`, it is used directly. - * - *
    - * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to - * start at the index of the last search's match, thus not taking the whole input value into - * account. - *
    - * - *
    - * **Note:** This directive is also added when the plain `pattern` attribute is used, with two - * differences: - *
      - *
    1. - * `ngPattern` does not set the `pattern` attribute and therefore HTML5 constraint validation is - * not available. - *
    2. - *
    3. - * The `ngPattern` attribute must be an expression, while the `pattern` value must be - * interpolated. - *
    4. - *
    - *
    - * - * @example - * - * - * - *
    - *
    - * - * - *
    - * - *
    - *
    - * input valid? = {{form.input.$valid}}
    - * model = {{model}} - *
    - *
    - *
    - * - var model = element(by.binding('model')); - var input = element(by.id('input')); - - it('should validate the input with the default pattern', function() { - input.sendKeys('aaa'); - expect(model.getText()).not.toContain('aaa'); - - input.clear().then(function() { - input.sendKeys('123'); - expect(model.getText()).toContain('123'); - }); - }); - * - *
    - */ - var patternDirective = function() { - return { - restrict: 'A', - require: '?ngModel', - link: function(scope, elm, attr, ctrl) { - if (!ctrl) return; - - var regexp, patternExp = attr.ngPattern || attr.pattern; - attr.$observe('pattern', function(regex) { - if (isString(regex) && regex.length > 0) { - regex = new RegExp('^' + regex + '$'); - } - - if (regex && !regex.test) { - throw minErr('ngPattern')('noregexp', - 'Expected {0} to be a RegExp but was {1}. Element: {2}', patternExp, - regex, startingTag(elm)); - } - - regexp = regex || undefined; - ctrl.$validate(); - }); - - ctrl.$validators.pattern = function(modelValue, viewValue) { - // HTML5 pattern constraint validates the input value, so we validate the viewValue - return ctrl.$isEmpty(viewValue) || isUndefined(regexp) || regexp.test(viewValue); - }; - } - }; - }; - - /** - * @ngdoc directive - * @name ngMaxlength - * @restrict A - * - * @param {expression} ngMaxlength AngularJS expression that must evaluate to a `Number` or `String` - * parsable into a `Number`. Used as value for the `maxlength` - * {@link ngModel.NgModelController#$validators validator}. - * - * @description - * - * ngMaxlength adds the maxlength {@link ngModel.NgModelController#$validators `validator`} to {@link ngModel `ngModel`}. - * It is most often used for text-based {@link input `input`} controls, but can also be applied to custom text-based controls. - * - * The validator sets the `maxlength` error key if the {@link ngModel.NgModelController#$viewValue `ngModel.$viewValue`} - * is longer than the integer obtained by evaluating the AngularJS expression given in the - * `ngMaxlength` attribute value. - * - *
    - * **Note:** This directive is also added when the plain `maxlength` attribute is used, with two - * differences: - *
      - *
    1. - * `ngMaxlength` does not set the `maxlength` attribute and therefore HTML5 constraint - * validation is not available. - *
    2. - *
    3. - * The `ngMaxlength` attribute must be an expression, while the `maxlength` value must be - * interpolated. - *
    4. - *
    - *
    - * - * @example - * - * - * - *
    - *
    - * - * - *
    - * - *
    - *
    - * input valid? = {{form.input.$valid}}
    - * model = {{model}} - *
    - *
    - *
    - * - var model = element(by.binding('model')); - var input = element(by.id('input')); - - it('should validate the input with the default maxlength', function() { - input.sendKeys('abcdef'); - expect(model.getText()).not.toContain('abcdef'); - - input.clear().then(function() { - input.sendKeys('abcde'); - expect(model.getText()).toContain('abcde'); - }); - }); - * - *
    - */ - var maxlengthDirective = function() { - return { - restrict: 'A', - require: '?ngModel', - link: function(scope, elm, attr, ctrl) { - if (!ctrl) return; - - var maxlength = -1; - attr.$observe('maxlength', function(value) { - var intVal = toInt(value); - maxlength = isNumberNaN(intVal) ? -1 : intVal; - ctrl.$validate(); - }); - ctrl.$validators.maxlength = function(modelValue, viewValue) { - return (maxlength < 0) || ctrl.$isEmpty(viewValue) || (viewValue.length <= maxlength); - }; - } - }; - }; - - /** - * @ngdoc directive - * @name ngMinlength - * @restrict A - * - * @param {expression} ngMinlength AngularJS expression that must evaluate to a `Number` or `String` - * parsable into a `Number`. Used as value for the `minlength` - * {@link ngModel.NgModelController#$validators validator}. - * - * @description - * - * ngMinlength adds the minlength {@link ngModel.NgModelController#$validators `validator`} to {@link ngModel `ngModel`}. - * It is most often used for text-based {@link input `input`} controls, but can also be applied to custom text-based controls. - * - * The validator sets the `minlength` error key if the {@link ngModel.NgModelController#$viewValue `ngModel.$viewValue`} - * is shorter than the integer obtained by evaluating the AngularJS expression given in the - * `ngMinlength` attribute value. - * - *
    - * **Note:** This directive is also added when the plain `minlength` attribute is used, with two - * differences: - *
      - *
    1. - * `ngMinlength` does not set the `minlength` attribute and therefore HTML5 constraint - * validation is not available. - *
    2. - *
    3. - * The `ngMinlength` value must be an expression, while the `minlength` value must be - * interpolated. - *
    4. - *
    - *
    - * - * @example - * - * - * - *
    - *
    - * - * - *
    - * - *
    - *
    - * input valid? = {{form.input.$valid}}
    - * model = {{model}} - *
    - *
    - *
    - * - var model = element(by.binding('model')); - var input = element(by.id('input')); - - it('should validate the input with the default minlength', function() { - input.sendKeys('ab'); - expect(model.getText()).not.toContain('ab'); - - input.sendKeys('abc'); - expect(model.getText()).toContain('abc'); - }); - * - *
    - */ - var minlengthDirective = function() { - return { - restrict: 'A', - require: '?ngModel', - link: function(scope, elm, attr, ctrl) { - if (!ctrl) return; - - var minlength = 0; - attr.$observe('minlength', function(value) { - minlength = toInt(value) || 0; - ctrl.$validate(); - }); - ctrl.$validators.minlength = function(modelValue, viewValue) { - return ctrl.$isEmpty(viewValue) || viewValue.length >= minlength; - }; - } - }; - }; - - if (window.angular.bootstrap) { - // AngularJS is already loaded, so we can return here... - if (window.console) { - console.log('WARNING: Tried to load AngularJS more than once.'); - } - return; - } - -// try to bind to jquery now so that one can write jqLite(fn) -// but we will rebind on bootstrap again. - bindJQuery(); - - publishExternalAPI(angular); - - angular.module("ngLocale", [], ["$provide", function($provide) { - var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; - function getDecimals(n) { - n = n + ''; - var i = n.indexOf('.'); - return (i == -1) ? 0 : n.length - i - 1; - } - - function getVF(n, opt_precision) { - var v = opt_precision; - - if (undefined === v) { - v = Math.min(getDecimals(n), 3); - } - - var base = Math.pow(10, v); - var f = ((n * base) | 0) % base; - return {v: v, f: f}; - } - - $provide.value("$locale", { - "DATETIME_FORMATS": { - "AMPMS": [ - "AM", - "PM" - ], - "DAY": [ - "Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday" - ], - "ERANAMES": [ - "Before Christ", - "Anno Domini" - ], - "ERAS": [ - "BC", - "AD" - ], - "FIRSTDAYOFWEEK": 6, - "MONTH": [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December" - ], - "SHORTDAY": [ - "Sun", - "Mon", - "Tue", - "Wed", - "Thu", - "Fri", - "Sat" - ], - "SHORTMONTH": [ - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec" - ], - "STANDALONEMONTH": [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December" - ], - "WEEKENDRANGE": [ - 5, - 6 - ], - "fullDate": "EEEE, MMMM d, y", - "longDate": "MMMM d, y", - "medium": "MMM d, y h:mm:ss a", - "mediumDate": "MMM d, y", - "mediumTime": "h:mm:ss a", - "short": "M/d/yy h:mm a", - "shortDate": "M/d/yy", - "shortTime": "h:mm a" - }, - "NUMBER_FORMATS": { - "CURRENCY_SYM": "$", - "DECIMAL_SEP": ".", - "GROUP_SEP": ",", - "PATTERNS": [ - { - "gSize": 3, - "lgSize": 3, - "maxFrac": 3, - "minFrac": 0, - "minInt": 1, - "negPre": "-", - "negSuf": "", - "posPre": "", - "posSuf": "" - }, - { - "gSize": 3, - "lgSize": 3, - "maxFrac": 2, - "minFrac": 2, - "minInt": 1, - "negPre": "-\u00a4", - "negSuf": "", - "posPre": "\u00a4", - "posSuf": "" - } - ] - }, - "id": "en-us", - "localeID": "en_US", - "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} - }); - }]); - - jqLite(function() { - angularInit(window.document, bootstrap); - }); - -})(window); - -!window.angular.$$csp().noInlineStyle && window.angular.element(document.head).prepend(''); \ No newline at end of file diff --git a/setup/pub/angular/angular.min.js b/setup/pub/angular/angular.min.js deleted file mode 100644 index 4c5793733579..000000000000 --- a/setup/pub/angular/angular.min.js +++ /dev/null @@ -1,337 +0,0 @@ -/* - AngularJS v1.6.9 - (c) 2010-2018 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(w){'use strict';function oe(a){if(B(a))u(a.objectMaxDepth)&&(Mc.objectMaxDepth=Wb(a.objectMaxDepth)?a.objectMaxDepth:NaN);else return Mc}function Wb(a){return Y(a)&&0c)return"...";var d=b.$$hashKey,g;if(I(a)){g=0;for(var f=a.length;g").append(a).html();try{return a[0].nodeType===Oa?L(b):b.match(/^(<[^>]+>)/)[1].replace(/^<([\w-]+)/,function(a,b){return"<"+L(b)})}catch(d){return L(b)}}function Tc(a){try{return decodeURIComponent(a)}catch(b){}}function ec(a){var b={};r((a||"").split("&"),function(a){var c,e,f;a&&(e=a=a.replace(/\+/g, - "%20"),c=a.indexOf("="),-1!==c&&(e=a.substring(0,c),f=a.substring(c+1)),e=Tc(e),u(e)&&(f=u(f)?Tc(f):!0,ra.call(b,e)?I(b[e])?b[e].push(f):b[e]=[b[e],f]:b[e]=f))});return b}function fc(a){var b=[];r(a,function(a,c){I(a)?r(a,function(a){b.push(ja(c,!0)+(!0===a?"":"="+ja(a,!0)))}):b.push(ja(c,!0)+(!0===a?"":"="+ja(a,!0)))});return b.length?b.join("&"):""}function fb(a){return ja(a,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ja(a,b){return encodeURIComponent(a).replace(/%40/gi, - "@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,b?"%20":"+")}function ve(a,b){var d,c,e=Ha.length;for(c=0;c protocol indicates an extension, document.location.href does not match."))}function Uc(a,b,d){B(d)||(d={});d=O({strictDi:!1},d);var c=function(){a=z(a);if(a.injector()){var c=a[0]===w.document?"document":za(a);throw qa("btstrpd",c.replace(//,">"));}b=b||[];b.unshift(["$provide",function(b){b.value("$rootElement",a)}]);d.debugInfoEnabled&&b.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]); - b.unshift("ng");c=gb(b,d.strictDi);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;w&&e.test(w.name)&&(d.debugInfoEnabled=!0,w.name=w.name.replace(e,""));if(w&&!f.test(w.name))return c();w.name=w.name.replace(f,"");$.resumeBootstrap=function(a){r(a,function(a){b.push(a)});return c()};C($.resumeDeferredBootstrap)&&$.resumeDeferredBootstrap()}function ye(){w.name= - "NG_ENABLE_DEBUG_INFO!"+w.name;w.location.reload()}function ze(a){a=$.element(a).injector();if(!a)throw qa("test");return a.get("$$testability")}function Vc(a,b){b=b||"_";return a.replace(Ae,function(a,c){return(c?b:"")+a.toLowerCase()})}function Be(){var a;if(!Wc){var b=rb();(ma=x(b)?w.jQuery:b?w[b]:void 0)&&ma.fn.on?(z=ma,O(ma.fn,{scope:Sa.scope,isolateScope:Sa.isolateScope,controller:Sa.controller,injector:Sa.injector,inheritedData:Sa.inheritedData}),a=ma.cleanData,ma.cleanData=function(b){for(var c, - e=0,f;null!=(f=b[e]);e++)(c=ma._data(f,"events"))&&c.$destroy&&ma(f).triggerHandler("$destroy");a(b)}):z=V;$.element=z;Wc=!0}}function hb(a,b,d){if(!a)throw qa("areq",b||"?",d||"required");return a}function sb(a,b,d){d&&I(a)&&(a=a[a.length-1]);hb(C(a),b,"not a function, got "+(a&&"object"===typeof a?a.constructor.name||"Object":typeof a));return a}function Ia(a,b){if("hasOwnProperty"===a)throw qa("badname",b);}function Xc(a,b,d){if(!b)return a;b=b.split(".");for(var c,e=a,f=b.length,g=0;g")+c[2];for(c=c[0];c--;)d=d.lastChild;f=db(f,d.childNodes);d=e.firstChild;d.textContent=""}else f.push(b.createTextNode(a));e.textContent="";e.innerHTML="";r(f,function(a){e.appendChild(a)});return e}function V(a){if(a instanceof V)return a;var b;E(a)&&(a=Q(a),b=!0);if(!(this instanceof V)){if(b&&"<"!==a.charAt(0))throw lc("nosel");return new V(a)}if(b){b=w.document;var d;a=(d=fg.exec(a))?[b.createElement(d[1])]:(d=fd(a,b))?d.childNodes: - [];mc(this,a)}else C(a)?gd(a):mc(this,a)}function nc(a){return a.cloneNode(!0)}function yb(a,b){!b&&jc(a)&&z.cleanData([a]);a.querySelectorAll&&z.cleanData(a.querySelectorAll("*"))}function hd(a,b,d,c){if(u(c))throw lc("offargs");var e=(c=zb(a))&&c.events,f=c&&c.handle;if(f)if(b){var g=function(b){var c=e[b];u(d)&&cb(c||[],d);u(d)&&c&&0l&&this.remove(n.key);return b}},get:function(a){if(l";b=Ba.firstChild.attributes;var d=b[0];b.removeNamedItem(d.name);d.value=c;a.attributes.setNamedItem(d)}function na(a,b){try{a.addClass(b)}catch(c){}}function da(a,b,c,d,e){a instanceof z||(a=z(a));var g=Ua(a,b,a,c,d,e);da.$$addScopeClass(a); - var f=null;return function(b,c,d){if(!a)throw ca("multilink");hb(b,"scope");e&&e.needsNewScope&&(b=b.$parent.$new());d=d||{};var h=d.parentBoundTranscludeFn,k=d.transcludeControllers;d=d.futureParentElement;h&&h.$$boundTransclude&&(h=h.$$boundTransclude);f||(f=(d=d&&d[0])?"foreignobject"!==ya(d)&&ia.call(d).match(/SVG/)?"svg":"html":"html");d="html"!==f?z(ka(f,z("
    ").append(a).html())):c?Sa.clone.call(a):a;if(k)for(var l in k)d.data("$"+l+"Controller",k[l].instance);da.$$addScopeInfo(d,b);c&& - c(d,b);g&&g(b,d,d,h);c||(a=g=null);return d}}function Ua(a,b,c,d,e,g){function f(a,c,d,e){var g,k,l,m,p,n,G;if(t)for(G=Array(c.length),m=0;ms.priority)break;if(w=s.scope)s.templateUrl||(B(w)?(aa("new/isolated scope",J||t,s,v),J=s):aa("new/isolated scope",J,s,v)),t=t||s;R=s.name;if(!u&&(s.replace&&(s.templateUrl||s.template)||s.transclude&&!s.$$tlb)){for(w=Da+1;u=a[w++];)if(u.transclude&&!u.$$tlb||u.replace&&(u.templateUrl||u.template)){Ib=!0;break}u=!0}!s.templateUrl&&s.controller&&(H=H||S(),aa("'"+R+"' controller",H[R],s,v),H[R]=s);if(w=s.transclude)if(ba=!0, - s.$$tlb||(aa("transclusion",y,s,v),y=s),"element"===w)T=!0,n=s.priority,P=v,v=d.$$element=z(da.$$createComment(R,d[R])),b=v[0],ma(g,xa.call(P,0),b),P[0].$$parentNode=P[0].parentNode,q=W(Ib,P,e,n,f&&f.name,{nonTlbTranscludeDirective:y});else{var na=S();if(B(w)){P=[];var Ua=S(),Ma=S();r(w,function(a,b){var c="?"===a.charAt(0);a=c?a.substring(1):a;Ua[a]=b;na[b]=null;Ma[b]=c});r(v.contents(),function(a){var b=Ua[Ea(ya(a))];b?(Ma[b]=!0,na[b]=na[b]||[],na[b].push(a)):P.push(a)});r(Ma,function(a,b){if(!a)throw ca("reqslot", - b);});for(var L in na)na[L]&&(na[L]=W(Ib,na[L],e))}else P=z(nc(b)).contents();v.empty();q=W(Ib,P,e,void 0,void 0,{needsNewScope:s.$$isolateScope||s.$$newScope});q.$$slots=na}if(s.template)if(M=!0,aa("template",A,s,v),A=s,w=C(s.template)?s.template(v,d):s.template,w=Ia(w),s.replace){f=s;P=kc.test(w)?qd(ka(s.templateNamespace,Q(w))):[];b=P[0];if(1!==P.length||1!==b.nodeType)throw ca("tplrt",R,"");ma(g,v,b);D={$attr:{}};w=K(b,[],D);var rc=a.splice(Da+1,a.length-(Da+1));(J||t)&&Z(w,J,t);a=a.concat(w).concat(rc); - fa(d,D);D=a.length}else v.html(w);if(s.templateUrl)M=!0,aa("template",A,s,v),A=s,s.replace&&(f=s),p=ja(a.splice(Da,a.length-Da),v,d,g,ba&&q,h,k,{controllerDirectives:H,newScopeDirective:t!==s&&t,newIsolateScopeDirective:J,templateDirective:A,nonTlbTranscludeDirective:y}),D=a.length;else if(s.compile)try{N=s.compile(v,d,q);var U=s.$$originalDirective||s;C(N)?m(null,Ra(U,N),Ta,E):N&&m(Ra(U,N.pre),Ra(U,N.post),Ta,E)}catch($){c($,za(v))}s.terminal&&(p.terminal=!0,n=Math.max(n,s.priority))}p.scope=t&& - !0===t.scope;p.transcludeOnThisElement=ba;p.templateOnThisElement=M;p.transclude=q;l.hasElementTranscludeDirective=T;return p}function X(a,b,c,d){var e;if(E(b)){var g=b.match(l);b=b.substring(g[0].length);var f=g[1]||g[3],g="?"===g[2];"^^"===f?c=c.parent():e=(e=d&&d[b])&&e.instance;if(!e){var h="$"+b+"Controller";e=f?c.inheritedData(h):c.data(h)}if(!e&&!g)throw ca("ctreq",b,a);}else if(I(b))for(e=[],f=0,g=b.length;fc.priority)&&-1!==c.restrict.indexOf(e)){k&&(c=$b(c,{$$start:k,$$end:l}));if(!c.$$bindings){var t=m=c,G=c.name,H={isolateScope:null,bindToController:null};B(t.scope)&&(!0===t.bindToController?(H.bindToController=d(t.scope,G,!0),H.isolateScope={}):H.isolateScope=d(t.scope,G,!1));B(t.bindToController)&&(H.bindToController=d(t.bindToController,G,!0));if(H.bindToController&&!t.controller)throw ca("noctrl",G);m=m.$$bindings=H;B(m.isolateScope)&&(c.$$isolateBindings=m.isolateScope)}b.push(c); - m=c}}return m}function $(b){if(f.hasOwnProperty(b))for(var c=a.get(b+"Directive"),d=0,e=c.length;d"+b+"";return c.childNodes[0].childNodes;default:return b}}function ua(a,b){if("srcdoc"===b)return T.HTML;var c=ya(a);if("src"===b||"ngSrc"===b){if(-1===["img","video","audio","source","track"].indexOf(c))return T.RESOURCE_URL}else if("xlinkHref"===b||"form"===c&&"action"===b||"link"===c&&"href"===b)return T.RESOURCE_URL}function wa(a,c,d,e,g){var f=ua(a,e),h=k[e]||g,l=b(d,!g,f,h);if(l){if("multiple"===e&&"select"===ya(a))throw ca("selmulti", - za(a));if(m.test(e))throw ca("nodomevents");c.push({priority:100,compile:function(){return{pre:function(a,c,g){c=g.$$observers||(g.$$observers=S());var k=g[e];k!==d&&(l=k&&b(k,!0,f,h),d=k);l&&(g[e]=l(a),(c[e]||(c[e]=[])).$$inter=!0,(g.$$observers&&g.$$observers[e].$$scope||a).$watch(l,function(a,b){"class"===e&&a!==b?g.$updateClass(a,b):g.$set(e,a)}))}}}})}}function ma(a,b,c){var d=b[0],e=b.length,g=d.parentNode,f,h;if(a)for(f=0,h=a.length;f=b)return a;for(;b--;){var d=a[b];(8===d.nodeType||d.nodeType===Oa&&""===d.nodeValue.trim())&&ug.call(a,b,1)}return a}function sg(a,b){if(b&&E(b))return b;if(E(a)){var d=td.exec(a);if(d)return d[3]}}function yf(){var a={},b=!1;this.has=function(b){return a.hasOwnProperty(b)};this.register=function(b, - c){Ia(b,"controller");B(b)?O(a,b):a[b]=c};this.allowGlobals=function(){b=!0};this.$get=["$injector","$window",function(d,c){function e(a,b,c,d){if(!a||!B(a.$scope))throw K("$controller")("noscp",d,b);a.$scope[b]=c}return function(f,g,h,k){var l,m,p;h=!0===h;k&&E(k)&&(p=k);if(E(f)){k=f.match(td);if(!k)throw ud("ctrlfmt",f);m=k[1];p=p||k[3];f=a.hasOwnProperty(m)?a[m]:Xc(g.$scope,m,!0)||(b?Xc(c,m,!0):void 0);if(!f)throw ud("ctrlreg",m);sb(f,m,!0)}if(h)return h=(I(f)?f[f.length-1]:f).prototype,l=Object.create(h|| - null),p&&e(g,p,l,m||f.name),O(function(){var a=d.invoke(f,l,g,m);a!==l&&(B(a)||C(a))&&(l=a,p&&e(g,p,l,m||f.name));return l},{instance:l,identifier:p});l=d.instantiate(f,g,m);p&&e(g,p,l,m||f.name);return l}}]}function zf(){this.$get=["$window",function(a){return z(a.document)}]}function Af(){this.$get=["$document","$rootScope",function(a,b){function d(){e=c.hidden}var c=a[0],e=c&&c.hidden;a.on("visibilitychange",d);b.$on("$destroy",function(){a.off("visibilitychange",d)});return function(){return e}}]} - function Bf(){this.$get=["$log",function(a){return function(b,d){a.error.apply(a,arguments)}}]}function tc(a){return B(a)?fa(a)?a.toISOString():eb(a):a}function Gf(){this.$get=function(){return function(a){if(!a)return"";var b=[];Oc(a,function(a,c){null===a||x(a)||C(a)||(I(a)?r(a,function(a){b.push(ja(c)+"="+ja(tc(a)))}):b.push(ja(c)+"="+ja(tc(a))))});return b.join("&")}}}function Hf(){this.$get=function(){return function(a){function b(a,e,f){null===a||x(a)||(I(a)?r(a,function(a,c){b(a,e+"["+(B(a)? - c:"")+"]")}):B(a)&&!fa(a)?Oc(a,function(a,c){b(a,e+(f?"":"[")+c+(f?"":"]"))}):d.push(ja(e)+"="+ja(tc(a))))}if(!a)return"";var d=[];b(a,"",!0);return d.join("&")}}}function uc(a,b){if(E(a)){var d=a.replace(vg,"").trim();if(d){var c=b("Content-Type"),c=c&&0===c.indexOf(vd),e;(e=c)||(e=(e=d.match(wg))&&xg[e[0]].test(d));if(e)try{a=Rc(d)}catch(f){if(!c)return a;throw Kb("baddata",a,f);}}}return a}function wd(a){var b=S(),d;E(a)?r(a.split("\n"),function(a){d=a.indexOf(":");var e=L(Q(a.substr(0,d)));a= - Q(a.substr(d+1));e&&(b[e]=b[e]?b[e]+", "+a:a)}):B(a)&&r(a,function(a,d){var f=L(d),g=Q(a);f&&(b[f]=b[f]?b[f]+", "+g:g)});return b}function xd(a){var b;return function(d){b||(b=wd(a));return d?(d=b[L(d)],void 0===d&&(d=null),d):b}}function yd(a,b,d,c){if(C(c))return c(a,b,d);r(c,function(c){a=c(a,b,d)});return a}function Ff(){var a=this.defaults={transformResponse:[uc],transformRequest:[function(a){return B(a)&&"[object File]"!==ia.call(a)&&"[object Blob]"!==ia.call(a)&&"[object FormData]"!==ia.call(a)? - eb(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ka(vc),put:ka(vc),patch:ka(vc)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer",jsonpCallbackParam:"callback"},b=!1;this.useApplyAsync=function(a){return u(a)?(b=!!a,this):b};var d=this.interceptors=[];this.$get=["$browser","$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector","$sce",function(c,e,f,g,h,k,l,m){function p(b){function d(a,b){for(var c=0, - e=b.length;ca?b:k.reject(b)}if(!B(b))throw K("$http")("badreq",b);if(!E(m.valueOf(b.url)))throw K("$http")("badreq",b.url);var f=O({method:"get",transformRequest:a.transformRequest,transformResponse:a.transformResponse,paramSerializer:a.paramSerializer, - jsonpCallbackParam:a.jsonpCallbackParam},b);f.headers=function(b){var c=a.headers,d=O({},b.headers),g,f,h,c=O({},c.common,c[L(b.method)]);a:for(g in c){f=L(g);for(h in d)if(L(h)===f)continue a;d[g]=c[g]}return e(d,ka(b))}(b);f.method=ub(f.method);f.paramSerializer=E(f.paramSerializer)?l.get(f.paramSerializer):f.paramSerializer;c.$$incOutstandingRequestCount();var h=[],p=[];b=k.resolve(f);r(y,function(a){(a.request||a.requestError)&&h.unshift(a.request,a.requestError);(a.response||a.responseError)&& - p.push(a.response,a.responseError)});b=d(b,h);b=b.then(function(b){var c=b.headers,d=yd(b.data,xd(c),void 0,b.transformRequest);x(d)&&r(c,function(a,b){"content-type"===L(b)&&delete c[b]});x(b.withCredentials)&&!x(a.withCredentials)&&(b.withCredentials=a.withCredentials);return n(b,d).then(g,g)});b=d(b,p);return b=b.finally(function(){c.$$completeOutstandingRequest(D)})}function n(c,d){function g(a){if(a){var c={};r(a,function(a,d){c[d]=function(c){function d(){a(c)}b?h.$applyAsync(d):h.$$phase?d(): - h.$apply(d)}});return c}}function l(a,c,d,e,g){function f(){n(c,a,d,e,g)}M&&(200<=a&&300>a?M.put(N,[a,c,wd(d),e,g]):M.remove(N));b?h.$applyAsync(f):(f(),h.$$phase||h.$apply())}function n(a,b,d,e,g){b=-1<=b?b:0;(200<=b&&300>b?J.resolve:J.reject)({data:a,status:b,headers:xd(d),config:c,statusText:e,xhrStatus:g})}function G(a){n(a.data,a.status,ka(a.headers()),a.statusText,a.xhrStatus)}function y(){var a=p.pendingRequests.indexOf(c);-1!==a&&p.pendingRequests.splice(a,1)}var J=k.defer(),R=J.promise,M, - T,P=c.headers,q="jsonp"===L(c.method),N=c.url;q?N=m.getTrustedResourceUrl(N):E(N)||(N=m.valueOf(N));N=F(N,c.paramSerializer(c.params));q&&(N=s(N,c.jsonpCallbackParam));p.pendingRequests.push(c);R.then(y,y);!c.cache&&!a.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(M=B(c.cache)?c.cache:B(a.cache)?a.cache:v);M&&(T=M.get(N),u(T)?T&&C(T.then)?T.then(G,G):I(T)?n(T[1],T[0],ka(T[2]),T[3],T[4]):n(T,200,{},"OK","complete"):M.put(N,R));x(T)&&((T=zd(c.url)?f()[c.xsrfCookieName||a.xsrfCookieName]: - void 0)&&(P[c.xsrfHeaderName||a.xsrfHeaderName]=T),e(c.method,N,d,l,P,c.timeout,c.withCredentials,c.responseType,g(c.eventHandlers),g(c.uploadEventHandlers)));return R}function F(a,b){0=l&&(r.resolve(y),v(q.$$intervalId),delete g[q.$$intervalId]);t||a.$apply()},k);g[q.$$intervalId]=r;return q} - var g={};f.cancel=function(a){return a&&a.$$intervalId in g?(g[a.$$intervalId].promise.$$state.pur=!0,g[a.$$intervalId].reject("canceled"),b.clearInterval(a.$$intervalId),delete g[a.$$intervalId],!0):!1};return f}]}function wc(a){a=a.split("/");for(var b=a.length;b--;)a[b]=fb(a[b].replace(/%2F/g,"/"));return a.join("/")}function Ad(a,b){var d=ta(a);b.$$protocol=d.protocol;b.$$host=d.hostname;b.$$port=Z(d.port)||zg[d.protocol]||null}function Bd(a,b,d){if(Ag.test(a))throw kb("badpath",a);var c="/"!== - a.charAt(0);c&&(a="/"+a);a=ta(a);for(var c=(c&&"/"===a.pathname.charAt(0)?a.pathname.substring(1):a.pathname).split("/"),e=c.length;e--;)c[e]=decodeURIComponent(c[e]),d&&(c[e]=c[e].replace(/\//g,"%2F"));d=c.join("/");b.$$path=d;b.$$search=ec(a.search);b.$$hash=decodeURIComponent(a.hash);b.$$path&&"/"!==b.$$path.charAt(0)&&(b.$$path="/"+b.$$path)}function xc(a,b){return a.slice(0,b.length)===b}function ua(a,b){if(xc(b,a))return b.substr(a.length)}function La(a){var b=a.indexOf("#");return-1===b?a: - a.substr(0,b)}function lb(a){return a.replace(/(#.+)|#$/,"$1")}function yc(a,b,d){this.$$html5=!0;d=d||"";Ad(a,this);this.$$parse=function(a){var d=ua(b,a);if(!E(d))throw kb("ipthprfx",a,b);Bd(d,this,!0);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=fc(this.$$search),d=this.$$hash?"#"+fb(this.$$hash):"";this.$$url=wc(this.$$path)+(a?"?"+a:"")+d;this.$$absUrl=b+this.$$url.substr(1);this.$$urlUpdatedByLocation=!0};this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)), - !0;var f,g;u(f=ua(a,c))?(g=f,g=d&&u(f=ua(d,f))?b+(ua("/",f)||f):a+g):u(f=ua(b,c))?g=b+f:b===c+"/"&&(g=b);g&&this.$$parse(g);return!!g}}function zc(a,b,d){Ad(a,this);this.$$parse=function(c){var e=ua(a,c)||ua(b,c),f;x(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",x(e)&&(a=c,this.replace())):(f=ua(d,e),x(f)&&(f=e));Bd(f,this,!1);c=this.$$path;var e=a,g=/^\/[A-Z]:(\/.*)/;xc(f,e)&&(f=f.replace(e,""));g.exec(f)||(c=(f=g.exec(c))?f[1]:c);this.$$path=c;this.$$compose()};this.$$compose=function(){var b=fc(this.$$search), - e=this.$$hash?"#"+fb(this.$$hash):"";this.$$url=wc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+(this.$$url?d+this.$$url:"");this.$$urlUpdatedByLocation=!0};this.$$parseLinkUrl=function(b,d){return La(a)===La(b)?(this.$$parse(b),!0):!1}}function Cd(a,b,d){this.$$html5=!0;zc.apply(this,arguments);this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;a===La(c)?f=c:(g=ua(b,c))?f=a+d+g:b===c+"/"&&(f=b);f&&this.$$parse(f);return!!f};this.$$compose=function(){var b=fc(this.$$search), - e=this.$$hash?"#"+fb(this.$$hash):"";this.$$url=wc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+d+this.$$url;this.$$urlUpdatedByLocation=!0}}function Lb(a){return function(){return this[a]}}function Dd(a,b){return function(d){if(x(d))return this[a];this[a]=b(d);this.$$compose();return this}}function Lf(){var a="!",b={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(b){return u(b)?(a=b,this):a};this.html5Mode=function(a){if(Na(a))return b.enabled=a,this;if(B(a)){Na(a.enabled)&&(b.enabled= - a.enabled);Na(a.requireBase)&&(b.requireBase=a.requireBase);if(Na(a.rewriteLinks)||E(a.rewriteLinks))b.rewriteLinks=a.rewriteLinks;return this}return b};this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(d,c,e,f,g){function h(a,b,d){var e=l.url(),g=l.$$state;try{c.url(a,b,d),l.$$state=c.state()}catch(f){throw l.url(e),l.$$state=g,f;}}function k(a,b){d.$broadcast("$locationChangeSuccess",l.absUrl(),a,l.$$state,b)}var l,m;m=c.baseHref();var p=c.url(),n;if(b.enabled){if(!m&& - b.requireBase)throw kb("nobase");n=p.substring(0,p.indexOf("/",p.indexOf("//")+2))+(m||"/");m=e.history?yc:Cd}else n=La(p),m=zc;var F=n.substr(0,La(n).lastIndexOf("/")+1);l=new m(n,F,"#"+a);l.$$parseLinkUrl(p,p);l.$$state=c.state();var s=/^\s*(javascript|mailto):/i;f.on("click",function(a){var e=b.rewriteLinks;if(e&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&2!==a.which&&2!==a.button){for(var h=z(a.target);"a"!==ya(h[0]);)if(h[0]===f[0]||!(h=h.parent())[0])return;if(!E(e)||!x(h.attr(e))){var e=h.prop("href"), - k=h.attr("href")||h.attr("xlink:href");B(e)&&"[object SVGAnimatedString]"===e.toString()&&(e=ta(e.animVal).href);s.test(e)||!e||h.attr("target")||a.isDefaultPrevented()||!l.$$parseLinkUrl(e,k)||(a.preventDefault(),l.absUrl()!==c.url()&&(d.$apply(),g.angular["ff-684208-preventDefault"]=!0))}}});lb(l.absUrl())!==lb(p)&&c.url(l.absUrl(),!0);var v=!0;c.onUrlChange(function(a,b){xc(a,F)?(d.$evalAsync(function(){var c=l.absUrl(),e=l.$$state,g;a=lb(a);l.$$parse(a);l.$$state=b;g=d.$broadcast("$locationChangeStart", - a,c,b,e).defaultPrevented;l.absUrl()===a&&(g?(l.$$parse(c),l.$$state=e,h(c,!1,e)):(v=!1,k(c,e)))}),d.$$phase||d.$digest()):g.location.href=a});d.$watch(function(){if(v||l.$$urlUpdatedByLocation){l.$$urlUpdatedByLocation=!1;var a=lb(c.url()),b=lb(l.absUrl()),g=c.state(),f=l.$$replace,m=a!==b||l.$$html5&&e.history&&g!==l.$$state;if(v||m)v=!1,d.$evalAsync(function(){var b=l.absUrl(),c=d.$broadcast("$locationChangeStart",b,a,l.$$state,g).defaultPrevented;l.absUrl()===b&&(c?(l.$$parse(a),l.$$state=g): - (m&&h(b,f,g===l.$$state?null:l.$$state),k(a,g)))})}l.$$replace=!1});return l}]}function Mf(){var a=!0,b=this;this.debugEnabled=function(b){return u(b)?(a=b,this):a};this.$get=["$window",function(d){function c(a){bc(a)&&(a.stack&&f?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=d.console||{},e=b[a]||b.log||D;return function(){var a=[];r(arguments,function(b){a.push(c(b))});return Function.prototype.apply.call(e, - b,a)}}var f=Ca||/\bEdge\//.test(d.navigator&&d.navigator.userAgent);return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){a&&c.apply(b,arguments)}}()}}]}function Bg(a){return a+""}function Cg(a,b){return"undefined"!==typeof a?a:b}function Ed(a,b){return"undefined"===typeof a?b:"undefined"===typeof b?a:a+b}function Dg(a,b){switch(a.type){case q.MemberExpression:if(a.computed)return!1;break;case q.UnaryExpression:return 1;case q.BinaryExpression:return"+"!== - a.operator?1:!1;case q.CallExpression:return!1}return void 0===b?Fd:b}function W(a,b,d){var c,e,f=a.isPure=Dg(a,d);switch(a.type){case q.Program:c=!0;r(a.body,function(a){W(a.expression,b,f);c=c&&a.expression.constant});a.constant=c;break;case q.Literal:a.constant=!0;a.toWatch=[];break;case q.UnaryExpression:W(a.argument,b,f);a.constant=a.argument.constant;a.toWatch=a.argument.toWatch;break;case q.BinaryExpression:W(a.left,b,f);W(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch= - a.left.toWatch.concat(a.right.toWatch);break;case q.LogicalExpression:W(a.left,b,f);W(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.constant?[]:[a];break;case q.ConditionalExpression:W(a.test,b,f);W(a.alternate,b,f);W(a.consequent,b,f);a.constant=a.test.constant&&a.alternate.constant&&a.consequent.constant;a.toWatch=a.constant?[]:[a];break;case q.Identifier:a.constant=!1;a.toWatch=[a];break;case q.MemberExpression:W(a.object,b,f);a.computed&&W(a.property,b,f);a.constant=a.object.constant&& - (!a.computed||a.property.constant);a.toWatch=a.constant?[]:[a];break;case q.CallExpression:c=d=a.filter?!b(a.callee.name).$stateful:!1;e=[];r(a.arguments,function(a){W(a,b,f);c=c&&a.constant;e.push.apply(e,a.toWatch)});a.constant=c;a.toWatch=d?e:[a];break;case q.AssignmentExpression:W(a.left,b,f);W(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch=[a];break;case q.ArrayExpression:c=!0;e=[];r(a.elements,function(a){W(a,b,f);c=c&&a.constant;e.push.apply(e,a.toWatch)});a.constant=c; - a.toWatch=e;break;case q.ObjectExpression:c=!0;e=[];r(a.properties,function(a){W(a.value,b,f);c=c&&a.value.constant;e.push.apply(e,a.value.toWatch);a.computed&&(W(a.key,b,!1),c=c&&a.key.constant,e.push.apply(e,a.key.toWatch))});a.constant=c;a.toWatch=e;break;case q.ThisExpression:a.constant=!1;a.toWatch=[];break;case q.LocalsExpression:a.constant=!1,a.toWatch=[]}}function Gd(a){if(1===a.length){a=a[0].expression;var b=a.toWatch;return 1!==b.length?b:b[0]!==a?b:void 0}}function Hd(a){return a.type=== - q.Identifier||a.type===q.MemberExpression}function Id(a){if(1===a.body.length&&Hd(a.body[0].expression))return{type:q.AssignmentExpression,left:a.body[0].expression,right:{type:q.NGValueParameter},operator:"="}}function Jd(a){this.$filter=a}function Kd(a){this.$filter=a}function Mb(a,b,d){this.ast=new q(a,d);this.astCompiler=d.csp?new Kd(b):new Jd(b)}function Ac(a){return C(a.valueOf)?a.valueOf():Eg.call(a)}function Nf(){var a=S(),b={"true":!0,"false":!1,"null":null,undefined:void 0},d,c;this.addLiteral= - function(a,c){b[a]=c};this.setIdentifierFns=function(a,b){d=a;c=b;return this};this.$get=["$filter",function(e){function f(b,c){var d,g;switch(typeof b){case "string":return g=b=b.trim(),d=a[g],d||(d=new Nb(n),d=(new Mb(d,e,n)).parse(b),d.constant?d.$$watchDelegate=m:d.oneTime?d.$$watchDelegate=d.literal?l:k:d.inputs&&(d.$$watchDelegate=h),a[g]=d),p(d,c);case "function":return p(b,c);default:return p(D,c)}}function g(a,b,c){return null==a||null==b?a===b:"object"!==typeof a||(a=Ac(a),"object"!==typeof a|| - c)?a===b||a!==a&&b!==b:!1}function h(a,b,c,d,e){var f=d.inputs,h;if(1===f.length){var k=g,f=f[0];return a.$watch(function(a){var b=f(a);g(b,k,f.isPure)||(h=d(a,void 0,void 0,[b]),k=b&&Ac(b));return h},b,c,e)}for(var l=[],m=[],p=0,n=f.length;p=c.$$state.status&&e&&e.length&&a(function(){for(var a,c,g=0,f=e.length;ga)for(b in l++,f)ra.call(e,b)||(t--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$stateful=!0;var d=this,e,f,h,k=1F&&(y=4-F,A[y]||(A[y]=[]),A[y].push({msg:C(a.exp)?"fn: "+(a.exp.name||a.exp.toString()): - a.exp,newVal:g,oldVal:k}));else if(a===c){r=!1;break a}}catch(D){f(D)}if(!(n=q.$$watchersCount&&q.$$childHead||q!==this&&q.$$nextSibling))for(;q!==this&&!(n=q.$$nextSibling);)q=q.$parent}while(q=n);if((r||u.length)&&!F--)throw t.$$phase=null,d("infdig",b,A);}while(r||u.length);for(t.$$phase=null;HCa)throw va("iequirks");var c=ka(oa);c.isEnabled=function(){return a};c.trustAs= - d.trustAs;c.getTrusted=d.getTrusted;c.valueOf=d.valueOf;a||(c.trustAs=c.getTrusted=function(a,b){return b},c.valueOf=ab);c.parseAs=function(a,d){var e=b(d);return e.literal&&e.constant?e:b(d,function(b){return c.getTrusted(a,b)})};var e=c.parseAs,f=c.getTrusted,g=c.trustAs;r(oa,function(a,b){var d=L(b);c[("parse_as_"+d).replace(Bc,wb)]=function(b){return e(a,b)};c[("get_trusted_"+d).replace(Bc,wb)]=function(b){return f(a,b)};c[("trust_as_"+d).replace(Bc,wb)]=function(b){return g(a,b)}});return c}]} - function Tf(){this.$get=["$window","$document",function(a,b){var d={},c=!((!a.nw||!a.nw.process)&&a.chrome&&(a.chrome.app&&a.chrome.app.runtime||!a.chrome.app&&a.chrome.runtime&&a.chrome.runtime.id))&&a.history&&a.history.pushState,e=Z((/android (\d+)/.exec(L((a.navigator||{}).userAgent))||[])[1]),f=/Boxee/i.test((a.navigator||{}).userAgent),g=b[0]||{},h=g.body&&g.body.style,k=!1,l=!1;h&&(k=!!("transition"in h||"webkitTransition"in h),l=!!("animation"in h||"webkitAnimation"in h));return{history:!(!c|| - 4>e||f),hasEvent:function(a){if("input"===a&&Ca)return!1;if(x(d[a])){var b=g.createElement("div");d[a]="on"+a in b}return d[a]},csp:Ja(),transitions:k,animations:l,android:e}}]}function Vf(){var a;this.httpOptions=function(b){return b?(a=b,this):a};this.$get=["$exceptionHandler","$templateCache","$http","$q","$sce",function(b,d,c,e,f){function g(h,k){g.totalPendingRequests++;if(!E(h)||x(d.get(h)))h=f.getTrustedResourceUrl(h);var l=c.defaults&&c.defaults.transformResponse;I(l)?l=l.filter(function(a){return a!== - uc}):l===uc&&(l=null);return c.get(h,O({cache:d,transformResponse:l},a)).finally(function(){g.totalPendingRequests--}).then(function(a){d.put(h,a.data);return a.data},function(a){k||(a=Gg("tpload",h,a.status,a.statusText),b(a));return e.reject(a)})}g.totalPendingRequests=0;return g}]}function Wf(){this.$get=["$rootScope","$browser","$location",function(a,b,d){return{findBindings:function(a,b,d){a=a.getElementsByClassName("ng-binding");var g=[];r(a,function(a){var c=$.element(a).data("$binding");c&& - r(c,function(c){d?(new RegExp("(^|\\s)"+Md(b)+"(\\s|\\||$)")).test(c)&&g.push(a):-1!==c.indexOf(b)&&g.push(a)})});return g},findModels:function(a,b,d){for(var g=["ng-","data-ng-","ng\\:"],h=0;hc&&(c=e),c+=+a.slice(e+1),a=a.substring(0,e)):0>c&&(c=a.length);for(e=0;a.charAt(e)===Dc;e++);if(e===(g=a.length))d=[0],c=1;else{for(g--;a.charAt(g)===Dc;)g--;c-=e;d=[];for(f=0;e<=g;e++,f++)d[f]=+a.charAt(e)}c>Wd&&(d=d.splice(0,Wd-1),b=c-1,c=1);return{d:d,e:b,i:c}}function Og(a,b,d,c){var e=a.d,f=e.length-a.i;b=x(b)?Math.min(Math.max(d,f),c):+b;d= - b+a.i;c=e[d];if(0d-1){for(c=0;c>d;c--)e.unshift(0),a.i++;e.unshift(1);a.i++}else e[d-1]++;for(;fh;)k.unshift(0),h++;0=b.lgSize&&h.unshift(k.splice(-b.lgSize,k.length).join(""));k.length>b.gSize;)h.unshift(k.splice(-b.gSize,k.length).join(""));k.length&&h.unshift(k.join(""));k=h.join(d);f.length&&(k+=c+f.join(""));e&&(k+="e+"+e)}return 0>a&&!g?b.negPre+k+b.negSuf:b.posPre+k+b.posSuf}function Ob(a,b,d,c){var e="";if(0>a||c&&0>= - a)c?a=-a+1:(a=-a,e="-");for(a=""+a;a.length-d)f+=d;0===f&&-12===d&&(f=12);return Ob(f,b,c,e)}}function mb(a,b,d){return function(c,e){var f=c["get"+a](),g=ub((d?"STANDALONE":"")+(b?"SHORT":"")+a);return e[g][f]}}function Xd(a){var b=(new Date(a,0,1)).getDay();return new Date(a,0,(4>=b?5:12)-b)}function Yd(a){return function(b){var d=Xd(b.getFullYear());b=+new Date(b.getFullYear(), - b.getMonth(),b.getDate()+(4-b.getDay()))-+d;b=1+Math.round(b/6048E5);return Ob(b,a)}}function Ec(a,b){return 0>=a.getFullYear()?b.ERAS[0]:b.ERAS[1]}function Rd(a){function b(a){var b;if(b=a.match(d)){a=new Date(0);var f=0,g=0,h=b[8]?a.setUTCFullYear:a.setFullYear,k=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=Z(b[9]+b[10]),g=Z(b[9]+b[11]));h.call(a,Z(b[1]),Z(b[2])-1,Z(b[3]));f=Z(b[4]||0)-f;g=Z(b[5]||0)-g;h=Z(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));k.call(a,f,g,h,b)}return a}var d=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/; - return function(c,d,f){var g="",h=[],k,l;d=d||"mediumDate";d=a.DATETIME_FORMATS[d]||d;E(c)&&(c=Pg.test(c)?Z(c):b(c));Y(c)&&(c=new Date(c));if(!fa(c)||!isFinite(c.getTime()))return c;for(;d;)(l=Qg.exec(d))?(h=db(h,l,1),d=h.pop()):(h.push(d),d=null);var m=c.getTimezoneOffset();f&&(m=Sc(f,m),c=dc(c,f,!0));r(h,function(b){k=Rg[b];g+=k?k(c,a.DATETIME_FORMATS,m):"''"===b?"'":b.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function Ig(){return function(a,b){x(b)&&(b=2);return eb(a,b)}}function Jg(){return function(a, - b,d){b=Infinity===Math.abs(Number(b))?Number(b):Z(b);if(U(b))return a;Y(a)&&(a=a.toString());if(!wa(a))return a;d=!d||isNaN(d)?0:Z(d);d=0>d?Math.max(0,a.length+d):d;return 0<=b?Fc(a,d,d+b):0===d?Fc(a,b,a.length):Fc(a,Math.max(0,d+b),d)}}function Fc(a,b,d){return E(a)?a.slice(b,d):xa.call(a,b,d)}function Td(a){function b(b){return b.map(function(b){var c=1,d=ab;if(C(b))d=b;else if(E(b)){if("+"===b.charAt(0)||"-"===b.charAt(0))c="-"===b.charAt(0)?-1:1,b=b.substring(1);if(""!==b&&(d=a(b),d.constant))var e= - d(),d=function(a){return a[e]}}return{get:d,descending:c}})}function d(a){switch(typeof a){case "number":case "boolean":case "string":return!0;default:return!1}}function c(a,b){var c=0,d=a.type,k=b.type;if(d===k){var k=a.value,l=b.value;"string"===d?(k=k.toLowerCase(),l=l.toLowerCase()):"object"===d&&(B(k)&&(k=a.index),B(l)&&(l=b.index));k!==l&&(c=kb||37<=b&&40>=b||m(a,this,this.value)});if(e.hasEvent("paste"))b.on("paste cut drop",m)}b.on("change",l);if(ce[g]&&c.$$hasNativeValidators&&g===d.type)b.on("keydown wheel mousedown",function(a){if(!k){var b=this.validity,c=b.badInput,d=b.typeMismatch;k=f.defer(function(){k=null;b.badInput===c&& - b.typeMismatch===d||l(a)})}});c.$render=function(){var a=c.$isEmpty(c.$viewValue)?"":c.$viewValue;b.val()!==a&&b.val(a)}}function Rb(a,b){return function(d,c){var e,f;if(fa(d))return d;if(E(d)){'"'===d.charAt(0)&&'"'===d.charAt(d.length-1)&&(d=d.substring(1,d.length-1));if(Sg.test(d))return new Date(d);a.lastIndex=0;if(e=a.exec(d))return e.shift(),f=c?{yyyy:c.getFullYear(),MM:c.getMonth()+1,dd:c.getDate(),HH:c.getHours(),mm:c.getMinutes(),ss:c.getSeconds(),sss:c.getMilliseconds()/1E3}:{yyyy:1970, - MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},r(e,function(a,c){c=q};g.$observe("min",function(a){q=n(a);h.$validate()})}if(u(g.max)||g.ngMax){var y;h.$validators.max=function(a){return!p(a)||x(y)||d(a)<=y};g.$observe("max",function(a){y=n(a);h.$validate()})}}}function Hc(a,b,d,c){(c.$$hasNativeValidators=B(b[0].validity))&&c.$parsers.push(function(a){var c= - b.prop("validity")||{};return c.badInput||c.typeMismatch?void 0:a})}function de(a){a.$$parserName="number";a.$parsers.push(function(b){if(a.$isEmpty(b))return null;if(Tg.test(b))return parseFloat(b)});a.$formatters.push(function(b){if(!a.$isEmpty(b)){if(!Y(b))throw pb("numfmt",b);b=b.toString()}return b})}function Wa(a){u(a)&&!Y(a)&&(a=parseFloat(a));return U(a)?void 0:a}function Ic(a){var b=a.toString(),d=b.indexOf(".");return-1===d?-1a&&(a=/e-(\d+)$/.exec(b))?Number(a[1]):0:b.length-d-1}function ee(a, - b,d){a=Number(a);var c=(a|0)!==a,e=(b|0)!==b,f=(d|0)!==d;if(c||e||f){var g=c?Ic(a):0,h=e?Ic(b):0,k=f?Ic(d):0,g=Math.max(g,h,k),g=Math.pow(10,g);a*=g;b*=g;d*=g;c&&(a=Math.round(a));e&&(b=Math.round(b));f&&(d=Math.round(d))}return 0===(a-b)%d}function fe(a,b,d,c,e){if(u(c)){a=a(c);if(!a.constant)throw pb("constexpr",d,c);return a(b)}return e}function Jc(a,b){function d(a,b){if(!a||!a.length)return[];if(!b||!b.length)return a;var c=[],d=0;a:for(;d(?:<\/\1>|)$/,kc=/<|&#?\w+;/,dg=/<([\w:-]+)/,eg=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,aa={option:[1,'"],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};aa.optgroup=aa.option;aa.tbody=aa.tfoot=aa.colgroup=aa.caption=aa.thead;aa.th=aa.td;var lg=w.Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)&16)},Sa=V.prototype={ready:gd,toString:function(){var a=[];r(this,function(b){a.push(""+b)});return"["+a.join(", ")+"]"}, - eq:function(a){return 0<=a?z(this[a]):z(this[this.length+a])},length:0,push:Wg,sort:[].sort,splice:[].splice},Gb={};r("multiple selected checked disabled readOnly required open".split(" "),function(a){Gb[L(a)]=a});var ld={};r("input select option textarea button form details".split(" "),function(a){ld[a]=!0});var sd={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern",ngStep:"step"};r({data:pc,removeData:oc,hasData:function(a){for(var b in ib[a.ng339])return!0; - return!1},cleanData:function(a){for(var b=0,d=a.length;b/,og=/^[^(]*\(\s*([^)]*)\)/m, - Zg=/,/,$g=/^\s*(_?)(\S+?)\1\s*$/,mg=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Ba=K("$injector");gb.$$annotate=function(a,b,d){var c;if("function"===typeof a){if(!(c=a.$inject)){c=[];if(a.length){if(b)throw E(d)&&d||(d=a.name||pg(a)),Ba("strictdi",d);b=nd(a);r(b[1].split(Zg),function(a){a.replace($g,function(a,b,d){c.push(d)})})}a.$inject=c}}else I(a)?(b=a.length-1,sb(a[b],"fn"),c=a.slice(0,b)):sb(a,"fn",!0);return c};var he=K("$animate"),sf=function(){this.$get=D},tf=function(){var a=new Hb,b=[];this.$get= - ["$$AnimateRunner","$rootScope",function(d,c){function e(a,b,c){var d=!1;b&&(b=E(b)?b.split(" "):I(b)?b:[],r(b,function(b){b&&(d=!0,a[b]=c)}));return d}function f(){r(b,function(b){var c=a.get(b);if(c){var d=qg(b.attr("class")),e="",f="";r(c,function(a,b){a!==!!d[b]&&(a?e+=(e.length?" ":"")+b:f+=(f.length?" ":"")+b)});r(b,function(a){e&&Db(a,e);f&&Cb(a,f)});a.delete(b)}});b.length=0}return{enabled:D,on:D,off:D,pin:D,push:function(g,h,k,l){l&&l();k=k||{};k.from&&g.css(k.from);k.to&&g.css(k.to);if(k.addClass|| - k.removeClass)if(h=k.addClass,l=k.removeClass,k=a.get(g)||{},h=e(k,h,!0),l=e(k,l,!1),h||l)a.set(g,k),b.push(g),1===b.length&&c.$$postDigest(f);g=new d;g.complete();return g}}}]},qf=["$provide",function(a){var b=this,d=null,c=null;this.$$registeredAnimations=Object.create(null);this.register=function(c,d){if(c&&"."!==c.charAt(0))throw he("notcsel",c);var g=c+"-animation";b.$$registeredAnimations[c.substr(1)]=g;a.factory(g,d)};this.customFilter=function(a){1===arguments.length&&(c=C(a)?a:null);return c}; - this.classNameFilter=function(a){if(1===arguments.length&&(d=a instanceof RegExp?a:null)&&/[(\s|\/)]ng-animate[(\s|\/)]/.test(d.toString()))throw d=null,he("nongcls","ng-animate");return d};this.$get=["$$animateQueue",function(a){function b(a,c,d){if(d){var e;a:{for(e=0;e <= >= && || ! = |".split(" "),function(a){Ub[a]=!0});var ch={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},Nb=function(a){this.options=a};Nb.prototype={constructor:Nb,lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdentifierStart:function(a){return this.options.isIdentifierStart?this.options.isIdentifierStart(a,this.codePointAt(a)):this.isValidIdentifierStart(a)},isValidIdentifierStart:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isIdentifierContinue:function(a){return this.options.isIdentifierContinue? - this.options.isIdentifierContinue(a,this.codePointAt(a)):this.isValidIdentifierContinue(a)},isValidIdentifierContinue:function(a,b){return this.isValidIdentifierStart(a,b)||this.isNumber(a)},codePointAt:function(a){return 1===a.length?a.charCodeAt(0):(a.charCodeAt(0)<<10)+a.charCodeAt(1)-56613888},peekMultichar:function(){var a=this.text.charAt(this.index),b=this.peek();if(!b)return a;var d=a.charCodeAt(0),c=b.charCodeAt(0);return 55296<=d&&56319>=d&&56320<=c&&57343>=c?a+b:a},isExpOperator:function(a){return"-"=== - a||"+"===a||this.isNumber(a)},throwError:function(a,b,d){d=d||this.index;b=u(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,d)+"]":" "+d;throw Xa("lexerr",a,b,this.text);},readNumber:function(){for(var a="",b=this.index;this.index","<=",">=");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),b;b=this.expect("+","-");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),b;b=this.expect("*","/","%");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.unary()};return a}, - unary:function(){var a;return(a=this.expect("+","-","!"))?{type:q.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.selfReferential.hasOwnProperty(this.peek().text)?a=pa(this.selfReferential[this.consume().text]):this.options.literals.hasOwnProperty(this.peek().text)?a={type:q.Literal,value:this.options.literals[this.consume().text]}: - this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var b;b=this.expect("(","[",".");)"("===b.text?(a={type:q.CallExpression,callee:a,arguments:this.parseArguments()},this.consume(")")):"["===b.text?(a={type:q.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===b.text?a={type:q.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE"); - return a},filter:function(a){a=[a];for(var b={type:q.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return b},parseArguments:function(){var a=[];if(")"!==this.peekToken().text){do a.push(this.filterChain());while(this.expect(","))}return a},identifier:function(){var a=this.consume();a.identifier||this.throwError("is not a valid identifier",a);return{type:q.Identifier,name:a.text}},constant:function(){return{type:q.Literal,value:this.consume().value}}, - arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","))}this.consume("]");return{type:q.ArrayExpression,elements:a}},object:function(){var a=[],b;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;b={type:q.Property,kind:"init"};this.peek().constant?(b.key=this.constant(),b.computed=!1,this.consume(":"),b.value=this.expression()):this.peek().identifier?(b.key=this.identifier(),b.computed=!1,this.peek(":")? - (this.consume(":"),b.value=this.expression()):b.value=b.key):this.peek("[")?(this.consume("["),b.key=this.expression(),this.consume("]"),b.computed=!0,this.consume(":"),b.value=this.expression()):this.throwError("invalid key",this.peek());a.push(b)}while(this.expect(","))}this.consume("}");return{type:q.ObjectExpression,properties:a}},throwError:function(a,b){throw Xa("syntax",b.text,a,b.index+1,this.text,this.text.substring(b.index));},consume:function(a){if(0===this.tokens.length)throw Xa("ueoe", - this.text);var b=this.expect(a);b||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return b},peekToken:function(){if(0===this.tokens.length)throw Xa("ueoe",this.text);return this.tokens[0]},peek:function(a,b,d,c){return this.peekAhead(0,a,b,d,c)},peekAhead:function(a,b,d,c,e){if(this.tokens.length>a){a=this.tokens[a];var f=a.text;if(f===b||f===d||f===c||f===e||!(b||d||c||e))return a}return!1},expect:function(a,b,d,c){return(a=this.peek(a,b,d,c))?(this.tokens.shift(),a):!1},selfReferential:{"this":{type:q.ThisExpression}, - $locals:{type:q.LocalsExpression}}};var Fd=2;Jd.prototype={compile:function(a){var b=this;this.state={nextId:0,filters:{},fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]};W(a,b.$filter);var d="",c;this.stage="assign";if(c=Id(a))this.state.computing="assign",d=this.nextId(),this.recurse(c,d),this.return_(d),d="fn.assign="+this.generateFunction("assign","s,v,l");c=Gd(a.body);b.stage="inputs";r(c,function(a,c){var d="fn"+c;b.state[d]={vars:[],body:[],own:{}};b.state.computing=d; - var h=b.nextId();b.recurse(a,h);b.return_(h);b.state.inputs.push({name:d,isPure:a.isPure});a.watchId=c});this.state.computing="fn";this.stage="main";this.recurse(a);a='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+d+this.watchFns()+"return fn;";a=(new Function("$filter","getStringValue","ifDefined","plus",a))(this.$filter,Bg,Cg,Ed);this.state=this.stage=void 0;return a},USE:"use",STRICT:"strict",watchFns:function(){var a=[],b=this.state.inputs, - d=this;r(b,function(b){a.push("var "+b.name+"="+d.generateFunction(b.name,"s"));b.isPure&&a.push(b.name,".isPure="+JSON.stringify(b.isPure)+";")});b.length&&a.push("fn.inputs=["+b.map(function(a){return a.name}).join(",")+"];");return a.join("")},generateFunction:function(a,b){return"function("+b+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],b=this;r(this.state.filters,function(d,c){a.push(d+"=$filter("+b.escape(c)+")")});return a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length? - "var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,b,d,c,e,f){var g,h,k=this,l,m,p;c=c||D;if(!f&&u(a.watchId))b=b||this.nextId(),this.if_("i",this.lazyAssign(b,this.computedMember("i",a.watchId)),this.lazyRecurse(a,b,d,c,e,!0));else switch(a.type){case q.Program:r(a.body,function(b,c){k.recurse(b.expression,void 0,void 0,function(a){h=a});c!==a.body.length-1?k.current().body.push(h,";"):k.return_(h)});break;case q.Literal:m=this.escape(a.value); - this.assign(b,m);c(b||m);break;case q.UnaryExpression:this.recurse(a.argument,void 0,void 0,function(a){h=a});m=a.operator+"("+this.ifDefined(h,0)+")";this.assign(b,m);c(m);break;case q.BinaryExpression:this.recurse(a.left,void 0,void 0,function(a){g=a});this.recurse(a.right,void 0,void 0,function(a){h=a});m="+"===a.operator?this.plus(g,h):"-"===a.operator?this.ifDefined(g,0)+a.operator+this.ifDefined(h,0):"("+g+")"+a.operator+"("+h+")";this.assign(b,m);c(m);break;case q.LogicalExpression:b=b||this.nextId(); - k.recurse(a.left,b);k.if_("&&"===a.operator?b:k.not(b),k.lazyRecurse(a.right,b));c(b);break;case q.ConditionalExpression:b=b||this.nextId();k.recurse(a.test,b);k.if_(b,k.lazyRecurse(a.alternate,b),k.lazyRecurse(a.consequent,b));c(b);break;case q.Identifier:b=b||this.nextId();d&&(d.context="inputs"===k.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",a.name)+"?l:s"),d.computed=!1,d.name=a.name);k.if_("inputs"===k.stage||k.not(k.getHasOwnProperty("l",a.name)),function(){k.if_("inputs"=== - k.stage||"s",function(){e&&1!==e&&k.if_(k.isNull(k.nonComputedMember("s",a.name)),k.lazyAssign(k.nonComputedMember("s",a.name),"{}"));k.assign(b,k.nonComputedMember("s",a.name))})},b&&k.lazyAssign(b,k.nonComputedMember("l",a.name)));c(b);break;case q.MemberExpression:g=d&&(d.context=this.nextId())||this.nextId();b=b||this.nextId();k.recurse(a.object,g,void 0,function(){k.if_(k.notNull(g),function(){a.computed?(h=k.nextId(),k.recurse(a.property,h),k.getStringValue(h),e&&1!==e&&k.if_(k.not(k.computedMember(g, - h)),k.lazyAssign(k.computedMember(g,h),"{}")),m=k.computedMember(g,h),k.assign(b,m),d&&(d.computed=!0,d.name=h)):(e&&1!==e&&k.if_(k.isNull(k.nonComputedMember(g,a.property.name)),k.lazyAssign(k.nonComputedMember(g,a.property.name),"{}")),m=k.nonComputedMember(g,a.property.name),k.assign(b,m),d&&(d.computed=!1,d.name=a.property.name))},function(){k.assign(b,"undefined")});c(b)},!!e);break;case q.CallExpression:b=b||this.nextId();a.filter?(h=k.filter(a.callee.name),l=[],r(a.arguments,function(a){var b= - k.nextId();k.recurse(a,b);l.push(b)}),m=h+"("+l.join(",")+")",k.assign(b,m),c(b)):(h=k.nextId(),g={},l=[],k.recurse(a.callee,h,g,function(){k.if_(k.notNull(h),function(){r(a.arguments,function(b){k.recurse(b,a.constant?void 0:k.nextId(),void 0,function(a){l.push(a)})});m=g.name?k.member(g.context,g.name,g.computed)+"("+l.join(",")+")":h+"("+l.join(",")+")";k.assign(b,m)},function(){k.assign(b,"undefined")});c(b)}));break;case q.AssignmentExpression:h=this.nextId();g={};this.recurse(a.left,void 0, - g,function(){k.if_(k.notNull(g.context),function(){k.recurse(a.right,h);m=k.member(g.context,g.name,g.computed)+a.operator+h;k.assign(b,m);c(b||m)})},1);break;case q.ArrayExpression:l=[];r(a.elements,function(b){k.recurse(b,a.constant?void 0:k.nextId(),void 0,function(a){l.push(a)})});m="["+l.join(",")+"]";this.assign(b,m);c(b||m);break;case q.ObjectExpression:l=[];p=!1;r(a.properties,function(a){a.computed&&(p=!0)});p?(b=b||this.nextId(),this.assign(b,"{}"),r(a.properties,function(a){a.computed? - (g=k.nextId(),k.recurse(a.key,g)):g=a.key.type===q.Identifier?a.key.name:""+a.key.value;h=k.nextId();k.recurse(a.value,h);k.assign(k.member(b,g,a.computed),h)})):(r(a.properties,function(b){k.recurse(b.value,a.constant?void 0:k.nextId(),void 0,function(a){l.push(k.escape(b.key.type===q.Identifier?b.key.name:""+b.key.value)+":"+a)})}),m="{"+l.join(",")+"}",this.assign(b,m));c(b||m);break;case q.ThisExpression:this.assign(b,"s");c(b||"s");break;case q.LocalsExpression:this.assign(b,"l");c(b||"l");break; - case q.NGValueParameter:this.assign(b,"v"),c(b||"v")}},getHasOwnProperty:function(a,b){var d=a+"."+b,c=this.current().own;c.hasOwnProperty(d)||(c[d]=this.nextId(!1,a+"&&("+this.escape(b)+" in "+a+")"));return c[d]},assign:function(a,b){if(a)return this.current().body.push(a,"=",b,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,b){return"ifDefined("+a+","+this.escape(b)+")"},plus:function(a, - b){return"plus("+a+","+b+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,b,d){if(!0===a)b();else{var c=this.current().body;c.push("if(",a,"){");b();c.push("}");d&&(c.push("else{"),d(),c.push("}"))}},not:function(a){return"!("+a+")"},isNull:function(a){return a+"==null"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,b){var d=/[^$_a-zA-Z0-9]/g;return/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(b)?a+"."+b:a+'["'+b.replace(d,this.stringEscapeFn)+'"]'},computedMember:function(a, - b){return a+"["+b+"]"},member:function(a,b,d){return d?this.computedMember(a,b):this.nonComputedMember(a,b)},getStringValue:function(a){this.assign(a,"getStringValue("+a+")")},lazyRecurse:function(a,b,d,c,e,f){var g=this;return function(){g.recurse(a,b,d,c,e,f)}},lazyAssign:function(a,b){var d=this;return function(){d.assign(a,b)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(E(a))return"'"+a.replace(this.stringEscapeRegex, - this.stringEscapeFn)+"'";if(Y(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if("undefined"===typeof a)return"undefined";throw Xa("esc");},nextId:function(a,b){var d="v"+this.state.nextId++;a||this.current().vars.push(d+(b?"="+b:""));return d},current:function(){return this.state[this.state.computing]}};Kd.prototype={compile:function(a){var b=this;W(a,b.$filter);var d,c;if(d=Id(a))c=this.recurse(d);d=Gd(a.body);var e;d&&(e=[],r(d,function(a,c){var d= - b.recurse(a);d.isPure=a.isPure;a.input=d;e.push(d);a.watchId=c}));var f=[];r(a.body,function(a){f.push(b.recurse(a.expression))});a=0===a.body.length?D:1===a.body.length?f[0]:function(a,b){var c;r(f,function(d){c=d(a,b)});return c};c&&(a.assign=function(a,b,d){return c(a,d,b)});e&&(a.inputs=e);return a},recurse:function(a,b,d){var c,e,f=this,g;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case q.Literal:return this.value(a.value,b);case q.UnaryExpression:return e=this.recurse(a.argument), - this["unary"+a.operator](e,b);case q.BinaryExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case q.LogicalExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case q.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),b);case q.Identifier:return f.identifier(a.name,b,d);case q.MemberExpression:return c=this.recurse(a.object,!1,!!d),a.computed|| - (e=a.property.name),a.computed&&(e=this.recurse(a.property)),a.computed?this.computedMember(c,e,b,d):this.nonComputedMember(c,e,b,d);case q.CallExpression:return g=[],r(a.arguments,function(a){g.push(f.recurse(a))}),a.filter&&(e=this.$filter(a.callee.name)),a.filter||(e=this.recurse(a.callee,!0)),a.filter?function(a,c,d,f){for(var p=[],n=0;n":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>b(c,e,f,g);return d?{value:c}:c}},"binary<=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f, - g)<=b(c,e,f,g);return d?{value:c}:c}},"binary>=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>=b(c,e,f,g);return d?{value:c}:c}},"binary&&":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)&&b(c,e,f,g);return d?{value:c}:c}},"binary||":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)||b(c,e,f,g);return d?{value:c}:c}},"ternary?:":function(a,b,d,c){return function(e,f,g,h){e=a(e,f,g,h)?b(e,f,g,h):d(e,f,g,h);return c?{value:e}:e}},value:function(a,b){return function(){return b?{context:void 0, - name:void 0,value:a}:a}},identifier:function(a,b,d){return function(c,e,f,g){c=e&&a in e?e:c;d&&1!==d&&c&&null==c[a]&&(c[a]={});e=c?c[a]:void 0;return b?{context:c,name:a,value:e}:e}},computedMember:function(a,b,d,c){return function(e,f,g,h){var k=a(e,f,g,h),l,m;null!=k&&(l=b(e,f,g,h),l+="",c&&1!==c&&k&&!k[l]&&(k[l]={}),m=k[l]);return d?{context:k,name:l,value:m}:m}},nonComputedMember:function(a,b,d,c){return function(e,f,g,h){e=a(e,f,g,h);c&&1!==c&&e&&null==e[b]&&(e[b]={});f=null!=e?e[b]:void 0; - return d?{context:e,name:b,value:f}:f}},inputs:function(a,b){return function(d,c,e,f){return f?f[b]:a(d,c,e)}}};Mb.prototype={constructor:Mb,parse:function(a){a=this.getAst(a);var b=this.astCompiler.compile(a.ast),d=a.ast;b.literal=0===d.body.length||1===d.body.length&&(d.body[0].expression.type===q.Literal||d.body[0].expression.type===q.ArrayExpression||d.body[0].expression.type===q.ObjectExpression);b.constant=a.ast.constant;b.oneTime=a.oneTime;return b},getAst:function(a){var b=!1;a=a.trim();":"=== - a.charAt(0)&&":"===a.charAt(1)&&(b=!0,a=a.substring(2));return{ast:this.ast.ast(a),oneTime:b}}};var va=K("$sce"),oa={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},Bc=/_([a-z])/g,Gg=K("$compile"),X=w.document.createElement("a"),Od=ta(w.location.href);Pd.$inject=["$document"];ed.$inject=["$provide"];var Wd=22,Vd=".",Dc="0";Qd.$inject=["$locale"];Sd.$inject=["$locale"];var Rg={yyyy:ea("FullYear",4,0,!1,!0),yy:ea("FullYear",2,0,!0,!0),y:ea("FullYear",1,0,!1,!0),MMMM:mb("Month"), - MMM:mb("Month",!0),MM:ea("Month",2,1),M:ea("Month",1,1),LLLL:mb("Month",!1,!0),dd:ea("Date",2),d:ea("Date",1),HH:ea("Hours",2),H:ea("Hours",1),hh:ea("Hours",2,-12),h:ea("Hours",1,-12),mm:ea("Minutes",2),m:ea("Minutes",1),ss:ea("Seconds",2),s:ea("Seconds",1),sss:ea("Milliseconds",3),EEEE:mb("Day"),EEE:mb("Day",!0),a:function(a,b){return 12>a.getHours()?b.AMPMS[0]:b.AMPMS[1]},Z:function(a,b,d){a=-1*d;return a=(0<=a?"+":"")+(Ob(Math[0=a.getFullYear()?b.ERANAMES[0]:b.ERANAMES[1]}},Qg=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\s\S]*)/,Pg=/^-?\d+$/;Rd.$inject=["$locale"];var Kg=la(L),Lg=la(ub);Td.$inject=["$parse"];var He=la({restrict:"E",compile:function(a,b){if(!b.href&&!b.xlinkHref)return function(a,b){if("a"===b[0].nodeName.toLowerCase()){var e="[object SVGAnimatedString]"===ia.call(b.prop("href"))?"xlink:href":"href";b.on("click",function(a){b.attr(e)|| - a.preventDefault()})}}}}),vb={};r(Gb,function(a,b){function d(a,d,e){a.$watch(e[c],function(a){e.$set(b,!!a)})}if("multiple"!==a){var c=Ea("ng-"+b),e=d;"checked"===a&&(e=function(a,b,e){e.ngModel!==e[c]&&d(a,b,e)});vb[c]=function(){return{restrict:"A",priority:100,link:e}}}});r(sd,function(a,b){vb[b]=function(){return{priority:100,link:function(a,c,e){if("ngPattern"===b&&"/"===e.ngPattern.charAt(0)&&(c=e.ngPattern.match(Vg))){e.$set("ngPattern",new RegExp(c[1],c[2]));return}a.$watch(e[b],function(a){e.$set(b, - a)})}}}});r(["src","srcset","href"],function(a){var b=Ea("ng-"+a);vb[b]=function(){return{priority:99,link:function(d,c,e){var f=a,g=a;"href"===a&&"[object SVGAnimatedString]"===ia.call(c.prop("href"))&&(g="xlinkHref",e.$attr[g]="xlink:href",f=null);e.$observe(b,function(b){b?(e.$set(g,b),Ca&&f&&c.prop(f,e[g])):"href"===a&&e.$set(g,null)})}}}});var Qb={$addControl:D,$$renameControl:function(a,b){a.$name=b},$removeControl:D,$setValidity:D,$setDirty:D,$setPristine:D,$setSubmitted:D};Pb.$inject=["$element", - "$attrs","$scope","$animate","$interpolate"];Pb.prototype={$rollbackViewValue:function(){r(this.$$controls,function(a){a.$rollbackViewValue()})},$commitViewValue:function(){r(this.$$controls,function(a){a.$commitViewValue()})},$addControl:function(a){Ia(a.$name,"input");this.$$controls.push(a);a.$name&&(this[a.$name]=a);a.$$parentForm=this},$$renameControl:function(a,b){var d=a.$name;this[d]===a&&delete this[d];this[b]=a;a.$name=b},$removeControl:function(a){a.$name&&this[a.$name]===a&&delete this[a.$name]; - r(this.$pending,function(b,d){this.$setValidity(d,null,a)},this);r(this.$error,function(b,d){this.$setValidity(d,null,a)},this);r(this.$$success,function(b,d){this.$setValidity(d,null,a)},this);cb(this.$$controls,a);a.$$parentForm=Qb},$setDirty:function(){this.$$animate.removeClass(this.$$element,Ya);this.$$animate.addClass(this.$$element,Vb);this.$dirty=!0;this.$pristine=!1;this.$$parentForm.$setDirty()},$setPristine:function(){this.$$animate.setClass(this.$$element,Ya,Vb+" ng-submitted");this.$dirty= - !1;this.$pristine=!0;this.$submitted=!1;r(this.$$controls,function(a){a.$setPristine()})},$setUntouched:function(){r(this.$$controls,function(a){a.$setUntouched()})},$setSubmitted:function(){this.$$animate.addClass(this.$$element,"ng-submitted");this.$submitted=!0;this.$$parentForm.$setSubmitted()}};ae({clazz:Pb,set:function(a,b,d){var c=a[b];c?-1===c.indexOf(d)&&c.push(d):a[b]=[d]},unset:function(a,b,d){var c=a[b];c&&(cb(c,d),0===c.length&&delete a[b])}});var ie=function(a){return["$timeout","$parse", - function(b,d){function c(a){return""===a?d('this[""]').assign:d(a).assign||D}return{name:"form",restrict:a?"EAC":"E",require:["form","^^?form"],controller:Pb,compile:function(d,f){d.addClass(Ya).addClass(nb);var g=f.name?"name":a&&f.ngForm?"ngForm":!1;return{pre:function(a,d,e,f){var p=f[0];if(!("action"in e)){var n=function(b){a.$apply(function(){p.$commitViewValue();p.$setSubmitted()});b.preventDefault()};d[0].addEventListener("submit",n);d.on("$destroy",function(){b(function(){d[0].removeEventListener("submit", - n)},0,!1)})}(f[1]||p.$$parentForm).$addControl(p);var r=g?c(p.$name):D;g&&(r(a,p),e.$observe(g,function(b){p.$name!==b&&(r(a,void 0),p.$$parentForm.$$renameControl(p,b),r=c(p.$name),r(a,p))}));d.on("$destroy",function(){p.$$parentForm.$removeControl(p);r(a,void 0);O(p,Qb)})}}}}}]},Ie=ie(),Ue=ie(!0),Sg=/^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/,dh=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i, - eh=/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,Tg=/^\s*(-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,je=/^(\d{4,})-(\d{2})-(\d{2})$/,ke=/^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Lc=/^(\d{4,})-W(\d\d)$/,le=/^(\d{4,})-(\d\d)$/,me=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,ce=S();r(["date","datetime-local","month","time","week"],function(a){ce[a]= - !0});var ne={text:function(a,b,d,c,e,f){Va(a,b,d,c,e,f);Gc(c)},date:ob("date",je,Rb(je,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":ob("datetimelocal",ke,Rb(ke,"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:ob("time",me,Rb(me,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:ob("week",Lc,function(a,b){if(fa(a))return a;if(E(a)){Lc.lastIndex=0;var d=Lc.exec(a);if(d){var c=+d[1],e=+d[2],f=d=0,g=0,h=0,k=Xd(c),e=7*(e-1);b&&(d=b.getHours(),f=b.getMinutes(),g=b.getSeconds(),h=b.getMilliseconds()); - return new Date(c,0,k.getDate()+e,d,f,g,h)}}return NaN},"yyyy-Www"),month:ob("month",le,Rb(le,["yyyy","MM"]),"yyyy-MM"),number:function(a,b,d,c,e,f){Hc(a,b,d,c);de(c);Va(a,b,d,c,e,f);var g,h;if(u(d.min)||d.ngMin)c.$validators.min=function(a){return c.$isEmpty(a)||x(g)||a>=g},d.$observe("min",function(a){g=Wa(a);c.$validate()});if(u(d.max)||d.ngMax)c.$validators.max=function(a){return c.$isEmpty(a)||x(h)||a<=h},d.$observe("max",function(a){h=Wa(a);c.$validate()});if(u(d.step)||d.ngStep){var k;c.$validators.step= - function(a,b){return c.$isEmpty(b)||x(k)||ee(b,g||0,k)};d.$observe("step",function(a){k=Wa(a);c.$validate()})}},url:function(a,b,d,c,e,f){Va(a,b,d,c,e,f);Gc(c);c.$$parserName="url";c.$validators.url=function(a,b){var d=a||b;return c.$isEmpty(d)||dh.test(d)}},email:function(a,b,d,c,e,f){Va(a,b,d,c,e,f);Gc(c);c.$$parserName="email";c.$validators.email=function(a,b){var d=a||b;return c.$isEmpty(d)||eh.test(d)}},radio:function(a,b,d,c){var e=!d.ngTrim||"false"!==Q(d.ngTrim);x(d.name)&&b.attr("name",++qb); - b.on("click",function(a){var g;b[0].checked&&(g=d.value,e&&(g=Q(g)),c.$setViewValue(g,a&&a.type))});c.$render=function(){var a=d.value;e&&(a=Q(a));b[0].checked=a===c.$viewValue};d.$observe("value",c.$render)},range:function(a,b,d,c,e,f){function g(a,c){b.attr(a,d[a]);d.$observe(a,c)}function h(a){p=Wa(a);U(c.$modelValue)||(m?(a=b.val(),p>a&&(a=p,b.val(a)),c.$setViewValue(a)):c.$validate())}function k(a){n=Wa(a);U(c.$modelValue)||(m?(a=b.val(),n=p},g("min",h));e&& - (c.$validators.max=m?function(){return!0}:function(a,b){return c.$isEmpty(b)||x(n)||b<=n},g("max",k));f&&(c.$validators.step=m?function(){return!q.stepMismatch}:function(a,b){return c.$isEmpty(b)||x(r)||ee(b,p||0,r)},g("step",l))},checkbox:function(a,b,d,c,e,f,g,h){var k=fe(h,a,"ngTrueValue",d.ngTrueValue,!0),l=fe(h,a,"ngFalseValue",d.ngFalseValue,!1);b.on("click",function(a){c.$setViewValue(b[0].checked,a&&a.type)});c.$render=function(){b[0].checked=c.$viewValue};c.$isEmpty=function(a){return!1=== - a};c.$formatters.push(function(a){return sa(a,k)});c.$parsers.push(function(a){return a?k:l})},hidden:D,button:D,submit:D,reset:D,file:D},Zc=["$browser","$sniffer","$filter","$parse",function(a,b,d,c){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,f,g,h){h[0]&&(ne[L(g.type)]||ne.text)(e,f,g,h[0],b,a,d,c)}}}}],fh=/^(true|false|\d+)$/,mf=function(){function a(a,d,c){var e=u(c)?c:9===Ca?"":null;a.prop("value",e);d.$set("value",c)}return{restrict:"A",priority:100,compile:function(b,d){return fh.test(d.ngValue)? - function(b,d,f){b=b.$eval(f.ngValue);a(d,f,b)}:function(b,d,f){b.$watch(f.ngValue,function(b){a(d,f,b)})}}}},Me=["$compile",function(a){return{restrict:"AC",compile:function(b){a.$$addBindingClass(b);return function(b,c,e){a.$$addBindingInfo(c,e.ngBind);c=c[0];b.$watch(e.ngBind,function(a){c.textContent=gc(a)})}}}}],Oe=["$interpolate","$compile",function(a,b){return{compile:function(d){b.$$addBindingClass(d);return function(c,d,f){c=a(d.attr(f.$attr.ngBindTemplate));b.$$addBindingInfo(d,c.expressions); - d=d[0];f.$observe("ngBindTemplate",function(a){d.textContent=x(a)?"":a})}}}}],Ne=["$sce","$parse","$compile",function(a,b,d){return{restrict:"A",compile:function(c,e){var f=b(e.ngBindHtml),g=b(e.ngBindHtml,function(b){return a.valueOf(b)});d.$$addBindingClass(c);return function(b,c,e){d.$$addBindingInfo(c,e.ngBindHtml);b.$watch(g,function(){var d=f(b);c.html(a.getTrustedHtml(d)||"")})}}}}],lf=la({restrict:"A",require:"ngModel",link:function(a,b,d,c){c.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}), - Pe=Jc("",!0),Re=Jc("Odd",0),Qe=Jc("Even",1),Se=Qa({compile:function(a,b){b.$set("ngCloak",void 0);a.removeClass("ng-cloak")}}),Te=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],dd={},gh={blur:!0,focus:!0};r("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var b=Ea("ng-"+a);dd[b]=["$parse","$rootScope",function(d,c){return{restrict:"A",compile:function(e,f){var g= - d(f[b]);return function(b,d){d.on(a,function(d){var e=function(){g(b,{$event:d})};gh[a]&&c.$$phase?b.$evalAsync(e):b.$apply(e)})}}}}]});var We=["$animate","$compile",function(a,b){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(d,c,e,f,g){var h,k,l;d.$watch(e.ngIf,function(d){d?k||g(function(d,f){k=f;d[d.length++]=b.$$createComment("end ngIf",e.ngIf);h={clone:d};a.enter(d,c.parent(),c)}):(l&&(l.remove(),l=null),k&&(k.$destroy(),k=null),h&&(l= - tb(h.clone),a.leave(l).done(function(a){!1!==a&&(l=null)}),h=null))})}}}],Xe=["$templateRequest","$anchorScroll","$animate",function(a,b,d){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:$.noop,compile:function(c,e){var f=e.ngInclude||e.src,g=e.onload||"",h=e.autoscroll;return function(c,e,m,p,n){var r=0,q,v,y,t=function(){v&&(v.remove(),v=null);q&&(q.$destroy(),q=null);y&&(d.leave(y).done(function(a){!1!==a&&(v=null)}),v=y,y=null)};c.$watch(f,function(f){var m=function(a){!1=== - a||!u(h)||h&&!c.$eval(h)||b()},v=++r;f?(a(f,!0).then(function(a){if(!c.$$destroyed&&v===r){var b=c.$new();p.template=a;a=n(b,function(a){t();d.enter(a,null,e).done(m)});q=b;y=a;q.$emit("$includeContentLoaded",f);c.$eval(g)}},function(){c.$$destroyed||v!==r||(t(),c.$emit("$includeContentError",f))}),c.$emit("$includeContentRequested",f)):(t(),p.template=null)})}}}}],of=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(b,d,c,e){ia.call(d[0]).match(/SVG/)? - (d.empty(),a(fd(e.template,w.document).childNodes)(b,function(a){d.append(a)},{futureParentElement:d})):(d.html(e.template),a(d.contents())(b))}}}],Ye=Qa({priority:450,compile:function(){return{pre:function(a,b,d){a.$eval(d.ngInit)}}}}),kf=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,b,d,c){var e=d.ngList||", ",f="false"!==d.ngTrim,g=f?Q(e):e;c.$parsers.push(function(a){if(!x(a)){var b=[];a&&r(a.split(g),function(a){a&&b.push(f?Q(a):a)});return b}});c.$formatters.push(function(a){if(I(a))return a.join(e)}); - c.$isEmpty=function(a){return!a||!a.length}}}},nb="ng-valid",$d="ng-invalid",Ya="ng-pristine",Vb="ng-dirty",pb=K("ngModel");Sb.$inject="$scope $exceptionHandler $attrs $element $parse $animate $timeout $q $interpolate".split(" ");Sb.prototype={$$initGetterSetters:function(){if(this.$options.getOption("getterSetter")){var a=this.$$parse(this.$$attr.ngModel+"()"),b=this.$$parse(this.$$attr.ngModel+"($$$p)");this.$$ngModelGet=function(b){var c=this.$$parsedNgModel(b);C(c)&&(c=a(b));return c};this.$$ngModelSet= - function(a,c){C(this.$$parsedNgModel(a))?b(a,{$$$p:c}):this.$$parsedNgModelAssign(a,c)}}else if(!this.$$parsedNgModel.assign)throw pb("nonassign",this.$$attr.ngModel,za(this.$$element));},$render:D,$isEmpty:function(a){return x(a)||""===a||null===a||a!==a},$$updateEmptyClasses:function(a){this.$isEmpty(a)?(this.$$animate.removeClass(this.$$element,"ng-not-empty"),this.$$animate.addClass(this.$$element,"ng-empty")):(this.$$animate.removeClass(this.$$element,"ng-empty"),this.$$animate.addClass(this.$$element, - "ng-not-empty"))},$setPristine:function(){this.$dirty=!1;this.$pristine=!0;this.$$animate.removeClass(this.$$element,Vb);this.$$animate.addClass(this.$$element,Ya)},$setDirty:function(){this.$dirty=!0;this.$pristine=!1;this.$$animate.removeClass(this.$$element,Ya);this.$$animate.addClass(this.$$element,Vb);this.$$parentForm.$setDirty()},$setUntouched:function(){this.$touched=!1;this.$untouched=!0;this.$$animate.setClass(this.$$element,"ng-untouched","ng-touched")},$setTouched:function(){this.$touched= - !0;this.$untouched=!1;this.$$animate.setClass(this.$$element,"ng-touched","ng-untouched")},$rollbackViewValue:function(){this.$$timeout.cancel(this.$$pendingDebounce);this.$viewValue=this.$$lastCommittedViewValue;this.$render()},$validate:function(){if(!U(this.$modelValue)){var a=this.$$lastCommittedViewValue,b=this.$$rawModelValue,d=this.$valid,c=this.$modelValue,e=this.$options.getOption("allowInvalid"),f=this;this.$$runValidators(b,a,function(a){e||d===a||(f.$modelValue=a?b:void 0,f.$modelValue!== - c&&f.$$writeModelToScope())})}},$$runValidators:function(a,b,d){function c(){var c=!0;r(k.$validators,function(d,e){var g=Boolean(d(a,b));c=c&&g;f(e,g)});return c?!0:(r(k.$asyncValidators,function(a,b){f(b,null)}),!1)}function e(){var c=[],d=!0;r(k.$asyncValidators,function(e,g){var k=e(a,b);if(!k||!C(k.then))throw pb("nopromise",k);f(g,void 0);c.push(k.then(function(){f(g,!0)},function(){d=!1;f(g,!1)}))});c.length?k.$$q.all(c).then(function(){g(d)},D):g(!0)}function f(a,b){h===k.$$currentValidationRunId&& - k.$setValidity(a,b)}function g(a){h===k.$$currentValidationRunId&&d(a)}this.$$currentValidationRunId++;var h=this.$$currentValidationRunId,k=this;(function(){var a=k.$$parserName||"parse";if(x(k.$$parserValid))f(a,null);else return k.$$parserValid||(r(k.$validators,function(a,b){f(b,null)}),r(k.$asyncValidators,function(a,b){f(b,null)})),f(a,k.$$parserValid),k.$$parserValid;return!0})()?c()?e():g(!1):g(!1)},$commitViewValue:function(){var a=this.$viewValue;this.$$timeout.cancel(this.$$pendingDebounce); - if(this.$$lastCommittedViewValue!==a||""===a&&this.$$hasNativeValidators)this.$$updateEmptyClasses(a),this.$$lastCommittedViewValue=a,this.$pristine&&this.$setDirty(),this.$$parseAndValidate()},$$parseAndValidate:function(){var a=this.$$lastCommittedViewValue,b=this;if(this.$$parserValid=x(a)?void 0:!0)for(var d=0;de||c.$isEmpty(b)||b.length<=e}}}}},bd=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e=0;d.$observe("minlength",function(a){e=Z(a)||0;c.$validate()});c.$validators.minlength=function(a,b){return c.$isEmpty(b)||b.length>=e}}}}};w.angular.bootstrap?w.console&&console.log("WARNING: Tried to load AngularJS more than once."): - (Be(),Ee($),$.module("ngLocale",[],["$provide",function(a){function b(a){a+="";var b=a.indexOf(".");return-1==b?0:a.length-b-1}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:"January February March April May June July August September October November December".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "), - STANDALONEMONTH:"January February March April May June July August September October November December".split(" "),WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a","short":"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2, - minFrac:2,minInt:1,negPre:"-\u00a4",negSuf:"",posPre:"\u00a4",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(a,c){var e=a|0,f=c;void 0===f&&(f=Math.min(b(a),3));Math.pow(10,f);return 1==e&&0==f?"one":"other"}})}]),z(function(){we(w.document,Uc)}))})(window);!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend(''); -//# sourceMappingURL=angular.min.js.map \ No newline at end of file diff --git a/setup/pub/angular/angular.min.js.map b/setup/pub/angular/angular.min.js.map deleted file mode 100644 index 1f7eb768415b..000000000000 --- a/setup/pub/angular/angular.min.js.map +++ /dev/null @@ -1,8 +0,0 @@ -{ -"version":3, -"file":"angular.min.js", -"lineCount":196, -"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAmBC,CAAnB,CAA8B,CCLvCC,QAAS,EAAM,CAAC,CAAD,CAAS,CAWtB,MAAO,SAAS,EAAG,CAAA,IACb,EAAO,SAAA,CAAU,CAAV,CADM,CAIf,CAJe,CAKjB,EAHW,GAGX,EAHkB,CAAA,CAAS,CAAT,CAAkB,GAAlB,CAAwB,EAG1C,EAHgD,CAGhD,CAAmB,0CAAnB,EAA+D,CAAA,CAAS,CAAT,CAAkB,GAAlB,CAAwB,EAAvF,EAA6F,CAC7F,KAAK,CAAL,CAAS,CAAT,CAAY,CAAZ,CAAgB,SAAA,OAAhB,CAAkC,CAAA,EAAlC,CACE,CAAA,CAAU,CAAV,EAA0B,CAAL,EAAA,CAAA,CAAS,GAAT,CAAe,GAApC,EAA2C,GAA3C,EAAkD,CAAlD,CAAoD,CAApD,EAAyD,GAAzD,CACE,kBAAA,CAjBc,UAAlB,EAAI,MAiB6B,UAAA,CAAU,CAAV,CAjBjC,CAiBiC,SAAA,CAAU,CAAV,CAhBxB,SAAA,EAAA,QAAA,CAAuB,aAAvB,CAAsC,EAAtC,CADT,CAEyB,WAAlB,EAAI,MAesB,UAAA,CAAU,CAAV,CAf1B,CACE,WADF,CAEoB,QAApB,EAAM,MAaoB,UAAA,CAAU,CAAV,CAb1B,CACE,IAAA,UAAA,CAYwB,SAAA,CAAU,CAAV,CAZxB,CADF,CAa0B,SAAA,CAAU,CAAV,CAA7B,CAEJ,OAAW,MAAJ,CAAU,CAAV,CAVU,CAXG,CDgKxBC,QAASA,GAAW,CAACC,CAAD,CAAM,CACxB,GAAW,IAAX,EAAIA,CAAJ,EAAmBC,EAAA,CAASD,CAAT,CAAnB,CACE,MAAO,CAAA,CAGT;IAAIE,EAASF,CAAAE,OAEb,OAAqB,EAArB,GAAIF,CAAAG,SAAJ,EAA0BD,CAA1B,CACS,CAAA,CADT,CAIOE,CAAA,CAASJ,CAAT,CAJP,EAIwBK,CAAA,CAAQL,CAAR,CAJxB,EAImD,CAJnD,GAIwCE,CAJxC,EAKyB,QALzB,GAKO,MAAOA,EALd,EAK8C,CAL9C,CAKqCA,CALrC,EAKoDA,CALpD,CAK6D,CAL7D,GAKmEF,EAZ3C,CA0C1BM,QAASA,EAAO,CAACN,CAAD,CAAMO,CAAN,CAAgBC,CAAhB,CAAyB,CACvC,IAAIC,CACJ,IAAIT,CAAJ,CACE,GAAIU,CAAA,CAAWV,CAAX,CAAJ,CACE,IAAKS,CAAL,GAAYT,EAAZ,CACa,WAAX,EAAIS,CAAJ,GAAiC,QAAjC,EAA0BA,CAA1B,EAAoD,MAApD,EAA6CA,CAA7C,EAA8DT,CAAAW,eAAA,CAAmBF,CAAnB,CAA9D,GACEF,CAAAK,KAAA,CAAcJ,CAAd,CAAuBR,CAAA,CAAIS,CAAJ,CAAvB,CAAiCA,CAAjC,CAHN,KAMO,IAAIT,CAAAM,QAAJ,EAAmBN,CAAAM,QAAnB,GAAmCA,CAAnC,CACLN,CAAAM,QAAA,CAAYC,CAAZ,CAAsBC,CAAtB,CADK,KAEA,IAAIT,EAAA,CAAYC,CAAZ,CAAJ,CACL,IAAKS,CAAL,CAAW,CAAX,CAAcA,CAAd,CAAoBT,CAAAE,OAApB,CAAgCO,CAAA,EAAhC,CACEF,CAAAK,KAAA,CAAcJ,CAAd,CAAuBR,CAAA,CAAIS,CAAJ,CAAvB,CAAiCA,CAAjC,CAFG,KAIL,KAAKA,CAAL,GAAYT,EAAZ,CACMA,CAAAW,eAAA,CAAmBF,CAAnB,CAAJ,EACEF,CAAAK,KAAA,CAAcJ,CAAd,CAAuBR,CAAA,CAAIS,CAAJ,CAAvB,CAAiCA,CAAjC,CAKR,OAAOT,EAtBgC,CAyBzCa,QAASA,GAAU,CAACb,CAAD,CAAM,CACvB,IAAIc,EAAO,EAAX,CACSL,CAAT,KAASA,CAAT,GAAgBT,EAAhB,CACMA,CAAAW,eAAA,CAAmBF,CAAnB,CAAJ,EACEK,CAAAC,KAAA,CAAUN,CAAV,CAGJ,OAAOK,EAAAE,KAAA,EAPgB,CAUzBC,QAASA,GAAa,CAACjB,CAAD,CAAMO,CAAN,CAAgBC,CAAhB,CAAyB,CAE7C,IADA,IAAIM;AAAOD,EAAA,CAAWb,CAAX,CAAX,CACUkB,EAAI,CAAd,CAAiBA,CAAjB,CAAqBJ,CAAAZ,OAArB,CAAkCgB,CAAA,EAAlC,CACEX,CAAAK,KAAA,CAAcJ,CAAd,CAAuBR,CAAA,CAAIc,CAAA,CAAKI,CAAL,CAAJ,CAAvB,CAAqCJ,CAAA,CAAKI,CAAL,CAArC,CAEF,OAAOJ,EALsC,CAc/CK,QAASA,GAAa,CAACC,CAAD,CAAa,CACjC,MAAO,SAAQ,CAACC,CAAD,CAAQZ,CAAR,CAAa,CAAEW,CAAA,CAAWX,CAAX,CAAgBY,CAAhB,CAAF,CADK,CAYnCC,QAASA,GAAO,EAAG,CAIjB,IAHA,IAAIC,EAAQC,EAAAtB,OAAZ,CACIuB,CAEJ,CAAMF,CAAN,CAAA,CAAa,CACXA,CAAA,EACAE,EAAA,CAAQD,EAAA,CAAID,CAAJ,CAAAG,WAAA,CAAsB,CAAtB,CACR,IAAa,EAAb,EAAID,CAAJ,CAEE,MADAD,GAAA,CAAID,CAAJ,CACO,CADM,GACN,CAAAC,EAAAG,KAAA,CAAS,EAAT,CAET,IAAa,EAAb,EAAIF,CAAJ,CACED,EAAA,CAAID,CAAJ,CAAA,CAAa,GADf,KAIE,OADAC,GAAA,CAAID,CAAJ,CACO,CADMK,MAAAC,aAAA,CAAoBJ,CAApB,CAA4B,CAA5B,CACN,CAAAD,EAAAG,KAAA,CAAS,EAAT,CAXE,CAcbH,EAAAM,QAAA,CAAY,GAAZ,CACA,OAAON,GAAAG,KAAA,CAAS,EAAT,CAnBU,CA4BnBI,QAASA,GAAU,CAAC/B,CAAD,CAAMgC,CAAN,CAAS,CACtBA,CAAJ,CACEhC,CAAAiC,UADF,CACkBD,CADlB,CAIE,OAAOhC,CAAAiC,UALiB,CAsB5BC,QAASA,EAAM,CAACC,CAAD,CAAM,CACnB,IAAIH,EAAIG,CAAAF,UACR3B,EAAA,CAAQ8B,SAAR,CAAmB,QAAQ,CAACpC,CAAD,CAAK,CAC1BA,CAAJ,GAAYmC,CAAZ,EACE7B,CAAA,CAAQN,CAAR,CAAa,QAAQ,CAACqB,CAAD,CAAQZ,CAAR,CAAY,CAC/B0B,CAAA,CAAI1B,CAAJ,CAAA,CAAWY,CADoB,CAAjC,CAF4B,CAAhC,CAQAU,GAAA,CAAWI,CAAX,CAAeH,CAAf,CACA,OAAOG,EAXY,CAcrBE,QAASA,EAAG,CAACC,CAAD,CAAM,CAChB,MAAOC,SAAA,CAASD,CAAT;AAAc,EAAd,CADS,CAKlBE,QAASA,GAAO,CAACC,CAAD,CAASC,CAAT,CAAgB,CAC9B,MAAOR,EAAA,CAAO,KAAKA,CAAA,CAAO,QAAQ,EAAG,EAAlB,CAAsB,WAAWO,CAAX,CAAtB,CAAL,CAAP,CAA0DC,CAA1D,CADuB,CAmBhCC,QAASA,EAAI,EAAG,EAmBhBC,QAASA,GAAQ,CAACC,CAAD,CAAI,CAAC,MAAOA,EAAR,CAIrBC,QAASA,GAAO,CAACzB,CAAD,CAAQ,CAAC,MAAO,SAAQ,EAAG,CAAC,MAAOA,EAAR,CAAnB,CAaxB0B,QAASA,EAAW,CAAC1B,CAAD,CAAO,CAAC,MAAuB,WAAvB,EAAO,MAAOA,EAAf,CAc3B2B,QAASA,EAAS,CAAC3B,CAAD,CAAO,CAAC,MAAuB,WAAvB,EAAO,MAAOA,EAAf,CAezB4B,QAASA,EAAQ,CAAC5B,CAAD,CAAO,CAAC,MAAgB,KAAhB,EAAOA,CAAP,EAAwC,QAAxC,EAAwB,MAAOA,EAAhC,CAcxBjB,QAASA,EAAQ,CAACiB,CAAD,CAAO,CAAC,MAAuB,QAAvB,EAAO,MAAOA,EAAf,CAcxB6B,QAASA,GAAQ,CAAC7B,CAAD,CAAO,CAAC,MAAuB,QAAvB,EAAO,MAAOA,EAAf,CAcxB8B,QAASA,GAAM,CAAC9B,CAAD,CAAO,CACpB,MAAgC,eAAhC,EAAO+B,EAAAC,MAAA,CAAehC,CAAf,CADa,CAgBtBhB,QAASA,EAAO,CAACgB,CAAD,CAAQ,CACtB,MAAgC,gBAAhC,EAAO+B,EAAAC,MAAA,CAAehC,CAAf,CADe,CAgBxBX,QAASA,EAAU,CAACW,CAAD,CAAO,CAAC,MAAuB,UAAvB,EAAO,MAAOA,EAAf,CArea;AA+evCiC,QAASA,GAAQ,CAACjC,CAAD,CAAQ,CACvB,MAAgC,iBAAhC,EAAO+B,EAAAC,MAAA,CAAehC,CAAf,CADgB,CAYzBpB,QAASA,GAAQ,CAACD,CAAD,CAAM,CACrB,MAAOA,EAAP,EAAcA,CAAAJ,SAAd,EAA8BI,CAAAuD,SAA9B,EAA8CvD,CAAAwD,MAA9C,EAA2DxD,CAAAyD,YADtC,CA8CvBC,QAASA,GAAS,CAACC,CAAD,CAAO,CACvB,MAAOA,EAAP,GACGA,CAAAC,SADH,EAEMD,CAAAE,GAFN,EAEiBF,CAAAG,KAFjB,CADuB,CA+BzBC,QAASA,GAAG,CAAC/D,CAAD,CAAMO,CAAN,CAAgBC,CAAhB,CAAyB,CACnC,IAAIwD,EAAU,EACd1D,EAAA,CAAQN,CAAR,CAAa,QAAQ,CAACqB,CAAD,CAAQE,CAAR,CAAe0C,CAAf,CAAqB,CACxCD,CAAAjD,KAAA,CAAaR,CAAAK,KAAA,CAAcJ,CAAd,CAAuBa,CAAvB,CAA8BE,CAA9B,CAAqC0C,CAArC,CAAb,CADwC,CAA1C,CAGA,OAAOD,EAL4B,CAwCrCE,QAASA,GAAO,CAACC,CAAD,CAAQnE,CAAR,CAAa,CAC3B,GAAImE,CAAAD,QAAJ,CAAmB,MAAOC,EAAAD,QAAA,CAAclE,CAAd,CAE1B,KAAM,IAAIkB,EAAI,CAAd,CAAiBA,CAAjB,CAAqBiD,CAAAjE,OAArB,CAAmCgB,CAAA,EAAnC,CACE,GAAIlB,CAAJ,GAAYmE,CAAA,CAAMjD,CAAN,CAAZ,CAAsB,MAAOA,EAE/B,OAAQ,EANmB,CAS7BkD,QAASA,GAAW,CAACD,CAAD,CAAQ9C,CAAR,CAAe,CACjC,IAAIE,EAAQ2C,EAAA,CAAQC,CAAR,CAAe9C,CAAf,CACA,EAAZ,EAAIE,CAAJ,EACE4C,CAAAE,OAAA,CAAa9C,CAAb,CAAoB,CAApB,CACF,OAAOF,EAJ0B,CA8EnCiD,QAASA,GAAI,CAACC,CAAD,CAASC,CAAT,CAAqB,CAChC,GAAIvE,EAAA,CAASsE,CAAT,CAAJ,EAAgCA,CAAhC,EAAgCA,CAvMlBE,WAuMd,EAAgCF,CAvMAG,OAuMhC,CACE,KAAMC,GAAA,CAAS,MAAT,CAAN,CAGF,GAAKH,CAAL,CAaO,CACL,GAAID,CAAJ;AAAeC,CAAf,CAA4B,KAAMG,GAAA,CAAS,KAAT,CAAN,CAC5B,GAAItE,CAAA,CAAQkE,CAAR,CAAJ,CAEE,IAAM,IAAIrD,EADVsD,CAAAtE,OACUgB,CADW,CACrB,CAAiBA,CAAjB,CAAqBqD,CAAArE,OAArB,CAAoCgB,CAAA,EAApC,CACEsD,CAAAzD,KAAA,CAAiBuD,EAAA,CAAKC,CAAA,CAAOrD,CAAP,CAAL,CAAjB,CAHJ,KAKO,CACDc,CAAAA,CAAIwC,CAAAvC,UACR3B,EAAA,CAAQkE,CAAR,CAAqB,QAAQ,CAACnD,CAAD,CAAQZ,CAAR,CAAY,CACvC,OAAO+D,CAAA,CAAY/D,CAAZ,CADgC,CAAzC,CAGA,KAAMA,IAAIA,CAAV,GAAiB8D,EAAjB,CACEC,CAAA,CAAY/D,CAAZ,CAAA,CAAmB6D,EAAA,CAAKC,CAAA,CAAO9D,CAAP,CAAL,CAErBsB,GAAA,CAAWyC,CAAX,CAAuBxC,CAAvB,CARK,CAPF,CAbP,IAEE,CADAwC,CACA,CADcD,CACd,IACMlE,CAAA,CAAQkE,CAAR,CAAJ,CACEC,CADF,CACgBF,EAAA,CAAKC,CAAL,CAAa,EAAb,CADhB,CAEWpB,EAAA,CAAOoB,CAAP,CAAJ,CACLC,CADK,CACS,IAAII,IAAJ,CAASL,CAAAM,QAAA,EAAT,CADT,CAEIvB,EAAA,CAASiB,CAAT,CAAJ,CACLC,CADK,CACaM,MAAJ,CAAWP,CAAAA,OAAX,CADT,CAEItB,CAAA,CAASsB,CAAT,CAFJ,GAGLC,CAHK,CAGSF,EAAA,CAAKC,CAAL,CAAa,EAAb,CAHT,CALT,CA6BF,OAAOC,EApCyB,CA0ClCO,QAASA,GAAW,CAACC,CAAD,CAAM7C,CAAN,CAAW,CAC7BA,CAAA,CAAMA,CAAN,EAAa,EAEb,KAAI1B,IAAIA,CAAR,GAAeuE,EAAf,CAGMA,CAAArE,eAAA,CAAmBF,CAAnB,CAAJ,EAAoD,IAApD,GAA+BA,CAAAwE,OAAA,CAAW,CAAX,CAAc,CAAd,CAA/B,GACE9C,CAAA,CAAI1B,CAAJ,CADF,CACauE,CAAA,CAAIvE,CAAJ,CADb,CAKF,OAAO0B,EAXsB,CA0C/B+C,QAASA,GAAM,CAACC,CAAD,CAAKC,CAAL,CAAS,CACtB,GAAID,CAAJ,GAAWC,CAAX,CAAe,MAAO,CAAA,CACtB,IAAW,IAAX,GAAID,CAAJ,EAA0B,IAA1B,GAAmBC,CAAnB,CAAgC,MAAO,CAAA,CACvC,IAAID,CAAJ,GAAWA,CAAX,EAAiBC,CAAjB,GAAwBA,CAAxB,CAA4B,MAAO,CAAA,CAHb,KAIlBC,EAAK,MAAOF,EAJM,CAIsB1E,CAC5C,IAAI4E,CAAJ,EADyBC,MAAOF,EAChC;AACY,QADZ,EACMC,CADN,CAEI,GAAIhF,CAAA,CAAQ8E,CAAR,CAAJ,CAAiB,CACf,GAAI,CAAC9E,CAAA,CAAQ+E,CAAR,CAAL,CAAkB,MAAO,CAAA,CACzB,KAAKlF,CAAL,CAAciF,CAAAjF,OAAd,GAA4BkF,CAAAlF,OAA5B,CAAuC,CACrC,IAAIO,CAAJ,CAAQ,CAAR,CAAWA,CAAX,CAAeP,CAAf,CAAuBO,CAAA,EAAvB,CACE,GAAI,CAACyE,EAAA,CAAOC,CAAA,CAAG1E,CAAH,CAAP,CAAgB2E,CAAA,CAAG3E,CAAH,CAAhB,CAAL,CAA+B,MAAO,CAAA,CAExC,OAAO,CAAA,CAJ8B,CAFxB,CAAjB,IAQO,CAAA,GAAI0C,EAAA,CAAOgC,CAAP,CAAJ,CACL,MAAOhC,GAAA,CAAOiC,CAAP,CAAP,EAAqBD,CAAAN,QAAA,EAArB,EAAqCO,CAAAP,QAAA,EAChC,IAAIvB,EAAA,CAAS6B,CAAT,CAAJ,EAAoB7B,EAAA,CAAS8B,CAAT,CAApB,CACL,MAAOD,EAAA/B,SAAA,EAAP,EAAwBgC,CAAAhC,SAAA,EAExB,IAAY+B,CAAZ,EAAYA,CA9SJV,WA8SR,EAAYU,CA9ScT,OA8S1B,EAA2BU,CAA3B,EAA2BA,CA9SnBX,WA8SR,EAA2BW,CA9SDV,OA8S1B,EAAkCzE,EAAA,CAASkF,CAAT,CAAlC,EAAkDlF,EAAA,CAASmF,CAAT,CAAlD,EAAkE/E,CAAA,CAAQ+E,CAAR,CAAlE,CAA+E,MAAO,CAAA,CACtFG,EAAA,CAAS,EACT,KAAI9E,CAAJ,GAAW0E,EAAX,CACE,GAAsB,GAAtB,GAAI1E,CAAA+E,OAAA,CAAW,CAAX,CAAJ,EAA6B,CAAA9E,CAAA,CAAWyE,CAAA,CAAG1E,CAAH,CAAX,CAA7B,CAAA,CACA,GAAI,CAACyE,EAAA,CAAOC,CAAA,CAAG1E,CAAH,CAAP,CAAgB2E,CAAA,CAAG3E,CAAH,CAAhB,CAAL,CAA+B,MAAO,CAAA,CACtC8E,EAAA,CAAO9E,CAAP,CAAA,CAAc,CAAA,CAFd,CAIF,IAAIA,CAAJ,GAAW2E,EAAX,CACE,GAAI,CAACG,CAAA5E,eAAA,CAAsBF,CAAtB,CAAL,EACsB,GADtB,GACIA,CAAA+E,OAAA,CAAW,CAAX,CADJ,EAEIJ,CAAA,CAAG3E,CAAH,CAFJ,GAEgBZ,CAFhB,EAGI,CAACa,CAAA,CAAW0E,CAAA,CAAG3E,CAAH,CAAX,CAHL,CAG0B,MAAO,CAAA,CAEnC,OAAO,CAAA,CAlBF,CAsBX,MAAO,CAAA,CArCe,CAkExBgF,QAASA,GAAI,CAACC,CAAD;AAAOC,CAAP,CAAW,CACtB,IAAIC,EAA+B,CAAnB,CAAAxD,SAAAlC,OAAA,CArBT2F,EAAAjF,KAAA,CAqB0CwB,SArB1C,CAqBqD0D,CArBrD,CAqBS,CAAiD,EACjE,OAAI,CAAApF,CAAA,CAAWiF,CAAX,CAAJ,EAAwBA,CAAxB,WAAsCb,OAAtC,CAcSa,CAdT,CACSC,CAAA1F,OACA,CAAH,QAAQ,EAAG,CACT,MAAOkC,UAAAlC,OACA,CAAHyF,CAAAtC,MAAA,CAASqC,CAAT,CAAeE,CAAAG,OAAA,CAAiBF,EAAAjF,KAAA,CAAWwB,SAAX,CAAsB,CAAtB,CAAjB,CAAf,CAAG,CACHuD,CAAAtC,MAAA,CAASqC,CAAT,CAAeE,CAAf,CAHK,CAAR,CAKH,QAAQ,EAAG,CACT,MAAOxD,UAAAlC,OACA,CAAHyF,CAAAtC,MAAA,CAASqC,CAAT,CAAetD,SAAf,CAAG,CACHuD,CAAA/E,KAAA,CAAQ8E,CAAR,CAHK,CATK,CAqBxBM,QAASA,GAAc,CAACvF,CAAD,CAAMY,CAAN,CAAa,CAClC,IAAI4E,EAAM5E,CAES,SAAnB,GAAI,MAAOZ,EAAX,EAAiD,GAAjD,GAA+BA,CAAA+E,OAAA,CAAW,CAAX,CAA/B,CACES,CADF,CACQpG,CADR,CAEWI,EAAA,CAASoB,CAAT,CAAJ,CACL4E,CADK,CACC,SADD,CAEI5E,CAAJ,EAAczB,CAAd,GAA2ByB,CAA3B,CACL4E,CADK,CACC,WADD,CAEY5E,CAFZ,GAEYA,CA1XLoD,WAwXP,EAEYpD,CA1XaqD,OAwXzB,IAGLuB,CAHK,CAGC,QAHD,CAMP,OAAOA,EAb2B,CA8BpCC,QAASA,GAAM,CAAClG,CAAD,CAAMmG,CAAN,CAAc,CAC3B,MAAmB,WAAnB,GAAI,MAAOnG,EAAX,CAAuCH,CAAvC,CACOuG,IAAAC,UAAA,CAAerG,CAAf,CAAoBgG,EAApB,CAAoCG,CAAA,CAAS,IAAT,CAAgB,IAApD,CAFoB,CAiB7BG,QAASA,GAAQ,CAACC,CAAD,CAAO,CACtB,MAAOnG,EAAA,CAASmG,CAAT,CACA;AAADH,IAAAI,MAAA,CAAWD,CAAX,CAAC,CACDA,CAHgB,CAOxBE,QAASA,GAAS,CAACpF,CAAD,CAAQ,CACpBA,CAAJ,EAA8B,CAA9B,GAAaA,CAAAnB,OAAb,EACMwG,CACJ,CADQC,CAAA,CAAU,EAAV,CAAetF,CAAf,CACR,CAAAA,CAAA,CAAQ,EAAO,GAAP,EAAEqF,CAAF,EAAmB,GAAnB,EAAcA,CAAd,EAA+B,OAA/B,EAA0BA,CAA1B,EAA+C,IAA/C,EAA0CA,CAA1C,EAA4D,GAA5D,EAAuDA,CAAvD,EAAwE,IAAxE,EAAmEA,CAAnE,CAFV,EAIErF,CAJF,CAIU,CAAA,CAEV,OAAOA,EAPiB,CAa1BuF,QAASA,GAAW,CAACC,CAAD,CAAU,CAC5BA,CAAA,CAAUC,CAAA,CAAOD,CAAP,CAAAE,MAAA,EACV,IAAI,CAGFF,CAAAG,KAAA,CAAa,EAAb,CAHE,CAIF,MAAMC,CAAN,CAAS,EAGX,IAAIC,EAAWJ,CAAA,CAAO,OAAP,CAAAK,OAAA,CAAuBN,CAAvB,CAAAG,KAAA,EACf,IAAI,CACF,MAHcI,EAGP,GAAAP,CAAA,CAAQ,CAAR,CAAA1G,SAAA,CAAoCwG,CAAA,CAAUO,CAAV,CAApC,CACHA,CAAAG,MAAA,CACQ,YADR,CACA,CAAsB,CAAtB,CAAAC,QAAA,CACU,aADV,CACyB,QAAQ,CAACD,CAAD,CAAQzD,CAAR,CAAkB,CAAE,MAAO,GAAP,CAAa+C,CAAA,CAAU/C,CAAV,CAAf,CADnD,CAHF,CAKF,MAAMqD,CAAN,CAAS,CACT,MAAON,EAAA,CAAUO,CAAV,CADE,CAfiB,CAgC9BK,QAASA,GAAqB,CAAClG,CAAD,CAAQ,CACpC,GAAI,CACF,MAAOmG,mBAAA,CAAmBnG,CAAnB,CADL,CAEF,MAAM4F,CAAN,CAAS,EAHyB,CAatCQ,QAASA,GAAa,CAAYC,CAAZ,CAAsB,CAAA,IACtC1H,EAAM,EADgC,CAC5B2H,CAD4B,CACjBlH,CACzBH,EAAA,CAASsH,CAAAF,CAAAE,EAAY,EAAZA,OAAA,CAAsB,GAAtB,CAAT,CAAqC,QAAQ,CAACF,CAAD,CAAU,CAChDA,CAAL,GACEC,CAEA,CAFYD,CAAAE,MAAA,CAAe,GAAf,CAEZ,CADAnH,CACA,CADM8G,EAAA,CAAsBI,CAAA,CAAU,CAAV,CAAtB,CACN;AAAK3E,CAAA,CAAUvC,CAAV,CAAL,GACMwF,CACJ,CADUjD,CAAA,CAAU2E,CAAA,CAAU,CAAV,CAAV,CAAA,CAA0BJ,EAAA,CAAsBI,CAAA,CAAU,CAAV,CAAtB,CAA1B,CAAgE,CAAA,CAC1E,CAAK3H,CAAA,CAAIS,CAAJ,CAAL,CAEUJ,CAAA,CAAQL,CAAA,CAAIS,CAAJ,CAAR,CAAH,CACLT,CAAA,CAAIS,CAAJ,CAAAM,KAAA,CAAckF,CAAd,CADK,CAGLjG,CAAA,CAAIS,CAAJ,CAHK,CAGM,CAACT,CAAA,CAAIS,CAAJ,CAAD,CAAUwF,CAAV,CALb,CACEjG,CAAA,CAAIS,CAAJ,CADF,CACawF,CAHf,CAHF,CADqD,CAAvD,CAgBA,OAAOjG,EAlBmC,CAqB5C6H,QAASA,GAAU,CAAC7H,CAAD,CAAM,CACvB,IAAI8H,EAAQ,EACZxH,EAAA,CAAQN,CAAR,CAAa,QAAQ,CAACqB,CAAD,CAAQZ,CAAR,CAAa,CAC5BJ,CAAA,CAAQgB,CAAR,CAAJ,CACEf,CAAA,CAAQe,CAAR,CAAe,QAAQ,CAAC0G,CAAD,CAAa,CAClCD,CAAA/G,KAAA,CAAWiH,EAAA,CAAevH,CAAf,CAAoB,CAAA,CAApB,CAAX,EAAuD,CAAA,CAAf,GAAAsH,CAAA,CAAsB,EAAtB,CAA2B,GAA3B,CAAiCC,EAAA,CAAeD,CAAf,CAA2B,CAAA,CAA3B,CAAzE,EADkC,CAApC,CADF,CAKAD,CAAA/G,KAAA,CAAWiH,EAAA,CAAevH,CAAf,CAAoB,CAAA,CAApB,CAAX,EAAkD,CAAA,CAAV,GAAAY,CAAA,CAAiB,EAAjB,CAAsB,GAAtB,CAA4B2G,EAAA,CAAe3G,CAAf,CAAsB,CAAA,CAAtB,CAApE,EANgC,CAAlC,CASA,OAAOyG,EAAA5H,OAAA,CAAe4H,CAAAnG,KAAA,CAAW,GAAX,CAAf,CAAiC,EAXjB,CA0BzBsG,QAASA,GAAgB,CAAChC,CAAD,CAAM,CAC7B,MAAO+B,GAAA,CAAe/B,CAAf,CAAoB,CAAA,CAApB,CAAAqB,QAAA,CACY,OADZ,CACqB,GADrB,CAAAA,QAAA,CAEY,OAFZ,CAEqB,GAFrB,CAAAA,QAAA,CAGY,OAHZ,CAGqB,GAHrB,CADsB,CAmB/BU,QAASA,GAAc,CAAC/B,CAAD,CAAMiC,CAAN,CAAuB,CAC5C,MAAOC,mBAAA,CAAmBlC,CAAnB,CAAAqB,QAAA,CACY,OADZ,CACqB,GADrB,CAAAA,QAAA,CAEY,OAFZ,CAEqB,GAFrB,CAAAA,QAAA,CAGY,MAHZ,CAGoB,GAHpB,CAAAA,QAAA,CAIY,OAJZ,CAIqB,GAJrB,CAAAA,QAAA,CAKY,MALZ;AAKqBY,CAAA,CAAkB,KAAlB,CAA0B,GAL/C,CADqC,CA0C9CE,QAASA,GAAW,CAACvB,CAAD,CAAUwB,CAAV,CAAqB,CAOvClB,QAASA,EAAM,CAACN,CAAD,CAAU,CACvBA,CAAA,EAAWyB,CAAAvH,KAAA,CAAc8F,CAAd,CADY,CAPc,IACnCyB,EAAW,CAACzB,CAAD,CADwB,CAEnC0B,CAFmC,CAGnCC,CAHmC,CAInCC,EAAQ,CAAC,QAAD,CAAW,QAAX,CAAqB,UAArB,CAAiC,aAAjC,CAJ2B,CAKnCC,EAAsB,mCAM1BpI,EAAA,CAAQmI,CAAR,CAAe,QAAQ,CAACE,CAAD,CAAO,CAC5BF,CAAA,CAAME,CAAN,CAAA,CAAc,CAAA,CACdxB,EAAA,CAAOvH,CAAAgJ,eAAA,CAAwBD,CAAxB,CAAP,CACAA,EAAA,CAAOA,CAAArB,QAAA,CAAa,GAAb,CAAkB,KAAlB,CACHT,EAAAgC,iBAAJ,GACEvI,CAAA,CAAQuG,CAAAgC,iBAAA,CAAyB,GAAzB,CAA+BF,CAA/B,CAAR,CAA8CxB,CAA9C,CAEA,CADA7G,CAAA,CAAQuG,CAAAgC,iBAAA,CAAyB,GAAzB,CAA+BF,CAA/B,CAAsC,KAAtC,CAAR,CAAsDxB,CAAtD,CACA,CAAA7G,CAAA,CAAQuG,CAAAgC,iBAAA,CAAyB,GAAzB,CAA+BF,CAA/B,CAAsC,GAAtC,CAAR,CAAoDxB,CAApD,CAHF,CAJ4B,CAA9B,CAWA7G,EAAA,CAAQgI,CAAR,CAAkB,QAAQ,CAACzB,CAAD,CAAU,CAClC,GAAI,CAAC0B,CAAL,CAAiB,CAEf,IAAIlB,EAAQqB,CAAAI,KAAA,CADI,GACJ,CADUjC,CAAAkC,UACV,CAD8B,GAC9B,CACR1B,EAAJ,EACEkB,CACA,CADa1B,CACb,CAAA2B,CAAA,CAAUlB,CAAAD,CAAA,CAAM,CAAN,CAAAC,EAAY,EAAZA,SAAA,CAAwB,MAAxB,CAAgC,GAAhC,CAFZ,EAIEhH,CAAA,CAAQuG,CAAAmC,WAAR,CAA4B,QAAQ,CAACC,CAAD,CAAO,CACpCV,CAAAA,CAAL,EAAmBE,CAAA,CAAMQ,CAAAN,KAAN,CAAnB,GACEJ,CACA,CADa1B,CACb,CAAA2B,CAAA,CAASS,CAAA5H,MAFX,CADyC,CAA3C,CAPa,CADiB,CAApC,CAiBIkH;CAAJ,EACEF,CAAA,CAAUE,CAAV,CAAsBC,CAAA,CAAS,CAACA,CAAD,CAAT,CAAoB,EAA1C,CAxCqC,CA6DzCH,QAASA,GAAS,CAACxB,CAAD,CAAUqC,CAAV,CAAmB,CACnC,IAAIC,EAAcA,QAAQ,EAAG,CAC3BtC,CAAA,CAAUC,CAAA,CAAOD,CAAP,CAEV,IAAIA,CAAAuC,SAAA,EAAJ,CAAwB,CACtB,IAAIC,EAAOxC,CAAA,CAAQ,CAAR,CAAD,GAAgBjH,CAAhB,CAA4B,UAA5B,CAAyCgH,EAAA,CAAYC,CAAZ,CACnD,MAAMlC,GAAA,CAAS,SAAT,CAAwE0E,CAAxE,CAAN,CAFsB,CAKxBH,CAAA,CAAUA,CAAV,EAAqB,EACrBA,EAAApH,QAAA,CAAgB,CAAC,UAAD,CAAa,QAAQ,CAACwH,CAAD,CAAW,CAC9CA,CAAAjI,MAAA,CAAe,cAAf,CAA+BwF,CAA/B,CAD8C,CAAhC,CAAhB,CAGAqC,EAAApH,QAAA,CAAgB,IAAhB,CACIsH,EAAAA,CAAWG,EAAA,CAAeL,CAAf,CACfE,EAAAI,OAAA,CAAgB,CAAC,YAAD,CAAe,cAAf,CAA+B,UAA/B,CAA2C,WAA3C,CAAwD,UAAxD,CACb,QAAQ,CAACC,CAAD,CAAQ5C,CAAR,CAAiB6C,CAAjB,CAA0BN,CAA1B,CAAoCO,CAApC,CAA6C,CACpDF,CAAAG,OAAA,CAAa,QAAQ,EAAG,CACtB/C,CAAAgD,KAAA,CAAa,WAAb,CAA0BT,CAA1B,CACAM,EAAA,CAAQ7C,CAAR,CAAA,CAAiB4C,CAAjB,CAFsB,CAAxB,CAIAE,EAAAG,QAAA,CAAgB,CAAA,CAAhB,CALoD,CADxC,CAAhB,CASA,OAAOV,EAvBoB,CAA7B,CA0BIW,EAAqB,sBAEzB,IAAIpK,CAAJ,EAAc,CAACoK,CAAAC,KAAA,CAAwBrK,CAAAgJ,KAAxB,CAAf,CACE,MAAOQ,EAAA,EAGTxJ,EAAAgJ,KAAA,CAAchJ,CAAAgJ,KAAArB,QAAA,CAAoByC,CAApB,CAAwC,EAAxC,CACdE,GAAAC,gBAAA;AAA0BC,QAAQ,CAACC,CAAD,CAAe,CAC/C9J,CAAA,CAAQ8J,CAAR,CAAsB,QAAQ,CAAC5B,CAAD,CAAS,CACrCU,CAAAnI,KAAA,CAAayH,CAAb,CADqC,CAAvC,CAGAW,EAAA,EAJ+C,CAlCd,CA2CrCkB,QAASA,GAAU,CAAC1B,CAAD,CAAO2B,CAAP,CAAiB,CAClCA,CAAA,CAAYA,CAAZ,EAAyB,GACzB,OAAO3B,EAAArB,QAAA,CAAaiD,EAAb,CAAgC,QAAQ,CAACC,CAAD,CAASC,CAAT,CAAc,CAC3D,OAAQA,CAAA,CAAMH,CAAN,CAAkB,EAA1B,EAAgCE,CAAAE,YAAA,EAD2B,CAAtD,CAF2B,CAgCpCC,QAASA,GAAS,CAACC,CAAD,CAAMjC,CAAN,CAAYkC,CAAZ,CAAoB,CACpC,GAAI,CAACD,CAAL,CACE,KAAMjG,GAAA,CAAS,MAAT,CAA2CgE,CAA3C,EAAmD,GAAnD,CAA0DkC,CAA1D,EAAoE,UAApE,CAAN,CAEF,MAAOD,EAJ6B,CAOtCE,QAASA,GAAW,CAACF,CAAD,CAAMjC,CAAN,CAAYoC,CAAZ,CAAmC,CACjDA,CAAJ,EAA6B1K,CAAA,CAAQuK,CAAR,CAA7B,GACIA,CADJ,CACUA,CAAA,CAAIA,CAAA1K,OAAJ,CAAiB,CAAjB,CADV,CAIAyK,GAAA,CAAUjK,CAAA,CAAWkK,CAAX,CAAV,CAA2BjC,CAA3B,CAAiC,sBAAjC,EACKiC,CAAA,EAAqB,QAArB,EAAO,MAAOA,EAAd,CAAgCA,CAAAI,YAAArC,KAAhC,EAAwD,QAAxD,CAAmE,MAAOiC,EAD/E,EAEA,OAAOA,EAP8C,CAevDK,QAASA,GAAuB,CAACtC,CAAD,CAAOnI,CAAP,CAAgB,CAC9C,GAAa,gBAAb,GAAImI,CAAJ,CACE,KAAMhE,GAAA,CAAS,SAAT,CAA8DnE,CAA9D,CAAN,CAF4C,CAchD0K,QAASA,GAAM,CAAClL,CAAD,CAAMmL,CAAN,CAAYC,CAAZ,CAA2B,CACxC,GAAI,CAACD,CAAL,CAAW,MAAOnL,EACdc,EAAAA,CAAOqK,CAAAvD,MAAA,CAAW,GAAX,CAKX,KAJA,IAAInH,CAAJ,CACI4K,EAAerL,CADnB,CAEIsL,EAAMxK,CAAAZ,OAFV,CAISgB;AAAI,CAAb,CAAgBA,CAAhB,CAAoBoK,CAApB,CAAyBpK,CAAA,EAAzB,CACET,CACA,CADMK,CAAA,CAAKI,CAAL,CACN,CAAIlB,CAAJ,GACEA,CADF,CACQ,CAACqL,CAAD,CAAgBrL,CAAhB,EAAqBS,CAArB,CADR,CAIF,OAAI,CAAC2K,CAAL,EAAsB1K,CAAA,CAAWV,CAAX,CAAtB,CACSyF,EAAA,CAAK4F,CAAL,CAAmBrL,CAAnB,CADT,CAGOA,CAhBiC,CA2B1CuL,QAASA,GAAiB,CAAC5L,CAAD,CAAS,CAIjC6L,QAASA,EAAM,CAACxL,CAAD,CAAM2I,CAAN,CAAY8C,CAAZ,CAAqB,CAClC,MAAOzL,EAAA,CAAI2I,CAAJ,CAAP,GAAqB3I,CAAA,CAAI2I,CAAJ,CAArB,CAAiC8C,CAAA,EAAjC,CADkC,CAFpC,IAAIC,EAAkB5L,CAAA,CAAO,WAAP,CAMtB,OAAO0L,EAAA,CAAOA,CAAA,CAAO7L,CAAP,CAAe,SAAf,CAA0BgM,MAA1B,CAAP,CAA0C,QAA1C,CAAoD,QAAQ,EAAG,CAEpE,IAAIzC,EAAU,EAmDd,OAAOV,SAAe,CAACG,CAAD,CAAOiD,CAAP,CAAiBC,CAAjB,CAA2B,CAC/CZ,EAAA,CAAwBtC,CAAxB,CAA8B,QAA9B,CACIiD,EAAJ,EAAgB1C,CAAAvI,eAAA,CAAuBgI,CAAvB,CAAhB,GACEO,CAAA,CAAQP,CAAR,CADF,CACkB,IADlB,CAGA,OAAO6C,EAAA,CAAOtC,CAAP,CAAgBP,CAAhB,CAAsB,QAAQ,EAAG,CA6MtCmD,QAASA,EAAW,CAACC,CAAD,CAAWC,CAAX,CAAmBC,CAAnB,CAAiC,CACnD,MAAO,SAAQ,EAAG,CAChBC,CAAA,CAAYD,CAAZ,EAA4B,MAA5B,CAAA,CAAoC,CAACF,CAAD,CAAWC,CAAX,CAAmB5J,SAAnB,CAApC,CACA,OAAO+J,EAFS,CADiC,CA5MrD,GAAI,CAACP,CAAL,CACE,KAAMF,EAAA,CAAgB,OAAhB,CAEW/C,CAFX,CAAN,CAMF,IAAIuD,EAAc,EAAlB,CAGIE,EAAY,EAHhB,CAKIC,EAASP,CAAA,CAAY,WAAZ,CAAyB,QAAzB,CALb,CAQIK,EAAiB,cAELD,CAFK,YAGPE,CAHO,UAaTR,CAbS,MAsBbjD,CAtBa,UAkCTmD,CAAA,CAAY,UAAZ;AAAwB,UAAxB,CAlCS,SA6CVA,CAAA,CAAY,UAAZ,CAAwB,SAAxB,CA7CU,SAwDVA,CAAA,CAAY,UAAZ,CAAwB,SAAxB,CAxDU,OAmEZA,CAAA,CAAY,UAAZ,CAAwB,OAAxB,CAnEY,UA+ETA,CAAA,CAAY,UAAZ,CAAwB,UAAxB,CAAoC,SAApC,CA/ES,WAgHRA,CAAA,CAAY,kBAAZ,CAAgC,UAAhC,CAhHQ,QA2HXA,CAAA,CAAY,iBAAZ,CAA+B,UAA/B,CA3HW,YAuIPA,CAAA,CAAY,qBAAZ,CAAmC,UAAnC,CAvIO,WAoJRA,CAAA,CAAY,kBAAZ,CAAgC,WAAhC,CApJQ,QA+JXO,CA/JW,KA2KdC,QAAQ,CAACC,CAAD,CAAQ,CACnBH,CAAArL,KAAA,CAAewL,CAAf,CACA,OAAO,KAFY,CA3KF,CAiLjBV,EAAJ,EACEQ,CAAA,CAAOR,CAAP,CAGF,OAAQM,EArM8B,CAAjC,CALwC,CArDmB,CAA/D,CAR0B,CA0gBnCK,QAASA,GAAS,CAAC7D,CAAD,CAAO,CACvB,MAAOA,EAAArB,QAAA,CACGmF,EADH,CACyB,QAAQ,CAACC,CAAD,CAAIpC,CAAJ,CAAeE,CAAf,CAAuBmC,CAAvB,CAA+B,CACnE,MAAOA,EAAA,CAASnC,CAAAoC,YAAA,EAAT,CAAgCpC,CAD4B,CADhE,CAAAlD,QAAA,CAIGuF,EAJH,CAIoB,OAJpB,CADgB,CAgBzBC,QAASA,GAAuB,CAACnE,CAAD;AAAOoE,CAAP,CAAqBC,CAArB,CAAkCC,CAAlC,CAAuD,CAMrFC,QAASA,EAAW,CAACC,CAAD,CAAQ,CAAA,IACtBlJ,EAAO+I,CAAA,EAAeG,CAAf,CAAuB,CAAC,IAAAC,OAAA,CAAYD,CAAZ,CAAD,CAAvB,CAA8C,CAAC,IAAD,CAD/B,CAEtBE,EAAYN,CAFU,CAGtBO,CAHsB,CAGjBC,CAHiB,CAGPC,CAHO,CAItB3G,CAJsB,CAIb4G,CAJa,CAIYC,CAEtC,IAAI,CAACT,CAAL,EAAqC,IAArC,EAA4BE,CAA5B,CACE,IAAA,CAAMlJ,CAAA/D,OAAN,CAAA,CAEE,IADAoN,CACkB,CADZrJ,CAAA0J,MAAA,EACY,CAAdJ,CAAc,CAAH,CAAG,CAAAC,CAAA,CAAYF,CAAApN,OAA9B,CAA0CqN,CAA1C,CAAqDC,CAArD,CAAgED,CAAA,EAAhE,CAOE,IANA1G,CAMoB,CANVC,CAAA,CAAOwG,CAAA,CAAIC,CAAJ,CAAP,CAMU,CALhBF,CAAJ,CACExG,CAAA+G,eAAA,CAAuB,UAAvB,CADF,CAGEP,CAHF,CAGc,CAACA,CAEK,CAAhBI,CAAgB,CAAH,CAAG,CAAAI,CAAA,CAAe3N,CAAAwN,CAAAxN,CAAW2G,CAAA6G,SAAA,EAAXxN,QAAnC,CACIuN,CADJ,CACiBI,CADjB,CAEIJ,CAAA,EAFJ,CAGExJ,CAAAlD,KAAA,CAAU+M,EAAA,CAAOJ,CAAA,CAASD,CAAT,CAAP,CAAV,CAKR,OAAOM,EAAA1K,MAAA,CAAmB,IAAnB,CAAyBjB,SAAzB,CAxBmB,CAL5B,IAAI2L,EAAeD,EAAAnI,GAAA,CAAUgD,CAAV,CAAnB,CACAoF,EAAeA,CAAAC,UAAfD,EAAyCA,CACzCb,EAAAc,UAAA,CAAwBD,CACxBD,GAAAnI,GAAA,CAAUgD,CAAV,CAAA,CAAkBuE,CAJmE,CAmCvFe,QAASA,EAAM,CAACpH,CAAD,CAAU,CACvB,GAAIA,CAAJ,WAAuBoH,EAAvB,CACE,MAAOpH,EAET,IAAI,EAAE,IAAF,WAAkBoH,EAAlB,CAAJ,CAA+B,CAC7B,GAAI7N,CAAA,CAASyG,CAAT,CAAJ,EAA8C,GAA9C,EAAyBA,CAAArB,OAAA,CAAe,CAAf,CAAzB,CACE,KAAM0I,GAAA,CAAa,OAAb,CAAN,CAEF,MAAO,KAAID,CAAJ,CAAWpH,CAAX,CAJsB,CAO/B,GAAIzG,CAAA,CAASyG,CAAT,CAAJ,CAAuB,CACrB,IAAIsH,EAAMvO,CAAAwO,cAAA,CAAuB,KAAvB,CAGVD,EAAAE,UAAA;AAAgB,mBAAhB,CAAsCxH,CACtCsH,EAAAG,YAAA,CAAgBH,CAAAI,WAAhB,CACAC,GAAA,CAAe,IAAf,CAAqBL,CAAAM,WAArB,CACe3H,EAAA4H,CAAO9O,CAAA+O,uBAAA,EAAPD,CACfvH,OAAA,CAAgB,IAAhB,CARqB,CAAvB,IAUEqH,GAAA,CAAe,IAAf,CAAqB3H,CAArB,CArBqB,CAyBzB+H,QAASA,GAAW,CAAC/H,CAAD,CAAU,CAC5B,MAAOA,EAAAgI,UAAA,CAAkB,CAAA,CAAlB,CADqB,CAI9BC,QAASA,GAAY,CAACjI,CAAD,CAAS,CAC5BkI,EAAA,CAAiBlI,CAAjB,CAD4B,KAElB3F,EAAI,CAAd,KAAiBwM,CAAjB,CAA4B7G,CAAA4H,WAA5B,EAAkD,EAAlD,CAAsDvN,CAAtD,CAA0DwM,CAAAxN,OAA1D,CAA2EgB,CAAA,EAA3E,CACE4N,EAAA,CAAapB,CAAA,CAASxM,CAAT,CAAb,CAH0B,CAO9B8N,QAASA,GAAS,CAACnI,CAAD,CAAUoI,CAAV,CAAgBtJ,CAAhB,CAAoBuJ,CAApB,CAAiC,CACjD,GAAIlM,CAAA,CAAUkM,CAAV,CAAJ,CAA4B,KAAMhB,GAAA,CAAa,SAAb,CAAN,CADqB,IAG7CiB,EAASC,EAAA,CAAmBvI,CAAnB,CAA4B,QAA5B,CACAuI,GAAAC,CAAmBxI,CAAnBwI,CAA4B,QAA5BA,CAEb,GAEItM,CAAA,CAAYkM,CAAZ,CAAJ,CACE3O,CAAA,CAAQ6O,CAAR,CAAgB,QAAQ,CAACG,CAAD,CAAeL,CAAf,CAAqB,CAC3CM,EAAA,CAAsB1I,CAAtB,CAA+BoI,CAA/B,CAAqCK,CAArC,CACA,QAAOH,CAAA,CAAOF,CAAP,CAFoC,CAA7C,CADF,CAME3O,CAAA,CAAQ2O,CAAArH,MAAA,CAAW,GAAX,CAAR,CAAyB,QAAQ,CAACqH,CAAD,CAAO,CAClClM,CAAA,CAAY4C,CAAZ,CAAJ,EACE4J,EAAA,CAAsB1I,CAAtB,CAA+BoI,CAA/B,CAAqCE,CAAA,CAAOF,CAAP,CAArC,CACA,CAAA,OAAOE,CAAA,CAAOF,CAAP,CAFT,EAIE7K,EAAA,CAAY+K,CAAA,CAAOF,CAAP,CAAZ,EAA4B,EAA5B,CAAgCtJ,CAAhC,CALoC,CAAxC,CARF,CANiD,CAyBnDoJ,QAASA,GAAgB,CAAClI,CAAD,CAAU8B,CAAV,CAAgB,CAAA,IACnC6G,EAAY3I,CAAA,CAAQ4I,EAAR,CADuB,CAEnCC,EAAeC,EAAA,CAAQH,CAAR,CAEfE,EAAJ,GACM/G,CAAJ,CACE,OAAOgH,EAAA,CAAQH,CAAR,CAAA3F,KAAA,CAAwBlB,CAAxB,CADT;CAKI+G,CAAAL,OAKJ,GAJEK,CAAAP,OAAAS,SACA,EADgCF,CAAAL,OAAA,CAAoB,EAApB,CAAwB,UAAxB,CAChC,CAAAL,EAAA,CAAUnI,CAAV,CAGF,EADA,OAAO8I,EAAA,CAAQH,CAAR,CACP,CAAA3I,CAAA,CAAQ4I,EAAR,CAAA,CAAkB5P,CAVlB,CADF,CAJuC,CAmBzCuP,QAASA,GAAkB,CAACvI,CAAD,CAAUpG,CAAV,CAAeY,CAAf,CAAsB,CAAA,IAC3CmO,EAAY3I,CAAA,CAAQ4I,EAAR,CAD+B,CAE3CC,EAAeC,EAAA,CAAQH,CAAR,EAAsB,EAAtB,CAEnB,IAAIxM,CAAA,CAAU3B,CAAV,CAAJ,CACOqO,CAIL,GAHE7I,CAAA,CAAQ4I,EAAR,CACA,CADkBD,CAClB,CAtJuB,EAAEK,EAsJzB,CAAAH,CAAA,CAAeC,EAAA,CAAQH,CAAR,CAAf,CAAoC,EAEtC,EAAAE,CAAA,CAAajP,CAAb,CAAA,CAAoBY,CALtB,KAOE,OAAOqO,EAAP,EAAuBA,CAAA,CAAajP,CAAb,CAXsB,CAejDqP,QAASA,GAAU,CAACjJ,CAAD,CAAUpG,CAAV,CAAeY,CAAf,CAAsB,CAAA,IACnCwI,EAAOuF,EAAA,CAAmBvI,CAAnB,CAA4B,MAA5B,CAD4B,CAEnCkJ,EAAW/M,CAAA,CAAU3B,CAAV,CAFwB,CAGnC2O,EAAa,CAACD,CAAdC,EAA0BhN,CAAA,CAAUvC,CAAV,CAHS,CAInCwP,EAAiBD,CAAjBC,EAA+B,CAAChN,CAAA,CAASxC,CAAT,CAE/BoJ,EAAL,EAAcoG,CAAd,EACEb,EAAA,CAAmBvI,CAAnB,CAA4B,MAA5B,CAAoCgD,CAApC,CAA2C,EAA3C,CAGF,IAAIkG,CAAJ,CACElG,CAAA,CAAKpJ,CAAL,CAAA,CAAYY,CADd,KAGE,IAAI2O,CAAJ,CAAgB,CACd,GAAIC,CAAJ,CAEE,MAAOpG,EAAP,EAAeA,CAAA,CAAKpJ,CAAL,CAEfyB,EAAA,CAAO2H,CAAP,CAAapJ,CAAb,CALY,CAAhB,IAQE,OAAOoJ,EArB4B,CA0BzCqG,QAASA,GAAc,CAACrJ,CAAD,CAAUsJ,CAAV,CAAoB,CACzC,MAAKtJ,EAAAuJ,aAAL,CAEuC,EAFvC,CACS9I,CAAA,GAAAA,EAAOT,CAAAuJ,aAAA,CAAqB,OAArB,CAAP9I,EAAwC,EAAxCA,EAA8C,GAA9CA,SAAA,CAA2D,SAA3D,CAAsE,GAAtE,CAAApD,QAAA,CACI,GADJ,CACUiM,CADV,CACqB,GADrB,CADT,CAAkC,CAAA,CADO,CAM3CE,QAASA,GAAiB,CAACxJ,CAAD,CAAUyJ,CAAV,CAAsB,CAC1CA,CAAJ,EAAkBzJ,CAAA0J,aAAlB;AACEjQ,CAAA,CAAQgQ,CAAA1I,MAAA,CAAiB,GAAjB,CAAR,CAA+B,QAAQ,CAAC4I,CAAD,CAAW,CAChD3J,CAAA0J,aAAA,CAAqB,OAArB,CAA8BE,EAAA,CACzBnJ,CAAA,GAAAA,EAAOT,CAAAuJ,aAAA,CAAqB,OAArB,CAAP9I,EAAwC,EAAxCA,EAA8C,GAA9CA,SAAA,CACQ,SADR,CACmB,GADnB,CAAAA,QAAA,CAEQ,GAFR,CAEcmJ,EAAA,CAAKD,CAAL,CAFd,CAE+B,GAF/B,CAEoC,GAFpC,CADyB,CAA9B,CADgD,CAAlD,CAF4C,CAYhDE,QAASA,GAAc,CAAC7J,CAAD,CAAUyJ,CAAV,CAAsB,CAC3C,GAAIA,CAAJ,EAAkBzJ,CAAA0J,aAAlB,CAAwC,CACtC,IAAII,EAAmBrJ,CAAA,GAAAA,EAAOT,CAAAuJ,aAAA,CAAqB,OAArB,CAAP9I,EAAwC,EAAxCA,EAA8C,GAA9CA,SAAA,CACU,SADV,CACqB,GADrB,CAGvBhH,EAAA,CAAQgQ,CAAA1I,MAAA,CAAiB,GAAjB,CAAR,CAA+B,QAAQ,CAAC4I,CAAD,CAAW,CAChDA,CAAA,CAAWC,EAAA,CAAKD,CAAL,CAC4C,GAAvD,GAAIG,CAAAzM,QAAA,CAAwB,GAAxB,CAA8BsM,CAA9B,CAAyC,GAAzC,CAAJ,GACEG,CADF,EACqBH,CADrB,CACgC,GADhC,CAFgD,CAAlD,CAOA3J,EAAA0J,aAAA,CAAqB,OAArB,CAA8BE,EAAA,CAAKE,CAAL,CAA9B,CAXsC,CADG,CAgB7CnC,QAASA,GAAc,CAACoC,CAAD,CAAOtI,CAAP,CAAiB,CACtC,GAAIA,CAAJ,CAAc,CACZA,CAAA,CAAaA,CAAA1E,SACF,EADuB,CAAAZ,CAAA,CAAUsF,CAAApI,OAAV,CACvB,EADsDD,EAAA,CAASqI,CAAT,CACtD,CACP,CAAEA,CAAF,CADO,CAAPA,CAEJ,KAAI,IAAIpH,EAAE,CAAV,CAAaA,CAAb,CAAiBoH,CAAApI,OAAjB,CAAkCgB,CAAA,EAAlC,CACE0P,CAAA7P,KAAA,CAAUuH,CAAA,CAASpH,CAAT,CAAV,CALU,CADwB,CAWxC2P,QAASA,GAAgB,CAAChK,CAAD,CAAU8B,CAAV,CAAgB,CACvC,MAAOmI,GAAA,CAAoBjK,CAApB,CAA6B,GAA7B,EAAoC8B,CAApC;AAA4C,cAA5C,EAA+D,YAA/D,CADgC,CAIzCmI,QAASA,GAAmB,CAACjK,CAAD,CAAU8B,CAAV,CAAgBtH,CAAhB,CAAuB,CACjDwF,CAAA,CAAUC,CAAA,CAAOD,CAAP,CAQV,KAJ0B,CAI1B,EAJGA,CAAA,CAAQ,CAAR,CAAA1G,SAIH,GAHE0G,CAGF,CAHYA,CAAA/C,KAAA,CAAa,MAAb,CAGZ,EAAO+C,CAAA3G,OAAP,CAAA,CAAuB,CACrB,IAAKmB,CAAL,CAAawF,CAAAgD,KAAA,CAAalB,CAAb,CAAb,IAAqC9I,CAArC,CAAgD,MAAOwB,EACvDwF,EAAA,CAAUA,CAAApE,OAAA,EAFW,CAT0B,CAmEnDsO,QAASA,GAAkB,CAAClK,CAAD,CAAU8B,CAAV,CAAgB,CAEzC,IAAIqI,EAAcC,EAAA,CAAatI,CAAA+B,YAAA,EAAb,CAGlB,OAAOsG,EAAP,EAAsBE,EAAA,CAAiBrK,CAAAjD,SAAjB,CAAtB,EAA4DoN,CALnB,CAsL3CG,QAASA,GAAkB,CAACtK,CAAD,CAAUsI,CAAV,CAAkB,CAC3C,IAAIG,EAAeA,QAAS,CAAC8B,CAAD,CAAQnC,CAAR,CAAc,CACnCmC,CAAAC,eAAL,GACED,CAAAC,eADF,CACyBC,QAAQ,EAAG,CAChCF,CAAAG,YAAA,CAAoB,CAAA,CADY,CADpC,CAMKH,EAAAI,gBAAL,GACEJ,CAAAI,gBADF,CAC0BC,QAAQ,EAAG,CACjCL,CAAAM,aAAA,CAAqB,CAAA,CADY,CADrC,CAMKN,EAAAO,OAAL,GACEP,CAAAO,OADF,CACiBP,CAAAQ,WADjB,EACqChS,CADrC,CAIA,IAAImD,CAAA,CAAYqO,CAAAS,iBAAZ,CAAJ,CAAyC,CACvC,IAAIC,EAAUV,CAAAC,eACdD,EAAAC,eAAA,CAAuBC,QAAQ,EAAG,CAChCF,CAAAS,iBAAA;AAAyB,CAAA,CACzBC,EAAAlR,KAAA,CAAawQ,CAAb,CAFgC,CAIlCA,EAAAS,iBAAA,CAAyB,CAAA,CANc,CASzCT,CAAAW,mBAAA,CAA2BC,QAAQ,EAAG,CACpC,MAAOZ,EAAAS,iBAAP,EAAsD,CAAA,CAAtD,EAAiCT,CAAAG,YADG,CAItCjR,EAAA,CAAQ6O,CAAA,CAAOF,CAAP,EAAemC,CAAAnC,KAAf,CAAR,CAAoC,QAAQ,CAACtJ,CAAD,CAAK,CAC/CA,CAAA/E,KAAA,CAAQiG,CAAR,CAAiBuK,CAAjB,CAD+C,CAAjD,CAMY,EAAZ,EAAIa,CAAJ,EAEEb,CAAAC,eAEA,CAFuB,IAEvB,CADAD,CAAAI,gBACA,CADwB,IACxB,CAAAJ,CAAAW,mBAAA,CAA2B,IAJ7B,GAOE,OAAOX,CAAAC,eAEP,CADA,OAAOD,CAAAI,gBACP,CAAA,OAAOJ,CAAAW,mBATT,CApCwC,CAgD1CzC,EAAA4C,KAAA,CAAoBrL,CACpB,OAAOyI,EAlDoC,CAqR7C6C,QAASA,GAAO,CAACnS,CAAD,CAAM,CAAA,IAChBoS,EAAU,MAAOpS,EADD,CAEhBS,CAEW,SAAf,EAAI2R,CAAJ,EAAmC,IAAnC,GAA2BpS,CAA3B,CACsC,UAApC,EAAI,OAAQS,CAAR,CAAcT,CAAAiC,UAAd,CAAJ,CAEExB,CAFF,CAEQT,CAAAiC,UAAA,EAFR,CAGWxB,CAHX,GAGmBZ,CAHnB,GAIEY,CAJF,CAIQT,CAAAiC,UAJR,CAIwBX,EAAA,EAJxB,CADF,CAQEb,CARF,CAQQT,CAGR,OAAOoS,EAAP,CAAiB,GAAjB,CAAuB3R,CAfH,CAqBtB4R,QAASA,GAAO,CAAClO,CAAD,CAAO,CACrB7D,CAAA,CAAQ6D,CAAR;AAAe,IAAAmO,IAAf,CAAyB,IAAzB,CADqB,CA2EvBC,QAASA,GAAQ,CAAC5M,CAAD,CAAK,CAAA,IAChB6M,CADgB,CAEhBC,CAIa,WAAjB,EAAI,MAAO9M,EAAX,EACQ6M,CADR,CACkB7M,CAAA6M,QADlB,IAEIA,CAUA,CAVU,EAUV,CATI7M,CAAAzF,OASJ,GAREuS,CAEA,CAFS9M,CAAAvC,SAAA,EAAAkE,QAAA,CAAsBoL,EAAtB,CAAsC,EAAtC,CAET,CADAC,CACA,CADUF,CAAApL,MAAA,CAAauL,EAAb,CACV,CAAAtS,CAAA,CAAQqS,CAAA,CAAQ,CAAR,CAAA/K,MAAA,CAAiBiL,EAAjB,CAAR,CAAwC,QAAQ,CAACjI,CAAD,CAAK,CACnDA,CAAAtD,QAAA,CAAYwL,EAAZ,CAAoB,QAAQ,CAACC,CAAD,CAAMC,CAAN,CAAkBrK,CAAlB,CAAuB,CACjD6J,CAAAzR,KAAA,CAAa4H,CAAb,CADiD,CAAnD,CADmD,CAArD,CAMF,EAAAhD,CAAA6M,QAAA,CAAaA,CAZjB,EAcWnS,CAAA,CAAQsF,CAAR,CAAJ,EACLsN,CAEA,CAFOtN,CAAAzF,OAEP,CAFmB,CAEnB,CADA4K,EAAA,CAAYnF,CAAA,CAAGsN,CAAH,CAAZ,CAAsB,IAAtB,CACA,CAAAT,CAAA,CAAU7M,CAAAE,MAAA,CAAS,CAAT,CAAYoN,CAAZ,CAHL,EAKLnI,EAAA,CAAYnF,CAAZ,CAAgB,IAAhB,CAAsB,CAAA,CAAtB,CAEF,OAAO6M,EA3Ba,CAsgBtBjJ,QAASA,GAAc,CAAC2J,CAAD,CAAgB,CAmCrCC,QAASA,EAAa,CAACC,CAAD,CAAW,CAC/B,MAAO,SAAQ,CAAC3S,CAAD,CAAMY,CAAN,CAAa,CAC1B,GAAI4B,CAAA,CAASxC,CAAT,CAAJ,CACEH,CAAA,CAAQG,CAAR,CAAaU,EAAA,CAAciS,CAAd,CAAb,CADF,KAGE,OAAOA,EAAA,CAAS3S,CAAT,CAAcY,CAAd,CAJiB,CADG,CAUjC0K,QAASA,EAAQ,CAACpD,CAAD,CAAO0K,CAAP,CAAkB,CACjCpI,EAAA,CAAwBtC,CAAxB,CAA8B,SAA9B,CACA,IAAIjI,CAAA,CAAW2S,CAAX,CAAJ,EAA6BhT,CAAA,CAAQgT,CAAR,CAA7B,CACEA,CAAA,CAAYC,CAAAC,YAAA,CAA6BF,CAA7B,CAEd,IAAI,CAACA,CAAAG,KAAL,CACE,KAAM9H,GAAA,CAAgB,MAAhB,CAA2E/C,CAA3E,CAAN,CAEF,MAAO8K,EAAA,CAAc9K,CAAd,CAAqB+K,CAArB,CAAP,CAA8CL,CARb,CAWnC5H,QAASA,EAAO,CAAC9C,CAAD;AAAOgL,CAAP,CAAkB,CAAE,MAAO5H,EAAA,CAASpD,CAAT,CAAe,MAAQgL,CAAR,CAAf,CAAT,CA6BlCC,QAASA,EAAW,CAACV,CAAD,CAAe,CACjC,IAAI9G,EAAY,EAChB9L,EAAA,CAAQ4S,CAAR,CAAuB,QAAQ,CAAC1K,CAAD,CAAS,CACtC,GAAI,CAAAqL,CAAAC,IAAA,CAAkBtL,CAAlB,CAAJ,CAAA,CACAqL,CAAAvB,IAAA,CAAkB9J,CAAlB,CAA0B,CAAA,CAA1B,CAEA,IAAI,CACF,GAAIpI,CAAA,CAASoI,CAAT,CAAJ,CAAsB,CACpB,IAAIuL,EAAWC,EAAA,CAAcxL,CAAd,CACf4D,EAAA,CAAYA,CAAArG,OAAA,CAAiB6N,CAAA,CAAYG,CAAAnI,SAAZ,CAAjB,CAAA7F,OAAA,CAAwDgO,CAAAE,WAAxD,CAEZ,KAJoB,IAIZ/H,EAAc6H,CAAAG,aAJF,CAIyBhT,EAAI,CAJ7B,CAIgCiT,EAAKjI,CAAAhM,OAAzD,CAA6EgB,CAA7E,CAAiFiT,CAAjF,CAAqFjT,CAAA,EAArF,CAA0F,CAAA,IACpFkT,EAAalI,CAAA,CAAYhL,CAAZ,CADuE,CAEpF6K,EAAWuH,CAAAQ,IAAA,CAAqBM,CAAA,CAAW,CAAX,CAArB,CAEfrI,EAAA,CAASqI,CAAA,CAAW,CAAX,CAAT,CAAA/Q,MAAA,CAA8B0I,CAA9B,CAAwCqI,CAAA,CAAW,CAAX,CAAxC,CAJwF,CAJtE,CAAtB,IAUW1T,EAAA,CAAW8H,CAAX,CAAJ,CACH4D,CAAArL,KAAA,CAAeuS,CAAA9J,OAAA,CAAwBhB,CAAxB,CAAf,CADG,CAEInI,CAAA,CAAQmI,CAAR,CAAJ,CACH4D,CAAArL,KAAA,CAAeuS,CAAA9J,OAAA,CAAwBhB,CAAxB,CAAf,CADG,CAGLsC,EAAA,CAAYtC,CAAZ,CAAoB,QAApB,CAhBA,CAkBF,MAAOvB,CAAP,CAAU,CAUV,KATI5G,EAAA,CAAQmI,CAAR,CASE,GARJA,CAQI,CARKA,CAAA,CAAOA,CAAAtI,OAAP,CAAuB,CAAvB,CAQL,EANF+G,CAAAoN,QAME,GANWpN,CAAAqN,MAMX,EANqD,EAMrD,EANsBrN,CAAAqN,MAAApQ,QAAA,CAAgB+C,CAAAoN,QAAhB,CAMtB,IAFJpN,CAEI,CAFAA,CAAAoN,QAEA,CAFY,IAEZ,CAFmBpN,CAAAqN,MAEnB,EAAA5I,EAAA,CAAgB,UAAhB,CAA6ElD,CAA7E,CAAqFvB,CAAAqN,MAArF,EAAgGrN,CAAAoN,QAAhG,EAA6GpN,CAA7G,CAAN,CAVU,CArBZ,CADsC,CAAxC,CAmCA,OAAOmF,EArC0B,CArFE;AAiIrCmI,QAASA,EAAsB,CAACC,CAAD,CAAQ/I,CAAR,CAAiB,CAE9CgJ,QAASA,EAAU,CAACC,CAAD,CAAc,CAC/B,GAAIF,CAAA7T,eAAA,CAAqB+T,CAArB,CAAJ,CAAuC,CACrC,GAAIF,CAAA,CAAME,CAAN,CAAJ,GAA2BC,CAA3B,CACE,KAAMjJ,GAAA,CAAgB,MAAhB,CAA0DP,CAAAxJ,KAAA,CAAU,MAAV,CAA1D,CAAN,CAEF,MAAO6S,EAAA,CAAME,CAAN,CAJ8B,CAMrC,GAAI,CAGF,MAFAvJ,EAAArJ,QAAA,CAAa4S,CAAb,CAEO,CADPF,CAAA,CAAME,CAAN,CACO,CADcC,CACd,CAAAH,CAAA,CAAME,CAAN,CAAA,CAAqBjJ,CAAA,CAAQiJ,CAAR,CAH1B,CAAJ,OAIU,CACRvJ,CAAAwC,MAAA,EADQ,CAXmB,CAiBjCnE,QAASA,EAAM,CAAC7D,CAAD,CAAKD,CAAL,CAAWkP,CAAX,CAAkB,CAAA,IAC3BC,EAAO,EADoB,CAE3BrC,EAAUD,EAAA,CAAS5M,CAAT,CAFiB,CAG3BzF,CAH2B,CAGnBgB,CAHmB,CAI3BT,CAEAS,EAAA,CAAI,CAAR,KAAWhB,CAAX,CAAoBsS,CAAAtS,OAApB,CAAoCgB,CAApC,CAAwChB,CAAxC,CAAgDgB,CAAA,EAAhD,CAAqD,CACnDT,CAAA,CAAM+R,CAAA,CAAQtR,CAAR,CACN,IAAmB,QAAnB,GAAI,MAAOT,EAAX,CACE,KAAMiL,GAAA,CAAgB,MAAhB,CAA+FjL,CAA/F,CAAN,CAEFoU,CAAA9T,KAAA,CACE6T,CACA,EADUA,CAAAjU,eAAA,CAAsBF,CAAtB,CACV,CAAEmU,CAAA,CAAOnU,CAAP,CAAF,CACEgU,CAAA,CAAWhU,CAAX,CAHJ,CALmD,CAWhDkF,CAAA6M,QAAL,GAEE7M,CAFF,CAEOA,CAAA,CAAGzF,CAAH,CAFP,CAOA,QAAQwF,CAAA,CAAQ,EAAR,CAAYmP,CAAA3U,OAApB,EACE,KAAM,CAAN,CAAS,MAAOyF,EAAA,EAChB,MAAM,CAAN,CAAS,MAAOA,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAChB,MAAM,CAAN,CAAS,MAAOlP,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAAYA,CAAA,CAAK,CAAL,CAAZ,CAChB,MAAM,CAAN,CAAS,MAAOlP,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAAYA,CAAA,CAAK,CAAL,CAAZ,CAAqBA,CAAA,CAAK,CAAL,CAArB,CAChB,MAAM,CAAN,CAAS,MAAOlP,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAAYA,CAAA,CAAK,CAAL,CAAZ,CAAqBA,CAAA,CAAK,CAAL,CAArB;AAA8BA,CAAA,CAAK,CAAL,CAA9B,CAChB,MAAM,CAAN,CAAS,MAAOlP,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAAYA,CAAA,CAAK,CAAL,CAAZ,CAAqBA,CAAA,CAAK,CAAL,CAArB,CAA8BA,CAAA,CAAK,CAAL,CAA9B,CAAuCA,CAAA,CAAK,CAAL,CAAvC,CAChB,MAAM,CAAN,CAAS,MAAOlP,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAAYA,CAAA,CAAK,CAAL,CAAZ,CAAqBA,CAAA,CAAK,CAAL,CAArB,CAA8BA,CAAA,CAAK,CAAL,CAA9B,CAAuCA,CAAA,CAAK,CAAL,CAAvC,CAAgDA,CAAA,CAAK,CAAL,CAAhD,CAChB,MAAM,CAAN,CAAS,MAAOlP,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAAYA,CAAA,CAAK,CAAL,CAAZ,CAAqBA,CAAA,CAAK,CAAL,CAArB,CAA8BA,CAAA,CAAK,CAAL,CAA9B,CAAuCA,CAAA,CAAK,CAAL,CAAvC,CAAgDA,CAAA,CAAK,CAAL,CAAhD,CAAyDA,CAAA,CAAK,CAAL,CAAzD,CAChB,MAAM,CAAN,CAAS,MAAOlP,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAAYA,CAAA,CAAK,CAAL,CAAZ,CAAqBA,CAAA,CAAK,CAAL,CAArB,CAA8BA,CAAA,CAAK,CAAL,CAA9B,CAAuCA,CAAA,CAAK,CAAL,CAAvC,CAAgDA,CAAA,CAAK,CAAL,CAAhD,CAAyDA,CAAA,CAAK,CAAL,CAAzD,CAAkEA,CAAA,CAAK,CAAL,CAAlE,CAChB,MAAM,CAAN,CAAS,MAAOlP,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAAYA,CAAA,CAAK,CAAL,CAAZ,CAAqBA,CAAA,CAAK,CAAL,CAArB,CAA8BA,CAAA,CAAK,CAAL,CAA9B,CAAuCA,CAAA,CAAK,CAAL,CAAvC,CAAgDA,CAAA,CAAK,CAAL,CAAhD,CAAyDA,CAAA,CAAK,CAAL,CAAzD,CAAkEA,CAAA,CAAK,CAAL,CAAlE,CAA2EA,CAAA,CAAK,CAAL,CAA3E,CAChB,MAAK,EAAL,CAAS,MAAOlP,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAAYA,CAAA,CAAK,CAAL,CAAZ,CAAqBA,CAAA,CAAK,CAAL,CAArB,CAA8BA,CAAA,CAAK,CAAL,CAA9B,CAAuCA,CAAA,CAAK,CAAL,CAAvC,CAAgDA,CAAA,CAAK,CAAL,CAAhD,CAAyDA,CAAA,CAAK,CAAL,CAAzD,CAAkEA,CAAA,CAAK,CAAL,CAAlE,CAA2EA,CAAA,CAAK,CAAL,CAA3E,CAAoFA,CAAA,CAAK,CAAL,CAApF,CAChB,SAAS,MAAOlP,EAAAtC,MAAA,CAASqC,CAAT,CAAemP,CAAf,CAZlB,CAxB+B,CAqDjC,MAAO,QACGrL,CADH,aAbP+J,QAAoB,CAACuB,CAAD,CAAOF,CAAP,CAAe,CAAA,IAC7BG,EAAcA,QAAQ,EAAG,EADI,CAEnBC,CAIdD,EAAAE,UAAA,CAAyBA,CAAA5U,CAAA,CAAQyU,CAAR,CAAA,CAAgBA,CAAA,CAAKA,CAAA5U,OAAL,CAAmB,CAAnB,CAAhB,CAAwC4U,CAAxCG,WACzBC,EAAA,CAAW,IAAIH,CACfC,EAAA,CAAgBxL,CAAA,CAAOsL,CAAP,CAAaI,CAAb,CAAuBN,CAAvB,CAEhB,OAAO3R,EAAA,CAAS+R,CAAT,CAAA;AAA0BA,CAA1B,CAA0CE,CAVhB,CAa5B,KAGAT,CAHA,UAIKlC,EAJL,KAKA4C,QAAQ,CAACxM,CAAD,CAAO,CAClB,MAAO8K,EAAA9S,eAAA,CAA6BgI,CAA7B,CAAoC+K,CAApC,CAAP,EAA8Dc,CAAA7T,eAAA,CAAqBgI,CAArB,CAD5C,CALf,CAxEuC,CAjIX,IACjCgM,EAAgB,EADiB,CAEjCjB,EAAiB,UAFgB,CAGjCvI,EAAO,EAH0B,CAIjC0I,EAAgB,IAAIxB,EAJa,CAKjCoB,EAAgB,UACJ,UACIN,CAAA,CAAcpH,CAAd,CADJ,SAEGoH,CAAA,CAAc1H,CAAd,CAFH,SAGG0H,CAAA,CAiDnBiC,QAAgB,CAACzM,CAAD,CAAOqC,CAAP,CAAoB,CAClC,MAAOS,EAAA,CAAQ9C,CAAR,CAAc,CAAC,WAAD,CAAc,QAAQ,CAAC0M,CAAD,CAAY,CACrD,MAAOA,EAAA9B,YAAA,CAAsBvI,CAAtB,CAD8C,CAAlC,CAAd,CAD2B,CAjDjB,CAHH,OAICmI,CAAA,CAsDjB9R,QAAc,CAACsH,CAAD,CAAOtH,CAAP,CAAc,CAAE,MAAOoK,EAAA,CAAQ9C,CAAR,CAAc7F,EAAA,CAAQzB,CAAR,CAAd,CAAT,CAtDX,CAJD,UAKI8R,CAAA,CAuDpBmC,QAAiB,CAAC3M,CAAD,CAAOtH,CAAP,CAAc,CAC7B4J,EAAA,CAAwBtC,CAAxB,CAA8B,UAA9B,CACA8K,EAAA,CAAc9K,CAAd,CAAA,CAAsBtH,CACtBkU,EAAA,CAAc5M,CAAd,CAAA,CAAsBtH,CAHO,CAvDX,CALJ,WAkEhBmU,QAAkB,CAACd,CAAD,CAAce,CAAd,CAAuB,CAAA,IACnCC,EAAepC,CAAAQ,IAAA,CAAqBY,CAArB,CAAmChB,CAAnC,CADoB,CAEnCiC,EAAWD,CAAAlC,KAEfkC,EAAAlC,KAAA,CAAoBoC,QAAQ,EAAG,CAC7B,IAAIC,EAAeC,CAAAtM,OAAA,CAAwBmM,CAAxB,CAAkCD,CAAlC,CACnB,OAAOI,EAAAtM,OAAA,CAAwBiM,CAAxB,CAAiC,IAAjC,CAAuC,WAAYI,CAAZ,CAAvC,CAFsB,CAJQ,CAlEzB,CADI,CALiB,CAejCvC,EAAoBG,CAAA4B,UAApB/B,CACIiB,CAAA,CAAuBd,CAAvB;AAAsC,QAAQ,EAAG,CAC/C,KAAM/H,GAAA,CAAgB,MAAhB,CAAiDP,CAAAxJ,KAAA,CAAU,MAAV,CAAjD,CAAN,CAD+C,CAAjD,CAhB6B,CAmBjC4T,EAAgB,EAnBiB,CAoBjCO,EAAoBP,CAAAF,UAApBS,CACIvB,CAAA,CAAuBgB,CAAvB,CAAsC,QAAQ,CAACQ,CAAD,CAAc,CACtDhK,CAAAA,CAAWuH,CAAAQ,IAAA,CAAqBiC,CAArB,CAAmCrC,CAAnC,CACf,OAAOoC,EAAAtM,OAAA,CAAwBuC,CAAAyH,KAAxB,CAAuCzH,CAAvC,CAFmD,CAA5D,CAMRzL,EAAA,CAAQsT,CAAA,CAAYV,CAAZ,CAAR,CAAoC,QAAQ,CAACvN,CAAD,CAAK,CAAEmQ,CAAAtM,OAAA,CAAwB7D,CAAxB,EAA8BhD,CAA9B,CAAF,CAAjD,CAEA,OAAOmT,EA7B8B,CAsQvCE,QAASA,GAAqB,EAAG,CAE/B,IAAIC,EAAuB,CAAA,CAE3B,KAAAC,qBAAA,CAA4BC,QAAQ,EAAG,CACrCF,CAAA,CAAuB,CAAA,CADc,CAIvC,KAAAzC,KAAA,CAAY,CAAC,SAAD,CAAY,WAAZ,CAAyB,YAAzB,CAAuC,QAAQ,CAAC4C,CAAD,CAAUC,CAAV,CAAqBC,CAArB,CAAiC,CAO1FC,QAASA,EAAc,CAACtS,CAAD,CAAO,CAC5B,IAAIuS,EAAS,IACblW,EAAA,CAAQ2D,CAAR,CAAc,QAAQ,CAAC4C,CAAD,CAAU,CACzB2P,CAAL,EAA+C,GAA/C,GAAe7P,CAAA,CAAUE,CAAAjD,SAAV,CAAf,GAAoD4S,CAApD,CAA6D3P,CAA7D,CAD8B,CAAhC,CAGA,OAAO2P,EALqB,CAQ9BC,QAASA,EAAM,EAAG,CAAA,IACZC,EAAOL,CAAAK,KAAA,EADK,CACaC,CAGxBD,EAAL,CAGK,CAAKC,CAAL,CAAW/W,CAAAgJ,eAAA,CAAwB8N,CAAxB,CAAX,EAA2CC,CAAAC,eAAA,EAA3C,CAGA,CAAKD,CAAL,CAAWJ,CAAA,CAAe3W,CAAAiX,kBAAA,CAA2BH,CAA3B,CAAf,CAAX,EAA8DC,CAAAC,eAAA,EAA9D;AAGa,KAHb,GAGIF,CAHJ,EAGoBN,CAAAU,SAAA,CAAiB,CAAjB,CAAoB,CAApB,CATzB,CAAWV,CAAAU,SAAA,CAAiB,CAAjB,CAAoB,CAApB,CAJK,CAdlB,IAAIlX,EAAWwW,CAAAxW,SAgCXqW,EAAJ,EACEK,CAAA5R,OAAA,CAAkBqS,QAAwB,EAAG,CAAC,MAAOV,EAAAK,KAAA,EAAR,CAA7C,CACEM,QAA8B,EAAG,CAC/BV,CAAA7R,WAAA,CAAsBgS,CAAtB,CAD+B,CADnC,CAMF,OAAOA,EAxCmF,CAAhF,CARmB,CAwQjCQ,QAASA,GAAO,CAACtX,CAAD,CAASC,CAAT,CAAmBsX,CAAnB,CAAyBC,CAAzB,CAAmC,CAsBjDC,QAASA,EAA0B,CAACzR,CAAD,CAAK,CACtC,GAAI,CACFA,CAAAtC,MAAA,CAAS,IAAT,CA70FGwC,EAAAjF,KAAA,CA60FsBwB,SA70FtB,CA60FiC0D,CA70FjC,CA60FH,CADE,CAAJ,OAEU,CAER,GADAuR,CAAA,EACI,CAA4B,CAA5B,GAAAA,CAAJ,CACE,IAAA,CAAMC,CAAApX,OAAN,CAAA,CACE,GAAI,CACFoX,CAAAC,IAAA,EAAA,EADE,CAEF,MAAOtQ,CAAP,CAAU,CACViQ,CAAAM,MAAA,CAAWvQ,CAAX,CADU,CANR,CAH4B,CAoExCwQ,QAASA,EAAW,CAACC,CAAD,CAAWC,CAAX,CAAuB,CACxCC,SAASA,GAAK,EAAG,CAChBtX,CAAA,CAAQuX,CAAR,CAAiB,QAAQ,CAACC,CAAD,CAAQ,CAAEA,CAAA,EAAF,CAAjC,CACAC,EAAA,CAAcJ,CAAA,CAAWC,EAAX,CAAkBF,CAAlB,CAFE,CAAjBE,CAAA,EADwC,CAuE3CI,QAASA,EAAa,EAAG,CACvBC,CAAA,CAAc,IACVC,EAAJ,EAAsBxS,CAAAyS,IAAA,EAAtB,GAEAD,CACA,CADiBxS,CAAAyS,IAAA,EACjB,CAAA7X,CAAA,CAAQ8X,CAAR,CAA4B,QAAQ,CAACC,CAAD,CAAW,CAC7CA,CAAA,CAAS3S,CAAAyS,IAAA,EAAT,CAD6C,CAA/C,CAHA,CAFuB,CAjKwB,IAC7CzS,EAAO,IADsC,CAE7C4S,EAAc1Y,CAAA,CAAS,CAAT,CAF+B,CAG7C2D,EAAW5D,CAAA4D,SAHkC,CAI7CgV,EAAU5Y,CAAA4Y,QAJmC,CAK7CZ,EAAahY,CAAAgY,WALgC,CAM7Ca,EAAe7Y,CAAA6Y,aAN8B;AAO7CC,EAAkB,EAEtB/S,EAAAgT,OAAA,CAAc,CAAA,CAEd,KAAIrB,EAA0B,CAA9B,CACIC,EAA8B,EAGlC5R,EAAAiT,6BAAA,CAAoCvB,CACpC1R,EAAAkT,6BAAA,CAAoCC,QAAQ,EAAG,CAAExB,CAAA,EAAF,CA6B/C3R,EAAAoT,gCAAA,CAAuCC,QAAQ,CAACC,CAAD,CAAW,CAIxD1Y,CAAA,CAAQuX,CAAR,CAAiB,QAAQ,CAACC,CAAD,CAAQ,CAAEA,CAAA,EAAF,CAAjC,CAEgC,EAAhC,GAAIT,CAAJ,CACE2B,CAAA,EADF,CAGE1B,CAAAvW,KAAA,CAAiCiY,CAAjC,CATsD,CA7CT,KA6D7CnB,EAAU,EA7DmC,CA8D7CE,CAcJrS,EAAAuT,UAAA,CAAiBC,QAAQ,CAACvT,CAAD,CAAK,CACxB5C,CAAA,CAAYgV,CAAZ,CAAJ,EAA8BN,CAAA,CAAY,GAAZ,CAAiBE,CAAjB,CAC9BE,EAAA9W,KAAA,CAAa4E,CAAb,CACA,OAAOA,EAHqB,CA5EmB,KAqG7CuS,EAAiB3U,CAAA4V,KArG4B,CAsG7CC,EAAcxZ,CAAAkE,KAAA,CAAc,MAAd,CAtG+B,CAuG7CmU,EAAc,IAsBlBvS,EAAAyS,IAAA,CAAWkB,QAAQ,CAAClB,CAAD,CAAM7Q,CAAN,CAAe,CAE5B/D,CAAJ,GAAiB5D,CAAA4D,SAAjB,GAAkCA,CAAlC,CAA6C5D,CAAA4D,SAA7C,CAGA,IAAI4U,CAAJ,CACE,IAAID,CAAJ,EAAsBC,CAAtB,CAiBA,MAhBAD,EAgBOxS,CAhBUyS,CAgBVzS,CAfHyR,CAAAoB,QAAJ,CACMjR,CAAJ,CAAaiR,CAAAe,aAAA,CAAqB,IAArB,CAA2B,EAA3B,CAA+BnB,CAA/B,CAAb,EAEEI,CAAAgB,UAAA,CAAkB,IAAlB,CAAwB,EAAxB,CAA4BpB,CAA5B,CAEA,CAAAiB,CAAAnQ,KAAA,CAAiB,MAAjB,CAAyBmQ,CAAAnQ,KAAA,CAAiB,MAAjB,CAAzB,CAJF,CADF,EAQEgP,CACA,CADcE,CACd,CAAI7Q,CAAJ,CACE/D,CAAA+D,QAAA,CAAiB6Q,CAAjB,CADF,CAGE5U,CAAA4V,KAHF;AAGkBhB,CAZpB,CAeOzS,CAAAA,CAjBP,CADF,IAwBE,OAAOuS,EAAP,EAAsB1U,CAAA4V,KAAA7R,QAAA,CAAsB,MAAtB,CAA6B,GAA7B,CA7BQ,CA7He,KA8J7C8Q,EAAqB,EA9JwB,CA+J7CoB,GAAgB,CAAA,CAmCpB9T,EAAA+T,YAAA,CAAmBC,QAAQ,CAACV,CAAD,CAAW,CACpC,GAAI,CAACQ,EAAL,CAAoB,CAMlB,GAAIrC,CAAAoB,QAAJ,CAAsBzR,CAAA,CAAOnH,CAAP,CAAAkE,GAAA,CAAkB,UAAlB,CAA8BmU,CAA9B,CAEtB,IAAIb,CAAAwC,WAAJ,CAAyB7S,CAAA,CAAOnH,CAAP,CAAAkE,GAAA,CAAkB,YAAlB,CAAgCmU,CAAhC,CAAzB,KAEKtS,EAAAuT,UAAA,CAAejB,CAAf,CAELwB,GAAA,CAAgB,CAAA,CAZE,CAepBpB,CAAArX,KAAA,CAAwBiY,CAAxB,CACA,OAAOA,EAjB6B,CAkCtCtT,EAAAkU,SAAA,CAAgBC,QAAQ,EAAG,CACzB,IAAIV,EAAOC,CAAAnQ,KAAA,CAAiB,MAAjB,CACX,OAAOkQ,EAAA,CAAOA,CAAA7R,QAAA,CAAa,qBAAb,CAAoC,EAApC,CAAP,CAAiD,EAF/B,CAQ3B,KAAIwS,EAAc,EAAlB,CACIC,GAAmB,EADvB,CAEIC,GAAatU,CAAAkU,SAAA,EAsBjBlU,EAAAuU,QAAA,CAAeC,QAAQ,CAACvR,CAAD,CAAOtH,CAAP,CAAc,CAAA,IAC/B8Y,CAD+B,CACJC,CADI,CACIlZ,CADJ,CACOK,CAE1C,IAAIoH,CAAJ,CACMtH,CAAJ,GAAcxB,CAAd,CACEyY,CAAA8B,OADF,CACuBC,MAAA,CAAO1R,CAAP,CADvB,CACsC,SADtC,CACkDqR,EADlD,CAC+D,wCAD/D,CAGM5Z,CAAA,CAASiB,CAAT,CAHN,GAII8Y,CAMA,CANgBja,CAAAoY,CAAA8B,OAAAla,CAAqBma,MAAA,CAAO1R,CAAP,CAArBzI,CAAoC,GAApCA,CAA0Cma,MAAA,CAAOhZ,CAAP,CAA1CnB;AAA0D,QAA1DA,CAAqE8Z,EAArE9Z,QAMhB,CAN0G,CAM1G,CAAmB,IAAnB,CAAIia,CAAJ,EACEjD,CAAAoD,KAAA,CAAU,UAAV,CAAsB3R,CAAtB,CAA4B,6DAA5B,CACEwR,CADF,CACiB,iBADjB,CAXN,CADF,KAiBO,CACL,GAAI7B,CAAA8B,OAAJ,GAA2BL,EAA3B,CAKE,IAJAA,EAIK,CAJczB,CAAA8B,OAId,CAHLG,CAGK,CAHSR,EAAAnS,MAAA,CAAuB,IAAvB,CAGT,CAFLkS,CAEK,CAFS,EAET,CAAA5Y,CAAA,CAAI,CAAT,CAAYA,CAAZ,CAAgBqZ,CAAAra,OAAhB,CAAoCgB,CAAA,EAApC,CACEkZ,CAEA,CAFSG,CAAA,CAAYrZ,CAAZ,CAET,CADAK,CACA,CADQ6Y,CAAAlW,QAAA,CAAe,GAAf,CACR,CAAY,CAAZ,CAAI3C,CAAJ,GACMoH,CAIJ,CAJW6R,QAAA,CAASJ,CAAAK,UAAA,CAAiB,CAAjB,CAAoBlZ,CAApB,CAAT,CAIX,CAAIuY,CAAA,CAAYnR,CAAZ,CAAJ,GAA0B9I,CAA1B,GACEia,CAAA,CAAYnR,CAAZ,CADF,CACsB6R,QAAA,CAASJ,CAAAK,UAAA,CAAiBlZ,CAAjB,CAAyB,CAAzB,CAAT,CADtB,CALF,CAWJ,OAAOuY,EApBF,CApB4B,CA4DrCpU,EAAAgV,MAAA,CAAaC,QAAQ,CAAChV,CAAD,CAAKiV,CAAL,CAAY,CAC/B,IAAIC,CACJxD,EAAA,EACAwD,EAAA,CAAYlD,CAAA,CAAW,QAAQ,EAAG,CAChC,OAAOc,CAAA,CAAgBoC,CAAhB,CACPzD,EAAA,CAA2BzR,CAA3B,CAFgC,CAAtB,CAGTiV,CAHS,EAGA,CAHA,CAIZnC,EAAA,CAAgBoC,CAAhB,CAAA,CAA6B,CAAA,CAC7B,OAAOA,EARwB,CAsBjCnV,EAAAgV,MAAAI,OAAA,CAAoBC,QAAQ,CAACC,CAAD,CAAU,CACpC,MAAIvC,EAAA,CAAgBuC,CAAhB,CAAJ,EACE,OAAOvC,CAAA,CAAgBuC,CAAhB,CAGA,CAFPxC,CAAA,CAAawC,CAAb,CAEO,CADP5D,CAAA,CAA2BzU,CAA3B,CACO,CAAA,CAAA,CAJT,EAMO,CAAA,CAP6B,CAtVW,CAkWnDsY,QAASA,GAAgB,EAAE,CACzB,IAAAzH,KAAA;AAAY,CAAC,SAAD,CAAY,MAAZ,CAAoB,UAApB,CAAgC,WAAhC,CACR,QAAQ,CAAE4C,CAAF,CAAac,CAAb,CAAqBC,CAArB,CAAiC+D,CAAjC,CAA2C,CACjD,MAAO,KAAIjE,EAAJ,CAAYb,CAAZ,CAAqB8E,CAArB,CAAgChE,CAAhC,CAAsCC,CAAtC,CAD0C,CAD3C,CADa,CA2C3BgE,QAASA,GAAqB,EAAG,CAE/B,IAAA3H,KAAA,CAAY4H,QAAQ,EAAG,CAGrBC,QAASA,EAAY,CAACC,CAAD,CAAUC,CAAV,CAAmB,CAmFtCC,QAASA,EAAO,CAACC,CAAD,CAAQ,CAClBA,CAAJ,EAAaC,CAAb,GACOC,CAAL,CAEWA,CAFX,EAEuBF,CAFvB,GAGEE,CAHF,CAGaF,CAAAG,EAHb,EACED,CADF,CACaF,CAQb,CAHAI,CAAA,CAAKJ,CAAAG,EAAL,CAAcH,CAAAK,EAAd,CAGA,CAFAD,CAAA,CAAKJ,CAAL,CAAYC,CAAZ,CAEA,CADAA,CACA,CADWD,CACX,CAAAC,CAAAE,EAAA,CAAa,IAVf,CADsB,CAmBxBC,QAASA,EAAI,CAACE,CAAD,CAAYC,CAAZ,CAAuB,CAC9BD,CAAJ,EAAiBC,CAAjB,GACMD,CACJ,GADeA,CAAAD,EACf,CAD6BE,CAC7B,EAAIA,CAAJ,GAAeA,CAAAJ,EAAf,CAA6BG,CAA7B,CAFF,CADkC,CArGpC,GAAIT,CAAJ,GAAeW,EAAf,CACE,KAAMnc,EAAA,CAAO,eAAP,CAAA,CAAwB,KAAxB,CAAkEwb,CAAlE,CAAN,CAFoC,IAKlCY,EAAO,CAL2B,CAMlCC,EAAQja,CAAA,CAAO,EAAP,CAAWqZ,CAAX,CAAoB,IAAKD,CAAL,CAApB,CAN0B,CAOlCzR,EAAO,EAP2B,CAQlCuS,EAAYb,CAAZa,EAAuBb,CAAAa,SAAvBA,EAA4CC,MAAAC,UARV,CASlCC,EAAU,EATwB,CAUlCb,EAAW,IAVuB,CAWlCC,EAAW,IAEf,OAAOM,EAAA,CAAOX,CAAP,CAAP,CAAyB,KAElBhJ,QAAQ,CAAC7R,CAAD,CAAMY,CAAN,CAAa,CACxB,IAAImb,EAAWD,CAAA,CAAQ9b,CAAR,CAAX+b,GAA4BD,CAAA,CAAQ9b,CAAR,CAA5B+b,CAA2C,KAAM/b,CAAN,CAA3C+b,CAEJhB,EAAA,CAAQgB,CAAR,CAEA,IAAI,CAAAzZ,CAAA,CAAY1B,CAAZ,CAAJ,CAQA,MAPMZ,EAOCY,GAPMwI,EAONxI,EAPa6a,CAAA,EAOb7a,CANPwI,CAAA,CAAKpJ,CAAL,CAMOY,CANKA,CAMLA,CAJH6a,CAIG7a,CAJI+a,CAIJ/a,EAHL,IAAAob,OAAA,CAAYd,CAAAlb,IAAZ,CAGKY;AAAAA,CAbiB,CAFH,KAmBlByS,QAAQ,CAACrT,CAAD,CAAM,CACjB,IAAI+b,EAAWD,CAAA,CAAQ9b,CAAR,CAEf,IAAK+b,CAAL,CAIA,MAFAhB,EAAA,CAAQgB,CAAR,CAEO,CAAA3S,CAAA,CAAKpJ,CAAL,CAPU,CAnBI,QA8Bfgc,QAAQ,CAAChc,CAAD,CAAM,CACpB,IAAI+b,EAAWD,CAAA,CAAQ9b,CAAR,CAEV+b,EAAL,GAEIA,CAMJ,EANgBd,CAMhB,GAN0BA,CAM1B,CANqCc,CAAAV,EAMrC,EALIU,CAKJ,EALgBb,CAKhB,GAL0BA,CAK1B,CALqCa,CAAAZ,EAKrC,EAJAC,CAAA,CAAKW,CAAAZ,EAAL,CAAgBY,CAAAV,EAAhB,CAIA,CAFA,OAAOS,CAAA,CAAQ9b,CAAR,CAEP,CADA,OAAOoJ,CAAA,CAAKpJ,CAAL,CACP,CAAAyb,CAAA,EARA,CAHoB,CA9BC,WA6CZQ,QAAQ,EAAG,CACpB7S,CAAA,CAAO,EACPqS,EAAA,CAAO,CACPK,EAAA,CAAU,EACVb,EAAA,CAAWC,CAAX,CAAsB,IAJF,CA7CC,SAqDdgB,QAAQ,EAAG,CAGlBJ,CAAA,CADAJ,CACA,CAFAtS,CAEA,CAFO,IAGP,QAAOoS,CAAA,CAAOX,CAAP,CAJW,CArDG,MA6DjBsB,QAAQ,EAAG,CACf,MAAO1a,EAAA,CAAO,EAAP,CAAWia,CAAX,CAAkB,MAAOD,CAAP,CAAlB,CADQ,CA7DM,CAba,CAFxC,IAAID,EAAS,EA2HbZ,EAAAuB,KAAA,CAAoBC,QAAQ,EAAG,CAC7B,IAAID,EAAO,EACXtc,EAAA,CAAQ2b,CAAR,CAAgB,QAAQ,CAACzH,CAAD,CAAQ8G,CAAR,CAAiB,CACvCsB,CAAA,CAAKtB,CAAL,CAAA,CAAgB9G,CAAAoI,KAAA,EADuB,CAAzC,CAGA,OAAOA,EALsB,CAoB/BvB,EAAAvH,IAAA,CAAmBgJ,QAAQ,CAACxB,CAAD,CAAU,CACnC,MAAOW,EAAA,CAAOX,CAAP,CAD4B,CAKrC,OAAOD,EArJc,CAFQ,CAyMjC0B,QAASA,GAAsB,EAAG,CAChC,IAAAvJ,KAAA,CAAY,CAAC,eAAD,CAAkB,QAAQ,CAACwJ,CAAD,CAAgB,CACpD,MAAOA,EAAA,CAAc,WAAd,CAD6C,CAA1C,CADoB,CA0JlCC,QAASA,GAAgB,CAAC3T,CAAD,CAAW,CAAA,IAC9B4T;AAAgB,EADc,CAE9BC,EAAS,WAFqB,CAG9BC,EAA2B,wCAHG,CAI9BC,EAAyB,gCAJK,CAK9BC,EAA6B,mCALC,CAM9BC,EAA8B,qCANA,CAW9BC,EAA4B,yBAkB/B,KAAAC,UAAA,CAAiBC,QAASC,EAAiB,CAAChV,CAAD,CAAOiV,CAAP,CAAyB,CACnE3S,EAAA,CAAwBtC,CAAxB,CAA8B,WAA9B,CACIvI,EAAA,CAASuI,CAAT,CAAJ,EACEgC,EAAA,CAAUiT,CAAV,CAA4B,kBAA5B,CA2BA,CA1BKV,CAAAvc,eAAA,CAA6BgI,CAA7B,CA0BL,GAzBEuU,CAAA,CAAcvU,CAAd,CACA,CADsB,EACtB,CAAAW,CAAAmC,QAAA,CAAiB9C,CAAjB,CAAwBwU,CAAxB,CAAgC,CAAC,WAAD,CAAc,mBAAd,CAC9B,QAAQ,CAAC9H,CAAD,CAAYwI,CAAZ,CAA+B,CACrC,IAAIC,EAAa,EACjBxd,EAAA,CAAQ4c,CAAA,CAAcvU,CAAd,CAAR,CAA6B,QAAQ,CAACiV,CAAD,CAAmBrc,CAAnB,CAA0B,CAC7D,GAAI,CACF,IAAIkc,EAAYpI,CAAA7L,OAAA,CAAiBoU,CAAjB,CACZld,EAAA,CAAW+c,CAAX,CAAJ,CACEA,CADF,CACc,SAAW3a,EAAA,CAAQ2a,CAAR,CAAX,CADd,CAEY/T,CAAA+T,CAAA/T,QAFZ,EAEiC+T,CAAA5B,KAFjC,GAGE4B,CAAA/T,QAHF,CAGsB5G,EAAA,CAAQ2a,CAAA5B,KAAR,CAHtB,CAKA4B,EAAAM,SAAA;AAAqBN,CAAAM,SAArB,EAA2C,CAC3CN,EAAAlc,MAAA,CAAkBA,CAClBkc,EAAA9U,KAAA,CAAiB8U,CAAA9U,KAAjB,EAAmCA,CACnC8U,EAAAO,QAAA,CAAoBP,CAAAO,QAApB,EAA0CP,CAAAQ,WAA1C,EAAkER,CAAA9U,KAClE8U,EAAAS,SAAA,CAAqBT,CAAAS,SAArB,EAA2C,GAC3CJ,EAAA/c,KAAA,CAAgB0c,CAAhB,CAZE,CAaF,MAAOxW,CAAP,CAAU,CACV4W,CAAA,CAAkB5W,CAAlB,CADU,CAdiD,CAA/D,CAkBA,OAAO6W,EApB8B,CADT,CAAhC,CAwBF,EAAAZ,CAAA,CAAcvU,CAAd,CAAA5H,KAAA,CAAyB6c,CAAzB,CA5BF,EA8BEtd,CAAA,CAAQqI,CAAR,CAAcxH,EAAA,CAAcwc,CAAd,CAAd,CAEF,OAAO,KAlC4D,CA2DrE,KAAAL,2BAAA,CAAkCa,QAAQ,CAACC,CAAD,CAAS,CACjD,MAAIpb,EAAA,CAAUob,CAAV,CAAJ,EACEd,CACO,CADsBc,CACtB,CAAA,IAFT,EAIOd,CAL0C,CA8BnD,KAAAC,4BAAA,CAAmCc,QAAQ,CAACD,CAAD,CAAS,CAClD,MAAIpb,EAAA,CAAUob,CAAV,CAAJ,EACEb,CACO,CADuBa,CACvB,CAAA,IAFT,EAIOb,CAL2C,CASpD,KAAA/J,KAAA,CAAY,CACF,WADE,CACW,cADX,CAC2B,mBAD3B,CACgD,OADhD,CACyD,gBADzD,CAC2E,QAD3E,CAEF,aAFE,CAEa,YAFb,CAE2B,WAF3B,CAEwC,MAFxC,CAEgD,UAFhD,CAGV,QAAQ,CAAC6B,CAAD,CAAciJ,CAAd,CAA8BT,CAA9B,CAAmDU,CAAnD,CAA4DC,CAA5D,CAA8EC,CAA9E,CACCC,CADD;AACgBpI,CADhB,CAC8B4E,CAD9B,CAC2CyD,CAD3C,CACmDC,CADnD,CAC6D,CA8LrElV,QAASA,EAAO,CAACmV,CAAD,CAAgBC,CAAhB,CAA8BC,CAA9B,CAA2CC,CAA3C,CAA4DC,CAA5D,CAAoF,CAC5FJ,CAAN,WAA+B/X,EAA/B,GAEE+X,CAFF,CAEkB/X,CAAA,CAAO+X,CAAP,CAFlB,CAMAve,EAAA,CAAQue,CAAR,CAAuB,QAAQ,CAAClb,CAAD,CAAOpC,CAAP,CAAa,CACrB,CAArB,EAAIoC,CAAAxD,SAAJ,EAA0CwD,CAAAub,UAAA7X,MAAA,CAAqB,KAArB,CAA1C,GACEwX,CAAA,CAActd,CAAd,CADF,CACgCuF,CAAA,CAAOnD,CAAP,CAAAwb,KAAA,CAAkB,eAAlB,CAAA1c,OAAA,EAAA,CAA4C,CAA5C,CADhC,CAD0C,CAA5C,CAKA,KAAI2c,EAAkBC,EAAA,CAAaR,CAAb,CAA4BC,CAA5B,CAA0CD,CAA1C,CAAyDE,CAAzD,CAAsEC,CAAtE,CAAuFC,CAAvF,CACtB,OAAOK,SAAqB,CAAC7V,CAAD,CAAQ8V,CAAR,CAAuB,CACjD5U,EAAA,CAAUlB,CAAV,CAAiB,OAAjB,CAQA,KALA,IAAI+V,EAAYD,CACA,CAAZE,EAAA1Y,MAAAnG,KAAA,CAA2Bie,CAA3B,CAAY,CACZA,CAFJ,CAKQ3d,EAAI,CALZ,CAKeiT,EAAKqL,CAAAtf,OAApB,CAAsCgB,CAAtC,CAAwCiT,CAAxC,CAA4CjT,CAAA,EAA5C,CAAiD,CAC/C,IAAIyC,EAAO6b,CAAA,CAAUte,CAAV,CACU,EAArB,EAAIyC,CAAAxD,SAAJ,EAAyD,CAAzD,EAAwCwD,CAAAxD,SAAxC,EACEqf,CAAAE,GAAA,CAAaxe,CAAb,CAAA2I,KAAA,CAAqB,QAArB,CAA+BJ,CAA/B,CAH6C,CAMjDkW,CAAA,CAAaH,CAAb,CAAwB,UAAxB,CACID,EAAJ,EAAoBA,CAAA,CAAeC,CAAf,CAA0B/V,CAA1B,CAChB2V,EAAJ,EAAqBA,CAAA,CAAgB3V,CAAhB,CAAuB+V,CAAvB,CAAkCA,CAAlC,CACrB,OAAOA,EAlB0C,CAb+C,CAmCpGG,QAASA,EAAY,CAACC,CAAD,CAAW7W,CAAX,CAAsB,CACzC,GAAI,CACF6W,CAAAC,SAAA,CAAkB9W,CAAlB,CADE,CAEF,MAAM9B,CAAN,CAAS,EAH8B,CAwB3CoY,QAASA,GAAY,CAACS,CAAD,CAAWhB,CAAX,CAAyBiB,CAAzB,CAAuChB,CAAvC,CAAoDC,CAApD,CAAqEC,CAArE,CAA6F,CA4BhHG,QAASA,EAAe,CAAC3V,CAAD,CAAQqW,CAAR,CAAkBC,CAAlB,CAAgCC,CAAhC,CAAmD,CAAA,IACzDC,CADyD,CAC5Ctc,CAD4C,CACtCuc,CADsC,CAC1BC,CAD0B,CACPjf,CADO,CACJiT,CADI,CACAyH,CADA,CAIrEwE,EAAiB,EAChBlf;CAAA,CAAI,CAAT,KAAYiT,CAAZ,CAAiB2L,CAAA5f,OAAjB,CAAkCgB,CAAlC,CAAsCiT,CAAtC,CAA0CjT,CAAA,EAA1C,CACEkf,CAAArf,KAAA,CAAoB+e,CAAA,CAAS5e,CAAT,CAApB,CAGS0a,EAAP,CAAA1a,CAAA,CAAI,CAAR,KAAkBiT,CAAlB,CAAuBkM,CAAAngB,OAAvB,CAAuCgB,CAAvC,CAA2CiT,CAA3C,CAA+CyH,CAAA,EAA/C,CACEjY,CAIA,CAJOyc,CAAA,CAAexE,CAAf,CAIP,CAHA0E,CAGA,CAHaD,CAAA,CAAQnf,CAAA,EAAR,CAGb,CAFA+e,CAEA,CAFcI,CAAA,CAAQnf,CAAA,EAAR,CAEd,CAAIof,CAAJ,EACMA,CAAA7W,MAAJ,EACEyW,CACA,CADazW,CAAA8W,KAAA,CAAWtd,CAAA,CAASqd,CAAA7W,MAAT,CAAX,CACb,CAAA3C,CAAA,CAAOnD,CAAP,CAAAkG,KAAA,CAAkB,QAAlB,CAA4BqW,CAA5B,CAFF,EAIEA,CAJF,CAIezW,CAGf,CAAA,CADA0W,CACA,CADoBG,CAAAE,WACpB,GAA2BR,CAAAA,CAA3B,EAAgDlB,CAAhD,CACEwB,CAAA,CAAWL,CAAX,CAAwBC,CAAxB,CAAoCvc,CAApC,CAA0Coc,CAA1C,CACK,QAAQ,CAACjB,CAAD,CAAe,CACtB,MAAO,SAAQ,CAAC2B,CAAD,CAAU,CACvB,IAAIC,EAAkBjX,CAAA8W,KAAA,EACtBG,EAAAC,cAAA,CAAgC,CAAA,CAEhC,OAAO7B,EAAA,CAAa4B,CAAb,CAA8BD,CAA9B,CAAA5c,GAAA,CACA,UADA,CACY4B,EAAA,CAAKib,CAAL,CAAsBA,CAAA9Q,SAAtB,CADZ,CAJgB,CADH,CAAvB,CAQEuQ,CARF,EAQuBrB,CARvB,CADL,CADF,CAaEwB,CAAA,CAAWL,CAAX,CAAwBC,CAAxB,CAAoCvc,CAApC,CAA0C9D,CAA1C,CAAqDmgB,CAArD,CArBJ,EAuBWC,CAvBX,EAwBEA,CAAA,CAAYxW,CAAZ,CAAmB9F,CAAA8K,WAAnB,CAAoC5O,CAApC,CAA+CmgB,CAA/C,CAtCqE,CAxB3E,IAJgH,IAC5GK,EAAU,EADkG,CAEhGJ,CAFgG,CAEvEW,CAFuE,CAEhEC,CAFgE,CAIxG3f,EAAI,CAAZ,CAAeA,CAAf,CAAmB4e,CAAA5f,OAAnB,CAAoCgB,CAAA,EAApC,CACE0f,CAiBA,CAjBQ,IAAIE,CAiBZ,CAdAhD,CAcA,CAdaiD,CAAA,CAAkBjB,CAAA,CAAS5e,CAAT,CAAlB,CAA+B,EAA/B,CAAmC0f,CAAnC,CAA+C,CAAL,EAAA1f,CAAA,CAAS6d,CAAT,CAAuBlf,CAAjE,CAA4Emf,CAA5E,CAcb,CARAiB,CAQA,CAPc,CALdK,CAKc,CALAxC,CAAA5d,OACD,CAAP8gB,CAAA,CAAsBlD,CAAtB,CAAkCgC,CAAA,CAAS5e,CAAT,CAAlC,CAA+C0f,CAA/C,CAAsD9B,CAAtD,CAAoEiB,CAApE,CAAkF,IAAlF,CAAwF,EAAxF,CAA4F,EAA5F,CAAgGd,CAAhG,CAAO,CACP,IAGQ,GADeqB,CAAAW,SACf,EADsC,CAACnB,CAAA,CAAS5e,CAAT,CAAAuN,WACvC,EADiE,CAACqR,CAAA,CAAS5e,CAAT,CAAAuN,WAAAvO,OAClE;AAAR,IAAQ,CACRmf,EAAA,CAAaS,CAAA,CAAS5e,CAAT,CAAAuN,WAAb,CACG6R,CAAA,CAAaA,CAAAE,WAAb,CAAqC1B,CADxC,CAMN,CAHAuB,CAAAtf,KAAA,CAAauf,CAAb,CAGA,CAFAD,CAAAtf,KAAA,CAAakf,CAAb,CAEA,CADAY,CACA,CADeA,CACf,EAD8BP,CAC9B,EAD4CL,CAC5C,CAAAhB,CAAA,CAAyB,IAI3B,OAAO4B,EAAA,CAAczB,CAAd,CAAgC,IA1ByE,CAmFlH2B,QAASA,EAAiB,CAACpd,CAAD,CAAOma,CAAP,CAAmB8C,CAAnB,CAA0B7B,CAA1B,CAAuCC,CAAvC,CAAwD,CAAA,IAE5EkC,EAAWN,CAAAO,MAFiE,CAG5E9Z,CAGJ,QALe1D,CAAAxD,SAKf,EACE,KAAK,CAAL,CAEEihB,CAAA,CAAatD,CAAb,CACIuD,EAAA,CAAmBC,EAAA,CAAU3d,CAAV,CAAA+G,YAAA,EAAnB,CADJ,CACuD,GADvD,CAC4DqU,CAD5D,CACyEC,CADzE,CAFF,KAMW/V,CANX,CAMiBN,CANjB,CAMuB4Y,CAA0BC,EAAAA,CAAS7d,CAAAqF,WAAxD,KANF,IAOWyY,EAAI,CAPf,CAOkBC,EAAKF,CAALE,EAAeF,CAAAthB,OAD/B,CAC8CuhB,CAD9C,CACkDC,CADlD,CACsDD,CAAA,EADtD,CAC2D,CACzD,IAAIE,EAAgB,CAAA,CAApB,CACIC,EAAc,CAAA,CAElB3Y,EAAA,CAAOuY,CAAA,CAAOC,CAAP,CACP,IAAI,CAACxP,CAAL,EAAqB,CAArB,EAAaA,CAAb,EAA0BhJ,CAAA4Y,UAA1B,CAA0C,CACxClZ,CAAA,CAAOM,CAAAN,KAEPmZ,EAAA,CAAaT,EAAA,CAAmB1Y,CAAnB,CACToZ,GAAA/X,KAAA,CAAqB8X,CAArB,CAAJ,GACEnZ,CADF,CACS0B,EAAA,CAAWyX,CAAA7c,OAAA,CAAkB,CAAlB,CAAX,CAAiC,GAAjC,CADT,CAIA,KAAI+c,EAAiBF,CAAAxa,QAAA,CAAmB,cAAnB,CAAmC,EAAnC,CACjBwa,EAAJ,GAAmBE,CAAnB,CAAoC,OAApC,GACEL,CAEA,CAFgBhZ,CAEhB,CADAiZ,CACA,CADcjZ,CAAA1D,OAAA,CAAY,CAAZ,CAAe0D,CAAAzI,OAAf,CAA6B,CAA7B,CACd,CADgD,KAChD,CAAAyI,CAAA,CAAOA,CAAA1D,OAAA,CAAY,CAAZ,CAAe0D,CAAAzI,OAAf,CAA6B,CAA7B,CAHT,CAMAqhB,EAAA,CAAQF,EAAA,CAAmB1Y,CAAA+B,YAAA,EAAnB,CACRwW,EAAA,CAASK,CAAT,CAAA,CAAkB5Y,CAClBiY,EAAA,CAAMW,CAAN,CAAA;AAAelgB,CAAf,CAAuBoP,EAAA,CAAMwB,CACD,EADiB,MACjB,EADStJ,CACT,CAAxBnB,kBAAA,CAAmB7D,CAAAyM,aAAA,CAAkBzH,CAAlB,CAAwB,CAAxB,CAAnB,CAAwB,CACxBM,CAAA5H,MAFmB,CAGnB0P,GAAA,CAAmBpN,CAAnB,CAAyB4d,CAAzB,CAAJ,GACEX,CAAA,CAAMW,CAAN,CADF,CACiB,CAAA,CADjB,CAGAU,EAAA,CAA4Bte,CAA5B,CAAkCma,CAAlC,CAA8Czc,CAA9C,CAAqDkgB,CAArD,CACAH,EAAA,CAAatD,CAAb,CAAyByD,CAAzB,CAAgC,GAAhC,CAAqCxC,CAArC,CAAkDC,CAAlD,CAAmE2C,CAAnE,CAAkFC,CAAlF,CAxBwC,CALe,CAkC3D7Y,CAAA,CAAYpF,CAAAoF,UACZ,IAAI3I,CAAA,CAAS2I,CAAT,CAAJ,EAAyC,EAAzC,GAA2BA,CAA3B,CACE,IAAA,CAAO1B,CAAP,CAAegW,CAAAvU,KAAA,CAA4BC,CAA5B,CAAf,CAAA,CACEwY,CAIA,CAJQF,EAAA,CAAmBha,CAAA,CAAM,CAAN,CAAnB,CAIR,CAHI+Z,CAAA,CAAatD,CAAb,CAAyByD,CAAzB,CAAgC,GAAhC,CAAqCxC,CAArC,CAAkDC,CAAlD,CAGJ,GAFE4B,CAAA,CAAMW,CAAN,CAEF,CAFiB9Q,EAAA,CAAKpJ,CAAA,CAAM,CAAN,CAAL,CAEjB,EAAA0B,CAAA,CAAYA,CAAA9D,OAAA,CAAiBoC,CAAA9F,MAAjB,CAA+B8F,CAAA,CAAM,CAAN,CAAAnH,OAA/B,CAGhB,MACF,MAAK,CAAL,CACEgiB,CAAA,CAA4BpE,CAA5B,CAAwCna,CAAAub,UAAxC,CACA,MACF,MAAK,CAAL,CACE,GAAI,CAEF,GADA7X,CACA,CADQ+V,CAAAtU,KAAA,CAA8BnF,CAAAub,UAA9B,CACR,CACEqC,CACA,CADQF,EAAA,CAAmBha,CAAA,CAAM,CAAN,CAAnB,CACR,CAAI+Z,CAAA,CAAatD,CAAb,CAAyByD,CAAzB,CAAgC,GAAhC,CAAqCxC,CAArC,CAAkDC,CAAlD,CAAJ,GACE4B,CAAA,CAAMW,CAAN,CADF,CACiB9Q,EAAA,CAAKpJ,CAAA,CAAM,CAAN,CAAL,CADjB,CAJA,CAQF,MAAOJ,CAAP,CAAU,EAjEhB,CAwEA6W,CAAA9c,KAAA,CAAgBmhB,CAAhB,CACA,OAAOrE,EA/EyE,CAyFlFsE,QAASA,GAAS,CAACze,CAAD,CAAO0e,CAAP,CAAkBC,CAAlB,CAA2B,CAC3C,IAAIC,EAAQ,EAAZ,CACIC,EAAQ,CACZ,IAAIH,CAAJ,EAAiB1e,CAAA8e,aAAjB,EAAsC9e,CAAA8e,aAAA,CAAkBJ,CAAlB,CAAtC,EAEE,EAAG,CACD,GAAI,CAAC1e,CAAL,CACE,KAAM+e,GAAA,CAAe,SAAf,CAA8FL,CAA9F,CAAyGC,CAAzG,CAAN,CAEmB,CAArB,EAAI3e,CAAAxD,SAAJ;CACMwD,CAAA8e,aAAA,CAAkBJ,CAAlB,CACJ,EADkCG,CAAA,EAClC,CAAI7e,CAAA8e,aAAA,CAAkBH,CAAlB,CAAJ,EAAgCE,CAAA,EAFlC,CAIAD,EAAAxhB,KAAA,CAAW4C,CAAX,CACAA,EAAA,CAAOA,CAAAgf,YATN,CAAH,MAUiB,CAVjB,CAUSH,CAVT,CAFF,KAcED,EAAAxhB,KAAA,CAAW4C,CAAX,CAGF,OAAOmD,EAAA,CAAOyb,CAAP,CApBoC,CA+B7CK,QAASA,GAA0B,CAACC,CAAD,CAASR,CAAT,CAAoBC,CAApB,CAA6B,CAC9D,MAAO,SAAQ,CAAC7Y,CAAD,CAAQ5C,CAAR,CAAiB+Z,CAAjB,CAAwBkC,CAAxB,CAAqC,CAClDjc,CAAA,CAAUub,EAAA,CAAUvb,CAAA,CAAQ,CAAR,CAAV,CAAsBwb,CAAtB,CAAiCC,CAAjC,CACV,OAAOO,EAAA,CAAOpZ,CAAP,CAAc5C,CAAd,CAAuB+Z,CAAvB,CAA8BkC,CAA9B,CAF2C,CADU,CA2BhE9B,QAASA,EAAqB,CAAClD,CAAD,CAAaiF,CAAb,CAA0BC,CAA1B,CAAyClE,CAAzC,CAAuDmE,CAAvD,CAC1BC,CAD0B,CACAC,CADA,CACYC,CADZ,CACyBnE,CADzB,CACiD,CAgL7EoE,QAASA,EAAU,CAACC,CAAD,CAAMC,CAAN,CAAYlB,CAAZ,CAAuBC,CAAvB,CAAgC,CAC7CgB,CAAJ,GACMjB,CAEJ,GAFeiB,CAEf,CAFqBV,EAAA,CAA2BU,CAA3B,CAAgCjB,CAAhC,CAA2CC,CAA3C,CAErB,EADAgB,CAAAtF,QACA,CADcP,CAAAO,QACd,CAAAmF,CAAApiB,KAAA,CAAgBuiB,CAAhB,CAHF,CAKIC,EAAJ,GACMlB,CAEJ,GAFekB,CAEf,CAFsBX,EAAA,CAA2BW,CAA3B,CAAiClB,CAAjC,CAA4CC,CAA5C,CAEtB,EADAiB,CAAAvF,QACA,CADeP,CAAAO,QACf,CAAAoF,CAAAriB,KAAA,CAAiBwiB,CAAjB,CAHF,CANiD,CAcnDC,QAASA,EAAc,CAACxF,CAAD,CAAU4B,CAAV,CAAoB,CAAA,IACrCve,CADqC,CAC9BoiB,EAAkB,MADY,CACJC,EAAW,CAAA,CAChD,IAAItjB,CAAA,CAAS4d,CAAT,CAAJ,CAAuB,CACrB,IAAA,CAAqC,GAArC,GAAO3c,CAAP,CAAe2c,CAAAxY,OAAA,CAAe,CAAf,CAAf,GAAqD,GAArD,EAA4CnE,CAA5C,CAAA,CACE2c,CAIA,CAJUA,CAAA/Y,OAAA,CAAe,CAAf,CAIV,CAHa,GAGb,EAHI5D,CAGJ,GAFEoiB,CAEF,CAFoB,eAEpB,EAAAC,CAAA,CAAWA,CAAX,EAAgC,GAAhC,EAAuBriB,CAGzBA,EAAA,CAAQue,CAAA,CAAS6D,CAAT,CAAA,CAA0B,GAA1B,CAAgCzF,CAAhC,CAA0C,YAA1C,CAEoB;CAA5B,EAAI4B,CAAA,CAAS,CAAT,CAAAzf,SAAJ,EAAiCyf,CAAA,CAAS,CAAT,CAAA+D,aAAjC,GACEtiB,CACA,CADQA,CACR,EADiBue,CAAA,CAAS,CAAT,CAAA+D,aACjB,CAAA/D,CAAA,CAAS,CAAT,CAAA+D,aAAA,CAA2B,IAF7B,CAKA,IAAI,CAACtiB,CAAL,EAAc,CAACqiB,CAAf,CACE,KAAMhB,GAAA,CAAe,OAAf,CAA0F1E,CAA1F,CAAmG4F,CAAnG,CAAN,CAjBmB,CAAvB,IAoBWvjB,EAAA,CAAQ2d,CAAR,CAAJ,GACL3c,CACA,CADQ,EACR,CAAAf,CAAA,CAAQ0d,CAAR,CAAiB,QAAQ,CAACA,CAAD,CAAU,CACjC3c,CAAAN,KAAA,CAAWyiB,CAAA,CAAexF,CAAf,CAAwB4B,CAAxB,CAAX,CADiC,CAAnC,CAFK,CAMP,OAAOve,EA5BkC,CAgC3Cif,QAASA,EAAU,CAACL,CAAD,CAAcxW,CAAd,CAAqBoa,CAArB,CAA+B9D,CAA/B,CAA6CC,CAA7C,CAAgE,CAAA,IAC7EY,CAD6E,CACtEhB,CADsE,CACzDzL,CADyD,CACrD0O,CADqD,CAC7C5E,CAGlC2C,EAAA,CADEmC,CAAJ,GAAoBc,CAApB,CACUb,CADV,CAGUje,EAAA,CAAYie,CAAZ,CAA2B,IAAIlC,CAAJ,CAAeha,CAAA,CAAO+c,CAAP,CAAf,CAAiCb,CAAA7B,MAAjC,CAA3B,CAEVvB,EAAA,CAAWgB,CAAAkD,UAEX,IAAIC,CAAJ,CAA8B,CAC5B,IAAIC,GAAe,8BAAnB,CAEIC,EAAcxa,CAAAya,QAAdD,EAA+Bxa,CAEnCnJ,EAAA,CAAQyjB,CAAAta,MAAR,CAAwC,QAAQ,CAAC0a,CAAD,CAAaC,CAAb,CAAwB,CAAA,IAClE/c,EAAQ8c,CAAA9c,MAAA,CAAiB2c,EAAjB,CAAR3c,EAA0C,EADwB,CAElEgd,EAAWhd,CAAA,CAAM,CAAN,CAAXgd,EAAuBD,CAF2C,CAGlEV,EAAwB,GAAxBA,EAAYrc,CAAA,CAAM,CAAN,CAHsD,CAIlEid,EAAOjd,CAAA,CAAM,CAAN,CAJ2D,CAKlEkd,CALkE,CAMlEC,CANkE,CAMvDC,CAEfhb,EAAAib,kBAAA,CAAwBN,CAAxB,CAAA,CAAqCE,CAArC,CAA4CD,CAE5C,QAAQC,CAAR,EAEE,KAAK,GAAL,CACE1D,CAAA+D,SAAA,CAAeN,CAAf,CAAyB,QAAQ,CAAChjB,CAAD,CAAQ,CACvCoI,CAAA,CAAM2a,CAAN,CAAA,CAAmB/iB,CADoB,CAAzC,CAGAuf,EAAAgE,YAAA,CAAkBP,CAAlB,CAAAQ,QAAA;AAAsCZ,CAClCrD,EAAA,CAAMyD,CAAN,CAAJ,GAEE5a,CAAA,CAAM2a,CAAN,CAFF,CAEqB9F,CAAA,CAAasC,CAAA,CAAMyD,CAAN,CAAb,CAAA,CAA8BJ,CAA9B,CAFrB,CAIA,MAGF,MAAK,GAAL,CACE,GAAIP,CAAJ,EAAgB,CAAC9C,CAAA,CAAMyD,CAAN,CAAjB,CACE,KAEFG,EAAA,CAAY/F,CAAA,CAAOmC,CAAA,CAAMyD,CAAN,CAAP,CACZI,EAAA,CAAYD,CAAAM,OAAZ,EAAgC,QAAQ,EAAG,CAEzCP,CAAA,CAAY9a,CAAA,CAAM2a,CAAN,CAAZ,CAA+BI,CAAA,CAAUP,CAAV,CAC/B,MAAMvB,GAAA,CAAe,WAAf,CACF9B,CAAA,CAAMyD,CAAN,CADE,CACeN,CAAApb,KADf,CAAN,CAHyC,CAM3C4b,EAAA,CAAY9a,CAAA,CAAM2a,CAAN,CAAZ,CAA+BI,CAAA,CAAUP,CAAV,CAC/Bxa,EAAA/E,OAAA,CAAaqgB,QAAyB,EAAG,CACvC,IAAIC,EAAcR,CAAA,CAAUP,CAAV,CAEde,EAAJ,GAAoBvb,CAAA,CAAM2a,CAAN,CAApB,GAEMY,CAAJ,GAAoBT,CAApB,CAEEA,CAFF,CAEc9a,CAAA,CAAM2a,CAAN,CAFd,CAEiCY,CAFjC,CAKEP,CAAA,CAAUR,CAAV,CAAuBe,CAAvB,CAAqCT,CAArC,CAAiD9a,CAAA,CAAM2a,CAAN,CAAjD,CAPJ,CAUA,OAAOY,EAbgC,CAAzC,CAeA,MAGF,MAAK,GAAL,CACER,CAAA,CAAY/F,CAAA,CAAOmC,CAAA,CAAMyD,CAAN,CAAP,CACZ5a,EAAA,CAAM2a,CAAN,CAAA,CAAmB,QAAQ,CAACxP,CAAD,CAAS,CAClC,MAAO4P,EAAA,CAAUP,CAAV,CAAuBrP,CAAvB,CAD2B,CAGpC,MAGF,SACE,KAAM8N,GAAA,CAAe,MAAf,CACFqB,CAAApb,KADE,CAC6Byb,CAD7B,CACwCD,CADxC,CAAN,CArDJ,CAVsE,CAAxE,CAL4B,CA2E1Bc,CAAJ,EACE3kB,CAAA,CAAQ2kB,CAAR,CAA8B,QAAQ,CAACxH,CAAD,CAAY,CAAA,IAC5C7I,EAAS,QACHnL,CADG,UAEDmW,CAFC,QAGHgB,CAHG,aAIEZ,CAJF,CADmC,CAM7CkF,CAEHjH,EAAA,CAAaR,CAAAQ,WACK,IAAlB,EAAIA,CAAJ,GACEA,CADF,CACe2C,CAAA,CAAMnD,CAAA9U,KAAN,CADf,CAIAuc,EAAA,CAAqBxG,CAAA,CAAYT,CAAZ,CAAwBrJ,CAAxB,CAMO,EAA5B,EAAIgL,CAAA,CAAS,CAAT,CAAAzf,SAAJ,CACEyf,CAAA,CAAS,CAAT,CAAA+D,aADF,CAC6BuB,CAD7B,CAGEtF,CAAA/V,KAAA,CAAc,GAAd;AAAoB4T,CAAA9U,KAApB,CAAqC,YAArC,CAAmDuc,CAAnD,CAEEzH,EAAA0H,aAAJ,GACEvQ,CAAAwQ,OAAA,CAAc3H,CAAA0H,aAAd,CADF,CAC0CD,CAD1C,CAxBgD,CAAlD,CA+BEhkB,EAAA,CAAI,CAAR,KAAWiT,CAAX,CAAgBgP,CAAAjjB,OAAhB,CAAmCgB,CAAnC,CAAuCiT,CAAvC,CAA2CjT,CAAA,EAA3C,CACE,GAAI,CACF2hB,CACA,CADSM,CAAA,CAAWjiB,CAAX,CACT,CAAA2hB,CAAA,CAAOpZ,CAAP,CAAcmW,CAAd,CAAwBgB,CAAxB,CACIiC,CAAA7E,QADJ,EACsBwF,CAAA,CAAeX,CAAA7E,QAAf,CAA+B4B,CAA/B,CADtB,CAFE,CAIF,MAAO3Y,CAAP,CAAU,CACV4W,CAAA,CAAkB5W,CAAlB,CAAqBL,EAAA,CAAYgZ,CAAZ,CAArB,CADU,CAMdK,CAAA,EAAeA,CAAA,CAAYxW,CAAZ,CAAmBoa,CAAApV,WAAnB,CAAwC5O,CAAxC,CAAmDmgB,CAAnD,CAGf,KAAI9e,CAAJ,CAAQkiB,CAAAljB,OAAR,CAA6B,CAA7B,CAAqC,CAArC,EAAgCgB,CAAhC,CAAwCA,CAAA,EAAxC,CACE,GAAI,CACF2hB,CACA,CADSO,CAAA,CAAYliB,CAAZ,CACT,CAAA2hB,CAAA,CAAOpZ,CAAP,CAAcmW,CAAd,CAAwBgB,CAAxB,CACIiC,CAAA7E,QADJ,EACsBwF,CAAA,CAAeX,CAAA7E,QAAf,CAA+B4B,CAA/B,CADtB,CAFE,CAIF,MAAO3Y,EAAP,CAAU,CACV4W,CAAA,CAAkB5W,EAAlB,CAAqBL,EAAA,CAAYgZ,CAAZ,CAArB,CADU,CAxImE,CA7NnFX,CAAA,CAAyBA,CAAzB,EAAmD,EAD0B,KAGzEoG,EAAmB,CAAChJ,MAAAC,UAHqD,CAIzEgJ,EAJyE,CAKzEvB,EAA2B9E,CAAA8E,yBAL8C,CAMzEwB,EAAoBtG,CAAAsG,kBANqD,CAOzEC,EAAexC,CAAAc,UAAf0B,CAAyC1e,CAAA,CAAOic,CAAP,CAPgC,CAQzEtF,CARyE,CASzEmG,CATyE,CAUzE6B,CACAC,EAAAA,CAAsBzG,CAAAyG,oBAQ1B,KAnB6E,IAazEvF,EAAoBrB,CAbqD,CAczEmG,CAdyE,CAezEpC,CAfyE,CAmBrE3hB,GAAI,CAnBiE,CAmB9DiT,EAAK2J,CAAA5d,OAApB,CAAuCgB,EAAvC,CAA2CiT,CAA3C,CAA+CjT,EAAA,EAA/C,CAAoD,CAClDuc,CAAA,CAAYK,CAAA,CAAW5c,EAAX,CACZ,KAAImhB,EAAY5E,CAAAkI,QAAhB,CACIrD,EAAU7E,CAAAmI,MAGVvD,EAAJ,GACEmD,CADF;AACiBpD,EAAA,CAAUW,CAAV,CAAuBV,CAAvB,CAAkCC,CAAlC,CADjB,CAGAmD,EAAA,CAAY5lB,CAEZ,IAAIwlB,CAAJ,CAAuB5H,CAAAM,SAAvB,CACE,KAGF,IAAI8H,CAAJ,CAAqBpI,CAAAhU,MAArB,CACE6b,EAIA,CAJoBA,EAIpB,EAJyC7H,CAIzC,CAAKA,CAAAqI,YAAL,GACEC,CAAA,CAAkB,oBAAlB,CAAwChC,CAAxC,CAAkEtG,CAAlE,CAA6E+H,CAA7E,CAKA,CAJIviB,CAAA,CAAS4iB,CAAT,CAIJ,GAHElG,CAAA,CAAa6F,CAAb,CAA2B,kBAA3B,CACA,CAAAzB,CAAA,CAA2BtG,CAE7B,EAAAkC,CAAA,CAAa6F,CAAb,CAA2B,UAA3B,CANF,CAUF5B,EAAA,CAAgBnG,CAAA9U,KAEXmd,EAAArI,CAAAqI,YAAL,EAA8BrI,CAAAQ,WAA9B,GACE4H,CAIA,CAJiBpI,CAAAQ,WAIjB,CAHAgH,CAGA,CAHuBA,CAGvB,EAH+C,EAG/C,CAFAc,CAAA,CAAkB,GAAlB,CAAwBnC,CAAxB,CAAwC,cAAxC,CACIqB,CAAA,CAAqBrB,CAArB,CADJ,CACyCnG,CADzC,CACoD+H,CADpD,CAEA,CAAAP,CAAA,CAAqBrB,CAArB,CAAA,CAAsCnG,CALxC,CAQA,IAAIoI,CAAJ,CAAqBpI,CAAA+C,WAArB,CAGwB,UAKtB,GALIoD,CAKJ,GAJEmC,CAAA,CAAkB,cAAlB,CAAkCL,CAAlC,CAAuDjI,CAAvD,CAAkE+H,CAAlE,CACA,CAAAE,CAAA,CAAsBjI,CAGxB,EAAsB,SAAtB,EAAIoI,CAAJ,EACER,CAOA,CAPmB5H,CAAAM,SAOnB,CANA0H,CAMA,CANYrD,EAAA,CAAUW,CAAV,CAAuBV,CAAvB,CAAkCC,CAAlC,CAMZ,CALAkD,CAKA,CALexC,CAAAc,UAKf,CAJIhd,CAAA,CAAOlH,CAAAomB,cAAA,CAAuB,GAAvB,CAA6BpC,CAA7B,CAA6C,IAA7C,CAAoDZ,CAAA,CAAcY,CAAd,CAApD,CAAmF,GAAnF,CAAP,CAIJ,CAHAb,CAGA,CAHcyC,CAAA,CAAa,CAAb,CAGd,CAFAS,EAAA,CAAYhD,CAAZ,CAA0Bnc,CAAA,CAjtI7BjB,EAAAjF,KAAA,CAitI8C6kB,CAjtI9C,CAA+B,CAA/B,CAitI6B,CAA1B,CAAwD1C,CAAxD,CAEA,CAAA5C,CAAA,CAAoBzW,CAAA,CAAQ+b,CAAR,CAAmB3G,CAAnB,CAAiCuG,CAAjC,CACQa,CADR,EAC4BA,CAAAvd,KAD5B,CACmD,0BACfob,CADe,qBAEpB2B,CAFoB;kBAGtBH,CAHsB,CADnD,CARtB,GAeEE,CAEA,CAFY3e,CAAA,CAAO8H,EAAA,CAAYmU,CAAZ,CAAP,CAAAoD,SAAA,EAEZ,CADAX,CAAAxe,KAAA,CAAkB,EAAlB,CACA,CAAAmZ,CAAA,CAAoBzW,CAAA,CAAQ+b,CAAR,CAAmB3G,CAAnB,CAjBtB,CAqBF,IAAIrB,CAAA2I,SAAJ,CAUE,GATAL,CAAA,CAAkB,UAAlB,CAA8BR,CAA9B,CAAiD9H,CAAjD,CAA4D+H,CAA5D,CASIle,CARJie,CAQIje,CARgBmW,CAQhBnW,CANJue,CAMIve,CANc5G,CAAA,CAAW+c,CAAA2I,SAAX,CACD,CAAX3I,CAAA2I,SAAA,CAAmBZ,CAAnB,CAAiCxC,CAAjC,CAAW,CACXvF,CAAA2I,SAIF9e,CAFJue,CAEIve,CAFa+e,EAAA,CAAoBR,CAApB,CAEbve,CAAAmW,CAAAnW,QAAJ,CAAuB,CACrB4e,CAAA,CAAmBzI,CACnBgI,EAAA,CAAY3e,CAAA,CAAO,OAAP,CACS2J,EAAA,CAAKoV,CAAL,CADT,CAEO,QAFP,CAAAM,SAAA,EAGZpD,EAAA,CAAc0C,CAAA,CAAU,CAAV,CAEd,IAAwB,CAAxB,EAAIA,CAAAvlB,OAAJ,EAAsD,CAAtD,GAA6B6iB,CAAA5iB,SAA7B,CACE,KAAMuiB,GAAA,CAAe,OAAf,CAAgGkB,CAAhG,CAA+G,EAA/G,CAAN,CAGFqC,EAAA,CAAYhD,CAAZ,CAA0BuC,CAA1B,CAAwCzC,CAAxC,CAEIuD,EAAAA,CAAmB,OAAQ,EAAR,CAOvBxI,EAAA,CAAaA,CAAA/X,OAAA,CACTgb,CAAA,CACIgC,CADJ,CAEIjF,CAAAzZ,OAAA,CAAkBnD,EAAlB,CAAsB,CAAtB,CAAyB4c,CAAA5d,OAAzB,EAA8CgB,EAA9C,CAAkD,CAAlD,EAFJ,CAGIolB,CAHJ,CADS,CAObC,GAAA,CAAwBvD,CAAxB,CAAuCsD,CAAvC,CAEAnS,EAAA,CAAK2J,CAAA5d,OA7BgB,CAAvB,IA+BEslB,EAAAxe,KAAA,CAAkB6e,CAAlB,CAIJ,IAAIpI,CAAAqI,YAAJ,CACEC,CAAA,CAAkB,UAAlB,CAA8BR,CAA9B,CAAiD9H,CAAjD,CAA4D+H,CAA5D,CAaA,CAZAD,CAYA,CAZoB9H,CAYpB,CAVIA,CAAAnW,QAUJ,GATE4e,CASF,CATqBzI,CASrB,EANA6C,CAMA,CANakG,EAAA,CAAmB1I,CAAAzZ,OAAA,CAAkBnD,EAAlB,CAAqB4c,CAAA5d,OAArB,CAAyCgB,EAAzC,CAAnB,CAAgEskB,CAAhE,CACTxC,CADS,CACMC,CADN,CACoB9C,CADpB,CACuCgD,CADvC,CACmDC,CADnD,CACgE,0BAC7CW,CAD6C;oBAElD2B,CAFkD,mBAGpDH,CAHoD,CADhE,CAMb,CAAApR,CAAA,CAAK2J,CAAA5d,OAdP,KAeO,IAAIud,CAAA/T,QAAJ,CACL,GAAI,CACFmZ,CACA,CADSpF,CAAA/T,QAAA,CAAkB8b,CAAlB,CAAgCxC,CAAhC,CAA+C7C,CAA/C,CACT,CAAIzf,CAAA,CAAWmiB,CAAX,CAAJ,CACEQ,CAAA,CAAW,IAAX,CAAiBR,CAAjB,CAAyBR,CAAzB,CAAoCC,CAApC,CADF,CAEWO,CAFX,EAGEQ,CAAA,CAAWR,CAAAS,IAAX,CAAuBT,CAAAU,KAAvB,CAAoClB,CAApC,CAA+CC,CAA/C,CALA,CAOF,MAAOrb,CAAP,CAAU,CACV4W,CAAA,CAAkB5W,CAAlB,CAAqBL,EAAA,CAAY4e,CAAZ,CAArB,CADU,CAKV/H,CAAAwD,SAAJ,GACEX,CAAAW,SACA,CADsB,CAAA,CACtB,CAAAoE,CAAA,CAAmBoB,IAAAC,IAAA,CAASrB,CAAT,CAA2B5H,CAAAM,SAA3B,CAFrB,CA9IkD,CAqJpDuC,CAAA7W,MAAA,CAAmB6b,EAAnB,EAAwCA,EAAA7b,MACxC6W,EAAAE,WAAA,CAAwBkF,CAAxB,EAA+CvF,CAG/C,OAAOG,EA5KsE,CA4X/Ec,QAASA,EAAY,CAACuF,CAAD,CAAche,CAAd,CAAoBpF,CAApB,CAA8Bwb,CAA9B,CAA2CC,CAA3C,CAA4D4H,CAA5D,CAA2EC,CAA3E,CAAwF,CAC3G,GAAIle,CAAJ,GAAaqW,CAAb,CAA8B,MAAO,KACjC3X,EAAAA,CAAQ,IACZ,IAAI6V,CAAAvc,eAAA,CAA6BgI,CAA7B,CAAJ,CAAwC,CAAA,IAC9B8U,CAAWK,EAAAA,CAAazI,CAAAvB,IAAA,CAAcnL,CAAd,CAAqBwU,CAArB,CAAhC,KADsC,IAElCjc,EAAI,CAF8B,CAE3BiT,EAAK2J,CAAA5d,OADhB,CACmCgB,CADnC,CACqCiT,CADrC,CACyCjT,CAAA,EADzC,CAEE,GAAI,CACFuc,CACA,CADYK,CAAA,CAAW5c,CAAX,CACZ,EAAM6d,CAAN,GAAsBlf,CAAtB,EAAmCkf,CAAnC,CAAiDtB,CAAAM,SAAjD,GAC8C,EAD9C,EACKN,CAAAS,SAAAha,QAAA,CAA2BX,CAA3B,CADL,GAEMqjB,CAIJ,GAHEnJ,CAGF,CAHcjb,EAAA,CAAQib,CAAR,CAAmB,SAAUmJ,CAAV,OAAgCC,CAAhC,CAAnB,CAGd,EADAF,CAAA5lB,KAAA,CAAiB0c,CAAjB,CACA,CAAApW,CAAA,CAAQoW,CANV,CAFE,CAUF,MAAMxW,CAAN,CAAS,CAAE4W,CAAA,CAAkB5W,CAAlB,CAAF,CAbyB,CAgBxC,MAAOI,EAnBoG,CA51BxC;AA23BrEkf,QAASA,GAAuB,CAACpkB,CAAD,CAAM6C,CAAN,CAAW,CAAA,IACrC8hB,EAAU9hB,CAAAmc,MAD2B,CAErC4F,EAAU5kB,CAAAgf,MAF2B,CAGrCvB,EAAWzd,CAAA2hB,UAGfxjB,EAAA,CAAQ6B,CAAR,CAAa,QAAQ,CAACd,CAAD,CAAQZ,CAAR,CAAa,CACX,GAArB,EAAIA,CAAA+E,OAAA,CAAW,CAAX,CAAJ,GACMR,CAAA,CAAIvE,CAAJ,CAGJ,GAFEY,CAEF,GAFoB,OAAR,GAAAZ,CAAA,CAAkB,GAAlB,CAAwB,GAEpC,EAF2CuE,CAAA,CAAIvE,CAAJ,CAE3C,EAAA0B,CAAA6kB,KAAA,CAASvmB,CAAT,CAAcY,CAAd,CAAqB,CAAA,CAArB,CAA2BylB,CAAA,CAAQrmB,CAAR,CAA3B,CAJF,CADgC,CAAlC,CAUAH,EAAA,CAAQ0E,CAAR,CAAa,QAAQ,CAAC3D,CAAD,CAAQZ,CAAR,CAAa,CACrB,OAAX,EAAIA,CAAJ,EACEkf,CAAA,CAAaC,CAAb,CAAuBve,CAAvB,CACA,CAAAc,CAAA,CAAI,OAAJ,CAAA,EAAgBA,CAAA,CAAI,OAAJ,CAAA,CAAeA,CAAA,CAAI,OAAJ,CAAf,CAA8B,GAA9B,CAAoC,EAApD,EAA0Dd,CAF5D,EAGkB,OAAX,EAAIZ,CAAJ,CACLmf,CAAA3W,KAAA,CAAc,OAAd,CAAuB2W,CAAA3W,KAAA,CAAc,OAAd,CAAvB,CAAgD,GAAhD,CAAsD5H,CAAtD,CADK,CAKqB,GALrB,EAKIZ,CAAA+E,OAAA,CAAW,CAAX,CALJ,EAK6BrD,CAAAxB,eAAA,CAAmBF,CAAnB,CAL7B,GAML0B,CAAA,CAAI1B,CAAJ,CACA,CADWY,CACX,CAAA0lB,CAAA,CAAQtmB,CAAR,CAAA,CAAeqmB,CAAA,CAAQrmB,CAAR,CAPV,CAJyB,CAAlC,CAhByC,CAiC3C+lB,QAASA,GAAkB,CAAC1I,CAAD,CAAa0H,CAAb,CAA2ByB,CAA3B,CACvBlH,CADuB,CACTI,CADS,CACUgD,CADV,CACsBC,CADtB,CACmCnE,CADnC,CAC2D,CAAA,IAChFiI,EAAY,EADoE,CAEhFC,CAFgF,CAGhFC,CAHgF,CAIhFC,EAA4B7B,CAAA,CAAa,CAAb,CAJoD,CAKhF8B,EAAqBxJ,CAAAnQ,MAAA,EAL2D,CAOhF4Z,EAAuBrlB,CAAA,CAAO,EAAP,CAAWolB,CAAX,CAA+B,aACvC,IADuC,YACrB,IADqB,SACN,IADM,CAA/B,CAPyD,CAUhFxB,EAAeplB,CAAA,CAAW4mB,CAAAxB,YAAX,CACD,CAARwB,CAAAxB,YAAA,CAA+BN,CAA/B,CAA6CyB,CAA7C,CAAQ;AACRK,CAAAxB,YAEVN,EAAAxe,KAAA,CAAkB,EAAlB,CAEAuX,EAAAzK,IAAA,CAAU6K,CAAA6I,sBAAA,CAA2B1B,CAA3B,CAAV,CAAmD,OAAQtH,CAAR,CAAnD,CAAAiJ,QAAA,CACU,QAAQ,CAACC,CAAD,CAAU,CAAA,IACpB3E,CAEJ2E,EAAA,CAAUrB,EAAA,CAAoBqB,CAApB,CAEV,IAAIJ,CAAAhgB,QAAJ,CAAgC,CAC9Bme,CAAA,CAAY3e,CAAA,CAAO,OAAP,CAAiB2J,EAAA,CAAKiX,CAAL,CAAjB,CAAiC,QAAjC,CAAAvB,SAAA,EACZpD,EAAA,CAAc0C,CAAA,CAAU,CAAV,CAEd,IAAwB,CAAxB,EAAIA,CAAAvlB,OAAJ,EAAsD,CAAtD,GAA6B6iB,CAAA5iB,SAA7B,CACE,KAAMuiB,GAAA,CAAe,OAAf,CACF4E,CAAA3e,KADE,CACuBmd,CADvB,CAAN,CAIF6B,CAAA,CAAoB,OAAQ,EAAR,CACpB1B,GAAA,CAAYlG,CAAZ,CAA0ByF,CAA1B,CAAwCzC,CAAxC,CACAhC,EAAA,CAAkBgC,CAAlB,CAA+BjF,CAA/B,CAA2C6J,CAA3C,CACApB,GAAA,CAAwBU,CAAxB,CAAgCU,CAAhC,CAZ8B,CAAhC,IAcE5E,EACA,CADcsE,CACd,CAAA7B,CAAAxe,KAAA,CAAkB0gB,CAAlB,CAGF5J,EAAAhc,QAAA,CAAmBylB,CAAnB,CAEAJ,EAAA,CAA0BnG,CAAA,CAAsBlD,CAAtB,CAAkCiF,CAAlC,CAA+CkE,CAA/C,CACtB9G,CADsB,CACHqF,CADG,CACW8B,CADX,CAC+BnE,CAD/B,CAC2CC,CAD3C,CACwDnE,CADxD,CAE1B3e,EAAA,CAAQyf,CAAR,CAAsB,QAAQ,CAACpc,CAAD,CAAOzC,CAAP,CAAU,CAClCyC,CAAJ,EAAYof,CAAZ,GACEhD,CAAA,CAAa7e,CAAb,CADF,CACoBskB,CAAA,CAAa,CAAb,CADpB,CADsC,CAAxC,CAQA,KAHA4B,CAGA,CAH2B/H,EAAA,CAAamG,CAAA,CAAa,CAAb,CAAA/W,WAAb,CAAyC0R,CAAzC,CAG3B,CAAM+G,CAAAhnB,OAAN,CAAA,CAAwB,CAClBuJ,CAAAA,CAAQyd,CAAAvZ,MAAA,EADU,KAElBia,EAAyBV,CAAAvZ,MAAA,EAFP,CAGlBka,EAAkBX,CAAAvZ,MAAA,EAHA,CAIlBsQ,EAAaiJ,CAAAvZ,MAAA,EAJK,CAKlBkW,EAAW2B,CAAA,CAAa,CAAb,CAEXoC,EAAJ,GAA+BP,CAA/B,GAEExD,CACA,CADWjV,EAAA,CAAYmU,CAAZ,CACX,CAAAkD,EAAA,CAAY4B,CAAZ,CAA6B/gB,CAAA,CAAO8gB,CAAP,CAA7B,CAA6D/D,CAA7D,CAHF,CAMAsD,EAAA,CAAwBC,CAAxB,CAAkD3d,CAAlD,CAAyDoa,CAAzD,CAAmE9D,CAAnE,CAAiF9B,CAAjF,CAbsB,CAexBiJ,CAAA,CAAY,IAlDY,CAD5B,CAAA1P,MAAA,CAqDQ,QAAQ,CAACsQ,CAAD;AAAWC,CAAX,CAAiBC,CAAjB,CAA0B3b,CAA1B,CAAkC,CAC9C,KAAMqW,GAAA,CAAe,QAAf,CAAyDrW,CAAA8L,IAAzD,CAAN,CAD8C,CArDlD,CAyDA,OAAO8P,SAA0B,CAACC,CAAD,CAAoBze,CAApB,CAA2B9F,CAA3B,CAAiCwkB,CAAjC,CAA8ClK,CAA9C,CAA0D,CACrFiJ,CAAJ,EACEA,CAAAnmB,KAAA,CAAe0I,CAAf,CAGA,CAFAyd,CAAAnmB,KAAA,CAAe4C,CAAf,CAEA,CADAujB,CAAAnmB,KAAA,CAAeonB,CAAf,CACA,CAAAjB,CAAAnmB,KAAA,CAAekd,CAAf,CAJF,EAMEkJ,CAAA,CAAwBC,CAAxB,CAAkD3d,CAAlD,CAAyD9F,CAAzD,CAA+DwkB,CAA/D,CAA4ElK,CAA5E,CAPuF,CAzEP,CAyFtFkE,QAASA,EAAU,CAACiG,CAAD,CAAIC,CAAJ,CAAO,CACxB,IAAIC,EAAOD,CAAAtK,SAAPuK,CAAoBF,CAAArK,SACxB,OAAa,EAAb,GAAIuK,CAAJ,CAAuBA,CAAvB,CACIF,CAAAzf,KAAJ,GAAe0f,CAAA1f,KAAf,CAA+Byf,CAAAzf,KAAD,CAAU0f,CAAA1f,KAAV,CAAqB,EAArB,CAAyB,CAAvD,CACOyf,CAAA7mB,MADP,CACiB8mB,CAAA9mB,MAJO,CAQ1BwkB,QAASA,EAAiB,CAACwC,CAAD,CAAOC,CAAP,CAA0B/K,CAA1B,CAAqC5W,CAArC,CAA8C,CACtE,GAAI2hB,CAAJ,CACE,KAAM9F,GAAA,CAAe,UAAf,CACF8F,CAAA7f,KADE,CACsB8U,CAAA9U,KADtB,CACsC4f,CADtC,CAC4C3hB,EAAA,CAAYC,CAAZ,CAD5C,CAAN,CAFoE,CAQxEqb,QAASA,EAA2B,CAACpE,CAAD,CAAa2K,CAAb,CAAmB,CACrD,IAAIC,EAAgBpK,CAAA,CAAamK,CAAb,CAAmB,CAAA,CAAnB,CAChBC,EAAJ,EACE5K,CAAA/c,KAAA,CAAgB,UACJ,CADI,SAEL+B,EAAA,CAAQ6lB,QAA8B,CAAClf,CAAD,CAAQ9F,CAAR,CAAc,CAAA,IACvDlB,EAASkB,CAAAlB,OAAA,EAD8C,CAEvDmmB,EAAWnmB,CAAAoH,KAAA,CAAY,UAAZ,CAAX+e,EAAsC,EAC1CA,EAAA7nB,KAAA,CAAc2nB,CAAd,CACA/I,EAAA,CAAald,CAAAoH,KAAA,CAAY,UAAZ,CAAwB+e,CAAxB,CAAb,CAAgD,YAAhD,CACAnf,EAAA/E,OAAA,CAAagkB,CAAb,CAA4BG,QAAiC,CAACxnB,CAAD,CAAQ,CACnEsC,CAAA,CAAK,CAAL,CAAAub,UAAA;AAAoB7d,CAD+C,CAArE,CAL2D,CAApD,CAFK,CAAhB,CAHmD,CAmBvDynB,QAASA,EAAiB,CAACnlB,CAAD,CAAOolB,CAAP,CAA2B,CAEnD,GAA0B,WAA1B,EAAIA,CAAJ,EACwB,KADxB,EACKzH,EAAA,CAAU3d,CAAV,CADL,GACwD,KADxD,EACkColB,CADlC,EAEwD,OAFxD,EAEkCA,CAFlC,EAGE,MAAOpK,EAAAqK,aAL0C,CAUrD/G,QAASA,EAA2B,CAACte,CAAD,CAAOma,CAAP,CAAmBzc,CAAnB,CAA0BsH,CAA1B,CAAgC,CAClE,IAAI+f,EAAgBpK,CAAA,CAAajd,CAAb,CAAoB,CAAA,CAApB,CAGpB,IAAKqnB,CAAL,CAAA,CAGA,GAAa,UAAb,GAAI/f,CAAJ,EAA+C,QAA/C,GAA2B2Y,EAAA,CAAU3d,CAAV,CAA3B,CACE,KAAM+e,GAAA,CAAe,UAAf,CACF9b,EAAA,CAAYjD,CAAZ,CADE,CAAN,CAIFma,CAAA/c,KAAA,CAAgB,UACH,IADG,SAEL+B,EAAA,CAAQmmB,QAA8B,CAACxf,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CAChE2b,CAAAA,CAAe3b,CAAA2b,YAAfA,GAAoC3b,CAAA2b,YAApCA,CAAuD,EAAvDA,CAEJ,IAAIpH,CAAAxT,KAAA,CAA+BrB,CAA/B,CAAJ,CACE,KAAM+Z,GAAA,CAAe,aAAf,CAAN,CAWF,GAJAgG,CAIA,CAJgBpK,CAAA,CAAarV,CAAA,CAAKN,CAAL,CAAb,CAAyB,CAAA,CAAzB,CAA+BmgB,CAAA,CAAkBnlB,CAAlB,CAAwBgF,CAAxB,CAA/B,CAIhB,CAGAM,CAAA,CAAKN,CAAL,CAEC,CAFY+f,CAAA,CAAcjf,CAAd,CAEZ,CADAyf,CAAAtE,CAAA,CAAYjc,CAAZ,CAAAugB,GAAsBtE,CAAA,CAAYjc,CAAZ,CAAtBugB,CAA0C,EAA1CA,UACA,CADyD,CAAA,CACzD,CAAAxkB,CAAAuE,CAAA2b,YAAAlgB,EAAoBuE,CAAA2b,YAAA,CAAiBjc,CAAjB,CAAAkc,QAApBngB,EAAsD+E,CAAtD/E,QAAA,CACQgkB,CADR,CACuBG,QAAiC,CAACxnB,CAAD,CAAQ,CAC7D4H,CAAA+d,KAAA,CAAUre,CAAV,CAAgBtH,CAAhB,CAD6D,CADhE,CApBmE,CAA7D,CAFK,CAAhB,CARA,CAJkE,CAqDpE4kB,QAASA,GAAW,CAAClG,CAAD,CAAeoJ,CAAf,CAAiCC,CAAjC,CAA0C,CAAA,IACxDC,EAAuBF,CAAA,CAAiB,CAAjB,CADiC;AAExDG,EAAcH,CAAAjpB,OAF0C,CAGxDuC,EAAS4mB,CAAAE,WAH+C,CAIxDroB,CAJwD,CAIrDiT,CAEP,IAAI4L,CAAJ,CACE,IAAI7e,CAAO,CAAH,CAAG,CAAAiT,CAAA,CAAK4L,CAAA7f,OAAhB,CAAqCgB,CAArC,CAAyCiT,CAAzC,CAA6CjT,CAAA,EAA7C,CACE,GAAI6e,CAAA,CAAa7e,CAAb,CAAJ,EAAuBmoB,CAAvB,CAA6C,CAC3CtJ,CAAA,CAAa7e,CAAA,EAAb,CAAA,CAAoBkoB,CACJI,EAAAA,CAAK/H,CAAL+H,CAASF,CAATE,CAAuB,CAAvC,KAAK,IACI9H,EAAK3B,CAAA7f,OADd,CAEKuhB,CAFL,CAESC,CAFT,CAEaD,CAAA,EAAA,CAAK+H,CAAA,EAFlB,CAGMA,CAAJ,CAAS9H,CAAT,CACE3B,CAAA,CAAa0B,CAAb,CADF,CACoB1B,CAAA,CAAayJ,CAAb,CADpB,CAGE,OAAOzJ,CAAA,CAAa0B,CAAb,CAGX1B,EAAA7f,OAAA,EAAuBopB,CAAvB,CAAqC,CACrC,MAZ2C,CAiB7C7mB,CAAJ,EACEA,CAAAgnB,aAAA,CAAoBL,CAApB,CAA6BC,CAA7B,CAEE3a,EAAAA,CAAW9O,CAAA+O,uBAAA,EACfD,EAAAgb,YAAA,CAAqBL,CAArB,CACAD,EAAA,CAAQtiB,CAAA6iB,QAAR,CAAA,CAA0BN,CAAA,CAAqBviB,CAAA6iB,QAArB,CACjBC,EAAAA,CAAI,CAAb,KAAgBC,CAAhB,CAAqBV,CAAAjpB,OAArB,CAA8C0pB,CAA9C,CAAkDC,CAAlD,CAAsDD,CAAA,EAAtD,CACM/iB,CAGJ,CAHcsiB,CAAA,CAAiBS,CAAjB,CAGd,CAFA9iB,CAAA,CAAOD,CAAP,CAAA4V,OAAA,EAEA,CADA/N,CAAAgb,YAAA,CAAqB7iB,CAArB,CACA,CAAA,OAAOsiB,CAAA,CAAiBS,CAAjB,CAGTT,EAAA,CAAiB,CAAjB,CAAA,CAAsBC,CACtBD,EAAAjpB,OAAA,CAA0B,CAvCkC,CAtlC9D,IAAI4gB,EAAaA,QAAQ,CAACja,CAAD,CAAUoC,CAAV,CAAgB,CACvC,IAAA6a,UAAA,CAAiBjd,CACjB,KAAAsa,MAAA,CAAalY,CAAb,EAAqB,EAFkB,CAKzC6X,EAAA7L,UAAA,CAAuB,YACToM,EADS,WAgBTyI,QAAQ,CAACC,CAAD,CAAW,CAC1BA,CAAH,EAAiC,CAAjC,CAAeA,CAAA7pB,OAAf,EACE0e,CAAAiB,SAAA,CAAkB,IAAAiE,UAAlB;AAAkCiG,CAAlC,CAF2B,CAhBV,cAkCNC,QAAQ,CAACD,CAAD,CAAW,CAC7BA,CAAH,EAAiC,CAAjC,CAAeA,CAAA7pB,OAAf,EACE0e,CAAAqL,YAAA,CAAqB,IAAAnG,UAArB,CAAqCiG,CAArC,CAF8B,CAlCb,MAiDf/C,QAAQ,CAACvmB,CAAD,CAAMY,CAAN,CAAa6oB,CAAb,CAAwB7F,CAAxB,CAAkC,CAmE9C8F,QAASA,EAAe,CAACC,CAAD,CAAOC,CAAP,CAAa,CAAA,IAC/BC,EAAS,EADsB,CAE/BC,EAAUH,CAAAxiB,MAAA,CAAW,KAAX,CAFqB,CAG/B4iB,EAAUH,CAAAziB,MAAA,CAAW,KAAX,CAHqB,CAM3B1G,EAAE,CADV,EAAA,CACA,IAAA,CAAYA,CAAZ,CAAcqpB,CAAArqB,OAAd,CAA6BgB,CAAA,EAA7B,CAAkC,CAEhC,IADA,IAAIupB,EAAQF,CAAA,CAAQrpB,CAAR,CAAZ,CACQugB,EAAE,CAAV,CAAYA,CAAZ,CAAc+I,CAAAtqB,OAAd,CAA6BuhB,CAAA,EAA7B,CACE,GAAGgJ,CAAH,EAAYD,CAAA,CAAQ/I,CAAR,CAAZ,CAAwB,SAAS,CAEnC6I,EAAAvpB,KAAA,CAAY0pB,CAAZ,CALgC,CAOlC,MAAOH,EAb4B,CA/DrC,GAAU,OAAV,EAAG7pB,CAAH,CACEY,CAGA,CAHQA,CAGR,EAHiB,EAGjB,CAFIqpB,CAEJ,CAFc,IAAA5G,UAAA7a,KAAA,CAAoB,OAApB,CAEd,EAF8C,EAE9C,CADA,IAAA+gB,aAAA,CAAkBG,CAAA,CAAgBO,CAAhB,CAAyBrpB,CAAzB,CAAAM,KAAA,CAAqC,GAArC,CAAlB,CACA,CAAA,IAAAmoB,UAAA,CAAeK,CAAA,CAAgB9oB,CAAhB,CAAuBqpB,CAAvB,CAAA/oB,KAAA,CAAqC,GAArC,CAAf,CAJF,KAKO,CAAA,IACDgpB,EAAa5Z,EAAA,CAAmB,IAAA+S,UAAA,CAAe,CAAf,CAAnB,CAAsCrjB,CAAtC,CAIbkqB,EAAJ,GACE,IAAA7G,UAAA8G,KAAA,CAAoBnqB,CAApB,CAAyBY,CAAzB,CACA,CAAAgjB,CAAA,CAAWsG,CAFb,CAKA,KAAA,CAAKlqB,CAAL,CAAA,CAAYY,CAGRgjB,EAAJ,CACE,IAAAlD,MAAA,CAAW1gB,CAAX,CADF,CACoB4jB,CADpB,EAGEA,CAHF,CAGa,IAAAlD,MAAA,CAAW1gB,CAAX,CAHb;CAKI,IAAA0gB,MAAA,CAAW1gB,CAAX,CALJ,CAKsB4jB,CALtB,CAKiCha,EAAA,CAAW5J,CAAX,CAAgB,GAAhB,CALjC,CASAmD,EAAA,CAAW0d,EAAA,CAAU,IAAAwC,UAAV,CAGX,IAAkB,GAAlB,GAAKlgB,CAAL,EAAiC,MAAjC,GAAyBnD,CAAzB,EACkB,KADlB,GACKmD,CADL,EACmC,KADnC,GAC2BnD,CAD3B,CAGE,GAAI,CAACwR,CAAL,EAAqB,CAArB,EAAaA,CAAb,CACE4Y,CACA,CADgBC,EAAA,CAAWzpB,CAAX,CAAA8X,KAChB,CAAsB,EAAtB,GAAI0R,CAAJ,GACe,MADf,GACOpqB,CADP,EAC0B,CAAAoqB,CAAAxjB,MAAA,CAAoBiW,CAApB,CAD1B,EAEe,KAFf,GAEO7c,CAFP,EAEyB,CAAAoqB,CAAAxjB,MAAA,CAAoBkW,CAApB,CAFzB,IAGI,IAAA,CAAK9c,CAAL,CAHJ,CAGgBY,CAHhB,CAGwB,SAHxB,CAGoCwpB,CAHpC,CASc,EAAA,CAAlB,GAAIX,CAAJ,GACgB,IAAd,GAAI7oB,CAAJ,EAAsBA,CAAtB,GAAgCxB,CAAhC,CACE,IAAAikB,UAAAiH,WAAA,CAA0B1G,CAA1B,CADF,CAGE,IAAAP,UAAA7a,KAAA,CAAoBob,CAApB,CAA8BhjB,CAA9B,CAJJ,CAvCK,CAkDP,CADIujB,CACJ,CADkB,IAAAA,YAClB,GAAetkB,CAAA,CAAQskB,CAAA,CAAYnkB,CAAZ,CAAR,CAA0B,QAAQ,CAACkF,CAAD,CAAK,CACpD,GAAI,CACFA,CAAA,CAAGtE,CAAH,CADE,CAEF,MAAO4F,CAAP,CAAU,CACV4W,CAAA,CAAkB5W,CAAlB,CADU,CAHwC,CAAvC,CA3D+B,CAjD3B,UAyJX0d,QAAQ,CAAClkB,CAAD,CAAMkF,CAAN,CAAU,CAAA,IACtBib,EAAQ,IADc,CAEtBgE,EAAehE,CAAAgE,YAAfA,GAAqChE,CAAAgE,YAArCA,CAAyD,EAAzDA,CAFsB,CAGtBoG,EAAapG,CAAA,CAAYnkB,CAAZ,CAAbuqB,GAAkCpG,CAAA,CAAYnkB,CAAZ,CAAlCuqB,CAAqD,EAArDA,CAEJA,EAAAjqB,KAAA,CAAe4E,CAAf,CACA2Q,EAAA7R,WAAA,CAAsB,QAAQ,EAAG,CAC1BumB,CAAA9B,QAAL,EAEEvjB,CAAA,CAAGib,CAAA,CAAMngB,CAAN,CAAH,CAH6B,CAAjC,CAMA,OAAOkF,EAZmB,CAzJP,CAP8C;IAgLjEslB,EAAc3M,CAAA2M,YAAA,EAhLmD,CAiLjEC,EAAY5M,CAAA4M,UAAA,EAjLqD,CAkLjE7E,GAAsC,IAChB,EADC4E,CACD,EADsC,IACtC,EADwBC,CACxB,CAAhBtoB,EAAgB,CAChByjB,QAA4B,CAACD,CAAD,CAAW,CACvC,MAAOA,EAAA9e,QAAA,CAAiB,OAAjB,CAA0B2jB,CAA1B,CAAA3jB,QAAA,CAA+C,KAA/C,CAAsD4jB,CAAtD,CADgC,CApLoB,CAuLjEnJ,GAAkB,cAGtB,OAAOrY,EA1L8D,CAJ3D,CA/HsB,CAmxCpC2X,QAASA,GAAkB,CAAC1Y,CAAD,CAAO,CAChC,MAAO6D,GAAA,CAAU7D,CAAArB,QAAA,CAAa6jB,EAAb,CAA4B,EAA5B,CAAV,CADyB,CAwElCC,QAASA,GAAmB,EAAG,CAAA,IACzBtI,EAAc,EADW,CAEzBuI,EAAY,yBAYhB,KAAAC,SAAA,CAAgBC,QAAQ,CAAC5iB,CAAD,CAAOqC,CAAP,CAAoB,CAC1CC,EAAA,CAAwBtC,CAAxB,CAA8B,YAA9B,CACI1F,EAAA,CAAS0F,CAAT,CAAJ,CACEzG,CAAA,CAAO4gB,CAAP,CAAoBna,CAApB,CADF,CAGEma,CAAA,CAAYna,CAAZ,CAHF,CAGsBqC,CALoB,CAU5C,KAAAwI,KAAA,CAAY,CAAC,WAAD,CAAc,SAAd,CAAyB,QAAQ,CAAC6B,CAAD,CAAYe,CAAZ,CAAqB,CAyBhE,MAAO,SAAQ,CAACoV,CAAD,CAAa5W,CAAb,CAAqB,CAAA,IAC9BM,CAD8B,CACblK,CADa,CACAygB,CAE/BrrB,EAAA,CAASorB,CAAT,CAAH,GACEnkB,CAOA,CAPQmkB,CAAAnkB,MAAA,CAAiBgkB,CAAjB,CAOR,CANArgB,CAMA,CANc3D,CAAA,CAAM,CAAN,CAMd,CALAokB,CAKA,CALapkB,CAAA,CAAM,CAAN,CAKb,CAJAmkB,CAIA,CAJa1I,CAAAniB,eAAA,CAA2BqK,CAA3B,CACA,CAAP8X,CAAA,CAAY9X,CAAZ,CAAO,CACPE,EAAA,CAAO0J,CAAAwQ,OAAP,CAAsBpa,CAAtB,CAAmC,CAAA,CAAnC,CADO,EACqCE,EAAA,CAAOkL,CAAP,CAAgBpL,CAAhB,CAA6B,CAAA,CAA7B,CAElD,CAAAF,EAAA,CAAY0gB,CAAZ,CAAwBxgB,CAAxB,CAAqC,CAAA,CAArC,CARF,CAWAkK,EAAA,CAAWG,CAAA9B,YAAA,CAAsBiY,CAAtB;AAAkC5W,CAAlC,CAEX,IAAI6W,CAAJ,CAAgB,CACd,GAAM7W,CAAAA,CAAN,EAAwC,QAAxC,EAAgB,MAAOA,EAAAwQ,OAAvB,CACE,KAAMtlB,EAAA,CAAO,aAAP,CAAA,CAAsB,OAAtB,CAAmHkL,CAAnH,EAAkIwgB,CAAA7iB,KAAlI,CAAmJ8iB,CAAnJ,CAAN,CAGF7W,CAAAwQ,OAAA,CAAcqG,CAAd,CAAA,CAA4BvW,CALd,CAQhB,MAAOA,EAxB2B,CAzB4B,CAAtD,CAxBiB,CAuF/BwW,QAASA,GAAiB,EAAE,CAC1B,IAAAlY,KAAA,CAAY,CAAC,SAAD,CAAY,QAAQ,CAAC7T,CAAD,CAAQ,CACtC,MAAOmH,EAAA,CAAOnH,CAAAC,SAAP,CAD+B,CAA5B,CADc,CAsC5B+rB,QAASA,GAAyB,EAAG,CACnC,IAAAnY,KAAA,CAAY,CAAC,MAAD,CAAS,QAAQ,CAAC0D,CAAD,CAAO,CAClC,MAAO,SAAQ,CAAC0U,CAAD,CAAYC,CAAZ,CAAmB,CAChC3U,CAAAM,MAAAnU,MAAA,CAAiB6T,CAAjB,CAAuB9U,SAAvB,CADgC,CADA,CAAxB,CADuB,CAcrC0pB,QAASA,GAAY,CAAC9D,CAAD,CAAU,CAAA,IACzB+D,EAAS,EADgB,CACZtrB,CADY,CACPwF,CADO,CACF/E,CAE3B,IAAI,CAAC8mB,CAAL,CAAc,MAAO+D,EAErBzrB,EAAA,CAAQ0nB,CAAApgB,MAAA,CAAc,IAAd,CAAR,CAA6B,QAAQ,CAACokB,CAAD,CAAO,CAC1C9qB,CAAA,CAAI8qB,CAAA9nB,QAAA,CAAa,GAAb,CACJzD,EAAA,CAAMkG,CAAA,CAAU8J,EAAA,CAAKub,CAAA/mB,OAAA,CAAY,CAAZ,CAAe/D,CAAf,CAAL,CAAV,CACN+E,EAAA,CAAMwK,EAAA,CAAKub,CAAA/mB,OAAA,CAAY/D,CAAZ,CAAgB,CAAhB,CAAL,CAEFT,EAAJ,GAEIsrB,CAAA,CAAOtrB,CAAP,CAFJ,CACMsrB,CAAA,CAAOtrB,CAAP,CAAJ,CACEsrB,CAAA,CAAOtrB,CAAP,CADF,EACiB,IADjB,CACwBwF,CADxB,EAGgBA,CAJlB,CAL0C,CAA5C,CAcA,OAAO8lB,EAnBsB,CAmC/BE,QAASA,GAAa,CAACjE,CAAD,CAAU,CAC9B,IAAIkE,EAAajpB,CAAA,CAAS+kB,CAAT,CAAA,CAAoBA,CAApB,CAA8BnoB,CAE/C,OAAO,SAAQ,CAAC8I,CAAD,CAAO,CACfujB,CAAL;CAAiBA,CAAjB,CAA+BJ,EAAA,CAAa9D,CAAb,CAA/B,CAEA,OAAIrf,EAAJ,CACSujB,CAAA,CAAWvlB,CAAA,CAAUgC,CAAV,CAAX,CADT,EACwC,IADxC,CAIOujB,CAPa,CAHQ,CAyBhCC,QAASA,GAAa,CAACtiB,CAAD,CAAOme,CAAP,CAAgBoE,CAAhB,CAAqB,CACzC,GAAI1rB,CAAA,CAAW0rB,CAAX,CAAJ,CACE,MAAOA,EAAA,CAAIviB,CAAJ,CAAUme,CAAV,CAET1nB,EAAA,CAAQ8rB,CAAR,CAAa,QAAQ,CAACzmB,CAAD,CAAK,CACxBkE,CAAA,CAAOlE,CAAA,CAAGkE,CAAH,CAASme,CAAT,CADiB,CAA1B,CAIA,OAAOne,EARkC,CAiB3CwiB,QAASA,GAAa,EAAG,CAAA,IACnBC,EAAa,kBADM,CAEnBC,EAAW,YAFQ,CAGnBC,EAAoB,cAHD,CAInBC,EAAgC,CAAC,cAAD,CAAiB,gCAAjB,CAJb,CAMnBC,EAAW,IAAAA,SAAXA,CAA2B,mBAEV,CAAC,QAAQ,CAAC7iB,CAAD,CAAO,CAC7BzJ,CAAA,CAASyJ,CAAT,CAAJ,GAEEA,CACA,CADOA,CAAAvC,QAAA,CAAaklB,CAAb,CAAgC,EAAhC,CACP,CAAIF,CAAAtiB,KAAA,CAAgBH,CAAhB,CAAJ,EAA6B0iB,CAAAviB,KAAA,CAAcH,CAAd,CAA7B,GACEA,CADF,CACSvD,EAAA,CAASuD,CAAT,CADT,CAHF,CAMA,OAAOA,EAP0B,CAAhB,CAFU,kBAaX,CAAC,QAAQ,CAAC8iB,CAAD,CAAI,CAC7B,MAAO1pB,EAAA,CAAS0pB,CAAT,CAAA,EA/6KoB,eA+6KpB,GA/6KJvpB,EAAAC,MAAA,CA+6K2BspB,CA/6K3B,CA+6KI,CAA4BzmB,EAAA,CAAOymB,CAAP,CAA5B,CAAwCA,CADlB,CAAb,CAbW,SAkBpB,QACC,QACI,mCADJ,CADD,MAICF,CAJD;IAKCA,CALD,OAMCA,CAND,CAlBoB,gBA2Bb,YA3Ba,gBA4Bb,cA5Ba,CANR,CAyCnBG,EAAuB,IAAAC,aAAvBD,CAA2C,EAzCxB,CA+CnBE,EAA+B,IAAAC,qBAA/BD,CAA2D,EAE/D,KAAAtZ,KAAA,CAAY,CAAC,cAAD,CAAiB,UAAjB,CAA6B,eAA7B,CAA8C,YAA9C,CAA4D,IAA5D,CAAkE,WAAlE,CACR,QAAQ,CAACwZ,CAAD,CAAeC,CAAf,CAAyBjQ,CAAzB,CAAwC1G,CAAxC,CAAoD4W,CAApD,CAAwD7X,CAAxD,CAAmE,CAyf7EkJ,QAASA,EAAK,CAAC4O,CAAD,CAAgB,CA4E5BC,QAASA,EAAiB,CAACtF,CAAD,CAAW,CAEnC,IAAIuF,EAAOnrB,CAAA,CAAO,EAAP,CAAW4lB,CAAX,CAAqB,MACxBqE,EAAA,CAAcrE,CAAAje,KAAd,CAA6Bie,CAAAE,QAA7B,CAA+C3b,CAAA+gB,kBAA/C,CADwB,CAArB,CAGX,OAhoBC,IAioBM,EADWtF,CAAAwF,OACX,EAjoBoB,GAioBpB,CADWxF,CAAAwF,OACX,CAAHD,CAAG,CACHH,CAAAK,OAAA,CAAUF,CAAV,CAP+B,CA3ErC,IAAIhhB,EAAS,kBACOqgB,CAAAc,iBADP,mBAEQd,CAAAU,kBAFR,CAAb,CAIIpF,EAiFJyF,QAAqB,CAACphB,CAAD,CAAS,CA2B5BqhB,QAASA,EAAW,CAAC1F,CAAD,CAAU,CAC5B,IAAI2F,CAEJrtB,EAAA,CAAQ0nB,CAAR,CAAiB,QAAQ,CAAC4F,CAAD;AAAWC,CAAX,CAAmB,CACtCntB,CAAA,CAAWktB,CAAX,CAAJ,GACED,CACA,CADgBC,CAAA,EAChB,CAAqB,IAArB,EAAID,CAAJ,CACE3F,CAAA,CAAQ6F,CAAR,CADF,CACoBF,CADpB,CAGE,OAAO3F,CAAA,CAAQ6F,CAAR,CALX,CAD0C,CAA5C,CAH4B,CA3BF,IACxBC,EAAapB,CAAA1E,QADW,CAExB+F,EAAa7rB,CAAA,CAAO,EAAP,CAAWmK,CAAA2b,QAAX,CAFW,CAGxBgG,CAHwB,CAGeC,CAHf,CAK5BH,EAAa5rB,CAAA,CAAO,EAAP,CAAW4rB,CAAAI,OAAX,CAA8BJ,CAAA,CAAWnnB,CAAA,CAAU0F,CAAAL,OAAV,CAAX,CAA9B,CAGb0hB,EAAA,CAAYI,CAAZ,CACAJ,EAAA,CAAYK,CAAZ,CAGA,EAAA,CACA,IAAKC,CAAL,GAAsBF,EAAtB,CAAkC,CAChCK,CAAA,CAAyBxnB,CAAA,CAAUqnB,CAAV,CAEzB,KAAKC,CAAL,GAAsBF,EAAtB,CACE,GAAIpnB,CAAA,CAAUsnB,CAAV,CAAJ,GAAiCE,CAAjC,CACE,SAAS,CAIbJ,EAAA,CAAWC,CAAX,CAAA,CAA4BF,CAAA,CAAWE,CAAX,CATI,CAYlC,MAAOD,EAzBqB,CAjFhB,CAAaZ,CAAb,CAEdjrB,EAAA,CAAOmK,CAAP,CAAe8gB,CAAf,CACA9gB,EAAA2b,QAAA,CAAiBA,CACjB3b,EAAAL,OAAA,CAAgBoiB,EAAA,CAAU/hB,CAAAL,OAAV,CAKhB,EAHIqiB,CAGJ,CAHgBC,EAAA,CAAgBjiB,CAAA8L,IAAhB,CACA,CAAV8U,CAAAhT,QAAA,EAAA,CAAmB5N,CAAAkiB,eAAnB,EAA4C7B,CAAA6B,eAA5C,CAAU,CACV1uB,CACN,IACEmoB,CAAA,CAAS3b,CAAAmiB,eAAT,EAAkC9B,CAAA8B,eAAlC,CADF,CACgEH,CADhE,CA0BA,KAAII,EAAQ,CArBQC,QAAQ,CAACriB,CAAD,CAAS,CACnC2b,CAAA,CAAU3b,CAAA2b,QACV,KAAI2G,EAAUxC,EAAA,CAAc9f,CAAAxC,KAAd,CAA2BoiB,EAAA,CAAcjE,CAAd,CAA3B,CAAmD3b,CAAAmhB,iBAAnD,CAGVzqB,EAAA,CAAYsJ,CAAAxC,KAAZ,CAAJ,EACEvJ,CAAA,CAAQ0nB,CAAR,CAAiB,QAAQ,CAAC3mB,CAAD,CAAQwsB,CAAR,CAAgB,CACb,cAA1B,GAAIlnB,CAAA,CAAUknB,CAAV,CAAJ,EACI,OAAO7F,CAAA,CAAQ6F,CAAR,CAF4B,CAAzC,CAOE9qB,EAAA,CAAYsJ,CAAAuiB,gBAAZ,CAAJ;AAA4C,CAAA7rB,CAAA,CAAY2pB,CAAAkC,gBAAZ,CAA5C,GACEviB,CAAAuiB,gBADF,CAC2BlC,CAAAkC,gBAD3B,CAKA,OAAOC,EAAA,CAAQxiB,CAAR,CAAgBsiB,CAAhB,CAAyB3G,CAAzB,CAAA8G,KAAA,CAAuC1B,CAAvC,CAA0DA,CAA1D,CAlB4B,CAqBzB,CAAgBvtB,CAAhB,CAAZ,CACIkvB,EAAU7B,CAAA8B,KAAA,CAAQ3iB,CAAR,CAYd,KATA/L,CAAA,CAAQ2uB,CAAR,CAA8B,QAAQ,CAACC,CAAD,CAAc,CAClD,CAAIA,CAAAC,QAAJ,EAA2BD,CAAAE,aAA3B,GACEX,CAAA3sB,QAAA,CAAcotB,CAAAC,QAAd,CAAmCD,CAAAE,aAAnC,CAEF,EAAIF,CAAApH,SAAJ,EAA4BoH,CAAAG,cAA5B,GACEZ,CAAA1tB,KAAA,CAAWmuB,CAAApH,SAAX,CAAiCoH,CAAAG,cAAjC,CALgD,CAApD,CASA,CAAMZ,CAAAvuB,OAAN,CAAA,CAAoB,CACdovB,CAAAA,CAASb,CAAA9gB,MAAA,EACb,KAAI4hB,EAAWd,CAAA9gB,MAAA,EAAf,CAEAohB,EAAUA,CAAAD,KAAA,CAAaQ,CAAb,CAAqBC,CAArB,CAJQ,CAOpBR,CAAAtH,QAAA,CAAkB+H,QAAQ,CAAC7pB,CAAD,CAAK,CAC7BopB,CAAAD,KAAA,CAAa,QAAQ,CAAChH,CAAD,CAAW,CAC9BniB,CAAA,CAAGmiB,CAAAje,KAAH,CAAkBie,CAAAwF,OAAlB,CAAmCxF,CAAAE,QAAnC,CAAqD3b,CAArD,CAD8B,CAAhC,CAGA,OAAO0iB,EAJsB,CAO/BA,EAAAvX,MAAA,CAAgBiY,QAAQ,CAAC9pB,CAAD,CAAK,CAC3BopB,CAAAD,KAAA,CAAa,IAAb,CAAmB,QAAQ,CAAChH,CAAD,CAAW,CACpCniB,CAAA,CAAGmiB,CAAAje,KAAH,CAAkBie,CAAAwF,OAAlB,CAAmCxF,CAAAE,QAAnC,CAAqD3b,CAArD,CADoC,CAAtC,CAGA,OAAO0iB,EAJoB,CAO7B,OAAOA,EA1EqB,CAuQ9BF,QAASA,EAAO,CAACxiB,CAAD;AAASsiB,CAAT,CAAkBZ,CAAlB,CAA8B,CAqD5C2B,QAASA,EAAI,CAACpC,CAAD,CAASxF,CAAT,CAAmB6H,CAAnB,CAAkC,CACzCnb,CAAJ,GA52BC,GA62BC,EAAc8Y,CAAd,EA72ByB,GA62BzB,CAAcA,CAAd,CACE9Y,CAAAlC,IAAA,CAAU6F,CAAV,CAAe,CAACmV,CAAD,CAASxF,CAAT,CAAmBgE,EAAA,CAAa6D,CAAb,CAAnB,CAAf,CADF,CAIEnb,CAAAiI,OAAA,CAAatE,CAAb,CALJ,CASAyX,EAAA,CAAe9H,CAAf,CAAyBwF,CAAzB,CAAiCqC,CAAjC,CACKrZ,EAAAuZ,QAAL,EAAyBvZ,CAAA1M,OAAA,EAXoB,CAkB/CgmB,QAASA,EAAc,CAAC9H,CAAD,CAAWwF,CAAX,CAAmBtF,CAAnB,CAA4B,CAEjDsF,CAAA,CAAS7G,IAAAC,IAAA,CAAS4G,CAAT,CAAiB,CAAjB,CAER,EAj4BA,GAi4BA,EAAUA,CAAV,EAj4B0B,GAi4B1B,CAAUA,CAAV,CAAoBwC,CAAAC,QAApB,CAAuCD,CAAAvC,OAAvC,EAAwD,MACjDzF,CADiD,QAE/CwF,CAF+C,SAG9CrB,EAAA,CAAcjE,CAAd,CAH8C,QAI/C3b,CAJ+C,CAAxD,CAJgD,CAanD2jB,QAASA,EAAgB,EAAG,CAC1B,IAAIC,EAAM/rB,EAAA,CAAQqa,CAAA2R,gBAAR,CAA+B7jB,CAA/B,CACG,GAAb,GAAI4jB,CAAJ,EAAgB1R,CAAA2R,gBAAA7rB,OAAA,CAA6B4rB,CAA7B,CAAkC,CAAlC,CAFU,CApFgB,IACxCH,EAAW5C,CAAAxS,MAAA,EAD6B,CAExCqU,EAAUe,CAAAf,QAF8B,CAGxCva,CAHwC,CAIxC2b,CAJwC,CAKxChY,EAAMiY,CAAA,CAAS/jB,CAAA8L,IAAT,CAAqB9L,CAAAgkB,OAArB,CAEV9R,EAAA2R,gBAAAnvB,KAAA,CAA2BsL,CAA3B,CACA0iB,EAAAD,KAAA,CAAakB,CAAb,CAA+BA,CAA/B,CAGA,EAAK3jB,CAAAmI,MAAL,EAAqBkY,CAAAlY,MAArB,IAAyD,CAAA,CAAzD,GAAwCnI,CAAAmI,MAAxC,EAAmF,KAAnF,EAAkEnI,CAAAL,OAAlE,IACEwI,CADF,CACUvR,CAAA,CAASoJ,CAAAmI,MAAT,CAAA,CAAyBnI,CAAAmI,MAAzB,CACAvR,CAAA,CAASypB,CAAAlY,MAAT,CAAA,CAA2BkY,CAAAlY,MAA3B,CACA8b,CAHV,CAMA,IAAI9b,CAAJ,CAEE,GADA2b,CACI,CADS3b,CAAAV,IAAA,CAAUqE,CAAV,CACT;AAAAnV,CAAA,CAAUmtB,CAAV,CAAJ,CAA2B,CACzB,GAAIA,CAAArB,KAAJ,CAGE,MADAqB,EAAArB,KAAA,CAAgBkB,CAAhB,CAAkCA,CAAlC,CACOG,CAAAA,CAGH9vB,EAAA,CAAQ8vB,CAAR,CAAJ,CACEP,CAAA,CAAeO,CAAA,CAAW,CAAX,CAAf,CAA8BA,CAAA,CAAW,CAAX,CAA9B,CAA6C7rB,EAAA,CAAK6rB,CAAA,CAAW,CAAX,CAAL,CAA7C,CADF,CAGEP,CAAA,CAAeO,CAAf,CAA2B,GAA3B,CAAgC,EAAhC,CAVqB,CAA3B,IAeE3b,EAAAlC,IAAA,CAAU6F,CAAV,CAAe4W,CAAf,CAKAhsB,EAAA,CAAYotB,CAAZ,CAAJ,EACEnD,CAAA,CAAa3gB,CAAAL,OAAb,CAA4BmM,CAA5B,CAAiCwW,CAAjC,CAA0Ce,CAA1C,CAAgD3B,CAAhD,CAA4D1hB,CAAAkkB,QAA5D,CACIlkB,CAAAuiB,gBADJ,CAC4BviB,CAAAmkB,aAD5B,CAIF,OAAOzB,EA5CqC,CA2F9CqB,QAASA,EAAQ,CAACjY,CAAD,CAAMkY,CAAN,CAAc,CACzB,GAAI,CAACA,CAAL,CAAa,MAAOlY,EACpB,KAAIrQ,EAAQ,EACZ7G,GAAA,CAAcovB,CAAd,CAAsB,QAAQ,CAAChvB,CAAD,CAAQZ,CAAR,CAAa,CAC5B,IAAb,EAAIY,CAAJ,EAAqBA,CAArB,EAA8BxB,CAA9B,GACKQ,CAAA,CAAQgB,CAAR,CAEL,GAFqBA,CAErB,CAF6B,CAACA,CAAD,CAE7B,EAAAf,CAAA,CAAQe,CAAR,CAAe,QAAQ,CAACqF,CAAD,CAAI,CACrBzD,CAAA,CAASyD,CAAT,CAAJ,GACEA,CADF,CACMR,EAAA,CAAOQ,CAAP,CADN,CAGAoB,EAAA/G,KAAA,CAAWiH,EAAA,CAAevH,CAAf,CAAX,CAAiC,GAAjC,CACWuH,EAAA,CAAetB,CAAf,CADX,CAJyB,CAA3B,CAHA,CADyC,CAA3C,CAYA,OAAOyR,EAAP,EAAoC,EAAtB,EAACA,CAAAjU,QAAA,CAAY,GAAZ,CAAD,CAA2B,GAA3B,CAAiC,GAA/C,EAAsD4D,CAAAnG,KAAA,CAAW,GAAX,CAf7B,CAz1B/B,IAAI2uB,EAAetT,CAAA,CAAc,OAAd,CAAnB,CAOIiS,EAAuB,EAE3B3uB,EAAA,CAAQssB,CAAR,CAA8B,QAAQ,CAAC6D,CAAD,CAAqB,CACzDxB,CAAAntB,QAAA,CAA6B1B,CAAA,CAASqwB,CAAT,CACA,CAAvBpb,CAAAvB,IAAA,CAAc2c,CAAd,CAAuB,CAAapb,CAAA7L,OAAA,CAAiBinB,CAAjB,CAD1C,CADyD,CAA3D,CAKAnwB,EAAA,CAAQwsB,CAAR,CAAsC,QAAQ,CAAC2D,CAAD,CAAqBlvB,CAArB,CAA4B,CACxE,IAAImvB,EAAatwB,CAAA,CAASqwB,CAAT,CACA,CAAXpb,CAAAvB,IAAA,CAAc2c,CAAd,CAAW,CACXpb,CAAA7L,OAAA,CAAiBinB,CAAjB,CAONxB,EAAA5qB,OAAA,CAA4B9C,CAA5B;AAAmC,CAAnC,CAAsC,UAC1BumB,QAAQ,CAACA,CAAD,CAAW,CAC3B,MAAO4I,EAAA,CAAWxD,CAAA8B,KAAA,CAAQlH,CAAR,CAAX,CADoB,CADO,eAIrBuH,QAAQ,CAACvH,CAAD,CAAW,CAChC,MAAO4I,EAAA,CAAWxD,CAAAK,OAAA,CAAUzF,CAAV,CAAX,CADyB,CAJE,CAAtC,CAVwE,CAA1E,CA2mBAvJ,EAAA2R,gBAAA,CAAwB,EAsGxBS,UAA2B,CAACloB,CAAD,CAAQ,CACjCnI,CAAA,CAAQ8B,SAAR,CAAmB,QAAQ,CAACuG,CAAD,CAAO,CAChC4V,CAAA,CAAM5V,CAAN,CAAA,CAAc,QAAQ,CAACwP,CAAD,CAAM9L,CAAN,CAAc,CAClC,MAAOkS,EAAA,CAAMrc,CAAA,CAAOmK,CAAP,EAAiB,EAAjB,CAAqB,QACxB1D,CADwB,KAE3BwP,CAF2B,CAArB,CAAN,CAD2B,CADJ,CAAlC,CADiC,CAAnCwY,CAhDA,CAAmB,KAAnB,CAA0B,QAA1B,CAAoC,MAApC,CAA4C,OAA5C,CA4DAC,UAAmC,CAACjoB,CAAD,CAAO,CACxCrI,CAAA,CAAQ8B,SAAR,CAAmB,QAAQ,CAACuG,CAAD,CAAO,CAChC4V,CAAA,CAAM5V,CAAN,CAAA,CAAc,QAAQ,CAACwP,CAAD,CAAMtO,CAAN,CAAYwC,CAAZ,CAAoB,CACxC,MAAOkS,EAAA,CAAMrc,CAAA,CAAOmK,CAAP,EAAiB,EAAjB,CAAqB,QACxB1D,CADwB,KAE3BwP,CAF2B,MAG1BtO,CAH0B,CAArB,CAAN,CADiC,CADV,CAAlC,CADwC,CAA1C+mB,CA/BA,CAA2B,MAA3B,CAAmC,KAAnC,CAaArS,EAAAmO,SAAA,CAAiBA,CAGjB,OAAOnO,EA9tBsE,CADnE,CAjDW,CA47BzBsS,QAASA,GAAoB,EAAG,CAC9B,IAAArd,KAAA,CAAY,CAAC,UAAD,CAAa,SAAb,CAAwB,WAAxB,CAAqC,QAAQ,CAACyZ,CAAD,CAAW7W,CAAX,CAAoB8E,CAApB,CAA+B,CACtF,MAAO4V,GAAA,CAAkB7D,CAAlB,CAA4B8D,EAA5B,CAAiC9D,CAAAvS,MAAjC,CAAiDtE,CAAAnM,QAAA+mB,UAAjD;AACH9V,CAAA,CAAU,CAAV,CADG,CACW9E,CAAA7S,SAAA0tB,SAAA3pB,QAAA,CAAkC,GAAlC,CAAuC,EAAvC,CADX,CAD+E,CAA5E,CADkB,CAOhCwpB,QAASA,GAAiB,CAAC7D,CAAD,CAAW8D,CAAX,CAAgBG,CAAhB,CAA+BF,CAA/B,CAA0C1Y,CAA1C,CAAuD6Y,CAAvD,CAAyE,CAyFjGC,QAASA,EAAQ,CAACjZ,CAAD,CAAMuX,CAAN,CAAY,CAAA,IAIvB2B,EAAS/Y,CAAAlK,cAAA,CAA0B,QAA1B,CAJc,CAKvBkjB,EAAcA,QAAQ,EAAG,CACvBhZ,CAAAiZ,KAAAjjB,YAAA,CAA6B+iB,CAA7B,CACI3B,EAAJ,EAAUA,CAAA,EAFa,CAK7B2B,EAAApiB,KAAA,CAAc,iBACdoiB,EAAArsB,IAAA,CAAamT,CAETlG,EAAJ,CACEof,CAAAG,mBADF,CAC8BC,QAAQ,EAAG,CACjC,iBAAAznB,KAAA,CAAuBqnB,CAAAK,WAAvB,CAAJ,EAA+CJ,CAAA,EADV,CADzC,CAKED,CAAAM,OALF,CAKkBN,CAAAO,QALlB,CAKmCN,CAGnChZ,EAAAiZ,KAAA7H,YAAA,CAA6B2H,CAA7B,CACA,OAAOC,EAtBoB,CAvF7B,MAAO,SAAQ,CAACtlB,CAAD,CAASmM,CAAT,CAAcoL,CAAd,CAAoBvK,CAApB,CAA8BgP,CAA9B,CAAuCuI,CAAvC,CAAgD3B,CAAhD,CAAiE4B,CAAjE,CAA+E,CA+D5FqB,QAASA,EAAc,EAAG,CACxBvE,CAAA,CAAU,EACVwE,EAAA,EAAaA,CAAA,EACbC,EAAA,EAAOA,CAAAC,MAAA,EAHiB,CAM1BC,QAASA,EAAe,CAACjZ,CAAD,CAAWsU,CAAX,CAAmBxF,CAAnB,CAA6B6H,CAA7B,CAA4C,CAClE,IAAIsB,EAAWE,CAAXF,EAA+BnG,EAAA,CAAW3S,CAAX,CAAA8Y,SAGnCpW,EAAA,EAAaqW,CAAApW,OAAA,CAAqBD,CAArB,CACbiX,EAAA,CAAYC,CAAZ,CAAkB,IAGlBzE,EAAA,CAAsB,MAAb,EAAC2D,CAAD,CAAwBnJ,CAAA,CAAW,GAAX,CAAiB,GAAzC,CAAgDwF,CAKzDtU,EAAA,CAFmB,IAAVsU,EAAAA,CAAAA,CAAiB,GAAjBA,CAAuBA,CAEhC;AAAiBxF,CAAjB,CAA2B6H,CAA3B,CACA1C,EAAAtU,6BAAA,CAAsChW,CAAtC,CAdkE,CApEpE,IAAI2qB,CACJL,EAAArU,6BAAA,EACAT,EAAA,CAAMA,CAAN,EAAa8U,CAAA9U,IAAA,EAEb,IAAyB,OAAzB,EAAIxR,CAAA,CAAUqF,CAAV,CAAJ,CAAkC,CAChC,IAAIkmB,EAAa,GAAbA,CAAoB9uB,CAAA4tB,CAAAmB,QAAA,EAAA/uB,UAAA,CAA8B,EAA9B,CACxB4tB,EAAA,CAAUkB,CAAV,CAAA,CAAwB,QAAQ,CAACroB,CAAD,CAAO,CACrCmnB,CAAA,CAAUkB,CAAV,CAAAroB,KAAA,CAA6BA,CADQ,CAIvC,KAAIioB,EAAYV,CAAA,CAASjZ,CAAA7Q,QAAA,CAAY,eAAZ,CAA6B,oBAA7B,CAAoD4qB,CAApD,CAAT,CACZ,QAAQ,EAAG,CACTlB,CAAA,CAAUkB,CAAV,CAAAroB,KAAJ,CACEooB,CAAA,CAAgBjZ,CAAhB,CAA0B,GAA1B,CAA+BgY,CAAA,CAAUkB,CAAV,CAAAroB,KAA/B,CADF,CAGEooB,CAAA,CAAgBjZ,CAAhB,CAA0BsU,CAA1B,EAAqC,EAArC,CAEF,QAAO0D,CAAA,CAAUkB,CAAV,CANM,CADC,CANgB,CAAlC,IAeO,CACL,IAAIH,EAAM,IAAIhB,CACdgB,EAAAK,KAAA,CAASpmB,CAAT,CAAiBmM,CAAjB,CAAsB,CAAA,CAAtB,CACA7X,EAAA,CAAQ0nB,CAAR,CAAiB,QAAQ,CAAC3mB,CAAD,CAAQZ,CAAR,CAAa,CAChCuC,CAAA,CAAU3B,CAAV,CAAJ,EACI0wB,CAAAM,iBAAA,CAAqB5xB,CAArB,CAA0BY,CAA1B,CAFgC,CAAtC,CASA0wB,EAAAP,mBAAA,CAAyBc,QAAQ,EAAG,CAClC,GAAsB,CAAtB,EAAIP,CAAAL,WAAJ,CAAyB,CACvB,IAAIa,EAAkBR,CAAAS,sBAAA,EAItBP,EAAA,CAAgBjZ,CAAhB,CACIsU,CADJ,EACcyE,CAAAzE,OADd,CAEKyE,CAAAvB,aAAA,CAAmBuB,CAAAjK,SAAnB;AAAkCiK,CAAAU,aAFvC,CAGIF,CAHJ,CALuB,CADS,CAahC3D,EAAJ,GACEmD,CAAAnD,gBADF,CACwB,CAAA,CADxB,CAII4B,EAAJ,GACEuB,CAAAvB,aADF,CACqBA,CADrB,CAIAuB,EAAAW,KAAA,CAASnP,CAAT,EAAiB,IAAjB,CAjCK,CAoCP,GAAc,CAAd,CAAIgN,CAAJ,CACE,IAAI1V,EAAYqW,CAAA,CAAcW,CAAd,CAA8BtB,CAA9B,CADlB,KAEWA,EAAJ,EAAeA,CAAAzB,KAAf,EACLyB,CAAAzB,KAAA,CAAa+C,CAAb,CA3D0F,CAFG,CAyJnGc,QAASA,GAAoB,EAAG,CAC9B,IAAI1H,EAAc,IAAlB,CACIC,EAAY,IAYhB,KAAAD,YAAA,CAAmB2H,QAAQ,CAACvxB,CAAD,CAAO,CAChC,MAAIA,EAAJ,EACE4pB,CACO,CADO5pB,CACP,CAAA,IAFT,EAIS4pB,CALuB,CAmBlC,KAAAC,UAAA,CAAiB2H,QAAQ,CAACxxB,CAAD,CAAO,CAC9B,MAAIA,EAAJ,EACE6pB,CACO,CADK7pB,CACL,CAAA,IAFT,EAIS6pB,CALqB,CAUhC,KAAA1X,KAAA,CAAY,CAAC,QAAD,CAAW,mBAAX,CAAgC,MAAhC,CAAwC,QAAQ,CAACiL,CAAD,CAASZ,CAAT,CAA4Bc,CAA5B,CAAkC,CA0C5FL,QAASA,EAAY,CAACmK,CAAD,CAAOqK,CAAP,CAA2BC,CAA3B,CAA2C,CAW9D,IAX8D,IAC1DjtB,CAD0D,CAE1DktB,CAF0D,CAG1DzxB,EAAQ,CAHkD,CAI1DuG,EAAQ,EAJkD,CAK1D5H,EAASuoB,CAAAvoB,OALiD,CAM1D+yB,EAAmB,CAAA,CANuC,CAS1DltB,EAAS,EAEb,CAAMxE,CAAN,CAAcrB,CAAd,CAAA,CAC4D,EAA1D,GAAO4F,CAAP,CAAoB2iB,CAAAvkB,QAAA,CAAa+mB,CAAb,CAA0B1pB,CAA1B,CAApB,GAC+E,EAD/E,GACOyxB,CADP,CACkBvK,CAAAvkB,QAAA,CAAagnB,CAAb,CAAwBplB,CAAxB,CAAqCotB,CAArC,CADlB,GAEG3xB,CAID,EAJUuE,CAIV,EAJyBgC,CAAA/G,KAAA,CAAW0nB,CAAAhO,UAAA,CAAelZ,CAAf,CAAsBuE,CAAtB,CAAX,CAIzB,CAHAgC,CAAA/G,KAAA,CAAW4E,CAAX,CAAgB8Y,CAAA,CAAO0U,CAAP,CAAa1K,CAAAhO,UAAA,CAAe3U,CAAf;AAA4BotB,CAA5B,CAA+CF,CAA/C,CAAb,CAAhB,CAGA,CAFArtB,CAAAwtB,IAEA,CAFSA,CAET,CADA5xB,CACA,CADQyxB,CACR,CADmBI,CACnB,CAAAH,CAAA,CAAmB,CAAA,CANrB,GASG1xB,CACD,EADUrB,CACV,EADqB4H,CAAA/G,KAAA,CAAW0nB,CAAAhO,UAAA,CAAelZ,CAAf,CAAX,CACrB,CAAAA,CAAA,CAAQrB,CAVV,CAcF,EAAMA,CAAN,CAAe4H,CAAA5H,OAAf,IAEE4H,CAAA/G,KAAA,CAAW,EAAX,CACA,CAAAb,CAAA,CAAS,CAHX,CAYA,IAAI6yB,CAAJ,EAAqC,CAArC,CAAsBjrB,CAAA5H,OAAtB,CACI,KAAMmzB,GAAA,CAAmB,UAAnB,CAGsD5K,CAHtD,CAAN,CAMJ,GAAI,CAACqK,CAAL,EAA4BG,CAA5B,CA6BE,MA5BAltB,EAAA7F,OA4BOyF,CA5BSzF,CA4BTyF,CA3BPA,CA2BOA,CA3BFA,QAAQ,CAACnF,CAAD,CAAU,CACrB,GAAI,CACF,IADE,IACMU,EAAI,CADV,CACaiT,EAAKjU,CADlB,CAC0BozB,CAA5B,CAAkCpyB,CAAlC,CAAoCiT,CAApC,CAAwCjT,CAAA,EAAxC,CACkC,UAahC,EAbI,OAAQoyB,CAAR,CAAexrB,CAAA,CAAM5G,CAAN,CAAf,CAaJ,GAZEoyB,CAMA,CANOA,CAAA,CAAK9yB,CAAL,CAMP,CAJE8yB,CAIF,CALIP,CAAJ,CACSpU,CAAA4U,WAAA,CAAgBR,CAAhB,CAAgCO,CAAhC,CADT,CAGS3U,CAAA6U,QAAA,CAAaF,CAAb,CAET,CAAY,IAAZ,EAAIA,CAAJ,EAAoBA,CAApB,EAA4BzzB,CAA5B,CACEyzB,CADF,CACS,EADT,CAE0B,QAF1B,EAEW,MAAOA,EAFlB,GAGEA,CAHF,CAGSptB,EAAA,CAAOotB,CAAP,CAHT,CAMF,EAAAvtB,CAAA,CAAO7E,CAAP,CAAA,CAAYoyB,CAEd,OAAOvtB,EAAApE,KAAA,CAAY,EAAZ,CAjBL,CAmBJ,MAAM8xB,CAAN,CAAW,CACLC,CACJ,CADaL,EAAA,CAAmB,QAAnB,CAA4D5K,CAA5D,CAAkEgL,CAAArwB,SAAA,EAAlE,CACb,CAAAya,CAAA,CAAkB6V,CAAlB,CAFS,CApBU,CA2BhB/tB,CAFPA,CAAAwtB,IAEOxtB,CAFE8iB,CAEF9iB,CADPA,CAAAmC,MACOnC,CADImC,CACJnC,CAAAA,CA1EqD,CA1C4B,IACxFutB,EAAoBjI,CAAA/qB,OADoE,CAExFkzB,EAAkBlI,CAAAhrB,OAmItBoe,EAAA2M,YAAA,CAA2B0I,QAAQ,EAAG,CACpC,MAAO1I,EAD6B,CAiBtC3M,EAAA4M,UAAA,CAAyB0I,QAAQ,EAAG,CAClC,MAAO1I,EAD2B,CAIpC;MAAO5M,EA1JqF,CAAlF,CA3CkB,CAyMhCuV,QAASA,GAAiB,EAAG,CAC3B,IAAArgB,KAAA,CAAY,CAAC,YAAD,CAAe,SAAf,CAA0B,IAA1B,CACP,QAAQ,CAAC8C,CAAD,CAAeF,CAAf,CAA0B8W,CAA1B,CAA8B,CA8BzCxV,QAASA,EAAQ,CAAC/R,CAAD,CAAKiV,CAAL,CAAYkZ,CAAZ,CAAmBC,CAAnB,CAAgC,CAAA,IAC3CtwB,EAAc2S,CAAA3S,YAD6B,CAE3CuwB,EAAgB5d,CAAA4d,cAF2B,CAI3ClE,EAAW5C,CAAAxS,MAAA,EAJgC,CAK3CqU,EAAUe,CAAAf,QACV+E,EAN2C,CAMlC9wB,CAAA,CAAU8wB,CAAV,CAAD,CAAqBA,CAArB,CAA6B,CANM,KAO3CG,EAAY,CAP+B,CAQ3CC,EAAalxB,CAAA,CAAU+wB,CAAV,CAAbG,EAAuC,CAACH,CAE5ChF,EAAAD,KAAA,CAAa,IAAb,CAAmB,IAAnB,CAAyBnpB,CAAzB,CAEAopB,EAAAoF,aAAA,CAAuB1wB,CAAA,CAAY2wB,QAAa,EAAG,CACjDtE,CAAAuE,OAAA,CAAgBJ,CAAA,EAAhB,CAEY,EAAZ,CAAIH,CAAJ,EAAiBG,CAAjB,EAA8BH,CAA9B,GACEhE,CAAAC,QAAA,CAAiBkE,CAAjB,CAEA,CADAD,CAAA,CAAcjF,CAAAoF,aAAd,CACA,CAAA,OAAOG,CAAA,CAAUvF,CAAAoF,aAAV,CAHT,CAMKD,EAAL,EAAgB5d,CAAA1M,OAAA,EATiC,CAA5B,CAWpBgR,CAXoB,CAavB0Z,EAAA,CAAUvF,CAAAoF,aAAV,CAAA,CAAkCrE,CAElC,OAAOf,EA3BwC,CA7BjD,IAAIuF,EAAY,EAuEhB5c,EAAAoD,OAAA,CAAkByZ,QAAQ,CAACxF,CAAD,CAAU,CAClC,MAAIA,EAAJ,EAAeA,CAAAoF,aAAf,GAAuCG,EAAvC,EACEA,CAAA,CAAUvF,CAAAoF,aAAV,CAAA5G,OAAA,CAAuC,UAAvC,CAGO,CAFPyG,aAAA,CAAcjF,CAAAoF,aAAd,CAEO,CADP,OAAOG,CAAA,CAAUvF,CAAAoF,aAAV,CACA;AAAA,CAAA,CAJT,EAMO,CAAA,CAP2B,CAUpC,OAAOzc,EAlFkC,CAD/B,CADe,CAkG7B8c,QAASA,GAAe,EAAE,CACxB,IAAAhhB,KAAA,CAAY4H,QAAQ,EAAG,CACrB,MAAO,IACD,OADC,gBAGW,aACD,GADC,WAEH,GAFG,UAGJ,CACR,QACU,CADV,SAEW,CAFX,SAGW,CAHX,QAIU,EAJV,QAKU,EALV,QAMU,GANV,QAOU,EAPV,OAQS,CART,QASU,CATV,CADQ,CAWN,QACQ,CADR,SAES,CAFT,SAGS,CAHT,QAIQ,QAJR,QAKQ,EALR,QAMQ,SANR,QAOQ,GAPR,OAQO,CARP,QASQ,CATR,CAXM,CAHI,cA0BA,GA1BA,CAHX,kBAgCa,OACT,uFAAA,MAAA,CAAA,GAAA,CADS,YAGH,iDAAA,MAAA,CAAA,GAAA,CAHG;IAIX,0DAAA,MAAA,CAAA,GAAA,CAJW,UAKN,6BAAA,MAAA,CAAA,GAAA,CALM,OAMT,CAAC,IAAD,CAAM,IAAN,CANS,QAOR,oBAPQ,CAQhBqZ,OARgB,CAQT,eARS,UASN,iBATM,UAUN,WAVM,YAWJ,UAXI,WAYL,QAZK,YAaJ,WAbI,WAcL,QAdK,CAhCb,WAiDMC,QAAQ,CAACC,CAAD,CAAM,CACvB,MAAY,EAAZ,GAAIA,CAAJ,CACS,KADT,CAGO,OAJgB,CAjDpB,CADc,CADC,CAwE1BC,QAASA,GAAU,CAACzpB,CAAD,CAAO,CACpB0pB,CAAAA,CAAW1pB,CAAAvD,MAAA,CAAW,GAAX,CAGf,KAHA,IACI1G,EAAI2zB,CAAA30B,OAER,CAAOgB,CAAA,EAAP,CAAA,CACE2zB,CAAA,CAAS3zB,CAAT,CAAA,CAAc+G,EAAA,CAAiB4sB,CAAA,CAAS3zB,CAAT,CAAjB,CAGhB,OAAO2zB,EAAAlzB,KAAA,CAAc,GAAd,CARiB,CAW1BmzB,QAASA,GAAgB,CAACC,CAAD,CAAcC,CAAd,CAA2B,CAClD,IAAIC,EAAYnK,EAAA,CAAWiK,CAAX,CAEhBC,EAAAE,WAAA;AAAyBD,CAAAhE,SACzB+D,EAAAG,OAAA,CAAqBF,CAAAG,SACrBJ,EAAAK,OAAA,CAAqBhzB,CAAA,CAAI4yB,CAAAK,KAAJ,CAArB,EAA4CC,EAAA,CAAcN,CAAAhE,SAAd,CAA5C,EAAiF,IAL/B,CASpDuE,QAASA,GAAW,CAACC,CAAD,CAAcT,CAAd,CAA2B,CAC7C,IAAIU,EAAsC,GAAtCA,GAAYD,CAAAjwB,OAAA,CAAmB,CAAnB,CACZkwB,EAAJ,GACED,CADF,CACgB,GADhB,CACsBA,CADtB,CAGA,KAAIpuB,EAAQyjB,EAAA,CAAW2K,CAAX,CACZT,EAAAW,OAAA,CAAqBnuB,kBAAA,CAAmBkuB,CAAA,EAAyC,GAAzC,GAAYruB,CAAAuuB,SAAApwB,OAAA,CAAsB,CAAtB,CAAZ,CAA+C6B,CAAAuuB,SAAAnb,UAAA,CAAyB,CAAzB,CAA/C,CAA6EpT,CAAAuuB,SAAhG,CACrBZ,EAAAa,SAAA,CAAuBpuB,EAAA,CAAcJ,CAAAyuB,OAAd,CACvBd,EAAAe,OAAA,CAAqBvuB,kBAAA,CAAmBH,CAAAqP,KAAnB,CAGjBse,EAAAW,OAAJ,EAA0D,GAA1D,EAA0BX,CAAAW,OAAAnwB,OAAA,CAA0B,CAA1B,CAA1B,GAA+DwvB,CAAAW,OAA/D,CAAoF,GAApF,CAA0FX,CAAAW,OAA1F,CAX6C,CAqB/CK,QAASA,GAAU,CAACC,CAAD,CAAQC,CAAR,CAAe,CAChC,GAA4B,CAA5B,EAAIA,CAAAhyB,QAAA,CAAc+xB,CAAd,CAAJ,CACE,MAAOC,EAAAjxB,OAAA,CAAagxB,CAAA/1B,OAAb,CAFuB,CAOlCi2B,QAASA,GAAS,CAAChe,CAAD,CAAM,CACtB,IAAI5W,EAAQ4W,CAAAjU,QAAA,CAAY,GAAZ,CACZ,OAAiB,EAAV,EAAA3C,CAAA,CAAc4W,CAAd,CAAoBA,CAAAlT,OAAA,CAAW,CAAX,CAAc1D,CAAd,CAFL,CAMxB60B,QAASA,GAAS,CAACje,CAAD,CAAM,CACtB,MAAOA,EAAAlT,OAAA,CAAW,CAAX;AAAckxB,EAAA,CAAUhe,CAAV,CAAAke,YAAA,CAA2B,GAA3B,CAAd,CAAgD,CAAhD,CADe,CAkBxBC,QAASA,GAAgB,CAACC,CAAD,CAAUC,CAAV,CAAsB,CAC7C,IAAAC,QAAA,CAAe,CAAA,CACfD,EAAA,CAAaA,CAAb,EAA2B,EAC3B,KAAIE,EAAgBN,EAAA,CAAUG,CAAV,CACpBzB,GAAA,CAAiByB,CAAjB,CAA0B,IAA1B,CAQA,KAAAI,QAAA,CAAeC,QAAQ,CAACze,CAAD,CAAM,CAC3B,IAAI0e,EAAUb,EAAA,CAAWU,CAAX,CAA0Bve,CAA1B,CACd,IAAI,CAAC/X,CAAA,CAASy2B,CAAT,CAAL,CACE,KAAMC,GAAA,CAAgB,UAAhB,CAA6E3e,CAA7E,CAAkFue,CAAlF,CAAN,CAGFlB,EAAA,CAAYqB,CAAZ,CAAqB,IAArB,CAEK,KAAAlB,OAAL,GACE,IAAAA,OADF,CACgB,GADhB,CAIA,KAAAoB,UAAA,EAZ2B,CAmB7B,KAAAA,UAAA,CAAiBC,QAAQ,EAAG,CAAA,IACtBlB,EAASjuB,EAAA,CAAW,IAAAguB,SAAX,CADa,CAEtBnf,EAAO,IAAAqf,OAAA,CAAc,GAAd,CAAoB9tB,EAAA,CAAiB,IAAA8tB,OAAjB,CAApB,CAAoD,EAE/D,KAAAkB,MAAA,CAAarC,EAAA,CAAW,IAAAe,OAAX,CAAb,EAAwCG,CAAA,CAAS,GAAT,CAAeA,CAAf,CAAwB,EAAhE,EAAsEpf,CACtE,KAAAwgB,SAAA,CAAgBR,CAAhB,CAAgC,IAAAO,MAAAhyB,OAAA,CAAkB,CAAlB,CALN,CAQ5B,KAAAkyB,UAAA,CAAiBC,QAAQ,CAACjf,CAAD,CAAM,CAAA,IACzBkf,CAEJ,KAAMA,CAAN,CAAerB,EAAA,CAAWO,CAAX,CAAoBpe,CAApB,CAAf,IAA6CtY,CAA7C,CAEE,MADAy3B,EACA,CADaD,CACb,CAAA,CAAMA,CAAN,CAAerB,EAAA,CAAWQ,CAAX,CAAuBa,CAAvB,CAAf,IAAmDx3B,CAAnD,CACS62B,CADT,EAC0BV,EAAA,CAAW,GAAX,CAAgBqB,CAAhB,CAD1B,EACqDA,CADrD,EAGSd,CAHT,CAGmBe,CAEd,KAAMD,CAAN,CAAerB,EAAA,CAAWU,CAAX;AAA0Bve,CAA1B,CAAf,IAAmDtY,CAAnD,CACL,MAAO62B,EAAP,CAAuBW,CAClB,IAAIX,CAAJ,EAAqBve,CAArB,CAA2B,GAA3B,CACL,MAAOue,EAboB,CAvCc,CAmE/Ca,QAASA,GAAmB,CAAChB,CAAD,CAAUiB,CAAV,CAAsB,CAChD,IAAId,EAAgBN,EAAA,CAAUG,CAAV,CAEpBzB,GAAA,CAAiByB,CAAjB,CAA0B,IAA1B,CAQA,KAAAI,QAAA,CAAeC,QAAQ,CAACze,CAAD,CAAM,CAC3B,IAAIsf,EAAiBzB,EAAA,CAAWO,CAAX,CAAoBpe,CAApB,CAAjBsf,EAA6CzB,EAAA,CAAWU,CAAX,CAA0Bve,CAA1B,CAAjD,CACIuf,EAA6C,GAC5B,EADAD,CAAAjyB,OAAA,CAAsB,CAAtB,CACA,CAAfwwB,EAAA,CAAWwB,CAAX,CAAuBC,CAAvB,CAAe,CACd,IAAAhB,QACD,CAAEgB,CAAF,CACE,EAER,IAAI,CAACr3B,CAAA,CAASs3B,CAAT,CAAL,CACE,KAAMZ,GAAA,CAAgB,UAAhB,CAA6E3e,CAA7E,CAAkFqf,CAAlF,CAAN,CAEFhC,EAAA,CAAYkC,CAAZ,CAA4B,IAA5B,CACA,KAAAX,UAAA,EAZ2B,CAmB7B,KAAAA,UAAA,CAAiBC,QAAQ,EAAG,CAAA,IACtBlB,EAASjuB,EAAA,CAAW,IAAAguB,SAAX,CADa,CAEtBnf,EAAO,IAAAqf,OAAA,CAAc,GAAd,CAAoB9tB,EAAA,CAAiB,IAAA8tB,OAAjB,CAApB,CAAoD,EAE/D,KAAAkB,MAAA,CAAarC,EAAA,CAAW,IAAAe,OAAX,CAAb,EAAwCG,CAAA,CAAS,GAAT,CAAeA,CAAf,CAAwB,EAAhE,EAAsEpf,CACtE,KAAAwgB,SAAA,CAAgBX,CAAhB,EAA2B,IAAAU,MAAA,CAAaO,CAAb,CAA0B,IAAAP,MAA1B,CAAuC,EAAlE,CAL0B,CAQ5B,KAAAE,UAAA,CAAiBC,QAAQ,CAACjf,CAAD,CAAM,CAC7B,GAAGge,EAAA,CAAUI,CAAV,CAAH,EAAyBJ,EAAA,CAAUhe,CAAV,CAAzB,CACE,MAAOA,EAFoB,CAtCiB,CAuDlDwf,QAASA,GAA0B,CAACpB,CAAD,CAAUiB,CAAV,CAAsB,CACvD,IAAAf,QAAA,CAAe,CAAA,CACfc,GAAAl0B,MAAA,CAA0B,IAA1B;AAAgCjB,SAAhC,CAEA,KAAIs0B,EAAgBN,EAAA,CAAUG,CAAV,CAEpB,KAAAY,UAAA,CAAiBC,QAAQ,CAACjf,CAAD,CAAM,CAC7B,IAAIkf,CAEJ,IAAKd,CAAL,EAAgBJ,EAAA,CAAUhe,CAAV,CAAhB,CACE,MAAOA,EACF,IAAMkf,CAAN,CAAerB,EAAA,CAAWU,CAAX,CAA0Bve,CAA1B,CAAf,CACL,MAAOoe,EAAP,CAAiBiB,CAAjB,CAA8BH,CACzB,IAAKX,CAAL,GAAuBve,CAAvB,CAA6B,GAA7B,CACL,MAAOue,EARoB,CANwB,CA2NzDkB,QAASA,GAAc,CAACC,CAAD,CAAW,CAChC,MAAO,SAAQ,EAAG,CAChB,MAAO,KAAA,CAAKA,CAAL,CADS,CADc,CAOlCC,QAASA,GAAoB,CAACD,CAAD,CAAWE,CAAX,CAAuB,CAClD,MAAO,SAAQ,CAAC12B,CAAD,CAAQ,CACrB,GAAI0B,CAAA,CAAY1B,CAAZ,CAAJ,CACE,MAAO,KAAA,CAAKw2B,CAAL,CAET,KAAA,CAAKA,CAAL,CAAA,CAAiBE,CAAA,CAAW12B,CAAX,CACjB,KAAA01B,UAAA,EAEA,OAAO,KAPc,CAD2B,CAgDpDiB,QAASA,GAAiB,EAAE,CAAA,IACtBR,EAAa,EADS,CAEtBS,EAAY,CAAA,CAUhB,KAAAT,WAAA,CAAkBU,QAAQ,CAACC,CAAD,CAAS,CACjC,MAAIn1B,EAAA,CAAUm1B,CAAV,CAAJ,EACEX,CACO,CADMW,CACN,CAAA,IAFT,EAISX,CALwB,CAiBnC,KAAAS,UAAA,CAAiBG,QAAQ,CAAC9T,CAAD,CAAO,CAC9B,MAAIthB,EAAA,CAAUshB,CAAV,CAAJ,EACE2T,CACO,CADK3T,CACL,CAAA,IAFT,EAIS2T,CALqB,CAShC,KAAAzkB,KAAA,CAAY,CAAC,YAAD,CAAe,UAAf,CAA2B,UAA3B,CAAuC,cAAvC,CACR,QAAQ,CAAE8C,CAAF,CAAgB2W,CAAhB,CAA4B9V,CAA5B,CAAwC4I,CAAxC,CAAsD,CA8FhEsY,QAASA,EAAmB,CAACC,CAAD,CAAS,CACnChiB,CAAAiiB,WAAA,CAAsB,wBAAtB;AAAgDliB,CAAAmiB,OAAA,EAAhD,CAAoEF,CAApE,CADmC,CA9F2B,IAC5DjiB,CAD4D,CAG5DuD,EAAWqT,CAAArT,SAAA,EAHiD,CAI5D6e,EAAaxL,CAAA9U,IAAA,EAGb8f,EAAJ,EACE1B,CACA,CADqBkC,CAvclBhe,UAAA,CAAc,CAAd,CAuckBge,CAvcDv0B,QAAA,CAAY,GAAZ,CAucCu0B,CAvcgBv0B,QAAA,CAAY,IAAZ,CAAjB,CAAqC,CAArC,CAAjB,CAwcH,EADoC0V,CACpC,EADgD,GAChD,EAAA8e,CAAA,CAAevhB,CAAAoB,QAAA,CAAmB+d,EAAnB,CAAsCqB,EAFvD,GAIEpB,CACA,CADUJ,EAAA,CAAUsC,CAAV,CACV,CAAAC,CAAA,CAAenB,EALjB,CAOAlhB,EAAA,CAAY,IAAIqiB,CAAJ,CAAiBnC,CAAjB,CAA0B,GAA1B,CAAgCiB,CAAhC,CACZnhB,EAAAsgB,QAAA,CAAkBtgB,CAAA8gB,UAAA,CAAoBsB,CAApB,CAAlB,CAEA1Y,EAAAlc,GAAA,CAAgB,OAAhB,CAAyB,QAAQ,CAACuN,CAAD,CAAQ,CAIvC,GAAIunB,CAAAvnB,CAAAunB,QAAJ,EAAqBC,CAAAxnB,CAAAwnB,QAArB,EAAqD,CAArD,EAAsCxnB,CAAAynB,MAAtC,CAAA,CAKA,IAHA,IAAIliB,EAAM7P,CAAA,CAAOsK,CAAAO,OAAP,CAGV,CAAsC,GAAtC,GAAOhL,CAAA,CAAUgQ,CAAA,CAAI,CAAJ,CAAA/S,SAAV,CAAP,CAAA,CAEE,GAAI+S,CAAA,CAAI,CAAJ,CAAJ,GAAeoJ,CAAA,CAAa,CAAb,CAAf,EAAkC,CAAC,CAACpJ,CAAD,CAAOA,CAAAlU,OAAA,EAAP,EAAqB,CAArB,CAAnC,CAA4D,MAG9D,KAAIq2B,EAAUniB,CAAAiU,KAAA,CAAS,MAAT,CAAd,CACImO,EAAe1iB,CAAA8gB,UAAA,CAAoB2B,CAApB,CAEfA,EAAJ,GAAgB,CAAAniB,CAAA1N,KAAA,CAAS,QAAT,CAAhB,EAAsC8vB,CAAtC,EAAuD,CAAA3nB,CAAAW,mBAAA,EAAvD,IACEX,CAAAC,eAAA,EACA,CAAI0nB,CAAJ,EAAoB9L,CAAA9U,IAAA,EAApB,GAEE9B,CAAAsgB,QAAA,CAAkBoC,CAAlB,CAGA,CAFAziB,CAAA1M,OAAA,EAEA,CAAAjK,CAAAsK,QAAA,CAAe,0BAAf,CAAA;AAA6C,CAAA,CAL/C,CAFF,CAbA,CAJuC,CAAzC,CA+BIoM,EAAAmiB,OAAA,EAAJ,EAA0BC,CAA1B,EACExL,CAAA9U,IAAA,CAAa9B,CAAAmiB,OAAA,EAAb,CAAiC,CAAA,CAAjC,CAIFvL,EAAAxT,YAAA,CAAqB,QAAQ,CAACuf,CAAD,CAAS,CAChC3iB,CAAAmiB,OAAA,EAAJ,EAA0BQ,CAA1B,GACM1iB,CAAAiiB,WAAA,CAAsB,sBAAtB,CAA8CS,CAA9C,CAAsD3iB,CAAAmiB,OAAA,EAAtD,CAAA3mB,iBAAJ,CACEob,CAAA9U,IAAA,CAAa9B,CAAAmiB,OAAA,EAAb,CADF,EAIAliB,CAAA7R,WAAA,CAAsB,QAAQ,EAAG,CAC/B,IAAI6zB,EAASjiB,CAAAmiB,OAAA,EAEbniB,EAAAsgB,QAAA,CAAkBqC,CAAlB,CACAX,EAAA,CAAoBC,CAApB,CAJ+B,CAAjC,CAMA,CAAKhiB,CAAAuZ,QAAL,EAAyBvZ,CAAA2iB,QAAA,EAVzB,CADF,CADoC,CAAtC,CAiBA,KAAIC,EAAgB,CACpB5iB,EAAA5R,OAAA,CAAkBy0B,QAAuB,EAAG,CAC1C,IAAIb,EAASrL,CAAA9U,IAAA,EAAb,CACIihB,EAAiB/iB,CAAAgjB,UAEhBH,EAAL,EAAsBZ,CAAtB,EAAgCjiB,CAAAmiB,OAAA,EAAhC,GACEU,CAAA,EACA,CAAA5iB,CAAA7R,WAAA,CAAsB,QAAQ,EAAG,CAC3B6R,CAAAiiB,WAAA,CAAsB,sBAAtB,CAA8CliB,CAAAmiB,OAAA,EAA9C,CAAkEF,CAAlE,CAAAzmB,iBAAJ,CAEEwE,CAAAsgB,QAAA,CAAkB2B,CAAlB,CAFF,EAIErL,CAAA9U,IAAA,CAAa9B,CAAAmiB,OAAA,EAAb,CAAiCY,CAAjC,CACA,CAAAf,CAAA,CAAoBC,CAApB,CALF,CAD+B,CAAjC,CAFF,CAYAjiB,EAAAgjB,UAAA,CAAsB,CAAA,CAEtB,OAAOH,EAlBmC,CAA5C,CAqBA,OAAO7iB,EA5FyD,CADtD,CAtCc,CAp0PW;AAy/PvCijB,QAASA,GAAY,EAAE,CAAA,IACjBC,EAAQ,CAAA,CADS,CAEjB7zB,EAAO,IAUX,KAAA8zB,aAAA,CAAoBC,QAAQ,CAACC,CAAD,CAAO,CAClC,MAAI12B,EAAA,CAAU02B,CAAV,CAAJ,EACCH,CACO,CADCG,CACD,CAAA,IAFR,EAIQH,CAL0B,CASnC,KAAA/lB,KAAA,CAAY,CAAC,SAAD,CAAY,QAAQ,CAAC4C,CAAD,CAAS,CA6DvCujB,QAASA,EAAW,CAAC/uB,CAAD,CAAM,CACpBA,CAAJ,WAAmBgvB,MAAnB,GACMhvB,CAAA0J,MAAJ,CACE1J,CADF,CACSA,CAAAyJ,QACD,EADoD,EACpD,GADgBzJ,CAAA0J,MAAApQ,QAAA,CAAkB0G,CAAAyJ,QAAlB,CAChB,CAAA,SAAA,CAAYzJ,CAAAyJ,QAAZ,CAA0B,IAA1B,CAAiCzJ,CAAA0J,MAAjC,CACA1J,CAAA0J,MAHR,CAIW1J,CAAAivB,UAJX,GAKEjvB,CALF,CAKQA,CAAAyJ,QALR,CAKsB,IALtB,CAK6BzJ,CAAAivB,UAL7B,CAK6C,GAL7C,CAKmDjvB,CAAAohB,KALnD,CADF,CASA,OAAOphB,EAViB,CAa1BkvB,QAASA,EAAU,CAAC7qB,CAAD,CAAO,CAAA,IACpB8qB,EAAU3jB,CAAA2jB,QAAVA,EAA6B,EADT,CAEpBC,EAAQD,CAAA,CAAQ9qB,CAAR,CAAR+qB,EAAyBD,CAAAE,IAAzBD,EAAwCr3B,CAE5C,OAAIq3B,EAAA32B,MAAJ,CACS,QAAQ,EAAG,CAChB,IAAIwR,EAAO,EACXvU,EAAA,CAAQ8B,SAAR,CAAmB,QAAQ,CAACwI,CAAD,CAAM,CAC/BiK,CAAA9T,KAAA,CAAU44B,CAAA,CAAY/uB,CAAZ,CAAV,CAD+B,CAAjC,CAGA,OAAOovB,EAAA32B,MAAA,CAAY02B,CAAZ,CAAqBllB,CAArB,CALS,CADpB,CAYO,QAAQ,CAACqlB,CAAD,CAAOC,CAAP,CAAa,CAC1BH,CAAA,CAAME,CAAN,CAAoB,IAAR,EAAAC,CAAA,CAAe,EAAf,CAAoBA,CAAhC,CAD0B,CAhBJ,CAzE1B,MAAO,KASAL,CAAA,CAAW,KAAX,CATA;KAmBCA,CAAA,CAAW,MAAX,CAnBD,MA6BCA,CAAA,CAAW,MAAX,CA7BD,OAuCEA,CAAA,CAAW,OAAX,CAvCF,OAiDG,QAAS,EAAG,CACrB,IAAIn0B,EAAKm0B,CAAA,CAAW,OAAX,CAET,OAAO,SAAQ,EAAG,CACbP,CAAJ,EACC5zB,CAAAtC,MAAA,CAASqC,CAAT,CAAetD,SAAf,CAFgB,CAHG,CAAZ,EAjDH,CADgC,CAA7B,CArBS,CAqJvBg4B,QAASA,GAAoB,CAACzxB,CAAD,CAAO0xB,CAAP,CAAuB,CAClD,GAAa,aAAb,GAAI1xB,CAAJ,CACE,KAAM2xB,GAAA,CAAa,SAAb,CACuFD,CADvF,CAAN,CAGF,MAAO1xB,EAL2C,CAQpD4xB,QAASA,GAAgB,CAACv6B,CAAD,CAAMq6B,CAAN,CAAsB,CAE7C,GAAIr6B,CAAJ,EAAWA,CAAAgL,YAAX,GAA+BhL,CAA/B,CACE,KAAMs6B,GAAA,CAAa,QAAb,CAC4ED,CAD5E,CAAN,CAEK,GACHr6B,CADG,EACIA,CAAAJ,SADJ,EACoBI,CAAAuD,SADpB,EACoCvD,CAAAwD,MADpC,EACiDxD,CAAAyD,YADjD,CAEL,KAAM62B,GAAA,CAAa,YAAb,CAC8ED,CAD9E,CAAN,CAEK,GACHr6B,CADG,GACKA,CAAA4D,SADL,EACsB5D,CAAA6D,GADtB,EACgC7D,CAAA8D,KADhC,EAEL,KAAMw2B,GAAA,CAAa,SAAb,CAC6ED,CAD7E,CAAN,CAGA,MAAOr6B,EAdoC,CAqxB/Cw6B,QAASA,GAAM,CAACx6B,CAAD,CAAMmL,CAAN,CAAYsvB,CAAZ,CAAsBC,CAAtB,CAA+Bnf,CAA/B,CAAwC,CAErDA,CAAA,CAAUA,CAAV,EAAqB,EAEjB1U,EAAAA,CAAUsE,CAAAvD,MAAA,CAAW,GAAX,CACd,KADA,IAA+BnH,CAA/B,CACSS,EAAI,CAAb,CAAiC,CAAjC,CAAgB2F,CAAA3G,OAAhB,CAAoCgB,CAAA,EAApC,CAAyC,CACvCT,CAAA,CAAM25B,EAAA,CAAqBvzB,CAAA8G,MAAA,EAArB,CAAsC+sB,CAAtC,CACN,KAAIC;AAAc36B,CAAA,CAAIS,CAAJ,CACbk6B,EAAL,GACEA,CACA,CADc,EACd,CAAA36B,CAAA,CAAIS,CAAJ,CAAA,CAAWk6B,CAFb,CAIA36B,EAAA,CAAM26B,CACF36B,EAAA8uB,KAAJ,EAAgBvT,CAAAqf,eAAhB,GACEC,EAAA,CAAeH,CAAf,CASA,CARM,KAQN,EARe16B,EAQf,EAPG,QAAQ,CAAC+uB,CAAD,CAAU,CACjBA,CAAAD,KAAA,CAAa,QAAQ,CAAC7oB,CAAD,CAAM,CAAE8oB,CAAA+L,IAAA,CAAc70B,CAAhB,CAA3B,CADiB,CAAlB,CAECjG,CAFD,CAOH,CAHIA,CAAA86B,IAGJ,GAHgBj7B,CAGhB,GAFEG,CAAA86B,IAEF,CAFY,EAEZ,EAAA96B,CAAA,CAAMA,CAAA86B,IAVR,CARuC,CAqBzCr6B,CAAA,CAAM25B,EAAA,CAAqBvzB,CAAA8G,MAAA,EAArB,CAAsC+sB,CAAtC,CAEN,OADA16B,EAAA,CAAIS,CAAJ,CACA,CADWg6B,CA3B0C,CAsCvDM,QAASA,GAAe,CAACC,CAAD,CAAOC,CAAP,CAAaC,CAAb,CAAmBC,CAAnB,CAAyBC,CAAzB,CAA+BV,CAA/B,CAAwCnf,CAAxC,CAAiD,CACvE6e,EAAA,CAAqBY,CAArB,CAA2BN,CAA3B,CACAN,GAAA,CAAqBa,CAArB,CAA2BP,CAA3B,CACAN,GAAA,CAAqBc,CAArB,CAA2BR,CAA3B,CACAN,GAAA,CAAqBe,CAArB,CAA2BT,CAA3B,CACAN,GAAA,CAAqBgB,CAArB,CAA2BV,CAA3B,CAEA,OAAQnf,EAAAqf,eACD,CAoBDS,QAAoC,CAAC5xB,CAAD,CAAQmL,CAAR,CAAgB,CAAA,IAC9C0mB,EAAW1mB,CAAD,EAAWA,CAAAjU,eAAA,CAAsBq6B,CAAtB,CAAX,CAA0CpmB,CAA1C,CAAmDnL,CADf,CAE9CslB,CAEJ,IAAgB,IAAhB,GAAIuM,CAAJ,EAAwBA,CAAxB,GAAoCz7B,CAApC,CAA+C,MAAOy7B,EAGtD,EADAA,CACA,CADUA,CAAA,CAAQN,CAAR,CACV,GAAeM,CAAAxM,KAAf,GACE+L,EAAA,CAAeH,CAAf,CAMA,CALM,KAKN,EALeY,EAKf,GAJEvM,CAEA,CAFUuM,CAEV,CADAvM,CAAA+L,IACA,CADcj7B,CACd,CAAAkvB,CAAAD,KAAA,CAAa,QAAQ,CAAC7oB,CAAD,CAAM,CAAE8oB,CAAA+L,IAAA,CAAc70B,CAAhB,CAA3B,CAEF,EAAAq1B,CAAA,CAAUA,CAAAR,IAPZ,CASA,IAAI,CAACG,CAAL,EAAyB,IAAzB,GAAaK,CAAb,EAAiCA,CAAjC,GAA6Cz7B,CAA7C,CAAwD,MAAOy7B,EAG/D,EADAA,CACA,CADUA,CAAA,CAAQL,CAAR,CACV,GAAeK,CAAAxM,KAAf,GACE+L,EAAA,CAAeH,CAAf,CAMA,CALM,KAKN,EALeY,EAKf;CAJEvM,CAEA,CAFUuM,CAEV,CADAvM,CAAA+L,IACA,CADcj7B,CACd,CAAAkvB,CAAAD,KAAA,CAAa,QAAQ,CAAC7oB,CAAD,CAAM,CAAE8oB,CAAA+L,IAAA,CAAc70B,CAAhB,CAA3B,CAEF,EAAAq1B,CAAA,CAAUA,CAAAR,IAPZ,CASA,IAAI,CAACI,CAAL,EAAyB,IAAzB,GAAaI,CAAb,EAAiCA,CAAjC,GAA6Cz7B,CAA7C,CAAwD,MAAOy7B,EAG/D,EADAA,CACA,CADUA,CAAA,CAAQJ,CAAR,CACV,GAAeI,CAAAxM,KAAf,GACE+L,EAAA,CAAeH,CAAf,CAMA,CALM,KAKN,EALeY,EAKf,GAJEvM,CAEA,CAFUuM,CAEV,CADAvM,CAAA+L,IACA,CADcj7B,CACd,CAAAkvB,CAAAD,KAAA,CAAa,QAAQ,CAAC7oB,CAAD,CAAM,CAAE8oB,CAAA+L,IAAA,CAAc70B,CAAhB,CAA3B,CAEF,EAAAq1B,CAAA,CAAUA,CAAAR,IAPZ,CASA,IAAI,CAACK,CAAL,EAAyB,IAAzB,GAAaG,CAAb,EAAiCA,CAAjC,GAA6Cz7B,CAA7C,CAAwD,MAAOy7B,EAG/D,EADAA,CACA,CADUA,CAAA,CAAQH,CAAR,CACV,GAAeG,CAAAxM,KAAf,GACE+L,EAAA,CAAeH,CAAf,CAMA,CALM,KAKN,EALeY,EAKf,GAJEvM,CAEA,CAFUuM,CAEV,CADAvM,CAAA+L,IACA,CADcj7B,CACd,CAAAkvB,CAAAD,KAAA,CAAa,QAAQ,CAAC7oB,CAAD,CAAM,CAAE8oB,CAAA+L,IAAA,CAAc70B,CAAhB,CAA3B,CAEF,EAAAq1B,CAAA,CAAUA,CAAAR,IAPZ,CASA,IAAI,CAACM,CAAL,EAAyB,IAAzB,GAAaE,CAAb,EAAiCA,CAAjC,GAA6Cz7B,CAA7C,CAAwD,MAAOy7B,EAG/D,EADAA,CACA,CADUA,CAAA,CAAQF,CAAR,CACV,GAAeE,CAAAxM,KAAf,GACE+L,EAAA,CAAeH,CAAf,CAMA,CALM,KAKN,EALeY,EAKf,GAJEvM,CAEA,CAFUuM,CAEV,CADAvM,CAAA+L,IACA,CADcj7B,CACd,CAAAkvB,CAAAD,KAAA,CAAa,QAAQ,CAAC7oB,CAAD,CAAM,CAAE8oB,CAAA+L,IAAA,CAAc70B,CAAhB,CAA3B,CAEF,EAAAq1B,CAAA,CAAUA,CAAAR,IAPZ,CASA,OAAOQ,EAhE2C,CApBnD,CAADC,QAAsB,CAAC9xB,CAAD,CAAQmL,CAAR,CAAgB,CACpC,IAAI0mB,EAAW1mB,CAAD,EAAWA,CAAAjU,eAAA,CAAsBq6B,CAAtB,CAAX,CAA0CpmB,CAA1C,CAAmDnL,CAEjE,IAAgB,IAAhB,GAAI6xB,CAAJ,EAAwBA,CAAxB,GAAoCz7B,CAApC,CAA+C,MAAOy7B,EACtDA,EAAA,CAAUA,CAAA,CAAQN,CAAR,CAEV;GAAI,CAACC,CAAL,EAAyB,IAAzB,GAAaK,CAAb,EAAiCA,CAAjC,GAA6Cz7B,CAA7C,CAAwD,MAAOy7B,EAC/DA,EAAA,CAAUA,CAAA,CAAQL,CAAR,CAEV,IAAI,CAACC,CAAL,EAAyB,IAAzB,GAAaI,CAAb,EAAiCA,CAAjC,GAA6Cz7B,CAA7C,CAAwD,MAAOy7B,EAC/DA,EAAA,CAAUA,CAAA,CAAQJ,CAAR,CAEV,IAAI,CAACC,CAAL,EAAyB,IAAzB,GAAaG,CAAb,EAAiCA,CAAjC,GAA6Cz7B,CAA7C,CAAwD,MAAOy7B,EAC/DA,EAAA,CAAUA,CAAA,CAAQH,CAAR,CAEV,OAAKC,EAAL,EAAyB,IAAzB,GAAaE,CAAb,EAAiCA,CAAjC,GAA6Cz7B,CAA7C,CACAy7B,CADA,CACUA,CAAA,CAAQF,CAAR,CADV,CAA+DE,CAf3B,CAR2B,CAgGzEE,QAASA,GAAQ,CAACrwB,CAAD,CAAOoQ,CAAP,CAAgBmf,CAAhB,CAAyB,CAIxC,GAAIe,EAAA96B,eAAA,CAA6BwK,CAA7B,CAAJ,CACE,MAAOswB,GAAA,CAActwB,CAAd,CAL+B,KAQpCuwB,EAAWvwB,CAAAvD,MAAA,CAAW,GAAX,CARyB,CASpC+zB,EAAiBD,CAAAx7B,OATmB,CAUpCyF,CAEJ,IAAI4V,CAAAqgB,IAAJ,CACEj2B,CAAA,CAAuB,CAClB,CADCg2B,CACD,CAACZ,EAAA,CAAgBW,CAAA,CAAS,CAAT,CAAhB,CAA6BA,CAAA,CAAS,CAAT,CAA7B,CAA0CA,CAAA,CAAS,CAAT,CAA1C,CAAuDA,CAAA,CAAS,CAAT,CAAvD,CAAoEA,CAAA,CAAS,CAAT,CAApE,CAAiFhB,CAAjF,CAA0Fnf,CAA1F,CAAD,CACC,QAAQ,CAAC9R,CAAD,CAAQmL,CAAR,CAAgB,CAAA,IACpB1T,EAAI,CADgB,CACb+E,CACX,GACEA,EAKA,CALM80B,EAAA,CACEW,CAAA,CAASx6B,CAAA,EAAT,CADF,CACiBw6B,CAAA,CAASx6B,CAAA,EAAT,CADjB,CACgCw6B,CAAA,CAASx6B,CAAA,EAAT,CADhC,CAC+Cw6B,CAAA,CAASx6B,CAAA,EAAT,CAD/C,CAC8Dw6B,CAAA,CAASx6B,CAAA,EAAT,CAD9D,CAC6Ew5B,CAD7E,CACsFnf,CADtF,CAAA,CAEE9R,CAFF,CAESmL,CAFT,CAKN,CADAA,CACA,CADS/U,CACT,CAAA4J,CAAA,CAAQxD,CANV,OAOS/E,CAPT,CAOay6B,CAPb,CAQA,OAAO11B,EAViB,CAHhC,KAeO,CACL,IAAI8hB,EAAO,iBACXznB,EAAA,CAAQo7B,CAAR,CAAkB,QAAQ,CAACj7B,CAAD,CAAMc,CAAN,CAAa,CACrC64B,EAAA,CAAqB35B,CAArB,CAA0Bi6B,CAA1B,CACA3S,EAAA,EAAQ,uDAAR;CAEexmB,CAEA,CAAG,GAAH,CAEG,yBAFH,CAE+Bd,CAF/B,CAEqC,UANpD,EAMkE,IANlE,CAMyEA,CANzE,CAMsF,OANtF,EAOS8a,CAAAqf,eACA,CAAG,2BAAH,CACaF,CAAApzB,QAAA,CAAgB,KAAhB,CAAuB,KAAvB,CADb,CAQC,4GARD,CASG,EAjBZ,CAFqC,CAAvC,CAqBA,KAAAygB,EAAAA,CAAAA,CAAQ,WAAR,CAEI8T,EAAiBC,QAAA,CAAS,GAAT,CAAc,GAAd,CAAmB,IAAnB,CAAyB/T,CAAzB,CACrB8T,EAAAz4B,SAAA,CAA0B24B,QAAQ,EAAG,CAAE,MAAOhU,EAAT,CACrCpiB,EAAA,CAAKA,QAAQ,CAAC8D,CAAD,CAAQmL,CAAR,CAAgB,CAC3B,MAAOinB,EAAA,CAAepyB,CAAf,CAAsBmL,CAAtB,CAA8BimB,EAA9B,CADoB,CA3BxB,CAkCM,gBAAb,GAAI1vB,CAAJ,GACEswB,EAAA,CAActwB,CAAd,CADF,CACwBxF,CADxB,CAGA,OAAOA,EAhEiC,CAsH1Cq2B,QAASA,GAAc,EAAG,CACxB,IAAIxnB,EAAQ,EAAZ,CAEIynB,EAAgB,KACb,CAAA,CADa,gBAEF,CAAA,CAFE,oBAGE,CAAA,CAHF,CA+CpB,KAAArB,eAAA,CAAsBsB,QAAQ,CAAC76B,CAAD,CAAQ,CACpC,MAAI2B,EAAA,CAAU3B,CAAV,CAAJ;CACE46B,CAAArB,eACO,CADwB,CAAC,CAACv5B,CAC1B,CAAA,IAFT,EAIS46B,CAAArB,eAL2B,CA2BvC,KAAAuB,mBAAA,CAA0BC,QAAQ,CAAC/6B,CAAD,CAAQ,CACvC,MAAI2B,EAAA,CAAU3B,CAAV,CAAJ,EACE46B,CAAAE,mBACO,CAD4B96B,CAC5B,CAAA,IAFT,EAIS46B,CAAAE,mBAL8B,CAUzC,KAAA3oB,KAAA,CAAY,CAAC,SAAD,CAAY,UAAZ,CAAwB,MAAxB,CAAgC,QAAQ,CAAC6oB,CAAD,CAAUllB,CAAV,CAAoBD,CAApB,CAA0B,CAC5E+kB,CAAAL,IAAA,CAAoBzkB,CAAAykB,IAEpBf,GAAA,CAAiBA,QAAyB,CAACH,CAAD,CAAU,CAC7CuB,CAAAE,mBAAL,EAAyC,CAAAG,EAAA37B,eAAA,CAAmC+5B,CAAnC,CAAzC,GACA4B,EAAA,CAAoB5B,CAApB,CACA,CAD+B,CAAA,CAC/B,CAAAxjB,CAAAoD,KAAA,CAAU,4CAAV,CAAyDogB,CAAzD,CACI,2EADJ,CAFA,CADkD,CAOpD,OAAO,SAAQ,CAACvH,CAAD,CAAM,CACnB,IAAIoJ,CAEJ,QAAQ,MAAOpJ,EAAf,EACE,KAAK,QAAL,CAEE,GAAI3e,CAAA7T,eAAA,CAAqBwyB,CAArB,CAAJ,CACE,MAAO3e,EAAA,CAAM2e,CAAN,CAGLqJ;CAAAA,CAAQ,IAAIC,EAAJ,CAAUR,CAAV,CAEZM,EAAA,CAAmB/1B,CADNk2B,IAAIC,EAAJD,CAAWF,CAAXE,CAAkBL,CAAlBK,CAA2BT,CAA3BS,CACMl2B,OAAA,CAAa2sB,CAAb,CAAkB,CAAA,CAAlB,CAEP,iBAAZ,GAAIA,CAAJ,GAGE3e,CAAA,CAAM2e,CAAN,CAHF,CAGeoJ,CAHf,CAMA,OAAOA,EAET,MAAK,UAAL,CACE,MAAOpJ,EAET,SACE,MAAOxwB,EAvBX,CAHmB,CAVuD,CAAlE,CAvFY,CA0S1Bi6B,QAASA,GAAU,EAAG,CAEpB,IAAAppB,KAAA,CAAY,CAAC,YAAD,CAAe,mBAAf,CAAoC,QAAQ,CAAC8C,CAAD,CAAauH,CAAb,CAAgC,CACtF,MAAOgf,GAAA,CAAS,QAAQ,CAAC7jB,CAAD,CAAW,CACjC1C,CAAA7R,WAAA,CAAsBuU,CAAtB,CADiC,CAA5B,CAEJ6E,CAFI,CAD+E,CAA5E,CAFQ,CAkBtBgf,QAASA,GAAQ,CAACC,CAAD,CAAWC,CAAX,CAA6B,CAgR5CC,QAASA,EAAe,CAAC37B,CAAD,CAAQ,CAC9B,MAAOA,EADuB,CAKhC47B,QAASA,EAAc,CAACpyB,CAAD,CAAS,CAC9B,MAAO0iB,EAAA,CAAO1iB,CAAP,CADuB,CA1QhC,IAAI6P,EAAQA,QAAQ,EAAG,CAAA,IACjBwiB,EAAU,EADO,CAEjB77B,CAFiB,CAEVyuB,CA+HX,OA7HAA,EA6HA,CA7HW,SAEAC,QAAQ,CAAC9pB,CAAD,CAAM,CACrB,GAAIi3B,CAAJ,CAAa,CACX,IAAIlM,EAAYkM,CAChBA,EAAA,CAAUr9B,CACVwB,EAAA,CAAQ87B,CAAA,CAAIl3B,CAAJ,CAEJ+qB,EAAA9wB,OAAJ,EACE48B,CAAA,CAAS,QAAQ,EAAG,CAElB,IADA,IAAI9jB,CAAJ,CACS9X,EAAI,CADb,CACgBiT,EAAK6c,CAAA9wB,OAArB,CAAuCgB,CAAvC,CAA2CiT,CAA3C,CAA+CjT,CAAA,EAA/C,CACE8X,CACA,CADWgY,CAAA,CAAU9vB,CAAV,CACX,CAAAG,CAAAytB,KAAA,CAAW9V,CAAA,CAAS,CAAT,CAAX,CAAwBA,CAAA,CAAS,CAAT,CAAxB,CAAqCA,CAAA,CAAS,CAAT,CAArC,CAJgB,CAApB,CANS,CADQ,CAFd,QAqBDuU,QAAQ,CAAC1iB,CAAD,CAAS,CACvBilB,CAAAC,QAAA,CAAiBxC,CAAA,CAAO1iB,CAAP,CAAjB,CADuB,CArBhB;OA0BDwpB,QAAQ,CAAC+I,CAAD,CAAW,CACzB,GAAIF,CAAJ,CAAa,CACX,IAAIlM,EAAYkM,CAEZA,EAAAh9B,OAAJ,EACE48B,CAAA,CAAS,QAAQ,EAAG,CAElB,IADA,IAAI9jB,CAAJ,CACS9X,EAAI,CADb,CACgBiT,EAAK6c,CAAA9wB,OAArB,CAAuCgB,CAAvC,CAA2CiT,CAA3C,CAA+CjT,CAAA,EAA/C,CACE8X,CACA,CADWgY,CAAA,CAAU9vB,CAAV,CACX,CAAA8X,CAAA,CAAS,CAAT,CAAA,CAAYokB,CAAZ,CAJgB,CAApB,CAJS,CADY,CA1BlB,SA2CA,MACDtO,QAAQ,CAAC9V,CAAD,CAAWqkB,CAAX,CAAoBC,CAApB,CAAkC,CAC9C,IAAI9mB,EAASkE,CAAA,EAAb,CAEI6iB,EAAkBA,QAAQ,CAACl8B,CAAD,CAAQ,CACpC,GAAI,CACFmV,CAAAuZ,QAAA,CAAgB,CAAArvB,CAAA,CAAWsY,CAAX,CAAA,CAAuBA,CAAvB,CAAkCgkB,CAAlC,EAAmD37B,CAAnD,CAAhB,CADE,CAEF,MAAM4F,CAAN,CAAS,CACTuP,CAAA+W,OAAA,CAActmB,CAAd,CACA,CAAA81B,CAAA,CAAiB91B,CAAjB,CAFS,CAHyB,CAFtC,CAWIu2B,EAAiBA,QAAQ,CAAC3yB,CAAD,CAAS,CACpC,GAAI,CACF2L,CAAAuZ,QAAA,CAAgB,CAAArvB,CAAA,CAAW28B,CAAX,CAAA,CAAsBA,CAAtB,CAAgCJ,CAAhC,EAAgDpyB,CAAhD,CAAhB,CADE,CAEF,MAAM5D,CAAN,CAAS,CACTuP,CAAA+W,OAAA,CAActmB,CAAd,CACA,CAAA81B,CAAA,CAAiB91B,CAAjB,CAFS,CAHyB,CAXtC,CAoBIw2B,EAAsBA,QAAQ,CAACL,CAAD,CAAW,CAC3C,GAAI,CACF5mB,CAAA6d,OAAA,CAAe,CAAA3zB,CAAA,CAAW48B,CAAX,CAAA,CAA2BA,CAA3B,CAA0CN,CAA1C,EAA2DI,CAA3D,CAAf,CADE,CAEF,MAAMn2B,CAAN,CAAS,CACT81B,CAAA,CAAiB91B,CAAjB,CADS,CAHgC,CAQzCi2B,EAAJ,CACEA,CAAAn8B,KAAA,CAAa,CAACw8B,CAAD,CAAkBC,CAAlB,CAAkCC,CAAlC,CAAb,CADF,CAGEp8B,CAAAytB,KAAA,CAAWyO,CAAX,CAA4BC,CAA5B,CAA4CC,CAA5C,CAGF,OAAOjnB,EAAAuY,QAnCuC,CADzC,CAuCP,OAvCO,CAuCE2O,QAAQ,CAAC1kB,CAAD,CAAW,CAC1B,MAAO,KAAA8V,KAAA,CAAU,IAAV,CAAgB9V,CAAhB,CADmB,CAvCrB,CA2CP,SA3CO,CA2CI2kB,QAAQ,CAAC3kB,CAAD,CAAW,CAE5B4kB,QAASA,EAAW,CAACv8B,CAAD,CAAQw8B,CAAR,CAAkB,CACpC,IAAIrnB,EAASkE,CAAA,EACTmjB,EAAJ,CACErnB,CAAAuZ,QAAA,CAAe1uB,CAAf,CADF;AAGEmV,CAAA+W,OAAA,CAAclsB,CAAd,CAEF,OAAOmV,EAAAuY,QAP6B,CAUtC+O,QAASA,EAAc,CAACz8B,CAAD,CAAQ08B,CAAR,CAAoB,CACzC,IAAIC,EAAiB,IACrB,IAAI,CACFA,CAAA,CAAkB,CAAAhlB,CAAA,EAAWgkB,CAAX,GADhB,CAEF,MAAM/1B,CAAN,CAAS,CACT,MAAO22B,EAAA,CAAY32B,CAAZ,CAAe,CAAA,CAAf,CADE,CAGX,MAAI+2B,EAAJ,EAAsBt9B,CAAA,CAAWs9B,CAAAlP,KAAX,CAAtB,CACSkP,CAAAlP,KAAA,CAAoB,QAAQ,EAAG,CACpC,MAAO8O,EAAA,CAAYv8B,CAAZ,CAAmB08B,CAAnB,CAD6B,CAA/B,CAEJ,QAAQ,CAACvmB,CAAD,CAAQ,CACjB,MAAOomB,EAAA,CAAYpmB,CAAZ,CAAmB,CAAA,CAAnB,CADU,CAFZ,CADT,CAOSomB,CAAA,CAAYv8B,CAAZ,CAAmB08B,CAAnB,CAdgC,CAkB3C,MAAO,KAAAjP,KAAA,CAAU,QAAQ,CAACztB,CAAD,CAAQ,CAC/B,MAAOy8B,EAAA,CAAez8B,CAAf,CAAsB,CAAA,CAAtB,CADwB,CAA1B,CAEJ,QAAQ,CAACmW,CAAD,CAAQ,CACjB,MAAOsmB,EAAA,CAAetmB,CAAf,CAAsB,CAAA,CAAtB,CADU,CAFZ,CA9BqB,CA3CvB,CA3CA,CAJU,CAAvB,CAqII2lB,EAAMA,QAAQ,CAAC97B,CAAD,CAAQ,CACxB,MAAIA,EAAJ,EAAaX,CAAA,CAAWW,CAAAytB,KAAX,CAAb,CAA4CztB,CAA5C,CACO,MACCytB,QAAQ,CAAC9V,CAAD,CAAW,CACvB,IAAIxC,EAASkE,CAAA,EACboiB,EAAA,CAAS,QAAQ,EAAG,CAClBtmB,CAAAuZ,QAAA,CAAe/W,CAAA,CAAS3X,CAAT,CAAf,CADkB,CAApB,CAGA,OAAOmV,EAAAuY,QALgB,CADpB,CAFiB,CArI1B,CAsLIxB,EAASA,QAAQ,CAAC1iB,CAAD,CAAS,CAC5B,MAAO,MACCikB,QAAQ,CAAC9V,CAAD,CAAWqkB,CAAX,CAAoB,CAChC,IAAI7mB,EAASkE,CAAA,EACboiB,EAAA,CAAS,QAAQ,EAAG,CAClB,GAAI,CACFtmB,CAAAuZ,QAAA,CAAgB,CAAArvB,CAAA,CAAW28B,CAAX,CAAA,CAAsBA,CAAtB,CAAgCJ,CAAhC,EAAgDpyB,CAAhD,CAAhB,CADE,CAEF,MAAM5D,CAAN,CAAS,CACTuP,CAAA+W,OAAA,CAActmB,CAAd,CACA,CAAA81B,CAAA,CAAiB91B,CAAjB,CAFS,CAHO,CAApB,CAQA,OAAOuP,EAAAuY,QAVyB,CAD7B,CADqB,CA+H9B;MAAO,OACErU,CADF,QAEG6S,CAFH,MAjGIyB,QAAQ,CAAC3tB,CAAD,CAAQ2X,CAAR,CAAkBqkB,CAAlB,CAA2BC,CAA3B,CAAyC,CAAA,IACtD9mB,EAASkE,CAAA,EAD6C,CAEtDgV,CAFsD,CAItD6N,EAAkBA,QAAQ,CAACl8B,CAAD,CAAQ,CACpC,GAAI,CACF,MAAQ,CAAAX,CAAA,CAAWsY,CAAX,CAAA,CAAuBA,CAAvB,CAAkCgkB,CAAlC,EAAmD37B,CAAnD,CADN,CAEF,MAAO4F,CAAP,CAAU,CAEV,MADA81B,EAAA,CAAiB91B,CAAjB,CACO,CAAAsmB,CAAA,CAAOtmB,CAAP,CAFG,CAHwB,CAJoB,CAatDu2B,EAAiBA,QAAQ,CAAC3yB,CAAD,CAAS,CACpC,GAAI,CACF,MAAQ,CAAAnK,CAAA,CAAW28B,CAAX,CAAA,CAAsBA,CAAtB,CAAgCJ,CAAhC,EAAgDpyB,CAAhD,CADN,CAEF,MAAO5D,CAAP,CAAU,CAEV,MADA81B,EAAA,CAAiB91B,CAAjB,CACO,CAAAsmB,CAAA,CAAOtmB,CAAP,CAFG,CAHwB,CAboB,CAsBtDw2B,EAAsBA,QAAQ,CAACL,CAAD,CAAW,CAC3C,GAAI,CACF,MAAQ,CAAA18B,CAAA,CAAW48B,CAAX,CAAA,CAA2BA,CAA3B,CAA0CN,CAA1C,EAA2DI,CAA3D,CADN,CAEF,MAAOn2B,CAAP,CAAU,CACV81B,CAAA,CAAiB91B,CAAjB,CADU,CAH+B,CAQ7C61B,EAAA,CAAS,QAAQ,EAAG,CAClBK,CAAA,CAAI97B,CAAJ,CAAAytB,KAAA,CAAgB,QAAQ,CAACztB,CAAD,CAAQ,CAC1BquB,CAAJ,GACAA,CACA,CADO,CAAA,CACP,CAAAlZ,CAAAuZ,QAAA,CAAeoN,CAAA,CAAI97B,CAAJ,CAAAytB,KAAA,CAAgByO,CAAhB,CAAiCC,CAAjC,CAAiDC,CAAjD,CAAf,CAFA,CAD8B,CAAhC,CAIG,QAAQ,CAAC5yB,CAAD,CAAS,CACd6kB,CAAJ,GACAA,CACA,CADO,CAAA,CACP,CAAAlZ,CAAAuZ,QAAA,CAAeyN,CAAA,CAAe3yB,CAAf,CAAf,CAFA,CADkB,CAJpB,CAQG,QAAQ,CAACuyB,CAAD,CAAW,CAChB1N,CAAJ,EACAlZ,CAAA6d,OAAA,CAAcoJ,CAAA,CAAoBL,CAApB,CAAd,CAFoB,CARtB,CADkB,CAApB,CAeA,OAAO5mB,EAAAuY,QA7CmD,CAiGrD,KAxBPhc,QAAY,CAACkrB,CAAD,CAAW,CAAA,IACjBnO,EAAWpV,CAAA,EADM,CAEjByX,EAAU,CAFO,CAGjBnuB,EAAU3D,CAAA,CAAQ49B,CAAR,CAAA,CAAoB,EAApB,CAAyB,EAEvC39B,EAAA,CAAQ29B,CAAR,CAAkB,QAAQ,CAAClP,CAAD,CAAUtuB,CAAV,CAAe,CACvC0xB,CAAA,EACAgL,EAAA,CAAIpO,CAAJ,CAAAD,KAAA,CAAkB,QAAQ,CAACztB,CAAD,CAAQ,CAC5B2C,CAAArD,eAAA,CAAuBF,CAAvB,CAAJ;CACAuD,CAAA,CAAQvD,CAAR,CACA,CADeY,CACf,CAAM,EAAE8wB,CAAR,EAAkBrC,CAAAC,QAAA,CAAiB/rB,CAAjB,CAFlB,CADgC,CAAlC,CAIG,QAAQ,CAAC6G,CAAD,CAAS,CACd7G,CAAArD,eAAA,CAAuBF,CAAvB,CAAJ,EACAqvB,CAAAvC,OAAA,CAAgB1iB,CAAhB,CAFkB,CAJpB,CAFuC,CAAzC,CAYgB,EAAhB,GAAIsnB,CAAJ,EACErC,CAAAC,QAAA,CAAiB/rB,CAAjB,CAGF,OAAO8rB,EAAAf,QArBc,CAwBhB,CAhUqC,CAoY9CmP,QAASA,GAAkB,EAAE,CAC3B,IAAIC,EAAM,EAAV,CACIC,EAAmBt+B,CAAA,CAAO,YAAP,CAEvB,KAAAu+B,UAAA,CAAiBC,QAAQ,CAACj9B,CAAD,CAAQ,CAC3Be,SAAAlC,OAAJ,GACEi+B,CADF,CACQ98B,CADR,CAGA,OAAO88B,EAJwB,CAOjC,KAAA3qB,KAAA,CAAY,CAAC,WAAD,CAAc,mBAAd,CAAmC,QAAnC,CAA6C,UAA7C,CACR,QAAQ,CAAE6B,CAAF,CAAewI,CAAf,CAAoCY,CAApC,CAA8CwO,CAA9C,CAAwD,CAyClEsR,QAASA,EAAK,EAAG,CACf,IAAAC,IAAA,CAAWl9B,EAAA,EACX,KAAAuuB,QAAA,CAAe,IAAA3L,QAAf,CAA8B,IAAAua,WAA9B,CACe,IAAAC,cADf,CACoC,IAAAC,cADpC,CAEe,IAAAC,YAFf,CAEkC,IAAAC,YAFlC,CAEqD,IACrD,KAAA,CAAK,MAAL,CAAA,CAAe,IAAAC,MAAf,CAA6B,IAC7B,KAAAC,YAAA,CAAmB,CAAA,CACnB,KAAAC,aAAA;AAAoB,EACpB,KAAAC,kBAAA,CAAyB,EACzB,KAAAC,YAAA,CAAmB,EACnB,KAAAxa,kBAAA,CAAyB,EAVV,CA+0BjBya,QAASA,EAAU,CAACC,CAAD,CAAQ,CACzB,GAAI9oB,CAAAuZ,QAAJ,CACE,KAAMuO,EAAA,CAAiB,QAAjB,CAAsD9nB,CAAAuZ,QAAtD,CAAN,CAGFvZ,CAAAuZ,QAAA,CAAqBuP,CALI,CAY3BC,QAASA,EAAW,CAAClM,CAAD,CAAMxqB,CAAN,CAAY,CAC9B,IAAIhD,EAAK8Y,CAAA,CAAO0U,CAAP,CACTroB,GAAA,CAAYnF,CAAZ,CAAgBgD,CAAhB,CACA,OAAOhD,EAHuB,CAUhC25B,QAASA,EAAY,EAAG,EA/0BxBf,CAAAtpB,UAAA,CAAkB,aACHspB,CADG,MA2BVhe,QAAQ,CAACgf,CAAD,CAAU,CAIlBA,CAAJ,EACEC,CAIA,CAJQ,IAAIjB,CAIZ,CAHAiB,CAAAV,MAGA,CAHc,IAAAA,MAGd,CADAU,CAAAR,aACA,CADqB,IAAAA,aACrB,CAAAQ,CAAAP,kBAAA,CAA0B,IAAAA,kBAL5B,GAOEQ,CAKA,CALQA,QAAQ,EAAG,EAKnB,CAFAA,CAAAxqB,UAEA,CAFkB,IAElB,CADAuqB,CACA,CADQ,IAAIC,CACZ,CAAAD,CAAAhB,IAAA,CAAYl9B,EAAA,EAZd,CAcAk+B,EAAA,CAAM,MAAN,CAAA,CAAgBA,CAChBA,EAAAN,YAAA,CAAoB,EACpBM,EAAAtb,QAAA,CAAgB,IAChBsb,EAAAf,WAAA,CAAmBe,CAAAd,cAAnB,CAAyCc,CAAAZ,YAAzC,CAA6DY,CAAAX,YAA7D;AAAiF,IACjFW,EAAAb,cAAA,CAAsB,IAAAE,YAClB,KAAAD,YAAJ,CAEE,IAAAC,YAFF,CACE,IAAAA,YAAAH,cADF,CACmCc,CADnC,CAIE,IAAAZ,YAJF,CAIqB,IAAAC,YAJrB,CAIwCW,CAExC,OAAOA,EA7Be,CA3BR,QAqIR96B,QAAQ,CAACg7B,CAAD,CAAWrnB,CAAX,CAAqBsnB,CAArB,CAAqC,CAAA,IAE/C7rB,EAAMurB,CAAA,CAAYK,CAAZ,CAAsB,OAAtB,CAFyC,CAG/Cv7B,EAFQsF,IAEAg1B,WAHuC,CAI/CmB,EAAU,IACJvnB,CADI,MAEFinB,CAFE,KAGHxrB,CAHG,KAIH4rB,CAJG,IAKJ,CAAC,CAACC,CALE,CASd,IAAI,CAACj/B,CAAA,CAAW2X,CAAX,CAAL,CAA2B,CACzB,IAAIwnB,EAAWR,CAAA,CAAYhnB,CAAZ,EAAwB1V,CAAxB,CAA8B,UAA9B,CACfi9B,EAAAj6B,GAAA,CAAam6B,QAAQ,CAACC,CAAD,CAASC,CAAT,CAAiBv2B,CAAjB,CAAwB,CAACo2B,CAAA,CAASp2B,CAAT,CAAD,CAFpB,CAK3B,GAAuB,QAAvB,EAAI,MAAOi2B,EAAX,EAAmC5rB,CAAAwB,SAAnC,CAAiD,CAC/C,IAAI2qB,EAAaL,CAAAj6B,GACjBi6B,EAAAj6B,GAAA,CAAam6B,QAAQ,CAACC,CAAD,CAASC,CAAT,CAAiBv2B,CAAjB,CAAwB,CAC3Cw2B,CAAAr/B,KAAA,CAAgB,IAAhB,CAAsBm/B,CAAtB,CAA8BC,CAA9B,CAAsCv2B,CAAtC,CACArF,GAAA,CAAYD,CAAZ,CAAmBy7B,CAAnB,CAF2C,CAFE,CAQ5Cz7B,CAAL,GACEA,CADF,CAzBYsF,IA0BFg1B,WADV,CAC6B,EAD7B,CAKAt6B,EAAArC,QAAA,CAAc89B,CAAd,CAEA,OAAO,SAAQ,EAAG,CAChBx7B,EAAA,CAAYD,CAAZ,CAAmBy7B,CAAnB,CADgB,CAjCiC,CArIrC,kBAkOEM,QAAQ,CAAClgC,CAAD,CAAMqY,CAAN,CAAgB,CACxC,IAAI3S;AAAO,IAAX,CACIy6B,CADJ,CAEIC,CAFJ,CAGIC,EAAiB,CAHrB,CAIIC,EAAY7hB,CAAA,CAAOze,CAAP,CAJhB,CAKIugC,EAAgB,EALpB,CAMIC,EAAiB,EANrB,CAOIC,EAAY,CA2EhB,OAAO,KAAA/7B,OAAA,CAzEPg8B,QAA8B,EAAG,CAC/BN,CAAA,CAAWE,CAAA,CAAU56B,CAAV,CADoB,KAE3Bi7B,CAF2B,CAEhBlgC,CAEf,IAAKwC,CAAA,CAASm9B,CAAT,CAAL,CAKO,GAAIrgC,EAAA,CAAYqgC,CAAZ,CAAJ,CAgBL,IAfID,CAeKj/B,GAfQq/B,CAeRr/B,GAbPi/B,CAEA,CAFWI,CAEX,CADAE,CACA,CADYN,CAAAjgC,OACZ,CAD8B,CAC9B,CAAAmgC,CAAA,EAWOn/B,EARTy/B,CAQSz/B,CARGk/B,CAAAlgC,OAQHgB,CANLu/B,CAMKv/B,GANSy/B,CAMTz/B,GAJPm/B,CAAA,EACA,CAAAF,CAAAjgC,OAAA,CAAkBugC,CAAlB,CAA8BE,CAGvBz/B,EAAAA,CAAAA,CAAI,CAAb,CAAgBA,CAAhB,CAAoBy/B,CAApB,CAA+Bz/B,CAAA,EAA/B,CACMi/B,CAAA,CAASj/B,CAAT,CAAJ,GAAoBk/B,CAAA,CAASl/B,CAAT,CAApB,GACEm/B,CAAA,EACA,CAAAF,CAAA,CAASj/B,CAAT,CAAA,CAAck/B,CAAA,CAASl/B,CAAT,CAFhB,CAjBG,KAsBA,CACDi/B,CAAJ,GAAiBK,CAAjB,GAEEL,CAEA,CAFWK,CAEX,CAF4B,EAE5B,CADAC,CACA,CADY,CACZ,CAAAJ,CAAA,EAJF,CAOAM,EAAA,CAAY,CACZ,KAAKlgC,CAAL,GAAY2/B,EAAZ,CACMA,CAAAz/B,eAAA,CAAwBF,CAAxB,CAAJ,GACEkgC,CAAA,EACA,CAAIR,CAAAx/B,eAAA,CAAwBF,CAAxB,CAAJ,CACM0/B,CAAA,CAAS1/B,CAAT,CADN,GACwB2/B,CAAA,CAAS3/B,CAAT,CADxB,GAEI4/B,CAAA,EACA,CAAAF,CAAA,CAAS1/B,CAAT,CAAA,CAAgB2/B,CAAA,CAAS3/B,CAAT,CAHpB,GAMEggC,CAAA,EAEA,CADAN,CAAA,CAAS1/B,CAAT,CACA,CADgB2/B,CAAA,CAAS3/B,CAAT,CAChB,CAAA4/B,CAAA,EARF,CAFF,CAcF,IAAII,CAAJ,CAAgBE,CAAhB,CAGE,IAAIlgC,CAAJ,GADA4/B,EAAA,EACWF,CAAAA,CAAX,CACMA,CAAAx/B,eAAA,CAAwBF,CAAxB,CAAJ,EAAqC,CAAA2/B,CAAAz/B,eAAA,CAAwBF,CAAxB,CAArC,GACEggC,CAAA,EACA,CAAA,OAAON,CAAA,CAAS1/B,CAAT,CAFT,CA5BC,CA3BP,IACM0/B,EAAJ,GAAiBC,CAAjB,GACED,CACA,CADWC,CACX,CAAAC,CAAA,EAFF,CA6DF,OAAOA,EAlEwB,CAyE1B,CAJPO,QAA+B,EAAG,CAChCvoB,CAAA,CAAS+nB,CAAT,CAAmBD,CAAnB,CAA6Bz6B,CAA7B,CADgC,CAI3B,CAnFiC,CAlO1B,SAuWPuzB,QAAQ,EAAG,CAAA,IACd4H,CADc;AACPx/B,CADO,CACA4R,CADA,CAEd6tB,CAFc,CAGdC,EAAa,IAAA/B,aAHC,CAIdgC,EAAkB,IAAA/B,kBAJJ,CAKd/+B,CALc,CAMd+gC,CANc,CAMPC,EAAM/C,CANC,CAORzT,CAPQ,CAQdyW,EAAW,EARG,CASdC,CATc,CASNC,CATM,CASEC,EAEpBnC,EAAA,CAAW,SAAX,CAEA,GAAG,CACD8B,CAAA,CAAQ,CAAA,CAGR,KAFAvW,CAEA,CAV0B/Y,IAU1B,CAAMovB,CAAA7gC,OAAN,CAAA,CACE,GAAI,CACFohC,EACA,CADYP,CAAApzB,MAAA,EACZ,CAAA2zB,EAAA73B,MAAA83B,MAAA,CAAsBD,EAAA9V,WAAtB,CAFE,CAGF,MAAOvkB,EAAP,CAAU,CACV4W,CAAA,CAAkB5W,EAAlB,CADU,CAKd,EAAG,CACD,GAAK65B,CAAL,CAAgBpW,CAAA+T,WAAhB,CAGE,IADAv+B,CACA,CADS4gC,CAAA5gC,OACT,CAAOA,CAAA,EAAP,CAAA,CACE,GAAI,CAIF,CAHA2gC,CAGA,CAHQC,CAAA,CAAS5gC,CAAT,CAGR,KAAcmB,CAAd,CAAsBw/B,CAAA/sB,IAAA,CAAU4W,CAAV,CAAtB,KAA+CzX,CAA/C,CAAsD4tB,CAAA5tB,KAAtD,GAEM,EADA4tB,CAAAnhB,GACA,CAAIxa,EAAA,CAAO7D,CAAP,CAAc4R,CAAd,CAAJ,CACqB,QADrB,EACK,MAAO5R,EADZ,EACgD,QADhD,EACiC,MAAO4R,EADxC,EAEQuuB,KAAA,CAAMngC,CAAN,CAFR,EAEwBmgC,KAAA,CAAMvuB,CAAN,CAFxB,CAFN,IAKEguB,CAGA,CAHQ,CAAA,CAGR,CAFAJ,CAAA5tB,KAEA,CAFa4tB,CAAAnhB,GAAA,CAAWpb,EAAA,CAAKjD,CAAL,CAAX,CAAyBA,CAEtC,CADAw/B,CAAAl7B,GAAA,CAAStE,CAAT,CAAkB4R,CAAD,GAAUqsB,CAAV,CAA0Bj+B,CAA1B,CAAkC4R,CAAnD,CAA0DyX,CAA1D,CACA,CAAU,CAAV,CAAIwW,CAAJ,GACEE,CAMA,CANS,CAMT,CANaF,CAMb,CALKC,CAAA,CAASC,CAAT,CAKL,GALuBD,CAAA,CAASC,CAAT,CAKvB,CAL0C,EAK1C,EAJAC,CAIA,CAJU3gC,CAAA,CAAWmgC,CAAA1N,IAAX,CACD,CAAH,MAAG,EAAO0N,CAAA1N,IAAAxqB,KAAP,EAAyBk4B,CAAA1N,IAAA/vB,SAAA,EAAzB,EACHy9B,CAAA1N,IAEN,CADAkO,CACA,EADU,YACV,CADyBn7B,EAAA,CAAO7E,CAAP,CACzB,CADyC,YACzC;AADwD6E,EAAA,CAAO+M,CAAP,CACxD,CAAAkuB,CAAA,CAASC,CAAT,CAAArgC,KAAA,CAAsBsgC,CAAtB,CAPF,CARF,CAJE,CAsBF,MAAOp6B,CAAP,CAAU,CACV4W,CAAA,CAAkB5W,CAAlB,CADU,CAShB,GAAI,EAAEw6B,CAAF,CAAU/W,CAAAkU,YAAV,EAAkClU,CAAlC,GAvDoB/Y,IAuDpB,EAAwD+Y,CAAAgU,cAAxD,CAAJ,CACE,IAAA,CAAMhU,CAAN,GAxDsB/Y,IAwDtB,EAA4B,EAAE8vB,CAAF,CAAS/W,CAAAgU,cAAT,CAA5B,CAAA,CACEhU,CAAA,CAAUA,CAAAxG,QAtCb,CAAH,MAyCUwG,CAzCV,CAyCoB+W,CAzCpB,CA2CA,IAAGR,CAAH,EAAY,CAAEC,CAAA,EAAd,CAEE,KAoZN5qB,EAAAuZ,QApZY,CAoZS,IApZT,CAAAuO,CAAA,CAAiB,QAAjB,CAEFD,CAFE,CAEGj4B,EAAA,CAAOi7B,CAAP,CAFH,CAAN,CA1DD,CAAH,MA8DSF,CA9DT,EA8DkBF,CAAA7gC,OA9DlB,CAkEA,KA4YFoW,CAAAuZ,QA5YE,CA4YmB,IA5YnB,CAAMmR,CAAA9gC,OAAN,CAAA,CACE,GAAI,CACF8gC,CAAArzB,MAAA,EAAA,EADE,CAEF,MAAO1G,CAAP,CAAU,CACV4W,CAAA,CAAkB5W,CAAlB,CADU,CAlFI,CAvWJ,UAoeN2I,QAAQ,EAAG,CAEnB,GAAI0G,CAAJ,EAAkB,IAAlB,EAA0ByoB,CAAA,IAAAA,YAA1B,CAAA,CACA,IAAIt8B,EAAS,IAAAyhB,QAEb,KAAAqU,WAAA,CAAgB,UAAhB,CACA,KAAAwG,YAAA,CAAmB,CAAA,CAEft8B,EAAAm8B,YAAJ,EAA0B,IAA1B,GAAgCn8B,CAAAm8B,YAAhC,CAAqD,IAAAF,cAArD,CACIj8B,EAAAo8B,YAAJ,EAA0B,IAA1B,GAAgCp8B,CAAAo8B,YAAhC,CAAqD,IAAAF,cAArD,CACI;IAAAA,cAAJ,GAAwB,IAAAA,cAAAD,cAAxB,CAA2D,IAAAA,cAA3D,CACI,KAAAA,cAAJ,GAAwB,IAAAA,cAAAC,cAAxB,CAA2D,IAAAA,cAA3D,CAIA,KAAAza,QAAA,CAAe,IAAAwa,cAAf,CAAoC,IAAAC,cAApC,CAAyD,IAAAC,YAAzD,CACI,IAAAC,YADJ,CACuB,IAdvB,CAFmB,CApeL,OAkhBT0C,QAAQ,CAACG,CAAD,CAAO9sB,CAAP,CAAe,CAC5B,MAAO6J,EAAA,CAAOijB,CAAP,CAAA,CAAa,IAAb,CAAmB9sB,CAAnB,CADqB,CAlhBd,YAijBJnQ,QAAQ,CAACi9B,CAAD,CAAO,CAGpBprB,CAAAuZ,QAAL,EAA4BvZ,CAAA0oB,aAAA9+B,OAA5B,EACE+sB,CAAAvS,MAAA,CAAe,QAAQ,EAAG,CACpBpE,CAAA0oB,aAAA9+B,OAAJ,EACEoW,CAAA2iB,QAAA,EAFsB,CAA1B,CAOF,KAAA+F,aAAAj+B,KAAA,CAAuB,OAAQ,IAAR,YAA0B2gC,CAA1B,CAAvB,CAXyB,CAjjBX,cA+jBDC,QAAQ,CAACh8B,CAAD,CAAK,CAC1B,IAAAs5B,kBAAAl+B,KAAA,CAA4B4E,CAA5B,CAD0B,CA/jBZ;OAinBRiE,QAAQ,CAAC83B,CAAD,CAAO,CACrB,GAAI,CAEF,MADAvC,EAAA,CAAW,QAAX,CACO,CAAA,IAAAoC,MAAA,CAAWG,CAAX,CAFL,CAGF,MAAOz6B,CAAP,CAAU,CACV4W,CAAA,CAAkB5W,CAAlB,CADU,CAHZ,OAKU,CA2MZqP,CAAAuZ,QAAA,CAAqB,IAzMjB,IAAI,CACFvZ,CAAA2iB,QAAA,EADE,CAEF,MAAOhyB,CAAP,CAAU,CAEV,KADA4W,EAAA,CAAkB5W,CAAlB,CACMA,CAAAA,CAAN,CAFU,CAJJ,CANW,CAjnBP,KA2pBX26B,QAAQ,CAACj5B,CAAD,CAAO0P,CAAP,CAAiB,CAC5B,IAAIwpB,EAAiB,IAAA3C,YAAA,CAAiBv2B,CAAjB,CAChBk5B,EAAL,GACE,IAAA3C,YAAA,CAAiBv2B,CAAjB,CADF,CAC2Bk5B,CAD3B,CAC4C,EAD5C,CAGAA,EAAA9gC,KAAA,CAAoBsX,CAApB,CAEA,OAAO,SAAQ,EAAG,CAChBwpB,CAAA,CAAe39B,EAAA,CAAQ29B,CAAR,CAAwBxpB,CAAxB,CAAf,CAAA,CAAoD,IADpC,CAPU,CA3pBd,OA8rBTypB,QAAQ,CAACn5B,CAAD,CAAOkM,CAAP,CAAa,CAAA,IACtBktB,EAAQ,EADc,CAEtBF,CAFsB,CAGtBp4B,EAAQ,IAHc,CAItB+H,EAAkB,CAAA,CAJI,CAKtBJ,EAAQ,MACAzI,CADA,aAEOc,CAFP,iBAGW+H,QAAQ,EAAG,CAACA,CAAA,CAAkB,CAAA,CAAnB,CAHtB,gBAIUH,QAAQ,EAAG,CACzBD,CAAAS,iBAAA,CAAyB,CAAA,CADA,CAJrB,kBAOY,CAAA,CAPZ,CALc,CActBmwB,EAAsBC,CAAC7wB,CAAD6wB,CAzzTzBl8B,OAAA,CAAcF,EAAAjF,KAAA,CAyzToBwB,SAzzTpB,CAyzT+Bb,CAzzT/B,CAAd,CA2yTyB,CAetBL,CAfsB,CAenBhB,CAEP,GAAG,CACD2hC,CAAA,CAAiBp4B,CAAAy1B,YAAA,CAAkBv2B,CAAlB,CAAjB,EAA4Co5B,CAC5C3wB,EAAA8wB,aAAA;AAAqBz4B,CAChBvI,EAAA,CAAE,CAAP,KAAUhB,CAAV,CAAiB2hC,CAAA3hC,OAAjB,CAAwCgB,CAAxC,CAA0ChB,CAA1C,CAAkDgB,CAAA,EAAlD,CAGE,GAAK2gC,CAAA,CAAe3gC,CAAf,CAAL,CAMA,GAAI,CAEF2gC,CAAA,CAAe3gC,CAAf,CAAAmC,MAAA,CAAwB,IAAxB,CAA8B2+B,CAA9B,CAFE,CAGF,MAAO/6B,CAAP,CAAU,CACV4W,CAAA,CAAkB5W,CAAlB,CADU,CATZ,IACE46B,EAAAx9B,OAAA,CAAsBnD,CAAtB,CAAyB,CAAzB,CAEA,CADAA,CAAA,EACA,CAAAhB,CAAA,EAWJ,IAAIsR,CAAJ,CAAqB,KAErB/H,EAAA,CAAQA,CAAAya,QAtBP,CAAH,MAuBSza,CAvBT,CAyBA,OAAO2H,EA1CmB,CA9rBZ,YAkwBJmnB,QAAQ,CAAC5vB,CAAD,CAAOkM,CAAP,CAAa,CAAA,IAE3B6V,EADS/Y,IADkB,CAG3B8vB,EAFS9vB,IADkB,CAI3BP,EAAQ,MACAzI,CADA,aAHCgJ,IAGD,gBAGUN,QAAQ,EAAG,CACzBD,CAAAS,iBAAA,CAAyB,CAAA,CADA,CAHrB,kBAMY,CAAA,CANZ,CAJmB,CAY3BmwB,EAAsBC,CAAC7wB,CAAD6wB,CA33TzBl8B,OAAA,CAAcF,EAAAjF,KAAA,CA23ToBwB,SA33TpB,CA23T+Bb,CA33T/B,CAAd,CA+2T8B,CAahBL,CAbgB,CAabhB,CAGlB,GAAG,CACDwqB,CAAA,CAAU+W,CACVrwB,EAAA8wB,aAAA,CAAqBxX,CACrBM,EAAA,CAAYN,CAAAwU,YAAA,CAAoBv2B,CAApB,CAAZ,EAAyC,EACpCzH,EAAA,CAAE,CAAP,KAAUhB,CAAV,CAAmB8qB,CAAA9qB,OAAnB,CAAqCgB,CAArC,CAAuChB,CAAvC,CAA+CgB,CAAA,EAA/C,CAEE,GAAK8pB,CAAA,CAAU9pB,CAAV,CAAL,CAOA,GAAI,CACF8pB,CAAA,CAAU9pB,CAAV,CAAAmC,MAAA,CAAmB,IAAnB,CAAyB2+B,CAAzB,CADE,CAEF,MAAM/6B,CAAN,CAAS,CACT4W,CAAA,CAAkB5W,CAAlB,CADS,CATX,IACE+jB,EAAA3mB,OAAA,CAAiBnD,CAAjB,CAAoB,CAApB,CAEA,CADAA,CAAA,EACA,CAAAhB,CAAA,EAcJ,IAAI,EAAEuhC,CAAF,CAAU/W,CAAAkU,YAAV,EAAkClU,CAAlC,GAtCO/Y,IAsCP,EAAwD+Y,CAAAgU,cAAxD,CAAJ,CACE,IAAA,CAAMhU,CAAN;AAvCS/Y,IAuCT,EAA4B,EAAE8vB,CAAF,CAAS/W,CAAAgU,cAAT,CAA5B,CAAA,CACEhU,CAAA,CAAUA,CAAAxG,QAzBb,CAAH,MA4BUwG,CA5BV,CA4BoB+W,CA5BpB,CA8BA,OAAOrwB,EA9CwB,CAlwBjB,CAozBlB,KAAIkF,EAAa,IAAIioB,CAErB,OAAOjoB,EAr3B2D,CADxD,CAXe,CAq7B7B6rB,QAASA,GAAa,CAACC,CAAD,CAAU,CAC9B,GAAgB,MAAhB,GAAIA,CAAJ,CACE,MAAOA,EACF,IAAIhiC,CAAA,CAASgiC,CAAT,CAAJ,CAAuB,CAK5B,GAA8B,EAA9B,CAAIA,CAAAl+B,QAAA,CAAgB,KAAhB,CAAJ,CACE,KAAMm+B,GAAA,CAAW,QAAX,CACsDD,CADtD,CAAN,CAGFA,CAAA,CAA0BA,CAjBrB96B,QAAA,CAAU,+BAAV,CAA2C,MAA3C,CAAAA,QAAA,CACU,OADV,CACmB,OADnB,CAiBKA,QAAA,CACY,QADZ,CACsB,IADtB,CAAAA,QAAA,CAEY,KAFZ,CAEmB,YAFnB,CAGV,OAAWxC,OAAJ,CAAW,GAAX,CAAiBs9B,CAAjB,CAA2B,GAA3B,CAZqB,CAavB,GAAI9+B,EAAA,CAAS8+B,CAAT,CAAJ,CAIL,MAAWt9B,OAAJ,CAAW,GAAX,CAAiBs9B,CAAA79B,OAAjB,CAAkC,GAAlC,CAEP,MAAM89B,GAAA,CAAW,UAAX,CAAN,CAtB4B,CA4BhCC,QAASA,GAAc,CAACC,CAAD,CAAW,CAChC,IAAIC,EAAmB,EACnBx/B,EAAA,CAAUu/B,CAAV,CAAJ,EACEjiC,CAAA,CAAQiiC,CAAR,CAAkB,QAAQ,CAACH,CAAD,CAAU,CAClCI,CAAAzhC,KAAA,CAAsBohC,EAAA,CAAcC,CAAd,CAAtB,CADkC,CAApC,CAIF,OAAOI,EAPyB,CA4ElCC,QAASA,GAAoB,EAAG,CAC9B,IAAAC,aAAA,CAAoBA,EADU,KAI1BC;AAAuB,CAAC,MAAD,CAJG,CAK1BC,EAAuB,EAyB3B,KAAAD,qBAAA,CAA4BE,QAAS,CAACxhC,CAAD,CAAQ,CACvCe,SAAAlC,OAAJ,GACEyiC,CADF,CACyBL,EAAA,CAAejhC,CAAf,CADzB,CAGA,OAAOshC,EAJoC,CAmC7C,KAAAC,qBAAA,CAA4BE,QAAS,CAACzhC,CAAD,CAAQ,CACvCe,SAAAlC,OAAJ,GACE0iC,CADF,CACyBN,EAAA,CAAejhC,CAAf,CADzB,CAGA,OAAOuhC,EAJoC,CAO7C,KAAApvB,KAAA,CAAY,CAAC,MAAD,CAAS,WAAT,CAAsB,WAAtB,CAAmC,QAAQ,CACzC0D,CADyC,CACjCgE,CADiC,CACpB7F,CADoB,CACT,CA0C5C0tB,QAASA,EAAkB,CAACC,CAAD,CAAO,CAChC,IAAIC,EAAaA,QAA+B,CAACC,CAAD,CAAe,CAC7D,IAAAC,qBAAA,CAA4BC,QAAQ,EAAG,CACrC,MAAOF,EAD8B,CADsB,CAK3DF,EAAJ,GACEC,CAAAhuB,UADF,CACyB,IAAI+tB,CAD7B,CAGAC,EAAAhuB,UAAAue,QAAA,CAA+B6P,QAAmB,EAAG,CACnD,MAAO,KAAAF,qBAAA,EAD4C,CAGrDF,EAAAhuB,UAAA7R,SAAA,CAAgCkgC,QAAoB,EAAG,CACrD,MAAO,KAAAH,qBAAA,EAAA//B,SAAA,EAD8C,CAGvD,OAAO6/B,EAfyB,CAxClC,IAAIM,EAAgBA,QAAsB,CAACv8B,CAAD,CAAO,CAC/C,KAAMq7B,GAAA,CAAW,QAAX,CAAN;AAD+C,CAI7ChtB,EAAAF,IAAA,CAAc,WAAd,CAAJ,GACEouB,CADF,CACkBluB,CAAAvB,IAAA,CAAc,WAAd,CADlB,CAN4C,KA4DxC0vB,EAAyBT,CAAA,EA5De,CA6DxCU,EAAS,EAEbA,EAAA,CAAOf,EAAAgB,KAAP,CAAA,CAA4BX,CAAA,CAAmBS,CAAnB,CAC5BC,EAAA,CAAOf,EAAAiB,IAAP,CAAA,CAA2BZ,CAAA,CAAmBS,CAAnB,CAC3BC,EAAA,CAAOf,EAAAkB,IAAP,CAAA,CAA2Bb,CAAA,CAAmBS,CAAnB,CAC3BC,EAAA,CAAOf,EAAAmB,GAAP,CAAA,CAA0Bd,CAAA,CAAmBS,CAAnB,CAC1BC,EAAA,CAAOf,EAAA1Z,aAAP,CAAA,CAAoC+Z,CAAA,CAAmBU,CAAA,CAAOf,EAAAkB,IAAP,CAAnB,CA0GpC,OAAO,SAtFPE,QAAgB,CAAC70B,CAAD,CAAOi0B,CAAP,CAAqB,CACnC,IAAIl4B,EAAey4B,CAAA9iC,eAAA,CAAsBsO,CAAtB,CAAA,CAA8Bw0B,CAAA,CAAOx0B,CAAP,CAA9B,CAA6C,IAChE,IAAI,CAACjE,CAAL,CACE,KAAMq3B,GAAA,CAAW,UAAX,CACFpzB,CADE,CACIi0B,CADJ,CAAN,CAGF,GAAqB,IAArB,GAAIA,CAAJ,EAA6BA,CAA7B,GAA8CrjC,CAA9C,EAA4E,EAA5E,GAA2DqjC,CAA3D,CACE,MAAOA,EAIT,IAA4B,QAA5B,GAAI,MAAOA,EAAX,CACE,KAAMb,GAAA,CAAW,OAAX,CAEFpzB,CAFE,CAAN,CAIF,MAAO,KAAIjE,CAAJ,CAAgBk4B,CAAhB,CAhB4B,CAsF9B,YAxBP3P,QAAmB,CAACtkB,CAAD,CAAO80B,CAAP,CAAqB,CACtC,GAAqB,IAArB,GAAIA,CAAJ,EAA6BA,CAA7B,GAA8ClkC,CAA9C,EAA4E,EAA5E,GAA2DkkC,CAA3D,CACE,MAAOA,EAET,KAAI/4B,EAAey4B,CAAA9iC,eAAA,CAAsBsO,CAAtB,CAAA,CAA8Bw0B,CAAA,CAAOx0B,CAAP,CAA9B,CAA6C,IAChE,IAAIjE,CAAJ,EAAmB+4B,CAAnB,WAA2C/4B,EAA3C,CACE,MAAO+4B,EAAAZ,qBAAA,EAKT,IAAIl0B,CAAJ;AAAayzB,EAAA1Z,aAAb,CAAwC,CA3IpCiM,IAAAA,EAAYnK,EAAA,CA4ImBiZ,CA5IR3gC,SAAA,EAAX,CAAZ6xB,CACA/zB,CADA+zB,CACGrZ,CADHqZ,CACM+O,EAAU,CAAA,CAEf9iC,EAAA,CAAI,CAAT,KAAY0a,CAAZ,CAAgB+mB,CAAAziC,OAAhB,CAA6CgB,CAA7C,CAAiD0a,CAAjD,CAAoD1a,CAAA,EAApD,CACE,GAbc,MAAhB,GAaeyhC,CAAAP,CAAqBlhC,CAArBkhC,CAbf,CACS9T,EAAA,CAY+B2G,CAZ/B,CADT,CAae0N,CAAAP,CAAqBlhC,CAArBkhC,CATJt5B,KAAA,CAS6BmsB,CAThB9b,KAAb,CAST,CAAkD,CAChD6qB,CAAA,CAAU,CAAA,CACV,MAFgD,CAKpD,GAAIA,CAAJ,CAEE,IAAK9iC,CAAO,CAAH,CAAG,CAAA0a,CAAA,CAAIgnB,CAAA1iC,OAAhB,CAA6CgB,CAA7C,CAAiD0a,CAAjD,CAAoD1a,CAAA,EAApD,CACE,GArBY,MAAhB,GAqBiB0hC,CAAAR,CAAqBlhC,CAArBkhC,CArBjB,CACS9T,EAAA,CAoBiC2G,CApBjC,CADT,CAqBiB2N,CAAAR,CAAqBlhC,CAArBkhC,CAjBNt5B,KAAA,CAiB+BmsB,CAjBlB9b,KAAb,CAiBP,CAAkD,CAChD6qB,CAAA,CAAU,CAAA,CACV,MAFgD,CAgIpD,GA1HKA,CA0HL,CACE,MAAOD,EAEP,MAAM1B,GAAA,CAAW,UAAX,CACiF0B,CAAA3gC,SAAA,EADjF,CAAN,CAJoC,CAOjC,GAAI6L,CAAJ,GAAayzB,EAAAgB,KAAb,CACL,MAAOH,EAAA,CAAcQ,CAAd,CAET,MAAM1B,GAAA,CAAW,QAAX,CAAN,CArBsC,CAwBjC,SAhDP7O,QAAgB,CAACuQ,CAAD,CAAe,CAC7B,MAAIA,EAAJ,WAA4BP,EAA5B,CACSO,CAAAZ,qBAAA,EADT,CAGSY,CAJoB,CAgDxB,CA7KqC,CADlC,CAxEkB,CA8gBhCE,QAASA,GAAY,EAAG,CACtB,IAAIn6B,EAAU,CAAA,CAcd,KAAAA,QAAA,CAAeo6B,QAAS,CAAC7iC,CAAD,CAAQ,CAC1Be,SAAAlC,OAAJ,GACE4J,CADF,CACY,CAAC,CAACzI,CADd,CAGA,OAAOyI,EAJuB,CAsDhC,KAAA0J,KAAA,CAAY,CAAC,QAAD,CAAW,WAAX,CAAwB,cAAxB;AAAwC,QAAQ,CAC9CiL,CAD8C,CACpCvD,CADoC,CACvBipB,CADuB,CACT,CAGjD,GAAIr6B,CAAJ,EAAemI,CAAf,GACMmyB,CACA,CADelpB,CAAA,CAAU,CAAV,CAAAkpB,aACf,CAAAA,CAAA,GAAiBvkC,CAAjB,EAA6C,CAA7C,CAA8BukC,CAFpC,EAGI,KAAM/B,GAAA,CAAW,UAAX,CAAN,CAOJ,IAAIgC,EAAM//B,EAAA,CAAKo+B,EAAL,CAcV2B,EAAAC,UAAA,CAAgBC,QAAS,EAAG,CAC1B,MAAOz6B,EADmB,CAG5Bu6B,EAAAP,QAAA,CAAcK,CAAAL,QACdO,EAAA9Q,WAAA,CAAiB4Q,CAAA5Q,WACjB8Q,EAAA7Q,QAAA,CAAc2Q,CAAA3Q,QAET1pB,EAAL,GACEu6B,CAAAP,QACA,CADcO,CAAA9Q,WACd,CAD+BiR,QAAQ,CAACv1B,CAAD,CAAO5N,CAAP,CAAc,CAAE,MAAOA,EAAT,CACrD,CAAAgjC,CAAA7Q,QAAA,CAAc5wB,EAFhB,CAyBAyhC,EAAAI,QAAA,CAAcC,QAAmB,CAACz1B,CAAD,CAAOyyB,CAAP,CAAa,CAC5C,IAAI3V,EAAStN,CAAA,CAAOijB,CAAP,CACb,OAAI3V,EAAA4Y,QAAJ,EAAsB5Y,CAAAzW,SAAtB,CACSyW,CADT,CAGS6Y,QAA0B,CAACl/B,CAAD,CAAOkP,CAAP,CAAe,CAC9C,MAAOyvB,EAAA9Q,WAAA,CAAetkB,CAAf,CAAqB8c,CAAA,CAAOrmB,CAAP,CAAakP,CAAb,CAArB,CADuC,CALN,CA3DG,KAwT7CpO,EAAQ69B,CAAAI,QAxTqC,CAyT7ClR,EAAa8Q,CAAA9Q,WAzTgC,CA0T7CuQ,EAAUO,CAAAP,QAEdxjC,EAAA,CAAQoiC,EAAR,CAAsB,QAAS,CAACmC,CAAD,CAAYl8B,CAAZ,CAAkB,CAC/C,IAAIm8B,EAAQn+B,CAAA,CAAUgC,CAAV,CACZ07B,EAAA,CAAI73B,EAAA,CAAU,WAAV,CAAwBs4B,CAAxB,CAAJ,CAAA,CAAsC,QAAS,CAACpD,CAAD,CAAO,CACpD,MAAOl7B,EAAA,CAAMq+B,CAAN,CAAiBnD,CAAjB,CAD6C,CAGtD2C,EAAA,CAAI73B,EAAA,CAAU,cAAV;AAA2Bs4B,CAA3B,CAAJ,CAAA,CAAyC,QAAS,CAACzjC,CAAD,CAAQ,CACxD,MAAOkyB,EAAA,CAAWsR,CAAX,CAAsBxjC,CAAtB,CADiD,CAG1DgjC,EAAA,CAAI73B,EAAA,CAAU,WAAV,CAAwBs4B,CAAxB,CAAJ,CAAA,CAAsC,QAAS,CAACzjC,CAAD,CAAQ,CACrD,MAAOyiC,EAAA,CAAQe,CAAR,CAAmBxjC,CAAnB,CAD8C,CARR,CAAjD,CAaA,OAAOgjC,EAzU0C,CADvC,CArEU,CAkaxBU,QAASA,GAAgB,EAAG,CAC1B,IAAAvxB,KAAA,CAAY,CAAC,SAAD,CAAY,WAAZ,CAAyB,QAAQ,CAAC4C,CAAD,CAAU8E,CAAV,CAAqB,CAAA,IAC5D8pB,EAAe,EAD6C,CAE5DC,EAAU5iC,CAAA,CAAI,CAAC,eAAAyG,KAAA,CAAqBnC,CAAA,CAAWu+B,CAAA9uB,CAAA+uB,UAAAD,EAAqB,EAArBA,WAAX,CAArB,CAAD,EAAyE,EAAzE,EAA6E,CAA7E,CAAJ,CAFkD,CAG5DE,EAAQ,QAAAp7B,KAAA,CAAek7B,CAAA9uB,CAAA+uB,UAAAD,EAAqB,EAArBA,WAAf,CAHoD,CAI5DtlC,EAAWsb,CAAA,CAAU,CAAV,CAAXtb,EAA2B,EAJiC,CAK5DylC,CAL4D,CAM5DC,EAAc,6BAN8C,CAO5DC,EAAY3lC,CAAA2xB,KAAZgU,EAA6B3lC,CAAA2xB,KAAAiU,MAP+B,CAQ5DC,EAAc,CAAA,CAR8C,CAS5DC,EAAa,CAAA,CAGjB,IAAIH,CAAJ,CAAe,CACb,IAAI3a,IAAIA,CAAR,GAAgB2a,EAAhB,CACE,GAAGl+B,CAAH,CAAWi+B,CAAAx8B,KAAA,CAAiB8hB,CAAjB,CAAX,CAAmC,CACjCya,CAAA,CAAeh+B,CAAA,CAAM,CAAN,CACfg+B,EAAA,CAAeA,CAAApgC,OAAA,CAAoB,CAApB,CAAuB,CAAvB,CAAA2H,YAAA,EAAf,CAAyDy4B,CAAApgC,OAAA,CAAoB,CAApB,CACzD,MAHiC,CAOjCogC,CAAJ,GACEA,CADF,CACkB,eADlB,EACqCE,EADrC,EACmD,QADnD,CAIAE,EAAA,CAAc,CAAC,EAAG,YAAH,EAAmBF,EAAnB;AAAkCF,CAAlC,CAAiD,YAAjD,EAAiEE,EAAjE,CACfG,EAAA,CAAc,CAAC,EAAG,WAAH,EAAkBH,EAAlB,EAAiCF,CAAjC,CAAgD,WAAhD,EAA+DE,EAA/D,CAEXN,EAAAA,CAAJ,EAAiBQ,CAAjB,EAA+BC,CAA/B,GACED,CACA,CADcrlC,CAAA,CAASR,CAAA2xB,KAAAiU,MAAAG,iBAAT,CACd,CAAAD,CAAA,CAAatlC,CAAA,CAASR,CAAA2xB,KAAAiU,MAAAI,gBAAT,CAFf,CAhBa,CAuBf,MAAO,SAQI,EAAGrtB,CAAAnC,CAAAmC,QAAH,EAAsBgB,CAAAnD,CAAAmC,QAAAgB,UAAtB,EAA+D,CAA/D,CAAqD0rB,CAArD,EAAsEG,CAAtE,CARJ,YASO,cATP,EASyBhvB,EATzB,GAWQ,CAACxW,CAAAwkC,aAXT,EAW0D,CAX1D,CAWkCxkC,CAAAwkC,aAXlC,WAYKyB,QAAQ,CAACz0B,CAAD,CAAQ,CAIxB,GAAa,OAAb,EAAIA,CAAJ,EAAgC,CAAhC,EAAwBa,CAAxB,CAAmC,MAAO,CAAA,CAE1C,IAAIlP,CAAA,CAAYiiC,CAAA,CAAa5zB,CAAb,CAAZ,CAAJ,CAAsC,CACpC,IAAI00B,EAASlmC,CAAAwO,cAAA,CAAuB,KAAvB,CACb42B,EAAA,CAAa5zB,CAAb,CAAA,CAAsB,IAAtB,CAA6BA,CAA7B,GAAsC00B,EAFF,CAKtC,MAAOd,EAAA,CAAa5zB,CAAb,CAXiB,CAZrB,KAyBAxR,CAAAmmC,eAAA,CAA0BnmC,CAAAmmC,eAAAC,SAA1B,CAA6D,CAAA,CAzB7D,cA0BSX,CA1BT,aA2BSI,CA3BT,YA4BQC,CA5BR,CAnCyD,CAAtD,CADc,CAqE5BO,QAASA,GAAgB,EAAG,CAC1B,IAAAzyB,KAAA;AAAY,CAAC,YAAD,CAAe,UAAf,CAA2B,IAA3B,CAAiC,mBAAjC,CACP,QAAQ,CAAC8C,CAAD,CAAe2W,CAAf,CAA2BC,CAA3B,CAAiCrP,CAAjC,CAAoD,CAqH/D0S,QAASA,EAAO,CAAC5qB,CAAD,CAAKiV,CAAL,CAAYmZ,CAAZ,CAAyB,CAAA,IACnCjE,EAAW5C,CAAAxS,MAAA,EADwB,CAEnCqU,EAAUe,CAAAf,QAFyB,CAGnCmF,EAAalxB,CAAA,CAAU+wB,CAAV,CAAbG,EAAuC,CAACH,CAG5ClZ,EAAA,CAAYoS,CAAAvS,MAAA,CAAe,QAAQ,EAAG,CACpC,GAAI,CACFoV,CAAAC,QAAA,CAAiBpqB,CAAA,EAAjB,CADE,CAEF,MAAMsB,CAAN,CAAS,CACT6oB,CAAAvC,OAAA,CAAgBtmB,CAAhB,CACA,CAAA4W,CAAA,CAAkB5W,CAAlB,CAFS,CAFX,OAMQ,CACN,OAAOi/B,CAAA,CAAUnX,CAAAoX,YAAV,CADD,CAIHjS,CAAL,EAAgB5d,CAAA1M,OAAA,EAXoB,CAA1B,CAYTgR,CAZS,CAcZmU,EAAAoX,YAAA,CAAsBtrB,CACtBqrB,EAAA,CAAUrrB,CAAV,CAAA,CAAuBiV,CAEvB,OAAOf,EAvBgC,CApHzC,IAAImX,EAAY,EA4JhB3V,EAAAzV,OAAA,CAAiBsrB,QAAQ,CAACrX,CAAD,CAAU,CACjC,MAAIA,EAAJ,EAAeA,CAAAoX,YAAf,GAAsCD,EAAtC,EACEA,CAAA,CAAUnX,CAAAoX,YAAV,CAAA5Y,OAAA,CAAsC,UAAtC,CAEO,CADP,OAAO2Y,CAAA,CAAUnX,CAAAoX,YAAV,CACA,CAAAlZ,CAAAvS,MAAAI,OAAA,CAAsBiU,CAAAoX,YAAtB,CAHT,EAKO,CAAA,CAN0B,CASnC,OAAO5V,EAtKwD,CADrD,CADc,CA0O5BzF,QAASA,GAAU,CAAC3S,CAAD,CAAM,CAEnBlG,CAAJ,GAGEo0B,CAAA91B,aAAA,CAA4B,MAA5B,CAAoC4I,CAApC,CACA,CAAAA,CAAA,CAAOktB,CAAAltB,KAJT,CAOAktB,EAAA91B,aAAA,CAA4B,MAA5B;AAAoC4I,CAApC,CAGA,OAAO,MACCktB,CAAAltB,KADD,UAEKktB,CAAApV,SAAA,CAA0BoV,CAAApV,SAAA3pB,QAAA,CAAgC,IAAhC,CAAsC,EAAtC,CAA1B,CAAsE,EAF3E,MAGC++B,CAAAC,KAHD,QAIGD,CAAAvQ,OAAA,CAAwBuQ,CAAAvQ,OAAAxuB,QAAA,CAA8B,KAA9B,CAAqC,EAArC,CAAxB,CAAmE,EAJtE,MAKC++B,CAAA3vB,KAAA,CAAsB2vB,CAAA3vB,KAAApP,QAAA,CAA4B,IAA5B,CAAkC,EAAlC,CAAtB,CAA8D,EAL/D,UAMK++B,CAAAjR,SANL,MAOCiR,CAAA/Q,KAPD,UAQK+Q,CAAAzQ,SAAA,EAAiE,GAAjE,GAA2ByQ,CAAAzQ,SAAApwB,OAAA,CAA+B,CAA/B,CAA3B,CAAuE6gC,CAAAzQ,SAAvE,CAAiG,GAAjG,CAAuGyQ,CAAAzQ,SAR5G,CAZgB,CAgCzBtH,QAASA,GAAe,CAACiY,CAAD,CAAa,CAC/Bxa,CAAAA,CAAU3rB,CAAA,CAASmmC,CAAT,CAAD,CAAyBzb,EAAA,CAAWyb,CAAX,CAAzB,CAAkDA,CAC/D,OAAQxa,EAAAkF,SAAR,GAA4BuV,EAAAvV,SAA5B,EACQlF,CAAAua,KADR,GACwBE,EAAAF,KAHW,CA4CrCG,QAASA,GAAe,EAAE,CACxB,IAAAjzB,KAAA,CAAY1Q,EAAA,CAAQnD,CAAR,CADY,CA+E1B+mC,QAASA,GAAe,CAACp9B,CAAD,CAAW,CAYjCgiB,QAASA,EAAQ,CAAC3iB,CAAD,CAAO8C,CAAP,CAAgB,CAC/B,GAAGxI,CAAA,CAAS0F,CAAT,CAAH,CAAmB,CACjB,IAAIg+B,EAAU,EACdrmC,EAAA,CAAQqI,CAAR,CAAc,QAAQ,CAACyE,CAAD,CAAS3M,CAAT,CAAc,CAClCkmC,CAAA,CAAQlmC,CAAR,CAAA,CAAe6qB,CAAA,CAAS7qB,CAAT,CAAc2M,CAAd,CADmB,CAApC,CAGA,OAAOu5B,EALU,CAOjB,MAAOr9B,EAAAmC,QAAA,CAAiB9C,CAAjB,CAAwBi+B,CAAxB,CAAgCn7B,CAAhC,CARsB,CAZA;AACjC,IAAIm7B,EAAS,QAsBb,KAAAtb,SAAA,CAAgBA,CAEhB,KAAA9X,KAAA,CAAY,CAAC,WAAD,CAAc,QAAQ,CAAC6B,CAAD,CAAY,CAC5C,MAAO,SAAQ,CAAC1M,CAAD,CAAO,CACpB,MAAO0M,EAAAvB,IAAA,CAAcnL,CAAd,CAAqBi+B,CAArB,CADa,CADsB,CAAlC,CAQZtb,EAAA,CAAS,UAAT,CAAqBub,EAArB,CACAvb,EAAA,CAAS,MAAT,CAAiBwb,EAAjB,CACAxb,EAAA,CAAS,QAAT,CAAmByb,EAAnB,CACAzb,EAAA,CAAS,MAAT,CAAiB0b,EAAjB,CACA1b,EAAA,CAAS,SAAT,CAAoB2b,EAApB,CACA3b,EAAA,CAAS,WAAT,CAAsB4b,EAAtB,CACA5b,EAAA,CAAS,QAAT,CAAmB6b,EAAnB,CACA7b,EAAA,CAAS,SAAT,CAAoB8b,EAApB,CACA9b,EAAA,CAAS,WAAT,CAAsB+b,EAAtB,CAzCiC,CAoJnCN,QAASA,GAAY,EAAG,CACtB,MAAO,SAAQ,CAAC5iC,CAAD,CAAQqnB,CAAR,CAAoB8b,CAApB,CAAgC,CAC7C,GAAI,CAACjnC,CAAA,CAAQ8D,CAAR,CAAL,CAAqB,MAAOA,EAC5B,KAAIojC,EAAa,EACjBA,EAAA3vB,MAAA,CAAmB4vB,QAAQ,CAACnmC,CAAD,CAAQ,CACjC,IAAK,IAAIogB,EAAI,CAAb,CAAgBA,CAAhB,CAAoB8lB,CAAArnC,OAApB,CAAuCuhB,CAAA,EAAvC,CACE,GAAG,CAAC8lB,CAAA,CAAW9lB,CAAX,CAAA,CAAcpgB,CAAd,CAAJ,CACE,MAAO,CAAA,CAGX,OAAO,CAAA,CAN0B,CAQnC,QAAO,MAAOimC,EAAd,EACE,KAAK,UAAL,CACE,KACF,MAAK,SAAL,CACE,GAAiB,CAAA,CAAjB,EAAGA,CAAH,CAAuB,CACrBA,CAAA,CAAaA,QAAQ,CAACtnC,CAAD,CAAMyoB,CAAN,CAAY,CAC/B,MAAOxe,GAAA/E,OAAA,CAAelF,CAAf,CAAoByoB,CAApB,CADwB,CAGjC,MAJqB,CAMzB,QACE6e,CAAA;AAAaA,QAAQ,CAACtnC,CAAD,CAAMyoB,CAAN,CAAY,CAC/BA,CAAA,CAAQ/d,CAAA,EAAAA,CAAG+d,CAAH/d,aAAA,EACR,OAA+C,EAA/C,CAAQA,CAAA,EAAAA,CAAG1K,CAAH0K,aAAA,EAAAxG,QAAA,CAA8BukB,CAA9B,CAFuB,CAXrC,CAgBA,IAAIqN,EAASA,QAAQ,CAAC91B,CAAD,CAAMyoB,CAAN,CAAW,CAC9B,GAAmB,QAAnB,EAAI,MAAOA,EAAX,EAAkD,GAAlD,GAA+BA,CAAAjjB,OAAA,CAAY,CAAZ,CAA/B,CACE,MAAO,CAACswB,CAAA,CAAO91B,CAAP,CAAYyoB,CAAAxjB,OAAA,CAAY,CAAZ,CAAZ,CAEV,QAAQ,MAAOjF,EAAf,EACE,KAAK,SAAL,CACA,KAAK,QAAL,CACA,KAAK,QAAL,CACE,MAAOsnC,EAAA,CAAWtnC,CAAX,CAAgByoB,CAAhB,CACT,MAAK,QAAL,CACE,OAAQ,MAAOA,EAAf,EACE,KAAK,QAAL,CACE,MAAO6e,EAAA,CAAWtnC,CAAX,CAAgByoB,CAAhB,CAET,SACE,IAAMgf,IAAIA,CAAV,GAAoBznC,EAApB,CACE,GAAyB,GAAzB,GAAIynC,CAAAjiC,OAAA,CAAc,CAAd,CAAJ,EAAgCswB,CAAA,CAAO91B,CAAA,CAAIynC,CAAJ,CAAP,CAAoBhf,CAApB,CAAhC,CACE,MAAO,CAAA,CAPf,CAYA,MAAO,CAAA,CACT,MAAK,OAAL,CACE,IAAUvnB,CAAV,CAAc,CAAd,CAAiBA,CAAjB,CAAqBlB,CAAAE,OAArB,CAAiCgB,CAAA,EAAjC,CACE,GAAI40B,CAAA,CAAO91B,CAAA,CAAIkB,CAAJ,CAAP,CAAeunB,CAAf,CAAJ,CACE,MAAO,CAAA,CAGX,OAAO,CAAA,CACT,SACE,MAAO,CAAA,CA3BX,CAJ8B,CAkChC,QAAQ,MAAO+C,EAAf,EACE,KAAK,SAAL,CACA,KAAK,QAAL,CACA,KAAK,QAAL,CACEA,CAAA;AAAa,GAAGA,CAAH,CACf,MAAK,QAAL,CACE,IAAK/qB,IAAIA,CAAT,GAAgB+qB,EAAhB,CACa,GAAX,EAAI/qB,CAAJ,CACG,QAAQ,EAAG,CACV,GAAK+qB,CAAA,CAAW/qB,CAAX,CAAL,CAAA,CACA,IAAI0K,EAAO1K,CACX8mC,EAAAxmC,KAAA,CAAgB,QAAQ,CAACM,CAAD,CAAQ,CAC9B,MAAOy0B,EAAA,CAAOz0B,CAAP,CAAcmqB,CAAA,CAAWrgB,CAAX,CAAd,CADuB,CAAhC,CAFA,CADU,CAAX,EADH,CASG,QAAQ,EAAG,CACV,GAA+B,WAA/B,EAAI,MAAOqgB,EAAA,CAAW/qB,CAAX,CAAX,CAAA,CACA,IAAI0K,EAAO1K,CACX8mC,EAAAxmC,KAAA,CAAgB,QAAQ,CAACM,CAAD,CAAQ,CAC9B,MAAOy0B,EAAA,CAAO5qB,EAAA,CAAO7J,CAAP,CAAa8J,CAAb,CAAP,CAA2BqgB,CAAA,CAAWrgB,CAAX,CAA3B,CADuB,CAAhC,CAFA,CADU,CAAX,EASL,MACF,MAAK,UAAL,CACEo8B,CAAAxmC,KAAA,CAAgByqB,CAAhB,CACA,MACF,SACE,MAAOrnB,EA9BX,CAiCA,IADA,IAAIujC,EAAW,EAAf,CACUjmB,EAAI,CAAd,CAAiBA,CAAjB,CAAqBtd,CAAAjE,OAArB,CAAmCuhB,CAAA,EAAnC,CAAwC,CACtC,IAAIpgB,EAAQ8C,CAAA,CAAMsd,CAAN,CACR8lB,EAAA3vB,MAAA,CAAiBvW,CAAjB,CAAJ,EACEqmC,CAAA3mC,KAAA,CAAcM,CAAd,CAHoC,CAMxC,MAAOqmC,EApGsC,CADzB,CAmJxBb,QAASA,GAAc,CAACc,CAAD,CAAU,CAC/B,IAAIC,EAAUD,CAAAE,eACd,OAAO,SAAQ,CAACC,CAAD,CAASC,CAAT,CAAwB,CACjChlC,CAAA,CAAYglC,CAAZ,CAAJ,GAAiCA,CAAjC,CAAkDH,CAAAI,aAAlD,CACA,OAAOC,GAAA,CAAaH,CAAb,CAAqBF,CAAAM,SAAA,CAAiB,CAAjB,CAArB,CAA0CN,CAAAO,UAA1C,CAA6DP,CAAAQ,YAA7D,CAAkF,CAAlF,CAAA9gC,QAAA,CACa,SADb,CACwBygC,CADxB,CAF8B,CAFR,CA2DjCZ,QAASA,GAAY,CAACQ,CAAD,CAAU,CAC7B,IAAIC;AAAUD,CAAAE,eACd,OAAO,SAAQ,CAACQ,CAAD,CAASC,CAAT,CAAuB,CACpC,MAAOL,GAAA,CAAaI,CAAb,CAAqBT,CAAAM,SAAA,CAAiB,CAAjB,CAArB,CAA0CN,CAAAO,UAA1C,CAA6DP,CAAAQ,YAA7D,CACLE,CADK,CAD6B,CAFT,CAS/BL,QAASA,GAAY,CAACI,CAAD,CAASE,CAAT,CAAkBC,CAAlB,CAA4BC,CAA5B,CAAwCH,CAAxC,CAAsD,CACzE,GAAI9G,KAAA,CAAM6G,CAAN,CAAJ,EAAqB,CAACK,QAAA,CAASL,CAAT,CAAtB,CAAwC,MAAO,EAE/C,KAAIM,EAAsB,CAAtBA,CAAaN,CACjBA,EAAA,CAAS5hB,IAAAmiB,IAAA,CAASP,CAAT,CAJgE,KAKrEQ,EAASR,CAATQ,CAAkB,EALmD,CAMrEC,EAAe,EANsD,CAOrEhhC,EAAQ,EAP6D,CASrEihC,EAAc,CAAA,CAClB,IAA6B,EAA7B,GAAIF,CAAA3kC,QAAA,CAAe,GAAf,CAAJ,CAAgC,CAC9B,IAAImD,EAAQwhC,CAAAxhC,MAAA,CAAa,qBAAb,CACRA,EAAJ,EAAyB,GAAzB,EAAaA,CAAA,CAAM,CAAN,CAAb,EAAgCA,CAAA,CAAM,CAAN,CAAhC,CAA2CihC,CAA3C,CAA0D,CAA1D,CACEO,CADF,CACW,GADX,EAGEC,CACA,CADeD,CACf,CAAAE,CAAA,CAAc,CAAA,CAJhB,CAF8B,CAUhC,GAAKA,CAAL,CA2CqB,CAAnB,CAAIT,CAAJ,GAAkC,EAAlC,CAAwBD,CAAxB,EAAgD,CAAhD,CAAuCA,CAAvC,IACES,CADF,CACiBT,CAAAW,QAAA,CAAeV,CAAf,CADjB,CA3CF,KAAkB,CACZW,CAAAA,CAAe/oC,CAAA2oC,CAAAjhC,MAAA,CAAawgC,EAAb,CAAA,CAA0B,CAA1B,CAAAloC,EAAgC,EAAhCA,QAGf6C,EAAA,CAAYulC,CAAZ,CAAJ,GACEA,CADF,CACiB7hB,IAAAyiB,IAAA,CAASziB,IAAAC,IAAA,CAAS6hB,CAAAY,QAAT,CAA0BF,CAA1B,CAAT,CAAiDV,CAAAa,QAAjD,CADjB,CAIIC,EAAAA,CAAM5iB,IAAA4iB,IAAA,CAAS,EAAT,CAAaf,CAAb,CACVD,EAAA,CAAS5hB,IAAA6iB,MAAA,CAAWjB,CAAX,CAAoBgB,CAApB,CAAT,CAAoCA,CAChCE,EAAAA,CAAY3hC,CAAA,EAAAA,CAAKygC,CAALzgC,OAAA,CAAmBwgC,EAAnB,CACZlS,EAAAA,CAAQqT,CAAA,CAAS,CAAT,CACZA,EAAA,CAAWA,CAAA,CAAS,CAAT,CAAX;AAA0B,EAEtB9+B,KAAAA,EAAM,CAANA,CACA++B,EAASjB,CAAAkB,OADTh/B,CAEAi/B,EAAQnB,CAAAoB,MAEZ,IAAIzT,CAAAh2B,OAAJ,EAAqBspC,CAArB,CAA8BE,CAA9B,CAEE,IADA,IAAAj/B,EAAMyrB,CAAAh2B,OAANuK,CAAqB++B,CAArB,CACStoC,EAAI,CAAb,CAAgBA,CAAhB,CAAoBuJ,CAApB,CAAyBvJ,CAAA,EAAzB,CAC0B,CAGxB,IAHKuJ,CAGL,CAHWvJ,CAGX,EAHcwoC,CAGd,EAHmC,CAGnC,GAH6BxoC,CAG7B,GAFE4nC,CAEF,EAFkBN,CAElB,EAAAM,CAAA,EAAgB5S,CAAA1wB,OAAA,CAAatE,CAAb,CAIpB,KAAKA,CAAL,CAASuJ,CAAT,CAAcvJ,CAAd,CAAkBg1B,CAAAh2B,OAAlB,CAAgCgB,CAAA,EAAhC,CACoC,CAGlC,IAHKg1B,CAAAh2B,OAGL,CAHoBgB,CAGpB,EAHuBsoC,CAGvB,EAH6C,CAG7C,GAHuCtoC,CAGvC,GAFE4nC,CAEF,EAFkBN,CAElB,EAAAM,CAAA,EAAgB5S,CAAA1wB,OAAA,CAAatE,CAAb,CAIlB,KAAA,CAAMqoC,CAAArpC,OAAN,CAAwBooC,CAAxB,CAAA,CACEiB,CAAA,EAAY,GAGVjB,EAAJ,EAAqC,GAArC,GAAoBA,CAApB,GAA0CQ,CAA1C,EAA0DL,CAA1D,CAAuEc,CAAAtkC,OAAA,CAAgB,CAAhB,CAAmBqjC,CAAnB,CAAvE,CAxCgB,CAgDlBxgC,CAAA/G,KAAA,CAAW4nC,CAAA,CAAaJ,CAAAqB,OAAb,CAA8BrB,CAAAsB,OAAzC,CACA/hC,EAAA/G,KAAA,CAAW+nC,CAAX,CACAhhC,EAAA/G,KAAA,CAAW4nC,CAAA,CAAaJ,CAAAuB,OAAb,CAA8BvB,CAAAwB,OAAzC,CACA,OAAOjiC,EAAAnG,KAAA,CAAW,EAAX,CAvEkE,CA0E3EqoC,QAASA,GAAS,CAACrV,CAAD,CAAMsV,CAAN,CAAcx5B,CAAd,CAAoB,CACpC,IAAIy5B,EAAM,EACA,EAAV,CAAIvV,CAAJ,GACEuV,CACA,CADO,GACP,CAAAvV,CAAA,CAAM,CAACA,CAFT,CAKA,KADAA,CACA,CADM,EACN,CADWA,CACX,CAAMA,CAAAz0B,OAAN,CAAmB+pC,CAAnB,CAAA,CAA2BtV,CAAA,CAAM,GAAN,CAAYA,CACnClkB,EAAJ,GACEkkB,CADF,CACQA,CAAA1vB,OAAA,CAAW0vB,CAAAz0B,OAAX,CAAwB+pC,CAAxB,CADR,CAEA,OAAOC,EAAP,CAAavV,CAVuB,CActCwV,QAASA,EAAU,CAACxhC,CAAD,CAAOuT,CAAP,CAAavP,CAAb,CAAqB8D,CAArB,CAA2B,CAC5C9D,CAAA,CAASA,CAAT,EAAmB,CACnB,OAAO,SAAQ,CAACy9B,CAAD,CAAO,CAChB/oC,CAAAA;AAAQ+oC,CAAA,CAAK,KAAL,CAAazhC,CAAb,CAAA,EACZ,IAAa,CAAb,CAAIgE,CAAJ,EAAkBtL,CAAlB,CAA0B,CAACsL,CAA3B,CACEtL,CAAA,EAASsL,CACG,EAAd,GAAItL,CAAJ,EAA8B,GAA9B,EAAmBsL,CAAnB,GAAmCtL,CAAnC,CAA2C,EAA3C,CACA,OAAO2oC,GAAA,CAAU3oC,CAAV,CAAiB6a,CAAjB,CAAuBzL,CAAvB,CALa,CAFsB,CAW9C45B,QAASA,GAAa,CAAC1hC,CAAD,CAAO2hC,CAAP,CAAkB,CACtC,MAAO,SAAQ,CAACF,CAAD,CAAOxC,CAAP,CAAgB,CAC7B,IAAIvmC,EAAQ+oC,CAAA,CAAK,KAAL,CAAazhC,CAAb,CAAA,EAAZ,CACImL,EAAMsa,EAAA,CAAUkc,CAAA,CAAa,OAAb,CAAuB3hC,CAAvB,CAA+BA,CAAzC,CAEV,OAAOi/B,EAAA,CAAQ9zB,CAAR,CAAA,CAAazS,CAAb,CAJsB,CADO,CAuIxCylC,QAASA,GAAU,CAACa,CAAD,CAAU,CAK3B4C,QAASA,EAAgB,CAACC,CAAD,CAAS,CAChC,IAAInjC,CACJ,IAAIA,CAAJ,CAAYmjC,CAAAnjC,MAAA,CAAaojC,CAAb,CAAZ,CAAyC,CACnCL,CAAAA,CAAO,IAAIxlC,IAAJ,CAAS,CAAT,CAD4B,KAEnC8lC,EAAS,CAF0B,CAGnCC,EAAS,CAH0B,CAInCC,EAAavjC,CAAA,CAAM,CAAN,CAAA,CAAW+iC,CAAAS,eAAX,CAAiCT,CAAAU,YAJX,CAKnCC,EAAa1jC,CAAA,CAAM,CAAN,CAAA,CAAW+iC,CAAAY,YAAX,CAA8BZ,CAAAa,SAE3C5jC,EAAA,CAAM,CAAN,CAAJ,GACEqjC,CACA,CADSroC,CAAA,CAAIgF,CAAA,CAAM,CAAN,CAAJ,CAAeA,CAAA,CAAM,EAAN,CAAf,CACT,CAAAsjC,CAAA,CAAQtoC,CAAA,CAAIgF,CAAA,CAAM,CAAN,CAAJ,CAAeA,CAAA,CAAM,EAAN,CAAf,CAFV,CAIAujC,EAAAhqC,KAAA,CAAgBwpC,CAAhB,CAAsB/nC,CAAA,CAAIgF,CAAA,CAAM,CAAN,CAAJ,CAAtB,CAAqChF,CAAA,CAAIgF,CAAA,CAAM,CAAN,CAAJ,CAArC,CAAqD,CAArD,CAAwDhF,CAAA,CAAIgF,CAAA,CAAM,CAAN,CAAJ,CAAxD,CACIrF,EAAAA,CAAIK,CAAA,CAAIgF,CAAA,CAAM,CAAN,CAAJ,EAAc,CAAd,CAAJrF,CAAuB0oC,CACvBQ,EAAAA,CAAI7oC,CAAA,CAAIgF,CAAA,CAAM,CAAN,CAAJ,EAAc,CAAd,CAAJ6jC,CAAuBP,CACvBQ,EAAAA,CAAI9oC,CAAA,CAAIgF,CAAA,CAAM,CAAN,CAAJ,EAAc,CAAd,CACJ+jC,EAAAA,CAAK3kB,IAAA6iB,MAAA,CAA8C,GAA9C,CAAW+B,UAAA,CAAW,IAAX,EAAmBhkC,CAAA,CAAM,CAAN,CAAnB,EAA6B,CAA7B,EAAX,CACT0jC,EAAAnqC,KAAA,CAAgBwpC,CAAhB,CAAsBpoC,CAAtB,CAAyBkpC,CAAzB,CAA4BC,CAA5B,CAA+BC,CAA/B,CAhBuC,CAmBzC,MAAOZ,EArByB,CALP;AAG3B,IAAIC,EAAgB,sGA2BpB,OAAO,SAAQ,CAACL,CAAD,CAAOkB,CAAP,CAAe,CAAA,IACxB7iB,EAAO,EADiB,CAExB3gB,EAAQ,EAFgB,CAGxBnC,CAHwB,CAGpB0B,CAERikC,EAAA,CAASA,CAAT,EAAmB,YACnBA,EAAA,CAAS3D,CAAA4D,iBAAA,CAAyBD,CAAzB,CAAT,EAA6CA,CACzClrC,EAAA,CAASgqC,CAAT,CAAJ,GAEIA,CAFJ,CACMoB,EAAAxhC,KAAA,CAAmBogC,CAAnB,CAAJ,CACS/nC,CAAA,CAAI+nC,CAAJ,CADT,CAGSG,CAAA,CAAiBH,CAAjB,CAJX,CAQIlnC,GAAA,CAASknC,CAAT,CAAJ,GACEA,CADF,CACS,IAAIxlC,IAAJ,CAASwlC,CAAT,CADT,CAIA,IAAI,CAACjnC,EAAA,CAAOinC,CAAP,CAAL,CACE,MAAOA,EAGT,KAAA,CAAMkB,CAAN,CAAA,CAEE,CADAjkC,CACA,CADQokC,EAAA3iC,KAAA,CAAwBwiC,CAAxB,CACR,GACExjC,CACA,CADeA,CAtkYd/B,OAAA,CAAcF,EAAAjF,KAAA,CAskYOyG,CAtkYP,CAskYc9F,CAtkYd,CAAd,CAukYD,CAAA+pC,CAAA,CAASxjC,CAAAyP,IAAA,EAFX,GAIEzP,CAAA/G,KAAA,CAAWuqC,CAAX,CACA,CAAAA,CAAA,CAAS,IALX,CASFhrC,EAAA,CAAQwH,CAAR,CAAe,QAAQ,CAACzG,CAAD,CAAO,CAC5BsE,CAAA,CAAK+lC,EAAA,CAAarqC,CAAb,CACLonB,EAAA,EAAQ9iB,CAAA,CAAKA,CAAA,CAAGykC,CAAH,CAASzC,CAAA4D,iBAAT,CAAL,CACKlqC,CAAAiG,QAAA,CAAc,UAAd,CAA0B,EAA1B,CAAAA,QAAA,CAAsC,KAAtC,CAA6C,GAA7C,CAHe,CAA9B,CAMA,OAAOmhB,EAxCqB,CA9BH,CAuG7Bue,QAASA,GAAU,EAAG,CACpB,MAAO,SAAQ,CAAC2E,CAAD,CAAS,CACtB,MAAOzlC,GAAA,CAAOylC,CAAP,CAAe,CAAA,CAAf,CADe,CADJ,CA17ZiB;AAqhavC1E,QAASA,GAAa,EAAE,CACtB,MAAO,SAAQ,CAAC2E,CAAD,CAAQC,CAAR,CAAe,CAC5B,GAAI,CAACxrC,CAAA,CAAQurC,CAAR,CAAL,EAAuB,CAACxrC,CAAA,CAASwrC,CAAT,CAAxB,CAAyC,MAAOA,EAEhDC,EAAA,CAAQxpC,CAAA,CAAIwpC,CAAJ,CAER,IAAIzrC,CAAA,CAASwrC,CAAT,CAAJ,CAEE,MAAIC,EAAJ,CACkB,CAAT,EAAAA,CAAA,CAAaD,CAAA/lC,MAAA,CAAY,CAAZ,CAAegmC,CAAf,CAAb,CAAqCD,CAAA/lC,MAAA,CAAYgmC,CAAZ,CAAmBD,CAAA1rC,OAAnB,CAD9C,CAGS,EAViB,KAcxB4rC,EAAM,EAdkB,CAe1B5qC,CAf0B,CAevB0a,CAGDiwB,EAAJ,CAAYD,CAAA1rC,OAAZ,CACE2rC,CADF,CACUD,CAAA1rC,OADV,CAES2rC,CAFT,CAEiB,CAACD,CAAA1rC,OAFlB,GAGE2rC,CAHF,CAGU,CAACD,CAAA1rC,OAHX,CAKY,EAAZ,CAAI2rC,CAAJ,EACE3qC,CACA,CADI,CACJ,CAAA0a,CAAA,CAAIiwB,CAFN,GAIE3qC,CACA,CADI0qC,CAAA1rC,OACJ,CADmB2rC,CACnB,CAAAjwB,CAAA,CAAIgwB,CAAA1rC,OALN,CAQA,KAAA,CAAOgB,CAAP,CAAS0a,CAAT,CAAY1a,CAAA,EAAZ,CACE4qC,CAAA/qC,KAAA,CAAS6qC,CAAA,CAAM1qC,CAAN,CAAT,CAGF,OAAO4qC,EAnCqB,CADR,CA+HxB1E,QAASA,GAAa,CAAC3oB,CAAD,CAAQ,CAC5B,MAAO,SAAQ,CAACta,CAAD,CAAQ4nC,CAAR,CAAuBC,CAAvB,CAAqC,CA4BlDC,QAASA,EAAiB,CAACC,CAAD,CAAOC,CAAP,CAAmB,CAC3C,MAAO1lC,GAAA,CAAU0lC,CAAV,CACA,CAAD,QAAQ,CAAC/jB,CAAD,CAAGC,CAAH,CAAK,CAAC,MAAO6jB,EAAA,CAAK7jB,CAAL,CAAOD,CAAP,CAAR,CAAZ,CACD8jB,CAHqC,CA1B7C,GADI,CAAC7rC,CAAA,CAAQ8D,CAAR,CACL,EAAI,CAAC4nC,CAAL,CAAoB,MAAO5nC,EAC3B4nC,EAAA,CAAgB1rC,CAAA,CAAQ0rC,CAAR,CAAA,CAAyBA,CAAzB,CAAwC,CAACA,CAAD,CACxDA,EAAA,CAAgBhoC,EAAA,CAAIgoC,CAAJ,CAAmB,QAAQ,CAACK,CAAD,CAAW,CAAA,IAChDD,EAAa,CAAA,CADmC,CAC5Br4B,EAAMs4B,CAANt4B,EAAmBlR,EAC3C,IAAIxC,CAAA,CAASgsC,CAAT,CAAJ,CAAyB,CACvB,GAA4B,GAA5B,EAAKA,CAAA5mC,OAAA,CAAiB,CAAjB,CAAL,EAA0D,GAA1D,EAAmC4mC,CAAA5mC,OAAA,CAAiB,CAAjB,CAAnC,CACE2mC,CACA,CADoC,GACpC,EADaC,CAAA5mC,OAAA,CAAiB,CAAjB,CACb,CAAA4mC,CAAA,CAAYA,CAAA3xB,UAAA,CAAoB,CAApB,CAEd3G;CAAA,CAAM2K,CAAA,CAAO2tB,CAAP,CALiB,CAOzB,MAAOH,EAAA,CAAkB,QAAQ,CAAC7jB,CAAD,CAAGC,CAAH,CAAK,CAC7B,IAAA,CAAQ,EAAA,CAAAvU,CAAA,CAAIsU,CAAJ,CAAO,KAAA,EAAAtU,CAAA,CAAIuU,CAAJ,CAAA,CAoBpBhjB,EAAK,MAAOgnC,EApBQ,CAqBpB/mC,EAAK,MAAOgnC,EACZjnC,EAAJ,EAAUC,CAAV,EACY,QAIV,EAJID,CAIJ,GAHGgnC,CACA,CADKA,CAAA3hC,YAAA,EACL,CAAA4hC,CAAA,CAAKA,CAAA5hC,YAAA,EAER,EAAA,CAAA,CAAI2hC,CAAJ,GAAWC,CAAX,CAAsB,CAAtB,CACOD,CAAA,CAAKC,CAAL,CAAW,EAAX,CAAe,CANxB,EAQE,CARF,CAQSjnC,CAAA,CAAKC,CAAL,CAAW,EAAX,CAAe,CA9BtB,OAAO,EAD6B,CAA/B,CAEJ6mC,CAFI,CAT6C,CAAtC,CAchB,KADA,IAAII,EAAY,EAAhB,CACUrrC,EAAI,CAAd,CAAiBA,CAAjB,CAAqBiD,CAAAjE,OAArB,CAAmCgB,CAAA,EAAnC,CAA0CqrC,CAAAxrC,KAAA,CAAeoD,CAAA,CAAMjD,CAAN,CAAf,CAC1C,OAAOqrC,EAAAvrC,KAAA,CAAeirC,CAAA,CAEtBO,QAAmB,CAACrnC,CAAD,CAAKC,CAAL,CAAQ,CACzB,IAAM,IAAIlE,EAAI,CAAd,CAAiBA,CAAjB,CAAqB6qC,CAAA7rC,OAArB,CAA2CgB,CAAA,EAA3C,CAAgD,CAC9C,IAAIgrC,EAAOH,CAAA,CAAc7qC,CAAd,CAAA,CAAiBiE,CAAjB,CAAqBC,CAArB,CACX,IAAa,CAAb,GAAI8mC,CAAJ,CAAgB,MAAOA,EAFuB,CAIhD,MAAO,EALkB,CAFL,CAA8BF,CAA9B,CAAf,CAnB2C,CADxB,CAmD9BS,QAASA,GAAW,CAAChvB,CAAD,CAAY,CAC1B/c,CAAA,CAAW+c,CAAX,CAAJ,GACEA,CADF,CACc,MACJA,CADI,CADd,CAKAA,EAAAS,SAAA,CAAqBT,CAAAS,SAArB,EAA2C,IAC3C,OAAOpb,GAAA,CAAQ2a,CAAR,CAPuB,CAmbhCivB,QAASA,GAAc,CAAC7lC,CAAD,CAAU+Z,CAAV,CAAiB,CAqBtC+rB,QAASA,EAAc,CAACC,CAAD,CAAUC,CAAV,CAA8B,CACnDA,CAAA,CAAqBA,CAAA,CAAqB,GAArB,CAA2BxiC,EAAA,CAAWwiC,CAAX,CAA+B,GAA/B,CAA3B,CAAiE,EACtFhmC,EAAAojB,YAAA,EACe2iB,CAAA,CAAUE,EAAV,CAA0BC,EADzC,EACwDF,CADxD,CAAAhtB,SAAA,EAEY+sB,CAAA,CAAUG,EAAV;AAAwBD,EAFpC,EAEqDD,CAFrD,CAFmD,CArBf,IAClCG,EAAO,IAD2B,CAElCC,EAAapmC,CAAApE,OAAA,EAAAwb,WAAA,CAA4B,MAA5B,CAAbgvB,EAAoDC,EAFlB,CAGlCC,EAAe,CAHmB,CAIlCC,EAASJ,CAAAK,OAATD,CAAuB,EAJW,CAKlCE,EAAW,EAGfN,EAAAO,MAAA,CAAa3sB,CAAAjY,KAAb,EAA2BiY,CAAA4sB,OAC3BR,EAAAS,OAAA,CAAc,CAAA,CACdT,EAAAU,UAAA,CAAiB,CAAA,CACjBV,EAAAW,OAAA,CAAc,CAAA,CACdX,EAAAY,SAAA,CAAgB,CAAA,CAEhBX,EAAAY,YAAA,CAAuBb,CAAvB,CAGAnmC,EAAAgZ,SAAA,CAAiBiuB,EAAjB,CACAnB,EAAA,CAAe,CAAA,CAAf,CAoBAK,EAAAa,YAAA,CAAmBE,QAAQ,CAACC,CAAD,CAAU,CAGnC/iC,EAAA,CAAwB+iC,CAAAT,MAAxB,CAAuC,OAAvC,CACAD,EAAAvsC,KAAA,CAAcitC,CAAd,CAEIA,EAAAT,MAAJ,GACEP,CAAA,CAAKgB,CAAAT,MAAL,CADF,CACwBS,CADxB,CANmC,CAqBrChB,EAAAiB,eAAA,CAAsBC,QAAQ,CAACF,CAAD,CAAU,CAClCA,CAAAT,MAAJ,EAAqBP,CAAA,CAAKgB,CAAAT,MAAL,CAArB,GAA6CS,CAA7C,EACE,OAAOhB,CAAA,CAAKgB,CAAAT,MAAL,CAETjtC,EAAA,CAAQ8sC,CAAR,CAAgB,QAAQ,CAACe,CAAD,CAAQC,CAAR,CAAyB,CAC/CpB,CAAAqB,aAAA,CAAkBD,CAAlB,CAAmC,CAAA,CAAnC,CAAyCJ,CAAzC,CAD+C,CAAjD,CAIA5pC,GAAA,CAAYkpC,CAAZ,CAAsBU,CAAtB,CARsC,CAqBxChB,EAAAqB,aAAA,CAAoBC,QAAQ,CAACF,CAAD,CAAkBxB,CAAlB,CAA2BoB,CAA3B,CAAoC,CAC9D,IAAIG,EAAQf,CAAA,CAAOgB,CAAP,CAEZ,IAAIxB,CAAJ,CACMuB,CAAJ,GACE/pC,EAAA,CAAY+pC,CAAZ,CAAmBH,CAAnB,CACA,CAAKG,CAAAjuC,OAAL,GACEitC,CAAA,EAQA,CAPKA,CAOL,GANER,CAAA,CAAeC,CAAf,CAEA,CADAI,CAAAW,OACA,CADc,CAAA,CACd,CAAAX,CAAAY,SAAA;AAAgB,CAAA,CAIlB,EAFAR,CAAA,CAAOgB,CAAP,CAEA,CAF0B,CAAA,CAE1B,CADAzB,CAAA,CAAe,CAAA,CAAf,CAAqByB,CAArB,CACA,CAAAnB,CAAAoB,aAAA,CAAwBD,CAAxB,CAAyC,CAAA,CAAzC,CAA+CpB,CAA/C,CATF,CAFF,CADF,KAgBO,CACAG,CAAL,EACER,CAAA,CAAeC,CAAf,CAEF,IAAIuB,CAAJ,CACE,IArnayB,EAqnazB,EArnaCjqC,EAAA,CAqnaYiqC,CArnaZ,CAqnamBH,CArnanB,CAqnaD,CAA8B,MAA9B,CADF,IAGEZ,EAAA,CAAOgB,CAAP,CAGA,CAH0BD,CAG1B,CAHkC,EAGlC,CAFAhB,CAAA,EAEA,CADAR,CAAA,CAAe,CAAA,CAAf,CAAsByB,CAAtB,CACA,CAAAnB,CAAAoB,aAAA,CAAwBD,CAAxB,CAAyC,CAAA,CAAzC,CAAgDpB,CAAhD,CAEFmB,EAAAptC,KAAA,CAAWitC,CAAX,CAEAhB,EAAAW,OAAA,CAAc,CAAA,CACdX,EAAAY,SAAA,CAAgB,CAAA,CAfX,CAnBuD,CAiDhEZ,EAAAuB,UAAA,CAAiBC,QAAQ,EAAG,CAC1B3nC,CAAAojB,YAAA,CAAoB6jB,EAApB,CAAAjuB,SAAA,CAA6C4uB,EAA7C,CACAzB,EAAAS,OAAA,CAAc,CAAA,CACdT,EAAAU,UAAA,CAAiB,CAAA,CACjBT,EAAAsB,UAAA,EAJ0B,CAsB5BvB,EAAA0B,aAAA,CAAoBC,QAAS,EAAG,CAC9B9nC,CAAAojB,YAAA,CAAoBwkB,EAApB,CAAA5uB,SAAA,CAA0CiuB,EAA1C,CACAd,EAAAS,OAAA,CAAc,CAAA,CACdT,EAAAU,UAAA,CAAiB,CAAA,CACjBptC,EAAA,CAAQgtC,CAAR,CAAkB,QAAQ,CAACU,CAAD,CAAU,CAClCA,CAAAU,aAAA,EADkC,CAApC,CAJ8B,CAvJM,CA4sBxCE,QAASA,GAAa,CAACnlC,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B13B,CAA7B,CAAuC8V,CAAvC,CAAiD,CAErE,IAAI5U,EAAWA,QAAQ,EAAG,CACxB,IAAIhX,EAAQwF,CAAAZ,IAAA,EAKRQ,GAAA,CAAUwC,CAAA6lC,OAAV,EAAyB,GAAzB,CAAJ,GACEztC,CADF,CACUoP,EAAA,CAAKpP,CAAL,CADV,CAIIwtC,EAAAE,WAAJ,GAAwB1tC,CAAxB,EACEoI,CAAAG,OAAA,CAAa,QAAQ,EAAG,CACtBilC,CAAAG,cAAA,CAAmB3tC,CAAnB,CADsB,CAAxB,CAXsB,CAmB1B;GAAI8V,CAAA0uB,SAAA,CAAkB,OAAlB,CAAJ,CACEh/B,CAAAhD,GAAA,CAAW,OAAX,CAAoBwU,CAApB,CADF,KAEO,CACL,IAAIkY,CAAJ,CAEI0e,EAAgBA,QAAQ,EAAG,CACxB1e,CAAL,GACEA,CADF,CACYtD,CAAAvS,MAAA,CAAe,QAAQ,EAAG,CAClCrC,CAAA,EACAkY,EAAA,CAAU,IAFwB,CAA1B,CADZ,CAD6B,CAS/B1pB,EAAAhD,GAAA,CAAW,SAAX,CAAsB,QAAQ,CAACuN,CAAD,CAAQ,CAChC3Q,CAAAA,CAAM2Q,CAAA89B,QAIE,GAAZ,GAAIzuC,CAAJ,GAAmB,EAAnB,CAAwBA,CAAxB,EAAqC,EAArC,CAA+BA,CAA/B,EAA6C,EAA7C,EAAmDA,CAAnD,EAAiE,EAAjE,EAA0DA,CAA1D,GAEAwuC,CAAA,EAPoC,CAAtC,CAWApoC,EAAAhD,GAAA,CAAW,QAAX,CAAqBwU,CAArB,CAGA,IAAIlB,CAAA0uB,SAAA,CAAkB,OAAlB,CAAJ,CACEh/B,CAAAhD,GAAA,CAAW,WAAX,CAAwBorC,CAAxB,CA3BG,CAgCPJ,CAAAM,QAAA,CAAeC,QAAQ,EAAG,CACxBvoC,CAAAZ,IAAA,CAAY4oC,CAAAQ,SAAA,CAAcR,CAAAE,WAAd,CAAA,CAAiC,EAAjC,CAAsCF,CAAAE,WAAlD,CADwB,CAvD2C,KA4DjExG,EAAUt/B,CAAAqmC,UA5DuD,CAgEjEC,EAAWA,QAAQ,CAACnxB,CAAD,CAAS/c,CAAT,CAAgB,CACrC,GAAIwtC,CAAAQ,SAAA,CAAchuC,CAAd,CAAJ,EAA4B+c,CAAApU,KAAA,CAAY3I,CAAZ,CAA5B,CAEE,MADAwtC,EAAAR,aAAA,CAAkB,SAAlB,CAA6B,CAAA,CAA7B,CACOhtC,CAAAA,CAEPwtC,EAAAR,aAAA,CAAkB,SAAlB,CAA6B,CAAA,CAA7B,CACA,OAAOxuC,EAN4B,CAUnC0oC,EAAJ,GAEE,CADAlhC,CACA,CADQkhC,CAAAlhC,MAAA,CAAc,oBAAd,CACR,GACEkhC,CACA,CADczjC,MAAJ,CAAWuC,CAAA,CAAM,CAAN,CAAX;AAAqBA,CAAA,CAAM,CAAN,CAArB,CACV,CAAAmoC,CAAA,CAAmBA,QAAQ,CAACnuC,CAAD,CAAQ,CACjC,MAAOkuC,EAAA,CAAShH,CAAT,CAAkBlnC,CAAlB,CAD0B,CAFrC,EAMEmuC,CANF,CAMqBA,QAAQ,CAACnuC,CAAD,CAAQ,CACjC,IAAIouC,EAAahmC,CAAA83B,MAAA,CAAYgH,CAAZ,CAEjB,IAAI,CAACkH,CAAL,EAAmB,CAACA,CAAAzlC,KAApB,CACE,KAAMlK,EAAA,CAAO,WAAP,CAAA,CAAoB,UAApB,CACqDyoC,CADrD,CAEJkH,CAFI,CAEQ7oC,EAAA,CAAYC,CAAZ,CAFR,CAAN,CAIF,MAAO0oC,EAAA,CAASE,CAAT,CAAqBpuC,CAArB,CAR0B,CAarC,CADAwtC,CAAAa,YAAA3uC,KAAA,CAAsByuC,CAAtB,CACA,CAAAX,CAAAc,SAAA5uC,KAAA,CAAmByuC,CAAnB,CArBF,CAyBA,IAAIvmC,CAAA2mC,YAAJ,CAAsB,CACpB,IAAIC,EAAYxtC,CAAA,CAAI4G,CAAA2mC,YAAJ,CACZE,EAAAA,CAAqBA,QAAQ,CAACzuC,CAAD,CAAQ,CACvC,GAAI,CAACwtC,CAAAQ,SAAA,CAAchuC,CAAd,CAAL,EAA6BA,CAAAnB,OAA7B,CAA4C2vC,CAA5C,CAEE,MADAhB,EAAAR,aAAA,CAAkB,WAAlB,CAA+B,CAAA,CAA/B,CACOxuC,CAAAA,CAEPgvC,EAAAR,aAAA,CAAkB,WAAlB,CAA+B,CAAA,CAA/B,CACA,OAAOhtC,EAN8B,CAUzCwtC,EAAAc,SAAA5uC,KAAA,CAAmB+uC,CAAnB,CACAjB,EAAAa,YAAA3uC,KAAA,CAAsB+uC,CAAtB,CAboB,CAiBtB,GAAI7mC,CAAA8mC,YAAJ,CAAsB,CACpB,IAAIC,EAAY3tC,CAAA,CAAI4G,CAAA8mC,YAAJ,CACZE,EAAAA,CAAqBA,QAAQ,CAAC5uC,CAAD,CAAQ,CACvC,GAAI,CAACwtC,CAAAQ,SAAA,CAAchuC,CAAd,CAAL,EAA6BA,CAAAnB,OAA7B,CAA4C8vC,CAA5C,CAEE,MADAnB,EAAAR,aAAA,CAAkB,WAAlB;AAA+B,CAAA,CAA/B,CACOxuC,CAAAA,CAEPgvC,EAAAR,aAAA,CAAkB,WAAlB,CAA+B,CAAA,CAA/B,CACA,OAAOhtC,EAN8B,CAUzCwtC,EAAAc,SAAA5uC,KAAA,CAAmBkvC,CAAnB,CACApB,EAAAa,YAAA3uC,KAAA,CAAsBkvC,CAAtB,CAboB,CApH+C,CA0sCvEC,QAASA,GAAc,CAACvnC,CAAD,CAAOwH,CAAP,CAAiB,CACtCxH,CAAA,CAAO,SAAP,CAAmBA,CACnB,OAAO,SAAQ,EAAG,CAChB,MAAO,UACK,IADL,MAECkT,QAAQ,CAACpS,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CAwBnCknC,QAASA,EAAkB,CAACpQ,CAAD,CAAS,CAClC,GAAiB,CAAA,CAAjB,GAAI5vB,CAAJ,EAAyB1G,CAAA2mC,OAAzB,CAAwC,CAAxC,GAA8CjgC,CAA9C,CACM6vB,CAeN,EAfiB,CAAA96B,EAAA,CAAO66B,CAAP,CAAcC,CAAd,CAejB,EALA/2B,CAAA+gB,aAAA,CAAkBqmB,CAAA,CATFrQ,CASE,CAAlB,CAKA,CAAA/2B,CAAA6gB,UAAA,CAAeumB,CAAA,CAZJtQ,CAYI,CAAf,CAVAC,EAAA,CAAS17B,EAAA,CAAKy7B,CAAL,CAPyB,CAoBpCsQ,QAASA,EAAc,CAACtmB,CAAD,CAAW,CAChC,GAAG1pB,CAAA,CAAQ0pB,CAAR,CAAH,CACE,MAAOA,EAAApoB,KAAA,CAAc,GAAd,CACF,IAAIsB,CAAA,CAAS8mB,CAAT,CAAJ,CAAwB,CAAA,IACzBumB,EAAU,EACdhwC,EAAA,CAAQypB,CAAR,CAAkB,QAAQ,CAACrjB,CAAD,CAAIkjB,CAAJ,CAAO,CAC3BljB,CAAJ,EACE4pC,CAAAvvC,KAAA,CAAa6oB,CAAb,CAF6B,CAAjC,CAKA,OAAO0mB,EAAA3uC,KAAA,CAAa,GAAb,CAPsB,CAU/B,MAAOooB,EAbyB,CA3ClC,IAAIiW,EAASngC,CAEb4J,EAAA/E,OAAA,CAAauE,CAAA,CAAKN,CAAL,CAAb,CAAyBwnC,CAAzB,CAA6C,CAAA,CAA7C,CAEAlnC,EAAA0b,SAAA,CAAc,OAAd,CAAuB,QAAQ,CAACtjB,CAAD,CAAQ,CACrC8uC,CAAA,CAAmB1mC,CAAA83B,MAAA,CAAYt4B,CAAA,CAAKN,CAAL,CAAZ,CAAnB,CADqC,CAAvC,CAKa,UAAb,GAAIA,CAAJ,EACEc,CAAA/E,OAAA,CAAa,QAAb;AAAuB,QAAQ,CAAC0rC,CAAD,CAASG,CAAT,CAAoB,CACjD,IAAIC,EAAMJ,CAANI,CAAe,CACfA,EAAJ,GAAYD,CAAZ,CAAwB,CAAxB,GACMC,CAAJ,GAAYrgC,CAAZ,EACW,CA0Bf,CA1Be1G,CAAA83B,MAAA,CAAYt4B,CAAA,CAAKN,CAAL,CAAZ,CA0Bf,CAAAM,CAAA6gB,UAAA,CAAeumB,CAAA,CAAetmB,CAAf,CAAf,CA3BI,GAGc,CAmBlB,CAnBkBtgB,CAAA83B,MAAA,CAAYt4B,CAAA,CAAKN,CAAL,CAAZ,CAmBlB,CAAAM,CAAA+gB,aAAA,CAAkBqmB,CAAA,CAAetmB,CAAf,CAAlB,CAtBI,CADF,CAFiD,CAAnD,CAXiC,CAFhC,CADS,CAFoB,CAz7exC,IAAIpjB,EAAYA,QAAQ,CAAC6jC,CAAD,CAAQ,CAAC,MAAOpqC,EAAA,CAASoqC,CAAT,CAAA,CAAmBA,CAAA9/B,YAAA,EAAnB,CAA0C8/B,CAAlD,CAAhC,CAYIpc,GAAYA,QAAQ,CAACoc,CAAD,CAAQ,CAAC,MAAOpqC,EAAA,CAASoqC,CAAT,CAAA,CAAmBA,CAAA59B,YAAA,EAAnB,CAA0C49B,CAAlD,CAZhC,CAqCIv4B,CArCJ,CAsCInL,CAtCJ,CAuCIgH,EAvCJ,CAwCIjI,GAAoB,EAAAA,MAxCxB,CAyCI9E,GAAoB,EAAAA,KAzCxB,CA0CIqC,GAAoBuI,MAAAsJ,UAAA7R,SA1CxB,CA2CIuB,GAAoB7E,CAAA,CAAO,IAAP,CA3CxB,CAgDImK,GAAoBtK,CAAAsK,QAApBA,GAAuCtK,CAAAsK,QAAvCA,CAAwD,EAAxDA,CAhDJ,CAiDI+J,EAjDJ,CAkDIsN,EAlDJ,CAmDI9f,GAAoB,CAAC,GAAD,CAAM,GAAN,CAAW,GAAX,CAMxByQ,EAAA,CAAO5P,CAAA,CAAI,CAAC,YAAAyG,KAAA,CAAkBnC,CAAA,CAAUw+B,SAAAD,UAAV,CAAlB,CAAD,EAAsD,EAAtD,EAA0D,CAA1D,CAAJ,CACH1D,MAAA,CAAMvvB,CAAN,CAAJ,GACEA,CADF,CACS5P,CAAA,CAAI,CAAC,uBAAAyG,KAAA,CAA6BnC,CAAA,CAAUw+B,SAAAD,UAAV,CAA7B,CAAD,EAAiE,EAAjE,EAAqE,CAArE,CAAJ,CADT,CA0MAviC,EAAA6P,QAAA,CAAe,EAmBf5P,GAAA4P,QAAA,CAAmB,EAiKnB,KAAI/B;AAAQ,QAAQ,EAAG,CAIrB,MAAK7O,OAAAqT,UAAAxE,KAAL,CAKO,QAAQ,CAACpP,CAAD,CAAQ,CACrB,MAAOjB,EAAA,CAASiB,CAAT,CAAA,CAAkBA,CAAAoP,KAAA,EAAlB,CAAiCpP,CADnB,CALvB,CACS,QAAQ,CAACA,CAAD,CAAQ,CACrB,MAAOjB,EAAA,CAASiB,CAAT,CAAA,CAAkBA,CAAAiG,QAAA,CAAc,MAAd,CAAsB,EAAtB,CAAAA,QAAA,CAAkC,MAAlC,CAA0C,EAA1C,CAAlB,CAAkEjG,CADpD,CALJ,CAAX,EA6CVigB,GAAA,CADS,CAAX,CAAIrP,CAAJ,CACcqP,QAAQ,CAACza,CAAD,CAAU,CAC5BA,CAAA,CAAUA,CAAAjD,SAAA,CAAmBiD,CAAnB,CAA6BA,CAAA,CAAQ,CAAR,CACvC,OAAQA,EAAAud,UACD,EAD2C,MAC3C,EADsBvd,CAAAud,UACtB,CAAHgK,EAAA,CAAUvnB,CAAAud,UAAV,CAA8B,GAA9B,CAAoCvd,CAAAjD,SAApC,CAAG,CAAqDiD,CAAAjD,SAHhC,CADhC,CAOc0d,QAAQ,CAACza,CAAD,CAAU,CAC5B,MAAOA,EAAAjD,SAAA,CAAmBiD,CAAAjD,SAAnB,CAAsCiD,CAAA,CAAQ,CAAR,CAAAjD,SADjB,CAmnBhC,KAAI2G,GAAoB,QAAxB,CAwYIkmC,GAAU,MACN,YADM,OAEL,CAFK,OAGL,CAHK,KAIP,CAJO,UAKF,kBALE,CAxYd,CAolBI9gC,GAAU1B,CAAAuG,MAAV7E,CAAyB,EAplB7B,CAqlBIF,GAASxB,CAAA0b,QAATla,CAA0B,KAA1BA,CAAkC5K,CAAA,IAAID,IAAJC,SAAA,EArlBtC,CAslBIgL,GAAO,CAtlBX,CAulBI6gC,GAAsB/wC,CAAAC,SAAA+wC,iBACA;AAAlB,QAAQ,CAAC9pC,CAAD,CAAUoI,CAAV,CAAgBtJ,CAAhB,CAAoB,CAACkB,CAAA8pC,iBAAA,CAAyB1hC,CAAzB,CAA+BtJ,CAA/B,CAAmC,CAAA,CAAnC,CAAD,CAAV,CAClB,QAAQ,CAACkB,CAAD,CAAUoI,CAAV,CAAgBtJ,CAAhB,CAAoB,CAACkB,CAAA+pC,YAAA,CAAoB,IAApB,CAA2B3hC,CAA3B,CAAiCtJ,CAAjC,CAAD,CAzlBpC,CA0lBI4J,GAAyB5P,CAAAC,SAAAixC,oBACA,CAArB,QAAQ,CAAChqC,CAAD,CAAUoI,CAAV,CAAgBtJ,CAAhB,CAAoB,CAACkB,CAAAgqC,oBAAA,CAA4B5hC,CAA5B,CAAkCtJ,CAAlC,CAAsC,CAAA,CAAtC,CAAD,CAAP,CACrB,QAAQ,CAACkB,CAAD,CAAUoI,CAAV,CAAgBtJ,CAAhB,CAAoB,CAACkB,CAAAiqC,YAAA,CAAoB,IAApB,CAA2B7hC,CAA3B,CAAiCtJ,CAAjC,CAAD,CA5lBpC,CAimBI8G,GAAuB,iBAjmB3B,CAkmBII,GAAkB,aAlmBtB,CAmmBIqB,GAAepO,CAAA,CAAO,QAAP,CAnmBnB,CAy1BI2f,GAAkBxR,CAAAgH,UAAlBwK,CAAqC,OAChCsxB,QAAQ,CAACprC,CAAD,CAAK,CAGlBqrC,QAASA,EAAO,EAAG,CACbC,CAAJ,GACAA,CACA,CADQ,CAAA,CACR,CAAAtrC,CAAA,EAFA,CADiB,CAFnB,IAAIsrC,EAAQ,CAAA,CASgB,WAA5B,GAAIrxC,CAAA8xB,WAAJ,CACE/Z,UAAA,CAAWq5B,CAAX,CADF,EAGE,IAAAntC,GAAA,CAAQ,kBAAR,CAA4BmtC,CAA5B,CAEA,CAAA/iC,CAAA,CAAOtO,CAAP,CAAAkE,GAAA,CAAkB,MAAlB,CAA0BmtC,CAA1B,CALF,CAVkB,CADmB,UAmB7B5tC,QAAQ,EAAG,CACnB,IAAI/B,EAAQ,EACZf,EAAA,CAAQ,IAAR,CAAc,QAAQ,CAAC2G,CAAD,CAAG,CAAE5F,CAAAN,KAAA,CAAW,EAAX,CAAgBkG,CAAhB,CAAF,CAAzB,CACA,OAAO,GAAP,CAAa5F,CAAAM,KAAA,CAAW,IAAX,CAAb;AAAgC,GAHb,CAnBkB,IAyBnC+d,QAAQ,CAACne,CAAD,CAAQ,CAChB,MAAiB,EAAV,EAACA,CAAD,CAAeuF,CAAA,CAAO,IAAA,CAAKvF,CAAL,CAAP,CAAf,CAAqCuF,CAAA,CAAO,IAAA,CAAK,IAAA5G,OAAL,CAAmBqB,CAAnB,CAAP,CAD5B,CAzBmB,QA6B/B,CA7B+B,MA8BjCR,EA9BiC,MA+BjC,EAAAC,KA/BiC,QAgC/B,EAAAqD,OAhC+B,CAz1BzC,CAi4BI4M,GAAe,EACnB3Q,EAAA,CAAQ,2DAAA,MAAA,CAAA,GAAA,CAAR,CAAgF,QAAQ,CAACe,CAAD,CAAQ,CAC9F4P,EAAA,CAAatK,CAAA,CAAUtF,CAAV,CAAb,CAAA,CAAiCA,CAD6D,CAAhG,CAGA,KAAI6P,GAAmB,EACvB5Q,EAAA,CAAQ,kDAAA,MAAA,CAAA,GAAA,CAAR,CAAuE,QAAQ,CAACe,CAAD,CAAQ,CACrF6P,EAAA,CAAiBkd,EAAA,CAAU/sB,CAAV,CAAjB,CAAA,CAAqC,CAAA,CADgD,CAAvF,CAYAf,EAAA,CAAQ,MACAwP,EADA,eAESgB,EAFT,OAICrH,QAAQ,CAAC5C,CAAD,CAAU,CACvB,MAAOiK,GAAA,CAAoBjK,CAApB,CAA6B,QAA7B,CADgB,CAJnB,YAQMgK,EARN,UAUIzH,QAAQ,CAACvC,CAAD,CAAU,CAC1B,MAAOiK,GAAA,CAAoBjK,CAApB,CAA6B,WAA7B,CADmB,CAVtB,YAcMkkB,QAAQ,CAAClkB,CAAD,CAAS8B,CAAT,CAAe,CACjC9B,CAAAqqC,gBAAA,CAAwBvoC,CAAxB,CADiC,CAd7B,UAkBIuH,EAlBJ;IAoBDihC,QAAQ,CAACtqC,CAAD,CAAU8B,CAAV,CAAgBtH,CAAhB,CAAuB,CAClCsH,CAAA,CAAO6D,EAAA,CAAU7D,CAAV,CAEP,IAAI3F,CAAA,CAAU3B,CAAV,CAAJ,CACEwF,CAAA2+B,MAAA,CAAc78B,CAAd,CAAA,CAAsBtH,CADxB,KAEO,CACL,IAAI4E,CAEQ,EAAZ,EAAIgM,CAAJ,GAEEhM,CACA,CADMY,CAAAuqC,aACN,EAD8BvqC,CAAAuqC,aAAA,CAAqBzoC,CAArB,CAC9B,CAAY,EAAZ,GAAI1C,CAAJ,GAAgBA,CAAhB,CAAsB,MAAtB,CAHF,CAMAA,EAAA,CAAMA,CAAN,EAAaY,CAAA2+B,MAAA,CAAc78B,CAAd,CAED,EAAZ,EAAIsJ,CAAJ,GAEEhM,CAFF,CAEiB,EAAT,GAACA,CAAD,CAAepG,CAAf,CAA2BoG,CAFnC,CAKA,OAAQA,EAhBH,CAL2B,CApB9B,MA6CAgD,QAAQ,CAACpC,CAAD,CAAU8B,CAAV,CAAgBtH,CAAhB,CAAsB,CAClC,IAAIgwC,EAAiB1qC,CAAA,CAAUgC,CAAV,CACrB,IAAIsI,EAAA,CAAaogC,CAAb,CAAJ,CACE,GAAIruC,CAAA,CAAU3B,CAAV,CAAJ,CACQA,CAAN,EACEwF,CAAA,CAAQ8B,CAAR,CACA,CADgB,CAAA,CAChB,CAAA9B,CAAA0J,aAAA,CAAqB5H,CAArB,CAA2B0oC,CAA3B,CAFF,GAIExqC,CAAA,CAAQ8B,CAAR,CACA,CADgB,CAAA,CAChB,CAAA9B,CAAAqqC,gBAAA,CAAwBG,CAAxB,CALF,CADF,KASE,OAAQxqC,EAAA,CAAQ8B,CAAR,CAED,EADGkZ,CAAAhb,CAAAmC,WAAAsoC,aAAA,CAAgC3oC,CAAhC,CAAAkZ,EAAwClf,CAAxCkf,WACH,CAAEwvB,CAAF,CACExxC,CAbb,KAeO,IAAImD,CAAA,CAAU3B,CAAV,CAAJ,CACLwF,CAAA0J,aAAA,CAAqB5H,CAArB,CAA2BtH,CAA3B,CADK,KAEA,IAAIwF,CAAAuJ,aAAJ,CAKL,MAFImhC,EAEG,CAFG1qC,CAAAuJ,aAAA,CAAqBzH,CAArB,CAA2B,CAA3B,CAEH,CAAQ,IAAR,GAAA4oC,CAAA,CAAe1xC,CAAf,CAA2B0xC,CAxBF,CA7C9B,MAyEA3mB,QAAQ,CAAC/jB,CAAD,CAAU8B,CAAV,CAAgBtH,CAAhB,CAAuB,CACnC,GAAI2B,CAAA,CAAU3B,CAAV,CAAJ,CACEwF,CAAA,CAAQ8B,CAAR,CAAA,CAAgBtH,CADlB,KAGE,OAAOwF,EAAA,CAAQ8B,CAAR,CAJ0B,CAzE/B;KAiFC,QAAQ,EAAG,CAYhB6oC,QAASA,EAAO,CAAC3qC,CAAD,CAAUxF,CAAV,CAAiB,CAC/B,IAAIowC,EAAWC,CAAA,CAAwB7qC,CAAA1G,SAAxB,CACf,IAAI4C,CAAA,CAAY1B,CAAZ,CAAJ,CACE,MAAOowC,EAAA,CAAW5qC,CAAA,CAAQ4qC,CAAR,CAAX,CAA+B,EAExC5qC,EAAA,CAAQ4qC,CAAR,CAAA,CAAoBpwC,CALW,CAXjC,IAAIqwC,EAA0B,EACnB,EAAX,CAAIz/B,CAAJ,EACEy/B,CAAA,CAAwB,CAAxB,CACA,CAD6B,WAC7B,CAAAA,CAAA,CAAwB,CAAxB,CAAA,CAA6B,WAF/B,EAIEA,CAAA,CAAwB,CAAxB,CAJF,CAKEA,CAAA,CAAwB,CAAxB,CALF,CAK+B,aAE/BF,EAAAG,IAAA,CAAc,EACd,OAAOH,EAVS,CAAX,EAjFD,KAsGDvrC,QAAQ,CAACY,CAAD,CAAUxF,CAAV,CAAiB,CAC5B,GAAI0B,CAAA,CAAY1B,CAAZ,CAAJ,CAAwB,CACtB,GAA2B,QAA3B,GAAIigB,EAAA,CAAUza,CAAV,CAAJ,EAAuCA,CAAA+qC,SAAvC,CAAyD,CACvD,IAAIp7B,EAAS,EACblW,EAAA,CAAQuG,CAAA0U,QAAR,CAAyB,QAAS,CAACs2B,CAAD,CAAS,CACrCA,CAAAC,SAAJ,EACEt7B,CAAAzV,KAAA,CAAY8wC,CAAAxwC,MAAZ,EAA4BwwC,CAAAppB,KAA5B,CAFuC,CAA3C,CAKA,OAAyB,EAAlB,GAAAjS,CAAAtW,OAAA,CAAsB,IAAtB,CAA6BsW,CAPmB,CASzD,MAAO3P,EAAAxF,MAVe,CAYxBwF,CAAAxF,MAAA,CAAgBA,CAbY,CAtGxB,MAsHA2F,QAAQ,CAACH,CAAD,CAAUxF,CAAV,CAAiB,CAC7B,GAAI0B,CAAA,CAAY1B,CAAZ,CAAJ,CACE,MAAOwF,EAAAwH,UAET,KAJ6B,IAIpBnN,EAAI,CAJgB,CAIbuN,EAAa5H,CAAA4H,WAA7B,CAAiDvN,CAAjD,CAAqDuN,CAAAvO,OAArD,CAAwEgB,CAAA,EAAxE,CACE4N,EAAA,CAAaL,CAAA,CAAWvN,CAAX,CAAb,CAEF2F,EAAAwH,UAAA,CAAoBhN,CAPS,CAtHzB,CAAR,CA+HG,QAAQ,CAACsE,CAAD,CAAKgD,CAAL,CAAU,CAInBsF,CAAAgH,UAAA,CAAiBtM,CAAjB,CAAA;AAAyB,QAAQ,CAACuxB,CAAD,CAAOC,CAAP,CAAa,CAAA,IACxCj5B,CADwC,CACrCT,CAIP,KAAmB,CAAd,EAACkF,CAAAzF,OAAD,EAAoByF,CAApB,GAA2BuK,EAA3B,EAA6CvK,CAA7C,GAAoDkL,EAApD,CAAyEqpB,CAAzE,CAAgFC,CAArF,IAA+Ft6B,CAA/F,CAA0G,CACxG,GAAIoD,CAAA,CAASi3B,CAAT,CAAJ,CAAoB,CAGlB,IAAIh5B,CAAJ,CAAM,CAAN,CAASA,CAAT,CAAa,IAAAhB,OAAb,CAA0BgB,CAAA,EAA1B,CACE,GAAIyE,CAAJ,GAAWmK,EAAX,CAEEnK,CAAA,CAAG,IAAA,CAAKzE,CAAL,CAAH,CAAYg5B,CAAZ,CAFF,KAIE,KAAKz5B,CAAL,GAAYy5B,EAAZ,CACEv0B,CAAA,CAAG,IAAA,CAAKzE,CAAL,CAAH,CAAYT,CAAZ,CAAiBy5B,CAAA,CAAKz5B,CAAL,CAAjB,CAKN,OAAO,KAdW,CAiBdY,CAAAA,CAAQsE,CAAAgsC,IAERjwB,EAAAA,CAAKrgB,CAAA,EAASxB,CAAT,CAAqB4mB,IAAAyiB,IAAA,CAAS,IAAAhpC,OAAT,CAAsB,CAAtB,CAArB,CAAgD,IAAAA,OACzD,KAAK,IAAIuhB,EAAI,CAAb,CAAgBA,CAAhB,CAAoBC,CAApB,CAAwBD,CAAA,EAAxB,CAA6B,CAC3B,IAAIvC,EAAYvZ,CAAA,CAAG,IAAA,CAAK8b,CAAL,CAAH,CAAYyY,CAAZ,CAAkBC,CAAlB,CAChB94B,EAAA,CAAQA,CAAA,CAAQA,CAAR,CAAgB6d,CAAhB,CAA4BA,CAFT,CAI7B,MAAO7d,EAzB+F,CA6BxG,IAAIH,CAAJ,CAAM,CAAN,CAASA,CAAT,CAAa,IAAAhB,OAAb,CAA0BgB,CAAA,EAA1B,CACEyE,CAAA,CAAG,IAAA,CAAKzE,CAAL,CAAH,CAAYg5B,CAAZ,CAAkBC,CAAlB,CAGF,OAAO,KAtCmC,CAJ3B,CA/HrB,CAwOA75B,EAAA,CAAQ,YACMyO,EADN,QAGED,EAHF,IAKFijC,QAASA,EAAI,CAAClrC,CAAD,CAAUoI,CAAV,CAAgBtJ,CAAhB,CAAoBuJ,CAApB,CAAgC,CAC/C,GAAIlM,CAAA,CAAUkM,CAAV,CAAJ,CAA4B,KAAMhB,GAAA,CAAa,QAAb,CAAN,CADmB,IAG3CiB,EAASC,EAAA,CAAmBvI,CAAnB,CAA4B,QAA5B,CAHkC,CAI3CwI,EAASD,EAAA,CAAmBvI,CAAnB,CAA4B,QAA5B,CAERsI,EAAL,EAAaC,EAAA,CAAmBvI,CAAnB,CAA4B,QAA5B,CAAsCsI,CAAtC,CAA+C,EAA/C,CACRE,EAAL,EAAaD,EAAA,CAAmBvI,CAAnB,CAA4B,QAA5B,CAAsCwI,CAAtC,CAA+C8B,EAAA,CAAmBtK,CAAnB,CAA4BsI,CAA5B,CAA/C,CAEb7O;CAAA,CAAQ2O,CAAArH,MAAA,CAAW,GAAX,CAAR,CAAyB,QAAQ,CAACqH,CAAD,CAAM,CACrC,IAAI+iC,EAAW7iC,CAAA,CAAOF,CAAP,CAEf,IAAI,CAAC+iC,CAAL,CAAe,CACb,GAAY,YAAZ,EAAI/iC,CAAJ,EAAoC,YAApC,EAA4BA,CAA5B,CAAkD,CAChD,IAAIgjC,EAAWryC,CAAA2xB,KAAA0gB,SAAA,EAA0BryC,CAAA2xB,KAAA2gB,wBAA1B,CACf,QAAQ,CAAE9pB,CAAF,CAAKC,CAAL,CAAS,CAAA,IACX8pB,EAAuB,CAAf,GAAA/pB,CAAAjoB,SAAA,CAAmBioB,CAAAgqB,gBAAnB,CAAuChqB,CADpC,CAEfiqB,EAAMhqB,CAANgqB,EAAWhqB,CAAAkB,WACX,OAAOnB,EAAP,GAAaiqB,CAAb,EAAoB,CAAC,EAAGA,CAAH,EAA2B,CAA3B,GAAUA,CAAAlyC,SAAV,GACnBgyC,CAAAF,SAAA,CACAE,CAAAF,SAAA,CAAgBI,CAAhB,CADA,CAEAjqB,CAAA8pB,wBAFA,EAE6B9pB,CAAA8pB,wBAAA,CAA2BG,CAA3B,CAF7B,CAEgE,EAH7C,EAHN,CADF,CAUb,QAAQ,CAAEjqB,CAAF,CAAKC,CAAL,CAAS,CACf,GAAKA,CAAL,CACE,IAAA,CAASA,CAAT,CAAaA,CAAAkB,WAAb,CAAA,CACE,GAAKlB,CAAL,GAAWD,CAAX,CACE,MAAO,CAAA,CAIb,OAAO,CAAA,CARQ,CAWnBjZ,EAAA,CAAOF,CAAP,CAAA,CAAe,EAOf8iC,EAAA,CAAKlrC,CAAL,CAFeyrC,YAAe,UAAfA,YAAwC,WAAxCA,CAED,CAASrjC,CAAT,CAAd,CAA8B,QAAQ,CAACmC,CAAD,CAAQ,CAC5C,IAAmBmhC,EAAUnhC,CAAAohC,cAGvBD,EAAN,GAAkBA,CAAlB;AAHa5gC,IAGb,EAAyCsgC,CAAA,CAH5BtgC,IAG4B,CAAiB4gC,CAAjB,CAAzC,GACEljC,CAAA,CAAO+B,CAAP,CAAcnC,CAAd,CAL0C,CAA9C,CA7BgD,CAAlD,IAuCEyhC,GAAA,CAAmB7pC,CAAnB,CAA4BoI,CAA5B,CAAkCI,CAAlC,CACA,CAAAF,CAAA,CAAOF,CAAP,CAAA,CAAe,EAEjB+iC,EAAA,CAAW7iC,CAAA,CAAOF,CAAP,CA3CE,CA6Cf+iC,CAAAjxC,KAAA,CAAc4E,CAAd,CAhDqC,CAAvC,CAT+C,CAL3C,KAkEDqJ,EAlEC,aAoEOiX,QAAQ,CAACpf,CAAD,CAAU4rC,CAAV,CAAuB,CAAA,IACtClxC,CADsC,CAC/BkB,EAASoE,CAAA0iB,WACpBza,GAAA,CAAajI,CAAb,CACAvG,EAAA,CAAQ,IAAI2N,CAAJ,CAAWwkC,CAAX,CAAR,CAAiC,QAAQ,CAAC9uC,CAAD,CAAM,CACzCpC,CAAJ,CACEkB,CAAAiwC,aAAA,CAAoB/uC,CAApB,CAA0BpC,CAAAohB,YAA1B,CADF,CAGElgB,CAAAgnB,aAAA,CAAoB9lB,CAApB,CAA0BkD,CAA1B,CAEFtF,EAAA,CAAQoC,CANqC,CAA/C,CAH0C,CApEtC,UAiFI+J,QAAQ,CAAC7G,CAAD,CAAU,CAC1B,IAAI6G,EAAW,EACfpN,EAAA,CAAQuG,CAAA4H,WAAR,CAA4B,QAAQ,CAAC5H,CAAD,CAAS,CAClB,CAAzB,GAAIA,CAAA1G,SAAJ,EACEuN,CAAA3M,KAAA,CAAc8F,CAAd,CAFyC,CAA7C,CAIA,OAAO6G,EANmB,CAjFtB,UA0FIyY,QAAQ,CAACtf,CAAD,CAAU,CAC1B,MAAOA,EAAA4H,WAAP,EAA6B,EADH,CA1FtB,QA8FEtH,QAAQ,CAACN,CAAD,CAAUlD,CAAV,CAAgB,CAC9BrD,CAAA,CAAQ,IAAI2N,CAAJ,CAAWtK,CAAX,CAAR,CAA0B,QAAQ,CAAC67B,CAAD,CAAO,CACd,CAAzB,GAAI34B,CAAA1G,SAAJ,EAAmD,EAAnD,GAA8B0G,CAAA1G,SAA9B,EACE0G,CAAA6iB,YAAA,CAAoB8V,CAApB,CAFqC,CAAzC,CAD8B,CA9F1B,SAsGGmT,QAAQ,CAAC9rC,CAAD,CAAUlD,CAAV,CAAgB,CAC/B,GAAyB,CAAzB,GAAIkD,CAAA1G,SAAJ,CAA4B,CAC1B,IAAIoB,EAAQsF,CAAA0H,WACZjO;CAAA,CAAQ,IAAI2N,CAAJ,CAAWtK,CAAX,CAAR,CAA0B,QAAQ,CAAC67B,CAAD,CAAO,CACvC34B,CAAA6rC,aAAA,CAAqBlT,CAArB,CAA4Bj+B,CAA5B,CADuC,CAAzC,CAF0B,CADG,CAtG3B,MA+GA4d,QAAQ,CAACtY,CAAD,CAAU+rC,CAAV,CAAoB,CAChCA,CAAA,CAAW9rC,CAAA,CAAO8rC,CAAP,CAAA,CAAiB,CAAjB,CACX,KAAInwC,EAASoE,CAAA0iB,WACT9mB,EAAJ,EACEA,CAAAgnB,aAAA,CAAoBmpB,CAApB,CAA8B/rC,CAA9B,CAEF+rC,EAAAlpB,YAAA,CAAqB7iB,CAArB,CANgC,CA/G5B,QAwHE4V,QAAQ,CAAC5V,CAAD,CAAU,CACxBiI,EAAA,CAAajI,CAAb,CACA,KAAIpE,EAASoE,CAAA0iB,WACT9mB,EAAJ,EAAYA,CAAA6L,YAAA,CAAmBzH,CAAnB,CAHY,CAxHpB,OA8HCgsC,QAAQ,CAAChsC,CAAD,CAAUisC,CAAV,CAAsB,CAAA,IAC/BvxC,EAAQsF,CADuB,CACdpE,EAASoE,CAAA0iB,WAC9BjpB,EAAA,CAAQ,IAAI2N,CAAJ,CAAW6kC,CAAX,CAAR,CAAgC,QAAQ,CAACnvC,CAAD,CAAM,CAC5ClB,CAAAiwC,aAAA,CAAoB/uC,CAApB,CAA0BpC,CAAAohB,YAA1B,CACAphB,EAAA,CAAQoC,CAFoC,CAA9C,CAFmC,CA9H/B,UAsII+M,EAtIJ,aAuIOL,EAvIP,aAyIO0iC,QAAQ,CAAClsC,CAAD,CAAUsJ,CAAV,CAAoB6iC,CAApB,CAA+B,CAC9CjwC,CAAA,CAAYiwC,CAAZ,CAAJ,GACEA,CADF,CACc,CAAC9iC,EAAA,CAAerJ,CAAf,CAAwBsJ,CAAxB,CADf,CAGC,EAAA6iC,CAAA,CAAYtiC,EAAZ,CAA6BL,EAA7B,EAAgDxJ,CAAhD,CAAyDsJ,CAAzD,CAJiD,CAzI9C,QAgJE1N,QAAQ,CAACoE,CAAD,CAAU,CAExB,MAAO,CADHpE,CACG,CADMoE,CAAA0iB,WACN,GAA8B,EAA9B,GAAU9mB,CAAAtC,SAAV,CAAmCsC,CAAnC,CAA4C,IAF3B,CAhJpB,MAqJAg/B,QAAQ,CAAC56B,CAAD,CAAU,CACtB,GAAIA,CAAAosC,mBAAJ,CACE,MAAOpsC,EAAAosC,mBAKT;IADIt8B,CACJ,CADU9P,CAAA8b,YACV,CAAc,IAAd,EAAOhM,CAAP,EAAuC,CAAvC,GAAsBA,CAAAxW,SAAtB,CAAA,CACEwW,CAAA,CAAMA,CAAAgM,YAER,OAAOhM,EAVe,CArJlB,MAkKA7S,QAAQ,CAAC+C,CAAD,CAAUsJ,CAAV,CAAoB,CAChC,MAAOtJ,EAAAqsC,qBAAA,CAA6B/iC,CAA7B,CADyB,CAlK5B,OAsKCvB,EAtKD,gBAwKUhB,QAAQ,CAAC/G,CAAD,CAAUssC,CAAV,CAAqBC,CAArB,CAAgC,CAClDpB,CAAAA,CAAW,CAAC5iC,EAAA,CAAmBvI,CAAnB,CAA4B,QAA5B,CAAD,EAA0C,EAA1C,EAA8CssC,CAA9C,CAEfC,EAAA,CAAYA,CAAZ,EAAyB,EAEzB,KAAIhiC,EAAQ,CAAC,gBACKzO,CADL,iBAEMA,CAFN,CAAD,CAKZrC,EAAA,CAAQ0xC,CAAR,CAAkB,QAAQ,CAACrsC,CAAD,CAAK,CAC7BA,CAAAtC,MAAA,CAASwD,CAAT,CAAkBuK,CAAArL,OAAA,CAAaqtC,CAAb,CAAlB,CAD6B,CAA/B,CAVsD,CAxKlD,CAAR,CAsLG,QAAQ,CAACztC,CAAD,CAAKgD,CAAL,CAAU,CAInBsF,CAAAgH,UAAA,CAAiBtM,CAAjB,CAAA,CAAyB,QAAQ,CAACuxB,CAAD,CAAOC,CAAP,CAAakZ,CAAb,CAAmB,CAElD,IADA,IAAIhyC,CAAJ,CACQH,EAAE,CAAV,CAAaA,CAAb,CAAiB,IAAAhB,OAAjB,CAA8BgB,CAAA,EAA9B,CACMG,CAAJ,EAAaxB,CAAb,EACEwB,CACA,CADQsE,CAAA,CAAG,IAAA,CAAKzE,CAAL,CAAH,CAAYg5B,CAAZ,CAAkBC,CAAlB,CAAwBkZ,CAAxB,CACR,CAAIhyC,CAAJ,GAAcxB,CAAd,GAEEwB,CAFF,CAEUyF,CAAA,CAAOzF,CAAP,CAFV,CAFF,EAOEmN,EAAA,CAAenN,CAAf,CAAsBsE,CAAA,CAAG,IAAA,CAAKzE,CAAL,CAAH,CAAYg5B,CAAZ,CAAkBC,CAAlB,CAAwBkZ,CAAxB,CAAtB,CAGJ,OAAOhyC,EAAA,EAASxB,CAAT,CAAqB,IAArB,CAA4BwB,CAbe,CAiBpD4M,EAAAgH,UAAAxP,KAAA,CAAwBwI,CAAAgH,UAAApR,GACxBoK,EAAAgH,UAAAq+B,OAAA,CAA0BrlC,CAAAgH,UAAAs+B,IAtBP,CAtLrB,CAmPAlhC;EAAA4C,UAAA,CAAoB,KAMb3C,QAAQ,CAAC7R,CAAD,CAAMY,CAAN,CAAa,CACxB,IAAA,CAAK8Q,EAAA,CAAQ1R,CAAR,CAAL,CAAA,CAAqBY,CADG,CANR,KAcbyS,QAAQ,CAACrT,CAAD,CAAM,CACjB,MAAO,KAAA,CAAK0R,EAAA,CAAQ1R,CAAR,CAAL,CADU,CAdD,QAsBVgc,QAAQ,CAAChc,CAAD,CAAM,CACpB,IAAIY,EAAQ,IAAA,CAAKZ,CAAL,CAAW0R,EAAA,CAAQ1R,CAAR,CAAX,CACZ,QAAO,IAAA,CAAKA,CAAL,CACP,OAAOY,EAHa,CAtBJ,CAmEpB,KAAIuR,GAAU,oCAAd,CACIC,GAAe,GADnB,CAEIC,GAAS,sBAFb,CAGIJ,GAAiB,kCAHrB,CAIIhH,GAAkB5L,CAAA,CAAO,WAAP,CAJtB,CAq0BI0zC,GAAiB1zC,CAAA,CAAO,UAAP,CAr0BrB,CAm1BI2zC,GAAmB,CAAC,UAAD,CAAa,QAAQ,CAACnqC,CAAD,CAAW,CAErD,IAAAoqC,YAAA,CAAmB,EAgCnB,KAAApoB,SAAA,CAAgBC,QAAQ,CAAC5iB,CAAD,CAAO8C,CAAP,CAAgB,CACtC,IAAIhL,EAAMkI,CAANlI,CAAa,YACjB,IAAIkI,CAAJ,EAA8B,GAA9B,EAAYA,CAAAnD,OAAA,CAAY,CAAZ,CAAZ,CAAmC,KAAMguC,GAAA,CAAe,SAAf,CACoB7qC,CADpB,CAAN,CAEnC,IAAA+qC,YAAA,CAAiB/qC,CAAA1D,OAAA,CAAY,CAAZ,CAAjB,CAAA,CAAmCxE,CACnC6I,EAAAmC,QAAA,CAAiBhL,CAAjB,CAAsBgL,CAAtB,CALsC,CAQxC,KAAA+H,KAAA,CAAY,CAAC,UAAD;AAAa,QAAQ,CAACmgC,CAAD,CAAW,CAiB1C,MAAO,OAiBGC,QAAQ,CAAC/sC,CAAD,CAAUpE,CAAV,CAAkBowC,CAAlB,CAAyBnjB,CAAzB,CAA+B,CACzCmkB,CAAAA,CAAYhB,CAAZgB,EAAqBhB,CAAA,CAAMA,CAAA3yC,OAAN,CAAqB,CAArB,CACzB,KAAIqpB,EAAa9mB,CAAb8mB,EAAuB9mB,CAAA,CAAO,CAAP,CAAvB8mB,EAAoCsqB,CAApCtqB,EAAiDsqB,CAAAtqB,WAArD,CAEIuqB,EAAoBD,CAApBC,EAAiCD,CAAAlxB,YAAjCmxB,EAA2D,IAC/DxzC,EAAA,CAAQuG,CAAR,CAAiB,QAAQ,CAAClD,CAAD,CAAO,CAC9B4lB,CAAAmpB,aAAA,CAAwB/uC,CAAxB,CAA8BmwC,CAA9B,CAD8B,CAAhC,CAGApkB,EAAA,EAAQikB,CAAA,CAASjkB,CAAT,CAAe,CAAf,CAAkB,CAAA,CAAlB,CARqC,CAjB1C,OAwCGqkB,QAAQ,CAACltC,CAAD,CAAU6oB,CAAV,CAAgB,CAC9B7oB,CAAA4V,OAAA,EACAiT,EAAA,EAAQikB,CAAA,CAASjkB,CAAT,CAAe,CAAf,CAAkB,CAAA,CAAlB,CAFsB,CAxC3B,MA4DEskB,QAAQ,CAACntC,CAAD,CAAUpE,CAAV,CAAkBowC,CAAlB,CAAyBnjB,CAAzB,CAA+B,CAG5C,IAAAkkB,MAAA,CAAW/sC,CAAX,CAAoBpE,CAApB,CAA4BowC,CAA5B,CAAmCnjB,CAAnC,CAH4C,CA5DzC,UA+EM7P,QAAQ,CAAChZ,CAAD,CAAUkC,CAAV,CAAqB2mB,CAArB,CAA2B,CAC5C3mB,CAAA,CAAY3I,CAAA,CAAS2I,CAAT,CAAA,CACEA,CADF,CAEE1I,CAAA,CAAQ0I,CAAR,CAAA,CAAqBA,CAAApH,KAAA,CAAe,GAAf,CAArB,CAA2C,EACzDrB,EAAA,CAAQuG,CAAR,CAAiB,QAAS,CAACA,CAAD,CAAU,CAClC6J,EAAA,CAAe7J,CAAf,CAAwBkC,CAAxB,CADkC,CAApC,CAGA2mB,EAAA,EAAQikB,CAAA,CAASjkB,CAAT,CAAe,CAAf,CAAkB,CAAA,CAAlB,CAPoC,CA/EzC,aAsGSzF,QAAQ,CAACpjB,CAAD,CAAUkC,CAAV,CAAqB2mB,CAArB,CAA2B,CAC/C3mB,CAAA,CAAY3I,CAAA,CAAS2I,CAAT,CAAA,CACEA,CADF,CAEE1I,CAAA,CAAQ0I,CAAR,CAAA,CAAqBA,CAAApH,KAAA,CAAe,GAAf,CAArB,CAA2C,EACzDrB,EAAA,CAAQuG,CAAR,CAAiB,QAAS,CAACA,CAAD,CAAU,CAClCwJ,EAAA,CAAkBxJ,CAAlB,CAA2BkC,CAA3B,CADkC,CAApC,CAGA2mB,EAAA,EAAQikB,CAAA,CAASjkB,CAAT,CAAe,CAAf,CAAkB,CAAA,CAAlB,CAPuC,CAtG5C,SAgHK/sB,CAhHL,CAjBmC,CAAhC,CA1CyC,CAAhC,CAn1BvB,CA+vDI+f,GAAiB5iB,CAAA,CAAO,UAAP,CASrBmd,GAAAzK,QAAA,CAA2B,CAAC,UAAD,CAwwC3B;IAAI2Y,GAAgB,0BAApB,CA+sCI4F,GAAMpxB,CAAAs0C,eAANljB,EAA+B,QAAQ,EAAG,CAC5C,GAAI,CAAE,MAAO,KAAImjB,aAAJ,CAAkB,oBAAlB,CAAT,CAAoD,MAAOC,CAAP,CAAW,EACnE,GAAI,CAAE,MAAO,KAAID,aAAJ,CAAkB,oBAAlB,CAAT,CAAoD,MAAOE,CAAP,CAAW,EACnE,GAAI,CAAE,MAAO,KAAIF,aAAJ,CAAkB,gBAAlB,CAAT,CAAgD,MAAOG,CAAP,CAAW,EAC/D,KAAMv0C,EAAA,CAAO,cAAP,CAAA,CAAuB,OAAvB,CAAN,CAJ4C,CA/sC9C,CAk2CIuzB,GAAqBvzB,CAAA,CAAO,cAAP,CAl2CzB,CAgvDIw0C,GAAa,iCAhvDjB,CAivDI/e,GAAgB,MAAS,EAAT,OAAsB,GAAtB,KAAkC,EAAlC,CAjvDpB,CAkvDIuB,GAAkBh3B,CAAA,CAAO,WAAP,CA+NtB63B,GAAA1iB,UAAA,CACEsiB,EAAAtiB,UADF,CAEEqhB,EAAArhB,UAFF,CAE+B,SAMpB,CAAA,CANoB,WAYlB,CAAA,CAZkB,QA2BrB2iB,EAAA,CAAe,UAAf,CA3BqB,KA6CxBzf,QAAQ,CAACA,CAAD,CAAM7Q,CAAN,CAAe,CAC1B,GAAIvE,CAAA,CAAYoV,CAAZ,CAAJ,CACE,MAAO,KAAA8e,MAET;IAAI5vB,EAAQitC,EAAAxrC,KAAA,CAAgBqP,CAAhB,CACR9Q,EAAA,CAAM,CAAN,CAAJ,EAAc,IAAA8D,KAAA,CAAU3D,kBAAA,CAAmBH,CAAA,CAAM,CAAN,CAAnB,CAAV,CACd,EAAIA,CAAA,CAAM,CAAN,CAAJ,EAAgBA,CAAA,CAAM,CAAN,CAAhB,GAA0B,IAAAyuB,OAAA,CAAYzuB,CAAA,CAAM,CAAN,CAAZ,EAAwB,EAAxB,CAC1B,KAAAqP,KAAA,CAAUrP,CAAA,CAAM,CAAN,CAAV,EAAsB,EAAtB,CAA0BC,CAA1B,CAEA,OAAO,KATmB,CA7CC,UAqEnBswB,EAAA,CAAe,YAAf,CArEmB,MAmFvBA,EAAA,CAAe,QAAf,CAnFuB,MAiGvBA,EAAA,CAAe,QAAf,CAjGuB,MAqHvBE,EAAA,CAAqB,QAArB,CAA+B,QAAQ,CAAC3sB,CAAD,CAAO,CAClD,MAAyB,GAAlB,EAAAA,CAAA3F,OAAA,CAAY,CAAZ,CAAA,CAAwB2F,CAAxB,CAA+B,GAA/B,CAAqCA,CADM,CAA9C,CArHuB,QA4IrB2qB,QAAQ,CAACA,CAAD,CAASye,CAAT,CAAqB,CACnC,OAAQnyC,SAAAlC,OAAR,EACE,KAAK,CAAL,CACE,MAAO,KAAA21B,SACT,MAAK,CAAL,CACE,GAAIz1B,CAAA,CAAS01B,CAAT,CAAJ,CACE,IAAAD,SAAA,CAAgBpuB,EAAA,CAAcquB,CAAd,CADlB,KAEO,IAAI7yB,CAAA,CAAS6yB,CAAT,CAAJ,CACL,IAAAD,SAAA,CAAgBC,CADX,KAGL,MAAMgB,GAAA,CAAgB,UAAhB,CAAN,CAEF,KACF,SACMyd,CAAJ,EAAkB10C,CAAlB,EAA6C,IAA7C,EAA+B00C,CAA/B,CACE,OAAO,IAAA1e,SAAA,CAAcC,CAAd,CADT,CAGE,IAAAD,SAAA,CAAcC,CAAd,CAHF,CAG0Bye,CAhB9B,CAoBA,IAAAxd,UAAA,EACA;MAAO,KAtB4B,CA5IR,MAoLvBe,EAAA,CAAqB,QAArB,CAA+Bl1B,EAA/B,CApLuB,SA+LpB0E,QAAQ,EAAG,CAClB,IAAA+xB,UAAA,CAAiB,CAAA,CACjB,OAAO,KAFW,CA/LS,CAuiB/B,KAAIiB,GAAex6B,CAAA,CAAO,QAAP,CAAnB,CACIw8B,GAAsB,EAD1B,CAEIzB,EAFJ,CAyDI2Z,GAAY,CACZ,MADY,CACLC,QAAQ,EAAE,CAAC,MAAO,KAAR,CADL,CAEZ,MAFY,CAELC,QAAQ,EAAE,CAAC,MAAO,CAAA,CAAR,CAFL,CAGZ,OAHY,CAGJC,QAAQ,EAAE,CAAC,MAAO,CAAA,CAAR,CAHN,WAIFhyC,CAJE,CAKZ,GALY,CAKRiyC,QAAQ,CAAClvC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAC7BD,CAAA,CAAEA,CAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAiByT,EAAA,CAAEA,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CACrB,OAAI5R,EAAA,CAAUolB,CAAV,CAAJ,CACMplB,CAAA,CAAUqlB,CAAV,CAAJ,CACSD,CADT,CACaC,CADb,CAGOD,CAJT,CAMOplB,CAAA,CAAUqlB,CAAV,CAAA,CAAaA,CAAb,CAAexoB,CARO,CALnB,CAcZ,GAdY,CAcRg1C,QAAQ,CAACnvC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAACD,CAAA,CAAEA,CAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAiByT,EAAA,CAAEA,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAiB,QAAQ5R,CAAA,CAAUolB,CAAV,CAAA,CAAaA,CAAb,CAAe,CAAvB,GAA2BplB,CAAA,CAAUqlB,CAAV,CAAA,CAAaA,CAAb,CAAe,CAA1C,CAAvC,CAdnB,CAeZ,GAfY,CAeRysB,QAAQ,CAACpvC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,CAAuByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAxB,CAfnB,CAgBZ,GAhBY,CAgBRmgC,QAAQ,CAACrvC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,CAAuByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAxB,CAhBnB,CAiBZ,GAjBY,CAiBRogC,QAAQ,CAACtvC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,CAAuByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAxB,CAjBnB,CAkBZ,GAlBY,CAkBRqgC,QAAQ,CAACvvC,CAAD;AAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,CAAuByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAxB,CAlBnB,CAmBZ,GAnBY,CAmBRjS,CAnBQ,CAoBZ,KApBY,CAoBNuyC,QAAQ,CAACxvC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAkBC,CAAlB,CAAoB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,GAAyByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAA1B,CApBtB,CAqBZ,KArBY,CAqBNugC,QAAQ,CAACzvC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAkBC,CAAlB,CAAoB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,GAAyByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAA1B,CArBtB,CAsBZ,IAtBY,CAsBPwgC,QAAQ,CAAC1vC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,EAAwByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAzB,CAtBpB,CAuBZ,IAvBY,CAuBPygC,QAAQ,CAAC3vC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,EAAwByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAzB,CAvBpB,CAwBZ,GAxBY,CAwBR0gC,QAAQ,CAAC5vC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,CAAuByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAxB,CAxBnB,CAyBZ,GAzBY,CAyBR2gC,QAAQ,CAAC7vC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,CAAuByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAxB,CAzBnB,CA0BZ,IA1BY,CA0BP4gC,QAAQ,CAAC9vC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,EAAwByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAzB,CA1BpB,CA2BZ,IA3BY,CA2BP6gC,QAAQ,CAAC/vC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,EAAwByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAzB,CA3BpB,CA4BZ,IA5BY,CA4BP8gC,QAAQ,CAAChwC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,EAAwByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAzB,CA5BpB,CA6BZ,IA7BY,CA6BP+gC,QAAQ,CAACjwC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,EAAwByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAzB,CA7BpB,CA8BZ,GA9BY,CA8BRghC,QAAQ,CAAClwC,CAAD;AAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,CAAuByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAxB,CA9BnB,CAgCZ,GAhCY,CAgCRihC,QAAQ,CAACnwC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOA,EAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAA,CAAgBlP,CAAhB,CAAsBkP,CAAtB,CAA8BwT,CAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAA9B,CAAR,CAhCnB,CAiCZ,GAjCY,CAiCRkhC,QAAQ,CAACpwC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiB,CAAC,MAAO,CAACA,CAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAT,CAjCjB,CAzDhB,CA4FImhC,GAAS,GAAK,IAAL,GAAe,IAAf,GAAyB,IAAzB,GAAmC,IAAnC,GAA6C,IAA7C,CAAmD,GAAnD,CAAuD,GAAvD,CAA4D,GAA5D,CAAgE,GAAhE,CA5Fb,CAqGItZ,GAAQA,QAAS,CAAClhB,CAAD,CAAU,CAC7B,IAAAA,QAAA,CAAeA,CADc,CAI/BkhB,GAAAxnB,UAAA,CAAkB,aACHwnB,EADG,KAGXuZ,QAAS,CAACvtB,CAAD,CAAO,CACnB,IAAAA,KAAA,CAAYA,CAEZ,KAAAlnB,MAAA,CAAa,CACb,KAAA00C,GAAA,CAAUp2C,CACV,KAAAq2C,OAAA,CAAc,GAEd,KAAAC,OAAA,CAAc,EAEd,KAAI1rB,CAGJ,KAFIlkB,CAEJ,CAFW,EAEX,CAAO,IAAAhF,MAAP,CAAoB,IAAAknB,KAAAvoB,OAApB,CAAA,CAAsC,CACpC,IAAA+1C,GAAA,CAAU,IAAAxtB,KAAAjjB,OAAA,CAAiB,IAAAjE,MAAjB,CACV,IAAI,IAAA60C,GAAA,CAAQ,KAAR,CAAJ,CACE,IAAAC,WAAA,CAAgB,IAAAJ,GAAhB,CADF,KAEO,IAAI,IAAA/yC,SAAA,CAAc,IAAA+yC,GAAd,CAAJ,EAA8B,IAAAG,GAAA,CAAQ,GAAR,CAA9B,EAA8C,IAAAlzC,SAAA,CAAc,IAAAozC,KAAA,EAAd,CAA9C,CACL,IAAAC,WAAA,EADK;IAEA,IAAI,IAAAC,QAAA,CAAa,IAAAP,GAAb,CAAJ,CACL,IAAAQ,UAAA,EAEA,CAAI,IAAAC,IAAA,CAAS,IAAT,CAAJ,GAAkC,GAAlC,GAAsBnwC,CAAA,CAAK,CAAL,CAAtB,GACKkkB,CADL,CACa,IAAA0rB,OAAA,CAAY,IAAAA,OAAAj2C,OAAZ,CAAiC,CAAjC,CADb,KAEEuqB,CAAAlkB,KAFF,CAE4C,EAF5C,GAEekkB,CAAAhC,KAAAvkB,QAAA,CAAmB,GAAnB,CAFf,CAHK,KAOA,IAAI,IAAAkyC,GAAA,CAAQ,aAAR,CAAJ,CACL,IAAAD,OAAAp1C,KAAA,CAAiB,OACR,IAAAQ,MADQ,MAET,IAAA00C,GAFS,MAGR,IAAAS,IAAA,CAAS,KAAT,CAHQ,EAGW,IAAAN,GAAA,CAAQ,IAAR,CAHX,EAG6B,IAAAA,GAAA,CAAQ,MAAR,CAH7B,CAAjB,CAOA,CAFI,IAAAA,GAAA,CAAQ,IAAR,CAEJ,EAFmB7vC,CAAAzE,QAAA,CAAa,IAAAm0C,GAAb,CAEnB,CADI,IAAAG,GAAA,CAAQ,IAAR,CACJ,EADmB7vC,CAAAoH,MAAA,EACnB,CAAA,IAAApM,MAAA,EARK,KASA,IAAI,IAAAo1C,aAAA,CAAkB,IAAAV,GAAlB,CAAJ,CAAgC,CACrC,IAAA10C,MAAA,EACA,SAFqC,CAAhC,IAGA,CACL,IAAIq1C,EAAM,IAAAX,GAANW,CAAgB,IAAAN,KAAA,EAApB,CACIO,EAAMD,CAANC,CAAY,IAAAP,KAAA,CAAU,CAAV,CADhB,CAEI3wC,EAAK6uC,EAAA,CAAU,IAAAyB,GAAV,CAFT,CAGIa,EAAMtC,EAAA,CAAUoC,CAAV,CAHV,CAIIG,EAAMvC,EAAA,CAAUqC,CAAV,CACNE,EAAJ,EACE,IAAAZ,OAAAp1C,KAAA,CAAiB,OAAQ,IAAAQ,MAAR;KAA0Bs1C,CAA1B,IAAmCE,CAAnC,CAAjB,CACA,CAAA,IAAAx1C,MAAA,EAAc,CAFhB,EAGWu1C,CAAJ,EACL,IAAAX,OAAAp1C,KAAA,CAAiB,OAAQ,IAAAQ,MAAR,MAA0Bq1C,CAA1B,IAAmCE,CAAnC,CAAjB,CACA,CAAA,IAAAv1C,MAAA,EAAc,CAFT,EAGIoE,CAAJ,EACL,IAAAwwC,OAAAp1C,KAAA,CAAiB,OACR,IAAAQ,MADQ,MAET,IAAA00C,GAFS,IAGXtwC,CAHW,MAIR,IAAA+wC,IAAA,CAAS,KAAT,CAJQ,EAIW,IAAAN,GAAA,CAAQ,IAAR,CAJX,CAAjB,CAMA,CAAA,IAAA70C,MAAA,EAAc,CAPT,EASL,IAAAy1C,WAAA,CAAgB,4BAAhB,CAA8C,IAAAz1C,MAA9C,CAA0D,IAAAA,MAA1D,CAAuE,CAAvE,CArBG,CAwBP,IAAA20C,OAAA,CAAc,IAAAD,GAjDsB,CAmDtC,MAAO,KAAAE,OA/DY,CAHL,IAqEZC,QAAQ,CAACa,CAAD,CAAQ,CAClB,MAAmC,EAAnC,GAAOA,CAAA/yC,QAAA,CAAc,IAAA+xC,GAAd,CADW,CArEJ,KAyEXS,QAAQ,CAACO,CAAD,CAAQ,CACnB,MAAuC,EAAvC,GAAOA,CAAA/yC,QAAA,CAAc,IAAAgyC,OAAd,CADY,CAzEL,MA6EVI,QAAQ,CAACp1C,CAAD,CAAI,CACZyzB,CAAAA,CAAMzzB,CAANyzB,EAAW,CACf,OAAQ,KAAApzB,MAAD,CAAcozB,CAAd,CAAoB,IAAAlM,KAAAvoB,OAApB,CAAwC,IAAAuoB,KAAAjjB,OAAA,CAAiB,IAAAjE,MAAjB;AAA8BozB,CAA9B,CAAxC,CAA6E,CAAA,CAFpE,CA7EF,UAkFNzxB,QAAQ,CAAC+yC,CAAD,CAAK,CACrB,MAAQ,GAAR,EAAeA,CAAf,EAA2B,GAA3B,EAAqBA,CADA,CAlFP,cAsFFU,QAAQ,CAACV,CAAD,CAAK,CACzB,MAAe,GAAf,GAAQA,CAAR,EAA6B,IAA7B,GAAsBA,CAAtB,EAA4C,IAA5C,GAAqCA,CAArC,EACe,IADf,GACQA,CADR,EAC8B,IAD9B,GACuBA,CADvB,EAC6C,QAD7C,GACsCA,CAFb,CAtFX,SA2FPO,QAAQ,CAACP,CAAD,CAAK,CACpB,MAAQ,GAAR,EAAeA,CAAf,EAA2B,GAA3B,EAAqBA,CAArB,EACQ,GADR,EACeA,CADf,EAC2B,GAD3B,EACqBA,CADrB,EAEQ,GAFR,GAEgBA,CAFhB,EAE6B,GAF7B,GAEsBA,CAHF,CA3FN,eAiGDiB,QAAQ,CAACjB,CAAD,CAAK,CAC1B,MAAe,GAAf,GAAQA,CAAR,EAA6B,GAA7B,GAAsBA,CAAtB,EAAoC,IAAA/yC,SAAA,CAAc+yC,CAAd,CADV,CAjGZ,YAqGJe,QAAQ,CAACx/B,CAAD,CAAQ2/B,CAAR,CAAeC,CAAf,CAAoB,CACtCA,CAAA,CAAMA,CAAN,EAAa,IAAA71C,MACT81C,EAAAA,CAAUr0C,CAAA,CAAUm0C,CAAV,CACA,CAAJ,IAAI,CAAGA,CAAH,CAAY,GAAZ,CAAkB,IAAA51C,MAAlB,CAA+B,IAA/B,CAAsC,IAAAknB,KAAAhO,UAAA,CAAoB08B,CAApB,CAA2BC,CAA3B,CAAtC,CAAwE,GAAxE,CACJ,GADI,CACEA,CAChB,MAAM9c,GAAA,CAAa,QAAb,CACF9iB,CADE,CACK6/B,CADL,CACa,IAAA5uB,KADb,CAAN,CALsC,CArGxB,YA8GJ8tB,QAAQ,EAAG,CAGrB,IAFA,IAAIlO,EAAS,EAAb,CACI8O,EAAQ,IAAA51C,MACZ,CAAO,IAAAA,MAAP,CAAoB,IAAAknB,KAAAvoB,OAApB,CAAA,CAAsC,CACpC,IAAI+1C;AAAKtvC,CAAA,CAAU,IAAA8hB,KAAAjjB,OAAA,CAAiB,IAAAjE,MAAjB,CAAV,CACT,IAAU,GAAV,EAAI00C,CAAJ,EAAiB,IAAA/yC,SAAA,CAAc+yC,CAAd,CAAjB,CACE5N,CAAA,EAAU4N,CADZ,KAEO,CACL,IAAIqB,EAAS,IAAAhB,KAAA,EACb,IAAU,GAAV,EAAIL,CAAJ,EAAiB,IAAAiB,cAAA,CAAmBI,CAAnB,CAAjB,CACEjP,CAAA,EAAU4N,CADZ,KAEO,IAAI,IAAAiB,cAAA,CAAmBjB,CAAnB,CAAJ,EACHqB,CADG,EACO,IAAAp0C,SAAA,CAAco0C,CAAd,CADP,EAEiC,GAFjC,EAEHjP,CAAA7iC,OAAA,CAAc6iC,CAAAnoC,OAAd,CAA8B,CAA9B,CAFG,CAGLmoC,CAAA,EAAU4N,CAHL,KAIA,IAAI,CAAA,IAAAiB,cAAA,CAAmBjB,CAAnB,CAAJ,EACDqB,CADC,EACU,IAAAp0C,SAAA,CAAco0C,CAAd,CADV,EAEiC,GAFjC,EAEHjP,CAAA7iC,OAAA,CAAc6iC,CAAAnoC,OAAd,CAA8B,CAA9B,CAFG,CAKL,KALK,KAGL,KAAA82C,WAAA,CAAgB,kBAAhB,CAXG,CAgBP,IAAAz1C,MAAA,EApBoC,CAsBtC8mC,CAAA,EAAS,CACT,KAAA8N,OAAAp1C,KAAA,CAAiB,OACRo2C,CADQ,MAET9O,CAFS,MAGT,CAAA,CAHS,IAIX1iC,QAAQ,EAAG,CAAE,MAAO0iC,EAAT,CAJA,CAAjB,CA1BqB,CA9GP,WAgJLoO,QAAQ,EAAG,CAQpB,IAPA,IAAI/Z,EAAS,IAAb,CAEI6a,EAAQ,EAFZ,CAGIJ,EAAQ,IAAA51C,MAHZ,CAKIi2C,CALJ,CAKaC,CALb,CAKwBC,CALxB,CAKoCzB,CAEpC,CAAO,IAAA10C,MAAP,CAAoB,IAAAknB,KAAAvoB,OAApB,CAAA,CAAsC,CACpC+1C,CAAA;AAAK,IAAAxtB,KAAAjjB,OAAA,CAAiB,IAAAjE,MAAjB,CACL,IAAW,GAAX,GAAI00C,CAAJ,EAAkB,IAAAO,QAAA,CAAaP,CAAb,CAAlB,EAAsC,IAAA/yC,SAAA,CAAc+yC,CAAd,CAAtC,CACa,GACX,GADIA,CACJ,GADgBuB,CAChB,CAD0B,IAAAj2C,MAC1B,EAAAg2C,CAAA,EAAStB,CAFX,KAIE,MAEF,KAAA10C,MAAA,EARoC,CAYtC,GAAIi2C,CAAJ,CAEE,IADAC,CACA,CADY,IAAAl2C,MACZ,CAAOk2C,CAAP,CAAmB,IAAAhvB,KAAAvoB,OAAnB,CAAA,CAAqC,CACnC+1C,CAAA,CAAK,IAAAxtB,KAAAjjB,OAAA,CAAiBiyC,CAAjB,CACL,IAAW,GAAX,GAAIxB,CAAJ,CAAgB,CACdyB,CAAA,CAAaH,CAAAtyC,OAAA,CAAauyC,CAAb,CAAuBL,CAAvB,CAA+B,CAA/B,CACbI,EAAA,CAAQA,CAAAtyC,OAAA,CAAa,CAAb,CAAgBuyC,CAAhB,CAA0BL,CAA1B,CACR,KAAA51C,MAAA,CAAak2C,CACb,MAJc,CAMhB,GAAI,IAAAd,aAAA,CAAkBV,CAAlB,CAAJ,CACEwB,CAAA,EADF,KAGE,MAXiC,CAiBnChtB,CAAAA,CAAQ,OACH0sB,CADG,MAEJI,CAFI,CAMZ,IAAI/C,EAAA7zC,eAAA,CAAyB42C,CAAzB,CAAJ,CACE9sB,CAAA9kB,GACA,CADW6uC,EAAA,CAAU+C,CAAV,CACX,CAAA9sB,CAAAlkB,KAAA,CAAaiuC,EAAA,CAAU+C,CAAV,CAFf,KAGO,CACL,IAAIrsC,EAASswB,EAAA,CAAS+b,CAAT,CAAgB,IAAAh8B,QAAhB,CAA8B,IAAAkN,KAA9B,CACbgC,EAAA9kB,GAAA,CAAWzD,CAAA,CAAO,QAAQ,CAACwD,CAAD,CAAOkP,CAAP,CAAe,CACvC,MAAQ1J,EAAA,CAAOxF,CAAP,CAAakP,CAAb,CAD+B,CAA9B,CAER,QACOkQ,QAAQ,CAACpf,CAAD,CAAOrE,CAAP,CAAc,CAC5B,MAAOm5B,GAAA,CAAO90B,CAAP,CAAa6xC,CAAb,CAAoBl2C,CAApB,CAA2Bq7B,CAAAjU,KAA3B,CAAwCiU,CAAAnhB,QAAxC,CADqB,CAD7B,CAFQ,CAFN,CAWP,IAAA46B,OAAAp1C,KAAA,CAAiB0pB,CAAjB,CAEIitB;CAAJ,GACE,IAAAvB,OAAAp1C,KAAA,CAAiB,OACTy2C,CADS,MAET,GAFS,MAGT,CAAA,CAHS,CAAjB,CAKA,CAAA,IAAArB,OAAAp1C,KAAA,CAAiB,OACRy2C,CADQ,CACE,CADF,MAETE,CAFS,MAGT,CAAA,CAHS,CAAjB,CANF,CA7DoB,CAhJN,YA2NJrB,QAAQ,CAACsB,CAAD,CAAQ,CAC1B,IAAIR,EAAQ,IAAA51C,MACZ,KAAAA,MAAA,EAIA,KAHA,IAAIipC,EAAS,EAAb,CACIoN,EAAYD,CADhB,CAEIt9B,EAAS,CAAA,CACb,CAAO,IAAA9Y,MAAP,CAAoB,IAAAknB,KAAAvoB,OAApB,CAAA,CAAsC,CACpC,IAAI+1C,EAAK,IAAAxtB,KAAAjjB,OAAA,CAAiB,IAAAjE,MAAjB,CAAT,CACAq2C,EAAAA,CAAAA,CAAa3B,CACb,IAAI57B,CAAJ,CACa,GAAX,GAAI47B,CAAJ,EACM4B,CAIJ,CAJU,IAAApvB,KAAAhO,UAAA,CAAoB,IAAAlZ,MAApB,CAAiC,CAAjC,CAAoC,IAAAA,MAApC,CAAiD,CAAjD,CAIV,CAHKs2C,CAAAxwC,MAAA,CAAU,aAAV,CAGL,EAFE,IAAA2vC,WAAA,CAAgB,6BAAhB,CAAgDa,CAAhD,CAAsD,GAAtD,CAEF,CADA,IAAAt2C,MACA,EADc,CACd,CAAAipC,CAAA,EAAU5oC,MAAAC,aAAA,CAAoBU,QAAA,CAASs1C,CAAT,CAAc,EAAd,CAApB,CALZ,EASIrN,CATJ,CAQE,CADIsN,CACJ,CADU/B,EAAA,CAAOE,CAAP,CACV,EACEzL,CADF,CACYsN,CADZ,CAGEtN,CAHF,CAGYyL,CAGd,CAAA57B,CAAA,CAAS,CAAA,CAfX,KAgBO,IAAW,IAAX,GAAI47B,CAAJ,CACL57B,CAAA,CAAS,CAAA,CADJ,KAEA,CAAA,GAAI47B,CAAJ,GAAW0B,CAAX,CAAkB,CACvB,IAAAp2C,MAAA,EACA;IAAA40C,OAAAp1C,KAAA,CAAiB,OACRo2C,CADQ,MAETS,CAFS,QAGPpN,CAHO,MAIT,CAAA,CAJS,IAKX7kC,QAAQ,EAAG,CAAE,MAAO6kC,EAAT,CALA,CAAjB,CAOA,OATuB,CAWvBA,CAAA,EAAUyL,CAXL,CAaP,IAAA10C,MAAA,EAlCoC,CAoCtC,IAAAy1C,WAAA,CAAgB,oBAAhB,CAAsCG,CAAtC,CA1C0B,CA3NZ,CA6QlB,KAAIxa,GAASA,QAAS,CAACH,CAAD,CAAQH,CAAR,CAAiB9gB,CAAjB,CAA0B,CAC9C,IAAAihB,MAAA,CAAaA,CACb,KAAAH,QAAA,CAAeA,CACf,KAAA9gB,QAAA,CAAeA,CAH+B,CAMhDohB,GAAAob,KAAA,CAAcC,QAAS,EAAG,CAAE,MAAO,EAAT,CAE1Brb,GAAA1nB,UAAA,CAAmB,aACJ0nB,EADI,OAGVn2B,QAAS,CAACiiB,CAAD,CAAOliB,CAAP,CAAa,CAC3B,IAAAkiB,KAAA,CAAYA,CAGZ,KAAAliB,KAAA,CAAYA,CAEZ,KAAA4vC,OAAA,CAAc,IAAA3Z,MAAAwZ,IAAA,CAAevtB,CAAf,CAEVliB,EAAJ,GAGE,IAAA0xC,WAEA,CAFkB,IAAAC,UAElB,CAAA,IAAAC,aAAA,CACA,IAAAC,YADA,CAEA,IAAAC,YAFA,CAGA,IAAAC,YAHA,CAGmBC,QAAQ,EAAG,CAC5B,IAAAvB,WAAA,CAAgB,mBAAhB,CAAqC,MAAOvuB,CAAP;MAAoB,CAApB,CAArC,CAD4B,CARhC,CAaA,KAAIpnB,EAAQkF,CAAA,CAAO,IAAAiyC,QAAA,EAAP,CAAwB,IAAAC,WAAA,EAET,EAA3B,GAAI,IAAAtC,OAAAj2C,OAAJ,EACE,IAAA82C,WAAA,CAAgB,wBAAhB,CAA0C,IAAAb,OAAA,CAAY,CAAZ,CAA1C,CAGF90C,EAAAsjC,QAAA,CAAgB,CAAC,CAACtjC,CAAAsjC,QAClBtjC,EAAAiU,SAAA,CAAiB,CAAC,CAACjU,CAAAiU,SAEnB,OAAOjU,EA9BoB,CAHZ,SAoCRm3C,QAAS,EAAG,CACnB,IAAIA,CACJ,IAAI,IAAAE,OAAA,CAAY,GAAZ,CAAJ,CACEF,CACA,CADU,IAAAF,YAAA,EACV,CAAA,IAAAK,QAAA,CAAa,GAAb,CAFF,KAGO,IAAI,IAAAD,OAAA,CAAY,GAAZ,CAAJ,CACLF,CAAA,CAAU,IAAAI,iBAAA,EADL,KAEA,IAAI,IAAAF,OAAA,CAAY,GAAZ,CAAJ,CACLF,CAAA,CAAU,IAAA7M,OAAA,EADL,KAEA,CACL,IAAIlhB,EAAQ,IAAAiuB,OAAA,EAEZ,EADAF,CACA,CADU/tB,CAAA9kB,GACV,GACE,IAAAqxC,WAAA,CAAgB,0BAAhB,CAA4CvsB,CAA5C,CAEEA,EAAAlkB,KAAJ,GACEiyC,CAAAljC,SACA,CADmB,CAAA,CACnB,CAAAkjC,CAAA7T,QAAA,CAAkB,CAAA,CAFpB,CANK,CAaP,IADA,IAAUnkC,CACV,CAAQihC,CAAR,CAAe,IAAAiX,OAAA,CAAY,GAAZ;AAAiB,GAAjB,CAAsB,GAAtB,CAAf,CAAA,CACoB,GAAlB,GAAIjX,CAAAhZ,KAAJ,EACE+vB,CACA,CADU,IAAAL,aAAA,CAAkBK,CAAlB,CAA2Bh4C,CAA3B,CACV,CAAAA,CAAA,CAAU,IAFZ,EAGyB,GAAlB,GAAIihC,CAAAhZ,KAAJ,EACLjoB,CACA,CADUg4C,CACV,CAAAA,CAAA,CAAU,IAAAH,YAAA,CAAiBG,CAAjB,CAFL,EAGkB,GAAlB,GAAI/W,CAAAhZ,KAAJ,EACLjoB,CACA,CADUg4C,CACV,CAAAA,CAAA,CAAU,IAAAJ,YAAA,CAAiBI,CAAjB,CAFL,EAIL,IAAAxB,WAAA,CAAgB,YAAhB,CAGJ,OAAOwB,EApCY,CApCJ,YA2ELxB,QAAQ,CAAC6B,CAAD,CAAMpuB,CAAN,CAAa,CAC/B,KAAM6P,GAAA,CAAa,QAAb,CAEA7P,CAAAhC,KAFA,CAEYowB,CAFZ,CAEkBpuB,CAAAlpB,MAFlB,CAEgC,CAFhC,CAEoC,IAAAknB,KAFpC,CAE+C,IAAAA,KAAAhO,UAAA,CAAoBgQ,CAAAlpB,MAApB,CAF/C,CAAN,CAD+B,CA3EhB,WAiFNu3C,QAAQ,EAAG,CACpB,GAA2B,CAA3B,GAAI,IAAA3C,OAAAj2C,OAAJ,CACE,KAAMo6B,GAAA,CAAa,MAAb,CAA0D,IAAA7R,KAA1D,CAAN,CACF,MAAO,KAAA0tB,OAAA,CAAY,CAAZ,CAHa,CAjFL,MAuFXG,QAAQ,CAACnC,CAAD,CAAKC,CAAL,CAASC,CAAT,CAAa0E,CAAb,CAAiB,CAC7B,GAAyB,CAAzB,CAAI,IAAA5C,OAAAj2C,OAAJ,CAA4B,CAC1B,IAAIuqB,EAAQ,IAAA0rB,OAAA,CAAY,CAAZ,CAAZ,CACI6C,EAAIvuB,CAAAhC,KACR,IAAIuwB,CAAJ,GAAU7E,CAAV,EAAgB6E,CAAhB,GAAsB5E,CAAtB,EAA4B4E,CAA5B,GAAkC3E,CAAlC,EAAwC2E,CAAxC,GAA8CD,CAA9C,EACK,EAAC5E,CAAD,EAAQC,CAAR,EAAeC,CAAf,EAAsB0E,CAAtB,CADL,CAEE,MAAOtuB,EALiB,CAQ5B,MAAO,CAAA,CATsB,CAvFd;OAmGTiuB,QAAQ,CAACvE,CAAD,CAAKC,CAAL,CAASC,CAAT,CAAa0E,CAAb,CAAgB,CAE9B,MAAA,CADItuB,CACJ,CADY,IAAA6rB,KAAA,CAAUnC,CAAV,CAAcC,CAAd,CAAkBC,CAAlB,CAAsB0E,CAAtB,CACZ,GACM,IAAAxyC,KAIGkkB,EAJWlkB,CAAAkkB,CAAAlkB,KAIXkkB,EAHL,IAAAusB,WAAA,CAAgB,mBAAhB,CAAqCvsB,CAArC,CAGKA,CADP,IAAA0rB,OAAAxoC,MAAA,EACO8c,CAAAA,CALT,EAOO,CAAA,CATuB,CAnGf,SA+GRkuB,QAAQ,CAACxE,CAAD,CAAI,CACd,IAAAuE,OAAA,CAAYvE,CAAZ,CAAL,EACE,IAAA6C,WAAA,CAAgB,4BAAhB,CAA+C7C,CAA/C,CAAoD,GAApD,CAAyD,IAAAmC,KAAA,EAAzD,CAFiB,CA/GJ,SAqHR2C,QAAQ,CAACtzC,CAAD,CAAKuzC,CAAL,CAAY,CAC3B,MAAOh3C,EAAA,CAAO,QAAQ,CAACwD,CAAD,CAAOkP,CAAP,CAAe,CACnC,MAAOjP,EAAA,CAAGD,CAAH,CAASkP,CAAT,CAAiBskC,CAAjB,CAD4B,CAA9B,CAEJ,UACQA,CAAA5jC,SADR,CAFI,CADoB,CArHZ,WA6HN6jC,QAAQ,CAACC,CAAD,CAAOC,CAAP,CAAeH,CAAf,CAAqB,CACtC,MAAOh3C,EAAA,CAAO,QAAQ,CAACwD,CAAD,CAAOkP,CAAP,CAAc,CAClC,MAAOwkC,EAAA,CAAK1zC,CAAL,CAAWkP,CAAX,CAAA,CAAqBykC,CAAA,CAAO3zC,CAAP,CAAakP,CAAb,CAArB,CAA4CskC,CAAA,CAAMxzC,CAAN,CAAYkP,CAAZ,CADjB,CAA7B,CAEJ,UACSwkC,CAAA9jC,SADT,EAC0B+jC,CAAA/jC,SAD1B,EAC6C4jC,CAAA5jC,SAD7C,CAFI,CAD+B,CA7HvB,UAqIPgkC,QAAQ,CAACF,CAAD,CAAOzzC,CAAP,CAAWuzC,CAAX,CAAkB,CAClC,MAAOh3C,EAAA,CAAO,QAAQ,CAACwD,CAAD,CAAOkP,CAAP,CAAe,CACnC,MAAOjP,EAAA,CAAGD,CAAH;AAASkP,CAAT,CAAiBwkC,CAAjB,CAAuBF,CAAvB,CAD4B,CAA9B,CAEJ,UACQE,CAAA9jC,SADR,EACyB4jC,CAAA5jC,SADzB,CAFI,CAD2B,CArInB,YA6ILmjC,QAAQ,EAAG,CAErB,IADA,IAAIA,EAAa,EACjB,CAAA,CAAA,CAGE,GAFyB,CAErB,CAFA,IAAAtC,OAAAj2C,OAEA,EAF2B,CAAA,IAAAo2C,KAAA,CAAU,GAAV,CAAe,GAAf,CAAoB,GAApB,CAAyB,GAAzB,CAE3B,EADFmC,CAAA13C,KAAA,CAAgB,IAAAu3C,YAAA,EAAhB,CACE,CAAA,CAAC,IAAAI,OAAA,CAAY,GAAZ,CAAL,CAGE,MAA8B,EACvB,GADCD,CAAAv4C,OACD,CAADu4C,CAAA,CAAW,CAAX,CAAC,CACD,QAAQ,CAAC/yC,CAAD,CAAOkP,CAAP,CAAe,CAErB,IADA,IAAIvT,CAAJ,CACSH,EAAI,CAAb,CAAgBA,CAAhB,CAAoBu3C,CAAAv4C,OAApB,CAAuCgB,CAAA,EAAvC,CAA4C,CAC1C,IAAIq4C,EAAYd,CAAA,CAAWv3C,CAAX,CACZq4C,EAAJ,GACEl4C,CADF,CACUk4C,CAAA,CAAU7zC,CAAV,CAAgBkP,CAAhB,CADV,CAF0C,CAM5C,MAAOvT,EARc,CAVZ,CA7IN,aAqKJi3C,QAAQ,EAAG,CAGtB,IAFA,IAAIc,EAAO,IAAA5tB,WAAA,EAAX,CACIf,CACJ,CAAA,CAAA,CACE,GAAKA,CAAL,CAAa,IAAAiuB,OAAA,CAAY,GAAZ,CAAb,CACEU,CAAA,CAAO,IAAAE,SAAA,CAAcF,CAAd,CAAoB3uB,CAAA9kB,GAApB,CAA8B,IAAAyH,OAAA,EAA9B,CADT,KAGE,OAAOgsC,EAPW,CArKP,QAiLThsC,QAAQ,EAAG,CAIjB,IAHA,IAAIqd,EAAQ,IAAAiuB,OAAA,EAAZ,CACI/yC,EAAK,IAAA02B,QAAA,CAAa5R,CAAAhC,KAAb,CADT,CAEI+wB,EAAS,EACb,CAAA,CAAA,CACE,GAAK/uB,CAAL,CAAa,IAAAiuB,OAAA,CAAY,GAAZ,CAAb,CACEc,CAAAz4C,KAAA,CAAY,IAAAyqB,WAAA,EAAZ,CADF;IAEO,CACL,IAAIiuB,EAAWA,QAAQ,CAAC/zC,CAAD,CAAOkP,CAAP,CAAeg3B,CAAf,CAAsB,CACvC/2B,CAAAA,CAAO,CAAC+2B,CAAD,CACX,KAAK,IAAI1qC,EAAI,CAAb,CAAgBA,CAAhB,CAAoBs4C,CAAAt5C,OAApB,CAAmCgB,CAAA,EAAnC,CACE2T,CAAA9T,KAAA,CAAUy4C,CAAA,CAAOt4C,CAAP,CAAA,CAAUwE,CAAV,CAAgBkP,CAAhB,CAAV,CAEF,OAAOjP,EAAAtC,MAAA,CAASqC,CAAT,CAAemP,CAAf,CALoC,CAO7C,OAAO,SAAQ,EAAG,CAChB,MAAO4kC,EADS,CARb,CAPQ,CAjLF,YAuMLjuB,QAAQ,EAAG,CACrB,MAAO,KAAAysB,WAAA,EADc,CAvMN,YA2MLA,QAAQ,EAAG,CACrB,IAAImB,EAAO,IAAAM,QAAA,EAAX,CACIR,CADJ,CAEIzuB,CACJ,OAAA,CAAKA,CAAL,CAAa,IAAAiuB,OAAA,CAAY,GAAZ,CAAb,GACOU,CAAAt0B,OAKE,EAJL,IAAAkyB,WAAA,CAAgB,0BAAhB,CACI,IAAAvuB,KAAAhO,UAAA,CAAoB,CAApB,CAAuBgQ,CAAAlpB,MAAvB,CADJ,CAC0C,0BAD1C,CACsEkpB,CADtE,CAIK,CADPyuB,CACO,CADC,IAAAQ,QAAA,EACD,CAAA,QAAQ,CAACjwC,CAAD,CAAQmL,CAAR,CAAgB,CAC7B,MAAOwkC,EAAAt0B,OAAA,CAAYrb,CAAZ,CAAmByvC,CAAA,CAAMzvC,CAAN,CAAamL,CAAb,CAAnB,CAAyCA,CAAzC,CADsB,CANjC,EAUOwkC,CAdc,CA3MN,SA4NRM,QAAQ,EAAG,CAClB,IAAIN,EAAO,IAAAlB,UAAA,EAAX,CACImB,CADJ,CAEI5uB,CACJ,IAAa,IAAAiuB,OAAA,CAAY,GAAZ,CAAb,CAAgC,CAC9BW,CAAA,CAAS,IAAAK,QAAA,EACT;GAAKjvB,CAAL,CAAa,IAAAiuB,OAAA,CAAY,GAAZ,CAAb,CACE,MAAO,KAAAS,UAAA,CAAeC,CAAf,CAAqBC,CAArB,CAA6B,IAAAK,QAAA,EAA7B,CAEP,KAAA1C,WAAA,CAAgB,YAAhB,CAA8BvsB,CAA9B,CAL4B,CAAhC,IAQE,OAAO2uB,EAZS,CA5NH,WA4ONlB,QAAQ,EAAG,CAGpB,IAFA,IAAIkB,EAAO,IAAAO,WAAA,EAAX,CACIlvB,CACJ,CAAA,CAAA,CACE,GAAKA,CAAL,CAAa,IAAAiuB,OAAA,CAAY,IAAZ,CAAb,CACEU,CAAA,CAAO,IAAAE,SAAA,CAAcF,CAAd,CAAoB3uB,CAAA9kB,GAApB,CAA8B,IAAAg0C,WAAA,EAA9B,CADT,KAGE,OAAOP,EAPS,CA5OL,YAwPLO,QAAQ,EAAG,CACrB,IAAIP,EAAO,IAAAQ,SAAA,EAAX,CACInvB,CACJ,IAAKA,CAAL,CAAa,IAAAiuB,OAAA,CAAY,IAAZ,CAAb,CACEU,CAAA,CAAO,IAAAE,SAAA,CAAcF,CAAd,CAAoB3uB,CAAA9kB,GAApB,CAA8B,IAAAg0C,WAAA,EAA9B,CAET,OAAOP,EANc,CAxPN,UAiQPQ,QAAQ,EAAG,CACnB,IAAIR,EAAO,IAAAS,WAAA,EAAX,CACIpvB,CACJ,IAAKA,CAAL,CAAa,IAAAiuB,OAAA,CAAY,IAAZ,CAAiB,IAAjB,CAAsB,KAAtB,CAA4B,KAA5B,CAAb,CACEU,CAAA,CAAO,IAAAE,SAAA,CAAcF,CAAd,CAAoB3uB,CAAA9kB,GAApB,CAA8B,IAAAi0C,SAAA,EAA9B,CAET,OAAOR,EANY,CAjQJ;WA0QLS,QAAQ,EAAG,CACrB,IAAIT,EAAO,IAAAU,SAAA,EAAX,CACIrvB,CACJ,IAAKA,CAAL,CAAa,IAAAiuB,OAAA,CAAY,GAAZ,CAAiB,GAAjB,CAAsB,IAAtB,CAA4B,IAA5B,CAAb,CACEU,CAAA,CAAO,IAAAE,SAAA,CAAcF,CAAd,CAAoB3uB,CAAA9kB,GAApB,CAA8B,IAAAk0C,WAAA,EAA9B,CAET,OAAOT,EANc,CA1QN,UAmRPU,QAAQ,EAAG,CAGnB,IAFA,IAAIV,EAAO,IAAAW,eAAA,EAAX,CACItvB,CACJ,CAAQA,CAAR,CAAgB,IAAAiuB,OAAA,CAAY,GAAZ,CAAgB,GAAhB,CAAhB,CAAA,CACEU,CAAA,CAAO,IAAAE,SAAA,CAAcF,CAAd,CAAoB3uB,CAAA9kB,GAApB,CAA8B,IAAAo0C,eAAA,EAA9B,CAET,OAAOX,EANY,CAnRJ,gBA4RDW,QAAQ,EAAG,CAGzB,IAFA,IAAIX,EAAO,IAAAY,MAAA,EAAX,CACIvvB,CACJ,CAAQA,CAAR,CAAgB,IAAAiuB,OAAA,CAAY,GAAZ,CAAgB,GAAhB,CAAoB,GAApB,CAAhB,CAAA,CACEU,CAAA,CAAO,IAAAE,SAAA,CAAcF,CAAd,CAAoB3uB,CAAA9kB,GAApB,CAA8B,IAAAq0C,MAAA,EAA9B,CAET,OAAOZ,EANkB,CA5RV,OAqSVY,QAAQ,EAAG,CAChB,IAAIvvB,CACJ,OAAI,KAAAiuB,OAAA,CAAY,GAAZ,CAAJ,CACS,IAAAF,QAAA,EADT,CAEO,CAAK/tB,CAAL,CAAa,IAAAiuB,OAAA,CAAY,GAAZ,CAAb,EACE,IAAAY,SAAA,CAAc3c,EAAAob,KAAd,CAA2BttB,CAAA9kB,GAA3B;AAAqC,IAAAq0C,MAAA,EAArC,CADF,CAEA,CAAKvvB,CAAL,CAAa,IAAAiuB,OAAA,CAAY,GAAZ,CAAb,EACE,IAAAO,QAAA,CAAaxuB,CAAA9kB,GAAb,CAAuB,IAAAq0C,MAAA,EAAvB,CADF,CAGE,IAAAxB,QAAA,EATO,CArSD,aAkTJJ,QAAQ,CAACzM,CAAD,CAAS,CAC5B,IAAIjP,EAAS,IAAb,CACIud,EAAQ,IAAAvB,OAAA,EAAAjwB,KADZ,CAEIvd,EAASswB,EAAA,CAASye,CAAT,CAAgB,IAAA1+B,QAAhB,CAA8B,IAAAkN,KAA9B,CAEb,OAAOvmB,EAAA,CAAO,QAAQ,CAACuH,CAAD,CAAQmL,CAAR,CAAgBlP,CAAhB,CAAsB,CAC1C,MAAOwF,EAAA,CAAOxF,CAAP,EAAeimC,CAAA,CAAOliC,CAAP,CAAcmL,CAAd,CAAf,CAAsCA,CAAtC,CADmC,CAArC,CAEJ,QACOkQ,QAAQ,CAACrb,CAAD,CAAQpI,CAAR,CAAeuT,CAAf,CAAuB,CACrC,MAAO4lB,GAAA,CAAOmR,CAAA,CAAOliC,CAAP,CAAcmL,CAAd,CAAP,CAA8BqlC,CAA9B,CAAqC54C,CAArC,CAA4Cq7B,CAAAjU,KAA5C,CAAyDiU,CAAAnhB,QAAzD,CAD8B,CADtC,CAFI,CALqB,CAlTb,aAgUJ88B,QAAQ,CAACr4C,CAAD,CAAM,CACzB,IAAI08B,EAAS,IAAb,CAEIwd,EAAU,IAAA1uB,WAAA,EACd,KAAAmtB,QAAA,CAAa,GAAb,CAEA,OAAOz2C,EAAA,CAAO,QAAQ,CAACwD,CAAD,CAAOkP,CAAP,CAAe,CAAA,IAC/BulC,EAAIn6C,CAAA,CAAI0F,CAAJ,CAAUkP,CAAV,CAD2B,CAE/B1T,EAAIg5C,CAAA,CAAQx0C,CAAR,CAAckP,CAAd,CAF2B,CAG5BkH,CAEP,IAAI,CAACq+B,CAAL,CAAQ,MAAOt6C,EAEf,EADA6G,CACA,CADI6zB,EAAA,CAAiB4f,CAAA,CAAEj5C,CAAF,CAAjB,CAAuBw7B,CAAAjU,KAAvB,CACJ,IAAS/hB,CAAAooB,KAAT,EAAmB4N,CAAAnhB,QAAAqf,eAAnB,IACE9e,CAKA,CALIpV,CAKJ,CAJM,KAIN,EAJeA,EAIf,GAHEoV,CAAAgf,IACA,CADQj7B,CACR;AAAAic,CAAAgT,KAAA,CAAO,QAAQ,CAAC7oB,CAAD,CAAM,CAAE6V,CAAAgf,IAAA,CAAQ70B,CAAV,CAArB,CAEF,EAAAS,CAAA,CAAIA,CAAAo0B,IANN,CAQA,OAAOp0B,EAf4B,CAA9B,CAgBJ,QACOoe,QAAQ,CAACpf,CAAD,CAAOrE,CAAP,CAAcuT,CAAd,CAAsB,CACpC,IAAInU,EAAMy5C,CAAA,CAAQx0C,CAAR,CAAckP,CAAd,CAGV,OADW2lB,GAAA6f,CAAiBp6C,CAAA,CAAI0F,CAAJ,CAAUkP,CAAV,CAAjBwlC,CAAoC1d,CAAAjU,KAApC2xB,CACJ,CAAK35C,CAAL,CAAP,CAAmBY,CAJiB,CADrC,CAhBI,CANkB,CAhUV,cAgWH82C,QAAQ,CAACxyC,CAAD,CAAK00C,CAAL,CAAoB,CACxC,IAAIb,EAAS,EACb,IAA8B,GAA9B,GAAI,IAAAV,UAAA,EAAArwB,KAAJ,EACE,EACE+wB,EAAAz4C,KAAA,CAAY,IAAAyqB,WAAA,EAAZ,CADF,OAES,IAAAktB,OAAA,CAAY,GAAZ,CAFT,CADF,CAKA,IAAAC,QAAA,CAAa,GAAb,CAEA,KAAIjc,EAAS,IAEb,OAAO,SAAQ,CAACjzB,CAAD,CAAQmL,CAAR,CAAgB,CAI7B,IAHA,IAAIC,EAAO,EAAX,CACIrU,EAAU65C,CAAA,CAAgBA,CAAA,CAAc5wC,CAAd,CAAqBmL,CAArB,CAAhB,CAA+CnL,CAD7D,CAGSvI,EAAI,CAAb,CAAgBA,CAAhB,CAAoBs4C,CAAAt5C,OAApB,CAAmCgB,CAAA,EAAnC,CACE2T,CAAA9T,KAAA,CAAUy4C,CAAA,CAAOt4C,CAAP,CAAA,CAAUuI,CAAV,CAAiBmL,CAAjB,CAAV,CAEE0lC,EAAAA,CAAQ30C,CAAA,CAAG8D,CAAH,CAAUmL,CAAV,CAAkBpU,CAAlB,CAAR85C,EAAsC33C,CAE1C43B,GAAA,CAAiB+f,CAAjB,CAAwB5d,CAAAjU,KAAxB,CAGI/hB,EAAAA,CAAI4zC,CAAAj3C,MACA,CAAAi3C,CAAAj3C,MAAA,CAAY7C,CAAZ,CAAqBqU,CAArB,CAAA,CACAylC,CAAA,CAAMzlC,CAAA,CAAK,CAAL,CAAN,CAAeA,CAAA,CAAK,CAAL,CAAf,CAAwBA,CAAA,CAAK,CAAL,CAAxB,CAAiCA,CAAA,CAAK,CAAL,CAAjC,CAA0CA,CAAA,CAAK,CAAL,CAA1C,CAER,OAAO0lB,GAAA,CAAiB7zB,CAAjB,CAAoBg2B,CAAAjU,KAApB,CAhBsB,CAXS,CAhWzB,kBAgYCmwB,QAAS,EAAG,CAC5B,IAAI2B,EAAa,EAAjB,CACIC,EAAc,CAAA,CAClB,IAA8B,GAA9B;AAAI,IAAA1B,UAAA,EAAArwB,KAAJ,EACE,EAAG,CACD,IAAIgyB,EAAY,IAAAjvB,WAAA,EAChB+uB,EAAAx5C,KAAA,CAAgB05C,CAAhB,CACKA,EAAAnlC,SAAL,GACEklC,CADF,CACgB,CAAA,CADhB,CAHC,CAAH,MAMS,IAAA9B,OAAA,CAAY,GAAZ,CANT,CADF,CASA,IAAAC,QAAA,CAAa,GAAb,CAEA,OAAOz2C,EAAA,CAAO,QAAQ,CAACwD,CAAD,CAAOkP,CAAP,CAAe,CAEnC,IADA,IAAIzQ,EAAQ,EAAZ,CACSjD,EAAI,CAAb,CAAgBA,CAAhB,CAAoBq5C,CAAAr6C,OAApB,CAAuCgB,CAAA,EAAvC,CACEiD,CAAApD,KAAA,CAAWw5C,CAAA,CAAWr5C,CAAX,CAAA,CAAcwE,CAAd,CAAoBkP,CAApB,CAAX,CAEF,OAAOzQ,EAL4B,CAA9B,CAMJ,SACQ,CAAA,CADR,UAESq2C,CAFT,CANI,CAdqB,CAhYb,QA0ZT7O,QAAS,EAAG,CAClB,IAAI+O,EAAY,EAAhB,CACIF,EAAc,CAAA,CAClB,IAA8B,GAA9B,GAAI,IAAA1B,UAAA,EAAArwB,KAAJ,EACE,EAAG,CAAA,IACGgC,EAAQ,IAAAiuB,OAAA,EADX,CAEDj4C,EAAMgqB,CAAA+f,OAAN/pC,EAAsBgqB,CAAAhC,KACtB,KAAAkwB,QAAA,CAAa,GAAb,CACA,KAAIt3C,EAAQ,IAAAmqB,WAAA,EACZkvB,EAAA35C,KAAA,CAAe,KAAMN,CAAN,OAAkBY,CAAlB,CAAf,CACKA,EAAAiU,SAAL,GACEklC,CADF,CACgB,CAAA,CADhB,CANC,CAAH,MASS,IAAA9B,OAAA,CAAY,GAAZ,CATT,CADF,CAYA,IAAAC,QAAA,CAAa,GAAb,CAEA,OAAOz2C,EAAA,CAAO,QAAQ,CAACwD,CAAD,CAAOkP,CAAP,CAAe,CAEnC,IADA,IAAI+2B,EAAS,EAAb,CACSzqC;AAAI,CAAb,CAAgBA,CAAhB,CAAoBw5C,CAAAx6C,OAApB,CAAsCgB,CAAA,EAAtC,CAA2C,CACzC,IAAIwG,EAAWgzC,CAAA,CAAUx5C,CAAV,CACfyqC,EAAA,CAAOjkC,CAAAjH,IAAP,CAAA,CAAuBiH,CAAArG,MAAA,CAAeqE,CAAf,CAAqBkP,CAArB,CAFkB,CAI3C,MAAO+2B,EAN4B,CAA9B,CAOJ,SACQ,CAAA,CADR,UAES6O,CAFT,CAPI,CAjBW,CA1ZH,CA6dnB,KAAI/e,GAAgB,EAApB,CA2zDI4G,GAAaviC,CAAA,CAAO,MAAP,CA3zDjB,CA6zDI4iC,GAAe,MACX,MADW,KAEZ,KAFY,KAGZ,KAHY,cAMH,aANG,IAOb,IAPa,CA7zDnB,CAkmGI2D,EAAiBzmC,CAAAwO,cAAA,CAAuB,GAAvB,CAlmGrB,CAmmGIo4B,GAAY1b,EAAA,CAAWnrB,CAAA4D,SAAA4V,KAAX,CAAiC,CAAA,CAAjC,CAgNhButB,GAAAl0B,QAAA,CAA0B,CAAC,UAAD,CAuS1Bq0B,GAAAr0B,QAAA,CAAyB,CAAC,SAAD,CA2DzB20B,GAAA30B,QAAA,CAAuB,CAAC,SAAD,CASvB,KAAI41B,GAAc,GAAlB,CA2HIsD,GAAe,MACXvB,CAAA,CAAW,UAAX,CAAuB,CAAvB,CADW,IAEXA,CAAA,CAAW,UAAX,CAAuB,CAAvB,CAA0B,CAA1B,CAA6B,CAAA,CAA7B,CAFW,GAGXA,CAAA,CAAW,UAAX,CAAuB,CAAvB,CAHW,MAIXE,EAAA,CAAc,OAAd,CAJW,KAKXA,EAAA,CAAc,OAAd,CAAuB,CAAA,CAAvB,CALW,IAMXF,CAAA,CAAW,OAAX,CAAoB,CAApB,CAAuB,CAAvB,CANW,GAOXA,CAAA,CAAW,OAAX,CAAoB,CAApB,CAAuB,CAAvB,CAPW,IAQXA,CAAA,CAAW,MAAX,CAAmB,CAAnB,CARW,GASXA,CAAA,CAAW,MAAX,CAAmB,CAAnB,CATW,IAUXA,CAAA,CAAW,OAAX,CAAoB,CAApB,CAVW,GAWXA,CAAA,CAAW,OAAX;AAAoB,CAApB,CAXW,IAYXA,CAAA,CAAW,OAAX,CAAoB,CAApB,CAAwB,GAAxB,CAZW,GAaXA,CAAA,CAAW,OAAX,CAAoB,CAApB,CAAwB,GAAxB,CAbW,IAcXA,CAAA,CAAW,SAAX,CAAsB,CAAtB,CAdW,GAeXA,CAAA,CAAW,SAAX,CAAsB,CAAtB,CAfW,IAgBXA,CAAA,CAAW,SAAX,CAAsB,CAAtB,CAhBW,GAiBXA,CAAA,CAAW,SAAX,CAAsB,CAAtB,CAjBW,KAoBXA,CAAA,CAAW,cAAX,CAA2B,CAA3B,CApBW,MAqBXE,EAAA,CAAc,KAAd,CArBW,KAsBXA,EAAA,CAAc,KAAd,CAAqB,CAAA,CAArB,CAtBW,GAJnBsQ,QAAmB,CAACvQ,CAAD,CAAOxC,CAAP,CAAgB,CACjC,MAAyB,GAAlB,CAAAwC,CAAAwQ,SAAA,EAAA,CAAuBhT,CAAAiT,MAAA,CAAc,CAAd,CAAvB,CAA0CjT,CAAAiT,MAAA,CAAc,CAAd,CADhB,CAIhB,GAdnBC,QAAuB,CAAC1Q,CAAD,CAAO,CACxB2Q,CAAAA,CAAQ,EAARA,CAAY3Q,CAAA4Q,kBAAA,EAMhB,OAHAC,EAGA,EAL0B,CAATA,EAACF,CAADE,CAAc,GAAdA,CAAoB,EAKrC,GAHcjR,EAAA,CAAUvjB,IAAA,CAAY,CAAP,CAAAs0B,CAAA,CAAW,OAAX,CAAqB,MAA1B,CAAA,CAAkCA,CAAlC,CAAyC,EAAzC,CAAV,CAAwD,CAAxD,CAGd,CAFc/Q,EAAA,CAAUvjB,IAAAmiB,IAAA,CAASmS,CAAT,CAAgB,EAAhB,CAAV,CAA+B,CAA/B,CAEd,CAP4B,CAcX,CA3HnB,CAsJItP,GAAqB,8EAtJzB,CAuJID,GAAgB,UAmFpB1E,GAAAt0B,QAAA,CAAqB,CAAC,SAAD,CAuHrB,KAAI00B,GAAkBpkC,EAAA,CAAQ6D,CAAR,CAAtB,CAWI0gC,GAAkBvkC,EAAA,CAAQsrB,EAAR,CA+LtBgZ,GAAA50B,QAAA;AAAwB,CAAC,QAAD,CA2ExB,KAAI0oC,GAAsBp4C,EAAA,CAAQ,UACtB,GADsB,SAEvB4G,QAAQ,CAAC7C,CAAD,CAAUoC,CAAV,CAAgB,CAEnB,CAAZ,EAAIgJ,CAAJ,GAIOhJ,CAAAkQ,KAQL,EARmBlQ,CAAAN,KAQnB,EAPEM,CAAA+d,KAAA,CAAU,MAAV,CAAkB,EAAlB,CAOF,CAAAngB,CAAAM,OAAA,CAAevH,CAAAomB,cAAA,CAAuB,QAAvB,CAAf,CAZF,CAeA,OAAO,SAAQ,CAACvc,CAAD,CAAQ5C,CAAR,CAAiB,CAC9BA,CAAAhD,GAAA,CAAW,OAAX,CAAoB,QAAQ,CAACuN,CAAD,CAAO,CAE5BvK,CAAAoC,KAAA,CAAa,MAAb,CAAL,EACEmI,CAAAC,eAAA,EAH+B,CAAnC,CAD8B,CAjBD,CAFD,CAAR,CAA1B,CA2UI8pC,GAA6B,EAIjC76C,EAAA,CAAQ2Q,EAAR,CAAsB,QAAQ,CAACmqC,CAAD,CAAW/2B,CAAX,CAAqB,CAEjD,GAAgB,UAAhB,EAAI+2B,CAAJ,CAAA,CAEA,IAAIC,EAAah6B,EAAA,CAAmB,KAAnB,CAA2BgD,CAA3B,CACjB82B,GAAA,CAA2BE,CAA3B,CAAA,CAAyC,QAAQ,EAAG,CAClD,MAAO,UACK,GADL,SAEI3xC,QAAQ,EAAG,CAClB,MAAO,SAAQ,CAACD,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CACpCQ,CAAA/E,OAAA,CAAauE,CAAA,CAAKoyC,CAAL,CAAb,CAA+BC,QAAiC,CAACj6C,CAAD,CAAQ,CACtE4H,CAAA+d,KAAA,CAAU3C,CAAV,CAAoB,CAAC,CAAChjB,CAAtB,CADsE,CAAxE,CADoC,CADpB,CAFf,CAD2C,CAHpD,CAFiD,CAAnD,CAqBAf,EAAA,CAAQ,CAAC,KAAD,CAAQ,QAAR,CAAkB,MAAlB,CAAR,CAAmC,QAAQ,CAAC+jB,CAAD,CAAW,CACpD,IAAIg3B,EAAah6B,EAAA,CAAmB,KAAnB,CAA2BgD,CAA3B,CACjB82B,GAAA,CAA2BE,CAA3B,CAAA,CAAyC,QAAQ,EAAG,CAClD,MAAO,UACK,EADL;KAECx/B,QAAQ,CAACpS,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CACnCA,CAAA0b,SAAA,CAAc02B,CAAd,CAA0B,QAAQ,CAACh6C,CAAD,CAAQ,CACnCA,CAAL,GAGA4H,CAAA+d,KAAA,CAAU3C,CAAV,CAAoBhjB,CAApB,CAMA,CAAI4Q,CAAJ,EAAUpL,CAAA+jB,KAAA,CAAavG,CAAb,CAAuBpb,CAAA,CAAKob,CAAL,CAAvB,CATV,CADwC,CAA1C,CADmC,CAFhC,CAD2C,CAFA,CAAtD,CAuBA,KAAI6oB,GAAe,aACJvqC,CADI,gBAEDA,CAFC,cAGHA,CAHG,WAINA,CAJM,cAKHA,CALG,CAgCnB+pC,GAAAl6B,QAAA,CAAyB,CAAC,UAAD,CAAa,QAAb,CAAuB,QAAvB,CAiRzB,KAAI+oC,GAAuBA,QAAQ,CAACC,CAAD,CAAW,CAC5C,MAAO,CAAC,UAAD,CAAa,QAAQ,CAAC7H,CAAD,CAAW,CAoDrC,MAnDoB8H,MACZ,MADYA,UAERD,CAAA,CAAW,KAAX,CAAmB,GAFXC,YAGN/O,EAHM+O,SAIT/xC,QAAQ,EAAG,CAClB,MAAO,KACA4Z,QAAQ,CAAC7Z,CAAD,CAAQiyC,CAAR,CAAqBzyC,CAArB,CAA2BgV,CAA3B,CAAuC,CAClD,GAAI,CAAChV,CAAA0yC,OAAL,CAAkB,CAOhB,IAAIC,EAAyBA,QAAQ,CAACxqC,CAAD,CAAQ,CAC3CA,CAAAC,eACA,CAAID,CAAAC,eAAA,EAAJ,CACID,CAAAG,YADJ,CACwB,CAAA,CAHmB,CAM7Cm/B,GAAA,CAAmBgL,CAAA,CAAY,CAAZ,CAAnB,CAAmC,QAAnC,CAA6CE,CAA7C,CAIAF,EAAA73C,GAAA,CAAe,UAAf,CAA2B,QAAQ,EAAG,CACpC8vC,CAAA,CAAS,QAAQ,EAAG,CAClBpkC,EAAA,CAAsBmsC,CAAA,CAAY,CAAZ,CAAtB;AAAsC,QAAtC,CAAgDE,CAAhD,CADkB,CAApB,CAEG,CAFH,CAEM,CAAA,CAFN,CADoC,CAAtC,CAjBgB,CADgC,IAyB9CC,EAAiBH,CAAAj5C,OAAA,EAAAwb,WAAA,CAAgC,MAAhC,CAzB6B,CA0B9C69B,EAAQ7yC,CAAAN,KAARmzC,EAAqB7yC,CAAAukC,OAErBsO,EAAJ,EACEthB,EAAA,CAAO/wB,CAAP,CAAcqyC,CAAd,CAAqB79B,CAArB,CAAiC69B,CAAjC,CAEF,IAAID,CAAJ,CACEH,CAAA73C,GAAA,CAAe,UAAf,CAA2B,QAAQ,EAAG,CACpCg4C,CAAA5N,eAAA,CAA8BhwB,CAA9B,CACI69B,EAAJ,EACEthB,EAAA,CAAO/wB,CAAP,CAAcqyC,CAAd,CAAqBj8C,CAArB,CAAgCi8C,CAAhC,CAEF55C,EAAA,CAAO+b,CAAP,CAAmBivB,EAAnB,CALoC,CAAtC,CAhCgD,CAD/C,CADW,CAJFuO,CADiB,CAAhC,CADqC,CAA9C,CAyDIA,GAAgBF,EAAA,EAzDpB,CA0DIQ,GAAkBR,EAAA,CAAqB,CAAA,CAArB,CA1DtB,CA4DIS,GAAa,qFA5DjB,CA6DIC,GAAe,mDA7DnB,CA8DIC,GAAgB,oCA9DpB,CAgEIC,GAAY,MA4ENvN,EA5EM,QAigBhBwN,QAAwB,CAAC3yC,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B13B,CAA7B,CAAuC8V,CAAvC,CAAiD,CACvE2hB,EAAA,CAAcnlC,CAAd,CAAqB5C,CAArB,CAA8BoC,CAA9B,CAAoC4lC,CAApC,CAA0C13B,CAA1C,CAAoD8V,CAApD,CAEA4hB,EAAAc,SAAA5uC,KAAA,CAAmB,QAAQ,CAACM,CAAD,CAAQ,CACjC,IAAI0gC,EAAQ8M,CAAAQ,SAAA,CAAchuC,CAAd,CACZ,IAAI0gC,CAAJ,EAAama,EAAAlyC,KAAA,CAAmB3I,CAAnB,CAAb,CAEE,MADAwtC,EAAAR,aAAA,CAAkB,QAAlB;AAA4B,CAAA,CAA5B,CACO,CAAU,EAAV,GAAAhtC,CAAA,CAAe,IAAf,CAAuB0gC,CAAA,CAAQ1gC,CAAR,CAAgBgqC,UAAA,CAAWhqC,CAAX,CAE9CwtC,EAAAR,aAAA,CAAkB,QAAlB,CAA4B,CAAA,CAA5B,CACA,OAAOxuC,EAPwB,CAAnC,CAWAgvC,EAAAa,YAAA3uC,KAAA,CAAsB,QAAQ,CAACM,CAAD,CAAQ,CACpC,MAAOwtC,EAAAQ,SAAA,CAAchuC,CAAd,CAAA,CAAuB,EAAvB,CAA4B,EAA5B,CAAiCA,CADJ,CAAtC,CAIA,IAAI4H,CAAAigC,IAAJ,CAAc,CACZ,IAAIA,EAAMmC,UAAA,CAAWpiC,CAAAigC,IAAX,CACNmT,EAAAA,CAAeA,QAAQ,CAACh7C,CAAD,CAAQ,CACjC,GAAI,CAACwtC,CAAAQ,SAAA,CAAchuC,CAAd,CAAL,EAA6BA,CAA7B,CAAqC6nC,CAArC,CAEE,MADA2F,EAAAR,aAAA,CAAkB,KAAlB,CAAyB,CAAA,CAAzB,CACOxuC,CAAAA,CAEPgvC,EAAAR,aAAA,CAAkB,KAAlB,CAAyB,CAAA,CAAzB,CACA,OAAOhtC,EANwB,CAUnCwtC,EAAAc,SAAA5uC,KAAA,CAAmBs7C,CAAnB,CACAxN,EAAAa,YAAA3uC,KAAA,CAAsBs7C,CAAtB,CAbY,CAgBd,GAAIpzC,CAAAyd,IAAJ,CAAc,CACZ,IAAIA,EAAM2kB,UAAA,CAAWpiC,CAAAyd,IAAX,CACN41B,EAAAA,CAAeA,QAAQ,CAACj7C,CAAD,CAAQ,CACjC,GAAI,CAACwtC,CAAAQ,SAAA,CAAchuC,CAAd,CAAL,EAA6BA,CAA7B,CAAqCqlB,CAArC,CAEE,MADAmoB,EAAAR,aAAA,CAAkB,KAAlB,CAAyB,CAAA,CAAzB,CACOxuC,CAAAA,CAEPgvC,EAAAR,aAAA,CAAkB,KAAlB,CAAyB,CAAA,CAAzB,CACA,OAAOhtC,EANwB,CAUnCwtC,EAAAc,SAAA5uC,KAAA,CAAmBu7C,CAAnB,CACAzN,EAAAa,YAAA3uC,KAAA,CAAsBu7C,CAAtB,CAbY,CAgBdzN,CAAAa,YAAA3uC,KAAA,CAAsB,QAAQ,CAACM,CAAD,CAAQ,CAEpC,GAAIwtC,CAAAQ,SAAA,CAAchuC,CAAd,CAAJ;AAA4B6B,EAAA,CAAS7B,CAAT,CAA5B,CAEE,MADAwtC,EAAAR,aAAA,CAAkB,QAAlB,CAA4B,CAAA,CAA5B,CACOhtC,CAAAA,CAEPwtC,EAAAR,aAAA,CAAkB,QAAlB,CAA4B,CAAA,CAA5B,CACA,OAAOxuC,EAP2B,CAAtC,CAlDuE,CAjgBzD,KA+jBhB08C,QAAqB,CAAC9yC,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B13B,CAA7B,CAAuC8V,CAAvC,CAAiD,CACpE2hB,EAAA,CAAcnlC,CAAd,CAAqB5C,CAArB,CAA8BoC,CAA9B,CAAoC4lC,CAApC,CAA0C13B,CAA1C,CAAoD8V,CAApD,CAEIuvB,EAAAA,CAAeA,QAAQ,CAACn7C,CAAD,CAAQ,CACjC,GAAIwtC,CAAAQ,SAAA,CAAchuC,CAAd,CAAJ,EAA4B26C,EAAAhyC,KAAA,CAAgB3I,CAAhB,CAA5B,CAEE,MADAwtC,EAAAR,aAAA,CAAkB,KAAlB,CAAyB,CAAA,CAAzB,CACOhtC,CAAAA,CAEPwtC,EAAAR,aAAA,CAAkB,KAAlB,CAAyB,CAAA,CAAzB,CACA,OAAOxuC,EANwB,CAUnCgvC,EAAAa,YAAA3uC,KAAA,CAAsBy7C,CAAtB,CACA3N,EAAAc,SAAA5uC,KAAA,CAAmBy7C,CAAnB,CAdoE,CA/jBtD,OAglBhBC,QAAuB,CAAChzC,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B13B,CAA7B,CAAuC8V,CAAvC,CAAiD,CACtE2hB,EAAA,CAAcnlC,CAAd,CAAqB5C,CAArB,CAA8BoC,CAA9B,CAAoC4lC,CAApC,CAA0C13B,CAA1C,CAAoD8V,CAApD,CAEIyvB,EAAAA,CAAiBA,QAAQ,CAACr7C,CAAD,CAAQ,CACnC,GAAIwtC,CAAAQ,SAAA,CAAchuC,CAAd,CAAJ,EAA4B46C,EAAAjyC,KAAA,CAAkB3I,CAAlB,CAA5B,CAEE,MADAwtC,EAAAR,aAAA,CAAkB,OAAlB,CAA2B,CAAA,CAA3B,CACOhtC,CAAAA,CAEPwtC,EAAAR,aAAA,CAAkB,OAAlB,CAA2B,CAAA,CAA3B,CACA,OAAOxuC,EAN0B,CAUrCgvC,EAAAa,YAAA3uC,KAAA,CAAsB27C,CAAtB,CACA7N,EAAAc,SAAA5uC,KAAA,CAAmB27C,CAAnB,CAdsE,CAhlBxD,OAimBhBC,QAAuB,CAAClzC,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB;AAAuB4lC,CAAvB,CAA6B,CAE9C9rC,CAAA,CAAYkG,CAAAN,KAAZ,CAAJ,EACE9B,CAAAoC,KAAA,CAAa,MAAb,CAAqB3H,EAAA,EAArB,CAGFuF,EAAAhD,GAAA,CAAW,OAAX,CAAoB,QAAQ,EAAG,CACzBgD,CAAA,CAAQ,CAAR,CAAA+1C,QAAJ,EACEnzC,CAAAG,OAAA,CAAa,QAAQ,EAAG,CACtBilC,CAAAG,cAAA,CAAmB/lC,CAAA5H,MAAnB,CADsB,CAAxB,CAF2B,CAA/B,CAQAwtC,EAAAM,QAAA,CAAeC,QAAQ,EAAG,CAExBvoC,CAAA,CAAQ,CAAR,CAAA+1C,QAAA,CADY3zC,CAAA5H,MACZ,EAA+BwtC,CAAAE,WAFP,CAK1B9lC,EAAA0b,SAAA,CAAc,OAAd,CAAuBkqB,CAAAM,QAAvB,CAnBkD,CAjmBpC,UAunBhB0N,QAA0B,CAACpzC,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B,CAAA,IACjDiO,EAAY7zC,CAAA8zC,YADqC,CAEjDC,EAAa/zC,CAAAg0C,aAEZ78C,EAAA,CAAS08C,CAAT,CAAL,GAA0BA,CAA1B,CAAsC,CAAA,CAAtC,CACK18C,EAAA,CAAS48C,CAAT,CAAL,GAA2BA,CAA3B,CAAwC,CAAA,CAAxC,CAEAn2C,EAAAhD,GAAA,CAAW,OAAX,CAAoB,QAAQ,EAAG,CAC7B4F,CAAAG,OAAA,CAAa,QAAQ,EAAG,CACtBilC,CAAAG,cAAA,CAAmBnoC,CAAA,CAAQ,CAAR,CAAA+1C,QAAnB,CADsB,CAAxB,CAD6B,CAA/B,CAMA/N,EAAAM,QAAA,CAAeC,QAAQ,EAAG,CACxBvoC,CAAA,CAAQ,CAAR,CAAA+1C,QAAA,CAAqB/N,CAAAE,WADG,CAK1BF,EAAAQ,SAAA,CAAgB6N,QAAQ,CAAC77C,CAAD,CAAQ,CAC9B,MAAOA,EAAP,GAAiBy7C,CADa,CAIhCjO,EAAAa,YAAA3uC,KAAA,CAAsB,QAAQ,CAACM,CAAD,CAAQ,CACpC,MAAOA,EAAP;AAAiBy7C,CADmB,CAAtC,CAIAjO,EAAAc,SAAA5uC,KAAA,CAAmB,QAAQ,CAACM,CAAD,CAAQ,CACjC,MAAOA,EAAA,CAAQy7C,CAAR,CAAoBE,CADM,CAAnC,CA1BqD,CAvnBvC,QAqXJr6C,CArXI,QAsXJA,CAtXI,QAuXJA,CAvXI,OAwXLA,CAxXK,CAhEhB,CAk1BIw6C,GAAiB,CAAC,UAAD,CAAa,UAAb,CAAyB,QAAQ,CAAClwB,CAAD,CAAW9V,CAAX,CAAqB,CACzE,MAAO,UACK,GADL,SAEI,UAFJ,MAGC0E,QAAQ,CAACpS,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B,CACrCA,CAAJ,EACG,CAAAsN,EAAA,CAAUx1C,CAAA,CAAUsC,CAAAgG,KAAV,CAAV,CAAA,EAAmCktC,EAAA1zB,KAAnC,EAAmDhf,CAAnD,CAA0D5C,CAA1D,CAAmEoC,CAAnE,CAAyE4lC,CAAzE,CAA+E13B,CAA/E,CACmD8V,CADnD,CAFsC,CAHtC,CADkE,CAAtD,CAl1BrB,CA+1BI8f,GAAc,UA/1BlB,CAg2BID,GAAgB,YAh2BpB,CAi2BIgB,GAAiB,aAj2BrB,CAk2BIW,GAAc,UAl2BlB,CA4/BI2O,GAAoB,CAAC,QAAD,CAAW,mBAAX,CAAgC,QAAhC,CAA0C,UAA1C,CAAsD,QAAtD,CACpB,QAAQ,CAACh4B,CAAD,CAASvH,CAAT,CAA4BsD,CAA5B,CAAmCvB,CAAnC,CAA6CnB,CAA7C,CAAqD,CA4D/DkuB,QAASA,EAAc,CAACC,CAAD,CAAUC,CAAV,CAA8B,CACnDA,CAAA,CAAqBA,CAAA,CAAqB,GAArB,CAA2BxiC,EAAA,CAAWwiC,CAAX,CAA+B,GAA/B,CAA3B,CAAiE,EACtFjtB,EAAAqK,YAAA,EACe2iB,CAAA,CAAUE,EAAV,CAA0BC,EADzC,EACwDF,CADxD,CAAAhtB,SAAA,EAEY+sB,CAAA,CAAUG,EAAV,CAAwBD,EAFpC,EAEqDD,CAFrD,CAFmD,CA1DrD,IAAAwQ,YAAA,CADA,IAAAtO,WACA,CADkB1yB,MAAAihC,IAElB;IAAA3N,SAAA,CAAgB,EAChB,KAAAD,YAAA,CAAmB,EACnB,KAAA6N,qBAAA,CAA4B,EAC5B,KAAA7P,UAAA,CAAiB,CAAA,CACjB,KAAAD,OAAA,CAAc,CAAA,CACd,KAAAE,OAAA,CAAc,CAAA,CACd,KAAAC,SAAA,CAAgB,CAAA,CAChB,KAAAL,MAAA,CAAapsB,CAAAxY,KAVkD,KAY3D60C,EAAa/+B,CAAA,CAAO0C,CAAAs8B,QAAP,CAZ8C,CAa3DC,EAAaF,CAAA14B,OAEjB,IAAI,CAAC44B,CAAL,CACE,KAAM59C,EAAA,CAAO,SAAP,CAAA,CAAkB,WAAlB,CACFqhB,CAAAs8B,QADE,CACa72C,EAAA,CAAYgZ,CAAZ,CADb,CAAN,CAaF,IAAAuvB,QAAA,CAAexsC,CAiBf,KAAA0sC,SAAA,CAAgBsO,QAAQ,CAACt8C,CAAD,CAAQ,CAC9B,MAAO0B,EAAA,CAAY1B,CAAZ,CAAP,EAAuC,EAAvC,GAA6BA,CAA7B,EAAuD,IAAvD,GAA6CA,CAA7C,EAA+DA,CAA/D,GAAyEA,CAD3C,CA9C+B,KAkD3D4rC,EAAartB,CAAAg+B,cAAA,CAAuB,iBAAvB,CAAb3Q,EAA0DC,EAlDC,CAmD3DC,EAAe,CAnD4C,CAoD3DE,EAAS,IAAAA,OAATA,CAAuB,EAI3BztB,EAAAC,SAAA,CAAkBiuB,EAAlB,CACAnB,EAAA,CAAe,CAAA,CAAf,CA4BA,KAAA0B,aAAA,CAAoBwP,QAAQ,CAAChR,CAAD,CAAqBD,CAArB,CAA8B,CACpDS,CAAA,CAAOR,CAAP,CAAJ,GAAmC,CAACD,CAApC,GAEIA,CAAJ,EACMS,CAAA,CAAOR,CAAP,CACJ,EADgCM,CAAA,EAChC,CAAKA,CAAL,GACER,CAAA,CAAe,CAAA,CAAf,CAEA,CADA,IAAAgB,OACA,CADc,CAAA,CACd,CAAA,IAAAC,SAAA,CAAgB,CAAA,CAHlB,CAFF,GAQEjB,CAAA,CAAe,CAAA,CAAf,CAGA;AAFA,IAAAiB,SAEA,CAFgB,CAAA,CAEhB,CADA,IAAAD,OACA,CADc,CAAA,CACd,CAAAR,CAAA,EAXF,CAiBA,CAHAE,CAAA,CAAOR,CAAP,CAGA,CAH6B,CAACD,CAG9B,CAFAD,CAAA,CAAeC,CAAf,CAAwBC,CAAxB,CAEA,CAAAI,CAAAoB,aAAA,CAAwBxB,CAAxB,CAA4CD,CAA5C,CAAqD,IAArD,CAnBA,CADwD,CAkC1D,KAAA8B,aAAA,CAAoBoP,QAAS,EAAG,CAC9B,IAAArQ,OAAA,CAAc,CAAA,CACd,KAAAC,UAAA,CAAiB,CAAA,CACjB9tB,EAAAqK,YAAA,CAAqBwkB,EAArB,CAAA5uB,SAAA,CAA2CiuB,EAA3C,CAH8B,CAuBhC,KAAAkB,cAAA,CAAqB+O,QAAQ,CAAC18C,CAAD,CAAQ,CACnC,IAAA0tC,WAAA,CAAkB1tC,CAGd,KAAAqsC,UAAJ,GACE,IAAAD,OAGA,CAHc,CAAA,CAGd,CAFA,IAAAC,UAEA,CAFiB,CAAA,CAEjB,CADA9tB,CAAAqK,YAAA,CAAqB6jB,EAArB,CAAAjuB,SAAA,CAA8C4uB,EAA9C,CACA,CAAAxB,CAAAsB,UAAA,EAJF,CAOAjuC,EAAA,CAAQ,IAAAqvC,SAAR,CAAuB,QAAQ,CAAChqC,CAAD,CAAK,CAClCtE,CAAA,CAAQsE,CAAA,CAAGtE,CAAH,CAD0B,CAApC,CAII,KAAAg8C,YAAJ,GAAyBh8C,CAAzB,GACE,IAAAg8C,YAEA,CAFmBh8C,CAEnB,CADAq8C,CAAA,CAAWt4B,CAAX,CAAmB/jB,CAAnB,CACA,CAAAf,CAAA,CAAQ,IAAAi9C,qBAAR,CAAmC,QAAQ,CAACllC,CAAD,CAAW,CACpD,GAAI,CACFA,CAAA,EADE,CAEF,MAAMpR,CAAN,CAAS,CACT4W,CAAA,CAAkB5W,CAAlB,CADS,CAHyC,CAAtD,CAHF,CAfmC,CA6BrC,KAAI4nC,EAAO,IAEXzpB,EAAA1gB,OAAA,CAAcs5C,QAAqB,EAAG,CACpC,IAAI38C;AAAQm8C,CAAA,CAAWp4B,CAAX,CAGZ,IAAIypB,CAAAwO,YAAJ,GAAyBh8C,CAAzB,CAAgC,CAAA,IAE1B48C,EAAapP,CAAAa,YAFa,CAG1Bzf,EAAMguB,CAAA/9C,OAGV,KADA2uC,CAAAwO,YACA,CADmBh8C,CACnB,CAAM4uB,CAAA,EAAN,CAAA,CACE5uB,CAAA,CAAQ48C,CAAA,CAAWhuB,CAAX,CAAA,CAAgB5uB,CAAhB,CAGNwtC,EAAAE,WAAJ,GAAwB1tC,CAAxB,GACEwtC,CAAAE,WACA,CADkB1tC,CAClB,CAAAwtC,CAAAM,QAAA,EAFF,CAV8B,CAJI,CAAtC,CA7K+D,CADzC,CA5/BxB,CA0uCI+O,GAAmBA,QAAQ,EAAG,CAChC,MAAO,SACI,CAAC,SAAD,CAAY,QAAZ,CADJ,YAEOd,EAFP,MAGCvhC,QAAQ,CAACpS,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuBk1C,CAAvB,CAA8B,CAAA,IAGtCC,EAAYD,CAAA,CAAM,CAAN,CAH0B,CAItCE,EAAWF,CAAA,CAAM,CAAN,CAAXE,EAAuBnR,EAE3BmR,EAAAxQ,YAAA,CAAqBuQ,CAArB,CAEAv3C,EAAAhD,GAAA,CAAW,UAAX,CAAuB,QAAQ,EAAG,CAChCw6C,CAAApQ,eAAA,CAAwBmQ,CAAxB,CADgC,CAAlC,CAR0C,CAHvC,CADyB,CA1uClC,CA+yCIE,GAAoBx7C,EAAA,CAAQ,SACrB,SADqB,MAExB+Y,QAAQ,CAACpS,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B,CACzCA,CAAA0O,qBAAAx8C,KAAA,CAA+B,QAAQ,EAAG,CACxC0I,CAAA83B,MAAA,CAAYt4B,CAAAs1C,SAAZ,CADwC,CAA1C,CADyC,CAFb,CAAR,CA/yCxB,CAyzCIC,GAAoBA,QAAQ,EAAG,CACjC,MAAO,SACI,UADJ,MAEC3iC,QAAQ,CAACpS,CAAD,CAAQkN,CAAR,CAAa1N,CAAb,CAAmB4lC,CAAnB,CAAyB,CACrC,GAAKA,CAAL,CAAA,CACA5lC,CAAAw1C,SAAA;AAAgB,CAAA,CAEhB,KAAIC,EAAYA,QAAQ,CAACr9C,CAAD,CAAQ,CAC9B,GAAI4H,CAAAw1C,SAAJ,EAAqB5P,CAAAQ,SAAA,CAAchuC,CAAd,CAArB,CACEwtC,CAAAR,aAAA,CAAkB,UAAlB,CAA8B,CAAA,CAA9B,CADF,KAKE,OADAQ,EAAAR,aAAA,CAAkB,UAAlB,CAA8B,CAAA,CAA9B,CACOhtC,CAAAA,CANqB,CAUhCwtC,EAAAa,YAAA3uC,KAAA,CAAsB29C,CAAtB,CACA7P,EAAAc,SAAA7tC,QAAA,CAAsB48C,CAAtB,CAEAz1C,EAAA0b,SAAA,CAAc,UAAd,CAA0B,QAAQ,EAAG,CACnC+5B,CAAA,CAAU7P,CAAAE,WAAV,CADmC,CAArC,CAhBA,CADqC,CAFlC,CAD0B,CAzzCnC,CAq4CI4P,GAAkBA,QAAQ,EAAG,CAC/B,MAAO,SACI,SADJ,MAEC9iC,QAAQ,CAACpS,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B,CACzC,IACIvkC,GADAjD,CACAiD,CADQ,UAAAxB,KAAA,CAAgBG,CAAA21C,OAAhB,CACRt0C,GAAyBxF,MAAJ,CAAWuC,CAAA,CAAM,CAAN,CAAX,CAArBiD,EAA6CrB,CAAA21C,OAA7Ct0C,EAA4D,GAiBhEukC,EAAAc,SAAA5uC,KAAA,CAfYyF,QAAQ,CAACq4C,CAAD,CAAY,CAE9B,GAAI,CAAA97C,CAAA,CAAY87C,CAAZ,CAAJ,CAAA,CAEA,IAAI56C,EAAO,EAEP46C,EAAJ,EACEv+C,CAAA,CAAQu+C,CAAAj3C,MAAA,CAAgB0C,CAAhB,CAAR,CAAoC,QAAQ,CAACjJ,CAAD,CAAQ,CAC9CA,CAAJ,EAAW4C,CAAAlD,KAAA,CAAU0P,EAAA,CAAKpP,CAAL,CAAV,CADuC,CAApD,CAKF,OAAO4C,EAVP,CAF8B,CAehC,CACA4qC,EAAAa,YAAA3uC,KAAA,CAAsB,QAAQ,CAACM,CAAD,CAAQ,CACpC,MAAIhB,EAAA,CAAQgB,CAAR,CAAJ,CACSA,CAAAM,KAAA,CAAW,IAAX,CADT;AAIO9B,CAL6B,CAAtC,CASAgvC,EAAAQ,SAAA,CAAgB6N,QAAQ,CAAC77C,CAAD,CAAQ,CAC9B,MAAO,CAACA,CAAR,EAAiB,CAACA,CAAAnB,OADY,CA7BS,CAFtC,CADwB,CAr4CjC,CA66CI4+C,GAAwB,oBA76C5B,CAg+CIC,GAAmBA,QAAQ,EAAG,CAChC,MAAO,UACK,GADL,SAEIr1C,QAAQ,CAACs1C,CAAD,CAAMC,CAAN,CAAe,CAC9B,MAAIH,GAAA90C,KAAA,CAA2Bi1C,CAAAC,QAA3B,CAAJ,CACSC,QAA4B,CAAC11C,CAAD,CAAQkN,CAAR,CAAa1N,CAAb,CAAmB,CACpDA,CAAA+d,KAAA,CAAU,OAAV,CAAmBvd,CAAA83B,MAAA,CAAYt4B,CAAAi2C,QAAZ,CAAnB,CADoD,CADxD,CAKSE,QAAoB,CAAC31C,CAAD,CAAQkN,CAAR,CAAa1N,CAAb,CAAmB,CAC5CQ,CAAA/E,OAAA,CAAauE,CAAAi2C,QAAb,CAA2BG,QAAyB,CAACh+C,CAAD,CAAQ,CAC1D4H,CAAA+d,KAAA,CAAU,OAAV,CAAmB3lB,CAAnB,CAD0D,CAA5D,CAD4C,CANlB,CAF3B,CADyB,CAh+ClC,CAkiDIi+C,GAAkB7S,EAAA,CAAY,QAAQ,CAAChjC,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CAC/DpC,CAAAgZ,SAAA,CAAiB,YAAjB,CAAAhW,KAAA,CAAoC,UAApC,CAAgDZ,CAAAs2C,OAAhD,CACA91C,EAAA/E,OAAA,CAAauE,CAAAs2C,OAAb,CAA0BC,QAA0B,CAACn+C,CAAD,CAAQ,CAC1DwF,CAAA4hB,KAAA,CAAapnB,CAAA,EAASxB,CAAT,CAAqB,EAArB,CAA0BwB,CAAvC,CAD0D,CAA5D,CAF+D,CAA3C,CAliDtB,CA0lDIo+C,GAA0B,CAAC,cAAD,CAAiB,QAAQ,CAACnhC,CAAD,CAAe,CACpE,MAAO,SAAQ,CAAC7U,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CAEhCyf,CAAAA,CAAgBpK,CAAA,CAAazX,CAAAoC,KAAA,CAAaA,CAAAkY,MAAAu+B,eAAb,CAAb,CACpB74C,EAAAgZ,SAAA,CAAiB,YAAjB,CAAAhW,KAAA,CAAoC,UAApC;AAAgD6e,CAAhD,CACAzf,EAAA0b,SAAA,CAAc,gBAAd,CAAgC,QAAQ,CAACtjB,CAAD,CAAQ,CAC9CwF,CAAA4hB,KAAA,CAAapnB,CAAb,CAD8C,CAAhD,CAJoC,CAD8B,CAAxC,CA1lD9B,CAynDIs+C,GAAsB,CAAC,MAAD,CAAS,QAAT,CAAmB,QAAQ,CAAChhC,CAAD,CAAOF,CAAP,CAAe,CAClE,MAAO,SAAQ,CAAChV,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CACpCpC,CAAAgZ,SAAA,CAAiB,YAAjB,CAAAhW,KAAA,CAAoC,UAApC,CAAgDZ,CAAA22C,WAAhD,CAEA,KAAI7zB,EAAStN,CAAA,CAAOxV,CAAA22C,WAAP,CAGbn2C,EAAA/E,OAAA,CAFAm7C,QAAuB,EAAG,CAAE,MAAQz8C,CAAA2oB,CAAA,CAAOtiB,CAAP,CAAArG,EAAiB,EAAjBA,UAAA,EAAV,CAE1B,CAA6B08C,QAA8B,CAACz+C,CAAD,CAAQ,CACjEwF,CAAAG,KAAA,CAAa2X,CAAAohC,eAAA,CAAoBh0B,CAAA,CAAOtiB,CAAP,CAApB,CAAb,EAAmD,EAAnD,CADiE,CAAnE,CANoC,CAD4B,CAA1C,CAznD1B,CAo1DIu2C,GAAmB9P,EAAA,CAAe,EAAf,CAAmB,CAAA,CAAnB,CAp1DvB,CAo4DI+P,GAAsB/P,EAAA,CAAe,KAAf,CAAsB,CAAtB,CAp4D1B,CAo7DIgQ,GAAuBhQ,EAAA,CAAe,MAAf,CAAuB,CAAvB,CAp7D3B,CA6+DIiQ,GAAmB1T,EAAA,CAAY,SACxB/iC,QAAQ,CAAC7C,CAAD,CAAUoC,CAAV,CAAgB,CAC/BA,CAAA+d,KAAA,CAAU,SAAV,CAAqBnnB,CAArB,CACAgH,EAAAojB,YAAA,CAAoB,UAApB,CAF+B,CADA,CAAZ,CA7+DvB,CAqpEIm2B,GAAwB,CAAC,QAAQ,EAAG,CACtC,MAAO,OACE,CAAA,CADF,YAEO,GAFP,CAD+B,CAAZ,CArpE5B,CA6rEIC,GAAiB,CAAC,UAAD,CAAa,QAAQ,CAAClpC,CAAD,CAAW,CACnD,MAAO,UACK,GADL;QAEIzN,QAAQ,EAAG,CAClByN,CAAAykB,IAAA,CAAe,CAAA,CADG,CAFf,CAD4C,CAAhC,CA7rErB,CAyuEI0kB,GAAoB,EACxBhgD,EAAA,CACE,6IAAA,MAAA,CAAA,GAAA,CADF,CAEE,QAAQ,CAACqI,CAAD,CAAO,CACb,IAAIib,EAAgBvC,EAAA,CAAmB,KAAnB,CAA2B1Y,CAA3B,CACpB23C,GAAA,CAAkB18B,CAAlB,CAAA,CAAmC,CAAC,QAAD,CAAW,QAAQ,CAACnF,CAAD,CAAS,CAC7D,MAAO,SAAQ,CAAChV,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CACpC,IAAItD,EAAK8Y,CAAA,CAAOxV,CAAA,CAAK2a,CAAL,CAAP,CACT/c,EAAAhD,GAAA,CAAW8C,CAAA,CAAUgC,CAAV,CAAX,CAA4B,QAAQ,CAACyI,CAAD,CAAQ,CAC1C3H,CAAAG,OAAA,CAAa,QAAQ,EAAG,CACtBjE,CAAA,CAAG8D,CAAH,CAAU,QAAQ2H,CAAR,CAAV,CADsB,CAAxB,CAD0C,CAA5C,CAFoC,CADuB,CAA5B,CAFtB,CAFjB,CA8XA,KAAImvC,GAAgB,CAAC,UAAD,CAAa,QAAQ,CAAC3hC,CAAD,CAAW,CAClD,MAAO,YACO,SADP,UAEK,GAFL,UAGK,CAAA,CAHL,UAIK,GAJL,SAKIlV,QAAS,CAAC7C,CAAD,CAAUoC,CAAV,CAAgBuX,CAAhB,CAA4B,CAC5C,MAAO,SAAS,CAAC4E,CAAD,CAASxF,CAAT,CAAmBuB,CAAnB,CAA0B,CAAA,IACpCq/B,CADoC;AACtBtgC,CAClBkF,EAAA1gB,OAAA,CAAcyc,CAAAs/B,KAAd,CAA0BC,QAAwB,CAACr/C,CAAD,CAAQ,CACpDm/C,CAAJ,GACE5hC,CAAAm1B,MAAA,CAAeyM,CAAf,CACA,CAAAA,CAAA,CAAe3gD,CAFjB,CAIIqgB,EAAJ,GACEA,CAAAtQ,SAAA,EACA,CAAAsQ,CAAA,CAAargB,CAFf,CAII4G,GAAA,CAAUpF,CAAV,CAAJ,GACE6e,CACA,CADakF,CAAA7E,KAAA,EACb,CAAAC,CAAA,CAAWN,CAAX,CAAuB,QAAS,CAACnZ,CAAD,CAAQ,CACtCy5C,CAAA,CAAez5C,CACf6X,EAAAg1B,MAAA,CAAe7sC,CAAf,CAAsB6Y,CAAAnd,OAAA,EAAtB,CAAyCmd,CAAzC,CAFsC,CAAxC,CAFF,CATwD,CAA1D,CAFwC,CADE,CALzC,CAD2C,CAAhC,CAApB,CAoLI+gC,GAAqB,CAAC,OAAD,CAAU,gBAAV,CAA4B,eAA5B,CAA6C,UAA7C,CAAyD,UAAzD,CAAqE,MAArE,CACP,QAAQ,CAACpiC,CAAD,CAAUC,CAAV,CAA4BoiC,CAA5B,CAA6CC,CAA7C,CAAyDjiC,CAAzD,CAAqED,CAArE,CAA2E,CACnG,MAAO,UACK,KADL,UAEK,GAFL,UAGK,CAAA,CAHL,YAIO,SAJP,SAKIjV,QAAQ,CAAC7C,CAAD,CAAUoC,CAAV,CAAgB63C,CAAhB,CAA8B,CAAA,IACzCC,EAAS93C,CAAA+3C,UAATD,EAA2B93C,CAAAjE,IADc,CAEzCi8C,EAAYh4C,CAAA0oB,OAAZsvB,EAA2B,EAFc,CAGzCC,EAAgBj4C,CAAAk4C,WAEpB,OAAO,SAAQ,CAAC13C,CAAD,CAAQmW,CAAR,CAAkB,CAAA,IAC3BsZ,EAAgB,CADW,CAE3BgJ,CAF2B,CAG3Bkf,CAH2B,CAK3BC,EAA4BA,QAAQ,EAAG,CACrCnf,CAAJ,GACEA,CAAAtyB,SAAA,EACA,CAAAsyB,CAAA,CAAe,IAFjB,CAIGkf,EAAH,GACExiC,CAAAm1B,MAAA,CAAeqN,CAAf,CACA,CAAAA,CAAA,CAAiB,IAFnB,CALyC,CAW3C33C,EAAA/E,OAAA,CAAaia,CAAA2iC,mBAAA,CAAwBP,CAAxB,CAAb;AAA8CQ,QAA6B,CAACv8C,CAAD,CAAM,CAC/E,IAAIw8C,EAAe,EAAEtoB,CAEjBl0B,EAAJ,EACEuZ,CAAAzK,IAAA,CAAU9O,CAAV,CAAe,OAAQwZ,CAAR,CAAf,CAAAiJ,QAAA,CAAgD,QAAQ,CAACK,CAAD,CAAW,CACjE,GAAI05B,CAAJ,GAAqBtoB,CAArB,CAAA,CACA,IAAIuoB,EAAWh4C,CAAA8W,KAAA,EAEfugC,EAAA,CAAaW,CAAb,CAAuB,QAAQ,CAAC16C,CAAD,CAAQ,CACrCs6C,CAAA,EAEAnf,EAAA,CAAeuf,CACfL,EAAA,CAAiBr6C,CAEjBq6C,EAAAp6C,KAAA,CAAoB8gB,CAApB,CACAlJ,EAAAg1B,MAAA,CAAewN,CAAf,CAA+B,IAA/B,CAAqCxhC,CAArC,CACAihC,EAAA,CAASO,CAAAj7B,SAAA,EAAT,CAAA,CAAoC+b,CAApC,CAEI,EAAAl/B,CAAA,CAAUk+C,CAAV,CAAJ,EAAkCA,CAAlC,EAAmD,CAAAz3C,CAAA83B,MAAA,CAAY2f,CAAZ,CAAnD,EACEN,CAAA,EAGF1e,EAAAJ,MAAA,CAAmB,uBAAnB,CACAr4B,EAAA83B,MAAA,CAAY0f,CAAZ,CAfqC,CAAvC,CAHA,CADiE,CAAnE,CAAAzpC,MAAA,CAqBS,QAAQ,EAAG,CACdgqC,CAAJ,GAAqBtoB,CAArB,EAAoCmoB,CAAA,EADlB,CArBpB,CAwBA,CAAA53C,CAAAq4B,MAAA,CAAY,0BAAZ,CAzBF,EA2BEuf,CAAA,EA9B6E,CAAjF,CAhB+B,CALY,CAL1C,CAD4F,CAD5E,CApLzB,CAoSIK,GAAkBjV,EAAA,CAAY,SACvB/iC,QAAQ,EAAG,CAClB,MAAO,KACA4Z,QAAQ,CAAC7Z,CAAD,CAAQ5C,CAAR,CAAiB+Z,CAAjB,CAAwB,CACnCnX,CAAA83B,MAAA,CAAY3gB,CAAA+gC,OAAZ,CADmC,CADhC,CADW,CADY,CAAZ,CApStB,CA+UIC,GAAyBnV,EAAA,CAAY,UAAY,CAAA,CAAZ,UAA4B,GAA5B,CAAZ,CA/U7B,CAyfIoV,GAAuB,CAAC,SAAD,CAAY,cAAZ,CAA4B,QAAQ,CAACla,CAAD,CAAUrpB,CAAV,CAAwB,CACrF,IAAIwjC,EAAQ,KACZ,OAAO,UACK,IADL;KAECjmC,QAAQ,CAACpS,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CAAA,IAC/B84C,EAAY94C,CAAA6qB,MADmB,CAE/BkuB,EAAU/4C,CAAAkY,MAAA6N,KAAVgzB,EAA6Bn7C,CAAAoC,KAAA,CAAaA,CAAAkY,MAAA6N,KAAb,CAFE,CAG/BriB,EAAS1D,CAAA0D,OAATA,EAAwB,CAHO,CAI/Bs1C,EAAQx4C,CAAA83B,MAAA,CAAYygB,CAAZ,CAARC,EAAgC,EAJD,CAK/BC,EAAc,EALiB,CAM/Bj3B,EAAc3M,CAAA2M,YAAA,EANiB,CAO/BC,EAAY5M,CAAA4M,UAAA,EAPmB,CAQ/Bi3B,EAAS,oBAEb7hD,EAAA,CAAQ2I,CAAR,CAAc,QAAQ,CAACuiB,CAAD,CAAa42B,CAAb,CAA4B,CAC5CD,CAAAn4C,KAAA,CAAYo4C,CAAZ,CAAJ,GACEH,CAAA,CAAMt7C,CAAA,CAAUy7C,CAAA96C,QAAA,CAAsB,MAAtB,CAA8B,EAA9B,CAAAA,QAAA,CAA0C,OAA1C,CAAmD,GAAnD,CAAV,CAAN,CADF,CAEIT,CAAAoC,KAAA,CAAaA,CAAAkY,MAAA,CAAWihC,CAAX,CAAb,CAFJ,CADgD,CAAlD,CAMA9hD,EAAA,CAAQ2hD,CAAR,CAAe,QAAQ,CAACz2B,CAAD,CAAa/qB,CAAb,CAAkB,CACvCyhD,CAAA,CAAYzhD,CAAZ,CAAA,CACE6d,CAAA,CAAakN,CAAAlkB,QAAA,CAAmBw6C,CAAnB,CAA0B72B,CAA1B,CAAwC82B,CAAxC,CAAoD,GAApD,CACXp1C,CADW,CACFue,CADE,CAAb,CAFqC,CAAzC,CAMAzhB,EAAA/E,OAAA,CAAa29C,QAAyB,EAAG,CACvC,IAAIhhD,EAAQgqC,UAAA,CAAW5hC,CAAA83B,MAAA,CAAYwgB,CAAZ,CAAX,CAEZ,IAAKvgB,KAAA,CAAMngC,CAAN,CAAL,CAME,MAAO,EAHDA,EAAN,GAAe4gD,EAAf,GAAuB5gD,CAAvB,CAA+BsmC,CAAAjT,UAAA,CAAkBrzB,CAAlB,CAA0BsL,CAA1B,CAA/B,CACC,OAAOu1C,EAAA,CAAY7gD,CAAZ,CAAA,CAAmBoI,CAAnB,CAA0B5C,CAA1B,CAAmC,CAAA,CAAnC,CAP6B,CAAzC,CAWGy7C,QAA+B,CAACviB,CAAD,CAAS,CACzCl5B,CAAA4hB,KAAA,CAAasX,CAAb,CADyC,CAX3C,CAtBmC,CAFhC,CAF8E,CAA5D,CAzf3B,CAovBIwiB,GAAoB,CAAC,QAAD,CAAW,UAAX,CAAuB,QAAQ,CAAC9jC,CAAD;AAASG,CAAT,CAAmB,CA2LxE4jC,QAASA,EAAgB,CAACj2C,CAAD,CAAQ,CAC/B,GAAIA,CAAAk2C,UAAJ,GAAwBl2C,CAAAm2C,QAAxB,CACE,MAAO57C,EAAA,CAAOyF,CAAAk2C,UAAP,CAGT,KAAI57C,EAAU0F,CAAAk2C,UAAd,CACIn6C,EAAW,CAACzB,CAAD,CAEf,GAAG,CACDA,CAAA,CAAUA,CAAA8b,YACV,IAAI,CAAC9b,CAAL,CAAc,KACdyB,EAAAvH,KAAA,CAAc8F,CAAd,CAHC,CAAH,MAISA,CAJT,GAIqB0F,CAAAm2C,QAJrB,CAMA,OAAO57C,EAAA,CAAOwB,CAAP,CAdwB,CAzLjC,IAAIq6C,EAAiB7iD,CAAA,CAAO,UAAP,CACrB,OAAO,YACO,SADP,UAEK,GAFL,UAGK,CAAA,CAHL,SAII4J,QAAQ,CAAC7C,CAAD,CAAUoC,CAAV,CAAgB25C,CAAhB,CAAwB,CACvC,MAAO,SAAQ,CAACx9B,CAAD,CAASxF,CAAT,CAAmBuB,CAAnB,CAAyB,CACtC,IAAIqK,EAAarK,CAAA0hC,SAAjB,CACIx7C,EAAQmkB,CAAAnkB,MAAA,CAAiB,qDAAjB,CADZ,CAEcy7C,CAFd,CAEgCC,CAFhC,CAEgDC,CAFhD,CAEkEC,CAFlE,CAGOC,CAHP,CAGYC,CAHZ,CAG6BC,CAH7B,CAIEC,EAAe,KAAMlxC,EAAN,CAEjB,IAAI,CAAC9K,CAAL,CACE,KAAMs7C,EAAA,CAAe,MAAf,CACJn3B,CADI,CAAN,CAIF83B,CAAA,CAAMj8C,CAAA,CAAM,CAAN,CACN67C,EAAA,CAAM77C,CAAA,CAAM,CAAN,CAGN,EAFAk8C,CAEA,CAFal8C,CAAA,CAAM,CAAN,CAEb,GACEy7C,CACA,CADmBrkC,CAAA,CAAO8kC,CAAP,CACnB,CAAAR,CAAA,CAAiBA,QAAQ,CAACtiD,CAAD,CAAMY,CAAN,CAAaE,CAAb,CAAoB,CAEvC6hD,CAAJ,GAAmBC,CAAA,CAAaD,CAAb,CAAnB,CAAiD3iD,CAAjD,CACA4iD,EAAA,CAAaF,CAAb,CAAA,CAAgC9hD,CAChCgiD,EAAAjT,OAAA,CAAsB7uC,CACtB,OAAOuhD,EAAA,CAAiB19B,CAAjB;AAAyBi+B,CAAzB,CALoC,CAF/C,GAUEL,CAGA,CAHmBA,QAAQ,CAACviD,CAAD,CAAMY,CAAN,CAAa,CACtC,MAAO8Q,GAAA,CAAQ9Q,CAAR,CAD+B,CAGxC,CAAA4hD,CAAA,CAAiBA,QAAQ,CAACxiD,CAAD,CAAM,CAC7B,MAAOA,EADsB,CAbjC,CAkBA4G,EAAA,CAAQi8C,CAAAj8C,MAAA,CAAU,+CAAV,CACR,IAAI,CAACA,CAAL,CACE,KAAMs7C,EAAA,CAAe,QAAf,CACoDW,CADpD,CAAN,CAGFH,CAAA,CAAkB97C,CAAA,CAAM,CAAN,CAAlB,EAA8BA,CAAA,CAAM,CAAN,CAC9B+7C,EAAA,CAAgB/7C,CAAA,CAAM,CAAN,CAOhB,KAAIm8C,EAAe,EAGnBp+B,EAAA8a,iBAAA,CAAwBgjB,CAAxB,CAA6BO,QAAuB,CAACC,CAAD,CAAY,CAAA,IAC1DniD,CAD0D,CACnDrB,CADmD,CAE1DyjD,EAAe/jC,CAAA,CAAS,CAAT,CAF2C,CAG1DgkC,CAH0D,CAM1DC,EAAe,EAN2C,CAO1DC,CAP0D,CAQ1D5jC,CAR0D,CAS1Dzf,CAT0D,CASrDY,CATqD,CAY1D0iD,CAZ0D,CAa1Dx3C,CAb0D,CAc1Dy3C,EAAiB,EAIrB,IAAIjkD,EAAA,CAAY2jD,CAAZ,CAAJ,CACEK,CACA,CADiBL,CACjB,CAAAO,CAAA,CAAclB,CAAd,EAAgCC,CAFlC,KAGO,CACLiB,CAAA,CAAclB,CAAd,EAAgCE,CAEhCc,EAAA,CAAiB,EACjB,KAAKtjD,CAAL,GAAYijD,EAAZ,CACMA,CAAA/iD,eAAA,CAA0BF,CAA1B,CAAJ,EAAuD,GAAvD,EAAsCA,CAAA+E,OAAA,CAAW,CAAX,CAAtC,EACEu+C,CAAAhjD,KAAA,CAAoBN,CAApB,CAGJsjD,EAAA/iD,KAAA,EATK,CAYP8iD,CAAA,CAAcC,CAAA7jD,OAGdA,EAAA,CAAS8jD,CAAA9jD,OAAT,CAAiC6jD,CAAA7jD,OACjC,KAAIqB,CAAJ,CAAY,CAAZ,CAAeA,CAAf,CAAuBrB,CAAvB,CAA+BqB,CAAA,EAA/B,CAKC,GAJAd,CAIG,CAJIijD,CAAD,GAAgBK,CAAhB,CAAkCxiD,CAAlC,CAA0CwiD,CAAA,CAAexiD,CAAf,CAI7C,CAHHF,CAGG,CAHKqiD,CAAA,CAAWjjD,CAAX,CAGL,CAFHyjD,CAEG,CAFSD,CAAA,CAAYxjD,CAAZ,CAAiBY,CAAjB,CAAwBE,CAAxB,CAET,CADH0J,EAAA,CAAwBi5C,CAAxB,CAAmC,eAAnC,CACG,CAAAV,CAAA7iD,eAAA,CAA4BujD,CAA5B,CAAH,CACE33C,CAGA,CAHQi3C,CAAA,CAAaU,CAAb,CAGR,CAFA,OAAOV,CAAA,CAAaU,CAAb,CAEP,CADAL,CAAA,CAAaK,CAAb,CACA;AAD0B33C,CAC1B,CAAAy3C,CAAA,CAAeziD,CAAf,CAAA,CAAwBgL,CAJ1B,KAKO,CAAA,GAAIs3C,CAAAljD,eAAA,CAA4BujD,CAA5B,CAAJ,CAML,KAJA5jD,EAAA,CAAQ0jD,CAAR,CAAwB,QAAQ,CAACz3C,CAAD,CAAQ,CAClCA,CAAJ,EAAaA,CAAAk2C,UAAb,GAA8Be,CAAA,CAAaj3C,CAAA43C,GAAb,CAA9B,CAAuD53C,CAAvD,CADsC,CAAxC,CAIM,CAAAo2C,CAAA,CAAe,OAAf,CACiIn3B,CADjI,CACmJ04B,CADnJ,CAAN,CAIAF,CAAA,CAAeziD,CAAf,CAAA,CAAwB,IAAM2iD,CAAN,CACxBL,EAAA,CAAaK,CAAb,CAAA,CAA0B,CAAA,CAXrB,CAgBR,IAAKzjD,CAAL,GAAY+iD,EAAZ,CAEMA,CAAA7iD,eAAA,CAA4BF,CAA5B,CAAJ,GACE8L,CAIA,CAJQi3C,CAAA,CAAa/iD,CAAb,CAIR,CAHA0oB,CAGA,CAHmBq5B,CAAA,CAAiBj2C,CAAjB,CAGnB,CAFAqS,CAAAm1B,MAAA,CAAe5qB,CAAf,CAEA,CADA7oB,CAAA,CAAQ6oB,CAAR,CAA0B,QAAQ,CAACtiB,CAAD,CAAU,CAAEA,CAAA,aAAA,CAAsB,CAAA,CAAxB,CAA5C,CACA,CAAA0F,CAAA9C,MAAAmG,SAAA,EALF,CAUGrO,EAAA,CAAQ,CAAb,KAAgBrB,CAAhB,CAAyB6jD,CAAA7jD,OAAzB,CAAgDqB,CAAhD,CAAwDrB,CAAxD,CAAgEqB,CAAA,EAAhE,CAAyE,CACvEd,CAAA,CAAOijD,CAAD,GAAgBK,CAAhB,CAAkCxiD,CAAlC,CAA0CwiD,CAAA,CAAexiD,CAAf,CAChDF,EAAA,CAAQqiD,CAAA,CAAWjjD,CAAX,CACR8L,EAAA,CAAQy3C,CAAA,CAAeziD,CAAf,CACJyiD,EAAA,CAAeziD,CAAf,CAAuB,CAAvB,CAAJ,GAA+BoiD,CAA/B,CAA8CK,CAAA,CAAeziD,CAAf,CAAuB,CAAvB,CAAAmhD,QAA9C,CAEA,IAAIn2C,CAAAk2C,UAAJ,CAAqB,CAGnBviC,CAAA,CAAa3T,CAAA9C,MAEbm6C,EAAA,CAAWD,CACX,GACEC,EAAA,CAAWA,CAAAjhC,YADb,OAEQihC,CAFR,EAEoBA,CAAA,aAFpB,CAIIr3C,EAAAk2C,UAAJ,EAAuBmB,CAAvB,EAIEhlC,CAAAo1B,KAAA,CAAcwO,CAAA,CAAiBj2C,CAAjB,CAAd,CAAuC,IAAvC,CAA6CzF,CAAA,CAAO68C,CAAP,CAA7C,CAEFA,EAAA,CAAep3C,CAAAm2C,QAhBI,CAArB,IAmBExiC,EAAA,CAAakF,CAAA7E,KAAA,EAGfL,EAAA,CAAWijC,CAAX,CAAA,CAA8B9hD,CAC1B+hD,EAAJ,GAAmBljC,CAAA,CAAWkjC,CAAX,CAAnB,CAA+C3iD,CAA/C,CACAyf,EAAAkwB,OAAA,CAAoB7uC,CACpB2e,EAAAkkC,OAAA;AAA+B,CAA/B,GAAqB7iD,CACrB2e,EAAAmkC,MAAA,CAAoB9iD,CAApB,GAA+BuiD,CAA/B,CAA6C,CAC7C5jC,EAAAokC,QAAA,CAAqB,EAAEpkC,CAAAkkC,OAAF,EAAuBlkC,CAAAmkC,MAAvB,CACrBnkC,EAAAqkC,KAAA,CAAkB,EAAErkC,CAAAskC,MAAF,CAA8B,CAA9B,EAAqBjjD,CAArB,CAA2B,CAA3B,CAEbgL,EAAAk2C,UAAL,EACEG,CAAA,CAAO1iC,CAAP,CAAmB,QAAQ,CAACnZ,CAAD,CAAQ,CACjCA,CAAA,CAAMA,CAAA7G,OAAA,EAAN,CAAA,CAAwBN,CAAAomB,cAAA,CAAuB,iBAAvB,CAA2CwF,CAA3C,CAAwD,GAAxD,CACxB5M,EAAAg1B,MAAA,CAAe7sC,CAAf,CAAsB,IAAtB,CAA4BD,CAAA,CAAO68C,CAAP,CAA5B,CACAA,EAAA,CAAe58C,CACfwF,EAAA9C,MAAA,CAAcyW,CACd3T,EAAAk2C,UAAA,CAAkBkB,CAAA,EAAgBA,CAAAjB,QAAhB,CAAuCiB,CAAAjB,QAAvC,CAA8D37C,CAAA,CAAM,CAAN,CAChFwF,EAAAm2C,QAAA,CAAgB37C,CAAA,CAAMA,CAAA7G,OAAN,CAAqB,CAArB,CAChB2jD,EAAA,CAAat3C,CAAA43C,GAAb,CAAA,CAAyB53C,CAPQ,CAAnC,CArCqE,CAgDzEi3C,CAAA,CAAeK,CA3H+C,CAAhE,CAlDsC,CADD,CAJpC,CAHiE,CAAlD,CApvBxB,CAglCIY,GAAkB,CAAC,UAAD,CAAa,QAAQ,CAAC7lC,CAAD,CAAW,CACpD,MAAO,SAAQ,CAACnV,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CACpCQ,CAAA/E,OAAA,CAAauE,CAAAy7C,OAAb,CAA0BC,QAA0B,CAACtjD,CAAD,CAAO,CACzDud,CAAA,CAASnY,EAAA,CAAUpF,CAAV,CAAA,CAAmB,aAAnB,CAAmC,UAA5C,CAAA,CAAwDwF,CAAxD,CAAiE,SAAjE,CADyD,CAA3D,CADoC,CADc,CAAhC,CAhlCtB,CAwuCI+9C,GAAkB,CAAC,UAAD,CAAa,QAAQ,CAAChmC,CAAD,CAAW,CACpD,MAAO,SAAQ,CAACnV,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CACpCQ,CAAA/E,OAAA,CAAauE,CAAA47C,OAAb,CAA0BC,QAA0B,CAACzjD,CAAD,CAAO,CACzDud,CAAA,CAASnY,EAAA,CAAUpF,CAAV,CAAA;AAAmB,UAAnB,CAAgC,aAAzC,CAAA,CAAwDwF,CAAxD,CAAiE,SAAjE,CADyD,CAA3D,CADoC,CADc,CAAhC,CAxuCtB,CAsxCIk+C,GAAmBtY,EAAA,CAAY,QAAQ,CAAChjC,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CAChEQ,CAAA/E,OAAA,CAAauE,CAAA+7C,QAAb,CAA2BC,QAA2B,CAACC,CAAD,CAAYC,CAAZ,CAAuB,CACvEA,CAAJ,EAAkBD,CAAlB,GAAgCC,CAAhC,EACE7kD,CAAA,CAAQ6kD,CAAR,CAAmB,QAAQ,CAACl/C,CAAD,CAAMu/B,CAAN,CAAa,CAAE3+B,CAAAsqC,IAAA,CAAY3L,CAAZ,CAAmB,EAAnB,CAAF,CAAxC,CAEE0f,EAAJ,EAAer+C,CAAAsqC,IAAA,CAAY+T,CAAZ,CAJ4D,CAA7E,CAKG,CAAA,CALH,CADgE,CAA3C,CAtxCvB,CAy5CIE,GAAoB,CAAC,UAAD,CAAa,QAAQ,CAACxmC,CAAD,CAAW,CACtD,MAAO,UACK,IADL,SAEI,UAFJ,YAKO,CAAC,QAAD,CAAWymC,QAA2B,EAAG,CACpD,IAAAC,MAAA,CAAa,EADuC,CAAzC,CALP,MAQCzpC,QAAQ,CAACpS,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuBo8C,CAAvB,CAA2C,CAAA,IAEnDE,CAFmD,CAGnDC,CAHmD,CAInDC,EAAiB,EAErBh8C,EAAA/E,OAAA,CALgBuE,CAAAy8C,SAKhB,EALiCz8C,CAAApF,GAKjC,CAAwB8hD,QAA4B,CAACtkD,CAAD,CAAQ,CAC1D,IAD0D,IACjDH,EAAG,CAD8C,CAC3CiT,EAAGsxC,CAAAvlD,OAAlB,CAAyCgB,CAAzC,CAA2CiT,CAA3C,CAA+CjT,CAAA,EAA/C,CACEukD,CAAA,CAAevkD,CAAf,CAAA0O,SAAA,EACA,CAAAgP,CAAAm1B,MAAA,CAAeyR,CAAA,CAAiBtkD,CAAjB,CAAf,CAGFskD,EAAA,CAAmB,EACnBC,EAAA,CAAiB,EAEjB,IAAKF,CAAL,CAA2BF,CAAAC,MAAA,CAAyB,GAAzB,CAA+BjkD,CAA/B,CAA3B,EAAoEgkD,CAAAC,MAAA,CAAyB,GAAzB,CAApE,CACE77C,CAAA83B,MAAA,CAAYt4B,CAAA28C,OAAZ,CACA,CAAAtlD,CAAA,CAAQilD,CAAR,CAA6B,QAAQ,CAACM,CAAD,CAAqB,CACxD,IAAIC,EAAgBr8C,CAAA8W,KAAA,EACpBklC;CAAA1kD,KAAA,CAAoB+kD,CAApB,CACAD,EAAArlC,WAAA,CAA8BslC,CAA9B,CAA6C,QAAQ,CAACC,CAAD,CAAc,CACjE,IAAIC,EAASH,CAAAh/C,QAEb2+C,EAAAzkD,KAAA,CAAsBglD,CAAtB,CACAnnC,EAAAg1B,MAAA,CAAemS,CAAf,CAA4BC,CAAAvjD,OAAA,EAA5B,CAA6CujD,CAA7C,CAJiE,CAAnE,CAHwD,CAA1D,CAXwD,CAA5D,CANuD,CARpD,CAD+C,CAAhC,CAz5CxB,CAm8CIC,GAAwBxZ,EAAA,CAAY,YAC1B,SAD0B,UAE5B,GAF4B,SAG7B,WAH6B,SAI7B/iC,QAAQ,CAAC7C,CAAD,CAAU+Z,CAAV,CAAiBJ,CAAjB,CAA6B,CAC5C,MAAO,SAAQ,CAAC/W,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B,CAC1CA,CAAAyW,MAAA,CAAW,GAAX,CAAiB1kC,CAAAslC,aAAjB,CAAA,CAAwCrX,CAAAyW,MAAA,CAAW,GAAX,CAAiB1kC,CAAAslC,aAAjB,CAAxC,EAAgF,EAChFrX,EAAAyW,MAAA,CAAW,GAAX,CAAiB1kC,CAAAslC,aAAjB,CAAAnlD,KAAA,CAA0C,YAAcyf,CAAd,SAAmC3Z,CAAnC,CAA1C,CAF0C,CADA,CAJR,CAAZ,CAn8C5B,CA+8CIs/C,GAA2B1Z,EAAA,CAAY,YAC7B,SAD6B,UAE/B,GAF+B,SAGhC,WAHgC,SAIhC/iC,QAAQ,CAAC7C,CAAD,CAAU+Z,CAAV,CAAiBJ,CAAjB,CAA6B,CAC5C,MAAO,SAAQ,CAAC/W,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B,CAC1CA,CAAAyW,MAAA,CAAW,GAAX,CAAA,CAAmBzW,CAAAyW,MAAA,CAAW,GAAX,CAAnB,EAAsC,EACtCzW,EAAAyW,MAAA,CAAW,GAAX,CAAAvkD,KAAA,CAAqB,YAAcyf,CAAd;QAAmC3Z,CAAnC,CAArB,CAF0C,CADA,CAJL,CAAZ,CA/8C/B,CA8gDIu/C,GAAwB3Z,EAAA,CAAY,YAC1B,CAAC,UAAD,CAAa,aAAb,CAA4B,QAAQ,CAAC7sB,CAAD,CAAWymC,CAAX,CAAwB,CACtE,GAAI,CAACA,CAAL,CACE,KAAMvmD,EAAA,CAAO,cAAP,CAAA,CAAuB,QAAvB,CAIF8G,EAAA,CAAYgZ,CAAZ,CAJE,CAAN,CAUF,IAAAymC,YAAA,CAAmBA,CAZmD,CAA5D,CAD0B,MAgBhCxqC,QAAQ,CAACuJ,CAAD,CAASxF,CAAT,CAAmB0mC,CAAnB,CAA2BroC,CAA3B,CAAuC,CACnDA,CAAAooC,YAAA,CAAuB,QAAQ,CAACt/C,CAAD,CAAQ,CACrC6Y,CAAA5Y,KAAA,CAAc,EAAd,CACA4Y,EAAAzY,OAAA,CAAgBJ,CAAhB,CAFqC,CAAvC,CADmD,CAhBf,CAAZ,CA9gD5B,CAmkDIw/C,GAAkB,CAAC,gBAAD,CAAmB,QAAQ,CAAC/nC,CAAD,CAAiB,CAChE,MAAO,UACK,GADL,UAEK,CAAA,CAFL,SAGI9U,QAAQ,CAAC7C,CAAD,CAAUoC,CAAV,CAAgB,CACd,kBAAjB,EAAIA,CAAAgG,KAAJ,EAKEuP,CAAAlM,IAAA,CAJkBrJ,CAAAk7C,GAIlB,CAFWt9C,CAAA,CAAQ,CAAR,CAAA4hB,KAEX,CAN6B,CAH5B,CADyD,CAA5C,CAnkDtB,CAmlDI+9B,GAAkB1mD,CAAA,CAAO,WAAP,CAnlDtB,CAgtDI2mD,GAAqB3jD,EAAA,CAAQ,UAAY,CAAA,CAAZ,CAAR,CAhtDzB,CAitDI4jD,GAAkB,CAAC,UAAD,CAAa,QAAb,CAAuB,QAAQ,CAAC7F,CAAD,CAAapiC,CAAb,CAAqB,CAAA,IAEpEkoC,EAAoB,8KAFgD;AAGpEC,EAAgB,eAAgBjkD,CAAhB,CAEpB,OAAO,UACK,GADL,SAEI,CAAC,QAAD,CAAW,UAAX,CAFJ,YAGO,CAAC,UAAD,CAAa,QAAb,CAAuB,QAAvB,CAAiC,QAAQ,CAACid,CAAD,CAAWwF,CAAX,CAAmBkhC,CAAnB,CAA2B,CAAA,IAC1E5gD,EAAO,IADmE,CAE1EmhD,EAAa,EAF6D,CAG1EC,EAAcF,CAH4D,CAK1EG,CAGJrhD,EAAAshD,UAAA,CAAiBV,CAAA7I,QAGjB/3C,EAAAuhD,KAAA,CAAYC,QAAQ,CAACC,CAAD,CAAeC,CAAf,CAA4BC,CAA5B,CAA4C,CAC9DP,CAAA,CAAcK,CAEdJ,EAAA,CAAgBM,CAH8C,CAOhE3hD,EAAA4hD,UAAA,CAAiBC,QAAQ,CAAClmD,CAAD,CAAQ,CAC/B4J,EAAA,CAAwB5J,CAAxB,CAA+B,gBAA/B,CACAwlD,EAAA,CAAWxlD,CAAX,CAAA,CAAoB,CAAA,CAEhBylD,EAAA/X,WAAJ,EAA8B1tC,CAA9B,GACEue,CAAA3Z,IAAA,CAAa5E,CAAb,CACA,CAAI0lD,CAAAtkD,OAAA,EAAJ,EAA4BskD,CAAAtqC,OAAA,EAF9B,CAJ+B,CAWjC/W,EAAA8hD,aAAA,CAAoBC,QAAQ,CAACpmD,CAAD,CAAQ,CAC9B,IAAAqmD,UAAA,CAAermD,CAAf,CAAJ,GACE,OAAOwlD,CAAA,CAAWxlD,CAAX,CACP,CAAIylD,CAAA/X,WAAJ,EAA8B1tC,CAA9B,EACE,IAAAsmD,oBAAA,CAAyBtmD,CAAzB,CAHJ,CADkC,CAUpCqE,EAAAiiD,oBAAA,CAA2BC,QAAQ,CAAC3hD,CAAD,CAAM,CACnC4hD,CAAAA,CAAa,IAAbA,CAAoB11C,EAAA,CAAQlM,CAAR,CAApB4hD,CAAmC,IACvCd,EAAA9gD,IAAA,CAAkB4hD,CAAlB,CACAjoC,EAAA+yB,QAAA,CAAiBoU,CAAjB,CACAnnC,EAAA3Z,IAAA,CAAa4hD,CAAb,CACAd,EAAAn8B,KAAA,CAAmB,UAAnB;AAA+B,CAAA,CAA/B,CALuC,CASzCllB,EAAAgiD,UAAA,CAAiBI,QAAQ,CAACzmD,CAAD,CAAQ,CAC/B,MAAOwlD,EAAAlmD,eAAA,CAA0BU,CAA1B,CADwB,CAIjC+jB,EAAAwc,IAAA,CAAW,UAAX,CAAuB,QAAQ,EAAG,CAEhCl8B,CAAAiiD,oBAAA,CAA2BhlD,CAFK,CAAlC,CApD8E,CAApE,CAHP,MA6DCkZ,QAAQ,CAACpS,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuBk1C,CAAvB,CAA8B,CAkD1C4J,QAASA,EAAM,CAACt+C,CAAD,CAAQu+C,CAAR,CAAuBlB,CAAvB,CAAoCmB,CAApC,CAAgD,CAC7DnB,CAAA3X,QAAA,CAAsB+Y,QAAQ,EAAG,CAC/B,IAAIrJ,EAAYiI,CAAA/X,WAEZkZ,EAAAP,UAAA,CAAqB7I,CAArB,CAAJ,EACMkI,CAAAtkD,OAAA,EAEJ,EAF4BskD,CAAAtqC,OAAA,EAE5B,CADAurC,CAAA/hD,IAAA,CAAkB44C,CAAlB,CACA,CAAkB,EAAlB,GAAIA,CAAJ,EAAsBsJ,CAAAv9B,KAAA,CAAiB,UAAjB,CAA6B,CAAA,CAA7B,CAHxB,EAKM7nB,CAAA,CAAY87C,CAAZ,CAAJ,EAA8BsJ,CAA9B,CACEH,CAAA/hD,IAAA,CAAkB,EAAlB,CADF,CAGEgiD,CAAAN,oBAAA,CAA+B9I,CAA/B,CAX2B,CAgBjCmJ,EAAAnkD,GAAA,CAAiB,QAAjB,CAA2B,QAAQ,EAAG,CACpC4F,CAAAG,OAAA,CAAa,QAAQ,EAAG,CAClBm9C,CAAAtkD,OAAA,EAAJ,EAA4BskD,CAAAtqC,OAAA,EAC5BqqC,EAAA9X,cAAA,CAA0BgZ,CAAA/hD,IAAA,EAA1B,CAFsB,CAAxB,CADoC,CAAtC,CAjB6D,CAyB/DmiD,QAASA,EAAQ,CAAC3+C,CAAD,CAAQu+C,CAAR,CAAuBnZ,CAAvB,CAA6B,CAC5C,IAAIwZ,CACJxZ,EAAAM,QAAA,CAAeC,QAAQ,EAAG,CACxB,IAAIkZ,EAAQ,IAAIj2C,EAAJ,CAAYw8B,CAAAE,WAAZ,CACZzuC,EAAA,CAAQ0nD,CAAAlkD,KAAA,CAAmB,QAAnB,CAAR;AAAsC,QAAQ,CAAC+tC,CAAD,CAAS,CACrDA,CAAAC,SAAA,CAAkB9uC,CAAA,CAAUslD,CAAAx0C,IAAA,CAAU+9B,CAAAxwC,MAAV,CAAV,CADmC,CAAvD,CAFwB,CAS1BoI,EAAA/E,OAAA,CAAa6jD,QAA4B,EAAG,CACrCrjD,EAAA,CAAOmjD,CAAP,CAAiBxZ,CAAAE,WAAjB,CAAL,GACEsZ,CACA,CADW/jD,EAAA,CAAKuqC,CAAAE,WAAL,CACX,CAAAF,CAAAM,QAAA,EAFF,CAD0C,CAA5C,CAOA6Y,EAAAnkD,GAAA,CAAiB,QAAjB,CAA2B,QAAQ,EAAG,CACpC4F,CAAAG,OAAA,CAAa,QAAQ,EAAG,CACtB,IAAIzF,EAAQ,EACZ7D,EAAA,CAAQ0nD,CAAAlkD,KAAA,CAAmB,QAAnB,CAAR,CAAsC,QAAQ,CAAC+tC,CAAD,CAAS,CACjDA,CAAAC,SAAJ,EACE3tC,CAAApD,KAAA,CAAW8wC,CAAAxwC,MAAX,CAFmD,CAAvD,CAKAwtC,EAAAG,cAAA,CAAmB7qC,CAAnB,CAPsB,CAAxB,CADoC,CAAtC,CAlB4C,CA+B9CqkD,QAASA,EAAO,CAAC/+C,CAAD,CAAQu+C,CAAR,CAAuBnZ,CAAvB,CAA6B,CAoG3C4Z,QAASA,EAAM,EAAG,CAAA,IACZC,EAAe,CAAC,EAAD,CAAI,EAAJ,CADH,CAEZC,EAAmB,CAAC,EAAD,CAFP,CAGZC,CAHY,CAIZC,CAJY,CAKZhX,CALY,CAMZiX,CANY,CAMIC,CAChBC,EAAAA,CAAana,CAAAwO,YACb/yB,EAAAA,CAAS2+B,CAAA,CAASx/C,CAAT,CAAT6gB,EAA4B,EARhB,KASZxpB,EAAOooD,CAAA,CAAUroD,EAAA,CAAWypB,CAAX,CAAV,CAA+BA,CAT1B,CAWCpqB,CAXD,CAYZipD,CAZY,CAYA5nD,CACZqT,EAAAA,CAAS,EAETw0C,EAAAA,CAAc,CAAA,CAfF,KAgBZC,CAhBY,CAiBZxiD,CAGJ,IAAI+qC,CAAJ,CACE,GAAI0X,CAAJ,EAAejpD,CAAA,CAAQ2oD,CAAR,CAAf,CAEE,IADAI,CACSG,CADK,IAAIl3C,EAAJ,CAAY,EAAZ,CACLk3C,CAAAA,CAAAA,CAAa,CAAtB,CAAyBA,CAAzB,CAAsCP,CAAA9oD,OAAtC,CAAyDqpD,CAAA,EAAzD,CACE30C,CAAA,CAAO40C,CAAP,CACA,CADoBR,CAAA,CAAWO,CAAX,CACpB,CAAAH,CAAA92C,IAAA,CAAgBg3C,CAAA,CAAQ7/C,CAAR,CAAemL,CAAf,CAAhB,CAAwCo0C,CAAA,CAAWO,CAAX,CAAxC,CAJJ,KAOEH,EAAA,CAAc,IAAI/2C,EAAJ,CAAY22C,CAAZ,CAKlB,KAAKznD,CAAL,CAAa,CAAb,CAAgBrB,CAAA,CAASY,CAAAZ,OAAT;AAAsBqB,CAAtB,CAA8BrB,CAA9C,CAAsDqB,CAAA,EAAtD,CAA+D,CAE7Dd,CAAA,CAAMc,CACN,IAAI2nD,CAAJ,CAAa,CACXzoD,CAAA,CAAMK,CAAA,CAAKS,CAAL,CACN,IAAuB,GAAvB,GAAKd,CAAA+E,OAAA,CAAW,CAAX,CAAL,CAA6B,QAC7BoP,EAAA,CAAOs0C,CAAP,CAAA,CAAkBzoD,CAHP,CAMbmU,CAAA,CAAO40C,CAAP,CAAA,CAAoBl/B,CAAA,CAAO7pB,CAAP,CAEpBmoD,EAAA,CAAkBa,CAAA,CAAUhgD,CAAV,CAAiBmL,CAAjB,CAAlB,EAA8C,EAC9C,EAAMi0C,CAAN,CAAoBH,CAAA,CAAaE,CAAb,CAApB,IACEC,CACA,CADcH,CAAA,CAAaE,CAAb,CACd,CAD8C,EAC9C,CAAAD,CAAA5nD,KAAA,CAAsB6nD,CAAtB,CAFF,CAIIhX,EAAJ,CACEE,CADF,CACasX,CAAA3sC,OAAA,CAAmB6sC,CAAA,CAAUA,CAAA,CAAQ7/C,CAAR,CAAemL,CAAf,CAAV,CAAmC9R,CAAA,CAAQ2G,CAAR,CAAemL,CAAf,CAAtD,CADb,GAC+F/U,CAD/F,EAGMypD,CAAJ,EACMI,CAEJ,CAFgB,EAEhB,CADAA,CAAA,CAAUF,CAAV,CACA,CADuBR,CACvB,CAAAlX,CAAA,CAAWwX,CAAA,CAAQ7/C,CAAR,CAAeigD,CAAf,CAAX,GAAyCJ,CAAA,CAAQ7/C,CAAR,CAAemL,CAAf,CAH3C,EAKEk9B,CALF,CAKakX,CALb,GAK4BlmD,CAAA,CAAQ2G,CAAR,CAAemL,CAAf,CAE5B,CAAAw0C,CAAA,CAAcA,CAAd,EAA6BtX,CAV/B,CAYA6X,EAAA,CAAQC,CAAA,CAAUngD,CAAV,CAAiBmL,CAAjB,CACR+0C,EAAA,CAAQA,CAAA,GAAU9pD,CAAV,CAAsB,EAAtB,CAA2B8pD,CACnCd,EAAA9nD,KAAA,CAAiB,IACXuoD,CAAA,CAAUA,CAAA,CAAQ7/C,CAAR,CAAemL,CAAf,CAAV,CAAoCs0C,CAAA,CAAUpoD,CAAA,CAAKS,CAAL,CAAV,CAAwBA,CADjD,OAERooD,CAFQ,UAGL7X,CAHK,CAAjB,CA9B6D,CAoC1DF,CAAL,GACMiY,CAAJ,EAAiC,IAAjC,GAAkBb,CAAlB,CAEEN,CAAA,CAAa,EAAb,CAAA5mD,QAAA,CAAyB,IAAI,EAAJ,OAAc,EAAd,UAA2B,CAACsnD,CAA5B,CAAzB,CAFF,CAGYA,CAHZ,EAKEV,CAAA,CAAa,EAAb,CAAA5mD,QAAA,CAAyB,IAAI,GAAJ,OAAe,EAAf,UAA4B,CAAA,CAA5B,CAAzB,CANJ,CAWKqnD,EAAA,CAAa,CAAlB,KAAqBW,CAArB,CAAmCnB,CAAAzoD,OAAnC,CACKipD,CADL,CACkBW,CADlB,CAEKX,CAAA,EAFL,CAEmB,CAEjBP,CAAA,CAAkBD,CAAA,CAAiBQ,CAAjB,CAGlBN,EAAA,CAAcH,CAAA,CAAaE,CAAb,CAEVmB,EAAA7pD,OAAJ,EAAgCipD,CAAhC,EAEEL,CAMA,CANiB,SACNkB,CAAAjjD,MAAA,EAAAkC,KAAA,CAA8B,OAA9B,CAAuC2/C,CAAvC,CADM,OAERC,CAAAc,MAFQ,CAMjB,CAFAZ,CAEA,CAFkB,CAACD,CAAD,CAElB;AADAiB,CAAAhpD,KAAA,CAAuBgoD,CAAvB,CACA,CAAAf,CAAA7gD,OAAA,CAAqB2hD,CAAAjiD,QAArB,CARF,GAUEkiD,CAIA,CAJkBgB,CAAA,CAAkBZ,CAAlB,CAIlB,CAHAL,CAGA,CAHiBC,CAAA,CAAgB,CAAhB,CAGjB,CAAID,CAAAa,MAAJ,EAA4Bf,CAA5B,EACEE,CAAAjiD,QAAAoC,KAAA,CAA4B,OAA5B,CAAqC6/C,CAAAa,MAArC,CAA4Df,CAA5D,CAfJ,CAmBAS,EAAA,CAAc,IACV9nD,EAAA,CAAQ,CAAZ,KAAerB,CAAf,CAAwB2oD,CAAA3oD,OAAxB,CAA4CqB,CAA5C,CAAoDrB,CAApD,CAA4DqB,CAAA,EAA5D,CACEswC,CACA,CADSgX,CAAA,CAAYtnD,CAAZ,CACT,CAAA,CAAK0oD,CAAL,CAAsBlB,CAAA,CAAgBxnD,CAAhB,CAAsB,CAAtB,CAAtB,GAEE8nD,CAQA,CARcY,CAAApjD,QAQd,CAPIojD,CAAAN,MAOJ,GAP6B9X,CAAA8X,MAO7B,EANEN,CAAA5gC,KAAA,CAAiBwhC,CAAAN,MAAjB,CAAwC9X,CAAA8X,MAAxC,CAMF,CAJIM,CAAA9F,GAIJ,GAJ0BtS,CAAAsS,GAI1B,EAHEkF,CAAApjD,IAAA,CAAgBgkD,CAAA9F,GAAhB,CAAoCtS,CAAAsS,GAApC,CAGF,CAAIkF,CAAA,CAAY,CAAZ,CAAAvX,SAAJ,GAAgCD,CAAAC,SAAhC,EACEuX,CAAAz+B,KAAA,CAAiB,UAAjB,CAA8Bq/B,CAAAnY,SAA9B,CAAwDD,CAAAC,SAAxD,CAXJ,GAiBoB,EAAlB,GAAID,CAAAsS,GAAJ,EAAwB0F,CAAxB,CAEEhjD,CAFF,CAEYgjD,CAFZ,CAOG5jD,CAAAY,CAAAZ,CAAUikD,CAAAnjD,MAAA,EAAVd,KAAA,CACQ4rC,CAAAsS,GADR,CAAAl7C,KAAA,CAES,UAFT,CAEqB4oC,CAAAC,SAFrB,CAAArpB,KAAA,CAGSopB,CAAA8X,MAHT,CAiBH,CAXAZ,CAAAhoD,KAAA,CAAsC,SACzB8F,CADyB,OAE3BgrC,CAAA8X,MAF2B,IAG9B9X,CAAAsS,GAH8B,UAIxBtS,CAAAC,SAJwB,CAAtC,CAWA,CALIuX,CAAJ,CACEA,CAAAxW,MAAA,CAAkBhsC,CAAlB,CADF,CAGEiiD,CAAAjiD,QAAAM,OAAA,CAA8BN,CAA9B,CAEF,CAAAwiD,CAAA,CAAcxiD,CAzChB,CA8CF,KADAtF,CAAA,EACA,CAAMwnD,CAAA7oD,OAAN;AAA+BqB,CAA/B,CAAA,CACEwnD,CAAAxxC,IAAA,EAAA1Q,QAAA4V,OAAA,EA5Ee,CAgFnB,IAAA,CAAMstC,CAAA7pD,OAAN,CAAiCipD,CAAjC,CAAA,CACEY,CAAAxyC,IAAA,EAAA,CAAwB,CAAxB,CAAA1Q,QAAA4V,OAAA,EAnKc,CAnGlB,IAAIpV,CAEJ,IAAI,EAAGA,CAAH,CAAW8iD,CAAA9iD,MAAA,CAAiBs/C,CAAjB,CAAX,CAAJ,CACE,KAAMH,GAAA,CAAgB,MAAhB,CAEJ2D,CAFI,CAEQvjD,EAAA,CAAYohD,CAAZ,CAFR,CAAN,CAJyC,IASvC4B,EAAYnrC,CAAA,CAAOpX,CAAA,CAAM,CAAN,CAAP,EAAmBA,CAAA,CAAM,CAAN,CAAnB,CAT2B,CAUvCmiD,EAAYniD,CAAA,CAAM,CAAN,CAAZmiD,EAAwBniD,CAAA,CAAM,CAAN,CAVe,CAWvC6hD,EAAU7hD,CAAA,CAAM,CAAN,CAX6B,CAYvCoiD,EAAYhrC,CAAA,CAAOpX,CAAA,CAAM,CAAN,CAAP,EAAmB,EAAnB,CAZ2B,CAavCvE,EAAU2b,CAAA,CAAOpX,CAAA,CAAM,CAAN,CAAA,CAAWA,CAAA,CAAM,CAAN,CAAX,CAAsBmiD,CAA7B,CAb6B,CAcvCP,EAAWxqC,CAAA,CAAOpX,CAAA,CAAM,CAAN,CAAP,CAd4B,CAgBvCiiD,EADQjiD,CAAA+iD,CAAM,CAANA,CACE,CAAQ3rC,CAAA,CAAOpX,CAAA,CAAM,CAAN,CAAP,CAAR,CAA2B,IAhBE,CAoBvC0iD,EAAoB,CAAC,CAAC,SAAU/B,CAAV,OAA+B,EAA/B,CAAD,CAAD,CAEpB6B,EAAJ,GAEEhJ,CAAA,CAASgJ,CAAT,CAAA,CAAqBpgD,CAArB,CAQA,CAJAogD,CAAA5/B,YAAA,CAAuB,UAAvB,CAIA,CAAA4/B,CAAAptC,OAAA,EAVF,CAcAurC,EAAAhhD,KAAA,CAAmB,EAAnB,CAEAghD,EAAAnkD,GAAA,CAAiB,QAAjB,CAA2B,QAAQ,EAAG,CACpC4F,CAAAG,OAAA,CAAa,QAAQ,EAAG,CAAA,IAClBi/C,CADkB,CAElBnF,EAAauF,CAAA,CAASx/C,CAAT,CAAbi6C,EAAgC,EAFd,CAGlB9uC,EAAS,EAHS,CAIlBnU,CAJkB,CAIbY,CAJa,CAISE,CAJT,CAIgB4nD,CAJhB,CAI4BjpD,CAJ5B,CAIoC4pD,CAJpC,CAIiDP,CAEvE,IAAI3X,CAAJ,CAEE,IADAvwC,CACqB,CADb,EACa,CAAhB8nD,CAAgB,CAAH,CAAG,CAAAW,CAAA,CAAcC,CAAA7pD,OAAnC,CACKipD,CADL,CACkBW,CADlB,CAEKX,CAAA,EAFL,CAME,IAFAN,CAEe,CAFDkB,CAAA,CAAkBZ,CAAlB,CAEC,CAAX5nD,CAAW,CAAH,CAAG,CAAArB,CAAA,CAAS2oD,CAAA3oD,OAAxB,CAA4CqB,CAA5C,CAAoDrB,CAApD,CAA4DqB,CAAA,EAA5D,CACE,IAAI,CAAC8oD,CAAD,CAAiBxB,CAAA,CAAYtnD,CAAZ,CAAAsF,QAAjB,EAA6C,CAA7C,CAAAirC,SAAJ,CAA8D,CAC5DrxC,CAAA,CAAM4pD,CAAApkD,IAAA,EACFijD;CAAJ,GAAat0C,CAAA,CAAOs0C,CAAP,CAAb,CAA+BzoD,CAA/B,CACA,IAAI6oD,CAAJ,CACE,IAAKC,CAAL,CAAkB,CAAlB,CAAqBA,CAArB,CAAkC7F,CAAAxjD,OAAlC,GACE0U,CAAA,CAAO40C,CAAP,CACI,CADgB9F,CAAA,CAAW6F,CAAX,CAChB,CAAAD,CAAA,CAAQ7/C,CAAR,CAAemL,CAAf,CAAA,EAA0BnU,CAFhC,EAAqD8oD,CAAA,EAArD,EADF,IAME30C,EAAA,CAAO40C,CAAP,CAAA,CAAoB9F,CAAA,CAAWjjD,CAAX,CAEtBY,EAAAN,KAAA,CAAW+B,CAAA,CAAQ2G,CAAR,CAAemL,CAAf,CAAX,CAX4D,CAA9D,CATN,IA0BE,IADAnU,CACI,CADEunD,CAAA/hD,IAAA,EACF,CAAO,GAAP,EAAAxF,CAAJ,CACEY,CAAA,CAAQxB,CADV,KAEO,IAAW,EAAX,EAAIY,CAAJ,CACLY,CAAA,CAAQ,IADH,KAGL,IAAIioD,CAAJ,CACE,IAAKC,CAAL,CAAkB,CAAlB,CAAqBA,CAArB,CAAkC7F,CAAAxjD,OAAlC,CAAqDqpD,CAAA,EAArD,CAEE,IADA30C,CAAA,CAAO40C,CAAP,CACI,CADgB9F,CAAA,CAAW6F,CAAX,CAChB,CAAAD,CAAA,CAAQ7/C,CAAR,CAAemL,CAAf,CAAA,EAA0BnU,CAA9B,CAAmC,CACjCY,CAAA,CAAQyB,CAAA,CAAQ2G,CAAR,CAAemL,CAAf,CACR,MAFiC,CAAnC,CAHJ,IASEA,EAAA,CAAO40C,CAAP,CAEA,CAFoB9F,CAAA,CAAWjjD,CAAX,CAEpB,CADIyoD,CACJ,GADat0C,CAAA,CAAOs0C,CAAP,CACb,CAD+BzoD,CAC/B,EAAAY,CAAA,CAAQyB,CAAA,CAAQ2G,CAAR,CAAemL,CAAf,CAIdi6B,EAAAG,cAAA,CAAmB3tC,CAAnB,CApDsB,CAAxB,CADoC,CAAtC,CAyDAwtC,EAAAM,QAAA,CAAesZ,CAGfh/C,EAAA/E,OAAA,CAAa+jD,CAAb,CAlG2C,CAxG7C,GAAKtK,CAAA,CAAM,CAAN,CAAL,CAAA,CAF0C,IAItC8J,EAAa9J,CAAA,CAAM,CAAN,CAJyB,CAKtC2I,EAAc3I,CAAA,CAAM,CAAN,CALwB,CAMtCvM,EAAW3oC,CAAA2oC,SAN2B,CAOtCuY,EAAalhD,CAAAqhD,UAPyB,CAQtCT,EAAa,CAAA,CARyB,CAStC1B,CATsC,CAYtC+B,EAAiBpjD,CAAA,CAAOlH,CAAAwO,cAAA,CAAuB,QAAvB,CAAP,CAZqB,CAatC47C,EAAkBljD,CAAA,CAAOlH,CAAAwO,cAAA,CAAuB,UAAvB,CAAP,CAboB,CActC24C,EAAgBmD,CAAAnjD,MAAA,EAGZ7F,EAAAA,CAAI,CAAZ,KAjB0C,IAiB3BwM,EAAW7G,CAAA6G,SAAA,EAjBgB,CAiBIyG,EAAKzG,CAAAxN,OAAnD,CAAoEgB,CAApE,CAAwEiT,CAAxE,CAA4EjT,CAAA,EAA5E,CACE,GAAyB,EAAzB,EAAIwM,CAAA,CAASxM,CAAT,CAAAG,MAAJ,CAA6B,CAC3B8mD,CAAA;AAAc0B,CAAd,CAA2Bn8C,CAAAgS,GAAA,CAAYxe,CAAZ,CAC3B,MAF2B,CAM/B+mD,CAAAhB,KAAA,CAAgBH,CAAhB,CAA6B+C,CAA7B,CAAyC9C,CAAzC,CAGA,IAAInV,CAAJ,GAAiB3oC,CAAAw1C,SAAjB,EAAkCx1C,CAAAshD,WAAlC,EAAoD,CAClD,IAAIC,EAAoBA,QAAQ,CAACnpD,CAAD,CAAQ,CACtCylD,CAAAzY,aAAA,CAAyB,UAAzB,CAAqC,CAACplC,CAAAw1C,SAAtC,EAAwDp9C,CAAxD,EAAiEA,CAAAnB,OAAjE,CACA,OAAOmB,EAF+B,CAKxCylD,EAAAnX,SAAA5uC,KAAA,CAA0BypD,CAA1B,CACA1D,EAAApX,YAAA5tC,QAAA,CAAgC0oD,CAAhC,CAEAvhD,EAAA0b,SAAA,CAAc,UAAd,CAA0B,QAAQ,EAAG,CACnC6lC,CAAA,CAAkB1D,CAAA/X,WAAlB,CADmC,CAArC,CATkD,CAchDob,CAAJ,CAAgB3B,CAAA,CAAQ/+C,CAAR,CAAe5C,CAAf,CAAwBigD,CAAxB,CAAhB,CACSlV,CAAJ,CAAcwW,CAAA,CAAS3+C,CAAT,CAAgB5C,CAAhB,CAAyBigD,CAAzB,CAAd,CACAiB,CAAA,CAAOt+C,CAAP,CAAc5C,CAAd,CAAuBigD,CAAvB,CAAoCmB,CAApC,CAzCL,CAF0C,CA7DvC,CALiE,CAApD,CAjtDtB,CA4oEIwC,GAAkB,CAAC,cAAD,CAAiB,QAAQ,CAACnsC,CAAD,CAAe,CAC5D,IAAIosC,EAAiB,WACR/nD,CADQ,cAELA,CAFK,CAKrB,OAAO,UACK,GADL,UAEK,GAFL,SAGI+G,QAAQ,CAAC7C,CAAD,CAAUoC,CAAV,CAAgB,CAC/B,GAAIlG,CAAA,CAAYkG,CAAA5H,MAAZ,CAAJ,CAA6B,CAC3B,IAAIqnB,EAAgBpK,CAAA,CAAazX,CAAA4hB,KAAA,EAAb,CAA6B,CAAA,CAA7B,CACfC,EAAL,EACEzf,CAAA+d,KAAA,CAAU,OAAV,CAAmBngB,CAAA4hB,KAAA,EAAnB,CAHyB,CAO7B,MAAO,SAAS,CAAChf,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CAAA,IAEjCxG,EAASoE,CAAApE,OAAA,EAFwB;AAGjCwlD,EAAaxlD,CAAAoH,KAAA,CAFI8gD,mBAEJ,CAAb1C,EACExlD,CAAAA,OAAA,EAAAoH,KAAA,CAHe8gD,mBAGf,CAEF1C,EAAJ,EAAkBA,CAAAjB,UAAlB,CAGEngD,CAAA+jB,KAAA,CAAa,UAAb,CAAyB,CAAA,CAAzB,CAHF,CAKEq9B,CALF,CAKeyC,CAGXhiC,EAAJ,CACEjf,CAAA/E,OAAA,CAAagkB,CAAb,CAA4BkiC,QAA+B,CAAC7qB,CAAD,CAASC,CAAT,CAAiB,CAC1E/2B,CAAA+d,KAAA,CAAU,OAAV,CAAmB+Y,CAAnB,CACIA,EAAJ,GAAeC,CAAf,EAAuBioB,CAAAT,aAAA,CAAwBxnB,CAAxB,CACvBioB,EAAAX,UAAA,CAAqBvnB,CAArB,CAH0E,CAA5E,CADF,CAOEkoB,CAAAX,UAAA,CAAqBr+C,CAAA5H,MAArB,CAGFwF,EAAAhD,GAAA,CAAW,UAAX,CAAuB,QAAQ,EAAG,CAChCokD,CAAAT,aAAA,CAAwBv+C,CAAA5H,MAAxB,CADgC,CAAlC,CAxBqC,CARR,CAH5B,CANqD,CAAxC,CA5oEtB,CA6rEIwpD,GAAiB/nD,EAAA,CAAQ,UACjB,GADiB,UAEjB,CAAA,CAFiB,CAAR,CA9+iBnB,EAFAgL,EAEA,CAFSnO,CAAAmO,OAET,GACEhH,CAUA,CAVSgH,EAUT,CATA5L,CAAA,CAAO4L,EAAAnI,GAAP,CAAkB,OACT8Z,EAAAhW,MADS,YAEJgW,EAAAxB,WAFI,UAGNwB,EAAArW,SAHM,eAIDqW,EAAAm+B,cAJC,CAAlB,CASA,CAFA9wC,EAAA,CAAwB,QAAxB,CAAkC,CAAA,CAAlC,CAAwC,CAAA,CAAxC,CAA8C,CAAA,CAA9C,CAEA,CADAA,EAAA,CAAwB,OAAxB,CAAiC,CAAA,CAAjC,CAAwC,CAAA,CAAxC,CAA+C,CAAA,CAA/C,CACA,CAAAA,EAAA,CAAwB,MAAxB,CAAgC,CAAA,CAAhC,CAAuC,CAAA,CAAvC,CAA8C,CAAA,CAA9C,CAXF,EAaEhG,CAbF,CAaWmH,CAEXhE,GAAApD,QAAA;AAAkBC,CAsXpBgkD,UAA2B,CAAC7gD,CAAD,CAAS,CAClC/H,CAAA,CAAO+H,CAAP,CAAgB,WACD5B,EADC,MAEN/D,EAFM,QAGJpC,CAHI,QAIJgD,EAJI,SAKH4B,CALG,SAMHxG,CANG,UAOFiJ,EAPE,MAQP5G,CARO,MASP8C,EATO,QAUJS,EAVI,UAWFI,EAXE,UAYH1D,EAZG,aAaCG,CAbD,WAcDC,CAdC,UAeF5C,CAfE,YAgBAM,CAhBA,UAiBFuC,CAjBE,UAkBFC,EAlBE,WAmBDQ,EAnBC,SAoBHrD,CApBG,UAqBFP,CArBE,SAsBH2wC,EAtBG,QAuBJttC,EAvBI,WAwBDwD,CAxBC,WAyBDynB,EAzBC,WA0BD,SAAU,CAAV,CA1BC,CAAhB,CA6BApa,GAAA,CAAgBzI,EAAA,CAAkB5L,CAAlB,CAChB,IAAI,CACFqU,EAAA,CAAc,UAAd,CADE,CAEF,MAAO/M,CAAP,CAAU,CACV+M,EAAA,CAAc,UAAd,CAA0B,EAA1B,CAAAjI,SAAA,CAAuC,SAAvC,CAAkDyoB,EAAlD,CADU,CAIZxgB,EAAA,CAAc,IAAd,CAAoB,CAAC,UAAD,CAApB,CAAkC,CAAC,UAAD,CAChC+2C,QAAiB,CAACzhD,CAAD,CAAW,CAC1BA,CAAAyC,SAAA,CAAkB,UAAlB,CAA8BkR,EAA9B,CAAAQ,UAAA,CACY,GACHy9B,EADG,OAECiC,EAFD,UAGIA,EAHJ;KAIA1B,EAJA,QAKE8K,EALF,QAMEG,EANF,OAOCmE,EAPD,QAQEJ,EARF,QASEnL,EATF,YAUMK,EAVN,gBAWUF,EAXV,SAYGO,EAZH,aAaOE,EAbP,YAcMD,EAdN,OAeCI,EAfD,SAgBGF,EAhBH,cAiBQC,EAjBR,QAkBErE,EAlBF,QAmBE6I,EAnBF,MAoBArE,EApBA,WAqBKI,EArBL,QAsBEe,EAtBF,eAuBSE,EAvBT,aAwBOC,EAxBP,UAyBIU,EAzBJ,QA0BEkC,EA1BF,SA2BGM,EA3BH,UA4BIK,EA5BJ,cA6BQa,EA7BR,iBA8BWE,EA9BX,WA+BKM,EA/BL,cAgCQL,EAhCR,SAiCGlI,EAjCH,QAkCES,EAlCF,UAmCIL,EAnCJ,UAoCIE,EApCJ,YAqCMA,EArCN,SAsCGO,EAtCH,CADZ,CAAAthC,UAAA,CAyCY09B,EAzCZ,CAAA19B,UAAA,CA0CY6iC,EA1CZ,CA2CAh3C,EAAAyC,SAAA,CAAkB,eACDiK,EADC,UAENy9B,EAFM,UAGNx4B,EAHM;cAIDE,EAJC,aAKHiQ,EALG,WAMLM,EANK,mBAOGC,EAPH,SAQP+a,EARO,cASF/T,EATE,WAULkB,EAVK,OAWTxH,EAXS,cAYFwE,EAZE,WAaLmH,EAbK,MAcVsB,EAdU,QAeR0C,EAfQ,YAgBJkC,EAhBI,IAiBZtB,EAjBY,MAkBVqH,EAlBU,cAmBFxB,EAnBE,UAoBNsC,EApBM,gBAqBAhoB,EArBA,UAsBNkpB,EAtBM,SAuBPQ,EAvBO,CAAlB,CA5C0B,CADI,CAAlC,CArCkC,CAApCqkB,CAkniBE,CAAmB7gD,EAAnB,CAEAnD,EAAA,CAAOlH,CAAP,CAAAmxC,MAAA,CAAuB,QAAQ,EAAG,CAChC3oC,EAAA,CAAYxI,CAAZ,CAAsByI,EAAtB,CADgC,CAAlC,CA1rlBqC,CAAtC,CAAA,CA8rlBE1I,MA9rlBF,CA8rlBUC,QA9rlBV,CA+rlBDqK,QAAApD,QAAA,CAAgBjH,QAAhB,CAAAkE,KAAA,CAA+B,MAA/B,CAAA6uC,QAAA,CAA+C,wLAA/C;", -"sources":["angular.js","MINERR_ASSET"], -"names":["window","document","undefined","minErr","isArrayLike","obj","isWindow","length","nodeType","isString","isArray","forEach","iterator","context","key","isFunction","hasOwnProperty","call","sortedKeys","keys","push","sort","forEachSorted","i","reverseParams","iteratorFn","value","nextUid","index","uid","digit","charCodeAt","join","String","fromCharCode","unshift","setHashKey","h","$$hashKey","extend","dst","arguments","int","str","parseInt","inherit","parent","extra","noop","identity","$","valueFn","isUndefined","isDefined","isObject","isNumber","isDate","toString","apply","isRegExp","location","alert","setInterval","isElement","node","nodeName","on","find","map","results","list","indexOf","array","arrayRemove","splice","copy","source","destination","$evalAsync","$watch","ngMinErr","Date","getTime","RegExp","shallowCopy","src","substr","equals","o1","o2","t1","t2","keySet","charAt","bind","self","fn","curryArgs","slice","startIndex","concat","toJsonReplacer","val","toJson","pretty","JSON","stringify","fromJson","json","parse","toBoolean","v","lowercase","startingTag","element","jqLite","clone","html","e","elemHtml","append","TEXT_NODE","match","replace","tryDecodeURIComponent","decodeURIComponent","parseKeyValue","keyValue","key_value","split","toKeyValue","parts","arrayValue","encodeUriQuery","encodeUriSegment","pctEncodeSpaces","encodeURIComponent","angularInit","bootstrap","elements","appElement","module","names","NG_APP_CLASS_REGEXP","name","getElementById","querySelectorAll","exec","className","attributes","attr","modules","doBootstrap","injector","tag","$provide","createInjector","invoke","scope","compile","animate","$apply","data","enabled","NG_DEFER_BOOTSTRAP","test","angular","resumeBootstrap","angular.resumeBootstrap","extraModules","snake_case","separator","SNAKE_CASE_REGEXP","letter","pos","toLowerCase","assertArg","arg","reason","assertArgFn","acceptArrayAnnotation","constructor","assertNotHasOwnProperty","getter","path","bindFnToScope","lastInstance","len","setupModuleLoader","ensure","factory","$injectorMinErr","Object","requires","configFn","invokeLater","provider","method","insertMethod","invokeQueue","moduleInstance","runBlocks","config","run","block","camelCase","SPECIAL_CHARS_REGEXP","_","offset","toUpperCase","MOZ_HACK_REGEXP","JQLitePatchJQueryRemove","dispatchThis","filterElems","getterIfNoArguments","removePatch","param","filter","fireEvent","set","setIndex","setLength","childIndex","children","shift","triggerHandler","childLength","jQuery","originalJqFn","$original","JQLite","jqLiteMinErr","div","createElement","innerHTML","removeChild","firstChild","JQLiteAddNodes","childNodes","fragment","createDocumentFragment","JQLiteClone","cloneNode","JQLiteDealoc","JQLiteRemoveData","JQLiteOff","type","unsupported","events","JQLiteExpandoStore","handle","eventHandler","removeEventListenerFn","expandoId","jqName","expandoStore","jqCache","$destroy","jqId","JQLiteData","isSetter","keyDefined","isSimpleGetter","JQLiteHasClass","selector","getAttribute","JQLiteRemoveClass","cssClasses","setAttribute","cssClass","trim","JQLiteAddClass","existingClasses","root","JQLiteController","JQLiteInheritedData","getBooleanAttrName","booleanAttr","BOOLEAN_ATTR","BOOLEAN_ELEMENTS","createEventHandler","event","preventDefault","event.preventDefault","returnValue","stopPropagation","event.stopPropagation","cancelBubble","target","srcElement","defaultPrevented","prevent","isDefaultPrevented","event.isDefaultPrevented","msie","elem","hashKey","objType","HashMap","put","annotate","$inject","fnText","STRIP_COMMENTS","argDecl","FN_ARGS","FN_ARG_SPLIT","FN_ARG","all","underscore","last","modulesToLoad","supportObject","delegate","provider_","providerInjector","instantiate","$get","providerCache","providerSuffix","factoryFn","loadModules","loadedModules","get","moduleFn","angularModule","_runBlocks","_invokeQueue","ii","invokeArgs","message","stack","createInternalInjector","cache","getService","serviceName","INSTANTIATING","locals","args","Type","Constructor","returnedValue","prototype","instance","has","service","$injector","constant","instanceCache","decorator","decorFn","origProvider","orig$get","origProvider.$get","origInstance","instanceInjector","servicename","$AnchorScrollProvider","autoScrollingEnabled","disableAutoScrolling","this.disableAutoScrolling","$window","$location","$rootScope","getFirstAnchor","result","scroll","hash","elm","scrollIntoView","getElementsByName","scrollTo","autoScrollWatch","autoScrollWatchAction","Browser","$log","$sniffer","completeOutstandingRequest","outstandingRequestCount","outstandingRequestCallbacks","pop","error","startPoller","interval","setTimeout","check","pollFns","pollFn","pollTimeout","fireUrlChange","newLocation","lastBrowserUrl","url","urlChangeListeners","listener","rawDocument","history","clearTimeout","pendingDeferIds","isMock","$$completeOutstandingRequest","$$incOutstandingRequestCount","self.$$incOutstandingRequestCount","notifyWhenNoOutstandingRequests","self.notifyWhenNoOutstandingRequests","callback","addPollFn","self.addPollFn","href","baseElement","self.url","replaceState","pushState","urlChangeInit","onUrlChange","self.onUrlChange","hashchange","baseHref","self.baseHref","lastCookies","lastCookieString","cookiePath","cookies","self.cookies","cookieLength","cookie","escape","warn","cookieArray","unescape","substring","defer","self.defer","delay","timeoutId","cancel","self.defer.cancel","deferId","$BrowserProvider","$document","$CacheFactoryProvider","this.$get","cacheFactory","cacheId","options","refresh","entry","freshEnd","staleEnd","n","link","p","nextEntry","prevEntry","caches","size","stats","capacity","Number","MAX_VALUE","lruHash","lruEntry","remove","removeAll","destroy","info","cacheFactory.info","cacheFactory.get","$TemplateCacheProvider","$cacheFactory","$CompileProvider","hasDirectives","Suffix","COMMENT_DIRECTIVE_REGEXP","CLASS_DIRECTIVE_REGEXP","aHrefSanitizationWhitelist","imgSrcSanitizationWhitelist","EVENT_HANDLER_ATTR_REGEXP","directive","this.directive","registerDirective","directiveFactory","$exceptionHandler","directives","priority","require","controller","restrict","this.aHrefSanitizationWhitelist","regexp","this.imgSrcSanitizationWhitelist","$interpolate","$http","$templateCache","$parse","$controller","$sce","$animate","$compileNodes","transcludeFn","maxPriority","ignoreDirective","previousCompileContext","nodeValue","wrap","compositeLinkFn","compileNodes","publicLinkFn","cloneConnectFn","$linkNode","JQLitePrototype","eq","safeAddClass","$element","addClass","nodeList","$rootElement","boundTranscludeFn","childLinkFn","childScope","childTranscludeFn","stableNodeList","linkFns","nodeLinkFn","$new","transclude","cloneFn","transcludeScope","$$transcluded","attrs","linkFnFound","Attributes","collectDirectives","applyDirectivesToNode","terminal","attrsMap","$attr","addDirective","directiveNormalize","nodeName_","nName","nAttrs","j","jj","attrStartName","attrEndName","specified","ngAttrName","NG_ATTR_BINDING","directiveNName","addAttrInterpolateDirective","addTextInterpolateDirective","byPriority","groupScan","attrStart","attrEnd","nodes","depth","hasAttribute","$compileMinErr","nextSibling","groupElementsLinkFnWrapper","linkFn","controllers","compileNode","templateAttrs","jqCollection","originalReplaceDirective","preLinkFns","postLinkFns","addLinkFns","pre","post","getControllers","retrievalMethod","optional","$$controller","directiveName","linkNode","$$element","newIsolateScopeDirective","LOCAL_REGEXP","parentScope","$parent","definition","scopeName","attrName","mode","lastValue","parentGet","parentSet","$$isolateBindings","$observe","$$observers","$$scope","assign","parentValueWatch","parentValue","controllerDirectives","controllerInstance","controllerAs","$scope","terminalPriority","newScopeDirective","templateDirective","$compileNode","$template","transcludeDirective","$$start","$$end","directiveValue","templateUrl","assertNoDuplicate","createComment","replaceWith","replaceDirective","contents","template","denormalizeTemplate","newTemplateAttrs","mergeTemplateAttributes","compileTemplateUrl","Math","max","tDirectives","startAttrName","endAttrName","srcAttr","dstAttr","$set","tAttrs","linkQueue","afterTemplateNodeLinkFn","afterTemplateChildLinkFn","beforeTemplateCompileNode","origAsyncDirective","derivedSyncDirective","getTrustedResourceUrl","success","content","tempTemplateAttrs","beforeTemplateLinkNode","linkRootElement","response","code","headers","delayedNodeLinkFn","ignoreChildLinkFn","rootElement","a","b","diff","what","previousDirective","text","interpolateFn","textInterpolateLinkFn","bindings","interpolateFnWatchAction","getTrustedContext","attrNormalizedName","RESOURCE_URL","attrInterpolateLinkFn","$$inter","elementsToRemove","newNode","firstElementToRemove","removeCount","parentNode","j2","replaceChild","appendChild","expando","k","kk","$addClass","classVal","$removeClass","removeClass","writeAttr","tokenDifference","str1","str2","values","tokens1","tokens2","token","current","booleanKey","prop","normalizedVal","urlResolve","removeAttr","listeners","startSymbol","endSymbol","PREFIX_REGEXP","$ControllerProvider","CNTRL_REG","register","this.register","expression","identifier","$DocumentProvider","$ExceptionHandlerProvider","exception","cause","parseHeaders","parsed","line","headersGetter","headersObj","transformData","fns","$HttpProvider","JSON_START","JSON_END","PROTECTION_PREFIX","CONTENT_TYPE_APPLICATION_JSON","defaults","d","interceptorFactories","interceptors","responseInterceptorFactories","responseInterceptors","$httpBackend","$browser","$q","requestConfig","transformResponse","resp","status","reject","transformRequest","mergeHeaders","execHeaders","headerContent","headerFn","header","defHeaders","reqHeaders","defHeaderName","reqHeaderName","common","lowercaseDefHeaderName","uppercase","xsrfValue","urlIsSameOrigin","xsrfCookieName","xsrfHeaderName","chain","serverRequest","reqData","withCredentials","sendReq","then","promise","when","reversedInterceptors","interceptor","request","requestError","responseError","thenFn","rejectFn","promise.success","promise.error","done","headersString","resolvePromise","$$phase","deferred","resolve","removePendingReq","idx","pendingRequests","cachedResp","buildUrl","params","defaultCache","timeout","responseType","interceptorFactory","responseFn","createShortMethods","createShortMethodsWithData","$HttpBackendProvider","createHttpBackend","XHR","callbacks","protocol","$browserDefer","locationProtocol","jsonpReq","script","doneWrapper","body","onreadystatechange","script.onreadystatechange","readyState","onload","onerror","timeoutRequest","jsonpDone","xhr","abort","completeRequest","callbackId","counter","open","setRequestHeader","xhr.onreadystatechange","responseHeaders","getAllResponseHeaders","responseText","send","$InterpolateProvider","this.startSymbol","this.endSymbol","mustHaveExpression","trustedContext","endIndex","hasInterpolation","startSymbolLength","exp","endSymbolLength","$interpolateMinErr","part","getTrusted","valueOf","err","newErr","$interpolate.startSymbol","$interpolate.endSymbol","$IntervalProvider","count","invokeApply","clearInterval","iteration","skipApply","$$intervalId","tick","notify","intervals","interval.cancel","$LocaleProvider","short","pluralCat","num","encodePath","segments","parseAbsoluteUrl","absoluteUrl","locationObj","parsedUrl","$$protocol","$$host","hostname","$$port","port","DEFAULT_PORTS","parseAppUrl","relativeUrl","prefixed","$$path","pathname","$$search","search","$$hash","beginsWith","begin","whole","stripHash","stripFile","lastIndexOf","LocationHtml5Url","appBase","basePrefix","$$html5","appBaseNoFile","$$parse","this.$$parse","pathUrl","$locationMinErr","$$compose","this.$$compose","$$url","$$absUrl","$$rewrite","this.$$rewrite","appUrl","prevAppUrl","LocationHashbangUrl","hashPrefix","withoutBaseUrl","withoutHashUrl","LocationHashbangInHtml5Url","locationGetter","property","locationGetterSetter","preprocess","$LocationProvider","html5Mode","this.hashPrefix","prefix","this.html5Mode","afterLocationChange","oldUrl","$broadcast","absUrl","initialUrl","LocationMode","ctrlKey","metaKey","which","absHref","rewrittenUrl","newUrl","$digest","changeCounter","$locationWatch","currentReplace","$$replace","$LogProvider","debug","debugEnabled","this.debugEnabled","flag","formatError","Error","sourceURL","consoleLog","console","logFn","log","arg1","arg2","ensureSafeMemberName","fullExpression","$parseMinErr","ensureSafeObject","setter","setValue","fullExp","propertyObj","unwrapPromises","promiseWarning","$$v","cspSafeGetterFn","key0","key1","key2","key3","key4","cspSafePromiseEnabledGetter","pathVal","cspSafeGetter","getterFn","getterFnCache","pathKeys","pathKeysLength","csp","evaledFnGetter","Function","evaledFnGetter.toString","$ParseProvider","$parseOptions","this.unwrapPromises","logPromiseWarnings","this.logPromiseWarnings","$filter","promiseWarningCache","parsedExpression","lexer","Lexer","parser","Parser","$QProvider","qFactory","nextTick","exceptionHandler","defaultCallback","defaultErrback","pending","ref","progress","errback","progressback","wrappedCallback","wrappedErrback","wrappedProgressback","catch","finally","makePromise","resolved","handleCallback","isResolved","callbackOutput","promises","$RootScopeProvider","TTL","$rootScopeMinErr","digestTtl","this.digestTtl","Scope","$id","$$watchers","$$nextSibling","$$prevSibling","$$childHead","$$childTail","$root","$$destroyed","$$asyncQueue","$$postDigestQueue","$$listeners","beginPhase","phase","compileToFn","initWatchVal","isolate","child","Child","watchExp","objectEquality","watcher","listenFn","watcher.fn","newVal","oldVal","originalFn","$watchCollection","oldValue","newValue","changeDetected","objGetter","internalArray","internalObject","oldLength","$watchCollectionWatch","newLength","$watchCollectionAction","watch","watchers","asyncQueue","postDigestQueue","dirty","ttl","watchLog","logIdx","logMsg","asyncTask","$eval","isNaN","next","expr","$$postDigest","$on","namedListeners","$emit","empty","listenerArgs","array1","currentScope","adjustMatcher","matcher","$sceMinErr","adjustMatchers","matchers","adjustedMatchers","$SceDelegateProvider","SCE_CONTEXTS","resourceUrlWhitelist","resourceUrlBlacklist","this.resourceUrlWhitelist","this.resourceUrlBlacklist","generateHolderType","base","holderType","trustedValue","$$unwrapTrustedValue","this.$$unwrapTrustedValue","holderType.prototype.valueOf","holderType.prototype.toString","htmlSanitizer","trustedValueHolderBase","byType","HTML","CSS","URL","JS","trustAs","maybeTrusted","allowed","$SceProvider","this.enabled","$sceDelegate","documentMode","sce","isEnabled","sce.isEnabled","sce.getTrusted","parseAs","sce.parseAs","literal","sceParseAsTrusted","enumValue","lName","$SnifferProvider","eventSupport","android","userAgent","navigator","boxee","vendorPrefix","vendorRegex","bodyStyle","style","transitions","animations","webkitTransition","webkitAnimation","hasEvent","divElm","securityPolicy","isActive","$TimeoutProvider","deferreds","$$timeoutId","timeout.cancel","urlParsingNode","host","requestUrl","originUrl","$WindowProvider","$FilterProvider","filters","suffix","currencyFilter","dateFilter","filterFilter","jsonFilter","limitToFilter","lowercaseFilter","numberFilter","orderByFilter","uppercaseFilter","comperator","predicates","predicates.check","objKey","filtered","$locale","formats","NUMBER_FORMATS","amount","currencySymbol","CURRENCY_SYM","formatNumber","PATTERNS","GROUP_SEP","DECIMAL_SEP","number","fractionSize","pattern","groupSep","decimalSep","isFinite","isNegative","abs","numStr","formatedText","hasExponent","toFixed","fractionLen","min","minFrac","maxFrac","pow","round","fraction","lgroup","lgSize","group","gSize","negPre","posPre","negSuf","posSuf","padNumber","digits","neg","dateGetter","date","dateStrGetter","shortForm","jsonStringToDate","string","R_ISO8601_STR","tzHour","tzMin","dateSetter","setUTCFullYear","setFullYear","timeSetter","setUTCHours","setHours","m","s","ms","parseFloat","format","DATETIME_FORMATS","NUMBER_STRING","DATE_FORMATS_SPLIT","DATE_FORMATS","object","input","limit","out","sortPredicate","reverseOrder","reverseComparator","comp","descending","predicate","v1","v2","arrayCopy","comparator","ngDirective","FormController","toggleValidCss","isValid","validationErrorKey","INVALID_CLASS","VALID_CLASS","form","parentForm","nullFormCtrl","invalidCount","errors","$error","controls","$name","ngForm","$dirty","$pristine","$valid","$invalid","$addControl","PRISTINE_CLASS","form.$addControl","control","$removeControl","form.$removeControl","queue","validationToken","$setValidity","form.$setValidity","$setDirty","form.$setDirty","DIRTY_CLASS","$setPristine","form.$setPristine","textInputType","ctrl","ngTrim","$viewValue","$setViewValue","deferListener","keyCode","$render","ctrl.$render","$isEmpty","ngPattern","validate","patternValidator","patternObj","$formatters","$parsers","ngMinlength","minlength","minLengthValidator","ngMaxlength","maxlength","maxLengthValidator","classDirective","ngClassWatchAction","$index","flattenClasses","classes","old$index","mod","version","addEventListenerFn","addEventListener","attachEvent","removeEventListener","detachEvent","ready","trigger","fired","removeAttribute","css","currentStyle","lowercasedName","getNamedItem","ret","getText","textProp","NODE_TYPE_TEXT_PROPERTY","$dv","multiple","option","selected","onFn","eventFns","contains","compareDocumentPosition","adown","documentElement","bup","eventmap","related","relatedTarget","replaceNode","insertBefore","prepend","wrapNode","after","newElement","toggleClass","condition","nextElementSibling","getElementsByTagName","eventName","eventData","arg3","unbind","off","$animateMinErr","$AnimateProvider","$$selectors","$timeout","enter","afterNode","afterNextSibling","leave","move","XMLHttpRequest","ActiveXObject","e1","e2","e3","PATH_MATCH","paramValue","OPERATORS","null","true","false","+","-","*","/","%","^","===","!==","==","!=","<",">","<=",">=","&&","||","&","|","!","ESCAPE","lex","ch","lastCh","tokens","is","readString","peek","readNumber","isIdent","readIdent","was","isWhitespace","ch2","ch3","fn2","fn3","throwError","chars","isExpOperator","start","end","colStr","peekCh","ident","lastDot","peekIndex","methodName","quote","rawString","hex","rep","ZERO","Parser.ZERO","assignment","logicalOR","functionCall","fieldAccess","objectIndex","filterChain","this.filterChain","primary","statements","expect","consume","arrayDeclaration","msg","peekToken","e4","t","unaryFn","right","ternaryFn","left","middle","binaryFn","statement","argsFn","fnInvoke","ternary","logicalAND","equality","relational","additive","multiplicative","unary","field","indexFn","o","safe","contextGetter","fnPtr","elementFns","allConstant","elementFn","keyValues","ampmGetter","getHours","AMPMS","timeZoneGetter","zone","getTimezoneOffset","paddedZone","htmlAnchorDirective","ngAttributeAliasDirectives","propName","normalized","ngBooleanAttrWatchAction","formDirectiveFactory","isNgForm","formDirective","formElement","action","preventDefaultListener","parentFormCtrl","alias","ngFormDirective","URL_REGEXP","EMAIL_REGEXP","NUMBER_REGEXP","inputType","numberInputType","minValidator","maxValidator","urlInputType","urlValidator","emailInputType","emailValidator","radioInputType","checked","checkboxInputType","trueValue","ngTrueValue","falseValue","ngFalseValue","ctrl.$isEmpty","inputDirective","NgModelController","$modelValue","NaN","$viewChangeListeners","ngModelGet","ngModel","ngModelSet","this.$isEmpty","inheritedData","this.$setValidity","this.$setPristine","this.$setViewValue","ngModelWatch","formatters","ngModelDirective","ctrls","modelCtrl","formCtrl","ngChangeDirective","ngChange","requiredDirective","required","validator","ngListDirective","ngList","viewValue","CONSTANT_VALUE_REGEXP","ngValueDirective","tpl","tplAttr","ngValue","ngValueConstantLink","ngValueLink","valueWatchAction","ngBindDirective","ngBind","ngBindWatchAction","ngBindTemplateDirective","ngBindTemplate","ngBindHtmlDirective","ngBindHtml","getStringValue","ngBindHtmlWatchAction","getTrustedHtml","ngClassDirective","ngClassOddDirective","ngClassEvenDirective","ngCloakDirective","ngControllerDirective","ngCspDirective","ngEventDirectives","ngIfDirective","childElement","ngIf","ngIfWatchAction","ngIncludeDirective","$anchorScroll","$compile","transclusion","srcExp","ngInclude","onloadExp","autoScrollExp","autoscroll","currentElement","cleanupLastIncludeContent","parseAsResourceUrl","ngIncludeWatchAction","thisChangeId","newScope","ngInitDirective","ngInit","ngNonBindableDirective","ngPluralizeDirective","BRACE","numberExp","whenExp","whens","whensExpFns","isWhen","attributeName","ngPluralizeWatch","ngPluralizeWatchAction","ngRepeatDirective","getBlockElements","startNode","endNode","ngRepeatMinErr","linker","ngRepeat","trackByExpGetter","trackByIdExpFn","trackByIdArrayFn","trackByIdObjFn","rhs","valueIdentifier","keyIdentifier","hashFnLocals","lhs","trackByExp","lastBlockMap","ngRepeatAction","collection","previousNode","nextNode","nextBlockMap","arrayLength","collectionKeys","nextBlockOrder","trackByIdFn","trackById","id","$first","$last","$middle","$odd","$even","ngShowDirective","ngShow","ngShowWatchAction","ngHideDirective","ngHide","ngHideWatchAction","ngStyleDirective","ngStyle","ngStyleWatchAction","newStyles","oldStyles","ngSwitchDirective","ngSwitchController","cases","selectedTranscludes","selectedElements","selectedScopes","ngSwitch","ngSwitchWatchAction","change","selectedTransclude","selectedScope","caseElement","anchor","ngSwitchWhenDirective","ngSwitchWhen","ngSwitchDefaultDirective","ngTranscludeDirective","$transclude","$attrs","scriptDirective","ngOptionsMinErr","ngOptionsDirective","selectDirective","NG_OPTIONS_REGEXP","nullModelCtrl","optionsMap","ngModelCtrl","unknownOption","databound","init","self.init","ngModelCtrl_","nullOption_","unknownOption_","addOption","self.addOption","removeOption","self.removeOption","hasOption","renderUnknownOption","self.renderUnknownOption","unknownVal","self.hasOption","Single","selectElement","selectCtrl","ngModelCtrl.$render","emptyOption","Multiple","lastView","items","selectMultipleWatch","Options","render","optionGroups","optionGroupNames","optionGroupName","optionGroup","existingParent","existingOptions","modelValue","valuesFn","keyName","groupIndex","selectedSet","lastElement","trackFn","trackIndex","valueName","groupByFn","modelCast","label","displayFn","nullOption","groupLength","optionGroupsCache","optGroupTemplate","existingOption","optionTemplate","optionsExp","track","optionElement","ngOptions","ngRequired","requiredValidator","optionDirective","nullSelectCtrl","selectCtrlName","interpolateWatchAction","styleDirective","publishExternalAPI","ngModule"] -} diff --git a/setup/pub/bootstrap/js/bootstrap.js b/setup/pub/bootstrap/js/bootstrap.js deleted file mode 100644 index 8ae571b6da5b..000000000000 --- a/setup/pub/bootstrap/js/bootstrap.js +++ /dev/null @@ -1,1951 +0,0 @@ -/*! - * Bootstrap v3.1.1 (http://getbootstrap.com) - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ - -if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') } - -/* ======================================================================== - * Bootstrap: transition.js v3.1.1 - * http://getbootstrap.com/javascript/#transitions - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) - // ============================================================ - - function transitionEnd() { - var el = document.createElement('bootstrap') - - var transEndEventNames = { - 'WebkitTransition' : 'webkitTransitionEnd', - 'MozTransition' : 'transitionend', - 'OTransition' : 'oTransitionEnd otransitionend', - 'transition' : 'transitionend' - } - - for (var name in transEndEventNames) { - if (el.style[name] !== undefined) { - return { end: transEndEventNames[name] } - } - } - - return false // explicit for ie8 ( ._.) - } - - // http://blog.alexmaccaw.com/css-transitions - $.fn.emulateTransitionEnd = function (duration) { - var called = false, $el = this - $(this).one($.support.transition.end, function () { called = true }) - var callback = function () { if (!called) $($el).trigger($.support.transition.end) } - setTimeout(callback, duration) - return this - } - - $(function () { - $.support.transition = transitionEnd() - }) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: alert.js v3.1.1 - * http://getbootstrap.com/javascript/#alerts - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // ALERT CLASS DEFINITION - // ====================== - - var dismiss = '[data-dismiss="alert"]' - var Alert = function (el) { - $(el).on('click', dismiss, this.close) - } - - Alert.prototype.close = function (e) { - var $this = $(this) - var selector = $this.attr('data-target') - - if (!selector) { - selector = $this.attr('href') - selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 - } - - var $parent = $(selector) - - if (e) e.preventDefault() - - if (!$parent.length) { - $parent = $this.hasClass('alert') ? $this : $this.parent() - } - - $parent.trigger(e = $.Event('close.bs.alert')) - - if (e.isDefaultPrevented()) return - - $parent.removeClass('in') - - function removeElement() { - $parent.trigger('closed.bs.alert').remove() - } - - $.support.transition && $parent.hasClass('fade') ? - $parent - .one($.support.transition.end, removeElement) - .emulateTransitionEnd(150) : - removeElement() - } - - - // ALERT PLUGIN DEFINITION - // ======================= - - var old = $.fn.alert - - $.fn.alert = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.alert') - - if (!data) $this.data('bs.alert', (data = new Alert(this))) - if (typeof option == 'string') data[option].call($this) - }) - } - - $.fn.alert.Constructor = Alert - - - // ALERT NO CONFLICT - // ================= - - $.fn.alert.noConflict = function () { - $.fn.alert = old - return this - } - - - // ALERT DATA-API - // ============== - - $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: button.js v3.1.1 - * http://getbootstrap.com/javascript/#buttons - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // BUTTON PUBLIC CLASS DEFINITION - // ============================== - - var Button = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, Button.DEFAULTS, options) - this.isLoading = false - } - - Button.DEFAULTS = { - loadingText: 'loading...' - } - - Button.prototype.setState = function (state) { - var d = 'disabled' - var $el = this.$element - var val = $el.is('input') ? 'val' : 'html' - var data = $el.data() - - state = state + 'Text' - - if (!data.resetText) $el.data('resetText', $el[val]()) - - $el[val](data[state] || this.options[state]) - - // push to event loop to allow forms to submit - setTimeout($.proxy(function () { - if (state == 'loadingText') { - this.isLoading = true - $el.addClass(d).attr(d, d) - } else if (this.isLoading) { - this.isLoading = false - $el.removeClass(d).removeAttr(d) - } - }, this), 0) - } - - Button.prototype.toggle = function () { - var changed = true - var $parent = this.$element.closest('[data-toggle="buttons"]') - - if ($parent.length) { - var $input = this.$element.find('input') - if ($input.prop('type') == 'radio') { - if ($input.prop('checked') && this.$element.hasClass('active')) changed = false - else $parent.find('.active').removeClass('active') - } - if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') - } - - if (changed) this.$element.toggleClass('active') - } - - - // BUTTON PLUGIN DEFINITION - // ======================== - - var old = $.fn.button - - $.fn.button = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.button') - var options = typeof option == 'object' && option - - if (!data) $this.data('bs.button', (data = new Button(this, options))) - - if (option == 'toggle') data.toggle() - else if (option) data.setState(option) - }) - } - - $.fn.button.Constructor = Button - - - // BUTTON NO CONFLICT - // ================== - - $.fn.button.noConflict = function () { - $.fn.button = old - return this - } - - - // BUTTON DATA-API - // =============== - - $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { - var $btn = $(e.target) - if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') - $btn.button('toggle') - e.preventDefault() - }) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: carousel.js v3.1.1 - * http://getbootstrap.com/javascript/#carousel - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // CAROUSEL CLASS DEFINITION - // ========================= - - var Carousel = function (element, options) { - this.$element = $(element) - this.$indicators = this.$element.find('.carousel-indicators') - this.options = options - this.paused = - this.sliding = - this.interval = - this.$active = - this.$items = null - - this.options.pause == 'hover' && this.$element - .on('mouseenter', $.proxy(this.pause, this)) - .on('mouseleave', $.proxy(this.cycle, this)) - } - - Carousel.DEFAULTS = { - interval: 5000, - pause: 'hover', - wrap: true - } - - Carousel.prototype.cycle = function (e) { - e || (this.paused = false) - - this.interval && clearInterval(this.interval) - - this.options.interval - && !this.paused - && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) - - return this - } - - Carousel.prototype.getActiveIndex = function () { - this.$active = this.$element.find('.item.active') - this.$items = this.$active.parent().children() - - return this.$items.index(this.$active) - } - - Carousel.prototype.to = function (pos) { - var that = this - var activeIndex = this.getActiveIndex() - - if (pos > (this.$items.length - 1) || pos < 0) return - - if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) - if (activeIndex == pos) return this.pause().cycle() - - return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) - } - - Carousel.prototype.pause = function (e) { - e || (this.paused = true) - - if (this.$element.find('.next, .prev').length && $.support.transition) { - this.$element.trigger($.support.transition.end) - this.cycle(true) - } - - this.interval = clearInterval(this.interval) - - return this - } - - Carousel.prototype.next = function () { - if (this.sliding) return - return this.slide('next') - } - - Carousel.prototype.prev = function () { - if (this.sliding) return - return this.slide('prev') - } - - Carousel.prototype.slide = function (type, next) { - var $active = this.$element.find('.item.active') - var $next = next || $active[type]() - var isCycling = this.interval - var direction = type == 'next' ? 'left' : 'right' - var fallback = type == 'next' ? 'first' : 'last' - var that = this - - if (!$next.length) { - if (!this.options.wrap) return - $next = this.$element.find('.item')[fallback]() - } - - if ($next.hasClass('active')) return this.sliding = false - - var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) - this.$element.trigger(e) - if (e.isDefaultPrevented()) return - - this.sliding = true - - isCycling && this.pause() - - if (this.$indicators.length) { - this.$indicators.find('.active').removeClass('active') - this.$element.one('slid.bs.carousel', function () { - var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) - $nextIndicator && $nextIndicator.addClass('active') - }) - } - - if ($.support.transition && this.$element.hasClass('slide')) { - $next.addClass(type) - $next[0].offsetWidth // force reflow - $active.addClass(direction) - $next.addClass(direction) - $active - .one($.support.transition.end, function () { - $next.removeClass([type, direction].join(' ')).addClass('active') - $active.removeClass(['active', direction].join(' ')) - that.sliding = false - setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0) - }) - .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000) - } else { - $active.removeClass('active') - $next.addClass('active') - this.sliding = false - this.$element.trigger('slid.bs.carousel') - } - - isCycling && this.cycle() - - return this - } - - - // CAROUSEL PLUGIN DEFINITION - // ========================== - - var old = $.fn.carousel - - $.fn.carousel = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.carousel') - var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) - var action = typeof option == 'string' ? option : options.slide - - if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) - if (typeof option == 'number') data.to(option) - else if (action) data[action]() - else if (options.interval) data.pause().cycle() - }) - } - - $.fn.carousel.Constructor = Carousel - - - // CAROUSEL NO CONFLICT - // ==================== - - $.fn.carousel.noConflict = function () { - $.fn.carousel = old - return this - } - - - // CAROUSEL DATA-API - // ================= - - $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { - var $this = $(this), href - var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 - var options = $.extend({}, $target.data(), $this.data()) - var slideIndex = $this.attr('data-slide-to') - if (slideIndex) options.interval = false - - $target.carousel(options) - - if (slideIndex = $this.attr('data-slide-to')) { - $target.data('bs.carousel').to(slideIndex) - } - - e.preventDefault() - }) - - $(window).on('load', function () { - $('[data-ride="carousel"]').each(function () { - var $carousel = $(this) - $carousel.carousel($carousel.data()) - }) - }) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: collapse.js v3.1.1 - * http://getbootstrap.com/javascript/#collapse - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // COLLAPSE PUBLIC CLASS DEFINITION - // ================================ - - var Collapse = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, Collapse.DEFAULTS, options) - this.transitioning = null - - if (this.options.parent) this.$parent = $(this.options.parent) - if (this.options.toggle) this.toggle() - } - - Collapse.DEFAULTS = { - toggle: true - } - - Collapse.prototype.dimension = function () { - var hasWidth = this.$element.hasClass('width') - return hasWidth ? 'width' : 'height' - } - - Collapse.prototype.show = function () { - if (this.transitioning || this.$element.hasClass('in')) return - - var startEvent = $.Event('show.bs.collapse') - this.$element.trigger(startEvent) - if (startEvent.isDefaultPrevented()) return - - var actives = this.$parent && this.$parent.find('> .panel > .in') - - if (actives && actives.length) { - var hasData = actives.data('bs.collapse') - if (hasData && hasData.transitioning) return - actives.collapse('hide') - hasData || actives.data('bs.collapse', null) - } - - var dimension = this.dimension() - - this.$element - .removeClass('collapse') - .addClass('collapsing') - [dimension](0) - - this.transitioning = 1 - - var complete = function () { - this.$element - .removeClass('collapsing') - .addClass('collapse in') - [dimension]('auto') - this.transitioning = 0 - this.$element.trigger('shown.bs.collapse') - } - - if (!$.support.transition) return complete.call(this) - - var scrollSize = $.camelCase(['scroll', dimension].join('-')) - - this.$element - .one($.support.transition.end, $.proxy(complete, this)) - .emulateTransitionEnd(350) - [dimension](this.$element[0][scrollSize]) - } - - Collapse.prototype.hide = function () { - if (this.transitioning || !this.$element.hasClass('in')) return - - var startEvent = $.Event('hide.bs.collapse') - this.$element.trigger(startEvent) - if (startEvent.isDefaultPrevented()) return - - var dimension = this.dimension() - - this.$element - [dimension](this.$element[dimension]()) - [0].offsetHeight - - this.$element - .addClass('collapsing') - .removeClass('collapse') - .removeClass('in') - - this.transitioning = 1 - - var complete = function () { - this.transitioning = 0 - this.$element - .trigger('hidden.bs.collapse') - .removeClass('collapsing') - .addClass('collapse') - } - - if (!$.support.transition) return complete.call(this) - - this.$element - [dimension](0) - .one($.support.transition.end, $.proxy(complete, this)) - .emulateTransitionEnd(350) - } - - Collapse.prototype.toggle = function () { - this[this.$element.hasClass('in') ? 'hide' : 'show']() - } - - - // COLLAPSE PLUGIN DEFINITION - // ========================== - - var old = $.fn.collapse - - $.fn.collapse = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.collapse') - var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) - - if (!data && options.toggle && option == 'show') option = !option - if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.collapse.Constructor = Collapse - - - // COLLAPSE NO CONFLICT - // ==================== - - $.fn.collapse.noConflict = function () { - $.fn.collapse = old - return this - } - - - // COLLAPSE DATA-API - // ================= - - $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { - var $this = $(this), href - var target = $this.attr('data-target') - || e.preventDefault() - || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 - var $target = $(target) - var data = $target.data('bs.collapse') - var option = data ? 'toggle' : $this.data() - var parent = $this.attr('data-parent') - var $parent = parent && $(parent) - - if (!data || !data.transitioning) { - if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') - $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') - } - - $target.collapse(option) - }) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: dropdown.js v3.1.1 - * http://getbootstrap.com/javascript/#dropdowns - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // DROPDOWN CLASS DEFINITION - // ========================= - - var backdrop = '.dropdown-backdrop' - var toggle = '[data-toggle=dropdown]' - var Dropdown = function (element) { - $(element).on('click.bs.dropdown', this.toggle) - } - - Dropdown.prototype.toggle = function (e) { - var $this = $(this) - - if ($this.is('.disabled, :disabled')) return - - var $parent = getParent($this) - var isActive = $parent.hasClass('open') - - clearMenus() - - if (!isActive) { - if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { - // if mobile we use a backdrop because click events don't delegate - $('